@treasuredata/tdx 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +37 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +19 -3
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/pull-workflow.js.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +1 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x15a8b3=a4_0x1dc9;(function(_0x2ee0f6,_0x2ae361){const _0x12f41c=a4_0x1dc9,_0xe44d27=_0x2ee0f6();while(!![]){try{const _0x4bf4e7=-parseInt(_0x12f41c(0x258))/0x1*(-parseInt(_0x12f41c(0x27f))/0x2)+parseInt(_0x12f41c(0x278))/0x3+-parseInt(_0x12f41c(0x214))/0x4+parseInt(_0x12f41c(0x209))/0x5+parseInt(_0x12f41c(0x222))/0x6+-parseInt(_0x12f41c(0x1f6))/0x7+parseInt(_0x12f41c(0x241))/0x8*(parseInt(_0x12f41c(0x243))/0x9);if(_0x4bf4e7===_0x2ae361)break;else _0xe44d27['push'](_0xe44d27['shift']());}catch(_0x1833c3){_0xe44d27['push'](_0xe44d27['shift']());}}}(a4_0x3e4f,0xf3dde));import a4_0xba4cf from'chalk';import a4_0x1db266 from'path';function a4_0x3e4f(){const _0x23489d=['\x20total','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Summary:','\x0aWrite\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20--name\x20','1602336yudEyo','\x20created','red','pullAgent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','tdx.json','green','dim','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Push\x20cancelled','Pull\x20cancelled','\x20\x20Agent\x20\x22','✔\x20Context\x20set:\x20','log','outputDir','parse','force','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','No\x20tdx.json\x20found\x20in\x20','agent:clone','agentName','Errors:','Output\x20path:\x20','newProjectId','10431477nlfEiF','pullProject','knowledgeBases','Output:\x20','isNew','\x20=\x20','errors','INVALID_ARGUMENT','pushProject','cyan','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x22...','\x20\x20Source:\x20','counts','pushAgent','\x0aChanges\x20to\x20agent\x20\x27','Using\x20project:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','Agent:\x20','113785ZSfSYq','updated','execute','\x20\x20Target:\x20','\x20\x20Knowledge\x20Bases:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Clone\x20\x22','sourceProjectName','yellow','Project\x20cloned\x20with\x20errors','New\x20project\x20ID:\x20','1512480XvCnDc','push','\x20resources?','utf-8','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Chat:\x20','Project\x20cloned\x20successfully','Project:\x20','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Cloning\x20\x22','\x20--profile\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Agent\x20','267750HipWCY','error','session','outputPath','\x20\x20tdx\x20agent\x20clone\x20agents/','repeat','dirname','\x0a✔\x20Pulled\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','MISSING_ARGUMENT','Pulling\x20agent\x20\x22','agent:push','\x20new','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','created','New\x20project\x20name\x20is\x20required','textKnowledgeBases','Agent\x20pulled\x20successfully','\x22:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Agents:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','llm','projectName','llm_project','diff','dryRun','description','Using\x20project\x20from\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','yes','40AlpwXM','new','2026692yUEovl','name','site','\x20files\x20to\x20','\x20\x20tdx\x20agent\x20pull\x20','Would\x20clone:','action','Run\x20\x27tdx\x20agent\x20pull\x20','New\x20project:\x20','join','\x20successfully','Would\x20push\x20agent:\x20','Source:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','newProjectName','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','llmProject','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a✔\x20Pushed\x20','unchanged','agent.yml','1YjlKXq','gray','Status:\x20','\x0aPush\x20summary\x20for\x20\x27','hasChanges','\x22\x20to\x20\x22','\x20|\x20','\x0aErrors\x20found:','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','projectId','output','\x20\x20Prompts:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Clone\x20cancelled','\x20errors','prompts','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22\x20to\x20a\x20different\x20profile','cwd','Analyzing\x20project\x20\x22','\x20unchanged','agent:pull','cloneProject','Writing\x20files...','\x0aPush\x20','agents','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x20resources\x20to\x20\x27','\x0aChanges:','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x0aPull\x20summary\x20for\x20\x27','Using\x20local\x20project:\x20','2618157couGDX'];a4_0x3e4f=function(){return _0x23489d;};return a4_0x3e4f();}import{existsSync,readFileSync}from'fs';function a4_0x1dc9(_0x186f26,_0x5c0658){_0x186f26=_0x186f26-0x1ec;const _0x3e4f99=a4_0x3e4f();let _0x1dc9d0=_0x3e4f99[_0x186f26];return _0x1dc9d0;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x3c6311){const _0x18ba98=a4_0x1dc9,_0x11960e=[];if(_0x3c6311['total']!==undefined)_0x11960e['push'](_0x3c6311['total']+_0x18ba98(0x279));if(_0x3c6311['new']!==undefined&&_0x3c6311[_0x18ba98(0x242)]>0x0)_0x11960e[_0x18ba98(0x215)](a4_0xba4cf[_0x18ba98(0x285)](_0x3c6311[_0x18ba98(0x242)]+_0x18ba98(0x22e)));if(_0x3c6311[_0x18ba98(0x230)]!==undefined&&_0x3c6311[_0x18ba98(0x230)]>0x0)_0x11960e[_0x18ba98(0x215)](a4_0xba4cf['green'](_0x3c6311[_0x18ba98(0x230)]+_0x18ba98(0x280)));if(_0x3c6311[_0x18ba98(0x20a)]!==undefined&&_0x3c6311[_0x18ba98(0x20a)]>0x0)_0x11960e[_0x18ba98(0x215)](a4_0xba4cf[_0x18ba98(0x211)](_0x3c6311[_0x18ba98(0x20a)]+'\x20updated'));if(_0x3c6311[_0x18ba98(0x256)]!==undefined&&_0x3c6311[_0x18ba98(0x256)]>0x0)_0x11960e[_0x18ba98(0x215)](a4_0xba4cf[_0x18ba98(0x259)](_0x3c6311['unchanged']+_0x18ba98(0x26c)));if(_0x3c6311[_0x18ba98(0x1fc)]!==undefined&&_0x3c6311[_0x18ba98(0x1fc)]>0x0)_0x11960e['push'](a4_0xba4cf[_0x18ba98(0x281)](_0x3c6311[_0x18ba98(0x1fc)]+_0x18ba98(0x266)));return _0x11960e[_0x18ba98(0x24c)](',\x20');}function displayDiffs(_0x4a7b04,_0x45cc31,_0x2a840f,_0x1365d1){const _0x273f53=a4_0x1dc9;for(const _0x265c5b of _0x4a7b04){if(_0x265c5b[_0x273f53(0x23b)]){const _0x154eed=_0x265c5b[_0x273f53(0x1f2)]||_0x265c5b[_0x273f53(0x244)];console[_0x273f53(0x28c)](_0x273f53(0x205)+_0x154eed+'\x27:'),console['log']('─'[_0x273f53(0x227)](0x3c)),console[_0x273f53(0x28c)](_0x265c5b[_0x273f53(0x23b)]),console[_0x273f53(0x28c)]('─'[_0x273f53(0x227)](0x3c));}}for(const _0x477ebc of _0x45cc31){_0x477ebc['diff']&&(console[_0x273f53(0x28c)](_0x273f53(0x21d)+_0x477ebc[_0x273f53(0x244)]+'\x27:'),console[_0x273f53(0x28c)]('─'[_0x273f53(0x227)](0x3c)),console['log'](_0x477ebc[_0x273f53(0x23b)]),console[_0x273f53(0x28c)]('─'[_0x273f53(0x227)](0x3c)));}for(const _0xf15718 of _0x2a840f){_0xf15718[_0x273f53(0x23b)]&&(console['log'](_0x273f53(0x283)+_0xf15718['name']+'\x27:'),console[_0x273f53(0x28c)]('─'[_0x273f53(0x227)](0x3c)),console['log'](_0xf15718[_0x273f53(0x23b)]),console[_0x273f53(0x28c)]('─'['repeat'](0x3c)));}for(const _0x4fd30c of _0x1365d1){_0x4fd30c['diff']&&(console[_0x273f53(0x28c)](_0x273f53(0x1ee)+_0x4fd30c[_0x273f53(0x244)]+'\x27:'),console[_0x273f53(0x28c)]('─'[_0x273f53(0x227)](0x3c)),console[_0x273f53(0x28c)](_0x4fd30c[_0x273f53(0x23b)]),console[_0x273f53(0x28c)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x15a8b3(0x26d);[a4_0x15a8b3(0x23d)]=a4_0x15a8b3(0x23f);async[a4_0x15a8b3(0x20b)](_0xfeee31){const _0x19c35f=a4_0x15a8b3,{options:_0x3bf8ef,args:_0x4eb759,tdx:_0x5ba5fc}=_0xfeee31,_0x2d1136=_0x4eb759[0x0],_0x3b6b10=_0x4eb759[0x1],_0x27313a=_0x3bf8ef[_0x19c35f(0x262)],_0x563a18=_0x3bf8ef[_0x19c35f(0x23c)],_0x3e8f49=_0x3bf8ef[_0x19c35f(0x1ed)],_0x409797=_0x3bf8ef[_0x19c35f(0x240)],_0x33f79c=_0x3bf8ef['llmProject'];let _0x4ef587,_0x1ea18e;const _0x335898=findAgentConfigPath(process[_0x19c35f(0x26a)]());if(_0x2d1136){const _0x51b0e9=a4_0x1db266[_0x19c35f(0x24c)](_0x2d1136,'tdx.json');if(existsSync(_0x51b0e9))try{const _0x5b6244=JSON[_0x19c35f(0x1ec)](readFileSync(_0x51b0e9,_0x19c35f(0x217)));_0x4ef587=_0x5b6244[_0x19c35f(0x23a)],_0x1ea18e=_0x2d1136,console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x286)](_0x19c35f(0x23e)+_0x51b0e9+':\x20'+_0x4ef587));}catch{_0x4ef587=_0x2d1136;}else _0x4ef587=_0x2d1136;}else{if(_0x335898)try{const _0x3ba1a1=JSON['parse'](readFileSync(_0x335898,_0x19c35f(0x217)));_0x4ef587=_0x3ba1a1[_0x19c35f(0x23a)],_0x1ea18e=a4_0x1db266[_0x19c35f(0x228)](_0x335898),console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x286)](_0x19c35f(0x206)+_0x4ef587));}catch{_0x4ef587=_0x33f79c;}else _0x4ef587=_0x33f79c;}if(!_0x4ef587)return console[_0x19c35f(0x28c)](a4_0xba4cf['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x19c35f(0x28c)](_0x19c35f(0x20e)),console[_0x19c35f(0x28c)](_0x19c35f(0x1ef)),console[_0x19c35f(0x28c)](_0x19c35f(0x275)),console['log'](_0x19c35f(0x272)),0x1;if(_0x3b6b10){const {data:_0x10e09f}=await withSpinner(_0x19c35f(0x22c)+_0x3b6b10+'\x22\x20from\x20project\x20\x22'+_0x4ef587+_0x19c35f(0x201),()=>_0x5ba5fc['llm'][_0x19c35f(0x282)](_0x4ef587,_0x3b6b10,_0x27313a,{'dryRun':_0x563a18,'force':_0x3e8f49}));if(_0x563a18)return console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x211)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x19c35f(0x28c)]('Would\x20pull\x20agent:\x20'+_0x10e09f[_0x19c35f(0x1f2)]),console[_0x19c35f(0x28c)](_0x19c35f(0x1f4)+_0x10e09f['outputPath']),_0x10e09f[_0x19c35f(0x23b)]&&(console['log'](_0x19c35f(0x274)),console[_0x19c35f(0x28c)]('─'[_0x19c35f(0x227)](0x3c)),console[_0x19c35f(0x28c)](_0x10e09f[_0x19c35f(0x23b)]),console[_0x19c35f(0x28c)]('─'[_0x19c35f(0x227)](0x3c))),0x0;return console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x285)](_0x19c35f(0x233))),console['log']('Agent:\x20'+_0x10e09f[_0x19c35f(0x1f2)]),console[_0x19c35f(0x28c)](_0x19c35f(0x1f9)+_0x10e09f[_0x19c35f(0x225)]),console[_0x19c35f(0x28c)](_0x19c35f(0x25a)+(_0x10e09f[_0x19c35f(0x1fa)]?a4_0xba4cf['green'](_0x19c35f(0x242)):_0x10e09f[_0x19c35f(0x25c)]?a4_0xba4cf[_0x19c35f(0x211)](_0x19c35f(0x20a)):a4_0xba4cf[_0x19c35f(0x259)]('unchanged'))),0x0;}const _0x52bf15=_0x1ea18e||_0x27313a,{data:_0x541ef7}=await withSpinner(_0x19c35f(0x26b)+_0x4ef587+'\x22...',()=>_0x5ba5fc[_0x19c35f(0x238)][_0x19c35f(0x1f7)](_0x4ef587,_0x52bf15,{'dryRun':!![]})),_0x547eff=_0x541ef7['counts'][_0x19c35f(0x271)]['new']+_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x1f8)]['new']+_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x232)][_0x19c35f(0x242)]+_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x267)]['new'],_0x2b8991=_0x541ef7[_0x19c35f(0x203)]['agents'][_0x19c35f(0x20a)]+_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x1f8)]['updated']+_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x232)]['updated']+_0x541ef7[_0x19c35f(0x203)]['prompts']['updated'],_0x3bffc2=_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x271)]['unchanged']+_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x1f8)][_0x19c35f(0x256)]+_0x541ef7['counts'][_0x19c35f(0x232)][_0x19c35f(0x256)]+_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x267)][_0x19c35f(0x256)];console['log'](_0x19c35f(0x276)+_0x541ef7[_0x19c35f(0x239)]+'\x27:'),console[_0x19c35f(0x28c)]('\x20\x20'+a4_0xba4cf[_0x19c35f(0x285)]('+\x20'+_0x547eff+_0x19c35f(0x22e))+'\x20|\x20'+a4_0xba4cf[_0x19c35f(0x211)]('~\x20'+_0x2b8991+'\x20changed')+_0x19c35f(0x25e)+a4_0xba4cf['dim']('=\x20'+_0x3bffc2+_0x19c35f(0x26c))),console[_0x19c35f(0x28c)]('\x20\x20Agents:\x20'+formatCountSummary(_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x271)])),console[_0x19c35f(0x28c)](_0x19c35f(0x20d)+formatCountSummary(_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x1f8)])),console[_0x19c35f(0x28c)](_0x19c35f(0x207)+formatCountSummary(_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x232)])),console[_0x19c35f(0x28c)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x541ef7[_0x19c35f(0x203)][_0x19c35f(0x267)])),console['log'](_0x19c35f(0x20c)+a4_0xba4cf[_0x19c35f(0x1ff)](_0x541ef7[_0x19c35f(0x28d)])),displayDiffs(_0x541ef7[_0x19c35f(0x271)],_0x541ef7['knowledgeBases'],_0x541ef7[_0x19c35f(0x232)],_0x541ef7[_0x19c35f(0x267)]);if(_0x563a18)return console[_0x19c35f(0x28c)](a4_0xba4cf['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x547eff===0x0&&_0x2b8991===0x0)return console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x285)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x541ef7[_0x19c35f(0x239)]},_0x3bf8ef[_0x19c35f(0x224)]),console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x285)](_0x19c35f(0x28b)+a4_0xba4cf['dim'](_0x19c35f(0x23a))+_0x19c35f(0x1fb)+a4_0xba4cf['cyan'](_0x541ef7[_0x19c35f(0x239)]))),0x0;if(!_0x409797&&!_0x3e8f49){const _0x4c3e5d=await confirmKey(_0x19c35f(0x27c)+(_0x547eff+_0x2b8991)+'\x20files?');if(!_0x4c3e5d)return console[_0x19c35f(0x28c)](_0x19c35f(0x289)),0x0;}const {data:_0x30f2da}=await withSpinner(_0x19c35f(0x26f),()=>_0x5ba5fc[_0x19c35f(0x238)]['pullProject'](_0x4ef587,_0x52bf15,{'force':_0x3e8f49}));return console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x285)](_0x19c35f(0x229)+(_0x547eff+_0x2b8991)+_0x19c35f(0x246)+_0x30f2da[_0x19c35f(0x28d)])),saveSessionContext({'llm_project':_0x30f2da['projectName']},_0x3bf8ef[_0x19c35f(0x224)]),console[_0x19c35f(0x28c)](a4_0xba4cf[_0x19c35f(0x285)](_0x19c35f(0x28b)+a4_0xba4cf[_0x19c35f(0x286)]('llm_project')+_0x19c35f(0x1fb)+a4_0xba4cf[_0x19c35f(0x1ff)](_0x30f2da[_0x19c35f(0x239)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x15a8b3(0x244)]=a4_0x15a8b3(0x1f1);['description']=a4_0x15a8b3(0x250);async[a4_0x15a8b3(0x20b)](_0x1e037f){const _0x3c3595=a4_0x15a8b3,{options:_0x134917,args:_0x109753,tdx:_0x40a617}=_0x1e037f,_0x45d65f=_0x109753[0x0],_0x2fd1d3=_0x134917[_0x3c3595(0x244)],_0x520341=_0x134917[_0x3c3595(0x23c)],_0x4e0337=_0x134917[_0x3c3595(0x240)],_0xcde3c0=_0x134917[_0x3c3595(0x245)],_0x30f082=_0x134917[_0x3c3595(0x253)];let _0x3c10b7;const _0x296cd8=findAgentConfigPath(process[_0x3c3595(0x26a)]());if(_0x45d65f){const _0x220024=a4_0x1db266['join'](_0x45d65f,_0x3c3595(0x284));existsSync(_0x220024)?(_0x3c10b7=_0x45d65f,console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x286)](_0x3c3595(0x277)+_0x45d65f))):_0x3c10b7=_0x45d65f;}else{if(_0x296cd8)_0x3c10b7=a4_0x1db266[_0x3c3595(0x228)](_0x296cd8),console['log'](a4_0xba4cf['dim']('Using\x20current\x20project:\x20'+_0x3c10b7));else{if(_0x30f082){const _0x1c5d94=normalizeName(_0x30f082),_0x548957=a4_0x1db266[_0x3c3595(0x24c)](process[_0x3c3595(0x26a)](),'agents',_0x1c5d94,_0x3c3595(0x284));if(existsSync(_0x548957))_0x3c10b7=a4_0x1db266[_0x3c3595(0x228)](_0x548957),console[_0x3c3595(0x28c)](a4_0xba4cf['dim'](_0x3c3595(0x277)+_0x3c10b7));else{const _0x374039=_0x134917['profile'];if(_0x374039)throw new SDKError(ErrorCode[_0x3c3595(0x1fd)],_0x3c3595(0x27a)+_0x30f082+_0x3c3595(0x269),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x3c3595(0x237)+(_0x3c3595(0x247)+_0x30f082+'\x0a')+(_0x3c3595(0x226)+_0x1c5d94+_0x3c3595(0x27e)+(_0x2fd1d3||'<new-name>')+_0x3c3595(0x21f)+_0x374039)});_0x3c10b7=_0x30f082,console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x286)]('Using\x20context\x20project:\x20'+_0x30f082));}}}}if(!_0x3c10b7)return console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x211)](_0x3c3595(0x252))),console[_0x3c3595(0x28c)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x3c3595(0x28c)](_0x3c3595(0x287)),console[_0x3c3595(0x28c)](_0x3c3595(0x260)),console[_0x3c3595(0x28c)](_0x3c3595(0x220)),0x1;if(!_0x2fd1d3)throw new SDKError(ErrorCode[_0x3c3595(0x22b)],_0x3c3595(0x231),undefined,{'helpText':_0x3c3595(0x268)});if(!_0x4e0337&&!_0x520341){const _0x5666a7=await confirmKey(_0x3c3595(0x20f)+_0x3c10b7+'\x22\x20to\x20new\x20project\x20\x22'+_0x2fd1d3+'\x22?');if(!_0x5666a7)return console[_0x3c3595(0x28c)](_0x3c3595(0x265)),0x0;}const {data:_0x642e27}=await withSpinner(_0x3c3595(0x21e)+_0x3c10b7+_0x3c3595(0x25d)+_0x2fd1d3+'\x22...',()=>_0x40a617['llm'][_0x3c3595(0x26e)](_0x3c10b7,_0x2fd1d3,{'dryRun':_0x520341}));if(_0x520341)return console['log'](a4_0xba4cf['yellow'](_0x3c3595(0x235))),console[_0x3c3595(0x28c)](_0x3c3595(0x24f)+_0x642e27[_0x3c3595(0x210)]),console['log']('New\x20project:\x20'+_0x2fd1d3),console[_0x3c3595(0x28c)](_0x3c3595(0x248)),console['log']('\x20\x20Agents:\x20'+_0x642e27[_0x3c3595(0x203)]['agents'][_0x3c3595(0x230)]),console[_0x3c3595(0x28c)]('\x20\x20Knowledge\x20Bases:\x20'+_0x642e27[_0x3c3595(0x203)][_0x3c3595(0x1f8)][_0x3c3595(0x230)]),console['log'](_0x3c3595(0x263)+_0x642e27[_0x3c3595(0x203)]['prompts'][_0x3c3595(0x230)]),0x0;const _0x260dc0=_0x642e27[_0x3c3595(0x203)][_0x3c3595(0x271)]['errors']>0x0||_0x642e27['counts'][_0x3c3595(0x1f8)]['errors']>0x0||_0x642e27['counts'][_0x3c3595(0x267)][_0x3c3595(0x1fc)]>0x0;_0x260dc0?console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x211)](_0x3c3595(0x212))):console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x285)](_0x3c3595(0x21a)));console['log'](_0x3c3595(0x24f)+_0x642e27[_0x3c3595(0x210)]),console[_0x3c3595(0x28c)](_0x3c3595(0x24b)+_0x642e27[_0x3c3595(0x251)]),console['log'](_0x3c3595(0x213)+_0x642e27[_0x3c3595(0x1f5)]),console[_0x3c3595(0x28c)](),console['log'](_0x3c3595(0x27b)),console[_0x3c3595(0x28c)]('\x20\x20Agents:\x20'+formatCountSummary(_0x642e27[_0x3c3595(0x203)]['agents'])),console[_0x3c3595(0x28c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x642e27[_0x3c3595(0x203)]['knowledgeBases'])),console[_0x3c3595(0x28c)](_0x3c3595(0x263)+formatCountSummary(_0x642e27['counts'][_0x3c3595(0x267)]));if(_0x260dc0){console[_0x3c3595(0x28c)](),console['log'](a4_0xba4cf['red'](_0x3c3595(0x1f3)));for(const _0x171b06 of _0x642e27[_0x3c3595(0x271)]){_0x171b06[_0x3c3595(0x249)]==='error'&&console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x281)](_0x3c3595(0x28a)+_0x171b06['agentName']+_0x3c3595(0x234)+_0x171b06[_0x3c3595(0x223)]));}for(const _0x1abd74 of _0x642e27[_0x3c3595(0x1f8)]){_0x1abd74[_0x3c3595(0x249)]==='error'&&console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x281)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x1abd74[_0x3c3595(0x244)]+_0x3c3595(0x234)+_0x1abd74[_0x3c3595(0x223)]));}for(const _0x485cbc of _0x642e27[_0x3c3595(0x267)]){_0x485cbc[_0x3c3595(0x249)]===_0x3c3595(0x223)&&console[_0x3c3595(0x28c)](a4_0xba4cf[_0x3c3595(0x281)]('\x20\x20Prompt\x20\x22'+_0x485cbc['name']+_0x3c3595(0x234)+_0x485cbc[_0x3c3595(0x223)]));}return 0x1;}console['log']();const _0x5281ee=getLLMProjectUrl(_0xcde3c0,_0x642e27[_0x3c3595(0x1f5)]);return console['log']('Project:\x20'+a4_0xba4cf[_0x3c3595(0x1ff)](_0x5281ee)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x15a8b3(0x22d);['description']=a4_0x15a8b3(0x218);async[a4_0x15a8b3(0x20b)](_0x29b253){const _0xf2a324=a4_0x15a8b3,{options:_0x2b29d5,args:_0x942cdc,tdx:_0x4588a0}=_0x29b253;let _0x1de38b=_0x942cdc[0x0]||process[_0xf2a324(0x26a)]();const _0x4e6916=_0x2b29d5[_0xf2a324(0x23c)],_0x23494b=_0x2b29d5['force'],_0x3118ba=_0x2b29d5[_0xf2a324(0x240)],_0x49b310=_0x2b29d5[_0xf2a324(0x245)],_0x200bb8=a4_0x1db266[_0xf2a324(0x24c)](_0x1de38b,_0xf2a324(0x257)),_0x1d113c=existsSync(_0x200bb8);if(_0x1d113c){const {data:_0x5e4ba2}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x1de38b+_0xf2a324(0x201),()=>_0x4588a0['llm'][_0xf2a324(0x204)](_0x1de38b,{'dryRun':_0x4e6916,'force':_0x23494b}));if(_0x4e6916)return console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x211)](_0xf2a324(0x235))),console['log'](_0xf2a324(0x24e)+_0x5e4ba2['agentName']),0x0;if(_0x5e4ba2[_0xf2a324(0x249)]===_0xf2a324(0x223))return console['log'](a4_0xba4cf['red']('Failed\x20to\x20push\x20agent:\x20'+_0x5e4ba2['error'])),0x1;console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x285)](_0xf2a324(0x221)+_0x5e4ba2[_0xf2a324(0x249)]+_0xf2a324(0x24d))),console[_0xf2a324(0x28c)](_0xf2a324(0x208)+_0x5e4ba2[_0xf2a324(0x1f2)]);if(_0x5e4ba2['agentId']&&_0x5e4ba2[_0xf2a324(0x261)]){const _0x37bc4f=getLLMAgentChatUrl(_0x49b310,_0x5e4ba2[_0xf2a324(0x261)],_0x5e4ba2['agentId']);console[_0xf2a324(0x28c)](_0xf2a324(0x219)+a4_0xba4cf[_0xf2a324(0x1ff)](_0x37bc4f));}return 0x0;}let _0x2f0ba6=a4_0x1db266[_0xf2a324(0x24c)](_0x1de38b,_0xf2a324(0x284));if(!existsSync(_0x2f0ba6)){const _0x8aece=findAgentConfigPath(_0x1de38b);if(_0x8aece)_0x1de38b=a4_0x1db266[_0xf2a324(0x228)](_0x8aece),_0x2f0ba6=_0x8aece,console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x286)](_0xf2a324(0x206)+_0x1de38b));else{const _0x366fc4=_0x2b29d5[_0xf2a324(0x253)];if(_0x366fc4){const _0x64a29e=normalizeName(_0x366fc4),_0x22d4ac=a4_0x1db266[_0xf2a324(0x24c)](_0x1de38b,_0xf2a324(0x271)),_0x5d34b1=a4_0x1db266[_0xf2a324(0x24c)](_0x22d4ac,_0x64a29e,'tdx.json');existsSync(_0x5d34b1)&&(_0x1de38b=a4_0x1db266[_0xf2a324(0x228)](_0x5d34b1),_0x2f0ba6=_0x5d34b1,console['log'](a4_0xba4cf[_0xf2a324(0x286)](_0xf2a324(0x206)+_0x1de38b)));}if(!existsSync(_0x2f0ba6)){let _0x53fd86=_0xf2a324(0x264);_0x366fc4&&(_0x53fd86='Current\x20context\x20has\x20llm_project=\x22'+_0x366fc4+'\x22\x20but\x20no\x20local\x20folder\x20found.\x0a'+(_0xf2a324(0x24a)+_0x366fc4+_0xf2a324(0x22a)));throw new SDKError(ErrorCode[_0xf2a324(0x1fd)],_0xf2a324(0x1f0)+_0x1de38b,undefined,{'helpText':_0x53fd86});}}}const {data:_0x588a7a}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x4588a0[_0xf2a324(0x238)]['pushProject'](_0x1de38b,{'dryRun':!![]})),_0xaac923=_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x271)]['errors']>0x0;if(_0xaac923){console['log'](a4_0xba4cf[_0xf2a324(0x281)](_0xf2a324(0x25f)));for(const _0x17c16b of _0x588a7a[_0xf2a324(0x271)]){_0x17c16b[_0xf2a324(0x249)]===_0xf2a324(0x223)&&console[_0xf2a324(0x28c)](a4_0xba4cf['red'](_0xf2a324(0x28a)+_0x17c16b[_0xf2a324(0x1f2)]+_0xf2a324(0x234)+_0x17c16b['error']));}return 0x1;}const _0x4a2d07=_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x271)]['created']+_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x1f8)]['created']+_0x588a7a['counts'][_0xf2a324(0x232)][_0xf2a324(0x230)]+_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x267)][_0xf2a324(0x230)],_0x2fbf4e=_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x271)][_0xf2a324(0x20a)]+_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x1f8)]['updated']+_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x232)]['updated']+_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x267)][_0xf2a324(0x20a)],_0x344744=_0x588a7a['counts'][_0xf2a324(0x271)][_0xf2a324(0x256)]+_0x588a7a[_0xf2a324(0x203)]['knowledgeBases']['unchanged']+_0x588a7a['counts']['textKnowledgeBases'][_0xf2a324(0x256)]+_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x267)][_0xf2a324(0x256)];console['log'](_0xf2a324(0x25b)+_0x588a7a[_0xf2a324(0x239)]+'\x27:'),console[_0xf2a324(0x28c)]('\x20\x20'+a4_0xba4cf[_0xf2a324(0x285)]('+\x20'+_0x4a2d07+_0xf2a324(0x22e))+_0xf2a324(0x25e)+a4_0xba4cf['yellow']('~\x20'+_0x2fbf4e+'\x20changed')+'\x20|\x20'+a4_0xba4cf['dim']('=\x20'+_0x344744+_0xf2a324(0x26c))),console['log'](_0xf2a324(0x236)+formatCountSummary(_0x588a7a[_0xf2a324(0x203)]['agents'])),console[_0xf2a324(0x28c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x1f8)])),console[_0xf2a324(0x28c)](_0xf2a324(0x207)+formatCountSummary(_0x588a7a[_0xf2a324(0x203)]['textKnowledgeBases'])),console[_0xf2a324(0x28c)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x588a7a[_0xf2a324(0x203)][_0xf2a324(0x267)])),console['log'](_0xf2a324(0x202)+a4_0xba4cf[_0xf2a324(0x1ff)](_0x1de38b)),displayDiffs(_0x588a7a[_0xf2a324(0x271)],_0x588a7a[_0xf2a324(0x1f8)],_0x588a7a[_0xf2a324(0x232)],_0x588a7a[_0xf2a324(0x267)]);if(_0x4e6916)return console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x211)](_0xf2a324(0x22f))),0x0;if(_0x4a2d07===0x0&&_0x2fbf4e===0x0){console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x285)](_0xf2a324(0x254)));const _0x3eddb2=getLLMProjectUrl(_0x49b310,_0x588a7a[_0xf2a324(0x261)]);return console['log'](_0xf2a324(0x21b)+a4_0xba4cf[_0xf2a324(0x1ff)](_0x3eddb2)),0x0;}if(!_0x3118ba&&!_0x23494b){const _0x5ef095=await confirmKey(_0xf2a324(0x270)+(_0x4a2d07+_0x2fbf4e)+_0xf2a324(0x216));if(!_0x5ef095)return console[_0xf2a324(0x28c)](_0xf2a324(0x288)),0x0;}const {data:_0x3964c9}=await withSpinner('Pushing\x20to\x20project...',()=>_0x4588a0[_0xf2a324(0x238)][_0xf2a324(0x1fe)](_0x1de38b,{'force':_0x23494b})),_0x380ea2=_0x3964c9['counts'][_0xf2a324(0x271)][_0xf2a324(0x1fc)]>0x0||_0x3964c9['counts'][_0xf2a324(0x1f8)][_0xf2a324(0x1fc)]>0x0||_0x3964c9[_0xf2a324(0x203)][_0xf2a324(0x232)][_0xf2a324(0x1fc)]>0x0||_0x3964c9[_0xf2a324(0x203)][_0xf2a324(0x267)][_0xf2a324(0x1fc)]>0x0;if(_0x380ea2){console[_0xf2a324(0x28c)](a4_0xba4cf['yellow'](_0xf2a324(0x21c))),console['log'](),console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x281)]('Errors:'));for(const _0x14e854 of _0x3964c9['agents']){_0x14e854['action']===_0xf2a324(0x223)&&console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x281)](_0xf2a324(0x28a)+_0x14e854['agentName']+_0xf2a324(0x234)+_0x14e854[_0xf2a324(0x223)]));}for(const _0x526233 of _0x3964c9[_0xf2a324(0x1f8)]){_0x526233[_0xf2a324(0x249)]===_0xf2a324(0x223)&&console['log'](a4_0xba4cf[_0xf2a324(0x281)](_0xf2a324(0x27d)+_0x526233['name']+'\x22:\x20'+_0x526233[_0xf2a324(0x223)]));}for(const _0x25a0b6 of _0x3964c9['textKnowledgeBases']){_0x25a0b6[_0xf2a324(0x249)]===_0xf2a324(0x223)&&console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x281)](_0xf2a324(0x200)+_0x25a0b6[_0xf2a324(0x244)]+_0xf2a324(0x234)+_0x25a0b6[_0xf2a324(0x223)]));}for(const _0x2de71e of _0x3964c9[_0xf2a324(0x267)]){_0x2de71e[_0xf2a324(0x249)]==='error'&&console[_0xf2a324(0x28c)](a4_0xba4cf['red']('\x20\x20Prompt\x20\x22'+_0x2de71e['name']+'\x22:\x20'+_0x2de71e['error']));}return 0x1;}console[_0xf2a324(0x28c)](a4_0xba4cf[_0xf2a324(0x285)](_0xf2a324(0x255)+(_0x4a2d07+_0x2fbf4e)+_0xf2a324(0x273)+_0x3964c9[_0xf2a324(0x239)]+'\x27'));const _0x5d5dc2=getLLMProjectUrl(_0x49b310,_0x3964c9['projectId']);return console[_0xf2a324(0x28c)](_0xf2a324(0x21b)+a4_0xba4cf[_0xf2a324(0x1ff)](_0x5d5dc2)),0x0;}}
|
|
1
|
+
const a4_0x1295b4=a4_0x454c;(function(_0x4f7480,_0x255f3c){const _0x3b543f=a4_0x454c,_0xb6bc5b=_0x4f7480();while(!![]){try{const _0x4718f8=-parseInt(_0x3b543f(0x132))/0x1+parseInt(_0x3b543f(0x126))/0x2*(-parseInt(_0x3b543f(0xf4))/0x3)+parseInt(_0x3b543f(0x137))/0x4+-parseInt(_0x3b543f(0x10b))/0x5+parseInt(_0x3b543f(0xa3))/0x6+-parseInt(_0x3b543f(0xb7))/0x7*(parseInt(_0x3b543f(0xac))/0x8)+parseInt(_0x3b543f(0x9e))/0x9*(parseInt(_0x3b543f(0xf0))/0xa);if(_0x4718f8===_0x255f3c)break;else _0xb6bc5b['push'](_0xb6bc5b['shift']());}catch(_0x3c4f23){_0xb6bc5b['push'](_0xb6bc5b['shift']());}}}(a4_0x506c,0xbf924));import a4_0x1b05e3 from'chalk';import a4_0x2d4bec from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x454c(_0x5a811d,_0x413ccf){_0x5a811d=_0x5a811d-0x9b;const _0x506c63=a4_0x506c();let _0x454c65=_0x506c63[_0x5a811d];return _0x454c65;}import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../sdk/agent/agent-config.js';function a4_0x506c(){const _0x1a6725=['total','llm_project','\x20\x20tdx\x20agent\x20pull\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','4087864ebnXOL','Run\x20\x27tdx\x20agent\x20pull\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','execute','\x22\x20to\x20new\x20project\x20\x22','117dTDsdB','tdx.json','yellow','Agent:\x20','\x20files?','9028326ZUCloq','\x22\x20from\x20project\x20\x22','Output:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a','\x20\x20Source:\x20','\x0a✔\x20Pushed\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','error','8992nqMYAQ','agent:clone','✔\x20Context\x20set:\x20','dryRun','dim','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x22:\x20','Would\x20push\x20agent:\x20','Pull\x20cancelled','\x0aPush\x20','No\x20tdx.json\x20found\x20in\x20','7483JooarK','log','\x20resources?','projectName','\x0aPull\x20summary\x20for\x20\x27','agents','Dry\x20run\x20-\x20no\x20changes\x20made','isNew','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','outputDir','\x20files\x20to\x20','\x20\x20Knowledge\x20Bases:\x20','newProjectName','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Push\x20cancelled','\x20\x20Agent\x20\x22','red','textKnowledgeBases','Using\x20local\x20project:\x20','unchanged','<new-name>','prompts','pushAgent','\x0aWrite\x20','diff','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Would\x20pull\x20agent:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','llm','\x0aChanges:','\x20\x20Target:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20successfully','Status:\x20','\x20\x20Agents:\x20','force','join','\x20\x20Knowledge\x20Base\x20\x22','Project:\x20','action','Clone\x20cancelled','name','agent:pull','New\x20project\x20name\x20is\x20required','agent.yml','INVALID_ARGUMENT','hasChanges','Clone\x20\x22','yes','\x20=\x20','\x0aProject\x20pushed\x20with\x20errors','cwd','dirname','Failed\x20to\x20push\x20agent:\x20','new','cyan','session','1616820hMVnoo','created','Output\x20path:\x20','utf-8','66FKcmSb','\x22...','description','\x22\x20to\x20a\x20different\x20profile','\x20unchanged','Writing\x20files...','\x0aErrors\x20found:','knowledgeBases','counts','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','parse','\x22\x20to\x20\x22','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20changed','Errors:','updated','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','pushProject','\x20created','Analyzing\x20project\x20\x22','gray','agentId','green','6449315BvAUjy','New\x20project:\x20','\x20new','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','pullAgent','cloneProject','\x20\x20tdx\x20agent\x20clone\x20agents/','push','site','agentName','Pulling\x20agent\x20\x22','Using\x20project:\x20','\x20\x20Prompts:\x20','\x0a✔\x20Pulled\x20','outputPath','\x20total','\x20--name\x20','\x20\x20Prompt\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Summary:','\x20|\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aPush\x20summary\x20for\x20\x27','Cloning\x20\x22','\x20updated','101902bPCrxc','\x20--profile\x20','repeat','Using\x20project\x20from\x20','sourceProjectName','New\x20project\x20ID:\x20','projectId','profile','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','output','errors','Source:\x20','231536iqzjYQ'];a4_0x506c=function(){return _0x1a6725;};return a4_0x506c();}import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4f4692){const _0x4cdbdd=a4_0x454c,_0x1684c2=[];if(_0x4f4692[_0x4cdbdd(0x133)]!==undefined)_0x1684c2[_0x4cdbdd(0x112)](_0x4f4692[_0x4cdbdd(0x133)]+_0x4cdbdd(0x11a));if(_0x4f4692['new']!==undefined&&_0x4f4692[_0x4cdbdd(0xed)]>0x0)_0x1684c2[_0x4cdbdd(0x112)](a4_0x1b05e3[_0x4cdbdd(0x10a)](_0x4f4692[_0x4cdbdd(0xed)]+_0x4cdbdd(0x10d)));if(_0x4f4692['created']!==undefined&&_0x4f4692[_0x4cdbdd(0xf1)]>0x0)_0x1684c2['push'](a4_0x1b05e3[_0x4cdbdd(0x10a)](_0x4f4692[_0x4cdbdd(0xf1)]+_0x4cdbdd(0x106)));if(_0x4f4692[_0x4cdbdd(0x103)]!==undefined&&_0x4f4692['updated']>0x0)_0x1684c2[_0x4cdbdd(0x112)](a4_0x1b05e3[_0x4cdbdd(0xa0)](_0x4f4692[_0x4cdbdd(0x103)]+_0x4cdbdd(0x125)));if(_0x4f4692[_0x4cdbdd(0xca)]!==undefined&&_0x4f4692['unchanged']>0x0)_0x1684c2[_0x4cdbdd(0x112)](a4_0x1b05e3[_0x4cdbdd(0x108)](_0x4f4692[_0x4cdbdd(0xca)]+_0x4cdbdd(0xf8)));if(_0x4f4692[_0x4cdbdd(0x130)]!==undefined&&_0x4f4692[_0x4cdbdd(0x130)]>0x0)_0x1684c2[_0x4cdbdd(0x112)](a4_0x1b05e3['red'](_0x4f4692[_0x4cdbdd(0x130)]+'\x20errors'));return _0x1684c2['join'](',\x20');}function displayDiffs(_0x5f24dc,_0x12dda1,_0x419c95,_0x6d4d80){const _0x58c198=a4_0x454c;for(const _0x2ceb86 of _0x5f24dc){if(_0x2ceb86['diff']){const _0x1dee86=_0x2ceb86[_0x58c198(0x114)]||_0x2ceb86[_0x58c198(0xe0)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x1dee86+'\x27:'),console[_0x58c198(0xb8)]('─'['repeat'](0x3c)),console[_0x58c198(0xb8)](_0x2ceb86[_0x58c198(0xcf)]),console[_0x58c198(0xb8)]('─'[_0x58c198(0x128)](0x3c));}}for(const _0x7dd06b of _0x12dda1){_0x7dd06b['diff']&&(console[_0x58c198(0xb8)](_0x58c198(0x122)+_0x7dd06b['name']+'\x27:'),console['log']('─'[_0x58c198(0x128)](0x3c)),console['log'](_0x7dd06b[_0x58c198(0xcf)]),console['log']('─'[_0x58c198(0x128)](0x3c)));}for(const _0x5ef3f1 of _0x419c95){_0x5ef3f1[_0x58c198(0xcf)]&&(console[_0x58c198(0xb8)](_0x58c198(0xa6)+_0x5ef3f1['name']+'\x27:'),console[_0x58c198(0xb8)]('─'[_0x58c198(0x128)](0x3c)),console['log'](_0x5ef3f1[_0x58c198(0xcf)]),console['log']('─'['repeat'](0x3c)));}for(const _0x20e3fc of _0x6d4d80){_0x20e3fc['diff']&&(console[_0x58c198(0xb8)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x20e3fc[_0x58c198(0xe0)]+'\x27:'),console[_0x58c198(0xb8)]('─'[_0x58c198(0x128)](0x3c)),console[_0x58c198(0xb8)](_0x20e3fc[_0x58c198(0xcf)]),console[_0x58c198(0xb8)]('─'[_0x58c198(0x128)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1295b4(0xe0)]=a4_0x1295b4(0xe1);[a4_0x1295b4(0xf6)]=a4_0x1295b4(0xfd);async[a4_0x1295b4(0x9c)](_0x366741){const _0x54eb15=a4_0x1295b4,{options:_0x9c8c21,args:_0x2eb9df,tdx:_0x10dc82}=_0x366741,_0x5d38a6=_0x2eb9df[0x0],_0x38d4dd=_0x2eb9df[0x1],_0xef7cf9=_0x9c8c21[_0x54eb15(0x12f)],_0x1cf2e0=_0x9c8c21[_0x54eb15(0xaf)],_0x873b62=_0x9c8c21[_0x54eb15(0xda)],_0x56e615=_0x9c8c21[_0x54eb15(0xe7)],_0x1c145f=_0x9c8c21['llmProject'];let _0x2d5d99,_0x1d1358;const _0x482734=findAgentConfigPath(process[_0x54eb15(0xea)]());if(_0x5d38a6){const _0x2f8734=a4_0x2d4bec['join'](_0x5d38a6,_0x54eb15(0x9f));if(existsSync(_0x2f8734))try{const _0x3e59a2=JSON[_0x54eb15(0xfe)](readFileSync(_0x2f8734,_0x54eb15(0xf3)));_0x2d5d99=_0x3e59a2[_0x54eb15(0x134)],_0x1d1358=_0x5d38a6,console[_0x54eb15(0xb8)](a4_0x1b05e3[_0x54eb15(0xb0)](_0x54eb15(0x129)+_0x2f8734+':\x20'+_0x2d5d99));}catch{_0x2d5d99=_0x5d38a6;}else _0x2d5d99=_0x5d38a6;}else{if(_0x482734)try{const _0x5e0a07=JSON[_0x54eb15(0xfe)](readFileSync(_0x482734,_0x54eb15(0xf3)));_0x2d5d99=_0x5e0a07[_0x54eb15(0x134)],_0x1d1358=a4_0x2d4bec[_0x54eb15(0xeb)](_0x482734),console['log'](a4_0x1b05e3[_0x54eb15(0xb0)](_0x54eb15(0x116)+_0x2d5d99));}catch{_0x2d5d99=_0x1c145f;}else _0x2d5d99=_0x1c145f;}if(!_0x2d5d99)return console['log'](a4_0x1b05e3[_0x54eb15(0xa0)](_0x54eb15(0x104))),console[_0x54eb15(0xb8)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x54eb15(0xb8)](_0x54eb15(0x121)),console[_0x54eb15(0xb8)](_0x54eb15(0x11e)),console['log'](_0x54eb15(0xc4)),0x1;if(_0x38d4dd){const {data:_0x285e49}=await withSpinner(_0x54eb15(0x115)+_0x38d4dd+_0x54eb15(0xa4)+_0x2d5d99+_0x54eb15(0xf5),()=>_0x10dc82[_0x54eb15(0xd3)][_0x54eb15(0x10f)](_0x2d5d99,_0x38d4dd,_0xef7cf9,{'dryRun':_0x1cf2e0,'force':_0x873b62}));if(_0x1cf2e0)return console[_0x54eb15(0xb8)](a4_0x1b05e3[_0x54eb15(0xa0)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x54eb15(0xb8)](_0x54eb15(0xd1)+_0x285e49[_0x54eb15(0x114)]),console['log'](_0x54eb15(0xf2)+_0x285e49['outputPath']),_0x285e49[_0x54eb15(0xcf)]&&(console['log'](_0x54eb15(0xd4)),console[_0x54eb15(0xb8)]('─'[_0x54eb15(0x128)](0x3c)),console[_0x54eb15(0xb8)](_0x285e49['diff']),console['log']('─'[_0x54eb15(0x128)](0x3c))),0x0;return console[_0x54eb15(0xb8)](a4_0x1b05e3[_0x54eb15(0x10a)]('Agent\x20pulled\x20successfully')),console[_0x54eb15(0xb8)](_0x54eb15(0xa1)+_0x285e49[_0x54eb15(0x114)]),console['log'](_0x54eb15(0xa5)+_0x285e49[_0x54eb15(0x119)]),console[_0x54eb15(0xb8)](_0x54eb15(0xd8)+(_0x285e49[_0x54eb15(0xbe)]?a4_0x1b05e3[_0x54eb15(0x10a)](_0x54eb15(0xed)):_0x285e49[_0x54eb15(0xe5)]?a4_0x1b05e3[_0x54eb15(0xa0)]('updated'):a4_0x1b05e3[_0x54eb15(0x108)](_0x54eb15(0xca)))),0x0;}const _0x3aa3ac=_0x1d1358||_0xef7cf9,{data:_0x45b702}=await withSpinner(_0x54eb15(0x107)+_0x2d5d99+_0x54eb15(0xf5),()=>_0x10dc82[_0x54eb15(0xd3)]['pullProject'](_0x2d5d99,_0x3aa3ac,{'dryRun':!![]})),_0x35be98=_0x45b702[_0x54eb15(0xfc)]['agents'][_0x54eb15(0xed)]+_0x45b702['counts'][_0x54eb15(0xfb)][_0x54eb15(0xed)]+_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xc8)][_0x54eb15(0xed)]+_0x45b702['counts'][_0x54eb15(0xcc)][_0x54eb15(0xed)],_0x3d02c=_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xbc)][_0x54eb15(0x103)]+_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xfb)][_0x54eb15(0x103)]+_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xc8)]['updated']+_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xcc)][_0x54eb15(0x103)],_0x471011=_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xbc)][_0x54eb15(0xca)]+_0x45b702['counts'][_0x54eb15(0xfb)]['unchanged']+_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xc8)][_0x54eb15(0xca)]+_0x45b702[_0x54eb15(0xfc)]['prompts']['unchanged'];console[_0x54eb15(0xb8)](_0x54eb15(0xbb)+_0x45b702[_0x54eb15(0xba)]+'\x27:'),console[_0x54eb15(0xb8)]('\x20\x20'+a4_0x1b05e3[_0x54eb15(0x10a)]('+\x20'+_0x35be98+_0x54eb15(0x10d))+_0x54eb15(0x120)+a4_0x1b05e3[_0x54eb15(0xa0)]('~\x20'+_0x3d02c+_0x54eb15(0x101))+_0x54eb15(0x120)+a4_0x1b05e3[_0x54eb15(0xb0)]('=\x20'+_0x471011+_0x54eb15(0xf8))),console[_0x54eb15(0xb8)](_0x54eb15(0xd9)+formatCountSummary(_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xbc)])),console['log'](_0x54eb15(0xc2)+formatCountSummary(_0x45b702[_0x54eb15(0xfc)]['knowledgeBases'])),console[_0x54eb15(0xb8)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x45b702[_0x54eb15(0xfc)][_0x54eb15(0xc8)])),console[_0x54eb15(0xb8)](_0x54eb15(0x117)+formatCountSummary(_0x45b702[_0x54eb15(0xfc)]['prompts'])),console[_0x54eb15(0xb8)](_0x54eb15(0xd5)+a4_0x1b05e3['cyan'](_0x45b702['outputDir'])),displayDiffs(_0x45b702[_0x54eb15(0xbc)],_0x45b702[_0x54eb15(0xfb)],_0x45b702[_0x54eb15(0xc8)],_0x45b702[_0x54eb15(0xcc)]);if(_0x1cf2e0)return console['log'](a4_0x1b05e3[_0x54eb15(0xa0)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x35be98===0x0&&_0x3d02c===0x0)return console[_0x54eb15(0xb8)](a4_0x1b05e3[_0x54eb15(0x10a)](_0x54eb15(0xd6))),saveSessionContext({'llm_project':_0x45b702[_0x54eb15(0xba)]},_0x9c8c21['session']),console[_0x54eb15(0xb8)](a4_0x1b05e3[_0x54eb15(0x10a)](_0x54eb15(0xae)+a4_0x1b05e3[_0x54eb15(0xb0)](_0x54eb15(0x134))+_0x54eb15(0xe8)+a4_0x1b05e3[_0x54eb15(0xee)](_0x45b702[_0x54eb15(0xba)]))),0x0;if(!_0x56e615&&!_0x873b62){const _0xc780a2=await confirmKey(_0x54eb15(0xce)+(_0x35be98+_0x3d02c)+_0x54eb15(0xa2));if(!_0xc780a2)return console['log'](_0x54eb15(0xb4)),0x0;}const {data:_0x133775}=await withSpinner(_0x54eb15(0xf9),()=>_0x10dc82[_0x54eb15(0xd3)]['pullProject'](_0x2d5d99,_0x3aa3ac,{'force':_0x873b62}));return console[_0x54eb15(0xb8)](a4_0x1b05e3[_0x54eb15(0x10a)](_0x54eb15(0x118)+(_0x35be98+_0x3d02c)+_0x54eb15(0xc1)+_0x133775[_0x54eb15(0xc0)])),saveSessionContext({'llm_project':_0x133775[_0x54eb15(0xba)]},_0x9c8c21[_0x54eb15(0xef)]),console[_0x54eb15(0xb8)](a4_0x1b05e3[_0x54eb15(0x10a)](_0x54eb15(0xae)+a4_0x1b05e3[_0x54eb15(0xb0)](_0x54eb15(0x134))+_0x54eb15(0xe8)+a4_0x1b05e3[_0x54eb15(0xee)](_0x133775[_0x54eb15(0xba)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x1295b4(0xad);[a4_0x1295b4(0xf6)]=a4_0x1295b4(0xb1);async['execute'](_0xde18b1){const _0x9c0674=a4_0x1295b4,{options:_0x302747,args:_0x51db7e,tdx:_0x345ff5}=_0xde18b1,_0x442cb2=_0x51db7e[0x0],_0x1b5cb4=_0x302747['name'],_0x44f01c=_0x302747[_0x9c0674(0xaf)],_0x872c4=_0x302747[_0x9c0674(0xe7)],_0x3b5f5c=_0x302747['site'],_0x5dfab0=_0x302747['llmProject'];let _0x1bc104;const _0x511d88=findAgentConfigPath(process[_0x9c0674(0xea)]());if(_0x442cb2){const _0xce1f8a=a4_0x2d4bec[_0x9c0674(0xdb)](_0x442cb2,'tdx.json');existsSync(_0xce1f8a)?(_0x1bc104=_0x442cb2,console[_0x9c0674(0xb8)](a4_0x1b05e3['dim'](_0x9c0674(0xc9)+_0x442cb2))):_0x1bc104=_0x442cb2;}else{if(_0x511d88)_0x1bc104=a4_0x2d4bec[_0x9c0674(0xeb)](_0x511d88),console[_0x9c0674(0xb8)](a4_0x1b05e3['dim']('Using\x20current\x20project:\x20'+_0x1bc104));else{if(_0x5dfab0){const _0x53690f=normalizeName(_0x5dfab0),_0x25b951=a4_0x2d4bec[_0x9c0674(0xdb)](process['cwd'](),_0x9c0674(0xbc),_0x53690f,_0x9c0674(0x9f));if(existsSync(_0x25b951))_0x1bc104=a4_0x2d4bec[_0x9c0674(0xeb)](_0x25b951),console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0xb0)](_0x9c0674(0xc9)+_0x1bc104));else{const _0xb069f0=_0x302747[_0x9c0674(0x12d)];if(_0xb069f0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5dfab0+_0x9c0674(0xf7),undefined,{'helpText':_0x9c0674(0xd2)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x9c0674(0x135)+_0x5dfab0+'\x0a')+(_0x9c0674(0x111)+_0x53690f+_0x9c0674(0x11b)+(_0x1b5cb4||_0x9c0674(0xcb))+_0x9c0674(0x127)+_0xb069f0)});_0x1bc104=_0x5dfab0,console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0xb0)]('Using\x20context\x20project:\x20'+_0x5dfab0));}}}}if(!_0x1bc104)return console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0xa0)](_0x9c0674(0xbf))),console[_0x9c0674(0xb8)](_0x9c0674(0x12e)),console[_0x9c0674(0xb8)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x9c0674(0xb8)](_0x9c0674(0x100)),console[_0x9c0674(0xb8)](_0x9c0674(0xd0)),0x1;if(!_0x1b5cb4)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x9c0674(0xe2),undefined,{'helpText':_0x9c0674(0x11d)});if(!_0x872c4&&!_0x44f01c){const _0xea8ba2=await confirmKey(_0x9c0674(0xe6)+_0x1bc104+_0x9c0674(0x9d)+_0x1b5cb4+'\x22?');if(!_0xea8ba2)return console['log'](_0x9c0674(0xdf)),0x0;}const {data:_0x5df34b}=await withSpinner(_0x9c0674(0x124)+_0x1bc104+_0x9c0674(0xff)+_0x1b5cb4+_0x9c0674(0xf5),()=>_0x345ff5[_0x9c0674(0xd3)][_0x9c0674(0x110)](_0x1bc104,_0x1b5cb4,{'dryRun':_0x44f01c}));if(_0x44f01c)return console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0xa0)](_0x9c0674(0xbd))),console[_0x9c0674(0xb8)](_0x9c0674(0x131)+_0x5df34b[_0x9c0674(0x12a)]),console['log'](_0x9c0674(0x10c)+_0x1b5cb4),console['log']('Would\x20clone:'),console[_0x9c0674(0xb8)](_0x9c0674(0xd9)+_0x5df34b[_0x9c0674(0xfc)]['agents'][_0x9c0674(0xf1)]),console[_0x9c0674(0xb8)]('\x20\x20Knowledge\x20Bases:\x20'+_0x5df34b['counts'][_0x9c0674(0xfb)]['created']),console['log']('\x20\x20Prompts:\x20'+_0x5df34b['counts']['prompts'][_0x9c0674(0xf1)]),0x0;const _0x7d800e=_0x5df34b[_0x9c0674(0xfc)][_0x9c0674(0xbc)]['errors']>0x0||_0x5df34b[_0x9c0674(0xfc)][_0x9c0674(0xfb)]['errors']>0x0||_0x5df34b[_0x9c0674(0xfc)][_0x9c0674(0xcc)][_0x9c0674(0x130)]>0x0;_0x7d800e?console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0xa0)]('Project\x20cloned\x20with\x20errors')):console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0x10a)]('Project\x20cloned\x20successfully'));console['log']('Source:\x20'+_0x5df34b[_0x9c0674(0x12a)]),console[_0x9c0674(0xb8)]('New\x20project:\x20'+_0x5df34b[_0x9c0674(0xc3)]),console[_0x9c0674(0xb8)](_0x9c0674(0x12b)+_0x5df34b['newProjectId']),console['log'](),console[_0x9c0674(0xb8)](_0x9c0674(0x11f)),console[_0x9c0674(0xb8)](_0x9c0674(0xd9)+formatCountSummary(_0x5df34b[_0x9c0674(0xfc)]['agents'])),console[_0x9c0674(0xb8)](_0x9c0674(0xc2)+formatCountSummary(_0x5df34b['counts'][_0x9c0674(0xfb)])),console[_0x9c0674(0xb8)](_0x9c0674(0x117)+formatCountSummary(_0x5df34b[_0x9c0674(0xfc)][_0x9c0674(0xcc)]));if(_0x7d800e){console['log'](),console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0xc7)](_0x9c0674(0x102)));for(const _0x220066 of _0x5df34b[_0x9c0674(0xbc)]){_0x220066[_0x9c0674(0xde)]===_0x9c0674(0xab)&&console[_0x9c0674(0xb8)](a4_0x1b05e3['red'](_0x9c0674(0xc6)+_0x220066[_0x9c0674(0x114)]+_0x9c0674(0xb2)+_0x220066[_0x9c0674(0xab)]));}for(const _0x3df15f of _0x5df34b['knowledgeBases']){_0x3df15f[_0x9c0674(0xde)]===_0x9c0674(0xab)&&console['log'](a4_0x1b05e3['red'](_0x9c0674(0xdc)+_0x3df15f[_0x9c0674(0xe0)]+_0x9c0674(0xb2)+_0x3df15f['error']));}for(const _0x1de72e of _0x5df34b[_0x9c0674(0xcc)]){_0x1de72e[_0x9c0674(0xde)]==='error'&&console[_0x9c0674(0xb8)](a4_0x1b05e3[_0x9c0674(0xc7)](_0x9c0674(0x11c)+_0x1de72e[_0x9c0674(0xe0)]+_0x9c0674(0xb2)+_0x1de72e[_0x9c0674(0xab)]));}return 0x1;}console[_0x9c0674(0xb8)]();const _0x204dca=getLLMProjectUrl(_0x3b5f5c,_0x5df34b['newProjectId']);return console[_0x9c0674(0xb8)](_0x9c0674(0xdd)+a4_0x1b05e3['cyan'](_0x204dca)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1295b4(0xe0)]='agent:push';[a4_0x1295b4(0xf6)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0x24ebbf){const _0x16a15c=a4_0x1295b4,{options:_0x4e6f65,args:_0x4dc36d,tdx:_0x47249f}=_0x24ebbf;let _0x4b6759=_0x4dc36d[0x0]||process[_0x16a15c(0xea)]();const _0x4090e1=_0x4e6f65['dryRun'],_0x18bef7=_0x4e6f65[_0x16a15c(0xda)],_0x4b175e=_0x4e6f65[_0x16a15c(0xe7)],_0x2623e1=_0x4e6f65[_0x16a15c(0x113)],_0x4aec08=a4_0x2d4bec[_0x16a15c(0xdb)](_0x4b6759,_0x16a15c(0xe3)),_0x164718=existsSync(_0x4aec08);if(_0x164718){const {data:_0x3d1e3a}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x4b6759+_0x16a15c(0xf5),()=>_0x47249f['llm'][_0x16a15c(0xcd)](_0x4b6759,{'dryRun':_0x4090e1,'force':_0x18bef7}));if(_0x4090e1)return console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0xa0)](_0x16a15c(0xbd))),console[_0x16a15c(0xb8)](_0x16a15c(0xb3)+_0x3d1e3a['agentName']),0x0;if(_0x3d1e3a['action']===_0x16a15c(0xab))return console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0xc7)](_0x16a15c(0xec)+_0x3d1e3a[_0x16a15c(0xab)])),0x1;console['log'](a4_0x1b05e3[_0x16a15c(0x10a)]('Agent\x20'+_0x3d1e3a['action']+_0x16a15c(0xd7))),console[_0x16a15c(0xb8)](_0x16a15c(0xa1)+_0x3d1e3a['agentName']);if(_0x3d1e3a[_0x16a15c(0x109)]&&_0x3d1e3a[_0x16a15c(0x12c)]){const _0x116eed=getLLMAgentChatUrl(_0x2623e1,_0x3d1e3a[_0x16a15c(0x12c)],_0x3d1e3a[_0x16a15c(0x109)]);console[_0x16a15c(0xb8)]('Chat:\x20'+a4_0x1b05e3['cyan'](_0x116eed));}return 0x0;}let _0x3f0de2=a4_0x2d4bec['join'](_0x4b6759,_0x16a15c(0x9f));if(!existsSync(_0x3f0de2)){const _0x2a92fd=findAgentConfigPath(_0x4b6759);if(_0x2a92fd)_0x4b6759=a4_0x2d4bec['dirname'](_0x2a92fd),_0x3f0de2=_0x2a92fd,console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0xb0)](_0x16a15c(0x116)+_0x4b6759));else{const _0x633c0c=_0x4e6f65['llmProject'];if(_0x633c0c){const _0x9caf70=normalizeName(_0x633c0c),_0xf2256c=a4_0x2d4bec[_0x16a15c(0xdb)](_0x4b6759,'agents'),_0x2276f5=a4_0x2d4bec[_0x16a15c(0xdb)](_0xf2256c,_0x9caf70,_0x16a15c(0x9f));existsSync(_0x2276f5)&&(_0x4b6759=a4_0x2d4bec[_0x16a15c(0xeb)](_0x2276f5),_0x3f0de2=_0x2276f5,console[_0x16a15c(0xb8)](a4_0x1b05e3['dim'](_0x16a15c(0x116)+_0x4b6759)));}if(!existsSync(_0x3f0de2)){let _0x2b91ac=_0x16a15c(0x136);_0x633c0c&&(_0x2b91ac='Current\x20context\x20has\x20llm_project=\x22'+_0x633c0c+_0x16a15c(0xa7)+(_0x16a15c(0x138)+_0x633c0c+_0x16a15c(0x9b)));throw new SDKError(ErrorCode[_0x16a15c(0xe4)],_0x16a15c(0xb6)+_0x4b6759,undefined,{'helpText':_0x2b91ac});}}}const {data:_0xdad19c}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x47249f['llm']['pushProject'](_0x4b6759,{'dryRun':!![]})),_0x144492=_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xbc)][_0x16a15c(0x130)]>0x0;if(_0x144492){console[_0x16a15c(0xb8)](a4_0x1b05e3['red'](_0x16a15c(0xfa)));for(const _0x1148f6 of _0xdad19c['agents']){_0x1148f6['action']===_0x16a15c(0xab)&&console['log'](a4_0x1b05e3[_0x16a15c(0xc7)](_0x16a15c(0xc6)+_0x1148f6[_0x16a15c(0x114)]+'\x22:\x20'+_0x1148f6[_0x16a15c(0xab)]));}return 0x1;}const _0x3bda22=_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xbc)][_0x16a15c(0xf1)]+_0xdad19c['counts']['knowledgeBases'][_0x16a15c(0xf1)]+_0xdad19c['counts'][_0x16a15c(0xc8)][_0x16a15c(0xf1)]+_0xdad19c[_0x16a15c(0xfc)]['prompts'][_0x16a15c(0xf1)],_0x46ee74=_0xdad19c[_0x16a15c(0xfc)]['agents'][_0x16a15c(0x103)]+_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xfb)][_0x16a15c(0x103)]+_0xdad19c['counts'][_0x16a15c(0xc8)][_0x16a15c(0x103)]+_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xcc)][_0x16a15c(0x103)],_0x436c7d=_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xbc)][_0x16a15c(0xca)]+_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xfb)][_0x16a15c(0xca)]+_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xc8)][_0x16a15c(0xca)]+_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xcc)][_0x16a15c(0xca)];console['log'](_0x16a15c(0x123)+_0xdad19c['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x1b05e3[_0x16a15c(0x10a)]('+\x20'+_0x3bda22+_0x16a15c(0x10d))+_0x16a15c(0x120)+a4_0x1b05e3[_0x16a15c(0xa0)]('~\x20'+_0x46ee74+_0x16a15c(0x101))+_0x16a15c(0x120)+a4_0x1b05e3[_0x16a15c(0xb0)]('=\x20'+_0x436c7d+_0x16a15c(0xf8))),console['log'](_0x16a15c(0xd9)+formatCountSummary(_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xbc)])),console[_0x16a15c(0xb8)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xdad19c[_0x16a15c(0xfc)][_0x16a15c(0xfb)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xdad19c['counts'][_0x16a15c(0xc8)])),console[_0x16a15c(0xb8)](_0x16a15c(0x117)+formatCountSummary(_0xdad19c['counts'][_0x16a15c(0xcc)])),console[_0x16a15c(0xb8)](_0x16a15c(0xa8)+a4_0x1b05e3[_0x16a15c(0xee)](_0x4b6759)),displayDiffs(_0xdad19c[_0x16a15c(0xbc)],_0xdad19c[_0x16a15c(0xfb)],_0xdad19c[_0x16a15c(0xc8)],_0xdad19c[_0x16a15c(0xcc)]);if(_0x4090e1)return console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0xa0)](_0x16a15c(0x10e))),0x0;if(_0x3bda22===0x0&&_0x46ee74===0x0){console[_0x16a15c(0xb8)](a4_0x1b05e3['green'](_0x16a15c(0xaa)));const _0x1dab75=getLLMProjectUrl(_0x2623e1,_0xdad19c[_0x16a15c(0x12c)]);return console[_0x16a15c(0xb8)](_0x16a15c(0xdd)+a4_0x1b05e3['cyan'](_0x1dab75)),0x0;}if(!_0x4b175e&&!_0x18bef7){const _0x195cda=await confirmKey(_0x16a15c(0xb5)+(_0x3bda22+_0x46ee74)+_0x16a15c(0xb9));if(!_0x195cda)return console[_0x16a15c(0xb8)](_0x16a15c(0xc5)),0x0;}const {data:_0x39e5a7}=await withSpinner('Pushing\x20to\x20project...',()=>_0x47249f[_0x16a15c(0xd3)][_0x16a15c(0x105)](_0x4b6759,{'force':_0x18bef7})),_0x859824=_0x39e5a7[_0x16a15c(0xfc)][_0x16a15c(0xbc)]['errors']>0x0||_0x39e5a7[_0x16a15c(0xfc)][_0x16a15c(0xfb)]['errors']>0x0||_0x39e5a7[_0x16a15c(0xfc)][_0x16a15c(0xc8)]['errors']>0x0||_0x39e5a7['counts'][_0x16a15c(0xcc)][_0x16a15c(0x130)]>0x0;if(_0x859824){console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0xa0)](_0x16a15c(0xe9))),console[_0x16a15c(0xb8)](),console['log'](a4_0x1b05e3[_0x16a15c(0xc7)](_0x16a15c(0x102)));for(const _0x4a4d82 of _0x39e5a7['agents']){_0x4a4d82['action']===_0x16a15c(0xab)&&console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0xc7)](_0x16a15c(0xc6)+_0x4a4d82['agentName']+_0x16a15c(0xb2)+_0x4a4d82[_0x16a15c(0xab)]));}for(const _0x31b801 of _0x39e5a7[_0x16a15c(0xfb)]){_0x31b801[_0x16a15c(0xde)]===_0x16a15c(0xab)&&console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0xc7)](_0x16a15c(0xdc)+_0x31b801[_0x16a15c(0xe0)]+'\x22:\x20'+_0x31b801['error']));}for(const _0x5d36f5 of _0x39e5a7[_0x16a15c(0xc8)]){_0x5d36f5['action']==='error'&&console[_0x16a15c(0xb8)](a4_0x1b05e3['red']('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x5d36f5[_0x16a15c(0xe0)]+_0x16a15c(0xb2)+_0x5d36f5['error']));}for(const _0xdeb753 of _0x39e5a7[_0x16a15c(0xcc)]){_0xdeb753[_0x16a15c(0xde)]===_0x16a15c(0xab)&&console['log'](a4_0x1b05e3['red'](_0x16a15c(0x11c)+_0xdeb753[_0x16a15c(0xe0)]+'\x22:\x20'+_0xdeb753[_0x16a15c(0xab)]));}return 0x1;}console[_0x16a15c(0xb8)](a4_0x1b05e3[_0x16a15c(0x10a)](_0x16a15c(0xa9)+(_0x3bda22+_0x46ee74)+'\x20resources\x20to\x20\x27'+_0x39e5a7[_0x16a15c(0xba)]+'\x27'));const _0x3c10cd=getLLMProjectUrl(_0x2623e1,_0x39e5a7['projectId']);return console[_0x16a15c(0xb8)](_0x16a15c(0xdd)+a4_0x1b05e3[_0x16a15c(0xee)](_0x3c10cd)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a5_0x313c(_0x13ea73,_0x51b40b){_0x13ea73=_0x13ea73-0xdc;const _0xfe63eb=a5_0xfe63();let _0x313cd1=_0xfe63eb[_0x13ea73];return _0x313cd1;}const a5_0x36aded=a5_0x313c;(function(_0x37562b,_0x310992){const _0x48eebc=a5_0x313c,_0x52c156=_0x37562b();while(!![]){try{const _0x4cc77b=-parseInt(_0x48eebc(0xf3))/0x1+-parseInt(_0x48eebc(0xdf))/0x2+-parseInt(_0x48eebc(0xe0))/0x3+-parseInt(_0x48eebc(0xdd))/0x4*(-parseInt(_0x48eebc(0xe2))/0x5)+parseInt(_0x48eebc(0x119))/0x6*(parseInt(_0x48eebc(0xff))/0x7)+parseInt(_0x48eebc(0xf8))/0x8+parseInt(_0x48eebc(0x118))/0x9;if(_0x4cc77b===_0x310992)break;else _0x52c156['push'](_0x52c156['shift']());}catch(_0x15c8ca){_0x52c156['push'](_0x52c156['shift']());}}}(a5_0xfe63,0x41a99));function a5_0xfe63(){const _0x4799d0=['5864175kpjnfS','90zYhZtq','x-trino-user','api','workflow','PUT','has','186580aTmxRv','method','898524QuiQUu','1354638BuMgEk','log','10rJdFVu','.\x20Valid\x20methods:\x20','error','message','validate','POST','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','<\x20HTTP/1.1\x20','type','join','GET','entries','trim','toLowerCase','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','stack','Error:\x20','189474WDELrk','authorization','name','verbose','isArray','1127160OAgPlo','description','trino','readBodyFromFile','headers','Invalid\x20API\x20type:\x20','site','220955djbMFp','request','Results\x20saved\x20to\x20','.\x20Valid\x20types:\x20','Invalid\x20header\x20format:\x20\x22','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PATCH','length','set-cookie','color','proxy-authorization','includes','set-cookie2','output','cdp','llm','x-xsrf-token','Endpoint\x20must\x20start\x20with\x20/:\x20','data','body','substring','DELETE','startsWith','file','header'];a5_0xfe63=function(){return _0x4799d0;};return a5_0xfe63();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a5_0x36aded(0xf4),a5_0x36aded(0x109),'cookie',a5_0x36aded(0x107),a5_0x36aded(0x10b),a5_0x36aded(0x10f),'x-auth-token',a5_0x36aded(0x11a)]);function isSensitiveHeader(_0x4ba918){const _0x5ae0ce=a5_0x36aded;return SENSITIVE_HEADERS[_0x5ae0ce(0xdc)](_0x4ba918[_0x5ae0ce(0xef)]());}function parseHeader(_0x7b6e12){const _0x513083=a5_0x36aded,_0x2363ad=_0x7b6e12['indexOf'](':');if(_0x2363ad===-0x1)throw new Error(_0x513083(0x103)+_0x7b6e12+'\x22.\x20'+_0x513083(0x104));const _0x31467c=_0x7b6e12[_0x513083(0x113)](0x0,_0x2363ad)[_0x513083(0xee)](),_0x48fe53=_0x7b6e12[_0x513083(0x113)](_0x2363ad+0x1)[_0x513083(0xee)]();if(!_0x31467c)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x7b6e12+'\x22');return[_0x31467c,_0x48fe53];}export class ApiCommand extends BaseCommand{[a5_0x36aded(0xf5)]=a5_0x36aded(0x11b);[a5_0x36aded(0xf9)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a5_0x36aded(0xe6)](_0x5c7b76){const _0x1da3b9=a5_0x36aded,{args:_0x196f8a,options:_0x528482}=_0x5c7b76,_0x7ae59e=_0x528482;if(_0x196f8a[_0x1da3b9(0x106)]===0x0)return _0x1da3b9(0xf0);const _0x41f47e=_0x196f8a[0x0];if(!_0x41f47e[_0x1da3b9(0x115)]('/'))return _0x1da3b9(0x110)+_0x41f47e;const _0xaf575f=_0x7ae59e[_0x1da3b9(0x111)],_0xeecf8e=_0x7ae59e[_0x1da3b9(0x116)];if(_0xaf575f&&_0xeecf8e)return _0x1da3b9(0xe8);const _0x331ec7=_0x7ae59e[_0x1da3b9(0xde)]||_0x1da3b9(0xec),_0x47cae1=['GET',_0x1da3b9(0xe7),_0x1da3b9(0x11d),_0x1da3b9(0x114),_0x1da3b9(0x105)];if(!_0x47cae1[_0x1da3b9(0x10a)](_0x331ec7['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x331ec7+_0x1da3b9(0xe3)+_0x47cae1['join'](',\x20');const _0x1e7c5a=_0x7ae59e[_0x1da3b9(0xea)]||'td',_0x4ad83d=['td',_0x1da3b9(0x10d),_0x1da3b9(0x11c),_0x1da3b9(0xfa),_0x1da3b9(0x10e)];if(!_0x4ad83d[_0x1da3b9(0x10a)](_0x1e7c5a))return _0x1da3b9(0xfd)+_0x1e7c5a+_0x1da3b9(0x102)+_0x4ad83d[_0x1da3b9(0xeb)](',\x20');return undefined;}async['execute'](_0xf004e2){const _0x25f655=a5_0x36aded,{options:_0x346ec4,args:_0x386e76,tdx:_0x20e839}=_0xf004e2,_0x3d8ff3=_0x346ec4,_0x2de144=_0x386e76[0x0],_0x54a879=(_0x3d8ff3['method']||_0x25f655(0xec))['toUpperCase'](),_0x12f15c=_0x3d8ff3[_0x25f655(0x111)],_0x554145=_0x3d8ff3['file'],_0x58f63d=_0x3d8ff3[_0x25f655(0x117)],_0x3e00e6=_0x3d8ff3[_0x25f655(0xea)]||'td';try{const _0xa3fee9={};if(_0x58f63d){const _0x372add=Array[_0x25f655(0xf7)](_0x58f63d)?_0x58f63d:[_0x58f63d];for(const _0x3eed22 of _0x372add){const [_0x2e44e1,_0x140941]=parseHeader(_0x3eed22);_0xa3fee9[_0x2e44e1]=_0x140941;}}let _0x39ceba;if(_0x12f15c)_0x39ceba=_0x12f15c;else{if(_0x554145)try{_0x39ceba=RawAPI[_0x25f655(0xfb)](_0x554145);}catch(_0x58140b){return console[_0x25f655(0xe4)](_0x25f655(0xf2)+(_0x58140b instanceof Error?_0x58140b[_0x25f655(0xe5)]:String(_0x58140b))),0x1;}}const _0x5ee30d={'method':_0x54a879,'apiType':_0x3e00e6,'includeHeaders':_0x346ec4[_0x25f655(0xf6)]};_0x39ceba&&(_0x5ee30d[_0x25f655(0x112)]=_0x39ceba);Object['keys'](_0xa3fee9)[_0x25f655(0x106)]>0x0&&(_0x5ee30d[_0x25f655(0xfc)]=_0xa3fee9);if(_0x346ec4[_0x25f655(0xf6)]){const _0x1e2b07=resolveSite(_0x346ec4[_0x25f655(0xfe)]),_0x16097a=getEndpoint(_0x1e2b07,_0x3e00e6),_0x1fdc07=''+_0x16097a+_0x2de144;console['error']('>\x20'+_0x54a879+'\x20'+_0x1fdc07);const _0x5ca65d=getAuthHeaders(_0x1e2b07),_0x27be97={..._0x5ca65d,..._0xa3fee9};for(const [_0x15d23c,_0x5a5051]of Object[_0x25f655(0xed)](_0x27be97)){!isSensitiveHeader(_0x15d23c)&&console[_0x25f655(0xe4)]('>\x20'+_0x15d23c+':\x20'+_0x5a5051);}_0x39ceba&&console[_0x25f655(0xe4)]('>'),console[_0x25f655(0xe4)]('');}const _0x5c0480=await _0x20e839[_0x25f655(0x11b)][_0x25f655(0x100)](_0x2de144,_0x5ee30d);if(_0x346ec4[_0x25f655(0xf6)]&&_0x5c0480['headers']){console[_0x25f655(0xe4)](_0x25f655(0xe9)+_0x5c0480['status']);for(const [_0x1dfa35,_0xafc8a7]of Object[_0x25f655(0xed)](_0x5c0480['headers'])){!isSensitiveHeader(_0x1dfa35)&&console[_0x25f655(0xe4)]('<\x20'+_0x1dfa35+':\x20'+_0xafc8a7);}console['error']('');}const _0x27753c=Boolean(_0x346ec4[_0x25f655(0x10c)]),_0x68c895={'color':_0x346ec4[_0x25f655(0x108)],'noColor':_0x346ec4['noColor']||_0x27753c&&!_0x346ec4[_0x25f655(0x108)]},_0x605c39=colorizeJSON(_0x5c0480[_0x25f655(0x111)],_0x68c895);return _0x346ec4['output']?(writeFileSync(_0x346ec4[_0x25f655(0x10c)],_0x605c39),console[_0x25f655(0xe4)](_0x25f655(0x101)+_0x346ec4[_0x25f655(0x10c)])):console[_0x25f655(0xe1)](_0x605c39),0x0;}catch(_0x119531){return _0x119531 instanceof Error?(console[_0x25f655(0xe4)](_0x25f655(0xf2)+_0x119531[_0x25f655(0xe5)]),_0x346ec4[_0x25f655(0xf6)]&&_0x119531['stack']&&console[_0x25f655(0xe4)]('\x0aStack\x20trace:\x0a'+_0x119531[_0x25f655(0xf1)])):console[_0x25f655(0xe4)](_0x25f655(0xf2)+String(_0x119531)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0xe622f4=a6_0x1583;(function(_0x26a1fc,_0x27cdc3){const _0x4d0b0c=a6_0x1583,_0x377f23=_0x26a1fc();while(!![]){try{const _0x7fd960=parseInt(_0x4d0b0c(0x189))/0x1*(-parseInt(_0x4d0b0c(0x193))/0x2)+-parseInt(_0x4d0b0c(0x18f))/0x3*(-parseInt(_0x4d0b0c(0x19c))/0x4)+parseInt(_0x4d0b0c(0x173))/0x5+parseInt(_0x4d0b0c(0x165))/0x6*(-parseInt(_0x4d0b0c(0x166))/0x7)+parseInt(_0x4d0b0c(0x186))/0x8*(-parseInt(_0x4d0b0c(0x170))/0x9)+-parseInt(_0x4d0b0c(0x16d))/0xa*(parseInt(_0x4d0b0c(0x168))/0xb)+parseInt(_0x4d0b0c(0x17f))/0xc*(parseInt(_0x4d0b0c(0x163))/0xd);if(_0x7fd960===_0x27cdc3)break;else _0x377f23['push'](_0x377f23['shift']());}catch(_0x4d109c){_0x377f23['push'](_0x377f23['shift']());}}}(a6_0x4e4d,0x7b755));function a6_0x1583(_0x398a61,_0x5c0c21){_0x398a61=_0x398a61-0x14e;const _0x4e4db2=a6_0x4e4d();let _0x1583c6=_0x4e4db2[_0x398a61];return _0x1583c6;}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a6_0x221830 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a6_0x32dc4b from'chalk';function a6_0x4e4d(){const _0x528809=['N/A','4214040SUjEcY','7VoRGVJ','ERROR','907973TkZbWq','select','push','last_name','Enter\x20site\x20name:','20wQthKG','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','trim','432lusmHS','green','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','794790QZnaea','Name:\x20','description','create','bold','\x0aSetup\x20cancelled','\x20--profile\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','value','message','Enter\x20your\x20TD\x20API\x20key:','getUserInfo','13971420RHxqOo','jp\x20\x20\x20-\x20Japan','password','execute','tdx\x20profile:\x20','profile','User:\x20','107960Qgytec','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Enter\x20custom\x20site','2143lUjrHa','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','filter','auth:clear','apiKey','3HFcyon','System\x20keychain\x20is\x20not\x20available','You\x20can\x20find\x20your\x20API\x20key\x20at:','email','514IPdRLh','logLevel','Read\x20credential\x20from\x20','us01','yellow','eu01','\x20(site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','name','336376jSOEoq','\x27\x20registered','log','site','join','tdx:\x20auth\x20clear','ap02','customSite','No\x20credential\x20found','✓\x20Profile\x20\x27','jp01','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','red','findIndex','eu\x20\x20\x20-\x20Europe','error','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','\x20for\x20profile:\x20','Validating\x20API\x20key...','auth:setup','status','test','API\x20key\x20cannot\x20be\x20empty','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20(profile:\x20','other','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Select\x20your\x20Treasure\x20Data\x20site:','Setup\x20API\x20key\x20authentication\x20interactively','No\x20API\x20key\x20found\x20in\x20keychain','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20\x20tdx','length','Site\x20name\x20cannot\x20be\x20empty','26KZwtsT'];a6_0x4e4d=function(){return _0x528809;};return a6_0x4e4d();}export class AuthSetupCommand extends BaseCommand{[a6_0xe622f4(0x19b)]=a6_0xe622f4(0x154);[a6_0xe622f4(0x175)]=a6_0xe622f4(0x15d);async[a6_0xe622f4(0x182)](_0x2128de){const _0x1cea3d=a6_0xe622f4,{options:_0x29fd88}=_0x2128de,_0x256cdc=_0x29fd88[_0x1cea3d(0x184)];console[_0x1cea3d(0x19e)](a6_0x32dc4b['bold']('tdx:\x20auth\x20setup'));const _0x36488b=_0x29fd88['site']||_0x1cea3d(0x196),_0x58b063=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x1cea3d(0x196)},{'title':_0x1cea3d(0x180),'value':_0x1cea3d(0x1a6)},{'title':_0x1cea3d(0x14e),'value':_0x1cea3d(0x198)},{'title':'ap02\x20-\x20Korea','value':_0x1cea3d(0x1a2)}];let _0x45423a=_0x58b063[_0x1cea3d(0x1a9)](_0x5117ad=>_0x5117ad[_0x1cea3d(0x17b)]===_0x36488b);_0x45423a===-0x1&&_0x36488b!==_0x1cea3d(0x196)&&(_0x58b063['push']({'title':_0x36488b,'value':_0x36488b}),_0x45423a=_0x58b063[_0x1cea3d(0x161)]-0x1);_0x58b063[_0x1cea3d(0x16a)]({'title':_0x1cea3d(0x188),'value':_0x1cea3d(0x15a)});const _0x1e3b9d=_0x256cdc?_0x1cea3d(0x15b)+_0x256cdc+'):':_0x1cea3d(0x15c),_0x130fae=await a6_0x221830({'type':_0x1cea3d(0x169),'name':'site','message':_0x1e3b9d,'choices':_0x58b063,'initial':_0x45423a>=0x0?_0x45423a:0x0});if(!_0x130fae['site'])return console[_0x1cea3d(0x19e)](_0x1cea3d(0x178)),0x1;let _0x590356;if(_0x130fae[_0x1cea3d(0x19f)]===_0x1cea3d(0x15a)){const _0x52d93f=await a6_0x221830({'type':'text','name':_0x1cea3d(0x1a3),'message':_0x1cea3d(0x16c),'initial':_0x1cea3d(0x196),'validate':_0x5912ac=>{const _0xdce4f1=_0x1cea3d;if(!_0x5912ac||!_0x5912ac[_0xdce4f1(0x16f)]())return _0xdce4f1(0x162);if(!/^[a-z0-9-]+$/[_0xdce4f1(0x156)](_0x5912ac[_0xdce4f1(0x16f)]()))return _0xdce4f1(0x15f);return!![];}});if(!_0x52d93f['customSite'])return console[_0x1cea3d(0x19e)](_0x1cea3d(0x178)),0x1;_0x590356=_0x52d93f[_0x1cea3d(0x1a3)];}else _0x590356=_0x130fae[_0x1cea3d(0x19f)];const _0x1b0101=resolveSite(_0x590356);console['log'](_0x1cea3d(0x158)+_0x1b0101),console['log'](_0x1cea3d(0x191)),console[_0x1cea3d(0x19e)]('\x20\x20'+getConsoleUrl(_0x1b0101,'/app/mp/ak'));const _0x505094=await a6_0x221830({'type':_0x1cea3d(0x181),'name':'apiKey','message':_0x1cea3d(0x17d),'validate':_0x155d6d=>{const _0x38a9ee=_0x1cea3d;if(!_0x155d6d||!_0x155d6d[_0x38a9ee(0x16f)]())return _0x38a9ee(0x157);return!![];}});if(!_0x505094[_0x1cea3d(0x18e)])return console[_0x1cea3d(0x19e)](_0x1cea3d(0x178)),0x1;const _0x406eac=_0x505094['apiKey'];console[_0x1cea3d(0x19e)](_0x1cea3d(0x153));try{const _0x339e0d=TDX[_0x1cea3d(0x176)]({'site':_0x1b0101,'apiKey':_0x406eac[_0x1cea3d(0x16f)](),'logLevel':_0x29fd88[_0x1cea3d(0x194)]??LogLevel[_0x1cea3d(0x167)]}),_0xc9a5af=await _0x339e0d['jobs'][_0x1cea3d(0x17e)]();console[_0x1cea3d(0x19e)](_0x1cea3d(0x18b)+_0xc9a5af[_0x1cea3d(0x192)]+')');const _0x48de81=await isKeychainAvailable();_0x48de81?(await saveAPIKeyAsync(_0x406eac[_0x1cea3d(0x16f)](),_0x1b0101,_0x256cdc),console[_0x1cea3d(0x19e)](_0x1cea3d(0x16e)+(_0x256cdc?_0x1cea3d(0x159)+_0x256cdc+')':''))):(console['warn'](a6_0x32dc4b[_0x1cea3d(0x197)](_0x1cea3d(0x18a))),console['warn'](a6_0x32dc4b[_0x1cea3d(0x197)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x256cdc){const _0x5a1232={'site':_0x1b0101};saveProfileToUserConfig(_0x256cdc,_0x5a1232),console['log'](_0x1cea3d(0x1a5)+_0x256cdc+_0x1cea3d(0x19d));}const _0x1898a3=_0x256cdc?_0x1cea3d(0x179)+_0x256cdc:'';return console[_0x1cea3d(0x19e)](),console[_0x1cea3d(0x19e)](_0x1cea3d(0x1a7)),console[_0x1cea3d(0x19e)](_0x1cea3d(0x160)+_0x1898a3+_0x1cea3d(0x17a)),console[_0x1cea3d(0x19e)]('\x20\x20tdx'+_0x1898a3+_0x1cea3d(0x19a)),0x0;}catch(_0x2e8a94){if(_0x2e8a94 instanceof HTTPClientError&&_0x2e8a94[_0x1cea3d(0x155)]===0x191)return printAuthError(_0x2e8a94),0x1;return console[_0x1cea3d(0x14f)](a6_0x32dc4b[_0x1cea3d(0x1a8)]('✗\x20Validation\x20failed:\x20'+(_0x2e8a94 instanceof Error?_0x2e8a94[_0x1cea3d(0x17c)]:String(_0x2e8a94)))),console[_0x1cea3d(0x14f)](_0x1cea3d(0x172)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a6_0xe622f4(0x19b)]='auth';['description']=a6_0xe622f4(0x187);async[a6_0xe622f4(0x182)](_0xb1126){const _0x387817=a6_0xe622f4,{options:_0x1f314a,tdx:_0x3c1ff7}=_0xb1126,_0x53ba86=_0x1f314a[_0x387817(0x19f)],_0x9d9ae9=_0x1f314a[_0x387817(0x184)],_0x585f3d=_0x9d9ae9?_0x9d9ae9:_0x387817(0x164);console['log'](_0x387817(0x183)+_0x585f3d+_0x387817(0x199)+_0x53ba86+')');const _0x54b475=await resolveAPIKeyAsync(_0x53ba86,_0x9d9ae9);if(_0x54b475){const {source:_0x5252d5,isDeprecated:_0x3ae53f}=_0x54b475,_0x4b2f74=_0x387817(0x195)+_0x5252d5;console[_0x387817(0x19e)](_0x3ae53f?a6_0x32dc4b[_0x387817(0x197)](_0x4b2f74):_0x4b2f74);}else console[_0x387817(0x19e)](a6_0x32dc4b[_0x387817(0x197)](_0x387817(0x1a4)));try{const _0x64469=await _0x3c1ff7['jobs']['getUserInfo']();return console[_0x387817(0x19e)](a6_0x32dc4b[_0x387817(0x171)](_0x387817(0x151))),console[_0x387817(0x19e)](_0x387817(0x185)+_0x64469[_0x387817(0x192)]),(_0x64469['first_name']||_0x64469[_0x387817(0x16b)])&&console[_0x387817(0x19e)](_0x387817(0x174)+[_0x64469['first_name'],_0x64469[_0x387817(0x16b)]][_0x387817(0x18c)](Boolean)[_0x387817(0x1a0)]('\x20')),0x0;}catch(_0x51443b){return _0x51443b instanceof HTTPClientError&&_0x51443b[_0x387817(0x155)]===0x191?printAuthError(_0x51443b,!![],_0x9d9ae9):console['error'](a6_0x32dc4b[_0x387817(0x1a8)]('✗\x20Validation\x20failed:\x20'+(_0x51443b instanceof Error?_0x51443b[_0x387817(0x17c)]:String(_0x51443b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a6_0xe622f4(0x19b)]=a6_0xe622f4(0x18d);['description']=a6_0xe622f4(0x150);async[a6_0xe622f4(0x182)](_0x3060c5){const _0x1b7ff9=a6_0xe622f4,{options:_0x459fd1}=_0x3060c5,_0x26f45d=_0x459fd1[_0x1b7ff9(0x184)];console[_0x1b7ff9(0x19e)](a6_0x32dc4b[_0x1b7ff9(0x177)](_0x1b7ff9(0x1a1)));const _0x45a851=await isKeychainAvailable();if(!_0x45a851)return console['error'](a6_0x32dc4b[_0x1b7ff9(0x1a8)](_0x1b7ff9(0x190))),0x1;const _0x1fa02f=await deleteKeychainAPIKey(_0x26f45d);return _0x1fa02f?(clearCredentialCache(),console[_0x1b7ff9(0x19e)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x26f45d?_0x1b7ff9(0x159)+_0x26f45d+')':'')),0x0):(console[_0x1b7ff9(0x19e)](_0x1b7ff9(0x15e)+(_0x26f45d?_0x1b7ff9(0x152)+_0x26f45d:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x29bcdb=a7_0x12df;(function(_0x31cf1d,_0x81244d){const _0x7c67f1=a7_0x12df,_0x1fda49=_0x31cf1d();while(!![]){try{const _0x3831a3=-parseInt(_0x7c67f1(0x1b7))/0x1+parseInt(_0x7c67f1(0x1b9))/0x2+-parseInt(_0x7c67f1(0x1e6))/0x3+parseInt(_0x7c67f1(0x1d4))/0x4+-parseInt(_0x7c67f1(0x1c7))/0x5*(-parseInt(_0x7c67f1(0x1e1))/0x6)+-parseInt(_0x7c67f1(0x1b8))/0x7+parseInt(_0x7c67f1(0x1d5))/0x8*(-parseInt(_0x7c67f1(0x1c1))/0x9);if(_0x3831a3===_0x81244d)break;else _0x1fda49['push'](_0x1fda49['shift']());}catch(_0x353690){_0x1fda49['push'](_0x1fda49['shift']());}}}(a7_0x418a,0xcb55b));function a7_0x418a(){const _0x406fbd=['llmProject','15003XhukSE','join','new','chatId','Continuing\x20chat:\x20','log','2315fezNtZ','verbose','\x27...','resolveProjectId','cause','getDefaultAgent','write','stdout','name','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','event','\x0aStack\x20trace:','CHAT_NOT_FOUND','4844116CpewyS','120AEihWX','\x20\x20Cause:\x20','\x0aError:\x20','session\x20context','data','llm','Using\x20cached\x20default\x20agent:\x20','agent','404','content','getOrCreateDefaultAgent','Using\x20agent\x20from\x20','9894YKtaaG','validate','stack','resolveAgentId','Chat\x20session:\x20','1204734ZUpbZU','handleChatEvent','message','Getting\x20default\x20agent...','Resolving\x20agent\x20\x27','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','type','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','error','32296LWZlnk','6120583AwcSGM','383182VXNdbu','execute','streamChat','getAgentId','chat','code','llmAgent'];a7_0x418a=function(){return _0x406fbd;};return a7_0x418a();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a7_0x12df(_0x260aa4,_0x1f447e){_0x260aa4=_0x260aa4-0x1b2;const _0x418a10=a7_0x418a();let _0x12dfe8=_0x418a10[_0x260aa4];return _0x12dfe8;}function handleSDKError(_0x380a7f,_0x225eb){const _0x347477=a7_0x12df;if(_0x380a7f instanceof SDKError)console[_0x347477(0x1b6)]('Error:\x20'+_0x380a7f[_0x347477(0x1e8)]),_0x225eb[_0x347477(0x1c8)]&&(_0x380a7f[_0x347477(0x1cb)]&&console[_0x347477(0x1b6)](_0x347477(0x1d6)+_0x380a7f[_0x347477(0x1cb)]),_0x380a7f['stack']&&(console[_0x347477(0x1b6)](_0x347477(0x1d2)),console[_0x347477(0x1b6)](_0x380a7f[_0x347477(0x1e3)])));else throw _0x380a7f;}export class ChatCommand extends BaseCommand{[a7_0x29bcdb(0x1cf)]=a7_0x29bcdb(0x1bd);['description']=a7_0x29bcdb(0x1b3);[a7_0x29bcdb(0x1e2)](_0xeb4360){const _0x3f4594=a7_0x29bcdb,_0x37435e=_0xeb4360['args'][_0x3f4594(0x1c2)]('\x20');if(!_0x37435e)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x1cc0c8,_0x251543,_0x29e8a1,_0xe1e2be,_0x4bf97a){const _0x481cb5=a7_0x29bcdb;for await(const _0x267341 of _0x1cc0c8[_0x481cb5(0x1da)]['chat'](_0x251543,{'agentId':_0x29e8a1,'chatId':_0xe1e2be})){if(_0x267341['type']==='metadata'){const _0x3878da=_0x267341['data'][_0x481cb5(0x1c4)];saveLastChatId(_0x3878da),_0x4bf97a&&console[_0x481cb5(0x1b6)](_0x481cb5(0x1e5)+_0x3878da);}else _0x267341[_0x481cb5(0x1b4)]===_0x481cb5(0x1d1)&&this[_0x481cb5(0x1e7)](_0x267341['data']);}}async['getAgentId'](_0x228e19,_0x10f7a9,_0x107ac5,_0x2583c7,_0x25f4a2){const _0x4582e6=a7_0x29bcdb,_0x1ffcc6=_0x10f7a9||_0x107ac5;if(_0x1ffcc6){const {projectName:_0x2b6baa,agentName:_0x53e796}=parseAgentRef(_0x1ffcc6),_0x66b3e2=_0x53e796||_0x1ffcc6,_0x1aa997=_0x53e796?_0x2b6baa:_0x2583c7;if(!_0x1aa997)throw new Error(_0x4582e6(0x1d0));if(_0x25f4a2){const _0x18dda6=_0x10f7a9?'--agent\x20flag':_0x4582e6(0x1d8);console['error'](_0x4582e6(0x1e0)+_0x18dda6+':\x20'+_0x1aa997+'/'+_0x66b3e2);}const _0x1e8f01=await withSpinner('Resolving\x20project\x20\x27'+_0x1aa997+_0x4582e6(0x1c9),()=>_0x228e19[_0x4582e6(0x1da)][_0x4582e6(0x1ca)](_0x1aa997),{'verbose':_0x25f4a2}),_0x54203b=await withSpinner(_0x4582e6(0x1b2)+_0x66b3e2+_0x4582e6(0x1c9),()=>_0x228e19[_0x4582e6(0x1da)][_0x4582e6(0x1e4)](_0x66b3e2,_0x1e8f01[_0x4582e6(0x1d9)]),{'verbose':_0x25f4a2});return _0x54203b[_0x4582e6(0x1d9)];}else{const _0x545593=_0x228e19[_0x4582e6(0x1da)][_0x4582e6(0x1cc)]();if(_0x545593)return _0x25f4a2&&console[_0x4582e6(0x1b6)](_0x4582e6(0x1db)+_0x545593[_0x4582e6(0x1cf)]),_0x545593['id'];const _0x585819=await withSpinner(_0x4582e6(0x1e9),()=>_0x228e19[_0x4582e6(0x1da)][_0x4582e6(0x1df)]('claude-4.5-haiku',0x0),{'verbose':_0x25f4a2});return _0x585819['data']['id'];}}async[a7_0x29bcdb(0x1ba)](_0x117f96){const _0x40ffeb=a7_0x29bcdb,{options:_0x4f6108,args:_0x25f9d6,tdx:_0x4bc348}=_0x117f96,_0x195ebb=_0x25f9d6[_0x40ffeb(0x1c2)]('\x20'),_0x532441=_0x4f6108,_0x3eccf4=_0x532441[_0x40ffeb(0x1dc)],_0x109d70=_0x532441[_0x40ffeb(0x1bf)],_0x43d7a9=_0x532441[_0x40ffeb(0x1c0)],_0x510ef4=_0x532441[_0x40ffeb(0x1c3)];try{let _0x2e33fc,_0x4ae866;!_0x510ef4&&(_0x4ae866=loadLastChatId(),_0x4ae866&&_0x4f6108[_0x40ffeb(0x1c8)]&&console['error'](_0x40ffeb(0x1c5)+_0x4ae866));(_0x510ef4||!_0x4ae866)&&(_0x2e33fc=await this[_0x40ffeb(0x1bc)](_0x4bc348,_0x3eccf4,_0x109d70,_0x43d7a9,_0x4f6108[_0x40ffeb(0x1c8)]));try{await this[_0x40ffeb(0x1bb)](_0x4bc348,_0x195ebb,_0x2e33fc,_0x4ae866,_0x4f6108['verbose']);}catch(_0x5a8758){const _0x1e6e40=_0x5a8758 instanceof SDKError&&_0x5a8758[_0x40ffeb(0x1be)]===ErrorCode[_0x40ffeb(0x1d3)]||_0x5a8758 instanceof Error&&_0x5a8758[_0x40ffeb(0x1e8)]['includes'](_0x40ffeb(0x1dd));if(_0x1e6e40)_0x4f6108[_0x40ffeb(0x1c8)]&&console['error'](_0x40ffeb(0x1b5)),!_0x2e33fc&&(_0x2e33fc=await this['getAgentId'](_0x4bc348,_0x3eccf4,_0x109d70,_0x43d7a9,_0x4f6108['verbose'])),await this[_0x40ffeb(0x1bb)](_0x4bc348,_0x195ebb,_0x2e33fc,undefined,_0x4f6108[_0x40ffeb(0x1c8)]);else throw _0x5a8758;}return console[_0x40ffeb(0x1c6)](),0x0;}catch(_0x947d85){return console[_0x40ffeb(0x1b6)](),handleSDKError(_0x947d85,_0x4f6108),0x1;}}[a7_0x29bcdb(0x1e7)](_0x1dc5fc){const _0x3d6d39=a7_0x29bcdb;if('content'in _0x1dc5fc)process[_0x3d6d39(0x1ce)][_0x3d6d39(0x1cd)](_0x1dc5fc[_0x3d6d39(0x1de)]);else'error'in _0x1dc5fc&&console[_0x3d6d39(0x1b6)](_0x3d6d39(0x1d7)+_0x1dc5fc['error']);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x3c13e5=a8_0x138c;(function(_0x3d2bc4,_0x17e0df){const _0x1a9037=a8_0x138c,_0x4c7df7=_0x3d2bc4();while(!![]){try{const _0x2ea2bb=parseInt(_0x1a9037(0x13e))/0x1*(parseInt(_0x1a9037(0x17a))/0x2)+-parseInt(_0x1a9037(0x188))/0x3+-parseInt(_0x1a9037(0x1a4))/0x4+parseInt(_0x1a9037(0x15d))/0x5+parseInt(_0x1a9037(0x127))/0x6+-parseInt(_0x1a9037(0x14c))/0x7*(-parseInt(_0x1a9037(0x166))/0x8)+-parseInt(_0x1a9037(0x11f))/0x9*(parseInt(_0x1a9037(0x12e))/0xa);if(_0x2ea2bb===_0x17e0df)break;else _0x4c7df7['push'](_0x4c7df7['shift']());}catch(_0x461ef3){_0x4c7df7['push'](_0x4c7df7['shift']());}}}(a8_0x2a16,0xcc505));import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';function a8_0x138c(_0x202387,_0x2b3cc7){_0x202387=_0x202387-0x10e;const _0x2a1626=a8_0x2a16();let _0x138c13=_0x2a1626[_0x202387];return _0x138c13;}import a8_0x1a4a9b from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a8_0x3c13e5(0x13c);function handleInstallationError(_0x218bbb,_0x5a23ea,_0x118be4,_0x5099a7){const _0x8acccf=a8_0x3c13e5;errorContains(_0x218bbb,'already\x20exists',_0x8acccf(0x149),_0x8acccf(0x1a2))?(_0x118be4[_0x8acccf(0x12b)]='✓\x20'+_0x5a23ea+_0x8acccf(0x178),_0x5099a7?.[_0x8acccf(0x174)](_0x5a23ea+'\x20already\x20configured'),_0x218bbb instanceof SDKError&&_0x218bbb[_0x8acccf(0x15f)]&&_0x5099a7?.[_0x8acccf(0x177)](_0x8acccf(0x13b)+_0x218bbb[_0x8acccf(0x15f)][_0x8acccf(0x180)])):(_0x118be4['warn'](_0x8acccf(0x11c)+_0x5a23ea),_0x5099a7?.[_0x8acccf(0x12a)](_0x5a23ea+_0x8acccf(0x18d),_0x218bbb));}export function parseVersion(_0xb5fb9d){const _0xd0cafa=a8_0x3c13e5,_0x504a12=_0xb5fb9d[_0xd0cafa(0x171)]()[_0xd0cafa(0x167)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x504a12)return null;return{'major':parseInt(_0x504a12[0x1],0xa),'minor':parseInt(_0x504a12[0x2],0xa),'patch':parseInt(_0x504a12[0x3],0xa)};}export function compareVersions(_0x4cc5a3,_0x4b15aa){const _0x43ca77=a8_0x3c13e5;if(_0x4cc5a3[_0x43ca77(0x197)]!==_0x4b15aa[_0x43ca77(0x197)])return _0x4cc5a3[_0x43ca77(0x197)]-_0x4b15aa[_0x43ca77(0x197)];if(_0x4cc5a3[_0x43ca77(0x162)]!==_0x4b15aa[_0x43ca77(0x162)])return _0x4cc5a3[_0x43ca77(0x162)]-_0x4b15aa[_0x43ca77(0x162)];return _0x4cc5a3[_0x43ca77(0x129)]-_0x4b15aa['patch'];}async function checkClaudeVersion(_0x46bcca,_0x3a5fc4){const _0x115fcc=a8_0x3c13e5;_0x3a5fc4?.[_0x115fcc(0x177)](_0x115fcc(0x16e)+_0x46bcca+')');const _0x1978a4=await executeClaudeCommand([_0x115fcc(0x15c)],undefined,_0x3a5fc4),_0xfc62b9=parseVersion(_0x1978a4);if(!_0xfc62b9){_0x3a5fc4?.[_0x115fcc(0x185)](_0x115fcc(0x1a1)+_0x1978a4);return;}const _0x2dffd1=_0xfc62b9[_0x115fcc(0x197)]+'.'+_0xfc62b9[_0x115fcc(0x162)]+'.'+_0xfc62b9[_0x115fcc(0x129)],_0x59381c=parseVersion(_0x46bcca);if(!_0x59381c){_0x3a5fc4?.[_0x115fcc(0x185)](_0x115fcc(0x144)+_0x46bcca);return;}if(compareVersions(_0xfc62b9,_0x59381c)<0x0){_0x3a5fc4?.[_0x115fcc(0x12a)](_0x115fcc(0x16c)+_0x2dffd1+_0x115fcc(0x169)+_0x46bcca+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],'Claude\x20Code\x20version\x20'+_0x2dffd1+_0x115fcc(0x1a3)+_0x46bcca+_0x115fcc(0x12d),undefined,{'helpText':_0x115fcc(0x141)});}_0x3a5fc4?.[_0x115fcc(0x177)](_0x115fcc(0x16c)+_0x2dffd1+_0x115fcc(0x140));}async function executeClaudeCommand(_0x100b3e,_0x19bd1a,_0x109374){const _0x40fdfc=a8_0x3c13e5;return _0x109374?.['info'](_0x40fdfc(0x18b)+_0x100b3e['join']('\x20')),new Promise((_0x3cf39c,_0x1d4909)=>{const _0x3829c=_0x40fdfc,_0x599fc3=spawn(_0x3829c(0x143),_0x100b3e,{'stdio':_0x3829c(0x18e)});let _0x3fabdf='',_0x5d9832='';_0x599fc3[_0x3829c(0x153)]['on']('data',_0x2a68ab=>{const _0xe5826e=_0x3829c;_0x3fabdf+=_0x2a68ab[_0xe5826e(0x121)]();}),_0x599fc3['stderr']['on']('data',_0xd920e6=>{const _0x44b46e=_0x3829c;_0x5d9832+=_0xd920e6[_0x44b46e(0x121)]();}),_0x599fc3['on'](_0x3829c(0x12a),_0x1d3a46=>{const _0x4484e9=_0x3829c;_0x1d3a46[_0x4484e9(0x18f)]==='ENOENT'?(_0x109374?.[_0x4484e9(0x12a)](_0x4484e9(0x134)),_0x1d4909(new SDKError(ErrorCode[_0x4484e9(0x155)],_0x4484e9(0x134),_0x1d3a46,{'helpText':_0x4484e9(0x151)}))):(_0x109374?.['error']('Command\x20spawn\x20error:\x20'+_0x1d3a46[_0x4484e9(0x180)]),_0x1d4909(new SDKError(ErrorCode[_0x4484e9(0x11e)],_0x4484e9(0x116)+_0x1d3a46['message'],_0x1d3a46)));}),_0x599fc3['on'](_0x3829c(0x170),_0x57a85e=>{const _0x5c50b1=_0x3829c;if(_0x57a85e===0x0)_0x3cf39c(_0x3fabdf);else _0x19bd1a?(_0x109374?.['error'](_0x5c50b1(0x181)+_0x57a85e+_0x5c50b1(0x112)+_0x100b3e[_0x5c50b1(0x115)]('\x20')),_0x1d4909(new SDKError(ErrorCode[_0x5c50b1(0x113)],_0x19bd1a,new Error(_0x5d9832)))):_0x3cf39c('');});});}async function ensureMcpServer(_0x372e27,_0x3d9011,_0x4a5c42,_0x20a22f,_0x1ec372){const _0xf1163a=a8_0x3c13e5;_0x20a22f[_0xf1163a(0x12b)]='Configuring\x20MCP\x20server\x20\x27'+_0x372e27+_0xf1163a(0x192),await executeClaudeCommand([_0xf1163a(0x1a5),_0xf1163a(0x19c),_0x372e27,_0x3d9011,_0xf1163a(0x148),_0x4a5c42],_0xf1163a(0x184)+_0x372e27+'\x27',_0x1ec372),_0x20a22f[_0xf1163a(0x12b)]=_0xf1163a(0x159)+_0x372e27+_0xf1163a(0x198);}async function ensureMarketplace(_0x2b77b6,_0x26c724,_0x19c464,_0x15daaf){const _0x45261d=a8_0x3c13e5;_0x19c464[_0x45261d(0x12b)]='Configuring\x20marketplace\x20\x27'+_0x2b77b6+_0x45261d(0x192),await executeClaudeCommand(['plugin',_0x45261d(0x165),'add',_0x26c724],_0x45261d(0x150)+_0x2b77b6+'\x27',_0x15daaf),_0x19c464[_0x45261d(0x12b)]=_0x45261d(0x1a0)+_0x2b77b6+_0x45261d(0x198);}async function updateMarketplace(_0x4123a5,_0x51e454,_0x4e9317){const _0x421f24=a8_0x3c13e5;_0x51e454[_0x421f24(0x12b)]=_0x421f24(0x17c)+_0x4123a5+_0x421f24(0x192),await executeClaudeCommand(['plugin',_0x421f24(0x165),_0x421f24(0x14d)],_0x421f24(0x139)+_0x4123a5+'\x27',_0x4e9317),_0x51e454['text']=_0x421f24(0x1a0)+_0x4123a5+_0x421f24(0x18c);}async function ensurePlugin(_0x5341e8,_0x2b5b1c,_0x37a11f,_0x1fe67a){const _0xcccebe=a8_0x3c13e5;_0x37a11f[_0xcccebe(0x12b)]=_0xcccebe(0x15b)+_0x5341e8+_0xcccebe(0x192),await executeClaudeCommand(['plugin',_0xcccebe(0x173),_0x5341e8+'@'+_0x2b5b1c],_0xcccebe(0x154)+_0x5341e8+'\x27',_0x1fe67a),_0x37a11f[_0xcccebe(0x12b)]=_0xcccebe(0x147)+_0x5341e8+_0xcccebe(0x16b);}async function createClaudeSettings(_0x4cad04,_0x5dbf48='sonnet',_0x2a95fd){const _0x3cde60=a8_0x3c13e5,_0x5732b1=join(process[_0x3cde60(0x175)](),'.claude'),_0x301ff3=join(_0x5732b1,_0x3cde60(0x117));await mkdir(_0x5732b1,{'recursive':!![]});let _0x32f8fd={};if(existsSync(_0x301ff3))try{const _0x1bb5da=await readFile(_0x301ff3,_0x3cde60(0x110));_0x32f8fd=JSON[_0x3cde60(0x138)](_0x1bb5da);}catch{_0x32f8fd={};}const _0x49e97d=_0x32f8fd[_0x3cde60(0x195)]||{},_0x3723fe={'ANTHROPIC_BASE_URL':_0x49e97d['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x49e97d[_0x3cde60(0x118)],'ANTHROPIC_AUTH_TOKEN':_0x49e97d[_0x3cde60(0x190)],'statusLine':_0x32f8fd[_0x3cde60(0x12f)]},_0x1e5260={..._0x32f8fd,'env':{..._0x49e97d,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x4cad04,'ANTHROPIC_MODEL':_0x5dbf48,'ANTHROPIC_AUTH_TOKEN':_0x3cde60(0x156)},'statusLine':{'type':'command','command':_0x2a95fd?_0x3cde60(0x18a)+_0x2a95fd+_0x3cde60(0x158):'tdx\x20claude\x20statusline'}};return await writeFile(_0x301ff3,JSON[_0x3cde60(0x168)](_0x1e5260,null,0x2)+'\x0a'),_0x3723fe;}async function restoreClaudeSettings(_0x2dc62d){const _0x54e331=a8_0x3c13e5,_0x4a7476=join(process[_0x54e331(0x175)](),'.claude'),_0x366a67=join(_0x4a7476,'settings.local.json');if(!existsSync(_0x366a67))return;try{const _0x2dbfa4=await readFile(_0x366a67,_0x54e331(0x110)),_0xc96f4e=JSON[_0x54e331(0x138)](_0x2dbfa4),_0x106535=_0xc96f4e[_0x54e331(0x195)]||{},_0x64bb38=_0x106535[_0x54e331(0x13a)],_0x3b5f52=((()=>{const _0x32a565=_0x54e331;if(typeof _0x64bb38!=='string')return![];try{const _0x457e2d=new URL(_0x64bb38);return _0x457e2d[_0x32a565(0x17d)]===_0x32a565(0x19f)||_0x457e2d[_0x32a565(0x17d)]===_0x32a565(0x119);}catch{return![];}})());_0x3b5f52?(delete _0x106535[_0x54e331(0x13a)],delete _0x106535[_0x54e331(0x118)],delete _0x106535[_0x54e331(0x190)]):(_0x2dc62d[_0x54e331(0x13a)]!==undefined?_0x106535[_0x54e331(0x13a)]=_0x2dc62d['ANTHROPIC_BASE_URL']:delete _0x106535[_0x54e331(0x13a)],_0x2dc62d['ANTHROPIC_MODEL']!==undefined?_0x106535[_0x54e331(0x118)]=_0x2dc62d[_0x54e331(0x118)]:delete _0x106535[_0x54e331(0x118)],_0x2dc62d[_0x54e331(0x190)]!==undefined?_0x106535['ANTHROPIC_AUTH_TOKEN']=_0x2dc62d[_0x54e331(0x190)]:delete _0x106535[_0x54e331(0x190)]);const _0x2e2d34=_0xc96f4e['statusLine'],_0x6f0959=((()=>{const _0x1ea000=_0x54e331;if(!_0x2e2d34||typeof _0x2e2d34!=='object')return![];if(_0x2e2d34[_0x1ea000(0x128)]!==_0x1ea000(0x11d))return![];if(typeof _0x2e2d34['command']!==_0x1ea000(0x14a))return![];return _0x2e2d34[_0x1ea000(0x11d)][_0x1ea000(0x142)](_0x1ea000(0x15a))&&_0x2e2d34[_0x1ea000(0x11d)][_0x1ea000(0x142)](_0x1ea000(0x132));})());if(_0x6f0959)delete _0xc96f4e['statusLine'];else _0x2dc62d[_0x54e331(0x12f)]!==undefined?_0xc96f4e[_0x54e331(0x12f)]=_0x2dc62d[_0x54e331(0x12f)]:delete _0xc96f4e[_0x54e331(0x12f)];_0xc96f4e[_0x54e331(0x195)]=_0x106535,await writeFile(_0x366a67,JSON[_0x54e331(0x168)](_0xc96f4e,null,0x2)+'\x0a');}catch{}}function a8_0x2a16(){const _0x1bbd25=['\x20already\x20configured','proxy','2sSkMlu','findClaudePath','Updating\x20marketplace\x20\x27','hostname','originalSettings','tdx-skills','message','Command\x20failed\x20(exit\x20','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','start','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','warn','data','attributes','47670QssucG','Setup\x20failed','tdx\x20--profile\x20','Executing:\x20claude\x20','\x27\x20updated','\x20configuration\x20failed','pipe','code','ANTHROPIC_AUTH_TOKEN','resume','\x27...','sonnet','init','env','verbose','major','\x27\x20configured','log','Checking\x20Claude\x20Code\x20version...','server','add','td-skills\x20Plugins','http://127.0.0.1:','localhost','✓\x20Marketplace\x20\x27','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','already\x20configured','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','4844016TsgYBH','mcp','logLevel','stop','utf-8','unshift','):\x20claude\x20','INSTALLATION_FAILED','fail','join','Failed\x20to\x20spawn\x20claude\x20command:\x20','settings.local.json','ANTHROPIC_MODEL','127.0.0.1','Initializing...','model','Warning:\x20Failed\x20to\x20configure\x20','command','INTERNAL','9lmRKEj','https://docs.treasuredata.com/mcp','toString','red','execute','port','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Creating\x20.claude/settings.local.json...','9938550OzYXZM','type','patch','error','text','TD\x20Docs\x20MCP\x20Server','\x20or\x20later.','21638020HSMnjn','statusLine','td-skills','getCurrent','statusline','✓\x20Using\x20project:\x20','Claude\x20Code\x20CLI\x20not\x20found','which','inherit','Initializing\x20proxy\x20logger...','parse','Failed\x20to\x20update\x20marketplace\x20\x27','ANTHROPIC_BASE_URL','Command\x20output:\x20','2.0.20','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','623099lpZScU','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','\x20meets\x20minimum\x20requirement','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','includes','claude','Invalid\x20minimum\x20version\x20format:\x20','Setting\x20up\x20project...','green','✓\x20Plugin\x20\x27','--transport','already\x20installed','string','sql-skills','7eaOdEv','update','Starting\x20TD\x20LLM\x20proxy\x20server...','workflow-skills','Failed\x20to\x20configure\x20marketplace\x20\x27','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','✓\x20Logs\x20saved\x20to\x20','stdout','Failed\x20to\x20install\x20plugin\x20\x27','CLAUDE_CODE_NOT_FOUND','tdx-managed-proxy','✓\x20Logging\x20to\x20','\x20claude\x20statusline','✓\x20MCP\x20server\x20\x27','tdx','Installing\x20plugin\x20\x27','--version','2314755XSuTIw','✓\x20Claude\x20Code\x20version\x20OK','cause','site','logger','minor','profile','user','marketplace','11880720FCyytS','match','stringify','\x20is\x20too\x20old\x20(minimum:\x20','Claude\x20Code\x20version\x20check\x20failed','\x27\x20installed','Claude\x20Code\x20version\x20','close','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','Finding\x20available\x20port...','exit','trim','name','install','info','cwd','continue','debug'];a8_0x2a16=function(){return _0x1bbd25;};return a8_0x2a16();}export class ClaudeCommand extends BaseCommand{[a8_0x3c13e5(0x172)]=a8_0x3c13e5(0x143);['description']=a8_0x3c13e5(0x13f);[a8_0x3c13e5(0x19b)];['originalSettings'];['logger'];[a8_0x3c13e5(0x124)];async[a8_0x3c13e5(0x123)](_0xeacd41){const _0x24e7fa=a8_0x3c13e5,{tdx:_0x1c9033,options:_0x440126,args:_0x4a9750}=_0xeacd41;try{const _0x354a8=_0x440126,_0x37b852=_0x354a8[_0x24e7fa(0x11b)]||_0x24e7fa(0x193),_0x3d2d43=_0x354a8[_0x24e7fa(0x179)]===![],_0x3a9b5b=_0x354a8[_0x24e7fa(0x176)]===!![],_0x4a14e0=_0x354a8[_0x24e7fa(0x191)]===!![],_0x2ae6e1=[..._0x4a9750];if(_0x3a9b5b)_0x2ae6e1[_0x24e7fa(0x111)]('-c');else _0x4a14e0&&_0x2ae6e1[_0x24e7fa(0x111)]('-r');const _0x47e794=createCommandSpinner(_0x24e7fa(0x11a),{'verbose':_0x440126[_0x24e7fa(0x196)]});_0x47e794[_0x24e7fa(0x183)]();try{if(!_0x3d2d43){_0x47e794['text']=_0x24e7fa(0x16f),this[_0x24e7fa(0x124)]=await findAvailablePort(0xfa0),_0x47e794['text']='✓\x20Port\x20'+this[_0x24e7fa(0x124)],_0x47e794[_0x24e7fa(0x12b)]=_0x24e7fa(0x145);const _0x5c855e=await _0x1c9033['llm']['getOrCreateDefaultProject'](),_0x1eef1f=_0x5c855e['id'];_0x47e794['text']=_0x24e7fa(0x133)+_0x5c855e[_0x24e7fa(0x187)]['name'];const _0x17cb54=_0x440126[_0x24e7fa(0x163)];try{const _0xbf8266=await _0x1c9033[_0x24e7fa(0x164)][_0x24e7fa(0x131)]();_0xbf8266['account_id']&&writeCachedAccountInfo(_0x440126[_0x24e7fa(0x160)],_0xbf8266['account_id'],_0x17cb54);}catch{}_0x47e794['text']=_0x24e7fa(0x137),this[_0x24e7fa(0x161)]=new TDXLogger(_0x440126[_0x24e7fa(0x10e)],!![]),await this['logger'][_0x24e7fa(0x194)]();const _0x366b33=this[_0x24e7fa(0x161)]['getLogPath']();_0x47e794['text']=_0x24e7fa(0x157)+_0x366b33,_0x47e794[_0x24e7fa(0x12b)]=_0x24e7fa(0x14e),this[_0x24e7fa(0x19b)]=new ProxyServer({'port':this['port'],'projectId':_0x1eef1f,'tdx':_0x1c9033,'logger':this[_0x24e7fa(0x161)],'site':_0x440126['site']}),await this[_0x24e7fa(0x19b)][_0x24e7fa(0x183)](),_0x47e794[_0x24e7fa(0x12b)]=_0x24e7fa(0x13d)+this[_0x24e7fa(0x124)],_0x47e794[_0x24e7fa(0x12b)]=_0x24e7fa(0x126),this['originalSettings']=await createClaudeSettings(this[_0x24e7fa(0x124)],_0x37b852,_0x17cb54),_0x47e794[_0x24e7fa(0x12b)]='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x47e794[_0x24e7fa(0x12b)]=_0x24e7fa(0x125);try{_0x47e794[_0x24e7fa(0x12b)]=_0x24e7fa(0x19a),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x24e7fa(0x161)]),_0x47e794[_0x24e7fa(0x12b)]=_0x24e7fa(0x15e);}catch(_0x5dd525){_0x47e794[_0x24e7fa(0x114)](_0x24e7fa(0x16a));throw _0x5dd525;}try{await ensureMcpServer('td-docs',_0x24e7fa(0x120),'http',_0x47e794,this[_0x24e7fa(0x161)]);}catch(_0xe304d4){handleInstallationError(_0xe304d4,_0x24e7fa(0x12c),_0x47e794,this['logger']);}try{await ensureMarketplace('td-skills','https://github.com/treasure-data/td-skills',_0x47e794,this[_0x24e7fa(0x161)]),await updateMarketplace(_0x24e7fa(0x130),_0x47e794,this[_0x24e7fa(0x161)]),await ensurePlugin(_0x24e7fa(0x14b),_0x24e7fa(0x130),_0x47e794,this[_0x24e7fa(0x161)]),await ensurePlugin(_0x24e7fa(0x14f),_0x24e7fa(0x130),_0x47e794,this['logger']),await ensurePlugin(_0x24e7fa(0x17f),_0x24e7fa(0x130),_0x47e794,this['logger']);}catch(_0x14bbb4){handleInstallationError(_0x14bbb4,_0x24e7fa(0x19d),_0x47e794,this[_0x24e7fa(0x161)]);}_0x47e794[_0x24e7fa(0x10f)]();}catch(_0x186783){_0x47e794['fail'](_0x24e7fa(0x189));throw _0x186783;}const _0x31ef7c=await this['findClaudePath']();if(!_0x31ef7c)throw new SDKError(ErrorCode[_0x24e7fa(0x155)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x39fd9b={...process[_0x24e7fa(0x195)]};!_0x3d2d43&&(_0x39fd9b[_0x24e7fa(0x13a)]=_0x24e7fa(0x19e)+this['port'],_0x39fd9b[_0x24e7fa(0x118)]=_0x37b852,_0x39fd9b['ANTHROPIC_AUTH_TOKEN']=_0x24e7fa(0x156));const _0x590846=spawn(_0x31ef7c,_0x2ae6e1,{'stdio':_0x24e7fa(0x136),'env':_0x39fd9b}),_0x1e91c3=await new Promise(_0x3d59e0=>{const _0x5ecd21=_0x24e7fa;_0x590846['on'](_0x5ecd21(0x170),_0x2aff5e=>{_0x3d59e0(_0x2aff5e||0x0);}),_0x590846['on']('error',_0x462fe5=>{const _0x479bba=_0x5ecd21;console[_0x479bba(0x12a)](a8_0x1a4a9b[_0x479bba(0x122)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x462fe5[_0x479bba(0x180)])),_0x3d59e0(0x1);});});this['server']&&(await this[_0x24e7fa(0x19b)][_0x24e7fa(0x10f)](),console['log'](a8_0x1a4a9b['green'](_0x24e7fa(0x182))));if(this[_0x24e7fa(0x161)]){await this[_0x24e7fa(0x161)][_0x24e7fa(0x16d)]();const _0x446081=this[_0x24e7fa(0x161)]['getLogPath']();console[_0x24e7fa(0x199)](a8_0x1a4a9b[_0x24e7fa(0x146)](_0x24e7fa(0x152)+_0x446081));}return this[_0x24e7fa(0x17e)]&&(await restoreClaudeSettings(this[_0x24e7fa(0x17e)]),console['log'](a8_0x1a4a9b[_0x24e7fa(0x146)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x1e91c3;}catch(_0xc06ebf){this[_0x24e7fa(0x19b)]&&await this[_0x24e7fa(0x19b)][_0x24e7fa(0x10f)]();this['logger']&&await this['logger'][_0x24e7fa(0x16d)]();this['originalSettings']&&await restoreClaudeSettings(this['originalSettings']);throw _0xc06ebf;}}async[a8_0x3c13e5(0x17b)](){return new Promise(_0x35a8e3=>{const _0x2bea72=a8_0x138c,_0x3f61b1=spawn(_0x2bea72(0x135),[_0x2bea72(0x143)]);let _0x4ce8f5='';_0x3f61b1['stdout']['on'](_0x2bea72(0x186),_0x2a57ce=>{const _0x256fd6=_0x2bea72;_0x4ce8f5+=_0x2a57ce[_0x256fd6(0x121)]();}),_0x3f61b1['on']('exit',_0x42bc19=>{const _0x314f14=_0x2bea72;_0x42bc19===0x0&&_0x4ce8f5[_0x314f14(0x171)]()?_0x35a8e3(_0x4ce8f5[_0x314f14(0x171)]()):_0x35a8e3(null);});});}}
|
|
1
|
+
const a8_0x2c44a1=a8_0x4ba4;(function(_0x19c942,_0x51bfa2){const _0x58ae9e=a8_0x4ba4,_0x2f88d6=_0x19c942();while(!![]){try{const _0x555a19=parseInt(_0x58ae9e(0x164))/0x1+parseInt(_0x58ae9e(0x111))/0x2*(-parseInt(_0x58ae9e(0x126))/0x3)+parseInt(_0x58ae9e(0x120))/0x4*(-parseInt(_0x58ae9e(0x128))/0x5)+-parseInt(_0x58ae9e(0x108))/0x6*(-parseInt(_0x58ae9e(0x11a))/0x7)+-parseInt(_0x58ae9e(0x12a))/0x8*(-parseInt(_0x58ae9e(0x176))/0x9)+-parseInt(_0x58ae9e(0xfe))/0xa*(parseInt(_0x58ae9e(0xee))/0xb)+parseInt(_0x58ae9e(0x142))/0xc;if(_0x555a19===_0x51bfa2)break;else _0x2f88d6['push'](_0x2f88d6['shift']());}catch(_0x499468){_0x2f88d6['push'](_0x2f88d6['shift']());}}}(a8_0x4ec8,0xc6347));import{spawn}from'node:child_process';function a8_0x4ba4(_0x107637,_0x483084){_0x107637=_0x107637-0xdf;const _0x4ec8f0=a8_0x4ec8();let _0x4ba474=_0x4ec8f0[_0x107637];return _0x4ba474;}import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a8_0x493afd from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a8_0x2c44a1(0x161);function handleInstallationError(_0x525351,_0x221061,_0x31e54f,_0x408591){const _0x21497d=a8_0x2c44a1;errorContains(_0x525351,_0x21497d(0x166),_0x21497d(0x137),_0x21497d(0x130))?(_0x31e54f[_0x21497d(0x174)]='✓\x20'+_0x221061+_0x21497d(0x11e),_0x408591?.[_0x21497d(0x132)](_0x221061+_0x21497d(0x11e)),_0x525351 instanceof SDKError&&_0x525351[_0x21497d(0x103)]&&_0x408591?.[_0x21497d(0x15f)]('Command\x20output:\x20'+_0x525351[_0x21497d(0x103)][_0x21497d(0x122)])):(_0x31e54f['warn'](_0x21497d(0x127)+_0x221061),_0x408591?.[_0x21497d(0x145)](_0x221061+_0x21497d(0x163),_0x525351));}export function parseVersion(_0x431b9e){const _0x4993d9=a8_0x2c44a1,_0x31ea56=_0x431b9e[_0x4993d9(0xfd)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x31ea56)return null;return{'major':parseInt(_0x31ea56[0x1],0xa),'minor':parseInt(_0x31ea56[0x2],0xa),'patch':parseInt(_0x31ea56[0x3],0xa)};}export function compareVersions(_0x8ecb8d,_0x5391f1){const _0x38eece=a8_0x2c44a1;if(_0x8ecb8d[_0x38eece(0x11d)]!==_0x5391f1[_0x38eece(0x11d)])return _0x8ecb8d[_0x38eece(0x11d)]-_0x5391f1[_0x38eece(0x11d)];if(_0x8ecb8d['minor']!==_0x5391f1[_0x38eece(0x172)])return _0x8ecb8d[_0x38eece(0x172)]-_0x5391f1[_0x38eece(0x172)];return _0x8ecb8d[_0x38eece(0x16c)]-_0x5391f1[_0x38eece(0x16c)];}async function checkClaudeVersion(_0x485a4,_0x529bd4){const _0x33aa8e=a8_0x2c44a1;_0x529bd4?.[_0x33aa8e(0x15f)](_0x33aa8e(0x104)+_0x485a4+')');const _0x3b77f4=await executeClaudeCommand([_0x33aa8e(0xe3)],undefined,_0x529bd4),_0x432bb6=parseVersion(_0x3b77f4);if(!_0x432bb6){_0x529bd4?.['warn'](_0x33aa8e(0x159)+_0x3b77f4);return;}const _0x117ac9=_0x432bb6[_0x33aa8e(0x11d)]+'.'+_0x432bb6[_0x33aa8e(0x172)]+'.'+_0x432bb6[_0x33aa8e(0x16c)],_0x4a4f93=parseVersion(_0x485a4);if(!_0x4a4f93){_0x529bd4?.[_0x33aa8e(0x150)](_0x33aa8e(0x13a)+_0x485a4);return;}if(compareVersions(_0x432bb6,_0x4a4f93)<0x0){_0x529bd4?.['error'](_0x33aa8e(0x165)+_0x117ac9+_0x33aa8e(0x140)+_0x485a4+')');throw new SDKError(ErrorCode[_0x33aa8e(0x168)],_0x33aa8e(0x165)+_0x117ac9+_0x33aa8e(0x113)+_0x485a4+_0x33aa8e(0x14f),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x529bd4?.[_0x33aa8e(0x15f)]('Claude\x20Code\x20version\x20'+_0x117ac9+'\x20meets\x20minimum\x20requirement');}function a8_0x4ec8(){const _0x31d490=['Warning:\x20Failed\x20to\x20configure\x20','15sGqGPo','originalSettings','186568WpgyHw','✓\x20Marketplace\x20\x27','Creating\x20.claude/settings.local.json...','verbose','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','td-skills','already\x20configured','execute','info','server','settings.local.json','data','includes','already\x20installed','utf-8','inherit','Invalid\x20minimum\x20version\x20format:\x20','workflow-skills','parse','logLevel','\x27...','\x27\x20updated','\x20is\x20too\x20old\x20(minimum:\x20','user','13710756xAVQcE','join','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','error','resume','profile','Updating\x20marketplace\x20\x27','proxy','✓\x20Port\x20','ANTHROPIC_AUTH_TOKEN','Starting\x20TD\x20LLM\x20proxy\x20server...','start','Configuring\x20MCP\x20server\x20\x27','\x20or\x20later.','warn','close','✓\x20Settings\x20restored:\x20.claude/settings.local.json','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','cwd','stdout','Failed\x20to\x20launch\x20Claude\x20Code:\x20','init','account_id','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Failed\x20to\x20spawn\x20claude\x20command:\x20','plugin','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','name','sonnet','debug','continue','2.0.20','string','\x20configuration\x20failed','51900NLLUkc','Claude\x20Code\x20version\x20','already\x20exists','\x27\x20configured','CLAUDE_CODE_UNSUPPORTED_VERSION','ANTHROPIC_BASE_URL','log','INSTALLATION_FAILED','patch','tdx','getCurrent','findClaudePath','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Failed\x20to\x20update\x20marketplace\x20\x27','minor','logger','text','http://127.0.0.1:','72JHHzhB','fail','✓\x20Settings\x20configured:\x20.claude/settings.local.json','\x27\x20installed','✓\x20Logging\x20to\x20','code','--version','CLAUDE_CODE_NOT_FOUND','red','td-skills\x20Plugins','env','Initializing\x20proxy\x20logger...','statusline','stderr','which','statusLine','tdx-managed-proxy','1008502VNEHqt','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','marketplace','stringify','localhost','attributes','mcp','Claude\x20Code\x20CLI\x20not\x20found','Checking\x20Claude\x20Code\x20version...','sql-skills','port','Setting\x20up\x20project...','.claude','description','hostname','trim','20VzKQgE','Command\x20spawn\x20error:\x20','127.0.0.1','getLogPath','Executing:\x20claude\x20','cause','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','Claude\x20Code\x20version\x20check\x20failed','Command\x20failed\x20(exit\x20','llm','7910202FrgytX','Finding\x20available\x20port...','site','type','✓\x20Claude\x20Code\x20version\x20OK','claude','object','td-docs','green','2rmUGWm','exit','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','add','Setup\x20failed','stop','unshift','tdx-skills','ANTHROPIC_MODEL','7LqyafP','Configuring\x20marketplace\x20\x27','getOrCreateDefaultProject','major','\x20already\x20configured','Failed\x20to\x20install\x20plugin\x20\x27','535840LQpPJi','toString','message','install','pipe','command','3906921VcbGpq'];a8_0x4ec8=function(){return _0x31d490;};return a8_0x4ec8();}async function executeClaudeCommand(_0x10fffa,_0x4e6c7b,_0x2653ef){const _0x4cec35=a8_0x2c44a1;return _0x2653ef?.['info'](_0x4cec35(0x102)+_0x10fffa[_0x4cec35(0x143)]('\x20')),new Promise((_0x1e4208,_0x3e6e07)=>{const _0x298a7a=_0x4cec35,_0x4e956c=spawn('claude',_0x10fffa,{'stdio':_0x298a7a(0x124)});let _0xc254cb='',_0xa0feeb='';_0x4e956c[_0x298a7a(0x155)]['on'](_0x298a7a(0x135),_0x230444=>{const _0x35abdc=_0x298a7a;_0xc254cb+=_0x230444[_0x35abdc(0x121)]();}),_0x4e956c[_0x298a7a(0xea)]['on'](_0x298a7a(0x135),_0x4a4040=>{const _0x370905=_0x298a7a;_0xa0feeb+=_0x4a4040[_0x370905(0x121)]();}),_0x4e956c['on'](_0x298a7a(0x145),_0x40983a=>{const _0x57fe3d=_0x298a7a;_0x40983a[_0x57fe3d(0xe2)]==='ENOENT'?(_0x2653ef?.[_0x57fe3d(0x145)](_0x57fe3d(0xf5)),_0x3e6e07(new SDKError(ErrorCode[_0x57fe3d(0xe4)],_0x57fe3d(0xf5),_0x40983a,{'helpText':_0x57fe3d(0x170)}))):(_0x2653ef?.[_0x57fe3d(0x145)](_0x57fe3d(0xff)+_0x40983a[_0x57fe3d(0x122)]),_0x3e6e07(new SDKError(ErrorCode['INTERNAL'],_0x57fe3d(0x15a)+_0x40983a[_0x57fe3d(0x122)],_0x40983a)));}),_0x4e956c['on'](_0x298a7a(0x112),_0x27fa28=>{const _0x238da1=_0x298a7a;if(_0x27fa28===0x0)_0x1e4208(_0xc254cb);else _0x4e6c7b?(_0x2653ef?.[_0x238da1(0x145)](_0x238da1(0x106)+_0x27fa28+'):\x20claude\x20'+_0x10fffa['join']('\x20')),_0x3e6e07(new SDKError(ErrorCode[_0x238da1(0x16b)],_0x4e6c7b,new Error(_0xa0feeb)))):_0x1e4208('');});});}async function ensureMcpServer(_0x9d750b,_0x1b12c1,_0x1fb972,_0xaefc25,_0x357743){const _0x3b2c51=a8_0x2c44a1;_0xaefc25['text']=_0x3b2c51(0x14e)+_0x9d750b+_0x3b2c51(0x13e),await executeClaudeCommand([_0x3b2c51(0xf4),_0x3b2c51(0x114),_0x9d750b,_0x1b12c1,'--transport',_0x1fb972],_0x3b2c51(0xef)+_0x9d750b+'\x27',_0x357743),_0xaefc25[_0x3b2c51(0x174)]='✓\x20MCP\x20server\x20\x27'+_0x9d750b+'\x27\x20configured';}async function ensureMarketplace(_0x29095b,_0x343b1c,_0x474468,_0x22f702){const _0x3c1c76=a8_0x2c44a1;_0x474468['text']=_0x3c1c76(0x11b)+_0x29095b+'\x27...',await executeClaudeCommand(['plugin',_0x3c1c76(0xf0),_0x3c1c76(0x114),_0x343b1c],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x29095b+'\x27',_0x22f702),_0x474468[_0x3c1c76(0x174)]=_0x3c1c76(0x12b)+_0x29095b+_0x3c1c76(0x167);}async function updateMarketplace(_0x3b9df0,_0x4fa626,_0x358dd0){const _0xc88a3d=a8_0x2c44a1;_0x4fa626[_0xc88a3d(0x174)]=_0xc88a3d(0x148)+_0x3b9df0+_0xc88a3d(0x13e),await executeClaudeCommand([_0xc88a3d(0x15b),_0xc88a3d(0xf0),'update'],_0xc88a3d(0x171)+_0x3b9df0+'\x27',_0x358dd0),_0x4fa626[_0xc88a3d(0x174)]=_0xc88a3d(0x12b)+_0x3b9df0+_0xc88a3d(0x13f);}async function ensurePlugin(_0x33a1eb,_0x37d2d8,_0x3e7e90,_0x2aa6a2){const _0x3d80e2=a8_0x2c44a1;_0x3e7e90['text']='Installing\x20plugin\x20\x27'+_0x33a1eb+_0x3d80e2(0x13e),await executeClaudeCommand([_0x3d80e2(0x15b),_0x3d80e2(0x123),_0x33a1eb+'@'+_0x37d2d8],_0x3d80e2(0x11f)+_0x33a1eb+'\x27',_0x2aa6a2),_0x3e7e90[_0x3d80e2(0x174)]='✓\x20Plugin\x20\x27'+_0x33a1eb+_0x3d80e2(0xe0);}async function createClaudeSettings(_0x357820,_0x1c701a=a8_0x2c44a1(0x15e),_0x418639){const _0x1b9fca=a8_0x2c44a1,_0x8c5a73=join(process['cwd'](),_0x1b9fca(0xfa)),_0x244e7e=join(_0x8c5a73,_0x1b9fca(0x134));await mkdir(_0x8c5a73,{'recursive':!![]});let _0x66a4da={};if(existsSync(_0x244e7e))try{const _0x14ed02=await readFile(_0x244e7e,_0x1b9fca(0x138));_0x66a4da=JSON[_0x1b9fca(0x13c)](_0x14ed02);}catch{_0x66a4da={};}const _0x207fbf=_0x66a4da[_0x1b9fca(0xe7)]||{},_0x4f58a4={'ANTHROPIC_BASE_URL':_0x207fbf['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x207fbf[_0x1b9fca(0x119)],'ANTHROPIC_AUTH_TOKEN':_0x207fbf[_0x1b9fca(0x14b)],'statusLine':_0x66a4da[_0x1b9fca(0xec)]},_0x2e72d3={..._0x66a4da,'env':{..._0x207fbf,'ANTHROPIC_BASE_URL':_0x1b9fca(0x175)+_0x357820,'ANTHROPIC_MODEL':_0x1c701a,'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy'},'statusLine':{'type':_0x1b9fca(0x125),'command':_0x418639?'tdx\x20--profile\x20'+_0x418639+'\x20claude\x20statusline':'tdx\x20claude\x20statusline'}};return await writeFile(_0x244e7e,JSON['stringify'](_0x2e72d3,null,0x2)+'\x0a'),_0x4f58a4;}async function restoreClaudeSettings(_0x29f12e){const _0x50c918=a8_0x2c44a1,_0x73e9d8=join(process[_0x50c918(0x154)](),_0x50c918(0xfa)),_0x599483=join(_0x73e9d8,_0x50c918(0x134));if(!existsSync(_0x599483))return;try{const _0x4668aa=await readFile(_0x599483,_0x50c918(0x138)),_0x2361d2=JSON[_0x50c918(0x13c)](_0x4668aa),_0x5cb4be=_0x2361d2[_0x50c918(0xe7)]||{},_0x58f109=_0x5cb4be['ANTHROPIC_BASE_URL'],_0x4b99f9=((()=>{const _0x94226b=_0x50c918;if(typeof _0x58f109!==_0x94226b(0x162))return![];try{const _0x4db4ca=new URL(_0x58f109);return _0x4db4ca[_0x94226b(0xfc)]===_0x94226b(0xf2)||_0x4db4ca[_0x94226b(0xfc)]===_0x94226b(0x100);}catch{return![];}})());_0x4b99f9?(delete _0x5cb4be['ANTHROPIC_BASE_URL'],delete _0x5cb4be[_0x50c918(0x119)],delete _0x5cb4be[_0x50c918(0x14b)]):(_0x29f12e[_0x50c918(0x169)]!==undefined?_0x5cb4be[_0x50c918(0x169)]=_0x29f12e[_0x50c918(0x169)]:delete _0x5cb4be[_0x50c918(0x169)],_0x29f12e[_0x50c918(0x119)]!==undefined?_0x5cb4be[_0x50c918(0x119)]=_0x29f12e[_0x50c918(0x119)]:delete _0x5cb4be['ANTHROPIC_MODEL'],_0x29f12e['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x5cb4be[_0x50c918(0x14b)]=_0x29f12e[_0x50c918(0x14b)]:delete _0x5cb4be[_0x50c918(0x14b)]);const _0x3db0f2=_0x2361d2[_0x50c918(0xec)],_0x5d0708=((()=>{const _0x3a21e2=_0x50c918;if(!_0x3db0f2||typeof _0x3db0f2!==_0x3a21e2(0x10e))return![];if(_0x3db0f2[_0x3a21e2(0x10b)]!=='command')return![];if(typeof _0x3db0f2[_0x3a21e2(0x125)]!==_0x3a21e2(0x162))return![];return _0x3db0f2['command']['includes'](_0x3a21e2(0x16d))&&_0x3db0f2[_0x3a21e2(0x125)][_0x3a21e2(0x136)](_0x3a21e2(0xe9));})());if(_0x5d0708)delete _0x2361d2[_0x50c918(0xec)];else _0x29f12e[_0x50c918(0xec)]!==undefined?_0x2361d2[_0x50c918(0xec)]=_0x29f12e['statusLine']:delete _0x2361d2['statusLine'];_0x2361d2[_0x50c918(0xe7)]=_0x5cb4be,await writeFile(_0x599483,JSON[_0x50c918(0xf1)](_0x2361d2,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a8_0x2c44a1(0x15d)]=a8_0x2c44a1(0x10d);[a8_0x2c44a1(0xfb)]=a8_0x2c44a1(0x12e);[a8_0x2c44a1(0x133)];[a8_0x2c44a1(0x129)];[a8_0x2c44a1(0x173)];[a8_0x2c44a1(0xf8)];async[a8_0x2c44a1(0x131)](_0x1af747){const _0x1700c2=a8_0x2c44a1,{tdx:_0x3c61a3,options:_0x308e30,args:_0x17d44a}=_0x1af747;try{const _0x3a3c92=_0x308e30,_0x4a74a1=_0x3a3c92['model']||_0x1700c2(0x15e),_0x390f94=_0x3a3c92[_0x1700c2(0x149)]===![],_0x53fec5=_0x3a3c92[_0x1700c2(0x160)]===!![],_0x18d900=_0x3a3c92[_0x1700c2(0x146)]===!![],_0x35a1c7=[..._0x17d44a];if(_0x53fec5)_0x35a1c7[_0x1700c2(0x117)]('-c');else _0x18d900&&_0x35a1c7['unshift']('-r');const _0x2e0f49=createCommandSpinner('Initializing...',{'verbose':_0x308e30[_0x1700c2(0x12d)]});_0x2e0f49['start']();try{if(!_0x390f94){_0x2e0f49['text']=_0x1700c2(0x109),this['port']=await findAvailablePort(0xfa0),_0x2e0f49[_0x1700c2(0x174)]=_0x1700c2(0x14a)+this['port'],_0x2e0f49['text']=_0x1700c2(0xf9);const _0x476303=await _0x3c61a3[_0x1700c2(0x107)][_0x1700c2(0x11c)](),_0x516423=_0x476303['id'];_0x2e0f49['text']='✓\x20Using\x20project:\x20'+_0x476303[_0x1700c2(0xf3)][_0x1700c2(0x15d)];const _0x3e0020=_0x308e30[_0x1700c2(0x147)];try{const _0x5036ea=await _0x3c61a3[_0x1700c2(0x141)][_0x1700c2(0x16e)]();_0x5036ea[_0x1700c2(0x158)]&&writeCachedAccountInfo(_0x308e30[_0x1700c2(0x10a)],_0x5036ea['account_id'],_0x3e0020);}catch{}_0x2e0f49[_0x1700c2(0x174)]=_0x1700c2(0xe8),this[_0x1700c2(0x173)]=new TDXLogger(_0x308e30[_0x1700c2(0x13d)],!![]),await this[_0x1700c2(0x173)][_0x1700c2(0x157)]();const _0x24bdc9=this[_0x1700c2(0x173)]['getLogPath']();_0x2e0f49[_0x1700c2(0x174)]=_0x1700c2(0xe1)+_0x24bdc9,_0x2e0f49['text']=_0x1700c2(0x14c),this[_0x1700c2(0x133)]=new ProxyServer({'port':this['port'],'projectId':_0x516423,'tdx':_0x3c61a3,'logger':this['logger'],'site':_0x308e30[_0x1700c2(0x10a)]}),await this['server'][_0x1700c2(0x14d)](),_0x2e0f49[_0x1700c2(0x174)]=_0x1700c2(0x153)+this[_0x1700c2(0xf8)],_0x2e0f49['text']=_0x1700c2(0x12c),this[_0x1700c2(0x129)]=await createClaudeSettings(this[_0x1700c2(0xf8)],_0x4a74a1,_0x3e0020),_0x2e0f49[_0x1700c2(0x174)]=_0x1700c2(0xdf);}else _0x2e0f49['text']=_0x1700c2(0x144);try{_0x2e0f49[_0x1700c2(0x174)]=_0x1700c2(0xf6),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x1700c2(0x173)]),_0x2e0f49[_0x1700c2(0x174)]=_0x1700c2(0x10c);}catch(_0xd8e7fc){_0x2e0f49[_0x1700c2(0x177)](_0x1700c2(0x105));throw _0xd8e7fc;}try{await ensureMcpServer(_0x1700c2(0x10f),'https://docs.treasuredata.com/mcp','http',_0x2e0f49,this[_0x1700c2(0x173)]);}catch(_0x54176b){handleInstallationError(_0x54176b,'TD\x20Docs\x20MCP\x20Server',_0x2e0f49,this[_0x1700c2(0x173)]);}try{await ensureMarketplace(_0x1700c2(0x12f),'https://github.com/treasure-data/td-skills',_0x2e0f49,this[_0x1700c2(0x173)]),await updateMarketplace(_0x1700c2(0x12f),_0x2e0f49,this[_0x1700c2(0x173)]),await ensurePlugin(_0x1700c2(0xf7),'td-skills',_0x2e0f49,this[_0x1700c2(0x173)]),await ensurePlugin(_0x1700c2(0x13b),_0x1700c2(0x12f),_0x2e0f49,this[_0x1700c2(0x173)]),await ensurePlugin(_0x1700c2(0x118),_0x1700c2(0x12f),_0x2e0f49,this[_0x1700c2(0x173)]);}catch(_0x2f55f1){handleInstallationError(_0x2f55f1,_0x1700c2(0xe6),_0x2e0f49,this['logger']);}_0x2e0f49[_0x1700c2(0x116)]();}catch(_0x584aa4){_0x2e0f49[_0x1700c2(0x177)](_0x1700c2(0x115));throw _0x584aa4;}const _0x25a390=await this[_0x1700c2(0x16f)]();if(!_0x25a390)throw new SDKError(ErrorCode[_0x1700c2(0xe4)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x1700c2(0x170)});const _0x323c03={...process[_0x1700c2(0xe7)]};!_0x390f94&&(_0x323c03[_0x1700c2(0x169)]='http://127.0.0.1:'+this[_0x1700c2(0xf8)],_0x323c03['ANTHROPIC_MODEL']=_0x4a74a1,_0x323c03[_0x1700c2(0x14b)]=_0x1700c2(0xed));const _0x49bb32=spawn(_0x25a390,_0x35a1c7,{'stdio':_0x1700c2(0x139),'env':_0x323c03}),_0x3f41bd=await new Promise(_0x2e0220=>{const _0x9ad76c=_0x1700c2;_0x49bb32['on'](_0x9ad76c(0x112),_0xe03782=>{_0x2e0220(_0xe03782||0x0);}),_0x49bb32['on']('error',_0x242ff8=>{const _0x4cce92=_0x9ad76c;console[_0x4cce92(0x145)](a8_0x493afd[_0x4cce92(0xe5)](_0x4cce92(0x156)+_0x242ff8[_0x4cce92(0x122)])),_0x2e0220(0x1);});});this[_0x1700c2(0x133)]&&(await this[_0x1700c2(0x133)][_0x1700c2(0x116)](),console[_0x1700c2(0x16a)](a8_0x493afd[_0x1700c2(0x110)](_0x1700c2(0x15c))));if(this['logger']){await this[_0x1700c2(0x173)][_0x1700c2(0x151)]();const _0xc6b837=this['logger'][_0x1700c2(0x101)]();console[_0x1700c2(0x16a)](a8_0x493afd[_0x1700c2(0x110)]('✓\x20Logs\x20saved\x20to\x20'+_0xc6b837));}return this[_0x1700c2(0x129)]&&(await restoreClaudeSettings(this[_0x1700c2(0x129)]),console[_0x1700c2(0x16a)](a8_0x493afd['green'](_0x1700c2(0x152)))),_0x3f41bd;}catch(_0x7bd168){this['server']&&await this['server'][_0x1700c2(0x116)]();this['logger']&&await this[_0x1700c2(0x173)]['close']();this[_0x1700c2(0x129)]&&await restoreClaudeSettings(this[_0x1700c2(0x129)]);throw _0x7bd168;}}async['findClaudePath'](){return new Promise(_0x237dd2=>{const _0x215069=a8_0x4ba4,_0x3ecc0b=spawn(_0x215069(0xeb),['claude']);let _0x1db51f='';_0x3ecc0b[_0x215069(0x155)]['on']('data',_0x476701=>{const _0x8cf387=_0x215069;_0x1db51f+=_0x476701[_0x8cf387(0x121)]();}),_0x3ecc0b['on']('exit',_0x1f9eb5=>{const _0x207f30=_0x215069;_0x1f9eb5===0x0&&_0x1db51f[_0x207f30(0xfd)]()?_0x237dd2(_0x1db51f[_0x207f30(0xfd)]()):_0x237dd2(null);});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a9_0x464cfb=a9_0x3f3c;(function(_0x482887,_0x4abc11){const _0x2a6815=a9_0x3f3c,_0x56e3be=_0x482887();while(!![]){try{const _0x4b5d47=parseInt(_0x2a6815(0xfa))/0x1*(parseInt(_0x2a6815(0xe6))/0x2)+-parseInt(_0x2a6815(0xe7))/0x3*(-parseInt(_0x2a6815(0xda))/0x4)+-parseInt(_0x2a6815(0xdb))/0x5+-parseInt(_0x2a6815(0xe3))/0x6+-parseInt(_0x2a6815(0xf7))/0x7*(parseInt(_0x2a6815(0xe5))/0x8)+parseInt(_0x2a6815(0xf1))/0x9*(-parseInt(_0x2a6815(0xdf))/0xa)+parseInt(_0x2a6815(0xdc))/0xb;if(_0x4b5d47===_0x4abc11)break;else _0x56e3be['push'](_0x56e3be['shift']());}catch(_0x4de721){_0x56e3be['push'](_0x56e3be['shift']());}}}(a9_0x4ccb,0xdc74f));function a9_0x3f3c(_0x1649a3,_0x2f52f7){_0x1649a3=_0x1649a3-0xd3;const _0x4ccbad=a9_0x4ccb();let _0x3f3c61=_0x4ccbad[_0x1649a3];return _0x3f3c61;}import{createInterface}from'node:readline';function a9_0x4ccb(){const _0x517619=['🧠\x20','line','latestInputTokens','tdx\x20','\x20month','\x20-\x20','push','options','toFixed','3404520jaDXJn','session_id','join','log','monthCredits','profile','4886AYyhgp','tdx','\x20session\x20/\x20','58831ElYuMx','model','site','sessionCredits','close','name','\x20today\x20/\x20','parse','72FcjrBK','2500730KlppSD','20299609kUxeJy','💎\x20tdx\x20-\x20Claude','🪙\x20credit:\x20','30wFbLTk','💎\x20','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','statusline','8504676JvaNqm','Claude','7816xNaXdk','48ngaoRw','230001kkTNlO'];a9_0x4ccb=function(){return _0x517619;};return a9_0x4ccb();}import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x1a721c=0x64){return new Promise(_0x248b91=>{const _0x314676=a9_0x3f3c;let _0x2a97e5='',_0x3483f5=![];const _0x1859dc=createInterface({'input':process['stdin'],'terminal':![]}),_0x117aa3=_0x5ae87e=>{const _0x5fb822=a9_0x3f3c;if(_0x3483f5)return;_0x3483f5=!![],clearTimeout(_0x29bf41),_0x1859dc[_0x5fb822(0xd6)](),_0x248b91(_0x5ae87e);},_0x29bf41=setTimeout(()=>{_0x117aa3(null);},_0x1a721c);_0x1859dc['on'](_0x314676(0xe9),_0x5b2fca=>{_0x2a97e5+=_0x5b2fca;}),_0x1859dc['on'](_0x314676(0xd6),()=>{const _0x5e9388=_0x314676;if(_0x3483f5)return;try{const _0xe8ec98=JSON[_0x5e9388(0xd9)](_0x2a97e5);_0x117aa3(_0xe8ec98);}catch{_0x117aa3(null);}});});}function formatCredits(_0x45e44f){const _0x3dee6d=a9_0x3f3c;return _0x45e44f[_0x3dee6d(0xf0)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a9_0x464cfb(0xd7)]=a9_0x464cfb(0xe2);['description']=a9_0x464cfb(0xe1);async['execute'](_0x1dffd7){const _0x547ea8=a9_0x464cfb;try{const _0x4612fd=await readStdinJson();if(!_0x4612fd?.[_0x547ea8(0xf2)])return console[_0x547ea8(0xf4)](_0x547ea8(0xdd)),0x0;const _0x213314=_0x4612fd[_0x547ea8(0xf2)],_0x43ccc=_0x4612fd[_0x547ea8(0xd3)]?.['id']||'',_0x1aa2da=_0x4612fd[_0x547ea8(0xf6)]||_0x1dffd7[_0x547ea8(0xef)]['profile'],_0x1a643d=await getUsageStats(_0x213314,_0x1aa2da),_0x169514=[],_0xe9db72=readCachedAccountInfo(_0x1aa2da),_0x1f553d=_0xe9db72?_0x547ea8(0xeb)+_0xe9db72[_0x547ea8(0xd4)]+':'+_0xe9db72['accountId']:_0x547ea8(0xf8),_0x3fb8b4=_0x43ccc?getModelDisplayName(_0x43ccc):_0x547ea8(0xe4);_0x169514[_0x547ea8(0xee)](_0x547ea8(0xe0)+_0x1f553d+_0x547ea8(0xed)+_0x3fb8b4);const _0x74688=formatCredits(_0x1a643d[_0x547ea8(0xd5)]),_0x195ad6=formatCredits(_0x1a643d['todayCredits']),_0x1fc54c=formatCredits(_0x1a643d[_0x547ea8(0xf5)]);_0x169514['push'](_0x547ea8(0xde)+_0x74688+_0x547ea8(0xf9)+_0x195ad6+_0x547ea8(0xd8)+_0x1fc54c+_0x547ea8(0xec));if(_0x1a643d[_0x547ea8(0xea)]>0x0&&_0x43ccc){const _0x6544a9=formatTokenCount(_0x1a643d[_0x547ea8(0xea)]),_0x43d90b=calculateContextPercentage(_0x1a643d[_0x547ea8(0xea)],_0x43ccc);_0x169514[_0x547ea8(0xee)](_0x547ea8(0xe8)+_0x6544a9+'\x20('+_0x43d90b+'%)');}return console['log'](_0x169514[_0x547ea8(0xf3)]('\x20|\x20')),0x0;}catch{return console[_0x547ea8(0xf4)](_0x547ea8(0xdd)),0x0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a10_0x452aac=a10_0x1e4a;(function(_0x12fa0f,_0x37df70){const _0xa03144=a10_0x1e4a,_0x3b5cef=_0x12fa0f();while(!![]){try{const _0x13dfa3=-parseInt(_0xa03144(0x169))/0x1+-parseInt(_0xa03144(0x166))/0x2*(parseInt(_0xa03144(0x16b))/0x3)+-parseInt(_0xa03144(0x16a))/0x4*(-parseInt(_0xa03144(0x195))/0x5)+parseInt(_0xa03144(0x194))/0x6+parseInt(_0xa03144(0x167))/0x7+parseInt(_0xa03144(0x19a))/0x8*(parseInt(_0xa03144(0x188))/0x9)+-parseInt(_0xa03144(0x170))/0xa;if(_0x13dfa3===_0x37df70)break;else _0x3b5cef['push'](_0x3b5cef['shift']());}catch(_0x3f6889){_0x3b5cef['push'](_0x3b5cef['shift']());}}}(a10_0x29b4,0xe9aa9));import a10_0x18caa8 from'chalk';function a10_0x1e4a(_0x979db1,_0x2d84ea){_0x979db1=_0x979db1-0x160;const _0x29b497=a10_0x29b4();let _0x1e4ad7=_0x29b497[_0x979db1];return _0x1e4ad7;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x41f660){return _0x41f660['toFixed'](0x2);}function a10_0x29b4(){const _0x52b43b=['lastUsedAt','cyan','en-US','red','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','numeric','toLocaleTimeString','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','outputStructured','length','9IxTMka','\x20\x20Today:\x20\x20\x20','never','monthCredits','Requests','padStart','Credits','dim','default','repeat','log','2-digit','7453020nNxxbs','4395zOtHmr','json','padEnd','getTime','entryCount','4866920SLIcve','totalCredits','bold','\x20credits','description','profile','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','1262392hlOdWt','9815372PgsXxs','Usage\x20by\x20Profile','639230iJCNVW','7804bQKWtO','3xBRwwc','max','Profile','usage','Unknown\x20error','27401370ZIDghu','\x20\x20Total:\x20\x20\x20','round','toLocaleDateString','todayCredits','short','\x20days\x20ago','today\x20','jsonl','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','execute','error','en-CA','(default)'];a10_0x29b4=function(){return _0x52b43b;};return a10_0x29b4();}function formatLastUsed(_0x525998){const _0xf466d6=a10_0x1e4a;if(!_0x525998)return _0xf466d6(0x18a);const _0x4efb9f=new Date(_0x525998),_0x1b4ce8=new Date(),_0x5b3025=_0x4efb9f[_0xf466d6(0x173)](_0xf466d6(0x17c)),_0x14a57d=_0x1b4ce8['toLocaleDateString']('en-CA');if(_0x5b3025===_0x14a57d)return _0xf466d6(0x177)+_0x4efb9f[_0xf466d6(0x184)](_0xf466d6(0x180),{'hour':'2-digit','minute':_0xf466d6(0x193)});const _0x5e2489=new Date(_0x5b3025),_0x8cea5a=new Date(_0x14a57d),_0x4c32ff=Math[_0xf466d6(0x172)]((_0x8cea5a[_0xf466d6(0x198)]()-_0x5e2489[_0xf466d6(0x198)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x4c32ff===0x1)return'yesterday';else return _0x4c32ff>0x1&&_0x4c32ff<0x7?_0x4c32ff+_0xf466d6(0x176):_0x4efb9f[_0xf466d6(0x173)]('en-US',{'month':_0xf466d6(0x175),'day':_0xf466d6(0x183)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a10_0x452aac(0x16e);[a10_0x452aac(0x163)]=a10_0x452aac(0x179);async[a10_0x452aac(0x17a)](_0x3df6b0){const _0x346470=a10_0x452aac,{options:_0x6c6a0b}=_0x3df6b0,_0xa52d80=_0x6c6a0b['format']===_0x346470(0x196)||_0x6c6a0b['format']===_0x346470(0x178)||_0x6c6a0b['json'];try{const [_0x2ecb97,_0x41a246]=await Promise['all']([getAllProfileStats(),getUsageSummary()]);return _0xa52d80?await this['outputStructured'](_0x2ecb97,_0x41a246,_0x6c6a0b):this['outputTable'](_0x2ecb97,_0x41a246),0x0;}catch(_0x263501){const _0x8ca928=_0x263501 instanceof Error?_0x263501['message']:_0x346470(0x16f);return console[_0x346470(0x17b)](a10_0x18caa8[_0x346470(0x181)]('Error:\x20'+_0x8ca928)),0x1;}}async[a10_0x452aac(0x186)](_0x5e7ff8,_0x526543,_0x4d57a6){const _0x2bf265=a10_0x452aac,_0x212b7b={'summary':{'todayCredits':_0x526543[_0x2bf265(0x174)],'monthCredits':_0x526543[_0x2bf265(0x18b)],'totalCredits':_0x526543[_0x2bf265(0x160)],'profileCount':_0x526543['profileCount']},'profiles':_0x5e7ff8['map'](_0x2bb2d2=>({'profile':_0x2bb2d2['profile'],'credits':_0x2bb2d2['credits'],'requests':_0x2bb2d2['entryCount'],'lastUsedAt':_0x2bb2d2[_0x2bf265(0x17e)]}))};await handleSDKOutput([_0x212b7b],_0x4d57a6);}['outputTable'](_0x3327f9,_0x1e073b){const _0x2d4f75=a10_0x452aac;console[_0x2d4f75(0x192)](a10_0x18caa8[_0x2d4f75(0x161)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0x2d4f75(0x192)](a10_0x18caa8[_0x2d4f75(0x18f)]('─'[_0x2d4f75(0x191)](0x32))),console[_0x2d4f75(0x192)](_0x2d4f75(0x189)+a10_0x18caa8[_0x2d4f75(0x17f)](formatCredits(_0x1e073b[_0x2d4f75(0x174)]))+_0x2d4f75(0x162)),console[_0x2d4f75(0x192)]('\x20\x20Month:\x20\x20\x20'+a10_0x18caa8[_0x2d4f75(0x17f)](formatCredits(_0x1e073b[_0x2d4f75(0x18b)]))+'\x20credits'),console[_0x2d4f75(0x192)](_0x2d4f75(0x171)+a10_0x18caa8[_0x2d4f75(0x17f)](formatCredits(_0x1e073b[_0x2d4f75(0x160)]))+_0x2d4f75(0x162)),console['log']();if(_0x3327f9[_0x2d4f75(0x187)]===0x0){console[_0x2d4f75(0x192)](a10_0x18caa8[_0x2d4f75(0x18f)](_0x2d4f75(0x165))),console[_0x2d4f75(0x192)](a10_0x18caa8[_0x2d4f75(0x18f)](_0x2d4f75(0x185)));return;}console[_0x2d4f75(0x192)](a10_0x18caa8[_0x2d4f75(0x161)](_0x2d4f75(0x168))),console[_0x2d4f75(0x192)](a10_0x18caa8[_0x2d4f75(0x18f)]('─'[_0x2d4f75(0x191)](0x3c)));const _0x3ede09=Math[_0x2d4f75(0x16c)](0xc,..._0x3327f9['map'](_0x390a33=>_0x390a33['profile']===_0x2d4f75(0x190)?_0x2d4f75(0x17d)['length']:_0x390a33[_0x2d4f75(0x164)][_0x2d4f75(0x187)])),_0x30eefa=0xa,_0x26c2fc=0xa;console[_0x2d4f75(0x192)]('\x20\x20'+_0x2d4f75(0x16d)['padEnd'](_0x3ede09)+'\x20\x20'+_0x2d4f75(0x18e)[_0x2d4f75(0x18d)](_0x30eefa)+'\x20\x20'+_0x2d4f75(0x18c)[_0x2d4f75(0x18d)](_0x26c2fc)+'\x20\x20'+'Last\x20Used');for(const _0x2f5891 of _0x3327f9){const _0x2bf414=_0x2f5891[_0x2d4f75(0x164)]===_0x2d4f75(0x190)?_0x2d4f75(0x17d):_0x2f5891[_0x2d4f75(0x164)],_0x41fd7a=_0x2bf414[_0x2d4f75(0x197)](_0x3ede09),_0x58c396=_0x2f5891[_0x2d4f75(0x164)]===_0x2d4f75(0x190)?a10_0x18caa8[_0x2d4f75(0x18f)](_0x41fd7a):_0x41fd7a;console[_0x2d4f75(0x192)]('\x20\x20'+_0x58c396+'\x20\x20'+a10_0x18caa8[_0x2d4f75(0x17f)](formatCredits(_0x2f5891['credits'])['padStart'](_0x30eefa))+'\x20\x20'+String(_0x2f5891[_0x2d4f75(0x199)])[_0x2d4f75(0x18d)](_0x26c2fc)+'\x20\x20'+a10_0x18caa8[_0x2d4f75(0x18f)](formatLastUsed(_0x2f5891['lastUsedAt'])));}console[_0x2d4f75(0x192)](),console[_0x2d4f75(0x192)](a10_0x18caa8[_0x2d4f75(0x18f)](_0x2d4f75(0x182))),console[_0x2d4f75(0x192)]();}}
|