@treasuredata/tdx 0.25.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.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.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.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.js +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.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.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/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a3_0x24f1(_0x420439,_0x3aa920){_0x420439=_0x420439-0x69;const _0x21a86c=a3_0x21a8();let _0x24f1c3=_0x21a86c[_0x420439];return _0x24f1c3;}const a3_0x28d192=a3_0x24f1;(function(_0x4a50f5,_0x55a53a){const _0x4726fe=a3_0x24f1,_0x3fc446=_0x4a50f5();while(!![]){try{const _0x1917c7=-parseInt(_0x4726fe(0x7d))/0x1*(-parseInt(_0x4726fe(0x6a))/0x2)+-parseInt(_0x4726fe(0x78))/0x3+-parseInt(_0x4726fe(0x74))/0x4+parseInt(_0x4726fe(0x81))/0x5*(parseInt(_0x4726fe(0x80))/0x6)+parseInt(_0x4726fe(0x6f))/0x7+-parseInt(_0x4726fe(0x7b))/0x8+parseInt(_0x4726fe(0x6d))/0x9;if(_0x1917c7===_0x55a53a)break;else _0x3fc446['push'](_0x3fc446['shift']());}catch(_0x4a1481){_0x3fc446['push'](_0x3fc446['shift']());}}}(a3_0x21a8,0x532a4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x21a8(){const _0x486d0c=['2153380kxUYCH','\x20\x20Cause:\x20','verbose','✔\x20Found\x20','571164WPhWff','length','data','2973720LZhVMj','\x27...','1AYYyDn','error','\x20activation','426qVwaDQ','75zJThHc','Error:\x20Segment\x20name\x20is\x20required','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolved\x20parent\x20ID:\x20','message','Resolving\x20parent\x20segment\x20\x27','Resolving\x20child\x20segment\x20\x27','Parent\x20name:\x20','activations','execute','930294BzzYtR','listActivations','name','6289776slPvvU','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','1932112CUgZPQ','Error:\x20','cause','Site:\x20','Listing\x20activations\x20for\x20segment\x20\x27'];a3_0x21a8=function(){return _0x486d0c;};return a3_0x21a8();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x28d192(0x6c)]=a3_0x28d192(0x89);['description']='List\x20activations\x20for\x20a\x20segment';async[a3_0x28d192(0x69)](_0x4b1cce){const _0x22c452=a3_0x28d192,{options:_0x4cae4b,args:_0x304c13,tdx:_0x1fb68b}=_0x4b1cce;if(_0x304c13[_0x22c452(0x79)]===0x0)return console[_0x22c452(0x7e)](_0x22c452(0x82)),console[_0x22c452(0x7e)](_0x22c452(0x83)),0x1;try{const {parentId:_0x7e96b7,childId:_0x364bc0}=parseSegmentRef(_0x304c13[0x0]);if(!_0x364bc0)return console['error'](_0x22c452(0x6e)),console[_0x22c452(0x7e)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x4cae4b[_0x22c452(0x76)]&&(console['error'](_0x22c452(0x72)+_0x4cae4b['site']),console[_0x22c452(0x7e)](_0x22c452(0x88)+_0x7e96b7),console[_0x22c452(0x7e)]('Child\x20name:\x20'+_0x364bc0));const _0x18d000=await withSpinner(_0x22c452(0x86)+_0x7e96b7+_0x22c452(0x7c),()=>_0x1fb68b['segment']['resolveParentId'](_0x7e96b7),{'verbose':_0x4cae4b[_0x22c452(0x76)]}),_0xf03670=_0x18d000['data'];_0x4cae4b[_0x22c452(0x76)]&&console[_0x22c452(0x7e)](_0x22c452(0x84)+_0xf03670);const _0x4f95bf=await withSpinner(_0x22c452(0x87)+_0x364bc0+'\x27...',()=>_0x1fb68b['segment']['resolveSegmentId'](_0xf03670,_0x364bc0),{'verbose':_0x4cae4b[_0x22c452(0x76)]}),_0x4f341f=_0x4f95bf['data'];_0x4cae4b[_0x22c452(0x76)]&&console[_0x22c452(0x7e)]('Resolved\x20child\x20ID:\x20'+_0x4f341f);const _0x3244ed=await withSpinner(_0x22c452(0x73)+_0x364bc0+_0x22c452(0x7c),()=>_0x1fb68b['segment'][_0x22c452(0x6b)](_0xf03670,_0x4f341f),{'verbose':_0x4cae4b[_0x22c452(0x76)]}),_0x50534b=_0x3244ed[_0x22c452(0x7a)];return console['error'](_0x22c452(0x77)+_0x50534b[_0x22c452(0x79)]+_0x22c452(0x7f)+(_0x50534b['length']!==0x1?'s':'')),await handleSDKOutput(_0x50534b,_0x4cae4b),0x0;}catch(_0x3d48be){if(_0x3d48be instanceof SDKError)return console['error'](_0x22c452(0x70)+_0x3d48be[_0x22c452(0x85)]),_0x3d48be[_0x22c452(0x71)]&&console['error'](_0x22c452(0x75)+_0x3d48be['cause']),0x1;throw _0x3d48be;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x5d84ce=a4_0x524b;function a4_0x57e1(){const _0xde1231=['\x20unchanged','pullAgent','Would\x20clone:','session','repeat','sourceProjectName','-\x20nothing\x20pushed','no_context','Dry\x20run\x20-\x20no\x20changes\x20made','yes','textKnowledgeBases','llm_project','✔\x20Context\x20set:\x20','Clone\x20\x22','\x20\x20Knowledge\x20Bases:\x20','Using\x20project\x20from\x20','agentName','\x20\x20Integrations:\x20','\x0a✔\x20Pulled\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','newProjectId','352752JMciDW','Would\x20pull\x20agent:\x20','\x22...','Agent\x20pulled\x20successfully','Agent:\x20','total','MISSING_ARGUMENT','\x20\x20Text\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','48351braLsg','join','Project\x20cloned\x20with\x20errors','\x27\x20to\x20create\x20the\x20folder\x20structure.','cyan','\x0aPush\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20new','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\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','\x20total','tdx.json','site','Output\x20path:\x20','Output:\x20','\x20\x20Agents:\x20','<new-name>','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20created','New\x20project:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Summary:','108CvOUWm','2NkBBnr','error','hasChanges','agentId','dim','\x20\x20Prompt\x20\x22','projectName','yellow','new','Using\x20local\x20project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aWrite\x20','context','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Agent\x20\x22','updated','agents','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','output','Status:\x20','Cancelled','projectId','agent:clone','-\x20no\x20files\x20written','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','llmProject','\x0aProject\x20pushed\x20with\x20errors','log','\x0aError:','Writing\x20files...','No\x20tdx.json\x20found\x20in\x20','Using\x20current\x20project:\x20','message','Pulling\x20agent\x20\x22','5cebPlj','Agent\x20','\x20changed','projectDir','Using\x20context\x20project:\x20','\x20--name\x20','description','\x20\x20Target:\x20','\x0aChanges:','\x20--profile\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','prompts','profile','push','agent:pull','New\x20project\x20ID:\x20','cloneProject','green','Failed\x20to\x20push\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','10502210RdpyMo','\x22:\x20','\x0aPull\x20summary\x20for\x20\x27','230251uYQlQs','force','Analyzing\x20changes\x20to\x20push...','agent.yml','Errors:','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pushed\x20','\x0aPush\x20summary\x20for\x20\x27','counts','errors','name','2889972PYZMLc','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Would\x20push\x20agent:\x20','Source:\x20','gray','no_local_folder','\x20\x20Integration\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20successfully','\x20\x20Prompts:\x20','dryRun','Pushing\x20agent\x20from\x20\x22','cwd','\x20errors','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)','outputDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','red','utf-8','Chat:\x20','pullProject','\x20\x20Knowledge\x20Base\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','llm','421628gshsWa','Cannot\x20clone\x20from\x20context\x20project\x20\x22','execute','480215uqUDxD','Using\x20project:\x20','agent:push','Pushing\x20to\x20project...','reason','parse','integrations','pushAgent','created','newProjectName','found','\x20=\x20','diff','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','dirname','action','Project:\x20','unchanged','knowledgeBases'];a4_0x57e1=function(){return _0xde1231;};return a4_0x57e1();}(function(_0xa391a6,_0x29ee7e){const _0x1202f7=a4_0x524b,_0x1aa780=_0xa391a6();while(!![]){try{const _0x3a5067=parseInt(_0x1202f7(0x13d))/0x1*(parseInt(_0x1202f7(0x187))/0x2)+-parseInt(_0x1202f7(0x16e))/0x3+-parseInt(_0x1202f7(0x13a))/0x4*(parseInt(_0x1202f7(0x1aa))/0x5)+parseInt(_0x1202f7(0x122))/0x6+-parseInt(_0x1202f7(0x1c1))/0x7+parseInt(_0x1202f7(0x165))/0x8*(parseInt(_0x1202f7(0x186))/0x9)+-parseInt(_0x1202f7(0x1be))/0xa;if(_0x3a5067===_0x29ee7e)break;else _0x1aa780['push'](_0x1aa780['shift']());}catch(_0x3a3cd4){_0x1aa780['push'](_0x1aa780['shift']());}}}(a4_0x57e1,0x45e9f));import a4_0x7da01a from'chalk';function a4_0x524b(_0x31d5b9,_0x5ebc57){_0x31d5b9=_0x31d5b9-0x118;const _0x57e1a6=a4_0x57e1();let _0x524bae=_0x57e1a6[_0x31d5b9];return _0x524bae;}import a4_0x246e7b from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x553e72){const _0x353108=a4_0x524b,_0x50ed6d=[];if(_0x553e72['total']!==undefined)_0x50ed6d[_0x353108(0x1b7)](_0x553e72[_0x353108(0x16a)]+_0x353108(0x178));if(_0x553e72[_0x353108(0x18f)]!==undefined&&_0x553e72[_0x353108(0x18f)]>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x1bb)](_0x553e72[_0x353108(0x18f)]+_0x353108(0x175)));if(_0x553e72[_0x353108(0x145)]!==undefined&&_0x553e72[_0x353108(0x145)]>0x0)_0x50ed6d['push'](a4_0x7da01a[_0x353108(0x1bb)](_0x553e72[_0x353108(0x145)]+_0x353108(0x181)));if(_0x553e72['updated']!==undefined&&_0x553e72['updated']>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x18e)](_0x553e72['updated']+'\x20updated'));if(_0x553e72[_0x353108(0x14e)]!==undefined&&_0x553e72[_0x353108(0x14e)]>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x126)](_0x553e72['unchanged']+_0x353108(0x150)));if(_0x553e72[_0x353108(0x120)]!==undefined&&_0x553e72['errors']>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x133)](_0x553e72[_0x353108(0x120)]+_0x353108(0x12f)));return _0x50ed6d[_0x353108(0x16f)](',\x20');}function displayDiffs(_0x53a4a1,_0x360d5d,_0x26799a,_0x413a0f,_0x1d9eff=[]){const _0x4ce0a0=a4_0x524b;for(const _0xef72b4 of _0x53a4a1){if(_0xef72b4[_0x4ce0a0(0x149)]){const _0x4ad048=_0xef72b4[_0x4ce0a0(0x160)]||_0xef72b4[_0x4ce0a0(0x121)];console[_0x4ce0a0(0x1a3)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x4ad048+'\x27:'),console['log']('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0xef72b4['diff']),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c));}}for(const _0x271e9f of _0x360d5d){_0x271e9f['diff']&&(console[_0x4ce0a0(0x1a3)](_0x4ce0a0(0x176)+_0x271e9f[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'['repeat'](0x3c)),console[_0x4ce0a0(0x1a3)](_0x271e9f[_0x4ce0a0(0x149)]),console[_0x4ce0a0(0x1a3)]('─'['repeat'](0x3c)));}for(const _0xd51b38 of _0x26799a){_0xd51b38[_0x4ce0a0(0x149)]&&(console[_0x4ce0a0(0x1a3)](_0x4ce0a0(0x17f)+_0xd51b38[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0xd51b38[_0x4ce0a0(0x149)]),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)));}for(const _0x1b876c of _0x413a0f){_0x1b876c[_0x4ce0a0(0x149)]&&(console[_0x4ce0a0(0x1a3)](_0x4ce0a0(0x19f)+_0x1b876c[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0x1b876c['diff']),console[_0x4ce0a0(0x1a3)]('─'['repeat'](0x3c)));}for(const _0x1b49ea of _0x1d9eff){_0x1b49ea[_0x4ce0a0(0x149)]&&(console[_0x4ce0a0(0x1a3)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x1b49ea[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0x1b49ea[_0x4ce0a0(0x149)]),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x5d84ce(0x1b8);['description']=a4_0x5d84ce(0x138);async[a4_0x5d84ce(0x13c)](_0xd9a46a){const _0x20c8c0=a4_0x5d84ce,{options:_0x10f0ce,args:_0x3aa877,tdx:_0x50d656}=_0xd9a46a,_0x28de78=_0x3aa877[0x0],_0x266286=_0x3aa877[0x1],_0x522079=_0x10f0ce[_0x20c8c0(0x199)],_0x12b46f=_0x10f0ce['dryRun'],_0x175fef=_0x10f0ce[_0x20c8c0(0x1c2)],_0x403541=_0x10f0ce[_0x20c8c0(0x159)],_0x3d2063=_0x10f0ce[_0x20c8c0(0x1a1)];let _0x39ed7f,_0xf9a1b1;const _0x3f9181=findAgentConfigPath(process['cwd']());if(_0x28de78){const _0x33b2cc=a4_0x246e7b[_0x20c8c0(0x16f)](_0x28de78,_0x20c8c0(0x179));if(existsSync(_0x33b2cc))try{const _0x33b0b3=JSON[_0x20c8c0(0x142)](readFileSync(_0x33b2cc,_0x20c8c0(0x134)));_0x39ed7f=_0x33b0b3[_0x20c8c0(0x15b)],_0xf9a1b1=_0x28de78,console['log'](a4_0x7da01a[_0x20c8c0(0x18b)](_0x20c8c0(0x15f)+_0x33b2cc+':\x20'+_0x39ed7f));}catch{_0x39ed7f=_0x28de78;}else _0x39ed7f=_0x28de78;}else{if(_0x3f9181)try{const _0x3fef1f=JSON[_0x20c8c0(0x142)](readFileSync(_0x3f9181,_0x20c8c0(0x134)));_0x39ed7f=_0x3fef1f[_0x20c8c0(0x15b)],_0xf9a1b1=a4_0x246e7b[_0x20c8c0(0x14b)](_0x3f9181),console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18b)](_0x20c8c0(0x13e)+_0x39ed7f));}catch{_0x39ed7f=_0x3d2063;}else _0x39ed7f=_0x3d2063;}if(!_0x39ed7f)return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18e)](_0x20c8c0(0x1b4))),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x130)),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x180)),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x177)),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x132)),0x1;if(_0x266286){const {data:_0x362509}=await withSpinner(_0x20c8c0(0x1a9)+_0x266286+'\x22\x20from\x20project\x20\x22'+_0x39ed7f+'\x22...',()=>_0x50d656[_0x20c8c0(0x139)][_0x20c8c0(0x151)](_0x39ed7f,_0x266286,_0x522079,{'dryRun':_0x12b46f,'force':_0x175fef}));if(_0x12b46f)return console['log'](a4_0x7da01a[_0x20c8c0(0x18e)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x166)+_0x362509['agentName']),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x17b)+_0x362509['outputPath']),_0x362509[_0x20c8c0(0x149)]&&(console[_0x20c8c0(0x1a3)](_0x20c8c0(0x1b2)),console[_0x20c8c0(0x1a3)]('─'[_0x20c8c0(0x154)](0x3c)),console[_0x20c8c0(0x1a3)](_0x362509[_0x20c8c0(0x149)]),console[_0x20c8c0(0x1a3)]('─'['repeat'](0x3c))),0x0;return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x1bb)](_0x20c8c0(0x168))),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x169)+_0x362509[_0x20c8c0(0x160)]),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x17c)+_0x362509['outputPath']),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x19a)+(_0x362509['isNew']?a4_0x7da01a[_0x20c8c0(0x1bb)](_0x20c8c0(0x18f)):_0x362509[_0x20c8c0(0x189)]?a4_0x7da01a[_0x20c8c0(0x18e)]('updated'):a4_0x7da01a['gray'](_0x20c8c0(0x14e)))),0x0;}const _0x570091=_0xf9a1b1||_0x522079,{data:_0x1b768f}=await withSpinner('Analyzing\x20project\x20\x22'+_0x39ed7f+_0x20c8c0(0x167),()=>_0x50d656[_0x20c8c0(0x139)][_0x20c8c0(0x136)](_0x39ed7f,_0x570091,{'dryRun':!![]})),_0x49ac95=_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x197)]['new']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x14f)][_0x20c8c0(0x18f)]+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)][_0x20c8c0(0x18f)]+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x1b5)]['new']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x143)]['new'],_0x7cb790=_0x1b768f['counts'][_0x20c8c0(0x197)][_0x20c8c0(0x196)]+_0x1b768f['counts'][_0x20c8c0(0x14f)]['updated']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)][_0x20c8c0(0x196)]+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x1b5)][_0x20c8c0(0x196)]+_0x1b768f['counts'][_0x20c8c0(0x143)][_0x20c8c0(0x196)],_0x598b2e=_0x1b768f['counts'][_0x20c8c0(0x197)][_0x20c8c0(0x14e)]+_0x1b768f['counts']['knowledgeBases']['unchanged']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)][_0x20c8c0(0x14e)]+_0x1b768f[_0x20c8c0(0x11f)]['prompts'][_0x20c8c0(0x14e)]+_0x1b768f['counts']['integrations'][_0x20c8c0(0x14e)];console[_0x20c8c0(0x1a3)](_0x20c8c0(0x1c0)+_0x1b768f['projectName']+'\x27:'),console[_0x20c8c0(0x1a3)]('\x20\x20'+a4_0x7da01a['green']('+\x20'+_0x49ac95+_0x20c8c0(0x175))+_0x20c8c0(0x1a0)+a4_0x7da01a['yellow']('~\x20'+_0x7cb790+_0x20c8c0(0x1ac))+_0x20c8c0(0x1a0)+a4_0x7da01a['dim']('=\x20'+_0x598b2e+'\x20unchanged')),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x17d)+formatCountSummary(_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x197)])),console[_0x20c8c0(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1b768f['counts'][_0x20c8c0(0x14f)])),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x16c)+formatCountSummary(_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)])),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x12b)+formatCountSummary(_0x1b768f['counts'][_0x20c8c0(0x1b5)])),console['log'](_0x20c8c0(0x161)+formatCountSummary(_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x143)])),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x1b1)+a4_0x7da01a[_0x20c8c0(0x172)](_0x1b768f['outputDir'])),displayDiffs(_0x1b768f['agents'],_0x1b768f[_0x20c8c0(0x14f)],_0x1b768f[_0x20c8c0(0x15a)],_0x1b768f['prompts'],_0x1b768f[_0x20c8c0(0x143)]);if(_0x12b46f)return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18e)](_0x20c8c0(0x123))),0x0;if(_0x49ac95===0x0&&_0x7cb790===0x0)return console[_0x20c8c0(0x1a3)](a4_0x7da01a['green'](_0x20c8c0(0x191))),saveSessionContext({'llm_project':_0x1b768f[_0x20c8c0(0x18d)]},_0x10f0ce[_0x20c8c0(0x153)]),console['log'](a4_0x7da01a['green'](_0x20c8c0(0x15c)+a4_0x7da01a['dim'](_0x20c8c0(0x15b))+_0x20c8c0(0x148)+a4_0x7da01a[_0x20c8c0(0x172)](_0x1b768f[_0x20c8c0(0x18d)]))),0x0;if(!_0x403541&&!_0x175fef){if(!isInteractive())return console[_0x20c8c0(0x188)](a4_0x7da01a[_0x20c8c0(0x133)](_0x20c8c0(0x1a4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20c8c0(0x188)](a4_0x7da01a['dim'](_0x20c8c0(0x129))),0x1;const _0x4c7cd9=await confirmKey(_0x20c8c0(0x192)+(_0x49ac95+_0x7cb790)+'\x20files?');if(!_0x4c7cd9)return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18e)](_0x20c8c0(0x19b)),_0x20c8c0(0x19e)),0x1;}const {data:_0x44df3c}=await withSpinner(_0x20c8c0(0x1a5),()=>_0x50d656['llm'][_0x20c8c0(0x136)](_0x39ed7f,_0x570091,{'force':_0x175fef}));return console[_0x20c8c0(0x1a3)](a4_0x7da01a['green'](_0x20c8c0(0x162)+(_0x49ac95+_0x7cb790)+'\x20files\x20to\x20'+_0x44df3c[_0x20c8c0(0x131)])),saveSessionContext({'llm_project':_0x44df3c[_0x20c8c0(0x18d)]},_0x10f0ce['session']),console['log'](a4_0x7da01a['green']('✔\x20Context\x20set:\x20'+a4_0x7da01a['dim'](_0x20c8c0(0x15b))+'\x20=\x20'+a4_0x7da01a['cyan'](_0x44df3c[_0x20c8c0(0x18d)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5d84ce(0x121)]=a4_0x5d84ce(0x19d);[a4_0x5d84ce(0x1b0)]=a4_0x5d84ce(0x198);async['execute'](_0x7c7f6){const _0x58cb67=a4_0x5d84ce,{options:_0x18bbf5,args:_0x379895,tdx:_0x57ae8b}=_0x7c7f6,_0x263af2=_0x379895[0x0],_0x17c990=_0x18bbf5['name'],_0x50e87d=_0x18bbf5[_0x58cb67(0x12c)],_0x1d19a6=_0x18bbf5[_0x58cb67(0x159)],_0x47ef1d=_0x18bbf5[_0x58cb67(0x17a)],_0x1f9970=_0x18bbf5[_0x58cb67(0x1a1)];let _0x4324c1;const _0x538227=findAgentConfigPath(process['cwd']());if(_0x263af2){const _0x2744c2=a4_0x246e7b['join'](_0x263af2,_0x58cb67(0x179));existsSync(_0x2744c2)?(_0x4324c1=_0x263af2,console[_0x58cb67(0x1a3)](a4_0x7da01a['dim'](_0x58cb67(0x190)+_0x263af2))):_0x4324c1=_0x263af2;}else{if(_0x538227)_0x4324c1=a4_0x246e7b[_0x58cb67(0x14b)](_0x538227),console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x18b)](_0x58cb67(0x1a7)+_0x4324c1));else{if(_0x1f9970){const _0x541021=sanitizeForFilesystem(_0x1f9970);let _0x24a054=_0x541021,_0x26dbb1=a4_0x246e7b['join'](process['cwd'](),_0x58cb67(0x197),_0x541021,_0x58cb67(0x179));if(!existsSync(_0x26dbb1)){const _0x4073e6=normalizeName(_0x1f9970),_0x5c7c4a=a4_0x246e7b[_0x58cb67(0x16f)](process[_0x58cb67(0x12e)](),'agents',_0x4073e6,_0x58cb67(0x179));existsSync(_0x5c7c4a)&&(_0x24a054=_0x4073e6,_0x26dbb1=_0x5c7c4a);}if(existsSync(_0x26dbb1))_0x4324c1=a4_0x246e7b[_0x58cb67(0x14b)](_0x26dbb1),console[_0x58cb67(0x1a3)](a4_0x7da01a['dim'](_0x58cb67(0x190)+_0x4324c1));else{const _0x4162d8=_0x18bbf5[_0x58cb67(0x1b6)];if(_0x4162d8)throw new SDKError(ErrorCode[_0x58cb67(0x16d)],_0x58cb67(0x13b)+_0x1f9970+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x58cb67(0x194)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x58cb67(0x174)+_0x1f9970+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x24a054+_0x58cb67(0x1af)+(_0x17c990||_0x58cb67(0x17e))+_0x58cb67(0x1b3)+_0x4162d8)});_0x4324c1=_0x1f9970,console['log'](a4_0x7da01a[_0x58cb67(0x18b)](_0x58cb67(0x1ae)+_0x1f9970));}}}}if(!_0x4324c1)return console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x18e)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x58cb67(0x1a3)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x58cb67(0x1a3)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x58cb67(0x1a3)]('\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'](_0x58cb67(0x11c)),0x1;if(!_0x17c990)throw new SDKError(ErrorCode[_0x58cb67(0x16b)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x58cb67(0x163)});if(!_0x1d19a6&&!_0x50e87d){if(!isInteractive())return console[_0x58cb67(0x188)](a4_0x7da01a[_0x58cb67(0x133)](_0x58cb67(0x1a4)),_0x58cb67(0x184)),console[_0x58cb67(0x188)](a4_0x7da01a['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x58b6eb=await confirmKey(_0x58cb67(0x15d)+_0x4324c1+'\x22\x20to\x20new\x20project\x20\x22'+_0x17c990+'\x22?');if(!_0x58b6eb)return console[_0x58cb67(0x1a3)](a4_0x7da01a['yellow'](_0x58cb67(0x19b))),0x1;}const {data:_0x41aa44}=await withSpinner('Cloning\x20\x22'+_0x4324c1+'\x22\x20to\x20\x22'+_0x17c990+_0x58cb67(0x167),()=>_0x57ae8b[_0x58cb67(0x139)][_0x58cb67(0x1ba)](_0x4324c1,_0x17c990,{'dryRun':_0x50e87d}));if(_0x50e87d)return console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x18e)](_0x58cb67(0x158))),console['log'](_0x58cb67(0x125)+_0x41aa44[_0x58cb67(0x155)]),console['log'](_0x58cb67(0x182)+_0x17c990),console['log'](_0x58cb67(0x152)),console[_0x58cb67(0x1a3)](_0x58cb67(0x17d)+_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x197)][_0x58cb67(0x145)]),console[_0x58cb67(0x1a3)](_0x58cb67(0x15e)+_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x14f)][_0x58cb67(0x145)]),console[_0x58cb67(0x1a3)]('\x20\x20Prompts:\x20'+_0x41aa44['counts'][_0x58cb67(0x1b5)]['created']),0x0;const _0x32d637=_0x41aa44[_0x58cb67(0x11f)]['agents'][_0x58cb67(0x120)]>0x0||_0x41aa44[_0x58cb67(0x11f)]['knowledgeBases'][_0x58cb67(0x120)]>0x0||_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x1b5)][_0x58cb67(0x120)]>0x0;_0x32d637?console['log'](a4_0x7da01a[_0x58cb67(0x18e)](_0x58cb67(0x170))):console['log'](a4_0x7da01a['green']('Project\x20cloned\x20successfully'));console[_0x58cb67(0x1a3)]('Source:\x20'+_0x41aa44[_0x58cb67(0x155)]),console[_0x58cb67(0x1a3)](_0x58cb67(0x182)+_0x41aa44[_0x58cb67(0x146)]),console[_0x58cb67(0x1a3)](_0x58cb67(0x1b9)+_0x41aa44[_0x58cb67(0x164)]),console[_0x58cb67(0x1a3)](),console['log'](_0x58cb67(0x185)),console[_0x58cb67(0x1a3)](_0x58cb67(0x17d)+formatCountSummary(_0x41aa44['counts']['agents'])),console[_0x58cb67(0x1a3)](_0x58cb67(0x15e)+formatCountSummary(_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x14f)])),console[_0x58cb67(0x1a3)](_0x58cb67(0x12b)+formatCountSummary(_0x41aa44['counts']['prompts'])),console['log'](_0x58cb67(0x161)+formatCountSummary(_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x143)]));if(_0x32d637){console[_0x58cb67(0x1a3)](),console['log'](a4_0x7da01a[_0x58cb67(0x133)](_0x58cb67(0x11a)));for(const _0x4b100a of _0x41aa44[_0x58cb67(0x197)]){_0x4b100a['action']===_0x58cb67(0x188)&&console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x133)](_0x58cb67(0x195)+_0x4b100a['agentName']+_0x58cb67(0x1bf)+_0x4b100a[_0x58cb67(0x188)]));}for(const _0x51e4f8 of _0x41aa44[_0x58cb67(0x14f)]){_0x51e4f8['action']==='error'&&console['log'](a4_0x7da01a['red'](_0x58cb67(0x137)+_0x51e4f8[_0x58cb67(0x121)]+_0x58cb67(0x1bf)+_0x51e4f8['error']));}for(const _0x5d962d of _0x41aa44[_0x58cb67(0x1b5)]){_0x5d962d[_0x58cb67(0x14c)]===_0x58cb67(0x188)&&console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x133)]('\x20\x20Prompt\x20\x22'+_0x5d962d[_0x58cb67(0x121)]+_0x58cb67(0x1bf)+_0x5d962d['error']));}for(const _0x1b8cf7 of _0x41aa44['integrations']){_0x1b8cf7['action']===_0x58cb67(0x188)&&console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x133)]('\x20\x20Integration\x20\x22'+_0x1b8cf7[_0x58cb67(0x121)]+_0x58cb67(0x1bf)+_0x1b8cf7['error']));}return 0x1;}console['log']();const _0x1d78ee=getLLMProjectUrl(_0x47ef1d,_0x41aa44[_0x58cb67(0x164)]);return console[_0x58cb67(0x1a3)](_0x58cb67(0x14d)+a4_0x7da01a[_0x58cb67(0x172)](_0x1d78ee)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5d84ce(0x121)]=a4_0x5d84ce(0x13f);[a4_0x5d84ce(0x1b0)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0x4bd06b){const _0x3a0615=a4_0x5d84ce,{options:_0xb648,args:_0xa00e0f,tdx:_0x43885d}=_0x4bd06b;let _0x1e7d3b=_0xa00e0f[0x0]||process['cwd']();const _0x56362f=_0xb648[_0x3a0615(0x12c)],_0x415fae=_0xb648[_0x3a0615(0x1c2)],_0x397802=_0xb648[_0x3a0615(0x159)],_0x5ec88e=_0xb648[_0x3a0615(0x17a)],_0x496d94=a4_0x246e7b['join'](_0x1e7d3b,_0x3a0615(0x119)),_0xe42347=existsSync(_0x496d94);if(_0xe42347){const {data:_0x22d07c}=await withSpinner(_0x3a0615(0x12d)+_0x1e7d3b+_0x3a0615(0x167),()=>_0x43885d[_0x3a0615(0x139)][_0x3a0615(0x144)](_0x1e7d3b,{'dryRun':_0x56362f,'force':_0x415fae}));if(_0x56362f)return console[_0x3a0615(0x1a3)](a4_0x7da01a['yellow'](_0x3a0615(0x158))),console[_0x3a0615(0x1a3)](_0x3a0615(0x124)+_0x22d07c[_0x3a0615(0x160)]),0x0;if(_0x22d07c[_0x3a0615(0x14c)]===_0x3a0615(0x188))return console['log'](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x1bc)+_0x22d07c[_0x3a0615(0x188)])),0x1;console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x1bb)](_0x3a0615(0x1ab)+_0x22d07c['action']+_0x3a0615(0x12a))),console[_0x3a0615(0x1a3)](_0x3a0615(0x169)+_0x22d07c[_0x3a0615(0x160)]);if(_0x22d07c[_0x3a0615(0x18a)]&&_0x22d07c[_0x3a0615(0x19c)]){const _0x2b87ba=getLLMAgentChatUrl(_0x5ec88e,_0x22d07c[_0x3a0615(0x19c)],_0x22d07c[_0x3a0615(0x18a)]);console[_0x3a0615(0x1a3)](_0x3a0615(0x135)+a4_0x7da01a[_0x3a0615(0x172)](_0x2b87ba));}return 0x0;}const _0x1e281e=_0xb648[_0x3a0615(0x1a1)],_0x469b63=resolveProjectFromContext(_0x1e7d3b,_0x1e281e);if(_0x469b63[_0x3a0615(0x147)])_0x1e7d3b=_0x469b63[_0x3a0615(0x1ad)],_0x469b63['source']===_0x3a0615(0x193)&&console['log'](a4_0x7da01a[_0x3a0615(0x18b)](_0x3a0615(0x13e)+_0x1e7d3b));else{let _0xfdbe6a='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x469b63[_0x3a0615(0x141)]===_0x3a0615(0x127)&&(_0xfdbe6a=_0x469b63['message']+_0x3a0615(0x14a)+_0x469b63[_0x3a0615(0x1a1)]+_0x3a0615(0x171));throw new SDKError(ErrorCode[_0x3a0615(0x16d)],_0x469b63[_0x3a0615(0x141)]===_0x3a0615(0x157)?_0x469b63[_0x3a0615(0x1a8)]:_0x3a0615(0x1a6)+_0x1e7d3b,undefined,{'helpText':_0xfdbe6a});}const {data:_0x5a561d}=await withSpinner(_0x3a0615(0x118),()=>_0x43885d[_0x3a0615(0x139)]['pushProject'](_0x1e7d3b,{'dryRun':!![]})),_0x32d5fd=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)][_0x3a0615(0x120)]>0x0;if(_0x32d5fd){console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)]('\x0aErrors\x20found:'));for(const _0x62a20b of _0x5a561d['agents']){_0x62a20b['action']==='error'&&console['log'](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x195)+_0x62a20b[_0x3a0615(0x160)]+'\x22:\x20'+_0x62a20b[_0x3a0615(0x188)]));}return 0x1;}const _0x87bc2=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)][_0x3a0615(0x145)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x14f)][_0x3a0615(0x145)]+_0x5a561d[_0x3a0615(0x11f)]['textKnowledgeBases']['created']+_0x5a561d[_0x3a0615(0x11f)]['prompts']['created']+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x143)][_0x3a0615(0x145)],_0x1a6eb3=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)]['updated']+_0x5a561d['counts'][_0x3a0615(0x14f)][_0x3a0615(0x196)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x15a)][_0x3a0615(0x196)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x1b5)][_0x3a0615(0x196)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x143)][_0x3a0615(0x196)],_0x1c87bf=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)][_0x3a0615(0x14e)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x14f)][_0x3a0615(0x14e)]+_0x5a561d['counts'][_0x3a0615(0x15a)][_0x3a0615(0x14e)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x1b5)]['unchanged']+_0x5a561d['counts'][_0x3a0615(0x143)]['unchanged'];console[_0x3a0615(0x1a3)](_0x3a0615(0x11e)+_0x5a561d[_0x3a0615(0x18d)]+'\x27:'),console[_0x3a0615(0x1a3)]('\x20\x20'+a4_0x7da01a[_0x3a0615(0x1bb)]('+\x20'+_0x87bc2+_0x3a0615(0x175))+_0x3a0615(0x1a0)+a4_0x7da01a[_0x3a0615(0x18e)]('~\x20'+_0x1a6eb3+_0x3a0615(0x1ac))+'\x20|\x20'+a4_0x7da01a[_0x3a0615(0x18b)]('=\x20'+_0x1c87bf+_0x3a0615(0x150))),console['log'](_0x3a0615(0x17d)+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)])),console[_0x3a0615(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x14f)])),console[_0x3a0615(0x1a3)](_0x3a0615(0x16c)+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x15a)])),console[_0x3a0615(0x1a3)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x1b5)])),console[_0x3a0615(0x1a3)](_0x3a0615(0x161)+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x143)])),console[_0x3a0615(0x1a3)]('\x20\x20Source:\x20'+a4_0x7da01a[_0x3a0615(0x172)](_0x1e7d3b)),displayDiffs(_0x5a561d['agents'],_0x5a561d['knowledgeBases'],_0x5a561d[_0x3a0615(0x15a)],_0x5a561d[_0x3a0615(0x1b5)],_0x5a561d[_0x3a0615(0x143)]);if(_0x56362f)return console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x18e)](_0x3a0615(0x1bd))),0x0;if(_0x87bc2===0x0&&_0x1a6eb3===0x0){console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x1bb)](_0x3a0615(0x183)));const _0x5ba224=getLLMProjectUrl(_0x5ec88e,_0x5a561d['projectId']);return console['log'](_0x3a0615(0x14d)+a4_0x7da01a['cyan'](_0x5ba224)),0x0;}if(!_0x397802&&!_0x415fae){if(!isInteractive())return console['error'](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x1a4)),_0x3a0615(0x184)),console[_0x3a0615(0x188)](a4_0x7da01a[_0x3a0615(0x18b)](_0x3a0615(0x129))),0x1;const _0x10971e=await confirmKey(_0x3a0615(0x173)+(_0x87bc2+_0x1a6eb3)+'\x20resources?');if(!_0x10971e)return console['log'](a4_0x7da01a['yellow'](_0x3a0615(0x19b)),_0x3a0615(0x156)),0x1;}const {data:_0x34d0c9}=await withSpinner(_0x3a0615(0x140),()=>_0x43885d['llm']['pushProject'](_0x1e7d3b,{'force':_0x415fae})),_0x4fed59=_0x34d0c9[_0x3a0615(0x11f)]['agents'][_0x3a0615(0x120)]>0x0||_0x34d0c9[_0x3a0615(0x11f)][_0x3a0615(0x14f)][_0x3a0615(0x120)]>0x0||_0x34d0c9['counts'][_0x3a0615(0x15a)]['errors']>0x0||_0x34d0c9[_0x3a0615(0x11f)][_0x3a0615(0x1b5)][_0x3a0615(0x120)]>0x0;if(_0x4fed59){console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x18e)](_0x3a0615(0x1a2))),console[_0x3a0615(0x1a3)](),console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x11a)));for(const _0x4af046 of _0x34d0c9[_0x3a0615(0x197)]){_0x4af046[_0x3a0615(0x14c)]===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a['red'](_0x3a0615(0x195)+_0x4af046[_0x3a0615(0x160)]+'\x22:\x20'+_0x4af046['error']));}for(const _0x87b25e of _0x34d0c9[_0x3a0615(0x14f)]){_0x87b25e[_0x3a0615(0x14c)]==='error'&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x137)+_0x87b25e[_0x3a0615(0x121)]+_0x3a0615(0x1bf)+_0x87b25e['error']));}for(const _0x365b86 of _0x34d0c9[_0x3a0615(0x15a)]){_0x365b86['action']===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x11b)+_0x365b86['name']+_0x3a0615(0x1bf)+_0x365b86[_0x3a0615(0x188)]));}for(const _0x566dc8 of _0x34d0c9[_0x3a0615(0x1b5)]){_0x566dc8[_0x3a0615(0x14c)]===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x18c)+_0x566dc8[_0x3a0615(0x121)]+_0x3a0615(0x1bf)+_0x566dc8['error']));}for(const _0x5648ea of _0x34d0c9[_0x3a0615(0x143)]){_0x5648ea[_0x3a0615(0x14c)]===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x128)+_0x5648ea['name']+_0x3a0615(0x1bf)+_0x5648ea[_0x3a0615(0x188)]));}return 0x1;}console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x1bb)](_0x3a0615(0x11d)+(_0x87bc2+_0x1a6eb3)+'\x20resources\x20to\x20\x27'+_0x34d0c9[_0x3a0615(0x18d)]+'\x27'));const _0x3250d9=getLLMProjectUrl(_0x5ec88e,_0x34d0c9[_0x3a0615(0x19c)]);return console[_0x3a0615(0x1a3)](_0x3a0615(0x14d)+a4_0x7da01a[_0x3a0615(0x172)](_0x3250d9)),0x0;}}
|
|
1
|
+
const a4_0x2792dd=a4_0x3a41;(function(_0x4ac163,_0x5585b1){const _0x3bd8c1=a4_0x3a41,_0x47939c=_0x4ac163();while(!![]){try{const _0x7bd762=parseInt(_0x3bd8c1(0x115))/0x1+parseInt(_0x3bd8c1(0x155))/0x2*(parseInt(_0x3bd8c1(0x19d))/0x3)+-parseInt(_0x3bd8c1(0x109))/0x4+-parseInt(_0x3bd8c1(0x122))/0x5*(parseInt(_0x3bd8c1(0x129))/0x6)+parseInt(_0x3bd8c1(0x157))/0x7+parseInt(_0x3bd8c1(0x18b))/0x8*(-parseInt(_0x3bd8c1(0x13e))/0x9)+parseInt(_0x3bd8c1(0x134))/0xa*(parseInt(_0x3bd8c1(0x147))/0xb);if(_0x7bd762===_0x5585b1)break;else _0x47939c['push'](_0x47939c['shift']());}catch(_0x24028d){_0x47939c['push'](_0x47939c['shift']());}}}(a4_0xc8d2,0xb4e37));function a4_0xc8d2(){const _0x3d36ad=['\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','\x20\x20Prompt\x20\x22','\x22:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aChanges:','repeat','found','Would\x20clone:','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pushed\x20','cwd','dryRun','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','log','\x20total','Pushing\x20agent\x20from\x20\x22','New\x20project:\x20','profile','\x27\x20to\x20create\x20the\x20folder\x20structure.','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)','textKnowledgeBases','Source:\x20','join','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0aErrors\x20found:','newProjectName','Using\x20current\x20project:\x20','Agent:\x20','\x0aPush\x20summary\x20for\x20\x27','\x0aPush\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','8YVMIxQ','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Agents:\x20','projectDir','dirname','Pushing\x20to\x20project...','site','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20files\x20to\x20','integrations','yellow','\x20\x20Integrations:\x20','dim','prompts','agent:push','reason','session','No\x20tdx.json\x20found\x20in\x20','3CqdjCM','new','unchanged','name','\x20|\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','newProjectId','Pulling\x20agent\x20\x22','Project:\x20','counts','context','knowledgeBases','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20resources\x20to\x20\x27','no_local_folder','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20--profile\x20','\x22\x20to\x20\x22','4325984CzyfQW','\x20\x20Source:\x20','\x20new','llmProject','Analyzing\x20project\x20\x22','message','\x20created','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','updated','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','yes','962380USYFQv','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','diff','New\x20project\x20ID:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x0aError:','\x20updated','Chat:\x20','✔\x20Context\x20set:\x20','\x0a✔\x20Pulled\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','cyan','5nHkqss','Clone\x20\x22','Would\x20push\x20agent:\x20','isNew','\x0aWrite\x20','-\x20nothing\x20pushed','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','4178658NYurgL','pushProject','agents','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','pullProject','\x20\x20Knowledge\x20Bases:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','errors','Using\x20project\x20from\x20','Errors:','7300010TVAmqr','agentName','\x20changed','\x0aChanges\x20to\x20prompt\x20\x27','green','push','\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','llm','\x20unchanged','projectId','2134053MsRDof','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','execute','description','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','llm_project','outputPath','parse','action','11nGMlMN','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Integration\x20\x22','utf-8','\x0aProject\x20pushed\x20with\x20errors','\x20errors','output','\x20successfully','tdx.json','hasChanges','agent:pull','\x22...','Using\x20local\x20project:\x20','\x20\x20Agent\x20\x22','827362NDaUUP','\x20\x20Prompts:\x20','4549391RmTfMp','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Using\x20project:\x20','force','agentId','-\x20no\x20files\x20written','cloneProject','Status:\x20','projectName','red','Cancelled','Agent\x20pulled\x20successfully','error','pushAgent','Output\x20path:\x20','INVALID_ARGUMENT','Writing\x20files...','agent:clone','total','\x0aPull\x20summary\x20for\x20\x27'];a4_0xc8d2=function(){return _0x3d36ad;};return a4_0xc8d2();}import a4_0x4e5e88 from'chalk';import a4_0x28e3c8 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x3a41(_0x1d1f2c,_0x256d98){_0x1d1f2c=_0x1d1f2c-0x104;const _0xc8d211=a4_0xc8d2();let _0x3a4158=_0xc8d211[_0x1d1f2c];return _0x3a4158;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1d22f3){const _0x3aafe3=a4_0x3a41,_0x397152=[];if(_0x1d22f3[_0x3aafe3(0x16a)]!==undefined)_0x397152[_0x3aafe3(0x139)](_0x1d22f3[_0x3aafe3(0x16a)]+_0x3aafe3(0x17a));if(_0x1d22f3[_0x3aafe3(0x19e)]!==undefined&&_0x1d22f3[_0x3aafe3(0x19e)]>0x0)_0x397152[_0x3aafe3(0x139)](a4_0x4e5e88['green'](_0x1d22f3[_0x3aafe3(0x19e)]+_0x3aafe3(0x10b)));if(_0x1d22f3['created']!==undefined&&_0x1d22f3[_0x3aafe3(0x105)]>0x0)_0x397152[_0x3aafe3(0x139)](a4_0x4e5e88['green'](_0x1d22f3[_0x3aafe3(0x105)]+_0x3aafe3(0x10f)));if(_0x1d22f3[_0x3aafe3(0x112)]!==undefined&&_0x1d22f3[_0x3aafe3(0x112)]>0x0)_0x397152[_0x3aafe3(0x139)](a4_0x4e5e88[_0x3aafe3(0x195)](_0x1d22f3[_0x3aafe3(0x112)]+_0x3aafe3(0x11c)));if(_0x1d22f3[_0x3aafe3(0x19f)]!==undefined&&_0x1d22f3[_0x3aafe3(0x19f)]>0x0)_0x397152[_0x3aafe3(0x139)](a4_0x4e5e88['gray'](_0x1d22f3['unchanged']+'\x20unchanged'));if(_0x1d22f3[_0x3aafe3(0x131)]!==undefined&&_0x1d22f3[_0x3aafe3(0x131)]>0x0)_0x397152[_0x3aafe3(0x139)](a4_0x4e5e88['red'](_0x1d22f3['errors']+_0x3aafe3(0x14c)));return _0x397152[_0x3aafe3(0x182)](',\x20');}function displayDiffs(_0x174a43,_0x1cb58f,_0x699c6c,_0x1eff39,_0x4ef205=[]){const _0x58c3ac=a4_0x3a41;for(const _0x4ef7db of _0x174a43){if(_0x4ef7db[_0x58c3ac(0x118)]){const _0x558cd9=_0x4ef7db[_0x58c3ac(0x135)]||_0x4ef7db[_0x58c3ac(0x1a0)];console[_0x58c3ac(0x179)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x558cd9+'\x27:'),console[_0x58c3ac(0x179)]('─'[_0x58c3ac(0x171)](0x3c)),console[_0x58c3ac(0x179)](_0x4ef7db[_0x58c3ac(0x118)]),console['log']('─'[_0x58c3ac(0x171)](0x3c));}}for(const _0x3a2f8d of _0x1cb58f){_0x3a2f8d[_0x58c3ac(0x118)]&&(console[_0x58c3ac(0x179)](_0x58c3ac(0x18a)+_0x3a2f8d[_0x58c3ac(0x1a0)]+'\x27:'),console['log']('─'[_0x58c3ac(0x171)](0x3c)),console[_0x58c3ac(0x179)](_0x3a2f8d[_0x58c3ac(0x118)]),console['log']('─'['repeat'](0x3c)));}for(const _0x8786f9 of _0x699c6c){_0x8786f9[_0x58c3ac(0x118)]&&(console['log'](_0x58c3ac(0x183)+_0x8786f9[_0x58c3ac(0x1a0)]+'\x27:'),console['log']('─'[_0x58c3ac(0x171)](0x3c)),console['log'](_0x8786f9[_0x58c3ac(0x118)]),console['log']('─'[_0x58c3ac(0x171)](0x3c)));}for(const _0x1ec910 of _0x1eff39){_0x1ec910['diff']&&(console[_0x58c3ac(0x179)](_0x58c3ac(0x137)+_0x1ec910[_0x58c3ac(0x1a0)]+'\x27:'),console[_0x58c3ac(0x179)]('─'[_0x58c3ac(0x171)](0x3c)),console[_0x58c3ac(0x179)](_0x1ec910[_0x58c3ac(0x118)]),console['log']('─'[_0x58c3ac(0x171)](0x3c)));}for(const _0x38ad19 of _0x4ef205){_0x38ad19[_0x58c3ac(0x118)]&&(console[_0x58c3ac(0x179)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x38ad19[_0x58c3ac(0x1a0)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x58c3ac(0x179)](_0x38ad19['diff']),console['log']('─'[_0x58c3ac(0x171)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2792dd(0x1a0)]=a4_0x2792dd(0x151);[a4_0x2792dd(0x141)]=a4_0x2792dd(0x1a3);async[a4_0x2792dd(0x140)](_0x3c0a8c){const _0x210f97=a4_0x2792dd,{options:_0x424250,args:_0x520c19,tdx:_0x4bd76a}=_0x3c0a8c,_0xf1c21e=_0x520c19[0x0],_0x5d9788=_0x520c19[0x1],_0x231bfe=_0x424250[_0x210f97(0x14d)],_0x29bed1=_0x424250[_0x210f97(0x177)],_0x3607c5=_0x424250['force'],_0x380b11=_0x424250[_0x210f97(0x114)],_0x443601=_0x424250['llmProject'];let _0x42b9ab,_0x57d20e;const _0x45e493=findAgentConfigPath(process[_0x210f97(0x176)]());if(_0xf1c21e){const _0x4378c1=a4_0x28e3c8[_0x210f97(0x182)](_0xf1c21e,_0x210f97(0x14f));if(existsSync(_0x4378c1))try{const _0x2f3c29=JSON[_0x210f97(0x145)](readFileSync(_0x4378c1,'utf-8'));_0x42b9ab=_0x2f3c29[_0x210f97(0x143)],_0x57d20e=_0xf1c21e,console[_0x210f97(0x179)](a4_0x4e5e88[_0x210f97(0x197)](_0x210f97(0x132)+_0x4378c1+':\x20'+_0x42b9ab));}catch{_0x42b9ab=_0xf1c21e;}else _0x42b9ab=_0xf1c21e;}else{if(_0x45e493)try{const _0x563275=JSON['parse'](readFileSync(_0x45e493,_0x210f97(0x14a)));_0x42b9ab=_0x563275[_0x210f97(0x143)],_0x57d20e=a4_0x28e3c8['dirname'](_0x45e493),console[_0x210f97(0x179)](a4_0x4e5e88[_0x210f97(0x197)](_0x210f97(0x15a)+_0x42b9ab));}catch{_0x42b9ab=_0x443601;}else _0x42b9ab=_0x443601;}if(!_0x42b9ab)return console[_0x210f97(0x179)](a4_0x4e5e88[_0x210f97(0x195)](_0x210f97(0x142))),console[_0x210f97(0x179)](_0x210f97(0x17f)),console[_0x210f97(0x179)](_0x210f97(0x13a)),console[_0x210f97(0x179)](_0x210f97(0x16c)),console[_0x210f97(0x179)](_0x210f97(0x128)),0x1;if(_0x5d9788){const {data:_0x4fc9af}=await withSpinner(_0x210f97(0x1a5)+_0x5d9788+'\x22\x20from\x20project\x20\x22'+_0x42b9ab+'\x22...',()=>_0x4bd76a['llm']['pullAgent'](_0x42b9ab,_0x5d9788,_0x231bfe,{'dryRun':_0x29bed1,'force':_0x3607c5}));if(_0x29bed1)return console[_0x210f97(0x179)](a4_0x4e5e88['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x210f97(0x179)]('Would\x20pull\x20agent:\x20'+_0x4fc9af['agentName']),console[_0x210f97(0x179)](_0x210f97(0x166)+_0x4fc9af[_0x210f97(0x144)]),_0x4fc9af[_0x210f97(0x118)]&&(console[_0x210f97(0x179)](_0x210f97(0x170)),console[_0x210f97(0x179)]('─'['repeat'](0x3c)),console[_0x210f97(0x179)](_0x4fc9af[_0x210f97(0x118)]),console[_0x210f97(0x179)]('─'[_0x210f97(0x171)](0x3c))),0x0;return console['log'](a4_0x4e5e88[_0x210f97(0x138)](_0x210f97(0x163))),console['log'](_0x210f97(0x187)+_0x4fc9af[_0x210f97(0x135)]),console[_0x210f97(0x179)]('Output:\x20'+_0x4fc9af['outputPath']),console['log'](_0x210f97(0x15f)+(_0x4fc9af[_0x210f97(0x125)]?a4_0x4e5e88[_0x210f97(0x138)](_0x210f97(0x19e)):_0x4fc9af[_0x210f97(0x150)]?a4_0x4e5e88['yellow'](_0x210f97(0x112)):a4_0x4e5e88['gray'](_0x210f97(0x19f)))),0x0;}const _0x457fa7=_0x57d20e||_0x231bfe,{data:_0x200baf}=await withSpinner(_0x210f97(0x10d)+_0x42b9ab+_0x210f97(0x152),()=>_0x4bd76a['llm'][_0x210f97(0x12e)](_0x42b9ab,_0x457fa7,{'dryRun':!![]})),_0x47c33a=_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x12b)][_0x210f97(0x19e)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x1a9)][_0x210f97(0x19e)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x180)][_0x210f97(0x19e)]+_0x200baf['counts'][_0x210f97(0x198)][_0x210f97(0x19e)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x194)][_0x210f97(0x19e)],_0x2138d6=_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x12b)][_0x210f97(0x112)]+_0x200baf[_0x210f97(0x1a7)]['knowledgeBases'][_0x210f97(0x112)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x180)]['updated']+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x198)][_0x210f97(0x112)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x194)][_0x210f97(0x112)],_0x241d30=_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x12b)][_0x210f97(0x19f)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x1a9)][_0x210f97(0x19f)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x180)][_0x210f97(0x19f)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x198)][_0x210f97(0x19f)]+_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x194)][_0x210f97(0x19f)];console[_0x210f97(0x179)](_0x210f97(0x16b)+_0x200baf[_0x210f97(0x160)]+'\x27:'),console[_0x210f97(0x179)]('\x20\x20'+a4_0x4e5e88[_0x210f97(0x138)]('+\x20'+_0x47c33a+'\x20new')+_0x210f97(0x1a1)+a4_0x4e5e88[_0x210f97(0x195)]('~\x20'+_0x2138d6+_0x210f97(0x136))+'\x20|\x20'+a4_0x4e5e88[_0x210f97(0x197)]('=\x20'+_0x241d30+_0x210f97(0x13c))),console[_0x210f97(0x179)]('\x20\x20Agents:\x20'+formatCountSummary(_0x200baf['counts']['agents'])),console[_0x210f97(0x179)](_0x210f97(0x12f)+formatCountSummary(_0x200baf['counts']['knowledgeBases'])),console[_0x210f97(0x179)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x200baf[_0x210f97(0x1a7)]['textKnowledgeBases'])),console[_0x210f97(0x179)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x198)])),console[_0x210f97(0x179)](_0x210f97(0x196)+formatCountSummary(_0x200baf[_0x210f97(0x1a7)][_0x210f97(0x194)])),console[_0x210f97(0x179)]('\x20\x20Target:\x20'+a4_0x4e5e88[_0x210f97(0x121)](_0x200baf['outputDir'])),displayDiffs(_0x200baf[_0x210f97(0x12b)],_0x200baf['knowledgeBases'],_0x200baf[_0x210f97(0x180)],_0x200baf['prompts'],_0x200baf['integrations']);if(_0x29bed1)return console['log'](a4_0x4e5e88[_0x210f97(0x195)](_0x210f97(0x106))),0x0;if(_0x47c33a===0x0&&_0x2138d6===0x0)return console[_0x210f97(0x179)](a4_0x4e5e88[_0x210f97(0x138)](_0x210f97(0x16f))),saveSessionContext({'llm_project':_0x200baf['projectName']},_0x424250[_0x210f97(0x19b)]),console[_0x210f97(0x179)](a4_0x4e5e88['green']('✔\x20Context\x20set:\x20'+a4_0x4e5e88['dim']('llm_project')+'\x20=\x20'+a4_0x4e5e88['cyan'](_0x200baf[_0x210f97(0x160)]))),0x0;if(!_0x380b11&&!_0x3607c5){if(!isInteractive())return console[_0x210f97(0x164)](a4_0x4e5e88[_0x210f97(0x161)](_0x210f97(0x11b)),_0x210f97(0x116)),console[_0x210f97(0x164)](a4_0x4e5e88[_0x210f97(0x197)](_0x210f97(0x159))),0x1;const _0x3758a6=await confirmKey(_0x210f97(0x126)+(_0x47c33a+_0x2138d6)+'\x20files?');if(!_0x3758a6)return console[_0x210f97(0x179)](a4_0x4e5e88[_0x210f97(0x195)](_0x210f97(0x162)),_0x210f97(0x15d)),0x1;}const {data:_0xa95f05}=await withSpinner(_0x210f97(0x168),()=>_0x4bd76a[_0x210f97(0x13b)]['pullProject'](_0x42b9ab,_0x457fa7,{'force':_0x3607c5}));return console['log'](a4_0x4e5e88[_0x210f97(0x138)](_0x210f97(0x11f)+(_0x47c33a+_0x2138d6)+_0x210f97(0x193)+_0xa95f05['outputDir'])),saveSessionContext({'llm_project':_0xa95f05['projectName']},_0x424250[_0x210f97(0x19b)]),console[_0x210f97(0x179)](a4_0x4e5e88[_0x210f97(0x138)](_0x210f97(0x11e)+a4_0x4e5e88[_0x210f97(0x197)]('llm_project')+'\x20=\x20'+a4_0x4e5e88['cyan'](_0xa95f05[_0x210f97(0x160)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2792dd(0x1a0)]=a4_0x2792dd(0x169);[a4_0x2792dd(0x141)]=a4_0x2792dd(0x158);async[a4_0x2792dd(0x140)](_0x2dab33){const _0x90c95f=a4_0x2792dd,{options:_0x5ad129,args:_0x215f5d,tdx:_0x1703ff}=_0x2dab33,_0x14b624=_0x215f5d[0x0],_0x5e2783=_0x5ad129[_0x90c95f(0x1a0)],_0x34899b=_0x5ad129[_0x90c95f(0x177)],_0x4d6320=_0x5ad129[_0x90c95f(0x114)],_0x502f57=_0x5ad129[_0x90c95f(0x191)],_0x402239=_0x5ad129[_0x90c95f(0x10c)];let _0x5c57d6;const _0x30c389=findAgentConfigPath(process[_0x90c95f(0x176)]());if(_0x14b624){const _0x5e22e5=a4_0x28e3c8[_0x90c95f(0x182)](_0x14b624,_0x90c95f(0x14f));existsSync(_0x5e22e5)?(_0x5c57d6=_0x14b624,console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x197)](_0x90c95f(0x153)+_0x14b624))):_0x5c57d6=_0x14b624;}else{if(_0x30c389)_0x5c57d6=a4_0x28e3c8[_0x90c95f(0x18f)](_0x30c389),console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x197)](_0x90c95f(0x186)+_0x5c57d6));else{if(_0x402239){const _0x3aedce=sanitizeForFilesystem(_0x402239);let _0x3c8520=_0x3aedce,_0x5519d3=a4_0x28e3c8[_0x90c95f(0x182)](process[_0x90c95f(0x176)](),_0x90c95f(0x12b),_0x3aedce,_0x90c95f(0x14f));if(!existsSync(_0x5519d3)){const _0x4ffe80=normalizeName(_0x402239),_0x48f42c=a4_0x28e3c8[_0x90c95f(0x182)](process[_0x90c95f(0x176)](),'agents',_0x4ffe80,'tdx.json');existsSync(_0x48f42c)&&(_0x3c8520=_0x4ffe80,_0x5519d3=_0x48f42c);}if(existsSync(_0x5519d3))_0x5c57d6=a4_0x28e3c8[_0x90c95f(0x18f)](_0x5519d3),console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x197)](_0x90c95f(0x153)+_0x5c57d6));else{const _0xde5972=_0x5ad129[_0x90c95f(0x17d)];if(_0xde5972)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x90c95f(0x192)+_0x402239+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x90c95f(0x110)+_0x90c95f(0x178)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x402239+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3c8520+'\x20--name\x20'+(_0x5e2783||'<new-name>')+_0x90c95f(0x107)+_0xde5972)});_0x5c57d6=_0x402239,console[_0x90c95f(0x179)](a4_0x4e5e88['dim']('Using\x20context\x20project:\x20'+_0x402239));}}}}if(!_0x5c57d6)return console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x195)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x90c95f(0x179)](_0x90c95f(0x13f)),console['log'](_0x90c95f(0x12d)),console[_0x90c95f(0x179)](_0x90c95f(0x1a2)),console[_0x90c95f(0x179)](_0x90c95f(0x174)),0x1;if(!_0x5e2783)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x90c95f(0x113)});if(!_0x4d6320&&!_0x34899b){if(!isInteractive())return console[_0x90c95f(0x164)](a4_0x4e5e88[_0x90c95f(0x161)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x90c95f(0x164)](a4_0x4e5e88['dim'](_0x90c95f(0x159))),0x1;const _0x4787f1=await confirmKey(_0x90c95f(0x123)+_0x5c57d6+'\x22\x20to\x20new\x20project\x20\x22'+_0x5e2783+'\x22?');if(!_0x4787f1)return console[_0x90c95f(0x179)](a4_0x4e5e88['yellow'](_0x90c95f(0x162))),0x1;}const {data:_0x4f193e}=await withSpinner('Cloning\x20\x22'+_0x5c57d6+_0x90c95f(0x108)+_0x5e2783+'\x22...',()=>_0x1703ff[_0x90c95f(0x13b)][_0x90c95f(0x15e)](_0x5c57d6,_0x5e2783,{'dryRun':_0x34899b}));if(_0x34899b)return console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x195)](_0x90c95f(0x130))),console[_0x90c95f(0x179)]('Source:\x20'+_0x4f193e['sourceProjectName']),console['log'](_0x90c95f(0x17c)+_0x5e2783),console[_0x90c95f(0x179)](_0x90c95f(0x173)),console[_0x90c95f(0x179)](_0x90c95f(0x18d)+_0x4f193e['counts']['agents'][_0x90c95f(0x105)]),console['log'](_0x90c95f(0x12f)+_0x4f193e['counts'][_0x90c95f(0x1a9)][_0x90c95f(0x105)]),console[_0x90c95f(0x179)](_0x90c95f(0x156)+_0x4f193e[_0x90c95f(0x1a7)]['prompts'][_0x90c95f(0x105)]),0x0;const _0x3b875a=_0x4f193e[_0x90c95f(0x1a7)][_0x90c95f(0x12b)]['errors']>0x0||_0x4f193e['counts']['knowledgeBases'][_0x90c95f(0x131)]>0x0||_0x4f193e['counts']['prompts'][_0x90c95f(0x131)]>0x0;_0x3b875a?console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x195)]('Project\x20cloned\x20with\x20errors')):console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x138)]('Project\x20cloned\x20successfully'));console[_0x90c95f(0x179)](_0x90c95f(0x181)+_0x4f193e['sourceProjectName']),console[_0x90c95f(0x179)](_0x90c95f(0x17c)+_0x4f193e[_0x90c95f(0x185)]),console['log'](_0x90c95f(0x119)+_0x4f193e[_0x90c95f(0x1a4)]),console[_0x90c95f(0x179)](),console['log']('Summary:'),console[_0x90c95f(0x179)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4f193e[_0x90c95f(0x1a7)][_0x90c95f(0x12b)])),console[_0x90c95f(0x179)](_0x90c95f(0x12f)+formatCountSummary(_0x4f193e[_0x90c95f(0x1a7)]['knowledgeBases'])),console[_0x90c95f(0x179)](_0x90c95f(0x156)+formatCountSummary(_0x4f193e[_0x90c95f(0x1a7)]['prompts'])),console[_0x90c95f(0x179)](_0x90c95f(0x196)+formatCountSummary(_0x4f193e[_0x90c95f(0x1a7)]['integrations']));if(_0x3b875a){console[_0x90c95f(0x179)](),console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x161)](_0x90c95f(0x133)));for(const _0x2137ea of _0x4f193e[_0x90c95f(0x12b)]){_0x2137ea[_0x90c95f(0x146)]===_0x90c95f(0x164)&&console['log'](a4_0x4e5e88[_0x90c95f(0x161)]('\x20\x20Agent\x20\x22'+_0x2137ea[_0x90c95f(0x135)]+'\x22:\x20'+_0x2137ea[_0x90c95f(0x164)]));}for(const _0x97cf7 of _0x4f193e[_0x90c95f(0x1a9)]){_0x97cf7[_0x90c95f(0x146)]===_0x90c95f(0x164)&&console['log'](a4_0x4e5e88[_0x90c95f(0x161)](_0x90c95f(0x11a)+_0x97cf7['name']+_0x90c95f(0x16e)+_0x97cf7['error']));}for(const _0x434f2d of _0x4f193e[_0x90c95f(0x198)]){_0x434f2d[_0x90c95f(0x146)]===_0x90c95f(0x164)&&console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x161)](_0x90c95f(0x16d)+_0x434f2d['name']+_0x90c95f(0x16e)+_0x434f2d['error']));}for(const _0x4ef33b of _0x4f193e[_0x90c95f(0x194)]){_0x4ef33b[_0x90c95f(0x146)]===_0x90c95f(0x164)&&console[_0x90c95f(0x179)](a4_0x4e5e88[_0x90c95f(0x161)](_0x90c95f(0x149)+_0x4ef33b[_0x90c95f(0x1a0)]+'\x22:\x20'+_0x4ef33b['error']));}return 0x1;}console[_0x90c95f(0x179)]();const _0x6abcb6=getLLMProjectUrl(_0x502f57,_0x4f193e[_0x90c95f(0x1a4)]);return console[_0x90c95f(0x179)](_0x90c95f(0x1a6)+a4_0x4e5e88[_0x90c95f(0x121)](_0x6abcb6)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2792dd(0x1a0)]=a4_0x2792dd(0x199);[a4_0x2792dd(0x141)]=a4_0x2792dd(0x120);async[a4_0x2792dd(0x140)](_0x5e06f3){const _0x4452b7=a4_0x2792dd,{options:_0x495d11,args:_0x524b50,tdx:_0x5522a7}=_0x5e06f3;let _0x4362ab=_0x524b50[0x0]||process[_0x4452b7(0x176)]();const _0x2c5ca6=_0x495d11[_0x4452b7(0x177)],_0x4a2c81=_0x495d11[_0x4452b7(0x15b)],_0x425256=_0x495d11[_0x4452b7(0x114)],_0x3c8b5b=_0x495d11['site'],_0x229d03=a4_0x28e3c8[_0x4452b7(0x182)](_0x4362ab,'agent.yml'),_0x2c46d8=existsSync(_0x229d03);if(_0x2c46d8){const {data:_0x5b9e87}=await withSpinner(_0x4452b7(0x17b)+_0x4362ab+'\x22...',()=>_0x5522a7['llm'][_0x4452b7(0x165)](_0x4362ab,{'dryRun':_0x2c5ca6,'force':_0x4a2c81}));if(_0x2c5ca6)return console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x195)](_0x4452b7(0x130))),console[_0x4452b7(0x179)](_0x4452b7(0x124)+_0x5b9e87['agentName']),0x0;if(_0x5b9e87[_0x4452b7(0x146)]===_0x4452b7(0x164))return console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)](_0x4452b7(0x12c)+_0x5b9e87[_0x4452b7(0x164)])),0x1;console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x138)]('Agent\x20'+_0x5b9e87['action']+_0x4452b7(0x14e))),console['log']('Agent:\x20'+_0x5b9e87[_0x4452b7(0x135)]);if(_0x5b9e87[_0x4452b7(0x15c)]&&_0x5b9e87[_0x4452b7(0x13d)]){const _0x1b1c3f=getLLMAgentChatUrl(_0x3c8b5b,_0x5b9e87[_0x4452b7(0x13d)],_0x5b9e87[_0x4452b7(0x15c)]);console['log'](_0x4452b7(0x11d)+a4_0x4e5e88['cyan'](_0x1b1c3f));}return 0x0;}const _0xed9e9e=_0x495d11[_0x4452b7(0x10c)],_0x2cc196=resolveProjectFromContext(_0x4362ab,_0xed9e9e);if(_0x2cc196[_0x4452b7(0x172)])_0x4362ab=_0x2cc196[_0x4452b7(0x18e)],_0x2cc196['source']===_0x4452b7(0x1a8)&&console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x197)]('Using\x20project:\x20'+_0x4362ab));else{let _0x181e31=_0x4452b7(0x111);_0x2cc196[_0x4452b7(0x19a)]===_0x4452b7(0x104)&&(_0x181e31=_0x2cc196[_0x4452b7(0x10e)]+_0x4452b7(0x148)+_0x2cc196[_0x4452b7(0x10c)]+_0x4452b7(0x17e));throw new SDKError(ErrorCode[_0x4452b7(0x167)],_0x2cc196[_0x4452b7(0x19a)]==='no_context'?_0x2cc196['message']:_0x4452b7(0x19c)+_0x4362ab,undefined,{'helpText':_0x181e31});}const {data:_0x430a2f}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x5522a7[_0x4452b7(0x13b)][_0x4452b7(0x12a)](_0x4362ab,{'dryRun':!![]})),_0x2eb510=_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x12b)][_0x4452b7(0x131)]>0x0;if(_0x2eb510){console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)](_0x4452b7(0x184)));for(const _0x127571 of _0x430a2f[_0x4452b7(0x12b)]){_0x127571['action']===_0x4452b7(0x164)&&console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)](_0x4452b7(0x154)+_0x127571['agentName']+'\x22:\x20'+_0x127571['error']));}return 0x1;}const _0x409b36=_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x12b)][_0x4452b7(0x105)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x1a9)][_0x4452b7(0x105)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x180)][_0x4452b7(0x105)]+_0x430a2f['counts'][_0x4452b7(0x198)][_0x4452b7(0x105)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x194)][_0x4452b7(0x105)],_0x398b9e=_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x12b)][_0x4452b7(0x112)]+_0x430a2f[_0x4452b7(0x1a7)]['knowledgeBases'][_0x4452b7(0x112)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x180)]['updated']+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x198)][_0x4452b7(0x112)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x194)]['updated'],_0x54ec7f=_0x430a2f[_0x4452b7(0x1a7)]['agents'][_0x4452b7(0x19f)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x1a9)][_0x4452b7(0x19f)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x180)][_0x4452b7(0x19f)]+_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x198)][_0x4452b7(0x19f)]+_0x430a2f[_0x4452b7(0x1a7)]['integrations'][_0x4452b7(0x19f)];console['log'](_0x4452b7(0x188)+_0x430a2f['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x4e5e88[_0x4452b7(0x138)]('+\x20'+_0x409b36+'\x20new')+_0x4452b7(0x1a1)+a4_0x4e5e88['yellow']('~\x20'+_0x398b9e+_0x4452b7(0x136))+_0x4452b7(0x1a1)+a4_0x4e5e88[_0x4452b7(0x197)]('=\x20'+_0x54ec7f+_0x4452b7(0x13c))),console[_0x4452b7(0x179)](_0x4452b7(0x18d)+formatCountSummary(_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x12b)])),console[_0x4452b7(0x179)](_0x4452b7(0x12f)+formatCountSummary(_0x430a2f['counts']['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x430a2f['counts'][_0x4452b7(0x180)])),console[_0x4452b7(0x179)](_0x4452b7(0x156)+formatCountSummary(_0x430a2f[_0x4452b7(0x1a7)]['prompts'])),console[_0x4452b7(0x179)](_0x4452b7(0x196)+formatCountSummary(_0x430a2f[_0x4452b7(0x1a7)][_0x4452b7(0x194)])),console['log'](_0x4452b7(0x10a)+a4_0x4e5e88[_0x4452b7(0x121)](_0x4362ab)),displayDiffs(_0x430a2f['agents'],_0x430a2f['knowledgeBases'],_0x430a2f[_0x4452b7(0x180)],_0x430a2f[_0x4452b7(0x198)],_0x430a2f[_0x4452b7(0x194)]);if(_0x2c5ca6)return console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x195)](_0x4452b7(0x117))),0x0;if(_0x409b36===0x0&&_0x398b9e===0x0){console['log'](a4_0x4e5e88[_0x4452b7(0x138)](_0x4452b7(0x18c)));const _0x2e01fb=getLLMProjectUrl(_0x3c8b5b,_0x430a2f[_0x4452b7(0x13d)]);return console['log'](_0x4452b7(0x1a6)+a4_0x4e5e88[_0x4452b7(0x121)](_0x2e01fb)),0x0;}if(!_0x425256&&!_0x4a2c81){if(!isInteractive())return console[_0x4452b7(0x164)](a4_0x4e5e88[_0x4452b7(0x161)]('\x0aError:'),_0x4452b7(0x116)),console[_0x4452b7(0x164)](a4_0x4e5e88[_0x4452b7(0x197)](_0x4452b7(0x159))),0x1;const _0x13089d=await confirmKey(_0x4452b7(0x189)+(_0x409b36+_0x398b9e)+'\x20resources?');if(!_0x13089d)return console['log'](a4_0x4e5e88[_0x4452b7(0x195)]('Cancelled'),_0x4452b7(0x127)),0x1;}const {data:_0x20fc00}=await withSpinner(_0x4452b7(0x190),()=>_0x5522a7[_0x4452b7(0x13b)][_0x4452b7(0x12a)](_0x4362ab,{'force':_0x4a2c81})),_0x1f0d25=_0x20fc00['counts'][_0x4452b7(0x12b)][_0x4452b7(0x131)]>0x0||_0x20fc00[_0x4452b7(0x1a7)][_0x4452b7(0x1a9)][_0x4452b7(0x131)]>0x0||_0x20fc00[_0x4452b7(0x1a7)][_0x4452b7(0x180)][_0x4452b7(0x131)]>0x0||_0x20fc00[_0x4452b7(0x1a7)][_0x4452b7(0x198)][_0x4452b7(0x131)]>0x0;if(_0x1f0d25){console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x195)](_0x4452b7(0x14b))),console[_0x4452b7(0x179)](),console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)]('Errors:'));for(const _0x484852 of _0x20fc00[_0x4452b7(0x12b)]){_0x484852[_0x4452b7(0x146)]===_0x4452b7(0x164)&&console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)]('\x20\x20Agent\x20\x22'+_0x484852[_0x4452b7(0x135)]+'\x22:\x20'+_0x484852[_0x4452b7(0x164)]));}for(const _0xd1ecca of _0x20fc00[_0x4452b7(0x1a9)]){_0xd1ecca[_0x4452b7(0x146)]===_0x4452b7(0x164)&&console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)](_0x4452b7(0x11a)+_0xd1ecca[_0x4452b7(0x1a0)]+_0x4452b7(0x16e)+_0xd1ecca['error']));}for(const _0x54294e of _0x20fc00[_0x4452b7(0x180)]){_0x54294e[_0x4452b7(0x146)]===_0x4452b7(0x164)&&console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)](_0x4452b7(0x1aa)+_0x54294e[_0x4452b7(0x1a0)]+'\x22:\x20'+_0x54294e[_0x4452b7(0x164)]));}for(const _0x47ffeb of _0x20fc00['prompts']){_0x47ffeb[_0x4452b7(0x146)]===_0x4452b7(0x164)&&console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x161)](_0x4452b7(0x16d)+_0x47ffeb['name']+_0x4452b7(0x16e)+_0x47ffeb[_0x4452b7(0x164)]));}for(const _0x229cb1 of _0x20fc00[_0x4452b7(0x194)]){_0x229cb1[_0x4452b7(0x146)]===_0x4452b7(0x164)&&console['log'](a4_0x4e5e88['red']('\x20\x20Integration\x20\x22'+_0x229cb1[_0x4452b7(0x1a0)]+'\x22:\x20'+_0x229cb1['error']));}return 0x1;}console[_0x4452b7(0x179)](a4_0x4e5e88[_0x4452b7(0x138)](_0x4452b7(0x175)+(_0x409b36+_0x398b9e)+_0x4452b7(0x1ab)+_0x20fc00['projectName']+'\x27'));const _0x5817a3=getLLMProjectUrl(_0x3c8b5b,_0x20fc00[_0x4452b7(0x13d)]);return console[_0x4452b7(0x179)](_0x4452b7(0x1a6)+a4_0x4e5e88[_0x4452b7(0x121)](_0x5817a3)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x2a298d=a5_0x5cdc;function a5_0x5cdc(_0x9efe37,_0x4f4318){_0x9efe37=_0x9efe37-0x17c;const _0x3324db=a5_0x3324();let _0x5cdc4f=_0x3324db[_0x9efe37];return _0x5cdc4f;}function a5_0x3324(){const _0x417451=['yellow','executeReeval','Either\x20switch\x20to\x20the\x20\x22','reeval','Test\x20','some','71044EiUHeF','9pjjraH','207473EHzoTI','start','table','3tiKwrR','\x20\x20Agent:\x20','⚠\x20SKIPPED:\x20','171832yrxgAT','projectName','rounds','utf-8','✗\x20FAIL:\x20','Project\x20path:\x20','split','404','found','resolve','length','Cached\x20run\x20is\x20from\x20site\x20\x22','execute','verbose','cyan','json','Test\x20Configuration:','conversation_url','No\x20tests\x20found\x20with\x20tags:\x20','PASS','Executing\x20new\x20tests...','✗\x20ERROR:\x20Project\x20not\x20found:\x20','1500145wuEnwa','map','no_tests','Available\x20tests:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','has','Evaluating\x20response...','trim','repeat','✗\x20ERROR:\x20','llm','Round\x20','\x20\x20Round\x20','tests','...','substring','\x20\x20Project:\x20','testYmlPath','Site:\x20','Error\x20writing\x20output\x20file:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','output','toLowerCase','find','Total:\x20\x20\x20\x20','status','tsv','tags','FAIL','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agent','2709XVHlfl','\x20-\x20','site','\x27\x20to\x20create\x20the\x20folder\x20structure.','testName','add','agent:test','ERROR','stop','562168YWPhPK','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','reason','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20','projectDir','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','text','✓\x20PASS:\x20','\x20(new)','jsonl','now','Running\x20test:\x20',':\x20Sending\x20user\x20input...','\x20(cached)','Agent:\x20','filter','/<agent-name>','...\x20','dim','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','name','no_context','10DxzJrT','Output\x20written\x20to:\x20','Tests\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Duration:\x20','Errors:\x20\x20\x20','log','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','round','not\x20found','\x22:\x20','includes','context','\x20\x20Conversation:\x20','\x20\x20Site:\x20','agentDirs','Test\x20Summary','multiple_agents','push','resolveAgentId','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20-\x20','agentName','7194UQlZUJ','toISOString','Round\x201/','Using\x20agent:\x20','llmProject','white','\x20\x20Evaluating...\x20','source','Cached\x20run\x20from:\x20','message','red','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','green','test.yml','no_local_folder','join','7791487NjyvlV','existsSync','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','writeFileSync','Conversation\x20URL:\x20','resolveProjectId','isSpinning','Failed:\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'];a5_0x3324=function(){return _0x417451;};return a5_0x3324();}(function(_0x29b359,_0x44ce9d){const _0x184c9d=a5_0x5cdc,_0x1057aa=_0x29b359();while(!![]){try{const _0x5a732f=-parseInt(_0x184c9d(0x209))/0x1+parseInt(_0x184c9d(0x207))/0x2+parseInt(_0x184c9d(0x20c))/0x3*(-parseInt(_0x184c9d(0x20f))/0x4)+parseInt(_0x184c9d(0x191))/0x5+parseInt(_0x184c9d(0x1e8))/0x6*(-parseInt(_0x184c9d(0x1b1))/0x7)+-parseInt(_0x184c9d(0x1ba))/0x8*(parseInt(_0x184c9d(0x208))/0x9)+-parseInt(_0x184c9d(0x1d1))/0xa*(-parseInt(_0x184c9d(0x1f8))/0xb);if(_0x5a732f===_0x44ce9d)break;else _0x1057aa['push'](_0x1057aa['shift']());}catch(_0x2a90ad){_0x1057aa['push'](_0x1057aa['shift']());}}}(a5_0x3324,0x3f451));import*as a5_0x254c45 from'node:fs';import*as a5_0x4e7ede from'node:path';import a5_0xe176b 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';export class AgentTestCommand extends BaseCommand{[a5_0x2a298d(0x1cf)]=a5_0x2a298d(0x1b7);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x2a298d(0x187)](_0x4f9771){const _0x176cd8=a5_0x2a298d,{options:_0x1c0545,args:_0x184f2a,tdx:_0x24029d}=_0x4f9771,_0x2ea2e3=_0x184f2a[0x0]||'.',_0x45bfef=_0x1c0545['dryRun'],_0x30e851=_0x1c0545,_0x3eb44d=_0x30e851['eval']===![],_0x6fc78a=_0x30e851[_0x176cd8(0x204)],_0x3af441=_0x30e851['name'],_0x5d7990=_0x30e851['tags'],_0x96c282=_0x1c0545[_0x176cd8(0x1b3)],_0x1c103b=_0x30e851[_0x176cd8(0x1a7)];if(_0x6fc78a&&_0x3eb44d)return console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x1c0))),0x1;let _0x4b9d6a=_0x176cd8(0x20b);if(_0x30e851['json'])_0x4b9d6a=_0x176cd8(0x18a);else{if(_0x30e851['jsonl'])_0x4b9d6a=_0x176cd8(0x1c4);else{if(_0x30e851['tsv'])_0x4b9d6a=_0x176cd8(0x1ac);else{if(_0x30e851[_0x176cd8(0x20b)])_0x4b9d6a='table';}}}const _0x1cf9e0=_0x30e851['llmProject'];let _0x5eebbe=_0x2ea2e3;const _0x597be6=a5_0x254c45[_0x176cd8(0x1f9)](_0x2ea2e3),_0x5564d7=_0x2ea2e3==='.';if(!_0x597be6||_0x5564d7){const _0x32c9ff=resolveProjectFromContext(_0x2ea2e3,_0x1cf9e0,{'requireFile':_0x176cd8(0x1f5)});if(_0x32c9ff[_0x176cd8(0x183)])_0x5eebbe=_0x32c9ff[_0x176cd8(0x1bf)],_0x32c9ff[_0x176cd8(0x1ef)]===_0x176cd8(0x1dd)&&console['log'](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x1eb)+_0x5eebbe));else switch(_0x32c9ff[_0x176cd8(0x1bc)]){case _0x176cd8(0x1d0):console[_0x176cd8(0x1d7)](a5_0xe176b['yellow'](_0x32c9ff[_0x176cd8(0x1f1)])),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)]('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x176cd8(0x1d7)]('\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[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1fa));return 0x1;case _0x176cd8(0x1f6):console['log'](a5_0xe176b[_0x176cd8(0x201)](_0x32c9ff[_0x176cd8(0x1f1)])),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1be)+_0x32c9ff[_0x176cd8(0x1ec)]+_0x176cd8(0x1b4));return 0x1;case _0x176cd8(0x1e2):{const _0x2f65f9=a5_0x4e7ede['basename'](_0x32c9ff['projectDir']);console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x201)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x32c9ff[_0x176cd8(0x1ec)]+'\x22:'));for(const _0x50fb1d of _0x32c9ff[_0x176cd8(0x1e0)]){console[_0x176cd8(0x1d7)](_0x176cd8(0x1e6)+_0x50fb1d);}return console['log'](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1f3)+_0x2f65f9+_0x176cd8(0x1cb)),0x1;}case _0x176cd8(0x193):console[_0x176cd8(0x1d7)](a5_0xe176b['yellow'](_0x176cd8(0x1a5)+_0x32c9ff[_0x176cd8(0x1ec)]+'\x22.')),console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x180)+_0x32c9ff['projectDir'])),console['log'](),console[_0x176cd8(0x1d7)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x332691,agentInfo:_0x75c9b8}=parseTestFile(_0x5eebbe);let _0x503f8e=_0x332691['tests'];if(_0x3af441){const _0x481f68=_0x3af441['split'](',')['map'](_0x582f0d=>_0x582f0d['trim']());_0x503f8e=_0x332691[_0x176cd8(0x19e)][_0x176cd8(0x1ca)](_0x5d7a14=>_0x481f68[_0x176cd8(0x1dc)](_0x5d7a14[_0x176cd8(0x1cf)]));if(_0x503f8e['length']===0x0)return console['log'](a5_0xe176b['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x3af441)),console[_0x176cd8(0x1d7)](a5_0xe176b['dim'](_0x176cd8(0x194)+_0x332691[_0x176cd8(0x19e)][_0x176cd8(0x192)](_0x36a691=>_0x36a691[_0x176cd8(0x1cf)])[_0x176cd8(0x1f7)](',\x20'))),0x1;}if(_0x5d7990){const _0x47d0c8=_0x5d7990[_0x176cd8(0x181)](',')['map'](_0x4477b7=>_0x4477b7[_0x176cd8(0x198)]()[_0x176cd8(0x1a8)]());_0x503f8e=_0x503f8e[_0x176cd8(0x1ca)](_0x1fb807=>_0x1fb807[_0x176cd8(0x1ad)]?.[_0x176cd8(0x206)](_0x184a24=>_0x47d0c8[_0x176cd8(0x1dc)](_0x184a24[_0x176cd8(0x1a8)]())));if(_0x503f8e[_0x176cd8(0x185)]===0x0){console['log'](a5_0xe176b['yellow'](_0x176cd8(0x18d)+_0x5d7990));const _0x474d39=new Set();return _0x332691[_0x176cd8(0x19e)]['forEach'](_0xa4f8d3=>_0xa4f8d3['tags']?.['forEach'](_0x3f5406=>_0x474d39[_0x176cd8(0x1b6)](_0x3f5406))),_0x474d39['size']>0x0?console[_0x176cd8(0x1d7)](a5_0xe176b['dim']('Available\x20tags:\x20'+[..._0x474d39][_0x176cd8(0x1f7)](',\x20'))):console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x6fc78a)return this[_0x176cd8(0x202)](_0x4f9771,{'definition':{'tests':_0x503f8e},'agentInfo':_0x75c9b8,'outputFormat':_0x4b9d6a,'outputFile':_0x1c103b,'testNames':_0x3af441});if(_0x45bfef){console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x189)](_0x176cd8(0x18b))),console['log'](_0x176cd8(0x1df)+a5_0xe176b['white'](_0x96c282)),console[_0x176cd8(0x1d7)](_0x176cd8(0x1a1)+a5_0xe176b[_0x176cd8(0x1ed)](_0x75c9b8[_0x176cd8(0x17c)])),console[_0x176cd8(0x1d7)](_0x176cd8(0x20d)+a5_0xe176b[_0x176cd8(0x1ed)](_0x75c9b8[_0x176cd8(0x1e7)])),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1d3)+a5_0xe176b['white'](_0x503f8e['length']));for(let _0x17efed=0x0;_0x17efed<_0x503f8e[_0x176cd8(0x185)];_0x17efed++){const _0x5933dc=_0x503f8e[_0x17efed],_0x2228bb=_0x5933dc[_0x176cd8(0x17d)][_0x176cd8(0x185)]===0x1?_0x176cd8(0x1d9):'rounds',_0x1e565f=_0x5933dc['tags']?.['length']?'\x20['+_0x5933dc[_0x176cd8(0x1ad)][_0x176cd8(0x1f7)](',\x20')+']':'';console[_0x176cd8(0x1d7)]('\x20\x20'+(_0x17efed+0x1)+'.\x20'+a5_0xe176b['white'](_0x5933dc[_0x176cd8(0x1cf)])+'\x20('+_0x5933dc[_0x176cd8(0x17d)][_0x176cd8(0x185)]+'\x20'+_0x2228bb+')'+a5_0xe176b[_0x176cd8(0x1cd)](_0x1e565f));}return 0x0;}let _0x2aabba,_0x1b7bbd;try{_0x2aabba=await _0x24029d[_0x176cd8(0x19b)][_0x176cd8(0x1fd)](_0x75c9b8[_0x176cd8(0x17c)]);}catch(_0x33536b){const _0x324761=_0x33536b instanceof Error?_0x33536b['message']:String(_0x33536b);return _0x324761[_0x176cd8(0x1dc)](_0x176cd8(0x182))||_0x324761['toLowerCase']()[_0x176cd8(0x1dc)](_0x176cd8(0x1da))?console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x190)+_0x75c9b8[_0x176cd8(0x17c)])):console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x200)+_0x75c9b8[_0x176cd8(0x17c)]+_0x176cd8(0x1db)+_0x324761)),0x1;}try{_0x1b7bbd=await _0x24029d[_0x176cd8(0x19b)][_0x176cd8(0x1e4)](_0x75c9b8[_0x176cd8(0x1e7)],_0x2aabba);}catch(_0x46ffb3){const _0x3b8bcd=_0x46ffb3 instanceof Error?_0x46ffb3[_0x176cd8(0x1f1)]:String(_0x46ffb3);return _0x3b8bcd['includes'](_0x176cd8(0x182))||_0x3b8bcd['toLowerCase']()[_0x176cd8(0x1dc)]('not\x20found')?console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x75c9b8[_0x176cd8(0x1e7)])):console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x1d4)+_0x75c9b8[_0x176cd8(0x1e7)]+'\x22:\x20'+_0x3b8bcd)),0x1;}let _0x278da9;if(!_0x3eb44d)try{_0x278da9=await setupEvaluatorAgent(_0x24029d[_0x176cd8(0x19b)],_0x1c0545[_0x176cd8(0x188)]);}catch(_0x259a03){const _0x1fb1fb=_0x259a03 instanceof Error?_0x259a03[_0x176cd8(0x1f1)]:String(_0x259a03);return console[_0x176cd8(0x1d7)](a5_0xe176b['red'](_0x176cd8(0x1af)+_0x1fb1fb)),0x1;}console[_0x176cd8(0x1d7)](a5_0xe176b['cyan']('Running\x20agent\x20tests...')),console[_0x176cd8(0x1d7)](_0x176cd8(0x1a3)+a5_0xe176b[_0x176cd8(0x1ed)](_0x96c282)),console[_0x176cd8(0x1d7)]('Agent:\x20'+a5_0xe176b[_0x176cd8(0x1ed)](_0x75c9b8['projectName']+'/'+_0x75c9b8[_0x176cd8(0x1e7)])),console[_0x176cd8(0x1d7)]();const _0x204375=[],_0x4b5333=[],_0x1b7002=Date[_0x176cd8(0x1c5)]();for(let _0x4e891a=0x0;_0x4e891a<_0x503f8e[_0x176cd8(0x185)];_0x4e891a++){const _0x4c39e3=_0x503f8e[_0x4e891a];_0x503f8e[_0x176cd8(0x185)]>0x1?console[_0x176cd8(0x1d7)](_0x176cd8(0x205)+(_0x4e891a+0x1)+'/'+_0x503f8e[_0x176cd8(0x185)]+':\x20'+a5_0xe176b[_0x176cd8(0x1ed)](_0x4c39e3[_0x176cd8(0x1cf)])):console[_0x176cd8(0x1d7)](_0x176cd8(0x1c6)+a5_0xe176b[_0x176cd8(0x1ed)](_0x4c39e3['name']));const _0xd0904d=createCommandSpinner(_0x176cd8(0x1ea)+_0x4c39e3[_0x176cd8(0x17d)][_0x176cd8(0x185)]+_0x176cd8(0x1c7));_0xd0904d[_0x176cd8(0x20a)]();try{const {result:_0x44a8d4,conversation:_0x1c65f5}=await runTest(_0x24029d[_0x176cd8(0x19b)],_0x4c39e3,{'agentId':_0x1b7bbd,'projectId':_0x2aabba,'site':_0x96c282,'noEval':_0x3eb44d,'evaluatorId':_0x278da9,'onRoundStart':(_0xdb1fef,_0xd40d59)=>{const _0x253526=_0x176cd8;_0xd0904d['text']=_0x253526(0x19c)+(_0xdb1fef+0x1)+'/'+_0xd40d59+_0x253526(0x1c7);},'onRoundComplete':(_0x4db844,_0x146ae0,_0x59afba)=>{const _0x379579=_0x176cd8,_0x12754d=formatElapsed(_0x146ae0);_0x59afba?console[_0x379579(0x1d7)](_0x379579(0x19d)+(_0x4db844+0x1)+'/'+_0x4c39e3['rounds'][_0x379579(0x185)]+_0x379579(0x1cc)+a5_0xe176b[_0x379579(0x1f4)]('✓')+'\x20('+_0x12754d+')'):console[_0x379579(0x1d7)](_0x379579(0x19d)+(_0x4db844+0x1)+'/'+_0x4c39e3[_0x379579(0x17d)][_0x379579(0x185)]+'...\x20'+a5_0xe176b[_0x379579(0x1f2)]('✗'));},'onEvaluationStart':()=>{const _0x1c140c=_0x176cd8;_0xd0904d['text']=_0x1c140c(0x197);},'onEvaluationComplete':_0x585c33=>{const _0xba1aba=_0x176cd8,_0x2f05b5=formatElapsed(_0x585c33);console[_0xba1aba(0x1d7)](_0xba1aba(0x1ee)+a5_0xe176b[_0xba1aba(0x1f4)]('✓')+'\x20('+_0x2f05b5+')');}});_0xd0904d[_0x176cd8(0x1b9)](),_0x204375['push'](_0x44a8d4),_0x4b5333[_0x176cd8(0x1e3)](_0x1c65f5);if(_0x44a8d4[_0x176cd8(0x1ab)]===_0x176cd8(0x18e))console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f4)](_0x176cd8(0x1c2)+_0x44a8d4['reason']));else _0x44a8d4[_0x176cd8(0x1ab)]===_0x176cd8(0x1ae)?console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x17f)+_0x44a8d4[_0x176cd8(0x1bc)])):console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x19a)+_0x44a8d4[_0x176cd8(0x1bc)]));_0x44a8d4[_0x176cd8(0x18c)]&&console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x1fc)+_0x44a8d4[_0x176cd8(0x18c)])),console[_0x176cd8(0x1d7)]();}catch(_0x27e11f){_0xd0904d[_0x176cd8(0x1b9)]();const _0x26ee50=_0x27e11f instanceof Error?_0x27e11f[_0x176cd8(0x1f1)]:String(_0x27e11f);console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x19a)+_0x26ee50)),console[_0x176cd8(0x1d7)](),_0x204375[_0x176cd8(0x1e3)]({'name':_0x4c39e3['name'],'status':'ERROR','reason':_0x26ee50,'timestamp':new Date()[_0x176cd8(0x1e9)](),'duration_ms':0x0});}}const _0x37f180=Date[_0x176cd8(0x1c5)]()-_0x1b7002,_0xa2c08d=_0x204375['filter'](_0x4de6da=>_0x4de6da[_0x176cd8(0x1ab)]===_0x176cd8(0x18e))[_0x176cd8(0x185)],_0x259345=_0x204375[_0x176cd8(0x1ca)](_0x319745=>_0x319745[_0x176cd8(0x1ab)]===_0x176cd8(0x1ae))[_0x176cd8(0x185)],_0x135acb=_0x204375[_0x176cd8(0x1ca)](_0x503319=>_0x503319['status']===_0x176cd8(0x1b8))['length'];console['log']('━'[_0x176cd8(0x199)](0x3c)),console[_0x176cd8(0x1d7)](_0x176cd8(0x1e1)),console[_0x176cd8(0x1d7)]('━'['repeat'](0x3c)),console['log'](_0x176cd8(0x1aa)+_0x204375[_0x176cd8(0x185)]),console[_0x176cd8(0x1d7)]('Passed:\x20\x20\x20'+a5_0xe176b[_0x176cd8(0x1f4)](_0xa2c08d)),console[_0x176cd8(0x1d7)](_0x176cd8(0x1ff)+a5_0xe176b[_0x176cd8(0x1f2)](_0x259345));_0x135acb>0x0&&console[_0x176cd8(0x1d7)](_0x176cd8(0x1d6)+a5_0xe176b[_0x176cd8(0x1f2)](_0x135acb));console[_0x176cd8(0x1d7)](_0x176cd8(0x1d5)+formatElapsed(_0x37f180)),console[_0x176cd8(0x1d7)]('━'[_0x176cd8(0x199)](0x3c));const _0x484f2a=_0x204375[_0x176cd8(0x1ca)](_0x519cb7=>_0x519cb7['status']!=='PASS');if(_0x484f2a[_0x176cd8(0x185)]>0x0){console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)]('Failed\x20Tests:');for(const _0x441693 of _0x484f2a){const _0x4ddd5a=a5_0xe176b['red']('✗'),_0x5950a9=_0x441693['reason']['length']>0x32?_0x441693[_0x176cd8(0x1bc)][_0x176cd8(0x1a0)](0x0,0x32)+'...':_0x441693[_0x176cd8(0x1bc)];console[_0x176cd8(0x1d7)]('\x20\x20'+_0x4ddd5a+'\x20'+_0x441693[_0x176cd8(0x1cf)]+':\x20'+_0x5950a9);}}const _0x5bae79={'summary':{'total':_0x204375[_0x176cd8(0x185)],'passed':_0xa2c08d,'failed':_0x259345,'errors':_0x135acb>0x0?_0x135acb:undefined,'duration_ms':_0x37f180},'tests':_0x204375,'agent':{'project':_0x75c9b8[_0x176cd8(0x17c)],'name':_0x75c9b8['agentName'],'site':_0x96c282},'timestamp':new Date(_0x1b7002)[_0x176cd8(0x1e9)]()};try{const _0x2ff113=buildCachedTestRun(_0x4b5333,{'site':_0x96c282,'projectId':_0x2aabba,'projectName':_0x75c9b8['projectName'],'agentId':_0x1b7bbd,'agentName':_0x75c9b8['agentName'],'testYmlPath':a5_0x4e7ede[_0x176cd8(0x184)](_0x75c9b8[_0x176cd8(0x1a2)])});saveLastTestRun(_0x2ff113);}catch{}if(_0x4b9d6a!==_0x176cd8(0x20b)||_0x1c103b){const _0x32d921=formatResults(_0x5bae79,_0x4b9d6a);if(_0x1c103b)try{a5_0x254c45[_0x176cd8(0x1fb)](_0x1c103b,_0x32d921,_0x176cd8(0x17e)),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x1d2)+_0x1c103b));}catch(_0x5a87a9){return console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x1a4)+_0x5a87a9)),0x1;}else console['log'](),console[_0x176cd8(0x1d7)](_0x32d921);}return _0x484f2a[_0x176cd8(0x185)]>0x0?0x1:0x0;}async[a5_0x2a298d(0x202)](_0x1be7f6,_0x521677){const _0x53a15e=a5_0x2a298d,{options:_0x3caec3,tdx:_0x54d64c}=_0x1be7f6,{definition:_0x4f5d36,agentInfo:_0x7749a0,outputFormat:_0x5ccd42,outputFile:_0x576953}=_0x521677,_0x35cc1f=_0x3caec3['site'],_0x1db105=loadLastTestRun();if(!_0x1db105)return console['log'](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x195))),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x1d8))),0x1;if(_0x1db105[_0x53a15e(0x1b0)][_0x53a15e(0x1e7)]!==_0x7749a0[_0x53a15e(0x1e7)])return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x1bd)+_0x1db105[_0x53a15e(0x1b0)][_0x53a15e(0x1e7)]+_0x53a15e(0x1bb)+_0x7749a0[_0x53a15e(0x1e7)]+'\x22.')),console['log'](a5_0xe176b['dim'](_0x53a15e(0x1a6))),0x1;const _0x1b6fd3=new Set(_0x1db105['conversations'][_0x53a15e(0x192)](_0xda8a07=>_0xda8a07[_0x53a15e(0x1b5)])),_0x41341c=_0x4f5d36['tests'][_0x53a15e(0x1ca)](_0x2bc2e4=>!_0x1b6fd3[_0x53a15e(0x196)](_0x2bc2e4[_0x53a15e(0x1cf)]));if(_0x41341c[_0x53a15e(0x185)]>0x0&&_0x1db105[_0x53a15e(0x1b3)]!==_0x35cc1f)return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x1ce))),console['log'](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x186)+_0x1db105[_0x53a15e(0x1b3)]+_0x53a15e(0x1e5)+_0x35cc1f+'\x22.')),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x203)+_0x1db105['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x2cdb3f=_0x4f5d36[_0x53a15e(0x19e)][_0x53a15e(0x1ca)](_0x253b30=>_0x1b6fd3[_0x53a15e(0x196)](_0x253b30[_0x53a15e(0x1cf)])),_0x57219a=_0x41341c;let _0x5d96bb;try{_0x5d96bb=await setupEvaluatorAgent(_0x54d64c[_0x53a15e(0x19b)],_0x3caec3[_0x53a15e(0x188)]);}catch(_0x5335da){const _0x58235e=_0x5335da instanceof Error?_0x5335da[_0x53a15e(0x1f1)]:String(_0x5335da);return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x58235e)),0x1;}console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x189)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x53a15e(0x1f0)+a5_0xe176b[_0x53a15e(0x1ed)](_0x1db105['timestamp'])),console['log'](_0x53a15e(0x1c9)+a5_0xe176b['white'](_0x1db105['agent'][_0x53a15e(0x17c)]+'/'+_0x1db105[_0x53a15e(0x1b0)][_0x53a15e(0x1e7)]));_0x57219a[_0x53a15e(0x185)]>0x0&&console[_0x53a15e(0x1d7)]('New\x20tests\x20to\x20execute:\x20'+a5_0xe176b[_0x53a15e(0x201)](_0x57219a[_0x53a15e(0x185)]));console[_0x53a15e(0x1d7)]();const _0x18ddae=[],_0x4f2e1d=Date[_0x53a15e(0x1c5)](),_0x44905c=createCommandSpinner('Re-evaluating...');if(_0x2cdb3f['length']>0x0)try{const _0x1bf3a1=await reevaluateFromCache(_0x54d64c['llm'],_0x1db105,{'tests':_0x2cdb3f},{'evaluatorId':_0x5d96bb,'onTestStart':(_0x2c33a5,_0xc910b2,_0x53875e)=>{const _0x1e6804=_0x53a15e;_0x44905c[_0x1e6804(0x1c1)]='Re-evaluating\x20'+(_0xc910b2+0x1)+'/'+_0x53875e+':\x20'+_0x2c33a5+_0x1e6804(0x19f);if(!_0x44905c[_0x1e6804(0x1fe)])_0x44905c[_0x1e6804(0x20a)]();},'onTestComplete':(_0x5d0eb7,_0x34c957)=>{const _0x8a856d=_0x53a15e;_0x44905c[_0x8a856d(0x1b9)]();if(_0x34c957['status']===_0x8a856d(0x18e))console['log'](a5_0xe176b[_0x8a856d(0x1f4)](_0x8a856d(0x1c2)+_0x5d0eb7)+a5_0xe176b['dim']('\x20(cached)'));else _0x34c957[_0x8a856d(0x1ab)]===_0x8a856d(0x1ae)?console[_0x8a856d(0x1d7)](a5_0xe176b['red']('✗\x20FAIL:\x20'+_0x5d0eb7+'\x20-\x20'+_0x34c957[_0x8a856d(0x1bc)])+a5_0xe176b[_0x8a856d(0x1cd)](_0x8a856d(0x1c8))):console[_0x8a856d(0x1d7)](a5_0xe176b[_0x8a856d(0x1f2)](_0x8a856d(0x19a)+_0x5d0eb7+'\x20-\x20'+_0x34c957[_0x8a856d(0x1bc)]));_0x34c957[_0x8a856d(0x18c)]&&console[_0x8a856d(0x1d7)](a5_0xe176b[_0x8a856d(0x1cd)](_0x8a856d(0x1de)+_0x34c957[_0x8a856d(0x18c)])),_0x18ddae[_0x8a856d(0x1e3)](_0x34c957);},'onTestSkipped':(_0x3c4486,_0x72b27f)=>{const _0x143e4a=_0x53a15e;_0x44905c[_0x143e4a(0x1b9)](),console[_0x143e4a(0x1d7)](a5_0xe176b[_0x143e4a(0x201)](_0x143e4a(0x20e)+_0x3c4486+_0x143e4a(0x1b2)+_0x72b27f));}});for(const _0x4132f6 of _0x1bf3a1){!_0x18ddae[_0x53a15e(0x1a9)](_0x3b8c9a=>_0x3b8c9a[_0x53a15e(0x1cf)]===_0x4132f6['name'])&&_0x18ddae['push'](_0x4132f6);}}catch(_0x1b9075){_0x44905c['stop']();const _0xa28f0=_0x1b9075 instanceof Error?_0x1b9075[_0x53a15e(0x1f1)]:String(_0x1b9075);return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0xa28f0)),0x1;}_0x44905c[_0x53a15e(0x1b9)]();if(_0x57219a[_0x53a15e(0x185)]>0x0){console[_0x53a15e(0x1d7)](),console['log'](a5_0xe176b[_0x53a15e(0x189)](_0x53a15e(0x18f)));const {projectId:_0x22e046,agentId:_0x13f2d1}=_0x1db105[_0x53a15e(0x1b0)];for(const _0x53fc1a of _0x57219a){console['log']('Running:\x20'+a5_0xe176b[_0x53a15e(0x1ed)](_0x53fc1a['name']));const _0x1778e7=createCommandSpinner(_0x53a15e(0x1ea)+_0x53fc1a[_0x53a15e(0x17d)][_0x53a15e(0x185)]+_0x53a15e(0x1c7));_0x1778e7['start']();try{const {result:_0x32beb2}=await runTest(_0x54d64c[_0x53a15e(0x19b)],_0x53fc1a,{'agentId':_0x13f2d1,'projectId':_0x22e046,'site':_0x1db105[_0x53a15e(0x1b3)],'noEval':![],'evaluatorId':_0x5d96bb,'onRoundStart':(_0x2a9d8a,_0x564698)=>{_0x1778e7['text']='Round\x20'+(_0x2a9d8a+0x1)+'/'+_0x564698+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x34b8c7,_0x377079,_0x56525c)=>{const _0x216263=_0x53a15e,_0x47cc68=formatElapsed(_0x377079);_0x56525c?console[_0x216263(0x1d7)]('\x20\x20Round\x20'+(_0x34b8c7+0x1)+'/'+_0x53fc1a[_0x216263(0x17d)][_0x216263(0x185)]+_0x216263(0x1cc)+a5_0xe176b[_0x216263(0x1f4)]('✓')+'\x20('+_0x47cc68+')'):console[_0x216263(0x1d7)](_0x216263(0x19d)+(_0x34b8c7+0x1)+'/'+_0x53fc1a[_0x216263(0x17d)][_0x216263(0x185)]+_0x216263(0x1cc)+a5_0xe176b[_0x216263(0x1f2)]('✗'));},'onEvaluationStart':()=>{const _0x428a4a=_0x53a15e;_0x1778e7[_0x428a4a(0x1c1)]=_0x428a4a(0x197);},'onEvaluationComplete':_0x48a74b=>{const _0x17b08b=_0x53a15e,_0x1190df=formatElapsed(_0x48a74b);console[_0x17b08b(0x1d7)](_0x17b08b(0x1ee)+a5_0xe176b[_0x17b08b(0x1f4)]('✓')+'\x20('+_0x1190df+')');}});_0x1778e7[_0x53a15e(0x1b9)](),_0x18ddae[_0x53a15e(0x1e3)](_0x32beb2);if(_0x32beb2['status']===_0x53a15e(0x18e))console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f4)](_0x53a15e(0x1c2)+_0x32beb2[_0x53a15e(0x1bc)])+a5_0xe176b['dim'](_0x53a15e(0x1c3)));else _0x32beb2[_0x53a15e(0x1ab)]===_0x53a15e(0x1ae)?console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x17f)+_0x32beb2[_0x53a15e(0x1bc)])+a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x1c3))):console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x19a)+_0x32beb2['reason']));_0x32beb2[_0x53a15e(0x18c)]&&console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x1de)+_0x32beb2[_0x53a15e(0x18c)]));}catch(_0x184bc4){_0x1778e7['stop']();const _0x18e9d6=_0x184bc4 instanceof Error?_0x184bc4['message']:String(_0x184bc4);console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x19a)+_0x18e9d6)),_0x18ddae[_0x53a15e(0x1e3)]({'name':_0x53fc1a['name'],'status':_0x53a15e(0x1b8),'reason':_0x18e9d6,'timestamp':new Date()[_0x53a15e(0x1e9)](),'duration_ms':0x0});}}}console[_0x53a15e(0x1d7)]();const _0x5ff11d=Date[_0x53a15e(0x1c5)]()-_0x4f2e1d,_0x57d7ec=_0x18ddae['filter'](_0x1c5ab4=>_0x1c5ab4['status']===_0x53a15e(0x18e))[_0x53a15e(0x185)],_0x3ab713=_0x18ddae['filter'](_0x598b34=>_0x598b34[_0x53a15e(0x1ab)]===_0x53a15e(0x1ae))[_0x53a15e(0x185)],_0x2d4d53=_0x18ddae[_0x53a15e(0x1ca)](_0x2b7ffe=>_0x2b7ffe[_0x53a15e(0x1ab)]===_0x53a15e(0x1b8))['length'];console[_0x53a15e(0x1d7)]('━'[_0x53a15e(0x199)](0x3c)),console[_0x53a15e(0x1d7)]('Re-evaluation\x20Summary'),console[_0x53a15e(0x1d7)]('━'[_0x53a15e(0x199)](0x3c)),console[_0x53a15e(0x1d7)]('Total:\x20\x20\x20\x20'+_0x18ddae['length']),console[_0x53a15e(0x1d7)]('Passed:\x20\x20\x20'+a5_0xe176b['green'](_0x57d7ec)),console[_0x53a15e(0x1d7)](_0x53a15e(0x1ff)+a5_0xe176b[_0x53a15e(0x1f2)](_0x3ab713));_0x2d4d53>0x0&&console[_0x53a15e(0x1d7)]('Errors:\x20\x20\x20'+a5_0xe176b[_0x53a15e(0x1f2)](_0x2d4d53));console[_0x53a15e(0x1d7)](_0x53a15e(0x1d5)+formatElapsed(_0x5ff11d)),console[_0x53a15e(0x1d7)]('━'[_0x53a15e(0x199)](0x3c));const _0xedfe2e={'summary':{'total':_0x18ddae[_0x53a15e(0x185)],'passed':_0x57d7ec,'failed':_0x3ab713,'errors':_0x2d4d53>0x0?_0x2d4d53:undefined,'duration_ms':_0x5ff11d},'tests':_0x18ddae,'agent':{'project':_0x7749a0[_0x53a15e(0x17c)],'name':_0x7749a0[_0x53a15e(0x1e7)],'site':_0x35cc1f},'timestamp':new Date(_0x4f2e1d)[_0x53a15e(0x1e9)]()};if(_0x5ccd42!==_0x53a15e(0x20b)||_0x576953){const _0x52dfbe=formatResults(_0xedfe2e,_0x5ccd42);if(_0x576953)try{a5_0x254c45[_0x53a15e(0x1fb)](_0x576953,_0x52dfbe,'utf-8'),console['log'](),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)]('Output\x20written\x20to:\x20'+_0x576953));}catch(_0x49f8d5){return console[_0x53a15e(0x1d7)](),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x1a4)+_0x49f8d5)),0x1;}else console[_0x53a15e(0x1d7)](),console['log'](_0x52dfbe);}const _0x285686=_0x18ddae['filter'](_0x8e8d3a=>_0x8e8d3a[_0x53a15e(0x1ab)]!==_0x53a15e(0x18e));return _0x285686[_0x53a15e(0x185)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x19cf57=a5_0x340e;(function(_0x217892,_0x2533d9){const _0x5b79b6=a5_0x340e,_0x2b9af7=_0x217892();while(!![]){try{const _0x1ae8df=parseInt(_0x5b79b6(0x13b))/0x1*(parseInt(_0x5b79b6(0x111))/0x2)+parseInt(_0x5b79b6(0x129))/0x3+parseInt(_0x5b79b6(0xe7))/0x4+parseInt(_0x5b79b6(0x110))/0x5+-parseInt(_0x5b79b6(0x13a))/0x6*(-parseInt(_0x5b79b6(0xc9))/0x7)+-parseInt(_0x5b79b6(0x135))/0x8*(-parseInt(_0x5b79b6(0x145))/0x9)+-parseInt(_0x5b79b6(0xe9))/0xa;if(_0x1ae8df===_0x2533d9)break;else _0x2b9af7['push'](_0x2b9af7['shift']());}catch(_0x2d4818){_0x2b9af7['push'](_0x2b9af7['shift']());}}}(a5_0x37e7,0x6338e));import*as a5_0x59467f from'node:fs';import*as a5_0xd71767 from'node:path';import a5_0x1f9320 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x340e(_0x5451dc,_0x1dab43){_0x5451dc=_0x5451dc-0xc1;const _0x37e7d4=a5_0x37e7();let _0x340e01=_0x37e7d4[_0x5451dc];return _0x340e01;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x19cf57(0xff)]=a5_0x19cf57(0x11d);['description']=a5_0x19cf57(0x121);async[a5_0x19cf57(0xd8)](_0xdbcbe0){const _0x400320=a5_0x19cf57,{options:_0x121ebf,args:_0x513b6f,tdx:_0x520465}=_0xdbcbe0,_0x52943e=_0x513b6f[0x0]||'.',_0x7e9f92=_0x121ebf['dryRun'],_0x434d54=_0x121ebf,_0x481519=_0x434d54['eval']===![],_0x28b111=_0x434d54['reeval'],_0xefb377=_0x434d54[_0x400320(0xff)],_0x26a675=_0x434d54[_0x400320(0x143)],_0x27b825=_0x121ebf[_0x400320(0xcf)],_0x118f6a=_0x434d54['output'];if(_0x28b111&&_0x481519)return console['log'](a5_0x1f9320[_0x400320(0xd1)](_0x400320(0x10e))),0x1;let _0x55cc83='table';if(_0x434d54['json'])_0x55cc83=_0x400320(0xda);else{if(_0x434d54[_0x400320(0xee)])_0x55cc83=_0x400320(0xee);else{if(_0x434d54[_0x400320(0x139)])_0x55cc83=_0x400320(0x139);else{if(_0x434d54[_0x400320(0x150)])_0x55cc83=_0x400320(0x150);}}}const _0x538034=_0x434d54[_0x400320(0xfe)];let _0x200b96=_0x52943e;const _0x42e4f5=a5_0x59467f[_0x400320(0x14e)](_0x52943e),_0x28bd7c=_0x52943e==='.';if(!_0x42e4f5||_0x28bd7c){const _0x390eb6=resolveProjectFromContext(_0x52943e,_0x538034,{'requireFile':_0x400320(0x120)});if(_0x390eb6[_0x400320(0x108)])_0x200b96=_0x390eb6['projectDir'],_0x390eb6[_0x400320(0xe2)]==='context'&&console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0x124)](_0x400320(0x11a)+_0x200b96));else switch(_0x390eb6[_0x400320(0x102)]){case _0x400320(0x147):console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xf2)](_0x390eb6['message'])),console[_0x400320(0x11e)](),console[_0x400320(0x11e)](_0x400320(0xf9)),console[_0x400320(0x11e)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x400320(0x11e)](_0x400320(0x136)),console[_0x400320(0x11e)](),console['log'](_0x400320(0x105));return 0x1;case _0x400320(0xd4):console[_0x400320(0x11e)](a5_0x1f9320['yellow'](_0x390eb6[_0x400320(0x137)])),console[_0x400320(0x11e)](),console['log'](_0x400320(0xfc)+_0x390eb6[_0x400320(0xfe)]+_0x400320(0xde));return 0x1;case'multiple_agents':{const _0x54a4bf=a5_0xd71767[_0x400320(0xcc)](_0x390eb6['projectDir']);console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xf2)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x390eb6['llmProject']+'\x22:'));for(const _0x2e0f48 of _0x390eb6['agentDirs']){console[_0x400320(0x11e)]('\x20\x20-\x20'+_0x2e0f48);}return console[_0x400320(0x11e)](),console[_0x400320(0x11e)](_0x400320(0x14a)+_0x54a4bf+_0x400320(0x109)),0x1;}case _0x400320(0xf3):console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xf2)](_0x400320(0x107)+_0x390eb6[_0x400320(0xfe)]+'\x22.')),console[_0x400320(0x11e)](a5_0x1f9320['dim'](_0x400320(0x12e)+_0x390eb6[_0x400320(0xf1)])),console[_0x400320(0x11e)](),console[_0x400320(0x11e)](_0x400320(0xd9));return 0x1;}}const {definition:_0x2f855d,agentInfo:_0x3dc3e3}=parseTestFile(_0x200b96);let _0x4c0310=_0x2f855d[_0x400320(0xed)];if(_0xefb377){const _0x1ebbea=_0xefb377[_0x400320(0x12d)](',')['map'](_0x17f203=>_0x17f203[_0x400320(0x131)]());_0x4c0310=_0x2f855d[_0x400320(0xed)][_0x400320(0xc6)](_0x2bd47e=>_0x1ebbea[_0x400320(0x118)](_0x2bd47e['name']));if(_0x4c0310[_0x400320(0x114)]===0x0)return console[_0x400320(0x11e)](a5_0x1f9320['yellow']('No\x20tests\x20found\x20matching:\x20'+_0xefb377)),console['log'](a5_0x1f9320['dim']('Available\x20tests:\x20'+_0x2f855d[_0x400320(0xed)][_0x400320(0x138)](_0x1bd191=>_0x1bd191['name'])[_0x400320(0xd0)](',\x20'))),0x1;}if(_0x26a675){const _0x182e32=_0x26a675['split'](',')[_0x400320(0x138)](_0x2b4f5b=>_0x2b4f5b[_0x400320(0x131)]()[_0x400320(0xfb)]());_0x4c0310=_0x4c0310[_0x400320(0xc6)](_0x34b9a2=>_0x34b9a2[_0x400320(0x143)]?.[_0x400320(0xe6)](_0x3a735b=>_0x182e32[_0x400320(0x118)](_0x3a735b[_0x400320(0xfb)]())));if(_0x4c0310[_0x400320(0x114)]===0x0){console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xf2)](_0x400320(0xfd)+_0x26a675));const _0x30bdaa=new Set();return _0x2f855d[_0x400320(0xed)]['forEach'](_0x16a5af=>_0x16a5af[_0x400320(0x143)]?.[_0x400320(0xca)](_0x373e70=>_0x30bdaa['add'](_0x373e70))),_0x30bdaa[_0x400320(0x10a)]>0x0?console['log'](a5_0x1f9320[_0x400320(0x124)](_0x400320(0xea)+[..._0x30bdaa][_0x400320(0xd0)](',\x20'))):console[_0x400320(0x11e)](a5_0x1f9320['dim'](_0x400320(0xc5))),0x1;}}if(_0x28b111)return this['executeReeval'](_0xdbcbe0,{'definition':{'tests':_0x4c0310},'agentInfo':_0x3dc3e3,'outputFormat':_0x55cc83,'outputFile':_0x118f6a,'testNames':_0xefb377});if(_0x7e9f92){console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xd3)](_0x400320(0x148))),console[_0x400320(0x11e)](_0x400320(0xdc)+a5_0x1f9320[_0x400320(0x141)](_0x27b825)),console[_0x400320(0x11e)](_0x400320(0xe4)+a5_0x1f9320[_0x400320(0x141)](_0x3dc3e3[_0x400320(0xdd)])),console[_0x400320(0x11e)](_0x400320(0x116)+a5_0x1f9320['white'](_0x3dc3e3[_0x400320(0x100)])),console[_0x400320(0x11e)](),console[_0x400320(0x11e)](_0x400320(0xc4)+a5_0x1f9320[_0x400320(0x141)](_0x4c0310[_0x400320(0x114)]));for(let _0x529ce3=0x0;_0x529ce3<_0x4c0310[_0x400320(0x114)];_0x529ce3++){const _0x2f2ef5=_0x4c0310[_0x529ce3],_0x14b0a2=_0x2f2ef5['rounds'][_0x400320(0x114)]===0x1?_0x400320(0xf6):'rounds',_0x1d5d35=_0x2f2ef5[_0x400320(0x143)]?.[_0x400320(0x114)]?'\x20['+_0x2f2ef5[_0x400320(0x143)][_0x400320(0xd0)](',\x20')+']':'';console[_0x400320(0x11e)]('\x20\x20'+(_0x529ce3+0x1)+'.\x20'+a5_0x1f9320[_0x400320(0x141)](_0x2f2ef5[_0x400320(0xff)])+'\x20('+_0x2f2ef5[_0x400320(0x13c)][_0x400320(0x114)]+'\x20'+_0x14b0a2+')'+a5_0x1f9320[_0x400320(0x124)](_0x1d5d35));}return 0x0;}let _0x2ec3ec,_0x19e147;try{_0x2ec3ec=await _0x520465[_0x400320(0xce)]['resolveProjectId'](_0x3dc3e3[_0x400320(0xdd)]);}catch(_0x3d76cd){const _0x5562b1=_0x3d76cd instanceof Error?_0x3d76cd[_0x400320(0x137)]:String(_0x3d76cd);return _0x5562b1[_0x400320(0x118)](_0x400320(0x144))||_0x5562b1[_0x400320(0xfb)]()[_0x400320(0x118)](_0x400320(0x149))?console['log'](a5_0x1f9320[_0x400320(0xd1)](_0x400320(0x10b)+_0x3dc3e3['projectName'])):console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xd1)](_0x400320(0xcd)+_0x3dc3e3[_0x400320(0xdd)]+_0x400320(0xec)+_0x5562b1)),0x1;}try{_0x19e147=await _0x520465['llm']['resolveAgentId'](_0x3dc3e3[_0x400320(0x100)],_0x2ec3ec);}catch(_0x55f8ab){const _0x54ebff=_0x55f8ab instanceof Error?_0x55f8ab[_0x400320(0x137)]:String(_0x55f8ab);return _0x54ebff[_0x400320(0x118)](_0x400320(0x144))||_0x54ebff[_0x400320(0xfb)]()[_0x400320(0x118)]('not\x20found')?console[_0x400320(0x11e)](a5_0x1f9320['red'](_0x400320(0x10c)+_0x3dc3e3['agentName'])):console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xd1)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x3dc3e3['agentName']+'\x22:\x20'+_0x54ebff)),0x1;}let _0x1e1c23;if(!_0x481519)try{_0x1e1c23=await setupEvaluatorAgent(_0x520465[_0x400320(0xce)],_0x121ebf[_0x400320(0xf8)]);}catch(_0x1d10a7){const _0x2b5692=_0x1d10a7 instanceof Error?_0x1d10a7[_0x400320(0x137)]:String(_0x1d10a7);return console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xd1)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2b5692)),0x1;}console[_0x400320(0x11e)](a5_0x1f9320['cyan'](_0x400320(0xe8))),console[_0x400320(0x11e)](_0x400320(0xf5)+a5_0x1f9320[_0x400320(0x141)](_0x27b825)),console[_0x400320(0x11e)](_0x400320(0x133)+a5_0x1f9320[_0x400320(0x141)](_0x3dc3e3[_0x400320(0xdd)]+'/'+_0x3dc3e3[_0x400320(0x100)])),console[_0x400320(0x11e)]();const _0x424a62=[],_0x1b7324=[],_0x400590=Date[_0x400320(0x117)]();for(let _0x28fcdd=0x0;_0x28fcdd<_0x4c0310[_0x400320(0x114)];_0x28fcdd++){const _0x2857e4=_0x4c0310[_0x28fcdd];_0x4c0310[_0x400320(0x114)]>0x1?console[_0x400320(0x11e)]('Test\x20'+(_0x28fcdd+0x1)+'/'+_0x4c0310[_0x400320(0x114)]+':\x20'+a5_0x1f9320[_0x400320(0x141)](_0x2857e4[_0x400320(0xff)])):console[_0x400320(0x11e)]('Running\x20test:\x20'+a5_0x1f9320[_0x400320(0x141)](_0x2857e4[_0x400320(0xff)]));const _0x236aca=createCommandSpinner('Round\x201/'+_0x2857e4[_0x400320(0x13c)][_0x400320(0x114)]+':\x20Sending\x20user\x20input...');_0x236aca[_0x400320(0xc3)]();try{const {result:_0x170a2a,conversation:_0x3528ad}=await runTest(_0x520465['llm'],_0x2857e4,{'agentId':_0x19e147,'projectId':_0x2ec3ec,'site':_0x27b825,'noEval':_0x481519,'evaluatorId':_0x1e1c23,'onRoundStart':(_0x1cd1f2,_0x280146)=>{const _0x45d5b4=_0x400320;_0x236aca[_0x45d5b4(0x12b)]=_0x45d5b4(0x14b)+(_0x1cd1f2+0x1)+'/'+_0x280146+_0x45d5b4(0x10d);},'onRoundComplete':(_0x36f799,_0x424a10,_0x4b3b44)=>{const _0x33f3f4=_0x400320,_0x23d212=formatElapsed(_0x424a10);_0x4b3b44?console['log'](_0x33f3f4(0xe0)+(_0x36f799+0x1)+'/'+_0x2857e4[_0x33f3f4(0x13c)]['length']+_0x33f3f4(0x10f)+a5_0x1f9320[_0x33f3f4(0x12a)]('✓')+'\x20('+_0x23d212+')'):console['log'](_0x33f3f4(0xe0)+(_0x36f799+0x1)+'/'+_0x2857e4['rounds']['length']+_0x33f3f4(0x10f)+a5_0x1f9320[_0x33f3f4(0xd1)]('✗'));},'onEvaluationStart':()=>{const _0x5ec879=_0x400320;_0x236aca[_0x5ec879(0x12b)]=_0x5ec879(0x132);},'onEvaluationComplete':_0x4fafba=>{const _0x21d942=_0x400320,_0x348487=formatElapsed(_0x4fafba);console[_0x21d942(0x11e)](_0x21d942(0xf4)+a5_0x1f9320[_0x21d942(0x12a)]('✓')+'\x20('+_0x348487+')');}});_0x236aca[_0x400320(0x113)](),_0x424a62[_0x400320(0x122)](_0x170a2a),_0x1b7324[_0x400320(0x122)](_0x3528ad);if(_0x170a2a[_0x400320(0x142)]===_0x400320(0x14f))console[_0x400320(0x11e)](a5_0x1f9320['green'](_0x400320(0xe3)+_0x170a2a[_0x400320(0x102)]));else _0x170a2a[_0x400320(0x142)]===_0x400320(0x104)?console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0xd1)](_0x400320(0xef)+_0x170a2a[_0x400320(0x102)])):console['log'](a5_0x1f9320[_0x400320(0xd1)]('✗\x20ERROR:\x20'+_0x170a2a['reason']));_0x170a2a['conversation_url']&&console[_0x400320(0x11e)](a5_0x1f9320[_0x400320(0x124)](_0x400320(0xc7)+_0x170a2a[_0x400320(0x123)])),console[_0x400320(0x11e)]();}catch(_0x68ff91){_0x236aca[_0x400320(0x113)]();const _0x5e129d=_0x68ff91 instanceof Error?_0x68ff91[_0x400320(0x137)]:String(_0x68ff91);console['log'](a5_0x1f9320[_0x400320(0xd1)](_0x400320(0xeb)+_0x5e129d)),console[_0x400320(0x11e)](),_0x424a62[_0x400320(0x122)]({'name':_0x2857e4[_0x400320(0xff)],'status':_0x400320(0x128),'reason':_0x5e129d,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0xa4e6dc=Date[_0x400320(0x117)]()-_0x400590,_0x93e405=_0x424a62['filter'](_0x5a069d=>_0x5a069d['status']===_0x400320(0x14f))[_0x400320(0x114)],_0x1b33cb=_0x424a62[_0x400320(0xc6)](_0x364690=>_0x364690['status']===_0x400320(0x104))[_0x400320(0x114)],_0x5b3ba4=_0x424a62[_0x400320(0xc6)](_0x2ab79a=>_0x2ab79a['status']==='ERROR')['length'];console[_0x400320(0x11e)]('━'[_0x400320(0x14d)](0x3c)),console[_0x400320(0x11e)](_0x400320(0x112)),console[_0x400320(0x11e)]('━'[_0x400320(0x14d)](0x3c)),console['log'](_0x400320(0xd2)+_0x424a62[_0x400320(0x114)]),console['log'](_0x400320(0x13e)+a5_0x1f9320[_0x400320(0x12a)](_0x93e405)),console['log'](_0x400320(0xdf)+a5_0x1f9320[_0x400320(0xd1)](_0x1b33cb));_0x5b3ba4>0x0&&console[_0x400320(0x11e)]('Errors:\x20\x20\x20'+a5_0x1f9320[_0x400320(0xd1)](_0x5b3ba4));console[_0x400320(0x11e)]('Duration:\x20'+formatElapsed(_0xa4e6dc)),console['log']('━'[_0x400320(0x14d)](0x3c));const _0x3dba89=_0x424a62[_0x400320(0xc6)](_0x1430e7=>_0x1430e7[_0x400320(0x142)]!=='PASS');if(_0x3dba89[_0x400320(0x114)]>0x0){console['log'](),console[_0x400320(0x11e)]('Failed\x20Tests:');for(const _0x18dd81 of _0x3dba89){const _0x543ae3=a5_0x1f9320[_0x400320(0xd1)]('✗'),_0x3eb13b=_0x18dd81[_0x400320(0x102)]['length']>0x32?_0x18dd81[_0x400320(0x102)][_0x400320(0xc2)](0x0,0x32)+_0x400320(0x12c):_0x18dd81['reason'];console['log']('\x20\x20'+_0x543ae3+'\x20'+_0x18dd81[_0x400320(0xff)]+':\x20'+_0x3eb13b);}}const _0x5d8449={'summary':{'total':_0x424a62[_0x400320(0x114)],'passed':_0x93e405,'failed':_0x1b33cb,'errors':_0x5b3ba4>0x0?_0x5b3ba4:undefined,'duration_ms':_0xa4e6dc},'tests':_0x424a62,'agent':{'project':_0x3dc3e3[_0x400320(0xdd)],'name':_0x3dc3e3[_0x400320(0x100)],'site':_0x27b825},'timestamp':new Date(_0x400590)[_0x400320(0xd5)]()};try{const _0x1f50e3=buildCachedTestRun(_0x1b7324,{'site':_0x27b825,'projectId':_0x2ec3ec,'projectName':_0x3dc3e3[_0x400320(0xdd)],'agentId':_0x19e147,'agentName':_0x3dc3e3['agentName'],'testYmlPath':a5_0xd71767[_0x400320(0xdb)](_0x3dc3e3['testYmlPath'])});saveLastTestRun(_0x1f50e3);}catch{}if(_0x55cc83!==_0x400320(0x150)||_0x118f6a){const _0xc6abba=formatResults(_0x5d8449,_0x55cc83);if(_0x118f6a)try{a5_0x59467f['writeFileSync'](_0x118f6a,_0xc6abba,_0x400320(0x119)),console[_0x400320(0x11e)](),console[_0x400320(0x11e)](a5_0x1f9320['dim'](_0x400320(0x101)+_0x118f6a));}catch(_0x3a9c0f){return console[_0x400320(0x11e)](),console['log'](a5_0x1f9320[_0x400320(0xd1)]('Error\x20writing\x20output\x20file:\x20'+_0x3a9c0f)),0x1;}else console[_0x400320(0x11e)](),console[_0x400320(0x11e)](_0xc6abba);}return _0x3dba89['length']>0x0?0x1:0x0;}async[a5_0x19cf57(0x125)](_0x2b965d,_0xbd8420){const _0x22d9e4=a5_0x19cf57,{options:_0x5d0cb1,tdx:_0x5a846e}=_0x2b965d,{definition:_0x16c258,agentInfo:_0x46fe22,outputFormat:_0x49900a,outputFile:_0x29ceda}=_0xbd8420,_0x386460=_0x5d0cb1['site'],_0x5ae433=loadLastTestRun();if(!_0x5ae433)return console['log'](a5_0x1f9320[_0x22d9e4(0xd1)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0x124)](_0x22d9e4(0x14c))),0x1;if(_0x5ae433['agent'][_0x22d9e4(0x100)]!==_0x46fe22[_0x22d9e4(0x100)])return console['log'](a5_0x1f9320[_0x22d9e4(0xd1)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x5ae433[_0x22d9e4(0xf7)][_0x22d9e4(0x100)]+_0x22d9e4(0x140)+_0x46fe22['agentName']+'\x22.')),console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0x124)](_0x22d9e4(0x11c))),0x1;const _0x25b94d=new Set(_0x5ae433['conversations'][_0x22d9e4(0x138)](_0x2db98c=>_0x2db98c[_0x22d9e4(0xd6)])),_0x544c89=_0x16c258[_0x22d9e4(0xed)][_0x22d9e4(0xc6)](_0x33ff00=>!_0x25b94d['has'](_0x33ff00['name']));if(_0x544c89[_0x22d9e4(0x114)]>0x0&&_0x5ae433[_0x22d9e4(0xcf)]!==_0x386460)return console[_0x22d9e4(0x11e)](a5_0x1f9320['red'](_0x22d9e4(0x106))),console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0x124)](_0x22d9e4(0x115)+_0x5ae433[_0x22d9e4(0xcf)]+_0x22d9e4(0x13f)+_0x386460+'\x22.')),console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0x124)](_0x22d9e4(0x11f)+_0x5ae433[_0x22d9e4(0xcf)]+_0x22d9e4(0xc8))),0x1;const _0x2153d6=_0x16c258[_0x22d9e4(0xed)][_0x22d9e4(0xc6)](_0x1de627=>_0x25b94d[_0x22d9e4(0xf0)](_0x1de627[_0x22d9e4(0xff)])),_0xee9a93=_0x544c89;let _0x3a43b8;try{_0x3a43b8=await setupEvaluatorAgent(_0x5a846e[_0x22d9e4(0xce)],_0x5d0cb1[_0x22d9e4(0xf8)]);}catch(_0x221f3d){const _0x2918fe=_0x221f3d instanceof Error?_0x221f3d['message']:String(_0x221f3d);return console[_0x22d9e4(0x11e)](a5_0x1f9320['red'](_0x22d9e4(0x126)+_0x2918fe)),0x1;}console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0xd3)](_0x22d9e4(0x146))),console['log'](_0x22d9e4(0x103)+a5_0x1f9320[_0x22d9e4(0x141)](_0x5ae433[_0x22d9e4(0x13d)])),console[_0x22d9e4(0x11e)]('Agent:\x20'+a5_0x1f9320[_0x22d9e4(0x141)](_0x5ae433['agent']['projectName']+'/'+_0x5ae433[_0x22d9e4(0xf7)][_0x22d9e4(0x100)]));_0xee9a93[_0x22d9e4(0x114)]>0x0&&console[_0x22d9e4(0x11e)](_0x22d9e4(0xcb)+a5_0x1f9320[_0x22d9e4(0xf2)](_0xee9a93[_0x22d9e4(0x114)]));console['log']();const _0x5e5068=[],_0x1ace43=Date['now'](),_0x1d4f6b=createCommandSpinner('Re-evaluating...');if(_0x2153d6[_0x22d9e4(0x114)]>0x0)try{const _0x427126=await reevaluateFromCache(_0x5a846e[_0x22d9e4(0xce)],_0x5ae433,{'tests':_0x2153d6},{'evaluatorId':_0x3a43b8,'onTestStart':(_0xb1f066,_0x49a2ed,_0x2da441)=>{const _0x1e6d4c=_0x22d9e4;_0x1d4f6b[_0x1e6d4c(0x12b)]=_0x1e6d4c(0x127)+(_0x49a2ed+0x1)+'/'+_0x2da441+':\x20'+_0xb1f066+_0x1e6d4c(0x12c);if(!_0x1d4f6b[_0x1e6d4c(0x12f)])_0x1d4f6b['start']();},'onTestComplete':(_0x5c47a6,_0x243d16)=>{const _0x1a9f1b=_0x22d9e4;_0x1d4f6b[_0x1a9f1b(0x113)]();if(_0x243d16[_0x1a9f1b(0x142)]===_0x1a9f1b(0x14f))console[_0x1a9f1b(0x11e)](a5_0x1f9320[_0x1a9f1b(0x12a)](_0x1a9f1b(0xe3)+_0x5c47a6)+a5_0x1f9320['dim'](_0x1a9f1b(0x134)));else _0x243d16[_0x1a9f1b(0x142)]==='FAIL'?console[_0x1a9f1b(0x11e)](a5_0x1f9320['red'](_0x1a9f1b(0xef)+_0x5c47a6+_0x1a9f1b(0xd7)+_0x243d16[_0x1a9f1b(0x102)])+a5_0x1f9320[_0x1a9f1b(0x124)](_0x1a9f1b(0x134))):console[_0x1a9f1b(0x11e)](a5_0x1f9320[_0x1a9f1b(0xd1)](_0x1a9f1b(0xeb)+_0x5c47a6+_0x1a9f1b(0xd7)+_0x243d16[_0x1a9f1b(0x102)]));_0x243d16[_0x1a9f1b(0x123)]&&console['log'](a5_0x1f9320[_0x1a9f1b(0x124)](_0x1a9f1b(0xfa)+_0x243d16['conversation_url'])),_0x5e5068[_0x1a9f1b(0x122)](_0x243d16);},'onTestSkipped':(_0x302c6c,_0x3f893a)=>{const _0x42655f=_0x22d9e4;_0x1d4f6b[_0x42655f(0x113)](),console[_0x42655f(0x11e)](a5_0x1f9320[_0x42655f(0xf2)](_0x42655f(0x130)+_0x302c6c+_0x42655f(0xd7)+_0x3f893a));}});for(const _0x31929c of _0x427126){!_0x5e5068['find'](_0x535967=>_0x535967[_0x22d9e4(0xff)]===_0x31929c[_0x22d9e4(0xff)])&&_0x5e5068['push'](_0x31929c);}}catch(_0x453072){_0x1d4f6b[_0x22d9e4(0x113)]();const _0x2ce0e1=_0x453072 instanceof Error?_0x453072[_0x22d9e4(0x137)]:String(_0x453072);return console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0xd1)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x2ce0e1)),0x1;}_0x1d4f6b[_0x22d9e4(0x113)]();if(_0xee9a93['length']>0x0){console[_0x22d9e4(0x11e)](),console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0xd3)]('Executing\x20new\x20tests...'));const {projectId:_0x5921dc,agentId:_0x5f2c8b}=_0x5ae433[_0x22d9e4(0xf7)];for(const _0x35e9b2 of _0xee9a93){console[_0x22d9e4(0x11e)](_0x22d9e4(0xc1)+a5_0x1f9320[_0x22d9e4(0x141)](_0x35e9b2[_0x22d9e4(0xff)]));const _0x680564=createCommandSpinner('Round\x201/'+_0x35e9b2['rounds'][_0x22d9e4(0x114)]+_0x22d9e4(0x10d));_0x680564[_0x22d9e4(0xc3)]();try{const {result:_0x31fc42}=await runTest(_0x5a846e[_0x22d9e4(0xce)],_0x35e9b2,{'agentId':_0x5f2c8b,'projectId':_0x5921dc,'site':_0x5ae433[_0x22d9e4(0xcf)],'noEval':![],'evaluatorId':_0x3a43b8,'onRoundStart':(_0x471dff,_0x1add6c)=>{const _0x4c7231=_0x22d9e4;_0x680564[_0x4c7231(0x12b)]=_0x4c7231(0x14b)+(_0x471dff+0x1)+'/'+_0x1add6c+_0x4c7231(0x10d);},'onRoundComplete':(_0x41859a,_0x10b074,_0x4b514d)=>{const _0xffa523=_0x22d9e4,_0x19aca0=formatElapsed(_0x10b074);_0x4b514d?console[_0xffa523(0x11e)](_0xffa523(0xe0)+(_0x41859a+0x1)+'/'+_0x35e9b2[_0xffa523(0x13c)]['length']+_0xffa523(0x10f)+a5_0x1f9320[_0xffa523(0x12a)]('✓')+'\x20('+_0x19aca0+')'):console[_0xffa523(0x11e)]('\x20\x20Round\x20'+(_0x41859a+0x1)+'/'+_0x35e9b2[_0xffa523(0x13c)][_0xffa523(0x114)]+_0xffa523(0x10f)+a5_0x1f9320[_0xffa523(0xd1)]('✗'));},'onEvaluationStart':()=>{_0x680564['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x37a261=>{const _0x32d225=_0x22d9e4,_0x4c05b2=formatElapsed(_0x37a261);console[_0x32d225(0x11e)]('\x20\x20Evaluating...\x20'+a5_0x1f9320[_0x32d225(0x12a)]('✓')+'\x20('+_0x4c05b2+')');}});_0x680564[_0x22d9e4(0x113)](),_0x5e5068[_0x22d9e4(0x122)](_0x31fc42);if(_0x31fc42[_0x22d9e4(0x142)]===_0x22d9e4(0x14f))console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0x12a)](_0x22d9e4(0xe3)+_0x31fc42['reason'])+a5_0x1f9320['dim'](_0x22d9e4(0xe5)));else _0x31fc42[_0x22d9e4(0x142)]===_0x22d9e4(0x104)?console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0xd1)]('✗\x20FAIL:\x20'+_0x31fc42[_0x22d9e4(0x102)])+a5_0x1f9320[_0x22d9e4(0x124)](_0x22d9e4(0xe5))):console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0xd1)](_0x22d9e4(0xeb)+_0x31fc42[_0x22d9e4(0x102)]));_0x31fc42[_0x22d9e4(0x123)]&&console[_0x22d9e4(0x11e)](a5_0x1f9320['dim'](_0x22d9e4(0xfa)+_0x31fc42['conversation_url']));}catch(_0x6fd13f){_0x680564[_0x22d9e4(0x113)]();const _0x545f4c=_0x6fd13f instanceof Error?_0x6fd13f[_0x22d9e4(0x137)]:String(_0x6fd13f);console['log'](a5_0x1f9320[_0x22d9e4(0xd1)](_0x22d9e4(0xeb)+_0x545f4c)),_0x5e5068[_0x22d9e4(0x122)]({'name':_0x35e9b2[_0x22d9e4(0xff)],'status':'ERROR','reason':_0x545f4c,'timestamp':new Date()[_0x22d9e4(0xd5)](),'duration_ms':0x0});}}}console[_0x22d9e4(0x11e)]();const _0x48d3bb=Date['now']()-_0x1ace43,_0x47c2fd=_0x5e5068['filter'](_0x373926=>_0x373926['status']===_0x22d9e4(0x14f))['length'],_0x4cb85e=_0x5e5068[_0x22d9e4(0xc6)](_0x5edcbf=>_0x5edcbf[_0x22d9e4(0x142)]===_0x22d9e4(0x104))[_0x22d9e4(0x114)],_0x30c2b0=_0x5e5068['filter'](_0xe0e81c=>_0xe0e81c['status']==='ERROR')[_0x22d9e4(0x114)];console[_0x22d9e4(0x11e)]('━'[_0x22d9e4(0x14d)](0x3c)),console[_0x22d9e4(0x11e)](_0x22d9e4(0xe1)),console[_0x22d9e4(0x11e)]('━'['repeat'](0x3c)),console[_0x22d9e4(0x11e)](_0x22d9e4(0xd2)+_0x5e5068['length']),console[_0x22d9e4(0x11e)]('Passed:\x20\x20\x20'+a5_0x1f9320[_0x22d9e4(0x12a)](_0x47c2fd)),console[_0x22d9e4(0x11e)](_0x22d9e4(0xdf)+a5_0x1f9320[_0x22d9e4(0xd1)](_0x4cb85e));_0x30c2b0>0x0&&console[_0x22d9e4(0x11e)]('Errors:\x20\x20\x20'+a5_0x1f9320[_0x22d9e4(0xd1)](_0x30c2b0));console[_0x22d9e4(0x11e)]('Duration:\x20'+formatElapsed(_0x48d3bb)),console[_0x22d9e4(0x11e)]('━'[_0x22d9e4(0x14d)](0x3c));const _0x8cceb9={'summary':{'total':_0x5e5068[_0x22d9e4(0x114)],'passed':_0x47c2fd,'failed':_0x4cb85e,'errors':_0x30c2b0>0x0?_0x30c2b0:undefined,'duration_ms':_0x48d3bb},'tests':_0x5e5068,'agent':{'project':_0x46fe22[_0x22d9e4(0xdd)],'name':_0x46fe22[_0x22d9e4(0x100)],'site':_0x386460},'timestamp':new Date(_0x1ace43)[_0x22d9e4(0xd5)]()};if(_0x49900a!==_0x22d9e4(0x150)||_0x29ceda){const _0x16f3c9=formatResults(_0x8cceb9,_0x49900a);if(_0x29ceda)try{a5_0x59467f[_0x22d9e4(0x11b)](_0x29ceda,_0x16f3c9,_0x22d9e4(0x119)),console[_0x22d9e4(0x11e)](),console[_0x22d9e4(0x11e)](a5_0x1f9320['dim'](_0x22d9e4(0x101)+_0x29ceda));}catch(_0x34da39){return console[_0x22d9e4(0x11e)](),console[_0x22d9e4(0x11e)](a5_0x1f9320[_0x22d9e4(0xd1)]('Error\x20writing\x20output\x20file:\x20'+_0x34da39)),0x1;}else console[_0x22d9e4(0x11e)](),console[_0x22d9e4(0x11e)](_0x16f3c9);}const _0x5ae88c=_0x5e5068[_0x22d9e4(0xc6)](_0x3171a6=>_0x3171a6[_0x22d9e4(0x142)]!==_0x22d9e4(0x14f));return _0x5ae88c['length']>0x0?0x1:0x0;}}function a5_0x37e7(){const _0x27a826=['404','9XCYujv','Re-evaluating\x20cached\x20test\x20run...','no_context','Test\x20Configuration:','not\x20found','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Round\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','repeat','existsSync','PASS','table','Running:\x20','substring','start','Tests\x20found:\x20','No\x20tests\x20have\x20tags\x20defined.','filter','Conversation\x20URL:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','7VLhvCh','forEach','New\x20tests\x20to\x20execute:\x20','basename','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','llm','site','join','red','Total:\x20\x20\x20\x20','cyan','no_local_folder','toISOString','testName','\x20-\x20','execute','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','json','resolve','\x20\x20Site:\x20','projectName','\x27\x20to\x20create\x20the\x20folder\x20structure.','Failed:\x20\x20\x20','\x20\x20Round\x20','Re-evaluation\x20Summary','source','✓\x20PASS:\x20','\x20\x20Project:\x20','\x20(new)','some','1075292KMFgOM','Running\x20agent\x20tests...','19607330LOZEsH','Available\x20tags:\x20','✗\x20ERROR:\x20','\x22:\x20','tests','jsonl','✗\x20FAIL:\x20','has','projectDir','yellow','no_tests','\x20\x20Evaluating...\x20','Site:\x20','round','agent','verbose','Usage:','\x20\x20Conversation:\x20','toLowerCase','Run\x20\x27tdx\x20agent\x20pull\x20','No\x20tests\x20found\x20with\x20tags:\x20','llmProject','name','agentName','Output\x20written\x20to:\x20','reason','Cached\x20run\x20from:\x20','FAIL','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','found','/<agent-name>','size','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20',':\x20Sending\x20user\x20input...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','...\x20','2282060jfxmkU','98206LxKiUJ','Test\x20Summary','stop','length','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20\x20Agent:\x20','now','includes','utf-8','Using\x20agent:\x20','writeFileSync','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agent:test','log','Either\x20switch\x20to\x20the\x20\x22','test.yml','Run\x20tests\x20for\x20an\x20LLM\x20agent','push','conversation_url','dim','executeReeval','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating\x20','ERROR','1790931VzXnVA','green','text','...','split','Project\x20path:\x20','isSpinning','⚠\x20SKIPPED:\x20','trim','Evaluating\x20response...','Agent:\x20','\x20(cached)','1796232MxhFrp','\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)','message','map','tsv','2565492xCLOWW','8DebPkF','rounds','timestamp','Passed:\x20\x20\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','white','status','tags'];a5_0x37e7=function(){return _0x27a826;};return a5_0x37e7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x24d292=a6_0x8bf1;(function(_0x1d80b4,_0x44235f){const _0x518b28=a6_0x8bf1,_0x2296d1=_0x1d80b4();while(!![]){try{const _0x2ae739=parseInt(_0x518b28(0x129))/0x1*(parseInt(_0x518b28(0x145))/0x2)+-parseInt(_0x518b28(0x13e))/0x3+parseInt(_0x518b28(0x157))/0x4*(-parseInt(_0x518b28(0x140))/0x5)+parseInt(_0x518b28(0x15b))/0x6+parseInt(_0x518b28(0x141))/0x7+-parseInt(_0x518b28(0x12c))/0x8*(parseInt(_0x518b28(0x159))/0x9)+parseInt(_0x518b28(0x134))/0xa;if(_0x2ae739===_0x44235f)break;else _0x2296d1['push'](_0x2296d1['shift']());}catch(_0x6840ad){_0x2296d1['push'](_0x2296d1['shift']());}}}(a6_0x46f3,0x98e89));function a6_0x46f3(){const _0x5b9ffc=['readBodyFromFile','trim','api','POST','Error:\x20','4LtsHwL','trino','3004389pQOwPf','output','881850JTaCBc','validate','method','has','stack','proxy-authorization','log','verbose','cookie','Invalid\x20API\x20type:\x20','1ULpYos','join','length','8pACWyL','status','authorization','PATCH','keys','noColor','cdp','x-trino-user','4061110igaacb','GET','message','DELETE','site','type','error','body','llm','x-xsrf-token','1326822bWMAQc','substring','2132005WtTdAG','8468516YdCprB','toUpperCase','PUT','file','131870WennYC','toLowerCase','Invalid\x20header\x20format:\x20\x22','<\x20HTTP/1.1\x20','set-cookie2','x-auth-token','data','Invalid\x20HTTP\x20method:\x20','headers','entries','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','color','name'];a6_0x46f3=function(){return _0x5b9ffc;};return a6_0x46f3();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x24d292(0x12e),a6_0x24d292(0x124),a6_0x24d292(0x127),'set-cookie',a6_0x24d292(0x149),a6_0x24d292(0x13d),a6_0x24d292(0x14a),a6_0x24d292(0x133)]);function isSensitiveHeader(_0x167afa){const _0x39e0a1=a6_0x24d292;return SENSITIVE_HEADERS[_0x39e0a1(0x122)](_0x167afa[_0x39e0a1(0x146)]());}function parseHeader(_0x1ad520){const _0x49d94c=a6_0x24d292,_0x48e984=_0x1ad520['indexOf'](':');if(_0x48e984===-0x1)throw new Error(_0x49d94c(0x147)+_0x1ad520+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x25bd44=_0x1ad520[_0x49d94c(0x13f)](0x0,_0x48e984)[_0x49d94c(0x153)](),_0x2aab76=_0x1ad520['substring'](_0x48e984+0x1)[_0x49d94c(0x153)]();if(!_0x25bd44)throw new Error(_0x49d94c(0x14f)+_0x1ad520+'\x22');return[_0x25bd44,_0x2aab76];}function a6_0x8bf1(_0x438afc,_0x937ae4){_0x438afc=_0x438afc-0x122;const _0x46f3bc=a6_0x46f3();let _0x8bf10f=_0x46f3bc[_0x438afc];return _0x8bf10f;}export class ApiCommand extends BaseCommand{[a6_0x24d292(0x151)]='api';['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x24d292(0x15c)](_0x2c07c5){const _0x14dd19=a6_0x24d292,{args:_0x296d09,options:_0x417746}=_0x2c07c5,_0x339436=_0x417746;if(_0x296d09[_0x14dd19(0x12b)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2cb297=_0x296d09[0x0];if(!_0x2cb297['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x2cb297;const _0x538b4d=_0x339436[_0x14dd19(0x14b)],_0x1c3332=_0x339436[_0x14dd19(0x144)];if(_0x538b4d&&_0x1c3332)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x5c349c=_0x339436[_0x14dd19(0x15d)]||'GET',_0x4997df=[_0x14dd19(0x135),_0x14dd19(0x155),_0x14dd19(0x143),_0x14dd19(0x137),_0x14dd19(0x12f)];if(!_0x4997df['includes'](_0x5c349c[_0x14dd19(0x142)]()))return _0x14dd19(0x14c)+_0x5c349c+'.\x20Valid\x20methods:\x20'+_0x4997df[_0x14dd19(0x12a)](',\x20');const _0x5be05b=_0x339436[_0x14dd19(0x139)]||'td',_0x867f90=['td',_0x14dd19(0x132),'workflow',_0x14dd19(0x158),_0x14dd19(0x13c),'llm-proxy'];if(!_0x867f90['includes'](_0x5be05b))return _0x14dd19(0x128)+_0x5be05b+'.\x20Valid\x20types:\x20'+_0x867f90[_0x14dd19(0x12a)](',\x20');return undefined;}async['execute'](_0xf2664f){const _0x4aaa0b=a6_0x24d292,{options:_0x1d76d8,args:_0x2aea28,tdx:_0x3510b3}=_0xf2664f,_0x5713ee=_0x1d76d8,_0x54c489=_0x2aea28[0x0],_0xcc1d00=(_0x5713ee['method']||_0x4aaa0b(0x135))[_0x4aaa0b(0x142)](),_0xfcf968=_0x5713ee[_0x4aaa0b(0x14b)],_0x55e1ad=_0x5713ee['file'],_0x17c859=_0x5713ee['header'],_0x3ade2f=_0x5713ee['type']||'td';try{const _0xf7e597={};if(_0x17c859){const _0x56f9fb=Array['isArray'](_0x17c859)?_0x17c859:[_0x17c859];for(const _0x4266c3 of _0x56f9fb){const [_0x18454f,_0x49c85b]=parseHeader(_0x4266c3);_0xf7e597[_0x18454f]=_0x49c85b;}}let _0x4ab2c5;if(_0xfcf968)_0x4ab2c5=_0xfcf968;else{if(_0x55e1ad)try{_0x4ab2c5=RawAPI[_0x4aaa0b(0x152)](_0x55e1ad);}catch(_0xecbc49){return console['error']('Error:\x20'+(_0xecbc49 instanceof Error?_0xecbc49[_0x4aaa0b(0x136)]:String(_0xecbc49))),0x1;}}const _0x4b24fa={'method':_0xcc1d00,'apiType':_0x3ade2f,'includeHeaders':_0x1d76d8[_0x4aaa0b(0x126)]};_0x4ab2c5&&(_0x4b24fa[_0x4aaa0b(0x13b)]=_0x4ab2c5);Object[_0x4aaa0b(0x130)](_0xf7e597)[_0x4aaa0b(0x12b)]>0x0&&(_0x4b24fa[_0x4aaa0b(0x14d)]=_0xf7e597);if(_0x1d76d8['verbose']){const _0x394f86=resolveSite(_0x1d76d8[_0x4aaa0b(0x138)]),_0x44deb3=getEndpoint(_0x394f86,_0x3ade2f),_0x2d5fbe=''+_0x44deb3+_0x54c489;console[_0x4aaa0b(0x13a)]('>\x20'+_0xcc1d00+'\x20'+_0x2d5fbe);const _0x1a9103=getAuthHeaders(_0x394f86),_0x51904b={..._0x1a9103,..._0xf7e597};for(const [_0x2c641a,_0xd46ab6]of Object[_0x4aaa0b(0x14e)](_0x51904b)){!isSensitiveHeader(_0x2c641a)&&console[_0x4aaa0b(0x13a)]('>\x20'+_0x2c641a+':\x20'+_0xd46ab6);}_0x4ab2c5&&console[_0x4aaa0b(0x13a)]('>'),console[_0x4aaa0b(0x13a)]('');}const _0x51e5ed=await _0x3510b3[_0x4aaa0b(0x154)]['request'](_0x54c489,_0x4b24fa);if(_0x1d76d8['verbose']&&_0x51e5ed['headers']){console[_0x4aaa0b(0x13a)](_0x4aaa0b(0x148)+_0x51e5ed[_0x4aaa0b(0x12d)]);for(const [_0x11cbdf,_0x2db5d3]of Object[_0x4aaa0b(0x14e)](_0x51e5ed[_0x4aaa0b(0x14d)])){!isSensitiveHeader(_0x11cbdf)&&console[_0x4aaa0b(0x13a)]('<\x20'+_0x11cbdf+':\x20'+_0x2db5d3);}console['error']('');}const _0x4217e5=Boolean(_0x1d76d8[_0x4aaa0b(0x15a)]),_0x141de9={'color':_0x1d76d8['color'],'noColor':_0x1d76d8[_0x4aaa0b(0x131)]||_0x4217e5&&!_0x1d76d8[_0x4aaa0b(0x150)]},_0x31883b=colorizeJSON(_0x51e5ed['data'],_0x141de9);return _0x1d76d8[_0x4aaa0b(0x15a)]?(writeFileSync(_0x1d76d8['output'],_0x31883b),console['error']('Results\x20saved\x20to\x20'+_0x1d76d8[_0x4aaa0b(0x15a)])):console[_0x4aaa0b(0x125)](_0x31883b),0x0;}catch(_0x3bedaa){return _0x3bedaa instanceof Error?(console[_0x4aaa0b(0x13a)](_0x4aaa0b(0x156)+_0x3bedaa[_0x4aaa0b(0x136)]),_0x1d76d8[_0x4aaa0b(0x126)]&&_0x3bedaa[_0x4aaa0b(0x123)]&&console[_0x4aaa0b(0x13a)]('\x0aStack\x20trace:\x0a'+_0x3bedaa[_0x4aaa0b(0x123)])):console['error'](_0x4aaa0b(0x156)+String(_0x3bedaa)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x3c813e=a7_0x48ed;(function(_0x525471,_0x29e7fa){const _0x34060c=a7_0x48ed,_0x51d622=_0x525471();while(!![]){try{const _0x3092f0=-parseInt(_0x34060c(0x1fe))/0x1+parseInt(_0x34060c(0x1fb))/0x2*(-parseInt(_0x34060c(0x1e5))/0x3)+-parseInt(_0x34060c(0x1ce))/0x4*(-parseInt(_0x34060c(0x200))/0x5)+parseInt(_0x34060c(0x1f3))/0x6+parseInt(_0x34060c(0x1ca))/0x7+parseInt(_0x34060c(0x1e3))/0x8+-parseInt(_0x34060c(0x1ef))/0x9*(-parseInt(_0x34060c(0x1c8))/0xa);if(_0x3092f0===_0x29e7fa)break;else _0x51d622['push'](_0x51d622['shift']());}catch(_0x216a14){_0x51d622['push'](_0x51d622['shift']());}}}(a7_0x1960,0x49526));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x30f01f from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a7_0x48ed(_0x1800ca,_0x5e5376){_0x1800ca=_0x1800ca-0x1bc;const _0x196021=a7_0x1960();let _0x48ed1=_0x196021[_0x1800ca];return _0x48ed1;}function a7_0x1960(){const _0x543ea3=['us01','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','System\x20keychain\x20is\x20not\x20available','auth:clear','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','apiKey','red','/app/mp/ak','\x20(site:\x20','221193ZyciEZ','Setting\x20up\x20authentication\x20for\x20site:\x20','bold','Select\x20your\x20Treasure\x20Data\x20site:','2048118QOvuzf','No\x20API\x20key\x20found\x20in\x20keychain','profile','\x0aSetup\x20cancelled','other','filter','\x20\x20tdx','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','838162QXwFnm','\x27\x20registered','API\x20key\x20cannot\x20be\x20empty','545065ClZYOg','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','5zLhRzt','jobs','error','email','text','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','tdx:\x20auth\x20clear','✓\x20Default\x20site\x20set\x20to\x20','tdx:\x20auth\x20setup','name','\x20(profile:\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','trim','Validating\x20API\x20key...','auth:setup','✗\x20Validation\x20failed:\x20','Site\x20name\x20cannot\x20be\x20empty','Setup\x20API\x20key\x20authentication\x20interactively','40TcBLcW','No\x20credential\x20found','1677466uaBYtk','yellow','message','warn','763892KRrCgl','Remove\x20API\x20key\x20from\x20system\x20keychain','log','\x20--profile\x20','description','execute','ERROR','customSite','Enter\x20site\x20name:','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20for\x20profile:\x20','N/A','test','first_name','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','getUserInfo','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','site','User:\x20','✓\x20Authentication\x20successful\x0a','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','3153600CesPzT','last_name','3wOiUsT'];a7_0x1960=function(){return _0x543ea3;};return a7_0x1960();}import a7_0x56212d from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x3c813e(0x1bf)]=a7_0x3c813e(0x1c4);['description']=a7_0x3c813e(0x1c7);async[a7_0x3c813e(0x1d3)](_0xaa623d){const _0x6e979a=a7_0x3c813e,{options:_0x4b8814}=_0xaa623d,_0x4b8760=_0x4b8814[_0x6e979a(0x1f5)];console[_0x6e979a(0x1d0)](a7_0x56212d['bold'](_0x6e979a(0x1be)));const _0x3ddb44=_0x4b8814[_0x6e979a(0x1df)]||_0x6e979a(0x1e6),{choices:_0x26e647,initialIndex:_0x4ac7af}=buildSiteChoices(_0x3ddb44),_0x2633cb=_0x4b8760?_0x6e979a(0x1de)+_0x4b8760+'):':_0x6e979a(0x1f2),_0x9cbfc5=await a7_0x30f01f({'type':'select','name':'site','message':_0x2633cb,'choices':_0x26e647,'initial':_0x4ac7af});if(!_0x9cbfc5['site'])return console[_0x6e979a(0x1d0)](_0x6e979a(0x1f6)),0x1;let _0x42b4c8;if(_0x9cbfc5[_0x6e979a(0x1df)]===_0x6e979a(0x1f7)){const _0x1f643c=await a7_0x30f01f({'type':_0x6e979a(0x204),'name':'customSite','message':_0x6e979a(0x1d6),'initial':_0x6e979a(0x1e6),'validate':_0x2916b6=>{const _0x3d5f05=_0x6e979a;if(!_0x2916b6||!_0x2916b6['trim']())return _0x3d5f05(0x1c6);if(!/^[a-z0-9-]+$/[_0x3d5f05(0x1da)](_0x2916b6['trim']()))return _0x3d5f05(0x1ff);return!![];}});if(!_0x1f643c[_0x6e979a(0x1d5)])return console[_0x6e979a(0x1d0)](_0x6e979a(0x1f6)),0x1;_0x42b4c8=_0x1f643c[_0x6e979a(0x1d5)];}else _0x42b4c8=_0x9cbfc5[_0x6e979a(0x1df)];const _0x209e0e=resolveSite(_0x42b4c8);console[_0x6e979a(0x1d0)](_0x6e979a(0x1f0)+_0x209e0e),console['log'](_0x6e979a(0x1d7)),console[_0x6e979a(0x1d0)]('\x20\x20'+getConsoleUrl(_0x209e0e,_0x6e979a(0x1ed)));const _0x408f71=await a7_0x30f01f({'type':'password','name':_0x6e979a(0x1eb),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x2df387=>{const _0x5f1072=_0x6e979a;if(!_0x2df387||!_0x2df387[_0x5f1072(0x1c2)]())return _0x5f1072(0x1fd);return!![];}});if(!_0x408f71[_0x6e979a(0x1eb)])return console[_0x6e979a(0x1d0)](_0x6e979a(0x1f6)),0x1;const _0x5abf1b=_0x408f71['apiKey'];console['log'](_0x6e979a(0x1c3));try{const _0x28bfad=TDX['create']({'site':_0x209e0e,'apiKey':_0x5abf1b['trim'](),'logLevel':_0x4b8814['logLevel']??LogLevel[_0x6e979a(0x1d4)]}),_0x23b5d4=await _0x28bfad[_0x6e979a(0x201)][_0x6e979a(0x1dd)]();console['log'](_0x6e979a(0x1fa)+_0x23b5d4[_0x6e979a(0x203)]+')');const _0xe8859a=await isKeychainAvailable();_0xe8859a?(await saveAPIKeyAsync(_0x5abf1b['trim'](),_0x209e0e,_0x4b8760),console['log'](_0x6e979a(0x1e2)+(_0x4b8760?_0x6e979a(0x1c0)+_0x4b8760+')':''))):(console[_0x6e979a(0x1cd)](a7_0x56212d[_0x6e979a(0x1cb)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x6e979a(0x1cd)](a7_0x56212d[_0x6e979a(0x1cb)](_0x6e979a(0x1e7))));if(_0x4b8760){const _0x4d1d0f={'site':_0x209e0e};saveProfileToUserConfig(_0x4b8760,_0x4d1d0f),console[_0x6e979a(0x1d0)]('✓\x20Profile\x20\x27'+_0x4b8760+_0x6e979a(0x1fc));}else saveDefaultSiteToUserConfig(_0x209e0e),console['log'](_0x6e979a(0x1bd)+_0x209e0e);const _0x1e7afb=_0x4b8760?_0x6e979a(0x1d1)+_0x4b8760:'';return console[_0x6e979a(0x1d0)](),console['log'](_0x6e979a(0x1ea)),console[_0x6e979a(0x1d0)](_0x6e979a(0x1f9)+_0x1e7afb+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x6e979a(0x1f9)+_0x1e7afb+_0x6e979a(0x205)),0x0;}catch(_0x7abd4e){if(_0x7abd4e instanceof HTTPClientError&&_0x7abd4e['status']===0x191)return printAuthError(_0x7abd4e),0x1;return console[_0x6e979a(0x202)](a7_0x56212d['red'](_0x6e979a(0x1c5)+(_0x7abd4e instanceof Error?_0x7abd4e[_0x6e979a(0x1cc)]:String(_0x7abd4e)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x3c813e(0x1d2)]=a7_0x3c813e(0x1dc);async['execute'](_0x5a977d){const _0x28f44f=a7_0x3c813e,{options:_0x25d271,tdx:_0x2f7419}=_0x5a977d,_0x564050=_0x25d271[_0x28f44f(0x1df)],_0x29cd41=_0x25d271[_0x28f44f(0x1f5)],_0x27b68f=_0x29cd41?_0x29cd41:_0x28f44f(0x1d9);console[_0x28f44f(0x1d0)]('tdx\x20profile:\x20'+_0x27b68f+_0x28f44f(0x1ee)+_0x564050+')');const _0x69ce73=await resolveAPIKeyAsync(_0x564050,_0x29cd41);if(_0x69ce73){const {source:_0x1090c1,isDeprecated:_0x560774}=_0x69ce73,_0x52bfe4='Read\x20credential\x20from\x20'+_0x1090c1;console['log'](_0x560774?a7_0x56212d['yellow'](_0x52bfe4):_0x52bfe4);}else console[_0x28f44f(0x1d0)](a7_0x56212d[_0x28f44f(0x1cb)](_0x28f44f(0x1c9)));try{const _0x23b594=await _0x2f7419[_0x28f44f(0x201)]['getUserInfo']();return console['log'](a7_0x56212d['green'](_0x28f44f(0x1e1))),console[_0x28f44f(0x1d0)](_0x28f44f(0x1e0)+_0x23b594['email']),(_0x23b594[_0x28f44f(0x1db)]||_0x23b594[_0x28f44f(0x1e4)])&&console[_0x28f44f(0x1d0)]('Name:\x20'+[_0x23b594[_0x28f44f(0x1db)],_0x23b594[_0x28f44f(0x1e4)]][_0x28f44f(0x1f8)](Boolean)['join']('\x20')),0x0;}catch(_0x2e0503){return _0x2e0503 instanceof HTTPClientError&&_0x2e0503['status']===0x191?printAuthError(_0x2e0503,!![],_0x29cd41):console['error'](a7_0x56212d[_0x28f44f(0x1ec)](_0x28f44f(0x1c5)+(_0x2e0503 instanceof Error?_0x2e0503[_0x28f44f(0x1cc)]:String(_0x2e0503)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3c813e(0x1bf)]=a7_0x3c813e(0x1e9);[a7_0x3c813e(0x1d2)]=a7_0x3c813e(0x1cf);async[a7_0x3c813e(0x1d3)](_0x113dad){const _0xb0f568=a7_0x3c813e,{options:_0x1dff88}=_0x113dad,_0x249fdc=_0x1dff88['profile'];console[_0xb0f568(0x1d0)](a7_0x56212d[_0xb0f568(0x1f1)](_0xb0f568(0x1bc)));const _0x5829e0=await isKeychainAvailable();if(!_0x5829e0)return console['error'](a7_0x56212d[_0xb0f568(0x1ec)](_0xb0f568(0x1e8))),0x1;const _0x3ebcb5=await deleteKeychainAPIKey(_0x249fdc);return _0x3ebcb5?(clearCredentialCache(),console[_0xb0f568(0x1d0)](_0xb0f568(0x1c1)+(_0x249fdc?_0xb0f568(0x1c0)+_0x249fdc+')':'')),0x0):(console[_0xb0f568(0x1d0)](_0xb0f568(0x1f4)+(_0x249fdc?_0xb0f568(0x1d8)+_0x249fdc:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x54ca86=a8_0x4a0d;function a8_0x4a0d(_0x8bd2a8,_0x31a8f2){_0x8bd2a8=_0x8bd2a8-0x1b3;const _0x275bda=a8_0x275b();let _0x4a0d2a=_0x275bda[_0x8bd2a8];return _0x4a0d2a;}(function(_0x1c812e,_0x4cb4fc){const _0x22953e=a8_0x4a0d,_0x10610f=_0x1c812e();while(!![]){try{const _0x32cae7=-parseInt(_0x22953e(0x1f3))/0x1+parseInt(_0x22953e(0x1b9))/0x2*(parseInt(_0x22953e(0x1c2))/0x3)+parseInt(_0x22953e(0x1d3))/0x4*(parseInt(_0x22953e(0x1f9))/0x5)+-parseInt(_0x22953e(0x1ce))/0x6+-parseInt(_0x22953e(0x1f0))/0x7+-parseInt(_0x22953e(0x1d2))/0x8+parseInt(_0x22953e(0x1e7))/0x9;if(_0x32cae7===_0x4cb4fc)break;else _0x10610f['push'](_0x10610f['shift']());}catch(_0x4a8ae0){_0x10610f['push'](_0x10610f['shift']());}}}(a8_0x275b,0xe2155));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x5f2ab7,_0x54e053){const _0x19662e=a8_0x4a0d;if(_0x5f2ab7 instanceof SDKError)console[_0x19662e(0x1b6)](_0x19662e(0x1ee)+_0x5f2ab7[_0x19662e(0x1cd)]),_0x54e053[_0x19662e(0x1b5)]&&(_0x5f2ab7[_0x19662e(0x1f4)]&&console['error']('\x20\x20Cause:\x20'+_0x5f2ab7['cause']),_0x5f2ab7['stack']&&(console[_0x19662e(0x1b6)](_0x19662e(0x1dd)),console['error'](_0x5f2ab7[_0x19662e(0x1e9)])));else throw _0x5f2ab7;}function a8_0x275b(){const _0x2e197b=['chat','new','llmProject','startChat','slice','validate','tool','22975425deABmf','context','stack','targetAgent','chatId','stdout','agentId','Error:\x20','includes','8345029IUXHno','CHAT_NOT_FOUND','execute','1138157QqUnvr','cause','functionName','resolveProjectId','type','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','92060IZbrAK','404','resolveAgentId','tool_result','args','chat-create','agent','verbose','error','description','targetFunction','2NSCWFM','Error:\x20Chat\x20session\x20\x27','tool_call','\x27\x20not\x20found','Getting\x20default\x20agent...','string','projectId','name','Chat\x20session:\x20','2036523qVesDz','streamChatJsonl','getOrCreateDefaultAgent','\x27...','stringify','content','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Using\x20agent\x20from\x20','Create\x20a\x20new\x20chat\x20session','targetKnowledgeBase','--agent\x20flag','message','3352518sOZkFq','metadata','session\x20context','Continuing\x20chat:\x20','8883808kLYoIm','368ZmSnPW','join','event','site','write','llmAgent','log','llm','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','data','\x0aStack\x20trace:','handleChatEvent','done'];a8_0x275b=function(){return _0x2e197b;};return a8_0x275b();}async function resolveAgentId(_0x3da453,_0x53c524,_0x401e1c,_0x48919c,_0x368e9e){const _0xf67c58=a8_0x4a0d,_0x17f816=_0x53c524||_0x401e1c;if(_0x17f816){const {projectName:_0x53a5ea,agentName:_0x5437e4}=parseAgentRef(_0x17f816),_0x2df1ce=_0x5437e4||_0x17f816,_0x365321=_0x5437e4?_0x53a5ea:_0x48919c;if(!_0x365321)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x368e9e){const _0x5897f9=_0x53c524?_0xf67c58(0x1cc):_0xf67c58(0x1d0);console[_0xf67c58(0x1b6)](_0xf67c58(0x1c9)+_0x5897f9+':\x20'+_0x365321+'/'+_0x2df1ce);}const _0x17fdbd=await withSpinner('Resolving\x20project\x20\x27'+_0x365321+_0xf67c58(0x1c5),()=>_0x3da453[_0xf67c58(0x1da)][_0xf67c58(0x1f6)](_0x365321),{'verbose':_0x368e9e}),_0x21d201=await withSpinner('Resolving\x20agent\x20\x27'+_0x2df1ce+_0xf67c58(0x1c5),()=>_0x3da453[_0xf67c58(0x1da)][_0xf67c58(0x1fb)](_0x2df1ce,_0x17fdbd['data']),{'verbose':_0x368e9e});return _0x21d201['data'];}else{const _0x2a424f=_0x3da453['llm']['getDefaultAgent']();if(_0x2a424f)return _0x368e9e&&console[_0xf67c58(0x1b6)]('Using\x20cached\x20default\x20agent:\x20'+_0x2a424f[_0xf67c58(0x1c0)]),_0x2a424f['id'];const _0x4b903f=await withSpinner(_0xf67c58(0x1bd),()=>_0x3da453[_0xf67c58(0x1da)][_0xf67c58(0x1c4)]('claude-4.5-haiku',0x0),{'verbose':_0x368e9e});return _0x4b903f[_0xf67c58(0x1dc)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x54ca86(0x1c0)]=a8_0x54ca86(0x1e0);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x54ca86(0x1e5)](_0x5281f7){const _0xa710b1=a8_0x54ca86,_0x3bc4ac=_0x5281f7[_0xa710b1(0x1fd)][_0xa710b1(0x1d4)]('\x20');if(!_0x3bc4ac)return _0xa710b1(0x1db);return undefined;}async['streamChat'](_0x4a9b85,_0x40ca81,_0x4fe15e,_0x33ceed,_0x593ad8){const _0x129f58=a8_0x54ca86;for await(const _0x424b1f of _0x4a9b85[_0x129f58(0x1da)][_0x129f58(0x1e0)](_0x40ca81,{'agentId':_0x4fe15e,'chatId':_0x33ceed})){if(_0x424b1f[_0x129f58(0x1f7)]==='metadata'){const _0x225c58=_0x424b1f['data']['chatId'];saveLastChatId(_0x225c58),_0x593ad8&&console[_0x129f58(0x1b6)](_0x129f58(0x1c1)+_0x225c58);}else _0x424b1f['type']==='event'&&this['handleChatEvent'](_0x424b1f[_0x129f58(0x1dc)]);}}async[a8_0x54ca86(0x1c3)](_0x49d50f,_0x27f672,_0x22f677,_0x3fd7f4){const _0x445df0=a8_0x54ca86,_0x457b11=_0x49d50f[_0x445df0(0x1e8)][_0x445df0(0x1d6)];let _0x54efc6=![];for await(const _0x42a6f1 of _0x49d50f[_0x445df0(0x1da)]['chat'](_0x27f672,{'agentId':_0x22f677,'chatId':_0x3fd7f4})){if(_0x42a6f1[_0x445df0(0x1f7)]===_0x445df0(0x1cf)){const _0x22355b=_0x42a6f1[_0x445df0(0x1dc)];saveLastChatId(_0x22355b[_0x445df0(0x1eb)]);const _0x37bd4d=_0x22355b[_0x445df0(0x1bf)]&&_0x22355b[_0x445df0(0x1ed)]?getLLMConversationUrl(_0x457b11,_0x22355b[_0x445df0(0x1bf)],_0x22355b[_0x445df0(0x1ed)],_0x22355b[_0x445df0(0x1eb)]):undefined;console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1cf),'data':{'chatId':_0x22355b[_0x445df0(0x1eb)],'agentId':_0x22355b[_0x445df0(0x1ed)],'consoleUrl':_0x37bd4d}})),_0x54efc6=!![];}else{if(_0x42a6f1[_0x445df0(0x1f7)]===_0x445df0(0x1d5)){!_0x54efc6&&_0x3fd7f4&&(console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1cf),'data':{'chatId':_0x3fd7f4}})),_0x54efc6=!![]);const _0x468619=_0x42a6f1[_0x445df0(0x1dc)];if(_0x445df0(0x1c7)in _0x468619)console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1c7),'data':{'content':_0x468619['content']}}));else{if(_0x445df0(0x1bb)in _0x468619){const _0x2bdbeb=_0x468619[_0x445df0(0x1bb)];console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':'tool_call','data':{'id':_0x2bdbeb['id'],'name':_0x2bdbeb['functionName'],'target':_0x2bdbeb[_0x445df0(0x1cb)]?.[_0x445df0(0x1c0)]||_0x2bdbeb[_0x445df0(0x1ea)]?.[_0x445df0(0x1c0)]||_0x2bdbeb['targetWebSearchTool']?.['name']||_0x2bdbeb[_0x445df0(0x1b8)]}}));}else{if(_0x445df0(0x1e6)in _0x468619)console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1fc),'data':{'id':_0x468619[_0x445df0(0x1e6)]['id'],'name':_0x468619[_0x445df0(0x1e6)][_0x445df0(0x1f5)],'result':typeof _0x468619['tool'][_0x445df0(0x1c7)]===_0x445df0(0x1be)?_0x468619[_0x445df0(0x1e6)][_0x445df0(0x1c7)][_0x445df0(0x1e4)](0x0,0x1f4):''}}));else _0x445df0(0x1b6)in _0x468619&&console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1b6),'data':{'error':_0x468619['error']}}));}}}}}console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1df)}));}async[a8_0x54ca86(0x1f2)](_0x10b8b9){const _0x18fc80=a8_0x54ca86,{options:_0x2751bf,args:_0x4242dd,tdx:_0x68d200}=_0x10b8b9,_0x59dab2=_0x4242dd['join']('\x20'),_0x4e26cf=_0x2751bf,_0x4177c=_0x4e26cf[_0x18fc80(0x1b4)],_0x18575c=_0x4e26cf[_0x18fc80(0x1d8)],_0x1501ce=_0x4e26cf[_0x18fc80(0x1e2)],_0x2a0fd3=_0x4e26cf[_0x18fc80(0x1e1)],_0x15d32b=_0x4e26cf[_0x18fc80(0x1eb)],_0x308a52=_0x4e26cf['stream'];if(_0x2a0fd3&&_0x15d32b)return console['error'](_0x18fc80(0x1f8)),0x1;try{let _0x1ed005,_0x153e9a;if(_0x15d32b)_0x153e9a=_0x15d32b;else!_0x2a0fd3&&(_0x153e9a=loadLastChatId(),_0x153e9a&&_0x2751bf[_0x18fc80(0x1b5)]&&console[_0x18fc80(0x1b6)](_0x18fc80(0x1d1)+_0x153e9a));!_0x15d32b&&(_0x2a0fd3||!_0x153e9a)&&(_0x1ed005=await resolveAgentId(_0x68d200,_0x4177c,_0x18575c,_0x1501ce,_0x2751bf[_0x18fc80(0x1b5)]));const _0x584c99=_0x308a52?(_0x53b6b6,_0xdcb0fa,_0x3064b6)=>this[_0x18fc80(0x1c3)](_0x68d200,_0x53b6b6,_0xdcb0fa,_0x3064b6):(_0x8bbf15,_0x23d80e,_0x23c215)=>this['streamChat'](_0x68d200,_0x8bbf15,_0x23d80e,_0x23c215,_0x2751bf['verbose']);try{await _0x584c99(_0x59dab2,_0x1ed005,_0x153e9a);}catch(_0x5f288d){const _0x2531e8=_0x5f288d instanceof SDKError&&_0x5f288d['code']===ErrorCode[_0x18fc80(0x1f1)]||_0x5f288d instanceof Error&&_0x5f288d['message'][_0x18fc80(0x1ef)](_0x18fc80(0x1fa));if(_0x2531e8&&_0x15d32b)return console[_0x18fc80(0x1b6)](_0x18fc80(0x1ba)+_0x15d32b+_0x18fc80(0x1bc)),0x1;if(_0x2531e8)_0x2751bf[_0x18fc80(0x1b5)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x1ed005&&(_0x1ed005=await resolveAgentId(_0x68d200,_0x4177c,_0x18575c,_0x1501ce,_0x2751bf[_0x18fc80(0x1b5)])),await _0x584c99(_0x59dab2,_0x1ed005,undefined);else throw _0x5f288d;}return!_0x308a52&&console[_0x18fc80(0x1d9)](),0x0;}catch(_0x175a1f){return console['error'](),handleSDKError(_0x175a1f,_0x2751bf),0x1;}}[a8_0x54ca86(0x1de)](_0x15c24a){const _0x39ea1c=a8_0x54ca86;if('content'in _0x15c24a)process[_0x39ea1c(0x1ec)][_0x39ea1c(0x1d7)](_0x15c24a['content']);else _0x39ea1c(0x1b6)in _0x15c24a&&console[_0x39ea1c(0x1b6)]('\x0aError:\x20'+_0x15c24a['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x54ca86(0x1c0)]=a8_0x54ca86(0x1b3);[a8_0x54ca86(0x1b7)]=a8_0x54ca86(0x1ca);[a8_0x54ca86(0x1e5)](_0x10f5b5){const _0x5849ee=a8_0x54ca86,_0x47ebd1=_0x10f5b5['options'],_0x17f807=_0x47ebd1[_0x5849ee(0x1b4)],_0x117bf6=_0x47ebd1['llmAgent'];if(!_0x17f807&&!_0x117bf6)return _0x5849ee(0x1c8);return undefined;}async[a8_0x54ca86(0x1f2)](_0x19cdcd){const _0x41757f=a8_0x54ca86,{options:_0x1bd76b,tdx:_0x1f4a43}=_0x19cdcd,_0x2740e2=_0x1bd76b,_0x427cb0=_0x2740e2['agent'],_0x1e27d3=_0x2740e2[_0x41757f(0x1d8)],_0x15fb08=_0x2740e2[_0x41757f(0x1e2)];try{const _0x38c206=await resolveAgentId(_0x1f4a43,_0x427cb0,_0x1e27d3,_0x15fb08,_0x1bd76b[_0x41757f(0x1b5)]),_0x1bcb07=await _0x1f4a43[_0x41757f(0x1da)][_0x41757f(0x1e3)](_0x38c206);return saveLastChatId(_0x1bcb07['id']),console[_0x41757f(0x1d9)](JSON[_0x41757f(0x1c6)]({'chatId':_0x1bcb07['id'],'agentId':_0x38c206})),0x0;}catch(_0x23bfe2){return handleSDKError(_0x23bfe2,_0x1bd76b),0x1;}}}
|
|
1
|
+
function a8_0x484f(){const _0x50052a=['chatId','site','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','session\x20context','llmAgent','args','stdout','\x0aStack\x20trace:','8673688pRVXZN','\x20\x20Cause:\x20','Create\x20a\x20new\x20chat\x20session','event','targetWebSearchTool','Error:\x20Chat\x20session\x20\x27','resolveProjectId','\x27\x20not\x20found','functionName','stringify','2814954YzjAIN','tool_call','resolveAgentId','execute','verbose','message','Error:\x20','\x0aError:\x20','404','description','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','llm','content','getDefaultAgent','638055ILQcmr','269342IGKHYV','string','streamChat','getOrCreateDefaultAgent','chat','tool_result','tool','options','\x27...','targetFunction','targetAgent','metadata','slice','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','3831107WyFdUu','stream','6jEagsw','targetKnowledgeBase','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','projectId','join','agent','chat-create','agentId','log','streamChatJsonl','done','stack','Resolving\x20agent\x20\x27','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','new','code','Continuing\x20chat:\x20','handleChatEvent','llmProject','595512XjOsrN','error','Using\x20cached\x20default\x20agent:\x20','name','data','1357270vsFjba','claude-4.5-haiku','type','cause'];a8_0x484f=function(){return _0x50052a;};return a8_0x484f();}const a8_0x3be912=a8_0x5877;(function(_0x3876dc,_0x1dd3e5){const _0x5eb760=a8_0x5877,_0x793de4=_0x3876dc();while(!![]){try{const _0xef781f=-parseInt(_0x5eb760(0xb9))/0x1+-parseInt(_0x5eb760(0xba))/0x2+parseInt(_0x5eb760(0xf8))/0x3+parseInt(_0x5eb760(0xdd))/0x4+-parseInt(_0x5eb760(0xe2))/0x5+-parseInt(_0x5eb760(0xca))/0x6*(parseInt(_0x5eb760(0xc8))/0x7)+parseInt(_0x5eb760(0xee))/0x8;if(_0xef781f===_0x1dd3e5)break;else _0x793de4['push'](_0x793de4['shift']());}catch(_0x15e95e){_0x793de4['push'](_0x793de4['shift']());}}}(a8_0x484f,0x8d956));function a8_0x5877(_0xfd0dea,_0x45d338){_0xfd0dea=_0xfd0dea-0xaf;const _0x484fcc=a8_0x484f();let _0x58771b=_0x484fcc[_0xfd0dea];return _0x58771b;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x3c2924,_0x4ace9f){const _0x41d417=a8_0x5877;if(_0x3c2924 instanceof SDKError)console[_0x41d417(0xde)](_0x41d417(0xb1)+_0x3c2924[_0x41d417(0xb0)]),_0x4ace9f[_0x41d417(0xaf)]&&(_0x3c2924[_0x41d417(0xe5)]&&console['error'](_0x41d417(0xef)+_0x3c2924[_0x41d417(0xe5)]),_0x3c2924[_0x41d417(0xd5)]&&(console[_0x41d417(0xde)](_0x41d417(0xed)),console['error'](_0x3c2924['stack'])));else throw _0x3c2924;}async function resolveAgentId(_0x111140,_0x44658c,_0x2ee582,_0x1f626b,_0x26212b){const _0x265671=a8_0x5877,_0x2c69f4=_0x44658c||_0x2ee582;if(_0x2c69f4){const {projectName:_0x445fa2,agentName:_0x5cf99f}=parseAgentRef(_0x2c69f4),_0x2447e8=_0x5cf99f||_0x2c69f4,_0x3b122d=_0x5cf99f?_0x445fa2:_0x1f626b;if(!_0x3b122d)throw new Error(_0x265671(0xcc));if(_0x26212b){const _0x348055=_0x44658c?'--agent\x20flag':_0x265671(0xe9);console[_0x265671(0xde)]('Using\x20agent\x20from\x20'+_0x348055+':\x20'+_0x3b122d+'/'+_0x2447e8);}const _0x5087ea=await withSpinner('Resolving\x20project\x20\x27'+_0x3b122d+'\x27...',()=>_0x111140['llm'][_0x265671(0xf4)](_0x3b122d),{'verbose':_0x26212b}),_0x25f4c2=await withSpinner(_0x265671(0xd6)+_0x2447e8+_0x265671(0xc2),()=>_0x111140[_0x265671(0xb6)][_0x265671(0xfa)](_0x2447e8,_0x5087ea[_0x265671(0xe1)]),{'verbose':_0x26212b});return _0x25f4c2[_0x265671(0xe1)];}else{const _0xd81aab=_0x111140[_0x265671(0xb6)][_0x265671(0xb8)]();if(_0xd81aab)return _0x26212b&&console['error'](_0x265671(0xdf)+_0xd81aab[_0x265671(0xe0)]),_0xd81aab['id'];const _0x93d13=await withSpinner('Getting\x20default\x20agent...',()=>_0x111140[_0x265671(0xb6)][_0x265671(0xbd)](_0x265671(0xe3),0x0),{'verbose':_0x26212b});return _0x93d13['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0x3be912(0xe0)]=a8_0x3be912(0xbe);[a8_0x3be912(0xb4)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x2104f6){const _0x40475b=a8_0x3be912,_0x4ec361=_0x2104f6[_0x40475b(0xeb)][_0x40475b(0xce)]('\x20');if(!_0x4ec361)return _0x40475b(0xd7);return undefined;}async['streamChat'](_0x474362,_0x1154a7,_0x39bc66,_0x56b03c,_0x42a529){const _0x5e5f61=a8_0x3be912;for await(const _0x46f28a of _0x474362[_0x5e5f61(0xb6)][_0x5e5f61(0xbe)](_0x1154a7,{'agentId':_0x39bc66,'chatId':_0x56b03c})){if(_0x46f28a[_0x5e5f61(0xe4)]==='metadata'){const _0x7664e6=_0x46f28a['data'][_0x5e5f61(0xe6)];saveLastChatId(_0x7664e6),_0x42a529&&console[_0x5e5f61(0xde)]('Chat\x20session:\x20'+_0x7664e6);}else _0x46f28a[_0x5e5f61(0xe4)]==='event'&&this[_0x5e5f61(0xdb)](_0x46f28a['data']);}}async[a8_0x3be912(0xd3)](_0x3f4614,_0x34f290,_0x1830c7,_0x1422b3){const _0x250477=a8_0x3be912,_0x4a42ee=_0x3f4614['context'][_0x250477(0xe7)];let _0x1a123f=![];for await(const _0x37549e of _0x3f4614[_0x250477(0xb6)][_0x250477(0xbe)](_0x34f290,{'agentId':_0x1830c7,'chatId':_0x1422b3})){if(_0x37549e[_0x250477(0xe4)]==='metadata'){const _0x2a820e=_0x37549e['data'];saveLastChatId(_0x2a820e[_0x250477(0xe6)]);const _0x10b2c0=_0x2a820e[_0x250477(0xcd)]&&_0x2a820e[_0x250477(0xd1)]?getLLMConversationUrl(_0x4a42ee,_0x2a820e[_0x250477(0xcd)],_0x2a820e['agentId'],_0x2a820e[_0x250477(0xe6)]):undefined;console[_0x250477(0xd2)](JSON['stringify']({'type':_0x250477(0xc5),'data':{'chatId':_0x2a820e[_0x250477(0xe6)],'agentId':_0x2a820e[_0x250477(0xd1)],'consoleUrl':_0x10b2c0}})),_0x1a123f=!![];}else{if(_0x37549e['type']===_0x250477(0xf1)){!_0x1a123f&&_0x1422b3&&(console[_0x250477(0xd2)](JSON['stringify']({'type':_0x250477(0xc5),'data':{'chatId':_0x1422b3}})),_0x1a123f=!![]);const _0x4062c3=_0x37549e[_0x250477(0xe1)];if(_0x250477(0xb7)in _0x4062c3)console[_0x250477(0xd2)](JSON[_0x250477(0xf7)]({'type':_0x250477(0xb7),'data':{'content':_0x4062c3[_0x250477(0xb7)]}}));else{if(_0x250477(0xf9)in _0x4062c3){const _0x4e6c4b=_0x4062c3['tool_call'];console[_0x250477(0xd2)](JSON[_0x250477(0xf7)]({'type':'tool_call','data':{'id':_0x4e6c4b['id'],'name':_0x4e6c4b['functionName'],'target':_0x4e6c4b[_0x250477(0xcb)]?.[_0x250477(0xe0)]||_0x4e6c4b[_0x250477(0xc4)]?.[_0x250477(0xe0)]||_0x4e6c4b[_0x250477(0xf2)]?.[_0x250477(0xe0)]||_0x4e6c4b[_0x250477(0xc3)]}}));}else{if('tool'in _0x4062c3)console[_0x250477(0xd2)](JSON[_0x250477(0xf7)]({'type':_0x250477(0xbf),'data':{'id':_0x4062c3['tool']['id'],'name':_0x4062c3[_0x250477(0xc0)][_0x250477(0xf6)],'result':typeof _0x4062c3['tool'][_0x250477(0xb7)]===_0x250477(0xbb)?_0x4062c3[_0x250477(0xc0)][_0x250477(0xb7)][_0x250477(0xc6)](0x0,0x1f4):''}}));else _0x250477(0xde)in _0x4062c3&&console[_0x250477(0xd2)](JSON[_0x250477(0xf7)]({'type':_0x250477(0xde),'data':{'error':_0x4062c3[_0x250477(0xde)]}}));}}}}}console[_0x250477(0xd2)](JSON[_0x250477(0xf7)]({'type':_0x250477(0xd4)}));}async[a8_0x3be912(0xfb)](_0x22678b){const _0x26ea99=a8_0x3be912,{options:_0x31f815,args:_0x3776a4,tdx:_0x14b1ed}=_0x22678b,_0x1fccdc=_0x3776a4[_0x26ea99(0xce)]('\x20'),_0x1b259c=_0x31f815,_0xd8d4a3=_0x1b259c[_0x26ea99(0xcf)],_0x2bd740=_0x1b259c['llmAgent'],_0x43fe5f=_0x1b259c['llmProject'],_0x40f02a=_0x1b259c[_0x26ea99(0xd8)],_0x511e5a=_0x1b259c[_0x26ea99(0xe6)],_0x16e2d9=_0x1b259c[_0x26ea99(0xc9)];if(_0x40f02a&&_0x511e5a)return console[_0x26ea99(0xde)](_0x26ea99(0xc7)),0x1;try{let _0x5ae60f,_0xbffec8;if(_0x511e5a)_0xbffec8=_0x511e5a;else!_0x40f02a&&(_0xbffec8=loadLastChatId(),_0xbffec8&&_0x31f815[_0x26ea99(0xaf)]&&console[_0x26ea99(0xde)](_0x26ea99(0xda)+_0xbffec8));!_0x511e5a&&(_0x40f02a||!_0xbffec8)&&(_0x5ae60f=await resolveAgentId(_0x14b1ed,_0xd8d4a3,_0x2bd740,_0x43fe5f,_0x31f815[_0x26ea99(0xaf)]));const _0x252eda=_0x16e2d9?(_0x790cbc,_0x3f7771,_0x3cb0ca)=>this[_0x26ea99(0xd3)](_0x14b1ed,_0x790cbc,_0x3f7771,_0x3cb0ca):(_0x5994ea,_0x393e41,_0x38b57a)=>this[_0x26ea99(0xbc)](_0x14b1ed,_0x5994ea,_0x393e41,_0x38b57a,_0x31f815[_0x26ea99(0xaf)]);try{await _0x252eda(_0x1fccdc,_0x5ae60f,_0xbffec8);}catch(_0x2fadf8){const _0x313214=_0x2fadf8 instanceof SDKError&&_0x2fadf8[_0x26ea99(0xd9)]===ErrorCode['CHAT_NOT_FOUND']||_0x2fadf8 instanceof Error&&_0x2fadf8['message']['includes'](_0x26ea99(0xb3));if(_0x313214&&_0x511e5a)return console['error'](_0x26ea99(0xf3)+_0x511e5a+_0x26ea99(0xf5)),0x1;if(_0x313214)_0x31f815[_0x26ea99(0xaf)]&&console[_0x26ea99(0xde)](_0x26ea99(0xb5)),!_0x5ae60f&&(_0x5ae60f=await resolveAgentId(_0x14b1ed,_0xd8d4a3,_0x2bd740,_0x43fe5f,_0x31f815[_0x26ea99(0xaf)])),await _0x252eda(_0x1fccdc,_0x5ae60f,undefined);else throw _0x2fadf8;}return!_0x16e2d9&&console['log'](),0x0;}catch(_0x32a415){return console[_0x26ea99(0xde)](),handleSDKError(_0x32a415,_0x31f815),0x1;}}[a8_0x3be912(0xdb)](_0x180fd0){const _0x349907=a8_0x3be912;if(_0x349907(0xb7)in _0x180fd0)process[_0x349907(0xec)]['write'](_0x180fd0[_0x349907(0xb7)]);else'error'in _0x180fd0&&console[_0x349907(0xde)](_0x349907(0xb2)+_0x180fd0['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x3be912(0xe0)]=a8_0x3be912(0xd0);[a8_0x3be912(0xb4)]=a8_0x3be912(0xf0);['validate'](_0x33f98f){const _0x3d5541=a8_0x3be912,_0x45ea20=_0x33f98f[_0x3d5541(0xc1)],_0x244be1=_0x45ea20['agent'],_0x448c4b=_0x45ea20[_0x3d5541(0xea)];if(!_0x244be1&&!_0x448c4b)return _0x3d5541(0xe8);return undefined;}async[a8_0x3be912(0xfb)](_0x4f0381){const _0x1c82a7=a8_0x3be912,{options:_0x476066,tdx:_0x27e748}=_0x4f0381,_0x3dbd98=_0x476066,_0x31f350=_0x3dbd98[_0x1c82a7(0xcf)],_0x2ce9ea=_0x3dbd98[_0x1c82a7(0xea)],_0x58642b=_0x3dbd98[_0x1c82a7(0xdc)];try{const _0x47ebe8=await resolveAgentId(_0x27e748,_0x31f350,_0x2ce9ea,_0x58642b,_0x476066['verbose']),_0x2f067c=await _0x27e748[_0x1c82a7(0xb6)]['startChat'](_0x47ebe8);return saveLastChatId(_0x2f067c['id']),console[_0x1c82a7(0xd2)](JSON['stringify']({'chatId':_0x2f067c['id'],'agentId':_0x47ebe8})),0x0;}catch(_0x42aeaf){return handleSDKError(_0x42aeaf,_0x476066),0x1;}}}
|