@treasuredata/tdx 0.28.6 → 0.28.8
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/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.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/upgrade-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/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-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/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.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/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x3e9411=a3_0x25b2;(function(_0x13f812,_0x3df6d2){const _0x2190b3=a3_0x25b2,_0x306333=_0x13f812();while(!![]){try{const _0x329217=parseInt(_0x2190b3(0x173))/0x1+parseInt(_0x2190b3(0x15e))/0x2+parseInt(_0x2190b3(0x15f))/0x3+parseInt(_0x2190b3(0x17c))/0x4*(-parseInt(_0x2190b3(0x15c))/0x5)+parseInt(_0x2190b3(0x174))/0x6*(parseInt(_0x2190b3(0x16f))/0x7)+-parseInt(_0x2190b3(0x163))/0x8*(-parseInt(_0x2190b3(0x170))/0x9)+-parseInt(_0x2190b3(0x169))/0xa*(parseInt(_0x2190b3(0x165))/0xb);if(_0x329217===_0x3df6d2)break;else _0x306333['push'](_0x306333['shift']());}catch(_0x5070dc){_0x306333['push'](_0x306333['shift']());}}}(a3_0xfd25,0x3535f));function a3_0x25b2(_0x1daae6,_0x40735c){_0x1daae6=_0x1daae6-0x15c;const _0xfd2591=a3_0xfd25();let _0x25b21e=_0xfd2591[_0x1daae6];return _0x25b21e;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0xfd25(){const _0x5916b3=['cause','8452CiXYEI','execute','error','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','activations','330YnvHqE','Listing\x20activations\x20for\x20segment\x20\x27','623992kIjiov','80898QnLAAI','resolveParentId','verbose','Child\x20name:\x20','342296LrjgOf','segment','33ktvoKz','name','\x20activation','Resolving\x20child\x20segment\x20\x27','709760dwjVsS','length','Resolved\x20child\x20ID:\x20','Resolved\x20parent\x20ID:\x20','List\x20activations\x20for\x20a\x20segment','Error:\x20Segment\x20name\x20is\x20required','66591EzdAdd','9KmhNWl','✔\x20Found\x20','\x20\x20Cause:\x20','26867qokUcd','102CAwRmZ','description','data','Parent\x20name:\x20','\x27...','Error:\x20','Resolving\x20parent\x20segment\x20\x27'];a3_0xfd25=function(){return _0x5916b3;};return a3_0xfd25();}export class ActivationsCommand extends BaseCommand{[a3_0x3e9411(0x166)]=a3_0x3e9411(0x180);[a3_0x3e9411(0x175)]=a3_0x3e9411(0x16d);async[a3_0x3e9411(0x17d)](_0xfb46d3){const _0x5906cf=a3_0x3e9411,{options:_0x155891,args:_0x89ecf4,tdx:_0x4c3c54}=_0xfb46d3;if(_0x89ecf4[_0x5906cf(0x16a)]===0x0)return console[_0x5906cf(0x17e)](_0x5906cf(0x16e)),console['error'](_0x5906cf(0x17f)),0x1;try{const {parentId:_0x568b75,childId:_0x1a09da}=parseSegmentRef(_0x89ecf4[0x0]);if(!_0x1a09da)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x5906cf(0x17e)](_0x5906cf(0x17f)),0x1;_0x155891[_0x5906cf(0x161)]&&(console['error']('Site:\x20'+_0x155891['site']),console[_0x5906cf(0x17e)](_0x5906cf(0x177)+_0x568b75),console[_0x5906cf(0x17e)](_0x5906cf(0x162)+_0x1a09da));const _0x31e765=await withSpinner(_0x5906cf(0x17a)+_0x568b75+_0x5906cf(0x178),()=>_0x4c3c54['segment'][_0x5906cf(0x160)](_0x568b75),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x3c86a4=_0x31e765[_0x5906cf(0x176)];_0x155891[_0x5906cf(0x161)]&&console[_0x5906cf(0x17e)](_0x5906cf(0x16c)+_0x3c86a4);const _0x114022=await withSpinner(_0x5906cf(0x168)+_0x1a09da+_0x5906cf(0x178),()=>_0x4c3c54[_0x5906cf(0x164)]['resolveSegmentId'](_0x3c86a4,_0x1a09da),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x4ec838=_0x114022['data'];_0x155891[_0x5906cf(0x161)]&&console[_0x5906cf(0x17e)](_0x5906cf(0x16b)+_0x4ec838);const _0x457c45=await withSpinner(_0x5906cf(0x15d)+_0x1a09da+'\x27...',()=>_0x4c3c54[_0x5906cf(0x164)]['listActivations'](_0x3c86a4,_0x4ec838),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x2eed1=_0x457c45['data'];return console['error'](_0x5906cf(0x171)+_0x2eed1['length']+_0x5906cf(0x167)+(_0x2eed1[_0x5906cf(0x16a)]!==0x1?'s':'')),await handleSDKOutput(_0x2eed1,_0x155891),0x0;}catch(_0x3b31a3){if(_0x3b31a3 instanceof SDKError)return console[_0x5906cf(0x17e)](_0x5906cf(0x179)+_0x3b31a3['message']),_0x3b31a3[_0x5906cf(0x17b)]&&console['error'](_0x5906cf(0x172)+_0x3b31a3['cause']),0x1;throw _0x3b31a3;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x1381ed=a4_0x1284;(function(_0x59e72f,_0x1e67cb){const _0x50b559=a4_0x1284,_0x1ad72d=_0x59e72f();while(!![]){try{const _0x1be497=-parseInt(_0x50b559(0x1f5))/0x1*(parseInt(_0x50b559(0x1d4))/0x2)+parseInt(_0x50b559(0x276))/0x3*(parseInt(_0x50b559(0x1e5))/0x4)+parseInt(_0x50b559(0x27a))/0x5+parseInt(_0x50b559(0x20f))/0x6*(parseInt(_0x50b559(0x202))/0x7)+parseInt(_0x50b559(0x265))/0x8*(parseInt(_0x50b559(0x21c))/0x9)+parseInt(_0x50b559(0x1d6))/0xa+parseInt(_0x50b559(0x234))/0xb*(-parseInt(_0x50b559(0x231))/0xc);if(_0x1be497===_0x1e67cb)break;else _0x1ad72d['push'](_0x1ad72d['shift']());}catch(_0x410526){_0x1ad72d['push'](_0x1ad72d['shift']());}}}(a4_0x4337,0x1e2e0));import a4_0x25d8c7 from'chalk';import a4_0x34d7a8 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';function a4_0x1284(_0x8d9ac,_0x1a35aa){_0x8d9ac=_0x8d9ac-0x1cb;const _0x433757=a4_0x4337();let _0x128476=_0x433757[_0x8d9ac];return _0x128476;}import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}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(_0x261af4){const _0x10826c=a4_0x1284,_0x332eac=[];if(_0x261af4['total']!==undefined)_0x332eac[_0x10826c(0x1f8)](_0x261af4[_0x10826c(0x240)]+_0x10826c(0x269));if(_0x261af4[_0x10826c(0x26c)]!==undefined&&_0x261af4[_0x10826c(0x26c)]>0x0)_0x332eac[_0x10826c(0x1f8)](a4_0x25d8c7[_0x10826c(0x227)](_0x261af4[_0x10826c(0x26c)]+_0x10826c(0x255)));if(_0x261af4['created']!==undefined&&_0x261af4[_0x10826c(0x23b)]>0x0)_0x332eac['push'](a4_0x25d8c7[_0x10826c(0x227)](_0x261af4['created']+'\x20created'));if(_0x261af4['updated']!==undefined&&_0x261af4[_0x10826c(0x21e)]>0x0)_0x332eac[_0x10826c(0x1f8)](a4_0x25d8c7[_0x10826c(0x1f1)](_0x261af4[_0x10826c(0x21e)]+_0x10826c(0x242)));if(_0x261af4[_0x10826c(0x210)]!==undefined&&_0x261af4[_0x10826c(0x210)]>0x0)_0x332eac[_0x10826c(0x1f8)](a4_0x25d8c7[_0x10826c(0x253)](_0x261af4[_0x10826c(0x210)]+_0x10826c(0x1da)));if(_0x261af4[_0x10826c(0x1fa)]!==undefined&&_0x261af4[_0x10826c(0x1fa)]>0x0)_0x332eac[_0x10826c(0x1f8)](a4_0x25d8c7[_0x10826c(0x24d)](_0x261af4[_0x10826c(0x1fa)]+_0x10826c(0x24b)));return _0x332eac[_0x10826c(0x22d)](',\x20');}function displayDiffs(_0x3e6926,_0x1ec850,_0xa9ffdf,_0x2a6be4,_0x55ede9,_0x321f0f,_0x49c754){const _0x21fe88=a4_0x1284;for(const _0x556302 of _0x3e6926){if(_0x556302[_0x21fe88(0x252)]){const _0x5196c6=_0x556302[_0x21fe88(0x243)]||_0x556302[_0x21fe88(0x1fe)];console[_0x21fe88(0x221)](_0x21fe88(0x212)+_0x5196c6+'\x27:'),console[_0x21fe88(0x221)]('─'[_0x21fe88(0x1de)](0x3c)),console['log'](_0x556302[_0x21fe88(0x252)]),console[_0x21fe88(0x221)]('─'[_0x21fe88(0x1de)](0x3c));}}for(const _0x31ef60 of _0x1ec850){_0x31ef60[_0x21fe88(0x252)]&&(console['log'](_0x21fe88(0x274)+_0x31ef60[_0x21fe88(0x1fe)]+'\x27:'),console[_0x21fe88(0x221)]('─'[_0x21fe88(0x1de)](0x3c)),console['log'](_0x31ef60[_0x21fe88(0x252)]),console[_0x21fe88(0x221)]('─'[_0x21fe88(0x1de)](0x3c)));}for(const _0x3dfa28 of _0xa9ffdf){_0x3dfa28[_0x21fe88(0x252)]&&(console[_0x21fe88(0x221)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3dfa28['name']+'\x27:'),console['log']('─'[_0x21fe88(0x1de)](0x3c)),console[_0x21fe88(0x221)](_0x3dfa28[_0x21fe88(0x252)]),console[_0x21fe88(0x221)]('─'[_0x21fe88(0x1de)](0x3c)));}for(const _0x13d1c9 of _0x2a6be4){_0x13d1c9[_0x21fe88(0x252)]&&(console[_0x21fe88(0x221)](_0x21fe88(0x1e0)+_0x13d1c9[_0x21fe88(0x1fe)]+'\x27:'),console[_0x21fe88(0x221)]('─'['repeat'](0x3c)),console[_0x21fe88(0x221)](_0x13d1c9[_0x21fe88(0x252)]),console[_0x21fe88(0x221)]('─'['repeat'](0x3c)));}for(const _0x15db24 of _0x55ede9){_0x15db24[_0x21fe88(0x252)]&&(console[_0x21fe88(0x221)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x15db24[_0x21fe88(0x1fe)]+'\x27:'),console[_0x21fe88(0x221)]('─'[_0x21fe88(0x1de)](0x3c)),console[_0x21fe88(0x221)](_0x15db24[_0x21fe88(0x252)]),console[_0x21fe88(0x221)]('─'['repeat'](0x3c)));}for(const _0x428072 of _0x321f0f){_0x428072[_0x21fe88(0x252)]&&(console[_0x21fe88(0x221)](_0x21fe88(0x200)+_0x428072[_0x21fe88(0x1fe)]+'\x27:'),console[_0x21fe88(0x221)]('─'[_0x21fe88(0x1de)](0x3c)),console[_0x21fe88(0x221)](_0x428072[_0x21fe88(0x252)]),console['log']('─'[_0x21fe88(0x1de)](0x3c)));}for(const _0x287c78 of _0x49c754){_0x287c78[_0x21fe88(0x252)]&&(console[_0x21fe88(0x221)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x287c78[_0x21fe88(0x1fe)]+'\x27:'),console['log']('─'[_0x21fe88(0x1de)](0x3c)),console[_0x21fe88(0x221)](_0x287c78[_0x21fe88(0x252)]),console[_0x21fe88(0x221)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x1381ed(0x22a)]=a4_0x1381ed(0x209);async['execute'](_0x1d2c57){const _0xd3cac3=a4_0x1381ed,{options:_0x2547b7,args:_0x4ebc31,tdx:_0x2561a2}=_0x1d2c57,_0x2d7904=_0x4ebc31[0x0],_0x448d4e=_0x4ebc31[0x1],_0x408150=_0x2547b7['output'],_0x57285d=_0x2547b7[_0xd3cac3(0x201)],_0x4c8439=_0x2547b7[_0xd3cac3(0x264)],_0x29fbd0=_0x2547b7['yes'],_0x5465b0=_0x2547b7['llmProject'],_0xc71351=_0x2547b7[_0xd3cac3(0x1db)];let _0x5effa4;if(_0x2d7904){const _0x9f95e8=a4_0x34d7a8[_0xd3cac3(0x22d)](_0x2d7904,_0xd3cac3(0x1d8));if(existsSync(_0x9f95e8))try{const _0xf2f0f5=JSON[_0xd3cac3(0x239)](readFileSync(_0x9f95e8,_0xd3cac3(0x1d7)));_0xf2f0f5[_0xd3cac3(0x1f6)]&&(_0x5effa4={'llm_project':_0xf2f0f5[_0xd3cac3(0x1f6)]});}catch{}}const _0x300d3c=findAgentConfigPath(process['cwd']());let _0x216c4c;if(_0x300d3c)try{const _0x3f714e=JSON[_0xd3cac3(0x239)](readFileSync(_0x300d3c,_0xd3cac3(0x1d7)));_0x3f714e[_0xd3cac3(0x1f6)]&&(_0x216c4c={'llm_project':_0x3f714e[_0xd3cac3(0x1f6)]});}catch{}const _0x2d566a=resolveAgentPullArgs({'arg':_0x2d7904,'agentNameArg':_0x448d4e,'agentFlag':_0xc71351,'contextProject':_0x5465b0,'argDirConfig':_0x5effa4,'cwdConfigPath':_0x300d3c||undefined,'cwdConfig':_0x216c4c}),{projectNameOrId:_0x27d2ba,targetAgentName:_0x48c43d,existingOutputDir:_0x2ca807,source:_0x3be679}=_0x2d566a;if(_0x3be679===_0xd3cac3(0x213))console[_0xd3cac3(0x221)](a4_0x25d8c7['dim'](_0xd3cac3(0x230)+a4_0x34d7a8['join'](_0x2d7904,'tdx.json')+':\x20'+_0x27d2ba));else{if(_0x3be679==='cwd-config')console[_0xd3cac3(0x221)](a4_0x25d8c7['dim'](_0xd3cac3(0x1e1)+_0x27d2ba));else _0x3be679===_0xd3cac3(0x271)&&console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x1f0)](_0xd3cac3(0x219)+_0x27d2ba));}if(!_0x27d2ba)return _0xc71351?(console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x1f1)](_0xd3cac3(0x261))),console[_0xd3cac3(0x221)](_0xd3cac3(0x222)),console[_0xd3cac3(0x221)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x1f1)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0xd3cac3(0x221)]('Usage:\x20tdx\x20agent\x20pull\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#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0xd3cac3(0x221)](_0xd3cac3(0x1f2)),console[_0xd3cac3(0x221)](_0xd3cac3(0x23c)),console['log'](_0xd3cac3(0x27c)),console[_0xd3cac3(0x221)](_0xd3cac3(0x224))),0x1;if(_0x48c43d){const {data:_0x39008f}=await withSpinner(_0xd3cac3(0x205)+_0x48c43d+_0xd3cac3(0x20d)+_0x27d2ba+_0xd3cac3(0x233),()=>_0x2561a2[_0xd3cac3(0x1fb)]['pullAgent'](_0x27d2ba,_0x48c43d,_0x408150,{'dryRun':_0x57285d,'force':_0x4c8439}));if(_0x57285d)return console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x1f1)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0xd3cac3(0x221)](_0xd3cac3(0x1cc)+_0x39008f[_0xd3cac3(0x243)]),console[_0xd3cac3(0x221)](_0xd3cac3(0x275)+_0x39008f[_0xd3cac3(0x1cd)]),_0x39008f[_0xd3cac3(0x252)]&&(console[_0xd3cac3(0x221)]('\x0aChanges:'),console[_0xd3cac3(0x221)]('─'[_0xd3cac3(0x1de)](0x3c)),console['log'](_0x39008f[_0xd3cac3(0x252)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x227)]('Agent\x20pulled\x20successfully')),console[_0xd3cac3(0x221)](_0xd3cac3(0x272)+_0x39008f[_0xd3cac3(0x243)]),console[_0xd3cac3(0x221)](_0xd3cac3(0x23a)+_0x39008f[_0xd3cac3(0x1cd)]),console[_0xd3cac3(0x221)](_0xd3cac3(0x20b)+(_0x39008f['isNew']?a4_0x25d8c7[_0xd3cac3(0x227)]('new'):_0x39008f[_0xd3cac3(0x26e)]?a4_0x25d8c7[_0xd3cac3(0x1f1)]('updated'):a4_0x25d8c7[_0xd3cac3(0x253)](_0xd3cac3(0x210)))),0x0;}const _0x428d24=_0x2ca807||_0x408150,{data:_0x33eec2}=await withSpinner('Analyzing\x20project\x20\x22'+_0x27d2ba+_0xd3cac3(0x233),()=>_0x2561a2['llm'][_0xd3cac3(0x1ec)](_0x27d2ba,_0x428d24,{'dryRun':!![]})),_0x14caab=_0x33eec2[_0xd3cac3(0x266)]['agents']['new']+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x23f)][_0xd3cac3(0x26c)]+_0x33eec2['counts'][_0xd3cac3(0x203)][_0xd3cac3(0x26c)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x1fc)][_0xd3cac3(0x26c)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x238)][_0xd3cac3(0x26c)]+_0x33eec2['counts']['experimentalKnowledgeBases']['new']+_0x33eec2[_0xd3cac3(0x266)]['experimentalArtifacts'][_0xd3cac3(0x26c)],_0x4f17ce=_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x226)][_0xd3cac3(0x21e)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x23f)][_0xd3cac3(0x21e)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x203)][_0xd3cac3(0x21e)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x1fc)][_0xd3cac3(0x21e)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x238)][_0xd3cac3(0x21e)]+_0x33eec2['counts'][_0xd3cac3(0x1eb)][_0xd3cac3(0x21e)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x24c)][_0xd3cac3(0x21e)],_0x1e38e7=_0x33eec2[_0xd3cac3(0x266)]['agents']['unchanged']+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x23f)][_0xd3cac3(0x210)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x203)][_0xd3cac3(0x210)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x1fc)][_0xd3cac3(0x210)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x238)][_0xd3cac3(0x210)]+_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x1eb)][_0xd3cac3(0x210)]+_0x33eec2[_0xd3cac3(0x266)]['experimentalArtifacts'][_0xd3cac3(0x210)];console[_0xd3cac3(0x221)]('\x0aPull\x20summary\x20for\x20\x27'+_0x33eec2[_0xd3cac3(0x1f7)]+'\x27:'),console['log']('\x20\x20'+a4_0x25d8c7[_0xd3cac3(0x227)]('+\x20'+_0x14caab+_0xd3cac3(0x255))+_0xd3cac3(0x25e)+a4_0x25d8c7[_0xd3cac3(0x1f1)]('~\x20'+_0x4f17ce+_0xd3cac3(0x268))+_0xd3cac3(0x25e)+a4_0x25d8c7[_0xd3cac3(0x1f0)]('=\x20'+_0x1e38e7+_0xd3cac3(0x1da))),console[_0xd3cac3(0x221)](_0xd3cac3(0x1dd)+formatCountSummary(_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x226)])),console['log'](_0xd3cac3(0x25c)+formatCountSummary(_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x23f)])),console[_0xd3cac3(0x221)](_0xd3cac3(0x26f)+formatCountSummary(_0x33eec2['counts'][_0xd3cac3(0x203)])),console[_0xd3cac3(0x221)](_0xd3cac3(0x24a)+formatCountSummary(_0x33eec2[_0xd3cac3(0x266)]['prompts'])),console[_0xd3cac3(0x221)](_0xd3cac3(0x248)+formatCountSummary(_0x33eec2[_0xd3cac3(0x266)]['integrations']));const _0x3c20d8=_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x1eb)][_0xd3cac3(0x240)]>0x0||_0x33eec2[_0xd3cac3(0x266)][_0xd3cac3(0x24c)][_0xd3cac3(0x240)]>0x0;_0x3c20d8&&(console[_0xd3cac3(0x221)](_0xd3cac3(0x25b)+formatCountSummary(_0x33eec2['counts'][_0xd3cac3(0x1eb)])),console[_0xd3cac3(0x221)](_0xd3cac3(0x263)+formatCountSummary(_0x33eec2['counts'][_0xd3cac3(0x24c)])));console[_0xd3cac3(0x221)](_0xd3cac3(0x236)+a4_0x25d8c7[_0xd3cac3(0x1e8)](_0x33eec2[_0xd3cac3(0x23e)])),displayDiffs(_0x33eec2['agents'],_0x33eec2[_0xd3cac3(0x23f)],_0x33eec2['textKnowledgeBases'],_0x33eec2['prompts'],_0x33eec2['integrations'],_0x33eec2[_0xd3cac3(0x1eb)],_0x33eec2[_0xd3cac3(0x24c)]);if(_0x57285d)return console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x1f1)](_0xd3cac3(0x1f4))),0x0;if(_0x14caab===0x0&&_0x4f17ce===0x0)return console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x227)](_0xd3cac3(0x256))),saveSessionContext({'llm_project':_0x33eec2[_0xd3cac3(0x1f7)]},_0x2547b7['session']),console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x227)](_0xd3cac3(0x1d5)+a4_0x25d8c7[_0xd3cac3(0x1f0)]('llm_project')+_0xd3cac3(0x22f)+a4_0x25d8c7[_0xd3cac3(0x1e8)](_0x33eec2['projectName']))),0x0;if(!_0x29fbd0&&!_0x4c8439){if(!isInteractive())return console[_0xd3cac3(0x22b)](a4_0x25d8c7[_0xd3cac3(0x24d)](_0xd3cac3(0x216)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xd3cac3(0x22b)](a4_0x25d8c7['dim'](_0xd3cac3(0x1dc))),0x1;const _0x2d8722=await confirmKey(_0xd3cac3(0x228)+(_0x14caab+_0x4f17ce)+_0xd3cac3(0x259));if(!_0x2d8722)return console['log'](a4_0x25d8c7['yellow']('Cancelled'),_0xd3cac3(0x273)),0x1;}const {data:_0xf1c98b}=await withSpinner(_0xd3cac3(0x1ef),()=>_0x2561a2['llm'][_0xd3cac3(0x1ec)](_0x27d2ba,_0x428d24,{'force':_0x4c8439}));return console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x227)](_0xd3cac3(0x21d)+(_0x14caab+_0x4f17ce)+_0xd3cac3(0x1d1)+_0xf1c98b['outputDir'])),saveSessionContext({'llm_project':_0xf1c98b[_0xd3cac3(0x1f7)]},_0x2547b7[_0xd3cac3(0x1ff)]),console[_0xd3cac3(0x221)](a4_0x25d8c7[_0xd3cac3(0x227)](_0xd3cac3(0x1d5)+a4_0x25d8c7[_0xd3cac3(0x1f0)](_0xd3cac3(0x1f6))+_0xd3cac3(0x22f)+a4_0x25d8c7[_0xd3cac3(0x1e8)](_0xf1c98b[_0xd3cac3(0x1f7)]))),0x0;}}function a4_0x4337(){const _0x2694e0=['green','\x0aWrite\x20','<new-name>','description','error','newProjectName','join','Using\x20current\x20project:\x20','\x20=\x20','Using\x20project\x20from\x20','108dOUhcj','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22...','113883LHQAfn','Cloning\x20\x22','\x20\x20Target:\x20','\x20--profile\x20','integrations','parse','Output:\x20','created','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','action','outputDir','knowledgeBases','total','\x0a✔\x20Pushed\x20','\x20updated','agentName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','cwd','\x20resources?','Using\x20context\x20project:\x20','\x20\x20Integrations:\x20','dirname','\x20\x20Prompts:\x20','\x20errors','experimentalArtifacts','red','No\x20tdx.json\x20found\x20in\x20','Analyzing\x20changes\x20to\x20push...','\x20resources\x20to\x20\x27','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','diff','gray','\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)','\x20new','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','projectDir','\x20\x20Integration\x20\x22','\x20files?','source','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','\x20|\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Source:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','New\x20project\x20name\x20is\x20required','\x20\x20Experimental\x20Artifacts:\x20','force','7744rgwuAr','counts','Project\x20cloned\x20with\x20errors','\x20changed','\x20total','agent:clone','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','new','Pushing\x20to\x20project...','hasChanges','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20successfully','context','Agent:\x20','-\x20no\x20files\x20written','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Output\x20path:\x20','243aIwBFv','Project:\x20','\x0aPush\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','88220vzMgop','no_context','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','reason','-\x20nothing\x20pushed','pushProject','Cancelled','Failed\x20to\x20push\x20agent:\x20','Using\x20local\x20project:\x20','Would\x20pull\x20agent:\x20','outputPath','projectId','Clone\x20\x22','MISSING_ARGUMENT','\x20files\x20to\x20','\x20\x20Prompt\x20\x22','Would\x20clone:','65498KYRQRE','✔\x20Context\x20set:\x20','364320niOapV','utf-8','tdx.json','\x20\x20Knowledge\x20Base\x20\x22','\x20unchanged','agent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Agents:\x20','repeat','\x22:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Using\x20project:\x20','agent.yml','New\x20project:\x20','no_local_folder','4552LxYCqF','\x0aProject\x20pushed\x20with\x20errors','llmProject','cyan','message','Errors:','experimentalKnowledgeBases','pullProject','yes','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Writing\x20files...','dim','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','sourceProjectName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','2uyRMBt','llm_project','projectName','push','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','errors','llm','prompts','\x20\x20tdx\x20agent\x20clone\x20agents/','name','session','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','dryRun','559251CSWdjf','textKnowledgeBases','Pushing\x20agent\x20from\x20\x22','Pulling\x20agent\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Project\x20cloned\x20successfully','execute','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','site','Status:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x22\x20from\x20project\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','6byOpsA','unchanged','\x0aErrors\x20found:','\x0aChanges\x20to\x20agent\x20\x27','arg-dir','Would\x20push\x20agent:\x20','newProjectId','\x0aError:','profile','agent:push','Using\x20project\x20from\x20context:\x20','found','\x20\x20Agent\x20\x22','522lDUCtC','\x0a✔\x20Pulled\x20','updated','\x20\x20Experimental\x20Artifact\x20\x22','\x0aPush\x20summary\x20for\x20\x27','log','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','agents'];a4_0x4337=function(){return _0x2694e0;};return a4_0x4337();}export class AgentCloneCommand extends BaseCommand{[a4_0x1381ed(0x1fe)]=a4_0x1381ed(0x26a);[a4_0x1381ed(0x22a)]=a4_0x1381ed(0x26b);async['execute'](_0x56b4ee){const _0x2c879f=a4_0x1381ed,{options:_0x336add,args:_0x57e003,tdx:_0x277beb}=_0x56b4ee,_0x321001=_0x57e003[0x0],_0x494fb2=_0x336add['name'],_0x423640=_0x336add['dryRun'],_0x2ce0e6=_0x336add[_0x2c879f(0x1ed)],_0x5f1b45=_0x336add[_0x2c879f(0x20a)],_0x566e5c=_0x336add[_0x2c879f(0x1e7)];let _0x545fd8;const _0x120533=findAgentConfigPath(process['cwd']());if(_0x321001){const _0x519d2b=a4_0x34d7a8[_0x2c879f(0x22d)](_0x321001,_0x2c879f(0x1d8));existsSync(_0x519d2b)?(_0x545fd8=_0x321001,console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x1f0)](_0x2c879f(0x1cb)+_0x321001))):_0x545fd8=_0x321001;}else{if(_0x120533)_0x545fd8=a4_0x34d7a8[_0x2c879f(0x249)](_0x120533),console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x1f0)](_0x2c879f(0x22e)+_0x545fd8));else{if(_0x566e5c){const _0x46e013=sanitizeForFilesystem(_0x566e5c);let _0xb4a349=_0x46e013,_0x45ae1a=a4_0x34d7a8[_0x2c879f(0x22d)](process['cwd'](),_0x2c879f(0x226),_0x46e013,'tdx.json');if(!existsSync(_0x45ae1a)){const _0x5a3e0e=normalizeName(_0x566e5c),_0x2f07f6=a4_0x34d7a8[_0x2c879f(0x22d)](process[_0x2c879f(0x245)](),'agents',_0x5a3e0e,_0x2c879f(0x1d8));existsSync(_0x2f07f6)&&(_0xb4a349=_0x5a3e0e,_0x45ae1a=_0x2f07f6);}if(existsSync(_0x45ae1a))_0x545fd8=a4_0x34d7a8[_0x2c879f(0x249)](_0x45ae1a),console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x1f0)](_0x2c879f(0x1cb)+_0x545fd8));else{const _0x1c9582=_0x336add[_0x2c879f(0x217)];if(_0x1c9582)throw new SDKError(ErrorCode[_0x2c879f(0x25d)],_0x2c879f(0x20c)+_0x566e5c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2c879f(0x20e)+_0x2c879f(0x25f)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x566e5c+'\x0a')+(_0x2c879f(0x1fd)+_0xb4a349+'\x20--name\x20'+(_0x494fb2||_0x2c879f(0x229))+_0x2c879f(0x237)+_0x1c9582)});_0x545fd8=_0x566e5c,console[_0x2c879f(0x221)](a4_0x25d8c7['dim'](_0x2c879f(0x247)+_0x566e5c));}}}}if(!_0x545fd8)return console['log'](a4_0x25d8c7[_0x2c879f(0x1f1)](_0x2c879f(0x251))),console[_0x2c879f(0x221)](_0x2c879f(0x206)),console[_0x2c879f(0x221)](_0x2c879f(0x225)),console[_0x2c879f(0x221)](_0x2c879f(0x254)),console[_0x2c879f(0x221)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x494fb2)throw new SDKError(ErrorCode[_0x2c879f(0x1d0)],_0x2c879f(0x262),undefined,{'helpText':_0x2c879f(0x1f9)});if(!_0x2ce0e6&&!_0x423640){if(!isInteractive())return console['error'](a4_0x25d8c7['red']('\x0aError:'),_0x2c879f(0x244)),console[_0x2c879f(0x22b)](a4_0x25d8c7[_0x2c879f(0x1f0)](_0x2c879f(0x1dc))),0x1;const _0x156448=await confirmKey(_0x2c879f(0x1cf)+_0x545fd8+'\x22\x20to\x20new\x20project\x20\x22'+_0x494fb2+'\x22?');if(!_0x156448)return console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x1f1)](_0x2c879f(0x280))),0x1;}const {data:_0x17b82b}=await withSpinner(_0x2c879f(0x235)+_0x545fd8+'\x22\x20to\x20\x22'+_0x494fb2+'\x22...',()=>_0x277beb[_0x2c879f(0x1fb)]['cloneProject'](_0x545fd8,_0x494fb2,{'dryRun':_0x423640}));if(_0x423640){console['log'](a4_0x25d8c7['yellow'](_0x2c879f(0x223))),console[_0x2c879f(0x221)](_0x2c879f(0x260)+_0x17b82b['sourceProjectName']),console[_0x2c879f(0x221)](_0x2c879f(0x1e3)+_0x494fb2),console[_0x2c879f(0x221)](_0x2c879f(0x1d3)),console[_0x2c879f(0x221)]('\x20\x20Agents:\x20'+_0x17b82b[_0x2c879f(0x266)]['agents']['created']),console[_0x2c879f(0x221)](_0x2c879f(0x25c)+_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x23f)]['created']),console[_0x2c879f(0x221)](_0x2c879f(0x24a)+_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x1fc)][_0x2c879f(0x23b)]);const _0x202c95=_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x1eb)][_0x2c879f(0x23b)]>0x0||_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x24c)][_0x2c879f(0x23b)]>0x0;return _0x202c95&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x1eb)][_0x2c879f(0x23b)]),console[_0x2c879f(0x221)](_0x2c879f(0x263)+_0x17b82b['counts']['experimentalArtifacts']['created'])),0x0;}const _0x54e402=_0x17b82b[_0x2c879f(0x266)]['agents'][_0x2c879f(0x1fa)]>0x0||_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x23f)][_0x2c879f(0x1fa)]>0x0||_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x1fc)]['errors']>0x0||_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x1eb)][_0x2c879f(0x1fa)]>0x0||_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x24c)][_0x2c879f(0x1fa)]>0x0;_0x54e402?console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x1f1)](_0x2c879f(0x267))):console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x227)](_0x2c879f(0x207)));console[_0x2c879f(0x221)](_0x2c879f(0x260)+_0x17b82b[_0x2c879f(0x1f3)]),console[_0x2c879f(0x221)](_0x2c879f(0x1e3)+_0x17b82b[_0x2c879f(0x22c)]),console[_0x2c879f(0x221)]('New\x20project\x20ID:\x20'+_0x17b82b[_0x2c879f(0x215)]),console[_0x2c879f(0x221)](),console[_0x2c879f(0x221)]('Summary:'),console[_0x2c879f(0x221)](_0x2c879f(0x1dd)+formatCountSummary(_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x226)])),console['log'](_0x2c879f(0x25c)+formatCountSummary(_0x17b82b[_0x2c879f(0x266)]['knowledgeBases'])),console[_0x2c879f(0x221)](_0x2c879f(0x24a)+formatCountSummary(_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x1fc)])),console['log'](_0x2c879f(0x248)+formatCountSummary(_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x238)]));const _0x24b0cf=_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x1eb)][_0x2c879f(0x23b)]>0x0||_0x17b82b[_0x2c879f(0x266)]['experimentalKnowledgeBases'][_0x2c879f(0x21e)]>0x0||_0x17b82b['counts'][_0x2c879f(0x1eb)][_0x2c879f(0x210)]>0x0||_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x24c)][_0x2c879f(0x23b)]>0x0||_0x17b82b[_0x2c879f(0x266)][_0x2c879f(0x24c)][_0x2c879f(0x21e)]>0x0||_0x17b82b['counts'][_0x2c879f(0x24c)][_0x2c879f(0x210)]>0x0;_0x24b0cf&&(console[_0x2c879f(0x221)](_0x2c879f(0x25b)+formatCountSummary(_0x17b82b['counts'][_0x2c879f(0x1eb)])),console[_0x2c879f(0x221)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x17b82b['counts'][_0x2c879f(0x24c)])));if(_0x54e402){console['log'](),console['log'](a4_0x25d8c7[_0x2c879f(0x24d)](_0x2c879f(0x1ea)));for(const _0x1a595c of _0x17b82b[_0x2c879f(0x226)]){_0x1a595c[_0x2c879f(0x23d)]===_0x2c879f(0x22b)&&console['log'](a4_0x25d8c7[_0x2c879f(0x24d)]('\x20\x20Agent\x20\x22'+_0x1a595c[_0x2c879f(0x243)]+'\x22:\x20'+_0x1a595c[_0x2c879f(0x22b)]));}for(const _0x4f0b7c of _0x17b82b['knowledgeBases']){_0x4f0b7c[_0x2c879f(0x23d)]===_0x2c879f(0x22b)&&console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x24d)](_0x2c879f(0x1d9)+_0x4f0b7c['name']+_0x2c879f(0x1df)+_0x4f0b7c['error']));}for(const _0x59e242 of _0x17b82b[_0x2c879f(0x1fc)]){_0x59e242['action']===_0x2c879f(0x22b)&&console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x24d)](_0x2c879f(0x1d2)+_0x59e242['name']+_0x2c879f(0x1df)+_0x59e242[_0x2c879f(0x22b)]));}for(const _0x354ae8 of _0x17b82b[_0x2c879f(0x238)]){_0x354ae8[_0x2c879f(0x23d)]==='error'&&console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x24d)]('\x20\x20Integration\x20\x22'+_0x354ae8[_0x2c879f(0x1fe)]+_0x2c879f(0x1df)+_0x354ae8[_0x2c879f(0x22b)]));}for(const _0x561f8c of _0x17b82b[_0x2c879f(0x1eb)]){_0x561f8c[_0x2c879f(0x23d)]===_0x2c879f(0x22b)&&console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x24d)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x561f8c[_0x2c879f(0x1fe)]+_0x2c879f(0x1df)+_0x561f8c[_0x2c879f(0x22b)]));}for(const _0x18f541 of _0x17b82b['experimentalArtifacts']){_0x18f541['action']==='error'&&console[_0x2c879f(0x221)](a4_0x25d8c7[_0x2c879f(0x24d)](_0x2c879f(0x21f)+_0x18f541[_0x2c879f(0x1fe)]+_0x2c879f(0x1df)+_0x18f541[_0x2c879f(0x22b)]));}return 0x1;}console[_0x2c879f(0x221)]();const _0x13706c=getLLMProjectUrl(_0x5f1b45,_0x17b82b[_0x2c879f(0x215)]);return console[_0x2c879f(0x221)](_0x2c879f(0x277)+a4_0x25d8c7['cyan'](_0x13706c)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1381ed(0x1fe)]=a4_0x1381ed(0x218);[a4_0x1381ed(0x22a)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x1381ed(0x208)](_0x1c2c5e){const _0x3d798c=a4_0x1381ed,{options:_0x491c7e,args:_0x40d22d,tdx:_0x8f94a3}=_0x1c2c5e;let _0x2fb8cd=_0x40d22d[0x0]||process['cwd']();const _0x43cf85=_0x491c7e[_0x3d798c(0x201)],_0x27e667=_0x491c7e[_0x3d798c(0x264)],_0x50ab86=_0x491c7e[_0x3d798c(0x1ed)],_0x131936=_0x491c7e[_0x3d798c(0x20a)],_0x4443ab=a4_0x34d7a8[_0x3d798c(0x22d)](_0x2fb8cd,_0x3d798c(0x1e2)),_0x136f26=existsSync(_0x4443ab);if(_0x136f26){const {data:_0x383566}=await withSpinner(_0x3d798c(0x204)+_0x2fb8cd+_0x3d798c(0x233),()=>_0x8f94a3[_0x3d798c(0x1fb)]['pushAgent'](_0x2fb8cd,{'dryRun':_0x43cf85,'force':_0x27e667}));if(_0x43cf85)return console['log'](a4_0x25d8c7[_0x3d798c(0x1f1)](_0x3d798c(0x223))),console[_0x3d798c(0x221)](_0x3d798c(0x214)+_0x383566[_0x3d798c(0x243)]),0x0;if(_0x383566[_0x3d798c(0x23d)]===_0x3d798c(0x22b))return console['log'](a4_0x25d8c7[_0x3d798c(0x24d)](_0x3d798c(0x281)+_0x383566['error'])),0x1;console['log'](a4_0x25d8c7[_0x3d798c(0x227)]('Agent\x20'+_0x383566[_0x3d798c(0x23d)]+_0x3d798c(0x270))),console[_0x3d798c(0x221)](_0x3d798c(0x272)+_0x383566[_0x3d798c(0x243)]);if(_0x383566['agentId']&&_0x383566[_0x3d798c(0x1ce)]){const _0x2cad28=getLLMAgentChatUrl(_0x131936,_0x383566[_0x3d798c(0x1ce)],_0x383566['agentId']);console['log']('Chat:\x20'+a4_0x25d8c7[_0x3d798c(0x1e8)](_0x2cad28));}return 0x0;}const _0x5b5c65=_0x491c7e[_0x3d798c(0x1e7)],_0x5b34a3=resolveProjectFromContext(_0x2fb8cd,_0x5b5c65);if(_0x5b34a3[_0x3d798c(0x21a)])_0x2fb8cd=_0x5b34a3[_0x3d798c(0x257)],_0x5b34a3[_0x3d798c(0x25a)]==='context'&&console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x1f0)](_0x3d798c(0x1e1)+_0x2fb8cd));else{let _0x22bdd4=_0x3d798c(0x1ee);_0x5b34a3[_0x3d798c(0x27d)]===_0x3d798c(0x1e4)&&(_0x22bdd4=_0x5b34a3[_0x3d798c(0x1e9)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x5b34a3['llmProject']+_0x3d798c(0x232));throw new SDKError(ErrorCode[_0x3d798c(0x25d)],_0x5b34a3[_0x3d798c(0x27d)]===_0x3d798c(0x27b)?_0x5b34a3[_0x3d798c(0x1e9)]:_0x3d798c(0x24e)+_0x2fb8cd,undefined,{'helpText':_0x22bdd4});}const {data:_0x2054b3}=await withSpinner(_0x3d798c(0x24f),()=>_0x8f94a3[_0x3d798c(0x1fb)][_0x3d798c(0x27f)](_0x2fb8cd,{'dryRun':!![]})),_0x4d5760=_0x2054b3[_0x3d798c(0x266)]['agents'][_0x3d798c(0x1fa)]>0x0;if(_0x4d5760){console['log'](a4_0x25d8c7[_0x3d798c(0x24d)](_0x3d798c(0x211)));for(const _0x425cfc of _0x2054b3[_0x3d798c(0x226)]){_0x425cfc[_0x3d798c(0x23d)]===_0x3d798c(0x22b)&&console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x24d)](_0x3d798c(0x21b)+_0x425cfc[_0x3d798c(0x243)]+_0x3d798c(0x1df)+_0x425cfc[_0x3d798c(0x22b)]));}return 0x1;}const _0x1de595=_0x2054b3['counts'][_0x3d798c(0x226)]['created']+_0x2054b3['counts'][_0x3d798c(0x23f)][_0x3d798c(0x23b)]+_0x2054b3[_0x3d798c(0x266)]['textKnowledgeBases'][_0x3d798c(0x23b)]+_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x1fc)]['created']+_0x2054b3[_0x3d798c(0x266)]['integrations'][_0x3d798c(0x23b)]+_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x1eb)]['created']+_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x24c)][_0x3d798c(0x23b)],_0x5785e2=_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x226)][_0x3d798c(0x21e)]+_0x2054b3['counts'][_0x3d798c(0x23f)][_0x3d798c(0x21e)]+_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x203)]['updated']+_0x2054b3['counts'][_0x3d798c(0x1fc)][_0x3d798c(0x21e)]+_0x2054b3[_0x3d798c(0x266)]['integrations'][_0x3d798c(0x21e)]+_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x1eb)][_0x3d798c(0x21e)]+_0x2054b3[_0x3d798c(0x266)]['experimentalArtifacts']['updated'],_0x5ddce4=_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x226)][_0x3d798c(0x210)]+_0x2054b3['counts'][_0x3d798c(0x23f)]['unchanged']+_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x203)][_0x3d798c(0x210)]+_0x2054b3[_0x3d798c(0x266)]['prompts'][_0x3d798c(0x210)]+_0x2054b3[_0x3d798c(0x266)]['integrations'][_0x3d798c(0x210)]+_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x1eb)]['unchanged']+_0x2054b3['counts'][_0x3d798c(0x24c)][_0x3d798c(0x210)];console['log'](_0x3d798c(0x220)+_0x2054b3[_0x3d798c(0x1f7)]+'\x27:'),console[_0x3d798c(0x221)]('\x20\x20'+a4_0x25d8c7[_0x3d798c(0x227)]('+\x20'+_0x1de595+'\x20new')+'\x20|\x20'+a4_0x25d8c7[_0x3d798c(0x1f1)]('~\x20'+_0x5785e2+_0x3d798c(0x268))+_0x3d798c(0x25e)+a4_0x25d8c7[_0x3d798c(0x1f0)]('=\x20'+_0x5ddce4+_0x3d798c(0x1da))),console[_0x3d798c(0x221)](_0x3d798c(0x1dd)+formatCountSummary(_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x226)])),console[_0x3d798c(0x221)](_0x3d798c(0x25c)+formatCountSummary(_0x2054b3[_0x3d798c(0x266)]['knowledgeBases'])),console[_0x3d798c(0x221)](_0x3d798c(0x26f)+formatCountSummary(_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x203)])),console[_0x3d798c(0x221)](_0x3d798c(0x24a)+formatCountSummary(_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x1fc)])),console[_0x3d798c(0x221)](_0x3d798c(0x248)+formatCountSummary(_0x2054b3['counts']['integrations']));const _0x1142e0=_0x2054b3[_0x3d798c(0x266)]['experimentalKnowledgeBases'][_0x3d798c(0x23b)]>0x0||_0x2054b3['counts']['experimentalKnowledgeBases'][_0x3d798c(0x21e)]>0x0||_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x1eb)][_0x3d798c(0x210)]>0x0||_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x24c)][_0x3d798c(0x23b)]>0x0||_0x2054b3[_0x3d798c(0x266)]['experimentalArtifacts'][_0x3d798c(0x21e)]>0x0||_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x24c)][_0x3d798c(0x210)]>0x0;_0x1142e0&&(console[_0x3d798c(0x221)](_0x3d798c(0x25b)+formatCountSummary(_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x1eb)])),console[_0x3d798c(0x221)](_0x3d798c(0x263)+formatCountSummary(_0x2054b3[_0x3d798c(0x266)][_0x3d798c(0x24c)])));console[_0x3d798c(0x221)]('\x20\x20Source:\x20'+a4_0x25d8c7['cyan'](_0x2fb8cd)),displayDiffs(_0x2054b3[_0x3d798c(0x226)],_0x2054b3[_0x3d798c(0x23f)],_0x2054b3[_0x3d798c(0x203)],_0x2054b3[_0x3d798c(0x1fc)],_0x2054b3['integrations'],_0x2054b3['experimentalKnowledgeBases'],_0x2054b3[_0x3d798c(0x24c)]);if(_0x43cf85)return console[_0x3d798c(0x221)](a4_0x25d8c7['yellow'](_0x3d798c(0x279))),0x0;if(_0x1de595===0x0&&_0x5785e2===0x0){console[_0x3d798c(0x221)](a4_0x25d8c7['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2676bf=getLLMProjectUrl(_0x131936,_0x2054b3[_0x3d798c(0x1ce)]);return console['log']('Project:\x20'+a4_0x25d8c7[_0x3d798c(0x1e8)](_0x2676bf)),0x0;}if(!_0x50ab86&&!_0x27e667){if(!isInteractive())return console[_0x3d798c(0x22b)](a4_0x25d8c7[_0x3d798c(0x24d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3d798c(0x22b)](a4_0x25d8c7['dim'](_0x3d798c(0x1dc))),0x1;const _0x2760f5=await confirmKey(_0x3d798c(0x278)+(_0x1de595+_0x5785e2)+_0x3d798c(0x246));if(!_0x2760f5)return console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x1f1)](_0x3d798c(0x280)),_0x3d798c(0x27e)),0x1;}const {data:_0xb8c87c}=await withSpinner(_0x3d798c(0x26d),()=>_0x8f94a3[_0x3d798c(0x1fb)][_0x3d798c(0x27f)](_0x2fb8cd,{'force':_0x27e667})),_0x15e19b=_0xb8c87c[_0x3d798c(0x266)][_0x3d798c(0x226)]['errors']>0x0||_0xb8c87c['counts'][_0x3d798c(0x23f)][_0x3d798c(0x1fa)]>0x0||_0xb8c87c['counts'][_0x3d798c(0x203)][_0x3d798c(0x1fa)]>0x0||_0xb8c87c['counts'][_0x3d798c(0x1fc)][_0x3d798c(0x1fa)]>0x0;if(_0x15e19b){console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x1f1)](_0x3d798c(0x1e6))),console[_0x3d798c(0x221)](),console['log'](a4_0x25d8c7[_0x3d798c(0x24d)](_0x3d798c(0x1ea)));for(const _0x5454d4 of _0xb8c87c[_0x3d798c(0x226)]){_0x5454d4[_0x3d798c(0x23d)]==='error'&&console[_0x3d798c(0x221)](a4_0x25d8c7['red'](_0x3d798c(0x21b)+_0x5454d4[_0x3d798c(0x243)]+'\x22:\x20'+_0x5454d4['error']));}for(const _0x2c310c of _0xb8c87c['knowledgeBases']){_0x2c310c[_0x3d798c(0x23d)]===_0x3d798c(0x22b)&&console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x24d)](_0x3d798c(0x1d9)+_0x2c310c['name']+_0x3d798c(0x1df)+_0x2c310c[_0x3d798c(0x22b)]));}for(const _0xbac418 of _0xb8c87c[_0x3d798c(0x203)]){_0xbac418['action']===_0x3d798c(0x22b)&&console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x24d)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0xbac418[_0x3d798c(0x1fe)]+'\x22:\x20'+_0xbac418[_0x3d798c(0x22b)]));}for(const _0x4f7be1 of _0xb8c87c[_0x3d798c(0x1fc)]){_0x4f7be1[_0x3d798c(0x23d)]===_0x3d798c(0x22b)&&console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x24d)]('\x20\x20Prompt\x20\x22'+_0x4f7be1['name']+_0x3d798c(0x1df)+_0x4f7be1[_0x3d798c(0x22b)]));}for(const _0x43ae0e of _0xb8c87c['integrations']){_0x43ae0e[_0x3d798c(0x23d)]===_0x3d798c(0x22b)&&console[_0x3d798c(0x221)](a4_0x25d8c7[_0x3d798c(0x24d)](_0x3d798c(0x258)+_0x43ae0e[_0x3d798c(0x1fe)]+_0x3d798c(0x1df)+_0x43ae0e['error']));}return 0x1;}console[_0x3d798c(0x221)](a4_0x25d8c7['green'](_0x3d798c(0x241)+(_0x1de595+_0x5785e2)+_0x3d798c(0x250)+_0xb8c87c[_0x3d798c(0x1f7)]+'\x27'));const _0x40a273=getLLMProjectUrl(_0x131936,_0xb8c87c[_0x3d798c(0x1ce)]);return console[_0x3d798c(0x221)]('Project:\x20'+a4_0x25d8c7[_0x3d798c(0x1e8)](_0x40a273)),0x0;}}
|
|
1
|
+
const a4_0x3c89bd=a4_0xedae;function a4_0x209a(){const _0x52a439=['join','Using\x20current\x20project:\x20','dim','\x20\x20Agents:\x20','experimentalKnowledgeBases','\x20\x20Prompt\x20\x22','execute','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','gray','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Writing\x20files...','error','\x0aProject\x20pushed\x20with\x20errors','red','context','\x20|\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x22:\x20','no_local_folder','Pushing\x20to\x20project...','message','session','prompts','\x20\x20Agent\x20\x22','\x20successfully','\x20--profile\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','1055304cngdev','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','Status:\x20','cloneProject','cyan','Chat:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','newProjectName','\x0aPull\x20summary\x20for\x20\x27','Project\x20cloned\x20with\x20errors','\x20errors','log','\x0aError:','agentName','arg-dir','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','50687qHZVoC','utf-8','Using\x20local\x20project:\x20','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','llm_project','88vAQMyK','new','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','42170iHmyTy','New\x20project\x20ID:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x22\x20to\x20a\x20different\x20profile','outputDir','force','sourceProjectName','Agent:\x20','Summary:','diff','\x20\x20Experimental\x20Artifacts:\x20','yes','\x20\x20Source:\x20','Errors:','profile','\x0aErrors\x20found:','\x20\x20Integration\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20project:\x20','tdx.json','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Prompts:\x20','dryRun','newProjectId','agent.yml','\x20\x20Knowledge\x20Bases:\x20','New\x20project:\x20','llmProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cwd-config','Cancelled','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Integrations:\x20','Project\x20cloned\x20successfully','found','push','total','cwd','\x20--name\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Clone\x20\x22','counts','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Cloning\x20\x22','INVALID_ARGUMENT','\x20new','dirname','Analyzing\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','294sjAxyL','textKnowledgeBases','883470auTgYu','parse','Using\x20project\x20from\x20context:\x20','\x20\x20Knowledge\x20Base\x20\x22','Agent\x20','projectName','Source:\x20','\x20resources\x20to\x20\x27','name','\x20files\x20to\x20','\x0aPush\x20','action','projectId','yellow','\x0a✔\x20Pushed\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','99356AVdsLY','source','No\x20tdx.json\x20found\x20in\x20','experimentalArtifacts','outputPath','\x20resources?','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','integrations','updated','New\x20project\x20name\x20is\x20required','agent:push','knowledgeBases','agentId','llm','agents','\x0aPush\x20summary\x20for\x20\x27','agent:clone','Project:\x20','no_context','unchanged','Pushing\x20agent\x20from\x20\x22','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aChanges:','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20\x22','5041540gzgCch','pullAgent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1785vYuQhq','hasChanges','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','48ZGeBVX','\x20changed','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','errors','\x22...','\x20updated','pullProject','description','\x20=\x20','\x20total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Usage:\x20tdx\x20agent\x20pull\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#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','MISSING_ARGUMENT','✔\x20Context\x20set:\x20','reason','\x20\x20Experimental\x20Artifact\x20\x22'];a4_0x209a=function(){return _0x52a439;};return a4_0x209a();}(function(_0x131120,_0x550e26){const _0x511519=a4_0xedae,_0x164b86=_0x131120();while(!![]){try{const _0x4e3869=parseInt(_0x511519(0x21a))/0x1*(-parseInt(_0x511519(0x1ea))/0x2)+-parseInt(_0x511519(0x1ec))/0x3+parseInt(_0x511519(0x1fd))/0x4+-parseInt(_0x511519(0x26a))/0x5*(-parseInt(_0x511519(0x21e))/0x6)+-parseInt(_0x511519(0x261))/0x7*(-parseInt(_0x511519(0x267))/0x8)+parseInt(_0x511519(0x24f))/0x9+parseInt(_0x511519(0x217))/0xa;if(_0x4e3869===_0x550e26)break;else _0x164b86['push'](_0x164b86['shift']());}catch(_0x6d3247){_0x164b86['push'](_0x164b86['shift']());}}}(a4_0x209a,0x39bc7));import a4_0x282c7e from'chalk';import a4_0x24c893 from'path';function a4_0xedae(_0x2e79a2,_0x359332){_0x2e79a2=_0x2e79a2-0x1e6;const _0x209aae=a4_0x209a();let _0xedae48=_0x209aae[_0x2e79a2];return _0xedae48;}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,resolveAgentPullArgs}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(_0x5336cd){const _0xd0c5c9=a4_0xedae,_0x35d977=[];if(_0x5336cd['total']!==undefined)_0x35d977['push'](_0x5336cd['total']+_0xd0c5c9(0x229));if(_0x5336cd[_0xd0c5c9(0x268)]!==undefined&&_0x5336cd['new']>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd['new']+'\x20new'));if(_0x5336cd[_0xd0c5c9(0x27d)]!==undefined&&_0x5336cd[_0xd0c5c9(0x27d)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd[_0xd0c5c9(0x27d)]+'\x20created'));if(_0x5336cd['updated']!==undefined&&_0x5336cd['updated']>0x0)_0x35d977['push'](a4_0x282c7e['yellow'](_0x5336cd['updated']+_0xd0c5c9(0x225)));if(_0x5336cd[_0xd0c5c9(0x210)]!==undefined&&_0x5336cd[_0xd0c5c9(0x210)]>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x239)](_0x5336cd['unchanged']+_0xd0c5c9(0x1fc)));if(_0x5336cd[_0xd0c5c9(0x223)]!==undefined&&_0x5336cd[_0xd0c5c9(0x223)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x23f)](_0x5336cd[_0xd0c5c9(0x223)]+_0xd0c5c9(0x25a)));return _0x35d977['join'](',\x20');}function displayDiffs(_0x1a39ae,_0x24169b,_0x2723b2,_0x4cf2b9,_0x4c6f36,_0x2749cd,_0x5942e0){const _0x3b8876=a4_0xedae;for(const _0xcb9655 of _0x1a39ae){if(_0xcb9655[_0x3b8876(0x274)]){const _0xe02c6b=_0xcb9655[_0x3b8876(0x25d)]||_0xcb9655['name'];console[_0x3b8876(0x25b)](_0x3b8876(0x244)+_0xe02c6b+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0xcb9655['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c));}}for(const _0x2d742b of _0x24169b){_0x2d742b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x256)+_0x2d742b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x2d742b['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x3d8f03 of _0x2723b2){_0x3d8f03[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x281)+_0x3d8f03[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x3d8f03[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x31332b of _0x4cf2b9){_0x31332b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x215)+_0x31332b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console[_0x3b8876(0x25b)](_0x31332b[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x276eb2 of _0x4c6f36){_0x276eb2[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x276eb2['name']+'\x27:'),console['log']('─'[_0x3b8876(0x264)](0x3c)),console['log'](_0x276eb2[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x48a327 of _0x2749cd){_0x48a327[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x48a327['name']+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x48a327[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x5827a2 of _0x5942e0){_0x5827a2[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x238)+_0x5827a2[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console['log'](_0x5827a2['diff']),console['log']('─'[_0x3b8876(0x264)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]='agent:pull';[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x269);async[a4_0x3c89bd(0x237)](_0x4b682c){const _0x4b631d=a4_0x3c89bd,{options:_0x470222,args:_0x5d370d,tdx:_0x3e47d7}=_0x4b682c,_0x1eea3a=_0x5d370d[0x0],_0x3bca87=_0x5d370d[0x1],_0x3c5c1e=_0x470222['output'],_0x4fea08=_0x470222[_0x4b631d(0x284)],_0x3e3c76=_0x470222['force'],_0x55301c=_0x470222[_0x4b631d(0x276)],_0x4de693=_0x470222[_0x4b631d(0x289)],_0x349cbc=_0x470222['agent'];let _0x251d6d;if(_0x1eea3a){const _0x4fb99a=a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280));if(existsSync(_0x4fb99a))try{const _0x25af65=JSON[_0x4b631d(0x1ed)](readFileSync(_0x4fb99a,_0x4b631d(0x262)));_0x25af65[_0x4b631d(0x266)]&&(_0x251d6d={'llm_project':_0x25af65[_0x4b631d(0x266)]});}catch{}}const _0xbfe48=findAgentConfigPath(process['cwd']());let _0xbae5b8;if(_0xbfe48)try{const _0x4643db=JSON['parse'](readFileSync(_0xbfe48,_0x4b631d(0x262)));_0x4643db['llm_project']&&(_0xbae5b8={'llm_project':_0x4643db[_0x4b631d(0x266)]});}catch{}const _0x4db4e3=resolveAgentPullArgs({'arg':_0x1eea3a,'agentNameArg':_0x3bca87,'agentFlag':_0x349cbc,'contextProject':_0x4de693,'argDirConfig':_0x251d6d,'cwdConfigPath':_0xbfe48||undefined,'cwdConfig':_0xbae5b8}),{projectNameOrId:_0x1a1d88,targetAgentName:_0x4f5ba8,existingOutputDir:_0x5bbd00,source:_0x4afc7f}=_0x4db4e3;if(_0x4afc7f===_0x4b631d(0x25e))console['log'](a4_0x282c7e[_0x4b631d(0x233)]('Using\x20project\x20from\x20'+a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280))+':\x20'+_0x1a1d88));else{if(_0x4afc7f===_0x4b631d(0x28c))console['log'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x27f)+_0x1a1d88));else _0x4afc7f==='context'&&console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x1ee)+_0x1a1d88));}if(!_0x1a1d88)return _0x349cbc?(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x4b631d(0x25b)](_0x4b631d(0x22b)),console[_0x4b631d(0x25b)](_0x4b631d(0x213))):(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x265))),console[_0x4b631d(0x25b)](_0x4b631d(0x22c)),console['log'](_0x4b631d(0x296)),console[_0x4b631d(0x25b)](_0x4b631d(0x21d)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log'](_0x4b631d(0x203))),0x1;if(_0x4f5ba8){const {data:_0x3f815c}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4f5ba8+'\x22\x20from\x20project\x20\x22'+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x218)](_0x1a1d88,_0x4f5ba8,_0x3c5c1e,{'dryRun':_0x4fea08,'force':_0x3e3c76}));if(_0x4fea08)return console['log'](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28a))),console[_0x4b631d(0x25b)]('Would\x20pull\x20agent:\x20'+_0x3f815c[_0x4b631d(0x25d)]),console[_0x4b631d(0x25b)]('Output\x20path:\x20'+_0x3f815c[_0x4b631d(0x201)]),_0x3f815c[_0x4b631d(0x274)]&&(console[_0x4b631d(0x25b)](_0x4b631d(0x214)),console['log']('─'[_0x4b631d(0x264)](0x3c)),console[_0x4b631d(0x25b)](_0x3f815c[_0x4b631d(0x274)]),console[_0x4b631d(0x25b)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('Agent\x20pulled\x20successfully')),console[_0x4b631d(0x25b)]('Agent:\x20'+_0x3f815c['agentName']),console[_0x4b631d(0x25b)]('Output:\x20'+_0x3f815c[_0x4b631d(0x201)]),console['log'](_0x4b631d(0x252)+(_0x3f815c['isNew']?a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x268)):_0x3f815c[_0x4b631d(0x21b)]?a4_0x282c7e[_0x4b631d(0x1f9)]('updated'):a4_0x282c7e[_0x4b631d(0x239)](_0x4b631d(0x210)))),0x0;}const _0x574ed9=_0x5bbd00||_0x3c5c1e,{data:_0x120938}=await withSpinner(_0x4b631d(0x1e8)+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)]['pullProject'](_0x1a1d88,_0x574ed9,{'dryRun':!![]})),_0x266ea6=_0x120938['counts'][_0x4b631d(0x20b)][_0x4b631d(0x268)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)]['new']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x24a)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x204)]['new']+_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x200)][_0x4b631d(0x268)],_0xc31fdb=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x205)],_0x2ab2a7=_0x120938[_0x4b631d(0x298)]['agents'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x210)]+_0x120938['counts']['textKnowledgeBases'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)][_0x4b631d(0x210)]+_0x120938['counts'][_0x4b631d(0x235)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x210)];console[_0x4b631d(0x25b)](_0x4b631d(0x258)+_0x120938[_0x4b631d(0x1f1)]+'\x27:'),console[_0x4b631d(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4b631d(0x29a)]('+\x20'+_0x266ea6+'\x20new')+_0x4b631d(0x241)+a4_0x282c7e['yellow']('~\x20'+_0xc31fdb+_0x4b631d(0x21f))+_0x4b631d(0x241)+a4_0x282c7e[_0x4b631d(0x233)]('=\x20'+_0x2ab2a7+_0x4b631d(0x1fc))),console[_0x4b631d(0x25b)](_0x4b631d(0x234)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)])),console[_0x4b631d(0x25b)](_0x4b631d(0x287)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)])),console[_0x4b631d(0x25b)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['textKnowledgeBases'])),console[_0x4b631d(0x25b)](_0x4b631d(0x283)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)])),console[_0x4b631d(0x25b)](_0x4b631d(0x28f)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]));const _0x4d2228=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x293)]>0x0||_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x293)]>0x0;_0x4d2228&&(console[_0x4b631d(0x25b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'])),console['log'](_0x4b631d(0x275)+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalArtifacts'])));console[_0x4b631d(0x25b)]('\x20\x20Target:\x20'+a4_0x282c7e['cyan'](_0x120938[_0x4b631d(0x26f)])),displayDiffs(_0x120938[_0x4b631d(0x20b)],_0x120938['knowledgeBases'],_0x120938[_0x4b631d(0x1eb)],_0x120938[_0x4b631d(0x24a)],_0x120938['integrations'],_0x120938['experimentalKnowledgeBases'],_0x120938['experimentalArtifacts']);if(_0x4fea08)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x27e))),0x0;if(_0x266ea6===0x0&&_0xc31fdb===0x0)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x120938[_0x4b631d(0x1f1)]},_0x470222['session']),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x266))+_0x4b631d(0x228)+a4_0x282c7e['cyan'](_0x120938['projectName']))),0x0;if(!_0x55301c&&!_0x3e3c76){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4b631d(0x23f)]('\x0aError:'),_0x4b631d(0x29b)),console['error'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x219))),0x1;const _0x38fab2=await confirmKey('\x0aWrite\x20'+(_0x266ea6+_0xc31fdb)+'\x20files?');if(!_0x38fab2)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28d)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1d3fd0}=await withSpinner(_0x4b631d(0x23c),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x226)](_0x1a1d88,_0x574ed9,{'force':_0x3e3c76}));return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20Pulled\x20'+(_0x266ea6+_0xc31fdb)+_0x4b631d(0x1f5)+_0x1d3fd0[_0x4b631d(0x26f)])),saveSessionContext({'llm_project':_0x1d3fd0[_0x4b631d(0x1f1)]},_0x470222[_0x4b631d(0x249)]),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)]('llm_project')+'\x20=\x20'+a4_0x282c7e[_0x4b631d(0x254)](_0x1d3fd0[_0x4b631d(0x1f1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x20d);[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x28e);async[a4_0x3c89bd(0x237)](_0xa26d4e){const _0x11cfe2=a4_0x3c89bd,{options:_0x50b595,args:_0x55c446,tdx:_0x193cf7}=_0xa26d4e,_0x59e4b6=_0x55c446[0x0],_0x3f7b80=_0x50b595[_0x11cfe2(0x1f4)],_0x3235bb=_0x50b595[_0x11cfe2(0x284)],_0x4764f7=_0x50b595[_0x11cfe2(0x276)],_0xb26468=_0x50b595['site'],_0x19905d=_0x50b595['llmProject'];let _0x36def7;const _0x18cce5=findAgentConfigPath(process[_0x11cfe2(0x294)]());if(_0x59e4b6){const _0x4f9423=a4_0x24c893['join'](_0x59e4b6,_0x11cfe2(0x280));existsSync(_0x4f9423)?(_0x36def7=_0x59e4b6,console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x263)+_0x59e4b6))):_0x36def7=_0x59e4b6;}else{if(_0x18cce5)_0x36def7=a4_0x24c893['dirname'](_0x18cce5),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x232)+_0x36def7));else{if(_0x19905d){const _0x2f8172=sanitizeForFilesystem(_0x19905d);let _0x2d1a19=_0x2f8172,_0x4af032=a4_0x24c893[_0x11cfe2(0x231)](process[_0x11cfe2(0x294)](),_0x11cfe2(0x20b),_0x2f8172,_0x11cfe2(0x280));if(!existsSync(_0x4af032)){const _0x3dd32e=normalizeName(_0x19905d),_0x5cb0b5=a4_0x24c893[_0x11cfe2(0x231)](process['cwd'](),_0x11cfe2(0x20b),_0x3dd32e,_0x11cfe2(0x280));existsSync(_0x5cb0b5)&&(_0x2d1a19=_0x3dd32e,_0x4af032=_0x5cb0b5);}if(existsSync(_0x4af032))_0x36def7=a4_0x24c893[_0x11cfe2(0x1e7)](_0x4af032),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)]('Using\x20local\x20project:\x20'+_0x36def7));else{const _0x5ade47=_0x50b595[_0x11cfe2(0x279)];if(_0x5ade47)throw new SDKError(ErrorCode[_0x11cfe2(0x29d)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x19905d+_0x11cfe2(0x26e),undefined,{'helpText':_0x11cfe2(0x27c)+_0x11cfe2(0x23b)+(_0x11cfe2(0x251)+_0x19905d+'\x0a')+(_0x11cfe2(0x242)+_0x2d1a19+_0x11cfe2(0x295)+(_0x3f7b80||'<new-name>')+_0x11cfe2(0x24d)+_0x5ade47)});_0x36def7=_0x19905d,console['log'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x212)+_0x19905d));}}}}if(!_0x36def7)return console['log'](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x22a))),console['log'](_0x11cfe2(0x282)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x28b)),console[_0x11cfe2(0x25b)]('\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[_0x11cfe2(0x25b)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3f7b80)throw new SDKError(ErrorCode[_0x11cfe2(0x22d)],_0x11cfe2(0x206),undefined,{'helpText':_0x11cfe2(0x222)});if(!_0x4764f7&&!_0x3235bb){if(!isInteractive())return console[_0x11cfe2(0x23d)](a4_0x282c7e['red'](_0x11cfe2(0x25c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x219))),0x1;const _0x536fb3=await confirmKey(_0x11cfe2(0x297)+_0x36def7+_0x11cfe2(0x250)+_0x3f7b80+'\x22?');if(!_0x536fb3)return console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x28d))),0x1;}const {data:_0x2b7247}=await withSpinner(_0x11cfe2(0x29c)+_0x36def7+_0x11cfe2(0x216)+_0x3f7b80+_0x11cfe2(0x224),()=>_0x193cf7['llm'][_0x11cfe2(0x253)](_0x36def7,_0x3f7b80,{'dryRun':_0x3235bb}));if(_0x3235bb){console[_0x11cfe2(0x25b)](a4_0x282c7e['yellow'](_0x11cfe2(0x1fb))),console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console['log'](_0x11cfe2(0x288)+_0x3f7b80),console[_0x11cfe2(0x25b)](_0x11cfe2(0x220)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x283)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)][_0x11cfe2(0x27d)]);const _0x4be03a=_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts']['created']>0x0;return _0x4be03a&&(console[_0x11cfe2(0x25b)](_0x11cfe2(0x24e)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]),console['log'](_0x11cfe2(0x275)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x27d)])),0x0;}const _0x358328=_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x223)]>0x0||_0x2b7247['counts']['knowledgeBases'][_0x11cfe2(0x223)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)]['errors']>0x0||_0x2b7247['counts'][_0x11cfe2(0x235)]['errors']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x223)]>0x0;_0x358328?console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x259))):console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x29a)](_0x11cfe2(0x290)));console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x288)+_0x2b7247[_0x11cfe2(0x257)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x26b)+_0x2b7247[_0x11cfe2(0x285)]),console[_0x11cfe2(0x25b)](),console['log'](_0x11cfe2(0x273)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['agents'])),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)])),console[_0x11cfe2(0x25b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)])),console[_0x11cfe2(0x25b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x204)]));const _0x5a1037=_0x2b7247[_0x11cfe2(0x298)]['experimentalKnowledgeBases'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)]['updated']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x210)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x205)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x210)]>0x0;_0x5a1037&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)])),console[_0x11cfe2(0x25b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'])));if(_0x358328){console[_0x11cfe2(0x25b)](),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)]('Errors:'));for(const _0x2a8714 of _0x2b7247[_0x11cfe2(0x20b)]){_0x2a8714[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e['red'](_0x11cfe2(0x24b)+_0x2a8714[_0x11cfe2(0x25d)]+_0x11cfe2(0x245)+_0x2a8714['error']));}for(const _0x27f0ca of _0x2b7247[_0x11cfe2(0x208)]){_0x27f0ca[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x1ef)+_0x27f0ca[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x27f0ca['error']));}for(const _0x447b10 of _0x2b7247['prompts']){_0x447b10['action']===_0x11cfe2(0x23d)&&console['log'](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x236)+_0x447b10['name']+'\x22:\x20'+_0x447b10['error']));}for(const _0x227053 of _0x2b7247[_0x11cfe2(0x204)]){_0x227053['action']===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x27b)+_0x227053[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x227053[_0x11cfe2(0x23d)]));}for(const _0x451034 of _0x2b7247[_0x11cfe2(0x235)]){_0x451034[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x26c)+_0x451034[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x451034[_0x11cfe2(0x23d)]));}for(const _0x465f08 of _0x2b7247[_0x11cfe2(0x200)]){_0x465f08[_0x11cfe2(0x1f7)]==='error'&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x230)+_0x465f08['name']+'\x22:\x20'+_0x465f08['error']));}return 0x1;}console['log']();const _0x299eb1=getLLMProjectUrl(_0xb26468,_0x2b7247[_0x11cfe2(0x285)]);return console[_0x11cfe2(0x25b)](_0x11cfe2(0x20e)+a4_0x282c7e[_0x11cfe2(0x254)](_0x299eb1)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x207);['description']=a4_0x3c89bd(0x21c);async[a4_0x3c89bd(0x237)](_0x457879){const _0x4408d5=a4_0x3c89bd,{options:_0x389e77,args:_0x17f8ee,tdx:_0x13cab8}=_0x457879;let _0x568ba4=_0x17f8ee[0x0]||process[_0x4408d5(0x294)]();const _0x2c62a2=_0x389e77['dryRun'],_0x52c6f5=_0x389e77[_0x4408d5(0x270)],_0x58bb01=_0x389e77[_0x4408d5(0x276)],_0x3e1d0e=_0x389e77['site'],_0x490728=a4_0x24c893[_0x4408d5(0x231)](_0x568ba4,_0x4408d5(0x286)),_0x32d4d8=existsSync(_0x490728);if(_0x32d4d8){const {data:_0x154e65}=await withSpinner(_0x4408d5(0x211)+_0x568ba4+_0x4408d5(0x224),()=>_0x13cab8[_0x4408d5(0x20a)]['pushAgent'](_0x568ba4,{'dryRun':_0x2c62a2,'force':_0x52c6f5}));if(_0x2c62a2)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)](_0x4408d5(0x1fb))),console[_0x4408d5(0x25b)](_0x4408d5(0x243)+_0x154e65[_0x4408d5(0x25d)]),0x0;if(_0x154e65['action']===_0x4408d5(0x23d))return console['log'](a4_0x282c7e['red'](_0x4408d5(0x221)+_0x154e65[_0x4408d5(0x23d)])),0x1;console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1f0)+_0x154e65['action']+_0x4408d5(0x24c))),console[_0x4408d5(0x25b)](_0x4408d5(0x272)+_0x154e65['agentName']);if(_0x154e65['agentId']&&_0x154e65['projectId']){const _0x5965c0=getLLMAgentChatUrl(_0x3e1d0e,_0x154e65[_0x4408d5(0x1f8)],_0x154e65[_0x4408d5(0x209)]);console[_0x4408d5(0x25b)](_0x4408d5(0x255)+a4_0x282c7e[_0x4408d5(0x254)](_0x5965c0));}return 0x0;}const _0x3f6b26=_0x389e77[_0x4408d5(0x289)],_0x2f65bb=resolveProjectFromContext(_0x568ba4,_0x3f6b26);if(_0x2f65bb[_0x4408d5(0x291)])_0x568ba4=_0x2f65bb['projectDir'],_0x2f65bb[_0x4408d5(0x1fe)]===_0x4408d5(0x240)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x233)]('Using\x20project:\x20'+_0x568ba4));else{let _0x55f16d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2f65bb[_0x4408d5(0x22f)]===_0x4408d5(0x246)&&(_0x55f16d=_0x2f65bb[_0x4408d5(0x248)]+_0x4408d5(0x23a)+_0x2f65bb[_0x4408d5(0x289)]+_0x4408d5(0x299));throw new SDKError(ErrorCode[_0x4408d5(0x29d)],_0x2f65bb['reason']===_0x4408d5(0x20f)?_0x2f65bb['message']:_0x4408d5(0x1ff)+_0x568ba4,undefined,{'helpText':_0x55f16d});}const {data:_0x33f7ee}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x13cab8['llm']['pushProject'](_0x568ba4,{'dryRun':!![]})),_0x4b52de=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x223)]>0x0;if(_0x4b52de){console['log'](a4_0x282c7e['red'](_0x4408d5(0x27a)));for(const _0xaca2b7 of _0x33f7ee[_0x4408d5(0x20b)]){_0xaca2b7[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e['red'](_0x4408d5(0x24b)+_0xaca2b7[_0x4408d5(0x25d)]+'\x22:\x20'+_0xaca2b7[_0x4408d5(0x23d)]));}return 0x1;}const _0x49b8ba=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x27d)]+_0x33f7ee['counts']['textKnowledgeBases'][_0x4408d5(0x27d)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['integrations'][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['created'],_0x97d6af=_0x33f7ee[_0x4408d5(0x298)]['agents'][_0x4408d5(0x205)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x1eb)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x204)]['updated']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]+_0x33f7ee['counts']['experimentalArtifacts'][_0x4408d5(0x205)],_0x5973e3=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['textKnowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['prompts'][_0x4408d5(0x210)]+_0x33f7ee['counts']['integrations'][_0x4408d5(0x210)]+_0x33f7ee['counts'][_0x4408d5(0x235)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)][_0x4408d5(0x210)];console[_0x4408d5(0x25b)](_0x4408d5(0x20c)+_0x33f7ee[_0x4408d5(0x1f1)]+'\x27:'),console[_0x4408d5(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4408d5(0x29a)]('+\x20'+_0x49b8ba+_0x4408d5(0x1e6))+_0x4408d5(0x241)+a4_0x282c7e['yellow']('~\x20'+_0x97d6af+_0x4408d5(0x21f))+_0x4408d5(0x241)+a4_0x282c7e[_0x4408d5(0x233)]('=\x20'+_0x5973e3+_0x4408d5(0x1fc))),console[_0x4408d5(0x25b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['agents'])),console[_0x4408d5(0x25b)](_0x4408d5(0x287)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'])),console[_0x4408d5(0x25b)](_0x4408d5(0x260)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x1eb)])),console[_0x4408d5(0x25b)](_0x4408d5(0x283)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x24a)])),console[_0x4408d5(0x25b)](_0x4408d5(0x28f)+formatCountSummary(_0x33f7ee['counts']['integrations']));const _0xad94bd=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x210)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['unchanged']>0x0;_0xad94bd&&(console['log'](_0x4408d5(0x24e)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)])),console['log'](_0x4408d5(0x275)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)])));console[_0x4408d5(0x25b)](_0x4408d5(0x277)+a4_0x282c7e[_0x4408d5(0x254)](_0x568ba4)),displayDiffs(_0x33f7ee[_0x4408d5(0x20b)],_0x33f7ee[_0x4408d5(0x208)],_0x33f7ee['textKnowledgeBases'],_0x33f7ee['prompts'],_0x33f7ee[_0x4408d5(0x204)],_0x33f7ee[_0x4408d5(0x235)],_0x33f7ee[_0x4408d5(0x200)]);if(_0x2c62a2)return console['log'](a4_0x282c7e[_0x4408d5(0x1f9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x49b8ba===0x0&&_0x97d6af===0x0){console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x26d)));const _0xe9231b=getLLMProjectUrl(_0x3e1d0e,_0x33f7ee['projectId']);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e[_0x4408d5(0x254)](_0xe9231b)),0x0;}if(!_0x58bb01&&!_0x52c6f5){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x25c)),_0x4408d5(0x29b)),console[_0x4408d5(0x23d)](a4_0x282c7e['dim'](_0x4408d5(0x219))),0x1;const _0x10d164=await confirmKey(_0x4408d5(0x1f6)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x202));if(!_0x10d164)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x2d6a24}=await withSpinner(_0x4408d5(0x247),()=>_0x13cab8[_0x4408d5(0x20a)][_0x4408d5(0x25f)](_0x568ba4,{'force':_0x52c6f5})),_0x36b344=_0x2d6a24['counts']['agents']['errors']>0x0||_0x2d6a24['counts'][_0x4408d5(0x208)]['errors']>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x1eb)][_0x4408d5(0x223)]>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x24a)][_0x4408d5(0x223)]>0x0;if(_0x36b344){console[_0x4408d5(0x25b)](a4_0x282c7e['yellow'](_0x4408d5(0x23e))),console['log'](),console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x278)));for(const _0x1c9e42 of _0x2d6a24[_0x4408d5(0x20b)]){_0x1c9e42[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x24b)+_0x1c9e42[_0x4408d5(0x25d)]+_0x4408d5(0x245)+_0x1c9e42[_0x4408d5(0x23d)]));}for(const _0x23e3cd of _0x2d6a24[_0x4408d5(0x208)]){_0x23e3cd[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x23e3cd[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x23e3cd[_0x4408d5(0x23d)]));}for(const _0x3cac9f of _0x2d6a24[_0x4408d5(0x1eb)]){_0x3cac9f[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x1e9)+_0x3cac9f[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x3cac9f[_0x4408d5(0x23d)]));}for(const _0x3c957b of _0x2d6a24[_0x4408d5(0x24a)]){_0x3c957b[_0x4408d5(0x1f7)]==='error'&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x236)+_0x3c957b[_0x4408d5(0x1f4)]+'\x22:\x20'+_0x3c957b[_0x4408d5(0x23d)]));}for(const _0x4e6c0a of _0x2d6a24['integrations']){_0x4e6c0a['action']===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x27b)+_0x4e6c0a[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x4e6c0a['error']));}return 0x1;}console['log'](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1fa)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x1f3)+_0x2d6a24[_0x4408d5(0x1f1)]+'\x27'));const _0x351dd8=getLLMProjectUrl(_0x3e1d0e,_0x2d6a24[_0x4408d5(0x1f8)]);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e['cyan'](_0x351dd8)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x491fd5=a5_0x2bad;(function(_0x444a09,_0x4b217b){const _0x4d3c1f=a5_0x2bad,_0x4fbffc=_0x444a09();while(!![]){try{const _0x745df4=parseInt(_0x4d3c1f(0x9c))/0x1+parseInt(_0x4d3c1f(0xb4))/0x2+parseInt(_0x4d3c1f(0xcc))/0x3+parseInt(_0x4d3c1f(0xa7))/0x4*(parseInt(_0x4d3c1f(0xf6))/0x5)+-parseInt(_0x4d3c1f(0xcd))/0x6+-parseInt(_0x4d3c1f(0xfc))/0x7*(-parseInt(_0x4d3c1f(0xfa))/0x8)+-parseInt(_0x4d3c1f(0xd3))/0x9;if(_0x745df4===_0x4b217b)break;else _0x4fbffc['push'](_0x4fbffc['shift']());}catch(_0x28dc9c){_0x4fbffc['push'](_0x4fbffc['shift']());}}}(a5_0x24b5,0xdaa8c));import*as a5_0x5b6759 from'node:fs';import*as a5_0x2b2577 from'node:path';function a5_0x2bad(_0x2407f9,_0x4f4e39){_0x2407f9=_0x2407f9-0x7d;const _0x24b59b=a5_0x24b5();let _0x2bad6d=_0x24b59b[_0x2407f9];return _0x2bad6d;}import a5_0x1d7800 from'chalk';import{BaseCommand}from'./command.js';function a5_0x24b5(){const _0x2adb78=['tsv','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','utf-8','No\x20tests\x20found\x20matching:\x20','text','...','llm','writeFileSync','cyan','...\x20','log','add','push','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','source','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20(new)','testYmlPath','filter','toISOString','isSpinning','Re-evaluating\x20','find','rounds','179550hQXSOG','\x22:\x20','\x20\x20Evaluating...\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)','conversation_url','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tests','\x20\x20Agent:\x20','has','projectName','basename','26308KwmeyL','stop','table','Error:\x20No\x20previous\x20test\x20run\x20found.','join','verbose','Test\x20Summary','json','name','repeat','\x20-\x20','resolveProjectId','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','3131332LmfQcZ','New\x20tests\x20to\x20execute:\x20','\x20\x20Conversation:\x20','context','white','status','dryRun','no_context','agent','Available\x20tags:\x20','Total:\x20\x20\x20\x20','map','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','timestamp','substring','dim','ERROR','Conversation\x20URL:\x20','Evaluating\x20response...','multiple_agents','agent:test','includes','length','start','3651567ZbXpXK','8672190MVlQyz','Usage:','No\x20tests\x20have\x20tags\x20defined.','now','Running\x20test:\x20','no_local_folder','17026623oconST','agentName','reason','Run\x20\x27tdx\x20agent\x20pull\x20','Executing\x20new\x20tests...','Site:\x20','not\x20found','✗\x20FAIL:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Errors:\x20\x20\x20','jsonl','resolve','llmProject','Cached\x20run\x20is\x20from\x20site\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Test\x20Configuration:','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20\x20-\x20','Duration:\x20','\x20(cached)','\x27\x20to\x20create\x20the\x20folder\x20structure.','PASS','message','Available\x20tests:\x20','projectDir','site','✓\x20PASS:\x20','\x20\x20Round\x20','forEach','No\x20tests\x20found\x20with\x20tags:\x20','Tests\x20found:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Running:\x20',':\x20Sending\x20user\x20input...','745yApFcg','\x20\x20Site:\x20','testName','Test\x20','1161848rKhOBa','green','14KGAnRk','Failed:\x20\x20\x20','output','Using\x20agent:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','existsSync','Project\x20path:\x20','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Passed:\x20\x20\x20','execute','⚠\x20SKIPPED:\x20','yellow','description','✗\x20ERROR:\x20','Running\x20agent\x20tests...','Round\x201/','reeval','Re-evaluating\x20cached\x20test\x20run...','Output\x20written\x20to:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','FAIL','red','found','tags','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','404','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','toLowerCase','split','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','executeReeval'];a5_0x24b5=function(){return _0x2adb78;};return a5_0x24b5();}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_0x491fd5(0xaf)]=a5_0x491fd5(0xc8);[a5_0x491fd5(0x109)]=a5_0x491fd5(0x110);async[a5_0x491fd5(0x106)](_0x3a965f){const _0x236775=a5_0x491fd5,{options:_0x521fe1,args:_0x22af5c,tdx:_0x2a486b}=_0x3a965f,_0x19b7e4=_0x22af5c[0x0]||'.',_0x2e78c0=_0x521fe1[_0x236775(0xba)],_0x13a4bf=_0x521fe1,_0x321c94=_0x13a4bf['eval']===![],_0x385aa0=_0x13a4bf[_0x236775(0x10d)],_0x368dd1=_0x13a4bf[_0x236775(0xaf)],_0x46ca0d=_0x13a4bf['tags'],_0x50f64d=_0x521fe1[_0x236775(0xec)],_0x43b3c4=_0x13a4bf[_0x236775(0xfe)];if(_0x385aa0&&_0x321c94)return console['log'](a5_0x1d7800[_0x236775(0x113)](_0x236775(0xa1))),0x1;let _0x15e235=_0x236775(0xa9);if(_0x13a4bf[_0x236775(0xae)])_0x15e235=_0x236775(0xae);else{if(_0x13a4bf[_0x236775(0xdd)])_0x15e235=_0x236775(0xdd);else{if(_0x13a4bf[_0x236775(0x84)])_0x15e235='tsv';else{if(_0x13a4bf[_0x236775(0xa9)])_0x15e235=_0x236775(0xa9);}}}const _0x542985=_0x13a4bf['llmProject'];let _0xec7a86=_0x19b7e4;const _0x3f4f0c=a5_0x5b6759[_0x236775(0x101)](_0x19b7e4),_0x4c7692=_0x19b7e4==='.';if(!_0x3f4f0c||_0x4c7692){const _0x4b3716=resolveProjectFromContext(_0x19b7e4,_0x542985,{'requireFile':'test.yml'});if(_0x4b3716[_0x236775(0x114)])_0xec7a86=_0x4b3716['projectDir'],_0x4b3716[_0x236775(0x92)]===_0x236775(0xb7)&&console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0xc3)](_0x236775(0xff)+_0xec7a86));else switch(_0x4b3716['reason']){case _0x236775(0xbb):console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x108)](_0x4b3716[_0x236775(0xe9)])),console['log'](),console[_0x236775(0x8e)](_0x236775(0xce)),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x236775(0x8e)](_0x236775(0x9f)),console[_0x236775(0x8e)](),console[_0x236775(0x8e)](_0x236775(0xe1));return 0x1;case _0x236775(0xd2):console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x108)](_0x4b3716[_0x236775(0xe9)])),console[_0x236775(0x8e)](),console[_0x236775(0x8e)](_0x236775(0xd6)+_0x4b3716['llmProject']+_0x236775(0xe7));return 0x1;case _0x236775(0xc7):{const _0x349aa6=a5_0x2b2577[_0x236775(0xa6)](_0x4b3716[_0x236775(0xeb)]);console['log'](a5_0x1d7800['yellow'](_0x236775(0x111)+_0x4b3716['llmProject']+'\x22:'));for(const _0x36eacb of _0x4b3716['agentDirs']){console[_0x236775(0x8e)](_0x236775(0xe4)+_0x36eacb);}return console[_0x236775(0x8e)](),console[_0x236775(0x8e)](_0x236775(0x91)+_0x349aa6+'/<agent-name>'),0x1;}case'no_tests':console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x108)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4b3716[_0x236775(0xdf)]+'\x22.')),console['log'](a5_0x1d7800['dim'](_0x236775(0x102)+_0x4b3716[_0x236775(0xeb)])),console['log'](),console[_0x236775(0x8e)](_0x236775(0xe3));return 0x1;}}const {definition:_0x1c4b3e,agentInfo:_0x5cc2e0}=parseTestFile(_0xec7a86);let _0xf8f7ab=_0x1c4b3e[_0x236775(0xa2)];if(_0x368dd1){const _0x4196ae=_0x368dd1[_0x236775(0x81)](',')[_0x236775(0xbf)](_0x237b2f=>_0x237b2f['trim']());_0xf8f7ab=_0x1c4b3e[_0x236775(0xa2)][_0x236775(0x96)](_0x1a62e9=>_0x4196ae['includes'](_0x1a62e9['name']));if(_0xf8f7ab[_0x236775(0xca)]===0x0)return console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x108)](_0x236775(0x87)+_0x368dd1)),console['log'](a5_0x1d7800['dim'](_0x236775(0xea)+_0x1c4b3e[_0x236775(0xa2)]['map'](_0x14b6b7=>_0x14b6b7['name'])[_0x236775(0xab)](',\x20'))),0x1;}if(_0x46ca0d){const _0x5d919e=_0x46ca0d['split'](',')['map'](_0x245d94=>_0x245d94['trim']()[_0x236775(0x80)]());_0xf8f7ab=_0xf8f7ab[_0x236775(0x96)](_0x13a67a=>_0x13a67a[_0x236775(0x115)]?.['some'](_0x22b0c3=>_0x5d919e[_0x236775(0xc9)](_0x22b0c3[_0x236775(0x80)]())));if(_0xf8f7ab[_0x236775(0xca)]===0x0){console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x108)](_0x236775(0xf0)+_0x46ca0d));const _0x32f17e=new Set();return _0x1c4b3e[_0x236775(0xa2)][_0x236775(0xef)](_0x47a847=>_0x47a847[_0x236775(0x115)]?.[_0x236775(0xef)](_0x325e77=>_0x32f17e[_0x236775(0x8f)](_0x325e77))),_0x32f17e['size']>0x0?console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0xc3)](_0x236775(0xbd)+[..._0x32f17e][_0x236775(0xab)](',\x20'))):console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0xc3)](_0x236775(0xcf))),0x1;}}if(_0x385aa0)return this[_0x236775(0x83)](_0x3a965f,{'definition':{'tests':_0xf8f7ab},'agentInfo':_0x5cc2e0,'outputFormat':_0x15e235,'outputFile':_0x43b3c4,'testNames':_0x368dd1});if(_0x2e78c0){console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x8c)](_0x236775(0xe2))),console[_0x236775(0x8e)](_0x236775(0xf7)+a5_0x1d7800['white'](_0x50f64d)),console[_0x236775(0x8e)]('\x20\x20Project:\x20'+a5_0x1d7800[_0x236775(0xb8)](_0x5cc2e0['projectName'])),console[_0x236775(0x8e)](_0x236775(0xa3)+a5_0x1d7800[_0x236775(0xb8)](_0x5cc2e0[_0x236775(0xd4)])),console[_0x236775(0x8e)](),console[_0x236775(0x8e)](_0x236775(0xf1)+a5_0x1d7800[_0x236775(0xb8)](_0xf8f7ab[_0x236775(0xca)]));for(let _0xaac281=0x0;_0xaac281<_0xf8f7ab['length'];_0xaac281++){const _0x1102e9=_0xf8f7ab[_0xaac281],_0x336c04=_0x1102e9[_0x236775(0x9b)][_0x236775(0xca)]===0x1?'round':'rounds',_0x5b2abf=_0x1102e9[_0x236775(0x115)]?.[_0x236775(0xca)]?'\x20['+_0x1102e9[_0x236775(0x115)][_0x236775(0xab)](',\x20')+']':'';console['log']('\x20\x20'+(_0xaac281+0x1)+'.\x20'+a5_0x1d7800[_0x236775(0xb8)](_0x1102e9[_0x236775(0xaf)])+'\x20('+_0x1102e9['rounds'][_0x236775(0xca)]+'\x20'+_0x336c04+')'+a5_0x1d7800['dim'](_0x5b2abf));}return 0x0;}let _0xed2f80,_0x431237;try{_0xed2f80=await _0x2a486b[_0x236775(0x8a)][_0x236775(0xb2)](_0x5cc2e0[_0x236775(0xa5)]);}catch(_0x1b81bc){const _0x2af16e=_0x1b81bc instanceof Error?_0x1b81bc['message']:String(_0x1b81bc);return _0x2af16e[_0x236775(0xc9)](_0x236775(0x7e))||_0x2af16e[_0x236775(0x80)]()[_0x236775(0xc9)](_0x236775(0xd9))?console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x113)](_0x236775(0xf3)+_0x5cc2e0[_0x236775(0xa5)])):console['log'](a5_0x1d7800['red'](_0x236775(0x7f)+_0x5cc2e0[_0x236775(0xa5)]+_0x236775(0x9d)+_0x2af16e)),0x1;}try{_0x431237=await _0x2a486b['llm']['resolveAgentId'](_0x5cc2e0[_0x236775(0xd4)],_0xed2f80);}catch(_0x5e46f6){const _0x3f82ed=_0x5e46f6 instanceof Error?_0x5e46f6[_0x236775(0xe9)]:String(_0x5e46f6);return _0x3f82ed[_0x236775(0xc9)]('404')||_0x3f82ed['toLowerCase']()[_0x236775(0xc9)](_0x236775(0xd9))?console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x113)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x5cc2e0[_0x236775(0xd4)])):console['log'](a5_0x1d7800[_0x236775(0x113)](_0x236775(0x104)+_0x5cc2e0[_0x236775(0xd4)]+'\x22:\x20'+_0x3f82ed)),0x1;}let _0x2d2b1f;if(!_0x321c94)try{_0x2d2b1f=await setupEvaluatorAgent(_0x2a486b[_0x236775(0x8a)],_0x521fe1[_0x236775(0xac)]);}catch(_0x15dcc8){const _0x35cba5=_0x15dcc8 instanceof Error?_0x15dcc8[_0x236775(0xe9)]:String(_0x15dcc8);return console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x113)](_0x236775(0x82)+_0x35cba5)),0x1;}console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x8c)](_0x236775(0x10b))),console['log'](_0x236775(0xd8)+a5_0x1d7800[_0x236775(0xb8)](_0x50f64d)),console[_0x236775(0x8e)]('Agent:\x20'+a5_0x1d7800[_0x236775(0xb8)](_0x5cc2e0[_0x236775(0xa5)]+'/'+_0x5cc2e0['agentName'])),console[_0x236775(0x8e)]();const _0x328fc3=[],_0x2e595e=[],_0x5ba285=Date[_0x236775(0xd0)]();for(let _0x3f5f7e=0x0;_0x3f5f7e<_0xf8f7ab[_0x236775(0xca)];_0x3f5f7e++){const _0x4b2fbe=_0xf8f7ab[_0x3f5f7e];_0xf8f7ab[_0x236775(0xca)]>0x1?console[_0x236775(0x8e)](_0x236775(0xf9)+(_0x3f5f7e+0x1)+'/'+_0xf8f7ab[_0x236775(0xca)]+':\x20'+a5_0x1d7800['white'](_0x4b2fbe['name'])):console[_0x236775(0x8e)](_0x236775(0xd1)+a5_0x1d7800[_0x236775(0xb8)](_0x4b2fbe[_0x236775(0xaf)]));const _0x259a9b=createCommandSpinner(_0x236775(0x10c)+_0x4b2fbe['rounds']['length']+_0x236775(0xf5));_0x259a9b[_0x236775(0xcb)]();try{const {result:_0x53f262,conversation:_0x4a945a}=await runTest(_0x2a486b[_0x236775(0x8a)],_0x4b2fbe,{'agentId':_0x431237,'projectId':_0xed2f80,'site':_0x50f64d,'noEval':_0x321c94,'evaluatorId':_0x2d2b1f,'onRoundStart':(_0x3e505d,_0x471f49)=>{const _0x413680=_0x236775;_0x259a9b[_0x413680(0x88)]='Round\x20'+(_0x3e505d+0x1)+'/'+_0x471f49+_0x413680(0xf5);},'onRoundComplete':(_0x124613,_0xfc7a58,_0x5c57af)=>{const _0x4ca0af=_0x236775,_0x1b222a=formatElapsed(_0xfc7a58);_0x5c57af?console[_0x4ca0af(0x8e)](_0x4ca0af(0xee)+(_0x124613+0x1)+'/'+_0x4b2fbe[_0x4ca0af(0x9b)]['length']+_0x4ca0af(0x8d)+a5_0x1d7800[_0x4ca0af(0xfb)]('✓')+'\x20('+_0x1b222a+')'):console[_0x4ca0af(0x8e)]('\x20\x20Round\x20'+(_0x124613+0x1)+'/'+_0x4b2fbe['rounds'][_0x4ca0af(0xca)]+_0x4ca0af(0x8d)+a5_0x1d7800['red']('✗'));},'onEvaluationStart':()=>{const _0x165a26=_0x236775;_0x259a9b['text']=_0x165a26(0xc6);},'onEvaluationComplete':_0x164dc0=>{const _0x130b52=_0x236775,_0x2e831a=formatElapsed(_0x164dc0);console[_0x130b52(0x8e)](_0x130b52(0x9e)+a5_0x1d7800['green']('✓')+'\x20('+_0x2e831a+')');}});_0x259a9b[_0x236775(0xa8)](),_0x328fc3[_0x236775(0x90)](_0x53f262),_0x2e595e['push'](_0x4a945a);if(_0x53f262['status']===_0x236775(0xe8))console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0xfb)](_0x236775(0xed)+_0x53f262['reason']));else _0x53f262[_0x236775(0xb9)]===_0x236775(0x112)?console['log'](a5_0x1d7800[_0x236775(0x113)]('✗\x20FAIL:\x20'+_0x53f262[_0x236775(0xd5)])):console[_0x236775(0x8e)](a5_0x1d7800['red'](_0x236775(0x10a)+_0x53f262[_0x236775(0xd5)]));_0x53f262['conversation_url']&&console['log'](a5_0x1d7800[_0x236775(0xc3)](_0x236775(0xc5)+_0x53f262[_0x236775(0xa0)])),console['log']();}catch(_0x217e72){_0x259a9b['stop']();const _0x2b258f=_0x217e72 instanceof Error?_0x217e72[_0x236775(0xe9)]:String(_0x217e72);console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x113)](_0x236775(0x10a)+_0x2b258f)),console['log'](),_0x328fc3[_0x236775(0x90)]({'name':_0x4b2fbe[_0x236775(0xaf)],'status':'ERROR','reason':_0x2b258f,'timestamp':new Date()[_0x236775(0x97)](),'duration_ms':0x0});}}const _0x1cdf9c=Date[_0x236775(0xd0)]()-_0x5ba285,_0x32f77c=_0x328fc3[_0x236775(0x96)](_0x7883ae=>_0x7883ae[_0x236775(0xb9)]==='PASS')[_0x236775(0xca)],_0x104dfb=_0x328fc3['filter'](_0x251629=>_0x251629[_0x236775(0xb9)]==='FAIL')['length'],_0x885255=_0x328fc3[_0x236775(0x96)](_0x3326b1=>_0x3326b1[_0x236775(0xb9)]==='ERROR')[_0x236775(0xca)];console['log']('━'['repeat'](0x3c)),console[_0x236775(0x8e)](_0x236775(0xad)),console['log']('━'[_0x236775(0xb0)](0x3c)),console[_0x236775(0x8e)]('Total:\x20\x20\x20\x20'+_0x328fc3[_0x236775(0xca)]),console[_0x236775(0x8e)]('Passed:\x20\x20\x20'+a5_0x1d7800[_0x236775(0xfb)](_0x32f77c)),console[_0x236775(0x8e)](_0x236775(0xfd)+a5_0x1d7800[_0x236775(0x113)](_0x104dfb));_0x885255>0x0&&console[_0x236775(0x8e)](_0x236775(0xdc)+a5_0x1d7800[_0x236775(0x113)](_0x885255));console[_0x236775(0x8e)](_0x236775(0xe5)+formatElapsed(_0x1cdf9c)),console[_0x236775(0x8e)]('━'[_0x236775(0xb0)](0x3c));const _0x4389a7=_0x328fc3[_0x236775(0x96)](_0x4c1ea9=>_0x4c1ea9['status']!==_0x236775(0xe8));if(_0x4389a7[_0x236775(0xca)]>0x0){console['log'](),console[_0x236775(0x8e)]('Failed\x20Tests:');for(const _0x5a3bbc of _0x4389a7){const _0x54b205=a5_0x1d7800[_0x236775(0x113)]('✗'),_0x11d3b1=_0x5a3bbc[_0x236775(0xd5)][_0x236775(0xca)]>0x32?_0x5a3bbc[_0x236775(0xd5)][_0x236775(0xc2)](0x0,0x32)+_0x236775(0x89):_0x5a3bbc[_0x236775(0xd5)];console['log']('\x20\x20'+_0x54b205+'\x20'+_0x5a3bbc[_0x236775(0xaf)]+':\x20'+_0x11d3b1);}}const _0x327ff3={'summary':{'total':_0x328fc3[_0x236775(0xca)],'passed':_0x32f77c,'failed':_0x104dfb,'errors':_0x885255>0x0?_0x885255:undefined,'duration_ms':_0x1cdf9c},'tests':_0x328fc3,'agent':{'project':_0x5cc2e0[_0x236775(0xa5)],'name':_0x5cc2e0[_0x236775(0xd4)],'site':_0x50f64d},'timestamp':new Date(_0x5ba285)[_0x236775(0x97)]()};try{const _0x467d20=buildCachedTestRun(_0x2e595e,{'site':_0x50f64d,'projectId':_0xed2f80,'projectName':_0x5cc2e0[_0x236775(0xa5)],'agentId':_0x431237,'agentName':_0x5cc2e0[_0x236775(0xd4)],'testYmlPath':a5_0x2b2577[_0x236775(0xde)](_0x5cc2e0[_0x236775(0x95)])});saveLastTestRun(_0x467d20);}catch{}if(_0x15e235!==_0x236775(0xa9)||_0x43b3c4){const _0x2b576b=formatResults(_0x327ff3,_0x15e235);if(_0x43b3c4)try{a5_0x5b6759[_0x236775(0x8b)](_0x43b3c4,_0x2b576b,_0x236775(0x86)),console['log'](),console['log'](a5_0x1d7800[_0x236775(0xc3)](_0x236775(0x10f)+_0x43b3c4));}catch(_0x57f959){return console[_0x236775(0x8e)](),console[_0x236775(0x8e)](a5_0x1d7800[_0x236775(0x113)]('Error\x20writing\x20output\x20file:\x20'+_0x57f959)),0x1;}else console['log'](),console[_0x236775(0x8e)](_0x2b576b);}return _0x4389a7[_0x236775(0xca)]>0x0?0x1:0x0;}async[a5_0x491fd5(0x83)](_0x47f79c,_0x1a312e){const _0xe316be=a5_0x491fd5,{options:_0x2aced9,tdx:_0x57c45a}=_0x47f79c,{definition:_0x42e79b,agentInfo:_0x45980e,outputFormat:_0x3cf7cd,outputFile:_0x251d68}=_0x1a312e,_0x35dc27=_0x2aced9['site'],_0x5a041b=loadLastTestRun();if(!_0x5a041b)return console['log'](a5_0x1d7800[_0xe316be(0x113)](_0xe316be(0xaa))),console['log'](a5_0x1d7800[_0xe316be(0xc3)](_0xe316be(0x100))),0x1;if(_0x5a041b['agent'][_0xe316be(0xd4)]!==_0x45980e[_0xe316be(0xd4)])return console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0x113)](_0xe316be(0xc0)+_0x5a041b['agent']['agentName']+_0xe316be(0x85)+_0x45980e[_0xe316be(0xd4)]+'\x22.')),console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0xc3)](_0xe316be(0xf2))),0x1;const _0x273aae=new Set(_0x5a041b['conversations'][_0xe316be(0xbf)](_0x35c8e4=>_0x35c8e4[_0xe316be(0xf8)])),_0x34a0de=_0x42e79b[_0xe316be(0xa2)][_0xe316be(0x96)](_0x2ab0f3=>!_0x273aae[_0xe316be(0xa4)](_0x2ab0f3[_0xe316be(0xaf)]));if(_0x34a0de[_0xe316be(0xca)]>0x0&&_0x5a041b[_0xe316be(0xec)]!==_0x35dc27)return console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0x113)](_0xe316be(0xb3))),console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0xc3)](_0xe316be(0xe0)+_0x5a041b['site']+_0xe316be(0x93)+_0x35dc27+'\x22.')),console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0xc3)]('Either\x20switch\x20to\x20the\x20\x22'+_0x5a041b[_0xe316be(0xec)]+_0xe316be(0x7d))),0x1;const _0x491376=_0x42e79b[_0xe316be(0xa2)][_0xe316be(0x96)](_0xcd80ef=>_0x273aae[_0xe316be(0xa4)](_0xcd80ef[_0xe316be(0xaf)])),_0x1237a3=_0x34a0de;let _0x3fb463;try{_0x3fb463=await setupEvaluatorAgent(_0x57c45a[_0xe316be(0x8a)],_0x2aced9[_0xe316be(0xac)]);}catch(_0x4e2a61){const _0x5be539=_0x4e2a61 instanceof Error?_0x4e2a61[_0xe316be(0xe9)]:String(_0x4e2a61);return console['log'](a5_0x1d7800[_0xe316be(0x113)](_0xe316be(0x82)+_0x5be539)),0x1;}console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0x8c)](_0xe316be(0x10e))),console[_0xe316be(0x8e)](_0xe316be(0x103)+a5_0x1d7800[_0xe316be(0xb8)](_0x5a041b[_0xe316be(0xc1)])),console[_0xe316be(0x8e)]('Agent:\x20'+a5_0x1d7800[_0xe316be(0xb8)](_0x5a041b[_0xe316be(0xbc)]['projectName']+'/'+_0x5a041b[_0xe316be(0xbc)][_0xe316be(0xd4)]));_0x1237a3[_0xe316be(0xca)]>0x0&&console[_0xe316be(0x8e)](_0xe316be(0xb5)+a5_0x1d7800[_0xe316be(0x108)](_0x1237a3[_0xe316be(0xca)]));console['log']();const _0x5d889c=[],_0x67ef5d=Date['now'](),_0x448777=createCommandSpinner('Re-evaluating...');if(_0x491376['length']>0x0)try{const _0x380781=await reevaluateFromCache(_0x57c45a[_0xe316be(0x8a)],_0x5a041b,{'tests':_0x491376},{'evaluatorId':_0x3fb463,'onTestStart':(_0x1a1688,_0x3d70ad,_0x56e040)=>{const _0x2d35f9=_0xe316be;_0x448777['text']=_0x2d35f9(0x99)+(_0x3d70ad+0x1)+'/'+_0x56e040+':\x20'+_0x1a1688+'...';if(!_0x448777[_0x2d35f9(0x98)])_0x448777[_0x2d35f9(0xcb)]();},'onTestComplete':(_0x59fc83,_0x37d8f7)=>{const _0x306170=_0xe316be;_0x448777[_0x306170(0xa8)]();if(_0x37d8f7[_0x306170(0xb9)]===_0x306170(0xe8))console[_0x306170(0x8e)](a5_0x1d7800[_0x306170(0xfb)]('✓\x20PASS:\x20'+_0x59fc83)+a5_0x1d7800['dim'](_0x306170(0xe6)));else _0x37d8f7['status']===_0x306170(0x112)?console[_0x306170(0x8e)](a5_0x1d7800[_0x306170(0x113)](_0x306170(0xda)+_0x59fc83+_0x306170(0xb1)+_0x37d8f7['reason'])+a5_0x1d7800[_0x306170(0xc3)](_0x306170(0xe6))):console[_0x306170(0x8e)](a5_0x1d7800['red']('✗\x20ERROR:\x20'+_0x59fc83+'\x20-\x20'+_0x37d8f7['reason']));_0x37d8f7[_0x306170(0xa0)]&&console['log'](a5_0x1d7800[_0x306170(0xc3)](_0x306170(0xb6)+_0x37d8f7[_0x306170(0xa0)])),_0x5d889c[_0x306170(0x90)](_0x37d8f7);},'onTestSkipped':(_0xe9cfbb,_0x4f0b78)=>{const _0x29db7b=_0xe316be;_0x448777[_0x29db7b(0xa8)](),console[_0x29db7b(0x8e)](a5_0x1d7800[_0x29db7b(0x108)](_0x29db7b(0x107)+_0xe9cfbb+_0x29db7b(0xb1)+_0x4f0b78));}});for(const _0x466923 of _0x380781){!_0x5d889c[_0xe316be(0x9a)](_0x5b6c95=>_0x5b6c95[_0xe316be(0xaf)]===_0x466923['name'])&&_0x5d889c[_0xe316be(0x90)](_0x466923);}}catch(_0x34f1f5){_0x448777[_0xe316be(0xa8)]();const _0x3de71c=_0x34f1f5 instanceof Error?_0x34f1f5[_0xe316be(0xe9)]:String(_0x34f1f5);return console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0x113)](_0xe316be(0xdb)+_0x3de71c)),0x1;}_0x448777[_0xe316be(0xa8)]();if(_0x1237a3['length']>0x0){console[_0xe316be(0x8e)](),console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0x8c)](_0xe316be(0xd7)));const {projectId:_0x5672d6,agentId:_0x1a0b0f}=_0x5a041b[_0xe316be(0xbc)];for(const _0x38639e of _0x1237a3){console[_0xe316be(0x8e)](_0xe316be(0xf4)+a5_0x1d7800[_0xe316be(0xb8)](_0x38639e[_0xe316be(0xaf)]));const _0x591af3=createCommandSpinner(_0xe316be(0x10c)+_0x38639e[_0xe316be(0x9b)][_0xe316be(0xca)]+_0xe316be(0xf5));_0x591af3['start']();try{const {result:_0x5454ea}=await runTest(_0x57c45a[_0xe316be(0x8a)],_0x38639e,{'agentId':_0x1a0b0f,'projectId':_0x5672d6,'site':_0x5a041b[_0xe316be(0xec)],'noEval':![],'evaluatorId':_0x3fb463,'onRoundStart':(_0x25bed0,_0x3e6183)=>{const _0x4a47f0=_0xe316be;_0x591af3['text']='Round\x20'+(_0x25bed0+0x1)+'/'+_0x3e6183+_0x4a47f0(0xf5);},'onRoundComplete':(_0x36f1a8,_0x2a5d11,_0x24cb4e)=>{const _0x2bab43=_0xe316be,_0x879d40=formatElapsed(_0x2a5d11);_0x24cb4e?console[_0x2bab43(0x8e)]('\x20\x20Round\x20'+(_0x36f1a8+0x1)+'/'+_0x38639e[_0x2bab43(0x9b)]['length']+_0x2bab43(0x8d)+a5_0x1d7800[_0x2bab43(0xfb)]('✓')+'\x20('+_0x879d40+')'):console['log']('\x20\x20Round\x20'+(_0x36f1a8+0x1)+'/'+_0x38639e[_0x2bab43(0x9b)][_0x2bab43(0xca)]+_0x2bab43(0x8d)+a5_0x1d7800['red']('✗'));},'onEvaluationStart':()=>{const _0x27f137=_0xe316be;_0x591af3[_0x27f137(0x88)]=_0x27f137(0xc6);},'onEvaluationComplete':_0x18f147=>{const _0xafa27c=_0xe316be,_0x49d8cc=formatElapsed(_0x18f147);console[_0xafa27c(0x8e)](_0xafa27c(0x9e)+a5_0x1d7800['green']('✓')+'\x20('+_0x49d8cc+')');}});_0x591af3[_0xe316be(0xa8)](),_0x5d889c[_0xe316be(0x90)](_0x5454ea);if(_0x5454ea[_0xe316be(0xb9)]===_0xe316be(0xe8))console[_0xe316be(0x8e)](a5_0x1d7800['green']('✓\x20PASS:\x20'+_0x5454ea[_0xe316be(0xd5)])+a5_0x1d7800[_0xe316be(0xc3)](_0xe316be(0x94)));else _0x5454ea['status']===_0xe316be(0x112)?console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0x113)](_0xe316be(0xda)+_0x5454ea[_0xe316be(0xd5)])+a5_0x1d7800['dim'](_0xe316be(0x94))):console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0x113)]('✗\x20ERROR:\x20'+_0x5454ea[_0xe316be(0xd5)]));_0x5454ea[_0xe316be(0xa0)]&&console['log'](a5_0x1d7800[_0xe316be(0xc3)](_0xe316be(0xb6)+_0x5454ea['conversation_url']));}catch(_0x330df8){_0x591af3[_0xe316be(0xa8)]();const _0x317f8e=_0x330df8 instanceof Error?_0x330df8['message']:String(_0x330df8);console['log'](a5_0x1d7800[_0xe316be(0x113)]('✗\x20ERROR:\x20'+_0x317f8e)),_0x5d889c[_0xe316be(0x90)]({'name':_0x38639e[_0xe316be(0xaf)],'status':_0xe316be(0xc4),'reason':_0x317f8e,'timestamp':new Date()[_0xe316be(0x97)](),'duration_ms':0x0});}}}console[_0xe316be(0x8e)]();const _0x1df5dc=Date['now']()-_0x67ef5d,_0x1a7851=_0x5d889c['filter'](_0x3d7105=>_0x3d7105['status']==='PASS')[_0xe316be(0xca)],_0x254b50=_0x5d889c[_0xe316be(0x96)](_0x2f0cf2=>_0x2f0cf2[_0xe316be(0xb9)]==='FAIL')[_0xe316be(0xca)],_0xb96c6d=_0x5d889c[_0xe316be(0x96)](_0x3d3662=>_0x3d3662[_0xe316be(0xb9)]===_0xe316be(0xc4))['length'];console['log']('━'['repeat'](0x3c)),console[_0xe316be(0x8e)]('Re-evaluation\x20Summary'),console[_0xe316be(0x8e)]('━'[_0xe316be(0xb0)](0x3c)),console[_0xe316be(0x8e)](_0xe316be(0xbe)+_0x5d889c[_0xe316be(0xca)]),console['log'](_0xe316be(0x105)+a5_0x1d7800['green'](_0x1a7851)),console['log']('Failed:\x20\x20\x20'+a5_0x1d7800[_0xe316be(0x113)](_0x254b50));_0xb96c6d>0x0&&console[_0xe316be(0x8e)](_0xe316be(0xdc)+a5_0x1d7800[_0xe316be(0x113)](_0xb96c6d));console['log'](_0xe316be(0xe5)+formatElapsed(_0x1df5dc)),console[_0xe316be(0x8e)]('━'[_0xe316be(0xb0)](0x3c));const _0x1e6618={'summary':{'total':_0x5d889c['length'],'passed':_0x1a7851,'failed':_0x254b50,'errors':_0xb96c6d>0x0?_0xb96c6d:undefined,'duration_ms':_0x1df5dc},'tests':_0x5d889c,'agent':{'project':_0x45980e['projectName'],'name':_0x45980e[_0xe316be(0xd4)],'site':_0x35dc27},'timestamp':new Date(_0x67ef5d)[_0xe316be(0x97)]()};if(_0x3cf7cd!==_0xe316be(0xa9)||_0x251d68){const _0x2368a5=formatResults(_0x1e6618,_0x3cf7cd);if(_0x251d68)try{a5_0x5b6759[_0xe316be(0x8b)](_0x251d68,_0x2368a5,_0xe316be(0x86)),console['log'](),console[_0xe316be(0x8e)](a5_0x1d7800[_0xe316be(0xc3)]('Output\x20written\x20to:\x20'+_0x251d68));}catch(_0x10278a){return console[_0xe316be(0x8e)](),console['log'](a5_0x1d7800[_0xe316be(0x113)]('Error\x20writing\x20output\x20file:\x20'+_0x10278a)),0x1;}else console[_0xe316be(0x8e)](),console[_0xe316be(0x8e)](_0x2368a5);}const _0x314687=_0x5d889c['filter'](_0x150df3=>_0x150df3[_0xe316be(0xb9)]!==_0xe316be(0xe8));return _0x314687[_0xe316be(0xca)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x348df7=a5_0x422d;(function(_0x23d3bd,_0x45bdf9){const _0xf6772a=a5_0x422d,_0x2f7d4a=_0x23d3bd();while(!![]){try{const _0x5cc2d3=parseInt(_0xf6772a(0x168))/0x1+-parseInt(_0xf6772a(0x117))/0x2*(-parseInt(_0xf6772a(0x106))/0x3)+parseInt(_0xf6772a(0x103))/0x4+parseInt(_0xf6772a(0x17b))/0x5*(parseInt(_0xf6772a(0x170))/0x6)+-parseInt(_0xf6772a(0x119))/0x7*(parseInt(_0xf6772a(0x133))/0x8)+-parseInt(_0xf6772a(0x167))/0x9*(parseInt(_0xf6772a(0x13e))/0xa)+-parseInt(_0xf6772a(0x146))/0xb*(parseInt(_0xf6772a(0x134))/0xc);if(_0x5cc2d3===_0x45bdf9)break;else _0x2f7d4a['push'](_0x2f7d4a['shift']());}catch(_0xf32e71){_0x2f7d4a['push'](_0x2f7d4a['shift']());}}}(a5_0x829b,0x68952));import*as a5_0x1fa2e3 from'node:fs';import*as a5_0x496d65 from'node:path';import a5_0x312754 from'chalk';import{BaseCommand}from'./command.js';function a5_0x422d(_0x16be6e,_0x2dc89f){_0x16be6e=_0x16be6e-0xea;const _0x829bb9=a5_0x829b();let _0x422d77=_0x829bb9[_0x16be6e];return _0x422d77;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x829b(){const _0x4823b1=['agent','Re-evaluating\x20cached\x20test\x20run...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','find','agentName','execute','stop','red','Executing\x20new\x20tests...','Round\x20','459212tRmhfN','conversation_url','Failed:\x20\x20\x20','16929bXjEMr','Error\x20writing\x20output\x20file:\x20','ERROR','\x20\x20Round\x20','json','Agent:\x20','Running\x20agent\x20tests...','tsv','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Test\x20Configuration:','white','cyan','site','llm','PASS','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Site:\x20','262Mtvkqt','no_context','14eJhTSd','\x20(cached)','now','executeReeval','resolveProjectId','length','Tests\x20found:\x20','green','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','FAIL','✗\x20ERROR:\x20','Total:\x20\x20\x20\x20','context','yellow','Evaluating\x20response...','Re-evaluation\x20Summary','no_local_folder','tags','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','✓\x20PASS:\x20','toISOString','includes','/<agent-name>','reason','373064tQVqxs','12iYXKFP','resolveAgentId','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','source','projectDir','Conversation\x20URL:\x20','\x20\x20Project:\x20','message','Usage:','start','1430OiYFFy','\x20\x20Site:\x20','Re-evaluating\x20','Either\x20switch\x20to\x20the\x20\x22','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\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)','repeat','15985717TOlNuu','basename','Output\x20written\x20to:\x20','text','No\x20tests\x20have\x20tags\x20defined.','dim','filter','split','Using\x20agent:\x20','Running\x20test:\x20','has','Cached\x20run\x20is\x20from\x20site\x20\x22','join','Round\x201/','size','Passed:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Errors:\x20\x20\x20','verbose','push','jsonl','Failed\x20Tests:','404','reeval','✗\x20ERROR:\x20Project\x20not\x20found:\x20','projectName','✗\x20FAIL:\x20','log','rounds','Available\x20tests:\x20','\x20-\x20','existsSync','New\x20tests\x20to\x20execute:\x20','6759nCUQlI','447110rfghdp','trim','utf-8','name','status','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','420GIcWmd','table','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Error:\x20No\x20previous\x20test\x20run\x20found.','agentDirs','...\x20','multiple_agents','toLowerCase',':\x20Sending\x20user\x20input...','some','...','55795BuGWea','Test\x20','\x20(new)','\x27\x20to\x20create\x20the\x20folder\x20structure.','forEach','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x22:\x20','\x20\x20-\x20','\x20\x20Evaluating...\x20','llmProject','writeFileSync','Test\x20Summary','Cached\x20run\x20from:\x20','Running:\x20','\x20\x20Conversation:\x20','add','\x20\x20Agent:\x20'];a5_0x829b=function(){return _0x4823b1;};return a5_0x829b();}export class AgentTestCommand extends BaseCommand{[a5_0x348df7(0x16b)]='agent:test';['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x348df7(0xfe)](_0x161c02){const _0x4cfe3f=a5_0x348df7,{options:_0x2c20fc,args:_0x227f93,tdx:_0x4f4ecb}=_0x161c02,_0x160634=_0x227f93[0x0]||'.',_0x48f8f4=_0x2c20fc['dryRun'],_0x27523d=_0x2c20fc,_0x3e0617=_0x27523d['eval']===![],_0x3f8618=_0x27523d[_0x4cfe3f(0x15d)],_0x4b0c48=_0x27523d[_0x4cfe3f(0x16b)],_0x5bd9c8=_0x27523d[_0x4cfe3f(0x12a)],_0x451c73=_0x2c20fc['site'],_0x4a8abf=_0x27523d['output'];if(_0x3f8618&&_0x3e0617)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x156))),0x1;let _0x11b36b=_0x4cfe3f(0x171);if(_0x27523d[_0x4cfe3f(0x10a)])_0x11b36b='json';else{if(_0x27523d[_0x4cfe3f(0x15a)])_0x11b36b=_0x4cfe3f(0x15a);else{if(_0x27523d[_0x4cfe3f(0x10d)])_0x11b36b=_0x4cfe3f(0x10d);else{if(_0x27523d[_0x4cfe3f(0x171)])_0x11b36b='table';}}}const _0x34db8f=_0x27523d[_0x4cfe3f(0xf0)];let _0x4a301a=_0x160634;const _0x3a2a1e=a5_0x1fa2e3[_0x4cfe3f(0x165)](_0x160634),_0x5c01b9=_0x160634==='.';if(!_0x3a2a1e||_0x5c01b9){const _0xd004b0=resolveProjectFromContext(_0x160634,_0x34db8f,{'requireFile':'test.yml'});if(_0xd004b0['found'])_0x4a301a=_0xd004b0['projectDir'],_0xd004b0[_0x4cfe3f(0x137)]===_0x4cfe3f(0x125)&&console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14e)+_0x4a301a));else switch(_0xd004b0['reason']){case _0x4cfe3f(0x118):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0['message'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12d)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x144)),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0xec));return 0x1;case _0x4cfe3f(0x129):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0[_0x4cfe3f(0x13b)])),console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12b)+_0xd004b0['llmProject']+_0x4cfe3f(0xea));return 0x1;case _0x4cfe3f(0x176):{const _0x213ef9=a5_0x496d65[_0x4cfe3f(0x147)](_0xd004b0[_0x4cfe3f(0x138)]);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16d)+_0xd004b0['llmProject']+'\x22:'));for(const _0x1d43ff of _0xd004b0[_0x4cfe3f(0x174)]){console[_0x4cfe3f(0x161)](_0x4cfe3f(0xee)+_0x1d43ff);}return console['log'](),console[_0x4cfe3f(0x161)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x213ef9+_0x4cfe3f(0x131)),0x1;}case'no_tests':console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16e)+_0xd004b0[_0x4cfe3f(0xf0)]+'\x22.')),console[_0x4cfe3f(0x161)](a5_0x312754['dim']('Project\x20path:\x20'+_0xd004b0['projectDir'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xfa));return 0x1;}}const {definition:_0xb5e38a,agentInfo:_0x18072c}=parseTestFile(_0x4a301a);let _0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)];if(_0x4b0c48){const _0x5b9561=_0x4b0c48[_0x4cfe3f(0x14d)](',')['map'](_0x2db06b=>_0x2db06b[_0x4cfe3f(0x169)]());_0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)]['filter'](_0x2ed19c=>_0x5b9561['includes'](_0x2ed19c['name']));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20matching:\x20'+_0x4b0c48)),console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x163)+_0xb5e38a[_0x4cfe3f(0x142)]['map'](_0x1b15bc=>_0x1b15bc[_0x4cfe3f(0x16b)])[_0x4cfe3f(0x152)](',\x20'))),0x1;}if(_0x5bd9c8){const _0x4af7e2=_0x5bd9c8[_0x4cfe3f(0x14d)](',')['map'](_0x5ce645=>_0x5ce645['trim']()[_0x4cfe3f(0x177)]());_0x363b6a=_0x363b6a[_0x4cfe3f(0x14c)](_0x1819d6=>_0x1819d6['tags']?.[_0x4cfe3f(0x179)](_0x25bede=>_0x4af7e2[_0x4cfe3f(0x130)](_0x25bede[_0x4cfe3f(0x177)]())));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0){console['log'](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5bd9c8));const _0x1cef2a=new Set();return _0xb5e38a[_0x4cfe3f(0x142)]['forEach'](_0x20933c=>_0x20933c[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0xeb)](_0x706f04=>_0x1cef2a[_0x4cfe3f(0xf6)](_0x706f04))),_0x1cef2a[_0x4cfe3f(0x154)]>0x0?console['log'](a5_0x312754[_0x4cfe3f(0x14b)]('Available\x20tags:\x20'+[..._0x1cef2a][_0x4cfe3f(0x152)](',\x20'))):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14a))),0x1;}}if(_0x3f8618)return this[_0x4cfe3f(0x11c)](_0x161c02,{'definition':{'tests':_0x363b6a},'agentInfo':_0x18072c,'outputFormat':_0x11b36b,'outputFile':_0x4a8abf,'testNames':_0x4b0c48});if(_0x48f8f4){console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10f))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13f)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13a)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c['projectName'])),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf7)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0x11f)+a5_0x312754['white'](_0x363b6a['length']));for(let _0x289caa=0x0;_0x289caa<_0x363b6a[_0x4cfe3f(0x11e)];_0x289caa++){const _0x53e376=_0x363b6a[_0x289caa],_0xfb927e=_0x53e376['rounds']['length']===0x1?'round':_0x4cfe3f(0x162),_0x239906=_0x53e376[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0x11e)]?'\x20['+_0x53e376[_0x4cfe3f(0x12a)][_0x4cfe3f(0x152)](',\x20')+']':'';console['log']('\x20\x20'+(_0x289caa+0x1)+'.\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x53e376['name'])+'\x20('+_0x53e376['rounds'][_0x4cfe3f(0x11e)]+'\x20'+_0xfb927e+')'+a5_0x312754['dim'](_0x239906));}return 0x0;}let _0x5c09ed,_0xeb5bf0;try{_0x5c09ed=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x11d)](_0x18072c['projectName']);}catch(_0x1cfcc4){const _0xb2dd55=_0x1cfcc4 instanceof Error?_0x1cfcc4[_0x4cfe3f(0x13b)]:String(_0x1cfcc4);return _0xb2dd55[_0x4cfe3f(0x130)]('404')||_0xb2dd55[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x15e)+_0x18072c[_0x4cfe3f(0x15f)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x18072c[_0x4cfe3f(0x15f)]+_0x4cfe3f(0xed)+_0xb2dd55)),0x1;}try{_0xeb5bf0=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x135)](_0x18072c[_0x4cfe3f(0xfd)],_0x5c09ed);}catch(_0x399a24){const _0xde00ff=_0x399a24 instanceof Error?_0x399a24[_0x4cfe3f(0x13b)]:String(_0x399a24);return _0xde00ff[_0x4cfe3f(0x130)](_0x4cfe3f(0x15c))||_0xde00ff[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console['log'](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x10e)+_0x18072c['agentName'])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x16f)+_0x18072c[_0x4cfe3f(0xfd)]+'\x22:\x20'+_0xde00ff)),0x1;}let _0x25f3b2;if(!_0x3e0617)try{_0x25f3b2=await setupEvaluatorAgent(_0x4f4ecb['llm'],_0x2c20fc[_0x4cfe3f(0x158)]);}catch(_0x22efea){const _0x460bab=_0x22efea instanceof Error?_0x22efea['message']:String(_0x22efea);return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x115)+_0x460bab)),0x1;}console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10c))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x116)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x10b)+a5_0x312754['white'](_0x18072c[_0x4cfe3f(0x15f)]+'/'+_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)]();const _0x17c0a5=[],_0x2cd05d=[],_0xc6d242=Date[_0x4cfe3f(0x11b)]();for(let _0x317740=0x0;_0x317740<_0x363b6a['length'];_0x317740++){const _0x9c2e7c=_0x363b6a[_0x317740];_0x363b6a[_0x4cfe3f(0x11e)]>0x1?console['log'](_0x4cfe3f(0x17c)+(_0x317740+0x1)+'/'+_0x363b6a[_0x4cfe3f(0x11e)]+':\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x9c2e7c[_0x4cfe3f(0x16b)])):console[_0x4cfe3f(0x161)](_0x4cfe3f(0x14f)+a5_0x312754['white'](_0x9c2e7c[_0x4cfe3f(0x16b)]));const _0x4b8d3d=createCommandSpinner(_0x4cfe3f(0x153)+_0x9c2e7c[_0x4cfe3f(0x162)][_0x4cfe3f(0x11e)]+_0x4cfe3f(0x178));_0x4b8d3d['start']();try{const {result:_0x57a4f0,conversation:_0x156b7a}=await runTest(_0x4f4ecb['llm'],_0x9c2e7c,{'agentId':_0xeb5bf0,'projectId':_0x5c09ed,'site':_0x451c73,'noEval':_0x3e0617,'evaluatorId':_0x25f3b2,'onRoundStart':(_0x51c624,_0x42db25)=>{const _0x1ffc1a=_0x4cfe3f;_0x4b8d3d[_0x1ffc1a(0x149)]='Round\x20'+(_0x51c624+0x1)+'/'+_0x42db25+_0x1ffc1a(0x178);},'onRoundComplete':(_0x383afd,_0x560e1a,_0x1e52c3)=>{const _0x4908c2=_0x4cfe3f,_0x2f9226=formatElapsed(_0x560e1a);_0x1e52c3?console['log'](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)]['length']+'...\x20'+a5_0x312754[_0x4908c2(0x120)]('✓')+'\x20('+_0x2f9226+')'):console[_0x4908c2(0x161)](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)][_0x4908c2(0x11e)]+_0x4908c2(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x4eee76=_0x4cfe3f;_0x4b8d3d[_0x4eee76(0x149)]=_0x4eee76(0x127);},'onEvaluationComplete':_0x5eeba4=>{const _0x40d7f8=_0x4cfe3f,_0xcfbf2=formatElapsed(_0x5eeba4);console[_0x40d7f8(0x161)]('\x20\x20Evaluating...\x20'+a5_0x312754[_0x40d7f8(0x120)]('✓')+'\x20('+_0xcfbf2+')');}});_0x4b8d3d[_0x4cfe3f(0xff)](),_0x17c0a5['push'](_0x57a4f0),_0x2cd05d[_0x4cfe3f(0x159)](_0x156b7a);if(_0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))console[_0x4cfe3f(0x161)](a5_0x312754['green'](_0x4cfe3f(0x12e)+_0x57a4f0[_0x4cfe3f(0x132)]));else _0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122)?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x160)+_0x57a4f0[_0x4cfe3f(0x132)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20'+_0x57a4f0[_0x4cfe3f(0x132)]));_0x57a4f0[_0x4cfe3f(0x104)]&&console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x139)+_0x57a4f0[_0x4cfe3f(0x104)])),console[_0x4cfe3f(0x161)]();}catch(_0x26afc6){_0x4b8d3d[_0x4cfe3f(0xff)]();const _0x24a63f=_0x26afc6 instanceof Error?_0x26afc6[_0x4cfe3f(0x13b)]:String(_0x26afc6);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x123)+_0x24a63f)),console[_0x4cfe3f(0x161)](),_0x17c0a5[_0x4cfe3f(0x159)]({'name':_0x9c2e7c[_0x4cfe3f(0x16b)],'status':_0x4cfe3f(0x108),'reason':_0x24a63f,'timestamp':new Date()[_0x4cfe3f(0x12f)](),'duration_ms':0x0});}}const _0x4a000c=Date[_0x4cfe3f(0x11b)]()-_0xc6d242,_0x2245be=_0x17c0a5['filter'](_0x3dedd5=>_0x3dedd5[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))[_0x4cfe3f(0x11e)],_0x3a827b=_0x17c0a5['filter'](_0x1ab91a=>_0x1ab91a[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122))[_0x4cfe3f(0x11e)],_0x5aa4a7=_0x17c0a5['filter'](_0x38f685=>_0x38f685['status']===_0x4cfe3f(0x108))[_0x4cfe3f(0x11e)];console['log']('━'['repeat'](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf2)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x124)+_0x17c0a5[_0x4cfe3f(0x11e)]),console['log'](_0x4cfe3f(0x155)+a5_0x312754[_0x4cfe3f(0x120)](_0x2245be)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x105)+a5_0x312754['red'](_0x3a827b));_0x5aa4a7>0x0&&console['log'](_0x4cfe3f(0x157)+a5_0x312754['red'](_0x5aa4a7));console[_0x4cfe3f(0x161)]('Duration:\x20'+formatElapsed(_0x4a000c)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c));const _0x4f3ce8=_0x17c0a5['filter'](_0x481040=>_0x481040[_0x4cfe3f(0x16c)]!=='PASS');if(_0x4f3ce8[_0x4cfe3f(0x11e)]>0x0){console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x15b));for(const _0x118786 of _0x4f3ce8){const _0x2fa525=a5_0x312754['red']('✗'),_0x205567=_0x118786[_0x4cfe3f(0x132)][_0x4cfe3f(0x11e)]>0x32?_0x118786[_0x4cfe3f(0x132)]['substring'](0x0,0x32)+_0x4cfe3f(0x17a):_0x118786[_0x4cfe3f(0x132)];console[_0x4cfe3f(0x161)]('\x20\x20'+_0x2fa525+'\x20'+_0x118786[_0x4cfe3f(0x16b)]+':\x20'+_0x205567);}}const _0x36b878={'summary':{'total':_0x17c0a5['length'],'passed':_0x2245be,'failed':_0x3a827b,'errors':_0x5aa4a7>0x0?_0x5aa4a7:undefined,'duration_ms':_0x4a000c},'tests':_0x17c0a5,'agent':{'project':_0x18072c[_0x4cfe3f(0x15f)],'name':_0x18072c[_0x4cfe3f(0xfd)],'site':_0x451c73},'timestamp':new Date(_0xc6d242)[_0x4cfe3f(0x12f)]()};try{const _0x4105a2=buildCachedTestRun(_0x2cd05d,{'site':_0x451c73,'projectId':_0x5c09ed,'projectName':_0x18072c['projectName'],'agentId':_0xeb5bf0,'agentName':_0x18072c[_0x4cfe3f(0xfd)],'testYmlPath':a5_0x496d65[_0x4cfe3f(0xfb)](_0x18072c[_0x4cfe3f(0x12c)])});saveLastTestRun(_0x4105a2);}catch{}if(_0x11b36b!=='table'||_0x4a8abf){const _0x5a0c8d=formatResults(_0x36b878,_0x11b36b);if(_0x4a8abf)try{a5_0x1fa2e3[_0x4cfe3f(0xf1)](_0x4a8abf,_0x5a0c8d,_0x4cfe3f(0x16a)),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x148)+_0x4a8abf));}catch(_0x215e1e){return console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754['red'](_0x4cfe3f(0x107)+_0x215e1e)),0x1;}else console[_0x4cfe3f(0x161)](),console['log'](_0x5a0c8d);}return _0x4f3ce8['length']>0x0?0x1:0x0;}async['executeReeval'](_0x3c49a7,_0x3ab7f0){const _0x5023e6=a5_0x348df7,{options:_0x40fe57,tdx:_0x313e42}=_0x3c49a7,{definition:_0x40cdda,agentInfo:_0x2e9a88,outputFormat:_0x1c6bba,outputFile:_0x989c7a}=_0x3ab7f0,_0x41299c=_0x40fe57[_0x5023e6(0x112)],_0x509907=loadLastTestRun();if(!_0x509907)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x173))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x121))),0x1;if(_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]!==_0x2e9a88[_0x5023e6(0xfd)])return console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x136)+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]+_0x5023e6(0x143)+_0x2e9a88['agentName']+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x223523=new Set(_0x509907['conversations']['map'](_0x4c624c=>_0x4c624c['testName'])),_0x4b4da9=_0x40cdda['tests']['filter'](_0x3facc5=>!_0x223523[_0x5023e6(0x150)](_0x3facc5[_0x5023e6(0x16b)]));if(_0x4b4da9['length']>0x0&&_0x509907[_0x5023e6(0x112)]!==_0x41299c)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x172))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x151)+_0x509907[_0x5023e6(0x112)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x41299c+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x141)+_0x509907[_0x5023e6(0x112)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4c6e56=_0x40cdda[_0x5023e6(0x142)][_0x5023e6(0x14c)](_0x1e634d=>_0x223523[_0x5023e6(0x150)](_0x1e634d[_0x5023e6(0x16b)])),_0x4e9804=_0x4b4da9;let _0x196bd4;try{_0x196bd4=await setupEvaluatorAgent(_0x313e42[_0x5023e6(0x113)],_0x40fe57[_0x5023e6(0x158)]);}catch(_0xe228c3){const _0x2944ca=_0xe228c3 instanceof Error?_0xe228c3[_0x5023e6(0x13b)]:String(_0xe228c3);return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2944ca)),0x1;}console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0xf9))),console[_0x5023e6(0x161)](_0x5023e6(0xf3)+a5_0x312754[_0x5023e6(0x110)](_0x509907['timestamp'])),console['log'](_0x5023e6(0x10b)+a5_0x312754[_0x5023e6(0x110)](_0x509907['agent'][_0x5023e6(0x15f)]+'/'+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]));_0x4e9804[_0x5023e6(0x11e)]>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x166)+a5_0x312754['yellow'](_0x4e9804[_0x5023e6(0x11e)]));console[_0x5023e6(0x161)]();const _0x2a13c0=[],_0x51b17a=Date[_0x5023e6(0x11b)](),_0x1df9a4=createCommandSpinner('Re-evaluating...');if(_0x4c6e56[_0x5023e6(0x11e)]>0x0)try{const _0x52c754=await reevaluateFromCache(_0x313e42[_0x5023e6(0x113)],_0x509907,{'tests':_0x4c6e56},{'evaluatorId':_0x196bd4,'onTestStart':(_0x450e30,_0x4feb88,_0xef6ef2)=>{const _0x18c15c=_0x5023e6;_0x1df9a4[_0x18c15c(0x149)]=_0x18c15c(0x140)+(_0x4feb88+0x1)+'/'+_0xef6ef2+':\x20'+_0x450e30+_0x18c15c(0x17a);if(!_0x1df9a4['isSpinning'])_0x1df9a4[_0x18c15c(0x13d)]();},'onTestComplete':(_0x266293,_0x177f36)=>{const _0x53fedf=_0x5023e6;_0x1df9a4['stop']();if(_0x177f36[_0x53fedf(0x16c)]==='PASS')console[_0x53fedf(0x161)](a5_0x312754['green'](_0x53fedf(0x12e)+_0x266293)+a5_0x312754['dim'](_0x53fedf(0x11a)));else _0x177f36['status']===_0x53fedf(0x122)?console[_0x53fedf(0x161)](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x160)+_0x266293+'\x20-\x20'+_0x177f36['reason'])+a5_0x312754[_0x53fedf(0x14b)]('\x20(cached)')):console['log'](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x123)+_0x266293+_0x53fedf(0x164)+_0x177f36[_0x53fedf(0x132)]));_0x177f36[_0x53fedf(0x104)]&&console['log'](a5_0x312754[_0x53fedf(0x14b)]('\x20\x20Conversation:\x20'+_0x177f36[_0x53fedf(0x104)])),_0x2a13c0[_0x53fedf(0x159)](_0x177f36);},'onTestSkipped':(_0x14d5cd,_0x580f0d)=>{const _0x10c9c3=_0x5023e6;_0x1df9a4[_0x10c9c3(0xff)](),console[_0x10c9c3(0x161)](a5_0x312754['yellow']('⚠\x20SKIPPED:\x20'+_0x14d5cd+_0x10c9c3(0x164)+_0x580f0d));}});for(const _0x512605 of _0x52c754){!_0x2a13c0[_0x5023e6(0xfc)](_0x5b3fa2=>_0x5b3fa2['name']===_0x512605['name'])&&_0x2a13c0[_0x5023e6(0x159)](_0x512605);}}catch(_0x195137){_0x1df9a4[_0x5023e6(0xff)]();const _0x1ffc18=_0x195137 instanceof Error?_0x195137[_0x5023e6(0x13b)]:String(_0x195137);return console['log'](a5_0x312754['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x1ffc18)),0x1;}_0x1df9a4[_0x5023e6(0xff)]();if(_0x4e9804[_0x5023e6(0x11e)]>0x0){console[_0x5023e6(0x161)](),console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0x101)));const {projectId:_0x260357,agentId:_0x1abb7b}=_0x509907['agent'];for(const _0x58cdec of _0x4e9804){console[_0x5023e6(0x161)](_0x5023e6(0xf4)+a5_0x312754['white'](_0x58cdec['name']));const _0x20cdef=createCommandSpinner(_0x5023e6(0x153)+_0x58cdec[_0x5023e6(0x162)][_0x5023e6(0x11e)]+_0x5023e6(0x178));_0x20cdef['start']();try{const {result:_0x922893}=await runTest(_0x313e42['llm'],_0x58cdec,{'agentId':_0x1abb7b,'projectId':_0x260357,'site':_0x509907[_0x5023e6(0x112)],'noEval':![],'evaluatorId':_0x196bd4,'onRoundStart':(_0x48a27c,_0x3b2840)=>{const _0x12abf6=_0x5023e6;_0x20cdef[_0x12abf6(0x149)]=_0x12abf6(0x102)+(_0x48a27c+0x1)+'/'+_0x3b2840+_0x12abf6(0x178);},'onRoundComplete':(_0xbe312e,_0x4fb5a2,_0x3e8979)=>{const _0x334580=_0x5023e6,_0x4d5982=formatElapsed(_0x4fb5a2);_0x3e8979?console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec['rounds']['length']+'...\x20'+a5_0x312754[_0x334580(0x120)]('✓')+'\x20('+_0x4d5982+')'):console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec[_0x334580(0x162)][_0x334580(0x11e)]+_0x334580(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x2443c4=_0x5023e6;_0x20cdef[_0x2443c4(0x149)]='Evaluating\x20response...';},'onEvaluationComplete':_0x31d042=>{const _0x3cb182=_0x5023e6,_0x67605c=formatElapsed(_0x31d042);console[_0x3cb182(0x161)](_0x3cb182(0xef)+a5_0x312754[_0x3cb182(0x120)]('✓')+'\x20('+_0x67605c+')');}});_0x20cdef['stop'](),_0x2a13c0[_0x5023e6(0x159)](_0x922893);if(_0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x114))console[_0x5023e6(0x161)](a5_0x312754['green']('✓\x20PASS:\x20'+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d)));else _0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x122)?console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x160)+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d))):console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x123)+_0x922893[_0x5023e6(0x132)]));_0x922893[_0x5023e6(0x104)]&&console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0xf5)+_0x922893[_0x5023e6(0x104)]));}catch(_0x3843e1){_0x20cdef[_0x5023e6(0xff)]();const _0x33cc33=_0x3843e1 instanceof Error?_0x3843e1[_0x5023e6(0x13b)]:String(_0x3843e1);console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x123)+_0x33cc33)),_0x2a13c0[_0x5023e6(0x159)]({'name':_0x58cdec['name'],'status':_0x5023e6(0x108),'reason':_0x33cc33,'timestamp':new Date()[_0x5023e6(0x12f)](),'duration_ms':0x0});}}}console[_0x5023e6(0x161)]();const _0x2b61f5=Date[_0x5023e6(0x11b)]()-_0x51b17a,_0x1e4f02=_0x2a13c0[_0x5023e6(0x14c)](_0x5b1d81=>_0x5b1d81[_0x5023e6(0x16c)]===_0x5023e6(0x114))[_0x5023e6(0x11e)],_0x1f3c1e=_0x2a13c0[_0x5023e6(0x14c)](_0x3c1e6d=>_0x3c1e6d[_0x5023e6(0x16c)]===_0x5023e6(0x122))[_0x5023e6(0x11e)],_0x15650c=_0x2a13c0[_0x5023e6(0x14c)](_0x319faa=>_0x319faa[_0x5023e6(0x16c)]===_0x5023e6(0x108))['length'];console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x128)),console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x124)+_0x2a13c0['length']),console[_0x5023e6(0x161)](_0x5023e6(0x155)+a5_0x312754[_0x5023e6(0x120)](_0x1e4f02)),console['log'](_0x5023e6(0x105)+a5_0x312754['red'](_0x1f3c1e));_0x15650c>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x157)+a5_0x312754[_0x5023e6(0x100)](_0x15650c));console[_0x5023e6(0x161)]('Duration:\x20'+formatElapsed(_0x2b61f5)),console['log']('━'[_0x5023e6(0x145)](0x3c));const _0x4fef93={'summary':{'total':_0x2a13c0[_0x5023e6(0x11e)],'passed':_0x1e4f02,'failed':_0x1f3c1e,'errors':_0x15650c>0x0?_0x15650c:undefined,'duration_ms':_0x2b61f5},'tests':_0x2a13c0,'agent':{'project':_0x2e9a88['projectName'],'name':_0x2e9a88['agentName'],'site':_0x41299c},'timestamp':new Date(_0x51b17a)['toISOString']()};if(_0x1c6bba!==_0x5023e6(0x171)||_0x989c7a){const _0x55d43b=formatResults(_0x4fef93,_0x1c6bba);if(_0x989c7a)try{a5_0x1fa2e3[_0x5023e6(0xf1)](_0x989c7a,_0x55d43b,'utf-8'),console['log'](),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x148)+_0x989c7a));}catch(_0x39c480){return console[_0x5023e6(0x161)](),console['log'](a5_0x312754['red'](_0x5023e6(0x107)+_0x39c480)),0x1;}else console['log'](),console[_0x5023e6(0x161)](_0x55d43b);}const _0x54d3fd=_0x2a13c0[_0x5023e6(0x14c)](_0x5c508f=>_0x5c508f['status']!==_0x5023e6(0x114));return _0x54d3fd['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x59f68b=a6_0x1849;(function(_0x3a635d,_0x8d2347){const _0x828eb7=a6_0x1849,_0x27151b=_0x3a635d();while(!![]){try{const _0x586856=parseInt(_0x828eb7(0x158))/0x1*(-parseInt(_0x828eb7(0x167))/0x2)+parseInt(_0x828eb7(0x163))/0x3+parseInt(_0x828eb7(0x16f))/0x4*(parseInt(_0x828eb7(0x15a))/0x5)+-parseInt(_0x828eb7(0x153))/0x6+parseInt(_0x828eb7(0x178))/0x7*(-parseInt(_0x828eb7(0x149))/0x8)+parseInt(_0x828eb7(0x17c))/0x9*(-parseInt(_0x828eb7(0x139))/0xa)+parseInt(_0x828eb7(0x16a))/0xb;if(_0x586856===_0x8d2347)break;else _0x27151b['push'](_0x27151b['shift']());}catch(_0x479468){_0x27151b['push'](_0x27151b['shift']());}}}(a6_0x240d,0x579c1));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';function a6_0x1849(_0x13f782,_0xee0204){_0x13f782=_0x13f782-0x138;const _0x240d32=a6_0x240d();let _0x184938=_0x240d32[_0x13f782];return _0x184938;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x59f68b(0x159),a6_0x59f68b(0x152),'cookie',a6_0x59f68b(0x161),'set-cookie2','x-xsrf-token',a6_0x59f68b(0x13f),a6_0x59f68b(0x145)]);function isSensitiveHeader(_0xa3686b){const _0x56a2d2=a6_0x59f68b;return SENSITIVE_HEADERS[_0x56a2d2(0x172)](_0xa3686b[_0x56a2d2(0x160)]());}function parseHeader(_0x5b7fda){const _0x2333fb=a6_0x59f68b,_0x60013c=_0x5b7fda[_0x2333fb(0x174)](':');if(_0x60013c===-0x1)throw new Error(_0x2333fb(0x148)+_0x5b7fda+_0x2333fb(0x141)+_0x2333fb(0x14d));const _0x22c2ad=_0x5b7fda['substring'](0x0,_0x60013c)[_0x2333fb(0x165)](),_0x49dcc7=_0x5b7fda[_0x2333fb(0x164)](_0x60013c+0x1)['trim']();if(!_0x22c2ad)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5b7fda+'\x22');return[_0x22c2ad,_0x49dcc7];}export class ApiCommand extends BaseCommand{[a6_0x59f68b(0x16d)]=a6_0x59f68b(0x142);[a6_0x59f68b(0x13c)]=a6_0x59f68b(0x169);['validate'](_0x4c8853){const _0x58f5fc=a6_0x59f68b,{args:_0xff4814,options:_0x53a523}=_0x4c8853,_0xce1590=_0x53a523;if(_0xff4814[_0x58f5fc(0x173)]===0x0)return _0x58f5fc(0x14b);const _0x2bb83e=_0xff4814[0x0];if(!_0x2bb83e[_0x58f5fc(0x140)]('/'))return _0x58f5fc(0x13e)+_0x2bb83e;const _0x30e98f=_0xce1590[_0x58f5fc(0x13b)],_0x466261=_0xce1590['file'];if(_0x30e98f&&_0x466261)return _0x58f5fc(0x177);const _0x4d478c=_0xce1590[_0x58f5fc(0x13d)]||_0x58f5fc(0x15f),_0x3a1270=['GET',_0x58f5fc(0x171),_0x58f5fc(0x14e),'DELETE',_0x58f5fc(0x17a)];if(!_0x3a1270[_0x58f5fc(0x154)](_0x4d478c[_0x58f5fc(0x14a)]()))return _0x58f5fc(0x151)+_0x4d478c+'.\x20Valid\x20methods:\x20'+_0x3a1270[_0x58f5fc(0x156)](',\x20');const _0x4f5118=_0xce1590[_0x58f5fc(0x15e)]||'td',_0x202ce0=['td',_0x58f5fc(0x162),_0x58f5fc(0x17b),_0x58f5fc(0x14c),_0x58f5fc(0x155),'llm-proxy'];if(!_0x202ce0[_0x58f5fc(0x154)](_0x4f5118))return _0x58f5fc(0x157)+_0x4f5118+_0x58f5fc(0x179)+_0x202ce0['join'](',\x20');return undefined;}async[a6_0x59f68b(0x170)](_0x5db8eb){const _0x112cd5=a6_0x59f68b,{options:_0x222644,args:_0x22d7a5,tdx:_0x56a97b}=_0x5db8eb,_0x49c5cd=_0x222644,_0x588981=_0x22d7a5[0x0],_0x48f21a=(_0x49c5cd[_0x112cd5(0x13d)]||_0x112cd5(0x15f))[_0x112cd5(0x14a)](),_0x176e80=_0x49c5cd[_0x112cd5(0x13b)],_0x334103=_0x49c5cd[_0x112cd5(0x146)],_0x518204=_0x49c5cd[_0x112cd5(0x168)],_0xbcbfb4=_0x49c5cd['type']||'td';try{const _0x434694={};if(_0x518204){const _0x26c16b=Array[_0x112cd5(0x150)](_0x518204)?_0x518204:[_0x518204];for(const _0x3c4358 of _0x26c16b){const [_0x12d0e1,_0x369257]=parseHeader(_0x3c4358);_0x434694[_0x12d0e1]=_0x369257;}}let _0x379c7b;if(_0x176e80)_0x379c7b=_0x176e80;else{if(_0x334103)try{_0x379c7b=RawAPI[_0x112cd5(0x15c)](_0x334103);}catch(_0x439d5b){return console[_0x112cd5(0x138)](_0x112cd5(0x15d)+(_0x439d5b instanceof Error?_0x439d5b[_0x112cd5(0x176)]:String(_0x439d5b))),0x1;}}const _0x738fda={'method':_0x48f21a,'apiType':_0xbcbfb4,'includeHeaders':_0x222644[_0x112cd5(0x16c)]};_0x379c7b&&(_0x738fda['body']=_0x379c7b);Object[_0x112cd5(0x143)](_0x434694)[_0x112cd5(0x173)]>0x0&&(_0x738fda[_0x112cd5(0x16b)]=_0x434694);if(_0x222644[_0x112cd5(0x16c)]){const _0x2f2c2c=resolveSite(_0x222644['site']),_0x32ac13=getEndpoint(_0x2f2c2c,_0xbcbfb4),_0x2293db=''+_0x32ac13+_0x588981;console[_0x112cd5(0x138)]('>\x20'+_0x48f21a+'\x20'+_0x2293db);const _0x4aa2d6=getAuthHeaders(_0x2f2c2c),_0x4b0c46={..._0x4aa2d6,..._0x434694};for(const [_0x20ac8a,_0x3fc4af]of Object[_0x112cd5(0x15b)](_0x4b0c46)){!isSensitiveHeader(_0x20ac8a)&&console[_0x112cd5(0x138)]('>\x20'+_0x20ac8a+':\x20'+_0x3fc4af);}_0x379c7b&&console[_0x112cd5(0x138)]('>'),console[_0x112cd5(0x138)]('');}const _0x11ca54=await _0x56a97b[_0x112cd5(0x142)]['request'](_0x588981,_0x738fda);if(_0x222644[_0x112cd5(0x16c)]&&_0x11ca54[_0x112cd5(0x16b)]){console[_0x112cd5(0x138)](_0x112cd5(0x13a)+_0x11ca54[_0x112cd5(0x166)]);for(const [_0x39e105,_0x38be5f]of Object[_0x112cd5(0x15b)](_0x11ca54[_0x112cd5(0x16b)])){!isSensitiveHeader(_0x39e105)&&console[_0x112cd5(0x138)]('<\x20'+_0x39e105+':\x20'+_0x38be5f);}console[_0x112cd5(0x138)]('');}const _0x13f4f7=Boolean(_0x222644['output']),_0x4de27c={'color':_0x222644[_0x112cd5(0x14f)],'noColor':_0x222644['noColor']||_0x13f4f7&&!_0x222644[_0x112cd5(0x14f)]},_0x2417b7=colorizeJSON(_0x11ca54[_0x112cd5(0x13b)],_0x4de27c);return _0x222644[_0x112cd5(0x144)]?(writeFileSync(_0x222644[_0x112cd5(0x144)],_0x2417b7),console[_0x112cd5(0x138)](_0x112cd5(0x16e)+_0x222644[_0x112cd5(0x144)])):console['log'](_0x2417b7),0x0;}catch(_0x553138){return _0x553138 instanceof Error?(console[_0x112cd5(0x138)]('Error:\x20'+_0x553138['message']),_0x222644['verbose']&&_0x553138[_0x112cd5(0x147)]&&console[_0x112cd5(0x138)](_0x112cd5(0x175)+_0x553138[_0x112cd5(0x147)])):console[_0x112cd5(0x138)](_0x112cd5(0x15d)+String(_0x553138)),0x1;}}}function a6_0x240d(){const _0x122cbd=['stack','Invalid\x20header\x20format:\x20\x22','8eHgDMX','toUpperCase','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','trino','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PUT','color','isArray','Invalid\x20HTTP\x20method:\x20','proxy-authorization','843774JvqgEY','includes','llm','join','Invalid\x20API\x20type:\x20','2Cglzvm','authorization','76465dQhcKa','entries','readBodyFromFile','Error:\x20','type','GET','toLowerCase','set-cookie','cdp','1224291tEwtar','substring','trim','status','109488mzDflN','header','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','10957936pMSoaP','headers','verbose','name','Results\x20saved\x20to\x20','4ObbRdi','execute','POST','has','length','indexOf','\x0aStack\x20trace:\x0a','message','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','3953999SDXvaZ','.\x20Valid\x20types:\x20','PATCH','workflow','9flasUj','error','2457430vQqFqD','<\x20HTTP/1.1\x20','data','description','method','Endpoint\x20must\x20start\x20with\x20/:\x20','x-auth-token','startsWith','\x22.\x20','api','keys','output','x-trino-user','file'];a6_0x240d=function(){return _0x122cbd;};return a6_0x240d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x6925ab=a7_0x489a;(function(_0xbd2cc6,_0x578046){const _0x26ed14=a7_0x489a,_0x2041ff=_0xbd2cc6();while(!![]){try{const _0x33a69b=-parseInt(_0x26ed14(0x183))/0x1*(parseInt(_0x26ed14(0x159))/0x2)+-parseInt(_0x26ed14(0x185))/0x3+parseInt(_0x26ed14(0x167))/0x4+parseInt(_0x26ed14(0x19b))/0x5+parseInt(_0x26ed14(0x15f))/0x6+parseInt(_0x26ed14(0x16d))/0x7*(parseInt(_0x26ed14(0x19c))/0x8)+parseInt(_0x26ed14(0x160))/0x9*(-parseInt(_0x26ed14(0x18b))/0xa);if(_0x33a69b===_0x578046)break;else _0x2041ff['push'](_0x2041ff['shift']());}catch(_0x3bec43){_0x2041ff['push'](_0x2041ff['shift']());}}}(a7_0x5664,0xd48fd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x5664(){const _0x283acb=['email','description','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x0aSetup\x20cancelled','Setup\x20API\x20key\x20authentication\x20interactively','green','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20(profile:\x20','1155460hKPTqy','1672ybSVld','Site\x20name\x20cannot\x20be\x20empty','auth:setup','other','auth:clear','message','N/A','logLevel','test','10ETxseJ','red','text','✓\x20Default\x20site\x20set\x20to\x20','✓\x20Profile\x20\x27','Enter\x20site\x20name:','4787934hrGWNS','291996qMUwXo','auth','Remove\x20API\x20key\x20from\x20system\x20keychain','/app/mp/ak','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','yellow','6136900gAXsXe','warn','last_name','profile','No\x20API\x20key\x20found\x20in\x20keychain','status','28889ROlTFS','\x20\x20tdx','\x27\x20registered','trim','join','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','first_name','filter','User:\x20','log','\x20for\x20profile:\x20','getUserInfo','System\x20keychain\x20is\x20not\x20available','Select\x20your\x20Treasure\x20Data\x20site:','API\x20key\x20cannot\x20be\x20empty','Setting\x20up\x20authentication\x20for\x20site:\x20','Name:\x20','jobs','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','22001mxiZMd','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','5096937ePUNsz','✓\x20API\x20key\x20removed\x20from\x20keychain','create','name','Validating\x20API\x20key...','customSite','230CxxHDf','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ERROR','✗\x20Validation\x20failed:\x20','tdx\x20profile:\x20','execute','error'];a7_0x5664=function(){return _0x283acb;};return a7_0x5664();}import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x489a(_0x53fe6c,_0x382a9a){_0x53fe6c=_0x53fe6c-0x156;const _0x56645d=a7_0x5664();let _0x489a22=_0x56645d[_0x53fe6c];return _0x489a22;}import{buildSiteChoices}from'../core/constants.js';import a7_0x142149 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_0xcdccf4 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x19e);[a7_0x6925ab(0x194)]=a7_0x6925ab(0x197);async[a7_0x6925ab(0x191)](_0x1e8311){const _0x4a16cb=a7_0x6925ab,{options:_0x139157}=_0x1e8311,_0x576f7=_0x139157['profile'];console[_0x4a16cb(0x178)](a7_0xcdccf4['bold']('tdx:\x20auth\x20setup'));const _0x26712c=_0x139157['site']||'us01',{choices:_0xe3a0b5,initialIndex:_0x3be95b}=buildSiteChoices(_0x26712c),_0x37e252=_0x576f7?_0x4a16cb(0x199)+_0x576f7+'):':_0x4a16cb(0x17c),_0xa27a46=await a7_0x142149({'type':'select','name':_0x4a16cb(0x18c),'message':_0x37e252,'choices':_0xe3a0b5,'initial':_0x3be95b});if(!_0xa27a46['site'])return console[_0x4a16cb(0x178)](_0x4a16cb(0x196)),0x1;let _0x3f5187;if(_0xa27a46[_0x4a16cb(0x18c)]===_0x4a16cb(0x19f)){const _0x44c054=await a7_0x142149({'type':_0x4a16cb(0x15b),'name':_0x4a16cb(0x18a),'message':_0x4a16cb(0x15e),'initial':'us01','validate':_0x26b6da=>{const _0x223f90=_0x4a16cb;if(!_0x26b6da||!_0x26b6da[_0x223f90(0x170)]())return _0x223f90(0x19d);if(!/^[a-z0-9-]+$/[_0x223f90(0x158)](_0x26b6da[_0x223f90(0x170)]()))return _0x223f90(0x181);return!![];}});if(!_0x44c054[_0x4a16cb(0x18a)])return console[_0x4a16cb(0x178)](_0x4a16cb(0x196)),0x1;_0x3f5187=_0x44c054[_0x4a16cb(0x18a)];}else _0x3f5187=_0xa27a46[_0x4a16cb(0x18c)];const _0x935060=resolveSite(_0x3f5187);console[_0x4a16cb(0x178)](_0x4a16cb(0x17e)+_0x935060),console['log'](_0x4a16cb(0x164)),console[_0x4a16cb(0x178)]('\x20\x20'+getConsoleUrl(_0x935060,_0x4a16cb(0x163)));const _0x9022b7=await a7_0x142149({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x2ead2a=>{const _0x16a71f=_0x4a16cb;if(!_0x2ead2a||!_0x2ead2a[_0x16a71f(0x170)]())return _0x16a71f(0x17d);return!![];}});if(!_0x9022b7['apiKey'])return console[_0x4a16cb(0x178)]('\x0aSetup\x20cancelled'),0x1;const _0x3aac55=_0x9022b7['apiKey'];console[_0x4a16cb(0x178)](_0x4a16cb(0x189));try{const _0x115275=TDX[_0x4a16cb(0x187)]({'site':_0x935060,'apiKey':_0x3aac55[_0x4a16cb(0x170)](),'logLevel':_0x139157[_0x4a16cb(0x157)]??LogLevel[_0x4a16cb(0x18e)]}),_0x1c22d9=await _0x115275[_0x4a16cb(0x180)][_0x4a16cb(0x17a)]();console[_0x4a16cb(0x178)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1c22d9[_0x4a16cb(0x193)]+')');const _0x3b85ae=await isKeychainAvailable();_0x3b85ae?(await saveAPIKeyAsync(_0x3aac55[_0x4a16cb(0x170)](),_0x935060,_0x576f7),console[_0x4a16cb(0x178)](_0x4a16cb(0x182)+(_0x576f7?_0x4a16cb(0x19a)+_0x576f7+')':''))):(console[_0x4a16cb(0x168)](a7_0xcdccf4[_0x4a16cb(0x166)](_0x4a16cb(0x184))),console[_0x4a16cb(0x168)](a7_0xcdccf4[_0x4a16cb(0x166)](_0x4a16cb(0x172))));if(_0x576f7){const _0x5569b8={'site':_0x935060};saveProfileToUserConfig(_0x576f7,_0x5569b8),console[_0x4a16cb(0x178)](_0x4a16cb(0x15d)+_0x576f7+_0x4a16cb(0x16f));}else saveDefaultSiteToUserConfig(_0x935060),console['log'](_0x4a16cb(0x15c)+_0x935060);const _0x4c1a83=_0x576f7?'\x20--profile\x20'+_0x576f7:'';return console[_0x4a16cb(0x178)](),console[_0x4a16cb(0x178)](_0x4a16cb(0x18d)),console[_0x4a16cb(0x178)](_0x4a16cb(0x16e)+_0x4c1a83+_0x4a16cb(0x195)),console[_0x4a16cb(0x178)](_0x4a16cb(0x16e)+_0x4c1a83+_0x4a16cb(0x165)),0x0;}catch(_0x2da1ad){if(_0x2da1ad instanceof HTTPClientError&&_0x2da1ad['status']===0x191)return printAuthError(_0x2da1ad),0x1;return console[_0x4a16cb(0x192)](a7_0xcdccf4[_0x4a16cb(0x15a)](_0x4a16cb(0x18f)+(_0x2da1ad instanceof Error?_0x2da1ad[_0x4a16cb(0x1a1)]:String(_0x2da1ad)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x161);[a7_0x6925ab(0x194)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x2caa75){const _0x34e267=a7_0x6925ab,{options:_0x537aaa,tdx:_0x1991d6}=_0x2caa75,_0x48f9f7=_0x537aaa[_0x34e267(0x18c)],_0x4e05b7=_0x537aaa[_0x34e267(0x16a)],_0x3cc458=_0x4e05b7?_0x4e05b7:_0x34e267(0x156);console[_0x34e267(0x178)](_0x34e267(0x190)+_0x3cc458+'\x20(site:\x20'+_0x48f9f7+')');const _0x4992a6=await resolveAPIKeyAsync(_0x48f9f7,_0x4e05b7);if(_0x4992a6){const {source:_0x1ffafb,isDeprecated:_0x531511}=_0x4992a6,_0x6d4adf=_0x34e267(0x174)+_0x1ffafb;console[_0x34e267(0x178)](_0x531511?a7_0xcdccf4[_0x34e267(0x166)](_0x6d4adf):_0x6d4adf);}else console[_0x34e267(0x178)](a7_0xcdccf4['yellow']('No\x20credential\x20found'));try{const _0x49593d=await _0x1991d6[_0x34e267(0x180)][_0x34e267(0x17a)]();return console[_0x34e267(0x178)](a7_0xcdccf4[_0x34e267(0x198)](_0x34e267(0x173))),console[_0x34e267(0x178)](_0x34e267(0x177)+_0x49593d[_0x34e267(0x193)]),(_0x49593d[_0x34e267(0x175)]||_0x49593d[_0x34e267(0x169)])&&console[_0x34e267(0x178)](_0x34e267(0x17f)+[_0x49593d[_0x34e267(0x175)],_0x49593d[_0x34e267(0x169)]][_0x34e267(0x176)](Boolean)[_0x34e267(0x171)]('\x20')),0x0;}catch(_0x5d1d70){return _0x5d1d70 instanceof HTTPClientError&&_0x5d1d70[_0x34e267(0x16c)]===0x191?printAuthError(_0x5d1d70,!![],_0x4e05b7):console[_0x34e267(0x192)](a7_0xcdccf4[_0x34e267(0x15a)](_0x34e267(0x18f)+(_0x5d1d70 instanceof Error?_0x5d1d70[_0x34e267(0x1a1)]:String(_0x5d1d70)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x1a0);[a7_0x6925ab(0x194)]=a7_0x6925ab(0x162);async[a7_0x6925ab(0x191)](_0x129360){const _0x541ffe=a7_0x6925ab,{options:_0x59f9bf}=_0x129360,_0x2aea80=_0x59f9bf['profile'];console[_0x541ffe(0x178)](a7_0xcdccf4['bold']('tdx:\x20auth\x20clear'));const _0x1c048b=await isKeychainAvailable();if(!_0x1c048b)return console[_0x541ffe(0x192)](a7_0xcdccf4[_0x541ffe(0x15a)](_0x541ffe(0x17b))),0x1;const _0x4187ec=await deleteKeychainAPIKey(_0x2aea80);return _0x4187ec?(clearCredentialCache(),console[_0x541ffe(0x178)](_0x541ffe(0x186)+(_0x2aea80?_0x541ffe(0x19a)+_0x2aea80+')':'')),0x0):(console['log'](_0x541ffe(0x16b)+(_0x2aea80?_0x541ffe(0x179)+_0x2aea80:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x4a47d4=a8_0x3e30;(function(_0x38bc3a,_0x4072c7){const _0x35ca87=a8_0x3e30,_0x2065fc=_0x38bc3a();while(!![]){try{const _0x17bec0=-parseInt(_0x35ca87(0xfd))/0x1+parseInt(_0x35ca87(0x10a))/0x2+parseInt(_0x35ca87(0x116))/0x3+-parseInt(_0x35ca87(0x122))/0x4*(parseInt(_0x35ca87(0xec))/0x5)+-parseInt(_0x35ca87(0x114))/0x6+-parseInt(_0x35ca87(0xe2))/0x7*(parseInt(_0x35ca87(0x121))/0x8)+parseInt(_0x35ca87(0xeb))/0x9*(parseInt(_0x35ca87(0x123))/0xa);if(_0x17bec0===_0x4072c7)break;else _0x2065fc['push'](_0x2065fc['shift']());}catch(_0x24ba69){_0x2065fc['push'](_0x2065fc['shift']());}}}(a8_0x3df7,0x8b137));function a8_0x3df7(){const _0x547945=['stringify','startChat','440372NqJAvh','tool','\x27\x20not\x20found','Resolving\x20project\x20\x27','description','llm','targetKnowledgeBase','targetFunction','error','join','29412wJDjyZ','session\x20context','616404xfUUzk','args','verbose','data','resolveAgentId','Continuing\x20chat:\x20','log','resolveProjectId','\x20\x20Cause:\x20','chat-create','targetAgent','184vsexUZ','12GjEjxu','48550mJkzER','agent','name','functionName','content','execute','tool_call','projectId','llmAgent','streamChatJsonl','Getting\x20default\x20agent...','string','streamChat','targetWebSearchTool','329777xKlPBA','write','stream','metadata','agentId','chatId','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Using\x20cached\x20default\x20agent:\x20','event','4302RRWKxx','259495rbfZss','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','claude-4.5-haiku','--agent\x20flag','Error:\x20','404','Chat\x20session:\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','chat','handleChatEvent','Resolving\x20agent\x20\x27','validate','type','site','done','message','Using\x20agent\x20from\x20','932537NmlmUc','context','llmProject','CHAT_NOT_FOUND','includes','stack','Error:\x20Chat\x20session\x20\x27','new','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','cause','\x27...'];a8_0x3df7=function(){return _0x547945;};return a8_0x3df7();}function a8_0x3e30(_0x1367ad,_0x1d1b89){_0x1367ad=_0x1367ad-0xdf;const _0x3df7d4=a8_0x3df7();let _0x3e30f1=_0x3df7d4[_0x1367ad];return _0x3e30f1;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x2941ff,_0xce34aa){const _0x3366c0=a8_0x3e30;if(_0x2941ff instanceof SDKError)console[_0x3366c0(0x112)](_0x3366c0(0xf0)+_0x2941ff[_0x3366c0(0xfb)]),_0xce34aa['verbose']&&(_0x2941ff[_0x3366c0(0x106)]&&console[_0x3366c0(0x112)](_0x3366c0(0x11e)+_0x2941ff[_0x3366c0(0x106)]),_0x2941ff[_0x3366c0(0x102)]&&(console[_0x3366c0(0x112)]('\x0aStack\x20trace:'),console['error'](_0x2941ff[_0x3366c0(0x102)])));else throw _0x2941ff;}async function resolveAgentId(_0x3b6166,_0x41a765,_0x466637,_0x1b85a1,_0x9902cd){const _0x277784=a8_0x3e30,_0x2d2549=_0x41a765||_0x466637;if(_0x2d2549){const {projectName:_0x5b27ba,agentName:_0x155289}=parseAgentRef(_0x2d2549),_0x49085c=_0x155289||_0x2d2549,_0x43e639=_0x155289?_0x5b27ba:_0x1b85a1;if(!_0x43e639)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x9902cd){const _0x5c9f0a=_0x41a765?_0x277784(0xef):_0x277784(0x115);console['error'](_0x277784(0xfc)+_0x5c9f0a+':\x20'+_0x43e639+'/'+_0x49085c);}const _0x543ac5=await withSpinner(_0x277784(0x10d)+_0x43e639+_0x277784(0x107),()=>_0x3b6166[_0x277784(0x10f)][_0x277784(0x11d)](_0x43e639),{'verbose':_0x9902cd}),_0x5b56c8=await withSpinner(_0x277784(0xf6)+_0x49085c+_0x277784(0x107),()=>_0x3b6166[_0x277784(0x10f)][_0x277784(0x11a)](_0x49085c,_0x543ac5['data']),{'verbose':_0x9902cd});return _0x5b56c8[_0x277784(0x119)];}else{const _0x1d5440=_0x3b6166[_0x277784(0x10f)]['getDefaultAgent']();if(_0x1d5440)return _0x9902cd&&console[_0x277784(0x112)](_0x277784(0xe9)+_0x1d5440[_0x277784(0x125)]),_0x1d5440['id'];const _0x67b992=await withSpinner(_0x277784(0x12d),()=>_0x3b6166[_0x277784(0x10f)]['getOrCreateDefaultAgent'](_0x277784(0xee),0x0),{'verbose':_0x9902cd});return _0x67b992['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4a47d4(0x125)]=a8_0x4a47d4(0xf4);['description']=a8_0x4a47d4(0x105);[a8_0x4a47d4(0xf7)](_0x3c1b13){const _0x174ca1=a8_0x4a47d4,_0xa293eb=_0x3c1b13[_0x174ca1(0x117)]['join']('\x20');if(!_0xa293eb)return _0x174ca1(0xed);return undefined;}async['streamChat'](_0x4da16c,_0x28374c,_0x5ee12c,_0xc20c96,_0x34adea){const _0x40fe17=a8_0x4a47d4;for await(const _0x6b94ac of _0x4da16c['llm'][_0x40fe17(0xf4)](_0x28374c,{'agentId':_0x5ee12c,'chatId':_0xc20c96})){if(_0x6b94ac['type']===_0x40fe17(0xe5)){const _0xa79c4f=_0x6b94ac[_0x40fe17(0x119)][_0x40fe17(0xe7)];saveLastChatId(_0xa79c4f),_0x34adea&&console['error'](_0x40fe17(0xf2)+_0xa79c4f);}else _0x6b94ac[_0x40fe17(0xf8)]===_0x40fe17(0xea)&&this[_0x40fe17(0xf5)](_0x6b94ac[_0x40fe17(0x119)]);}}async[a8_0x4a47d4(0x12c)](_0x286756,_0x9547ed,_0x2f74f2,_0x47c6c6){const _0x2563d5=a8_0x4a47d4,_0x556cec=_0x286756[_0x2563d5(0xfe)][_0x2563d5(0xf9)];let _0x41f6d1=![];for await(const _0x228249 of _0x286756['llm'][_0x2563d5(0xf4)](_0x9547ed,{'agentId':_0x2f74f2,'chatId':_0x47c6c6})){if(_0x228249['type']===_0x2563d5(0xe5)){const _0x121b78=_0x228249['data'];saveLastChatId(_0x121b78[_0x2563d5(0xe7)]);const _0x152345=_0x121b78[_0x2563d5(0x12a)]&&_0x121b78['agentId']?getLLMConversationUrl(_0x556cec,_0x121b78[_0x2563d5(0x12a)],_0x121b78[_0x2563d5(0xe6)],_0x121b78['chatId']):undefined;console[_0x2563d5(0x11c)](JSON[_0x2563d5(0x108)]({'type':_0x2563d5(0xe5),'data':{'chatId':_0x121b78[_0x2563d5(0xe7)],'agentId':_0x121b78['agentId'],'consoleUrl':_0x152345}})),_0x41f6d1=!![];}else{if(_0x228249['type']===_0x2563d5(0xea)){!_0x41f6d1&&_0x47c6c6&&(console[_0x2563d5(0x11c)](JSON[_0x2563d5(0x108)]({'type':_0x2563d5(0xe5),'data':{'chatId':_0x47c6c6}})),_0x41f6d1=!![]);const _0x382bb8=_0x228249[_0x2563d5(0x119)];if(_0x2563d5(0x127)in _0x382bb8)console[_0x2563d5(0x11c)](JSON[_0x2563d5(0x108)]({'type':_0x2563d5(0x127),'data':{'content':_0x382bb8[_0x2563d5(0x127)]}}));else{if(_0x2563d5(0x129)in _0x382bb8){const _0x418d91=_0x382bb8['tool_call'];console['log'](JSON[_0x2563d5(0x108)]({'type':_0x2563d5(0x129),'data':{'id':_0x418d91['id'],'name':_0x418d91[_0x2563d5(0x126)],'target':_0x418d91[_0x2563d5(0x110)]?.['name']||_0x418d91[_0x2563d5(0x120)]?.[_0x2563d5(0x125)]||_0x418d91[_0x2563d5(0xe1)]?.[_0x2563d5(0x125)]||_0x418d91[_0x2563d5(0x111)]}}));}else{if(_0x2563d5(0x10b)in _0x382bb8)console[_0x2563d5(0x11c)](JSON[_0x2563d5(0x108)]({'type':'tool_result','data':{'id':_0x382bb8[_0x2563d5(0x10b)]['id'],'name':_0x382bb8[_0x2563d5(0x10b)]['functionName'],'result':typeof _0x382bb8[_0x2563d5(0x10b)][_0x2563d5(0x127)]===_0x2563d5(0xdf)?_0x382bb8[_0x2563d5(0x10b)][_0x2563d5(0x127)]['slice'](0x0,0x1f4):''}}));else _0x2563d5(0x112)in _0x382bb8&&console[_0x2563d5(0x11c)](JSON['stringify']({'type':'error','data':{'error':_0x382bb8[_0x2563d5(0x112)]}}));}}}}}console[_0x2563d5(0x11c)](JSON['stringify']({'type':_0x2563d5(0xfa)}));}async['execute'](_0x38ee29){const _0x41bdcf=a8_0x4a47d4,{options:_0x5e2b61,args:_0x43d2d6,tdx:_0x1cb716}=_0x38ee29,_0x41702b=_0x43d2d6[_0x41bdcf(0x113)]('\x20'),_0x42cfb2=_0x5e2b61,_0x191da3=_0x42cfb2[_0x41bdcf(0x124)],_0x174de5=_0x42cfb2[_0x41bdcf(0x12b)],_0x445240=_0x42cfb2[_0x41bdcf(0xff)],_0x23dfc8=_0x42cfb2[_0x41bdcf(0x104)],_0x374725=_0x42cfb2[_0x41bdcf(0xe7)],_0x5b2a88=_0x42cfb2[_0x41bdcf(0xe4)];if(_0x23dfc8&&_0x374725)return console['error']('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x47e516,_0x31ff74;if(_0x374725)_0x31ff74=_0x374725;else!_0x23dfc8&&(_0x31ff74=loadLastChatId(),_0x31ff74&&_0x5e2b61['verbose']&&console[_0x41bdcf(0x112)](_0x41bdcf(0x11b)+_0x31ff74));!_0x374725&&(_0x23dfc8||!_0x31ff74)&&(_0x47e516=await resolveAgentId(_0x1cb716,_0x191da3,_0x174de5,_0x445240,_0x5e2b61[_0x41bdcf(0x118)]));const _0x5254fa=_0x5b2a88?(_0xad6d98,_0x4e0e0f,_0x79f24)=>this[_0x41bdcf(0x12c)](_0x1cb716,_0xad6d98,_0x4e0e0f,_0x79f24):(_0x15e794,_0x5ac3af,_0x516f62)=>this[_0x41bdcf(0xe0)](_0x1cb716,_0x15e794,_0x5ac3af,_0x516f62,_0x5e2b61['verbose']);try{await _0x5254fa(_0x41702b,_0x47e516,_0x31ff74);}catch(_0x215c6a){const _0x4c09ec=_0x215c6a instanceof SDKError&&_0x215c6a['code']===ErrorCode[_0x41bdcf(0x100)]||_0x215c6a instanceof Error&&_0x215c6a['message'][_0x41bdcf(0x101)](_0x41bdcf(0xf1));if(_0x4c09ec&&_0x374725)return console[_0x41bdcf(0x112)](_0x41bdcf(0x103)+_0x374725+_0x41bdcf(0x10c)),0x1;if(_0x4c09ec)_0x5e2b61['verbose']&&console[_0x41bdcf(0x112)](_0x41bdcf(0xf3)),!_0x47e516&&(_0x47e516=await resolveAgentId(_0x1cb716,_0x191da3,_0x174de5,_0x445240,_0x5e2b61[_0x41bdcf(0x118)])),await _0x5254fa(_0x41702b,_0x47e516,undefined);else throw _0x215c6a;}return!_0x5b2a88&&console[_0x41bdcf(0x11c)](),0x0;}catch(_0x1eaf93){return console[_0x41bdcf(0x112)](),handleSDKError(_0x1eaf93,_0x5e2b61),0x1;}}['handleChatEvent'](_0x1e63f5){const _0x401b7f=a8_0x4a47d4;if(_0x401b7f(0x127)in _0x1e63f5)process['stdout'][_0x401b7f(0xe3)](_0x1e63f5[_0x401b7f(0x127)]);else _0x401b7f(0x112)in _0x1e63f5&&console[_0x401b7f(0x112)]('\x0aError:\x20'+_0x1e63f5['error']);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x4a47d4(0x11f);[a8_0x4a47d4(0x10e)]='Create\x20a\x20new\x20chat\x20session';[a8_0x4a47d4(0xf7)](_0x46eaf3){const _0x3203d0=a8_0x4a47d4,_0x26549d=_0x46eaf3['options'],_0x18e8cc=_0x26549d[_0x3203d0(0x124)],_0x2e5106=_0x26549d[_0x3203d0(0x12b)];if(!_0x18e8cc&&!_0x2e5106)return _0x3203d0(0xe8);return undefined;}async[a8_0x4a47d4(0x128)](_0xa6a7){const _0x502699=a8_0x4a47d4,{options:_0x2b9cfa,tdx:_0x1dfc41}=_0xa6a7,_0x197516=_0x2b9cfa,_0x357202=_0x197516['agent'],_0x4d1dfc=_0x197516[_0x502699(0x12b)],_0x2d98c3=_0x197516[_0x502699(0xff)];try{const _0x2fd3e6=await resolveAgentId(_0x1dfc41,_0x357202,_0x4d1dfc,_0x2d98c3,_0x2b9cfa[_0x502699(0x118)]),_0x4d8f09=await _0x1dfc41[_0x502699(0x10f)][_0x502699(0x109)](_0x2fd3e6);return saveLastChatId(_0x4d8f09['id']),console[_0x502699(0x11c)](JSON[_0x502699(0x108)]({'chatId':_0x4d8f09['id'],'agentId':_0x2fd3e6})),0x0;}catch(_0x291edd){return handleSDKError(_0x291edd,_0x2b9cfa),0x1;}}}
|
|
1
|
+
const a8_0x5a85ea=a8_0x3abd;(function(_0x3872b5,_0x28d547){const _0x2c07ce=a8_0x3abd,_0x22e275=_0x3872b5();while(!![]){try{const _0x5bb4d9=parseInt(_0x2c07ce(0x1cb))/0x1*(-parseInt(_0x2c07ce(0x1bf))/0x2)+-parseInt(_0x2c07ce(0x1b1))/0x3+parseInt(_0x2c07ce(0x1ad))/0x4+parseInt(_0x2c07ce(0x1cf))/0x5*(-parseInt(_0x2c07ce(0x1c7))/0x6)+-parseInt(_0x2c07ce(0x1c9))/0x7*(parseInt(_0x2c07ce(0x1a3))/0x8)+-parseInt(_0x2c07ce(0x1b2))/0x9*(-parseInt(_0x2c07ce(0x1a2))/0xa)+-parseInt(_0x2c07ce(0x1d1))/0xb*(-parseInt(_0x2c07ce(0x1c3))/0xc);if(_0x5bb4d9===_0x28d547)break;else _0x22e275['push'](_0x22e275['shift']());}catch(_0x5ef677){_0x22e275['push'](_0x22e275['shift']());}}}(a8_0x27f8,0x86fb7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function a8_0x3abd(_0x55fc40,_0x587816){_0x55fc40=_0x55fc40-0x190;const _0x27f868=a8_0x27f8();let _0x3abd74=_0x27f868[_0x55fc40];return _0x3abd74;}function a8_0x27f8(){const _0x381d1b=['targetWebSearchTool','1108368MFwXrV','1071153wkJjFm','done','write','description','string','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','chat-create','code','options','Using\x20cached\x20default\x20agent:\x20','name','Resolving\x20project\x20\x27','cause','9314jeAwCU','stdout','chat','data','12VTQmPM','includes','join','verbose','486xXxSDq','--agent\x20flag','49FWFbEL','Error:\x20Chat\x20session\x20\x27','111MBVcJZ','event','startChat','Error:\x20','44095tTExeb','chatId','19162594kDMiJy','streamChat','targetFunction','validate','Create\x20a\x20new\x20chat\x20session','execute','Chat\x20session:\x20','\x0aStack\x20trace:','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','site','projectId','metadata','CHAT_NOT_FOUND','message','getOrCreateDefaultAgent','slice','\x27\x20not\x20found','log','agentId','llmProject','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','tool_result','llmAgent','\x0aError:\x20','agent','tool_call','Using\x20agent\x20from\x20','streamChatJsonl','handleChatEvent','error','type','20UUtlUs','501848yduLmI','content','claude-4.5-haiku','stack','stringify','Resolving\x20agent\x20\x27','\x27...','resolveProjectId','tool','targetKnowledgeBase','2450552DSgjjr','llm','functionName'];a8_0x27f8=function(){return _0x381d1b;};return a8_0x27f8();}function handleSDKError(_0x54f4c7,_0xbc6792){const _0x443755=a8_0x3abd;if(_0x54f4c7 instanceof SDKError)console[_0x443755(0x1a0)](_0x443755(0x1ce)+_0x54f4c7['message']),_0xbc6792[_0x443755(0x1c6)]&&(_0x54f4c7[_0x443755(0x1be)]&&console[_0x443755(0x1a0)]('\x20\x20Cause:\x20'+_0x54f4c7[_0x443755(0x1be)]),_0x54f4c7[_0x443755(0x1a6)]&&(console[_0x443755(0x1a0)](_0x443755(0x1d8)),console['error'](_0x54f4c7['stack'])));else throw _0x54f4c7;}async function resolveAgentId(_0x2ab248,_0xf64e0c,_0x14f6df,_0x4d2952,_0x5b54fd){const _0x50934a=a8_0x3abd,_0x4525d0=_0xf64e0c||_0x14f6df;if(_0x4525d0){const {projectName:_0x44766a,agentName:_0x2c0733}=parseAgentRef(_0x4525d0),_0x2b8daa=_0x2c0733||_0x4525d0,_0x41a2fa=_0x2c0733?_0x44766a:_0x4d2952;if(!_0x41a2fa)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5b54fd){const _0x24328f=_0xf64e0c?_0x50934a(0x1c8):'session\x20context';console['error'](_0x50934a(0x19d)+_0x24328f+':\x20'+_0x41a2fa+'/'+_0x2b8daa);}const _0x943462=await withSpinner(_0x50934a(0x1bd)+_0x41a2fa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x1aa)](_0x41a2fa),{'verbose':_0x5b54fd}),_0x434e87=await withSpinner(_0x50934a(0x1a8)+_0x2b8daa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)]['resolveAgentId'](_0x2b8daa,_0x943462['data']),{'verbose':_0x5b54fd});return _0x434e87[_0x50934a(0x1c2)];}else{const _0x350489=_0x2ab248['llm']['getDefaultAgent']();if(_0x350489)return _0x5b54fd&&console['error'](_0x50934a(0x1bb)+_0x350489[_0x50934a(0x1bc)]),_0x350489['id'];const _0x1dfc18=await withSpinner('Getting\x20default\x20agent...',()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x191)](_0x50934a(0x1a5),0x0),{'verbose':_0x5b54fd});return _0x1dfc18['data']['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x5a85ea(0x1c1);[a8_0x5a85ea(0x1b5)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x4f83b7){const _0x137eaa=a8_0x5a85ea,_0x37cf0a=_0x4f83b7['args'][_0x137eaa(0x1c5)]('\x20');if(!_0x37cf0a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x5a85ea(0x1d2)](_0x2e7edc,_0x2443a7,_0x53eca7,_0x58a158,_0x4dd312){const _0x3d35bc=a8_0x5a85ea;for await(const _0x5f03c of _0x2e7edc[_0x3d35bc(0x1ae)][_0x3d35bc(0x1c1)](_0x2443a7,{'agentId':_0x53eca7,'chatId':_0x58a158})){if(_0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1dc)){const _0x3284a3=_0x5f03c[_0x3d35bc(0x1c2)][_0x3d35bc(0x1d0)];saveLastChatId(_0x3284a3),_0x4dd312&&console[_0x3d35bc(0x1a0)](_0x3d35bc(0x1d7)+_0x3284a3);}else _0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1cc)&&this[_0x3d35bc(0x19f)](_0x5f03c['data']);}}async[a8_0x5a85ea(0x19e)](_0x5079f0,_0x24380e,_0x4d0abc,_0x11d1ac){const _0x29ff13=a8_0x5a85ea,_0x5005f7=_0x5079f0['context'][_0x29ff13(0x1da)];let _0x1183c6=![];for await(const _0x65897 of _0x5079f0['llm'][_0x29ff13(0x1c1)](_0x24380e,{'agentId':_0x4d0abc,'chatId':_0x11d1ac})){if(_0x65897['type']===_0x29ff13(0x1dc)){const _0x52b8ec=_0x65897[_0x29ff13(0x1c2)];saveLastChatId(_0x52b8ec[_0x29ff13(0x1d0)]);const _0x30f470=_0x52b8ec[_0x29ff13(0x1db)]&&_0x52b8ec[_0x29ff13(0x195)]?getLLMConversationUrl(_0x5005f7,_0x52b8ec[_0x29ff13(0x1db)],_0x52b8ec['agentId'],_0x52b8ec[_0x29ff13(0x1d0)]):undefined;console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x52b8ec['chatId'],'agentId':_0x52b8ec[_0x29ff13(0x195)],'consoleUrl':_0x30f470}})),_0x1183c6=!![];}else{if(_0x65897['type']===_0x29ff13(0x1cc)){!_0x1183c6&&_0x11d1ac&&(console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x11d1ac}})),_0x1183c6=!![]);const _0x31fa0f=_0x65897[_0x29ff13(0x1c2)];if(_0x29ff13(0x1a4)in _0x31fa0f)console['log'](JSON[_0x29ff13(0x1a7)]({'type':'content','data':{'content':_0x31fa0f['content']}}));else{if(_0x29ff13(0x19c)in _0x31fa0f){const _0x2ca549=_0x31fa0f[_0x29ff13(0x19c)];console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':'tool_call','data':{'id':_0x2ca549['id'],'name':_0x2ca549[_0x29ff13(0x1af)],'target':_0x2ca549[_0x29ff13(0x1ac)]?.['name']||_0x2ca549['targetAgent']?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1b0)]?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1d3)]}}));}else{if(_0x29ff13(0x1ab)in _0x31fa0f)console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x198),'data':{'id':_0x31fa0f[_0x29ff13(0x1ab)]['id'],'name':_0x31fa0f['tool']['functionName'],'result':typeof _0x31fa0f[_0x29ff13(0x1ab)][_0x29ff13(0x1a4)]===_0x29ff13(0x1b6)?_0x31fa0f['tool'][_0x29ff13(0x1a4)][_0x29ff13(0x192)](0x0,0x1f4):''}}));else'error'in _0x31fa0f&&console['log'](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1a0),'data':{'error':_0x31fa0f[_0x29ff13(0x1a0)]}}));}}}}}console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1b3)}));}async['execute'](_0x4884d5){const _0x397d42=a8_0x5a85ea,{options:_0x574155,args:_0x267264,tdx:_0x468368}=_0x4884d5,_0x467cf1=_0x267264['join']('\x20'),_0x51f6a7=_0x574155,_0x21c0e3=_0x51f6a7[_0x397d42(0x19b)],_0x1fc411=_0x51f6a7[_0x397d42(0x199)],_0x50217=_0x51f6a7[_0x397d42(0x196)],_0x4341b0=_0x51f6a7['new'],_0x805c7a=_0x51f6a7[_0x397d42(0x1d0)],_0x56a5c1=_0x51f6a7['stream'];if(_0x4341b0&&_0x805c7a)return console['error'](_0x397d42(0x1d9)),0x1;try{let _0x8c371,_0x2979c0;if(_0x805c7a)_0x2979c0=_0x805c7a;else!_0x4341b0&&(_0x2979c0=loadLastChatId(),_0x2979c0&&_0x574155[_0x397d42(0x1c6)]&&console['error']('Continuing\x20chat:\x20'+_0x2979c0));!_0x805c7a&&(_0x4341b0||!_0x2979c0)&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose']));const _0x1e1543=_0x56a5c1?(_0x228391,_0x276272,_0x1dae6c)=>this[_0x397d42(0x19e)](_0x468368,_0x228391,_0x276272,_0x1dae6c):(_0x13f02f,_0x11bdbc,_0x4a6864)=>this[_0x397d42(0x1d2)](_0x468368,_0x13f02f,_0x11bdbc,_0x4a6864,_0x574155[_0x397d42(0x1c6)]);try{await _0x1e1543(_0x467cf1,_0x8c371,_0x2979c0);}catch(_0x1ad55d){const _0x273a2a=_0x1ad55d instanceof SDKError&&_0x1ad55d[_0x397d42(0x1b9)]===ErrorCode[_0x397d42(0x1dd)]||_0x1ad55d instanceof Error&&_0x1ad55d[_0x397d42(0x190)][_0x397d42(0x1c4)]('404');if(_0x273a2a&&_0x805c7a)return console[_0x397d42(0x1a0)](_0x397d42(0x1ca)+_0x805c7a+_0x397d42(0x193)),0x1;if(_0x273a2a)_0x574155['verbose']&&console[_0x397d42(0x1a0)](_0x397d42(0x197)),!_0x8c371&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose'])),await _0x1e1543(_0x467cf1,_0x8c371,undefined);else throw _0x1ad55d;}return!_0x56a5c1&&console[_0x397d42(0x194)](),0x0;}catch(_0x55aa1f){return console[_0x397d42(0x1a0)](),handleSDKError(_0x55aa1f,_0x574155),0x1;}}[a8_0x5a85ea(0x19f)](_0x774db1){const _0x243e13=a8_0x5a85ea;if(_0x243e13(0x1a4)in _0x774db1)process[_0x243e13(0x1c0)][_0x243e13(0x1b4)](_0x774db1[_0x243e13(0x1a4)]);else _0x243e13(0x1a0)in _0x774db1&&console['error'](_0x243e13(0x19a)+_0x774db1[_0x243e13(0x1a0)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x5a85ea(0x1bc)]=a8_0x5a85ea(0x1b8);[a8_0x5a85ea(0x1b5)]=a8_0x5a85ea(0x1d5);[a8_0x5a85ea(0x1d4)](_0xf6bf34){const _0x43fb0d=a8_0x5a85ea,_0x1cbdcb=_0xf6bf34[_0x43fb0d(0x1ba)],_0x5ae3b3=_0x1cbdcb[_0x43fb0d(0x19b)],_0x5c8c23=_0x1cbdcb[_0x43fb0d(0x199)];if(!_0x5ae3b3&&!_0x5c8c23)return _0x43fb0d(0x1b7);return undefined;}async[a8_0x5a85ea(0x1d6)](_0x4b33a2){const _0xfe5b72=a8_0x5a85ea,{options:_0x13113b,tdx:_0x853f8c}=_0x4b33a2,_0x59cc04=_0x13113b,_0x4fc9d9=_0x59cc04['agent'],_0x5461dd=_0x59cc04['llmAgent'],_0x17697d=_0x59cc04[_0xfe5b72(0x196)];try{const _0x543d0e=await resolveAgentId(_0x853f8c,_0x4fc9d9,_0x5461dd,_0x17697d,_0x13113b[_0xfe5b72(0x1c6)]),_0x56d29a=await _0x853f8c['llm'][_0xfe5b72(0x1cd)](_0x543d0e);return saveLastChatId(_0x56d29a['id']),console[_0xfe5b72(0x194)](JSON[_0xfe5b72(0x1a7)]({'chatId':_0x56d29a['id'],'agentId':_0x543d0e})),0x0;}catch(_0xd5152e){return handleSDKError(_0xd5152e,_0x13113b),0x1;}}}
|