@treasuredata/tdx 0.25.8 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/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.d.ts +2 -1
- package/dist/utils/local-cache.d.ts.map +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/local-cache.js.map +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x1f4a86=a3_0x1c25;(function(_0x34b73f,_0x1d8d8d){const _0x4379cc=a3_0x1c25,_0x40fc65=_0x34b73f();while(!![]){try{const _0x2591cc=parseInt(_0x4379cc(0x152))/0x1*(-parseInt(_0x4379cc(0x159))/0x2)+parseInt(_0x4379cc(0x14c))/0x3*(parseInt(_0x4379cc(0x151))/0x4)+-parseInt(_0x4379cc(0x14a))/0x5+-parseInt(_0x4379cc(0x14d))/0x6*(parseInt(_0x4379cc(0x162))/0x7)+-parseInt(_0x4379cc(0x15a))/0x8+-parseInt(_0x4379cc(0x161))/0x9+parseInt(_0x4379cc(0x143))/0xa;if(_0x2591cc===_0x1d8d8d)break;else _0x40fc65['push'](_0x40fc65['shift']());}catch(_0x32bfd8){_0x40fc65['push'](_0x40fc65['shift']());}}}(a3_0x39b6,0xb37b1));import{BaseCommand}from'./command.js';function a3_0x39b6(){const _0xca1336=['activations','Error:\x20','✔\x20Found\x20','6545421RmngVu','64547LytSDB','verbose','execute','segment','29889560OLZQCr','Resolving\x20child\x20segment\x20\x27','\x27...','Resolved\x20parent\x20ID:\x20','name','resolveSegmentId','listActivations','2418695JhgdTY','Child\x20name:\x20','171BzLyWd','30gFGwdQ','Site:\x20','data','length','6012IQbIlb','1087PpNURa','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','cause','resolveParentId','\x20activation','description','Error:\x20Segment\x20name\x20is\x20required','736qTKcix','5458760FRhUQR','error','Listing\x20activations\x20for\x20segment\x20\x27','message'];a3_0x39b6=function(){return _0xca1336;};return a3_0x39b6();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x1c25(_0x4ba9db,_0x5a4db7){_0x4ba9db=_0x4ba9db-0x140;const _0x39b636=a3_0x39b6();let _0x1c2538=_0x39b636[_0x4ba9db];return _0x1c2538;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x1f4a86(0x147)]=a3_0x1f4a86(0x15e);[a3_0x1f4a86(0x157)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x1f4a86(0x141)](_0x55f8c6){const _0x4282d7=a3_0x1f4a86,{options:_0x23f5ab,args:_0x1af432,tdx:_0x15bfd2}=_0x55f8c6;if(_0x1af432['length']===0x0)return console['error'](_0x4282d7(0x158)),console[_0x4282d7(0x15b)](_0x4282d7(0x153)),0x1;try{const {parentId:_0x157267,childId:_0x321890}=parseSegmentRef(_0x1af432[0x0]);if(!_0x321890)return console[_0x4282d7(0x15b)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x4282d7(0x15b)](_0x4282d7(0x153)),0x1;_0x23f5ab['verbose']&&(console['error'](_0x4282d7(0x14e)+_0x23f5ab['site']),console['error']('Parent\x20name:\x20'+_0x157267),console['error'](_0x4282d7(0x14b)+_0x321890));const _0x460053=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x157267+_0x4282d7(0x145),()=>_0x15bfd2[_0x4282d7(0x142)][_0x4282d7(0x155)](_0x157267),{'verbose':_0x23f5ab['verbose']}),_0x1b151a=_0x460053[_0x4282d7(0x14f)];_0x23f5ab[_0x4282d7(0x140)]&&console[_0x4282d7(0x15b)](_0x4282d7(0x146)+_0x1b151a);const _0x29acf3=await withSpinner(_0x4282d7(0x144)+_0x321890+_0x4282d7(0x145),()=>_0x15bfd2[_0x4282d7(0x142)][_0x4282d7(0x148)](_0x1b151a,_0x321890),{'verbose':_0x23f5ab[_0x4282d7(0x140)]}),_0x2670cf=_0x29acf3['data'];_0x23f5ab[_0x4282d7(0x140)]&&console[_0x4282d7(0x15b)]('Resolved\x20child\x20ID:\x20'+_0x2670cf);const _0x374387=await withSpinner(_0x4282d7(0x15c)+_0x321890+'\x27...',()=>_0x15bfd2[_0x4282d7(0x142)][_0x4282d7(0x149)](_0x1b151a,_0x2670cf),{'verbose':_0x23f5ab['verbose']}),_0xcb8468=_0x374387[_0x4282d7(0x14f)];return console[_0x4282d7(0x15b)](_0x4282d7(0x160)+_0xcb8468['length']+_0x4282d7(0x156)+(_0xcb8468[_0x4282d7(0x150)]!==0x1?'s':'')),await handleSDKOutput(_0xcb8468,_0x23f5ab),0x0;}catch(_0x27bf92){if(_0x27bf92 instanceof SDKError)return console[_0x4282d7(0x15b)](_0x4282d7(0x15f)+_0x27bf92[_0x4282d7(0x15d)]),_0x27bf92[_0x4282d7(0x154)]&&console[_0x4282d7(0x15b)]('\x20\x20Cause:\x20'+_0x27bf92[_0x4282d7(0x154)]),0x1;throw _0x27bf92;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0xdc039d=a4_0x1199;(function(_0x54ef4e,_0x28680b){const _0x483833=a4_0x1199,_0x49e633=_0x54ef4e();while(!![]){try{const _0x41885c=-parseInt(_0x483833(0x21d))/0x1*(-parseInt(_0x483833(0x267))/0x2)+-parseInt(_0x483833(0x1f9))/0x3+parseInt(_0x483833(0x243))/0x4*(parseInt(_0x483833(0x258))/0x5)+parseInt(_0x483833(0x1d9))/0x6*(-parseInt(_0x483833(0x232))/0x7)+-parseInt(_0x483833(0x1f1))/0x8*(parseInt(_0x483833(0x227))/0x9)+parseInt(_0x483833(0x25e))/0xa*(-parseInt(_0x483833(0x21a))/0xb)+parseInt(_0x483833(0x1eb))/0xc;if(_0x41885c===_0x28680b)break;else _0x49e633['push'](_0x49e633['shift']());}catch(_0x42490f){_0x49e633['push'](_0x49e633['shift']());}}}(a4_0x5c31,0x1e7bf));import a4_0x5424b1 from'chalk';import a4_0x4975e4 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(_0xbc43cf){const _0x3d3e67=a4_0x1199,_0x284d60=[];if(_0xbc43cf[_0x3d3e67(0x22e)]!==undefined)_0x284d60[_0x3d3e67(0x1bf)](_0xbc43cf[_0x3d3e67(0x22e)]+_0x3d3e67(0x254));if(_0xbc43cf[_0x3d3e67(0x1ed)]!==undefined&&_0xbc43cf[_0x3d3e67(0x1ed)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x23b)](_0xbc43cf[_0x3d3e67(0x1ed)]+'\x20new'));if(_0xbc43cf[_0x3d3e67(0x26d)]!==undefined&&_0xbc43cf[_0x3d3e67(0x26d)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x23b)](_0xbc43cf[_0x3d3e67(0x26d)]+'\x20created'));if(_0xbc43cf[_0x3d3e67(0x229)]!==undefined&&_0xbc43cf[_0x3d3e67(0x229)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x263)](_0xbc43cf[_0x3d3e67(0x229)]+_0x3d3e67(0x226)));if(_0xbc43cf[_0x3d3e67(0x25c)]!==undefined&&_0xbc43cf[_0x3d3e67(0x25c)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x200)](_0xbc43cf['unchanged']+_0x3d3e67(0x26a)));if(_0xbc43cf[_0x3d3e67(0x1e4)]!==undefined&&_0xbc43cf[_0x3d3e67(0x1e4)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x1cf)](_0xbc43cf[_0x3d3e67(0x1e4)]+_0x3d3e67(0x1be)));return _0x284d60['join'](',\x20');}function displayDiffs(_0xdf8022,_0x466959,_0x414da5,_0x499092,_0x514a94,_0x435b58,_0x6becaf){const _0x3016ef=a4_0x1199;for(const _0x4a50e1 of _0xdf8022){if(_0x4a50e1[_0x3016ef(0x1fa)]){const _0x376c7b=_0x4a50e1[_0x3016ef(0x22c)]||_0x4a50e1['name'];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x376c7b+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x4a50e1['diff']),console['log']('─'[_0x3016ef(0x218)](0x3c));}}for(const _0x2cbb85 of _0x466959){_0x2cbb85[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)](_0x3016ef(0x249)+_0x2cbb85[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'['repeat'](0x3c)),console['log'](_0x2cbb85[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x207ee8 of _0x414da5){_0x207ee8[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x207ee8[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'['repeat'](0x3c)),console[_0x3016ef(0x24c)](_0x207ee8[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x7488c of _0x499092){_0x7488c['diff']&&(console[_0x3016ef(0x24c)](_0x3016ef(0x1d1)+_0x7488c[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x7488c['diff']),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x36bf6f of _0x514a94){_0x36bf6f[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)](_0x3016ef(0x1f0)+_0x36bf6f['name']+'\x27:'),console['log']('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x36bf6f[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x517348 of _0x435b58){_0x517348[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x517348[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x517348['diff']),console[_0x3016ef(0x24c)]('─'['repeat'](0x3c)));}for(const _0x56eb11 of _0x6becaf){_0x56eb11[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x56eb11['name']+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x56eb11[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0xdc039d(0x1ee)]=a4_0xdc039d(0x257);['description']=a4_0xdc039d(0x1f7);async[a4_0xdc039d(0x1c1)](_0x4f7d46){const _0xef3a7b=a4_0xdc039d,{options:_0x331c0b,args:_0x5860ca,tdx:_0x29f0e3}=_0x4f7d46,_0x37eb84=_0x5860ca[0x0],_0x28e022=_0x5860ca[0x1],_0x43fbce=_0x331c0b[_0xef3a7b(0x221)],_0x118475=_0x331c0b[_0xef3a7b(0x1d2)],_0xe15e10=_0x331c0b[_0xef3a7b(0x238)],_0x111f0f=_0x331c0b[_0xef3a7b(0x20f)],_0xa0ba62=_0x331c0b['llmProject'];let _0x2fe86a,_0x2ac47b;const _0x2abc94=findAgentConfigPath(process[_0xef3a7b(0x247)]());if(_0x37eb84){const _0x3caeee=a4_0x4975e4[_0xef3a7b(0x239)](_0x37eb84,_0xef3a7b(0x26e));if(existsSync(_0x3caeee))try{const _0x516a00=JSON['parse'](readFileSync(_0x3caeee,_0xef3a7b(0x212)));_0x2fe86a=_0x516a00[_0xef3a7b(0x255)],_0x2ac47b=_0x37eb84,console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x242)]('Using\x20project\x20from\x20'+_0x3caeee+':\x20'+_0x2fe86a));}catch{_0x2fe86a=_0x37eb84;}else _0x2fe86a=_0x37eb84;}else{if(_0x2abc94)try{const _0x5d8dc9=JSON['parse'](readFileSync(_0x2abc94,_0xef3a7b(0x212)));_0x2fe86a=_0x5d8dc9[_0xef3a7b(0x255)],_0x2ac47b=a4_0x4975e4[_0xef3a7b(0x1d7)](_0x2abc94),console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x242)](_0xef3a7b(0x1ce)+_0x2fe86a));}catch{_0x2fe86a=_0xa0ba62;}else _0x2fe86a=_0xa0ba62;}if(!_0x2fe86a)return console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x269))),console['log'](_0xef3a7b(0x26b)),console[_0xef3a7b(0x24c)](_0xef3a7b(0x201)),console[_0xef3a7b(0x24c)](_0xef3a7b(0x22b)),console['log'](_0xef3a7b(0x20e)),0x1;if(_0x28e022){const {data:_0xd35f6a}=await withSpinner(_0xef3a7b(0x233)+_0x28e022+_0xef3a7b(0x1cc)+_0x2fe86a+_0xef3a7b(0x237),()=>_0x29f0e3[_0xef3a7b(0x246)][_0xef3a7b(0x260)](_0x2fe86a,_0x28e022,_0x43fbce,{'dryRun':_0x118475,'force':_0xe15e10}));if(_0x118475)return console[_0xef3a7b(0x24c)](a4_0x5424b1['yellow'](_0xef3a7b(0x20a))),console[_0xef3a7b(0x24c)](_0xef3a7b(0x202)+_0xd35f6a[_0xef3a7b(0x22c)]),console['log'](_0xef3a7b(0x208)+_0xd35f6a[_0xef3a7b(0x1db)]),_0xd35f6a[_0xef3a7b(0x1fa)]&&(console[_0xef3a7b(0x24c)]('\x0aChanges:'),console['log']('─'[_0xef3a7b(0x218)](0x3c)),console[_0xef3a7b(0x24c)](_0xd35f6a['diff']),console['log']('─'[_0xef3a7b(0x218)](0x3c))),0x0;return console['log'](a4_0x5424b1[_0xef3a7b(0x23b)](_0xef3a7b(0x26f))),console['log'](_0xef3a7b(0x265)+_0xd35f6a['agentName']),console['log'](_0xef3a7b(0x22a)+_0xd35f6a[_0xef3a7b(0x1db)]),console[_0xef3a7b(0x24c)]('Status:\x20'+(_0xd35f6a['isNew']?a4_0x5424b1['green']('new'):_0xd35f6a[_0xef3a7b(0x225)]?a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x229)):a4_0x5424b1[_0xef3a7b(0x200)](_0xef3a7b(0x25c)))),0x0;}const _0x57d344=_0x2ac47b||_0x43fbce,{data:_0x5d47a1}=await withSpinner(_0xef3a7b(0x1cd)+_0x2fe86a+_0xef3a7b(0x237),()=>_0x29f0e3['llm'][_0xef3a7b(0x21e)](_0x2fe86a,_0x57d344,{'dryRun':!![]})),_0x56c913=_0x5d47a1['counts'][_0xef3a7b(0x230)]['new']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x210)]['new']+_0x5d47a1['counts'][_0xef3a7b(0x1fe)][_0xef3a7b(0x1ed)]+_0x5d47a1['counts'][_0xef3a7b(0x1d5)]['new']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x223)][_0xef3a7b(0x1ed)]+_0x5d47a1['counts'][_0xef3a7b(0x23d)][_0xef3a7b(0x1ed)]+_0x5d47a1['counts'][_0xef3a7b(0x1c7)]['new'],_0x8f2d18=_0x5d47a1[_0xef3a7b(0x1bd)]['agents'][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)]['knowledgeBases'][_0xef3a7b(0x229)]+_0x5d47a1['counts'][_0xef3a7b(0x1fe)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1d5)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x223)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x23d)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)][_0xef3a7b(0x229)],_0x38e68e=_0x5d47a1[_0xef3a7b(0x1bd)]['agents'][_0xef3a7b(0x25c)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x210)]['unchanged']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1fe)][_0xef3a7b(0x25c)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1d5)][_0xef3a7b(0x25c)]+_0x5d47a1['counts'][_0xef3a7b(0x223)][_0xef3a7b(0x25c)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x23d)]['unchanged']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)][_0xef3a7b(0x25c)];console[_0xef3a7b(0x24c)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5d47a1[_0xef3a7b(0x236)]+'\x27:'),console[_0xef3a7b(0x24c)]('\x20\x20'+a4_0x5424b1[_0xef3a7b(0x23b)]('+\x20'+_0x56c913+_0xef3a7b(0x250))+'\x20|\x20'+a4_0x5424b1[_0xef3a7b(0x263)]('~\x20'+_0x8f2d18+_0xef3a7b(0x26c))+_0xef3a7b(0x264)+a4_0x5424b1[_0xef3a7b(0x242)]('=\x20'+_0x38e68e+_0xef3a7b(0x26a))),console[_0xef3a7b(0x24c)](_0xef3a7b(0x24e)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x230)])),console[_0xef3a7b(0x24c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x210)])),console[_0xef3a7b(0x24c)](_0xef3a7b(0x22f)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1fe)])),console[_0xef3a7b(0x24c)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1d5)])),console[_0xef3a7b(0x24c)](_0xef3a7b(0x217)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x223)]));const _0x335f64=_0x5d47a1['counts'][_0xef3a7b(0x23d)][_0xef3a7b(0x22e)]>0x0||_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)][_0xef3a7b(0x22e)]>0x0;_0x335f64&&(console[_0xef3a7b(0x24c)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x23d)])),console['log'](_0xef3a7b(0x205)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)])));console[_0xef3a7b(0x24c)](_0xef3a7b(0x21c)+a4_0x5424b1['cyan'](_0x5d47a1[_0xef3a7b(0x204)])),displayDiffs(_0x5d47a1[_0xef3a7b(0x230)],_0x5d47a1[_0xef3a7b(0x210)],_0x5d47a1[_0xef3a7b(0x1fe)],_0x5d47a1[_0xef3a7b(0x1d5)],_0x5d47a1[_0xef3a7b(0x223)],_0x5d47a1['experimentalKnowledgeBases'],_0x5d47a1[_0xef3a7b(0x1c7)]);if(_0x118475)return console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x211))),0x0;if(_0x56c913===0x0&&_0x8f2d18===0x0)return console[_0xef3a7b(0x24c)](a4_0x5424b1['green'](_0xef3a7b(0x241))),saveSessionContext({'llm_project':_0x5d47a1[_0xef3a7b(0x236)]},_0x331c0b['session']),console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x23b)](_0xef3a7b(0x24f)+a4_0x5424b1[_0xef3a7b(0x242)]('llm_project')+_0xef3a7b(0x1c9)+a4_0x5424b1[_0xef3a7b(0x1c5)](_0x5d47a1[_0xef3a7b(0x236)]))),0x0;if(!_0x111f0f&&!_0xe15e10){if(!isInteractive())return console['error'](a4_0x5424b1[_0xef3a7b(0x1cf)](_0xef3a7b(0x209)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xef3a7b(0x1c0)](a4_0x5424b1[_0xef3a7b(0x242)](_0xef3a7b(0x203))),0x1;const _0x529e69=await confirmKey('\x0aWrite\x20'+(_0x56c913+_0x8f2d18)+'\x20files?');if(!_0x529e69)return console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x21f)),_0xef3a7b(0x253)),0x1;}const {data:_0x3c4ec4}=await withSpinner(_0xef3a7b(0x24d),()=>_0x29f0e3[_0xef3a7b(0x246)][_0xef3a7b(0x21e)](_0x2fe86a,_0x57d344,{'force':_0xe15e10}));return console['log'](a4_0x5424b1[_0xef3a7b(0x23b)](_0xef3a7b(0x1f8)+(_0x56c913+_0x8f2d18)+_0xef3a7b(0x1dc)+_0x3c4ec4['outputDir'])),saveSessionContext({'llm_project':_0x3c4ec4[_0xef3a7b(0x236)]},_0x331c0b['session']),console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x23b)]('✔\x20Context\x20set:\x20'+a4_0x5424b1[_0xef3a7b(0x242)]('llm_project')+_0xef3a7b(0x1c9)+a4_0x5424b1[_0xef3a7b(0x1c5)](_0x3c4ec4[_0xef3a7b(0x236)]))),0x0;}}function a4_0x1199(_0x588517,_0x33b34c){_0x588517=_0x588517-0x1ba;const _0x5c3168=a4_0x5c31();let _0x119975=_0x5c3168[_0x588517];return _0x119975;}export class AgentCloneCommand extends BaseCommand{[a4_0xdc039d(0x1ee)]='agent:clone';[a4_0xdc039d(0x25a)]=a4_0xdc039d(0x240);async[a4_0xdc039d(0x1c1)](_0x40b0a6){const _0x2d3677=a4_0xdc039d,{options:_0x3ddff9,args:_0x57d92f,tdx:_0x576101}=_0x40b0a6,_0x2abbd2=_0x57d92f[0x0],_0x59d46b=_0x3ddff9[_0x2d3677(0x1ee)],_0x33cc77=_0x3ddff9[_0x2d3677(0x1d2)],_0x20b557=_0x3ddff9['yes'],_0x12639e=_0x3ddff9[_0x2d3677(0x1bb)],_0x30edba=_0x3ddff9[_0x2d3677(0x20d)];let _0x5e38ad;const _0x514b5c=findAgentConfigPath(process[_0x2d3677(0x247)]());if(_0x2abbd2){const _0x4d51cc=a4_0x4975e4[_0x2d3677(0x239)](_0x2abbd2,_0x2d3677(0x26e));existsSync(_0x4d51cc)?(_0x5e38ad=_0x2abbd2,console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x242)](_0x2d3677(0x244)+_0x2abbd2))):_0x5e38ad=_0x2abbd2;}else{if(_0x514b5c)_0x5e38ad=a4_0x4975e4['dirname'](_0x514b5c),console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x242)](_0x2d3677(0x1ec)+_0x5e38ad));else{if(_0x30edba){const _0x4028da=sanitizeForFilesystem(_0x30edba);let _0x55c45c=_0x4028da,_0x485535=a4_0x4975e4[_0x2d3677(0x239)](process[_0x2d3677(0x247)](),'agents',_0x4028da,_0x2d3677(0x26e));if(!existsSync(_0x485535)){const _0x25b44f=normalizeName(_0x30edba),_0x34b97e=a4_0x4975e4[_0x2d3677(0x239)](process[_0x2d3677(0x247)](),'agents',_0x25b44f,'tdx.json');existsSync(_0x34b97e)&&(_0x55c45c=_0x25b44f,_0x485535=_0x34b97e);}if(existsSync(_0x485535))_0x5e38ad=a4_0x4975e4[_0x2d3677(0x1d7)](_0x485535),console['log'](a4_0x5424b1[_0x2d3677(0x242)](_0x2d3677(0x244)+_0x5e38ad));else{const _0x2f82b2=_0x3ddff9[_0x2d3677(0x234)];if(_0x2f82b2)throw new SDKError(ErrorCode[_0x2d3677(0x219)],_0x2d3677(0x228)+_0x30edba+_0x2d3677(0x22d),undefined,{'helpText':_0x2d3677(0x1e3)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x30edba+'\x0a')+(_0x2d3677(0x1c4)+_0x55c45c+_0x2d3677(0x1ff)+(_0x59d46b||_0x2d3677(0x25b))+'\x20--profile\x20'+_0x2f82b2)});_0x5e38ad=_0x30edba,console[_0x2d3677(0x24c)](a4_0x5424b1['dim'](_0x2d3677(0x1ba)+_0x30edba));}}}}if(!_0x5e38ad)return console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x263)](_0x2d3677(0x1e8))),console[_0x2d3677(0x24c)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x2d3677(0x24c)](_0x2d3677(0x1fd)),console[_0x2d3677(0x24c)](_0x2d3677(0x235)),console[_0x2d3677(0x24c)](_0x2d3677(0x222)),0x1;if(!_0x59d46b)throw new SDKError(ErrorCode[_0x2d3677(0x25d)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x2d3677(0x1f5)});if(!_0x20b557&&!_0x33cc77){if(!isInteractive())return console[_0x2d3677(0x1c0)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x209)),_0x2d3677(0x1fc)),console['error'](a4_0x5424b1[_0x2d3677(0x242)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x56ee45=await confirmKey('Clone\x20\x22'+_0x5e38ad+_0x2d3677(0x1d3)+_0x59d46b+'\x22?');if(!_0x56ee45)return console[_0x2d3677(0x24c)](a4_0x5424b1['yellow'](_0x2d3677(0x21f))),0x1;}const {data:_0x3fbd04}=await withSpinner(_0x2d3677(0x1e2)+_0x5e38ad+_0x2d3677(0x1e7)+_0x59d46b+_0x2d3677(0x237),()=>_0x576101[_0x2d3677(0x246)]['cloneProject'](_0x5e38ad,_0x59d46b,{'dryRun':_0x33cc77}));if(_0x33cc77){console[_0x2d3677(0x24c)](a4_0x5424b1['yellow'](_0x2d3677(0x23e))),console[_0x2d3677(0x24c)](_0x2d3677(0x1ef)+_0x3fbd04[_0x2d3677(0x1c8)]),console[_0x2d3677(0x24c)]('New\x20project:\x20'+_0x59d46b),console['log'](_0x2d3677(0x1e9)),console[_0x2d3677(0x24c)](_0x2d3677(0x24e)+_0x3fbd04[_0x2d3677(0x1bd)]['agents'][_0x2d3677(0x26d)]),console[_0x2d3677(0x24c)]('\x20\x20Knowledge\x20Bases:\x20'+_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x210)]['created']),console['log'](_0x2d3677(0x270)+_0x3fbd04[_0x2d3677(0x1bd)]['prompts']['created']);const _0x22cb0b=_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)]['created']>0x0||_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x26d)]>0x0;return _0x22cb0b&&(console[_0x2d3677(0x24c)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x3fbd04['counts'][_0x2d3677(0x23d)][_0x2d3677(0x26d)]),console[_0x2d3677(0x24c)](_0x2d3677(0x205)+_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x26d)])),0x0;}const _0x2abbbf=_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x230)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x210)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04['counts'][_0x2d3677(0x1d5)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x1c7)][_0x2d3677(0x1e4)]>0x0;_0x2abbbf?console[_0x2d3677(0x24c)](a4_0x5424b1['yellow'](_0x2d3677(0x256))):console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x23b)](_0x2d3677(0x24a)));console[_0x2d3677(0x24c)](_0x2d3677(0x1ef)+_0x3fbd04['sourceProjectName']),console[_0x2d3677(0x24c)](_0x2d3677(0x1e6)+_0x3fbd04['newProjectName']),console[_0x2d3677(0x24c)](_0x2d3677(0x1ea)+_0x3fbd04[_0x2d3677(0x23c)]),console[_0x2d3677(0x24c)](),console[_0x2d3677(0x24c)](_0x2d3677(0x207)),console[_0x2d3677(0x24c)](_0x2d3677(0x24e)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x230)])),console[_0x2d3677(0x24c)](_0x2d3677(0x271)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x210)])),console[_0x2d3677(0x24c)](_0x2d3677(0x270)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)]['prompts'])),console[_0x2d3677(0x24c)](_0x2d3677(0x217)+formatCountSummary(_0x3fbd04['counts'][_0x2d3677(0x223)]));const _0x407f8=_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x26d)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x229)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x25c)]>0x0||_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x26d)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x1c7)][_0x2d3677(0x229)]>0x0||_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x25c)]>0x0;_0x407f8&&(console[_0x2d3677(0x24c)](_0x2d3677(0x1bc)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)])),console[_0x2d3677(0x24c)](_0x2d3677(0x205)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x1c7)])));if(_0x2abbbf){console[_0x2d3677(0x24c)](),console['log'](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x206)));for(const _0x3ed6b9 of _0x3fbd04[_0x2d3677(0x230)]){_0x3ed6b9[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x1de)+_0x3ed6b9[_0x2d3677(0x22c)]+_0x2d3677(0x1ca)+_0x3ed6b9[_0x2d3677(0x1c0)]));}for(const _0x3402af of _0x3fbd04[_0x2d3677(0x210)]){_0x3402af[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x1cb)+_0x3402af[_0x2d3677(0x1ee)]+_0x2d3677(0x1ca)+_0x3402af[_0x2d3677(0x1c0)]));}for(const _0x92d7c6 of _0x3fbd04['prompts']){_0x92d7c6[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console['log'](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x224)+_0x92d7c6[_0x2d3677(0x1ee)]+'\x22:\x20'+_0x92d7c6[_0x2d3677(0x1c0)]));}for(const _0x102af9 of _0x3fbd04[_0x2d3677(0x223)]){_0x102af9[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x24b)+_0x102af9['name']+_0x2d3677(0x1ca)+_0x102af9[_0x2d3677(0x1c0)]));}for(const _0x2c11e9 of _0x3fbd04[_0x2d3677(0x23d)]){_0x2c11e9['action']===_0x2d3677(0x1c0)&&console['log'](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x20c)+_0x2c11e9[_0x2d3677(0x1ee)]+_0x2d3677(0x1ca)+_0x2c11e9['error']));}for(const _0xc06d9d of _0x3fbd04[_0x2d3677(0x1c7)]){_0xc06d9d[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1['red'](_0x2d3677(0x245)+_0xc06d9d[_0x2d3677(0x1ee)]+_0x2d3677(0x1ca)+_0xc06d9d[_0x2d3677(0x1c0)]));}return 0x1;}console[_0x2d3677(0x24c)]();const _0x3319c2=getLLMProjectUrl(_0x12639e,_0x3fbd04[_0x2d3677(0x23c)]);return console[_0x2d3677(0x24c)](_0x2d3677(0x213)+a4_0x5424b1[_0x2d3677(0x1c5)](_0x3319c2)),0x0;}}function a4_0x5c31(){const _0x35929b=['execute','\x0aProject\x20pushed\x20with\x20errors','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20tdx\x20agent\x20clone\x20agents/','cyan','agent.yml','experimentalArtifacts','sourceProjectName','\x20=\x20','\x22:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x22\x20from\x20project\x20\x22','Analyzing\x20project\x20\x22','Using\x20project:\x20','red','reason','\x0aChanges\x20to\x20prompt\x20\x27','dryRun','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','prompts','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','dirname','message','789420QVaFQP','\x0aErrors\x20found:','outputPath','\x20files\x20to\x20','\x0aPush\x20','\x20\x20Agent\x20\x22','\x20resources\x20to\x20\x27','Would\x20push\x20agent:\x20','\x0aPush\x20summary\x20for\x20\x27','Cloning\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','errors','no_local_folder','New\x20project:\x20','\x22\x20to\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Would\x20clone:','New\x20project\x20ID:\x20','6382296rMCRtT','Using\x20current\x20project:\x20','new','name','Source:\x20','\x0aChanges\x20to\x20integration\x20\x27','72616aLKUle','projectId','Agent\x20','source','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Failed\x20to\x20push\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0a✔\x20Pulled\x20','667248Jmalox','diff','action','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','textKnowledgeBases','\x20--name\x20','gray','\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','Would\x20pull\x20agent:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','outputDir','\x20\x20Experimental\x20Artifacts:\x20','Errors:','Summary:','Output\x20path:\x20','\x0aError:','Dry\x20run\x20-\x20no\x20files\x20written','pushAgent','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','llmProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','yes','knowledgeBases','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','utf-8','Project:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20resources?','\x20successfully','\x20\x20Integrations:\x20','repeat','INVALID_ARGUMENT','289630xUKJql','agent:push','\x20\x20Target:\x20','2tiRvAl','pullProject','Cancelled','Chat:\x20','output','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','integrations','\x20\x20Prompt\x20\x22','hasChanges','\x20updated','9fUhgwM','Cannot\x20clone\x20from\x20context\x20project\x20\x22','updated','Output:\x20','\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','agentName','\x22\x20to\x20a\x20different\x20profile','total','\x20\x20Text\x20Knowledge\x20Bases:\x20','agents','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','7CAzDjN','Pulling\x20agent\x20\x22','profile','\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)','projectName','\x22...','force','join','projectDir','green','newProjectId','experimentalKnowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','agentId','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','dim','150608umMMYq','Using\x20local\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','llm','cwd','Analyzing\x20changes\x20to\x20push...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Project\x20cloned\x20successfully','\x20\x20Integration\x20\x22','log','Writing\x20files...','\x20\x20Agents:\x20','✔\x20Context\x20set:\x20','\x20new','pushProject','Pushing\x20to\x20project...','-\x20no\x20files\x20written','\x20total','llm_project','Project\x20cloned\x20with\x20errors','agent:pull','5GvoPBL','\x0a✔\x20Pushed\x20','description','<new-name>','unchanged','MISSING_ARGUMENT','70axqVdg','no_context','pullAgent','\x20\x20Source:\x20','context','yellow','\x20|\x20','Agent:\x20','Pushing\x20agent\x20from\x20\x22','102726sSUuhA','\x27\x20to\x20create\x20the\x20folder\x20structure.','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20unchanged','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)','\x20changed','created','tdx.json','Agent\x20pulled\x20successfully','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Bases:\x20','Using\x20context\x20project:\x20','site','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','counts','\x20errors','push','error'];a4_0x5c31=function(){return _0x35929b;};return a4_0x5c31();}export class AgentPushCommand extends BaseCommand{[a4_0xdc039d(0x1ee)]=a4_0xdc039d(0x21b);[a4_0xdc039d(0x25a)]=a4_0xdc039d(0x214);async['execute'](_0x375122){const _0x47f53f=a4_0xdc039d,{options:_0x128540,args:_0x21a34c,tdx:_0xf45f78}=_0x375122;let _0x45974e=_0x21a34c[0x0]||process['cwd']();const _0x387c82=_0x128540[_0x47f53f(0x1d2)],_0xacfc3e=_0x128540[_0x47f53f(0x238)],_0x5e478e=_0x128540['yes'],_0x439da9=_0x128540[_0x47f53f(0x1bb)],_0x6cd156=a4_0x4975e4[_0x47f53f(0x239)](_0x45974e,_0x47f53f(0x1c6)),_0x16043b=existsSync(_0x6cd156);if(_0x16043b){const {data:_0x223a3f}=await withSpinner(_0x47f53f(0x266)+_0x45974e+_0x47f53f(0x237),()=>_0xf45f78[_0x47f53f(0x246)][_0x47f53f(0x20b)](_0x45974e,{'dryRun':_0x387c82,'force':_0xacfc3e}));if(_0x387c82)return console[_0x47f53f(0x24c)](a4_0x5424b1['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x47f53f(0x1e0)+_0x223a3f[_0x47f53f(0x22c)]),0x0;if(_0x223a3f[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0))return console[_0x47f53f(0x24c)](a4_0x5424b1['red'](_0x47f53f(0x1f6)+_0x223a3f[_0x47f53f(0x1c0)])),0x1;console['log'](a4_0x5424b1[_0x47f53f(0x23b)](_0x47f53f(0x1f3)+_0x223a3f[_0x47f53f(0x1fb)]+_0x47f53f(0x216))),console[_0x47f53f(0x24c)](_0x47f53f(0x265)+_0x223a3f[_0x47f53f(0x22c)]);if(_0x223a3f[_0x47f53f(0x23f)]&&_0x223a3f[_0x47f53f(0x1f2)]){const _0x41203d=getLLMAgentChatUrl(_0x439da9,_0x223a3f['projectId'],_0x223a3f[_0x47f53f(0x23f)]);console[_0x47f53f(0x24c)](_0x47f53f(0x220)+a4_0x5424b1[_0x47f53f(0x1c5)](_0x41203d));}return 0x0;}const _0x5d7be6=_0x128540[_0x47f53f(0x20d)],_0x51e405=resolveProjectFromContext(_0x45974e,_0x5d7be6);if(_0x51e405['found'])_0x45974e=_0x51e405[_0x47f53f(0x23a)],_0x51e405[_0x47f53f(0x1f4)]===_0x47f53f(0x262)&&console[_0x47f53f(0x24c)](a4_0x5424b1['dim'](_0x47f53f(0x1ce)+_0x45974e));else{let _0x338d2d=_0x47f53f(0x1d6);_0x51e405[_0x47f53f(0x1d0)]===_0x47f53f(0x1e5)&&(_0x338d2d=_0x51e405[_0x47f53f(0x1d8)]+_0x47f53f(0x231)+_0x51e405[_0x47f53f(0x20d)]+_0x47f53f(0x268));throw new SDKError(ErrorCode[_0x47f53f(0x219)],_0x51e405[_0x47f53f(0x1d0)]===_0x47f53f(0x25f)?_0x51e405['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x45974e,undefined,{'helpText':_0x338d2d});}const {data:_0x5540b4}=await withSpinner(_0x47f53f(0x248),()=>_0xf45f78['llm'][_0x47f53f(0x251)](_0x45974e,{'dryRun':!![]})),_0x38b4bc=_0x5540b4['counts']['agents'][_0x47f53f(0x1e4)]>0x0;if(_0x38b4bc){console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1da)));for(const _0x6d9773 of _0x5540b4[_0x47f53f(0x230)]){_0x6d9773[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1de)+_0x6d9773[_0x47f53f(0x22c)]+_0x47f53f(0x1ca)+_0x6d9773['error']));}return 0x1;}const _0x326780=_0x5540b4['counts'][_0x47f53f(0x230)]['created']+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x210)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1d5)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)]['integrations']['created']+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)]['experimentalArtifacts'][_0x47f53f(0x26d)],_0x34b57c=_0x5540b4['counts'][_0x47f53f(0x230)][_0x47f53f(0x229)]+_0x5540b4[_0x47f53f(0x1bd)]['knowledgeBases']['updated']+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)][_0x47f53f(0x229)]+_0x5540b4[_0x47f53f(0x1bd)]['prompts'][_0x47f53f(0x229)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x223)][_0x47f53f(0x229)]+_0x5540b4['counts'][_0x47f53f(0x23d)][_0x47f53f(0x229)]+_0x5540b4['counts']['experimentalArtifacts'][_0x47f53f(0x229)],_0x383828=_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x230)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)]['knowledgeBases'][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)]['prompts'][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x223)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)][_0x47f53f(0x25c)];console[_0x47f53f(0x24c)](_0x47f53f(0x1e1)+_0x5540b4['projectName']+'\x27:'),console[_0x47f53f(0x24c)]('\x20\x20'+a4_0x5424b1[_0x47f53f(0x23b)]('+\x20'+_0x326780+_0x47f53f(0x250))+_0x47f53f(0x264)+a4_0x5424b1[_0x47f53f(0x263)]('~\x20'+_0x34b57c+'\x20changed')+_0x47f53f(0x264)+a4_0x5424b1[_0x47f53f(0x242)]('=\x20'+_0x383828+_0x47f53f(0x26a))),console[_0x47f53f(0x24c)](_0x47f53f(0x24e)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x230)])),console[_0x47f53f(0x24c)](_0x47f53f(0x271)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x210)])),console[_0x47f53f(0x24c)](_0x47f53f(0x22f)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)])),console[_0x47f53f(0x24c)](_0x47f53f(0x270)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1d5)])),console[_0x47f53f(0x24c)](_0x47f53f(0x217)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)]['integrations']));const _0x3047cd=_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)]['created']>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)][_0x47f53f(0x229)]>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)]['unchanged']>0x0||_0x5540b4[_0x47f53f(0x1bd)]['experimentalArtifacts']['created']>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)][_0x47f53f(0x229)]>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)][_0x47f53f(0x25c)]>0x0;_0x3047cd&&(console['log'](_0x47f53f(0x1bc)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)])),console[_0x47f53f(0x24c)](_0x47f53f(0x205)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)])));console[_0x47f53f(0x24c)](_0x47f53f(0x261)+a4_0x5424b1[_0x47f53f(0x1c5)](_0x45974e)),displayDiffs(_0x5540b4['agents'],_0x5540b4[_0x47f53f(0x210)],_0x5540b4[_0x47f53f(0x1fe)],_0x5540b4['prompts'],_0x5540b4[_0x47f53f(0x223)],_0x5540b4[_0x47f53f(0x23d)],_0x5540b4[_0x47f53f(0x1c7)]);if(_0x387c82)return console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x263)](_0x47f53f(0x1c3))),0x0;if(_0x326780===0x0&&_0x34b57c===0x0){console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x23b)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2bbd3b=getLLMProjectUrl(_0x439da9,_0x5540b4['projectId']);return console['log'](_0x47f53f(0x213)+a4_0x5424b1[_0x47f53f(0x1c5)](_0x2bbd3b)),0x0;}if(!_0x5e478e&&!_0xacfc3e){if(!isInteractive())return console[_0x47f53f(0x1c0)](a4_0x5424b1[_0x47f53f(0x1cf)]('\x0aError:'),_0x47f53f(0x1fc)),console[_0x47f53f(0x1c0)](a4_0x5424b1[_0x47f53f(0x242)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3148fe=await confirmKey(_0x47f53f(0x1dd)+(_0x326780+_0x34b57c)+_0x47f53f(0x215));if(!_0x3148fe)return console['log'](a4_0x5424b1['yellow'](_0x47f53f(0x21f)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x206921}=await withSpinner(_0x47f53f(0x252),()=>_0xf45f78[_0x47f53f(0x246)]['pushProject'](_0x45974e,{'force':_0xacfc3e})),_0x5d41cf=_0x206921[_0x47f53f(0x1bd)][_0x47f53f(0x230)][_0x47f53f(0x1e4)]>0x0||_0x206921['counts'][_0x47f53f(0x210)][_0x47f53f(0x1e4)]>0x0||_0x206921[_0x47f53f(0x1bd)]['textKnowledgeBases'][_0x47f53f(0x1e4)]>0x0||_0x206921[_0x47f53f(0x1bd)]['prompts'][_0x47f53f(0x1e4)]>0x0;if(_0x5d41cf){console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x263)](_0x47f53f(0x1c2))),console[_0x47f53f(0x24c)](),console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x206)));for(const _0x44a94c of _0x206921[_0x47f53f(0x230)]){_0x44a94c['action']===_0x47f53f(0x1c0)&&console['log'](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1de)+_0x44a94c[_0x47f53f(0x22c)]+'\x22:\x20'+_0x44a94c['error']));}for(const _0x41dc6a of _0x206921[_0x47f53f(0x210)]){_0x41dc6a[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console['log'](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1cb)+_0x41dc6a[_0x47f53f(0x1ee)]+'\x22:\x20'+_0x41dc6a[_0x47f53f(0x1c0)]));}for(const _0x51e128 of _0x206921[_0x47f53f(0x1fe)]){_0x51e128['action']===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1['red'](_0x47f53f(0x1d4)+_0x51e128['name']+_0x47f53f(0x1ca)+_0x51e128['error']));}for(const _0x5c7ff5 of _0x206921['prompts']){_0x5c7ff5[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x224)+_0x5c7ff5['name']+_0x47f53f(0x1ca)+_0x5c7ff5['error']));}for(const _0x362318 of _0x206921[_0x47f53f(0x223)]){_0x362318[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1['red'](_0x47f53f(0x24b)+_0x362318[_0x47f53f(0x1ee)]+'\x22:\x20'+_0x362318[_0x47f53f(0x1c0)]));}return 0x1;}console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x23b)](_0x47f53f(0x259)+(_0x326780+_0x34b57c)+_0x47f53f(0x1df)+_0x206921[_0x47f53f(0x236)]+'\x27'));const _0x2c72ab=getLLMProjectUrl(_0x439da9,_0x206921['projectId']);return console[_0x47f53f(0x24c)]('Project:\x20'+a4_0x5424b1[_0x47f53f(0x1c5)](_0x2c72ab)),0x0;}}
|
|
1
|
+
const a4_0x57942b=a4_0x1193;(function(_0x6bb450,_0x929fef){const _0x5943f6=a4_0x1193,_0x71768b=_0x6bb450();while(!![]){try{const _0x4487e3=parseInt(_0x5943f6(0xf6))/0x1*(-parseInt(_0x5943f6(0x11e))/0x2)+-parseInt(_0x5943f6(0xff))/0x3*(-parseInt(_0x5943f6(0x142))/0x4)+parseInt(_0x5943f6(0x12f))/0x5*(parseInt(_0x5943f6(0x140))/0x6)+-parseInt(_0x5943f6(0x129))/0x7*(parseInt(_0x5943f6(0x10c))/0x8)+-parseInt(_0x5943f6(0xb7))/0x9*(parseInt(_0x5943f6(0xc8))/0xa)+-parseInt(_0x5943f6(0x9a))/0xb+-parseInt(_0x5943f6(0x121))/0xc*(-parseInt(_0x5943f6(0xb6))/0xd);if(_0x4487e3===_0x929fef)break;else _0x71768b['push'](_0x71768b['shift']());}catch(_0x2b84c8){_0x71768b['push'](_0x71768b['shift']());}}}(a4_0x11e7,0x224f4));import a4_0x1a470e from'chalk';function a4_0x11e7(){const _0x280d3c=['\x20\x20Prompts:\x20','total','error','knowledgeBases','agents','log','site','Using\x20context\x20project:\x20','updated','gray','context','✔\x20Context\x20set:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Cloning\x20\x22','New\x20project:\x20','counts','\x22\x20to\x20a\x20different\x20profile','newProjectId','\x20\x20Agent\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x20--profile\x20','Summary:','Analyzing\x20project\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','272287nwDxIb','\x22\x20to\x20new\x20project\x20\x22','\x0aWrite\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aPush\x20','Failed\x20to\x20push\x20agent:\x20','pullProject','21iVzWWP','repeat','\x22\x20to\x20\x22','push','isNew','\x27\x20to\x20create\x20the\x20folder\x20structure.','yellow','diff','\x20\x20Target:\x20','Source:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','pushProject','session','2008uriNhu','\x20\x20Knowledge\x20Bases:\x20','\x20resources\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x0aProject\x20pushed\x20with\x20errors','agent:pull','Would\x20clone:','Writing\x20files...','Dry\x20run\x20-\x20no\x20files\x20written','\x20created','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20total','textKnowledgeBases','no_local_folder','\x20\x20Agents:\x20','Status:\x20','\x0a✔\x20Pushed\x20','Cancelled','2KwRuHh','outputPath','\x20\x20Text\x20Knowledge\x20Base\x20\x22','9191844udzwHA','experimentalArtifacts','Pushing\x20agent\x20from\x20\x22','-\x20nothing\x20pushed','prompts','\x20\x20Integration\x20\x22','red','\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','5579IFXNJE','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Using\x20current\x20project:\x20','projectId','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','10uvkcyl','New\x20project\x20name\x20is\x20required','-\x20no\x20files\x20written','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)','name','\x0aChanges\x20to\x20integration\x20\x27','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','utf-8','projectName','Agent\x20pulled\x20successfully','errors','message','Agent:\x20','experimentalKnowledgeBases','\x20successfully','cloneProject','\x0aError:','493530rpIWTJ','\x20updated','46108uMOvWT','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20project\x20from\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dryRun','\x20=\x20','MISSING_ARGUMENT','\x0aChanges:','Pushing\x20to\x20project...','created','Pulling\x20agent\x20\x22','\x20new','join','Chat:\x20','parse','action','Project\x20cloned\x20with\x20errors','tdx.json','\x0aPull\x20summary\x20for\x20\x27','1600170XlyysO','unchanged','llmProject','\x20\x20Source:\x20','\x20\x20Experimental\x20Artifacts:\x20','execute','force','sourceProjectName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Would\x20push\x20agent:\x20','\x20\x20Integrations:\x20','profile','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20resources?','agent.yml','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','new','newProjectName','yes','\x22...','\x20\x20Knowledge\x20Base\x20\x22','dirname','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20unchanged','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Using\x20local\x20project:\x20','cyan','13IroehU','3501AhCEaw','\x20--name\x20','llm','\x20\x20Experimental\x20Artifact\x20\x22','INVALID_ARGUMENT','llm_project','\x20|\x20','integrations','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Prompt\x20\x22','agentId','\x20files\x20to\x20','Clone\x20\x22','\x20changed','\x22\x20from\x20project\x20\x22','\x20files?','description','6500jiaBWz','agent:clone','Errors:','Would\x20pull\x20agent:\x20','dim','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','reason','agentName','\x22:\x20','output','green','Analyzing\x20changes\x20to\x20push...','agent:push','<new-name>','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','cwd','\x20\x20Text\x20Knowledge\x20Bases:\x20'];a4_0x11e7=function(){return _0x280d3c;};return a4_0x11e7();}import a4_0x5306a4 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(_0x1cef01){const _0x5db641=a4_0x1193,_0x575022=[];if(_0x1cef01['total']!==undefined)_0x575022[_0x5db641(0x102)](_0x1cef01[_0x5db641(0xde)]+_0x5db641(0x117));if(_0x1cef01['new']!==undefined&&_0x1cef01[_0x5db641(0xab)]>0x0)_0x575022[_0x5db641(0x102)](a4_0x1a470e[_0x5db641(0xd2)](_0x1cef01[_0x5db641(0xab)]+_0x5db641(0x14d)));if(_0x1cef01[_0x5db641(0x14b)]!==undefined&&_0x1cef01[_0x5db641(0x14b)]>0x0)_0x575022[_0x5db641(0x102)](a4_0x1a470e[_0x5db641(0xd2)](_0x1cef01[_0x5db641(0x14b)]+_0x5db641(0x115)));if(_0x1cef01['updated']!==undefined&&_0x1cef01['updated']>0x0)_0x575022[_0x5db641(0x102)](a4_0x1a470e[_0x5db641(0x105)](_0x1cef01[_0x5db641(0xe5)]+_0x5db641(0x141)));if(_0x1cef01[_0x5db641(0x9b)]!==undefined&&_0x1cef01[_0x5db641(0x9b)]>0x0)_0x575022['push'](a4_0x1a470e[_0x5db641(0xe6)](_0x1cef01[_0x5db641(0x9b)]+_0x5db641(0xb2)));if(_0x1cef01[_0x5db641(0x139)]!==undefined&&_0x1cef01[_0x5db641(0x139)]>0x0)_0x575022['push'](a4_0x1a470e['red'](_0x1cef01[_0x5db641(0x139)]+'\x20errors'));return _0x575022['join'](',\x20');}function displayDiffs(_0xfab9a1,_0x369c43,_0x8bf0dc,_0x13a694,_0xc3ffdc,_0xb08ba8,_0x5ea525){const _0x537403=a4_0x1193;for(const _0x1b74a1 of _0xfab9a1){if(_0x1b74a1[_0x537403(0x106)]){const _0x3ba20c=_0x1b74a1[_0x537403(0xcf)]||_0x1b74a1['name'];console[_0x537403(0xe2)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x3ba20c+'\x27:'),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)),console[_0x537403(0xe2)](_0x1b74a1[_0x537403(0x106)]),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c));}}for(const _0x1c79f of _0x369c43){_0x1c79f[_0x537403(0x106)]&&(console[_0x537403(0xe2)](_0x537403(0xcd)+_0x1c79f[_0x537403(0x133)]+'\x27:'),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)),console['log'](_0x1c79f[_0x537403(0x106)]),console[_0x537403(0xe2)]('─'['repeat'](0x3c)));}for(const _0x228df6 of _0x8bf0dc){_0x228df6['diff']&&(console['log'](_0x537403(0xf5)+_0x228df6[_0x537403(0x133)]+'\x27:'),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)),console[_0x537403(0xe2)](_0x228df6[_0x537403(0x106)]),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)));}for(const _0xfbfabc of _0x13a694){_0xfbfabc['diff']&&(console[_0x537403(0xe2)](_0x537403(0xd9)+_0xfbfabc[_0x537403(0x133)]+'\x27:'),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)),console[_0x537403(0xe2)](_0xfbfabc[_0x537403(0x106)]),console['log']('─'[_0x537403(0x100)](0x3c)));}for(const _0x1a356e of _0xc3ffdc){_0x1a356e[_0x537403(0x106)]&&(console['log'](_0x537403(0x134)+_0x1a356e['name']+'\x27:'),console[_0x537403(0xe2)]('─'['repeat'](0x3c)),console[_0x537403(0xe2)](_0x1a356e[_0x537403(0x106)]),console[_0x537403(0xe2)]('─'['repeat'](0x3c)));}for(const _0x308dab of _0xb08ba8){_0x308dab['diff']&&(console['log'](_0x537403(0x12b)+_0x308dab['name']+'\x27:'),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)),console[_0x537403(0xe2)](_0x308dab['diff']),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)));}for(const _0x1594b3 of _0x5ea525){_0x1594b3[_0x537403(0x106)]&&(console['log'](_0x537403(0x135)+_0x1594b3[_0x537403(0x133)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x1594b3['diff']),console[_0x537403(0xe2)]('─'[_0x537403(0x100)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x57942b(0x133)]=a4_0x57942b(0x111);['description']=a4_0x57942b(0xb3);async[a4_0x57942b(0x9f)](_0x12d6bb){const _0x5cc427=a4_0x57942b,{options:_0x290ca8,args:_0x4343e1,tdx:_0x1851fa}=_0x12d6bb,_0x4921eb=_0x4343e1[0x0],_0xe0183f=_0x4343e1[0x1],_0x2f5ebb=_0x290ca8[_0x5cc427(0xd1)],_0xbb966b=_0x290ca8[_0x5cc427(0x146)],_0x58c910=_0x290ca8[_0x5cc427(0xa0)],_0x16773e=_0x290ca8[_0x5cc427(0xad)],_0x3ec1a9=_0x290ca8[_0x5cc427(0x9c)];let _0x51c70f,_0x200360;const _0x3ec22c=findAgentConfigPath(process[_0x5cc427(0xdb)]());if(_0x4921eb){const _0x49b3b9=a4_0x5306a4[_0x5cc427(0x14e)](_0x4921eb,'tdx.json');if(existsSync(_0x49b3b9))try{const _0x4aa80c=JSON[_0x5cc427(0x95)](readFileSync(_0x49b3b9,_0x5cc427(0x136)));_0x51c70f=_0x4aa80c[_0x5cc427(0xbc)],_0x200360=_0x4921eb,console[_0x5cc427(0xe2)](a4_0x1a470e['dim'](_0x5cc427(0x144)+_0x49b3b9+':\x20'+_0x51c70f));}catch{_0x51c70f=_0x4921eb;}else _0x51c70f=_0x4921eb;}else{if(_0x3ec22c)try{const _0x35ebcc=JSON[_0x5cc427(0x95)](readFileSync(_0x3ec22c,_0x5cc427(0x136)));_0x51c70f=_0x35ebcc[_0x5cc427(0xbc)],_0x200360=a4_0x5306a4[_0x5cc427(0xb0)](_0x3ec22c),console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0xcc)]('Using\x20project:\x20'+_0x51c70f));}catch{_0x51c70f=_0x3ec1a9;}else _0x51c70f=_0x3ec1a9;}if(!_0x51c70f)return console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0x105)](_0x5cc427(0xaa))),console[_0x5cc427(0xe2)](_0x5cc427(0x132)),console[_0x5cc427(0xe2)](_0x5cc427(0x10f)),console[_0x5cc427(0xe2)](_0x5cc427(0x128)),console['log'](_0x5cc427(0xf1)),0x1;if(_0xe0183f){const {data:_0x1e3001}=await withSpinner(_0x5cc427(0x14c)+_0xe0183f+_0x5cc427(0xc5)+_0x51c70f+'\x22...',()=>_0x1851fa[_0x5cc427(0xb9)]['pullAgent'](_0x51c70f,_0xe0183f,_0x2f5ebb,{'dryRun':_0xbb966b,'force':_0x58c910}));if(_0xbb966b)return console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0x105)](_0x5cc427(0x114))),console[_0x5cc427(0xe2)](_0x5cc427(0xcb)+_0x1e3001[_0x5cc427(0xcf)]),console[_0x5cc427(0xe2)]('Output\x20path:\x20'+_0x1e3001[_0x5cc427(0x11f)]),_0x1e3001[_0x5cc427(0x106)]&&(console[_0x5cc427(0xe2)](_0x5cc427(0x149)),console[_0x5cc427(0xe2)]('─'[_0x5cc427(0x100)](0x3c)),console[_0x5cc427(0xe2)](_0x1e3001['diff']),console[_0x5cc427(0xe2)]('─'[_0x5cc427(0x100)](0x3c))),0x0;return console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0xd2)](_0x5cc427(0x138))),console['log'](_0x5cc427(0x13b)+_0x1e3001[_0x5cc427(0xcf)]),console['log']('Output:\x20'+_0x1e3001[_0x5cc427(0x11f)]),console[_0x5cc427(0xe2)](_0x5cc427(0x11b)+(_0x1e3001[_0x5cc427(0x103)]?a4_0x1a470e['green']('new'):_0x1e3001['hasChanges']?a4_0x1a470e[_0x5cc427(0x105)]('updated'):a4_0x1a470e[_0x5cc427(0xe6)](_0x5cc427(0x9b)))),0x0;}const _0x39e869=_0x200360||_0x2f5ebb,{data:_0x44155d}=await withSpinner(_0x5cc427(0xf4)+_0x51c70f+_0x5cc427(0xae),()=>_0x1851fa['llm'][_0x5cc427(0xfe)](_0x51c70f,_0x39e869,{'dryRun':!![]})),_0x5b7075=_0x44155d[_0x5cc427(0xed)][_0x5cc427(0xe1)][_0x5cc427(0xab)]+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0xe0)]['new']+_0x44155d['counts']['textKnowledgeBases'][_0x5cc427(0xab)]+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x125)][_0x5cc427(0xab)]+_0x44155d[_0x5cc427(0xed)]['integrations']['new']+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x13c)]['new']+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x122)][_0x5cc427(0xab)],_0x40fb8d=_0x44155d['counts'][_0x5cc427(0xe1)][_0x5cc427(0xe5)]+_0x44155d[_0x5cc427(0xed)]['knowledgeBases'][_0x5cc427(0xe5)]+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x118)]['updated']+_0x44155d['counts'][_0x5cc427(0x125)][_0x5cc427(0xe5)]+_0x44155d['counts'][_0x5cc427(0xbe)][_0x5cc427(0xe5)]+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x13c)][_0x5cc427(0xe5)]+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x122)][_0x5cc427(0xe5)],_0x45ad85=_0x44155d[_0x5cc427(0xed)][_0x5cc427(0xe1)][_0x5cc427(0x9b)]+_0x44155d['counts'][_0x5cc427(0xe0)]['unchanged']+_0x44155d[_0x5cc427(0xed)]['textKnowledgeBases'][_0x5cc427(0x9b)]+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x125)][_0x5cc427(0x9b)]+_0x44155d[_0x5cc427(0xed)][_0x5cc427(0xbe)][_0x5cc427(0x9b)]+_0x44155d[_0x5cc427(0xed)]['experimentalKnowledgeBases'][_0x5cc427(0x9b)]+_0x44155d[_0x5cc427(0xed)]['experimentalArtifacts']['unchanged'];console[_0x5cc427(0xe2)](_0x5cc427(0x99)+_0x44155d['projectName']+'\x27:'),console[_0x5cc427(0xe2)]('\x20\x20'+a4_0x1a470e[_0x5cc427(0xd2)]('+\x20'+_0x5b7075+_0x5cc427(0x14d))+_0x5cc427(0xbd)+a4_0x1a470e[_0x5cc427(0x105)]('~\x20'+_0x40fb8d+_0x5cc427(0xc4))+'\x20|\x20'+a4_0x1a470e[_0x5cc427(0xcc)]('=\x20'+_0x45ad85+_0x5cc427(0xb2))),console[_0x5cc427(0xe2)]('\x20\x20Agents:\x20'+formatCountSummary(_0x44155d['counts'][_0x5cc427(0xe1)])),console[_0x5cc427(0xe2)](_0x5cc427(0x10d)+formatCountSummary(_0x44155d[_0x5cc427(0xed)]['knowledgeBases'])),console[_0x5cc427(0xe2)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x44155d[_0x5cc427(0xed)]['textKnowledgeBases'])),console[_0x5cc427(0xe2)](_0x5cc427(0xdd)+formatCountSummary(_0x44155d['counts'][_0x5cc427(0x125)])),console[_0x5cc427(0xe2)](_0x5cc427(0xa4)+formatCountSummary(_0x44155d[_0x5cc427(0xed)]['integrations']));const _0x1d976c=_0x44155d['counts'][_0x5cc427(0x13c)][_0x5cc427(0xde)]>0x0||_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x122)][_0x5cc427(0xde)]>0x0;_0x1d976c&&(console[_0x5cc427(0xe2)](_0x5cc427(0xa6)+formatCountSummary(_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x13c)])),console['log'](_0x5cc427(0x9e)+formatCountSummary(_0x44155d[_0x5cc427(0xed)][_0x5cc427(0x122)])));console['log'](_0x5cc427(0x107)+a4_0x1a470e[_0x5cc427(0xb5)](_0x44155d['outputDir'])),displayDiffs(_0x44155d[_0x5cc427(0xe1)],_0x44155d[_0x5cc427(0xe0)],_0x44155d[_0x5cc427(0x118)],_0x44155d['prompts'],_0x44155d[_0x5cc427(0xbe)],_0x44155d[_0x5cc427(0x13c)],_0x44155d[_0x5cc427(0x122)]);if(_0xbb966b)return console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0x105)](_0x5cc427(0xa2))),0x0;if(_0x5b7075===0x0&&_0x40fb8d===0x0)return console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0xd2)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x44155d[_0x5cc427(0x137)]},_0x290ca8['session']),console['log'](a4_0x1a470e[_0x5cc427(0xd2)]('✔\x20Context\x20set:\x20'+a4_0x1a470e[_0x5cc427(0xcc)](_0x5cc427(0xbc))+_0x5cc427(0x147)+a4_0x1a470e[_0x5cc427(0xb5)](_0x44155d[_0x5cc427(0x137)]))),0x0;if(!_0x16773e&&!_0x58c910){if(!isInteractive())return console[_0x5cc427(0xdf)](a4_0x1a470e[_0x5cc427(0x127)](_0x5cc427(0x13f)),_0x5cc427(0x145)),console[_0x5cc427(0xdf)](a4_0x1a470e['dim'](_0x5cc427(0xf9))),0x1;const _0x4774a0=await confirmKey(_0x5cc427(0xf8)+(_0x5b7075+_0x40fb8d)+_0x5cc427(0xc6));if(!_0x4774a0)return console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0x105)](_0x5cc427(0x11d)),_0x5cc427(0x131)),0x1;}const {data:_0x4fe9b4}=await withSpinner(_0x5cc427(0x113),()=>_0x1851fa['llm'][_0x5cc427(0xfe)](_0x51c70f,_0x39e869,{'force':_0x58c910}));return console['log'](a4_0x1a470e['green']('\x0a✔\x20Pulled\x20'+(_0x5b7075+_0x40fb8d)+_0x5cc427(0xc2)+_0x4fe9b4['outputDir'])),saveSessionContext({'llm_project':_0x4fe9b4[_0x5cc427(0x137)]},_0x290ca8[_0x5cc427(0x10b)]),console[_0x5cc427(0xe2)](a4_0x1a470e[_0x5cc427(0xd2)](_0x5cc427(0xe8)+a4_0x1a470e[_0x5cc427(0xcc)](_0x5cc427(0xbc))+'\x20=\x20'+a4_0x1a470e[_0x5cc427(0xb5)](_0x4fe9b4[_0x5cc427(0x137)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x57942b(0xc9);['description']=a4_0x57942b(0x143);async[a4_0x57942b(0x9f)](_0x4c8fcc){const _0x3f01a2=a4_0x57942b,{options:_0x3cb567,args:_0x3c4d26,tdx:_0x4779fe}=_0x4c8fcc,_0x25e770=_0x3c4d26[0x0],_0x7ba022=_0x3cb567[_0x3f01a2(0x133)],_0xe17f90=_0x3cb567[_0x3f01a2(0x146)],_0x2c6d39=_0x3cb567[_0x3f01a2(0xad)],_0x294c83=_0x3cb567[_0x3f01a2(0xe3)],_0x420223=_0x3cb567[_0x3f01a2(0x9c)];let _0x1e4d40;const _0x58375a=findAgentConfigPath(process[_0x3f01a2(0xdb)]());if(_0x25e770){const _0x163b71=a4_0x5306a4['join'](_0x25e770,_0x3f01a2(0x98));existsSync(_0x163b71)?(_0x1e4d40=_0x25e770,console['log'](a4_0x1a470e[_0x3f01a2(0xcc)](_0x3f01a2(0xb4)+_0x25e770))):_0x1e4d40=_0x25e770;}else{if(_0x58375a)_0x1e4d40=a4_0x5306a4[_0x3f01a2(0xb0)](_0x58375a),console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0xcc)](_0x3f01a2(0x12c)+_0x1e4d40));else{if(_0x420223){const _0x54d2f6=sanitizeForFilesystem(_0x420223);let _0x1f0221=_0x54d2f6,_0x56cb1f=a4_0x5306a4['join'](process[_0x3f01a2(0xdb)](),_0x3f01a2(0xe1),_0x54d2f6,_0x3f01a2(0x98));if(!existsSync(_0x56cb1f)){const _0x2dd9cc=normalizeName(_0x420223),_0x4f65ae=a4_0x5306a4['join'](process[_0x3f01a2(0xdb)](),_0x3f01a2(0xe1),_0x2dd9cc,_0x3f01a2(0x98));existsSync(_0x4f65ae)&&(_0x1f0221=_0x2dd9cc,_0x56cb1f=_0x4f65ae);}if(existsSync(_0x56cb1f))_0x1e4d40=a4_0x5306a4['dirname'](_0x56cb1f),console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0xcc)](_0x3f01a2(0xb4)+_0x1e4d40));else{const _0x415e15=_0x3cb567[_0x3f01a2(0xa5)];if(_0x415e15)throw new SDKError(ErrorCode[_0x3f01a2(0xbb)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x420223+_0x3f01a2(0xee),undefined,{'helpText':_0x3f01a2(0x12e)+_0x3f01a2(0xd6)+(_0x3f01a2(0xd8)+_0x420223+'\x0a')+(_0x3f01a2(0x116)+_0x1f0221+_0x3f01a2(0xb8)+(_0x7ba022||_0x3f01a2(0xd5))+_0x3f01a2(0xf2)+_0x415e15)});_0x1e4d40=_0x420223,console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0xcc)](_0x3f01a2(0xe4)+_0x420223));}}}}if(!_0x1e4d40)return console['log'](a4_0x1a470e[_0x3f01a2(0x105)](_0x3f01a2(0xe9))),console[_0x3f01a2(0xe2)](_0x3f01a2(0xd7)),console['log'](_0x3f01a2(0x12a)),console[_0x3f01a2(0xe2)]('\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[_0x3f01a2(0xe2)](_0x3f01a2(0xea)),0x1;if(!_0x7ba022)throw new SDKError(ErrorCode[_0x3f01a2(0x148)],_0x3f01a2(0x130),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x2c6d39&&!_0xe17f90){if(!isInteractive())return console[_0x3f01a2(0xdf)](a4_0x1a470e['red'](_0x3f01a2(0x13f)),_0x3f01a2(0x145)),console[_0x3f01a2(0xdf)](a4_0x1a470e[_0x3f01a2(0xcc)](_0x3f01a2(0xf9))),0x1;const _0x4ff64b=await confirmKey(_0x3f01a2(0xc3)+_0x1e4d40+_0x3f01a2(0xf7)+_0x7ba022+'\x22?');if(!_0x4ff64b)return console['log'](a4_0x1a470e[_0x3f01a2(0x105)](_0x3f01a2(0x11d))),0x1;}const {data:_0x5b781c}=await withSpinner(_0x3f01a2(0xeb)+_0x1e4d40+_0x3f01a2(0x101)+_0x7ba022+_0x3f01a2(0xae),()=>_0x4779fe[_0x3f01a2(0xb9)][_0x3f01a2(0x13e)](_0x1e4d40,_0x7ba022,{'dryRun':_0xe17f90}));if(_0xe17f90){console['log'](a4_0x1a470e[_0x3f01a2(0x105)](_0x3f01a2(0x109))),console['log'](_0x3f01a2(0x108)+_0x5b781c[_0x3f01a2(0xa1)]),console[_0x3f01a2(0xe2)]('New\x20project:\x20'+_0x7ba022),console[_0x3f01a2(0xe2)](_0x3f01a2(0x112)),console[_0x3f01a2(0xe2)](_0x3f01a2(0x11a)+_0x5b781c['counts'][_0x3f01a2(0xe1)][_0x3f01a2(0x14b)]),console[_0x3f01a2(0xe2)](_0x3f01a2(0x10d)+_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0xe0)][_0x3f01a2(0x14b)]),console[_0x3f01a2(0xe2)]('\x20\x20Prompts:\x20'+_0x5b781c[_0x3f01a2(0xed)]['prompts']['created']);const _0x266b74=_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x13c)][_0x3f01a2(0x14b)]>0x0||_0x5b781c['counts'][_0x3f01a2(0x122)][_0x3f01a2(0x14b)]>0x0;return _0x266b74&&(console[_0x3f01a2(0xe2)](_0x3f01a2(0xa6)+_0x5b781c[_0x3f01a2(0xed)]['experimentalKnowledgeBases']['created']),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x5b781c[_0x3f01a2(0xed)]['experimentalArtifacts'][_0x3f01a2(0x14b)])),0x0;}const _0x23a0f0=_0x5b781c[_0x3f01a2(0xed)]['agents'][_0x3f01a2(0x139)]>0x0||_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0xe0)][_0x3f01a2(0x139)]>0x0||_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x125)]['errors']>0x0||_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x13c)][_0x3f01a2(0x139)]>0x0||_0x5b781c[_0x3f01a2(0xed)]['experimentalArtifacts'][_0x3f01a2(0x139)]>0x0;_0x23a0f0?console[_0x3f01a2(0xe2)](a4_0x1a470e['yellow'](_0x3f01a2(0x97))):console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0xd2)]('Project\x20cloned\x20successfully'));console[_0x3f01a2(0xe2)](_0x3f01a2(0x108)+_0x5b781c['sourceProjectName']),console[_0x3f01a2(0xe2)](_0x3f01a2(0xec)+_0x5b781c[_0x3f01a2(0xac)]),console[_0x3f01a2(0xe2)]('New\x20project\x20ID:\x20'+_0x5b781c[_0x3f01a2(0xef)]),console[_0x3f01a2(0xe2)](),console[_0x3f01a2(0xe2)](_0x3f01a2(0xf3)),console[_0x3f01a2(0xe2)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0xe1)])),console['log'](_0x3f01a2(0x10d)+formatCountSummary(_0x5b781c['counts']['knowledgeBases'])),console[_0x3f01a2(0xe2)](_0x3f01a2(0xdd)+formatCountSummary(_0x5b781c['counts'][_0x3f01a2(0x125)])),console[_0x3f01a2(0xe2)](_0x3f01a2(0xa4)+formatCountSummary(_0x5b781c[_0x3f01a2(0xed)]['integrations']));const _0x1b1715=_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x13c)][_0x3f01a2(0x14b)]>0x0||_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x13c)]['updated']>0x0||_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x13c)]['unchanged']>0x0||_0x5b781c[_0x3f01a2(0xed)]['experimentalArtifacts'][_0x3f01a2(0x14b)]>0x0||_0x5b781c[_0x3f01a2(0xed)]['experimentalArtifacts'][_0x3f01a2(0xe5)]>0x0||_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x122)][_0x3f01a2(0x9b)]>0x0;_0x1b1715&&(console[_0x3f01a2(0xe2)](_0x3f01a2(0xa6)+formatCountSummary(_0x5b781c['counts'][_0x3f01a2(0x13c)])),console[_0x3f01a2(0xe2)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5b781c[_0x3f01a2(0xed)][_0x3f01a2(0x122)])));if(_0x23a0f0){console['log'](),console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0x127)](_0x3f01a2(0xca)));for(const _0x3ee8ec of _0x5b781c[_0x3f01a2(0xe1)]){_0x3ee8ec[_0x3f01a2(0x96)]===_0x3f01a2(0xdf)&&console[_0x3f01a2(0xe2)](a4_0x1a470e['red'](_0x3f01a2(0xf0)+_0x3ee8ec['agentName']+_0x3f01a2(0xd0)+_0x3ee8ec[_0x3f01a2(0xdf)]));}for(const _0x4e7aba of _0x5b781c[_0x3f01a2(0xe0)]){_0x4e7aba['action']==='error'&&console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0x127)](_0x3f01a2(0xaf)+_0x4e7aba[_0x3f01a2(0x133)]+_0x3f01a2(0xd0)+_0x4e7aba[_0x3f01a2(0xdf)]));}for(const _0x4fcd6b of _0x5b781c[_0x3f01a2(0x125)]){_0x4fcd6b[_0x3f01a2(0x96)]===_0x3f01a2(0xdf)&&console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0x127)](_0x3f01a2(0xc0)+_0x4fcd6b[_0x3f01a2(0x133)]+'\x22:\x20'+_0x4fcd6b['error']));}for(const _0xcd8396 of _0x5b781c[_0x3f01a2(0xbe)]){_0xcd8396[_0x3f01a2(0x96)]===_0x3f01a2(0xdf)&&console[_0x3f01a2(0xe2)](a4_0x1a470e['red'](_0x3f01a2(0x126)+_0xcd8396[_0x3f01a2(0x133)]+_0x3f01a2(0xd0)+_0xcd8396[_0x3f01a2(0xdf)]));}for(const _0x576d2b of _0x5b781c[_0x3f01a2(0x13c)]){_0x576d2b[_0x3f01a2(0x96)]===_0x3f01a2(0xdf)&&console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0x127)](_0x3f01a2(0xbf)+_0x576d2b[_0x3f01a2(0x133)]+_0x3f01a2(0xd0)+_0x576d2b[_0x3f01a2(0xdf)]));}for(const _0x4ada3f of _0x5b781c[_0x3f01a2(0x122)]){_0x4ada3f[_0x3f01a2(0x96)]===_0x3f01a2(0xdf)&&console[_0x3f01a2(0xe2)](a4_0x1a470e[_0x3f01a2(0x127)](_0x3f01a2(0xba)+_0x4ada3f[_0x3f01a2(0x133)]+_0x3f01a2(0xd0)+_0x4ada3f['error']));}return 0x1;}console[_0x3f01a2(0xe2)]();const _0x941362=getLLMProjectUrl(_0x294c83,_0x5b781c[_0x3f01a2(0xef)]);return console[_0x3f01a2(0xe2)]('Project:\x20'+a4_0x1a470e[_0x3f01a2(0xb5)](_0x941362)),0x0;}}function a4_0x1193(_0x192d5c,_0x39fc60){_0x192d5c=_0x192d5c-0x94;const _0x11e76c=a4_0x11e7();let _0x119334=_0x11e76c[_0x192d5c];return _0x119334;}export class AgentPushCommand extends BaseCommand{['name']=a4_0x57942b(0xd4);[a4_0x57942b(0xc7)]=a4_0x57942b(0xb1);async[a4_0x57942b(0x9f)](_0x1e9107){const _0x303596=a4_0x57942b,{options:_0xad6971,args:_0x43f180,tdx:_0x1d0b36}=_0x1e9107;let _0x5c6055=_0x43f180[0x0]||process['cwd']();const _0x42b0c7=_0xad6971[_0x303596(0x146)],_0x1f1c5e=_0xad6971['force'],_0x1e751c=_0xad6971[_0x303596(0xad)],_0x17c229=_0xad6971[_0x303596(0xe3)],_0x5bcfff=a4_0x5306a4[_0x303596(0x14e)](_0x5c6055,_0x303596(0xa8)),_0xab87bf=existsSync(_0x5bcfff);if(_0xab87bf){const {data:_0x20dd49}=await withSpinner(_0x303596(0x123)+_0x5c6055+'\x22...',()=>_0x1d0b36[_0x303596(0xb9)]['pushAgent'](_0x5c6055,{'dryRun':_0x42b0c7,'force':_0x1f1c5e}));if(_0x42b0c7)return console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x105)](_0x303596(0x109))),console['log'](_0x303596(0xa3)+_0x20dd49['agentName']),0x0;if(_0x20dd49[_0x303596(0x96)]===_0x303596(0xdf))return console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x127)](_0x303596(0xfd)+_0x20dd49[_0x303596(0xdf)])),0x1;console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0xd2)]('Agent\x20'+_0x20dd49[_0x303596(0x96)]+_0x303596(0x13d))),console[_0x303596(0xe2)]('Agent:\x20'+_0x20dd49['agentName']);if(_0x20dd49['agentId']&&_0x20dd49['projectId']){const _0x14f959=getLLMAgentChatUrl(_0x17c229,_0x20dd49[_0x303596(0x12d)],_0x20dd49[_0x303596(0xc1)]);console['log'](_0x303596(0x94)+a4_0x1a470e[_0x303596(0xb5)](_0x14f959));}return 0x0;}const _0x2c2793=_0xad6971[_0x303596(0x9c)],_0x25759f=resolveProjectFromContext(_0x5c6055,_0x2c2793);if(_0x25759f['found'])_0x5c6055=_0x25759f['projectDir'],_0x25759f[_0x303596(0xfa)]===_0x303596(0xe7)&&console[_0x303596(0xe2)](a4_0x1a470e['dim']('Using\x20project:\x20'+_0x5c6055));else{let _0x5db77f=_0x303596(0xfb);_0x25759f[_0x303596(0xce)]===_0x303596(0x119)&&(_0x5db77f=_0x25759f[_0x303596(0x13a)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x25759f[_0x303596(0x9c)]+_0x303596(0x104));throw new SDKError(ErrorCode[_0x303596(0xbb)],_0x25759f[_0x303596(0xce)]==='no_context'?_0x25759f[_0x303596(0x13a)]:'No\x20tdx.json\x20found\x20in\x20'+_0x5c6055,undefined,{'helpText':_0x5db77f});}const {data:_0xf629cc}=await withSpinner(_0x303596(0xd3),()=>_0x1d0b36[_0x303596(0xb9)][_0x303596(0x10a)](_0x5c6055,{'dryRun':!![]})),_0x58a29d=_0xf629cc[_0x303596(0xed)]['agents'][_0x303596(0x139)]>0x0;if(_0x58a29d){console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x127)]('\x0aErrors\x20found:'));for(const _0x3e8adb of _0xf629cc[_0x303596(0xe1)]){_0x3e8adb[_0x303596(0x96)]===_0x303596(0xdf)&&console['log'](a4_0x1a470e[_0x303596(0x127)](_0x303596(0xf0)+_0x3e8adb[_0x303596(0xcf)]+_0x303596(0xd0)+_0x3e8adb[_0x303596(0xdf)]));}return 0x1;}const _0x27b50e=_0xf629cc[_0x303596(0xed)][_0x303596(0xe1)][_0x303596(0x14b)]+_0xf629cc[_0x303596(0xed)][_0x303596(0xe0)][_0x303596(0x14b)]+_0xf629cc['counts'][_0x303596(0x118)]['created']+_0xf629cc[_0x303596(0xed)][_0x303596(0x125)][_0x303596(0x14b)]+_0xf629cc['counts'][_0x303596(0xbe)][_0x303596(0x14b)]+_0xf629cc[_0x303596(0xed)][_0x303596(0x13c)][_0x303596(0x14b)]+_0xf629cc['counts'][_0x303596(0x122)][_0x303596(0x14b)],_0x352c34=_0xf629cc[_0x303596(0xed)]['agents']['updated']+_0xf629cc['counts'][_0x303596(0xe0)][_0x303596(0xe5)]+_0xf629cc[_0x303596(0xed)]['textKnowledgeBases'][_0x303596(0xe5)]+_0xf629cc[_0x303596(0xed)][_0x303596(0x125)][_0x303596(0xe5)]+_0xf629cc['counts'][_0x303596(0xbe)]['updated']+_0xf629cc[_0x303596(0xed)]['experimentalKnowledgeBases'][_0x303596(0xe5)]+_0xf629cc[_0x303596(0xed)][_0x303596(0x122)][_0x303596(0xe5)],_0x193b1d=_0xf629cc[_0x303596(0xed)]['agents'][_0x303596(0x9b)]+_0xf629cc['counts']['knowledgeBases'][_0x303596(0x9b)]+_0xf629cc[_0x303596(0xed)][_0x303596(0x118)][_0x303596(0x9b)]+_0xf629cc[_0x303596(0xed)][_0x303596(0x125)][_0x303596(0x9b)]+_0xf629cc['counts'][_0x303596(0xbe)][_0x303596(0x9b)]+_0xf629cc[_0x303596(0xed)][_0x303596(0x13c)]['unchanged']+_0xf629cc[_0x303596(0xed)]['experimentalArtifacts'][_0x303596(0x9b)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0xf629cc[_0x303596(0x137)]+'\x27:'),console['log']('\x20\x20'+a4_0x1a470e[_0x303596(0xd2)]('+\x20'+_0x27b50e+_0x303596(0x14d))+_0x303596(0xbd)+a4_0x1a470e[_0x303596(0x105)]('~\x20'+_0x352c34+'\x20changed')+_0x303596(0xbd)+a4_0x1a470e[_0x303596(0xcc)]('=\x20'+_0x193b1d+_0x303596(0xb2))),console['log'](_0x303596(0x11a)+formatCountSummary(_0xf629cc[_0x303596(0xed)]['agents'])),console[_0x303596(0xe2)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xf629cc[_0x303596(0xed)][_0x303596(0xe0)])),console[_0x303596(0xe2)](_0x303596(0xdc)+formatCountSummary(_0xf629cc['counts'][_0x303596(0x118)])),console['log'](_0x303596(0xdd)+formatCountSummary(_0xf629cc[_0x303596(0xed)][_0x303596(0x125)])),console[_0x303596(0xe2)](_0x303596(0xa4)+formatCountSummary(_0xf629cc[_0x303596(0xed)][_0x303596(0xbe)]));const _0x44bec6=_0xf629cc[_0x303596(0xed)]['experimentalKnowledgeBases'][_0x303596(0x14b)]>0x0||_0xf629cc['counts']['experimentalKnowledgeBases']['updated']>0x0||_0xf629cc[_0x303596(0xed)]['experimentalKnowledgeBases'][_0x303596(0x9b)]>0x0||_0xf629cc['counts'][_0x303596(0x122)]['created']>0x0||_0xf629cc['counts'][_0x303596(0x122)][_0x303596(0xe5)]>0x0||_0xf629cc[_0x303596(0xed)][_0x303596(0x122)][_0x303596(0x9b)]>0x0;_0x44bec6&&(console[_0x303596(0xe2)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xf629cc['counts'][_0x303596(0x13c)])),console['log'](_0x303596(0x9e)+formatCountSummary(_0xf629cc[_0x303596(0xed)][_0x303596(0x122)])));console[_0x303596(0xe2)](_0x303596(0x9d)+a4_0x1a470e[_0x303596(0xb5)](_0x5c6055)),displayDiffs(_0xf629cc[_0x303596(0xe1)],_0xf629cc[_0x303596(0xe0)],_0xf629cc[_0x303596(0x118)],_0xf629cc[_0x303596(0x125)],_0xf629cc['integrations'],_0xf629cc[_0x303596(0x13c)],_0xf629cc['experimentalArtifacts']);if(_0x42b0c7)return console['log'](a4_0x1a470e[_0x303596(0x105)](_0x303596(0xda))),0x0;if(_0x27b50e===0x0&&_0x352c34===0x0){console['log'](a4_0x1a470e[_0x303596(0xd2)](_0x303596(0xa9)));const _0x41211c=getLLMProjectUrl(_0x17c229,_0xf629cc[_0x303596(0x12d)]);return console['log']('Project:\x20'+a4_0x1a470e['cyan'](_0x41211c)),0x0;}if(!_0x1e751c&&!_0x1f1c5e){if(!isInteractive())return console[_0x303596(0xdf)](a4_0x1a470e[_0x303596(0x127)](_0x303596(0x13f)),_0x303596(0x145)),console[_0x303596(0xdf)](a4_0x1a470e['dim'](_0x303596(0xf9))),0x1;const _0x494d4f=await confirmKey(_0x303596(0xfc)+(_0x27b50e+_0x352c34)+_0x303596(0xa7));if(!_0x494d4f)return console['log'](a4_0x1a470e[_0x303596(0x105)](_0x303596(0x11d)),_0x303596(0x124)),0x1;}const {data:_0x4127c3}=await withSpinner(_0x303596(0x14a),()=>_0x1d0b36[_0x303596(0xb9)][_0x303596(0x10a)](_0x5c6055,{'force':_0x1f1c5e})),_0x112464=_0x4127c3[_0x303596(0xed)][_0x303596(0xe1)][_0x303596(0x139)]>0x0||_0x4127c3[_0x303596(0xed)][_0x303596(0xe0)][_0x303596(0x139)]>0x0||_0x4127c3[_0x303596(0xed)][_0x303596(0x118)][_0x303596(0x139)]>0x0||_0x4127c3[_0x303596(0xed)][_0x303596(0x125)]['errors']>0x0;if(_0x112464){console[_0x303596(0xe2)](a4_0x1a470e['yellow'](_0x303596(0x110))),console[_0x303596(0xe2)](),console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x127)](_0x303596(0xca)));for(const _0xe5d5d4 of _0x4127c3[_0x303596(0xe1)]){_0xe5d5d4[_0x303596(0x96)]===_0x303596(0xdf)&&console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x127)]('\x20\x20Agent\x20\x22'+_0xe5d5d4['agentName']+_0x303596(0xd0)+_0xe5d5d4[_0x303596(0xdf)]));}for(const _0x49baa7 of _0x4127c3[_0x303596(0xe0)]){_0x49baa7[_0x303596(0x96)]==='error'&&console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x127)](_0x303596(0xaf)+_0x49baa7[_0x303596(0x133)]+_0x303596(0xd0)+_0x49baa7[_0x303596(0xdf)]));}for(const _0x4bccd6 of _0x4127c3[_0x303596(0x118)]){_0x4bccd6[_0x303596(0x96)]===_0x303596(0xdf)&&console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x127)](_0x303596(0x120)+_0x4bccd6[_0x303596(0x133)]+'\x22:\x20'+_0x4bccd6[_0x303596(0xdf)]));}for(const _0x217941 of _0x4127c3['prompts']){_0x217941['action']===_0x303596(0xdf)&&console['log'](a4_0x1a470e[_0x303596(0x127)](_0x303596(0xc0)+_0x217941[_0x303596(0x133)]+'\x22:\x20'+_0x217941[_0x303596(0xdf)]));}for(const _0x4d86f5 of _0x4127c3[_0x303596(0xbe)]){_0x4d86f5['action']===_0x303596(0xdf)&&console[_0x303596(0xe2)](a4_0x1a470e[_0x303596(0x127)](_0x303596(0x126)+_0x4d86f5[_0x303596(0x133)]+_0x303596(0xd0)+_0x4d86f5[_0x303596(0xdf)]));}return 0x1;}console[_0x303596(0xe2)](a4_0x1a470e['green'](_0x303596(0x11c)+(_0x27b50e+_0x352c34)+_0x303596(0x10e)+_0x4127c3[_0x303596(0x137)]+'\x27'));const _0x48f7dd=getLLMProjectUrl(_0x17c229,_0x4127c3['projectId']);return console['log']('Project:\x20'+a4_0x1a470e['cyan'](_0x48f7dd)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4ee16d=a5_0x36cc;(function(_0x1214f6,_0x285f71){const _0x206129=a5_0x36cc,_0xe3137a=_0x1214f6();while(!![]){try{const _0x3c4991=parseInt(_0x206129(0x268))/0x1+-parseInt(_0x206129(0x1f9))/0x2+parseInt(_0x206129(0x24b))/0x3+-parseInt(_0x206129(0x267))/0x4+-parseInt(_0x206129(0x266))/0x5+-parseInt(_0x206129(0x22a))/0x6+-parseInt(_0x206129(0x251))/0x7*(-parseInt(_0x206129(0x24c))/0x8);if(_0x3c4991===_0x285f71)break;else _0xe3137a['push'](_0xe3137a['shift']());}catch(_0x54b481){_0xe3137a['push'](_0xe3137a['shift']());}}}(a5_0x4718,0x6aaaa));import*as a5_0x252daf from'node:fs';function a5_0x4718(){const _0x3ea8a5=['agentName','Round\x20','Evaluating\x20response...','\x22,\x20but\x20current\x20site\x20is\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','start','\x20\x20Agent:\x20','toLowerCase','404','PASS','context','\x20\x20-\x20','tags','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','No\x20tests\x20have\x20tags\x20defined.','substring','basename','forEach','Running\x20agent\x20tests...','stop','site','json','Run\x20tests\x20for\x20an\x20LLM\x20agent','Re-evaluating\x20cached\x20test\x20run...',':\x20Sending\x20user\x20input...','size','conversations','find','\x22:\x20','round','No\x20tests\x20found\x20with\x20tags:\x20','\x20(cached)','82718QLHylx','writeFileSync','Tests\x20found:\x20','isSpinning','Agent:\x20','conversation_url','repeat','jsonl','New\x20tests\x20to\x20execute:\x20','has','utf-8','llm','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Test\x20Configuration:','trim','Failed:\x20\x20\x20','text','resolve','map','test.yml','Duration:\x20','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Passed:\x20\x20\x20','testYmlPath','status','...','\x20\x20Site:\x20','Project\x20path:\x20','Cached\x20run\x20from:\x20','llmProject','executeReeval','\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)','agent:test','rounds','output','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','table','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','projectDir','green','Running:\x20','Errors:\x20\x20\x20','Available\x20tags:\x20','message','tsv','✓\x20PASS:\x20','white','\x20\x20Project:\x20','1786542UZdgsg','Round\x201/','\x27\x20to\x20create\x20the\x20folder\x20structure.','length','includes','join','description','...\x20','not\x20found','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Re-evaluating...','found','✗\x20FAIL:\x20','red','now','Output\x20written\x20to:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','dim','Conversation\x20URL:\x20','Either\x20switch\x20to\x20the\x20\x22','name','resolveAgentId','Test\x20','✗\x20ERROR:\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','no_local_folder','Usage:','Total:\x20\x20\x20\x20','execute','no_tests','filter','1952709iCCfxk','16MSxVbw','\x20-\x20','cyan','tests','Error\x20writing\x20output\x20file:\x20','1041061PBbsdz','ERROR','verbose','Using\x20agent:\x20','source','toISOString','Re-evaluation\x20Summary','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agent','reason','dryRun','eval','\x20\x20Round\x20','push','resolveProjectId','Re-evaluating\x20','Executing\x20new\x20tests...','projectName','log','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','yellow','1673100QMtnQG','1745492XPjmEs','598666bfZqNu','split','\x20\x20Conversation:\x20','no_context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','timestamp','⚠\x20SKIPPED:\x20','Failed\x20Tests:','FAIL','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'];a5_0x4718=function(){return _0x3ea8a5;};return a5_0x4718();}import*as a5_0x527aab from'node:path';function a5_0x36cc(_0xfea270,_0x4cae40){_0xfea270=_0xfea270-0x1e0;const _0x47186e=a5_0x4718();let _0x36cc48=_0x47186e[_0xfea270];return _0x36cc48;}import a5_0x555240 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4ee16d(0x240)]=a5_0x4ee16d(0x21a);[a5_0x4ee16d(0x230)]=a5_0x4ee16d(0x1ef);async[a5_0x4ee16d(0x248)](_0x30a462){const _0x369f1a=a5_0x4ee16d,{options:_0x415ef0,args:_0x538e45,tdx:_0x376f3e}=_0x30a462,_0x5a94d2=_0x538e45[0x0]||'.',_0x4df8ae=_0x415ef0[_0x369f1a(0x25b)],_0x4eb967=_0x415ef0,_0x2bd0a6=_0x4eb967[_0x369f1a(0x25c)]===![],_0x34d162=_0x4eb967['reeval'],_0x373b81=_0x4eb967[_0x369f1a(0x240)],_0x15bba7=_0x4eb967[_0x369f1a(0x1e5)],_0x1505b0=_0x415ef0[_0x369f1a(0x1ed)],_0x5cc68d=_0x4eb967[_0x369f1a(0x21c)];if(_0x34d162&&_0x2bd0a6)return console[_0x369f1a(0x263)](a5_0x555240['red'](_0x369f1a(0x264))),0x1;let _0xbea8ec='table';if(_0x4eb967[_0x369f1a(0x1ee)])_0xbea8ec=_0x369f1a(0x1ee);else{if(_0x4eb967[_0x369f1a(0x200)])_0xbea8ec=_0x369f1a(0x200);else{if(_0x4eb967[_0x369f1a(0x226)])_0xbea8ec=_0x369f1a(0x226);else{if(_0x4eb967['table'])_0xbea8ec=_0x369f1a(0x21e);}}}const _0x52e2d6=_0x4eb967[_0x369f1a(0x217)];let _0x315a31=_0x5a94d2;const _0x3d9062=a5_0x252daf['existsSync'](_0x5a94d2),_0x5785e4=_0x5a94d2==='.';if(!_0x3d9062||_0x5785e4){const _0xdeaf44=resolveProjectFromContext(_0x5a94d2,_0x52e2d6,{'requireFile':_0x369f1a(0x20c)});if(_0xdeaf44[_0x369f1a(0x236)])_0x315a31=_0xdeaf44[_0x369f1a(0x220)],_0xdeaf44[_0x369f1a(0x255)]===_0x369f1a(0x1e3)&&console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x254)+_0x315a31));else switch(_0xdeaf44[_0x369f1a(0x25a)]){case _0x369f1a(0x26b):console['log'](a5_0x555240[_0x369f1a(0x265)](_0xdeaf44['message'])),console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x246)),console[_0x369f1a(0x263)](_0x369f1a(0x244)),console[_0x369f1a(0x263)](_0x369f1a(0x219)),console[_0x369f1a(0x263)](),console['log'](_0x369f1a(0x276));return 0x1;case _0x369f1a(0x245):console[_0x369f1a(0x263)](a5_0x555240['yellow'](_0xdeaf44[_0x369f1a(0x225)])),console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0xdeaf44[_0x369f1a(0x217)]+_0x369f1a(0x22c));return 0x1;case'multiple_agents':{const _0x5354ed=a5_0x527aab[_0x369f1a(0x1e9)](_0xdeaf44['projectDir']);console[_0x369f1a(0x263)](a5_0x555240['yellow'](_0x369f1a(0x26c)+_0xdeaf44[_0x369f1a(0x217)]+'\x22:'));for(const _0x5a882b of _0xdeaf44['agentDirs']){console[_0x369f1a(0x263)](_0x369f1a(0x1e4)+_0x5a882b);}return console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x23b)+_0x5354ed+'/<agent-name>'),0x1;}case _0x369f1a(0x249):console[_0x369f1a(0x263)](a5_0x555240['yellow'](_0x369f1a(0x23c)+_0xdeaf44[_0x369f1a(0x217)]+'\x22.')),console['log'](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x215)+_0xdeaf44[_0x369f1a(0x220)])),console['log'](),console[_0x369f1a(0x263)](_0x369f1a(0x205));return 0x1;}}const {definition:_0x1a68d8,agentInfo:_0x47009c}=parseTestFile(_0x315a31);let _0x1758f6=_0x1a68d8[_0x369f1a(0x24f)];if(_0x373b81){const _0x33c8bd=_0x373b81['split'](',')[_0x369f1a(0x20b)](_0x1e13fe=>_0x1e13fe[_0x369f1a(0x207)]());_0x1758f6=_0x1a68d8[_0x369f1a(0x24f)][_0x369f1a(0x24a)](_0x34ecae=>_0x33c8bd[_0x369f1a(0x22e)](_0x34ecae['name']));if(_0x1758f6[_0x369f1a(0x22d)]===0x0)return console[_0x369f1a(0x263)](a5_0x555240['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x373b81)),console[_0x369f1a(0x263)](a5_0x555240['dim']('Available\x20tests:\x20'+_0x1a68d8[_0x369f1a(0x24f)][_0x369f1a(0x20b)](_0xc12f9b=>_0xc12f9b[_0x369f1a(0x240)])[_0x369f1a(0x22f)](',\x20'))),0x1;}if(_0x15bba7){const _0x447552=_0x15bba7[_0x369f1a(0x269)](',')[_0x369f1a(0x20b)](_0x403d1e=>_0x403d1e['trim']()[_0x369f1a(0x1e0)]());_0x1758f6=_0x1758f6[_0x369f1a(0x24a)](_0x441566=>_0x441566[_0x369f1a(0x1e5)]?.['some'](_0x21b7ea=>_0x447552[_0x369f1a(0x22e)](_0x21b7ea[_0x369f1a(0x1e0)]())));if(_0x1758f6[_0x369f1a(0x22d)]===0x0){console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x265)](_0x369f1a(0x1f7)+_0x15bba7));const _0x3bd5a9=new Set();return _0x1a68d8[_0x369f1a(0x24f)][_0x369f1a(0x1ea)](_0x18bce2=>_0x18bce2[_0x369f1a(0x1e5)]?.[_0x369f1a(0x1ea)](_0x30f41e=>_0x3bd5a9['add'](_0x30f41e))),_0x3bd5a9[_0x369f1a(0x1f2)]>0x0?console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x224)+[..._0x3bd5a9][_0x369f1a(0x22f)](',\x20'))):console['log'](a5_0x555240['dim'](_0x369f1a(0x1e7))),0x1;}}if(_0x34d162)return this['executeReeval'](_0x30a462,{'definition':{'tests':_0x1758f6},'agentInfo':_0x47009c,'outputFormat':_0xbea8ec,'outputFile':_0x5cc68d,'testNames':_0x373b81});if(_0x4df8ae){console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x24e)](_0x369f1a(0x206))),console['log'](_0x369f1a(0x214)+a5_0x555240[_0x369f1a(0x228)](_0x1505b0)),console[_0x369f1a(0x263)](_0x369f1a(0x229)+a5_0x555240['white'](_0x47009c['projectName'])),console[_0x369f1a(0x263)](_0x369f1a(0x279)+a5_0x555240['white'](_0x47009c[_0x369f1a(0x272)])),console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x1fb)+a5_0x555240[_0x369f1a(0x228)](_0x1758f6[_0x369f1a(0x22d)]));for(let _0x586758=0x0;_0x586758<_0x1758f6['length'];_0x586758++){const _0xe14fda=_0x1758f6[_0x586758],_0x33ab80=_0xe14fda[_0x369f1a(0x21b)]['length']===0x1?_0x369f1a(0x1f6):_0x369f1a(0x21b),_0x408f65=_0xe14fda[_0x369f1a(0x1e5)]?.[_0x369f1a(0x22d)]?'\x20['+_0xe14fda[_0x369f1a(0x1e5)][_0x369f1a(0x22f)](',\x20')+']':'';console[_0x369f1a(0x263)]('\x20\x20'+(_0x586758+0x1)+'.\x20'+a5_0x555240['white'](_0xe14fda[_0x369f1a(0x240)])+'\x20('+_0xe14fda['rounds'][_0x369f1a(0x22d)]+'\x20'+_0x33ab80+')'+a5_0x555240['dim'](_0x408f65));}return 0x0;}let _0x4a2805,_0xb62a;try{_0x4a2805=await _0x376f3e[_0x369f1a(0x204)][_0x369f1a(0x25f)](_0x47009c[_0x369f1a(0x262)]);}catch(_0x5471c4){const _0x5a82c1=_0x5471c4 instanceof Error?_0x5471c4[_0x369f1a(0x225)]:String(_0x5471c4);return _0x5a82c1[_0x369f1a(0x22e)](_0x369f1a(0x1e1))||_0x5a82c1[_0x369f1a(0x1e0)]()[_0x369f1a(0x22e)]('not\x20found')?console['log'](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x234)+_0x47009c[_0x369f1a(0x262)])):console[_0x369f1a(0x263)](a5_0x555240['red'](_0x369f1a(0x258)+_0x47009c[_0x369f1a(0x262)]+_0x369f1a(0x1f5)+_0x5a82c1)),0x1;}try{_0xb62a=await _0x376f3e[_0x369f1a(0x204)][_0x369f1a(0x241)](_0x47009c[_0x369f1a(0x272)],_0x4a2805);}catch(_0x4d0f4e){const _0x22f2af=_0x4d0f4e instanceof Error?_0x4d0f4e[_0x369f1a(0x225)]:String(_0x4d0f4e);return _0x22f2af[_0x369f1a(0x22e)](_0x369f1a(0x1e1))||_0x22f2af[_0x369f1a(0x1e0)]()[_0x369f1a(0x22e)](_0x369f1a(0x232))?console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x1e6)+_0x47009c[_0x369f1a(0x272)])):console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x47009c[_0x369f1a(0x272)]+_0x369f1a(0x1f5)+_0x22f2af)),0x1;}let _0x4f6333;if(!_0x2bd0a6)try{_0x4f6333=await setupEvaluatorAgent(_0x376f3e[_0x369f1a(0x204)],_0x415ef0[_0x369f1a(0x253)]);}catch(_0xb730db){const _0x26d98e=_0xb730db instanceof Error?_0xb730db[_0x369f1a(0x225)]:String(_0xb730db);return console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x271)+_0x26d98e)),0x1;}console[_0x369f1a(0x263)](a5_0x555240['cyan'](_0x369f1a(0x1eb))),console[_0x369f1a(0x263)]('Site:\x20'+a5_0x555240[_0x369f1a(0x228)](_0x1505b0)),console['log'](_0x369f1a(0x1fd)+a5_0x555240[_0x369f1a(0x228)](_0x47009c[_0x369f1a(0x262)]+'/'+_0x47009c['agentName'])),console[_0x369f1a(0x263)]();const _0x411e8e=[],_0x3c5ca3=[],_0x39626f=Date[_0x369f1a(0x239)]();for(let _0xece314=0x0;_0xece314<_0x1758f6[_0x369f1a(0x22d)];_0xece314++){const _0x44d869=_0x1758f6[_0xece314];_0x1758f6[_0x369f1a(0x22d)]>0x1?console['log'](_0x369f1a(0x242)+(_0xece314+0x1)+'/'+_0x1758f6[_0x369f1a(0x22d)]+':\x20'+a5_0x555240[_0x369f1a(0x228)](_0x44d869[_0x369f1a(0x240)])):console[_0x369f1a(0x263)]('Running\x20test:\x20'+a5_0x555240['white'](_0x44d869[_0x369f1a(0x240)]));const _0x2f26f7=createCommandSpinner(_0x369f1a(0x22b)+_0x44d869[_0x369f1a(0x21b)][_0x369f1a(0x22d)]+_0x369f1a(0x1f1));_0x2f26f7[_0x369f1a(0x278)]();try{const {result:_0x467324,conversation:_0x2ae3f2}=await runTest(_0x376f3e['llm'],_0x44d869,{'agentId':_0xb62a,'projectId':_0x4a2805,'site':_0x1505b0,'noEval':_0x2bd0a6,'evaluatorId':_0x4f6333,'onRoundStart':(_0x3610a5,_0x106fa9)=>{const _0x26fa11=_0x369f1a;_0x2f26f7[_0x26fa11(0x209)]=_0x26fa11(0x273)+(_0x3610a5+0x1)+'/'+_0x106fa9+_0x26fa11(0x1f1);},'onRoundComplete':(_0x4c97d3,_0x562a23,_0x1984dc)=>{const _0xe20960=_0x369f1a,_0x5e596f=formatElapsed(_0x562a23);_0x1984dc?console[_0xe20960(0x263)](_0xe20960(0x25d)+(_0x4c97d3+0x1)+'/'+_0x44d869['rounds'][_0xe20960(0x22d)]+_0xe20960(0x231)+a5_0x555240[_0xe20960(0x221)]('✓')+'\x20('+_0x5e596f+')'):console[_0xe20960(0x263)](_0xe20960(0x25d)+(_0x4c97d3+0x1)+'/'+_0x44d869['rounds'][_0xe20960(0x22d)]+'...\x20'+a5_0x555240[_0xe20960(0x238)]('✗'));},'onEvaluationStart':()=>{const _0x58e7ab=_0x369f1a;_0x2f26f7[_0x58e7ab(0x209)]=_0x58e7ab(0x274);},'onEvaluationComplete':_0x31087c=>{const _0x40f863=_0x369f1a,_0xa2fcaa=formatElapsed(_0x31087c);console[_0x40f863(0x263)](_0x40f863(0x20e)+a5_0x555240[_0x40f863(0x221)]('✓')+'\x20('+_0xa2fcaa+')');}});_0x2f26f7[_0x369f1a(0x1ec)](),_0x411e8e[_0x369f1a(0x25e)](_0x467324),_0x3c5ca3[_0x369f1a(0x25e)](_0x2ae3f2);if(_0x467324[_0x369f1a(0x212)]==='PASS')console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x221)]('✓\x20PASS:\x20'+_0x467324[_0x369f1a(0x25a)]));else _0x467324[_0x369f1a(0x212)]==='FAIL'?console['log'](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x237)+_0x467324['reason'])):console['log'](a5_0x555240['red'](_0x369f1a(0x243)+_0x467324[_0x369f1a(0x25a)]));_0x467324['conversation_url']&&console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x23e)+_0x467324[_0x369f1a(0x1fe)])),console[_0x369f1a(0x263)]();}catch(_0x240a46){_0x2f26f7[_0x369f1a(0x1ec)]();const _0x55ebd4=_0x240a46 instanceof Error?_0x240a46['message']:String(_0x240a46);console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x243)+_0x55ebd4)),console[_0x369f1a(0x263)](),_0x411e8e[_0x369f1a(0x25e)]({'name':_0x44d869[_0x369f1a(0x240)],'status':_0x369f1a(0x252),'reason':_0x55ebd4,'timestamp':new Date()[_0x369f1a(0x256)](),'duration_ms':0x0});}}const _0x588ca9=Date[_0x369f1a(0x239)]()-_0x39626f,_0x8a54ce=_0x411e8e[_0x369f1a(0x24a)](_0x1378d1=>_0x1378d1[_0x369f1a(0x212)]===_0x369f1a(0x1e2))[_0x369f1a(0x22d)],_0x3b444e=_0x411e8e['filter'](_0x582e2a=>_0x582e2a[_0x369f1a(0x212)]===_0x369f1a(0x270))[_0x369f1a(0x22d)],_0x312fb4=_0x411e8e[_0x369f1a(0x24a)](_0x464d99=>_0x464d99[_0x369f1a(0x212)]==='ERROR')[_0x369f1a(0x22d)];console[_0x369f1a(0x263)]('━'[_0x369f1a(0x1ff)](0x3c)),console['log']('Test\x20Summary'),console[_0x369f1a(0x263)]('━'[_0x369f1a(0x1ff)](0x3c)),console[_0x369f1a(0x263)](_0x369f1a(0x247)+_0x411e8e[_0x369f1a(0x22d)]),console[_0x369f1a(0x263)](_0x369f1a(0x210)+a5_0x555240[_0x369f1a(0x221)](_0x8a54ce)),console[_0x369f1a(0x263)](_0x369f1a(0x208)+a5_0x555240[_0x369f1a(0x238)](_0x3b444e));_0x312fb4>0x0&&console[_0x369f1a(0x263)](_0x369f1a(0x223)+a5_0x555240['red'](_0x312fb4));console['log']('Duration:\x20'+formatElapsed(_0x588ca9)),console['log']('━'[_0x369f1a(0x1ff)](0x3c));const _0x123fa7=_0x411e8e[_0x369f1a(0x24a)](_0x59bd6f=>_0x59bd6f[_0x369f1a(0x212)]!==_0x369f1a(0x1e2));if(_0x123fa7[_0x369f1a(0x22d)]>0x0){console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x26f));for(const _0xbe555e of _0x123fa7){const _0x931a37=a5_0x555240[_0x369f1a(0x238)]('✗'),_0x4fd271=_0xbe555e[_0x369f1a(0x25a)][_0x369f1a(0x22d)]>0x32?_0xbe555e[_0x369f1a(0x25a)][_0x369f1a(0x1e8)](0x0,0x32)+'...':_0xbe555e[_0x369f1a(0x25a)];console[_0x369f1a(0x263)]('\x20\x20'+_0x931a37+'\x20'+_0xbe555e['name']+':\x20'+_0x4fd271);}}const _0x49da8c={'summary':{'total':_0x411e8e[_0x369f1a(0x22d)],'passed':_0x8a54ce,'failed':_0x3b444e,'errors':_0x312fb4>0x0?_0x312fb4:undefined,'duration_ms':_0x588ca9},'tests':_0x411e8e,'agent':{'project':_0x47009c[_0x369f1a(0x262)],'name':_0x47009c['agentName'],'site':_0x1505b0},'timestamp':new Date(_0x39626f)['toISOString']()};try{const _0x5b1b52=buildCachedTestRun(_0x3c5ca3,{'site':_0x1505b0,'projectId':_0x4a2805,'projectName':_0x47009c['projectName'],'agentId':_0xb62a,'agentName':_0x47009c[_0x369f1a(0x272)],'testYmlPath':a5_0x527aab[_0x369f1a(0x20a)](_0x47009c[_0x369f1a(0x211)])});saveLastTestRun(_0x5b1b52);}catch{}if(_0xbea8ec!==_0x369f1a(0x21e)||_0x5cc68d){const _0x5dadf6=formatResults(_0x49da8c,_0xbea8ec);if(_0x5cc68d)try{a5_0x252daf['writeFileSync'](_0x5cc68d,_0x5dadf6,'utf-8'),console['log'](),console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x23a)+_0x5cc68d));}catch(_0x7f9a62){return console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)]('Error\x20writing\x20output\x20file:\x20'+_0x7f9a62)),0x1;}else console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x5dadf6);}return _0x123fa7[_0x369f1a(0x22d)]>0x0?0x1:0x0;}async[a5_0x4ee16d(0x218)](_0x5861f1,_0x35604d){const _0x20d28a=a5_0x4ee16d,{options:_0x2fab7a,tdx:_0xabd198}=_0x5861f1,{definition:_0x21c577,agentInfo:_0x426049,outputFormat:_0x19ed17,outputFile:_0x22817b}=_0x35604d,_0x3bc378=_0x2fab7a[_0x20d28a(0x1ed)],_0x4ef77d=loadLastTestRun();if(!_0x4ef77d)return console['log'](a5_0x555240[_0x20d28a(0x238)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x20f))),0x1;if(_0x4ef77d[_0x20d28a(0x259)][_0x20d28a(0x272)]!==_0x426049[_0x20d28a(0x272)])return console[_0x20d28a(0x263)](a5_0x555240['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4ef77d[_0x20d28a(0x259)]['agentName']+_0x20d28a(0x21f)+_0x426049[_0x20d28a(0x272)]+'\x22.')),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x21d))),0x1;const _0x31974e=new Set(_0x4ef77d[_0x20d28a(0x1f3)][_0x20d28a(0x20b)](_0x2026de=>_0x2026de['testName'])),_0x27132a=_0x21c577[_0x20d28a(0x24f)][_0x20d28a(0x24a)](_0x331aef=>!_0x31974e[_0x20d28a(0x202)](_0x331aef[_0x20d28a(0x240)]));if(_0x27132a[_0x20d28a(0x22d)]>0x0&&_0x4ef77d[_0x20d28a(0x1ed)]!==_0x3bc378)return console[_0x20d28a(0x263)](a5_0x555240['red'](_0x20d28a(0x233))),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4ef77d[_0x20d28a(0x1ed)]+_0x20d28a(0x275)+_0x3bc378+'\x22.')),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x23f)+_0x4ef77d[_0x20d28a(0x1ed)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x450891=_0x21c577[_0x20d28a(0x24f)][_0x20d28a(0x24a)](_0x2acdae=>_0x31974e['has'](_0x2acdae[_0x20d28a(0x240)])),_0x6e62ed=_0x27132a;let _0xfdb028;try{_0xfdb028=await setupEvaluatorAgent(_0xabd198[_0x20d28a(0x204)],_0x2fab7a[_0x20d28a(0x253)]);}catch(_0x2601bf){const _0x55967f=_0x2601bf instanceof Error?_0x2601bf[_0x20d28a(0x225)]:String(_0x2601bf);return console[_0x20d28a(0x263)](a5_0x555240['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x55967f)),0x1;}console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x24e)](_0x20d28a(0x1f0))),console[_0x20d28a(0x263)](_0x20d28a(0x216)+a5_0x555240[_0x20d28a(0x228)](_0x4ef77d[_0x20d28a(0x26d)])),console[_0x20d28a(0x263)](_0x20d28a(0x1fd)+a5_0x555240[_0x20d28a(0x228)](_0x4ef77d[_0x20d28a(0x259)][_0x20d28a(0x262)]+'/'+_0x4ef77d[_0x20d28a(0x259)]['agentName']));_0x6e62ed[_0x20d28a(0x22d)]>0x0&&console[_0x20d28a(0x263)](_0x20d28a(0x201)+a5_0x555240['yellow'](_0x6e62ed[_0x20d28a(0x22d)]));console[_0x20d28a(0x263)]();const _0x3503c3=[],_0x14b38c=Date[_0x20d28a(0x239)](),_0x4c528a=createCommandSpinner(_0x20d28a(0x235));if(_0x450891[_0x20d28a(0x22d)]>0x0)try{const _0x18a7f1=await reevaluateFromCache(_0xabd198[_0x20d28a(0x204)],_0x4ef77d,{'tests':_0x450891},{'evaluatorId':_0xfdb028,'onTestStart':(_0x323c10,_0xa37453,_0x5226a4)=>{const _0x89309c=_0x20d28a;_0x4c528a[_0x89309c(0x209)]=_0x89309c(0x260)+(_0xa37453+0x1)+'/'+_0x5226a4+':\x20'+_0x323c10+_0x89309c(0x213);if(!_0x4c528a[_0x89309c(0x1fc)])_0x4c528a['start']();},'onTestComplete':(_0x1c1c52,_0x10562b)=>{const _0x76812a=_0x20d28a;_0x4c528a['stop']();if(_0x10562b[_0x76812a(0x212)]===_0x76812a(0x1e2))console[_0x76812a(0x263)](a5_0x555240[_0x76812a(0x221)](_0x76812a(0x227)+_0x1c1c52)+a5_0x555240[_0x76812a(0x23d)](_0x76812a(0x1f8)));else _0x10562b[_0x76812a(0x212)]===_0x76812a(0x270)?console['log'](a5_0x555240[_0x76812a(0x238)](_0x76812a(0x237)+_0x1c1c52+_0x76812a(0x24d)+_0x10562b[_0x76812a(0x25a)])+a5_0x555240[_0x76812a(0x23d)]('\x20(cached)')):console[_0x76812a(0x263)](a5_0x555240['red'](_0x76812a(0x243)+_0x1c1c52+_0x76812a(0x24d)+_0x10562b[_0x76812a(0x25a)]));_0x10562b[_0x76812a(0x1fe)]&&console[_0x76812a(0x263)](a5_0x555240[_0x76812a(0x23d)](_0x76812a(0x26a)+_0x10562b[_0x76812a(0x1fe)])),_0x3503c3['push'](_0x10562b);},'onTestSkipped':(_0x5c7af0,_0x38bbe8)=>{const _0x4e4933=_0x20d28a;_0x4c528a[_0x4e4933(0x1ec)](),console[_0x4e4933(0x263)](a5_0x555240[_0x4e4933(0x265)](_0x4e4933(0x26e)+_0x5c7af0+_0x4e4933(0x24d)+_0x38bbe8));}});for(const _0x1673ec of _0x18a7f1){!_0x3503c3[_0x20d28a(0x1f4)](_0x2f9fc4=>_0x2f9fc4[_0x20d28a(0x240)]===_0x1673ec[_0x20d28a(0x240)])&&_0x3503c3['push'](_0x1673ec);}}catch(_0x12af5e){_0x4c528a['stop']();const _0x1045f8=_0x12af5e instanceof Error?_0x12af5e[_0x20d28a(0x225)]:String(_0x12af5e);return console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x238)](_0x20d28a(0x277)+_0x1045f8)),0x1;}_0x4c528a[_0x20d28a(0x1ec)]();if(_0x6e62ed[_0x20d28a(0x22d)]>0x0){console[_0x20d28a(0x263)](),console['log'](a5_0x555240[_0x20d28a(0x24e)](_0x20d28a(0x261)));const {projectId:_0x103ab5,agentId:_0x207586}=_0x4ef77d[_0x20d28a(0x259)];for(const _0x2174e3 of _0x6e62ed){console[_0x20d28a(0x263)](_0x20d28a(0x222)+a5_0x555240['white'](_0x2174e3['name']));const _0x44aff6=createCommandSpinner(_0x20d28a(0x22b)+_0x2174e3[_0x20d28a(0x21b)][_0x20d28a(0x22d)]+_0x20d28a(0x1f1));_0x44aff6[_0x20d28a(0x278)]();try{const {result:_0x95dedd}=await runTest(_0xabd198[_0x20d28a(0x204)],_0x2174e3,{'agentId':_0x207586,'projectId':_0x103ab5,'site':_0x4ef77d[_0x20d28a(0x1ed)],'noEval':![],'evaluatorId':_0xfdb028,'onRoundStart':(_0x2dff47,_0x342ac5)=>{const _0x9ed50c=_0x20d28a;_0x44aff6['text']=_0x9ed50c(0x273)+(_0x2dff47+0x1)+'/'+_0x342ac5+_0x9ed50c(0x1f1);},'onRoundComplete':(_0x46fbd4,_0x7641d,_0x303d38)=>{const _0x545a7f=_0x20d28a,_0x54db1e=formatElapsed(_0x7641d);_0x303d38?console[_0x545a7f(0x263)](_0x545a7f(0x25d)+(_0x46fbd4+0x1)+'/'+_0x2174e3[_0x545a7f(0x21b)][_0x545a7f(0x22d)]+_0x545a7f(0x231)+a5_0x555240[_0x545a7f(0x221)]('✓')+'\x20('+_0x54db1e+')'):console[_0x545a7f(0x263)](_0x545a7f(0x25d)+(_0x46fbd4+0x1)+'/'+_0x2174e3[_0x545a7f(0x21b)]['length']+'...\x20'+a5_0x555240[_0x545a7f(0x238)]('✗'));},'onEvaluationStart':()=>{const _0x29300d=_0x20d28a;_0x44aff6[_0x29300d(0x209)]=_0x29300d(0x274);},'onEvaluationComplete':_0x4e43f9=>{const _0x30cc8d=_0x20d28a,_0x59435d=formatElapsed(_0x4e43f9);console[_0x30cc8d(0x263)](_0x30cc8d(0x20e)+a5_0x555240['green']('✓')+'\x20('+_0x59435d+')');}});_0x44aff6[_0x20d28a(0x1ec)](),_0x3503c3['push'](_0x95dedd);if(_0x95dedd[_0x20d28a(0x212)]==='PASS')console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x221)](_0x20d28a(0x227)+_0x95dedd[_0x20d28a(0x25a)])+a5_0x555240[_0x20d28a(0x23d)]('\x20(new)'));else _0x95dedd[_0x20d28a(0x212)]===_0x20d28a(0x270)?console[_0x20d28a(0x263)](a5_0x555240['red'](_0x20d28a(0x237)+_0x95dedd[_0x20d28a(0x25a)])+a5_0x555240[_0x20d28a(0x23d)]('\x20(new)')):console['log'](a5_0x555240['red']('✗\x20ERROR:\x20'+_0x95dedd[_0x20d28a(0x25a)]));_0x95dedd[_0x20d28a(0x1fe)]&&console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)]('\x20\x20Conversation:\x20'+_0x95dedd[_0x20d28a(0x1fe)]));}catch(_0xb83935){_0x44aff6[_0x20d28a(0x1ec)]();const _0x4a8f50=_0xb83935 instanceof Error?_0xb83935[_0x20d28a(0x225)]:String(_0xb83935);console['log'](a5_0x555240[_0x20d28a(0x238)](_0x20d28a(0x243)+_0x4a8f50)),_0x3503c3[_0x20d28a(0x25e)]({'name':_0x2174e3[_0x20d28a(0x240)],'status':_0x20d28a(0x252),'reason':_0x4a8f50,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x20d28a(0x263)]();const _0x91eabf=Date[_0x20d28a(0x239)]()-_0x14b38c,_0x150400=_0x3503c3[_0x20d28a(0x24a)](_0x295e33=>_0x295e33[_0x20d28a(0x212)]==='PASS')[_0x20d28a(0x22d)],_0x2d5ce6=_0x3503c3[_0x20d28a(0x24a)](_0x30ea79=>_0x30ea79[_0x20d28a(0x212)]===_0x20d28a(0x270))['length'],_0x3f19c6=_0x3503c3[_0x20d28a(0x24a)](_0x2bc9f5=>_0x2bc9f5[_0x20d28a(0x212)]===_0x20d28a(0x252))[_0x20d28a(0x22d)];console['log']('━'[_0x20d28a(0x1ff)](0x3c)),console[_0x20d28a(0x263)](_0x20d28a(0x257)),console['log']('━'[_0x20d28a(0x1ff)](0x3c)),console[_0x20d28a(0x263)](_0x20d28a(0x247)+_0x3503c3[_0x20d28a(0x22d)]),console[_0x20d28a(0x263)]('Passed:\x20\x20\x20'+a5_0x555240[_0x20d28a(0x221)](_0x150400)),console['log'](_0x20d28a(0x208)+a5_0x555240[_0x20d28a(0x238)](_0x2d5ce6));_0x3f19c6>0x0&&console[_0x20d28a(0x263)](_0x20d28a(0x223)+a5_0x555240[_0x20d28a(0x238)](_0x3f19c6));console[_0x20d28a(0x263)](_0x20d28a(0x20d)+formatElapsed(_0x91eabf)),console['log']('━'['repeat'](0x3c));const _0x37b1ee={'summary':{'total':_0x3503c3[_0x20d28a(0x22d)],'passed':_0x150400,'failed':_0x2d5ce6,'errors':_0x3f19c6>0x0?_0x3f19c6:undefined,'duration_ms':_0x91eabf},'tests':_0x3503c3,'agent':{'project':_0x426049[_0x20d28a(0x262)],'name':_0x426049[_0x20d28a(0x272)],'site':_0x3bc378},'timestamp':new Date(_0x14b38c)[_0x20d28a(0x256)]()};if(_0x19ed17!==_0x20d28a(0x21e)||_0x22817b){const _0x47487b=formatResults(_0x37b1ee,_0x19ed17);if(_0x22817b)try{a5_0x252daf[_0x20d28a(0x1fa)](_0x22817b,_0x47487b,_0x20d28a(0x203)),console[_0x20d28a(0x263)](),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x23a)+_0x22817b));}catch(_0x1131d6){return console['log'](),console['log'](a5_0x555240[_0x20d28a(0x238)](_0x20d28a(0x250)+_0x1131d6)),0x1;}else console[_0x20d28a(0x263)](),console[_0x20d28a(0x263)](_0x47487b);}const _0xa206d8=_0x3503c3[_0x20d28a(0x24a)](_0x50ce24=>_0x50ce24['status']!==_0x20d28a(0x1e2));return _0xa206d8[_0x20d28a(0x22d)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x41b9d6=a5_0x3325;(function(_0x22843a,_0x2b4d04){const _0x328c20=a5_0x3325,_0x2be005=_0x22843a();while(!![]){try{const _0x24f05e=parseInt(_0x328c20(0x1fe))/0x1*(parseInt(_0x328c20(0x217))/0x2)+-parseInt(_0x328c20(0x226))/0x3+parseInt(_0x328c20(0x25f))/0x4+parseInt(_0x328c20(0x1f7))/0x5*(parseInt(_0x328c20(0x1f4))/0x6)+-parseInt(_0x328c20(0x229))/0x7*(-parseInt(_0x328c20(0x1eb))/0x8)+-parseInt(_0x328c20(0x1da))/0x9+-parseInt(_0x328c20(0x234))/0xa*(parseInt(_0x328c20(0x1e7))/0xb);if(_0x24f05e===_0x2b4d04)break;else _0x2be005['push'](_0x2be005['shift']());}catch(_0x5c5420){_0x2be005['push'](_0x2be005['shift']());}}}(a5_0x1ff1,0xb8c57));import*as a5_0x371230 from'node:fs';import*as a5_0x4569b2 from'node:path';function a5_0x1ff1(){const _0x4b444f=['output','Test\x20Summary','timestamp','substring','Round\x201/','\x20\x20Agent:\x20','yellow','green','tags','reason','status','cyan','Round\x20','white','verbose','Agent:\x20','length','rounds','5517328oEXBwH','text','now','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agent:test','Conversation\x20URL:\x20','push','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','trim','\x20(new)','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','find','No\x20tests\x20found\x20matching:\x20','\x20\x20Site:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','/<agent-name>','writeFileSync','Run\x20\x27tdx\x20agent\x20pull\x20','Test\x20Configuration:','\x20\x20Project:\x20','...\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','executeReeval','llm','split','toISOString','690921RtAYIN','Passed:\x20\x20\x20','name','\x20\x20Conversation:\x20','repeat','some','log','New\x20tests\x20to\x20execute:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','ERROR','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','utf-8','\x20\x20Evaluating...\x20','21918589buHRmI','filter','red','testName','56vYirLz','stop','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Executing\x20new\x20tests...','PASS','No\x20tests\x20have\x20tags\x20defined.','Duration:\x20','Running\x20test:\x20','found','18KvUkJo','jsonl','has','349010rqdOyC','\x20\x20Round\x20','tests','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','...','conversation_url','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','25eTrpvq','no_context','Usage:','execute','eval','basename','message','resolveProjectId','✗\x20FAIL:\x20','table','projectName','description','\x27\x20to\x20create\x20the\x20folder\x20structure.','Available\x20tests:\x20','site','⚠\x20SKIPPED:\x20','map','\x22,\x20but\x20current\x20site\x20is\x20\x22','agentDirs','not\x20found','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','isSpinning','existsSync','test.yml','Errors:\x20\x20\x20','59734IDHPaM','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','includes','start','context',':\x20Sending\x20user\x20input...','\x20-\x20','tsv','forEach','✗\x20ERROR:\x20','Total:\x20\x20\x20\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x22:\x20','Re-evaluating\x20cached\x20test\x20run...','2591901MqhSCV','dryRun','reeval','1354745SjUcvF','testYmlPath','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','join','dim','FAIL','Re-evaluating\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20\x20-\x20','Test\x20','resolveAgentId','10eIiXZb','Error\x20writing\x20output\x20file:\x20','agentName','✓\x20PASS:\x20','json','size','agent','\x20(cached)','Output\x20written\x20to:\x20','Failed\x20Tests:','Either\x20switch\x20to\x20the\x20\x22','Running:\x20','llmProject','Failed:\x20\x20\x20','toLowerCase','No\x20tests\x20found\x20with\x20tags:\x20','multiple_agents','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','no_local_folder','round','Evaluating\x20response...','projectDir','Site:\x20','conversations','404'];a5_0x1ff1=function(){return _0x4b444f;};return a5_0x1ff1();}import a5_0x195e9e from'chalk';import{BaseCommand}from'./command.js';function a5_0x3325(_0x5619bd,_0x4b9188){_0x5619bd=_0x5619bd-0x1c8;const _0x1ff186=a5_0x1ff1();let _0x332575=_0x1ff186[_0x5619bd];return _0x332575;}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_0x41b9d6(0x263);[a5_0x41b9d6(0x209)]=a5_0x41b9d6(0x1e2);async[a5_0x41b9d6(0x201)](_0x4256c2){const _0x23cd43=a5_0x41b9d6,{options:_0x32a1da,args:_0x58984c,tdx:_0xf58706}=_0x4256c2,_0x45ff7b=_0x58984c[0x0]||'.',_0x3322e6=_0x32a1da[_0x23cd43(0x227)],_0xf76ca7=_0x32a1da,_0x541157=_0xf76ca7[_0x23cd43(0x202)]===![],_0x3cd00f=_0xf76ca7[_0x23cd43(0x228)],_0x4f1f24=_0xf76ca7[_0x23cd43(0x1dc)],_0x345733=_0xf76ca7[_0x23cd43(0x255)],_0x206fb8=_0x32a1da['site'],_0x1892a0=_0xf76ca7[_0x23cd43(0x24d)];if(_0x3cd00f&&_0x541157)return console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x1e9)](_0x23cd43(0x1ca))),0x1;let _0x5358cd=_0x23cd43(0x207);if(_0xf76ca7[_0x23cd43(0x238)])_0x5358cd=_0x23cd43(0x238);else{if(_0xf76ca7['jsonl'])_0x5358cd=_0x23cd43(0x1f5);else{if(_0xf76ca7[_0x23cd43(0x21e)])_0x5358cd=_0x23cd43(0x21e);else{if(_0xf76ca7[_0x23cd43(0x207)])_0x5358cd=_0x23cd43(0x207);}}}const _0x4535a1=_0xf76ca7[_0x23cd43(0x240)];let _0x2732b3=_0x45ff7b;const _0xe6e19=a5_0x371230[_0x23cd43(0x214)](_0x45ff7b),_0x325fab=_0x45ff7b==='.';if(!_0xe6e19||_0x325fab){const _0x2e7c08=resolveProjectFromContext(_0x45ff7b,_0x4535a1,{'requireFile':_0x23cd43(0x215)});if(_0x2e7c08[_0x23cd43(0x1f3)])_0x2732b3=_0x2e7c08[_0x23cd43(0x249)],_0x2e7c08['source']===_0x23cd43(0x21b)&&console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x22d)]('Using\x20agent:\x20'+_0x2732b3));else switch(_0x2e7c08['reason']){case _0x23cd43(0x1ff):console[_0x23cd43(0x1e0)](a5_0x195e9e['yellow'](_0x2e7c08['message'])),console[_0x23cd43(0x1e0)](),console[_0x23cd43(0x1e0)](_0x23cd43(0x200)),console[_0x23cd43(0x1e0)](_0x23cd43(0x1fa)),console[_0x23cd43(0x1e0)](_0x23cd43(0x222)),console[_0x23cd43(0x1e0)](),console[_0x23cd43(0x1e0)](_0x23cd43(0x1e4));return 0x1;case _0x23cd43(0x246):console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x253)](_0x2e7c08['message'])),console['log'](),console['log'](_0x23cd43(0x1d1)+_0x2e7c08[_0x23cd43(0x240)]+_0x23cd43(0x20a));return 0x1;case _0x23cd43(0x244):{const _0x223561=a5_0x4569b2[_0x23cd43(0x203)](_0x2e7c08[_0x23cd43(0x249)]);console['log'](a5_0x195e9e[_0x23cd43(0x253)](_0x23cd43(0x1ed)+_0x2e7c08[_0x23cd43(0x240)]+'\x22:'));for(const _0x223313 of _0x2e7c08[_0x23cd43(0x210)]){console['log'](_0x23cd43(0x231)+_0x223313);}return console[_0x23cd43(0x1e0)](),console[_0x23cd43(0x1e0)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x223561+_0x23cd43(0x1cf)),0x1;}case'no_tests':console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x253)](_0x23cd43(0x218)+_0x2e7c08[_0x23cd43(0x240)]+'\x22.')),console[_0x23cd43(0x1e0)](a5_0x195e9e['dim']('Project\x20path:\x20'+_0x2e7c08[_0x23cd43(0x249)])),console['log'](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x2dceb0,agentInfo:_0x30486f}=parseTestFile(_0x2732b3);let _0x4981a0=_0x2dceb0[_0x23cd43(0x1f9)];if(_0x4f1f24){const _0x712fde=_0x4f1f24[_0x23cd43(0x1d8)](',')[_0x23cd43(0x20e)](_0x57cdf8=>_0x57cdf8[_0x23cd43(0x1c8)]());_0x4981a0=_0x2dceb0[_0x23cd43(0x1f9)][_0x23cd43(0x1e8)](_0x39d0a9=>_0x712fde[_0x23cd43(0x219)](_0x39d0a9[_0x23cd43(0x1dc)]));if(_0x4981a0[_0x23cd43(0x25d)]===0x0)return console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x253)](_0x23cd43(0x1cc)+_0x4f1f24)),console[_0x23cd43(0x1e0)](a5_0x195e9e['dim'](_0x23cd43(0x20b)+_0x2dceb0[_0x23cd43(0x1f9)][_0x23cd43(0x20e)](_0x4e0e2a=>_0x4e0e2a[_0x23cd43(0x1dc)])[_0x23cd43(0x22c)](',\x20'))),0x1;}if(_0x345733){const _0x146427=_0x345733[_0x23cd43(0x1d8)](',')[_0x23cd43(0x20e)](_0x451ecc=>_0x451ecc[_0x23cd43(0x1c8)]()[_0x23cd43(0x242)]());_0x4981a0=_0x4981a0['filter'](_0x5019f3=>_0x5019f3[_0x23cd43(0x255)]?.[_0x23cd43(0x1df)](_0x3da208=>_0x146427[_0x23cd43(0x219)](_0x3da208['toLowerCase']())));if(_0x4981a0[_0x23cd43(0x25d)]===0x0){console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x253)](_0x23cd43(0x243)+_0x345733));const _0xb054c=new Set();return _0x2dceb0[_0x23cd43(0x1f9)][_0x23cd43(0x21f)](_0x138b7c=>_0x138b7c[_0x23cd43(0x255)]?.[_0x23cd43(0x21f)](_0x49ebdb=>_0xb054c['add'](_0x49ebdb))),_0xb054c[_0x23cd43(0x239)]>0x0?console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x22d)]('Available\x20tags:\x20'+[..._0xb054c][_0x23cd43(0x22c)](',\x20'))):console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x22d)](_0x23cd43(0x1f0))),0x1;}}if(_0x3cd00f)return this['executeReeval'](_0x4256c2,{'definition':{'tests':_0x4981a0},'agentInfo':_0x30486f,'outputFormat':_0x5358cd,'outputFile':_0x1892a0,'testNames':_0x4f1f24});if(_0x3322e6){console[_0x23cd43(0x1e0)](a5_0x195e9e['cyan'](_0x23cd43(0x1d2))),console[_0x23cd43(0x1e0)](_0x23cd43(0x1cd)+a5_0x195e9e[_0x23cd43(0x25a)](_0x206fb8)),console[_0x23cd43(0x1e0)](_0x23cd43(0x1d3)+a5_0x195e9e[_0x23cd43(0x25a)](_0x30486f[_0x23cd43(0x208)])),console[_0x23cd43(0x1e0)](_0x23cd43(0x252)+a5_0x195e9e['white'](_0x30486f[_0x23cd43(0x236)])),console[_0x23cd43(0x1e0)](),console[_0x23cd43(0x1e0)]('Tests\x20found:\x20'+a5_0x195e9e[_0x23cd43(0x25a)](_0x4981a0[_0x23cd43(0x25d)]));for(let _0x15f69f=0x0;_0x15f69f<_0x4981a0[_0x23cd43(0x25d)];_0x15f69f++){const _0x563de8=_0x4981a0[_0x15f69f],_0x5c2c07=_0x563de8[_0x23cd43(0x25e)][_0x23cd43(0x25d)]===0x1?_0x23cd43(0x247):_0x23cd43(0x25e),_0x199019=_0x563de8[_0x23cd43(0x255)]?.['length']?'\x20['+_0x563de8[_0x23cd43(0x255)]['join'](',\x20')+']':'';console[_0x23cd43(0x1e0)]('\x20\x20'+(_0x15f69f+0x1)+'.\x20'+a5_0x195e9e[_0x23cd43(0x25a)](_0x563de8[_0x23cd43(0x1dc)])+'\x20('+_0x563de8['rounds'][_0x23cd43(0x25d)]+'\x20'+_0x5c2c07+')'+a5_0x195e9e[_0x23cd43(0x22d)](_0x199019));}return 0x0;}let _0x4e5ada,_0x3ddc44;try{_0x4e5ada=await _0xf58706[_0x23cd43(0x1d7)][_0x23cd43(0x205)](_0x30486f[_0x23cd43(0x208)]);}catch(_0xe71fee){const _0x37510=_0xe71fee instanceof Error?_0xe71fee[_0x23cd43(0x204)]:String(_0xe71fee);return _0x37510['includes'](_0x23cd43(0x24c))||_0x37510['toLowerCase']()['includes'](_0x23cd43(0x211))?console['log'](a5_0x195e9e[_0x23cd43(0x1e9)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x30486f['projectName'])):console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x1e9)](_0x23cd43(0x22b)+_0x30486f[_0x23cd43(0x208)]+_0x23cd43(0x224)+_0x37510)),0x1;}try{_0x3ddc44=await _0xf58706[_0x23cd43(0x1d7)][_0x23cd43(0x233)](_0x30486f[_0x23cd43(0x236)],_0x4e5ada);}catch(_0x1628e2){const _0xe3a174=_0x1628e2 instanceof Error?_0x1628e2[_0x23cd43(0x204)]:String(_0x1628e2);return _0xe3a174['includes'](_0x23cd43(0x24c))||_0xe3a174[_0x23cd43(0x242)]()[_0x23cd43(0x219)](_0x23cd43(0x211))?console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x1e9)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x30486f[_0x23cd43(0x236)])):console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x1e9)](_0x23cd43(0x1fd)+_0x30486f[_0x23cd43(0x236)]+_0x23cd43(0x224)+_0xe3a174)),0x1;}let _0xb3ce92;if(!_0x541157)try{_0xb3ce92=await setupEvaluatorAgent(_0xf58706[_0x23cd43(0x1d7)],_0x32a1da[_0x23cd43(0x25b)]);}catch(_0x55edd2){const _0x40a5f7=_0x55edd2 instanceof Error?_0x55edd2[_0x23cd43(0x204)]:String(_0x55edd2);return console['log'](a5_0x195e9e['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x40a5f7)),0x1;}console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x258)]('Running\x20agent\x20tests...')),console[_0x23cd43(0x1e0)](_0x23cd43(0x24a)+a5_0x195e9e['white'](_0x206fb8)),console['log'](_0x23cd43(0x25c)+a5_0x195e9e[_0x23cd43(0x25a)](_0x30486f[_0x23cd43(0x208)]+'/'+_0x30486f[_0x23cd43(0x236)])),console['log']();const _0x254d04=[],_0x2e4f50=[],_0x400c7d=Date[_0x23cd43(0x261)]();for(let _0x23ab44=0x0;_0x23ab44<_0x4981a0[_0x23cd43(0x25d)];_0x23ab44++){const _0x2b4120=_0x4981a0[_0x23ab44];_0x4981a0['length']>0x1?console[_0x23cd43(0x1e0)](_0x23cd43(0x232)+(_0x23ab44+0x1)+'/'+_0x4981a0[_0x23cd43(0x25d)]+':\x20'+a5_0x195e9e['white'](_0x2b4120[_0x23cd43(0x1dc)])):console[_0x23cd43(0x1e0)](_0x23cd43(0x1f2)+a5_0x195e9e['white'](_0x2b4120[_0x23cd43(0x1dc)]));const _0x9df976=createCommandSpinner(_0x23cd43(0x251)+_0x2b4120[_0x23cd43(0x25e)][_0x23cd43(0x25d)]+_0x23cd43(0x21c));_0x9df976[_0x23cd43(0x21a)]();try{const {result:_0xb44819,conversation:_0x3ff1d6}=await runTest(_0xf58706[_0x23cd43(0x1d7)],_0x2b4120,{'agentId':_0x3ddc44,'projectId':_0x4e5ada,'site':_0x206fb8,'noEval':_0x541157,'evaluatorId':_0xb3ce92,'onRoundStart':(_0x5328e9,_0x940a61)=>{const _0x334868=_0x23cd43;_0x9df976[_0x334868(0x260)]=_0x334868(0x259)+(_0x5328e9+0x1)+'/'+_0x940a61+_0x334868(0x21c);},'onRoundComplete':(_0x280fc7,_0x460359,_0x2b20b5)=>{const _0x1e6a22=_0x23cd43,_0x2c1887=formatElapsed(_0x460359);_0x2b20b5?console['log'](_0x1e6a22(0x1f8)+(_0x280fc7+0x1)+'/'+_0x2b4120[_0x1e6a22(0x25e)][_0x1e6a22(0x25d)]+_0x1e6a22(0x1d4)+a5_0x195e9e[_0x1e6a22(0x254)]('✓')+'\x20('+_0x2c1887+')'):console[_0x1e6a22(0x1e0)](_0x1e6a22(0x1f8)+(_0x280fc7+0x1)+'/'+_0x2b4120[_0x1e6a22(0x25e)][_0x1e6a22(0x25d)]+'...\x20'+a5_0x195e9e[_0x1e6a22(0x1e9)]('✗'));},'onEvaluationStart':()=>{const _0x53c5ea=_0x23cd43;_0x9df976[_0x53c5ea(0x260)]=_0x53c5ea(0x248);},'onEvaluationComplete':_0x2da33f=>{const _0x48c32=formatElapsed(_0x2da33f);console['log']('\x20\x20Evaluating...\x20'+a5_0x195e9e['green']('✓')+'\x20('+_0x48c32+')');}});_0x9df976['stop'](),_0x254d04['push'](_0xb44819),_0x2e4f50['push'](_0x3ff1d6);if(_0xb44819['status']===_0x23cd43(0x1ef))console[_0x23cd43(0x1e0)](a5_0x195e9e['green']('✓\x20PASS:\x20'+_0xb44819['reason']));else _0xb44819['status']==='FAIL'?console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x1e9)]('✗\x20FAIL:\x20'+_0xb44819['reason'])):console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x1e9)](_0x23cd43(0x220)+_0xb44819[_0x23cd43(0x256)]));_0xb44819[_0x23cd43(0x1fc)]&&console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x22d)](_0x23cd43(0x264)+_0xb44819[_0x23cd43(0x1fc)])),console[_0x23cd43(0x1e0)]();}catch(_0x3e77aa){_0x9df976[_0x23cd43(0x1ec)]();const _0x5996b8=_0x3e77aa instanceof Error?_0x3e77aa[_0x23cd43(0x204)]:String(_0x3e77aa);console[_0x23cd43(0x1e0)](a5_0x195e9e['red'](_0x23cd43(0x220)+_0x5996b8)),console[_0x23cd43(0x1e0)](),_0x254d04[_0x23cd43(0x265)]({'name':_0x2b4120[_0x23cd43(0x1dc)],'status':_0x23cd43(0x1e3),'reason':_0x5996b8,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x5f35c3=Date[_0x23cd43(0x261)]()-_0x400c7d,_0x2f338a=_0x254d04[_0x23cd43(0x1e8)](_0x3aeb9d=>_0x3aeb9d[_0x23cd43(0x257)]==='PASS')[_0x23cd43(0x25d)],_0x42e315=_0x254d04['filter'](_0x4666da=>_0x4666da[_0x23cd43(0x257)]===_0x23cd43(0x22e))['length'],_0x29126e=_0x254d04[_0x23cd43(0x1e8)](_0x1abc26=>_0x1abc26[_0x23cd43(0x257)]==='ERROR')[_0x23cd43(0x25d)];console['log']('━'[_0x23cd43(0x1de)](0x3c)),console[_0x23cd43(0x1e0)](_0x23cd43(0x24e)),console['log']('━'[_0x23cd43(0x1de)](0x3c)),console['log'](_0x23cd43(0x221)+_0x254d04[_0x23cd43(0x25d)]),console[_0x23cd43(0x1e0)](_0x23cd43(0x1db)+a5_0x195e9e[_0x23cd43(0x254)](_0x2f338a)),console[_0x23cd43(0x1e0)](_0x23cd43(0x241)+a5_0x195e9e[_0x23cd43(0x1e9)](_0x42e315));_0x29126e>0x0&&console[_0x23cd43(0x1e0)](_0x23cd43(0x216)+a5_0x195e9e['red'](_0x29126e));console['log'](_0x23cd43(0x1f1)+formatElapsed(_0x5f35c3)),console[_0x23cd43(0x1e0)]('━'['repeat'](0x3c));const _0xfe3510=_0x254d04[_0x23cd43(0x1e8)](_0x508f3f=>_0x508f3f[_0x23cd43(0x257)]!==_0x23cd43(0x1ef));if(_0xfe3510[_0x23cd43(0x25d)]>0x0){console[_0x23cd43(0x1e0)](),console[_0x23cd43(0x1e0)](_0x23cd43(0x23d));for(const _0x3f4a17 of _0xfe3510){const _0x3efa5a=a5_0x195e9e[_0x23cd43(0x1e9)]('✗'),_0x3ded9d=_0x3f4a17['reason'][_0x23cd43(0x25d)]>0x32?_0x3f4a17[_0x23cd43(0x256)][_0x23cd43(0x250)](0x0,0x32)+'...':_0x3f4a17[_0x23cd43(0x256)];console[_0x23cd43(0x1e0)]('\x20\x20'+_0x3efa5a+'\x20'+_0x3f4a17['name']+':\x20'+_0x3ded9d);}}const _0x4e3ae1={'summary':{'total':_0x254d04[_0x23cd43(0x25d)],'passed':_0x2f338a,'failed':_0x42e315,'errors':_0x29126e>0x0?_0x29126e:undefined,'duration_ms':_0x5f35c3},'tests':_0x254d04,'agent':{'project':_0x30486f[_0x23cd43(0x208)],'name':_0x30486f['agentName'],'site':_0x206fb8},'timestamp':new Date(_0x400c7d)['toISOString']()};try{const _0x185732=buildCachedTestRun(_0x2e4f50,{'site':_0x206fb8,'projectId':_0x4e5ada,'projectName':_0x30486f[_0x23cd43(0x208)],'agentId':_0x3ddc44,'agentName':_0x30486f['agentName'],'testYmlPath':a5_0x4569b2['resolve'](_0x30486f[_0x23cd43(0x22a)])});saveLastTestRun(_0x185732);}catch{}if(_0x5358cd!==_0x23cd43(0x207)||_0x1892a0){const _0x42c639=formatResults(_0x4e3ae1,_0x5358cd);if(_0x1892a0)try{a5_0x371230[_0x23cd43(0x1d0)](_0x1892a0,_0x42c639,'utf-8'),console[_0x23cd43(0x1e0)](),console[_0x23cd43(0x1e0)](a5_0x195e9e[_0x23cd43(0x22d)]('Output\x20written\x20to:\x20'+_0x1892a0));}catch(_0x2d5200){return console[_0x23cd43(0x1e0)](),console['log'](a5_0x195e9e[_0x23cd43(0x1e9)]('Error\x20writing\x20output\x20file:\x20'+_0x2d5200)),0x1;}else console['log'](),console[_0x23cd43(0x1e0)](_0x42c639);}return _0xfe3510[_0x23cd43(0x25d)]>0x0?0x1:0x0;}async[a5_0x41b9d6(0x1d6)](_0x2d9b07,_0x4fd07b){const _0x22680a=a5_0x41b9d6,{options:_0x5e99e3,tdx:_0x5b93ec}=_0x2d9b07,{definition:_0x34773d,agentInfo:_0x42148f,outputFormat:_0x366699,outputFile:_0x4596e9}=_0x4fd07b,_0x3b94f6=_0x5e99e3[_0x22680a(0x20c)],_0x21e29a=loadLastTestRun();if(!_0x21e29a)return console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x1e9)](_0x22680a(0x230))),console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x22d)](_0x22680a(0x245))),0x1;if(_0x21e29a[_0x22680a(0x23a)][_0x22680a(0x236)]!==_0x42148f[_0x22680a(0x236)])return console['log'](a5_0x195e9e[_0x22680a(0x1e9)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x21e29a[_0x22680a(0x23a)][_0x22680a(0x236)]+_0x22680a(0x223)+_0x42148f['agentName']+'\x22.')),console['log'](a5_0x195e9e[_0x22680a(0x22d)](_0x22680a(0x1ce))),0x1;const _0x25a33f=new Set(_0x21e29a[_0x22680a(0x24b)]['map'](_0x1df8b0=>_0x1df8b0[_0x22680a(0x1ea)])),_0x203844=_0x34773d['tests'][_0x22680a(0x1e8)](_0x299cf1=>!_0x25a33f['has'](_0x299cf1[_0x22680a(0x1dc)]));if(_0x203844['length']>0x0&&_0x21e29a[_0x22680a(0x20c)]!==_0x3b94f6)return console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x1e9)](_0x22680a(0x266))),console['log'](a5_0x195e9e[_0x22680a(0x22d)](_0x22680a(0x1d5)+_0x21e29a[_0x22680a(0x20c)]+_0x22680a(0x20f)+_0x3b94f6+'\x22.')),console[_0x22680a(0x1e0)](a5_0x195e9e['dim'](_0x22680a(0x23e)+_0x21e29a[_0x22680a(0x20c)]+_0x22680a(0x212))),0x1;const _0xc5820c=_0x34773d[_0x22680a(0x1f9)][_0x22680a(0x1e8)](_0x3a8331=>_0x25a33f[_0x22680a(0x1f6)](_0x3a8331[_0x22680a(0x1dc)])),_0x67f185=_0x203844;let _0x16a7cb;try{_0x16a7cb=await setupEvaluatorAgent(_0x5b93ec['llm'],_0x5e99e3[_0x22680a(0x25b)]);}catch(_0x4d6f8b){const _0x25c24f=_0x4d6f8b instanceof Error?_0x4d6f8b[_0x22680a(0x204)]:String(_0x4d6f8b);return console[_0x22680a(0x1e0)](a5_0x195e9e['red'](_0x22680a(0x262)+_0x25c24f)),0x1;}console['log'](a5_0x195e9e[_0x22680a(0x258)](_0x22680a(0x225))),console[_0x22680a(0x1e0)]('Cached\x20run\x20from:\x20'+a5_0x195e9e[_0x22680a(0x25a)](_0x21e29a[_0x22680a(0x24f)])),console[_0x22680a(0x1e0)](_0x22680a(0x25c)+a5_0x195e9e['white'](_0x21e29a[_0x22680a(0x23a)][_0x22680a(0x208)]+'/'+_0x21e29a['agent'][_0x22680a(0x236)]));_0x67f185[_0x22680a(0x25d)]>0x0&&console['log'](_0x22680a(0x1e1)+a5_0x195e9e[_0x22680a(0x253)](_0x67f185[_0x22680a(0x25d)]));console[_0x22680a(0x1e0)]();const _0x4ff134=[],_0x53351d=Date['now'](),_0x5156ae=createCommandSpinner('Re-evaluating...');if(_0xc5820c[_0x22680a(0x25d)]>0x0)try{const _0x3847f8=await reevaluateFromCache(_0x5b93ec['llm'],_0x21e29a,{'tests':_0xc5820c},{'evaluatorId':_0x16a7cb,'onTestStart':(_0x61b277,_0x59fd39,_0x5a0ecb)=>{const _0x384f2b=_0x22680a;_0x5156ae['text']=_0x384f2b(0x22f)+(_0x59fd39+0x1)+'/'+_0x5a0ecb+':\x20'+_0x61b277+_0x384f2b(0x1fb);if(!_0x5156ae[_0x384f2b(0x213)])_0x5156ae[_0x384f2b(0x21a)]();},'onTestComplete':(_0x402385,_0xb39eec)=>{const _0x507eb6=_0x22680a;_0x5156ae['stop']();if(_0xb39eec[_0x507eb6(0x257)]===_0x507eb6(0x1ef))console['log'](a5_0x195e9e[_0x507eb6(0x254)](_0x507eb6(0x237)+_0x402385)+a5_0x195e9e[_0x507eb6(0x22d)]('\x20(cached)'));else _0xb39eec['status']==='FAIL'?console[_0x507eb6(0x1e0)](a5_0x195e9e[_0x507eb6(0x1e9)](_0x507eb6(0x206)+_0x402385+'\x20-\x20'+_0xb39eec[_0x507eb6(0x256)])+a5_0x195e9e[_0x507eb6(0x22d)](_0x507eb6(0x23b))):console[_0x507eb6(0x1e0)](a5_0x195e9e[_0x507eb6(0x1e9)](_0x507eb6(0x220)+_0x402385+_0x507eb6(0x21d)+_0xb39eec[_0x507eb6(0x256)]));_0xb39eec[_0x507eb6(0x1fc)]&&console[_0x507eb6(0x1e0)](a5_0x195e9e[_0x507eb6(0x22d)](_0x507eb6(0x1dd)+_0xb39eec[_0x507eb6(0x1fc)])),_0x4ff134[_0x507eb6(0x265)](_0xb39eec);},'onTestSkipped':(_0x1edf2b,_0x428da2)=>{const _0x581055=_0x22680a;_0x5156ae[_0x581055(0x1ec)](),console['log'](a5_0x195e9e['yellow'](_0x581055(0x20d)+_0x1edf2b+_0x581055(0x21d)+_0x428da2));}});for(const _0x134411 of _0x3847f8){!_0x4ff134[_0x22680a(0x1cb)](_0x589564=>_0x589564[_0x22680a(0x1dc)]===_0x134411[_0x22680a(0x1dc)])&&_0x4ff134['push'](_0x134411);}}catch(_0x7ee6a3){_0x5156ae[_0x22680a(0x1ec)]();const _0x2b4fd0=_0x7ee6a3 instanceof Error?_0x7ee6a3[_0x22680a(0x204)]:String(_0x7ee6a3);return console[_0x22680a(0x1e0)](a5_0x195e9e['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x2b4fd0)),0x1;}_0x5156ae[_0x22680a(0x1ec)]();if(_0x67f185[_0x22680a(0x25d)]>0x0){console[_0x22680a(0x1e0)](),console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x258)](_0x22680a(0x1ee)));const {projectId:_0x350a23,agentId:_0x4edbbe}=_0x21e29a[_0x22680a(0x23a)];for(const _0x5c91f2 of _0x67f185){console['log'](_0x22680a(0x23f)+a5_0x195e9e[_0x22680a(0x25a)](_0x5c91f2['name']));const _0x37cac8=createCommandSpinner(_0x22680a(0x251)+_0x5c91f2[_0x22680a(0x25e)][_0x22680a(0x25d)]+_0x22680a(0x21c));_0x37cac8[_0x22680a(0x21a)]();try{const {result:_0x331673}=await runTest(_0x5b93ec['llm'],_0x5c91f2,{'agentId':_0x4edbbe,'projectId':_0x350a23,'site':_0x21e29a[_0x22680a(0x20c)],'noEval':![],'evaluatorId':_0x16a7cb,'onRoundStart':(_0x274948,_0x570395)=>{const _0x5bb896=_0x22680a;_0x37cac8[_0x5bb896(0x260)]=_0x5bb896(0x259)+(_0x274948+0x1)+'/'+_0x570395+_0x5bb896(0x21c);},'onRoundComplete':(_0x44cdb0,_0x4fb1cb,_0x487abb)=>{const _0x5dab62=_0x22680a,_0x399a7b=formatElapsed(_0x4fb1cb);_0x487abb?console[_0x5dab62(0x1e0)]('\x20\x20Round\x20'+(_0x44cdb0+0x1)+'/'+_0x5c91f2[_0x5dab62(0x25e)][_0x5dab62(0x25d)]+'...\x20'+a5_0x195e9e[_0x5dab62(0x254)]('✓')+'\x20('+_0x399a7b+')'):console[_0x5dab62(0x1e0)](_0x5dab62(0x1f8)+(_0x44cdb0+0x1)+'/'+_0x5c91f2[_0x5dab62(0x25e)][_0x5dab62(0x25d)]+_0x5dab62(0x1d4)+a5_0x195e9e[_0x5dab62(0x1e9)]('✗'));},'onEvaluationStart':()=>{const _0x2a247c=_0x22680a;_0x37cac8[_0x2a247c(0x260)]=_0x2a247c(0x248);},'onEvaluationComplete':_0x48ef0b=>{const _0x189099=_0x22680a,_0x247b02=formatElapsed(_0x48ef0b);console[_0x189099(0x1e0)](_0x189099(0x1e6)+a5_0x195e9e[_0x189099(0x254)]('✓')+'\x20('+_0x247b02+')');}});_0x37cac8[_0x22680a(0x1ec)](),_0x4ff134[_0x22680a(0x265)](_0x331673);if(_0x331673[_0x22680a(0x257)]==='PASS')console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x254)](_0x22680a(0x237)+_0x331673[_0x22680a(0x256)])+a5_0x195e9e[_0x22680a(0x22d)](_0x22680a(0x1c9)));else _0x331673[_0x22680a(0x257)]===_0x22680a(0x22e)?console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x1e9)](_0x22680a(0x206)+_0x331673['reason'])+a5_0x195e9e[_0x22680a(0x22d)](_0x22680a(0x1c9))):console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x1e9)]('✗\x20ERROR:\x20'+_0x331673[_0x22680a(0x256)]));_0x331673[_0x22680a(0x1fc)]&&console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x22d)](_0x22680a(0x1dd)+_0x331673['conversation_url']));}catch(_0x2b8bc4){_0x37cac8[_0x22680a(0x1ec)]();const _0x33a078=_0x2b8bc4 instanceof Error?_0x2b8bc4[_0x22680a(0x204)]:String(_0x2b8bc4);console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x1e9)](_0x22680a(0x220)+_0x33a078)),_0x4ff134[_0x22680a(0x265)]({'name':_0x5c91f2['name'],'status':_0x22680a(0x1e3),'reason':_0x33a078,'timestamp':new Date()[_0x22680a(0x1d9)](),'duration_ms':0x0});}}}console[_0x22680a(0x1e0)]();const _0x2a030b=Date[_0x22680a(0x261)]()-_0x53351d,_0x424eed=_0x4ff134[_0x22680a(0x1e8)](_0x511f4b=>_0x511f4b[_0x22680a(0x257)]===_0x22680a(0x1ef))[_0x22680a(0x25d)],_0x1f6f64=_0x4ff134[_0x22680a(0x1e8)](_0x25a4a8=>_0x25a4a8[_0x22680a(0x257)]===_0x22680a(0x22e))[_0x22680a(0x25d)],_0x198747=_0x4ff134['filter'](_0x22f167=>_0x22f167[_0x22680a(0x257)]==='ERROR')[_0x22680a(0x25d)];console['log']('━'[_0x22680a(0x1de)](0x3c)),console[_0x22680a(0x1e0)]('Re-evaluation\x20Summary'),console[_0x22680a(0x1e0)]('━'[_0x22680a(0x1de)](0x3c)),console['log'](_0x22680a(0x221)+_0x4ff134[_0x22680a(0x25d)]),console['log'](_0x22680a(0x1db)+a5_0x195e9e[_0x22680a(0x254)](_0x424eed)),console[_0x22680a(0x1e0)](_0x22680a(0x241)+a5_0x195e9e[_0x22680a(0x1e9)](_0x1f6f64));_0x198747>0x0&&console[_0x22680a(0x1e0)](_0x22680a(0x216)+a5_0x195e9e['red'](_0x198747));console[_0x22680a(0x1e0)](_0x22680a(0x1f1)+formatElapsed(_0x2a030b)),console['log']('━'[_0x22680a(0x1de)](0x3c));const _0x2a4514={'summary':{'total':_0x4ff134[_0x22680a(0x25d)],'passed':_0x424eed,'failed':_0x1f6f64,'errors':_0x198747>0x0?_0x198747:undefined,'duration_ms':_0x2a030b},'tests':_0x4ff134,'agent':{'project':_0x42148f[_0x22680a(0x208)],'name':_0x42148f['agentName'],'site':_0x3b94f6},'timestamp':new Date(_0x53351d)[_0x22680a(0x1d9)]()};if(_0x366699!==_0x22680a(0x207)||_0x4596e9){const _0x20025f=formatResults(_0x2a4514,_0x366699);if(_0x4596e9)try{a5_0x371230[_0x22680a(0x1d0)](_0x4596e9,_0x20025f,_0x22680a(0x1e5)),console[_0x22680a(0x1e0)](),console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x22d)](_0x22680a(0x23c)+_0x4596e9));}catch(_0x5128a6){return console[_0x22680a(0x1e0)](),console[_0x22680a(0x1e0)](a5_0x195e9e[_0x22680a(0x1e9)](_0x22680a(0x235)+_0x5128a6)),0x1;}else console['log'](),console['log'](_0x20025f);}const _0x51046f=_0x4ff134[_0x22680a(0x1e8)](_0x3e275b=>_0x3e275b[_0x22680a(0x257)]!==_0x22680a(0x1ef));return _0x51046f[_0x22680a(0x25d)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x52d9a6=a6_0x58ea;(function(_0x459710,_0x55d99b){const _0x56eee3=a6_0x58ea,_0x22d2d4=_0x459710();while(!![]){try{const _0x36e1f5=-parseInt(_0x56eee3(0x1d6))/0x1*(-parseInt(_0x56eee3(0x1f0))/0x2)+parseInt(_0x56eee3(0x1be))/0x3+parseInt(_0x56eee3(0x1bb))/0x4*(parseInt(_0x56eee3(0x1b0))/0x5)+-parseInt(_0x56eee3(0x1af))/0x6+-parseInt(_0x56eee3(0x1da))/0x7*(parseInt(_0x56eee3(0x1df))/0x8)+-parseInt(_0x56eee3(0x1c7))/0x9*(parseInt(_0x56eee3(0x1c0))/0xa)+-parseInt(_0x56eee3(0x1dc))/0xb*(-parseInt(_0x56eee3(0x1bf))/0xc);if(_0x36e1f5===_0x55d99b)break;else _0x22d2d4['push'](_0x22d2d4['shift']());}catch(_0x2f8c67){_0x22d2d4['push'](_0x22d2d4['shift']());}}}(a6_0x2542,0xea4b8));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x52d9a6(0x1d0),a6_0x52d9a6(0x1ce),a6_0x52d9a6(0x1ed),a6_0x52d9a6(0x1b5),a6_0x52d9a6(0x1d3),a6_0x52d9a6(0x1d4),a6_0x52d9a6(0x1eb),'x-trino-user']);function a6_0x58ea(_0x119ae8,_0x57a797){_0x119ae8=_0x119ae8-0x1ae;const _0x2542b2=a6_0x2542();let _0x58eaa7=_0x2542b2[_0x119ae8];return _0x58eaa7;}function a6_0x2542(){const _0x15d08c=['headers','set-cookie','request','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','DELETE','Invalid\x20API\x20type:\x20','trino','104nMJzMr','entries','PATCH','2190792jvExSd','84VGWYKp','18472060lvaJXm','data','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','output','trim','\x22.\x20','PUT','9KrKUYB','keys','error','verbose','.\x20Valid\x20types:\x20','POST','log','proxy-authorization','length','authorization','cdp','message','set-cookie2','x-xsrf-token','includes','406733TLDOQZ','stack','header','status','6642734QegSDF','GET','2602413nBNtLR','.\x20Valid\x20methods:\x20','toLowerCase','8JBmHHO','execute','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Error:\x20','workflow','type','color','has','indexOf','site','join','description','x-auth-token','isArray','cookie','startsWith','\x0aStack\x20trace:\x0a','2ApWbZc','substring','method','validate','readBodyFromFile','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Invalid\x20header\x20format:\x20\x22','17424NKykgF','185705uaqjbv','llm-proxy','toUpperCase','llm'];a6_0x2542=function(){return _0x15d08c;};return a6_0x2542();}function isSensitiveHeader(_0x5b9c14){const _0x82662f=a6_0x52d9a6;return SENSITIVE_HEADERS[_0x82662f(0x1e6)](_0x5b9c14[_0x82662f(0x1de)]());}function parseHeader(_0x39e931){const _0x59a18d=a6_0x52d9a6,_0x19079a=_0x39e931[_0x59a18d(0x1e7)](':');if(_0x19079a===-0x1)throw new Error(_0x59a18d(0x1ae)+_0x39e931+_0x59a18d(0x1c5)+_0x59a18d(0x1c2));const _0x3bd1c6=_0x39e931[_0x59a18d(0x1f1)](0x0,_0x19079a)[_0x59a18d(0x1c4)](),_0x297a94=_0x39e931['substring'](_0x19079a+0x1)['trim']();if(!_0x3bd1c6)throw new Error(_0x59a18d(0x1f5)+_0x39e931+'\x22');return[_0x3bd1c6,_0x297a94];}export class ApiCommand extends BaseCommand{['name']='api';[a6_0x52d9a6(0x1ea)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x52d9a6(0x1f3)](_0x394cad){const _0x387350=a6_0x52d9a6,{args:_0x77dd49,options:_0x543c1d}=_0x394cad,_0x33b879=_0x543c1d;if(_0x77dd49[_0x387350(0x1cf)]===0x0)return _0x387350(0x1b7);const _0x481a83=_0x77dd49[0x0];if(!_0x481a83[_0x387350(0x1ee)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x481a83;const _0x12708b=_0x33b879[_0x387350(0x1c1)],_0x32ed3f=_0x33b879['file'];if(_0x12708b&&_0x32ed3f)return _0x387350(0x1e1);const _0x4d426d=_0x33b879['method']||_0x387350(0x1db),_0x1e714f=[_0x387350(0x1db),_0x387350(0x1cc),_0x387350(0x1c6),_0x387350(0x1b8),_0x387350(0x1bd)];if(!_0x1e714f[_0x387350(0x1d5)](_0x4d426d[_0x387350(0x1b2)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x4d426d+_0x387350(0x1dd)+_0x1e714f[_0x387350(0x1e9)](',\x20');const _0x3d9625=_0x33b879[_0x387350(0x1e4)]||'td',_0x378969=['td',_0x387350(0x1d1),_0x387350(0x1e3),_0x387350(0x1ba),_0x387350(0x1b3),_0x387350(0x1b1)];if(!_0x378969[_0x387350(0x1d5)](_0x3d9625))return _0x387350(0x1b9)+_0x3d9625+_0x387350(0x1cb)+_0x378969['join'](',\x20');return undefined;}async[a6_0x52d9a6(0x1e0)](_0x1c9e88){const _0x297062=a6_0x52d9a6,{options:_0xc5743,args:_0x2d4883,tdx:_0x1e3016}=_0x1c9e88,_0x2d37a0=_0xc5743,_0x58c291=_0x2d4883[0x0],_0x4b96ae=(_0x2d37a0[_0x297062(0x1f2)]||_0x297062(0x1db))[_0x297062(0x1b2)](),_0x141cad=_0x2d37a0[_0x297062(0x1c1)],_0x2743dc=_0x2d37a0['file'],_0x329617=_0x2d37a0[_0x297062(0x1d8)],_0x5551fd=_0x2d37a0[_0x297062(0x1e4)]||'td';try{const _0x42af4a={};if(_0x329617){const _0x31e861=Array[_0x297062(0x1ec)](_0x329617)?_0x329617:[_0x329617];for(const _0x230cc9 of _0x31e861){const [_0x38374e,_0x4292ab]=parseHeader(_0x230cc9);_0x42af4a[_0x38374e]=_0x4292ab;}}let _0x5f13fc;if(_0x141cad)_0x5f13fc=_0x141cad;else{if(_0x2743dc)try{_0x5f13fc=RawAPI[_0x297062(0x1f4)](_0x2743dc);}catch(_0x26a2b5){return console['error'](_0x297062(0x1e2)+(_0x26a2b5 instanceof Error?_0x26a2b5['message']:String(_0x26a2b5))),0x1;}}const _0x31d877={'method':_0x4b96ae,'apiType':_0x5551fd,'includeHeaders':_0xc5743[_0x297062(0x1ca)]};_0x5f13fc&&(_0x31d877['body']=_0x5f13fc);Object[_0x297062(0x1c8)](_0x42af4a)[_0x297062(0x1cf)]>0x0&&(_0x31d877['headers']=_0x42af4a);if(_0xc5743[_0x297062(0x1ca)]){const _0x3dfd87=resolveSite(_0xc5743[_0x297062(0x1e8)]),_0x5463b5=getEndpoint(_0x3dfd87,_0x5551fd),_0x45108b=''+_0x5463b5+_0x58c291;console[_0x297062(0x1c9)]('>\x20'+_0x4b96ae+'\x20'+_0x45108b);const _0x492acf=getAuthHeaders(_0x3dfd87),_0x5627da={..._0x492acf,..._0x42af4a};for(const [_0x156f64,_0x3cafaf]of Object[_0x297062(0x1bc)](_0x5627da)){!isSensitiveHeader(_0x156f64)&&console[_0x297062(0x1c9)]('>\x20'+_0x156f64+':\x20'+_0x3cafaf);}_0x5f13fc&&console[_0x297062(0x1c9)]('>'),console[_0x297062(0x1c9)]('');}const _0x5bcd71=await _0x1e3016['api'][_0x297062(0x1b6)](_0x58c291,_0x31d877);if(_0xc5743[_0x297062(0x1ca)]&&_0x5bcd71[_0x297062(0x1b4)]){console[_0x297062(0x1c9)]('<\x20HTTP/1.1\x20'+_0x5bcd71[_0x297062(0x1d9)]);for(const [_0x1d4620,_0x1ded29]of Object[_0x297062(0x1bc)](_0x5bcd71[_0x297062(0x1b4)])){!isSensitiveHeader(_0x1d4620)&&console['error']('<\x20'+_0x1d4620+':\x20'+_0x1ded29);}console[_0x297062(0x1c9)]('');}const _0x58f645=Boolean(_0xc5743['output']),_0x253c63={'color':_0xc5743[_0x297062(0x1e5)],'noColor':_0xc5743['noColor']||_0x58f645&&!_0xc5743['color']},_0x233836=colorizeJSON(_0x5bcd71[_0x297062(0x1c1)],_0x253c63);return _0xc5743[_0x297062(0x1c3)]?(writeFileSync(_0xc5743[_0x297062(0x1c3)],_0x233836),console[_0x297062(0x1c9)]('Results\x20saved\x20to\x20'+_0xc5743[_0x297062(0x1c3)])):console[_0x297062(0x1cd)](_0x233836),0x0;}catch(_0x3d0498){return _0x3d0498 instanceof Error?(console['error'](_0x297062(0x1e2)+_0x3d0498[_0x297062(0x1d2)]),_0xc5743[_0x297062(0x1ca)]&&_0x3d0498[_0x297062(0x1d7)]&&console[_0x297062(0x1c9)](_0x297062(0x1ef)+_0x3d0498['stack'])):console[_0x297062(0x1c9)](_0x297062(0x1e2)+String(_0x3d0498)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x4c49ae=a7_0x6f99;(function(_0x2c5e23,_0x1d96c4){const _0x2a5cad=a7_0x6f99,_0x2be48d=_0x2c5e23();while(!![]){try{const _0x4c9681=parseInt(_0x2a5cad(0x1c5))/0x1+-parseInt(_0x2a5cad(0x1aa))/0x2+parseInt(_0x2a5cad(0x1dc))/0x3*(parseInt(_0x2a5cad(0x1c3))/0x4)+parseInt(_0x2a5cad(0x1ad))/0x5*(-parseInt(_0x2a5cad(0x1ae))/0x6)+-parseInt(_0x2a5cad(0x1b4))/0x7*(-parseInt(_0x2a5cad(0x1c1))/0x8)+parseInt(_0x2a5cad(0x1e7))/0x9+parseInt(_0x2a5cad(0x1c7))/0xa*(parseInt(_0x2a5cad(0x1b6))/0xb);if(_0x4c9681===_0x1d96c4)break;else _0x2be48d['push'](_0x2be48d['shift']());}catch(_0x1b7462){_0x2be48d['push'](_0x2be48d['shift']());}}}(a7_0x4747,0x1fb7c));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x4747(){const _0x190f45=['customSite','Enter\x20site\x20name:','site','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Site\x20name\x20cannot\x20be\x20empty','API\x20key\x20cannot\x20be\x20empty','logLevel','Select\x20your\x20Treasure\x20Data\x20site:','36nhTlbv','\x20(profile:\x20','tdx:\x20auth\x20clear','Setting\x20up\x20authentication\x20for\x20site:\x20','Validating\x20API\x20key...','✓\x20Profile\x20\x27','tdx:\x20auth\x20setup','getUserInfo','yellow','tdx\x20profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','275508oxVtJK','log','Remove\x20API\x20key\x20from\x20system\x20keychain','bold','trim','✓\x20Default\x20site\x20set\x20to\x20','\x20for\x20profile:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20\x20tdx','Enter\x20your\x20TD\x20API\x20key:','join','last_name','✓\x20Authentication\x20successful\x0a','You\x20can\x20find\x20your\x20API\x20key\x20at:','profile','/app/mp/ak','warn','✓\x20API\x20key\x20removed\x20from\x20keychain','us01','No\x20API\x20key\x20found\x20in\x20keychain','90488UOpuJz','execute','\x20(site:\x20','10zYOZOF','728286ZcQyCC','description','text','filter','Name:\x20','status','283297xknMTO','name','22jhZAcz','message','User:\x20','select','auth','green','error','\x0aSetup\x20cancelled','apiKey','System\x20keychain\x20is\x20not\x20available','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','32hUaQmI','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','5188jKHFHU','create','100660wwcBlR','jobs','546010yBIcIG','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','red','email','\x27\x20registered','auth:clear','auth:setup','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✗\x20Validation\x20failed:\x20','first_name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','other'];a7_0x4747=function(){return _0x190f45;};return a7_0x4747();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x6f99(_0x570aa5,_0x3055bb){_0x570aa5=_0x570aa5-0x1a6;const _0x4747dd=a7_0x4747();let _0x6f992d=_0x4747dd[_0x570aa5];return _0x6f992d;}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x55b52f 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_0x25298f from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4c49ae(0x1b5)]=a7_0x4c49ae(0x1cd);[a7_0x4c49ae(0x1af)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x4c49ae(0x1ab)](_0x23abd5){const _0x5b605b=a7_0x4c49ae,{options:_0x393d11}=_0x23abd5,_0x2ef630=_0x393d11[_0x5b605b(0x1f5)];console[_0x5b605b(0x1e8)](a7_0x25298f[_0x5b605b(0x1ea)](_0x5b605b(0x1e2)));const _0x45c068=_0x393d11[_0x5b605b(0x1d5)]||_0x5b605b(0x1a8),{choices:_0x3ee31b,initialIndex:_0xe8e8ed}=buildSiteChoices(_0x45c068),_0x5c087e=_0x2ef630?_0x5b605b(0x1c2)+_0x2ef630+'):':_0x5b605b(0x1db),_0x20d019=await a7_0x55b52f({'type':_0x5b605b(0x1b9),'name':_0x5b605b(0x1d5),'message':_0x5c087e,'choices':_0x3ee31b,'initial':_0xe8e8ed});if(!_0x20d019[_0x5b605b(0x1d5)])return console['log'](_0x5b605b(0x1bd)),0x1;let _0x1f6ba0;if(_0x20d019[_0x5b605b(0x1d5)]===_0x5b605b(0x1d2)){const _0x5dbc9e=await a7_0x55b52f({'type':_0x5b605b(0x1b0),'name':_0x5b605b(0x1d3),'message':_0x5b605b(0x1d4),'initial':'us01','validate':_0x5a021f=>{const _0x5e6fdc=_0x5b605b;if(!_0x5a021f||!_0x5a021f[_0x5e6fdc(0x1eb)]())return _0x5e6fdc(0x1d8);if(!/^[a-z0-9-]+$/['test'](_0x5a021f[_0x5e6fdc(0x1eb)]()))return _0x5e6fdc(0x1e6);return!![];}});if(!_0x5dbc9e[_0x5b605b(0x1d3)])return console[_0x5b605b(0x1e8)](_0x5b605b(0x1bd)),0x1;_0x1f6ba0=_0x5dbc9e[_0x5b605b(0x1d3)];}else _0x1f6ba0=_0x20d019[_0x5b605b(0x1d5)];const _0x1664bd=resolveSite(_0x1f6ba0);console[_0x5b605b(0x1e8)](_0x5b605b(0x1df)+_0x1664bd),console[_0x5b605b(0x1e8)](_0x5b605b(0x1f4)),console[_0x5b605b(0x1e8)]('\x20\x20'+getConsoleUrl(_0x1664bd,_0x5b605b(0x1f6)));const _0xb9ebc6=await a7_0x55b52f({'type':'password','name':'apiKey','message':_0x5b605b(0x1f0),'validate':_0x4a2c5a=>{const _0x4b770b=_0x5b605b;if(!_0x4a2c5a||!_0x4a2c5a[_0x4b770b(0x1eb)]())return _0x4b770b(0x1d9);return!![];}});if(!_0xb9ebc6[_0x5b605b(0x1be)])return console[_0x5b605b(0x1e8)](_0x5b605b(0x1bd)),0x1;const _0x57363e=_0xb9ebc6['apiKey'];console[_0x5b605b(0x1e8)](_0x5b605b(0x1e0));try{const _0x5b8ee0=TDX[_0x5b605b(0x1c4)]({'site':_0x1664bd,'apiKey':_0x57363e[_0x5b605b(0x1eb)](),'logLevel':_0x393d11[_0x5b605b(0x1da)]??LogLevel['ERROR']}),_0x448ac7=await _0x5b8ee0[_0x5b605b(0x1c6)][_0x5b605b(0x1e3)]();console[_0x5b605b(0x1e8)](_0x5b605b(0x1ee)+_0x448ac7[_0x5b605b(0x1ca)]+')');const _0x550e9d=await isKeychainAvailable();_0x550e9d?(await saveAPIKeyAsync(_0x57363e[_0x5b605b(0x1eb)](),_0x1664bd,_0x2ef630),console['log'](_0x5b605b(0x1d6)+(_0x2ef630?_0x5b605b(0x1dd)+_0x2ef630+')':''))):(console[_0x5b605b(0x1a6)](a7_0x25298f[_0x5b605b(0x1e4)](_0x5b605b(0x1d7))),console[_0x5b605b(0x1a6)](a7_0x25298f[_0x5b605b(0x1e4)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x2ef630){const _0x348a1f={'site':_0x1664bd};saveProfileToUserConfig(_0x2ef630,_0x348a1f),console[_0x5b605b(0x1e8)](_0x5b605b(0x1e1)+_0x2ef630+_0x5b605b(0x1cb));}else saveDefaultSiteToUserConfig(_0x1664bd),console[_0x5b605b(0x1e8)](_0x5b605b(0x1ec)+_0x1664bd);const _0x55cfae=_0x2ef630?'\x20--profile\x20'+_0x2ef630:'';return console[_0x5b605b(0x1e8)](),console[_0x5b605b(0x1e8)](_0x5b605b(0x1d1)),console[_0x5b605b(0x1e8)]('\x20\x20tdx'+_0x55cfae+_0x5b605b(0x1c8)),console[_0x5b605b(0x1e8)](_0x5b605b(0x1ef)+_0x55cfae+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x44e0fe){if(_0x44e0fe instanceof HTTPClientError&&_0x44e0fe['status']===0x191)return printAuthError(_0x44e0fe),0x1;return console[_0x5b605b(0x1bc)](a7_0x25298f[_0x5b605b(0x1c9)](_0x5b605b(0x1cf)+(_0x44e0fe instanceof Error?_0x44e0fe[_0x5b605b(0x1b7)]:String(_0x44e0fe)))),console[_0x5b605b(0x1bc)](_0x5b605b(0x1c0)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4c49ae(0x1ba);[a7_0x4c49ae(0x1af)]=a7_0x4c49ae(0x1ce);async[a7_0x4c49ae(0x1ab)](_0x1e5810){const _0x2a554f=a7_0x4c49ae,{options:_0x16e030,tdx:_0x6c03ad}=_0x1e5810,_0x24056d=_0x16e030['site'],_0x118781=_0x16e030[_0x2a554f(0x1f5)],_0x3b5c48=_0x118781?_0x118781:'N/A';console[_0x2a554f(0x1e8)](_0x2a554f(0x1e5)+_0x3b5c48+_0x2a554f(0x1ac)+_0x24056d+')');const _0x311056=await resolveAPIKeyAsync(_0x24056d,_0x118781);if(_0x311056){const {source:_0x2b6838,isDeprecated:_0x5e2562}=_0x311056,_0x26304e='Read\x20credential\x20from\x20'+_0x2b6838;console[_0x2a554f(0x1e8)](_0x5e2562?a7_0x25298f['yellow'](_0x26304e):_0x26304e);}else console[_0x2a554f(0x1e8)](a7_0x25298f['yellow']('No\x20credential\x20found'));try{const _0x5511e5=await _0x6c03ad[_0x2a554f(0x1c6)][_0x2a554f(0x1e3)]();return console[_0x2a554f(0x1e8)](a7_0x25298f[_0x2a554f(0x1bb)](_0x2a554f(0x1f3))),console['log'](_0x2a554f(0x1b8)+_0x5511e5[_0x2a554f(0x1ca)]),(_0x5511e5[_0x2a554f(0x1d0)]||_0x5511e5['last_name'])&&console[_0x2a554f(0x1e8)](_0x2a554f(0x1b2)+[_0x5511e5[_0x2a554f(0x1d0)],_0x5511e5[_0x2a554f(0x1f2)]][_0x2a554f(0x1b1)](Boolean)[_0x2a554f(0x1f1)]('\x20')),0x0;}catch(_0x4f9bd3){return _0x4f9bd3 instanceof HTTPClientError&&_0x4f9bd3[_0x2a554f(0x1b3)]===0x191?printAuthError(_0x4f9bd3,!![],_0x118781):console['error'](a7_0x25298f[_0x2a554f(0x1c9)]('✗\x20Validation\x20failed:\x20'+(_0x4f9bd3 instanceof Error?_0x4f9bd3[_0x2a554f(0x1b7)]:String(_0x4f9bd3)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4c49ae(0x1b5)]=a7_0x4c49ae(0x1cc);['description']=a7_0x4c49ae(0x1e9);async[a7_0x4c49ae(0x1ab)](_0x93873c){const _0x1e824=a7_0x4c49ae,{options:_0x35854e}=_0x93873c,_0x427996=_0x35854e['profile'];console[_0x1e824(0x1e8)](a7_0x25298f[_0x1e824(0x1ea)](_0x1e824(0x1de)));const _0xc4c998=await isKeychainAvailable();if(!_0xc4c998)return console[_0x1e824(0x1bc)](a7_0x25298f['red'](_0x1e824(0x1bf))),0x1;const _0x2e5ce0=await deleteKeychainAPIKey(_0x427996);return _0x2e5ce0?(clearCredentialCache(),console['log'](_0x1e824(0x1a7)+(_0x427996?_0x1e824(0x1dd)+_0x427996+')':'')),0x0):(console[_0x1e824(0x1e8)](_0x1e824(0x1a9)+(_0x427996?_0x1e824(0x1ed)+_0x427996:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x4d9afb=a8_0x40dc;(function(_0x5c923d,_0x4accbe){const _0x2d47ba=a8_0x40dc,_0x4d8438=_0x5c923d();while(!![]){try{const _0x24d043=-parseInt(_0x2d47ba(0x153))/0x1+-parseInt(_0x2d47ba(0x144))/0x2*(-parseInt(_0x2d47ba(0x122))/0x3)+parseInt(_0x2d47ba(0x14e))/0x4*(-parseInt(_0x2d47ba(0x152))/0x5)+-parseInt(_0x2d47ba(0x130))/0x6+parseInt(_0x2d47ba(0x158))/0x7+-parseInt(_0x2d47ba(0x118))/0x8+parseInt(_0x2d47ba(0x150))/0x9*(parseInt(_0x2d47ba(0x133))/0xa);if(_0x24d043===_0x4accbe)break;else _0x4d8438['push'](_0x4d8438['shift']());}catch(_0x3dd696){_0x4d8438['push'](_0x4d8438['shift']());}}}(a8_0x247d,0x87474));import{BaseCommand}from'./command.js';function a8_0x40dc(_0x28be79,_0x295403){_0x28be79=_0x28be79-0x10b;const _0x247d71=a8_0x247d();let _0x40dcaf=_0x247d71[_0x28be79];return _0x40dcaf;}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(_0x3e1be4,_0x3b2c2d){const _0x19ef54=a8_0x40dc;if(_0x3e1be4 instanceof SDKError)console[_0x19ef54(0x13e)]('Error:\x20'+_0x3e1be4[_0x19ef54(0x13b)]),_0x3b2c2d[_0x19ef54(0x12b)]&&(_0x3e1be4[_0x19ef54(0x13a)]&&console['error']('\x20\x20Cause:\x20'+_0x3e1be4[_0x19ef54(0x13a)]),_0x3e1be4[_0x19ef54(0x123)]&&(console['error'](_0x19ef54(0x155)),console['error'](_0x3e1be4[_0x19ef54(0x123)])));else throw _0x3e1be4;}async function resolveAgentId(_0x3c00b9,_0x13a78d,_0x26166c,_0x1b85ae,_0x32d897){const _0x16a3ff=a8_0x40dc,_0x52d556=_0x13a78d||_0x26166c;if(_0x52d556){const {projectName:_0x41dfe9,agentName:_0x434012}=parseAgentRef(_0x52d556),_0x25c5ab=_0x434012||_0x52d556,_0x3f5f66=_0x434012?_0x41dfe9:_0x1b85ae;if(!_0x3f5f66)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x32d897){const _0x4d2ae8=_0x13a78d?'--agent\x20flag':_0x16a3ff(0x12a);console['error'](_0x16a3ff(0x11d)+_0x4d2ae8+':\x20'+_0x3f5f66+'/'+_0x25c5ab);}const _0x59029e=await withSpinner('Resolving\x20project\x20\x27'+_0x3f5f66+_0x16a3ff(0x11f),()=>_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x146)](_0x3f5f66),{'verbose':_0x32d897}),_0x49ac37=await withSpinner(_0x16a3ff(0x121)+_0x25c5ab+_0x16a3ff(0x11f),()=>_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x143)](_0x25c5ab,_0x59029e[_0x16a3ff(0x129)]),{'verbose':_0x32d897});return _0x49ac37[_0x16a3ff(0x129)];}else{const _0xa3ba4c=_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x128)]();if(_0xa3ba4c)return _0x32d897&&console[_0x16a3ff(0x13e)](_0x16a3ff(0x114)+_0xa3ba4c[_0x16a3ff(0x10e)]),_0xa3ba4c['id'];const _0x327671=await withSpinner(_0x16a3ff(0x127),()=>_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x137)](_0x16a3ff(0x132),0x0),{'verbose':_0x32d897});return _0x327671[_0x16a3ff(0x129)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4d9afb(0x10e)]='chat';[a8_0x4d9afb(0x139)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x4d9afb(0x151)](_0x3ac719){const _0x3ea475=a8_0x4d9afb,_0x2adc04=_0x3ac719['args'][_0x3ea475(0x116)]('\x20');if(!_0x2adc04)return _0x3ea475(0x11b);return undefined;}async[a8_0x4d9afb(0x148)](_0x55cc8c,_0x1687dc,_0x2de5ba,_0x15a4f9,_0xf6b692){const _0x4bf8f5=a8_0x4d9afb;for await(const _0x14684e of _0x55cc8c[_0x4bf8f5(0x12e)][_0x4bf8f5(0x149)](_0x1687dc,{'agentId':_0x2de5ba,'chatId':_0x15a4f9})){if(_0x14684e[_0x4bf8f5(0x115)]===_0x4bf8f5(0x135)){const _0x559e27=_0x14684e[_0x4bf8f5(0x129)]['chatId'];saveLastChatId(_0x559e27),_0xf6b692&&console[_0x4bf8f5(0x13e)](_0x4bf8f5(0x112)+_0x559e27);}else _0x14684e[_0x4bf8f5(0x115)]==='event'&&this[_0x4bf8f5(0x12f)](_0x14684e[_0x4bf8f5(0x129)]);}}async['streamChatJsonl'](_0x4487a9,_0x2ceec0,_0x7ef455,_0x2d8684){const _0x27dba9=a8_0x4d9afb,_0x1d6a08=_0x4487a9[_0x27dba9(0x10b)][_0x27dba9(0x11a)];let _0x1161e9=![];for await(const _0x58dcb4 of _0x4487a9[_0x27dba9(0x12e)][_0x27dba9(0x149)](_0x2ceec0,{'agentId':_0x7ef455,'chatId':_0x2d8684})){if(_0x58dcb4[_0x27dba9(0x115)]===_0x27dba9(0x135)){const _0x53a97b=_0x58dcb4[_0x27dba9(0x129)];saveLastChatId(_0x53a97b[_0x27dba9(0x125)]);const _0x338c29=_0x53a97b['projectId']&&_0x53a97b[_0x27dba9(0x124)]?getLLMConversationUrl(_0x1d6a08,_0x53a97b[_0x27dba9(0x120)],_0x53a97b[_0x27dba9(0x124)],_0x53a97b['chatId']):undefined;console[_0x27dba9(0x11e)](JSON['stringify']({'type':_0x27dba9(0x135),'data':{'chatId':_0x53a97b[_0x27dba9(0x125)],'agentId':_0x53a97b[_0x27dba9(0x124)],'consoleUrl':_0x338c29}})),_0x1161e9=!![];}else{if(_0x58dcb4[_0x27dba9(0x115)]==='event'){!_0x1161e9&&_0x2d8684&&(console[_0x27dba9(0x11e)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x2d8684}})),_0x1161e9=!![]);const _0x3a842e=_0x58dcb4[_0x27dba9(0x129)];if(_0x27dba9(0x111)in _0x3a842e)console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x111),'data':{'content':_0x3a842e[_0x27dba9(0x111)]}}));else{if(_0x27dba9(0x119)in _0x3a842e){const _0x15ac58=_0x3a842e[_0x27dba9(0x119)];console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':'tool_call','data':{'id':_0x15ac58['id'],'name':_0x15ac58['functionName'],'target':_0x15ac58[_0x27dba9(0x110)]?.[_0x27dba9(0x10e)]||_0x15ac58[_0x27dba9(0x14f)]?.[_0x27dba9(0x10e)]||_0x15ac58['targetWebSearchTool']?.[_0x27dba9(0x10e)]||_0x15ac58[_0x27dba9(0x142)]}}));}else{if(_0x27dba9(0x14d)in _0x3a842e)console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x10c),'data':{'id':_0x3a842e['tool']['id'],'name':_0x3a842e['tool'][_0x27dba9(0x11c)],'result':typeof _0x3a842e['tool'][_0x27dba9(0x111)]===_0x27dba9(0x140)?_0x3a842e[_0x27dba9(0x14d)]['content'][_0x27dba9(0x14b)](0x0,0x1f4):''}}));else _0x27dba9(0x13e)in _0x3a842e&&console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x13e),'data':{'error':_0x3a842e[_0x27dba9(0x13e)]}}));}}}}}console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x10d)}));}async[a8_0x4d9afb(0x134)](_0x2560c9){const _0x2b00cf=a8_0x4d9afb,{options:_0x17b9dc,args:_0x397cdc,tdx:_0x1271d8}=_0x2560c9,_0x4cf084=_0x397cdc[_0x2b00cf(0x116)]('\x20'),_0x4ad283=_0x17b9dc,_0x3b1597=_0x4ad283[_0x2b00cf(0x157)],_0x555c68=_0x4ad283[_0x2b00cf(0x117)],_0x3950fd=_0x4ad283[_0x2b00cf(0x12d)],_0x3dd6f2=_0x4ad283[_0x2b00cf(0x131)],_0x251b4f=_0x4ad283['chatId'],_0x14a268=_0x4ad283['stream'];if(_0x3dd6f2&&_0x251b4f)return console[_0x2b00cf(0x13e)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x5293f9,_0x1c6430;if(_0x251b4f)_0x1c6430=_0x251b4f;else!_0x3dd6f2&&(_0x1c6430=loadLastChatId(),_0x1c6430&&_0x17b9dc[_0x2b00cf(0x12b)]&&console[_0x2b00cf(0x13e)](_0x2b00cf(0x12c)+_0x1c6430));!_0x251b4f&&(_0x3dd6f2||!_0x1c6430)&&(_0x5293f9=await resolveAgentId(_0x1271d8,_0x3b1597,_0x555c68,_0x3950fd,_0x17b9dc[_0x2b00cf(0x12b)]));const _0x1a4d18=_0x14a268?(_0x21b853,_0x40d702,_0x3388d1)=>this[_0x2b00cf(0x141)](_0x1271d8,_0x21b853,_0x40d702,_0x3388d1):(_0x34e655,_0x27acda,_0x47d3cf)=>this['streamChat'](_0x1271d8,_0x34e655,_0x27acda,_0x47d3cf,_0x17b9dc[_0x2b00cf(0x12b)]);try{await _0x1a4d18(_0x4cf084,_0x5293f9,_0x1c6430);}catch(_0x5ae42b){const _0x4881a0=_0x5ae42b instanceof SDKError&&_0x5ae42b['code']===ErrorCode[_0x2b00cf(0x10f)]||_0x5ae42b instanceof Error&&_0x5ae42b[_0x2b00cf(0x13b)]['includes'](_0x2b00cf(0x14c));if(_0x4881a0&&_0x251b4f)return console[_0x2b00cf(0x13e)](_0x2b00cf(0x154)+_0x251b4f+_0x2b00cf(0x138)),0x1;if(_0x4881a0)_0x17b9dc[_0x2b00cf(0x12b)]&&console[_0x2b00cf(0x13e)](_0x2b00cf(0x147)),!_0x5293f9&&(_0x5293f9=await resolveAgentId(_0x1271d8,_0x3b1597,_0x555c68,_0x3950fd,_0x17b9dc[_0x2b00cf(0x12b)])),await _0x1a4d18(_0x4cf084,_0x5293f9,undefined);else throw _0x5ae42b;}return!_0x14a268&&console[_0x2b00cf(0x11e)](),0x0;}catch(_0x6d9f4b){return console[_0x2b00cf(0x13e)](),handleSDKError(_0x6d9f4b,_0x17b9dc),0x1;}}[a8_0x4d9afb(0x12f)](_0x12dad1){const _0xf401a2=a8_0x4d9afb;if(_0xf401a2(0x111)in _0x12dad1)process[_0xf401a2(0x13f)][_0xf401a2(0x113)](_0x12dad1[_0xf401a2(0x111)]);else'error'in _0x12dad1&&console['error'](_0xf401a2(0x145)+_0x12dad1['error']);}}function a8_0x247d(){const _0x5c2967=['chat-create','agent','2011772IOSTeL','context','tool_result','done','name','CHAT_NOT_FOUND','targetKnowledgeBase','content','Chat\x20session:\x20','write','Using\x20cached\x20default\x20agent:\x20','type','join','llmAgent','2845392QQwOyF','tool_call','site','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','functionName','Using\x20agent\x20from\x20','log','\x27...','projectId','Resolving\x20agent\x20\x27','6xsnIoM','stack','agentId','chatId','options','Getting\x20default\x20agent...','getDefaultAgent','data','session\x20context','verbose','Continuing\x20chat:\x20','llmProject','llm','handleChatEvent','3879768GEnUmb','new','claude-4.5-haiku','6430qgsrwm','execute','metadata','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','getOrCreateDefaultAgent','\x27\x20not\x20found','description','cause','message','stringify','Create\x20a\x20new\x20chat\x20session','error','stdout','string','streamChatJsonl','targetFunction','resolveAgentId','604848iYEnEu','\x0aError:\x20','resolveProjectId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','streamChat','chat','startChat','slice','404','tool','92eSUusa','targetAgent','22878iryWgq','validate','45260rysEnm','762152ETuEdM','Error:\x20Chat\x20session\x20\x27','\x0aStack\x20trace:'];a8_0x247d=function(){return _0x5c2967;};return a8_0x247d();}export class ChatCreateCommand extends BaseCommand{[a8_0x4d9afb(0x10e)]=a8_0x4d9afb(0x156);[a8_0x4d9afb(0x139)]=a8_0x4d9afb(0x13d);[a8_0x4d9afb(0x151)](_0xbcd7a2){const _0x1ed22a=a8_0x4d9afb,_0x1f8233=_0xbcd7a2[_0x1ed22a(0x126)],_0x2c18a9=_0x1f8233[_0x1ed22a(0x157)],_0x2749c2=_0x1f8233['llmAgent'];if(!_0x2c18a9&&!_0x2749c2)return _0x1ed22a(0x136);return undefined;}async[a8_0x4d9afb(0x134)](_0x4b19d9){const _0x2a7164=a8_0x4d9afb,{options:_0x4699fa,tdx:_0x4ba69c}=_0x4b19d9,_0x4373f6=_0x4699fa,_0x317a59=_0x4373f6[_0x2a7164(0x157)],_0x443cee=_0x4373f6[_0x2a7164(0x117)],_0x1b7111=_0x4373f6[_0x2a7164(0x12d)];try{const _0x55da56=await resolveAgentId(_0x4ba69c,_0x317a59,_0x443cee,_0x1b7111,_0x4699fa[_0x2a7164(0x12b)]),_0x5e0815=await _0x4ba69c[_0x2a7164(0x12e)][_0x2a7164(0x14a)](_0x55da56);return saveLastChatId(_0x5e0815['id']),console['log'](JSON['stringify']({'chatId':_0x5e0815['id'],'agentId':_0x55da56})),0x0;}catch(_0x1765b4){return handleSDKError(_0x1765b4,_0x4699fa),0x1;}}}
|
|
1
|
+
const a8_0x4cdd0f=a8_0x2481;(function(_0x1f2313,_0xd3a14){const _0x20679e=a8_0x2481,_0x223317=_0x1f2313();while(!![]){try{const _0x1d57ef=parseInt(_0x20679e(0x1f8))/0x1+parseInt(_0x20679e(0x1f6))/0x2*(-parseInt(_0x20679e(0x1e5))/0x3)+parseInt(_0x20679e(0x1f3))/0x4*(parseInt(_0x20679e(0x1f9))/0x5)+-parseInt(_0x20679e(0x1ca))/0x6*(-parseInt(_0x20679e(0x1cd))/0x7)+-parseInt(_0x20679e(0x203))/0x8+parseInt(_0x20679e(0x1de))/0x9+-parseInt(_0x20679e(0x1bf))/0xa*(parseInt(_0x20679e(0x1e7))/0xb);if(_0x1d57ef===_0xd3a14)break;else _0x223317['push'](_0x223317['shift']());}catch(_0x2422cc){_0x223317['push'](_0x223317['shift']());}}}(a8_0x2d1c,0xb16da));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x2481(_0x1f21ea,_0x3a8576){_0x1f21ea=_0x1f21ea-0x1ba;const _0x2d1c12=a8_0x2d1c();let _0x24815a=_0x2d1c12[_0x1f21ea];return _0x24815a;}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(_0x142a9f,_0x277d89){const _0x25e554=a8_0x2481;if(_0x142a9f instanceof SDKError)console[_0x25e554(0x202)](_0x25e554(0x204)+_0x142a9f[_0x25e554(0x1c2)]),_0x277d89[_0x25e554(0x20c)]&&(_0x142a9f[_0x25e554(0x1f4)]&&console['error'](_0x25e554(0x1d3)+_0x142a9f[_0x25e554(0x1f4)]),_0x142a9f[_0x25e554(0x209)]&&(console['error'](_0x25e554(0x1c0)),console['error'](_0x142a9f[_0x25e554(0x209)])));else throw _0x142a9f;}function a8_0x2d1c(){const _0x13a269=['No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','verbose','404','join','targetKnowledgeBase','options','agentId','Resolving\x20project\x20\x27','18310bMwFsK','\x0aStack\x20trace:','content','message','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','llm','Using\x20cached\x20default\x20agent:\x20','write','resolveProjectId','--agent\x20flag','Chat\x20session:\x20','6uGJrdx','Continuing\x20chat:\x20','string','4675811hDdtbr','includes','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','data','chat','targetAgent','\x20\x20Cause:\x20','args','getOrCreateDefaultAgent','\x0aError:\x20','llmAgent','getDefaultAgent','tool','context','chatId','functionName','event','3685950SszxCc','name','CHAT_NOT_FOUND','claude-4.5-haiku','slice','log','new','3IxxPUU','tool_call','7326OjxBzZ','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','description','type','agent','\x27...','\x27\x20not\x20found','stringify','done','Getting\x20default\x20agent...','stdout','stream','3465668yQXnhj','cause','startChat','122622DORMzr','Error:\x20Chat\x20session\x20\x27','1350558CpWjms','5KLxcHE','handleChatEvent','metadata','projectId','targetFunction','execute','Resolving\x20agent\x20\x27','resolveAgentId','streamChatJsonl','error','10295960LSXRFU','Error:\x20','llmProject','Using\x20agent\x20from\x20','site','targetWebSearchTool','stack','validate'];a8_0x2d1c=function(){return _0x13a269;};return a8_0x2d1c();}async function resolveAgentId(_0x120cde,_0x3b80c5,_0x2e8a0f,_0x4f6dd4,_0x5cbcfa){const _0x3e7f66=a8_0x2481,_0x1f6442=_0x3b80c5||_0x2e8a0f;if(_0x1f6442){const {projectName:_0x2dbb23,agentName:_0x3ccf3a}=parseAgentRef(_0x1f6442),_0xc98c4=_0x3ccf3a||_0x1f6442,_0x2952cc=_0x3ccf3a?_0x2dbb23:_0x4f6dd4;if(!_0x2952cc)throw new Error(_0x3e7f66(0x20b));if(_0x5cbcfa){const _0x42b65d=_0x3b80c5?_0x3e7f66(0x1c8):'session\x20context';console['error'](_0x3e7f66(0x206)+_0x42b65d+':\x20'+_0x2952cc+'/'+_0xc98c4);}const _0x2998b0=await withSpinner(_0x3e7f66(0x1be)+_0x2952cc+_0x3e7f66(0x1ec),()=>_0x120cde[_0x3e7f66(0x1c4)][_0x3e7f66(0x1c7)](_0x2952cc),{'verbose':_0x5cbcfa}),_0x5a4fc4=await withSpinner(_0x3e7f66(0x1ff)+_0xc98c4+_0x3e7f66(0x1ec),()=>_0x120cde[_0x3e7f66(0x1c4)][_0x3e7f66(0x200)](_0xc98c4,_0x2998b0[_0x3e7f66(0x1d0)]),{'verbose':_0x5cbcfa});return _0x5a4fc4[_0x3e7f66(0x1d0)];}else{const _0x56c928=_0x120cde[_0x3e7f66(0x1c4)][_0x3e7f66(0x1d8)]();if(_0x56c928)return _0x5cbcfa&&console[_0x3e7f66(0x202)](_0x3e7f66(0x1c5)+_0x56c928['name']),_0x56c928['id'];const _0x40ce43=await withSpinner(_0x3e7f66(0x1f0),()=>_0x120cde[_0x3e7f66(0x1c4)][_0x3e7f66(0x1d5)](_0x3e7f66(0x1e1),0x0),{'verbose':_0x5cbcfa});return _0x40ce43[_0x3e7f66(0x1d0)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4cdd0f(0x1df)]=a8_0x4cdd0f(0x1d1);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x4cdd0f(0x20a)](_0x3fa42b){const _0xb37316=a8_0x4cdd0f,_0x1119f9=_0x3fa42b[_0xb37316(0x1d4)][_0xb37316(0x1ba)]('\x20');if(!_0x1119f9)return _0xb37316(0x1c3);return undefined;}async['streamChat'](_0x5af36c,_0x23dc5f,_0x2599fb,_0x591d4f,_0x92eeb2){const _0x45d98b=a8_0x4cdd0f;for await(const _0x2681d6 of _0x5af36c[_0x45d98b(0x1c4)][_0x45d98b(0x1d1)](_0x23dc5f,{'agentId':_0x2599fb,'chatId':_0x591d4f})){if(_0x2681d6[_0x45d98b(0x1ea)]===_0x45d98b(0x1fb)){const _0x2b4015=_0x2681d6[_0x45d98b(0x1d0)][_0x45d98b(0x1db)];saveLastChatId(_0x2b4015),_0x92eeb2&&console[_0x45d98b(0x202)](_0x45d98b(0x1c9)+_0x2b4015);}else _0x2681d6[_0x45d98b(0x1ea)]===_0x45d98b(0x1dd)&&this[_0x45d98b(0x1fa)](_0x2681d6['data']);}}async[a8_0x4cdd0f(0x201)](_0xe837da,_0x18beba,_0x305031,_0xe0d7bf){const _0x542739=a8_0x4cdd0f,_0x502f42=_0xe837da[_0x542739(0x1da)][_0x542739(0x207)];let _0x3d9298=![];for await(const _0x2dcb08 of _0xe837da[_0x542739(0x1c4)][_0x542739(0x1d1)](_0x18beba,{'agentId':_0x305031,'chatId':_0xe0d7bf})){if(_0x2dcb08['type']===_0x542739(0x1fb)){const _0x1b6f89=_0x2dcb08[_0x542739(0x1d0)];saveLastChatId(_0x1b6f89[_0x542739(0x1db)]);const _0x5a27c4=_0x1b6f89[_0x542739(0x1fc)]&&_0x1b6f89[_0x542739(0x1bd)]?getLLMConversationUrl(_0x502f42,_0x1b6f89[_0x542739(0x1fc)],_0x1b6f89[_0x542739(0x1bd)],_0x1b6f89[_0x542739(0x1db)]):undefined;console['log'](JSON['stringify']({'type':'metadata','data':{'chatId':_0x1b6f89[_0x542739(0x1db)],'agentId':_0x1b6f89['agentId'],'consoleUrl':_0x5a27c4}})),_0x3d9298=!![];}else{if(_0x2dcb08[_0x542739(0x1ea)]===_0x542739(0x1dd)){!_0x3d9298&&_0xe0d7bf&&(console[_0x542739(0x1e3)](JSON[_0x542739(0x1ee)]({'type':_0x542739(0x1fb),'data':{'chatId':_0xe0d7bf}})),_0x3d9298=!![]);const _0x3322ba=_0x2dcb08[_0x542739(0x1d0)];if(_0x542739(0x1c1)in _0x3322ba)console['log'](JSON[_0x542739(0x1ee)]({'type':_0x542739(0x1c1),'data':{'content':_0x3322ba['content']}}));else{if(_0x542739(0x1e6)in _0x3322ba){const _0x528e32=_0x3322ba['tool_call'];console[_0x542739(0x1e3)](JSON[_0x542739(0x1ee)]({'type':'tool_call','data':{'id':_0x528e32['id'],'name':_0x528e32['functionName'],'target':_0x528e32[_0x542739(0x1bb)]?.[_0x542739(0x1df)]||_0x528e32[_0x542739(0x1d2)]?.[_0x542739(0x1df)]||_0x528e32[_0x542739(0x208)]?.[_0x542739(0x1df)]||_0x528e32[_0x542739(0x1fd)]}}));}else{if(_0x542739(0x1d9)in _0x3322ba)console[_0x542739(0x1e3)](JSON[_0x542739(0x1ee)]({'type':'tool_result','data':{'id':_0x3322ba[_0x542739(0x1d9)]['id'],'name':_0x3322ba[_0x542739(0x1d9)][_0x542739(0x1dc)],'result':typeof _0x3322ba['tool'][_0x542739(0x1c1)]===_0x542739(0x1cc)?_0x3322ba[_0x542739(0x1d9)]['content'][_0x542739(0x1e2)](0x0,0x1f4):''}}));else'error'in _0x3322ba&&console[_0x542739(0x1e3)](JSON[_0x542739(0x1ee)]({'type':_0x542739(0x202),'data':{'error':_0x3322ba['error']}}));}}}}}console['log'](JSON[_0x542739(0x1ee)]({'type':_0x542739(0x1ef)}));}async[a8_0x4cdd0f(0x1fe)](_0x3a56f0){const _0x54acc7=a8_0x4cdd0f,{options:_0x171f52,args:_0x595a42,tdx:_0x65270a}=_0x3a56f0,_0x1d3d07=_0x595a42[_0x54acc7(0x1ba)]('\x20'),_0x3ac7fa=_0x171f52,_0x4b37eb=_0x3ac7fa[_0x54acc7(0x1eb)],_0x9b9e91=_0x3ac7fa[_0x54acc7(0x1d7)],_0x127b00=_0x3ac7fa['llmProject'],_0x51074f=_0x3ac7fa[_0x54acc7(0x1e4)],_0x251a6e=_0x3ac7fa['chatId'],_0x30686f=_0x3ac7fa[_0x54acc7(0x1f2)];if(_0x51074f&&_0x251a6e)return console[_0x54acc7(0x202)](_0x54acc7(0x1e8)),0x1;try{let _0xc7d7eb,_0x182701;if(_0x251a6e)_0x182701=_0x251a6e;else!_0x51074f&&(_0x182701=loadLastChatId(),_0x182701&&_0x171f52['verbose']&&console[_0x54acc7(0x202)](_0x54acc7(0x1cb)+_0x182701));!_0x251a6e&&(_0x51074f||!_0x182701)&&(_0xc7d7eb=await resolveAgentId(_0x65270a,_0x4b37eb,_0x9b9e91,_0x127b00,_0x171f52['verbose']));const _0x5be76b=_0x30686f?(_0x4175d4,_0x4a67c4,_0x57789d)=>this[_0x54acc7(0x201)](_0x65270a,_0x4175d4,_0x4a67c4,_0x57789d):(_0x4c8dac,_0x2bf065,_0x3cd5e3)=>this['streamChat'](_0x65270a,_0x4c8dac,_0x2bf065,_0x3cd5e3,_0x171f52[_0x54acc7(0x20c)]);try{await _0x5be76b(_0x1d3d07,_0xc7d7eb,_0x182701);}catch(_0x41fc05){const _0x20588c=_0x41fc05 instanceof SDKError&&_0x41fc05['code']===ErrorCode[_0x54acc7(0x1e0)]||_0x41fc05 instanceof Error&&_0x41fc05[_0x54acc7(0x1c2)][_0x54acc7(0x1ce)](_0x54acc7(0x20d));if(_0x20588c&&_0x251a6e)return console[_0x54acc7(0x202)](_0x54acc7(0x1f7)+_0x251a6e+_0x54acc7(0x1ed)),0x1;if(_0x20588c)_0x171f52[_0x54acc7(0x20c)]&&console[_0x54acc7(0x202)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0xc7d7eb&&(_0xc7d7eb=await resolveAgentId(_0x65270a,_0x4b37eb,_0x9b9e91,_0x127b00,_0x171f52[_0x54acc7(0x20c)])),await _0x5be76b(_0x1d3d07,_0xc7d7eb,undefined);else throw _0x41fc05;}return!_0x30686f&&console[_0x54acc7(0x1e3)](),0x0;}catch(_0x20a5a4){return console[_0x54acc7(0x202)](),handleSDKError(_0x20a5a4,_0x171f52),0x1;}}['handleChatEvent'](_0xa765dd){const _0x5bb7d5=a8_0x4cdd0f;if(_0x5bb7d5(0x1c1)in _0xa765dd)process[_0x5bb7d5(0x1f1)][_0x5bb7d5(0x1c6)](_0xa765dd[_0x5bb7d5(0x1c1)]);else _0x5bb7d5(0x202)in _0xa765dd&&console[_0x5bb7d5(0x202)](_0x5bb7d5(0x1d6)+_0xa765dd['error']);}}export class ChatCreateCommand extends BaseCommand{['name']='chat-create';[a8_0x4cdd0f(0x1e9)]='Create\x20a\x20new\x20chat\x20session';[a8_0x4cdd0f(0x20a)](_0x378daf){const _0x370f09=a8_0x4cdd0f,_0x34b48b=_0x378daf[_0x370f09(0x1bc)],_0x2fcea0=_0x34b48b[_0x370f09(0x1eb)],_0x2fd3c7=_0x34b48b['llmAgent'];if(!_0x2fcea0&&!_0x2fd3c7)return _0x370f09(0x1cf);return undefined;}async[a8_0x4cdd0f(0x1fe)](_0x349ea6){const _0x504fcb=a8_0x4cdd0f,{options:_0x4ce530,tdx:_0x500b41}=_0x349ea6,_0xe2d6a4=_0x4ce530,_0xec3550=_0xe2d6a4[_0x504fcb(0x1eb)],_0x50d205=_0xe2d6a4[_0x504fcb(0x1d7)],_0x5946d3=_0xe2d6a4[_0x504fcb(0x205)];try{const _0x11b6ed=await resolveAgentId(_0x500b41,_0xec3550,_0x50d205,_0x5946d3,_0x4ce530[_0x504fcb(0x20c)]),_0x299ba8=await _0x500b41[_0x504fcb(0x1c4)][_0x504fcb(0x1f5)](_0x11b6ed);return saveLastChatId(_0x299ba8['id']),console['log'](JSON['stringify']({'chatId':_0x299ba8['id'],'agentId':_0x11b6ed})),0x0;}catch(_0xb9bd03){return handleSDKError(_0xb9bd03,_0x4ce530),0x1;}}}
|