@treasuredata/tdx 0.26.7 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/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.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts +4 -2
- package/dist/commands/claude-statusline-command.d.ts.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-statusline-command.js.map +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.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/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.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/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.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +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.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/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/claude-usage-tracker.d.ts +2 -2
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/passthrough-server.d.ts +18 -3
- 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/sse-usage-parser.d.ts +20 -2
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/proxy/sse-usage-parser.js.map +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/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +9 -0
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +0 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +2 -2
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-validator.d.ts +3 -0
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/pull-workflow.js.map +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts +8 -0
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +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/types/segment-def.d.ts +10 -1
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +23 -15
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/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/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +3 -3
- package/dist/utils/port.d.ts +0 -18
- package/dist/utils/port.d.ts.map +0 -1
- package/dist/utils/port.js +0 -1
- package/dist/utils/port.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x59ba5d=a4_0x28cf;(function(_0x14898a,_0x335a60){const _0x4c2752=a4_0x28cf,_0x36e8d8=_0x14898a();while(!![]){try{const _0x3d66f5=parseInt(_0x4c2752(0x1ba))/0x1+parseInt(_0x4c2752(0x175))/0x2+-parseInt(_0x4c2752(0x14b))/0x3*(parseInt(_0x4c2752(0x124))/0x4)+-parseInt(_0x4c2752(0x172))/0x5+-parseInt(_0x4c2752(0x1bc))/0x6*(parseInt(_0x4c2752(0x1b6))/0x7)+-parseInt(_0x4c2752(0x137))/0x8*(parseInt(_0x4c2752(0x118))/0x9)+parseInt(_0x4c2752(0x161))/0xa;if(_0x3d66f5===_0x335a60)break;else _0x36e8d8['push'](_0x36e8d8['shift']());}catch(_0x522199){_0x36e8d8['push'](_0x36e8d8['shift']());}}}(a4_0x4789,0x352c8));import a4_0x2b36da from'chalk';import a4_0x4a5513 from'path';function a4_0x4789(){const _0x3d8367=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','8koPfPH','updated','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','errors','\x20resources\x20to\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','outputPath','\x20total','session','dim','\x20--profile\x20','pullProject','repeat','New\x20project\x20name\x20is\x20required','no_local_folder','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Output\x20path:\x20','newProjectName','projectName','action','30UFCyJX','\x20\x20Agents:\x20','\x20\x20Knowledge\x20Bases:\x20','Analyzing\x20project\x20\x22','cwd','red','execute','<new-name>','total','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','gray','MISSING_ARGUMENT','Using\x20project\x20from\x20','prompts','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22:\x20','Agent\x20pulled\x20successfully','\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','name','No\x20tdx.json\x20found\x20in\x20','parse','\x20\x20Source:\x20','3873130tCOHqT','llm','\x20\x20Experimental\x20Artifacts:\x20','New\x20project:\x20','\x20files?','\x20\x20Text\x20Knowledge\x20Base\x20\x22','green','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Integration\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0aChanges:','Project\x20cloned\x20with\x20errors','site','textKnowledgeBases','Analyzing\x20changes\x20to\x20push...','\x22...','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','1274480pRIsUL','\x20\x20Agent\x20\x22','\x20changed','610698JsRyAw','dirname','agent:pull','\x20created','\x0aWrite\x20','experimentalArtifacts','Would\x20pull\x20agent:\x20','Pushing\x20to\x20project...','dryRun','Errors:','\x20\x20tdx\x20agent\x20clone\x20agents/','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','New\x20project\x20ID:\x20','pushProject','diff','\x20new','new','Cancelled','\x20|\x20','sourceProjectName','\x20resources?','\x20unchanged','Would\x20push\x20agent:\x20','pullAgent','Writing\x20files...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20tdx\x20agent\x20pull\x20','log','projectDir','no_context','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aChanges\x20to\x20agent\x20\x27','Failed\x20to\x20push\x20agent:\x20','Using\x20local\x20project:\x20','projectId','\x0aPush\x20summary\x20for\x20\x27','profile','Would\x20clone:','INVALID_ARGUMENT','experimentalKnowledgeBases','Source:\x20','tdx.json','cyan','hasChanges','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20updated','\x20files\x20to\x20','llmProject','Using\x20context\x20project:\x20','push','unchanged','context','agents','pushAgent','agentId','knowledgeBases','join','\x0aErrors\x20found:','yes','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Knowledge\x20Base\x20\x22','agent:push','found','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','yellow','28OMRLUw','Cannot\x20clone\x20from\x20context\x20project\x20\x22','message','counts','294842Fuegrh','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','295170eAyEiH','\x0aPull\x20summary\x20for\x20\x27','newProjectId','✔\x20Context\x20set:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','isNew','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agentName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Status:\x20','Using\x20project:\x20','error','\x20\x20Integrations:\x20','integrations','\x20\x20Prompt\x20\x22','Pushing\x20agent\x20from\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Pulling\x20agent\x20\x22','2441682opKyWo','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x20=\x20','Clone\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aPush\x20','description','\x20\x20Prompts:\x20','created','force','llm_project','source','18692zYAbHU','outputDir','\x20successfully','\x20--name\x20','\x0aError:','\x0aProject\x20pushed\x20with\x20errors','output','\x22\x20from\x20project\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Text\x20Knowledge\x20Bases:\x20','Project:\x20','Summary:','reason','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','utf-8','cloneProject','Agent:\x20','\x20\x20Target:\x20'];a4_0x4789=function(){return _0x3d8367;};return a4_0x4789();}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';function a4_0x28cf(_0x2d75f2,_0x4ca05a){_0x2d75f2=_0x2d75f2-0x116;const _0x4789d3=a4_0x4789();let _0x28cf59=_0x4789d3[_0x2d75f2];return _0x28cf59;}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(_0x52eb4f){const _0x5b645d=a4_0x28cf,_0x18453b=[];if(_0x52eb4f['total']!==undefined)_0x18453b['push'](_0x52eb4f[_0x5b645d(0x153)]+_0x5b645d(0x13e));if(_0x52eb4f[_0x5b645d(0x185)]!==undefined&&_0x52eb4f[_0x5b645d(0x185)]>0x0)_0x18453b['push'](a4_0x2b36da['green'](_0x52eb4f['new']+_0x5b645d(0x184)));if(_0x52eb4f[_0x5b645d(0x120)]!==undefined&&_0x52eb4f[_0x5b645d(0x120)]>0x0)_0x18453b[_0x5b645d(0x1a6)](a4_0x2b36da[_0x5b645d(0x167)](_0x52eb4f[_0x5b645d(0x120)]+_0x5b645d(0x178)));if(_0x52eb4f[_0x5b645d(0x138)]!==undefined&&_0x52eb4f['updated']>0x0)_0x18453b[_0x5b645d(0x1a6)](a4_0x2b36da[_0x5b645d(0x1b5)](_0x52eb4f['updated']+_0x5b645d(0x1a2)));if(_0x52eb4f[_0x5b645d(0x1a7)]!==undefined&&_0x52eb4f['unchanged']>0x0)_0x18453b['push'](a4_0x2b36da[_0x5b645d(0x155)](_0x52eb4f[_0x5b645d(0x1a7)]+_0x5b645d(0x18a)));if(_0x52eb4f['errors']!==undefined&&_0x52eb4f[_0x5b645d(0x13a)]>0x0)_0x18453b[_0x5b645d(0x1a6)](a4_0x2b36da[_0x5b645d(0x150)](_0x52eb4f['errors']+'\x20errors'));return _0x18453b[_0x5b645d(0x1ad)](',\x20');}function displayDiffs(_0x2fb322,_0x856b2c,_0x357617,_0x371e0b,_0x541c5a,_0x5c86e8,_0x46b4a7){const _0x7d894e=a4_0x28cf;for(const _0xced9c4 of _0x2fb322){if(_0xced9c4[_0x7d894e(0x183)]){const _0x1a6cf0=_0xced9c4[_0x7d894e(0x1c3)]||_0xced9c4[_0x7d894e(0x15d)];console['log'](_0x7d894e(0x194)+_0x1a6cf0+'\x27:'),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)),console['log'](_0xced9c4['diff']),console[_0x7d894e(0x190)]('─'['repeat'](0x3c));}}for(const _0x576861 of _0x856b2c){_0x576861[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x576861[_0x7d894e(0x15d)]+'\x27:'),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)),console[_0x7d894e(0x190)](_0x576861[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'['repeat'](0x3c)));}for(const _0x5dc2a4 of _0x357617){_0x5dc2a4[_0x7d894e(0x183)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x5dc2a4[_0x7d894e(0x15d)]+'\x27:'),console['log']('─'[_0x7d894e(0x143)](0x3c)),console[_0x7d894e(0x190)](_0x5dc2a4['diff']),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x9bff11 of _0x371e0b){_0x9bff11[_0x7d894e(0x183)]&&(console['log'](_0x7d894e(0x1b0)+_0x9bff11[_0x7d894e(0x15d)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x9bff11[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x41efcf of _0x541c5a){_0x41efcf[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x41efcf[_0x7d894e(0x15d)]+'\x27:'),console[_0x7d894e(0x190)]('─'['repeat'](0x3c)),console[_0x7d894e(0x190)](_0x41efcf[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x4b5d81 of _0x5c86e8){_0x4b5d81[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4b5d81[_0x7d894e(0x15d)]+'\x27:'),console[_0x7d894e(0x190)]('─'['repeat'](0x3c)),console[_0x7d894e(0x190)](_0x4b5d81['diff']),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x2e53cb of _0x46b4a7){_0x2e53cb[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)](_0x7d894e(0x116)+_0x2e53cb[_0x7d894e(0x15d)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x7d894e(0x190)](_0x2e53cb[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x59ba5d(0x15d)]=a4_0x59ba5d(0x177);[a4_0x59ba5d(0x11e)]=a4_0x59ba5d(0x171);async[a4_0x59ba5d(0x151)](_0x12e34f){const _0x1f2f4a=a4_0x59ba5d,{options:_0x2e7742,args:_0x762432,tdx:_0x4efd75}=_0x12e34f,_0x3cd8c8=_0x762432[0x0],_0x3e742b=_0x762432[0x1],_0x39d077=_0x2e7742[_0x1f2f4a(0x12a)],_0x2138c5=_0x2e7742[_0x1f2f4a(0x17d)],_0x59f95e=_0x2e7742[_0x1f2f4a(0x121)],_0x51afab=_0x2e7742[_0x1f2f4a(0x1af)],_0x3bdfe5=_0x2e7742[_0x1f2f4a(0x1a4)];let _0x338627,_0x327398;const _0x1e3601=findAgentConfigPath(process[_0x1f2f4a(0x14f)]());if(_0x3cd8c8){const _0x2ef564=a4_0x4a5513['join'](_0x3cd8c8,_0x1f2f4a(0x19e));if(existsSync(_0x2ef564))try{const _0x142ad4=JSON[_0x1f2f4a(0x15f)](readFileSync(_0x2ef564,_0x1f2f4a(0x132)));_0x338627=_0x142ad4[_0x1f2f4a(0x122)],_0x327398=_0x3cd8c8,console['log'](a4_0x2b36da[_0x1f2f4a(0x140)](_0x1f2f4a(0x157)+_0x2ef564+':\x20'+_0x338627));}catch{_0x338627=_0x3cd8c8;}else _0x338627=_0x3cd8c8;}else{if(_0x1e3601)try{const _0x10e392=JSON[_0x1f2f4a(0x15f)](readFileSync(_0x1e3601,_0x1f2f4a(0x132)));_0x338627=_0x10e392[_0x1f2f4a(0x122)],_0x327398=a4_0x4a5513['dirname'](_0x1e3601),console['log'](a4_0x2b36da[_0x1f2f4a(0x140)](_0x1f2f4a(0x1c6)+_0x338627));}catch{_0x338627=_0x3bdfe5;}else _0x338627=_0x3bdfe5;}if(!_0x338627)return console['log'](a4_0x2b36da['yellow'](_0x1f2f4a(0x180))),console[_0x1f2f4a(0x190)]('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['log'](_0x1f2f4a(0x15c)),console[_0x1f2f4a(0x190)]('\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'),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x119)),0x1;if(_0x3e742b){const {data:_0x20330f}=await withSpinner(_0x1f2f4a(0x117)+_0x3e742b+_0x1f2f4a(0x12b)+_0x338627+_0x1f2f4a(0x170),()=>_0x4efd75[_0x1f2f4a(0x162)][_0x1f2f4a(0x18c)](_0x338627,_0x3e742b,_0x39d077,{'dryRun':_0x2138c5,'force':_0x59f95e}));if(_0x2138c5)return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x1b5)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0x1f2f4a(0x17b)+_0x20330f['agentName']),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x147)+_0x20330f[_0x1f2f4a(0x13d)]),_0x20330f['diff']&&(console['log'](_0x1f2f4a(0x16b)),console[_0x1f2f4a(0x190)]('─'[_0x1f2f4a(0x143)](0x3c)),console[_0x1f2f4a(0x190)](_0x20330f[_0x1f2f4a(0x183)]),console[_0x1f2f4a(0x190)]('─'[_0x1f2f4a(0x143)](0x3c))),0x0;return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x167)](_0x1f2f4a(0x15b))),console['log']('Agent:\x20'+_0x20330f[_0x1f2f4a(0x1c3)]),console[_0x1f2f4a(0x190)]('Output:\x20'+_0x20330f[_0x1f2f4a(0x13d)]),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1c5)+(_0x20330f[_0x1f2f4a(0x1c1)]?a4_0x2b36da[_0x1f2f4a(0x167)](_0x1f2f4a(0x185)):_0x20330f[_0x1f2f4a(0x1a0)]?a4_0x2b36da['yellow']('updated'):a4_0x2b36da[_0x1f2f4a(0x155)](_0x1f2f4a(0x1a7)))),0x0;}const _0x474eb9=_0x327398||_0x39d077,{data:_0x457526}=await withSpinner(_0x1f2f4a(0x14e)+_0x338627+_0x1f2f4a(0x170),()=>_0x4efd75['llm'][_0x1f2f4a(0x142)](_0x338627,_0x474eb9,{'dryRun':!![]})),_0x43f6ae=_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1a9)]['new']+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1ac)][_0x1f2f4a(0x185)]+_0x457526['counts'][_0x1f2f4a(0x16e)][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)]['prompts'][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1c9)][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x19c)][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)][_0x1f2f4a(0x185)],_0x2b2f00=_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1a9)][_0x1f2f4a(0x138)]+_0x457526['counts'][_0x1f2f4a(0x1ac)][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x16e)][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)]['prompts'][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)]['integrations'][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x19c)][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)]['updated'],_0x15d14e=_0x457526[_0x1f2f4a(0x1b9)]['agents'][_0x1f2f4a(0x1a7)]+_0x457526['counts'][_0x1f2f4a(0x1ac)][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)]['textKnowledgeBases'][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x158)][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1c9)]['unchanged']+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x19c)][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)]['experimentalArtifacts'][_0x1f2f4a(0x1a7)];console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1bd)+_0x457526[_0x1f2f4a(0x149)]+'\x27:'),console['log']('\x20\x20'+a4_0x2b36da['green']('+\x20'+_0x43f6ae+_0x1f2f4a(0x184))+'\x20|\x20'+a4_0x2b36da[_0x1f2f4a(0x1b5)]('~\x20'+_0x2b2f00+_0x1f2f4a(0x174))+_0x1f2f4a(0x187)+a4_0x2b36da[_0x1f2f4a(0x140)]('=\x20'+_0x15d14e+_0x1f2f4a(0x18a))),console[_0x1f2f4a(0x190)]('\x20\x20Agents:\x20'+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)]['agents'])),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x14d)+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1ac)])),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x12d)+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x16e)])),console[_0x1f2f4a(0x190)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x158)])),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1c8)+formatCountSummary(_0x457526['counts']['integrations']));const _0x263549=_0x457526['counts'][_0x1f2f4a(0x19c)][_0x1f2f4a(0x153)]>0x0||_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)][_0x1f2f4a(0x153)]>0x0;_0x263549&&(console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1a1)+formatCountSummary(_0x457526['counts'][_0x1f2f4a(0x19c)])),console[_0x1f2f4a(0x190)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)])));console[_0x1f2f4a(0x190)](_0x1f2f4a(0x135)+a4_0x2b36da[_0x1f2f4a(0x19f)](_0x457526[_0x1f2f4a(0x125)])),displayDiffs(_0x457526['agents'],_0x457526[_0x1f2f4a(0x1ac)],_0x457526[_0x1f2f4a(0x16e)],_0x457526['prompts'],_0x457526[_0x1f2f4a(0x1c9)],_0x457526[_0x1f2f4a(0x19c)],_0x457526[_0x1f2f4a(0x17a)]);if(_0x2138c5)return console[_0x1f2f4a(0x190)](a4_0x2b36da['yellow'](_0x1f2f4a(0x11c))),0x0;if(_0x43f6ae===0x0&&_0x2b2f00===0x0)return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x167)](_0x1f2f4a(0x139))),saveSessionContext({'llm_project':_0x457526[_0x1f2f4a(0x149)]},_0x2e7742[_0x1f2f4a(0x13f)]),console[_0x1f2f4a(0x190)](a4_0x2b36da['green'](_0x1f2f4a(0x1bf)+a4_0x2b36da['dim'](_0x1f2f4a(0x122))+_0x1f2f4a(0x11a)+a4_0x2b36da[_0x1f2f4a(0x19f)](_0x457526[_0x1f2f4a(0x149)]))),0x0;if(!_0x51afab&&!_0x59f95e){if(!isInteractive())return console['error'](a4_0x2b36da[_0x1f2f4a(0x150)](_0x1f2f4a(0x128)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1f2f4a(0x1c7)](a4_0x2b36da[_0x1f2f4a(0x140)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1c8fcb=await confirmKey(_0x1f2f4a(0x179)+(_0x43f6ae+_0x2b2f00)+_0x1f2f4a(0x165));if(!_0x1c8fcb)return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x1b5)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}const {data:_0x446025}=await withSpinner(_0x1f2f4a(0x18d),()=>_0x4efd75[_0x1f2f4a(0x162)][_0x1f2f4a(0x142)](_0x338627,_0x474eb9,{'force':_0x59f95e}));return console['log'](a4_0x2b36da[_0x1f2f4a(0x167)]('\x0a✔\x20Pulled\x20'+(_0x43f6ae+_0x2b2f00)+_0x1f2f4a(0x1a3)+_0x446025[_0x1f2f4a(0x125)])),saveSessionContext({'llm_project':_0x446025[_0x1f2f4a(0x149)]},_0x2e7742[_0x1f2f4a(0x13f)]),console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x167)]('✔\x20Context\x20set:\x20'+a4_0x2b36da[_0x1f2f4a(0x140)](_0x1f2f4a(0x122))+'\x20=\x20'+a4_0x2b36da[_0x1f2f4a(0x19f)](_0x446025[_0x1f2f4a(0x149)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x59ba5d(0x15d)]='agent:clone';[a4_0x59ba5d(0x11e)]=a4_0x59ba5d(0x193);async[a4_0x59ba5d(0x151)](_0x462acf){const _0x499706=a4_0x59ba5d,{options:_0x4fd79d,args:_0xe2e9d4,tdx:_0x490a86}=_0x462acf,_0x3f5190=_0xe2e9d4[0x0],_0x2e3d49=_0x4fd79d[_0x499706(0x15d)],_0x1acac2=_0x4fd79d[_0x499706(0x17d)],_0x461eb3=_0x4fd79d[_0x499706(0x1af)],_0x1a92d5=_0x4fd79d[_0x499706(0x16d)],_0x368966=_0x4fd79d[_0x499706(0x1a4)];let _0x1776f8;const _0x84a26a=findAgentConfigPath(process[_0x499706(0x14f)]());if(_0x3f5190){const _0x1aedab=a4_0x4a5513['join'](_0x3f5190,_0x499706(0x19e));existsSync(_0x1aedab)?(_0x1776f8=_0x3f5190,console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x140)]('Using\x20local\x20project:\x20'+_0x3f5190))):_0x1776f8=_0x3f5190;}else{if(_0x84a26a)_0x1776f8=a4_0x4a5513['dirname'](_0x84a26a),console[_0x499706(0x190)](a4_0x2b36da['dim']('Using\x20current\x20project:\x20'+_0x1776f8));else{if(_0x368966){const _0x6cb08b=sanitizeForFilesystem(_0x368966);let _0x1a6958=_0x6cb08b,_0x51b3a2=a4_0x4a5513[_0x499706(0x1ad)](process[_0x499706(0x14f)](),_0x499706(0x1a9),_0x6cb08b,_0x499706(0x19e));if(!existsSync(_0x51b3a2)){const _0x14aa1c=normalizeName(_0x368966),_0x1994c0=a4_0x4a5513[_0x499706(0x1ad)](process[_0x499706(0x14f)](),_0x499706(0x1a9),_0x14aa1c,'tdx.json');existsSync(_0x1994c0)&&(_0x1a6958=_0x14aa1c,_0x51b3a2=_0x1994c0);}if(existsSync(_0x51b3a2))_0x1776f8=a4_0x4a5513[_0x499706(0x176)](_0x51b3a2),console['log'](a4_0x2b36da[_0x499706(0x140)](_0x499706(0x196)+_0x1776f8));else{const _0x5c32cc=_0x4fd79d[_0x499706(0x199)];if(_0x5c32cc)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x499706(0x1b7)+_0x368966+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x499706(0x12c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x499706(0x18f)+_0x368966+'\x0a')+(_0x499706(0x17f)+_0x1a6958+_0x499706(0x127)+(_0x2e3d49||_0x499706(0x152))+_0x499706(0x141)+_0x5c32cc)});_0x1776f8=_0x368966,console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x140)](_0x499706(0x1a5)+_0x368966));}}}}if(!_0x1776f8)return console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)](_0x499706(0x1b4))),console[_0x499706(0x190)](_0x499706(0x1c2)),console[_0x499706(0x190)](_0x499706(0x154)),console[_0x499706(0x190)]('\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)'),console['log'](_0x499706(0x16a)),0x1;if(!_0x2e3d49)throw new SDKError(ErrorCode[_0x499706(0x156)],_0x499706(0x144),undefined,{'helpText':_0x499706(0x131)});if(!_0x461eb3&&!_0x1acac2){if(!isInteractive())return console[_0x499706(0x1c7)](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x128)),_0x499706(0x18e)),console['error'](a4_0x2b36da[_0x499706(0x140)](_0x499706(0x136))),0x1;const _0x53d7c5=await confirmKey(_0x499706(0x11b)+_0x1776f8+'\x22\x20to\x20new\x20project\x20\x22'+_0x2e3d49+'\x22?');if(!_0x53d7c5)return console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)](_0x499706(0x186))),0x1;}const {data:_0x55fbdf}=await withSpinner('Cloning\x20\x22'+_0x1776f8+'\x22\x20to\x20\x22'+_0x2e3d49+'\x22...',()=>_0x490a86[_0x499706(0x162)][_0x499706(0x133)](_0x1776f8,_0x2e3d49,{'dryRun':_0x1acac2}));if(_0x1acac2){console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x499706(0x190)](_0x499706(0x19d)+_0x55fbdf['sourceProjectName']),console['log'](_0x499706(0x164)+_0x2e3d49),console[_0x499706(0x190)](_0x499706(0x19a)),console[_0x499706(0x190)](_0x499706(0x14c)+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1a9)][_0x499706(0x120)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1ac)][_0x499706(0x120)]),console[_0x499706(0x190)](_0x499706(0x11f)+_0x55fbdf['counts'][_0x499706(0x158)][_0x499706(0x120)]);const _0x2a03e6=_0x55fbdf['counts'][_0x499706(0x19c)][_0x499706(0x120)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)][_0x499706(0x120)]>0x0;return _0x2a03e6&&(console['log'](_0x499706(0x1a1)+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x19c)][_0x499706(0x120)]),console[_0x499706(0x190)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)]['created'])),0x0;}const _0x541e20=_0x55fbdf['counts'][_0x499706(0x1a9)]['errors']>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1ac)][_0x499706(0x13a)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x158)][_0x499706(0x13a)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x19c)][_0x499706(0x13a)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)][_0x499706(0x13a)]>0x0;_0x541e20?console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)](_0x499706(0x16c))):console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x167)]('Project\x20cloned\x20successfully'));console[_0x499706(0x190)](_0x499706(0x19d)+_0x55fbdf[_0x499706(0x188)]),console[_0x499706(0x190)](_0x499706(0x164)+_0x55fbdf[_0x499706(0x148)]),console['log'](_0x499706(0x181)+_0x55fbdf[_0x499706(0x1be)]),console[_0x499706(0x190)](),console[_0x499706(0x190)](_0x499706(0x12f)),console[_0x499706(0x190)]('\x20\x20Agents:\x20'+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)]['agents'])),console[_0x499706(0x190)](_0x499706(0x14d)+formatCountSummary(_0x55fbdf['counts'][_0x499706(0x1ac)])),console['log'](_0x499706(0x11f)+formatCountSummary(_0x55fbdf['counts'][_0x499706(0x158)])),console[_0x499706(0x190)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1c9)]));const _0x4080f7=_0x55fbdf[_0x499706(0x1b9)]['experimentalKnowledgeBases'][_0x499706(0x120)]>0x0||_0x55fbdf['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x55fbdf[_0x499706(0x1b9)]['experimentalKnowledgeBases'][_0x499706(0x1a7)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)][_0x499706(0x120)]>0x0||_0x55fbdf['counts']['experimentalArtifacts'][_0x499706(0x138)]>0x0||_0x55fbdf[_0x499706(0x1b9)]['experimentalArtifacts'][_0x499706(0x1a7)]>0x0;_0x4080f7&&(console['log'](_0x499706(0x1a1)+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x19c)])),console[_0x499706(0x190)](_0x499706(0x163)+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)])));if(_0x541e20){console[_0x499706(0x190)](),console['log'](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x17e)));for(const _0x2e7d05 of _0x55fbdf[_0x499706(0x1a9)]){_0x2e7d05[_0x499706(0x14a)]==='error'&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)]('\x20\x20Agent\x20\x22'+_0x2e7d05[_0x499706(0x1c3)]+'\x22:\x20'+_0x2e7d05[_0x499706(0x1c7)]));}for(const _0x42c8b0 of _0x55fbdf[_0x499706(0x1ac)]){_0x42c8b0[_0x499706(0x14a)]===_0x499706(0x1c7)&&console['log'](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x1b1)+_0x42c8b0['name']+_0x499706(0x15a)+_0x42c8b0[_0x499706(0x1c7)]));}for(const _0x4cb1c7 of _0x55fbdf[_0x499706(0x158)]){_0x4cb1c7[_0x499706(0x14a)]===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da['red']('\x20\x20Prompt\x20\x22'+_0x4cb1c7[_0x499706(0x15d)]+_0x499706(0x15a)+_0x4cb1c7[_0x499706(0x1c7)]));}for(const _0x2c926c of _0x55fbdf['integrations']){_0x2c926c[_0x499706(0x14a)]===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x169)+_0x2c926c[_0x499706(0x15d)]+_0x499706(0x15a)+_0x2c926c[_0x499706(0x1c7)]));}for(const _0x4af424 of _0x55fbdf[_0x499706(0x19c)]){_0x4af424[_0x499706(0x14a)]===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x1c4)+_0x4af424['name']+_0x499706(0x15a)+_0x4af424['error']));}for(const _0xb7e046 of _0x55fbdf[_0x499706(0x17a)]){_0xb7e046['action']===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0xb7e046[_0x499706(0x15d)]+_0x499706(0x15a)+_0xb7e046['error']));}return 0x1;}console[_0x499706(0x190)]();const _0x3cfc43=getLLMProjectUrl(_0x1a92d5,_0x55fbdf[_0x499706(0x1be)]);return console[_0x499706(0x190)](_0x499706(0x12e)+a4_0x2b36da['cyan'](_0x3cfc43)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x59ba5d(0x1b2);[a4_0x59ba5d(0x11e)]=a4_0x59ba5d(0x13c);async[a4_0x59ba5d(0x151)](_0x427586){const _0x4a1e49=a4_0x59ba5d,{options:_0x3a6882,args:_0x658145,tdx:_0x26b04e}=_0x427586;let _0x5ce224=_0x658145[0x0]||process['cwd']();const _0x2b8ee1=_0x3a6882[_0x4a1e49(0x17d)],_0x56d368=_0x3a6882[_0x4a1e49(0x121)],_0x3e5772=_0x3a6882[_0x4a1e49(0x1af)],_0x2eb975=_0x3a6882['site'],_0xfc6828=a4_0x4a5513[_0x4a1e49(0x1ad)](_0x5ce224,'agent.yml'),_0x5d3111=existsSync(_0xfc6828);if(_0x5d3111){const {data:_0x3674e6}=await withSpinner(_0x4a1e49(0x1cb)+_0x5ce224+_0x4a1e49(0x170),()=>_0x26b04e['llm'][_0x4a1e49(0x1aa)](_0x5ce224,{'dryRun':_0x2b8ee1,'force':_0x56d368}));if(_0x2b8ee1)return console['log'](a4_0x2b36da[_0x4a1e49(0x1b5)](_0x4a1e49(0x1c0))),console[_0x4a1e49(0x190)](_0x4a1e49(0x18b)+_0x3674e6[_0x4a1e49(0x1c3)]),0x0;if(_0x3674e6[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7))return console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x195)+_0x3674e6[_0x4a1e49(0x1c7)])),0x1;console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x167)]('Agent\x20'+_0x3674e6[_0x4a1e49(0x14a)]+_0x4a1e49(0x126))),console[_0x4a1e49(0x190)](_0x4a1e49(0x134)+_0x3674e6['agentName']);if(_0x3674e6[_0x4a1e49(0x1ab)]&&_0x3674e6[_0x4a1e49(0x197)]){const _0x168ad9=getLLMAgentChatUrl(_0x2eb975,_0x3674e6[_0x4a1e49(0x197)],_0x3674e6[_0x4a1e49(0x1ab)]);console[_0x4a1e49(0x190)]('Chat:\x20'+a4_0x2b36da[_0x4a1e49(0x19f)](_0x168ad9));}return 0x0;}const _0x4206f6=_0x3a6882[_0x4a1e49(0x1a4)],_0x436c02=resolveProjectFromContext(_0x5ce224,_0x4206f6);if(_0x436c02[_0x4a1e49(0x1b3)])_0x5ce224=_0x436c02[_0x4a1e49(0x191)],_0x436c02[_0x4a1e49(0x123)]===_0x4a1e49(0x1a8)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x140)](_0x4a1e49(0x1c6)+_0x5ce224));else{let _0x49cb01=_0x4a1e49(0x159);_0x436c02[_0x4a1e49(0x130)]===_0x4a1e49(0x145)&&(_0x49cb01=_0x436c02[_0x4a1e49(0x1b8)]+_0x4a1e49(0x1bb)+_0x436c02[_0x4a1e49(0x1a4)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4a1e49(0x19b)],_0x436c02['reason']===_0x4a1e49(0x192)?_0x436c02[_0x4a1e49(0x1b8)]:_0x4a1e49(0x15e)+_0x5ce224,undefined,{'helpText':_0x49cb01});}const {data:_0x1e5fe8}=await withSpinner(_0x4a1e49(0x16f),()=>_0x26b04e[_0x4a1e49(0x162)][_0x4a1e49(0x182)](_0x5ce224,{'dryRun':!![]})),_0x111062=_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1a9)][_0x4a1e49(0x13a)]>0x0;if(_0x111062){console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x1ae)));for(const _0x460bd7 of _0x1e5fe8[_0x4a1e49(0x1a9)]){_0x460bd7['action']===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da['red'](_0x4a1e49(0x173)+_0x460bd7[_0x4a1e49(0x1c3)]+_0x4a1e49(0x15a)+_0x460bd7[_0x4a1e49(0x1c7)]));}return 0x1;}const _0x1d2df0=_0x1e5fe8[_0x4a1e49(0x1b9)]['agents']['created']+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1ac)][_0x4a1e49(0x120)]+_0x1e5fe8['counts'][_0x4a1e49(0x16e)][_0x4a1e49(0x120)]+_0x1e5fe8[_0x4a1e49(0x1b9)]['prompts'][_0x4a1e49(0x120)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1c9)][_0x4a1e49(0x120)]+_0x1e5fe8['counts'][_0x4a1e49(0x19c)][_0x4a1e49(0x120)]+_0x1e5fe8['counts'][_0x4a1e49(0x17a)][_0x4a1e49(0x120)],_0x473149=_0x1e5fe8['counts']['agents'][_0x4a1e49(0x138)]+_0x1e5fe8['counts'][_0x4a1e49(0x1ac)]['updated']+_0x1e5fe8['counts'][_0x4a1e49(0x16e)][_0x4a1e49(0x138)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)][_0x4a1e49(0x138)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1c9)]['updated']+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x19c)]['updated']+_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalArtifacts'][_0x4a1e49(0x138)],_0xc60e5a=_0x1e5fe8[_0x4a1e49(0x1b9)]['agents'][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1ac)][_0x4a1e49(0x1a7)]+_0x1e5fe8['counts']['textKnowledgeBases'][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)]['integrations'][_0x4a1e49(0x1a7)]+_0x1e5fe8['counts']['experimentalKnowledgeBases'][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x17a)][_0x4a1e49(0x1a7)];console[_0x4a1e49(0x190)](_0x4a1e49(0x198)+_0x1e5fe8['projectName']+'\x27:'),console[_0x4a1e49(0x190)]('\x20\x20'+a4_0x2b36da[_0x4a1e49(0x167)]('+\x20'+_0x1d2df0+_0x4a1e49(0x184))+_0x4a1e49(0x187)+a4_0x2b36da['yellow']('~\x20'+_0x473149+_0x4a1e49(0x174))+_0x4a1e49(0x187)+a4_0x2b36da[_0x4a1e49(0x140)]('=\x20'+_0xc60e5a+'\x20unchanged')),console[_0x4a1e49(0x190)](_0x4a1e49(0x14c)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1ac)])),console['log'](_0x4a1e49(0x12d)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x16e)])),console[_0x4a1e49(0x190)](_0x4a1e49(0x11f)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)])),console[_0x4a1e49(0x190)](_0x4a1e49(0x1c8)+formatCountSummary(_0x1e5fe8['counts']['integrations']));const _0x382c39=_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalKnowledgeBases'][_0x4a1e49(0x120)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalKnowledgeBases'][_0x4a1e49(0x138)]>0x0||_0x1e5fe8['counts'][_0x4a1e49(0x19c)][_0x4a1e49(0x1a7)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x17a)][_0x4a1e49(0x120)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalArtifacts'][_0x4a1e49(0x138)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x17a)][_0x4a1e49(0x1a7)]>0x0;_0x382c39&&(console[_0x4a1e49(0x190)](_0x4a1e49(0x1a1)+formatCountSummary(_0x1e5fe8['counts'][_0x4a1e49(0x19c)])),console[_0x4a1e49(0x190)](_0x4a1e49(0x163)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalArtifacts'])));console[_0x4a1e49(0x190)](_0x4a1e49(0x160)+a4_0x2b36da['cyan'](_0x5ce224)),displayDiffs(_0x1e5fe8['agents'],_0x1e5fe8[_0x4a1e49(0x1ac)],_0x1e5fe8[_0x4a1e49(0x16e)],_0x1e5fe8[_0x4a1e49(0x158)],_0x1e5fe8[_0x4a1e49(0x1c9)],_0x1e5fe8['experimentalKnowledgeBases'],_0x1e5fe8[_0x4a1e49(0x17a)]);if(_0x2b8ee1)return console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x1b5)](_0x4a1e49(0x168))),0x0;if(_0x1d2df0===0x0&&_0x473149===0x0){console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x167)](_0x4a1e49(0x146)));const _0xb65f43=getLLMProjectUrl(_0x2eb975,_0x1e5fe8[_0x4a1e49(0x197)]);return console[_0x4a1e49(0x190)](_0x4a1e49(0x12e)+a4_0x2b36da[_0x4a1e49(0x19f)](_0xb65f43)),0x0;}if(!_0x3e5772&&!_0x56d368){if(!isInteractive())return console['error'](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x128)),_0x4a1e49(0x18e)),console[_0x4a1e49(0x1c7)](a4_0x2b36da[_0x4a1e49(0x140)](_0x4a1e49(0x136))),0x1;const _0x3ea356=await confirmKey(_0x4a1e49(0x11d)+(_0x1d2df0+_0x473149)+_0x4a1e49(0x189));if(!_0x3ea356)return console['log'](a4_0x2b36da[_0x4a1e49(0x1b5)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x3202f4}=await withSpinner(_0x4a1e49(0x17c),()=>_0x26b04e[_0x4a1e49(0x162)][_0x4a1e49(0x182)](_0x5ce224,{'force':_0x56d368})),_0x1e3826=_0x3202f4[_0x4a1e49(0x1b9)][_0x4a1e49(0x1a9)]['errors']>0x0||_0x3202f4[_0x4a1e49(0x1b9)]['knowledgeBases']['errors']>0x0||_0x3202f4[_0x4a1e49(0x1b9)][_0x4a1e49(0x16e)][_0x4a1e49(0x13a)]>0x0||_0x3202f4[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)][_0x4a1e49(0x13a)]>0x0;if(_0x1e3826){console[_0x4a1e49(0x190)](a4_0x2b36da['yellow'](_0x4a1e49(0x129))),console[_0x4a1e49(0x190)](),console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x17e)));for(const _0x33d4d3 of _0x3202f4[_0x4a1e49(0x1a9)]){_0x33d4d3[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7)&&console['log'](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x173)+_0x33d4d3[_0x4a1e49(0x1c3)]+'\x22:\x20'+_0x33d4d3['error']));}for(const _0x479424 of _0x3202f4[_0x4a1e49(0x1ac)]){_0x479424[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x1b1)+_0x479424[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x479424[_0x4a1e49(0x1c7)]));}for(const _0x33df2e of _0x3202f4[_0x4a1e49(0x16e)]){_0x33df2e['action']===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x166)+_0x33df2e[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x33df2e[_0x4a1e49(0x1c7)]));}for(const _0x43dd2f of _0x3202f4['prompts']){_0x43dd2f['action']===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x1ca)+_0x43dd2f[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x43dd2f[_0x4a1e49(0x1c7)]));}for(const _0x7c33b7 of _0x3202f4['integrations']){_0x7c33b7[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7)&&console['log'](a4_0x2b36da['red'](_0x4a1e49(0x169)+_0x7c33b7[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x7c33b7['error']));}return 0x1;}console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x167)]('\x0a✔\x20Pushed\x20'+(_0x1d2df0+_0x473149)+_0x4a1e49(0x13b)+_0x3202f4['projectName']+'\x27'));const _0x5be5c7=getLLMProjectUrl(_0x2eb975,_0x3202f4[_0x4a1e49(0x197)]);return console[_0x4a1e49(0x190)]('Project:\x20'+a4_0x2b36da[_0x4a1e49(0x19f)](_0x5be5c7)),0x0;}}
|
|
1
|
+
const a4_0x200d1=a4_0x37cb;function a4_0x37cb(_0x4b5d69,_0x5f1632){_0x4b5d69=_0x4b5d69-0x13d;const _0xeda2d1=a4_0xeda2();let _0x37cbba=_0xeda2d1[_0x4b5d69];return _0x37cbba;}(function(_0x3f1a65,_0x481de7){const _0x16026b=a4_0x37cb,_0x276bd5=_0x3f1a65();while(!![]){try{const _0x5ed53e=-parseInt(_0x16026b(0x15d))/0x1*(parseInt(_0x16026b(0x1d1))/0x2)+parseInt(_0x16026b(0x197))/0x3*(-parseInt(_0x16026b(0x1e0))/0x4)+-parseInt(_0x16026b(0x1e8))/0x5*(-parseInt(_0x16026b(0x1ee))/0x6)+parseInt(_0x16026b(0x18b))/0x7*(parseInt(_0x16026b(0x187))/0x8)+parseInt(_0x16026b(0x170))/0x9+parseInt(_0x16026b(0x1e9))/0xa*(parseInt(_0x16026b(0x1ed))/0xb)+-parseInt(_0x16026b(0x1a3))/0xc*(-parseInt(_0x16026b(0x161))/0xd);if(_0x5ed53e===_0x481de7)break;else _0x276bd5['push'](_0x276bd5['shift']());}catch(_0x239062){_0x276bd5['push'](_0x276bd5['shift']());}}}(a4_0xeda2,0xa738c));import a4_0x1b9acb from'chalk';import a4_0xfa118c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0xeda2(){const _0x46874d=['projectDir','\x20\x20Integrations:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','outputDir','source','\x20\x20Agents:\x20','New\x20project:\x20','-\x20nothing\x20pushed','3qwyFIu','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','pushAgent','green','cwd','Chat:\x20','Using\x20context\x20project:\x20','\x0aWrite\x20','integrations','\x20changed','Status:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','67068bqiOvf','\x20=\x20','llm','\x0aChanges\x20to\x20agent\x20\x27','Summary:','Clone\x20\x22','\x20\x20Source:\x20','parse','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','error','session','updated','\x20resources?','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Writing\x20files...','Using\x20local\x20project:\x20','\x20\x20Agent\x20\x22','description','\x0aProject\x20pushed\x20with\x20errors','\x20--profile\x20','projectId','Failed\x20to\x20push\x20agent:\x20','isNew','\x20\x20Knowledge\x20Base\x20\x22','Output\x20path:\x20','Cloning\x20\x22','dim','\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)','agents','site','\x20files\x20to\x20','errors','\x20\x20tdx\x20agent\x20pull\x20','Project\x20cloned\x20with\x20errors','\x20successfully','\x22\x20from\x20project\x20\x22','cloneProject','pushProject','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\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','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','textKnowledgeBases','883682tZdwJj','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Dry\x20run\x20-\x20no\x20changes\x20made','experimentalKnowledgeBases','Pulling\x20agent\x20\x22','\x20\x20Prompts:\x20','\x0aPush\x20summary\x20for\x20\x27','red','\x20total','dryRun','dirname','Agent:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','newProjectName','Using\x20project\x20from\x20','5032884iZdEEC','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)','cyan','\x20unchanged','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Pushing\x20agent\x20from\x20\x22','name','New\x20project\x20ID:\x20','5jYZKTP','3120DxjoHI','push','newProjectId','\x20resources\x20to\x20\x27','3157CmmIvA','549012dwHlvH','execute','agent:push','log','diff','sourceProjectName','force','✔\x20Context\x20set:\x20','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','gray','pullProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','Errors:','new','message','projectName','agentId','\x22\x20to\x20a\x20different\x20profile','\x20\x20Integration\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20integration\x20\x27','agent:clone','experimentalArtifacts','join','Using\x20project:\x20','Project:\x20','tdx.json','Analyzing\x20project\x20\x22','Cancelled','no_local_folder','action','\x20|\x20','2SCFJOH','llmProject','unchanged','Output:\x20','2483xVOtAB','\x22...','\x20new','\x20--name\x20','counts','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aChanges\x20to\x20prompt\x20\x27','Would\x20clone:','\x0aError:','Would\x20push\x20agent:\x20','Project\x20cloned\x20successfully','found','\x20\x20Experimental\x20Artifacts:\x20','agent:pull','Pushing\x20to\x20project...','7871328UYNVpV','Source:\x20','\x22:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','reason','repeat','MISSING_ARGUMENT','\x0a✔\x20Pulled\x20','<new-name>','\x0aChanges:','New\x20project\x20name\x20is\x20required','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','utf-8','llm_project','knowledgeBases','prompts','INVALID_ARGUMENT','\x0aPull\x20summary\x20for\x20\x27','pullAgent','no_context','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','agent.yml','yes','2648hDuujD','\x20\x20Prompt\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','created','14882LeRTvX','\x20created','\x20\x20Knowledge\x20Bases:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a'];a4_0xeda2=function(){return _0x46874d;};return a4_0xeda2();}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(_0x3f3670){const _0x19613a=a4_0x37cb,_0x17b966=[];if(_0x3f3670['total']!==undefined)_0x17b966[_0x19613a(0x1ea)](_0x3f3670['total']+_0x19613a(0x1d9));if(_0x3f3670['new']!==undefined&&_0x3f3670[_0x19613a(0x14a)]>0x0)_0x17b966[_0x19613a(0x1ea)](a4_0x1b9acb[_0x19613a(0x19a)](_0x3f3670[_0x19613a(0x14a)]+_0x19613a(0x163)));if(_0x3f3670[_0x19613a(0x18a)]!==undefined&&_0x3f3670['created']>0x0)_0x17b966[_0x19613a(0x1ea)](a4_0x1b9acb['green'](_0x3f3670[_0x19613a(0x18a)]+_0x19613a(0x18c)));if(_0x3f3670[_0x19613a(0x1ae)]!==undefined&&_0x3f3670[_0x19613a(0x1ae)]>0x0)_0x17b966[_0x19613a(0x1ea)](a4_0x1b9acb[_0x19613a(0x1b2)](_0x3f3670[_0x19613a(0x1ae)]+'\x20updated'));if(_0x3f3670[_0x19613a(0x15f)]!==undefined&&_0x3f3670['unchanged']>0x0)_0x17b966[_0x19613a(0x1ea)](a4_0x1b9acb[_0x19613a(0x145)](_0x3f3670['unchanged']+_0x19613a(0x1e3)));if(_0x3f3670[_0x19613a(0x1c5)]!==undefined&&_0x3f3670[_0x19613a(0x1c5)]>0x0)_0x17b966['push'](a4_0x1b9acb[_0x19613a(0x1d8)](_0x3f3670[_0x19613a(0x1c5)]+'\x20errors'));return _0x17b966[_0x19613a(0x154)](',\x20');}function displayDiffs(_0x22faa7,_0x529492,_0x978bb,_0x4d0c3c,_0x4d378e,_0xfcc26f,_0x4479ed){const _0x3a6859=a4_0x37cb;for(const _0x46760a of _0x22faa7){if(_0x46760a[_0x3a6859(0x1f2)]){const _0x359f01=_0x46760a[_0x3a6859(0x140)]||_0x46760a['name'];console[_0x3a6859(0x1f1)](_0x3a6859(0x1a6)+_0x359f01+'\x27:'),console['log']('─'[_0x3a6859(0x175)](0x3c)),console[_0x3a6859(0x1f1)](_0x46760a[_0x3a6859(0x1f2)]),console[_0x3a6859(0x1f1)]('─'[_0x3a6859(0x175)](0x3c));}}for(const _0x3f8083 of _0x529492){_0x3f8083['diff']&&(console[_0x3a6859(0x1f1)](_0x3a6859(0x184)+_0x3f8083[_0x3a6859(0x1e6)]+'\x27:'),console[_0x3a6859(0x1f1)]('─'[_0x3a6859(0x175)](0x3c)),console[_0x3a6859(0x1f1)](_0x3f8083['diff']),console[_0x3a6859(0x1f1)]('─'['repeat'](0x3c)));}for(const _0x2fc1c5 of _0x978bb){_0x2fc1c5['diff']&&(console[_0x3a6859(0x1f1)](_0x3a6859(0x1b1)+_0x2fc1c5['name']+'\x27:'),console[_0x3a6859(0x1f1)]('─'[_0x3a6859(0x175)](0x3c)),console[_0x3a6859(0x1f1)](_0x2fc1c5[_0x3a6859(0x1f2)]),console[_0x3a6859(0x1f1)]('─'['repeat'](0x3c)));}for(const _0x503fb4 of _0x4d0c3c){_0x503fb4['diff']&&(console[_0x3a6859(0x1f1)](_0x3a6859(0x167)+_0x503fb4[_0x3a6859(0x1e6)]+'\x27:'),console['log']('─'[_0x3a6859(0x175)](0x3c)),console[_0x3a6859(0x1f1)](_0x503fb4[_0x3a6859(0x1f2)]),console['log']('─'[_0x3a6859(0x175)](0x3c)));}for(const _0x41c2bb of _0x4d378e){_0x41c2bb[_0x3a6859(0x1f2)]&&(console['log'](_0x3a6859(0x151)+_0x41c2bb[_0x3a6859(0x1e6)]+'\x27:'),console[_0x3a6859(0x1f1)]('─'['repeat'](0x3c)),console[_0x3a6859(0x1f1)](_0x41c2bb[_0x3a6859(0x1f2)]),console[_0x3a6859(0x1f1)]('─'[_0x3a6859(0x175)](0x3c)));}for(const _0x225307 of _0xfcc26f){_0x225307[_0x3a6859(0x1f2)]&&(console[_0x3a6859(0x1f1)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x225307[_0x3a6859(0x1e6)]+'\x27:'),console[_0x3a6859(0x1f1)]('─'['repeat'](0x3c)),console[_0x3a6859(0x1f1)](_0x225307[_0x3a6859(0x1f2)]),console['log']('─'[_0x3a6859(0x175)](0x3c)));}for(const _0x2cbb61 of _0x4479ed){_0x2cbb61[_0x3a6859(0x1f2)]&&(console[_0x3a6859(0x1f1)](_0x3a6859(0x1cf)+_0x2cbb61[_0x3a6859(0x1e6)]+'\x27:'),console[_0x3a6859(0x1f1)]('─'[_0x3a6859(0x175)](0x3c)),console['log'](_0x2cbb61[_0x3a6859(0x1f2)]),console[_0x3a6859(0x1f1)]('─'[_0x3a6859(0x175)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x200d1(0x16e);['description']=a4_0x200d1(0x166);async[a4_0x200d1(0x1ef)](_0x2a1e46){const _0x3362bf=a4_0x200d1,{options:_0x5adb4a,args:_0x88a352,tdx:_0x253d80}=_0x2a1e46,_0x218bab=_0x88a352[0x0],_0x5b9357=_0x88a352[0x1],_0x357ebf=_0x5adb4a['output'],_0x21ab20=_0x5adb4a[_0x3362bf(0x1da)],_0x5b70c8=_0x5adb4a[_0x3362bf(0x13e)],_0x197279=_0x5adb4a[_0x3362bf(0x186)],_0x3a4553=_0x5adb4a[_0x3362bf(0x15e)];let _0x3ef559,_0x1cd954;const _0xd2f103=findAgentConfigPath(process[_0x3362bf(0x19b)]());if(_0x218bab){const _0x13deb0=a4_0xfa118c[_0x3362bf(0x154)](_0x218bab,'tdx.json');if(existsSync(_0x13deb0))try{const _0x5d81dd=JSON[_0x3362bf(0x1aa)](readFileSync(_0x13deb0,'utf-8'));_0x3ef559=_0x5d81dd[_0x3362bf(0x17d)],_0x1cd954=_0x218bab,console[_0x3362bf(0x1f1)](a4_0x1b9acb[_0x3362bf(0x1c0)](_0x3362bf(0x1df)+_0x13deb0+':\x20'+_0x3ef559));}catch{_0x3ef559=_0x218bab;}else _0x3ef559=_0x218bab;}else{if(_0xd2f103)try{const _0x38299a=JSON['parse'](readFileSync(_0xd2f103,_0x3362bf(0x17c)));_0x3ef559=_0x38299a[_0x3362bf(0x17d)],_0x1cd954=a4_0xfa118c['dirname'](_0xd2f103),console[_0x3362bf(0x1f1)](a4_0x1b9acb[_0x3362bf(0x1c0)](_0x3362bf(0x155)+_0x3ef559));}catch{_0x3ef559=_0x3a4553;}else _0x3ef559=_0x3a4553;}if(!_0x3ef559)return console['log'](a4_0x1b9acb['yellow'](_0x3362bf(0x18e))),console[_0x3362bf(0x1f1)](_0x3362bf(0x1e1)),console['log']('\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['log'](_0x3362bf(0x1cd)),console[_0x3362bf(0x1f1)](_0x3362bf(0x1b3)),0x1;if(_0x5b9357){const {data:_0x4149dd}=await withSpinner(_0x3362bf(0x1d5)+_0x5b9357+_0x3362bf(0x1c9)+_0x3ef559+_0x3362bf(0x162),()=>_0x253d80[_0x3362bf(0x1a5)][_0x3362bf(0x182)](_0x3ef559,_0x5b9357,_0x357ebf,{'dryRun':_0x21ab20,'force':_0x5b70c8}));if(_0x21ab20)return console[_0x3362bf(0x1f1)](a4_0x1b9acb['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0x4149dd[_0x3362bf(0x140)]),console[_0x3362bf(0x1f1)](_0x3362bf(0x1be)+_0x4149dd['outputPath']),_0x4149dd['diff']&&(console[_0x3362bf(0x1f1)](_0x3362bf(0x179)),console['log']('─'[_0x3362bf(0x175)](0x3c)),console[_0x3362bf(0x1f1)](_0x4149dd[_0x3362bf(0x1f2)]),console[_0x3362bf(0x1f1)]('─'[_0x3362bf(0x175)](0x3c))),0x0;return console['log'](a4_0x1b9acb[_0x3362bf(0x19a)]('Agent\x20pulled\x20successfully')),console[_0x3362bf(0x1f1)](_0x3362bf(0x1dc)+_0x4149dd['agentName']),console[_0x3362bf(0x1f1)](_0x3362bf(0x160)+_0x4149dd['outputPath']),console[_0x3362bf(0x1f1)](_0x3362bf(0x1a1)+(_0x4149dd[_0x3362bf(0x1bc)]?a4_0x1b9acb[_0x3362bf(0x19a)]('new'):_0x4149dd[_0x3362bf(0x143)]?a4_0x1b9acb['yellow'](_0x3362bf(0x1ae)):a4_0x1b9acb[_0x3362bf(0x145)](_0x3362bf(0x15f)))),0x0;}const _0x1c2f60=_0x1cd954||_0x357ebf,{data:_0x272678}=await withSpinner(_0x3362bf(0x158)+_0x3ef559+_0x3362bf(0x162),()=>_0x253d80[_0x3362bf(0x1a5)][_0x3362bf(0x146)](_0x3ef559,_0x1c2f60,{'dryRun':!![]})),_0x1c4749=_0x272678['counts']['agents'][_0x3362bf(0x14a)]+_0x272678['counts']['knowledgeBases'][_0x3362bf(0x14a)]+_0x272678['counts'][_0x3362bf(0x1d0)]['new']+_0x272678['counts'][_0x3362bf(0x17f)]['new']+_0x272678['counts'][_0x3362bf(0x19f)][_0x3362bf(0x14a)]+_0x272678[_0x3362bf(0x165)][_0x3362bf(0x1d4)][_0x3362bf(0x14a)]+_0x272678[_0x3362bf(0x165)]['experimentalArtifacts'][_0x3362bf(0x14a)],_0x56d2c6=_0x272678[_0x3362bf(0x165)]['agents'][_0x3362bf(0x1ae)]+_0x272678['counts'][_0x3362bf(0x17e)][_0x3362bf(0x1ae)]+_0x272678[_0x3362bf(0x165)][_0x3362bf(0x1d0)][_0x3362bf(0x1ae)]+_0x272678[_0x3362bf(0x165)][_0x3362bf(0x17f)][_0x3362bf(0x1ae)]+_0x272678[_0x3362bf(0x165)][_0x3362bf(0x19f)][_0x3362bf(0x1ae)]+_0x272678['counts']['experimentalKnowledgeBases']['updated']+_0x272678[_0x3362bf(0x165)][_0x3362bf(0x153)]['updated'],_0x2dbaba=_0x272678['counts']['agents'][_0x3362bf(0x15f)]+_0x272678['counts']['knowledgeBases'][_0x3362bf(0x15f)]+_0x272678[_0x3362bf(0x165)]['textKnowledgeBases'][_0x3362bf(0x15f)]+_0x272678['counts'][_0x3362bf(0x17f)][_0x3362bf(0x15f)]+_0x272678['counts']['integrations'][_0x3362bf(0x15f)]+_0x272678[_0x3362bf(0x165)][_0x3362bf(0x1d4)]['unchanged']+_0x272678[_0x3362bf(0x165)][_0x3362bf(0x153)]['unchanged'];console[_0x3362bf(0x1f1)](_0x3362bf(0x181)+_0x272678[_0x3362bf(0x14c)]+'\x27:'),console['log']('\x20\x20'+a4_0x1b9acb[_0x3362bf(0x19a)]('+\x20'+_0x1c4749+_0x3362bf(0x163))+_0x3362bf(0x15c)+a4_0x1b9acb['yellow']('~\x20'+_0x56d2c6+_0x3362bf(0x1a0))+_0x3362bf(0x15c)+a4_0x1b9acb[_0x3362bf(0x1c0)]('=\x20'+_0x2dbaba+_0x3362bf(0x1e3))),console[_0x3362bf(0x1f1)](_0x3362bf(0x194)+formatCountSummary(_0x272678['counts']['agents'])),console[_0x3362bf(0x1f1)](_0x3362bf(0x18d)+formatCountSummary(_0x272678['counts'][_0x3362bf(0x17e)])),console[_0x3362bf(0x1f1)](_0x3362bf(0x191)+formatCountSummary(_0x272678['counts']['textKnowledgeBases'])),console[_0x3362bf(0x1f1)](_0x3362bf(0x1d6)+formatCountSummary(_0x272678['counts'][_0x3362bf(0x17f)])),console[_0x3362bf(0x1f1)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x272678[_0x3362bf(0x165)][_0x3362bf(0x19f)]));const _0x19578f=_0x272678[_0x3362bf(0x165)][_0x3362bf(0x1d4)]['total']>0x0||_0x272678[_0x3362bf(0x165)][_0x3362bf(0x153)]['total']>0x0;_0x19578f&&(console[_0x3362bf(0x1f1)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x272678[_0x3362bf(0x165)][_0x3362bf(0x1d4)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x272678[_0x3362bf(0x165)]['experimentalArtifacts'])));console[_0x3362bf(0x1f1)]('\x20\x20Target:\x20'+a4_0x1b9acb[_0x3362bf(0x1e2)](_0x272678[_0x3362bf(0x192)])),displayDiffs(_0x272678[_0x3362bf(0x1c2)],_0x272678[_0x3362bf(0x17e)],_0x272678[_0x3362bf(0x1d0)],_0x272678[_0x3362bf(0x17f)],_0x272678[_0x3362bf(0x19f)],_0x272678[_0x3362bf(0x1d4)],_0x272678['experimentalArtifacts']);if(_0x21ab20)return console['log'](a4_0x1b9acb[_0x3362bf(0x1b2)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1c4749===0x0&&_0x56d2c6===0x0)return console[_0x3362bf(0x1f1)](a4_0x1b9acb[_0x3362bf(0x19a)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x272678[_0x3362bf(0x14c)]},_0x5adb4a['session']),console[_0x3362bf(0x1f1)](a4_0x1b9acb[_0x3362bf(0x19a)](_0x3362bf(0x13f)+a4_0x1b9acb['dim'](_0x3362bf(0x17d))+_0x3362bf(0x1a4)+a4_0x1b9acb[_0x3362bf(0x1e2)](_0x272678[_0x3362bf(0x14c)]))),0x0;if(!_0x197279&&!_0x5b70c8){if(!isInteractive())return console[_0x3362bf(0x1ac)](a4_0x1b9acb['red'](_0x3362bf(0x169)),_0x3362bf(0x150)),console[_0x3362bf(0x1ac)](a4_0x1b9acb[_0x3362bf(0x1c0)](_0x3362bf(0x144))),0x1;const _0x2444b4=await confirmKey(_0x3362bf(0x19e)+(_0x1c4749+_0x56d2c6)+'\x20files?');if(!_0x2444b4)return console[_0x3362bf(0x1f1)](a4_0x1b9acb[_0x3362bf(0x1b2)](_0x3362bf(0x159)),'-\x20no\x20files\x20written'),0x1;}const {data:_0xb31414}=await withSpinner(_0x3362bf(0x1b4),()=>_0x253d80['llm'][_0x3362bf(0x146)](_0x3ef559,_0x1c2f60,{'force':_0x5b70c8}));return console[_0x3362bf(0x1f1)](a4_0x1b9acb[_0x3362bf(0x19a)](_0x3362bf(0x177)+(_0x1c4749+_0x56d2c6)+_0x3362bf(0x1c4)+_0xb31414[_0x3362bf(0x192)])),saveSessionContext({'llm_project':_0xb31414['projectName']},_0x5adb4a[_0x3362bf(0x1ad)]),console[_0x3362bf(0x1f1)](a4_0x1b9acb[_0x3362bf(0x19a)](_0x3362bf(0x13f)+a4_0x1b9acb['dim'](_0x3362bf(0x17d))+_0x3362bf(0x1a4)+a4_0x1b9acb['cyan'](_0xb31414[_0x3362bf(0x14c)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x200d1(0x1e6)]=a4_0x200d1(0x152);[a4_0x200d1(0x1b7)]=a4_0x200d1(0x1e4);async[a4_0x200d1(0x1ef)](_0x4c05ec){const _0x54ca67=a4_0x200d1,{options:_0x958760,args:_0x540519,tdx:_0xc80871}=_0x4c05ec,_0x1ca27d=_0x540519[0x0],_0x16b654=_0x958760[_0x54ca67(0x1e6)],_0x35d430=_0x958760[_0x54ca67(0x1da)],_0x3947a3=_0x958760[_0x54ca67(0x186)],_0x1e480f=_0x958760[_0x54ca67(0x1c3)],_0x10f611=_0x958760[_0x54ca67(0x15e)];let _0x93cfea;const _0x445917=findAgentConfigPath(process[_0x54ca67(0x19b)]());if(_0x1ca27d){const _0x306f68=a4_0xfa118c[_0x54ca67(0x154)](_0x1ca27d,_0x54ca67(0x157));existsSync(_0x306f68)?(_0x93cfea=_0x1ca27d,console[_0x54ca67(0x1f1)](a4_0x1b9acb['dim'](_0x54ca67(0x1b5)+_0x1ca27d))):_0x93cfea=_0x1ca27d;}else{if(_0x445917)_0x93cfea=a4_0xfa118c[_0x54ca67(0x1db)](_0x445917),console['log'](a4_0x1b9acb[_0x54ca67(0x1c0)]('Using\x20current\x20project:\x20'+_0x93cfea));else{if(_0x10f611){const _0x3eabda=sanitizeForFilesystem(_0x10f611);let _0x2eae80=_0x3eabda,_0x24b3ab=a4_0xfa118c[_0x54ca67(0x154)](process[_0x54ca67(0x19b)](),'agents',_0x3eabda,_0x54ca67(0x157));if(!existsSync(_0x24b3ab)){const _0x23390a=normalizeName(_0x10f611),_0x281c38=a4_0xfa118c[_0x54ca67(0x154)](process['cwd'](),_0x54ca67(0x1c2),_0x23390a,'tdx.json');existsSync(_0x281c38)&&(_0x2eae80=_0x23390a,_0x24b3ab=_0x281c38);}if(existsSync(_0x24b3ab))_0x93cfea=a4_0xfa118c[_0x54ca67(0x1db)](_0x24b3ab),console['log'](a4_0x1b9acb[_0x54ca67(0x1c0)](_0x54ca67(0x1b5)+_0x93cfea));else{const _0x50c4ff=_0x958760['profile'];if(_0x50c4ff)throw new SDKError(ErrorCode[_0x54ca67(0x180)],_0x54ca67(0x141)+_0x10f611+_0x54ca67(0x14e),undefined,{'helpText':_0x54ca67(0x1cc)+_0x54ca67(0x1ce)+(_0x54ca67(0x1c6)+_0x10f611+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2eae80+_0x54ca67(0x164)+(_0x16b654||_0x54ca67(0x178))+_0x54ca67(0x1b9)+_0x50c4ff)});_0x93cfea=_0x10f611,console[_0x54ca67(0x1f1)](a4_0x1b9acb['dim'](_0x54ca67(0x19d)+_0x10f611));}}}}if(!_0x93cfea)return console[_0x54ca67(0x1f1)](a4_0x1b9acb[_0x54ca67(0x1b2)](_0x54ca67(0x198))),console[_0x54ca67(0x1f1)](_0x54ca67(0x1b0)),console[_0x54ca67(0x1f1)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x54ca67(0x1f1)](_0x54ca67(0x1c1)),console[_0x54ca67(0x1f1)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x16b654)throw new SDKError(ErrorCode[_0x54ca67(0x176)],_0x54ca67(0x17a),undefined,{'helpText':_0x54ca67(0x173)});if(!_0x3947a3&&!_0x35d430){if(!isInteractive())return console[_0x54ca67(0x1ac)](a4_0x1b9acb[_0x54ca67(0x1d8)](_0x54ca67(0x169)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x1b9acb[_0x54ca67(0x1c0)](_0x54ca67(0x144))),0x1;const _0x5d6086=await confirmKey(_0x54ca67(0x1a8)+_0x93cfea+'\x22\x20to\x20new\x20project\x20\x22'+_0x16b654+'\x22?');if(!_0x5d6086)return console[_0x54ca67(0x1f1)](a4_0x1b9acb['yellow'](_0x54ca67(0x159))),0x1;}const {data:_0x2d8380}=await withSpinner(_0x54ca67(0x1bf)+_0x93cfea+'\x22\x20to\x20\x22'+_0x16b654+_0x54ca67(0x162),()=>_0xc80871[_0x54ca67(0x1a5)][_0x54ca67(0x1ca)](_0x93cfea,_0x16b654,{'dryRun':_0x35d430}));if(_0x35d430){console[_0x54ca67(0x1f1)](a4_0x1b9acb[_0x54ca67(0x1b2)](_0x54ca67(0x1d3))),console[_0x54ca67(0x1f1)](_0x54ca67(0x171)+_0x2d8380[_0x54ca67(0x13d)]),console['log'](_0x54ca67(0x195)+_0x16b654),console['log'](_0x54ca67(0x168)),console[_0x54ca67(0x1f1)](_0x54ca67(0x194)+_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x1c2)][_0x54ca67(0x18a)]),console[_0x54ca67(0x1f1)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x17e)][_0x54ca67(0x18a)]),console['log']('\x20\x20Prompts:\x20'+_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x17f)][_0x54ca67(0x18a)]);const _0x2b4433=_0x2d8380[_0x54ca67(0x165)]['experimentalKnowledgeBases']['created']>0x0||_0x2d8380['counts']['experimentalArtifacts'][_0x54ca67(0x18a)]>0x0;return _0x2b4433&&(console[_0x54ca67(0x1f1)](_0x54ca67(0x189)+_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x1d4)][_0x54ca67(0x18a)]),console[_0x54ca67(0x1f1)](_0x54ca67(0x16d)+_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x153)]['created'])),0x0;}const _0xbf6a4e=_0x2d8380['counts']['agents'][_0x54ca67(0x1c5)]>0x0||_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x17e)]['errors']>0x0||_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x17f)][_0x54ca67(0x1c5)]>0x0||_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x1d4)][_0x54ca67(0x1c5)]>0x0||_0x2d8380['counts'][_0x54ca67(0x153)]['errors']>0x0;_0xbf6a4e?console[_0x54ca67(0x1f1)](a4_0x1b9acb['yellow'](_0x54ca67(0x1c7))):console['log'](a4_0x1b9acb[_0x54ca67(0x19a)](_0x54ca67(0x16b)));console[_0x54ca67(0x1f1)]('Source:\x20'+_0x2d8380['sourceProjectName']),console[_0x54ca67(0x1f1)](_0x54ca67(0x195)+_0x2d8380[_0x54ca67(0x1de)]),console[_0x54ca67(0x1f1)](_0x54ca67(0x1e7)+_0x2d8380[_0x54ca67(0x1eb)]),console[_0x54ca67(0x1f1)](),console[_0x54ca67(0x1f1)](_0x54ca67(0x1a7)),console[_0x54ca67(0x1f1)](_0x54ca67(0x194)+formatCountSummary(_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x1c2)])),console['log'](_0x54ca67(0x18d)+formatCountSummary(_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x17e)])),console[_0x54ca67(0x1f1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2d8380['counts']['prompts'])),console[_0x54ca67(0x1f1)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x19f)]));const _0x1834be=_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x1d4)][_0x54ca67(0x18a)]>0x0||_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x1d4)][_0x54ca67(0x1ae)]>0x0||_0x2d8380[_0x54ca67(0x165)]['experimentalKnowledgeBases'][_0x54ca67(0x15f)]>0x0||_0x2d8380[_0x54ca67(0x165)][_0x54ca67(0x153)][_0x54ca67(0x18a)]>0x0||_0x2d8380['counts'][_0x54ca67(0x153)][_0x54ca67(0x1ae)]>0x0||_0x2d8380['counts'][_0x54ca67(0x153)][_0x54ca67(0x15f)]>0x0;_0x1834be&&(console[_0x54ca67(0x1f1)](_0x54ca67(0x189)+formatCountSummary(_0x2d8380['counts'][_0x54ca67(0x1d4)])),console[_0x54ca67(0x1f1)](_0x54ca67(0x16d)+formatCountSummary(_0x2d8380['counts'][_0x54ca67(0x153)])));if(_0xbf6a4e){console[_0x54ca67(0x1f1)](),console[_0x54ca67(0x1f1)](a4_0x1b9acb[_0x54ca67(0x1d8)](_0x54ca67(0x149)));for(const _0x213c68 of _0x2d8380[_0x54ca67(0x1c2)]){_0x213c68[_0x54ca67(0x15b)]===_0x54ca67(0x1ac)&&console[_0x54ca67(0x1f1)](a4_0x1b9acb[_0x54ca67(0x1d8)](_0x54ca67(0x1b6)+_0x213c68[_0x54ca67(0x140)]+_0x54ca67(0x172)+_0x213c68[_0x54ca67(0x1ac)]));}for(const _0x4c3a45 of _0x2d8380[_0x54ca67(0x17e)]){_0x4c3a45[_0x54ca67(0x15b)]===_0x54ca67(0x1ac)&&console[_0x54ca67(0x1f1)](a4_0x1b9acb['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4c3a45[_0x54ca67(0x1e6)]+_0x54ca67(0x172)+_0x4c3a45[_0x54ca67(0x1ac)]));}for(const _0x29fe69 of _0x2d8380[_0x54ca67(0x17f)]){_0x29fe69[_0x54ca67(0x15b)]==='error'&&console[_0x54ca67(0x1f1)](a4_0x1b9acb[_0x54ca67(0x1d8)](_0x54ca67(0x188)+_0x29fe69['name']+_0x54ca67(0x172)+_0x29fe69[_0x54ca67(0x1ac)]));}for(const _0x449395 of _0x2d8380[_0x54ca67(0x19f)]){_0x449395[_0x54ca67(0x15b)]==='error'&&console[_0x54ca67(0x1f1)](a4_0x1b9acb[_0x54ca67(0x1d8)](_0x54ca67(0x14f)+_0x449395['name']+'\x22:\x20'+_0x449395[_0x54ca67(0x1ac)]));}for(const _0x36f8de of _0x2d8380[_0x54ca67(0x1d4)]){_0x36f8de[_0x54ca67(0x15b)]===_0x54ca67(0x1ac)&&console[_0x54ca67(0x1f1)](a4_0x1b9acb[_0x54ca67(0x1d8)](_0x54ca67(0x1a2)+_0x36f8de[_0x54ca67(0x1e6)]+_0x54ca67(0x172)+_0x36f8de[_0x54ca67(0x1ac)]));}for(const _0x555050 of _0x2d8380[_0x54ca67(0x153)]){_0x555050[_0x54ca67(0x15b)]===_0x54ca67(0x1ac)&&console[_0x54ca67(0x1f1)](a4_0x1b9acb['red'](_0x54ca67(0x142)+_0x555050['name']+_0x54ca67(0x172)+_0x555050[_0x54ca67(0x1ac)]));}return 0x1;}console[_0x54ca67(0x1f1)]();const _0x5a33e1=getLLMProjectUrl(_0x1e480f,_0x2d8380[_0x54ca67(0x1eb)]);return console[_0x54ca67(0x1f1)](_0x54ca67(0x156)+a4_0x1b9acb[_0x54ca67(0x1e2)](_0x5a33e1)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x200d1(0x1e6)]=a4_0x200d1(0x1f0);['description']=a4_0x200d1(0x17b);async[a4_0x200d1(0x1ef)](_0x409368){const _0x3ff435=a4_0x200d1,{options:_0x485aa1,args:_0x537a4a,tdx:_0x53b286}=_0x409368;let _0x30e50b=_0x537a4a[0x0]||process[_0x3ff435(0x19b)]();const _0x5c92a7=_0x485aa1['dryRun'],_0x419205=_0x485aa1['force'],_0x58cbb5=_0x485aa1[_0x3ff435(0x186)],_0xad42a=_0x485aa1[_0x3ff435(0x1c3)],_0x365322=a4_0xfa118c[_0x3ff435(0x154)](_0x30e50b,_0x3ff435(0x185)),_0x4a9ad7=existsSync(_0x365322);if(_0x4a9ad7){const {data:_0x208dc3}=await withSpinner(_0x3ff435(0x1e5)+_0x30e50b+'\x22...',()=>_0x53b286[_0x3ff435(0x1a5)][_0x3ff435(0x199)](_0x30e50b,{'dryRun':_0x5c92a7,'force':_0x419205}));if(_0x5c92a7)return console[_0x3ff435(0x1f1)](a4_0x1b9acb['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x3ff435(0x16a)+_0x208dc3[_0x3ff435(0x140)]),0x0;if(_0x208dc3[_0x3ff435(0x15b)]===_0x3ff435(0x1ac))return console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1d8)](_0x3ff435(0x1bb)+_0x208dc3[_0x3ff435(0x1ac)])),0x1;console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x19a)]('Agent\x20'+_0x208dc3[_0x3ff435(0x15b)]+_0x3ff435(0x1c8))),console[_0x3ff435(0x1f1)](_0x3ff435(0x1dc)+_0x208dc3['agentName']);if(_0x208dc3[_0x3ff435(0x14d)]&&_0x208dc3['projectId']){const _0x522ccd=getLLMAgentChatUrl(_0xad42a,_0x208dc3[_0x3ff435(0x1ba)],_0x208dc3[_0x3ff435(0x14d)]);console[_0x3ff435(0x1f1)](_0x3ff435(0x19c)+a4_0x1b9acb[_0x3ff435(0x1e2)](_0x522ccd));}return 0x0;}const _0x3ec12f=_0x485aa1[_0x3ff435(0x15e)],_0x5195a3=resolveProjectFromContext(_0x30e50b,_0x3ec12f);if(_0x5195a3[_0x3ff435(0x16c)])_0x30e50b=_0x5195a3[_0x3ff435(0x18f)],_0x5195a3[_0x3ff435(0x193)]==='context'&&console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1c0)](_0x3ff435(0x155)+_0x30e50b));else{let _0xa712ec=_0x3ff435(0x1d2);_0x5195a3[_0x3ff435(0x174)]===_0x3ff435(0x15a)&&(_0xa712ec=_0x5195a3[_0x3ff435(0x14b)]+_0x3ff435(0x1dd)+_0x5195a3[_0x3ff435(0x15e)]+_0x3ff435(0x148));throw new SDKError(ErrorCode[_0x3ff435(0x180)],_0x5195a3[_0x3ff435(0x174)]===_0x3ff435(0x183)?_0x5195a3[_0x3ff435(0x14b)]:'No\x20tdx.json\x20found\x20in\x20'+_0x30e50b,undefined,{'helpText':_0xa712ec});}const {data:_0x178fcd}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x53b286[_0x3ff435(0x1a5)][_0x3ff435(0x1cb)](_0x30e50b,{'dryRun':!![]})),_0x2ba5a9=_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1c2)][_0x3ff435(0x1c5)]>0x0;if(_0x2ba5a9){console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1d8)]('\x0aErrors\x20found:'));for(const _0x1f5d4f of _0x178fcd[_0x3ff435(0x1c2)]){_0x1f5d4f[_0x3ff435(0x15b)]==='error'&&console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1d8)](_0x3ff435(0x1b6)+_0x1f5d4f['agentName']+_0x3ff435(0x172)+_0x1f5d4f[_0x3ff435(0x1ac)]));}return 0x1;}const _0x2c17a8=_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1c2)]['created']+_0x178fcd['counts'][_0x3ff435(0x17e)][_0x3ff435(0x18a)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1d0)][_0x3ff435(0x18a)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x17f)]['created']+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x19f)][_0x3ff435(0x18a)]+_0x178fcd['counts'][_0x3ff435(0x1d4)][_0x3ff435(0x18a)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x153)]['created'],_0x2328a6=_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1c2)][_0x3ff435(0x1ae)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x17e)][_0x3ff435(0x1ae)]+_0x178fcd[_0x3ff435(0x165)]['textKnowledgeBases'][_0x3ff435(0x1ae)]+_0x178fcd['counts'][_0x3ff435(0x17f)][_0x3ff435(0x1ae)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x19f)][_0x3ff435(0x1ae)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1d4)][_0x3ff435(0x1ae)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x153)][_0x3ff435(0x1ae)],_0x18f6bf=_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1c2)][_0x3ff435(0x15f)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x17e)][_0x3ff435(0x15f)]+_0x178fcd[_0x3ff435(0x165)]['textKnowledgeBases']['unchanged']+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x17f)][_0x3ff435(0x15f)]+_0x178fcd['counts'][_0x3ff435(0x19f)]['unchanged']+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1d4)][_0x3ff435(0x15f)]+_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x153)]['unchanged'];console[_0x3ff435(0x1f1)](_0x3ff435(0x1d7)+_0x178fcd[_0x3ff435(0x14c)]+'\x27:'),console[_0x3ff435(0x1f1)]('\x20\x20'+a4_0x1b9acb[_0x3ff435(0x19a)]('+\x20'+_0x2c17a8+_0x3ff435(0x163))+'\x20|\x20'+a4_0x1b9acb[_0x3ff435(0x1b2)]('~\x20'+_0x2328a6+_0x3ff435(0x1a0))+_0x3ff435(0x15c)+a4_0x1b9acb[_0x3ff435(0x1c0)]('=\x20'+_0x18f6bf+_0x3ff435(0x1e3))),console[_0x3ff435(0x1f1)](_0x3ff435(0x194)+formatCountSummary(_0x178fcd['counts']['agents'])),console[_0x3ff435(0x1f1)](_0x3ff435(0x18d)+formatCountSummary(_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x17e)])),console['log'](_0x3ff435(0x191)+formatCountSummary(_0x178fcd['counts'][_0x3ff435(0x1d0)])),console[_0x3ff435(0x1f1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x17f)])),console[_0x3ff435(0x1f1)](_0x3ff435(0x190)+formatCountSummary(_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x19f)]));const _0x27d1d4=_0x178fcd[_0x3ff435(0x165)]['experimentalKnowledgeBases'][_0x3ff435(0x18a)]>0x0||_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1d4)][_0x3ff435(0x1ae)]>0x0||_0x178fcd[_0x3ff435(0x165)]['experimentalKnowledgeBases'][_0x3ff435(0x15f)]>0x0||_0x178fcd['counts'][_0x3ff435(0x153)][_0x3ff435(0x18a)]>0x0||_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x153)][_0x3ff435(0x1ae)]>0x0||_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x153)][_0x3ff435(0x15f)]>0x0;_0x27d1d4&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x1d4)])),console[_0x3ff435(0x1f1)](_0x3ff435(0x16d)+formatCountSummary(_0x178fcd[_0x3ff435(0x165)][_0x3ff435(0x153)])));console[_0x3ff435(0x1f1)](_0x3ff435(0x1a9)+a4_0x1b9acb[_0x3ff435(0x1e2)](_0x30e50b)),displayDiffs(_0x178fcd[_0x3ff435(0x1c2)],_0x178fcd['knowledgeBases'],_0x178fcd[_0x3ff435(0x1d0)],_0x178fcd[_0x3ff435(0x17f)],_0x178fcd[_0x3ff435(0x19f)],_0x178fcd[_0x3ff435(0x1d4)],_0x178fcd[_0x3ff435(0x153)]);if(_0x5c92a7)return console[_0x3ff435(0x1f1)](a4_0x1b9acb['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x2c17a8===0x0&&_0x2328a6===0x0){console[_0x3ff435(0x1f1)](a4_0x1b9acb['green'](_0x3ff435(0x1ab)));const _0x24ca15=getLLMProjectUrl(_0xad42a,_0x178fcd[_0x3ff435(0x1ba)]);return console[_0x3ff435(0x1f1)](_0x3ff435(0x156)+a4_0x1b9acb[_0x3ff435(0x1e2)](_0x24ca15)),0x0;}if(!_0x58cbb5&&!_0x419205){if(!isInteractive())return console[_0x3ff435(0x1ac)](a4_0x1b9acb[_0x3ff435(0x1d8)]('\x0aError:'),_0x3ff435(0x150)),console[_0x3ff435(0x1ac)](a4_0x1b9acb['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3362e4=await confirmKey('\x0aPush\x20'+(_0x2c17a8+_0x2328a6)+_0x3ff435(0x1af));if(!_0x3362e4)return console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1b2)](_0x3ff435(0x159)),_0x3ff435(0x196)),0x1;}const {data:_0x1fe115}=await withSpinner(_0x3ff435(0x16f),()=>_0x53b286[_0x3ff435(0x1a5)]['pushProject'](_0x30e50b,{'force':_0x419205})),_0xe2ad23=_0x1fe115[_0x3ff435(0x165)]['agents'][_0x3ff435(0x1c5)]>0x0||_0x1fe115[_0x3ff435(0x165)][_0x3ff435(0x17e)]['errors']>0x0||_0x1fe115[_0x3ff435(0x165)][_0x3ff435(0x1d0)][_0x3ff435(0x1c5)]>0x0||_0x1fe115[_0x3ff435(0x165)][_0x3ff435(0x17f)][_0x3ff435(0x1c5)]>0x0;if(_0xe2ad23){console['log'](a4_0x1b9acb[_0x3ff435(0x1b2)](_0x3ff435(0x1b8))),console[_0x3ff435(0x1f1)](),console['log'](a4_0x1b9acb[_0x3ff435(0x1d8)](_0x3ff435(0x149)));for(const _0x4a08cc of _0x1fe115[_0x3ff435(0x1c2)]){_0x4a08cc[_0x3ff435(0x15b)]===_0x3ff435(0x1ac)&&console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1d8)](_0x3ff435(0x1b6)+_0x4a08cc[_0x3ff435(0x140)]+'\x22:\x20'+_0x4a08cc[_0x3ff435(0x1ac)]));}for(const _0x5808af of _0x1fe115[_0x3ff435(0x17e)]){_0x5808af[_0x3ff435(0x15b)]===_0x3ff435(0x1ac)&&console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1d8)](_0x3ff435(0x1bd)+_0x5808af['name']+'\x22:\x20'+_0x5808af[_0x3ff435(0x1ac)]));}for(const _0x54f317 of _0x1fe115[_0x3ff435(0x1d0)]){_0x54f317[_0x3ff435(0x15b)]===_0x3ff435(0x1ac)&&console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1d8)](_0x3ff435(0x147)+_0x54f317['name']+_0x3ff435(0x172)+_0x54f317[_0x3ff435(0x1ac)]));}for(const _0x36274a of _0x1fe115[_0x3ff435(0x17f)]){_0x36274a[_0x3ff435(0x15b)]==='error'&&console[_0x3ff435(0x1f1)](a4_0x1b9acb[_0x3ff435(0x1d8)]('\x20\x20Prompt\x20\x22'+_0x36274a[_0x3ff435(0x1e6)]+_0x3ff435(0x172)+_0x36274a[_0x3ff435(0x1ac)]));}for(const _0x458bb5 of _0x1fe115['integrations']){_0x458bb5[_0x3ff435(0x15b)]===_0x3ff435(0x1ac)&&console[_0x3ff435(0x1f1)](a4_0x1b9acb['red']('\x20\x20Integration\x20\x22'+_0x458bb5[_0x3ff435(0x1e6)]+_0x3ff435(0x172)+_0x458bb5['error']));}return 0x1;}console['log'](a4_0x1b9acb['green']('\x0a✔\x20Pushed\x20'+(_0x2c17a8+_0x2328a6)+_0x3ff435(0x1ec)+_0x1fe115['projectName']+'\x27'));const _0x4b0089=getLLMProjectUrl(_0xad42a,_0x1fe115[_0x3ff435(0x1ba)]);return console[_0x3ff435(0x1f1)](_0x3ff435(0x156)+a4_0x1b9acb['cyan'](_0x4b0089)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x1aadb1=a5_0x4be3;(function(_0x12fb04,_0x3ac9e1){const _0x9cacdd=a5_0x4be3,_0x3afd9d=_0x12fb04();while(!![]){try{const _0x1eeb09=-parseInt(_0x9cacdd(0x203))/0x1*(-parseInt(_0x9cacdd(0x24b))/0x2)+-parseInt(_0x9cacdd(0x254))/0x3+-parseInt(_0x9cacdd(0x240))/0x4+parseInt(_0x9cacdd(0x230))/0x5*(-parseInt(_0x9cacdd(0x256))/0x6)+-parseInt(_0x9cacdd(0x237))/0x7*(parseInt(_0x9cacdd(0x1c7))/0x8)+parseInt(_0x9cacdd(0x223))/0x9*(-parseInt(_0x9cacdd(0x210))/0xa)+parseInt(_0x9cacdd(0x25a))/0xb*(parseInt(_0x9cacdd(0x248))/0xc);if(_0x1eeb09===_0x3ac9e1)break;else _0x3afd9d['push'](_0x3afd9d['shift']());}catch(_0x27f076){_0x3afd9d['push'](_0x3afd9d['shift']());}}}(a5_0x225f,0x7b65d));function a5_0x4be3(_0x51ec28,_0x21ccde){_0x51ec28=_0x51ec28-0x1c6;const _0x225f21=a5_0x225f();let _0x4be35b=_0x225f21[_0x51ec28];return _0x4be35b;}import*as a5_0xabfca1 from'node:fs';import*as a5_0x207983 from'node:path';import a5_0x535e65 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';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x225f(){const _0x3c3409=['tags','has','conversations','PASS','Running\x20test:\x20','site','json','tsv','projectName','testName','substring','green','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','no_tests','find','\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','red','\x20-\x20','9NxewtU','llm','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','resolve','includes','\x20\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','name','\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)','Failed:\x20\x20\x20','conversation_url','message','white','8035ReYmex','Test\x20','Running\x20agent\x20tests...','\x20\x20Evaluating...\x20','rounds','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','length','319928RsebKF','filter','existsSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Project\x20path:\x20','jsonl','404','Site:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','3707768FqNacm','No\x20tests\x20found\x20matching:\x20','map','trim','\x22:\x20','ERROR','Output\x20written\x20to:\x20','toISOString','348aZLcoh','Using\x20agent:\x20','not\x20found','1645762qaamBC','context','utf-8','now','...','eval','size','start','Conversation\x20URL:\x20','135357eRnHFv','verbose','1482jOwcMB','Cached\x20run\x20is\x20from\x20site\x20\x22','reeval','dim','965602LhaNVp','repeat','Available\x20tests:\x20','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20','...\x20','Evaluating\x20response...','152zJuPHs','Running:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','projectDir','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','resolveProjectId','/<agent-name>','cyan','resolveAgentId','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','Executing\x20new\x20tests...','Agent:\x20','yellow','text','output','isSpinning','✓\x20PASS:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','⚠\x20SKIPPED:\x20','executeReeval','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','llmProject','Available\x20tags:\x20','Either\x20switch\x20to\x20the\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','log','✗\x20ERROR:\x20Project\x20not\x20found:\x20','join','timestamp',':\x20Sending\x20user\x20input...','push','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Conversation:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','agent','Re-evaluating...','✗\x20FAIL:\x20','agentName','Test\x20Summary','no_local_folder','No\x20tests\x20have\x20tags\x20defined.','reason','Round\x20','writeFileSync','execute','Usage:','dryRun','some','Cached\x20run\x20from:\x20','\x20(new)','tests','no_context','toLowerCase','FAIL','status','No\x20tests\x20found\x20with\x20tags:\x20','source','test.yml','1wfmmYE','forEach','found','round','Test\x20Configuration:','stop','multiple_agents','Re-evaluation\x20Summary','Passed:\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20Round\x20','Round\x201/','6257560dxWyle'];a5_0x225f=function(){return _0x3c3409;};return a5_0x225f();}export class AgentTestCommand extends BaseCommand{[a5_0x1aadb1(0x22a)]='agent:test';['description']=a5_0x1aadb1(0x1c9);async[a5_0x1aadb1(0x1f5)](_0x56f955){const _0x41a204=a5_0x1aadb1,{options:_0x42cac2,args:_0x3d26eb,tdx:_0xfcf5a7}=_0x56f955,_0x41fbc8=_0x3d26eb[0x0]||'.',_0x35230c=_0x42cac2[_0x41a204(0x1f7)],_0x143edf=_0x42cac2,_0x43f63b=_0x143edf[_0x41a204(0x250)]===![],_0x24f2e0=_0x143edf[_0x41a204(0x258)],_0x596b7a=_0x143edf['name'],_0x3a2446=_0x143edf[_0x41a204(0x211)],_0x12690a=_0x42cac2[_0x41a204(0x216)],_0x4a37ba=_0x143edf[_0x41a204(0x1d7)];if(_0x24f2e0&&_0x43f63b)return console[_0x41a204(0x1e2)](a5_0x535e65['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2c521e=_0x41a204(0x1d2);if(_0x143edf['json'])_0x2c521e=_0x41a204(0x217);else{if(_0x143edf[_0x41a204(0x23c)])_0x2c521e='jsonl';else{if(_0x143edf[_0x41a204(0x218)])_0x2c521e=_0x41a204(0x218);else{if(_0x143edf[_0x41a204(0x1d2)])_0x2c521e=_0x41a204(0x1d2);}}}const _0x45d91b=_0x143edf[_0x41a204(0x1de)];let _0x2b2f27=_0x41fbc8;const _0x4a7a01=a5_0xabfca1[_0x41a204(0x239)](_0x41fbc8),_0x429b36=_0x41fbc8==='.';if(!_0x4a7a01||_0x429b36){const _0x5932a0=resolveProjectFromContext(_0x41fbc8,_0x45d91b,{'requireFile':_0x41a204(0x202)});if(_0x5932a0[_0x41a204(0x205)])_0x2b2f27=_0x5932a0['projectDir'],_0x5932a0[_0x41a204(0x201)]===_0x41a204(0x24c)&&console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x249)+_0x2b2f27));else switch(_0x5932a0[_0x41a204(0x1f2)]){case _0x41a204(0x1fc):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x1d5)](_0x5932a0[_0x41a204(0x22e)])),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)](_0x41a204(0x1f6)),console[_0x41a204(0x1e2)](_0x41a204(0x220)),console[_0x41a204(0x1e2)](_0x41a204(0x22b)),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x41a204(0x1f0):console['log'](a5_0x535e65[_0x41a204(0x1d5)](_0x5932a0['message'])),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5932a0[_0x41a204(0x1de)]+_0x41a204(0x1e1));return 0x1;case _0x41a204(0x209):{const _0x1c3556=a5_0x207983['basename'](_0x5932a0[_0x41a204(0x1ca)]);console['log'](a5_0x535e65[_0x41a204(0x1d5)](_0x41a204(0x1ea)+_0x5932a0[_0x41a204(0x1de)]+'\x22:'));for(const _0xc8cc5b of _0x5932a0['agentDirs']){console[_0x41a204(0x1e2)](_0x41a204(0x228)+_0xc8cc5b);}return console[_0x41a204(0x1e2)](),console['log'](_0x41a204(0x23f)+_0x1c3556+_0x41a204(0x1cd)),0x1;}case _0x41a204(0x21e):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x1d5)](_0x41a204(0x235)+_0x5932a0['llmProject']+'\x22.')),console[_0x41a204(0x1e2)](a5_0x535e65['dim'](_0x41a204(0x23b)+_0x5932a0['projectDir'])),console['log'](),console['log'](_0x41a204(0x23a));return 0x1;}}const {definition:_0x6b625f,agentInfo:_0x3f955f}=parseTestFile(_0x2b2f27);let _0x442584=_0x6b625f['tests'];if(_0x596b7a){const _0x464af1=_0x596b7a['split'](',')[_0x41a204(0x242)](_0xfdaa43=>_0xfdaa43['trim']());_0x442584=_0x6b625f['tests']['filter'](_0x578588=>_0x464af1[_0x41a204(0x227)](_0x578588[_0x41a204(0x22a)]));if(_0x442584[_0x41a204(0x236)]===0x0)return console['log'](a5_0x535e65[_0x41a204(0x1d5)](_0x41a204(0x241)+_0x596b7a)),console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x25c)+_0x6b625f[_0x41a204(0x1fb)][_0x41a204(0x242)](_0x273fc2=>_0x273fc2[_0x41a204(0x22a)])[_0x41a204(0x1e4)](',\x20'))),0x1;}if(_0x3a2446){const _0x798c99=_0x3a2446['split'](',')[_0x41a204(0x242)](_0x2938a3=>_0x2938a3[_0x41a204(0x243)]()[_0x41a204(0x1fd)]());_0x442584=_0x442584[_0x41a204(0x238)](_0x305f96=>_0x305f96[_0x41a204(0x211)]?.[_0x41a204(0x1f8)](_0x4852d0=>_0x798c99[_0x41a204(0x227)](_0x4852d0[_0x41a204(0x1fd)]())));if(_0x442584[_0x41a204(0x236)]===0x0){console[_0x41a204(0x1e2)](a5_0x535e65['yellow'](_0x41a204(0x200)+_0x3a2446));const _0x39c4c6=new Set();return _0x6b625f[_0x41a204(0x1fb)][_0x41a204(0x204)](_0x3ac4d7=>_0x3ac4d7[_0x41a204(0x211)]?.['forEach'](_0x49c33b=>_0x39c4c6['add'](_0x49c33b))),_0x39c4c6[_0x41a204(0x251)]>0x0?console['log'](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x1df)+[..._0x39c4c6][_0x41a204(0x1e4)](',\x20'))):console['log'](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x1f1))),0x1;}}if(_0x24f2e0)return this[_0x41a204(0x1dc)](_0x56f955,{'definition':{'tests':_0x442584},'agentInfo':_0x3f955f,'outputFormat':_0x2c521e,'outputFile':_0x4a37ba,'testNames':_0x596b7a});if(_0x35230c){console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x1ce)](_0x41a204(0x207))),console[_0x41a204(0x1e2)]('\x20\x20Site:\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x12690a)),console[_0x41a204(0x1e2)]('\x20\x20Project:\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x3f955f[_0x41a204(0x219)])),console['log']('\x20\x20Agent:\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x3f955f['agentName'])),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)]('Tests\x20found:\x20'+a5_0x535e65['white'](_0x442584[_0x41a204(0x236)]));for(let _0x2065be=0x0;_0x2065be<_0x442584[_0x41a204(0x236)];_0x2065be++){const _0x58fc6d=_0x442584[_0x2065be],_0x38d74e=_0x58fc6d[_0x41a204(0x234)]['length']===0x1?_0x41a204(0x206):_0x41a204(0x234),_0x5eff87=_0x58fc6d[_0x41a204(0x211)]?.[_0x41a204(0x236)]?'\x20['+_0x58fc6d['tags']['join'](',\x20')+']':'';console[_0x41a204(0x1e2)]('\x20\x20'+(_0x2065be+0x1)+'.\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x58fc6d[_0x41a204(0x22a)])+'\x20('+_0x58fc6d[_0x41a204(0x234)][_0x41a204(0x236)]+'\x20'+_0x38d74e+')'+a5_0x535e65[_0x41a204(0x259)](_0x5eff87));}return 0x0;}let _0x35cf0a,_0x45479e;try{_0x35cf0a=await _0xfcf5a7[_0x41a204(0x224)][_0x41a204(0x1cc)](_0x3f955f[_0x41a204(0x219)]);}catch(_0x4a9c83){const _0xa7fc2c=_0x4a9c83 instanceof Error?_0x4a9c83[_0x41a204(0x22e)]:String(_0x4a9c83);return _0xa7fc2c['includes'](_0x41a204(0x23d))||_0xa7fc2c[_0x41a204(0x1fd)]()[_0x41a204(0x227)](_0x41a204(0x24a))?console['log'](a5_0x535e65['red'](_0x41a204(0x1e3)+_0x3f955f[_0x41a204(0x219)])):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x1d1)+_0x3f955f[_0x41a204(0x219)]+_0x41a204(0x244)+_0xa7fc2c)),0x1;}try{_0x45479e=await _0xfcf5a7[_0x41a204(0x224)][_0x41a204(0x1cf)](_0x3f955f[_0x41a204(0x1ee)],_0x35cf0a);}catch(_0x4c0e7f){const _0x40de61=_0x4c0e7f instanceof Error?_0x4c0e7f['message']:String(_0x4c0e7f);return _0x40de61[_0x41a204(0x227)](_0x41a204(0x23d))||_0x40de61[_0x41a204(0x1fd)]()[_0x41a204(0x227)](_0x41a204(0x24a))?console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x225)+_0x3f955f['agentName'])):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x1dd)+_0x3f955f[_0x41a204(0x1ee)]+_0x41a204(0x244)+_0x40de61)),0x1;}let _0x1aa066;if(!_0x43f63b)try{_0x1aa066=await setupEvaluatorAgent(_0xfcf5a7['llm'],_0x42cac2[_0x41a204(0x255)]);}catch(_0x310bc1){const _0x492c70=_0x310bc1 instanceof Error?_0x310bc1['message']:String(_0x310bc1);return console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x20d)+_0x492c70)),0x1;}console['log'](a5_0x535e65[_0x41a204(0x1ce)](_0x41a204(0x232))),console[_0x41a204(0x1e2)](_0x41a204(0x23e)+a5_0x535e65[_0x41a204(0x22f)](_0x12690a)),console[_0x41a204(0x1e2)](_0x41a204(0x1d4)+a5_0x535e65[_0x41a204(0x22f)](_0x3f955f[_0x41a204(0x219)]+'/'+_0x3f955f[_0x41a204(0x1ee)])),console[_0x41a204(0x1e2)]();const _0x2895a8=[],_0x40eaad=[],_0x398a7c=Date[_0x41a204(0x24e)]();for(let _0x2fa936=0x0;_0x2fa936<_0x442584[_0x41a204(0x236)];_0x2fa936++){const _0x2e42b2=_0x442584[_0x2fa936];_0x442584['length']>0x1?console['log'](_0x41a204(0x231)+(_0x2fa936+0x1)+'/'+_0x442584[_0x41a204(0x236)]+':\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x2e42b2['name'])):console[_0x41a204(0x1e2)](_0x41a204(0x215)+a5_0x535e65[_0x41a204(0x22f)](_0x2e42b2[_0x41a204(0x22a)]));const _0x16d66c=createCommandSpinner('Round\x201/'+_0x2e42b2[_0x41a204(0x234)][_0x41a204(0x236)]+_0x41a204(0x1e6));_0x16d66c['start']();try{const {result:_0x322140,conversation:_0x303e8b}=await runTest(_0xfcf5a7['llm'],_0x2e42b2,{'agentId':_0x45479e,'projectId':_0x35cf0a,'site':_0x12690a,'noEval':_0x43f63b,'evaluatorId':_0x1aa066,'onRoundStart':(_0x507f4f,_0xecb330)=>{_0x16d66c['text']='Round\x20'+(_0x507f4f+0x1)+'/'+_0xecb330+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x8573d2,_0x2d9f33,_0x4bcba0)=>{const _0x37d868=_0x41a204,_0x211865=formatElapsed(_0x2d9f33);_0x4bcba0?console[_0x37d868(0x1e2)](_0x37d868(0x20e)+(_0x8573d2+0x1)+'/'+_0x2e42b2['rounds'][_0x37d868(0x236)]+_0x37d868(0x25f)+a5_0x535e65[_0x37d868(0x21c)]('✓')+'\x20('+_0x211865+')'):console['log'](_0x37d868(0x20e)+(_0x8573d2+0x1)+'/'+_0x2e42b2['rounds']['length']+_0x37d868(0x25f)+a5_0x535e65[_0x37d868(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x599a47=_0x41a204;_0x16d66c[_0x599a47(0x1d6)]=_0x599a47(0x1c6);},'onEvaluationComplete':_0x5c3bce=>{const _0x58360e=_0x41a204,_0xd427ca=formatElapsed(_0x5c3bce);console[_0x58360e(0x1e2)]('\x20\x20Evaluating...\x20'+a5_0x535e65[_0x58360e(0x21c)]('✓')+'\x20('+_0xd427ca+')');}});_0x16d66c['stop'](),_0x2895a8[_0x41a204(0x1e7)](_0x322140),_0x40eaad[_0x41a204(0x1e7)](_0x303e8b);if(_0x322140[_0x41a204(0x1ff)]===_0x41a204(0x214))console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x21c)](_0x41a204(0x1d9)+_0x322140['reason']));else _0x322140[_0x41a204(0x1ff)]===_0x41a204(0x1fe)?console[_0x41a204(0x1e2)](a5_0x535e65['red'](_0x41a204(0x1ed)+_0x322140[_0x41a204(0x1f2)])):console['log'](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x25e)+_0x322140[_0x41a204(0x1f2)]));_0x322140[_0x41a204(0x22d)]&&console[_0x41a204(0x1e2)](a5_0x535e65['dim'](_0x41a204(0x253)+_0x322140[_0x41a204(0x22d)])),console[_0x41a204(0x1e2)]();}catch(_0x4d27f8){_0x16d66c[_0x41a204(0x208)]();const _0x203160=_0x4d27f8 instanceof Error?_0x4d27f8[_0x41a204(0x22e)]:String(_0x4d27f8);console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)]('✗\x20ERROR:\x20'+_0x203160)),console[_0x41a204(0x1e2)](),_0x2895a8[_0x41a204(0x1e7)]({'name':_0x2e42b2[_0x41a204(0x22a)],'status':_0x41a204(0x245),'reason':_0x203160,'timestamp':new Date()[_0x41a204(0x247)](),'duration_ms':0x0});}}const _0x478617=Date[_0x41a204(0x24e)]()-_0x398a7c,_0x2419bc=_0x2895a8[_0x41a204(0x238)](_0x396182=>_0x396182[_0x41a204(0x1ff)]===_0x41a204(0x214))['length'],_0x2df3cc=_0x2895a8[_0x41a204(0x238)](_0x22266e=>_0x22266e[_0x41a204(0x1ff)]===_0x41a204(0x1fe))['length'],_0x2a1b62=_0x2895a8[_0x41a204(0x238)](_0x19aa0e=>_0x19aa0e[_0x41a204(0x1ff)]===_0x41a204(0x245))[_0x41a204(0x236)];console[_0x41a204(0x1e2)]('━'[_0x41a204(0x25b)](0x3c)),console[_0x41a204(0x1e2)](_0x41a204(0x1ef)),console[_0x41a204(0x1e2)]('━'[_0x41a204(0x25b)](0x3c)),console[_0x41a204(0x1e2)](_0x41a204(0x25d)+_0x2895a8[_0x41a204(0x236)]),console[_0x41a204(0x1e2)](_0x41a204(0x20b)+a5_0x535e65['green'](_0x2419bc)),console[_0x41a204(0x1e2)](_0x41a204(0x22c)+a5_0x535e65[_0x41a204(0x221)](_0x2df3cc));_0x2a1b62>0x0&&console[_0x41a204(0x1e2)]('Errors:\x20\x20\x20'+a5_0x535e65[_0x41a204(0x221)](_0x2a1b62));console[_0x41a204(0x1e2)]('Duration:\x20'+formatElapsed(_0x478617)),console['log']('━'[_0x41a204(0x25b)](0x3c));const _0x51f38d=_0x2895a8[_0x41a204(0x238)](_0xa87927=>_0xa87927[_0x41a204(0x1ff)]!=='PASS');if(_0x51f38d[_0x41a204(0x236)]>0x0){console['log'](),console['log']('Failed\x20Tests:');for(const _0x4fb26a of _0x51f38d){const _0x525588=a5_0x535e65['red']('✗'),_0x114530=_0x4fb26a[_0x41a204(0x1f2)][_0x41a204(0x236)]>0x32?_0x4fb26a[_0x41a204(0x1f2)][_0x41a204(0x21b)](0x0,0x32)+_0x41a204(0x24f):_0x4fb26a[_0x41a204(0x1f2)];console['log']('\x20\x20'+_0x525588+'\x20'+_0x4fb26a['name']+':\x20'+_0x114530);}}const _0x4be87e={'summary':{'total':_0x2895a8[_0x41a204(0x236)],'passed':_0x2419bc,'failed':_0x2df3cc,'errors':_0x2a1b62>0x0?_0x2a1b62:undefined,'duration_ms':_0x478617},'tests':_0x2895a8,'agent':{'project':_0x3f955f[_0x41a204(0x219)],'name':_0x3f955f[_0x41a204(0x1ee)],'site':_0x12690a},'timestamp':new Date(_0x398a7c)[_0x41a204(0x247)]()};try{const _0x4d3c02=buildCachedTestRun(_0x40eaad,{'site':_0x12690a,'projectId':_0x35cf0a,'projectName':_0x3f955f['projectName'],'agentId':_0x45479e,'agentName':_0x3f955f['agentName'],'testYmlPath':a5_0x207983[_0x41a204(0x226)](_0x3f955f['testYmlPath'])});saveLastTestRun(_0x4d3c02);}catch{}if(_0x2c521e!==_0x41a204(0x1d2)||_0x4a37ba){const _0x3fe3c9=formatResults(_0x4be87e,_0x2c521e);if(_0x4a37ba)try{a5_0xabfca1[_0x41a204(0x1f4)](_0x4a37ba,_0x3fe3c9,_0x41a204(0x24d)),console['log'](),console['log'](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x246)+_0x4a37ba));}catch(_0x3d1ed2){return console[_0x41a204(0x1e2)](),console['log'](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x1d0)+_0x3d1ed2)),0x1;}else console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)](_0x3fe3c9);}return _0x51f38d[_0x41a204(0x236)]>0x0?0x1:0x0;}async['executeReeval'](_0x2564e3,_0x501e38){const _0x5d3168=a5_0x1aadb1,{options:_0xe0d45b,tdx:_0x3b737b}=_0x2564e3,{definition:_0x52b934,agentInfo:_0x4b8a7f,outputFormat:_0x4fb726,outputFile:_0x1ea26c}=_0x501e38,_0x2c27b9=_0xe0d45b[_0x5d3168(0x216)],_0x2200e3=loadLastTestRun();if(!_0x2200e3)return console[_0x5d3168(0x1e2)](a5_0x535e65['red'](_0x5d3168(0x1da))),console['log'](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1e8))),0x1;if(_0x2200e3[_0x5d3168(0x1eb)][_0x5d3168(0x1ee)]!==_0x4b8a7f[_0x5d3168(0x1ee)])return console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x221)](_0x5d3168(0x21d)+_0x2200e3[_0x5d3168(0x1eb)][_0x5d3168(0x1ee)]+_0x5d3168(0x1cb)+_0x4b8a7f[_0x5d3168(0x1ee)]+'\x22.')),console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x20c))),0x1;const _0x434092=new Set(_0x2200e3[_0x5d3168(0x213)][_0x5d3168(0x242)](_0x58427e=>_0x58427e[_0x5d3168(0x21a)])),_0x48124c=_0x52b934[_0x5d3168(0x1fb)][_0x5d3168(0x238)](_0x3cfe3=>!_0x434092[_0x5d3168(0x212)](_0x3cfe3['name']));if(_0x48124c[_0x5d3168(0x236)]>0x0&&_0x2200e3[_0x5d3168(0x216)]!==_0x2c27b9)return console[_0x5d3168(0x1e2)](a5_0x535e65['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console['log'](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x257)+_0x2200e3[_0x5d3168(0x216)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x2c27b9+'\x22.')),console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1e0)+_0x2200e3[_0x5d3168(0x216)]+_0x5d3168(0x229))),0x1;const _0x45d5c6=_0x52b934[_0x5d3168(0x1fb)][_0x5d3168(0x238)](_0x2ecedc=>_0x434092[_0x5d3168(0x212)](_0x2ecedc['name'])),_0x1a2511=_0x48124c;let _0x17d25b;try{_0x17d25b=await setupEvaluatorAgent(_0x3b737b[_0x5d3168(0x224)],_0xe0d45b['verbose']);}catch(_0x32ec84){const _0x332e26=_0x32ec84 instanceof Error?_0x32ec84[_0x5d3168(0x22e)]:String(_0x32ec84);return console[_0x5d3168(0x1e2)](a5_0x535e65['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x332e26)),0x1;}console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x1ce)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5d3168(0x1e2)](_0x5d3168(0x1f9)+a5_0x535e65[_0x5d3168(0x22f)](_0x2200e3[_0x5d3168(0x1e5)])),console[_0x5d3168(0x1e2)](_0x5d3168(0x1d4)+a5_0x535e65[_0x5d3168(0x22f)](_0x2200e3['agent'][_0x5d3168(0x219)]+'/'+_0x2200e3['agent']['agentName']));_0x1a2511[_0x5d3168(0x236)]>0x0&&console[_0x5d3168(0x1e2)]('New\x20tests\x20to\x20execute:\x20'+a5_0x535e65[_0x5d3168(0x1d5)](_0x1a2511[_0x5d3168(0x236)]));console[_0x5d3168(0x1e2)]();const _0x11b139=[],_0x185af4=Date[_0x5d3168(0x24e)](),_0x418f27=createCommandSpinner(_0x5d3168(0x1ec));if(_0x45d5c6['length']>0x0)try{const _0x447929=await reevaluateFromCache(_0x3b737b[_0x5d3168(0x224)],_0x2200e3,{'tests':_0x45d5c6},{'evaluatorId':_0x17d25b,'onTestStart':(_0x3f70a2,_0x2417f0,_0x50fccc)=>{const _0x330122=_0x5d3168;_0x418f27[_0x330122(0x1d6)]='Re-evaluating\x20'+(_0x2417f0+0x1)+'/'+_0x50fccc+':\x20'+_0x3f70a2+_0x330122(0x24f);if(!_0x418f27[_0x330122(0x1d8)])_0x418f27[_0x330122(0x252)]();},'onTestComplete':(_0x5da1d0,_0x56dfa3)=>{const _0xae576c=_0x5d3168;_0x418f27[_0xae576c(0x208)]();if(_0x56dfa3[_0xae576c(0x1ff)]==='PASS')console[_0xae576c(0x1e2)](a5_0x535e65['green'](_0xae576c(0x1d9)+_0x5da1d0)+a5_0x535e65[_0xae576c(0x259)]('\x20(cached)'));else _0x56dfa3[_0xae576c(0x1ff)]==='FAIL'?console[_0xae576c(0x1e2)](a5_0x535e65[_0xae576c(0x221)](_0xae576c(0x1ed)+_0x5da1d0+_0xae576c(0x222)+_0x56dfa3[_0xae576c(0x1f2)])+a5_0x535e65[_0xae576c(0x259)]('\x20(cached)')):console[_0xae576c(0x1e2)](a5_0x535e65[_0xae576c(0x221)](_0xae576c(0x25e)+_0x5da1d0+_0xae576c(0x222)+_0x56dfa3[_0xae576c(0x1f2)]));_0x56dfa3['conversation_url']&&console['log'](a5_0x535e65[_0xae576c(0x259)](_0xae576c(0x1e9)+_0x56dfa3[_0xae576c(0x22d)])),_0x11b139[_0xae576c(0x1e7)](_0x56dfa3);},'onTestSkipped':(_0x1ddeeb,_0x4dc7a8)=>{const _0x1e3c33=_0x5d3168;_0x418f27[_0x1e3c33(0x208)](),console[_0x1e3c33(0x1e2)](a5_0x535e65[_0x1e3c33(0x1d5)](_0x1e3c33(0x1db)+_0x1ddeeb+'\x20-\x20'+_0x4dc7a8));}});for(const _0xec6967 of _0x447929){!_0x11b139[_0x5d3168(0x21f)](_0x36fd2c=>_0x36fd2c['name']===_0xec6967[_0x5d3168(0x22a)])&&_0x11b139[_0x5d3168(0x1e7)](_0xec6967);}}catch(_0x27994e){_0x418f27[_0x5d3168(0x208)]();const _0x4d8824=_0x27994e instanceof Error?_0x27994e[_0x5d3168(0x22e)]:String(_0x27994e);return console['log'](a5_0x535e65['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x4d8824)),0x1;}_0x418f27['stop']();if(_0x1a2511[_0x5d3168(0x236)]>0x0){console[_0x5d3168(0x1e2)](),console['log'](a5_0x535e65[_0x5d3168(0x1ce)](_0x5d3168(0x1d3)));const {projectId:_0x3b39b6,agentId:_0x1eebf1}=_0x2200e3['agent'];for(const _0x40a2ff of _0x1a2511){console[_0x5d3168(0x1e2)](_0x5d3168(0x1c8)+a5_0x535e65[_0x5d3168(0x22f)](_0x40a2ff['name']));const _0x3560ab=createCommandSpinner(_0x5d3168(0x20f)+_0x40a2ff[_0x5d3168(0x234)][_0x5d3168(0x236)]+_0x5d3168(0x1e6));_0x3560ab[_0x5d3168(0x252)]();try{const {result:_0x534a85}=await runTest(_0x3b737b[_0x5d3168(0x224)],_0x40a2ff,{'agentId':_0x1eebf1,'projectId':_0x3b39b6,'site':_0x2200e3[_0x5d3168(0x216)],'noEval':![],'evaluatorId':_0x17d25b,'onRoundStart':(_0x379612,_0x5e8edd)=>{const _0x49184b=_0x5d3168;_0x3560ab[_0x49184b(0x1d6)]=_0x49184b(0x1f3)+(_0x379612+0x1)+'/'+_0x5e8edd+_0x49184b(0x1e6);},'onRoundComplete':(_0x541cad,_0x8317ea,_0x4bc1ba)=>{const _0x42d178=_0x5d3168,_0x1e6a64=formatElapsed(_0x8317ea);_0x4bc1ba?console['log'](_0x42d178(0x20e)+(_0x541cad+0x1)+'/'+_0x40a2ff[_0x42d178(0x234)][_0x42d178(0x236)]+_0x42d178(0x25f)+a5_0x535e65[_0x42d178(0x21c)]('✓')+'\x20('+_0x1e6a64+')'):console[_0x42d178(0x1e2)](_0x42d178(0x20e)+(_0x541cad+0x1)+'/'+_0x40a2ff[_0x42d178(0x234)][_0x42d178(0x236)]+'...\x20'+a5_0x535e65[_0x42d178(0x221)]('✗'));},'onEvaluationStart':()=>{_0x3560ab['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x25cc0e=>{const _0x2dad6b=_0x5d3168,_0x41e5bc=formatElapsed(_0x25cc0e);console[_0x2dad6b(0x1e2)](_0x2dad6b(0x233)+a5_0x535e65['green']('✓')+'\x20('+_0x41e5bc+')');}});_0x3560ab[_0x5d3168(0x208)](),_0x11b139[_0x5d3168(0x1e7)](_0x534a85);if(_0x534a85[_0x5d3168(0x1ff)]===_0x5d3168(0x214))console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x21c)](_0x5d3168(0x1d9)+_0x534a85[_0x5d3168(0x1f2)])+a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1fa)));else _0x534a85[_0x5d3168(0x1ff)]==='FAIL'?console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x221)]('✗\x20FAIL:\x20'+_0x534a85[_0x5d3168(0x1f2)])+a5_0x535e65['dim'](_0x5d3168(0x1fa))):console[_0x5d3168(0x1e2)](a5_0x535e65['red']('✗\x20ERROR:\x20'+_0x534a85['reason']));_0x534a85[_0x5d3168(0x22d)]&&console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1e9)+_0x534a85[_0x5d3168(0x22d)]));}catch(_0x1bd828){_0x3560ab['stop']();const _0x75b159=_0x1bd828 instanceof Error?_0x1bd828[_0x5d3168(0x22e)]:String(_0x1bd828);console[_0x5d3168(0x1e2)](a5_0x535e65['red'](_0x5d3168(0x25e)+_0x75b159)),_0x11b139[_0x5d3168(0x1e7)]({'name':_0x40a2ff[_0x5d3168(0x22a)],'status':_0x5d3168(0x245),'reason':_0x75b159,'timestamp':new Date()[_0x5d3168(0x247)](),'duration_ms':0x0});}}}console[_0x5d3168(0x1e2)]();const _0x51ca6f=Date['now']()-_0x185af4,_0x387ab4=_0x11b139[_0x5d3168(0x238)](_0x46507c=>_0x46507c[_0x5d3168(0x1ff)]==='PASS')[_0x5d3168(0x236)],_0x50f358=_0x11b139['filter'](_0x2fca2c=>_0x2fca2c[_0x5d3168(0x1ff)]===_0x5d3168(0x1fe))[_0x5d3168(0x236)],_0x4b0a30=_0x11b139[_0x5d3168(0x238)](_0x13e8df=>_0x13e8df[_0x5d3168(0x1ff)]==='ERROR')[_0x5d3168(0x236)];console[_0x5d3168(0x1e2)]('━'[_0x5d3168(0x25b)](0x3c)),console[_0x5d3168(0x1e2)](_0x5d3168(0x20a)),console[_0x5d3168(0x1e2)]('━'[_0x5d3168(0x25b)](0x3c)),console[_0x5d3168(0x1e2)](_0x5d3168(0x25d)+_0x11b139[_0x5d3168(0x236)]),console[_0x5d3168(0x1e2)](_0x5d3168(0x20b)+a5_0x535e65['green'](_0x387ab4)),console[_0x5d3168(0x1e2)](_0x5d3168(0x22c)+a5_0x535e65[_0x5d3168(0x221)](_0x50f358));_0x4b0a30>0x0&&console[_0x5d3168(0x1e2)]('Errors:\x20\x20\x20'+a5_0x535e65['red'](_0x4b0a30));console[_0x5d3168(0x1e2)]('Duration:\x20'+formatElapsed(_0x51ca6f)),console[_0x5d3168(0x1e2)]('━'[_0x5d3168(0x25b)](0x3c));const _0x79a5af={'summary':{'total':_0x11b139['length'],'passed':_0x387ab4,'failed':_0x50f358,'errors':_0x4b0a30>0x0?_0x4b0a30:undefined,'duration_ms':_0x51ca6f},'tests':_0x11b139,'agent':{'project':_0x4b8a7f['projectName'],'name':_0x4b8a7f['agentName'],'site':_0x2c27b9},'timestamp':new Date(_0x185af4)[_0x5d3168(0x247)]()};if(_0x4fb726!=='table'||_0x1ea26c){const _0x3099df=formatResults(_0x79a5af,_0x4fb726);if(_0x1ea26c)try{a5_0xabfca1[_0x5d3168(0x1f4)](_0x1ea26c,_0x3099df,'utf-8'),console['log'](),console[_0x5d3168(0x1e2)](a5_0x535e65['dim'](_0x5d3168(0x246)+_0x1ea26c));}catch(_0x319893){return console['log'](),console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x221)](_0x5d3168(0x1d0)+_0x319893)),0x1;}else console[_0x5d3168(0x1e2)](),console[_0x5d3168(0x1e2)](_0x3099df);}const _0x53f4fc=_0x11b139['filter'](_0x5b5a10=>_0x5b5a10[_0x5d3168(0x1ff)]!=='PASS');return _0x53f4fc[_0x5d3168(0x236)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x45ea84=a5_0x1aa3;(function(_0x51a771,_0x1727cc){const _0x2eee3e=a5_0x1aa3,_0x3f3390=_0x51a771();while(!![]){try{const _0x17d631=parseInt(_0x2eee3e(0x15b))/0x1+parseInt(_0x2eee3e(0x103))/0x2+parseInt(_0x2eee3e(0xfe))/0x3+parseInt(_0x2eee3e(0xdc))/0x4*(-parseInt(_0x2eee3e(0xff))/0x5)+parseInt(_0x2eee3e(0x152))/0x6*(parseInt(_0x2eee3e(0xf8))/0x7)+parseInt(_0x2eee3e(0xe3))/0x8*(parseInt(_0x2eee3e(0xfa))/0x9)+-parseInt(_0x2eee3e(0x123))/0xa*(parseInt(_0x2eee3e(0xc7))/0xb);if(_0x17d631===_0x1727cc)break;else _0x3f3390['push'](_0x3f3390['shift']());}catch(_0x24be6a){_0x3f3390['push'](_0x3f3390['shift']());}}}(a5_0x171d,0xe1d57));import*as a5_0x42099a from'node:fs';import*as a5_0x372e60 from'node:path';import a5_0x510f51 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';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x171d(){const _0x4348c6=['timestamp','No\x20tests\x20found\x20matching:\x20','agentName','length','5104688OKjVWU','✗\x20ERROR:\x20Project\x20not\x20found:\x20','tsv','✗\x20FAIL:\x20','/<agent-name>','stop','Executing\x20new\x20tests...','agent','Error:\x20No\x20previous\x20test\x20run\x20found.','white','\x20(cached)','resolveAgentId','isSpinning','not\x20found','\x20\x20-\x20','toISOString','split','substring','\x20\x20Agent:\x20','Passed:\x20\x20\x20','Failed:\x20\x20\x20','7jilSrR','find','9QtqZaw','testYmlPath','\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','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','3071466olRCNf','8215ACGQpc','site','Test\x20','Re-evaluation\x20Summary','1203192RgspiN',':\x20Sending\x20user\x20input...','llm','context','now','Re-evaluating...','source','conversation_url','FAIL','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x27\x20to\x20create\x20the\x20folder\x20structure.','text','Site:\x20','Evaluating\x20response...','output','\x20\x20Round\x20','dim','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x22:\x20','PASS','Conversation\x20URL:\x20','404','message','verbose','Using\x20agent:\x20','json','Run\x20\x27tdx\x20agent\x20pull\x20','has','ERROR','eval','Errors:\x20\x20\x20','reason','517830kSiMVe','...','round','utf-8','filter','toLowerCase','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','log','Available\x20tests:\x20','yellow','Usage:','no_tests','\x20-\x20','writeFileSync','no_context','Duration:\x20','Cached\x20run\x20from:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','trim','New\x20tests\x20to\x20execute:\x20','execute','Running\x20agent\x20tests...','table','green','No\x20tests\x20have\x20tags\x20defined.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','tags','Test\x20Configuration:','llmProject','some','rounds','Running:\x20','found','executeReeval','cyan','test.yml','agent:test','basename','Round\x20','forEach','jsonl','join','tests','✓\x20PASS:\x20','name','existsSync','repeat','5522658LnMeGX','Run\x20tests\x20for\x20an\x20LLM\x20agent','Available\x20tags:\x20','dryRun','...\x20','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','description','1216194VZtJia','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','map','704DkkwRf','includes','Either\x20switch\x20to\x20the\x20\x22','start','red','conversations','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Test\x20Summary','projectDir','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20Evaluating...\x20','\x20(new)','\x22,\x20but\x20current\x20site\x20is\x20\x22','Output\x20written\x20to:\x20','Round\x201/','\x20\x20Site:\x20','Tests\x20found:\x20','resolve','projectName','push','status','392aXmcPJ','add','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'];a5_0x171d=function(){return _0x4348c6;};return a5_0x171d();}function a5_0x1aa3(_0x32e5c5,_0x30ffae){_0x32e5c5=_0x32e5c5-0xc4;const _0x171db1=a5_0x171d();let _0x1aa397=_0x171db1[_0x32e5c5];return _0x1aa397;}export class AgentTestCommand extends BaseCommand{[a5_0x45ea84(0x14f)]=a5_0x45ea84(0x147);[a5_0x45ea84(0x15a)]=a5_0x45ea84(0x153);async[a5_0x45ea84(0x137)](_0x593d92){const _0x5a74d8=a5_0x45ea84,{options:_0x348214,args:_0xb19c43,tdx:_0x27a4d3}=_0x593d92,_0x51c3dc=_0xb19c43[0x0]||'.',_0x40121d=_0x348214[_0x5a74d8(0x155)],_0x38a6bf=_0x348214,_0x5b9142=_0x38a6bf[_0x5a74d8(0x120)]===![],_0x11eef2=_0x38a6bf['reeval'],_0x39048f=_0x38a6bf[_0x5a74d8(0x14f)],_0x27cc20=_0x38a6bf[_0x5a74d8(0x13d)],_0x336549=_0x348214['site'],_0x37a8d8=_0x38a6bf[_0x5a74d8(0x111)];if(_0x11eef2&&_0x5b9142)return console[_0x5a74d8(0x12a)](a5_0x510f51['red'](_0x5a74d8(0x134))),0x1;let _0xea69b5=_0x5a74d8(0x139);if(_0x38a6bf[_0x5a74d8(0x11c)])_0xea69b5=_0x5a74d8(0x11c);else{if(_0x38a6bf[_0x5a74d8(0x14b)])_0xea69b5=_0x5a74d8(0x14b);else{if(_0x38a6bf[_0x5a74d8(0xe5)])_0xea69b5='tsv';else{if(_0x38a6bf[_0x5a74d8(0x139)])_0xea69b5=_0x5a74d8(0x139);}}}const _0x831991=_0x38a6bf[_0x5a74d8(0x13f)];let _0x4fdf95=_0x51c3dc;const _0x4aa80b=a5_0x42099a[_0x5a74d8(0x150)](_0x51c3dc),_0x2d8e13=_0x51c3dc==='.';if(!_0x4aa80b||_0x2d8e13){const _0x2d5b23=resolveProjectFromContext(_0x51c3dc,_0x831991,{'requireFile':_0x5a74d8(0x146)});if(_0x2d5b23[_0x5a74d8(0x143)])_0x4fdf95=_0x2d5b23['projectDir'],_0x2d5b23[_0x5a74d8(0x109)]===_0x5a74d8(0x106)&&console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x113)](_0x5a74d8(0x11b)+_0x4fdf95));else switch(_0x2d5b23[_0x5a74d8(0x122)]){case _0x5a74d8(0x131):console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x12c)](_0x2d5b23[_0x5a74d8(0x119)])),console[_0x5a74d8(0x12a)](),console[_0x5a74d8(0x12a)](_0x5a74d8(0x12d)),console[_0x5a74d8(0x12a)](_0x5a74d8(0xfc)),console[_0x5a74d8(0x12a)]('\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[_0x5a74d8(0x12a)](),console[_0x5a74d8(0x12a)](_0x5a74d8(0x129));return 0x1;case'no_local_folder':console['log'](a5_0x510f51[_0x5a74d8(0x12c)](_0x2d5b23[_0x5a74d8(0x119)])),console['log'](),console[_0x5a74d8(0x12a)](_0x5a74d8(0x11d)+_0x2d5b23['llmProject']+_0x5a74d8(0x10d));return 0x1;case'multiple_agents':{const _0x1722d1=a5_0x372e60[_0x5a74d8(0x148)](_0x2d5b23['projectDir']);console[_0x5a74d8(0x12a)](a5_0x510f51['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x2d5b23[_0x5a74d8(0x13f)]+'\x22:'));for(const _0x4df6d9 of _0x2d5b23['agentDirs']){console[_0x5a74d8(0x12a)](_0x5a74d8(0xf1)+_0x4df6d9);}return console[_0x5a74d8(0x12a)](),console[_0x5a74d8(0x12a)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1722d1+_0x5a74d8(0xe7)),0x1;}case _0x5a74d8(0x12e):console[_0x5a74d8(0x12a)](a5_0x510f51['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x2d5b23[_0x5a74d8(0x13f)]+'\x22.')),console[_0x5a74d8(0x12a)](a5_0x510f51['dim']('Project\x20path:\x20'+_0x2d5b23[_0x5a74d8(0xcf)])),console['log'](),console['log'](_0x5a74d8(0xc5));return 0x1;}}const {definition:_0x5a9f83,agentInfo:_0x228688}=parseTestFile(_0x4fdf95);let _0xaa86e3=_0x5a9f83[_0x5a74d8(0x14d)];if(_0x39048f){const _0x37a9e5=_0x39048f[_0x5a74d8(0xf3)](',')[_0x5a74d8(0xc6)](_0x426537=>_0x426537[_0x5a74d8(0x135)]());_0xaa86e3=_0x5a9f83[_0x5a74d8(0x14d)][_0x5a74d8(0x127)](_0x3f0976=>_0x37a9e5['includes'](_0x3f0976[_0x5a74d8(0x14f)]));if(_0xaa86e3['length']===0x0)return console[_0x5a74d8(0x12a)](a5_0x510f51['yellow'](_0x5a74d8(0xe0)+_0x39048f)),console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x113)](_0x5a74d8(0x12b)+_0x5a9f83[_0x5a74d8(0x14d)]['map'](_0x36235e=>_0x36235e[_0x5a74d8(0x14f)])[_0x5a74d8(0x14c)](',\x20'))),0x1;}if(_0x27cc20){const _0xdc6f00=_0x27cc20[_0x5a74d8(0xf3)](',')[_0x5a74d8(0xc6)](_0x3af950=>_0x3af950['trim']()['toLowerCase']());_0xaa86e3=_0xaa86e3[_0x5a74d8(0x127)](_0x5b773b=>_0x5b773b[_0x5a74d8(0x13d)]?.[_0x5a74d8(0x140)](_0xeec1c6=>_0xdc6f00[_0x5a74d8(0xc8)](_0xeec1c6[_0x5a74d8(0x128)]())));if(_0xaa86e3[_0x5a74d8(0xe2)]===0x0){console['log'](a5_0x510f51[_0x5a74d8(0x12c)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x27cc20));const _0x8e810a=new Set();return _0x5a9f83[_0x5a74d8(0x14d)]['forEach'](_0x310639=>_0x310639[_0x5a74d8(0x13d)]?.[_0x5a74d8(0x14a)](_0x1b6692=>_0x8e810a[_0x5a74d8(0xdd)](_0x1b6692))),_0x8e810a['size']>0x0?console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x113)](_0x5a74d8(0x154)+[..._0x8e810a][_0x5a74d8(0x14c)](',\x20'))):console['log'](a5_0x510f51[_0x5a74d8(0x113)](_0x5a74d8(0x13b))),0x1;}}if(_0x11eef2)return this[_0x5a74d8(0x144)](_0x593d92,{'definition':{'tests':_0xaa86e3},'agentInfo':_0x228688,'outputFormat':_0xea69b5,'outputFile':_0x37a8d8,'testNames':_0x39048f});if(_0x40121d){console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x145)](_0x5a74d8(0x13e))),console['log'](_0x5a74d8(0xd6)+a5_0x510f51['white'](_0x336549)),console[_0x5a74d8(0x12a)]('\x20\x20Project:\x20'+a5_0x510f51['white'](_0x228688[_0x5a74d8(0xd9)])),console[_0x5a74d8(0x12a)](_0x5a74d8(0xf5)+a5_0x510f51['white'](_0x228688['agentName'])),console['log'](),console[_0x5a74d8(0x12a)](_0x5a74d8(0xd7)+a5_0x510f51[_0x5a74d8(0xec)](_0xaa86e3['length']));for(let _0x4a1b4f=0x0;_0x4a1b4f<_0xaa86e3[_0x5a74d8(0xe2)];_0x4a1b4f++){const _0x298a3a=_0xaa86e3[_0x4a1b4f],_0x2c2e05=_0x298a3a[_0x5a74d8(0x141)][_0x5a74d8(0xe2)]===0x1?_0x5a74d8(0x125):_0x5a74d8(0x141),_0x2bd711=_0x298a3a[_0x5a74d8(0x13d)]?.[_0x5a74d8(0xe2)]?'\x20['+_0x298a3a[_0x5a74d8(0x13d)][_0x5a74d8(0x14c)](',\x20')+']':'';console[_0x5a74d8(0x12a)]('\x20\x20'+(_0x4a1b4f+0x1)+'.\x20'+a5_0x510f51[_0x5a74d8(0xec)](_0x298a3a['name'])+'\x20('+_0x298a3a['rounds'][_0x5a74d8(0xe2)]+'\x20'+_0x2c2e05+')'+a5_0x510f51[_0x5a74d8(0x113)](_0x2bd711));}return 0x0;}let _0x2b8d8d,_0x13c5ac;try{_0x2b8d8d=await _0x27a4d3[_0x5a74d8(0x105)]['resolveProjectId'](_0x228688['projectName']);}catch(_0xe90647){const _0x8fd163=_0xe90647 instanceof Error?_0xe90647[_0x5a74d8(0x119)]:String(_0xe90647);return _0x8fd163[_0x5a74d8(0xc8)](_0x5a74d8(0x118))||_0x8fd163[_0x5a74d8(0x128)]()[_0x5a74d8(0xc8)](_0x5a74d8(0xf0))?console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0xcb)](_0x5a74d8(0xe4)+_0x228688[_0x5a74d8(0xd9)])):console['log'](a5_0x510f51[_0x5a74d8(0xcb)](_0x5a74d8(0x114)+_0x228688[_0x5a74d8(0xd9)]+_0x5a74d8(0x115)+_0x8fd163)),0x1;}try{_0x13c5ac=await _0x27a4d3[_0x5a74d8(0x105)][_0x5a74d8(0xee)](_0x228688[_0x5a74d8(0xe1)],_0x2b8d8d);}catch(_0x327bab){const _0x10439c=_0x327bab instanceof Error?_0x327bab[_0x5a74d8(0x119)]:String(_0x327bab);return _0x10439c[_0x5a74d8(0xc8)](_0x5a74d8(0x118))||_0x10439c[_0x5a74d8(0x128)]()[_0x5a74d8(0xc8)](_0x5a74d8(0xf0))?console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0xcb)](_0x5a74d8(0xc4)+_0x228688[_0x5a74d8(0xe1)])):console[_0x5a74d8(0x12a)](a5_0x510f51['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x228688[_0x5a74d8(0xe1)]+'\x22:\x20'+_0x10439c)),0x1;}let _0x19742d;if(!_0x5b9142)try{_0x19742d=await setupEvaluatorAgent(_0x27a4d3[_0x5a74d8(0x105)],_0x348214[_0x5a74d8(0x11a)]);}catch(_0x45cca9){const _0x4123ad=_0x45cca9 instanceof Error?_0x45cca9[_0x5a74d8(0x119)]:String(_0x45cca9);return console['log'](a5_0x510f51[_0x5a74d8(0xcb)](_0x5a74d8(0xde)+_0x4123ad)),0x1;}console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x145)](_0x5a74d8(0x138))),console[_0x5a74d8(0x12a)](_0x5a74d8(0x10f)+a5_0x510f51[_0x5a74d8(0xec)](_0x336549)),console[_0x5a74d8(0x12a)]('Agent:\x20'+a5_0x510f51[_0x5a74d8(0xec)](_0x228688[_0x5a74d8(0xd9)]+'/'+_0x228688[_0x5a74d8(0xe1)])),console[_0x5a74d8(0x12a)]();const _0x2f3707=[],_0x87fda1=[],_0x1a027f=Date[_0x5a74d8(0x107)]();for(let _0x58a4c8=0x0;_0x58a4c8<_0xaa86e3[_0x5a74d8(0xe2)];_0x58a4c8++){const _0x50a7a2=_0xaa86e3[_0x58a4c8];_0xaa86e3[_0x5a74d8(0xe2)]>0x1?console[_0x5a74d8(0x12a)](_0x5a74d8(0x101)+(_0x58a4c8+0x1)+'/'+_0xaa86e3['length']+':\x20'+a5_0x510f51['white'](_0x50a7a2['name'])):console[_0x5a74d8(0x12a)]('Running\x20test:\x20'+a5_0x510f51['white'](_0x50a7a2[_0x5a74d8(0x14f)]));const _0xe1e7cd=createCommandSpinner(_0x5a74d8(0xd5)+_0x50a7a2[_0x5a74d8(0x141)]['length']+_0x5a74d8(0x104));_0xe1e7cd[_0x5a74d8(0xca)]();try{const {result:_0x43c56e,conversation:_0x4a6718}=await runTest(_0x27a4d3['llm'],_0x50a7a2,{'agentId':_0x13c5ac,'projectId':_0x2b8d8d,'site':_0x336549,'noEval':_0x5b9142,'evaluatorId':_0x19742d,'onRoundStart':(_0x49993f,_0x563980)=>{const _0x4edcca=_0x5a74d8;_0xe1e7cd[_0x4edcca(0x10e)]='Round\x20'+(_0x49993f+0x1)+'/'+_0x563980+_0x4edcca(0x104);},'onRoundComplete':(_0x46f0d8,_0x58419e,_0x29d0a0)=>{const _0x510963=_0x5a74d8,_0x2757d6=formatElapsed(_0x58419e);_0x29d0a0?console[_0x510963(0x12a)](_0x510963(0x112)+(_0x46f0d8+0x1)+'/'+_0x50a7a2[_0x510963(0x141)]['length']+_0x510963(0x156)+a5_0x510f51[_0x510963(0x13a)]('✓')+'\x20('+_0x2757d6+')'):console[_0x510963(0x12a)](_0x510963(0x112)+(_0x46f0d8+0x1)+'/'+_0x50a7a2['rounds']['length']+_0x510963(0x156)+a5_0x510f51[_0x510963(0xcb)]('✗'));},'onEvaluationStart':()=>{const _0x185048=_0x5a74d8;_0xe1e7cd[_0x185048(0x10e)]=_0x185048(0x110);},'onEvaluationComplete':_0x483976=>{const _0x382be1=_0x5a74d8,_0x4d9b78=formatElapsed(_0x483976);console[_0x382be1(0x12a)](_0x382be1(0xd1)+a5_0x510f51[_0x382be1(0x13a)]('✓')+'\x20('+_0x4d9b78+')');}});_0xe1e7cd[_0x5a74d8(0xe8)](),_0x2f3707[_0x5a74d8(0xda)](_0x43c56e),_0x87fda1['push'](_0x4a6718);if(_0x43c56e['status']==='PASS')console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x13a)](_0x5a74d8(0x14e)+_0x43c56e[_0x5a74d8(0x122)]));else _0x43c56e[_0x5a74d8(0xdb)]===_0x5a74d8(0x10b)?console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0xcb)]('✗\x20FAIL:\x20'+_0x43c56e['reason'])):console[_0x5a74d8(0x12a)](a5_0x510f51['red'](_0x5a74d8(0x158)+_0x43c56e[_0x5a74d8(0x122)]));_0x43c56e['conversation_url']&&console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0x113)](_0x5a74d8(0x117)+_0x43c56e[_0x5a74d8(0x10a)])),console[_0x5a74d8(0x12a)]();}catch(_0x36277e){_0xe1e7cd[_0x5a74d8(0xe8)]();const _0x4d2bfc=_0x36277e instanceof Error?_0x36277e[_0x5a74d8(0x119)]:String(_0x36277e);console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0xcb)](_0x5a74d8(0x158)+_0x4d2bfc)),console['log'](),_0x2f3707[_0x5a74d8(0xda)]({'name':_0x50a7a2[_0x5a74d8(0x14f)],'status':'ERROR','reason':_0x4d2bfc,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x31e988=Date[_0x5a74d8(0x107)]()-_0x1a027f,_0x9109cf=_0x2f3707['filter'](_0x1ab51d=>_0x1ab51d['status']===_0x5a74d8(0x116))[_0x5a74d8(0xe2)],_0x28b128=_0x2f3707[_0x5a74d8(0x127)](_0x28be76=>_0x28be76[_0x5a74d8(0xdb)]===_0x5a74d8(0x10b))[_0x5a74d8(0xe2)],_0x1514ec=_0x2f3707[_0x5a74d8(0x127)](_0x28e354=>_0x28e354[_0x5a74d8(0xdb)]===_0x5a74d8(0x11f))['length'];console[_0x5a74d8(0x12a)]('━'['repeat'](0x3c)),console[_0x5a74d8(0x12a)](_0x5a74d8(0xce)),console[_0x5a74d8(0x12a)]('━'[_0x5a74d8(0x151)](0x3c)),console[_0x5a74d8(0x12a)](_0x5a74d8(0x157)+_0x2f3707[_0x5a74d8(0xe2)]),console[_0x5a74d8(0x12a)]('Passed:\x20\x20\x20'+a5_0x510f51[_0x5a74d8(0x13a)](_0x9109cf)),console[_0x5a74d8(0x12a)]('Failed:\x20\x20\x20'+a5_0x510f51[_0x5a74d8(0xcb)](_0x28b128));_0x1514ec>0x0&&console[_0x5a74d8(0x12a)](_0x5a74d8(0x121)+a5_0x510f51[_0x5a74d8(0xcb)](_0x1514ec));console[_0x5a74d8(0x12a)](_0x5a74d8(0x132)+formatElapsed(_0x31e988)),console[_0x5a74d8(0x12a)]('━'[_0x5a74d8(0x151)](0x3c));const _0x3bf9f9=_0x2f3707[_0x5a74d8(0x127)](_0x4be765=>_0x4be765['status']!==_0x5a74d8(0x116));if(_0x3bf9f9[_0x5a74d8(0xe2)]>0x0){console[_0x5a74d8(0x12a)](),console[_0x5a74d8(0x12a)]('Failed\x20Tests:');for(const _0x554d26 of _0x3bf9f9){const _0xd276a4=a5_0x510f51[_0x5a74d8(0xcb)]('✗'),_0x3a6071=_0x554d26['reason']['length']>0x32?_0x554d26[_0x5a74d8(0x122)][_0x5a74d8(0xf4)](0x0,0x32)+_0x5a74d8(0x124):_0x554d26[_0x5a74d8(0x122)];console['log']('\x20\x20'+_0xd276a4+'\x20'+_0x554d26[_0x5a74d8(0x14f)]+':\x20'+_0x3a6071);}}const _0x246cea={'summary':{'total':_0x2f3707[_0x5a74d8(0xe2)],'passed':_0x9109cf,'failed':_0x28b128,'errors':_0x1514ec>0x0?_0x1514ec:undefined,'duration_ms':_0x31e988},'tests':_0x2f3707,'agent':{'project':_0x228688[_0x5a74d8(0xd9)],'name':_0x228688['agentName'],'site':_0x336549},'timestamp':new Date(_0x1a027f)[_0x5a74d8(0xf2)]()};try{const _0x5b8349=buildCachedTestRun(_0x87fda1,{'site':_0x336549,'projectId':_0x2b8d8d,'projectName':_0x228688[_0x5a74d8(0xd9)],'agentId':_0x13c5ac,'agentName':_0x228688['agentName'],'testYmlPath':a5_0x372e60[_0x5a74d8(0xd8)](_0x228688[_0x5a74d8(0xfb)])});saveLastTestRun(_0x5b8349);}catch{}if(_0xea69b5!==_0x5a74d8(0x139)||_0x37a8d8){const _0x5da839=formatResults(_0x246cea,_0xea69b5);if(_0x37a8d8)try{a5_0x42099a['writeFileSync'](_0x37a8d8,_0x5da839,_0x5a74d8(0x126)),console[_0x5a74d8(0x12a)](),console[_0x5a74d8(0x12a)](a5_0x510f51['dim'](_0x5a74d8(0xd4)+_0x37a8d8));}catch(_0x394af4){return console['log'](),console[_0x5a74d8(0x12a)](a5_0x510f51[_0x5a74d8(0xcb)]('Error\x20writing\x20output\x20file:\x20'+_0x394af4)),0x1;}else console[_0x5a74d8(0x12a)](),console['log'](_0x5da839);}return _0x3bf9f9[_0x5a74d8(0xe2)]>0x0?0x1:0x0;}async[a5_0x45ea84(0x144)](_0x440129,_0x41ebff){const _0x4195a1=a5_0x45ea84,{options:_0x8f876,tdx:_0x557bfc}=_0x440129,{definition:_0x4c55d2,agentInfo:_0x326d70,outputFormat:_0x23d0ec,outputFile:_0x4e0d19}=_0x41ebff,_0x1ba24a=_0x8f876[_0x4195a1(0x100)],_0x55217c=loadLastTestRun();if(!_0x55217c)return console['log'](a5_0x510f51[_0x4195a1(0xcb)](_0x4195a1(0xeb))),console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0x113)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x55217c[_0x4195a1(0xea)][_0x4195a1(0xe1)]!==_0x326d70[_0x4195a1(0xe1)])return console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0xcb)](_0x4195a1(0x13c)+_0x55217c[_0x4195a1(0xea)]['agentName']+_0x4195a1(0xfd)+_0x326d70[_0x4195a1(0xe1)]+'\x22.')),console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0x113)](_0x4195a1(0xcd))),0x1;const _0x34e048=new Set(_0x55217c[_0x4195a1(0xcc)][_0x4195a1(0xc6)](_0x1c8c09=>_0x1c8c09['testName'])),_0x3e6b97=_0x4c55d2[_0x4195a1(0x14d)][_0x4195a1(0x127)](_0x5a1f69=>!_0x34e048['has'](_0x5a1f69['name']));if(_0x3e6b97[_0x4195a1(0xe2)]>0x0&&_0x55217c['site']!==_0x1ba24a)return console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0xcb)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console['log'](a5_0x510f51[_0x4195a1(0x113)](_0x4195a1(0x159)+_0x55217c[_0x4195a1(0x100)]+_0x4195a1(0xd3)+_0x1ba24a+'\x22.')),console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0x113)](_0x4195a1(0xc9)+_0x55217c['site']+_0x4195a1(0x10c))),0x1;const _0x9c1806=_0x4c55d2[_0x4195a1(0x14d)]['filter'](_0x499e28=>_0x34e048[_0x4195a1(0x11e)](_0x499e28['name'])),_0x2f069f=_0x3e6b97;let _0x2b362e;try{_0x2b362e=await setupEvaluatorAgent(_0x557bfc[_0x4195a1(0x105)],_0x8f876[_0x4195a1(0x11a)]);}catch(_0x375fb8){const _0x343783=_0x375fb8 instanceof Error?_0x375fb8[_0x4195a1(0x119)]:String(_0x375fb8);return console[_0x4195a1(0x12a)](a5_0x510f51['red'](_0x4195a1(0xde)+_0x343783)),0x1;}console[_0x4195a1(0x12a)](a5_0x510f51['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x4195a1(0x133)+a5_0x510f51[_0x4195a1(0xec)](_0x55217c[_0x4195a1(0xdf)])),console[_0x4195a1(0x12a)]('Agent:\x20'+a5_0x510f51[_0x4195a1(0xec)](_0x55217c[_0x4195a1(0xea)][_0x4195a1(0xd9)]+'/'+_0x55217c[_0x4195a1(0xea)][_0x4195a1(0xe1)]));_0x2f069f['length']>0x0&&console['log'](_0x4195a1(0x136)+a5_0x510f51[_0x4195a1(0x12c)](_0x2f069f[_0x4195a1(0xe2)]));console[_0x4195a1(0x12a)]();const _0x12a061=[],_0x44fd35=Date[_0x4195a1(0x107)](),_0x8a4a9b=createCommandSpinner(_0x4195a1(0x108));if(_0x9c1806[_0x4195a1(0xe2)]>0x0)try{const _0x273159=await reevaluateFromCache(_0x557bfc[_0x4195a1(0x105)],_0x55217c,{'tests':_0x9c1806},{'evaluatorId':_0x2b362e,'onTestStart':(_0x1c5677,_0x305edd,_0x5edb9d)=>{const _0x185dfa=_0x4195a1;_0x8a4a9b[_0x185dfa(0x10e)]='Re-evaluating\x20'+(_0x305edd+0x1)+'/'+_0x5edb9d+':\x20'+_0x1c5677+_0x185dfa(0x124);if(!_0x8a4a9b[_0x185dfa(0xef)])_0x8a4a9b[_0x185dfa(0xca)]();},'onTestComplete':(_0x4d1599,_0x1ff286)=>{const _0x277339=_0x4195a1;_0x8a4a9b[_0x277339(0xe8)]();if(_0x1ff286[_0x277339(0xdb)]==='PASS')console[_0x277339(0x12a)](a5_0x510f51[_0x277339(0x13a)](_0x277339(0x14e)+_0x4d1599)+a5_0x510f51[_0x277339(0x113)](_0x277339(0xed)));else _0x1ff286[_0x277339(0xdb)]===_0x277339(0x10b)?console[_0x277339(0x12a)](a5_0x510f51[_0x277339(0xcb)](_0x277339(0xe6)+_0x4d1599+'\x20-\x20'+_0x1ff286[_0x277339(0x122)])+a5_0x510f51[_0x277339(0x113)](_0x277339(0xed))):console['log'](a5_0x510f51[_0x277339(0xcb)](_0x277339(0x158)+_0x4d1599+_0x277339(0x12f)+_0x1ff286['reason']));_0x1ff286[_0x277339(0x10a)]&&console[_0x277339(0x12a)](a5_0x510f51[_0x277339(0x113)]('\x20\x20Conversation:\x20'+_0x1ff286[_0x277339(0x10a)])),_0x12a061['push'](_0x1ff286);},'onTestSkipped':(_0x42ed14,_0x558bbf)=>{const _0x2ddccb=_0x4195a1;_0x8a4a9b[_0x2ddccb(0xe8)](),console[_0x2ddccb(0x12a)](a5_0x510f51['yellow']('⚠\x20SKIPPED:\x20'+_0x42ed14+_0x2ddccb(0x12f)+_0x558bbf));}});for(const _0x43bce2 of _0x273159){!_0x12a061[_0x4195a1(0xf9)](_0x1e3d37=>_0x1e3d37[_0x4195a1(0x14f)]===_0x43bce2[_0x4195a1(0x14f)])&&_0x12a061[_0x4195a1(0xda)](_0x43bce2);}}catch(_0x23c85e){_0x8a4a9b[_0x4195a1(0xe8)]();const _0x66b8e1=_0x23c85e instanceof Error?_0x23c85e[_0x4195a1(0x119)]:String(_0x23c85e);return console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0xcb)](_0x4195a1(0xd0)+_0x66b8e1)),0x1;}_0x8a4a9b[_0x4195a1(0xe8)]();if(_0x2f069f['length']>0x0){console[_0x4195a1(0x12a)](),console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0x145)](_0x4195a1(0xe9)));const {projectId:_0x399d23,agentId:_0x3609c6}=_0x55217c[_0x4195a1(0xea)];for(const _0x2d74bc of _0x2f069f){console[_0x4195a1(0x12a)](_0x4195a1(0x142)+a5_0x510f51['white'](_0x2d74bc['name']));const _0x1af958=createCommandSpinner(_0x4195a1(0xd5)+_0x2d74bc['rounds'][_0x4195a1(0xe2)]+_0x4195a1(0x104));_0x1af958[_0x4195a1(0xca)]();try{const {result:_0xb42236}=await runTest(_0x557bfc[_0x4195a1(0x105)],_0x2d74bc,{'agentId':_0x3609c6,'projectId':_0x399d23,'site':_0x55217c['site'],'noEval':![],'evaluatorId':_0x2b362e,'onRoundStart':(_0x143adc,_0x465a0f)=>{const _0x320e72=_0x4195a1;_0x1af958[_0x320e72(0x10e)]=_0x320e72(0x149)+(_0x143adc+0x1)+'/'+_0x465a0f+_0x320e72(0x104);},'onRoundComplete':(_0x4a9e61,_0x1a0c20,_0x469468)=>{const _0x3691d0=_0x4195a1,_0x96b589=formatElapsed(_0x1a0c20);_0x469468?console[_0x3691d0(0x12a)]('\x20\x20Round\x20'+(_0x4a9e61+0x1)+'/'+_0x2d74bc['rounds'][_0x3691d0(0xe2)]+_0x3691d0(0x156)+a5_0x510f51[_0x3691d0(0x13a)]('✓')+'\x20('+_0x96b589+')'):console[_0x3691d0(0x12a)](_0x3691d0(0x112)+(_0x4a9e61+0x1)+'/'+_0x2d74bc[_0x3691d0(0x141)][_0x3691d0(0xe2)]+_0x3691d0(0x156)+a5_0x510f51['red']('✗'));},'onEvaluationStart':()=>{const _0x266337=_0x4195a1;_0x1af958[_0x266337(0x10e)]=_0x266337(0x110);},'onEvaluationComplete':_0x170c1d=>{const _0x42ca85=_0x4195a1,_0x5d8545=formatElapsed(_0x170c1d);console[_0x42ca85(0x12a)]('\x20\x20Evaluating...\x20'+a5_0x510f51[_0x42ca85(0x13a)]('✓')+'\x20('+_0x5d8545+')');}});_0x1af958[_0x4195a1(0xe8)](),_0x12a061[_0x4195a1(0xda)](_0xb42236);if(_0xb42236[_0x4195a1(0xdb)]===_0x4195a1(0x116))console[_0x4195a1(0x12a)](a5_0x510f51['green'](_0x4195a1(0x14e)+_0xb42236['reason'])+a5_0x510f51[_0x4195a1(0x113)](_0x4195a1(0xd2)));else _0xb42236['status']===_0x4195a1(0x10b)?console[_0x4195a1(0x12a)](a5_0x510f51['red'](_0x4195a1(0xe6)+_0xb42236[_0x4195a1(0x122)])+a5_0x510f51[_0x4195a1(0x113)]('\x20(new)')):console[_0x4195a1(0x12a)](a5_0x510f51['red']('✗\x20ERROR:\x20'+_0xb42236[_0x4195a1(0x122)]));_0xb42236[_0x4195a1(0x10a)]&&console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0x113)]('\x20\x20Conversation:\x20'+_0xb42236[_0x4195a1(0x10a)]));}catch(_0x1e6b7c){_0x1af958['stop']();const _0x47075b=_0x1e6b7c instanceof Error?_0x1e6b7c[_0x4195a1(0x119)]:String(_0x1e6b7c);console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0xcb)](_0x4195a1(0x158)+_0x47075b)),_0x12a061[_0x4195a1(0xda)]({'name':_0x2d74bc[_0x4195a1(0x14f)],'status':'ERROR','reason':_0x47075b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x4195a1(0x12a)]();const _0x8387cd=Date[_0x4195a1(0x107)]()-_0x44fd35,_0x12f96b=_0x12a061[_0x4195a1(0x127)](_0x387d39=>_0x387d39[_0x4195a1(0xdb)]===_0x4195a1(0x116))[_0x4195a1(0xe2)],_0x4c4b48=_0x12a061['filter'](_0x17c36f=>_0x17c36f[_0x4195a1(0xdb)]===_0x4195a1(0x10b))['length'],_0x54de30=_0x12a061[_0x4195a1(0x127)](_0x25eec6=>_0x25eec6[_0x4195a1(0xdb)]===_0x4195a1(0x11f))[_0x4195a1(0xe2)];console[_0x4195a1(0x12a)]('━'[_0x4195a1(0x151)](0x3c)),console[_0x4195a1(0x12a)](_0x4195a1(0x102)),console[_0x4195a1(0x12a)]('━'[_0x4195a1(0x151)](0x3c)),console[_0x4195a1(0x12a)]('Total:\x20\x20\x20\x20'+_0x12a061[_0x4195a1(0xe2)]),console[_0x4195a1(0x12a)](_0x4195a1(0xf6)+a5_0x510f51['green'](_0x12f96b)),console[_0x4195a1(0x12a)](_0x4195a1(0xf7)+a5_0x510f51[_0x4195a1(0xcb)](_0x4c4b48));_0x54de30>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x510f51['red'](_0x54de30));console[_0x4195a1(0x12a)](_0x4195a1(0x132)+formatElapsed(_0x8387cd)),console[_0x4195a1(0x12a)]('━'[_0x4195a1(0x151)](0x3c));const _0x425ce5={'summary':{'total':_0x12a061[_0x4195a1(0xe2)],'passed':_0x12f96b,'failed':_0x4c4b48,'errors':_0x54de30>0x0?_0x54de30:undefined,'duration_ms':_0x8387cd},'tests':_0x12a061,'agent':{'project':_0x326d70[_0x4195a1(0xd9)],'name':_0x326d70['agentName'],'site':_0x1ba24a},'timestamp':new Date(_0x44fd35)[_0x4195a1(0xf2)]()};if(_0x23d0ec!==_0x4195a1(0x139)||_0x4e0d19){const _0x5f2a2b=formatResults(_0x425ce5,_0x23d0ec);if(_0x4e0d19)try{a5_0x42099a[_0x4195a1(0x130)](_0x4e0d19,_0x5f2a2b,'utf-8'),console['log'](),console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0x113)](_0x4195a1(0xd4)+_0x4e0d19));}catch(_0x21efa1){return console[_0x4195a1(0x12a)](),console[_0x4195a1(0x12a)](a5_0x510f51[_0x4195a1(0xcb)]('Error\x20writing\x20output\x20file:\x20'+_0x21efa1)),0x1;}else console['log'](),console[_0x4195a1(0x12a)](_0x5f2a2b);}const _0x5dcdb7=_0x12a061[_0x4195a1(0x127)](_0x41a2ea=>_0x41a2ea['status']!==_0x4195a1(0x116));return _0x5dcdb7[_0x4195a1(0xe2)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a6_0x22af(_0x43268c,_0x3f5c3e){_0x43268c=_0x43268c-0xbc;const _0x7b01cb=a6_0x7b01();let _0x22afb=_0x7b01cb[_0x43268c];return _0x22afb;}const a6_0x55f7ed=a6_0x22af;(function(_0x52cd80,_0x37c2de){const _0x20e773=a6_0x22af,_0x450662=_0x52cd80();while(!![]){try{const _0x47081d=parseInt(_0x20e773(0xea))/0x1+-parseInt(_0x20e773(0xd5))/0x2*(-parseInt(_0x20e773(0xf5))/0x3)+parseInt(_0x20e773(0xcf))/0x4*(parseInt(_0x20e773(0xf4))/0x5)+-parseInt(_0x20e773(0xc8))/0x6+parseInt(_0x20e773(0xc3))/0x7*(-parseInt(_0x20e773(0xbf))/0x8)+parseInt(_0x20e773(0xd7))/0x9+-parseInt(_0x20e773(0xf2))/0xa;if(_0x47081d===_0x37c2de)break;else _0x450662['push'](_0x450662['shift']());}catch(_0x42f4eb){_0x450662['push'](_0x450662['shift']());}}}(a6_0x7b01,0x275b8));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x7b01(){const _0x3eba3f=['toUpperCase','21145QfYxBw','21lpjuIJ','log','cdp','proxy-authorization','error','GET','Invalid\x20header\x20format:\x20\x22','indexOf','POST','header','message','\x0aStack\x20trace:\x0a','body','request','join','404872pgcMKp','has','set-cookie','headers','14WCjbTH','file','DELETE','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','workflow','354810VyiUfD','method','substring','llm-proxy','.\x20Valid\x20types:\x20','.\x20Valid\x20methods:\x20','PUT','208RjsRuZ','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','\x22.\x20','color','set-cookie2','trim','65790RFiVZQ','llm','1990197bbQNQK','data','validate','Invalid\x20API\x20type:\x20','Error:\x20','name','startsWith','description','<\x20HTTP/1.1\x20','Results\x20saved\x20to\x20','authorization','keys','x-xsrf-token','x-trino-user','PATCH','stack','cookie','trino','x-auth-token','274524TfyaWM','includes','entries','api','readBodyFromFile','status','noColor','output','6242690CcDkjt'];a6_0x7b01=function(){return _0x3eba3f;};return a6_0x7b01();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x55f7ed(0xe1),a6_0x55f7ed(0xf8),a6_0x55f7ed(0xe7),a6_0x55f7ed(0xc1),a6_0x55f7ed(0xd3),a6_0x55f7ed(0xe3),a6_0x55f7ed(0xe9),a6_0x55f7ed(0xe4)]);function isSensitiveHeader(_0x4d7ba4){const _0x218875=a6_0x55f7ed;return SENSITIVE_HEADERS[_0x218875(0xc0)](_0x4d7ba4['toLowerCase']());}function parseHeader(_0x465876){const _0x2f74e3=a6_0x55f7ed,_0x328d53=_0x465876[_0x2f74e3(0xfc)](':');if(_0x328d53===-0x1)throw new Error(_0x2f74e3(0xfb)+_0x465876+_0x2f74e3(0xd1)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x59737e=_0x465876[_0x2f74e3(0xca)](0x0,_0x328d53)[_0x2f74e3(0xd4)](),_0x31f3f3=_0x465876['substring'](_0x328d53+0x1)[_0x2f74e3(0xd4)]();if(!_0x59737e)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x465876+'\x22');return[_0x59737e,_0x31f3f3];}export class ApiCommand extends BaseCommand{[a6_0x55f7ed(0xdc)]=a6_0x55f7ed(0xed);[a6_0x55f7ed(0xde)]=a6_0x55f7ed(0xc6);[a6_0x55f7ed(0xd9)](_0x4b3bc1){const _0x26eb9e=a6_0x55f7ed,{args:_0x1d9374,options:_0x167c9f}=_0x4b3bc1,_0x3a849e=_0x167c9f;if(_0x1d9374['length']===0x0)return _0x26eb9e(0xd0);const _0x44dd3d=_0x1d9374[0x0];if(!_0x44dd3d[_0x26eb9e(0xdd)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x44dd3d;const _0x4070cd=_0x3a849e['data'],_0x19b887=_0x3a849e[_0x26eb9e(0xc4)];if(_0x4070cd&&_0x19b887)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x39a4d1=_0x3a849e[_0x26eb9e(0xc9)]||_0x26eb9e(0xfa),_0x56a7d5=[_0x26eb9e(0xfa),_0x26eb9e(0xfd),_0x26eb9e(0xce),_0x26eb9e(0xc5),_0x26eb9e(0xe5)];if(!_0x56a7d5[_0x26eb9e(0xeb)](_0x39a4d1[_0x26eb9e(0xf3)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x39a4d1+_0x26eb9e(0xcd)+_0x56a7d5[_0x26eb9e(0xbe)](',\x20');const _0x5865eb=_0x3a849e['type']||'td',_0x201579=['td',_0x26eb9e(0xf7),_0x26eb9e(0xc7),_0x26eb9e(0xe8),_0x26eb9e(0xd6),_0x26eb9e(0xcb)];if(!_0x201579[_0x26eb9e(0xeb)](_0x5865eb))return _0x26eb9e(0xda)+_0x5865eb+_0x26eb9e(0xcc)+_0x201579[_0x26eb9e(0xbe)](',\x20');return undefined;}async['execute'](_0x389aca){const _0x41fd4d=a6_0x55f7ed,{options:_0x2fe7bd,args:_0x270fc3,tdx:_0x41cef7}=_0x389aca,_0x37dc6d=_0x2fe7bd,_0x198d90=_0x270fc3[0x0],_0x3637ea=(_0x37dc6d[_0x41fd4d(0xc9)]||_0x41fd4d(0xfa))[_0x41fd4d(0xf3)](),_0x4be1c1=_0x37dc6d[_0x41fd4d(0xd8)],_0x2cfbf2=_0x37dc6d[_0x41fd4d(0xc4)],_0x7d8ce7=_0x37dc6d[_0x41fd4d(0xfe)],_0x44e9ea=_0x37dc6d['type']||'td';try{const _0x14b3af={};if(_0x7d8ce7){const _0x2dfa0d=Array['isArray'](_0x7d8ce7)?_0x7d8ce7:[_0x7d8ce7];for(const _0x4cab73 of _0x2dfa0d){const [_0x258494,_0x466281]=parseHeader(_0x4cab73);_0x14b3af[_0x258494]=_0x466281;}}let _0x1dc1c6;if(_0x4be1c1)_0x1dc1c6=_0x4be1c1;else{if(_0x2cfbf2)try{_0x1dc1c6=RawAPI[_0x41fd4d(0xee)](_0x2cfbf2);}catch(_0x501e59){return console[_0x41fd4d(0xf9)]('Error:\x20'+(_0x501e59 instanceof Error?_0x501e59[_0x41fd4d(0xff)]:String(_0x501e59))),0x1;}}const _0x1ad291={'method':_0x3637ea,'apiType':_0x44e9ea,'includeHeaders':_0x2fe7bd['verbose']};_0x1dc1c6&&(_0x1ad291[_0x41fd4d(0xbc)]=_0x1dc1c6);Object[_0x41fd4d(0xe2)](_0x14b3af)['length']>0x0&&(_0x1ad291[_0x41fd4d(0xc2)]=_0x14b3af);if(_0x2fe7bd['verbose']){const _0x5b54a4=resolveSite(_0x2fe7bd['site']),_0x237890=getEndpoint(_0x5b54a4,_0x44e9ea),_0x5a6335=''+_0x237890+_0x198d90;console[_0x41fd4d(0xf9)]('>\x20'+_0x3637ea+'\x20'+_0x5a6335);const _0x1641e8=getAuthHeaders(_0x5b54a4),_0x234d21={..._0x1641e8,..._0x14b3af};for(const [_0x432a10,_0x448ab4]of Object[_0x41fd4d(0xec)](_0x234d21)){!isSensitiveHeader(_0x432a10)&&console[_0x41fd4d(0xf9)]('>\x20'+_0x432a10+':\x20'+_0x448ab4);}_0x1dc1c6&&console['error']('>'),console[_0x41fd4d(0xf9)]('');}const _0x3935f6=await _0x41cef7['api'][_0x41fd4d(0xbd)](_0x198d90,_0x1ad291);if(_0x2fe7bd['verbose']&&_0x3935f6['headers']){console['error'](_0x41fd4d(0xdf)+_0x3935f6[_0x41fd4d(0xef)]);for(const [_0x245946,_0x14d433]of Object[_0x41fd4d(0xec)](_0x3935f6[_0x41fd4d(0xc2)])){!isSensitiveHeader(_0x245946)&&console[_0x41fd4d(0xf9)]('<\x20'+_0x245946+':\x20'+_0x14d433);}console['error']('');}const _0x535d41=Boolean(_0x2fe7bd[_0x41fd4d(0xf1)]),_0x5d2e44={'color':_0x2fe7bd[_0x41fd4d(0xd2)],'noColor':_0x2fe7bd[_0x41fd4d(0xf0)]||_0x535d41&&!_0x2fe7bd[_0x41fd4d(0xd2)]},_0x4514ab=colorizeJSON(_0x3935f6[_0x41fd4d(0xd8)],_0x5d2e44);return _0x2fe7bd['output']?(writeFileSync(_0x2fe7bd[_0x41fd4d(0xf1)],_0x4514ab),console['error'](_0x41fd4d(0xe0)+_0x2fe7bd[_0x41fd4d(0xf1)])):console[_0x41fd4d(0xf6)](_0x4514ab),0x0;}catch(_0x4b4cc5){return _0x4b4cc5 instanceof Error?(console['error'](_0x41fd4d(0xdb)+_0x4b4cc5[_0x41fd4d(0xff)]),_0x2fe7bd['verbose']&&_0x4b4cc5[_0x41fd4d(0xe6)]&&console[_0x41fd4d(0xf9)](_0x41fd4d(0x100)+_0x4b4cc5[_0x41fd4d(0xe6)])):console[_0x41fd4d(0xf9)]('Error:\x20'+String(_0x4b4cc5)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a7_0x3f497b=a7_0x23a8;(function(_0x2c55ff,_0x1a1fda){const _0x453c44=a7_0x23a8,_0x4e54f8=_0x2c55ff();while(!![]){try{const _0x1e54af=-parseInt(_0x453c44(0xb3))/0x1*(parseInt(_0x453c44(0xcc))/0x2)+parseInt(_0x453c44(0xc1))/0x3*(parseInt(_0x453c44(0xaa))/0x4)+-parseInt(_0x453c44(0xe7))/0x5*(parseInt(_0x453c44(0xbc))/0x6)+-parseInt(_0x453c44(0xd3))/0x7+parseInt(_0x453c44(0xd0))/0x8+-parseInt(_0x453c44(0xe8))/0x9+parseInt(_0x453c44(0xa7))/0xa;if(_0x1e54af===_0x1a1fda)break;else _0x4e54f8['push'](_0x4e54f8['shift']());}catch(_0x518797){_0x4e54f8['push'](_0x4e54f8['shift']());}}}(a7_0x210d,0x337d6));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x23a8(_0x3260a0,_0xff2e50){_0x3260a0=_0x3260a0-0xa7;const _0x210dd4=a7_0x210d();let _0x23a8d2=_0x210dd4[_0x3260a0];return _0x23a8d2;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x210d(){const _0x83e8f0=['password','Site\x20name\x20cannot\x20be\x20empty','Remove\x20API\x20key\x20from\x20system\x20keychain','2004vDaNSG','join','profile','customSite','filter','\x20(profile:\x20','apiKey','last_name','red','auth:clear','execute','2psHNnN','✓\x20API\x20key\x20removed\x20from\x20keychain','error','email','2019920hnBiNE','\x20(site:\x20','trim','1863064bWJtJK','ERROR','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','bold','auth','log','\x20--profile\x20','name','Setting\x20up\x20authentication\x20for\x20site:\x20','API\x20key\x20cannot\x20be\x20empty','No\x20API\x20key\x20found\x20in\x20keychain','Name:\x20','text','\x0aSetup\x20cancelled','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','tdx:\x20auth\x20clear','us01','N/A','25rOsiEN','1264986zRjnzA','site','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Enter\x20site\x20name:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','tdx\x20profile:\x20','warn','System\x20keychain\x20is\x20not\x20available','message','create','select','Validating\x20API\x20key...','5244050rsPnxp','/app/mp/ak','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','2072uyarwk','You\x20can\x20find\x20your\x20API\x20key\x20at:','logLevel','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Read\x20credential\x20from\x20','✓\x20Default\x20site\x20set\x20to\x20','first_name','\x20\x20tdx','getUserInfo','372676VzOTds','jobs','Enter\x20your\x20TD\x20API\x20key:','✗\x20Validation\x20failed:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','other','yellow','description','Select\x20your\x20Treasure\x20Data\x20site:','159162ShBYxa','No\x20credential\x20found'];a7_0x210d=function(){return _0x83e8f0;};return a7_0x210d();}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x25f4dc 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_0x662ce4 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x3f497b(0xba)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x3f497b(0xcb)](_0x348ca7){const _0x499f62=a7_0x3f497b,{options:_0x2844d5}=_0x348ca7,_0x4165e3=_0x2844d5['profile'];console[_0x499f62(0xd8)](a7_0x662ce4[_0x499f62(0xd6)]('tdx:\x20auth\x20setup'));const _0x1c5a7a=_0x2844d5[_0x499f62(0xe9)]||_0x499f62(0xe5),{choices:_0x294356,initialIndex:_0x423065}=buildSiteChoices(_0x1c5a7a),_0x2e3343=_0x4165e3?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x4165e3+'):':_0x499f62(0xbb),_0x3befbb=await a7_0x25f4dc({'type':_0x499f62(0xf2),'name':_0x499f62(0xe9),'message':_0x2e3343,'choices':_0x294356,'initial':_0x423065});if(!_0x3befbb[_0x499f62(0xe9)])return console[_0x499f62(0xd8)](_0x499f62(0xe0)),0x1;let _0x2248b3;if(_0x3befbb[_0x499f62(0xe9)]===_0x499f62(0xb8)){const _0x151877=await a7_0x25f4dc({'type':_0x499f62(0xdf),'name':_0x499f62(0xc4),'message':_0x499f62(0xeb),'initial':_0x499f62(0xe5),'validate':_0x4520f8=>{const _0x5ee955=_0x499f62;if(!_0x4520f8||!_0x4520f8[_0x5ee955(0xd2)]())return _0x5ee955(0xbf);if(!/^[a-z0-9-]+$/['test'](_0x4520f8[_0x5ee955(0xd2)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x151877[_0x499f62(0xc4)])return console['log'](_0x499f62(0xe0)),0x1;_0x2248b3=_0x151877['customSite'];}else _0x2248b3=_0x3befbb[_0x499f62(0xe9)];const _0x34c527=resolveSite(_0x2248b3);console['log'](_0x499f62(0xdb)+_0x34c527),console['log'](_0x499f62(0xab)),console[_0x499f62(0xd8)]('\x20\x20'+getConsoleUrl(_0x34c527,_0x499f62(0xa8)));const _0x11d883=await a7_0x25f4dc({'type':_0x499f62(0xbe),'name':_0x499f62(0xc7),'message':_0x499f62(0xb5),'validate':_0x436829=>{const _0x3d0969=_0x499f62;if(!_0x436829||!_0x436829[_0x3d0969(0xd2)]())return _0x3d0969(0xdc);return!![];}});if(!_0x11d883[_0x499f62(0xc7)])return console[_0x499f62(0xd8)](_0x499f62(0xe0)),0x1;const _0x2b437b=_0x11d883[_0x499f62(0xc7)];console[_0x499f62(0xd8)](_0x499f62(0xf3));try{const _0x4ed7af=TDX[_0x499f62(0xf1)]({'site':_0x34c527,'apiKey':_0x2b437b[_0x499f62(0xd2)](),'logLevel':_0x2844d5[_0x499f62(0xac)]??LogLevel[_0x499f62(0xd4)]}),_0x1ab698=await _0x4ed7af[_0x499f62(0xb4)][_0x499f62(0xb2)]();console[_0x499f62(0xd8)](_0x499f62(0xec)+_0x1ab698[_0x499f62(0xcf)]+')');const _0x569ec1=await isKeychainAvailable();_0x569ec1?(await saveAPIKeyAsync(_0x2b437b[_0x499f62(0xd2)](),_0x34c527,_0x4165e3),console['log'](_0x499f62(0xea)+(_0x4165e3?_0x499f62(0xc6)+_0x4165e3+')':''))):(console[_0x499f62(0xee)](a7_0x662ce4['yellow'](_0x499f62(0xd5))),console[_0x499f62(0xee)](a7_0x662ce4[_0x499f62(0xb9)](_0x499f62(0xe2))));if(_0x4165e3){const _0x565676={'site':_0x34c527};saveProfileToUserConfig(_0x4165e3,_0x565676),console['log']('✓\x20Profile\x20\x27'+_0x4165e3+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x34c527),console['log'](_0x499f62(0xaf)+_0x34c527);const _0x331aae=_0x4165e3?_0x499f62(0xd9)+_0x4165e3:'';return console[_0x499f62(0xd8)](),console['log'](_0x499f62(0xe1)),console['log'](_0x499f62(0xb1)+_0x331aae+_0x499f62(0xb7)),console[_0x499f62(0xd8)](_0x499f62(0xb1)+_0x331aae+_0x499f62(0xa9)),0x0;}catch(_0xc565a){if(_0xc565a instanceof HTTPClientError&&_0xc565a['status']===0x191)return printAuthError(_0xc565a),0x1;return console[_0x499f62(0xce)](a7_0x662ce4[_0x499f62(0xc9)](_0x499f62(0xb6)+(_0xc565a instanceof Error?_0xc565a[_0x499f62(0xf0)]:String(_0xc565a)))),console[_0x499f62(0xce)](_0x499f62(0xe3)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3f497b(0xd7);[a7_0x3f497b(0xba)]=a7_0x3f497b(0xad);async[a7_0x3f497b(0xcb)](_0x48dccb){const _0x2e9748=a7_0x3f497b,{options:_0x19854a,tdx:_0x24e076}=_0x48dccb,_0x2c4f10=_0x19854a['site'],_0x1ccde0=_0x19854a[_0x2e9748(0xc3)],_0x6205f0=_0x1ccde0?_0x1ccde0:_0x2e9748(0xe6);console[_0x2e9748(0xd8)](_0x2e9748(0xed)+_0x6205f0+_0x2e9748(0xd1)+_0x2c4f10+')');const _0x1a2999=await resolveAPIKeyAsync(_0x2c4f10,_0x1ccde0);if(_0x1a2999){const {source:_0x7bd1cc,isDeprecated:_0x3c0748}=_0x1a2999,_0x56c16a=_0x2e9748(0xae)+_0x7bd1cc;console[_0x2e9748(0xd8)](_0x3c0748?a7_0x662ce4['yellow'](_0x56c16a):_0x56c16a);}else console[_0x2e9748(0xd8)](a7_0x662ce4[_0x2e9748(0xb9)](_0x2e9748(0xbd)));try{const _0x80b1b=await _0x24e076[_0x2e9748(0xb4)][_0x2e9748(0xb2)]();return console[_0x2e9748(0xd8)](a7_0x662ce4['green']('✓\x20Authentication\x20successful\x0a')),console[_0x2e9748(0xd8)]('User:\x20'+_0x80b1b[_0x2e9748(0xcf)]),(_0x80b1b[_0x2e9748(0xb0)]||_0x80b1b[_0x2e9748(0xc8)])&&console[_0x2e9748(0xd8)](_0x2e9748(0xde)+[_0x80b1b['first_name'],_0x80b1b[_0x2e9748(0xc8)]][_0x2e9748(0xc5)](Boolean)[_0x2e9748(0xc2)]('\x20')),0x0;}catch(_0x5794a8){return _0x5794a8 instanceof HTTPClientError&&_0x5794a8['status']===0x191?printAuthError(_0x5794a8,!![],_0x1ccde0):console[_0x2e9748(0xce)](a7_0x662ce4[_0x2e9748(0xc9)](_0x2e9748(0xb6)+(_0x5794a8 instanceof Error?_0x5794a8[_0x2e9748(0xf0)]:String(_0x5794a8)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3f497b(0xda)]=a7_0x3f497b(0xca);['description']=a7_0x3f497b(0xc0);async['execute'](_0x10ea20){const _0x5ecd88=a7_0x3f497b,{options:_0x39c76d}=_0x10ea20,_0x356376=_0x39c76d[_0x5ecd88(0xc3)];console[_0x5ecd88(0xd8)](a7_0x662ce4['bold'](_0x5ecd88(0xe4)));const _0x267ac6=await isKeychainAvailable();if(!_0x267ac6)return console[_0x5ecd88(0xce)](a7_0x662ce4[_0x5ecd88(0xc9)](_0x5ecd88(0xef))),0x1;const _0x3f189f=await deleteKeychainAPIKey(_0x356376);return _0x3f189f?(clearCredentialCache(),console[_0x5ecd88(0xd8)](_0x5ecd88(0xcd)+(_0x356376?_0x5ecd88(0xc6)+_0x356376+')':'')),0x0):(console[_0x5ecd88(0xd8)](_0x5ecd88(0xdd)+(_0x356376?'\x20for\x20profile:\x20'+_0x356376:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x420c75=a8_0x235c;(function(_0x9038b0,_0x4db313){const _0x42b95e=a8_0x235c,_0x155986=_0x9038b0();while(!![]){try{const _0x536202=-parseInt(_0x42b95e(0xd4))/0x1*(-parseInt(_0x42b95e(0xa0))/0x2)+parseInt(_0x42b95e(0xc8))/0x3+parseInt(_0x42b95e(0x9b))/0x4*(parseInt(_0x42b95e(0xb7))/0x5)+-parseInt(_0x42b95e(0xb8))/0x6*(parseInt(_0x42b95e(0xbb))/0x7)+parseInt(_0x42b95e(0xda))/0x8*(-parseInt(_0x42b95e(0xd5))/0x9)+parseInt(_0x42b95e(0xb3))/0xa+-parseInt(_0x42b95e(0xb2))/0xb;if(_0x536202===_0x4db313)break;else _0x155986['push'](_0x155986['shift']());}catch(_0x383a4c){_0x155986['push'](_0x155986['shift']());}}}(a8_0x5875,0x7c6da));import{BaseCommand}from'./command.js';function a8_0x5875(){const _0x177051=['llm','Continuing\x20chat:\x20','includes','metadata','1106KyMqns','startChat','Getting\x20default\x20agent...','chatId','done','args','content','verbose','event','validate','targetFunction','--agent\x20flag','stream','stringify','Error:\x20Chat\x20session\x20\x27','llmAgent','Create\x20a\x20new\x20chat\x20session','streamChat','684618BHFxkj','2519090hpWMRX','claude-4.5-haiku','\x0aStack\x20trace:','tool_call','23105jsaVTf','6hWUtLz','agentId','streamChatJsonl','2344237ybuiLn','string','404','Chat\x20session:\x20','write','cause','error','Resolving\x20agent\x20\x27','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','new','execute','stdout','stack','1515870aHSvCF','join','name','projectId','agent','functionName','\x27...','\x0aError:\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','description','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','tool','1289qVMXKq','13059uvNCYw','message','log','getDefaultAgent','chat','4048wZMsrY','code','llmProject','type','options','\x20\x20Cause:\x20','resolveAgentId','slice','getOrCreateDefaultAgent','resolveProjectId','targetKnowledgeBase','handleChatEvent','Resolving\x20project\x20\x27','data','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','148LWGzca'];a8_0x5875=function(){return _0x177051;};return a8_0x5875();}import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x235c(_0x35d3b6,_0x5b5bbd){_0x35d3b6=_0x35d3b6-0x94;const _0x5875e5=a8_0x5875();let _0x235c25=_0x5875e5[_0x35d3b6];return _0x235c25;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x3ec962,_0x4d9693){const _0xae42c8=a8_0x235c;if(_0x3ec962 instanceof SDKError)console['error']('Error:\x20'+_0x3ec962[_0xae42c8(0xd6)]),_0x4d9693['verbose']&&(_0x3ec962[_0xae42c8(0xc0)]&&console[_0xae42c8(0xc1)](_0xae42c8(0xdf)+_0x3ec962[_0xae42c8(0xc0)]),_0x3ec962['stack']&&(console[_0xae42c8(0xc1)](_0xae42c8(0xb5)),console[_0xae42c8(0xc1)](_0x3ec962[_0xae42c8(0xc7)])));else throw _0x3ec962;}async function resolveAgentId(_0x41495d,_0x50d4be,_0x3574c6,_0x7832e,_0x196363){const _0xd4aeb3=a8_0x235c,_0x2b5a40=_0x50d4be||_0x3574c6;if(_0x2b5a40){const {projectName:_0x503959,agentName:_0x22ab7b}=parseAgentRef(_0x2b5a40),_0xfbe1af=_0x22ab7b||_0x2b5a40,_0x52aecc=_0x22ab7b?_0x503959:_0x7832e;if(!_0x52aecc)throw new Error(_0xd4aeb3(0xc3));if(_0x196363){const _0x1c200f=_0x50d4be?_0xd4aeb3(0xab):'session\x20context';console['error']('Using\x20agent\x20from\x20'+_0x1c200f+':\x20'+_0x52aecc+'/'+_0xfbe1af);}const _0x2d5216=await withSpinner(_0xd4aeb3(0x98)+_0x52aecc+'\x27...',()=>_0x41495d[_0xd4aeb3(0x9c)][_0xd4aeb3(0x95)](_0x52aecc),{'verbose':_0x196363}),_0xb33886=await withSpinner(_0xd4aeb3(0xc2)+_0xfbe1af+_0xd4aeb3(0xce),()=>_0x41495d[_0xd4aeb3(0x9c)][_0xd4aeb3(0xe0)](_0xfbe1af,_0x2d5216[_0xd4aeb3(0x99)]),{'verbose':_0x196363});return _0xb33886[_0xd4aeb3(0x99)];}else{const _0x13fc9f=_0x41495d['llm'][_0xd4aeb3(0xd8)]();if(_0x13fc9f)return _0x196363&&console[_0xd4aeb3(0xc1)]('Using\x20cached\x20default\x20agent:\x20'+_0x13fc9f['name']),_0x13fc9f['id'];const _0xbf25d5=await withSpinner(_0xd4aeb3(0xa2),()=>_0x41495d['llm'][_0xd4aeb3(0x94)](_0xd4aeb3(0xb4),0x0),{'verbose':_0x196363});return _0xbf25d5[_0xd4aeb3(0x99)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x420c75(0xca)]=a8_0x420c75(0xd9);['description']=a8_0x420c75(0xd2);[a8_0x420c75(0xa9)](_0xad7804){const _0x23e106=a8_0x420c75,_0x4a6cd2=_0xad7804[_0x23e106(0xa5)]['join']('\x20');if(!_0x4a6cd2)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x2c86e0,_0x41b135,_0x1c2878,_0x3dd039,_0x1ea158){const _0x5e9930=a8_0x420c75;for await(const _0x2f75ff of _0x2c86e0[_0x5e9930(0x9c)][_0x5e9930(0xd9)](_0x41b135,{'agentId':_0x1c2878,'chatId':_0x3dd039})){if(_0x2f75ff[_0x5e9930(0xdd)]==='metadata'){const _0x255561=_0x2f75ff[_0x5e9930(0x99)][_0x5e9930(0xa3)];saveLastChatId(_0x255561),_0x1ea158&&console[_0x5e9930(0xc1)](_0x5e9930(0xbe)+_0x255561);}else _0x2f75ff[_0x5e9930(0xdd)]===_0x5e9930(0xa8)&&this[_0x5e9930(0x97)](_0x2f75ff['data']);}}async[a8_0x420c75(0xba)](_0x7be2ea,_0x38f6bf,_0x4e420c,_0x1b66ec){const _0x99f296=a8_0x420c75,_0x192e12=_0x7be2ea['context']['site'];let _0x2fd633=![];for await(const _0x15002e of _0x7be2ea['llm']['chat'](_0x38f6bf,{'agentId':_0x4e420c,'chatId':_0x1b66ec})){if(_0x15002e[_0x99f296(0xdd)]===_0x99f296(0x9f)){const _0x4113be=_0x15002e[_0x99f296(0x99)];saveLastChatId(_0x4113be[_0x99f296(0xa3)]);const _0x1e4cc5=_0x4113be['projectId']&&_0x4113be[_0x99f296(0xb9)]?getLLMConversationUrl(_0x192e12,_0x4113be[_0x99f296(0xcb)],_0x4113be[_0x99f296(0xb9)],_0x4113be['chatId']):undefined;console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0x9f),'data':{'chatId':_0x4113be[_0x99f296(0xa3)],'agentId':_0x4113be[_0x99f296(0xb9)],'consoleUrl':_0x1e4cc5}})),_0x2fd633=!![];}else{if(_0x15002e[_0x99f296(0xdd)]===_0x99f296(0xa8)){!_0x2fd633&&_0x1b66ec&&(console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0x9f),'data':{'chatId':_0x1b66ec}})),_0x2fd633=!![]);const _0x2a0007=_0x15002e[_0x99f296(0x99)];if('content'in _0x2a0007)console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0xa6),'data':{'content':_0x2a0007['content']}}));else{if('tool_call'in _0x2a0007){const _0x48c4d0=_0x2a0007['tool_call'];console[_0x99f296(0xd7)](JSON['stringify']({'type':_0x99f296(0xb6),'data':{'id':_0x48c4d0['id'],'name':_0x48c4d0[_0x99f296(0xcd)],'target':_0x48c4d0[_0x99f296(0x96)]?.[_0x99f296(0xca)]||_0x48c4d0['targetAgent']?.[_0x99f296(0xca)]||_0x48c4d0['targetWebSearchTool']?.[_0x99f296(0xca)]||_0x48c4d0[_0x99f296(0xaa)]}}));}else{if(_0x99f296(0xd3)in _0x2a0007)console[_0x99f296(0xd7)](JSON['stringify']({'type':'tool_result','data':{'id':_0x2a0007[_0x99f296(0xd3)]['id'],'name':_0x2a0007[_0x99f296(0xd3)][_0x99f296(0xcd)],'result':typeof _0x2a0007[_0x99f296(0xd3)]['content']===_0x99f296(0xbc)?_0x2a0007['tool'][_0x99f296(0xa6)][_0x99f296(0xe1)](0x0,0x1f4):''}}));else _0x99f296(0xc1)in _0x2a0007&&console[_0x99f296(0xd7)](JSON['stringify']({'type':_0x99f296(0xc1),'data':{'error':_0x2a0007['error']}}));}}}}}console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0xa4)}));}async[a8_0x420c75(0xc5)](_0x266f68){const _0x218b50=a8_0x420c75,{options:_0x2fa45f,args:_0xeddd09,tdx:_0x3d11f7}=_0x266f68,_0x14c07b=_0xeddd09[_0x218b50(0xc9)]('\x20'),_0x23e944=_0x2fa45f,_0x355062=_0x23e944[_0x218b50(0xcc)],_0x150ec3=_0x23e944[_0x218b50(0xaf)],_0x4bc8a0=_0x23e944[_0x218b50(0xdc)],_0x4ced48=_0x23e944[_0x218b50(0xc4)],_0x4db03b=_0x23e944['chatId'],_0x304d6a=_0x23e944[_0x218b50(0xac)];if(_0x4ced48&&_0x4db03b)return console[_0x218b50(0xc1)](_0x218b50(0x9a)),0x1;try{let _0x4a9c80,_0x154131;if(_0x4db03b)_0x154131=_0x4db03b;else!_0x4ced48&&(_0x154131=loadLastChatId(),_0x154131&&_0x2fa45f['verbose']&&console[_0x218b50(0xc1)](_0x218b50(0x9d)+_0x154131));!_0x4db03b&&(_0x4ced48||!_0x154131)&&(_0x4a9c80=await resolveAgentId(_0x3d11f7,_0x355062,_0x150ec3,_0x4bc8a0,_0x2fa45f[_0x218b50(0xa7)]));const _0x1ead52=_0x304d6a?(_0x27fc3f,_0x19c160,_0x563d48)=>this[_0x218b50(0xba)](_0x3d11f7,_0x27fc3f,_0x19c160,_0x563d48):(_0x46f6f8,_0x3cd5be,_0x5e144e)=>this[_0x218b50(0xb1)](_0x3d11f7,_0x46f6f8,_0x3cd5be,_0x5e144e,_0x2fa45f[_0x218b50(0xa7)]);try{await _0x1ead52(_0x14c07b,_0x4a9c80,_0x154131);}catch(_0x54e7ce){const _0x4fadab=_0x54e7ce instanceof SDKError&&_0x54e7ce[_0x218b50(0xdb)]===ErrorCode['CHAT_NOT_FOUND']||_0x54e7ce instanceof Error&&_0x54e7ce[_0x218b50(0xd6)][_0x218b50(0x9e)](_0x218b50(0xbd));if(_0x4fadab&&_0x4db03b)return console['error'](_0x218b50(0xae)+_0x4db03b+'\x27\x20not\x20found'),0x1;if(_0x4fadab)_0x2fa45f[_0x218b50(0xa7)]&&console[_0x218b50(0xc1)](_0x218b50(0xd0)),!_0x4a9c80&&(_0x4a9c80=await resolveAgentId(_0x3d11f7,_0x355062,_0x150ec3,_0x4bc8a0,_0x2fa45f[_0x218b50(0xa7)])),await _0x1ead52(_0x14c07b,_0x4a9c80,undefined);else throw _0x54e7ce;}return!_0x304d6a&&console[_0x218b50(0xd7)](),0x0;}catch(_0x21449c){return console[_0x218b50(0xc1)](),handleSDKError(_0x21449c,_0x2fa45f),0x1;}}[a8_0x420c75(0x97)](_0x476396){const _0x5e8ba3=a8_0x420c75;if(_0x5e8ba3(0xa6)in _0x476396)process[_0x5e8ba3(0xc6)][_0x5e8ba3(0xbf)](_0x476396['content']);else'error'in _0x476396&&console[_0x5e8ba3(0xc1)](_0x5e8ba3(0xcf)+_0x476396[_0x5e8ba3(0xc1)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x420c75(0xca)]='chat-create';[a8_0x420c75(0xd1)]=a8_0x420c75(0xb0);[a8_0x420c75(0xa9)](_0x9b4f92){const _0x3b4cd4=a8_0x420c75,_0x776aa8=_0x9b4f92[_0x3b4cd4(0xde)],_0x116726=_0x776aa8[_0x3b4cd4(0xcc)],_0x874f1c=_0x776aa8[_0x3b4cd4(0xaf)];if(!_0x116726&&!_0x874f1c)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x420c75(0xc5)](_0x53e865){const _0x196a9b=a8_0x420c75,{options:_0x5b2636,tdx:_0x6c20d3}=_0x53e865,_0x3b795d=_0x5b2636,_0x3fbc66=_0x3b795d[_0x196a9b(0xcc)],_0x338d90=_0x3b795d[_0x196a9b(0xaf)],_0xfe62e4=_0x3b795d[_0x196a9b(0xdc)];try{const _0x1e68bb=await resolveAgentId(_0x6c20d3,_0x3fbc66,_0x338d90,_0xfe62e4,_0x5b2636[_0x196a9b(0xa7)]),_0x2a0387=await _0x6c20d3[_0x196a9b(0x9c)][_0x196a9b(0xa1)](_0x1e68bb);return saveLastChatId(_0x2a0387['id']),console[_0x196a9b(0xd7)](JSON[_0x196a9b(0xad)]({'chatId':_0x2a0387['id'],'agentId':_0x1e68bb})),0x0;}catch(_0x5ecaed){return handleSDKError(_0x5ecaed,_0x5b2636),0x1;}}}
|
|
1
|
+
function a8_0x43c0(_0x268c45,_0x59fbcd){_0x268c45=_0x268c45-0x71;const _0x57d738=a8_0x57d7();let _0x43c0fa=_0x57d738[_0x268c45];return _0x43c0fa;}const a8_0xf61cdb=a8_0x43c0;(function(_0x4db6b7,_0x1bb125){const _0x4d433b=a8_0x43c0,_0x194842=_0x4db6b7();while(!![]){try{const _0x97f464=parseInt(_0x4d433b(0xb8))/0x1*(-parseInt(_0x4d433b(0x8c))/0x2)+parseInt(_0x4d433b(0x7e))/0x3+parseInt(_0x4d433b(0xae))/0x4+-parseInt(_0x4d433b(0x86))/0x5+-parseInt(_0x4d433b(0x80))/0x6*(parseInt(_0x4d433b(0x88))/0x7)+parseInt(_0x4d433b(0x7d))/0x8*(-parseInt(_0x4d433b(0x72))/0x9)+parseInt(_0x4d433b(0xad))/0xa;if(_0x97f464===_0x1bb125)break;else _0x194842['push'](_0x194842['shift']());}catch(_0x5d00f9){_0x194842['push'](_0x194842['shift']());}}}(a8_0x57d7,0x61082));import{BaseCommand}from'./command.js';function a8_0x57d7(){const _0x4f6180=['write','args','handleChatEvent','tool_call','CHAT_NOT_FOUND','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','description','128XyJorO','1643757rjetMS','projectId','58746rKHFoC','stdout','startChat','Using\x20agent\x20from\x20','stringify','chatId','1797385xziTkQ','Continuing\x20chat:\x20','294bPXHkI','context','targetWebSearchTool','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','2bYfNQu','resolveProjectId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','name','options','chat','targetFunction','join','streamChat','data','message','error','cause','content','Create\x20a\x20new\x20chat\x20session','new','code','type','event','Chat\x20session:\x20','string','Resolving\x20agent\x20\x27','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','agentId','llmProject','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Error:\x20Chat\x20session\x20\x27','verbose','execute','tool','404','log','metadata','7296630tCfICT','316412neOaWm','\x27...','getOrCreateDefaultAgent','Error:\x20','tool_result','llm','Resolving\x20project\x20\x27','site','streamChatJsonl','llmAgent','144416hkISfv','agent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','24822blfDeo','includes','functionName','done'];a8_0x57d7=function(){return _0x4f6180;};return a8_0x57d7();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x35640d,_0x34e9b3){const _0x24c65e=a8_0x43c0;if(_0x35640d instanceof SDKError)console['error'](_0x24c65e(0xb1)+_0x35640d[_0x24c65e(0x96)]),_0x34e9b3['verbose']&&(_0x35640d[_0x24c65e(0x98)]&&console[_0x24c65e(0x97)]('\x20\x20Cause:\x20'+_0x35640d['cause']),_0x35640d['stack']&&(console[_0x24c65e(0x97)]('\x0aStack\x20trace:'),console[_0x24c65e(0x97)](_0x35640d['stack'])));else throw _0x35640d;}async function resolveAgentId(_0x49b895,_0x4c1e45,_0x5448cf,_0xc05019,_0x25f923){const _0x1954f6=a8_0x43c0,_0x48e518=_0x4c1e45||_0x5448cf;if(_0x48e518){const {projectName:_0x57069f,agentName:_0x1a9ef7}=parseAgentRef(_0x48e518),_0x41cd01=_0x1a9ef7||_0x48e518,_0x20f5e7=_0x1a9ef7?_0x57069f:_0xc05019;if(!_0x20f5e7)throw new Error(_0x1954f6(0x8b));if(_0x25f923){const _0x37cfc9=_0x4c1e45?'--agent\x20flag':'session\x20context';console[_0x1954f6(0x97)](_0x1954f6(0x83)+_0x37cfc9+':\x20'+_0x20f5e7+'/'+_0x41cd01);}const _0x2ad2d8=await withSpinner(_0x1954f6(0xb4)+_0x20f5e7+_0x1954f6(0xaf),()=>_0x49b895[_0x1954f6(0xb3)][_0x1954f6(0x8d)](_0x20f5e7),{'verbose':_0x25f923}),_0x32fb63=await withSpinner(_0x1954f6(0xa1)+_0x41cd01+_0x1954f6(0xaf),()=>_0x49b895[_0x1954f6(0xb3)]['resolveAgentId'](_0x41cd01,_0x2ad2d8['data']),{'verbose':_0x25f923});return _0x32fb63[_0x1954f6(0x95)];}else{const _0x39a365=_0x49b895[_0x1954f6(0xb3)]['getDefaultAgent']();if(_0x39a365)return _0x25f923&&console[_0x1954f6(0x97)]('Using\x20cached\x20default\x20agent:\x20'+_0x39a365['name']),_0x39a365['id'];const _0xa2ec06=await withSpinner('Getting\x20default\x20agent...',()=>_0x49b895[_0x1954f6(0xb3)][_0x1954f6(0xb0)]('claude-4.5-haiku',0x0),{'verbose':_0x25f923});return _0xa2ec06[_0x1954f6(0x95)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0xf61cdb(0x8f)]=a8_0xf61cdb(0x91);['description']=a8_0xf61cdb(0x71);['validate'](_0x4dc0b7){const _0x308b8a=a8_0xf61cdb,_0x820999=_0x4dc0b7[_0x308b8a(0x77)]['join']('\x20');if(!_0x820999)return _0x308b8a(0x8e);return undefined;}async[a8_0xf61cdb(0x94)](_0x395e16,_0x3844d4,_0x291432,_0x1b0ce4,_0x52fe7b){const _0x3b11d1=a8_0xf61cdb;for await(const _0x4b4e55 of _0x395e16[_0x3b11d1(0xb3)]['chat'](_0x3844d4,{'agentId':_0x291432,'chatId':_0x1b0ce4})){if(_0x4b4e55[_0x3b11d1(0x9d)]===_0x3b11d1(0xac)){const _0x589ae1=_0x4b4e55['data'][_0x3b11d1(0x85)];saveLastChatId(_0x589ae1),_0x52fe7b&&console[_0x3b11d1(0x97)](_0x3b11d1(0x9f)+_0x589ae1);}else _0x4b4e55[_0x3b11d1(0x9d)]===_0x3b11d1(0x9e)&&this[_0x3b11d1(0x78)](_0x4b4e55[_0x3b11d1(0x95)]);}}async[a8_0xf61cdb(0xb6)](_0x417923,_0x4d1721,_0x54ea93,_0x270443){const _0x490818=a8_0xf61cdb,_0x38b431=_0x417923[_0x490818(0x89)][_0x490818(0xb5)];let _0x3880e1=![];for await(const _0x2e22fc of _0x417923[_0x490818(0xb3)][_0x490818(0x91)](_0x4d1721,{'agentId':_0x54ea93,'chatId':_0x270443})){if(_0x2e22fc['type']===_0x490818(0xac)){const _0x44151b=_0x2e22fc[_0x490818(0x95)];saveLastChatId(_0x44151b[_0x490818(0x85)]);const _0x70760b=_0x44151b[_0x490818(0x7f)]&&_0x44151b['agentId']?getLLMConversationUrl(_0x38b431,_0x44151b[_0x490818(0x7f)],_0x44151b[_0x490818(0xa3)],_0x44151b[_0x490818(0x85)]):undefined;console[_0x490818(0xab)](JSON[_0x490818(0x84)]({'type':_0x490818(0xac),'data':{'chatId':_0x44151b[_0x490818(0x85)],'agentId':_0x44151b[_0x490818(0xa3)],'consoleUrl':_0x70760b}})),_0x3880e1=!![];}else{if(_0x2e22fc[_0x490818(0x9d)]===_0x490818(0x9e)){!_0x3880e1&&_0x270443&&(console[_0x490818(0xab)](JSON[_0x490818(0x84)]({'type':_0x490818(0xac),'data':{'chatId':_0x270443}})),_0x3880e1=!![]);const _0x320f0a=_0x2e22fc[_0x490818(0x95)];if(_0x490818(0x99)in _0x320f0a)console[_0x490818(0xab)](JSON[_0x490818(0x84)]({'type':'content','data':{'content':_0x320f0a['content']}}));else{if(_0x490818(0x79)in _0x320f0a){const _0x475404=_0x320f0a['tool_call'];console[_0x490818(0xab)](JSON[_0x490818(0x84)]({'type':_0x490818(0x79),'data':{'id':_0x475404['id'],'name':_0x475404[_0x490818(0x74)],'target':_0x475404['targetKnowledgeBase']?.[_0x490818(0x8f)]||_0x475404['targetAgent']?.[_0x490818(0x8f)]||_0x475404[_0x490818(0x8a)]?.[_0x490818(0x8f)]||_0x475404[_0x490818(0x92)]}}));}else{if('tool'in _0x320f0a)console[_0x490818(0xab)](JSON[_0x490818(0x84)]({'type':_0x490818(0xb2),'data':{'id':_0x320f0a[_0x490818(0xa9)]['id'],'name':_0x320f0a['tool'][_0x490818(0x74)],'result':typeof _0x320f0a['tool']['content']===_0x490818(0xa0)?_0x320f0a[_0x490818(0xa9)][_0x490818(0x99)]['slice'](0x0,0x1f4):''}}));else _0x490818(0x97)in _0x320f0a&&console[_0x490818(0xab)](JSON[_0x490818(0x84)]({'type':_0x490818(0x97),'data':{'error':_0x320f0a[_0x490818(0x97)]}}));}}}}}console['log'](JSON[_0x490818(0x84)]({'type':_0x490818(0x75)}));}async['execute'](_0x2b9651){const _0x2ceb37=a8_0xf61cdb,{options:_0x1b62f4,args:_0x26cd31,tdx:_0x15f6f5}=_0x2b9651,_0x341788=_0x26cd31[_0x2ceb37(0x93)]('\x20'),_0x43fddb=_0x1b62f4,_0x4777a0=_0x43fddb[_0x2ceb37(0xb9)],_0x7477f6=_0x43fddb['llmAgent'],_0x316b76=_0x43fddb[_0x2ceb37(0xa4)],_0x367b7e=_0x43fddb[_0x2ceb37(0x9b)],_0x46879a=_0x43fddb[_0x2ceb37(0x85)],_0x387a84=_0x43fddb['stream'];if(_0x367b7e&&_0x46879a)return console[_0x2ceb37(0x97)](_0x2ceb37(0xa5)),0x1;try{let _0x5dece7,_0x2c9698;if(_0x46879a)_0x2c9698=_0x46879a;else!_0x367b7e&&(_0x2c9698=loadLastChatId(),_0x2c9698&&_0x1b62f4['verbose']&&console[_0x2ceb37(0x97)](_0x2ceb37(0x87)+_0x2c9698));!_0x46879a&&(_0x367b7e||!_0x2c9698)&&(_0x5dece7=await resolveAgentId(_0x15f6f5,_0x4777a0,_0x7477f6,_0x316b76,_0x1b62f4[_0x2ceb37(0xa7)]));const _0x39a82c=_0x387a84?(_0x4c3129,_0x23f82b,_0x273e02)=>this[_0x2ceb37(0xb6)](_0x15f6f5,_0x4c3129,_0x23f82b,_0x273e02):(_0x299136,_0x525b27,_0x313ea5)=>this[_0x2ceb37(0x94)](_0x15f6f5,_0x299136,_0x525b27,_0x313ea5,_0x1b62f4[_0x2ceb37(0xa7)]);try{await _0x39a82c(_0x341788,_0x5dece7,_0x2c9698);}catch(_0x3abef8){const _0x3fd30b=_0x3abef8 instanceof SDKError&&_0x3abef8[_0x2ceb37(0x9c)]===ErrorCode[_0x2ceb37(0x7a)]||_0x3abef8 instanceof Error&&_0x3abef8[_0x2ceb37(0x96)][_0x2ceb37(0x73)](_0x2ceb37(0xaa));if(_0x3fd30b&&_0x46879a)return console[_0x2ceb37(0x97)](_0x2ceb37(0xa6)+_0x46879a+'\x27\x20not\x20found'),0x1;if(_0x3fd30b)_0x1b62f4[_0x2ceb37(0xa7)]&&console[_0x2ceb37(0x97)](_0x2ceb37(0x7b)),!_0x5dece7&&(_0x5dece7=await resolveAgentId(_0x15f6f5,_0x4777a0,_0x7477f6,_0x316b76,_0x1b62f4[_0x2ceb37(0xa7)])),await _0x39a82c(_0x341788,_0x5dece7,undefined);else throw _0x3abef8;}return!_0x387a84&&console[_0x2ceb37(0xab)](),0x0;}catch(_0x2f43cb){return console['error'](),handleSDKError(_0x2f43cb,_0x1b62f4),0x1;}}['handleChatEvent'](_0x1fc4d1){const _0x183a13=a8_0xf61cdb;if(_0x183a13(0x99)in _0x1fc4d1)process[_0x183a13(0x81)][_0x183a13(0x76)](_0x1fc4d1['content']);else _0x183a13(0x97)in _0x1fc4d1&&console['error']('\x0aError:\x20'+_0x1fc4d1['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0xf61cdb(0x8f)]='chat-create';[a8_0xf61cdb(0x7c)]=a8_0xf61cdb(0x9a);['validate'](_0x5a9b4e){const _0x1dd84a=a8_0xf61cdb,_0x305fab=_0x5a9b4e[_0x1dd84a(0x90)],_0x472229=_0x305fab[_0x1dd84a(0xb9)],_0x4039e6=_0x305fab[_0x1dd84a(0xb7)];if(!_0x472229&&!_0x4039e6)return _0x1dd84a(0xa2);return undefined;}async[a8_0xf61cdb(0xa8)](_0x29a736){const _0x15af8a=a8_0xf61cdb,{options:_0x40ff3c,tdx:_0x332e42}=_0x29a736,_0x35b9b5=_0x40ff3c,_0x9c4f40=_0x35b9b5[_0x15af8a(0xb9)],_0xce60b5=_0x35b9b5[_0x15af8a(0xb7)],_0x42674b=_0x35b9b5['llmProject'];try{const _0x15f24b=await resolveAgentId(_0x332e42,_0x9c4f40,_0xce60b5,_0x42674b,_0x40ff3c[_0x15af8a(0xa7)]),_0xb06392=await _0x332e42[_0x15af8a(0xb3)][_0x15af8a(0x82)](_0x15f24b);return saveLastChatId(_0xb06392['id']),console['log'](JSON[_0x15af8a(0x84)]({'chatId':_0xb06392['id'],'agentId':_0x15f24b})),0x0;}catch(_0x54dd49){return handleSDKError(_0x54dd49,_0x40ff3c),0x1;}}}
|
|
@@ -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;
|
|
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;AA2KhE;;;;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;AA8ND;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,kDAAkD;IAEtE,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;CAuNxD"}
|