@treasuredata/tdx 0.4.6 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/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.d.ts +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts +23 -0
- package/dist/commands/claude-statusline-command.d.ts.map +1 -0
- package/dist/commands/claude-statusline-command.js +1 -0
- package/dist/commands/claude-statusline-command.js.map +1 -0
- package/dist/commands/claude-usage-command.d.ts +22 -0
- package/dist/commands/claude-usage-command.d.ts.map +1 -0
- package/dist/commands/claude-usage-command.js +1 -0
- package/dist/commands/claude-usage-command.js.map +1 -0
- package/dist/commands/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/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-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +10 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/claude-usage-tracker.d.ts +124 -0
- package/dist/utils/claude-usage-tracker.d.ts.map +1 -0
- package/dist/utils/claude-usage-tracker.js +1 -0
- package/dist/utils/claude-usage-tracker.js.map +1 -0
- 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/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.d.ts +52 -0
- package/dist/utils/model-factors.d.ts.map +1 -0
- package/dist/utils/model-factors.js +1 -0
- package/dist/utils/model-factors.js.map +1 -0
- 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-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x1ccf27=a20_0x34b6;(function(_0x47c5da,_0x3feecd){const _0x195612=a20_0x34b6,_0x205be6=_0x47c5da();while(!![]){try{const _0x5c5740=-parseInt(_0x195612(0x181))/0x1+parseInt(_0x195612(0x149))/0x2*(-parseInt(_0x195612(0x153))/0x3)+-parseInt(_0x195612(0x1bd))/0x4*(parseInt(_0x195612(0x1c8))/0x5)+-parseInt(_0x195612(0x174))/0x6+-parseInt(_0x195612(0x144))/0x7*(parseInt(_0x195612(0x185))/0x8)+-parseInt(_0x195612(0x14f))/0x9*(parseInt(_0x195612(0x1b3))/0xa)+parseInt(_0x195612(0x151))/0xb;if(_0x5c5740===_0x3feecd)break;else _0x205be6['push'](_0x205be6['shift']());}catch(_0x44402f){_0x205be6['push'](_0x205be6['shift']());}}}(a20_0x5634,0xa82b4));import{BaseCommand}from'./command.js';function a20_0x5634(){const _0x5694e9=['Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','bold','projectId','584444ZpuvGZ','backupProject','verbose','models','createProject','name','llm:projects','prompts','(no\x20message)','red','counts','40fpVmhz','projects','\x20bytes)','Create\x20a\x20new\x20LLM\x20project','agent','[content]','\x20->\x20Agent:','map','Agent\x20created:\x20','[unknown]','Backup\x20cancelled.','Resolving\x20project\x20\x27','\x20->\x20KB:','string','join','targetImageGenerator','Invalid\x20path\x20syntax:\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x20->\x20ImageGen:','Setting\x20project\x20context\x20to\x20\x27','llm:agent:update','INVALID_ARGUMENT','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','llm','chats','execute','llm:agent:delete','No\x20messages\x20found\x20in\x20chat\x20history.','output','image','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','attributes','description','yellow','agents','\x20\x20Knowledge\x20Bases:\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','targetKnowledgeBase','filter','Getting\x20default\x20project...','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Project\x20created:\x20','Output\x20directory\x20\x27','Project\x20restored:\x20','Resolving\x20agent\x20\x27','firstInputContent','toLowerCase','\x20\x20Cause:\x20','14vbMNyD','length','llm:models','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','jsonl','566uAikzw','\x20\x20Prompts:\x20','createdAt','targetWebSearchTool','history','restoreProject','286866mpiAte','Agent\x20updated:\x20','60303144ZVGpaF','targetAgent','6522wBgEiW','\x27...','List\x20all\x20LLM\x20projects','magenta','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Restoring\x20project\x20from\x20\x27','deleteProject','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','temperature','llm:history','updatedAt','Fetching\x20chat\x20sessions...','content','.llm','No\x20chat\x20sessions\x20found.','Fetching\x20agents...','message','getOrCreateDefaultProject','yes','outputDir','exportedFrom','split','updateAgent','Error:\x20Agent\x20name\x20is\x20required','Update\x20an\x20existing\x20agent','Fetching\x20most\x20recent\x20chat...','llm:project:restore','blue','Deleting\x20project\x20\x27','Usage:\x20tdx\x20llm\x20use\x20<project-name>','7189650pMKPwH','dryRun','\x0aStack\x20trace:','tool_call','cause','llm:project:delete','llm:project:create','tool','\x20\x20Agents:\x20','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','\x20→\x20chat:\x20','\x20\x20Integrations:\x20','List\x20agents\x20in\x20current\x20project','142997DyvAHd','Restore\x20cancelled.','maxToolIterations','Delete\x20an\x20agent','2464160TqsBAt','format','\x20->\x20WebSearch:','entries','createAgent','Error:\x20Project\x20name\x20is\x20required','[input]\x20\x20','Project\x20backed\x20up\x20to:\x20','projectName','sourceSite','cyan','List\x20available\x20LLM\x20models','llm:agent:show','stack','log','Checking\x20for\x20existing\x20projects...','table','resolveAgentId','systemPrompt','Show\x20agent\x20details','last','slice','data','error','model','prompt','llm:agents','includes','Set\x20current\x20project\x20context','setCurrentProject','green','Delete\x20an\x20LLM\x20project','llmProject','json','getBackupMetadata','dim','[tool]\x20\x20\x20','rmSync','LLM_PROJECT_NOT_FOUND','limit','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','stringify','\x27\x20already\x20exists.\x20Overwrite?','integrations','Agent\x20deleted:\x20','[output]\x20','330GTQrGN','resolveProjectId','find','[error]\x20\x20','Create\x20a\x20new\x20agent\x20in\x20current\x20project','knowledgeBases','input'];a20_0x5634=function(){return _0x5694e9;};return a20_0x5634();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}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 a20_0x452631 from'node:fs';function handleSDKError(_0x3fb835,_0x57d375){const _0x20bfd4=a20_0x34b6;if(_0x3fb835 instanceof SDKError)console['error']('Error:\x20'+_0x3fb835[_0x20bfd4(0x166)]),_0x57d375[_0x20bfd4(0x1bf)]&&(_0x3fb835['cause']&&console[_0x20bfd4(0x19c)](_0x20bfd4(0x143)+_0x3fb835[_0x20bfd4(0x178)]),_0x3fb835['stack']&&(console[_0x20bfd4(0x19c)](_0x20bfd4(0x176)),console[_0x20bfd4(0x19c)](_0x3fb835[_0x20bfd4(0x192)])));else throw _0x3fb835;}function formatChatHistoryEntry(_0x5bd79b,_0x2646cb){const _0x8946cf=a20_0x34b6,_0x530412=getChalk(_0x2646cb),_0x1792d4=_0x530412['dim'](_0x5bd79b['at']);if('input'in _0x5bd79b){const _0x4178f1=_0x530412[_0x8946cf(0x18f)](_0x8946cf(0x18b));return _0x1792d4+'\x20'+_0x4178f1+':\x20'+_0x5bd79b[_0x8946cf(0x1b9)];}if(_0x8946cf(0x162)in _0x5bd79b){const _0x51b8a7=_0x530412[_0x8946cf(0x1a3)](_0x8946cf(0x1cd));return _0x1792d4+'\x20'+_0x51b8a7+':\x20'+_0x5bd79b[_0x8946cf(0x162)];}if(_0x8946cf(0x177)in _0x5bd79b){const _0x4b2577=_0x530412[_0x8946cf(0x135)]('[tool_call]'),{functionName:_0x426ed3,functionArguments:_0x80f218,targetFunction:_0x59a338}=_0x5bd79b[_0x8946cf(0x177)];let _0x383d39=_0x1792d4+'\x20'+_0x4b2577+':\x20'+_0x530412[_0x8946cf(0x1bb)](_0x426ed3);if(_0x80f218&&Object['keys'](_0x80f218)['length']>0x0){const _0x34644c=Object[_0x8946cf(0x188)](_0x80f218)[_0x8946cf(0x1cf)](([_0x1f09ca,_0x32b631])=>_0x1f09ca+'='+JSON[_0x8946cf(0x1ae)](_0x32b631))[_0x8946cf(0x1d6)](',\x20');_0x383d39+='('+_0x34644c+')';}_0x59a338&&(_0x383d39+=_0x530412[_0x8946cf(0x1a8)]('\x20['+_0x59a338+']'));let _0x507c88='';if(_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x139)])_0x507c88=_0x8946cf(0x1d4)+_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x139)][_0x8946cf(0x1c2)];else{if(_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x152)])_0x507c88=_0x8946cf(0x1ce)+_0x5bd79b['tool_call']['targetAgent'][_0x8946cf(0x1c2)];else{if(_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x14c)])_0x507c88=_0x8946cf(0x187)+_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x14c)][_0x8946cf(0x1c2)];else _0x5bd79b['tool_call'][_0x8946cf(0x122)]&&(_0x507c88=_0x8946cf(0x125)+_0x5bd79b[_0x8946cf(0x177)]['targetImageGenerator'][_0x8946cf(0x1c2)]);}}return _0x383d39+_0x507c88;}if(_0x8946cf(0x17b)in _0x5bd79b){const _0x4a2de7=_0x530412[_0x8946cf(0x156)](_0x8946cf(0x1a9)),{functionName:_0x3733ea,functionArguments:_0x2f0b44,content:_0x1e127a,newChat:_0x32fd33}=_0x5bd79b['tool'];let _0x1173bb=_0x1792d4+'\x20'+_0x4a2de7+':\x20'+_0x530412[_0x8946cf(0x1bb)](_0x3733ea);if(_0x2f0b44){const _0x4a85fc=typeof _0x2f0b44===_0x8946cf(0x1d5)?_0x2f0b44:JSON[_0x8946cf(0x1ae)](_0x2f0b44);_0x1173bb+='('+_0x4a85fc+')';}return _0x1e127a&&(_0x1173bb+='\x0a'+_0x530412[_0x8946cf(0x1a8)](_0x1e127a)),_0x32fd33&&(_0x1173bb+=_0x530412[_0x8946cf(0x1a8)](_0x8946cf(0x17e)+_0x32fd33['id'])),_0x1173bb;}if('output'in _0x5bd79b){const _0x1497b9=_0x530412[_0x8946cf(0x171)](_0x8946cf(0x1b2));return _0x1792d4+'\x20'+_0x1497b9+':\x20'+_0x5bd79b[_0x8946cf(0x130)][_0x8946cf(0x1c2)]+'\x20('+_0x5bd79b[_0x8946cf(0x130)][_0x8946cf(0x162)][_0x8946cf(0x145)]+_0x8946cf(0x1ca);}if('image'in _0x5bd79b){const _0x50fe17=_0x530412[_0x8946cf(0x171)]('[image]\x20\x20'),{width:_0x4fd53f,height:_0x5b43eb,headerText:_0xb9d25c}=_0x5bd79b[_0x8946cf(0x131)],_0x38b093=_0xb9d25c?'\x20-\x20'+_0xb9d25c:'';return _0x1792d4+'\x20'+_0x50fe17+':\x20'+_0x4fd53f+'x'+_0x5b43eb+_0x38b093;}if(_0x8946cf(0x19c)in _0x5bd79b){const _0x1bff5c=_0x530412[_0x8946cf(0x1c6)](_0x8946cf(0x1b6));return _0x1792d4+'\x20'+_0x1bff5c+':\x20'+_0x5bd79b[_0x8946cf(0x19c)];}return _0x1792d4+'\x20'+_0x530412[_0x8946cf(0x1a8)](_0x8946cf(0x1d1))+':\x20'+JSON[_0x8946cf(0x1ae)](_0x5bd79b);}async function getProjectIdOrDefault(_0x8fac1f){const _0x129fa1=a20_0x34b6,{tdx:_0x47f1a2,options:_0x309f2e}=_0x8fac1f,_0x5a1545=_0x309f2e[_0x129fa1(0x1a5)];if(_0x5a1545){const _0x16db85=await withSpinner('Resolving\x20project\x20\x27'+_0x5a1545+_0x129fa1(0x154),()=>_0x47f1a2[_0x129fa1(0x12b)][_0x129fa1(0x1b4)](_0x5a1545),{'verbose':_0x309f2e[_0x129fa1(0x1bf)]});return _0x16db85[_0x129fa1(0x19b)];}let _0x3ec0e6=_0x47f1a2[_0x129fa1(0x12b)]['getCurrentProject']();if(_0x3ec0e6)return _0x3ec0e6;const _0x285aee=await withSpinner(_0x129fa1(0x13b),()=>_0x47f1a2[_0x129fa1(0x12b)][_0x129fa1(0x167)](),{'verbose':_0x309f2e[_0x129fa1(0x1bf)]});return _0x285aee[_0x129fa1(0x19b)]['id'];}function toLLMProjectInfo(_0x24188a){const _0x13a693=a20_0x34b6;return{'name':_0x24188a[_0x13a693(0x133)][_0x13a693(0x1c2)],'description':_0x24188a['attributes'][_0x13a693(0x134)],'createdAt':_0x24188a[_0x13a693(0x133)]['createdAt'],'updatedAt':_0x24188a[_0x13a693(0x133)][_0x13a693(0x160)]};}function toAgentInfo(_0x464fbe){const _0x45c4dd=a20_0x34b6;return{'name':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x1c2)],'description':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x134)],'prompt':truncatePrompt(_0x464fbe['attributes']['prompt']),'createdAt':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x14b)],'updatedAt':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x160)]};}function truncatePrompt(_0x129d1d){const _0x2a839a=a20_0x34b6;if(!_0x129d1d)return undefined;const _0x44a1bc=0x64;if(_0x129d1d[_0x2a839a(0x145)]<=_0x44a1bc)return _0x129d1d;return _0x129d1d[_0x2a839a(0x19a)](0x0,_0x44a1bc)+'...';}export class LLMModelsCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x146);['description']=a20_0x1ccf27(0x190);async['execute'](_0x3bca01){const _0x5450e5=a20_0x1ccf27,{options:_0x19472b,tdx:_0x465a93}=_0x3bca01;try{const _0x2d1e56=await withSpinner('Fetching\x20available\x20models...',()=>_0x465a93['llm'][_0x5450e5(0x1c0)](),{'verbose':_0x19472b[_0x5450e5(0x1bf)]});return await handleSDKOutput(_0x2d1e56['data'],_0x19472b),0x0;}catch(_0x366b14){return handleSDKError(_0x366b14,_0x19472b),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x1c3);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x155);async[a20_0x1ccf27(0x12d)](_0x59ec84){const _0x2c9bec=a20_0x1ccf27,{options:_0x539edc,args:_0xbcef51,tdx:_0x236182}=_0x59ec84;try{const _0x5cc678=_0xbcef51[0x0],_0x208c01=resolveLimit(_0x539edc[_0x2c9bec(0x1ac)],DEFAULT_LLM_LIMIT),_0x559887=await withSpinner('Fetching\x20projects...',()=>_0x236182[_0x2c9bec(0x12b)][_0x2c9bec(0x1c9)](_0x208c01),{'verbose':_0x539edc[_0x2c9bec(0x1bf)]});let _0x4e285b=_0x559887[_0x2c9bec(0x19b)];_0x5cc678&&(_0x4e285b=_0x559887[_0x2c9bec(0x19b)][_0x2c9bec(0x13a)](_0x57680d=>matchGlobPattern(_0x57680d[_0x2c9bec(0x133)][_0x2c9bec(0x1c2)],_0x5cc678)));const _0x5d3709=_0x4e285b[_0x2c9bec(0x1cf)](toLLMProjectInfo);return await handleSDKOutput(_0x5d3709,_0x539edc),0x0;}catch(_0x18a5ba){return handleSDKError(_0x18a5ba,_0x539edc),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x19f);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x180);async[a20_0x1ccf27(0x12d)](_0x17a1d5){const _0x336d3a=a20_0x1ccf27,{options:_0x355ec7,args:_0x27b44c,tdx:_0x34fa34}=_0x17a1d5;try{const _0x3ce8c5=_0x27b44c[0x0];let _0x29dfd1,_0x4d4090=_0x3ce8c5;if(_0x3ce8c5&&_0x3ce8c5[_0x336d3a(0x1a0)]('/')){const _0x4ecfff=_0x3ce8c5[_0x336d3a(0x16b)]('/');if(_0x4ecfff['length']===0x2){const [_0xa31976,_0x52f128]=_0x4ecfff,_0x37d624=await _0x34fa34[_0x336d3a(0x12b)][_0x336d3a(0x1c9)](),_0x34badb=_0x37d624[_0x336d3a(0x1b5)](_0x1e456e=>_0x1e456e[_0x336d3a(0x133)][_0x336d3a(0x1c2)][_0x336d3a(0x142)]()===_0xa31976[_0x336d3a(0x142)]());if(!_0x34badb)throw new SDKError(ErrorCode[_0x336d3a(0x1ab)],'Project\x20not\x20found:\x20'+_0xa31976,undefined,{'helpText':_0x336d3a(0x138)});_0x29dfd1=_0x34badb['id'],_0x4d4090=_0x52f128;}else throw new SDKError(ErrorCode[_0x336d3a(0x128)],_0x336d3a(0x123)+_0x3ce8c5,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x29dfd1=await getProjectIdOrDefault(_0x17a1d5);const _0x350fbe=await withSpinner(_0x336d3a(0x165),()=>_0x34fa34[_0x336d3a(0x12b)]['agents'](_0x29dfd1),{'verbose':_0x355ec7[_0x336d3a(0x1bf)]});let _0x515a0a=_0x350fbe[_0x336d3a(0x19b)];_0x4d4090&&(_0x515a0a=_0x350fbe[_0x336d3a(0x19b)][_0x336d3a(0x13a)](_0x5329b3=>matchGlobPattern(_0x5329b3[_0x336d3a(0x133)][_0x336d3a(0x1c2)],_0x4d4090)));const _0x4b341e=_0x515a0a[_0x336d3a(0x1cf)](toAgentInfo);return await handleSDKOutput(_0x4b341e,_0x355ec7),0x0;}catch(_0x340da4){return handleSDKError(_0x340da4,_0x355ec7),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a20_0x1ccf27(0x191);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x198);async[a20_0x1ccf27(0x12d)](_0x344c0b){const _0xa0338e=a20_0x1ccf27,{options:_0x701436,args:_0x27cd73,tdx:_0x241089}=_0x344c0b;if(_0x27cd73['length']===0x0)return console[_0xa0338e(0x19c)](_0xa0338e(0x16d)),console[_0xa0338e(0x19c)](_0xa0338e(0x124)),0x1;const _0x2dff8d=_0x27cd73[0x0];try{const _0x3678c7=await getProjectIdOrDefault(_0x344c0b),_0x3b8b01=await withSpinner(_0xa0338e(0x140)+_0x2dff8d+_0xa0338e(0x154),()=>_0x241089[_0xa0338e(0x12b)][_0xa0338e(0x196)](_0x2dff8d,_0x3678c7),{'verbose':_0x701436[_0xa0338e(0x1bf)]}),_0x582ac1=await withSpinner('Fetching\x20agent...',()=>_0x241089[_0xa0338e(0x12b)][_0xa0338e(0x1cc)](_0x3b8b01[_0xa0338e(0x19b)]),{'verbose':_0x701436[_0xa0338e(0x1bf)]});return await handleSDKOutput([_0x582ac1[_0xa0338e(0x19b)]],_0x701436),0x0;}catch(_0x5bce6b){return handleSDKError(_0x5bce6b,_0x701436),0x1;}}}function a20_0x34b6(_0x31ce83,_0x2eaeec){const _0x5634fb=a20_0x5634();return a20_0x34b6=function(_0x34b68f,_0x3e3e2b){_0x34b68f=_0x34b68f-0x122;let _0xe0de48=_0x5634fb[_0x34b68f];return _0xe0de48;},a20_0x34b6(_0x31ce83,_0x2eaeec);}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]='llm:agent:create';[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x1b7);async[a20_0x1ccf27(0x12d)](_0x2c3b03){const _0x3b52cf=a20_0x1ccf27,{options:_0x1d55af,args:_0x18f252,tdx:_0xc5f11b}=_0x2c3b03;if(_0x18f252[_0x3b52cf(0x145)]===0x0)return console['error'](_0x3b52cf(0x16d)),console[_0x3b52cf(0x19c)](_0x3b52cf(0x1ba)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x39c097=_0x18f252[0x0],_0x27c2c1=_0x1d55af,_0x3b9f6b=_0x27c2c1[_0x3b52cf(0x197)],_0x329fac=_0x27c2c1[_0x3b52cf(0x19d)]||'claude-4.5-haiku',_0x3e328f=_0x27c2c1['starterMessage'],_0x1169d0=_0x27c2c1[_0x3b52cf(0x183)]?Number(_0x27c2c1['maxToolIterations']):undefined,_0xf1ea2b=_0x27c2c1[_0x3b52cf(0x15e)]?Number(_0x27c2c1['temperature']):undefined;try{let _0x525c78,_0x679563;if(_0x39c097[_0x3b52cf(0x1a0)]('/')){const _0x4a2df0=_0x39c097[_0x3b52cf(0x16b)]('/');if(_0x4a2df0['length']===0x2){const [_0x25aa92,_0x3c6ff3]=_0x4a2df0,_0x1c3014=await withSpinner(_0x3b52cf(0x1d3)+_0x25aa92+_0x3b52cf(0x154),()=>_0xc5f11b[_0x3b52cf(0x12b)]['resolveProjectId'](_0x25aa92),{'verbose':_0x1d55af[_0x3b52cf(0x1bf)]});_0x525c78=_0x1c3014[_0x3b52cf(0x19b)],_0x679563=_0x3c6ff3;}else throw new SDKError(ErrorCode[_0x3b52cf(0x128)],_0x3b52cf(0x123)+_0x39c097,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x525c78=await getProjectIdOrDefault(_0x2c3b03),_0x679563=_0x39c097;const _0x4e734f=await withSpinner('Creating\x20agent\x20\x27'+_0x679563+'\x27...',()=>_0xc5f11b['llm'][_0x3b52cf(0x189)]({'name':_0x679563,'projectId':_0x525c78,'modelType':_0x329fac,'systemPrompt':_0x3b9f6b,'starterMessage':_0x3e328f,'maxToolIterations':_0x1169d0,'temperature':_0xf1ea2b}),{'verbose':_0x1d55af[_0x3b52cf(0x1bf)]});return console[_0x3b52cf(0x193)](_0x3b52cf(0x1d0)+_0x4e734f[_0x3b52cf(0x19b)]['id']),await handleSDKOutput([_0x4e734f['data']],_0x1d55af),0x0;}catch(_0x5a8d80){return handleSDKError(_0x5a8d80,_0x1d55af),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x127);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x16e);async[a20_0x1ccf27(0x12d)](_0x563558){const _0xd0f9e2=a20_0x1ccf27,{options:_0x1515a7,args:_0x135f77,tdx:_0x16ca5e}=_0x563558;if(_0x135f77[_0xd0f9e2(0x145)]===0x0)return console[_0xd0f9e2(0x19c)](_0xd0f9e2(0x16d)),console[_0xd0f9e2(0x19c)](_0xd0f9e2(0x15c)),0x1;const _0x3bdcf1=_0x135f77[0x0],_0x5ab4f9=_0x1515a7,_0x38e463=_0x5ab4f9[_0xd0f9e2(0x1c2)],_0x478076=_0x5ab4f9[_0xd0f9e2(0x19e)],_0x1b3ce5=_0x5ab4f9[_0xd0f9e2(0x134)],_0x3d6cb1=_0x5ab4f9['starterMessage'];if(!_0x38e463&&!_0x478076&&!_0x1b3ce5&&!_0x3d6cb1)return console['error'](_0xd0f9e2(0x129)),console[_0xd0f9e2(0x19c)](_0xd0f9e2(0x158)),0x1;try{const _0x34f4b8=await getProjectIdOrDefault(_0x563558),_0x399066=await withSpinner(_0xd0f9e2(0x140)+_0x3bdcf1+_0xd0f9e2(0x154),()=>_0x16ca5e['llm'][_0xd0f9e2(0x196)](_0x3bdcf1,_0x34f4b8),{'verbose':_0x1515a7[_0xd0f9e2(0x1bf)]}),_0x38246b=_0x399066[_0xd0f9e2(0x19b)],_0x22e2af=await withSpinner('Updating\x20agent...',()=>_0x16ca5e[_0xd0f9e2(0x12b)][_0xd0f9e2(0x16c)](_0x38246b,{'name':_0x38e463,'prompt':_0x478076,'description':_0x1b3ce5,'starterMessage':_0x3d6cb1}),{'verbose':_0x1515a7[_0xd0f9e2(0x1bf)]});return console[_0xd0f9e2(0x193)](_0xd0f9e2(0x150)+_0x22e2af[_0xd0f9e2(0x19b)]['id']),await handleSDKOutput([_0x22e2af['data']],_0x1515a7),0x0;}catch(_0x51c87b){return handleSDKError(_0x51c87b,_0x1515a7),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x12e);['description']=a20_0x1ccf27(0x184);async[a20_0x1ccf27(0x12d)](_0x69fd55){const _0x1a291f=a20_0x1ccf27,{options:_0x2bbb5a,args:_0x3c53ee,tdx:_0x495e56}=_0x69fd55;if(_0x3c53ee[_0x1a291f(0x145)]===0x0)return console[_0x1a291f(0x19c)](_0x1a291f(0x16d)),console[_0x1a291f(0x19c)](_0x1a291f(0x132)),0x1;const _0xd34f70=_0x3c53ee[0x0];try{const _0xbf077f=await getProjectIdOrDefault(_0x69fd55),_0xd1e118=await withSpinner(_0x1a291f(0x140)+_0xd34f70+_0x1a291f(0x154),()=>_0x495e56[_0x1a291f(0x12b)][_0x1a291f(0x196)](_0xd34f70,_0xbf077f),{'verbose':_0x2bbb5a[_0x1a291f(0x1bf)]}),_0x570412=_0xd1e118[_0x1a291f(0x19b)];return await withSpinner('Deleting\x20agent...',()=>_0x495e56['llm']['deleteAgent'](_0x570412),{'verbose':_0x2bbb5a[_0x1a291f(0x1bf)]}),console['log'](_0x1a291f(0x1b1)+_0x570412),0x0;}catch(_0x23bb23){return handleSDKError(_0x23bb23,_0x2bbb5a),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x15f);[a20_0x1ccf27(0x134)]='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async[a20_0x1ccf27(0x12d)](_0x1b6a85){const _0x137c52=a20_0x1ccf27,{options:_0x2665c9,args:_0x37fb52,tdx:_0xa3e8e4}=_0x1b6a85;let _0x471179=_0x37fb52[0x0];const _0x2f167d=_0x2665c9,_0x5bdb10=_0x2f167d[_0x137c52(0x199)];try{if(_0x5bdb10){if(_0x471179)return console[_0x137c52(0x19c)](_0x137c52(0x1ad)),console[_0x137c52(0x19c)]('Usage:\x20tdx\x20llm\x20history\x20--last'),0x1;const _0x169fc5=await withSpinner(_0x137c52(0x16f),()=>_0xa3e8e4[_0x137c52(0x12b)][_0x137c52(0x12c)](0x1),{'verbose':_0x2665c9[_0x137c52(0x1bf)]});if(_0x169fc5[_0x137c52(0x19b)][_0x137c52(0x145)]===0x0)return console[_0x137c52(0x193)](_0x137c52(0x164)),0x0;_0x471179=_0x169fc5['data'][0x0]['id'];}if(!_0x471179){const _0x6fa9dc=resolveLimit(_0x2665c9[_0x137c52(0x1ac)],DEFAULT_LLM_LIMIT),_0xdcdcbe=await withSpinner(_0x137c52(0x161),()=>_0xa3e8e4[_0x137c52(0x12b)][_0x137c52(0x12c)](_0x6fa9dc),{'verbose':_0x2665c9[_0x137c52(0x1bf)]});if(_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x1a6)||_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x148))await handleSDKOutput(_0xdcdcbe[_0x137c52(0x19b)],_0x2665c9);else{const _0x2ad349=_0xdcdcbe[_0x137c52(0x19b)][_0x137c52(0x1cf)](_0xd8993b=>({'created_at':_0xd8993b[_0x137c52(0x133)][_0x137c52(0x14b)],'chat_id':_0xd8993b['id'],'first_input':_0xd8993b[_0x137c52(0x133)][_0x137c52(0x141)]||_0x137c52(0x1c5)}));await handleSDKOutput(_0x2ad349,_0x2665c9);}return 0x0;}else{const _0x28e0c9=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x471179+_0x137c52(0x154),()=>_0xa3e8e4[_0x137c52(0x12b)][_0x137c52(0x14d)](_0x471179),{'verbose':_0x2665c9[_0x137c52(0x1bf)]}),_0x4a356d=_0x28e0c9[_0x137c52(0x19b)][_0x137c52(0x19b)]??[];if(_0x4a356d[_0x137c52(0x145)]===0x0)return console['log'](_0x137c52(0x12f)),0x0;if(_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x1a6)||_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x148)||_0x2665c9['format']===_0x137c52(0x195)||_0x2665c9[_0x137c52(0x186)]==='tsv')await handleSDKOutput(_0x4a356d,_0x2665c9);else for(const _0x367d1e of _0x4a356d){console[_0x137c52(0x193)](formatChatHistoryEntry(_0x367d1e,_0x2665c9));}return 0x0;}}catch(_0x58c46f){return handleSDKError(_0x58c46f,_0x2665c9),0x1;}}}export class LLMUseCommand extends BaseCommand{['name']='llm:use';[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x1a1);async['execute'](_0x13b344){const _0x1910db=a20_0x1ccf27,{options:_0x22ff7f,args:_0x4cdb50,tdx:_0x1fdd54}=_0x13b344;if(_0x4cdb50[_0x1910db(0x145)]===0x0)return console['error'](_0x1910db(0x18a)),console[_0x1910db(0x19c)](_0x1910db(0x173)),0x1;const _0x42a0bb=_0x4cdb50[0x0];try{return await withSpinner(_0x1910db(0x126)+_0x42a0bb+_0x1910db(0x154),()=>_0x1fdd54['llm'][_0x1910db(0x1a2)](_0x42a0bb),{'verbose':_0x22ff7f[_0x1910db(0x1bf)]}),console['log']('Project\x20context\x20set\x20to:\x20'+_0x42a0bb),0x0;}catch(_0x3d72c9){return handleSDKError(_0x3d72c9,_0x22ff7f),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x17a);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x1cb);async[a20_0x1ccf27(0x12d)](_0x5b6bf5){const _0x9a3e89=a20_0x1ccf27,{options:_0x15c06a,args:_0x36038f,tdx:_0x1bbef9}=_0x5b6bf5;if(_0x36038f[_0x9a3e89(0x145)]===0x0)return console[_0x9a3e89(0x19c)](_0x9a3e89(0x18a)),console[_0x9a3e89(0x19c)](_0x9a3e89(0x12a)),0x1;const _0x4a6d73=_0x36038f[0x0],_0x453ff1=_0x15c06a,_0x1c58f5=_0x453ff1[_0x9a3e89(0x134)];try{const _0x5ef045=await withSpinner('Creating\x20project\x20\x27'+_0x4a6d73+_0x9a3e89(0x154),()=>_0x1bbef9[_0x9a3e89(0x12b)][_0x9a3e89(0x1c1)]({'name':_0x4a6d73,'description':_0x1c58f5}),{'verbose':_0x15c06a[_0x9a3e89(0x1bf)]});console['log'](_0x9a3e89(0x13d)+_0x5ef045[_0x9a3e89(0x19b)]['id']);const _0x36aae5=toLLMProjectInfo(_0x5ef045[_0x9a3e89(0x19b)]);return await handleSDKOutput([_0x36aae5],_0x15c06a),0x0;}catch(_0x94edb){return handleSDKError(_0x94edb,_0x15c06a),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x179);['description']=a20_0x1ccf27(0x1a4);async[a20_0x1ccf27(0x12d)](_0x3ca796){const _0x46f1d5=a20_0x1ccf27,{options:_0xd747b5,args:_0x451012,tdx:_0x5df4df}=_0x3ca796;if(_0x451012['length']===0x0)return console[_0x46f1d5(0x19c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x46f1d5(0x19c)](_0x46f1d5(0x17d)),0x1;const _0x4737ae=_0x451012[0x0];try{return await withSpinner(_0x46f1d5(0x172)+_0x4737ae+_0x46f1d5(0x154),()=>_0x5df4df[_0x46f1d5(0x12b)][_0x46f1d5(0x15a)](_0x4737ae),{'verbose':_0xd747b5[_0x46f1d5(0x1bf)]}),console['log']('Project\x20deleted:\x20'+_0x4737ae),0x0;}catch(_0x15c180){return handleSDKError(_0x15c180,_0xd747b5),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]='llm:project:backup';[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x157);async[a20_0x1ccf27(0x12d)](_0x30f27a){const _0x422837=a20_0x1ccf27,{options:_0x311d86,args:_0x58d840,tdx:_0x1e2b0d}=_0x30f27a;if(_0x58d840['length']===0x0)return console[_0x422837(0x19c)](_0x422837(0x18a)),console[_0x422837(0x19c)](_0x422837(0x15d)),0x1;const _0x4131b1=_0x58d840[0x0],_0x130b54=_0x311d86,_0x3aac64=_0x130b54['output'],_0x113b83=_0x130b54[_0x422837(0x175)];try{const _0x2f4188=_0x3aac64||_0x4131b1+_0x422837(0x163);if(a20_0x452631['existsSync'](_0x2f4188)&&!_0x113b83){if(!_0x311d86[_0x422837(0x168)]){const _0x3e4fec=await confirm(_0x422837(0x13e)+_0x2f4188+_0x422837(0x1af));if(!_0x3e4fec)return console[_0x422837(0x193)](_0x422837(0x1d2)),0x0;}a20_0x452631[_0x422837(0x1aa)](_0x2f4188,{'recursive':!![]});}const _0x3b1d31=await withSpinner(_0x113b83?'Analyzing\x20project\x20\x27'+_0x4131b1+_0x422837(0x154):'Backing\x20up\x20project\x20\x27'+_0x4131b1+'\x27...',()=>_0x1e2b0d[_0x422837(0x12b)][_0x422837(0x1be)](_0x4131b1,_0x3aac64,{'dryRun':_0x113b83}),{'verbose':_0x311d86[_0x422837(0x1bf)]}),_0x58bf6b=_0x3b1d31[_0x422837(0x19b)];return _0x113b83?console[_0x422837(0x193)]('[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20'+_0x58bf6b[_0x422837(0x169)]):console[_0x422837(0x193)](_0x422837(0x18c)+_0x58bf6b[_0x422837(0x169)]),console[_0x422837(0x193)](_0x422837(0x17c)+_0x58bf6b['counts'][_0x422837(0x136)]),console[_0x422837(0x193)](_0x422837(0x137)+_0x58bf6b[_0x422837(0x1c7)]['knowledgeBases']),console['log'](_0x422837(0x14a)+_0x58bf6b[_0x422837(0x1c7)][_0x422837(0x1c4)]),console[_0x422837(0x193)](_0x422837(0x17f)+_0x58bf6b[_0x422837(0x1c7)]['integrations']),(_0x311d86[_0x422837(0x186)]===_0x422837(0x1a6)||_0x311d86[_0x422837(0x186)]==='jsonl')&&await handleSDKOutput([_0x58bf6b],_0x311d86),0x0;}catch(_0x1c3d35){return handleSDKError(_0x1c3d35,_0x311d86),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x170);['description']='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder';async['execute'](_0x5c2501){const _0x2cb609=a20_0x1ccf27,{options:_0x195ac8,args:_0x134604,tdx:_0x25a31a}=_0x5c2501;if(_0x134604['length']===0x0)return console[_0x2cb609(0x19c)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x2cb609(0x19c)](_0x2cb609(0x13c)),0x1;const _0x4c2c3f=_0x134604[0x0],_0xad3684=_0x195ac8,_0xc9ebbc=_0xad3684[_0x2cb609(0x1c2)],_0x4c201e=_0xad3684[_0x2cb609(0x175)];try{if(!_0x4c201e){const _0x1040c9=_0x25a31a[_0x2cb609(0x12b)][_0x2cb609(0x1a7)](_0x4c2c3f),_0x32b9d3=_0xc9ebbc||_0x1040c9[_0x2cb609(0x16a)][_0x2cb609(0x18d)],_0x557f68=await withSpinner(_0x2cb609(0x194),()=>_0x25a31a[_0x2cb609(0x12b)][_0x2cb609(0x1c9)](),{'verbose':_0x195ac8['verbose']}),_0x129aca=_0x557f68['data'][_0x2cb609(0x1b5)](_0x3b95b3=>_0x3b95b3[_0x2cb609(0x133)][_0x2cb609(0x1c2)]===_0x32b9d3);if(_0x129aca&&!_0x195ac8['yes']){const _0x19d510=await confirm('A\x20project\x20named\x20\x27'+_0x32b9d3+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x19d510)return console['log'](_0x2cb609(0x182)),0x0;}}const _0x1a83fe=await withSpinner(_0x4c201e?'Validating\x20backup\x20from\x20\x27'+_0x4c2c3f+'\x27...':_0x2cb609(0x159)+_0x4c2c3f+'\x27...',()=>_0x25a31a[_0x2cb609(0x12b)][_0x2cb609(0x14e)](_0x4c2c3f,{'name':_0xc9ebbc,'dryRun':_0x4c201e}),{'verbose':_0x195ac8[_0x2cb609(0x1bf)]}),_0x2bfafd=_0x1a83fe[_0x2cb609(0x19b)];return _0x2bfafd[_0x2cb609(0x18e)]&&console[_0x2cb609(0x193)](_0x2cb609(0x15b)+_0x2bfafd['sourceSite']+'\x27'),_0x4c201e?console[_0x2cb609(0x193)](_0x2cb609(0x147)+_0x2bfafd[_0x2cb609(0x18d)]):console['log'](_0x2cb609(0x13f)+_0x2bfafd[_0x2cb609(0x18d)]+'\x20('+_0x2bfafd[_0x2cb609(0x1bc)]+')'),console[_0x2cb609(0x193)](_0x2cb609(0x17c)+_0x2bfafd[_0x2cb609(0x1c7)][_0x2cb609(0x136)]),console[_0x2cb609(0x193)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2bfafd['counts'][_0x2cb609(0x1b8)]),console['log']('\x20\x20Prompts:\x20'+_0x2bfafd[_0x2cb609(0x1c7)][_0x2cb609(0x1c4)]),console[_0x2cb609(0x193)](_0x2cb609(0x17f)+_0x2bfafd['counts'][_0x2cb609(0x1b0)]),(_0x195ac8[_0x2cb609(0x186)]===_0x2cb609(0x1a6)||_0x195ac8[_0x2cb609(0x186)]===_0x2cb609(0x148))&&await handleSDKOutput([_0x2bfafd],_0x195ac8),0x0;}catch(_0x35c7b2){return handleSDKError(_0x35c7b2,_0x195ac8),0x1;}}}
|
|
1
|
+
const a22_0x160052=a22_0x113d;(function(_0x223563,_0x2d6e4b){const _0x2453dc=a22_0x113d,_0x544226=_0x223563();while(!![]){try{const _0x3244bf=parseInt(_0x2453dc(0x1ea))/0x1+parseInt(_0x2453dc(0x254))/0x2+parseInt(_0x2453dc(0x216))/0x3+-parseInt(_0x2453dc(0x1c4))/0x4+parseInt(_0x2453dc(0x1e0))/0x5*(-parseInt(_0x2453dc(0x1d5))/0x6)+parseInt(_0x2453dc(0x1c6))/0x7+parseInt(_0x2453dc(0x202))/0x8*(parseInt(_0x2453dc(0x1b7))/0x9);if(_0x3244bf===_0x2d6e4b)break;else _0x544226['push'](_0x544226['shift']());}catch(_0xf25e6f){_0x544226['push'](_0x544226['shift']());}}}(a22_0xeb31,0xc370f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a22_0x113d(_0x9ef743,_0x236bf9){const _0xeb3199=a22_0xeb31();return a22_0x113d=function(_0x113dd9,_0x4bf981){_0x113dd9=_0x113dd9-0x1af;let _0x253c18=_0xeb3199[_0x113dd9];return _0x253c18;},a22_0x113d(_0x9ef743,_0x236bf9);}import{handleSDKOutput}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 a22_0x42121b from'node:fs';function handleSDKError(_0x4623c0,_0x1d26d8){const _0x4fb243=a22_0x113d;if(_0x4623c0 instanceof SDKError)console[_0x4fb243(0x205)](_0x4fb243(0x1b6)+_0x4623c0[_0x4fb243(0x220)]),_0x1d26d8['verbose']&&(_0x4623c0['cause']&&console[_0x4fb243(0x205)](_0x4fb243(0x209)+_0x4623c0[_0x4fb243(0x1cb)]),_0x4623c0['stack']&&(console[_0x4fb243(0x205)](_0x4fb243(0x24b)),console[_0x4fb243(0x205)](_0x4623c0[_0x4fb243(0x227)])));else throw _0x4623c0;}function formatChatHistoryEntry(_0x443a6f,_0x49dc08){const _0x4fec5d=a22_0x113d,_0x344465=getChalk(_0x49dc08),_0x10a495=_0x344465[_0x4fec5d(0x1be)](_0x443a6f['at']);if(_0x4fec5d(0x213)in _0x443a6f){const _0x26ca2c=_0x344465[_0x4fec5d(0x252)](_0x4fec5d(0x1ba));return _0x10a495+'\x20'+_0x26ca2c+':\x20'+_0x443a6f['input'];}if('content'in _0x443a6f){const _0x4f6c05=_0x344465['green'](_0x4fec5d(0x223));return _0x10a495+'\x20'+_0x4f6c05+':\x20'+_0x443a6f[_0x4fec5d(0x257)];}if(_0x4fec5d(0x21a)in _0x443a6f){const _0x26d668=_0x344465[_0x4fec5d(0x1bf)](_0x4fec5d(0x1f0)),{functionName:_0x71cd40,functionArguments:_0x32f3a9,targetFunction:_0xe33a18}=_0x443a6f[_0x4fec5d(0x21a)];let _0x5cf4c6=_0x10a495+'\x20'+_0x26d668+':\x20'+_0x344465[_0x4fec5d(0x1af)](_0x71cd40);if(_0x32f3a9&&Object[_0x4fec5d(0x1e4)](_0x32f3a9)['length']>0x0){const _0x59ba1b=Object[_0x4fec5d(0x1b3)](_0x32f3a9)['map'](([_0x431a00,_0x5be14d])=>_0x431a00+'='+JSON[_0x4fec5d(0x256)](_0x5be14d))[_0x4fec5d(0x219)](',\x20');_0x5cf4c6+='('+_0x59ba1b+')';}_0xe33a18&&(_0x5cf4c6+=_0x344465[_0x4fec5d(0x1be)]('\x20['+_0xe33a18+']'));let _0x3a2d20='';if(_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x1ed)])_0x3a2d20=_0x4fec5d(0x245)+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x1ed)]['name'];else{if(_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x215)])_0x3a2d20='\x20->\x20Agent:'+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x215)][_0x4fec5d(0x1cc)];else{if(_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x228)])_0x3a2d20=_0x4fec5d(0x249)+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x228)][_0x4fec5d(0x1cc)];else _0x443a6f[_0x4fec5d(0x21a)]['targetImageGenerator']&&(_0x3a2d20=_0x4fec5d(0x25d)+_0x443a6f[_0x4fec5d(0x21a)][_0x4fec5d(0x211)]['name']);}}return _0x5cf4c6+_0x3a2d20;}if(_0x4fec5d(0x1f7)in _0x443a6f){const _0x18a80=_0x344465[_0x4fec5d(0x1c3)](_0x4fec5d(0x208)),{functionName:_0x5c0795,functionArguments:_0x1089d3,content:_0x30b158,newChat:_0x10d575}=_0x443a6f[_0x4fec5d(0x1f7)];let _0x4f8404=_0x10a495+'\x20'+_0x18a80+':\x20'+_0x344465[_0x4fec5d(0x1af)](_0x5c0795);if(_0x1089d3){const _0x2f25b5=typeof _0x1089d3==='string'?_0x1089d3:JSON[_0x4fec5d(0x256)](_0x1089d3);_0x4f8404+='('+_0x2f25b5+')';}return _0x30b158&&(_0x4f8404+='\x0a'+_0x344465[_0x4fec5d(0x1be)](_0x30b158)),_0x10d575&&(_0x4f8404+=_0x344465[_0x4fec5d(0x1be)](_0x4fec5d(0x1db)+_0x10d575['id'])),_0x4f8404;}if(_0x4fec5d(0x206)in _0x443a6f){const _0x53e88f=_0x344465[_0x4fec5d(0x1ef)](_0x4fec5d(0x237));return _0x10a495+'\x20'+_0x53e88f+':\x20'+_0x443a6f[_0x4fec5d(0x206)][_0x4fec5d(0x1cc)]+'\x20('+_0x443a6f[_0x4fec5d(0x206)][_0x4fec5d(0x257)][_0x4fec5d(0x1c9)]+'\x20bytes)';}if(_0x4fec5d(0x203)in _0x443a6f){const _0x4f5b74=_0x344465[_0x4fec5d(0x1ef)](_0x4fec5d(0x1fe)),{width:_0x199fe6,height:_0x58c399,headerText:_0x5e2587}=_0x443a6f[_0x4fec5d(0x203)],_0xd22932=_0x5e2587?_0x4fec5d(0x232)+_0x5e2587:'';return _0x10a495+'\x20'+_0x4f5b74+':\x20'+_0x199fe6+'x'+_0x58c399+_0xd22932;}if(_0x4fec5d(0x205)in _0x443a6f){const _0x19626a=_0x344465[_0x4fec5d(0x1d6)](_0x4fec5d(0x20e));return _0x10a495+'\x20'+_0x19626a+':\x20'+_0x443a6f[_0x4fec5d(0x205)];}return _0x10a495+'\x20'+_0x344465[_0x4fec5d(0x1be)](_0x4fec5d(0x1ff))+':\x20'+JSON[_0x4fec5d(0x256)](_0x443a6f);}async function getProjectIdOrDefault(_0x9a0134){const _0x312dac=a22_0x113d,{tdx:_0x4e848f,options:_0x11b6de}=_0x9a0134,_0x22437a=_0x11b6de[_0x312dac(0x24a)];if(_0x22437a){const _0x12e91a=await withSpinner(_0x312dac(0x226)+_0x22437a+'\x27...',()=>_0x4e848f[_0x312dac(0x238)]['resolveProjectId'](_0x22437a),{'verbose':_0x11b6de['verbose']});return _0x12e91a[_0x312dac(0x20f)];}let _0x2760b8=_0x4e848f[_0x312dac(0x238)][_0x312dac(0x1d2)]();if(_0x2760b8)return _0x2760b8;const _0x19ab21=await withSpinner(_0x312dac(0x25a),()=>_0x4e848f[_0x312dac(0x238)][_0x312dac(0x224)](),{'verbose':_0x11b6de[_0x312dac(0x1bc)]});return _0x19ab21['data']['id'];}function toLLMProjectInfo(_0x3fac8e){const _0x10ae9c=a22_0x113d;return{'name':_0x3fac8e[_0x10ae9c(0x21d)][_0x10ae9c(0x1cc)],'description':_0x3fac8e[_0x10ae9c(0x21d)][_0x10ae9c(0x1c0)],'createdAt':_0x3fac8e[_0x10ae9c(0x21d)]['createdAt'],'updatedAt':_0x3fac8e['attributes'][_0x10ae9c(0x20d)]};}function toAgentInfo(_0x46b3b8){const _0x258f03=a22_0x113d;return{'name':_0x46b3b8[_0x258f03(0x21d)][_0x258f03(0x1cc)],'description':_0x46b3b8[_0x258f03(0x21d)]['description'],'prompt':truncatePrompt(_0x46b3b8[_0x258f03(0x21d)][_0x258f03(0x1e8)]),'createdAt':_0x46b3b8['attributes'][_0x258f03(0x22c)],'updatedAt':_0x46b3b8[_0x258f03(0x21d)]['updatedAt']};}function truncatePrompt(_0x42419d){const _0x55ac25=a22_0x113d;if(!_0x42419d)return undefined;const _0x2f0073=0x64;if(_0x42419d['length']<=_0x2f0073)return _0x42419d;return _0x42419d['slice'](0x0,_0x2f0073)+_0x55ac25(0x22e);}function a22_0xeb31(){const _0x361545=['Delete\x20an\x20LLM\x20project','json','965514qvyRtZ','red','Validating\x20backup\x20from\x20\x27','Use\x20format:\x20project-name/agent-name','integrations','prompts','\x20→\x20chat:\x20','Update\x20an\x20existing\x20agent','llm:projects','Create\x20a\x20new\x20agent\x20in\x20current\x20project','table','35QSoEyT','deleteProject','Invalid\x20path\x20syntax:\x20','llm:agents','keys','List\x20all\x20LLM\x20projects','sourceSite','log','prompt','createAgent','164134ocMGAV','llm:history','outputDir','targetKnowledgeBase','dryRun','blue','[tool_call]','Backup\x20cancelled.','llm:agent:create','Agent\x20created:\x20','Error:\x20Agent\x20name\x20is\x20required','split','projectName','tool','\x27\x20already\x20exists.\x20Overwrite?','Usage:\x20tdx\x20llm\x20history\x20--last','Agent\x20deleted:\x20','llm:project:create','last','Agent\x20updated:\x20','[image]\x20\x20','[unknown]','agents','Project\x20restored:\x20','69912AHTiuX','image','Output\x20directory\x20\x27','error','output','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','[tool]\x20\x20\x20','\x20\x20Cause:\x20','Resolving\x20agent\x20\x27','\x27...','history','updatedAt','[error]\x20\x20','data','model','targetImageGenerator','restoreProject','input','resolveAgentId','targetAgent','3543180yNowoV','Project\x20created:\x20','Project\x20context\x20set\x20to:\x20','join','tool_call','jsonl','Fetching\x20available\x20models...','attributes','\x20\x20Integrations:\x20','Backing\x20up\x20project\x20\x27','message','projects','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','[content]','getOrCreateDefaultProject','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Resolving\x20project\x20\x27','stack','targetWebSearchTool','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','\x20\x20Prompts:\x20','limit','createdAt','claude-4.5-haiku','...','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','updateAgent','Creating\x20agent\x20\x27','\x20-\x20','map','setCurrentProject','Show\x20agent\x20details','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','[output]\x20','llm','maxToolIterations','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Restore\x20cancelled.','yes','deleteAgent','Error:\x20Backup\x20folder\x20path\x20is\x20required','Project\x20not\x20found:\x20','\x20\x20Knowledge\x20Bases:\x20','backupProject','\x20\x20Agents:\x20','getBackupMetadata','\x20->\x20KB:','List\x20agents\x20in\x20current\x20project','Error:\x20Project\x20name\x20is\x20required','temperature','\x20->\x20WebSearch:','llmProject','\x0aStack\x20trace:','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','execute','Fetching\x20projects...','knowledgeBases','counts','llm:project:backup','cyan','exportedFrom','192058zLKVin','.llm','stringify','content','Analyzing\x20project\x20\x27','existsSync','Getting\x20default\x20project...','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','\x20->\x20ImageGen:','bold','toLowerCase','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','entries','Deleting\x20agent...','llm:models','Error:\x20','1161xdJIhH','llm:agent:update','systemPrompt','[input]\x20\x20','format','verbose','chats','dim','yellow','description','Updating\x20agent...','models','magenta','6184040nJGFVW','find','6330912kdGXlE','List\x20available\x20LLM\x20models','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','length','INVALID_ARGUMENT','cause','name','Fetching\x20agent...','llm:agent:show','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','filter','getCurrentProject'];a22_0xeb31=function(){return _0x361545;};return a22_0xeb31();}export class LLMModelsCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1b5);[a22_0x160052(0x1c0)]=a22_0x160052(0x1c7);async[a22_0x160052(0x24d)](_0x2f6603){const _0x45d597=a22_0x160052,{options:_0x4cf79a,tdx:_0x31e838}=_0x2f6603;try{const _0x3d0b3f=await withSpinner(_0x45d597(0x21c),()=>_0x31e838['llm'][_0x45d597(0x1c2)](),{'verbose':_0x4cf79a[_0x45d597(0x1bc)]});return await handleSDKOutput(_0x3d0b3f['data'],_0x4cf79a),0x0;}catch(_0x329900){return handleSDKError(_0x329900,_0x4cf79a),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a22_0x160052(0x1dd);[a22_0x160052(0x1c0)]=a22_0x160052(0x1e5);async[a22_0x160052(0x24d)](_0x5a395d){const _0x496be5=a22_0x160052,{options:_0x5a79c6,args:_0x4b2e2f,tdx:_0x5b777a}=_0x5a395d;try{const _0x1f863e=_0x4b2e2f[0x0],_0x36f561=resolveLimit(_0x5a79c6[_0x496be5(0x22b)],DEFAULT_LLM_LIMIT),_0x1e71e8=await withSpinner(_0x496be5(0x24e),()=>_0x5b777a['llm'][_0x496be5(0x221)](_0x36f561),{'verbose':_0x5a79c6[_0x496be5(0x1bc)]});let _0x54c77e=_0x1e71e8[_0x496be5(0x20f)];_0x1f863e&&(_0x54c77e=_0x1e71e8[_0x496be5(0x20f)][_0x496be5(0x1d1)](_0x53067e=>matchGlobPattern(_0x53067e[_0x496be5(0x21d)]['name'],_0x1f863e)));const _0x3740fd=_0x54c77e[_0x496be5(0x233)](toLLMProjectInfo);return await handleSDKOutput(_0x3740fd,_0x5a79c6),0x0;}catch(_0x2c5778){return handleSDKError(_0x2c5778,_0x5a79c6),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1e3);[a22_0x160052(0x1c0)]=a22_0x160052(0x246);async[a22_0x160052(0x24d)](_0x45e83f){const _0x1c25e2=a22_0x160052,{options:_0x1e03f5,args:_0x454ef9,tdx:_0x5b39c7}=_0x45e83f;try{const _0x47dda0=_0x454ef9[0x0];let _0x41a4c0,_0x2ee8f4=_0x47dda0;if(_0x47dda0&&_0x47dda0['includes']('/')){const _0x4fb1c2=_0x47dda0[_0x1c25e2(0x1f5)]('/');if(_0x4fb1c2[_0x1c25e2(0x1c9)]===0x2){const [_0x5818f3,_0x4cd9e7]=_0x4fb1c2,_0x52c678=await _0x5b39c7[_0x1c25e2(0x238)][_0x1c25e2(0x221)](),_0x248ded=_0x52c678[_0x1c25e2(0x1c5)](_0x220296=>_0x220296[_0x1c25e2(0x21d)][_0x1c25e2(0x1cc)][_0x1c25e2(0x1b0)]()===_0x5818f3[_0x1c25e2(0x1b0)]());if(!_0x248ded)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x1c25e2(0x240)+_0x5818f3,undefined,{'helpText':_0x1c25e2(0x236)});_0x41a4c0=_0x248ded['id'],_0x2ee8f4=_0x4cd9e7;}else throw new SDKError(ErrorCode[_0x1c25e2(0x1ca)],_0x1c25e2(0x1e2)+_0x47dda0,undefined,{'helpText':_0x1c25e2(0x1d8)});}else _0x41a4c0=await getProjectIdOrDefault(_0x45e83f);const _0x30864a=await withSpinner('Fetching\x20agents...',()=>_0x5b39c7['llm'][_0x1c25e2(0x200)](_0x41a4c0),{'verbose':_0x1e03f5['verbose']});let _0x576cfa=_0x30864a['data'];_0x2ee8f4&&(_0x576cfa=_0x30864a['data']['filter'](_0x250a5f=>matchGlobPattern(_0x250a5f['attributes'][_0x1c25e2(0x1cc)],_0x2ee8f4)));const _0x5985a6=_0x576cfa['map'](toAgentInfo);return await handleSDKOutput(_0x5985a6,_0x1e03f5),0x0;}catch(_0x4e98c6){return handleSDKError(_0x4e98c6,_0x1e03f5),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a22_0x160052(0x1ce);['description']=a22_0x160052(0x235);async[a22_0x160052(0x24d)](_0x3eab36){const _0x486852=a22_0x160052,{options:_0x58a1c7,args:_0xea099,tdx:_0x5eaf21}=_0x3eab36;if(_0xea099[_0x486852(0x1c9)]===0x0)return console['error'](_0x486852(0x1f4)),console[_0x486852(0x205)](_0x486852(0x22f)),0x1;const _0x10dcc7=_0xea099[0x0];try{const _0x375d35=await getProjectIdOrDefault(_0x3eab36),_0x3065e6=await withSpinner(_0x486852(0x20a)+_0x10dcc7+_0x486852(0x20b),()=>_0x5eaf21['llm'][_0x486852(0x214)](_0x10dcc7,_0x375d35),{'verbose':_0x58a1c7['verbose']}),_0x507190=await withSpinner(_0x486852(0x1cd),()=>_0x5eaf21[_0x486852(0x238)]['agent'](_0x3065e6[_0x486852(0x20f)]),{'verbose':_0x58a1c7['verbose']});return await handleSDKOutput([_0x507190['data']],_0x58a1c7),0x0;}catch(_0x2d7f7d){return handleSDKError(_0x2d7f7d,_0x58a1c7),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1f2);[a22_0x160052(0x1c0)]=a22_0x160052(0x1de);async[a22_0x160052(0x24d)](_0x1daf59){const _0x26ee35=a22_0x160052,{options:_0x386563,args:_0x2c8ac4,tdx:_0x287441}=_0x1daf59;if(_0x2c8ac4[_0x26ee35(0x1c9)]===0x0)return console[_0x26ee35(0x205)](_0x26ee35(0x1f4)),console[_0x26ee35(0x205)](_0x26ee35(0x23a)),console[_0x26ee35(0x205)](_0x26ee35(0x23b)),0x1;const _0x1bd52d=_0x2c8ac4[0x0],_0x3a4fac=_0x386563,_0x4a7400=_0x3a4fac[_0x26ee35(0x1b9)],_0x7da790=_0x3a4fac[_0x26ee35(0x210)]||_0x26ee35(0x22d),_0x83de3d=_0x3a4fac['starterMessage'],_0x5460c7=_0x3a4fac[_0x26ee35(0x239)]?Number(_0x3a4fac[_0x26ee35(0x239)]):undefined,_0x237785=_0x3a4fac['temperature']?Number(_0x3a4fac[_0x26ee35(0x248)]):undefined;try{let _0x1c67f9,_0x83da7c;if(_0x1bd52d['includes']('/')){const _0x4ef95e=_0x1bd52d[_0x26ee35(0x1f5)]('/');if(_0x4ef95e['length']===0x2){const [_0x265df6,_0x258e8e]=_0x4ef95e,_0x29c98c=await withSpinner(_0x26ee35(0x226)+_0x265df6+_0x26ee35(0x20b),()=>_0x287441[_0x26ee35(0x238)]['resolveProjectId'](_0x265df6),{'verbose':_0x386563[_0x26ee35(0x1bc)]});_0x1c67f9=_0x29c98c[_0x26ee35(0x20f)],_0x83da7c=_0x258e8e;}else throw new SDKError(ErrorCode[_0x26ee35(0x1ca)],_0x26ee35(0x1e2)+_0x1bd52d,undefined,{'helpText':_0x26ee35(0x1d8)});}else _0x1c67f9=await getProjectIdOrDefault(_0x1daf59),_0x83da7c=_0x1bd52d;const _0x2021a5=await withSpinner(_0x26ee35(0x231)+_0x83da7c+'\x27...',()=>_0x287441[_0x26ee35(0x238)][_0x26ee35(0x1e9)]({'name':_0x83da7c,'projectId':_0x1c67f9,'modelType':_0x7da790,'systemPrompt':_0x4a7400,'starterMessage':_0x83de3d,'maxToolIterations':_0x5460c7,'temperature':_0x237785}),{'verbose':_0x386563['verbose']});return console[_0x26ee35(0x1e7)](_0x26ee35(0x1f3)+_0x2021a5[_0x26ee35(0x20f)]['id']),await handleSDKOutput([_0x2021a5[_0x26ee35(0x20f)]],_0x386563),0x0;}catch(_0x549cc8){return handleSDKError(_0x549cc8,_0x386563),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1b8);[a22_0x160052(0x1c0)]=a22_0x160052(0x1dc);async[a22_0x160052(0x24d)](_0x42b087){const _0x2451ea=a22_0x160052,{options:_0x4fb840,args:_0x2916ef,tdx:_0x2baf22}=_0x42b087;if(_0x2916ef[_0x2451ea(0x1c9)]===0x0)return console[_0x2451ea(0x205)](_0x2451ea(0x1f4)),console[_0x2451ea(0x205)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x4330d2=_0x2916ef[0x0],_0x25c71d=_0x4fb840,_0x1718e4=_0x25c71d['name'],_0x10ccea=_0x25c71d['prompt'],_0x3bcae8=_0x25c71d[_0x2451ea(0x1c0)],_0x535071=_0x25c71d['starterMessage'];if(!_0x1718e4&&!_0x10ccea&&!_0x3bcae8&&!_0x535071)return console[_0x2451ea(0x205)](_0x2451ea(0x207)),console['error'](_0x2451ea(0x222)),0x1;try{const _0x4d46d7=await getProjectIdOrDefault(_0x42b087),_0x4f4d5c=await withSpinner(_0x2451ea(0x20a)+_0x4330d2+_0x2451ea(0x20b),()=>_0x2baf22[_0x2451ea(0x238)][_0x2451ea(0x214)](_0x4330d2,_0x4d46d7),{'verbose':_0x4fb840['verbose']}),_0x5d07be=_0x4f4d5c['data'],_0x655c29=await withSpinner(_0x2451ea(0x1c1),()=>_0x2baf22[_0x2451ea(0x238)][_0x2451ea(0x230)](_0x5d07be,{'name':_0x1718e4,'prompt':_0x10ccea,'description':_0x3bcae8,'starterMessage':_0x535071}),{'verbose':_0x4fb840[_0x2451ea(0x1bc)]});return console[_0x2451ea(0x1e7)](_0x2451ea(0x1fd)+_0x655c29[_0x2451ea(0x20f)]['id']),await handleSDKOutput([_0x655c29[_0x2451ea(0x20f)]],_0x4fb840),0x0;}catch(_0x1d0372){return handleSDKError(_0x1d0372,_0x4fb840),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a22_0x160052(0x1cc)]='llm:agent:delete';['description']='Delete\x20an\x20agent';async[a22_0x160052(0x24d)](_0x2cc693){const _0x5c3fcc=a22_0x160052,{options:_0x59e265,args:_0x174834,tdx:_0x110661}=_0x2cc693;if(_0x174834['length']===0x0)return console['error'](_0x5c3fcc(0x1f4)),console[_0x5c3fcc(0x205)](_0x5c3fcc(0x1b2)),0x1;const _0x4bec17=_0x174834[0x0];try{const _0x5b97f5=await getProjectIdOrDefault(_0x2cc693),_0x3d2289=await withSpinner(_0x5c3fcc(0x20a)+_0x4bec17+_0x5c3fcc(0x20b),()=>_0x110661[_0x5c3fcc(0x238)][_0x5c3fcc(0x214)](_0x4bec17,_0x5b97f5),{'verbose':_0x59e265[_0x5c3fcc(0x1bc)]}),_0x26ef85=_0x3d2289[_0x5c3fcc(0x20f)];return await withSpinner(_0x5c3fcc(0x1b4),()=>_0x110661[_0x5c3fcc(0x238)][_0x5c3fcc(0x23e)](_0x26ef85),{'verbose':_0x59e265[_0x5c3fcc(0x1bc)]}),console[_0x5c3fcc(0x1e7)](_0x5c3fcc(0x1fa)+_0x26ef85),0x0;}catch(_0x175d99){return handleSDKError(_0x175d99,_0x59e265),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1eb);[a22_0x160052(0x1c0)]=a22_0x160052(0x225);async[a22_0x160052(0x24d)](_0x5dd9ec){const _0x1a11da=a22_0x160052,{options:_0x58bb05,args:_0x4cb847,tdx:_0xa5e8}=_0x5dd9ec;let _0x287486=_0x4cb847[0x0];const _0x4a860c=_0x58bb05,_0x131739=_0x4a860c[_0x1a11da(0x1fc)];try{if(_0x131739){if(_0x287486)return console[_0x1a11da(0x205)](_0x1a11da(0x1b1)),console[_0x1a11da(0x205)](_0x1a11da(0x1f9)),0x1;const _0x4bc7c9=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0xa5e8[_0x1a11da(0x238)][_0x1a11da(0x1bd)](0x1),{'verbose':_0x58bb05['verbose']});if(_0x4bc7c9[_0x1a11da(0x20f)][_0x1a11da(0x1c9)]===0x0)return console[_0x1a11da(0x1e7)]('No\x20chat\x20sessions\x20found.'),0x0;_0x287486=_0x4bc7c9['data'][0x0]['id'];}if(!_0x287486){const _0x545388=resolveLimit(_0x58bb05[_0x1a11da(0x22b)],DEFAULT_LLM_LIMIT),_0x3b918a=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0xa5e8[_0x1a11da(0x238)][_0x1a11da(0x1bd)](_0x545388),{'verbose':_0x58bb05[_0x1a11da(0x1bc)]});if(_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x1d4)||_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x21b))await handleSDKOutput(_0x3b918a[_0x1a11da(0x20f)],_0x58bb05);else{const _0xa7e919=_0x3b918a[_0x1a11da(0x20f)][_0x1a11da(0x233)](_0xdfab9f=>({'created_at':_0xdfab9f[_0x1a11da(0x21d)][_0x1a11da(0x22c)],'chat_id':_0xdfab9f['id'],'first_input':_0xdfab9f[_0x1a11da(0x21d)]['firstInputContent']||'(no\x20message)'}));await handleSDKOutput(_0xa7e919,_0x58bb05);}return 0x0;}else{const _0x29d1c4=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x287486+_0x1a11da(0x20b),()=>_0xa5e8['llm'][_0x1a11da(0x20c)](_0x287486),{'verbose':_0x58bb05[_0x1a11da(0x1bc)]}),_0xbcbbb7=_0x29d1c4['data'][_0x1a11da(0x20f)]??[];if(_0xbcbbb7['length']===0x0)return console['log']('No\x20messages\x20found\x20in\x20chat\x20history.'),0x0;if(_0x58bb05['format']==='json'||_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x21b)||_0x58bb05[_0x1a11da(0x1bb)]===_0x1a11da(0x1df)||_0x58bb05[_0x1a11da(0x1bb)]==='tsv')await handleSDKOutput(_0xbcbbb7,_0x58bb05);else for(const _0x4c71dd of _0xbcbbb7){console['log'](formatChatHistoryEntry(_0x4c71dd,_0x58bb05));}return 0x0;}}catch(_0x46a7d7){return handleSDKError(_0x46a7d7,_0x58bb05),0x1;}}}export class LLMUseCommand extends BaseCommand{['name']='llm:use';[a22_0x160052(0x1c0)]='Set\x20current\x20project\x20context';async[a22_0x160052(0x24d)](_0x4791fc){const _0xbfc1=a22_0x160052,{options:_0x56fb22,args:_0xe86be4,tdx:_0x5d0816}=_0x4791fc;if(_0xe86be4[_0xbfc1(0x1c9)]===0x0)return console[_0xbfc1(0x205)](_0xbfc1(0x247)),console[_0xbfc1(0x205)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x4cec80=_0xe86be4[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x4cec80+'\x27...',()=>_0x5d0816[_0xbfc1(0x238)][_0xbfc1(0x234)](_0x4cec80),{'verbose':_0x56fb22[_0xbfc1(0x1bc)]}),console['log'](_0xbfc1(0x218)+_0x4cec80),0x0;}catch(_0x4a5ea1){return handleSDKError(_0x4a5ea1,_0x56fb22),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x1fb);[a22_0x160052(0x1c0)]='Create\x20a\x20new\x20LLM\x20project';async['execute'](_0x3b8816){const _0x5ad9c2=a22_0x160052,{options:_0x49f311,args:_0x35cf61,tdx:_0x3548f5}=_0x3b8816;if(_0x35cf61[_0x5ad9c2(0x1c9)]===0x0)return console[_0x5ad9c2(0x205)](_0x5ad9c2(0x247)),console[_0x5ad9c2(0x205)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x50c5a1=_0x35cf61[0x0],_0x15878c=_0x49f311,_0x1daccf=_0x15878c['description'];try{const _0x3cbbe8=await withSpinner('Creating\x20project\x20\x27'+_0x50c5a1+'\x27...',()=>_0x3548f5[_0x5ad9c2(0x238)]['createProject']({'name':_0x50c5a1,'description':_0x1daccf}),{'verbose':_0x49f311[_0x5ad9c2(0x1bc)]});console[_0x5ad9c2(0x1e7)](_0x5ad9c2(0x217)+_0x3cbbe8[_0x5ad9c2(0x20f)]['id']);const _0x640296=toLLMProjectInfo(_0x3cbbe8[_0x5ad9c2(0x20f)]);return await handleSDKOutput([_0x640296],_0x49f311),0x0;}catch(_0x99554f){return handleSDKError(_0x99554f,_0x49f311),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a22_0x160052(0x1cc)]='llm:project:delete';[a22_0x160052(0x1c0)]=a22_0x160052(0x1d3);async['execute'](_0x405626){const _0x87800b=a22_0x160052,{options:_0x410da2,args:_0x2f67c2,tdx:_0x6af593}=_0x405626;if(_0x2f67c2[_0x87800b(0x1c9)]===0x0)return console[_0x87800b(0x205)](_0x87800b(0x247)),console['error'](_0x87800b(0x1cf)),0x1;const _0x4e1662=_0x2f67c2[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x4e1662+_0x87800b(0x20b),()=>_0x6af593[_0x87800b(0x238)][_0x87800b(0x1e1)](_0x4e1662),{'verbose':_0x410da2[_0x87800b(0x1bc)]}),console[_0x87800b(0x1e7)]('Project\x20deleted:\x20'+_0x4e1662),0x0;}catch(_0x3850cd){return handleSDKError(_0x3850cd,_0x410da2),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a22_0x160052(0x1cc)]=a22_0x160052(0x251);[a22_0x160052(0x1c0)]='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder';async[a22_0x160052(0x24d)](_0x5ca85f){const _0x39981f=a22_0x160052,{options:_0x18e504,args:_0x5e5808,tdx:_0x150cac}=_0x5ca85f;if(_0x5e5808[_0x39981f(0x1c9)]===0x0)return console[_0x39981f(0x205)](_0x39981f(0x247)),console[_0x39981f(0x205)](_0x39981f(0x25c)),0x1;const _0x150bc7=_0x5e5808[0x0],_0x1185d0=_0x18e504,_0x32e5da=_0x1185d0[_0x39981f(0x206)],_0x2420a0=_0x1185d0[_0x39981f(0x1ee)];try{const _0x2bfbf7=_0x32e5da||_0x150bc7+_0x39981f(0x255);if(a22_0x42121b[_0x39981f(0x259)](_0x2bfbf7)&&!_0x2420a0){if(!_0x18e504['yes']){const _0x259a5e=await confirm(_0x39981f(0x204)+_0x2bfbf7+_0x39981f(0x1f8));if(!_0x259a5e)return console[_0x39981f(0x1e7)](_0x39981f(0x1f1)),0x0;}a22_0x42121b['rmSync'](_0x2bfbf7,{'recursive':!![]});}const _0x1a9495=await withSpinner(_0x2420a0?_0x39981f(0x258)+_0x150bc7+'\x27...':_0x39981f(0x21f)+_0x150bc7+_0x39981f(0x20b),()=>_0x150cac[_0x39981f(0x238)][_0x39981f(0x242)](_0x150bc7,_0x32e5da,{'dryRun':_0x2420a0}),{'verbose':_0x18e504[_0x39981f(0x1bc)]}),_0x403dd7=_0x1a9495[_0x39981f(0x20f)];return _0x2420a0?console[_0x39981f(0x1e7)](_0x39981f(0x229)+_0x403dd7[_0x39981f(0x1ec)]):console[_0x39981f(0x1e7)]('Project\x20backed\x20up\x20to:\x20'+_0x403dd7[_0x39981f(0x1ec)]),console['log'](_0x39981f(0x243)+_0x403dd7[_0x39981f(0x250)][_0x39981f(0x200)]),console['log'](_0x39981f(0x241)+_0x403dd7['counts'][_0x39981f(0x24f)]),console[_0x39981f(0x1e7)](_0x39981f(0x22a)+_0x403dd7[_0x39981f(0x250)][_0x39981f(0x1da)]),console[_0x39981f(0x1e7)](_0x39981f(0x21e)+_0x403dd7['counts'][_0x39981f(0x1d9)]),(_0x18e504[_0x39981f(0x1bb)]===_0x39981f(0x1d4)||_0x18e504[_0x39981f(0x1bb)]===_0x39981f(0x21b))&&await handleSDKOutput([_0x403dd7],_0x18e504),0x0;}catch(_0x3a2e49){return handleSDKError(_0x3a2e49,_0x18e504),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a22_0x160052(0x1cc)]='llm:project:restore';['description']=a22_0x160052(0x1d0);async[a22_0x160052(0x24d)](_0x1b085f){const _0x4cf0ee=a22_0x160052,{options:_0x1ece68,args:_0x53713a,tdx:_0xa4b60c}=_0x1b085f;if(_0x53713a['length']===0x0)return console[_0x4cf0ee(0x205)](_0x4cf0ee(0x23f)),console[_0x4cf0ee(0x205)]('Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]'),0x1;const _0x10d6d7=_0x53713a[0x0],_0x677242=_0x1ece68,_0x4d679f=_0x677242[_0x4cf0ee(0x1cc)],_0x5c8bfa=_0x677242[_0x4cf0ee(0x1ee)];try{if(!_0x5c8bfa){const _0x6c4c65=_0xa4b60c[_0x4cf0ee(0x238)][_0x4cf0ee(0x244)](_0x10d6d7),_0x382ace=_0x4d679f||_0x6c4c65[_0x4cf0ee(0x253)][_0x4cf0ee(0x1f6)],_0x2401fe=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0xa4b60c[_0x4cf0ee(0x238)]['projects'](),{'verbose':_0x1ece68[_0x4cf0ee(0x1bc)]}),_0x2e9670=_0x2401fe['data'][_0x4cf0ee(0x1c5)](_0x1763a3=>_0x1763a3['attributes']['name']===_0x382ace);if(_0x2e9670&&!_0x1ece68[_0x4cf0ee(0x23d)]){const _0x2cadc8=await confirm('A\x20project\x20named\x20\x27'+_0x382ace+_0x4cf0ee(0x25b));if(!_0x2cadc8)return console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x23c)),0x0;}}const _0x5995ed=await withSpinner(_0x5c8bfa?_0x4cf0ee(0x1d7)+_0x10d6d7+_0x4cf0ee(0x20b):'Restoring\x20project\x20from\x20\x27'+_0x10d6d7+_0x4cf0ee(0x20b),()=>_0xa4b60c[_0x4cf0ee(0x238)][_0x4cf0ee(0x212)](_0x10d6d7,{'name':_0x4d679f,'dryRun':_0x5c8bfa}),{'verbose':_0x1ece68[_0x4cf0ee(0x1bc)]}),_0x3348ff=_0x5995ed[_0x4cf0ee(0x20f)];return _0x3348ff[_0x4cf0ee(0x1e6)]&&console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x1c8)+_0x3348ff[_0x4cf0ee(0x1e6)]+'\x27'),_0x5c8bfa?console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x24c)+_0x3348ff[_0x4cf0ee(0x1f6)]):console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x201)+_0x3348ff[_0x4cf0ee(0x1f6)]+'\x20('+_0x3348ff['projectId']+')'),console['log']('\x20\x20Agents:\x20'+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x200)]),console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x241)+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x24f)]),console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x22a)+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x1da)]),console[_0x4cf0ee(0x1e7)](_0x4cf0ee(0x21e)+_0x3348ff[_0x4cf0ee(0x250)][_0x4cf0ee(0x1d9)]),(_0x1ece68['format']==='json'||_0x1ece68['format']===_0x4cf0ee(0x21b))&&await handleSDKOutput([_0x3348ff],_0x1ece68),0x0;}catch(_0x56fc7b){return handleSDKError(_0x56fc7b,_0x1ece68),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x5dd1bc=a23_0x2db2;function a23_0x2db2(_0x144082,_0x2f67cc){const _0x14e65c=a23_0x14e6();return a23_0x2db2=function(_0x2db2e1,_0x55f27b){_0x2db2e1=_0x2db2e1-0x1f4;let _0x12ff16=_0x14e65c[_0x2db2e1];return _0x12ff16;},a23_0x2db2(_0x144082,_0x2f67cc);}(function(_0x57441d,_0x126d1e){const _0x2f4184=a23_0x2db2,_0x28974b=_0x57441d();while(!![]){try{const _0x90947e=parseInt(_0x2f4184(0x205))/0x1*(parseInt(_0x2f4184(0x225))/0x2)+parseInt(_0x2f4184(0x200))/0x3+parseInt(_0x2f4184(0x20b))/0x4*(parseInt(_0x2f4184(0x22e))/0x5)+parseInt(_0x2f4184(0x21f))/0x6+-parseInt(_0x2f4184(0x211))/0x7*(-parseInt(_0x2f4184(0x215))/0x8)+-parseInt(_0x2f4184(0x212))/0x9+parseInt(_0x2f4184(0x1f9))/0xa*(-parseInt(_0x2f4184(0x219))/0xb);if(_0x90947e===_0x126d1e)break;else _0x28974b['push'](_0x28974b['shift']());}catch(_0x4b4dd1){_0x28974b['push'](_0x28974b['shift']());}}}(a23_0x14e6,0x7e912));import a23_0x44b794 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';function a23_0x14e6(){const _0x1633f4=['1gbSNBY','Project\x20\x27','init','llm:proxy','\x20\x20Project:','Server\x20Configuration:','4GsFQaM','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20Agents:','find','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x20\x20\x20\x20}','70DZsuHE','2950947xrVPXy','\x20\x20\x20\x20\x22env\x22:\x20{','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','648840mhmMYg','getOrCreateDefaultProject','white','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','16064873zndkeS','log','yellow','http://0.0.0.0:','start','created\x20on-demand\x20per\x20model','3662682PcJQyX','llmProject','\x20\x20Site:','name','stop','dim','2003224CiRjOt','close','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','\x20\x20Address:','attributes','\x20is\x20unavailable,\x20using\x20port\x20','green','llm','bold','4704730bBFEcd','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20{','site','Starting\x20proxy\x20server...','logLevel','description','logger','project','server','20qNTqvf','cyan','exit','\x27\x20not\x20found','projects','\x20\x20}','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','1209396XLjtsS','SIGINT','Port\x20','\x0a\x0aShutting\x20down\x20proxy\x20server...','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a'];a23_0x14e6=function(){return _0x1633f4;};return a23_0x14e6();}async function getProjectIdOrDefault(_0x554a42,_0x7fc68f){const _0x40f62c=a23_0x2db2,{tdx:_0x598868,options:_0x360ce5}=_0x554a42,_0x101e45=_0x7fc68f||_0x360ce5[_0x40f62c(0x220)];if(_0x101e45){const _0x55c421=await _0x598868[_0x40f62c(0x22c)][_0x40f62c(0x1fd)](),_0x5b64c3=_0x55c421[_0x40f62c(0x20e)](_0x56f927=>_0x56f927['attributes'][_0x40f62c(0x222)]===_0x101e45);if(!_0x5b64c3)throw new SDKError(ErrorCode['NOT_FOUND'],_0x40f62c(0x206)+_0x101e45+_0x40f62c(0x1fc),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x5b64c3['id'];}const _0x19ae67=await _0x598868[_0x40f62c(0x22c)][_0x40f62c(0x216)]();return _0x19ae67['id'];}export class LLMProxyCommand extends BaseCommand{[a23_0x5dd1bc(0x222)]=a23_0x5dd1bc(0x208);[a23_0x5dd1bc(0x1f5)]=a23_0x5dd1bc(0x20c);[a23_0x5dd1bc(0x1f8)];[a23_0x5dd1bc(0x1f6)];async['execute'](_0x1aa6a2){const _0x2c41d5=a23_0x5dd1bc,{tdx:_0x1dcaf2,options:_0x1d2e09}=_0x1aa6a2;try{const _0x1c98b6=_0x1d2e09,_0x5eae81=_0x1c98b6['port']||0xfa0,_0x3e1d31=_0x1c98b6[_0x2c41d5(0x1f7)],_0x49b9c8=await findAvailablePort(_0x5eae81);console['log'](a23_0x44b794['dim']('Resolving\x20project...'));const _0x47cf55=await getProjectIdOrDefault(_0x1aa6a2,_0x3e1d31),_0x37dcd5=await _0x1dcaf2[_0x2c41d5(0x22c)]['projects'](),_0x38c48f=_0x37dcd5[_0x2c41d5(0x20e)](_0x169419=>_0x169419['id']===_0x47cf55);this[_0x2c41d5(0x1f6)]=new TDXLogger(_0x1d2e09[_0x2c41d5(0x1f4)]),await this['logger'][_0x2c41d5(0x207)](),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x232)));_0x49b9c8!==_0x5eae81&&console['log'](a23_0x44b794['yellow'](_0x2c41d5(0x202)+_0x5eae81+_0x2c41d5(0x22a)+_0x49b9c8));this[_0x2c41d5(0x1f8)]=new ProxyServer({'port':_0x49b9c8,'projectId':_0x47cf55,'tdx':_0x1dcaf2,'logger':this[_0x2c41d5(0x1f6)],'site':_0x1d2e09[_0x2c41d5(0x231)]}),await this[_0x2c41d5(0x1f8)][_0x2c41d5(0x21d)](),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x21b)][_0x2c41d5(0x22d)](_0x2c41d5(0x214))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x21b)](_0x2c41d5(0x218))),console['log'](a23_0x44b794[_0x2c41d5(0x21b)](_0x2c41d5(0x227))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x22b)][_0x2c41d5(0x22d)](_0x2c41d5(0x204))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x1fa)](_0x2c41d5(0x20a))),console['log'](a23_0x44b794['dim'](_0x2c41d5(0x228)),a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x21c)+_0x49b9c8)),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x209)),a23_0x44b794[_0x2c41d5(0x217)](_0x38c48f?.[_0x2c41d5(0x229)][_0x2c41d5(0x222)]||_0x47cf55)),console['log'](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x20d)),a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x21e))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x221)),a23_0x44b794[_0x2c41d5(0x217)](_0x1d2e09[_0x2c41d5(0x231)])),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x1fa)]('\x0aClaude\x20Code\x20Configuration:')),console['log'](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x20f))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x230))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x213))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x49b9c8+'\x22,')),console[_0x2c41d5(0x21a)](a23_0x44b794['white']('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x210))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x217)](_0x2c41d5(0x1fe))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x1fa)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console['log'](a23_0x44b794['dim']('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x1ff))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x224)](_0x2c41d5(0x22f))),console[_0x2c41d5(0x21a)](a23_0x44b794[_0x2c41d5(0x21b)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x174c7a=async()=>{const _0x323e1a=_0x2c41d5;console[_0x323e1a(0x21a)](a23_0x44b794[_0x323e1a(0x224)](_0x323e1a(0x203))),this[_0x323e1a(0x1f8)]&&await this['server'][_0x323e1a(0x223)](),this[_0x323e1a(0x1f6)]&&await this[_0x323e1a(0x1f6)]['close'](),console[_0x323e1a(0x21a)](a23_0x44b794['green']('✓\x20Proxy\x20server\x20stopped')),process[_0x323e1a(0x1fb)](0x0);};return process['on'](_0x2c41d5(0x201),_0x174c7a),process['on']('SIGTERM',_0x174c7a),await new Promise(()=>{}),0x0;}catch(_0xa62614){this[_0x2c41d5(0x1f8)]&&await this['server'][_0x2c41d5(0x223)]();this[_0x2c41d5(0x1f6)]&&await this[_0x2c41d5(0x1f6)][_0x2c41d5(0x226)]();throw _0xa62614;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x501e75=a24_0x27ed;(function(_0x59b023,_0x2c87b0){const _0x23df4a=a24_0x27ed,_0x103df1=_0x59b023();while(!![]){try{const _0x477489=-parseInt(_0x23df4a(0x1fd))/0x1+parseInt(_0x23df4a(0x207))/0x2+parseInt(_0x23df4a(0x210))/0x3*(-parseInt(_0x23df4a(0x201))/0x4)+-parseInt(_0x23df4a(0x1f0))/0x5*(-parseInt(_0x23df4a(0x1e7))/0x6)+-parseInt(_0x23df4a(0x208))/0x7*(parseInt(_0x23df4a(0x1fb))/0x8)+parseInt(_0x23df4a(0x1f5))/0x9*(parseInt(_0x23df4a(0x1f6))/0xa)+parseInt(_0x23df4a(0x215))/0xb;if(_0x477489===_0x2c87b0)break;else _0x103df1['push'](_0x103df1['shift']());}catch(_0x419c87){_0x103df1['push'](_0x103df1['shift']());}}}(a24_0x4624,0x2b8ea));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a24_0x501e75(0x1ed)]=a24_0x501e75(0x1e1);[a24_0x501e75(0x1e6)]=a24_0x501e75(0x1f7);async[a24_0x501e75(0x20c)](_0x4d449b){const _0x13fc5d=a24_0x501e75,{options:_0x22004f,args:_0x37c63e,tdx:_0x2363d2}=_0x4d449b,_0x5e2d3b=_0x22004f;if(_0x37c63e[_0x13fc5d(0x205)]===0x0)return console[_0x13fc5d(0x1e2)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x20f)),0x1;const _0x308112=_0x37c63e[0x0];if(!_0x5e2d3b['database']||!_0x5e2d3b[_0x13fc5d(0x1f1)])return console[_0x13fc5d(0x1e2)](_0x13fc5d(0x1ec)),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x20f)),0x1;_0x5e2d3b[_0x13fc5d(0x20a)]&&(console['error'](_0x13fc5d(0x1f2)+_0x5e2d3b[_0x13fc5d(0x20d)]),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x206)+_0x308112),console['error']('Database:\x20'+_0x5e2d3b[_0x13fc5d(0x1e0)]),console[_0x13fc5d(0x1e2)](_0x13fc5d(0x1f3)+_0x5e2d3b[_0x13fc5d(0x1f1)]));const _0x52ad58=await loadJSONFromOptions(_0x5e2d3b['attributes'],_0x5e2d3b[_0x13fc5d(0x1f8)]),_0x357ba4=await loadJSONFromOptions(_0x5e2d3b[_0x13fc5d(0x1ff)],_0x5e2d3b[_0x13fc5d(0x20b)]),_0x37c220=await loadJSONFromOptions(_0x5e2d3b[_0x13fc5d(0x204)],_0x5e2d3b[_0x13fc5d(0x1f4)]),_0x5a501a={'name':_0x308112,'description':_0x5e2d3b[_0x13fc5d(0x1e6)],'scheduleType':_0x5e2d3b[_0x13fc5d(0x214)],'scheduleOption':_0x5e2d3b[_0x13fc5d(0x20e)],'timezone':_0x5e2d3b['timezone'],'master':{'parentDatabaseName':_0x5e2d3b[_0x13fc5d(0x1e0)],'parentTableName':_0x5e2d3b[_0x13fc5d(0x1f1)]},'attributes':_0x52ad58,'behaviors':_0x357ba4,'customerGroup':_0x37c220},_0x4587f1=await withSpinner(_0x13fc5d(0x202)+_0x308112+'\x27...',()=>_0x2363d2['segment'][_0x13fc5d(0x1e3)](_0x5a501a),{'verbose':_0x22004f[_0x13fc5d(0x20a)]}),_0x3ef004=_0x4587f1[_0x13fc5d(0x1e8)];return console[_0x13fc5d(0x1e2)](_0x13fc5d(0x212)+_0x3ef004['name']+'\x27\x20with\x20ID:\x20'+_0x3ef004['id']),await handleSDKOutput([_0x3ef004],_0x22004f),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a24_0x501e75(0x1ed)]=a24_0x501e75(0x1eb);[a24_0x501e75(0x1e6)]=a24_0x501e75(0x211);async['execute'](_0xd41d6a){const _0xbdd198=a24_0x501e75,{options:_0x6884d6,args:_0x4d0748,tdx:_0x4496f8}=_0xd41d6a,_0x1ea6cc=_0x6884d6;if(_0x4d0748['length']===0x0)return console[_0xbdd198(0x1e2)](_0xbdd198(0x203)),console['error'](_0xbdd198(0x1fe)),0x1;const _0xbd55ea=_0x4d0748[0x0];_0x1ea6cc['verbose']&&(console[_0xbdd198(0x1e2)]('Site:\x20'+_0x1ea6cc[_0xbdd198(0x20d)]),console[_0xbdd198(0x1e2)](_0xbdd198(0x1f9)+_0xbd55ea));const _0x351f1f=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0xbd55ea+_0xbdd198(0x1fa),()=>_0x4496f8[_0xbdd198(0x213)][_0xbdd198(0x1e4)](_0xbd55ea),{'verbose':_0x1ea6cc[_0xbdd198(0x20a)]}),_0xfcba98=_0x351f1f[_0xbdd198(0x1e8)],_0x16790b=await loadJSONFromOptions(_0x1ea6cc[_0xbdd198(0x209)],_0x1ea6cc[_0xbdd198(0x200)]),_0x139fe8=await loadJSONFromOptions(_0x1ea6cc[_0xbdd198(0x1ea)],_0x1ea6cc[_0xbdd198(0x1ef)]),_0x96caa0={'name':_0xfcba98[_0xbdd198(0x1ed)],'description':_0x1ea6cc[_0xbdd198(0x1e6)]!==undefined?_0x1ea6cc[_0xbdd198(0x1e6)]:_0xfcba98['description'],'scheduleType':_0x1ea6cc[_0xbdd198(0x214)]!==undefined?_0x1ea6cc[_0xbdd198(0x214)]:_0xfcba98[_0xbdd198(0x214)],'scheduleOption':_0x1ea6cc[_0xbdd198(0x20e)]!==undefined?_0x1ea6cc[_0xbdd198(0x20e)]:_0xfcba98[_0xbdd198(0x20e)],'timezone':_0x1ea6cc[_0xbdd198(0x1ee)]!==undefined?_0x1ea6cc[_0xbdd198(0x1ee)]:_0xfcba98[_0xbdd198(0x1ee)],'master':_0xfcba98[_0xbdd198(0x1e5)],'attributes':_0x16790b?[..._0xfcba98[_0xbdd198(0x1fc)]||[],..._0x16790b]:_0xfcba98[_0xbdd198(0x1fc)],'behaviors':_0x139fe8?[..._0xfcba98[_0xbdd198(0x1ff)]||[],..._0x139fe8]:_0xfcba98[_0xbdd198(0x1ff)],'customerGroup':_0xfcba98[_0xbdd198(0x204)]},_0x2884e5=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0xbd55ea+_0xbdd198(0x1fa),()=>_0x4496f8[_0xbdd198(0x213)]['updateParent'](_0xbd55ea,_0x96caa0),{'verbose':_0x1ea6cc['verbose']}),_0x11fe0e=_0x2884e5['data'];return console[_0xbdd198(0x1e2)](_0xbdd198(0x1e9)+_0x11fe0e[_0xbdd198(0x1ed)]+'\x27'),await handleSDKOutput([_0x11fe0e],_0x1ea6cc),0x0;}}function a24_0x27ed(_0x421141,_0x2e1a1a){const _0x46248c=a24_0x4624();return a24_0x27ed=function(_0x27ed34,_0x43ca03){_0x27ed34=_0x27ed34-0x1e0;let _0x2f6f46=_0x46248c[_0x27ed34];return _0x2f6f46;},a24_0x27ed(_0x421141,_0x2e1a1a);}function a24_0x4624(){const _0x188ee1=['80veLUjA','Create\x20new\x20parent\x20segment\x20(audience)','attributesFile','Parent\x20segment:\x20','\x27...','56xCtqJM','attributes','191244ePVaZz','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','behaviors','addAttributesFile','20XIfpfs','Creating\x20parent\x20segment\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','customerGroup','length','Name:\x20','280404hXuRbH','3017wpfagR','addAttributes','verbose','behaviorsFile','execute','site','scheduleOption','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','150933iIwJZv','Update\x20existing\x20parent\x20segment\x20(audience)','✔\x20Created\x20parent\x20segment\x20\x27','segment','scheduleType','150579eqTpyg','database','segment:parent:create','error','createParent','getParentFull','master','description','6HrHGuh','data','✔\x20Updated\x20parent\x20segment\x20\x27','addBehaviors','segment:parent:update','Error:\x20--database\x20and\x20--table\x20are\x20required','name','timezone','addBehaviorsFile','647275nTvblp','table','Site:\x20','Table:\x20','customerGroupFile','383490QyrVmj'];a24_0x4624=function(){return _0x188ee1;};return a24_0x4624();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x3cec3f=a25_0x4816;(function(_0x233c98,_0x17833e){const _0x525ff1=a25_0x4816,_0x7dfdf5=_0x233c98();while(!![]){try{const _0x51fd56=-parseInt(_0x525ff1(0x9d))/0x1*(parseInt(_0x525ff1(0xb0))/0x2)+parseInt(_0x525ff1(0xa1))/0x3+parseInt(_0x525ff1(0xa0))/0x4+parseInt(_0x525ff1(0xa2))/0x5+parseInt(_0x525ff1(0x9f))/0x6*(-parseInt(_0x525ff1(0xb3))/0x7)+parseInt(_0x525ff1(0xa6))/0x8+-parseInt(_0x525ff1(0xaa))/0x9;if(_0x51fd56===_0x17833e)break;else _0x7dfdf5['push'](_0x7dfdf5['shift']());}catch(_0x100f97){_0x7dfdf5['push'](_0x7dfdf5['shift']());}}}(a25_0xd2c3,0xdb46d));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a25_0xd2c3(){const _0x155979=['5608280MCaUGK','4840644XAcIjI','8845335nsbqPv','profiles','error','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','3071736ntOzWZ','Error:\x20','\x20\x20Global:\x20~/.config/tdx/tdx.json','message','15722073yrhwTH','scope','List\x20all\x20available\x20profiles','log','config','description','704Ddahlx','length','execute','154rFQOhZ','map','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2848bGEZya','name','414846artfqC'];a25_0xd2c3=function(){return _0x155979;};return a25_0xd2c3();}function a25_0x4816(_0x52e974,_0x120b4b){const _0xd2c399=a25_0xd2c3();return a25_0x4816=function(_0x48160f,_0x4cea03){_0x48160f=_0x48160f-0x9c;let _0x2f98bd=_0xd2c399[_0x48160f];return _0x2f98bd;},a25_0x4816(_0x52e974,_0x120b4b);}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a25_0x3cec3f(0x9e)]=a25_0x3cec3f(0xa3);['description']=a25_0x3cec3f(0xac);async[a25_0x3cec3f(0xb2)](_0x3fed9e){const _0x133b68=a25_0x3cec3f,{options:_0x50452c}=_0x3fed9e;try{const _0x1e718e=listProfiles(),_0x3d7ce9=getActiveProfile();if(_0x1e718e[_0x133b68(0xb1)]===0x0)return console[_0x133b68(0xad)](_0x133b68(0xa5)),console[_0x133b68(0xad)](_0x133b68(0x9c)),console[_0x133b68(0xad)](_0x133b68(0xa8)),0x0;const _0x2eebbb=_0x1e718e[_0x133b68(0xb4)](_0x4aed93=>{const _0xa41f4=_0x133b68,_0x3675b5=_0x4aed93['name']===_0x3d7ce9,_0xa3bbfe=getProfileParams(_0x4aed93[_0xa41f4(0xae)]);return{'name':_0x4aed93[_0xa41f4(0x9e)],'active':_0x3675b5,'scope':_0x4aed93[_0xa41f4(0xab)],'description':_0x4aed93[_0xa41f4(0xae)][_0xa41f4(0xaf)]||'','params':_0xa3bbfe};});return await handleSDKOutput(_0x2eebbb,_0x50452c),0x0;}catch(_0x43162f){return _0x43162f instanceof Error&&console[_0x133b68(0xa4)](_0x133b68(0xa7)+_0x43162f[_0x133b68(0xa9)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x135fcb=a26_0x22ff;(function(_0x448500,_0x1104d7){const _0x3c12a5=a26_0x22ff,_0x5c1abe=_0x448500();while(!![]){try{const _0x3d8681=parseInt(_0x3c12a5(0x186))/0x1*(-parseInt(_0x3c12a5(0x179))/0x2)+parseInt(_0x3c12a5(0x181))/0x3*(parseInt(_0x3c12a5(0x192))/0x4)+-parseInt(_0x3c12a5(0x182))/0x5+-parseInt(_0x3c12a5(0x17f))/0x6*(-parseInt(_0x3c12a5(0x1a3))/0x7)+-parseInt(_0x3c12a5(0x194))/0x8*(-parseInt(_0x3c12a5(0x17c))/0x9)+-parseInt(_0x3c12a5(0x175))/0xa+parseInt(_0x3c12a5(0x196))/0xb*(parseInt(_0x3c12a5(0x18c))/0xc);if(_0x3d8681===_0x1104d7)break;else _0x5c1abe['push'](_0x5c1abe['shift']());}catch(_0x4b347f){_0x5c1abe['push'](_0x5c1abe['shift']());}}}(a26_0x388e,0x43674));function a26_0x22ff(_0x37d171,_0x5fe25d){const _0x388ee2=a26_0x388e();return a26_0x22ff=function(_0x22ff05,_0x12f609){_0x22ff05=_0x22ff05-0x174;let _0x23245b=_0x388ee2[_0x22ff05];return _0x23245b;},a26_0x22ff(_0x37d171,_0x5fe25d);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a26_0x388e(){const _0x36b9d9=['completedSplits','27154wbqRDb','\x20rows\x20','\x20[Job\x20ID:\x20','423rAcpvV','\x0aAll\x20results\x20saved\x20to\x20','catalog','1178946ENCGeO','query','52629KAFFlk','1723825vmMQEw','stats','SQL:\x20','file','35ZSEiob','Error:\x20','totalSplits','Catalog:\x20','information_schema','validate','7626756QBeyQI','\x20-\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','in\x20','Executing\x20statement\x20','elapsedTimeMillis','4txwbGx','database','38728lZkOQx','length','11vUyAbr','\x20splits','verbose','data','...','args','error','Schema:\x20','originalMessage','Query\x20completed:\x20Processed\x20','description','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','execute','14dUtnJF','output','push','jobId','Statement\x20','1775710WYOEqt','site','message'];a26_0x388e=function(){return _0x36b9d9;};return a26_0x388e();}import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a26_0x135fcb(0x180);[a26_0x135fcb(0x1a0)]='Run\x20Trino\x20queries\x20(streaming)';async[a26_0x135fcb(0x1a2)](_0x47f72f){const _0x4475fc=a26_0x135fcb,{options:_0x54ec02,args:_0x37eea4,tdx:_0x35f00c}=_0x47f72f,_0x223ee6=_0x37eea4[0x0],_0xfb50aa=_0x54ec02[_0x4475fc(0x185)];let _0x5480cf;if(_0xfb50aa)try{_0x5480cf=readSqlStatementsFromFile(_0xfb50aa);}catch(_0x48f831){return console[_0x4475fc(0x19c)](_0x4475fc(0x187)+_0x48f831[_0x4475fc(0x177)]),0x1;}else try{_0x5480cf=splitSqlStatements(_0x223ee6);}catch(_0x446240){return console[_0x4475fc(0x19c)](_0x4475fc(0x187)+_0x446240[_0x4475fc(0x177)]),0x1;}const _0x5385a6=_0x54ec02[_0x4475fc(0x193)]||_0x4475fc(0x18a),_0x4b3e33=_0x54ec02[_0x4475fc(0x17e)];try{const _0x46d82b=[],_0x4f8011=!!_0x54ec02[_0x4475fc(0x1a4)];for(let _0x6e81f0=0x0;_0x6e81f0<_0x5480cf['length'];_0x6e81f0++){const _0x3ec90e=_0x5480cf[_0x6e81f0],_0x2cfa4f=_0x6e81f0+0x1,_0x55e8f9=_0x5480cf[_0x4475fc(0x195)],_0x2fe0d2=_0x55e8f9>0x1;_0x54ec02[_0x4475fc(0x198)]&&(console[_0x4475fc(0x19c)]('\x0a'+(_0x2fe0d2?'Statement\x20'+_0x2cfa4f+'/'+_0x55e8f9+':':'')),console[_0x4475fc(0x19c)]('Site:\x20'+_0x54ec02[_0x4475fc(0x176)]),console[_0x4475fc(0x19c)](_0x4475fc(0x189)+(_0x4b3e33||'td')),console['error'](_0x4475fc(0x19d)+_0x5385a6),console[_0x4475fc(0x19c)](_0x4475fc(0x184)+_0x3ec90e));const _0x3358ee=_0x2fe0d2?_0x4475fc(0x190)+_0x2cfa4f+'/'+_0x55e8f9+_0x4475fc(0x19a):'Executing\x20query...';try{const _0x1078c4=await withQuerySpinner(_0x3358ee,async _0x15e32b=>{const _0x3584db=_0x4475fc,_0xe482ce=await _0x35f00c[_0x3584db(0x180)]['execute'](_0x3ec90e,{'catalog':_0x4b3e33,'schema':_0x5385a6,'onJobId':_0x359740=>{_0x15e32b['setJobId'](_0x359740);},'onProgress':_0x1f49b9=>{const _0x280036=_0x3584db;_0x15e32b['setPhase']('Executing\x20query\x20['+_0x1f49b9['state']+']'),_0x15e32b['setExtra'](formatRows(_0x1f49b9['processedRows'])+_0x280036(0x17a)+_0x1f49b9[_0x280036(0x178)]+'/'+_0x1f49b9[_0x280036(0x188)]+_0x280036(0x197));}});return _0xe482ce;},{'verbose':_0x54ec02[_0x4475fc(0x198)]}),_0x1b24cd=_0x1078c4[_0x4475fc(0x199)],_0x1b0416=_0x1b24cd[_0x4475fc(0x1a6)]?_0x4475fc(0x17b)+_0x1b24cd[_0x4475fc(0x1a6)]+']':'',_0x2e79ec=_0x2fe0d2?_0x4475fc(0x174)+_0x2cfa4f+'/'+_0x55e8f9+_0x4475fc(0x18d):'';console[_0x4475fc(0x19c)]('✔\x20'+_0x2e79ec+_0x4475fc(0x19f)+formatRows(_0x1b24cd[_0x4475fc(0x183)]['processedRows'])+_0x4475fc(0x17a)+(_0x4475fc(0x18f)+formatElapsed(_0x1b24cd['stats'][_0x4475fc(0x191)])+_0x1b0416));if(_0x2fe0d2&&_0x4f8011){const _0x2db1c6=resolveOutputOptions(_0x54ec02),_0x410865=await formatQueryOutput(_0x1b24cd,_0x2db1c6);_0x46d82b[_0x4475fc(0x1a5)](_0x410865);}else await handleQueryOutput(_0x1b24cd,_0x54ec02);}catch(_0x38165e){const _0x1eb405=_0x2fe0d2?'Statement\x20'+_0x2cfa4f+'/'+_0x55e8f9+':\x0a':'',_0x3cc769=_0x38165e instanceof SDKError?_0x38165e[_0x4475fc(0x19e)]:_0x38165e[_0x4475fc(0x177)];return console[_0x4475fc(0x19c)](''+_0x1eb405+_0x3cc769),0x1;}}if(_0x5480cf[_0x4475fc(0x195)]>0x1&&_0x4f8011&&_0x46d82b[_0x4475fc(0x195)]>0x0){const _0x2bcd89=_0x46d82b['join']('\x0a');writeFileSync(_0x54ec02[_0x4475fc(0x1a4)],_0x2bcd89),console[_0x4475fc(0x19c)](_0x4475fc(0x17d)+_0x54ec02[_0x4475fc(0x1a4)]);}return 0x0;}catch(_0x4e0a5d){throw _0x4e0a5d;}}[a26_0x135fcb(0x18b)](_0x311e52){const _0x2325b5=a26_0x135fcb,_0x4ef26c=_0x311e52[_0x2325b5(0x19b)][0x0],_0xd9d065=_0x311e52['options'][_0x2325b5(0x185)];if(!_0x4ef26c&&!_0xd9d065)return _0x2325b5(0x1a1);if(_0x4ef26c&&_0xd9d065)return _0x2325b5(0x18e);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x15aaa8=a25_0x8202;(function(_0x534430,_0x5b04c2){const _0x3f1715=a25_0x8202,_0x359cf5=_0x534430();while(!![]){try{const _0x592d40=parseInt(_0x3f1715(0x1cf))/0x1+-parseInt(_0x3f1715(0x19b))/0x2*(parseInt(_0x3f1715(0x1a1))/0x3)+parseInt(_0x3f1715(0x1b3))/0x4+-parseInt(_0x3f1715(0x186))/0x5*(parseInt(_0x3f1715(0x192))/0x6)+-parseInt(_0x3f1715(0x1d5))/0x7+-parseInt(_0x3f1715(0x18e))/0x8+parseInt(_0x3f1715(0x189))/0x9;if(_0x592d40===_0x5b04c2)break;else _0x359cf5['push'](_0x359cf5['shift']());}catch(_0x4f55fb){_0x359cf5['push'](_0x359cf5['shift']());}}}(a25_0xe77d,0xf365b));function a25_0x8202(_0x4ab654,_0x3b5394){const _0xe77dd9=a25_0xe77d();return a25_0x8202=function(_0x820231,_0x11ee06){_0x820231=_0x820231-0x16d;let _0x537b4b=_0xe77dd9[_0x820231];return _0x537b4b;},a25_0x8202(_0x4ab654,_0x3b5394);}function a25_0xe77d(){const _0x26760b=['Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20Cause:\x20','folder','Usage:\x20tdx\x20segment\x20sql\x20<path>','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','execute','Resolved\x20parent\x20folder\x20ID:\x20','Segment\x20ID:\x20','information_schema','segmentId','Error:\x20','segment','✔\x20Query\x20completed:\x20Processed\x20','Parent\x20name:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Examples:','Folder\x20name:\x20','Resolving\x20folder\x20\x27','INTERNAL','message','Site:\x20','Resolved\x20relative\x20path\x20to:\x20','Fetching\x20folder\x20\x27','5ZlmkfO','Fetching\x20SQL\x20for\x20parent\x20segment...','in\x20','8599464FyaUTR','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Show\x20segment\x20or\x20folder\x20details','error','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','9631808IMnKiF','resolvePathToResource','parentSegment','segment:folder:list','5754786SgjTcf','test','getFolder','segmentPath','parentId','data','Resolved\x20type:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Usage:\x20tdx\x20segment\x20show\x20<path>','2kFeppL','\x27...','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','code','resolveFolderId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','55575uvDNIb','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','getSegmentSQL','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','cause','includes','length','parentFolder','replace','query','name','\x20[Job\x20ID:\x20','segment:folder:create','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolving\x20parent\x20folder\x20\x27','segment:sql','5893692NpRXOX','Parent\x20segment:\x20','Show\x20segment\x20folder\x20details','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','processedRows','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','site','segment:describe','Creating\x20folder\x20\x27','resolveParentId','Fetching\x20SQL\x20for\x20segment...','Error:\x20Path\x20or\x20name\x20is\x20required','type','verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getParentSQL','getSegment','Fetching\x20parent\x20segment\x20details...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','setJobId','description','\x20rows\x20','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','segment:show','1368012jfFSqi','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Parent\x20ID:\x20','elapsedTimeMillis','json','4328408KsaOmQ','Executing\x20segment\x20query...','format','parent','folderId','createFolder','jobId','listFolders','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'];a25_0xe77d=function(){return _0x26760b;};return a25_0xe77d();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a25_0x15aaa8(0x1ad)]=a25_0x15aaa8(0x1bb);[a25_0x15aaa8(0x1ca)]=a25_0x15aaa8(0x18b);async[a25_0x15aaa8(0x173)](_0x47287e){const _0x957c70=a25_0x15aaa8,{options:_0x49d14e,args:_0x4ceeab,tdx:_0x1c9f82}=_0x47287e,_0x518931=_0x4ceeab[0x0],_0x104247=!_0x518931&&!!_0x49d14e[_0x957c70(0x190)],_0x1825d6=_0x518931||_0x49d14e['parentSegment'];if(!_0x1825d6)return console[_0x957c70(0x18c)](_0x957c70(0x1bf)),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x957c70(0x18c)](_0x957c70(0x17e)),console[_0x957c70(0x18c)](_0x957c70(0x1c8)),console[_0x957c70(0x18c)](_0x957c70(0x18d)),console[_0x957c70(0x18c)](_0x957c70(0x1dd)),console[_0x957c70(0x18c)](_0x957c70(0x1c2)),0x1;try{const _0x5d64b9=_0x49d14e[_0x957c70(0x195)];let _0x328145=_0x1825d6;!_0x104247&&_0x5d64b9&&!_0x1825d6[_0x957c70(0x1a8)]('/')&&(_0x328145=_0x5d64b9+'/'+_0x1825d6,_0x49d14e[_0x957c70(0x1c1)]&&console['error'](_0x957c70(0x184)+_0x328145));const _0x5f3f20=await withSpinner(_0x957c70(0x1a2)+_0x328145+_0x957c70(0x19c),()=>_0x1c9f82[_0x957c70(0x179)][_0x957c70(0x18f)](_0x328145),{'verbose':_0x49d14e[_0x957c70(0x1c1)]}),_0x53c549=_0x5f3f20['data'];_0x49d14e[_0x957c70(0x1c1)]&&(console[_0x957c70(0x18c)](_0x957c70(0x198)+_0x53c549['type']),console[_0x957c70(0x18c)](_0x957c70(0x1d2)+_0x53c549[_0x957c70(0x196)]),_0x53c549[_0x957c70(0x1d9)]&&console[_0x957c70(0x18c)]('Folder\x20ID:\x20'+_0x53c549[_0x957c70(0x1d9)]),_0x53c549[_0x957c70(0x177)]&&console[_0x957c70(0x18c)](_0x957c70(0x175)+_0x53c549['segmentId']));if(_0x53c549[_0x957c70(0x1c0)]===_0x957c70(0x1d8)){const _0x4753f6=await withSpinner(_0x957c70(0x1c5),()=>_0x1c9f82[_0x957c70(0x179)]['getParent'](_0x53c549[_0x957c70(0x196)]),{'verbose':_0x49d14e[_0x957c70(0x1c1)]});await handleSingleObjectOutput(_0x4753f6[_0x957c70(0x197)],_0x49d14e);}else{if(_0x53c549[_0x957c70(0x1c0)]===_0x957c70(0x170)){if(!_0x53c549[_0x957c70(0x1d9)])throw new SDKError(ErrorCode['INTERNAL'],_0x957c70(0x17c));const _0x4d23e2=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1c9f82[_0x957c70(0x179)][_0x957c70(0x194)](_0x53c549[_0x957c70(0x1d9)]),{'verbose':_0x49d14e[_0x957c70(0x1c1)]});await handleSingleObjectOutput(_0x4d23e2['data'],_0x49d14e);}else{if(_0x53c549['type']===_0x957c70(0x179)){if(!_0x53c549[_0x957c70(0x177)])throw new SDKError(ErrorCode[_0x957c70(0x181)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x46fbf3=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1c9f82[_0x957c70(0x179)][_0x957c70(0x1c4)](_0x53c549[_0x957c70(0x196)],_0x53c549['segmentId']),{'verbose':_0x49d14e[_0x957c70(0x1c1)]});await handleSingleObjectOutput(_0x46fbf3[_0x957c70(0x197)],_0x49d14e);}}}return 0x0;}catch(_0x5ef358){if(_0x5ef358 instanceof SDKError)return console['error'](_0x957c70(0x178)+_0x5ef358[_0x957c70(0x182)]),_0x5ef358[_0x957c70(0x1a7)]&&console[_0x957c70(0x18c)](_0x957c70(0x16f)+_0x5ef358[_0x957c70(0x1a7)]),0x1;throw _0x5ef358;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x15aaa8(0x1ad)]=a25_0x15aaa8(0x1ce);['description']=a25_0x15aaa8(0x17d);async[a25_0x15aaa8(0x173)](_0xd6c8f2){const _0x3d24e3=a25_0x15aaa8,{options:_0x2bfb65,args:_0x227edc,tdx:_0x471b0f}=_0xd6c8f2,_0x45996d=_0x227edc[0x0],_0x3b2972=!_0x45996d&&!!_0x2bfb65[_0x3d24e3(0x190)],_0x76d8d4=_0x45996d||_0x2bfb65[_0x3d24e3(0x190)];if(!_0x76d8d4)return console[_0x3d24e3(0x18c)](_0x3d24e3(0x18a)),console[_0x3d24e3(0x18c)](_0x3d24e3(0x19a)),console[_0x3d24e3(0x18c)](_0x3d24e3(0x17e)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x3d24e3(0x1b0)),console[_0x3d24e3(0x18c)](_0x3d24e3(0x1a4)),console[_0x3d24e3(0x18c)](_0x3d24e3(0x1c2)),0x1;try{const _0x4d722f=_0x2bfb65[_0x3d24e3(0x195)];let _0x277ab9=_0x76d8d4;!_0x3b2972&&_0x4d722f&&!_0x76d8d4['includes']('/')&&(_0x277ab9=_0x4d722f+'/'+_0x76d8d4,_0x2bfb65['verbose']&&console[_0x3d24e3(0x18c)](_0x3d24e3(0x184)+_0x277ab9));const _0x23b806=await withSpinner(_0x3d24e3(0x1a2)+_0x277ab9+_0x3d24e3(0x19c),()=>_0x471b0f[_0x3d24e3(0x179)][_0x3d24e3(0x18f)](_0x277ab9),{'verbose':_0x2bfb65['verbose']}),_0x1db230=_0x23b806['data'];_0x2bfb65['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x1db230[_0x3d24e3(0x1c0)]),console[_0x3d24e3(0x18c)]('Parent\x20ID:\x20'+_0x1db230[_0x3d24e3(0x196)]));if(_0x1db230['type']===_0x3d24e3(0x170))return console['error'](_0x3d24e3(0x1d1)),console[_0x3d24e3(0x18c)](_0x3d24e3(0x1cd)),0x1;let _0x3539ce;if(_0x1db230[_0x3d24e3(0x1c0)]===_0x3d24e3(0x1d8)){const _0x2da93b=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x471b0f[_0x3d24e3(0x179)][_0x3d24e3(0x1c3)](_0x1db230[_0x3d24e3(0x196)]),{'verbose':_0x2bfb65[_0x3d24e3(0x1c1)]});_0x3539ce=_0x2da93b['data'];}else{if(!_0x1db230['segmentId'])throw new SDKError(ErrorCode[_0x3d24e3(0x181)],_0x3d24e3(0x1c6));const _0x4baf60=await withSpinner(_0x3d24e3(0x1be),()=>_0x471b0f[_0x3d24e3(0x179)][_0x3d24e3(0x1a5)](_0x1db230[_0x3d24e3(0x196)],_0x1db230[_0x3d24e3(0x177)]),{'verbose':_0x2bfb65['verbose']});_0x3539ce=_0x4baf60[_0x3d24e3(0x197)];}const _0x1ef396=resolveLimit(_0x2bfb65['limit'],DEFAULT_DISPLAY_LIMIT),_0x1283b7=/\bLIMIT\s+\d+/i[_0x3d24e3(0x193)](_0x3539ce);!_0x1283b7&&(_0x3539ce=_0x3539ce['trim']()[_0x3d24e3(0x1ab)](/;+$/,''),_0x3539ce=_0x3d24e3(0x16e)+_0x3539ce+_0x3d24e3(0x1a6)+_0x1ef396);_0x2bfb65['verbose']&&console[_0x3d24e3(0x18c)]('SQL\x20query:\x0a'+_0x3539ce);const _0x798ecb=await withQuerySpinner(_0x3d24e3(0x1d6),async _0x1d465c=>{const _0x2b7aa1=_0x3d24e3,_0x4cfb6d=await _0x471b0f[_0x2b7aa1(0x1ac)][_0x2b7aa1(0x173)](_0x3539ce,{'catalog':'td','schema':_0x2b7aa1(0x176),'onJobId':_0x18c24e=>{const _0x41a918=_0x2b7aa1;_0x1d465c[_0x41a918(0x1c9)](_0x18c24e);}});return _0x4cfb6d;},{'verbose':_0x2bfb65[_0x3d24e3(0x1c1)]}),_0x4b2c04=_0x798ecb[_0x3d24e3(0x197)],_0x5b8376=_0x4b2c04['jobId']?_0x3d24e3(0x1ae)+_0x4b2c04[_0x3d24e3(0x1db)]+']':'';return console[_0x3d24e3(0x18c)](_0x3d24e3(0x17a)+_0x4b2c04['stats'][_0x3d24e3(0x1b7)]['toLocaleString']()+_0x3d24e3(0x1cb)+(_0x3d24e3(0x188)+formatElapsed(_0x4b2c04['stats'][_0x3d24e3(0x1d3)])+_0x5b8376)),await handleQueryOutput(_0x4b2c04,_0x2bfb65),0x0;}catch(_0x26a9e1){if(_0x26a9e1 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0x26a9e1[_0x3d24e3(0x19e)]+']'),console[_0x3d24e3(0x18c)]('\x0a'+_0x26a9e1[_0x3d24e3(0x182)]),0x1;throw _0x26a9e1;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x15aaa8(0x191);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x14b286){const _0x5e1552=a25_0x15aaa8,{options:_0x3378c2,args:_0x1a2219,tdx:_0x3d521e}=_0x14b286;if(_0x1a2219[_0x5e1552(0x1a9)]===0x0)return console[_0x5e1552(0x18c)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x46cc31=_0x1a2219[0x0];try{_0x3378c2['verbose']&&(console[_0x5e1552(0x18c)]('Site:\x20'+_0x3378c2['site']),console[_0x5e1552(0x18c)](_0x5e1552(0x17b)+_0x46cc31));const _0x263b9b=await withSpinner(_0x5e1552(0x1d0)+_0x46cc31+_0x5e1552(0x19c),()=>_0x3d521e[_0x5e1552(0x179)][_0x5e1552(0x1bd)](_0x46cc31),{'verbose':_0x3378c2[_0x5e1552(0x1c1)]}),_0x4871a9=_0x263b9b[_0x5e1552(0x197)];_0x3378c2[_0x5e1552(0x1c1)]&&console[_0x5e1552(0x18c)]('Resolved\x20parent\x20ID:\x20'+_0x4871a9);const _0x14719c=await withSpinner(_0x5e1552(0x1c7)+_0x46cc31+_0x5e1552(0x19c),()=>_0x3d521e[_0x5e1552(0x179)][_0x5e1552(0x1dc)](_0x4871a9),{'verbose':_0x3378c2[_0x5e1552(0x1c1)]}),_0x57d9d9=_0x14719c[_0x5e1552(0x197)];return console[_0x5e1552(0x18c)]('✔\x20Found\x20'+_0x57d9d9[_0x5e1552(0x1a9)]+'\x20folder'+(_0x57d9d9[_0x5e1552(0x1a9)]!==0x1?'s':'')),await handleSDKOutput(_0x57d9d9,_0x3378c2),0x0;}catch(_0x13b468){if(_0x13b468 instanceof SDKError)return console[_0x5e1552(0x18c)](_0x5e1552(0x178)+_0x13b468['message']),_0x13b468[_0x5e1552(0x1a7)]&&console[_0x5e1552(0x18c)](_0x5e1552(0x16f)+_0x13b468[_0x5e1552(0x1a7)]),0x1;throw _0x13b468;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x15aaa8(0x1ad)]='segment:folder:show';[a25_0x15aaa8(0x1ca)]=a25_0x15aaa8(0x1b5);async[a25_0x15aaa8(0x173)](_0x20fe75){const _0x51c4d3=a25_0x15aaa8,{options:_0x1f2d12,args:_0x117325,tdx:_0xa20f48}=_0x20fe75;if(_0x117325[_0x51c4d3(0x1a9)]===0x0)return console[_0x51c4d3(0x18c)](_0x51c4d3(0x1cc)),console['error'](_0x51c4d3(0x199)),0x1;try{const {parentId:_0x1ec915,childId:_0x5e18b3}=parseSegmentRef(_0x117325[0x0]);_0x1f2d12[_0x51c4d3(0x1c1)]&&(console['error']('Site:\x20'+_0x1f2d12[_0x51c4d3(0x1ba)]),console[_0x51c4d3(0x18c)](_0x51c4d3(0x17b)+_0x1ec915),_0x5e18b3&&console[_0x51c4d3(0x18c)](_0x51c4d3(0x17f)+_0x5e18b3));if(!_0x5e18b3)return console[_0x51c4d3(0x18c)](_0x51c4d3(0x19d)),0x1;const _0x27e23c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ec915+_0x51c4d3(0x19c),()=>_0xa20f48[_0x51c4d3(0x179)][_0x51c4d3(0x1bd)](_0x1ec915),{'verbose':_0x1f2d12['verbose']}),_0x257fcd=_0x27e23c[_0x51c4d3(0x197)];_0x1f2d12[_0x51c4d3(0x1c1)]&&console[_0x51c4d3(0x18c)]('Resolved\x20parent\x20ID:\x20'+_0x257fcd);const _0x361b9d=await withSpinner(_0x51c4d3(0x180)+_0x5e18b3+_0x51c4d3(0x19c),()=>_0xa20f48[_0x51c4d3(0x179)][_0x51c4d3(0x19f)](_0x257fcd,_0x5e18b3),{'verbose':_0x1f2d12['verbose']}),_0x52c856=_0x361b9d[_0x51c4d3(0x197)];_0x1f2d12[_0x51c4d3(0x1c1)]&&console[_0x51c4d3(0x18c)]('Resolved\x20folder\x20ID:\x20'+_0x52c856);const _0x3876b2=await withSpinner(_0x51c4d3(0x185)+_0x5e18b3+_0x51c4d3(0x19c),()=>_0xa20f48['segment'][_0x51c4d3(0x194)](_0x52c856),{'verbose':_0x1f2d12[_0x51c4d3(0x1c1)]});return await handleSDKOutput([_0x3876b2['data']],_0x1f2d12),0x0;}catch(_0x26bfef){if(_0x26bfef instanceof SDKError)return console['error'](_0x51c4d3(0x178)+_0x26bfef[_0x51c4d3(0x182)]),_0x26bfef[_0x51c4d3(0x1a7)]&&console[_0x51c4d3(0x18c)]('\x20\x20Cause:\x20'+_0x26bfef[_0x51c4d3(0x1a7)]),0x1;throw _0x26bfef;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a25_0x15aaa8(0x1b2);['description']=a25_0x15aaa8(0x16d);async[a25_0x15aaa8(0x173)](_0x275d2b){const _0x5c715a=a25_0x15aaa8,{options:_0x39abdc,args:_0x3ded75,tdx:_0x2a4355}=_0x275d2b,_0x33127d=_0x3ded75[0x0],_0x24be16=!_0x33127d&&!!_0x39abdc['parentSegment'],_0xfb8e21=_0x33127d||_0x39abdc[_0x5c715a(0x190)];if(!_0xfb8e21)return console[_0x5c715a(0x18c)](_0x5c715a(0x18a)),console[_0x5c715a(0x18c)](_0x5c715a(0x171)),console['error']('Examples:'),console[_0x5c715a(0x18c)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x5c715a(0x18c)](_0x5c715a(0x1a3)),console['error'](_0x5c715a(0x1b9)),console[_0x5c715a(0x18c)](_0x5c715a(0x1c2)),0x1;try{const _0x3a00b7=_0x39abdc[_0x5c715a(0x195)];let _0xc92fb7=_0xfb8e21;!_0x24be16&&_0x3a00b7&&!_0xfb8e21[_0x5c715a(0x1a8)]('/')&&(_0xc92fb7=_0x3a00b7+'/'+_0xfb8e21,_0x39abdc[_0x5c715a(0x1c1)]&&console['error'](_0x5c715a(0x184)+_0xc92fb7));const _0x43b794=await withSpinner(_0x5c715a(0x1a2)+_0xc92fb7+'\x27...',()=>_0x2a4355[_0x5c715a(0x179)][_0x5c715a(0x18f)](_0xc92fb7),{'verbose':_0x39abdc[_0x5c715a(0x1c1)]}),_0x250ca1=_0x43b794[_0x5c715a(0x197)];_0x39abdc['verbose']&&(console[_0x5c715a(0x18c)](_0x5c715a(0x198)+_0x250ca1['type']),console[_0x5c715a(0x18c)](_0x5c715a(0x1d2)+_0x250ca1[_0x5c715a(0x196)]));if(_0x250ca1['type']===_0x5c715a(0x170))return console[_0x5c715a(0x18c)](_0x5c715a(0x1b6)),console[_0x5c715a(0x18c)](_0x5c715a(0x172)),0x1;let _0x2694a0;if(_0x250ca1[_0x5c715a(0x1c0)]==='parent'){const _0x2bedd7=await withSpinner(_0x5c715a(0x187),()=>_0x2a4355[_0x5c715a(0x179)]['getParentSQL'](_0x250ca1[_0x5c715a(0x196)]),{'verbose':_0x39abdc[_0x5c715a(0x1c1)]});_0x2694a0=_0x2bedd7[_0x5c715a(0x197)];}else{if(!_0x250ca1[_0x5c715a(0x177)])throw new SDKError(ErrorCode[_0x5c715a(0x181)],_0x5c715a(0x1c6));const _0x3466ac=await withSpinner(_0x5c715a(0x1be),()=>_0x2a4355[_0x5c715a(0x179)][_0x5c715a(0x1a5)](_0x250ca1[_0x5c715a(0x196)],_0x250ca1['segmentId']),{'verbose':_0x39abdc['verbose']});_0x2694a0=_0x3466ac[_0x5c715a(0x197)];}return _0x39abdc['format']===_0x5c715a(0x1d4)||_0x39abdc[_0x5c715a(0x1d7)]==='jsonl'?await handleSDKOutput([{'sql':_0x2694a0}],_0x39abdc):console['log'](_0x2694a0),0x0;}catch(_0x554bf5){if(_0x554bf5 instanceof SDKError)return console[_0x5c715a(0x18c)](_0x5c715a(0x178)+_0x554bf5[_0x5c715a(0x182)]),_0x554bf5['cause']&&console[_0x5c715a(0x18c)](_0x5c715a(0x16f)+_0x554bf5[_0x5c715a(0x1a7)]),0x1;throw _0x554bf5;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x15aaa8(0x1ad)]=a25_0x15aaa8(0x1af);[a25_0x15aaa8(0x1ca)]='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x15aaa8(0x173)](_0x4b58b9){const _0x1a2046=a25_0x15aaa8,{options:_0x8db778,args:_0x2c68e9,tdx:_0x5ea963}=_0x4b58b9,_0x12b92b=_0x8db778;if(_0x2c68e9[_0x1a2046(0x1a9)]<0x2)return console[_0x1a2046(0x18c)](_0x1a2046(0x1a0)),console[_0x1a2046(0x18c)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x2fb101=_0x2c68e9[0x0],_0x4e6615=_0x2c68e9[0x1];_0x12b92b[_0x1a2046(0x1c1)]&&(console[_0x1a2046(0x18c)](_0x1a2046(0x183)+_0x12b92b[_0x1a2046(0x1ba)]),console[_0x1a2046(0x18c)](_0x1a2046(0x1b4)+_0x2fb101),console[_0x1a2046(0x18c)](_0x1a2046(0x17f)+_0x4e6615));let _0x285426;if(_0x12b92b[_0x1a2046(0x1aa)]){const _0x3990b0=_0x12b92b['parentFolder'],_0xe10687=await withSpinner(_0x1a2046(0x1d0)+_0x2fb101+_0x1a2046(0x19c),()=>_0x5ea963[_0x1a2046(0x179)][_0x1a2046(0x1bd)](_0x2fb101),{'verbose':_0x12b92b[_0x1a2046(0x1c1)]}),_0xb8efb9=_0xe10687[_0x1a2046(0x197)],_0x3507ef=await withSpinner(_0x1a2046(0x1b1)+_0x3990b0+_0x1a2046(0x19c),()=>_0x5ea963['segment'][_0x1a2046(0x19f)](_0xb8efb9,_0x3990b0),{'verbose':_0x12b92b[_0x1a2046(0x1c1)]});_0x285426=_0x3507ef[_0x1a2046(0x197)],_0x12b92b['verbose']&&console[_0x1a2046(0x18c)](_0x1a2046(0x174)+_0x285426);}const _0x163ece={'name':_0x4e6615,'description':_0x12b92b[_0x1a2046(0x1ca)],'parentFolderId':_0x285426},_0xff1b48=await withSpinner(_0x1a2046(0x1bc)+_0x4e6615+_0x1a2046(0x19c),()=>_0x5ea963[_0x1a2046(0x179)][_0x1a2046(0x1da)](_0x2fb101,_0x163ece),{'verbose':_0x12b92b[_0x1a2046(0x1c1)]}),_0xdb52f3=_0xff1b48[_0x1a2046(0x197)];return console[_0x1a2046(0x18c)]('✔\x20Created\x20folder\x20\x27'+_0xdb52f3['name']+_0x1a2046(0x1b8)+_0xdb52f3['id']),await handleSDKOutput([_0xdb52f3],_0x12b92b),0x0;}}
|
|
1
|
+
const a27_0x1b95de=a27_0x2789;(function(_0x15cb5f,_0x117af4){const _0x2b3b57=a27_0x2789,_0x303c66=_0x15cb5f();while(!![]){try{const _0x2e391f=-parseInt(_0x2b3b57(0x1ea))/0x1*(parseInt(_0x2b3b57(0x1e4))/0x2)+-parseInt(_0x2b3b57(0x1d1))/0x3+-parseInt(_0x2b3b57(0x1a0))/0x4*(parseInt(_0x2b3b57(0x1ae))/0x5)+-parseInt(_0x2b3b57(0x1cd))/0x6+-parseInt(_0x2b3b57(0x1ec))/0x7+parseInt(_0x2b3b57(0x1e6))/0x8+parseInt(_0x2b3b57(0x1a1))/0x9;if(_0x2e391f===_0x117af4)break;else _0x303c66['push'](_0x303c66['shift']());}catch(_0x494531){_0x303c66['push'](_0x303c66['shift']());}}}(a27_0x294b,0x5f318));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a27_0x2789(_0x1edf1a,_0x3bb117){const _0x294bad=a27_0x294b();return a27_0x2789=function(_0x278933,_0x3dba43){_0x278933=_0x278933-0x196;let _0x321290=_0x294bad[_0x278933];return _0x321290;},a27_0x2789(_0x1edf1a,_0x3bb117);}export class SegmentDescribeCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1b8);[a27_0x1b95de(0x1b6)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x1b95de(0x1b4)](_0x5a75af){const _0x55b987=a27_0x1b95de,{options:_0x5e59d1,args:_0xe0e1ea,tdx:_0x2440ba}=_0x5a75af,_0x1a8320=_0xe0e1ea[0x0],_0xe438f6=!_0x1a8320&&!!_0x5e59d1[_0x55b987(0x1d6)],_0x2cdf1b=_0x1a8320||_0x5e59d1[_0x55b987(0x1d6)];if(!_0x2cdf1b)return console[_0x55b987(0x1e2)](_0x55b987(0x1a3)),console[_0x55b987(0x1e2)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x55b987(0x1e2)](_0x55b987(0x1fc)),console[_0x55b987(0x1e2)](_0x55b987(0x1ee)),console[_0x55b987(0x1e2)](_0x55b987(0x1e0)),console[_0x55b987(0x1e2)](_0x55b987(0x1c3)),console[_0x55b987(0x1e2)](_0x55b987(0x208)),0x1;try{const _0x1e2cdd=_0x5e59d1['segmentPath'];let _0x53675e=_0x2cdf1b;!_0xe438f6&&_0x1e2cdd&&!_0x2cdf1b[_0x55b987(0x1a9)]('/')&&(_0x53675e=_0x1e2cdd+'/'+_0x2cdf1b,_0x5e59d1[_0x55b987(0x1dc)]&&console['error'](_0x55b987(0x1c4)+_0x53675e));const _0x4f9317=await withSpinner(_0x55b987(0x207)+_0x53675e+_0x55b987(0x1c8),()=>_0x2440ba['segment'][_0x55b987(0x1da)](_0x53675e),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]}),_0x32df5e=_0x4f9317['data'];_0x5e59d1[_0x55b987(0x1dc)]&&(console[_0x55b987(0x1e2)]('Resolved\x20type:\x20'+_0x32df5e['type']),console['error'](_0x55b987(0x1bb)+_0x32df5e[_0x55b987(0x1c2)]),_0x32df5e['folderId']&&console['error'](_0x55b987(0x1f5)+_0x32df5e['folderId']),_0x32df5e[_0x55b987(0x1c7)]&&console[_0x55b987(0x1e2)](_0x55b987(0x1e5)+_0x32df5e['segmentId']));if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x1af)){const _0x596dca=await withSpinner(_0x55b987(0x1d4),()=>_0x2440ba[_0x55b987(0x1e3)]['getParent'](_0x32df5e[_0x55b987(0x1c2)]),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]});await handleSingleObjectOutput(_0x596dca[_0x55b987(0x1a6)],_0x5e59d1);}else{if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x206)){if(!_0x32df5e[_0x55b987(0x209)])throw new SDKError(ErrorCode[_0x55b987(0x1f4)],_0x55b987(0x1e7));const _0x453875=await withSpinner(_0x55b987(0x1c9),()=>_0x2440ba[_0x55b987(0x1e3)][_0x55b987(0x1aa)](_0x32df5e['folderId']),{'verbose':_0x5e59d1['verbose']});await handleSingleObjectOutput(_0x453875[_0x55b987(0x1a6)],_0x5e59d1);}else{if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x1e3)){if(!_0x32df5e[_0x55b987(0x1c7)])throw new SDKError(ErrorCode[_0x55b987(0x1f4)],_0x55b987(0x201));const _0x4afe6d=await withSpinner(_0x55b987(0x1f7),()=>_0x2440ba[_0x55b987(0x1e3)]['getSegment'](_0x32df5e[_0x55b987(0x1c2)],_0x32df5e[_0x55b987(0x1c7)]),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]});await handleSingleObjectOutput(_0x4afe6d[_0x55b987(0x1a6)],_0x5e59d1);}}}return 0x0;}catch(_0x5d7e71){if(_0x5d7e71 instanceof SDKError)return console['error'](_0x55b987(0x1de)+_0x5d7e71[_0x55b987(0x19a)]),_0x5d7e71[_0x55b987(0x1e8)]&&console[_0x55b987(0x1e2)](_0x55b987(0x1e1)+_0x5d7e71[_0x55b987(0x1e8)]),0x1;throw _0x5d7e71;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1b2);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x1f0);async[a27_0x1b95de(0x1b4)](_0xbf8ccb){const _0x354a6f=a27_0x1b95de,{options:_0x1178e4,args:_0x4d4c44,tdx:_0x5d9b27}=_0xbf8ccb,_0x170c93=_0x4d4c44[0x0],_0x52d927=!_0x170c93&&!!_0x1178e4[_0x354a6f(0x1d6)],_0x96e230=_0x170c93||_0x1178e4[_0x354a6f(0x1d6)];if(!_0x96e230)return console['error'](_0x354a6f(0x1c5)),console[_0x354a6f(0x1e2)](_0x354a6f(0x1c0)),console['error'](_0x354a6f(0x1fc)),console[_0x354a6f(0x1e2)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x354a6f(0x1e2)](_0x354a6f(0x1a7)),console['error'](_0x354a6f(0x1ac)),console[_0x354a6f(0x1e2)](_0x354a6f(0x208)),0x1;try{const _0xc18811=_0x1178e4['segmentPath'];let _0x48d653=_0x96e230;!_0x52d927&&_0xc18811&&!_0x96e230[_0x354a6f(0x1a9)]('/')&&(_0x48d653=_0xc18811+'/'+_0x96e230,_0x1178e4[_0x354a6f(0x1dc)]&&console['error'](_0x354a6f(0x1c4)+_0x48d653));const _0x26ed36=await withSpinner(_0x354a6f(0x207)+_0x48d653+_0x354a6f(0x1c8),()=>_0x5d9b27['segment']['resolvePathToResource'](_0x48d653),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]}),_0x5cddab=_0x26ed36[_0x354a6f(0x1a6)];_0x1178e4[_0x354a6f(0x1dc)]&&(console[_0x354a6f(0x1e2)](_0x354a6f(0x1b5)+_0x5cddab[_0x354a6f(0x1eb)]),console['error'](_0x354a6f(0x1bb)+_0x5cddab[_0x354a6f(0x1c2)]));if(_0x5cddab[_0x354a6f(0x1eb)]===_0x354a6f(0x206))return console[_0x354a6f(0x1e2)](_0x354a6f(0x19f)),console[_0x354a6f(0x1e2)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x42033d;if(_0x5cddab[_0x354a6f(0x1eb)]==='parent'){const _0x46aaf8=await withSpinner(_0x354a6f(0x199),()=>_0x5d9b27[_0x354a6f(0x1e3)][_0x354a6f(0x1b1)](_0x5cddab[_0x354a6f(0x1c2)]),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]});_0x42033d=_0x46aaf8[_0x354a6f(0x1a6)];}else{if(!_0x5cddab[_0x354a6f(0x1c7)])throw new SDKError(ErrorCode[_0x354a6f(0x1f4)],_0x354a6f(0x201));const _0xc5263=await withSpinner(_0x354a6f(0x1cb),()=>_0x5d9b27[_0x354a6f(0x1e3)]['getSegmentSQL'](_0x5cddab[_0x354a6f(0x1c2)],_0x5cddab['segmentId']),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]});_0x42033d=_0xc5263[_0x354a6f(0x1a6)];}const _0x54e3d6=resolveLimit(_0x1178e4[_0x354a6f(0x1a4)],DEFAULT_DISPLAY_LIMIT),_0x1c0439=/\bLIMIT\s+\d+/i[_0x354a6f(0x1d3)](_0x42033d);!_0x1c0439&&(_0x42033d=_0x42033d['trim']()['replace'](/;+$/,''),_0x42033d=_0x354a6f(0x19d)+_0x42033d+_0x354a6f(0x1d9)+_0x54e3d6);_0x1178e4['verbose']&&console[_0x354a6f(0x1e2)](_0x354a6f(0x1cf)+_0x42033d);const _0x4daaa2=await withQuerySpinner(_0x354a6f(0x1ef),async _0x5774bb=>{const _0x5529d7=_0x354a6f,_0x586337=await _0x5d9b27[_0x5529d7(0x1c6)][_0x5529d7(0x1b4)](_0x42033d,{'catalog':'td','schema':_0x5529d7(0x202),'onJobId':_0x5cb5c4=>{_0x5774bb['setJobId'](_0x5cb5c4);}});return _0x586337;},{'verbose':_0x1178e4['verbose']}),_0x2b9c44=_0x4daaa2[_0x354a6f(0x1a6)],_0x67bf85=_0x2b9c44[_0x354a6f(0x1cc)]?_0x354a6f(0x198)+_0x2b9c44['jobId']+']':'';return console[_0x354a6f(0x1e2)](_0x354a6f(0x19e)+_0x2b9c44[_0x354a6f(0x20a)]['processedRows']['toLocaleString']()+'\x20rows\x20'+(_0x354a6f(0x1d7)+formatElapsed(_0x2b9c44[_0x354a6f(0x20a)][_0x354a6f(0x1a5)])+_0x67bf85)),await handleQueryOutput(_0x2b9c44,_0x1178e4),0x0;}catch(_0x407cad){if(_0x407cad instanceof SDKError)return console['error'](_0x354a6f(0x1ba)+_0x407cad[_0x354a6f(0x1b7)]+']'),console['error']('\x0a'+_0x407cad['message']),0x1;throw _0x407cad;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x1b95de(0x1c1);[a27_0x1b95de(0x1b6)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a27_0x1b95de(0x1b4)](_0x26d6f5){const _0x4cb6ff=a27_0x1b95de,{options:_0x4d7362,args:_0x57bb22,tdx:_0x53f584}=_0x26d6f5;if(_0x57bb22[_0x4cb6ff(0x1b9)]===0x0)return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1a8)),console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x20b)),0x1;const _0x34e336=_0x57bb22[0x0];try{_0x4d7362['verbose']&&(console['error'](_0x4cb6ff(0x1be)+_0x4d7362['site']),console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1b0)+_0x34e336));const _0x2e4abc=await withSpinner(_0x4cb6ff(0x1dd)+_0x34e336+'\x27...',()=>_0x53f584['segment']['resolveParentId'](_0x34e336),{'verbose':_0x4d7362[_0x4cb6ff(0x1dc)]}),_0x466f7d=_0x2e4abc[_0x4cb6ff(0x1a6)];_0x4d7362[_0x4cb6ff(0x1dc)]&&console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1f6)+_0x466f7d);const _0x5a2da8=await withSpinner(_0x4cb6ff(0x1d2)+_0x34e336+_0x4cb6ff(0x1c8),()=>_0x53f584['segment']['listFolders'](_0x466f7d),{'verbose':_0x4d7362[_0x4cb6ff(0x1dc)]}),_0x5eecb1=_0x5a2da8[_0x4cb6ff(0x1a6)];return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1ab)+_0x5eecb1[_0x4cb6ff(0x1b9)]+_0x4cb6ff(0x1fb)+(_0x5eecb1['length']!==0x1?'s':'')),await handleSDKOutput(_0x5eecb1,_0x4d7362),0x0;}catch(_0x23a65c){if(_0x23a65c instanceof SDKError)return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1de)+_0x23a65c['message']),_0x23a65c[_0x4cb6ff(0x1e8)]&&console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1e1)+_0x23a65c[_0x4cb6ff(0x1e8)]),0x1;throw _0x23a65c;}}}function a27_0x294b(){const _0x206e86=['\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20Cause:\x20','error','segment','361748Jrqbxp','Segment\x20ID:\x20','148200SCqpjC','Folder\x20ID\x20missing\x20from\x20resolved\x20path','cause','name','2NYYWUb','type','3887744zDJXQR','getSegmentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Executing\x20segment\x20query...','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved\x20parent\x20folder\x20ID:\x20','resolveParentId','log','INTERNAL','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Fetching\x20segment\x20details...','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Parent\x20segment:\x20','\x20folder','Examples:','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:folder:create','Segment\x20ID\x20missing\x20from\x20resolved\x20path','information_schema','format','Creating\x20folder\x20\x27','resolveFolderId','folder','Resolving\x20path\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folderId','stats','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20segment\x20folder\x20details','✔\x20Created\x20folder\x20\x27','\x20[Job\x20ID:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','message','Usage:\x20tdx\x20segment\x20sql\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','4BtCsLP','22925925WCKYBC','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Path\x20or\x20name\x20is\x20required','limit','elapsedTimeMillis','data','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','includes','getFolder','✔\x20Found\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20parent\x20folder\x20\x27','2125915kSFVIS','parent','Parent\x20name:\x20','getParentSQL','segment:show','site','execute','Resolved\x20type:\x20','description','code','segment:describe','length','✖\x20Query\x20failed\x20[','Parent\x20ID:\x20','segmentPath','Resolved\x20folder\x20ID:\x20','Site:\x20','json','Usage:\x20tdx\x20segment\x20show\x20<path>','segment:folder:list','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','query','segmentId','\x27...','Fetching\x20folder\x20details...','Folder\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','jobId','3041946xipwWp','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','SQL\x20query:\x0a','segment:sql','979872aUqXzw','Listing\x20folders\x20for\x20parent\x20\x27','test','Fetching\x20parent\x20segment\x20details...','Create\x20segment\x20folder\x20for\x20organization','parentSegment','in\x20','segment:folder:show','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','resolvePathToResource','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','verbose','Resolving\x20parent\x20segment\x20\x27','Error:\x20','\x27\x20with\x20ID:\x20'];a27_0x294b=function(){return _0x206e86;};return a27_0x294b();}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1d8);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x196);async[a27_0x1b95de(0x1b4)](_0x126955){const _0xf944af=a27_0x1b95de,{options:_0x107348,args:_0x194d73,tdx:_0x415b7a}=_0x126955;if(_0x194d73[_0xf944af(0x1b9)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xf944af(0x1e2)](_0xf944af(0x1f8)),0x1;try{const {parentId:_0x3b7d36,childId:_0x366265}=parseSegmentRef(_0x194d73[0x0]);_0x107348[_0xf944af(0x1dc)]&&(console[_0xf944af(0x1e2)]('Site:\x20'+_0x107348[_0xf944af(0x1b3)]),console[_0xf944af(0x1e2)]('Parent\x20name:\x20'+_0x3b7d36),_0x366265&&console[_0xf944af(0x1e2)]('Folder\x20name:\x20'+_0x366265));if(!_0x366265)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x13e282=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b7d36+_0xf944af(0x1c8),()=>_0x415b7a[_0xf944af(0x1e3)][_0xf944af(0x1f2)](_0x3b7d36),{'verbose':_0x107348['verbose']}),_0x18198a=_0x13e282[_0xf944af(0x1a6)];_0x107348[_0xf944af(0x1dc)]&&console[_0xf944af(0x1e2)]('Resolved\x20parent\x20ID:\x20'+_0x18198a);const _0x4e8fd3=await withSpinner(_0xf944af(0x1fd)+_0x366265+'\x27...',()=>_0x415b7a['segment'][_0xf944af(0x205)](_0x18198a,_0x366265),{'verbose':_0x107348[_0xf944af(0x1dc)]}),_0x4359e4=_0x4e8fd3[_0xf944af(0x1a6)];_0x107348['verbose']&&console['error'](_0xf944af(0x1bd)+_0x4359e4);const _0x3ffd9a=await withSpinner('Fetching\x20folder\x20\x27'+_0x366265+_0xf944af(0x1c8),()=>_0x415b7a[_0xf944af(0x1e3)][_0xf944af(0x1aa)](_0x4359e4),{'verbose':_0x107348['verbose']});return await handleSDKOutput([_0x3ffd9a[_0xf944af(0x1a6)]],_0x107348),0x0;}catch(_0x51ad5e){if(_0x51ad5e instanceof SDKError)return console[_0xf944af(0x1e2)]('Error:\x20'+_0x51ad5e[_0xf944af(0x19a)]),_0x51ad5e['cause']&&console[_0xf944af(0x1e2)]('\x20\x20Cause:\x20'+_0x51ad5e[_0xf944af(0x1e8)]),0x1;throw _0x51ad5e;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x1b95de(0x1d0);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x1ce);async[a27_0x1b95de(0x1b4)](_0x34b898){const _0x39bba6=a27_0x1b95de,{options:_0x5ddc86,args:_0x29a07e,tdx:_0xd66bf7}=_0x34b898,_0xa224b=_0x29a07e[0x0],_0x3bccfc=!_0xa224b&&!!_0x5ddc86[_0x39bba6(0x1d6)],_0x7bfaaa=_0xa224b||_0x5ddc86['parentSegment'];if(!_0x7bfaaa)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x39bba6(0x19b)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1fc)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1db)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1a2)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1fe)),console[_0x39bba6(0x1e2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x28effc=_0x5ddc86[_0x39bba6(0x1bc)];let _0x1537df=_0x7bfaaa;!_0x3bccfc&&_0x28effc&&!_0x7bfaaa[_0x39bba6(0x1a9)]('/')&&(_0x1537df=_0x28effc+'/'+_0x7bfaaa,_0x5ddc86['verbose']&&console['error'](_0x39bba6(0x1c4)+_0x1537df));const _0x273f1c=await withSpinner(_0x39bba6(0x207)+_0x1537df+_0x39bba6(0x1c8),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1da)](_0x1537df),{'verbose':_0x5ddc86[_0x39bba6(0x1dc)]}),_0x4f7a36=_0x273f1c[_0x39bba6(0x1a6)];_0x5ddc86[_0x39bba6(0x1dc)]&&(console[_0x39bba6(0x1e2)](_0x39bba6(0x1b5)+_0x4f7a36[_0x39bba6(0x1eb)]),console['error']('Parent\x20ID:\x20'+_0x4f7a36[_0x39bba6(0x1c2)]));if(_0x4f7a36[_0x39bba6(0x1eb)]===_0x39bba6(0x206))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x39bba6(0x1e2)](_0x39bba6(0x1ff)),0x1;let _0x377513;if(_0x4f7a36['type']==='parent'){const _0x48dbff=await withSpinner(_0x39bba6(0x199),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1b1)](_0x4f7a36['parentId']),{'verbose':_0x5ddc86[_0x39bba6(0x1dc)]});_0x377513=_0x48dbff['data'];}else{if(!_0x4f7a36[_0x39bba6(0x1c7)])throw new SDKError(ErrorCode[_0x39bba6(0x1f4)],_0x39bba6(0x201));const _0x42d6c8=await withSpinner(_0x39bba6(0x1cb),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1ed)](_0x4f7a36[_0x39bba6(0x1c2)],_0x4f7a36['segmentId']),{'verbose':_0x5ddc86['verbose']});_0x377513=_0x42d6c8[_0x39bba6(0x1a6)];}return _0x5ddc86[_0x39bba6(0x203)]===_0x39bba6(0x1bf)||_0x5ddc86[_0x39bba6(0x203)]==='jsonl'?await handleSDKOutput([{'sql':_0x377513}],_0x5ddc86):console[_0x39bba6(0x1f3)](_0x377513),0x0;}catch(_0x2d6124){if(_0x2d6124 instanceof SDKError)return console[_0x39bba6(0x1e2)](_0x39bba6(0x1de)+_0x2d6124[_0x39bba6(0x19a)]),_0x2d6124[_0x39bba6(0x1e8)]&&console[_0x39bba6(0x1e2)](_0x39bba6(0x1e1)+_0x2d6124['cause']),0x1;throw _0x2d6124;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x200);['description']=a27_0x1b95de(0x1d5);async[a27_0x1b95de(0x1b4)](_0xfa1b4c){const _0x3d5492=a27_0x1b95de,{options:_0x28e156,args:_0x285118,tdx:_0x4d5676}=_0xfa1b4c,_0x233c48=_0x28e156;if(_0x285118[_0x3d5492(0x1b9)]<0x2)return console[_0x3d5492(0x1e2)](_0x3d5492(0x1f9)),console[_0x3d5492(0x1e2)](_0x3d5492(0x19c)),0x1;const _0x20a8c5=_0x285118[0x0],_0x23f18c=_0x285118[0x1];_0x233c48[_0x3d5492(0x1dc)]&&(console['error'](_0x3d5492(0x1be)+_0x233c48[_0x3d5492(0x1b3)]),console[_0x3d5492(0x1e2)](_0x3d5492(0x1fa)+_0x20a8c5),console[_0x3d5492(0x1e2)](_0x3d5492(0x1ca)+_0x23f18c));let _0x49eaa5;if(_0x233c48['parentFolder']){const _0x47d96c=_0x233c48['parentFolder'],_0x3dc76d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x20a8c5+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)]['resolveParentId'](_0x20a8c5),{'verbose':_0x233c48[_0x3d5492(0x1dc)]}),_0x11990c=_0x3dc76d['data'],_0x57d2be=await withSpinner(_0x3d5492(0x1ad)+_0x47d96c+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)][_0x3d5492(0x205)](_0x11990c,_0x47d96c),{'verbose':_0x233c48['verbose']});_0x49eaa5=_0x57d2be[_0x3d5492(0x1a6)],_0x233c48['verbose']&&console['error'](_0x3d5492(0x1f1)+_0x49eaa5);}const _0x40ed29={'name':_0x23f18c,'description':_0x233c48['description'],'parentFolderId':_0x49eaa5},_0x526ac4=await withSpinner(_0x3d5492(0x204)+_0x23f18c+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)]['createFolder'](_0x20a8c5,_0x40ed29),{'verbose':_0x233c48[_0x3d5492(0x1dc)]}),_0x2691e1=_0x526ac4[_0x3d5492(0x1a6)];return console[_0x3d5492(0x1e2)](_0x3d5492(0x197)+_0x2691e1[_0x3d5492(0x1e9)]+_0x3d5492(0x1df)+_0x2691e1['id']),await handleSDKOutput([_0x2691e1],_0x233c48),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x590336=a28_0xceb6;function a28_0x104b(){const _0x485f3b=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolveParentId','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','1tzgoIQ','Creating\x20segment\x20\x27','description','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1093560esjJFD','4642740kEVyQL','ruleFile','verbose','createSegment','resolveFolderId','execute','data','Examples:','355ItVBUu','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20folder\x20ID:\x20','Segment\x20name:\x20','10820oAlrZy','segments','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','2064755zljvQp','15qorRcx','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','length','invisible','segment:create','parent','Resolving\x20folder\x20\x27','segment','24FGzRhS','includes','\x27...','resolvePathToResource','name','kind','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','noCountPopulation','965570brYETQ','folder','Parent:\x20','Target\x20path:\x20','8426GaVPnd','error','250552UosoJk','23982uTSQCp','folderId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27\x20with\x20ID:\x20','\x20\x20\x20Path:\x20','rule','8Jwsuva','type','site','Resolved\x20relative\x20path\x20to:\x20','segmentPath'];a28_0x104b=function(){return _0x485f3b;};return a28_0x104b();}(function(_0x1582a5,_0x653196){const _0x4e7c84=a28_0xceb6,_0x1f1ba1=_0x1582a5();while(!![]){try{const _0x5e4dd9=parseInt(_0x4e7c84(0x122))/0x1*(parseInt(_0x4e7c84(0x10d))/0x2)+-parseInt(_0x4e7c84(0x139))/0x3*(-parseInt(_0x4e7c84(0x113))/0x4)+-parseInt(_0x4e7c84(0x12f))/0x5*(parseInt(_0x4e7c84(0x114))/0x6)+parseInt(_0x4e7c84(0x138))/0x7+-parseInt(_0x4e7c84(0x11a))/0x8*(-parseInt(_0x4e7c84(0x127))/0x9)+-parseInt(_0x4e7c84(0x133))/0xa*(parseInt(_0x4e7c84(0x111))/0xb)+-parseInt(_0x4e7c84(0x104))/0xc*(-parseInt(_0x4e7c84(0x126))/0xd);if(_0x5e4dd9===_0x653196)break;else _0x1f1ba1['push'](_0x1f1ba1['shift']());}catch(_0x115591){_0x1f1ba1['push'](_0x1f1ba1['shift']());}}}(a28_0x104b,0xa1ba9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a28_0xceb6(_0x46c348,_0x11b968){const _0x104b64=a28_0x104b();return a28_0xceb6=function(_0xceb6a0,_0x4f019c){_0xceb6a0=_0xceb6a0-0xfd;let _0x550338=_0x104b64[_0xceb6a0];return _0x550338;},a28_0xceb6(_0x46c348,_0x11b968);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']=a28_0x590336(0x100);[a28_0x590336(0x124)]=a28_0x590336(0x130);async[a28_0x590336(0x12c)](_0x291282){const _0x147e8c=a28_0x590336,{options:_0x4809aa,args:_0x128da6,tdx:_0x4dce54}=_0x291282,_0x2681d9=_0x4809aa;if(_0x128da6[_0x147e8c(0xfe)]===0x0)return console[_0x147e8c(0x112)](_0x147e8c(0x10b)),console[_0x147e8c(0x112)](_0x147e8c(0x10a)),console[_0x147e8c(0x112)](_0x147e8c(0x12e)),console[_0x147e8c(0x112)](_0x147e8c(0x13a)),console[_0x147e8c(0x112)](_0x147e8c(0x11f)),console[_0x147e8c(0x112)](_0x147e8c(0x125)),0x1;const _0x544c0b=_0x128da6[0x0],_0xc66312=_0x4809aa[_0x147e8c(0x11e)];let _0x18663f=_0x544c0b;_0xc66312&&!_0x544c0b[_0x147e8c(0x105)]('/')&&(_0x18663f=_0xc66312+'/'+_0x544c0b,_0x2681d9['verbose']&&console[_0x147e8c(0x112)](_0x147e8c(0x11d)+_0x18663f));const _0x286e5e=parsePath(_0x18663f);if(_0x286e5e[_0x147e8c(0x134)][_0x147e8c(0xfe)]<0x2)return console[_0x147e8c(0x112)](_0x147e8c(0x137)),console[_0x147e8c(0x112)](_0x147e8c(0x121)),0x1;const _0x3637fc=_0x286e5e['segments'][0x0],_0x48f861=getBaseName(_0x18663f),_0x37f58a=getParentPath(_0x18663f);_0x2681d9[_0x147e8c(0x129)]&&(console['error']('Site:\x20'+_0x2681d9[_0x147e8c(0x11c)]),console[_0x147e8c(0x112)](_0x147e8c(0x110)+_0x18663f),console[_0x147e8c(0x112)](_0x147e8c(0x10f)+_0x3637fc),console[_0x147e8c(0x112)](_0x147e8c(0x132)+_0x48f861),console[_0x147e8c(0x112)](_0x147e8c(0xfd)+_0x37f58a));const _0x583350=await withSpinner(_0x147e8c(0x135)+_0x3637fc+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x120)](_0x3637fc),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x3e76ba=_0x583350[_0x147e8c(0x12d)];let _0xb1667b;if(_0x286e5e['segments'][_0x147e8c(0xfe)]>0x2){const _0x4c14dd=await withSpinner(_0x147e8c(0x136)+_0x37f58a+_0x147e8c(0x106),()=>_0x4dce54['segment'][_0x147e8c(0x107)](_0x37f58a),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x48e5e7=_0x4c14dd[_0x147e8c(0x12d)];if(_0x48e5e7[_0x147e8c(0x11b)]!==_0x147e8c(0x10e)&&_0x48e5e7[_0x147e8c(0x11b)]!==_0x147e8c(0x101))return console[_0x147e8c(0x112)](_0x147e8c(0x116)),0x1;_0xb1667b=_0x48e5e7[_0x147e8c(0x115)];}else{if(_0x2681d9[_0x147e8c(0x10e)]){const _0x8c5024=await withSpinner(_0x147e8c(0x102)+_0x2681d9['folder']+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x12b)](_0x3e76ba,_0x2681d9[_0x147e8c(0x10e)]),{'verbose':_0x2681d9[_0x147e8c(0x129)]});_0xb1667b=_0x8c5024[_0x147e8c(0x12d)];}}_0x2681d9[_0x147e8c(0x129)]&&_0xb1667b&&console['error'](_0x147e8c(0x131)+_0xb1667b);const _0xc7867b=await loadJSONFromOptions(_0x2681d9[_0x147e8c(0x119)],_0x2681d9[_0x147e8c(0x128)]),_0xcfcbd9={'name':_0x48f861,'description':_0x2681d9['description'],'rule':_0xc7867b,'kind':_0x2681d9[_0x147e8c(0x109)]!==undefined?parseInt(_0x2681d9[_0x147e8c(0x109)],0xa):undefined,'isVisible':_0x2681d9[_0x147e8c(0xff)]?![]:undefined,'segmentFolderId':_0xb1667b,'countPopulation':_0x2681d9[_0x147e8c(0x10c)]?![]:undefined},_0x507fb3=await withSpinner(_0x147e8c(0x123)+_0x48f861+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x12a)](_0x3e76ba,_0xcfcbd9),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x33bcb5=_0x507fb3['data'];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x33bcb5[_0x147e8c(0x108)]+_0x147e8c(0x117)+_0x33bcb5['id']),_0x18663f!==_0x544c0b&&console[_0x147e8c(0x112)](_0x147e8c(0x118)+_0x18663f),await handleSDKOutput([_0x33bcb5],_0x2681d9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x2ef354=a29_0x2c55;(function(_0x1f06c0,_0x3b6a2b){const _0x1455be=a29_0x2c55,_0x4cb512=_0x1f06c0();while(!![]){try{const _0x199362=parseInt(_0x1455be(0x1eb))/0x1+-parseInt(_0x1455be(0x1e2))/0x2+-parseInt(_0x1455be(0x1e4))/0x3+parseInt(_0x1455be(0x1e5))/0x4+-parseInt(_0x1455be(0x1e8))/0x5+-parseInt(_0x1455be(0x1ed))/0x6+-parseInt(_0x1455be(0x1f5))/0x7*(-parseInt(_0x1455be(0x1f3))/0x8);if(_0x199362===_0x3b6a2b)break;else _0x4cb512['push'](_0x4cb512['shift']());}catch(_0x5f2c94){_0x4cb512['push'](_0x4cb512['shift']());}}}(a29_0x2898,0xca9f2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x2c55(_0x26918d,_0x494602){const _0x28987f=a29_0x2898();return a29_0x2c55=function(_0x2c55f0,_0x2e3211){_0x2c55f0=_0x2c55f0-0x1df;let _0x20eb02=_0x28987f[_0x2c55f0];return _0x20eb02;},a29_0x2c55(_0x26918d,_0x494602);}export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x2ef354(0x1f0);[a29_0x2ef354(0x1ee)]=a29_0x2ef354(0x1f1);async['execute'](_0x147a0f){const _0x4fc79c=a29_0x2ef354,{options:_0x3b0d04,args:_0x21490c,tdx:_0x547b8e}=_0x147a0f,_0x13ab18=_0x21490c[0x0]||_0x3b0d04[_0x4fc79c(0x1e6)];if(!_0x13ab18)return console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e9)),console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1f4)),console['error'](_0x4fc79c(0x1f2)),0x1;_0x3b0d04['verbose']&&(console['error'](_0x4fc79c(0x1f6)+_0x3b0d04['site']),console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e1)+_0x13ab18));const _0x5d6e4a=await withSpinner(_0x4fc79c(0x1e7)+_0x13ab18+_0x4fc79c(0x1ec),()=>_0x547b8e[_0x4fc79c(0x1df)]['listFields'](_0x13ab18),{'verbose':_0x3b0d04[_0x4fc79c(0x1ea)]}),_0x4cd566=_0x5d6e4a['data'];return console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e3)+_0x4cd566[_0x4fc79c(0x1e0)]+'\x20field'+(_0x4cd566['length']!==0x1?'s':'')),await handleSDKOutput(_0x4cd566,_0x3b0d04),0x0;}}function a29_0x2898(){const _0x4559ba=['1612286cbrNZO','✔\x20Found\x20','2102694KfPNlV','6173144rOtlih','parentSegment','Listing\x20fields\x20for\x20\x27','1514630TeHwKx','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','731453eRCVmB','\x27...','9483276pGonpA','description','error','segment:fields','List\x20available\x20fields\x20for\x20segmentation','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','15565696fRGdzs','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','7fCfNeP','Site:\x20','segment','length','Parent\x20segment:\x20'];a29_0x2898=function(){return _0x4559ba;};return a29_0x2898();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a30_0x405b(_0x17116d,_0x298ba5){const _0x291375=a30_0x2913();return a30_0x405b=function(_0x405b50,_0x3960ed){_0x405b50=_0x405b50-0x1b5;let _0x32958f=_0x291375[_0x405b50];return _0x32958f;},a30_0x405b(_0x17116d,_0x298ba5);}function a30_0x2913(){const _0x3dfa12=['9GYctBn','4ysmCJl','1166bRAZLk','description','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','449896UEAubQ','1566020gjGTFM','Context\x20details:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','error','34671hJtlYI','526530TtKWcL','root','name','210uOBZIO','segment:pwd','format','jsonl','1652KeGnkc','log','\x20\x20Path:\x20','368072ClYnQh','segmentPath','json','Show\x20current\x20segment/folder\x20context','36jjoWKm','73428UoAlIn'];a30_0x2913=function(){return _0x3dfa12;};return a30_0x2913();}const a30_0x8a1c12=a30_0x405b;(function(_0x3594ec,_0x2c1c6e){const _0x5ef3d6=a30_0x405b,_0x3b1b53=_0x3594ec();while(!![]){try{const _0xb02987=-parseInt(_0x5ef3d6(0x1cc))/0x1+parseInt(_0x5ef3d6(0x1be))/0x2*(-parseInt(_0x5ef3d6(0x1c7))/0x3)+parseInt(_0x5ef3d6(0x1c8))/0x4*(-parseInt(_0x5ef3d6(0x1b7))/0x5)+-parseInt(_0x5ef3d6(0x1ba))/0x6*(parseInt(_0x5ef3d6(0x1b6))/0x7)+-parseInt(_0x5ef3d6(0x1c1))/0x8*(-parseInt(_0x5ef3d6(0x1c5))/0x9)+parseInt(_0x5ef3d6(0x1cd))/0xa+-parseInt(_0x5ef3d6(0x1c9))/0xb*(-parseInt(_0x5ef3d6(0x1c6))/0xc);if(_0xb02987===_0x2c1c6e)break;else _0x3b1b53['push'](_0x3b1b53['shift']());}catch(_0x4a796f){_0x3b1b53['push'](_0x3b1b53['shift']());}}}(a30_0x2913,0x3f0a9));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a30_0x8a1c12(0x1b9)]=a30_0x8a1c12(0x1bb);[a30_0x8a1c12(0x1ca)]=a30_0x8a1c12(0x1c4);async['execute'](_0x5bf1d8){const _0x33e072=a30_0x8a1c12,{options:_0x50a8b9}=_0x5bf1d8;try{const _0x412c59=_0x50a8b9[_0x33e072(0x1c2)];if(!_0x412c59)return _0x50a8b9['format']===_0x33e072(0x1c3)||_0x50a8b9[_0x33e072(0x1bc)]===_0x33e072(0x1bd)?console['log'](JSON['stringify']({'path':'/','type':_0x33e072(0x1b8)})):console[_0x33e072(0x1bf)]('/'),0x0;if(_0x50a8b9[_0x33e072(0x1bc)]==='json'||_0x50a8b9[_0x33e072(0x1bc)]===_0x33e072(0x1bd)){const _0x4e1454={'path':_0x412c59};console[_0x33e072(0x1bf)](JSON['stringify'](_0x4e1454));}else console[_0x33e072(0x1bf)](_0x412c59),_0x50a8b9['verbose']&&(console[_0x33e072(0x1b5)](''),console[_0x33e072(0x1b5)](_0x33e072(0x1ce)),console[_0x33e072(0x1b5)](_0x33e072(0x1c0)+_0x412c59),console[_0x33e072(0x1b5)](''),console[_0x33e072(0x1b5)](_0x33e072(0x1cf)),console['error'](_0x33e072(0x1cb)));return 0x0;}catch(_0x25257a){throw _0x25257a;}}}
|