@treasuredata/tdx 0.26.5 → 0.26.6
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
|
-
function
|
|
1
|
+
function a3_0x3862(_0x565f87,_0x35e5ea){_0x565f87=_0x565f87-0x196;const _0x2b82ab=a3_0x2b82();let _0x386292=_0x2b82ab[_0x565f87];return _0x386292;}const a3_0x4da9ef=a3_0x3862;(function(_0x15b89c,_0x4f273a){const _0x134f01=a3_0x3862,_0x555e5c=_0x15b89c();while(!![]){try{const _0x1155c6=parseInt(_0x134f01(0x1ba))/0x1*(parseInt(_0x134f01(0x1a0))/0x2)+parseInt(_0x134f01(0x1a2))/0x3*(-parseInt(_0x134f01(0x1b0))/0x4)+parseInt(_0x134f01(0x1ac))/0x5*(-parseInt(_0x134f01(0x1b9))/0x6)+-parseInt(_0x134f01(0x196))/0x7*(parseInt(_0x134f01(0x1b6))/0x8)+-parseInt(_0x134f01(0x1ad))/0x9+parseInt(_0x134f01(0x1aa))/0xa+-parseInt(_0x134f01(0x1b8))/0xb*(-parseInt(_0x134f01(0x1b5))/0xc);if(_0x1155c6===_0x4f273a)break;else _0x555e5c['push'](_0x555e5c['shift']());}catch(_0x37a149){_0x555e5c['push'](_0x555e5c['shift']());}}}(a3_0x2b82,0x2c7b9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x2b82(){const _0x1fc046=['4izOqeO','verbose','Resolving\x20parent\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','error','146268oeSFAs','32ERxSSW','Error:\x20','594wRbMVQ','6LKmyfl','127847VUOQxK','length','54131XtFddE','name','Resolved\x20child\x20ID:\x20','description','\x27...','execute','\x20activation','cause','List\x20activations\x20for\x20a\x20segment','Parent\x20name:\x20','2bLvJbm','Site:\x20','915357BLxpEP','✔\x20Found\x20','Child\x20name:\x20','activations','segment','Resolving\x20child\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x20\x20Cause:\x20','1765820XeUdfP','message','931605FWKgqw','2322558kUvXMJ','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Listing\x20activations\x20for\x20segment\x20\x27'];a3_0x2b82=function(){return _0x1fc046;};return a3_0x2b82();}export class ActivationsCommand extends BaseCommand{[a3_0x4da9ef(0x197)]=a3_0x4da9ef(0x1a5);[a3_0x4da9ef(0x199)]=a3_0x4da9ef(0x19e);async[a3_0x4da9ef(0x19b)](_0x51508f){const _0x597c13=a3_0x4da9ef,{options:_0x4456d2,args:_0x3cd2c3,tdx:_0x4ed35e}=_0x51508f;if(_0x3cd2c3['length']===0x0)return console[_0x597c13(0x1b4)](_0x597c13(0x1b3)),console[_0x597c13(0x1b4)](_0x597c13(0x1ae)),0x1;try{const {parentId:_0x33bab9,childId:_0x21d3f2}=parseSegmentRef(_0x3cd2c3[0x0]);if(!_0x21d3f2)return console[_0x597c13(0x1b4)](_0x597c13(0x1a8)),console['error'](_0x597c13(0x1ae)),0x1;_0x4456d2[_0x597c13(0x1b1)]&&(console[_0x597c13(0x1b4)](_0x597c13(0x1a1)+_0x4456d2['site']),console[_0x597c13(0x1b4)](_0x597c13(0x19f)+_0x33bab9),console[_0x597c13(0x1b4)](_0x597c13(0x1a4)+_0x21d3f2));const _0x552b42=await withSpinner(_0x597c13(0x1b2)+_0x33bab9+_0x597c13(0x19a),()=>_0x4ed35e[_0x597c13(0x1a6)]['resolveParentId'](_0x33bab9),{'verbose':_0x4456d2['verbose']}),_0x1c867d=_0x552b42['data'];_0x4456d2[_0x597c13(0x1b1)]&&console[_0x597c13(0x1b4)]('Resolved\x20parent\x20ID:\x20'+_0x1c867d);const _0x24a712=await withSpinner(_0x597c13(0x1a7)+_0x21d3f2+_0x597c13(0x19a),()=>_0x4ed35e['segment']['resolveSegmentId'](_0x1c867d,_0x21d3f2),{'verbose':_0x4456d2[_0x597c13(0x1b1)]}),_0x25eb19=_0x24a712['data'];_0x4456d2[_0x597c13(0x1b1)]&&console[_0x597c13(0x1b4)](_0x597c13(0x198)+_0x25eb19);const _0x42b030=await withSpinner(_0x597c13(0x1af)+_0x21d3f2+'\x27...',()=>_0x4ed35e[_0x597c13(0x1a6)]['listActivations'](_0x1c867d,_0x25eb19),{'verbose':_0x4456d2[_0x597c13(0x1b1)]}),_0x47e38e=_0x42b030['data'];return console[_0x597c13(0x1b4)](_0x597c13(0x1a3)+_0x47e38e[_0x597c13(0x1bb)]+_0x597c13(0x19c)+(_0x47e38e[_0x597c13(0x1bb)]!==0x1?'s':'')),await handleSDKOutput(_0x47e38e,_0x4456d2),0x0;}catch(_0x227a52){if(_0x227a52 instanceof SDKError)return console[_0x597c13(0x1b4)](_0x597c13(0x1b7)+_0x227a52[_0x597c13(0x1ab)]),_0x227a52['cause']&&console[_0x597c13(0x1b4)](_0x597c13(0x1a9)+_0x227a52[_0x597c13(0x19d)]),0x1;throw _0x227a52;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x169279=a4_0x4a6d;(function(_0x156572,_0x3e7258){const _0x54e75d=a4_0x4a6d,_0x864610=_0x156572();while(!![]){try{const _0x19f217=parseInt(_0x54e75d(0x1b0))/0x1*(parseInt(_0x54e75d(0x16a))/0x2)+-parseInt(_0x54e75d(0x1be))/0x3*(parseInt(_0x54e75d(0x18f))/0x4)+-parseInt(_0x54e75d(0x1af))/0x5+-parseInt(_0x54e75d(0x198))/0x6*(-parseInt(_0x54e75d(0x14e))/0x7)+-parseInt(_0x54e75d(0x1e1))/0x8+parseInt(_0x54e75d(0x1ca))/0x9*(parseInt(_0x54e75d(0x1b9))/0xa)+parseInt(_0x54e75d(0x17e))/0xb;if(_0x19f217===_0x3e7258)break;else _0x864610['push'](_0x864610['shift']());}catch(_0x38654){_0x864610['push'](_0x864610['shift']());}}}(a4_0x1485,0x4655e));import a4_0x3fdead from'chalk';import a4_0x87d866 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x4a6d(_0x4afde2,_0x1079f5){_0x4afde2=_0x4afde2-0x13a;const _0x14852c=a4_0x1485();let _0x4a6d1f=_0x14852c[_0x4afde2];return _0x4a6d1f;}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';function a4_0x1485(){const _0x3e53bb=['dirname','pullProject','\x22\x20from\x20project\x20\x22','Errors:','\x0aPush\x20','textKnowledgeBases','session','1912230gBZohh','6823jsFena','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Agent\x20','utf-8','source','\x20errors','\x20\x20Knowledge\x20Base\x20\x22','Cancelled','Using\x20project\x20from\x20','537160yLLrYI','\x20\x20Knowledge\x20Bases:\x20','cwd','\x20\x20Text\x20Knowledge\x20Bases:\x20','Pulling\x20agent\x20\x22','1205715xTahop','prompts','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x22:\x20','agent:clone','errors','llmProject','description','\x20\x20Text\x20Knowledge\x20Base\x20\x22','join','unchanged','MISSING_ARGUMENT','81TsTcxZ','outputDir','\x22\x20to\x20new\x20project\x20\x22','\x20resources?','Would\x20clone:','name','cyan','Chat:\x20','\x20\x20Experimental\x20Artifacts:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','green','Clone\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','agent:push','experimentalArtifacts','Pushing\x20to\x20project...','\x20files?','New\x20project\x20name\x20is\x20required','\x20\x20Prompts:\x20','execute','profile','\x20--profile\x20','integrations','4310968vHCyoS','red','yes','outputPath','yellow','hasChanges','\x22...','-\x20no\x20files\x20written','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Source:\x20','Agent:\x20','New\x20project:\x20','newProjectId','\x20--name\x20','✔\x20Context\x20set:\x20','\x20unchanged','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','tdx.json','\x20\x20Agents:\x20','dryRun','\x20|\x20','\x0aWrite\x20','INVALID_ARGUMENT','created','\x0aPull\x20summary\x20for\x20\x27','projectDir','867517yeCyIU','\x20\x20Prompt\x20\x22','Project:\x20','force','Analyzing\x20project\x20\x22','total','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20total','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20created','\x0aChanges\x20to\x20prompt\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Project\x20cloned\x20successfully','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Output\x20path:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agents','\x20\x20Integration\x20\x22','\x20new','push','projectName','-\x20nothing\x20pushed','Using\x20local\x20project:\x20','pushProject','\x22\x20to\x20a\x20different\x20profile','knowledgeBases','\x20files\x20to\x20','154rYGNuA','\x0aChanges\x20to\x20agent\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','llm','no_local_folder','repeat','Source:\x20','dim','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent\x20pulled\x20successfully','Project\x20cloned\x20with\x20errors','\x20successfully','agentId','Would\x20pull\x20agent:\x20','diff','Using\x20project:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','no_context','1174547SDPdXx','\x20\x20Experimental\x20Artifact\x20\x22','\x0a✔\x20Pulled\x20','reason','new','\x22\x20to\x20\x22','Summary:','\x20\x20Agent\x20\x22','experimentalKnowledgeBases','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges:','site','context','agentName','\x20\x20Integrations:\x20','\x0aError:','llm_project','4vYgMSI','\x0a✔\x20Pushed\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','Cannot\x20clone\x20from\x20context\x20project\x20\x22','gray','projectId','error','Cloning\x20\x22','24yjhwql','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','New\x20project\x20ID:\x20','Analyzing\x20changes\x20to\x20push...','counts','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','action','log','isNew','Failed\x20to\x20push\x20agent:\x20','pullAgent','sourceProjectName','updated','\x20\x20Target:\x20','No\x20tdx.json\x20found\x20in\x20'];a4_0x1485=function(){return _0x3e53bb;};return a4_0x1485();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2b5267){const _0x649c17=a4_0x4a6d,_0x1d3fe8=[];if(_0x2b5267['total']!==undefined)_0x1d3fe8[_0x649c17(0x162)](_0x2b5267['total']+_0x649c17(0x155));if(_0x2b5267['new']!==undefined&&_0x2b5267[_0x649c17(0x182)]>0x0)_0x1d3fe8['push'](a4_0x3fdead[_0x649c17(0x1d4)](_0x2b5267[_0x649c17(0x182)]+_0x649c17(0x161)));if(_0x2b5267[_0x649c17(0x14b)]!==undefined&&_0x2b5267[_0x649c17(0x14b)]>0x0)_0x1d3fe8['push'](a4_0x3fdead['green'](_0x2b5267[_0x649c17(0x14b)]+_0x649c17(0x157)));if(_0x2b5267['updated']!==undefined&&_0x2b5267[_0x649c17(0x1a5)]>0x0)_0x1d3fe8[_0x649c17(0x162)](a4_0x3fdead[_0x649c17(0x1e5)](_0x2b5267[_0x649c17(0x1a5)]+'\x20updated'));if(_0x2b5267[_0x649c17(0x1c8)]!==undefined&&_0x2b5267[_0x649c17(0x1c8)]>0x0)_0x1d3fe8[_0x649c17(0x162)](a4_0x3fdead['gray'](_0x2b5267[_0x649c17(0x1c8)]+_0x649c17(0x143)));if(_0x2b5267[_0x649c17(0x1c3)]!==undefined&&_0x2b5267[_0x649c17(0x1c3)]>0x0)_0x1d3fe8[_0x649c17(0x162)](a4_0x3fdead[_0x649c17(0x1e2)](_0x2b5267['errors']+_0x649c17(0x1b5)));return _0x1d3fe8[_0x649c17(0x1c7)](',\x20');}function displayDiffs(_0x24142a,_0xc79b8a,_0xc16e52,_0x2385de,_0x42d4a5,_0x40f990,_0x57b3b4){const _0x3852b3=a4_0x4a6d;for(const _0x16773c of _0x24142a){if(_0x16773c[_0x3852b3(0x17a)]){const _0x5cafff=_0x16773c['agentName']||_0x16773c[_0x3852b3(0x1cf)];console[_0x3852b3(0x1a0)](_0x3852b3(0x16b)+_0x5cafff+'\x27:'),console[_0x3852b3(0x1a0)]('─'['repeat'](0x3c)),console[_0x3852b3(0x1a0)](_0x16773c[_0x3852b3(0x17a)]),console['log']('─'[_0x3852b3(0x171)](0x3c));}}for(const _0xcf79e2 of _0xc79b8a){_0xcf79e2[_0x3852b3(0x17a)]&&(console['log'](_0x3852b3(0x16c)+_0xcf79e2[_0x3852b3(0x1cf)]+'\x27:'),console[_0x3852b3(0x1a0)]('─'[_0x3852b3(0x171)](0x3c)),console['log'](_0xcf79e2[_0x3852b3(0x17a)]),console[_0x3852b3(0x1a0)]('─'['repeat'](0x3c)));}for(const _0x5ac6e1 of _0xc16e52){_0x5ac6e1[_0x3852b3(0x17a)]&&(console[_0x3852b3(0x1a0)](_0x3852b3(0x17c)+_0x5ac6e1['name']+'\x27:'),console[_0x3852b3(0x1a0)]('─'['repeat'](0x3c)),console[_0x3852b3(0x1a0)](_0x5ac6e1[_0x3852b3(0x17a)]),console[_0x3852b3(0x1a0)]('─'[_0x3852b3(0x171)](0x3c)));}for(const _0x2073ec of _0x2385de){_0x2073ec[_0x3852b3(0x17a)]&&(console['log'](_0x3852b3(0x158)+_0x2073ec[_0x3852b3(0x1cf)]+'\x27:'),console[_0x3852b3(0x1a0)]('─'[_0x3852b3(0x171)](0x3c)),console['log'](_0x2073ec[_0x3852b3(0x17a)]),console['log']('─'[_0x3852b3(0x171)](0x3c)));}for(const _0x47ab5e of _0x42d4a5){_0x47ab5e['diff']&&(console[_0x3852b3(0x1a0)](_0x3852b3(0x192)+_0x47ab5e[_0x3852b3(0x1cf)]+'\x27:'),console['log']('─'[_0x3852b3(0x171)](0x3c)),console[_0x3852b3(0x1a0)](_0x47ab5e[_0x3852b3(0x17a)]),console[_0x3852b3(0x1a0)]('─'[_0x3852b3(0x171)](0x3c)));}for(const _0x8e6fe5 of _0x40f990){_0x8e6fe5['diff']&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x8e6fe5['name']+'\x27:'),console[_0x3852b3(0x1a0)]('─'['repeat'](0x3c)),console[_0x3852b3(0x1a0)](_0x8e6fe5[_0x3852b3(0x17a)]),console[_0x3852b3(0x1a0)]('─'[_0x3852b3(0x171)](0x3c)));}for(const _0x7a849a of _0x57b3b4){_0x7a849a['diff']&&(console[_0x3852b3(0x1a0)](_0x3852b3(0x144)+_0x7a849a['name']+'\x27:'),console['log']('─'[_0x3852b3(0x171)](0x3c)),console['log'](_0x7a849a[_0x3852b3(0x17a)]),console[_0x3852b3(0x1a0)]('─'[_0x3852b3(0x171)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x169279(0x1cf)]='agent:pull';['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x169279(0x1dd)](_0x487a20){const _0x2c714a=a4_0x169279,{options:_0x374242,args:_0x4c9d04,tdx:_0x5a6137}=_0x487a20,_0x2a7e75=_0x4c9d04[0x0],_0x4f32f7=_0x4c9d04[0x1],_0x5aca69=_0x374242['output'],_0xaf1480=_0x374242[_0x2c714a(0x147)],_0x5b1fce=_0x374242[_0x2c714a(0x151)],_0x38d9f0=_0x374242['yes'],_0x402351=_0x374242[_0x2c714a(0x1c4)];let _0x114ca0,_0x4e9194;const _0x345480=findAgentConfigPath(process[_0x2c714a(0x1bb)]());if(_0x2a7e75){const _0xcb323a=a4_0x87d866[_0x2c714a(0x1c7)](_0x2a7e75,_0x2c714a(0x145));if(existsSync(_0xcb323a))try{const _0x5c6047=JSON['parse'](readFileSync(_0xcb323a,_0x2c714a(0x1b3)));_0x114ca0=_0x5c6047['llm_project'],_0x4e9194=_0x2a7e75,console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x173)](_0x2c714a(0x1b8)+_0xcb323a+':\x20'+_0x114ca0));}catch{_0x114ca0=_0x2a7e75;}else _0x114ca0=_0x2a7e75;}else{if(_0x345480)try{const _0x2c2da8=JSON['parse'](readFileSync(_0x345480,_0x2c714a(0x1b3)));_0x114ca0=_0x2c2da8[_0x2c714a(0x18e)],_0x4e9194=a4_0x87d866[_0x2c714a(0x1a8)](_0x345480),console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x173)]('Using\x20project:\x20'+_0x114ca0));}catch{_0x114ca0=_0x402351;}else _0x114ca0=_0x402351;}if(!_0x114ca0)return console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1e5)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log']('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x2c714a(0x1a0)]('\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['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x4f32f7){const {data:_0x433ee9}=await withSpinner(_0x2c714a(0x1bd)+_0x4f32f7+_0x2c714a(0x1aa)+_0x114ca0+_0x2c714a(0x13a),()=>_0x5a6137['llm'][_0x2c714a(0x1a3)](_0x114ca0,_0x4f32f7,_0x5aca69,{'dryRun':_0xaf1480,'force':_0x5b1fce}));if(_0xaf1480)return console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1e5)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x2c714a(0x1a0)](_0x2c714a(0x179)+_0x433ee9[_0x2c714a(0x18b)]),console['log'](_0x2c714a(0x15d)+_0x433ee9[_0x2c714a(0x1e4)]),_0x433ee9[_0x2c714a(0x17a)]&&(console[_0x2c714a(0x1a0)](_0x2c714a(0x188)),console[_0x2c714a(0x1a0)]('─'[_0x2c714a(0x171)](0x3c)),console[_0x2c714a(0x1a0)](_0x433ee9['diff']),console[_0x2c714a(0x1a0)]('─'[_0x2c714a(0x171)](0x3c))),0x0;return console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1d4)](_0x2c714a(0x175))),console[_0x2c714a(0x1a0)](_0x2c714a(0x13e)+_0x433ee9[_0x2c714a(0x18b)]),console['log']('Output:\x20'+_0x433ee9[_0x2c714a(0x1e4)]),console[_0x2c714a(0x1a0)]('Status:\x20'+(_0x433ee9[_0x2c714a(0x1a1)]?a4_0x3fdead[_0x2c714a(0x1d4)](_0x2c714a(0x182)):_0x433ee9[_0x2c714a(0x1e6)]?a4_0x3fdead[_0x2c714a(0x1e5)](_0x2c714a(0x1a5)):a4_0x3fdead[_0x2c714a(0x194)](_0x2c714a(0x1c8)))),0x0;}const _0x1c80a8=_0x4e9194||_0x5aca69,{data:_0xb6b4f5}=await withSpinner(_0x2c714a(0x152)+_0x114ca0+_0x2c714a(0x13a),()=>_0x5a6137[_0x2c714a(0x16f)][_0x2c714a(0x1a9)](_0x114ca0,_0x1c80a8,{'dryRun':!![]})),_0x59680e=_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x15f)][_0x2c714a(0x182)]+_0xb6b4f5['counts'][_0x2c714a(0x168)][_0x2c714a(0x182)]+_0xb6b4f5['counts']['textKnowledgeBases'][_0x2c714a(0x182)]+_0xb6b4f5[_0x2c714a(0x19c)]['prompts']['new']+_0xb6b4f5['counts'][_0x2c714a(0x1e0)]['new']+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x186)][_0x2c714a(0x182)]+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1d8)][_0x2c714a(0x182)],_0x3d61b0=_0xb6b4f5[_0x2c714a(0x19c)]['agents'][_0x2c714a(0x1a5)]+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x168)][_0x2c714a(0x1a5)]+_0xb6b4f5[_0x2c714a(0x19c)]['textKnowledgeBases'][_0x2c714a(0x1a5)]+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1bf)][_0x2c714a(0x1a5)]+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1e0)]['updated']+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x186)]['updated']+_0xb6b4f5[_0x2c714a(0x19c)]['experimentalArtifacts'][_0x2c714a(0x1a5)],_0x773b6=_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x15f)]['unchanged']+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x168)][_0x2c714a(0x1c8)]+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1ad)]['unchanged']+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1bf)][_0x2c714a(0x1c8)]+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1e0)][_0x2c714a(0x1c8)]+_0xb6b4f5[_0x2c714a(0x19c)]['experimentalKnowledgeBases'][_0x2c714a(0x1c8)]+_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1d8)]['unchanged'];console['log'](_0x2c714a(0x14c)+_0xb6b4f5[_0x2c714a(0x163)]+'\x27:'),console[_0x2c714a(0x1a0)]('\x20\x20'+a4_0x3fdead[_0x2c714a(0x1d4)]('+\x20'+_0x59680e+_0x2c714a(0x161))+_0x2c714a(0x148)+a4_0x3fdead[_0x2c714a(0x1e5)]('~\x20'+_0x3d61b0+'\x20changed')+_0x2c714a(0x148)+a4_0x3fdead['dim']('=\x20'+_0x773b6+_0x2c714a(0x143))),console[_0x2c714a(0x1a0)]('\x20\x20Agents:\x20'+formatCountSummary(_0xb6b4f5[_0x2c714a(0x19c)]['agents'])),console[_0x2c714a(0x1a0)](_0x2c714a(0x1ba)+formatCountSummary(_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x168)])),console[_0x2c714a(0x1a0)](_0x2c714a(0x1bc)+formatCountSummary(_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1ad)])),console[_0x2c714a(0x1a0)](_0x2c714a(0x1dc)+formatCountSummary(_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1bf)])),console[_0x2c714a(0x1a0)](_0x2c714a(0x18c)+formatCountSummary(_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1e0)]));const _0x123f35=_0xb6b4f5['counts']['experimentalKnowledgeBases']['total']>0x0||_0xb6b4f5[_0x2c714a(0x19c)][_0x2c714a(0x1d8)][_0x2c714a(0x153)]>0x0;_0x123f35&&(console[_0x2c714a(0x1a0)](_0x2c714a(0x15c)+formatCountSummary(_0xb6b4f5[_0x2c714a(0x19c)]['experimentalKnowledgeBases'])),console[_0x2c714a(0x1a0)](_0x2c714a(0x1d2)+formatCountSummary(_0xb6b4f5['counts'][_0x2c714a(0x1d8)])));console['log'](_0x2c714a(0x1a6)+a4_0x3fdead[_0x2c714a(0x1d0)](_0xb6b4f5[_0x2c714a(0x1cb)])),displayDiffs(_0xb6b4f5[_0x2c714a(0x15f)],_0xb6b4f5[_0x2c714a(0x168)],_0xb6b4f5[_0x2c714a(0x1ad)],_0xb6b4f5[_0x2c714a(0x1bf)],_0xb6b4f5[_0x2c714a(0x1e0)],_0xb6b4f5['experimentalKnowledgeBases'],_0xb6b4f5[_0x2c714a(0x1d8)]);if(_0xaf1480)return console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1e5)](_0x2c714a(0x159))),0x0;if(_0x59680e===0x0&&_0x3d61b0===0x0)return console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1d4)](_0x2c714a(0x16e))),saveSessionContext({'llm_project':_0xb6b4f5[_0x2c714a(0x163)]},_0x374242[_0x2c714a(0x1ae)]),console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1d4)](_0x2c714a(0x142)+a4_0x3fdead[_0x2c714a(0x173)](_0x2c714a(0x18e))+'\x20=\x20'+a4_0x3fdead[_0x2c714a(0x1d0)](_0xb6b4f5[_0x2c714a(0x163)]))),0x0;if(!_0x38d9f0&&!_0x5b1fce){if(!isInteractive())return console['error'](a4_0x3fdead[_0x2c714a(0x1e2)](_0x2c714a(0x18d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2c714a(0x196)](a4_0x3fdead[_0x2c714a(0x173)](_0x2c714a(0x15b))),0x1;const _0x12dea9=await confirmKey(_0x2c714a(0x149)+(_0x59680e+_0x3d61b0)+_0x2c714a(0x1da));if(!_0x12dea9)return console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1e5)](_0x2c714a(0x1b7)),_0x2c714a(0x13b)),0x1;}const {data:_0xb34578}=await withSpinner('Writing\x20files...',()=>_0x5a6137[_0x2c714a(0x16f)][_0x2c714a(0x1a9)](_0x114ca0,_0x1c80a8,{'force':_0x5b1fce}));return console[_0x2c714a(0x1a0)](a4_0x3fdead['green'](_0x2c714a(0x180)+(_0x59680e+_0x3d61b0)+_0x2c714a(0x169)+_0xb34578[_0x2c714a(0x1cb)])),saveSessionContext({'llm_project':_0xb34578[_0x2c714a(0x163)]},_0x374242[_0x2c714a(0x1ae)]),console[_0x2c714a(0x1a0)](a4_0x3fdead[_0x2c714a(0x1d4)]('✔\x20Context\x20set:\x20'+a4_0x3fdead[_0x2c714a(0x173)](_0x2c714a(0x18e))+'\x20=\x20'+a4_0x3fdead[_0x2c714a(0x1d0)](_0xb34578['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x169279(0x1cf)]=a4_0x169279(0x1c2);[a4_0x169279(0x1c5)]=a4_0x169279(0x1b1);async[a4_0x169279(0x1dd)](_0x570835){const _0x4a7e4a=a4_0x169279,{options:_0x490e99,args:_0x85e4f2,tdx:_0x2704ff}=_0x570835,_0x151619=_0x85e4f2[0x0],_0x17cbb5=_0x490e99[_0x4a7e4a(0x1cf)],_0x1d6c23=_0x490e99[_0x4a7e4a(0x147)],_0x45b2f5=_0x490e99[_0x4a7e4a(0x1e3)],_0xdb5ca8=_0x490e99[_0x4a7e4a(0x189)],_0xb718ba=_0x490e99[_0x4a7e4a(0x1c4)];let _0x5ee3cd;const _0x46bd47=findAgentConfigPath(process[_0x4a7e4a(0x1bb)]());if(_0x151619){const _0x4d7b9e=a4_0x87d866[_0x4a7e4a(0x1c7)](_0x151619,_0x4a7e4a(0x145));existsSync(_0x4d7b9e)?(_0x5ee3cd=_0x151619,console[_0x4a7e4a(0x1a0)](a4_0x3fdead['dim'](_0x4a7e4a(0x165)+_0x151619))):_0x5ee3cd=_0x151619;}else{if(_0x46bd47)_0x5ee3cd=a4_0x87d866[_0x4a7e4a(0x1a8)](_0x46bd47),console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x173)]('Using\x20current\x20project:\x20'+_0x5ee3cd));else{if(_0xb718ba){const _0x2fc9ab=sanitizeForFilesystem(_0xb718ba);let _0x447483=_0x2fc9ab,_0x120049=a4_0x87d866[_0x4a7e4a(0x1c7)](process[_0x4a7e4a(0x1bb)](),_0x4a7e4a(0x15f),_0x2fc9ab,_0x4a7e4a(0x145));if(!existsSync(_0x120049)){const _0x463182=normalizeName(_0xb718ba),_0x4e6f5e=a4_0x87d866[_0x4a7e4a(0x1c7)](process[_0x4a7e4a(0x1bb)](),_0x4a7e4a(0x15f),_0x463182,_0x4a7e4a(0x145));existsSync(_0x4e6f5e)&&(_0x447483=_0x463182,_0x120049=_0x4e6f5e);}if(existsSync(_0x120049))_0x5ee3cd=a4_0x87d866[_0x4a7e4a(0x1a8)](_0x120049),console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x173)]('Using\x20local\x20project:\x20'+_0x5ee3cd));else{const _0x3d9b71=_0x490e99[_0x4a7e4a(0x1de)];if(_0x3d9b71)throw new SDKError(ErrorCode[_0x4a7e4a(0x14a)],_0x4a7e4a(0x193)+_0xb718ba+_0x4a7e4a(0x167),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x4a7e4a(0x1d3)+(_0x4a7e4a(0x187)+_0xb718ba+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x447483+_0x4a7e4a(0x141)+(_0x17cbb5||'<new-name>')+_0x4a7e4a(0x1df)+_0x3d9b71)});_0x5ee3cd=_0xb718ba,console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x173)]('Using\x20context\x20project:\x20'+_0xb718ba));}}}}if(!_0x5ee3cd)return console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x1e5)](_0x4a7e4a(0x174))),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x15e)),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x199)),console[_0x4a7e4a(0x1a0)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x156)),0x1;if(!_0x17cbb5)throw new SDKError(ErrorCode[_0x4a7e4a(0x1c9)],_0x4a7e4a(0x1db),undefined,{'helpText':_0x4a7e4a(0x13c)});if(!_0x45b2f5&&!_0x1d6c23){if(!isInteractive())return console[_0x4a7e4a(0x196)](a4_0x3fdead[_0x4a7e4a(0x1e2)](_0x4a7e4a(0x18d)),_0x4a7e4a(0x16d)),console['error'](a4_0x3fdead[_0x4a7e4a(0x173)](_0x4a7e4a(0x15b))),0x1;const _0x56f716=await confirmKey(_0x4a7e4a(0x1d5)+_0x5ee3cd+_0x4a7e4a(0x1cc)+_0x17cbb5+'\x22?');if(!_0x56f716)return console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x1e5)](_0x4a7e4a(0x1b7))),0x1;}const {data:_0x1cc649}=await withSpinner(_0x4a7e4a(0x197)+_0x5ee3cd+_0x4a7e4a(0x183)+_0x17cbb5+_0x4a7e4a(0x13a),()=>_0x2704ff[_0x4a7e4a(0x16f)]['cloneProject'](_0x5ee3cd,_0x17cbb5,{'dryRun':_0x1d6c23}));if(_0x1d6c23){console[_0x4a7e4a(0x1a0)](a4_0x3fdead['yellow'](_0x4a7e4a(0x19d))),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x172)+_0x1cc649[_0x4a7e4a(0x1a4)]),console[_0x4a7e4a(0x1a0)]('New\x20project:\x20'+_0x17cbb5),console['log'](_0x4a7e4a(0x1ce)),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x146)+_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x15f)]['created']),console[_0x4a7e4a(0x1a0)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1cc649['counts'][_0x4a7e4a(0x168)][_0x4a7e4a(0x14b)]),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x1dc)+_0x1cc649[_0x4a7e4a(0x19c)]['prompts']['created']);const _0x7a43f8=_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x186)][_0x4a7e4a(0x14b)]>0x0||_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x1d8)]['created']>0x0;return _0x7a43f8&&(console['log'](_0x4a7e4a(0x15c)+_0x1cc649['counts'][_0x4a7e4a(0x186)]['created']),console['log'](_0x4a7e4a(0x1d2)+_0x1cc649['counts']['experimentalArtifacts'][_0x4a7e4a(0x14b)])),0x0;}const _0x5acf52=_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x15f)]['errors']>0x0||_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x168)][_0x4a7e4a(0x1c3)]>0x0||_0x1cc649['counts'][_0x4a7e4a(0x1bf)][_0x4a7e4a(0x1c3)]>0x0||_0x1cc649[_0x4a7e4a(0x19c)]['experimentalKnowledgeBases'][_0x4a7e4a(0x1c3)]>0x0||_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x1d8)]['errors']>0x0;_0x5acf52?console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x1e5)](_0x4a7e4a(0x176))):console['log'](a4_0x3fdead[_0x4a7e4a(0x1d4)](_0x4a7e4a(0x15a)));console['log'](_0x4a7e4a(0x172)+_0x1cc649[_0x4a7e4a(0x1a4)]),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x13f)+_0x1cc649['newProjectName']),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x19a)+_0x1cc649[_0x4a7e4a(0x140)]),console['log'](),console['log'](_0x4a7e4a(0x184)),console[_0x4a7e4a(0x1a0)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x15f)])),console[_0x4a7e4a(0x1a0)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x168)])),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x1dc)+formatCountSummary(_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x1bf)])),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x18c)+formatCountSummary(_0x1cc649['counts'][_0x4a7e4a(0x1e0)]));const _0xdce69a=_0x1cc649['counts']['experimentalKnowledgeBases'][_0x4a7e4a(0x14b)]>0x0||_0x1cc649[_0x4a7e4a(0x19c)]['experimentalKnowledgeBases'][_0x4a7e4a(0x1a5)]>0x0||_0x1cc649['counts'][_0x4a7e4a(0x186)][_0x4a7e4a(0x1c8)]>0x0||_0x1cc649['counts'][_0x4a7e4a(0x1d8)][_0x4a7e4a(0x14b)]>0x0||_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x1d8)][_0x4a7e4a(0x1a5)]>0x0||_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x1d8)][_0x4a7e4a(0x1c8)]>0x0;_0xdce69a&&(console['log'](_0x4a7e4a(0x15c)+formatCountSummary(_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x186)])),console[_0x4a7e4a(0x1a0)](_0x4a7e4a(0x1d2)+formatCountSummary(_0x1cc649[_0x4a7e4a(0x19c)][_0x4a7e4a(0x1d8)])));if(_0x5acf52){console[_0x4a7e4a(0x1a0)](),console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x1e2)](_0x4a7e4a(0x1ab)));for(const _0x1682a4 of _0x1cc649[_0x4a7e4a(0x15f)]){_0x1682a4['action']===_0x4a7e4a(0x196)&&console['log'](a4_0x3fdead[_0x4a7e4a(0x1e2)](_0x4a7e4a(0x185)+_0x1682a4['agentName']+'\x22:\x20'+_0x1682a4['error']));}for(const _0x44711a of _0x1cc649[_0x4a7e4a(0x168)]){_0x44711a[_0x4a7e4a(0x19f)]==='error'&&console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x1e2)](_0x4a7e4a(0x1b6)+_0x44711a[_0x4a7e4a(0x1cf)]+_0x4a7e4a(0x1c1)+_0x44711a[_0x4a7e4a(0x196)]));}for(const _0x5c24af of _0x1cc649['prompts']){_0x5c24af[_0x4a7e4a(0x19f)]===_0x4a7e4a(0x196)&&console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x1e2)](_0x4a7e4a(0x14f)+_0x5c24af[_0x4a7e4a(0x1cf)]+_0x4a7e4a(0x1c1)+_0x5c24af['error']));}for(const _0x2d5677 of _0x1cc649[_0x4a7e4a(0x1e0)]){_0x2d5677[_0x4a7e4a(0x19f)]===_0x4a7e4a(0x196)&&console[_0x4a7e4a(0x1a0)](a4_0x3fdead[_0x4a7e4a(0x1e2)]('\x20\x20Integration\x20\x22'+_0x2d5677[_0x4a7e4a(0x1cf)]+_0x4a7e4a(0x1c1)+_0x2d5677[_0x4a7e4a(0x196)]));}for(const _0x55e73c of _0x1cc649[_0x4a7e4a(0x186)]){_0x55e73c[_0x4a7e4a(0x19f)]==='error'&&console['log'](a4_0x3fdead[_0x4a7e4a(0x1e2)](_0x4a7e4a(0x191)+_0x55e73c['name']+'\x22:\x20'+_0x55e73c['error']));}for(const _0x4d60f4 of _0x1cc649[_0x4a7e4a(0x1d8)]){_0x4d60f4[_0x4a7e4a(0x19f)]===_0x4a7e4a(0x196)&&console[_0x4a7e4a(0x1a0)](a4_0x3fdead['red'](_0x4a7e4a(0x17f)+_0x4d60f4[_0x4a7e4a(0x1cf)]+'\x22:\x20'+_0x4d60f4[_0x4a7e4a(0x196)]));}return 0x1;}console[_0x4a7e4a(0x1a0)]();const _0x1cb9c3=getLLMProjectUrl(_0xdb5ca8,_0x1cc649['newProjectId']);return console['log'](_0x4a7e4a(0x150)+a4_0x3fdead[_0x4a7e4a(0x1d0)](_0x1cb9c3)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x169279(0x1d7);[a4_0x169279(0x1c5)]=a4_0x169279(0x1d6);async[a4_0x169279(0x1dd)](_0x51ef92){const _0x5a22a8=a4_0x169279,{options:_0x128509,args:_0x2c72fc,tdx:_0x3cd81b}=_0x51ef92;let _0x46b074=_0x2c72fc[0x0]||process[_0x5a22a8(0x1bb)]();const _0x32a065=_0x128509['dryRun'],_0x4c2ad5=_0x128509['force'],_0x3251fe=_0x128509[_0x5a22a8(0x1e3)],_0x5bec43=_0x128509['site'],_0x27285c=a4_0x87d866[_0x5a22a8(0x1c7)](_0x46b074,'agent.yml'),_0x512559=existsSync(_0x27285c);if(_0x512559){const {data:_0x36eb3f}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x46b074+_0x5a22a8(0x13a),()=>_0x3cd81b[_0x5a22a8(0x16f)]['pushAgent'](_0x46b074,{'dryRun':_0x32a065,'force':_0x4c2ad5}));if(_0x32a065)return console[_0x5a22a8(0x1a0)](a4_0x3fdead['yellow'](_0x5a22a8(0x19d))),console['log']('Would\x20push\x20agent:\x20'+_0x36eb3f[_0x5a22a8(0x18b)]),0x0;if(_0x36eb3f[_0x5a22a8(0x19f)]==='error')return console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e2)](_0x5a22a8(0x1a2)+_0x36eb3f[_0x5a22a8(0x196)])),0x1;console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1d4)](_0x5a22a8(0x1b2)+_0x36eb3f['action']+_0x5a22a8(0x177))),console[_0x5a22a8(0x1a0)](_0x5a22a8(0x13e)+_0x36eb3f[_0x5a22a8(0x18b)]);if(_0x36eb3f[_0x5a22a8(0x178)]&&_0x36eb3f[_0x5a22a8(0x195)]){const _0x1a8465=getLLMAgentChatUrl(_0x5bec43,_0x36eb3f[_0x5a22a8(0x195)],_0x36eb3f[_0x5a22a8(0x178)]);console['log'](_0x5a22a8(0x1d1)+a4_0x3fdead['cyan'](_0x1a8465));}return 0x0;}const _0x4aa5e5=_0x128509[_0x5a22a8(0x1c4)],_0x33b017=resolveProjectFromContext(_0x46b074,_0x4aa5e5);if(_0x33b017['found'])_0x46b074=_0x33b017[_0x5a22a8(0x14d)],_0x33b017[_0x5a22a8(0x1b4)]===_0x5a22a8(0x18a)&&console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x173)](_0x5a22a8(0x17b)+_0x46b074));else{let _0x4a01c3='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x33b017[_0x5a22a8(0x181)]===_0x5a22a8(0x170)&&(_0x4a01c3=_0x33b017['message']+_0x5a22a8(0x1c0)+_0x33b017[_0x5a22a8(0x1c4)]+_0x5a22a8(0x154));throw new SDKError(ErrorCode[_0x5a22a8(0x14a)],_0x33b017['reason']===_0x5a22a8(0x17d)?_0x33b017['message']:_0x5a22a8(0x1a7)+_0x46b074,undefined,{'helpText':_0x4a01c3});}const {data:_0x74b012}=await withSpinner(_0x5a22a8(0x19b),()=>_0x3cd81b['llm']['pushProject'](_0x46b074,{'dryRun':!![]})),_0x498073=_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x15f)][_0x5a22a8(0x1c3)]>0x0;if(_0x498073){console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e2)]('\x0aErrors\x20found:'));for(const _0x1984e7 of _0x74b012[_0x5a22a8(0x15f)]){_0x1984e7[_0x5a22a8(0x19f)]===_0x5a22a8(0x196)&&console['log'](a4_0x3fdead[_0x5a22a8(0x1e2)](_0x5a22a8(0x185)+_0x1984e7['agentName']+_0x5a22a8(0x1c1)+_0x1984e7[_0x5a22a8(0x196)]));}return 0x1;}const _0x34827f=_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x15f)][_0x5a22a8(0x14b)]+_0x74b012[_0x5a22a8(0x19c)]['knowledgeBases'][_0x5a22a8(0x14b)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1ad)][_0x5a22a8(0x14b)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1bf)][_0x5a22a8(0x14b)]+_0x74b012[_0x5a22a8(0x19c)]['integrations']['created']+_0x74b012[_0x5a22a8(0x19c)]['experimentalKnowledgeBases'][_0x5a22a8(0x14b)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1d8)][_0x5a22a8(0x14b)],_0x41c339=_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x15f)][_0x5a22a8(0x1a5)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x168)][_0x5a22a8(0x1a5)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1ad)]['updated']+_0x74b012['counts'][_0x5a22a8(0x1bf)][_0x5a22a8(0x1a5)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1e0)][_0x5a22a8(0x1a5)]+_0x74b012['counts']['experimentalKnowledgeBases']['updated']+_0x74b012['counts']['experimentalArtifacts'][_0x5a22a8(0x1a5)],_0x2f2454=_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x15f)][_0x5a22a8(0x1c8)]+_0x74b012['counts'][_0x5a22a8(0x168)][_0x5a22a8(0x1c8)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1ad)][_0x5a22a8(0x1c8)]+_0x74b012['counts'][_0x5a22a8(0x1bf)][_0x5a22a8(0x1c8)]+_0x74b012['counts'][_0x5a22a8(0x1e0)][_0x5a22a8(0x1c8)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x186)][_0x5a22a8(0x1c8)]+_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1d8)][_0x5a22a8(0x1c8)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x74b012[_0x5a22a8(0x163)]+'\x27:'),console[_0x5a22a8(0x1a0)]('\x20\x20'+a4_0x3fdead['green']('+\x20'+_0x34827f+'\x20new')+_0x5a22a8(0x148)+a4_0x3fdead[_0x5a22a8(0x1e5)]('~\x20'+_0x41c339+'\x20changed')+_0x5a22a8(0x148)+a4_0x3fdead[_0x5a22a8(0x173)]('=\x20'+_0x2f2454+_0x5a22a8(0x143))),console[_0x5a22a8(0x1a0)]('\x20\x20Agents:\x20'+formatCountSummary(_0x74b012[_0x5a22a8(0x19c)]['agents'])),console[_0x5a22a8(0x1a0)](_0x5a22a8(0x1ba)+formatCountSummary(_0x74b012[_0x5a22a8(0x19c)]['knowledgeBases'])),console[_0x5a22a8(0x1a0)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x74b012['counts'][_0x5a22a8(0x1ad)])),console[_0x5a22a8(0x1a0)](_0x5a22a8(0x1dc)+formatCountSummary(_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1bf)])),console[_0x5a22a8(0x1a0)](_0x5a22a8(0x18c)+formatCountSummary(_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1e0)]));const _0x5b647e=_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x186)]['created']>0x0||_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x186)]['updated']>0x0||_0x74b012['counts'][_0x5a22a8(0x186)][_0x5a22a8(0x1c8)]>0x0||_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1d8)][_0x5a22a8(0x14b)]>0x0||_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1d8)][_0x5a22a8(0x1a5)]>0x0||_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1d8)]['unchanged']>0x0;_0x5b647e&&(console[_0x5a22a8(0x1a0)](_0x5a22a8(0x15c)+formatCountSummary(_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x186)])),console['log'](_0x5a22a8(0x1d2)+formatCountSummary(_0x74b012[_0x5a22a8(0x19c)][_0x5a22a8(0x1d8)])));console[_0x5a22a8(0x1a0)](_0x5a22a8(0x13d)+a4_0x3fdead[_0x5a22a8(0x1d0)](_0x46b074)),displayDiffs(_0x74b012[_0x5a22a8(0x15f)],_0x74b012[_0x5a22a8(0x168)],_0x74b012[_0x5a22a8(0x1ad)],_0x74b012[_0x5a22a8(0x1bf)],_0x74b012[_0x5a22a8(0x1e0)],_0x74b012[_0x5a22a8(0x186)],_0x74b012[_0x5a22a8(0x1d8)]);if(_0x32a065)return console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e5)](_0x5a22a8(0x19e))),0x0;if(_0x34827f===0x0&&_0x41c339===0x0){console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1d4)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4dfec0=getLLMProjectUrl(_0x5bec43,_0x74b012[_0x5a22a8(0x195)]);return console[_0x5a22a8(0x1a0)](_0x5a22a8(0x150)+a4_0x3fdead[_0x5a22a8(0x1d0)](_0x4dfec0)),0x0;}if(!_0x3251fe&&!_0x4c2ad5){if(!isInteractive())return console[_0x5a22a8(0x196)](a4_0x3fdead[_0x5a22a8(0x1e2)]('\x0aError:'),_0x5a22a8(0x16d)),console[_0x5a22a8(0x196)](a4_0x3fdead[_0x5a22a8(0x173)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5c17c9=await confirmKey(_0x5a22a8(0x1ac)+(_0x34827f+_0x41c339)+_0x5a22a8(0x1cd));if(!_0x5c17c9)return console['log'](a4_0x3fdead[_0x5a22a8(0x1e5)](_0x5a22a8(0x1b7)),_0x5a22a8(0x164)),0x1;}const {data:_0x56bed6}=await withSpinner(_0x5a22a8(0x1d9),()=>_0x3cd81b[_0x5a22a8(0x16f)][_0x5a22a8(0x166)](_0x46b074,{'force':_0x4c2ad5})),_0x165926=_0x56bed6[_0x5a22a8(0x19c)][_0x5a22a8(0x15f)][_0x5a22a8(0x1c3)]>0x0||_0x56bed6[_0x5a22a8(0x19c)]['knowledgeBases'][_0x5a22a8(0x1c3)]>0x0||_0x56bed6[_0x5a22a8(0x19c)][_0x5a22a8(0x1ad)]['errors']>0x0||_0x56bed6[_0x5a22a8(0x19c)]['prompts'][_0x5a22a8(0x1c3)]>0x0;if(_0x165926){console['log'](a4_0x3fdead[_0x5a22a8(0x1e5)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x5a22a8(0x1a0)](),console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e2)](_0x5a22a8(0x1ab)));for(const _0x2e23e7 of _0x56bed6['agents']){_0x2e23e7[_0x5a22a8(0x19f)]===_0x5a22a8(0x196)&&console[_0x5a22a8(0x1a0)](a4_0x3fdead['red'](_0x5a22a8(0x185)+_0x2e23e7[_0x5a22a8(0x18b)]+_0x5a22a8(0x1c1)+_0x2e23e7[_0x5a22a8(0x196)]));}for(const _0x1f856e of _0x56bed6[_0x5a22a8(0x168)]){_0x1f856e[_0x5a22a8(0x19f)]===_0x5a22a8(0x196)&&console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e2)](_0x5a22a8(0x1b6)+_0x1f856e[_0x5a22a8(0x1cf)]+_0x5a22a8(0x1c1)+_0x1f856e[_0x5a22a8(0x196)]));}for(const _0x203a7a of _0x56bed6[_0x5a22a8(0x1ad)]){_0x203a7a['action']===_0x5a22a8(0x196)&&console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e2)](_0x5a22a8(0x1c6)+_0x203a7a[_0x5a22a8(0x1cf)]+_0x5a22a8(0x1c1)+_0x203a7a[_0x5a22a8(0x196)]));}for(const _0x6c2bba of _0x56bed6[_0x5a22a8(0x1bf)]){_0x6c2bba[_0x5a22a8(0x19f)]==='error'&&console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e2)](_0x5a22a8(0x14f)+_0x6c2bba['name']+_0x5a22a8(0x1c1)+_0x6c2bba[_0x5a22a8(0x196)]));}for(const _0x39f69c of _0x56bed6['integrations']){_0x39f69c[_0x5a22a8(0x19f)]===_0x5a22a8(0x196)&&console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1e2)](_0x5a22a8(0x160)+_0x39f69c['name']+_0x5a22a8(0x1c1)+_0x39f69c['error']));}return 0x1;}console[_0x5a22a8(0x1a0)](a4_0x3fdead[_0x5a22a8(0x1d4)](_0x5a22a8(0x190)+(_0x34827f+_0x41c339)+'\x20resources\x20to\x20\x27'+_0x56bed6[_0x5a22a8(0x163)]+'\x27'));const _0x23eb15=getLLMProjectUrl(_0x5bec43,_0x56bed6[_0x5a22a8(0x195)]);return console[_0x5a22a8(0x1a0)](_0x5a22a8(0x150)+a4_0x3fdead['cyan'](_0x23eb15)),0x0;}}
|
|
1
|
+
function a4_0x3531(){const _0x56e9ee=['output','errors','yes','\x20=\x20','Cloning\x20\x22','updated','27808CXdOeG','\x20unchanged','outputPath','new','291320DiCcsv','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aErrors\x20found:','agent:pull','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aWrite\x20','red','Output:\x20','\x20--profile\x20','\x0aChanges\x20to\x20integration\x20\x27','agent:clone','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20files?','llm','Agent:\x20','Clone\x20\x22','site','\x20\x20Knowledge\x20Base\x20\x22','Would\x20clone:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Analyzing\x20changes\x20to\x20push...','\x22\x20from\x20project\x20\x22','2301369ptbLkM','153RngCjm','Source:\x20','dryRun','\x20\x20Prompt\x20\x22','llmProject','No\x20tdx.json\x20found\x20in\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20updated','cwd','dirname','repeat','counts','integrations','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','New\x20project\x20name\x20is\x20required','\x22...','newProjectId','session','\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','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Agent\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x27\x20to\x20create\x20the\x20folder\x20structure.','knowledgeBases','cloneProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20files\x20to\x20','Agent\x20pulled\x20successfully','Summary:','\x20resources\x20to\x20\x27','log','Dry\x20run\x20-\x20no\x20changes\x20made','2402368osivnb','action','diff','utf-8','\x20\x20Source:\x20','\x20|\x20','✔\x20Context\x20set:\x20','Pushing\x20agent\x20from\x20\x22','\x20successfully','INVALID_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','error','\x20\x20Integrations:\x20','projectId','\x0aPush\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Experimental\x20Artifacts:\x20','total','join','textKnowledgeBases','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0a✔\x20Pulled\x20','Status:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x20changed','\x20resources?','agentId','hasChanges','created','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','execute','\x20\x20Integration\x20\x22','cyan','reason','tdx.json','profile','5OFZMcS','Project\x20cloned\x20successfully','name','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Agents:\x20','pullProject','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Writing\x20files...','projectDir','\x20\x20Agent\x20\x22','\x20\x20Target:\x20','agent.yml','newProjectName','description','\x20errors','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','outputDir','521214ABHgWJ','sourceProjectName','isNew','\x0aChanges:','650452EireoF','\x20new','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20context\x20project:\x20','New\x20project\x20ID:\x20','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','force','Cancelled','pullAgent','Project\x20cloned\x20with\x20errors','message','unchanged','projectName','gray','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','yellow','green','New\x20project:\x20','pushProject','\x22\x20to\x20\x22','parse','\x20\x20Knowledge\x20Bases:\x20','prompts','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','push','<new-name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','context','Failed\x20to\x20push\x20agent:\x20','agent:push','580ZonJYb','Using\x20project\x20from\x20','1054836hMpXsP','llm_project','\x22:\x20','experimentalKnowledgeBases','experimentalArtifacts','agents','\x0aPull\x20summary\x20for\x20\x27','dim','\x0aChanges\x20to\x20agent\x20\x27','Would\x20pull\x20agent:\x20','agentName','pushAgent','\x20--name\x20','\x20\x20Prompts:\x20','Project:\x20','6lawlTL','\x22\x20to\x20a\x20different\x20profile','Errors:','-\x20no\x20files\x20written','-\x20nothing\x20pushed','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written'];a4_0x3531=function(){return _0x56e9ee;};return a4_0x3531();}const a4_0x27c9da=a4_0x540c;(function(_0x2aa9c9,_0x9da933){const _0x4d05ea=a4_0x540c,_0x382e08=_0x2aa9c9();while(!![]){try{const _0x1c1219=-parseInt(_0x4d05ea(0x1bd))/0x1+-parseInt(_0x4d05ea(0x1df))/0x2+-parseInt(_0x4d05ea(0x1b9))/0x3+parseInt(_0x4d05ea(0x182))/0x4*(parseInt(_0x4d05ea(0x1a7))/0x5)+-parseInt(_0x4d05ea(0x1ee))/0x6*(-parseInt(_0x4d05ea(0x161))/0x7)+parseInt(_0x4d05ea(0x1fe))/0x8*(parseInt(_0x4d05ea(0x162))/0x9)+parseInt(_0x4d05ea(0x1dd))/0xa*(parseInt(_0x4d05ea(0x1fa))/0xb);if(_0x1c1219===_0x9da933)break;else _0x382e08['push'](_0x382e08['shift']());}catch(_0x33f089){_0x382e08['push'](_0x382e08['shift']());}}}(a4_0x3531,0x53d86));function a4_0x540c(_0x2a1a68,_0x4c07eb){_0x2a1a68=_0x2a1a68-0x14a;const _0x353181=a4_0x3531();let _0x540c5b=_0x353181[_0x2a1a68];return _0x540c5b;}import a4_0x2359e2 from'chalk';import a4_0x570106 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0xff55b){const _0x57b3c2=a4_0x540c,_0x1d4140=[];if(_0xff55b[_0x57b3c2(0x194)]!==undefined)_0x1d4140[_0x57b3c2(0x1d7)](_0xff55b[_0x57b3c2(0x194)]+'\x20total');if(_0xff55b[_0x57b3c2(0x1fd)]!==undefined&&_0xff55b[_0x57b3c2(0x1fd)]>0x0)_0x1d4140[_0x57b3c2(0x1d7)](a4_0x2359e2[_0x57b3c2(0x1cf)](_0xff55b[_0x57b3c2(0x1fd)]+_0x57b3c2(0x1be)));if(_0xff55b[_0x57b3c2(0x19f)]!==undefined&&_0xff55b[_0x57b3c2(0x19f)]>0x0)_0x1d4140[_0x57b3c2(0x1d7)](a4_0x2359e2[_0x57b3c2(0x1cf)](_0xff55b['created']+'\x20created'));if(_0xff55b[_0x57b3c2(0x1f9)]!==undefined&&_0xff55b['updated']>0x0)_0x1d4140[_0x57b3c2(0x1d7)](a4_0x2359e2['yellow'](_0xff55b[_0x57b3c2(0x1f9)]+_0x57b3c2(0x169)));if(_0xff55b[_0x57b3c2(0x1ca)]!==undefined&&_0xff55b[_0x57b3c2(0x1ca)]>0x0)_0x1d4140[_0x57b3c2(0x1d7)](a4_0x2359e2[_0x57b3c2(0x1cc)](_0xff55b[_0x57b3c2(0x1ca)]+_0x57b3c2(0x1fb)));if(_0xff55b[_0x57b3c2(0x1f5)]!==undefined&&_0xff55b[_0x57b3c2(0x1f5)]>0x0)_0x1d4140[_0x57b3c2(0x1d7)](a4_0x2359e2['red'](_0xff55b[_0x57b3c2(0x1f5)]+_0x57b3c2(0x1b5)));return _0x1d4140[_0x57b3c2(0x195)](',\x20');}function displayDiffs(_0x16077c,_0x506f07,_0x596ab,_0x2487f7,_0xfe2639,_0x59f6da,_0x552cca){const _0x4b46c7=a4_0x540c;for(const _0x1069e4 of _0x16077c){if(_0x1069e4['diff']){const _0x31ac7d=_0x1069e4[_0x4b46c7(0x1e9)]||_0x1069e4[_0x4b46c7(0x1a9)];console['log'](_0x4b46c7(0x1e7)+_0x31ac7d+'\x27:'),console['log']('─'[_0x4b46c7(0x16c)](0x3c)),console[_0x4b46c7(0x180)](_0x1069e4[_0x4b46c7(0x184)]),console['log']('─'[_0x4b46c7(0x16c)](0x3c));}}for(const _0x50e3da of _0x506f07){_0x50e3da[_0x4b46c7(0x184)]&&(console[_0x4b46c7(0x180)](_0x4b46c7(0x18d)+_0x50e3da[_0x4b46c7(0x1a9)]+'\x27:'),console[_0x4b46c7(0x180)]('─'['repeat'](0x3c)),console[_0x4b46c7(0x180)](_0x50e3da[_0x4b46c7(0x184)]),console[_0x4b46c7(0x180)]('─'[_0x4b46c7(0x16c)](0x3c)));}for(const _0x24af32 of _0x596ab){_0x24af32[_0x4b46c7(0x184)]&&(console['log'](_0x4b46c7(0x168)+_0x24af32[_0x4b46c7(0x1a9)]+'\x27:'),console[_0x4b46c7(0x180)]('─'[_0x4b46c7(0x16c)](0x3c)),console[_0x4b46c7(0x180)](_0x24af32['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x5a2546 of _0x2487f7){_0x5a2546[_0x4b46c7(0x184)]&&(console['log'](_0x4b46c7(0x19a)+_0x5a2546[_0x4b46c7(0x1a9)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x4b46c7(0x180)](_0x5a2546[_0x4b46c7(0x184)]),console[_0x4b46c7(0x180)]('─'[_0x4b46c7(0x16c)](0x3c)));}for(const _0x2097e4 of _0xfe2639){_0x2097e4[_0x4b46c7(0x184)]&&(console[_0x4b46c7(0x180)](_0x4b46c7(0x154)+_0x2097e4[_0x4b46c7(0x1a9)]+'\x27:'),console[_0x4b46c7(0x180)]('─'[_0x4b46c7(0x16c)](0x3c)),console['log'](_0x2097e4[_0x4b46c7(0x184)]),console['log']('─'[_0x4b46c7(0x16c)](0x3c)));}for(const _0x5a9099 of _0x59f6da){_0x5a9099[_0x4b46c7(0x184)]&&(console[_0x4b46c7(0x180)](_0x4b46c7(0x14e)+_0x5a9099[_0x4b46c7(0x1a9)]+'\x27:'),console[_0x4b46c7(0x180)]('─'[_0x4b46c7(0x16c)](0x3c)),console['log'](_0x5a9099[_0x4b46c7(0x184)]),console[_0x4b46c7(0x180)]('─'[_0x4b46c7(0x16c)](0x3c)));}for(const _0x10479b of _0x552cca){_0x10479b[_0x4b46c7(0x184)]&&(console[_0x4b46c7(0x180)](_0x4b46c7(0x197)+_0x10479b[_0x4b46c7(0x1a9)]+'\x27:'),console[_0x4b46c7(0x180)]('─'[_0x4b46c7(0x16c)](0x3c)),console[_0x4b46c7(0x180)](_0x10479b['diff']),console[_0x4b46c7(0x180)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x27c9da(0x1a9)]=a4_0x27c9da(0x14c);[a4_0x27c9da(0x1b4)]=a4_0x27c9da(0x17b);async[a4_0x27c9da(0x1a1)](_0x13f1a6){const _0x364515=a4_0x27c9da,{options:_0x4da5c6,args:_0x27a9ce,tdx:_0xc86ed8}=_0x13f1a6,_0x237e38=_0x27a9ce[0x0],_0x444035=_0x27a9ce[0x1],_0x67497a=_0x4da5c6[_0x364515(0x1f4)],_0x26f32c=_0x4da5c6[_0x364515(0x164)],_0x29c226=_0x4da5c6[_0x364515(0x1c5)],_0x4ae680=_0x4da5c6['yes'],_0x4a3324=_0x4da5c6[_0x364515(0x166)];let _0x2a43ba,_0x35be4d;const _0x5836b2=findAgentConfigPath(process['cwd']());if(_0x237e38){const _0x1a0a30=a4_0x570106[_0x364515(0x195)](_0x237e38,'tdx.json');if(existsSync(_0x1a0a30))try{const _0xfcdf90=JSON['parse'](readFileSync(_0x1a0a30,_0x364515(0x185)));_0x2a43ba=_0xfcdf90[_0x364515(0x1e0)],_0x35be4d=_0x237e38,console[_0x364515(0x180)](a4_0x2359e2['dim'](_0x364515(0x1de)+_0x1a0a30+':\x20'+_0x2a43ba));}catch{_0x2a43ba=_0x237e38;}else _0x2a43ba=_0x237e38;}else{if(_0x5836b2)try{const _0x1edb37=JSON[_0x364515(0x1d3)](readFileSync(_0x5836b2,_0x364515(0x185)));_0x2a43ba=_0x1edb37[_0x364515(0x1e0)],_0x35be4d=a4_0x570106[_0x364515(0x16b)](_0x5836b2),console[_0x364515(0x180)](a4_0x2359e2['dim']('Using\x20project:\x20'+_0x2a43ba));}catch{_0x2a43ba=_0x4a3324;}else _0x2a43ba=_0x4a3324;}if(!_0x2a43ba)return console[_0x364515(0x180)](a4_0x2359e2['yellow'](_0x364515(0x192))),console[_0x364515(0x180)]('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[_0x364515(0x180)](_0x364515(0x174)),console[_0x364515(0x180)]('\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[_0x364515(0x180)](_0x364515(0x1d9)),0x1;if(_0x444035){const {data:_0x3269ba}=await withSpinner('Pulling\x20agent\x20\x22'+_0x444035+_0x364515(0x160)+_0x2a43ba+_0x364515(0x171),()=>_0xc86ed8['llm'][_0x364515(0x1c7)](_0x2a43ba,_0x444035,_0x67497a,{'dryRun':_0x26f32c,'force':_0x29c226}));if(_0x26f32c)return console[_0x364515(0x180)](a4_0x2359e2['yellow'](_0x364515(0x1aa))),console[_0x364515(0x180)](_0x364515(0x1e8)+_0x3269ba[_0x364515(0x1e9)]),console[_0x364515(0x180)]('Output\x20path:\x20'+_0x3269ba['outputPath']),_0x3269ba[_0x364515(0x184)]&&(console['log'](_0x364515(0x1bc)),console['log']('─'[_0x364515(0x16c)](0x3c)),console[_0x364515(0x180)](_0x3269ba[_0x364515(0x184)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x364515(0x180)](a4_0x2359e2['green'](_0x364515(0x17d))),console[_0x364515(0x180)](_0x364515(0x159)+_0x3269ba[_0x364515(0x1e9)]),console[_0x364515(0x180)](_0x364515(0x152)+_0x3269ba[_0x364515(0x1fc)]),console[_0x364515(0x180)](_0x364515(0x199)+(_0x3269ba[_0x364515(0x1bb)]?a4_0x2359e2[_0x364515(0x1cf)](_0x364515(0x1fd)):_0x3269ba[_0x364515(0x19e)]?a4_0x2359e2[_0x364515(0x1ce)](_0x364515(0x1f9)):a4_0x2359e2[_0x364515(0x1cc)](_0x364515(0x1ca)))),0x0;}const _0x3d65cc=_0x35be4d||_0x67497a,{data:_0x3812fc}=await withSpinner('Analyzing\x20project\x20\x22'+_0x2a43ba+_0x364515(0x171),()=>_0xc86ed8[_0x364515(0x158)]['pullProject'](_0x2a43ba,_0x3d65cc,{'dryRun':!![]})),_0xc77f51=_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e4)][_0x364515(0x1fd)]+_0x3812fc[_0x364515(0x16d)][_0x364515(0x179)][_0x364515(0x1fd)]+_0x3812fc['counts'][_0x364515(0x196)][_0x364515(0x1fd)]+_0x3812fc[_0x364515(0x16d)]['prompts'][_0x364515(0x1fd)]+_0x3812fc[_0x364515(0x16d)][_0x364515(0x16e)]['new']+_0x3812fc[_0x364515(0x16d)]['experimentalKnowledgeBases'][_0x364515(0x1fd)]+_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e3)][_0x364515(0x1fd)],_0x23e85e=_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e4)]['updated']+_0x3812fc['counts']['knowledgeBases']['updated']+_0x3812fc['counts'][_0x364515(0x196)][_0x364515(0x1f9)]+_0x3812fc[_0x364515(0x16d)]['prompts'][_0x364515(0x1f9)]+_0x3812fc[_0x364515(0x16d)][_0x364515(0x16e)]['updated']+_0x3812fc[_0x364515(0x16d)]['experimentalKnowledgeBases'][_0x364515(0x1f9)]+_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e3)][_0x364515(0x1f9)],_0x4406a6=_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e4)][_0x364515(0x1ca)]+_0x3812fc[_0x364515(0x16d)]['knowledgeBases']['unchanged']+_0x3812fc['counts'][_0x364515(0x196)]['unchanged']+_0x3812fc['counts'][_0x364515(0x1d5)]['unchanged']+_0x3812fc['counts'][_0x364515(0x16e)]['unchanged']+_0x3812fc['counts']['experimentalKnowledgeBases'][_0x364515(0x1ca)]+_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e3)][_0x364515(0x1ca)];console['log'](_0x364515(0x1e5)+_0x3812fc[_0x364515(0x1cb)]+'\x27:'),console['log']('\x20\x20'+a4_0x2359e2[_0x364515(0x1cf)]('+\x20'+_0xc77f51+'\x20new')+_0x364515(0x187)+a4_0x2359e2[_0x364515(0x1ce)]('~\x20'+_0x23e85e+_0x364515(0x19b))+_0x364515(0x187)+a4_0x2359e2[_0x364515(0x1e6)]('=\x20'+_0x4406a6+_0x364515(0x1fb))),console[_0x364515(0x180)](_0x364515(0x1ab)+formatCountSummary(_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e4)])),console[_0x364515(0x180)](_0x364515(0x1d4)+formatCountSummary(_0x3812fc['counts'][_0x364515(0x179)])),console[_0x364515(0x180)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3812fc[_0x364515(0x16d)][_0x364515(0x196)])),console[_0x364515(0x180)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3812fc['counts'][_0x364515(0x1d5)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x3812fc[_0x364515(0x16d)]['integrations']));const _0x39e540=_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e2)][_0x364515(0x194)]>0x0||_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e3)][_0x364515(0x194)]>0x0;_0x39e540&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3812fc[_0x364515(0x16d)]['experimentalKnowledgeBases'])),console['log'](_0x364515(0x193)+formatCountSummary(_0x3812fc[_0x364515(0x16d)][_0x364515(0x1e3)])));console[_0x364515(0x180)](_0x364515(0x1b1)+a4_0x2359e2['cyan'](_0x3812fc[_0x364515(0x1b8)])),displayDiffs(_0x3812fc[_0x364515(0x1e4)],_0x3812fc[_0x364515(0x179)],_0x3812fc[_0x364515(0x196)],_0x3812fc[_0x364515(0x1d5)],_0x3812fc[_0x364515(0x16e)],_0x3812fc[_0x364515(0x1e2)],_0x3812fc[_0x364515(0x1e3)]);if(_0x26f32c)return console['log'](a4_0x2359e2['yellow'](_0x364515(0x1f3))),0x0;if(_0xc77f51===0x0&&_0x23e85e===0x0)return console[_0x364515(0x180)](a4_0x2359e2[_0x364515(0x1cf)](_0x364515(0x14f))),saveSessionContext({'llm_project':_0x3812fc['projectName']},_0x4da5c6[_0x364515(0x173)]),console[_0x364515(0x180)](a4_0x2359e2[_0x364515(0x1cf)](_0x364515(0x188)+a4_0x2359e2['dim']('llm_project')+_0x364515(0x1f7)+a4_0x2359e2[_0x364515(0x1a3)](_0x3812fc[_0x364515(0x1cb)]))),0x0;if(!_0x4ae680&&!_0x29c226){if(!isInteractive())return console[_0x364515(0x18e)](a4_0x2359e2[_0x364515(0x151)](_0x364515(0x1ff)),_0x364515(0x14a)),console[_0x364515(0x18e)](a4_0x2359e2[_0x364515(0x1e6)](_0x364515(0x16f))),0x1;const _0x447831=await confirmKey(_0x364515(0x150)+(_0xc77f51+_0x23e85e)+_0x364515(0x157));if(!_0x447831)return console[_0x364515(0x180)](a4_0x2359e2[_0x364515(0x1ce)](_0x364515(0x1c6)),_0x364515(0x1f1)),0x1;}const {data:_0x132ef7}=await withSpinner(_0x364515(0x1ae),()=>_0xc86ed8[_0x364515(0x158)][_0x364515(0x1ac)](_0x2a43ba,_0x3d65cc,{'force':_0x29c226}));return console[_0x364515(0x180)](a4_0x2359e2[_0x364515(0x1cf)](_0x364515(0x198)+(_0xc77f51+_0x23e85e)+_0x364515(0x17c)+_0x132ef7['outputDir'])),saveSessionContext({'llm_project':_0x132ef7[_0x364515(0x1cb)]},_0x4da5c6[_0x364515(0x173)]),console[_0x364515(0x180)](a4_0x2359e2[_0x364515(0x1cf)](_0x364515(0x188)+a4_0x2359e2[_0x364515(0x1e6)]('llm_project')+'\x20=\x20'+a4_0x2359e2['cyan'](_0x132ef7[_0x364515(0x1cb)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x27c9da(0x155);[a4_0x27c9da(0x1b4)]=a4_0x27c9da(0x175);async['execute'](_0x5efd3a){const _0x4a0424=a4_0x27c9da,{options:_0x41c252,args:_0x35f375,tdx:_0x501b05}=_0x5efd3a,_0x491e8b=_0x35f375[0x0],_0x5f566e=_0x41c252[_0x4a0424(0x1a9)],_0x5c355c=_0x41c252[_0x4a0424(0x164)],_0x3835fa=_0x41c252[_0x4a0424(0x1f6)],_0x58d972=_0x41c252[_0x4a0424(0x15b)],_0x2945e9=_0x41c252['llmProject'];let _0x1b6cc3;const _0x97d9b5=findAgentConfigPath(process[_0x4a0424(0x16a)]());if(_0x491e8b){const _0x5a1293=a4_0x570106[_0x4a0424(0x195)](_0x491e8b,_0x4a0424(0x1a5));existsSync(_0x5a1293)?(_0x1b6cc3=_0x491e8b,console['log'](a4_0x2359e2[_0x4a0424(0x1e6)]('Using\x20local\x20project:\x20'+_0x491e8b))):_0x1b6cc3=_0x491e8b;}else{if(_0x97d9b5)_0x1b6cc3=a4_0x570106[_0x4a0424(0x16b)](_0x97d9b5),console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x1e6)]('Using\x20current\x20project:\x20'+_0x1b6cc3));else{if(_0x2945e9){const _0x3c1922=sanitizeForFilesystem(_0x2945e9);let _0x45e1a4=_0x3c1922,_0x5d8a81=a4_0x570106[_0x4a0424(0x195)](process[_0x4a0424(0x16a)](),_0x4a0424(0x1e4),_0x3c1922,_0x4a0424(0x1a5));if(!existsSync(_0x5d8a81)){const _0x11a2af=normalizeName(_0x2945e9),_0x1a8a25=a4_0x570106['join'](process[_0x4a0424(0x16a)](),'agents',_0x11a2af,'tdx.json');existsSync(_0x1a8a25)&&(_0x45e1a4=_0x11a2af,_0x5d8a81=_0x1a8a25);}if(existsSync(_0x5d8a81))_0x1b6cc3=a4_0x570106[_0x4a0424(0x16b)](_0x5d8a81),console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x1e6)]('Using\x20local\x20project:\x20'+_0x1b6cc3));else{const _0x44bcdd=_0x41c252[_0x4a0424(0x1a6)];if(_0x44bcdd)throw new SDKError(ErrorCode[_0x4a0424(0x18b)],_0x4a0424(0x1bf)+_0x2945e9+_0x4a0424(0x1ef),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x4a0424(0x1cd)+(_0x4a0424(0x1b7)+_0x2945e9+'\x0a')+(_0x4a0424(0x18c)+_0x45e1a4+_0x4a0424(0x1eb)+(_0x5f566e||_0x4a0424(0x1d8))+_0x4a0424(0x153)+_0x44bcdd)});_0x1b6cc3=_0x2945e9,console[_0x4a0424(0x180)](a4_0x2359e2['dim'](_0x4a0424(0x1c1)+_0x2945e9));}}}}if(!_0x1b6cc3)return console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x1ce)](_0x4a0424(0x156))),console[_0x4a0424(0x180)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x4a0424(0x180)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x4a0424(0x180)](_0x4a0424(0x1a0)),0x1;if(!_0x5f566e)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x4a0424(0x170),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x3835fa&&!_0x5c355c){if(!isInteractive())return console[_0x4a0424(0x18e)](a4_0x2359e2[_0x4a0424(0x151)](_0x4a0424(0x1ff)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4a0424(0x18e)](a4_0x2359e2[_0x4a0424(0x1e6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x46901c=await confirmKey(_0x4a0424(0x15a)+_0x1b6cc3+_0x4a0424(0x1c3)+_0x5f566e+'\x22?');if(!_0x46901c)return console[_0x4a0424(0x180)](a4_0x2359e2['yellow'](_0x4a0424(0x1c6))),0x1;}const {data:_0x2e9fc9}=await withSpinner(_0x4a0424(0x1f8)+_0x1b6cc3+_0x4a0424(0x1d2)+_0x5f566e+'\x22...',()=>_0x501b05[_0x4a0424(0x158)][_0x4a0424(0x17a)](_0x1b6cc3,_0x5f566e,{'dryRun':_0x5c355c}));if(_0x5c355c){console[_0x4a0424(0x180)](a4_0x2359e2['yellow'](_0x4a0424(0x181))),console[_0x4a0424(0x180)](_0x4a0424(0x163)+_0x2e9fc9[_0x4a0424(0x1ba)]),console[_0x4a0424(0x180)](_0x4a0424(0x1d0)+_0x5f566e),console[_0x4a0424(0x180)](_0x4a0424(0x15d)),console[_0x4a0424(0x180)](_0x4a0424(0x1ab)+_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e4)][_0x4a0424(0x19f)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x2e9fc9['counts']['knowledgeBases']['created']),console[_0x4a0424(0x180)](_0x4a0424(0x1ec)+_0x2e9fc9[_0x4a0424(0x16d)]['prompts'][_0x4a0424(0x19f)]);const _0x15cac0=_0x2e9fc9[_0x4a0424(0x16d)]['experimentalKnowledgeBases'][_0x4a0424(0x19f)]>0x0||_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e3)][_0x4a0424(0x19f)]>0x0;return _0x15cac0&&(console[_0x4a0424(0x180)](_0x4a0424(0x15e)+_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e2)]['created']),console['log'](_0x4a0424(0x193)+_0x2e9fc9[_0x4a0424(0x16d)]['experimentalArtifacts'][_0x4a0424(0x19f)])),0x0;}const _0x5b7e98=_0x2e9fc9['counts'][_0x4a0424(0x1e4)][_0x4a0424(0x1f5)]>0x0||_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x179)][_0x4a0424(0x1f5)]>0x0||_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1d5)][_0x4a0424(0x1f5)]>0x0||_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e2)][_0x4a0424(0x1f5)]>0x0||_0x2e9fc9['counts'][_0x4a0424(0x1e3)][_0x4a0424(0x1f5)]>0x0;_0x5b7e98?console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x1ce)](_0x4a0424(0x1c8))):console[_0x4a0424(0x180)](a4_0x2359e2['green'](_0x4a0424(0x1a8)));console[_0x4a0424(0x180)](_0x4a0424(0x163)+_0x2e9fc9[_0x4a0424(0x1ba)]),console[_0x4a0424(0x180)](_0x4a0424(0x1d0)+_0x2e9fc9[_0x4a0424(0x1b3)]),console[_0x4a0424(0x180)](_0x4a0424(0x1c2)+_0x2e9fc9[_0x4a0424(0x172)]),console[_0x4a0424(0x180)](),console[_0x4a0424(0x180)](_0x4a0424(0x17e)),console[_0x4a0424(0x180)](_0x4a0424(0x1ab)+formatCountSummary(_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e4)])),console[_0x4a0424(0x180)](_0x4a0424(0x1d4)+formatCountSummary(_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x179)])),console[_0x4a0424(0x180)](_0x4a0424(0x1ec)+formatCountSummary(_0x2e9fc9['counts'][_0x4a0424(0x1d5)])),console[_0x4a0424(0x180)](_0x4a0424(0x18f)+formatCountSummary(_0x2e9fc9['counts'][_0x4a0424(0x16e)]));const _0x30ec39=_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e2)][_0x4a0424(0x19f)]>0x0||_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e2)][_0x4a0424(0x1f9)]>0x0||_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e2)][_0x4a0424(0x1ca)]>0x0||_0x2e9fc9['counts'][_0x4a0424(0x1e3)][_0x4a0424(0x19f)]>0x0||_0x2e9fc9[_0x4a0424(0x16d)][_0x4a0424(0x1e3)][_0x4a0424(0x1f9)]>0x0||_0x2e9fc9['counts'][_0x4a0424(0x1e3)][_0x4a0424(0x1ca)]>0x0;_0x30ec39&&(console[_0x4a0424(0x180)](_0x4a0424(0x15e)+formatCountSummary(_0x2e9fc9['counts'][_0x4a0424(0x1e2)])),console[_0x4a0424(0x180)](_0x4a0424(0x193)+formatCountSummary(_0x2e9fc9['counts'][_0x4a0424(0x1e3)])));if(_0x5b7e98){console['log'](),console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x151)](_0x4a0424(0x1f0)));for(const _0x11c9fe of _0x2e9fc9[_0x4a0424(0x1e4)]){_0x11c9fe[_0x4a0424(0x183)]===_0x4a0424(0x18e)&&console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x151)](_0x4a0424(0x1b0)+_0x11c9fe[_0x4a0424(0x1e9)]+'\x22:\x20'+_0x11c9fe[_0x4a0424(0x18e)]));}for(const _0x59df30 of _0x2e9fc9[_0x4a0424(0x179)]){_0x59df30[_0x4a0424(0x183)]===_0x4a0424(0x18e)&&console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x151)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x59df30[_0x4a0424(0x1a9)]+_0x4a0424(0x1e1)+_0x59df30[_0x4a0424(0x18e)]));}for(const _0x48161e of _0x2e9fc9[_0x4a0424(0x1d5)]){_0x48161e[_0x4a0424(0x183)]===_0x4a0424(0x18e)&&console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x151)](_0x4a0424(0x165)+_0x48161e[_0x4a0424(0x1a9)]+_0x4a0424(0x1e1)+_0x48161e[_0x4a0424(0x18e)]));}for(const _0x593dcd of _0x2e9fc9[_0x4a0424(0x16e)]){_0x593dcd[_0x4a0424(0x183)]===_0x4a0424(0x18e)&&console[_0x4a0424(0x180)](a4_0x2359e2['red']('\x20\x20Integration\x20\x22'+_0x593dcd[_0x4a0424(0x1a9)]+_0x4a0424(0x1e1)+_0x593dcd[_0x4a0424(0x18e)]));}for(const _0x10ce48 of _0x2e9fc9[_0x4a0424(0x1e2)]){_0x10ce48[_0x4a0424(0x183)]===_0x4a0424(0x18e)&&console['log'](a4_0x2359e2[_0x4a0424(0x151)](_0x4a0424(0x1ad)+_0x10ce48[_0x4a0424(0x1a9)]+_0x4a0424(0x1e1)+_0x10ce48['error']));}for(const _0x268316 of _0x2e9fc9[_0x4a0424(0x1e3)]){_0x268316['action']===_0x4a0424(0x18e)&&console[_0x4a0424(0x180)](a4_0x2359e2[_0x4a0424(0x151)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x268316['name']+'\x22:\x20'+_0x268316[_0x4a0424(0x18e)]));}return 0x1;}console[_0x4a0424(0x180)]();const _0x444c3d=getLLMProjectUrl(_0x58d972,_0x2e9fc9[_0x4a0424(0x172)]);return console['log'](_0x4a0424(0x1ed)+a4_0x2359e2['cyan'](_0x444c3d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x27c9da(0x1a9)]=a4_0x27c9da(0x1dc);[a4_0x27c9da(0x1b4)]=a4_0x27c9da(0x1c0);async[a4_0x27c9da(0x1a1)](_0x2acfca){const _0x137d0a=a4_0x27c9da,{options:_0x1f2dce,args:_0x3c5fc6,tdx:_0xbbbcf}=_0x2acfca;let _0x390d48=_0x3c5fc6[0x0]||process['cwd']();const _0x203557=_0x1f2dce[_0x137d0a(0x164)],_0x272d02=_0x1f2dce['force'],_0x2be558=_0x1f2dce[_0x137d0a(0x1f6)],_0x21f10d=_0x1f2dce[_0x137d0a(0x15b)],_0x4231ab=a4_0x570106['join'](_0x390d48,_0x137d0a(0x1b2)),_0x23924e=existsSync(_0x4231ab);if(_0x23924e){const {data:_0x208ac3}=await withSpinner(_0x137d0a(0x189)+_0x390d48+_0x137d0a(0x171),()=>_0xbbbcf['llm'][_0x137d0a(0x1ea)](_0x390d48,{'dryRun':_0x203557,'force':_0x272d02}));if(_0x203557)return console[_0x137d0a(0x180)](a4_0x2359e2['yellow'](_0x137d0a(0x181))),console[_0x137d0a(0x180)]('Would\x20push\x20agent:\x20'+_0x208ac3[_0x137d0a(0x1e9)]),0x0;if(_0x208ac3['action']===_0x137d0a(0x18e))return console[_0x137d0a(0x180)](a4_0x2359e2['red'](_0x137d0a(0x1db)+_0x208ac3[_0x137d0a(0x18e)])),0x1;console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x1cf)](_0x137d0a(0x176)+_0x208ac3[_0x137d0a(0x183)]+_0x137d0a(0x18a))),console[_0x137d0a(0x180)](_0x137d0a(0x159)+_0x208ac3[_0x137d0a(0x1e9)]);if(_0x208ac3['agentId']&&_0x208ac3[_0x137d0a(0x190)]){const _0x479b75=getLLMAgentChatUrl(_0x21f10d,_0x208ac3[_0x137d0a(0x190)],_0x208ac3[_0x137d0a(0x19d)]);console['log']('Chat:\x20'+a4_0x2359e2['cyan'](_0x479b75));}return 0x0;}const _0x288902=_0x1f2dce[_0x137d0a(0x166)],_0x8e70f5=resolveProjectFromContext(_0x390d48,_0x288902);if(_0x8e70f5['found'])_0x390d48=_0x8e70f5[_0x137d0a(0x1af)],_0x8e70f5['source']===_0x137d0a(0x1da)&&console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x1e6)]('Using\x20project:\x20'+_0x390d48));else{let _0x2b5725=_0x137d0a(0x1b6);_0x8e70f5[_0x137d0a(0x1a4)]==='no_local_folder'&&(_0x2b5725=_0x8e70f5['message']+_0x137d0a(0x14d)+_0x8e70f5[_0x137d0a(0x166)]+_0x137d0a(0x178));throw new SDKError(ErrorCode[_0x137d0a(0x18b)],_0x8e70f5[_0x137d0a(0x1a4)]==='no_context'?_0x8e70f5[_0x137d0a(0x1c9)]:_0x137d0a(0x167)+_0x390d48,undefined,{'helpText':_0x2b5725});}const {data:_0x1d1879}=await withSpinner(_0x137d0a(0x15f),()=>_0xbbbcf[_0x137d0a(0x158)]['pushProject'](_0x390d48,{'dryRun':!![]})),_0x49efd2=_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e4)][_0x137d0a(0x1f5)]>0x0;if(_0x49efd2){console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x151)](_0x137d0a(0x14b)));for(const _0x7875ab of _0x1d1879['agents']){_0x7875ab[_0x137d0a(0x183)]===_0x137d0a(0x18e)&&console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x151)](_0x137d0a(0x1b0)+_0x7875ab[_0x137d0a(0x1e9)]+_0x137d0a(0x1e1)+_0x7875ab[_0x137d0a(0x18e)]));}return 0x1;}const _0x12613e=_0x1d1879['counts'][_0x137d0a(0x1e4)]['created']+_0x1d1879['counts'][_0x137d0a(0x179)][_0x137d0a(0x19f)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x196)][_0x137d0a(0x19f)]+_0x1d1879[_0x137d0a(0x16d)]['prompts'][_0x137d0a(0x19f)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x16e)][_0x137d0a(0x19f)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e2)][_0x137d0a(0x19f)]+_0x1d1879['counts'][_0x137d0a(0x1e3)][_0x137d0a(0x19f)],_0x556c88=_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e4)][_0x137d0a(0x1f9)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x179)]['updated']+_0x1d1879['counts']['textKnowledgeBases'][_0x137d0a(0x1f9)]+_0x1d1879[_0x137d0a(0x16d)]['prompts'][_0x137d0a(0x1f9)]+_0x1d1879['counts']['integrations'][_0x137d0a(0x1f9)]+_0x1d1879['counts']['experimentalKnowledgeBases'][_0x137d0a(0x1f9)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e3)][_0x137d0a(0x1f9)],_0x34802a=_0x1d1879['counts'][_0x137d0a(0x1e4)][_0x137d0a(0x1ca)]+_0x1d1879['counts']['knowledgeBases']['unchanged']+_0x1d1879[_0x137d0a(0x16d)]['textKnowledgeBases'][_0x137d0a(0x1ca)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1d5)]['unchanged']+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x16e)][_0x137d0a(0x1ca)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e2)][_0x137d0a(0x1ca)]+_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e3)][_0x137d0a(0x1ca)];console[_0x137d0a(0x180)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1d1879[_0x137d0a(0x1cb)]+'\x27:'),console['log']('\x20\x20'+a4_0x2359e2[_0x137d0a(0x1cf)]('+\x20'+_0x12613e+'\x20new')+_0x137d0a(0x187)+a4_0x2359e2[_0x137d0a(0x1ce)]('~\x20'+_0x556c88+_0x137d0a(0x19b))+_0x137d0a(0x187)+a4_0x2359e2[_0x137d0a(0x1e6)]('=\x20'+_0x34802a+_0x137d0a(0x1fb))),console['log'](_0x137d0a(0x1ab)+formatCountSummary(_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e4)])),console[_0x137d0a(0x180)](_0x137d0a(0x1d4)+formatCountSummary(_0x1d1879['counts'][_0x137d0a(0x179)])),console[_0x137d0a(0x180)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x196)])),console[_0x137d0a(0x180)](_0x137d0a(0x1ec)+formatCountSummary(_0x1d1879['counts'][_0x137d0a(0x1d5)])),console[_0x137d0a(0x180)](_0x137d0a(0x18f)+formatCountSummary(_0x1d1879[_0x137d0a(0x16d)]['integrations']));const _0x4ff297=_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e2)]['created']>0x0||_0x1d1879['counts'][_0x137d0a(0x1e2)][_0x137d0a(0x1f9)]>0x0||_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e2)][_0x137d0a(0x1ca)]>0x0||_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e3)][_0x137d0a(0x19f)]>0x0||_0x1d1879['counts']['experimentalArtifacts'][_0x137d0a(0x1f9)]>0x0||_0x1d1879[_0x137d0a(0x16d)][_0x137d0a(0x1e3)]['unchanged']>0x0;_0x4ff297&&(console['log'](_0x137d0a(0x15e)+formatCountSummary(_0x1d1879['counts'][_0x137d0a(0x1e2)])),console['log'](_0x137d0a(0x193)+formatCountSummary(_0x1d1879['counts'][_0x137d0a(0x1e3)])));console[_0x137d0a(0x180)](_0x137d0a(0x186)+a4_0x2359e2[_0x137d0a(0x1a3)](_0x390d48)),displayDiffs(_0x1d1879[_0x137d0a(0x1e4)],_0x1d1879[_0x137d0a(0x179)],_0x1d1879[_0x137d0a(0x196)],_0x1d1879['prompts'],_0x1d1879['integrations'],_0x1d1879[_0x137d0a(0x1e2)],_0x1d1879[_0x137d0a(0x1e3)]);if(_0x203557)return console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x1ce)](_0x137d0a(0x177))),0x0;if(_0x12613e===0x0&&_0x556c88===0x0){console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x1cf)](_0x137d0a(0x1d6)));const _0x676b78=getLLMProjectUrl(_0x21f10d,_0x1d1879[_0x137d0a(0x190)]);return console[_0x137d0a(0x180)](_0x137d0a(0x1ed)+a4_0x2359e2[_0x137d0a(0x1a3)](_0x676b78)),0x0;}if(!_0x2be558&&!_0x272d02){if(!isInteractive())return console[_0x137d0a(0x18e)](a4_0x2359e2[_0x137d0a(0x151)](_0x137d0a(0x1ff)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x137d0a(0x18e)](a4_0x2359e2['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xb4cf60=await confirmKey(_0x137d0a(0x191)+(_0x12613e+_0x556c88)+_0x137d0a(0x19c));if(!_0xb4cf60)return console['log'](a4_0x2359e2['yellow'](_0x137d0a(0x1c6)),_0x137d0a(0x1f2)),0x1;}const {data:_0x17393e}=await withSpinner('Pushing\x20to\x20project...',()=>_0xbbbcf[_0x137d0a(0x158)][_0x137d0a(0x1d1)](_0x390d48,{'force':_0x272d02})),_0x5f8e39=_0x17393e['counts']['agents'][_0x137d0a(0x1f5)]>0x0||_0x17393e[_0x137d0a(0x16d)]['knowledgeBases'][_0x137d0a(0x1f5)]>0x0||_0x17393e['counts'][_0x137d0a(0x196)][_0x137d0a(0x1f5)]>0x0||_0x17393e['counts'][_0x137d0a(0x1d5)]['errors']>0x0;if(_0x5f8e39){console['log'](a4_0x2359e2[_0x137d0a(0x1ce)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x137d0a(0x180)](),console['log'](a4_0x2359e2['red'](_0x137d0a(0x1f0)));for(const _0x3354c8 of _0x17393e[_0x137d0a(0x1e4)]){_0x3354c8[_0x137d0a(0x183)]===_0x137d0a(0x18e)&&console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x151)](_0x137d0a(0x1b0)+_0x3354c8[_0x137d0a(0x1e9)]+_0x137d0a(0x1e1)+_0x3354c8[_0x137d0a(0x18e)]));}for(const _0x29c40e of _0x17393e[_0x137d0a(0x179)]){_0x29c40e[_0x137d0a(0x183)]===_0x137d0a(0x18e)&&console[_0x137d0a(0x180)](a4_0x2359e2['red'](_0x137d0a(0x15c)+_0x29c40e[_0x137d0a(0x1a9)]+'\x22:\x20'+_0x29c40e[_0x137d0a(0x18e)]));}for(const _0x2f22a3 of _0x17393e[_0x137d0a(0x196)]){_0x2f22a3[_0x137d0a(0x183)]===_0x137d0a(0x18e)&&console['log'](a4_0x2359e2[_0x137d0a(0x151)](_0x137d0a(0x1c4)+_0x2f22a3[_0x137d0a(0x1a9)]+_0x137d0a(0x1e1)+_0x2f22a3['error']));}for(const _0x67bfc3 of _0x17393e['prompts']){_0x67bfc3[_0x137d0a(0x183)]===_0x137d0a(0x18e)&&console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x151)](_0x137d0a(0x165)+_0x67bfc3[_0x137d0a(0x1a9)]+_0x137d0a(0x1e1)+_0x67bfc3[_0x137d0a(0x18e)]));}for(const _0x2dd620 of _0x17393e[_0x137d0a(0x16e)]){_0x2dd620[_0x137d0a(0x183)]==='error'&&console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x151)](_0x137d0a(0x1a2)+_0x2dd620[_0x137d0a(0x1a9)]+'\x22:\x20'+_0x2dd620[_0x137d0a(0x18e)]));}return 0x1;}console[_0x137d0a(0x180)](a4_0x2359e2[_0x137d0a(0x1cf)]('\x0a✔\x20Pushed\x20'+(_0x12613e+_0x556c88)+_0x137d0a(0x17f)+_0x17393e[_0x137d0a(0x1cb)]+'\x27'));const _0x188dc4=getLLMProjectUrl(_0x21f10d,_0x17393e[_0x137d0a(0x190)]);return console[_0x137d0a(0x180)](_0x137d0a(0x1ed)+a4_0x2359e2[_0x137d0a(0x1a3)](_0x188dc4)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x391cce=a5_0xfb4b;function a5_0xfb4b(_0x16d93b,_0x5144b7){_0x16d93b=_0x16d93b-0x1d3;const _0x1ff7bc=a5_0x1ff7();let _0xfb4b88=_0x1ff7bc[_0x16d93b];return _0xfb4b88;}(function(_0x2d96f4,_0x20b064){const _0xef588e=a5_0xfb4b,_0x50250b=_0x2d96f4();while(!![]){try{const _0x3465cd=-parseInt(_0xef588e(0x25d))/0x1*(-parseInt(_0xef588e(0x204))/0x2)+-parseInt(_0xef588e(0x229))/0x3+parseInt(_0xef588e(0x1f1))/0x4*(-parseInt(_0xef588e(0x242))/0x5)+parseInt(_0xef588e(0x264))/0x6*(-parseInt(_0xef588e(0x228))/0x7)+-parseInt(_0xef588e(0x214))/0x8*(parseInt(_0xef588e(0x1e5))/0x9)+-parseInt(_0xef588e(0x230))/0xa*(parseInt(_0xef588e(0x22d))/0xb)+parseInt(_0xef588e(0x206))/0xc;if(_0x3465cd===_0x20b064)break;else _0x50250b['push'](_0x50250b['shift']());}catch(_0x554baf){_0x50250b['push'](_0x50250b['shift']());}}}(a5_0x1ff7,0x1dbc3));import*as a5_0x22729e from'node:fs';function a5_0x1ff7(){const _0x52581d=['filter','verbose','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','25144rdkzPw','173505bYVKxb','\x20\x20Conversation:\x20','status','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','143VhkOus','agent','stop','98130jCwzVw','toISOString','context','site','log','Tests\x20found:\x20','projectDir','Total:\x20\x20\x20\x20','llm','length','basename','Passed:\x20\x20\x20','Project\x20path:\x20','red','source','resolve','eval','tsv','65CYvZHO','\x27\x20to\x20create\x20the\x20folder\x20structure.','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','dryRun','now','white','/<agent-name>','round','cyan','Failed\x20Tests:','split','Evaluating\x20response...','dim','✗\x20ERROR:\x20','text','\x20\x20Round\x20','Test\x20','executeReeval','repeat','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','toLowerCase','Run\x20tests\x20for\x20an\x20LLM\x20agent','\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','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','name','agent:test','Usage:','787JMruSn','404','ERROR','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','start','114jjhJbn','add','✓\x20PASS:\x20','\x20\x20Project:\x20','description','has','no_tests','rounds','tags','Executing\x20new\x20tests...','\x20-\x20','New\x20tests\x20to\x20execute:\x20','Test\x20Summary','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','not\x20found','Re-evaluating\x20cached\x20test\x20run...','agentName','timestamp','✗\x20FAIL:\x20','Test\x20Configuration:','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','conversation_url','6327iaIHTH','jsonl','yellow','forEach','writeFileSync','No\x20tests\x20have\x20tags\x20defined.','Output\x20written\x20to:\x20','PASS','includes','tests','Round\x20','Error\x20writing\x20output\x20file:\x20','28684TqkpkV','Run\x20\x27tdx\x20agent\x20pull\x20','some','reeval','Re-evaluating\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20\x20Site:\x20','\x20\x20-\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','projectName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','push','Site:\x20','size','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','...\x20','⚠\x20SKIPPED:\x20','Round\x201/','join','604RZPneQ','testYmlPath','5344932pBaeVE',':\x20Sending\x20user\x20input...','map','message','Failed:\x20\x20\x20','no_context','json','resolveProjectId','\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','\x20(cached)','trim','llmProject','Available\x20tests:\x20','2440QDLbgT','green','\x20\x20Evaluating...\x20','Re-evaluation\x20Summary','found','agentDirs','Conversation\x20URL:\x20','no_local_folder','conversations','output','testName','\x22:\x20','existsSync','Errors:\x20\x20\x20','...','find','execute'];a5_0x1ff7=function(){return _0x52581d;};return a5_0x1ff7();}import*as a5_0xf7ff1 from'node:path';import a5_0x532781 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{['name']=a5_0x391cce(0x25b);[a5_0x391cce(0x1d3)]=a5_0x391cce(0x257);async[a5_0x391cce(0x224)](_0x379d0a){const _0x561074=a5_0x391cce,{options:_0x522e99,args:_0xfec901,tdx:_0x196cb1}=_0x379d0a,_0x5d689d=_0xfec901[0x0]||'.',_0x3e23b0=_0x522e99[_0x561074(0x245)],_0x45d588=_0x522e99,_0x119173=_0x45d588[_0x561074(0x240)]===![],_0x3f050c=_0x45d588[_0x561074(0x1f4)],_0x3915ab=_0x45d588[_0x561074(0x25a)],_0x15becd=_0x45d588[_0x561074(0x1d7)],_0x1332b6=_0x522e99[_0x561074(0x233)],_0x1f73a7=_0x45d588[_0x561074(0x21d)];if(_0x3f050c&&_0x119173)return console[_0x561074(0x234)](a5_0x532781['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3b31e1='table';if(_0x45d588[_0x561074(0x20c)])_0x3b31e1=_0x561074(0x20c);else{if(_0x45d588[_0x561074(0x1e6)])_0x3b31e1=_0x561074(0x1e6);else{if(_0x45d588['tsv'])_0x3b31e1=_0x561074(0x241);else{if(_0x45d588['table'])_0x3b31e1=_0x561074(0x262);}}}const _0x141dcf=_0x45d588[_0x561074(0x212)];let _0x2c3140=_0x5d689d;const _0x1debc7=a5_0x22729e[_0x561074(0x220)](_0x5d689d),_0x4e50d9=_0x5d689d==='.';if(!_0x1debc7||_0x4e50d9){const _0x1e7d32=resolveProjectFromContext(_0x5d689d,_0x141dcf,{'requireFile':'test.yml'});if(_0x1e7d32[_0x561074(0x218)])_0x2c3140=_0x1e7d32[_0x561074(0x236)],_0x1e7d32[_0x561074(0x23e)]===_0x561074(0x232)&&console['log'](a5_0x532781[_0x561074(0x24e)]('Using\x20agent:\x20'+_0x2c3140));else switch(_0x1e7d32[_0x561074(0x20f)]){case _0x561074(0x20b):console[_0x561074(0x234)](a5_0x532781['yellow'](_0x1e7d32[_0x561074(0x209)])),console['log'](),console[_0x561074(0x234)](_0x561074(0x25c)),console[_0x561074(0x234)](_0x561074(0x258)),console[_0x561074(0x234)](_0x561074(0x20e)),console[_0x561074(0x234)](),console['log']('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x561074(0x21b):console[_0x561074(0x234)](a5_0x532781[_0x561074(0x1e7)](_0x1e7d32['message'])),console[_0x561074(0x234)](),console[_0x561074(0x234)](_0x561074(0x1f2)+_0x1e7d32[_0x561074(0x212)]+_0x561074(0x243));return 0x1;case'multiple_agents':{const _0x1e13ac=a5_0xf7ff1[_0x561074(0x23a)](_0x1e7d32['projectDir']);console[_0x561074(0x234)](a5_0x532781[_0x561074(0x1e7)](_0x561074(0x22c)+_0x1e7d32['llmProject']+'\x22:'));for(const _0xaeb294 of _0x1e7d32[_0x561074(0x219)]){console[_0x561074(0x234)](_0x561074(0x1f8)+_0xaeb294);}return console[_0x561074(0x234)](),console[_0x561074(0x234)](_0x561074(0x1ff)+_0x1e13ac+_0x561074(0x248)),0x1;}case _0x561074(0x1d5):console[_0x561074(0x234)](a5_0x532781[_0x561074(0x1e7)](_0x561074(0x244)+_0x1e7d32[_0x561074(0x212)]+'\x22.')),console[_0x561074(0x234)](a5_0x532781['dim'](_0x561074(0x23c)+_0x1e7d32[_0x561074(0x236)])),console[_0x561074(0x234)](),console[_0x561074(0x234)](_0x561074(0x1dc));return 0x1;}}const {definition:_0x36086f,agentInfo:_0x4aff6d}=parseTestFile(_0x2c3140);let _0x1bac0a=_0x36086f['tests'];if(_0x3915ab){const _0x1844e3=_0x3915ab[_0x561074(0x24c)](',')['map'](_0x299823=>_0x299823[_0x561074(0x211)]());_0x1bac0a=_0x36086f['tests'][_0x561074(0x225)](_0x4663ec=>_0x1844e3[_0x561074(0x1ed)](_0x4663ec[_0x561074(0x25a)]));if(_0x1bac0a[_0x561074(0x239)]===0x0)return console[_0x561074(0x234)](a5_0x532781[_0x561074(0x1e7)]('No\x20tests\x20found\x20matching:\x20'+_0x3915ab)),console['log'](a5_0x532781['dim'](_0x561074(0x213)+_0x36086f[_0x561074(0x1ee)]['map'](_0x482b15=>_0x482b15[_0x561074(0x25a)])[_0x561074(0x203)](',\x20'))),0x1;}if(_0x15becd){const _0x47aafa=_0x15becd[_0x561074(0x24c)](',')[_0x561074(0x208)](_0x6ba598=>_0x6ba598[_0x561074(0x211)]()[_0x561074(0x256)]());_0x1bac0a=_0x1bac0a[_0x561074(0x225)](_0x30e62f=>_0x30e62f['tags']?.[_0x561074(0x1f3)](_0x16b41d=>_0x47aafa['includes'](_0x16b41d[_0x561074(0x256)]())));if(_0x1bac0a['length']===0x0){console['log'](a5_0x532781[_0x561074(0x1e7)](_0x561074(0x260)+_0x15becd));const _0x9fee1b=new Set();return _0x36086f[_0x561074(0x1ee)][_0x561074(0x1e8)](_0x5c8338=>_0x5c8338[_0x561074(0x1d7)]?.[_0x561074(0x1e8)](_0x436873=>_0x9fee1b[_0x561074(0x265)](_0x436873))),_0x9fee1b[_0x561074(0x1fe)]>0x0?console[_0x561074(0x234)](a5_0x532781['dim']('Available\x20tags:\x20'+[..._0x9fee1b][_0x561074(0x203)](',\x20'))):console[_0x561074(0x234)](a5_0x532781[_0x561074(0x24e)](_0x561074(0x1ea))),0x1;}}if(_0x3f050c)return this['executeReeval'](_0x379d0a,{'definition':{'tests':_0x1bac0a},'agentInfo':_0x4aff6d,'outputFormat':_0x3b31e1,'outputFile':_0x1f73a7,'testNames':_0x3915ab});if(_0x3e23b0){console['log'](a5_0x532781['cyan'](_0x561074(0x1e2))),console['log'](_0x561074(0x1f7)+a5_0x532781[_0x561074(0x247)](_0x1332b6)),console[_0x561074(0x234)](_0x561074(0x267)+a5_0x532781[_0x561074(0x247)](_0x4aff6d[_0x561074(0x1fa)])),console[_0x561074(0x234)]('\x20\x20Agent:\x20'+a5_0x532781['white'](_0x4aff6d[_0x561074(0x1df)])),console['log'](),console[_0x561074(0x234)](_0x561074(0x235)+a5_0x532781[_0x561074(0x247)](_0x1bac0a['length']));for(let _0x4caa7f=0x0;_0x4caa7f<_0x1bac0a['length'];_0x4caa7f++){const _0x26c8f6=_0x1bac0a[_0x4caa7f],_0x3ddfff=_0x26c8f6[_0x561074(0x1d6)]['length']===0x1?_0x561074(0x249):_0x561074(0x1d6),_0x13cc2a=_0x26c8f6['tags']?.[_0x561074(0x239)]?'\x20['+_0x26c8f6[_0x561074(0x1d7)][_0x561074(0x203)](',\x20')+']':'';console[_0x561074(0x234)]('\x20\x20'+(_0x4caa7f+0x1)+'.\x20'+a5_0x532781[_0x561074(0x247)](_0x26c8f6[_0x561074(0x25a)])+'\x20('+_0x26c8f6[_0x561074(0x1d6)][_0x561074(0x239)]+'\x20'+_0x3ddfff+')'+a5_0x532781[_0x561074(0x24e)](_0x13cc2a));}return 0x0;}let _0x23f719,_0xd0e748;try{_0x23f719=await _0x196cb1[_0x561074(0x238)][_0x561074(0x20d)](_0x4aff6d[_0x561074(0x1fa)]);}catch(_0x377b3a){const _0x1a4b89=_0x377b3a instanceof Error?_0x377b3a[_0x561074(0x209)]:String(_0x377b3a);return _0x1a4b89[_0x561074(0x1ed)](_0x561074(0x25e))||_0x1a4b89['toLowerCase']()[_0x561074(0x1ed)](_0x561074(0x1dd))?console['log'](a5_0x532781['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x4aff6d['projectName'])):console['log'](a5_0x532781[_0x561074(0x23d)](_0x561074(0x261)+_0x4aff6d[_0x561074(0x1fa)]+_0x561074(0x21f)+_0x1a4b89)),0x1;}try{_0xd0e748=await _0x196cb1[_0x561074(0x238)]['resolveAgentId'](_0x4aff6d[_0x561074(0x1df)],_0x23f719);}catch(_0x4c64e0){const _0x36360b=_0x4c64e0 instanceof Error?_0x4c64e0[_0x561074(0x209)]:String(_0x4c64e0);return _0x36360b[_0x561074(0x1ed)](_0x561074(0x25e))||_0x36360b[_0x561074(0x256)]()[_0x561074(0x1ed)](_0x561074(0x1dd))?console['log'](a5_0x532781[_0x561074(0x23d)](_0x561074(0x1e3)+_0x4aff6d['agentName'])):console[_0x561074(0x234)](a5_0x532781[_0x561074(0x23d)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x4aff6d['agentName']+_0x561074(0x21f)+_0x36360b)),0x1;}let _0x47c549;if(!_0x119173)try{_0x47c549=await setupEvaluatorAgent(_0x196cb1[_0x561074(0x238)],_0x522e99[_0x561074(0x226)]);}catch(_0x14b67d){const _0x14131c=_0x14b67d instanceof Error?_0x14b67d[_0x561074(0x209)]:String(_0x14b67d);return console['log'](a5_0x532781[_0x561074(0x23d)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x14131c)),0x1;}console[_0x561074(0x234)](a5_0x532781[_0x561074(0x24a)]('Running\x20agent\x20tests...')),console[_0x561074(0x234)](_0x561074(0x1fd)+a5_0x532781[_0x561074(0x247)](_0x1332b6)),console[_0x561074(0x234)]('Agent:\x20'+a5_0x532781[_0x561074(0x247)](_0x4aff6d[_0x561074(0x1fa)]+'/'+_0x4aff6d['agentName'])),console[_0x561074(0x234)]();const _0x47e66f=[],_0x5b70d7=[],_0x22070f=Date[_0x561074(0x246)]();for(let _0x115d2e=0x0;_0x115d2e<_0x1bac0a['length'];_0x115d2e++){const _0x5ea453=_0x1bac0a[_0x115d2e];_0x1bac0a[_0x561074(0x239)]>0x1?console[_0x561074(0x234)](_0x561074(0x252)+(_0x115d2e+0x1)+'/'+_0x1bac0a['length']+':\x20'+a5_0x532781[_0x561074(0x247)](_0x5ea453[_0x561074(0x25a)])):console[_0x561074(0x234)]('Running\x20test:\x20'+a5_0x532781['white'](_0x5ea453[_0x561074(0x25a)]));const _0x41cec1=createCommandSpinner(_0x561074(0x202)+_0x5ea453['rounds'][_0x561074(0x239)]+_0x561074(0x207));_0x41cec1['start']();try{const {result:_0x288e67,conversation:_0x1b8f15}=await runTest(_0x196cb1[_0x561074(0x238)],_0x5ea453,{'agentId':_0xd0e748,'projectId':_0x23f719,'site':_0x1332b6,'noEval':_0x119173,'evaluatorId':_0x47c549,'onRoundStart':(_0x2da7dc,_0x229834)=>{const _0x179e0c=_0x561074;_0x41cec1[_0x179e0c(0x250)]='Round\x20'+(_0x2da7dc+0x1)+'/'+_0x229834+_0x179e0c(0x207);},'onRoundComplete':(_0x1adbd3,_0x1e52e3,_0x467b64)=>{const _0x2238d5=_0x561074,_0x5f3425=formatElapsed(_0x1e52e3);_0x467b64?console[_0x2238d5(0x234)]('\x20\x20Round\x20'+(_0x1adbd3+0x1)+'/'+_0x5ea453[_0x2238d5(0x1d6)][_0x2238d5(0x239)]+_0x2238d5(0x200)+a5_0x532781[_0x2238d5(0x215)]('✓')+'\x20('+_0x5f3425+')'):console[_0x2238d5(0x234)](_0x2238d5(0x251)+(_0x1adbd3+0x1)+'/'+_0x5ea453[_0x2238d5(0x1d6)][_0x2238d5(0x239)]+_0x2238d5(0x200)+a5_0x532781[_0x2238d5(0x23d)]('✗'));},'onEvaluationStart':()=>{const _0x354f4c=_0x561074;_0x41cec1[_0x354f4c(0x250)]=_0x354f4c(0x24d);},'onEvaluationComplete':_0x230269=>{const _0x337be7=_0x561074,_0x4eb4fa=formatElapsed(_0x230269);console[_0x337be7(0x234)](_0x337be7(0x216)+a5_0x532781['green']('✓')+'\x20('+_0x4eb4fa+')');}});_0x41cec1['stop'](),_0x47e66f[_0x561074(0x1fc)](_0x288e67),_0x5b70d7[_0x561074(0x1fc)](_0x1b8f15);if(_0x288e67[_0x561074(0x22b)]==='PASS')console[_0x561074(0x234)](a5_0x532781[_0x561074(0x215)]('✓\x20PASS:\x20'+_0x288e67['reason']));else _0x288e67['status']==='FAIL'?console['log'](a5_0x532781[_0x561074(0x23d)](_0x561074(0x1e1)+_0x288e67[_0x561074(0x20f)])):console[_0x561074(0x234)](a5_0x532781[_0x561074(0x23d)](_0x561074(0x24f)+_0x288e67[_0x561074(0x20f)]));_0x288e67[_0x561074(0x1e4)]&&console[_0x561074(0x234)](a5_0x532781[_0x561074(0x24e)](_0x561074(0x21a)+_0x288e67[_0x561074(0x1e4)])),console[_0x561074(0x234)]();}catch(_0x9ec406){_0x41cec1['stop']();const _0x5a31c2=_0x9ec406 instanceof Error?_0x9ec406[_0x561074(0x209)]:String(_0x9ec406);console[_0x561074(0x234)](a5_0x532781['red'](_0x561074(0x24f)+_0x5a31c2)),console[_0x561074(0x234)](),_0x47e66f[_0x561074(0x1fc)]({'name':_0x5ea453[_0x561074(0x25a)],'status':'ERROR','reason':_0x5a31c2,'timestamp':new Date()[_0x561074(0x231)](),'duration_ms':0x0});}}const _0x138d7b=Date[_0x561074(0x246)]()-_0x22070f,_0x339394=_0x47e66f[_0x561074(0x225)](_0x5f3594=>_0x5f3594[_0x561074(0x22b)]===_0x561074(0x1ec))[_0x561074(0x239)],_0xf0b66f=_0x47e66f[_0x561074(0x225)](_0x4bb2d9=>_0x4bb2d9[_0x561074(0x22b)]==='FAIL')[_0x561074(0x239)],_0x38d70d=_0x47e66f[_0x561074(0x225)](_0x1daad8=>_0x1daad8[_0x561074(0x22b)]===_0x561074(0x25f))[_0x561074(0x239)];console['log']('━'[_0x561074(0x254)](0x3c)),console[_0x561074(0x234)](_0x561074(0x1db)),console['log']('━'[_0x561074(0x254)](0x3c)),console[_0x561074(0x234)](_0x561074(0x237)+_0x47e66f[_0x561074(0x239)]),console['log'](_0x561074(0x23b)+a5_0x532781['green'](_0x339394)),console[_0x561074(0x234)]('Failed:\x20\x20\x20'+a5_0x532781[_0x561074(0x23d)](_0xf0b66f));_0x38d70d>0x0&&console[_0x561074(0x234)](_0x561074(0x221)+a5_0x532781[_0x561074(0x23d)](_0x38d70d));console[_0x561074(0x234)]('Duration:\x20'+formatElapsed(_0x138d7b)),console[_0x561074(0x234)]('━'[_0x561074(0x254)](0x3c));const _0x4040d8=_0x47e66f['filter'](_0x5df6b4=>_0x5df6b4['status']!==_0x561074(0x1ec));if(_0x4040d8[_0x561074(0x239)]>0x0){console[_0x561074(0x234)](),console[_0x561074(0x234)](_0x561074(0x24b));for(const _0x740b4d of _0x4040d8){const _0x31c8e5=a5_0x532781[_0x561074(0x23d)]('✗'),_0x415a16=_0x740b4d['reason'][_0x561074(0x239)]>0x32?_0x740b4d[_0x561074(0x20f)]['substring'](0x0,0x32)+'...':_0x740b4d[_0x561074(0x20f)];console[_0x561074(0x234)]('\x20\x20'+_0x31c8e5+'\x20'+_0x740b4d['name']+':\x20'+_0x415a16);}}const _0x270c12={'summary':{'total':_0x47e66f['length'],'passed':_0x339394,'failed':_0xf0b66f,'errors':_0x38d70d>0x0?_0x38d70d:undefined,'duration_ms':_0x138d7b},'tests':_0x47e66f,'agent':{'project':_0x4aff6d[_0x561074(0x1fa)],'name':_0x4aff6d[_0x561074(0x1df)],'site':_0x1332b6},'timestamp':new Date(_0x22070f)[_0x561074(0x231)]()};try{const _0x2abf56=buildCachedTestRun(_0x5b70d7,{'site':_0x1332b6,'projectId':_0x23f719,'projectName':_0x4aff6d[_0x561074(0x1fa)],'agentId':_0xd0e748,'agentName':_0x4aff6d[_0x561074(0x1df)],'testYmlPath':a5_0xf7ff1[_0x561074(0x23f)](_0x4aff6d[_0x561074(0x205)])});saveLastTestRun(_0x2abf56);}catch{}if(_0x3b31e1!==_0x561074(0x262)||_0x1f73a7){const _0x18813b=formatResults(_0x270c12,_0x3b31e1);if(_0x1f73a7)try{a5_0x22729e[_0x561074(0x1e9)](_0x1f73a7,_0x18813b,'utf-8'),console[_0x561074(0x234)](),console[_0x561074(0x234)](a5_0x532781[_0x561074(0x24e)](_0x561074(0x1eb)+_0x1f73a7));}catch(_0x40d9eb){return console[_0x561074(0x234)](),console[_0x561074(0x234)](a5_0x532781[_0x561074(0x23d)]('Error\x20writing\x20output\x20file:\x20'+_0x40d9eb)),0x1;}else console['log'](),console[_0x561074(0x234)](_0x18813b);}return _0x4040d8[_0x561074(0x239)]>0x0?0x1:0x0;}async[a5_0x391cce(0x253)](_0x58ff4c,_0x36de17){const _0x4cf2ca=a5_0x391cce,{options:_0x29b3a8,tdx:_0xe233cf}=_0x58ff4c,{definition:_0x340786,agentInfo:_0x20bd65,outputFormat:_0x1a77d0,outputFile:_0x3076c9}=_0x36de17,_0x2a131c=_0x29b3a8[_0x4cf2ca(0x233)],_0xbc320=loadLastTestRun();if(!_0xbc320)return console['log'](a5_0x532781[_0x4cf2ca(0x23d)](_0x4cf2ca(0x1f6))),console['log'](a5_0x532781['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0xbc320[_0x4cf2ca(0x22e)][_0x4cf2ca(0x1df)]!==_0x20bd65[_0x4cf2ca(0x1df)])return console['log'](a5_0x532781[_0x4cf2ca(0x23d)](_0x4cf2ca(0x259)+_0xbc320[_0x4cf2ca(0x22e)][_0x4cf2ca(0x1df)]+_0x4cf2ca(0x1f9)+_0x20bd65[_0x4cf2ca(0x1df)]+'\x22.')),console['log'](a5_0x532781[_0x4cf2ca(0x24e)](_0x4cf2ca(0x255))),0x1;const _0x5f5d56=new Set(_0xbc320[_0x4cf2ca(0x21c)][_0x4cf2ca(0x208)](_0x4f6436=>_0x4f6436[_0x4cf2ca(0x21e)])),_0x32064b=_0x340786[_0x4cf2ca(0x1ee)][_0x4cf2ca(0x225)](_0x27d890=>!_0x5f5d56['has'](_0x27d890[_0x4cf2ca(0x25a)]));if(_0x32064b[_0x4cf2ca(0x239)]>0x0&&_0xbc320[_0x4cf2ca(0x233)]!==_0x2a131c)return console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x23d)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x24e)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0xbc320[_0x4cf2ca(0x233)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x2a131c+'\x22.')),console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x24e)]('Either\x20switch\x20to\x20the\x20\x22'+_0xbc320[_0x4cf2ca(0x233)]+_0x4cf2ca(0x227))),0x1;const _0x2d7805=_0x340786[_0x4cf2ca(0x1ee)][_0x4cf2ca(0x225)](_0x1cd08d=>_0x5f5d56[_0x4cf2ca(0x1d4)](_0x1cd08d[_0x4cf2ca(0x25a)])),_0x8d78c7=_0x32064b;let _0x5644e8;try{_0x5644e8=await setupEvaluatorAgent(_0xe233cf[_0x4cf2ca(0x238)],_0x29b3a8[_0x4cf2ca(0x226)]);}catch(_0x40ddf0){const _0x48bb86=_0x40ddf0 instanceof Error?_0x40ddf0[_0x4cf2ca(0x209)]:String(_0x40ddf0);return console[_0x4cf2ca(0x234)](a5_0x532781['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x48bb86)),0x1;}console[_0x4cf2ca(0x234)](a5_0x532781['cyan'](_0x4cf2ca(0x1de))),console[_0x4cf2ca(0x234)]('Cached\x20run\x20from:\x20'+a5_0x532781[_0x4cf2ca(0x247)](_0xbc320[_0x4cf2ca(0x1e0)])),console[_0x4cf2ca(0x234)]('Agent:\x20'+a5_0x532781[_0x4cf2ca(0x247)](_0xbc320[_0x4cf2ca(0x22e)]['projectName']+'/'+_0xbc320[_0x4cf2ca(0x22e)][_0x4cf2ca(0x1df)]));_0x8d78c7[_0x4cf2ca(0x239)]>0x0&&console[_0x4cf2ca(0x234)](_0x4cf2ca(0x1da)+a5_0x532781[_0x4cf2ca(0x1e7)](_0x8d78c7[_0x4cf2ca(0x239)]));console[_0x4cf2ca(0x234)]();const _0x2bafe7=[],_0xb2e640=Date[_0x4cf2ca(0x246)](),_0x4eca51=createCommandSpinner('Re-evaluating...');if(_0x2d7805['length']>0x0)try{const _0x47e09c=await reevaluateFromCache(_0xe233cf[_0x4cf2ca(0x238)],_0xbc320,{'tests':_0x2d7805},{'evaluatorId':_0x5644e8,'onTestStart':(_0x5b7245,_0x2d0329,_0x4ad13d)=>{const _0x54479e=_0x4cf2ca;_0x4eca51[_0x54479e(0x250)]=_0x54479e(0x1f5)+(_0x2d0329+0x1)+'/'+_0x4ad13d+':\x20'+_0x5b7245+_0x54479e(0x222);if(!_0x4eca51['isSpinning'])_0x4eca51['start']();},'onTestComplete':(_0x4bdcec,_0x35b19e)=>{const _0x2ab756=_0x4cf2ca;_0x4eca51[_0x2ab756(0x22f)]();if(_0x35b19e['status']==='PASS')console[_0x2ab756(0x234)](a5_0x532781[_0x2ab756(0x215)](_0x2ab756(0x266)+_0x4bdcec)+a5_0x532781['dim'](_0x2ab756(0x210)));else _0x35b19e[_0x2ab756(0x22b)]==='FAIL'?console[_0x2ab756(0x234)](a5_0x532781[_0x2ab756(0x23d)]('✗\x20FAIL:\x20'+_0x4bdcec+_0x2ab756(0x1d9)+_0x35b19e[_0x2ab756(0x20f)])+a5_0x532781['dim'](_0x2ab756(0x210))):console[_0x2ab756(0x234)](a5_0x532781[_0x2ab756(0x23d)]('✗\x20ERROR:\x20'+_0x4bdcec+_0x2ab756(0x1d9)+_0x35b19e[_0x2ab756(0x20f)]));_0x35b19e[_0x2ab756(0x1e4)]&&console[_0x2ab756(0x234)](a5_0x532781['dim'](_0x2ab756(0x22a)+_0x35b19e[_0x2ab756(0x1e4)])),_0x2bafe7[_0x2ab756(0x1fc)](_0x35b19e);},'onTestSkipped':(_0x2458df,_0x5d0c66)=>{const _0x29bc30=_0x4cf2ca;_0x4eca51[_0x29bc30(0x22f)](),console['log'](a5_0x532781['yellow'](_0x29bc30(0x201)+_0x2458df+_0x29bc30(0x1d9)+_0x5d0c66));}});for(const _0x1f05c3 of _0x47e09c){!_0x2bafe7[_0x4cf2ca(0x223)](_0x36d89d=>_0x36d89d['name']===_0x1f05c3[_0x4cf2ca(0x25a)])&&_0x2bafe7[_0x4cf2ca(0x1fc)](_0x1f05c3);}}catch(_0x3ce252){_0x4eca51[_0x4cf2ca(0x22f)]();const _0x1614d4=_0x3ce252 instanceof Error?_0x3ce252[_0x4cf2ca(0x209)]:String(_0x3ce252);return console['log'](a5_0x532781[_0x4cf2ca(0x23d)](_0x4cf2ca(0x1fb)+_0x1614d4)),0x1;}_0x4eca51['stop']();if(_0x8d78c7[_0x4cf2ca(0x239)]>0x0){console[_0x4cf2ca(0x234)](),console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x24a)](_0x4cf2ca(0x1d8)));const {projectId:_0x57d97b,agentId:_0x547fc2}=_0xbc320[_0x4cf2ca(0x22e)];for(const _0x30173a of _0x8d78c7){console['log']('Running:\x20'+a5_0x532781[_0x4cf2ca(0x247)](_0x30173a[_0x4cf2ca(0x25a)]));const _0x588e82=createCommandSpinner(_0x4cf2ca(0x202)+_0x30173a[_0x4cf2ca(0x1d6)][_0x4cf2ca(0x239)]+_0x4cf2ca(0x207));_0x588e82[_0x4cf2ca(0x263)]();try{const {result:_0x51a3b3}=await runTest(_0xe233cf[_0x4cf2ca(0x238)],_0x30173a,{'agentId':_0x547fc2,'projectId':_0x57d97b,'site':_0xbc320['site'],'noEval':![],'evaluatorId':_0x5644e8,'onRoundStart':(_0x5aae83,_0x3ede8f)=>{const _0x31c9d7=_0x4cf2ca;_0x588e82[_0x31c9d7(0x250)]=_0x31c9d7(0x1ef)+(_0x5aae83+0x1)+'/'+_0x3ede8f+_0x31c9d7(0x207);},'onRoundComplete':(_0x5aa86c,_0x29d452,_0x259763)=>{const _0x18fe3a=_0x4cf2ca,_0x3cce0d=formatElapsed(_0x29d452);_0x259763?console['log']('\x20\x20Round\x20'+(_0x5aa86c+0x1)+'/'+_0x30173a['rounds']['length']+_0x18fe3a(0x200)+a5_0x532781['green']('✓')+'\x20('+_0x3cce0d+')'):console['log'](_0x18fe3a(0x251)+(_0x5aa86c+0x1)+'/'+_0x30173a[_0x18fe3a(0x1d6)]['length']+_0x18fe3a(0x200)+a5_0x532781[_0x18fe3a(0x23d)]('✗'));},'onEvaluationStart':()=>{const _0x98d758=_0x4cf2ca;_0x588e82['text']=_0x98d758(0x24d);},'onEvaluationComplete':_0xcd7f38=>{const _0xfa1fbf=_0x4cf2ca,_0x3c3d58=formatElapsed(_0xcd7f38);console[_0xfa1fbf(0x234)]('\x20\x20Evaluating...\x20'+a5_0x532781[_0xfa1fbf(0x215)]('✓')+'\x20('+_0x3c3d58+')');}});_0x588e82[_0x4cf2ca(0x22f)](),_0x2bafe7[_0x4cf2ca(0x1fc)](_0x51a3b3);if(_0x51a3b3[_0x4cf2ca(0x22b)]===_0x4cf2ca(0x1ec))console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x215)](_0x4cf2ca(0x266)+_0x51a3b3['reason'])+a5_0x532781[_0x4cf2ca(0x24e)]('\x20(new)'));else _0x51a3b3['status']==='FAIL'?console[_0x4cf2ca(0x234)](a5_0x532781['red'](_0x4cf2ca(0x1e1)+_0x51a3b3['reason'])+a5_0x532781[_0x4cf2ca(0x24e)]('\x20(new)')):console['log'](a5_0x532781['red']('✗\x20ERROR:\x20'+_0x51a3b3[_0x4cf2ca(0x20f)]));_0x51a3b3[_0x4cf2ca(0x1e4)]&&console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x24e)](_0x4cf2ca(0x22a)+_0x51a3b3['conversation_url']));}catch(_0x4dd74a){_0x588e82[_0x4cf2ca(0x22f)]();const _0x3e453a=_0x4dd74a instanceof Error?_0x4dd74a['message']:String(_0x4dd74a);console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x23d)](_0x4cf2ca(0x24f)+_0x3e453a)),_0x2bafe7[_0x4cf2ca(0x1fc)]({'name':_0x30173a['name'],'status':_0x4cf2ca(0x25f),'reason':_0x3e453a,'timestamp':new Date()[_0x4cf2ca(0x231)](),'duration_ms':0x0});}}}console[_0x4cf2ca(0x234)]();const _0x318650=Date[_0x4cf2ca(0x246)]()-_0xb2e640,_0xc1643a=_0x2bafe7[_0x4cf2ca(0x225)](_0x5bed04=>_0x5bed04[_0x4cf2ca(0x22b)]===_0x4cf2ca(0x1ec))[_0x4cf2ca(0x239)],_0x3d7f8d=_0x2bafe7[_0x4cf2ca(0x225)](_0x5d35b3=>_0x5d35b3[_0x4cf2ca(0x22b)]==='FAIL')[_0x4cf2ca(0x239)],_0x4aa311=_0x2bafe7[_0x4cf2ca(0x225)](_0x3b2ad7=>_0x3b2ad7[_0x4cf2ca(0x22b)]===_0x4cf2ca(0x25f))[_0x4cf2ca(0x239)];console[_0x4cf2ca(0x234)]('━'[_0x4cf2ca(0x254)](0x3c)),console[_0x4cf2ca(0x234)](_0x4cf2ca(0x217)),console['log']('━'[_0x4cf2ca(0x254)](0x3c)),console[_0x4cf2ca(0x234)]('Total:\x20\x20\x20\x20'+_0x2bafe7[_0x4cf2ca(0x239)]),console[_0x4cf2ca(0x234)](_0x4cf2ca(0x23b)+a5_0x532781['green'](_0xc1643a)),console[_0x4cf2ca(0x234)](_0x4cf2ca(0x20a)+a5_0x532781[_0x4cf2ca(0x23d)](_0x3d7f8d));_0x4aa311>0x0&&console[_0x4cf2ca(0x234)](_0x4cf2ca(0x221)+a5_0x532781['red'](_0x4aa311));console[_0x4cf2ca(0x234)]('Duration:\x20'+formatElapsed(_0x318650)),console[_0x4cf2ca(0x234)]('━'['repeat'](0x3c));const _0x23282e={'summary':{'total':_0x2bafe7[_0x4cf2ca(0x239)],'passed':_0xc1643a,'failed':_0x3d7f8d,'errors':_0x4aa311>0x0?_0x4aa311:undefined,'duration_ms':_0x318650},'tests':_0x2bafe7,'agent':{'project':_0x20bd65[_0x4cf2ca(0x1fa)],'name':_0x20bd65[_0x4cf2ca(0x1df)],'site':_0x2a131c},'timestamp':new Date(_0xb2e640)['toISOString']()};if(_0x1a77d0!=='table'||_0x3076c9){const _0x44bebe=formatResults(_0x23282e,_0x1a77d0);if(_0x3076c9)try{a5_0x22729e[_0x4cf2ca(0x1e9)](_0x3076c9,_0x44bebe,'utf-8'),console[_0x4cf2ca(0x234)](),console[_0x4cf2ca(0x234)](a5_0x532781['dim']('Output\x20written\x20to:\x20'+_0x3076c9));}catch(_0x2c001d){return console[_0x4cf2ca(0x234)](),console[_0x4cf2ca(0x234)](a5_0x532781[_0x4cf2ca(0x23d)](_0x4cf2ca(0x1f0)+_0x2c001d)),0x1;}else console[_0x4cf2ca(0x234)](),console[_0x4cf2ca(0x234)](_0x44bebe);}const _0x4012f5=_0x2bafe7[_0x4cf2ca(0x225)](_0x25935c=>_0x25935c[_0x4cf2ca(0x22b)]!==_0x4cf2ca(0x1ec));return _0x4012f5[_0x4cf2ca(0x239)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x350009=a5_0x3653;(function(_0x4f1f1b,_0x3ec508){const _0x268790=a5_0x3653,_0x408a86=_0x4f1f1b();while(!![]){try{const _0x16dcee=parseInt(_0x268790(0x16a))/0x1*(-parseInt(_0x268790(0x161))/0x2)+-parseInt(_0x268790(0x130))/0x3+parseInt(_0x268790(0x187))/0x4*(-parseInt(_0x268790(0x180))/0x5)+-parseInt(_0x268790(0x16e))/0x6+parseInt(_0x268790(0x170))/0x7+-parseInt(_0x268790(0x18a))/0x8+parseInt(_0x268790(0x15b))/0x9*(parseInt(_0x268790(0x171))/0xa);if(_0x16dcee===_0x3ec508)break;else _0x408a86['push'](_0x408a86['shift']());}catch(_0x221878){_0x408a86['push'](_0x408a86['shift']());}}}(a5_0x183a,0xa8663));import*as a5_0x607e01 from'node:fs';function a5_0x183a(){const _0x42f450=['\x20(cached)','yellow','\x20\x20Conversation:\x20','4674402KicnZD','size','5463878JkAsKR','39013810olTSrR','Errors:\x20\x20\x20','forEach','length','description','projectDir','New\x20tests\x20to\x20execute:\x20','projectName','executeReeval','Re-evaluating\x20cached\x20test\x20run...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Output\x20written\x20to:\x20','Failed:\x20\x20\x20','\x20\x20Project:\x20','find','535bHVRBC','red','Run\x20tests\x20for\x20an\x20LLM\x20agent','...','writeFileSync','Test\x20','\x20-\x20','15244OgSocW','conversations','trim','6125768VyMvIj','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Passed:\x20\x20\x20','Duration:\x20','jsonl','Project\x20path:\x20','Evaluating\x20response...','green','test.yml','Either\x20switch\x20to\x20the\x20\x22','✗\x20ERROR:\x20','toLowerCase','Test\x20Summary','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Round\x201/','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Site:\x20','conversation_url','eval','Total:\x20\x20\x20\x20','tags','404','round','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Available\x20tests:\x20','resolveAgentId','⚠\x20SKIPPED:\x20','substring','ERROR','dim','\x20\x20Round\x20','message','tests','\x20(new)','text','source','No\x20tests\x20found\x20matching:\x20','table','/<agent-name>','Running\x20test:\x20','push','filter','\x22:\x20','agent:test','llm','output','Round\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','rounds','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Re-evaluation\x20Summary','Cached\x20run\x20from:\x20','agent','Error\x20writing\x20output\x20file:\x20','now','Re-evaluating...','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','4023762LAMlur','includes','Run\x20\x27tdx\x20agent\x20pull\x20','dryRun','Cached\x20run\x20is\x20from\x20site\x20\x22','json','Available\x20tags:\x20','no_context','white','Tests\x20found:\x20','\x20\x20Evaluating...\x20','Using\x20agent:\x20','has','PASS','verbose','llmProject','context','Running\x20agent\x20tests...','reason','testYmlPath','Test\x20Configuration:','map','some','start','add','✗\x20FAIL:\x20','join','tsv','site','existsSync','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','resolveProjectId','resolve','✓\x20PASS:\x20','agentName','cyan','...\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','stop','toISOString','not\x20found','log','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','9MRCxfj','status','split','\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',':\x20Sending\x20user\x20input...','Failed\x20Tests:','1396706JWbLiz','name','FAIL','basename','\x20\x20Agent:\x20','no_tests','no_local_folder','repeat','Error:\x20No\x20previous\x20test\x20run\x20found.','1lrfhel'];a5_0x183a=function(){return _0x42f450;};return a5_0x183a();}import*as a5_0x29ab65 from'node:path';import a5_0x15ebbe from'chalk';function a5_0x3653(_0x34f3fb,_0x2a2c71){_0x34f3fb=_0x34f3fb-0xf9;const _0x183af6=a5_0x183a();let _0x365378=_0x183af6[_0x34f3fb];return _0x365378;}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_0x350009(0x162)]=a5_0x350009(0x122);[a5_0x350009(0x175)]=a5_0x350009(0x182);async['execute'](_0x463c1a){const _0x466df4=a5_0x350009,{options:_0x38cc83,args:_0x10f2a5,tdx:_0x1d1c48}=_0x463c1a,_0x6e275d=_0x10f2a5[0x0]||'.',_0x55c30a=_0x38cc83[_0x466df4(0x133)],_0x2054fe=_0x38cc83,_0x3c3be3=_0x2054fe[_0x466df4(0x109)]===![],_0x4bb7e6=_0x2054fe['reeval'],_0x5e5a95=_0x2054fe[_0x466df4(0x162)],_0x321dae=_0x2054fe[_0x466df4(0x10b)],_0x154abf=_0x38cc83[_0x466df4(0x14c)],_0x117605=_0x2054fe[_0x466df4(0x124)];if(_0x4bb7e6&&_0x3c3be3)return console[_0x466df4(0x159)](a5_0x15ebbe['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0xbdbd55=_0x466df4(0x11c);if(_0x2054fe['json'])_0xbdbd55=_0x466df4(0x135);else{if(_0x2054fe[_0x466df4(0xf9)])_0xbdbd55=_0x466df4(0xf9);else{if(_0x2054fe[_0x466df4(0x14b)])_0xbdbd55=_0x466df4(0x14b);else{if(_0x2054fe[_0x466df4(0x11c)])_0xbdbd55='table';}}}const _0x260c59=_0x2054fe[_0x466df4(0x13f)];let _0x58a32c=_0x6e275d;const _0x286502=a5_0x607e01[_0x466df4(0x14d)](_0x6e275d),_0x48e095=_0x6e275d==='.';if(!_0x286502||_0x48e095){const _0x4d6b55=resolveProjectFromContext(_0x6e275d,_0x260c59,{'requireFile':_0x466df4(0xfd)});if(_0x4d6b55['found'])_0x58a32c=_0x4d6b55[_0x466df4(0x176)],_0x4d6b55[_0x466df4(0x11a)]===_0x466df4(0x140)&&console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x114)](_0x466df4(0x13b)+_0x58a32c));else switch(_0x4d6b55[_0x466df4(0x142)]){case _0x466df4(0x137):console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x16c)](_0x4d6b55[_0x466df4(0x116)])),console[_0x466df4(0x159)](),console['log']('Usage:'),console[_0x466df4(0x159)](_0x466df4(0x15e)),console[_0x466df4(0x159)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x466df4(0x159)](),console[_0x466df4(0x159)](_0x466df4(0x103));return 0x1;case _0x466df4(0x167):console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x16c)](_0x4d6b55['message'])),console[_0x466df4(0x159)](),console[_0x466df4(0x159)](_0x466df4(0x132)+_0x4d6b55[_0x466df4(0x13f)]+_0x466df4(0x126));return 0x1;case'multiple_agents':{const _0x5d062b=a5_0x29ab65[_0x466df4(0x164)](_0x4d6b55[_0x466df4(0x176)]);console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x16c)](_0x466df4(0x14e)+_0x4d6b55[_0x466df4(0x13f)]+'\x22:'));for(const _0x656421 of _0x4d6b55['agentDirs']){console[_0x466df4(0x159)]('\x20\x20-\x20'+_0x656421);}return console[_0x466df4(0x159)](),console[_0x466df4(0x159)](_0x466df4(0x17b)+_0x5d062b+_0x466df4(0x11d)),0x1;}case _0x466df4(0x166):console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x16c)](_0x466df4(0x102)+_0x4d6b55[_0x466df4(0x13f)]+'\x22.')),console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x114)](_0x466df4(0xfa)+_0x4d6b55[_0x466df4(0x176)])),console[_0x466df4(0x159)](),console[_0x466df4(0x159)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x41c4f5,agentInfo:_0x2c8e93}=parseTestFile(_0x58a32c);let _0xec1886=_0x41c4f5[_0x466df4(0x117)];if(_0x5e5a95){const _0x18b09d=_0x5e5a95[_0x466df4(0x15d)](',')[_0x466df4(0x145)](_0x4ba6cc=>_0x4ba6cc[_0x466df4(0x189)]());_0xec1886=_0x41c4f5[_0x466df4(0x117)][_0x466df4(0x120)](_0x1250c4=>_0x18b09d[_0x466df4(0x131)](_0x1250c4[_0x466df4(0x162)]));if(_0xec1886[_0x466df4(0x174)]===0x0)return console['log'](a5_0x15ebbe[_0x466df4(0x16c)](_0x466df4(0x11b)+_0x5e5a95)),console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x114)](_0x466df4(0x10f)+_0x41c4f5[_0x466df4(0x117)][_0x466df4(0x145)](_0x39ce7d=>_0x39ce7d[_0x466df4(0x162)])['join'](',\x20'))),0x1;}if(_0x321dae){const _0x1bb4aa=_0x321dae['split'](',')[_0x466df4(0x145)](_0x1d84c3=>_0x1d84c3[_0x466df4(0x189)]()[_0x466df4(0x100)]());_0xec1886=_0xec1886[_0x466df4(0x120)](_0x2901f9=>_0x2901f9[_0x466df4(0x10b)]?.[_0x466df4(0x146)](_0x41f07f=>_0x1bb4aa[_0x466df4(0x131)](_0x41f07f[_0x466df4(0x100)]())));if(_0xec1886['length']===0x0){console[_0x466df4(0x159)](a5_0x15ebbe['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x321dae));const _0x324acc=new Set();return _0x41c4f5[_0x466df4(0x117)]['forEach'](_0x44262c=>_0x44262c['tags']?.[_0x466df4(0x173)](_0x219b16=>_0x324acc[_0x466df4(0x148)](_0x219b16))),_0x324acc[_0x466df4(0x16f)]>0x0?console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x114)](_0x466df4(0x136)+[..._0x324acc][_0x466df4(0x14a)](',\x20'))):console[_0x466df4(0x159)](a5_0x15ebbe['dim'](_0x466df4(0x105))),0x1;}}if(_0x4bb7e6)return this[_0x466df4(0x179)](_0x463c1a,{'definition':{'tests':_0xec1886},'agentInfo':_0x2c8e93,'outputFormat':_0xbdbd55,'outputFile':_0x117605,'testNames':_0x5e5a95});if(_0x55c30a){console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x153)](_0x466df4(0x144))),console[_0x466df4(0x159)]('\x20\x20Site:\x20'+a5_0x15ebbe[_0x466df4(0x138)](_0x154abf)),console[_0x466df4(0x159)](_0x466df4(0x17e)+a5_0x15ebbe[_0x466df4(0x138)](_0x2c8e93['projectName'])),console['log'](_0x466df4(0x165)+a5_0x15ebbe[_0x466df4(0x138)](_0x2c8e93[_0x466df4(0x152)])),console[_0x466df4(0x159)](),console[_0x466df4(0x159)](_0x466df4(0x139)+a5_0x15ebbe['white'](_0xec1886[_0x466df4(0x174)]));for(let _0x3c3955=0x0;_0x3c3955<_0xec1886[_0x466df4(0x174)];_0x3c3955++){const _0x35e578=_0xec1886[_0x3c3955],_0x523ce4=_0x35e578[_0x466df4(0x127)][_0x466df4(0x174)]===0x1?_0x466df4(0x10d):_0x466df4(0x127),_0x81db37=_0x35e578[_0x466df4(0x10b)]?.['length']?'\x20['+_0x35e578[_0x466df4(0x10b)]['join'](',\x20')+']':'';console[_0x466df4(0x159)]('\x20\x20'+(_0x3c3955+0x1)+'.\x20'+a5_0x15ebbe[_0x466df4(0x138)](_0x35e578[_0x466df4(0x162)])+'\x20('+_0x35e578['rounds'][_0x466df4(0x174)]+'\x20'+_0x523ce4+')'+a5_0x15ebbe[_0x466df4(0x114)](_0x81db37));}return 0x0;}let _0x37d2c4,_0x57235d;try{_0x37d2c4=await _0x1d1c48[_0x466df4(0x123)][_0x466df4(0x14f)](_0x2c8e93[_0x466df4(0x178)]);}catch(_0x322e1c){const _0x4eabbe=_0x322e1c instanceof Error?_0x322e1c[_0x466df4(0x116)]:String(_0x322e1c);return _0x4eabbe[_0x466df4(0x131)](_0x466df4(0x10c))||_0x4eabbe[_0x466df4(0x100)]()['includes']('not\x20found')?console['log'](a5_0x15ebbe['red'](_0x466df4(0x128)+_0x2c8e93['projectName'])):console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x181)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x2c8e93[_0x466df4(0x178)]+'\x22:\x20'+_0x4eabbe)),0x1;}try{_0x57235d=await _0x1d1c48[_0x466df4(0x123)][_0x466df4(0x110)](_0x2c8e93[_0x466df4(0x152)],_0x37d2c4);}catch(_0x199503){const _0x55e3ba=_0x199503 instanceof Error?_0x199503['message']:String(_0x199503);return _0x55e3ba[_0x466df4(0x131)](_0x466df4(0x10c))||_0x55e3ba[_0x466df4(0x100)]()[_0x466df4(0x131)](_0x466df4(0x158))?console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x181)](_0x466df4(0x10e)+_0x2c8e93['agentName'])):console[_0x466df4(0x159)](a5_0x15ebbe['red'](_0x466df4(0x155)+_0x2c8e93[_0x466df4(0x152)]+_0x466df4(0x121)+_0x55e3ba)),0x1;}let _0x43e5a4;if(!_0x3c3be3)try{_0x43e5a4=await setupEvaluatorAgent(_0x1d1c48[_0x466df4(0x123)],_0x38cc83[_0x466df4(0x13e)]);}catch(_0x9d2259){const _0x35b886=_0x9d2259 instanceof Error?_0x9d2259[_0x466df4(0x116)]:String(_0x9d2259);return console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x181)](_0x466df4(0x106)+_0x35b886)),0x1;}console['log'](a5_0x15ebbe[_0x466df4(0x153)](_0x466df4(0x141))),console[_0x466df4(0x159)](_0x466df4(0x107)+a5_0x15ebbe['white'](_0x154abf)),console['log']('Agent:\x20'+a5_0x15ebbe[_0x466df4(0x138)](_0x2c8e93[_0x466df4(0x178)]+'/'+_0x2c8e93[_0x466df4(0x152)])),console[_0x466df4(0x159)]();const _0x50857e=[],_0x198890=[],_0x12c410=Date[_0x466df4(0x12d)]();for(let _0x43d21e=0x0;_0x43d21e<_0xec1886[_0x466df4(0x174)];_0x43d21e++){const _0x5cf586=_0xec1886[_0x43d21e];_0xec1886[_0x466df4(0x174)]>0x1?console[_0x466df4(0x159)](_0x466df4(0x185)+(_0x43d21e+0x1)+'/'+_0xec1886[_0x466df4(0x174)]+':\x20'+a5_0x15ebbe['white'](_0x5cf586[_0x466df4(0x162)])):console['log'](_0x466df4(0x11e)+a5_0x15ebbe[_0x466df4(0x138)](_0x5cf586[_0x466df4(0x162)]));const _0x58603d=createCommandSpinner(_0x466df4(0x104)+_0x5cf586[_0x466df4(0x127)][_0x466df4(0x174)]+_0x466df4(0x15f));_0x58603d[_0x466df4(0x147)]();try{const {result:_0x39daeb,conversation:_0x4a43c1}=await runTest(_0x1d1c48[_0x466df4(0x123)],_0x5cf586,{'agentId':_0x57235d,'projectId':_0x37d2c4,'site':_0x154abf,'noEval':_0x3c3be3,'evaluatorId':_0x43e5a4,'onRoundStart':(_0x544682,_0x580e6e)=>{const _0x3fe53a=_0x466df4;_0x58603d[_0x3fe53a(0x119)]=_0x3fe53a(0x125)+(_0x544682+0x1)+'/'+_0x580e6e+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2a25cb,_0x148590,_0x2d53ac)=>{const _0x265293=_0x466df4,_0x212614=formatElapsed(_0x148590);_0x2d53ac?console[_0x265293(0x159)](_0x265293(0x115)+(_0x2a25cb+0x1)+'/'+_0x5cf586[_0x265293(0x127)][_0x265293(0x174)]+_0x265293(0x154)+a5_0x15ebbe['green']('✓')+'\x20('+_0x212614+')'):console[_0x265293(0x159)]('\x20\x20Round\x20'+(_0x2a25cb+0x1)+'/'+_0x5cf586[_0x265293(0x127)][_0x265293(0x174)]+_0x265293(0x154)+a5_0x15ebbe['red']('✗'));},'onEvaluationStart':()=>{const _0x2b72b4=_0x466df4;_0x58603d['text']=_0x2b72b4(0xfb);},'onEvaluationComplete':_0x3c57e4=>{const _0x22fb92=_0x466df4,_0x3c2144=formatElapsed(_0x3c57e4);console[_0x22fb92(0x159)](_0x22fb92(0x13a)+a5_0x15ebbe[_0x22fb92(0xfc)]('✓')+'\x20('+_0x3c2144+')');}});_0x58603d[_0x466df4(0x156)](),_0x50857e['push'](_0x39daeb),_0x198890[_0x466df4(0x11f)](_0x4a43c1);if(_0x39daeb['status']===_0x466df4(0x13d))console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0xfc)](_0x466df4(0x151)+_0x39daeb[_0x466df4(0x142)]));else _0x39daeb[_0x466df4(0x15c)]==='FAIL'?console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x181)](_0x466df4(0x149)+_0x39daeb['reason'])):console['log'](a5_0x15ebbe[_0x466df4(0x181)](_0x466df4(0xff)+_0x39daeb[_0x466df4(0x142)]));_0x39daeb[_0x466df4(0x108)]&&console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x114)]('Conversation\x20URL:\x20'+_0x39daeb[_0x466df4(0x108)])),console[_0x466df4(0x159)]();}catch(_0x4501e0){_0x58603d[_0x466df4(0x156)]();const _0x4ee8dd=_0x4501e0 instanceof Error?_0x4501e0[_0x466df4(0x116)]:String(_0x4501e0);console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x181)](_0x466df4(0xff)+_0x4ee8dd)),console[_0x466df4(0x159)](),_0x50857e[_0x466df4(0x11f)]({'name':_0x5cf586['name'],'status':'ERROR','reason':_0x4ee8dd,'timestamp':new Date()[_0x466df4(0x157)](),'duration_ms':0x0});}}const _0x217b08=Date[_0x466df4(0x12d)]()-_0x12c410,_0x58d109=_0x50857e[_0x466df4(0x120)](_0x3a1f4c=>_0x3a1f4c['status']===_0x466df4(0x13d))[_0x466df4(0x174)],_0x4d67fc=_0x50857e[_0x466df4(0x120)](_0x216ab3=>_0x216ab3[_0x466df4(0x15c)]===_0x466df4(0x163))[_0x466df4(0x174)],_0x5bc1f1=_0x50857e[_0x466df4(0x120)](_0x4ec230=>_0x4ec230[_0x466df4(0x15c)]===_0x466df4(0x113))['length'];console[_0x466df4(0x159)]('━'[_0x466df4(0x168)](0x3c)),console[_0x466df4(0x159)](_0x466df4(0x101)),console[_0x466df4(0x159)]('━'[_0x466df4(0x168)](0x3c)),console[_0x466df4(0x159)](_0x466df4(0x10a)+_0x50857e[_0x466df4(0x174)]),console['log'](_0x466df4(0x18c)+a5_0x15ebbe['green'](_0x58d109)),console[_0x466df4(0x159)](_0x466df4(0x17d)+a5_0x15ebbe['red'](_0x4d67fc));_0x5bc1f1>0x0&&console['log'](_0x466df4(0x172)+a5_0x15ebbe[_0x466df4(0x181)](_0x5bc1f1));console[_0x466df4(0x159)](_0x466df4(0x18d)+formatElapsed(_0x217b08)),console[_0x466df4(0x159)]('━'[_0x466df4(0x168)](0x3c));const _0x3d2872=_0x50857e[_0x466df4(0x120)](_0xa5c25a=>_0xa5c25a[_0x466df4(0x15c)]!=='PASS');if(_0x3d2872[_0x466df4(0x174)]>0x0){console['log'](),console[_0x466df4(0x159)](_0x466df4(0x160));for(const _0x3bf428 of _0x3d2872){const _0x564776=a5_0x15ebbe['red']('✗'),_0xecb413=_0x3bf428[_0x466df4(0x142)][_0x466df4(0x174)]>0x32?_0x3bf428[_0x466df4(0x142)][_0x466df4(0x112)](0x0,0x32)+'...':_0x3bf428['reason'];console[_0x466df4(0x159)]('\x20\x20'+_0x564776+'\x20'+_0x3bf428[_0x466df4(0x162)]+':\x20'+_0xecb413);}}const _0x1f4f69={'summary':{'total':_0x50857e[_0x466df4(0x174)],'passed':_0x58d109,'failed':_0x4d67fc,'errors':_0x5bc1f1>0x0?_0x5bc1f1:undefined,'duration_ms':_0x217b08},'tests':_0x50857e,'agent':{'project':_0x2c8e93[_0x466df4(0x178)],'name':_0x2c8e93[_0x466df4(0x152)],'site':_0x154abf},'timestamp':new Date(_0x12c410)['toISOString']()};try{const _0x5d200f=buildCachedTestRun(_0x198890,{'site':_0x154abf,'projectId':_0x37d2c4,'projectName':_0x2c8e93[_0x466df4(0x178)],'agentId':_0x57235d,'agentName':_0x2c8e93[_0x466df4(0x152)],'testYmlPath':a5_0x29ab65[_0x466df4(0x150)](_0x2c8e93[_0x466df4(0x143)])});saveLastTestRun(_0x5d200f);}catch{}if(_0xbdbd55!==_0x466df4(0x11c)||_0x117605){const _0x587de4=formatResults(_0x1f4f69,_0xbdbd55);if(_0x117605)try{a5_0x607e01[_0x466df4(0x184)](_0x117605,_0x587de4,'utf-8'),console[_0x466df4(0x159)](),console[_0x466df4(0x159)](a5_0x15ebbe['dim'](_0x466df4(0x17c)+_0x117605));}catch(_0x36cda8){return console[_0x466df4(0x159)](),console[_0x466df4(0x159)](a5_0x15ebbe[_0x466df4(0x181)](_0x466df4(0x12c)+_0x36cda8)),0x1;}else console['log'](),console[_0x466df4(0x159)](_0x587de4);}return _0x3d2872[_0x466df4(0x174)]>0x0?0x1:0x0;}async['executeReeval'](_0x52948a,_0x2275fc){const _0x3bd413=a5_0x350009,{options:_0x2a4fa0,tdx:_0x58c6da}=_0x52948a,{definition:_0x2c94a3,agentInfo:_0x51e46c,outputFormat:_0x2616dd,outputFile:_0xca79df}=_0x2275fc,_0x18d75d=_0x2a4fa0['site'],_0x449143=loadLastTestRun();if(!_0x449143)return console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x181)](_0x3bd413(0x169))),console[_0x3bd413(0x159)](a5_0x15ebbe['dim'](_0x3bd413(0x12f))),0x1;if(_0x449143[_0x3bd413(0x12b)][_0x3bd413(0x152)]!==_0x51e46c[_0x3bd413(0x152)])return console['log'](a5_0x15ebbe[_0x3bd413(0x181)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x449143[_0x3bd413(0x12b)][_0x3bd413(0x152)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x51e46c[_0x3bd413(0x152)]+'\x22.')),console[_0x3bd413(0x159)](a5_0x15ebbe['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x223ff0=new Set(_0x449143[_0x3bd413(0x188)]['map'](_0x113796=>_0x113796['testName'])),_0x4bd9cf=_0x2c94a3[_0x3bd413(0x117)][_0x3bd413(0x120)](_0x10154d=>!_0x223ff0[_0x3bd413(0x13c)](_0x10154d[_0x3bd413(0x162)]));if(_0x4bd9cf[_0x3bd413(0x174)]>0x0&&_0x449143[_0x3bd413(0x14c)]!==_0x18d75d)return console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x181)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x114)](_0x3bd413(0x134)+_0x449143[_0x3bd413(0x14c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x18d75d+'\x22.')),console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x114)](_0x3bd413(0xfe)+_0x449143[_0x3bd413(0x14c)]+_0x3bd413(0x15a))),0x1;const _0x559199=_0x2c94a3[_0x3bd413(0x117)][_0x3bd413(0x120)](_0x515f6f=>_0x223ff0[_0x3bd413(0x13c)](_0x515f6f['name'])),_0x52e3c6=_0x4bd9cf;let _0x14f788;try{_0x14f788=await setupEvaluatorAgent(_0x58c6da[_0x3bd413(0x123)],_0x2a4fa0['verbose']);}catch(_0x21bc51){const _0x163ce4=_0x21bc51 instanceof Error?_0x21bc51[_0x3bd413(0x116)]:String(_0x21bc51);return console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x181)](_0x3bd413(0x106)+_0x163ce4)),0x1;}console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x153)](_0x3bd413(0x17a))),console[_0x3bd413(0x159)](_0x3bd413(0x12a)+a5_0x15ebbe[_0x3bd413(0x138)](_0x449143['timestamp'])),console[_0x3bd413(0x159)]('Agent:\x20'+a5_0x15ebbe[_0x3bd413(0x138)](_0x449143[_0x3bd413(0x12b)]['projectName']+'/'+_0x449143['agent'][_0x3bd413(0x152)]));_0x52e3c6[_0x3bd413(0x174)]>0x0&&console['log'](_0x3bd413(0x177)+a5_0x15ebbe['yellow'](_0x52e3c6[_0x3bd413(0x174)]));console['log']();const _0x25af39=[],_0xf14e3c=Date[_0x3bd413(0x12d)](),_0x1f387d=createCommandSpinner(_0x3bd413(0x12e));if(_0x559199[_0x3bd413(0x174)]>0x0)try{const _0x515e28=await reevaluateFromCache(_0x58c6da[_0x3bd413(0x123)],_0x449143,{'tests':_0x559199},{'evaluatorId':_0x14f788,'onTestStart':(_0x9d3422,_0x446ce7,_0x4e24ad)=>{const _0x3a218e=_0x3bd413;_0x1f387d[_0x3a218e(0x119)]='Re-evaluating\x20'+(_0x446ce7+0x1)+'/'+_0x4e24ad+':\x20'+_0x9d3422+_0x3a218e(0x183);if(!_0x1f387d['isSpinning'])_0x1f387d['start']();},'onTestComplete':(_0x1a772f,_0x3b3584)=>{const _0x5d1bc2=_0x3bd413;_0x1f387d[_0x5d1bc2(0x156)]();if(_0x3b3584[_0x5d1bc2(0x15c)]===_0x5d1bc2(0x13d))console[_0x5d1bc2(0x159)](a5_0x15ebbe[_0x5d1bc2(0xfc)]('✓\x20PASS:\x20'+_0x1a772f)+a5_0x15ebbe[_0x5d1bc2(0x114)](_0x5d1bc2(0x16b)));else _0x3b3584[_0x5d1bc2(0x15c)]===_0x5d1bc2(0x163)?console[_0x5d1bc2(0x159)](a5_0x15ebbe[_0x5d1bc2(0x181)]('✗\x20FAIL:\x20'+_0x1a772f+_0x5d1bc2(0x186)+_0x3b3584[_0x5d1bc2(0x142)])+a5_0x15ebbe['dim'](_0x5d1bc2(0x16b))):console['log'](a5_0x15ebbe['red'](_0x5d1bc2(0xff)+_0x1a772f+'\x20-\x20'+_0x3b3584[_0x5d1bc2(0x142)]));_0x3b3584['conversation_url']&&console[_0x5d1bc2(0x159)](a5_0x15ebbe[_0x5d1bc2(0x114)](_0x5d1bc2(0x16d)+_0x3b3584[_0x5d1bc2(0x108)])),_0x25af39[_0x5d1bc2(0x11f)](_0x3b3584);},'onTestSkipped':(_0x35aa8d,_0x35ba58)=>{const _0x3ccdc2=_0x3bd413;_0x1f387d[_0x3ccdc2(0x156)](),console[_0x3ccdc2(0x159)](a5_0x15ebbe[_0x3ccdc2(0x16c)](_0x3ccdc2(0x111)+_0x35aa8d+_0x3ccdc2(0x186)+_0x35ba58));}});for(const _0xc9650e of _0x515e28){!_0x25af39[_0x3bd413(0x17f)](_0x428bfb=>_0x428bfb[_0x3bd413(0x162)]===_0xc9650e[_0x3bd413(0x162)])&&_0x25af39[_0x3bd413(0x11f)](_0xc9650e);}}catch(_0x287b2e){_0x1f387d[_0x3bd413(0x156)]();const _0x495966=_0x287b2e instanceof Error?_0x287b2e['message']:String(_0x287b2e);return console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x181)](_0x3bd413(0x18b)+_0x495966)),0x1;}_0x1f387d[_0x3bd413(0x156)]();if(_0x52e3c6[_0x3bd413(0x174)]>0x0){console['log'](),console[_0x3bd413(0x159)](a5_0x15ebbe['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x52e219,agentId:_0x1c506f}=_0x449143[_0x3bd413(0x12b)];for(const _0x956bfb of _0x52e3c6){console[_0x3bd413(0x159)]('Running:\x20'+a5_0x15ebbe[_0x3bd413(0x138)](_0x956bfb['name']));const _0x37adb2=createCommandSpinner(_0x3bd413(0x104)+_0x956bfb[_0x3bd413(0x127)][_0x3bd413(0x174)]+_0x3bd413(0x15f));_0x37adb2[_0x3bd413(0x147)]();try{const {result:_0x3bc838}=await runTest(_0x58c6da['llm'],_0x956bfb,{'agentId':_0x1c506f,'projectId':_0x52e219,'site':_0x449143[_0x3bd413(0x14c)],'noEval':![],'evaluatorId':_0x14f788,'onRoundStart':(_0x1d34ad,_0x37bd5c)=>{const _0x17c5de=_0x3bd413;_0x37adb2[_0x17c5de(0x119)]='Round\x20'+(_0x1d34ad+0x1)+'/'+_0x37bd5c+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2dc491,_0x350d41,_0x83533c)=>{const _0x39aac8=_0x3bd413,_0x2c9375=formatElapsed(_0x350d41);_0x83533c?console[_0x39aac8(0x159)](_0x39aac8(0x115)+(_0x2dc491+0x1)+'/'+_0x956bfb['rounds'][_0x39aac8(0x174)]+'...\x20'+a5_0x15ebbe[_0x39aac8(0xfc)]('✓')+'\x20('+_0x2c9375+')'):console[_0x39aac8(0x159)](_0x39aac8(0x115)+(_0x2dc491+0x1)+'/'+_0x956bfb['rounds'][_0x39aac8(0x174)]+'...\x20'+a5_0x15ebbe['red']('✗'));},'onEvaluationStart':()=>{const _0x498f57=_0x3bd413;_0x37adb2['text']=_0x498f57(0xfb);},'onEvaluationComplete':_0x5c5ea6=>{const _0x8f9be8=_0x3bd413,_0x288854=formatElapsed(_0x5c5ea6);console[_0x8f9be8(0x159)](_0x8f9be8(0x13a)+a5_0x15ebbe[_0x8f9be8(0xfc)]('✓')+'\x20('+_0x288854+')');}});_0x37adb2[_0x3bd413(0x156)](),_0x25af39[_0x3bd413(0x11f)](_0x3bc838);if(_0x3bc838[_0x3bd413(0x15c)]===_0x3bd413(0x13d))console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0xfc)](_0x3bd413(0x151)+_0x3bc838[_0x3bd413(0x142)])+a5_0x15ebbe[_0x3bd413(0x114)](_0x3bd413(0x118)));else _0x3bc838[_0x3bd413(0x15c)]===_0x3bd413(0x163)?console[_0x3bd413(0x159)](a5_0x15ebbe['red'](_0x3bd413(0x149)+_0x3bc838[_0x3bd413(0x142)])+a5_0x15ebbe[_0x3bd413(0x114)](_0x3bd413(0x118))):console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x181)]('✗\x20ERROR:\x20'+_0x3bc838[_0x3bd413(0x142)]));_0x3bc838['conversation_url']&&console['log'](a5_0x15ebbe[_0x3bd413(0x114)]('\x20\x20Conversation:\x20'+_0x3bc838['conversation_url']));}catch(_0x5f313f){_0x37adb2[_0x3bd413(0x156)]();const _0x5862d0=_0x5f313f instanceof Error?_0x5f313f['message']:String(_0x5f313f);console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x181)]('✗\x20ERROR:\x20'+_0x5862d0)),_0x25af39[_0x3bd413(0x11f)]({'name':_0x956bfb[_0x3bd413(0x162)],'status':_0x3bd413(0x113),'reason':_0x5862d0,'timestamp':new Date()[_0x3bd413(0x157)](),'duration_ms':0x0});}}}console[_0x3bd413(0x159)]();const _0x192ec7=Date[_0x3bd413(0x12d)]()-_0xf14e3c,_0x433761=_0x25af39[_0x3bd413(0x120)](_0x1524fd=>_0x1524fd[_0x3bd413(0x15c)]==='PASS')[_0x3bd413(0x174)],_0x34d9eb=_0x25af39[_0x3bd413(0x120)](_0x448028=>_0x448028[_0x3bd413(0x15c)]==='FAIL')[_0x3bd413(0x174)],_0x592de3=_0x25af39['filter'](_0x5bef5f=>_0x5bef5f[_0x3bd413(0x15c)]===_0x3bd413(0x113))[_0x3bd413(0x174)];console[_0x3bd413(0x159)]('━'[_0x3bd413(0x168)](0x3c)),console[_0x3bd413(0x159)](_0x3bd413(0x129)),console[_0x3bd413(0x159)]('━'[_0x3bd413(0x168)](0x3c)),console[_0x3bd413(0x159)](_0x3bd413(0x10a)+_0x25af39['length']),console[_0x3bd413(0x159)]('Passed:\x20\x20\x20'+a5_0x15ebbe['green'](_0x433761)),console[_0x3bd413(0x159)](_0x3bd413(0x17d)+a5_0x15ebbe[_0x3bd413(0x181)](_0x34d9eb));_0x592de3>0x0&&console['log'](_0x3bd413(0x172)+a5_0x15ebbe[_0x3bd413(0x181)](_0x592de3));console[_0x3bd413(0x159)](_0x3bd413(0x18d)+formatElapsed(_0x192ec7)),console[_0x3bd413(0x159)]('━'['repeat'](0x3c));const _0x4121f2={'summary':{'total':_0x25af39[_0x3bd413(0x174)],'passed':_0x433761,'failed':_0x34d9eb,'errors':_0x592de3>0x0?_0x592de3:undefined,'duration_ms':_0x192ec7},'tests':_0x25af39,'agent':{'project':_0x51e46c[_0x3bd413(0x178)],'name':_0x51e46c[_0x3bd413(0x152)],'site':_0x18d75d},'timestamp':new Date(_0xf14e3c)[_0x3bd413(0x157)]()};if(_0x2616dd!==_0x3bd413(0x11c)||_0xca79df){const _0x3a00b7=formatResults(_0x4121f2,_0x2616dd);if(_0xca79df)try{a5_0x607e01[_0x3bd413(0x184)](_0xca79df,_0x3a00b7,'utf-8'),console[_0x3bd413(0x159)](),console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x114)](_0x3bd413(0x17c)+_0xca79df));}catch(_0x57279e){return console[_0x3bd413(0x159)](),console[_0x3bd413(0x159)](a5_0x15ebbe[_0x3bd413(0x181)](_0x3bd413(0x12c)+_0x57279e)),0x1;}else console[_0x3bd413(0x159)](),console[_0x3bd413(0x159)](_0x3a00b7);}const _0x491f9e=_0x25af39[_0x3bd413(0x120)](_0x59456e=>_0x59456e[_0x3bd413(0x15c)]!==_0x3bd413(0x13d));return _0x491f9e['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x360058=a6_0x4cd8;(function(_0x40d77d,_0x429a58){const _0x455d9c=a6_0x4cd8,_0xb70a9=_0x40d77d();while(!![]){try{const _0x2b4af6=parseInt(_0x455d9c(0xc8))/0x1*(parseInt(_0x455d9c(0xc5))/0x2)+-parseInt(_0x455d9c(0xbe))/0x3+parseInt(_0x455d9c(0xce))/0x4+-parseInt(_0x455d9c(0xbf))/0x5*(-parseInt(_0x455d9c(0xd9))/0x6)+parseInt(_0x455d9c(0xbc))/0x7+-parseInt(_0x455d9c(0xc4))/0x8*(parseInt(_0x455d9c(0xd0))/0x9)+parseInt(_0x455d9c(0xda))/0xa;if(_0x2b4af6===_0x429a58)break;else _0xb70a9['push'](_0xb70a9['shift']());}catch(_0xc191b6){_0xb70a9['push'](_0xb70a9['shift']());}}}(a6_0xed10,0xda4cd));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x4cd8(_0x57cdcc,_0x2e9c83){_0x57cdcc=_0x57cdcc-0xaf;const _0xed10f4=a6_0xed10();let _0x4cd880=_0xed10f4[_0x57cdcc];return _0x4cd880;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0xed10(){const _0x3a19f2=['.\x20Valid\x20types:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','output','authorization','includes','execute','llm-proxy','noColor','set-cookie2','log','validate','x-auth-token','set-cookie','message','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','length','Error:\x20','method','readBodyFromFile','request','POST','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','PATCH','file','\x22.\x20','verbose','GET','proxy-authorization','name','Invalid\x20API\x20type:\x20','.\x20Valid\x20methods:\x20','6316065qobfgl','headers','3942207cCDpEH','175415ZYKZYJ','indexOf','workflow','stack','toUpperCase','16712PrkAFL','224018YEdEdI','header','toLowerCase','4arqAQe','trim','error','cdp','PUT','api','1156496qIeZaJ','\x0aStack\x20trace:\x0a','4509ITQlSQ','DELETE','type','startsWith','color','entries','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','substring','join','186ibOXHl','5277870EXdNjW','body'];a6_0xed10=function(){return _0x3a19f2;};return a6_0xed10();}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x360058(0xdf),a6_0x360058(0xb8),'cookie',a6_0x360058(0xe8),a6_0x360058(0xe4),'x-xsrf-token',a6_0x360058(0xe7),'x-trino-user']);function isSensitiveHeader(_0x8d218c){const _0x57591d=a6_0x360058;return SENSITIVE_HEADERS['has'](_0x8d218c[_0x57591d(0xc7)]());}function parseHeader(_0x252680){const _0x5f4ba3=a6_0x360058,_0x5cc622=_0x252680[_0x5f4ba3(0xc0)](':');if(_0x5cc622===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x252680+_0x5f4ba3(0xb5)+_0x5f4ba3(0xd6));const _0x2fcbf7=_0x252680['substring'](0x0,_0x5cc622)[_0x5f4ba3(0xc9)](),_0x5075e4=_0x252680[_0x5f4ba3(0xd7)](_0x5cc622+0x1)[_0x5f4ba3(0xc9)]();if(!_0x2fcbf7)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x252680+'\x22');return[_0x2fcbf7,_0x5075e4];}export class ApiCommand extends BaseCommand{[a6_0x360058(0xb9)]=a6_0x360058(0xcd);['description']=a6_0x360058(0xb2);[a6_0x360058(0xe6)](_0x3c395d){const _0x360f88=a6_0x360058,{args:_0xbad5b8,options:_0x44fe99}=_0x3c395d,_0x1020fd=_0x44fe99;if(_0xbad5b8[_0x360f88(0xeb)]===0x0)return _0x360f88(0xea);const _0x3ac73f=_0xbad5b8[0x0];if(!_0x3ac73f[_0x360f88(0xd3)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x3ac73f;const _0x48bed6=_0x1020fd['data'],_0x3c281a=_0x1020fd[_0x360f88(0xb4)];if(_0x48bed6&&_0x3c281a)return _0x360f88(0xdd);const _0x324326=_0x1020fd[_0x360f88(0xed)]||_0x360f88(0xb7),_0x15c5e5=['GET',_0x360f88(0xb1),_0x360f88(0xcc),_0x360f88(0xd1),_0x360f88(0xb3)];if(!_0x15c5e5[_0x360f88(0xe0)](_0x324326['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x324326+_0x360f88(0xbb)+_0x15c5e5[_0x360f88(0xd8)](',\x20');const _0x44397f=_0x1020fd['type']||'td',_0x152a0a=['td',_0x360f88(0xcb),_0x360f88(0xc1),'trino','llm',_0x360f88(0xe2)];if(!_0x152a0a[_0x360f88(0xe0)](_0x44397f))return _0x360f88(0xba)+_0x44397f+_0x360f88(0xdc)+_0x152a0a[_0x360f88(0xd8)](',\x20');return undefined;}async[a6_0x360058(0xe1)](_0x1dc40c){const _0x1bd568=a6_0x360058,{options:_0x24229c,args:_0x543060,tdx:_0x59d1c2}=_0x1dc40c,_0x2a0a3a=_0x24229c,_0x3f62f0=_0x543060[0x0],_0xd8149b=(_0x2a0a3a[_0x1bd568(0xed)]||'GET')[_0x1bd568(0xc3)](),_0x48a921=_0x2a0a3a['data'],_0x167bdd=_0x2a0a3a[_0x1bd568(0xb4)],_0x26e1d9=_0x2a0a3a[_0x1bd568(0xc6)],_0x146709=_0x2a0a3a[_0x1bd568(0xd2)]||'td';try{const _0x1368f9={};if(_0x26e1d9){const _0x263c48=Array['isArray'](_0x26e1d9)?_0x26e1d9:[_0x26e1d9];for(const _0x15412d of _0x263c48){const [_0x9186fb,_0xb03286]=parseHeader(_0x15412d);_0x1368f9[_0x9186fb]=_0xb03286;}}let _0x35517f;if(_0x48a921)_0x35517f=_0x48a921;else{if(_0x167bdd)try{_0x35517f=RawAPI[_0x1bd568(0xaf)](_0x167bdd);}catch(_0x58f9da){return console['error'](_0x1bd568(0xec)+(_0x58f9da instanceof Error?_0x58f9da[_0x1bd568(0xe9)]:String(_0x58f9da))),0x1;}}const _0x93e27={'method':_0xd8149b,'apiType':_0x146709,'includeHeaders':_0x24229c[_0x1bd568(0xb6)]};_0x35517f&&(_0x93e27[_0x1bd568(0xdb)]=_0x35517f);Object['keys'](_0x1368f9)[_0x1bd568(0xeb)]>0x0&&(_0x93e27[_0x1bd568(0xbd)]=_0x1368f9);if(_0x24229c[_0x1bd568(0xb6)]){const _0x52f78d=resolveSite(_0x24229c['site']),_0x2a35fc=getEndpoint(_0x52f78d,_0x146709),_0x4161d7=''+_0x2a35fc+_0x3f62f0;console[_0x1bd568(0xca)]('>\x20'+_0xd8149b+'\x20'+_0x4161d7);const _0x2d94d5=getAuthHeaders(_0x52f78d),_0x33b459={..._0x2d94d5,..._0x1368f9};for(const [_0x54ee12,_0x380f1e]of Object['entries'](_0x33b459)){!isSensitiveHeader(_0x54ee12)&&console[_0x1bd568(0xca)]('>\x20'+_0x54ee12+':\x20'+_0x380f1e);}_0x35517f&&console[_0x1bd568(0xca)]('>'),console['error']('');}const _0x3f07d8=await _0x59d1c2[_0x1bd568(0xcd)][_0x1bd568(0xb0)](_0x3f62f0,_0x93e27);if(_0x24229c[_0x1bd568(0xb6)]&&_0x3f07d8['headers']){console[_0x1bd568(0xca)]('<\x20HTTP/1.1\x20'+_0x3f07d8['status']);for(const [_0x4379b1,_0x3e1610]of Object[_0x1bd568(0xd5)](_0x3f07d8[_0x1bd568(0xbd)])){!isSensitiveHeader(_0x4379b1)&&console[_0x1bd568(0xca)]('<\x20'+_0x4379b1+':\x20'+_0x3e1610);}console[_0x1bd568(0xca)]('');}const _0x2572e5=Boolean(_0x24229c[_0x1bd568(0xde)]),_0x5d23d9={'color':_0x24229c[_0x1bd568(0xd4)],'noColor':_0x24229c[_0x1bd568(0xe3)]||_0x2572e5&&!_0x24229c['color']},_0x29c8b8=colorizeJSON(_0x3f07d8['data'],_0x5d23d9);return _0x24229c[_0x1bd568(0xde)]?(writeFileSync(_0x24229c[_0x1bd568(0xde)],_0x29c8b8),console['error']('Results\x20saved\x20to\x20'+_0x24229c['output'])):console[_0x1bd568(0xe5)](_0x29c8b8),0x0;}catch(_0x5b938c){return _0x5b938c instanceof Error?(console[_0x1bd568(0xca)](_0x1bd568(0xec)+_0x5b938c[_0x1bd568(0xe9)]),_0x24229c[_0x1bd568(0xb6)]&&_0x5b938c['stack']&&console[_0x1bd568(0xca)](_0x1bd568(0xcf)+_0x5b938c[_0x1bd568(0xc2)])):console['error']('Error:\x20'+String(_0x5b938c)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x6a081d=a7_0x23e9;(function(_0x5f1ced,_0x273aed){const _0x405231=a7_0x23e9,_0x49b80b=_0x5f1ced();while(!![]){try{const _0x3a5cc4=-parseInt(_0x405231(0x194))/0x1+-parseInt(_0x405231(0x1a3))/0x2*(parseInt(_0x405231(0x1a8))/0x3)+-parseInt(_0x405231(0x18a))/0x4*(-parseInt(_0x405231(0x1b2))/0x5)+parseInt(_0x405231(0x1b6))/0x6+parseInt(_0x405231(0x1ac))/0x7+-parseInt(_0x405231(0x197))/0x8*(parseInt(_0x405231(0x1b0))/0x9)+-parseInt(_0x405231(0x1a0))/0xa*(-parseInt(_0x405231(0x183))/0xb);if(_0x3a5cc4===_0x273aed)break;else _0x49b80b['push'](_0x49b80b['shift']());}catch(_0x2853c6){_0x49b80b['push'](_0x49b80b['shift']());}}}(a7_0x3dda,0xa9577));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';function a7_0x3dda(){const _0x3de087=['logLevel','name','Enter\x20site\x20name:','message','create','N/A','\x20(profile:\x20','\x20--profile\x20','bold','log','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','customSite','392062KUphRb','No\x20credential\x20found','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','email','execute','text','profile','191108pTxNpp','first_name','us01','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Site\x20name\x20cannot\x20be\x20empty','System\x20keychain\x20is\x20not\x20available','auth:clear','Name:\x20','test','getUserInfo','1110613VVGMpy','✓\x20Authentication\x20successful\x0a','trim','2084664blxwJj','auth','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','green','\x20\x20tdx','✓\x20Default\x20site\x20set\x20to\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','610AvWbuf','Validating\x20API\x20key...','other','4rAybJh','yellow','\x20(site:\x20','status','apiKey','682824aXcqUN','tdx:\x20auth\x20clear','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','1933274lhVNZm','\x27\x20registered','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','ERROR','18ZgtCoz','warn','15xFwJAs','password','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','last_name','1121658AmUwpX','API\x20key\x20cannot\x20be\x20empty','\x20for\x20profile:\x20','error','\x0aSetup\x20cancelled','red','✓\x20Profile\x20\x27','User:\x20'];a7_0x3dda=function(){return _0x3de087;};return a7_0x3dda();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x1270e3 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_0x7e997a from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x6a081d(0x178)]='auth:setup';['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x6a081d(0x187)](_0x489e19){const _0x2ab498=a7_0x6a081d,{options:_0x1da65c}=_0x489e19,_0x42c3f5=_0x1da65c[_0x2ab498(0x189)];console[_0x2ab498(0x180)](a7_0x7e997a[_0x2ab498(0x17f)]('tdx:\x20auth\x20setup'));const _0x5e5106=_0x1da65c[_0x2ab498(0x1aa)]||_0x2ab498(0x18c),{choices:_0x1e1135,initialIndex:_0x5ce0b1}=buildSiteChoices(_0x5e5106),_0x174792=_0x42c3f5?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x42c3f5+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x14704=await a7_0x1270e3({'type':'select','name':_0x2ab498(0x1aa),'message':_0x174792,'choices':_0x1e1135,'initial':_0x5ce0b1});if(!_0x14704['site'])return console[_0x2ab498(0x180)]('\x0aSetup\x20cancelled'),0x1;let _0xab6ded;if(_0x14704[_0x2ab498(0x1aa)]===_0x2ab498(0x1a2)){const _0x19742d=await a7_0x1270e3({'type':_0x2ab498(0x188),'name':_0x2ab498(0x182),'message':_0x2ab498(0x179),'initial':_0x2ab498(0x18c),'validate':_0x14dd49=>{const _0x1e906b=_0x2ab498;if(!_0x14dd49||!_0x14dd49[_0x1e906b(0x196)]())return _0x1e906b(0x18e);if(!/^[a-z0-9-]+$/[_0x1e906b(0x192)](_0x14dd49[_0x1e906b(0x196)]()))return _0x1e906b(0x1ae);return!![];}});if(!_0x19742d[_0x2ab498(0x182)])return console['log'](_0x2ab498(0x1ba)),0x1;_0xab6ded=_0x19742d[_0x2ab498(0x182)];}else _0xab6ded=_0x14704[_0x2ab498(0x1aa)];const _0x227895=resolveSite(_0xab6ded);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x227895),console[_0x2ab498(0x180)](_0x2ab498(0x19d)),console['log']('\x20\x20'+getConsoleUrl(_0x227895,'/app/mp/ak'));const _0x4e1aff=await a7_0x1270e3({'type':_0x2ab498(0x1b3),'name':_0x2ab498(0x1a7),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x1f4fb8=>{const _0x459cd6=_0x2ab498;if(!_0x1f4fb8||!_0x1f4fb8[_0x459cd6(0x196)]())return _0x459cd6(0x1b7);return!![];}});if(!_0x4e1aff['apiKey'])return console[_0x2ab498(0x180)](_0x2ab498(0x1ba)),0x1;const _0xd20691=_0x4e1aff[_0x2ab498(0x1a7)];console[_0x2ab498(0x180)](_0x2ab498(0x1a1));try{const _0x173605=TDX[_0x2ab498(0x17b)]({'site':_0x227895,'apiKey':_0xd20691[_0x2ab498(0x196)](),'logLevel':_0x1da65c[_0x2ab498(0x1be)]??LogLevel[_0x2ab498(0x1af)]}),_0xb53070=await _0x173605['jobs'][_0x2ab498(0x193)]();console[_0x2ab498(0x180)](_0x2ab498(0x19e)+_0xb53070[_0x2ab498(0x186)]+')');const _0x1a96e3=await isKeychainAvailable();_0x1a96e3?(await saveAPIKeyAsync(_0xd20691[_0x2ab498(0x196)](),_0x227895,_0x42c3f5),console[_0x2ab498(0x180)](_0x2ab498(0x18d)+(_0x42c3f5?_0x2ab498(0x17d)+_0x42c3f5+')':''))):(console[_0x2ab498(0x1b1)](a7_0x7e997a[_0x2ab498(0x1a4)](_0x2ab498(0x185))),console[_0x2ab498(0x1b1)](a7_0x7e997a['yellow'](_0x2ab498(0x1b4))));if(_0x42c3f5){const _0x1b9328={'site':_0x227895};saveProfileToUserConfig(_0x42c3f5,_0x1b9328),console['log'](_0x2ab498(0x1bc)+_0x42c3f5+_0x2ab498(0x1ad));}else saveDefaultSiteToUserConfig(_0x227895),console[_0x2ab498(0x180)](_0x2ab498(0x19c)+_0x227895);const _0x323779=_0x42c3f5?_0x2ab498(0x17e)+_0x42c3f5:'';return console[_0x2ab498(0x180)](),console[_0x2ab498(0x180)](_0x2ab498(0x1ab)),console[_0x2ab498(0x180)](_0x2ab498(0x19b)+_0x323779+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x2ab498(0x180)]('\x20\x20tdx'+_0x323779+_0x2ab498(0x181)),0x0;}catch(_0x245a30){if(_0x245a30 instanceof HTTPClientError&&_0x245a30[_0x2ab498(0x1a6)]===0x191)return printAuthError(_0x245a30),0x1;return console[_0x2ab498(0x1b9)](a7_0x7e997a[_0x2ab498(0x1bb)]('✗\x20Validation\x20failed:\x20'+(_0x245a30 instanceof Error?_0x245a30['message']:String(_0x245a30)))),console[_0x2ab498(0x1b9)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x6a081d(0x178)]=a7_0x6a081d(0x198);['description']=a7_0x6a081d(0x199);async[a7_0x6a081d(0x187)](_0x363c65){const _0x4620c3=a7_0x6a081d,{options:_0x467891,tdx:_0x3e2c83}=_0x363c65,_0x26f623=_0x467891[_0x4620c3(0x1aa)],_0x57b370=_0x467891[_0x4620c3(0x189)],_0x187d15=_0x57b370?_0x57b370:_0x4620c3(0x17c);console[_0x4620c3(0x180)]('tdx\x20profile:\x20'+_0x187d15+_0x4620c3(0x1a5)+_0x26f623+')');const _0x35fa13=await resolveAPIKeyAsync(_0x26f623,_0x57b370);if(_0x35fa13){const {source:_0x5415f1,isDeprecated:_0x5ba1b2}=_0x35fa13,_0x97f55d='Read\x20credential\x20from\x20'+_0x5415f1;console[_0x4620c3(0x180)](_0x5ba1b2?a7_0x7e997a['yellow'](_0x97f55d):_0x97f55d);}else console['log'](a7_0x7e997a[_0x4620c3(0x1a4)](_0x4620c3(0x184)));try{const _0x2e7aaa=await _0x3e2c83['jobs'][_0x4620c3(0x193)]();return console['log'](a7_0x7e997a[_0x4620c3(0x19a)](_0x4620c3(0x195))),console['log'](_0x4620c3(0x1bd)+_0x2e7aaa['email']),(_0x2e7aaa['first_name']||_0x2e7aaa['last_name'])&&console[_0x4620c3(0x180)](_0x4620c3(0x191)+[_0x2e7aaa[_0x4620c3(0x18b)],_0x2e7aaa[_0x4620c3(0x1b5)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0x45e3c5){return _0x45e3c5 instanceof HTTPClientError&&_0x45e3c5[_0x4620c3(0x1a6)]===0x191?printAuthError(_0x45e3c5,!![],_0x57b370):console['error'](a7_0x7e997a[_0x4620c3(0x1bb)](_0x4620c3(0x19f)+(_0x45e3c5 instanceof Error?_0x45e3c5[_0x4620c3(0x17a)]:String(_0x45e3c5)))),0x1;}}}function a7_0x23e9(_0x23e2be,_0xbbe8ee){_0x23e2be=_0x23e2be-0x178;const _0x3dda4d=a7_0x3dda();let _0x23e9e3=_0x3dda4d[_0x23e2be];return _0x23e9e3;}export class AuthClearCommand extends BaseCommand{[a7_0x6a081d(0x178)]=a7_0x6a081d(0x190);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x6a081d(0x187)](_0x3e9709){const _0x2f69a7=a7_0x6a081d,{options:_0x5af731}=_0x3e9709,_0x1985a9=_0x5af731['profile'];console[_0x2f69a7(0x180)](a7_0x7e997a[_0x2f69a7(0x17f)](_0x2f69a7(0x1a9)));const _0x2bb427=await isKeychainAvailable();if(!_0x2bb427)return console[_0x2f69a7(0x1b9)](a7_0x7e997a[_0x2f69a7(0x1bb)](_0x2f69a7(0x18f))),0x1;const _0xa3f401=await deleteKeychainAPIKey(_0x1985a9);return _0xa3f401?(clearCredentialCache(),console['log']('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x1985a9?'\x20(profile:\x20'+_0x1985a9+')':'')),0x0):(console[_0x2f69a7(0x180)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x1985a9?_0x2f69a7(0x1b8)+_0x1985a9:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x2775b0=a8_0xc4b0;function a8_0x5adc(){const _0x2fa87f=['join','llmAgent','316MzidyD','stringify','claude-4.5-haiku','tool','14SfhulV','session\x20context','404','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','content','--agent\x20flag','context','code','13447580zDGvnB','stack','660227aIoLla','verbose','getOrCreateDefaultAgent','done','chat','Create\x20a\x20new\x20chat\x20session','Using\x20agent\x20from\x20','Error:\x20','streamChat','Chat\x20session:\x20','targetKnowledgeBase','\x27...','name','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','stdout','4000374BgeNgm','stream','description','data','write','handleChatEvent','targetAgent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','chatId','\x20\x20Cause:\x20','tool_result','Using\x20cached\x20default\x20agent:\x20','llmProject','2195528mFxolU','message','Getting\x20default\x20agent...','6549102mKlpiC','2hfrxPR','streamChatJsonl','agent','execute','Continuing\x20chat:\x20','error','targetFunction','1121625RCoKvs','site','functionName','cause','tool_call','llm','Error:\x20Chat\x20session\x20\x27','\x27\x20not\x20found','Resolving\x20agent\x20\x27','validate','type','getDefaultAgent','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','13137WnCSBh','\x0aError:\x20','projectId','chat-create','Resolving\x20project\x20\x27','log','includes','agentId','metadata','CHAT_NOT_FOUND'];a8_0x5adc=function(){return _0x2fa87f;};return a8_0x5adc();}(function(_0x54871d,_0x54bab2){const _0x5775da=a8_0xc4b0,_0x578dcb=_0x54871d();while(!![]){try{const _0x3426d3=-parseInt(_0x5775da(0x14d))/0x1*(parseInt(_0x5775da(0x16d))/0x2)+parseInt(_0x5775da(0x133))/0x3*(parseInt(_0x5775da(0x13f))/0x4)+parseInt(_0x5775da(0x126))/0x5+-parseInt(_0x5775da(0x15c))/0x6+-parseInt(_0x5775da(0x143))/0x7*(-parseInt(_0x5775da(0x169))/0x8)+-parseInt(_0x5775da(0x16c))/0x9+parseInt(_0x5775da(0x14b))/0xa;if(_0x3426d3===_0x54bab2)break;else _0x578dcb['push'](_0x578dcb['shift']());}catch(_0xd548b9){_0x578dcb['push'](_0x578dcb['shift']());}}}(a8_0x5adc,0x63eb8));import{BaseCommand}from'./command.js';function a8_0xc4b0(_0x2154de,_0xa5288e){_0x2154de=_0x2154de-0x121;const _0x5adcc1=a8_0x5adc();let _0xc4b0ce=_0x5adcc1[_0x2154de];return _0xc4b0ce;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x29bd4e,_0x27388e){const _0x30451c=a8_0xc4b0;if(_0x29bd4e instanceof SDKError)console['error'](_0x30451c(0x154)+_0x29bd4e['message']),_0x27388e['verbose']&&(_0x29bd4e[_0x30451c(0x129)]&&console['error'](_0x30451c(0x165)+_0x29bd4e['cause']),_0x29bd4e[_0x30451c(0x14c)]&&(console[_0x30451c(0x124)]('\x0aStack\x20trace:'),console[_0x30451c(0x124)](_0x29bd4e[_0x30451c(0x14c)])));else throw _0x29bd4e;}async function resolveAgentId(_0x50add6,_0x378a39,_0x428e88,_0x1fe69a,_0x53a8f6){const _0xacb2e1=a8_0xc4b0,_0x143f2a=_0x378a39||_0x428e88;if(_0x143f2a){const {projectName:_0x59bf0e,agentName:_0x50f8a0}=parseAgentRef(_0x143f2a),_0x4a4f87=_0x50f8a0||_0x143f2a,_0x2329ef=_0x50f8a0?_0x59bf0e:_0x1fe69a;if(!_0x2329ef)throw new Error(_0xacb2e1(0x132));if(_0x53a8f6){const _0x20527c=_0x378a39?_0xacb2e1(0x148):_0xacb2e1(0x144);console[_0xacb2e1(0x124)](_0xacb2e1(0x153)+_0x20527c+':\x20'+_0x2329ef+'/'+_0x4a4f87);}const _0x5d4603=await withSpinner(_0xacb2e1(0x137)+_0x2329ef+_0xacb2e1(0x158),()=>_0x50add6['llm']['resolveProjectId'](_0x2329ef),{'verbose':_0x53a8f6}),_0x18537e=await withSpinner(_0xacb2e1(0x12e)+_0x4a4f87+_0xacb2e1(0x158),()=>_0x50add6[_0xacb2e1(0x12b)]['resolveAgentId'](_0x4a4f87,_0x5d4603[_0xacb2e1(0x15f)]),{'verbose':_0x53a8f6});return _0x18537e['data'];}else{const _0x29832c=_0x50add6[_0xacb2e1(0x12b)][_0xacb2e1(0x131)]();if(_0x29832c)return _0x53a8f6&&console[_0xacb2e1(0x124)](_0xacb2e1(0x167)+_0x29832c['name']),_0x29832c['id'];const _0x3d9eea=await withSpinner(_0xacb2e1(0x16b),()=>_0x50add6[_0xacb2e1(0x12b)][_0xacb2e1(0x14f)](_0xacb2e1(0x141),0x0),{'verbose':_0x53a8f6});return _0x3d9eea[_0xacb2e1(0x15f)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x2775b0(0x151);[a8_0x2775b0(0x15e)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x2775b0(0x12f)](_0x11d810){const _0x33e237=a8_0x2775b0,_0x5ecfc7=_0x11d810['args'][_0x33e237(0x13d)]('\x20');if(!_0x5ecfc7)return _0x33e237(0x163);return undefined;}async['streamChat'](_0x4085d9,_0x5b9d75,_0x4fe9f4,_0x1e0c5e,_0x4269db){const _0x1c87e8=a8_0x2775b0;for await(const _0x32fcfb of _0x4085d9[_0x1c87e8(0x12b)][_0x1c87e8(0x151)](_0x5b9d75,{'agentId':_0x4fe9f4,'chatId':_0x1e0c5e})){if(_0x32fcfb[_0x1c87e8(0x130)]===_0x1c87e8(0x13b)){const _0x1db811=_0x32fcfb[_0x1c87e8(0x15f)][_0x1c87e8(0x164)];saveLastChatId(_0x1db811),_0x4269db&&console[_0x1c87e8(0x124)](_0x1c87e8(0x156)+_0x1db811);}else _0x32fcfb[_0x1c87e8(0x130)]==='event'&&this['handleChatEvent'](_0x32fcfb[_0x1c87e8(0x15f)]);}}async[a8_0x2775b0(0x16e)](_0x10c735,_0x1d7ced,_0x44be03,_0x23a058){const _0x1bf8c2=a8_0x2775b0,_0x572d66=_0x10c735[_0x1bf8c2(0x149)][_0x1bf8c2(0x127)];let _0x43a27f=![];for await(const _0x3dd4e7 of _0x10c735[_0x1bf8c2(0x12b)][_0x1bf8c2(0x151)](_0x1d7ced,{'agentId':_0x44be03,'chatId':_0x23a058})){if(_0x3dd4e7[_0x1bf8c2(0x130)]===_0x1bf8c2(0x13b)){const _0x5efc97=_0x3dd4e7['data'];saveLastChatId(_0x5efc97[_0x1bf8c2(0x164)]);const _0x4db699=_0x5efc97['projectId']&&_0x5efc97['agentId']?getLLMConversationUrl(_0x572d66,_0x5efc97[_0x1bf8c2(0x135)],_0x5efc97['agentId'],_0x5efc97[_0x1bf8c2(0x164)]):undefined;console['log'](JSON[_0x1bf8c2(0x140)]({'type':_0x1bf8c2(0x13b),'data':{'chatId':_0x5efc97[_0x1bf8c2(0x164)],'agentId':_0x5efc97[_0x1bf8c2(0x13a)],'consoleUrl':_0x4db699}})),_0x43a27f=!![];}else{if(_0x3dd4e7[_0x1bf8c2(0x130)]==='event'){!_0x43a27f&&_0x23a058&&(console[_0x1bf8c2(0x138)](JSON[_0x1bf8c2(0x140)]({'type':'metadata','data':{'chatId':_0x23a058}})),_0x43a27f=!![]);const _0x30c5ad=_0x3dd4e7[_0x1bf8c2(0x15f)];if(_0x1bf8c2(0x147)in _0x30c5ad)console['log'](JSON[_0x1bf8c2(0x140)]({'type':_0x1bf8c2(0x147),'data':{'content':_0x30c5ad[_0x1bf8c2(0x147)]}}));else{if(_0x1bf8c2(0x12a)in _0x30c5ad){const _0x27ece9=_0x30c5ad[_0x1bf8c2(0x12a)];console[_0x1bf8c2(0x138)](JSON[_0x1bf8c2(0x140)]({'type':_0x1bf8c2(0x12a),'data':{'id':_0x27ece9['id'],'name':_0x27ece9[_0x1bf8c2(0x128)],'target':_0x27ece9[_0x1bf8c2(0x157)]?.[_0x1bf8c2(0x159)]||_0x27ece9[_0x1bf8c2(0x162)]?.[_0x1bf8c2(0x159)]||_0x27ece9['targetWebSearchTool']?.['name']||_0x27ece9[_0x1bf8c2(0x125)]}}));}else{if(_0x1bf8c2(0x142)in _0x30c5ad)console[_0x1bf8c2(0x138)](JSON['stringify']({'type':_0x1bf8c2(0x166),'data':{'id':_0x30c5ad['tool']['id'],'name':_0x30c5ad[_0x1bf8c2(0x142)][_0x1bf8c2(0x128)],'result':typeof _0x30c5ad[_0x1bf8c2(0x142)][_0x1bf8c2(0x147)]==='string'?_0x30c5ad[_0x1bf8c2(0x142)]['content']['slice'](0x0,0x1f4):''}}));else'error'in _0x30c5ad&&console[_0x1bf8c2(0x138)](JSON[_0x1bf8c2(0x140)]({'type':_0x1bf8c2(0x124),'data':{'error':_0x30c5ad[_0x1bf8c2(0x124)]}}));}}}}}console['log'](JSON[_0x1bf8c2(0x140)]({'type':_0x1bf8c2(0x150)}));}async[a8_0x2775b0(0x122)](_0x1a3294){const _0x234206=a8_0x2775b0,{options:_0x28dec5,args:_0x50f5cb,tdx:_0xbdd245}=_0x1a3294,_0x2c47f8=_0x50f5cb[_0x234206(0x13d)]('\x20'),_0x2d3a9c=_0x28dec5,_0x2acea2=_0x2d3a9c['agent'],_0x361f15=_0x2d3a9c['llmAgent'],_0x1465ac=_0x2d3a9c['llmProject'],_0x3c0c88=_0x2d3a9c['new'],_0x1d0522=_0x2d3a9c[_0x234206(0x164)],_0x20e5a0=_0x2d3a9c[_0x234206(0x15d)];if(_0x3c0c88&&_0x1d0522)return console['error'](_0x234206(0x15a)),0x1;try{let _0x2218f6,_0x29417f;if(_0x1d0522)_0x29417f=_0x1d0522;else!_0x3c0c88&&(_0x29417f=loadLastChatId(),_0x29417f&&_0x28dec5[_0x234206(0x14e)]&&console['error'](_0x234206(0x123)+_0x29417f));!_0x1d0522&&(_0x3c0c88||!_0x29417f)&&(_0x2218f6=await resolveAgentId(_0xbdd245,_0x2acea2,_0x361f15,_0x1465ac,_0x28dec5[_0x234206(0x14e)]));const _0xd2956=_0x20e5a0?(_0x246f61,_0x5c070e,_0x4dd4a6)=>this[_0x234206(0x16e)](_0xbdd245,_0x246f61,_0x5c070e,_0x4dd4a6):(_0x253d7f,_0x56657f,_0x17355e)=>this[_0x234206(0x155)](_0xbdd245,_0x253d7f,_0x56657f,_0x17355e,_0x28dec5[_0x234206(0x14e)]);try{await _0xd2956(_0x2c47f8,_0x2218f6,_0x29417f);}catch(_0x1c2bfa){const _0x528b57=_0x1c2bfa instanceof SDKError&&_0x1c2bfa[_0x234206(0x14a)]===ErrorCode[_0x234206(0x13c)]||_0x1c2bfa instanceof Error&&_0x1c2bfa[_0x234206(0x16a)][_0x234206(0x139)](_0x234206(0x145));if(_0x528b57&&_0x1d0522)return console[_0x234206(0x124)](_0x234206(0x12c)+_0x1d0522+_0x234206(0x12d)),0x1;if(_0x528b57)_0x28dec5[_0x234206(0x14e)]&&console['error'](_0x234206(0x146)),!_0x2218f6&&(_0x2218f6=await resolveAgentId(_0xbdd245,_0x2acea2,_0x361f15,_0x1465ac,_0x28dec5[_0x234206(0x14e)])),await _0xd2956(_0x2c47f8,_0x2218f6,undefined);else throw _0x1c2bfa;}return!_0x20e5a0&&console['log'](),0x0;}catch(_0x361c62){return console[_0x234206(0x124)](),handleSDKError(_0x361c62,_0x28dec5),0x1;}}[a8_0x2775b0(0x161)](_0x493e23){const _0x11e5c5=a8_0x2775b0;if(_0x11e5c5(0x147)in _0x493e23)process[_0x11e5c5(0x15b)][_0x11e5c5(0x160)](_0x493e23['content']);else _0x11e5c5(0x124)in _0x493e23&&console[_0x11e5c5(0x124)](_0x11e5c5(0x134)+_0x493e23['error']);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x2775b0(0x136);[a8_0x2775b0(0x15e)]=a8_0x2775b0(0x152);[a8_0x2775b0(0x12f)](_0x4fd5a4){const _0x4d0fab=a8_0x2775b0,_0x5064df=_0x4fd5a4['options'],_0x3fb8cc=_0x5064df[_0x4d0fab(0x121)],_0xf35a5d=_0x5064df[_0x4d0fab(0x13e)];if(!_0x3fb8cc&&!_0xf35a5d)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async['execute'](_0x56c7f5){const _0x20d5ed=a8_0x2775b0,{options:_0x3f9cdf,tdx:_0x4d74de}=_0x56c7f5,_0x42af4f=_0x3f9cdf,_0x528de0=_0x42af4f[_0x20d5ed(0x121)],_0x143a9a=_0x42af4f[_0x20d5ed(0x13e)],_0x59c90a=_0x42af4f[_0x20d5ed(0x168)];try{const _0x2a1cc9=await resolveAgentId(_0x4d74de,_0x528de0,_0x143a9a,_0x59c90a,_0x3f9cdf['verbose']),_0x115818=await _0x4d74de[_0x20d5ed(0x12b)]['startChat'](_0x2a1cc9);return saveLastChatId(_0x115818['id']),console[_0x20d5ed(0x138)](JSON[_0x20d5ed(0x140)]({'chatId':_0x115818['id'],'agentId':_0x2a1cc9})),0x0;}catch(_0x2d9932){return handleSDKError(_0x2d9932,_0x3f9cdf),0x1;}}}
|
|
1
|
+
const a8_0x4fda7e=a8_0x386e;(function(_0x257e07,_0x452fe5){const _0x483a85=a8_0x386e,_0x544fd7=_0x257e07();while(!![]){try{const _0x5a53b4=parseInt(_0x483a85(0xff))/0x1+parseInt(_0x483a85(0x101))/0x2+parseInt(_0x483a85(0x13e))/0x3+parseInt(_0x483a85(0x13a))/0x4*(-parseInt(_0x483a85(0x11f))/0x5)+-parseInt(_0x483a85(0x10d))/0x6+parseInt(_0x483a85(0x11c))/0x7+-parseInt(_0x483a85(0xf7))/0x8*(parseInt(_0x483a85(0x12b))/0x9);if(_0x5a53b4===_0x452fe5)break;else _0x544fd7['push'](_0x544fd7['shift']());}catch(_0x26c666){_0x544fd7['push'](_0x544fd7['shift']());}}}(a8_0xcad6,0x6eab9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0xcad6(){const _0x315730=['message','log','llmProject','startChat','stringify','1382160nYrACf','404','resolveAgentId','code','\x0aStack\x20trace:','agentId','context','--agent\x20flag','slice','getDefaultAgent','streamChat','content','Using\x20agent\x20from\x20','verbose','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','6098659wYanyi','\x27\x20not\x20found','done','1178780NTagTZ','llmAgent','error','data','streamChatJsonl','\x27...','new','type','tool_call','tool_result','agent','site','16137xmkCMW','\x0aError:\x20','CHAT_NOT_FOUND','metadata','llm','chat-create','handleChatEvent','Create\x20a\x20new\x20chat\x20session','functionName','\x20\x20Cause:\x20','stack','session\x20context','chat','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','targetFunction','8ABubdw','stream','write','string','1107909HAutBE','Using\x20cached\x20default\x20agent:\x20','stdout','options','execute','Chat\x20session:\x20','cause','Continuing\x20chat:\x20','2864kZIXCc','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','projectId','Error:\x20','join','chatId','tool','description','152771zbKzQR','args','807520iJqekb','validate','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','name','claude-4.5-haiku','targetKnowledgeBase'];a8_0xcad6=function(){return _0x315730;};return a8_0xcad6();}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x4620cb,_0x5d7f75){const _0xddd5da=a8_0x386e;if(_0x4620cb instanceof SDKError)console[_0xddd5da(0x121)](_0xddd5da(0xfa)+_0x4620cb[_0xddd5da(0x108)]),_0x5d7f75[_0xddd5da(0x11a)]&&(_0x4620cb[_0xddd5da(0xf5)]&&console['error'](_0xddd5da(0x134)+_0x4620cb[_0xddd5da(0xf5)]),_0x4620cb['stack']&&(console['error'](_0xddd5da(0x111)),console[_0xddd5da(0x121)](_0x4620cb[_0xddd5da(0x135)])));else throw _0x4620cb;}async function resolveAgentId(_0x2a2dde,_0x1b1a61,_0x2bb086,_0x279cfc,_0x301ca9){const _0x2830fb=a8_0x386e,_0x5907e1=_0x1b1a61||_0x2bb086;if(_0x5907e1){const {projectName:_0x5d0c05,agentName:_0xe8c2a9}=parseAgentRef(_0x5907e1),_0x1a7feb=_0xe8c2a9||_0x5907e1,_0x5a9561=_0xe8c2a9?_0x5d0c05:_0x279cfc;if(!_0x5a9561)throw new Error(_0x2830fb(0x11b));if(_0x301ca9){const _0x5817ed=_0x1b1a61?_0x2830fb(0x114):_0x2830fb(0x136);console[_0x2830fb(0x121)](_0x2830fb(0x119)+_0x5817ed+':\x20'+_0x5a9561+'/'+_0x1a7feb);}const _0x4339d8=await withSpinner('Resolving\x20project\x20\x27'+_0x5a9561+_0x2830fb(0x124),()=>_0x2a2dde['llm']['resolveProjectId'](_0x5a9561),{'verbose':_0x301ca9}),_0x2d0296=await withSpinner('Resolving\x20agent\x20\x27'+_0x1a7feb+_0x2830fb(0x124),()=>_0x2a2dde['llm'][_0x2830fb(0x10f)](_0x1a7feb,_0x4339d8['data']),{'verbose':_0x301ca9});return _0x2d0296[_0x2830fb(0x122)];}else{const _0xd106e1=_0x2a2dde['llm'][_0x2830fb(0x116)]();if(_0xd106e1)return _0x301ca9&&console[_0x2830fb(0x121)](_0x2830fb(0x13f)+_0xd106e1[_0x2830fb(0x105)]),_0xd106e1['id'];const _0x259593=await withSpinner('Getting\x20default\x20agent...',()=>_0x2a2dde['llm']['getOrCreateDefaultAgent'](_0x2830fb(0x106),0x0),{'verbose':_0x301ca9});return _0x259593[_0x2830fb(0x122)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4fda7e(0x105)]=a8_0x4fda7e(0x137);[a8_0x4fda7e(0xfe)]=a8_0x4fda7e(0x138);[a8_0x4fda7e(0x102)](_0x27e383){const _0xc23977=a8_0x4fda7e,_0x4eb146=_0x27e383[_0xc23977(0x100)][_0xc23977(0xfb)]('\x20');if(!_0x4eb146)return _0xc23977(0xf8);return undefined;}async[a8_0x4fda7e(0x117)](_0x2beee4,_0x22e000,_0x18176c,_0x3bd72f,_0x5139ef){const _0x2f6c82=a8_0x4fda7e;for await(const _0xd7605d of _0x2beee4[_0x2f6c82(0x12f)]['chat'](_0x22e000,{'agentId':_0x18176c,'chatId':_0x3bd72f})){if(_0xd7605d['type']===_0x2f6c82(0x12e)){const _0x3f7a18=_0xd7605d['data'][_0x2f6c82(0xfc)];saveLastChatId(_0x3f7a18),_0x5139ef&&console['error'](_0x2f6c82(0xf4)+_0x3f7a18);}else _0xd7605d[_0x2f6c82(0x126)]==='event'&&this[_0x2f6c82(0x131)](_0xd7605d[_0x2f6c82(0x122)]);}}async[a8_0x4fda7e(0x123)](_0x2161ea,_0x500c89,_0x32a57f,_0x695327){const _0x6882a3=a8_0x4fda7e,_0x571cdc=_0x2161ea[_0x6882a3(0x113)][_0x6882a3(0x12a)];let _0x38253b=![];for await(const _0x34474e of _0x2161ea[_0x6882a3(0x12f)][_0x6882a3(0x137)](_0x500c89,{'agentId':_0x32a57f,'chatId':_0x695327})){if(_0x34474e[_0x6882a3(0x126)]==='metadata'){const _0x207103=_0x34474e[_0x6882a3(0x122)];saveLastChatId(_0x207103[_0x6882a3(0xfc)]);const _0x5782ca=_0x207103['projectId']&&_0x207103[_0x6882a3(0x112)]?getLLMConversationUrl(_0x571cdc,_0x207103[_0x6882a3(0xf9)],_0x207103[_0x6882a3(0x112)],_0x207103[_0x6882a3(0xfc)]):undefined;console['log'](JSON[_0x6882a3(0x10c)]({'type':'metadata','data':{'chatId':_0x207103[_0x6882a3(0xfc)],'agentId':_0x207103[_0x6882a3(0x112)],'consoleUrl':_0x5782ca}})),_0x38253b=!![];}else{if(_0x34474e[_0x6882a3(0x126)]==='event'){!_0x38253b&&_0x695327&&(console[_0x6882a3(0x109)](JSON[_0x6882a3(0x10c)]({'type':_0x6882a3(0x12e),'data':{'chatId':_0x695327}})),_0x38253b=!![]);const _0x2a6737=_0x34474e[_0x6882a3(0x122)];if('content'in _0x2a6737)console[_0x6882a3(0x109)](JSON[_0x6882a3(0x10c)]({'type':'content','data':{'content':_0x2a6737[_0x6882a3(0x118)]}}));else{if(_0x6882a3(0x127)in _0x2a6737){const _0x5edaa4=_0x2a6737[_0x6882a3(0x127)];console[_0x6882a3(0x109)](JSON[_0x6882a3(0x10c)]({'type':_0x6882a3(0x127),'data':{'id':_0x5edaa4['id'],'name':_0x5edaa4[_0x6882a3(0x133)],'target':_0x5edaa4[_0x6882a3(0x107)]?.[_0x6882a3(0x105)]||_0x5edaa4['targetAgent']?.['name']||_0x5edaa4['targetWebSearchTool']?.[_0x6882a3(0x105)]||_0x5edaa4[_0x6882a3(0x139)]}}));}else{if('tool'in _0x2a6737)console[_0x6882a3(0x109)](JSON[_0x6882a3(0x10c)]({'type':_0x6882a3(0x128),'data':{'id':_0x2a6737[_0x6882a3(0xfd)]['id'],'name':_0x2a6737[_0x6882a3(0xfd)][_0x6882a3(0x133)],'result':typeof _0x2a6737[_0x6882a3(0xfd)][_0x6882a3(0x118)]===_0x6882a3(0x13d)?_0x2a6737['tool'][_0x6882a3(0x118)][_0x6882a3(0x115)](0x0,0x1f4):''}}));else _0x6882a3(0x121)in _0x2a6737&&console['log'](JSON[_0x6882a3(0x10c)]({'type':_0x6882a3(0x121),'data':{'error':_0x2a6737[_0x6882a3(0x121)]}}));}}}}}console['log'](JSON[_0x6882a3(0x10c)]({'type':_0x6882a3(0x11e)}));}async['execute'](_0x3be82e){const _0x5daa71=a8_0x4fda7e,{options:_0xe88d8b,args:_0x29f4a6,tdx:_0x51e4fc}=_0x3be82e,_0x5ad9b0=_0x29f4a6[_0x5daa71(0xfb)]('\x20'),_0x1e9770=_0xe88d8b,_0x3981c6=_0x1e9770[_0x5daa71(0x129)],_0x4a84eb=_0x1e9770['llmAgent'],_0x37cb24=_0x1e9770[_0x5daa71(0x10a)],_0x590c22=_0x1e9770[_0x5daa71(0x125)],_0x25b7b0=_0x1e9770[_0x5daa71(0xfc)],_0x311d7e=_0x1e9770[_0x5daa71(0x13b)];if(_0x590c22&&_0x25b7b0)return console[_0x5daa71(0x121)](_0x5daa71(0x103)),0x1;try{let _0x5811aa,_0x49f17e;if(_0x25b7b0)_0x49f17e=_0x25b7b0;else!_0x590c22&&(_0x49f17e=loadLastChatId(),_0x49f17e&&_0xe88d8b['verbose']&&console[_0x5daa71(0x121)](_0x5daa71(0xf6)+_0x49f17e));!_0x25b7b0&&(_0x590c22||!_0x49f17e)&&(_0x5811aa=await resolveAgentId(_0x51e4fc,_0x3981c6,_0x4a84eb,_0x37cb24,_0xe88d8b[_0x5daa71(0x11a)]));const _0x53253c=_0x311d7e?(_0x2850de,_0x2d3417,_0x508b77)=>this['streamChatJsonl'](_0x51e4fc,_0x2850de,_0x2d3417,_0x508b77):(_0x211e80,_0x175662,_0x67cd50)=>this['streamChat'](_0x51e4fc,_0x211e80,_0x175662,_0x67cd50,_0xe88d8b['verbose']);try{await _0x53253c(_0x5ad9b0,_0x5811aa,_0x49f17e);}catch(_0x4bbe5f){const _0x345e18=_0x4bbe5f instanceof SDKError&&_0x4bbe5f[_0x5daa71(0x110)]===ErrorCode[_0x5daa71(0x12d)]||_0x4bbe5f instanceof Error&&_0x4bbe5f[_0x5daa71(0x108)]['includes'](_0x5daa71(0x10e));if(_0x345e18&&_0x25b7b0)return console[_0x5daa71(0x121)]('Error:\x20Chat\x20session\x20\x27'+_0x25b7b0+_0x5daa71(0x11d)),0x1;if(_0x345e18)_0xe88d8b[_0x5daa71(0x11a)]&&console['error'](_0x5daa71(0x104)),!_0x5811aa&&(_0x5811aa=await resolveAgentId(_0x51e4fc,_0x3981c6,_0x4a84eb,_0x37cb24,_0xe88d8b['verbose'])),await _0x53253c(_0x5ad9b0,_0x5811aa,undefined);else throw _0x4bbe5f;}return!_0x311d7e&&console[_0x5daa71(0x109)](),0x0;}catch(_0x260707){return console['error'](),handleSDKError(_0x260707,_0xe88d8b),0x1;}}[a8_0x4fda7e(0x131)](_0x337518){const _0x1cf14f=a8_0x4fda7e;if(_0x1cf14f(0x118)in _0x337518)process[_0x1cf14f(0x140)][_0x1cf14f(0x13c)](_0x337518[_0x1cf14f(0x118)]);else _0x1cf14f(0x121)in _0x337518&&console[_0x1cf14f(0x121)](_0x1cf14f(0x12c)+_0x337518[_0x1cf14f(0x121)]);}}function a8_0x386e(_0x5b8e04,_0x391fc8){_0x5b8e04=_0x5b8e04-0xf4;const _0xcad664=a8_0xcad6();let _0x386e63=_0xcad664[_0x5b8e04];return _0x386e63;}export class ChatCreateCommand extends BaseCommand{[a8_0x4fda7e(0x105)]=a8_0x4fda7e(0x130);[a8_0x4fda7e(0xfe)]=a8_0x4fda7e(0x132);[a8_0x4fda7e(0x102)](_0x37ad19){const _0x21dbb8=a8_0x4fda7e,_0x3f6d6e=_0x37ad19[_0x21dbb8(0x141)],_0xc188c5=_0x3f6d6e[_0x21dbb8(0x129)],_0x5958da=_0x3f6d6e[_0x21dbb8(0x120)];if(!_0xc188c5&&!_0x5958da)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x4fda7e(0x142)](_0x34e17e){const _0x28ee73=a8_0x4fda7e,{options:_0x46b115,tdx:_0x2b06b6}=_0x34e17e,_0x1dbfe1=_0x46b115,_0x172d18=_0x1dbfe1['agent'],_0x3bf6d7=_0x1dbfe1[_0x28ee73(0x120)],_0xa33b9c=_0x1dbfe1[_0x28ee73(0x10a)];try{const _0xa28687=await resolveAgentId(_0x2b06b6,_0x172d18,_0x3bf6d7,_0xa33b9c,_0x46b115[_0x28ee73(0x11a)]),_0x252b53=await _0x2b06b6[_0x28ee73(0x12f)][_0x28ee73(0x10b)](_0xa28687);return saveLastChatId(_0x252b53['id']),console[_0x28ee73(0x109)](JSON[_0x28ee73(0x10c)]({'chatId':_0x252b53['id'],'agentId':_0xa28687})),0x0;}catch(_0x58808f){return handleSDKError(_0x58808f,_0x46b115),0x1;}}}
|