@treasuredata/tdx 0.26.2 → 0.26.3
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/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.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-validator.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-recovery.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
|
-
const
|
|
1
|
+
const a3_0x632e87=a3_0x5bb4;function a3_0x3b65(){const _0x210d62=['1236863eQUbLo','listActivations','Resolving\x20child\x20segment\x20\x27','16oZCklC','error','1119117fJLNYx','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolving\x20parent\x20segment\x20\x27','data','segment','2481245sDCszr','length','\x27...','3063767txncey','\x20activation','9GVCpXp','✔\x20Found\x20','site','8778780QVRjfK','Listing\x20activations\x20for\x20segment\x20\x27','cause','activations','191880UDakpL','Site:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','resolveParentId','14070170prubTv','\x20\x20Cause:\x20','description','Child\x20name:\x20','Parent\x20name:\x20','8kGsBOQ','Error:\x20','verbose'];a3_0x3b65=function(){return _0x210d62;};return a3_0x3b65();}(function(_0x2afcf4,_0x44a500){const _0xa7a963=a3_0x5bb4,_0x3dab1f=_0x2afcf4();while(!![]){try{const _0x501726=-parseInt(_0xa7a963(0x15f))/0x1+-parseInt(_0xa7a963(0x153))/0x2+-parseInt(_0xa7a963(0x164))/0x3*(-parseInt(_0xa7a963(0x15c))/0x4)+parseInt(_0xa7a963(0x169))/0x5+parseInt(_0xa7a963(0x171))/0x6+parseInt(_0xa7a963(0x16c))/0x7*(parseInt(_0xa7a963(0x162))/0x8)+-parseInt(_0xa7a963(0x16e))/0x9*(parseInt(_0xa7a963(0x157))/0xa);if(_0x501726===_0x44a500)break;else _0x3dab1f['push'](_0x3dab1f['shift']());}catch(_0xb8a60c){_0x3dab1f['push'](_0x3dab1f['shift']());}}}(a3_0x3b65,0xcd527));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x5bb4(_0x458695,_0x36d531){_0x458695=_0x458695-0x152;const _0x3b6523=a3_0x3b65();let _0x5bb41c=_0x3b6523[_0x458695];return _0x5bb41c;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x632e87(0x152);[a3_0x632e87(0x159)]='List\x20activations\x20for\x20a\x20segment';async['execute'](_0x42aece){const _0x430c19=a3_0x632e87,{options:_0x4e931b,args:_0x1031c9,tdx:_0x3e31cf}=_0x42aece;if(_0x1031c9[_0x430c19(0x16a)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console['error'](_0x430c19(0x165)),0x1;try{const {parentId:_0x4c2418,childId:_0x46223f}=parseSegmentRef(_0x1031c9[0x0]);if(!_0x46223f)return console[_0x430c19(0x163)](_0x430c19(0x155)),console[_0x430c19(0x163)](_0x430c19(0x165)),0x1;_0x4e931b[_0x430c19(0x15e)]&&(console[_0x430c19(0x163)](_0x430c19(0x154)+_0x4e931b[_0x430c19(0x170)]),console[_0x430c19(0x163)](_0x430c19(0x15b)+_0x4c2418),console[_0x430c19(0x163)](_0x430c19(0x15a)+_0x46223f));const _0xc6cfbc=await withSpinner(_0x430c19(0x166)+_0x4c2418+_0x430c19(0x16b),()=>_0x3e31cf[_0x430c19(0x168)][_0x430c19(0x156)](_0x4c2418),{'verbose':_0x4e931b[_0x430c19(0x15e)]}),_0x31434f=_0xc6cfbc[_0x430c19(0x167)];_0x4e931b[_0x430c19(0x15e)]&&console[_0x430c19(0x163)]('Resolved\x20parent\x20ID:\x20'+_0x31434f);const _0x2760cd=await withSpinner(_0x430c19(0x161)+_0x46223f+_0x430c19(0x16b),()=>_0x3e31cf[_0x430c19(0x168)]['resolveSegmentId'](_0x31434f,_0x46223f),{'verbose':_0x4e931b[_0x430c19(0x15e)]}),_0x2df0c6=_0x2760cd[_0x430c19(0x167)];_0x4e931b[_0x430c19(0x15e)]&&console[_0x430c19(0x163)]('Resolved\x20child\x20ID:\x20'+_0x2df0c6);const _0x31b1b5=await withSpinner(_0x430c19(0x172)+_0x46223f+'\x27...',()=>_0x3e31cf[_0x430c19(0x168)][_0x430c19(0x160)](_0x31434f,_0x2df0c6),{'verbose':_0x4e931b[_0x430c19(0x15e)]}),_0x3d8721=_0x31b1b5['data'];return console[_0x430c19(0x163)](_0x430c19(0x16f)+_0x3d8721[_0x430c19(0x16a)]+_0x430c19(0x16d)+(_0x3d8721[_0x430c19(0x16a)]!==0x1?'s':'')),await handleSDKOutput(_0x3d8721,_0x4e931b),0x0;}catch(_0x57fd6c){if(_0x57fd6c instanceof SDKError)return console['error'](_0x430c19(0x15d)+_0x57fd6c['message']),_0x57fd6c['cause']&&console[_0x430c19(0x163)](_0x430c19(0x158)+_0x57fd6c[_0x430c19(0x173)]),0x1;throw _0x57fd6c;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x266ed6=a4_0x173b;(function(_0x4cb0ca,_0x47065d){const _0x180463=a4_0x173b,_0x1a49e9=_0x4cb0ca();while(!![]){try{const _0x26be3c=-parseInt(_0x180463(0xbb))/0x1*(-parseInt(_0x180463(0xd5))/0x2)+-parseInt(_0x180463(0x103))/0x3+-parseInt(_0x180463(0xdf))/0x4+-parseInt(_0x180463(0xed))/0x5*(parseInt(_0x180463(0x10b))/0x6)+-parseInt(_0x180463(0xc4))/0x7*(parseInt(_0x180463(0xe0))/0x8)+-parseInt(_0x180463(0xaf))/0x9*(-parseInt(_0x180463(0xe7))/0xa)+parseInt(_0x180463(0xdb))/0xb;if(_0x26be3c===_0x47065d)break;else _0x1a49e9['push'](_0x1a49e9['shift']());}catch(_0x163ed8){_0x1a49e9['push'](_0x1a49e9['shift']());}}}(a4_0xb399,0xf381c));import a4_0x51ad2e from'chalk';import a4_0x53d24e 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_0xb399(){const _0x1b033d=['Status:\x20','Cloning\x20\x22','experimentalArtifacts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent:push','join','execute','\x20\x20Agent\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','parse','\x20files?','\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)','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Failed\x20to\x20push\x20agent:\x20','projectName','agent:pull','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aError:','pushProject','23058rjtdbj','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','push','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','outputPath','Would\x20push\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','llm','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','Agent\x20pulled\x20successfully','Project\x20cloned\x20successfully','241027REQhaY','Cancelled','\x0a✔\x20Pulled\x20','knowledgeBases','yes','Using\x20context\x20project:\x20','\x20unchanged','\x20\x20Target:\x20','new','124145ovUqUc','\x20updated','site','cloneProject','\x20\x20Integration\x20\x22','prompts','yellow','\x20new','\x20successfully','dim','dryRun','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','total','found','\x20errors','diff','description','16JijLPi','agent.yml','agentName','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Agents:\x20','MISSING_ARGUMENT','23485286ZTiFTo','Analyzing\x20changes\x20to\x20push...','Analyzing\x20project\x20\x22','Pushing\x20to\x20project...','927384nNtcGQ','272xiDgtZ','✔\x20Context\x20set:\x20','pullAgent','Pushing\x20agent\x20from\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Errors:','\x0aErrors\x20found:','170yNgEdk','Source:\x20','hasChanges','Output\x20path:\x20','\x20\x20Experimental\x20Artifacts:\x20','tdx.json','46245qNONPR','\x22\x20to\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Writing\x20files...','Chat:\x20','no_local_folder','cwd','Would\x20clone:','Would\x20pull\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','-\x20no\x20files\x20written','\x20--name\x20','agentId','sourceProjectName','Project:\x20','force','unchanged','no_context','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','textKnowledgeBases','\x20\x20tdx\x20agent\x20clone\x20agents/','4132209hufUPb','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20integration\x20\x27','newProjectName','\x20|\x20','Using\x20local\x20project:\x20','action','\x0a✔\x20Pushed\x20','582bVYVSE','New\x20project\x20ID:\x20','\x20created','llmProject','Summary:','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','log','reason','projectId','cyan','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updated','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','outputDir','pullProject','green','integrations','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20changed','error','\x20--profile\x20','\x20=\x20','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20agent\x20\x27','\x22...','\x20\x20Source:\x20','\x20\x20Knowledge\x20Bases:\x20','newProjectId','Agent\x20','message','Pulling\x20agent\x20\x22','agents','gray','errors','source','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Prompts:\x20','\x0aPush\x20','session','repeat','red','New\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','counts','New\x20project\x20name\x20is\x20required','\x0aPush\x20summary\x20for\x20\x27','experimentalKnowledgeBases','name','\x20\x20Integrations:\x20','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Artifact\x20\x22','llm_project','\x22\x20to\x20new\x20project\x20\x22','created','\x0aPull\x20summary\x20for\x20\x27','\x22:\x20','dirname','utf-8','Using\x20current\x20project:\x20','Using\x20project\x20from\x20','context','Using\x20project:\x20','pushAgent','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Prompt\x20\x22','\x0aWrite\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20'];a4_0xb399=function(){return _0x1b033d;};return a4_0xb399();}function a4_0x173b(_0x5ecf81,_0x2c8e95){_0x5ecf81=_0x5ecf81-0x8c;const _0xb399d0=a4_0xb399();let _0x173ba1=_0xb399d0[_0x5ecf81];return _0x173ba1;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4f536b){const _0xc3672e=a4_0x173b,_0x4abf57=[];if(_0x4f536b[_0xc3672e(0xd0)]!==undefined)_0x4abf57['push'](_0x4f536b[_0xc3672e(0xd0)]+'\x20total');if(_0x4f536b[_0xc3672e(0xc3)]!==undefined&&_0x4f536b['new']>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x11b)](_0x4f536b[_0xc3672e(0xc3)]+'\x20new'));if(_0x4f536b[_0xc3672e(0x8d)]!==undefined&&_0x4f536b[_0xc3672e(0x8d)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x11b)](_0x4f536b['created']+_0xc3672e(0x10d)));if(_0x4f536b['updated']!==undefined&&_0x4f536b[_0xc3672e(0x116)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0xca)](_0x4f536b[_0xc3672e(0x116)]+_0xc3672e(0xc5)));if(_0x4f536b['unchanged']!==undefined&&_0x4f536b[_0xc3672e(0xfe)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e['gray'](_0x4f536b[_0xc3672e(0xfe)]+_0xc3672e(0xc1)));if(_0x4f536b[_0xc3672e(0x12d)]!==undefined&&_0x4f536b[_0xc3672e(0x12d)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x134)](_0x4f536b[_0xc3672e(0x12d)]+_0xc3672e(0xd2)));return _0x4abf57[_0xc3672e(0xa0)](',\x20');}function displayDiffs(_0x1ded88,_0x3bab3a,_0x2be646,_0x141ee1,_0xa2fcf9,_0x2356c6,_0xbe6080){const _0x25121f=a4_0x173b;for(const _0x2ae0cb of _0x1ded88){if(_0x2ae0cb[_0x25121f(0xd3)]){const _0x4d1048=_0x2ae0cb[_0x25121f(0xd7)]||_0x2ae0cb[_0x25121f(0x13b)];console[_0x25121f(0x111)](_0x25121f(0x123)+_0x4d1048+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console['log'](_0x2ae0cb[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'['repeat'](0x3c));}}for(const _0x27702c of _0x3bab3a){_0x27702c[_0x25121f(0xd3)]&&(console[_0x25121f(0x111)](_0x25121f(0x104)+_0x27702c[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x27702c[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0xf8abd of _0x2be646){_0xf8abd[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0xb0)+_0xf8abd['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x25121f(0x111)](_0xf8abd['diff']),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0x5222a0 of _0x141ee1){_0x5222a0[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0x97)+_0x5222a0[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x5222a0['diff']),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0xbf7362 of _0xa2fcf9){_0xbf7362[_0x25121f(0xd3)]&&(console[_0x25121f(0x111)](_0x25121f(0x105)+_0xbf7362[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console['log'](_0xbf7362[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0x5a553e of _0x2356c6){_0x5a553e[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0xef)+_0x5a553e[_0x25121f(0x13b)]+'\x27:'),console['log']('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x5a553e[_0x25121f(0xd3)]),console['log']('─'[_0x25121f(0x133)](0x3c)));}for(const _0xbd6801 of _0xbe6080){_0xbd6801[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0x11d)+_0xbd6801['name']+'\x27:'),console['log']('─'[_0x25121f(0x133)](0x3c)),console['log'](_0xbd6801['diff']),console[_0x25121f(0x111)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x266ed6(0x13b)]=a4_0x266ed6(0xab);[a4_0x266ed6(0xd4)]=a4_0x266ed6(0xb5);async[a4_0x266ed6(0xa1)](_0x3e17c9){const _0x3320d7=a4_0x266ed6,{options:_0x567d27,args:_0x5eefe6,tdx:_0x1a0f2d}=_0x3e17c9,_0x160ea1=_0x5eefe6[0x0],_0x1bcf69=_0x5eefe6[0x1],_0xfc93ce=_0x567d27['output'],_0x22688b=_0x567d27[_0x3320d7(0xce)],_0x4506b4=_0x567d27[_0x3320d7(0xfd)],_0x2c8d14=_0x567d27['yes'],_0x2a8633=_0x567d27[_0x3320d7(0x10e)];let _0x1012e2,_0x22696e;const _0x373cbc=findAgentConfigPath(process[_0x3320d7(0xf3)]());if(_0x160ea1){const _0x533c69=a4_0x53d24e[_0x3320d7(0xa0)](_0x160ea1,'tdx.json');if(existsSync(_0x533c69))try{const _0x20bc70=JSON['parse'](readFileSync(_0x533c69,'utf-8'));_0x1012e2=_0x20bc70[_0x3320d7(0x13f)],_0x22696e=_0x160ea1,console['log'](a4_0x51ad2e['dim'](_0x3320d7(0x93)+_0x533c69+':\x20'+_0x1012e2));}catch{_0x1012e2=_0x160ea1;}else _0x1012e2=_0x160ea1;}else{if(_0x373cbc)try{const _0x26209b=JSON[_0x3320d7(0xa4)](readFileSync(_0x373cbc,_0x3320d7(0x91)));_0x1012e2=_0x26209b['llm_project'],_0x22696e=a4_0x53d24e[_0x3320d7(0x90)](_0x373cbc),console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x95)+_0x1012e2));}catch{_0x1012e2=_0x2a8633;}else _0x1012e2=_0x2a8633;}if(!_0x1012e2)return console['log'](a4_0x51ad2e[_0x3320d7(0xca)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3320d7(0x111)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x1bcf69){const {data:_0x163548}=await withSpinner(_0x3320d7(0x12a)+_0x1bcf69+'\x22\x20from\x20project\x20\x22'+_0x1012e2+_0x3320d7(0x124),()=>_0x1a0f2d[_0x3320d7(0xb6)][_0x3320d7(0xe2)](_0x1012e2,_0x1bcf69,_0xfc93ce,{'dryRun':_0x22688b,'force':_0x4506b4}));if(_0x22688b)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xb8))),console[_0x3320d7(0x111)](_0x3320d7(0xf5)+_0x163548[_0x3320d7(0xd7)]),console[_0x3320d7(0x111)](_0x3320d7(0xea)+_0x163548[_0x3320d7(0xb3)]),_0x163548['diff']&&(console[_0x3320d7(0x111)]('\x0aChanges:'),console[_0x3320d7(0x111)]('─'[_0x3320d7(0x133)](0x3c)),console[_0x3320d7(0x111)](_0x163548[_0x3320d7(0xd3)]),console['log']('─'[_0x3320d7(0x133)](0x3c))),0x0;return console[_0x3320d7(0x111)](a4_0x51ad2e['green'](_0x3320d7(0xb9))),console['log']('Agent:\x20'+_0x163548[_0x3320d7(0xd7)]),console[_0x3320d7(0x111)]('Output:\x20'+_0x163548[_0x3320d7(0xb3)]),console[_0x3320d7(0x111)](_0x3320d7(0x9b)+(_0x163548['isNew']?a4_0x51ad2e[_0x3320d7(0x11b)]('new'):_0x163548[_0x3320d7(0xe9)]?a4_0x51ad2e[_0x3320d7(0xca)]('updated'):a4_0x51ad2e[_0x3320d7(0x12c)](_0x3320d7(0xfe)))),0x0;}const _0x1102d2=_0x22696e||_0xfc93ce,{data:_0x2d9792}=await withSpinner(_0x3320d7(0xdd)+_0x1012e2+_0x3320d7(0x124),()=>_0x1a0f2d[_0x3320d7(0xb6)][_0x3320d7(0x11a)](_0x1012e2,_0x1102d2,{'dryRun':!![]})),_0x500f85=_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)]['knowledgeBases'][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x101)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)]['new']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)][_0x3320d7(0xc3)],_0x37e9ff=_0x2d9792['counts'][_0x3320d7(0x12b)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xbe)][_0x3320d7(0x116)]+_0x2d9792['counts'][_0x3320d7(0x101)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)]['updated'],_0x420409=_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)]['unchanged']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xbe)]['unchanged']+_0x2d9792[_0x3320d7(0x137)]['textKnowledgeBases'][_0x3320d7(0xfe)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0xfe)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)][_0x3320d7(0xfe)]+_0x2d9792['counts']['experimentalKnowledgeBases']['unchanged']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)][_0x3320d7(0xfe)];console[_0x3320d7(0x111)](_0x3320d7(0x8e)+_0x2d9792[_0x3320d7(0xaa)]+'\x27:'),console[_0x3320d7(0x111)]('\x20\x20'+a4_0x51ad2e[_0x3320d7(0x11b)]('+\x20'+_0x500f85+_0x3320d7(0xcb))+_0x3320d7(0x107)+a4_0x51ad2e[_0x3320d7(0xca)]('~\x20'+_0x37e9ff+_0x3320d7(0x11e))+_0x3320d7(0x107)+a4_0x51ad2e['dim']('=\x20'+_0x420409+'\x20unchanged')),console['log'](_0x3320d7(0xd9)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)])),console[_0x3320d7(0x111)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d9792[_0x3320d7(0x137)]['knowledgeBases'])),console[_0x3320d7(0x111)](_0x3320d7(0xd8)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x101)])),console[_0x3320d7(0x111)](_0x3320d7(0x130)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)])),console[_0x3320d7(0x111)](_0x3320d7(0x13c)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)]));const _0x5e260a=_0x2d9792[_0x3320d7(0x137)]['experimentalKnowledgeBases'][_0x3320d7(0xd0)]>0x0||_0x2d9792['counts'][_0x3320d7(0x9d)][_0x3320d7(0xd0)]>0x0;_0x5e260a&&(console[_0x3320d7(0x111)](_0x3320d7(0x9a)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)])),console['log'](_0x3320d7(0xeb)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)])));console['log'](_0x3320d7(0xc2)+a4_0x51ad2e[_0x3320d7(0x114)](_0x2d9792['outputDir'])),displayDiffs(_0x2d9792[_0x3320d7(0x12b)],_0x2d9792[_0x3320d7(0xbe)],_0x2d9792['textKnowledgeBases'],_0x2d9792[_0x3320d7(0xc9)],_0x2d9792['integrations'],_0x2d9792['experimentalKnowledgeBases'],_0x2d9792['experimentalArtifacts']);if(_0x22688b)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xa7))),0x0;if(_0x500f85===0x0&&_0x37e9ff===0x0)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0x11b)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x2d9792[_0x3320d7(0xaa)]},_0x567d27[_0x3320d7(0x132)]),console['log'](a4_0x51ad2e[_0x3320d7(0x11b)](_0x3320d7(0xe1)+a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x13f))+_0x3320d7(0x121)+a4_0x51ad2e[_0x3320d7(0x114)](_0x2d9792[_0x3320d7(0xaa)]))),0x0;if(!_0x2c8d14&&!_0x4506b4){if(!isInteractive())return console[_0x3320d7(0x11f)](a4_0x51ad2e[_0x3320d7(0x134)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3320d7(0x11f)](a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x115))),0x1;const _0x574d92=await confirmKey(_0x3320d7(0x99)+(_0x500f85+_0x37e9ff)+_0x3320d7(0xa5));if(!_0x574d92)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xbc)),_0x3320d7(0xf8)),0x1;}const {data:_0x28f4f5}=await withSpinner(_0x3320d7(0xf0),()=>_0x1a0f2d[_0x3320d7(0xb6)]['pullProject'](_0x1012e2,_0x1102d2,{'force':_0x4506b4}));return console['log'](a4_0x51ad2e[_0x3320d7(0x11b)](_0x3320d7(0xbd)+(_0x500f85+_0x37e9ff)+'\x20files\x20to\x20'+_0x28f4f5[_0x3320d7(0x119)])),saveSessionContext({'llm_project':_0x28f4f5[_0x3320d7(0xaa)]},_0x567d27['session']),console[_0x3320d7(0x111)](a4_0x51ad2e['green'](_0x3320d7(0xe1)+a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x13f))+_0x3320d7(0x121)+a4_0x51ad2e[_0x3320d7(0x114)](_0x28f4f5[_0x3320d7(0xaa)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x266ed6(0x13b)]='agent:clone';['description']=a4_0x266ed6(0xcf);async[a4_0x266ed6(0xa1)](_0x32325e){const _0x167934=a4_0x266ed6,{options:_0xab88fb,args:_0x1405a6,tdx:_0x49bc1b}=_0x32325e,_0x15fadb=_0x1405a6[0x0],_0x43317f=_0xab88fb['name'],_0x106324=_0xab88fb[_0x167934(0xce)],_0x2fd414=_0xab88fb[_0x167934(0xbf)],_0x52d5fc=_0xab88fb[_0x167934(0xc6)],_0x47aa0b=_0xab88fb[_0x167934(0x10e)];let _0x99ff21;const _0x432863=findAgentConfigPath(process[_0x167934(0xf3)]());if(_0x15fadb){const _0x2be10d=a4_0x53d24e[_0x167934(0xa0)](_0x15fadb,_0x167934(0xec));existsSync(_0x2be10d)?(_0x99ff21=_0x15fadb,console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xcd)](_0x167934(0x108)+_0x15fadb))):_0x99ff21=_0x15fadb;}else{if(_0x432863)_0x99ff21=a4_0x53d24e[_0x167934(0x90)](_0x432863),console[_0x167934(0x111)](a4_0x51ad2e['dim'](_0x167934(0x92)+_0x99ff21));else{if(_0x47aa0b){const _0x56a3db=sanitizeForFilesystem(_0x47aa0b);let _0x22021a=_0x56a3db,_0x13e4e8=a4_0x53d24e[_0x167934(0xa0)](process['cwd'](),_0x167934(0x12b),_0x56a3db,'tdx.json');if(!existsSync(_0x13e4e8)){const _0x148aa6=normalizeName(_0x47aa0b),_0x26a5b9=a4_0x53d24e[_0x167934(0xa0)](process[_0x167934(0xf3)](),_0x167934(0x12b),_0x148aa6,_0x167934(0xec));existsSync(_0x26a5b9)&&(_0x22021a=_0x148aa6,_0x13e4e8=_0x26a5b9);}if(existsSync(_0x13e4e8))_0x99ff21=a4_0x53d24e['dirname'](_0x13e4e8),console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xcd)]('Using\x20local\x20project:\x20'+_0x99ff21));else{const _0x45a7a7=_0xab88fb['profile'];if(_0x45a7a7)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x167934(0x12f)+_0x47aa0b+_0x167934(0x13d),undefined,{'helpText':_0x167934(0x117)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x167934(0xa3)+_0x47aa0b+'\x0a')+(_0x167934(0x102)+_0x22021a+_0x167934(0xf9)+(_0x43317f||'<new-name>')+_0x167934(0x120)+_0x45a7a7)});_0x99ff21=_0x47aa0b,console[_0x167934(0x111)](a4_0x51ad2e['dim'](_0x167934(0xc0)+_0x47aa0b));}}}}if(!_0x99ff21)return console['log'](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0xb2))),console[_0x167934(0x111)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x167934(0x111)](_0x167934(0xe4)),console['log'](_0x167934(0xa6)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x43317f)throw new SDKError(ErrorCode[_0x167934(0xda)],_0x167934(0x138),undefined,{'helpText':_0x167934(0xa8)});if(!_0x2fd414&&!_0x106324){if(!isInteractive())return console[_0x167934(0x11f)](a4_0x51ad2e[_0x167934(0x134)]('\x0aError:'),_0x167934(0x9e)),console[_0x167934(0x11f)](a4_0x51ad2e['dim'](_0x167934(0x115))),0x1;const _0x38144e=await confirmKey('Clone\x20\x22'+_0x99ff21+_0x167934(0x8c)+_0x43317f+'\x22?');if(!_0x38144e)return console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0xbc))),0x1;}const {data:_0x2c3d17}=await withSpinner(_0x167934(0x9c)+_0x99ff21+_0x167934(0xee)+_0x43317f+_0x167934(0x124),()=>_0x49bc1b[_0x167934(0xb6)][_0x167934(0xc7)](_0x99ff21,_0x43317f,{'dryRun':_0x106324}));if(_0x106324){console[_0x167934(0x111)](a4_0x51ad2e['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x167934(0x111)](_0x167934(0xe8)+_0x2c3d17[_0x167934(0xfb)]),console[_0x167934(0x111)](_0x167934(0x135)+_0x43317f),console['log'](_0x167934(0xf4)),console['log'](_0x167934(0xd9)+_0x2c3d17[_0x167934(0x137)][_0x167934(0x12b)][_0x167934(0x8d)]),console[_0x167934(0x111)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)]['created']),console[_0x167934(0x111)](_0x167934(0x130)+_0x2c3d17[_0x167934(0x137)][_0x167934(0xc9)]['created']);const _0x42376b=_0x2c3d17[_0x167934(0x137)]['experimentalKnowledgeBases'][_0x167934(0x8d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x9d)][_0x167934(0x8d)]>0x0;return _0x42376b&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)]['created']),console['log'](_0x167934(0xeb)+_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts']['created'])),0x0;}const _0x58aff6=_0x2c3d17[_0x167934(0x137)]['agents'][_0x167934(0x12d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)][_0x167934(0x12d)]>0x0||_0x2c3d17['counts']['prompts'][_0x167934(0x12d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)][_0x167934(0x12d)]>0x0||_0x2c3d17['counts'][_0x167934(0x9d)][_0x167934(0x12d)]>0x0;_0x58aff6?console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0x122))):console['log'](a4_0x51ad2e[_0x167934(0x11b)](_0x167934(0xba)));console[_0x167934(0x111)](_0x167934(0xe8)+_0x2c3d17[_0x167934(0xfb)]),console[_0x167934(0x111)]('New\x20project:\x20'+_0x2c3d17[_0x167934(0x106)]),console['log'](_0x167934(0x10c)+_0x2c3d17[_0x167934(0x127)]),console[_0x167934(0x111)](),console[_0x167934(0x111)](_0x167934(0x10f)),console[_0x167934(0x111)](_0x167934(0xd9)+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0x12b)])),console[_0x167934(0x111)](_0x167934(0x126)+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0xc9)])),console[_0x167934(0x111)](_0x167934(0x13c)+formatCountSummary(_0x2c3d17['counts'][_0x167934(0x11c)]));const _0x35b633=_0x2c3d17['counts'][_0x167934(0x13a)]['created']>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalKnowledgeBases'][_0x167934(0x116)]>0x0||_0x2c3d17['counts']['experimentalKnowledgeBases'][_0x167934(0xfe)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x9d)][_0x167934(0x8d)]>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts'][_0x167934(0x116)]>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts'][_0x167934(0xfe)]>0x0;_0x35b633&&(console[_0x167934(0x111)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)])),console['log'](_0x167934(0xeb)+formatCountSummary(_0x2c3d17['counts']['experimentalArtifacts'])));if(_0x58aff6){console[_0x167934(0x111)](),console[_0x167934(0x111)](a4_0x51ad2e['red'](_0x167934(0xe5)));for(const _0x51a3f6 of _0x2c3d17['agents']){_0x51a3f6[_0x167934(0x109)]===_0x167934(0x11f)&&console['log'](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0xa2)+_0x51a3f6[_0x167934(0xd7)]+_0x167934(0x8f)+_0x51a3f6[_0x167934(0x11f)]));}for(const _0x150cd5 of _0x2c3d17[_0x167934(0xbe)]){_0x150cd5['action']==='error'&&console[_0x167934(0x111)](a4_0x51ad2e['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x150cd5['name']+_0x167934(0x8f)+_0x150cd5['error']));}for(const _0x54bc6f of _0x2c3d17[_0x167934(0xc9)]){_0x54bc6f['action']===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0x98)+_0x54bc6f[_0x167934(0x13b)]+_0x167934(0x8f)+_0x54bc6f[_0x167934(0x11f)]));}for(const _0x422f62 of _0x2c3d17[_0x167934(0x11c)]){_0x422f62['action']===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e['red'](_0x167934(0xc8)+_0x422f62[_0x167934(0x13b)]+'\x22:\x20'+_0x422f62[_0x167934(0x11f)]));}for(const _0xf35ff4 of _0x2c3d17[_0x167934(0x13a)]){_0xf35ff4[_0x167934(0x109)]===_0x167934(0x11f)&&console['log'](a4_0x51ad2e['red'](_0x167934(0xb7)+_0xf35ff4['name']+_0x167934(0x8f)+_0xf35ff4['error']));}for(const _0x2ebca6 of _0x2c3d17[_0x167934(0x9d)]){_0x2ebca6[_0x167934(0x109)]===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0x13e)+_0x2ebca6[_0x167934(0x13b)]+_0x167934(0x8f)+_0x2ebca6[_0x167934(0x11f)]));}return 0x1;}console[_0x167934(0x111)]();const _0x264671=getLLMProjectUrl(_0x52d5fc,_0x2c3d17['newProjectId']);return console[_0x167934(0x111)](_0x167934(0xfc)+a4_0x51ad2e[_0x167934(0x114)](_0x264671)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x266ed6(0x13b)]=a4_0x266ed6(0x9f);[a4_0x266ed6(0xd4)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x266ed6(0xa1)](_0x21ee5b){const _0x45d6f6=a4_0x266ed6,{options:_0x374b5a,args:_0x113ebc,tdx:_0x330062}=_0x21ee5b;let _0x47a256=_0x113ebc[0x0]||process['cwd']();const _0x5e24e0=_0x374b5a['dryRun'],_0x6c3886=_0x374b5a[_0x45d6f6(0xfd)],_0x569e1f=_0x374b5a[_0x45d6f6(0xbf)],_0x11815a=_0x374b5a[_0x45d6f6(0xc6)],_0x52db83=a4_0x53d24e[_0x45d6f6(0xa0)](_0x47a256,_0x45d6f6(0xd6)),_0x209cd4=existsSync(_0x52db83);if(_0x209cd4){const {data:_0x3a6bcc}=await withSpinner(_0x45d6f6(0xe3)+_0x47a256+_0x45d6f6(0x124),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0x96)](_0x47a256,{'dryRun':_0x5e24e0,'force':_0x6c3886}));if(_0x5e24e0)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x45d6f6(0x111)](_0x45d6f6(0xb4)+_0x3a6bcc[_0x45d6f6(0xd7)]),0x0;if(_0x3a6bcc[_0x45d6f6(0x109)]==='error')return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0xa9)+_0x3a6bcc[_0x45d6f6(0x11f)])),0x1;console['log'](a4_0x51ad2e[_0x45d6f6(0x11b)](_0x45d6f6(0x128)+_0x3a6bcc[_0x45d6f6(0x109)]+_0x45d6f6(0xcc))),console['log']('Agent:\x20'+_0x3a6bcc[_0x45d6f6(0xd7)]);if(_0x3a6bcc[_0x45d6f6(0xfa)]&&_0x3a6bcc[_0x45d6f6(0x113)]){const _0x487a78=getLLMAgentChatUrl(_0x11815a,_0x3a6bcc['projectId'],_0x3a6bcc['agentId']);console[_0x45d6f6(0x111)](_0x45d6f6(0xf1)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x487a78));}return 0x0;}const _0x515694=_0x374b5a[_0x45d6f6(0x10e)],_0x569f43=resolveProjectFromContext(_0x47a256,_0x515694);if(_0x569f43[_0x45d6f6(0xd1)])_0x47a256=_0x569f43['projectDir'],_0x569f43[_0x45d6f6(0x12e)]===_0x45d6f6(0x94)&&console['log'](a4_0x51ad2e[_0x45d6f6(0xcd)](_0x45d6f6(0x95)+_0x47a256));else{let _0x269832=_0x45d6f6(0x110);_0x569f43[_0x45d6f6(0x112)]===_0x45d6f6(0xf2)&&(_0x269832=_0x569f43[_0x45d6f6(0x129)]+_0x45d6f6(0x100)+_0x569f43[_0x45d6f6(0x10e)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x569f43[_0x45d6f6(0x112)]===_0x45d6f6(0xff)?_0x569f43[_0x45d6f6(0x129)]:_0x45d6f6(0x136)+_0x47a256,undefined,{'helpText':_0x269832});}const {data:_0x4f9496}=await withSpinner(_0x45d6f6(0xdc),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0xae)](_0x47a256,{'dryRun':!![]})),_0x1a9645=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x12d)]>0x0;if(_0x1a9645){console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0xe6)));for(const _0x327125 of _0x4f9496[_0x45d6f6(0x12b)]){_0x327125[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e['red']('\x20\x20Agent\x20\x22'+_0x327125[_0x45d6f6(0xd7)]+_0x45d6f6(0x8f)+_0x327125[_0x45d6f6(0x11f)]));}return 0x1;}const _0x540b2c=_0x4f9496['counts'][_0x45d6f6(0x12b)][_0x45d6f6(0x8d)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xbe)]['created']+_0x4f9496['counts']['textKnowledgeBases'][_0x45d6f6(0x8d)]+_0x4f9496['counts'][_0x45d6f6(0xc9)]['created']+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x11c)][_0x45d6f6(0x8d)]+_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases']['created']+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)]['created'],_0x376418=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x116)]+_0x4f9496['counts'][_0x45d6f6(0xbe)][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)]['textKnowledgeBases'][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xc9)]['updated']+_0x4f9496[_0x45d6f6(0x137)]['integrations']['updated']+_0x4f9496['counts'][_0x45d6f6(0x13a)][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0x116)],_0x4dc5cb=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)]['knowledgeBases'][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x101)][_0x45d6f6(0xfe)]+_0x4f9496['counts'][_0x45d6f6(0xc9)]['unchanged']+_0x4f9496['counts'][_0x45d6f6(0x11c)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x13a)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0xfe)];console[_0x45d6f6(0x111)](_0x45d6f6(0x139)+_0x4f9496[_0x45d6f6(0xaa)]+'\x27:'),console[_0x45d6f6(0x111)]('\x20\x20'+a4_0x51ad2e[_0x45d6f6(0x11b)]('+\x20'+_0x540b2c+_0x45d6f6(0xcb))+'\x20|\x20'+a4_0x51ad2e[_0x45d6f6(0xca)]('~\x20'+_0x376418+_0x45d6f6(0x11e))+'\x20|\x20'+a4_0x51ad2e[_0x45d6f6(0xcd)]('=\x20'+_0x4dc5cb+_0x45d6f6(0xc1))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0x12b)])),console[_0x45d6f6(0x111)](_0x45d6f6(0x126)+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0xbe)])),console[_0x45d6f6(0x111)](_0x45d6f6(0xd8)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)]['textKnowledgeBases'])),console['log'](_0x45d6f6(0x130)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xc9)])),console['log'](_0x45d6f6(0x13c)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x11c)]));const _0x5bbd62=_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases'][_0x45d6f6(0x8d)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x13a)]['updated']>0x0||_0x4f9496['counts'][_0x45d6f6(0x13a)][_0x45d6f6(0xfe)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0x8d)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)]['updated']>0x0||_0x4f9496['counts'][_0x45d6f6(0x9d)][_0x45d6f6(0xfe)]>0x0;_0x5bbd62&&(console[_0x45d6f6(0x111)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases'])),console['log'](_0x45d6f6(0xeb)+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0x9d)])));console[_0x45d6f6(0x111)](_0x45d6f6(0x125)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x47a256)),displayDiffs(_0x4f9496[_0x45d6f6(0x12b)],_0x4f9496[_0x45d6f6(0xbe)],_0x4f9496['textKnowledgeBases'],_0x4f9496[_0x45d6f6(0xc9)],_0x4f9496[_0x45d6f6(0x11c)],_0x4f9496[_0x45d6f6(0x13a)],_0x4f9496[_0x45d6f6(0x9d)]);if(_0x5e24e0)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)](_0x45d6f6(0xac))),0x0;if(_0x540b2c===0x0&&_0x376418===0x0){console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x11b)](_0x45d6f6(0xf7)));const _0x1117d1=getLLMProjectUrl(_0x11815a,_0x4f9496[_0x45d6f6(0x113)]);return console[_0x45d6f6(0x111)](_0x45d6f6(0xfc)+a4_0x51ad2e['cyan'](_0x1117d1)),0x0;}if(!_0x569e1f&&!_0x6c3886){if(!isInteractive())return console[_0x45d6f6(0x11f)](a4_0x51ad2e['red'](_0x45d6f6(0xad)),_0x45d6f6(0x9e)),console[_0x45d6f6(0x11f)](a4_0x51ad2e[_0x45d6f6(0xcd)](_0x45d6f6(0x115))),0x1;const _0x5e9055=await confirmKey(_0x45d6f6(0x131)+(_0x540b2c+_0x376418)+'\x20resources?');if(!_0x5e9055)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)](_0x45d6f6(0xbc)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x19768e}=await withSpinner(_0x45d6f6(0xde),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0xae)](_0x47a256,{'force':_0x6c3886})),_0x2dd39c=_0x19768e[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0xbe)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0x101)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0xc9)][_0x45d6f6(0x12d)]>0x0;if(_0x2dd39c){console['log'](a4_0x51ad2e['yellow'](_0x45d6f6(0xf6))),console[_0x45d6f6(0x111)](),console[_0x45d6f6(0x111)](a4_0x51ad2e['red'](_0x45d6f6(0xe5)));for(const _0x42423e of _0x19768e[_0x45d6f6(0x12b)]){_0x42423e[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Agent\x20\x22'+_0x42423e[_0x45d6f6(0xd7)]+_0x45d6f6(0x8f)+_0x42423e[_0x45d6f6(0x11f)]));}for(const _0x23f493 of _0x19768e[_0x45d6f6(0xbe)]){_0x23f493[_0x45d6f6(0x109)]===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0x118)+_0x23f493['name']+_0x45d6f6(0x8f)+_0x23f493[_0x45d6f6(0x11f)]));}for(const _0x1feb4d of _0x19768e[_0x45d6f6(0x101)]){_0x1feb4d['action']===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1feb4d[_0x45d6f6(0x13b)]+_0x45d6f6(0x8f)+_0x1feb4d[_0x45d6f6(0x11f)]));}for(const _0x533e1a of _0x19768e['prompts']){_0x533e1a[_0x45d6f6(0x109)]===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0x98)+_0x533e1a[_0x45d6f6(0x13b)]+_0x45d6f6(0x8f)+_0x533e1a[_0x45d6f6(0x11f)]));}for(const _0x38f7cc of _0x19768e[_0x45d6f6(0x11c)]){_0x38f7cc[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Integration\x20\x22'+_0x38f7cc['name']+_0x45d6f6(0x8f)+_0x38f7cc['error']));}return 0x1;}console['log'](a4_0x51ad2e['green'](_0x45d6f6(0x10a)+(_0x540b2c+_0x376418)+'\x20resources\x20to\x20\x27'+_0x19768e['projectName']+'\x27'));const _0x29e9e0=getLLMProjectUrl(_0x11815a,_0x19768e[_0x45d6f6(0x113)]);return console[_0x45d6f6(0x111)](_0x45d6f6(0xfc)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x29e9e0)),0x0;}}
|
|
1
|
+
const a4_0x15e66a=a4_0x31b6;(function(_0x48df38,_0x58c3c8){const _0x2d1d7b=a4_0x31b6,_0x17dcb6=_0x48df38();while(!![]){try{const _0x3ac4a4=-parseInt(_0x2d1d7b(0x223))/0x1*(-parseInt(_0x2d1d7b(0x19a))/0x2)+parseInt(_0x2d1d7b(0x22a))/0x3*(parseInt(_0x2d1d7b(0x201))/0x4)+parseInt(_0x2d1d7b(0x1d5))/0x5*(-parseInt(_0x2d1d7b(0x210))/0x6)+-parseInt(_0x2d1d7b(0x1cd))/0x7*(parseInt(_0x2d1d7b(0x1fa))/0x8)+parseInt(_0x2d1d7b(0x1df))/0x9*(parseInt(_0x2d1d7b(0x224))/0xa)+-parseInt(_0x2d1d7b(0x1c8))/0xb+parseInt(_0x2d1d7b(0x209))/0xc*(parseInt(_0x2d1d7b(0x192))/0xd);if(_0x3ac4a4===_0x58c3c8)break;else _0x17dcb6['push'](_0x17dcb6['shift']());}catch(_0x194110){_0x17dcb6['push'](_0x17dcb6['shift']());}}}(a4_0x3c3d,0x5dbc3));import a4_0x523d8d from'chalk';import a4_0x3c73ba from'path';import{existsSync,readFileSync}from'fs';function a4_0x3c3d(){const _0x4309bf=['64xMRlDI','pullAgent','force','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Pushing\x20to\x20project...','message','New\x20project:\x20','hasChanges','repeat','Would\x20push\x20agent:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20tdx\x20agent\x20clone\x20agents/','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','<new-name>','\x0aChanges:','cwd','\x20resources?','site','\x20errors','description','updated','tdx.json','green','created','reason','parse','pushAgent','prompts','\x0aChanges\x20to\x20integration\x20\x27','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20|\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','pushProject','push','dirname','Output\x20path:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Agents:\x20','\x0aError:','\x20files?','Source:\x20','profile','Project\x20cloned\x20with\x20errors','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','1606561MITFGW','new','Project:\x20','agents','cloneProject','402955kcvNTT','\x0a✔\x20Pushed\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Prompts:\x20','dim','Cancelled','\x0a✔\x20Pulled\x20','join','532030BeyAEK','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20tdx\x20agent\x20pull\x20','\x20changed','\x0aPush\x20summary\x20for\x20\x27','Failed\x20to\x20push\x20agent:\x20','experimentalKnowledgeBases','-\x20no\x20files\x20written','agentName','log','18JAQMQw','\x20\x20Knowledge\x20Bases:\x20','Analyzing\x20changes\x20to\x20push...','agent:clone','\x22:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Cloning\x20\x22','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Using\x20project:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22\x20to\x20new\x20project\x20\x22','outputPath','red','agentId','session','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cyan','dryRun','\x22\x20from\x20project\x20\x22','found','isNew','no_local_folder','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aWrite\x20','Pulling\x20agent\x20\x22','integrations','24KYrVvo','execute','\x20\x20Integration\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','error','agent:pull','\x20\x20Source:\x20','1053812RErnuj','Pushing\x20agent\x20from\x20\x22','knowledgeBases','yes','agent:push','\x20\x20Experimental\x20Artifacts:\x20','no_context','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','48eTfvoO','\x20new','Agent\x20pulled\x20successfully','New\x20project\x20name\x20is\x20required','\x20=\x20','gray','\x20--profile\x20','42sVHXmQ','\x0aChanges\x20to\x20prompt\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','llmProject','utf-8','New\x20project\x20ID:\x20','Using\x20current\x20project:\x20','newProjectId','llm_project','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','errors','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','llm','\x20updated','unchanged','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','projectId','19399fFGMgi','2213750iEGEMI','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Integrations:\x20','output','\x20resources\x20to\x20\x27','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)','3lELmBE','yellow','diff','Output:\x20','action','\x20--name\x20','Chat:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','No\x20tdx.json\x20found\x20in\x20','projectName','experimentalArtifacts','✔\x20Context\x20set:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Agent\x20','counts','\x20total','total','\x22...','Errors:','\x0aPull\x20summary\x20for\x20\x27','Using\x20project\x20from\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','sourceProjectName','textKnowledgeBases','\x0aProject\x20pushed\x20with\x20errors','\x20\x20Knowledge\x20Base\x20\x22','Writing\x20files...','pullProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Agent\x20\x22','name','391807OHqBtL','Agent:\x20','agent.yml','Would\x20pull\x20agent:\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)','Using\x20local\x20project:\x20','-\x20nothing\x20pushed','\x20\x20Target:\x20'];a4_0x3c3d=function(){return _0x4309bf;};return a4_0x3c3d();}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_0x31b6(_0x5b2809,_0x346b15){_0x5b2809=_0x5b2809-0x18a;const _0x3c3dea=a4_0x3c3d();let _0x31b624=_0x3c3dea[_0x5b2809];return _0x31b624;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2755f7){const _0x5db330=a4_0x31b6,_0x226942=[];if(_0x2755f7['total']!==undefined)_0x226942[_0x5db330(0x1bc)](_0x2755f7['total']+_0x5db330(0x239));if(_0x2755f7[_0x5db330(0x1c9)]!==undefined&&_0x2755f7[_0x5db330(0x1c9)]>0x0)_0x226942['push'](a4_0x523d8d[_0x5db330(0x1b0)](_0x2755f7[_0x5db330(0x1c9)]+_0x5db330(0x20a)));if(_0x2755f7[_0x5db330(0x1b1)]!==undefined&&_0x2755f7[_0x5db330(0x1b1)]>0x0)_0x226942['push'](a4_0x523d8d['green'](_0x2755f7['created']+'\x20created'));if(_0x2755f7[_0x5db330(0x1ae)]!==undefined&&_0x2755f7['updated']>0x0)_0x226942[_0x5db330(0x1bc)](a4_0x523d8d[_0x5db330(0x22b)](_0x2755f7[_0x5db330(0x1ae)]+_0x5db330(0x21e)));if(_0x2755f7['unchanged']!==undefined&&_0x2755f7[_0x5db330(0x21f)]>0x0)_0x226942[_0x5db330(0x1bc)](a4_0x523d8d[_0x5db330(0x20e)](_0x2755f7[_0x5db330(0x21f)]+_0x5db330(0x1ba)));if(_0x2755f7[_0x5db330(0x21b)]!==undefined&&_0x2755f7[_0x5db330(0x21b)]>0x0)_0x226942[_0x5db330(0x1bc)](a4_0x523d8d[_0x5db330(0x1eb)](_0x2755f7[_0x5db330(0x21b)]+_0x5db330(0x1ac)));return _0x226942['join'](',\x20');}function displayDiffs(_0x591d05,_0x34519b,_0x5905bd,_0x1ae011,_0x58ab90,_0x310fbb,_0x33af33){const _0x11f7bf=a4_0x31b6;for(const _0x4732d3 of _0x591d05){if(_0x4732d3['diff']){const _0x7925b6=_0x4732d3[_0x11f7bf(0x1dd)]||_0x4732d3[_0x11f7bf(0x191)];console['log'](_0x11f7bf(0x21a)+_0x7925b6+'\x27:'),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)),console[_0x11f7bf(0x1de)](_0x4732d3['diff']),console['log']('─'[_0x11f7bf(0x1a2)](0x3c));}}for(const _0x19dd3d of _0x34519b){_0x19dd3d[_0x11f7bf(0x22c)]&&(console[_0x11f7bf(0x1de)](_0x11f7bf(0x231)+_0x19dd3d[_0x11f7bf(0x191)]+'\x27:'),console[_0x11f7bf(0x1de)]('─'['repeat'](0x3c)),console[_0x11f7bf(0x1de)](_0x19dd3d[_0x11f7bf(0x22c)]),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)));}for(const _0x1063a7 of _0x5905bd){_0x1063a7[_0x11f7bf(0x22c)]&&(console['log'](_0x11f7bf(0x1b7)+_0x1063a7['name']+'\x27:'),console[_0x11f7bf(0x1de)]('─'['repeat'](0x3c)),console[_0x11f7bf(0x1de)](_0x1063a7['diff']),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)));}for(const _0x1228d6 of _0x1ae011){_0x1228d6[_0x11f7bf(0x22c)]&&(console[_0x11f7bf(0x1de)](_0x11f7bf(0x211)+_0x1228d6[_0x11f7bf(0x191)]+'\x27:'),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)),console[_0x11f7bf(0x1de)](_0x1228d6[_0x11f7bf(0x22c)]),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)));}for(const _0x51f27f of _0x58ab90){_0x51f27f['diff']&&(console[_0x11f7bf(0x1de)](_0x11f7bf(0x1b6)+_0x51f27f['name']+'\x27:'),console['log']('─'[_0x11f7bf(0x1a2)](0x3c)),console['log'](_0x51f27f[_0x11f7bf(0x22c)]),console['log']('─'['repeat'](0x3c)));}for(const _0x40a204 of _0x310fbb){_0x40a204[_0x11f7bf(0x22c)]&&(console[_0x11f7bf(0x1de)](_0x11f7bf(0x1bf)+_0x40a204[_0x11f7bf(0x191)]+'\x27:'),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)),console[_0x11f7bf(0x1de)](_0x40a204[_0x11f7bf(0x22c)]),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)));}for(const _0x959431 of _0x33af33){_0x959431[_0x11f7bf(0x22c)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x959431[_0x11f7bf(0x191)]+'\x27:'),console[_0x11f7bf(0x1de)]('─'[_0x11f7bf(0x1a2)](0x3c)),console[_0x11f7bf(0x1de)](_0x959431[_0x11f7bf(0x22c)]),console['log']('─'[_0x11f7bf(0x1a2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x15e66a(0x191)]=a4_0x15e66a(0x1ff);[a4_0x15e66a(0x1ad)]=a4_0x15e66a(0x1e4);async['execute'](_0x34b5ae){const _0x237241=a4_0x15e66a,{options:_0x3c2964,args:_0x2ac54e,tdx:_0x55811c}=_0x34b5ae,_0x10a0ad=_0x2ac54e[0x0],_0x3fded=_0x2ac54e[0x1],_0x32c84a=_0x3c2964[_0x237241(0x227)],_0x23334d=_0x3c2964[_0x237241(0x1f1)],_0x473083=_0x3c2964[_0x237241(0x19c)],_0x384998=_0x3c2964['yes'],_0x44a974=_0x3c2964[_0x237241(0x213)];let _0x42c5e3,_0x33cd1d;const _0x450079=findAgentConfigPath(process['cwd']());if(_0x10a0ad){const _0x1ccb95=a4_0x3c73ba[_0x237241(0x1d4)](_0x10a0ad,'tdx.json');if(existsSync(_0x1ccb95))try{const _0x17c8a2=JSON['parse'](readFileSync(_0x1ccb95,_0x237241(0x214)));_0x42c5e3=_0x17c8a2[_0x237241(0x218)],_0x33cd1d=_0x10a0ad,console['log'](a4_0x523d8d[_0x237241(0x1d1)](_0x237241(0x23e)+_0x1ccb95+':\x20'+_0x42c5e3));}catch{_0x42c5e3=_0x10a0ad;}else _0x42c5e3=_0x10a0ad;}else{if(_0x450079)try{const _0x3fb8d1=JSON[_0x237241(0x1b3)](readFileSync(_0x450079,'utf-8'));_0x42c5e3=_0x3fb8d1[_0x237241(0x218)],_0x33cd1d=a4_0x3c73ba[_0x237241(0x1bd)](_0x450079),console['log'](a4_0x523d8d[_0x237241(0x1d1)](_0x237241(0x1e7)+_0x42c5e3));}catch{_0x42c5e3=_0x44a974;}else _0x42c5e3=_0x44a974;}if(!_0x42c5e3)return console[_0x237241(0x1de)](a4_0x523d8d[_0x237241(0x22b)](_0x237241(0x1a4))),console[_0x237241(0x1de)](_0x237241(0x229)),console[_0x237241(0x1de)](_0x237241(0x1fd)),console['log'](_0x237241(0x212)),console[_0x237241(0x1de)](_0x237241(0x23f)),0x1;if(_0x3fded){const {data:_0x3e82e1}=await withSpinner(_0x237241(0x1f8)+_0x3fded+_0x237241(0x1f2)+_0x42c5e3+_0x237241(0x23b),()=>_0x55811c[_0x237241(0x21d)][_0x237241(0x19b)](_0x42c5e3,_0x3fded,_0x32c84a,{'dryRun':_0x23334d,'force':_0x473083}));if(_0x23334d)return console['log'](a4_0x523d8d[_0x237241(0x22b)](_0x237241(0x1cf))),console['log'](_0x237241(0x195)+_0x3e82e1[_0x237241(0x1dd)]),console['log'](_0x237241(0x1be)+_0x3e82e1[_0x237241(0x1ea)]),_0x3e82e1[_0x237241(0x22c)]&&(console[_0x237241(0x1de)](_0x237241(0x1a8)),console['log']('─'[_0x237241(0x1a2)](0x3c)),console['log'](_0x3e82e1[_0x237241(0x22c)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x237241(0x1de)](a4_0x523d8d[_0x237241(0x1b0)](_0x237241(0x20b))),console[_0x237241(0x1de)](_0x237241(0x193)+_0x3e82e1[_0x237241(0x1dd)]),console[_0x237241(0x1de)](_0x237241(0x22d)+_0x3e82e1[_0x237241(0x1ea)]),console[_0x237241(0x1de)]('Status:\x20'+(_0x3e82e1[_0x237241(0x1f4)]?a4_0x523d8d['green']('new'):_0x3e82e1[_0x237241(0x1a1)]?a4_0x523d8d[_0x237241(0x22b)](_0x237241(0x1ae)):a4_0x523d8d[_0x237241(0x20e)](_0x237241(0x21f)))),0x0;}const _0x7a9ee3=_0x33cd1d||_0x32c84a,{data:_0x22da03}=await withSpinner('Analyzing\x20project\x20\x22'+_0x42c5e3+_0x237241(0x23b),()=>_0x55811c[_0x237241(0x21d)][_0x237241(0x18e)](_0x42c5e3,_0x7a9ee3,{'dryRun':!![]})),_0x5e0782=_0x22da03[_0x237241(0x238)][_0x237241(0x1cb)]['new']+_0x22da03[_0x237241(0x238)][_0x237241(0x203)]['new']+_0x22da03[_0x237241(0x238)][_0x237241(0x18a)][_0x237241(0x1c9)]+_0x22da03['counts'][_0x237241(0x1b5)][_0x237241(0x1c9)]+_0x22da03[_0x237241(0x238)][_0x237241(0x1f9)][_0x237241(0x1c9)]+_0x22da03[_0x237241(0x238)][_0x237241(0x1db)][_0x237241(0x1c9)]+_0x22da03[_0x237241(0x238)]['experimentalArtifacts'][_0x237241(0x1c9)],_0x2ab525=_0x22da03[_0x237241(0x238)][_0x237241(0x1cb)][_0x237241(0x1ae)]+_0x22da03[_0x237241(0x238)][_0x237241(0x203)]['updated']+_0x22da03[_0x237241(0x238)][_0x237241(0x18a)][_0x237241(0x1ae)]+_0x22da03['counts']['prompts'][_0x237241(0x1ae)]+_0x22da03[_0x237241(0x238)][_0x237241(0x1f9)][_0x237241(0x1ae)]+_0x22da03[_0x237241(0x238)][_0x237241(0x1db)][_0x237241(0x1ae)]+_0x22da03[_0x237241(0x238)]['experimentalArtifacts']['updated'],_0x1e834e=_0x22da03[_0x237241(0x238)]['agents'][_0x237241(0x21f)]+_0x22da03[_0x237241(0x238)]['knowledgeBases'][_0x237241(0x21f)]+_0x22da03['counts'][_0x237241(0x18a)][_0x237241(0x21f)]+_0x22da03[_0x237241(0x238)][_0x237241(0x1b5)][_0x237241(0x21f)]+_0x22da03['counts']['integrations'][_0x237241(0x21f)]+_0x22da03[_0x237241(0x238)][_0x237241(0x1db)]['unchanged']+_0x22da03[_0x237241(0x238)]['experimentalArtifacts'][_0x237241(0x21f)];console['log'](_0x237241(0x23d)+_0x22da03[_0x237241(0x233)]+'\x27:'),console[_0x237241(0x1de)]('\x20\x20'+a4_0x523d8d[_0x237241(0x1b0)]('+\x20'+_0x5e0782+_0x237241(0x20a))+_0x237241(0x1b8)+a4_0x523d8d[_0x237241(0x22b)]('~\x20'+_0x2ab525+_0x237241(0x1d8))+_0x237241(0x1b8)+a4_0x523d8d[_0x237241(0x1d1)]('=\x20'+_0x1e834e+_0x237241(0x1ba))),console[_0x237241(0x1de)](_0x237241(0x1c1)+formatCountSummary(_0x22da03[_0x237241(0x238)][_0x237241(0x1cb)])),console[_0x237241(0x1de)](_0x237241(0x1e0)+formatCountSummary(_0x22da03[_0x237241(0x238)][_0x237241(0x203)])),console[_0x237241(0x1de)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x22da03[_0x237241(0x238)]['textKnowledgeBases'])),console[_0x237241(0x1de)](_0x237241(0x1d0)+formatCountSummary(_0x22da03['counts']['prompts'])),console[_0x237241(0x1de)](_0x237241(0x226)+formatCountSummary(_0x22da03[_0x237241(0x238)]['integrations']));const _0x5571fb=_0x22da03[_0x237241(0x238)][_0x237241(0x1db)][_0x237241(0x23a)]>0x0||_0x22da03['counts'][_0x237241(0x234)][_0x237241(0x23a)]>0x0;_0x5571fb&&(console[_0x237241(0x1de)](_0x237241(0x1f6)+formatCountSummary(_0x22da03[_0x237241(0x238)]['experimentalKnowledgeBases'])),console[_0x237241(0x1de)](_0x237241(0x206)+formatCountSummary(_0x22da03['counts'][_0x237241(0x234)])));console['log'](_0x237241(0x199)+a4_0x523d8d[_0x237241(0x1f0)](_0x22da03['outputDir'])),displayDiffs(_0x22da03[_0x237241(0x1cb)],_0x22da03[_0x237241(0x203)],_0x22da03[_0x237241(0x18a)],_0x22da03[_0x237241(0x1b5)],_0x22da03[_0x237241(0x1f9)],_0x22da03[_0x237241(0x1db)],_0x22da03[_0x237241(0x234)]);if(_0x23334d)return console[_0x237241(0x1de)](a4_0x523d8d[_0x237241(0x22b)](_0x237241(0x221))),0x0;if(_0x5e0782===0x0&&_0x2ab525===0x0)return console[_0x237241(0x1de)](a4_0x523d8d[_0x237241(0x1b0)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x22da03[_0x237241(0x233)]},_0x3c2964[_0x237241(0x1ed)]),console[_0x237241(0x1de)](a4_0x523d8d[_0x237241(0x1b0)](_0x237241(0x235)+a4_0x523d8d['dim']('llm_project')+_0x237241(0x20d)+a4_0x523d8d[_0x237241(0x1f0)](_0x22da03[_0x237241(0x233)]))),0x0;if(!_0x384998&&!_0x473083){if(!isInteractive())return console[_0x237241(0x1fe)](a4_0x523d8d[_0x237241(0x1eb)](_0x237241(0x1c2)),_0x237241(0x1c7)),console[_0x237241(0x1fe)](a4_0x523d8d['dim'](_0x237241(0x21c))),0x1;const _0x2fff6c=await confirmKey(_0x237241(0x1f7)+(_0x5e0782+_0x2ab525)+_0x237241(0x1c3));if(!_0x2fff6c)return console[_0x237241(0x1de)](a4_0x523d8d['yellow'](_0x237241(0x1d2)),_0x237241(0x1dc)),0x1;}const {data:_0xa052a1}=await withSpinner(_0x237241(0x18d),()=>_0x55811c['llm'][_0x237241(0x18e)](_0x42c5e3,_0x7a9ee3,{'force':_0x473083}));return console['log'](a4_0x523d8d[_0x237241(0x1b0)](_0x237241(0x1d3)+(_0x5e0782+_0x2ab525)+'\x20files\x20to\x20'+_0xa052a1['outputDir'])),saveSessionContext({'llm_project':_0xa052a1[_0x237241(0x233)]},_0x3c2964[_0x237241(0x1ed)]),console['log'](a4_0x523d8d[_0x237241(0x1b0)](_0x237241(0x235)+a4_0x523d8d[_0x237241(0x1d1)](_0x237241(0x218))+_0x237241(0x20d)+a4_0x523d8d[_0x237241(0x1f0)](_0xa052a1[_0x237241(0x233)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x15e66a(0x191)]=a4_0x15e66a(0x1e2);[a4_0x15e66a(0x1ad)]=a4_0x15e66a(0x208);async[a4_0x15e66a(0x1fb)](_0x436faa){const _0x468a78=a4_0x15e66a,{options:_0x12e61c,args:_0x3c6b2f,tdx:_0x47b162}=_0x436faa,_0x3e4edb=_0x3c6b2f[0x0],_0x5e48ef=_0x12e61c[_0x468a78(0x191)],_0x151e8d=_0x12e61c['dryRun'],_0x953ebb=_0x12e61c[_0x468a78(0x204)],_0x1010ae=_0x12e61c[_0x468a78(0x1ab)],_0xe2f09d=_0x12e61c[_0x468a78(0x213)];let _0x24b78a;const _0x784a59=findAgentConfigPath(process['cwd']());if(_0x3e4edb){const _0x4ddba2=a4_0x3c73ba['join'](_0x3e4edb,_0x468a78(0x1af));existsSync(_0x4ddba2)?(_0x24b78a=_0x3e4edb,console['log'](a4_0x523d8d[_0x468a78(0x1d1)](_0x468a78(0x197)+_0x3e4edb))):_0x24b78a=_0x3e4edb;}else{if(_0x784a59)_0x24b78a=a4_0x3c73ba['dirname'](_0x784a59),console[_0x468a78(0x1de)](a4_0x523d8d[_0x468a78(0x1d1)](_0x468a78(0x216)+_0x24b78a));else{if(_0xe2f09d){const _0x57e427=sanitizeForFilesystem(_0xe2f09d);let _0x379e42=_0x57e427,_0x492d4e=a4_0x3c73ba[_0x468a78(0x1d4)](process[_0x468a78(0x1a9)](),_0x468a78(0x1cb),_0x57e427,_0x468a78(0x1af));if(!existsSync(_0x492d4e)){const _0x5e79a4=normalizeName(_0xe2f09d),_0x2c591f=a4_0x3c73ba[_0x468a78(0x1d4)](process[_0x468a78(0x1a9)](),_0x468a78(0x1cb),_0x5e79a4,'tdx.json');existsSync(_0x2c591f)&&(_0x379e42=_0x5e79a4,_0x492d4e=_0x2c591f);}if(existsSync(_0x492d4e))_0x24b78a=a4_0x3c73ba[_0x468a78(0x1bd)](_0x492d4e),console[_0x468a78(0x1de)](a4_0x523d8d['dim'](_0x468a78(0x197)+_0x24b78a));else{const _0xada7b4=_0x12e61c[_0x468a78(0x1c5)];if(_0xada7b4)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0xe2f09d+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x468a78(0x1e8)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x468a78(0x1d7)+_0xe2f09d+'\x0a')+(_0x468a78(0x1a5)+_0x379e42+_0x468a78(0x22f)+(_0x5e48ef||_0x468a78(0x1a7))+_0x468a78(0x20f)+_0xada7b4)});_0x24b78a=_0xe2f09d,console[_0x468a78(0x1de)](a4_0x523d8d['dim']('Using\x20context\x20project:\x20'+_0xe2f09d));}}}}if(!_0x24b78a)return console[_0x468a78(0x1de)](a4_0x523d8d['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x468a78(0x1de)](_0x468a78(0x225)),console[_0x468a78(0x1de)](_0x468a78(0x1ef)),console['log'](_0x468a78(0x196)),console[_0x468a78(0x1de)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x5e48ef)throw new SDKError(ErrorCode[_0x468a78(0x1ee)],_0x468a78(0x20c),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x953ebb&&!_0x151e8d){if(!isInteractive())return console[_0x468a78(0x1fe)](a4_0x523d8d[_0x468a78(0x1eb)](_0x468a78(0x1c2)),_0x468a78(0x1c7)),console[_0x468a78(0x1fe)](a4_0x523d8d['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2828b9=await confirmKey('Clone\x20\x22'+_0x24b78a+_0x468a78(0x1e9)+_0x5e48ef+'\x22?');if(!_0x2828b9)return console[_0x468a78(0x1de)](a4_0x523d8d['yellow'](_0x468a78(0x1d2))),0x1;}const {data:_0x5e654d}=await withSpinner(_0x468a78(0x1e5)+_0x24b78a+'\x22\x20to\x20\x22'+_0x5e48ef+_0x468a78(0x23b),()=>_0x47b162[_0x468a78(0x21d)][_0x468a78(0x1cc)](_0x24b78a,_0x5e48ef,{'dryRun':_0x151e8d}));if(_0x151e8d){console[_0x468a78(0x1de)](a4_0x523d8d[_0x468a78(0x22b)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x468a78(0x1de)](_0x468a78(0x1c4)+_0x5e654d[_0x468a78(0x240)]),console[_0x468a78(0x1de)](_0x468a78(0x1a0)+_0x5e48ef),console[_0x468a78(0x1de)]('Would\x20clone:'),console['log'](_0x468a78(0x1c1)+_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1cb)][_0x468a78(0x1b1)]),console['log'](_0x468a78(0x1e0)+_0x5e654d['counts']['knowledgeBases']['created']),console[_0x468a78(0x1de)](_0x468a78(0x1d0)+_0x5e654d['counts'][_0x468a78(0x1b5)][_0x468a78(0x1b1)]);const _0x166150=_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1db)]['created']>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x234)][_0x468a78(0x1b1)]>0x0;return _0x166150&&(console[_0x468a78(0x1de)](_0x468a78(0x1f6)+_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1db)]['created']),console['log'](_0x468a78(0x206)+_0x5e654d[_0x468a78(0x238)]['experimentalArtifacts'][_0x468a78(0x1b1)])),0x0;}const _0x16a658=_0x5e654d[_0x468a78(0x238)]['agents'][_0x468a78(0x21b)]>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x203)][_0x468a78(0x21b)]>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1b5)][_0x468a78(0x21b)]>0x0||_0x5e654d['counts']['experimentalKnowledgeBases']['errors']>0x0||_0x5e654d['counts'][_0x468a78(0x234)][_0x468a78(0x21b)]>0x0;_0x16a658?console[_0x468a78(0x1de)](a4_0x523d8d[_0x468a78(0x22b)](_0x468a78(0x1c6))):console['log'](a4_0x523d8d['green']('Project\x20cloned\x20successfully'));console[_0x468a78(0x1de)](_0x468a78(0x1c4)+_0x5e654d['sourceProjectName']),console['log']('New\x20project:\x20'+_0x5e654d['newProjectName']),console[_0x468a78(0x1de)](_0x468a78(0x215)+_0x5e654d['newProjectId']),console[_0x468a78(0x1de)](),console[_0x468a78(0x1de)]('Summary:'),console[_0x468a78(0x1de)](_0x468a78(0x1c1)+formatCountSummary(_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1cb)])),console['log'](_0x468a78(0x1e0)+formatCountSummary(_0x5e654d[_0x468a78(0x238)]['knowledgeBases'])),console['log'](_0x468a78(0x1d0)+formatCountSummary(_0x5e654d['counts'][_0x468a78(0x1b5)])),console[_0x468a78(0x1de)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1f9)]));const _0x38c756=_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1db)][_0x468a78(0x1b1)]>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1db)][_0x468a78(0x1ae)]>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1db)][_0x468a78(0x21f)]>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x234)][_0x468a78(0x1b1)]>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x234)]['updated']>0x0||_0x5e654d[_0x468a78(0x238)][_0x468a78(0x234)][_0x468a78(0x21f)]>0x0;_0x38c756&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5e654d[_0x468a78(0x238)][_0x468a78(0x1db)])),console[_0x468a78(0x1de)](_0x468a78(0x206)+formatCountSummary(_0x5e654d['counts'][_0x468a78(0x234)])));if(_0x16a658){console[_0x468a78(0x1de)](),console['log'](a4_0x523d8d[_0x468a78(0x1eb)](_0x468a78(0x23c)));for(const _0x33c4de of _0x5e654d[_0x468a78(0x1cb)]){_0x33c4de['action']===_0x468a78(0x1fe)&&console[_0x468a78(0x1de)](a4_0x523d8d[_0x468a78(0x1eb)](_0x468a78(0x190)+_0x33c4de['agentName']+_0x468a78(0x1e3)+_0x33c4de['error']));}for(const _0x414057 of _0x5e654d[_0x468a78(0x203)]){_0x414057[_0x468a78(0x22e)]===_0x468a78(0x1fe)&&console[_0x468a78(0x1de)](a4_0x523d8d['red'](_0x468a78(0x18c)+_0x414057['name']+'\x22:\x20'+_0x414057[_0x468a78(0x1fe)]));}for(const _0x2f4bb1 of _0x5e654d[_0x468a78(0x1b5)]){_0x2f4bb1[_0x468a78(0x22e)]===_0x468a78(0x1fe)&&console[_0x468a78(0x1de)](a4_0x523d8d[_0x468a78(0x1eb)](_0x468a78(0x219)+_0x2f4bb1[_0x468a78(0x191)]+_0x468a78(0x1e3)+_0x2f4bb1[_0x468a78(0x1fe)]));}for(const _0x2b70b6 of _0x5e654d[_0x468a78(0x1f9)]){_0x2b70b6[_0x468a78(0x22e)]===_0x468a78(0x1fe)&&console[_0x468a78(0x1de)](a4_0x523d8d['red'](_0x468a78(0x1fc)+_0x2b70b6['name']+'\x22:\x20'+_0x2b70b6[_0x468a78(0x1fe)]));}for(const _0x1a1793 of _0x5e654d[_0x468a78(0x1db)]){_0x1a1793[_0x468a78(0x22e)]===_0x468a78(0x1fe)&&console[_0x468a78(0x1de)](a4_0x523d8d[_0x468a78(0x1eb)](_0x468a78(0x1e6)+_0x1a1793[_0x468a78(0x191)]+_0x468a78(0x1e3)+_0x1a1793[_0x468a78(0x1fe)]));}for(const _0x1d349f of _0x5e654d[_0x468a78(0x234)]){_0x1d349f[_0x468a78(0x22e)]===_0x468a78(0x1fe)&&console[_0x468a78(0x1de)](a4_0x523d8d[_0x468a78(0x1eb)](_0x468a78(0x1c0)+_0x1d349f[_0x468a78(0x191)]+'\x22:\x20'+_0x1d349f[_0x468a78(0x1fe)]));}return 0x1;}console[_0x468a78(0x1de)]();const _0x25a9f8=getLLMProjectUrl(_0x1010ae,_0x5e654d[_0x468a78(0x217)]);return console[_0x468a78(0x1de)](_0x468a78(0x1ca)+a4_0x523d8d[_0x468a78(0x1f0)](_0x25a9f8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x15e66a(0x191)]=a4_0x15e66a(0x205);['description']=a4_0x15e66a(0x1a6);async[a4_0x15e66a(0x1fb)](_0x220db6){const _0x486f9f=a4_0x15e66a,{options:_0x55c4f9,args:_0x232da2,tdx:_0x239742}=_0x220db6;let _0x3a71d2=_0x232da2[0x0]||process[_0x486f9f(0x1a9)]();const _0xa026b9=_0x55c4f9[_0x486f9f(0x1f1)],_0x2d8378=_0x55c4f9[_0x486f9f(0x19c)],_0x400fb1=_0x55c4f9[_0x486f9f(0x204)],_0x407065=_0x55c4f9[_0x486f9f(0x1ab)],_0x2f81b2=a4_0x3c73ba[_0x486f9f(0x1d4)](_0x3a71d2,_0x486f9f(0x194)),_0x4f38bd=existsSync(_0x2f81b2);if(_0x4f38bd){const {data:_0x39f2d7}=await withSpinner(_0x486f9f(0x202)+_0x3a71d2+'\x22...',()=>_0x239742[_0x486f9f(0x21d)][_0x486f9f(0x1b4)](_0x3a71d2,{'dryRun':_0xa026b9,'force':_0x2d8378}));if(_0xa026b9)return console['log'](a4_0x523d8d[_0x486f9f(0x22b)](_0x486f9f(0x1b9))),console['log'](_0x486f9f(0x1a3)+_0x39f2d7['agentName']),0x0;if(_0x39f2d7[_0x486f9f(0x22e)]===_0x486f9f(0x1fe))return console[_0x486f9f(0x1de)](a4_0x523d8d['red'](_0x486f9f(0x1da)+_0x39f2d7[_0x486f9f(0x1fe)])),0x1;console[_0x486f9f(0x1de)](a4_0x523d8d[_0x486f9f(0x1b0)](_0x486f9f(0x237)+_0x39f2d7[_0x486f9f(0x22e)]+'\x20successfully')),console[_0x486f9f(0x1de)](_0x486f9f(0x193)+_0x39f2d7[_0x486f9f(0x1dd)]);if(_0x39f2d7[_0x486f9f(0x1ec)]&&_0x39f2d7['projectId']){const _0xa6560=getLLMAgentChatUrl(_0x407065,_0x39f2d7[_0x486f9f(0x222)],_0x39f2d7['agentId']);console[_0x486f9f(0x1de)](_0x486f9f(0x230)+a4_0x523d8d['cyan'](_0xa6560));}return 0x0;}const _0x713dab=_0x55c4f9[_0x486f9f(0x213)],_0x5ce13f=resolveProjectFromContext(_0x3a71d2,_0x713dab);if(_0x5ce13f[_0x486f9f(0x1f3)])_0x3a71d2=_0x5ce13f['projectDir'],_0x5ce13f['source']==='context'&&console[_0x486f9f(0x1de)](a4_0x523d8d[_0x486f9f(0x1d1)](_0x486f9f(0x1e7)+_0x3a71d2));else{let _0x28ca9f=_0x486f9f(0x1d6);_0x5ce13f[_0x486f9f(0x1b2)]===_0x486f9f(0x1f5)&&(_0x28ca9f=_0x5ce13f[_0x486f9f(0x19f)]+_0x486f9f(0x236)+_0x5ce13f[_0x486f9f(0x213)]+_0x486f9f(0x18f));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5ce13f[_0x486f9f(0x1b2)]===_0x486f9f(0x207)?_0x5ce13f[_0x486f9f(0x19f)]:_0x486f9f(0x232)+_0x3a71d2,undefined,{'helpText':_0x28ca9f});}const {data:_0x5d296d}=await withSpinner(_0x486f9f(0x1e1),()=>_0x239742[_0x486f9f(0x21d)][_0x486f9f(0x1bb)](_0x3a71d2,{'dryRun':!![]})),_0x88a18e=_0x5d296d['counts'][_0x486f9f(0x1cb)][_0x486f9f(0x21b)]>0x0;if(_0x88a18e){console['log'](a4_0x523d8d[_0x486f9f(0x1eb)]('\x0aErrors\x20found:'));for(const _0x18de29 of _0x5d296d[_0x486f9f(0x1cb)]){_0x18de29[_0x486f9f(0x22e)]===_0x486f9f(0x1fe)&&console[_0x486f9f(0x1de)](a4_0x523d8d['red'](_0x486f9f(0x190)+_0x18de29[_0x486f9f(0x1dd)]+_0x486f9f(0x1e3)+_0x18de29['error']));}return 0x1;}const _0x28888a=_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1cb)]['created']+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x203)][_0x486f9f(0x1b1)]+_0x5d296d['counts'][_0x486f9f(0x18a)][_0x486f9f(0x1b1)]+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1b5)][_0x486f9f(0x1b1)]+_0x5d296d[_0x486f9f(0x238)]['integrations'][_0x486f9f(0x1b1)]+_0x5d296d['counts'][_0x486f9f(0x1db)][_0x486f9f(0x1b1)]+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x234)][_0x486f9f(0x1b1)],_0x41fe02=_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1cb)]['updated']+_0x5d296d['counts'][_0x486f9f(0x203)]['updated']+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x18a)][_0x486f9f(0x1ae)]+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1b5)][_0x486f9f(0x1ae)]+_0x5d296d['counts'][_0x486f9f(0x1f9)]['updated']+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1db)][_0x486f9f(0x1ae)]+_0x5d296d['counts'][_0x486f9f(0x234)][_0x486f9f(0x1ae)],_0x1bcf5f=_0x5d296d['counts'][_0x486f9f(0x1cb)][_0x486f9f(0x21f)]+_0x5d296d[_0x486f9f(0x238)]['knowledgeBases'][_0x486f9f(0x21f)]+_0x5d296d['counts'][_0x486f9f(0x18a)][_0x486f9f(0x21f)]+_0x5d296d['counts'][_0x486f9f(0x1b5)][_0x486f9f(0x21f)]+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1f9)]['unchanged']+_0x5d296d['counts']['experimentalKnowledgeBases']['unchanged']+_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x234)][_0x486f9f(0x21f)];console[_0x486f9f(0x1de)](_0x486f9f(0x1d9)+_0x5d296d[_0x486f9f(0x233)]+'\x27:'),console[_0x486f9f(0x1de)]('\x20\x20'+a4_0x523d8d[_0x486f9f(0x1b0)]('+\x20'+_0x28888a+'\x20new')+_0x486f9f(0x1b8)+a4_0x523d8d[_0x486f9f(0x22b)]('~\x20'+_0x41fe02+_0x486f9f(0x1d8))+_0x486f9f(0x1b8)+a4_0x523d8d['dim']('=\x20'+_0x1bcf5f+_0x486f9f(0x1ba))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1cb)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d296d[_0x486f9f(0x238)]['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x18a)])),console[_0x486f9f(0x1de)](_0x486f9f(0x1d0)+formatCountSummary(_0x5d296d['counts'][_0x486f9f(0x1b5)])),console[_0x486f9f(0x1de)](_0x486f9f(0x226)+formatCountSummary(_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1f9)]));const _0x4411e0=_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x1db)][_0x486f9f(0x1b1)]>0x0||_0x5d296d['counts'][_0x486f9f(0x1db)][_0x486f9f(0x1ae)]>0x0||_0x5d296d['counts'][_0x486f9f(0x1db)][_0x486f9f(0x21f)]>0x0||_0x5d296d['counts'][_0x486f9f(0x234)]['created']>0x0||_0x5d296d['counts'][_0x486f9f(0x234)][_0x486f9f(0x1ae)]>0x0||_0x5d296d[_0x486f9f(0x238)][_0x486f9f(0x234)][_0x486f9f(0x21f)]>0x0;_0x4411e0&&(console['log'](_0x486f9f(0x1f6)+formatCountSummary(_0x5d296d[_0x486f9f(0x238)]['experimentalKnowledgeBases'])),console[_0x486f9f(0x1de)](_0x486f9f(0x206)+formatCountSummary(_0x5d296d['counts'][_0x486f9f(0x234)])));console[_0x486f9f(0x1de)](_0x486f9f(0x200)+a4_0x523d8d['cyan'](_0x3a71d2)),displayDiffs(_0x5d296d[_0x486f9f(0x1cb)],_0x5d296d[_0x486f9f(0x203)],_0x5d296d[_0x486f9f(0x18a)],_0x5d296d[_0x486f9f(0x1b5)],_0x5d296d[_0x486f9f(0x1f9)],_0x5d296d[_0x486f9f(0x1db)],_0x5d296d[_0x486f9f(0x234)]);if(_0xa026b9)return console['log'](a4_0x523d8d['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x28888a===0x0&&_0x41fe02===0x0){console['log'](a4_0x523d8d[_0x486f9f(0x1b0)](_0x486f9f(0x220)));const _0x14108a=getLLMProjectUrl(_0x407065,_0x5d296d['projectId']);return console['log'](_0x486f9f(0x1ca)+a4_0x523d8d['cyan'](_0x14108a)),0x0;}if(!_0x400fb1&&!_0x2d8378){if(!isInteractive())return console[_0x486f9f(0x1fe)](a4_0x523d8d[_0x486f9f(0x1eb)](_0x486f9f(0x1c2)),_0x486f9f(0x1c7)),console['error'](a4_0x523d8d['dim'](_0x486f9f(0x21c))),0x1;const _0x1b3f90=await confirmKey('\x0aPush\x20'+(_0x28888a+_0x41fe02)+_0x486f9f(0x1aa));if(!_0x1b3f90)return console['log'](a4_0x523d8d[_0x486f9f(0x22b)](_0x486f9f(0x1d2)),_0x486f9f(0x198)),0x1;}const {data:_0xdd2fa1}=await withSpinner(_0x486f9f(0x19e),()=>_0x239742[_0x486f9f(0x21d)][_0x486f9f(0x1bb)](_0x3a71d2,{'force':_0x2d8378})),_0x5ae270=_0xdd2fa1[_0x486f9f(0x238)][_0x486f9f(0x1cb)][_0x486f9f(0x21b)]>0x0||_0xdd2fa1[_0x486f9f(0x238)][_0x486f9f(0x203)]['errors']>0x0||_0xdd2fa1[_0x486f9f(0x238)][_0x486f9f(0x18a)][_0x486f9f(0x21b)]>0x0||_0xdd2fa1[_0x486f9f(0x238)][_0x486f9f(0x1b5)][_0x486f9f(0x21b)]>0x0;if(_0x5ae270){console[_0x486f9f(0x1de)](a4_0x523d8d[_0x486f9f(0x22b)](_0x486f9f(0x18b))),console[_0x486f9f(0x1de)](),console[_0x486f9f(0x1de)](a4_0x523d8d['red']('Errors:'));for(const _0x1f0ef5 of _0xdd2fa1['agents']){_0x1f0ef5[_0x486f9f(0x22e)]===_0x486f9f(0x1fe)&&console['log'](a4_0x523d8d[_0x486f9f(0x1eb)]('\x20\x20Agent\x20\x22'+_0x1f0ef5[_0x486f9f(0x1dd)]+_0x486f9f(0x1e3)+_0x1f0ef5[_0x486f9f(0x1fe)]));}for(const _0x544f4a of _0xdd2fa1[_0x486f9f(0x203)]){_0x544f4a[_0x486f9f(0x22e)]===_0x486f9f(0x1fe)&&console[_0x486f9f(0x1de)](a4_0x523d8d[_0x486f9f(0x1eb)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x544f4a[_0x486f9f(0x191)]+_0x486f9f(0x1e3)+_0x544f4a[_0x486f9f(0x1fe)]));}for(const _0xa9ff23 of _0xdd2fa1[_0x486f9f(0x18a)]){_0xa9ff23[_0x486f9f(0x22e)]==='error'&&console['log'](a4_0x523d8d[_0x486f9f(0x1eb)](_0x486f9f(0x19d)+_0xa9ff23[_0x486f9f(0x191)]+_0x486f9f(0x1e3)+_0xa9ff23['error']));}for(const _0x275c46 of _0xdd2fa1['prompts']){_0x275c46['action']===_0x486f9f(0x1fe)&&console['log'](a4_0x523d8d[_0x486f9f(0x1eb)](_0x486f9f(0x219)+_0x275c46[_0x486f9f(0x191)]+'\x22:\x20'+_0x275c46['error']));}for(const _0x344718 of _0xdd2fa1['integrations']){_0x344718['action']===_0x486f9f(0x1fe)&&console[_0x486f9f(0x1de)](a4_0x523d8d[_0x486f9f(0x1eb)](_0x486f9f(0x1fc)+_0x344718[_0x486f9f(0x191)]+_0x486f9f(0x1e3)+_0x344718[_0x486f9f(0x1fe)]));}return 0x1;}console['log'](a4_0x523d8d[_0x486f9f(0x1b0)](_0x486f9f(0x1ce)+(_0x28888a+_0x41fe02)+_0x486f9f(0x228)+_0xdd2fa1[_0x486f9f(0x233)]+'\x27'));const _0x5ce55a=getLLMProjectUrl(_0x407065,_0xdd2fa1[_0x486f9f(0x222)]);return console[_0x486f9f(0x1de)](_0x486f9f(0x1ca)+a4_0x523d8d[_0x486f9f(0x1f0)](_0x5ce55a)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x47d17d=a5_0x30ad;(function(_0x4e6c8a,_0x2c2aed){const _0x23c632=a5_0x30ad,_0x28d395=_0x4e6c8a();while(!![]){try{const _0x3f86df=-parseInt(_0x23c632(0x230))/0x1*(-parseInt(_0x23c632(0x222))/0x2)+parseInt(_0x23c632(0x1ef))/0x3+parseInt(_0x23c632(0x257))/0x4*(parseInt(_0x23c632(0x23a))/0x5)+-parseInt(_0x23c632(0x1d7))/0x6+-parseInt(_0x23c632(0x207))/0x7+-parseInt(_0x23c632(0x1dd))/0x8+parseInt(_0x23c632(0x266))/0x9;if(_0x3f86df===_0x2c2aed)break;else _0x28d395['push'](_0x28d395['shift']());}catch(_0x1d7544){_0x28d395['push'](_0x28d395['shift']());}}}(a5_0xfe96,0xb0b9c));import*as a5_0x3baeb1 from'node:fs';import*as a5_0x39557c from'node:path';import a5_0x32ce2e from'chalk';import{BaseCommand}from'./command.js';function a5_0xfe96(){const _0x4754df=['No\x20tests\x20have\x20tags\x20defined.','Evaluating\x20response...','404','multiple_agents','llmProject','Duration:\x20','6FCuVDo','projectDir','testName','has','name','tests','Available\x20tests:\x20','\x20\x20Round\x20','writeFileSync','Site:\x20','map','✓\x20PASS:\x20','repeat','testYmlPath','60077mGRYpP','llm','eval','resolveProjectId','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Tests\x20found:\x20','log','reeval','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Running:\x20','5691815avUkPq','execute','\x20(cached)','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Failed:\x20\x20\x20','forEach','status','dryRun','\x20\x20Project:\x20','\x20\x20-\x20','includes','test.yml','Re-evaluating...','✗\x20ERROR:\x20','executeReeval','push','\x22:\x20','green','\x20\x20Agent:\x20',':\x20Sending\x20user\x20input...','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','projectName','output','start','\x20-\x20','now','rounds','Error\x20writing\x20output\x20file:\x20','jsonl','4uSNJGd','white','/<agent-name>','agentDirs','agent','FAIL','Round\x20','Project\x20path:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','agentName','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','context','ERROR','17099865cowFkb','Passed:\x20\x20\x20','reason','Either\x20switch\x20to\x20the\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','Conversation\x20URL:\x20','\x20(new)','message','Re-evaluating\x20','find','join','dim','5060706QpczmK','Available\x20tags:\x20','red','Output\x20written\x20to:\x20','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','9824312VOduJt','Re-evaluation\x20Summary','\x20\x20Site:\x20','Agent:\x20','text','Errors:\x20\x20\x20','✗\x20FAIL:\x20','Running\x20test:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','resolve','...','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','split','verbose','Test\x20Summary','Round\x201/','site','737400Ocfmyp','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','not\x20found','yellow','Running\x20agent\x20tests...','some','\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','conversation_url','found','json','toISOString','New\x20tests\x20to\x20execute:\x20','length','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...\x20','no_context','cyan','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','size','stop','Failed\x20Tests:','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_local_folder','toLowerCase','4683147gqrfNj','\x20\x20Conversation:\x20','substring','tags','Error:\x20No\x20previous\x20test\x20run\x20found.','add','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','PASS','round','Cached\x20run\x20is\x20from\x20site\x20\x22','agent:test','filter','trim','resolveAgentId','description','Executing\x20new\x20tests...','tsv','Total:\x20\x20\x20\x20','table','source','Using\x20agent:\x20'];a5_0xfe96=function(){return _0x4754df;};return a5_0xfe96();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x30ad(_0x226f4e,_0x10b3e1){_0x226f4e=_0x226f4e-0x1d1;const _0xfe96d1=a5_0xfe96();let _0x30ad2e=_0xfe96d1[_0x226f4e];return _0x30ad2e;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x47d17d(0x211);[a5_0x47d17d(0x215)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x47d17d(0x23b)](_0x1e3d50){const _0x498abf=a5_0x47d17d,{options:_0x93395b,args:_0x3e7ad5,tdx:_0x507d21}=_0x1e3d50,_0x36676c=_0x3e7ad5[0x0]||'.',_0x275aa7=_0x93395b[_0x498abf(0x241)],_0x50ff84=_0x93395b,_0x3371ae=_0x50ff84[_0x498abf(0x232)]===![],_0x2bd6ba=_0x50ff84[_0x498abf(0x237)],_0x4375d3=_0x50ff84[_0x498abf(0x226)],_0x55b139=_0x50ff84['tags'],_0xb25139=_0x93395b['site'],_0x2d91bb=_0x50ff84[_0x498abf(0x250)];if(_0x2bd6ba&&_0x3371ae)return console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3dfcc9=_0x498abf(0x219);if(_0x50ff84['json'])_0x3dfcc9=_0x498abf(0x1f8);else{if(_0x50ff84[_0x498abf(0x256)])_0x3dfcc9=_0x498abf(0x256);else{if(_0x50ff84[_0x498abf(0x217)])_0x3dfcc9=_0x498abf(0x217);else{if(_0x50ff84[_0x498abf(0x219)])_0x3dfcc9=_0x498abf(0x219);}}}const _0x5ed81d=_0x50ff84[_0x498abf(0x220)];let _0x40e361=_0x36676c;const _0x223745=a5_0x3baeb1['existsSync'](_0x36676c),_0x5e582=_0x36676c==='.';if(!_0x223745||_0x5e582){const _0x143d35=resolveProjectFromContext(_0x36676c,_0x5ed81d,{'requireFile':_0x498abf(0x245)});if(_0x143d35[_0x498abf(0x1f7)])_0x40e361=_0x143d35[_0x498abf(0x223)],_0x143d35[_0x498abf(0x21a)]===_0x498abf(0x264)&&console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x21b)+_0x40e361));else switch(_0x143d35[_0x498abf(0x268)]){case _0x498abf(0x1fe):console['log'](a5_0x32ce2e[_0x498abf(0x1f2)](_0x143d35['message'])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)]('Usage:'),console['log'](_0x498abf(0x1f5)),console[_0x498abf(0x236)](_0x498abf(0x1e5)),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x23d));return 0x1;case _0x498abf(0x205):console[_0x498abf(0x236)](a5_0x32ce2e['yellow'](_0x143d35[_0x498abf(0x1d2)])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x261)+_0x143d35[_0x498abf(0x220)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x498abf(0x21f):{const _0x4a5e1f=a5_0x39557c['basename'](_0x143d35[_0x498abf(0x223)]);console['log'](a5_0x32ce2e[_0x498abf(0x1f2)](_0x498abf(0x1e8)+_0x143d35[_0x498abf(0x220)]+'\x22:'));for(const _0x35ef62 of _0x143d35[_0x498abf(0x25a)]){console[_0x498abf(0x236)](_0x498abf(0x243)+_0x35ef62);}return console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x20d)+_0x4a5e1f+_0x498abf(0x259)),0x1;}case'no_tests':console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1f2)](_0x498abf(0x24e)+_0x143d35['llmProject']+'\x22.')),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x25e)+_0x143d35['projectDir'])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x238));return 0x1;}}const {definition:_0x1960a7,agentInfo:_0x4d19e2}=parseTestFile(_0x40e361);let _0x53837e=_0x1960a7[_0x498abf(0x227)];if(_0x4375d3){const _0x32ae1e=_0x4375d3[_0x498abf(0x1ea)](',')[_0x498abf(0x22c)](_0x4e050a=>_0x4e050a[_0x498abf(0x213)]());_0x53837e=_0x1960a7[_0x498abf(0x227)][_0x498abf(0x212)](_0x163ddd=>_0x32ae1e[_0x498abf(0x244)](_0x163ddd['name']));if(_0x53837e['length']===0x0)return console[_0x498abf(0x236)](a5_0x32ce2e['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x4375d3)),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x228)+_0x1960a7[_0x498abf(0x227)][_0x498abf(0x22c)](_0x4b0199=>_0x4b0199['name'])['join'](',\x20'))),0x1;}if(_0x55b139){const _0x574622=_0x55b139['split'](',')[_0x498abf(0x22c)](_0x207fb9=>_0x207fb9[_0x498abf(0x213)]()[_0x498abf(0x206)]());_0x53837e=_0x53837e[_0x498abf(0x212)](_0x16a9de=>_0x16a9de[_0x498abf(0x20a)]?.[_0x498abf(0x1f4)](_0x5ea4c8=>_0x574622[_0x498abf(0x244)](_0x5ea4c8['toLowerCase']())));if(_0x53837e[_0x498abf(0x1fb)]===0x0){console[_0x498abf(0x236)](a5_0x32ce2e['yellow'](_0x498abf(0x26b)+_0x55b139));const _0x1e520c=new Set();return _0x1960a7['tests']['forEach'](_0x3ff392=>_0x3ff392[_0x498abf(0x20a)]?.[_0x498abf(0x23f)](_0x5165c7=>_0x1e520c[_0x498abf(0x20c)](_0x5165c7))),_0x1e520c[_0x498abf(0x201)]>0x0?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x1d8)+[..._0x1e520c][_0x498abf(0x1d5)](',\x20'))):console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x21c))),0x1;}}if(_0x2bd6ba)return this[_0x498abf(0x248)](_0x1e3d50,{'definition':{'tests':_0x53837e},'agentInfo':_0x4d19e2,'outputFormat':_0x3dfcc9,'outputFile':_0x2d91bb,'testNames':_0x4375d3});if(_0x275aa7){console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1ff)]('Test\x20Configuration:')),console[_0x498abf(0x236)](_0x498abf(0x1df)+a5_0x32ce2e[_0x498abf(0x258)](_0xb25139)),console[_0x498abf(0x236)](_0x498abf(0x242)+a5_0x32ce2e[_0x498abf(0x258)](_0x4d19e2[_0x498abf(0x24f)])),console[_0x498abf(0x236)](_0x498abf(0x24c)+a5_0x32ce2e['white'](_0x4d19e2[_0x498abf(0x260)])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x235)+a5_0x32ce2e[_0x498abf(0x258)](_0x53837e['length']));for(let _0x222d54=0x0;_0x222d54<_0x53837e[_0x498abf(0x1fb)];_0x222d54++){const _0x72d836=_0x53837e[_0x222d54],_0x4fa7f1=_0x72d836[_0x498abf(0x254)][_0x498abf(0x1fb)]===0x1?_0x498abf(0x20f):_0x498abf(0x254),_0x2763fa=_0x72d836[_0x498abf(0x20a)]?.[_0x498abf(0x1fb)]?'\x20['+_0x72d836['tags']['join'](',\x20')+']':'';console[_0x498abf(0x236)]('\x20\x20'+(_0x222d54+0x1)+'.\x20'+a5_0x32ce2e['white'](_0x72d836[_0x498abf(0x226)])+'\x20('+_0x72d836[_0x498abf(0x254)][_0x498abf(0x1fb)]+'\x20'+_0x4fa7f1+')'+a5_0x32ce2e['dim'](_0x2763fa));}return 0x0;}let _0x491b8d,_0xe9ce0a;try{_0x491b8d=await _0x507d21[_0x498abf(0x231)][_0x498abf(0x233)](_0x4d19e2[_0x498abf(0x24f)]);}catch(_0x439583){const _0x3bb6a5=_0x439583 instanceof Error?_0x439583[_0x498abf(0x1d2)]:String(_0x439583);return _0x3bb6a5[_0x498abf(0x244)](_0x498abf(0x21e))||_0x3bb6a5[_0x498abf(0x206)]()[_0x498abf(0x244)](_0x498abf(0x1f1))?console['log'](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1dc)+_0x4d19e2[_0x498abf(0x24f)])):console['log'](a5_0x32ce2e['red'](_0x498abf(0x263)+_0x4d19e2[_0x498abf(0x24f)]+_0x498abf(0x24a)+_0x3bb6a5)),0x1;}try{_0xe9ce0a=await _0x507d21[_0x498abf(0x231)][_0x498abf(0x214)](_0x4d19e2[_0x498abf(0x260)],_0x491b8d);}catch(_0x2fb472){const _0x52a618=_0x2fb472 instanceof Error?_0x2fb472[_0x498abf(0x1d2)]:String(_0x2fb472);return _0x52a618[_0x498abf(0x244)](_0x498abf(0x21e))||_0x52a618['toLowerCase']()['includes'](_0x498abf(0x1f1))?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1fc)+_0x4d19e2[_0x498abf(0x260)])):console['log'](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x26a)+_0x4d19e2[_0x498abf(0x260)]+_0x498abf(0x24a)+_0x52a618)),0x1;}let _0x27cac9;if(!_0x3371ae)try{_0x27cac9=await setupEvaluatorAgent(_0x507d21[_0x498abf(0x231)],_0x93395b[_0x498abf(0x1eb)]);}catch(_0xf47f80){const _0x5adfc2=_0xf47f80 instanceof Error?_0xf47f80[_0x498abf(0x1d2)]:String(_0xf47f80);return console[_0x498abf(0x236)](a5_0x32ce2e['red'](_0x498abf(0x1f0)+_0x5adfc2)),0x1;}console[_0x498abf(0x236)](a5_0x32ce2e['cyan'](_0x498abf(0x1f3))),console[_0x498abf(0x236)](_0x498abf(0x22b)+a5_0x32ce2e[_0x498abf(0x258)](_0xb25139)),console['log'](_0x498abf(0x1e0)+a5_0x32ce2e[_0x498abf(0x258)](_0x4d19e2[_0x498abf(0x24f)]+'/'+_0x4d19e2[_0x498abf(0x260)])),console[_0x498abf(0x236)]();const _0x3a2f1f=[],_0x1c3974=[],_0x865854=Date[_0x498abf(0x253)]();for(let _0x46e4ad=0x0;_0x46e4ad<_0x53837e[_0x498abf(0x1fb)];_0x46e4ad++){const _0x2369a0=_0x53837e[_0x46e4ad];_0x53837e[_0x498abf(0x1fb)]>0x1?console[_0x498abf(0x236)]('Test\x20'+(_0x46e4ad+0x1)+'/'+_0x53837e[_0x498abf(0x1fb)]+':\x20'+a5_0x32ce2e['white'](_0x2369a0[_0x498abf(0x226)])):console[_0x498abf(0x236)](_0x498abf(0x1e4)+a5_0x32ce2e[_0x498abf(0x258)](_0x2369a0[_0x498abf(0x226)]));const _0x8a5a44=createCommandSpinner(_0x498abf(0x1ed)+_0x2369a0[_0x498abf(0x254)][_0x498abf(0x1fb)]+_0x498abf(0x24d));_0x8a5a44[_0x498abf(0x251)]();try{const {result:_0x2977dd,conversation:_0x199a9e}=await runTest(_0x507d21[_0x498abf(0x231)],_0x2369a0,{'agentId':_0xe9ce0a,'projectId':_0x491b8d,'site':_0xb25139,'noEval':_0x3371ae,'evaluatorId':_0x27cac9,'onRoundStart':(_0x14b73e,_0x2563c4)=>{const _0x4a72d7=_0x498abf;_0x8a5a44[_0x4a72d7(0x1e1)]=_0x4a72d7(0x25d)+(_0x14b73e+0x1)+'/'+_0x2563c4+_0x4a72d7(0x24d);},'onRoundComplete':(_0x29f382,_0x4cd42e,_0x5ceb0f)=>{const _0x23813f=_0x498abf,_0x49507b=formatElapsed(_0x4cd42e);_0x5ceb0f?console[_0x23813f(0x236)](_0x23813f(0x229)+(_0x29f382+0x1)+'/'+_0x2369a0[_0x23813f(0x254)][_0x23813f(0x1fb)]+'...\x20'+a5_0x32ce2e['green']('✓')+'\x20('+_0x49507b+')'):console[_0x23813f(0x236)](_0x23813f(0x229)+(_0x29f382+0x1)+'/'+_0x2369a0[_0x23813f(0x254)]['length']+'...\x20'+a5_0x32ce2e[_0x23813f(0x1d9)]('✗'));},'onEvaluationStart':()=>{const _0x2f9351=_0x498abf;_0x8a5a44['text']=_0x2f9351(0x21d);},'onEvaluationComplete':_0x19adc4=>{const _0x347221=_0x498abf,_0x261e04=formatElapsed(_0x19adc4);console[_0x347221(0x236)](_0x347221(0x1db)+a5_0x32ce2e[_0x347221(0x24b)]('✓')+'\x20('+_0x261e04+')');}});_0x8a5a44[_0x498abf(0x202)](),_0x3a2f1f[_0x498abf(0x249)](_0x2977dd),_0x1c3974[_0x498abf(0x249)](_0x199a9e);if(_0x2977dd[_0x498abf(0x240)]===_0x498abf(0x20e))console[_0x498abf(0x236)](a5_0x32ce2e['green']('✓\x20PASS:\x20'+_0x2977dd[_0x498abf(0x268)]));else _0x2977dd[_0x498abf(0x240)]===_0x498abf(0x25c)?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1e3)+_0x2977dd[_0x498abf(0x268)])):console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x247)+_0x2977dd['reason']));_0x2977dd[_0x498abf(0x1f6)]&&console[_0x498abf(0x236)](a5_0x32ce2e['dim'](_0x498abf(0x26c)+_0x2977dd[_0x498abf(0x1f6)])),console['log']();}catch(_0x19e6eb){_0x8a5a44[_0x498abf(0x202)]();const _0x958c74=_0x19e6eb instanceof Error?_0x19e6eb[_0x498abf(0x1d2)]:String(_0x19e6eb);console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x247)+_0x958c74)),console[_0x498abf(0x236)](),_0x3a2f1f['push']({'name':_0x2369a0['name'],'status':'ERROR','reason':_0x958c74,'timestamp':new Date()[_0x498abf(0x1f9)](),'duration_ms':0x0});}}const _0xcd3c7f=Date[_0x498abf(0x253)]()-_0x865854,_0x58a2c6=_0x3a2f1f['filter'](_0x119535=>_0x119535['status']==='PASS')[_0x498abf(0x1fb)],_0x45197a=_0x3a2f1f[_0x498abf(0x212)](_0x4d954d=>_0x4d954d[_0x498abf(0x240)]===_0x498abf(0x25c))['length'],_0x210d47=_0x3a2f1f[_0x498abf(0x212)](_0x51d9b6=>_0x51d9b6[_0x498abf(0x240)]===_0x498abf(0x265))['length'];console[_0x498abf(0x236)]('━'[_0x498abf(0x22e)](0x3c)),console[_0x498abf(0x236)](_0x498abf(0x1ec)),console['log']('━'['repeat'](0x3c)),console[_0x498abf(0x236)](_0x498abf(0x218)+_0x3a2f1f[_0x498abf(0x1fb)]),console['log'](_0x498abf(0x267)+a5_0x32ce2e[_0x498abf(0x24b)](_0x58a2c6)),console[_0x498abf(0x236)](_0x498abf(0x23e)+a5_0x32ce2e[_0x498abf(0x1d9)](_0x45197a));_0x210d47>0x0&&console[_0x498abf(0x236)](_0x498abf(0x1e2)+a5_0x32ce2e['red'](_0x210d47));console[_0x498abf(0x236)](_0x498abf(0x221)+formatElapsed(_0xcd3c7f)),console[_0x498abf(0x236)]('━'['repeat'](0x3c));const _0x404eff=_0x3a2f1f[_0x498abf(0x212)](_0x5965ed=>_0x5965ed[_0x498abf(0x240)]!==_0x498abf(0x20e));if(_0x404eff[_0x498abf(0x1fb)]>0x0){console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x203));for(const _0x2738fa of _0x404eff){const _0x479659=a5_0x32ce2e[_0x498abf(0x1d9)]('✗'),_0x4456a7=_0x2738fa[_0x498abf(0x268)][_0x498abf(0x1fb)]>0x32?_0x2738fa[_0x498abf(0x268)][_0x498abf(0x209)](0x0,0x32)+_0x498abf(0x1e7):_0x2738fa[_0x498abf(0x268)];console['log']('\x20\x20'+_0x479659+'\x20'+_0x2738fa[_0x498abf(0x226)]+':\x20'+_0x4456a7);}}const _0xc6822b={'summary':{'total':_0x3a2f1f[_0x498abf(0x1fb)],'passed':_0x58a2c6,'failed':_0x45197a,'errors':_0x210d47>0x0?_0x210d47:undefined,'duration_ms':_0xcd3c7f},'tests':_0x3a2f1f,'agent':{'project':_0x4d19e2['projectName'],'name':_0x4d19e2[_0x498abf(0x260)],'site':_0xb25139},'timestamp':new Date(_0x865854)[_0x498abf(0x1f9)]()};try{const _0x2d0fe3=buildCachedTestRun(_0x1c3974,{'site':_0xb25139,'projectId':_0x491b8d,'projectName':_0x4d19e2[_0x498abf(0x24f)],'agentId':_0xe9ce0a,'agentName':_0x4d19e2['agentName'],'testYmlPath':a5_0x39557c[_0x498abf(0x1e6)](_0x4d19e2[_0x498abf(0x22f)])});saveLastTestRun(_0x2d0fe3);}catch{}if(_0x3dfcc9!==_0x498abf(0x219)||_0x2d91bb){const _0x48bdeb=formatResults(_0xc6822b,_0x3dfcc9);if(_0x2d91bb)try{a5_0x3baeb1['writeFileSync'](_0x2d91bb,_0x48bdeb,'utf-8'),console['log'](),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x1da)+_0x2d91bb));}catch(_0x3bb1bc){return console[_0x498abf(0x236)](),console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x255)+_0x3bb1bc)),0x1;}else console['log'](),console['log'](_0x48bdeb);}return _0x404eff[_0x498abf(0x1fb)]>0x0?0x1:0x0;}async[a5_0x47d17d(0x248)](_0x47e6df,_0x36b4ed){const _0x445cb6=a5_0x47d17d,{options:_0x5a2c2c,tdx:_0x3b71a0}=_0x47e6df,{definition:_0x1457fc,agentInfo:_0x2ed787,outputFormat:_0x1b34b4,outputFile:_0x48249d}=_0x36b4ed,_0x1594f4=_0x5a2c2c[_0x445cb6(0x1ee)],_0x14354f=loadLastTestRun();if(!_0x14354f)return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x20b))),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x14354f[_0x445cb6(0x25b)][_0x445cb6(0x260)]!==_0x2ed787[_0x445cb6(0x260)])return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x262)+_0x14354f[_0x445cb6(0x25b)][_0x445cb6(0x260)]+_0x445cb6(0x234)+_0x2ed787['agentName']+'\x22.')),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x200))),0x1;const _0x1def45=new Set(_0x14354f['conversations']['map'](_0x3eb91e=>_0x3eb91e[_0x445cb6(0x224)])),_0x404116=_0x1457fc[_0x445cb6(0x227)][_0x445cb6(0x212)](_0x18e6c8=>!_0x1def45['has'](_0x18e6c8[_0x445cb6(0x226)]));if(_0x404116[_0x445cb6(0x1fb)]>0x0&&_0x14354f[_0x445cb6(0x1ee)]!==_0x1594f4)return console['log'](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x204))),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x210)+_0x14354f[_0x445cb6(0x1ee)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1594f4+'\x22.')),console[_0x445cb6(0x236)](a5_0x32ce2e['dim'](_0x445cb6(0x269)+_0x14354f[_0x445cb6(0x1ee)]+_0x445cb6(0x1e9))),0x1;const _0x32b86e=_0x1457fc[_0x445cb6(0x227)]['filter'](_0x538fad=>_0x1def45[_0x445cb6(0x225)](_0x538fad[_0x445cb6(0x226)])),_0x309d3e=_0x404116;let _0x498dbb;try{_0x498dbb=await setupEvaluatorAgent(_0x3b71a0['llm'],_0x5a2c2c['verbose']);}catch(_0x23e879){const _0x53f45c=_0x23e879 instanceof Error?_0x23e879['message']:String(_0x23e879);return console[_0x445cb6(0x236)](a5_0x32ce2e['red'](_0x445cb6(0x1f0)+_0x53f45c)),0x1;}console['log'](a5_0x32ce2e[_0x445cb6(0x1ff)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x32ce2e[_0x445cb6(0x258)](_0x14354f['timestamp'])),console[_0x445cb6(0x236)](_0x445cb6(0x1e0)+a5_0x32ce2e[_0x445cb6(0x258)](_0x14354f['agent'][_0x445cb6(0x24f)]+'/'+_0x14354f['agent'][_0x445cb6(0x260)]));_0x309d3e['length']>0x0&&console['log'](_0x445cb6(0x1fa)+a5_0x32ce2e['yellow'](_0x309d3e[_0x445cb6(0x1fb)]));console[_0x445cb6(0x236)]();const _0x58e204=[],_0xd717d5=Date['now'](),_0x1822c1=createCommandSpinner(_0x445cb6(0x246));if(_0x32b86e[_0x445cb6(0x1fb)]>0x0)try{const _0x8e6c1a=await reevaluateFromCache(_0x3b71a0[_0x445cb6(0x231)],_0x14354f,{'tests':_0x32b86e},{'evaluatorId':_0x498dbb,'onTestStart':(_0x87a367,_0x2b0db6,_0x3b72ba)=>{const _0x4064cb=_0x445cb6;_0x1822c1['text']=_0x4064cb(0x1d3)+(_0x2b0db6+0x1)+'/'+_0x3b72ba+':\x20'+_0x87a367+'...';if(!_0x1822c1['isSpinning'])_0x1822c1[_0x4064cb(0x251)]();},'onTestComplete':(_0x2af094,_0x460253)=>{const _0x3093ee=_0x445cb6;_0x1822c1[_0x3093ee(0x202)]();if(_0x460253['status']===_0x3093ee(0x20e))console[_0x3093ee(0x236)](a5_0x32ce2e[_0x3093ee(0x24b)](_0x3093ee(0x22d)+_0x2af094)+a5_0x32ce2e[_0x3093ee(0x1d6)](_0x3093ee(0x23c)));else _0x460253['status']===_0x3093ee(0x25c)?console[_0x3093ee(0x236)](a5_0x32ce2e['red'](_0x3093ee(0x1e3)+_0x2af094+_0x3093ee(0x252)+_0x460253[_0x3093ee(0x268)])+a5_0x32ce2e['dim'](_0x3093ee(0x23c))):console['log'](a5_0x32ce2e[_0x3093ee(0x1d9)]('✗\x20ERROR:\x20'+_0x2af094+'\x20-\x20'+_0x460253[_0x3093ee(0x268)]));_0x460253[_0x3093ee(0x1f6)]&&console[_0x3093ee(0x236)](a5_0x32ce2e['dim'](_0x3093ee(0x208)+_0x460253[_0x3093ee(0x1f6)])),_0x58e204['push'](_0x460253);},'onTestSkipped':(_0x1be6fe,_0x17e5ea)=>{const _0xbb5252=_0x445cb6;_0x1822c1[_0xbb5252(0x202)](),console[_0xbb5252(0x236)](a5_0x32ce2e['yellow']('⚠\x20SKIPPED:\x20'+_0x1be6fe+'\x20-\x20'+_0x17e5ea));}});for(const _0x32ba2d of _0x8e6c1a){!_0x58e204[_0x445cb6(0x1d4)](_0x3bf75f=>_0x3bf75f[_0x445cb6(0x226)]===_0x32ba2d[_0x445cb6(0x226)])&&_0x58e204['push'](_0x32ba2d);}}catch(_0x268fc3){_0x1822c1[_0x445cb6(0x202)]();const _0xb6e2da=_0x268fc3 instanceof Error?_0x268fc3['message']:String(_0x268fc3);return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x25f)+_0xb6e2da)),0x1;}_0x1822c1[_0x445cb6(0x202)]();if(_0x309d3e['length']>0x0){console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1ff)](_0x445cb6(0x216)));const {projectId:_0x555f4f,agentId:_0x440240}=_0x14354f[_0x445cb6(0x25b)];for(const _0x2f96b3 of _0x309d3e){console[_0x445cb6(0x236)](_0x445cb6(0x239)+a5_0x32ce2e['white'](_0x2f96b3[_0x445cb6(0x226)]));const _0x37649e=createCommandSpinner(_0x445cb6(0x1ed)+_0x2f96b3[_0x445cb6(0x254)][_0x445cb6(0x1fb)]+_0x445cb6(0x24d));_0x37649e[_0x445cb6(0x251)]();try{const {result:_0xfa277d}=await runTest(_0x3b71a0[_0x445cb6(0x231)],_0x2f96b3,{'agentId':_0x440240,'projectId':_0x555f4f,'site':_0x14354f[_0x445cb6(0x1ee)],'noEval':![],'evaluatorId':_0x498dbb,'onRoundStart':(_0x232b42,_0x50b8a8)=>{const _0x3ab2e1=_0x445cb6;_0x37649e[_0x3ab2e1(0x1e1)]='Round\x20'+(_0x232b42+0x1)+'/'+_0x50b8a8+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x10707b,_0x105dc5,_0x2b27fa)=>{const _0x3dbefe=_0x445cb6,_0x303e93=formatElapsed(_0x105dc5);_0x2b27fa?console[_0x3dbefe(0x236)](_0x3dbefe(0x229)+(_0x10707b+0x1)+'/'+_0x2f96b3[_0x3dbefe(0x254)][_0x3dbefe(0x1fb)]+_0x3dbefe(0x1fd)+a5_0x32ce2e['green']('✓')+'\x20('+_0x303e93+')'):console[_0x3dbefe(0x236)](_0x3dbefe(0x229)+(_0x10707b+0x1)+'/'+_0x2f96b3[_0x3dbefe(0x254)]['length']+'...\x20'+a5_0x32ce2e[_0x3dbefe(0x1d9)]('✗'));},'onEvaluationStart':()=>{const _0x391e01=_0x445cb6;_0x37649e[_0x391e01(0x1e1)]='Evaluating\x20response...';},'onEvaluationComplete':_0x313feb=>{const _0x37b388=_0x445cb6,_0x5512fa=formatElapsed(_0x313feb);console['log'](_0x37b388(0x1db)+a5_0x32ce2e[_0x37b388(0x24b)]('✓')+'\x20('+_0x5512fa+')');}});_0x37649e['stop'](),_0x58e204[_0x445cb6(0x249)](_0xfa277d);if(_0xfa277d[_0x445cb6(0x240)]==='PASS')console['log'](a5_0x32ce2e[_0x445cb6(0x24b)](_0x445cb6(0x22d)+_0xfa277d[_0x445cb6(0x268)])+a5_0x32ce2e['dim'](_0x445cb6(0x1d1)));else _0xfa277d['status']===_0x445cb6(0x25c)?console['log'](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x1e3)+_0xfa277d[_0x445cb6(0x268)])+a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x1d1))):console['log'](a5_0x32ce2e['red']('✗\x20ERROR:\x20'+_0xfa277d[_0x445cb6(0x268)]));_0xfa277d['conversation_url']&&console['log'](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x208)+_0xfa277d[_0x445cb6(0x1f6)]));}catch(_0x22dd76){_0x37649e['stop']();const _0x1262fd=_0x22dd76 instanceof Error?_0x22dd76[_0x445cb6(0x1d2)]:String(_0x22dd76);console['log'](a5_0x32ce2e['red'](_0x445cb6(0x247)+_0x1262fd)),_0x58e204[_0x445cb6(0x249)]({'name':_0x2f96b3['name'],'status':'ERROR','reason':_0x1262fd,'timestamp':new Date()[_0x445cb6(0x1f9)](),'duration_ms':0x0});}}}console[_0x445cb6(0x236)]();const _0x228ef8=Date[_0x445cb6(0x253)]()-_0xd717d5,_0xefb3fb=_0x58e204['filter'](_0x10ec5b=>_0x10ec5b['status']===_0x445cb6(0x20e))['length'],_0x540994=_0x58e204[_0x445cb6(0x212)](_0x232a62=>_0x232a62[_0x445cb6(0x240)]===_0x445cb6(0x25c))[_0x445cb6(0x1fb)],_0x2f01d0=_0x58e204['filter'](_0x226354=>_0x226354['status']===_0x445cb6(0x265))[_0x445cb6(0x1fb)];console['log']('━'[_0x445cb6(0x22e)](0x3c)),console[_0x445cb6(0x236)](_0x445cb6(0x1de)),console[_0x445cb6(0x236)]('━'['repeat'](0x3c)),console[_0x445cb6(0x236)](_0x445cb6(0x218)+_0x58e204[_0x445cb6(0x1fb)]),console[_0x445cb6(0x236)](_0x445cb6(0x267)+a5_0x32ce2e[_0x445cb6(0x24b)](_0xefb3fb)),console[_0x445cb6(0x236)](_0x445cb6(0x23e)+a5_0x32ce2e[_0x445cb6(0x1d9)](_0x540994));_0x2f01d0>0x0&&console[_0x445cb6(0x236)](_0x445cb6(0x1e2)+a5_0x32ce2e[_0x445cb6(0x1d9)](_0x2f01d0));console[_0x445cb6(0x236)](_0x445cb6(0x221)+formatElapsed(_0x228ef8)),console[_0x445cb6(0x236)]('━'[_0x445cb6(0x22e)](0x3c));const _0x4e1d0c={'summary':{'total':_0x58e204[_0x445cb6(0x1fb)],'passed':_0xefb3fb,'failed':_0x540994,'errors':_0x2f01d0>0x0?_0x2f01d0:undefined,'duration_ms':_0x228ef8},'tests':_0x58e204,'agent':{'project':_0x2ed787[_0x445cb6(0x24f)],'name':_0x2ed787[_0x445cb6(0x260)],'site':_0x1594f4},'timestamp':new Date(_0xd717d5)[_0x445cb6(0x1f9)]()};if(_0x1b34b4!==_0x445cb6(0x219)||_0x48249d){const _0x5c1855=formatResults(_0x4e1d0c,_0x1b34b4);if(_0x48249d)try{a5_0x3baeb1[_0x445cb6(0x22a)](_0x48249d,_0x5c1855,'utf-8'),console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e['dim'](_0x445cb6(0x1da)+_0x48249d));}catch(_0x4f87b6){return console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x255)+_0x4f87b6)),0x1;}else console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](_0x5c1855);}const _0x536dcb=_0x58e204[_0x445cb6(0x212)](_0x1a86d0=>_0x1a86d0[_0x445cb6(0x240)]!=='PASS');return _0x536dcb[_0x445cb6(0x1fb)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x17cf91=a5_0x24c0;function a5_0x407b(){const _0x2fbe6f=['utf-8','Usage:','push','join','tests','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Round\x20','\x20\x20Project:\x20','forEach','⚠\x20SKIPPED:\x20','filter','description','✗\x20ERROR:\x20Project\x20not\x20found:\x20','FAIL','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','...','projectName','name','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','agent','Errors:\x20\x20\x20','10ZmwsHx','tags','reeval','agent:test','\x20\x20Evaluating...\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','stop','substring','244275npsTpY','1047809JcYEdQ','text','4GXOzdZ','toISOString','size','327238LBPzlH','\x22,\x20but\x20current\x20site\x20is\x20\x22','llmProject','start','Error:\x20No\x20previous\x20test\x20run\x20found.','llm','find','Site:\x20','table','Passed:\x20\x20\x20','Agent:\x20','green','15VlHNvo','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','conversation_url','Re-evaluating\x20','ERROR','Re-evaluating...','Conversation\x20URL:\x20','json','102TqADVW','no_tests','24036orpVqt','basename','repeat','96424ZLvwQl','add','9896557SjAnGL','testYmlPath','Test\x20Configuration:','Cached\x20run\x20from:\x20','Total:\x20\x20\x20\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','conversations','\x20\x20Agent:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','yellow','...\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','status','New\x20tests\x20to\x20execute:\x20','Output\x20written\x20to:\x20','projectDir','Either\x20switch\x20to\x20the\x20\x22','jsonl','Project\x20path:\x20','map','\x20(new)','Evaluating\x20response...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','context','cyan','\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)','reason','message','agentDirs','agentName','Error\x20writing\x20output\x20file:\x20','✓\x20PASS:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','writeFileSync','Tests\x20found:\x20','\x20\x20Conversation:\x20','Executing\x20new\x20tests...','✗\x20FAIL:\x20','Failed:\x20\x20\x20','No\x20tests\x20found\x20matching:\x20','toLowerCase','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','resolveAgentId','\x20\x20Round\x20','not\x20found',':\x20Sending\x20user\x20input...','dim','has','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20-\x20','eval','site','Running:\x20','existsSync','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Using\x20agent:\x20','executeReeval','red','179344kSiaZu','✗\x20ERROR:\x20','No\x20tests\x20have\x20tags\x20defined.','white','Test\x20','PASS','90VcgNTy','isSpinning','\x20\x20Site:\x20','log','now','resolve','\x22:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x20(cached)','rounds','output','length','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20-\x20','\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','split','dryRun','Test\x20Summary','no_local_folder','trim','Cached\x20run\x20is\x20from\x20site\x20\x22','includes','some','11453QxagtO','verbose','resolveProjectId','Running\x20test:\x20','testName'];a5_0x407b=function(){return _0x2fbe6f;};return a5_0x407b();}function a5_0x24c0(_0xd31e15,_0x1fa824){_0xd31e15=_0xd31e15-0x79;const _0x407bb5=a5_0x407b();let _0x24c0af=_0x407bb5[_0xd31e15];return _0x24c0af;}(function(_0x165edd,_0x2c3312){const _0x49d7cc=a5_0x24c0,_0x4028a9=_0x165edd();while(!![]){try{const _0x23eb81=-parseInt(_0x49d7cc(0x82))/0x1*(-parseInt(_0x49d7cc(0x7f))/0x2)+-parseInt(_0x49d7cc(0x8e))/0x3*(-parseInt(_0x49d7cc(0xd9))/0x4)+-parseInt(_0x49d7cc(0x7c))/0x5*(parseInt(_0x49d7cc(0x96))/0x6)+-parseInt(_0x49d7cc(0x7d))/0x7+-parseInt(_0x49d7cc(0x9b))/0x8*(parseInt(_0x49d7cc(0xdf))/0x9)+parseInt(_0x49d7cc(0x110))/0xa*(-parseInt(_0x49d7cc(0x9d))/0xb)+parseInt(_0x49d7cc(0x98))/0xc*(parseInt(_0x49d7cc(0xf6))/0xd);if(_0x23eb81===_0x2c3312)break;else _0x4028a9['push'](_0x4028a9['shift']());}catch(_0x5522cf){_0x4028a9['push'](_0x4028a9['shift']());}}}(a5_0x407b,0x9cf2c));import*as a5_0x47dd46 from'node:fs';import*as a5_0x4e3500 from'node:path';import a5_0xa3e2b9 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_0x17cf91(0x10c)]=a5_0x17cf91(0x113);[a5_0x17cf91(0x106)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0x1e0a04){const _0x23fbbb=a5_0x17cf91,{options:_0x3abc3f,args:_0x134a50,tdx:_0x18dfbf}=_0x1e0a04,_0x2372fd=_0x134a50[0x0]||'.',_0x171ef4=_0x3abc3f[_0x23fbbb(0xef)],_0x5b4c34=_0x3abc3f,_0x10c81d=_0x5b4c34[_0x23fbbb(0xd1)]===![],_0x22fc41=_0x5b4c34[_0x23fbbb(0x112)],_0x1bcccc=_0x5b4c34[_0x23fbbb(0x10c)],_0x3d5d65=_0x5b4c34[_0x23fbbb(0x111)],_0x1de5ef=_0x3abc3f['site'],_0x23679c=_0x5b4c34[_0x23fbbb(0xe9)];if(_0x22fc41&&_0x10c81d)return console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xd8)](_0x23fbbb(0x109))),0x1;let _0x511130=_0x23fbbb(0x8a);if(_0x5b4c34[_0x23fbbb(0x95)])_0x511130=_0x23fbbb(0x95);else{if(_0x5b4c34['jsonl'])_0x511130=_0x23fbbb(0xaf);else{if(_0x5b4c34['tsv'])_0x511130='tsv';else{if(_0x5b4c34[_0x23fbbb(0x8a)])_0x511130=_0x23fbbb(0x8a);}}}const _0x4da365=_0x5b4c34[_0x23fbbb(0x84)];let _0x49eb9e=_0x2372fd;const _0x263431=a5_0x47dd46[_0x23fbbb(0xd4)](_0x2372fd),_0x4183ea=_0x2372fd==='.';if(!_0x263431||_0x4183ea){const _0x2b58b8=resolveProjectFromContext(_0x2372fd,_0x4da365,{'requireFile':'test.yml'});if(_0x2b58b8['found'])_0x49eb9e=_0x2b58b8[_0x23fbbb(0xad)],_0x2b58b8['source']===_0x23fbbb(0xb5)&&console[_0x23fbbb(0xe2)](a5_0xa3e2b9['dim'](_0x23fbbb(0xd6)+_0x49eb9e));else switch(_0x2b58b8[_0x23fbbb(0xb8)]){case'no_context':console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xa7)](_0x2b58b8[_0x23fbbb(0xb9)])),console[_0x23fbbb(0xe2)](),console[_0x23fbbb(0xe2)](_0x23fbbb(0xfc)),console['log'](_0x23fbbb(0xed)),console['log'](_0x23fbbb(0xb7)),console[_0x23fbbb(0xe2)](),console['log'](_0x23fbbb(0xeb));return 0x1;case _0x23fbbb(0xf1):console['log'](a5_0xa3e2b9[_0x23fbbb(0xa7)](_0x2b58b8[_0x23fbbb(0xb9)])),console[_0x23fbbb(0xe2)](),console['log'](_0x23fbbb(0xbe)+_0x2b58b8[_0x23fbbb(0x84)]+_0x23fbbb(0x79));return 0x1;case'multiple_agents':{const _0x4d0a56=a5_0x4e3500[_0x23fbbb(0x99)](_0x2b58b8[_0x23fbbb(0xad)]);console['log'](a5_0xa3e2b9[_0x23fbbb(0xa7)](_0x23fbbb(0xa2)+_0x2b58b8[_0x23fbbb(0x84)]+'\x22:'));for(const _0x220f61 of _0x2b58b8[_0x23fbbb(0xba)]){console[_0x23fbbb(0xe2)](_0x23fbbb(0xec)+_0x220f61);}return console[_0x23fbbb(0xe2)](),console[_0x23fbbb(0xe2)](_0x23fbbb(0xc8)+_0x4d0a56+'/<agent-name>'),0x1;}case _0x23fbbb(0x97):console[_0x23fbbb(0xe2)](a5_0xa3e2b9['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x2b58b8[_0x23fbbb(0x84)]+'\x22.')),console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xcd)](_0x23fbbb(0xb0)+_0x2b58b8[_0x23fbbb(0xad)])),console[_0x23fbbb(0xe2)](),console['log'](_0x23fbbb(0x10d));return 0x1;}}const {definition:_0x52ada3,agentInfo:_0x3f3103}=parseTestFile(_0x49eb9e);let _0x3d2807=_0x52ada3[_0x23fbbb(0xff)];if(_0x1bcccc){const _0x5724bc=_0x1bcccc[_0x23fbbb(0xee)](',')['map'](_0x18f78b=>_0x18f78b[_0x23fbbb(0xf2)]());_0x3d2807=_0x52ada3[_0x23fbbb(0xff)][_0x23fbbb(0x105)](_0x39fb97=>_0x5724bc[_0x23fbbb(0xf4)](_0x39fb97['name']));if(_0x3d2807[_0x23fbbb(0xea)]===0x0)return console[_0x23fbbb(0xe2)](a5_0xa3e2b9['yellow'](_0x23fbbb(0xc6)+_0x1bcccc)),console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xcd)]('Available\x20tests:\x20'+_0x52ada3[_0x23fbbb(0xff)]['map'](_0x46e74b=>_0x46e74b[_0x23fbbb(0x10c)])[_0x23fbbb(0xfe)](',\x20'))),0x1;}if(_0x3d5d65){const _0x226d07=_0x3d5d65[_0x23fbbb(0xee)](',')[_0x23fbbb(0xb1)](_0xd5c7a2=>_0xd5c7a2['trim']()[_0x23fbbb(0xc7)]());_0x3d2807=_0x3d2807[_0x23fbbb(0x105)](_0x1ce7cf=>_0x1ce7cf[_0x23fbbb(0x111)]?.[_0x23fbbb(0xf5)](_0x34368e=>_0x226d07[_0x23fbbb(0xf4)](_0x34368e['toLowerCase']())));if(_0x3d2807[_0x23fbbb(0xea)]===0x0){console['log'](a5_0xa3e2b9['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x3d5d65));const _0x47531d=new Set();return _0x52ada3[_0x23fbbb(0xff)]['forEach'](_0x4aa822=>_0x4aa822['tags']?.[_0x23fbbb(0x103)](_0x41a4b9=>_0x47531d[_0x23fbbb(0x9c)](_0x41a4b9))),_0x47531d[_0x23fbbb(0x81)]>0x0?console['log'](a5_0xa3e2b9[_0x23fbbb(0xcd)]('Available\x20tags:\x20'+[..._0x47531d][_0x23fbbb(0xfe)](',\x20'))):console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xcd)](_0x23fbbb(0xdb))),0x1;}}if(_0x22fc41)return this[_0x23fbbb(0xd7)](_0x1e0a04,{'definition':{'tests':_0x3d2807},'agentInfo':_0x3f3103,'outputFormat':_0x511130,'outputFile':_0x23679c,'testNames':_0x1bcccc});if(_0x171ef4){console['log'](a5_0xa3e2b9[_0x23fbbb(0xb6)](_0x23fbbb(0x9f))),console[_0x23fbbb(0xe2)](_0x23fbbb(0xe1)+a5_0xa3e2b9[_0x23fbbb(0xdc)](_0x1de5ef)),console['log'](_0x23fbbb(0x102)+a5_0xa3e2b9['white'](_0x3f3103[_0x23fbbb(0x10b)])),console[_0x23fbbb(0xe2)](_0x23fbbb(0xa5)+a5_0xa3e2b9['white'](_0x3f3103[_0x23fbbb(0xbb)])),console[_0x23fbbb(0xe2)](),console[_0x23fbbb(0xe2)](_0x23fbbb(0xc1)+a5_0xa3e2b9[_0x23fbbb(0xdc)](_0x3d2807[_0x23fbbb(0xea)]));for(let _0x3a99f7=0x0;_0x3a99f7<_0x3d2807[_0x23fbbb(0xea)];_0x3a99f7++){const _0xfbd598=_0x3d2807[_0x3a99f7],_0x11b2eb=_0xfbd598['rounds'][_0x23fbbb(0xea)]===0x1?'round':'rounds',_0x5032f3=_0xfbd598[_0x23fbbb(0x111)]?.[_0x23fbbb(0xea)]?'\x20['+_0xfbd598['tags'][_0x23fbbb(0xfe)](',\x20')+']':'';console['log']('\x20\x20'+(_0x3a99f7+0x1)+'.\x20'+a5_0xa3e2b9[_0x23fbbb(0xdc)](_0xfbd598[_0x23fbbb(0x10c)])+'\x20('+_0xfbd598[_0x23fbbb(0xe8)]['length']+'\x20'+_0x11b2eb+')'+a5_0xa3e2b9[_0x23fbbb(0xcd)](_0x5032f3));}return 0x0;}let _0x3a5332,_0x273f06;try{_0x3a5332=await _0x18dfbf[_0x23fbbb(0x87)][_0x23fbbb(0xf8)](_0x3f3103[_0x23fbbb(0x10b)]);}catch(_0x5094fb){const _0x2684a5=_0x5094fb instanceof Error?_0x5094fb[_0x23fbbb(0xb9)]:String(_0x5094fb);return _0x2684a5[_0x23fbbb(0xf4)]('404')||_0x2684a5[_0x23fbbb(0xc7)]()[_0x23fbbb(0xf4)](_0x23fbbb(0xcb))?console['log'](a5_0xa3e2b9[_0x23fbbb(0xd8)](_0x23fbbb(0x107)+_0x3f3103[_0x23fbbb(0x10b)])):console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xd8)](_0x23fbbb(0xcf)+_0x3f3103[_0x23fbbb(0x10b)]+_0x23fbbb(0xe5)+_0x2684a5)),0x1;}try{_0x273f06=await _0x18dfbf[_0x23fbbb(0x87)][_0x23fbbb(0xc9)](_0x3f3103[_0x23fbbb(0xbb)],_0x3a5332);}catch(_0x3a15ad){const _0x7cb4d8=_0x3a15ad instanceof Error?_0x3a15ad[_0x23fbbb(0xb9)]:String(_0x3a15ad);return _0x7cb4d8[_0x23fbbb(0xf4)]('404')||_0x7cb4d8[_0x23fbbb(0xc7)]()[_0x23fbbb(0xf4)](_0x23fbbb(0xcb))?console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xd8)](_0x23fbbb(0xb4)+_0x3f3103[_0x23fbbb(0xbb)])):console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xd8)](_0x23fbbb(0xd5)+_0x3f3103['agentName']+'\x22:\x20'+_0x7cb4d8)),0x1;}let _0x2b00f1;if(!_0x10c81d)try{_0x2b00f1=await setupEvaluatorAgent(_0x18dfbf[_0x23fbbb(0x87)],_0x3abc3f[_0x23fbbb(0xf7)]);}catch(_0x17f86a){const _0x336aff=_0x17f86a instanceof Error?_0x17f86a['message']:String(_0x17f86a);return console[_0x23fbbb(0xe2)](a5_0xa3e2b9['red'](_0x23fbbb(0xa6)+_0x336aff)),0x1;}console['log'](a5_0xa3e2b9[_0x23fbbb(0xb6)]('Running\x20agent\x20tests...')),console['log'](_0x23fbbb(0x89)+a5_0xa3e2b9[_0x23fbbb(0xdc)](_0x1de5ef)),console[_0x23fbbb(0xe2)](_0x23fbbb(0x8c)+a5_0xa3e2b9[_0x23fbbb(0xdc)](_0x3f3103[_0x23fbbb(0x10b)]+'/'+_0x3f3103[_0x23fbbb(0xbb)])),console[_0x23fbbb(0xe2)]();const _0xd777c6=[],_0x165a10=[],_0xca2267=Date[_0x23fbbb(0xe3)]();for(let _0x45cc65=0x0;_0x45cc65<_0x3d2807[_0x23fbbb(0xea)];_0x45cc65++){const _0x56af91=_0x3d2807[_0x45cc65];_0x3d2807['length']>0x1?console[_0x23fbbb(0xe2)](_0x23fbbb(0xdd)+(_0x45cc65+0x1)+'/'+_0x3d2807['length']+':\x20'+a5_0xa3e2b9[_0x23fbbb(0xdc)](_0x56af91[_0x23fbbb(0x10c)])):console['log'](_0x23fbbb(0xf9)+a5_0xa3e2b9['white'](_0x56af91[_0x23fbbb(0x10c)]));const _0x37aa85=createCommandSpinner('Round\x201/'+_0x56af91['rounds'][_0x23fbbb(0xea)]+':\x20Sending\x20user\x20input...');_0x37aa85[_0x23fbbb(0x85)]();try{const {result:_0xfa11b4,conversation:_0x55eff1}=await runTest(_0x18dfbf['llm'],_0x56af91,{'agentId':_0x273f06,'projectId':_0x3a5332,'site':_0x1de5ef,'noEval':_0x10c81d,'evaluatorId':_0x2b00f1,'onRoundStart':(_0x551928,_0x1b416a)=>{const _0x344e0f=_0x23fbbb;_0x37aa85['text']='Round\x20'+(_0x551928+0x1)+'/'+_0x1b416a+_0x344e0f(0xcc);},'onRoundComplete':(_0x153e30,_0x1299b4,_0x56829c)=>{const _0x5aaa58=_0x23fbbb,_0x3fd6ac=formatElapsed(_0x1299b4);_0x56829c?console['log'](_0x5aaa58(0xca)+(_0x153e30+0x1)+'/'+_0x56af91[_0x5aaa58(0xe8)]['length']+_0x5aaa58(0xa8)+a5_0xa3e2b9[_0x5aaa58(0x8d)]('✓')+'\x20('+_0x3fd6ac+')'):console[_0x5aaa58(0xe2)](_0x5aaa58(0xca)+(_0x153e30+0x1)+'/'+_0x56af91[_0x5aaa58(0xe8)][_0x5aaa58(0xea)]+'...\x20'+a5_0xa3e2b9[_0x5aaa58(0xd8)]('✗'));},'onEvaluationStart':()=>{const _0x45a399=_0x23fbbb;_0x37aa85[_0x45a399(0x7e)]='Evaluating\x20response...';},'onEvaluationComplete':_0x107057=>{const _0x41bee6=_0x23fbbb,_0x2b8e82=formatElapsed(_0x107057);console[_0x41bee6(0xe2)]('\x20\x20Evaluating...\x20'+a5_0xa3e2b9[_0x41bee6(0x8d)]('✓')+'\x20('+_0x2b8e82+')');}});_0x37aa85[_0x23fbbb(0x7a)](),_0xd777c6['push'](_0xfa11b4),_0x165a10[_0x23fbbb(0xfd)](_0x55eff1);if(_0xfa11b4[_0x23fbbb(0xaa)]===_0x23fbbb(0xde))console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0x8d)](_0x23fbbb(0xbd)+_0xfa11b4[_0x23fbbb(0xb8)]));else _0xfa11b4[_0x23fbbb(0xaa)]===_0x23fbbb(0x108)?console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xd8)]('✗\x20FAIL:\x20'+_0xfa11b4[_0x23fbbb(0xb8)])):console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xd8)]('✗\x20ERROR:\x20'+_0xfa11b4[_0x23fbbb(0xb8)]));_0xfa11b4['conversation_url']&&console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xcd)](_0x23fbbb(0x94)+_0xfa11b4['conversation_url'])),console[_0x23fbbb(0xe2)]();}catch(_0x1ee845){_0x37aa85[_0x23fbbb(0x7a)]();const _0x25df85=_0x1ee845 instanceof Error?_0x1ee845['message']:String(_0x1ee845);console['log'](a5_0xa3e2b9[_0x23fbbb(0xd8)]('✗\x20ERROR:\x20'+_0x25df85)),console[_0x23fbbb(0xe2)](),_0xd777c6[_0x23fbbb(0xfd)]({'name':_0x56af91['name'],'status':_0x23fbbb(0x92),'reason':_0x25df85,'timestamp':new Date()[_0x23fbbb(0x80)](),'duration_ms':0x0});}}const _0x3e4f12=Date[_0x23fbbb(0xe3)]()-_0xca2267,_0x3f6d2d=_0xd777c6[_0x23fbbb(0x105)](_0x2f7842=>_0x2f7842[_0x23fbbb(0xaa)]===_0x23fbbb(0xde))[_0x23fbbb(0xea)],_0x218774=_0xd777c6['filter'](_0x5aa47b=>_0x5aa47b[_0x23fbbb(0xaa)]===_0x23fbbb(0x108))[_0x23fbbb(0xea)],_0x312aad=_0xd777c6[_0x23fbbb(0x105)](_0x389d4c=>_0x389d4c['status']==='ERROR')[_0x23fbbb(0xea)];console[_0x23fbbb(0xe2)]('━'[_0x23fbbb(0x9a)](0x3c)),console[_0x23fbbb(0xe2)](_0x23fbbb(0xf0)),console['log']('━'[_0x23fbbb(0x9a)](0x3c)),console['log'](_0x23fbbb(0xa1)+_0xd777c6['length']),console[_0x23fbbb(0xe2)]('Passed:\x20\x20\x20'+a5_0xa3e2b9[_0x23fbbb(0x8d)](_0x3f6d2d)),console[_0x23fbbb(0xe2)](_0x23fbbb(0xc5)+a5_0xa3e2b9[_0x23fbbb(0xd8)](_0x218774));_0x312aad>0x0&&console[_0x23fbbb(0xe2)](_0x23fbbb(0x10f)+a5_0xa3e2b9['red'](_0x312aad));console[_0x23fbbb(0xe2)]('Duration:\x20'+formatElapsed(_0x3e4f12)),console[_0x23fbbb(0xe2)]('━'[_0x23fbbb(0x9a)](0x3c));const _0x1b6955=_0xd777c6[_0x23fbbb(0x105)](_0x387ba8=>_0x387ba8[_0x23fbbb(0xaa)]!=='PASS');if(_0x1b6955[_0x23fbbb(0xea)]>0x0){console[_0x23fbbb(0xe2)](),console[_0x23fbbb(0xe2)]('Failed\x20Tests:');for(const _0x1f618f of _0x1b6955){const _0x30ccaf=a5_0xa3e2b9[_0x23fbbb(0xd8)]('✗'),_0x4b11ee=_0x1f618f['reason'][_0x23fbbb(0xea)]>0x32?_0x1f618f['reason'][_0x23fbbb(0x7b)](0x0,0x32)+_0x23fbbb(0x10a):_0x1f618f[_0x23fbbb(0xb8)];console['log']('\x20\x20'+_0x30ccaf+'\x20'+_0x1f618f[_0x23fbbb(0x10c)]+':\x20'+_0x4b11ee);}}const _0xb05285={'summary':{'total':_0xd777c6[_0x23fbbb(0xea)],'passed':_0x3f6d2d,'failed':_0x218774,'errors':_0x312aad>0x0?_0x312aad:undefined,'duration_ms':_0x3e4f12},'tests':_0xd777c6,'agent':{'project':_0x3f3103[_0x23fbbb(0x10b)],'name':_0x3f3103[_0x23fbbb(0xbb)],'site':_0x1de5ef},'timestamp':new Date(_0xca2267)[_0x23fbbb(0x80)]()};try{const _0x4f73eb=buildCachedTestRun(_0x165a10,{'site':_0x1de5ef,'projectId':_0x3a5332,'projectName':_0x3f3103[_0x23fbbb(0x10b)],'agentId':_0x273f06,'agentName':_0x3f3103[_0x23fbbb(0xbb)],'testYmlPath':a5_0x4e3500[_0x23fbbb(0xe4)](_0x3f3103[_0x23fbbb(0x9e)])});saveLastTestRun(_0x4f73eb);}catch{}if(_0x511130!=='table'||_0x23679c){const _0x1be772=formatResults(_0xb05285,_0x511130);if(_0x23679c)try{a5_0x47dd46[_0x23fbbb(0xc0)](_0x23679c,_0x1be772,_0x23fbbb(0xfb)),console[_0x23fbbb(0xe2)](),console['log'](a5_0xa3e2b9['dim']('Output\x20written\x20to:\x20'+_0x23679c));}catch(_0xc439a0){return console[_0x23fbbb(0xe2)](),console[_0x23fbbb(0xe2)](a5_0xa3e2b9[_0x23fbbb(0xd8)](_0x23fbbb(0xbc)+_0xc439a0)),0x1;}else console[_0x23fbbb(0xe2)](),console[_0x23fbbb(0xe2)](_0x1be772);}return _0x1b6955[_0x23fbbb(0xea)]>0x0?0x1:0x0;}async[a5_0x17cf91(0xd7)](_0x104f48,_0x1a69f8){const _0x633e3d=a5_0x17cf91,{options:_0x470abd,tdx:_0x48308c}=_0x104f48,{definition:_0xab2b85,agentInfo:_0x518eeb,outputFormat:_0x548b0d,outputFile:_0x1c9acd}=_0x1a69f8,_0xb8f824=_0x470abd[_0x633e3d(0xd2)],_0x533f08=loadLastTestRun();if(!_0x533f08)return console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xd8)](_0x633e3d(0x86))),console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xcd)](_0x633e3d(0x8f))),0x1;if(_0x533f08[_0x633e3d(0x10e)][_0x633e3d(0xbb)]!==_0x518eeb[_0x633e3d(0xbb)])return console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xd8)](_0x633e3d(0x100)+_0x533f08['agent'][_0x633e3d(0xbb)]+_0x633e3d(0xa9)+_0x518eeb[_0x633e3d(0xbb)]+'\x22.')),console[_0x633e3d(0xe2)](a5_0xa3e2b9['dim'](_0x633e3d(0xbf))),0x1;const _0x4461f8=new Set(_0x533f08[_0x633e3d(0xa4)][_0x633e3d(0xb1)](_0x220645=>_0x220645[_0x633e3d(0xfa)])),_0x2d749f=_0xab2b85[_0x633e3d(0xff)][_0x633e3d(0x105)](_0x56f1aa=>!_0x4461f8[_0x633e3d(0xce)](_0x56f1aa[_0x633e3d(0x10c)]));if(_0x2d749f[_0x633e3d(0xea)]>0x0&&_0x533f08[_0x633e3d(0xd2)]!==_0xb8f824)return console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xd8)](_0x633e3d(0xe6))),console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xcd)](_0x633e3d(0xf3)+_0x533f08[_0x633e3d(0xd2)]+_0x633e3d(0x83)+_0xb8f824+'\x22.')),console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xcd)](_0x633e3d(0xae)+_0x533f08['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x516a0f=_0xab2b85['tests'][_0x633e3d(0x105)](_0x122467=>_0x4461f8[_0x633e3d(0xce)](_0x122467[_0x633e3d(0x10c)])),_0x52aac6=_0x2d749f;let _0x7b86e;try{_0x7b86e=await setupEvaluatorAgent(_0x48308c[_0x633e3d(0x87)],_0x470abd[_0x633e3d(0xf7)]);}catch(_0x48eeb7){const _0x63544c=_0x48eeb7 instanceof Error?_0x48eeb7[_0x633e3d(0xb9)]:String(_0x48eeb7);return console['log'](a5_0xa3e2b9[_0x633e3d(0xd8)](_0x633e3d(0xa6)+_0x63544c)),0x1;}console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xb6)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x633e3d(0xe2)](_0x633e3d(0xa0)+a5_0xa3e2b9[_0x633e3d(0xdc)](_0x533f08['timestamp'])),console[_0x633e3d(0xe2)](_0x633e3d(0x8c)+a5_0xa3e2b9[_0x633e3d(0xdc)](_0x533f08[_0x633e3d(0x10e)][_0x633e3d(0x10b)]+'/'+_0x533f08[_0x633e3d(0x10e)][_0x633e3d(0xbb)]));_0x52aac6['length']>0x0&&console[_0x633e3d(0xe2)](_0x633e3d(0xab)+a5_0xa3e2b9[_0x633e3d(0xa7)](_0x52aac6[_0x633e3d(0xea)]));console[_0x633e3d(0xe2)]();const _0x52701f=[],_0x58d56a=Date[_0x633e3d(0xe3)](),_0x446208=createCommandSpinner(_0x633e3d(0x93));if(_0x516a0f[_0x633e3d(0xea)]>0x0)try{const _0x2c6110=await reevaluateFromCache(_0x48308c[_0x633e3d(0x87)],_0x533f08,{'tests':_0x516a0f},{'evaluatorId':_0x7b86e,'onTestStart':(_0x2b2312,_0xd8408c,_0x544423)=>{const _0x2f5347=_0x633e3d;_0x446208['text']=_0x2f5347(0x91)+(_0xd8408c+0x1)+'/'+_0x544423+':\x20'+_0x2b2312+_0x2f5347(0x10a);if(!_0x446208[_0x2f5347(0xe0)])_0x446208[_0x2f5347(0x85)]();},'onTestComplete':(_0x36feb5,_0x337ae6)=>{const _0xfd4a50=_0x633e3d;_0x446208[_0xfd4a50(0x7a)]();if(_0x337ae6[_0xfd4a50(0xaa)]===_0xfd4a50(0xde))console[_0xfd4a50(0xe2)](a5_0xa3e2b9[_0xfd4a50(0x8d)](_0xfd4a50(0xbd)+_0x36feb5)+a5_0xa3e2b9[_0xfd4a50(0xcd)](_0xfd4a50(0xe7)));else _0x337ae6[_0xfd4a50(0xaa)]===_0xfd4a50(0x108)?console['log'](a5_0xa3e2b9[_0xfd4a50(0xd8)](_0xfd4a50(0xc4)+_0x36feb5+_0xfd4a50(0xd0)+_0x337ae6[_0xfd4a50(0xb8)])+a5_0xa3e2b9[_0xfd4a50(0xcd)]('\x20(cached)')):console[_0xfd4a50(0xe2)](a5_0xa3e2b9[_0xfd4a50(0xd8)](_0xfd4a50(0xda)+_0x36feb5+_0xfd4a50(0xd0)+_0x337ae6[_0xfd4a50(0xb8)]));_0x337ae6[_0xfd4a50(0x90)]&&console[_0xfd4a50(0xe2)](a5_0xa3e2b9[_0xfd4a50(0xcd)](_0xfd4a50(0xc2)+_0x337ae6[_0xfd4a50(0x90)])),_0x52701f[_0xfd4a50(0xfd)](_0x337ae6);},'onTestSkipped':(_0x185525,_0x36ed96)=>{const _0x1304d2=_0x633e3d;_0x446208[_0x1304d2(0x7a)](),console[_0x1304d2(0xe2)](a5_0xa3e2b9[_0x1304d2(0xa7)](_0x1304d2(0x104)+_0x185525+_0x1304d2(0xd0)+_0x36ed96));}});for(const _0x1acaf2 of _0x2c6110){!_0x52701f[_0x633e3d(0x88)](_0x2d22e1=>_0x2d22e1[_0x633e3d(0x10c)]===_0x1acaf2['name'])&&_0x52701f['push'](_0x1acaf2);}}catch(_0x29ab52){_0x446208['stop']();const _0x5aac10=_0x29ab52 instanceof Error?_0x29ab52['message']:String(_0x29ab52);return console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xd8)](_0x633e3d(0xa3)+_0x5aac10)),0x1;}_0x446208['stop']();if(_0x52aac6[_0x633e3d(0xea)]>0x0){console[_0x633e3d(0xe2)](),console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xb6)](_0x633e3d(0xc3)));const {projectId:_0x345e73,agentId:_0x3afecf}=_0x533f08[_0x633e3d(0x10e)];for(const _0xa6489c of _0x52aac6){console[_0x633e3d(0xe2)](_0x633e3d(0xd3)+a5_0xa3e2b9['white'](_0xa6489c[_0x633e3d(0x10c)]));const _0x54c79e=createCommandSpinner('Round\x201/'+_0xa6489c[_0x633e3d(0xe8)][_0x633e3d(0xea)]+_0x633e3d(0xcc));_0x54c79e[_0x633e3d(0x85)]();try{const {result:_0x59db89}=await runTest(_0x48308c[_0x633e3d(0x87)],_0xa6489c,{'agentId':_0x3afecf,'projectId':_0x345e73,'site':_0x533f08[_0x633e3d(0xd2)],'noEval':![],'evaluatorId':_0x7b86e,'onRoundStart':(_0x37781e,_0x225968)=>{const _0x2a69dc=_0x633e3d;_0x54c79e[_0x2a69dc(0x7e)]=_0x2a69dc(0x101)+(_0x37781e+0x1)+'/'+_0x225968+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4d6027,_0x3f795b,_0x408f1a)=>{const _0x16d03a=_0x633e3d,_0x16cf3f=formatElapsed(_0x3f795b);_0x408f1a?console[_0x16d03a(0xe2)](_0x16d03a(0xca)+(_0x4d6027+0x1)+'/'+_0xa6489c[_0x16d03a(0xe8)][_0x16d03a(0xea)]+_0x16d03a(0xa8)+a5_0xa3e2b9[_0x16d03a(0x8d)]('✓')+'\x20('+_0x16cf3f+')'):console['log'](_0x16d03a(0xca)+(_0x4d6027+0x1)+'/'+_0xa6489c[_0x16d03a(0xe8)][_0x16d03a(0xea)]+_0x16d03a(0xa8)+a5_0xa3e2b9[_0x16d03a(0xd8)]('✗'));},'onEvaluationStart':()=>{const _0x2a5cec=_0x633e3d;_0x54c79e[_0x2a5cec(0x7e)]=_0x2a5cec(0xb3);},'onEvaluationComplete':_0x587fba=>{const _0x4982e4=_0x633e3d,_0x4a82e6=formatElapsed(_0x587fba);console[_0x4982e4(0xe2)](_0x4982e4(0x114)+a5_0xa3e2b9[_0x4982e4(0x8d)]('✓')+'\x20('+_0x4a82e6+')');}});_0x54c79e[_0x633e3d(0x7a)](),_0x52701f[_0x633e3d(0xfd)](_0x59db89);if(_0x59db89[_0x633e3d(0xaa)]===_0x633e3d(0xde))console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0x8d)](_0x633e3d(0xbd)+_0x59db89[_0x633e3d(0xb8)])+a5_0xa3e2b9[_0x633e3d(0xcd)]('\x20(new)'));else _0x59db89[_0x633e3d(0xaa)]===_0x633e3d(0x108)?console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xd8)](_0x633e3d(0xc4)+_0x59db89[_0x633e3d(0xb8)])+a5_0xa3e2b9[_0x633e3d(0xcd)](_0x633e3d(0xb2))):console['log'](a5_0xa3e2b9['red'](_0x633e3d(0xda)+_0x59db89[_0x633e3d(0xb8)]));_0x59db89[_0x633e3d(0x90)]&&console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xcd)](_0x633e3d(0xc2)+_0x59db89['conversation_url']));}catch(_0x11318e){_0x54c79e['stop']();const _0x3f23c3=_0x11318e instanceof Error?_0x11318e['message']:String(_0x11318e);console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xd8)]('✗\x20ERROR:\x20'+_0x3f23c3)),_0x52701f[_0x633e3d(0xfd)]({'name':_0xa6489c['name'],'status':_0x633e3d(0x92),'reason':_0x3f23c3,'timestamp':new Date()[_0x633e3d(0x80)](),'duration_ms':0x0});}}}console[_0x633e3d(0xe2)]();const _0xd84ac0=Date[_0x633e3d(0xe3)]()-_0x58d56a,_0x29fbea=_0x52701f[_0x633e3d(0x105)](_0x2162a6=>_0x2162a6[_0x633e3d(0xaa)]===_0x633e3d(0xde))[_0x633e3d(0xea)],_0x3e9aaa=_0x52701f['filter'](_0x38eb2a=>_0x38eb2a[_0x633e3d(0xaa)]===_0x633e3d(0x108))[_0x633e3d(0xea)],_0x160c22=_0x52701f[_0x633e3d(0x105)](_0x4a9f7e=>_0x4a9f7e['status']===_0x633e3d(0x92))[_0x633e3d(0xea)];console[_0x633e3d(0xe2)]('━'['repeat'](0x3c)),console['log']('Re-evaluation\x20Summary'),console[_0x633e3d(0xe2)]('━'['repeat'](0x3c)),console['log'](_0x633e3d(0xa1)+_0x52701f[_0x633e3d(0xea)]),console[_0x633e3d(0xe2)](_0x633e3d(0x8b)+a5_0xa3e2b9['green'](_0x29fbea)),console['log']('Failed:\x20\x20\x20'+a5_0xa3e2b9[_0x633e3d(0xd8)](_0x3e9aaa));_0x160c22>0x0&&console[_0x633e3d(0xe2)](_0x633e3d(0x10f)+a5_0xa3e2b9[_0x633e3d(0xd8)](_0x160c22));console['log']('Duration:\x20'+formatElapsed(_0xd84ac0)),console[_0x633e3d(0xe2)]('━'[_0x633e3d(0x9a)](0x3c));const _0x47c30a={'summary':{'total':_0x52701f['length'],'passed':_0x29fbea,'failed':_0x3e9aaa,'errors':_0x160c22>0x0?_0x160c22:undefined,'duration_ms':_0xd84ac0},'tests':_0x52701f,'agent':{'project':_0x518eeb[_0x633e3d(0x10b)],'name':_0x518eeb[_0x633e3d(0xbb)],'site':_0xb8f824},'timestamp':new Date(_0x58d56a)[_0x633e3d(0x80)]()};if(_0x548b0d!=='table'||_0x1c9acd){const _0x5c061c=formatResults(_0x47c30a,_0x548b0d);if(_0x1c9acd)try{a5_0x47dd46[_0x633e3d(0xc0)](_0x1c9acd,_0x5c061c,_0x633e3d(0xfb)),console[_0x633e3d(0xe2)](),console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xcd)](_0x633e3d(0xac)+_0x1c9acd));}catch(_0xce2bdc){return console['log'](),console[_0x633e3d(0xe2)](a5_0xa3e2b9[_0x633e3d(0xd8)]('Error\x20writing\x20output\x20file:\x20'+_0xce2bdc)),0x1;}else console['log'](),console['log'](_0x5c061c);}const _0x58f04d=_0x52701f[_0x633e3d(0x105)](_0x4b0765=>_0x4b0765['status']!==_0x633e3d(0xde));return _0x58f04d[_0x633e3d(0xea)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x468577=a6_0x5b95;(function(_0x504ea2,_0x15cd59){const _0x5d07c7=a6_0x5b95,_0x162f0d=_0x504ea2();while(!![]){try{const _0x14ec5d=-parseInt(_0x5d07c7(0x106))/0x1+-parseInt(_0x5d07c7(0x12b))/0x2+parseInt(_0x5d07c7(0x115))/0x3+-parseInt(_0x5d07c7(0x139))/0x4*(parseInt(_0x5d07c7(0x13d))/0x5)+parseInt(_0x5d07c7(0x117))/0x6+parseInt(_0x5d07c7(0x129))/0x7+-parseInt(_0x5d07c7(0x13c))/0x8*(-parseInt(_0x5d07c7(0x10a))/0x9);if(_0x14ec5d===_0x15cd59)break;else _0x162f0d['push'](_0x162f0d['shift']());}catch(_0x7d5136){_0x162f0d['push'](_0x162f0d['shift']());}}}(a6_0x3888,0x869f9));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x5b95(_0x1782aa,_0x28a8f8){_0x1782aa=_0x1782aa-0xfd;const _0x3888cc=a6_0x3888();let _0x5b950b=_0x3888cc[_0x1782aa];return _0x5b950b;}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(['authorization',a6_0x468577(0x11e),'cookie','set-cookie','set-cookie2',a6_0x468577(0x10f),a6_0x468577(0x131),'x-trino-user']);function a6_0x3888(){const _0x521da2=['startsWith','request','\x0aStack\x20trace:\x0a','DELETE','verbose','x-auth-token','method','<\x20HTTP/1.1\x20','llm-proxy','headers','Invalid\x20header\x20format:\x20\x22','Results\x20saved\x20to\x20','data','169528dbkYHq','GET','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','51208dMOhAs','115QGPFAU','PATCH','header','toLowerCase','Endpoint\x20must\x20start\x20with\x20/:\x20','cdp','readBodyFromFile','trim','entries','join','414069rYfpYX','status','error','stack','2556VLscKE','type','length','file','.\x20Valid\x20methods:\x20','x-xsrf-token','includes','color','validate','name','execute','113400vsYCxC','isArray','2429058fJYgQB','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','description','indexOf','toUpperCase','Invalid\x20API\x20type:\x20','proxy-authorization','body','api','.\x20Valid\x20types:\x20','site','output','workflow','keys','substring','Error:\x20','trino','1679412aUAuTQ','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','1120342JOtRDx'];a6_0x3888=function(){return _0x521da2;};return a6_0x3888();}function isSensitiveHeader(_0x4c04d4){const _0x107983=a6_0x468577;return SENSITIVE_HEADERS['has'](_0x4c04d4[_0x107983(0xff)]());}function parseHeader(_0x48d218){const _0x44194f=a6_0x468577,_0x1edde5=_0x48d218[_0x44194f(0x11b)](':');if(_0x1edde5===-0x1)throw new Error(_0x44194f(0x136)+_0x48d218+'\x22.\x20'+_0x44194f(0x119));const _0x52dae5=_0x48d218['substring'](0x0,_0x1edde5)[_0x44194f(0x103)](),_0x342442=_0x48d218[_0x44194f(0x126)](_0x1edde5+0x1)[_0x44194f(0x103)]();if(!_0x52dae5)throw new Error(_0x44194f(0x12a)+_0x48d218+'\x22');return[_0x52dae5,_0x342442];}export class ApiCommand extends BaseCommand{[a6_0x468577(0x113)]=a6_0x468577(0x120);[a6_0x468577(0x11a)]=a6_0x468577(0x118);[a6_0x468577(0x112)](_0x3575e3){const _0x69a389=a6_0x468577,{args:_0x5be3c3,options:_0x372c73}=_0x3575e3,_0x169387=_0x372c73;if(_0x5be3c3['length']===0x0)return _0x69a389(0x13b);const _0x17fc13=_0x5be3c3[0x0];if(!_0x17fc13[_0x69a389(0x12c)]('/'))return _0x69a389(0x100)+_0x17fc13;const _0x4f0da1=_0x169387[_0x69a389(0x138)],_0x2d7502=_0x169387[_0x69a389(0x10d)];if(_0x4f0da1&&_0x2d7502)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x1ea4f8=_0x169387[_0x69a389(0x132)]||'GET',_0x442421=['GET','POST','PUT',_0x69a389(0x12f),_0x69a389(0xfd)];if(!_0x442421[_0x69a389(0x110)](_0x1ea4f8[_0x69a389(0x11c)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x1ea4f8+_0x69a389(0x10e)+_0x442421[_0x69a389(0x105)](',\x20');const _0x5d913c=_0x169387[_0x69a389(0x10b)]||'td',_0xeb3e0e=['td',_0x69a389(0x101),_0x69a389(0x124),_0x69a389(0x128),'llm',_0x69a389(0x134)];if(!_0xeb3e0e['includes'](_0x5d913c))return _0x69a389(0x11d)+_0x5d913c+_0x69a389(0x121)+_0xeb3e0e[_0x69a389(0x105)](',\x20');return undefined;}async[a6_0x468577(0x114)](_0x2dfedf){const _0x309623=a6_0x468577,{options:_0x68fea3,args:_0x47b351,tdx:_0x3d81f1}=_0x2dfedf,_0x19539b=_0x68fea3,_0x9c52a9=_0x47b351[0x0],_0x22e51c=(_0x19539b['method']||_0x309623(0x13a))[_0x309623(0x11c)](),_0x4487f8=_0x19539b['data'],_0x58e8b4=_0x19539b[_0x309623(0x10d)],_0x458e59=_0x19539b[_0x309623(0xfe)],_0x1ae88c=_0x19539b[_0x309623(0x10b)]||'td';try{const _0x36f041={};if(_0x458e59){const _0x3d34dc=Array[_0x309623(0x116)](_0x458e59)?_0x458e59:[_0x458e59];for(const _0x4b3faf of _0x3d34dc){const [_0x159fcb,_0x530da5]=parseHeader(_0x4b3faf);_0x36f041[_0x159fcb]=_0x530da5;}}let _0x268b78;if(_0x4487f8)_0x268b78=_0x4487f8;else{if(_0x58e8b4)try{_0x268b78=RawAPI[_0x309623(0x102)](_0x58e8b4);}catch(_0x546ca3){return console[_0x309623(0x108)](_0x309623(0x127)+(_0x546ca3 instanceof Error?_0x546ca3['message']:String(_0x546ca3))),0x1;}}const _0x33fbf8={'method':_0x22e51c,'apiType':_0x1ae88c,'includeHeaders':_0x68fea3[_0x309623(0x130)]};_0x268b78&&(_0x33fbf8[_0x309623(0x11f)]=_0x268b78);Object[_0x309623(0x125)](_0x36f041)[_0x309623(0x10c)]>0x0&&(_0x33fbf8[_0x309623(0x135)]=_0x36f041);if(_0x68fea3[_0x309623(0x130)]){const _0x2a6e18=resolveSite(_0x68fea3[_0x309623(0x122)]),_0x2fcc02=getEndpoint(_0x2a6e18,_0x1ae88c),_0x50437c=''+_0x2fcc02+_0x9c52a9;console[_0x309623(0x108)]('>\x20'+_0x22e51c+'\x20'+_0x50437c);const _0x5b1836=getAuthHeaders(_0x2a6e18),_0x477165={..._0x5b1836,..._0x36f041};for(const [_0x4e72ba,_0x1d544b]of Object[_0x309623(0x104)](_0x477165)){!isSensitiveHeader(_0x4e72ba)&&console[_0x309623(0x108)]('>\x20'+_0x4e72ba+':\x20'+_0x1d544b);}_0x268b78&&console['error']('>'),console[_0x309623(0x108)]('');}const _0x3a9b7d=await _0x3d81f1[_0x309623(0x120)][_0x309623(0x12d)](_0x9c52a9,_0x33fbf8);if(_0x68fea3[_0x309623(0x130)]&&_0x3a9b7d[_0x309623(0x135)]){console[_0x309623(0x108)](_0x309623(0x133)+_0x3a9b7d[_0x309623(0x107)]);for(const [_0x5db4ca,_0x287a00]of Object['entries'](_0x3a9b7d[_0x309623(0x135)])){!isSensitiveHeader(_0x5db4ca)&&console[_0x309623(0x108)]('<\x20'+_0x5db4ca+':\x20'+_0x287a00);}console[_0x309623(0x108)]('');}const _0x58377d=Boolean(_0x68fea3[_0x309623(0x123)]),_0x1454ae={'color':_0x68fea3['color'],'noColor':_0x68fea3['noColor']||_0x58377d&&!_0x68fea3[_0x309623(0x111)]},_0x280822=colorizeJSON(_0x3a9b7d['data'],_0x1454ae);return _0x68fea3[_0x309623(0x123)]?(writeFileSync(_0x68fea3['output'],_0x280822),console['error'](_0x309623(0x137)+_0x68fea3[_0x309623(0x123)])):console['log'](_0x280822),0x0;}catch(_0x4e48fc){return _0x4e48fc instanceof Error?(console[_0x309623(0x108)](_0x309623(0x127)+_0x4e48fc['message']),_0x68fea3['verbose']&&_0x4e48fc[_0x309623(0x109)]&&console[_0x309623(0x108)](_0x309623(0x12e)+_0x4e48fc['stack'])):console[_0x309623(0x108)](_0x309623(0x127)+String(_0x4e48fc)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a7_0x2a1e43=a7_0x2191;(function(_0x2fb0b9,_0x51da37){const _0x5ed74e=a7_0x2191,_0x552492=_0x2fb0b9();while(!![]){try{const _0x5646bb=parseInt(_0x5ed74e(0x1bb))/0x1+parseInt(_0x5ed74e(0x1e3))/0x2+parseInt(_0x5ed74e(0x1d5))/0x3*(parseInt(_0x5ed74e(0x1f2))/0x4)+-parseInt(_0x5ed74e(0x1b2))/0x5+-parseInt(_0x5ed74e(0x1d2))/0x6+-parseInt(_0x5ed74e(0x1b9))/0x7+parseInt(_0x5ed74e(0x1f3))/0x8*(parseInt(_0x5ed74e(0x1d4))/0x9);if(_0x5646bb===_0x51da37)break;else _0x552492['push'](_0x552492['shift']());}catch(_0x366ea8){_0x552492['push'](_0x552492['shift']());}}}(a7_0x3b79,0xb9a82));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';function a7_0x3b79(){const _0x458805=['\x20\x20tdx','bold','✓\x20Profile\x20\x27','\x0aSetup\x20cancelled','Name:\x20','No\x20credential\x20found','apiKey','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','System\x20keychain\x20is\x20not\x20available','profile','\x20for\x20profile:\x20','Validating\x20API\x20key...','No\x20API\x20key\x20found\x20in\x20keychain','614916jlLaVK','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Setup\x20API\x20key\x20authentication\x20interactively','message','status','description','create','site','Setting\x20up\x20authentication\x20for\x20site:\x20','getUserInfo','yellow','green','auth:setup','Site\x20name\x20cannot\x20be\x20empty','warn','576CPMZJY','57896vXqCVn','join','select','last_name','name','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','You\x20can\x20find\x20your\x20API\x20key\x20at:','trim','\x20(profile:\x20','customSite','ERROR','error','4153070FTHmJN','N/A','tdx:\x20auth\x20setup','auth:clear','User:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','tdx\x20profile:\x20','2066183TKAocW','text','1323951fhkkcu','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x27\x20registered','email','\x20(site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','jobs','other','password','✓\x20Default\x20site\x20set\x20to\x20','Enter\x20site\x20name:','red','API\x20key\x20cannot\x20be\x20empty','log','✗\x20Validation\x20failed:\x20','/app/mp/ak','first_name','tdx:\x20auth\x20clear','auth','filter','us01','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','7838586YFrgSr','execute','1683oXSoem','4332hfxBgN'];a7_0x3b79=function(){return _0x458805;};return a7_0x3b79();}import{buildSiteChoices}from'../core/constants.js';function a7_0x2191(_0x8040fd,_0x4f067c){_0x8040fd=_0x8040fd-0x1b0;const _0x3b79ee=a7_0x3b79();let _0x219104=_0x3b79ee[_0x8040fd];return _0x219104;}import a7_0x5aebc1 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x161739 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x2a1e43(0x1ef);[a7_0x2a1e43(0x1e8)]=a7_0x2a1e43(0x1e5);async[a7_0x2a1e43(0x1d3)](_0x1506f3){const _0x1c312a=a7_0x2a1e43,{options:_0x1d52ac}=_0x1506f3,_0x37ec23=_0x1d52ac[_0x1c312a(0x1df)];console[_0x1c312a(0x1c8)](a7_0x161739[_0x1c312a(0x1d7)](_0x1c312a(0x1b4)));const _0x2f2bf4=_0x1d52ac[_0x1c312a(0x1ea)]||_0x1c312a(0x1cf),{choices:_0xcfc48f,initialIndex:_0x5ef171}=buildSiteChoices(_0x2f2bf4),_0x4e1809=_0x37ec23?_0x1c312a(0x1d1)+_0x37ec23+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x13b3b7=await a7_0x5aebc1({'type':_0x1c312a(0x1f5),'name':_0x1c312a(0x1ea),'message':_0x4e1809,'choices':_0xcfc48f,'initial':_0x5ef171});if(!_0x13b3b7[_0x1c312a(0x1ea)])return console[_0x1c312a(0x1c8)](_0x1c312a(0x1d9)),0x1;let _0xba1112;if(_0x13b3b7[_0x1c312a(0x1ea)]===_0x1c312a(0x1c2)){const _0x31eab8=await a7_0x5aebc1({'type':_0x1c312a(0x1ba),'name':_0x1c312a(0x1fd),'message':_0x1c312a(0x1c5),'initial':_0x1c312a(0x1cf),'validate':_0xd77caa=>{const _0x95b1ce=_0x1c312a;if(!_0xd77caa||!_0xd77caa['trim']())return _0x95b1ce(0x1f0);if(!/^[a-z0-9-]+$/['test'](_0xd77caa[_0x95b1ce(0x1fb)]()))return _0x95b1ce(0x1f8);return!![];}});if(!_0x31eab8[_0x1c312a(0x1fd)])return console[_0x1c312a(0x1c8)](_0x1c312a(0x1d9)),0x1;_0xba1112=_0x31eab8[_0x1c312a(0x1fd)];}else _0xba1112=_0x13b3b7[_0x1c312a(0x1ea)];const _0x3485cc=resolveSite(_0xba1112);console[_0x1c312a(0x1c8)](_0x1c312a(0x1eb)+_0x3485cc),console['log'](_0x1c312a(0x1fa)),console[_0x1c312a(0x1c8)]('\x20\x20'+getConsoleUrl(_0x3485cc,_0x1c312a(0x1ca)));const _0x495205=await a7_0x5aebc1({'type':_0x1c312a(0x1c3),'name':_0x1c312a(0x1dc),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x4e3810=>{const _0x4f72f3=_0x1c312a;if(!_0x4e3810||!_0x4e3810[_0x4f72f3(0x1fb)]())return _0x4f72f3(0x1c7);return!![];}});if(!_0x495205[_0x1c312a(0x1dc)])return console[_0x1c312a(0x1c8)](_0x1c312a(0x1d9)),0x1;const _0x2234a6=_0x495205['apiKey'];console['log'](_0x1c312a(0x1e1));try{const _0x24b0ce=TDX[_0x1c312a(0x1e9)]({'site':_0x3485cc,'apiKey':_0x2234a6[_0x1c312a(0x1fb)](),'logLevel':_0x1d52ac['logLevel']??LogLevel[_0x1c312a(0x1b0)]}),_0x4d5c7f=await _0x24b0ce['jobs'][_0x1c312a(0x1ec)]();console[_0x1c312a(0x1c8)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x4d5c7f[_0x1c312a(0x1be)]+')');const _0x5671c4=await isKeychainAvailable();_0x5671c4?(await saveAPIKeyAsync(_0x2234a6[_0x1c312a(0x1fb)](),_0x3485cc,_0x37ec23),console[_0x1c312a(0x1c8)](_0x1c312a(0x1dd)+(_0x37ec23?_0x1c312a(0x1fc)+_0x37ec23+')':''))):(console['warn'](a7_0x161739[_0x1c312a(0x1ed)](_0x1c312a(0x1bc))),console[_0x1c312a(0x1f1)](a7_0x161739[_0x1c312a(0x1ed)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x37ec23){const _0x520a11={'site':_0x3485cc};saveProfileToUserConfig(_0x37ec23,_0x520a11),console[_0x1c312a(0x1c8)](_0x1c312a(0x1d8)+_0x37ec23+_0x1c312a(0x1bd));}else saveDefaultSiteToUserConfig(_0x3485cc),console['log'](_0x1c312a(0x1c4)+_0x3485cc);const _0x21474b=_0x37ec23?'\x20--profile\x20'+_0x37ec23:'';return console[_0x1c312a(0x1c8)](),console['log'](_0x1c312a(0x1d0)),console[_0x1c312a(0x1c8)](_0x1c312a(0x1d6)+_0x21474b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1c312a(0x1c8)]('\x20\x20tdx'+_0x21474b+_0x1c312a(0x1c0)),0x0;}catch(_0x297efa){if(_0x297efa instanceof HTTPClientError&&_0x297efa[_0x1c312a(0x1e7)]===0x191)return printAuthError(_0x297efa),0x1;return console[_0x1c312a(0x1b1)](a7_0x161739[_0x1c312a(0x1c6)](_0x1c312a(0x1c9)+(_0x297efa instanceof Error?_0x297efa[_0x1c312a(0x1e6)]:String(_0x297efa)))),console[_0x1c312a(0x1b1)](_0x1c312a(0x1f9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2a1e43(0x1f7)]=a7_0x2a1e43(0x1cd);[a7_0x2a1e43(0x1e8)]=a7_0x2a1e43(0x1e4);async[a7_0x2a1e43(0x1d3)](_0xc47c80){const _0x446443=a7_0x2a1e43,{options:_0x3fcf02,tdx:_0x4820fe}=_0xc47c80,_0x36cfad=_0x3fcf02[_0x446443(0x1ea)],_0x3ca5e7=_0x3fcf02[_0x446443(0x1df)],_0x33d2f4=_0x3ca5e7?_0x3ca5e7:_0x446443(0x1b3);console[_0x446443(0x1c8)](_0x446443(0x1b8)+_0x33d2f4+_0x446443(0x1bf)+_0x36cfad+')');const _0x5da9fe=await resolveAPIKeyAsync(_0x36cfad,_0x3ca5e7);if(_0x5da9fe){const {source:_0x3ceffb,isDeprecated:_0xea4ab3}=_0x5da9fe,_0x14f30d='Read\x20credential\x20from\x20'+_0x3ceffb;console[_0x446443(0x1c8)](_0xea4ab3?a7_0x161739[_0x446443(0x1ed)](_0x14f30d):_0x14f30d);}else console[_0x446443(0x1c8)](a7_0x161739[_0x446443(0x1ed)](_0x446443(0x1db)));try{const _0x42536f=await _0x4820fe[_0x446443(0x1c1)][_0x446443(0x1ec)]();return console[_0x446443(0x1c8)](a7_0x161739[_0x446443(0x1ee)]('✓\x20Authentication\x20successful\x0a')),console[_0x446443(0x1c8)](_0x446443(0x1b6)+_0x42536f[_0x446443(0x1be)]),(_0x42536f[_0x446443(0x1cb)]||_0x42536f[_0x446443(0x1f6)])&&console['log'](_0x446443(0x1da)+[_0x42536f[_0x446443(0x1cb)],_0x42536f[_0x446443(0x1f6)]][_0x446443(0x1ce)](Boolean)[_0x446443(0x1f4)]('\x20')),0x0;}catch(_0x590bed){return _0x590bed instanceof HTTPClientError&&_0x590bed['status']===0x191?printAuthError(_0x590bed,!![],_0x3ca5e7):console[_0x446443(0x1b1)](a7_0x161739['red']('✗\x20Validation\x20failed:\x20'+(_0x590bed instanceof Error?_0x590bed[_0x446443(0x1e6)]:String(_0x590bed)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x2a1e43(0x1f7)]=a7_0x2a1e43(0x1b5);[a7_0x2a1e43(0x1e8)]=a7_0x2a1e43(0x1b7);async[a7_0x2a1e43(0x1d3)](_0x40c0a3){const _0x507e80=a7_0x2a1e43,{options:_0x5674bc}=_0x40c0a3,_0x475bb7=_0x5674bc[_0x507e80(0x1df)];console[_0x507e80(0x1c8)](a7_0x161739[_0x507e80(0x1d7)](_0x507e80(0x1cc)));const _0x5f032b=await isKeychainAvailable();if(!_0x5f032b)return console['error'](a7_0x161739[_0x507e80(0x1c6)](_0x507e80(0x1de))),0x1;const _0x94d42b=await deleteKeychainAPIKey(_0x475bb7);return _0x94d42b?(clearCredentialCache(),console[_0x507e80(0x1c8)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x475bb7?_0x507e80(0x1fc)+_0x475bb7+')':'')),0x0):(console[_0x507e80(0x1c8)](_0x507e80(0x1e2)+(_0x475bb7?_0x507e80(0x1e0)+_0x475bb7:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x2ba85d=a8_0x4f25;(function(_0x47e55a,_0x2a3f1c){const _0x4e06a8=a8_0x4f25,_0x5f4961=_0x47e55a();while(!![]){try{const _0x245ca0=-parseInt(_0x4e06a8(0x1bb))/0x1+-parseInt(_0x4e06a8(0x1c3))/0x2*(parseInt(_0x4e06a8(0x180))/0x3)+-parseInt(_0x4e06a8(0x191))/0x4*(-parseInt(_0x4e06a8(0x1bd))/0x5)+parseInt(_0x4e06a8(0x17b))/0x6*(-parseInt(_0x4e06a8(0x195))/0x7)+-parseInt(_0x4e06a8(0x1a2))/0x8*(parseInt(_0x4e06a8(0x17f))/0x9)+-parseInt(_0x4e06a8(0x1b7))/0xa*(parseInt(_0x4e06a8(0x181))/0xb)+parseInt(_0x4e06a8(0x1a8))/0xc;if(_0x245ca0===_0x2a3f1c)break;else _0x5f4961['push'](_0x5f4961['shift']());}catch(_0x40bb0b){_0x5f4961['push'](_0x5f4961['shift']());}}}(a8_0x3fa2,0xdafa1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x3fa2(){const _0x4c702d=['Error:\x20Chat\x20session\x20\x27','targetWebSearchTool','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','type','name','Continuing\x20chat:\x20','4417750kKSkCk','metadata','404','streamChatJsonl','837418XtJatl','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','305815OVtOhf','options','\x0aStack\x20trace:','claude-4.5-haiku','getDefaultAgent','session\x20context','688570jJSOQg','Resolving\x20agent\x20\x27','tool','content','\x27...','verbose','llmAgent','handleChatEvent','774yosTJA','context','string','error','4179096zNIHgU','3KxrxaL','22XmdSzW','projectId','agent','chatId','stream','llmProject','Resolving\x20project\x20\x27','Using\x20agent\x20from\x20','new','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','description','targetFunction','targetAgent','startChat','code','stdout','32tWGqHH','Create\x20a\x20new\x20chat\x20session','data','execute','55888PHEeMw','cause','streamChat','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Chat\x20session:\x20','--agent\x20flag','tool_call','Getting\x20default\x20agent...','\x20\x20Cause:\x20','Using\x20cached\x20default\x20agent:\x20','functionName','stringify','\x27\x20not\x20found','8MAJgWW','args','message','llm','log','site','47605896ddKZhW','getOrCreateDefaultAgent','chat','stack','join','\x0aError:\x20','resolveProjectId','event','agentId'];a8_0x3fa2=function(){return _0x4c702d;};return a8_0x3fa2();}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(_0x10797e,_0x498d8c){const _0x574289=a8_0x4f25;if(_0x10797e instanceof SDKError)console['error']('Error:\x20'+_0x10797e[_0x574289(0x1a4)]),_0x498d8c[_0x574289(0x178)]&&(_0x10797e[_0x574289(0x196)]&&console['error'](_0x574289(0x19d)+_0x10797e['cause']),_0x10797e['stack']&&(console[_0x574289(0x17e)](_0x574289(0x1bf)),console['error'](_0x10797e[_0x574289(0x1ab)])));else throw _0x10797e;}function a8_0x4f25(_0x4ddb1c,_0x52d011){_0x4ddb1c=_0x4ddb1c-0x174;const _0x3fa248=a8_0x3fa2();let _0x4f25da=_0x3fa248[_0x4ddb1c];return _0x4f25da;}async function resolveAgentId(_0x57c604,_0x31c2c4,_0x551268,_0x43808e,_0x4960ff){const _0x542205=a8_0x4f25,_0x1704ae=_0x31c2c4||_0x551268;if(_0x1704ae){const {projectName:_0x4b9874,agentName:_0x242ac6}=parseAgentRef(_0x1704ae),_0x19b26d=_0x242ac6||_0x1704ae,_0x3d5988=_0x242ac6?_0x4b9874:_0x43808e;if(!_0x3d5988)throw new Error(_0x542205(0x1bc));if(_0x4960ff){const _0x43adee=_0x31c2c4?_0x542205(0x19a):_0x542205(0x1c2);console[_0x542205(0x17e)](_0x542205(0x188)+_0x43adee+':\x20'+_0x3d5988+'/'+_0x19b26d);}const _0x2d3463=await withSpinner(_0x542205(0x187)+_0x3d5988+'\x27...',()=>_0x57c604[_0x542205(0x1a5)][_0x542205(0x1ae)](_0x3d5988),{'verbose':_0x4960ff}),_0x498649=await withSpinner(_0x542205(0x174)+_0x19b26d+_0x542205(0x177),()=>_0x57c604[_0x542205(0x1a5)]['resolveAgentId'](_0x19b26d,_0x2d3463['data']),{'verbose':_0x4960ff});return _0x498649['data'];}else{const _0x41a818=_0x57c604[_0x542205(0x1a5)][_0x542205(0x1c1)]();if(_0x41a818)return _0x4960ff&&console['error'](_0x542205(0x19e)+_0x41a818[_0x542205(0x1b5)]),_0x41a818['id'];const _0x268285=await withSpinner(_0x542205(0x19c),()=>_0x57c604[_0x542205(0x1a5)][_0x542205(0x1a9)](_0x542205(0x1c0),0x0),{'verbose':_0x4960ff});return _0x268285[_0x542205(0x193)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x2ba85d(0x1b5)]='chat';['description']=a8_0x2ba85d(0x198);['validate'](_0x52066f){const _0x2a9ef4=a8_0x2ba85d,_0x575b41=_0x52066f[_0x2a9ef4(0x1a3)]['join']('\x20');if(!_0x575b41)return _0x2a9ef4(0x18a);return undefined;}async[a8_0x2ba85d(0x197)](_0x2c09bb,_0x392f33,_0x1ced2b,_0xb7237f,_0x4b2140){const _0x231ac7=a8_0x2ba85d;for await(const _0x399597 of _0x2c09bb[_0x231ac7(0x1a5)][_0x231ac7(0x1aa)](_0x392f33,{'agentId':_0x1ced2b,'chatId':_0xb7237f})){if(_0x399597['type']===_0x231ac7(0x1b8)){const _0x3b5f1d=_0x399597[_0x231ac7(0x193)][_0x231ac7(0x184)];saveLastChatId(_0x3b5f1d),_0x4b2140&&console[_0x231ac7(0x17e)](_0x231ac7(0x199)+_0x3b5f1d);}else _0x399597[_0x231ac7(0x1b4)]===_0x231ac7(0x1af)&&this[_0x231ac7(0x17a)](_0x399597[_0x231ac7(0x193)]);}}async['streamChatJsonl'](_0x55ca1d,_0x4e5cf7,_0xadd353,_0x1c80cd){const _0x1ec9f1=a8_0x2ba85d,_0xa94581=_0x55ca1d[_0x1ec9f1(0x17c)][_0x1ec9f1(0x1a7)];let _0x90a980=![];for await(const _0x3836fe of _0x55ca1d[_0x1ec9f1(0x1a5)][_0x1ec9f1(0x1aa)](_0x4e5cf7,{'agentId':_0xadd353,'chatId':_0x1c80cd})){if(_0x3836fe[_0x1ec9f1(0x1b4)]==='metadata'){const _0x1f685d=_0x3836fe[_0x1ec9f1(0x193)];saveLastChatId(_0x1f685d[_0x1ec9f1(0x184)]);const _0x54dda7=_0x1f685d['projectId']&&_0x1f685d[_0x1ec9f1(0x1b0)]?getLLMConversationUrl(_0xa94581,_0x1f685d[_0x1ec9f1(0x182)],_0x1f685d[_0x1ec9f1(0x1b0)],_0x1f685d[_0x1ec9f1(0x184)]):undefined;console['log'](JSON[_0x1ec9f1(0x1a0)]({'type':_0x1ec9f1(0x1b8),'data':{'chatId':_0x1f685d[_0x1ec9f1(0x184)],'agentId':_0x1f685d[_0x1ec9f1(0x1b0)],'consoleUrl':_0x54dda7}})),_0x90a980=!![];}else{if(_0x3836fe[_0x1ec9f1(0x1b4)]==='event'){!_0x90a980&&_0x1c80cd&&(console['log'](JSON[_0x1ec9f1(0x1a0)]({'type':_0x1ec9f1(0x1b8),'data':{'chatId':_0x1c80cd}})),_0x90a980=!![]);const _0x3ad241=_0x3836fe[_0x1ec9f1(0x193)];if(_0x1ec9f1(0x176)in _0x3ad241)console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'content','data':{'content':_0x3ad241[_0x1ec9f1(0x176)]}}));else{if(_0x1ec9f1(0x19b)in _0x3ad241){const _0x5b1aa5=_0x3ad241[_0x1ec9f1(0x19b)];console[_0x1ec9f1(0x1a6)](JSON['stringify']({'type':_0x1ec9f1(0x19b),'data':{'id':_0x5b1aa5['id'],'name':_0x5b1aa5[_0x1ec9f1(0x19f)],'target':_0x5b1aa5['targetKnowledgeBase']?.[_0x1ec9f1(0x1b5)]||_0x5b1aa5[_0x1ec9f1(0x18d)]?.['name']||_0x5b1aa5[_0x1ec9f1(0x1b2)]?.[_0x1ec9f1(0x1b5)]||_0x5b1aa5[_0x1ec9f1(0x18c)]}}));}else{if(_0x1ec9f1(0x175)in _0x3ad241)console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'tool_result','data':{'id':_0x3ad241[_0x1ec9f1(0x175)]['id'],'name':_0x3ad241['tool'][_0x1ec9f1(0x19f)],'result':typeof _0x3ad241[_0x1ec9f1(0x175)][_0x1ec9f1(0x176)]===_0x1ec9f1(0x17d)?_0x3ad241[_0x1ec9f1(0x175)][_0x1ec9f1(0x176)]['slice'](0x0,0x1f4):''}}));else _0x1ec9f1(0x17e)in _0x3ad241&&console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'error','data':{'error':_0x3ad241[_0x1ec9f1(0x17e)]}}));}}}}}console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'done'}));}async[a8_0x2ba85d(0x194)](_0x5021cb){const _0xbcd81=a8_0x2ba85d,{options:_0x339e0e,args:_0x41e09b,tdx:_0x4d53c6}=_0x5021cb,_0x24125d=_0x41e09b[_0xbcd81(0x1ac)]('\x20'),_0x40dc14=_0x339e0e,_0x53a447=_0x40dc14['agent'],_0x314ef8=_0x40dc14[_0xbcd81(0x179)],_0x397b5a=_0x40dc14[_0xbcd81(0x186)],_0x772747=_0x40dc14[_0xbcd81(0x189)],_0x2a7367=_0x40dc14['chatId'],_0xf2c724=_0x40dc14[_0xbcd81(0x185)];if(_0x772747&&_0x2a7367)return console[_0xbcd81(0x17e)](_0xbcd81(0x1b3)),0x1;try{let _0x515978,_0x543d71;if(_0x2a7367)_0x543d71=_0x2a7367;else!_0x772747&&(_0x543d71=loadLastChatId(),_0x543d71&&_0x339e0e[_0xbcd81(0x178)]&&console[_0xbcd81(0x17e)](_0xbcd81(0x1b6)+_0x543d71));!_0x2a7367&&(_0x772747||!_0x543d71)&&(_0x515978=await resolveAgentId(_0x4d53c6,_0x53a447,_0x314ef8,_0x397b5a,_0x339e0e[_0xbcd81(0x178)]));const _0x42a330=_0xf2c724?(_0x30c1a5,_0x57002f,_0x41e1a5)=>this[_0xbcd81(0x1ba)](_0x4d53c6,_0x30c1a5,_0x57002f,_0x41e1a5):(_0x88be6,_0x3d0f30,_0x272f00)=>this[_0xbcd81(0x197)](_0x4d53c6,_0x88be6,_0x3d0f30,_0x272f00,_0x339e0e[_0xbcd81(0x178)]);try{await _0x42a330(_0x24125d,_0x515978,_0x543d71);}catch(_0x21259b){const _0x3e633b=_0x21259b instanceof SDKError&&_0x21259b[_0xbcd81(0x18f)]===ErrorCode['CHAT_NOT_FOUND']||_0x21259b instanceof Error&&_0x21259b[_0xbcd81(0x1a4)]['includes'](_0xbcd81(0x1b9));if(_0x3e633b&&_0x2a7367)return console['error'](_0xbcd81(0x1b1)+_0x2a7367+_0xbcd81(0x1a1)),0x1;if(_0x3e633b)_0x339e0e[_0xbcd81(0x178)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x515978&&(_0x515978=await resolveAgentId(_0x4d53c6,_0x53a447,_0x314ef8,_0x397b5a,_0x339e0e[_0xbcd81(0x178)])),await _0x42a330(_0x24125d,_0x515978,undefined);else throw _0x21259b;}return!_0xf2c724&&console[_0xbcd81(0x1a6)](),0x0;}catch(_0xa19879){return console['error'](),handleSDKError(_0xa19879,_0x339e0e),0x1;}}['handleChatEvent'](_0x13c7ce){const _0x5e2ab4=a8_0x2ba85d;if(_0x5e2ab4(0x176)in _0x13c7ce)process[_0x5e2ab4(0x190)]['write'](_0x13c7ce[_0x5e2ab4(0x176)]);else _0x5e2ab4(0x17e)in _0x13c7ce&&console['error'](_0x5e2ab4(0x1ad)+_0x13c7ce[_0x5e2ab4(0x17e)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x2ba85d(0x1b5)]='chat-create';[a8_0x2ba85d(0x18b)]=a8_0x2ba85d(0x192);['validate'](_0x515bf2){const _0x585b40=a8_0x2ba85d,_0x24cd2e=_0x515bf2[_0x585b40(0x1be)],_0x32828e=_0x24cd2e[_0x585b40(0x183)],_0x308f79=_0x24cd2e[_0x585b40(0x179)];if(!_0x32828e&&!_0x308f79)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async['execute'](_0x1cbfb8){const _0x558a6f=a8_0x2ba85d,{options:_0x7198bb,tdx:_0x2a5a0e}=_0x1cbfb8,_0x8d9fb6=_0x7198bb,_0x6b0a11=_0x8d9fb6[_0x558a6f(0x183)],_0x26a96a=_0x8d9fb6['llmAgent'],_0x3e4c03=_0x8d9fb6['llmProject'];try{const _0x2352ed=await resolveAgentId(_0x2a5a0e,_0x6b0a11,_0x26a96a,_0x3e4c03,_0x7198bb[_0x558a6f(0x178)]),_0x6dab1f=await _0x2a5a0e['llm'][_0x558a6f(0x18e)](_0x2352ed);return saveLastChatId(_0x6dab1f['id']),console[_0x558a6f(0x1a6)](JSON[_0x558a6f(0x1a0)]({'chatId':_0x6dab1f['id'],'agentId':_0x2352ed})),0x0;}catch(_0x4d20de){return handleSDKError(_0x4d20de,_0x7198bb),0x1;}}}
|
|
1
|
+
const a8_0xe86108=a8_0x339d;(function(_0xe66683,_0x507ccc){const _0x1919b1=a8_0x339d,_0x1ee2b4=_0xe66683();while(!![]){try{const _0x2956da=-parseInt(_0x1919b1(0xfc))/0x1+parseInt(_0x1919b1(0xf6))/0x2+parseInt(_0x1919b1(0xf1))/0x3*(parseInt(_0x1919b1(0x10f))/0x4)+parseInt(_0x1919b1(0xea))/0x5+-parseInt(_0x1919b1(0x11a))/0x6+-parseInt(_0x1919b1(0x10d))/0x7+parseInt(_0x1919b1(0x118))/0x8*(parseInt(_0x1919b1(0xe6))/0x9);if(_0x2956da===_0x507ccc)break;else _0x1ee2b4['push'](_0x1ee2b4['shift']());}catch(_0x4bef42){_0x1ee2b4['push'](_0x1ee2b4['shift']());}}}(a8_0x5475,0x4ce15));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';function a8_0x5475(){const _0x5f32ec=['metadata','tool','error','event','write','404','resolveAgentId','description','handleChatEvent','targetFunction','site','name','2257003pJhPhK','targetAgent','4foWXmM','stream','string','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','context','code','validate','data','targetWebSearchTool','851528SDEQkG','agent','2891538FmgjVO','Chat\x20session:\x20','Error:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','\x27\x20not\x20found','Create\x20a\x20new\x20chat\x20session','execute','chatId','Resolving\x20project\x20\x27','Using\x20cached\x20default\x20agent:\x20','chat','verbose','stringify','llm','tool_call','agentId','log','done','streamChat','CHAT_NOT_FOUND','startChat','Getting\x20default\x20agent...','new','cause','join','llmAgent','stdout','--agent\x20flag','63HMvXHV','targetKnowledgeBase','getDefaultAgent','functionName','521975GzhIiz','Error:\x20Chat\x20session\x20\x27','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','content','\x27...','projectId','streamChatJsonl','164679XcRdoY','slice','includes','chat-create','claude-4.5-haiku','581652ITrTlP','\x20\x20Cause:\x20','stack','type','getOrCreateDefaultAgent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','75948hrjSbx','llmProject','message','Resolving\x20agent\x20\x27','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)'];a8_0x5475=function(){return _0x5f32ec;};return a8_0x5475();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x1ff50d,_0x3f5fae){const _0x915086=a8_0x339d;if(_0x1ff50d instanceof SDKError)console[_0x915086(0x103)](_0x915086(0x11c)+_0x1ff50d[_0x915086(0xfe)]),_0x3f5fae[_0x915086(0x125)]&&(_0x1ff50d['cause']&&console[_0x915086(0x103)](_0x915086(0xf7)+_0x1ff50d[_0x915086(0x131)]),_0x1ff50d['stack']&&(console[_0x915086(0x103)]('\x0aStack\x20trace:'),console[_0x915086(0x103)](_0x1ff50d[_0x915086(0xf8)])));else throw _0x1ff50d;}function a8_0x339d(_0x41ec01,_0x200963){_0x41ec01=_0x41ec01-0xe4;const _0x547555=a8_0x5475();let _0x339d86=_0x547555[_0x41ec01];return _0x339d86;}async function resolveAgentId(_0x154228,_0x22defe,_0x160029,_0x1103f0,_0x52c83a){const _0x41a0dd=a8_0x339d,_0x4aa589=_0x22defe||_0x160029;if(_0x4aa589){const {projectName:_0x3428e6,agentName:_0xf0095a}=parseAgentRef(_0x4aa589),_0x4e7861=_0xf0095a||_0x4aa589,_0x51c7bf=_0xf0095a?_0x3428e6:_0x1103f0;if(!_0x51c7bf)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x52c83a){const _0x1673f6=_0x22defe?_0x41a0dd(0xe5):'session\x20context';console[_0x41a0dd(0x103)]('Using\x20agent\x20from\x20'+_0x1673f6+':\x20'+_0x51c7bf+'/'+_0x4e7861);}const _0x1401b9=await withSpinner(_0x41a0dd(0x122)+_0x51c7bf+_0x41a0dd(0xee),()=>_0x154228[_0x41a0dd(0x127)]['resolveProjectId'](_0x51c7bf),{'verbose':_0x52c83a}),_0x69fba4=await withSpinner(_0x41a0dd(0xff)+_0x4e7861+_0x41a0dd(0xee),()=>_0x154228['llm'][_0x41a0dd(0x107)](_0x4e7861,_0x1401b9[_0x41a0dd(0x116)]),{'verbose':_0x52c83a});return _0x69fba4[_0x41a0dd(0x116)];}else{const _0x340c3d=_0x154228['llm'][_0x41a0dd(0xe8)]();if(_0x340c3d)return _0x52c83a&&console['error'](_0x41a0dd(0x123)+_0x340c3d['name']),_0x340c3d['id'];const _0x21a57f=await withSpinner(_0x41a0dd(0x12f),()=>_0x154228[_0x41a0dd(0x127)][_0x41a0dd(0xfa)](_0x41a0dd(0xf5),0x0),{'verbose':_0x52c83a});return _0x21a57f[_0x41a0dd(0x116)]['id'];}}export class ChatCommand extends BaseCommand{['name']='chat';[a8_0xe86108(0x108)]=a8_0xe86108(0x100);['validate'](_0x1458f1){const _0x4f4368=a8_0xe86108,_0x3ab393=_0x1458f1['args'][_0x4f4368(0x132)]('\x20');if(!_0x3ab393)return _0x4f4368(0x11d);return undefined;}async[a8_0xe86108(0x12c)](_0x55969d,_0x2041a3,_0x4a4e6b,_0x1b7dfb,_0x5c5b8b){const _0x170d0b=a8_0xe86108;for await(const _0x708930 of _0x55969d[_0x170d0b(0x127)][_0x170d0b(0x124)](_0x2041a3,{'agentId':_0x4a4e6b,'chatId':_0x1b7dfb})){if(_0x708930[_0x170d0b(0xf9)]===_0x170d0b(0x101)){const _0x425369=_0x708930[_0x170d0b(0x116)][_0x170d0b(0x121)];saveLastChatId(_0x425369),_0x5c5b8b&&console[_0x170d0b(0x103)](_0x170d0b(0x11b)+_0x425369);}else _0x708930[_0x170d0b(0xf9)]===_0x170d0b(0x104)&&this[_0x170d0b(0x109)](_0x708930[_0x170d0b(0x116)]);}}async[a8_0xe86108(0xf0)](_0x36abf8,_0xee709b,_0x1dafe4,_0x59f57e){const _0x48bf96=a8_0xe86108,_0x3b7b14=_0x36abf8[_0x48bf96(0x113)][_0x48bf96(0x10b)];let _0x1192cf=![];for await(const _0x278082 of _0x36abf8[_0x48bf96(0x127)][_0x48bf96(0x124)](_0xee709b,{'agentId':_0x1dafe4,'chatId':_0x59f57e})){if(_0x278082[_0x48bf96(0xf9)]===_0x48bf96(0x101)){const _0x1d7bb9=_0x278082['data'];saveLastChatId(_0x1d7bb9[_0x48bf96(0x121)]);const _0x4bbe0d=_0x1d7bb9['projectId']&&_0x1d7bb9[_0x48bf96(0x129)]?getLLMConversationUrl(_0x3b7b14,_0x1d7bb9[_0x48bf96(0xef)],_0x1d7bb9[_0x48bf96(0x129)],_0x1d7bb9[_0x48bf96(0x121)]):undefined;console[_0x48bf96(0x12a)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x1d7bb9[_0x48bf96(0x121)],'agentId':_0x1d7bb9[_0x48bf96(0x129)],'consoleUrl':_0x4bbe0d}})),_0x1192cf=!![];}else{if(_0x278082[_0x48bf96(0xf9)]===_0x48bf96(0x104)){!_0x1192cf&&_0x59f57e&&(console[_0x48bf96(0x12a)](JSON[_0x48bf96(0x126)]({'type':_0x48bf96(0x101),'data':{'chatId':_0x59f57e}})),_0x1192cf=!![]);const _0x4b7102=_0x278082[_0x48bf96(0x116)];if(_0x48bf96(0xed)in _0x4b7102)console[_0x48bf96(0x12a)](JSON[_0x48bf96(0x126)]({'type':_0x48bf96(0xed),'data':{'content':_0x4b7102[_0x48bf96(0xed)]}}));else{if(_0x48bf96(0x128)in _0x4b7102){const _0x41899c=_0x4b7102[_0x48bf96(0x128)];console['log'](JSON[_0x48bf96(0x126)]({'type':_0x48bf96(0x128),'data':{'id':_0x41899c['id'],'name':_0x41899c[_0x48bf96(0xe9)],'target':_0x41899c[_0x48bf96(0xe7)]?.[_0x48bf96(0x10c)]||_0x41899c[_0x48bf96(0x10e)]?.[_0x48bf96(0x10c)]||_0x41899c[_0x48bf96(0x117)]?.[_0x48bf96(0x10c)]||_0x41899c[_0x48bf96(0x10a)]}}));}else{if(_0x48bf96(0x102)in _0x4b7102)console['log'](JSON[_0x48bf96(0x126)]({'type':'tool_result','data':{'id':_0x4b7102[_0x48bf96(0x102)]['id'],'name':_0x4b7102[_0x48bf96(0x102)][_0x48bf96(0xe9)],'result':typeof _0x4b7102[_0x48bf96(0x102)]['content']===_0x48bf96(0x111)?_0x4b7102[_0x48bf96(0x102)][_0x48bf96(0xed)][_0x48bf96(0xf2)](0x0,0x1f4):''}}));else _0x48bf96(0x103)in _0x4b7102&&console[_0x48bf96(0x12a)](JSON[_0x48bf96(0x126)]({'type':_0x48bf96(0x103),'data':{'error':_0x4b7102[_0x48bf96(0x103)]}}));}}}}}console[_0x48bf96(0x12a)](JSON['stringify']({'type':_0x48bf96(0x12b)}));}async[a8_0xe86108(0x120)](_0x5d1d20){const _0x704137=a8_0xe86108,{options:_0x2a7d62,args:_0x47c79a,tdx:_0x161c33}=_0x5d1d20,_0x133709=_0x47c79a[_0x704137(0x132)]('\x20'),_0x124f38=_0x2a7d62,_0x232567=_0x124f38[_0x704137(0x119)],_0x1d1edf=_0x124f38[_0x704137(0x133)],_0x1e50b9=_0x124f38[_0x704137(0xfd)],_0x10ee45=_0x124f38[_0x704137(0x130)],_0x37ba1=_0x124f38[_0x704137(0x121)],_0x3b0e17=_0x124f38[_0x704137(0x110)];if(_0x10ee45&&_0x37ba1)return console[_0x704137(0x103)](_0x704137(0x112)),0x1;try{let _0x13f25b,_0xe7774d;if(_0x37ba1)_0xe7774d=_0x37ba1;else!_0x10ee45&&(_0xe7774d=loadLastChatId(),_0xe7774d&&_0x2a7d62[_0x704137(0x125)]&&console[_0x704137(0x103)]('Continuing\x20chat:\x20'+_0xe7774d));!_0x37ba1&&(_0x10ee45||!_0xe7774d)&&(_0x13f25b=await resolveAgentId(_0x161c33,_0x232567,_0x1d1edf,_0x1e50b9,_0x2a7d62[_0x704137(0x125)]));const _0x3d6141=_0x3b0e17?(_0x322968,_0x10a69d,_0x5ab63b)=>this[_0x704137(0xf0)](_0x161c33,_0x322968,_0x10a69d,_0x5ab63b):(_0x57b037,_0x4e80e9,_0x2b09d6)=>this[_0x704137(0x12c)](_0x161c33,_0x57b037,_0x4e80e9,_0x2b09d6,_0x2a7d62['verbose']);try{await _0x3d6141(_0x133709,_0x13f25b,_0xe7774d);}catch(_0x2d96dc){const _0x518996=_0x2d96dc instanceof SDKError&&_0x2d96dc[_0x704137(0x114)]===ErrorCode[_0x704137(0x12d)]||_0x2d96dc instanceof Error&&_0x2d96dc[_0x704137(0xfe)][_0x704137(0xf3)](_0x704137(0x106));if(_0x518996&&_0x37ba1)return console[_0x704137(0x103)](_0x704137(0xeb)+_0x37ba1+_0x704137(0x11e)),0x1;if(_0x518996)_0x2a7d62[_0x704137(0x125)]&&console[_0x704137(0x103)](_0x704137(0xec)),!_0x13f25b&&(_0x13f25b=await resolveAgentId(_0x161c33,_0x232567,_0x1d1edf,_0x1e50b9,_0x2a7d62['verbose'])),await _0x3d6141(_0x133709,_0x13f25b,undefined);else throw _0x2d96dc;}return!_0x3b0e17&&console['log'](),0x0;}catch(_0x1a027d){return console[_0x704137(0x103)](),handleSDKError(_0x1a027d,_0x2a7d62),0x1;}}[a8_0xe86108(0x109)](_0x5b1172){const _0x430b07=a8_0xe86108;if('content'in _0x5b1172)process[_0x430b07(0xe4)][_0x430b07(0x105)](_0x5b1172[_0x430b07(0xed)]);else'error'in _0x5b1172&&console[_0x430b07(0x103)]('\x0aError:\x20'+_0x5b1172[_0x430b07(0x103)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0xe86108(0x10c)]=a8_0xe86108(0xf4);[a8_0xe86108(0x108)]=a8_0xe86108(0x11f);[a8_0xe86108(0x115)](_0x4bc1f2){const _0x52dd52=a8_0xe86108,_0x5a4154=_0x4bc1f2['options'],_0x2ac039=_0x5a4154[_0x52dd52(0x119)],_0x1f7378=_0x5a4154[_0x52dd52(0x133)];if(!_0x2ac039&&!_0x1f7378)return _0x52dd52(0xfb);return undefined;}async[a8_0xe86108(0x120)](_0x4e9c6b){const _0x5b4db4=a8_0xe86108,{options:_0x20625e,tdx:_0x2db335}=_0x4e9c6b,_0x4d01d9=_0x20625e,_0x33aa93=_0x4d01d9['agent'],_0x5f18ba=_0x4d01d9['llmAgent'],_0x32fe6f=_0x4d01d9[_0x5b4db4(0xfd)];try{const _0x869b89=await resolveAgentId(_0x2db335,_0x33aa93,_0x5f18ba,_0x32fe6f,_0x20625e[_0x5b4db4(0x125)]),_0x2b3e77=await _0x2db335[_0x5b4db4(0x127)][_0x5b4db4(0x12e)](_0x869b89);return saveLastChatId(_0x2b3e77['id']),console[_0x5b4db4(0x12a)](JSON[_0x5b4db4(0x126)]({'chatId':_0x2b3e77['id'],'agentId':_0x869b89})),0x0;}catch(_0x37154b){return handleSDKError(_0x37154b,_0x20625e),0x1;}}}
|