@treasuredata/tdx 2026.3.17 → 2026.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/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.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/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/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/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_0x41299d=a3_0xa824;function a3_0x49a8(){const _0x124702=['List\x20activations\x20for\x20a\x20segment','829020YHIKCw','site','✔\x20Found\x20','length','activations','name','Resolved\x20parent\x20ID:\x20','228053zkeVNM','resolveSegmentId','segment','Resolving\x20parent\x20segment\x20\x27','\x27...','2795130zLNuNz','verbose','4349432YBDmYB','message','1101205cpFvqh','Child\x20name:\x20','56DUqBOk','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','execute','error','6333XGEYjn','description','1154RYyxrv','data','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','718285eMTgdX'];a3_0x49a8=function(){return _0x124702;};return a3_0x49a8();}(function(_0xda5b32,_0xfd7d15){const _0x31631a=a3_0xa824,_0x14aa67=_0xda5b32();while(!![]){try{const _0x946f3c=parseInt(_0x31631a(0x19a))/0x1+-parseInt(_0x31631a(0x185))/0x2*(parseInt(_0x31631a(0x183))/0x3)+parseInt(_0x31631a(0x198))/0x4+-parseInt(_0x31631a(0x188))/0x5+parseInt(_0x31631a(0x18a))/0x6+parseInt(_0x31631a(0x191))/0x7*(parseInt(_0x31631a(0x19c))/0x8)+-parseInt(_0x31631a(0x196))/0x9;if(_0x946f3c===_0xfd7d15)break;else _0x14aa67['push'](_0x14aa67['shift']());}catch(_0x225989){_0x14aa67['push'](_0x14aa67['shift']());}}}(a3_0x49a8,0xd7750));import{BaseCommand}from'./command.js';function a3_0xa824(_0x55505a,_0x3ddca3){_0x55505a=_0x55505a-0x180;const _0x49a8c6=a3_0x49a8();let _0xa8248a=_0x49a8c6[_0x55505a];return _0xa8248a;}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';export class ActivationsCommand extends BaseCommand{[a3_0x41299d(0x18f)]=a3_0x41299d(0x18e);[a3_0x41299d(0x184)]=a3_0x41299d(0x189);async[a3_0x41299d(0x181)](_0x49d62d){const _0x80edd7=a3_0x41299d,{options:_0x1aef02,args:_0x2c9469,tdx:_0x4de168}=_0x49d62d;if(_0x2c9469[_0x80edd7(0x18d)]===0x0)return console[_0x80edd7(0x182)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x80edd7(0x182)](_0x80edd7(0x180)),0x1;try{const {parentId:_0x1a99a5,childId:_0x28a37a}=parseSegmentRef(_0x2c9469[0x0]);if(!_0x28a37a)return console['error'](_0x80edd7(0x187)),console[_0x80edd7(0x182)](_0x80edd7(0x180)),0x1;_0x1aef02[_0x80edd7(0x197)]&&(console[_0x80edd7(0x182)]('Site:\x20'+_0x1aef02[_0x80edd7(0x18b)]),console['error']('Parent\x20name:\x20'+_0x1a99a5),console['error'](_0x80edd7(0x19b)+_0x28a37a));const _0x472a7d=await withSpinner(_0x80edd7(0x194)+_0x1a99a5+'\x27...',()=>_0x4de168[_0x80edd7(0x193)]['resolveParentId'](_0x1a99a5),{'verbose':_0x1aef02[_0x80edd7(0x197)]}),_0x1c0362=_0x472a7d[_0x80edd7(0x186)];_0x1aef02[_0x80edd7(0x197)]&&console['error'](_0x80edd7(0x190)+_0x1c0362);const _0x962bf=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x28a37a+_0x80edd7(0x195),()=>_0x4de168[_0x80edd7(0x193)][_0x80edd7(0x192)](_0x1c0362,_0x28a37a),{'verbose':_0x1aef02[_0x80edd7(0x197)]}),_0x3cb6be=_0x962bf[_0x80edd7(0x186)];_0x1aef02[_0x80edd7(0x197)]&&console[_0x80edd7(0x182)]('Resolved\x20child\x20ID:\x20'+_0x3cb6be);const _0x5c13e1=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x28a37a+_0x80edd7(0x195),()=>_0x4de168[_0x80edd7(0x193)]['listActivations'](_0x1c0362,_0x3cb6be),{'verbose':_0x1aef02['verbose']}),_0x33c955=_0x5c13e1[_0x80edd7(0x186)];return console[_0x80edd7(0x182)](_0x80edd7(0x18c)+_0x33c955[_0x80edd7(0x18d)]+'\x20activation'+(_0x33c955['length']!==0x1?'s':'')),await handleSDKOutput(_0x33c955,_0x1aef02),0x0;}catch(_0x458897){if(_0x458897 instanceof SDKError)return console[_0x80edd7(0x182)]('Error:\x20'+_0x458897[_0x80edd7(0x199)]),_0x458897['cause']&&console[_0x80edd7(0x182)]('\x20\x20Cause:\x20'+_0x458897['cause']),0x1;throw _0x458897;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x374e44=a4_0x4f38;(function(_0x54b189,_0x83ef23){const _0xf963e9=a4_0x4f38,_0x317979=_0x54b189();while(!![]){try{const _0x352327=-parseInt(_0xf963e9(0x18d))/0x1+parseInt(_0xf963e9(0x1ef))/0x2+parseInt(_0xf963e9(0x1ae))/0x3*(parseInt(_0xf963e9(0x1bd))/0x4)+parseInt(_0xf963e9(0x198))/0x5*(parseInt(_0xf963e9(0x1d8))/0x6)+-parseInt(_0xf963e9(0x1e7))/0x7*(-parseInt(_0xf963e9(0x171))/0x8)+-parseInt(_0xf963e9(0x1cc))/0x9*(-parseInt(_0xf963e9(0x173))/0xa)+parseInt(_0xf963e9(0x1f3))/0xb*(-parseInt(_0xf963e9(0x21b))/0xc);if(_0x352327===_0x83ef23)break;else _0x317979['push'](_0x317979['shift']());}catch(_0xf7c562){_0x317979['push'](_0x317979['shift']());}}}(a4_0x271d,0x38c85));function a4_0x4f38(_0x38c5cc,_0xba20d9){_0x38c5cc=_0x38c5cc-0x164;const _0x271d37=a4_0x271d();let _0x4f384f=_0x271d37[_0x38c5cc];return _0x4f384f;}import a4_0x456cf5 from'chalk';import a4_0x2b1dd1 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,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 a4_0x271d(){const _0xbdde9c=['Using\x20project\x20from\x20context:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aPush\x20summary\x20for\x20\x27','parse','\x20\x20Experimental\x20Artifact\x20\x22','session','24723OqLDfc','Writing\x20files...','\x20files?','\x20successfully','\x20|\x20','knowledgeBases','red','cwd','force','Would\x20push\x20agent:\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','\x27\x20to\x20create\x20the\x20folder\x20structure.','2244kTpIJM','total','\x20changed','\x0a✔\x20Pulled\x20','Pushing\x20agent\x20from\x20\x22','prompts','updated','\x0aChanges:','New\x20project\x20name\x20is\x20required','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)','\x0aWrite\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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','agents','arg-dir','985327kVAyfQ','message','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Bases:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','new','\x20\x20Knowledge\x20Base\x20\x22','<new-name>','826488RpHogs','reason','join','textKnowledgeBases','36707Dxopqi','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','projectName','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agent.yml','\x20resources?','hasChanges','no_local_folder','action','Using\x20context\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Clone\x20\x22','Would\x20pull\x20agent:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputPath','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Project\x20cloned\x20successfully','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Would\x20clone:','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Agent\x20','\x20\x20tdx\x20agent\x20pull\x20','\x0aPush\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent:push','Project:\x20','\x22\x20from\x20project\x20\x22','experimentalKnowledgeBases','\x20total','\x22\x20to\x20\x22','\x20unchanged','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','agentId','context','\x20created','cwd-config','\x0aErrors\x20found:','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','New\x20project:\x20','3228uGzcSi','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','MISSING_ARGUMENT','\x20=\x20','counts','pushProject','sourceProjectName','log','Dry\x20run\x20-\x20no\x20changes\x20made','-\x20nothing\x20pushed','source','dim','-\x20no\x20files\x20written','Cloning\x20\x22','agent:pull','execute','agent','newProjectId','\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Prompt\x20\x22','site','Using\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','24MQCojU','\x22...','130rZjgmj','llmProject','\x22\x20to\x20a\x20different\x20profile','name','pullProject','projectId','\x0aProject\x20pushed\x20with\x20errors','integrations','Pulling\x20agent\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','yes','tdx.json','\x22\x20to\x20new\x20project\x20\x22','\x20new','outputDir','errors','Failed\x20to\x20push\x20agent:\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','Cancelled','isNew','newProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','diff','Output:\x20','162626PHqCwM','Agent:\x20','cloneProject','experimentalArtifacts','Status:\x20','Using\x20local\x20project:\x20','cyan','utf-8','Pushing\x20to\x20project...','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','4385XhmVTY','dryRun','INVALID_ARGUMENT','\x20errors','llm','\x20\x20Integration\x20\x22','Agent\x20pulled\x20successfully','\x0a✔\x20Pushed\x20','\x22:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Agent\x20\x22','\x20\x20Prompts:\x20','no_context','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Source:\x20','✔\x20Context\x20set:\x20','error','\x20resources\x20to\x20\x27','green','repeat','unchanged','projectDir','3uwCSfL','pushAgent','dirname','\x20\x20tdx\x20agent\x20clone\x20agents/','agentName','created','\x20\x20Agents:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','found','\x20updated','gray','llm_project','description','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','374496ERmjXG','push','yellow','\x20--name\x20','\x0aChanges\x20to\x20agent\x20\x27','Output\x20path:\x20','Source:\x20','\x20\x20Target:\x20','Using\x20project\x20from\x20'];a4_0x271d=function(){return _0xbdde9c;};return a4_0x271d();}function formatCountSummary(_0x485691){const _0x530fe0=a4_0x4f38,_0xf96b78=[];if(_0x485691[_0x530fe0(0x1d9)]!==undefined)_0xf96b78[_0x530fe0(0x1be)](_0x485691[_0x530fe0(0x1d9)]+_0x530fe0(0x210));if(_0x485691[_0x530fe0(0x1ec)]!==undefined&&_0x485691[_0x530fe0(0x1ec)]>0x0)_0xf96b78['push'](a4_0x456cf5[_0x530fe0(0x1aa)](_0x485691['new']+_0x530fe0(0x181)));if(_0x485691['created']!==undefined&&_0x485691['created']>0x0)_0xf96b78[_0x530fe0(0x1be)](a4_0x456cf5['green'](_0x485691['created']+_0x530fe0(0x216)));if(_0x485691['updated']!==undefined&&_0x485691['updated']>0x0)_0xf96b78[_0x530fe0(0x1be)](a4_0x456cf5['yellow'](_0x485691[_0x530fe0(0x1de)]+_0x530fe0(0x1b8)));if(_0x485691[_0x530fe0(0x1ac)]!==undefined&&_0x485691[_0x530fe0(0x1ac)]>0x0)_0xf96b78['push'](a4_0x456cf5[_0x530fe0(0x1b9)](_0x485691[_0x530fe0(0x1ac)]+'\x20unchanged'));if(_0x485691[_0x530fe0(0x183)]!==undefined&&_0x485691['errors']>0x0)_0xf96b78[_0x530fe0(0x1be)](a4_0x456cf5[_0x530fe0(0x1d2)](_0x485691[_0x530fe0(0x183)]+_0x530fe0(0x19b)));return _0xf96b78[_0x530fe0(0x1f1)](',\x20');}function displayDiffs(_0x193b27,_0x20b613,_0x34b39e,_0x14fa01,_0x42cb8c,_0x57c208,_0x487fec){const _0x2d56cf=a4_0x4f38;for(const _0x446396 of _0x193b27){if(_0x446396['diff']){const _0x5b5122=_0x446396[_0x2d56cf(0x1b2)]||_0x446396[_0x2d56cf(0x176)];console[_0x2d56cf(0x223)](_0x2d56cf(0x1c1)+_0x5b5122+'\x27:'),console['log']('─'[_0x2d56cf(0x1ab)](0x3c)),console[_0x2d56cf(0x223)](_0x446396['diff']),console[_0x2d56cf(0x223)]('─'['repeat'](0x3c));}}for(const _0x18c5e2 of _0x20b613){_0x18c5e2[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x18c5e2[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console['log'](_0x18c5e2[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'['repeat'](0x3c)));}for(const _0x36b4b0 of _0x34b39e){_0x36b4b0[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x36b4b0[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console['log'](_0x36b4b0[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x3a94ff of _0x14fa01){_0x3a94ff[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x3a94ff[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console['log'](_0x3a94ff[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x5d3c58 of _0x42cb8c){_0x5d3c58[_0x2d56cf(0x18b)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x5d3c58[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console[_0x2d56cf(0x223)](_0x5d3c58[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x55234d of _0x57c208){_0x55234d[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)](_0x2d56cf(0x203)+_0x55234d[_0x2d56cf(0x176)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x2d56cf(0x223)](_0x55234d[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x29febd of _0x487fec){_0x29febd[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)](_0x2d56cf(0x196)+_0x29febd[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'['repeat'](0x3c)),console[_0x2d56cf(0x223)](_0x29febd[_0x2d56cf(0x18b)]),console['log']('─'[_0x2d56cf(0x1ab)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x374e44(0x176)]=a4_0x374e44(0x167);[a4_0x374e44(0x1bb)]=a4_0x374e44(0x1fd);async[a4_0x374e44(0x168)](_0x27fb08){const _0x1e5c38=a4_0x374e44,{options:_0x46fc78,args:_0x48030b,tdx:_0x33e641}=_0x27fb08,_0x453527=_0x48030b[0x0],_0x16c9ad=_0x48030b[0x1],_0x1a8380=_0x46fc78['output'],_0x4864af=_0x46fc78[_0x1e5c38(0x199)],_0x13cc3f=_0x46fc78[_0x1e5c38(0x1d4)],_0x598a49=_0x46fc78['yes'],_0xee8d27=_0x46fc78[_0x1e5c38(0x174)],_0x5927a3=_0x46fc78[_0x1e5c38(0x169)];let _0x1bea90;if(_0x453527){const _0xe1bcc5=a4_0x2b1dd1['join'](_0x453527,_0x1e5c38(0x17f));if(existsSync(_0xe1bcc5))try{const _0x210aa9=JSON[_0x1e5c38(0x1c9)](readFileSync(_0xe1bcc5,'utf-8'));_0x210aa9[_0x1e5c38(0x1ba)]&&(_0x1bea90={'llm_project':_0x210aa9[_0x1e5c38(0x1ba)]});}catch{}}const _0x4bae8f=findAgentConfigPath(process[_0x1e5c38(0x1d3)]());let _0x199982;if(_0x4bae8f)try{const _0xb930ae=JSON[_0x1e5c38(0x1c9)](readFileSync(_0x4bae8f,_0x1e5c38(0x194)));_0xb930ae[_0x1e5c38(0x1ba)]&&(_0x199982={'llm_project':_0xb930ae[_0x1e5c38(0x1ba)]});}catch{}const _0x2eee9b=resolveAgentPullArgs({'arg':_0x453527,'agentNameArg':_0x16c9ad,'agentFlag':_0x5927a3,'contextProject':_0xee8d27,'argDirConfig':_0x1bea90,'cwdConfigPath':_0x4bae8f||undefined,'cwdConfig':_0x199982}),{projectNameOrId:_0x2a78c8,targetAgentName:_0x6ccb0c,existingOutputDir:_0x4232b6,source:_0x3a5a2d}=_0x2eee9b;if(_0x3a5a2d===_0x1e5c38(0x1e6))console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x164)](_0x1e5c38(0x1c5)+a4_0x2b1dd1['join'](_0x453527,'tdx.json')+':\x20'+_0x2a78c8));else{if(_0x3a5a2d===_0x1e5c38(0x217))console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x164)]('Using\x20project:\x20'+_0x2a78c8));else _0x3a5a2d===_0x1e5c38(0x215)&&console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x164)](_0x1e5c38(0x1c6)+_0x2a78c8));}if(!_0x2a78c8)return _0x5927a3?(console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x17d))),console[_0x1e5c38(0x223)](_0x1e5c38(0x1a1)),console['log'](_0x1e5c38(0x21d))):(console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x1b6))),console[_0x1e5c38(0x223)](_0x1e5c38(0x1e1)),console['log']('\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[_0x1e5c38(0x223)](_0x1e5c38(0x1e4)),console[_0x1e5c38(0x223)](_0x1e5c38(0x1d6)),console[_0x1e5c38(0x223)]('\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(_0x6ccb0c){const {data:_0x28d2a8}=await withSpinner(_0x1e5c38(0x17b)+_0x6ccb0c+_0x1e5c38(0x20e)+_0x2a78c8+_0x1e5c38(0x172),()=>_0x33e641[_0x1e5c38(0x19c)]['pullAgent'](_0x2a78c8,_0x6ccb0c,_0x1a8380,{'dryRun':_0x4864af,'force':_0x13cc3f}));if(_0x4864af)return console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x1a5))),console[_0x1e5c38(0x223)](_0x1e5c38(0x200)+_0x28d2a8['agentName']),console[_0x1e5c38(0x223)](_0x1e5c38(0x1c2)+_0x28d2a8[_0x1e5c38(0x202)]),_0x28d2a8[_0x1e5c38(0x18b)]&&(console['log'](_0x1e5c38(0x1df)),console[_0x1e5c38(0x223)]('─'[_0x1e5c38(0x1ab)](0x3c)),console[_0x1e5c38(0x223)](_0x28d2a8[_0x1e5c38(0x18b)]),console['log']('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x456cf5[_0x1e5c38(0x1aa)](_0x1e5c38(0x19e))),console[_0x1e5c38(0x223)](_0x1e5c38(0x18e)+_0x28d2a8[_0x1e5c38(0x1b2)]),console[_0x1e5c38(0x223)](_0x1e5c38(0x18c)+_0x28d2a8[_0x1e5c38(0x202)]),console[_0x1e5c38(0x223)](_0x1e5c38(0x191)+(_0x28d2a8[_0x1e5c38(0x188)]?a4_0x456cf5[_0x1e5c38(0x1aa)]('new'):_0x28d2a8[_0x1e5c38(0x1f9)]?a4_0x456cf5['yellow']('updated'):a4_0x456cf5[_0x1e5c38(0x1b9)](_0x1e5c38(0x1ac)))),0x0;}const _0x31a284=_0x4232b6||_0x1a8380,{data:_0x8e931b}=await withSpinner('Analyzing\x20project\x20\x22'+_0x2a78c8+_0x1e5c38(0x172),()=>_0x33e641[_0x1e5c38(0x19c)][_0x1e5c38(0x177)](_0x2a78c8,_0x31a284,{'dryRun':!![]})),_0x39b819=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)]['new']+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1d1)][_0x1e5c38(0x1ec)]+_0x8e931b['counts'][_0x1e5c38(0x1f2)]['new']+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1dd)]['new']+_0x8e931b['counts'][_0x1e5c38(0x17a)]['new']+_0x8e931b[_0x1e5c38(0x220)]['experimentalKnowledgeBases']['new']+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)][_0x1e5c38(0x1ec)],_0x9195a6=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)]['updated']+_0x8e931b[_0x1e5c38(0x220)]['knowledgeBases'][_0x1e5c38(0x1de)]+_0x8e931b['counts'][_0x1e5c38(0x1f2)]['updated']+_0x8e931b['counts'][_0x1e5c38(0x1dd)]['updated']+_0x8e931b[_0x1e5c38(0x220)]['integrations'][_0x1e5c38(0x1de)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x20f)][_0x1e5c38(0x1de)]+_0x8e931b['counts'][_0x1e5c38(0x190)][_0x1e5c38(0x1de)],_0x423b04=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)][_0x1e5c38(0x1ac)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1d1)]['unchanged']+_0x8e931b['counts']['textKnowledgeBases'][_0x1e5c38(0x1ac)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1dd)][_0x1e5c38(0x1ac)]+_0x8e931b['counts'][_0x1e5c38(0x17a)][_0x1e5c38(0x1ac)]+_0x8e931b['counts'][_0x1e5c38(0x20f)][_0x1e5c38(0x1ac)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)]['unchanged'];console[_0x1e5c38(0x223)](_0x1e5c38(0x185)+_0x8e931b[_0x1e5c38(0x1f5)]+'\x27:'),console[_0x1e5c38(0x223)]('\x20\x20'+a4_0x456cf5[_0x1e5c38(0x1aa)]('+\x20'+_0x39b819+_0x1e5c38(0x181))+_0x1e5c38(0x1d0)+a4_0x456cf5[_0x1e5c38(0x1bf)]('~\x20'+_0x9195a6+_0x1e5c38(0x1da))+_0x1e5c38(0x1d0)+a4_0x456cf5[_0x1e5c38(0x164)]('=\x20'+_0x423b04+'\x20unchanged')),console[_0x1e5c38(0x223)](_0x1e5c38(0x1b4)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)])),console['log'](_0x1e5c38(0x1ea)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1d1)])),console[_0x1e5c38(0x223)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x8e931b['counts']['textKnowledgeBases'])),console[_0x1e5c38(0x223)](_0x1e5c38(0x1a3)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1dd)])),console[_0x1e5c38(0x223)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x17a)]));const _0x1417a6=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x20f)]['total']>0x0||_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)][_0x1e5c38(0x1d9)]>0x0;_0x1417a6&&(console[_0x1e5c38(0x223)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)]['experimentalKnowledgeBases'])),console[_0x1e5c38(0x223)](_0x1e5c38(0x1e9)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)])));console['log'](_0x1e5c38(0x1c4)+a4_0x456cf5['cyan'](_0x8e931b[_0x1e5c38(0x182)])),displayDiffs(_0x8e931b[_0x1e5c38(0x1e5)],_0x8e931b['knowledgeBases'],_0x8e931b['textKnowledgeBases'],_0x8e931b['prompts'],_0x8e931b[_0x1e5c38(0x17a)],_0x8e931b['experimentalKnowledgeBases'],_0x8e931b['experimentalArtifacts']);if(_0x4864af)return console['log'](a4_0x456cf5['yellow'](_0x1e5c38(0x16c))),0x0;if(_0x39b819===0x0&&_0x9195a6===0x0)return console[_0x1e5c38(0x223)](a4_0x456cf5['green'](_0x1e5c38(0x18a))),saveSessionContext({'llm_project':_0x8e931b[_0x1e5c38(0x1f5)]},_0x46fc78[_0x1e5c38(0x1cb)]),console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1aa)](_0x1e5c38(0x1a7)+a4_0x456cf5[_0x1e5c38(0x164)]('llm_project')+_0x1e5c38(0x21f)+a4_0x456cf5['cyan'](_0x8e931b[_0x1e5c38(0x1f5)]))),0x0;if(!_0x598a49&&!_0x13cc3f){if(!isInteractive())return console[_0x1e5c38(0x1a8)](a4_0x456cf5[_0x1e5c38(0x1d2)]('\x0aError:'),_0x1e5c38(0x17c)),console[_0x1e5c38(0x1a8)](a4_0x456cf5['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3a390c=await confirmKey(_0x1e5c38(0x1e2)+(_0x39b819+_0x9195a6)+_0x1e5c38(0x1ce));if(!_0x3a390c)return console['log'](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x187)),_0x1e5c38(0x165)),0x1;}const {data:_0xdd4cfd}=await withSpinner(_0x1e5c38(0x1cd),()=>_0x33e641[_0x1e5c38(0x19c)][_0x1e5c38(0x177)](_0x2a78c8,_0x31a284,{'force':_0x13cc3f}));return console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1aa)](_0x1e5c38(0x1db)+(_0x39b819+_0x9195a6)+_0x1e5c38(0x16b)+_0xdd4cfd['outputDir'])),saveSessionContext({'llm_project':_0xdd4cfd[_0x1e5c38(0x1f5)]},_0x46fc78[_0x1e5c38(0x1cb)]),console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1aa)]('✔\x20Context\x20set:\x20'+a4_0x456cf5[_0x1e5c38(0x164)](_0x1e5c38(0x1ba))+'\x20=\x20'+a4_0x456cf5[_0x1e5c38(0x193)](_0xdd4cfd['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x374e44(0x176)]='agent:clone';['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x374e44(0x168)](_0x2febad){const _0x4663f5=a4_0x374e44,{options:_0x429d35,args:_0x2a3a48,tdx:_0x52ad80}=_0x2febad,_0x1fd426=_0x2a3a48[0x0],_0x464dc3=_0x429d35[_0x4663f5(0x176)],_0x281ac8=_0x429d35[_0x4663f5(0x199)],_0xf65e54=_0x429d35[_0x4663f5(0x17e)],_0x536cd2=_0x429d35[_0x4663f5(0x16e)],_0x41d017=_0x429d35[_0x4663f5(0x174)];let _0x4db4c2;const _0x30a485=findAgentConfigPath(process['cwd']());if(_0x1fd426){const _0x257c3f=a4_0x2b1dd1['join'](_0x1fd426,_0x4663f5(0x17f));existsSync(_0x257c3f)?(_0x4db4c2=_0x1fd426,console['log'](a4_0x456cf5[_0x4663f5(0x164)](_0x4663f5(0x192)+_0x1fd426))):_0x4db4c2=_0x1fd426;}else{if(_0x30a485)_0x4db4c2=a4_0x2b1dd1[_0x4663f5(0x1b0)](_0x30a485),console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x164)]('Using\x20current\x20project:\x20'+_0x4db4c2));else{if(_0x41d017){const _0x3db6e3=sanitizeForFilesystem(_0x41d017);let _0x1a63a4=_0x3db6e3,_0x3dad68=a4_0x2b1dd1['join'](process[_0x4663f5(0x1d3)](),'agents',_0x3db6e3,_0x4663f5(0x17f));if(!existsSync(_0x3dad68)){const _0x27d63d=normalizeName(_0x41d017),_0x14c845=a4_0x2b1dd1[_0x4663f5(0x1f1)](process[_0x4663f5(0x1d3)](),'agents',_0x27d63d,'tdx.json');existsSync(_0x14c845)&&(_0x1a63a4=_0x27d63d,_0x3dad68=_0x14c845);}if(existsSync(_0x3dad68))_0x4db4c2=a4_0x2b1dd1[_0x4663f5(0x1b0)](_0x3dad68),console['log'](a4_0x456cf5[_0x4663f5(0x164)](_0x4663f5(0x192)+_0x4db4c2));else{const _0x588c74=_0x429d35['profile'];if(_0x588c74)throw new SDKError(ErrorCode[_0x4663f5(0x19a)],_0x4663f5(0x1b5)+_0x41d017+_0x4663f5(0x175),undefined,{'helpText':_0x4663f5(0x1bc)+_0x4663f5(0x1f6)+(_0x4663f5(0x209)+_0x41d017+'\x0a')+(_0x4663f5(0x1b1)+_0x1a63a4+_0x4663f5(0x1c0)+(_0x464dc3||_0x4663f5(0x1ee))+'\x20--profile\x20'+_0x588c74)});_0x4db4c2=_0x41d017,console['log'](a4_0x456cf5[_0x4663f5(0x164)](_0x4663f5(0x1fc)+_0x41d017));}}}}if(!_0x4db4c2)return console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1bf)](_0x4663f5(0x1fe))),console[_0x4663f5(0x223)](_0x4663f5(0x170)),console[_0x4663f5(0x223)](_0x4663f5(0x21c)),console[_0x4663f5(0x223)]('\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[_0x4663f5(0x223)](_0x4663f5(0x1f4)),0x1;if(!_0x464dc3)throw new SDKError(ErrorCode[_0x4663f5(0x21e)],_0x4663f5(0x1e0),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0xf65e54&&!_0x281ac8){if(!isInteractive())return console[_0x4663f5(0x1a8)](a4_0x456cf5['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4663f5(0x1a8)](a4_0x456cf5[_0x4663f5(0x164)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x26759f=await confirmKey(_0x4663f5(0x1ff)+_0x4db4c2+_0x4663f5(0x180)+_0x464dc3+'\x22?');if(!_0x26759f)return console[_0x4663f5(0x223)](a4_0x456cf5['yellow']('Cancelled')),0x1;}const {data:_0x1e5182}=await withSpinner(_0x4663f5(0x166)+_0x4db4c2+_0x4663f5(0x211)+_0x464dc3+'\x22...',()=>_0x52ad80[_0x4663f5(0x19c)][_0x4663f5(0x18f)](_0x4db4c2,_0x464dc3,{'dryRun':_0x281ac8}));if(_0x281ac8){console[_0x4663f5(0x223)](a4_0x456cf5['yellow'](_0x4663f5(0x224))),console[_0x4663f5(0x223)](_0x4663f5(0x1c3)+_0x1e5182[_0x4663f5(0x222)]),console[_0x4663f5(0x223)]('New\x20project:\x20'+_0x464dc3),console[_0x4663f5(0x223)](_0x4663f5(0x206)),console[_0x4663f5(0x223)]('\x20\x20Agents:\x20'+_0x1e5182['counts'][_0x4663f5(0x1e5)][_0x4663f5(0x1b3)]),console['log'](_0x4663f5(0x1ea)+_0x1e5182['counts'][_0x4663f5(0x1d1)]['created']),console['log'](_0x4663f5(0x1a3)+_0x1e5182['counts'][_0x4663f5(0x1dd)][_0x4663f5(0x1b3)]);const _0x2e9ccf=_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x20f)][_0x4663f5(0x1b3)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x190)][_0x4663f5(0x1b3)]>0x0;return _0x2e9ccf&&(console[_0x4663f5(0x223)](_0x4663f5(0x201)+_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x20f)][_0x4663f5(0x1b3)]),console[_0x4663f5(0x223)](_0x4663f5(0x1e9)+_0x1e5182[_0x4663f5(0x220)]['experimentalArtifacts']['created'])),0x0;}const _0x276688=_0x1e5182['counts']['agents'][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1d1)][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1dd)][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalArtifacts'][_0x4663f5(0x183)]>0x0;_0x276688?console['log'](a4_0x456cf5[_0x4663f5(0x1bf)]('Project\x20cloned\x20with\x20errors')):console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1aa)](_0x4663f5(0x204)));console[_0x4663f5(0x223)](_0x4663f5(0x1c3)+_0x1e5182['sourceProjectName']),console['log'](_0x4663f5(0x21a)+_0x1e5182[_0x4663f5(0x189)]),console[_0x4663f5(0x223)]('New\x20project\x20ID:\x20'+_0x1e5182[_0x4663f5(0x16a)]),console[_0x4663f5(0x223)](),console[_0x4663f5(0x223)]('Summary:'),console['log'](_0x4663f5(0x1b4)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1e5)])),console[_0x4663f5(0x223)](_0x4663f5(0x1ea)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1d1)])),console[_0x4663f5(0x223)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1dd)])),console['log'](_0x4663f5(0x186)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)]['integrations']));const _0x4d7cce=_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x1b3)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x1de)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x1ac)]>0x0||_0x1e5182['counts']['experimentalArtifacts'][_0x4663f5(0x1b3)]>0x0||_0x1e5182['counts'][_0x4663f5(0x190)][_0x4663f5(0x1de)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x190)][_0x4663f5(0x1ac)]>0x0;_0x4d7cce&&(console[_0x4663f5(0x223)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x20f)])),console['log'](_0x4663f5(0x1e9)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x190)])));if(_0x276688){console['log'](),console['log'](a4_0x456cf5['red']('Errors:'));for(const _0x2db973 of _0x1e5182['agents']){_0x2db973[_0x4663f5(0x1fb)]===_0x4663f5(0x1a8)&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x1a2)+_0x2db973[_0x4663f5(0x1b2)]+'\x22:\x20'+_0x2db973['error']));}for(const _0x477ef5 of _0x1e5182['knowledgeBases']){_0x477ef5['action']===_0x4663f5(0x1a8)&&console['log'](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x1ed)+_0x477ef5[_0x4663f5(0x176)]+_0x4663f5(0x1a0)+_0x477ef5[_0x4663f5(0x1a8)]));}for(const _0x3d7ddf of _0x1e5182['prompts']){_0x3d7ddf[_0x4663f5(0x1fb)]===_0x4663f5(0x1a8)&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)]('\x20\x20Prompt\x20\x22'+_0x3d7ddf[_0x4663f5(0x176)]+'\x22:\x20'+_0x3d7ddf[_0x4663f5(0x1a8)]));}for(const _0x137f3e of _0x1e5182[_0x4663f5(0x17a)]){_0x137f3e['action']==='error'&&console[_0x4663f5(0x223)](a4_0x456cf5['red']('\x20\x20Integration\x20\x22'+_0x137f3e[_0x4663f5(0x176)]+_0x4663f5(0x1a0)+_0x137f3e[_0x4663f5(0x1a8)]));}for(const _0x4af12d of _0x1e5182[_0x4663f5(0x20f)]){_0x4af12d[_0x4663f5(0x1fb)]==='error'&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x20b)+_0x4af12d[_0x4663f5(0x176)]+'\x22:\x20'+_0x4af12d[_0x4663f5(0x1a8)]));}for(const _0x1ea18c of _0x1e5182[_0x4663f5(0x190)]){_0x1ea18c[_0x4663f5(0x1fb)]==='error'&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x1ca)+_0x1ea18c[_0x4663f5(0x176)]+_0x4663f5(0x1a0)+_0x1ea18c[_0x4663f5(0x1a8)]));}return 0x1;}console['log']();const _0x3fce66=getLLMProjectUrl(_0x536cd2,_0x1e5182['newProjectId']);return console[_0x4663f5(0x223)](_0x4663f5(0x20d)+a4_0x456cf5[_0x4663f5(0x193)](_0x3fce66)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x374e44(0x176)]=a4_0x374e44(0x20c);[a4_0x374e44(0x1bb)]=a4_0x374e44(0x213);async[a4_0x374e44(0x168)](_0x2dee3e){const _0x4a0430=a4_0x374e44,{options:_0x15b5b6,args:_0x25e40a,tdx:_0x4e7c68}=_0x2dee3e;let _0x386cb7=_0x25e40a[0x0]||process[_0x4a0430(0x1d3)]();const _0x488e4f=_0x15b5b6[_0x4a0430(0x199)],_0x420b0e=_0x15b5b6[_0x4a0430(0x1d4)],_0x566b10=_0x15b5b6[_0x4a0430(0x17e)],_0x533cee=_0x15b5b6[_0x4a0430(0x16e)],_0x207014=a4_0x2b1dd1[_0x4a0430(0x1f1)](_0x386cb7,_0x4a0430(0x1f7)),_0x4c69fd=existsSync(_0x207014);if(_0x4c69fd){const {data:_0x17e45a}=await withSpinner(_0x4a0430(0x1dc)+_0x386cb7+_0x4a0430(0x172),()=>_0x4e7c68[_0x4a0430(0x19c)][_0x4a0430(0x1af)](_0x386cb7,{'dryRun':_0x488e4f,'force':_0x420b0e}));if(_0x488e4f)return console['log'](a4_0x456cf5[_0x4a0430(0x1bf)](_0x4a0430(0x224))),console[_0x4a0430(0x223)](_0x4a0430(0x1d5)+_0x17e45a[_0x4a0430(0x1b2)]),0x0;if(_0x17e45a[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8))return console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x184)+_0x17e45a[_0x4a0430(0x1a8)])),0x1;console[_0x4a0430(0x223)](a4_0x456cf5['green'](_0x4a0430(0x208)+_0x17e45a[_0x4a0430(0x1fb)]+_0x4a0430(0x1cf))),console[_0x4a0430(0x223)]('Agent:\x20'+_0x17e45a[_0x4a0430(0x1b2)]);if(_0x17e45a[_0x4a0430(0x214)]&&_0x17e45a['projectId']){const _0x1449f9=getLLMAgentChatUrl(_0x533cee,_0x17e45a[_0x4a0430(0x178)],_0x17e45a[_0x4a0430(0x214)]);console['log']('Chat:\x20'+a4_0x456cf5['cyan'](_0x1449f9));}return 0x0;}const _0x5002e9=_0x15b5b6[_0x4a0430(0x174)],_0x455a3e=resolveProjectFromContext(_0x386cb7,_0x5002e9);if(_0x455a3e[_0x4a0430(0x1b7)])_0x386cb7=_0x455a3e[_0x4a0430(0x1ad)],_0x455a3e[_0x4a0430(0x226)]===_0x4a0430(0x215)&&console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x164)](_0x4a0430(0x16f)+_0x386cb7));else{let _0x17cbef=_0x4a0430(0x205);_0x455a3e['reason']===_0x4a0430(0x1fa)&&(_0x17cbef=_0x455a3e[_0x4a0430(0x1e8)]+_0x4a0430(0x219)+_0x455a3e['llmProject']+_0x4a0430(0x1d7));throw new SDKError(ErrorCode[_0x4a0430(0x19a)],_0x455a3e[_0x4a0430(0x1f0)]===_0x4a0430(0x1a4)?_0x455a3e[_0x4a0430(0x1e8)]:'No\x20tdx.json\x20found\x20in\x20'+_0x386cb7,undefined,{'helpText':_0x17cbef});}const {data:_0x563e82}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x4e7c68[_0x4a0430(0x19c)][_0x4a0430(0x221)](_0x386cb7,{'dryRun':!![]})),_0x66930b=_0x563e82[_0x4a0430(0x220)]['agents'][_0x4a0430(0x183)]>0x0;if(_0x66930b){console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x218)));for(const _0x2ef61d of _0x563e82[_0x4a0430(0x1e5)]){_0x2ef61d[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x1a2)+_0x2ef61d['agentName']+_0x4a0430(0x1a0)+_0x2ef61d[_0x4a0430(0x1a8)]));}return 0x1;}const _0x8bd6a8=_0x563e82['counts'][_0x4a0430(0x1e5)][_0x4a0430(0x1b3)]+_0x563e82[_0x4a0430(0x220)]['knowledgeBases'][_0x4a0430(0x1b3)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1f2)]['created']+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1dd)]['created']+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x17a)][_0x4a0430(0x1b3)]+_0x563e82['counts'][_0x4a0430(0x20f)]['created']+_0x563e82['counts']['experimentalArtifacts'][_0x4a0430(0x1b3)],_0x4fbee9=_0x563e82['counts'][_0x4a0430(0x1e5)][_0x4a0430(0x1de)]+_0x563e82['counts']['knowledgeBases'][_0x4a0430(0x1de)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1f2)]['updated']+_0x563e82['counts']['prompts'][_0x4a0430(0x1de)]+_0x563e82['counts'][_0x4a0430(0x17a)]['updated']+_0x563e82['counts']['experimentalKnowledgeBases'][_0x4a0430(0x1de)]+_0x563e82['counts']['experimentalArtifacts'][_0x4a0430(0x1de)],_0x656128=_0x563e82[_0x4a0430(0x220)]['agents'][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1d1)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1f2)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1dd)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)]['integrations'][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x20f)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x190)][_0x4a0430(0x1ac)];console[_0x4a0430(0x223)](_0x4a0430(0x1c8)+_0x563e82[_0x4a0430(0x1f5)]+'\x27:'),console[_0x4a0430(0x223)]('\x20\x20'+a4_0x456cf5[_0x4a0430(0x1aa)]('+\x20'+_0x8bd6a8+_0x4a0430(0x181))+_0x4a0430(0x1d0)+a4_0x456cf5[_0x4a0430(0x1bf)]('~\x20'+_0x4fbee9+_0x4a0430(0x1da))+_0x4a0430(0x1d0)+a4_0x456cf5[_0x4a0430(0x164)]('=\x20'+_0x656128+_0x4a0430(0x212))),console['log'](_0x4a0430(0x1b4)+formatCountSummary(_0x563e82[_0x4a0430(0x220)]['agents'])),console['log'](_0x4a0430(0x1ea)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1d1)])),console['log'](_0x4a0430(0x197)+formatCountSummary(_0x563e82['counts']['textKnowledgeBases'])),console[_0x4a0430(0x223)](_0x4a0430(0x1a3)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1dd)])),console[_0x4a0430(0x223)](_0x4a0430(0x186)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x17a)]));const _0x25faea=_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x20f)]['created']>0x0||_0x563e82[_0x4a0430(0x220)]['experimentalKnowledgeBases'][_0x4a0430(0x1de)]>0x0||_0x563e82['counts']['experimentalKnowledgeBases'][_0x4a0430(0x1ac)]>0x0||_0x563e82[_0x4a0430(0x220)]['experimentalArtifacts'][_0x4a0430(0x1b3)]>0x0||_0x563e82[_0x4a0430(0x220)]['experimentalArtifacts']['updated']>0x0||_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x190)][_0x4a0430(0x1ac)]>0x0;_0x25faea&&(console[_0x4a0430(0x223)](_0x4a0430(0x201)+formatCountSummary(_0x563e82['counts'][_0x4a0430(0x20f)])),console[_0x4a0430(0x223)](_0x4a0430(0x1e9)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x190)])));console[_0x4a0430(0x223)](_0x4a0430(0x1a6)+a4_0x456cf5[_0x4a0430(0x193)](_0x386cb7)),displayDiffs(_0x563e82[_0x4a0430(0x1e5)],_0x563e82['knowledgeBases'],_0x563e82['textKnowledgeBases'],_0x563e82[_0x4a0430(0x1dd)],_0x563e82[_0x4a0430(0x17a)],_0x563e82[_0x4a0430(0x20f)],_0x563e82[_0x4a0430(0x190)]);if(_0x488e4f)return console[_0x4a0430(0x223)](a4_0x456cf5['yellow'](_0x4a0430(0x1eb))),0x0;if(_0x8bd6a8===0x0&&_0x4fbee9===0x0){console['log'](a4_0x456cf5['green'](_0x4a0430(0x207)));const _0x4ffe07=getLLMProjectUrl(_0x533cee,_0x563e82[_0x4a0430(0x178)]);return console['log']('Project:\x20'+a4_0x456cf5[_0x4a0430(0x193)](_0x4ffe07)),0x0;}if(!_0x566b10&&!_0x420b0e){if(!isInteractive())return console[_0x4a0430(0x1a8)](a4_0x456cf5[_0x4a0430(0x1d2)]('\x0aError:'),_0x4a0430(0x17c)),console[_0x4a0430(0x1a8)](a4_0x456cf5[_0x4a0430(0x164)](_0x4a0430(0x1e3))),0x1;const _0x5108c2=await confirmKey(_0x4a0430(0x20a)+(_0x8bd6a8+_0x4fbee9)+_0x4a0430(0x1f8));if(!_0x5108c2)return console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1bf)](_0x4a0430(0x187)),_0x4a0430(0x225)),0x1;}const {data:_0x5ceb26}=await withSpinner(_0x4a0430(0x195),()=>_0x4e7c68[_0x4a0430(0x19c)][_0x4a0430(0x221)](_0x386cb7,{'force':_0x420b0e})),_0xbf4863=_0x5ceb26['counts'][_0x4a0430(0x1e5)][_0x4a0430(0x183)]>0x0||_0x5ceb26[_0x4a0430(0x220)][_0x4a0430(0x1d1)]['errors']>0x0||_0x5ceb26[_0x4a0430(0x220)][_0x4a0430(0x1f2)][_0x4a0430(0x183)]>0x0||_0x5ceb26['counts']['prompts'][_0x4a0430(0x183)]>0x0;if(_0xbf4863){console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1bf)](_0x4a0430(0x179))),console['log'](),console['log'](a4_0x456cf5[_0x4a0430(0x1d2)]('Errors:'));for(const _0x3e8bce of _0x5ceb26[_0x4a0430(0x1e5)]){_0x3e8bce[_0x4a0430(0x1fb)]==='error'&&console[_0x4a0430(0x223)](a4_0x456cf5['red'](_0x4a0430(0x1a2)+_0x3e8bce['agentName']+_0x4a0430(0x1a0)+_0x3e8bce['error']));}for(const _0x50f50c of _0x5ceb26[_0x4a0430(0x1d1)]){_0x50f50c[_0x4a0430(0x1fb)]==='error'&&console['log'](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x1ed)+_0x50f50c[_0x4a0430(0x176)]+_0x4a0430(0x1a0)+_0x50f50c[_0x4a0430(0x1a8)]));}for(const _0x1f0269 of _0x5ceb26[_0x4a0430(0x1f2)]){_0x1f0269[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5['red'](_0x4a0430(0x1c7)+_0x1f0269['name']+_0x4a0430(0x1a0)+_0x1f0269[_0x4a0430(0x1a8)]));}for(const _0x1c189e of _0x5ceb26[_0x4a0430(0x1dd)]){_0x1c189e[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x16d)+_0x1c189e['name']+'\x22:\x20'+_0x1c189e['error']));}for(const _0x5db0e9 of _0x5ceb26[_0x4a0430(0x17a)]){_0x5db0e9[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5['red'](_0x4a0430(0x19d)+_0x5db0e9[_0x4a0430(0x176)]+_0x4a0430(0x1a0)+_0x5db0e9[_0x4a0430(0x1a8)]));}return 0x1;}console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1aa)](_0x4a0430(0x19f)+(_0x8bd6a8+_0x4fbee9)+_0x4a0430(0x1a9)+_0x5ceb26[_0x4a0430(0x1f5)]+'\x27'));const _0x111129=getLLMProjectUrl(_0x533cee,_0x5ceb26['projectId']);return console[_0x4a0430(0x223)](_0x4a0430(0x20d)+a4_0x456cf5['cyan'](_0x111129)),0x0;}}
|
|
1
|
+
const a4_0x414ac0=a4_0x2985;(function(_0x2035d0,_0x18a4be){const _0x5f266b=a4_0x2985,_0xef2143=_0x2035d0();while(!![]){try{const _0x516ae7=-parseInt(_0x5f266b(0xdd))/0x1+parseInt(_0x5f266b(0xbe))/0x2+-parseInt(_0x5f266b(0xb8))/0x3+-parseInt(_0x5f266b(0x11c))/0x4*(parseInt(_0x5f266b(0xcf))/0x5)+parseInt(_0x5f266b(0xb3))/0x6*(parseInt(_0x5f266b(0xc0))/0x7)+parseInt(_0x5f266b(0x115))/0x8*(parseInt(_0x5f266b(0x101))/0x9)+parseInt(_0x5f266b(0x94))/0xa;if(_0x516ae7===_0x18a4be)break;else _0xef2143['push'](_0xef2143['shift']());}catch(_0x38eb71){_0xef2143['push'](_0xef2143['shift']());}}}(a4_0x99bb,0x36c43));import a4_0x13b9bc from'chalk';import a4_0x4bb12e from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x99bb(){const _0x3c86d1=['\x0aChanges\x20to\x20integration\x20\x27','401460zSRDPg','Cancelled','\x20errors','utf-8','outputDir','693972JIGzEC','New\x20project:\x20','execute','\x20\x20Prompt\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20resources?','405324TPUzhD','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','28HNkVJz','\x20--name\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','projectName','cyan','Using\x20project:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yellow','INVALID_ARGUMENT','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Integration\x20\x22','tdx.json','Analyzing\x20changes\x20to\x20push...','description','no_context','1024615bKdNYB','Using\x20project\x20from\x20context:\x20','llm_project','✔\x20Context\x20set:\x20','knowledgeBases','sourceProjectName','Using\x20local\x20project:\x20','Failed\x20to\x20push\x20agent:\x20','parse','name','site','\x20=\x20','agentName','\x0aErrors\x20found:','237152qnyTFE','dim','pushProject','\x20\x20tdx\x20agent\x20clone\x20agents/','Writing\x20files...','counts','\x22...','\x0aChanges\x20to\x20agent\x20\x27','hasChanges','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)','force','Agent:\x20','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Chat:\x20','dryRun','created','projectId','total','\x22:\x20','Status:\x20','Project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','isNew','Using\x20context\x20project:\x20','textKnowledgeBases','Output:\x20','\x0aWrite\x20','agent:clone','agents','\x0aProject\x20pushed\x20with\x20errors','pullProject','experimentalArtifacts','\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Using\x20project\x20from\x20','1194309zcKZSd','\x20changed','\x20\x20Knowledge\x20Bases:\x20','\x20|\x20','agent','Pushing\x20agent\x20from\x20\x22','pushAgent','\x20\x20Prompts:\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','\x0aPush\x20','push','cloneProject','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','new','\x20updated','diff','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Source:\x20','\x20\x20Target:\x20','gray','16cuCaSe','llmProject','\x20\x20Agents:\x20','-\x20nothing\x20pushed','\x20\x20Source:\x20','newProjectId','\x0a✔\x20Pulled\x20','4OJUIRU','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','New\x20project\x20ID:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','join','\x22\x20to\x20new\x20project\x20\x22','errors','outputPath','\x20total','session','\x20unchanged','\x20\x20Text\x20Knowledge\x20Bases:\x20','Pulling\x20agent\x20\x22','\x22\x20from\x20project\x20\x22','Agent\x20pulled\x20successfully','message','\x20new','\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','Project\x20cloned\x20with\x20errors','action','yes','Errors:','Using\x20current\x20project:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22\x20to\x20\x22','cwd','agentId','\x0aPull\x20summary\x20for\x20\x27','found','Agent\x20','integrations','no_local_folder','green','\x0aChanges:','\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\x20Artifact\x20\x22','\x20files?','agent:push','<new-name>','\x20\x20tdx\x20agent\x20pull\x20','No\x20tdx.json\x20found\x20in\x20','reason','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Base\x20\x22','experimentalKnowledgeBases','repeat','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','1620180jHodqu','prompts','llm','log','arg-dir','cwd-config','\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)','\x22\x20to\x20a\x20different\x20profile','Analyzing\x20project\x20\x22','Would\x20push\x20agent:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Project\x20cloned\x20successfully','New\x20project\x20name\x20is\x20required','Would\x20pull\x20agent:\x20','unchanged','\x20created','\x0aChanges\x20to\x20prompt\x20\x27','red','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Dry\x20run\x20-\x20no\x20changes\x20made','context','Summary:','\x0aError:','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','updated','\x20\x20Integrations:\x20','error','Output\x20path:\x20','dirname'];a4_0x99bb=function(){return _0x3c86d1;};return a4_0x99bb();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x2985(_0x2cd53a,_0x32f86f){_0x2cd53a=_0x2cd53a-0x7a;const _0x99bbcc=a4_0x99bb();let _0x29850a=_0x99bbcc[_0x2cd53a];return _0x29850a;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2cb894){const _0x57862a=a4_0x2985,_0x5818af=[];if(_0x2cb894['total']!==undefined)_0x5818af['push'](_0x2cb894[_0x57862a(0xef)]+_0x57862a(0x124));if(_0x2cb894[_0x57862a(0x10e)]!==undefined&&_0x2cb894['new']>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc[_0x57862a(0x85)](_0x2cb894[_0x57862a(0x10e)]+_0x57862a(0x12c)));if(_0x2cb894['created']!==undefined&&_0x2cb894[_0x57862a(0xed)]>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc[_0x57862a(0x85)](_0x2cb894[_0x57862a(0xed)]+_0x57862a(0xa4)));if(_0x2cb894[_0x57862a(0xad)]!==undefined&&_0x2cb894[_0x57862a(0xad)]>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc['yellow'](_0x2cb894[_0x57862a(0xad)]+_0x57862a(0x10f)));if(_0x2cb894[_0x57862a(0xa3)]!==undefined&&_0x2cb894['unchanged']>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc['gray'](_0x2cb894[_0x57862a(0xa3)]+_0x57862a(0x126)));if(_0x2cb894[_0x57862a(0x122)]!==undefined&&_0x2cb894[_0x57862a(0x122)]>0x0)_0x5818af['push'](a4_0x13b9bc[_0x57862a(0xa6)](_0x2cb894[_0x57862a(0x122)]+_0x57862a(0xb5)));return _0x5818af[_0x57862a(0x120)](',\x20');}function displayDiffs(_0x40efad,_0x27bbdf,_0x263ee4,_0x348acc,_0x457903,_0x2288b4,_0x4209ba){const _0x452ad6=a4_0x2985;for(const _0x285ef6 of _0x40efad){if(_0x285ef6[_0x452ad6(0x110)]){const _0x13dd2c=_0x285ef6[_0x452ad6(0xdb)]||_0x285ef6['name'];console[_0x452ad6(0x97)](_0x452ad6(0xe4)+_0x13dd2c+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x452ad6(0x97)](_0x285ef6[_0x452ad6(0x110)]),console['log']('─'[_0x452ad6(0x92)](0x3c));}}for(const _0x3e54c4 of _0x27bbdf){_0x3e54c4[_0x452ad6(0x110)]&&(console[_0x452ad6(0x97)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x3e54c4['name']+'\x27:'),console[_0x452ad6(0x97)]('─'['repeat'](0x3c)),console['log'](_0x3e54c4[_0x452ad6(0x110)]),console['log']('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x17affb of _0x263ee4){_0x17affb['diff']&&(console[_0x452ad6(0x97)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x17affb[_0x452ad6(0xd8)]+'\x27:'),console[_0x452ad6(0x97)]('─'['repeat'](0x3c)),console[_0x452ad6(0x97)](_0x17affb[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x1297aa of _0x348acc){_0x1297aa['diff']&&(console[_0x452ad6(0x97)](_0x452ad6(0xa5)+_0x1297aa['name']+'\x27:'),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)),console[_0x452ad6(0x97)](_0x1297aa[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x1cdd00 of _0x457903){_0x1cdd00[_0x452ad6(0x110)]&&(console[_0x452ad6(0x97)](_0x452ad6(0xb2)+_0x1cdd00['name']+'\x27:'),console[_0x452ad6(0x97)]('─'['repeat'](0x3c)),console[_0x452ad6(0x97)](_0x1cdd00[_0x452ad6(0x110)]),console['log']('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x40bd8d of _0x2288b4){_0x40bd8d['diff']&&(console[_0x452ad6(0x97)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x40bd8d[_0x452ad6(0xd8)]+'\x27:'),console['log']('─'[_0x452ad6(0x92)](0x3c)),console[_0x452ad6(0x97)](_0x40bd8d[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x9d5fa5 of _0x4209ba){_0x9d5fa5[_0x452ad6(0x110)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x9d5fa5[_0x452ad6(0xd8)]+'\x27:'),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)),console[_0x452ad6(0x97)](_0x9d5fa5[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x414ac0(0xcd)]=a4_0x414ac0(0x93);async['execute'](_0x17c732){const _0x2ff5bf=a4_0x414ac0,{options:_0xb3195c,args:_0x27e289,tdx:_0x49a75c}=_0x17c732,_0x11899a=_0x27e289[0x0],_0x1ec2cd=_0x27e289[0x1],_0x5ebb68=_0xb3195c['output'],_0x532de1=_0xb3195c[_0x2ff5bf(0xec)],_0x29669a=_0xb3195c['force'],_0x10d3f0=_0xb3195c[_0x2ff5bf(0x130)],_0x3194f6=_0xb3195c[_0x2ff5bf(0x116)],_0x5a697c=_0xb3195c[_0x2ff5bf(0x105)];let _0x17f524;if(_0x11899a){const _0xc0cc1=a4_0x4bb12e['join'](_0x11899a,_0x2ff5bf(0xcb));if(existsSync(_0xc0cc1))try{const _0x1aae3b=JSON[_0x2ff5bf(0xd7)](readFileSync(_0xc0cc1,_0x2ff5bf(0xb6)));_0x1aae3b[_0x2ff5bf(0xd1)]&&(_0x17f524={'llm_project':_0x1aae3b[_0x2ff5bf(0xd1)]});}catch{}}const _0x3ba971=findAgentConfigPath(process['cwd']());let _0x235342;if(_0x3ba971)try{const _0x2b1717=JSON['parse'](readFileSync(_0x3ba971,_0x2ff5bf(0xb6)));_0x2b1717[_0x2ff5bf(0xd1)]&&(_0x235342={'llm_project':_0x2b1717['llm_project']});}catch{}const _0x4b633e=resolveAgentPullArgs({'arg':_0x11899a,'agentNameArg':_0x1ec2cd,'agentFlag':_0x5a697c,'contextProject':_0x3194f6,'argDirConfig':_0x17f524,'cwdConfigPath':_0x3ba971||undefined,'cwdConfig':_0x235342}),{projectNameOrId:_0xf909f9,targetAgentName:_0xae1d6a,existingOutputDir:_0x35b246,source:_0x1d0bcd}=_0x4b633e;if(_0x1d0bcd===_0x2ff5bf(0x98))console[_0x2ff5bf(0x97)](a4_0x13b9bc['dim'](_0x2ff5bf(0x100)+a4_0x4bb12e['join'](_0x11899a,'tdx.json')+':\x20'+_0xf909f9));else{if(_0x1d0bcd===_0x2ff5bf(0x99))console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0xde)](_0x2ff5bf(0xc5)+_0xf909f9));else _0x1d0bcd==='context'&&console['log'](a4_0x13b9bc[_0x2ff5bf(0xde)](_0x2ff5bf(0xd0)+_0xf909f9));}if(!_0xf909f9)return _0x5a697c?(console[_0x2ff5bf(0x97)](a4_0x13b9bc['yellow'](_0x2ff5bf(0x111))),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xf3)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xbc))):(console['log'](a4_0x13b9bc[_0x2ff5bf(0xc7)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xe6)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0x87)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0x12d)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0x109)),console[_0x2ff5bf(0x97)]('\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(_0xae1d6a){const {data:_0x24a323}=await withSpinner(_0x2ff5bf(0x128)+_0xae1d6a+_0x2ff5bf(0x129)+_0xf909f9+'\x22...',()=>_0x49a75c[_0x2ff5bf(0x96)]['pullAgent'](_0xf909f9,_0xae1d6a,_0x5ebb68,{'dryRun':_0x532de1,'force':_0x29669a}));if(_0x532de1)return console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0xc7)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xa2)+_0x24a323[_0x2ff5bf(0xdb)]),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xb0)+_0x24a323[_0x2ff5bf(0x123)]),_0x24a323[_0x2ff5bf(0x110)]&&(console[_0x2ff5bf(0x97)](_0x2ff5bf(0x86)),console[_0x2ff5bf(0x97)]('─'[_0x2ff5bf(0x92)](0x3c)),console[_0x2ff5bf(0x97)](_0x24a323[_0x2ff5bf(0x110)]),console[_0x2ff5bf(0x97)]('─'[_0x2ff5bf(0x92)](0x3c))),0x0;return console[_0x2ff5bf(0x97)](a4_0x13b9bc['green'](_0x2ff5bf(0x12a))),console[_0x2ff5bf(0x97)]('Agent:\x20'+_0x24a323[_0x2ff5bf(0xdb)]),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xf7)+_0x24a323['outputPath']),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xf1)+(_0x24a323[_0x2ff5bf(0xf4)]?a4_0x13b9bc[_0x2ff5bf(0x85)](_0x2ff5bf(0x10e)):_0x24a323[_0x2ff5bf(0xe5)]?a4_0x13b9bc[_0x2ff5bf(0xc7)](_0x2ff5bf(0xad)):a4_0x13b9bc[_0x2ff5bf(0x114)]('unchanged'))),0x0;}const _0x41eca6=_0x35b246||_0x5ebb68,{data:_0x313168}=await withSpinner(_0x2ff5bf(0x9c)+_0xf909f9+_0x2ff5bf(0xe3),()=>_0x49a75c[_0x2ff5bf(0x96)][_0x2ff5bf(0xfc)](_0xf909f9,_0x41eca6,{'dryRun':!![]})),_0x30af77=_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfa)][_0x2ff5bf(0x10e)]+_0x313168['counts'][_0x2ff5bf(0xd3)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xf6)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x95)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x83)][_0x2ff5bf(0x10e)]+_0x313168['counts'][_0x2ff5bf(0x91)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfd)][_0x2ff5bf(0x10e)],_0x43cd8e=_0x313168['counts'][_0x2ff5bf(0xfa)][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xd3)][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)]['textKnowledgeBases']['updated']+_0x313168[_0x2ff5bf(0xe2)]['prompts'][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x83)]['updated']+_0x313168[_0x2ff5bf(0xe2)]['experimentalKnowledgeBases'][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)]['experimentalArtifacts']['updated'],_0x5ccf0b=_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfa)][_0x2ff5bf(0xa3)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xd3)][_0x2ff5bf(0xa3)]+_0x313168['counts'][_0x2ff5bf(0xf6)][_0x2ff5bf(0xa3)]+_0x313168['counts'][_0x2ff5bf(0x95)][_0x2ff5bf(0xa3)]+_0x313168[_0x2ff5bf(0xe2)]['integrations'][_0x2ff5bf(0xa3)]+_0x313168['counts'][_0x2ff5bf(0x91)][_0x2ff5bf(0xa3)]+_0x313168[_0x2ff5bf(0xe2)]['experimentalArtifacts'][_0x2ff5bf(0xa3)];console[_0x2ff5bf(0x97)](_0x2ff5bf(0x80)+_0x313168[_0x2ff5bf(0xc3)]+'\x27:'),console[_0x2ff5bf(0x97)]('\x20\x20'+a4_0x13b9bc['green']('+\x20'+_0x30af77+_0x2ff5bf(0x12c))+'\x20|\x20'+a4_0x13b9bc[_0x2ff5bf(0xc7)]('~\x20'+_0x43cd8e+_0x2ff5bf(0x102))+_0x2ff5bf(0x104)+a4_0x13b9bc[_0x2ff5bf(0xde)]('=\x20'+_0x5ccf0b+_0x2ff5bf(0x126))),console['log'](_0x2ff5bf(0x117)+formatCountSummary(_0x313168['counts'][_0x2ff5bf(0xfa)])),console[_0x2ff5bf(0x97)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x313168['counts']['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x313168['counts'][_0x2ff5bf(0xf6)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x313168['counts'][_0x2ff5bf(0x95)])),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xae)+formatCountSummary(_0x313168[_0x2ff5bf(0xe2)]['integrations']));const _0x368315=_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x91)][_0x2ff5bf(0xef)]>0x0||_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfd)]['total']>0x0;_0x368315&&(console['log'](_0x2ff5bf(0x11d)+formatCountSummary(_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x91)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x313168[_0x2ff5bf(0xe2)]['experimentalArtifacts'])));console['log'](_0x2ff5bf(0x113)+a4_0x13b9bc['cyan'](_0x313168[_0x2ff5bf(0xb7)])),displayDiffs(_0x313168[_0x2ff5bf(0xfa)],_0x313168[_0x2ff5bf(0xd3)],_0x313168[_0x2ff5bf(0xf6)],_0x313168['prompts'],_0x313168[_0x2ff5bf(0x83)],_0x313168[_0x2ff5bf(0x91)],_0x313168[_0x2ff5bf(0xfd)]);if(_0x532de1)return console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0xc7)](_0x2ff5bf(0xc6))),0x0;if(_0x30af77===0x0&&_0x43cd8e===0x0)return console[_0x2ff5bf(0x97)](a4_0x13b9bc['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x313168['projectName']},_0xb3195c[_0x2ff5bf(0x125)]),console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0x85)](_0x2ff5bf(0xd2)+a4_0x13b9bc[_0x2ff5bf(0xde)](_0x2ff5bf(0xd1))+_0x2ff5bf(0xda)+a4_0x13b9bc[_0x2ff5bf(0xc4)](_0x313168['projectName']))),0x0;if(!_0x10d3f0&&!_0x29669a){if(!isInteractive())return console['error'](a4_0x13b9bc[_0x2ff5bf(0xa6)](_0x2ff5bf(0xab)),_0x2ff5bf(0x9e)),console[_0x2ff5bf(0xaf)](a4_0x13b9bc['dim'](_0x2ff5bf(0xc9))),0x1;const _0x6f90b9=await confirmKey(_0x2ff5bf(0xf8)+(_0x30af77+_0x43cd8e)+_0x2ff5bf(0x89));if(!_0x6f90b9)return console[_0x2ff5bf(0x97)](a4_0x13b9bc['yellow'](_0x2ff5bf(0xb4)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x44b2ed}=await withSpinner(_0x2ff5bf(0xe1),()=>_0x49a75c[_0x2ff5bf(0x96)][_0x2ff5bf(0xfc)](_0xf909f9,_0x41eca6,{'force':_0x29669a}));return console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0x85)](_0x2ff5bf(0x11b)+(_0x30af77+_0x43cd8e)+_0x2ff5bf(0xfe)+_0x44b2ed[_0x2ff5bf(0xb7)])),saveSessionContext({'llm_project':_0x44b2ed['projectName']},_0xb3195c[_0x2ff5bf(0x125)]),console[_0x2ff5bf(0x97)](a4_0x13b9bc['green'](_0x2ff5bf(0xd2)+a4_0x13b9bc['dim'](_0x2ff5bf(0xd1))+_0x2ff5bf(0xda)+a4_0x13b9bc['cyan'](_0x44b2ed['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x414ac0(0xd8)]=a4_0x414ac0(0xf9);[a4_0x414ac0(0xcd)]=a4_0x414ac0(0xa7);async[a4_0x414ac0(0xba)](_0x1ae2dc){const _0x524480=a4_0x414ac0,{options:_0x755412,args:_0x37afac,tdx:_0xb6144b}=_0x1ae2dc,_0x2fdb7b=_0x37afac[0x0],_0x22d068=_0x755412[_0x524480(0xd8)],_0x28fc25=_0x755412['dryRun'],_0x265583=_0x755412['yes'],_0x4233ca=_0x755412[_0x524480(0xd9)],_0x3724e6=_0x755412[_0x524480(0x116)];let _0x1c1942;const _0x2195ef=findAgentConfigPath(process[_0x524480(0x7e)]());if(_0x2fdb7b){const _0x49a2ed=a4_0x4bb12e[_0x524480(0x120)](_0x2fdb7b,_0x524480(0xcb));existsSync(_0x49a2ed)?(_0x1c1942=_0x2fdb7b,console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xde)](_0x524480(0xd5)+_0x2fdb7b))):_0x1c1942=_0x2fdb7b;}else{if(_0x2195ef)_0x1c1942=a4_0x4bb12e[_0x524480(0xb1)](_0x2195ef),console['log'](a4_0x13b9bc['dim'](_0x524480(0x7b)+_0x1c1942));else{if(_0x3724e6){const _0x3bb0db=sanitizeForFilesystem(_0x3724e6);let _0x2e3562=_0x3bb0db,_0x4144e5=a4_0x4bb12e['join'](process[_0x524480(0x7e)](),_0x524480(0xfa),_0x3bb0db,'tdx.json');if(!existsSync(_0x4144e5)){const _0x15afb6=normalizeName(_0x3724e6),_0x5bdbf0=a4_0x4bb12e[_0x524480(0x120)](process[_0x524480(0x7e)](),_0x524480(0xfa),_0x15afb6,_0x524480(0xcb));existsSync(_0x5bdbf0)&&(_0x2e3562=_0x15afb6,_0x4144e5=_0x5bdbf0);}if(existsSync(_0x4144e5))_0x1c1942=a4_0x4bb12e[_0x524480(0xb1)](_0x4144e5),console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xde)](_0x524480(0xd5)+_0x1c1942));else{const _0x5ce78e=_0x755412['profile'];if(_0x5ce78e)throw new SDKError(ErrorCode[_0x524480(0xc8)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3724e6+_0x524480(0x9b),undefined,{'helpText':_0x524480(0x7c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x524480(0x8c)+_0x3724e6+'\x0a')+(_0x524480(0xe0)+_0x2e3562+_0x524480(0xc1)+(_0x22d068||_0x524480(0x8b))+'\x20--profile\x20'+_0x5ce78e)});_0x1c1942=_0x3724e6,console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xde)](_0x524480(0xf5)+_0x3724e6));}}}}if(!_0x1c1942)return console[_0x524480(0x97)](a4_0x13b9bc['yellow'](_0x524480(0x9f))),console[_0x524480(0x97)](_0x524480(0xac)),console['log'](_0x524480(0x10d)),console[_0x524480(0x97)](_0x524480(0x9a)),console[_0x524480(0x97)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x22d068)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x524480(0xa1),undefined,{'helpText':_0x524480(0x11f)});if(!_0x265583&&!_0x28fc25){if(!isInteractive())return console[_0x524480(0xaf)](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0xab)),_0x524480(0x9e)),console[_0x524480(0xaf)](a4_0x13b9bc[_0x524480(0xde)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x482cb3=await confirmKey('Clone\x20\x22'+_0x1c1942+_0x524480(0x121)+_0x22d068+'\x22?');if(!_0x482cb3)return console[_0x524480(0x97)](a4_0x13b9bc['yellow']('Cancelled')),0x1;}const {data:_0x2aee27}=await withSpinner('Cloning\x20\x22'+_0x1c1942+_0x524480(0x7d)+_0x22d068+_0x524480(0xe3),()=>_0xb6144b['llm'][_0x524480(0x10c)](_0x1c1942,_0x22d068,{'dryRun':_0x28fc25}));if(_0x28fc25){console['log'](a4_0x13b9bc[_0x524480(0xc7)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x524480(0x97)](_0x524480(0x112)+_0x2aee27[_0x524480(0xd4)]),console[_0x524480(0x97)](_0x524480(0xb9)+_0x22d068),console[_0x524480(0x97)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x2aee27[_0x524480(0xe2)][_0x524480(0xfa)]['created']),console[_0x524480(0x97)](_0x524480(0x103)+_0x2aee27['counts']['knowledgeBases'][_0x524480(0xed)]),console['log']('\x20\x20Prompts:\x20'+_0x2aee27[_0x524480(0xe2)]['prompts'][_0x524480(0xed)]);const _0x23ba3a=_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xed)]>0x0||_0x2aee27[_0x524480(0xe2)]['experimentalArtifacts'][_0x524480(0xed)]>0x0;return _0x23ba3a&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x2aee27[_0x524480(0xe2)]['experimentalKnowledgeBases'][_0x524480(0xed)]),console[_0x524480(0x97)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)]['created'])),0x0;}const _0x2b1b3e=_0x2aee27['counts'][_0x524480(0xfa)][_0x524480(0x122)]>0x0||_0x2aee27['counts'][_0x524480(0xd3)]['errors']>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x95)][_0x524480(0x122)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)]['errors']>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)]['errors']>0x0;_0x2b1b3e?console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xc7)](_0x524480(0x12e))):console['log'](a4_0x13b9bc[_0x524480(0x85)](_0x524480(0xa0)));console[_0x524480(0x97)](_0x524480(0x112)+_0x2aee27[_0x524480(0xd4)]),console[_0x524480(0x97)]('New\x20project:\x20'+_0x2aee27['newProjectName']),console['log'](_0x524480(0x11e)+_0x2aee27[_0x524480(0x11a)]),console[_0x524480(0x97)](),console[_0x524480(0x97)](_0x524480(0xaa)),console['log'](_0x524480(0x117)+formatCountSummary(_0x2aee27[_0x524480(0xe2)][_0x524480(0xfa)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2aee27[_0x524480(0xe2)][_0x524480(0xd3)])),console['log'](_0x524480(0x108)+formatCountSummary(_0x2aee27['counts'][_0x524480(0x95)])),console[_0x524480(0x97)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2aee27[_0x524480(0xe2)]['integrations']));const _0x2275c7=_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xed)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xad)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xa3)]>0x0||_0x2aee27[_0x524480(0xe2)]['experimentalArtifacts'][_0x524480(0xed)]>0x0||_0x2aee27['counts']['experimentalArtifacts'][_0x524480(0xad)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)]['unchanged']>0x0;_0x2275c7&&(console[_0x524480(0x97)](_0x524480(0x11d)+formatCountSummary(_0x2aee27['counts']['experimentalKnowledgeBases'])),console[_0x524480(0x97)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)])));if(_0x2b1b3e){console[_0x524480(0x97)](),console['log'](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0x7a)));for(const _0x1af969 of _0x2aee27['agents']){_0x1af969['action']===_0x524480(0xaf)&&console['log'](a4_0x13b9bc[_0x524480(0xa6)]('\x20\x20Agent\x20\x22'+_0x1af969['agentName']+_0x524480(0xf0)+_0x1af969[_0x524480(0xaf)]));}for(const _0x325043 of _0x2aee27[_0x524480(0xd3)]){_0x325043[_0x524480(0x12f)]==='error'&&console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0x90)+_0x325043[_0x524480(0xd8)]+_0x524480(0xf0)+_0x325043['error']));}for(const _0x27793a of _0x2aee27[_0x524480(0x95)]){_0x27793a[_0x524480(0x12f)]===_0x524480(0xaf)&&console[_0x524480(0x97)](a4_0x13b9bc['red']('\x20\x20Prompt\x20\x22'+_0x27793a['name']+_0x524480(0xf0)+_0x27793a[_0x524480(0xaf)]));}for(const _0x2198ca of _0x2aee27[_0x524480(0x83)]){_0x2198ca['action']===_0x524480(0xaf)&&console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0xca)+_0x2198ca['name']+'\x22:\x20'+_0x2198ca[_0x524480(0xaf)]));}for(const _0x375e29 of _0x2aee27['experimentalKnowledgeBases']){_0x375e29[_0x524480(0x12f)]===_0x524480(0xaf)&&console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xa6)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x375e29[_0x524480(0xd8)]+_0x524480(0xf0)+_0x375e29[_0x524480(0xaf)]));}for(const _0x2df7c5 of _0x2aee27[_0x524480(0xfd)]){_0x2df7c5[_0x524480(0x12f)]==='error'&&console['log'](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0x88)+_0x2df7c5[_0x524480(0xd8)]+_0x524480(0xf0)+_0x2df7c5[_0x524480(0xaf)]));}return 0x1;}console['log']();const _0x15dc53=getLLMProjectUrl(_0x4233ca,_0x2aee27[_0x524480(0x11a)]);return console[_0x524480(0x97)](_0x524480(0xf2)+a4_0x13b9bc['cyan'](_0x15dc53)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x414ac0(0xd8)]=a4_0x414ac0(0x8a);[a4_0x414ac0(0xcd)]=a4_0x414ac0(0x8f);async[a4_0x414ac0(0xba)](_0x1f183c){const _0x1a77d2=a4_0x414ac0,{options:_0x15d8be,args:_0x334f40,tdx:_0x402b5e}=_0x1f183c;let _0x48d2f4=_0x334f40[0x0]||process['cwd']();const _0xbbaf47=_0x15d8be['dryRun'],_0x49c1be=_0x15d8be[_0x1a77d2(0xe7)],_0xb6c27=_0x15d8be['yes'],_0x246e68=_0x15d8be['site'],_0x1b996d=a4_0x4bb12e[_0x1a77d2(0x120)](_0x48d2f4,'agent.yml'),_0x195fc4=existsSync(_0x1b996d);if(_0x195fc4){const {data:_0x43bb5d}=await withSpinner(_0x1a77d2(0x106)+_0x48d2f4+_0x1a77d2(0xe3),()=>_0x402b5e['llm'][_0x1a77d2(0x107)](_0x48d2f4,{'dryRun':_0xbbaf47,'force':_0x49c1be}));if(_0xbbaf47)return console['log'](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xa8))),console[_0x1a77d2(0x97)](_0x1a77d2(0x9d)+_0x43bb5d['agentName']),0x0;if(_0x43bb5d['action']===_0x1a77d2(0xaf))return console[_0x1a77d2(0x97)](a4_0x13b9bc['red'](_0x1a77d2(0xd6)+_0x43bb5d[_0x1a77d2(0xaf)])),0x1;console['log'](a4_0x13b9bc[_0x1a77d2(0x85)](_0x1a77d2(0x82)+_0x43bb5d[_0x1a77d2(0x12f)]+'\x20successfully')),console[_0x1a77d2(0x97)](_0x1a77d2(0xe8)+_0x43bb5d[_0x1a77d2(0xdb)]);if(_0x43bb5d[_0x1a77d2(0x7f)]&&_0x43bb5d[_0x1a77d2(0xee)]){const _0x5e7a2d=getLLMAgentChatUrl(_0x246e68,_0x43bb5d[_0x1a77d2(0xee)],_0x43bb5d[_0x1a77d2(0x7f)]);console[_0x1a77d2(0x97)](_0x1a77d2(0xeb)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x5e7a2d));}return 0x0;}const _0x38448a=_0x15d8be['llmProject'],_0x40fc6e=resolveProjectFromContext(_0x48d2f4,_0x38448a);if(_0x40fc6e[_0x1a77d2(0x81)])_0x48d2f4=_0x40fc6e['projectDir'],_0x40fc6e['source']===_0x1a77d2(0xa9)&&console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xde)](_0x1a77d2(0xc5)+_0x48d2f4));else{let _0x3dcf68=_0x1a77d2(0xc2);_0x40fc6e[_0x1a77d2(0x8e)]===_0x1a77d2(0x84)&&(_0x3dcf68=_0x40fc6e[_0x1a77d2(0x12b)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x40fc6e[_0x1a77d2(0x116)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x1a77d2(0xc8)],_0x40fc6e[_0x1a77d2(0x8e)]===_0x1a77d2(0xce)?_0x40fc6e['message']:_0x1a77d2(0x8d)+_0x48d2f4,undefined,{'helpText':_0x3dcf68});}const {data:_0x795cc4}=await withSpinner(_0x1a77d2(0xcc),()=>_0x402b5e[_0x1a77d2(0x96)][_0x1a77d2(0xdf)](_0x48d2f4,{'dryRun':!![]})),_0x4bea4f=_0x795cc4['counts'][_0x1a77d2(0xfa)][_0x1a77d2(0x122)]>0x0;if(_0x4bea4f){console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xdc)));for(const _0x10a0ae of _0x795cc4[_0x1a77d2(0xfa)]){_0x10a0ae[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)]('\x20\x20Agent\x20\x22'+_0x10a0ae[_0x1a77d2(0xdb)]+_0x1a77d2(0xf0)+_0x10a0ae[_0x1a77d2(0xaf)]));}return 0x1;}const _0x1dc56a=_0x795cc4[_0x1a77d2(0xe2)]['agents'][_0x1a77d2(0xed)]+_0x795cc4['counts'][_0x1a77d2(0xd3)][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)]['textKnowledgeBases'][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x95)][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)]['integrations'][_0x1a77d2(0xed)]+_0x795cc4['counts'][_0x1a77d2(0x91)][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xed)],_0x267c5f=_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfa)]['updated']+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xf6)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x95)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x83)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x91)][_0x1a77d2(0xad)]+_0x795cc4['counts'][_0x1a77d2(0xfd)][_0x1a77d2(0xad)],_0x2dc851=_0x795cc4['counts'][_0x1a77d2(0xfa)][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xf6)][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)]['prompts']['unchanged']+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x83)][_0x1a77d2(0xa3)]+_0x795cc4['counts']['experimentalKnowledgeBases'][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xa3)];console[_0x1a77d2(0x97)]('\x0aPush\x20summary\x20for\x20\x27'+_0x795cc4['projectName']+'\x27:'),console[_0x1a77d2(0x97)]('\x20\x20'+a4_0x13b9bc['green']('+\x20'+_0x1dc56a+'\x20new')+'\x20|\x20'+a4_0x13b9bc[_0x1a77d2(0xc7)]('~\x20'+_0x267c5f+_0x1a77d2(0x102))+'\x20|\x20'+a4_0x13b9bc[_0x1a77d2(0xde)]('=\x20'+_0x2dc851+_0x1a77d2(0x126))),console[_0x1a77d2(0x97)](_0x1a77d2(0x117)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfa)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)])),console['log'](_0x1a77d2(0x127)+formatCountSummary(_0x795cc4['counts'][_0x1a77d2(0xf6)])),console[_0x1a77d2(0x97)](_0x1a77d2(0x108)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x95)])),console[_0x1a77d2(0x97)](_0x1a77d2(0xae)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x83)]));const _0x26d1e6=_0x795cc4['counts'][_0x1a77d2(0x91)]['created']>0x0||_0x795cc4['counts']['experimentalKnowledgeBases'][_0x1a77d2(0xad)]>0x0||_0x795cc4['counts'][_0x1a77d2(0x91)][_0x1a77d2(0xa3)]>0x0||_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)]['created']>0x0||_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xad)]>0x0||_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xa3)]>0x0;_0x26d1e6&&(console[_0x1a77d2(0x97)](_0x1a77d2(0x11d)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x91)])),console[_0x1a77d2(0x97)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)]['experimentalArtifacts'])));console[_0x1a77d2(0x97)](_0x1a77d2(0x119)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x48d2f4)),displayDiffs(_0x795cc4['agents'],_0x795cc4[_0x1a77d2(0xd3)],_0x795cc4[_0x1a77d2(0xf6)],_0x795cc4[_0x1a77d2(0x95)],_0x795cc4[_0x1a77d2(0x83)],_0x795cc4[_0x1a77d2(0x91)],_0x795cc4[_0x1a77d2(0xfd)]);if(_0xbbaf47)return console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xff))),0x0;if(_0x1dc56a===0x0&&_0x267c5f===0x0){console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0x85)](_0x1a77d2(0xbf)));const _0x3135de=getLLMProjectUrl(_0x246e68,_0x795cc4[_0x1a77d2(0xee)]);return console[_0x1a77d2(0x97)](_0x1a77d2(0xf2)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x3135de)),0x0;}if(!_0xb6c27&&!_0x49c1be){if(!isInteractive())return console['error'](a4_0x13b9bc['red']('\x0aError:'),_0x1a77d2(0x9e)),console[_0x1a77d2(0xaf)](a4_0x13b9bc[_0x1a77d2(0xde)](_0x1a77d2(0xc9))),0x1;const _0xb4ff3b=await confirmKey(_0x1a77d2(0x10a)+(_0x1dc56a+_0x267c5f)+_0x1a77d2(0xbd));if(!_0xb4ff3b)return console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xb4)),_0x1a77d2(0x118)),0x1;}const {data:_0x23806f}=await withSpinner('Pushing\x20to\x20project...',()=>_0x402b5e[_0x1a77d2(0x96)][_0x1a77d2(0xdf)](_0x48d2f4,{'force':_0x49c1be})),_0x59422b=_0x23806f['counts'][_0x1a77d2(0xfa)][_0x1a77d2(0x122)]>0x0||_0x23806f[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)][_0x1a77d2(0x122)]>0x0||_0x23806f[_0x1a77d2(0xe2)][_0x1a77d2(0xf6)][_0x1a77d2(0x122)]>0x0||_0x23806f[_0x1a77d2(0xe2)][_0x1a77d2(0x95)]['errors']>0x0;if(_0x59422b){console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xfb))),console[_0x1a77d2(0x97)](),console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0x7a)));for(const _0x459db3 of _0x23806f[_0x1a77d2(0xfa)]){_0x459db3[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xe9)+_0x459db3[_0x1a77d2(0xdb)]+_0x1a77d2(0xf0)+_0x459db3[_0x1a77d2(0xaf)]));}for(const _0x21e51b of _0x23806f['knowledgeBases']){_0x21e51b[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x21e51b[_0x1a77d2(0xd8)]+_0x1a77d2(0xf0)+_0x21e51b[_0x1a77d2(0xaf)]));}for(const _0x54fc72 of _0x23806f['textKnowledgeBases']){_0x54fc72['action']===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xea)+_0x54fc72['name']+'\x22:\x20'+_0x54fc72['error']));}for(const _0x27c6ae of _0x23806f['prompts']){_0x27c6ae[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xbb)+_0x27c6ae['name']+_0x1a77d2(0xf0)+_0x27c6ae[_0x1a77d2(0xaf)]));}for(const _0x397f73 of _0x23806f[_0x1a77d2(0x83)]){_0x397f73['action']===_0x1a77d2(0xaf)&&console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xca)+_0x397f73['name']+'\x22:\x20'+_0x397f73[_0x1a77d2(0xaf)]));}return 0x1;}console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0x85)]('\x0a✔\x20Pushed\x20'+(_0x1dc56a+_0x267c5f)+'\x20resources\x20to\x20\x27'+_0x23806f[_0x1a77d2(0xc3)]+'\x27'));const _0x3a2269=getLLMProjectUrl(_0x246e68,_0x23806f[_0x1a77d2(0xee)]);return console['log'](_0x1a77d2(0xf2)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x3a2269)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x2f4431=a5_0x3ea0;function a5_0x3ea0(_0x413718,_0x9c2152){_0x413718=_0x413718-0x142;const _0x45a2b1=a5_0x45a2();let _0x3ea0f0=_0x45a2b1[_0x413718];return _0x3ea0f0;}(function(_0x195cb2,_0x22cf48){const _0x1a7f93=a5_0x3ea0,_0x1fce63=_0x195cb2();while(!![]){try{const _0x3f73ae=-parseInt(_0x1a7f93(0x158))/0x1+parseInt(_0x1a7f93(0x171))/0x2+-parseInt(_0x1a7f93(0x18a))/0x3*(parseInt(_0x1a7f93(0x1a0))/0x4)+parseInt(_0x1a7f93(0x1a3))/0x5+-parseInt(_0x1a7f93(0x178))/0x6*(parseInt(_0x1a7f93(0x18f))/0x7)+parseInt(_0x1a7f93(0x1d1))/0x8+-parseInt(_0x1a7f93(0x17f))/0x9;if(_0x3f73ae===_0x22cf48)break;else _0x1fce63['push'](_0x1fce63['shift']());}catch(_0x47df24){_0x1fce63['push'](_0x1fce63['shift']());}}}(a5_0x45a2,0xed2c0));function a5_0x45a2(){const _0xa29820=['1719125jrgwTv','llmProject','dim','Project\x20path:\x20','timestamp','\x22:\x20','Evaluating\x20response...','source','no_tests','conversation_url','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','No\x20tests\x20have\x20tags\x20defined.','includes','Running:\x20','Agent:\x20','Errors:\x20\x20\x20',':\x20Sending\x20user\x20input...','testName','llm','...','projectName','Running\x20agent\x20tests...','Cached\x20run\x20from:\x20','status','tags','3859468KOFFYP','Executing\x20new\x20tests...','reeval','agent','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','test.yml','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','57984OMsKFW','rounds','Using\x20agent:\x20','now','Round\x201/','Re-evaluating\x20','agentDirs','13557753FJXYyK','Re-evaluation\x20Summary','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Running\x20test:\x20','log','cyan','jsonl','\x20(new)','push','\x20\x20Evaluating...\x20','not\x20found','6DhXnGj','existsSync','Test\x20Summary','red','Either\x20switch\x20to\x20the\x20\x22','280YgumSI','Re-evaluating\x20cached\x20test\x20run...','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','stop','projectDir','agentName','filter','find','Error:\x20No\x20previous\x20test\x20run\x20found.','Failed\x20Tests:','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','ERROR','add','✓\x20PASS:\x20','utf-8','Run\x20\x27tdx\x20agent\x20pull\x20','tsv','1265032nMxHkX','Round\x20','✗\x20ERROR:\x20','8473535USPmwy','writeFileSync','basename','Available\x20tests:\x20','\x20-\x20','\x20\x20Conversation:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','text','toLowerCase','no_local_folder','\x20\x20Round\x20','tests','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Re-evaluating...','testYmlPath','length','resolveProjectId','repeat','split','⚠\x20SKIPPED:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\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','FAIL','Run\x20tests\x20for\x20an\x20LLM\x20agent','No\x20tests\x20found\x20with\x20tags:\x20','agent:test','executeReeval','no_context','404','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','\x22,\x20but\x20current\x20site\x20is\x20\x22','dryRun','\x20\x20Agent:\x20','Usage:','Passed:\x20\x20\x20','\x20\x20Site:\x20','json','✗\x20FAIL:\x20','site','\x20(cached)','conversations','reason','context','eval','No\x20tests\x20found\x20matching:\x20','Total:\x20\x20\x20\x20','12733064xqkXhx','start','trim','message','Test\x20','verbose','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','map','\x20\x20-\x20','has','found','PASS','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','...\x20','multiple_agents','Output\x20written\x20to:\x20','Test\x20Configuration:','Duration:\x20','substring','output','yellow','description','some','isSpinning','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20Project:\x20','green','Site:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','white','Tests\x20found:\x20','toISOString','join','name','table'];a5_0x45a2=function(){return _0xa29820;};return a5_0x45a2();}import*as a5_0x3912be from'node:fs';import*as a5_0x18641e from'node:path';import a5_0x490e8c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x2f4431(0x1bc);[a5_0x2f4431(0x14a)]=a5_0x2f4431(0x1ba);async['execute'](_0x143bb8){const _0x230b61=a5_0x2f4431,{options:_0xa564e8,args:_0xbdeb58,tdx:_0x1420a9}=_0x143bb8,_0x15a18a=_0xbdeb58[0x0]||'.',_0x1efcc1=_0xa564e8[_0x230b61(0x1c2)],_0x1842d6=_0xa564e8,_0x1f0049=_0x1842d6[_0x230b61(0x1ce)]===![],_0x176409=_0x1842d6[_0x230b61(0x173)],_0xca1452=_0x1842d6[_0x230b61(0x156)],_0x573194=_0x1842d6[_0x230b61(0x170)],_0x5226da=_0xa564e8['site'],_0x232978=_0x1842d6[_0x230b61(0x148)];if(_0x176409&&_0x1f0049)return console[_0x230b61(0x183)](a5_0x490e8c['red'](_0x230b61(0x1dd))),0x1;let _0x3a48fc=_0x230b61(0x157);if(_0x1842d6['json'])_0x3a48fc=_0x230b61(0x1c7);else{if(_0x1842d6[_0x230b61(0x185)])_0x3a48fc='jsonl';else{if(_0x1842d6[_0x230b61(0x19f)])_0x3a48fc=_0x230b61(0x19f);else{if(_0x1842d6[_0x230b61(0x157)])_0x3a48fc=_0x230b61(0x157);}}}const _0x555805=_0x1842d6['llmProject'];let _0x21334a=_0x15a18a;const _0x5168e1=a5_0x3912be[_0x230b61(0x18b)](_0x15a18a),_0x2ce4a2=_0x15a18a==='.';if(!_0x5168e1||_0x2ce4a2){const _0x21a4cc=resolveProjectFromContext(_0x15a18a,_0x555805,{'requireFile':_0x230b61(0x176)});if(_0x21a4cc[_0x230b61(0x1db)])_0x21334a=_0x21a4cc['projectDir'],_0x21a4cc[_0x230b61(0x15f)]===_0x230b61(0x1cd)&&console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x17a)+_0x21334a));else switch(_0x21a4cc[_0x230b61(0x1cc)]){case _0x230b61(0x1be):console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x21a4cc[_0x230b61(0x1d4)])),console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x230b61(0x1c4)),console[_0x230b61(0x183)](_0x230b61(0x1b8)),console[_0x230b61(0x183)](_0x230b61(0x1c0)),console['log'](),console[_0x230b61(0x183)](_0x230b61(0x162));return 0x1;case _0x230b61(0x1ac):console['log'](a5_0x490e8c['yellow'](_0x21a4cc[_0x230b61(0x1d4)])),console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x230b61(0x19e)+_0x21a4cc[_0x230b61(0x159)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x230b61(0x143):{const _0x1791d1=a5_0x18641e[_0x230b61(0x1a5)](_0x21a4cc[_0x230b61(0x193)]);console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x1af)+_0x21a4cc[_0x230b61(0x159)]+'\x22:'));for(const _0x1a62e8 of _0x21a4cc[_0x230b61(0x17e)]){console[_0x230b61(0x183)](_0x230b61(0x1d9)+_0x1a62e8);}return console['log'](),console['log'](_0x230b61(0x1b7)+_0x1791d1+'/<agent-name>'),0x1;}case _0x230b61(0x160):console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x181)+_0x21a4cc['llmProject']+'\x22.')),console['log'](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x15b)+_0x21a4cc[_0x230b61(0x193)])),console[_0x230b61(0x183)](),console['log'](_0x230b61(0x177));return 0x1;}}const {definition:_0x2b250b,agentInfo:_0x1bee6a}=parseTestFile(_0x21334a);let _0x1dbe7c=_0x2b250b[_0x230b61(0x1ae)];if(_0xca1452){const _0x4ba862=_0xca1452[_0x230b61(0x1b5)](',')[_0x230b61(0x1d8)](_0x5ef65c=>_0x5ef65c[_0x230b61(0x1d3)]());_0x1dbe7c=_0x2b250b[_0x230b61(0x1ae)]['filter'](_0x2159b2=>_0x4ba862[_0x230b61(0x164)](_0x2159b2[_0x230b61(0x156)]));if(_0x1dbe7c[_0x230b61(0x1b2)]===0x0)return console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x1cf)+_0xca1452)),console['log'](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x1a6)+_0x2b250b[_0x230b61(0x1ae)][_0x230b61(0x1d8)](_0x550fb8=>_0x550fb8[_0x230b61(0x156)])[_0x230b61(0x155)](',\x20'))),0x1;}if(_0x573194){const _0x5828bd=_0x573194[_0x230b61(0x1b5)](',')[_0x230b61(0x1d8)](_0x3e4142=>_0x3e4142[_0x230b61(0x1d3)]()[_0x230b61(0x1ab)]());_0x1dbe7c=_0x1dbe7c[_0x230b61(0x195)](_0x11dce7=>_0x11dce7['tags']?.[_0x230b61(0x14b)](_0x390a83=>_0x5828bd[_0x230b61(0x164)](_0x390a83[_0x230b61(0x1ab)]())));if(_0x1dbe7c[_0x230b61(0x1b2)]===0x0){console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x1bb)+_0x573194));const _0xd4c7ef=new Set();return _0x2b250b[_0x230b61(0x1ae)]['forEach'](_0x38ef76=>_0x38ef76[_0x230b61(0x170)]?.['forEach'](_0x122fbc=>_0xd4c7ef[_0x230b61(0x19b)](_0x122fbc))),_0xd4c7ef['size']>0x0?console['log'](a5_0x490e8c['dim']('Available\x20tags:\x20'+[..._0xd4c7ef][_0x230b61(0x155)](',\x20'))):console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x163))),0x1;}}if(_0x176409)return this[_0x230b61(0x1bd)](_0x143bb8,{'definition':{'tests':_0x1dbe7c},'agentInfo':_0x1bee6a,'outputFormat':_0x3a48fc,'outputFile':_0x232978,'testNames':_0xca1452});if(_0x1efcc1){console[_0x230b61(0x183)](a5_0x490e8c['cyan'](_0x230b61(0x145))),console[_0x230b61(0x183)](_0x230b61(0x1c6)+a5_0x490e8c[_0x230b61(0x152)](_0x5226da)),console[_0x230b61(0x183)](_0x230b61(0x14e)+a5_0x490e8c[_0x230b61(0x152)](_0x1bee6a[_0x230b61(0x16c)])),console[_0x230b61(0x183)](_0x230b61(0x1c3)+a5_0x490e8c[_0x230b61(0x152)](_0x1bee6a[_0x230b61(0x194)])),console['log'](),console[_0x230b61(0x183)](_0x230b61(0x153)+a5_0x490e8c[_0x230b61(0x152)](_0x1dbe7c[_0x230b61(0x1b2)]));for(let _0x19f649=0x0;_0x19f649<_0x1dbe7c[_0x230b61(0x1b2)];_0x19f649++){const _0x10524a=_0x1dbe7c[_0x19f649],_0x23c0cb=_0x10524a['rounds']['length']===0x1?'round':'rounds',_0x276bed=_0x10524a[_0x230b61(0x170)]?.['length']?'\x20['+_0x10524a['tags'][_0x230b61(0x155)](',\x20')+']':'';console[_0x230b61(0x183)]('\x20\x20'+(_0x19f649+0x1)+'.\x20'+a5_0x490e8c['white'](_0x10524a[_0x230b61(0x156)])+'\x20('+_0x10524a[_0x230b61(0x179)]['length']+'\x20'+_0x23c0cb+')'+a5_0x490e8c[_0x230b61(0x15a)](_0x276bed));}return 0x0;}let _0x40416e,_0x456a9f;try{_0x40416e=await _0x1420a9[_0x230b61(0x16a)][_0x230b61(0x1b3)](_0x1bee6a[_0x230b61(0x16c)]);}catch(_0x100c1c){const _0x51dfd2=_0x100c1c instanceof Error?_0x100c1c[_0x230b61(0x1d4)]:String(_0x100c1c);return _0x51dfd2[_0x230b61(0x164)](_0x230b61(0x1bf))||_0x51dfd2[_0x230b61(0x1ab)]()[_0x230b61(0x164)](_0x230b61(0x189))?console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1bee6a['projectName'])):console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)](_0x230b61(0x14d)+_0x1bee6a[_0x230b61(0x16c)]+_0x230b61(0x15d)+_0x51dfd2)),0x1;}try{_0x456a9f=await _0x1420a9[_0x230b61(0x16a)]['resolveAgentId'](_0x1bee6a[_0x230b61(0x194)],_0x40416e);}catch(_0x1ffe69){const _0x7f9424=_0x1ffe69 instanceof Error?_0x1ffe69[_0x230b61(0x1d4)]:String(_0x1ffe69);return _0x7f9424['includes'](_0x230b61(0x1bf))||_0x7f9424['toLowerCase']()[_0x230b61(0x164)](_0x230b61(0x189))?console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1bee6a[_0x230b61(0x194)])):console['log'](a5_0x490e8c[_0x230b61(0x18d)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x1bee6a[_0x230b61(0x194)]+_0x230b61(0x15d)+_0x7f9424)),0x1;}let _0x1ada9c;if(!_0x1f0049)try{_0x1ada9c=await setupEvaluatorAgent(_0x1420a9[_0x230b61(0x16a)],_0xa564e8[_0x230b61(0x1d6)]);}catch(_0x58b2b7){const _0x33dec1=_0x58b2b7 instanceof Error?_0x58b2b7[_0x230b61(0x1d4)]:String(_0x58b2b7);return console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)](_0x230b61(0x175)+_0x33dec1)),0x1;}console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x184)](_0x230b61(0x16d))),console[_0x230b61(0x183)](_0x230b61(0x150)+a5_0x490e8c[_0x230b61(0x152)](_0x5226da)),console['log'](_0x230b61(0x166)+a5_0x490e8c[_0x230b61(0x152)](_0x1bee6a[_0x230b61(0x16c)]+'/'+_0x1bee6a[_0x230b61(0x194)])),console[_0x230b61(0x183)]();const _0x3e64e6=[],_0x36f1fa=[],_0x3fb754=Date[_0x230b61(0x17b)]();for(let _0x43ceb5=0x0;_0x43ceb5<_0x1dbe7c[_0x230b61(0x1b2)];_0x43ceb5++){const _0x476000=_0x1dbe7c[_0x43ceb5];_0x1dbe7c['length']>0x1?console[_0x230b61(0x183)](_0x230b61(0x1d5)+(_0x43ceb5+0x1)+'/'+_0x1dbe7c['length']+':\x20'+a5_0x490e8c[_0x230b61(0x152)](_0x476000['name'])):console[_0x230b61(0x183)](_0x230b61(0x182)+a5_0x490e8c['white'](_0x476000[_0x230b61(0x156)]));const _0x614df8=createCommandSpinner('Round\x201/'+_0x476000[_0x230b61(0x179)][_0x230b61(0x1b2)]+_0x230b61(0x168));_0x614df8['start']();try{const {result:_0x190e83,conversation:_0xe37527}=await runTest(_0x1420a9['llm'],_0x476000,{'agentId':_0x456a9f,'projectId':_0x40416e,'site':_0x5226da,'noEval':_0x1f0049,'evaluatorId':_0x1ada9c,'onRoundStart':(_0x5158ab,_0x5e7bad)=>{const _0x34e778=_0x230b61;_0x614df8[_0x34e778(0x1aa)]=_0x34e778(0x1a1)+(_0x5158ab+0x1)+'/'+_0x5e7bad+_0x34e778(0x168);},'onRoundComplete':(_0x11a35c,_0x3204aa,_0x578a96)=>{const _0x33442b=_0x230b61,_0x34633e=formatElapsed(_0x3204aa);_0x578a96?console[_0x33442b(0x183)](_0x33442b(0x1ad)+(_0x11a35c+0x1)+'/'+_0x476000[_0x33442b(0x179)][_0x33442b(0x1b2)]+'...\x20'+a5_0x490e8c[_0x33442b(0x14f)]('✓')+'\x20('+_0x34633e+')'):console['log'](_0x33442b(0x1ad)+(_0x11a35c+0x1)+'/'+_0x476000[_0x33442b(0x179)]['length']+_0x33442b(0x142)+a5_0x490e8c[_0x33442b(0x18d)]('✗'));},'onEvaluationStart':()=>{const _0x321a14=_0x230b61;_0x614df8['text']=_0x321a14(0x15e);},'onEvaluationComplete':_0x4359c0=>{const _0x4e68aa=_0x230b61,_0x9d7f47=formatElapsed(_0x4359c0);console[_0x4e68aa(0x183)](_0x4e68aa(0x188)+a5_0x490e8c[_0x4e68aa(0x14f)]('✓')+'\x20('+_0x9d7f47+')');}});_0x614df8[_0x230b61(0x192)](),_0x3e64e6[_0x230b61(0x187)](_0x190e83),_0x36f1fa[_0x230b61(0x187)](_0xe37527);if(_0x190e83[_0x230b61(0x16f)]===_0x230b61(0x1dc))console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x14f)](_0x230b61(0x19c)+_0x190e83[_0x230b61(0x1cc)]));else _0x190e83[_0x230b61(0x16f)]===_0x230b61(0x1b9)?console[_0x230b61(0x183)](a5_0x490e8c['red'](_0x230b61(0x1c8)+_0x190e83[_0x230b61(0x1cc)])):console[_0x230b61(0x183)](a5_0x490e8c['red'](_0x230b61(0x1a2)+_0x190e83[_0x230b61(0x1cc)]));_0x190e83[_0x230b61(0x161)]&&console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x15a)]('Conversation\x20URL:\x20'+_0x190e83[_0x230b61(0x161)])),console['log']();}catch(_0x508eaf){_0x614df8[_0x230b61(0x192)]();const _0x5e4bd0=_0x508eaf instanceof Error?_0x508eaf[_0x230b61(0x1d4)]:String(_0x508eaf);console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)](_0x230b61(0x1a2)+_0x5e4bd0)),console[_0x230b61(0x183)](),_0x3e64e6[_0x230b61(0x187)]({'name':_0x476000[_0x230b61(0x156)],'status':_0x230b61(0x19a),'reason':_0x5e4bd0,'timestamp':new Date()[_0x230b61(0x154)](),'duration_ms':0x0});}}const _0x2697b1=Date['now']()-_0x3fb754,_0x21028c=_0x3e64e6[_0x230b61(0x195)](_0x213a0e=>_0x213a0e['status']===_0x230b61(0x1dc))[_0x230b61(0x1b2)],_0x2c3294=_0x3e64e6['filter'](_0x5156ae=>_0x5156ae[_0x230b61(0x16f)]===_0x230b61(0x1b9))[_0x230b61(0x1b2)],_0x207920=_0x3e64e6[_0x230b61(0x195)](_0x58bd9b=>_0x58bd9b[_0x230b61(0x16f)]===_0x230b61(0x19a))[_0x230b61(0x1b2)];console[_0x230b61(0x183)]('━'[_0x230b61(0x1b4)](0x3c)),console[_0x230b61(0x183)](_0x230b61(0x18c)),console[_0x230b61(0x183)]('━'['repeat'](0x3c)),console[_0x230b61(0x183)](_0x230b61(0x1d0)+_0x3e64e6['length']),console['log'](_0x230b61(0x1c5)+a5_0x490e8c['green'](_0x21028c)),console[_0x230b61(0x183)]('Failed:\x20\x20\x20'+a5_0x490e8c[_0x230b61(0x18d)](_0x2c3294));_0x207920>0x0&&console[_0x230b61(0x183)](_0x230b61(0x167)+a5_0x490e8c[_0x230b61(0x18d)](_0x207920));console[_0x230b61(0x183)](_0x230b61(0x146)+formatElapsed(_0x2697b1)),console[_0x230b61(0x183)]('━'[_0x230b61(0x1b4)](0x3c));const _0x20a58f=_0x3e64e6[_0x230b61(0x195)](_0x36272e=>_0x36272e[_0x230b61(0x16f)]!==_0x230b61(0x1dc));if(_0x20a58f['length']>0x0){console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x230b61(0x198));for(const _0x3b2ba3 of _0x20a58f){const _0x51d8f1=a5_0x490e8c['red']('✗'),_0x19f8e2=_0x3b2ba3[_0x230b61(0x1cc)][_0x230b61(0x1b2)]>0x32?_0x3b2ba3['reason'][_0x230b61(0x147)](0x0,0x32)+'...':_0x3b2ba3[_0x230b61(0x1cc)];console[_0x230b61(0x183)]('\x20\x20'+_0x51d8f1+'\x20'+_0x3b2ba3[_0x230b61(0x156)]+':\x20'+_0x19f8e2);}}const _0x14cf58={'summary':{'total':_0x3e64e6[_0x230b61(0x1b2)],'passed':_0x21028c,'failed':_0x2c3294,'errors':_0x207920>0x0?_0x207920:undefined,'duration_ms':_0x2697b1},'tests':_0x3e64e6,'agent':{'project':_0x1bee6a[_0x230b61(0x16c)],'name':_0x1bee6a[_0x230b61(0x194)],'site':_0x5226da},'timestamp':new Date(_0x3fb754)[_0x230b61(0x154)]()};try{const _0x221287=buildCachedTestRun(_0x36f1fa,{'site':_0x5226da,'projectId':_0x40416e,'projectName':_0x1bee6a[_0x230b61(0x16c)],'agentId':_0x456a9f,'agentName':_0x1bee6a['agentName'],'testYmlPath':a5_0x18641e['resolve'](_0x1bee6a[_0x230b61(0x1b1)])});saveLastTestRun(_0x221287);}catch{}if(_0x3a48fc!==_0x230b61(0x157)||_0x232978){const _0x18dd43=formatResults(_0x14cf58,_0x3a48fc);if(_0x232978)try{a5_0x3912be['writeFileSync'](_0x232978,_0x18dd43,_0x230b61(0x19d)),console['log'](),console[_0x230b61(0x183)](a5_0x490e8c['dim'](_0x230b61(0x144)+_0x232978));}catch(_0x44c806){return console[_0x230b61(0x183)](),console['log'](a5_0x490e8c[_0x230b61(0x18d)]('Error\x20writing\x20output\x20file:\x20'+_0x44c806)),0x1;}else console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x18dd43);}return _0x20a58f[_0x230b61(0x1b2)]>0x0?0x1:0x0;}async[a5_0x2f4431(0x1bd)](_0x49f8af,_0x533967){const _0x183c07=a5_0x2f4431,{options:_0x56380e,tdx:_0x2b3478}=_0x49f8af,{definition:_0x3adfd4,agentInfo:_0x1d4d90,outputFormat:_0x1c595a,outputFile:_0x40e842}=_0x533967,_0x17a7c0=_0x56380e['site'],_0x425322=loadLastTestRun();if(!_0x425322)return console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x197))),console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x199))),0x1;if(_0x425322[_0x183c07(0x174)][_0x183c07(0x194)]!==_0x1d4d90['agentName'])return console['log'](a5_0x490e8c[_0x183c07(0x18d)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x425322[_0x183c07(0x174)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x1d4d90[_0x183c07(0x194)]+'\x22.')),console['log'](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x1d7))),0x1;const _0x145dfb=new Set(_0x425322[_0x183c07(0x1cb)]['map'](_0x161bbb=>_0x161bbb[_0x183c07(0x169)])),_0x33f972=_0x3adfd4['tests'][_0x183c07(0x195)](_0xedd029=>!_0x145dfb['has'](_0xedd029[_0x183c07(0x156)]));if(_0x33f972[_0x183c07(0x1b2)]>0x0&&_0x425322[_0x183c07(0x1c9)]!==_0x17a7c0)return console['log'](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x1a9))),console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x151)+_0x425322['site']+_0x183c07(0x1c1)+_0x17a7c0+'\x22.')),console['log'](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x18e)+_0x425322[_0x183c07(0x1c9)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4f978c=_0x3adfd4[_0x183c07(0x1ae)]['filter'](_0x780426=>_0x145dfb[_0x183c07(0x1da)](_0x780426[_0x183c07(0x156)])),_0x1afb6e=_0x33f972;let _0x46e3bf;try{_0x46e3bf=await setupEvaluatorAgent(_0x2b3478['llm'],_0x56380e[_0x183c07(0x1d6)]);}catch(_0x16964f){const _0x4e52b3=_0x16964f instanceof Error?_0x16964f[_0x183c07(0x1d4)]:String(_0x16964f);return console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x175)+_0x4e52b3)),0x1;}console[_0x183c07(0x183)](a5_0x490e8c['cyan'](_0x183c07(0x190))),console[_0x183c07(0x183)](_0x183c07(0x16e)+a5_0x490e8c[_0x183c07(0x152)](_0x425322[_0x183c07(0x15c)])),console['log'](_0x183c07(0x166)+a5_0x490e8c[_0x183c07(0x152)](_0x425322[_0x183c07(0x174)][_0x183c07(0x16c)]+'/'+_0x425322[_0x183c07(0x174)][_0x183c07(0x194)]));_0x1afb6e['length']>0x0&&console[_0x183c07(0x183)]('New\x20tests\x20to\x20execute:\x20'+a5_0x490e8c[_0x183c07(0x149)](_0x1afb6e[_0x183c07(0x1b2)]));console[_0x183c07(0x183)]();const _0x2532ab=[],_0x24f0b9=Date[_0x183c07(0x17b)](),_0x5c6e3b=createCommandSpinner(_0x183c07(0x1b0));if(_0x4f978c[_0x183c07(0x1b2)]>0x0)try{const _0x5e4c4f=await reevaluateFromCache(_0x2b3478[_0x183c07(0x16a)],_0x425322,{'tests':_0x4f978c},{'evaluatorId':_0x46e3bf,'onTestStart':(_0x19ade9,_0xe699bd,_0x5d6542)=>{const _0x4e326a=_0x183c07;_0x5c6e3b[_0x4e326a(0x1aa)]=_0x4e326a(0x17d)+(_0xe699bd+0x1)+'/'+_0x5d6542+':\x20'+_0x19ade9+_0x4e326a(0x16b);if(!_0x5c6e3b[_0x4e326a(0x14c)])_0x5c6e3b[_0x4e326a(0x1d2)]();},'onTestComplete':(_0x6c3110,_0x49a63f)=>{const _0x6f5e1=_0x183c07;_0x5c6e3b[_0x6f5e1(0x192)]();if(_0x49a63f[_0x6f5e1(0x16f)]===_0x6f5e1(0x1dc))console['log'](a5_0x490e8c[_0x6f5e1(0x14f)](_0x6f5e1(0x19c)+_0x6c3110)+a5_0x490e8c[_0x6f5e1(0x15a)](_0x6f5e1(0x1ca)));else _0x49a63f['status']===_0x6f5e1(0x1b9)?console[_0x6f5e1(0x183)](a5_0x490e8c[_0x6f5e1(0x18d)](_0x6f5e1(0x1c8)+_0x6c3110+_0x6f5e1(0x1a7)+_0x49a63f[_0x6f5e1(0x1cc)])+a5_0x490e8c[_0x6f5e1(0x15a)](_0x6f5e1(0x1ca))):console[_0x6f5e1(0x183)](a5_0x490e8c[_0x6f5e1(0x18d)](_0x6f5e1(0x1a2)+_0x6c3110+_0x6f5e1(0x1a7)+_0x49a63f['reason']));_0x49a63f[_0x6f5e1(0x161)]&&console[_0x6f5e1(0x183)](a5_0x490e8c['dim'](_0x6f5e1(0x1a8)+_0x49a63f[_0x6f5e1(0x161)])),_0x2532ab['push'](_0x49a63f);},'onTestSkipped':(_0x1cc864,_0x38b7ca)=>{const _0x38cdcc=_0x183c07;_0x5c6e3b[_0x38cdcc(0x192)](),console[_0x38cdcc(0x183)](a5_0x490e8c[_0x38cdcc(0x149)](_0x38cdcc(0x1b6)+_0x1cc864+_0x38cdcc(0x1a7)+_0x38b7ca));}});for(const _0x1d7f0c of _0x5e4c4f){!_0x2532ab[_0x183c07(0x196)](_0x2b1514=>_0x2b1514['name']===_0x1d7f0c[_0x183c07(0x156)])&&_0x2532ab['push'](_0x1d7f0c);}}catch(_0x3a5a62){_0x5c6e3b[_0x183c07(0x192)]();const _0x5da138=_0x3a5a62 instanceof Error?_0x3a5a62[_0x183c07(0x1d4)]:String(_0x3a5a62);return console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x191)+_0x5da138)),0x1;}_0x5c6e3b[_0x183c07(0x192)]();if(_0x1afb6e[_0x183c07(0x1b2)]>0x0){console[_0x183c07(0x183)](),console[_0x183c07(0x183)](a5_0x490e8c['cyan'](_0x183c07(0x172)));const {projectId:_0x50f2fb,agentId:_0x6329a6}=_0x425322[_0x183c07(0x174)];for(const _0x5055ef of _0x1afb6e){console[_0x183c07(0x183)](_0x183c07(0x165)+a5_0x490e8c['white'](_0x5055ef[_0x183c07(0x156)]));const _0x10971d=createCommandSpinner(_0x183c07(0x17c)+_0x5055ef['rounds'][_0x183c07(0x1b2)]+':\x20Sending\x20user\x20input...');_0x10971d[_0x183c07(0x1d2)]();try{const {result:_0x13b586}=await runTest(_0x2b3478[_0x183c07(0x16a)],_0x5055ef,{'agentId':_0x6329a6,'projectId':_0x50f2fb,'site':_0x425322[_0x183c07(0x1c9)],'noEval':![],'evaluatorId':_0x46e3bf,'onRoundStart':(_0x5c6335,_0x13b28f)=>{const _0x29f819=_0x183c07;_0x10971d[_0x29f819(0x1aa)]=_0x29f819(0x1a1)+(_0x5c6335+0x1)+'/'+_0x13b28f+_0x29f819(0x168);},'onRoundComplete':(_0x119339,_0x317437,_0x39d7a4)=>{const _0x15ac44=_0x183c07,_0x30671b=formatElapsed(_0x317437);_0x39d7a4?console[_0x15ac44(0x183)](_0x15ac44(0x1ad)+(_0x119339+0x1)+'/'+_0x5055ef[_0x15ac44(0x179)][_0x15ac44(0x1b2)]+_0x15ac44(0x142)+a5_0x490e8c[_0x15ac44(0x14f)]('✓')+'\x20('+_0x30671b+')'):console[_0x15ac44(0x183)](_0x15ac44(0x1ad)+(_0x119339+0x1)+'/'+_0x5055ef[_0x15ac44(0x179)][_0x15ac44(0x1b2)]+'...\x20'+a5_0x490e8c[_0x15ac44(0x18d)]('✗'));},'onEvaluationStart':()=>{const _0x124dc0=_0x183c07;_0x10971d[_0x124dc0(0x1aa)]=_0x124dc0(0x15e);},'onEvaluationComplete':_0x1cd709=>{const _0x1e54af=_0x183c07,_0x2b4c97=formatElapsed(_0x1cd709);console[_0x1e54af(0x183)]('\x20\x20Evaluating...\x20'+a5_0x490e8c[_0x1e54af(0x14f)]('✓')+'\x20('+_0x2b4c97+')');}});_0x10971d[_0x183c07(0x192)](),_0x2532ab[_0x183c07(0x187)](_0x13b586);if(_0x13b586['status']===_0x183c07(0x1dc))console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x14f)](_0x183c07(0x19c)+_0x13b586[_0x183c07(0x1cc)])+a5_0x490e8c['dim'](_0x183c07(0x186)));else _0x13b586[_0x183c07(0x16f)]===_0x183c07(0x1b9)?console['log'](a5_0x490e8c['red'](_0x183c07(0x1c8)+_0x13b586[_0x183c07(0x1cc)])+a5_0x490e8c['dim'](_0x183c07(0x186))):console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x1a2)+_0x13b586[_0x183c07(0x1cc)]));_0x13b586['conversation_url']&&console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x1a8)+_0x13b586['conversation_url']));}catch(_0x46cb98){_0x10971d[_0x183c07(0x192)]();const _0x30f53a=_0x46cb98 instanceof Error?_0x46cb98[_0x183c07(0x1d4)]:String(_0x46cb98);console['log'](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x1a2)+_0x30f53a)),_0x2532ab[_0x183c07(0x187)]({'name':_0x5055ef[_0x183c07(0x156)],'status':'ERROR','reason':_0x30f53a,'timestamp':new Date()[_0x183c07(0x154)](),'duration_ms':0x0});}}}console[_0x183c07(0x183)]();const _0x49cdc8=Date['now']()-_0x24f0b9,_0x207816=_0x2532ab[_0x183c07(0x195)](_0x10b1cc=>_0x10b1cc[_0x183c07(0x16f)]===_0x183c07(0x1dc))[_0x183c07(0x1b2)],_0x56faaf=_0x2532ab['filter'](_0x2ca7ee=>_0x2ca7ee[_0x183c07(0x16f)]===_0x183c07(0x1b9))['length'],_0x2a292e=_0x2532ab[_0x183c07(0x195)](_0x15485d=>_0x15485d[_0x183c07(0x16f)]===_0x183c07(0x19a))[_0x183c07(0x1b2)];console['log']('━'[_0x183c07(0x1b4)](0x3c)),console['log'](_0x183c07(0x180)),console[_0x183c07(0x183)]('━'[_0x183c07(0x1b4)](0x3c)),console[_0x183c07(0x183)](_0x183c07(0x1d0)+_0x2532ab[_0x183c07(0x1b2)]),console['log']('Passed:\x20\x20\x20'+a5_0x490e8c[_0x183c07(0x14f)](_0x207816)),console[_0x183c07(0x183)]('Failed:\x20\x20\x20'+a5_0x490e8c[_0x183c07(0x18d)](_0x56faaf));_0x2a292e>0x0&&console[_0x183c07(0x183)](_0x183c07(0x167)+a5_0x490e8c[_0x183c07(0x18d)](_0x2a292e));console['log'](_0x183c07(0x146)+formatElapsed(_0x49cdc8)),console[_0x183c07(0x183)]('━'[_0x183c07(0x1b4)](0x3c));const _0xde1c4e={'summary':{'total':_0x2532ab[_0x183c07(0x1b2)],'passed':_0x207816,'failed':_0x56faaf,'errors':_0x2a292e>0x0?_0x2a292e:undefined,'duration_ms':_0x49cdc8},'tests':_0x2532ab,'agent':{'project':_0x1d4d90['projectName'],'name':_0x1d4d90[_0x183c07(0x194)],'site':_0x17a7c0},'timestamp':new Date(_0x24f0b9)[_0x183c07(0x154)]()};if(_0x1c595a!==_0x183c07(0x157)||_0x40e842){const _0x5be3c8=formatResults(_0xde1c4e,_0x1c595a);if(_0x40e842)try{a5_0x3912be[_0x183c07(0x1a4)](_0x40e842,_0x5be3c8,_0x183c07(0x19d)),console[_0x183c07(0x183)](),console['log'](a5_0x490e8c['dim'](_0x183c07(0x144)+_0x40e842));}catch(_0x28439b){return console[_0x183c07(0x183)](),console['log'](a5_0x490e8c[_0x183c07(0x18d)]('Error\x20writing\x20output\x20file:\x20'+_0x28439b)),0x1;}else console[_0x183c07(0x183)](),console[_0x183c07(0x183)](_0x5be3c8);}const _0x1ce7db=_0x2532ab['filter'](_0x14978c=>_0x14978c['status']!==_0x183c07(0x1dc));return _0x1ce7db[_0x183c07(0x1b2)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x425988=a5_0x29f4;(function(_0xc1082d,_0x119e0f){const _0x3cc229=a5_0x29f4,_0x3420b8=_0xc1082d();while(!![]){try{const _0x2ac8d6=parseInt(_0x3cc229(0x15d))/0x1+-parseInt(_0x3cc229(0x183))/0x2*(-parseInt(_0x3cc229(0x17a))/0x3)+-parseInt(_0x3cc229(0x164))/0x4*(-parseInt(_0x3cc229(0x137))/0x5)+parseInt(_0x3cc229(0x131))/0x6*(parseInt(_0x3cc229(0x16a))/0x7)+-parseInt(_0x3cc229(0x1b1))/0x8+-parseInt(_0x3cc229(0x18e))/0x9+-parseInt(_0x3cc229(0x135))/0xa;if(_0x2ac8d6===_0x119e0f)break;else _0x3420b8['push'](_0x3420b8['shift']());}catch(_0x1b72e2){_0x3420b8['push'](_0x3420b8['shift']());}}}(a5_0x2cf0,0x18b1e));import*as a5_0x487957 from'node:fs';import*as a5_0xcad501 from'node:path';import a5_0x274d4d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x29f4(_0x1b4246,_0x148c63){_0x1b4246=_0x1b4246-0x129;const _0x2cf0a9=a5_0x2cf0();let _0x29f431=_0x2cf0a9[_0x1b4246];return _0x29f431;}function a5_0x2cf0(){const _0x4c5409=['testYmlPath','green','verbose','includes','\x20\x20Agent:\x20','FAIL','substring','eval','dim','now','\x20(cached)','Re-evaluating\x20','Site:\x20','9itliDt','Error:\x20No\x20previous\x20test\x20run\x20found.','...','projectName','agent:test','dryRun','New\x20tests\x20to\x20execute:\x20','forEach','join','74012XqhHIa','Running\x20agent\x20tests...','Test\x20Summary','tsv','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Test\x20Configuration:','round','map','\x20(new)','red','✗\x20ERROR:\x20','1627038LYMkNQ','existsSync','name','reason','executeReeval','agentDirs','not\x20found','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','agentName','cyan','Run\x20tests\x20for\x20an\x20LLM\x20agent','404','filter','Duration:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✓\x20PASS:\x20','found','Round\x20','\x20-\x20','start','toLowerCase','Agent:\x20','output','no_tests','some','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20FAIL:\x20','Available\x20tags:\x20','Tests\x20found:\x20','conversations','rounds','llm','\x20\x20Conversation:\x20','length','Passed:\x20\x20\x20','1171224ZpXjJQ','agent','reeval','\x20\x20Round\x20','Errors:\x20\x20\x20','Output\x20written\x20to:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','/<agent-name>','\x22,\x20but\x20current\x20site\x20is\x20\x22','Evaluating\x20response...',':\x20Sending\x20user\x20input...','basename','837222PSDiey','Project\x20path:\x20','No\x20tests\x20have\x20tags\x20defined.','...\x20','921670BIJOBC','no_context','729415JaZEwx','message','⚠\x20SKIPPED:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','table','No\x20tests\x20found\x20with\x20tags:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','yellow','Re-evaluating...','resolve','tests','json','timestamp','split','testName','stop','white','Either\x20switch\x20to\x20the\x20\x22','status','Failed:\x20\x20\x20','ERROR','has','tags','no_local_folder','PASS','text','size','jsonl','conversation_url','utf-8','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','log','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20Site:\x20','push','find','\x22:\x20','124064vnbSMb','repeat','writeFileSync','add','Running:\x20','toISOString','test.yml','4IwdTLr','Re-evaluating\x20cached\x20test\x20run...','projectDir','llmProject','No\x20tests\x20found\x20matching:\x20','Using\x20agent:\x20','7pePsda','Test\x20','site'];a5_0x2cf0=function(){return _0x4c5409;};return a5_0x2cf0();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x425988(0x190)]=a5_0x425988(0x17e);['description']=a5_0x425988(0x198);async['execute'](_0x23cabc){const _0x5dcc18=a5_0x425988,{options:_0x365661,args:_0xed7c38,tdx:_0x1c10b5}=_0x23cabc,_0x2b68b1=_0xed7c38[0x0]||'.',_0x191251=_0x365661[_0x5dcc18(0x17f)],_0x1e2e04=_0x365661,_0x29db99=_0x1e2e04[_0x5dcc18(0x174)]===![],_0x25979b=_0x1e2e04[_0x5dcc18(0x1b3)],_0x5267ef=_0x1e2e04['name'],_0x5a3cee=_0x1e2e04[_0x5dcc18(0x14e)],_0x2a286d=_0x365661[_0x5dcc18(0x16c)],_0xf9049c=_0x1e2e04[_0x5dcc18(0x1a4)];if(_0x25979b&&_0x29db99)return console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)](_0x5dcc18(0x13b))),0x1;let _0x37597d=_0x5dcc18(0x13c);if(_0x1e2e04['json'])_0x37597d=_0x5dcc18(0x143);else{if(_0x1e2e04[_0x5dcc18(0x153)])_0x37597d=_0x5dcc18(0x153);else{if(_0x1e2e04[_0x5dcc18(0x186)])_0x37597d=_0x5dcc18(0x186);else{if(_0x1e2e04[_0x5dcc18(0x13c)])_0x37597d=_0x5dcc18(0x13c);}}}const _0xcb5f04=_0x1e2e04[_0x5dcc18(0x167)];let _0x186ccc=_0x2b68b1;const _0x43deff=a5_0x487957[_0x5dcc18(0x18f)](_0x2b68b1),_0x59db02=_0x2b68b1==='.';if(!_0x43deff||_0x59db02){const _0x5606f7=resolveProjectFromContext(_0x2b68b1,_0xcb5f04,{'requireFile':_0x5dcc18(0x163)});if(_0x5606f7[_0x5dcc18(0x19e)])_0x186ccc=_0x5606f7[_0x5dcc18(0x166)],_0x5606f7['source']==='context'&&console['log'](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x169)+_0x186ccc));else switch(_0x5606f7['reason']){case _0x5dcc18(0x136):console['log'](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5606f7[_0x5dcc18(0x138)])),console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)]('Usage:'),console[_0x5dcc18(0x157)]('\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[_0x5dcc18(0x157)]('\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[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x5dcc18(0x14f):console[_0x5dcc18(0x157)](a5_0x274d4d['yellow'](_0x5606f7[_0x5dcc18(0x138)])),console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x5dcc18(0x13a)+_0x5606f7[_0x5dcc18(0x167)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0xe0bde0=a5_0xcad501[_0x5dcc18(0x130)](_0x5606f7['projectDir']);console[_0x5dcc18(0x157)](a5_0x274d4d['yellow'](_0x5dcc18(0x156)+_0x5606f7[_0x5dcc18(0x167)]+'\x22:'));for(const _0x509d3c of _0x5606f7[_0x5dcc18(0x193)]){console[_0x5dcc18(0x157)]('\x20\x20-\x20'+_0x509d3c);}return console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x5dcc18(0x1a7)+_0xe0bde0+_0x5dcc18(0x12c)),0x1;}case _0x5dcc18(0x1a5):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5dcc18(0x13e)+_0x5606f7[_0x5dcc18(0x167)]+'\x22.')),console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x132)+_0x5606f7[_0x5dcc18(0x166)])),console[_0x5dcc18(0x157)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x27d234,agentInfo:_0x8e4041}=parseTestFile(_0x186ccc);let _0x393941=_0x27d234[_0x5dcc18(0x142)];if(_0x5267ef){const _0x5ba9b6=_0x5267ef[_0x5dcc18(0x145)](',')[_0x5dcc18(0x18a)](_0x10ae5e=>_0x10ae5e['trim']());_0x393941=_0x27d234[_0x5dcc18(0x142)][_0x5dcc18(0x19a)](_0x1e9065=>_0x5ba9b6[_0x5dcc18(0x170)](_0x1e9065['name']));if(_0x393941[_0x5dcc18(0x1af)]===0x0)return console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5dcc18(0x168)+_0x5267ef)),console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x175)]('Available\x20tests:\x20'+_0x27d234[_0x5dcc18(0x142)]['map'](_0x2f12a7=>_0x2f12a7['name'])['join'](',\x20'))),0x1;}if(_0x5a3cee){const _0x37c89c=_0x5a3cee['split'](',')[_0x5dcc18(0x18a)](_0x4dfc1b=>_0x4dfc1b['trim']()[_0x5dcc18(0x1a2)]());_0x393941=_0x393941[_0x5dcc18(0x19a)](_0x40f70a=>_0x40f70a['tags']?.[_0x5dcc18(0x1a6)](_0x35fe4b=>_0x37c89c[_0x5dcc18(0x170)](_0x35fe4b['toLowerCase']())));if(_0x393941[_0x5dcc18(0x1af)]===0x0){console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5dcc18(0x13d)+_0x5a3cee));const _0x56875e=new Set();return _0x27d234[_0x5dcc18(0x142)][_0x5dcc18(0x181)](_0x31d2e8=>_0x31d2e8[_0x5dcc18(0x14e)]?.[_0x5dcc18(0x181)](_0x512a26=>_0x56875e[_0x5dcc18(0x160)](_0x512a26))),_0x56875e[_0x5dcc18(0x152)]>0x0?console['log'](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x1a9)+[..._0x56875e][_0x5dcc18(0x182)](',\x20'))):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x133))),0x1;}}if(_0x25979b)return this[_0x5dcc18(0x192)](_0x23cabc,{'definition':{'tests':_0x393941},'agentInfo':_0x8e4041,'outputFormat':_0x37597d,'outputFile':_0xf9049c,'testNames':_0x5267ef});if(_0x191251){console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x197)](_0x5dcc18(0x188))),console['log'](_0x5dcc18(0x159)+a5_0x274d4d[_0x5dcc18(0x148)](_0x2a286d)),console['log']('\x20\x20Project:\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x8e4041['projectName'])),console[_0x5dcc18(0x157)](_0x5dcc18(0x171)+a5_0x274d4d[_0x5dcc18(0x148)](_0x8e4041[_0x5dcc18(0x196)])),console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x5dcc18(0x1aa)+a5_0x274d4d[_0x5dcc18(0x148)](_0x393941[_0x5dcc18(0x1af)]));for(let _0x53d83c=0x0;_0x53d83c<_0x393941[_0x5dcc18(0x1af)];_0x53d83c++){const _0x52480e=_0x393941[_0x53d83c],_0xa96578=_0x52480e['rounds'][_0x5dcc18(0x1af)]===0x1?_0x5dcc18(0x189):_0x5dcc18(0x1ac),_0x5193f0=_0x52480e[_0x5dcc18(0x14e)]?.['length']?'\x20['+_0x52480e[_0x5dcc18(0x14e)][_0x5dcc18(0x182)](',\x20')+']':'';console[_0x5dcc18(0x157)]('\x20\x20'+(_0x53d83c+0x1)+'.\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x52480e['name'])+'\x20('+_0x52480e[_0x5dcc18(0x1ac)][_0x5dcc18(0x1af)]+'\x20'+_0xa96578+')'+a5_0x274d4d[_0x5dcc18(0x175)](_0x5193f0));}return 0x0;}let _0x244da0,_0x468501;try{_0x244da0=await _0x1c10b5[_0x5dcc18(0x1ad)]['resolveProjectId'](_0x8e4041[_0x5dcc18(0x17d)]);}catch(_0x118e3c){const _0x1df888=_0x118e3c instanceof Error?_0x118e3c[_0x5dcc18(0x138)]:String(_0x118e3c);return _0x1df888['includes']('404')||_0x1df888[_0x5dcc18(0x1a2)]()[_0x5dcc18(0x170)](_0x5dcc18(0x194))?console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x8e4041[_0x5dcc18(0x17d)])):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x8e4041[_0x5dcc18(0x17d)]+_0x5dcc18(0x15c)+_0x1df888)),0x1;}try{_0x468501=await _0x1c10b5['llm']['resolveAgentId'](_0x8e4041[_0x5dcc18(0x196)],_0x244da0);}catch(_0x116db7){const _0x2ab2ee=_0x116db7 instanceof Error?_0x116db7['message']:String(_0x116db7);return _0x2ab2ee['includes'](_0x5dcc18(0x199))||_0x2ab2ee[_0x5dcc18(0x1a2)]()[_0x5dcc18(0x170)](_0x5dcc18(0x194))?console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)](_0x5dcc18(0x195)+_0x8e4041['agentName'])):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x8e4041['agentName']+_0x5dcc18(0x15c)+_0x2ab2ee)),0x1;}let _0x4ee521;if(!_0x29db99)try{_0x4ee521=await setupEvaluatorAgent(_0x1c10b5[_0x5dcc18(0x1ad)],_0x365661[_0x5dcc18(0x16f)]);}catch(_0x36f711){const _0x538141=_0x36f711 instanceof Error?_0x36f711[_0x5dcc18(0x138)]:String(_0x36f711);return console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x538141)),0x1;}console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x197)](_0x5dcc18(0x184))),console[_0x5dcc18(0x157)](_0x5dcc18(0x179)+a5_0x274d4d[_0x5dcc18(0x148)](_0x2a286d)),console['log'](_0x5dcc18(0x1a3)+a5_0x274d4d['white'](_0x8e4041[_0x5dcc18(0x17d)]+'/'+_0x8e4041[_0x5dcc18(0x196)])),console[_0x5dcc18(0x157)]();const _0x5972ab=[],_0x5a6c81=[],_0x43fbbd=Date[_0x5dcc18(0x176)]();for(let _0x15df6d=0x0;_0x15df6d<_0x393941[_0x5dcc18(0x1af)];_0x15df6d++){const _0x238de6=_0x393941[_0x15df6d];_0x393941['length']>0x1?console[_0x5dcc18(0x157)](_0x5dcc18(0x16b)+(_0x15df6d+0x1)+'/'+_0x393941[_0x5dcc18(0x1af)]+':\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x238de6[_0x5dcc18(0x190)])):console[_0x5dcc18(0x157)]('Running\x20test:\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x238de6['name']));const _0x3a0f97=createCommandSpinner('Round\x201/'+_0x238de6[_0x5dcc18(0x1ac)][_0x5dcc18(0x1af)]+_0x5dcc18(0x12f));_0x3a0f97[_0x5dcc18(0x1a1)]();try{const {result:_0x433d01,conversation:_0x56786a}=await runTest(_0x1c10b5[_0x5dcc18(0x1ad)],_0x238de6,{'agentId':_0x468501,'projectId':_0x244da0,'site':_0x2a286d,'noEval':_0x29db99,'evaluatorId':_0x4ee521,'onRoundStart':(_0x22b7b8,_0x568091)=>{const _0x747419=_0x5dcc18;_0x3a0f97['text']=_0x747419(0x19f)+(_0x22b7b8+0x1)+'/'+_0x568091+_0x747419(0x12f);},'onRoundComplete':(_0x3ff152,_0x1dbaf7,_0x498cfb)=>{const _0x3f9d47=_0x5dcc18,_0x2da17e=formatElapsed(_0x1dbaf7);_0x498cfb?console[_0x3f9d47(0x157)]('\x20\x20Round\x20'+(_0x3ff152+0x1)+'/'+_0x238de6['rounds'][_0x3f9d47(0x1af)]+_0x3f9d47(0x134)+a5_0x274d4d[_0x3f9d47(0x16e)]('✓')+'\x20('+_0x2da17e+')'):console[_0x3f9d47(0x157)](_0x3f9d47(0x1b4)+(_0x3ff152+0x1)+'/'+_0x238de6['rounds'][_0x3f9d47(0x1af)]+_0x3f9d47(0x134)+a5_0x274d4d[_0x3f9d47(0x18c)]('✗'));},'onEvaluationStart':()=>{const _0x34ed64=_0x5dcc18;_0x3a0f97[_0x34ed64(0x151)]=_0x34ed64(0x12e);},'onEvaluationComplete':_0x5aab1d=>{const _0x273ed9=_0x5dcc18,_0x21691d=formatElapsed(_0x5aab1d);console[_0x273ed9(0x157)]('\x20\x20Evaluating...\x20'+a5_0x274d4d['green']('✓')+'\x20('+_0x21691d+')');}});_0x3a0f97['stop'](),_0x5972ab['push'](_0x433d01),_0x5a6c81[_0x5dcc18(0x15a)](_0x56786a);if(_0x433d01['status']===_0x5dcc18(0x150))console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x16e)](_0x5dcc18(0x19d)+_0x433d01[_0x5dcc18(0x191)]));else _0x433d01[_0x5dcc18(0x14a)]===_0x5dcc18(0x172)?console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20FAIL:\x20'+_0x433d01[_0x5dcc18(0x191)])):console[_0x5dcc18(0x157)](a5_0x274d4d['red'](_0x5dcc18(0x18d)+_0x433d01['reason']));_0x433d01[_0x5dcc18(0x154)]&&console[_0x5dcc18(0x157)](a5_0x274d4d['dim']('Conversation\x20URL:\x20'+_0x433d01[_0x5dcc18(0x154)])),console[_0x5dcc18(0x157)]();}catch(_0x2006e7){_0x3a0f97[_0x5dcc18(0x147)]();const _0xf9ad6a=_0x2006e7 instanceof Error?_0x2006e7[_0x5dcc18(0x138)]:String(_0x2006e7);console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)](_0x5dcc18(0x18d)+_0xf9ad6a)),console[_0x5dcc18(0x157)](),_0x5972ab['push']({'name':_0x238de6[_0x5dcc18(0x190)],'status':_0x5dcc18(0x14c),'reason':_0xf9ad6a,'timestamp':new Date()[_0x5dcc18(0x162)](),'duration_ms':0x0});}}const _0x3b7e28=Date['now']()-_0x43fbbd,_0x1c383b=_0x5972ab['filter'](_0x2b049c=>_0x2b049c[_0x5dcc18(0x14a)]===_0x5dcc18(0x150))[_0x5dcc18(0x1af)],_0xce7949=_0x5972ab[_0x5dcc18(0x19a)](_0x43a65f=>_0x43a65f[_0x5dcc18(0x14a)]===_0x5dcc18(0x172))[_0x5dcc18(0x1af)],_0x53751c=_0x5972ab[_0x5dcc18(0x19a)](_0x1184cd=>_0x1184cd[_0x5dcc18(0x14a)]===_0x5dcc18(0x14c))[_0x5dcc18(0x1af)];console['log']('━'[_0x5dcc18(0x15e)](0x3c)),console[_0x5dcc18(0x157)](_0x5dcc18(0x185)),console[_0x5dcc18(0x157)]('━'[_0x5dcc18(0x15e)](0x3c)),console[_0x5dcc18(0x157)]('Total:\x20\x20\x20\x20'+_0x5972ab[_0x5dcc18(0x1af)]),console[_0x5dcc18(0x157)]('Passed:\x20\x20\x20'+a5_0x274d4d[_0x5dcc18(0x16e)](_0x1c383b)),console[_0x5dcc18(0x157)](_0x5dcc18(0x14b)+a5_0x274d4d[_0x5dcc18(0x18c)](_0xce7949));_0x53751c>0x0&&console[_0x5dcc18(0x157)](_0x5dcc18(0x129)+a5_0x274d4d['red'](_0x53751c));console[_0x5dcc18(0x157)](_0x5dcc18(0x19b)+formatElapsed(_0x3b7e28)),console[_0x5dcc18(0x157)]('━'[_0x5dcc18(0x15e)](0x3c));const _0x164c91=_0x5972ab[_0x5dcc18(0x19a)](_0x21c2f8=>_0x21c2f8[_0x5dcc18(0x14a)]!==_0x5dcc18(0x150));if(_0x164c91[_0x5dcc18(0x1af)]>0x0){console['log'](),console[_0x5dcc18(0x157)]('Failed\x20Tests:');for(const _0x3bfbd9 of _0x164c91){const _0x45edeb=a5_0x274d4d[_0x5dcc18(0x18c)]('✗'),_0x6ea7f1=_0x3bfbd9[_0x5dcc18(0x191)][_0x5dcc18(0x1af)]>0x32?_0x3bfbd9[_0x5dcc18(0x191)][_0x5dcc18(0x173)](0x0,0x32)+_0x5dcc18(0x17c):_0x3bfbd9[_0x5dcc18(0x191)];console[_0x5dcc18(0x157)]('\x20\x20'+_0x45edeb+'\x20'+_0x3bfbd9[_0x5dcc18(0x190)]+':\x20'+_0x6ea7f1);}}const _0x3858ab={'summary':{'total':_0x5972ab['length'],'passed':_0x1c383b,'failed':_0xce7949,'errors':_0x53751c>0x0?_0x53751c:undefined,'duration_ms':_0x3b7e28},'tests':_0x5972ab,'agent':{'project':_0x8e4041[_0x5dcc18(0x17d)],'name':_0x8e4041['agentName'],'site':_0x2a286d},'timestamp':new Date(_0x43fbbd)['toISOString']()};try{const _0x25444c=buildCachedTestRun(_0x5a6c81,{'site':_0x2a286d,'projectId':_0x244da0,'projectName':_0x8e4041[_0x5dcc18(0x17d)],'agentId':_0x468501,'agentName':_0x8e4041[_0x5dcc18(0x196)],'testYmlPath':a5_0xcad501[_0x5dcc18(0x141)](_0x8e4041[_0x5dcc18(0x16d)])});saveLastTestRun(_0x25444c);}catch{}if(_0x37597d!==_0x5dcc18(0x13c)||_0xf9049c){const _0x3f588f=formatResults(_0x3858ab,_0x37597d);if(_0xf9049c)try{a5_0x487957[_0x5dcc18(0x15f)](_0xf9049c,_0x3f588f,'utf-8'),console[_0x5dcc18(0x157)](),console['log'](a5_0x274d4d[_0x5dcc18(0x175)]('Output\x20written\x20to:\x20'+_0xf9049c));}catch(_0x553140){return console['log'](),console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('Error\x20writing\x20output\x20file:\x20'+_0x553140)),0x1;}else console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x3f588f);}return _0x164c91[_0x5dcc18(0x1af)]>0x0?0x1:0x0;}async[a5_0x425988(0x192)](_0x585462,_0xb11a51){const _0x4d5562=a5_0x425988,{options:_0x24d861,tdx:_0x16829f}=_0x585462,{definition:_0x1afb96,agentInfo:_0x82aa60,outputFormat:_0x5235b3,outputFile:_0x77df43}=_0xb11a51,_0x3e6d76=_0x24d861[_0x4d5562(0x16c)],_0x1a9474=loadLastTestRun();if(!_0x1a9474)return console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)](_0x4d5562(0x17b))),console[_0x4d5562(0x157)](a5_0x274d4d['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x1a9474[_0x4d5562(0x1b2)][_0x4d5562(0x196)]!==_0x82aa60['agentName'])return console[_0x4d5562(0x157)](a5_0x274d4d['red'](_0x4d5562(0x158)+_0x1a9474[_0x4d5562(0x1b2)][_0x4d5562(0x196)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x82aa60[_0x4d5562(0x196)]+'\x22.')),console['log'](a5_0x274d4d['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1d520d=new Set(_0x1a9474[_0x4d5562(0x1ab)]['map'](_0x41d0bb=>_0x41d0bb[_0x4d5562(0x146)])),_0x41adfa=_0x1afb96[_0x4d5562(0x142)]['filter'](_0x95a178=>!_0x1d520d['has'](_0x95a178[_0x4d5562(0x190)]));if(_0x41adfa[_0x4d5562(0x1af)]>0x0&&_0x1a9474[_0x4d5562(0x16c)]!==_0x3e6d76)return console[_0x4d5562(0x157)](a5_0x274d4d['red'](_0x4d5562(0x12b))),console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x175)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x1a9474[_0x4d5562(0x16c)]+_0x4d5562(0x12d)+_0x3e6d76+'\x22.')),console[_0x4d5562(0x157)](a5_0x274d4d['dim'](_0x4d5562(0x149)+_0x1a9474['site']+_0x4d5562(0x19c))),0x1;const _0x3a3627=_0x1afb96[_0x4d5562(0x142)][_0x4d5562(0x19a)](_0x1bc800=>_0x1d520d[_0x4d5562(0x14d)](_0x1bc800['name'])),_0x465fa9=_0x41adfa;let _0x51c953;try{_0x51c953=await setupEvaluatorAgent(_0x16829f[_0x4d5562(0x1ad)],_0x24d861[_0x4d5562(0x16f)]);}catch(_0x20a10b){const _0x3eeae8=_0x20a10b instanceof Error?_0x20a10b['message']:String(_0x20a10b);return console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3eeae8)),0x1;}console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x197)](_0x4d5562(0x165))),console[_0x4d5562(0x157)]('Cached\x20run\x20from:\x20'+a5_0x274d4d['white'](_0x1a9474[_0x4d5562(0x144)])),console[_0x4d5562(0x157)](_0x4d5562(0x1a3)+a5_0x274d4d[_0x4d5562(0x148)](_0x1a9474[_0x4d5562(0x1b2)][_0x4d5562(0x17d)]+'/'+_0x1a9474[_0x4d5562(0x1b2)]['agentName']));_0x465fa9[_0x4d5562(0x1af)]>0x0&&console[_0x4d5562(0x157)](_0x4d5562(0x180)+a5_0x274d4d['yellow'](_0x465fa9['length']));console[_0x4d5562(0x157)]();const _0x2a8fe4=[],_0x3ec432=Date['now'](),_0x25b8ab=createCommandSpinner(_0x4d5562(0x140));if(_0x3a3627[_0x4d5562(0x1af)]>0x0)try{const _0x302672=await reevaluateFromCache(_0x16829f[_0x4d5562(0x1ad)],_0x1a9474,{'tests':_0x3a3627},{'evaluatorId':_0x51c953,'onTestStart':(_0x1dfe8b,_0x252cf5,_0xe26a8)=>{const _0x529cf1=_0x4d5562;_0x25b8ab[_0x529cf1(0x151)]=_0x529cf1(0x178)+(_0x252cf5+0x1)+'/'+_0xe26a8+':\x20'+_0x1dfe8b+_0x529cf1(0x17c);if(!_0x25b8ab['isSpinning'])_0x25b8ab[_0x529cf1(0x1a1)]();},'onTestComplete':(_0x38b568,_0x474598)=>{const _0xe9dc8=_0x4d5562;_0x25b8ab[_0xe9dc8(0x147)]();if(_0x474598[_0xe9dc8(0x14a)]===_0xe9dc8(0x150))console[_0xe9dc8(0x157)](a5_0x274d4d[_0xe9dc8(0x16e)](_0xe9dc8(0x19d)+_0x38b568)+a5_0x274d4d[_0xe9dc8(0x175)](_0xe9dc8(0x177)));else _0x474598[_0xe9dc8(0x14a)]===_0xe9dc8(0x172)?console[_0xe9dc8(0x157)](a5_0x274d4d['red'](_0xe9dc8(0x1a8)+_0x38b568+'\x20-\x20'+_0x474598[_0xe9dc8(0x191)])+a5_0x274d4d[_0xe9dc8(0x175)](_0xe9dc8(0x177))):console[_0xe9dc8(0x157)](a5_0x274d4d[_0xe9dc8(0x18c)](_0xe9dc8(0x18d)+_0x38b568+_0xe9dc8(0x1a0)+_0x474598[_0xe9dc8(0x191)]));_0x474598[_0xe9dc8(0x154)]&&console[_0xe9dc8(0x157)](a5_0x274d4d[_0xe9dc8(0x175)](_0xe9dc8(0x1ae)+_0x474598[_0xe9dc8(0x154)])),_0x2a8fe4[_0xe9dc8(0x15a)](_0x474598);},'onTestSkipped':(_0x27bc2a,_0x1d468c)=>{const _0x481339=_0x4d5562;_0x25b8ab[_0x481339(0x147)](),console[_0x481339(0x157)](a5_0x274d4d[_0x481339(0x13f)](_0x481339(0x139)+_0x27bc2a+_0x481339(0x1a0)+_0x1d468c));}});for(const _0x33863c of _0x302672){!_0x2a8fe4[_0x4d5562(0x15b)](_0x3345d3=>_0x3345d3[_0x4d5562(0x190)]===_0x33863c[_0x4d5562(0x190)])&&_0x2a8fe4['push'](_0x33863c);}}catch(_0x4d7316){_0x25b8ab['stop']();const _0x1d6402=_0x4d7316 instanceof Error?_0x4d7316[_0x4d5562(0x138)]:String(_0x4d7316);return console['log'](a5_0x274d4d[_0x4d5562(0x18c)](_0x4d5562(0x187)+_0x1d6402)),0x1;}_0x25b8ab[_0x4d5562(0x147)]();if(_0x465fa9[_0x4d5562(0x1af)]>0x0){console[_0x4d5562(0x157)](),console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x197)]('Executing\x20new\x20tests...'));const {projectId:_0x127b49,agentId:_0x360aa2}=_0x1a9474[_0x4d5562(0x1b2)];for(const _0x47cad2 of _0x465fa9){console[_0x4d5562(0x157)](_0x4d5562(0x161)+a5_0x274d4d[_0x4d5562(0x148)](_0x47cad2['name']));const _0x28eeed=createCommandSpinner('Round\x201/'+_0x47cad2[_0x4d5562(0x1ac)]['length']+_0x4d5562(0x12f));_0x28eeed['start']();try{const {result:_0x30afb0}=await runTest(_0x16829f[_0x4d5562(0x1ad)],_0x47cad2,{'agentId':_0x360aa2,'projectId':_0x127b49,'site':_0x1a9474[_0x4d5562(0x16c)],'noEval':![],'evaluatorId':_0x51c953,'onRoundStart':(_0x57f1b2,_0x5a34be)=>{const _0x58788a=_0x4d5562;_0x28eeed[_0x58788a(0x151)]='Round\x20'+(_0x57f1b2+0x1)+'/'+_0x5a34be+_0x58788a(0x12f);},'onRoundComplete':(_0x5e964a,_0x1af41b,_0x2f2657)=>{const _0x1b66a7=_0x4d5562,_0x1eb214=formatElapsed(_0x1af41b);_0x2f2657?console['log'](_0x1b66a7(0x1b4)+(_0x5e964a+0x1)+'/'+_0x47cad2[_0x1b66a7(0x1ac)]['length']+'...\x20'+a5_0x274d4d[_0x1b66a7(0x16e)]('✓')+'\x20('+_0x1eb214+')'):console[_0x1b66a7(0x157)](_0x1b66a7(0x1b4)+(_0x5e964a+0x1)+'/'+_0x47cad2[_0x1b66a7(0x1ac)]['length']+_0x1b66a7(0x134)+a5_0x274d4d[_0x1b66a7(0x18c)]('✗'));},'onEvaluationStart':()=>{const _0x3fe2cc=_0x4d5562;_0x28eeed[_0x3fe2cc(0x151)]=_0x3fe2cc(0x12e);},'onEvaluationComplete':_0x48a075=>{const _0x45df4f=_0x4d5562,_0x177ee2=formatElapsed(_0x48a075);console[_0x45df4f(0x157)]('\x20\x20Evaluating...\x20'+a5_0x274d4d[_0x45df4f(0x16e)]('✓')+'\x20('+_0x177ee2+')');}});_0x28eeed[_0x4d5562(0x147)](),_0x2a8fe4[_0x4d5562(0x15a)](_0x30afb0);if(_0x30afb0[_0x4d5562(0x14a)]===_0x4d5562(0x150))console[_0x4d5562(0x157)](a5_0x274d4d['green'](_0x4d5562(0x19d)+_0x30afb0[_0x4d5562(0x191)])+a5_0x274d4d['dim'](_0x4d5562(0x18b)));else _0x30afb0['status']===_0x4d5562(0x172)?console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)]('✗\x20FAIL:\x20'+_0x30afb0[_0x4d5562(0x191)])+a5_0x274d4d[_0x4d5562(0x175)](_0x4d5562(0x18b))):console[_0x4d5562(0x157)](a5_0x274d4d['red'](_0x4d5562(0x18d)+_0x30afb0[_0x4d5562(0x191)]));_0x30afb0['conversation_url']&&console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x175)](_0x4d5562(0x1ae)+_0x30afb0[_0x4d5562(0x154)]));}catch(_0x211c3d){_0x28eeed[_0x4d5562(0x147)]();const _0x4a7cbf=_0x211c3d instanceof Error?_0x211c3d[_0x4d5562(0x138)]:String(_0x211c3d);console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)](_0x4d5562(0x18d)+_0x4a7cbf)),_0x2a8fe4[_0x4d5562(0x15a)]({'name':_0x47cad2[_0x4d5562(0x190)],'status':_0x4d5562(0x14c),'reason':_0x4a7cbf,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x4d5562(0x157)]();const _0x2e3b34=Date['now']()-_0x3ec432,_0x57efd9=_0x2a8fe4[_0x4d5562(0x19a)](_0x1ae5a9=>_0x1ae5a9[_0x4d5562(0x14a)]===_0x4d5562(0x150))[_0x4d5562(0x1af)],_0xd21c00=_0x2a8fe4[_0x4d5562(0x19a)](_0x3402cd=>_0x3402cd['status']===_0x4d5562(0x172))[_0x4d5562(0x1af)],_0x294b94=_0x2a8fe4[_0x4d5562(0x19a)](_0x52888a=>_0x52888a[_0x4d5562(0x14a)]===_0x4d5562(0x14c))[_0x4d5562(0x1af)];console[_0x4d5562(0x157)]('━'['repeat'](0x3c)),console[_0x4d5562(0x157)]('Re-evaluation\x20Summary'),console[_0x4d5562(0x157)]('━'[_0x4d5562(0x15e)](0x3c)),console[_0x4d5562(0x157)]('Total:\x20\x20\x20\x20'+_0x2a8fe4[_0x4d5562(0x1af)]),console['log'](_0x4d5562(0x1b0)+a5_0x274d4d[_0x4d5562(0x16e)](_0x57efd9)),console[_0x4d5562(0x157)]('Failed:\x20\x20\x20'+a5_0x274d4d[_0x4d5562(0x18c)](_0xd21c00));_0x294b94>0x0&&console[_0x4d5562(0x157)](_0x4d5562(0x129)+a5_0x274d4d[_0x4d5562(0x18c)](_0x294b94));console[_0x4d5562(0x157)]('Duration:\x20'+formatElapsed(_0x2e3b34)),console[_0x4d5562(0x157)]('━'['repeat'](0x3c));const _0x4f0b27={'summary':{'total':_0x2a8fe4[_0x4d5562(0x1af)],'passed':_0x57efd9,'failed':_0xd21c00,'errors':_0x294b94>0x0?_0x294b94:undefined,'duration_ms':_0x2e3b34},'tests':_0x2a8fe4,'agent':{'project':_0x82aa60['projectName'],'name':_0x82aa60['agentName'],'site':_0x3e6d76},'timestamp':new Date(_0x3ec432)[_0x4d5562(0x162)]()};if(_0x5235b3!==_0x4d5562(0x13c)||_0x77df43){const _0x2742d2=formatResults(_0x4f0b27,_0x5235b3);if(_0x77df43)try{a5_0x487957[_0x4d5562(0x15f)](_0x77df43,_0x2742d2,_0x4d5562(0x155)),console['log'](),console['log'](a5_0x274d4d[_0x4d5562(0x175)](_0x4d5562(0x12a)+_0x77df43));}catch(_0x427c5f){return console[_0x4d5562(0x157)](),console[_0x4d5562(0x157)](a5_0x274d4d['red']('Error\x20writing\x20output\x20file:\x20'+_0x427c5f)),0x1;}else console[_0x4d5562(0x157)](),console[_0x4d5562(0x157)](_0x2742d2);}const _0x4c7af5=_0x2a8fe4[_0x4d5562(0x19a)](_0x2ef705=>_0x2ef705['status']!=='PASS');return _0x4c7af5[_0x4d5562(0x1af)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x4cb77b=a6_0x293c;(function(_0x2cdc80,_0x10dca6){const _0x267be2=a6_0x293c,_0x4d7a0c=_0x2cdc80();while(!![]){try{const _0x1e9a52=parseInt(_0x267be2(0x1ae))/0x1+-parseInt(_0x267be2(0x1df))/0x2+parseInt(_0x267be2(0x1be))/0x3*(-parseInt(_0x267be2(0x1c0))/0x4)+-parseInt(_0x267be2(0x1e0))/0x5+-parseInt(_0x267be2(0x1ca))/0x6*(-parseInt(_0x267be2(0x1d0))/0x7)+-parseInt(_0x267be2(0x1c2))/0x8*(-parseInt(_0x267be2(0x1da))/0x9)+parseInt(_0x267be2(0x1e2))/0xa;if(_0x1e9a52===_0x10dca6)break;else _0x4d7a0c['push'](_0x4d7a0c['shift']());}catch(_0x1cd8b1){_0x4d7a0c['push'](_0x4d7a0c['shift']());}}}(a6_0x4420,0x9be71));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x4420(){const _0xa20e2c=['GET','color','status','Invalid\x20API\x20type:\x20','headers','stack','method','site','Error:\x20','43119FLEjMC','startsWith','error','DELETE','verbose','2469254bfitME','6283455mdnNnd','PUT','29051910UqzvtK','has','x-xsrf-token','set-cookie2','trino','Invalid\x20HTTP\x20method:\x20','llm','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','includes','toLowerCase','request','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','44491pZvLok','x-trino-user','\x0aStack\x20trace:\x0a','data','output','authorization','cookie','validate','type','x-auth-token','toUpperCase','execute','file','Results\x20saved\x20to\x20','Invalid\x20header\x20format:\x20\x22','substring','2779611wGXeJS','join','4GkjQCj','proxy-authorization','40rDedkB','entries','trim','log','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','api','cdp','noColor','6nNopdc','length','workflow','body','<\x20HTTP/1.1\x20','.\x20Valid\x20methods:\x20','7579565qpHOQK'];a6_0x4420=function(){return _0xa20e2c;};return a6_0x4420();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x293c(_0x1e7ed6,_0x354130){_0x1e7ed6=_0x1e7ed6-0x1a5;const _0x4420fc=a6_0x4420();let _0x293cbc=_0x4420fc[_0x1e7ed6];return _0x293cbc;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4cb77b(0x1b3),a6_0x4cb77b(0x1c1),a6_0x4cb77b(0x1b4),'set-cookie',a6_0x4cb77b(0x1a5),a6_0x4cb77b(0x1e4),a6_0x4cb77b(0x1b7),a6_0x4cb77b(0x1af)]);function isSensitiveHeader(_0x481d09){const _0x4d6d1f=a6_0x4cb77b;return SENSITIVE_HEADERS[_0x4d6d1f(0x1e3)](_0x481d09[_0x4d6d1f(0x1ab)]());}function parseHeader(_0x13f12d){const _0x3546b7=a6_0x4cb77b,_0x3ce788=_0x13f12d['indexOf'](':');if(_0x3ce788===-0x1)throw new Error(_0x3546b7(0x1bc)+_0x13f12d+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x21fa08=_0x13f12d[_0x3546b7(0x1bd)](0x0,_0x3ce788)['trim'](),_0x11c522=_0x13f12d[_0x3546b7(0x1bd)](_0x3ce788+0x1)[_0x3546b7(0x1c4)]();if(!_0x21fa08)throw new Error(_0x3546b7(0x1c6)+_0x13f12d+'\x22');return[_0x21fa08,_0x11c522];}export class ApiCommand extends BaseCommand{['name']=a6_0x4cb77b(0x1c7);['description']=a6_0x4cb77b(0x1a9);[a6_0x4cb77b(0x1b5)](_0x4b34ae){const _0x5f392a=a6_0x4cb77b,{args:_0x2c1439,options:_0xd41c34}=_0x4b34ae,_0x2730ed=_0xd41c34;if(_0x2c1439[_0x5f392a(0x1cb)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2b8239=_0x2c1439[0x0];if(!_0x2b8239[_0x5f392a(0x1db)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x2b8239;const _0x39973c=_0x2730ed[_0x5f392a(0x1b1)],_0x1f6564=_0x2730ed[_0x5f392a(0x1ba)];if(_0x39973c&&_0x1f6564)return _0x5f392a(0x1ad);const _0x44e57f=_0x2730ed['method']||_0x5f392a(0x1d1),_0x517044=[_0x5f392a(0x1d1),'POST',_0x5f392a(0x1e1),_0x5f392a(0x1dd),'PATCH'];if(!_0x517044[_0x5f392a(0x1aa)](_0x44e57f[_0x5f392a(0x1b8)]()))return _0x5f392a(0x1a7)+_0x44e57f+_0x5f392a(0x1cf)+_0x517044['join'](',\x20');const _0x443a41=_0x2730ed[_0x5f392a(0x1b6)]||'td',_0x2c1c71=['td',_0x5f392a(0x1c8),_0x5f392a(0x1cc),_0x5f392a(0x1a6),_0x5f392a(0x1a8),'llm-proxy'];if(!_0x2c1c71[_0x5f392a(0x1aa)](_0x443a41))return _0x5f392a(0x1d4)+_0x443a41+'.\x20Valid\x20types:\x20'+_0x2c1c71[_0x5f392a(0x1bf)](',\x20');return undefined;}async[a6_0x4cb77b(0x1b9)](_0x4ed1d6){const _0x5bbb17=a6_0x4cb77b,{options:_0x3b02f6,args:_0x36a41d,tdx:_0x24f349}=_0x4ed1d6,_0x52bc77=_0x3b02f6,_0x539400=_0x36a41d[0x0],_0x4f8756=(_0x52bc77[_0x5bbb17(0x1d7)]||'GET')[_0x5bbb17(0x1b8)](),_0x4ea60a=_0x52bc77[_0x5bbb17(0x1b1)],_0x30a5a8=_0x52bc77[_0x5bbb17(0x1ba)],_0x5416ba=_0x52bc77['header'],_0x5b2eda=_0x52bc77[_0x5bbb17(0x1b6)]||'td';try{const _0x16934={};if(_0x5416ba){const _0x355bbc=Array['isArray'](_0x5416ba)?_0x5416ba:[_0x5416ba];for(const _0x237f0e of _0x355bbc){const [_0x3055e5,_0x3fa9da]=parseHeader(_0x237f0e);_0x16934[_0x3055e5]=_0x3fa9da;}}let _0x494ebb;if(_0x4ea60a)_0x494ebb=_0x4ea60a;else{if(_0x30a5a8)try{_0x494ebb=RawAPI['readBodyFromFile'](_0x30a5a8);}catch(_0x183a92){return console[_0x5bbb17(0x1dc)](_0x5bbb17(0x1d9)+(_0x183a92 instanceof Error?_0x183a92['message']:String(_0x183a92))),0x1;}}const _0x15edb8={'method':_0x4f8756,'apiType':_0x5b2eda,'includeHeaders':_0x3b02f6[_0x5bbb17(0x1de)]};_0x494ebb&&(_0x15edb8[_0x5bbb17(0x1cd)]=_0x494ebb);Object['keys'](_0x16934)[_0x5bbb17(0x1cb)]>0x0&&(_0x15edb8[_0x5bbb17(0x1d5)]=_0x16934);if(_0x3b02f6['verbose']){const _0x38c6dc=resolveSite(_0x3b02f6[_0x5bbb17(0x1d8)]),_0x4a8d82=getEndpoint(_0x38c6dc,_0x5b2eda),_0x52a149=''+_0x4a8d82+_0x539400;console['error']('>\x20'+_0x4f8756+'\x20'+_0x52a149);const _0x50dcbf=getAuthHeaders(_0x38c6dc),_0x192869={..._0x50dcbf,..._0x16934};for(const [_0x329b17,_0x479939]of Object[_0x5bbb17(0x1c3)](_0x192869)){!isSensitiveHeader(_0x329b17)&&console['error']('>\x20'+_0x329b17+':\x20'+_0x479939);}_0x494ebb&&console[_0x5bbb17(0x1dc)]('>'),console['error']('');}const _0x492faf=await _0x24f349['api'][_0x5bbb17(0x1ac)](_0x539400,_0x15edb8);if(_0x3b02f6[_0x5bbb17(0x1de)]&&_0x492faf['headers']){console[_0x5bbb17(0x1dc)](_0x5bbb17(0x1ce)+_0x492faf[_0x5bbb17(0x1d3)]);for(const [_0x505cad,_0x440d6a]of Object['entries'](_0x492faf[_0x5bbb17(0x1d5)])){!isSensitiveHeader(_0x505cad)&&console[_0x5bbb17(0x1dc)]('<\x20'+_0x505cad+':\x20'+_0x440d6a);}console['error']('');}const _0x56efec=Boolean(_0x3b02f6[_0x5bbb17(0x1b2)]),_0x3f4ce0={'color':_0x3b02f6[_0x5bbb17(0x1d2)],'noColor':_0x3b02f6[_0x5bbb17(0x1c9)]||_0x56efec&&!_0x3b02f6[_0x5bbb17(0x1d2)]},_0x24f23b=colorizeJSON(_0x492faf['data'],_0x3f4ce0);return _0x3b02f6['output']?(writeFileSync(_0x3b02f6[_0x5bbb17(0x1b2)],_0x24f23b),console[_0x5bbb17(0x1dc)](_0x5bbb17(0x1bb)+_0x3b02f6[_0x5bbb17(0x1b2)])):console[_0x5bbb17(0x1c5)](_0x24f23b),0x0;}catch(_0x2ab308){return _0x2ab308 instanceof Error?(console[_0x5bbb17(0x1dc)](_0x5bbb17(0x1d9)+_0x2ab308['message']),_0x3b02f6[_0x5bbb17(0x1de)]&&_0x2ab308[_0x5bbb17(0x1d6)]&&console['error'](_0x5bbb17(0x1b0)+_0x2ab308['stack'])):console[_0x5bbb17(0x1dc)](_0x5bbb17(0x1d9)+String(_0x2ab308)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x341d4f=a7_0x36a3;(function(_0x1fb48e,_0x1e92f7){const _0x256d81=a7_0x36a3,_0x229bae=_0x1fb48e();while(!![]){try{const _0x875961=parseInt(_0x256d81(0x10f))/0x1+parseInt(_0x256d81(0xe2))/0x2*(parseInt(_0x256d81(0xda))/0x3)+-parseInt(_0x256d81(0xf9))/0x4*(parseInt(_0x256d81(0x116))/0x5)+parseInt(_0x256d81(0xd4))/0x6*(parseInt(_0x256d81(0x108))/0x7)+parseInt(_0x256d81(0x107))/0x8+parseInt(_0x256d81(0x101))/0x9+-parseInt(_0x256d81(0x11c))/0xa;if(_0x875961===_0x1e92f7)break;else _0x229bae['push'](_0x229bae['shift']());}catch(_0x3171e1){_0x229bae['push'](_0x229bae['shift']());}}}(a7_0x4575,0x84416));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';function a7_0x4575(){const _0x480c24=['\x20--profile\x20','message','285126TkCdqw','Credential\x20type:\x20OAuth','N/A','logLevel','error','filter','1459701gQCYdK','No\x20credential\x20found','API\x20key','green','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','tdx:\x20auth\x20setup','System\x20keychain\x20is\x20not\x20available','tdx:\x20auth\x20clear','2rIpmKE','method','create','oauth','You\x20can\x20find\x20your\x20API\x20key\x20at:','getUserInfo','email','tdx\x20profile:\x20','join','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Name:\x20','site','✓\x20Default\x20site\x20set\x20to\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','Read\x20credential\x20from\x20','execute','OAuth\x20(browser\x20login)','trim','ERROR','Enter\x20your\x20TD\x20API\x20key:','password','✓\x20Profile\x20\x27','auth:clear','4DzKCky','✗\x20Validation\x20failed:\x20','Setup\x20cancelled','\x20removed\x20from\x20keychain','apiKey','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20(site:\x20','status','4744998dVPOWn','description','log','\x27\x20registered','last_name','warn','2597416tkaVpD','154PBrexA','\x20(profile:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','select','profile','\x20and\x20','red','454830wLbXjz','name','\x20for\x20profile:\x20','\x0aSetup\x20cancelled','first_name','jobs','bold','4627955mLHIzQ','\x20\x20tdx','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Read\x20credential\x20from\x20keychain','Choose\x20authentication\x20method:','13714490hMBkCw','API\x20Key','Setup\x20API\x20key\x20authentication\x20interactively','/app/mp/ak','OAuth\x20tokens','auth'];a7_0x4575=function(){return _0x480c24;};return a7_0x4575();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x36a3(_0x1ac71b,_0x10ccee){_0x1ac71b=_0x1ac71b-0xcf;const _0x4575ef=a7_0x4575();let _0x36a3fc=_0x4575ef[_0x1ac71b];return _0x36a3fc;}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_0x3d1b2a from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x43f7a1 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x341d4f(0x110)]='auth:setup';['description']=a7_0x341d4f(0x11e);async[a7_0x341d4f(0xf1)](_0x12666e){const _0x1276f9=a7_0x341d4f,{options:_0x34fdbe}=_0x12666e,_0x546662=_0x34fdbe[_0x1276f9(0x10c)];console[_0x1276f9(0x103)](a7_0x43f7a1[_0x1276f9(0x115)](_0x1276f9(0xdf)));const _0xc62bae=_0x34fdbe[_0x1276f9(0xed)]||'us01',_0x1e99ea=await promptSiteSelection(_0xc62bae,_0x546662,_0x1276f9(0xfb));if(!_0x1e99ea)return 0x1;const _0x42eca6=resolveSite(_0x1e99ea);if(isOAuthSupported(_0x42eca6)){const _0x1d09c8=await a7_0x3d1b2a({'type':_0x1276f9(0x10b),'name':_0x1276f9(0xe3),'message':_0x1276f9(0x11b),'choices':[{'title':_0x1276f9(0xf2),'value':_0x1276f9(0xe5)},{'title':_0x1276f9(0x11d),'value':'apikey'}]});if(!_0x1d09c8['method'])return console[_0x1276f9(0x103)](_0x1276f9(0x112)),0x1;if(_0x1d09c8['method']===_0x1276f9(0xe5))return await runOAuthLoginFlow(_0x42eca6,_0x546662,_0x34fdbe[_0x1276f9(0xd7)]??LogLevel['ERROR']),0x0;}console['log'](_0x1276f9(0xef)+_0x42eca6),console[_0x1276f9(0x103)](_0x1276f9(0xe6)),console['log']('\x20\x20'+getConsoleUrl(_0x42eca6,_0x1276f9(0xcf)));const _0x4fef5b=await a7_0x3d1b2a({'type':_0x1276f9(0xf6),'name':'apiKey','message':_0x1276f9(0xf5),'validate':_0x367ac2=>{const _0x21192f=_0x1276f9;if(!_0x367ac2||!_0x367ac2[_0x21192f(0xf3)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x4fef5b[_0x1276f9(0xfd)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x18098e=_0x4fef5b['apiKey'];console[_0x1276f9(0x103)]('Validating\x20API\x20key...');try{const _0x8923a7=TDX[_0x1276f9(0xe4)]({'site':_0x42eca6,'apiKey':_0x18098e[_0x1276f9(0xf3)](),'logLevel':_0x34fdbe[_0x1276f9(0xd7)]??LogLevel[_0x1276f9(0xf4)]}),_0x4f3ac6=await _0x8923a7[_0x1276f9(0x114)][_0x1276f9(0xe7)]();console[_0x1276f9(0x103)](_0x1276f9(0xde)+_0x4f3ac6[_0x1276f9(0xe8)]+')');const _0x3df980=await isKeychainAvailable();_0x3df980?(await saveAPIKeyAsync(_0x18098e[_0x1276f9(0xf3)](),_0x42eca6,_0x546662),console[_0x1276f9(0x103)](_0x1276f9(0xfe)+(_0x546662?'\x20(profile:\x20'+_0x546662+')':''))):(console[_0x1276f9(0x106)](a7_0x43f7a1['yellow'](_0x1276f9(0x118))),console['warn'](a7_0x43f7a1['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x546662){const _0x506d94={'site':_0x42eca6};saveProfileToUserConfig(_0x546662,_0x506d94),console[_0x1276f9(0x103)](_0x1276f9(0xf7)+_0x546662+_0x1276f9(0x104));}else saveDefaultSiteToUserConfig(_0x42eca6),console[_0x1276f9(0x103)](_0x1276f9(0xee)+_0x42eca6);const _0x18c68f=_0x546662?_0x1276f9(0xd2)+_0x546662:'';return console['log'](),console[_0x1276f9(0x103)](_0x1276f9(0x119)),console[_0x1276f9(0x103)](_0x1276f9(0x117)+_0x18c68f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1276f9(0x103)](_0x1276f9(0x117)+_0x18c68f+_0x1276f9(0xeb)),0x0;}catch(_0x589611){if(_0x589611 instanceof HTTPClientError&&_0x589611[_0x1276f9(0x100)]===0x191)return printAuthError(_0x589611),0x1;return console[_0x1276f9(0xd8)](a7_0x43f7a1[_0x1276f9(0x10e)](_0x1276f9(0xfa)+(_0x589611 instanceof Error?_0x589611[_0x1276f9(0xd3)]:String(_0x589611)))),console[_0x1276f9(0xd8)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x341d4f(0x110)]=a7_0x341d4f(0xd1);['description']=a7_0x341d4f(0x10a);async[a7_0x341d4f(0xf1)](_0x4c7030){const _0x4c423e=a7_0x341d4f,{options:_0x3a5207,tdx:_0x270db1}=_0x4c7030,_0x54cf96=_0x3a5207[_0x4c423e(0xed)],_0x5824c7=_0x3a5207['profile'],_0x174769=_0x5824c7?_0x5824c7:_0x4c423e(0xd6);console[_0x4c423e(0x103)](_0x4c423e(0xe9)+_0x174769+_0x4c423e(0xff)+_0x54cf96+')');const _0x588bd1=await getOAuthTokens(_0x5824c7);if(_0x588bd1)console[_0x4c423e(0x103)](_0x4c423e(0xd5)),console['log'](_0x4c423e(0x11a)+(_0x5824c7?'\x20(profile:\x20'+_0x5824c7+')':''));else{const _0xe3cdcd=await resolveAPIKeyAsync(_0x54cf96,_0x5824c7);if(_0xe3cdcd){const {source:_0x5e406a,isDeprecated:_0x531c84}=_0xe3cdcd,_0x48bc56=_0x4c423e(0xf0)+_0x5e406a;console[_0x4c423e(0x103)](_0x531c84?a7_0x43f7a1['yellow'](_0x48bc56):_0x48bc56);}else console[_0x4c423e(0x103)](a7_0x43f7a1['yellow'](_0x4c423e(0xdb)));}try{const _0x546e9a=await _0x270db1[_0x4c423e(0x114)][_0x4c423e(0xe7)]();return console[_0x4c423e(0x103)](a7_0x43f7a1[_0x4c423e(0xdd)]('✓\x20Authentication\x20successful\x0a')),console[_0x4c423e(0x103)]('User:\x20'+_0x546e9a[_0x4c423e(0xe8)]),(_0x546e9a['first_name']||_0x546e9a['last_name'])&&console[_0x4c423e(0x103)](_0x4c423e(0xec)+[_0x546e9a[_0x4c423e(0x113)],_0x546e9a[_0x4c423e(0x105)]][_0x4c423e(0xd9)](Boolean)[_0x4c423e(0xea)]('\x20')),0x0;}catch(_0x4de0cd){return _0x4de0cd instanceof HTTPClientError&&_0x4de0cd[_0x4c423e(0x100)]===0x191?printAuthError(_0x4de0cd,!![],_0x5824c7):console[_0x4c423e(0xd8)](a7_0x43f7a1[_0x4c423e(0x10e)](_0x4c423e(0xfa)+(_0x4de0cd instanceof Error?_0x4de0cd[_0x4c423e(0xd3)]:String(_0x4de0cd)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x341d4f(0x110)]=a7_0x341d4f(0xf8);[a7_0x341d4f(0x102)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x341d4f(0xf1)](_0x43a974){const _0x5c0295=a7_0x341d4f,{options:_0x2bf022}=_0x43a974,_0x3e4f9e=_0x2bf022['profile'];console[_0x5c0295(0x103)](a7_0x43f7a1['bold'](_0x5c0295(0xe1)));const _0x187716=await isKeychainAvailable();if(!_0x187716)return console['error'](a7_0x43f7a1[_0x5c0295(0x10e)](_0x5c0295(0xe0))),0x1;const [_0x1402be,_0x5183e9]=await Promise['all']([deleteKeychainAPIKey(_0x3e4f9e),deleteOAuthTokens(_0x3e4f9e)]);if(_0x1402be||_0x5183e9){clearCredentialCache();const _0x4445b4=[_0x1402be&&_0x5c0295(0xdc),_0x5183e9&&_0x5c0295(0xd0)][_0x5c0295(0xd9)](Boolean)[_0x5c0295(0xea)](_0x5c0295(0x10d));return console['log']('✓\x20'+_0x4445b4+_0x5c0295(0xfc)+(_0x3e4f9e?_0x5c0295(0x109)+_0x3e4f9e+')':'')),0x0;}else return console[_0x5c0295(0x103)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x3e4f9e?_0x5c0295(0x111)+_0x3e4f9e:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x38a23a=a8_0x4624;(function(_0xcd0443,_0x18f50f){const _0x587a7=a8_0x4624,_0x215a87=_0xcd0443();while(!![]){try{const _0x43aa2e=-parseInt(_0x587a7(0x117))/0x1*(parseInt(_0x587a7(0x126))/0x2)+-parseInt(_0x587a7(0x114))/0x3+-parseInt(_0x587a7(0x11a))/0x4*(parseInt(_0x587a7(0x11f))/0x5)+parseInt(_0x587a7(0x108))/0x6+parseInt(_0x587a7(0x12d))/0x7*(parseInt(_0x587a7(0x107))/0x8)+-parseInt(_0x587a7(0x12b))/0x9*(parseInt(_0x587a7(0x109))/0xa)+parseInt(_0x587a7(0x10b))/0xb*(parseInt(_0x587a7(0x10e))/0xc);if(_0x43aa2e===_0x18f50f)break;else _0x215a87['push'](_0x215a87['shift']());}catch(_0x1ccb39){_0x215a87['push'](_0x215a87['shift']());}}}(a8_0x3463,0xe1458));function a8_0x4624(_0x2aad6e,_0x407265){_0x2aad6e=_0x2aad6e-0x102;const _0x346323=a8_0x3463();let _0x462494=_0x346323[_0x2aad6e];return _0x462494;}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';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x373470 from'chalk';export async function runOAuthLoginFlow(_0x5f977e,_0x8cd49b,_0x337e29){const _0x20a91d=a8_0x4624;if(!isOAuthSupported(_0x5f977e))throw new Error(_0x20a91d(0x104)+_0x5f977e+'.\x20'+_0x20a91d(0x127)+_0x20a91d(0x113));const _0xc40e14=await isKeychainAvailable();if(!_0xc40e14)throw new Error(_0x20a91d(0x11d)+_0x20a91d(0x113));const _0xda4247=getConsoleUrl(_0x5f977e);console[_0x20a91d(0x102)](_0x20a91d(0x106)),console[_0x20a91d(0x102)]('\x20\x20'+_0xda4247+_0x20a91d(0x105)),console[_0x20a91d(0x102)](_0x20a91d(0x122));const _0x2bfe36=await startOAuthFlow(_0x5f977e);console[_0x20a91d(0x102)](_0x20a91d(0x129));const _0x2ed484=TDX['create']({'site':_0x5f977e,'accessToken':_0x2bfe36['access_token'],'logLevel':_0x337e29??LogLevel[_0x20a91d(0x11e)]}),_0x144c79=await _0x2ed484[_0x20a91d(0x115)]['getUserInfo']();console[_0x20a91d(0x102)](a8_0x373470[_0x20a91d(0x111)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x144c79[_0x20a91d(0x125)]+')')),await saveOAuthTokens(_0x2bfe36,_0x8cd49b),console[_0x20a91d(0x102)](_0x20a91d(0x119)+(_0x8cd49b?_0x20a91d(0x128)+_0x8cd49b+')':''));if(_0x8cd49b){const _0x5bf171={'site':_0x5f977e};saveProfileToUserConfig(_0x8cd49b,_0x5bf171),console[_0x20a91d(0x102)](_0x20a91d(0x112)+_0x8cd49b+'\x27\x20registered');}const _0x2756d9=_0x8cd49b?_0x20a91d(0x110)+_0x8cd49b:'';console[_0x20a91d(0x102)](),console[_0x20a91d(0x102)](_0x20a91d(0x121)),console[_0x20a91d(0x102)](_0x20a91d(0x12c)+_0x2756d9+_0x20a91d(0x12a)),console[_0x20a91d(0x102)](_0x20a91d(0x12c)+_0x2756d9+_0x20a91d(0x118));}function a8_0x3463(){const _0x5067d0=['log','name','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','/oauth/authorize','Opening\x20browser\x20for\x20authentication...','240NEbmyj','1430460ifzZfJ','30jTDcuY','tdx:\x20auth\x20login','30279293BFRGbT','Login\x20cancelled','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','12dNCyUl','bold','\x20--profile\x20','green','✓\x20Profile\x20\x27','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','4741242lTkMGw','jobs','Login\x20via\x20OAuth\x20(opens\x20browser)','55574BXohqM','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','2054040JXKjlD','description','execute','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','ERROR','5wYFgMT','auth:login','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','logLevel','profile','email','6qcipKZ','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','\x20(profile:\x20','Validating\x20OAuth\x20tokens...','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','4051035ItltId','\x20\x20tdx','359947uDNbbG'];a8_0x3463=function(){return _0x5067d0;};return a8_0x3463();}export class AuthLoginCommand extends BaseCommand{[a8_0x38a23a(0x103)]=a8_0x38a23a(0x120);[a8_0x38a23a(0x11b)]=a8_0x38a23a(0x116);async[a8_0x38a23a(0x11c)](_0x48f779){const _0x17832b=a8_0x38a23a,{options:_0xa2cca2}=_0x48f779,_0x3f6855=_0xa2cca2[_0x17832b(0x124)];console['log'](a8_0x373470[_0x17832b(0x10f)](_0x17832b(0x10a)));const _0x413c42=_0xa2cca2['site']||'us01',_0xf21427=await promptSiteSelection(_0x413c42,_0x3f6855,_0x17832b(0x10c));if(!_0xf21427)return 0x1;const _0x5c9829=resolveSite(_0xf21427);return console['log'](_0x17832b(0x10d)+_0x5c9829),await runOAuthLoginFlow(_0x5c9829,_0x3f6855,_0xa2cca2[_0x17832b(0x123)]??LogLevel[_0x17832b(0x11e)]),0x0;}}
|