@treasuredata/tdx 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.d.ts +16 -1
- package/dist/client/cdp-api-client.d.ts.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/cdp-api-client.js.map +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/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.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.d.ts +6 -6
- package/dist/commands/segment-pull-command.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +1 -1
- package/dist/commands/segment-push-command.d.ts +6 -6
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.d.ts +2 -2
- package/dist/commands/segments.d.ts.map +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/segments.js.map +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +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/job.js +1 -1
- package/dist/sdk/journey.d.ts +16 -1
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +11 -2
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +218 -46
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +46 -0
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.d.ts +110 -0
- package/dist/utils/journey-utils.d.ts.map +1 -0
- package/dist/utils/journey-utils.js +1 -0
- package/dist/utils/journey-utils.js.map +1 -0
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.d.ts +9 -8
- package/dist/utils/tree-formatter.d.ts.map +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/tree-formatter.js.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x312a95=a26_0x229e;(function(_0x1a063b,_0x506ab1){const _0x25766a=a26_0x229e,_0x2bb6e9=_0x1a063b();while(!![]){try{const _0x3cf05b=parseInt(_0x25766a(0x219))/0x1*(-parseInt(_0x25766a(0x194))/0x2)+parseInt(_0x25766a(0x23f))/0x3*(-parseInt(_0x25766a(0x250))/0x4)+-parseInt(_0x25766a(0x1bc))/0x5+-parseInt(_0x25766a(0x222))/0x6+parseInt(_0x25766a(0x1ef))/0x7+-parseInt(_0x25766a(0x19a))/0x8*(parseInt(_0x25766a(0x1d3))/0x9)+parseInt(_0x25766a(0x217))/0xa*(parseInt(_0x25766a(0x253))/0xb);if(_0x3cf05b===_0x506ab1)break;else _0x2bb6e9['push'](_0x2bb6e9['shift']());}catch(_0x53d827){_0x2bb6e9['push'](_0x2bb6e9['shift']());}}}(a26_0x1dac,0x626f1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a26_0xcd1495 from'node:fs';function handleSDKError(_0x2a1b10,_0x213a56){const _0x27b7c4=a26_0x229e;if(_0x2a1b10 instanceof SDKError)console['error'](_0x27b7c4(0x19c)+_0x2a1b10[_0x27b7c4(0x1ab)]),_0x213a56[_0x27b7c4(0x1d0)]&&(_0x2a1b10[_0x27b7c4(0x1c0)]&&console[_0x27b7c4(0x190)](_0x27b7c4(0x1a4)+_0x2a1b10['cause']),_0x2a1b10['stack']&&(console['error'](_0x27b7c4(0x22f)),console[_0x27b7c4(0x190)](_0x2a1b10[_0x27b7c4(0x246)])));else throw _0x2a1b10;}function formatChatHistoryEntry(_0x54270a,_0x4a6a20){const _0x59235f=a26_0x229e,_0x192ca9=getChalk(_0x4a6a20),_0x8274ae=_0x192ca9['dim'](_0x54270a['at']);if(_0x59235f(0x23d)in _0x54270a){const _0x2318f0=_0x192ca9[_0x59235f(0x247)]('[input]\x20\x20');return _0x8274ae+'\x20'+_0x2318f0+':\x20'+_0x54270a[_0x59235f(0x23d)];}if(_0x59235f(0x220)in _0x54270a){const _0x3e68c8=_0x192ca9[_0x59235f(0x1cc)]('[content]');return _0x8274ae+'\x20'+_0x3e68c8+':\x20'+_0x54270a['content'];}if('tool_call'in _0x54270a){const _0x25f91d=_0x192ca9[_0x59235f(0x1fe)]('[tool_call]'),{functionName:_0x314b4e,functionArguments:_0x382e85,targetFunction:_0x158a62}=_0x54270a['tool_call'];let _0x4e33a3=_0x8274ae+'\x20'+_0x25f91d+':\x20'+_0x192ca9[_0x59235f(0x245)](_0x314b4e);if(_0x382e85&&Object[_0x59235f(0x1a5)](_0x382e85)[_0x59235f(0x1f6)]>0x0){const _0x3f981f=Object[_0x59235f(0x224)](_0x382e85)['map'](([_0x386671,_0x3a9f4c])=>_0x386671+'='+JSON['stringify'](_0x3a9f4c))[_0x59235f(0x1bf)](',\x20');_0x4e33a3+='('+_0x3f981f+')';}_0x158a62&&(_0x4e33a3+=_0x192ca9[_0x59235f(0x1cd)]('\x20['+_0x158a62+']'));let _0x20be2a='';if(_0x54270a['tool_call'][_0x59235f(0x198)])_0x20be2a=_0x59235f(0x25d)+_0x54270a[_0x59235f(0x1fd)]['targetKnowledgeBase'][_0x59235f(0x1ee)];else{if(_0x54270a[_0x59235f(0x1fd)][_0x59235f(0x227)])_0x20be2a=_0x59235f(0x21e)+_0x54270a[_0x59235f(0x1fd)][_0x59235f(0x227)]['name'];else{if(_0x54270a[_0x59235f(0x1fd)][_0x59235f(0x1a1)])_0x20be2a=_0x59235f(0x213)+_0x54270a[_0x59235f(0x1fd)][_0x59235f(0x1a1)][_0x59235f(0x1ee)];else _0x54270a[_0x59235f(0x1fd)][_0x59235f(0x21a)]&&(_0x20be2a=_0x59235f(0x1ed)+_0x54270a[_0x59235f(0x1fd)][_0x59235f(0x21a)][_0x59235f(0x1ee)]);}}return _0x4e33a3+_0x20be2a;}if(_0x59235f(0x1dc)in _0x54270a){const _0x1fb689=_0x192ca9['magenta'](_0x59235f(0x1a8)),{functionName:_0x254449,functionArguments:_0x41190a,content:_0x17923a,newChat:_0x563046}=_0x54270a['tool'];let _0x6042c2=_0x8274ae+'\x20'+_0x1fb689+':\x20'+_0x192ca9[_0x59235f(0x245)](_0x254449);if(_0x41190a){const _0x379b0f=typeof _0x41190a===_0x59235f(0x235)?_0x41190a:JSON['stringify'](_0x41190a);_0x6042c2+='('+_0x379b0f+')';}return _0x17923a&&(_0x6042c2+='\x0a'+_0x192ca9[_0x59235f(0x1cd)](_0x17923a)),_0x563046&&(_0x6042c2+=_0x192ca9[_0x59235f(0x1cd)](_0x59235f(0x237)+_0x563046['id'])),_0x6042c2;}if(_0x59235f(0x1c2)in _0x54270a){const _0x508bf7=_0x192ca9['blue'](_0x59235f(0x1ca));return _0x8274ae+'\x20'+_0x508bf7+':\x20'+_0x54270a[_0x59235f(0x1c2)][_0x59235f(0x1ee)]+'\x20('+_0x54270a['output'][_0x59235f(0x220)]['length']+_0x59235f(0x244);}if(_0x59235f(0x1a6)in _0x54270a){const _0x2caadf=_0x192ca9[_0x59235f(0x21c)](_0x59235f(0x202)),{width:_0x4d9558,height:_0x4c9db7,headerText:_0x2103a9}=_0x54270a[_0x59235f(0x1a6)],_0x40aae3=_0x2103a9?_0x59235f(0x229)+_0x2103a9:'';return _0x8274ae+'\x20'+_0x2caadf+':\x20'+_0x4d9558+'x'+_0x4c9db7+_0x40aae3;}if(_0x59235f(0x190)in _0x54270a){const _0xca328b=_0x192ca9['red'](_0x59235f(0x255));return _0x8274ae+'\x20'+_0xca328b+':\x20'+_0x54270a[_0x59235f(0x190)];}return _0x8274ae+'\x20'+_0x192ca9['dim'](_0x59235f(0x1c6))+':\x20'+JSON['stringify'](_0x54270a);}async function executeChatHistoryCommand(_0x494fab,_0x44944c){const _0x34e5e3=a26_0x229e,{options:_0x5c6c05,args:_0x28ae0c,tdx:_0x33c26c}=_0x494fab,_0x17b97f=_0x28ae0c[0x0],_0x5c973d=_0x5c6c05,_0x3ef0bc=_0x5c973d[_0x34e5e3(0x242)];try{if(_0x3ef0bc&&_0x17b97f)return console['error']('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0x34e5e3(0x190)](_0x34e5e3(0x192)+_0x44944c+_0x34e5e3(0x22b)),0x1;if(!_0x17b97f&&!_0x3ef0bc&&_0x5c6c05[_0x34e5e3(0x1f2)]!==undefined){const _0x2fa31a=resolveLimit(_0x5c6c05[_0x34e5e3(0x191)],DEFAULT_LLM_LIMIT),_0x27c3ef=await withSpinner(_0x34e5e3(0x1be),()=>_0x33c26c[_0x34e5e3(0x1b3)][_0x34e5e3(0x1cf)](_0x2fa31a),{'verbose':_0x5c6c05[_0x34e5e3(0x1d0)]});return await handleSDKOutput(_0x27c3ef[_0x34e5e3(0x203)],_0x5c6c05),0x0;}const _0x3bb055=await getChatIdOrSelect(_0x33c26c,_0x5c6c05,_0x3ef0bc,_0x17b97f);if(!_0x3bb055)return 0x0;return await displayChatHistory(_0x3bb055,_0x33c26c,_0x5c6c05),0x0;}catch(_0x34e8cf){return handleSDKError(_0x34e8cf,_0x5c6c05),0x1;}}async function displayChatHistory(_0x145aad,_0x50915e,_0x45c788){const _0x3b2932=a26_0x229e,_0x13b6b8=await withSpinner(_0x3b2932(0x1bd)+_0x145aad+_0x3b2932(0x251),()=>_0x50915e[_0x3b2932(0x1b3)][_0x3b2932(0x230)](_0x145aad),{'verbose':_0x45c788['verbose']}),_0x3ba974=_0x13b6b8[_0x3b2932(0x203)][_0x3b2932(0x203)]??[];if(_0x3ba974['length']===0x0){console['log'](_0x3b2932(0x1c5));return;}if(_0x45c788['format']!==undefined)await handleSDKOutput(_0x3ba974,_0x45c788);else{const _0x1a2a9e=_0x3ba974[_0x3b2932(0x207)](_0xffd6ca=>formatChatHistoryEntry(_0xffd6ca,_0x45c788)),_0x404ad4=_0x1a2a9e[_0x3b2932(0x1bf)]('\x0a');await writeOutput(_0x404ad4,_0x45c788[_0x3b2932(0x1c2)],_0x3b2932(0x1b1));}}async function getChatIdOrSelect(_0x2a62b0,_0x467d08,_0x40688c,_0x51f242){const _0x2d80fa=a26_0x229e;if(_0x51f242)return _0x51f242;if(_0x40688c){const _0x37db1a=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x2a62b0['llm']['chats'](0x1),{'verbose':_0x467d08[_0x2d80fa(0x1d0)]});if(_0x37db1a['data'][_0x2d80fa(0x1f6)]===0x0)return console[_0x2d80fa(0x216)](_0x2d80fa(0x25a)),undefined;return _0x37db1a[_0x2d80fa(0x203)][0x0]['id'];}const _0x552313=await selectChatInteractively(_0x2a62b0,_0x467d08);if(!_0x552313)return console[_0x2d80fa(0x216)](_0x2d80fa(0x1d4)),undefined;return _0x552313;}async function getProjectIdOrDefault(_0x34393a){const _0x4e5a48=a26_0x229e,{tdx:_0x2d646b,options:_0x1835fb}=_0x34393a,_0x5f43d2=_0x1835fb['llmProject'];if(_0x5f43d2){const _0x184286=await withSpinner('Resolving\x20project\x20\x27'+_0x5f43d2+_0x4e5a48(0x251),()=>_0x2d646b[_0x4e5a48(0x1b3)][_0x4e5a48(0x193)](_0x5f43d2),{'verbose':_0x1835fb['verbose']});return _0x184286[_0x4e5a48(0x203)];}let _0x282781=_0x2d646b[_0x4e5a48(0x1b3)][_0x4e5a48(0x209)]();if(_0x282781)return _0x282781;const _0x44c00b=await withSpinner(_0x4e5a48(0x25c),()=>_0x2d646b['llm'][_0x4e5a48(0x1c7)](),{'verbose':_0x1835fb['verbose']});return _0x44c00b[_0x4e5a48(0x203)]['id'];}function toLLMProjectInfo(_0xd3b6f3){const _0x502570=a26_0x229e;return{'name':_0xd3b6f3[_0x502570(0x1ec)][_0x502570(0x1ee)],'description':_0xd3b6f3[_0x502570(0x1ec)]['description'],'createdAt':_0xd3b6f3[_0x502570(0x1ec)][_0x502570(0x1b4)],'updatedAt':_0xd3b6f3['attributes'][_0x502570(0x24a)]};}function toAgentInfo(_0x134a55){const _0x4af6fc=a26_0x229e;return{'name':_0x134a55[_0x4af6fc(0x1ec)]['name'],'description':_0x134a55[_0x4af6fc(0x1ec)][_0x4af6fc(0x19e)],'prompt':truncatePrompt(_0x134a55[_0x4af6fc(0x1ec)][_0x4af6fc(0x233)]),'createdAt':_0x134a55['attributes'][_0x4af6fc(0x1b4)],'updatedAt':_0x134a55[_0x4af6fc(0x1ec)][_0x4af6fc(0x24a)]};}function truncatePrompt(_0x4e81cd){const _0x54a65f=a26_0x229e;if(!_0x4e81cd)return undefined;const _0x4405c9=0x64;if(_0x4e81cd[_0x54a65f(0x1f6)]<=_0x4405c9)return _0x4e81cd;return _0x4e81cd['slice'](0x0,_0x4405c9)+_0x54a65f(0x1e5);}export class LLMModelsCommand extends BaseCommand{[a26_0x312a95(0x1ee)]='llm:models';[a26_0x312a95(0x19e)]=a26_0x312a95(0x239);async['execute'](_0x55f829){const _0x19ce2d=a26_0x312a95,{options:_0x307dfe,tdx:_0x1a93b6}=_0x55f829;try{const _0x42058f=await withSpinner(_0x19ce2d(0x22a),()=>_0x1a93b6[_0x19ce2d(0x1b3)][_0x19ce2d(0x1da)](),{'verbose':_0x307dfe['verbose']});return await handleSDKOutput(_0x42058f[_0x19ce2d(0x203)],_0x307dfe),0x0;}catch(_0x312fbf){return handleSDKError(_0x312fbf,_0x307dfe),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a26_0x312a95(0x1f3);[a26_0x312a95(0x19e)]='List\x20all\x20LLM\x20projects';async[a26_0x312a95(0x1e2)](_0x3d8fd4){const _0x107ce2=a26_0x312a95,{options:_0x498960,args:_0x127d71,tdx:_0x682f1f}=_0x3d8fd4;try{const _0x196356=_0x127d71[0x0],_0x3d2aa1=resolveLimit(_0x498960['limit'],DEFAULT_LLM_LIMIT),_0x418cff=await withSpinner(_0x107ce2(0x1b0),()=>_0x682f1f[_0x107ce2(0x1b3)][_0x107ce2(0x214)](_0x3d2aa1),{'verbose':_0x498960[_0x107ce2(0x1d0)]});let _0x395d5a=_0x418cff[_0x107ce2(0x203)];_0x196356&&(_0x395d5a=_0x418cff[_0x107ce2(0x203)][_0x107ce2(0x24f)](_0x323e82=>matchGlobPattern(_0x323e82['attributes'][_0x107ce2(0x1ee)],_0x196356)));const _0x39c1db=_0x395d5a[_0x107ce2(0x207)](toLLMProjectInfo);return await handleSDKOutput(_0x39c1db,_0x498960),0x0;}catch(_0xee9788){return handleSDKError(_0xee9788,_0x498960),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']='llm:agents';['description']=a26_0x312a95(0x1d9);async[a26_0x312a95(0x1e2)](_0xb4ba09){const _0x4623b6=a26_0x312a95,{options:_0x87b4d4,args:_0x4a3ea0,tdx:_0x132243}=_0xb4ba09;try{const _0x11b012=_0x4a3ea0[0x0];let _0xcb39f3,_0x37cec8=_0x11b012;if(_0x11b012&&_0x11b012[_0x4623b6(0x256)]('/')){const _0x48743f=_0x11b012[_0x4623b6(0x24e)]('/');if(_0x48743f[_0x4623b6(0x1f6)]===0x2){const [_0x1f9826,_0x43ebaa]=_0x48743f,_0x3cd2c0=await _0x132243['llm'][_0x4623b6(0x214)](),_0x13513d=_0x3cd2c0[_0x4623b6(0x21f)](_0x2b3872=>_0x2b3872[_0x4623b6(0x1ec)][_0x4623b6(0x1ee)][_0x4623b6(0x21d)]()===_0x1f9826['toLowerCase']());if(!_0x13513d)throw new SDKError(ErrorCode[_0x4623b6(0x231)],_0x4623b6(0x23c)+_0x1f9826,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});_0xcb39f3=_0x13513d['id'],_0x37cec8=_0x43ebaa;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4623b6(0x212)+_0x11b012,undefined,{'helpText':_0x4623b6(0x25b)});}else _0xcb39f3=await getProjectIdOrDefault(_0xb4ba09);const _0x572ec4=await withSpinner(_0x4623b6(0x1f0),()=>_0x132243[_0x4623b6(0x1b3)][_0x4623b6(0x20c)](_0xcb39f3),{'verbose':_0x87b4d4[_0x4623b6(0x1d0)]});let _0x16805d=_0x572ec4[_0x4623b6(0x203)];_0x37cec8&&(_0x16805d=_0x572ec4['data'][_0x4623b6(0x24f)](_0x4c8253=>matchGlobPattern(_0x4c8253[_0x4623b6(0x1ec)][_0x4623b6(0x1ee)],_0x37cec8)));const _0x5079aa=_0x16805d[_0x4623b6(0x207)](toAgentInfo);return await handleSDKOutput(_0x5079aa,_0x87b4d4),0x0;}catch(_0x2be878){return handleSDKError(_0x2be878,_0x87b4d4),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x1dd);['description']='Show\x20agent\x20details';async['execute'](_0x1aa905){const _0x326ae9=a26_0x312a95,{options:_0x4f1ece,args:_0x5dc3d2,tdx:_0x32d947}=_0x1aa905;if(_0x5dc3d2['length']===0x0)return console[_0x326ae9(0x190)](_0x326ae9(0x197)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x1d30c7=_0x5dc3d2[0x0];try{const _0x397507=await getProjectIdOrDefault(_0x1aa905),_0x138885=await withSpinner(_0x326ae9(0x1df)+_0x1d30c7+_0x326ae9(0x251),()=>_0x32d947[_0x326ae9(0x1b3)][_0x326ae9(0x23e)](_0x1d30c7,_0x397507),{'verbose':_0x4f1ece[_0x326ae9(0x1d0)]}),_0x52c098=await withSpinner(_0x326ae9(0x1d8),()=>_0x32d947[_0x326ae9(0x1b3)][_0x326ae9(0x215)](_0x138885[_0x326ae9(0x203)]),{'verbose':_0x4f1ece[_0x326ae9(0x1d0)]});return await handleSDKOutput([_0x52c098[_0x326ae9(0x203)]],_0x4f1ece),0x0;}catch(_0x538963){return handleSDKError(_0x538963,_0x4f1ece),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x25e);[a26_0x312a95(0x19e)]=a26_0x312a95(0x1ba);async[a26_0x312a95(0x1e2)](_0x21cedf){const _0x208edf=a26_0x312a95,{options:_0x1d0da6,args:_0x4544ae,tdx:_0x54fa74}=_0x21cedf;if(_0x4544ae[_0x208edf(0x1f6)]===0x0)return console[_0x208edf(0x190)](_0x208edf(0x197)),console[_0x208edf(0x190)](_0x208edf(0x20e)),console[_0x208edf(0x190)](_0x208edf(0x22e)),0x1;const _0x1ab656=_0x4544ae[0x0],_0x44bfbc=_0x1d0da6,_0x5d94f3=_0x44bfbc[_0x208edf(0x1e1)],_0xfcb4a2=_0x44bfbc[_0x208edf(0x1a9)]||_0x208edf(0x1b8),_0xdcf71b=_0x44bfbc[_0x208edf(0x1e9)],_0x5de387=_0x44bfbc['maxToolIterations']?Number(_0x44bfbc[_0x208edf(0x1c4)]):undefined,_0xeba110=_0x44bfbc[_0x208edf(0x199)]?Number(_0x44bfbc['temperature']):undefined;try{let _0x531fa9,_0x42dc63;if(_0x1ab656[_0x208edf(0x256)]('/')){const _0x14df5b=_0x1ab656[_0x208edf(0x24e)]('/');if(_0x14df5b[_0x208edf(0x1f6)]===0x2){const [_0x2a21cd,_0x4aeb57]=_0x14df5b,_0x406825=await withSpinner(_0x208edf(0x226)+_0x2a21cd+_0x208edf(0x251),()=>_0x54fa74[_0x208edf(0x1b3)][_0x208edf(0x193)](_0x2a21cd),{'verbose':_0x1d0da6['verbose']});_0x531fa9=_0x406825['data'],_0x42dc63=_0x4aeb57;}else throw new SDKError(ErrorCode[_0x208edf(0x195)],'Invalid\x20path\x20syntax:\x20'+_0x1ab656,undefined,{'helpText':_0x208edf(0x25b)});}else _0x531fa9=await getProjectIdOrDefault(_0x21cedf),_0x42dc63=_0x1ab656;const _0x1f7fe1=await withSpinner(_0x208edf(0x1e6)+_0x42dc63+_0x208edf(0x251),()=>_0x54fa74['llm'][_0x208edf(0x1d1)]({'name':_0x42dc63,'projectId':_0x531fa9,'modelType':_0xfcb4a2,'systemPrompt':_0x5d94f3,'starterMessage':_0xdcf71b,'maxToolIterations':_0x5de387,'temperature':_0xeba110}),{'verbose':_0x1d0da6['verbose']});return console[_0x208edf(0x216)](_0x208edf(0x225)+_0x1f7fe1['data']['id']),await handleSDKOutput([_0x1f7fe1['data']],_0x1d0da6),0x0;}catch(_0x27fb07){return handleSDKError(_0x27fb07,_0x1d0da6),0x1;}}}function a26_0x1dac(){const _0x545678=['getOrCreateDefaultProject','Delete\x20an\x20LLM\x20project','llm:project:create','[output]\x20','tdx\x20llm\x20history','green','dim','prompts','chats','verbose','createAgent','jsonl','989397ZcBWrL','\x0aCancelled','llm:history','firstInputContent','Creating\x20project\x20\x27','Fetching\x20agent...','List\x20agents\x20in\x20current\x20project','models','llm:use','tool','llm:agent:show','counts','Resolving\x20agent\x20\x27','\x20\x20Agents:\x20','systemPrompt','execute','\x20\x20Knowledge\x20Bases:\x20','Set\x20current\x20project\x20context','...','Creating\x20agent\x20\x27','Deleting\x20agent...','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','starterMessage','Update\x20an\x20existing\x20agent','setCurrentProject','attributes','\x20->\x20ImageGen:','name','1910720sWlDgh','Fetching\x20agents...','d\x20ago','format','llm:projects','getTime','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','length','agentId','restoreProject','select','Usage:\x20tdx\x20llm\x20use\x20<project-name>','lastConversationAt','Error:\x20Project\x20name\x20is\x20required','tool_call','yellow','Setting\x20project\x20context\x20to\x20\x27','Agent\x20deleted:\x20','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','[image]\x20\x20','data','existsSync','llm:agent:update','Project\x20backed\x20up\x20to:\x20','map','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','getCurrentProject','Create\x20a\x20new\x20LLM\x20project','get','agents','chatId','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','Restore\x20cancelled.','deleteAgent','llm:project:backup','Invalid\x20path\x20syntax:\x20','\x20->\x20WebSearch:','projects','agent','log','660shMKRP','floor','8vxVVaJ','targetImageGenerator','all','blue','toLowerCase','\x20->\x20Agent:','find','content','outputDir','1420488ouJaQE','projectName','entries','Agent\x20created:\x20','Resolving\x20project\x20\x27','targetAgent','numeric','\x20-\x20','Fetching\x20available\x20models...','\x20--last','dryRun','Select\x20a\x20chat\x20session:','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','\x0aStack\x20trace:','history','LLM_PROJECT_NOT_FOUND','knowledgeBases','prompt','h\x20ago','string','Load\x20more...','\x20→\x20chat:\x20','backupProject','List\x20available\x20LLM\x20models','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Restoring\x20project\x20from\x20\x27','Project\x20not\x20found:\x20','input','resolveAgentId','1164JhcjST','Deleting\x20project\x20\x27','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','last','yes','\x20bytes)','bold','stack','cyan','llm:project:delete','(no\x20message)','updatedAt','llm:agent:delete','short','integrations','split','filter','1084NoySfQ','\x27...','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','172117ftqFQi','\x20\x20Prompts:\x20','[error]\x20\x20','includes','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','Project\x20context\x20set\x20to:\x20','(no\x20agent)','No\x20chat\x20sessions\x20found.','Use\x20format:\x20project-name/agent-name','Getting\x20default\x20project...','\x20->\x20KB:','llm:agent:create','substring','error','limit','Usage:\x20','resolveProjectId','103478lRrJyf','INVALID_ARGUMENT','default','Error:\x20Agent\x20name\x20is\x20required','targetKnowledgeBase','temperature','8WxFEYk','sourceSite','Error:\x20','createProject','description','\x20\x20Integrations:\x20','__load_more__','targetWebSearchTool','Analyzing\x20project\x20\x27','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','\x20\x20Cause:\x20','keys','image','rmSync','[tool]\x20\x20\x20','model','set','message','getBackupMetadata','deleteProject','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','.llm','Fetching\x20projects...','table','llm:project:restore','llm','createdAt','json','toLocaleDateString','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','claude-4.5-haiku','push','Create\x20a\x20new\x20agent\x20in\x20current\x20project','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','183680IvpqOJ','Fetching\x20chat\x20history\x20for\x20\x27','Fetching\x20chat\x20sessions...','join','cause','Output\x20directory\x20\x27','output','exportedFrom','maxToolIterations','No\x20messages\x20found\x20in\x20chat\x20history.','[unknown]'];a26_0x1dac=function(){return _0x545678;};return a26_0x1dac();}function a26_0x229e(_0x215add,_0x5b9009){_0x215add=_0x215add-0x190;const _0x1dac96=a26_0x1dac();let _0x229ef1=_0x1dac96[_0x215add];return _0x229ef1;}export class LLMAgentUpdateCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x205);[a26_0x312a95(0x19e)]=a26_0x312a95(0x1ea);async[a26_0x312a95(0x1e2)](_0x1b36db){const _0x34e174=a26_0x312a95,{options:_0x27a84a,args:_0x210a54,tdx:_0x42f5b1}=_0x1b36db;if(_0x210a54[_0x34e174(0x1f6)]===0x0)return console[_0x34e174(0x190)](_0x34e174(0x197)),console[_0x34e174(0x190)](_0x34e174(0x1bb)),0x1;const _0x50d8fd=_0x210a54[0x0],_0x3c709d=_0x27a84a,_0x55e3e7=_0x3c709d[_0x34e174(0x1ee)],_0x36f1df=_0x3c709d[_0x34e174(0x233)],_0x548185=_0x3c709d['description'],_0x10fbed=_0x3c709d[_0x34e174(0x1e9)];if(!_0x55e3e7&&!_0x36f1df&&!_0x548185&&!_0x10fbed)return console[_0x34e174(0x190)](_0x34e174(0x252)),console[_0x34e174(0x190)](_0x34e174(0x1b7)),0x1;try{const _0xd71e93=await getProjectIdOrDefault(_0x1b36db),_0x10d442=await withSpinner('Resolving\x20agent\x20\x27'+_0x50d8fd+_0x34e174(0x251),()=>_0x42f5b1[_0x34e174(0x1b3)]['resolveAgentId'](_0x50d8fd,_0xd71e93),{'verbose':_0x27a84a[_0x34e174(0x1d0)]}),_0x392d09=_0x10d442[_0x34e174(0x203)],_0x2a0539=await withSpinner('Updating\x20agent...',()=>_0x42f5b1[_0x34e174(0x1b3)]['updateAgent'](_0x392d09,{'name':_0x55e3e7,'prompt':_0x36f1df,'description':_0x548185,'starterMessage':_0x10fbed}),{'verbose':_0x27a84a[_0x34e174(0x1d0)]});return console['log']('Agent\x20updated:\x20'+_0x2a0539['data']['id']),await handleSDKOutput([_0x2a0539['data']],_0x27a84a),0x0;}catch(_0x31febd){return handleSDKError(_0x31febd,_0x27a84a),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x24b);[a26_0x312a95(0x19e)]='Delete\x20an\x20agent';async[a26_0x312a95(0x1e2)](_0x5778e1){const _0xc8d179=a26_0x312a95,{options:_0x4d1eb0,args:_0x59fd52,tdx:_0x193fe4}=_0x5778e1;if(_0x59fd52[_0xc8d179(0x1f6)]===0x0)return console[_0xc8d179(0x190)](_0xc8d179(0x197)),console[_0xc8d179(0x190)](_0xc8d179(0x1a3)),0x1;const _0x538c93=_0x59fd52[0x0];try{const _0x155ba1=await getProjectIdOrDefault(_0x5778e1),_0x451289=await withSpinner(_0xc8d179(0x1df)+_0x538c93+'\x27...',()=>_0x193fe4[_0xc8d179(0x1b3)][_0xc8d179(0x23e)](_0x538c93,_0x155ba1),{'verbose':_0x4d1eb0[_0xc8d179(0x1d0)]}),_0x3426df=_0x451289[_0xc8d179(0x203)];return await withSpinner(_0xc8d179(0x1e7),()=>_0x193fe4[_0xc8d179(0x1b3)][_0xc8d179(0x210)](_0x3426df),{'verbose':_0x4d1eb0['verbose']}),console[_0xc8d179(0x216)](_0xc8d179(0x200)+_0x3426df),0x0;}catch(_0x254bfe){return handleSDKError(_0x254bfe,_0x4d1eb0),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x1d5);[a26_0x312a95(0x19e)]=a26_0x312a95(0x1ae);async['execute'](_0x437d5f){const _0xdad2f5=a26_0x312a95;return executeChatHistoryCommand(_0x437d5f,_0xdad2f5(0x1cb));}}export class LLMUseCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x1db);[a26_0x312a95(0x19e)]=a26_0x312a95(0x1e4);async['execute'](_0x3ab0df){const _0x25349f=a26_0x312a95,{options:_0x23af16,args:_0x12b6cd,tdx:_0x344315}=_0x3ab0df;if(_0x12b6cd[_0x25349f(0x1f6)]===0x0)return console['error'](_0x25349f(0x1fc)),console[_0x25349f(0x190)](_0x25349f(0x1fa)),0x1;const _0x404b9b=_0x12b6cd[0x0];try{return await withSpinner(_0x25349f(0x1ff)+_0x404b9b+_0x25349f(0x251),()=>_0x344315[_0x25349f(0x1b3)][_0x25349f(0x1eb)](_0x404b9b),{'verbose':_0x23af16[_0x25349f(0x1d0)]}),console['log'](_0x25349f(0x258)+_0x404b9b),0x0;}catch(_0x54fe6f){return handleSDKError(_0x54fe6f,_0x23af16),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x1c9);[a26_0x312a95(0x19e)]=a26_0x312a95(0x20a);async['execute'](_0x57cbef){const _0x1b9f4a=a26_0x312a95,{options:_0x53fb38,args:_0x42bbf1,tdx:_0x41eaad}=_0x57cbef;if(_0x42bbf1['length']===0x0)return console[_0x1b9f4a(0x190)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x1b9f4a(0x241)),0x1;const _0x31eec5=_0x42bbf1[0x0],_0x17ef11=_0x53fb38,_0x39d5fd=_0x17ef11[_0x1b9f4a(0x19e)];try{const _0x471fad=await withSpinner(_0x1b9f4a(0x1d7)+_0x31eec5+_0x1b9f4a(0x251),()=>_0x41eaad[_0x1b9f4a(0x1b3)][_0x1b9f4a(0x19d)]({'name':_0x31eec5,'description':_0x39d5fd}),{'verbose':_0x53fb38[_0x1b9f4a(0x1d0)]});console[_0x1b9f4a(0x216)]('Project\x20created:\x20'+_0x471fad[_0x1b9f4a(0x203)]['id']);const _0x1b74ad=toLLMProjectInfo(_0x471fad[_0x1b9f4a(0x203)]);return await handleSDKOutput([_0x1b74ad],_0x53fb38),0x0;}catch(_0x327f32){return handleSDKError(_0x327f32,_0x53fb38),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a26_0x312a95(0x248);[a26_0x312a95(0x19e)]=a26_0x312a95(0x1c8);async['execute'](_0x520d09){const _0x54be90=a26_0x312a95,{options:_0x2b1c05,args:_0x11f8e9,tdx:_0x5d44d3}=_0x520d09;if(_0x11f8e9[_0x54be90(0x1f6)]===0x0)return console[_0x54be90(0x190)](_0x54be90(0x1fc)),console[_0x54be90(0x190)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x34b5da=_0x11f8e9[0x0];try{return await withSpinner(_0x54be90(0x240)+_0x34b5da+'\x27...',()=>_0x5d44d3[_0x54be90(0x1b3)][_0x54be90(0x1ad)](_0x34b5da),{'verbose':_0x2b1c05['verbose']}),console['log']('Project\x20deleted:\x20'+_0x34b5da),0x0;}catch(_0x1b579b){return handleSDKError(_0x1b579b,_0x2b1c05),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a26_0x312a95(0x211);[a26_0x312a95(0x19e)]='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder';async[a26_0x312a95(0x1e2)](_0x4bd974){const _0xd3f3f6=a26_0x312a95,{options:_0x5de120,args:_0x8c6812,tdx:_0x4241ae}=_0x4bd974;if(_0x8c6812[_0xd3f3f6(0x1f6)]===0x0)return console[_0xd3f3f6(0x190)](_0xd3f3f6(0x1fc)),console[_0xd3f3f6(0x190)](_0xd3f3f6(0x257)),0x1;const _0x3423cd=_0x8c6812[0x0],_0x1649ea=_0x5de120,_0x3466d0=_0x1649ea[_0xd3f3f6(0x1c2)],_0x1763f3=_0x1649ea[_0xd3f3f6(0x22c)];try{const _0x528c84=_0x3466d0||_0x3423cd+_0xd3f3f6(0x1af);if(a26_0xcd1495[_0xd3f3f6(0x204)](_0x528c84)&&!_0x1763f3){if(!_0x5de120[_0xd3f3f6(0x243)]){const _0xdffb30=await confirm(_0xd3f3f6(0x1c1)+_0x528c84+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0xdffb30)return console[_0xd3f3f6(0x216)]('Backup\x20cancelled.'),0x0;}a26_0xcd1495[_0xd3f3f6(0x1a7)](_0x528c84,{'recursive':!![]});}const _0x405e40=await withSpinner(_0x1763f3?_0xd3f3f6(0x1a2)+_0x3423cd+'\x27...':'Backing\x20up\x20project\x20\x27'+_0x3423cd+_0xd3f3f6(0x251),()=>_0x4241ae[_0xd3f3f6(0x1b3)][_0xd3f3f6(0x238)](_0x3423cd,_0x3466d0,{'dryRun':_0x1763f3}),{'verbose':_0x5de120['verbose']}),_0x7c5361=_0x405e40[_0xd3f3f6(0x203)];return _0x1763f3?console[_0xd3f3f6(0x216)](_0xd3f3f6(0x208)+_0x7c5361[_0xd3f3f6(0x221)]):console[_0xd3f3f6(0x216)](_0xd3f3f6(0x206)+_0x7c5361[_0xd3f3f6(0x221)]),console['log'](_0xd3f3f6(0x1e0)+_0x7c5361['counts'][_0xd3f3f6(0x20c)]),console[_0xd3f3f6(0x216)](_0xd3f3f6(0x1e3)+_0x7c5361[_0xd3f3f6(0x1de)]['knowledgeBases']),console[_0xd3f3f6(0x216)](_0xd3f3f6(0x254)+_0x7c5361[_0xd3f3f6(0x1de)][_0xd3f3f6(0x1ce)]),console[_0xd3f3f6(0x216)]('\x20\x20Integrations:\x20'+_0x7c5361[_0xd3f3f6(0x1de)][_0xd3f3f6(0x24d)]),(_0x5de120[_0xd3f3f6(0x1f2)]===_0xd3f3f6(0x1b5)||_0x5de120['format']===_0xd3f3f6(0x1d2))&&await handleSDKOutput([_0x7c5361],_0x5de120),0x0;}catch(_0x355c7b){return handleSDKError(_0x355c7b,_0x5de120),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x1b2);[a26_0x312a95(0x19e)]=a26_0x312a95(0x201);async[a26_0x312a95(0x1e2)](_0x1df9ff){const _0xf7e623=a26_0x312a95,{options:_0x7df5ee,args:_0x49e650,tdx:_0x443637}=_0x1df9ff;if(_0x49e650['length']===0x0)return console[_0xf7e623(0x190)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0xf7e623(0x190)]('Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]'),0x1;const _0x62c0=_0x49e650[0x0],_0x53ff06=_0x7df5ee,_0x48a201=_0x53ff06[_0xf7e623(0x1ee)],_0x4f75e9=_0x53ff06['dryRun'];try{if(!_0x4f75e9){const _0x159baf=_0x443637[_0xf7e623(0x1b3)][_0xf7e623(0x1ac)](_0x62c0),_0x31c772=_0x48a201||_0x159baf[_0xf7e623(0x1c3)]['projectName'],_0x299875=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x443637['llm'][_0xf7e623(0x214)](),{'verbose':_0x7df5ee[_0xf7e623(0x1d0)]}),_0x14dc84=_0x299875[_0xf7e623(0x203)][_0xf7e623(0x21f)](_0x413877=>_0x413877['attributes'][_0xf7e623(0x1ee)]===_0x31c772);if(_0x14dc84&&!_0x7df5ee[_0xf7e623(0x243)]){const _0x2672eb=await confirm('A\x20project\x20named\x20\x27'+_0x31c772+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x2672eb)return console[_0xf7e623(0x216)](_0xf7e623(0x20f)),0x0;}}const _0xbeaa27=await withSpinner(_0x4f75e9?'Validating\x20backup\x20from\x20\x27'+_0x62c0+_0xf7e623(0x251):_0xf7e623(0x23b)+_0x62c0+_0xf7e623(0x251),()=>_0x443637['llm'][_0xf7e623(0x1f8)](_0x62c0,{'name':_0x48a201,'dryRun':_0x4f75e9}),{'verbose':_0x7df5ee[_0xf7e623(0x1d0)]}),_0x287e1a=_0xbeaa27['data'];return _0x287e1a[_0xf7e623(0x19b)]&&console['log']('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x287e1a[_0xf7e623(0x19b)]+'\x27'),_0x4f75e9?console[_0xf7e623(0x216)](_0xf7e623(0x23a)+_0x287e1a[_0xf7e623(0x223)]):console[_0xf7e623(0x216)]('Project\x20restored:\x20'+_0x287e1a[_0xf7e623(0x223)]+'\x20('+_0x287e1a['projectId']+')'),console['log'](_0xf7e623(0x1e0)+_0x287e1a[_0xf7e623(0x1de)][_0xf7e623(0x20c)]),console[_0xf7e623(0x216)](_0xf7e623(0x1e3)+_0x287e1a['counts'][_0xf7e623(0x232)]),console[_0xf7e623(0x216)](_0xf7e623(0x254)+_0x287e1a[_0xf7e623(0x1de)]['prompts']),console[_0xf7e623(0x216)](_0xf7e623(0x19f)+_0x287e1a['counts'][_0xf7e623(0x24d)]),(_0x7df5ee[_0xf7e623(0x1f2)]===_0xf7e623(0x1b5)||_0x7df5ee[_0xf7e623(0x1f2)]===_0xf7e623(0x1d2))&&await handleSDKOutput([_0x287e1a],_0x7df5ee),0x0;}catch(_0xaa4e3a){return handleSDKError(_0xaa4e3a,_0x7df5ee),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x38b47a,_0x43fea6){const _0x5f2e07=a26_0x312a95,_0x10634a=_0x43fea6[_0x5f2e07(0x191)]||CHAT_SELECTOR_PAGE_SIZE;let _0x237f07=0x0,_0xaca990=[];const _0x39f699=(await import(_0x5f2e07(0x1ce)))[_0x5f2e07(0x196)],_0x41f1c2=getChalk(_0x43fea6);while(!![]){const _0x5b2236=await withSpinner(_0x5f2e07(0x1be),()=>_0x38b47a['llm'][_0x5f2e07(0x1cf)](_0x10634a+_0x237f07),{'verbose':_0x43fea6[_0x5f2e07(0x1d0)]});_0xaca990=_0x5b2236[_0x5f2e07(0x203)];const _0x821f6=_0xaca990['slice'](_0x237f07,_0x237f07+_0x10634a),_0xbcf536=_0xaca990[_0x5f2e07(0x1f6)]>_0x237f07+_0x10634a,_0x3fa27b=[...new Set(_0x821f6[_0x5f2e07(0x207)](_0x29632e=>_0x29632e[_0x5f2e07(0x1ec)][_0x5f2e07(0x1f7)])[_0x5f2e07(0x24f)](_0x56f7b6=>_0x56f7b6!==undefined))],_0x4ae1a9=new Map();await Promise[_0x5f2e07(0x21b)](_0x3fa27b['map'](async _0x52e1d1=>{const _0x15e64a=_0x5f2e07;try{const _0x32d538=await _0x38b47a['llm']['agent'](_0x52e1d1);_0x4ae1a9[_0x15e64a(0x1aa)](_0x52e1d1,_0x32d538[_0x15e64a(0x1ec)][_0x15e64a(0x1ee)]);}catch{_0x4ae1a9[_0x15e64a(0x1aa)](_0x52e1d1,_0x52e1d1);}}));const _0x1f62fe=_0x821f6[_0x5f2e07(0x207)](_0x48852f=>{const _0x4a0b44=_0x5f2e07,_0xeea4cc=_0x48852f[_0x4a0b44(0x1ec)][_0x4a0b44(0x1d6)]||_0x4a0b44(0x249),_0x493772=_0xeea4cc[_0x4a0b44(0x24e)]('\x0a')[0x0],_0x1705c7=_0x493772['length']>0x50?_0x493772[_0x4a0b44(0x25f)](0x0,0x4d)+_0x4a0b44(0x1e5):_0x493772,_0x580d41=_0x48852f[_0x4a0b44(0x1ec)]['agentId']?_0x4ae1a9[_0x4a0b44(0x20b)](_0x48852f[_0x4a0b44(0x1ec)]['agentId'])||_0x48852f[_0x4a0b44(0x1ec)][_0x4a0b44(0x1f7)]:_0x4a0b44(0x259),_0x1a8ec9=_0x48852f[_0x4a0b44(0x1ec)][_0x4a0b44(0x1fb)]||_0x48852f['attributes']['updatedAt'],_0x2029e8=new Date(_0x1a8ec9),_0x1d1005=new Date(),_0x28c303=_0x1d1005[_0x4a0b44(0x1f4)]()-_0x2029e8['getTime'](),_0xf95467=Math['floor'](_0x28c303/0xea60),_0x17ce9d=Math[_0x4a0b44(0x218)](_0x28c303/0x36ee80),_0x375628=Math[_0x4a0b44(0x218)](_0x28c303/0x5265c00);let _0x4beec8;if(_0xf95467<0x1)_0x4beec8='just\x20now';else{if(_0xf95467<0x3c)_0x4beec8=_0xf95467+'m\x20ago';else{if(_0x17ce9d<0x18)_0x4beec8=_0x17ce9d+_0x4a0b44(0x234);else _0x375628<0x7?_0x4beec8=_0x375628+_0x4a0b44(0x1f1):_0x4beec8=_0x2029e8[_0x4a0b44(0x1b6)]('en-US',{'month':_0x4a0b44(0x24c),'day':_0x4a0b44(0x228)});}}return{'title':_0x1705c7+'\x20'+_0x41f1c2[_0x4a0b44(0x1cd)]('['+_0x580d41+']\x20'+_0x4beec8),'value':_0x48852f['id']};});_0xbcf536&&_0x1f62fe[_0x5f2e07(0x1b9)]({'title':_0x41f1c2[_0x5f2e07(0x247)](_0x5f2e07(0x236)),'value':_0x5f2e07(0x1a0)});const _0x3253af=await _0x39f699({'type':_0x5f2e07(0x1f9),'name':_0x5f2e07(0x20d),'message':_0x5f2e07(0x22d),'choices':_0x1f62fe,'hint':_0x5f2e07(0x1f5)});if(!_0x3253af[_0x5f2e07(0x20d)])return undefined;if(_0x3253af[_0x5f2e07(0x20d)]==='__load_more__'){_0x237f07+=_0x10634a;continue;}return _0x3253af[_0x5f2e07(0x20d)];}}export class ChatsCommand extends BaseCommand{[a26_0x312a95(0x1ee)]=a26_0x312a95(0x1cf);['description']=a26_0x312a95(0x1e8);async[a26_0x312a95(0x1e2)](_0x11672b){return executeChatHistoryCommand(_0x11672b,'tdx\x20chats');}}
|
|
1
|
+
const a26_0x284cfc=a26_0x3209;(function(_0x54ee5d,_0x143992){const _0xaa74e4=a26_0x3209,_0x233f2e=_0x54ee5d();while(!![]){try{const _0x398023=parseInt(_0xaa74e4(0x18a))/0x1*(-parseInt(_0xaa74e4(0x1d0))/0x2)+-parseInt(_0xaa74e4(0x13c))/0x3+parseInt(_0xaa74e4(0x1b8))/0x4+parseInt(_0xaa74e4(0x1c1))/0x5*(-parseInt(_0xaa74e4(0x1d1))/0x6)+-parseInt(_0xaa74e4(0x198))/0x7+parseInt(_0xaa74e4(0x12e))/0x8*(parseInt(_0xaa74e4(0x141))/0x9)+-parseInt(_0xaa74e4(0x149))/0xa*(-parseInt(_0xaa74e4(0x12d))/0xb);if(_0x398023===_0x143992)break;else _0x233f2e['push'](_0x233f2e['shift']());}catch(_0x49a176){_0x233f2e['push'](_0x233f2e['shift']());}}}(a26_0x4bd6,0x1ff68));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{confirm}from'../utils/prompt.js';import*as a26_0x2cce35 from'node:fs';function handleSDKError(_0x390a1d,_0x5e2362){const _0x4129ad=a26_0x3209;if(_0x390a1d instanceof SDKError)console['error'](_0x4129ad(0x164)+_0x390a1d[_0x4129ad(0x1e0)]),_0x5e2362[_0x4129ad(0x183)]&&(_0x390a1d[_0x4129ad(0x1cf)]&&console['error'](_0x4129ad(0x133)+_0x390a1d['cause']),_0x390a1d[_0x4129ad(0x138)]&&(console[_0x4129ad(0x17e)](_0x4129ad(0x169)),console[_0x4129ad(0x17e)](_0x390a1d['stack'])));else throw _0x390a1d;}function formatChatHistoryEntry(_0x406787,_0x457723){const _0x283d30=a26_0x3209,_0x2497c2=getChalk(_0x457723),_0x32b2d4=_0x2497c2[_0x283d30(0x1d8)](_0x406787['at']);if(_0x283d30(0x139)in _0x406787){const _0x20ed42=_0x2497c2['cyan'](_0x283d30(0x12a));return _0x32b2d4+'\x20'+_0x20ed42+':\x20'+_0x406787[_0x283d30(0x139)];}if(_0x283d30(0x1b2)in _0x406787){const _0x1c5219=_0x2497c2[_0x283d30(0x1ab)](_0x283d30(0x1de));return _0x32b2d4+'\x20'+_0x1c5219+':\x20'+_0x406787['content'];}if(_0x283d30(0x136)in _0x406787){const _0x4b02ed=_0x2497c2[_0x283d30(0x124)]('[tool_call]'),{functionName:_0x1ecf74,functionArguments:_0x588593,targetFunction:_0x158725}=_0x406787['tool_call'];let _0x238d08=_0x32b2d4+'\x20'+_0x4b02ed+':\x20'+_0x2497c2[_0x283d30(0x17d)](_0x1ecf74);if(_0x588593&&Object[_0x283d30(0x16e)](_0x588593)[_0x283d30(0x14a)]>0x0){const _0x5bd03e=Object[_0x283d30(0x1d4)](_0x588593)['map'](([_0x5f0808,_0x4e0185])=>_0x5f0808+'='+JSON[_0x283d30(0x162)](_0x4e0185))[_0x283d30(0x166)](',\x20');_0x238d08+='('+_0x5bd03e+')';}_0x158725&&(_0x238d08+=_0x2497c2[_0x283d30(0x1d8)]('\x20['+_0x158725+']'));let _0x5e8536='';if(_0x406787['tool_call'][_0x283d30(0x14e)])_0x5e8536=_0x283d30(0x11d)+_0x406787[_0x283d30(0x136)][_0x283d30(0x14e)][_0x283d30(0x1b7)];else{if(_0x406787[_0x283d30(0x136)][_0x283d30(0x148)])_0x5e8536='\x20->\x20Agent:'+_0x406787[_0x283d30(0x136)]['targetAgent'][_0x283d30(0x1b7)];else{if(_0x406787[_0x283d30(0x136)][_0x283d30(0x1c7)])_0x5e8536='\x20->\x20WebSearch:'+_0x406787['tool_call']['targetWebSearchTool'][_0x283d30(0x1b7)];else _0x406787['tool_call'][_0x283d30(0x13d)]&&(_0x5e8536=_0x283d30(0x15f)+_0x406787[_0x283d30(0x136)][_0x283d30(0x13d)][_0x283d30(0x1b7)]);}}return _0x238d08+_0x5e8536;}if(_0x283d30(0x187)in _0x406787){const _0x2abb68=_0x2497c2[_0x283d30(0x135)](_0x283d30(0x17c)),{functionName:_0x4e4e19,functionArguments:_0x4b3f48,content:_0x1a204d,newChat:_0x1508e0}=_0x406787[_0x283d30(0x187)];let _0x599ad5=_0x32b2d4+'\x20'+_0x2abb68+':\x20'+_0x2497c2[_0x283d30(0x17d)](_0x4e4e19);if(_0x4b3f48){const _0x2fc7bf=typeof _0x4b3f48===_0x283d30(0x1cd)?_0x4b3f48:JSON[_0x283d30(0x162)](_0x4b3f48);_0x599ad5+='('+_0x2fc7bf+')';}return _0x1a204d&&(_0x599ad5+='\x0a'+_0x2497c2[_0x283d30(0x1d8)](_0x1a204d)),_0x1508e0&&(_0x599ad5+=_0x2497c2[_0x283d30(0x1d8)]('\x20→\x20chat:\x20'+_0x1508e0['id'])),_0x599ad5;}if('output'in _0x406787){const _0x5ba44c=_0x2497c2[_0x283d30(0x18b)](_0x283d30(0x186));return _0x32b2d4+'\x20'+_0x5ba44c+':\x20'+_0x406787[_0x283d30(0x137)]['name']+'\x20('+_0x406787['output'][_0x283d30(0x1b2)][_0x283d30(0x14a)]+'\x20bytes)';}if(_0x283d30(0x15a)in _0x406787){const _0x5a2b33=_0x2497c2[_0x283d30(0x18b)](_0x283d30(0x185)),{width:_0x435d62,height:_0x5cf316,headerText:_0x483b92}=_0x406787['image'],_0x4691a8=_0x483b92?_0x283d30(0x1e5)+_0x483b92:'';return _0x32b2d4+'\x20'+_0x5a2b33+':\x20'+_0x435d62+'x'+_0x5cf316+_0x4691a8;}if(_0x283d30(0x17e)in _0x406787){const _0x17e6a7=_0x2497c2[_0x283d30(0x11e)](_0x283d30(0x176));return _0x32b2d4+'\x20'+_0x17e6a7+':\x20'+_0x406787[_0x283d30(0x17e)];}return _0x32b2d4+'\x20'+_0x2497c2[_0x283d30(0x1d8)](_0x283d30(0x1b4))+':\x20'+JSON[_0x283d30(0x162)](_0x406787);}async function executeChatHistoryCommand(_0x46c2e4,_0x520d35){const _0x845fe8=a26_0x3209,{options:_0x2c9f76,args:_0x38b3c6,tdx:_0x12246c}=_0x46c2e4,_0x1e26ca=_0x38b3c6[0x0],_0x3ff076=_0x2c9f76,_0x101883=_0x3ff076[_0x845fe8(0x13f)];try{if(_0x101883&&_0x1e26ca)return console['error']('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0x845fe8(0x17e)]('Usage:\x20'+_0x520d35+_0x845fe8(0x1b1)),0x1;if(!_0x1e26ca&&!_0x101883&&_0x2c9f76['format']!==undefined){const _0x4d7753=resolveLimit(_0x2c9f76[_0x845fe8(0x1aa)],DEFAULT_LLM_LIMIT),_0x436100=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x12246c[_0x845fe8(0x190)]['chats'](_0x4d7753),{'verbose':_0x2c9f76[_0x845fe8(0x183)]});return await handleSDKOutput(_0x436100[_0x845fe8(0x17a)],_0x2c9f76),0x0;}const _0x10f4c8=await getChatIdOrSelect(_0x12246c,_0x2c9f76,_0x101883,_0x1e26ca);if(!_0x10f4c8)return 0x0;return await displayChatHistory(_0x10f4c8,_0x12246c,_0x2c9f76),0x0;}catch(_0x650bd3){return handleSDKError(_0x650bd3,_0x2c9f76),0x1;}}async function displayChatHistory(_0x2db4b4,_0x1cf5b3,_0xf5ff47){const _0x4c4c80=a26_0x3209,_0x11c685=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x2db4b4+'\x27...',()=>_0x1cf5b3[_0x4c4c80(0x190)][_0x4c4c80(0x17f)](_0x2db4b4),{'verbose':_0xf5ff47[_0x4c4c80(0x183)]}),_0x507c60=_0x11c685['data'][_0x4c4c80(0x17a)]??[];if(_0x507c60['length']===0x0){console[_0x4c4c80(0x18f)](_0x4c4c80(0x120));return;}if(_0xf5ff47[_0x4c4c80(0x19a)]!==undefined)await handleSDKOutput(_0x507c60,_0xf5ff47);else{const _0x49335f=_0x507c60[_0x4c4c80(0x1ac)](_0x3edb66=>formatChatHistoryEntry(_0x3edb66,_0xf5ff47)),_0x27cacb=_0x49335f[_0x4c4c80(0x166)]('\x0a');await writeOutput(_0x27cacb,_0xf5ff47[_0x4c4c80(0x137)],_0x4c4c80(0x14f));}}async function getChatIdOrSelect(_0x3d485f,_0x1e16a6,_0x1b16c4,_0x52281f){const _0x1e83c0=a26_0x3209;if(_0x52281f)return _0x52281f;if(_0x1b16c4){const _0x1e8856=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x3d485f['llm']['chats'](0x1),{'verbose':_0x1e16a6[_0x1e83c0(0x183)]});if(_0x1e8856['data'][_0x1e83c0(0x14a)]===0x0)return console['log'](_0x1e83c0(0x16c)),undefined;return _0x1e8856[_0x1e83c0(0x17a)][0x0]['id'];}const _0x4d7aaa=await selectChatInteractively(_0x3d485f,_0x1e16a6);if(!_0x4d7aaa)return console[_0x1e83c0(0x18f)]('\x0aCancelled'),undefined;return _0x4d7aaa;}async function getProjectIdOrDefault(_0x470084){const _0xc80b24=a26_0x3209,{tdx:_0x2ab5e8,options:_0x21303c}=_0x470084,_0x1cd6ae=_0x21303c[_0xc80b24(0x151)];if(_0x1cd6ae){const _0x5dde2b=await withSpinner(_0xc80b24(0x170)+_0x1cd6ae+_0xc80b24(0x128),()=>_0x2ab5e8['llm'][_0xc80b24(0x11c)](_0x1cd6ae),{'verbose':_0x21303c[_0xc80b24(0x183)]});return _0x5dde2b[_0xc80b24(0x17a)];}let _0xe8f3d6=_0x2ab5e8['llm'][_0xc80b24(0x192)]();if(_0xe8f3d6)return _0xe8f3d6;const _0x54a495=await withSpinner('Getting\x20default\x20project...',()=>_0x2ab5e8[_0xc80b24(0x190)][_0xc80b24(0x1c5)](),{'verbose':_0x21303c[_0xc80b24(0x183)]});return _0x54a495['data']['id'];}function toLLMProjectInfo(_0x465f12){const _0x1e3214=a26_0x3209;return{'name':_0x465f12['attributes']['name'],'description':_0x465f12[_0x1e3214(0x175)][_0x1e3214(0x13b)],'createdAt':_0x465f12[_0x1e3214(0x175)][_0x1e3214(0x134)],'updatedAt':_0x465f12['attributes'][_0x1e3214(0x194)]};}function toAgentInfo(_0x1c371c){const _0xa58b4f=a26_0x3209;return{'name':_0x1c371c['attributes'][_0xa58b4f(0x1b7)],'description':_0x1c371c['attributes']['description'],'prompt':truncatePrompt(_0x1c371c['attributes'][_0xa58b4f(0x1ca)]),'createdAt':_0x1c371c['attributes'][_0xa58b4f(0x134)],'updatedAt':_0x1c371c[_0xa58b4f(0x175)][_0xa58b4f(0x194)]};}function truncatePrompt(_0x1994bf){const _0x333273=a26_0x3209;if(!_0x1994bf)return undefined;const _0x2227e2=0x64;if(_0x1994bf['length']<=_0x2227e2)return _0x1994bf;return _0x1994bf[_0x333273(0x16b)](0x0,_0x2227e2)+_0x333273(0x1af);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a26_0x284cfc(0x13b)]=a26_0x284cfc(0x1c0);async[a26_0x284cfc(0x123)](_0x54e808){const _0x15005c=a26_0x284cfc,{options:_0x4ea560,tdx:_0x1b0cd0}=_0x54e808;try{const _0x427579=await withSpinner('Fetching\x20available\x20models...',()=>_0x1b0cd0[_0x15005c(0x190)][_0x15005c(0x1a4)](),{'verbose':_0x4ea560['verbose']});return await handleSDKOutput(_0x427579[_0x15005c(0x17a)],_0x4ea560),0x0;}catch(_0x226b7f){return handleSDKError(_0x226b7f,_0x4ea560),0x1;}}}function a26_0x4bd6(){const _0x460de7=['get','[image]\x20\x20','[output]\x20','tool','Analyzing\x20project\x20\x27','starterMessage','10111OSDPbO','blue','short','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','agent','log','llm','createProject','getCurrentProject','chatId','updatedAt','Fetching\x20agents...','Creating\x20agent\x20\x27','sourceSite','200193OObuBm','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','format','llm:agent:update','resolveAgentId','d\x20ago','getTime','set','Select\x20a\x20chat\x20session:','Restore\x20cancelled.','getBackupMetadata','llm:history','models','LLM_PROJECT_NOT_FOUND','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','firstInputContent','\x20\x20Agents:\x20','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','limit','green','map','filter','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','...','Agent\x20created:\x20','\x20--last','content','maxToolIterations','[unknown]','Fetching\x20projects...','A\x20project\x20named\x20\x27','name','622152FfgIPS','prompts','claude-4.5-haiku','__load_more__','default','agentId','llm:project:backup','json','List\x20available\x20LLM\x20models','879850JpWIvW','Deleting\x20project\x20\x27','llm:project:restore','(no\x20message)','getOrCreateDefaultProject','Project\x20created:\x20','targetWebSearchTool','Fetching\x20chat\x20sessions...','existsSync','prompt','integrations','setCurrentProject','string','projectName','cause','2QnKkbE','6vSslCa','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','chats','entries','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','outputDir','dryRun','dim','yes','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Prompts:\x20','lastConversationAt','split','[content]','updateAgent','message','all','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','toLowerCase','Fetching\x20agent...','\x20-\x20','tdx\x20chats','projects','resolveProjectId','\x20->\x20KB:','red','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','No\x20messages\x20found\x20in\x20chat\x20history.','Agent\x20deleted:\x20','just\x20now','execute','yellow','h\x20ago','Project\x20backed\x20up\x20to:\x20','Restoring\x20project\x20from\x20\x27','\x27...','Create\x20a\x20new\x20LLM\x20project','[input]\x20\x20','temperature','Project\x20deleted:\x20','22dzfquo','16NBRiKz','agents','tdx\x20llm\x20history','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','llm:agents','\x20\x20Cause:\x20','createdAt','magenta','tool_call','output','stack','input','llm:agent:create','description','665442ZRatPs','targetImageGenerator','jsonl','last','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','713781RfEvEl','push','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','projectId','counts','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','targetAgent','1266290JCNQrO','length','\x20\x20Integrations:\x20','Resolving\x20agent\x20\x27','.llm','targetKnowledgeBase','table','Project\x20context\x20set\x20to:\x20','llmProject','Validating\x20backup\x20from\x20\x27','Project\x20not\x20found:\x20','rmSync','Invalid\x20path\x20syntax:\x20','select','Backing\x20up\x20project\x20\x27','substring','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','image','floor','knowledgeBases','Deleting\x20agent...','Use\x20format:\x20project-name/agent-name','\x20->\x20ImageGen:','Show\x20agent\x20details','Error:\x20Backup\x20folder\x20path\x20is\x20required','stringify','Updating\x20agent...','Error:\x20','deleteProject','join','includes','Error:\x20Project\x20name\x20is\x20required','\x0aStack\x20trace:','Project\x20restored:\x20','slice','No\x20chat\x20sessions\x20found.','Error:\x20Agent\x20name\x20is\x20required','keys','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Resolving\x20project\x20\x27','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','INVALID_ARGUMENT','Agent\x20updated:\x20','find','attributes','[error]\x20\x20','exportedFrom','Creating\x20project\x20\x27','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','data','Output\x20directory\x20\x27','[tool]\x20\x20\x20','bold','error','history','llm:agent:delete','llm:agent:show','llm:project:delete','verbose'];a26_0x4bd6=function(){return _0x460de7;};return a26_0x4bd6();}export class LLMProjectsCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]='llm:projects';[a26_0x284cfc(0x13b)]='List\x20all\x20LLM\x20projects';async['execute'](_0x3a7af6){const _0x2c151f=a26_0x284cfc,{options:_0x62eb25,args:_0x47c067,tdx:_0x2b155b}=_0x3a7af6;try{const _0x287f0a=_0x47c067[0x0],_0x836efe=resolveLimit(_0x62eb25[_0x2c151f(0x1aa)],DEFAULT_LLM_LIMIT),_0x4c38ca=await withSpinner(_0x2c151f(0x1b5),()=>_0x2b155b[_0x2c151f(0x190)][_0x2c151f(0x11b)](_0x836efe),{'verbose':_0x62eb25[_0x2c151f(0x183)]});let _0x10f2ad=_0x4c38ca[_0x2c151f(0x17a)];_0x287f0a&&(_0x10f2ad=_0x4c38ca[_0x2c151f(0x17a)][_0x2c151f(0x1ad)](_0x450ae9=>matchGlobPattern(_0x450ae9[_0x2c151f(0x175)][_0x2c151f(0x1b7)],_0x287f0a)));const _0x4995e6=_0x10f2ad['map'](toLLMProjectInfo);return await handleSDKOutput(_0x4995e6,_0x62eb25),0x0;}catch(_0x42c4c8){return handleSDKError(_0x42c4c8,_0x62eb25),0x1;}}}function a26_0x3209(_0x41e82b,_0x5527d3){_0x41e82b=_0x41e82b-0x11a;const _0x4bd60c=a26_0x4bd6();let _0x3209d0=_0x4bd60c[_0x41e82b];return _0x3209d0;}export class LLMAgentsCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x132);[a26_0x284cfc(0x13b)]='List\x20agents\x20in\x20current\x20project';async[a26_0x284cfc(0x123)](_0x4da43c){const _0x2706d3=a26_0x284cfc,{options:_0x43be8c,args:_0x25571c,tdx:_0x45843b}=_0x4da43c;try{const _0x53061c=_0x25571c[0x0];let _0x12daab,_0x2048ff=_0x53061c;if(_0x53061c&&_0x53061c['includes']('/')){const _0x44595a=_0x53061c[_0x2706d3(0x1dd)]('/');if(_0x44595a[_0x2706d3(0x14a)]===0x2){const [_0x40e4a4,_0x3d3416]=_0x44595a,_0x5a10ac=await _0x45843b[_0x2706d3(0x190)][_0x2706d3(0x11b)](),_0x52464a=_0x5a10ac[_0x2706d3(0x174)](_0x3f2feb=>_0x3f2feb['attributes'][_0x2706d3(0x1b7)][_0x2706d3(0x1e3)]()===_0x40e4a4['toLowerCase']());if(!_0x52464a)throw new SDKError(ErrorCode[_0x2706d3(0x1a5)],_0x2706d3(0x153)+_0x40e4a4,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});_0x12daab=_0x52464a['id'],_0x2048ff=_0x3d3416;}else throw new SDKError(ErrorCode[_0x2706d3(0x172)],'Invalid\x20path\x20syntax:\x20'+_0x53061c,undefined,{'helpText':_0x2706d3(0x15e)});}else _0x12daab=await getProjectIdOrDefault(_0x4da43c);const _0xf113d7=await withSpinner(_0x2706d3(0x195),()=>_0x45843b['llm'][_0x2706d3(0x12f)](_0x12daab),{'verbose':_0x43be8c[_0x2706d3(0x183)]});let _0x25647e=_0xf113d7['data'];_0x2048ff&&(_0x25647e=_0xf113d7[_0x2706d3(0x17a)][_0x2706d3(0x1ad)](_0x1ec397=>matchGlobPattern(_0x1ec397[_0x2706d3(0x175)]['name'],_0x2048ff)));const _0x29d618=_0x25647e[_0x2706d3(0x1ac)](toAgentInfo);return await handleSDKOutput(_0x29d618,_0x43be8c),0x0;}catch(_0x47159d){return handleSDKError(_0x47159d,_0x43be8c),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x181);[a26_0x284cfc(0x13b)]=a26_0x284cfc(0x160);async[a26_0x284cfc(0x123)](_0x2edc55){const _0x1d5a00=a26_0x284cfc,{options:_0x45ea0c,args:_0x3248ee,tdx:_0x212f8f}=_0x2edc55;if(_0x3248ee[_0x1d5a00(0x14a)]===0x0)return console['error'](_0x1d5a00(0x16d)),console[_0x1d5a00(0x17e)](_0x1d5a00(0x179)),0x1;const _0x9857fc=_0x3248ee[0x0];try{const _0xcfd522=await getProjectIdOrDefault(_0x2edc55),_0x2270be=await withSpinner(_0x1d5a00(0x14c)+_0x9857fc+_0x1d5a00(0x128),()=>_0x212f8f[_0x1d5a00(0x190)][_0x1d5a00(0x19c)](_0x9857fc,_0xcfd522),{'verbose':_0x45ea0c[_0x1d5a00(0x183)]}),_0x47eae4=await withSpinner(_0x1d5a00(0x1e4),()=>_0x212f8f[_0x1d5a00(0x190)][_0x1d5a00(0x18e)](_0x2270be[_0x1d5a00(0x17a)]),{'verbose':_0x45ea0c[_0x1d5a00(0x183)]});return await handleSDKOutput([_0x47eae4[_0x1d5a00(0x17a)]],_0x45ea0c),0x0;}catch(_0x43375e){return handleSDKError(_0x43375e,_0x45ea0c),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x13a);[a26_0x284cfc(0x13b)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a26_0x284cfc(0x123)](_0x4f290e){const _0x5315f6=a26_0x284cfc,{options:_0x3cf43e,args:_0x185dbc,tdx:_0x5dc211}=_0x4f290e;if(_0x185dbc['length']===0x0)return console[_0x5315f6(0x17e)](_0x5315f6(0x16d)),console[_0x5315f6(0x17e)](_0x5315f6(0x159)),console[_0x5315f6(0x17e)](_0x5315f6(0x16f)),0x1;const _0x186091=_0x185dbc[0x0],_0x563934=_0x3cf43e,_0x2efca9=_0x563934['systemPrompt'],_0x364a6b=_0x563934['model']||_0x5315f6(0x1ba),_0x3c28f8=_0x563934[_0x5315f6(0x189)],_0x5cf535=_0x563934[_0x5315f6(0x1b3)]?Number(_0x563934[_0x5315f6(0x1b3)]):undefined,_0x4a39d1=_0x563934[_0x5315f6(0x12b)]?Number(_0x563934[_0x5315f6(0x12b)]):undefined;try{let _0x11d145,_0x436983;if(_0x186091[_0x5315f6(0x167)]('/')){const _0x266313=_0x186091[_0x5315f6(0x1dd)]('/');if(_0x266313[_0x5315f6(0x14a)]===0x2){const [_0x272105,_0xec6cd4]=_0x266313,_0x3794c9=await withSpinner('Resolving\x20project\x20\x27'+_0x272105+_0x5315f6(0x128),()=>_0x5dc211['llm'][_0x5315f6(0x11c)](_0x272105),{'verbose':_0x3cf43e[_0x5315f6(0x183)]});_0x11d145=_0x3794c9['data'],_0x436983=_0xec6cd4;}else throw new SDKError(ErrorCode[_0x5315f6(0x172)],_0x5315f6(0x155)+_0x186091,undefined,{'helpText':_0x5315f6(0x15e)});}else _0x11d145=await getProjectIdOrDefault(_0x4f290e),_0x436983=_0x186091;const _0x2adb8a=await withSpinner(_0x5315f6(0x196)+_0x436983+'\x27...',()=>_0x5dc211[_0x5315f6(0x190)]['createAgent']({'name':_0x436983,'projectId':_0x11d145,'modelType':_0x364a6b,'systemPrompt':_0x2efca9,'starterMessage':_0x3c28f8,'maxToolIterations':_0x5cf535,'temperature':_0x4a39d1}),{'verbose':_0x3cf43e[_0x5315f6(0x183)]});return console['log'](_0x5315f6(0x1b0)+_0x2adb8a[_0x5315f6(0x17a)]['id']),await handleSDKOutput([_0x2adb8a[_0x5315f6(0x17a)]],_0x3cf43e),0x0;}catch(_0x25278e){return handleSDKError(_0x25278e,_0x3cf43e),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x19b);['description']='Update\x20an\x20existing\x20agent';async[a26_0x284cfc(0x123)](_0x13fb20){const _0x44a92b=a26_0x284cfc,{options:_0x116c30,args:_0x41706b,tdx:_0x18fe62}=_0x13fb20;if(_0x41706b[_0x44a92b(0x14a)]===0x0)return console['error'](_0x44a92b(0x16d)),console[_0x44a92b(0x17e)](_0x44a92b(0x140)),0x1;const _0x2ca06f=_0x41706b[0x0],_0x55891a=_0x116c30,_0x11176c=_0x55891a['name'],_0x1d11a0=_0x55891a[_0x44a92b(0x1ca)],_0x3c2d96=_0x55891a['description'],_0xe6166a=_0x55891a['starterMessage'];if(!_0x11176c&&!_0x1d11a0&&!_0x3c2d96&&!_0xe6166a)return console[_0x44a92b(0x17e)]('Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required'),console[_0x44a92b(0x17e)](_0x44a92b(0x1d2)),0x1;try{const _0x173b9f=await getProjectIdOrDefault(_0x13fb20),_0x4b6161=await withSpinner('Resolving\x20agent\x20\x27'+_0x2ca06f+'\x27...',()=>_0x18fe62[_0x44a92b(0x190)][_0x44a92b(0x19c)](_0x2ca06f,_0x173b9f),{'verbose':_0x116c30['verbose']}),_0x14eee4=_0x4b6161['data'],_0xbeca2d=await withSpinner(_0x44a92b(0x163),()=>_0x18fe62['llm'][_0x44a92b(0x1df)](_0x14eee4,{'name':_0x11176c,'prompt':_0x1d11a0,'description':_0x3c2d96,'starterMessage':_0xe6166a}),{'verbose':_0x116c30[_0x44a92b(0x183)]});return console[_0x44a92b(0x18f)](_0x44a92b(0x173)+_0xbeca2d[_0x44a92b(0x17a)]['id']),await handleSDKOutput([_0xbeca2d[_0x44a92b(0x17a)]],_0x116c30),0x0;}catch(_0x25c705){return handleSDKError(_0x25c705,_0x116c30),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a26_0x284cfc(0x180);[a26_0x284cfc(0x13b)]='Delete\x20an\x20agent';async[a26_0x284cfc(0x123)](_0x56c2aa){const _0x22486d=a26_0x284cfc,{options:_0x29169c,args:_0xb79d10,tdx:_0x545aef}=_0x56c2aa;if(_0xb79d10[_0x22486d(0x14a)]===0x0)return console[_0x22486d(0x17e)](_0x22486d(0x16d)),console[_0x22486d(0x17e)](_0x22486d(0x199)),0x1;const _0x5bca86=_0xb79d10[0x0];try{const _0x5b471c=await getProjectIdOrDefault(_0x56c2aa),_0x3a7708=await withSpinner(_0x22486d(0x14c)+_0x5bca86+'\x27...',()=>_0x545aef[_0x22486d(0x190)]['resolveAgentId'](_0x5bca86,_0x5b471c),{'verbose':_0x29169c['verbose']}),_0x5787d4=_0x3a7708[_0x22486d(0x17a)];return await withSpinner(_0x22486d(0x15d),()=>_0x545aef[_0x22486d(0x190)]['deleteAgent'](_0x5787d4),{'verbose':_0x29169c[_0x22486d(0x183)]}),console[_0x22486d(0x18f)](_0x22486d(0x121)+_0x5787d4),0x0;}catch(_0x30dead){return handleSDKError(_0x30dead,_0x29169c),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x1a3);['description']=a26_0x284cfc(0x1d5);async[a26_0x284cfc(0x123)](_0x48e134){const _0x469768=a26_0x284cfc;return executeChatHistoryCommand(_0x48e134,_0x469768(0x130));}}export class LLMUseCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]='llm:use';[a26_0x284cfc(0x13b)]='Set\x20current\x20project\x20context';async[a26_0x284cfc(0x123)](_0x3390e8){const _0x299a4c=a26_0x284cfc,{options:_0x1de3a3,args:_0x25dec2,tdx:_0x7be89e}=_0x3390e8;if(_0x25dec2[_0x299a4c(0x14a)]===0x0)return console[_0x299a4c(0x17e)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x299a4c(0x143)),0x1;const _0x3f98a0=_0x25dec2[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x3f98a0+'\x27...',()=>_0x7be89e[_0x299a4c(0x190)][_0x299a4c(0x1cc)](_0x3f98a0),{'verbose':_0x1de3a3[_0x299a4c(0x183)]}),console[_0x299a4c(0x18f)](_0x299a4c(0x150)+_0x3f98a0),0x0;}catch(_0x59e786){return handleSDKError(_0x59e786,_0x1de3a3),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']='llm:project:create';['description']=a26_0x284cfc(0x129);async['execute'](_0x5a1c78){const _0x3cbe60=a26_0x284cfc,{options:_0x54df55,args:_0x216c63,tdx:_0x55e449}=_0x5a1c78;if(_0x216c63[_0x3cbe60(0x14a)]===0x0)return console[_0x3cbe60(0x17e)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3cbe60(0x17e)](_0x3cbe60(0x11f)),0x1;const _0x13c2d9=_0x216c63[0x0],_0x117c99=_0x54df55,_0x25cadc=_0x117c99[_0x3cbe60(0x13b)];try{const _0x45d72b=await withSpinner(_0x3cbe60(0x178)+_0x13c2d9+_0x3cbe60(0x128),()=>_0x55e449[_0x3cbe60(0x190)][_0x3cbe60(0x191)]({'name':_0x13c2d9,'description':_0x25cadc}),{'verbose':_0x54df55[_0x3cbe60(0x183)]});console[_0x3cbe60(0x18f)](_0x3cbe60(0x1c6)+_0x45d72b[_0x3cbe60(0x17a)]['id']);const _0x2f3ec0=toLLMProjectInfo(_0x45d72b[_0x3cbe60(0x17a)]);return await handleSDKOutput([_0x2f3ec0],_0x54df55),0x0;}catch(_0x12e035){return handleSDKError(_0x12e035,_0x54df55),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a26_0x284cfc(0x182);[a26_0x284cfc(0x13b)]='Delete\x20an\x20LLM\x20project';async['execute'](_0x426586){const _0x39fed5=a26_0x284cfc,{options:_0x349e8c,args:_0xe47a5a,tdx:_0x5a9305}=_0x426586;if(_0xe47a5a[_0x39fed5(0x14a)]===0x0)return console[_0x39fed5(0x17e)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x39fed5(0x17e)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x17cf24=_0xe47a5a[0x0];try{return await withSpinner(_0x39fed5(0x1c2)+_0x17cf24+_0x39fed5(0x128),()=>_0x5a9305[_0x39fed5(0x190)][_0x39fed5(0x165)](_0x17cf24),{'verbose':_0x349e8c['verbose']}),console['log'](_0x39fed5(0x12c)+_0x17cf24),0x0;}catch(_0x4b6502){return handleSDKError(_0x4b6502,_0x349e8c),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x1be);[a26_0x284cfc(0x13b)]=a26_0x284cfc(0x171);async[a26_0x284cfc(0x123)](_0x3d53ce){const _0x4ede9e=a26_0x284cfc,{options:_0x3cfa2a,args:_0x46e865,tdx:_0xf3b191}=_0x3d53ce;if(_0x46e865[_0x4ede9e(0x14a)]===0x0)return console['error'](_0x4ede9e(0x168)),console[_0x4ede9e(0x17e)](_0x4ede9e(0x144)),0x1;const _0x3e6566=_0x46e865[0x0],_0x4357a8=_0x3cfa2a,_0x5caefd=_0x4357a8[_0x4ede9e(0x137)],_0x3d9041=_0x4357a8[_0x4ede9e(0x1d7)];try{const _0x39e701=_0x5caefd||_0x3e6566+_0x4ede9e(0x14d);if(a26_0x2cce35[_0x4ede9e(0x1c9)](_0x39e701)&&!_0x3d9041){if(!_0x3cfa2a['yes']){const _0x666a35=await confirm(_0x4ede9e(0x17b)+_0x39e701+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x666a35)return console[_0x4ede9e(0x18f)]('Backup\x20cancelled.'),0x0;}a26_0x2cce35[_0x4ede9e(0x154)](_0x39e701,{'recursive':!![]});}const _0x56a71b=await withSpinner(_0x3d9041?_0x4ede9e(0x188)+_0x3e6566+_0x4ede9e(0x128):_0x4ede9e(0x157)+_0x3e6566+_0x4ede9e(0x128),()=>_0xf3b191[_0x4ede9e(0x190)]['backupProject'](_0x3e6566,_0x5caefd,{'dryRun':_0x3d9041}),{'verbose':_0x3cfa2a['verbose']}),_0x99e004=_0x56a71b[_0x4ede9e(0x17a)];return _0x3d9041?console[_0x4ede9e(0x18f)](_0x4ede9e(0x18d)+_0x99e004[_0x4ede9e(0x1d6)]):console[_0x4ede9e(0x18f)](_0x4ede9e(0x126)+_0x99e004['outputDir']),console[_0x4ede9e(0x18f)](_0x4ede9e(0x1a8)+_0x99e004['counts'][_0x4ede9e(0x12f)]),console[_0x4ede9e(0x18f)](_0x4ede9e(0x1da)+_0x99e004['counts'][_0x4ede9e(0x15c)]),console[_0x4ede9e(0x18f)]('\x20\x20Prompts:\x20'+_0x99e004[_0x4ede9e(0x146)]['prompts']),console[_0x4ede9e(0x18f)](_0x4ede9e(0x14b)+_0x99e004[_0x4ede9e(0x146)]['integrations']),(_0x3cfa2a[_0x4ede9e(0x19a)]===_0x4ede9e(0x1bf)||_0x3cfa2a[_0x4ede9e(0x19a)]===_0x4ede9e(0x13e))&&await handleSDKOutput([_0x99e004],_0x3cfa2a),0x0;}catch(_0xf209f9){return handleSDKError(_0xf209f9,_0x3cfa2a),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x1c3);[a26_0x284cfc(0x13b)]='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder';async[a26_0x284cfc(0x123)](_0x391903){const _0x3eb301=a26_0x284cfc,{options:_0x1cb30e,args:_0x4f2b20,tdx:_0x3cb8e5}=_0x391903;if(_0x4f2b20[_0x3eb301(0x14a)]===0x0)return console[_0x3eb301(0x17e)](_0x3eb301(0x161)),console[_0x3eb301(0x17e)](_0x3eb301(0x1a6)),0x1;const _0x13d4c1=_0x4f2b20[0x0],_0x4cb05e=_0x1cb30e,_0x251559=_0x4cb05e[_0x3eb301(0x1b7)],_0x295278=_0x4cb05e[_0x3eb301(0x1d7)];try{if(!_0x295278){const _0x16c589=_0x3cb8e5[_0x3eb301(0x190)][_0x3eb301(0x1a2)](_0x13d4c1),_0x55ea3a=_0x251559||_0x16c589[_0x3eb301(0x177)]['projectName'],_0x1050e6=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x3cb8e5['llm'][_0x3eb301(0x11b)](),{'verbose':_0x1cb30e[_0x3eb301(0x183)]}),_0x1b78cc=_0x1050e6[_0x3eb301(0x17a)][_0x3eb301(0x174)](_0x4b5e27=>_0x4b5e27['attributes'][_0x3eb301(0x1b7)]===_0x55ea3a);if(_0x1b78cc&&!_0x1cb30e[_0x3eb301(0x1d9)]){const _0x598e79=await confirm(_0x3eb301(0x1b6)+_0x55ea3a+_0x3eb301(0x1ae));if(!_0x598e79)return console['log'](_0x3eb301(0x1a1)),0x0;}}const _0x379164=await withSpinner(_0x295278?_0x3eb301(0x152)+_0x13d4c1+_0x3eb301(0x128):_0x3eb301(0x127)+_0x13d4c1+_0x3eb301(0x128),()=>_0x3cb8e5[_0x3eb301(0x190)]['restoreProject'](_0x13d4c1,{'name':_0x251559,'dryRun':_0x295278}),{'verbose':_0x1cb30e[_0x3eb301(0x183)]}),_0x4cbeec=_0x379164[_0x3eb301(0x17a)];return _0x4cbeec[_0x3eb301(0x197)]&&console[_0x3eb301(0x18f)](_0x3eb301(0x1e2)+_0x4cbeec['sourceSite']+'\x27'),_0x295278?console[_0x3eb301(0x18f)](_0x3eb301(0x147)+_0x4cbeec[_0x3eb301(0x1ce)]):console[_0x3eb301(0x18f)](_0x3eb301(0x16a)+_0x4cbeec[_0x3eb301(0x1ce)]+'\x20('+_0x4cbeec[_0x3eb301(0x145)]+')'),console['log'](_0x3eb301(0x1a8)+_0x4cbeec[_0x3eb301(0x146)][_0x3eb301(0x12f)]),console[_0x3eb301(0x18f)](_0x3eb301(0x1da)+_0x4cbeec['counts'][_0x3eb301(0x15c)]),console[_0x3eb301(0x18f)](_0x3eb301(0x1db)+_0x4cbeec[_0x3eb301(0x146)]['prompts']),console[_0x3eb301(0x18f)](_0x3eb301(0x14b)+_0x4cbeec[_0x3eb301(0x146)][_0x3eb301(0x1cb)]),(_0x1cb30e['format']===_0x3eb301(0x1bf)||_0x1cb30e[_0x3eb301(0x19a)]==='jsonl')&&await handleSDKOutput([_0x4cbeec],_0x1cb30e),0x0;}catch(_0x4d694b){return handleSDKError(_0x4d694b,_0x1cb30e),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x527cf6,_0x5f1463){const _0x187d55=a26_0x284cfc,_0x29aa9c=_0x5f1463[_0x187d55(0x1aa)]||CHAT_SELECTOR_PAGE_SIZE;let _0x4349a5=0x0,_0x3face1=[];const _0x40be59=(await import(_0x187d55(0x1b9)))[_0x187d55(0x1bc)],_0x442c00=getChalk(_0x5f1463);while(!![]){const _0x18043e=await withSpinner(_0x187d55(0x1c8),()=>_0x527cf6[_0x187d55(0x190)][_0x187d55(0x1d3)](_0x29aa9c+_0x4349a5),{'verbose':_0x5f1463[_0x187d55(0x183)]});_0x3face1=_0x18043e[_0x187d55(0x17a)];const _0x2a170d=_0x3face1[_0x187d55(0x16b)](_0x4349a5,_0x4349a5+_0x29aa9c),_0x105393=_0x3face1['length']>_0x4349a5+_0x29aa9c,_0x230b79=[...new Set(_0x2a170d[_0x187d55(0x1ac)](_0x24b9a7=>_0x24b9a7['attributes'][_0x187d55(0x1bd)])[_0x187d55(0x1ad)](_0x448bb7=>_0x448bb7!==undefined))],_0x8dc88=new Map();await Promise[_0x187d55(0x1e1)](_0x230b79[_0x187d55(0x1ac)](async _0x48558a=>{const _0x12ce3b=_0x187d55;try{const _0x4cfa51=await _0x527cf6[_0x12ce3b(0x190)][_0x12ce3b(0x18e)](_0x48558a);_0x8dc88[_0x12ce3b(0x19f)](_0x48558a,_0x4cfa51[_0x12ce3b(0x175)][_0x12ce3b(0x1b7)]);}catch{_0x8dc88[_0x12ce3b(0x19f)](_0x48558a,_0x48558a);}}));const _0x487ca7=_0x2a170d['map'](_0x22eb17=>{const _0x305846=_0x187d55,_0xedefd=_0x22eb17[_0x305846(0x175)][_0x305846(0x1a7)]||_0x305846(0x1c4),_0x5d2c28=_0xedefd[_0x305846(0x1dd)]('\x0a')[0x0],_0x1efda8=_0x5d2c28[_0x305846(0x14a)]>0x50?_0x5d2c28[_0x305846(0x158)](0x0,0x4d)+_0x305846(0x1af):_0x5d2c28,_0x552b7b=_0x22eb17['attributes'][_0x305846(0x1bd)]?_0x8dc88[_0x305846(0x184)](_0x22eb17[_0x305846(0x175)][_0x305846(0x1bd)])||_0x22eb17[_0x305846(0x175)][_0x305846(0x1bd)]:'(no\x20agent)',_0x2c9979=_0x22eb17[_0x305846(0x175)][_0x305846(0x1dc)]||_0x22eb17['attributes'][_0x305846(0x194)],_0x43a618=new Date(_0x2c9979),_0x45df1e=new Date(),_0x5e6adb=_0x45df1e[_0x305846(0x19e)]()-_0x43a618[_0x305846(0x19e)](),_0x2d0caf=Math[_0x305846(0x15b)](_0x5e6adb/0xea60),_0x63bac0=Math['floor'](_0x5e6adb/0x36ee80),_0xebc0f2=Math[_0x305846(0x15b)](_0x5e6adb/0x5265c00);let _0x459b77;if(_0x2d0caf<0x1)_0x459b77=_0x305846(0x122);else{if(_0x2d0caf<0x3c)_0x459b77=_0x2d0caf+'m\x20ago';else{if(_0x63bac0<0x18)_0x459b77=_0x63bac0+_0x305846(0x125);else _0xebc0f2<0x7?_0x459b77=_0xebc0f2+_0x305846(0x19d):_0x459b77=_0x43a618['toLocaleDateString']('en-US',{'month':_0x305846(0x18c),'day':'numeric'});}}return{'title':_0x1efda8+'\x20'+_0x442c00[_0x305846(0x1d8)]('['+_0x552b7b+']\x20'+_0x459b77),'value':_0x22eb17['id']};});_0x105393&&_0x487ca7[_0x187d55(0x142)]({'title':_0x442c00['cyan']('Load\x20more...'),'value':'__load_more__'});const _0x1edf73=await _0x40be59({'type':_0x187d55(0x156),'name':_0x187d55(0x193),'message':_0x187d55(0x1a0),'choices':_0x487ca7,'hint':_0x187d55(0x1a9)});if(!_0x1edf73['chatId'])return undefined;if(_0x1edf73[_0x187d55(0x193)]===_0x187d55(0x1bb)){_0x4349a5+=_0x29aa9c;continue;}return _0x1edf73[_0x187d55(0x193)];}}export class ChatsCommand extends BaseCommand{[a26_0x284cfc(0x1b7)]=a26_0x284cfc(0x1d3);['description']=a26_0x284cfc(0x131);async[a26_0x284cfc(0x123)](_0x448262){const _0x9e6c4e=a26_0x284cfc;return executeChatHistoryCommand(_0x448262,_0x9e6c4e(0x11a));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x34631a=a27_0x5d7f;function a27_0x3bfc(){const _0x5796a5=['This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','SIGINT','1540467llVsOD','yellow','\x20\x20Agents:','14NvfwBH','\x0aTesting\x20with\x20Agent\x20SDK:','2537592LfYMLI','\x27\x20not\x20found','green','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','port','\x20\x20Project:','site','1332245pmCqEt','cyan','name','812940SDBQkz','\x0aClaude\x20Code\x20Configuration:','find','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,','projects','getOrCreateDefaultProject','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','start','Port\x20','llm:proxy','bold','9266328DwJhao','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','Project\x20\x27','17175708rTSlYj','close','log','init','dim','\x20\x20}','30AgTIdm','http://0.0.0.0:','\x20\x20Address:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x0a\x0aShutting\x20down\x20proxy\x20server...','white','attributes','2DmRyvw','execute','server','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','Server\x20Configuration:','project','6593935PqxGfU','llm','4sRFofS','created\x20on-demand\x20per\x20model','SIGTERM','stop','logger'];a27_0x3bfc=function(){return _0x5796a5;};return a27_0x3bfc();}function a27_0x5d7f(_0x43adf6,_0x401779){_0x43adf6=_0x43adf6-0x17d;const _0x3bfc33=a27_0x3bfc();let _0x5d7f2d=_0x3bfc33[_0x43adf6];return _0x5d7f2d;}(function(_0x3fae76,_0x4be395){const _0x126593=a27_0x5d7f,_0x30a73e=_0x3fae76();while(!![]){try{const _0x638409=-parseInt(_0x126593(0x1a1))/0x1*(parseInt(_0x126593(0x185))/0x2)+parseInt(_0x126593(0x199))/0x3+parseInt(_0x126593(0x18d))/0x4*(parseInt(_0x126593(0x18b))/0x5)+parseInt(_0x126593(0x1a4))/0x6*(-parseInt(_0x126593(0x197))/0x7)+parseInt(_0x126593(0x1b0))/0x8+-parseInt(_0x126593(0x194))/0x9*(-parseInt(_0x126593(0x17d))/0xa)+-parseInt(_0x126593(0x1b3))/0xb;if(_0x638409===_0x4be395)break;else _0x30a73e['push'](_0x30a73e['shift']());}catch(_0x1e946c){_0x30a73e['push'](_0x30a73e['shift']());}}}(a27_0x3bfc,0xa4022));import a27_0x2c765e from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0xd626d7,_0x57ada1){const _0x111fd0=a27_0x5d7f,{tdx:_0x3817b1,options:_0x415628}=_0xd626d7,_0x19c39b=_0x57ada1||_0x415628['llmProject'];if(_0x19c39b){const _0x516020=await _0x3817b1[_0x111fd0(0x18c)][_0x111fd0(0x1a9)](),_0x1d0017=_0x516020[_0x111fd0(0x1a6)](_0x54ddea=>_0x54ddea[_0x111fd0(0x184)][_0x111fd0(0x1a3)]===_0x19c39b);if(!_0x1d0017)throw new SDKError(ErrorCode['NOT_FOUND'],_0x111fd0(0x1b2)+_0x19c39b+_0x111fd0(0x19a),undefined,{'helpText':_0x111fd0(0x1b1)});return _0x1d0017['id'];}const _0x12b86a=await _0x3817b1['llm'][_0x111fd0(0x1aa)]();return _0x12b86a['id'];}export class LLMProxyCommand extends BaseCommand{['name']=a27_0x34631a(0x1ae);['description']=a27_0x34631a(0x1ab);[a27_0x34631a(0x187)];[a27_0x34631a(0x191)];async[a27_0x34631a(0x186)](_0x5c334d){const _0xf05cd5=a27_0x34631a,{tdx:_0x5b5dd8,options:_0x4e6cbc}=_0x5c334d;try{const _0x30abde=_0x4e6cbc,_0x7c98de=_0x30abde[_0xf05cd5(0x19e)]||0xfa0,_0x342571=_0x30abde[_0xf05cd5(0x18a)],_0x51a050=await findAvailablePort(_0x7c98de);console[_0xf05cd5(0x1b5)](a27_0x2c765e['dim']('Resolving\x20project...'));const _0x4c254f=await getProjectIdOrDefault(_0x5c334d,_0x342571),_0x1c96eb=await _0x5b5dd8[_0xf05cd5(0x18c)][_0xf05cd5(0x1a9)](),_0x18d5c3=_0x1c96eb[_0xf05cd5(0x1a6)](_0x159564=>_0x159564['id']===_0x4c254f);this[_0xf05cd5(0x191)]=new TDXLogger(_0x4e6cbc['logLevel']),await this[_0xf05cd5(0x191)][_0xf05cd5(0x1b6)](),console[_0xf05cd5(0x1b5)](a27_0x2c765e['dim']('Starting\x20proxy\x20server...'));_0x51a050!==_0x7c98de&&console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x195)](_0xf05cd5(0x1ad)+_0x7c98de+'\x20is\x20unavailable,\x20using\x20port\x20'+_0x51a050));this['server']=new ProxyServer({'port':_0x51a050,'projectId':_0x4c254f,'tdx':_0x5b5dd8,'logger':this[_0xf05cd5(0x191)],'site':_0x4e6cbc[_0xf05cd5(0x1a0)]}),await this['server'][_0xf05cd5(0x1ac)](),console[_0xf05cd5(0x1b5)](a27_0x2c765e['yellow'][_0xf05cd5(0x1af)](_0xf05cd5(0x19c))),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x195)](_0xf05cd5(0x192))),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x195)](_0xf05cd5(0x19d))),console[_0xf05cd5(0x1b5)](a27_0x2c765e['green'][_0xf05cd5(0x1af)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console[_0xf05cd5(0x1b5)](a27_0x2c765e['cyan'](_0xf05cd5(0x189))),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x1b7)](_0xf05cd5(0x17f)),a27_0x2c765e['white'](_0xf05cd5(0x17e)+_0x51a050)),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x1b7)](_0xf05cd5(0x19f)),a27_0x2c765e['white'](_0x18d5c3?.[_0xf05cd5(0x184)][_0xf05cd5(0x1a3)]||_0x4c254f)),console[_0xf05cd5(0x1b5)](a27_0x2c765e['dim'](_0xf05cd5(0x196)),a27_0x2c765e[_0xf05cd5(0x183)](_0xf05cd5(0x18e))),console['log'](a27_0x2c765e[_0xf05cd5(0x1b7)]('\x20\x20Site:'),a27_0x2c765e[_0xf05cd5(0x183)](_0x4e6cbc[_0xf05cd5(0x1a0)])),console['log'](a27_0x2c765e[_0xf05cd5(0x1a2)](_0xf05cd5(0x1a5))),console['log'](a27_0x2c765e[_0xf05cd5(0x1b7)](_0xf05cd5(0x181))),console['log'](a27_0x2c765e[_0xf05cd5(0x183)]('\x20\x20{')),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x183)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x183)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x51a050+'\x22,')),console[_0xf05cd5(0x1b5)](a27_0x2c765e['white'](_0xf05cd5(0x1a8))),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x183)](_0xf05cd5(0x180))),console['log'](a27_0x2c765e['white']('\x20\x20\x20\x20}')),console['log'](a27_0x2c765e[_0xf05cd5(0x183)](_0xf05cd5(0x1b8))),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x1a2)](_0xf05cd5(0x198))),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x1b7)]('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0xf05cd5(0x1b5)](a27_0x2c765e[_0xf05cd5(0x1b7)](_0xf05cd5(0x188))),console[_0xf05cd5(0x1b5)](a27_0x2c765e['dim']('\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a')),console['log'](a27_0x2c765e[_0xf05cd5(0x195)](_0xf05cd5(0x1a7)));const _0x18ef4a=async()=>{const _0x4b85fb=_0xf05cd5;console[_0x4b85fb(0x1b5)](a27_0x2c765e[_0x4b85fb(0x1b7)](_0x4b85fb(0x182))),this[_0x4b85fb(0x187)]&&await this[_0x4b85fb(0x187)]['stop'](),this[_0x4b85fb(0x191)]&&await this[_0x4b85fb(0x191)][_0x4b85fb(0x1b4)](),console[_0x4b85fb(0x1b5)](a27_0x2c765e[_0x4b85fb(0x19b)]('✓\x20Proxy\x20server\x20stopped')),process['exit'](0x0);};return process['on'](_0xf05cd5(0x193),_0x18ef4a),process['on'](_0xf05cd5(0x18f),_0x18ef4a),await new Promise(()=>{}),0x0;}catch(_0x45c26e){this['server']&&await this[_0xf05cd5(0x187)][_0xf05cd5(0x190)]();this[_0xf05cd5(0x191)]&&await this[_0xf05cd5(0x191)][_0xf05cd5(0x1b4)]();throw _0x45c26e;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a28_0x2abed2=a28_0x1b8f;(function(_0x21d090,_0x7adf50){const _0xe792d6=a28_0x1b8f,_0xbfa133=_0x21d090();while(!![]){try{const _0x4dbc2e=-parseInt(_0xe792d6(0x201))/0x1*(parseInt(_0xe792d6(0x196))/0x2)+-parseInt(_0xe792d6(0x213))/0x3+-parseInt(_0xe792d6(0x28d))/0x4*(-parseInt(_0xe792d6(0x2b6))/0x5)+-parseInt(_0xe792d6(0x20f))/0x6+-parseInt(_0xe792d6(0x231))/0x7+-parseInt(_0xe792d6(0x2a3))/0x8*(-parseInt(_0xe792d6(0x24c))/0x9)+parseInt(_0xe792d6(0x2b4))/0xa;if(_0x4dbc2e===_0x7adf50)break;else _0xbfa133['push'](_0xbfa133['shift']());}catch(_0x44b77a){_0xbfa133['push'](_0xbfa133['shift']());}}}(a28_0x2e2c,0x81ef9));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a28_0x55bf65 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a28_0x595089 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a28_0x2abed2(0x292);function openBrowser(_0x45cd8e){const _0x17841f=a28_0x2abed2,_0x3c98ee=process[_0x17841f(0x1e5)],_0x457203=_0x3c98ee===_0x17841f(0x1b0)?_0x17841f(0x1fb):_0x3c98ee==='win32'?'start':_0x17841f(0x1b1);spawn(_0x457203,[_0x45cd8e],{'detached':!![],'stdio':_0x17841f(0x1be)})[_0x17841f(0x288)]();}function migrateLegacyDirectory(){const _0x31ea28=a28_0x2abed2;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x573c4c=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x573c4c['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x31ea28(0x29e)](a28_0x595089[_0x31ea28(0x19a)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x31ea28(0x216)+PARENT_SEGMENT_DIR+_0x31ea28(0x223))),console[_0x31ea28(0x29e)](a28_0x595089[_0x31ea28(0x2af)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x31ea28(0x241))),![];console[_0x31ea28(0x29e)](a28_0x595089['yellow'](_0x31ea28(0x258)+LEGACY_PARENT_SEGMENT_DIR+_0x31ea28(0x195)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x31ea28(0x29e)](a28_0x595089['green'](_0x31ea28(0x1a7)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x230157){const _0x1550f5=_0x230157 instanceof Error?_0x230157[_0x31ea28(0x1c6)]:String(_0x230157);return console[_0x31ea28(0x29e)](a28_0x595089[_0x31ea28(0x205)](_0x31ea28(0x28b)+_0x1550f5+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a28_0x2abed2(0x22e)](_0x3be120){const _0x4624f4=a28_0x2abed2;return migrateLegacyDirectory(),super[_0x4624f4(0x22e)](_0x3be120);}}function resolveYamlFile(_0x3067e6){const _0xde926d=a28_0x2abed2;if(_0x3067e6['endsWith'](_0xde926d(0x1d4))||_0x3067e6[_0xde926d(0x1e2)](_0xde926d(0x1a1)))return _0x3067e6;return a28_0x55bf65[_0xde926d(0x29c)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3067e6)+_0xde926d(0x1d4));}function formatProgressMessage(_0x287e79){const _0x1ff917=a28_0x2abed2,_0x5ed7f5=_0x287e79['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5ed7f5){const [,_0x2c5f15,_0x1f6e6c,_0xd0624='']=_0x5ed7f5;return a28_0x595089[_0x1ff917(0x2af)](_0x2c5f15+':')+'\x20'+_0x1f6e6c+a28_0x595089['dim'](_0xd0624);}return a28_0x595089[_0x1ff917(0x2af)](_0x287e79);}function showFileNotFoundError(_0x36d4ba,_0x29a21c){const _0x31bee9=a28_0x2abed2;console['error'](a28_0x595089[_0x31bee9(0x205)](_0x31bee9(0x1e3)+_0x36d4ba+'\x0a')),console[_0x31bee9(0x29e)](a28_0x595089['cyan'](_0x31bee9(0x254)+_0x29a21c+_0x31bee9(0x194)));}function showParentSegmentNotSetError(_0x3cf70c){const _0x11381d=a28_0x2abed2;console[_0x11381d(0x29e)](a28_0x595089['yellow'](_0x11381d(0x261))),console[_0x11381d(0x29e)](_0x3cf70c);}export class ParentSegmentListCommand extends BaseCommand{['name']=a28_0x2abed2(0x19d);[a28_0x2abed2(0x1f3)]='List\x20parent\x20segments';async[a28_0x2abed2(0x1e1)](_0x16606c){const _0x5f555f=a28_0x2abed2,{options:_0x41bc06,args:_0x17af1f,tdx:_0x48f99b}=_0x16606c,_0x4894c7=_0x17af1f[0x0];_0x41bc06['verbose']&&(console[_0x5f555f(0x29e)]('Site:\x20'+_0x41bc06[_0x5f555f(0x1ec)]),_0x4894c7&&console[_0x5f555f(0x29e)](_0x5f555f(0x262)+_0x4894c7));const _0x228562=await withSpinner(_0x4894c7?_0x5f555f(0x26c)+_0x4894c7+_0x5f555f(0x26d):_0x5f555f(0x2a9),()=>_0x48f99b['segment'][_0x5f555f(0x24b)](),{'verbose':_0x41bc06[_0x5f555f(0x1e7)]});let _0x5a0450=_0x228562['data'];if(_0x4894c7){const _0x4246ec=_0x4894c7[_0x5f555f(0x25b)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x5f555f(0x25b)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x477cb6=new RegExp('^'+_0x4246ec+'$','i');_0x5a0450=_0x5a0450[_0x5f555f(0x285)](_0x32de5c=>_0x477cb6[_0x5f555f(0x299)](_0x32de5c[_0x5f555f(0x198)][_0x5f555f(0x1fe)]));}_0x5a0450[_0x5f555f(0x1ca)]((_0x326e7e,_0xae00ec)=>_0x326e7e['attributes'][_0x5f555f(0x1fe)][_0x5f555f(0x1c7)](_0xae00ec[_0x5f555f(0x198)][_0x5f555f(0x1fe)])),console['error'](_0x5f555f(0x1d7)+_0x5a0450[_0x5f555f(0x19c)]+'\x20parent\x20segment'+(_0x5a0450[_0x5f555f(0x19c)]!==0x1?'s':''));if(_0x41bc06[_0x5f555f(0x1fd)]===_0x5f555f(0x273)||_0x41bc06[_0x5f555f(0x1fd)]===_0x5f555f(0x234))await handleSDKOutput(_0x5a0450,_0x41bc06);else{if(_0x5a0450[_0x5f555f(0x19c)]===0x0)_0x4894c7?console[_0x5f555f(0x1cd)](_0x5f555f(0x1ac)+_0x4894c7):console['log'](_0x5f555f(0x192));else for(const _0x1d4ded of _0x5a0450){const _0x488aa1=_0x1d4ded[_0x5f555f(0x198)][_0x5f555f(0x29b)]?a28_0x595089[_0x5f555f(0x2af)]('\x20('+formatRows(_0x1d4ded[_0x5f555f(0x198)]['population'])+')'):'';console[_0x5f555f(0x1cd)](_0x5f555f(0x1ab)+_0x1d4ded[_0x5f555f(0x198)][_0x5f555f(0x1fe)]+_0x488aa1);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x1f2);[a28_0x2abed2(0x1f3)]=a28_0x2abed2(0x202);async[a28_0x2abed2(0x1e1)](_0x279bbd){const _0x578b4f=a28_0x2abed2,{options:_0x3baddf,args:_0x2a15c3,tdx:_0x1efc96}=_0x279bbd;console[_0x578b4f(0x29e)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x578b4f(0x214));const _0x344e94=_0x3baddf;if(_0x2a15c3[_0x578b4f(0x19c)]===0x0)return console[_0x578b4f(0x29e)](a28_0x595089[_0x578b4f(0x205)](_0x578b4f(0x245))),console[_0x578b4f(0x29e)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x397cb6=_0x2a15c3[0x0];if(!_0x344e94[_0x578b4f(0x1b5)]||!_0x344e94[_0x578b4f(0x22a)])return console[_0x578b4f(0x29e)](_0x578b4f(0x219)),console[_0x578b4f(0x29e)](_0x578b4f(0x1f6)),0x1;_0x344e94[_0x578b4f(0x1e7)]&&(console[_0x578b4f(0x29e)](_0x578b4f(0x244)+_0x344e94['site']),console[_0x578b4f(0x29e)](_0x578b4f(0x1b8)+_0x397cb6),console[_0x578b4f(0x29e)](_0x578b4f(0x1a8)+_0x344e94[_0x578b4f(0x1b5)]),console[_0x578b4f(0x29e)]('Table:\x20'+_0x344e94[_0x578b4f(0x22a)]));const _0x3a45cc=await loadJSONFromOptions(_0x344e94[_0x578b4f(0x198)],_0x344e94['attributesFile']),_0x514b08=await loadJSONFromOptions(_0x344e94['behaviors'],_0x344e94['behaviorsFile']),_0x47e5a9=await loadJSONFromOptions(_0x344e94[_0x578b4f(0x210)],_0x344e94[_0x578b4f(0x1b7)]),_0x2b1987={'name':_0x397cb6,'description':_0x344e94[_0x578b4f(0x1f3)],'scheduleType':_0x344e94[_0x578b4f(0x291)],'scheduleOption':_0x344e94['scheduleOption'],'timezone':_0x344e94[_0x578b4f(0x215)],'master':{'parentDatabaseName':_0x344e94[_0x578b4f(0x1b5)],'parentTableName':_0x344e94[_0x578b4f(0x22a)]},'attributes':_0x3a45cc,'behaviors':_0x514b08,'customerGroup':_0x47e5a9},_0x2c6a12=await withSpinner(_0x578b4f(0x27b)+_0x397cb6+_0x578b4f(0x26d),()=>_0x1efc96[_0x578b4f(0x1bb)][_0x578b4f(0x1e8)](_0x2b1987),{'verbose':_0x3baddf[_0x578b4f(0x1e7)]}),_0x39e18a=_0x2c6a12[_0x578b4f(0x1e0)];return console[_0x578b4f(0x29e)](_0x578b4f(0x270)+_0x39e18a[_0x578b4f(0x1fe)]+'\x27\x20with\x20ID:\x20'+_0x39e18a['id']),await handleSDKOutput([_0x39e18a],_0x3baddf),0x0;}}function a28_0x2e2c(){const _0x44d887=['label','format','name','workflowSessionId','Validate:','3IsEVmJ','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Events:','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','red','YAML\x20file:\x20','\x0a✔\x20Workflow\x20started','\x20Context\x20set:\x20','Master:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x0aNo\x20sample\x20data\x20available','workflowId','Columns:','schemaValid','4210302TXRmwX','customerGroup','Options\x20(one\x20required):\x0a','\x27\x20is\x20already\x20up\x20to\x20date','575259lyhArB','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','timezone','/\x20and\x20','totalEvents','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Error:\x20--database\x20and\x20--table\x20are\x20required','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Master\x20+\x20Attributes','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','toFixed','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','text','✔\x20Query\x20completed:\x20Processed\x20','/\x20directories\x20exist.','/sessions/','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','getParentSQL','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','processedRows','start','table','Fetching\x20sample\x20data...','\x20parent\x20segment\x20\x27','/attempt/','run','Join\x20on:','Updated','7126371cypzgr','displaySummary','Source:','jsonl','segment:parent:sql','joinKey','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Attributes','sampleData','\x0aChanges\x20to\x20apply\x20to\x20\x27','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Options:\x0a','workflowAttemptId','Error:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','/\x20directory.\x0a','Available\x20attributes:','resolveParentId','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20\x27','Customers:','segment:parent:fields','repeat','stats','listParents','63nfKMWd','schemaError','output','\x20\x20\x20\x20-\x20','Found\x20YAML\x20file:\x20','\x20No\x20changes\x20-\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','displayAttributesStats','segment:parent:view','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x0a⚠️\x20\x20Migrating:\x20','dirname','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','replace','customersWithEvents','\x20tdx\x20wf\x20attempt\x20','apply','segment:parent:pull','in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Pattern:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20--behavior\x20\x22','enriched','all','Updating\x20parent\x20segment\x20\x27','yes','SQL\x20query:\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','status','Listing\x20parent\x20segments\x20matching\x20\x27','\x27...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20--enriched','✔\x20Created\x20parent\x20segment\x20\x27','foreignKey','session','json','/app/workflows/','segment:parent:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','scheduleOption','addBehaviors','Analyzing\x20changes...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Creating\x20parent\x20segment\x20\x27','\x20--behavior\x20\x22<name>\x22','segment:parent:update','matchedCount','Audience\x20ID:','interval','addAttributes','Apply\x20changes\x20to\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','filter','errors','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','unref','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','pushParentYaml','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20field','40fqSUXY','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:preview','map','scheduleType','parent_segment','Attribute:','allValid','\x20is\x20already\x20up\x20to\x20date','use','Validating\x20configuration...','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','test','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','population','join','customerPercent','error','Creating','Status:','segment:parent:show','setJobId','1075592qPtbua','✔\x20No\x20changes\x20-\x20\x27','behavior','trim','displayPreviewHints','displayValidateResults','Listing\x20parent\x20segments...','Master\x20Table','green','displayColumns','Options:','Errors:','dim','limit','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','varchar','stop','12620090IBkZVm','number','417405WremEQ','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20[Job\x20ID:\x20','Join:','rowCount','Created','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20Opening\x20','No\x20parent\x20segments\x20found','Parent\x20segment:\x20','`\x20to\x20download\x20the\x20configuration\x20first','/\x20→\x20','396148QoApuu','Fetching\x20parent\x20segment\x20\x27','attributes','displayBehaviorsStats','yellow','toLocaleString','length','segment:parent:list','-1d','updateParent','getParentFull','.yaml','parentSegment','displaySampleData','segment:parent:validate','Executing\x20parent\x20segment\x20query...','preview','✔\x20Renamed\x20directory\x20to\x20','Database:\x20','string','cyan','👥\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20kill','information_schema','/{name}.yml\x0a','darwin','xdg-open','Updating','Create\x20parent\x20segment\x20\x27','previewParentYaml','database','Attempt:','customerGroupFile','Name:\x20','SELECT\x20*\x20FROM\x20(\x0a','Error\x20reading\x20file:\x20','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x0aUsage:\x20tdx\x20ps\x20preview\x20','ignore','jobId','columns','addBehaviorsFile','tdx\x20segment\x20parent\x20preview\x20','\x20=\x20','displayMasterInfo','/app/dw/parentSegments/','message','localeCompare','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','behaviors','sort','Available\x20behaviors:','column','log','utf-8','Rows:','audienceId','Show\x20parent\x20segment\x20details','web','bold','.yml','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Output\x20file:\x20','✔\x20Found\x20','%)\x20','Listing\x20fields\x20for\x20\x27','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x27\x20is\x20up\x20to\x20date','To\x20view\x20sample\x20data:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','coveragePercent','Behaviors','data','execute','endsWith','Error:\x20File\x20not\x20found:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','platform','Enriched:','verbose','createParent','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','displayPreviewResults','validateParentYaml','site','attribute','\x20rows)','\x0aNew\x20parent\x20segment\x20\x27','addAttributesFile','Session:','segment:parent:create','description','master','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x20rows\x20','\x20\x20No\x20sample\x20data\x20available','Resolving\x20parent\x20segment\x20\x27','Aborted.','open'];a28_0x2e2c=function(){return _0x44d887;};return a28_0x2e2c();}export class ParentSegmentUpdateCommand extends BaseCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x27d);[a28_0x2abed2(0x1f3)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a28_0x2abed2(0x1e1)](_0x24fc67){const _0x3c1f4d=a28_0x2abed2,{options:_0x49db73,args:_0x422aaf,tdx:_0x4756fb}=_0x24fc67;console[_0x3c1f4d(0x29e)](_0x3c1f4d(0x21e)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x47c9de=_0x49db73;if(_0x422aaf['length']===0x0)return console[_0x3c1f4d(0x29e)](a28_0x595089['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x3c1f4d(0x29e)](_0x3c1f4d(0x263)),0x1;const _0x38ef89=_0x422aaf[0x0];_0x47c9de['verbose']&&(console[_0x3c1f4d(0x29e)](_0x3c1f4d(0x244)+_0x47c9de[_0x3c1f4d(0x1ec)]),console[_0x3c1f4d(0x29e)](_0x3c1f4d(0x193)+_0x38ef89));const _0x50ef7a=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x38ef89+_0x3c1f4d(0x26d),()=>_0x4756fb['segment'][_0x3c1f4d(0x1a0)](_0x38ef89),{'verbose':_0x47c9de[_0x3c1f4d(0x1e7)]}),_0x66e5c5=_0x50ef7a[_0x3c1f4d(0x1e0)],_0x39e55b=await loadJSONFromOptions(_0x47c9de[_0x3c1f4d(0x281)],_0x47c9de[_0x3c1f4d(0x1f0)]),_0x387507=await loadJSONFromOptions(_0x47c9de[_0x3c1f4d(0x278)],_0x47c9de[_0x3c1f4d(0x1c1)]),_0x3c059b={'name':_0x66e5c5[_0x3c1f4d(0x1fe)],'description':_0x47c9de[_0x3c1f4d(0x1f3)]!==undefined?_0x47c9de['description']:_0x66e5c5[_0x3c1f4d(0x1f3)],'scheduleType':_0x47c9de['scheduleType']!==undefined?_0x47c9de[_0x3c1f4d(0x291)]:_0x66e5c5['scheduleType'],'scheduleOption':_0x47c9de['scheduleOption']!==undefined?_0x47c9de[_0x3c1f4d(0x277)]:_0x66e5c5[_0x3c1f4d(0x277)],'timezone':_0x47c9de[_0x3c1f4d(0x215)]!==undefined?_0x47c9de[_0x3c1f4d(0x215)]:_0x66e5c5[_0x3c1f4d(0x215)],'master':_0x66e5c5[_0x3c1f4d(0x1f4)],'attributes':_0x39e55b?[..._0x66e5c5[_0x3c1f4d(0x198)]||[],..._0x39e55b]:_0x66e5c5[_0x3c1f4d(0x198)],'behaviors':_0x387507?[..._0x66e5c5['behaviors']||[],..._0x387507]:_0x66e5c5[_0x3c1f4d(0x1c9)],'customerGroup':_0x66e5c5[_0x3c1f4d(0x210)]},_0x1dc335=await withSpinner(_0x3c1f4d(0x267)+_0x38ef89+_0x3c1f4d(0x26d),()=>_0x4756fb['segment'][_0x3c1f4d(0x19f)](_0x38ef89,_0x3c059b),{'verbose':_0x47c9de[_0x3c1f4d(0x1e7)]}),_0x322d9d=_0x1dc335[_0x3c1f4d(0x1e0)];return console['error']('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x322d9d[_0x3c1f4d(0x1fe)]+'\x27'),await handleSDKOutput([_0x322d9d],_0x47c9de),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a28_0x2abed2(0x25f);[a28_0x2abed2(0x1f3)]=a28_0x2abed2(0x20a);async[a28_0x2abed2(0x1e1)](_0x525fdf){const _0x8c1167=a28_0x2abed2,{options:_0x2ef19d,args:_0x12853d,tdx:_0x49500e}=_0x525fdf,_0x242383=_0x2ef19d,_0xa6aca6=_0x12853d[0x0]||_0x2ef19d[_0x8c1167(0x1a2)];if(!_0xa6aca6)return showParentSegmentNotSetError(_0x8c1167(0x204)+_0x8c1167(0x238)),0x1;if(_0x242383[_0x8c1167(0x296)]&&_0x242383['output'])return console[_0x8c1167(0x29e)](a28_0x595089[_0x8c1167(0x205)](_0x8c1167(0x1da))),console[_0x8c1167(0x29e)](a28_0x595089['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x8c1167(0x29e)](a28_0x595089[_0x8c1167(0x2af)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x8c1167(0x1af))),console[_0x8c1167(0x29e)](a28_0x595089['cyan'](_0x8c1167(0x252))),0x1;const _0x3761af=_0x242383[_0x8c1167(0x24e)]||a28_0x55bf65[_0x8c1167(0x29c)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xa6aca6)+_0x8c1167(0x1d4));_0x242383[_0x8c1167(0x1e7)]&&(console['error'](_0x8c1167(0x244)+_0x242383[_0x8c1167(0x1ec)]),console['error'](_0x8c1167(0x193)+_0xa6aca6),console[_0x8c1167(0x29e)](_0x8c1167(0x1d6)+_0x3761af));const _0x28e728=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0xa6aca6+_0x8c1167(0x26d),()=>_0x49500e['segment']['pullParentYaml'](_0xa6aca6),{'verbose':_0x242383['verbose']}),_0x42de1c=_0x28e728[_0x8c1167(0x1e0)];if(existsSync(_0x3761af)){const _0x295374=readFileSync(_0x3761af,_0x8c1167(0x1ce)),_0x45227c=generateDiff(_0x295374,_0x42de1c);if(!hasChanges(_0x45227c))console[_0x8c1167(0x29e)](a28_0x595089[_0x8c1167(0x2ab)]('✔')+_0x8c1167(0x251)+a28_0x595089[_0x8c1167(0x1aa)](_0x3761af)+_0x8c1167(0x295));else{console[_0x8c1167(0x29e)]('\x0aChanges\x20to\x20\x27'+_0x3761af+'\x27:'),console['error']('─'[_0x8c1167(0x249)](0x3c)),console['error'](formatDiffWithColors(_0x45227c)),console[_0x8c1167(0x29e)]('─'[_0x8c1167(0x249)](0x3c));if(!_0x242383[_0x8c1167(0x268)]){const _0x16f2ae=await confirmKey('Overwrite\x20\x27'+_0x3761af+'\x27?');if(!_0x16f2ae)return console[_0x8c1167(0x29e)](_0x8c1167(0x1fa)),0x1;}writeFileSync(_0x3761af,_0x42de1c,_0x8c1167(0x1ce)),console[_0x8c1167(0x29e)](a28_0x595089[_0x8c1167(0x2ab)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a28_0x595089[_0x8c1167(0x1aa)](_0x3761af));}}else{const _0x36f0c4=a28_0x55bf65[_0x8c1167(0x259)](_0x3761af);!existsSync(_0x36f0c4)&&mkdirSync(_0x36f0c4,{'recursive':!![]}),writeFileSync(_0x3761af,_0x42de1c,_0x8c1167(0x1ce)),console['error'](a28_0x595089[_0x8c1167(0x2ab)]('✔')+_0x8c1167(0x1e9)+a28_0x595089[_0x8c1167(0x1aa)](_0x3761af));}return saveSessionContext({'parent_segment':_0xa6aca6},_0x242383[_0x8c1167(0x272)]),console[_0x8c1167(0x29e)](a28_0x595089[_0x8c1167(0x2ab)]('✔')+_0x8c1167(0x208)+a28_0x595089[_0x8c1167(0x2af)](_0x8c1167(0x292))+_0x8c1167(0x1c3)+a28_0x595089['cyan'](_0xa6aca6)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x275);['description']=a28_0x2abed2(0x253);async[a28_0x2abed2(0x1e1)](_0x4b1e45){const _0x39f1b8=a28_0x2abed2,{options:_0x455cbd,args:_0xeb3a57,tdx:_0x407e0b}=_0x4b1e45,_0x30c0f0=_0x455cbd,_0x24bc94=_0xeb3a57[0x0]||_0x455cbd[_0x39f1b8(0x1a2)];if(!_0x24bc94)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 _0x13b471=resolveYamlFile(_0x24bc94);if(!existsSync(_0x13b471))return showFileNotFoundError(_0x13b471,_0x24bc94),0x1;_0x30c0f0[_0x39f1b8(0x1e7)]&&(console[_0x39f1b8(0x29e)](_0x39f1b8(0x244)+_0x30c0f0['site']),console[_0x39f1b8(0x29e)](_0x39f1b8(0x206)+_0x13b471));let _0x24d7cd;try{_0x24d7cd=readFileSync(_0x13b471,_0x39f1b8(0x1ce));}catch(_0x4e2baa){const _0x17e5b3=_0x4e2baa instanceof Error?_0x4e2baa[_0x39f1b8(0x1c6)]:String(_0x4e2baa);return console[_0x39f1b8(0x29e)]('Error\x20reading\x20file:\x20'+_0x17e5b3),0x1;}const _0x1c2eda=await withSpinner(_0x39f1b8(0x279),()=>_0x407e0b[_0x39f1b8(0x1bb)][_0x39f1b8(0x28a)](_0x24d7cd),{'verbose':_0x30c0f0[_0x39f1b8(0x1e7)]}),_0x61184e=_0x1c2eda[_0x39f1b8(0x1e0)],{isNew:_0x197fd1,name:_0x45d430,hasChanges:_0x1a42eb,diffFormatted:_0x11b819}=_0x61184e;if(!_0x1a42eb)return console[_0x39f1b8(0x29e)](_0x39f1b8(0x2a4)+_0x45d430+_0x39f1b8(0x212)),0x0;_0x197fd1?console[_0x39f1b8(0x29e)](_0x39f1b8(0x1ef)+_0x45d430+'\x27:'):console[_0x39f1b8(0x29e)](_0x39f1b8(0x23b)+_0x45d430+'\x27:');console['error']('─'[_0x39f1b8(0x249)](0x3c)),console[_0x39f1b8(0x29e)](_0x11b819),console[_0x39f1b8(0x29e)]('─'[_0x39f1b8(0x249)](0x3c));const _0x2e2ff7=_0x197fd1?_0x39f1b8(0x1b3)+_0x45d430+'\x27?':_0x39f1b8(0x282)+_0x45d430+'\x27?';if(!_0x30c0f0[_0x39f1b8(0x268)]){const _0x4b5150=await confirmKey(_0x2e2ff7);if(!_0x4b5150)return console[_0x39f1b8(0x29e)](_0x39f1b8(0x1fa)),0x1;}const _0x5819bd=_0x197fd1?_0x39f1b8(0x29f):_0x39f1b8(0x1b2),_0x509ce8=await withSpinner(_0x5819bd+'\x20parent\x20segment\x20\x27'+_0x45d430+_0x39f1b8(0x26d),()=>_0x61184e[_0x39f1b8(0x25e)](),{'verbose':_0x30c0f0[_0x39f1b8(0x1e7)]}),_0x21d3fc=_0x509ce8['data'],_0x4c891d=getConsoleNextUrl(_0x30c0f0[_0x39f1b8(0x1ec)],_0x39f1b8(0x1c5)+_0x21d3fc['id']),_0x27cbc4=_0x197fd1?'Created':_0x39f1b8(0x230);return console['error']('✔\x20'+_0x27cbc4+_0x39f1b8(0x22c)+_0x21d3fc[_0x39f1b8(0x1fe)]+'\x27'),console['error']('\x20\x20'+_0x4c891d),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x1a4);['description']=a28_0x2abed2(0x21a);async[a28_0x2abed2(0x1e1)](_0x907df8){const _0x363723=a28_0x2abed2,{options:_0xa00cd6,args:_0xcd38bd,tdx:_0x290bf8}=_0x907df8,_0x2f5e26=_0xa00cd6,_0x24bce0=_0xcd38bd[0x0]||_0xa00cd6[_0x363723(0x1a2)];if(!_0x24bce0)return showParentSegmentNotSetError(_0x363723(0x26a)+_0x363723(0x18f)+_0x363723(0x23d)+_0x363723(0x289)+_0x363723(0x21d)+_0x363723(0x240)),0x1;const _0x17de0f=resolveYamlFile(_0x24bce0);if(!existsSync(_0x17de0f))return showFileNotFoundError(_0x17de0f,_0x24bce0),0x1;_0x2f5e26[_0x363723(0x1e7)]&&(console[_0x363723(0x29e)](_0x363723(0x244)+_0x2f5e26['site']),console['error'](_0x363723(0x206)+_0x17de0f));let _0x1871cd;try{_0x1871cd=readFileSync(_0x17de0f,_0x363723(0x1ce));}catch(_0x76d07b){const _0x2f34ad=_0x76d07b instanceof Error?_0x76d07b[_0x363723(0x1c6)]:String(_0x76d07b);return console['error'](_0x363723(0x1ba)+_0x2f34ad),0x1;}const _0x503f0d=createCommandSpinner(a28_0x595089[_0x363723(0x2af)](_0x363723(0x297)),{'verbose':_0x2f5e26[_0x363723(0x1e7)]});_0x503f0d[_0x363723(0x229)]();const _0x10c16f={'onProgress':_0x3ae526=>{const _0x5e6cdc=_0x363723;_0x503f0d[_0x5e6cdc(0x221)]=formatProgressMessage(_0x3ae526);}};if(_0x2f5e26[_0x363723(0x1f4)])_0x10c16f[_0x363723(0x1f4)]=!![];if(_0x2f5e26[_0x363723(0x265)])_0x10c16f['enriched']=!![];_0x2f5e26[_0x363723(0x1ed)]&&(_0x10c16f[_0x363723(0x1ed)]=_0x2f5e26[_0x363723(0x1ed)]);_0x2f5e26[_0x363723(0x2a5)]&&(_0x10c16f[_0x363723(0x2a5)]=_0x2f5e26[_0x363723(0x2a5)]);if(_0x2f5e26[_0x363723(0x280)])_0x10c16f[_0x363723(0x280)]=_0x2f5e26[_0x363723(0x280)];let _0x41f402;try{_0x41f402=await _0x290bf8[_0x363723(0x1bb)][_0x363723(0x1eb)](_0x1871cd,_0x10c16f),_0x503f0d[_0x363723(0x2b3)]();}catch(_0x5643e0){_0x503f0d[_0x363723(0x2b3)]();throw _0x5643e0;}const _0x407728=_0x2f5e26[_0x363723(0x280)]||_0x363723(0x19e);return this[_0x363723(0x2a8)](_0x41f402,_0x10c16f,_0x17de0f,_0x407728),_0x41f402[_0x363723(0x294)]?0x0:0x1;}[a28_0x2abed2(0x2a8)](_0x4d250d,_0x4d16e0,_0x448fd3,_0x3d6924){const _0x3d3310=a28_0x2abed2;console['error']('\x0a'+a28_0x595089[_0x3d3310(0x1d3)](_0x3d3310(0x200))+'\x20'+_0x4d250d['name']),console[_0x3d3310(0x29e)]('═'['repeat'](0x3c)),this[_0x3d3310(0x1c4)](_0x4d250d);if(typeof _0x4d16e0[_0x3d3310(0x1ed)]===_0x3d3310(0x1a9)){this['displayAttributesStats'](_0x4d250d),this[_0x3d3310(0x232)](_0x4d250d),this[_0x3d3310(0x2a7)](_0x448fd3,_0x3d6924,_0x3d3310(0x1ed),_0x4d16e0[_0x3d3310(0x1ed)]);return;}if(_0x4d16e0['attribute']===!![]){this[_0x3d3310(0x255)](_0x4d250d),this[_0x3d3310(0x232)](_0x4d250d),this[_0x3d3310(0x2a7)](_0x448fd3,_0x3d6924,_0x3d3310(0x198));return;}if(typeof _0x4d16e0[_0x3d3310(0x2a5)]===_0x3d3310(0x1a9)){this[_0x3d3310(0x199)](_0x4d250d,_0x3d6924),this[_0x3d3310(0x232)](_0x4d250d),this['displayPreviewHints'](_0x448fd3,_0x3d6924,_0x3d3310(0x2a5),_0x4d16e0[_0x3d3310(0x2a5)]);return;}if(_0x4d16e0[_0x3d3310(0x2a5)]===!![]){this[_0x3d3310(0x199)](_0x4d250d,_0x3d6924),this['displaySummary'](_0x4d250d),this[_0x3d3310(0x2a7)](_0x448fd3,_0x3d6924,_0x3d3310(0x1c9));return;}this[_0x3d3310(0x255)](_0x4d250d),this[_0x3d3310(0x199)](_0x4d250d,_0x3d6924),this[_0x3d3310(0x232)](_0x4d250d),this[_0x3d3310(0x2a7)](_0x448fd3,_0x3d6924,_0x3d3310(0x266));}['displayPreviewHints'](_0xb02950,_0x2beab5,_0x14c509,_0x46a61c){const _0x3db931=a28_0x2abed2;console[_0x3db931(0x29e)]('\x0a'+a28_0x595089[_0x3db931(0x2af)](_0x3db931(0x1dc)));const _0x2feb57=_0x2beab5!==_0x3db931(0x19e)?'\x20--interval\x20'+_0x2beab5:'';if(_0x14c509==='attribute'&&_0x46a61c)console[_0x3db931(0x29e)]('\x20\x20'+a28_0x595089[_0x3db931(0x2af)](_0x3db931(0x1c2)+_0xb02950+'\x20--attribute\x20\x22'+_0x46a61c+'\x22'+_0x2feb57));else{if(_0x14c509===_0x3db931(0x2a5)&&_0x46a61c)console[_0x3db931(0x29e)]('\x20\x20'+a28_0x595089[_0x3db931(0x2af)](_0x3db931(0x1c2)+_0xb02950+_0x3db931(0x264)+_0x46a61c+'\x22'+_0x2feb57));else(_0x14c509===_0x3db931(0x198)||_0x14c509==='all')&&console[_0x3db931(0x29e)]('\x20\x20'+a28_0x595089['dim'](_0x3db931(0x1c2)+_0xb02950+'\x20--attribute\x20\x22<name>\x22'+_0x2feb57));}(_0x14c509===_0x3db931(0x1c9)||_0x14c509===_0x3db931(0x266))&&console[_0x3db931(0x29e)]('\x20\x20'+a28_0x595089[_0x3db931(0x2af)](_0x3db931(0x1c2)+_0xb02950+_0x3db931(0x27c)+_0x2feb57)),_0x14c509===_0x3db931(0x266)&&console[_0x3db931(0x29e)]('\x20\x20'+a28_0x595089[_0x3db931(0x2af)]('tdx\x20segment\x20parent\x20preview\x20'+_0xb02950+_0x3db931(0x26f)+_0x2feb57));}[a28_0x2abed2(0x1c4)](_0x54caf9){const _0x4ff881=a28_0x2abed2,{master:_0x133e5a}=_0x54caf9,_0x5b036e=_0x133e5a[_0x4ff881(0x20e)]?a28_0x595089[_0x4ff881(0x2ab)]('✔'):a28_0x595089[_0x4ff881(0x205)]('✘');console[_0x4ff881(0x29e)]('\x0a'+a28_0x595089[_0x4ff881(0x2af)](_0x4ff881(0x2aa))),console['error'](_0x5b036e+'\x20'+a28_0x595089[_0x4ff881(0x1d3)](_0x133e5a[_0x4ff881(0x1b5)]+'.'+_0x133e5a[_0x4ff881(0x22a)])),_0x133e5a['schemaValid']?_0x133e5a[_0x4ff881(0x2ba)]!==undefined&&console['error']('\x20\x20'+a28_0x595089['dim'](_0x4ff881(0x1cf))+'\x20'+a28_0x595089[_0x4ff881(0x1aa)](formatRows(_0x133e5a['rowCount']))):console[_0x4ff881(0x29e)]('\x20\x20'+a28_0x595089[_0x4ff881(0x205)](_0x4ff881(0x23f))+'\x20'+_0x133e5a['schemaError']);}['displayAttributesStats'](_0x1c554b){const _0x145352=a28_0x2abed2;if(_0x1c554b[_0x145352(0x198)]['length']===0x0)return;console['error']('\x0a'+a28_0x595089['dim'](_0x145352(0x239)));for(const _0x32ce88 of _0x1c554b[_0x145352(0x198)]){const _0x25d05f=_0x32ce88[_0x145352(0x20e)]?a28_0x595089[_0x145352(0x2ab)]('✔'):a28_0x595089[_0x145352(0x205)]('✘');let _0x4b8534='';if(_0x32ce88[_0x145352(0x20e)]&&_0x32ce88[_0x145352(0x27e)]!==undefined&&_0x32ce88[_0x145352(0x1de)]!==undefined){const _0x4dffd9=_0x32ce88['coveragePercent'][_0x145352(0x21f)](0x1),_0x151a41=_0x32ce88[_0x145352(0x1de)]>=0x50?a28_0x595089[_0x145352(0x2ab)]:_0x32ce88[_0x145352(0x1de)]>=0x32?a28_0x595089[_0x145352(0x19a)]:a28_0x595089['red'];_0x4b8534='\x20'+a28_0x595089['dim']('Coverage:')+'\x20'+_0x151a41(_0x4dffd9+'%')+'\x20('+formatRows(_0x32ce88[_0x145352(0x27e)])+_0x145352(0x1ee);}console[_0x145352(0x29e)](_0x25d05f+'\x20'+a28_0x595089[_0x145352(0x1d3)](_0x32ce88[_0x145352(0x1fe)])+_0x4b8534),console[_0x145352(0x29e)]('\x20\x20'+a28_0x595089[_0x145352(0x2af)]('Source:')+'\x20'+a28_0x595089[_0x145352(0x1d3)](_0x32ce88['database']+'.'+_0x32ce88[_0x145352(0x22a)]));const _0x1e8876=_0x32ce88[_0x145352(0x236)]===_0x32ce88['foreignKey']?a28_0x595089[_0x145352(0x2af)](_0x145352(0x22f))+'\x20'+_0x32ce88[_0x145352(0x236)]:a28_0x595089[_0x145352(0x2af)](_0x145352(0x2b9))+'\x20'+_0x32ce88[_0x145352(0x236)]+'\x20=\x20'+_0x32ce88['foreignKey'];console[_0x145352(0x29e)]('\x20\x20'+_0x1e8876),console[_0x145352(0x29e)]('\x20\x20'+a28_0x595089[_0x145352(0x2af)]('Columns:')),this['displayColumns'](_0x32ce88[_0x145352(0x1c0)]),!_0x32ce88[_0x145352(0x20e)]&&console[_0x145352(0x29e)]('\x20\x20'+a28_0x595089[_0x145352(0x205)](_0x145352(0x23f))+'\x20'+_0x32ce88[_0x145352(0x24d)]);}}['displayBehaviorsStats'](_0x4c4869,_0x2e8277){const _0x320931=a28_0x2abed2;if(_0x4c4869['behaviors'][_0x320931(0x19c)]===0x0)return;console[_0x320931(0x29e)]('\x0a'+a28_0x595089[_0x320931(0x2af)](_0x320931(0x1df))+'\x20'+a28_0x595089[_0x320931(0x2af)]('('+_0x2e8277+')'));for(const _0x555800 of _0x4c4869['behaviors']){const _0x429eb6=_0x555800[_0x320931(0x20e)]?a28_0x595089['green']('✔'):a28_0x595089[_0x320931(0x205)]('✘');let _0xac41dc='';if(_0x555800[_0x320931(0x20e)]&&_0x555800[_0x320931(0x25c)]!==undefined&&_0x555800[_0x320931(0x217)]!==undefined){const _0x1cd6c7=_0x555800[_0x320931(0x29d)]?.[_0x320931(0x21f)](0x1)||'?',_0x42e6a5=(_0x555800[_0x320931(0x29d)]??0x0)>=0x32?a28_0x595089[_0x320931(0x2ab)]:(_0x555800[_0x320931(0x29d)]??0x0)>=0x14?a28_0x595089[_0x320931(0x19a)]:a28_0x595089[_0x320931(0x205)];_0xac41dc='\x20'+a28_0x595089[_0x320931(0x2af)](_0x320931(0x247))+'\x20'+_0x42e6a5(formatRows(_0x555800[_0x320931(0x25c)]))+'\x20('+_0x1cd6c7+_0x320931(0x1d8)+a28_0x595089[_0x320931(0x2af)](_0x320931(0x203))+'\x20'+a28_0x595089[_0x320931(0x1aa)](formatRows(_0x555800['totalEvents']));}console['error'](_0x429eb6+'\x20'+a28_0x595089[_0x320931(0x1d3)](_0x555800[_0x320931(0x1fe)])+_0xac41dc),console['error']('\x20\x20'+a28_0x595089[_0x320931(0x2af)](_0x320931(0x233))+'\x20'+a28_0x595089[_0x320931(0x1d3)](_0x555800[_0x320931(0x1b5)]+'.'+_0x555800[_0x320931(0x22a)]));const _0x18727a=_0x555800[_0x320931(0x236)]===_0x555800[_0x320931(0x271)]?a28_0x595089['dim']('Join\x20on:')+'\x20'+_0x555800['joinKey']:a28_0x595089[_0x320931(0x2af)]('Join:')+'\x20'+_0x555800[_0x320931(0x236)]+_0x320931(0x1c3)+_0x555800[_0x320931(0x271)];console[_0x320931(0x29e)]('\x20\x20'+_0x18727a),console['error']('\x20\x20'+a28_0x595089[_0x320931(0x2af)](_0x320931(0x20d))),this['displayColumns'](_0x555800['columns']),!_0x555800[_0x320931(0x20e)]&&console['error']('\x20\x20'+a28_0x595089[_0x320931(0x205)]('Error:')+'\x20'+_0x555800[_0x320931(0x24d)]);}}[a28_0x2abed2(0x2ac)](_0x5d27b6){const _0x563c92=a28_0x2abed2;for(const _0x57e330 of _0x5d27b6){_0x57e330['label']===_0x57e330[_0x563c92(0x1cc)]||_0x57e330[_0x563c92(0x1cc)]==='*'?console[_0x563c92(0x29e)](_0x563c92(0x24f)+_0x57e330['label']):console['error'](_0x563c92(0x24f)+_0x57e330[_0x563c92(0x1fc)]+'\x20'+a28_0x595089[_0x563c92(0x2af)]('('+_0x57e330[_0x563c92(0x1cc)]+')'));}}[a28_0x2abed2(0x232)](_0x256898){const _0x29f81b=a28_0x2abed2;console[_0x29f81b(0x29e)]('─'[_0x29f81b(0x249)](0x3c));if(_0x256898[_0x29f81b(0x286)][_0x29f81b(0x19c)]>0x0){console[_0x29f81b(0x29e)]('\x0a'+a28_0x595089[_0x29f81b(0x205)](_0x29f81b(0x2ae)));for(const _0x6356a of _0x256898[_0x29f81b(0x286)]){console[_0x29f81b(0x29e)]('\x20\x20'+a28_0x595089[_0x29f81b(0x205)]('•')+'\x20'+_0x6356a);}}_0x256898['allValid']&&console[_0x29f81b(0x29e)]('\x0a'+a28_0x595089[_0x29f81b(0x2ab)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a28_0x2abed2(0x28f);[a28_0x2abed2(0x1f3)]=a28_0x2abed2(0x28e);async[a28_0x2abed2(0x1e1)](_0x445fd2){const _0x40fbf4=a28_0x2abed2,{options:_0x211dfe,args:_0x50d69d,tdx:_0x4f28cd}=_0x445fd2,_0x156505=_0x211dfe,_0x5435a7=_0x50d69d[0x0]||_0x211dfe['parentSegment'];if(!_0x5435a7)return showParentSegmentNotSetError(_0x40fbf4(0x257)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x40fbf4(0x211)+_0x40fbf4(0x225)+_0x40fbf4(0x1e4)+_0x40fbf4(0x26e)+_0x40fbf4(0x25a)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x156505[_0x40fbf4(0x1f4)]&&!_0x156505['attribute']&&!_0x156505[_0x40fbf4(0x2a5)]&&!_0x156505[_0x40fbf4(0x265)])return console[_0x40fbf4(0x29e)](a28_0x595089['red'](_0x40fbf4(0x227))),console[_0x40fbf4(0x29e)](_0x40fbf4(0x23c)),console[_0x40fbf4(0x29e)](_0x40fbf4(0x2ad)),console[_0x40fbf4(0x29e)](_0x40fbf4(0x287)),console['error'](_0x40fbf4(0x1dd)),console['error'](_0x40fbf4(0x27a)),console[_0x40fbf4(0x29e)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x28976f=resolveYamlFile(_0x5435a7);if(!existsSync(_0x28976f))return showFileNotFoundError(_0x28976f,_0x5435a7),0x1;_0x156505['verbose']&&(console[_0x40fbf4(0x29e)]('Site:\x20'+_0x156505['site']),console[_0x40fbf4(0x29e)]('YAML\x20file:\x20'+_0x28976f));let _0x502f42;try{_0x502f42=readFileSync(_0x28976f,_0x40fbf4(0x1ce));}catch(_0x209e93){const _0x39f5b5=_0x209e93 instanceof Error?_0x209e93['message']:String(_0x209e93);return console[_0x40fbf4(0x29e)](_0x40fbf4(0x1ba)+_0x39f5b5),0x1;}let _0x1d7b3d;try{_0x1d7b3d=parseYamlString(_0x502f42);}catch(_0x3bca2c){const _0x52d97d=_0x3bca2c instanceof Error?_0x3bca2c[_0x40fbf4(0x1c6)]:String(_0x3bca2c);return console[_0x40fbf4(0x29e)](a28_0x595089[_0x40fbf4(0x205)]('Error\x20parsing\x20YAML:\x20'+_0x52d97d)),0x1;}if(_0x156505[_0x40fbf4(0x1ed)]===!![]||_0x156505[_0x40fbf4(0x1ed)]===''){const _0x1660d5=_0x1d7b3d[_0x40fbf4(0x198)]?.['map'](_0x1b7c81=>_0x1b7c81[_0x40fbf4(0x1fe)])||[];if(_0x1660d5['length']===0x0)console[_0x40fbf4(0x29e)](a28_0x595089[_0x40fbf4(0x205)](_0x40fbf4(0x284)));else{console[_0x40fbf4(0x29e)](a28_0x595089[_0x40fbf4(0x205)](_0x40fbf4(0x237))),console['error'](_0x40fbf4(0x242));for(const _0xb9d3e6 of _0x1660d5){console[_0x40fbf4(0x29e)]('\x20\x20'+a28_0x595089[_0x40fbf4(0x1aa)](_0xb9d3e6));}console['error'](_0x40fbf4(0x1bd)+_0x5435a7+'\x20--attribute\x20\x22'+_0x1660d5[0x0]+'\x22');}return 0x1;}if(_0x156505[_0x40fbf4(0x2a5)]===!![]||_0x156505[_0x40fbf4(0x2a5)]===''){const _0x19861d=_0x1d7b3d[_0x40fbf4(0x1c9)]?.[_0x40fbf4(0x290)](_0x159045=>_0x159045['name'])||[];if(_0x19861d[_0x40fbf4(0x19c)]===0x0)console[_0x40fbf4(0x29e)](a28_0x595089['red'](_0x40fbf4(0x1d5)));else{console[_0x40fbf4(0x29e)](a28_0x595089[_0x40fbf4(0x205)](_0x40fbf4(0x218))),console[_0x40fbf4(0x29e)](_0x40fbf4(0x1cb));for(const _0x3b9a93 of _0x19861d){console[_0x40fbf4(0x29e)]('\x20\x20'+a28_0x595089['cyan'](_0x3b9a93));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x5435a7+_0x40fbf4(0x264)+_0x19861d[0x0]+'\x22');}return 0x1;}const _0x4fc674=createCommandSpinner(a28_0x595089[_0x40fbf4(0x2af)](_0x40fbf4(0x22b)),{'verbose':_0x156505[_0x40fbf4(0x1e7)]});_0x4fc674[_0x40fbf4(0x229)]();const _0x19c8c0={'onProgress':_0x392bc8=>{_0x4fc674['text']=formatProgressMessage(_0x392bc8);}};if(_0x156505[_0x40fbf4(0x1f4)])_0x19c8c0[_0x40fbf4(0x1f4)]=!![];if(_0x156505[_0x40fbf4(0x1ed)]&&typeof _0x156505[_0x40fbf4(0x1ed)]===_0x40fbf4(0x1a9))_0x19c8c0[_0x40fbf4(0x1ed)]=_0x156505[_0x40fbf4(0x1ed)];if(_0x156505[_0x40fbf4(0x2a5)]&&typeof _0x156505[_0x40fbf4(0x2a5)]===_0x40fbf4(0x1a9))_0x19c8c0['behavior']=_0x156505[_0x40fbf4(0x2a5)];if(_0x156505[_0x40fbf4(0x265)])_0x19c8c0[_0x40fbf4(0x265)]=!![];if(_0x156505[_0x40fbf4(0x280)])_0x19c8c0[_0x40fbf4(0x280)]=_0x156505[_0x40fbf4(0x280)];let _0x2f374a;try{_0x2f374a=await _0x4f28cd['segment'][_0x40fbf4(0x1b4)](_0x502f42,_0x19c8c0),_0x4fc674[_0x40fbf4(0x2b3)]();}catch(_0x109261){_0x4fc674[_0x40fbf4(0x2b3)]();throw _0x109261;}return await this[_0x40fbf4(0x1ea)](_0x2f374a,{'master':_0x156505['master'],'attribute':typeof _0x156505[_0x40fbf4(0x1ed)]===_0x40fbf4(0x1a9)?_0x156505[_0x40fbf4(0x1ed)]:undefined,'behavior':typeof _0x156505['behavior']===_0x40fbf4(0x1a9)?_0x156505[_0x40fbf4(0x2a5)]:undefined,'enriched':_0x156505[_0x40fbf4(0x265)]}),_0x2f374a[_0x40fbf4(0x294)]?0x0:0x1;}async[a28_0x2abed2(0x1ea)](_0x5103f4,_0x1e5413){const _0x538c37=a28_0x2abed2;console['error']('\x0a'+a28_0x595089[_0x538c37(0x1d3)]('Preview:')+'\x20'+_0x5103f4[_0x538c37(0x1fe)]),console[_0x538c37(0x29e)]('═'[_0x538c37(0x249)](0x3c));if(_0x1e5413['master']&&_0x5103f4[_0x538c37(0x23a)]){const _0x2f51bf=a28_0x595089[_0x538c37(0x2af)](_0x538c37(0x209))+'\x20'+a28_0x595089[_0x538c37(0x1d3)](_0x5103f4['master'][_0x538c37(0x1b5)]+'.'+_0x5103f4[_0x538c37(0x1f4)][_0x538c37(0x22a)]);await this[_0x538c37(0x1a3)](_0x2f51bf,_0x5103f4[_0x538c37(0x23a)]);}else{if(_0x1e5413[_0x538c37(0x1ed)]&&_0x5103f4['sampleData']){const _0x5ea206=a28_0x595089[_0x538c37(0x2af)](_0x538c37(0x293))+'\x20'+a28_0x595089[_0x538c37(0x1d3)](_0x1e5413[_0x538c37(0x1ed)]);await this[_0x538c37(0x1a3)](_0x5ea206,_0x5103f4[_0x538c37(0x23a)]);}else{if(_0x1e5413[_0x538c37(0x2a5)]&&_0x5103f4[_0x538c37(0x23a)]){const _0x35b0a5=a28_0x595089[_0x538c37(0x2af)]('Behavior:')+'\x20'+a28_0x595089[_0x538c37(0x1d3)](_0x1e5413[_0x538c37(0x2a5)]);await this[_0x538c37(0x1a3)](_0x35b0a5,_0x5103f4[_0x538c37(0x23a)]);}else{if(_0x1e5413[_0x538c37(0x265)]&&_0x5103f4['sampleData']){const _0x5bab01=a28_0x595089['dim'](_0x538c37(0x1e6))+'\x20'+a28_0x595089[_0x538c37(0x1d3)](_0x538c37(0x21c));await this[_0x538c37(0x1a3)](_0x5bab01,_0x5103f4[_0x538c37(0x23a)]);}else!_0x5103f4['sampleData']&&console[_0x538c37(0x29e)](_0x538c37(0x20b));}}}if(_0x5103f4[_0x538c37(0x286)][_0x538c37(0x19c)]>0x0){console[_0x538c37(0x29e)]('─'[_0x538c37(0x249)](0x3c)),console[_0x538c37(0x29e)]('\x0a'+a28_0x595089[_0x538c37(0x205)]('Errors:'));for(const _0x500f7f of _0x5103f4['errors']){console[_0x538c37(0x29e)]('\x20\x20'+a28_0x595089[_0x538c37(0x205)]('•')+'\x20'+_0x500f7f);}}}async[a28_0x2abed2(0x1a3)](_0x4d0af6,_0x336ead){const _0x46c077=a28_0x2abed2;if(_0x336ead[_0x46c077(0x19c)]===0x0){console['error']('\x0a'+_0x4d0af6),console['error'](_0x46c077(0x1f8));return;}console[_0x46c077(0x29e)]('\x0a'+_0x4d0af6);const _0x3d14c7=Object['keys'](_0x336ead[0x0])[_0x46c077(0x290)](_0x458c6c=>({'name':_0x458c6c,'type':typeof _0x336ead[0x0][_0x458c6c]===_0x46c077(0x2b5)?'double':_0x46c077(0x2b2)})),_0x5b8a2c={'queryId':_0x46c077(0x1a6),'columns':_0x3d14c7,'data':_0x336ead,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x336ead[_0x46c077(0x19c)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1d0703=formatAsTable(_0x5b8a2c,_0x336ead[_0x46c077(0x19c)],!![]);await writeOutput(_0x1d0703,undefined,'table');}}function a28_0x1b8f(_0x3a5dfa,_0xaa2a64){_0x3a5dfa=_0x3a5dfa-0x18e;const _0x2e2cd6=a28_0x2e2c();let _0x1b8f96=_0x2e2cd6[_0x3a5dfa];return _0x1b8f96;}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a28_0x2abed2(0x1fe)]='segment:parent:run';[a28_0x2abed2(0x1f3)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a28_0x2abed2(0x1e1)](_0x30a0f4){const _0x372c2c=a28_0x2abed2,{options:_0x5c5c4c,args:_0xd628ac,tdx:_0x81c31e}=_0x30a0f4,_0x4cec14=_0x5c5c4c,_0x17f257=_0xd628ac[0x0]||_0x5c5c4c[_0x372c2c(0x1a2)];if(!_0x17f257)return showParentSegmentNotSetError(_0x372c2c(0x2b7)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x190477=resolveYamlFile(_0x17f257);if(existsSync(_0x190477)){_0x4cec14[_0x372c2c(0x1e7)]&&console[_0x372c2c(0x29e)](_0x372c2c(0x250)+_0x190477);let _0x1af19e;try{_0x1af19e=readFileSync(_0x190477,'utf-8');}catch(_0x4ef73b){const _0x5abfd7=_0x4ef73b instanceof Error?_0x4ef73b['message']:String(_0x4ef73b);return console[_0x372c2c(0x29e)](_0x372c2c(0x1ba)+_0x5abfd7),0x1;}const _0x41814c=await withSpinner(_0x372c2c(0x279),()=>_0x81c31e[_0x372c2c(0x1bb)][_0x372c2c(0x28a)](_0x1af19e),{'verbose':_0x4cec14[_0x372c2c(0x1e7)]}),_0x516ab0=_0x41814c[_0x372c2c(0x1e0)],{isNew:_0x9f04ed,name:_0x3968dc,hasChanges:_0x9cc665,diffFormatted:_0x11718c}=_0x516ab0;if(_0x9cc665){_0x9f04ed?console[_0x372c2c(0x29e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x3968dc+'\x27:'):console['error'](_0x372c2c(0x23b)+_0x3968dc+'\x27:');console[_0x372c2c(0x29e)]('─'[_0x372c2c(0x249)](0x3c)),console['error'](_0x11718c),console[_0x372c2c(0x29e)]('─'[_0x372c2c(0x249)](0x3c));const _0x302052=_0x9f04ed?_0x372c2c(0x1b3)+_0x3968dc+_0x372c2c(0x1f5):'Apply\x20changes\x20to\x20\x27'+_0x3968dc+_0x372c2c(0x1f5);if(!_0x4cec14[_0x372c2c(0x268)]){const _0x327cb1=await confirmKey(_0x302052);if(!_0x327cb1)return console[_0x372c2c(0x29e)](_0x372c2c(0x1fa)),0x1;}const _0x1248f9=_0x9f04ed?_0x372c2c(0x29f):_0x372c2c(0x1b2);await withSpinner(_0x1248f9+_0x372c2c(0x22c)+_0x3968dc+'\x27...',()=>_0x516ab0[_0x372c2c(0x25e)](),{'verbose':_0x4cec14[_0x372c2c(0x1e7)]});const _0x29b1b9=_0x9f04ed?_0x372c2c(0x2bb):'Updated';console['error']('✔\x20'+_0x29b1b9+_0x372c2c(0x22c)+_0x3968dc+'\x27');}else console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x3968dc+_0x372c2c(0x1db));}const _0xa10f06=await withSpinner(_0x372c2c(0x298)+_0x17f257+_0x372c2c(0x26d),()=>_0x81c31e['segment']['runParent'](_0x17f257),{'verbose':_0x4cec14[_0x372c2c(0x1e7)]}),_0x2dbbf7=_0xa10f06['data'],_0x367aff=getConsoleUrl(_0x4cec14[_0x372c2c(0x1ec)],_0x372c2c(0x274)+_0x2dbbf7[_0x372c2c(0x20c)]+_0x372c2c(0x224)+_0x2dbbf7[_0x372c2c(0x1ff)]+_0x372c2c(0x22d)+_0x2dbbf7['workflowAttemptId']);return console['error'](_0x372c2c(0x207)),console[_0x372c2c(0x29e)]('\x20\x20'+a28_0x595089[_0x372c2c(0x2af)](_0x372c2c(0x27f))+'\x20'+_0x2dbbf7[_0x372c2c(0x1d0)]),console[_0x372c2c(0x29e)]('\x20\x20'+a28_0x595089[_0x372c2c(0x2af)](_0x372c2c(0x2a0))+'\x20'+_0x2dbbf7[_0x372c2c(0x26b)]),console[_0x372c2c(0x29e)]('\x20\x20'+a28_0x595089[_0x372c2c(0x2af)](_0x372c2c(0x1f1))+'\x20'+_0x2dbbf7[_0x372c2c(0x1ff)]),console[_0x372c2c(0x29e)]('\x20\x20'+a28_0x595089[_0x372c2c(0x2af)](_0x372c2c(0x1b6))+'\x20'+_0x2dbbf7[_0x372c2c(0x23e)]),console['error']('\x20\x20'+_0x367aff),console[_0x372c2c(0x29e)]('\x0a'+a28_0x595089[_0x372c2c(0x2af)]('To\x20cancel:')+_0x372c2c(0x25d)+_0x2dbbf7[_0x372c2c(0x23e)]+_0x372c2c(0x1ad)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x248);['description']='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x374e4d){const _0x308749=a28_0x2abed2,{options:_0x27a126,args:_0x91c650,tdx:_0x231b8d}=_0x374e4d,_0x37d0ab=_0x91c650[0x0]||_0x27a126[_0x308749(0x1a2)];if(!_0x37d0ab)return showParentSegmentNotSetError(_0x308749(0x1c8)+_0x308749(0x1bc)),0x1;_0x27a126[_0x308749(0x1e7)]&&(console[_0x308749(0x29e)](_0x308749(0x244)+_0x27a126[_0x308749(0x1ec)]),console[_0x308749(0x29e)](_0x308749(0x193)+_0x37d0ab));const _0x25bc9a=await withSpinner(_0x308749(0x1d9)+_0x37d0ab+_0x308749(0x26d),()=>_0x231b8d[_0x308749(0x1bb)]['listFields'](_0x37d0ab),{'verbose':_0x27a126[_0x308749(0x1e7)]}),_0x1f101d=_0x25bc9a[_0x308749(0x1e0)];console[_0x308749(0x29e)](_0x308749(0x1d7)+_0x1f101d[_0x308749(0x19c)]+_0x308749(0x28c)+(_0x1f101d[_0x308749(0x19c)]!==0x1?'s':''));if(_0x27a126['json']||_0x27a126[_0x308749(0x234)])return await handleSDKOutput(_0x1f101d,_0x27a126),0x0;return displayFieldsHumanReadable(_0x1f101d,_0x37d0ab),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x256);[a28_0x2abed2(0x1f3)]=a28_0x2abed2(0x1d1);async['execute'](_0x29aeb1){const _0x2c75da=a28_0x2abed2,{options:_0xe630de,args:_0x417a55,tdx:_0x58ee89}=_0x29aeb1,_0x2ccdd3=_0xe630de,_0x538a6c=_0x417a55[0x0]||_0xe630de[_0x2c75da(0x1a2)];if(!_0x538a6c)return showParentSegmentNotSetError(_0x2c75da(0x21b)+_0x2c75da(0x276)+_0x2c75da(0x23d)+_0x2c75da(0x2b1)),0x1;_0xe630de['verbose']&&(console[_0x2c75da(0x29e)]('Site:\x20'+_0xe630de[_0x2c75da(0x1ec)]),console[_0x2c75da(0x29e)](_0x2c75da(0x193)+_0x538a6c));const _0x1f61a0=await withSpinner(_0x2c75da(0x197)+_0x538a6c+'\x27...',()=>_0x58ee89['segment'][_0x2c75da(0x1a0)](_0x538a6c),{'verbose':_0xe630de[_0x2c75da(0x1e7)]}),_0x440d48=_0x1f61a0[_0x2c75da(0x1e0)];if(_0x2ccdd3[_0x2c75da(0x1d2)]){const _0x51dfeb=getConsoleNextUrl(_0x2ccdd3[_0x2c75da(0x1ec)],_0x2c75da(0x1c5)+_0x440d48['id']);return console[_0x2c75da(0x29e)](a28_0x595089[_0x2c75da(0x2ab)]('✔')+_0x2c75da(0x191)+a28_0x595089[_0x2c75da(0x1aa)](_0x51dfeb)),openBrowser(_0x51dfeb),0x0;}return await handleSingleObjectOutput(_0x440d48,_0xe630de),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a28_0x2abed2(0x1fe)]='segment:parent:desc';[a28_0x2abed2(0x1f3)]=a28_0x2abed2(0x283);async[a28_0x2abed2(0x1e1)](_0x4d5160){const _0x28170c=a28_0x2abed2,{options:_0x1db9e1,args:_0x69630d,tdx:_0xefd907}=_0x4d5160,_0xf1f6f5=_0x69630d[0x0]||_0x1db9e1[_0x28170c(0x1a2)];if(!_0xf1f6f5)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x1db9e1[_0x28170c(0x1e7)]&&(console[_0x28170c(0x29e)](_0x28170c(0x244)+_0x1db9e1['site']),console['error'](_0x28170c(0x193)+_0xf1f6f5));const _0x25cd02=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf1f6f5+_0x28170c(0x26d),()=>_0xefd907[_0x28170c(0x1bb)]['resolveParentId'](_0xf1f6f5),{'verbose':_0x1db9e1[_0x28170c(0x1e7)]}),_0xb7c028=_0x25cd02[_0x28170c(0x1e0)],_0x24fa08=await withSpinner(_0x28170c(0x246)+_0xf1f6f5+_0x28170c(0x26d),()=>_0xefd907[_0x28170c(0x1bb)][_0x28170c(0x226)](_0xb7c028),{'verbose':_0x1db9e1[_0x28170c(0x1e7)]}),_0x2ba9cd=await executeSchemaQuery(_0x24fa08[_0x28170c(0x1e0)],_0xefd907,_0x1db9e1);return await handleQueryOutput(_0x2ba9cd,_0x1db9e1),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x235);[a28_0x2abed2(0x1f3)]=a28_0x2abed2(0x18e);async[a28_0x2abed2(0x1e1)](_0x32beb0){const _0x5cba56=a28_0x2abed2,{options:_0x5dc7c2,args:_0x4c187f,tdx:_0x2b0ee9}=_0x32beb0,_0x52699c=_0x4c187f[0x0]||_0x5dc7c2[_0x5cba56(0x1a2)];if(!_0x52699c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x5cba56(0x190)),0x1;_0x5dc7c2[_0x5cba56(0x1e7)]&&(console[_0x5cba56(0x29e)](_0x5cba56(0x244)+_0x5dc7c2[_0x5cba56(0x1ec)]),console[_0x5cba56(0x29e)](_0x5cba56(0x193)+_0x52699c));const _0x47e48e=await withSpinner(_0x5cba56(0x1f9)+_0x52699c+'\x27...',()=>_0x2b0ee9['segment'][_0x5cba56(0x243)](_0x52699c),{'verbose':_0x5dc7c2[_0x5cba56(0x1e7)]}),_0x5b848b=_0x47e48e['data'],_0x40728d=await withSpinner(_0x5cba56(0x246)+_0x52699c+_0x5cba56(0x26d),()=>_0x2b0ee9[_0x5cba56(0x1bb)][_0x5cba56(0x226)](_0x5b848b),{'verbose':_0x5dc7c2[_0x5cba56(0x1e7)]}),_0x541d5e=_0x40728d[_0x5cba56(0x1e0)];return _0x5dc7c2[_0x5cba56(0x1fd)]===_0x5cba56(0x273)||_0x5dc7c2[_0x5cba56(0x1fd)]==='jsonl'?await handleSDKOutput([{'sql':_0x541d5e}],_0x5dc7c2):console[_0x5cba56(0x1cd)](_0x541d5e),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a28_0x2abed2(0x1fe)]=a28_0x2abed2(0x2a1);[a28_0x2abed2(0x1f3)]=a28_0x2abed2(0x220);async[a28_0x2abed2(0x1e1)](_0x21df33){const _0x550bde=a28_0x2abed2,{options:_0x8d73d2,args:_0x201d97,tdx:_0x4f008d}=_0x21df33,_0x1cad7e=_0x201d97[0x0]||_0x8d73d2[_0x550bde(0x1a2)];if(!_0x1cad7e)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'+_0x550bde(0x29a)),0x1;_0x8d73d2[_0x550bde(0x1e7)]&&(console[_0x550bde(0x29e)](_0x550bde(0x244)+_0x8d73d2[_0x550bde(0x1ec)]),console[_0x550bde(0x29e)](_0x550bde(0x193)+_0x1cad7e));const _0x1133b3=await withSpinner(_0x550bde(0x1f9)+_0x1cad7e+_0x550bde(0x26d),()=>_0x4f008d[_0x550bde(0x1bb)][_0x550bde(0x243)](_0x1cad7e),{'verbose':_0x8d73d2[_0x550bde(0x1e7)]}),_0x5e5b1c=_0x1133b3[_0x550bde(0x1e0)],_0x419639=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x1cad7e+'\x27...',()=>_0x4f008d[_0x550bde(0x1bb)]['getParentSQL'](_0x5e5b1c),{'verbose':_0x8d73d2['verbose']});let _0x582595=_0x419639[_0x550bde(0x1e0)];const _0x2841ef=resolveLimit(_0x8d73d2[_0x550bde(0x2b0)],DEFAULT_DISPLAY_LIMIT),_0x47425e=/\bLIMIT\s+\d+/i[_0x550bde(0x299)](_0x582595);!_0x47425e&&(_0x582595=_0x582595[_0x550bde(0x2a6)]()[_0x550bde(0x25b)](/;+$/,''),_0x582595=_0x550bde(0x1b9)+_0x582595+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2841ef);_0x8d73d2[_0x550bde(0x1e7)]&&console[_0x550bde(0x29e)](_0x550bde(0x269)+_0x582595);const _0x2388ff=await withQuerySpinner(_0x550bde(0x1a5),async _0xbba617=>{const _0x3a9875=_0x550bde,_0x1629f3=await _0x4f008d['query'][_0x3a9875(0x1e1)](_0x582595,{'catalog':'td','schema':_0x3a9875(0x1ae),'onJobId':_0x41a873=>{const _0x4f18f6=_0x3a9875;_0xbba617[_0x4f18f6(0x2a2)](_0x41a873);}});return _0x1629f3;},{'verbose':_0x8d73d2[_0x550bde(0x1e7)]}),_0x47d857=_0x2388ff['data'],_0x4fc116=_0x47d857[_0x550bde(0x1bf)]?_0x550bde(0x2b8)+_0x47d857[_0x550bde(0x1bf)]+']':'';return console[_0x550bde(0x29e)](_0x550bde(0x222)+_0x47d857[_0x550bde(0x24a)][_0x550bde(0x228)][_0x550bde(0x19b)]()+_0x550bde(0x1f7)+(_0x550bde(0x260)+formatElapsed(_0x47d857['stats']['elapsedTimeMillis'])+_0x4fc116)),await handleQueryOutput(_0x47d857,_0x8d73d2),0x0;}}
|
|
1
|
+
const a28_0x13db83=a28_0x1aa3;(function(_0x2c7654,_0x31e8cb){const _0x31b41a=a28_0x1aa3,_0x325e6d=_0x2c7654();while(!![]){try{const _0x2d25af=parseInt(_0x31b41a(0xe9))/0x1*(parseInt(_0x31b41a(0x1d7))/0x2)+parseInt(_0x31b41a(0x20d))/0x3*(-parseInt(_0x31b41a(0x1b8))/0x4)+parseInt(_0x31b41a(0x203))/0x5+parseInt(_0x31b41a(0x171))/0x6+parseInt(_0x31b41a(0x1ba))/0x7+parseInt(_0x31b41a(0xfe))/0x8+-parseInt(_0x31b41a(0x1cb))/0x9*(parseInt(_0x31b41a(0x177))/0xa);if(_0x2d25af===_0x31e8cb)break;else _0x325e6d['push'](_0x325e6d['shift']());}catch(_0x2b12be){_0x325e6d['push'](_0x325e6d['shift']());}}}(a28_0x1713,0xac0de));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a28_0x1a1c24 from'path';import{BaseCommand}from'./command.js';function a28_0x1713(){const _0x35ac2d=['tdx\x20segment\x20parent\x20preview\x20','cyan','Error\x20parsing\x20YAML:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','Status:','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Error:\x20--attribute\x20requires\x20a\x20name\x0a','toFixed','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Master:','isDirectory','yellow','.yml','population','✔\x20Renamed\x20directory\x20to\x20','attributesFile','displayMasterInfo','segment:parent:fields','getParentSQL','\x20Opening\x20','createParent','elapsedTimeMillis','segment:parent:create','sampleData','Overwrite\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20[Job\x20ID:\x20','Available\x20attributes:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Coverage:','segment:parent:view','\x20--attribute\x20\x22<name>\x22','Rows:','/\x20directories\x20exist.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','dim','unref','text','site','attribute','customerGroupFile','localeCompare','platform','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','name','using\x20the\x20default\x20path:\x20','audienceId','Fetching\x20current\x20configuration\x20for\x20\x27','schemaValid','filter','in\x20','behaviorsFile','use','👥\x20','Join:','timezone','table','Creating\x20parent\x20segment\x20\x27','List\x20parent\x20segments','2637642gHGftK','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Analyzing\x20changes...','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','segment:parent:desc','Join\x20on:','1316110WExCia','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','segment:parent:list','Available\x20behaviors:','Pattern:\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x27\x20with\x20ID:\x20','master','displayPreviewResults','\x0aNo\x20sample\x20data\x20available','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','message','rowCount','segment:parent:validate','Create\x20parent\x20segment\x20\x27','displayValidateResults','listParents','log','matchedCount','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','repeat','session','all','\x27...','utf-8','behavior','foreignKey','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','scheduleOption','red','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Fetching\x20parent\x20segment\x20\x27','error','verbose','runParent','addBehaviors','Created','data','label','Updating','displayAttributesStats','displayBehaviorsStats','customerGroup','displaySummary','Master\x20+\x20Attributes','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','allValid','Behavior:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','displayPreviewHints','/\x20and\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20--behavior\x20\x22','\x20--behavior\x20\x22<name>\x22','stats','output','Resolving\x20parent\x20segment\x20\x27','\x20\x20No\x20sample\x20data\x20available','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','errors','3712300BQJEFm','workflowId','7725158qmeRqP','Show\x20parent\x20segment\x20details','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Parent\x20segment:\x20','/\x20directory.\x0a','segment:parent:preview','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','enriched','attributes','interval','segment:parent:run','\x20kill','totalEvents','YAML\x20file:\x20','pushParentYaml','Events:','test','207ybpbzg','behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','length','✔\x20Updated\x20parent\x20segment\x20\x27','\x27\x20and\x20run\x20workflow?','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','toLocaleString','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Creating','938952oSessH','Output\x20file:\x20','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','segment:parent:sql','double','\x0a⚠️\x20\x20Migrating:\x20','ignore','processedRows','Audience\x20ID:','pullParentYaml','Found\x20YAML\x20file:\x20','-1d','displayColumns','List\x20available\x20fields\x20for\x20segmentation','`\x20to\x20download\x20the\x20configuration\x20first','\x20Configuration\x20is\x20valid','bold','jsonl','Attribute:','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','match','trim','Attempt:','\x20parent\x20segment\x20\x27','Aborted.','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','/\x20→\x20','Error:','dirname','number','apply','Error:\x20File\x20not\x20found:\x20','✔\x20Found\x20','/attempt/','previewParentYaml','Preview:','darwin','Updated','Database:\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Executing\x20parent\x20segment\x20query...','\x20Context\x20set:\x20','\x0aChanges\x20to\x20\x27','Updating\x20parent\x20segment\x20\x27','6936620Hbpbnb','description','%)\x20','json','execute','format','Enriched:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','/app/workflows/','Error\x20reading\x20file:\x20','3YanImx','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','workflowSessionId','✔\x20Query\x20completed:\x20Processed\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','varchar','2MQgFON','\x5c$&','Source:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','keys','joinKey','database','\x20field','parentSegment','segment:parent:push','SQL\x20query:\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a⚠️\x20\x20Both\x20','string','run','segment','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','customerPercent','map','6323080QOHEtS','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','replace','\x20is\x20already\x20up\x20to\x20date','\x20=\x20','Errors:','Options:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','web','/app/dw/parentSegments/','setJobId','start','coveragePercent','scheduleType','resolveParentId','Apply\x20changes\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','schemaError','\x20--enriched','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','green','/{name}.yml\x0a','parent_segment','Behaviors','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','information_schema','\x20--interval\x20','jobId','Fetching\x20SQL\x20for\x20\x27','win32','xdg-open','displaySampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20tdx\x20wf\x20attempt\x20','Customers:','Columns:','stop','\x20--attribute\x20\x22','Listing\x20parent\x20segments\x20matching\x20\x27','yes','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','updateParent','columns','workflowAttemptId','validateParentYaml','Options\x20(one\x20required):\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','getParentFull','column','join','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Options:\x0a','Site:\x20'];a28_0x1713=function(){return _0x35ac2d;};return a28_0x1713();}import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a28_0x1aa3(_0x1f4d48,_0x9b536a){_0x1f4d48=_0x1f4d48-0xe4;const _0x17137d=a28_0x1713();let _0x1aa3d1=_0x17137d[_0x1f4d48];return _0x1aa3d1;}import a28_0x414911 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x42e220){const _0x5c8ba2=a28_0x1aa3,_0xa669d6=process[_0x5c8ba2(0x160)],_0x552e17=_0xa669d6===_0x5c8ba2(0x1fb)?'open':_0xa669d6===_0x5c8ba2(0x11e)?_0x5c8ba2(0x10a):_0x5c8ba2(0x11f);spawn(_0x552e17,[_0x42e220],{'detached':!![],'stdio':_0x5c8ba2(0x1dd)})[_0x5c8ba2(0x15a)]();}function migrateLegacyDirectory(){const _0x540678=a28_0x1aa3;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x1a1c94=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x1a1c94[_0x540678(0x140)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a28_0x414911[_0x540678(0x141)](_0x540678(0xf6)+LEGACY_PARENT_SEGMENT_DIR+_0x540678(0x1ae)+PARENT_SEGMENT_DIR+_0x540678(0x157))),console[_0x540678(0x19a)](a28_0x414911[_0x540678(0x159)](_0x540678(0x1ab)+LEGACY_PARENT_SEGMENT_DIR+_0x540678(0x1be))),![];console[_0x540678(0x19a)](a28_0x414911['yellow'](_0x540678(0x1dc)+LEGACY_PARENT_SEGMENT_DIR+_0x540678(0x1f1)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a28_0x414911[_0x540678(0x113)](_0x540678(0x144)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1d37a3){const _0x40f9dd=_0x1d37a3 instanceof Error?_0x1d37a3[_0x540678(0x182)]:String(_0x1d37a3);return console[_0x540678(0x19a)](a28_0x414911['red'](_0x540678(0xf5)+_0x40f9dd+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a28_0x13db83(0xf8)](_0x456112){const _0x1852c4=a28_0x13db83;return migrateLegacyDirectory(),super[_0x1852c4(0xf8)](_0x456112);}}function resolveYamlFile(_0x4a0600){const _0x42b735=a28_0x13db83;if(_0x4a0600['endsWith'](_0x42b735(0x142))||_0x4a0600['endsWith']('.yaml'))return _0x4a0600;return a28_0x1a1c24[_0x42b735(0x132)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4a0600)+_0x42b735(0x142));}function formatProgressMessage(_0x55bc10){const _0x1c46f9=a28_0x13db83,_0xa1cc38=_0x55bc10[_0x1c46f9(0x1eb)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xa1cc38){const [,_0x4afc60,_0x294cf4,_0x37b2e0='']=_0xa1cc38;return a28_0x414911[_0x1c46f9(0x159)](_0x4afc60+':')+'\x20'+_0x294cf4+a28_0x414911[_0x1c46f9(0x159)](_0x37b2e0);}return a28_0x414911[_0x1c46f9(0x159)](_0x55bc10);}function showFileNotFoundError(_0x1604cd,_0x53171b){const _0x58a59a=a28_0x13db83;console['error'](a28_0x414911[_0x58a59a(0x196)](_0x58a59a(0x1f6)+_0x1604cd+'\x0a')),console[_0x58a59a(0x19a)](a28_0x414911['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x53171b+_0x58a59a(0x1e5)));}function showParentSegmentNotSetError(_0x4d482b){const _0x411616=a28_0x13db83;console[_0x411616(0x19a)](a28_0x414911[_0x411616(0x141)](_0x411616(0x158))),console[_0x411616(0x19a)](_0x4d482b);}export class ParentSegmentListCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x179);[a28_0x13db83(0x204)]=a28_0x13db83(0x170);async[a28_0x13db83(0x207)](_0xd1c527){const _0x3422a7=a28_0x13db83,{options:_0x22140a,args:_0x551961,tdx:_0x522c8b}=_0xd1c527,_0x24b370=_0x551961[0x0];_0x22140a[_0x3422a7(0x19b)]&&(console['error']('Site:\x20'+_0x22140a[_0x3422a7(0x15c)]),_0x24b370&&console[_0x3422a7(0x19a)](_0x3422a7(0x17b)+_0x24b370));const _0x51208c=await withSpinner(_0x24b370?_0x3422a7(0x127)+_0x24b370+_0x3422a7(0x190):'Listing\x20parent\x20segments...',()=>_0x522c8b['segment'][_0x3422a7(0x187)](),{'verbose':_0x22140a[_0x3422a7(0x19b)]});let _0x5e07b3=_0x51208c['data'];if(_0x24b370){const _0x46ff61=_0x24b370['replace'](/[.+^${}()|[\]\\]/g,_0x3422a7(0xea))[_0x3422a7(0x101)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x227da8=new RegExp('^'+_0x46ff61+'$','i');_0x5e07b3=_0x5e07b3[_0x3422a7(0x167)](_0x42f62d=>_0x227da8['test'](_0x42f62d[_0x3422a7(0x1c2)]['name']));}_0x5e07b3['sort']((_0x584a46,_0x5a751c)=>_0x584a46[_0x3422a7(0x1c2)][_0x3422a7(0x162)][_0x3422a7(0x15f)](_0x5a751c['attributes'][_0x3422a7(0x162)])),console[_0x3422a7(0x19a)]('✔\x20Found\x20'+_0x5e07b3[_0x3422a7(0x1d0)]+'\x20parent\x20segment'+(_0x5e07b3[_0x3422a7(0x1d0)]!==0x1?'s':''));if(_0x22140a[_0x3422a7(0x208)]===_0x3422a7(0x206)||_0x22140a['format']==='jsonl')await handleSDKOutput(_0x5e07b3,_0x22140a);else{if(_0x5e07b3[_0x3422a7(0x1d0)]===0x0)_0x24b370?console[_0x3422a7(0x188)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x24b370):console['log']('No\x20parent\x20segments\x20found');else for(const _0x14608a of _0x5e07b3){const _0x3b3e11=_0x14608a[_0x3422a7(0x1c2)][_0x3422a7(0x143)]?a28_0x414911['dim']('\x20('+formatRows(_0x14608a['attributes']['population'])+')'):'';console['log'](_0x3422a7(0x16b)+_0x14608a[_0x3422a7(0x1c2)][_0x3422a7(0x162)]+_0x3b3e11);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x14c);[a28_0x13db83(0x204)]=a28_0x13db83(0x18a);async['execute'](_0x2ae936){const _0x505412=a28_0x13db83,{options:_0xd19e2c,args:_0x144d07,tdx:_0x5974b5}=_0x2ae936;console[_0x505412(0x19a)](_0x505412(0x133)+_0x505412(0x152)+_0x505412(0x119));const _0x2a85b=_0xd19e2c;if(_0x144d07['length']===0x0)return console[_0x505412(0x19a)](a28_0x414911[_0x505412(0x196)](_0x505412(0x1ac))),console[_0x505412(0x19a)](_0x505412(0x1d5)),0x1;const _0x35b54b=_0x144d07[0x0];if(!_0x2a85b[_0x505412(0xf0)]||!_0x2a85b['table'])return console['error'](_0x505412(0x139)),console[_0x505412(0x19a)](_0x505412(0x1d5)),0x1;_0x2a85b[_0x505412(0x19b)]&&(console[_0x505412(0x19a)]('Site:\x20'+_0x2a85b[_0x505412(0x15c)]),console[_0x505412(0x19a)]('Name:\x20'+_0x35b54b),console[_0x505412(0x19a)](_0x505412(0x1fd)+_0x2a85b[_0x505412(0xf0)]),console[_0x505412(0x19a)]('Table:\x20'+_0x2a85b[_0x505412(0x16e)]));const _0x51d925=await loadJSONFromOptions(_0x2a85b[_0x505412(0x1c2)],_0x2a85b[_0x505412(0x145)]),_0x46e624=await loadJSONFromOptions(_0x2a85b[_0x505412(0x1cc)],_0x2a85b[_0x505412(0x169)]),_0x39a5af=await loadJSONFromOptions(_0x2a85b[_0x505412(0x1a4)],_0x2a85b[_0x505412(0x15e)]),_0x4d6167={'name':_0x35b54b,'description':_0x2a85b[_0x505412(0x204)],'scheduleType':_0x2a85b[_0x505412(0x10c)],'scheduleOption':_0x2a85b[_0x505412(0x195)],'timezone':_0x2a85b[_0x505412(0x16d)],'master':{'parentDatabaseName':_0x2a85b['database'],'parentTableName':_0x2a85b[_0x505412(0x16e)]},'attributes':_0x51d925,'behaviors':_0x46e624,'customerGroup':_0x39a5af},_0x5e74c4=await withSpinner(_0x505412(0x16f)+_0x35b54b+_0x505412(0x190),()=>_0x5974b5[_0x505412(0xf9)][_0x505412(0x14a)](_0x4d6167),{'verbose':_0xd19e2c[_0x505412(0x19b)]}),_0x44c24d=_0x5e74c4[_0x505412(0x19f)];return console[_0x505412(0x19a)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x44c24d[_0x505412(0x162)]+_0x505412(0x17d)+_0x44c24d['id']),await handleSDKOutput([_0x44c24d],_0xd19e2c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a28_0x13db83(0x162)]='segment:parent:update';[a28_0x13db83(0x204)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x50ef64){const _0xe5cc1f=a28_0x13db83,{options:_0x4e255e,args:_0x169c76,tdx:_0x97adb9}=_0x50ef64;console[_0xe5cc1f(0x19a)](_0xe5cc1f(0x129)+_0xe5cc1f(0x152)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3ae1db=_0x4e255e;if(_0x169c76[_0xe5cc1f(0x1d0)]===0x0)return console['error'](a28_0x414911[_0xe5cc1f(0x196)](_0xe5cc1f(0x1ac))),console[_0xe5cc1f(0x19a)](_0xe5cc1f(0x118)),0x1;const _0x2798f8=_0x169c76[0x0];_0x3ae1db[_0xe5cc1f(0x19b)]&&(console[_0xe5cc1f(0x19a)]('Site:\x20'+_0x3ae1db[_0xe5cc1f(0x15c)]),console['error']('Parent\x20segment:\x20'+_0x2798f8));const _0x576387=await withSpinner(_0xe5cc1f(0x165)+_0x2798f8+'\x27...',()=>_0x97adb9[_0xe5cc1f(0xf9)][_0xe5cc1f(0x130)](_0x2798f8),{'verbose':_0x3ae1db['verbose']}),_0x45c8f9=_0x576387[_0xe5cc1f(0x19f)],_0x515e19=await loadJSONFromOptions(_0x3ae1db['addAttributes'],_0x3ae1db['addAttributesFile']),_0x236cb6=await loadJSONFromOptions(_0x3ae1db[_0xe5cc1f(0x19d)],_0x3ae1db['addBehaviorsFile']),_0x5acf4e={'name':_0x45c8f9[_0xe5cc1f(0x162)],'description':_0x3ae1db[_0xe5cc1f(0x204)]!==undefined?_0x3ae1db['description']:_0x45c8f9[_0xe5cc1f(0x204)],'scheduleType':_0x3ae1db['scheduleType']!==undefined?_0x3ae1db[_0xe5cc1f(0x10c)]:_0x45c8f9[_0xe5cc1f(0x10c)],'scheduleOption':_0x3ae1db[_0xe5cc1f(0x195)]!==undefined?_0x3ae1db[_0xe5cc1f(0x195)]:_0x45c8f9[_0xe5cc1f(0x195)],'timezone':_0x3ae1db[_0xe5cc1f(0x16d)]!==undefined?_0x3ae1db[_0xe5cc1f(0x16d)]:_0x45c8f9[_0xe5cc1f(0x16d)],'master':_0x45c8f9[_0xe5cc1f(0x17e)],'attributes':_0x515e19?[..._0x45c8f9[_0xe5cc1f(0x1c2)]||[],..._0x515e19]:_0x45c8f9[_0xe5cc1f(0x1c2)],'behaviors':_0x236cb6?[..._0x45c8f9[_0xe5cc1f(0x1cc)]||[],..._0x236cb6]:_0x45c8f9[_0xe5cc1f(0x1cc)],'customerGroup':_0x45c8f9[_0xe5cc1f(0x1a4)]},_0x2cc88a=await withSpinner(_0xe5cc1f(0x202)+_0x2798f8+_0xe5cc1f(0x190),()=>_0x97adb9['segment'][_0xe5cc1f(0x12a)](_0x2798f8,_0x5acf4e),{'verbose':_0x3ae1db[_0xe5cc1f(0x19b)]}),_0x15d2bb=_0x2cc88a[_0xe5cc1f(0x19f)];return console[_0xe5cc1f(0x19a)](_0xe5cc1f(0x1d1)+_0x15d2bb[_0xe5cc1f(0x162)]+'\x27'),await handleSDKOutput([_0x15d2bb],_0x3ae1db),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a28_0x13db83(0x162)]='segment:parent:pull';[a28_0x13db83(0x204)]=a28_0x13db83(0x174);async[a28_0x13db83(0x207)](_0x2afbc8){const _0x2243d2=a28_0x13db83,{options:_0x1e112e,args:_0x5b07cf,tdx:_0x353e9c}=_0x2afbc8,_0x50a240=_0x1e112e,_0x442c98=_0x5b07cf[0x0]||_0x1e112e['parentSegment'];if(!_0x442c98)return showParentSegmentNotSetError(_0x2243d2(0x1b6)+_0x2243d2(0x1cf)),0x1;if(_0x50a240[_0x2243d2(0x16a)]&&_0x50a240[_0x2243d2(0x1b3)])return console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x196)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x159)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x2243d2(0x19a)](a28_0x414911['dim'](_0x2243d2(0x163)+PARENT_SEGMENT_DIR+_0x2243d2(0x114))),console[_0x2243d2(0x19a)](a28_0x414911['cyan'](_0x2243d2(0x20a))),0x1;const _0x4c2482=_0x50a240['output']||a28_0x1a1c24[_0x2243d2(0x132)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x442c98)+_0x2243d2(0x142));_0x50a240[_0x2243d2(0x19b)]&&(console[_0x2243d2(0x19a)](_0x2243d2(0x135)+_0x50a240['site']),console[_0x2243d2(0x19a)](_0x2243d2(0x1bd)+_0x442c98),console['error'](_0x2243d2(0x1d8)+_0x4c2482));const _0x2c0c87=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x442c98+_0x2243d2(0x190),()=>_0x353e9c[_0x2243d2(0xf9)][_0x2243d2(0x1e0)](_0x442c98),{'verbose':_0x50a240[_0x2243d2(0x19b)]}),_0x5e85f2=_0x2c0c87[_0x2243d2(0x19f)];if(existsSync(_0x4c2482)){const _0x134be9=readFileSync(_0x4c2482,'utf-8'),_0x5935e5=generateDiff(_0x134be9,_0x5e85f2);if(!hasChanges(_0x5935e5))console[_0x2243d2(0x19a)](a28_0x414911['green']('✔')+'\x20No\x20changes\x20-\x20'+a28_0x414911['cyan'](_0x4c2482)+_0x2243d2(0x102));else{console[_0x2243d2(0x19a)](_0x2243d2(0x201)+_0x4c2482+'\x27:'),console['error']('─'[_0x2243d2(0x18d)](0x3c)),console[_0x2243d2(0x19a)](formatDiffWithColors(_0x5935e5)),console[_0x2243d2(0x19a)]('─'[_0x2243d2(0x18d)](0x3c));if(!_0x50a240['yes']){const _0x1af1fb=await confirmKey(_0x2243d2(0x14e)+_0x4c2482+'\x27?');if(!_0x1af1fb)return console[_0x2243d2(0x19a)](_0x2243d2(0x1ef)),0x1;}writeFileSync(_0x4c2482,_0x5e85f2,_0x2243d2(0x191)),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x113)]('✔')+_0x2243d2(0x1d3)+a28_0x414911[_0x2243d2(0x137)](_0x4c2482));}}else{const _0x1d4542=a28_0x1a1c24[_0x2243d2(0x1f3)](_0x4c2482);!existsSync(_0x1d4542)&&mkdirSync(_0x1d4542,{'recursive':!![]}),writeFileSync(_0x4c2482,_0x5e85f2,_0x2243d2(0x191)),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x113)]('✔')+_0x2243d2(0x1d3)+a28_0x414911[_0x2243d2(0x137)](_0x4c2482));}return saveSessionContext({'parent_segment':_0x442c98},_0x50a240[_0x2243d2(0x18e)]),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x113)]('✔')+_0x2243d2(0x200)+a28_0x414911[_0x2243d2(0x159)](_0x2243d2(0x115))+_0x2243d2(0x103)+a28_0x414911[_0x2243d2(0x137)](_0x442c98)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a28_0x13db83(0xf3);[a28_0x13db83(0x204)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x1a1652){const _0x138c45=a28_0x13db83,{options:_0x55fa63,args:_0xb1b7fb,tdx:_0x42ac3f}=_0x1a1652,_0x3fa765=_0x55fa63,_0x44efdb=_0xb1b7fb[0x0]||_0x55fa63[_0x138c45(0xf2)];if(!_0x44efdb)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 _0x19538a=resolveYamlFile(_0x44efdb);if(!existsSync(_0x19538a))return showFileNotFoundError(_0x19538a,_0x44efdb),0x1;_0x3fa765[_0x138c45(0x19b)]&&(console[_0x138c45(0x19a)](_0x138c45(0x135)+_0x3fa765[_0x138c45(0x15c)]),console[_0x138c45(0x19a)](_0x138c45(0x1c7)+_0x19538a));let _0x36af6b;try{_0x36af6b=readFileSync(_0x19538a,_0x138c45(0x191));}catch(_0x46e1f3){const _0x2cdf71=_0x46e1f3 instanceof Error?_0x46e1f3['message']:String(_0x46e1f3);return console[_0x138c45(0x19a)](_0x138c45(0x20c)+_0x2cdf71),0x1;}const _0xa399b6=await withSpinner(_0x138c45(0x173),()=>_0x42ac3f['segment'][_0x138c45(0x1c8)](_0x36af6b),{'verbose':_0x3fa765[_0x138c45(0x19b)]}),_0x266aaf=_0xa399b6[_0x138c45(0x19f)],{isNew:_0x4755f7,name:_0x4ca4aa,hasChanges:_0x13b386,diffFormatted:_0x5b4ebb}=_0x266aaf;if(!_0x13b386)return console[_0x138c45(0x19a)]('✔\x20No\x20changes\x20-\x20\x27'+_0x4ca4aa+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x4755f7?console[_0x138c45(0x19a)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x4ca4aa+'\x27:'):console[_0x138c45(0x19a)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4ca4aa+'\x27:');console['error']('─'[_0x138c45(0x18d)](0x3c)),console['error'](_0x5b4ebb),console['error']('─'[_0x138c45(0x18d)](0x3c));const _0x354a91=_0x4755f7?_0x138c45(0x185)+_0x4ca4aa+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x4ca4aa+'\x27?';if(!_0x3fa765[_0x138c45(0x128)]){const _0x57d744=await confirmKey(_0x354a91);if(!_0x57d744)return console[_0x138c45(0x19a)](_0x138c45(0x1ef)),0x1;}const _0x2b9684=_0x4755f7?_0x138c45(0x1d6):'Updating',_0x444483=await withSpinner(_0x2b9684+_0x138c45(0x1ee)+_0x4ca4aa+_0x138c45(0x190),()=>_0x266aaf[_0x138c45(0x1f5)](),{'verbose':_0x3fa765[_0x138c45(0x19b)]}),_0x363861=_0x444483[_0x138c45(0x19f)],_0x319dcc=getConsoleNextUrl(_0x3fa765[_0x138c45(0x15c)],_0x138c45(0x108)+_0x363861['id']),_0x2ed534=_0x4755f7?_0x138c45(0x19e):'Updated';return console['error']('✔\x20'+_0x2ed534+_0x138c45(0x1ee)+_0x363861[_0x138c45(0x162)]+'\x27'),console[_0x138c45(0x19a)]('\x20\x20'+_0x319dcc),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x184);[a28_0x13db83(0x204)]=a28_0x13db83(0x178);async['execute'](_0x1aebc4){const _0x100a3e=a28_0x13db83,{options:_0x3062ee,args:_0xec3986,tdx:_0x4d469a}=_0x1aebc4,_0x5568a9=_0x3062ee,_0x96a494=_0xec3986[0x0]||_0x3062ee[_0x100a3e(0xf2)];if(!_0x96a494)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x100a3e(0x134)+_0x100a3e(0xfa)+_0x100a3e(0x1f0)+_0x100a3e(0x1bc)),0x1;const _0x152f01=resolveYamlFile(_0x96a494);if(!existsSync(_0x152f01))return showFileNotFoundError(_0x152f01,_0x96a494),0x1;_0x5568a9['verbose']&&(console[_0x100a3e(0x19a)](_0x100a3e(0x135)+_0x5568a9[_0x100a3e(0x15c)]),console[_0x100a3e(0x19a)]('YAML\x20file:\x20'+_0x152f01));let _0x17e9d5;try{_0x17e9d5=readFileSync(_0x152f01,_0x100a3e(0x191));}catch(_0x272f20){const _0xf983aa=_0x272f20 instanceof Error?_0x272f20['message']:String(_0x272f20);return console[_0x100a3e(0x19a)](_0x100a3e(0x20c)+_0xf983aa),0x1;}const _0x31879c=createCommandSpinner(a28_0x414911[_0x100a3e(0x159)]('Validating\x20configuration...'),{'verbose':_0x5568a9['verbose']});_0x31879c[_0x100a3e(0x10a)]();const _0x248ac1={'onProgress':_0xda7219=>{_0x31879c['text']=formatProgressMessage(_0xda7219);}};if(_0x5568a9[_0x100a3e(0x17e)])_0x248ac1[_0x100a3e(0x17e)]=!![];if(_0x5568a9[_0x100a3e(0x1c1)])_0x248ac1[_0x100a3e(0x1c1)]=!![];_0x5568a9[_0x100a3e(0x15d)]&&(_0x248ac1['attribute']=_0x5568a9[_0x100a3e(0x15d)]);_0x5568a9[_0x100a3e(0x192)]&&(_0x248ac1[_0x100a3e(0x192)]=_0x5568a9[_0x100a3e(0x192)]);if(_0x5568a9[_0x100a3e(0x1c3)])_0x248ac1['interval']=_0x5568a9[_0x100a3e(0x1c3)];let _0x3ec794;try{_0x3ec794=await _0x4d469a[_0x100a3e(0xf9)][_0x100a3e(0x12d)](_0x17e9d5,_0x248ac1),_0x31879c[_0x100a3e(0x125)]();}catch(_0x1faf92){_0x31879c[_0x100a3e(0x125)]();throw _0x1faf92;}const _0x1bfe08=_0x5568a9[_0x100a3e(0x1c3)]||_0x100a3e(0x1e2);return this[_0x100a3e(0x186)](_0x3ec794,_0x248ac1,_0x152f01,_0x1bfe08),_0x3ec794[_0x100a3e(0x1a9)]?0x0:0x1;}[a28_0x13db83(0x186)](_0x4fb2c8,_0x387c24,_0x3326c9,_0x2da40a){const _0x3ceb41=a28_0x13db83;console[_0x3ceb41(0x19a)]('\x0a'+a28_0x414911[_0x3ceb41(0x1e7)]('Validate:')+'\x20'+_0x4fb2c8['name']),console['error']('═'[_0x3ceb41(0x18d)](0x3c)),this[_0x3ceb41(0x146)](_0x4fb2c8);if(typeof _0x387c24[_0x3ceb41(0x15d)]===_0x3ceb41(0xf7)){this[_0x3ceb41(0x1a2)](_0x4fb2c8),this['displaySummary'](_0x4fb2c8),this['displayPreviewHints'](_0x3326c9,_0x2da40a,'attribute',_0x387c24[_0x3ceb41(0x15d)]);return;}if(_0x387c24[_0x3ceb41(0x15d)]===!![]){this[_0x3ceb41(0x1a2)](_0x4fb2c8),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,_0x3ceb41(0x1c2));return;}if(typeof _0x387c24[_0x3ceb41(0x192)]===_0x3ceb41(0xf7)){this[_0x3ceb41(0x1a3)](_0x4fb2c8,_0x2da40a),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,_0x3ceb41(0x192),_0x387c24[_0x3ceb41(0x192)]);return;}if(_0x387c24[_0x3ceb41(0x192)]===!![]){this[_0x3ceb41(0x1a3)](_0x4fb2c8,_0x2da40a),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,'behaviors');return;}this[_0x3ceb41(0x1a2)](_0x4fb2c8),this[_0x3ceb41(0x1a3)](_0x4fb2c8,_0x2da40a),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,_0x3ceb41(0x18f));}[a28_0x13db83(0x1ad)](_0x4f849b,_0x46dab3,_0x5750fc,_0x7127bb){const _0x524038=a28_0x13db83;console[_0x524038(0x19a)]('\x0a'+a28_0x414911[_0x524038(0x159)]('To\x20view\x20sample\x20data:'));const _0x549bff=_0x46dab3!==_0x524038(0x1e2)?_0x524038(0x11b)+_0x46dab3:'';if(_0x5750fc===_0x524038(0x15d)&&_0x7127bb)console[_0x524038(0x19a)]('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x126)+_0x7127bb+'\x22'+_0x549bff));else{if(_0x5750fc===_0x524038(0x192)&&_0x7127bb)console['error']('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x1b0)+_0x7127bb+'\x22'+_0x549bff));else(_0x5750fc===_0x524038(0x1c2)||_0x5750fc==='all')&&console[_0x524038(0x19a)]('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x155)+_0x549bff));}(_0x5750fc==='behaviors'||_0x5750fc==='all')&&console['error']('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x1b1)+_0x549bff)),_0x5750fc===_0x524038(0x18f)&&console[_0x524038(0x19a)]('\x20\x20'+a28_0x414911[_0x524038(0x159)]('tdx\x20segment\x20parent\x20preview\x20'+_0x4f849b+_0x524038(0x111)+_0x549bff));}['displayMasterInfo'](_0x43af8e){const _0x24fafb=a28_0x13db83,{master:_0x569fa2}=_0x43af8e,_0x15787f=_0x569fa2[_0x24fafb(0x166)]?a28_0x414911[_0x24fafb(0x113)]('✔'):a28_0x414911[_0x24fafb(0x196)]('✘');console['error']('\x0a'+a28_0x414911[_0x24fafb(0x159)]('Master\x20Table')),console[_0x24fafb(0x19a)](_0x15787f+'\x20'+a28_0x414911['bold'](_0x569fa2['database']+'.'+_0x569fa2['table'])),_0x569fa2[_0x24fafb(0x166)]?_0x569fa2['rowCount']!==undefined&&console['error']('\x20\x20'+a28_0x414911[_0x24fafb(0x159)](_0x24fafb(0x156))+'\x20'+a28_0x414911[_0x24fafb(0x137)](formatRows(_0x569fa2[_0x24fafb(0x183)]))):console[_0x24fafb(0x19a)]('\x20\x20'+a28_0x414911[_0x24fafb(0x196)](_0x24fafb(0x1f2))+'\x20'+_0x569fa2[_0x24fafb(0x110)]);}['displayAttributesStats'](_0x30bede){const _0x272898=a28_0x13db83;if(_0x30bede['attributes'][_0x272898(0x1d0)]===0x0)return;console[_0x272898(0x19a)]('\x0a'+a28_0x414911['dim']('Attributes'));for(const _0x50f1e5 of _0x30bede[_0x272898(0x1c2)]){const _0x22601a=_0x50f1e5['schemaValid']?a28_0x414911[_0x272898(0x113)]('✔'):a28_0x414911['red']('✘');let _0xd404d0='';if(_0x50f1e5['schemaValid']&&_0x50f1e5['matchedCount']!==undefined&&_0x50f1e5[_0x272898(0x10b)]!==undefined){const _0x113b6b=_0x50f1e5[_0x272898(0x10b)][_0x272898(0x13d)](0x1),_0x5f20fe=_0x50f1e5[_0x272898(0x10b)]>=0x50?a28_0x414911['green']:_0x50f1e5['coveragePercent']>=0x32?a28_0x414911[_0x272898(0x141)]:a28_0x414911[_0x272898(0x196)];_0xd404d0='\x20'+a28_0x414911[_0x272898(0x159)](_0x272898(0x153))+'\x20'+_0x5f20fe(_0x113b6b+'%')+'\x20('+formatRows(_0x50f1e5[_0x272898(0x189)])+'\x20rows)';}console['error'](_0x22601a+'\x20'+a28_0x414911['bold'](_0x50f1e5[_0x272898(0x162)])+_0xd404d0),console[_0x272898(0x19a)]('\x20\x20'+a28_0x414911[_0x272898(0x159)](_0x272898(0xeb))+'\x20'+a28_0x414911['bold'](_0x50f1e5[_0x272898(0xf0)]+'.'+_0x50f1e5['table']));const _0x569933=_0x50f1e5[_0x272898(0xef)]===_0x50f1e5[_0x272898(0x193)]?a28_0x414911[_0x272898(0x159)](_0x272898(0x176))+'\x20'+_0x50f1e5[_0x272898(0xef)]:a28_0x414911['dim'](_0x272898(0x16c))+'\x20'+_0x50f1e5[_0x272898(0xef)]+_0x272898(0x103)+_0x50f1e5[_0x272898(0x193)];console[_0x272898(0x19a)]('\x20\x20'+_0x569933),console[_0x272898(0x19a)]('\x20\x20'+a28_0x414911[_0x272898(0x159)](_0x272898(0x124))),this[_0x272898(0x1e3)](_0x50f1e5[_0x272898(0x12b)]),!_0x50f1e5[_0x272898(0x166)]&&console[_0x272898(0x19a)]('\x20\x20'+a28_0x414911[_0x272898(0x196)](_0x272898(0x1f2))+'\x20'+_0x50f1e5['schemaError']);}}[a28_0x13db83(0x1a3)](_0x32eecf,_0x2ac6d1){const _0x36a238=a28_0x13db83;if(_0x32eecf[_0x36a238(0x1cc)][_0x36a238(0x1d0)]===0x0)return;console['error']('\x0a'+a28_0x414911[_0x36a238(0x159)](_0x36a238(0x116))+'\x20'+a28_0x414911[_0x36a238(0x159)]('('+_0x2ac6d1+')'));for(const _0xf35262 of _0x32eecf['behaviors']){const _0x11e40d=_0xf35262[_0x36a238(0x166)]?a28_0x414911[_0x36a238(0x113)]('✔'):a28_0x414911[_0x36a238(0x196)]('✘');let _0x177722='';if(_0xf35262[_0x36a238(0x166)]&&_0xf35262['customersWithEvents']!==undefined&&_0xf35262[_0x36a238(0x1c6)]!==undefined){const _0x8fbc0f=_0xf35262[_0x36a238(0xfc)]?.[_0x36a238(0x13d)](0x1)||'?',_0x3d013a=(_0xf35262['customerPercent']??0x0)>=0x32?a28_0x414911[_0x36a238(0x113)]:(_0xf35262[_0x36a238(0xfc)]??0x0)>=0x14?a28_0x414911[_0x36a238(0x141)]:a28_0x414911[_0x36a238(0x196)];_0x177722='\x20'+a28_0x414911[_0x36a238(0x159)](_0x36a238(0x123))+'\x20'+_0x3d013a(formatRows(_0xf35262['customersWithEvents']))+'\x20('+_0x8fbc0f+_0x36a238(0x205)+a28_0x414911['dim'](_0x36a238(0x1c9))+'\x20'+a28_0x414911[_0x36a238(0x137)](formatRows(_0xf35262[_0x36a238(0x1c6)]));}console['error'](_0x11e40d+'\x20'+a28_0x414911['bold'](_0xf35262[_0x36a238(0x162)])+_0x177722),console[_0x36a238(0x19a)]('\x20\x20'+a28_0x414911['dim']('Source:')+'\x20'+a28_0x414911['bold'](_0xf35262[_0x36a238(0xf0)]+'.'+_0xf35262['table']));const _0x584cb6=_0xf35262[_0x36a238(0xef)]===_0xf35262[_0x36a238(0x193)]?a28_0x414911[_0x36a238(0x159)](_0x36a238(0x176))+'\x20'+_0xf35262[_0x36a238(0xef)]:a28_0x414911['dim'](_0x36a238(0x16c))+'\x20'+_0xf35262['joinKey']+'\x20=\x20'+_0xf35262[_0x36a238(0x193)];console[_0x36a238(0x19a)]('\x20\x20'+_0x584cb6),console[_0x36a238(0x19a)]('\x20\x20'+a28_0x414911[_0x36a238(0x159)]('Columns:')),this[_0x36a238(0x1e3)](_0xf35262['columns']),!_0xf35262[_0x36a238(0x166)]&&console[_0x36a238(0x19a)]('\x20\x20'+a28_0x414911['red'](_0x36a238(0x1f2))+'\x20'+_0xf35262[_0x36a238(0x110)]);}}['displayColumns'](_0x105a0f){const _0x2ae8fa=a28_0x13db83;for(const _0x15981e of _0x105a0f){_0x15981e[_0x2ae8fa(0x1a0)]===_0x15981e[_0x2ae8fa(0x131)]||_0x15981e[_0x2ae8fa(0x131)]==='*'?console['error'](_0x2ae8fa(0x1a7)+_0x15981e['label']):console['error']('\x20\x20\x20\x20-\x20'+_0x15981e[_0x2ae8fa(0x1a0)]+'\x20'+a28_0x414911[_0x2ae8fa(0x159)]('('+_0x15981e['column']+')'));}}['displaySummary'](_0x3b1a1a){const _0x54ebf2=a28_0x13db83;console[_0x54ebf2(0x19a)]('─'[_0x54ebf2(0x18d)](0x3c));if(_0x3b1a1a[_0x54ebf2(0x1b7)]['length']>0x0){console[_0x54ebf2(0x19a)]('\x0a'+a28_0x414911[_0x54ebf2(0x196)](_0x54ebf2(0x104)));for(const _0x3f88b6 of _0x3b1a1a['errors']){console[_0x54ebf2(0x19a)]('\x20\x20'+a28_0x414911[_0x54ebf2(0x196)]('•')+'\x20'+_0x3f88b6);}}_0x3b1a1a['allValid']&&console[_0x54ebf2(0x19a)]('\x0a'+a28_0x414911[_0x54ebf2(0x113)]('✔')+_0x54ebf2(0x1e6));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x1bf);[a28_0x13db83(0x204)]=a28_0x13db83(0x13e);async[a28_0x13db83(0x207)](_0x2f0ff5){const _0x3d5b84=a28_0x13db83,{options:_0x37e1d3,args:_0x2453d0,tdx:_0x333f40}=_0x2f0ff5,_0x4f1de2=_0x37e1d3,_0x364890=_0x2453d0[0x0]||_0x37e1d3[_0x3d5b84(0xf2)];if(!_0x364890)return showParentSegmentNotSetError(_0x3d5b84(0x1a8)+_0x3d5b84(0x18c)+_0x3d5b84(0x12e)+_0x3d5b84(0xfb)+_0x3d5b84(0x112)+_0x3d5b84(0x1c0)+_0x3d5b84(0x1ea)+_0x3d5b84(0x1bc)),0x1;if(!_0x4f1de2[_0x3d5b84(0x17e)]&&!_0x4f1de2['attribute']&&!_0x4f1de2[_0x3d5b84(0x192)]&&!_0x4f1de2[_0x3d5b84(0x1c1)])return console[_0x3d5b84(0x19a)](a28_0x414911[_0x3d5b84(0x196)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x3d5b84(0x19a)](_0x3d5b84(0x100)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x105)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x172)),console['error'](_0x3d5b84(0xff)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x17c)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x181)),0x1;const _0x2a269e=resolveYamlFile(_0x364890);if(!existsSync(_0x2a269e))return showFileNotFoundError(_0x2a269e,_0x364890),0x1;_0x4f1de2[_0x3d5b84(0x19b)]&&(console['error'](_0x3d5b84(0x135)+_0x4f1de2[_0x3d5b84(0x15c)]),console[_0x3d5b84(0x19a)](_0x3d5b84(0x1c7)+_0x2a269e));let _0x2c3cf1;try{_0x2c3cf1=readFileSync(_0x2a269e,_0x3d5b84(0x191));}catch(_0x2df129){const _0xd5a419=_0x2df129 instanceof Error?_0x2df129['message']:String(_0x2df129);return console['error'](_0x3d5b84(0x20c)+_0xd5a419),0x1;}let _0x16f769;try{_0x16f769=parseYamlString(_0x2c3cf1);}catch(_0x3ad0c8){const _0x3e3681=_0x3ad0c8 instanceof Error?_0x3ad0c8['message']:String(_0x3ad0c8);return console['error'](a28_0x414911[_0x3d5b84(0x196)](_0x3d5b84(0x138)+_0x3e3681)),0x1;}if(_0x4f1de2['attribute']===!![]||_0x4f1de2[_0x3d5b84(0x15d)]===''){const _0x8c5351=_0x16f769[_0x3d5b84(0x1c2)]?.['map'](_0x57e130=>_0x57e130[_0x3d5b84(0x162)])||[];if(_0x8c5351[_0x3d5b84(0x1d0)]===0x0)console['error'](a28_0x414911['red'](_0x3d5b84(0x1af)));else{console['error'](a28_0x414911[_0x3d5b84(0x196)](_0x3d5b84(0x13c))),console[_0x3d5b84(0x19a)](_0x3d5b84(0x151));for(const _0x302afe of _0x8c5351){console[_0x3d5b84(0x19a)]('\x20\x20'+a28_0x414911[_0x3d5b84(0x137)](_0x302afe));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x364890+_0x3d5b84(0x126)+_0x8c5351[0x0]+'\x22');}return 0x1;}if(_0x4f1de2['behavior']===!![]||_0x4f1de2[_0x3d5b84(0x192)]===''){const _0x1ba6f0=_0x16f769['behaviors']?.['map'](_0x429d71=>_0x429d71['name'])||[];if(_0x1ba6f0[_0x3d5b84(0x1d0)]===0x0)console[_0x3d5b84(0x19a)](a28_0x414911[_0x3d5b84(0x196)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x3d5b84(0x19a)](a28_0x414911[_0x3d5b84(0x196)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x3d5b84(0x17a));for(const _0x4f88a7 of _0x1ba6f0){console[_0x3d5b84(0x19a)]('\x20\x20'+a28_0x414911[_0x3d5b84(0x137)](_0x4f88a7));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x364890+'\x20--behavior\x20\x22'+_0x1ba6f0[0x0]+'\x22');}return 0x1;}const _0x474df5=createCommandSpinner(a28_0x414911['dim']('Fetching\x20sample\x20data...'),{'verbose':_0x4f1de2[_0x3d5b84(0x19b)]});_0x474df5['start']();const _0x1c9fd9={'onProgress':_0x4fc522=>{const _0x49b49b=_0x3d5b84;_0x474df5[_0x49b49b(0x15b)]=formatProgressMessage(_0x4fc522);}};if(_0x4f1de2[_0x3d5b84(0x17e)])_0x1c9fd9['master']=!![];if(_0x4f1de2[_0x3d5b84(0x15d)]&&typeof _0x4f1de2[_0x3d5b84(0x15d)]===_0x3d5b84(0xf7))_0x1c9fd9[_0x3d5b84(0x15d)]=_0x4f1de2[_0x3d5b84(0x15d)];if(_0x4f1de2[_0x3d5b84(0x192)]&&typeof _0x4f1de2[_0x3d5b84(0x192)]===_0x3d5b84(0xf7))_0x1c9fd9[_0x3d5b84(0x192)]=_0x4f1de2['behavior'];if(_0x4f1de2[_0x3d5b84(0x1c1)])_0x1c9fd9['enriched']=!![];if(_0x4f1de2[_0x3d5b84(0x1c3)])_0x1c9fd9[_0x3d5b84(0x1c3)]=_0x4f1de2[_0x3d5b84(0x1c3)];let _0x4540af;try{_0x4540af=await _0x333f40[_0x3d5b84(0xf9)][_0x3d5b84(0x1f9)](_0x2c3cf1,_0x1c9fd9),_0x474df5[_0x3d5b84(0x125)]();}catch(_0x1458ec){_0x474df5[_0x3d5b84(0x125)]();throw _0x1458ec;}return await this[_0x3d5b84(0x17f)](_0x4540af,{'master':_0x4f1de2['master'],'attribute':typeof _0x4f1de2['attribute']===_0x3d5b84(0xf7)?_0x4f1de2[_0x3d5b84(0x15d)]:undefined,'behavior':typeof _0x4f1de2['behavior']===_0x3d5b84(0xf7)?_0x4f1de2['behavior']:undefined,'enriched':_0x4f1de2[_0x3d5b84(0x1c1)]}),_0x4540af[_0x3d5b84(0x1a9)]?0x0:0x1;}async['displayPreviewResults'](_0x31b05e,_0x592c79){const _0x27787b=a28_0x13db83;console[_0x27787b(0x19a)]('\x0a'+a28_0x414911[_0x27787b(0x1e7)](_0x27787b(0x1fa))+'\x20'+_0x31b05e[_0x27787b(0x162)]),console['error']('═'[_0x27787b(0x18d)](0x3c));if(_0x592c79['master']&&_0x31b05e[_0x27787b(0x14d)]){const _0x5b9747=a28_0x414911[_0x27787b(0x159)](_0x27787b(0x13f))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x31b05e['master'][_0x27787b(0xf0)]+'.'+_0x31b05e['master'][_0x27787b(0x16e)]);await this[_0x27787b(0x120)](_0x5b9747,_0x31b05e['sampleData']);}else{if(_0x592c79['attribute']&&_0x31b05e[_0x27787b(0x14d)]){const _0x38ee86=a28_0x414911[_0x27787b(0x159)](_0x27787b(0x1e9))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x592c79['attribute']);await this[_0x27787b(0x120)](_0x38ee86,_0x31b05e[_0x27787b(0x14d)]);}else{if(_0x592c79[_0x27787b(0x192)]&&_0x31b05e[_0x27787b(0x14d)]){const _0x246519=a28_0x414911['dim'](_0x27787b(0x1aa))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x592c79[_0x27787b(0x192)]);await this[_0x27787b(0x120)](_0x246519,_0x31b05e[_0x27787b(0x14d)]);}else{if(_0x592c79[_0x27787b(0x1c1)]&&_0x31b05e[_0x27787b(0x14d)]){const _0x339a4f=a28_0x414911[_0x27787b(0x159)](_0x27787b(0x209))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x27787b(0x1a6));await this['displaySampleData'](_0x339a4f,_0x31b05e[_0x27787b(0x14d)]);}else!_0x31b05e[_0x27787b(0x14d)]&&console[_0x27787b(0x19a)](_0x27787b(0x180));}}}if(_0x31b05e[_0x27787b(0x1b7)][_0x27787b(0x1d0)]>0x0){console[_0x27787b(0x19a)]('─'[_0x27787b(0x18d)](0x3c)),console['error']('\x0a'+a28_0x414911[_0x27787b(0x196)]('Errors:'));for(const _0x5d51f3 of _0x31b05e[_0x27787b(0x1b7)]){console[_0x27787b(0x19a)]('\x20\x20'+a28_0x414911[_0x27787b(0x196)]('•')+'\x20'+_0x5d51f3);}}}async['displaySampleData'](_0x5278a1,_0x209fd9){const _0x172e1d=a28_0x13db83;if(_0x209fd9[_0x172e1d(0x1d0)]===0x0){console['error']('\x0a'+_0x5278a1),console[_0x172e1d(0x19a)](_0x172e1d(0x1b5));return;}console[_0x172e1d(0x19a)]('\x0a'+_0x5278a1);const _0x1a2f7d=Object[_0x172e1d(0xee)](_0x209fd9[0x0])[_0x172e1d(0xfd)](_0x3a62a1=>({'name':_0x3a62a1,'type':typeof _0x209fd9[0x0][_0x3a62a1]===_0x172e1d(0x1f4)?_0x172e1d(0x1db):_0x172e1d(0xe8)})),_0x1f3385={'queryId':'preview','columns':_0x1a2f7d,'data':_0x209fd9,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x209fd9['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x443eb3=formatAsTable(_0x1f3385,_0x209fd9[_0x172e1d(0x1d0)],!![]);await writeOutput(_0x443eb3,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a28_0x13db83(0x1c4);[a28_0x13db83(0x204)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x304b4a){const _0x49d988=a28_0x13db83,{options:_0x506bdc,args:_0x529d78,tdx:_0x1112a1}=_0x304b4a,_0x48352c=_0x506bdc,_0x1e4821=_0x529d78[0x0]||_0x506bdc['parentSegment'];if(!_0x1e4821)return showParentSegmentNotSetError(_0x49d988(0x198)+_0x49d988(0x106)),0x1;const _0x2c5da6=resolveYamlFile(_0x1e4821);if(existsSync(_0x2c5da6)){_0x48352c[_0x49d988(0x19b)]&&console[_0x49d988(0x19a)](_0x49d988(0x1e1)+_0x2c5da6);let _0x47ba7b;try{_0x47ba7b=readFileSync(_0x2c5da6,_0x49d988(0x191));}catch(_0x26d85d){const _0xd4e850=_0x26d85d instanceof Error?_0x26d85d[_0x49d988(0x182)]:String(_0x26d85d);return console[_0x49d988(0x19a)](_0x49d988(0x20c)+_0xd4e850),0x1;}const _0x1bbddf=await withSpinner(_0x49d988(0x173),()=>_0x1112a1[_0x49d988(0xf9)]['pushParentYaml'](_0x47ba7b),{'verbose':_0x48352c['verbose']}),_0x53ff2d=_0x1bbddf[_0x49d988(0x19f)],{isNew:_0x943002,name:_0xa86a4,hasChanges:_0x2f084f,diffFormatted:_0x52eadb}=_0x53ff2d;if(_0x2f084f){_0x943002?console[_0x49d988(0x19a)](_0x49d988(0x197)+_0xa86a4+'\x27:'):console[_0x49d988(0x19a)](_0x49d988(0xe7)+_0xa86a4+'\x27:');console['error']('─'[_0x49d988(0x18d)](0x3c)),console['error'](_0x52eadb),console['error']('─'['repeat'](0x3c));const _0xfc0ff7=_0x943002?_0x49d988(0x185)+_0xa86a4+_0x49d988(0x1d2):_0x49d988(0x10e)+_0xa86a4+_0x49d988(0x1d2);if(!_0x48352c[_0x49d988(0x128)]){const _0x126ccb=await confirmKey(_0xfc0ff7);if(!_0x126ccb)return console[_0x49d988(0x19a)]('Aborted.'),0x1;}const _0x1dbb58=_0x943002?_0x49d988(0x1d6):_0x49d988(0x1a1);await withSpinner(_0x1dbb58+_0x49d988(0x1ee)+_0xa86a4+'\x27...',()=>_0x53ff2d['apply'](),{'verbose':_0x48352c[_0x49d988(0x19b)]});const _0x22da84=_0x943002?_0x49d988(0x19e):_0x49d988(0x1fc);console[_0x49d988(0x19a)]('✔\x20'+_0x22da84+_0x49d988(0x1ee)+_0xa86a4+'\x27');}else console[_0x49d988(0x19a)](_0x49d988(0x1ce)+_0xa86a4+'\x27\x20is\x20up\x20to\x20date');}const _0x2bd563=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x1e4821+_0x49d988(0x190),()=>_0x1112a1[_0x49d988(0xf9)][_0x49d988(0x19c)](_0x1e4821),{'verbose':_0x48352c[_0x49d988(0x19b)]}),_0x347fbe=_0x2bd563[_0x49d988(0x19f)],_0x872e8f=getConsoleUrl(_0x48352c['site'],_0x49d988(0x20b)+_0x347fbe[_0x49d988(0x1b9)]+'/sessions/'+_0x347fbe['workflowSessionId']+_0x49d988(0x1f8)+_0x347fbe['workflowAttemptId']);return console[_0x49d988(0x19a)]('\x0a✔\x20Workflow\x20started'),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911[_0x49d988(0x159)](_0x49d988(0x1df))+'\x20'+_0x347fbe[_0x49d988(0x164)]),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911[_0x49d988(0x159)](_0x49d988(0x13a))+'\x20'+_0x347fbe['status']),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911[_0x49d988(0x159)]('Session:')+'\x20'+_0x347fbe[_0x49d988(0xe5)]),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911['dim'](_0x49d988(0x1ed))+'\x20'+_0x347fbe[_0x49d988(0x12c)]),console[_0x49d988(0x19a)]('\x20\x20'+_0x872e8f),console[_0x49d988(0x19a)]('\x0a'+a28_0x414911[_0x49d988(0x159)]('To\x20cancel:')+_0x49d988(0x122)+_0x347fbe['workflowAttemptId']+_0x49d988(0x1c5)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x147);[a28_0x13db83(0x204)]=a28_0x13db83(0x1e4);async[a28_0x13db83(0x207)](_0x165021){const _0x1f6e79=a28_0x13db83,{options:_0x17c649,args:_0x13eaf,tdx:_0x14a8a2}=_0x165021,_0x325c0e=_0x13eaf[0x0]||_0x17c649[_0x1f6e79(0xf2)];if(!_0x325c0e)return showParentSegmentNotSetError(_0x1f6e79(0x194)+_0x1f6e79(0x10f)),0x1;_0x17c649[_0x1f6e79(0x19b)]&&(console[_0x1f6e79(0x19a)](_0x1f6e79(0x135)+_0x17c649[_0x1f6e79(0x15c)]),console[_0x1f6e79(0x19a)](_0x1f6e79(0x1bd)+_0x325c0e));const _0x17e59b=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x325c0e+'\x27...',()=>_0x14a8a2[_0x1f6e79(0xf9)]['listFields'](_0x325c0e),{'verbose':_0x17c649['verbose']}),_0x1ab61f=_0x17e59b[_0x1f6e79(0x19f)];console[_0x1f6e79(0x19a)](_0x1f6e79(0x1f7)+_0x1ab61f['length']+_0x1f6e79(0xf1)+(_0x1ab61f[_0x1f6e79(0x1d0)]!==0x1?'s':''));if(_0x17c649[_0x1f6e79(0x206)]||_0x17c649[_0x1f6e79(0x1e8)])return await handleSDKOutput(_0x1ab61f,_0x17c649),0x0;return displayFieldsHumanReadable(_0x1ab61f,_0x325c0e),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x154);['description']=a28_0x13db83(0x1bb);async[a28_0x13db83(0x207)](_0x3e6bfc){const _0x3e4587=a28_0x13db83,{options:_0x22fe7e,args:_0x4ce655,tdx:_0x1860fd}=_0x3e6bfc,_0x3340e6=_0x22fe7e,_0xa231be=_0x4ce655[0x0]||_0x22fe7e[_0x3e4587(0xf2)];if(!_0xa231be)return showParentSegmentNotSetError(_0x3e4587(0xec)+_0x3e4587(0x12f)+'Options:\x0a'+_0x3e4587(0x13b)),0x1;_0x22fe7e[_0x3e4587(0x19b)]&&(console[_0x3e4587(0x19a)](_0x3e4587(0x135)+_0x22fe7e['site']),console['error'](_0x3e4587(0x1bd)+_0xa231be));const _0x646d58=await withSpinner(_0x3e4587(0x199)+_0xa231be+_0x3e4587(0x190),()=>_0x1860fd[_0x3e4587(0xf9)]['getParentFull'](_0xa231be),{'verbose':_0x22fe7e[_0x3e4587(0x19b)]}),_0x2bfc3=_0x646d58[_0x3e4587(0x19f)];if(_0x3340e6[_0x3e4587(0x107)]){const _0x210217=getConsoleNextUrl(_0x3340e6[_0x3e4587(0x15c)],_0x3e4587(0x108)+_0x2bfc3['id']);return console[_0x3e4587(0x19a)](a28_0x414911[_0x3e4587(0x113)]('✔')+_0x3e4587(0x149)+a28_0x414911['cyan'](_0x210217)),openBrowser(_0x210217),0x0;}return await handleSingleObjectOutput(_0x2bfc3,_0x22fe7e),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a28_0x13db83(0x175);['description']=a28_0x13db83(0x1fe);async[a28_0x13db83(0x207)](_0xef393e){const _0x326647=a28_0x13db83,{options:_0x2be302,args:_0x47c9a8,tdx:_0xedcb7}=_0xef393e,_0x36e029=_0x47c9a8[0x0]||_0x2be302['parentSegment'];if(!_0x36e029)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0x326647(0x161)),0x1;_0x2be302[_0x326647(0x19b)]&&(console[_0x326647(0x19a)](_0x326647(0x135)+_0x2be302[_0x326647(0x15c)]),console[_0x326647(0x19a)](_0x326647(0x1bd)+_0x36e029));const _0x4f3476=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x36e029+_0x326647(0x190),()=>_0xedcb7[_0x326647(0xf9)][_0x326647(0x10d)](_0x36e029),{'verbose':_0x2be302[_0x326647(0x19b)]}),_0x361ffc=_0x4f3476['data'],_0x2493fb=await withSpinner(_0x326647(0x11d)+_0x36e029+_0x326647(0x190),()=>_0xedcb7[_0x326647(0xf9)][_0x326647(0x148)](_0x361ffc),{'verbose':_0x2be302['verbose']}),_0x4c4fd7=await executeSchemaQuery(_0x2493fb[_0x326647(0x19f)],_0xedcb7,_0x2be302);return await handleQueryOutput(_0x4c4fd7,_0x2be302),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x1da);[a28_0x13db83(0x204)]=a28_0x13db83(0x14f);async[a28_0x13db83(0x207)](_0x307296){const _0x27e934=a28_0x13db83,{options:_0x2b2f9f,args:_0x27b006,tdx:_0x2c5214}=_0x307296,_0x2e78e0=_0x27b006[0x0]||_0x2b2f9f[_0x27e934(0xf2)];if(!_0x2e78e0)return showParentSegmentNotSetError(_0x27e934(0x1d9)+_0x27e934(0x1cd)),0x1;_0x2b2f9f[_0x27e934(0x19b)]&&(console['error'](_0x27e934(0x135)+_0x2b2f9f[_0x27e934(0x15c)]),console['error']('Parent\x20segment:\x20'+_0x2e78e0));const _0x4fb766=await withSpinner(_0x27e934(0x1b4)+_0x2e78e0+'\x27...',()=>_0x2c5214['segment'][_0x27e934(0x10d)](_0x2e78e0),{'verbose':_0x2b2f9f[_0x27e934(0x19b)]}),_0x431498=_0x4fb766[_0x27e934(0x19f)],_0x165bea=await withSpinner(_0x27e934(0x11d)+_0x2e78e0+_0x27e934(0x190),()=>_0x2c5214['segment'][_0x27e934(0x148)](_0x431498),{'verbose':_0x2b2f9f[_0x27e934(0x19b)]}),_0x3c6940=_0x165bea[_0x27e934(0x19f)];return _0x2b2f9f[_0x27e934(0x208)]==='json'||_0x2b2f9f[_0x27e934(0x208)]===_0x27e934(0x1e8)?await handleSDKOutput([{'sql':_0x3c6940}],_0x2b2f9f):console[_0x27e934(0x188)](_0x3c6940),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']='segment:parent:show';[a28_0x13db83(0x204)]=a28_0x13db83(0xed);async[a28_0x13db83(0x207)](_0x4dd052){const _0x1fa4c0=a28_0x13db83,{options:_0x3ac7f5,args:_0x195e50,tdx:_0x16fcea}=_0x4dd052,_0x13317b=_0x195e50[0x0]||_0x3ac7f5[_0x1fa4c0(0xf2)];if(!_0x13317b)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'+_0x1fa4c0(0x121)),0x1;_0x3ac7f5[_0x1fa4c0(0x19b)]&&(console[_0x1fa4c0(0x19a)](_0x1fa4c0(0x135)+_0x3ac7f5[_0x1fa4c0(0x15c)]),console[_0x1fa4c0(0x19a)]('Parent\x20segment:\x20'+_0x13317b));const _0x183419=await withSpinner(_0x1fa4c0(0x1b4)+_0x13317b+_0x1fa4c0(0x190),()=>_0x16fcea[_0x1fa4c0(0xf9)][_0x1fa4c0(0x10d)](_0x13317b),{'verbose':_0x3ac7f5[_0x1fa4c0(0x19b)]}),_0x19fd75=_0x183419['data'],_0x1231cb=await withSpinner(_0x1fa4c0(0x11d)+_0x13317b+'\x27...',()=>_0x16fcea[_0x1fa4c0(0xf9)]['getParentSQL'](_0x19fd75),{'verbose':_0x3ac7f5[_0x1fa4c0(0x19b)]});let _0x363d82=_0x1231cb[_0x1fa4c0(0x19f)];const _0x1ac437=resolveLimit(_0x3ac7f5[_0x1fa4c0(0x18b)],DEFAULT_DISPLAY_LIMIT),_0x28f5ce=/\bLIMIT\s+\d+/i[_0x1fa4c0(0x1ca)](_0x363d82);!_0x28f5ce&&(_0x363d82=_0x363d82[_0x1fa4c0(0x1ec)]()[_0x1fa4c0(0x101)](/;+$/,''),_0x363d82=_0x1fa4c0(0x117)+_0x363d82+_0x1fa4c0(0xe4)+_0x1ac437);_0x3ac7f5['verbose']&&console[_0x1fa4c0(0x19a)](_0x1fa4c0(0xf4)+_0x363d82);const _0x5e1b34=await withQuerySpinner(_0x1fa4c0(0x1ff),async _0x12cdb1=>{const _0x2acb23=_0x1fa4c0,_0x5355f2=await _0x16fcea['query']['execute'](_0x363d82,{'catalog':'td','schema':_0x2acb23(0x11a),'onJobId':_0x1fb913=>{const _0x16352e=_0x2acb23;_0x12cdb1[_0x16352e(0x109)](_0x1fb913);}});return _0x5355f2;},{'verbose':_0x3ac7f5[_0x1fa4c0(0x19b)]}),_0x18fd4d=_0x5e1b34['data'],_0xb94925=_0x18fd4d['jobId']?_0x1fa4c0(0x150)+_0x18fd4d[_0x1fa4c0(0x11c)]+']':'';return console['error'](_0x1fa4c0(0xe6)+_0x18fd4d['stats'][_0x1fa4c0(0x1de)][_0x1fa4c0(0x1d4)]()+'\x20rows\x20'+(_0x1fa4c0(0x168)+formatElapsed(_0x18fd4d[_0x1fa4c0(0x1b2)][_0x1fa4c0(0x14b)])+_0xb94925)),await handleQueryOutput(_0x18fd4d,_0x3ac7f5),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x21d364=a29_0xcde7;function a29_0xcde7(_0x5e2da6,_0x328fd0){_0x5e2da6=_0x5e2da6-0x1b9;const _0xee5dee=a29_0xee5d();let _0xcde70e=_0xee5dee[_0x5e2da6];return _0xcde70e;}(function(_0x570aad,_0x152d7c){const _0x3e850f=a29_0xcde7,_0x5dcfe8=_0x570aad();while(!![]){try{const _0x127b8c=-parseInt(_0x3e850f(0x1ca))/0x1+-parseInt(_0x3e850f(0x1ba))/0x2+parseInt(_0x3e850f(0x1c4))/0x3*(-parseInt(_0x3e850f(0x1cc))/0x4)+parseInt(_0x3e850f(0x1c1))/0x5*(-parseInt(_0x3e850f(0x1ce))/0x6)+parseInt(_0x3e850f(0x1c0))/0x7+-parseInt(_0x3e850f(0x1c5))/0x8*(-parseInt(_0x3e850f(0x1c7))/0x9)+parseInt(_0x3e850f(0x1bb))/0xa;if(_0x127b8c===_0x152d7c)break;else _0x5dcfe8['push'](_0x5dcfe8['shift']());}catch(_0x1ff703){_0x5dcfe8['push'](_0x5dcfe8['shift']());}}}(a29_0xee5d,0xa0251));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a29_0xee5d(){const _0x2ce4f3=['13272JbgAXC','config','5751aLsQgV','log','\x20\x20Global:\x20~/.config/tdx/tdx.json','906231sfwMlD','List\x20all\x20available\x20profiles','1648044IQarHg','name','1011864sRrJdE','map','description','322424rDGurG','12993710VulgHf','scope','profiles','error','execute','4334085bqEhMF','25jvqVyU','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','Error:\x20','3WdIHEI'];a29_0xee5d=function(){return _0x2ce4f3;};return a29_0xee5d();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a29_0x21d364(0x1cd)]=a29_0x21d364(0x1bd);['description']=a29_0x21d364(0x1cb);async[a29_0x21d364(0x1bf)](_0x5cb119){const _0x505b0d=a29_0x21d364,{options:_0x4396ec}=_0x5cb119;try{const _0x323bc1=listProfiles(),_0x5b91de=getActiveProfile();if(_0x323bc1['length']===0x0)return console[_0x505b0d(0x1c8)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console['log'](_0x505b0d(0x1c2)),console[_0x505b0d(0x1c8)](_0x505b0d(0x1c9)),0x0;const _0x28fa5f=_0x323bc1[_0x505b0d(0x1cf)](_0x15a4c5=>{const _0x1e6cbb=_0x505b0d,_0xc6618f=_0x15a4c5[_0x1e6cbb(0x1cd)]===_0x5b91de,_0x1e291a=getProfileParams(_0x15a4c5['config']);return{'name':_0x15a4c5[_0x1e6cbb(0x1cd)],'active':_0xc6618f,'scope':_0x15a4c5[_0x1e6cbb(0x1bc)],'description':_0x15a4c5[_0x1e6cbb(0x1c6)][_0x1e6cbb(0x1b9)]||'','params':_0x1e291a};});return await handleSDKOutput(_0x28fa5f,_0x4396ec),0x0;}catch(_0x1e2a78){return _0x1e2a78 instanceof Error&&console[_0x505b0d(0x1be)](_0x505b0d(0x1c3)+_0x1e2a78['message']),0x1;}}}
|