@treasuredata/tdx 0.20.0 → 0.20.1
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/agent-test-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.d.ts +9 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.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.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.d.ts +12 -0
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.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/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.d.ts +5 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.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/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.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/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.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.d.ts +7 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts +15 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +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/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +8 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +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/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.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/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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_0x4cc0e1=a4_0x4cb5;(function(_0x31f11c,_0x1a4f39){const _0x17c71b=a4_0x4cb5,_0x650828=_0x31f11c();while(!![]){try{const _0x372c52=parseInt(_0x17c71b(0x1b2))/0x1*(parseInt(_0x17c71b(0x1ac))/0x2)+parseInt(_0x17c71b(0x1c9))/0x3*(parseInt(_0x17c71b(0x140))/0x4)+-parseInt(_0x17c71b(0x167))/0x5*(parseInt(_0x17c71b(0x12c))/0x6)+-parseInt(_0x17c71b(0x170))/0x7*(parseInt(_0x17c71b(0x18c))/0x8)+-parseInt(_0x17c71b(0x1bc))/0x9+parseInt(_0x17c71b(0x18e))/0xa+parseInt(_0x17c71b(0x13d))/0xb;if(_0x372c52===_0x1a4f39)break;else _0x650828['push'](_0x650828['shift']());}catch(_0x345b18){_0x650828['push'](_0x650828['shift']());}}}(a4_0x1954,0xc5db0));import a4_0x1b83d5 from'chalk';function a4_0x1954(){const _0x1573c3=['Source:\x20','dryRun','cloneProject','\x20\x20tdx\x20agent\x20pull\x20','\x20--name\x20','MISSING_ARGUMENT','\x0aPush\x20','\x20new','Output\x20path:\x20','unchanged','\x20\x20Target:\x20','Using\x20project:\x20','log','Agent:\x20','Agent\x20','842wHOuqa','dim','\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','Analyzing\x20project\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','newProjectName','2771iAUCNr','-\x20nothing\x20pushed','\x20resources?','\x22\x20to\x20\x22','gray','llm','outputDir','diff','agentId','\x20|\x20','14059683aFnlMX','\x27\x20to\x20create\x20the\x20folder\x20structure.','-\x20no\x20files\x20written','Project\x20cloned\x20with\x20errors','agent:push','\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)','Dry\x20run\x20-\x20no\x20changes\x20made','join','utf-8','\x20\x20Knowledge\x20Base\x20\x22','\x20files?','\x22...','isNew','1308uhUtMJ','dirname','New\x20project:\x20','\x20\x20Knowledge\x20Bases:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20created','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Agent\x20pulled\x20successfully','cyan','\x20=\x20','INVALID_ARGUMENT','4599996Biuydu','sourceProjectName','Errors:','Failed\x20to\x20push\x20agent:\x20','\x20total','newProjectId','Clone\x20\x22','\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','llmProject','Pushing\x20to\x20project...','\x0aError:','red','agentName','\x20\x20Integration\x20\x22','projectId','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','found','28645067bUndLl','Would\x20clone:','yellow','3212rVMsbt','no_context','\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','Using\x20local\x20project:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','prompts','counts','updated','error','Project\x20cloned\x20successfully','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','action','site','context','new','Pushing\x20agent\x20from\x20\x22','Using\x20current\x20project:\x20','green','\x20\x20Agents:\x20','force','\x22:\x20','\x20updated','repeat','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Prompt\x20\x22','pullProject','\x20unchanged','reason','pushProject','description','\x0aChanges\x20to\x20agent\x20\x27','New\x20project\x20ID:\x20','\x0aErrors\x20found:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20context\x20project:\x20','\x22\x20to\x20a\x20different\x20profile','\x22\x20from\x20project\x20\x22','projectName','5xYvUyJ','\x20\x20Integrations:\x20','parse','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','push','\x0aPush\x20summary\x20for\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','cwd','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','791fSQYqF','tdx.json','\x20\x20Text\x20Knowledge\x20Bases:\x20','✔\x20Context\x20set:\x20','\x20resources\x20to\x20\x27','Cloning\x20\x22','agents','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','knowledgeBases','profile','yes','Project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','textKnowledgeBases','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','hasChanges','message','errors','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Writing\x20files...','Would\x20pull\x20agent:\x20','\x20changed','Summary:','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)','llm_project','pullAgent','No\x20tdx.json\x20found\x20in\x20','82448qTPqyT','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','1830510dFoOdY','outputPath','created','\x20--profile\x20','execute','\x20\x20Prompts:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aProject\x20pushed\x20with\x20errors','integrations','\x20\x20Source:\x20','agent:clone','name','New\x20project\x20name\x20is\x20required','session'];a4_0x1954=function(){return _0x1573c3;};return a4_0x1954();}import a4_0x353337 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';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x49d517){const _0x38bc57=a4_0x4cb5,_0x261984=[];if(_0x49d517['total']!==undefined)_0x261984['push'](_0x49d517['total']+_0x38bc57(0x130));if(_0x49d517[_0x38bc57(0x14f)]!==undefined&&_0x49d517[_0x38bc57(0x14f)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5[_0x38bc57(0x152)](_0x49d517[_0x38bc57(0x14f)]+'\x20new'));if(_0x49d517[_0x38bc57(0x190)]!==undefined&&_0x49d517[_0x38bc57(0x190)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5['green'](_0x49d517[_0x38bc57(0x190)]+_0x38bc57(0x1ce)));if(_0x49d517['updated']!==undefined&&_0x49d517[_0x38bc57(0x148)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5['yellow'](_0x49d517[_0x38bc57(0x148)]+_0x38bc57(0x156)));if(_0x49d517[_0x38bc57(0x1a6)]!==undefined&&_0x49d517[_0x38bc57(0x1a6)]>0x0)_0x261984['push'](a4_0x1b83d5[_0x38bc57(0x1b6)](_0x49d517[_0x38bc57(0x1a6)]+'\x20unchanged'));if(_0x49d517[_0x38bc57(0x181)]!==undefined&&_0x49d517[_0x38bc57(0x181)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5[_0x38bc57(0x137)](_0x49d517[_0x38bc57(0x181)]+_0x38bc57(0x142)));return _0x261984[_0x38bc57(0x1c3)](',\x20');}function displayDiffs(_0x567f91,_0x2e6abe,_0x5d9afe,_0x3aa9b8,_0x2fdbd1=[]){const _0xc2d73d=a4_0x4cb5;for(const _0xefe497 of _0x567f91){if(_0xefe497[_0xc2d73d(0x1b9)]){const _0x5a5abd=_0xefe497['agentName']||_0xefe497[_0xc2d73d(0x19a)];console['log'](_0xc2d73d(0x15f)+_0x5a5abd+'\x27:'),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)),console[_0xc2d73d(0x1a9)](_0xefe497[_0xc2d73d(0x1b9)]),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c));}}for(const _0x502c62 of _0x2e6abe){_0x502c62[_0xc2d73d(0x1b9)]&&(console[_0xc2d73d(0x1a9)](_0xc2d73d(0x17e)+_0x502c62[_0xc2d73d(0x19a)]+'\x27:'),console['log']('─'[_0xc2d73d(0x157)](0x3c)),console[_0xc2d73d(0x1a9)](_0x502c62[_0xc2d73d(0x1b9)]),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)));}for(const _0x23752e of _0x5d9afe){_0x23752e[_0xc2d73d(0x1b9)]&&(console[_0xc2d73d(0x1a9)](_0xc2d73d(0x183)+_0x23752e[_0xc2d73d(0x19a)]+'\x27:'),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)),console[_0xc2d73d(0x1a9)](_0x23752e['diff']),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)));}for(const _0x101a42 of _0x3aa9b8){_0x101a42[_0xc2d73d(0x1b9)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x101a42['name']+'\x27:'),console[_0xc2d73d(0x1a9)]('─'[_0xc2d73d(0x157)](0x3c)),console['log'](_0x101a42[_0xc2d73d(0x1b9)]),console[_0xc2d73d(0x1a9)]('─'[_0xc2d73d(0x157)](0x3c)));}for(const _0x22da69 of _0x2fdbd1){_0x22da69[_0xc2d73d(0x1b9)]&&(console['log'](_0xc2d73d(0x158)+_0x22da69[_0xc2d73d(0x19a)]+'\x27:'),console[_0xc2d73d(0x1a9)]('─'[_0xc2d73d(0x157)](0x3c)),console[_0xc2d73d(0x1a9)](_0x22da69[_0xc2d73d(0x1b9)]),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x4cc0e1(0x15e)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x4cc0e1(0x192)](_0x4a63dd){const _0xc7ad85=a4_0x4cc0e1,{options:_0x3d07cf,args:_0x251ba2,tdx:_0x5b98f8}=_0x4a63dd,_0x262b99=_0x251ba2[0x0],_0x46c353=_0x251ba2[0x1],_0x4b634c=_0x3d07cf['output'],_0x5d9268=_0x3d07cf['dryRun'],_0x318547=_0x3d07cf[_0xc7ad85(0x154)],_0x7d4557=_0x3d07cf[_0xc7ad85(0x17a)],_0x435cd0=_0x3d07cf['llmProject'];let _0x37af12,_0x173df9;const _0x2ba1ea=findAgentConfigPath(process['cwd']());if(_0x262b99){const _0x911cdd=a4_0x353337[_0xc7ad85(0x1c3)](_0x262b99,_0xc7ad85(0x171));if(existsSync(_0x911cdd))try{const _0x1c6460=JSON[_0xc7ad85(0x169)](readFileSync(_0x911cdd,_0xc7ad85(0x1c4)));_0x37af12=_0x1c6460[_0xc7ad85(0x189)],_0x173df9=_0x262b99,console[_0xc7ad85(0x1a9)](a4_0x1b83d5['dim']('Using\x20project\x20from\x20'+_0x911cdd+':\x20'+_0x37af12));}catch{_0x37af12=_0x262b99;}else _0x37af12=_0x262b99;}else{if(_0x2ba1ea)try{const _0x283998=JSON[_0xc7ad85(0x169)](readFileSync(_0x2ba1ea,_0xc7ad85(0x1c4)));_0x37af12=_0x283998[_0xc7ad85(0x189)],_0x173df9=a4_0x353337['dirname'](_0x2ba1ea),console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x1ad)](_0xc7ad85(0x1a8)+_0x37af12));}catch{_0x37af12=_0x435cd0;}else _0x37af12=_0x435cd0;}if(!_0x37af12)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x13f)](_0xc7ad85(0x13b))),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x188)),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x133)),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x1ae)),console[_0xc7ad85(0x1a9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x46c353){const {data:_0x22934e}=await withSpinner('Pulling\x20agent\x20\x22'+_0x46c353+_0xc7ad85(0x165)+_0x37af12+_0xc7ad85(0x1c7),()=>_0x5b98f8[_0xc7ad85(0x1b7)][_0xc7ad85(0x18a)](_0x37af12,_0x46c353,_0x4b634c,{'dryRun':_0x5d9268,'force':_0x318547}));if(_0x5d9268)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x13f)](_0xc7ad85(0x1b0))),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x185)+_0x22934e['agentName']),console['log'](_0xc7ad85(0x1a5)+_0x22934e[_0xc7ad85(0x18f)]),_0x22934e[_0xc7ad85(0x1b9)]&&(console[_0xc7ad85(0x1a9)]('\x0aChanges:'),console[_0xc7ad85(0x1a9)]('─'[_0xc7ad85(0x157)](0x3c)),console[_0xc7ad85(0x1a9)](_0x22934e[_0xc7ad85(0x1b9)]),console[_0xc7ad85(0x1a9)]('─'[_0xc7ad85(0x157)](0x3c))),0x0;return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x152)](_0xc7ad85(0x128))),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x1aa)+_0x22934e['agentName']),console[_0xc7ad85(0x1a9)]('Output:\x20'+_0x22934e[_0xc7ad85(0x18f)]),console[_0xc7ad85(0x1a9)]('Status:\x20'+(_0x22934e[_0xc7ad85(0x1c8)]?a4_0x1b83d5['green'](_0xc7ad85(0x14f)):_0x22934e[_0xc7ad85(0x17f)]?a4_0x1b83d5[_0xc7ad85(0x13f)](_0xc7ad85(0x148)):a4_0x1b83d5[_0xc7ad85(0x1b6)](_0xc7ad85(0x1a6)))),0x0;}const _0xa60b8b=_0x173df9||_0x4b634c,{data:_0x414770}=await withSpinner(_0xc7ad85(0x1af)+_0x37af12+_0xc7ad85(0x1c7),()=>_0x5b98f8['llm'][_0xc7ad85(0x15a)](_0x37af12,_0xa60b8b,{'dryRun':!![]})),_0x5e4de7=_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x176)][_0xc7ad85(0x14f)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x178)][_0xc7ad85(0x14f)]+_0x414770['counts'][_0xc7ad85(0x17d)][_0xc7ad85(0x14f)]+_0x414770['counts'][_0xc7ad85(0x146)][_0xc7ad85(0x14f)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x197)][_0xc7ad85(0x14f)],_0xec8f37=_0x414770['counts'][_0xc7ad85(0x176)][_0xc7ad85(0x148)]+_0x414770['counts'][_0xc7ad85(0x178)][_0xc7ad85(0x148)]+_0x414770['counts'][_0xc7ad85(0x17d)][_0xc7ad85(0x148)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x146)]['updated']+_0x414770[_0xc7ad85(0x147)]['integrations'][_0xc7ad85(0x148)],_0x4e47e9=_0x414770['counts'][_0xc7ad85(0x176)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x178)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x17d)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x146)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)]['integrations'][_0xc7ad85(0x1a6)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x414770[_0xc7ad85(0x166)]+'\x27:'),console[_0xc7ad85(0x1a9)]('\x20\x20'+a4_0x1b83d5['green']('+\x20'+_0x5e4de7+'\x20new')+'\x20|\x20'+a4_0x1b83d5[_0xc7ad85(0x13f)]('~\x20'+_0xec8f37+_0xc7ad85(0x186))+'\x20|\x20'+a4_0x1b83d5[_0xc7ad85(0x1ad)]('=\x20'+_0x4e47e9+_0xc7ad85(0x15b))),console[_0xc7ad85(0x1a9)]('\x20\x20Agents:\x20'+formatCountSummary(_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x176)])),console[_0xc7ad85(0x1a9)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x414770['counts']['knowledgeBases'])),console['log'](_0xc7ad85(0x172)+formatCountSummary(_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x17d)])),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x193)+formatCountSummary(_0x414770['counts']['prompts'])),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x168)+formatCountSummary(_0x414770[_0xc7ad85(0x147)]['integrations'])),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x1a7)+a4_0x1b83d5['cyan'](_0x414770[_0xc7ad85(0x1b8)])),displayDiffs(_0x414770[_0xc7ad85(0x176)],_0x414770[_0xc7ad85(0x178)],_0x414770['textKnowledgeBases'],_0x414770[_0xc7ad85(0x146)],_0x414770[_0xc7ad85(0x197)]);if(_0x5d9268)return console['log'](a4_0x1b83d5[_0xc7ad85(0x13f)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5e4de7===0x0&&_0xec8f37===0x0)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x152)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x414770[_0xc7ad85(0x166)]},_0x3d07cf['session']),console[_0xc7ad85(0x1a9)](a4_0x1b83d5['green'](_0xc7ad85(0x173)+a4_0x1b83d5[_0xc7ad85(0x1ad)](_0xc7ad85(0x189))+_0xc7ad85(0x12a)+a4_0x1b83d5[_0xc7ad85(0x129)](_0x414770[_0xc7ad85(0x166)]))),0x0;if(!_0x7d4557&&!_0x318547){if(!isInteractive())return console[_0xc7ad85(0x149)](a4_0x1b83d5[_0xc7ad85(0x137)](_0xc7ad85(0x136)),_0xc7ad85(0x127)),console['error'](a4_0x1b83d5[_0xc7ad85(0x1ad)](_0xc7ad85(0x17c))),0x1;const _0x1a9e37=await confirmKey('\x0aWrite\x20'+(_0x5e4de7+_0xec8f37)+_0xc7ad85(0x1c6));if(!_0x1a9e37)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x13f)]('Cancelled'),_0xc7ad85(0x1be)),0x1;}const {data:_0x5f2872}=await withSpinner(_0xc7ad85(0x184),()=>_0x5b98f8[_0xc7ad85(0x1b7)][_0xc7ad85(0x15a)](_0x37af12,_0xa60b8b,{'force':_0x318547}));return console['log'](a4_0x1b83d5[_0xc7ad85(0x152)]('\x0a✔\x20Pulled\x20'+(_0x5e4de7+_0xec8f37)+'\x20files\x20to\x20'+_0x5f2872[_0xc7ad85(0x1b8)])),saveSessionContext({'llm_project':_0x5f2872[_0xc7ad85(0x166)]},_0x3d07cf[_0xc7ad85(0x19c)]),console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x152)](_0xc7ad85(0x173)+a4_0x1b83d5[_0xc7ad85(0x1ad)]('llm_project')+_0xc7ad85(0x12a)+a4_0x1b83d5['cyan'](_0x5f2872[_0xc7ad85(0x166)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4cc0e1(0x19a)]=a4_0x4cc0e1(0x199);[a4_0x4cc0e1(0x15e)]=a4_0x4cc0e1(0x16d);async[a4_0x4cc0e1(0x192)](_0x3fc91b){const _0xaae92a=a4_0x4cc0e1,{options:_0x352807,args:_0x3603ab,tdx:_0x431cf0}=_0x3fc91b,_0x12bcca=_0x3603ab[0x0],_0x182eae=_0x352807[_0xaae92a(0x19a)],_0x16ae02=_0x352807[_0xaae92a(0x19e)],_0x200be8=_0x352807[_0xaae92a(0x17a)],_0x1fc5dd=_0x352807['site'],_0x4f490e=_0x352807['llmProject'];let _0x2a7da7;const _0x992afe=findAgentConfigPath(process[_0xaae92a(0x16e)]());if(_0x12bcca){const _0x489f3e=a4_0x353337[_0xaae92a(0x1c3)](_0x12bcca,_0xaae92a(0x171));existsSync(_0x489f3e)?(_0x2a7da7=_0x12bcca,console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x144)+_0x12bcca))):_0x2a7da7=_0x12bcca;}else{if(_0x992afe)_0x2a7da7=a4_0x353337[_0xaae92a(0x1ca)](_0x992afe),console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x151)+_0x2a7da7));else{if(_0x4f490e){const _0x23be23=sanitizeForFilesystem(_0x4f490e);let _0x2ed744=_0x23be23,_0x134abd=a4_0x353337[_0xaae92a(0x1c3)](process[_0xaae92a(0x16e)](),'agents',_0x23be23,_0xaae92a(0x171));if(!existsSync(_0x134abd)){const _0x166723=normalizeName(_0x4f490e),_0x1ad317=a4_0x353337[_0xaae92a(0x1c3)](process[_0xaae92a(0x16e)](),_0xaae92a(0x176),_0x166723,'tdx.json');existsSync(_0x1ad317)&&(_0x2ed744=_0x166723,_0x134abd=_0x1ad317);}if(existsSync(_0x134abd))_0x2a7da7=a4_0x353337[_0xaae92a(0x1ca)](_0x134abd),console['log'](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x144)+_0x2a7da7));else{const _0x2722e5=_0x352807[_0xaae92a(0x179)];if(_0x2722e5)throw new SDKError(ErrorCode[_0xaae92a(0x12b)],_0xaae92a(0x1cd)+_0x4f490e+_0xaae92a(0x164),undefined,{'helpText':_0xaae92a(0x194)+_0xaae92a(0x162)+(_0xaae92a(0x1a0)+_0x4f490e+'\x0a')+(_0xaae92a(0x143)+_0x2ed744+_0xaae92a(0x1a1)+(_0x182eae||'<new-name>')+_0xaae92a(0x191)+_0x2722e5)});_0x2a7da7=_0x4f490e,console[_0xaae92a(0x1a9)](a4_0x1b83d5['dim'](_0xaae92a(0x163)+_0x4f490e));}}}}if(!_0x2a7da7)return console['log'](a4_0x1b83d5['yellow'](_0xaae92a(0x16f))),console[_0xaae92a(0x1a9)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0xaae92a(0x1a9)](_0xaae92a(0x14b)),console[_0xaae92a(0x1a9)](_0xaae92a(0x1c1)),console[_0xaae92a(0x1a9)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x182eae)throw new SDKError(ErrorCode[_0xaae92a(0x1a2)],_0xaae92a(0x19b),undefined,{'helpText':_0xaae92a(0x177)});if(!_0x200be8&&!_0x16ae02){if(!isInteractive())return console[_0xaae92a(0x149)](a4_0x1b83d5['red']('\x0aError:'),_0xaae92a(0x127)),console['error'](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x17c))),0x1;const _0x3585c8=await confirmKey(_0xaae92a(0x132)+_0x2a7da7+'\x22\x20to\x20new\x20project\x20\x22'+_0x182eae+'\x22?');if(!_0x3585c8)return console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x13f)]('Cancelled')),0x1;}const {data:_0x1bdf19}=await withSpinner(_0xaae92a(0x175)+_0x2a7da7+_0xaae92a(0x1b5)+_0x182eae+'\x22...',()=>_0x431cf0['llm'][_0xaae92a(0x19f)](_0x2a7da7,_0x182eae,{'dryRun':_0x16ae02}));if(_0x16ae02)return console['log'](a4_0x1b83d5[_0xaae92a(0x13f)](_0xaae92a(0x1c2))),console[_0xaae92a(0x1a9)]('Source:\x20'+_0x1bdf19[_0xaae92a(0x12d)]),console['log']('New\x20project:\x20'+_0x182eae),console[_0xaae92a(0x1a9)](_0xaae92a(0x13e)),console[_0xaae92a(0x1a9)]('\x20\x20Agents:\x20'+_0x1bdf19['counts'][_0xaae92a(0x176)][_0xaae92a(0x190)]),console[_0xaae92a(0x1a9)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x178)]['created']),console[_0xaae92a(0x1a9)](_0xaae92a(0x193)+_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x146)][_0xaae92a(0x190)]),0x0;const _0x29835a=_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x176)]['errors']>0x0||_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x178)][_0xaae92a(0x181)]>0x0||_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x146)][_0xaae92a(0x181)]>0x0;_0x29835a?console[_0xaae92a(0x1a9)](a4_0x1b83d5['yellow'](_0xaae92a(0x1bf))):console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x152)](_0xaae92a(0x14a)));console['log'](_0xaae92a(0x19d)+_0x1bdf19[_0xaae92a(0x12d)]),console[_0xaae92a(0x1a9)](_0xaae92a(0x1cb)+_0x1bdf19[_0xaae92a(0x1b1)]),console[_0xaae92a(0x1a9)](_0xaae92a(0x160)+_0x1bdf19[_0xaae92a(0x131)]),console[_0xaae92a(0x1a9)](),console[_0xaae92a(0x1a9)](_0xaae92a(0x187)),console[_0xaae92a(0x1a9)](_0xaae92a(0x153)+formatCountSummary(_0x1bdf19['counts'][_0xaae92a(0x176)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x178)])),console[_0xaae92a(0x1a9)](_0xaae92a(0x193)+formatCountSummary(_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x146)])),console[_0xaae92a(0x1a9)](_0xaae92a(0x168)+formatCountSummary(_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x197)]));if(_0x29835a){console[_0xaae92a(0x1a9)](),console[_0xaae92a(0x1a9)](a4_0x1b83d5['red'](_0xaae92a(0x12e)));for(const _0x17662d of _0x1bdf19['agents']){_0x17662d[_0xaae92a(0x14c)]==='error'&&console['log'](a4_0x1b83d5[_0xaae92a(0x137)](_0xaae92a(0x182)+_0x17662d[_0xaae92a(0x138)]+_0xaae92a(0x155)+_0x17662d['error']));}for(const _0x5d4a51 of _0x1bdf19['knowledgeBases']){_0x5d4a51[_0xaae92a(0x14c)]===_0xaae92a(0x149)&&console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x137)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x5d4a51[_0xaae92a(0x19a)]+_0xaae92a(0x155)+_0x5d4a51[_0xaae92a(0x149)]));}for(const _0x299ec5 of _0x1bdf19[_0xaae92a(0x146)]){_0x299ec5[_0xaae92a(0x14c)]===_0xaae92a(0x149)&&console['log'](a4_0x1b83d5[_0xaae92a(0x137)]('\x20\x20Prompt\x20\x22'+_0x299ec5[_0xaae92a(0x19a)]+_0xaae92a(0x155)+_0x299ec5[_0xaae92a(0x149)]));}for(const _0x27e4ce of _0x1bdf19['integrations']){_0x27e4ce[_0xaae92a(0x14c)]===_0xaae92a(0x149)&&console[_0xaae92a(0x1a9)](a4_0x1b83d5['red'](_0xaae92a(0x139)+_0x27e4ce[_0xaae92a(0x19a)]+'\x22:\x20'+_0x27e4ce[_0xaae92a(0x149)]));}return 0x1;}console[_0xaae92a(0x1a9)]();const _0x2d058c=getLLMProjectUrl(_0x1fc5dd,_0x1bdf19['newProjectId']);return console[_0xaae92a(0x1a9)](_0xaae92a(0x17b)+a4_0x1b83d5[_0xaae92a(0x129)](_0x2d058c)),0x0;}}function a4_0x4cb5(_0x31242e,_0x355748){_0x31242e=_0x31242e-0x127;const _0x19545a=a4_0x1954();let _0x4cb521=_0x19545a[_0x31242e];return _0x4cb521;}export class AgentPushCommand extends BaseCommand{[a4_0x4cc0e1(0x19a)]=a4_0x4cc0e1(0x1c0);[a4_0x4cc0e1(0x15e)]=a4_0x4cc0e1(0x145);async[a4_0x4cc0e1(0x192)](_0x493af9){const _0x17831f=a4_0x4cc0e1,{options:_0xf71241,args:_0x64e008,tdx:_0x49eeb5}=_0x493af9;let _0x1b30c0=_0x64e008[0x0]||process[_0x17831f(0x16e)]();const _0x477f50=_0xf71241['dryRun'],_0x276612=_0xf71241[_0x17831f(0x154)],_0x9980ea=_0xf71241['yes'],_0x27b3e5=_0xf71241[_0x17831f(0x14d)],_0x142dee=a4_0x353337[_0x17831f(0x1c3)](_0x1b30c0,'agent.yml'),_0x57d44d=existsSync(_0x142dee);if(_0x57d44d){const {data:_0x3f230b}=await withSpinner(_0x17831f(0x150)+_0x1b30c0+_0x17831f(0x1c7),()=>_0x49eeb5['llm']['pushAgent'](_0x1b30c0,{'dryRun':_0x477f50,'force':_0x276612}));if(_0x477f50)return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)](_0x17831f(0x1c2))),console[_0x17831f(0x1a9)]('Would\x20push\x20agent:\x20'+_0x3f230b['agentName']),0x0;if(_0x3f230b[_0x17831f(0x14c)]===_0x17831f(0x149))return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x12f)+_0x3f230b[_0x17831f(0x149)])),0x1;console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x152)](_0x17831f(0x1ab)+_0x3f230b[_0x17831f(0x14c)]+'\x20successfully')),console[_0x17831f(0x1a9)]('Agent:\x20'+_0x3f230b[_0x17831f(0x138)]);if(_0x3f230b[_0x17831f(0x1ba)]&&_0x3f230b['projectId']){const _0xcb26c8=getLLMAgentChatUrl(_0x27b3e5,_0x3f230b['projectId'],_0x3f230b[_0x17831f(0x1ba)]);console[_0x17831f(0x1a9)]('Chat:\x20'+a4_0x1b83d5[_0x17831f(0x129)](_0xcb26c8));}return 0x0;}const _0x105bfb=_0xf71241[_0x17831f(0x134)],_0x3cc742=resolveProjectFromContext(_0x1b30c0,_0x105bfb);if(_0x3cc742[_0x17831f(0x13c)])_0x1b30c0=_0x3cc742['projectDir'],_0x3cc742['source']===_0x17831f(0x14e)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x1ad)](_0x17831f(0x1a8)+_0x1b30c0));else{let _0x31824c=_0x17831f(0x18d);_0x3cc742[_0x17831f(0x15c)]==='no_local_folder'&&(_0x31824c=_0x3cc742[_0x17831f(0x180)]+_0x17831f(0x16a)+_0x3cc742[_0x17831f(0x134)]+_0x17831f(0x1bd));throw new SDKError(ErrorCode[_0x17831f(0x12b)],_0x3cc742[_0x17831f(0x15c)]===_0x17831f(0x141)?_0x3cc742[_0x17831f(0x180)]:_0x17831f(0x18b)+_0x1b30c0,undefined,{'helpText':_0x31824c});}const {data:_0x531036}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x49eeb5[_0x17831f(0x1b7)]['pushProject'](_0x1b30c0,{'dryRun':!![]})),_0x2e2876=_0x531036[_0x17831f(0x147)]['agents'][_0x17831f(0x181)]>0x0;if(_0x2e2876){console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x161)));for(const _0x210a4a of _0x531036['agents']){_0x210a4a[_0x17831f(0x14c)]===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x182)+_0x210a4a[_0x17831f(0x138)]+'\x22:\x20'+_0x210a4a[_0x17831f(0x149)]));}return 0x1;}const _0x2b7e6b=_0x531036[_0x17831f(0x147)]['agents'][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x178)][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)]['textKnowledgeBases'][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x146)][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)]['integrations'][_0x17831f(0x190)],_0x293adc=_0x531036[_0x17831f(0x147)]['agents'][_0x17831f(0x148)]+_0x531036[_0x17831f(0x147)]['knowledgeBases'][_0x17831f(0x148)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x17d)][_0x17831f(0x148)]+_0x531036['counts'][_0x17831f(0x146)][_0x17831f(0x148)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x197)][_0x17831f(0x148)],_0xdc397a=_0x531036[_0x17831f(0x147)][_0x17831f(0x176)][_0x17831f(0x1a6)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x178)]['unchanged']+_0x531036['counts'][_0x17831f(0x17d)]['unchanged']+_0x531036[_0x17831f(0x147)][_0x17831f(0x146)]['unchanged']+_0x531036['counts'][_0x17831f(0x197)][_0x17831f(0x1a6)];console[_0x17831f(0x1a9)](_0x17831f(0x16c)+_0x531036[_0x17831f(0x166)]+'\x27:'),console['log']('\x20\x20'+a4_0x1b83d5['green']('+\x20'+_0x2b7e6b+_0x17831f(0x1a4))+_0x17831f(0x1bb)+a4_0x1b83d5[_0x17831f(0x13f)]('~\x20'+_0x293adc+_0x17831f(0x186))+_0x17831f(0x1bb)+a4_0x1b83d5['dim']('=\x20'+_0xdc397a+_0x17831f(0x15b))),console[_0x17831f(0x1a9)](_0x17831f(0x153)+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x176)])),console['log'](_0x17831f(0x1cc)+formatCountSummary(_0x531036['counts'][_0x17831f(0x178)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x17d)])),console[_0x17831f(0x1a9)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x146)])),console[_0x17831f(0x1a9)](_0x17831f(0x168)+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x197)])),console[_0x17831f(0x1a9)](_0x17831f(0x198)+a4_0x1b83d5[_0x17831f(0x129)](_0x1b30c0)),displayDiffs(_0x531036['agents'],_0x531036['knowledgeBases'],_0x531036[_0x17831f(0x17d)],_0x531036['prompts'],_0x531036[_0x17831f(0x197)]);if(_0x477f50)return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x2b7e6b===0x0&&_0x293adc===0x0){console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x152)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0xc4f4d6=getLLMProjectUrl(_0x27b3e5,_0x531036[_0x17831f(0x13a)]);return console[_0x17831f(0x1a9)](_0x17831f(0x17b)+a4_0x1b83d5['cyan'](_0xc4f4d6)),0x0;}if(!_0x9980ea&&!_0x276612){if(!isInteractive())return console[_0x17831f(0x149)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x136)),_0x17831f(0x127)),console[_0x17831f(0x149)](a4_0x1b83d5[_0x17831f(0x1ad)](_0x17831f(0x17c))),0x1;const _0x264fd3=await confirmKey(_0x17831f(0x1a3)+(_0x2b7e6b+_0x293adc)+_0x17831f(0x1b4));if(!_0x264fd3)return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)]('Cancelled'),_0x17831f(0x1b3)),0x1;}const {data:_0x5e6721}=await withSpinner(_0x17831f(0x135),()=>_0x49eeb5[_0x17831f(0x1b7)][_0x17831f(0x15d)](_0x1b30c0,{'force':_0x276612})),_0xe5f1bc=_0x5e6721[_0x17831f(0x147)][_0x17831f(0x176)][_0x17831f(0x181)]>0x0||_0x5e6721[_0x17831f(0x147)][_0x17831f(0x178)][_0x17831f(0x181)]>0x0||_0x5e6721[_0x17831f(0x147)][_0x17831f(0x17d)][_0x17831f(0x181)]>0x0||_0x5e6721['counts'][_0x17831f(0x146)]['errors']>0x0;if(_0xe5f1bc){console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)](_0x17831f(0x196))),console[_0x17831f(0x1a9)](),console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x12e)));for(const _0x5b0865 of _0x5e6721['agents']){_0x5b0865['action']===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)]('\x20\x20Agent\x20\x22'+_0x5b0865[_0x17831f(0x138)]+'\x22:\x20'+_0x5b0865[_0x17831f(0x149)]));}for(const _0x38c00c of _0x5e6721[_0x17831f(0x178)]){_0x38c00c['action']===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x1c5)+_0x38c00c[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x38c00c[_0x17831f(0x149)]));}for(const _0x149e5d of _0x5e6721['textKnowledgeBases']){_0x149e5d[_0x17831f(0x14c)]===_0x17831f(0x149)&&console['log'](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x195)+_0x149e5d[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x149e5d['error']));}for(const _0x2dc9dc of _0x5e6721[_0x17831f(0x146)]){_0x2dc9dc[_0x17831f(0x14c)]===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x159)+_0x2dc9dc[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x2dc9dc[_0x17831f(0x149)]));}for(const _0x268c9a of _0x5e6721['integrations']){_0x268c9a[_0x17831f(0x14c)]===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x139)+_0x268c9a[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x268c9a[_0x17831f(0x149)]));}return 0x1;}console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x152)]('\x0a✔\x20Pushed\x20'+(_0x2b7e6b+_0x293adc)+_0x17831f(0x174)+_0x5e6721[_0x17831f(0x166)]+'\x27'));const _0x12eb36=getLLMProjectUrl(_0x27b3e5,_0x5e6721[_0x17831f(0x13a)]);return console[_0x17831f(0x1a9)](_0x17831f(0x17b)+a4_0x1b83d5[_0x17831f(0x129)](_0x12eb36)),0x0;}}
|
|
1
|
+
const a4_0x1d306b=a4_0x3fe4;(function(_0x588dcf,_0x2025c1){const _0x390750=a4_0x3fe4,_0x40a005=_0x588dcf();while(!![]){try{const _0x5b2a25=parseInt(_0x390750(0x208))/0x1+parseInt(_0x390750(0x1b3))/0x2*(parseInt(_0x390750(0x1cd))/0x3)+-parseInt(_0x390750(0x1fb))/0x4+parseInt(_0x390750(0x1c4))/0x5+parseInt(_0x390750(0x1bb))/0x6*(-parseInt(_0x390750(0x23e))/0x7)+parseInt(_0x390750(0x1c9))/0x8+parseInt(_0x390750(0x1c6))/0x9;if(_0x5b2a25===_0x2025c1)break;else _0x40a005['push'](_0x40a005['shift']());}catch(_0x129d94){_0x40a005['push'](_0x40a005['shift']());}}}(a4_0x481f,0x7c71c));import a4_0xc7962c from'chalk';import a4_0x4d96fd 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';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x481f(){const _0x3cb6dd=['\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20updated','\x20=\x20','\x20changed','Agent:\x20','created','Clone\x20\x22','pullAgent','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Using\x20local\x20project:\x20','push','action','gray','log','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','green','textKnowledgeBases','session','updated','Using\x20project:\x20','\x22\x20to\x20new\x20project\x20\x22','\x0aErrors\x20found:','\x20successfully','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','3633732fxObFW','cwd','Output:\x20','name','outputDir','reason','pushProject','\x0aPush\x20','source','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','✔\x20Context\x20set:\x20','projectId','\x0aWrite\x20','16860mxoLgZ','Source:\x20','agents','Errors:','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','Pushing\x20to\x20project...','counts','\x0aPush\x20summary\x20for\x20\x27','no_context','prompts','found','\x20total','Analyzing\x20project\x20\x22','cyan','pullProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Agent\x20pulled\x20successfully','Status:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Failed\x20to\x20push\x20agent:\x20','llmProject','diff','No\x20tdx.json\x20found\x20in\x20','\x20files\x20to\x20','Dry\x20run\x20-\x20no\x20changes\x20made','llm','\x22...','tdx.json','New\x20project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agent:pull','\x20\x20Text\x20Knowledge\x20Bases:\x20','\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)','parse','Output\x20path:\x20','Chat:\x20','Cancelled','\x22\x20to\x20\x22','\x0a✔\x20Pulled\x20','\x0aChanges\x20to\x20agent\x20\x27','Would\x20pull\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','llm_project','agentId','\x22:\x20','total','projectName','join','force','-\x20nothing\x20pushed','context','Project:\x20','447503TtFMvU','Would\x20clone:','description','message','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Agent\x20','repeat','Writing\x20files...','yes','knowledgeBases','agentName','error','INVALID_ARGUMENT','Pushing\x20agent\x20from\x20\x22','New\x20project\x20ID:\x20','output','\x20\x20Prompts:\x20','\x20\x20Agents:\x20','\x20new','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20--name\x20','\x20|\x20','\x0a✔\x20Pushed\x20','sourceProjectName','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20created','\x20\x20Knowledge\x20Bases:\x20','execute','dim','\x27\x20to\x20create\x20the\x20folder\x20structure.','\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','140958XonELV','outputPath','\x20\x20Integrations:\x20','-\x20no\x20files\x20written','\x20\x20Agent\x20\x22','\x20\x20Integration\x20\x22','no_local_folder','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','48nhtRiN','Using\x20context\x20project:\x20','\x0aChanges:','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Cloning\x20\x22','red','New\x20project\x20name\x20is\x20required','\x0aError:','Pulling\x20agent\x20\x22','2242370JkNfQI','\x20errors','266382JrJjlO','newProjectId','\x20resources\x20to\x20\x27','5275104sGvBWK','isNew','\x20--profile\x20','hasChanges','33nEUDgP','\x0aPull\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','agent:clone','Dry\x20run\x20-\x20no\x20files\x20written','<new-name>','site','unchanged','errors','dirname','dryRun','\x20unchanged','cloneProject','Analyzing\x20changes\x20to\x20push...','utf-8','yellow','new','integrations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'];a4_0x481f=function(){return _0x3cb6dd;};return a4_0x481f();}function a4_0x3fe4(_0x418f92,_0x58b9aa){_0x418f92=_0x418f92-0x1b2;const _0x481f7b=a4_0x481f();let _0x3fe49c=_0x481f7b[_0x418f92];return _0x3fe49c;}import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x46d5af){const _0x54eaa1=a4_0x3fe4,_0x4dad8b=[];if(_0x46d5af[_0x54eaa1(0x237)]!==undefined)_0x4dad8b[_0x54eaa1(0x1eb)](_0x46d5af['total']+_0x54eaa1(0x215));if(_0x46d5af[_0x54eaa1(0x1de)]!==undefined&&_0x46d5af[_0x54eaa1(0x1de)]>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1f2)](_0x46d5af['new']+_0x54eaa1(0x250)));if(_0x46d5af[_0x54eaa1(0x1e6)]!==undefined&&_0x46d5af[_0x54eaa1(0x1e6)]>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1f2)](_0x46d5af[_0x54eaa1(0x1e6)]+_0x54eaa1(0x257)));if(_0x46d5af[_0x54eaa1(0x1f5)]!==undefined&&_0x46d5af[_0x54eaa1(0x1f5)]>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1dd)](_0x46d5af[_0x54eaa1(0x1f5)]+_0x54eaa1(0x1e2)));if(_0x46d5af[_0x54eaa1(0x1d5)]!==undefined&&_0x46d5af['unchanged']>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1ed)](_0x46d5af[_0x54eaa1(0x1d5)]+_0x54eaa1(0x1d9)));if(_0x46d5af[_0x54eaa1(0x1d6)]!==undefined&&_0x46d5af[_0x54eaa1(0x1d6)]>0x0)_0x4dad8b['push'](a4_0xc7962c[_0x54eaa1(0x1c0)](_0x46d5af[_0x54eaa1(0x1d6)]+_0x54eaa1(0x1c5)));return _0x4dad8b[_0x54eaa1(0x239)](',\x20');}function displayDiffs(_0x42f125,_0x23c459,_0x256317,_0x5a9d7b,_0xb71834=[]){const _0x30d5c8=a4_0x3fe4;for(const _0x968760 of _0x42f125){if(_0x968760[_0x30d5c8(0x21f)]){const _0x5a8cda=_0x968760[_0x30d5c8(0x248)]||_0x968760[_0x30d5c8(0x1fe)];console[_0x30d5c8(0x1ee)](_0x30d5c8(0x231)+_0x5a8cda+'\x27:'),console['log']('─'[_0x30d5c8(0x244)](0x3c)),console['log'](_0x968760[_0x30d5c8(0x21f)]),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c));}}for(const _0x318b6c of _0x23c459){_0x318b6c['diff']&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x318b6c[_0x30d5c8(0x1fe)]+'\x27:'),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)),console[_0x30d5c8(0x1ee)](_0x318b6c['diff']),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)));}for(const _0x4d1acd of _0x256317){_0x4d1acd[_0x30d5c8(0x21f)]&&(console[_0x30d5c8(0x1ee)](_0x30d5c8(0x1e1)+_0x4d1acd['name']+'\x27:'),console['log']('─'[_0x30d5c8(0x244)](0x3c)),console['log'](_0x4d1acd[_0x30d5c8(0x21f)]),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)));}for(const _0x41f98e of _0x5a9d7b){_0x41f98e[_0x30d5c8(0x21f)]&&(console[_0x30d5c8(0x1ee)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x41f98e[_0x30d5c8(0x1fe)]+'\x27:'),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)),console[_0x30d5c8(0x1ee)](_0x41f98e['diff']),console['log']('─'[_0x30d5c8(0x244)](0x3c)));}for(const _0x5293b7 of _0xb71834){_0x5293b7[_0x30d5c8(0x21f)]&&(console[_0x30d5c8(0x1ee)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x5293b7[_0x30d5c8(0x1fe)]+'\x27:'),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)),console[_0x30d5c8(0x1ee)](_0x5293b7[_0x30d5c8(0x21f)]),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x1d306b(0x228);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x1d306b(0x259)](_0x8a8f78){const _0x557754=a4_0x1d306b,{options:_0x46f18f,args:_0xaf7694,tdx:_0xf41345}=_0x8a8f78,_0x3b5879=_0xaf7694[0x0],_0x8e6368=_0xaf7694[0x1],_0x546383=_0x46f18f[_0x557754(0x24d)],_0x5d7042=_0x46f18f[_0x557754(0x1d8)],_0x3c9cca=_0x46f18f[_0x557754(0x23a)],_0x1ba291=_0x46f18f['yes'],_0x38a59f=_0x46f18f[_0x557754(0x21e)];let _0x5191af,_0x13fea0;const _0x156f80=findAgentConfigPath(process[_0x557754(0x1fc)]());if(_0x3b5879){const _0x37d56d=a4_0x4d96fd[_0x557754(0x239)](_0x3b5879,_0x557754(0x225));if(existsSync(_0x37d56d))try{const _0x2e2af4=JSON[_0x557754(0x22b)](readFileSync(_0x37d56d,_0x557754(0x1dc)));_0x5191af=_0x2e2af4[_0x557754(0x234)],_0x13fea0=_0x3b5879,console[_0x557754(0x1ee)](a4_0xc7962c['dim']('Using\x20project\x20from\x20'+_0x37d56d+':\x20'+_0x5191af));}catch{_0x5191af=_0x3b5879;}else _0x5191af=_0x3b5879;}else{if(_0x156f80)try{const _0x19147d=JSON['parse'](readFileSync(_0x156f80,_0x557754(0x1dc)));_0x5191af=_0x19147d[_0x557754(0x234)],_0x13fea0=a4_0x4d96fd[_0x557754(0x1d7)](_0x156f80),console['log'](a4_0xc7962c['dim'](_0x557754(0x1f6)+_0x5191af));}catch{_0x5191af=_0x38a59f;}else _0x5191af=_0x38a59f;}if(!_0x5191af)return console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1dd)](_0x557754(0x1f1))),console['log']('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[_0x557754(0x1ee)]('\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'),console[_0x557754(0x1ee)](_0x557754(0x1b2)),console['log'](_0x557754(0x219)),0x1;if(_0x8e6368){const {data:_0x39d8ea}=await withSpinner(_0x557754(0x1c3)+_0x8e6368+'\x22\x20from\x20project\x20\x22'+_0x5191af+_0x557754(0x224),()=>_0xf41345[_0x557754(0x223)][_0x557754(0x1e8)](_0x5191af,_0x8e6368,_0x546383,{'dryRun':_0x5d7042,'force':_0x3c9cca}));if(_0x5d7042)return console[_0x557754(0x1ee)](a4_0xc7962c['yellow'](_0x557754(0x1d2))),console[_0x557754(0x1ee)](_0x557754(0x232)+_0x39d8ea[_0x557754(0x248)]),console['log'](_0x557754(0x22c)+_0x39d8ea['outputPath']),_0x39d8ea[_0x557754(0x21f)]&&(console[_0x557754(0x1ee)](_0x557754(0x1bd)),console[_0x557754(0x1ee)]('─'[_0x557754(0x244)](0x3c)),console[_0x557754(0x1ee)](_0x39d8ea[_0x557754(0x21f)]),console[_0x557754(0x1ee)]('─'[_0x557754(0x244)](0x3c))),0x0;return console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x21a))),console[_0x557754(0x1ee)](_0x557754(0x1e5)+_0x39d8ea['agentName']),console[_0x557754(0x1ee)](_0x557754(0x1fd)+_0x39d8ea[_0x557754(0x1b4)]),console['log'](_0x557754(0x21b)+(_0x39d8ea[_0x557754(0x1ca)]?a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x1de)):_0x39d8ea[_0x557754(0x1cc)]?a4_0xc7962c[_0x557754(0x1dd)]('updated'):a4_0xc7962c['gray'](_0x557754(0x1d5)))),0x0;}const _0xdea496=_0x13fea0||_0x546383,{data:_0x2f6c94}=await withSpinner(_0x557754(0x216)+_0x5191af+'\x22...',()=>_0xf41345[_0x557754(0x223)][_0x557754(0x218)](_0x5191af,_0xdea496,{'dryRun':!![]})),_0x58f59c=_0x2f6c94['counts'][_0x557754(0x20a)][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)]['knowledgeBases'][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x213)][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)][_0x557754(0x1de)],_0x1d9721=_0x2f6c94['counts'][_0x557754(0x20a)][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x247)][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x213)][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)][_0x557754(0x1f5)],_0x251b6b=_0x2f6c94['counts'][_0x557754(0x20a)][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x247)][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x213)][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)]['unchanged'];console[_0x557754(0x1ee)](_0x557754(0x1ce)+_0x2f6c94[_0x557754(0x238)]+'\x27:'),console['log']('\x20\x20'+a4_0xc7962c[_0x557754(0x1f2)]('+\x20'+_0x58f59c+_0x557754(0x250))+'\x20|\x20'+a4_0xc7962c[_0x557754(0x1dd)]('~\x20'+_0x1d9721+_0x557754(0x1e4))+'\x20|\x20'+a4_0xc7962c['dim']('=\x20'+_0x251b6b+'\x20unchanged')),console[_0x557754(0x1ee)](_0x557754(0x24f)+formatCountSummary(_0x2f6c94[_0x557754(0x210)][_0x557754(0x20a)])),console[_0x557754(0x1ee)](_0x557754(0x258)+formatCountSummary(_0x2f6c94['counts']['knowledgeBases'])),console[_0x557754(0x1ee)](_0x557754(0x229)+formatCountSummary(_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'])),console[_0x557754(0x1ee)](_0x557754(0x24e)+formatCountSummary(_0x2f6c94['counts'][_0x557754(0x213)])),console[_0x557754(0x1ee)](_0x557754(0x1b5)+formatCountSummary(_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)])),console['log']('\x20\x20Target:\x20'+a4_0xc7962c[_0x557754(0x217)](_0x2f6c94[_0x557754(0x1ff)])),displayDiffs(_0x2f6c94[_0x557754(0x20a)],_0x2f6c94['knowledgeBases'],_0x2f6c94['textKnowledgeBases'],_0x2f6c94[_0x557754(0x213)],_0x2f6c94[_0x557754(0x1df)]);if(_0x5d7042)return console['log'](a4_0xc7962c[_0x557754(0x1dd)](_0x557754(0x233))),0x0;if(_0x58f59c===0x0&&_0x1d9721===0x0)return console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x227))),saveSessionContext({'llm_project':_0x2f6c94[_0x557754(0x238)]},_0x46f18f[_0x557754(0x1f4)]),console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x205)+a4_0xc7962c[_0x557754(0x25a)]('llm_project')+'\x20=\x20'+a4_0xc7962c['cyan'](_0x2f6c94['projectName']))),0x0;if(!_0x1ba291&&!_0x3c9cca){if(!isInteractive())return console[_0x557754(0x249)](a4_0xc7962c['red'](_0x557754(0x1c2)),_0x557754(0x1e0)),console[_0x557754(0x249)](a4_0xc7962c['dim'](_0x557754(0x1fa))),0x1;const _0x10c5cf=await confirmKey(_0x557754(0x207)+(_0x58f59c+_0x1d9721)+'\x20files?');if(!_0x10c5cf)return console[_0x557754(0x1ee)](a4_0xc7962c['yellow'](_0x557754(0x22e)),_0x557754(0x1b6)),0x1;}const {data:_0x5f3313}=await withSpinner(_0x557754(0x245),()=>_0xf41345[_0x557754(0x223)][_0x557754(0x218)](_0x5191af,_0xdea496,{'force':_0x3c9cca}));return console[_0x557754(0x1ee)](a4_0xc7962c['green'](_0x557754(0x230)+(_0x58f59c+_0x1d9721)+_0x557754(0x221)+_0x5f3313[_0x557754(0x1ff)])),saveSessionContext({'llm_project':_0x5f3313[_0x557754(0x238)]},_0x46f18f[_0x557754(0x1f4)]),console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x205)+a4_0xc7962c[_0x557754(0x25a)](_0x557754(0x234))+_0x557754(0x1e3)+a4_0xc7962c[_0x557754(0x217)](_0x5f3313['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1d306b(0x1fe)]=a4_0x1d306b(0x1d1);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x1d306b(0x259)](_0x5c1f0c){const _0x2d8c14=a4_0x1d306b,{options:_0x955d79,args:_0x2f726b,tdx:_0x5bbe22}=_0x5c1f0c,_0x5024e4=_0x2f726b[0x0],_0x1351b6=_0x955d79[_0x2d8c14(0x1fe)],_0x28e525=_0x955d79['dryRun'],_0x4a4a68=_0x955d79[_0x2d8c14(0x246)],_0x59a46f=_0x955d79['site'],_0x2916df=_0x955d79['llmProject'];let _0x3a6da7;const _0x486a5f=findAgentConfigPath(process[_0x2d8c14(0x1fc)]());if(_0x5024e4){const _0x19c88e=a4_0x4d96fd[_0x2d8c14(0x239)](_0x5024e4,_0x2d8c14(0x225));existsSync(_0x19c88e)?(_0x3a6da7=_0x5024e4,console['log'](a4_0xc7962c[_0x2d8c14(0x25a)](_0x2d8c14(0x1ea)+_0x5024e4))):_0x3a6da7=_0x5024e4;}else{if(_0x486a5f)_0x3a6da7=a4_0x4d96fd[_0x2d8c14(0x1d7)](_0x486a5f),console['log'](a4_0xc7962c['dim']('Using\x20current\x20project:\x20'+_0x3a6da7));else{if(_0x2916df){const _0x15461a=sanitizeForFilesystem(_0x2916df);let _0x132811=_0x15461a,_0x48a7bd=a4_0x4d96fd['join'](process[_0x2d8c14(0x1fc)](),_0x2d8c14(0x20a),_0x15461a,_0x2d8c14(0x225));if(!existsSync(_0x48a7bd)){const _0x2d99ce=normalizeName(_0x2916df),_0x5a6c76=a4_0x4d96fd[_0x2d8c14(0x239)](process[_0x2d8c14(0x1fc)](),_0x2d8c14(0x20a),_0x2d99ce,_0x2d8c14(0x225));existsSync(_0x5a6c76)&&(_0x132811=_0x2d99ce,_0x48a7bd=_0x5a6c76);}if(existsSync(_0x48a7bd))_0x3a6da7=a4_0x4d96fd[_0x2d8c14(0x1d7)](_0x48a7bd),console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x25a)]('Using\x20local\x20project:\x20'+_0x3a6da7));else{const _0x5918c6=_0x955d79['profile'];if(_0x5918c6)throw new SDKError(ErrorCode[_0x2d8c14(0x24a)],_0x2d8c14(0x242)+_0x2916df+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2d8c14(0x1ef)+_0x2d8c14(0x256)+(_0x2d8c14(0x20c)+_0x2916df+'\x0a')+(_0x2d8c14(0x20e)+_0x132811+_0x2d8c14(0x252)+(_0x1351b6||_0x2d8c14(0x1d3))+_0x2d8c14(0x1cb)+_0x5918c6)});_0x3a6da7=_0x2916df,console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x25a)](_0x2d8c14(0x1bc)+_0x2916df));}}}}if(!_0x3a6da7)return console['log'](a4_0xc7962c['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x1cf)),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x1d0)),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x22a)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x1351b6)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2d8c14(0x1c1),undefined,{'helpText':_0x2d8c14(0x204)});if(!_0x4a4a68&&!_0x28e525){if(!isInteractive())return console['error'](a4_0xc7962c['red'](_0x2d8c14(0x1c2)),_0x2d8c14(0x1e0)),console[_0x2d8c14(0x249)](a4_0xc7962c[_0x2d8c14(0x25a)](_0x2d8c14(0x1fa))),0x1;const _0x30454e=await confirmKey(_0x2d8c14(0x1e7)+_0x3a6da7+_0x2d8c14(0x1f7)+_0x1351b6+'\x22?');if(!_0x30454e)return console['log'](a4_0xc7962c[_0x2d8c14(0x1dd)](_0x2d8c14(0x22e))),0x1;}const {data:_0x463e54}=await withSpinner(_0x2d8c14(0x1bf)+_0x3a6da7+_0x2d8c14(0x22f)+_0x1351b6+_0x2d8c14(0x224),()=>_0x5bbe22[_0x2d8c14(0x223)][_0x2d8c14(0x1da)](_0x3a6da7,_0x1351b6,{'dryRun':_0x28e525}));if(_0x28e525)return console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1dd)](_0x2d8c14(0x222))),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x209)+_0x463e54[_0x2d8c14(0x255)]),console[_0x2d8c14(0x1ee)]('New\x20project:\x20'+_0x1351b6),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x23f)),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x24f)+_0x463e54[_0x2d8c14(0x210)]['agents']['created']),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x258)+_0x463e54['counts'][_0x2d8c14(0x247)][_0x2d8c14(0x1e6)]),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x24e)+_0x463e54['counts'][_0x2d8c14(0x213)][_0x2d8c14(0x1e6)]),0x0;const _0xa74782=_0x463e54[_0x2d8c14(0x210)]['agents'][_0x2d8c14(0x1d6)]>0x0||_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x247)][_0x2d8c14(0x1d6)]>0x0||_0x463e54['counts']['prompts'][_0x2d8c14(0x1d6)]>0x0;_0xa74782?console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1dd)]('Project\x20cloned\x20with\x20errors')):console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1f2)]('Project\x20cloned\x20successfully'));console['log'](_0x2d8c14(0x209)+_0x463e54[_0x2d8c14(0x255)]),console['log'](_0x2d8c14(0x226)+_0x463e54['newProjectName']),console['log'](_0x2d8c14(0x24c)+_0x463e54[_0x2d8c14(0x1c7)]),console[_0x2d8c14(0x1ee)](),console[_0x2d8c14(0x1ee)]('Summary:'),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x24f)+formatCountSummary(_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x20a)])),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x258)+formatCountSummary(_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x247)])),console['log'](_0x2d8c14(0x24e)+formatCountSummary(_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x213)])),console['log'](_0x2d8c14(0x1b5)+formatCountSummary(_0x463e54['counts'][_0x2d8c14(0x1df)]));if(_0xa74782){console['log'](),console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x20b)));for(const _0x1b5913 of _0x463e54[_0x2d8c14(0x20a)]){_0x1b5913['action']===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c['red'](_0x2d8c14(0x1b7)+_0x1b5913['agentName']+'\x22:\x20'+_0x1b5913['error']));}for(const _0x55a8e6 of _0x463e54[_0x2d8c14(0x247)]){_0x55a8e6['action']===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x1f0)+_0x55a8e6[_0x2d8c14(0x1fe)]+_0x2d8c14(0x236)+_0x55a8e6[_0x2d8c14(0x249)]));}for(const _0x362ff7 of _0x463e54[_0x2d8c14(0x213)]){_0x362ff7[_0x2d8c14(0x1ec)]===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x20d)+_0x362ff7[_0x2d8c14(0x1fe)]+'\x22:\x20'+_0x362ff7[_0x2d8c14(0x249)]));}for(const _0x152b84 of _0x463e54[_0x2d8c14(0x1df)]){_0x152b84[_0x2d8c14(0x1ec)]===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x1b8)+_0x152b84[_0x2d8c14(0x1fe)]+_0x2d8c14(0x236)+_0x152b84[_0x2d8c14(0x249)]));}return 0x1;}console['log']();const _0x4764e7=getLLMProjectUrl(_0x59a46f,_0x463e54[_0x2d8c14(0x1c7)]);return console[_0x2d8c14(0x1ee)](_0x2d8c14(0x23d)+a4_0xc7962c[_0x2d8c14(0x217)](_0x4764e7)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1d306b(0x1fe)]='agent:push';[a4_0x1d306b(0x240)]=a4_0x1d306b(0x1be);async[a4_0x1d306b(0x259)](_0x43492d){const _0x4c3183=a4_0x1d306b,{options:_0x965cbe,args:_0x24abb8,tdx:_0x1701b2}=_0x43492d;let _0x3db005=_0x24abb8[0x0]||process['cwd']();const _0x334555=_0x965cbe[_0x4c3183(0x1d8)],_0x18fb61=_0x965cbe[_0x4c3183(0x23a)],_0x457ddc=_0x965cbe[_0x4c3183(0x246)],_0x3b59df=_0x965cbe[_0x4c3183(0x1d4)],_0x30f252=a4_0x4d96fd[_0x4c3183(0x239)](_0x3db005,'agent.yml'),_0x48484=existsSync(_0x30f252);if(_0x48484){const {data:_0x4efaf8}=await withSpinner(_0x4c3183(0x24b)+_0x3db005+_0x4c3183(0x224),()=>_0x1701b2['llm']['pushAgent'](_0x3db005,{'dryRun':_0x334555,'force':_0x18fb61}));if(_0x334555)return console['log'](a4_0xc7962c[_0x4c3183(0x1dd)](_0x4c3183(0x222))),console[_0x4c3183(0x1ee)]('Would\x20push\x20agent:\x20'+_0x4efaf8[_0x4c3183(0x248)]),0x0;if(_0x4efaf8[_0x4c3183(0x1ec)]===_0x4c3183(0x249))return console['log'](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x21d)+_0x4efaf8[_0x4c3183(0x249)])),0x1;console['log'](a4_0xc7962c[_0x4c3183(0x1f2)](_0x4c3183(0x243)+_0x4efaf8[_0x4c3183(0x1ec)]+_0x4c3183(0x1f9))),console[_0x4c3183(0x1ee)](_0x4c3183(0x1e5)+_0x4efaf8['agentName']);if(_0x4efaf8['agentId']&&_0x4efaf8[_0x4c3183(0x206)]){const _0x36ad1b=getLLMAgentChatUrl(_0x3b59df,_0x4efaf8[_0x4c3183(0x206)],_0x4efaf8[_0x4c3183(0x235)]);console[_0x4c3183(0x1ee)](_0x4c3183(0x22d)+a4_0xc7962c[_0x4c3183(0x217)](_0x36ad1b));}return 0x0;}const _0x5777c2=_0x965cbe[_0x4c3183(0x21e)],_0x4ca7bc=resolveProjectFromContext(_0x3db005,_0x5777c2);if(_0x4ca7bc[_0x4c3183(0x214)])_0x3db005=_0x4ca7bc['projectDir'],_0x4ca7bc[_0x4c3183(0x203)]===_0x4c3183(0x23c)&&console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x25a)]('Using\x20project:\x20'+_0x3db005));else{let _0x51f8ac=_0x4c3183(0x1ba);_0x4ca7bc[_0x4c3183(0x200)]===_0x4c3183(0x1b9)&&(_0x51f8ac=_0x4ca7bc[_0x4c3183(0x241)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x4ca7bc[_0x4c3183(0x21e)]+_0x4c3183(0x25b));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4ca7bc[_0x4c3183(0x200)]===_0x4c3183(0x212)?_0x4ca7bc[_0x4c3183(0x241)]:_0x4c3183(0x220)+_0x3db005,undefined,{'helpText':_0x51f8ac});}const {data:_0x3c23d6}=await withSpinner(_0x4c3183(0x1db),()=>_0x1701b2[_0x4c3183(0x223)][_0x4c3183(0x201)](_0x3db005,{'dryRun':!![]})),_0x116fe3=_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x20a)][_0x4c3183(0x1d6)]>0x0;if(_0x116fe3){console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1f8)));for(const _0x344d92 of _0x3c23d6[_0x4c3183(0x20a)]){_0x344d92[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c['red'](_0x4c3183(0x1b7)+_0x344d92[_0x4c3183(0x248)]+'\x22:\x20'+_0x344d92[_0x4c3183(0x249)]));}return 0x1;}const _0x9bfeee=_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x20a)]['created']+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x247)][_0x4c3183(0x1e6)]+_0x3c23d6['counts']['textKnowledgeBases']['created']+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x213)][_0x4c3183(0x1e6)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1df)]['created'],_0x270ccc=_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x20a)][_0x4c3183(0x1f5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x247)][_0x4c3183(0x1f5)]+_0x3c23d6[_0x4c3183(0x210)]['textKnowledgeBases']['updated']+_0x3c23d6['counts'][_0x4c3183(0x213)][_0x4c3183(0x1f5)]+_0x3c23d6['counts']['integrations'][_0x4c3183(0x1f5)],_0x4bc85f=_0x3c23d6['counts'][_0x4c3183(0x20a)][_0x4c3183(0x1d5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x247)][_0x4c3183(0x1d5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1f3)][_0x4c3183(0x1d5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x213)]['unchanged']+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1df)]['unchanged'];console[_0x4c3183(0x1ee)](_0x4c3183(0x211)+_0x3c23d6['projectName']+'\x27:'),console[_0x4c3183(0x1ee)]('\x20\x20'+a4_0xc7962c[_0x4c3183(0x1f2)]('+\x20'+_0x9bfeee+'\x20new')+_0x4c3183(0x253)+a4_0xc7962c[_0x4c3183(0x1dd)]('~\x20'+_0x270ccc+_0x4c3183(0x1e4))+_0x4c3183(0x253)+a4_0xc7962c['dim']('=\x20'+_0x4bc85f+_0x4c3183(0x1d9))),console['log'](_0x4c3183(0x24f)+formatCountSummary(_0x3c23d6['counts']['agents'])),console[_0x4c3183(0x1ee)](_0x4c3183(0x258)+formatCountSummary(_0x3c23d6['counts']['knowledgeBases'])),console[_0x4c3183(0x1ee)](_0x4c3183(0x229)+formatCountSummary(_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1f3)])),console[_0x4c3183(0x1ee)](_0x4c3183(0x24e)+formatCountSummary(_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x213)])),console['log'](_0x4c3183(0x1b5)+formatCountSummary(_0x3c23d6[_0x4c3183(0x210)]['integrations'])),console[_0x4c3183(0x1ee)]('\x20\x20Source:\x20'+a4_0xc7962c[_0x4c3183(0x217)](_0x3db005)),displayDiffs(_0x3c23d6[_0x4c3183(0x20a)],_0x3c23d6[_0x4c3183(0x247)],_0x3c23d6[_0x4c3183(0x1f3)],_0x3c23d6[_0x4c3183(0x213)],_0x3c23d6[_0x4c3183(0x1df)]);if(_0x334555)return console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1dd)](_0x4c3183(0x251))),0x0;if(_0x9bfeee===0x0&&_0x270ccc===0x0){console[_0x4c3183(0x1ee)](a4_0xc7962c['green'](_0x4c3183(0x21c)));const _0x40ff7b=getLLMProjectUrl(_0x3b59df,_0x3c23d6['projectId']);return console['log'](_0x4c3183(0x23d)+a4_0xc7962c['cyan'](_0x40ff7b)),0x0;}if(!_0x457ddc&&!_0x18fb61){if(!isInteractive())return console[_0x4c3183(0x249)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1c2)),_0x4c3183(0x1e0)),console[_0x4c3183(0x249)](a4_0xc7962c[_0x4c3183(0x25a)](_0x4c3183(0x1fa))),0x1;const _0x43ac9a=await confirmKey(_0x4c3183(0x202)+(_0x9bfeee+_0x270ccc)+'\x20resources?');if(!_0x43ac9a)return console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1dd)](_0x4c3183(0x22e)),_0x4c3183(0x23b)),0x1;}const {data:_0x16d30f}=await withSpinner(_0x4c3183(0x20f),()=>_0x1701b2['llm'][_0x4c3183(0x201)](_0x3db005,{'force':_0x18fb61})),_0x820067=_0x16d30f[_0x4c3183(0x210)][_0x4c3183(0x20a)][_0x4c3183(0x1d6)]>0x0||_0x16d30f['counts']['knowledgeBases'][_0x4c3183(0x1d6)]>0x0||_0x16d30f[_0x4c3183(0x210)]['textKnowledgeBases'][_0x4c3183(0x1d6)]>0x0||_0x16d30f[_0x4c3183(0x210)][_0x4c3183(0x213)][_0x4c3183(0x1d6)]>0x0;if(_0x820067){console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1dd)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x4c3183(0x1ee)](),console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)]('Errors:'));for(const _0x377f99 of _0x16d30f['agents']){_0x377f99[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console['log'](a4_0xc7962c[_0x4c3183(0x1c0)]('\x20\x20Agent\x20\x22'+_0x377f99['agentName']+'\x22:\x20'+_0x377f99['error']));}for(const _0xc63086 of _0x16d30f['knowledgeBases']){_0xc63086[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1f0)+_0xc63086[_0x4c3183(0x1fe)]+_0x4c3183(0x236)+_0xc63086['error']));}for(const _0xed3a6c of _0x16d30f[_0x4c3183(0x1f3)]){_0xed3a6c[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c['red'](_0x4c3183(0x1e9)+_0xed3a6c[_0x4c3183(0x1fe)]+_0x4c3183(0x236)+_0xed3a6c[_0x4c3183(0x249)]));}for(const _0x17b81e of _0x16d30f[_0x4c3183(0x213)]){_0x17b81e[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c['red'](_0x4c3183(0x20d)+_0x17b81e[_0x4c3183(0x1fe)]+_0x4c3183(0x236)+_0x17b81e[_0x4c3183(0x249)]));}for(const _0x138329 of _0x16d30f['integrations']){_0x138329[_0x4c3183(0x1ec)]==='error'&&console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1b8)+_0x138329[_0x4c3183(0x1fe)]+'\x22:\x20'+_0x138329['error']));}return 0x1;}console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1f2)](_0x4c3183(0x254)+(_0x9bfeee+_0x270ccc)+_0x4c3183(0x1c8)+_0x16d30f[_0x4c3183(0x238)]+'\x27'));const _0x2bf740=getLLMProjectUrl(_0x3b59df,_0x16d30f['projectId']);return console['log'](_0x4c3183(0x23d)+a4_0xc7962c[_0x4c3183(0x217)](_0x2bf740)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x5d56ab=a5_0x48ac;(function(_0x1bbba3,_0x427c09){const _0x823ed1=a5_0x48ac,_0x139f40=_0x1bbba3();while(!![]){try{const _0x5a04d5=-parseInt(_0x823ed1(0x100))/0x1+parseInt(_0x823ed1(0xbc))/0x2+parseInt(_0x823ed1(0x98))/0x3+parseInt(_0x823ed1(0x6d))/0x4*(parseInt(_0x823ed1(0xcb))/0x5)+-parseInt(_0x823ed1(0xbb))/0x6+parseInt(_0x823ed1(0xf3))/0x7*(-parseInt(_0x823ed1(0xe0))/0x8)+-parseInt(_0x823ed1(0x9c))/0x9*(-parseInt(_0x823ed1(0x73))/0xa);if(_0x5a04d5===_0x427c09)break;else _0x139f40['push'](_0x139f40['shift']());}catch(_0x2ec1e6){_0x139f40['push'](_0x139f40['shift']());}}}(a5_0x8166,0xa9064));import*as a5_0x5e8169 from'node:fs';function a5_0x8166(){const _0x3b6f0a=['map','✗\x20FAIL:\x20','\x20(new)','Test\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','FAIL','utf-8','\x20\x20Project:\x20','log','tags','Round\x201/','red','6735904AyPyMO','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x22:\x20','push','Running\x20test:\x20','tsv','agentDirs','✗\x20ERROR:\x20Project\x20not\x20found:\x20','...\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','white','projectDir','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','519812nSmohU','filter','\x20\x20Evaluating...\x20','Test\x20Configuration:','318468hkyutY','Duration:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','isSpinning','Total:\x20\x20\x20\x20','timestamp','340vRMcCW','Usage:','resolve','Re-evaluating\x20','No\x20tests\x20found\x20with\x20tags:\x20','jsonl','some','multiple_agents','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','agentName','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','cyan','has','repeat',':\x20Sending\x20user\x20input...','Re-evaluation\x20Summary','\x20\x20Round\x20','llmProject','projectName','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Test\x20Summary','Agent:\x20','✗\x20ERROR:\x20','trim','...','rounds','text','green','executeReeval','eval','join','Running\x20agent\x20tests...','json','dim','resolveAgentId','now','4011459XuPhhF','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','reason','Output\x20written\x20to:\x20','42489DclSgL','\x20\x20Site:\x20','Project\x20path:\x20','message','conversation_url','Error\x20writing\x20output\x20file:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','includes','status','Errors:\x20\x20\x20','Available\x20tags:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','agent:test','Available\x20tests:\x20','Round\x20','\x20\x20Agent:\x20','⚠\x20SKIPPED:\x20','verbose','execute','no_context','\x20\x20-\x20','source','Tests\x20found:\x20','description','Evaluating\x20response...','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','not\x20found','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20\x20Conversation:\x20','find','6476934cZGaOr','2079354EzDHaW','site','Re-evaluating...','No\x20tests\x20found\x20matching:\x20','llm','conversations','forEach','Either\x20switch\x20to\x20the\x20\x22','length','yellow','resolveProjectId','start','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','test.yml','split','45rMxOiz','tests','writeFileSync','stop','ERROR','reeval','agent','/<agent-name>','add','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','found','output','404','✓\x20PASS:\x20','Failed:\x20\x20\x20','name','no_local_folder','Run\x20tests\x20for\x20an\x20LLM\x20agent','Site:\x20','toLowerCase','\x20-\x20','8HKtMjZ','context','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','toISOString','table','PASS','round'];a5_0x8166=function(){return _0x3b6f0a;};return a5_0x8166();}import*as a5_0x24f176 from'node:path';import a5_0x3a9a3b from'chalk';import{BaseCommand}from'./command.js';function a5_0x48ac(_0x1ebbd5,_0x3206cf){_0x1ebbd5=_0x1ebbd5-0x6b;const _0x8166b5=a5_0x8166();let _0x48ac07=_0x8166b5[_0x1ebbd5];return _0x48ac07;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5d56ab(0xda)]=a5_0x5d56ab(0xa8);[a5_0x5d56ab(0xb3)]=a5_0x5d56ab(0xdc);async[a5_0x5d56ab(0xae)](_0x52bdad){const _0x36d18d=a5_0x5d56ab,{options:_0x5efbf1,args:_0xe7479b,tdx:_0x9f25e8}=_0x52bdad,_0x586a62=_0xe7479b[0x0]||'.',_0x578116=_0x5efbf1['dryRun'],_0x5dda2c=_0x5efbf1,_0x28d95e=_0x5dda2c[_0x36d18d(0x91)]===![],_0x20aff4=_0x5dda2c[_0x36d18d(0xd0)],_0x1c328b=_0x5dda2c[_0x36d18d(0xda)],_0x35be96=_0x5dda2c[_0x36d18d(0xf0)],_0x5f2131=_0x5efbf1[_0x36d18d(0xbd)],_0x2e706c=_0x5dda2c[_0x36d18d(0xd6)];if(_0x20aff4&&_0x28d95e)return console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xeb))),0x1;let _0x53f591=_0x36d18d(0xe4);if(_0x5dda2c[_0x36d18d(0x94)])_0x53f591=_0x36d18d(0x94);else{if(_0x5dda2c[_0x36d18d(0x78)])_0x53f591=_0x36d18d(0x78);else{if(_0x5dda2c['tsv'])_0x53f591=_0x36d18d(0xf8);else{if(_0x5dda2c['table'])_0x53f591=_0x36d18d(0xe4);}}}const _0x2e4138=_0x5dda2c[_0x36d18d(0x85)];let _0x18535c=_0x586a62;const _0x40253c=a5_0x5e8169['existsSync'](_0x586a62),_0x4231c9=_0x586a62==='.';if(!_0x40253c||_0x4231c9){const _0x3dade7=resolveProjectFromContext(_0x586a62,_0x2e4138,{'requireFile':_0x36d18d(0xc9)});if(_0x3dade7[_0x36d18d(0xd5)])_0x18535c=_0x3dade7[_0x36d18d(0xfe)],_0x3dade7[_0x36d18d(0xb1)]===_0x36d18d(0xe1)&&console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('Using\x20agent:\x20'+_0x18535c));else switch(_0x3dade7['reason']){case _0x36d18d(0xaf):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x3dade7[_0x36d18d(0x9f)])),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0x74)),console[_0x36d18d(0xef)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log']('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x36d18d(0xef)](),console['log'](_0x36d18d(0xe2));return 0x1;case _0x36d18d(0xdb):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x3dade7[_0x36d18d(0x9f)])),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0xb5)+_0x3dade7[_0x36d18d(0x85)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x36d18d(0x7a):{const _0x1f7224=a5_0x24f176['basename'](_0x3dade7['projectDir']);console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0x7b)+_0x3dade7[_0x36d18d(0x85)]+'\x22:'));for(const _0x59a636 of _0x3dade7[_0x36d18d(0xf9)]){console['log'](_0x36d18d(0xb0)+_0x59a636);}return console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0x99)+_0x1f7224+_0x36d18d(0xd2)),0x1;}case'no_tests':console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0x87)+_0x3dade7[_0x36d18d(0x85)]+'\x22.')),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)](_0x36d18d(0x9e)+_0x3dade7[_0x36d18d(0xfe)])),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0xb8));return 0x1;}}const {definition:_0xc7289b,agentInfo:_0x4b5fe4}=parseTestFile(_0x18535c);let _0x486166=_0xc7289b[_0x36d18d(0xcc)];if(_0x1c328b){const _0x222a34=_0x1c328b[_0x36d18d(0xca)](',')['map'](_0x2e946c=>_0x2e946c['trim']());_0x486166=_0xc7289b[_0x36d18d(0xcc)]['filter'](_0x2b7536=>_0x222a34[_0x36d18d(0xa3)](_0x2b7536['name']));if(_0x486166[_0x36d18d(0xc4)]===0x0)return console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0xbf)+_0x1c328b)),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)](_0x36d18d(0xa9)+_0xc7289b[_0x36d18d(0xcc)][_0x36d18d(0xe7)](_0x19f0f2=>_0x19f0f2['name'])[_0x36d18d(0x92)](',\x20'))),0x1;}if(_0x35be96){const _0x514e78=_0x35be96['split'](',')[_0x36d18d(0xe7)](_0x561bf5=>_0x561bf5[_0x36d18d(0x8b)]()[_0x36d18d(0xde)]());_0x486166=_0x486166['filter'](_0x2d33cc=>_0x2d33cc[_0x36d18d(0xf0)]?.[_0x36d18d(0x79)](_0x3027a8=>_0x514e78['includes'](_0x3027a8['toLowerCase']())));if(_0x486166[_0x36d18d(0xc4)]===0x0){console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0x77)+_0x35be96));const _0x1ca491=new Set();return _0xc7289b['tests']['forEach'](_0x498d53=>_0x498d53['tags']?.[_0x36d18d(0xc2)](_0x5889d0=>_0x1ca491[_0x36d18d(0xd3)](_0x5889d0))),_0x1ca491['size']>0x0?console['log'](a5_0x3a9a3b['dim'](_0x36d18d(0xa6)+[..._0x1ca491]['join'](',\x20'))):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x20aff4)return this[_0x36d18d(0x90)](_0x52bdad,{'definition':{'tests':_0x486166},'agentInfo':_0x4b5fe4,'outputFormat':_0x53f591,'outputFile':_0x2e706c,'testNames':_0x1c328b});if(_0x578116){console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x7f)](_0x36d18d(0x6c))),console[_0x36d18d(0xef)](_0x36d18d(0x9d)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x5f2131)),console[_0x36d18d(0xef)](_0x36d18d(0xee)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x4b5fe4['projectName'])),console['log'](_0x36d18d(0xab)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x4b5fe4['agentName'])),console['log'](),console['log'](_0x36d18d(0xb2)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x486166[_0x36d18d(0xc4)]));for(let _0xa79795=0x0;_0xa79795<_0x486166[_0x36d18d(0xc4)];_0xa79795++){const _0x1b2ac0=_0x486166[_0xa79795],_0x55234d=_0x1b2ac0[_0x36d18d(0x8d)]['length']===0x1?_0x36d18d(0xe6):_0x36d18d(0x8d),_0x41d13e=_0x1b2ac0[_0x36d18d(0xf0)]?.[_0x36d18d(0xc4)]?'\x20['+_0x1b2ac0[_0x36d18d(0xf0)][_0x36d18d(0x92)](',\x20')+']':'';console[_0x36d18d(0xef)]('\x20\x20'+(_0xa79795+0x1)+'.\x20'+a5_0x3a9a3b['white'](_0x1b2ac0['name'])+'\x20('+_0x1b2ac0['rounds']['length']+'\x20'+_0x55234d+')'+a5_0x3a9a3b['dim'](_0x41d13e));}return 0x0;}let _0x382d7c,_0x1ec3d;try{_0x382d7c=await _0x9f25e8[_0x36d18d(0xc0)][_0x36d18d(0xc6)](_0x4b5fe4['projectName']);}catch(_0x53b11a){const _0x51d269=_0x53b11a instanceof Error?_0x53b11a[_0x36d18d(0x9f)]:String(_0x53b11a);return _0x51d269[_0x36d18d(0xa3)](_0x36d18d(0xd7))||_0x51d269[_0x36d18d(0xde)]()[_0x36d18d(0xa3)](_0x36d18d(0xb7))?console['log'](a5_0x3a9a3b['red'](_0x36d18d(0xfa)+_0x4b5fe4[_0x36d18d(0x86)])):console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xf4)+_0x4b5fe4[_0x36d18d(0x86)]+_0x36d18d(0xf5)+_0x51d269)),0x1;}try{_0x1ec3d=await _0x9f25e8['llm'][_0x36d18d(0x96)](_0x4b5fe4[_0x36d18d(0x7d)],_0x382d7c);}catch(_0x583c88){const _0x2912a7=_0x583c88 instanceof Error?_0x583c88['message']:String(_0x583c88);return _0x2912a7['includes'](_0x36d18d(0xd7))||_0x2912a7['toLowerCase']()[_0x36d18d(0xa3)](_0x36d18d(0xb7))?console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0x7c)+_0x4b5fe4[_0x36d18d(0x7d)])):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xff)+_0x4b5fe4[_0x36d18d(0x7d)]+_0x36d18d(0xf5)+_0x2912a7)),0x1;}let _0x30af6a;if(!_0x28d95e)try{_0x30af6a=await setupEvaluatorAgent(_0x9f25e8[_0x36d18d(0xc0)],_0x5efbf1['verbose']);}catch(_0x124220){const _0xe9dab6=_0x124220 instanceof Error?_0x124220[_0x36d18d(0x9f)]:String(_0x124220);return console[_0x36d18d(0xef)](a5_0x3a9a3b['red'](_0x36d18d(0xd4)+_0xe9dab6)),0x1;}console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x7f)](_0x36d18d(0x93))),console[_0x36d18d(0xef)](_0x36d18d(0xdd)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x5f2131)),console['log'](_0x36d18d(0x89)+a5_0x3a9a3b['white'](_0x4b5fe4[_0x36d18d(0x86)]+'/'+_0x4b5fe4[_0x36d18d(0x7d)])),console['log']();const _0x1f12f4=[],_0x105962=[],_0x412b68=Date[_0x36d18d(0x97)]();for(let _0x27f7a9=0x0;_0x27f7a9<_0x486166[_0x36d18d(0xc4)];_0x27f7a9++){const _0x2dba0b=_0x486166[_0x27f7a9];_0x486166[_0x36d18d(0xc4)]>0x1?console[_0x36d18d(0xef)](_0x36d18d(0xea)+(_0x27f7a9+0x1)+'/'+_0x486166[_0x36d18d(0xc4)]+':\x20'+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x2dba0b['name'])):console[_0x36d18d(0xef)](_0x36d18d(0xf7)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x2dba0b['name']));const _0x5a09a3=createCommandSpinner('Round\x201/'+_0x2dba0b[_0x36d18d(0x8d)][_0x36d18d(0xc4)]+_0x36d18d(0x82));_0x5a09a3[_0x36d18d(0xc7)]();try{const {result:_0x47996b,conversation:_0x3d0e82}=await runTest(_0x9f25e8['llm'],_0x2dba0b,{'agentId':_0x1ec3d,'projectId':_0x382d7c,'site':_0x5f2131,'noEval':_0x28d95e,'evaluatorId':_0x30af6a,'onRoundStart':(_0x295be3,_0xb3003c)=>{const _0x43c1bb=_0x36d18d;_0x5a09a3[_0x43c1bb(0x8e)]=_0x43c1bb(0xaa)+(_0x295be3+0x1)+'/'+_0xb3003c+_0x43c1bb(0x82);},'onRoundComplete':(_0xd20be1,_0x5ab8cb,_0x11cb95)=>{const _0x12e875=_0x36d18d,_0x1f8aa8=formatElapsed(_0x5ab8cb);_0x11cb95?console[_0x12e875(0xef)]('\x20\x20Round\x20'+(_0xd20be1+0x1)+'/'+_0x2dba0b[_0x12e875(0x8d)][_0x12e875(0xc4)]+_0x12e875(0xfb)+a5_0x3a9a3b[_0x12e875(0x8f)]('✓')+'\x20('+_0x1f8aa8+')'):console[_0x12e875(0xef)]('\x20\x20Round\x20'+(_0xd20be1+0x1)+'/'+_0x2dba0b[_0x12e875(0x8d)]['length']+_0x12e875(0xfb)+a5_0x3a9a3b['red']('✗'));},'onEvaluationStart':()=>{const _0x483574=_0x36d18d;_0x5a09a3[_0x483574(0x8e)]=_0x483574(0xb4);},'onEvaluationComplete':_0x4c6cbb=>{const _0x4b3cc1=_0x36d18d,_0x2cb763=formatElapsed(_0x4c6cbb);console['log'](_0x4b3cc1(0x6b)+a5_0x3a9a3b[_0x4b3cc1(0x8f)]('✓')+'\x20('+_0x2cb763+')');}});_0x5a09a3['stop'](),_0x1f12f4['push'](_0x47996b),_0x105962['push'](_0x3d0e82);if(_0x47996b['status']==='PASS')console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x8f)](_0x36d18d(0xd8)+_0x47996b[_0x36d18d(0x9a)]));else _0x47996b[_0x36d18d(0xa4)]===_0x36d18d(0xec)?console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xe8)+_0x47996b['reason'])):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)]('✗\x20ERROR:\x20'+_0x47996b[_0x36d18d(0x9a)]));_0x47996b[_0x36d18d(0xa0)]&&console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('Conversation\x20URL:\x20'+_0x47996b[_0x36d18d(0xa0)])),console[_0x36d18d(0xef)]();}catch(_0x4ad98c){_0x5a09a3[_0x36d18d(0xce)]();const _0x484d43=_0x4ad98c instanceof Error?_0x4ad98c['message']:String(_0x4ad98c);console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0x8a)+_0x484d43)),console['log'](),_0x1f12f4[_0x36d18d(0xf6)]({'name':_0x2dba0b['name'],'status':'ERROR','reason':_0x484d43,'timestamp':new Date()[_0x36d18d(0xe3)](),'duration_ms':0x0});}}const _0x26eb7f=Date['now']()-_0x412b68,_0x38069e=_0x1f12f4[_0x36d18d(0x101)](_0x20df24=>_0x20df24[_0x36d18d(0xa4)]===_0x36d18d(0xe5))[_0x36d18d(0xc4)],_0x2378e8=_0x1f12f4[_0x36d18d(0x101)](_0x579e19=>_0x579e19[_0x36d18d(0xa4)]===_0x36d18d(0xec))[_0x36d18d(0xc4)],_0x1a6370=_0x1f12f4['filter'](_0x223a61=>_0x223a61[_0x36d18d(0xa4)]===_0x36d18d(0xcf))[_0x36d18d(0xc4)];console[_0x36d18d(0xef)]('━'['repeat'](0x3c)),console['log'](_0x36d18d(0x88)),console[_0x36d18d(0xef)]('━'['repeat'](0x3c)),console[_0x36d18d(0xef)](_0x36d18d(0x71)+_0x1f12f4['length']),console[_0x36d18d(0xef)]('Passed:\x20\x20\x20'+a5_0x3a9a3b[_0x36d18d(0x8f)](_0x38069e)),console['log'](_0x36d18d(0xd9)+a5_0x3a9a3b[_0x36d18d(0xf2)](_0x2378e8));_0x1a6370>0x0&&console[_0x36d18d(0xef)](_0x36d18d(0xa5)+a5_0x3a9a3b[_0x36d18d(0xf2)](_0x1a6370));console[_0x36d18d(0xef)]('Duration:\x20'+formatElapsed(_0x26eb7f)),console['log']('━'['repeat'](0x3c));const _0x6f8270=_0x1f12f4[_0x36d18d(0x101)](_0x1c5721=>_0x1c5721[_0x36d18d(0xa4)]!=='PASS');if(_0x6f8270[_0x36d18d(0xc4)]>0x0){console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)]('Failed\x20Tests:');for(const _0x541d22 of _0x6f8270){const _0x4b00b3=a5_0x3a9a3b[_0x36d18d(0xf2)]('✗'),_0x44e118=_0x541d22[_0x36d18d(0x9a)][_0x36d18d(0xc4)]>0x32?_0x541d22[_0x36d18d(0x9a)]['substring'](0x0,0x32)+_0x36d18d(0x8c):_0x541d22[_0x36d18d(0x9a)];console[_0x36d18d(0xef)]('\x20\x20'+_0x4b00b3+'\x20'+_0x541d22[_0x36d18d(0xda)]+':\x20'+_0x44e118);}}const _0x3458b9={'summary':{'total':_0x1f12f4[_0x36d18d(0xc4)],'passed':_0x38069e,'failed':_0x2378e8,'errors':_0x1a6370>0x0?_0x1a6370:undefined,'duration_ms':_0x26eb7f},'tests':_0x1f12f4,'agent':{'project':_0x4b5fe4[_0x36d18d(0x86)],'name':_0x4b5fe4['agentName'],'site':_0x5f2131},'timestamp':new Date(_0x412b68)[_0x36d18d(0xe3)]()};try{const _0x5cc143=buildCachedTestRun(_0x105962,{'site':_0x5f2131,'projectId':_0x382d7c,'projectName':_0x4b5fe4[_0x36d18d(0x86)],'agentId':_0x1ec3d,'agentName':_0x4b5fe4[_0x36d18d(0x7d)],'testYmlPath':a5_0x24f176[_0x36d18d(0x75)](_0x4b5fe4[_0x36d18d(0xb6)])});saveLastTestRun(_0x5cc143);}catch{}if(_0x53f591!==_0x36d18d(0xe4)||_0x2e706c){const _0xb80559=formatResults(_0x3458b9,_0x53f591);if(_0x2e706c)try{a5_0x5e8169[_0x36d18d(0xcd)](_0x2e706c,_0xb80559,_0x36d18d(0xed)),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('Output\x20written\x20to:\x20'+_0x2e706c));}catch(_0xf57a40){return console['log'](),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xa1)+_0xf57a40)),0x1;}else console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0xb80559);}return _0x6f8270[_0x36d18d(0xc4)]>0x0?0x1:0x0;}async[a5_0x5d56ab(0x90)](_0x4f80be,_0x19db03){const _0x3f75c2=a5_0x5d56ab,{options:_0x71ca94,tdx:_0xe1d023}=_0x4f80be,{definition:_0x1a0c91,agentInfo:_0x4e62f0,outputFormat:_0x4a78e0,outputFile:_0x1f8581}=_0x19db03,_0x11778e=_0x71ca94[_0x3f75c2(0xbd)],_0xa62630=loadLastTestRun();if(!_0xa62630)return console['log'](a5_0x3a9a3b['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x95)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0xa62630[_0x3f75c2(0xd1)][_0x3f75c2(0x7d)]!==_0x4e62f0['agentName'])return console[_0x3f75c2(0xef)](a5_0x3a9a3b['red'](_0x3f75c2(0x7e)+_0xa62630['agent'][_0x3f75c2(0x7d)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4e62f0[_0x3f75c2(0x7d)]+'\x22.')),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xfc))),0x1;const _0x4604ab=new Set(_0xa62630[_0x3f75c2(0xc1)][_0x3f75c2(0xe7)](_0x310a6e=>_0x310a6e['testName'])),_0x49c9eb=_0x1a0c91[_0x3f75c2(0xcc)]['filter'](_0x2c42d4=>!_0x4604ab['has'](_0x2c42d4[_0x3f75c2(0xda)]));if(_0x49c9eb['length']>0x0&&_0xa62630['site']!==_0x11778e)return console[_0x3f75c2(0xef)](a5_0x3a9a3b['red'](_0x3f75c2(0x6f))),console['log'](a5_0x3a9a3b[_0x3f75c2(0x95)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0xa62630['site']+_0x3f75c2(0xa2)+_0x11778e+'\x22.')),console['log'](a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xc3)+_0xa62630[_0x3f75c2(0xbd)]+_0x3f75c2(0xa7))),0x1;const _0x60695a=_0x1a0c91[_0x3f75c2(0xcc)][_0x3f75c2(0x101)](_0x2acb12=>_0x4604ab[_0x3f75c2(0x80)](_0x2acb12['name'])),_0x346b12=_0x49c9eb;let _0x3fa731;try{_0x3fa731=await setupEvaluatorAgent(_0xe1d023[_0x3f75c2(0xc0)],_0x71ca94[_0x3f75c2(0xad)]);}catch(_0x5d52f8){const _0xaceb8b=_0x5d52f8 instanceof Error?_0x5d52f8[_0x3f75c2(0x9f)]:String(_0x5d52f8);return console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0xaceb8b)),0x1;}console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x7f)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x3a9a3b[_0x3f75c2(0xfd)](_0xa62630[_0x3f75c2(0x72)])),console[_0x3f75c2(0xef)](_0x3f75c2(0x89)+a5_0x3a9a3b['white'](_0xa62630[_0x3f75c2(0xd1)][_0x3f75c2(0x86)]+'/'+_0xa62630[_0x3f75c2(0xd1)][_0x3f75c2(0x7d)]));_0x346b12['length']>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x3a9a3b[_0x3f75c2(0xc5)](_0x346b12[_0x3f75c2(0xc4)]));console['log']();const _0xa75041=[],_0x564ef5=Date[_0x3f75c2(0x97)](),_0x9182f9=createCommandSpinner(_0x3f75c2(0xbe));if(_0x60695a['length']>0x0)try{const _0x3d7552=await reevaluateFromCache(_0xe1d023['llm'],_0xa62630,{'tests':_0x60695a},{'evaluatorId':_0x3fa731,'onTestStart':(_0x1ce7c0,_0x4c525b,_0x41bb8d)=>{const _0x22fe8c=_0x3f75c2;_0x9182f9[_0x22fe8c(0x8e)]=_0x22fe8c(0x76)+(_0x4c525b+0x1)+'/'+_0x41bb8d+':\x20'+_0x1ce7c0+_0x22fe8c(0x8c);if(!_0x9182f9[_0x22fe8c(0x70)])_0x9182f9[_0x22fe8c(0xc7)]();},'onTestComplete':(_0x4f1b3c,_0x367fd0)=>{const _0x251683=_0x3f75c2;_0x9182f9['stop']();if(_0x367fd0[_0x251683(0xa4)]===_0x251683(0xe5))console[_0x251683(0xef)](a5_0x3a9a3b[_0x251683(0x8f)]('✓\x20PASS:\x20'+_0x4f1b3c)+a5_0x3a9a3b[_0x251683(0x95)]('\x20(cached)'));else _0x367fd0['status']===_0x251683(0xec)?console['log'](a5_0x3a9a3b[_0x251683(0xf2)](_0x251683(0xe8)+_0x4f1b3c+_0x251683(0xdf)+_0x367fd0[_0x251683(0x9a)])+a5_0x3a9a3b[_0x251683(0x95)]('\x20(cached)')):console[_0x251683(0xef)](a5_0x3a9a3b[_0x251683(0xf2)](_0x251683(0x8a)+_0x4f1b3c+_0x251683(0xdf)+_0x367fd0['reason']));_0x367fd0[_0x251683(0xa0)]&&console[_0x251683(0xef)](a5_0x3a9a3b[_0x251683(0x95)](_0x251683(0xb9)+_0x367fd0[_0x251683(0xa0)])),_0xa75041[_0x251683(0xf6)](_0x367fd0);},'onTestSkipped':(_0x52e8ec,_0x201b15)=>{const _0x4134d2=_0x3f75c2;_0x9182f9['stop'](),console[_0x4134d2(0xef)](a5_0x3a9a3b['yellow'](_0x4134d2(0xac)+_0x52e8ec+'\x20-\x20'+_0x201b15));}});for(const _0x15ef3d of _0x3d7552){!_0xa75041[_0x3f75c2(0xba)](_0x70b643=>_0x70b643[_0x3f75c2(0xda)]===_0x15ef3d['name'])&&_0xa75041[_0x3f75c2(0xf6)](_0x15ef3d);}}catch(_0x18fcf6){_0x9182f9[_0x3f75c2(0xce)]();const _0x20a281=_0x18fcf6 instanceof Error?_0x18fcf6[_0x3f75c2(0x9f)]:String(_0x18fcf6);return console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0xc8)+_0x20a281)),0x1;}_0x9182f9[_0x3f75c2(0xce)]();if(_0x346b12[_0x3f75c2(0xc4)]>0x0){console['log'](),console['log'](a5_0x3a9a3b['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x33e045,agentId:_0x21e2a9}=_0xa62630[_0x3f75c2(0xd1)];for(const _0x42a26e of _0x346b12){console[_0x3f75c2(0xef)]('Running:\x20'+a5_0x3a9a3b[_0x3f75c2(0xfd)](_0x42a26e[_0x3f75c2(0xda)]));const _0x17ea58=createCommandSpinner(_0x3f75c2(0xf1)+_0x42a26e[_0x3f75c2(0x8d)][_0x3f75c2(0xc4)]+_0x3f75c2(0x82));_0x17ea58['start']();try{const {result:_0x462688}=await runTest(_0xe1d023['llm'],_0x42a26e,{'agentId':_0x21e2a9,'projectId':_0x33e045,'site':_0xa62630[_0x3f75c2(0xbd)],'noEval':![],'evaluatorId':_0x3fa731,'onRoundStart':(_0x16c735,_0x2b1719)=>{const _0x4ec706=_0x3f75c2;_0x17ea58['text']=_0x4ec706(0xaa)+(_0x16c735+0x1)+'/'+_0x2b1719+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x221708,_0x2ca076,_0xf3be91)=>{const _0x34f427=_0x3f75c2,_0x4eb725=formatElapsed(_0x2ca076);_0xf3be91?console[_0x34f427(0xef)]('\x20\x20Round\x20'+(_0x221708+0x1)+'/'+_0x42a26e[_0x34f427(0x8d)][_0x34f427(0xc4)]+_0x34f427(0xfb)+a5_0x3a9a3b['green']('✓')+'\x20('+_0x4eb725+')'):console[_0x34f427(0xef)](_0x34f427(0x84)+(_0x221708+0x1)+'/'+_0x42a26e['rounds']['length']+_0x34f427(0xfb)+a5_0x3a9a3b[_0x34f427(0xf2)]('✗'));},'onEvaluationStart':()=>{const _0x54aaa5=_0x3f75c2;_0x17ea58[_0x54aaa5(0x8e)]=_0x54aaa5(0xb4);},'onEvaluationComplete':_0x1e1764=>{const _0x12bfec=_0x3f75c2,_0x4bc2a3=formatElapsed(_0x1e1764);console['log']('\x20\x20Evaluating...\x20'+a5_0x3a9a3b[_0x12bfec(0x8f)]('✓')+'\x20('+_0x4bc2a3+')');}});_0x17ea58[_0x3f75c2(0xce)](),_0xa75041[_0x3f75c2(0xf6)](_0x462688);if(_0x462688[_0x3f75c2(0xa4)]===_0x3f75c2(0xe5))console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x8f)]('✓\x20PASS:\x20'+_0x462688[_0x3f75c2(0x9a)])+a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xe9)));else _0x462688['status']===_0x3f75c2(0xec)?console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)]('✗\x20FAIL:\x20'+_0x462688[_0x3f75c2(0x9a)])+a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xe9))):console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0x8a)+_0x462688[_0x3f75c2(0x9a)]));_0x462688[_0x3f75c2(0xa0)]&&console[_0x3f75c2(0xef)](a5_0x3a9a3b['dim'](_0x3f75c2(0xb9)+_0x462688[_0x3f75c2(0xa0)]));}catch(_0x549301){_0x17ea58[_0x3f75c2(0xce)]();const _0x285c5b=_0x549301 instanceof Error?_0x549301[_0x3f75c2(0x9f)]:String(_0x549301);console['log'](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0x8a)+_0x285c5b)),_0xa75041[_0x3f75c2(0xf6)]({'name':_0x42a26e[_0x3f75c2(0xda)],'status':_0x3f75c2(0xcf),'reason':_0x285c5b,'timestamp':new Date()[_0x3f75c2(0xe3)](),'duration_ms':0x0});}}}console[_0x3f75c2(0xef)]();const _0x164334=Date[_0x3f75c2(0x97)]()-_0x564ef5,_0x26f91d=_0xa75041[_0x3f75c2(0x101)](_0x1767fe=>_0x1767fe[_0x3f75c2(0xa4)]==='PASS')[_0x3f75c2(0xc4)],_0x4a1641=_0xa75041['filter'](_0xc2716f=>_0xc2716f['status']===_0x3f75c2(0xec))['length'],_0x5dc251=_0xa75041[_0x3f75c2(0x101)](_0x3b901c=>_0x3b901c[_0x3f75c2(0xa4)]===_0x3f75c2(0xcf))[_0x3f75c2(0xc4)];console[_0x3f75c2(0xef)]('━'[_0x3f75c2(0x81)](0x3c)),console[_0x3f75c2(0xef)](_0x3f75c2(0x83)),console['log']('━'['repeat'](0x3c)),console[_0x3f75c2(0xef)]('Total:\x20\x20\x20\x20'+_0xa75041[_0x3f75c2(0xc4)]),console[_0x3f75c2(0xef)]('Passed:\x20\x20\x20'+a5_0x3a9a3b[_0x3f75c2(0x8f)](_0x26f91d)),console[_0x3f75c2(0xef)](_0x3f75c2(0xd9)+a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x4a1641));_0x5dc251>0x0&&console[_0x3f75c2(0xef)](_0x3f75c2(0xa5)+a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x5dc251));console[_0x3f75c2(0xef)](_0x3f75c2(0x6e)+formatElapsed(_0x164334)),console['log']('━'[_0x3f75c2(0x81)](0x3c));const _0x40506e={'summary':{'total':_0xa75041[_0x3f75c2(0xc4)],'passed':_0x26f91d,'failed':_0x4a1641,'errors':_0x5dc251>0x0?_0x5dc251:undefined,'duration_ms':_0x164334},'tests':_0xa75041,'agent':{'project':_0x4e62f0[_0x3f75c2(0x86)],'name':_0x4e62f0[_0x3f75c2(0x7d)],'site':_0x11778e},'timestamp':new Date(_0x564ef5)[_0x3f75c2(0xe3)]()};if(_0x4a78e0!==_0x3f75c2(0xe4)||_0x1f8581){const _0x9d856f=formatResults(_0x40506e,_0x4a78e0);if(_0x1f8581)try{a5_0x5e8169['writeFileSync'](_0x1f8581,_0x9d856f,_0x3f75c2(0xed)),console['log'](),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0x9b)+_0x1f8581));}catch(_0x5863c0){return console[_0x3f75c2(0xef)](),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0xa1)+_0x5863c0)),0x1;}else console['log'](),console[_0x3f75c2(0xef)](_0x9d856f);}const _0x51a9cc=_0xa75041[_0x3f75c2(0x101)](_0xf795f4=>_0xf795f4[_0x3f75c2(0xa4)]!==_0x3f75c2(0xe5));return _0x51a9cc[_0x3f75c2(0xc4)]>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x59ce(_0x5adbdc,_0x3f5dd5){_0x5adbdc=_0x5adbdc-0xe4;const _0x193a3d=a5_0x193a();let _0x59ce9a=_0x193a3d[_0x5adbdc];return _0x59ce9a;}const a5_0x39e9d9=a5_0x59ce;(function(_0xbbf366,_0x350a7f){const _0x57b77c=a5_0x59ce,_0x1675ff=_0xbbf366();while(!![]){try{const _0xf710e4=-parseInt(_0x57b77c(0xf6))/0x1*(-parseInt(_0x57b77c(0x133))/0x2)+parseInt(_0x57b77c(0x14a))/0x3*(parseInt(_0x57b77c(0xff))/0x4)+parseInt(_0x57b77c(0x125))/0x5*(parseInt(_0x57b77c(0x13d))/0x6)+-parseInt(_0x57b77c(0x13f))/0x7*(parseInt(_0x57b77c(0x167))/0x8)+parseInt(_0x57b77c(0x143))/0x9+parseInt(_0x57b77c(0xf1))/0xa*(-parseInt(_0x57b77c(0x14e))/0xb)+parseInt(_0x57b77c(0xe7))/0xc*(-parseInt(_0x57b77c(0x161))/0xd);if(_0xf710e4===_0x350a7f)break;else _0x1675ff['push'](_0x1675ff['shift']());}catch(_0x11f94e){_0x1675ff['push'](_0x1675ff['shift']());}}}(a5_0x193a,0xb3576));import*as a5_0x2385cc from'node:fs';import*as a5_0xe8eedc from'node:path';import a5_0x2c39cf from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x193a(){const _0x517239=['message','reason','495IcaMUU','\x20\x20Conversation:\x20','resolveAgentId','Site:\x20','Evaluating\x20response...','jsonl','resolveProjectId','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','executeReeval','FAIL',':\x20Sending\x20user\x20input...','find','now','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','...','Total:\x20\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','split','\x20(cached)','65vcFizT','\x27\x20to\x20create\x20the\x20folder\x20structure.','length','stop','source','Re-evaluating...','72kKFHMP','status','verbose','name','json','Using\x20agent:\x20','substring','isSpinning','map','execute','add','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Running:\x20','site','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','⚠\x20SKIPPED:\x20','some','Error:\x20No\x20previous\x20test\x20run\x20found.','Test\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','yellow','join','text','6031560ftjqJw','forEach','trim','basename','push','agentName','✗\x20FAIL:\x20','repeat','Run\x20tests\x20for\x20an\x20LLM\x20agent','Output\x20written\x20to:\x20','177770oFwviq','llmProject','\x20-\x20','reeval','Test\x20Summary','690044vNYeCF','\x22:\x20','\x20\x20Site:\x20','tags','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','projectName','start','multiple_agents','Executing\x20new\x20tests...','344KiqPyy','log','\x20(new)','found','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','New\x20tests\x20to\x20execute:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','No\x20tests\x20found\x20matching:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','PASS','testName','white','red','no_context','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','cyan','llm','Test\x20Configuration:','agent','Running\x20agent\x20tests...','Errors:\x20\x20\x20','tests','green','\x20\x20Evaluating...\x20','filter','...\x20','includes','toLowerCase','ERROR','\x20\x20Round\x20','Conversation\x20URL:\x20','timestamp','rounds','Error\x20writing\x20output\x20file:\x20','toISOString','Agent:\x20','eval','570NZQwPT','utf-8','testYmlPath','✓\x20PASS:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Available\x20tags:\x20','✗\x20ERROR:\x20','context','test.yml','No\x20tests\x20have\x20tags\x20defined.','tsv','404','no_local_folder','size','4aiiryV','description','table','dim','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','has','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Failed\x20Tests:','conversation_url','Passed:\x20\x20\x20','73068tsRDEV','projectDir','278782jZRYVw','/<agent-name>','\x20\x20Project:\x20','writeFileSync','1689345SrGUgh','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','not\x20found','\x20\x20-\x20','Usage:','50583RVySoi','Cached\x20run\x20from:\x20'];a5_0x193a=function(){return _0x517239;};return a5_0x193a();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x39e9d9(0x16a)]='agent:test';[a5_0x39e9d9(0x134)]=a5_0x39e9d9(0xef);async[a5_0x39e9d9(0x170)](_0x40662e){const _0x2f099=a5_0x39e9d9,{options:_0x55e501,args:_0x5bce9f,tdx:_0x224a42}=_0x40662e,_0xf9ff53=_0x5bce9f[0x0]||'.',_0x9995b1=_0x55e501['dryRun'],_0x2e0cb2=_0x55e501,_0x42ed6d=_0x2e0cb2[_0x2f099(0x124)]===![],_0x21bf2f=_0x2e0cb2[_0x2f099(0xf4)],_0x38a1e7=_0x2e0cb2[_0x2f099(0x16a)],_0x3c072c=_0x2e0cb2[_0x2f099(0xf9)],_0x480bef=_0x55e501[_0x2f099(0x174)],_0x1f7e54=_0x2e0cb2['output'];if(_0x21bf2f&&_0x42ed6d)return console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x155))),0x1;let _0x226dd1='table';if(_0x2e0cb2[_0x2f099(0x16b)])_0x226dd1=_0x2f099(0x16b);else{if(_0x2e0cb2[_0x2f099(0x153)])_0x226dd1=_0x2f099(0x153);else{if(_0x2e0cb2[_0x2f099(0x12f)])_0x226dd1=_0x2f099(0x12f);else{if(_0x2e0cb2['table'])_0x226dd1='table';}}}const _0x20a274=_0x2e0cb2[_0x2f099(0xf2)];let _0x2cf2c9=_0xf9ff53;const _0x476723=a5_0x2385cc['existsSync'](_0xf9ff53),_0x327ea2=_0xf9ff53==='.';if(!_0x476723||_0x327ea2){const _0x5739ec=resolveProjectFromContext(_0xf9ff53,_0x20a274,{'requireFile':_0x2f099(0x12d)});if(_0x5739ec[_0x2f099(0x102)])_0x2cf2c9=_0x5739ec['projectDir'],_0x5739ec[_0x2f099(0x165)]===_0x2f099(0x12c)&&console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x16c)+_0x2cf2c9));else switch(_0x5739ec[_0x2f099(0x14d)]){case _0x2f099(0x10c):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x5739ec[_0x2f099(0x14c)])),console['log'](),console[_0x2f099(0x100)](_0x2f099(0x149)),console[_0x2f099(0x100)](_0x2f099(0x175)),console['log'](_0x2f099(0x105)),console['log'](),console[_0x2f099(0x100)](_0x2f099(0x172));return 0x1;case _0x2f099(0x131):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x5739ec[_0x2f099(0x14c)])),console[_0x2f099(0x100)](),console[_0x2f099(0x100)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5739ec['llmProject']+_0x2f099(0x162));return 0x1;case _0x2f099(0xfd):{const _0x3f72df=a5_0xe8eedc[_0x2f099(0xea)](_0x5739ec[_0x2f099(0x13e)]);console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x2f099(0x144)+_0x5739ec[_0x2f099(0xf2)]+'\x22:'));for(const _0x2e5094 of _0x5739ec['agentDirs']){console[_0x2f099(0x100)](_0x2f099(0x148)+_0x2e5094);}return console['log'](),console[_0x2f099(0x100)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3f72df+_0x2f099(0x140)),0x1;}case'no_tests':console[_0x2f099(0x100)](a5_0x2c39cf['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5739ec['llmProject']+'\x22.')),console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x136)]('Project\x20path:\x20'+_0x5739ec['projectDir'])),console[_0x2f099(0x100)](),console[_0x2f099(0x100)](_0x2f099(0x137));return 0x1;}}const {definition:_0x574d92,agentInfo:_0x5b98f2}=parseTestFile(_0x2cf2c9);let _0x355cbb=_0x574d92[_0x2f099(0x115)];if(_0x38a1e7){const _0x49589b=_0x38a1e7[_0x2f099(0x15f)](',')['map'](_0x52d2e3=>_0x52d2e3['trim']());_0x355cbb=_0x574d92[_0x2f099(0x115)]['filter'](_0x4d59f5=>_0x49589b[_0x2f099(0x11a)](_0x4d59f5[_0x2f099(0x16a)]));if(_0x355cbb['length']===0x0)return console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x2f099(0x106)+_0x38a1e7)),console[_0x2f099(0x100)](a5_0x2c39cf['dim']('Available\x20tests:\x20'+_0x574d92['tests'][_0x2f099(0x16f)](_0xec7bd3=>_0xec7bd3[_0x2f099(0x16a)])[_0x2f099(0xe5)](',\x20'))),0x1;}if(_0x3c072c){const _0x39e15b=_0x3c072c[_0x2f099(0x15f)](',')[_0x2f099(0x16f)](_0x3a3980=>_0x3a3980[_0x2f099(0xe9)]()['toLowerCase']());_0x355cbb=_0x355cbb[_0x2f099(0x118)](_0x39911a=>_0x39911a[_0x2f099(0xf9)]?.[_0x2f099(0x178)](_0xdd4331=>_0x39e15b[_0x2f099(0x11a)](_0xdd4331['toLowerCase']())));if(_0x355cbb[_0x2f099(0x163)]===0x0){console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x3c072c));const _0x4fcf5a=new Set();return _0x574d92[_0x2f099(0x115)][_0x2f099(0xe8)](_0x37e6f4=>_0x37e6f4[_0x2f099(0xf9)]?.[_0x2f099(0xe8)](_0x3697a0=>_0x4fcf5a[_0x2f099(0x171)](_0x3697a0))),_0x4fcf5a[_0x2f099(0x132)]>0x0?console['log'](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x12a)+[..._0x4fcf5a][_0x2f099(0xe5)](',\x20'))):console['log'](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x12e))),0x1;}}if(_0x21bf2f)return this[_0x2f099(0x156)](_0x40662e,{'definition':{'tests':_0x355cbb},'agentInfo':_0x5b98f2,'outputFormat':_0x226dd1,'outputFile':_0x1f7e54,'testNames':_0x38a1e7});if(_0x9995b1){console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10f)](_0x2f099(0x111))),console[_0x2f099(0x100)](_0x2f099(0xf8)+a5_0x2c39cf['white'](_0x480bef)),console[_0x2f099(0x100)](_0x2f099(0x141)+a5_0x2c39cf[_0x2f099(0x10a)](_0x5b98f2[_0x2f099(0xfb)])),console[_0x2f099(0x100)]('\x20\x20Agent:\x20'+a5_0x2c39cf['white'](_0x5b98f2['agentName'])),console[_0x2f099(0x100)](),console['log']('Tests\x20found:\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x355cbb['length']));for(let _0x1835a5=0x0;_0x1835a5<_0x355cbb[_0x2f099(0x163)];_0x1835a5++){const _0x124da4=_0x355cbb[_0x1835a5],_0x3e097c=_0x124da4['rounds'][_0x2f099(0x163)]===0x1?'round':_0x2f099(0x120),_0x5b49a5=_0x124da4[_0x2f099(0xf9)]?.[_0x2f099(0x163)]?'\x20['+_0x124da4[_0x2f099(0xf9)][_0x2f099(0xe5)](',\x20')+']':'';console[_0x2f099(0x100)]('\x20\x20'+(_0x1835a5+0x1)+'.\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x124da4['name'])+'\x20('+_0x124da4['rounds'][_0x2f099(0x163)]+'\x20'+_0x3e097c+')'+a5_0x2c39cf[_0x2f099(0x136)](_0x5b49a5));}return 0x0;}let _0x577859,_0x30e64f;try{_0x577859=await _0x224a42[_0x2f099(0x110)][_0x2f099(0x154)](_0x5b98f2[_0x2f099(0xfb)]);}catch(_0x292eb4){const _0x85ada0=_0x292eb4 instanceof Error?_0x292eb4['message']:String(_0x292eb4);return _0x85ada0[_0x2f099(0x11a)](_0x2f099(0x130))||_0x85ada0[_0x2f099(0x11b)]()[_0x2f099(0x11a)]('not\x20found')?console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x139)+_0x5b98f2[_0x2f099(0xfb)])):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x17b)+_0x5b98f2['projectName']+_0x2f099(0xf7)+_0x85ada0)),0x1;}try{_0x30e64f=await _0x224a42[_0x2f099(0x110)][_0x2f099(0x150)](_0x5b98f2[_0x2f099(0xec)],_0x577859);}catch(_0x445ccc){const _0x2a3b80=_0x445ccc instanceof Error?_0x445ccc[_0x2f099(0x14c)]:String(_0x445ccc);return _0x2a3b80[_0x2f099(0x11a)]('404')||_0x2a3b80[_0x2f099(0x11b)]()[_0x2f099(0x11a)](_0x2f099(0x147))?console[_0x2f099(0x100)](a5_0x2c39cf['red'](_0x2f099(0x176)+_0x5b98f2[_0x2f099(0xec)])):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x15b)+_0x5b98f2[_0x2f099(0xec)]+'\x22:\x20'+_0x2a3b80)),0x1;}let _0xa24850;if(!_0x42ed6d)try{_0xa24850=await setupEvaluatorAgent(_0x224a42[_0x2f099(0x110)],_0x55e501[_0x2f099(0x169)]);}catch(_0x10d9fe){const _0x81175=_0x10d9fe instanceof Error?_0x10d9fe[_0x2f099(0x14c)]:String(_0x10d9fe);return console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x146)+_0x81175)),0x1;}console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10f)](_0x2f099(0x113))),console[_0x2f099(0x100)](_0x2f099(0x151)+a5_0x2c39cf[_0x2f099(0x10a)](_0x480bef)),console[_0x2f099(0x100)](_0x2f099(0x123)+a5_0x2c39cf[_0x2f099(0x10a)](_0x5b98f2['projectName']+'/'+_0x5b98f2[_0x2f099(0xec)])),console[_0x2f099(0x100)]();const _0x5bd007=[],_0x564aa0=[],_0x3f89ad=Date[_0x2f099(0x15a)]();for(let _0x3ec97a=0x0;_0x3ec97a<_0x355cbb['length'];_0x3ec97a++){const _0x33c4e7=_0x355cbb[_0x3ec97a];_0x355cbb['length']>0x1?console[_0x2f099(0x100)](_0x2f099(0x17a)+(_0x3ec97a+0x1)+'/'+_0x355cbb[_0x2f099(0x163)]+':\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x33c4e7[_0x2f099(0x16a)])):console[_0x2f099(0x100)]('Running\x20test:\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x33c4e7[_0x2f099(0x16a)]));const _0x45d23d=createCommandSpinner('Round\x201/'+_0x33c4e7[_0x2f099(0x120)][_0x2f099(0x163)]+':\x20Sending\x20user\x20input...');_0x45d23d['start']();try{const {result:_0x3b8706,conversation:_0x2179e3}=await runTest(_0x224a42[_0x2f099(0x110)],_0x33c4e7,{'agentId':_0x30e64f,'projectId':_0x577859,'site':_0x480bef,'noEval':_0x42ed6d,'evaluatorId':_0xa24850,'onRoundStart':(_0x3e5b72,_0x2b6c21)=>{const _0x5263e7=_0x2f099;_0x45d23d[_0x5263e7(0xe6)]='Round\x20'+(_0x3e5b72+0x1)+'/'+_0x2b6c21+_0x5263e7(0x158);},'onRoundComplete':(_0x5b9ae2,_0x4fd629,_0x39c1ff)=>{const _0x30ccda=_0x2f099,_0x16e4ce=formatElapsed(_0x4fd629);_0x39c1ff?console[_0x30ccda(0x100)](_0x30ccda(0x11d)+(_0x5b9ae2+0x1)+'/'+_0x33c4e7['rounds'][_0x30ccda(0x163)]+_0x30ccda(0x119)+a5_0x2c39cf[_0x30ccda(0x116)]('✓')+'\x20('+_0x16e4ce+')'):console[_0x30ccda(0x100)](_0x30ccda(0x11d)+(_0x5b9ae2+0x1)+'/'+_0x33c4e7[_0x30ccda(0x120)][_0x30ccda(0x163)]+'...\x20'+a5_0x2c39cf[_0x30ccda(0x10b)]('✗'));},'onEvaluationStart':()=>{const _0x3ba425=_0x2f099;_0x45d23d['text']=_0x3ba425(0x152);},'onEvaluationComplete':_0x179eeb=>{const _0x135d8b=_0x2f099,_0xa1818e=formatElapsed(_0x179eeb);console[_0x135d8b(0x100)](_0x135d8b(0x117)+a5_0x2c39cf[_0x135d8b(0x116)]('✓')+'\x20('+_0xa1818e+')');}});_0x45d23d[_0x2f099(0x164)](),_0x5bd007[_0x2f099(0xeb)](_0x3b8706),_0x564aa0[_0x2f099(0xeb)](_0x2179e3);if(_0x3b8706['status']==='PASS')console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x116)](_0x2f099(0x128)+_0x3b8706[_0x2f099(0x14d)]));else _0x3b8706['status']===_0x2f099(0x157)?console['log'](a5_0x2c39cf['red'](_0x2f099(0xed)+_0x3b8706[_0x2f099(0x14d)])):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)]('✗\x20ERROR:\x20'+_0x3b8706[_0x2f099(0x14d)]));_0x3b8706[_0x2f099(0x13b)]&&console['log'](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x11e)+_0x3b8706['conversation_url'])),console['log']();}catch(_0x1a0912){_0x45d23d[_0x2f099(0x164)]();const _0x383524=_0x1a0912 instanceof Error?_0x1a0912[_0x2f099(0x14c)]:String(_0x1a0912);console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x12b)+_0x383524)),console[_0x2f099(0x100)](),_0x5bd007['push']({'name':_0x33c4e7[_0x2f099(0x16a)],'status':_0x2f099(0x11c),'reason':_0x383524,'timestamp':new Date()[_0x2f099(0x122)](),'duration_ms':0x0});}}const _0x4413ec=Date[_0x2f099(0x15a)]()-_0x3f89ad,_0x28e9d3=_0x5bd007['filter'](_0x5f5da5=>_0x5f5da5[_0x2f099(0x168)]===_0x2f099(0x108))['length'],_0x19c92b=_0x5bd007['filter'](_0x2d55f9=>_0x2d55f9[_0x2f099(0x168)]==='FAIL')[_0x2f099(0x163)],_0x27fbbd=_0x5bd007[_0x2f099(0x118)](_0x4d1f85=>_0x4d1f85[_0x2f099(0x168)]==='ERROR')[_0x2f099(0x163)];console[_0x2f099(0x100)]('━'['repeat'](0x3c)),console[_0x2f099(0x100)](_0x2f099(0xf5)),console[_0x2f099(0x100)]('━'[_0x2f099(0xee)](0x3c)),console['log'](_0x2f099(0x15d)+_0x5bd007['length']),console[_0x2f099(0x100)](_0x2f099(0x13c)+a5_0x2c39cf[_0x2f099(0x116)](_0x28e9d3)),console[_0x2f099(0x100)]('Failed:\x20\x20\x20'+a5_0x2c39cf[_0x2f099(0x10b)](_0x19c92b));_0x27fbbd>0x0&&console[_0x2f099(0x100)](_0x2f099(0x114)+a5_0x2c39cf[_0x2f099(0x10b)](_0x27fbbd));console['log']('Duration:\x20'+formatElapsed(_0x4413ec)),console['log']('━'[_0x2f099(0xee)](0x3c));const _0x1bbf3e=_0x5bd007[_0x2f099(0x118)](_0x1e3bab=>_0x1e3bab[_0x2f099(0x168)]!==_0x2f099(0x108));if(_0x1bbf3e[_0x2f099(0x163)]>0x0){console[_0x2f099(0x100)](),console['log'](_0x2f099(0x13a));for(const _0x3f7373 of _0x1bbf3e){const _0x47f006=a5_0x2c39cf['red']('✗'),_0x107ba8=_0x3f7373['reason']['length']>0x32?_0x3f7373[_0x2f099(0x14d)][_0x2f099(0x16d)](0x0,0x32)+_0x2f099(0x15c):_0x3f7373[_0x2f099(0x14d)];console[_0x2f099(0x100)]('\x20\x20'+_0x47f006+'\x20'+_0x3f7373['name']+':\x20'+_0x107ba8);}}const _0x53e66e={'summary':{'total':_0x5bd007['length'],'passed':_0x28e9d3,'failed':_0x19c92b,'errors':_0x27fbbd>0x0?_0x27fbbd:undefined,'duration_ms':_0x4413ec},'tests':_0x5bd007,'agent':{'project':_0x5b98f2[_0x2f099(0xfb)],'name':_0x5b98f2['agentName'],'site':_0x480bef},'timestamp':new Date(_0x3f89ad)['toISOString']()};try{const _0xd4404f=buildCachedTestRun(_0x564aa0,{'site':_0x480bef,'projectId':_0x577859,'projectName':_0x5b98f2[_0x2f099(0xfb)],'agentId':_0x30e64f,'agentName':_0x5b98f2['agentName'],'testYmlPath':a5_0xe8eedc['resolve'](_0x5b98f2[_0x2f099(0x127)])});saveLastTestRun(_0xd4404f);}catch{}if(_0x226dd1!==_0x2f099(0x135)||_0x1f7e54){const _0x8839c5=formatResults(_0x53e66e,_0x226dd1);if(_0x1f7e54)try{a5_0x2385cc[_0x2f099(0x142)](_0x1f7e54,_0x8839c5,_0x2f099(0x126)),console[_0x2f099(0x100)](),console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0xf0)+_0x1f7e54));}catch(_0x27c983){return console[_0x2f099(0x100)](),console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x121)+_0x27c983)),0x1;}else console['log'](),console[_0x2f099(0x100)](_0x8839c5);}return _0x1bbf3e['length']>0x0?0x1:0x0;}async[a5_0x39e9d9(0x156)](_0x583cc4,_0xb291af){const _0x18425b=a5_0x39e9d9,{options:_0x4ffdde,tdx:_0x5439a4}=_0x583cc4,{definition:_0x2cd15e,agentInfo:_0x4bb7c1,outputFormat:_0x4e8254,outputFile:_0x15d5fb}=_0xb291af,_0x561e67=_0x4ffdde[_0x18425b(0x174)],_0x908771=loadLastTestRun();if(!_0x908771)return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x179))),console['log'](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x103))),0x1;if(_0x908771['agent'][_0x18425b(0xec)]!==_0x4bb7c1[_0x18425b(0xec)])return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x129)+_0x908771[_0x18425b(0x112)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4bb7c1[_0x18425b(0xec)]+'\x22.')),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0xfa))),0x1;const _0x32b392=new Set(_0x908771['conversations'][_0x18425b(0x16f)](_0xc563bd=>_0xc563bd[_0x18425b(0x109)])),_0xaf195e=_0x2cd15e[_0x18425b(0x115)][_0x18425b(0x118)](_0x3d1219=>!_0x32b392[_0x18425b(0x138)](_0x3d1219['name']));if(_0xaf195e[_0x18425b(0x163)]>0x0&&_0x908771[_0x18425b(0x174)]!==_0x561e67)return console[_0x18425b(0x100)](a5_0x2c39cf['red'](_0x18425b(0x10e))),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x107)+_0x908771[_0x18425b(0x174)]+_0x18425b(0x10d)+_0x561e67+'\x22.')),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x15e)+_0x908771[_0x18425b(0x174)]+_0x18425b(0x145))),0x1;const _0x559d7b=_0x2cd15e['tests'][_0x18425b(0x118)](_0x54583f=>_0x32b392[_0x18425b(0x138)](_0x54583f[_0x18425b(0x16a)])),_0x1a10b6=_0xaf195e;let _0x4a439f;try{_0x4a439f=await setupEvaluatorAgent(_0x5439a4[_0x18425b(0x110)],_0x4ffdde[_0x18425b(0x169)]);}catch(_0x2a02e2){const _0x532afc=_0x2a02e2 instanceof Error?_0x2a02e2[_0x18425b(0x14c)]:String(_0x2a02e2);return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x146)+_0x532afc)),0x1;}console['log'](a5_0x2c39cf['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x18425b(0x100)](_0x18425b(0x14b)+a5_0x2c39cf[_0x18425b(0x10a)](_0x908771[_0x18425b(0x11f)])),console[_0x18425b(0x100)](_0x18425b(0x123)+a5_0x2c39cf[_0x18425b(0x10a)](_0x908771[_0x18425b(0x112)][_0x18425b(0xfb)]+'/'+_0x908771[_0x18425b(0x112)][_0x18425b(0xec)]));_0x1a10b6[_0x18425b(0x163)]>0x0&&console[_0x18425b(0x100)](_0x18425b(0x104)+a5_0x2c39cf['yellow'](_0x1a10b6[_0x18425b(0x163)]));console[_0x18425b(0x100)]();const _0x423391=[],_0xc86f78=Date[_0x18425b(0x15a)](),_0x38e0a6=createCommandSpinner(_0x18425b(0x166));if(_0x559d7b[_0x18425b(0x163)]>0x0)try{const _0x2ee70b=await reevaluateFromCache(_0x5439a4['llm'],_0x908771,{'tests':_0x559d7b},{'evaluatorId':_0x4a439f,'onTestStart':(_0xc68d71,_0x4f9a4b,_0xcf3a30)=>{const _0x479c51=_0x18425b;_0x38e0a6[_0x479c51(0xe6)]='Re-evaluating\x20'+(_0x4f9a4b+0x1)+'/'+_0xcf3a30+':\x20'+_0xc68d71+'...';if(!_0x38e0a6[_0x479c51(0x16e)])_0x38e0a6[_0x479c51(0xfc)]();},'onTestComplete':(_0x4611cd,_0x43c4f8)=>{const _0x1a1fc1=_0x18425b;_0x38e0a6[_0x1a1fc1(0x164)]();if(_0x43c4f8['status']==='PASS')console[_0x1a1fc1(0x100)](a5_0x2c39cf['green'](_0x1a1fc1(0x128)+_0x4611cd)+a5_0x2c39cf[_0x1a1fc1(0x136)]('\x20(cached)'));else _0x43c4f8[_0x1a1fc1(0x168)]===_0x1a1fc1(0x157)?console[_0x1a1fc1(0x100)](a5_0x2c39cf[_0x1a1fc1(0x10b)]('✗\x20FAIL:\x20'+_0x4611cd+_0x1a1fc1(0xf3)+_0x43c4f8[_0x1a1fc1(0x14d)])+a5_0x2c39cf[_0x1a1fc1(0x136)](_0x1a1fc1(0x160))):console[_0x1a1fc1(0x100)](a5_0x2c39cf[_0x1a1fc1(0x10b)](_0x1a1fc1(0x12b)+_0x4611cd+_0x1a1fc1(0xf3)+_0x43c4f8[_0x1a1fc1(0x14d)]));_0x43c4f8[_0x1a1fc1(0x13b)]&&console[_0x1a1fc1(0x100)](a5_0x2c39cf[_0x1a1fc1(0x136)](_0x1a1fc1(0x14f)+_0x43c4f8[_0x1a1fc1(0x13b)])),_0x423391[_0x1a1fc1(0xeb)](_0x43c4f8);},'onTestSkipped':(_0x8fc7cb,_0x718566)=>{const _0x1eb3e8=_0x18425b;_0x38e0a6[_0x1eb3e8(0x164)](),console['log'](a5_0x2c39cf[_0x1eb3e8(0xe4)](_0x1eb3e8(0x177)+_0x8fc7cb+_0x1eb3e8(0xf3)+_0x718566));}});for(const _0x56d00e of _0x2ee70b){!_0x423391[_0x18425b(0x159)](_0x593e6e=>_0x593e6e['name']===_0x56d00e[_0x18425b(0x16a)])&&_0x423391[_0x18425b(0xeb)](_0x56d00e);}}catch(_0x5afe40){_0x38e0a6[_0x18425b(0x164)]();const _0x55d827=_0x5afe40 instanceof Error?_0x5afe40[_0x18425b(0x14c)]:String(_0x5afe40);return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x55d827)),0x1;}_0x38e0a6[_0x18425b(0x164)]();if(_0x1a10b6[_0x18425b(0x163)]>0x0){console[_0x18425b(0x100)](),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10f)](_0x18425b(0xfe)));const {projectId:_0x49b01b,agentId:_0x18138e}=_0x908771[_0x18425b(0x112)];for(const _0x458809 of _0x1a10b6){console[_0x18425b(0x100)](_0x18425b(0x173)+a5_0x2c39cf['white'](_0x458809[_0x18425b(0x16a)]));const _0x4aef3c=createCommandSpinner('Round\x201/'+_0x458809['rounds'][_0x18425b(0x163)]+_0x18425b(0x158));_0x4aef3c['start']();try{const {result:_0x22023e}=await runTest(_0x5439a4[_0x18425b(0x110)],_0x458809,{'agentId':_0x18138e,'projectId':_0x49b01b,'site':_0x908771[_0x18425b(0x174)],'noEval':![],'evaluatorId':_0x4a439f,'onRoundStart':(_0x1a3cc6,_0x45fa05)=>{const _0x43ae85=_0x18425b;_0x4aef3c[_0x43ae85(0xe6)]='Round\x20'+(_0x1a3cc6+0x1)+'/'+_0x45fa05+_0x43ae85(0x158);},'onRoundComplete':(_0x28fcb4,_0x1fd40a,_0x1be9cb)=>{const _0x8eb58=_0x18425b,_0x149eec=formatElapsed(_0x1fd40a);_0x1be9cb?console[_0x8eb58(0x100)](_0x8eb58(0x11d)+(_0x28fcb4+0x1)+'/'+_0x458809[_0x8eb58(0x120)][_0x8eb58(0x163)]+'...\x20'+a5_0x2c39cf[_0x8eb58(0x116)]('✓')+'\x20('+_0x149eec+')'):console[_0x8eb58(0x100)](_0x8eb58(0x11d)+(_0x28fcb4+0x1)+'/'+_0x458809[_0x8eb58(0x120)][_0x8eb58(0x163)]+_0x8eb58(0x119)+a5_0x2c39cf[_0x8eb58(0x10b)]('✗'));},'onEvaluationStart':()=>{const _0x45aea9=_0x18425b;_0x4aef3c[_0x45aea9(0xe6)]=_0x45aea9(0x152);},'onEvaluationComplete':_0x457f6d=>{const _0x155ef1=_0x18425b,_0x388ff3=formatElapsed(_0x457f6d);console['log']('\x20\x20Evaluating...\x20'+a5_0x2c39cf[_0x155ef1(0x116)]('✓')+'\x20('+_0x388ff3+')');}});_0x4aef3c['stop'](),_0x423391[_0x18425b(0xeb)](_0x22023e);if(_0x22023e[_0x18425b(0x168)]===_0x18425b(0x108))console['log'](a5_0x2c39cf[_0x18425b(0x116)](_0x18425b(0x128)+_0x22023e[_0x18425b(0x14d)])+a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x101)));else _0x22023e[_0x18425b(0x168)]===_0x18425b(0x157)?console[_0x18425b(0x100)](a5_0x2c39cf['red'](_0x18425b(0xed)+_0x22023e[_0x18425b(0x14d)])+a5_0x2c39cf['dim'](_0x18425b(0x101))):console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x12b)+_0x22023e[_0x18425b(0x14d)]));_0x22023e['conversation_url']&&console[_0x18425b(0x100)](a5_0x2c39cf['dim']('\x20\x20Conversation:\x20'+_0x22023e[_0x18425b(0x13b)]));}catch(_0x2d3962){_0x4aef3c[_0x18425b(0x164)]();const _0x2d076b=_0x2d3962 instanceof Error?_0x2d3962['message']:String(_0x2d3962);console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x12b)+_0x2d076b)),_0x423391['push']({'name':_0x458809['name'],'status':_0x18425b(0x11c),'reason':_0x2d076b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x18425b(0x100)]();const _0x3bb3e9=Date['now']()-_0xc86f78,_0x2a9f40=_0x423391[_0x18425b(0x118)](_0x39739f=>_0x39739f[_0x18425b(0x168)]===_0x18425b(0x108))[_0x18425b(0x163)],_0x18b231=_0x423391['filter'](_0x327ca6=>_0x327ca6[_0x18425b(0x168)]==='FAIL')['length'],_0x4fc769=_0x423391[_0x18425b(0x118)](_0x4298af=>_0x4298af[_0x18425b(0x168)]===_0x18425b(0x11c))[_0x18425b(0x163)];console['log']('━'[_0x18425b(0xee)](0x3c)),console[_0x18425b(0x100)]('Re-evaluation\x20Summary'),console['log']('━'[_0x18425b(0xee)](0x3c)),console['log'](_0x18425b(0x15d)+_0x423391['length']),console[_0x18425b(0x100)]('Passed:\x20\x20\x20'+a5_0x2c39cf[_0x18425b(0x116)](_0x2a9f40)),console['log']('Failed:\x20\x20\x20'+a5_0x2c39cf[_0x18425b(0x10b)](_0x18b231));_0x4fc769>0x0&&console[_0x18425b(0x100)](_0x18425b(0x114)+a5_0x2c39cf[_0x18425b(0x10b)](_0x4fc769));console[_0x18425b(0x100)]('Duration:\x20'+formatElapsed(_0x3bb3e9)),console[_0x18425b(0x100)]('━'['repeat'](0x3c));const _0x1c58cf={'summary':{'total':_0x423391[_0x18425b(0x163)],'passed':_0x2a9f40,'failed':_0x18b231,'errors':_0x4fc769>0x0?_0x4fc769:undefined,'duration_ms':_0x3bb3e9},'tests':_0x423391,'agent':{'project':_0x4bb7c1[_0x18425b(0xfb)],'name':_0x4bb7c1[_0x18425b(0xec)],'site':_0x561e67},'timestamp':new Date(_0xc86f78)[_0x18425b(0x122)]()};if(_0x4e8254!==_0x18425b(0x135)||_0x15d5fb){const _0x388f19=formatResults(_0x1c58cf,_0x4e8254);if(_0x15d5fb)try{a5_0x2385cc[_0x18425b(0x142)](_0x15d5fb,_0x388f19,_0x18425b(0x126)),console[_0x18425b(0x100)](),console['log'](a5_0x2c39cf[_0x18425b(0x136)]('Output\x20written\x20to:\x20'+_0x15d5fb));}catch(_0xf53dbf){return console[_0x18425b(0x100)](),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)]('Error\x20writing\x20output\x20file:\x20'+_0xf53dbf)),0x1;}else console[_0x18425b(0x100)](),console[_0x18425b(0x100)](_0x388f19);}const _0x2fcc4a=_0x423391[_0x18425b(0x118)](_0x2bd390=>_0x2bd390[_0x18425b(0x168)]!==_0x18425b(0x108));return _0x2fcc4a[_0x18425b(0x163)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0xe72bc9=a6_0x265a;(function(_0x52c269,_0x33e75d){const _0x57c87f=a6_0x265a,_0x3b2610=_0x52c269();while(!![]){try{const _0x5539ba=parseInt(_0x57c87f(0x13e))/0x1*(-parseInt(_0x57c87f(0x146))/0x2)+parseInt(_0x57c87f(0x171))/0x3+parseInt(_0x57c87f(0x149))/0x4+-parseInt(_0x57c87f(0x158))/0x5*(-parseInt(_0x57c87f(0x13c))/0x6)+-parseInt(_0x57c87f(0x151))/0x7*(-parseInt(_0x57c87f(0x172))/0x8)+parseInt(_0x57c87f(0x168))/0x9+-parseInt(_0x57c87f(0x142))/0xa;if(_0x5539ba===_0x33e75d)break;else _0x3b2610['push'](_0x3b2610['shift']());}catch(_0x2fa8f3){_0x3b2610['push'](_0x3b2610['shift']());}}}(a6_0x2e7b,0xdcc0a));import{BaseCommand}from'./command.js';function a6_0x265a(_0xa4c80a,_0x5f3322){_0xa4c80a=_0xa4c80a-0x138;const _0x2e7b58=a6_0x2e7b();let _0x265ae9=_0x2e7b58[_0xa4c80a];return _0x265ae9;}import{RawAPI}from'../sdk/api.js';function a6_0x2e7b(){const _0x2078ff=['has','toLowerCase','trim','includes','35HzFmUt','\x0aStack\x20trace:\x0a','message','length','noColor','log','name','137665nkWoqC','readBodyFromFile','indexOf','error','data','x-xsrf-token','PATCH','set-cookie','authorization','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','substring','stack','proxy-authorization','x-trino-user','.\x20Valid\x20types:\x20','startsWith','6556662fAoQUs','Results\x20saved\x20to\x20','toUpperCase','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Invalid\x20header\x20format:\x20\x22','workflow','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','cdp','llm','399555YggwGD','711496atDoZa','status','headers','entries','trino','Error:\x20','POST','type','description','file','174CGuSfU','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','1fsxpTQ','header','output','join','15318420duqfyb','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','color','site','1579670OHdGqm','isArray','GET','4484136SfGEIS','method','api','verbose'];a6_0x2e7b=function(){return _0x2078ff;};return a6_0x2e7b();}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([a6_0xe72bc9(0x160),a6_0xe72bc9(0x164),'cookie',a6_0xe72bc9(0x15f),'set-cookie2',a6_0xe72bc9(0x15d),'x-auth-token',a6_0xe72bc9(0x165)]);function isSensitiveHeader(_0x39eb0b){const _0x182506=a6_0xe72bc9;return SENSITIVE_HEADERS[_0x182506(0x14d)](_0x39eb0b[_0x182506(0x14e)]());}function parseHeader(_0x220cfc){const _0x46dcae=a6_0xe72bc9,_0x48228d=_0x220cfc[_0x46dcae(0x15a)](':');if(_0x48228d===-0x1)throw new Error(_0x46dcae(0x16c)+_0x220cfc+'\x22.\x20'+_0x46dcae(0x143));const _0x2e1fec=_0x220cfc[_0x46dcae(0x162)](0x0,_0x48228d)['trim'](),_0x2ccb88=_0x220cfc['substring'](_0x48228d+0x1)[_0x46dcae(0x14f)]();if(!_0x2e1fec)throw new Error(_0x46dcae(0x161)+_0x220cfc+'\x22');return[_0x2e1fec,_0x2ccb88];}export class ApiCommand extends BaseCommand{[a6_0xe72bc9(0x157)]=a6_0xe72bc9(0x14b);[a6_0xe72bc9(0x13a)]=a6_0xe72bc9(0x16e);['validate'](_0x1c58e7){const _0x2926f0=a6_0xe72bc9,{args:_0x5dd772,options:_0x591b4b}=_0x1c58e7,_0x40539c=_0x591b4b;if(_0x5dd772['length']===0x0)return _0x2926f0(0x13d);const _0x16d6ed=_0x5dd772[0x0];if(!_0x16d6ed[_0x2926f0(0x167)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x16d6ed;const _0x355484=_0x40539c[_0x2926f0(0x15c)],_0x44e86d=_0x40539c[_0x2926f0(0x13b)];if(_0x355484&&_0x44e86d)return _0x2926f0(0x16b);const _0xc3906d=_0x40539c[_0x2926f0(0x14a)]||_0x2926f0(0x148),_0x2c0f26=[_0x2926f0(0x148),_0x2926f0(0x138),'PUT','DELETE',_0x2926f0(0x15e)];if(!_0x2c0f26[_0x2926f0(0x150)](_0xc3906d[_0x2926f0(0x16a)]()))return'Invalid\x20HTTP\x20method:\x20'+_0xc3906d+'.\x20Valid\x20methods:\x20'+_0x2c0f26[_0x2926f0(0x141)](',\x20');const _0x2485da=_0x40539c[_0x2926f0(0x139)]||'td',_0x572759=['td',_0x2926f0(0x16f),_0x2926f0(0x16d),_0x2926f0(0x176),_0x2926f0(0x170),'llm-proxy'];if(!_0x572759['includes'](_0x2485da))return'Invalid\x20API\x20type:\x20'+_0x2485da+_0x2926f0(0x166)+_0x572759['join'](',\x20');return undefined;}async['execute'](_0x16b82e){const _0x35bb04=a6_0xe72bc9,{options:_0x5e3917,args:_0x1f6cdd,tdx:_0x3f9a51}=_0x16b82e,_0x2c18d9=_0x5e3917,_0x52b77f=_0x1f6cdd[0x0],_0x2f38b9=(_0x2c18d9['method']||'GET')[_0x35bb04(0x16a)](),_0x12a1aa=_0x2c18d9[_0x35bb04(0x15c)],_0x18e1fb=_0x2c18d9[_0x35bb04(0x13b)],_0x49d6d5=_0x2c18d9[_0x35bb04(0x13f)],_0x585220=_0x2c18d9[_0x35bb04(0x139)]||'td';try{const _0xddb69f={};if(_0x49d6d5){const _0x2563b9=Array[_0x35bb04(0x147)](_0x49d6d5)?_0x49d6d5:[_0x49d6d5];for(const _0x2847f7 of _0x2563b9){const [_0x38e750,_0x53236b]=parseHeader(_0x2847f7);_0xddb69f[_0x38e750]=_0x53236b;}}let _0x384d6b;if(_0x12a1aa)_0x384d6b=_0x12a1aa;else{if(_0x18e1fb)try{_0x384d6b=RawAPI[_0x35bb04(0x159)](_0x18e1fb);}catch(_0x528d1b){return console[_0x35bb04(0x15b)]('Error:\x20'+(_0x528d1b instanceof Error?_0x528d1b[_0x35bb04(0x153)]:String(_0x528d1b))),0x1;}}const _0x5ed025={'method':_0x2f38b9,'apiType':_0x585220,'includeHeaders':_0x5e3917[_0x35bb04(0x14c)]};_0x384d6b&&(_0x5ed025['body']=_0x384d6b);Object['keys'](_0xddb69f)[_0x35bb04(0x154)]>0x0&&(_0x5ed025[_0x35bb04(0x174)]=_0xddb69f);if(_0x5e3917[_0x35bb04(0x14c)]){const _0x399bca=resolveSite(_0x5e3917[_0x35bb04(0x145)]),_0x47c1f8=getEndpoint(_0x399bca,_0x585220),_0x603d72=''+_0x47c1f8+_0x52b77f;console[_0x35bb04(0x15b)]('>\x20'+_0x2f38b9+'\x20'+_0x603d72);const _0x9a2f64=getAuthHeaders(_0x399bca),_0x56fab0={..._0x9a2f64,..._0xddb69f};for(const [_0x16d4c4,_0xb975e1]of Object[_0x35bb04(0x175)](_0x56fab0)){!isSensitiveHeader(_0x16d4c4)&&console[_0x35bb04(0x15b)]('>\x20'+_0x16d4c4+':\x20'+_0xb975e1);}_0x384d6b&&console[_0x35bb04(0x15b)]('>'),console[_0x35bb04(0x15b)]('');}const _0x42f2b9=await _0x3f9a51['api']['request'](_0x52b77f,_0x5ed025);if(_0x5e3917[_0x35bb04(0x14c)]&&_0x42f2b9[_0x35bb04(0x174)]){console[_0x35bb04(0x15b)]('<\x20HTTP/1.1\x20'+_0x42f2b9[_0x35bb04(0x173)]);for(const [_0xe1b1c3,_0x187ba1]of Object['entries'](_0x42f2b9[_0x35bb04(0x174)])){!isSensitiveHeader(_0xe1b1c3)&&console[_0x35bb04(0x15b)]('<\x20'+_0xe1b1c3+':\x20'+_0x187ba1);}console[_0x35bb04(0x15b)]('');}const _0x2eda0e=Boolean(_0x5e3917['output']),_0x3777c4={'color':_0x5e3917['color'],'noColor':_0x5e3917[_0x35bb04(0x155)]||_0x2eda0e&&!_0x5e3917[_0x35bb04(0x144)]},_0xfafb71=colorizeJSON(_0x42f2b9['data'],_0x3777c4);return _0x5e3917[_0x35bb04(0x140)]?(writeFileSync(_0x5e3917[_0x35bb04(0x140)],_0xfafb71),console['error'](_0x35bb04(0x169)+_0x5e3917[_0x35bb04(0x140)])):console[_0x35bb04(0x156)](_0xfafb71),0x0;}catch(_0x5491ab){return _0x5491ab instanceof Error?(console[_0x35bb04(0x15b)](_0x35bb04(0x177)+_0x5491ab['message']),_0x5e3917[_0x35bb04(0x14c)]&&_0x5491ab[_0x35bb04(0x163)]&&console[_0x35bb04(0x15b)](_0x35bb04(0x152)+_0x5491ab['stack'])):console[_0x35bb04(0x15b)](_0x35bb04(0x177)+String(_0x5491ab)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x14d0db=a7_0x1959;(function(_0x4fa23d,_0x108e9c){const _0xc226ed=a7_0x1959,_0x20d070=_0x4fa23d();while(!![]){try{const _0x2c70a8=parseInt(_0xc226ed(0x208))/0x1+-parseInt(_0xc226ed(0x1d0))/0x2*(-parseInt(_0xc226ed(0x1f2))/0x3)+-parseInt(_0xc226ed(0x1d3))/0x4*(-parseInt(_0xc226ed(0x1df))/0x5)+-parseInt(_0xc226ed(0x219))/0x6*(-parseInt(_0xc226ed(0x1d5))/0x7)+-parseInt(_0xc226ed(0x1cb))/0x8+-parseInt(_0xc226ed(0x210))/0x9*(-parseInt(_0xc226ed(0x217))/0xa)+parseInt(_0xc226ed(0x1e6))/0xb*(-parseInt(_0xc226ed(0x209))/0xc);if(_0x2c70a8===_0x108e9c)break;else _0x20d070['push'](_0x20d070['shift']());}catch(_0x5cb2f7){_0x20d070['push'](_0x20d070['shift']());}}}(a7_0x4f54,0x5e3b2));function a7_0x1959(_0x19ad33,_0x367b19){_0x19ad33=_0x19ad33-0x1ca;const _0x4f54a2=a7_0x4f54();let _0x19590e=_0x4f54a2[_0x19ad33];return _0x19590e;}function a7_0x4f54(){const _0x1c2061=['password','377931JmRiEu','auth:setup','last_name','Name:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','trim','tdx\x20profile:\x20','Enter\x20your\x20TD\x20API\x20key:','\x20(site:\x20','name','API\x20key\x20cannot\x20be\x20empty','✓\x20API\x20key\x20removed\x20from\x20keychain','bold','Select\x20your\x20Treasure\x20Data\x20site:','filter','Validating\x20API\x20key...','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','✗\x20Validation\x20failed:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','profile','jobs','376422PKiUfe','630348OfoySn','join','Remove\x20API\x20key\x20from\x20system\x20keychain','red','customSite','✓\x20Profile\x20\x27','log','1640097fUPkZw','\x20\x20tdx','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','test','You\x20can\x20find\x20your\x20API\x20key\x20at:','getUserInfo','30KPSzRK','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','340482IxiZtj','us01','N/A','3319088zWMoNi','error','\x20--profile\x20','warn','Enter\x20site\x20name:','4nWmBGb','User:\x20','message','69724roLieO','create','49qsdSlo','execute','✓\x20Default\x20site\x20set\x20to\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','site','No\x20credential\x20found','\x20for\x20profile:\x20','other','description','first_name','65sfYAwu','tdx:\x20auth\x20setup','System\x20keychain\x20is\x20not\x20available','email','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:clear','Site\x20name\x20cannot\x20be\x20empty','209jnouVT','ERROR','\x0aSetup\x20cancelled','tdx:\x20auth\x20clear','No\x20API\x20key\x20found\x20in\x20keychain','\x20(profile:\x20','select','yellow','status','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','apiKey'];a7_0x4f54=function(){return _0x1c2061;};return a7_0x4f54();}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}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{buildSiteChoices}from'../core/constants.js';import a7_0x1418b1 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1bf0b from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x14d0db(0x1f3);[a7_0x14d0db(0x1dd)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x14d0db(0x1d6)](_0x3580bb){const _0x580863=a7_0x14d0db,{options:_0x52a63c}=_0x3580bb,_0x592625=_0x52a63c[_0x580863(0x206)];console[_0x580863(0x20f)](a7_0x1bf0b[_0x580863(0x1fe)](_0x580863(0x1e0)));const _0x458039=_0x52a63c['site']||_0x580863(0x21a),{choices:_0xfe2b57,initialIndex:_0x3d8741}=buildSiteChoices(_0x458039),_0x34a5ca=_0x592625?_0x580863(0x212)+_0x592625+'):':_0x580863(0x1ff),_0x4037e2=await a7_0x1418b1({'type':_0x580863(0x1ec),'name':'site','message':_0x34a5ca,'choices':_0xfe2b57,'initial':_0x3d8741});if(!_0x4037e2[_0x580863(0x1d9)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x313241;if(_0x4037e2[_0x580863(0x1d9)]===_0x580863(0x1dc)){const _0x15f2d6=await a7_0x1418b1({'type':'text','name':_0x580863(0x20d),'message':_0x580863(0x1cf),'initial':_0x580863(0x21a),'validate':_0x5ac87f=>{const _0xfd3a8d=_0x580863;if(!_0x5ac87f||!_0x5ac87f[_0xfd3a8d(0x1f7)]())return _0xfd3a8d(0x1e5);if(!/^[a-z0-9-]+$/[_0xfd3a8d(0x214)](_0x5ac87f[_0xfd3a8d(0x1f7)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x15f2d6[_0x580863(0x20d)])return console['log'](_0x580863(0x1e8)),0x1;_0x313241=_0x15f2d6[_0x580863(0x20d)];}else _0x313241=_0x4037e2[_0x580863(0x1d9)];const _0x212281=resolveSite(_0x313241);console[_0x580863(0x20f)](_0x580863(0x1d8)+_0x212281),console[_0x580863(0x20f)](_0x580863(0x215)),console[_0x580863(0x20f)]('\x20\x20'+getConsoleUrl(_0x212281,'/app/mp/ak'));const _0x47bee4=await a7_0x1418b1({'type':_0x580863(0x1f1),'name':_0x580863(0x1f0),'message':_0x580863(0x1f9),'validate':_0x324273=>{const _0x15672c=_0x580863;if(!_0x324273||!_0x324273[_0x15672c(0x1f7)]())return _0x15672c(0x1fc);return!![];}});if(!_0x47bee4['apiKey'])return console['log'](_0x580863(0x1e8)),0x1;const _0x18a622=_0x47bee4[_0x580863(0x1f0)];console[_0x580863(0x20f)](_0x580863(0x201));try{const _0x1efcfd=TDX[_0x580863(0x1d4)]({'site':_0x212281,'apiKey':_0x18a622[_0x580863(0x1f7)](),'logLevel':_0x52a63c['logLevel']??LogLevel[_0x580863(0x1e7)]}),_0x3dc04e=await _0x1efcfd[_0x580863(0x207)][_0x580863(0x216)]();console[_0x580863(0x20f)](_0x580863(0x205)+_0x3dc04e['email']+')');const _0x16d2f3=await isKeychainAvailable();_0x16d2f3?(await saveAPIKeyAsync(_0x18a622[_0x580863(0x1f7)](),_0x212281,_0x592625),console['log'](_0x580863(0x1ef)+(_0x592625?_0x580863(0x1eb)+_0x592625+')':''))):(console[_0x580863(0x1ce)](a7_0x1bf0b[_0x580863(0x1ed)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x580863(0x1ce)](a7_0x1bf0b[_0x580863(0x1ed)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x592625){const _0x23c1b4={'site':_0x212281};saveProfileToUserConfig(_0x592625,_0x23c1b4),console[_0x580863(0x20f)](_0x580863(0x20e)+_0x592625+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x212281),console['log'](_0x580863(0x1d7)+_0x212281);const _0xcbac2b=_0x592625?_0x580863(0x1cd)+_0x592625:'';return console['log'](),console[_0x580863(0x20f)](_0x580863(0x213)),console[_0x580863(0x20f)](_0x580863(0x211)+_0xcbac2b+_0x580863(0x1e3)),console[_0x580863(0x20f)](_0x580863(0x211)+_0xcbac2b+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x43d618){if(_0x43d618 instanceof HTTPClientError&&_0x43d618[_0x580863(0x1ee)]===0x191)return printAuthError(_0x43d618),0x1;return console[_0x580863(0x1cc)](a7_0x1bf0b[_0x580863(0x20c)](_0x580863(0x204)+(_0x43d618 instanceof Error?_0x43d618[_0x580863(0x1d2)]:String(_0x43d618)))),console['error'](_0x580863(0x218)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x14d0db(0x1fb)]='auth';[a7_0x14d0db(0x1dd)]=a7_0x14d0db(0x1f6);async[a7_0x14d0db(0x1d6)](_0x35db32){const _0x1dad62=a7_0x14d0db,{options:_0x194e2e,tdx:_0x5efadd}=_0x35db32,_0x4d1ef8=_0x194e2e['site'],_0x34f009=_0x194e2e['profile'],_0x2ee092=_0x34f009?_0x34f009:_0x1dad62(0x1ca);console[_0x1dad62(0x20f)](_0x1dad62(0x1f8)+_0x2ee092+_0x1dad62(0x1fa)+_0x4d1ef8+')');const _0x41a687=await resolveAPIKeyAsync(_0x4d1ef8,_0x34f009);if(_0x41a687){const {source:_0x115f1f,isDeprecated:_0x1166a5}=_0x41a687,_0x3abbba=_0x1dad62(0x203)+_0x115f1f;console['log'](_0x1166a5?a7_0x1bf0b[_0x1dad62(0x1ed)](_0x3abbba):_0x3abbba);}else console[_0x1dad62(0x20f)](a7_0x1bf0b['yellow'](_0x1dad62(0x1da)));try{const _0x260d76=await _0x5efadd[_0x1dad62(0x207)][_0x1dad62(0x216)]();return console['log'](a7_0x1bf0b['green'](_0x1dad62(0x202))),console[_0x1dad62(0x20f)](_0x1dad62(0x1d1)+_0x260d76[_0x1dad62(0x1e2)]),(_0x260d76['first_name']||_0x260d76[_0x1dad62(0x1f4)])&&console['log'](_0x1dad62(0x1f5)+[_0x260d76[_0x1dad62(0x1de)],_0x260d76[_0x1dad62(0x1f4)]][_0x1dad62(0x200)](Boolean)[_0x1dad62(0x20a)]('\x20')),0x0;}catch(_0x53541f){return _0x53541f instanceof HTTPClientError&&_0x53541f[_0x1dad62(0x1ee)]===0x191?printAuthError(_0x53541f,!![],_0x34f009):console[_0x1dad62(0x1cc)](a7_0x1bf0b[_0x1dad62(0x20c)]('✗\x20Validation\x20failed:\x20'+(_0x53541f instanceof Error?_0x53541f['message']:String(_0x53541f)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x14d0db(0x1fb)]=a7_0x14d0db(0x1e4);[a7_0x14d0db(0x1dd)]=a7_0x14d0db(0x20b);async[a7_0x14d0db(0x1d6)](_0x125669){const _0x290340=a7_0x14d0db,{options:_0x4bdf98}=_0x125669,_0x8b7bea=_0x4bdf98['profile'];console['log'](a7_0x1bf0b[_0x290340(0x1fe)](_0x290340(0x1e9)));const _0x4ce88f=await isKeychainAvailable();if(!_0x4ce88f)return console[_0x290340(0x1cc)](a7_0x1bf0b[_0x290340(0x20c)](_0x290340(0x1e1))),0x1;const _0x17cd01=await deleteKeychainAPIKey(_0x8b7bea);return _0x17cd01?(clearCredentialCache(),console[_0x290340(0x20f)](_0x290340(0x1fd)+(_0x8b7bea?_0x290340(0x1eb)+_0x8b7bea+')':'')),0x0):(console['log'](_0x290340(0x1ea)+(_0x8b7bea?_0x290340(0x1db)+_0x8b7bea:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x1bbb32=a8_0x30ac;(function(_0x451960,_0x2d9efe){const _0xf1d81=a8_0x30ac,_0x596a3b=_0x451960();while(!![]){try{const _0x41b89e=parseInt(_0xf1d81(0xd3))/0x1+-parseInt(_0xf1d81(0xda))/0x2*(parseInt(_0xf1d81(0xc2))/0x3)+-parseInt(_0xf1d81(0xca))/0x4+parseInt(_0xf1d81(0xcf))/0x5*(parseInt(_0xf1d81(0xe7))/0x6)+-parseInt(_0xf1d81(0xdf))/0x7+-parseInt(_0xf1d81(0xd4))/0x8+parseInt(_0xf1d81(0xcb))/0x9;if(_0x41b89e===_0x2d9efe)break;else _0x596a3b['push'](_0x596a3b['shift']());}catch(_0x27ff60){_0x596a3b['push'](_0x596a3b['shift']());}}}(a8_0x133e,0x36e2f));function a8_0x133e(){const _0x2d4a9e=['getDefaultAgent','getOrCreateDefaultAgent','432246tKMrOc','stack','--agent\x20flag','resolveAgentId','includes','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Resolving\x20project\x20\x27','Resolving\x20agent\x20\x27','200608wraCUr','4521492wnesbQ','Getting\x20default\x20agent...','args','resolveProjectId','5UodWHy','Using\x20agent\x20from\x20','getAgentId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','377082zexNRc','1552688jSGrZI','Continuing\x20chat:\x20','claude-4.5-haiku','llm','content','handleChatEvent','4qBcszl','data','message','llmAgent','Using\x20cached\x20default\x20agent:\x20','2409134DzBuXe','verbose','Error:\x20','code','chatId','streamChat','agent','\x27...','1331454WCIMVK','execute','join','\x20\x20Cause:\x20','CHAT_NOT_FOUND','chat','validate','404','error','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','cause','description','type'];a8_0x133e=function(){return _0x2d4a9e;};return a8_0x133e();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x30ac(_0x16a0fd,_0x5cb761){_0x16a0fd=_0x16a0fd-0xbe;const _0x133e73=a8_0x133e();let _0x30ac85=_0x133e73[_0x16a0fd];return _0x30ac85;}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x3347f2,_0x38028f){const _0x14199e=a8_0x30ac;if(_0x3347f2 instanceof SDKError)console[_0x14199e(0xef)](_0x14199e(0xe1)+_0x3347f2[_0x14199e(0xdc)]),_0x38028f[_0x14199e(0xe0)]&&(_0x3347f2[_0x14199e(0xf1)]&&console['error'](_0x14199e(0xea)+_0x3347f2['cause']),_0x3347f2[_0x14199e(0xc3)]&&(console[_0x14199e(0xef)]('\x0aStack\x20trace:'),console[_0x14199e(0xef)](_0x3347f2[_0x14199e(0xc3)])));else throw _0x3347f2;}export class ChatCommand extends BaseCommand{['name']='chat';[a8_0x1bbb32(0xbe)]=a8_0x1bbb32(0xd2);[a8_0x1bbb32(0xed)](_0x38176e){const _0x35e66e=a8_0x1bbb32,_0xec61ff=_0x38176e[_0x35e66e(0xcd)][_0x35e66e(0xe9)]('\x20');if(!_0xec61ff)return _0x35e66e(0xc7);return undefined;}async['streamChat'](_0x3151b6,_0x5a7726,_0x27e23d,_0x3b4b6b,_0x3580b4){const _0x59966d=a8_0x1bbb32;for await(const _0x3bda09 of _0x3151b6[_0x59966d(0xd7)][_0x59966d(0xec)](_0x5a7726,{'agentId':_0x27e23d,'chatId':_0x3b4b6b})){if(_0x3bda09[_0x59966d(0xbf)]==='metadata'){const _0x59de40=_0x3bda09[_0x59966d(0xdb)][_0x59966d(0xe3)];saveLastChatId(_0x59de40),_0x3580b4&&console['error']('Chat\x20session:\x20'+_0x59de40);}else _0x3bda09[_0x59966d(0xbf)]==='event'&&this[_0x59966d(0xd9)](_0x3bda09[_0x59966d(0xdb)]);}}async[a8_0x1bbb32(0xd1)](_0x3c007c,_0x290e74,_0xf71a02,_0x42306c,_0x37430b){const _0x108023=a8_0x1bbb32,_0x59c5d3=_0x290e74||_0xf71a02;if(_0x59c5d3){const {projectName:_0x58aefe,agentName:_0x439eda}=parseAgentRef(_0x59c5d3),_0x4e3f00=_0x439eda||_0x59c5d3,_0xfd4fd8=_0x439eda?_0x58aefe:_0x42306c;if(!_0xfd4fd8)throw new Error(_0x108023(0xf0));if(_0x37430b){const _0x48b87c=_0x290e74?_0x108023(0xc4):'session\x20context';console[_0x108023(0xef)](_0x108023(0xd0)+_0x48b87c+':\x20'+_0xfd4fd8+'/'+_0x4e3f00);}const _0x11d6a9=await withSpinner(_0x108023(0xc8)+_0xfd4fd8+'\x27...',()=>_0x3c007c[_0x108023(0xd7)][_0x108023(0xce)](_0xfd4fd8),{'verbose':_0x37430b}),_0x19a56b=await withSpinner(_0x108023(0xc9)+_0x4e3f00+_0x108023(0xe6),()=>_0x3c007c[_0x108023(0xd7)][_0x108023(0xc5)](_0x4e3f00,_0x11d6a9[_0x108023(0xdb)]),{'verbose':_0x37430b});return _0x19a56b['data'];}else{const _0xa6ca9f=_0x3c007c['llm'][_0x108023(0xc0)]();if(_0xa6ca9f)return _0x37430b&&console[_0x108023(0xef)](_0x108023(0xde)+_0xa6ca9f['name']),_0xa6ca9f['id'];const _0x8d2dcd=await withSpinner(_0x108023(0xcc),()=>_0x3c007c['llm'][_0x108023(0xc1)](_0x108023(0xd6),0x0),{'verbose':_0x37430b});return _0x8d2dcd[_0x108023(0xdb)]['id'];}}async[a8_0x1bbb32(0xe8)](_0x53ae59){const _0x26776c=a8_0x1bbb32,{options:_0x2661d1,args:_0x525811,tdx:_0x3954ad}=_0x53ae59,_0x2e2326=_0x525811[_0x26776c(0xe9)]('\x20'),_0x2dcab6=_0x2661d1,_0x44e609=_0x2dcab6[_0x26776c(0xe5)],_0x2c92d6=_0x2dcab6[_0x26776c(0xdd)],_0x4e1bf7=_0x2dcab6['llmProject'],_0x2feed5=_0x2dcab6['new'];try{let _0x2504cb,_0x23d886;!_0x2feed5&&(_0x23d886=loadLastChatId(),_0x23d886&&_0x2661d1[_0x26776c(0xe0)]&&console[_0x26776c(0xef)](_0x26776c(0xd5)+_0x23d886));(_0x2feed5||!_0x23d886)&&(_0x2504cb=await this[_0x26776c(0xd1)](_0x3954ad,_0x44e609,_0x2c92d6,_0x4e1bf7,_0x2661d1[_0x26776c(0xe0)]));try{await this[_0x26776c(0xe4)](_0x3954ad,_0x2e2326,_0x2504cb,_0x23d886,_0x2661d1[_0x26776c(0xe0)]);}catch(_0x400cbb){const _0x3ceb16=_0x400cbb instanceof SDKError&&_0x400cbb[_0x26776c(0xe2)]===ErrorCode[_0x26776c(0xeb)]||_0x400cbb instanceof Error&&_0x400cbb[_0x26776c(0xdc)][_0x26776c(0xc6)](_0x26776c(0xee));if(_0x3ceb16)_0x2661d1[_0x26776c(0xe0)]&&console[_0x26776c(0xef)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x2504cb&&(_0x2504cb=await this[_0x26776c(0xd1)](_0x3954ad,_0x44e609,_0x2c92d6,_0x4e1bf7,_0x2661d1['verbose'])),await this['streamChat'](_0x3954ad,_0x2e2326,_0x2504cb,undefined,_0x2661d1[_0x26776c(0xe0)]);else throw _0x400cbb;}return console['log'](),0x0;}catch(_0x2849d7){return console['error'](),handleSDKError(_0x2849d7,_0x2661d1),0x1;}}[a8_0x1bbb32(0xd9)](_0x544fdc){const _0x34a775=a8_0x1bbb32;if(_0x34a775(0xd8)in _0x544fdc)process['stdout']['write'](_0x544fdc[_0x34a775(0xd8)]);else'error'in _0x544fdc&&console['error']('\x0aError:\x20'+_0x544fdc[_0x34a775(0xef)]);}}
|
|
@@ -22,6 +22,15 @@ export declare function compareVersions(v1: {
|
|
|
22
22
|
minor: number;
|
|
23
23
|
patch: number;
|
|
24
24
|
}): number;
|
|
25
|
+
/**
|
|
26
|
+
* Default td-skills repository URL
|
|
27
|
+
*/
|
|
28
|
+
export declare const DEFAULT_TD_SKILLS_URL = "https://github.com/treasure-data/td-skills";
|
|
29
|
+
/**
|
|
30
|
+
* Get td-skills repository URL based on environment variables
|
|
31
|
+
* Returns custom repository URL if TDX_TD_SKILLS_REPO is set, otherwise default
|
|
32
|
+
*/
|
|
33
|
+
export declare function getTdSkillsRepoUrl(): string;
|
|
25
34
|
/**
|
|
26
35
|
* Claude Command
|
|
27
36
|
* Launches Claude Code with integrated TD LLM proxy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-command.d.ts","sourceRoot":"","sources":["../../src/commands/claude-command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAoDhE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQpG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACnD,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD,MAAM,CAIR;
|
|
1
|
+
{"version":3,"file":"claude-command.d.ts","sourceRoot":"","sources":["../../src/commands/claude-command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAoDhE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQpG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACnD,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD,MAAM,CAIR;AAgJD;;GAEG;AACH,eAAO,MAAM,qBAAqB,+CAA+C,CAAC;AAElF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AA+QD;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,kDAAkD;IAEtE,OAAO,CAAC,MAAM,CAAC,CAAc;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAyB;IACnD,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,MAAM,CAAC,CAAY;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAS;IAEhB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAsQxD"}
|