@treasuredata/tdx 2026.3.33 → 2026.3.34
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/policy-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/work-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/oauth-keychain.js +1 -1
- package/dist/core/oauth.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.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/api.js.map +1 -1
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-api-client.js.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.d.ts.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.d.ts +7 -0
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +1 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-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/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +12 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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.d.ts.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/personalization.js.map +1 -1
- package/dist/sdk/policy.d.ts.map +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/policy.js.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.d.ts.map +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/realtime.js.map +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/segment-validator.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/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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/types/workspace.d.ts +1 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.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/paginate.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/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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/github-releases.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_0x45ea1f=a3_0x53fe;(function(_0x1eb9f9,_0x32fa59){const _0x40f736=a3_0x53fe,_0x49b434=_0x1eb9f9();while(!![]){try{const _0x21dee7=parseInt(_0x40f736(0x16a))/0x1+-parseInt(_0x40f736(0x156))/0x2*(parseInt(_0x40f736(0x172))/0x3)+parseInt(_0x40f736(0x164))/0x4+-parseInt(_0x40f736(0x170))/0x5+-parseInt(_0x40f736(0x169))/0x6*(parseInt(_0x40f736(0x176))/0x7)+-parseInt(_0x40f736(0x174))/0x8+parseInt(_0x40f736(0x160))/0x9*(parseInt(_0x40f736(0x165))/0xa);if(_0x21dee7===_0x32fa59)break;else _0x49b434['push'](_0x49b434['shift']());}catch(_0x5e9269){_0x49b434['push'](_0x49b434['shift']());}}}(a3_0x2ef1,0x695a6));import{BaseCommand}from'./command.js';function a3_0x53fe(_0x2fab64,_0xc5fe36){_0x2fab64=_0x2fab64-0x153;const _0x2ef1c5=a3_0x2ef1();let _0x53fec6=_0x2ef1c5[_0x2fab64];return _0x53fec6;}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_0x2ef1(){const _0x3c29c3=['Resolved\x20child\x20ID:\x20','Child\x20name:\x20','Error:\x20Segment\x20name\x20is\x20required','error','site','length','verbose','Resolving\x20parent\x20segment\x20\x27','6396489yJhHij','Listing\x20activations\x20for\x20segment\x20\x27','cause','resolveSegmentId','1617544lDwZBo','30BlQudf','Site:\x20','✔\x20Found\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','18SwPEZF','93802UDjsUC','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','execute','Parent\x20name:\x20','Resolving\x20child\x20segment\x20\x27','List\x20activations\x20for\x20a\x20segment','4245385BdYFOM','\x27...','15JXNqNi','data','6185824TOjkhP','Resolved\x20parent\x20ID:\x20','759325xqjDmI','segment','name','\x20activation','100438IExbYI','activations'];a3_0x2ef1=function(){return _0x3c29c3;};return a3_0x2ef1();}export class ActivationsCommand extends BaseCommand{[a3_0x45ea1f(0x154)]=a3_0x45ea1f(0x157);['description']=a3_0x45ea1f(0x16f);async[a3_0x45ea1f(0x16c)](_0x35c391){const _0xba276d=a3_0x45ea1f,{options:_0x474ed6,args:_0x209748,tdx:_0x597e34}=_0x35c391;if(_0x209748['length']===0x0)return console[_0xba276d(0x15b)](_0xba276d(0x15a)),console[_0xba276d(0x15b)](_0xba276d(0x168)),0x1;try{const {parentId:_0x4b9891,childId:_0x486e83}=parseSegmentRef(_0x209748[0x0]);if(!_0x486e83)return console[_0xba276d(0x15b)](_0xba276d(0x16b)),console[_0xba276d(0x15b)](_0xba276d(0x168)),0x1;_0x474ed6['verbose']&&(console['error'](_0xba276d(0x166)+_0x474ed6[_0xba276d(0x15c)]),console[_0xba276d(0x15b)](_0xba276d(0x16d)+_0x4b9891),console['error'](_0xba276d(0x159)+_0x486e83));const _0x3b990e=await withSpinner(_0xba276d(0x15f)+_0x4b9891+_0xba276d(0x171),()=>_0x597e34[_0xba276d(0x153)]['resolveParentId'](_0x4b9891),{'verbose':_0x474ed6[_0xba276d(0x15e)]}),_0xaa8249=_0x3b990e[_0xba276d(0x173)];_0x474ed6[_0xba276d(0x15e)]&&console[_0xba276d(0x15b)](_0xba276d(0x175)+_0xaa8249);const _0x251076=await withSpinner(_0xba276d(0x16e)+_0x486e83+_0xba276d(0x171),()=>_0x597e34['segment'][_0xba276d(0x163)](_0xaa8249,_0x486e83),{'verbose':_0x474ed6[_0xba276d(0x15e)]}),_0x19ce4d=_0x251076[_0xba276d(0x173)];_0x474ed6['verbose']&&console['error'](_0xba276d(0x158)+_0x19ce4d);const _0x238274=await withSpinner(_0xba276d(0x161)+_0x486e83+'\x27...',()=>_0x597e34[_0xba276d(0x153)]['listActivations'](_0xaa8249,_0x19ce4d),{'verbose':_0x474ed6[_0xba276d(0x15e)]}),_0x36e76a=_0x238274[_0xba276d(0x173)];return console[_0xba276d(0x15b)](_0xba276d(0x167)+_0x36e76a[_0xba276d(0x15d)]+_0xba276d(0x155)+(_0x36e76a[_0xba276d(0x15d)]!==0x1?'s':'')),await handleSDKOutput(_0x36e76a,_0x474ed6),0x0;}catch(_0x463e3e){if(_0x463e3e instanceof SDKError)return console[_0xba276d(0x15b)]('Error:\x20'+_0x463e3e['message']),_0x463e3e[_0xba276d(0x162)]&&console[_0xba276d(0x15b)]('\x20\x20Cause:\x20'+_0x463e3e[_0xba276d(0x162)]),0x1;throw _0x463e3e;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x510263=a4_0x1a6c;(function(_0x1f5499,_0x31da62){const _0x457bb9=a4_0x1a6c,_0x57cf1b=_0x1f5499();while(!![]){try{const _0x264ed3=-parseInt(_0x457bb9(0x189))/0x1+parseInt(_0x457bb9(0x14e))/0x2*(-parseInt(_0x457bb9(0x181))/0x3)+-parseInt(_0x457bb9(0x168))/0x4*(parseInt(_0x457bb9(0x167))/0x5)+parseInt(_0x457bb9(0x1b9))/0x6+-parseInt(_0x457bb9(0x1ce))/0x7+-parseInt(_0x457bb9(0x154))/0x8+parseInt(_0x457bb9(0x1ab))/0x9;if(_0x264ed3===_0x31da62)break;else _0x57cf1b['push'](_0x57cf1b['shift']());}catch(_0x36d1bc){_0x57cf1b['push'](_0x57cf1b['shift']());}}}(a4_0xa958,0x357f6));import a4_0x445426 from'chalk';import a4_0x136a8c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x1a6c(_0x129725,_0x4aba77){_0x129725=_0x129725-0x148;const _0xa958cb=a4_0xa958();let _0x1a6cee=_0xa958cb[_0x129725];return _0x1a6cee;}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(_0x446a82){const _0x4219ec=a4_0x1a6c,_0x4e2921=[];if(_0x446a82['total']!==undefined)_0x4e2921[_0x4219ec(0x180)](_0x446a82[_0x4219ec(0x1c2)]+_0x4219ec(0x156));if(_0x446a82[_0x4219ec(0x1af)]!==undefined&&_0x446a82[_0x4219ec(0x1af)]>0x0)_0x4e2921[_0x4219ec(0x180)](a4_0x445426[_0x4219ec(0x179)](_0x446a82[_0x4219ec(0x1af)]+_0x4219ec(0x18e)));if(_0x446a82[_0x4219ec(0x174)]!==undefined&&_0x446a82['created']>0x0)_0x4e2921['push'](a4_0x445426['green'](_0x446a82['created']+_0x4219ec(0x195)));if(_0x446a82[_0x4219ec(0x18d)]!==undefined&&_0x446a82[_0x4219ec(0x18d)]>0x0)_0x4e2921[_0x4219ec(0x180)](a4_0x445426[_0x4219ec(0x1e5)](_0x446a82[_0x4219ec(0x18d)]+_0x4219ec(0x1f0)));if(_0x446a82['unchanged']!==undefined&&_0x446a82['unchanged']>0x0)_0x4e2921['push'](a4_0x445426['gray'](_0x446a82[_0x4219ec(0x15a)]+_0x4219ec(0x1b2)));if(_0x446a82[_0x4219ec(0x18f)]!==undefined&&_0x446a82[_0x4219ec(0x18f)]>0x0)_0x4e2921[_0x4219ec(0x180)](a4_0x445426[_0x4219ec(0x15e)](_0x446a82[_0x4219ec(0x18f)]+_0x4219ec(0x1a7)));return _0x4e2921[_0x4219ec(0x1a5)](',\x20');}function displayDiffs(_0x48d9b1,_0xf26a66,_0x26a3dc,_0x42282b,_0x3c7b29,_0x1e2f3b,_0x11138a){const _0x7baeea=a4_0x1a6c;for(const _0x9afd4 of _0x48d9b1){if(_0x9afd4[_0x7baeea(0x159)]){const _0x3c67bb=_0x9afd4[_0x7baeea(0x1f5)]||_0x9afd4[_0x7baeea(0x1e1)];console[_0x7baeea(0x1a1)](_0x7baeea(0x166)+_0x3c67bb+'\x27:'),console[_0x7baeea(0x1a1)]('─'['repeat'](0x3c)),console['log'](_0x9afd4[_0x7baeea(0x159)]),console[_0x7baeea(0x1a1)]('─'['repeat'](0x3c));}}for(const _0x47eb98 of _0xf26a66){_0x47eb98[_0x7baeea(0x159)]&&(console['log'](_0x7baeea(0x188)+_0x47eb98['name']+'\x27:'),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x47eb98[_0x7baeea(0x159)]),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x2741c5 of _0x26a3dc){_0x2741c5[_0x7baeea(0x159)]&&(console['log'](_0x7baeea(0x1d8)+_0x2741c5['name']+'\x27:'),console['log']('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x2741c5[_0x7baeea(0x159)]),console['log']('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x40586f of _0x42282b){_0x40586f[_0x7baeea(0x159)]&&(console[_0x7baeea(0x1a1)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x40586f['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x7baeea(0x1a1)](_0x40586f[_0x7baeea(0x159)]),console['log']('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x472d86 of _0x3c7b29){_0x472d86['diff']&&(console[_0x7baeea(0x1a1)](_0x7baeea(0x14d)+_0x472d86['name']+'\x27:'),console['log']('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x472d86[_0x7baeea(0x159)]),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x5be350 of _0x1e2f3b){_0x5be350[_0x7baeea(0x159)]&&(console[_0x7baeea(0x1a1)](_0x7baeea(0x1ef)+_0x5be350[_0x7baeea(0x1e1)]+'\x27:'),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x5be350['diff']),console[_0x7baeea(0x1a1)]('─'['repeat'](0x3c)));}for(const _0x3c5652 of _0x11138a){_0x3c5652[_0x7baeea(0x159)]&&(console[_0x7baeea(0x1a1)](_0x7baeea(0x191)+_0x3c5652[_0x7baeea(0x1e1)]+'\x27:'),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)),console['log'](_0x3c5652[_0x7baeea(0x159)]),console['log']('─'[_0x7baeea(0x187)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x510263(0x1e1)]=a4_0x510263(0x1c0);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x510263(0x182)](_0x335a57){const _0x3dc69d=a4_0x510263,{options:_0x2ba470,args:_0x1c701e,tdx:_0x3aa443}=_0x335a57,_0xcbdd02=_0x1c701e[0x0],_0x388abd=_0x1c701e[0x1],_0x184959=_0x2ba470['output'],_0x1c46f1=_0x2ba470[_0x3dc69d(0x1e6)],_0x2cd582=_0x2ba470['force'],_0x344dfe=_0x2ba470[_0x3dc69d(0x1d5)],_0x56f7fe=_0x2ba470[_0x3dc69d(0x17a)],_0x2012e2=_0x2ba470[_0x3dc69d(0x158)];let _0x4980d8;if(_0xcbdd02){const _0x4100d0=a4_0x136a8c[_0x3dc69d(0x1a5)](_0xcbdd02,'tdx.json');if(existsSync(_0x4100d0))try{const _0x979f79=JSON['parse'](readFileSync(_0x4100d0,_0x3dc69d(0x186)));_0x979f79[_0x3dc69d(0x1de)]&&(_0x4980d8={'llm_project':_0x979f79[_0x3dc69d(0x1de)]});}catch{}}const _0x43238f=findAgentConfigPath(process[_0x3dc69d(0x169)]());let _0x1e3ccf;if(_0x43238f)try{const _0x3cdcd0=JSON['parse'](readFileSync(_0x43238f,'utf-8'));_0x3cdcd0[_0x3dc69d(0x1de)]&&(_0x1e3ccf={'llm_project':_0x3cdcd0[_0x3dc69d(0x1de)]});}catch{}const _0x20a341=resolveAgentPullArgs({'arg':_0xcbdd02,'agentNameArg':_0x388abd,'agentFlag':_0x2012e2,'contextProject':_0x56f7fe,'argDirConfig':_0x4980d8,'cwdConfigPath':_0x43238f||undefined,'cwdConfig':_0x1e3ccf}),{projectNameOrId:_0x38c312,targetAgentName:_0x432c7c,existingOutputDir:_0x69bd11,source:_0x2d1950}=_0x20a341;if(_0x2d1950==='arg-dir')console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x1d2)+a4_0x136a8c[_0x3dc69d(0x1a5)](_0xcbdd02,_0x3dc69d(0x1a9))+':\x20'+_0x38c312));else{if(_0x2d1950===_0x3dc69d(0x17c))console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x170)+_0x38c312));else _0x2d1950===_0x3dc69d(0x1ac)&&console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x150)+_0x38c312));}if(!_0x38c312)return _0x2012e2?(console['log'](a4_0x445426[_0x3dc69d(0x1e5)](_0x3dc69d(0x1bf))),console['log'](_0x3dc69d(0x16d)),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x184))):(console['log'](a4_0x445426['yellow'](_0x3dc69d(0x18b))),console[_0x3dc69d(0x1a1)]('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[_0x3dc69d(0x1a1)]('\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'),console[_0x3dc69d(0x1a1)]('\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'),console[_0x3dc69d(0x1a1)]('\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[_0x3dc69d(0x1a1)]('\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')),0x1;if(_0x432c7c){const {data:_0x181f22}=await withSpinner('Pulling\x20agent\x20\x22'+_0x432c7c+_0x3dc69d(0x19e)+_0x38c312+_0x3dc69d(0x18c),()=>_0x3aa443[_0x3dc69d(0x1cf)]['pullAgent'](_0x38c312,_0x432c7c,_0x184959,{'dryRun':_0x1c46f1,'force':_0x2cd582}));if(_0x1c46f1)return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1e5)](_0x3dc69d(0x17b))),console['log'](_0x3dc69d(0x17d)+_0x181f22[_0x3dc69d(0x1f5)]),console['log']('Output\x20path:\x20'+_0x181f22[_0x3dc69d(0x1e7)]),_0x181f22[_0x3dc69d(0x159)]&&(console['log'](_0x3dc69d(0x194)),console[_0x3dc69d(0x1a1)]('─'[_0x3dc69d(0x187)](0x3c)),console['log'](_0x181f22[_0x3dc69d(0x159)]),console[_0x3dc69d(0x1a1)]('─'[_0x3dc69d(0x187)](0x3c))),0x0;return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x179)]('Agent\x20pulled\x20successfully')),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x15d)+_0x181f22[_0x3dc69d(0x1f5)]),console[_0x3dc69d(0x1a1)]('Output:\x20'+_0x181f22[_0x3dc69d(0x1e7)]),console['log']('Status:\x20'+(_0x181f22[_0x3dc69d(0x1a6)]?a4_0x445426[_0x3dc69d(0x179)](_0x3dc69d(0x1af)):_0x181f22[_0x3dc69d(0x1d0)]?a4_0x445426['yellow']('updated'):a4_0x445426[_0x3dc69d(0x1d9)]('unchanged'))),0x0;}const _0x3f00dc=_0x69bd11||_0x184959,{data:_0x289515}=await withSpinner('Analyzing\x20project\x20\x22'+_0x38c312+_0x3dc69d(0x18c),()=>_0x3aa443[_0x3dc69d(0x1cf)][_0x3dc69d(0x173)](_0x38c312,_0x3f00dc,{'dryRun':!![]})),_0x385175=_0x289515['counts'][_0x3dc69d(0x177)]['new']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x149)][_0x3dc69d(0x1af)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1c7)]['new']+_0x289515['counts'][_0x3dc69d(0x1bc)]['new']+_0x289515['counts']['integrations'][_0x3dc69d(0x1af)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x151)][_0x3dc69d(0x1af)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x196)]['new'],_0x11fed4=_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x177)]['updated']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x149)][_0x3dc69d(0x18d)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1c7)][_0x3dc69d(0x18d)]+_0x289515['counts'][_0x3dc69d(0x1bc)]['updated']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1da)][_0x3dc69d(0x18d)]+_0x289515['counts']['experimentalKnowledgeBases'][_0x3dc69d(0x18d)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x196)][_0x3dc69d(0x18d)],_0x314105=_0x289515['counts'][_0x3dc69d(0x177)]['unchanged']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x149)][_0x3dc69d(0x15a)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1c7)][_0x3dc69d(0x15a)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1bc)]['unchanged']+_0x289515['counts']['integrations']['unchanged']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x151)][_0x3dc69d(0x15a)]+_0x289515[_0x3dc69d(0x19a)]['experimentalArtifacts']['unchanged'];console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1db)+_0x289515[_0x3dc69d(0x19f)]+'\x27:'),console['log']('\x20\x20'+a4_0x445426['green']('+\x20'+_0x385175+_0x3dc69d(0x18e))+_0x3dc69d(0x176)+a4_0x445426[_0x3dc69d(0x1e5)]('~\x20'+_0x11fed4+_0x3dc69d(0x1d4))+_0x3dc69d(0x176)+a4_0x445426[_0x3dc69d(0x1c6)]('=\x20'+_0x314105+_0x3dc69d(0x1b2))),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x164)+formatCountSummary(_0x289515['counts'][_0x3dc69d(0x177)])),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1b5)+formatCountSummary(_0x289515['counts'][_0x3dc69d(0x149)])),console[_0x3dc69d(0x1a1)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x289515[_0x3dc69d(0x19a)]['textKnowledgeBases'])),console[_0x3dc69d(0x1a1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x289515['counts']['prompts'])),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1e0)+formatCountSummary(_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1da)]));const _0x533c70=_0x289515['counts'][_0x3dc69d(0x151)][_0x3dc69d(0x1c2)]>0x0||_0x289515['counts']['experimentalArtifacts'][_0x3dc69d(0x1c2)]>0x0;_0x533c70&&(console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1ed)+formatCountSummary(_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x151)])),console[_0x3dc69d(0x1a1)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x196)])));console[_0x3dc69d(0x1a1)]('\x20\x20Target:\x20'+a4_0x445426['cyan'](_0x289515[_0x3dc69d(0x16c)])),displayDiffs(_0x289515[_0x3dc69d(0x177)],_0x289515[_0x3dc69d(0x149)],_0x289515[_0x3dc69d(0x1c7)],_0x289515[_0x3dc69d(0x1bc)],_0x289515['integrations'],_0x289515[_0x3dc69d(0x151)],_0x289515[_0x3dc69d(0x196)]);if(_0x1c46f1)return console['log'](a4_0x445426[_0x3dc69d(0x1e5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x385175===0x0&&_0x11fed4===0x0)return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x179)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x289515[_0x3dc69d(0x19f)]},_0x2ba470[_0x3dc69d(0x1e4)]),console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x179)](_0x3dc69d(0x1ae)+a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x1de))+_0x3dc69d(0x1dd)+a4_0x445426[_0x3dc69d(0x14a)](_0x289515['projectName']))),0x0;if(!_0x344dfe&&!_0x2cd582){if(!isInteractive())return console[_0x3dc69d(0x163)](a4_0x445426['red'](_0x3dc69d(0x153)),_0x3dc69d(0x175)),console[_0x3dc69d(0x163)](a4_0x445426[_0x3dc69d(0x1c6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2db189=await confirmKey('\x0aWrite\x20'+(_0x385175+_0x11fed4)+_0x3dc69d(0x1c8));if(!_0x2db189)return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1e5)](_0x3dc69d(0x199)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x5ca0f1}=await withSpinner(_0x3dc69d(0x1e8),()=>_0x3aa443[_0x3dc69d(0x1cf)]['pullProject'](_0x38c312,_0x3f00dc,{'force':_0x2cd582}));return console[_0x3dc69d(0x1a1)](a4_0x445426['green']('\x0a✔\x20Pulled\x20'+(_0x385175+_0x11fed4)+'\x20files\x20to\x20'+_0x5ca0f1[_0x3dc69d(0x16c)])),saveSessionContext({'llm_project':_0x5ca0f1[_0x3dc69d(0x19f)]},_0x2ba470[_0x3dc69d(0x1e4)]),console[_0x3dc69d(0x1a1)](a4_0x445426['green'](_0x3dc69d(0x1ae)+a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x1de))+_0x3dc69d(0x1dd)+a4_0x445426[_0x3dc69d(0x14a)](_0x5ca0f1[_0x3dc69d(0x19f)]))),0x0;}}function a4_0xa958(){const _0x57b688=['reason','agentName','description','\x22\x20to\x20new\x20project\x20\x22','knowledgeBases','cyan','projectId','\x20\x20Source:\x20','\x0aChanges\x20to\x20integration\x20\x27','122HaOoeE','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Using\x20project\x20from\x20context:\x20','experimentalKnowledgeBases','newProjectId','\x0aError:','278568uIKIiK','\x20--profile\x20','\x20total','\x20resources\x20to\x20\x27','agent','diff','unchanged','\x20\x20Integration\x20\x22','No\x20tdx.json\x20found\x20in\x20','Agent:\x20','red','\x27\x20to\x20create\x20the\x20folder\x20structure.','agent:clone','no_local_folder','found','error','\x20\x20Agents:\x20','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20agent\x20\x27','2990ePwMnV','1856ChnZqO','cwd','\x22\x20to\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','outputDir','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20resources?','\x0aPush\x20summary\x20for\x20\x27','Using\x20project:\x20','newProjectName','Errors:','pullProject','created','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20|\x20','agents','action','green','llmProject','Dry\x20run\x20-\x20no\x20files\x20written','cwd-config','Would\x20pull\x20agent:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','<new-name>','push','16662gSbysG','execute','Source:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','message','utf-8','repeat','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','436638CvLgml','INVALID_ARGUMENT','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22...','updated','\x20new','errors','agentId','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Cloning\x20\x22','\x0aChanges:','\x20created','experimentalArtifacts','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Using\x20current\x20project:\x20','Cancelled','counts','Using\x20local\x20project:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20Pushed\x20','\x22\x20from\x20project\x20\x22','projectName','Would\x20clone:','log','\x0aProject\x20pushed\x20with\x20errors','Using\x20context\x20project:\x20','Pushing\x20to\x20project...','join','isNew','\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','tdx.json','source','9467973IHwSKW','context','\x20successfully','✔\x20Context\x20set:\x20','new','force','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','pushProject','\x20--name\x20','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20Prompts:\x20','New\x20project:\x20','2062590bnsGPb','agent:push','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','prompts','Project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','agent:pull','\x20\x20tdx\x20agent\x20pull\x20','total','MISSING_ARGUMENT','Project\x20cloned\x20with\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','dim','textKnowledgeBases','\x20files?','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aPush\x20','Failed\x20to\x20push\x20agent:\x20','agent.yml','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','622377bMnFwF','llm','hasChanges','projectDir','Using\x20project\x20from\x20','Chat:\x20','\x20changed','yes','sourceProjectName','site','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','gray','integrations','\x0aPull\x20summary\x20for\x20\x27','\x22:\x20','\x20=\x20','llm_project','\x20\x20Agent\x20\x22','\x20\x20Integrations:\x20','name','Analyzing\x20changes\x20to\x20push...','cloneProject','session','yellow','dryRun','outputPath','Writing\x20files...','Would\x20push\x20agent:\x20','-\x20nothing\x20pushed','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aErrors\x20found:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20updated','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Prompt\x20\x22'];a4_0xa958=function(){return _0x57b688;};return a4_0xa958();}export class AgentCloneCommand extends BaseCommand{[a4_0x510263(0x1e1)]=a4_0x510263(0x160);['description']=a4_0x510263(0x19c);async[a4_0x510263(0x182)](_0x16d846){const _0x2acfae=a4_0x510263,{options:_0x1a623b,args:_0x25e6ce,tdx:_0x20dfc7}=_0x16d846,_0x1497c7=_0x25e6ce[0x0],_0x241c54=_0x1a623b['name'],_0x9b8871=_0x1a623b[_0x2acfae(0x1e6)],_0x3783a1=_0x1a623b[_0x2acfae(0x1d5)],_0x3ef4e9=_0x1a623b[_0x2acfae(0x1d7)],_0x3a8c90=_0x1a623b[_0x2acfae(0x17a)];let _0x15eced;const _0x2ffb01=findAgentConfigPath(process[_0x2acfae(0x169)]());if(_0x1497c7){const _0x12ca12=a4_0x136a8c[_0x2acfae(0x1a5)](_0x1497c7,'tdx.json');existsSync(_0x12ca12)?(_0x15eced=_0x1497c7,console[_0x2acfae(0x1a1)](a4_0x445426['dim'](_0x2acfae(0x19b)+_0x1497c7))):_0x15eced=_0x1497c7;}else{if(_0x2ffb01)_0x15eced=a4_0x136a8c['dirname'](_0x2ffb01),console[_0x2acfae(0x1a1)](a4_0x445426['dim'](_0x2acfae(0x198)+_0x15eced));else{if(_0x3a8c90){const _0x5c2e91=sanitizeForFilesystem(_0x3a8c90);let _0x45f7f8=_0x5c2e91,_0x392b69=a4_0x136a8c[_0x2acfae(0x1a5)](process['cwd'](),'agents',_0x5c2e91,_0x2acfae(0x1a9));if(!existsSync(_0x392b69)){const _0x300448=normalizeName(_0x3a8c90),_0x1bc4ad=a4_0x136a8c[_0x2acfae(0x1a5)](process[_0x2acfae(0x169)](),_0x2acfae(0x177),_0x300448,_0x2acfae(0x1a9));existsSync(_0x1bc4ad)&&(_0x45f7f8=_0x300448,_0x392b69=_0x1bc4ad);}if(existsSync(_0x392b69))_0x15eced=a4_0x136a8c['dirname'](_0x392b69),console[_0x2acfae(0x1a1)](a4_0x445426['dim'](_0x2acfae(0x19b)+_0x15eced));else{const _0x463435=_0x1a623b['profile'];if(_0x463435)throw new SDKError(ErrorCode[_0x2acfae(0x18a)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3a8c90+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2acfae(0x1ee)+_0x2acfae(0x192)+(_0x2acfae(0x1c1)+_0x3a8c90+'\x0a')+(_0x2acfae(0x1a8)+_0x45f7f8+_0x2acfae(0x1b4)+(_0x241c54||_0x2acfae(0x17f))+_0x2acfae(0x155)+_0x463435)});_0x15eced=_0x3a8c90,console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1c6)](_0x2acfae(0x1a3)+_0x3a8c90));}}}}if(!_0x15eced)return console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1e5)](_0x2acfae(0x197))),console['log'](_0x2acfae(0x1bb)),console['log'](_0x2acfae(0x14f)),console[_0x2acfae(0x1a1)]('\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[_0x2acfae(0x1a1)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x241c54)throw new SDKError(ErrorCode[_0x2acfae(0x1c3)],_0x2acfae(0x165),undefined,{'helpText':_0x2acfae(0x1be)});if(!_0x3783a1&&!_0x9b8871){if(!isInteractive())return console[_0x2acfae(0x163)](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x153)),_0x2acfae(0x175)),console[_0x2acfae(0x163)](a4_0x445426[_0x2acfae(0x1c6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2e6349=await confirmKey('Clone\x20\x22'+_0x15eced+_0x2acfae(0x148)+_0x241c54+'\x22?');if(!_0x2e6349)return console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1e5)](_0x2acfae(0x199))),0x1;}const {data:_0xe60f99}=await withSpinner(_0x2acfae(0x193)+_0x15eced+_0x2acfae(0x16a)+_0x241c54+_0x2acfae(0x18c),()=>_0x20dfc7[_0x2acfae(0x1cf)][_0x2acfae(0x1e3)](_0x15eced,_0x241c54,{'dryRun':_0x9b8871}));if(_0x9b8871){console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1e5)](_0x2acfae(0x1b1))),console[_0x2acfae(0x1a1)](_0x2acfae(0x183)+_0xe60f99[_0x2acfae(0x1d6)]),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b8)+_0x241c54),console['log'](_0x2acfae(0x1a0)),console[_0x2acfae(0x1a1)](_0x2acfae(0x164)+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x177)][_0x2acfae(0x174)]),console[_0x2acfae(0x1a1)]('\x20\x20Knowledge\x20Bases:\x20'+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x149)]['created']),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b7)+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x1bc)]['created']);const _0x1c7863=_0xe60f99['counts'][_0x2acfae(0x151)]['created']>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x196)][_0x2acfae(0x174)]>0x0;return _0x1c7863&&(console[_0x2acfae(0x1a1)](_0x2acfae(0x1ed)+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x174)]),console['log'](_0x2acfae(0x16b)+_0xe60f99['counts'][_0x2acfae(0x196)]['created'])),0x0;}const _0xa1948b=_0xe60f99['counts']['agents'][_0x2acfae(0x18f)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x149)]['errors']>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x1bc)][_0x2acfae(0x18f)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x18f)]>0x0||_0xe60f99['counts']['experimentalArtifacts'][_0x2acfae(0x18f)]>0x0;_0xa1948b?console[_0x2acfae(0x1a1)](a4_0x445426['yellow'](_0x2acfae(0x1c4))):console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x179)]('Project\x20cloned\x20successfully'));console[_0x2acfae(0x1a1)](_0x2acfae(0x183)+_0xe60f99[_0x2acfae(0x1d6)]),console['log'](_0x2acfae(0x1b8)+_0xe60f99[_0x2acfae(0x171)]),console[_0x2acfae(0x1a1)]('New\x20project\x20ID:\x20'+_0xe60f99['newProjectId']),console[_0x2acfae(0x1a1)](),console['log']('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)]['agents'])),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b5)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x149)])),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b7)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x1bc)])),console['log'](_0x2acfae(0x1e0)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)]['integrations']));const _0x1cb136=_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)]['created']>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x18d)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x15a)]>0x0||_0xe60f99[_0x2acfae(0x19a)]['experimentalArtifacts']['created']>0x0||_0xe60f99[_0x2acfae(0x19a)]['experimentalArtifacts'][_0x2acfae(0x18d)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x196)][_0x2acfae(0x15a)]>0x0;_0x1cb136&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xe60f99['counts'][_0x2acfae(0x151)])),console[_0x2acfae(0x1a1)](_0x2acfae(0x16b)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x196)])));if(_0xa1948b){console[_0x2acfae(0x1a1)](),console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x172)));for(const _0x518f87 of _0xe60f99['agents']){_0x518f87[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x1df)+_0x518f87[_0x2acfae(0x1f5)]+'\x22:\x20'+_0x518f87['error']));}for(const _0x5b8357 of _0xe60f99[_0x2acfae(0x149)]){_0x5b8357[_0x2acfae(0x178)]==='error'&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x5b8357[_0x2acfae(0x1e1)]+'\x22:\x20'+_0x5b8357[_0x2acfae(0x163)]));}for(const _0xb68eea of _0xe60f99['prompts']){_0xb68eea[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console['log'](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x1f3)+_0xb68eea[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0xb68eea[_0x2acfae(0x163)]));}for(const _0x4e2ab4 of _0xe60f99[_0x2acfae(0x1da)]){_0x4e2ab4[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Integration\x20\x22'+_0x4e2ab4[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0x4e2ab4[_0x2acfae(0x163)]));}for(const _0x412ba7 of _0xe60f99[_0x2acfae(0x151)]){_0x412ba7[_0x2acfae(0x178)]==='error'&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x412ba7[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0x412ba7[_0x2acfae(0x163)]));}for(const _0x3f8788 of _0xe60f99[_0x2acfae(0x196)]){_0x3f8788[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3f8788[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0x3f8788[_0x2acfae(0x163)]));}return 0x1;}console[_0x2acfae(0x1a1)]();const _0x56e50b=getLLMProjectUrl(_0x3ef4e9,_0xe60f99[_0x2acfae(0x152)]);return console[_0x2acfae(0x1a1)](_0x2acfae(0x1bd)+a4_0x445426[_0x2acfae(0x14a)](_0x56e50b)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x510263(0x1ba);[a4_0x510263(0x1f6)]=a4_0x510263(0x17e);async['execute'](_0x25a94f){const _0x450c62=a4_0x510263,{options:_0x554009,args:_0x1f8062,tdx:_0x41be47}=_0x25a94f;let _0x3ab062=_0x1f8062[0x0]||process[_0x450c62(0x169)]();const _0x1acde6=_0x554009[_0x450c62(0x1e6)],_0x30da85=_0x554009[_0x450c62(0x1b0)],_0x1c0577=_0x554009[_0x450c62(0x1d5)],_0x341779=_0x554009['site'],_0x575273=a4_0x136a8c['join'](_0x3ab062,_0x450c62(0x1cc)),_0x3a2a7e=existsSync(_0x575273);if(_0x3a2a7e){const {data:_0xf7972a}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x3ab062+_0x450c62(0x18c),()=>_0x41be47[_0x450c62(0x1cf)]['pushAgent'](_0x3ab062,{'dryRun':_0x1acde6,'force':_0x30da85}));if(_0x1acde6)return console[_0x450c62(0x1a1)](a4_0x445426['yellow'](_0x450c62(0x1b1))),console['log'](_0x450c62(0x1e9)+_0xf7972a['agentName']),0x0;if(_0xf7972a[_0x450c62(0x178)]===_0x450c62(0x163))return console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1cb)+_0xf7972a[_0x450c62(0x163)])),0x1;console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x179)]('Agent\x20'+_0xf7972a[_0x450c62(0x178)]+_0x450c62(0x1ad))),console[_0x450c62(0x1a1)]('Agent:\x20'+_0xf7972a[_0x450c62(0x1f5)]);if(_0xf7972a[_0x450c62(0x190)]&&_0xf7972a[_0x450c62(0x14b)]){const _0x1159a1=getLLMAgentChatUrl(_0x341779,_0xf7972a[_0x450c62(0x14b)],_0xf7972a[_0x450c62(0x190)]);console[_0x450c62(0x1a1)](_0x450c62(0x1d3)+a4_0x445426['cyan'](_0x1159a1));}return 0x0;}const _0x4b4c01=_0x554009[_0x450c62(0x17a)],_0x5d1bd9=resolveProjectFromContext(_0x3ab062,_0x4b4c01);if(_0x5d1bd9[_0x450c62(0x162)])_0x3ab062=_0x5d1bd9[_0x450c62(0x1d1)],_0x5d1bd9[_0x450c62(0x1aa)]===_0x450c62(0x1ac)&&console['log'](a4_0x445426[_0x450c62(0x1c6)](_0x450c62(0x170)+_0x3ab062));else{let _0xc77612=_0x450c62(0x1eb);_0x5d1bd9[_0x450c62(0x1f4)]===_0x450c62(0x161)&&(_0xc77612=_0x5d1bd9[_0x450c62(0x185)]+_0x450c62(0x1cd)+_0x5d1bd9[_0x450c62(0x17a)]+_0x450c62(0x15f));throw new SDKError(ErrorCode[_0x450c62(0x18a)],_0x5d1bd9[_0x450c62(0x1f4)]==='no_context'?_0x5d1bd9[_0x450c62(0x185)]:_0x450c62(0x15c)+_0x3ab062,undefined,{'helpText':_0xc77612});}const {data:_0x5ca7f0}=await withSpinner(_0x450c62(0x1e2),()=>_0x41be47[_0x450c62(0x1cf)][_0x450c62(0x1b3)](_0x3ab062,{'dryRun':!![]})),_0x357404=_0x5ca7f0['counts'][_0x450c62(0x177)][_0x450c62(0x18f)]>0x0;if(_0x357404){console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1ec)));for(const _0x7e054f of _0x5ca7f0[_0x450c62(0x177)]){_0x7e054f['action']===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1df)+_0x7e054f[_0x450c62(0x1f5)]+_0x450c62(0x1dc)+_0x7e054f[_0x450c62(0x163)]));}return 0x1;}const _0x1d2ae3=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)]['knowledgeBases']['created']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)]['prompts'][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)]['integrations']['created']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x151)][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x174)],_0x545f19=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)]['updated']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x149)][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1bc)]['updated']+_0x5ca7f0['counts'][_0x450c62(0x1da)][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)]['experimentalKnowledgeBases'][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x18d)],_0x2d3f5e=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)]['unchanged']+_0x5ca7f0['counts'][_0x450c62(0x149)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x15a)]+_0x5ca7f0['counts'][_0x450c62(0x1bc)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1da)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x151)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x15a)];console[_0x450c62(0x1a1)](_0x450c62(0x16f)+_0x5ca7f0['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x445426[_0x450c62(0x179)]('+\x20'+_0x1d2ae3+_0x450c62(0x18e))+_0x450c62(0x176)+a4_0x445426[_0x450c62(0x1e5)]('~\x20'+_0x545f19+_0x450c62(0x1d4))+'\x20|\x20'+a4_0x445426[_0x450c62(0x1c6)]('=\x20'+_0x2d3f5e+'\x20unchanged')),console[_0x450c62(0x1a1)](_0x450c62(0x164)+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)])),console[_0x450c62(0x1a1)](_0x450c62(0x1b5)+formatCountSummary(_0x5ca7f0['counts'][_0x450c62(0x149)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)])),console[_0x450c62(0x1a1)](_0x450c62(0x1b7)+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1bc)])),console[_0x450c62(0x1a1)](_0x450c62(0x1e0)+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1da)]));const _0x2a2d0c=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x151)][_0x450c62(0x174)]>0x0||_0x5ca7f0[_0x450c62(0x19a)]['experimentalKnowledgeBases']['updated']>0x0||_0x5ca7f0[_0x450c62(0x19a)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x174)]>0x0||_0x5ca7f0['counts']['experimentalArtifacts']['updated']>0x0||_0x5ca7f0['counts']['experimentalArtifacts']['unchanged']>0x0;_0x2a2d0c&&(console[_0x450c62(0x1a1)](_0x450c62(0x1ed)+formatCountSummary(_0x5ca7f0['counts']['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)])));console[_0x450c62(0x1a1)](_0x450c62(0x14c)+a4_0x445426['cyan'](_0x3ab062)),displayDiffs(_0x5ca7f0[_0x450c62(0x177)],_0x5ca7f0[_0x450c62(0x149)],_0x5ca7f0['textKnowledgeBases'],_0x5ca7f0['prompts'],_0x5ca7f0['integrations'],_0x5ca7f0[_0x450c62(0x151)],_0x5ca7f0[_0x450c62(0x196)]);if(_0x1acde6)return console['log'](a4_0x445426[_0x450c62(0x1e5)](_0x450c62(0x1c9))),0x0;if(_0x1d2ae3===0x0&&_0x545f19===0x0){console[_0x450c62(0x1a1)](a4_0x445426['green'](_0x450c62(0x1c5)));const _0x320fdc=getLLMProjectUrl(_0x341779,_0x5ca7f0[_0x450c62(0x14b)]);return console[_0x450c62(0x1a1)](_0x450c62(0x1bd)+a4_0x445426[_0x450c62(0x14a)](_0x320fdc)),0x0;}if(!_0x1c0577&&!_0x30da85){if(!isInteractive())return console[_0x450c62(0x163)](a4_0x445426['red'](_0x450c62(0x153)),_0x450c62(0x175)),console['error'](a4_0x445426['dim'](_0x450c62(0x1f1))),0x1;const _0x135b07=await confirmKey(_0x450c62(0x1ca)+(_0x1d2ae3+_0x545f19)+_0x450c62(0x16e));if(!_0x135b07)return console['log'](a4_0x445426[_0x450c62(0x1e5)]('Cancelled'),_0x450c62(0x1ea)),0x1;}const {data:_0x236a53}=await withSpinner(_0x450c62(0x1a4),()=>_0x41be47[_0x450c62(0x1cf)][_0x450c62(0x1b3)](_0x3ab062,{'force':_0x30da85})),_0x2bb048=_0x236a53[_0x450c62(0x19a)][_0x450c62(0x177)][_0x450c62(0x18f)]>0x0||_0x236a53[_0x450c62(0x19a)][_0x450c62(0x149)][_0x450c62(0x18f)]>0x0||_0x236a53[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x18f)]>0x0||_0x236a53[_0x450c62(0x19a)][_0x450c62(0x1bc)][_0x450c62(0x18f)]>0x0;if(_0x2bb048){console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x1e5)](_0x450c62(0x1a2))),console[_0x450c62(0x1a1)](),console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x172)));for(const _0x2e41a5 of _0x236a53['agents']){_0x2e41a5[_0x450c62(0x178)]===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426['red'](_0x450c62(0x1df)+_0x2e41a5[_0x450c62(0x1f5)]+_0x450c62(0x1dc)+_0x2e41a5[_0x450c62(0x163)]));}for(const _0x42fb3d of _0x236a53['knowledgeBases']){_0x42fb3d[_0x450c62(0x178)]===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1b6)+_0x42fb3d['name']+_0x450c62(0x1dc)+_0x42fb3d['error']));}for(const _0x487e78 of _0x236a53[_0x450c62(0x1c7)]){_0x487e78[_0x450c62(0x178)]===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1f2)+_0x487e78['name']+'\x22:\x20'+_0x487e78[_0x450c62(0x163)]));}for(const _0x22b2ab of _0x236a53[_0x450c62(0x1bc)]){_0x22b2ab[_0x450c62(0x178)]===_0x450c62(0x163)&&console['log'](a4_0x445426['red'](_0x450c62(0x1f3)+_0x22b2ab[_0x450c62(0x1e1)]+_0x450c62(0x1dc)+_0x22b2ab[_0x450c62(0x163)]));}for(const _0x267d88 of _0x236a53[_0x450c62(0x1da)]){_0x267d88['action']==='error'&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x15b)+_0x267d88[_0x450c62(0x1e1)]+_0x450c62(0x1dc)+_0x267d88[_0x450c62(0x163)]));}return 0x1;}console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x179)](_0x450c62(0x19d)+(_0x1d2ae3+_0x545f19)+_0x450c62(0x157)+_0x236a53[_0x450c62(0x19f)]+'\x27'));const _0x216599=getLLMProjectUrl(_0x341779,_0x236a53[_0x450c62(0x14b)]);return console[_0x450c62(0x1a1)](_0x450c62(0x1bd)+a4_0x445426[_0x450c62(0x14a)](_0x216599)),0x0;}}
|
|
1
|
+
const a4_0x14110d=a4_0x8a4d;function a4_0x8a4d(_0x267014,_0x2779ae){_0x267014=_0x267014-0x143;const _0x53a578=a4_0x53a5();let _0x8a4d2c=_0x53a578[_0x267014];return _0x8a4d2c;}(function(_0x51dd91,_0xdc2e66){const _0x363dd1=a4_0x8a4d,_0x112c95=_0x51dd91();while(!![]){try{const _0xc9aafe=-parseInt(_0x363dd1(0x1d6))/0x1*(parseInt(_0x363dd1(0x14d))/0x2)+parseInt(_0x363dd1(0x1fb))/0x3+parseInt(_0x363dd1(0x1bf))/0x4*(parseInt(_0x363dd1(0x169))/0x5)+-parseInt(_0x363dd1(0x15a))/0x6+parseInt(_0x363dd1(0x181))/0x7*(-parseInt(_0x363dd1(0x1c1))/0x8)+-parseInt(_0x363dd1(0x153))/0x9*(parseInt(_0x363dd1(0x155))/0xa)+parseInt(_0x363dd1(0x1e3))/0xb*(parseInt(_0x363dd1(0x192))/0xc);if(_0xc9aafe===_0xdc2e66)break;else _0x112c95['push'](_0x112c95['shift']());}catch(_0x2db1fc){_0x112c95['push'](_0x112c95['shift']());}}}(a4_0x53a5,0xc605c));import a4_0x4d481c from'chalk';import a4_0x2b6db8 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_0x53a5(){const _0x28d6ec=['Analyzing\x20changes\x20to\x20push...','\x20=\x20','Project\x20cloned\x20with\x20errors','Pushing\x20to\x20project...','updated','site','textKnowledgeBases','Project:\x20','sourceProjectName','Using\x20project:\x20','pushProject','agent.yml','source','12SYRVaI','\x22\x20to\x20\x22','hasChanges','gray','parse','\x20|\x20','Chat:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x27\x20to\x20create\x20the\x20folder\x20structure.','<new-name>','INVALID_ARGUMENT','\x20files\x20to\x20','outputDir','\x0aPush\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','New\x20project\x20ID:\x20','\x20new','errors','Status:\x20','counts','Agent\x20','cwd-config','\x20successfully','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','session','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','projectId','\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','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Bases:\x20','log','\x20\x20Integrations:\x20','\x20\x20Experimental\x20Artifact\x20\x22','found','yes','experimentalArtifacts','green','\x20total','Agent:\x20','\x20\x20Prompt\x20\x22','\x20\x20Integration\x20\x22','\x20\x20Agent\x20\x22','\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','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)','4XyKvZt','agentName','12440FJTbwr','Analyzing\x20project\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','newProjectId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20errors','repeat','\x20changed','\x0aPush\x20summary\x20for\x20\x27','no_local_folder','prompts','\x20\x20tdx\x20agent\x20pull\x20','tdx.json','\x0a✔\x20Pulled\x20','error','action','new','integrations','New\x20project\x20name\x20is\x20required','context','13ggudEa','\x20\x20Text\x20Knowledge\x20Bases:\x20','unchanged','agents','Errors:','Cancelled','\x20resources\x20to\x20\x27','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Cloning\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','knowledgeBases','push','\x0aPull\x20summary\x20for\x20\x27','53872093UndHnr','Pulling\x20agent\x20\x22','-\x20no\x20files\x20written','\x20files?','\x20unchanged','\x20\x20Source:\x20','dryRun','agent:pull','Output:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x22:\x20','isNew','\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)','yellow','Using\x20project\x20from\x20context:\x20','\x20\x20Target:\x20','\x20resources?','pushAgent','\x0a✔\x20Pushed\x20','join','llmProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20tdx\x20agent\x20clone\x20agents/','total','2249367tqsUgn','Agent\x20pulled\x20successfully','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22...','created','\x20\x20Agents:\x20','\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','\x20--name\x20','force','dim','pullAgent','247624nLXVHk','cyan','utf-8','\x22\x20from\x20project\x20\x22','Using\x20context\x20project:\x20','\x20updated','13698rBWEVA','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','4070ISEosF','message','\x0aError:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','8240586bleAml','reason','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20created','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','experimentalKnowledgeBases','profile','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','cwd','Using\x20local\x20project:\x20','execute','\x20\x20Prompts:\x20','name','dirname','✔\x20Context\x20set:\x20','393545CGobfF','diff','red','\x0aWrite\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','-\x20nothing\x20pushed','\x0aProject\x20pushed\x20with\x20errors','Project\x20cloned\x20successfully','\x0aErrors\x20found:','no_context','description','agent:push','Using\x20current\x20project:\x20','pullProject','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20project\x20from\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','projectName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','llm_project','agent','\x20--profile\x20','Summary:','5908pyUFnW','\x20\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','llm'];a4_0x53a5=function(){return _0x28d6ec;};return a4_0x53a5();}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(_0x51417e){const _0x42280e=a4_0x8a4d,_0x1e0705=[];if(_0x51417e['total']!==undefined)_0x1e0705['push'](_0x51417e[_0x42280e(0x1fa)]+_0x42280e(0x1b8));if(_0x51417e[_0x42280e(0x1d2)]!==undefined&&_0x51417e['new']>0x0)_0x1e0705['push'](a4_0x4d481c['green'](_0x51417e['new']+_0x42280e(0x1a3)));if(_0x51417e[_0x42280e(0x146)]!==undefined&&_0x51417e[_0x42280e(0x146)]>0x0)_0x1e0705['push'](a4_0x4d481c[_0x42280e(0x1b7)](_0x51417e[_0x42280e(0x146)]+_0x42280e(0x15d)));if(_0x51417e[_0x42280e(0x189)]!==undefined&&_0x51417e[_0x42280e(0x189)]>0x0)_0x1e0705['push'](a4_0x4d481c[_0x42280e(0x1f0)](_0x51417e[_0x42280e(0x189)]+_0x42280e(0x152)));if(_0x51417e[_0x42280e(0x1d8)]!==undefined&&_0x51417e['unchanged']>0x0)_0x1e0705[_0x42280e(0x1e1)](a4_0x4d481c[_0x42280e(0x195)](_0x51417e[_0x42280e(0x1d8)]+_0x42280e(0x1e7)));if(_0x51417e[_0x42280e(0x1a4)]!==undefined&&_0x51417e[_0x42280e(0x1a4)]>0x0)_0x1e0705['push'](a4_0x4d481c['red'](_0x51417e[_0x42280e(0x1a4)]+_0x42280e(0x1c7)));return _0x1e0705[_0x42280e(0x1f6)](',\x20');}function displayDiffs(_0x528dc2,_0x389948,_0x535295,_0x51608b,_0x44caaa,_0x10e2af,_0x3ef03e){const _0x550a5a=a4_0x8a4d;for(const _0x5148c1 of _0x528dc2){if(_0x5148c1[_0x550a5a(0x16a)]){const _0x52e71f=_0x5148c1[_0x550a5a(0x1c0)]||_0x5148c1['name'];console[_0x550a5a(0x1b1)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x52e71f+'\x27:'),console[_0x550a5a(0x1b1)]('─'[_0x550a5a(0x1c8)](0x3c)),console['log'](_0x5148c1[_0x550a5a(0x16a)]),console['log']('─'[_0x550a5a(0x1c8)](0x3c));}}for(const _0x311c75 of _0x389948){_0x311c75[_0x550a5a(0x16a)]&&(console[_0x550a5a(0x1b1)](_0x550a5a(0x16e)+_0x311c75[_0x550a5a(0x166)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x311c75[_0x550a5a(0x16a)]),console[_0x550a5a(0x1b1)]('─'[_0x550a5a(0x1c8)](0x3c)));}for(const _0x1c1c4a of _0x535295){_0x1c1c4a[_0x550a5a(0x16a)]&&(console['log'](_0x550a5a(0x154)+_0x1c1c4a[_0x550a5a(0x166)]+'\x27:'),console[_0x550a5a(0x1b1)]('─'['repeat'](0x3c)),console[_0x550a5a(0x1b1)](_0x1c1c4a[_0x550a5a(0x16a)]),console[_0x550a5a(0x1b1)]('─'['repeat'](0x3c)));}for(const _0x2da3d8 of _0x51608b){_0x2da3d8[_0x550a5a(0x16a)]&&(console[_0x550a5a(0x1b1)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2da3d8[_0x550a5a(0x166)]+'\x27:'),console['log']('─'[_0x550a5a(0x1c8)](0x3c)),console[_0x550a5a(0x1b1)](_0x2da3d8['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0xee3cb2 of _0x44caaa){_0xee3cb2[_0x550a5a(0x16a)]&&(console[_0x550a5a(0x1b1)]('\x0aChanges\x20to\x20integration\x20\x27'+_0xee3cb2[_0x550a5a(0x166)]+'\x27:'),console[_0x550a5a(0x1b1)]('─'[_0x550a5a(0x1c8)](0x3c)),console[_0x550a5a(0x1b1)](_0xee3cb2[_0x550a5a(0x16a)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3dd312 of _0x10e2af){_0x3dd312[_0x550a5a(0x16a)]&&(console['log'](_0x550a5a(0x15e)+_0x3dd312['name']+'\x27:'),console[_0x550a5a(0x1b1)]('─'[_0x550a5a(0x1c8)](0x3c)),console['log'](_0x3dd312[_0x550a5a(0x16a)]),console[_0x550a5a(0x1b1)]('─'['repeat'](0x3c)));}for(const _0x16ca64 of _0x3ef03e){_0x16ca64[_0x550a5a(0x16a)]&&(console[_0x550a5a(0x1b1)](_0x550a5a(0x1c3)+_0x16ca64['name']+'\x27:'),console[_0x550a5a(0x1b1)]('─'[_0x550a5a(0x1c8)](0x3c)),console[_0x550a5a(0x1b1)](_0x16ca64['diff']),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x14110d(0x166)]=a4_0x14110d(0x1ea);[a4_0x14110d(0x174)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x14110d(0x164)](_0x415227){const _0x1a874d=a4_0x14110d,{options:_0x414ea4,args:_0x4d618a,tdx:_0x5c3490}=_0x415227,_0x19f62d=_0x4d618a[0x0],_0x15c5e4=_0x4d618a[0x1],_0x45dc8b=_0x414ea4['output'],_0x5758ab=_0x414ea4[_0x1a874d(0x1e9)],_0x6a1fad=_0x414ea4['force'],_0x9a8b99=_0x414ea4[_0x1a874d(0x1b5)],_0x1a12be=_0x414ea4[_0x1a874d(0x1f7)],_0x3ed7c0=_0x414ea4[_0x1a874d(0x17e)];let _0x17089f;if(_0x19f62d){const _0x16187b=a4_0x2b6db8[_0x1a874d(0x1f6)](_0x19f62d,_0x1a874d(0x1ce));if(existsSync(_0x16187b))try{const _0x1aef24=JSON[_0x1a874d(0x196)](readFileSync(_0x16187b,_0x1a874d(0x14f)));_0x1aef24['llm_project']&&(_0x17089f={'llm_project':_0x1aef24[_0x1a874d(0x17d)]});}catch{}}const _0x96d090=findAgentConfigPath(process[_0x1a874d(0x162)]());let _0x567cf3;if(_0x96d090)try{const _0x5ab1d5=JSON['parse'](readFileSync(_0x96d090,_0x1a874d(0x14f)));_0x5ab1d5[_0x1a874d(0x17d)]&&(_0x567cf3={'llm_project':_0x5ab1d5[_0x1a874d(0x17d)]});}catch{}const _0x289889=resolveAgentPullArgs({'arg':_0x19f62d,'agentNameArg':_0x15c5e4,'agentFlag':_0x3ed7c0,'contextProject':_0x1a12be,'argDirConfig':_0x17089f,'cwdConfigPath':_0x96d090||undefined,'cwdConfig':_0x567cf3}),{projectNameOrId:_0x34bb40,targetAgentName:_0x1127d7,existingOutputDir:_0x36d0f2,source:_0x2547d0}=_0x289889;if(_0x2547d0==='arg-dir')console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x14b)](_0x1a874d(0x179)+a4_0x2b6db8[_0x1a874d(0x1f6)](_0x19f62d,_0x1a874d(0x1ce))+':\x20'+_0x34bb40));else{if(_0x2547d0===_0x1a874d(0x1a8))console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x14b)](_0x1a874d(0x18e)+_0x34bb40));else _0x2547d0===_0x1a874d(0x1d5)&&console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x14b)](_0x1a874d(0x1f1)+_0x34bb40));}if(!_0x34bb40)return _0x3ed7c0?(console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x1f0)](_0x1a874d(0x1a1))),console[_0x1a874d(0x1b1)](_0x1a874d(0x1dd)),console[_0x1a874d(0x1b1)](_0x1a874d(0x17a))):(console[_0x1a874d(0x1b1)](a4_0x4d481c['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1a874d(0x1b1)](_0x1a874d(0x1be)),console['log'](_0x1a874d(0x1ae)),console[_0x1a874d(0x1b1)](_0x1a874d(0x1bd)),console[_0x1a874d(0x1b1)](_0x1a874d(0x148)),console[_0x1a874d(0x1b1)]('\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')),0x1;if(_0x1127d7){const {data:_0x16f789}=await withSpinner(_0x1a874d(0x1e4)+_0x1127d7+_0x1a874d(0x150)+_0x34bb40+_0x1a874d(0x145),()=>_0x5c3490['llm'][_0x1a874d(0x14c)](_0x34bb40,_0x1127d7,_0x45dc8b,{'dryRun':_0x5758ab,'force':_0x6a1fad}));if(_0x5758ab)return console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x1f0)](_0x1a874d(0x1f8))),console[_0x1a874d(0x1b1)]('Would\x20pull\x20agent:\x20'+_0x16f789[_0x1a874d(0x1c0)]),console[_0x1a874d(0x1b1)]('Output\x20path:\x20'+_0x16f789['outputPath']),_0x16f789[_0x1a874d(0x16a)]&&(console[_0x1a874d(0x1b1)]('\x0aChanges:'),console['log']('─'[_0x1a874d(0x1c8)](0x3c)),console[_0x1a874d(0x1b1)](_0x16f789[_0x1a874d(0x16a)]),console[_0x1a874d(0x1b1)]('─'[_0x1a874d(0x1c8)](0x3c))),0x0;return console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x1b7)](_0x1a874d(0x143))),console[_0x1a874d(0x1b1)](_0x1a874d(0x1b9)+_0x16f789[_0x1a874d(0x1c0)]),console[_0x1a874d(0x1b1)](_0x1a874d(0x1eb)+_0x16f789['outputPath']),console[_0x1a874d(0x1b1)](_0x1a874d(0x1a5)+(_0x16f789[_0x1a874d(0x1ee)]?a4_0x4d481c['green'](_0x1a874d(0x1d2)):_0x16f789[_0x1a874d(0x194)]?a4_0x4d481c['yellow'](_0x1a874d(0x189)):a4_0x4d481c[_0x1a874d(0x195)]('unchanged'))),0x0;}const _0x2b4722=_0x36d0f2||_0x45dc8b,{data:_0x2ecf8a}=await withSpinner(_0x1a874d(0x1c2)+_0x34bb40+_0x1a874d(0x145),()=>_0x5c3490[_0x1a874d(0x184)][_0x1a874d(0x177)](_0x34bb40,_0x2b4722,{'dryRun':!![]})),_0x203352=_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1d9)][_0x1a874d(0x1d2)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1e0)]['new']+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x18b)][_0x1a874d(0x1d2)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1cc)]['new']+_0x2ecf8a['counts'][_0x1a874d(0x1d3)][_0x1a874d(0x1d2)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x15f)][_0x1a874d(0x1d2)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1b6)][_0x1a874d(0x1d2)],_0x1c6928=_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1d9)][_0x1a874d(0x189)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1e0)][_0x1a874d(0x189)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x18b)]['updated']+_0x2ecf8a['counts'][_0x1a874d(0x1cc)][_0x1a874d(0x189)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1d3)][_0x1a874d(0x189)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x15f)]['updated']+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1b6)][_0x1a874d(0x189)],_0x210875=_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1d9)][_0x1a874d(0x1d8)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1e0)][_0x1a874d(0x1d8)]+_0x2ecf8a['counts']['textKnowledgeBases']['unchanged']+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1cc)][_0x1a874d(0x1d8)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1d3)][_0x1a874d(0x1d8)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x15f)][_0x1a874d(0x1d8)]+_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1b6)]['unchanged'];console[_0x1a874d(0x1b1)](_0x1a874d(0x1e2)+_0x2ecf8a[_0x1a874d(0x17b)]+'\x27:'),console['log']('\x20\x20'+a4_0x4d481c[_0x1a874d(0x1b7)]('+\x20'+_0x203352+_0x1a874d(0x1a3))+_0x1a874d(0x197)+a4_0x4d481c[_0x1a874d(0x1f0)]('~\x20'+_0x1c6928+_0x1a874d(0x1c9))+_0x1a874d(0x197)+a4_0x4d481c[_0x1a874d(0x14b)]('=\x20'+_0x210875+_0x1a874d(0x1e7))),console[_0x1a874d(0x1b1)](_0x1a874d(0x147)+formatCountSummary(_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1d9)])),console[_0x1a874d(0x1b1)](_0x1a874d(0x1b0)+formatCountSummary(_0x2ecf8a['counts'][_0x1a874d(0x1e0)])),console['log'](_0x1a874d(0x1d7)+formatCountSummary(_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x18b)])),console[_0x1a874d(0x1b1)](_0x1a874d(0x165)+formatCountSummary(_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1cc)])),console[_0x1a874d(0x1b1)](_0x1a874d(0x1b2)+formatCountSummary(_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1d3)]));const _0x47c0b9=_0x2ecf8a['counts'][_0x1a874d(0x15f)][_0x1a874d(0x1fa)]>0x0||_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1b6)][_0x1a874d(0x1fa)]>0x0;_0x47c0b9&&(console[_0x1a874d(0x1b1)](_0x1a874d(0x159)+formatCountSummary(_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x15f)])),console[_0x1a874d(0x1b1)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2ecf8a[_0x1a874d(0x1a6)][_0x1a874d(0x1b6)])));console[_0x1a874d(0x1b1)](_0x1a874d(0x1f2)+a4_0x4d481c[_0x1a874d(0x14e)](_0x2ecf8a['outputDir'])),displayDiffs(_0x2ecf8a[_0x1a874d(0x1d9)],_0x2ecf8a[_0x1a874d(0x1e0)],_0x2ecf8a[_0x1a874d(0x18b)],_0x2ecf8a[_0x1a874d(0x1cc)],_0x2ecf8a['integrations'],_0x2ecf8a['experimentalKnowledgeBases'],_0x2ecf8a[_0x1a874d(0x1b6)]);if(_0x5758ab)return console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x1f0)](_0x1a874d(0x178))),0x0;if(_0x203352===0x0&&_0x1c6928===0x0)return console[_0x1a874d(0x1b1)](a4_0x4d481c['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x2ecf8a[_0x1a874d(0x17b)]},_0x414ea4[_0x1a874d(0x1ab)]),console[_0x1a874d(0x1b1)](a4_0x4d481c['green'](_0x1a874d(0x168)+a4_0x4d481c['dim'](_0x1a874d(0x17d))+'\x20=\x20'+a4_0x4d481c[_0x1a874d(0x14e)](_0x2ecf8a[_0x1a874d(0x17b)]))),0x0;if(!_0x9a8b99&&!_0x6a1fad){if(!isInteractive())return console[_0x1a874d(0x1d0)](a4_0x4d481c[_0x1a874d(0x16b)](_0x1a874d(0x157)),_0x1a874d(0x1c5)),console['error'](a4_0x4d481c['dim'](_0x1a874d(0x17c))),0x1;const _0x26fc18=await confirmKey(_0x1a874d(0x16c)+(_0x203352+_0x1c6928)+_0x1a874d(0x1e6));if(!_0x26fc18)return console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x1f0)](_0x1a874d(0x1db)),_0x1a874d(0x1e5)),0x1;}const {data:_0x14e753}=await withSpinner('Writing\x20files...',()=>_0x5c3490['llm'][_0x1a874d(0x177)](_0x34bb40,_0x2b4722,{'force':_0x6a1fad}));return console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x1b7)](_0x1a874d(0x1cf)+(_0x203352+_0x1c6928)+_0x1a874d(0x19e)+_0x14e753[_0x1a874d(0x19f)])),saveSessionContext({'llm_project':_0x14e753['projectName']},_0x414ea4[_0x1a874d(0x1ab)]),console[_0x1a874d(0x1b1)](a4_0x4d481c[_0x1a874d(0x1b7)]('✔\x20Context\x20set:\x20'+a4_0x4d481c[_0x1a874d(0x14b)](_0x1a874d(0x17d))+_0x1a874d(0x186)+a4_0x4d481c[_0x1a874d(0x14e)](_0x14e753[_0x1a874d(0x17b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x14110d(0x166)]='agent:clone';[a4_0x14110d(0x174)]=a4_0x14110d(0x16d);async['execute'](_0x8e84d1){const _0x52a6ec=a4_0x14110d,{options:_0x5f3da1,args:_0x1ada9d,tdx:_0x5c6329}=_0x8e84d1,_0x7a5fa3=_0x1ada9d[0x0],_0x54a0fe=_0x5f3da1[_0x52a6ec(0x166)],_0x4b2669=_0x5f3da1[_0x52a6ec(0x1e9)],_0x591fa5=_0x5f3da1[_0x52a6ec(0x1b5)],_0x254606=_0x5f3da1[_0x52a6ec(0x18a)],_0x375f6e=_0x5f3da1[_0x52a6ec(0x1f7)];let _0x27a79b;const _0x409b40=findAgentConfigPath(process[_0x52a6ec(0x162)]());if(_0x7a5fa3){const _0x53b901=a4_0x2b6db8[_0x52a6ec(0x1f6)](_0x7a5fa3,_0x52a6ec(0x1ce));existsSync(_0x53b901)?(_0x27a79b=_0x7a5fa3,console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x14b)](_0x52a6ec(0x163)+_0x7a5fa3))):_0x27a79b=_0x7a5fa3;}else{if(_0x409b40)_0x27a79b=a4_0x2b6db8[_0x52a6ec(0x167)](_0x409b40),console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x14b)](_0x52a6ec(0x176)+_0x27a79b));else{if(_0x375f6e){const _0x41e9c0=sanitizeForFilesystem(_0x375f6e);let _0x1deeba=_0x41e9c0,_0x74f23c=a4_0x2b6db8['join'](process[_0x52a6ec(0x162)](),_0x52a6ec(0x1d9),_0x41e9c0,'tdx.json');if(!existsSync(_0x74f23c)){const _0x151c12=normalizeName(_0x375f6e),_0x20e8d2=a4_0x2b6db8['join'](process[_0x52a6ec(0x162)](),_0x52a6ec(0x1d9),_0x151c12,_0x52a6ec(0x1ce));existsSync(_0x20e8d2)&&(_0x1deeba=_0x151c12,_0x74f23c=_0x20e8d2);}if(existsSync(_0x74f23c))_0x27a79b=a4_0x2b6db8[_0x52a6ec(0x167)](_0x74f23c),console['log'](a4_0x4d481c[_0x52a6ec(0x14b)](_0x52a6ec(0x163)+_0x27a79b));else{const _0x579af7=_0x5f3da1[_0x52a6ec(0x160)];if(_0x579af7)throw new SDKError(ErrorCode[_0x52a6ec(0x19d)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x375f6e+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x52a6ec(0x144)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x52a6ec(0x1cd)+_0x375f6e+'\x0a')+(_0x52a6ec(0x1f9)+_0x1deeba+_0x52a6ec(0x149)+(_0x54a0fe||_0x52a6ec(0x19c))+_0x52a6ec(0x17f)+_0x579af7)});_0x27a79b=_0x375f6e,console[_0x52a6ec(0x1b1)](a4_0x4d481c['dim'](_0x52a6ec(0x151)+_0x375f6e));}}}}if(!_0x27a79b)return console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x1f0)](_0x52a6ec(0x199))),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x1ac)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x1ef)),console['log'](_0x52a6ec(0x1df)),0x1;if(!_0x54a0fe)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x52a6ec(0x1d4),undefined,{'helpText':_0x52a6ec(0x1aa)});if(!_0x591fa5&&!_0x4b2669){if(!isInteractive())return console[_0x52a6ec(0x1d0)](a4_0x4d481c[_0x52a6ec(0x16b)](_0x52a6ec(0x157)),_0x52a6ec(0x1c5)),console[_0x52a6ec(0x1d0)](a4_0x4d481c['dim'](_0x52a6ec(0x17c))),0x1;const _0xd6de74=await confirmKey('Clone\x20\x22'+_0x27a79b+'\x22\x20to\x20new\x20project\x20\x22'+_0x54a0fe+'\x22?');if(!_0xd6de74)return console[_0x52a6ec(0x1b1)](a4_0x4d481c['yellow'](_0x52a6ec(0x1db))),0x1;}const {data:_0x8236d4}=await withSpinner(_0x52a6ec(0x1de)+_0x27a79b+_0x52a6ec(0x193)+_0x54a0fe+'\x22...',()=>_0x5c6329['llm']['cloneProject'](_0x27a79b,_0x54a0fe,{'dryRun':_0x4b2669}));if(_0x4b2669){console['log'](a4_0x4d481c['yellow'](_0x52a6ec(0x183))),console[_0x52a6ec(0x1b1)]('Source:\x20'+_0x8236d4[_0x52a6ec(0x18d)]),console[_0x52a6ec(0x1b1)]('New\x20project:\x20'+_0x54a0fe),console[_0x52a6ec(0x1b1)]('Would\x20clone:'),console[_0x52a6ec(0x1b1)]('\x20\x20Agents:\x20'+_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1d9)]['created']),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x1b0)+_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1e0)][_0x52a6ec(0x146)]),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x165)+_0x8236d4['counts'][_0x52a6ec(0x1cc)][_0x52a6ec(0x146)]);const _0x1f3808=_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x15f)][_0x52a6ec(0x146)]>0x0||_0x8236d4[_0x52a6ec(0x1a6)]['experimentalArtifacts'][_0x52a6ec(0x146)]>0x0;return _0x1f3808&&(console[_0x52a6ec(0x1b1)](_0x52a6ec(0x159)+_0x8236d4['counts'][_0x52a6ec(0x15f)][_0x52a6ec(0x146)]),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x1af)+_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1b6)][_0x52a6ec(0x146)])),0x0;}const _0x5d315d=_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1d9)][_0x52a6ec(0x1a4)]>0x0||_0x8236d4['counts'][_0x52a6ec(0x1e0)][_0x52a6ec(0x1a4)]>0x0||_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1cc)][_0x52a6ec(0x1a4)]>0x0||_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x15f)]['errors']>0x0||_0x8236d4[_0x52a6ec(0x1a6)]['experimentalArtifacts']['errors']>0x0;_0x5d315d?console[_0x52a6ec(0x1b1)](a4_0x4d481c['yellow'](_0x52a6ec(0x187))):console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x1b7)](_0x52a6ec(0x171)));console[_0x52a6ec(0x1b1)]('Source:\x20'+_0x8236d4[_0x52a6ec(0x18d)]),console[_0x52a6ec(0x1b1)]('New\x20project:\x20'+_0x8236d4['newProjectName']),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x1a2)+_0x8236d4[_0x52a6ec(0x1c4)]),console[_0x52a6ec(0x1b1)](),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x180)),console[_0x52a6ec(0x1b1)]('\x20\x20Agents:\x20'+formatCountSummary(_0x8236d4[_0x52a6ec(0x1a6)]['agents'])),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x1b0)+formatCountSummary(_0x8236d4['counts']['knowledgeBases'])),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x165)+formatCountSummary(_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1cc)])),console[_0x52a6ec(0x1b1)](_0x52a6ec(0x1b2)+formatCountSummary(_0x8236d4['counts'][_0x52a6ec(0x1d3)]));const _0x45c635=_0x8236d4['counts']['experimentalKnowledgeBases'][_0x52a6ec(0x146)]>0x0||_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x15f)][_0x52a6ec(0x189)]>0x0||_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x15f)]['unchanged']>0x0||_0x8236d4['counts'][_0x52a6ec(0x1b6)][_0x52a6ec(0x146)]>0x0||_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1b6)]['updated']>0x0||_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1b6)][_0x52a6ec(0x1d8)]>0x0;_0x45c635&&(console[_0x52a6ec(0x1b1)](_0x52a6ec(0x159)+formatCountSummary(_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x15f)])),console['log'](_0x52a6ec(0x1af)+formatCountSummary(_0x8236d4[_0x52a6ec(0x1a6)][_0x52a6ec(0x1b6)])));if(_0x5d315d){console[_0x52a6ec(0x1b1)](),console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x16b)](_0x52a6ec(0x1da)));for(const _0x393ced of _0x8236d4[_0x52a6ec(0x1d9)]){_0x393ced['action']===_0x52a6ec(0x1d0)&&console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x16b)](_0x52a6ec(0x1bc)+_0x393ced[_0x52a6ec(0x1c0)]+_0x52a6ec(0x1ed)+_0x393ced[_0x52a6ec(0x1d0)]));}for(const _0xb2156c of _0x8236d4['knowledgeBases']){_0xb2156c['action']==='error'&&console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x16b)]('\x20\x20Knowledge\x20Base\x20\x22'+_0xb2156c['name']+_0x52a6ec(0x1ed)+_0xb2156c[_0x52a6ec(0x1d0)]));}for(const _0x585614 of _0x8236d4[_0x52a6ec(0x1cc)]){_0x585614[_0x52a6ec(0x1d1)]===_0x52a6ec(0x1d0)&&console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x16b)](_0x52a6ec(0x1ba)+_0x585614[_0x52a6ec(0x166)]+_0x52a6ec(0x1ed)+_0x585614[_0x52a6ec(0x1d0)]));}for(const _0x1f3054 of _0x8236d4[_0x52a6ec(0x1d3)]){_0x1f3054['action']===_0x52a6ec(0x1d0)&&console['log'](a4_0x4d481c['red'](_0x52a6ec(0x1bb)+_0x1f3054['name']+_0x52a6ec(0x1ed)+_0x1f3054[_0x52a6ec(0x1d0)]));}for(const _0x3af8eb of _0x8236d4[_0x52a6ec(0x15f)]){_0x3af8eb['action']===_0x52a6ec(0x1d0)&&console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x16b)](_0x52a6ec(0x1c6)+_0x3af8eb[_0x52a6ec(0x166)]+_0x52a6ec(0x1ed)+_0x3af8eb[_0x52a6ec(0x1d0)]));}for(const _0x187ff0 of _0x8236d4['experimentalArtifacts']){_0x187ff0[_0x52a6ec(0x1d1)]===_0x52a6ec(0x1d0)&&console[_0x52a6ec(0x1b1)](a4_0x4d481c[_0x52a6ec(0x16b)](_0x52a6ec(0x1b3)+_0x187ff0[_0x52a6ec(0x166)]+_0x52a6ec(0x1ed)+_0x187ff0[_0x52a6ec(0x1d0)]));}return 0x1;}console[_0x52a6ec(0x1b1)]();const _0x24f37a=getLLMProjectUrl(_0x254606,_0x8236d4[_0x52a6ec(0x1c4)]);return console[_0x52a6ec(0x1b1)](_0x52a6ec(0x18c)+a4_0x4d481c[_0x52a6ec(0x14e)](_0x24f37a)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x14110d(0x166)]=a4_0x14110d(0x175);[a4_0x14110d(0x174)]=a4_0x14110d(0x15c);async[a4_0x14110d(0x164)](_0x37660d){const _0x41bb3a=a4_0x14110d,{options:_0x2c71c1,args:_0x29148c,tdx:_0x1232b5}=_0x37660d;let _0x316c99=_0x29148c[0x0]||process[_0x41bb3a(0x162)]();const _0x580112=_0x2c71c1[_0x41bb3a(0x1e9)],_0x477839=_0x2c71c1[_0x41bb3a(0x14a)],_0x252e40=_0x2c71c1[_0x41bb3a(0x1b5)],_0x4934d9=_0x2c71c1[_0x41bb3a(0x18a)],_0x2e125d=a4_0x2b6db8['join'](_0x316c99,_0x41bb3a(0x190)),_0x7bca71=existsSync(_0x2e125d);if(_0x7bca71){const {data:_0x55ac6a}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x316c99+_0x41bb3a(0x145),()=>_0x1232b5[_0x41bb3a(0x184)][_0x41bb3a(0x1f4)](_0x316c99,{'dryRun':_0x580112,'force':_0x477839}));if(_0x580112)return console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x1f0)](_0x41bb3a(0x183))),console['log']('Would\x20push\x20agent:\x20'+_0x55ac6a[_0x41bb3a(0x1c0)]),0x0;if(_0x55ac6a['action']===_0x41bb3a(0x1d0))return console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x16b)]('Failed\x20to\x20push\x20agent:\x20'+_0x55ac6a[_0x41bb3a(0x1d0)])),0x1;console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x1b7)](_0x41bb3a(0x1a7)+_0x55ac6a[_0x41bb3a(0x1d1)]+_0x41bb3a(0x1a9))),console[_0x41bb3a(0x1b1)](_0x41bb3a(0x1b9)+_0x55ac6a[_0x41bb3a(0x1c0)]);if(_0x55ac6a['agentId']&&_0x55ac6a[_0x41bb3a(0x1ad)]){const _0x3ff240=getLLMAgentChatUrl(_0x4934d9,_0x55ac6a['projectId'],_0x55ac6a['agentId']);console[_0x41bb3a(0x1b1)](_0x41bb3a(0x198)+a4_0x4d481c[_0x41bb3a(0x14e)](_0x3ff240));}return 0x0;}const _0x662e23=_0x2c71c1['llmProject'],_0x18b648=resolveProjectFromContext(_0x316c99,_0x662e23);if(_0x18b648[_0x41bb3a(0x1b4)])_0x316c99=_0x18b648['projectDir'],_0x18b648[_0x41bb3a(0x191)]===_0x41bb3a(0x1d5)&&console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x14b)](_0x41bb3a(0x18e)+_0x316c99));else{let _0x47f8ad=_0x41bb3a(0x19a);_0x18b648[_0x41bb3a(0x15b)]===_0x41bb3a(0x1cb)&&(_0x47f8ad=_0x18b648[_0x41bb3a(0x156)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x18b648[_0x41bb3a(0x1f7)]+_0x41bb3a(0x19b));throw new SDKError(ErrorCode[_0x41bb3a(0x19d)],_0x18b648[_0x41bb3a(0x15b)]===_0x41bb3a(0x173)?_0x18b648[_0x41bb3a(0x156)]:'No\x20tdx.json\x20found\x20in\x20'+_0x316c99,undefined,{'helpText':_0x47f8ad});}const {data:_0x205dc8}=await withSpinner(_0x41bb3a(0x185),()=>_0x1232b5['llm'][_0x41bb3a(0x18f)](_0x316c99,{'dryRun':!![]})),_0xb6cb33=_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1d9)][_0x41bb3a(0x1a4)]>0x0;if(_0xb6cb33){console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x16b)](_0x41bb3a(0x172)));for(const _0x1aece0 of _0x205dc8[_0x41bb3a(0x1d9)]){_0x1aece0[_0x41bb3a(0x1d1)]===_0x41bb3a(0x1d0)&&console['log'](a4_0x4d481c[_0x41bb3a(0x16b)](_0x41bb3a(0x1bc)+_0x1aece0['agentName']+_0x41bb3a(0x1ed)+_0x1aece0[_0x41bb3a(0x1d0)]));}return 0x1;}const _0x588bb9=_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1d9)][_0x41bb3a(0x146)]+_0x205dc8[_0x41bb3a(0x1a6)]['knowledgeBases'][_0x41bb3a(0x146)]+_0x205dc8['counts'][_0x41bb3a(0x18b)][_0x41bb3a(0x146)]+_0x205dc8['counts'][_0x41bb3a(0x1cc)][_0x41bb3a(0x146)]+_0x205dc8[_0x41bb3a(0x1a6)]['integrations'][_0x41bb3a(0x146)]+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x15f)][_0x41bb3a(0x146)]+_0x205dc8['counts'][_0x41bb3a(0x1b6)][_0x41bb3a(0x146)],_0x2ba6da=_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1d9)]['updated']+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1e0)]['updated']+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x18b)][_0x41bb3a(0x189)]+_0x205dc8[_0x41bb3a(0x1a6)]['prompts']['updated']+_0x205dc8['counts'][_0x41bb3a(0x1d3)]['updated']+_0x205dc8[_0x41bb3a(0x1a6)]['experimentalKnowledgeBases'][_0x41bb3a(0x189)]+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1b6)][_0x41bb3a(0x189)],_0x5d1d8e=_0x205dc8['counts']['agents']['unchanged']+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1e0)][_0x41bb3a(0x1d8)]+_0x205dc8['counts'][_0x41bb3a(0x18b)][_0x41bb3a(0x1d8)]+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1cc)][_0x41bb3a(0x1d8)]+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1d3)]['unchanged']+_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x15f)][_0x41bb3a(0x1d8)]+_0x205dc8[_0x41bb3a(0x1a6)]['experimentalArtifacts'][_0x41bb3a(0x1d8)];console[_0x41bb3a(0x1b1)](_0x41bb3a(0x1ca)+_0x205dc8[_0x41bb3a(0x17b)]+'\x27:'),console[_0x41bb3a(0x1b1)]('\x20\x20'+a4_0x4d481c[_0x41bb3a(0x1b7)]('+\x20'+_0x588bb9+_0x41bb3a(0x1a3))+'\x20|\x20'+a4_0x4d481c[_0x41bb3a(0x1f0)]('~\x20'+_0x2ba6da+_0x41bb3a(0x1c9))+_0x41bb3a(0x197)+a4_0x4d481c[_0x41bb3a(0x14b)]('=\x20'+_0x5d1d8e+_0x41bb3a(0x1e7))),console[_0x41bb3a(0x1b1)]('\x20\x20Agents:\x20'+formatCountSummary(_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1d9)])),console[_0x41bb3a(0x1b1)](_0x41bb3a(0x1b0)+formatCountSummary(_0x205dc8[_0x41bb3a(0x1a6)]['knowledgeBases'])),console[_0x41bb3a(0x1b1)](_0x41bb3a(0x1d7)+formatCountSummary(_0x205dc8[_0x41bb3a(0x1a6)]['textKnowledgeBases'])),console['log'](_0x41bb3a(0x165)+formatCountSummary(_0x205dc8[_0x41bb3a(0x1a6)]['prompts'])),console[_0x41bb3a(0x1b1)](_0x41bb3a(0x1b2)+formatCountSummary(_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1d3)]));const _0x27c4cc=_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x15f)][_0x41bb3a(0x146)]>0x0||_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x15f)][_0x41bb3a(0x189)]>0x0||_0x205dc8['counts'][_0x41bb3a(0x15f)][_0x41bb3a(0x1d8)]>0x0||_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1b6)][_0x41bb3a(0x146)]>0x0||_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1b6)][_0x41bb3a(0x189)]>0x0||_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1b6)][_0x41bb3a(0x1d8)]>0x0;_0x27c4cc&&(console['log'](_0x41bb3a(0x159)+formatCountSummary(_0x205dc8['counts'][_0x41bb3a(0x15f)])),console[_0x41bb3a(0x1b1)](_0x41bb3a(0x1af)+formatCountSummary(_0x205dc8[_0x41bb3a(0x1a6)][_0x41bb3a(0x1b6)])));console[_0x41bb3a(0x1b1)](_0x41bb3a(0x1e8)+a4_0x4d481c[_0x41bb3a(0x14e)](_0x316c99)),displayDiffs(_0x205dc8['agents'],_0x205dc8[_0x41bb3a(0x1e0)],_0x205dc8[_0x41bb3a(0x18b)],_0x205dc8['prompts'],_0x205dc8[_0x41bb3a(0x1d3)],_0x205dc8[_0x41bb3a(0x15f)],_0x205dc8[_0x41bb3a(0x1b6)]);if(_0x580112)return console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x1f0)](_0x41bb3a(0x158))),0x0;if(_0x588bb9===0x0&&_0x2ba6da===0x0){console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x1b7)](_0x41bb3a(0x161)));const _0x329f7c=getLLMProjectUrl(_0x4934d9,_0x205dc8[_0x41bb3a(0x1ad)]);return console[_0x41bb3a(0x1b1)](_0x41bb3a(0x18c)+a4_0x4d481c[_0x41bb3a(0x14e)](_0x329f7c)),0x0;}if(!_0x252e40&&!_0x477839){if(!isInteractive())return console['error'](a4_0x4d481c[_0x41bb3a(0x16b)](_0x41bb3a(0x157)),_0x41bb3a(0x1c5)),console[_0x41bb3a(0x1d0)](a4_0x4d481c[_0x41bb3a(0x14b)](_0x41bb3a(0x17c))),0x1;const _0x2d8c03=await confirmKey(_0x41bb3a(0x1a0)+(_0x588bb9+_0x2ba6da)+_0x41bb3a(0x1f3));if(!_0x2d8c03)return console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x1f0)](_0x41bb3a(0x1db)),_0x41bb3a(0x16f)),0x1;}const {data:_0x747a32}=await withSpinner(_0x41bb3a(0x188),()=>_0x1232b5[_0x41bb3a(0x184)]['pushProject'](_0x316c99,{'force':_0x477839})),_0x2f37df=_0x747a32[_0x41bb3a(0x1a6)][_0x41bb3a(0x1d9)][_0x41bb3a(0x1a4)]>0x0||_0x747a32[_0x41bb3a(0x1a6)][_0x41bb3a(0x1e0)]['errors']>0x0||_0x747a32['counts'][_0x41bb3a(0x18b)]['errors']>0x0||_0x747a32[_0x41bb3a(0x1a6)]['prompts']['errors']>0x0;if(_0x2f37df){console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x1f0)](_0x41bb3a(0x170))),console['log'](),console[_0x41bb3a(0x1b1)](a4_0x4d481c['red']('Errors:'));for(const _0x8848a8 of _0x747a32['agents']){_0x8848a8['action']===_0x41bb3a(0x1d0)&&console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x16b)]('\x20\x20Agent\x20\x22'+_0x8848a8[_0x41bb3a(0x1c0)]+_0x41bb3a(0x1ed)+_0x8848a8[_0x41bb3a(0x1d0)]));}for(const _0x35fc19 of _0x747a32[_0x41bb3a(0x1e0)]){_0x35fc19[_0x41bb3a(0x1d1)]==='error'&&console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x16b)](_0x41bb3a(0x182)+_0x35fc19[_0x41bb3a(0x166)]+'\x22:\x20'+_0x35fc19[_0x41bb3a(0x1d0)]));}for(const _0x380617 of _0x747a32[_0x41bb3a(0x18b)]){_0x380617['action']===_0x41bb3a(0x1d0)&&console['log'](a4_0x4d481c[_0x41bb3a(0x16b)](_0x41bb3a(0x1ec)+_0x380617[_0x41bb3a(0x166)]+'\x22:\x20'+_0x380617[_0x41bb3a(0x1d0)]));}for(const _0x98c915 of _0x747a32['prompts']){_0x98c915['action']===_0x41bb3a(0x1d0)&&console['log'](a4_0x4d481c[_0x41bb3a(0x16b)]('\x20\x20Prompt\x20\x22'+_0x98c915[_0x41bb3a(0x166)]+_0x41bb3a(0x1ed)+_0x98c915['error']));}for(const _0x59b0cd of _0x747a32[_0x41bb3a(0x1d3)]){_0x59b0cd[_0x41bb3a(0x1d1)]===_0x41bb3a(0x1d0)&&console[_0x41bb3a(0x1b1)](a4_0x4d481c[_0x41bb3a(0x16b)]('\x20\x20Integration\x20\x22'+_0x59b0cd[_0x41bb3a(0x166)]+_0x41bb3a(0x1ed)+_0x59b0cd[_0x41bb3a(0x1d0)]));}return 0x1;}console[_0x41bb3a(0x1b1)](a4_0x4d481c['green'](_0x41bb3a(0x1f5)+(_0x588bb9+_0x2ba6da)+_0x41bb3a(0x1dc)+_0x747a32[_0x41bb3a(0x17b)]+'\x27'));const _0x4744a1=getLLMProjectUrl(_0x4934d9,_0x747a32['projectId']);return console['log'](_0x41bb3a(0x18c)+a4_0x4d481c['cyan'](_0x4744a1)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x5761d3=a5_0x2092;(function(_0xc86420,_0x2327a2){const _0x117060=a5_0x2092,_0x51902f=_0xc86420();while(!![]){try{const _0x4a7839=parseInt(_0x117060(0x137))/0x1+-parseInt(_0x117060(0x191))/0x2+-parseInt(_0x117060(0x121))/0x3+parseInt(_0x117060(0x185))/0x4+-parseInt(_0x117060(0x14a))/0x5+parseInt(_0x117060(0x136))/0x6*(-parseInt(_0x117060(0x150))/0x7)+parseInt(_0x117060(0x15a))/0x8;if(_0x4a7839===_0x2327a2)break;else _0x51902f['push'](_0x51902f['shift']());}catch(_0x2117ff){_0x51902f['push'](_0x51902f['shift']());}}}(a5_0x3eb2,0x434b5));import*as a5_0x3d2886 from'node:fs';import*as a5_0x37492f from'node:path';import a5_0x5a9672 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x2092(_0x1e156e,_0x52a20d){_0x1e156e=_0x1e156e-0x10e;const _0x3eb207=a5_0x3eb2();let _0x2092ec=_0x3eb207[_0x1e156e];return _0x2092ec;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x3eb2(){const _0x1db96a=['Round\x20','includes','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','join','Test\x20Configuration:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','has','forEach','tests','find','timestamp','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','status','rounds','yellow','Round\x201/','eval','multiple_agents','Tests\x20found:\x20','agent:test','Usage:','not\x20found','FAIL','testName','json','map','Conversation\x20URL:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','context','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20have\x20tags\x20defined.','Executing\x20new\x20tests...','\x20\x20Evaluating...\x20','llm','772710kjUkQd','Output\x20written\x20to:\x20','conversation_url','no_local_folder','length','filter','Failed\x20Tests:','Re-evaluating\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','existsSync','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','projectDir','executeReeval','Running\x20agent\x20tests...','\x20\x20Site:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Project\x20path:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','message','\x20\x20Conversation:\x20','✗\x20ERROR:\x20','18EkdCBb','360562ulLrqk','push','red','Agent:\x20','conversations','Evaluating\x20response...','Test\x20Summary','\x20-\x20','\x20\x20-\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Passed:\x20\x20\x20','PASS','No\x20tests\x20found\x20with\x20tags:\x20','substring','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20\x20Project:\x20','ERROR','\x20(new)','1299325zoDijC','repeat','resolve','start','Using\x20agent:\x20',':\x20Sending\x20user\x20input...','1255625RKwhgb','agentDirs','Error\x20writing\x20output\x20file:\x20','agentName','add','dim','Cached\x20run\x20is\x20from\x20site\x20\x22','Available\x20tags:\x20','\x20\x20Agent:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','4477520vpkWAH','name','toISOString','cyan','isSpinning','tags','reeval','output','...','\x22:\x20','✓\x20PASS:\x20','\x20\x20Round\x20','Re-evaluating...','⚠\x20SKIPPED:\x20','trim','green','size','Total:\x20\x20\x20\x20','reason','\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)','No\x20tests\x20found\x20matching:\x20','projectName','jsonl','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','agent','basename','llmProject','source','split','Re-evaluating\x20cached\x20test\x20run...','\x20(cached)','404','✗\x20FAIL:\x20','verbose','text','Failed:\x20\x20\x20','Re-evaluation\x20Summary','Errors:\x20\x20\x20','Duration:\x20','tsv','round','log','1848856nvuGQu','Available\x20tests:\x20','writeFileSync','dryRun','site','Test\x20','Running\x20test:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','stop','...\x20','table','now','102538mEwJUF','toLowerCase','found','white','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.'];a5_0x3eb2=function(){return _0x1db96a;};return a5_0x3eb2();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5761d3(0x15b)]=a5_0x5761d3(0x112);['description']=a5_0x5761d3(0x172);async['execute'](_0x57882e){const _0x2cb4c6=a5_0x5761d3,{options:_0x5c9851,args:_0x1e3bd0,tdx:_0x5bb689}=_0x57882e,_0x4c9995=_0x1e3bd0[0x0]||'.',_0x526065=_0x5c9851[_0x2cb4c6(0x188)],_0x5a1b16=_0x5c9851,_0x364772=_0x5a1b16[_0x2cb4c6(0x10f)]===![],_0x44d0f2=_0x5a1b16[_0x2cb4c6(0x160)],_0x2e8fcd=_0x5a1b16[_0x2cb4c6(0x15b)],_0x46ef4e=_0x5a1b16[_0x2cb4c6(0x15f)],_0x3ebbba=_0x5c9851[_0x2cb4c6(0x189)],_0xa6d9a5=_0x5a1b16[_0x2cb4c6(0x161)];if(_0x44d0f2&&_0x364772)return console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x129))),0x1;let _0x2e663a='table';if(_0x5a1b16[_0x2cb4c6(0x117)])_0x2e663a=_0x2cb4c6(0x117);else{if(_0x5a1b16['jsonl'])_0x2e663a=_0x2cb4c6(0x170);else{if(_0x5a1b16['tsv'])_0x2e663a=_0x2cb4c6(0x182);else{if(_0x5a1b16[_0x2cb4c6(0x18f)])_0x2e663a=_0x2cb4c6(0x18f);}}}const _0xc3ea2d=_0x5a1b16[_0x2cb4c6(0x175)];let _0x4440d8=_0x4c9995;const _0xd7de44=a5_0x3d2886[_0x2cb4c6(0x12a)](_0x4c9995),_0x4485ee=_0x4c9995==='.';if(!_0xd7de44||_0x4485ee){const _0x356125=resolveProjectFromContext(_0x4c9995,_0xc3ea2d,{'requireFile':'test.yml'});if(_0x356125[_0x2cb4c6(0x193)])_0x4440d8=_0x356125['projectDir'],_0x356125[_0x2cb4c6(0x176)]===_0x2cb4c6(0x11b)&&console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x14e)+_0x4440d8));else switch(_0x356125[_0x2cb4c6(0x16c)]){case'no_context':console['log'](a5_0x5a9672['yellow'](_0x356125[_0x2cb4c6(0x133)])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x113)),console[_0x2cb4c6(0x184)]('\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[_0x2cb4c6(0x184)](_0x2cb4c6(0x16d)),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x141));return 0x1;case _0x2cb4c6(0x124):console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x1a5)](_0x356125[_0x2cb4c6(0x133)])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x130)+_0x356125['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x2cb4c6(0x110):{const _0x2e2214=a5_0x37492f[_0x2cb4c6(0x174)](_0x356125[_0x2cb4c6(0x12c)]);console[_0x2cb4c6(0x184)](a5_0x5a9672['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x356125[_0x2cb4c6(0x175)]+'\x22:'));for(const _0x305a3b of _0x356125[_0x2cb4c6(0x151)]){console[_0x2cb4c6(0x184)](_0x2cb4c6(0x13f)+_0x305a3b);}return console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x1a2)+_0x2e2214+'/<agent-name>'),0x1;}case'no_tests':console['log'](a5_0x5a9672['yellow'](_0x2cb4c6(0x140)+_0x356125[_0x2cb4c6(0x175)]+'\x22.')),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x131)+_0x356125[_0x2cb4c6(0x12c)])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3fb918,agentInfo:_0x18324e}=parseTestFile(_0x4440d8);let _0x7f314b=_0x3fb918[_0x2cb4c6(0x19f)];if(_0x2e8fcd){const _0x31936d=_0x2e8fcd[_0x2cb4c6(0x177)](',')[_0x2cb4c6(0x118)](_0x4ffba3=>_0x4ffba3[_0x2cb4c6(0x168)]());_0x7f314b=_0x3fb918[_0x2cb4c6(0x19f)][_0x2cb4c6(0x126)](_0x5e38de=>_0x31936d[_0x2cb4c6(0x198)](_0x5e38de[_0x2cb4c6(0x15b)]));if(_0x7f314b[_0x2cb4c6(0x125)]===0x0)return console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x1a5)](_0x2cb4c6(0x16e)+_0x2e8fcd)),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x186)+_0x3fb918[_0x2cb4c6(0x19f)][_0x2cb4c6(0x118)](_0x34c8bb=>_0x34c8bb[_0x2cb4c6(0x15b)])[_0x2cb4c6(0x19a)](',\x20'))),0x1;}if(_0x46ef4e){const _0x377652=_0x46ef4e[_0x2cb4c6(0x177)](',')[_0x2cb4c6(0x118)](_0x890182=>_0x890182[_0x2cb4c6(0x168)]()[_0x2cb4c6(0x192)]());_0x7f314b=_0x7f314b[_0x2cb4c6(0x126)](_0x3e384b=>_0x3e384b[_0x2cb4c6(0x15f)]?.['some'](_0x101d29=>_0x377652[_0x2cb4c6(0x198)](_0x101d29['toLowerCase']())));if(_0x7f314b[_0x2cb4c6(0x125)]===0x0){console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x1a5)](_0x2cb4c6(0x144)+_0x46ef4e));const _0x322bc7=new Set();return _0x3fb918[_0x2cb4c6(0x19f)][_0x2cb4c6(0x19e)](_0x45c7bf=>_0x45c7bf['tags']?.['forEach'](_0x47b827=>_0x322bc7[_0x2cb4c6(0x154)](_0x47b827))),_0x322bc7[_0x2cb4c6(0x16a)]>0x0?console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x157)+[..._0x322bc7][_0x2cb4c6(0x19a)](',\x20'))):console[_0x2cb4c6(0x184)](a5_0x5a9672['dim'](_0x2cb4c6(0x11d))),0x1;}}if(_0x44d0f2)return this[_0x2cb4c6(0x12d)](_0x57882e,{'definition':{'tests':_0x7f314b},'agentInfo':_0x18324e,'outputFormat':_0x2e663a,'outputFile':_0xa6d9a5,'testNames':_0x2e8fcd});if(_0x526065){console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x15d)](_0x2cb4c6(0x19b))),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x12f)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x3ebbba)),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x147)+a5_0x5a9672['white'](_0x18324e['projectName'])),console['log'](_0x2cb4c6(0x158)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x18324e['agentName'])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x111)+a5_0x5a9672['white'](_0x7f314b[_0x2cb4c6(0x125)]));for(let _0x558aec=0x0;_0x558aec<_0x7f314b[_0x2cb4c6(0x125)];_0x558aec++){const _0x149ae0=_0x7f314b[_0x558aec],_0x667743=_0x149ae0['rounds'][_0x2cb4c6(0x125)]===0x1?_0x2cb4c6(0x183):_0x2cb4c6(0x1a4),_0x51b99e=_0x149ae0[_0x2cb4c6(0x15f)]?.[_0x2cb4c6(0x125)]?'\x20['+_0x149ae0[_0x2cb4c6(0x15f)][_0x2cb4c6(0x19a)](',\x20')+']':'';console[_0x2cb4c6(0x184)]('\x20\x20'+(_0x558aec+0x1)+'.\x20'+a5_0x5a9672['white'](_0x149ae0[_0x2cb4c6(0x15b)])+'\x20('+_0x149ae0[_0x2cb4c6(0x1a4)][_0x2cb4c6(0x125)]+'\x20'+_0x667743+')'+a5_0x5a9672[_0x2cb4c6(0x155)](_0x51b99e));}return 0x0;}let _0x44b91e,_0x573078;try{_0x44b91e=await _0x5bb689[_0x2cb4c6(0x120)]['resolveProjectId'](_0x18324e[_0x2cb4c6(0x16f)]);}catch(_0x11891a){const _0x8bc621=_0x11891a instanceof Error?_0x11891a[_0x2cb4c6(0x133)]:String(_0x11891a);return _0x8bc621[_0x2cb4c6(0x198)](_0x2cb4c6(0x17a))||_0x8bc621[_0x2cb4c6(0x192)]()['includes'](_0x2cb4c6(0x114))?console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x18324e[_0x2cb4c6(0x16f)])):console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x199)+_0x18324e[_0x2cb4c6(0x16f)]+_0x2cb4c6(0x163)+_0x8bc621)),0x1;}try{_0x573078=await _0x5bb689[_0x2cb4c6(0x120)]['resolveAgentId'](_0x18324e[_0x2cb4c6(0x153)],_0x44b91e);}catch(_0x20dd2b){const _0x50842f=_0x20dd2b instanceof Error?_0x20dd2b[_0x2cb4c6(0x133)]:String(_0x20dd2b);return _0x50842f[_0x2cb4c6(0x198)](_0x2cb4c6(0x17a))||_0x50842f[_0x2cb4c6(0x192)]()[_0x2cb4c6(0x198)](_0x2cb4c6(0x114))?console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x132)+_0x18324e[_0x2cb4c6(0x153)])):console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x146)+_0x18324e[_0x2cb4c6(0x153)]+'\x22:\x20'+_0x50842f)),0x1;}let _0x558b93;if(!_0x364772)try{_0x558b93=await setupEvaluatorAgent(_0x5bb689[_0x2cb4c6(0x120)],_0x5c9851[_0x2cb4c6(0x17c)]);}catch(_0x423918){const _0x129118=_0x423918 instanceof Error?_0x423918[_0x2cb4c6(0x133)]:String(_0x423918);return console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x19c)+_0x129118)),0x1;}console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x15d)](_0x2cb4c6(0x12e))),console[_0x2cb4c6(0x184)]('Site:\x20'+a5_0x5a9672[_0x2cb4c6(0x194)](_0x3ebbba)),console['log'](_0x2cb4c6(0x13a)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x18324e[_0x2cb4c6(0x16f)]+'/'+_0x18324e[_0x2cb4c6(0x153)])),console[_0x2cb4c6(0x184)]();const _0x135888=[],_0x5ac905=[],_0x3cf174=Date[_0x2cb4c6(0x190)]();for(let _0x3ac27c=0x0;_0x3ac27c<_0x7f314b[_0x2cb4c6(0x125)];_0x3ac27c++){const _0x1ae015=_0x7f314b[_0x3ac27c];_0x7f314b[_0x2cb4c6(0x125)]>0x1?console['log'](_0x2cb4c6(0x18a)+(_0x3ac27c+0x1)+'/'+_0x7f314b['length']+':\x20'+a5_0x5a9672[_0x2cb4c6(0x194)](_0x1ae015['name'])):console[_0x2cb4c6(0x184)](_0x2cb4c6(0x18b)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x1ae015[_0x2cb4c6(0x15b)]));const _0x2bc988=createCommandSpinner(_0x2cb4c6(0x10e)+_0x1ae015['rounds'][_0x2cb4c6(0x125)]+_0x2cb4c6(0x14f));_0x2bc988['start']();try{const {result:_0x32b2b5,conversation:_0x5863c8}=await runTest(_0x5bb689[_0x2cb4c6(0x120)],_0x1ae015,{'agentId':_0x573078,'projectId':_0x44b91e,'site':_0x3ebbba,'noEval':_0x364772,'evaluatorId':_0x558b93,'onRoundStart':(_0x5e9de8,_0x56f2b9)=>{_0x2bc988['text']='Round\x20'+(_0x5e9de8+0x1)+'/'+_0x56f2b9+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x20b038,_0x532be5,_0x472a4f)=>{const _0x27ee6a=_0x2cb4c6,_0x58f2cf=formatElapsed(_0x532be5);_0x472a4f?console[_0x27ee6a(0x184)]('\x20\x20Round\x20'+(_0x20b038+0x1)+'/'+_0x1ae015['rounds'][_0x27ee6a(0x125)]+_0x27ee6a(0x18e)+a5_0x5a9672[_0x27ee6a(0x169)]('✓')+'\x20('+_0x58f2cf+')'):console['log']('\x20\x20Round\x20'+(_0x20b038+0x1)+'/'+_0x1ae015['rounds'][_0x27ee6a(0x125)]+_0x27ee6a(0x18e)+a5_0x5a9672['red']('✗'));},'onEvaluationStart':()=>{const _0x15089b=_0x2cb4c6;_0x2bc988[_0x15089b(0x17d)]='Evaluating\x20response...';},'onEvaluationComplete':_0x206a26=>{const _0x566c28=_0x2cb4c6,_0x4e4ab4=formatElapsed(_0x206a26);console[_0x566c28(0x184)](_0x566c28(0x11f)+a5_0x5a9672['green']('✓')+'\x20('+_0x4e4ab4+')');}});_0x2bc988[_0x2cb4c6(0x18d)](),_0x135888[_0x2cb4c6(0x138)](_0x32b2b5),_0x5ac905[_0x2cb4c6(0x138)](_0x5863c8);if(_0x32b2b5['status']==='PASS')console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x169)](_0x2cb4c6(0x164)+_0x32b2b5[_0x2cb4c6(0x16c)]));else _0x32b2b5[_0x2cb4c6(0x1a3)]===_0x2cb4c6(0x115)?console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x17b)+_0x32b2b5[_0x2cb4c6(0x16c)])):console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x135)+_0x32b2b5['reason']));_0x32b2b5[_0x2cb4c6(0x123)]&&console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x119)+_0x32b2b5[_0x2cb4c6(0x123)])),console[_0x2cb4c6(0x184)]();}catch(_0x1e9cb4){_0x2bc988[_0x2cb4c6(0x18d)]();const _0x45c157=_0x1e9cb4 instanceof Error?_0x1e9cb4['message']:String(_0x1e9cb4);console[_0x2cb4c6(0x184)](a5_0x5a9672['red']('✗\x20ERROR:\x20'+_0x45c157)),console[_0x2cb4c6(0x184)](),_0x135888[_0x2cb4c6(0x138)]({'name':_0x1ae015[_0x2cb4c6(0x15b)],'status':_0x2cb4c6(0x148),'reason':_0x45c157,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x23416a=Date['now']()-_0x3cf174,_0x4d075b=_0x135888[_0x2cb4c6(0x126)](_0x50a1fd=>_0x50a1fd['status']===_0x2cb4c6(0x143))[_0x2cb4c6(0x125)],_0x922323=_0x135888[_0x2cb4c6(0x126)](_0x305cc4=>_0x305cc4[_0x2cb4c6(0x1a3)]==='FAIL')[_0x2cb4c6(0x125)],_0x22c5ac=_0x135888[_0x2cb4c6(0x126)](_0x1cedda=>_0x1cedda[_0x2cb4c6(0x1a3)]===_0x2cb4c6(0x148))[_0x2cb4c6(0x125)];console['log']('━'[_0x2cb4c6(0x14b)](0x3c)),console['log'](_0x2cb4c6(0x13d)),console['log']('━'[_0x2cb4c6(0x14b)](0x3c)),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x16b)+_0x135888[_0x2cb4c6(0x125)]),console['log'](_0x2cb4c6(0x142)+a5_0x5a9672[_0x2cb4c6(0x169)](_0x4d075b)),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x17e)+a5_0x5a9672[_0x2cb4c6(0x139)](_0x922323));_0x22c5ac>0x0&&console[_0x2cb4c6(0x184)](_0x2cb4c6(0x180)+a5_0x5a9672[_0x2cb4c6(0x139)](_0x22c5ac));console['log'](_0x2cb4c6(0x181)+formatElapsed(_0x23416a)),console['log']('━'[_0x2cb4c6(0x14b)](0x3c));const _0x1abc8d=_0x135888['filter'](_0x22ef7e=>_0x22ef7e[_0x2cb4c6(0x1a3)]!==_0x2cb4c6(0x143));if(_0x1abc8d['length']>0x0){console[_0x2cb4c6(0x184)](),console['log'](_0x2cb4c6(0x127));for(const _0x5c7b5c of _0x1abc8d){const _0x631bc3=a5_0x5a9672[_0x2cb4c6(0x139)]('✗'),_0x39d585=_0x5c7b5c[_0x2cb4c6(0x16c)][_0x2cb4c6(0x125)]>0x32?_0x5c7b5c['reason'][_0x2cb4c6(0x145)](0x0,0x32)+'...':_0x5c7b5c[_0x2cb4c6(0x16c)];console['log']('\x20\x20'+_0x631bc3+'\x20'+_0x5c7b5c[_0x2cb4c6(0x15b)]+':\x20'+_0x39d585);}}const _0x116547={'summary':{'total':_0x135888[_0x2cb4c6(0x125)],'passed':_0x4d075b,'failed':_0x922323,'errors':_0x22c5ac>0x0?_0x22c5ac:undefined,'duration_ms':_0x23416a},'tests':_0x135888,'agent':{'project':_0x18324e['projectName'],'name':_0x18324e[_0x2cb4c6(0x153)],'site':_0x3ebbba},'timestamp':new Date(_0x3cf174)[_0x2cb4c6(0x15c)]()};try{const _0x2783ad=buildCachedTestRun(_0x5ac905,{'site':_0x3ebbba,'projectId':_0x44b91e,'projectName':_0x18324e[_0x2cb4c6(0x16f)],'agentId':_0x573078,'agentName':_0x18324e[_0x2cb4c6(0x153)],'testYmlPath':a5_0x37492f[_0x2cb4c6(0x14c)](_0x18324e['testYmlPath'])});saveLastTestRun(_0x2783ad);}catch{}if(_0x2e663a!==_0x2cb4c6(0x18f)||_0xa6d9a5){const _0x433a6d=formatResults(_0x116547,_0x2e663a);if(_0xa6d9a5)try{a5_0x3d2886['writeFileSync'](_0xa6d9a5,_0x433a6d,'utf-8'),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x122)+_0xa6d9a5));}catch(_0x1ea725){return console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x152)+_0x1ea725)),0x1;}else console[_0x2cb4c6(0x184)](),console['log'](_0x433a6d);}return _0x1abc8d['length']>0x0?0x1:0x0;}async['executeReeval'](_0x11a3f6,_0x3e34ad){const _0x338331=a5_0x5761d3,{options:_0x5eefb1,tdx:_0x2516da}=_0x11a3f6,{definition:_0x51e198,agentInfo:_0x55a050,outputFormat:_0x8656f4,outputFile:_0x12c3b2}=_0x3e34ad,_0x216d15=_0x5eefb1[_0x338331(0x189)],_0x3878f1=loadLastTestRun();if(!_0x3878f1)return console[_0x338331(0x184)](a5_0x5a9672['red'](_0x338331(0x11c))),console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x155)](_0x338331(0x11a))),0x1;if(_0x3878f1[_0x338331(0x173)][_0x338331(0x153)]!==_0x55a050[_0x338331(0x153)])return console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x139)](_0x338331(0x12b)+_0x3878f1[_0x338331(0x173)][_0x338331(0x153)]+_0x338331(0x18c)+_0x55a050['agentName']+'\x22.')),console[_0x338331(0x184)](a5_0x5a9672['dim'](_0x338331(0x195))),0x1;const _0xaa93e7=new Set(_0x3878f1[_0x338331(0x13b)][_0x338331(0x118)](_0x2f56bb=>_0x2f56bb[_0x338331(0x116)])),_0x2fd751=_0x51e198[_0x338331(0x19f)][_0x338331(0x126)](_0x5dd52c=>!_0xaa93e7[_0x338331(0x19d)](_0x5dd52c[_0x338331(0x15b)]));if(_0x2fd751['length']>0x0&&_0x3878f1[_0x338331(0x189)]!==_0x216d15)return console['log'](a5_0x5a9672['red'](_0x338331(0x196))),console['log'](a5_0x5a9672[_0x338331(0x155)](_0x338331(0x156)+_0x3878f1[_0x338331(0x189)]+_0x338331(0x159)+_0x216d15+'\x22.')),console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x155)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3878f1[_0x338331(0x189)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x395102=_0x51e198['tests'][_0x338331(0x126)](_0x377c3a=>_0xaa93e7[_0x338331(0x19d)](_0x377c3a['name'])),_0x5216e1=_0x2fd751;let _0x1e7d3c;try{_0x1e7d3c=await setupEvaluatorAgent(_0x2516da[_0x338331(0x120)],_0x5eefb1[_0x338331(0x17c)]);}catch(_0x2b1def){const _0x4f7718=_0x2b1def instanceof Error?_0x2b1def[_0x338331(0x133)]:String(_0x2b1def);return console['log'](a5_0x5a9672['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4f7718)),0x1;}console['log'](a5_0x5a9672[_0x338331(0x15d)](_0x338331(0x178))),console[_0x338331(0x184)]('Cached\x20run\x20from:\x20'+a5_0x5a9672[_0x338331(0x194)](_0x3878f1[_0x338331(0x1a1)])),console['log'](_0x338331(0x13a)+a5_0x5a9672[_0x338331(0x194)](_0x3878f1[_0x338331(0x173)]['projectName']+'/'+_0x3878f1['agent'][_0x338331(0x153)]));_0x5216e1[_0x338331(0x125)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x5a9672[_0x338331(0x1a5)](_0x5216e1[_0x338331(0x125)]));console[_0x338331(0x184)]();const _0x495579=[],_0x104401=Date[_0x338331(0x190)](),_0x32bbcd=createCommandSpinner(_0x338331(0x166));if(_0x395102[_0x338331(0x125)]>0x0)try{const _0x59c43b=await reevaluateFromCache(_0x2516da[_0x338331(0x120)],_0x3878f1,{'tests':_0x395102},{'evaluatorId':_0x1e7d3c,'onTestStart':(_0x31b465,_0x1693e5,_0x3b353a)=>{const _0x127c6c=_0x338331;_0x32bbcd[_0x127c6c(0x17d)]=_0x127c6c(0x128)+(_0x1693e5+0x1)+'/'+_0x3b353a+':\x20'+_0x31b465+_0x127c6c(0x162);if(!_0x32bbcd[_0x127c6c(0x15e)])_0x32bbcd[_0x127c6c(0x14d)]();},'onTestComplete':(_0x80bbc0,_0x1418c9)=>{const _0x1ba6d4=_0x338331;_0x32bbcd[_0x1ba6d4(0x18d)]();if(_0x1418c9[_0x1ba6d4(0x1a3)]===_0x1ba6d4(0x143))console['log'](a5_0x5a9672['green']('✓\x20PASS:\x20'+_0x80bbc0)+a5_0x5a9672[_0x1ba6d4(0x155)](_0x1ba6d4(0x179)));else _0x1418c9[_0x1ba6d4(0x1a3)]===_0x1ba6d4(0x115)?console[_0x1ba6d4(0x184)](a5_0x5a9672[_0x1ba6d4(0x139)](_0x1ba6d4(0x17b)+_0x80bbc0+_0x1ba6d4(0x13e)+_0x1418c9[_0x1ba6d4(0x16c)])+a5_0x5a9672[_0x1ba6d4(0x155)]('\x20(cached)')):console[_0x1ba6d4(0x184)](a5_0x5a9672[_0x1ba6d4(0x139)](_0x1ba6d4(0x135)+_0x80bbc0+_0x1ba6d4(0x13e)+_0x1418c9[_0x1ba6d4(0x16c)]));_0x1418c9[_0x1ba6d4(0x123)]&&console[_0x1ba6d4(0x184)](a5_0x5a9672[_0x1ba6d4(0x155)](_0x1ba6d4(0x134)+_0x1418c9[_0x1ba6d4(0x123)])),_0x495579[_0x1ba6d4(0x138)](_0x1418c9);},'onTestSkipped':(_0x3af71c,_0x572b1a)=>{const _0x5c26ae=_0x338331;_0x32bbcd['stop'](),console['log'](a5_0x5a9672['yellow'](_0x5c26ae(0x167)+_0x3af71c+_0x5c26ae(0x13e)+_0x572b1a));}});for(const _0x53f802 of _0x59c43b){!_0x495579[_0x338331(0x1a0)](_0x159883=>_0x159883[_0x338331(0x15b)]===_0x53f802[_0x338331(0x15b)])&&_0x495579['push'](_0x53f802);}}catch(_0x2f4fce){_0x32bbcd[_0x338331(0x18d)]();const _0x10bf32=_0x2f4fce instanceof Error?_0x2f4fce['message']:String(_0x2f4fce);return console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x139)](_0x338331(0x171)+_0x10bf32)),0x1;}_0x32bbcd[_0x338331(0x18d)]();if(_0x5216e1['length']>0x0){console[_0x338331(0x184)](),console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x15d)](_0x338331(0x11e)));const {projectId:_0x1da13f,agentId:_0x3e6aa0}=_0x3878f1['agent'];for(const _0x39e20b of _0x5216e1){console['log']('Running:\x20'+a5_0x5a9672[_0x338331(0x194)](_0x39e20b['name']));const _0x27806c=createCommandSpinner(_0x338331(0x10e)+_0x39e20b[_0x338331(0x1a4)][_0x338331(0x125)]+_0x338331(0x14f));_0x27806c[_0x338331(0x14d)]();try{const {result:_0x575a6d}=await runTest(_0x2516da[_0x338331(0x120)],_0x39e20b,{'agentId':_0x3e6aa0,'projectId':_0x1da13f,'site':_0x3878f1['site'],'noEval':![],'evaluatorId':_0x1e7d3c,'onRoundStart':(_0x5aff8b,_0x21d030)=>{const _0x14d643=_0x338331;_0x27806c[_0x14d643(0x17d)]=_0x14d643(0x197)+(_0x5aff8b+0x1)+'/'+_0x21d030+_0x14d643(0x14f);},'onRoundComplete':(_0x1c0382,_0x31836a,_0xf2b726)=>{const _0x120821=_0x338331,_0x49e111=formatElapsed(_0x31836a);_0xf2b726?console[_0x120821(0x184)](_0x120821(0x165)+(_0x1c0382+0x1)+'/'+_0x39e20b['rounds']['length']+'...\x20'+a5_0x5a9672[_0x120821(0x169)]('✓')+'\x20('+_0x49e111+')'):console[_0x120821(0x184)](_0x120821(0x165)+(_0x1c0382+0x1)+'/'+_0x39e20b[_0x120821(0x1a4)][_0x120821(0x125)]+_0x120821(0x18e)+a5_0x5a9672[_0x120821(0x139)]('✗'));},'onEvaluationStart':()=>{const _0x4f70a4=_0x338331;_0x27806c[_0x4f70a4(0x17d)]=_0x4f70a4(0x13c);},'onEvaluationComplete':_0x446688=>{const _0x85acad=_0x338331,_0x28c3cd=formatElapsed(_0x446688);console[_0x85acad(0x184)]('\x20\x20Evaluating...\x20'+a5_0x5a9672[_0x85acad(0x169)]('✓')+'\x20('+_0x28c3cd+')');}});_0x27806c['stop'](),_0x495579[_0x338331(0x138)](_0x575a6d);if(_0x575a6d[_0x338331(0x1a3)]===_0x338331(0x143))console['log'](a5_0x5a9672['green'](_0x338331(0x164)+_0x575a6d[_0x338331(0x16c)])+a5_0x5a9672['dim'](_0x338331(0x149)));else _0x575a6d[_0x338331(0x1a3)]===_0x338331(0x115)?console[_0x338331(0x184)](a5_0x5a9672['red']('✗\x20FAIL:\x20'+_0x575a6d['reason'])+a5_0x5a9672[_0x338331(0x155)](_0x338331(0x149))):console[_0x338331(0x184)](a5_0x5a9672['red'](_0x338331(0x135)+_0x575a6d['reason']));_0x575a6d[_0x338331(0x123)]&&console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x155)](_0x338331(0x134)+_0x575a6d[_0x338331(0x123)]));}catch(_0x236dc6){_0x27806c[_0x338331(0x18d)]();const _0x374dbc=_0x236dc6 instanceof Error?_0x236dc6[_0x338331(0x133)]:String(_0x236dc6);console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x139)](_0x338331(0x135)+_0x374dbc)),_0x495579[_0x338331(0x138)]({'name':_0x39e20b[_0x338331(0x15b)],'status':_0x338331(0x148),'reason':_0x374dbc,'timestamp':new Date()[_0x338331(0x15c)](),'duration_ms':0x0});}}}console[_0x338331(0x184)]();const _0x5ad5be=Date[_0x338331(0x190)]()-_0x104401,_0x15fa54=_0x495579['filter'](_0x5e1aa3=>_0x5e1aa3[_0x338331(0x1a3)]===_0x338331(0x143))[_0x338331(0x125)],_0x5f3056=_0x495579['filter'](_0x157d14=>_0x157d14[_0x338331(0x1a3)]===_0x338331(0x115))[_0x338331(0x125)],_0x297c0c=_0x495579[_0x338331(0x126)](_0x274d55=>_0x274d55['status']===_0x338331(0x148))[_0x338331(0x125)];console[_0x338331(0x184)]('━'[_0x338331(0x14b)](0x3c)),console[_0x338331(0x184)](_0x338331(0x17f)),console[_0x338331(0x184)]('━'[_0x338331(0x14b)](0x3c)),console[_0x338331(0x184)](_0x338331(0x16b)+_0x495579[_0x338331(0x125)]),console['log'](_0x338331(0x142)+a5_0x5a9672[_0x338331(0x169)](_0x15fa54)),console['log'](_0x338331(0x17e)+a5_0x5a9672['red'](_0x5f3056));_0x297c0c>0x0&&console[_0x338331(0x184)]('Errors:\x20\x20\x20'+a5_0x5a9672[_0x338331(0x139)](_0x297c0c));console[_0x338331(0x184)](_0x338331(0x181)+formatElapsed(_0x5ad5be)),console[_0x338331(0x184)]('━'[_0x338331(0x14b)](0x3c));const _0x5828e3={'summary':{'total':_0x495579['length'],'passed':_0x15fa54,'failed':_0x5f3056,'errors':_0x297c0c>0x0?_0x297c0c:undefined,'duration_ms':_0x5ad5be},'tests':_0x495579,'agent':{'project':_0x55a050[_0x338331(0x16f)],'name':_0x55a050[_0x338331(0x153)],'site':_0x216d15},'timestamp':new Date(_0x104401)['toISOString']()};if(_0x8656f4!==_0x338331(0x18f)||_0x12c3b2){const _0x173942=formatResults(_0x5828e3,_0x8656f4);if(_0x12c3b2)try{a5_0x3d2886[_0x338331(0x187)](_0x12c3b2,_0x173942,'utf-8'),console[_0x338331(0x184)](),console[_0x338331(0x184)](a5_0x5a9672['dim'](_0x338331(0x122)+_0x12c3b2));}catch(_0x10a9cd){return console[_0x338331(0x184)](),console[_0x338331(0x184)](a5_0x5a9672['red'](_0x338331(0x152)+_0x10a9cd)),0x1;}else console['log'](),console[_0x338331(0x184)](_0x173942);}const _0x430f6b=_0x495579['filter'](_0x4729d6=>_0x4729d6[_0x338331(0x1a3)]!==_0x338331(0x143));return _0x430f6b['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2c7e5d=a5_0x3c73;(function(_0x5c2288,_0x143ea6){const _0x2dd7f2=a5_0x3c73,_0x4806a3=_0x5c2288();while(!![]){try{const _0x17e209=-parseInt(_0x2dd7f2(0x173))/0x1*(-parseInt(_0x2dd7f2(0x1b2))/0x2)+-parseInt(_0x2dd7f2(0x18b))/0x3+-parseInt(_0x2dd7f2(0x1d7))/0x4+parseInt(_0x2dd7f2(0x1ce))/0x5*(-parseInt(_0x2dd7f2(0x175))/0x6)+parseInt(_0x2dd7f2(0x19a))/0x7*(-parseInt(_0x2dd7f2(0x1d5))/0x8)+parseInt(_0x2dd7f2(0x1b5))/0x9+-parseInt(_0x2dd7f2(0x1f0))/0xa*(-parseInt(_0x2dd7f2(0x1ae))/0xb);if(_0x17e209===_0x143ea6)break;else _0x4806a3['push'](_0x4806a3['shift']());}catch(_0x48000c){_0x4806a3['push'](_0x4806a3['shift']());}}}(a5_0x727d,0x44525));import*as a5_0xea5d50 from'node:fs';import*as a5_0x3716a6 from'node:path';import a5_0x537b58 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x727d(){const _0x1eb297=['json','Running\x20agent\x20tests...','has','some','\x20(cached)','executeReeval','agentDirs','description','Error\x20writing\x20output\x20file:\x20','Failed\x20Tests:','llm','\x20\x20Evaluating...\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','execute','✗\x20ERROR:\x20Project\x20not\x20found:\x20','3138490OExNPS','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','reeval','/<agent-name>','no_local_folder','size','\x22,\x20but\x20current\x20site\x20is\x20\x22','projectName','No\x20tests\x20found\x20matching:\x20','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20','New\x20tests\x20to\x20execute:\x20','✓\x20PASS:\x20','resolveProjectId','text','agent','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','conversation_url','jsonl','existsSync','substring','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','writeFileSync','Executing\x20new\x20tests...','Run\x20tests\x20for\x20an\x20LLM\x20agent','output','No\x20tests\x20have\x20tags\x20defined.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','site','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','testName','no_context','find','\x20\x20Agent:\x20','450671nWuklQ','\x20\x20Project:\x20','1158OCwCZr','yellow','Errors:\x20\x20\x20','add','Using\x20agent:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','push','toLowerCase','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','status','includes','tsv','not\x20found','Site:\x20','agentName','Available\x20tests:\x20','round','Available\x20tags:\x20','map','llmProject','test.yml','start','571377KFflvV','white','\x20-\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','ERROR','Cached\x20run\x20is\x20from\x20site\x20\x22','log','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','eval','Round\x201/','context','projectDir','Either\x20switch\x20to\x20the\x20\x22','verbose','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','150647yzctTt','\x20(new)','resolveAgentId','join','Re-evaluation\x20Summary','now','\x22:\x20','basename','⚠\x20SKIPPED:\x20','Total:\x20\x20\x20\x20','Evaluating\x20response...','Agent:\x20','Running\x20test:\x20','\x20\x20Round\x20','source','404','Round\x20','Output\x20written\x20to:\x20','utf-8','cyan','33lsyvHG','red','Usage:','filter','2ExOJPE','dim','Re-evaluating\x20','990711wiObat','PASS','length','Passed:\x20\x20\x20','Failed:\x20\x20\x20','Test\x20',':\x20Sending\x20user\x20input...','multiple_agents','tags','dryRun','toISOString','...\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','repeat','isSpinning','\x20\x20-\x20','tests','found','\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','✗\x20FAIL:\x20','agent:test','green','Error:\x20No\x20previous\x20test\x20run\x20found.','reason','\x27\x20to\x20create\x20the\x20folder\x20structure.','13055QNnGSy','Duration:\x20','stop','Re-evaluating...','message','Running:\x20','...','40nUavcW','split','1681860stwdnK','table','Tests\x20found:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','rounds','Project\x20path:\x20','name','No\x20tests\x20found\x20with\x20tags:\x20','forEach','FAIL'];a5_0x727d=function(){return _0x1eb297;};return a5_0x727d();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x3c73(_0x3d2722,_0x1df509){_0x3d2722=_0x3d2722-0x155;const _0x727dea=a5_0x727d();let _0x3c7322=_0x727dea[_0x3d2722];return _0x3c7322;}export class AgentTestCommand extends BaseCommand{['name']=a5_0x2c7e5d(0x1c9);[a5_0x2c7e5d(0x1e8)]=a5_0x2c7e5d(0x168);async[a5_0x2c7e5d(0x1ee)](_0x5b99b2){const _0x5bfe68=a5_0x2c7e5d,{options:_0x2950de,args:_0x431235,tdx:_0x5344a5}=_0x5b99b2,_0x5e36be=_0x431235[0x0]||'.',_0x4d2700=_0x2950de[_0x5bfe68(0x1be)],_0x46d4c5=_0x2950de,_0x34fd9e=_0x46d4c5[_0x5bfe68(0x193)]===![],_0x49883e=_0x46d4c5[_0x5bfe68(0x1f2)],_0xc43e70=_0x46d4c5[_0x5bfe68(0x1dd)],_0x5b7b76=_0x46d4c5['tags'],_0x1b8056=_0x2950de[_0x5bfe68(0x16c)],_0x3dde93=_0x46d4c5[_0x5bfe68(0x169)];if(_0x49883e&&_0x34fd9e)return console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1af)](_0x5bfe68(0x1ed))),0x1;let _0x1c708b=_0x5bfe68(0x1d8);if(_0x46d4c5['json'])_0x1c708b=_0x5bfe68(0x1e1);else{if(_0x46d4c5[_0x5bfe68(0x162)])_0x1c708b=_0x5bfe68(0x162);else{if(_0x46d4c5[_0x5bfe68(0x180)])_0x1c708b=_0x5bfe68(0x180);else{if(_0x46d4c5[_0x5bfe68(0x1d8)])_0x1c708b=_0x5bfe68(0x1d8);}}}const _0x255feb=_0x46d4c5[_0x5bfe68(0x188)];let _0x1b71c2=_0x5e36be;const _0x191e61=a5_0xea5d50[_0x5bfe68(0x163)](_0x5e36be),_0xefeb82=_0x5e36be==='.';if(!_0x191e61||_0xefeb82){const _0x39c861=resolveProjectFromContext(_0x5e36be,_0x255feb,{'requireFile':_0x5bfe68(0x189)});if(_0x39c861[_0x5bfe68(0x1c6)])_0x1b71c2=_0x39c861[_0x5bfe68(0x196)],_0x39c861[_0x5bfe68(0x1a8)]===_0x5bfe68(0x195)&&console['log'](a5_0x537b58[_0x5bfe68(0x1b3)](_0x5bfe68(0x179)+_0x1b71c2));else switch(_0x39c861[_0x5bfe68(0x1cc)]){case _0x5bfe68(0x170):console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x176)](_0x39c861['message'])),console[_0x5bfe68(0x191)](),console[_0x5bfe68(0x191)](_0x5bfe68(0x1b0)),console[_0x5bfe68(0x191)](_0x5bfe68(0x1c7)),console['log']('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console['log'](),console[_0x5bfe68(0x191)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x5bfe68(0x1f4):console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x176)](_0x39c861['message'])),console['log'](),console['log'](_0x5bfe68(0x16d)+_0x39c861[_0x5bfe68(0x188)]+_0x5bfe68(0x1cd));return 0x1;case _0x5bfe68(0x1bc):{const _0x2c4293=a5_0x3716a6[_0x5bfe68(0x1a1)](_0x39c861[_0x5bfe68(0x196)]);console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x176)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x39c861[_0x5bfe68(0x188)]+'\x22:'));for(const _0x1eda10 of _0x39c861[_0x5bfe68(0x1e7)]){console[_0x5bfe68(0x191)](_0x5bfe68(0x1c4)+_0x1eda10);}return console['log'](),console[_0x5bfe68(0x191)](_0x5bfe68(0x1f1)+_0x2c4293+_0x5bfe68(0x1f3)),0x1;}case'no_tests':console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x176)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x39c861['llmProject']+'\x22.')),console[_0x5bfe68(0x191)](a5_0x537b58['dim'](_0x5bfe68(0x1dc)+_0x39c861[_0x5bfe68(0x196)])),console['log'](),console['log'](_0x5bfe68(0x17a));return 0x1;}}const {definition:_0x608242,agentInfo:_0x1aa594}=parseTestFile(_0x1b71c2);let _0x4d970a=_0x608242['tests'];if(_0xc43e70){const _0x179730=_0xc43e70[_0x5bfe68(0x1d6)](',')[_0x5bfe68(0x187)](_0x1de593=>_0x1de593['trim']());_0x4d970a=_0x608242['tests'][_0x5bfe68(0x1b1)](_0x58ffba=>_0x179730[_0x5bfe68(0x17f)](_0x58ffba[_0x5bfe68(0x1dd)]));if(_0x4d970a[_0x5bfe68(0x1b7)]===0x0)return console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x176)](_0x5bfe68(0x158)+_0xc43e70)),console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1b3)](_0x5bfe68(0x184)+_0x608242[_0x5bfe68(0x1c5)][_0x5bfe68(0x187)](_0x40d9aa=>_0x40d9aa[_0x5bfe68(0x1dd)])[_0x5bfe68(0x19d)](',\x20'))),0x1;}if(_0x5b7b76){const _0x5f3767=_0x5b7b76[_0x5bfe68(0x1d6)](',')[_0x5bfe68(0x187)](_0x5d859a=>_0x5d859a['trim']()['toLowerCase']());_0x4d970a=_0x4d970a['filter'](_0xd09f05=>_0xd09f05[_0x5bfe68(0x1bd)]?.[_0x5bfe68(0x1e4)](_0x25d72b=>_0x5f3767[_0x5bfe68(0x17f)](_0x25d72b[_0x5bfe68(0x17c)]())));if(_0x4d970a['length']===0x0){console[_0x5bfe68(0x191)](a5_0x537b58['yellow'](_0x5bfe68(0x1de)+_0x5b7b76));const _0x4ff0bf=new Set();return _0x608242[_0x5bfe68(0x1c5)][_0x5bfe68(0x1df)](_0x59984a=>_0x59984a[_0x5bfe68(0x1bd)]?.[_0x5bfe68(0x1df)](_0x5b5277=>_0x4ff0bf[_0x5bfe68(0x178)](_0x5b5277))),_0x4ff0bf[_0x5bfe68(0x155)]>0x0?console['log'](a5_0x537b58[_0x5bfe68(0x1b3)](_0x5bfe68(0x186)+[..._0x4ff0bf][_0x5bfe68(0x19d)](',\x20'))):console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1b3)](_0x5bfe68(0x16a))),0x1;}}if(_0x49883e)return this[_0x5bfe68(0x1e6)](_0x5b99b2,{'definition':{'tests':_0x4d970a},'agentInfo':_0x1aa594,'outputFormat':_0x1c708b,'outputFile':_0x3dde93,'testNames':_0xc43e70});if(_0x4d2700){console[_0x5bfe68(0x191)](a5_0x537b58['cyan']('Test\x20Configuration:')),console['log']('\x20\x20Site:\x20'+a5_0x537b58[_0x5bfe68(0x18c)](_0x1b8056)),console['log'](_0x5bfe68(0x174)+a5_0x537b58[_0x5bfe68(0x18c)](_0x1aa594[_0x5bfe68(0x157)])),console['log'](_0x5bfe68(0x172)+a5_0x537b58[_0x5bfe68(0x18c)](_0x1aa594[_0x5bfe68(0x183)])),console[_0x5bfe68(0x191)](),console['log'](_0x5bfe68(0x1d9)+a5_0x537b58[_0x5bfe68(0x18c)](_0x4d970a[_0x5bfe68(0x1b7)]));for(let _0x54a54e=0x0;_0x54a54e<_0x4d970a[_0x5bfe68(0x1b7)];_0x54a54e++){const _0x60812c=_0x4d970a[_0x54a54e],_0x20797a=_0x60812c[_0x5bfe68(0x1db)][_0x5bfe68(0x1b7)]===0x1?_0x5bfe68(0x185):_0x5bfe68(0x1db),_0x4296a7=_0x60812c[_0x5bfe68(0x1bd)]?.['length']?'\x20['+_0x60812c[_0x5bfe68(0x1bd)][_0x5bfe68(0x19d)](',\x20')+']':'';console[_0x5bfe68(0x191)]('\x20\x20'+(_0x54a54e+0x1)+'.\x20'+a5_0x537b58[_0x5bfe68(0x18c)](_0x60812c['name'])+'\x20('+_0x60812c[_0x5bfe68(0x1db)]['length']+'\x20'+_0x20797a+')'+a5_0x537b58[_0x5bfe68(0x1b3)](_0x4296a7));}return 0x0;}let _0x10f420,_0x4a71ef;try{_0x10f420=await _0x5344a5[_0x5bfe68(0x1eb)][_0x5bfe68(0x15d)](_0x1aa594['projectName']);}catch(_0x598efb){const _0x323c3a=_0x598efb instanceof Error?_0x598efb[_0x5bfe68(0x1d2)]:String(_0x598efb);return _0x323c3a[_0x5bfe68(0x17f)](_0x5bfe68(0x1a9))||_0x323c3a[_0x5bfe68(0x17c)]()[_0x5bfe68(0x17f)](_0x5bfe68(0x181))?console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1af)](_0x5bfe68(0x1ef)+_0x1aa594[_0x5bfe68(0x157)])):console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1af)](_0x5bfe68(0x18e)+_0x1aa594[_0x5bfe68(0x157)]+_0x5bfe68(0x1a0)+_0x323c3a)),0x1;}try{_0x4a71ef=await _0x5344a5[_0x5bfe68(0x1eb)][_0x5bfe68(0x19c)](_0x1aa594[_0x5bfe68(0x183)],_0x10f420);}catch(_0x120e68){const _0x976ea2=_0x120e68 instanceof Error?_0x120e68[_0x5bfe68(0x1d2)]:String(_0x120e68);return _0x976ea2['includes'](_0x5bfe68(0x1a9))||_0x976ea2[_0x5bfe68(0x17c)]()[_0x5bfe68(0x17f)](_0x5bfe68(0x181))?console[_0x5bfe68(0x191)](a5_0x537b58['red'](_0x5bfe68(0x192)+_0x1aa594['agentName'])):console[_0x5bfe68(0x191)](a5_0x537b58['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x1aa594['agentName']+_0x5bfe68(0x1a0)+_0x976ea2)),0x1;}let _0x2b1b51;if(!_0x34fd9e)try{_0x2b1b51=await setupEvaluatorAgent(_0x5344a5['llm'],_0x2950de[_0x5bfe68(0x198)]);}catch(_0x1623f7){const _0x460e9=_0x1623f7 instanceof Error?_0x1623f7[_0x5bfe68(0x1d2)]:String(_0x1623f7);return console['log'](a5_0x537b58[_0x5bfe68(0x1af)](_0x5bfe68(0x17d)+_0x460e9)),0x1;}console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1ad)](_0x5bfe68(0x1e2))),console[_0x5bfe68(0x191)](_0x5bfe68(0x182)+a5_0x537b58[_0x5bfe68(0x18c)](_0x1b8056)),console[_0x5bfe68(0x191)](_0x5bfe68(0x1a5)+a5_0x537b58[_0x5bfe68(0x18c)](_0x1aa594[_0x5bfe68(0x157)]+'/'+_0x1aa594[_0x5bfe68(0x183)])),console[_0x5bfe68(0x191)]();const _0x20f54c=[],_0x9e31b=[],_0x4e74e7=Date[_0x5bfe68(0x19f)]();for(let _0x4ce43b=0x0;_0x4ce43b<_0x4d970a['length'];_0x4ce43b++){const _0x82fb49=_0x4d970a[_0x4ce43b];_0x4d970a['length']>0x1?console[_0x5bfe68(0x191)](_0x5bfe68(0x1ba)+(_0x4ce43b+0x1)+'/'+_0x4d970a[_0x5bfe68(0x1b7)]+':\x20'+a5_0x537b58['white'](_0x82fb49[_0x5bfe68(0x1dd)])):console[_0x5bfe68(0x191)](_0x5bfe68(0x1a6)+a5_0x537b58[_0x5bfe68(0x18c)](_0x82fb49['name']));const _0x1e37d7=createCommandSpinner('Round\x201/'+_0x82fb49[_0x5bfe68(0x1db)][_0x5bfe68(0x1b7)]+':\x20Sending\x20user\x20input...');_0x1e37d7[_0x5bfe68(0x18a)]();try{const {result:_0x1ac07c,conversation:_0x395dae}=await runTest(_0x5344a5['llm'],_0x82fb49,{'agentId':_0x4a71ef,'projectId':_0x10f420,'site':_0x1b8056,'noEval':_0x34fd9e,'evaluatorId':_0x2b1b51,'onRoundStart':(_0x413fb8,_0x5ecf81)=>{const _0x322634=_0x5bfe68;_0x1e37d7[_0x322634(0x15e)]=_0x322634(0x1aa)+(_0x413fb8+0x1)+'/'+_0x5ecf81+_0x322634(0x1bb);},'onRoundComplete':(_0x2ef883,_0x2f5804,_0xfe6e1d)=>{const _0x9eb970=_0x5bfe68,_0x312630=formatElapsed(_0x2f5804);_0xfe6e1d?console['log'](_0x9eb970(0x1a7)+(_0x2ef883+0x1)+'/'+_0x82fb49[_0x9eb970(0x1db)]['length']+_0x9eb970(0x1c0)+a5_0x537b58[_0x9eb970(0x1ca)]('✓')+'\x20('+_0x312630+')'):console[_0x9eb970(0x191)](_0x9eb970(0x1a7)+(_0x2ef883+0x1)+'/'+_0x82fb49[_0x9eb970(0x1db)][_0x9eb970(0x1b7)]+_0x9eb970(0x1c0)+a5_0x537b58[_0x9eb970(0x1af)]('✗'));},'onEvaluationStart':()=>{const _0x28f83e=_0x5bfe68;_0x1e37d7['text']=_0x28f83e(0x1a4);},'onEvaluationComplete':_0x1ec8a2=>{const _0x408a48=_0x5bfe68,_0x2738ca=formatElapsed(_0x1ec8a2);console[_0x408a48(0x191)](_0x408a48(0x1ec)+a5_0x537b58[_0x408a48(0x1ca)]('✓')+'\x20('+_0x2738ca+')');}});_0x1e37d7[_0x5bfe68(0x1d0)](),_0x20f54c[_0x5bfe68(0x17b)](_0x1ac07c),_0x9e31b[_0x5bfe68(0x17b)](_0x395dae);if(_0x1ac07c[_0x5bfe68(0x17e)]===_0x5bfe68(0x1b6))console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1ca)](_0x5bfe68(0x15c)+_0x1ac07c[_0x5bfe68(0x1cc)]));else _0x1ac07c[_0x5bfe68(0x17e)]===_0x5bfe68(0x1e0)?console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1af)](_0x5bfe68(0x1c8)+_0x1ac07c['reason'])):console[_0x5bfe68(0x191)](a5_0x537b58['red'](_0x5bfe68(0x15a)+_0x1ac07c[_0x5bfe68(0x1cc)]));_0x1ac07c[_0x5bfe68(0x161)]&&console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1b3)]('Conversation\x20URL:\x20'+_0x1ac07c[_0x5bfe68(0x161)])),console[_0x5bfe68(0x191)]();}catch(_0x1a52d8){_0x1e37d7[_0x5bfe68(0x1d0)]();const _0xfeb72a=_0x1a52d8 instanceof Error?_0x1a52d8[_0x5bfe68(0x1d2)]:String(_0x1a52d8);console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1af)]('✗\x20ERROR:\x20'+_0xfeb72a)),console[_0x5bfe68(0x191)](),_0x20f54c[_0x5bfe68(0x17b)]({'name':_0x82fb49[_0x5bfe68(0x1dd)],'status':_0x5bfe68(0x18f),'reason':_0xfeb72a,'timestamp':new Date()[_0x5bfe68(0x1bf)](),'duration_ms':0x0});}}const _0x8d0988=Date[_0x5bfe68(0x19f)]()-_0x4e74e7,_0x44b52d=_0x20f54c[_0x5bfe68(0x1b1)](_0x4da873=>_0x4da873[_0x5bfe68(0x17e)]===_0x5bfe68(0x1b6))['length'],_0x8ce72a=_0x20f54c[_0x5bfe68(0x1b1)](_0x3d4a15=>_0x3d4a15[_0x5bfe68(0x17e)]===_0x5bfe68(0x1e0))[_0x5bfe68(0x1b7)],_0x570153=_0x20f54c[_0x5bfe68(0x1b1)](_0x44a588=>_0x44a588[_0x5bfe68(0x17e)]===_0x5bfe68(0x18f))[_0x5bfe68(0x1b7)];console[_0x5bfe68(0x191)]('━'['repeat'](0x3c)),console[_0x5bfe68(0x191)]('Test\x20Summary'),console[_0x5bfe68(0x191)]('━'[_0x5bfe68(0x1c2)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x20f54c['length']),console[_0x5bfe68(0x191)](_0x5bfe68(0x1b8)+a5_0x537b58[_0x5bfe68(0x1ca)](_0x44b52d)),console[_0x5bfe68(0x191)](_0x5bfe68(0x1b9)+a5_0x537b58[_0x5bfe68(0x1af)](_0x8ce72a));_0x570153>0x0&&console[_0x5bfe68(0x191)](_0x5bfe68(0x177)+a5_0x537b58[_0x5bfe68(0x1af)](_0x570153));console[_0x5bfe68(0x191)](_0x5bfe68(0x1cf)+formatElapsed(_0x8d0988)),console[_0x5bfe68(0x191)]('━'[_0x5bfe68(0x1c2)](0x3c));const _0x109b85=_0x20f54c[_0x5bfe68(0x1b1)](_0xdcb7fb=>_0xdcb7fb['status']!=='PASS');if(_0x109b85[_0x5bfe68(0x1b7)]>0x0){console['log'](),console['log'](_0x5bfe68(0x1ea));for(const _0x31a23a of _0x109b85){const _0x1c736d=a5_0x537b58[_0x5bfe68(0x1af)]('✗'),_0x2ed75b=_0x31a23a[_0x5bfe68(0x1cc)][_0x5bfe68(0x1b7)]>0x32?_0x31a23a[_0x5bfe68(0x1cc)][_0x5bfe68(0x164)](0x0,0x32)+_0x5bfe68(0x1d4):_0x31a23a['reason'];console[_0x5bfe68(0x191)]('\x20\x20'+_0x1c736d+'\x20'+_0x31a23a[_0x5bfe68(0x1dd)]+':\x20'+_0x2ed75b);}}const _0x642630={'summary':{'total':_0x20f54c[_0x5bfe68(0x1b7)],'passed':_0x44b52d,'failed':_0x8ce72a,'errors':_0x570153>0x0?_0x570153:undefined,'duration_ms':_0x8d0988},'tests':_0x20f54c,'agent':{'project':_0x1aa594[_0x5bfe68(0x157)],'name':_0x1aa594[_0x5bfe68(0x183)],'site':_0x1b8056},'timestamp':new Date(_0x4e74e7)[_0x5bfe68(0x1bf)]()};try{const _0x33499d=buildCachedTestRun(_0x9e31b,{'site':_0x1b8056,'projectId':_0x10f420,'projectName':_0x1aa594[_0x5bfe68(0x157)],'agentId':_0x4a71ef,'agentName':_0x1aa594[_0x5bfe68(0x183)],'testYmlPath':a5_0x3716a6['resolve'](_0x1aa594[_0x5bfe68(0x16e)])});saveLastTestRun(_0x33499d);}catch{}if(_0x1c708b!=='table'||_0x3dde93){const _0x200c7e=formatResults(_0x642630,_0x1c708b);if(_0x3dde93)try{a5_0xea5d50[_0x5bfe68(0x166)](_0x3dde93,_0x200c7e,_0x5bfe68(0x1ac)),console['log'](),console['log'](a5_0x537b58['dim']('Output\x20written\x20to:\x20'+_0x3dde93));}catch(_0x2777bf){return console[_0x5bfe68(0x191)](),console[_0x5bfe68(0x191)](a5_0x537b58[_0x5bfe68(0x1af)]('Error\x20writing\x20output\x20file:\x20'+_0x2777bf)),0x1;}else console['log'](),console['log'](_0x200c7e);}return _0x109b85[_0x5bfe68(0x1b7)]>0x0?0x1:0x0;}async['executeReeval'](_0x3b490d,_0xb5bc0f){const _0xf3d3e2=a5_0x2c7e5d,{options:_0x17d48d,tdx:_0x312358}=_0x3b490d,{definition:_0x557dc2,agentInfo:_0x168910,outputFormat:_0x45bc9b,outputFile:_0x2c6940}=_0xb5bc0f,_0x46a7d1=_0x17d48d['site'],_0x5a21a9=loadLastTestRun();if(!_0x5a21a9)return console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1af)](_0xf3d3e2(0x1cb))),console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1b3)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x5a21a9[_0xf3d3e2(0x15f)][_0xf3d3e2(0x183)]!==_0x168910[_0xf3d3e2(0x183)])return console['log'](a5_0x537b58['red'](_0xf3d3e2(0x199)+_0x5a21a9['agent'][_0xf3d3e2(0x183)]+_0xf3d3e2(0x165)+_0x168910[_0xf3d3e2(0x183)]+'\x22.')),console[_0xf3d3e2(0x191)](a5_0x537b58['dim'](_0xf3d3e2(0x16b))),0x1;const _0x29480b=new Set(_0x5a21a9['conversations'][_0xf3d3e2(0x187)](_0x155cfb=>_0x155cfb[_0xf3d3e2(0x16f)])),_0x340826=_0x557dc2[_0xf3d3e2(0x1c5)][_0xf3d3e2(0x1b1)](_0x5cb4a8=>!_0x29480b[_0xf3d3e2(0x1e3)](_0x5cb4a8[_0xf3d3e2(0x1dd)]));if(_0x340826[_0xf3d3e2(0x1b7)]>0x0&&_0x5a21a9[_0xf3d3e2(0x16c)]!==_0x46a7d1)return console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1af)](_0xf3d3e2(0x1c1))),console[_0xf3d3e2(0x191)](a5_0x537b58['dim'](_0xf3d3e2(0x190)+_0x5a21a9[_0xf3d3e2(0x16c)]+_0xf3d3e2(0x156)+_0x46a7d1+'\x22.')),console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1b3)](_0xf3d3e2(0x197)+_0x5a21a9[_0xf3d3e2(0x16c)]+_0xf3d3e2(0x1da))),0x1;const _0x3d9b71=_0x557dc2['tests']['filter'](_0x471203=>_0x29480b[_0xf3d3e2(0x1e3)](_0x471203[_0xf3d3e2(0x1dd)])),_0x58f25f=_0x340826;let _0x2d8dee;try{_0x2d8dee=await setupEvaluatorAgent(_0x312358[_0xf3d3e2(0x1eb)],_0x17d48d[_0xf3d3e2(0x198)]);}catch(_0x140c51){const _0x3c5d46=_0x140c51 instanceof Error?_0x140c51[_0xf3d3e2(0x1d2)]:String(_0x140c51);return console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1af)](_0xf3d3e2(0x17d)+_0x3c5d46)),0x1;}console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1ad)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0xf3d3e2(0x191)](_0xf3d3e2(0x159)+a5_0x537b58[_0xf3d3e2(0x18c)](_0x5a21a9['timestamp'])),console[_0xf3d3e2(0x191)](_0xf3d3e2(0x1a5)+a5_0x537b58['white'](_0x5a21a9[_0xf3d3e2(0x15f)][_0xf3d3e2(0x157)]+'/'+_0x5a21a9['agent']['agentName']));_0x58f25f[_0xf3d3e2(0x1b7)]>0x0&&console[_0xf3d3e2(0x191)](_0xf3d3e2(0x15b)+a5_0x537b58[_0xf3d3e2(0x176)](_0x58f25f['length']));console[_0xf3d3e2(0x191)]();const _0x24d9fa=[],_0x163013=Date[_0xf3d3e2(0x19f)](),_0x4f2815=createCommandSpinner(_0xf3d3e2(0x1d1));if(_0x3d9b71[_0xf3d3e2(0x1b7)]>0x0)try{const _0x1e9fc9=await reevaluateFromCache(_0x312358[_0xf3d3e2(0x1eb)],_0x5a21a9,{'tests':_0x3d9b71},{'evaluatorId':_0x2d8dee,'onTestStart':(_0x15ff1e,_0x1cec3c,_0x5a22f7)=>{const _0x22ddef=_0xf3d3e2;_0x4f2815[_0x22ddef(0x15e)]=_0x22ddef(0x1b4)+(_0x1cec3c+0x1)+'/'+_0x5a22f7+':\x20'+_0x15ff1e+_0x22ddef(0x1d4);if(!_0x4f2815[_0x22ddef(0x1c3)])_0x4f2815[_0x22ddef(0x18a)]();},'onTestComplete':(_0x2b3a91,_0x14aa88)=>{const _0x5a8dc8=_0xf3d3e2;_0x4f2815[_0x5a8dc8(0x1d0)]();if(_0x14aa88[_0x5a8dc8(0x17e)]===_0x5a8dc8(0x1b6))console[_0x5a8dc8(0x191)](a5_0x537b58[_0x5a8dc8(0x1ca)](_0x5a8dc8(0x15c)+_0x2b3a91)+a5_0x537b58[_0x5a8dc8(0x1b3)](_0x5a8dc8(0x1e5)));else _0x14aa88['status']===_0x5a8dc8(0x1e0)?console[_0x5a8dc8(0x191)](a5_0x537b58[_0x5a8dc8(0x1af)]('✗\x20FAIL:\x20'+_0x2b3a91+_0x5a8dc8(0x18d)+_0x14aa88[_0x5a8dc8(0x1cc)])+a5_0x537b58[_0x5a8dc8(0x1b3)](_0x5a8dc8(0x1e5))):console[_0x5a8dc8(0x191)](a5_0x537b58[_0x5a8dc8(0x1af)](_0x5a8dc8(0x15a)+_0x2b3a91+_0x5a8dc8(0x18d)+_0x14aa88['reason']));_0x14aa88[_0x5a8dc8(0x161)]&&console[_0x5a8dc8(0x191)](a5_0x537b58[_0x5a8dc8(0x1b3)]('\x20\x20Conversation:\x20'+_0x14aa88[_0x5a8dc8(0x161)])),_0x24d9fa[_0x5a8dc8(0x17b)](_0x14aa88);},'onTestSkipped':(_0x4e4eb5,_0x5348c6)=>{const _0x406513=_0xf3d3e2;_0x4f2815[_0x406513(0x1d0)](),console[_0x406513(0x191)](a5_0x537b58['yellow'](_0x406513(0x1a2)+_0x4e4eb5+_0x406513(0x18d)+_0x5348c6));}});for(const _0xe5ea3f of _0x1e9fc9){!_0x24d9fa[_0xf3d3e2(0x171)](_0x2d7c95=>_0x2d7c95['name']===_0xe5ea3f[_0xf3d3e2(0x1dd)])&&_0x24d9fa[_0xf3d3e2(0x17b)](_0xe5ea3f);}}catch(_0x44eea0){_0x4f2815[_0xf3d3e2(0x1d0)]();const _0x4bc150=_0x44eea0 instanceof Error?_0x44eea0[_0xf3d3e2(0x1d2)]:String(_0x44eea0);return console[_0xf3d3e2(0x191)](a5_0x537b58['red'](_0xf3d3e2(0x160)+_0x4bc150)),0x1;}_0x4f2815[_0xf3d3e2(0x1d0)]();if(_0x58f25f[_0xf3d3e2(0x1b7)]>0x0){console[_0xf3d3e2(0x191)](),console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1ad)](_0xf3d3e2(0x167)));const {projectId:_0x31ea2f,agentId:_0x2b0e53}=_0x5a21a9[_0xf3d3e2(0x15f)];for(const _0x1f0884 of _0x58f25f){console[_0xf3d3e2(0x191)](_0xf3d3e2(0x1d3)+a5_0x537b58['white'](_0x1f0884['name']));const _0x456e70=createCommandSpinner(_0xf3d3e2(0x194)+_0x1f0884[_0xf3d3e2(0x1db)][_0xf3d3e2(0x1b7)]+_0xf3d3e2(0x1bb));_0x456e70[_0xf3d3e2(0x18a)]();try{const {result:_0x430a5b}=await runTest(_0x312358[_0xf3d3e2(0x1eb)],_0x1f0884,{'agentId':_0x2b0e53,'projectId':_0x31ea2f,'site':_0x5a21a9[_0xf3d3e2(0x16c)],'noEval':![],'evaluatorId':_0x2d8dee,'onRoundStart':(_0x8bae44,_0x2262d4)=>{const _0x24ecef=_0xf3d3e2;_0x456e70[_0x24ecef(0x15e)]=_0x24ecef(0x1aa)+(_0x8bae44+0x1)+'/'+_0x2262d4+_0x24ecef(0x1bb);},'onRoundComplete':(_0x510731,_0x1f4365,_0x2803e8)=>{const _0x2785b2=_0xf3d3e2,_0x3f25d6=formatElapsed(_0x1f4365);_0x2803e8?console[_0x2785b2(0x191)](_0x2785b2(0x1a7)+(_0x510731+0x1)+'/'+_0x1f0884[_0x2785b2(0x1db)][_0x2785b2(0x1b7)]+'...\x20'+a5_0x537b58[_0x2785b2(0x1ca)]('✓')+'\x20('+_0x3f25d6+')'):console[_0x2785b2(0x191)]('\x20\x20Round\x20'+(_0x510731+0x1)+'/'+_0x1f0884['rounds'][_0x2785b2(0x1b7)]+_0x2785b2(0x1c0)+a5_0x537b58['red']('✗'));},'onEvaluationStart':()=>{const _0x3c6220=_0xf3d3e2;_0x456e70[_0x3c6220(0x15e)]=_0x3c6220(0x1a4);},'onEvaluationComplete':_0x42aa94=>{const _0x54c8d3=_0xf3d3e2,_0x195988=formatElapsed(_0x42aa94);console[_0x54c8d3(0x191)]('\x20\x20Evaluating...\x20'+a5_0x537b58[_0x54c8d3(0x1ca)]('✓')+'\x20('+_0x195988+')');}});_0x456e70['stop'](),_0x24d9fa[_0xf3d3e2(0x17b)](_0x430a5b);if(_0x430a5b['status']===_0xf3d3e2(0x1b6))console['log'](a5_0x537b58['green'](_0xf3d3e2(0x15c)+_0x430a5b[_0xf3d3e2(0x1cc)])+a5_0x537b58[_0xf3d3e2(0x1b3)](_0xf3d3e2(0x19b)));else _0x430a5b[_0xf3d3e2(0x17e)]==='FAIL'?console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1af)](_0xf3d3e2(0x1c8)+_0x430a5b['reason'])+a5_0x537b58[_0xf3d3e2(0x1b3)](_0xf3d3e2(0x19b))):console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1af)](_0xf3d3e2(0x15a)+_0x430a5b['reason']));_0x430a5b[_0xf3d3e2(0x161)]&&console[_0xf3d3e2(0x191)](a5_0x537b58['dim']('\x20\x20Conversation:\x20'+_0x430a5b[_0xf3d3e2(0x161)]));}catch(_0x4bc643){_0x456e70['stop']();const _0x1562a2=_0x4bc643 instanceof Error?_0x4bc643['message']:String(_0x4bc643);console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1af)](_0xf3d3e2(0x15a)+_0x1562a2)),_0x24d9fa[_0xf3d3e2(0x17b)]({'name':_0x1f0884['name'],'status':_0xf3d3e2(0x18f),'reason':_0x1562a2,'timestamp':new Date()[_0xf3d3e2(0x1bf)](),'duration_ms':0x0});}}}console[_0xf3d3e2(0x191)]();const _0x14dd34=Date[_0xf3d3e2(0x19f)]()-_0x163013,_0x1ed3ad=_0x24d9fa[_0xf3d3e2(0x1b1)](_0x27f4af=>_0x27f4af[_0xf3d3e2(0x17e)]===_0xf3d3e2(0x1b6))[_0xf3d3e2(0x1b7)],_0x173238=_0x24d9fa[_0xf3d3e2(0x1b1)](_0x388b86=>_0x388b86[_0xf3d3e2(0x17e)]===_0xf3d3e2(0x1e0))[_0xf3d3e2(0x1b7)],_0x4e5dba=_0x24d9fa['filter'](_0x4eefe5=>_0x4eefe5['status']===_0xf3d3e2(0x18f))['length'];console[_0xf3d3e2(0x191)]('━'[_0xf3d3e2(0x1c2)](0x3c)),console[_0xf3d3e2(0x191)](_0xf3d3e2(0x19e)),console[_0xf3d3e2(0x191)]('━'[_0xf3d3e2(0x1c2)](0x3c)),console['log'](_0xf3d3e2(0x1a3)+_0x24d9fa['length']),console[_0xf3d3e2(0x191)](_0xf3d3e2(0x1b8)+a5_0x537b58[_0xf3d3e2(0x1ca)](_0x1ed3ad)),console['log'](_0xf3d3e2(0x1b9)+a5_0x537b58['red'](_0x173238));_0x4e5dba>0x0&&console[_0xf3d3e2(0x191)](_0xf3d3e2(0x177)+a5_0x537b58['red'](_0x4e5dba));console[_0xf3d3e2(0x191)](_0xf3d3e2(0x1cf)+formatElapsed(_0x14dd34)),console[_0xf3d3e2(0x191)]('━'['repeat'](0x3c));const _0x30cbae={'summary':{'total':_0x24d9fa[_0xf3d3e2(0x1b7)],'passed':_0x1ed3ad,'failed':_0x173238,'errors':_0x4e5dba>0x0?_0x4e5dba:undefined,'duration_ms':_0x14dd34},'tests':_0x24d9fa,'agent':{'project':_0x168910[_0xf3d3e2(0x157)],'name':_0x168910['agentName'],'site':_0x46a7d1},'timestamp':new Date(_0x163013)[_0xf3d3e2(0x1bf)]()};if(_0x45bc9b!==_0xf3d3e2(0x1d8)||_0x2c6940){const _0x491dce=formatResults(_0x30cbae,_0x45bc9b);if(_0x2c6940)try{a5_0xea5d50[_0xf3d3e2(0x166)](_0x2c6940,_0x491dce,_0xf3d3e2(0x1ac)),console[_0xf3d3e2(0x191)](),console['log'](a5_0x537b58['dim'](_0xf3d3e2(0x1ab)+_0x2c6940));}catch(_0x431ca8){return console['log'](),console[_0xf3d3e2(0x191)](a5_0x537b58[_0xf3d3e2(0x1af)](_0xf3d3e2(0x1e9)+_0x431ca8)),0x1;}else console['log'](),console['log'](_0x491dce);}const _0x5bcacb=_0x24d9fa[_0xf3d3e2(0x1b1)](_0x385d78=>_0x385d78[_0xf3d3e2(0x17e)]!==_0xf3d3e2(0x1b6));return _0x5bcacb[_0xf3d3e2(0x1b7)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x58be77=a6_0x55e0;(function(_0x3fe419,_0x5169a9){const _0x36f236=a6_0x55e0,_0x4f2e48=_0x3fe419();while(!![]){try{const _0x43145a=-parseInt(_0x36f236(0x165))/0x1*(-parseInt(_0x36f236(0x163))/0x2)+parseInt(_0x36f236(0x185))/0x3*(-parseInt(_0x36f236(0x161))/0x4)+parseInt(_0x36f236(0x181))/0x5*(parseInt(_0x36f236(0x193))/0x6)+parseInt(_0x36f236(0x174))/0x7+-parseInt(_0x36f236(0x16d))/0x8+-parseInt(_0x36f236(0x182))/0x9*(parseInt(_0x36f236(0x188))/0xa)+parseInt(_0x36f236(0x195))/0xb*(parseInt(_0x36f236(0x15d))/0xc);if(_0x43145a===_0x5169a9)break;else _0x4f2e48['push'](_0x4f2e48['shift']());}catch(_0x558733){_0x4f2e48['push'](_0x4f2e48['shift']());}}}(a6_0x160c,0x1871f));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x58be77(0x199),a6_0x58be77(0x171),a6_0x58be77(0x180),a6_0x58be77(0x16c),a6_0x58be77(0x15b),a6_0x58be77(0x162),a6_0x58be77(0x157),'x-trino-user']);function a6_0x160c(){const _0x860609=['POST','Endpoint\x20must\x20start\x20with\x20/:\x20','output','set-cookie','466832OwULsa','toUpperCase','PUT','\x0aStack\x20trace:\x0a','proxy-authorization','substring','message','118167aJobGT','join','includes','headers','data','verbose','.\x20Valid\x20methods:\x20','execute','method','file','description','toLowerCase','cookie','734225gMLpHj','90xEcABt','type','error','18831AaJAzT','Error:\x20','DELETE','167240mCbori','startsWith','request','llm','stack','<\x20HTTP/1.1\x20','header','PATCH','noColor','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','api','6uhVptw','entries','167882OCvyNo','llm-proxy','trino','color','authorization','log','has','x-auth-token','GET','readBodyFromFile','validate','set-cookie2','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','264etfBOD','site','.\x20Valid\x20types:\x20','cas','112ineLGR','x-xsrf-token','2nwgPwZ','length','1987ZVTtvm','workflow','trim','Invalid\x20API\x20type:\x20'];a6_0x160c=function(){return _0x860609;};return a6_0x160c();}function a6_0x55e0(_0x1e0a60,_0x14c2b3){_0x1e0a60=_0x1e0a60-0x157;const _0x160cef=a6_0x160c();let _0x55e091=_0x160cef[_0x1e0a60];return _0x55e091;}function isSensitiveHeader(_0x523149){const _0x1ae690=a6_0x58be77;return SENSITIVE_HEADERS[_0x1ae690(0x19b)](_0x523149[_0x1ae690(0x17f)]());}function parseHeader(_0x1d3c27){const _0x2dff12=a6_0x58be77,_0x520c1b=_0x1d3c27['indexOf'](':');if(_0x520c1b===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x1d3c27+'\x22.\x20'+_0x2dff12(0x15c));const _0x36bc60=_0x1d3c27[_0x2dff12(0x172)](0x0,_0x520c1b)[_0x2dff12(0x167)](),_0x2f991d=_0x1d3c27[_0x2dff12(0x172)](_0x520c1b+0x1)['trim']();if(!_0x36bc60)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x1d3c27+'\x22');return[_0x36bc60,_0x2f991d];}export class ApiCommand extends BaseCommand{['name']=a6_0x58be77(0x192);[a6_0x58be77(0x17e)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x58be77(0x15a)](_0x26dc6b){const _0x3062d0=a6_0x58be77,{args:_0x2dcd34,options:_0xd283f5}=_0x26dc6b,_0x1f2651=_0xd283f5;if(_0x2dcd34[_0x3062d0(0x164)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2fe3ad=_0x2dcd34[0x0];if(!_0x2fe3ad[_0x3062d0(0x189)]('/'))return _0x3062d0(0x16a)+_0x2fe3ad;const _0x4e17c4=_0x1f2651['data'],_0x2856ea=_0x1f2651[_0x3062d0(0x17d)];if(_0x4e17c4&&_0x2856ea)return _0x3062d0(0x191);const _0x369ade=_0x1f2651[_0x3062d0(0x17c)]||'GET',_0x336f58=[_0x3062d0(0x158),_0x3062d0(0x169),_0x3062d0(0x16f),_0x3062d0(0x187),_0x3062d0(0x18f)];if(!_0x336f58['includes'](_0x369ade['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x369ade+_0x3062d0(0x17a)+_0x336f58[_0x3062d0(0x175)](',\x20');const _0x5f1d12=_0x1f2651['type']||'td',_0x416bb9=['td','cdp',_0x3062d0(0x166),_0x3062d0(0x197),_0x3062d0(0x18b),_0x3062d0(0x196),_0x3062d0(0x160)];if(!_0x416bb9[_0x3062d0(0x176)](_0x5f1d12))return _0x3062d0(0x168)+_0x5f1d12+_0x3062d0(0x15f)+_0x416bb9[_0x3062d0(0x175)](',\x20');return undefined;}async[a6_0x58be77(0x17b)](_0x1b8d45){const _0x2c40f4=a6_0x58be77,{options:_0x168d2e,args:_0x54a0b1,tdx:_0x29d9d7}=_0x1b8d45,_0x1de4f7=_0x168d2e,_0x295957=_0x54a0b1[0x0],_0x9b8dee=(_0x1de4f7[_0x2c40f4(0x17c)]||'GET')[_0x2c40f4(0x16e)](),_0x59b0f5=_0x1de4f7[_0x2c40f4(0x178)],_0x10ad36=_0x1de4f7[_0x2c40f4(0x17d)],_0x35b830=_0x1de4f7[_0x2c40f4(0x18e)],_0x3806f6=_0x1de4f7[_0x2c40f4(0x183)]||'td';try{const _0x5d20f9={};if(_0x35b830){const _0x4df97b=Array['isArray'](_0x35b830)?_0x35b830:[_0x35b830];for(const _0x4da6fa of _0x4df97b){const [_0x463d4d,_0x21b673]=parseHeader(_0x4da6fa);_0x5d20f9[_0x463d4d]=_0x21b673;}}let _0x4ae5c4;if(_0x59b0f5)_0x4ae5c4=_0x59b0f5;else{if(_0x10ad36)try{_0x4ae5c4=RawAPI[_0x2c40f4(0x159)](_0x10ad36);}catch(_0x14a46f){return console[_0x2c40f4(0x184)](_0x2c40f4(0x186)+(_0x14a46f instanceof Error?_0x14a46f[_0x2c40f4(0x173)]:String(_0x14a46f))),0x1;}}const _0x25d07d={'method':_0x9b8dee,'apiType':_0x3806f6,'includeHeaders':_0x168d2e[_0x2c40f4(0x179)]};_0x4ae5c4&&(_0x25d07d['body']=_0x4ae5c4);Object['keys'](_0x5d20f9)[_0x2c40f4(0x164)]>0x0&&(_0x25d07d[_0x2c40f4(0x177)]=_0x5d20f9);if(_0x168d2e['verbose']){const _0x333f35=resolveSite(_0x168d2e[_0x2c40f4(0x15e)]),_0x490ff2=getEndpoint(_0x333f35,_0x3806f6),_0x2b2294=''+_0x490ff2+_0x295957;console['error']('>\x20'+_0x9b8dee+'\x20'+_0x2b2294);const _0x58d477=getAuthHeaders(_0x333f35),_0xfdf88c={..._0x58d477,..._0x5d20f9};for(const [_0x40c8f1,_0x27a3ab]of Object[_0x2c40f4(0x194)](_0xfdf88c)){!isSensitiveHeader(_0x40c8f1)&&console[_0x2c40f4(0x184)]('>\x20'+_0x40c8f1+':\x20'+_0x27a3ab);}_0x4ae5c4&&console[_0x2c40f4(0x184)]('>'),console[_0x2c40f4(0x184)]('');}const _0x4fd573=await _0x29d9d7[_0x2c40f4(0x192)][_0x2c40f4(0x18a)](_0x295957,_0x25d07d);if(_0x168d2e[_0x2c40f4(0x179)]&&_0x4fd573[_0x2c40f4(0x177)]){console[_0x2c40f4(0x184)](_0x2c40f4(0x18d)+_0x4fd573['status']);for(const [_0x1964cc,_0x19a596]of Object['entries'](_0x4fd573[_0x2c40f4(0x177)])){!isSensitiveHeader(_0x1964cc)&&console['error']('<\x20'+_0x1964cc+':\x20'+_0x19a596);}console[_0x2c40f4(0x184)]('');}const _0x157340=Boolean(_0x168d2e[_0x2c40f4(0x16b)]),_0xcbb13={'color':_0x168d2e[_0x2c40f4(0x198)],'noColor':_0x168d2e[_0x2c40f4(0x190)]||_0x157340&&!_0x168d2e['color']},_0x4fbfdd=colorizeJSON(_0x4fd573['data'],_0xcbb13);return _0x168d2e[_0x2c40f4(0x16b)]?(writeFileSync(_0x168d2e[_0x2c40f4(0x16b)],_0x4fbfdd),console[_0x2c40f4(0x184)]('Results\x20saved\x20to\x20'+_0x168d2e[_0x2c40f4(0x16b)])):console[_0x2c40f4(0x19a)](_0x4fbfdd),0x0;}catch(_0x27a3f4){return _0x27a3f4 instanceof Error?(console[_0x2c40f4(0x184)]('Error:\x20'+_0x27a3f4[_0x2c40f4(0x173)]),_0x168d2e[_0x2c40f4(0x179)]&&_0x27a3f4[_0x2c40f4(0x18c)]&&console[_0x2c40f4(0x184)](_0x2c40f4(0x170)+_0x27a3f4[_0x2c40f4(0x18c)])):console['error'](_0x2c40f4(0x186)+String(_0x27a3f4)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x4bfcdf=a7_0x2383;(function(_0x56330d,_0x467928){const _0x194fcc=a7_0x2383,_0x5946c6=_0x56330d();while(!![]){try{const _0x34b011=parseInt(_0x194fcc(0x1b0))/0x1*(-parseInt(_0x194fcc(0x1bf))/0x2)+parseInt(_0x194fcc(0x1d6))/0x3*(parseInt(_0x194fcc(0x1cf))/0x4)+parseInt(_0x194fcc(0x1c6))/0x5+-parseInt(_0x194fcc(0x1dc))/0x6+parseInt(_0x194fcc(0x1d5))/0x7+parseInt(_0x194fcc(0x1b9))/0x8+-parseInt(_0x194fcc(0x197))/0x9*(-parseInt(_0x194fcc(0x1c8))/0xa);if(_0x34b011===_0x467928)break;else _0x5946c6['push'](_0x5946c6['shift']());}catch(_0x33d8b9){_0x5946c6['push'](_0x5946c6['shift']());}}}(a7_0x1054,0x704ec));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0xaa48b7 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a7_0x1054(){const _0xdd086b=['logLevel','\x20removed\x20from\x20keychain','No\x20credential\x20found','5351172mNSeYO','error','profile','method','Enter\x20your\x20TD\x20API\x20key:','Setup\x20API\x20key\x20authentication\x20interactively','oauth','User:\x20','OAuth\x20tokens','N/A','join','Credential\x20type:\x20OAuth','1017TZeYMR','password','log','\x20--profile\x20','red','warn','API\x20Key','status','email','us01','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','description','\x20(site:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','green','jobs','Name:\x20','site','Setup\x20cancelled','✓\x20Default\x20site\x20set\x20to\x20','trim','apiKey','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','Read\x20credential\x20from\x20keychain','1JhFyMP','Choose\x20authentication\x20method:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Profile\x20\x27','\x27\x20registered','No\x20credentials\x20found\x20in\x20keychain','getUserInfo','create','message','5520032KryKoG','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Read\x20credential\x20from\x20','/app/mp/ak','System\x20keychain\x20is\x20not\x20available','filter','1033494yYIQFp','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x0aSetup\x20cancelled','bold','\x20(profile:\x20','ERROR','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','493370dbxwEZ','execute','75840KXxROD','API\x20key\x20cannot\x20be\x20empty','Validating\x20API\x20key...','yellow','Remove\x20API\x20key\x20from\x20system\x20keychain','OAuth\x20(browser\x20login)','auth:setup','4408nIYSEA','auth:clear','tdx\x20profile:\x20','name','auth','last_name','727545DgOkSB','324jSUwID','apikey','\x20for\x20profile:\x20'];a7_0x1054=function(){return _0xdd086b;};return a7_0x1054();}import a7_0x1a9ee9 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4bfcdf(0x1d2)]=a7_0x4bfcdf(0x1ce);[a7_0x4bfcdf(0x1a2)]=a7_0x4bfcdf(0x1e1);async[a7_0x4bfcdf(0x1c7)](_0x814a98){const _0x478b89=a7_0x4bfcdf,{options:_0x434fd4}=_0x814a98,_0x12e6ab=_0x434fd4[_0x478b89(0x1de)];console[_0x478b89(0x199)](a7_0x1a9ee9[_0x478b89(0x1c2)]('tdx:\x20auth\x20setup'));const _0x59e22c=_0x434fd4['site']||_0x478b89(0x1a0),_0xcbdcfb=await promptSiteSelection(_0x59e22c,_0x12e6ab,_0x478b89(0x1a9));if(!_0xcbdcfb)return 0x1;const _0x51a7d1=resolveSite(_0xcbdcfb);if(isOAuthSupported(_0x51a7d1)){const _0x9a733=await a7_0xaa48b7({'type':'select','name':_0x478b89(0x1df),'message':_0x478b89(0x1b1),'choices':[{'title':_0x478b89(0x1cd),'value':_0x478b89(0x1e2)},{'title':_0x478b89(0x19d),'value':_0x478b89(0x1d7)}]});if(!_0x9a733[_0x478b89(0x1df)])return console[_0x478b89(0x199)](_0x478b89(0x1c1)),0x1;if(_0x9a733[_0x478b89(0x1df)]===_0x478b89(0x1e2))return await runOAuthLoginFlow(_0x51a7d1,_0x12e6ab,_0x434fd4[_0x478b89(0x1d9)]??LogLevel['ERROR']),0x0;}console[_0x478b89(0x199)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x51a7d1),console[_0x478b89(0x199)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x51a7d1,_0x478b89(0x1bc)));const _0x33e0c4=await a7_0xaa48b7({'type':_0x478b89(0x198),'name':_0x478b89(0x1ac),'message':_0x478b89(0x1e0),'validate':_0x3b6a25=>{const _0xd58602=_0x478b89;if(!_0x3b6a25||!_0x3b6a25[_0xd58602(0x1ab)]())return _0xd58602(0x1c9);return!![];}});if(!_0x33e0c4[_0x478b89(0x1ac)])return console[_0x478b89(0x199)](_0x478b89(0x1c1)),0x1;const _0x5103c9=_0x33e0c4[_0x478b89(0x1ac)];console[_0x478b89(0x199)](_0x478b89(0x1ca));try{const _0x5989e6=TDX[_0x478b89(0x1b7)]({'site':_0x51a7d1,'apiKey':_0x5103c9['trim'](),'logLevel':_0x434fd4[_0x478b89(0x1d9)]??LogLevel[_0x478b89(0x1c4)]}),_0x35d1b5=await _0x5989e6[_0x478b89(0x1a6)]['getUserInfo']();console[_0x478b89(0x199)](_0x478b89(0x1ad)+_0x35d1b5[_0x478b89(0x19f)]+')');const _0x3a45f0=await isKeychainAvailable();_0x3a45f0?(await saveAPIKeyAsync(_0x5103c9[_0x478b89(0x1ab)](),_0x51a7d1,_0x12e6ab),console[_0x478b89(0x199)](_0x478b89(0x1c5)+(_0x12e6ab?'\x20(profile:\x20'+_0x12e6ab+')':''))):(console[_0x478b89(0x19c)](a7_0x1a9ee9['yellow'](_0x478b89(0x1a1))),console[_0x478b89(0x19c)](a7_0x1a9ee9[_0x478b89(0x1cb)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x12e6ab){const _0x5407e3={'site':_0x51a7d1};saveProfileToUserConfig(_0x12e6ab,_0x5407e3),console[_0x478b89(0x199)](_0x478b89(0x1b3)+_0x12e6ab+_0x478b89(0x1b4));}else saveDefaultSiteToUserConfig(_0x51a7d1),console['log'](_0x478b89(0x1aa)+_0x51a7d1);const _0x4868e9=_0x12e6ab?_0x478b89(0x19a)+_0x12e6ab:'';return console['log'](),console[_0x478b89(0x199)](_0x478b89(0x1c0)),console[_0x478b89(0x199)]('\x20\x20tdx'+_0x4868e9+_0x478b89(0x1a4)),console[_0x478b89(0x199)]('\x20\x20tdx'+_0x4868e9+_0x478b89(0x1b2)),0x0;}catch(_0x5940fa){if(_0x5940fa instanceof HTTPClientError&&_0x5940fa[_0x478b89(0x19e)]===0x191)return printAuthError(_0x5940fa),0x1;return console['error'](a7_0x1a9ee9[_0x478b89(0x19b)]('✗\x20Validation\x20failed:\x20'+(_0x5940fa instanceof Error?_0x5940fa[_0x478b89(0x1b8)]:String(_0x5940fa)))),console[_0x478b89(0x1dd)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x4bfcdf(0x1d2)]=a7_0x4bfcdf(0x1d3);[a7_0x4bfcdf(0x1a2)]=a7_0x4bfcdf(0x1ba);async[a7_0x4bfcdf(0x1c7)](_0x1e92e2){const _0x23f1d3=a7_0x4bfcdf,{options:_0x55f1dc,tdx:_0x2f9bbf}=_0x1e92e2,_0x30003e=_0x55f1dc[_0x23f1d3(0x1a8)],_0x36844b=_0x55f1dc['profile'],_0x3b769d=_0x36844b?_0x36844b:_0x23f1d3(0x194);console[_0x23f1d3(0x199)](_0x23f1d3(0x1d1)+_0x3b769d+_0x23f1d3(0x1a3)+_0x30003e+')');const _0x4eb13c=await getOAuthTokens(_0x36844b);if(_0x4eb13c)console['log'](_0x23f1d3(0x196)),console['log'](_0x23f1d3(0x1af)+(_0x36844b?'\x20(profile:\x20'+_0x36844b+')':''));else{const _0x3f4c2c=await resolveAPIKeyAsync(_0x30003e,_0x36844b);if(_0x3f4c2c){const {source:_0x46ebb6,isDeprecated:_0xfa19a3}=_0x3f4c2c,_0x39b4ed=_0x23f1d3(0x1bb)+_0x46ebb6;console['log'](_0xfa19a3?a7_0x1a9ee9[_0x23f1d3(0x1cb)](_0x39b4ed):_0x39b4ed);}else console[_0x23f1d3(0x199)](a7_0x1a9ee9[_0x23f1d3(0x1cb)](_0x23f1d3(0x1db)));}try{const _0x147ec7=await _0x2f9bbf[_0x23f1d3(0x1a6)][_0x23f1d3(0x1b6)]();return console[_0x23f1d3(0x199)](a7_0x1a9ee9[_0x23f1d3(0x1a5)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x23f1d3(0x1e3)+_0x147ec7[_0x23f1d3(0x19f)]),(_0x147ec7['first_name']||_0x147ec7[_0x23f1d3(0x1d4)])&&console[_0x23f1d3(0x199)](_0x23f1d3(0x1a7)+[_0x147ec7['first_name'],_0x147ec7[_0x23f1d3(0x1d4)]][_0x23f1d3(0x1be)](Boolean)[_0x23f1d3(0x195)]('\x20')),0x0;}catch(_0x483c6b){return _0x483c6b instanceof HTTPClientError&&_0x483c6b['status']===0x191?printAuthError(_0x483c6b,!![],_0x36844b):console[_0x23f1d3(0x1dd)](a7_0x1a9ee9[_0x23f1d3(0x19b)](_0x23f1d3(0x1ae)+(_0x483c6b instanceof Error?_0x483c6b['message']:String(_0x483c6b)))),0x1;}}}function a7_0x2383(_0x1ee7f5,_0x1e0986){_0x1ee7f5=_0x1ee7f5-0x194;const _0x105464=a7_0x1054();let _0x2383d3=_0x105464[_0x1ee7f5];return _0x2383d3;}export class AuthClearCommand extends BaseCommand{[a7_0x4bfcdf(0x1d2)]=a7_0x4bfcdf(0x1d0);[a7_0x4bfcdf(0x1a2)]=a7_0x4bfcdf(0x1cc);async[a7_0x4bfcdf(0x1c7)](_0xc0a729){const _0x317380=a7_0x4bfcdf,{options:_0x11cf7e}=_0xc0a729,_0x1754a9=_0x11cf7e[_0x317380(0x1de)];console['log'](a7_0x1a9ee9[_0x317380(0x1c2)]('tdx:\x20auth\x20clear'));const _0x1db7b0=await isKeychainAvailable();if(!_0x1db7b0)return console['error'](a7_0x1a9ee9[_0x317380(0x19b)](_0x317380(0x1bd))),0x1;const [_0x4b743a,_0x40a91b]=await Promise['all']([deleteKeychainAPIKey(_0x1754a9),deleteOAuthTokens(_0x1754a9)]);if(_0x4b743a||_0x40a91b){clearCredentialCache();const _0xd3dea3=[_0x4b743a&&'API\x20key',_0x40a91b&&_0x317380(0x1e4)][_0x317380(0x1be)](Boolean)['join']('\x20and\x20');return console[_0x317380(0x199)]('✓\x20'+_0xd3dea3+_0x317380(0x1da)+(_0x1754a9?_0x317380(0x1c3)+_0x1754a9+')':'')),0x0;}else return console[_0x317380(0x199)](_0x317380(0x1b5)+(_0x1754a9?_0x317380(0x1d8)+_0x1754a9:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x398043=a8_0x3035;(function(_0x9d9cd7,_0x5d6797){const _0x4ca585=a8_0x3035,_0x536c3a=_0x9d9cd7();while(!![]){try{const _0xc95440=-parseInt(_0x4ca585(0x12c))/0x1*(-parseInt(_0x4ca585(0x137))/0x2)+-parseInt(_0x4ca585(0x140))/0x3+-parseInt(_0x4ca585(0x141))/0x4*(-parseInt(_0x4ca585(0x144))/0x5)+parseInt(_0x4ca585(0x125))/0x6*(parseInt(_0x4ca585(0x12f))/0x7)+parseInt(_0x4ca585(0x127))/0x8+-parseInt(_0x4ca585(0x12d))/0x9+parseInt(_0x4ca585(0x143))/0xa*(-parseInt(_0x4ca585(0x130))/0xb);if(_0xc95440===_0x5d6797)break;else _0x536c3a['push'](_0x536c3a['shift']());}catch(_0x454389){_0x536c3a['push'](_0x536c3a['shift']());}}}(a8_0x4376,0xc67bf));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0x3035(_0x545ceb,_0x13dc8a){_0x545ceb=_0x545ceb-0x11f;const _0x437619=a8_0x4376();let _0x3035fc=_0x437619[_0x545ceb];return _0x3035fc;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x4376(){const _0x5bb4cb=['jobs','\x20(profile:\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','ERROR','151862UFPmJi','getUserInfo','create','Validating\x20OAuth\x20tokens...','email','/oauth/authorize','\x27\x20registered','execute','Opening\x20browser\x20for\x20authentication...','774099aRHcJL','2162792uROHyY','\x20\x20tdx','43190CufyYy','5DetnVr','description','green','us01','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','bold','logLevel','log','948AZZWwF','✓\x20Profile\x20\x27','5941456LyBfbz','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','5iYgnat','3661029GIOGXC','✓\x20Authentication\x20successful\x20(User:\x20','22792wITBjI','1782aImmuV','Login\x20cancelled','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'];a8_0x4376=function(){return _0x5bb4cb;};return a8_0x4376();}import a8_0x482040 from'chalk';export async function runOAuthLoginFlow(_0x9ac6,_0x316777,_0x4fe880){const _0x78696f=a8_0x3035;if(!isOAuthSupported(_0x9ac6))throw new Error(_0x78696f(0x12b)+_0x9ac6+'.\x20'+_0x78696f(0x12a)+_0x78696f(0x135));const _0x5ebe05=await isKeychainAvailable();if(!_0x5ebe05)throw new Error(_0x78696f(0x132)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x501ae9=getConsoleUrl(_0x9ac6);console[_0x78696f(0x124)](_0x78696f(0x13f)),console[_0x78696f(0x124)]('\x20\x20'+_0x501ae9+_0x78696f(0x13c)),console['log']('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x4bbe03=await startOAuthFlow(_0x9ac6);console['log'](_0x78696f(0x13a));const _0x4e84c2=TDX[_0x78696f(0x139)]({'site':_0x9ac6,'accessToken':_0x4bbe03['access_token'],'logLevel':_0x4fe880??LogLevel[_0x78696f(0x136)]}),_0x49d9c3=await _0x4e84c2[_0x78696f(0x133)][_0x78696f(0x138)]();console[_0x78696f(0x124)](a8_0x482040[_0x78696f(0x11f)](_0x78696f(0x12e)+_0x49d9c3[_0x78696f(0x13b)]+')')),await saveOAuthTokens(_0x4bbe03,_0x316777),console[_0x78696f(0x124)](_0x78696f(0x121)+(_0x316777?_0x78696f(0x134)+_0x316777+')':''));if(_0x316777){const _0x49a2fc={'site':_0x9ac6};saveProfileToUserConfig(_0x316777,_0x49a2fc),console[_0x78696f(0x124)](_0x78696f(0x126)+_0x316777+_0x78696f(0x13d));}const _0x32b464=_0x316777?'\x20--profile\x20'+_0x316777:'';console[_0x78696f(0x124)](),console[_0x78696f(0x124)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x78696f(0x124)](_0x78696f(0x142)+_0x32b464+_0x78696f(0x128)),console[_0x78696f(0x124)](_0x78696f(0x142)+_0x32b464+_0x78696f(0x129));}export class AuthLoginCommand extends BaseCommand{['name']='auth:login';[a8_0x398043(0x145)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async[a8_0x398043(0x13e)](_0x59d0e5){const _0x31a10d=a8_0x398043,{options:_0x14391b}=_0x59d0e5,_0x14642c=_0x14391b['profile'];console[_0x31a10d(0x124)](a8_0x482040[_0x31a10d(0x122)]('tdx:\x20auth\x20login'));const _0xbf0d97=_0x14391b['site']||_0x31a10d(0x120),_0x353843=await promptSiteSelection(_0xbf0d97,_0x14642c,_0x31a10d(0x131));if(!_0x353843)return 0x1;const _0x2a2901=resolveSite(_0x353843);return console['log']('Authenticating\x20via\x20OAuth\x20for\x20site:\x20'+_0x2a2901),await runOAuthLoginFlow(_0x2a2901,_0x14642c,_0x14391b[_0x31a10d(0x123)]??LogLevel[_0x31a10d(0x136)]),0x0;}}
|