@treasuredata/tdx 2026.3.23 → 2026.3.25
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/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/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/policy.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_0x501fe3=a3_0x3219;(function(_0x24aafd,_0x22b7aa){const _0x23b70a=a3_0x3219,_0x610143=_0x24aafd();while(!![]){try{const _0x139d40=-parseInt(_0x23b70a(0x1b1))/0x1+-parseInt(_0x23b70a(0x1be))/0x2+-parseInt(_0x23b70a(0x1b8))/0x3+parseInt(_0x23b70a(0x1a9))/0x4+-parseInt(_0x23b70a(0x1ab))/0x5*(-parseInt(_0x23b70a(0x1c2))/0x6)+-parseInt(_0x23b70a(0x1a2))/0x7*(parseInt(_0x23b70a(0x1af))/0x8)+-parseInt(_0x23b70a(0x1c0))/0x9*(-parseInt(_0x23b70a(0x1b9))/0xa);if(_0x139d40===_0x22b7aa)break;else _0x610143['push'](_0x610143['shift']());}catch(_0x3c9a8d){_0x610143['push'](_0x610143['shift']());}}}(a3_0x338b,0x51011));function a3_0x3219(_0x2ad5fb,_0x298481){_0x2ad5fb=_0x2ad5fb-0x1a1;const _0x338b7e=a3_0x338b();let _0x32195a=_0x338b7e[_0x2ad5fb];return _0x32195a;}import{BaseCommand}from'./command.js';function a3_0x338b(){const _0x33747c=['✔\x20Found\x20','744126JXSVEg','4798810inihOR','activations','data','Error:\x20Segment\x20name\x20is\x20required','cause','567296AHxVhN','resolveSegmentId','9ZWHgNw','Resolved\x20parent\x20ID:\x20','12kHqdQy','segment','1909894ahozdi','length','site','description','Site:\x20','verbose','Resolved\x20child\x20ID:\x20','1716348HNUjgR','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','727565qkcCFF','listActivations','Error:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','8vmWmZe','Child\x20name:\x20','63669wfZKPp','List\x20activations\x20for\x20a\x20segment','name','\x20activation','error','execute'];a3_0x338b=function(){return _0x33747c;};return a3_0x338b();}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_0x501fe3(0x1b3)]=a3_0x501fe3(0x1ba);[a3_0x501fe3(0x1a5)]=a3_0x501fe3(0x1b2);async[a3_0x501fe3(0x1b6)](_0x5e8f1d){const _0x1be0f8=a3_0x501fe3,{options:_0x484775,args:_0x4a64cd,tdx:_0x19c3c2}=_0x5e8f1d;if(_0x4a64cd['length']===0x0)return console[_0x1be0f8(0x1b5)](_0x1be0f8(0x1bc)),console[_0x1be0f8(0x1b5)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x343471,childId:_0x4052b8}=parseSegmentRef(_0x4a64cd[0x0]);if(!_0x4052b8)return console['error'](_0x1be0f8(0x1aa)),console[_0x1be0f8(0x1b5)](_0x1be0f8(0x1ae)),0x1;_0x484775[_0x1be0f8(0x1a7)]&&(console[_0x1be0f8(0x1b5)](_0x1be0f8(0x1a6)+_0x484775[_0x1be0f8(0x1a4)]),console[_0x1be0f8(0x1b5)]('Parent\x20name:\x20'+_0x343471),console[_0x1be0f8(0x1b5)](_0x1be0f8(0x1b0)+_0x4052b8));const _0x5e386d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x343471+'\x27...',()=>_0x19c3c2['segment']['resolveParentId'](_0x343471),{'verbose':_0x484775[_0x1be0f8(0x1a7)]}),_0x2641aa=_0x5e386d[_0x1be0f8(0x1bb)];_0x484775[_0x1be0f8(0x1a7)]&&console[_0x1be0f8(0x1b5)](_0x1be0f8(0x1c1)+_0x2641aa);const _0xbbb855=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x4052b8+'\x27...',()=>_0x19c3c2[_0x1be0f8(0x1a1)][_0x1be0f8(0x1bf)](_0x2641aa,_0x4052b8),{'verbose':_0x484775[_0x1be0f8(0x1a7)]}),_0x342cd6=_0xbbb855['data'];_0x484775[_0x1be0f8(0x1a7)]&&console['error'](_0x1be0f8(0x1a8)+_0x342cd6);const _0x168de6=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x4052b8+'\x27...',()=>_0x19c3c2[_0x1be0f8(0x1a1)][_0x1be0f8(0x1ac)](_0x2641aa,_0x342cd6),{'verbose':_0x484775[_0x1be0f8(0x1a7)]}),_0x59c260=_0x168de6[_0x1be0f8(0x1bb)];return console[_0x1be0f8(0x1b5)](_0x1be0f8(0x1b7)+_0x59c260['length']+_0x1be0f8(0x1b4)+(_0x59c260[_0x1be0f8(0x1a3)]!==0x1?'s':'')),await handleSDKOutput(_0x59c260,_0x484775),0x0;}catch(_0x59562b){if(_0x59562b instanceof SDKError)return console[_0x1be0f8(0x1b5)](_0x1be0f8(0x1ad)+_0x59562b['message']),_0x59562b[_0x1be0f8(0x1bd)]&&console[_0x1be0f8(0x1b5)]('\x20\x20Cause:\x20'+_0x59562b['cause']),0x1;throw _0x59562b;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x36616f=a4_0x1c77;(function(_0x1d9765,_0x45ba79){const _0x3796f0=a4_0x1c77,_0x3574c7=_0x1d9765();while(!![]){try{const _0xc76eb8=parseInt(_0x3796f0(0x1a1))/0x1+-parseInt(_0x3796f0(0x19a))/0x2+parseInt(_0x3796f0(0x1b1))/0x3*(parseInt(_0x3796f0(0x249))/0x4)+parseInt(_0x3796f0(0x22a))/0x5+parseInt(_0x3796f0(0x244))/0x6*(parseInt(_0x3796f0(0x1fc))/0x7)+parseInt(_0x3796f0(0x1a5))/0x8*(-parseInt(_0x3796f0(0x1d2))/0x9)+-parseInt(_0x3796f0(0x220))/0xa*(parseInt(_0x3796f0(0x1a6))/0xb);if(_0xc76eb8===_0x45ba79)break;else _0x3574c7['push'](_0x3574c7['shift']());}catch(_0x233f22){_0x3574c7['push'](_0x3574c7['shift']());}}}(a4_0x4bb9,0x8be4c));import a4_0x1f4b9a from'chalk';import a4_0x4e9b75 from'path';function a4_0x1c77(_0x127676,_0x2e3b85){_0x127676=_0x127676-0x192;const _0x4bb983=a4_0x4bb9();let _0x1c772c=_0x4bb983[_0x127676];return _0x1c772c;}import{existsSync,readFileSync}from'fs';function a4_0x4bb9(){const _0x28a309=['action','\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','integrations','unchanged','\x22:\x20','projectId','1314189FwtcIG','pushProject','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aError:','\x20\x20Source:\x20','No\x20tdx.json\x20found\x20in\x20','\x0aErrors\x20found:','✔\x20Context\x20set:\x20','\x20new','\x0aPull\x20summary\x20for\x20\x27','-\x20nothing\x20pushed','\x20successfully','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','outputPath','green','Cancelled','Writing\x20files...','Pushing\x20to\x20project...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','-\x20no\x20files\x20written','hasChanges','join','description','Source:\x20','total','Would\x20clone:','profile','knowledgeBases','INVALID_ARGUMENT','log','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Integrations:\x20','New\x20project:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','session','arg-dir','\x0aChanges\x20to\x20prompt\x20\x27','dirname','updated','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','errors','Using\x20project\x20from\x20context:\x20','77dNqINa','\x20resources\x20to\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','error','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Agents:\x20','Status:\x20','\x0aPush\x20summary\x20for\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','output','newProjectId','\x20\x20tdx\x20agent\x20clone\x20agents/','tdx.json','llm_project','counts','\x20files\x20to\x20','Dry\x20run\x20-\x20no\x20changes\x20made','agents','Pulling\x20agent\x20\x22','Would\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','diff','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','yellow','\x22\x20to\x20a\x20different\x20profile','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Knowledge\x20Bases:\x20','textKnowledgeBases','dim','\x20\x20Integration\x20\x22','no_context','isNew','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','reason','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20errors','15410hakpKx','projectName','site','\x0aPush\x20','\x20\x20Prompt\x20\x22','\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)','message','agent:clone','\x20\x20tdx\x20agent\x20pull\x20','\x20created','3963120ZBZGWS','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','pushAgent','\x0aChanges\x20to\x20integration\x20\x27','Using\x20project\x20from\x20','experimentalKnowledgeBases','pullAgent','\x22...','force','Dry\x20run\x20-\x20no\x20files\x20written','agentName','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)','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','execute','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','red','cyan','found','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Base\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20changed','424860eQLvBi','yes','\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','\x20updated','no_local_folder','1188dhCBKa','New\x20project\x20ID:\x20','\x20unchanged','\x20\x20Target:\x20','Analyzing\x20project\x20\x22','dryRun','repeat','sourceProjectName','cwd','\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','agent','\x20--name\x20','798400GJpQRn','agent.yml','Chat:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','utf-8','llm','649945JIGtBo','Project\x20cloned\x20with\x20errors','Errors:','push','16BKKDWY','9218URDzrM','Project\x20cloned\x20successfully','prompts','Output\x20path:\x20','<new-name>','Agent\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','llmProject','Using\x20local\x20project:\x20','new','Project:\x20','3375qLyegR','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agentId','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','created','Summary:','Agent\x20pulled\x20successfully','Cloning\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Experimental\x20Artifacts:\x20','\x0a✔\x20Pulled\x20','Agent:\x20','context','\x22\x20from\x20project\x20\x22','outputDir','Using\x20project:\x20','gray','\x20=\x20','source','\x22\x20to\x20\x22','agent:pull','\x20|\x20','Using\x20context\x20project:\x20','experimentalArtifacts'];a4_0x4bb9=function(){return _0x28a309;};return a4_0x4bb9();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x3e4555){const _0x422c00=a4_0x1c77,_0xe22fa7=[];if(_0x3e4555['total']!==undefined)_0xe22fa7[_0x422c00(0x1a4)](_0x3e4555['total']+'\x20total');if(_0x3e4555[_0x422c00(0x1af)]!==undefined&&_0x3e4555[_0x422c00(0x1af)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x1e0)](_0x3e4555['new']+_0x422c00(0x1da)));if(_0x3e4555[_0x422c00(0x1b8)]!==undefined&&_0x3e4555['created']>0x0)_0xe22fa7['push'](a4_0x1f4b9a['green'](_0x3e4555[_0x422c00(0x1b8)]+_0x422c00(0x229)));if(_0x3e4555[_0x422c00(0x1f8)]!==undefined&&_0x3e4555[_0x422c00(0x1f8)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x213)](_0x3e4555['updated']+_0x422c00(0x247)));if(_0x3e4555[_0x422c00(0x1cf)]!==undefined&&_0x3e4555['unchanged']>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x1c4)](_0x3e4555[_0x422c00(0x1cf)]+_0x422c00(0x24b)));if(_0x3e4555[_0x422c00(0x1fa)]!==undefined&&_0x3e4555[_0x422c00(0x1fa)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x23d)](_0x3e4555[_0x422c00(0x1fa)]+_0x422c00(0x21f)));return _0xe22fa7['join'](',\x20');}function displayDiffs(_0x16f5ab,_0x3879ff,_0x3088e0,_0x2de9db,_0xddeec,_0x44c352,_0x106f78){const _0x3202bb=a4_0x1c77;for(const _0x28911d of _0x16f5ab){if(_0x28911d[_0x3202bb(0x211)]){const _0x2acd49=_0x28911d['agentName']||_0x28911d[_0x3202bb(0x239)];console[_0x3202bb(0x1ef)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2acd49+'\x27:'),console['log']('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x28911d['diff']),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c));}}for(const _0x29242e of _0x3879ff){_0x29242e[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x22c)+_0x29242e[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console[_0x3202bb(0x1ef)](_0x29242e[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x107acf of _0x3088e0){_0x107acf['diff']&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x19d)+_0x107acf['name']+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console[_0x3202bb(0x1ef)](_0x107acf[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x1a218a of _0x2de9db){_0x1a218a[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x1f6)+_0x1a218a[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'['repeat'](0x3c)),console[_0x3202bb(0x1ef)](_0x1a218a['diff']),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x57731d of _0xddeec){_0x57731d[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x22e)+_0x57731d[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x57731d[_0x3202bb(0x211)]),console['log']('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x523235 of _0x44c352){_0x523235[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x1f3)+_0x523235['name']+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x523235[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x31f486 of _0x106f78){_0x31f486['diff']&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x21e)+_0x31f486[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x31f486[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x36616f(0x239)]=a4_0x36616f(0x1c8);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x36616f(0x23a)](_0xcaad55){const _0x1ad9b7=a4_0x36616f,{options:_0x457e12,args:_0x579e72,tdx:_0x2df277}=_0xcaad55,_0x53bdcf=_0x579e72[0x0],_0x2ce4ca=_0x579e72[0x1],_0x474fac=_0x457e12[_0x1ad9b7(0x205)],_0x170537=_0x457e12[_0x1ad9b7(0x193)],_0x32cc9d=_0x457e12[_0x1ad9b7(0x233)],_0x1b6348=_0x457e12[_0x1ad9b7(0x245)],_0x591e5d=_0x457e12[_0x1ad9b7(0x1ad)],_0x2d1337=_0x457e12[_0x1ad9b7(0x198)];let _0x511121;if(_0x53bdcf){const _0x588254=a4_0x4e9b75[_0x1ad9b7(0x1e7)](_0x53bdcf,'tdx.json');if(existsSync(_0x588254))try{const _0x3aed0c=JSON['parse'](readFileSync(_0x588254,_0x1ad9b7(0x19f)));_0x3aed0c[_0x1ad9b7(0x209)]&&(_0x511121={'llm_project':_0x3aed0c['llm_project']});}catch{}}const _0x22b6ed=findAgentConfigPath(process[_0x1ad9b7(0x196)]());let _0x948c81;if(_0x22b6ed)try{const _0x40bdfa=JSON['parse'](readFileSync(_0x22b6ed,_0x1ad9b7(0x19f)));_0x40bdfa[_0x1ad9b7(0x209)]&&(_0x948c81={'llm_project':_0x40bdfa[_0x1ad9b7(0x209)]});}catch{}const _0x263e2a=resolveAgentPullArgs({'arg':_0x53bdcf,'agentNameArg':_0x2ce4ca,'agentFlag':_0x2d1337,'contextProject':_0x591e5d,'argDirConfig':_0x511121,'cwdConfigPath':_0x22b6ed||undefined,'cwdConfig':_0x948c81}),{projectNameOrId:_0x3c0d02,targetAgentName:_0x2ac72f,existingOutputDir:_0x43c647,source:_0xe9bb5a}=_0x263e2a;if(_0xe9bb5a===_0x1ad9b7(0x1f5))console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x22f)+a4_0x4e9b75[_0x1ad9b7(0x1e7)](_0x53bdcf,_0x1ad9b7(0x208))+':\x20'+_0x3c0d02));else{if(_0xe9bb5a==='cwd-config')console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x1c3)+_0x3c0d02));else _0xe9bb5a===_0x1ad9b7(0x1c0)&&console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x1fb)+_0x3c0d02));}if(!_0x3c0d02)return _0x2d1337?(console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x1ac))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x242)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x215))):(console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x204))),console['log'](_0x1ad9b7(0x236)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x197)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1cd)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x21c)),console['log'](_0x1ad9b7(0x246))),0x1;if(_0x2ac72f){const {data:_0x26bf0f}=await withSpinner(_0x1ad9b7(0x20e)+_0x2ac72f+_0x1ad9b7(0x1c1)+_0x3c0d02+_0x1ad9b7(0x232),()=>_0x2df277[_0x1ad9b7(0x1a0)][_0x1ad9b7(0x231)](_0x3c0d02,_0x2ac72f,_0x474fac,{'dryRun':_0x170537,'force':_0x32cc9d}));if(_0x170537)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x234))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x210)+_0x26bf0f[_0x1ad9b7(0x235)]),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1a9)+_0x26bf0f[_0x1ad9b7(0x1df)]),_0x26bf0f[_0x1ad9b7(0x211)]&&(console[_0x1ad9b7(0x1ef)]('\x0aChanges:'),console[_0x1ad9b7(0x1ef)]('─'['repeat'](0x3c)),console['log'](_0x26bf0f['diff']),console[_0x1ad9b7(0x1ef)]('─'[_0x1ad9b7(0x194)](0x3c))),0x0;return console['log'](a4_0x1f4b9a[_0x1ad9b7(0x1e0)](_0x1ad9b7(0x1ba))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1bf)+_0x26bf0f[_0x1ad9b7(0x235)]),console[_0x1ad9b7(0x1ef)]('Output:\x20'+_0x26bf0f['outputPath']),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x202)+(_0x26bf0f[_0x1ad9b7(0x21b)]?a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('new'):_0x26bf0f[_0x1ad9b7(0x1e6)]?a4_0x1f4b9a[_0x1ad9b7(0x213)]('updated'):a4_0x1f4b9a['gray'](_0x1ad9b7(0x1cf)))),0x0;}const _0x92f812=_0x43c647||_0x474fac,{data:_0x25221e}=await withSpinner(_0x1ad9b7(0x192)+_0x3c0d02+_0x1ad9b7(0x232),()=>_0x2df277[_0x1ad9b7(0x1a0)]['pullProject'](_0x3c0d02,_0x92f812,{'dryRun':!![]})),_0x202076=_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ed)][_0x1ad9b7(0x1af)]+_0x25221e['counts'][_0x1ad9b7(0x217)][_0x1ad9b7(0x1af)]+_0x25221e['counts'][_0x1ad9b7(0x1a8)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ce)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)]['new'],_0x5e2d96=_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ed)]['updated']+_0x25221e['counts']['textKnowledgeBases']['updated']+_0x25221e[_0x1ad9b7(0x20a)]['prompts'][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ce)]['updated']+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)][_0x1ad9b7(0x1f8)],_0x1e047b=_0x25221e['counts'][_0x1ad9b7(0x20d)]['unchanged']+_0x25221e[_0x1ad9b7(0x20a)]['knowledgeBases'][_0x1ad9b7(0x1cf)]+_0x25221e['counts'][_0x1ad9b7(0x217)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1a8)]['unchanged']+_0x25221e['counts'][_0x1ad9b7(0x1ce)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)]['unchanged'];console['log'](_0x1ad9b7(0x1db)+_0x25221e['projectName']+'\x27:'),console[_0x1ad9b7(0x1ef)]('\x20\x20'+a4_0x1f4b9a['green']('+\x20'+_0x202076+_0x1ad9b7(0x1da))+_0x1ad9b7(0x1c9)+a4_0x1f4b9a[_0x1ad9b7(0x213)]('~\x20'+_0x5e2d96+'\x20changed')+_0x1ad9b7(0x1c9)+a4_0x1f4b9a[_0x1ad9b7(0x218)]('=\x20'+_0x1e047b+_0x1ad9b7(0x24b))),console[_0x1ad9b7(0x1ef)]('\x20\x20Agents:\x20'+formatCountSummary(_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)])),console['log'](_0x1ad9b7(0x216)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1ed)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1fe)+formatCountSummary(_0x25221e['counts']['textKnowledgeBases'])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x240)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1a8)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1f1)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1ce)]));const _0x39c85a=_0x25221e['counts'][_0x1ad9b7(0x230)]['total']>0x0||_0x25221e['counts']['experimentalArtifacts'][_0x1ad9b7(0x1ea)]>0x0;_0x39c85a&&(console['log'](_0x1ad9b7(0x23b)+formatCountSummary(_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1bd)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1cb)])));console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x24c)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x25221e[_0x1ad9b7(0x1c2)])),displayDiffs(_0x25221e[_0x1ad9b7(0x20d)],_0x25221e[_0x1ad9b7(0x1ed)],_0x25221e['textKnowledgeBases'],_0x25221e[_0x1ad9b7(0x1a8)],_0x25221e[_0x1ad9b7(0x1ce)],_0x25221e['experimentalKnowledgeBases'],_0x25221e[_0x1ad9b7(0x1cb)]);if(_0x170537)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a['yellow'](_0x1ad9b7(0x1b3))),0x0;if(_0x202076===0x0&&_0x5e2d96===0x0)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x25221e['projectName']},_0x457e12[_0x1ad9b7(0x1f4)]),console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('✔\x20Context\x20set:\x20'+a4_0x1f4b9a[_0x1ad9b7(0x218)]('llm_project')+_0x1ad9b7(0x1c5)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x25221e['projectName']))),0x0;if(!_0x1b6348&&!_0x32cc9d){if(!isInteractive())return console[_0x1ad9b7(0x1ff)](a4_0x1f4b9a[_0x1ad9b7(0x23d)](_0x1ad9b7(0x1d5)),_0x1ad9b7(0x23c)),console[_0x1ad9b7(0x1ff)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x238))),0x1;const _0x3615e0=await confirmKey('\x0aWrite\x20'+(_0x202076+_0x5e2d96)+'\x20files?');if(!_0x3615e0)return console['log'](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x1e1)),_0x1ad9b7(0x1e5)),0x1;}const {data:_0x16251b}=await withSpinner(_0x1ad9b7(0x1e2),()=>_0x2df277['llm']['pullProject'](_0x3c0d02,_0x92f812,{'force':_0x32cc9d}));return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a['green'](_0x1ad9b7(0x1be)+(_0x202076+_0x5e2d96)+_0x1ad9b7(0x20b)+_0x16251b[_0x1ad9b7(0x1c2)])),saveSessionContext({'llm_project':_0x16251b[_0x1ad9b7(0x221)]},_0x457e12[_0x1ad9b7(0x1f4)]),console['log'](a4_0x1f4b9a['green'](_0x1ad9b7(0x1d9)+a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x209))+_0x1ad9b7(0x1c5)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x16251b['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x36616f(0x227);['description']=a4_0x36616f(0x1b7);async[a4_0x36616f(0x23a)](_0xd9f55d){const _0x488cbd=a4_0x36616f,{options:_0x23760b,args:_0x3ed4d5,tdx:_0x7d5ec2}=_0xd9f55d,_0x53d883=_0x3ed4d5[0x0],_0x515338=_0x23760b[_0x488cbd(0x239)],_0x487d25=_0x23760b['dryRun'],_0x16cf15=_0x23760b[_0x488cbd(0x245)],_0xaaf592=_0x23760b['site'],_0x5f11d7=_0x23760b[_0x488cbd(0x1ad)];let _0x4c6a08;const _0x4c8a66=findAgentConfigPath(process[_0x488cbd(0x196)]());if(_0x53d883){const _0x42945d=a4_0x4e9b75[_0x488cbd(0x1e7)](_0x53d883,_0x488cbd(0x208));existsSync(_0x42945d)?(_0x4c6a08=_0x53d883,console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x218)]('Using\x20local\x20project:\x20'+_0x53d883))):_0x4c6a08=_0x53d883;}else{if(_0x4c8a66)_0x4c6a08=a4_0x4e9b75[_0x488cbd(0x1f7)](_0x4c8a66),console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x218)]('Using\x20current\x20project:\x20'+_0x4c6a08));else{if(_0x5f11d7){const _0xdf81e9=sanitizeForFilesystem(_0x5f11d7);let _0x5ca3c7=_0xdf81e9,_0xdc1808=a4_0x4e9b75[_0x488cbd(0x1e7)](process[_0x488cbd(0x196)](),_0x488cbd(0x20d),_0xdf81e9,_0x488cbd(0x208));if(!existsSync(_0xdc1808)){const _0x1c3deb=normalizeName(_0x5f11d7),_0x4ae1fc=a4_0x4e9b75[_0x488cbd(0x1e7)](process[_0x488cbd(0x196)](),_0x488cbd(0x20d),_0x1c3deb,_0x488cbd(0x208));existsSync(_0x4ae1fc)&&(_0x5ca3c7=_0x1c3deb,_0xdc1808=_0x4ae1fc);}if(existsSync(_0xdc1808))_0x4c6a08=a4_0x4e9b75[_0x488cbd(0x1f7)](_0xdc1808),console[_0x488cbd(0x1ef)](a4_0x1f4b9a['dim'](_0x488cbd(0x1ae)+_0x4c6a08));else{const _0x57c308=_0x23760b[_0x488cbd(0x1ec)];if(_0x57c308)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5f11d7+_0x488cbd(0x214),undefined,{'helpText':_0x488cbd(0x237)+_0x488cbd(0x1f9)+(_0x488cbd(0x228)+_0x5f11d7+'\x0a')+(_0x488cbd(0x207)+_0x5ca3c7+_0x488cbd(0x199)+(_0x515338||_0x488cbd(0x1aa))+'\x20--profile\x20'+_0x57c308)});_0x4c6a08=_0x5f11d7,console[_0x488cbd(0x1ef)](a4_0x1f4b9a['dim'](_0x488cbd(0x1ca)+_0x5f11d7));}}}}if(!_0x4c6a08)return console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x1b2))),console['log'](_0x488cbd(0x1b6)),console[_0x488cbd(0x1ef)](_0x488cbd(0x1d4)),console[_0x488cbd(0x1ef)](_0x488cbd(0x225)),console[_0x488cbd(0x1ef)](_0x488cbd(0x1de)),0x1;if(!_0x515338)throw new SDKError(ErrorCode[_0x488cbd(0x19e)],_0x488cbd(0x22b),undefined,{'helpText':_0x488cbd(0x1bc)});if(!_0x16cf15&&!_0x487d25){if(!isInteractive())return console['error'](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x1d5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x488cbd(0x1ff)](a4_0x1f4b9a[_0x488cbd(0x218)](_0x488cbd(0x238))),0x1;const _0x436700=await confirmKey('Clone\x20\x22'+_0x4c6a08+'\x22\x20to\x20new\x20project\x20\x22'+_0x515338+'\x22?');if(!_0x436700)return console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x1e1))),0x1;}const {data:_0x2d6a12}=await withSpinner(_0x488cbd(0x1bb)+_0x4c6a08+_0x488cbd(0x1c7)+_0x515338+_0x488cbd(0x232),()=>_0x7d5ec2[_0x488cbd(0x1a0)]['cloneProject'](_0x4c6a08,_0x515338,{'dryRun':_0x487d25}));if(_0x487d25){console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x20c))),console[_0x488cbd(0x1ef)](_0x488cbd(0x1e9)+_0x2d6a12[_0x488cbd(0x195)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f2)+_0x515338),console[_0x488cbd(0x1ef)](_0x488cbd(0x1eb)),console['log'](_0x488cbd(0x201)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x20d)][_0x488cbd(0x1b8)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x216)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)][_0x488cbd(0x1b8)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x240)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1a8)][_0x488cbd(0x1b8)]);const _0x3f1b59=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12['counts']['experimentalArtifacts'][_0x488cbd(0x1b8)]>0x0;return _0x3f1b59&&(console[_0x488cbd(0x1ef)](_0x488cbd(0x23b)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)]['created']),console[_0x488cbd(0x1ef)](_0x488cbd(0x1bd)+_0x2d6a12['counts'][_0x488cbd(0x1cb)][_0x488cbd(0x1b8)])),0x0;}const _0x4f1f07=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x20d)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12['counts'][_0x488cbd(0x1a8)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'][_0x488cbd(0x1fa)]>0x0;_0x4f1f07?console[_0x488cbd(0x1ef)](a4_0x1f4b9a['yellow'](_0x488cbd(0x1a2))):console[_0x488cbd(0x1ef)](a4_0x1f4b9a['green'](_0x488cbd(0x1a7)));console[_0x488cbd(0x1ef)]('Source:\x20'+_0x2d6a12[_0x488cbd(0x195)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f2)+_0x2d6a12['newProjectName']),console[_0x488cbd(0x1ef)](_0x488cbd(0x24a)+_0x2d6a12[_0x488cbd(0x206)]),console[_0x488cbd(0x1ef)](),console['log'](_0x488cbd(0x1b9)),console[_0x488cbd(0x1ef)](_0x488cbd(0x201)+formatCountSummary(_0x2d6a12['counts'][_0x488cbd(0x20d)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x216)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x240)+formatCountSummary(_0x2d6a12['counts'][_0x488cbd(0x1a8)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f1)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ce)]));const _0x355ea6=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1f8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1cf)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1cb)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'][_0x488cbd(0x1f8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1cb)]['unchanged']>0x0;_0x355ea6&&(console[_0x488cbd(0x1ef)](_0x488cbd(0x23b)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)])),console['log'](_0x488cbd(0x1bd)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'])));if(_0x4f1f07){console[_0x488cbd(0x1ef)](),console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x1a3)));for(const _0xb15bae of _0x2d6a12[_0x488cbd(0x20d)]){_0xb15bae[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Agent\x20\x22'+_0xb15bae[_0x488cbd(0x235)]+_0x488cbd(0x1d0)+_0xb15bae[_0x488cbd(0x1ff)]));}for(const _0x29a989 of _0x2d6a12[_0x488cbd(0x1ed)]){_0x29a989[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console['log'](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x29a989[_0x488cbd(0x239)]+_0x488cbd(0x1d0)+_0x29a989['error']));}for(const _0x15b908 of _0x2d6a12['prompts']){_0x15b908[_0x488cbd(0x1cc)]==='error'&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x224)+_0x15b908[_0x488cbd(0x239)]+'\x22:\x20'+_0x15b908[_0x488cbd(0x1ff)]));}for(const _0x356246 of _0x2d6a12[_0x488cbd(0x1ce)]){_0x356246['action']==='error'&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x219)+_0x356246[_0x488cbd(0x239)]+_0x488cbd(0x1d0)+_0x356246[_0x488cbd(0x1ff)]));}for(const _0x4fdf8d of _0x2d6a12[_0x488cbd(0x230)]){_0x4fdf8d[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console['log'](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x4fdf8d['name']+_0x488cbd(0x1d0)+_0x4fdf8d[_0x488cbd(0x1ff)]));}for(const _0x28c8eb of _0x2d6a12[_0x488cbd(0x1cb)]){_0x28c8eb[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x28c8eb[_0x488cbd(0x239)]+'\x22:\x20'+_0x28c8eb[_0x488cbd(0x1ff)]));}return 0x1;}console[_0x488cbd(0x1ef)]();const _0xe74705=getLLMProjectUrl(_0xaaf592,_0x2d6a12[_0x488cbd(0x206)]);return console[_0x488cbd(0x1ef)](_0x488cbd(0x1b0)+a4_0x1f4b9a[_0x488cbd(0x23e)](_0xe74705)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x36616f(0x239)]='agent:push';[a4_0x36616f(0x1e8)]=a4_0x36616f(0x212);async['execute'](_0x556035){const _0x49be48=a4_0x36616f,{options:_0x24ac5e,args:_0x51fee3,tdx:_0x2dd979}=_0x556035;let _0x2cb93b=_0x51fee3[0x0]||process['cwd']();const _0x3239bb=_0x24ac5e[_0x49be48(0x193)],_0x4cbee9=_0x24ac5e[_0x49be48(0x233)],_0x3f26ef=_0x24ac5e[_0x49be48(0x245)],_0x314213=_0x24ac5e[_0x49be48(0x222)],_0x1478cc=a4_0x4e9b75[_0x49be48(0x1e7)](_0x2cb93b,_0x49be48(0x19b)),_0x19adfc=existsSync(_0x1478cc);if(_0x19adfc){const {data:_0x436fa9}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x2cb93b+_0x49be48(0x232),()=>_0x2dd979[_0x49be48(0x1a0)][_0x49be48(0x22d)](_0x2cb93b,{'dryRun':_0x3239bb,'force':_0x4cbee9}));if(_0x3239bb)return console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x49be48(0x1ef)](_0x49be48(0x20f)+_0x436fa9[_0x49be48(0x235)]),0x0;if(_0x436fa9['action']===_0x49be48(0x1ff))return console['log'](a4_0x1f4b9a[_0x49be48(0x23d)]('Failed\x20to\x20push\x20agent:\x20'+_0x436fa9['error'])),0x1;console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x1e0)](_0x49be48(0x1ab)+_0x436fa9[_0x49be48(0x1cc)]+_0x49be48(0x1dd))),console[_0x49be48(0x1ef)](_0x49be48(0x1bf)+_0x436fa9[_0x49be48(0x235)]);if(_0x436fa9[_0x49be48(0x1b4)]&&_0x436fa9[_0x49be48(0x1d1)]){const _0x2bf396=getLLMAgentChatUrl(_0x314213,_0x436fa9[_0x49be48(0x1d1)],_0x436fa9[_0x49be48(0x1b4)]);console[_0x49be48(0x1ef)](_0x49be48(0x19c)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x2bf396));}return 0x0;}const _0x17ab3a=_0x24ac5e['llmProject'],_0xfc2e8d=resolveProjectFromContext(_0x2cb93b,_0x17ab3a);if(_0xfc2e8d[_0x49be48(0x23f)])_0x2cb93b=_0xfc2e8d['projectDir'],_0xfc2e8d[_0x49be48(0x1c6)]===_0x49be48(0x1c0)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x218)](_0x49be48(0x1c3)+_0x2cb93b));else{let _0x8cbfa8='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0xfc2e8d[_0x49be48(0x21d)]===_0x49be48(0x248)&&(_0x8cbfa8=_0xfc2e8d['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xfc2e8d[_0x49be48(0x1ad)]+_0x49be48(0x1f0));throw new SDKError(ErrorCode[_0x49be48(0x1ee)],_0xfc2e8d['reason']===_0x49be48(0x21a)?_0xfc2e8d[_0x49be48(0x226)]:_0x49be48(0x1d7)+_0x2cb93b,undefined,{'helpText':_0x8cbfa8});}const {data:_0x5d256e}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x2dd979['llm'][_0x49be48(0x1d3)](_0x2cb93b,{'dryRun':!![]})),_0x20568e=_0x5d256e[_0x49be48(0x20a)]['agents']['errors']>0x0;if(_0x20568e){console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x1d8)));for(const _0x1bc8ab of _0x5d256e['agents']){_0x1bc8ab[_0x49be48(0x1cc)]==='error'&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x20\x20Agent\x20\x22'+_0x1bc8ab[_0x49be48(0x235)]+_0x49be48(0x1d0)+_0x1bc8ab['error']));}return 0x1;}const _0xb733c0=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x20d)]['created']+_0x5d256e[_0x49be48(0x20a)]['knowledgeBases'][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1a8)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalArtifacts']['created'],_0x3de0cc=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x20d)][_0x49be48(0x1f8)]+_0x5d256e['counts']['knowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e[_0x49be48(0x20a)]['textKnowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e['counts']['prompts']['updated']+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]['updated']+_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalArtifacts']['updated'],_0x13dc63=_0x5d256e[_0x49be48(0x20a)]['agents'][_0x49be48(0x1cf)]+_0x5d256e['counts'][_0x49be48(0x1ed)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1a8)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]['unchanged']+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)]['unchanged']+_0x5d256e['counts'][_0x49be48(0x1cb)]['unchanged'];console[_0x49be48(0x1ef)](_0x49be48(0x203)+_0x5d256e['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x1f4b9a[_0x49be48(0x1e0)]('+\x20'+_0xb733c0+_0x49be48(0x1da))+_0x49be48(0x1c9)+a4_0x1f4b9a['yellow']('~\x20'+_0x3de0cc+_0x49be48(0x243))+_0x49be48(0x1c9)+a4_0x1f4b9a[_0x49be48(0x218)]('=\x20'+_0x13dc63+_0x49be48(0x24b))),console[_0x49be48(0x1ef)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5d256e['counts'][_0x49be48(0x20d)])),console['log'](_0x49be48(0x216)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ed)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)])),console[_0x49be48(0x1ef)](_0x49be48(0x240)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)]['prompts'])),console[_0x49be48(0x1ef)](_0x49be48(0x1f1)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]));const _0x13371d=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1b8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1f8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1cf)]>0x0||_0x5d256e['counts'][_0x49be48(0x1cb)][_0x49be48(0x1b8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1cb)]['updated']>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1cb)][_0x49be48(0x1cf)]>0x0;_0x13371d&&(console['log'](_0x49be48(0x23b)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'])),console['log'](_0x49be48(0x1bd)+formatCountSummary(_0x5d256e['counts']['experimentalArtifacts'])));console[_0x49be48(0x1ef)](_0x49be48(0x1d6)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x2cb93b)),displayDiffs(_0x5d256e['agents'],_0x5d256e['knowledgeBases'],_0x5d256e[_0x49be48(0x217)],_0x5d256e[_0x49be48(0x1a8)],_0x5d256e[_0x49be48(0x1ce)],_0x5d256e[_0x49be48(0x230)],_0x5d256e[_0x49be48(0x1cb)]);if(_0x3239bb)return console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)](_0x49be48(0x1e4))),0x0;if(_0xb733c0===0x0&&_0x3de0cc===0x0){console['log'](a4_0x1f4b9a[_0x49be48(0x1e0)](_0x49be48(0x200)));const _0x85813b=getLLMProjectUrl(_0x314213,_0x5d256e[_0x49be48(0x1d1)]);return console[_0x49be48(0x1ef)](_0x49be48(0x1b0)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x85813b)),0x0;}if(!_0x3f26ef&&!_0x4cbee9){if(!isInteractive())return console[_0x49be48(0x1ff)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x49be48(0x1ff)](a4_0x1f4b9a[_0x49be48(0x218)](_0x49be48(0x238))),0x1;const _0x4b3b6a=await confirmKey(_0x49be48(0x223)+(_0xb733c0+_0x3de0cc)+'\x20resources?');if(!_0x4b3b6a)return console[_0x49be48(0x1ef)](a4_0x1f4b9a['yellow'](_0x49be48(0x1e1)),_0x49be48(0x1dc)),0x1;}const {data:_0x239723}=await withSpinner(_0x49be48(0x1e3),()=>_0x2dd979[_0x49be48(0x1a0)][_0x49be48(0x1d3)](_0x2cb93b,{'force':_0x4cbee9})),_0x103307=_0x239723[_0x49be48(0x20a)][_0x49be48(0x20d)][_0x49be48(0x1fa)]>0x0||_0x239723['counts']['knowledgeBases'][_0x49be48(0x1fa)]>0x0||_0x239723[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1fa)]>0x0||_0x239723['counts'][_0x49be48(0x1a8)][_0x49be48(0x1fa)]>0x0;if(_0x103307){console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x49be48(0x1ef)](),console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x1a3)));for(const _0x1bf646 of _0x239723['agents']){_0x1bf646[_0x49be48(0x1cc)]==='error'&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x20\x20Agent\x20\x22'+_0x1bf646[_0x49be48(0x235)]+_0x49be48(0x1d0)+_0x1bf646[_0x49be48(0x1ff)]));}for(const _0x3e04bb of _0x239723[_0x49be48(0x1ed)]){_0x3e04bb['action']===_0x49be48(0x1ff)&&console['log'](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x241)+_0x3e04bb[_0x49be48(0x239)]+_0x49be48(0x1d0)+_0x3e04bb['error']));}for(const _0x3be7cf of _0x239723[_0x49be48(0x217)]){_0x3be7cf[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console['log'](a4_0x1f4b9a['red'](_0x49be48(0x1b5)+_0x3be7cf[_0x49be48(0x239)]+'\x22:\x20'+_0x3be7cf[_0x49be48(0x1ff)]));}for(const _0x566369 of _0x239723[_0x49be48(0x1a8)]){_0x566369[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a['red'](_0x49be48(0x224)+_0x566369[_0x49be48(0x239)]+'\x22:\x20'+_0x566369[_0x49be48(0x1ff)]));}for(const _0x39216f of _0x239723[_0x49be48(0x1ce)]){_0x39216f[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a['red']('\x20\x20Integration\x20\x22'+_0x39216f[_0x49be48(0x239)]+_0x49be48(0x1d0)+_0x39216f[_0x49be48(0x1ff)]));}return 0x1;}console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x1e0)]('\x0a✔\x20Pushed\x20'+(_0xb733c0+_0x3de0cc)+_0x49be48(0x1fd)+_0x239723['projectName']+'\x27'));const _0x59a191=getLLMProjectUrl(_0x314213,_0x239723[_0x49be48(0x1d1)]);return console[_0x49be48(0x1ef)](_0x49be48(0x1b0)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x59a191)),0x0;}}
|
|
1
|
+
const a4_0x5d729c=a4_0x3019;(function(_0xd1410,_0x367000){const _0x5d8a79=a4_0x3019,_0xceaefb=_0xd1410();while(!![]){try{const _0x477aca=parseInt(_0x5d8a79(0xb7))/0x1*(parseInt(_0x5d8a79(0x6b))/0x2)+parseInt(_0x5d8a79(0x9b))/0x3*(parseInt(_0x5d8a79(0xc0))/0x4)+parseInt(_0x5d8a79(0xec))/0x5+-parseInt(_0x5d8a79(0xb2))/0x6+-parseInt(_0x5d8a79(0xa0))/0x7*(parseInt(_0x5d8a79(0xf6))/0x8)+parseInt(_0x5d8a79(0x10d))/0x9+-parseInt(_0x5d8a79(0xd3))/0xa;if(_0x477aca===_0x367000)break;else _0xceaefb['push'](_0xceaefb['shift']());}catch(_0x38cfb0){_0xceaefb['push'](_0xceaefb['shift']());}}}(a4_0x2df7,0x4a747));import a4_0x42444e from'chalk';import a4_0x166ea5 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_0x2df7(){const _0x58c9b=['context','arg-dir','Project:\x20','repeat','\x0aPush\x20summary\x20for\x20\x27','\x20changed','Cancelled','gray','Using\x20project:\x20','prompts','integrations','619985VUuSZo','red','\x20errors','<new-name>','INVALID_ARGUMENT','\x0aChanges\x20to\x20agent\x20\x27','Pushing\x20agent\x20from\x20\x22','outputDir','Project\x20cloned\x20with\x20errors','llm','8lcDmcp','unchanged','\x20\x20tdx\x20agent\x20pull\x20','created','llm_project','Would\x20pull\x20agent:\x20','\x20new','\x20\x20Agents:\x20','errors','session','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','yellow','newProjectId','updated','agents','\x22:\x20','Using\x20context\x20project:\x20','\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','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aPull\x20summary\x20for\x20\x27','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Text\x20Knowledge\x20Base\x20\x22','dryRun','5024367grbJPv','cloneProject','Using\x20local\x20project:\x20','Failed\x20to\x20push\x20agent:\x20','hasChanges','\x0aErrors\x20found:','join','\x20resources?','\x22\x20to\x20new\x20project\x20\x22','knowledgeBases','\x0a✔\x20Pushed\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','utf-8','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','force','\x20\x20Experimental\x20Artifacts:\x20','pullProject','\x20\x20Experimental\x20Artifact\x20\x22','diff','Would\x20clone:','log','1041706ATnzND','\x0aChanges\x20to\x20prompt\x20\x27','textKnowledgeBases','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','pushProject','\x20files\x20to\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20unchanged','experimentalArtifacts','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','site','projectName','\x20\x20Text\x20Knowledge\x20Bases:\x20','description','action','\x20--name\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','agent','Would\x20push\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','Status:\x20','\x20total','error','\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','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20successfully','✔\x20Context\x20set:\x20','Source:\x20','-\x20nothing\x20pushed','\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)','source','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','new','\x20--profile\x20','\x20\x20Prompts:\x20','\x22...','\x20files?','\x20\x20Integration\x20\x22','Summary:','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','sourceProjectName','\x20=\x20','cwd','812277UilbYx','MISSING_ARGUMENT','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x20\x20Agent\x20\x22','agent:push','1195719dSparp','projectId','yes','Writing\x20files...','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x22\x20from\x20project\x20\x22','isNew','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','name','New\x20project\x20ID:\x20','Chat:\x20','Agent:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','agent.yml','reason','\x20\x20Integrations:\x20','dirname','2224020ffPIUC','Output\x20path:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Pushing\x20to\x20project...','push','1vheUPh','\x0aError:','counts','\x20\x20Knowledge\x20Bases:\x20','\x0aWrite\x20','\x20created','pullAgent','Agent\x20','\x20|\x20','8tflHTX','\x20\x20Target:\x20','green','total','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','agentId','\x0a✔\x20Pulled\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','execute','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','-\x20no\x20files\x20written','outputPath','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','No\x20tdx.json\x20found\x20in\x20','dim','agent:clone','\x0aPush\x20','message','cyan','8981770hCzDVd','parse','\x20resources\x20to\x20\x27','Errors:','Using\x20current\x20project:\x20','llmProject','experimentalKnowledgeBases','found','Agent\x20pulled\x20successfully','New\x20project\x20name\x20is\x20required','cwd-config','\x20\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','agentName'];a4_0x2df7=function(){return _0x58c9b;};return a4_0x2df7();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2a224d){const _0x409eeb=a4_0x3019,_0x118a73=[];if(_0x2a224d[_0x409eeb(0xc3)]!==undefined)_0x118a73[_0x409eeb(0xb6)](_0x2a224d['total']+_0x409eeb(0x83));if(_0x2a224d[_0x409eeb(0x8e)]!==undefined&&_0x2a224d['new']>0x0)_0x118a73[_0x409eeb(0xb6)](a4_0x42444e[_0x409eeb(0xc2)](_0x2a224d['new']+_0x409eeb(0xfc)));if(_0x2a224d[_0x409eeb(0xf9)]!==undefined&&_0x2a224d[_0x409eeb(0xf9)]>0x0)_0x118a73[_0x409eeb(0xb6)](a4_0x42444e[_0x409eeb(0xc2)](_0x2a224d[_0x409eeb(0xf9)]+_0x409eeb(0xbc)));if(_0x2a224d['updated']!==undefined&&_0x2a224d[_0x409eeb(0x103)]>0x0)_0x118a73['push'](a4_0x42444e[_0x409eeb(0x101)](_0x2a224d[_0x409eeb(0x103)]+'\x20updated'));if(_0x2a224d['unchanged']!==undefined&&_0x2a224d['unchanged']>0x0)_0x118a73[_0x409eeb(0xb6)](a4_0x42444e['gray'](_0x2a224d['unchanged']+_0x409eeb(0x74)));if(_0x2a224d[_0x409eeb(0xfe)]!==undefined&&_0x2a224d['errors']>0x0)_0x118a73['push'](a4_0x42444e[_0x409eeb(0xed)](_0x2a224d['errors']+_0x409eeb(0xee)));return _0x118a73[_0x409eeb(0x113)](',\x20');}function displayDiffs(_0x383771,_0x20c7b2,_0x3ad00e,_0x3383b6,_0x183a03,_0x1c1208,_0x2ce982){const _0x5cd924=a4_0x3019;for(const _0xd5c661 of _0x383771){if(_0xd5c661[_0x5cd924(0x68)]){const _0x3ebab7=_0xd5c661[_0x5cd924(0xe0)]||_0xd5c661[_0x5cd924(0xa9)];console[_0x5cd924(0x6a)](_0x5cd924(0xf1)+_0x3ebab7+'\x27:'),console[_0x5cd924(0x6a)]('─'['repeat'](0x3c)),console['log'](_0xd5c661['diff']),console[_0x5cd924(0x6a)]('─'[_0x5cd924(0xe4)](0x3c));}}for(const _0x37bf1a of _0x20c7b2){_0x37bf1a[_0x5cd924(0x68)]&&(console[_0x5cd924(0x6a)](_0x5cd924(0xdf)+_0x37bf1a['name']+'\x27:'),console[_0x5cd924(0x6a)]('─'['repeat'](0x3c)),console[_0x5cd924(0x6a)](_0x37bf1a['diff']),console[_0x5cd924(0x6a)]('─'['repeat'](0x3c)));}for(const _0x575594 of _0x3ad00e){_0x575594[_0x5cd924(0x68)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x575594[_0x5cd924(0xa9)]+'\x27:'),console['log']('─'[_0x5cd924(0xe4)](0x3c)),console[_0x5cd924(0x6a)](_0x575594[_0x5cd924(0x68)]),console[_0x5cd924(0x6a)]('─'[_0x5cd924(0xe4)](0x3c)));}for(const _0x4f039e of _0x3383b6){_0x4f039e[_0x5cd924(0x68)]&&(console[_0x5cd924(0x6a)](_0x5cd924(0x6c)+_0x4f039e[_0x5cd924(0xa9)]+'\x27:'),console[_0x5cd924(0x6a)]('─'[_0x5cd924(0xe4)](0x3c)),console[_0x5cd924(0x6a)](_0x4f039e[_0x5cd924(0x68)]),console[_0x5cd924(0x6a)]('─'['repeat'](0x3c)));}for(const _0x4b970c of _0x183a03){_0x4b970c[_0x5cd924(0x68)]&&(console[_0x5cd924(0x6a)](_0x5cd924(0x70)+_0x4b970c['name']+'\x27:'),console[_0x5cd924(0x6a)]('─'['repeat'](0x3c)),console[_0x5cd924(0x6a)](_0x4b970c[_0x5cd924(0x68)]),console[_0x5cd924(0x6a)]('─'[_0x5cd924(0xe4)](0x3c)));}for(const _0x3ad694 of _0x1c1208){_0x3ad694[_0x5cd924(0x68)]&&(console[_0x5cd924(0x6a)](_0x5cd924(0xad)+_0x3ad694[_0x5cd924(0xa9)]+'\x27:'),console['log']('─'[_0x5cd924(0xe4)](0x3c)),console[_0x5cd924(0x6a)](_0x3ad694[_0x5cd924(0x68)]),console[_0x5cd924(0x6a)]('─'['repeat'](0x3c)));}for(const _0x9beae of _0x2ce982){_0x9beae[_0x5cd924(0x68)]&&(console['log'](_0x5cd924(0xa4)+_0x9beae[_0x5cd924(0xa9)]+'\x27:'),console[_0x5cd924(0x6a)]('─'[_0x5cd924(0xe4)](0x3c)),console[_0x5cd924(0x6a)](_0x9beae[_0x5cd924(0x68)]),console[_0x5cd924(0x6a)]('─'[_0x5cd924(0xe4)](0x3c)));}}function a4_0x3019(_0x26d776,_0x1b5b09){_0x26d776=_0x26d776-0x64;const _0x2df7c8=a4_0x2df7();let _0x3019cc=_0x2df7c8[_0x26d776];return _0x3019cc;}export class AgentPullCommand extends BaseCommand{[a4_0x5d729c(0xa9)]='agent:pull';['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x5d729c(0xc8)](_0x34d568){const _0x64bb28=a4_0x5d729c,{options:_0x5ae049,args:_0x3671a9,tdx:_0x37d18e}=_0x34d568,_0x48d09f=_0x3671a9[0x0],_0x245be9=_0x3671a9[0x1],_0x3fa0be=_0x5ae049['output'],_0x4e7d3f=_0x5ae049[_0x64bb28(0x10c)],_0x4869cf=_0x5ae049[_0x64bb28(0x64)],_0x148bb9=_0x5ae049[_0x64bb28(0xa2)],_0x55d3cd=_0x5ae049[_0x64bb28(0xd8)],_0x1158d0=_0x5ae049[_0x64bb28(0x7f)];let _0x5d9ab4;if(_0x48d09f){const _0x1dfa67=a4_0x166ea5['join'](_0x48d09f,'tdx.json');if(existsSync(_0x1dfa67))try{const _0x3292a6=JSON[_0x64bb28(0xd4)](readFileSync(_0x1dfa67,_0x64bb28(0x119)));_0x3292a6[_0x64bb28(0xfa)]&&(_0x5d9ab4={'llm_project':_0x3292a6[_0x64bb28(0xfa)]});}catch{}}const _0x4144df=findAgentConfigPath(process[_0x64bb28(0x9a)]());let _0x411072;if(_0x4144df)try{const _0x234fcf=JSON[_0x64bb28(0xd4)](readFileSync(_0x4144df,'utf-8'));_0x234fcf[_0x64bb28(0xfa)]&&(_0x411072={'llm_project':_0x234fcf[_0x64bb28(0xfa)]});}catch{}const _0x4951f2=resolveAgentPullArgs({'arg':_0x48d09f,'agentNameArg':_0x245be9,'agentFlag':_0x1158d0,'contextProject':_0x55d3cd,'argDirConfig':_0x5d9ab4,'cwdConfigPath':_0x4144df||undefined,'cwdConfig':_0x411072}),{projectNameOrId:_0x3bb041,targetAgentName:_0x35f482,existingOutputDir:_0x313625,source:_0x190e9f}=_0x4951f2;if(_0x190e9f===_0x64bb28(0xe2))console[_0x64bb28(0x6a)](a4_0x42444e[_0x64bb28(0xce)]('Using\x20project\x20from\x20'+a4_0x166ea5[_0x64bb28(0x113)](_0x48d09f,'tdx.json')+':\x20'+_0x3bb041));else{if(_0x190e9f===_0x64bb28(0xdd))console['log'](a4_0x42444e[_0x64bb28(0xce)](_0x64bb28(0xe9)+_0x3bb041));else _0x190e9f===_0x64bb28(0xe1)&&console[_0x64bb28(0x6a)](a4_0x42444e[_0x64bb28(0xce)]('Using\x20project\x20from\x20context:\x20'+_0x3bb041));}if(!_0x3bb041)return _0x1158d0?(console['log'](a4_0x42444e[_0x64bb28(0x101)](_0x64bb28(0x7e))),console[_0x64bb28(0x6a)](_0x64bb28(0x95)),console[_0x64bb28(0x6a)](_0x64bb28(0x86))):(console['log'](a4_0x42444e['yellow'](_0x64bb28(0x118))),console[_0x64bb28(0x6a)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x64bb28(0x6a)]('\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[_0x64bb28(0x6a)](_0x64bb28(0x85)),console[_0x64bb28(0x6a)](_0x64bb28(0x9d)),console[_0x64bb28(0x6a)](_0x64bb28(0x107))),0x1;if(_0x35f482){const {data:_0x288f41}=await withSpinner('Pulling\x20agent\x20\x22'+_0x35f482+_0x64bb28(0xa6)+_0x3bb041+'\x22...',()=>_0x37d18e[_0x64bb28(0xf5)][_0x64bb28(0xbd)](_0x3bb041,_0x35f482,_0x3fa0be,{'dryRun':_0x4e7d3f,'force':_0x4869cf}));if(_0x4e7d3f)return console[_0x64bb28(0x6a)](a4_0x42444e[_0x64bb28(0x101)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x64bb28(0x6a)](_0x64bb28(0xfb)+_0x288f41['agentName']),console[_0x64bb28(0x6a)](_0x64bb28(0xb3)+_0x288f41[_0x64bb28(0xcb)]),_0x288f41[_0x64bb28(0x68)]&&(console['log']('\x0aChanges:'),console['log']('─'[_0x64bb28(0xe4)](0x3c)),console[_0x64bb28(0x6a)](_0x288f41[_0x64bb28(0x68)]),console[_0x64bb28(0x6a)]('─'[_0x64bb28(0xe4)](0x3c))),0x0;return console[_0x64bb28(0x6a)](a4_0x42444e['green'](_0x64bb28(0xdb))),console[_0x64bb28(0x6a)](_0x64bb28(0xac)+_0x288f41[_0x64bb28(0xe0)]),console[_0x64bb28(0x6a)]('Output:\x20'+_0x288f41[_0x64bb28(0xcb)]),console['log'](_0x64bb28(0x82)+(_0x288f41[_0x64bb28(0xa7)]?a4_0x42444e[_0x64bb28(0xc2)](_0x64bb28(0x8e)):_0x288f41[_0x64bb28(0x111)]?a4_0x42444e[_0x64bb28(0x101)]('updated'):a4_0x42444e[_0x64bb28(0xe8)](_0x64bb28(0xf7)))),0x0;}const _0x2f00a7=_0x313625||_0x3fa0be,{data:_0x3e58b2}=await withSpinner('Analyzing\x20project\x20\x22'+_0x3bb041+_0x64bb28(0x91),()=>_0x37d18e[_0x64bb28(0xf5)][_0x64bb28(0x66)](_0x3bb041,_0x2f00a7,{'dryRun':!![]})),_0x43c86d=_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x104)][_0x64bb28(0x8e)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x116)][_0x64bb28(0x8e)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x6d)]['new']+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0xea)][_0x64bb28(0x8e)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0xeb)][_0x64bb28(0x8e)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0xd9)]['new']+_0x3e58b2['counts']['experimentalArtifacts'][_0x64bb28(0x8e)],_0x291714=_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x104)][_0x64bb28(0x103)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x116)][_0x64bb28(0x103)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x6d)]['updated']+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0xea)][_0x64bb28(0x103)]+_0x3e58b2['counts'][_0x64bb28(0xeb)][_0x64bb28(0x103)]+_0x3e58b2['counts'][_0x64bb28(0xd9)][_0x64bb28(0x103)]+_0x3e58b2[_0x64bb28(0xb9)]['experimentalArtifacts'][_0x64bb28(0x103)],_0x444698=_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x104)][_0x64bb28(0xf7)]+_0x3e58b2['counts']['knowledgeBases']['unchanged']+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x6d)][_0x64bb28(0xf7)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0xea)][_0x64bb28(0xf7)]+_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0xeb)][_0x64bb28(0xf7)]+_0x3e58b2['counts'][_0x64bb28(0xd9)][_0x64bb28(0xf7)]+_0x3e58b2[_0x64bb28(0xb9)]['experimentalArtifacts'][_0x64bb28(0xf7)];console['log'](_0x64bb28(0x109)+_0x3e58b2[_0x64bb28(0x79)]+'\x27:'),console['log']('\x20\x20'+a4_0x42444e[_0x64bb28(0xc2)]('+\x20'+_0x43c86d+_0x64bb28(0xfc))+_0x64bb28(0xbf)+a4_0x42444e[_0x64bb28(0x101)]('~\x20'+_0x291714+'\x20changed')+'\x20|\x20'+a4_0x42444e['dim']('=\x20'+_0x444698+_0x64bb28(0x74))),console[_0x64bb28(0x6a)](_0x64bb28(0xfd)+formatCountSummary(_0x3e58b2[_0x64bb28(0xb9)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x116)])),console[_0x64bb28(0x6a)](_0x64bb28(0x7a)+formatCountSummary(_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x6d)])),console[_0x64bb28(0x6a)](_0x64bb28(0x90)+formatCountSummary(_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0xea)])),console['log'](_0x64bb28(0xb0)+formatCountSummary(_0x3e58b2['counts'][_0x64bb28(0xeb)]));const _0x53a6ef=_0x3e58b2[_0x64bb28(0xb9)]['experimentalKnowledgeBases'][_0x64bb28(0xc3)]>0x0||_0x3e58b2[_0x64bb28(0xb9)][_0x64bb28(0x75)]['total']>0x0;_0x53a6ef&&(console[_0x64bb28(0x6a)](_0x64bb28(0x97)+formatCountSummary(_0x3e58b2['counts'][_0x64bb28(0xd9)])),console[_0x64bb28(0x6a)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3e58b2['counts'][_0x64bb28(0x75)])));console[_0x64bb28(0x6a)](_0x64bb28(0xc1)+a4_0x42444e[_0x64bb28(0xd2)](_0x3e58b2['outputDir'])),displayDiffs(_0x3e58b2[_0x64bb28(0x104)],_0x3e58b2['knowledgeBases'],_0x3e58b2[_0x64bb28(0x6d)],_0x3e58b2[_0x64bb28(0xea)],_0x3e58b2['integrations'],_0x3e58b2[_0x64bb28(0xd9)],_0x3e58b2[_0x64bb28(0x75)]);if(_0x4e7d3f)return console['log'](a4_0x42444e[_0x64bb28(0x101)](_0x64bb28(0xa8))),0x0;if(_0x43c86d===0x0&&_0x291714===0x0)return console[_0x64bb28(0x6a)](a4_0x42444e[_0x64bb28(0xc2)](_0x64bb28(0x108))),saveSessionContext({'llm_project':_0x3e58b2[_0x64bb28(0x79)]},_0x5ae049[_0x64bb28(0xff)]),console['log'](a4_0x42444e['green']('✔\x20Context\x20set:\x20'+a4_0x42444e[_0x64bb28(0xce)](_0x64bb28(0xfa))+_0x64bb28(0x99)+a4_0x42444e[_0x64bb28(0xd2)](_0x3e58b2[_0x64bb28(0x79)]))),0x0;if(!_0x148bb9&&!_0x4869cf){if(!isInteractive())return console['error'](a4_0x42444e['red'](_0x64bb28(0xb8)),_0x64bb28(0x11a)),console[_0x64bb28(0x84)](a4_0x42444e[_0x64bb28(0xce)](_0x64bb28(0x6e))),0x1;const _0x1f15fb=await confirmKey(_0x64bb28(0xbb)+(_0x43c86d+_0x291714)+_0x64bb28(0x92));if(!_0x1f15fb)return console[_0x64bb28(0x6a)](a4_0x42444e[_0x64bb28(0x101)](_0x64bb28(0xe7)),_0x64bb28(0xca)),0x1;}const {data:_0x8fd36}=await withSpinner(_0x64bb28(0xa3),()=>_0x37d18e['llm'][_0x64bb28(0x66)](_0x3bb041,_0x2f00a7,{'force':_0x4869cf}));return console[_0x64bb28(0x6a)](a4_0x42444e[_0x64bb28(0xc2)](_0x64bb28(0xc6)+(_0x43c86d+_0x291714)+_0x64bb28(0x72)+_0x8fd36[_0x64bb28(0xf3)])),saveSessionContext({'llm_project':_0x8fd36[_0x64bb28(0x79)]},_0x5ae049[_0x64bb28(0xff)]),console[_0x64bb28(0x6a)](a4_0x42444e[_0x64bb28(0xc2)](_0x64bb28(0x88)+a4_0x42444e[_0x64bb28(0xce)](_0x64bb28(0xfa))+_0x64bb28(0x99)+a4_0x42444e['cyan'](_0x8fd36['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5d729c(0xa9)]=a4_0x5d729c(0xcf);[a4_0x5d729c(0x7b)]=a4_0x5d729c(0xc9);async[a4_0x5d729c(0xc8)](_0x5c72b2){const _0x7e5a5=a4_0x5d729c,{options:_0x29f2a8,args:_0x5958a9,tdx:_0x5b7ad6}=_0x5c72b2,_0x4f95b9=_0x5958a9[0x0],_0x109a65=_0x29f2a8[_0x7e5a5(0xa9)],_0x10aa54=_0x29f2a8[_0x7e5a5(0x10c)],_0x2c61d3=_0x29f2a8[_0x7e5a5(0xa2)],_0x8f22e1=_0x29f2a8['site'],_0x2f3ece=_0x29f2a8['llmProject'];let _0x532201;const _0x48e07c=findAgentConfigPath(process[_0x7e5a5(0x9a)]());if(_0x4f95b9){const _0x3dddcb=a4_0x166ea5[_0x7e5a5(0x113)](_0x4f95b9,'tdx.json');existsSync(_0x3dddcb)?(_0x532201=_0x4f95b9,console[_0x7e5a5(0x6a)](a4_0x42444e['dim'](_0x7e5a5(0x10f)+_0x4f95b9))):_0x532201=_0x4f95b9;}else{if(_0x48e07c)_0x532201=a4_0x166ea5[_0x7e5a5(0xb1)](_0x48e07c),console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xce)](_0x7e5a5(0xd7)+_0x532201));else{if(_0x2f3ece){const _0x5e5c0d=sanitizeForFilesystem(_0x2f3ece);let _0x2d75a=_0x5e5c0d,_0x579b93=a4_0x166ea5[_0x7e5a5(0x113)](process[_0x7e5a5(0x9a)](),_0x7e5a5(0x104),_0x5e5c0d,'tdx.json');if(!existsSync(_0x579b93)){const _0x166762=normalizeName(_0x2f3ece),_0x41fd45=a4_0x166ea5[_0x7e5a5(0x113)](process[_0x7e5a5(0x9a)](),_0x7e5a5(0x104),_0x166762,'tdx.json');existsSync(_0x41fd45)&&(_0x2d75a=_0x166762,_0x579b93=_0x41fd45);}if(existsSync(_0x579b93))_0x532201=a4_0x166ea5[_0x7e5a5(0xb1)](_0x579b93),console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xce)](_0x7e5a5(0x10f)+_0x532201));else{const _0x48328d=_0x29f2a8['profile'];if(_0x48328d)throw new SDKError(ErrorCode[_0x7e5a5(0xf0)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2f3ece+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x7e5a5(0x96)+_0x7e5a5(0x76)+(_0x7e5a5(0xf8)+_0x2f3ece+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2d75a+_0x7e5a5(0x7d)+(_0x109a65||_0x7e5a5(0xef))+_0x7e5a5(0x8f)+_0x48328d)});_0x532201=_0x2f3ece,console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xce)](_0x7e5a5(0x106)+_0x2f3ece));}}}}if(!_0x532201)return console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0x101)](_0x7e5a5(0x8d))),console['log'](_0x7e5a5(0xa5)),console[_0x7e5a5(0x6a)](_0x7e5a5(0x100)),console[_0x7e5a5(0x6a)](_0x7e5a5(0x8b)),console[_0x7e5a5(0x6a)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x109a65)throw new SDKError(ErrorCode[_0x7e5a5(0x9c)],_0x7e5a5(0xdc),undefined,{'helpText':_0x7e5a5(0xb4)});if(!_0x2c61d3&&!_0x10aa54){if(!isInteractive())return console[_0x7e5a5(0x84)](a4_0x42444e[_0x7e5a5(0xed)](_0x7e5a5(0xb8)),_0x7e5a5(0x11a)),console[_0x7e5a5(0x84)](a4_0x42444e[_0x7e5a5(0xce)](_0x7e5a5(0x6e))),0x1;const _0xcf02df=await confirmKey('Clone\x20\x22'+_0x532201+_0x7e5a5(0x115)+_0x109a65+'\x22?');if(!_0xcf02df)return console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0x101)](_0x7e5a5(0xe7))),0x1;}const {data:_0x11fced}=await withSpinner('Cloning\x20\x22'+_0x532201+'\x22\x20to\x20\x22'+_0x109a65+_0x7e5a5(0x91),()=>_0x5b7ad6[_0x7e5a5(0xf5)][_0x7e5a5(0x10e)](_0x532201,_0x109a65,{'dryRun':_0x10aa54}));if(_0x10aa54){console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0x101)](_0x7e5a5(0x10a))),console[_0x7e5a5(0x6a)](_0x7e5a5(0x89)+_0x11fced[_0x7e5a5(0x98)]),console['log']('New\x20project:\x20'+_0x109a65),console[_0x7e5a5(0x6a)](_0x7e5a5(0x69)),console[_0x7e5a5(0x6a)](_0x7e5a5(0xfd)+_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x104)][_0x7e5a5(0xf9)]),console[_0x7e5a5(0x6a)](_0x7e5a5(0xba)+_0x11fced['counts'][_0x7e5a5(0x116)][_0x7e5a5(0xf9)]),console[_0x7e5a5(0x6a)](_0x7e5a5(0x90)+_0x11fced[_0x7e5a5(0xb9)]['prompts'][_0x7e5a5(0xf9)]);const _0x1dd930=_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0xd9)][_0x7e5a5(0xf9)]>0x0||_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x75)][_0x7e5a5(0xf9)]>0x0;return _0x1dd930&&(console[_0x7e5a5(0x6a)](_0x7e5a5(0x97)+_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0xd9)][_0x7e5a5(0xf9)]),console[_0x7e5a5(0x6a)](_0x7e5a5(0x65)+_0x11fced['counts'][_0x7e5a5(0x75)]['created'])),0x0;}const _0x1e4b70=_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x104)]['errors']>0x0||_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x116)][_0x7e5a5(0xfe)]>0x0||_0x11fced[_0x7e5a5(0xb9)]['prompts'][_0x7e5a5(0xfe)]>0x0||_0x11fced[_0x7e5a5(0xb9)]['experimentalKnowledgeBases']['errors']>0x0||_0x11fced[_0x7e5a5(0xb9)]['experimentalArtifacts'][_0x7e5a5(0xfe)]>0x0;_0x1e4b70?console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0x101)](_0x7e5a5(0xf4))):console['log'](a4_0x42444e['green']('Project\x20cloned\x20successfully'));console['log'](_0x7e5a5(0x89)+_0x11fced['sourceProjectName']),console[_0x7e5a5(0x6a)]('New\x20project:\x20'+_0x11fced['newProjectName']),console[_0x7e5a5(0x6a)](_0x7e5a5(0xaa)+_0x11fced[_0x7e5a5(0x102)]),console[_0x7e5a5(0x6a)](),console['log'](_0x7e5a5(0x94)),console[_0x7e5a5(0x6a)]('\x20\x20Agents:\x20'+formatCountSummary(_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x104)])),console[_0x7e5a5(0x6a)](_0x7e5a5(0xba)+formatCountSummary(_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x116)])),console[_0x7e5a5(0x6a)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x11fced['counts'][_0x7e5a5(0xea)])),console[_0x7e5a5(0x6a)](_0x7e5a5(0xb0)+formatCountSummary(_0x11fced['counts'][_0x7e5a5(0xeb)]));const _0x5c012c=_0x11fced[_0x7e5a5(0xb9)]['experimentalKnowledgeBases'][_0x7e5a5(0xf9)]>0x0||_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0xd9)][_0x7e5a5(0x103)]>0x0||_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0xd9)][_0x7e5a5(0xf7)]>0x0||_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x75)][_0x7e5a5(0xf9)]>0x0||_0x11fced['counts'][_0x7e5a5(0x75)][_0x7e5a5(0x103)]>0x0||_0x11fced[_0x7e5a5(0xb9)]['experimentalArtifacts'][_0x7e5a5(0xf7)]>0x0;_0x5c012c&&(console['log'](_0x7e5a5(0x97)+formatCountSummary(_0x11fced['counts'][_0x7e5a5(0xd9)])),console[_0x7e5a5(0x6a)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x11fced[_0x7e5a5(0xb9)][_0x7e5a5(0x75)])));if(_0x1e4b70){console[_0x7e5a5(0x6a)](),console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xed)](_0x7e5a5(0xd6)));for(const _0x2d94f8 of _0x11fced['agents']){_0x2d94f8[_0x7e5a5(0x7c)]==='error'&&console[_0x7e5a5(0x6a)](a4_0x42444e['red'](_0x7e5a5(0x9e)+_0x2d94f8[_0x7e5a5(0xe0)]+'\x22:\x20'+_0x2d94f8['error']));}for(const _0x35db42 of _0x11fced['knowledgeBases']){_0x35db42['action']===_0x7e5a5(0x84)&&console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xed)](_0x7e5a5(0xde)+_0x35db42['name']+_0x7e5a5(0x105)+_0x35db42['error']));}for(const _0x1b5aea of _0x11fced['prompts']){_0x1b5aea[_0x7e5a5(0x7c)]==='error'&&console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xed)]('\x20\x20Prompt\x20\x22'+_0x1b5aea[_0x7e5a5(0xa9)]+_0x7e5a5(0x105)+_0x1b5aea[_0x7e5a5(0x84)]));}for(const _0x101813 of _0x11fced['integrations']){_0x101813[_0x7e5a5(0x7c)]==='error'&&console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xed)](_0x7e5a5(0x93)+_0x101813[_0x7e5a5(0xa9)]+_0x7e5a5(0x105)+_0x101813['error']));}for(const _0x3e2dec of _0x11fced[_0x7e5a5(0xd9)]){_0x3e2dec[_0x7e5a5(0x7c)]===_0x7e5a5(0x84)&&console['log'](a4_0x42444e['red'](_0x7e5a5(0x73)+_0x3e2dec[_0x7e5a5(0xa9)]+_0x7e5a5(0x105)+_0x3e2dec['error']));}for(const _0x455ec5 of _0x11fced['experimentalArtifacts']){_0x455ec5[_0x7e5a5(0x7c)]===_0x7e5a5(0x84)&&console[_0x7e5a5(0x6a)](a4_0x42444e[_0x7e5a5(0xed)](_0x7e5a5(0x67)+_0x455ec5[_0x7e5a5(0xa9)]+_0x7e5a5(0x105)+_0x455ec5[_0x7e5a5(0x84)]));}return 0x1;}console['log']();const _0x107618=getLLMProjectUrl(_0x8f22e1,_0x11fced['newProjectId']);return console[_0x7e5a5(0x6a)](_0x7e5a5(0xe3)+a4_0x42444e['cyan'](_0x107618)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x5d729c(0x9f);['description']=a4_0x5d729c(0xc4);async[a4_0x5d729c(0xc8)](_0x571c14){const _0x375f01=a4_0x5d729c,{options:_0x5c9ee0,args:_0x580a47,tdx:_0x4f1534}=_0x571c14;let _0x1134f9=_0x580a47[0x0]||process[_0x375f01(0x9a)]();const _0x3a5ca1=_0x5c9ee0[_0x375f01(0x10c)],_0x17082d=_0x5c9ee0[_0x375f01(0x64)],_0x3e3d15=_0x5c9ee0[_0x375f01(0xa2)],_0x28ac27=_0x5c9ee0[_0x375f01(0x78)],_0x3b200c=a4_0x166ea5[_0x375f01(0x113)](_0x1134f9,_0x375f01(0xae)),_0x61302=existsSync(_0x3b200c);if(_0x61302){const {data:_0x386108}=await withSpinner(_0x375f01(0xf2)+_0x1134f9+'\x22...',()=>_0x4f1534['llm']['pushAgent'](_0x1134f9,{'dryRun':_0x3a5ca1,'force':_0x17082d}));if(_0x3a5ca1)return console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0x101)](_0x375f01(0x10a))),console[_0x375f01(0x6a)](_0x375f01(0x80)+_0x386108[_0x375f01(0xe0)]),0x0;if(_0x386108[_0x375f01(0x7c)]===_0x375f01(0x84))return console['log'](a4_0x42444e[_0x375f01(0xed)](_0x375f01(0x110)+_0x386108[_0x375f01(0x84)])),0x1;console[_0x375f01(0x6a)](a4_0x42444e['green'](_0x375f01(0xbe)+_0x386108[_0x375f01(0x7c)]+_0x375f01(0x87))),console['log'](_0x375f01(0xac)+_0x386108['agentName']);if(_0x386108[_0x375f01(0xc5)]&&_0x386108[_0x375f01(0xa1)]){const _0x1051c7=getLLMAgentChatUrl(_0x28ac27,_0x386108[_0x375f01(0xa1)],_0x386108[_0x375f01(0xc5)]);console['log'](_0x375f01(0xab)+a4_0x42444e[_0x375f01(0xd2)](_0x1051c7));}return 0x0;}const _0x1bdb1c=_0x5c9ee0[_0x375f01(0xd8)],_0xf8ce91=resolveProjectFromContext(_0x1134f9,_0x1bdb1c);if(_0xf8ce91[_0x375f01(0xda)])_0x1134f9=_0xf8ce91['projectDir'],_0xf8ce91[_0x375f01(0x8c)]===_0x375f01(0xe1)&&console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xce)](_0x375f01(0xe9)+_0x1134f9));else{let _0x172bce=_0x375f01(0xc7);_0xf8ce91[_0x375f01(0xaf)]==='no_local_folder'&&(_0x172bce=_0xf8ce91[_0x375f01(0xd1)]+_0x375f01(0x77)+_0xf8ce91[_0x375f01(0xd8)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x375f01(0xf0)],_0xf8ce91[_0x375f01(0xaf)]==='no_context'?_0xf8ce91[_0x375f01(0xd1)]:_0x375f01(0xcd)+_0x1134f9,undefined,{'helpText':_0x172bce});}const {data:_0x57d3a3}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x4f1534[_0x375f01(0xf5)][_0x375f01(0x71)](_0x1134f9,{'dryRun':!![]})),_0xf152a1=_0x57d3a3['counts']['agents'][_0x375f01(0xfe)]>0x0;if(_0xf152a1){console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xed)](_0x375f01(0x112)));for(const _0x4cc75b of _0x57d3a3[_0x375f01(0x104)]){_0x4cc75b[_0x375f01(0x7c)]===_0x375f01(0x84)&&console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xed)](_0x375f01(0x9e)+_0x4cc75b['agentName']+'\x22:\x20'+_0x4cc75b[_0x375f01(0x84)]));}return 0x1;}const _0x8416d5=_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x104)][_0x375f01(0xf9)]+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x116)]['created']+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x6d)][_0x375f01(0xf9)]+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0xea)][_0x375f01(0xf9)]+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0xeb)][_0x375f01(0xf9)]+_0x57d3a3['counts']['experimentalKnowledgeBases'][_0x375f01(0xf9)]+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x75)][_0x375f01(0xf9)],_0x1cefc7=_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x104)][_0x375f01(0x103)]+_0x57d3a3[_0x375f01(0xb9)]['knowledgeBases']['updated']+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x6d)][_0x375f01(0x103)]+_0x57d3a3[_0x375f01(0xb9)]['prompts']['updated']+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0xeb)][_0x375f01(0x103)]+_0x57d3a3[_0x375f01(0xb9)]['experimentalKnowledgeBases'][_0x375f01(0x103)]+_0x57d3a3['counts']['experimentalArtifacts'][_0x375f01(0x103)],_0x24a7d6=_0x57d3a3['counts'][_0x375f01(0x104)][_0x375f01(0xf7)]+_0x57d3a3[_0x375f01(0xb9)]['knowledgeBases'][_0x375f01(0xf7)]+_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x6d)][_0x375f01(0xf7)]+_0x57d3a3['counts'][_0x375f01(0xea)][_0x375f01(0xf7)]+_0x57d3a3[_0x375f01(0xb9)]['integrations'][_0x375f01(0xf7)]+_0x57d3a3[_0x375f01(0xb9)]['experimentalKnowledgeBases'][_0x375f01(0xf7)]+_0x57d3a3['counts'][_0x375f01(0x75)]['unchanged'];console[_0x375f01(0x6a)](_0x375f01(0xe5)+_0x57d3a3['projectName']+'\x27:'),console[_0x375f01(0x6a)]('\x20\x20'+a4_0x42444e[_0x375f01(0xc2)]('+\x20'+_0x8416d5+_0x375f01(0xfc))+'\x20|\x20'+a4_0x42444e[_0x375f01(0x101)]('~\x20'+_0x1cefc7+_0x375f01(0xe6))+'\x20|\x20'+a4_0x42444e[_0x375f01(0xce)]('=\x20'+_0x24a7d6+_0x375f01(0x74))),console[_0x375f01(0x6a)]('\x20\x20Agents:\x20'+formatCountSummary(_0x57d3a3[_0x375f01(0xb9)]['agents'])),console[_0x375f01(0x6a)](_0x375f01(0xba)+formatCountSummary(_0x57d3a3[_0x375f01(0xb9)]['knowledgeBases'])),console[_0x375f01(0x6a)](_0x375f01(0x7a)+formatCountSummary(_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x6d)])),console[_0x375f01(0x6a)](_0x375f01(0x90)+formatCountSummary(_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0xea)])),console['log'](_0x375f01(0xb0)+formatCountSummary(_0x57d3a3['counts']['integrations']));const _0x59c4a2=_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0xd9)][_0x375f01(0xf9)]>0x0||_0x57d3a3[_0x375f01(0xb9)]['experimentalKnowledgeBases'][_0x375f01(0x103)]>0x0||_0x57d3a3[_0x375f01(0xb9)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x75)]['created']>0x0||_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x75)][_0x375f01(0x103)]>0x0||_0x57d3a3[_0x375f01(0xb9)][_0x375f01(0x75)][_0x375f01(0xf7)]>0x0;_0x59c4a2&&(console[_0x375f01(0x6a)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x57d3a3[_0x375f01(0xb9)]['experimentalKnowledgeBases'])),console['log'](_0x375f01(0x65)+formatCountSummary(_0x57d3a3['counts']['experimentalArtifacts'])));console[_0x375f01(0x6a)]('\x20\x20Source:\x20'+a4_0x42444e['cyan'](_0x1134f9)),displayDiffs(_0x57d3a3[_0x375f01(0x104)],_0x57d3a3[_0x375f01(0x116)],_0x57d3a3[_0x375f01(0x6d)],_0x57d3a3['prompts'],_0x57d3a3['integrations'],_0x57d3a3[_0x375f01(0xd9)],_0x57d3a3[_0x375f01(0x75)]);if(_0x3a5ca1)return console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0x101)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x8416d5===0x0&&_0x1cefc7===0x0){console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xc2)](_0x375f01(0xcc)));const _0x55b2ae=getLLMProjectUrl(_0x28ac27,_0x57d3a3['projectId']);return console[_0x375f01(0x6a)]('Project:\x20'+a4_0x42444e['cyan'](_0x55b2ae)),0x0;}if(!_0x3e3d15&&!_0x17082d){if(!isInteractive())return console[_0x375f01(0x84)](a4_0x42444e['red'](_0x375f01(0xb8)),_0x375f01(0x11a)),console[_0x375f01(0x84)](a4_0x42444e[_0x375f01(0xce)](_0x375f01(0x6e))),0x1;const _0x2b4d7f=await confirmKey(_0x375f01(0xd0)+(_0x8416d5+_0x1cefc7)+_0x375f01(0x114));if(!_0x2b4d7f)return console['log'](a4_0x42444e[_0x375f01(0x101)](_0x375f01(0xe7)),_0x375f01(0x8a)),0x1;}const {data:_0x32be31}=await withSpinner(_0x375f01(0xb5),()=>_0x4f1534[_0x375f01(0xf5)][_0x375f01(0x71)](_0x1134f9,{'force':_0x17082d})),_0x3af9f9=_0x32be31['counts']['agents'][_0x375f01(0xfe)]>0x0||_0x32be31[_0x375f01(0xb9)][_0x375f01(0x116)][_0x375f01(0xfe)]>0x0||_0x32be31[_0x375f01(0xb9)][_0x375f01(0x6d)][_0x375f01(0xfe)]>0x0||_0x32be31[_0x375f01(0xb9)][_0x375f01(0xea)][_0x375f01(0xfe)]>0x0;if(_0x3af9f9){console[_0x375f01(0x6a)](a4_0x42444e['yellow'](_0x375f01(0x81))),console[_0x375f01(0x6a)](),console['log'](a4_0x42444e[_0x375f01(0xed)](_0x375f01(0xd6)));for(const _0x5271af of _0x32be31['agents']){_0x5271af['action']==='error'&&console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xed)](_0x375f01(0x9e)+_0x5271af['agentName']+_0x375f01(0x105)+_0x5271af[_0x375f01(0x84)]));}for(const _0x573e21 of _0x32be31['knowledgeBases']){_0x573e21[_0x375f01(0x7c)]===_0x375f01(0x84)&&console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xed)](_0x375f01(0xde)+_0x573e21[_0x375f01(0xa9)]+'\x22:\x20'+_0x573e21['error']));}for(const _0x38d158 of _0x32be31[_0x375f01(0x6d)]){_0x38d158[_0x375f01(0x7c)]===_0x375f01(0x84)&&console[_0x375f01(0x6a)](a4_0x42444e['red'](_0x375f01(0x10b)+_0x38d158['name']+_0x375f01(0x105)+_0x38d158[_0x375f01(0x84)]));}for(const _0x3e92b6 of _0x32be31[_0x375f01(0xea)]){_0x3e92b6[_0x375f01(0x7c)]===_0x375f01(0x84)&&console['log'](a4_0x42444e['red'](_0x375f01(0x6f)+_0x3e92b6[_0x375f01(0xa9)]+_0x375f01(0x105)+_0x3e92b6['error']));}for(const _0x499145 of _0x32be31[_0x375f01(0xeb)]){_0x499145[_0x375f01(0x7c)]===_0x375f01(0x84)&&console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xed)](_0x375f01(0x93)+_0x499145['name']+_0x375f01(0x105)+_0x499145[_0x375f01(0x84)]));}return 0x1;}console[_0x375f01(0x6a)](a4_0x42444e[_0x375f01(0xc2)](_0x375f01(0x117)+(_0x8416d5+_0x1cefc7)+_0x375f01(0xd5)+_0x32be31[_0x375f01(0x79)]+'\x27'));const _0x3fde57=getLLMProjectUrl(_0x28ac27,_0x32be31[_0x375f01(0xa1)]);return console[_0x375f01(0x6a)](_0x375f01(0xe3)+a4_0x42444e['cyan'](_0x3fde57)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x9b25(_0x44fe9b,_0x41c0b3){_0x44fe9b=_0x44fe9b-0xb4;const _0x916d4b=a5_0x916d();let _0x9b258f=_0x916d4b[_0x44fe9b];return _0x9b258f;}const a5_0x136a22=a5_0x9b25;(function(_0x53f7a3,_0x186737){const _0x39d408=a5_0x9b25,_0x2eaf11=_0x53f7a3();while(!![]){try{const _0x1e53df=parseInt(_0x39d408(0xcf))/0x1*(-parseInt(_0x39d408(0x135))/0x2)+-parseInt(_0x39d408(0x10d))/0x3*(parseInt(_0x39d408(0x117))/0x4)+-parseInt(_0x39d408(0x138))/0x5*(parseInt(_0x39d408(0x13b))/0x6)+parseInt(_0x39d408(0x10b))/0x7+-parseInt(_0x39d408(0x13f))/0x8*(parseInt(_0x39d408(0x101))/0x9)+parseInt(_0x39d408(0x127))/0xa+parseInt(_0x39d408(0xde))/0xb;if(_0x1e53df===_0x186737)break;else _0x2eaf11['push'](_0x2eaf11['shift']());}catch(_0x586e32){_0x2eaf11['push'](_0x2eaf11['shift']());}}}(a5_0x916d,0xc969c));import*as a5_0x184740 from'node:fs';function a5_0x916d(){const _0x20071c=['Re-evaluating...','repeat','✓\x20PASS:\x20','Either\x20switch\x20to\x20the\x20\x22','json','projectDir','log','some','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Test\x20','size','testYmlPath','/<agent-name>','27201240cNCTwq','\x20(new)','context','source','Re-evaluation\x20Summary','New\x20tests\x20to\x20execute:\x20','Usage:','agentName','length','execute','\x22:\x20','Total:\x20\x20\x20\x20','testName','tests','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','resolveProjectId','✗\x20FAIL:\x20','writeFileSync','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','tags','conversation_url','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','table','trim','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20\x20Site:\x20','Available\x20tests:\x20','reason','\x22,\x20but\x20current\x20site\x20is\x20\x22','\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','not\x20found','Evaluating\x20response...','rounds','\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)','Cached\x20run\x20from:\x20','143073cWxFja','No\x20tests\x20found\x20with\x20tags:\x20','\x20\x20Agent:\x20','isSpinning','push','Cached\x20run\x20is\x20from\x20site\x20\x22','utf-8','no_context','reeval','agentDirs','1547553uRZSYL','name','2258103IOzmTq','basename','Error\x20writing\x20output\x20file:\x20','text','projectName','llm','message','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Project:\x20','4gqbxSY','dim','site','red','status','...','stop','has','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Failed:\x20\x20\x20','FAIL','\x20\x20-\x20','start','now','timestamp','resolveAgentId','8870660IEPOPM','no_tests','agent:test','Executing\x20new\x20tests...','Test\x20Configuration:','no_local_folder',':\x20Sending\x20user\x20input...','\x20\x20Round\x20','filter','conversations','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x20\x20Evaluating...\x20','includes','cyan','2HyTnBF','resolve','map','5KoMXTD','404','multiple_agents','9528186oFSHtT','\x20-\x20','Output\x20written\x20to:\x20','Conversation\x20URL:\x20','192bRmLMY','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agent','tsv','Running\x20test:\x20','ERROR','llmProject','green','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','jsonl','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20\x20Conversation:\x20','found','yellow','...\x20','Run\x20\x27tdx\x20agent\x20pull\x20','split','Round\x201/','toISOString','✗\x20ERROR:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','toLowerCase','Running:\x20','Re-evaluating\x20','Passed:\x20\x20\x20','PASS','output','Re-evaluating\x20cached\x20test\x20run...','verbose','Running\x20agent\x20tests...','Round\x20','Failed\x20Tests:','⚠\x20SKIPPED:\x20','join','existsSync','Project\x20path:\x20','find','\x20(cached)','Site:\x20','Test\x20Summary','Errors:\x20\x20\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','forEach','Run\x20tests\x20for\x20an\x20LLM\x20agent','Tests\x20found:\x20','executeReeval','white','round','33737YxQDuE','substring'];a5_0x916d=function(){return _0x20071c;};return a5_0x916d();}import*as a5_0x36abb9 from'node:path';import a5_0x4942b0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x136a22(0x10c)]=a5_0x136a22(0x129);['description']=a5_0x136a22(0xca);async[a5_0x136a22(0xe7)](_0xbf8871){const _0x4c08f7=a5_0x136a22,{options:_0x2d1174,args:_0x519464,tdx:_0x845b02}=_0xbf8871,_0x540736=_0x519464[0x0]||'.',_0x311d3a=_0x2d1174['dryRun'],_0x2a63ee=_0x2d1174,_0x4b1afe=_0x2a63ee['eval']===![],_0x291528=_0x2a63ee[_0x4c08f7(0x109)],_0x12efab=_0x2a63ee[_0x4c08f7(0x10c)],_0x4a1674=_0x2a63ee[_0x4c08f7(0xf1)],_0x40004f=_0x2d1174[_0x4c08f7(0x119)],_0x2d113b=_0x2a63ee[_0x4c08f7(0xb9)];if(_0x291528&&_0x4b1afe)return console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0xd9))),0x1;let _0x33f8e2='table';if(_0x2a63ee['json'])_0x33f8e2=_0x4c08f7(0xd5);else{if(_0x2a63ee['jsonl'])_0x33f8e2=_0x4c08f7(0x148);else{if(_0x2a63ee[_0x4c08f7(0x142)])_0x33f8e2='tsv';else{if(_0x2a63ee[_0x4c08f7(0xf4)])_0x33f8e2=_0x4c08f7(0xf4);}}}const _0x106129=_0x2a63ee[_0x4c08f7(0x145)];let _0x42dc54=_0x540736;const _0x44200d=a5_0x184740[_0x4c08f7(0xc1)](_0x540736),_0x8fcc30=_0x540736==='.';if(!_0x44200d||_0x8fcc30){const _0x1677af=resolveProjectFromContext(_0x540736,_0x106129,{'requireFile':'test.yml'});if(_0x1677af[_0x4c08f7(0x14b)])_0x42dc54=_0x1677af[_0x4c08f7(0xd6)],_0x1677af[_0x4c08f7(0xe1)]===_0x4c08f7(0xe0)&&console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)]('Using\x20agent:\x20'+_0x42dc54));else switch(_0x1677af[_0x4c08f7(0xf9)]){case _0x4c08f7(0x108):console[_0x4c08f7(0xd7)](a5_0x4942b0['yellow'](_0x1677af['message'])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xe4)),console['log'](_0x4c08f7(0xfb)),console[_0x4c08f7(0xd7)](_0x4c08f7(0xff)),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0x114));return 0x1;case _0x4c08f7(0x12c):console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)](_0x1677af[_0x4c08f7(0x113)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0x14e)+_0x1677af['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x4c08f7(0x13a):{const _0x2a52df=a5_0x36abb9[_0x4c08f7(0x10e)](_0x1677af[_0x4c08f7(0xd6)]);console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)](_0x4c08f7(0xf6)+_0x1677af[_0x4c08f7(0x145)]+'\x22:'));for(const _0x59b1b2 of _0x1677af[_0x4c08f7(0x10a)]){console[_0x4c08f7(0xd7)](_0x4c08f7(0x122)+_0x59b1b2);}return console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xec)+_0x2a52df+_0x4c08f7(0xdd)),0x1;}case _0x4c08f7(0x128):console[_0x4c08f7(0xd7)](a5_0x4942b0['yellow'](_0x4c08f7(0x147)+_0x1677af[_0x4c08f7(0x145)]+'\x22.')),console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0xc2)+_0x1677af[_0x4c08f7(0xd6)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x619ba0,agentInfo:_0xe86f3a}=parseTestFile(_0x42dc54);let _0x56f1d8=_0x619ba0[_0x4c08f7(0xeb)];if(_0x12efab){const _0x1fc436=_0x12efab[_0x4c08f7(0x14f)](',')[_0x4c08f7(0x137)](_0x4af2f8=>_0x4af2f8[_0x4c08f7(0xf5)]());_0x56f1d8=_0x619ba0['tests'][_0x4c08f7(0x12f)](_0x1f5798=>_0x1fc436[_0x4c08f7(0x133)](_0x1f5798[_0x4c08f7(0x10c)]));if(_0x56f1d8['length']===0x0)return console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)]('No\x20tests\x20found\x20matching:\x20'+_0x12efab)),console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0xf8)+_0x619ba0[_0x4c08f7(0xeb)][_0x4c08f7(0x137)](_0x2dba1b=>_0x2dba1b[_0x4c08f7(0x10c)])[_0x4c08f7(0xc0)](',\x20'))),0x1;}if(_0x4a1674){const _0x3a7e06=_0x4a1674[_0x4c08f7(0x14f)](',')[_0x4c08f7(0x137)](_0x181715=>_0x181715[_0x4c08f7(0xf5)]()[_0x4c08f7(0xb4)]());_0x56f1d8=_0x56f1d8['filter'](_0x24f786=>_0x24f786['tags']?.[_0x4c08f7(0xd8)](_0xa6ce0c=>_0x3a7e06[_0x4c08f7(0x133)](_0xa6ce0c[_0x4c08f7(0xb4)]())));if(_0x56f1d8['length']===0x0){console['log'](a5_0x4942b0[_0x4c08f7(0x14c)](_0x4c08f7(0x102)+_0x4a1674));const _0x5b61bb=new Set();return _0x619ba0[_0x4c08f7(0xeb)]['forEach'](_0x185c9f=>_0x185c9f[_0x4c08f7(0xf1)]?.[_0x4c08f7(0xc9)](_0xc04c6f=>_0x5b61bb['add'](_0xc04c6f))),_0x5b61bb[_0x4c08f7(0xdb)]>0x0?console[_0x4c08f7(0xd7)](a5_0x4942b0['dim']('Available\x20tags:\x20'+[..._0x5b61bb]['join'](',\x20'))):console[_0x4c08f7(0xd7)](a5_0x4942b0['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x291528)return this[_0x4c08f7(0xcc)](_0xbf8871,{'definition':{'tests':_0x56f1d8},'agentInfo':_0xe86f3a,'outputFormat':_0x33f8e2,'outputFile':_0x2d113b,'testNames':_0x12efab});if(_0x311d3a){console['log'](a5_0x4942b0[_0x4c08f7(0x134)](_0x4c08f7(0x12b))),console[_0x4c08f7(0xd7)](_0x4c08f7(0xf7)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x40004f)),console['log'](_0x4c08f7(0x116)+a5_0x4942b0[_0x4c08f7(0xcd)](_0xe86f3a[_0x4c08f7(0x111)])),console['log'](_0x4c08f7(0x103)+a5_0x4942b0[_0x4c08f7(0xcd)](_0xe86f3a[_0x4c08f7(0xe5)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xcb)+a5_0x4942b0['white'](_0x56f1d8['length']));for(let _0x3931df=0x0;_0x3931df<_0x56f1d8[_0x4c08f7(0xe6)];_0x3931df++){const _0x22e2c9=_0x56f1d8[_0x3931df],_0x5df6b3=_0x22e2c9[_0x4c08f7(0xfe)][_0x4c08f7(0xe6)]===0x1?_0x4c08f7(0xce):'rounds',_0x3871a7=_0x22e2c9[_0x4c08f7(0xf1)]?.[_0x4c08f7(0xe6)]?'\x20['+_0x22e2c9['tags'][_0x4c08f7(0xc0)](',\x20')+']':'';console[_0x4c08f7(0xd7)]('\x20\x20'+(_0x3931df+0x1)+'.\x20'+a5_0x4942b0[_0x4c08f7(0xcd)](_0x22e2c9[_0x4c08f7(0x10c)])+'\x20('+_0x22e2c9['rounds'][_0x4c08f7(0xe6)]+'\x20'+_0x5df6b3+')'+a5_0x4942b0['dim'](_0x3871a7));}return 0x0;}let _0xde2d0e,_0x364e4b;try{_0xde2d0e=await _0x845b02[_0x4c08f7(0x112)][_0x4c08f7(0xed)](_0xe86f3a[_0x4c08f7(0x111)]);}catch(_0x8659fc){const _0x3b3d9f=_0x8659fc instanceof Error?_0x8659fc[_0x4c08f7(0x113)]:String(_0x8659fc);return _0x3b3d9f['includes'](_0x4c08f7(0x139))||_0x3b3d9f[_0x4c08f7(0xb4)]()['includes'](_0x4c08f7(0xfc))?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0xe86f3a[_0x4c08f7(0x111)])):console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xe86f3a[_0x4c08f7(0x111)]+_0x4c08f7(0xe8)+_0x3b3d9f)),0x1;}try{_0x364e4b=await _0x845b02[_0x4c08f7(0x112)][_0x4c08f7(0x126)](_0xe86f3a[_0x4c08f7(0xe5)],_0xde2d0e);}catch(_0x55ba94){const _0x4482fc=_0x55ba94 instanceof Error?_0x55ba94[_0x4c08f7(0x113)]:String(_0x55ba94);return _0x4482fc['includes']('404')||_0x4482fc[_0x4c08f7(0xb4)]()[_0x4c08f7(0x133)](_0x4c08f7(0xfc))?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xe86f3a['agentName'])):console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0x149)+_0xe86f3a[_0x4c08f7(0xe5)]+_0x4c08f7(0xe8)+_0x4482fc)),0x1;}let _0x574d93;if(!_0x4b1afe)try{_0x574d93=await setupEvaluatorAgent(_0x845b02['llm'],_0x2d1174[_0x4c08f7(0xbb)]);}catch(_0x34a47c){const _0x5b5527=_0x34a47c instanceof Error?_0x34a47c[_0x4c08f7(0x113)]:String(_0x34a47c);return console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0x153)+_0x5b5527)),0x1;}console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x134)](_0x4c08f7(0xbc))),console['log'](_0x4c08f7(0xc5)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x40004f)),console['log']('Agent:\x20'+a5_0x4942b0['white'](_0xe86f3a[_0x4c08f7(0x111)]+'/'+_0xe86f3a['agentName'])),console[_0x4c08f7(0xd7)]();const _0x1f0f59=[],_0x36fbd0=[],_0x385e32=Date['now']();for(let _0x4327c5=0x0;_0x4327c5<_0x56f1d8[_0x4c08f7(0xe6)];_0x4327c5++){const _0x23eaca=_0x56f1d8[_0x4327c5];_0x56f1d8[_0x4c08f7(0xe6)]>0x1?console[_0x4c08f7(0xd7)](_0x4c08f7(0xda)+(_0x4327c5+0x1)+'/'+_0x56f1d8[_0x4c08f7(0xe6)]+':\x20'+a5_0x4942b0[_0x4c08f7(0xcd)](_0x23eaca[_0x4c08f7(0x10c)])):console[_0x4c08f7(0xd7)](_0x4c08f7(0x143)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x23eaca[_0x4c08f7(0x10c)]));const _0x482118=createCommandSpinner(_0x4c08f7(0x150)+_0x23eaca[_0x4c08f7(0xfe)][_0x4c08f7(0xe6)]+_0x4c08f7(0x12d));_0x482118[_0x4c08f7(0x123)]();try{const {result:_0x4afb3a,conversation:_0xa13b16}=await runTest(_0x845b02[_0x4c08f7(0x112)],_0x23eaca,{'agentId':_0x364e4b,'projectId':_0xde2d0e,'site':_0x40004f,'noEval':_0x4b1afe,'evaluatorId':_0x574d93,'onRoundStart':(_0x1c2a6f,_0x4b3744)=>{const _0x3e5916=_0x4c08f7;_0x482118[_0x3e5916(0x110)]=_0x3e5916(0xbd)+(_0x1c2a6f+0x1)+'/'+_0x4b3744+_0x3e5916(0x12d);},'onRoundComplete':(_0x5100c2,_0x59059d,_0x1e2a7d)=>{const _0x4a0bda=_0x4c08f7,_0x2b8fe4=formatElapsed(_0x59059d);_0x1e2a7d?console[_0x4a0bda(0xd7)](_0x4a0bda(0x12e)+(_0x5100c2+0x1)+'/'+_0x23eaca[_0x4a0bda(0xfe)]['length']+_0x4a0bda(0x14d)+a5_0x4942b0[_0x4a0bda(0x146)]('✓')+'\x20('+_0x2b8fe4+')'):console['log'](_0x4a0bda(0x12e)+(_0x5100c2+0x1)+'/'+_0x23eaca[_0x4a0bda(0xfe)]['length']+_0x4a0bda(0x14d)+a5_0x4942b0['red']('✗'));},'onEvaluationStart':()=>{const _0x10e1ee=_0x4c08f7;_0x482118[_0x10e1ee(0x110)]=_0x10e1ee(0xfd);},'onEvaluationComplete':_0x432859=>{const _0x283d6c=_0x4c08f7,_0x1c7ba4=formatElapsed(_0x432859);console[_0x283d6c(0xd7)](_0x283d6c(0x132)+a5_0x4942b0[_0x283d6c(0x146)]('✓')+'\x20('+_0x1c7ba4+')');}});_0x482118[_0x4c08f7(0x11d)](),_0x1f0f59['push'](_0x4afb3a),_0x36fbd0['push'](_0xa13b16);if(_0x4afb3a[_0x4c08f7(0x11b)]==='PASS')console[_0x4c08f7(0xd7)](a5_0x4942b0['green']('✓\x20PASS:\x20'+_0x4afb3a['reason']));else _0x4afb3a[_0x4c08f7(0x11b)]==='FAIL'?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0xee)+_0x4afb3a[_0x4c08f7(0xf9)])):console['log'](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0x152)+_0x4afb3a['reason']));_0x4afb3a[_0x4c08f7(0xf2)]&&console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0x13e)+_0x4afb3a[_0x4c08f7(0xf2)])),console[_0x4c08f7(0xd7)]();}catch(_0x4c7e70){_0x482118[_0x4c08f7(0x11d)]();const _0x1b4bd3=_0x4c7e70 instanceof Error?_0x4c7e70[_0x4c08f7(0x113)]:String(_0x4c7e70);console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20'+_0x1b4bd3)),console[_0x4c08f7(0xd7)](),_0x1f0f59[_0x4c08f7(0x105)]({'name':_0x23eaca['name'],'status':_0x4c08f7(0x144),'reason':_0x1b4bd3,'timestamp':new Date()[_0x4c08f7(0x151)](),'duration_ms':0x0});}}const _0x702a3b=Date[_0x4c08f7(0x124)]()-_0x385e32,_0x54f01f=_0x1f0f59[_0x4c08f7(0x12f)](_0xb15b7a=>_0xb15b7a[_0x4c08f7(0x11b)]===_0x4c08f7(0xb8))[_0x4c08f7(0xe6)],_0x568bcb=_0x1f0f59[_0x4c08f7(0x12f)](_0x44d369=>_0x44d369[_0x4c08f7(0x11b)]===_0x4c08f7(0x121))[_0x4c08f7(0xe6)],_0x55b704=_0x1f0f59[_0x4c08f7(0x12f)](_0x57be84=>_0x57be84[_0x4c08f7(0x11b)]==='ERROR')[_0x4c08f7(0xe6)];console[_0x4c08f7(0xd7)]('━'[_0x4c08f7(0xd2)](0x3c)),console[_0x4c08f7(0xd7)](_0x4c08f7(0xc6)),console[_0x4c08f7(0xd7)]('━'[_0x4c08f7(0xd2)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x1f0f59[_0x4c08f7(0xe6)]),console[_0x4c08f7(0xd7)](_0x4c08f7(0xb7)+a5_0x4942b0['green'](_0x54f01f)),console[_0x4c08f7(0xd7)](_0x4c08f7(0x120)+a5_0x4942b0[_0x4c08f7(0x11a)](_0x568bcb));_0x55b704>0x0&&console['log'](_0x4c08f7(0xc7)+a5_0x4942b0[_0x4c08f7(0x11a)](_0x55b704));console[_0x4c08f7(0xd7)]('Duration:\x20'+formatElapsed(_0x702a3b)),console['log']('━'[_0x4c08f7(0xd2)](0x3c));const _0x227171=_0x1f0f59[_0x4c08f7(0x12f)](_0x2d2a01=>_0x2d2a01['status']!==_0x4c08f7(0xb8));if(_0x227171[_0x4c08f7(0xe6)]>0x0){console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xbe));for(const _0x29541d of _0x227171){const _0x1fcb90=a5_0x4942b0[_0x4c08f7(0x11a)]('✗'),_0x2e900e=_0x29541d[_0x4c08f7(0xf9)][_0x4c08f7(0xe6)]>0x32?_0x29541d[_0x4c08f7(0xf9)][_0x4c08f7(0xd0)](0x0,0x32)+_0x4c08f7(0x11c):_0x29541d[_0x4c08f7(0xf9)];console[_0x4c08f7(0xd7)]('\x20\x20'+_0x1fcb90+'\x20'+_0x29541d['name']+':\x20'+_0x2e900e);}}const _0x1747c5={'summary':{'total':_0x1f0f59[_0x4c08f7(0xe6)],'passed':_0x54f01f,'failed':_0x568bcb,'errors':_0x55b704>0x0?_0x55b704:undefined,'duration_ms':_0x702a3b},'tests':_0x1f0f59,'agent':{'project':_0xe86f3a[_0x4c08f7(0x111)],'name':_0xe86f3a[_0x4c08f7(0xe5)],'site':_0x40004f},'timestamp':new Date(_0x385e32)[_0x4c08f7(0x151)]()};try{const _0x37a408=buildCachedTestRun(_0x36fbd0,{'site':_0x40004f,'projectId':_0xde2d0e,'projectName':_0xe86f3a[_0x4c08f7(0x111)],'agentId':_0x364e4b,'agentName':_0xe86f3a[_0x4c08f7(0xe5)],'testYmlPath':a5_0x36abb9[_0x4c08f7(0x136)](_0xe86f3a[_0x4c08f7(0xdc)])});saveLastTestRun(_0x37a408);}catch{}if(_0x33f8e2!==_0x4c08f7(0xf4)||_0x2d113b){const _0x25614c=formatResults(_0x1747c5,_0x33f8e2);if(_0x2d113b)try{a5_0x184740['writeFileSync'](_0x2d113b,_0x25614c,'utf-8'),console['log'](),console[_0x4c08f7(0xd7)](a5_0x4942b0['dim'](_0x4c08f7(0x13d)+_0x2d113b));}catch(_0x4d24b7){return console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0x10f)+_0x4d24b7)),0x1;}else console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x25614c);}return _0x227171[_0x4c08f7(0xe6)]>0x0?0x1:0x0;}async['executeReeval'](_0x472f98,_0x326b61){const _0x78975b=a5_0x136a22,{options:_0x170f7f,tdx:_0x8fc036}=_0x472f98,{definition:_0x535ca5,agentInfo:_0x283964,outputFormat:_0x6dc066,outputFile:_0x252595}=_0x326b61,_0x2d65ab=_0x170f7f[_0x78975b(0x119)],_0x24d1f2=loadLastTestRun();if(!_0x24d1f2)return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0xc8))),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xf0))),0x1;if(_0x24d1f2[_0x78975b(0x141)]['agentName']!==_0x283964[_0x78975b(0xe5)])return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0xf3)+_0x24d1f2[_0x78975b(0x141)][_0x78975b(0xe5)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x283964['agentName']+'\x22.')),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x140))),0x1;const _0x21b6d0=new Set(_0x24d1f2[_0x78975b(0x130)][_0x78975b(0x137)](_0x36469e=>_0x36469e[_0x78975b(0xea)])),_0x54e1cf=_0x535ca5[_0x78975b(0xeb)][_0x78975b(0x12f)](_0x106f06=>!_0x21b6d0[_0x78975b(0x11e)](_0x106f06[_0x78975b(0x10c)]));if(_0x54e1cf[_0x78975b(0xe6)]>0x0&&_0x24d1f2[_0x78975b(0x119)]!==_0x2d65ab)return console[_0x78975b(0xd7)](a5_0x4942b0['red'](_0x78975b(0x131))),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x106)+_0x24d1f2['site']+_0x78975b(0xfa)+_0x2d65ab+'\x22.')),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xd4)+_0x24d1f2[_0x78975b(0x119)]+_0x78975b(0x115))),0x1;const _0x5bf7eb=_0x535ca5[_0x78975b(0xeb)][_0x78975b(0x12f)](_0x359f12=>_0x21b6d0[_0x78975b(0x11e)](_0x359f12[_0x78975b(0x10c)])),_0x69ef1c=_0x54e1cf;let _0x3e2518;try{_0x3e2518=await setupEvaluatorAgent(_0x8fc036[_0x78975b(0x112)],_0x170f7f[_0x78975b(0xbb)]);}catch(_0xc678c7){const _0x23378a=_0xc678c7 instanceof Error?_0xc678c7['message']:String(_0xc678c7);return console['log'](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x153)+_0x23378a)),0x1;}console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x134)](_0x78975b(0xba))),console[_0x78975b(0xd7)](_0x78975b(0x100)+a5_0x4942b0[_0x78975b(0xcd)](_0x24d1f2[_0x78975b(0x125)])),console[_0x78975b(0xd7)]('Agent:\x20'+a5_0x4942b0[_0x78975b(0xcd)](_0x24d1f2['agent'][_0x78975b(0x111)]+'/'+_0x24d1f2[_0x78975b(0x141)][_0x78975b(0xe5)]));_0x69ef1c[_0x78975b(0xe6)]>0x0&&console[_0x78975b(0xd7)](_0x78975b(0xe3)+a5_0x4942b0[_0x78975b(0x14c)](_0x69ef1c[_0x78975b(0xe6)]));console['log']();const _0x253599=[],_0x582f64=Date[_0x78975b(0x124)](),_0xedb7fd=createCommandSpinner(_0x78975b(0xd1));if(_0x5bf7eb[_0x78975b(0xe6)]>0x0)try{const _0x410c80=await reevaluateFromCache(_0x8fc036[_0x78975b(0x112)],_0x24d1f2,{'tests':_0x5bf7eb},{'evaluatorId':_0x3e2518,'onTestStart':(_0xa24e86,_0x30e55d,_0x56d39a)=>{const _0x495fdc=_0x78975b;_0xedb7fd[_0x495fdc(0x110)]=_0x495fdc(0xb6)+(_0x30e55d+0x1)+'/'+_0x56d39a+':\x20'+_0xa24e86+_0x495fdc(0x11c);if(!_0xedb7fd[_0x495fdc(0x104)])_0xedb7fd[_0x495fdc(0x123)]();},'onTestComplete':(_0x5d62c8,_0xa6d762)=>{const _0x4cdd70=_0x78975b;_0xedb7fd[_0x4cdd70(0x11d)]();if(_0xa6d762[_0x4cdd70(0x11b)]==='PASS')console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x146)](_0x4cdd70(0xd3)+_0x5d62c8)+a5_0x4942b0[_0x4cdd70(0x118)](_0x4cdd70(0xc4)));else _0xa6d762['status']==='FAIL'?console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x11a)]('✗\x20FAIL:\x20'+_0x5d62c8+_0x4cdd70(0x13c)+_0xa6d762[_0x4cdd70(0xf9)])+a5_0x4942b0['dim'](_0x4cdd70(0xc4))):console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x11a)](_0x4cdd70(0x152)+_0x5d62c8+_0x4cdd70(0x13c)+_0xa6d762[_0x4cdd70(0xf9)]));_0xa6d762[_0x4cdd70(0xf2)]&&console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x118)](_0x4cdd70(0x14a)+_0xa6d762[_0x4cdd70(0xf2)])),_0x253599[_0x4cdd70(0x105)](_0xa6d762);},'onTestSkipped':(_0x22aabb,_0x39ad03)=>{const _0x171cba=_0x78975b;_0xedb7fd[_0x171cba(0x11d)](),console[_0x171cba(0xd7)](a5_0x4942b0[_0x171cba(0x14c)](_0x171cba(0xbf)+_0x22aabb+_0x171cba(0x13c)+_0x39ad03));}});for(const _0x247e3d of _0x410c80){!_0x253599[_0x78975b(0xc3)](_0x53834c=>_0x53834c['name']===_0x247e3d[_0x78975b(0x10c)])&&_0x253599['push'](_0x247e3d);}}catch(_0x47de77){_0xedb7fd[_0x78975b(0x11d)]();const _0x31c541=_0x47de77 instanceof Error?_0x47de77[_0x78975b(0x113)]:String(_0x47de77);return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x11f)+_0x31c541)),0x1;}_0xedb7fd[_0x78975b(0x11d)]();if(_0x69ef1c[_0x78975b(0xe6)]>0x0){console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x134)](_0x78975b(0x12a)));const {projectId:_0x576f5c,agentId:_0x4138c1}=_0x24d1f2['agent'];for(const _0x1a82ae of _0x69ef1c){console[_0x78975b(0xd7)](_0x78975b(0xb5)+a5_0x4942b0['white'](_0x1a82ae[_0x78975b(0x10c)]));const _0x43f407=createCommandSpinner(_0x78975b(0x150)+_0x1a82ae['rounds'][_0x78975b(0xe6)]+':\x20Sending\x20user\x20input...');_0x43f407['start']();try{const {result:_0x492ae8}=await runTest(_0x8fc036['llm'],_0x1a82ae,{'agentId':_0x4138c1,'projectId':_0x576f5c,'site':_0x24d1f2[_0x78975b(0x119)],'noEval':![],'evaluatorId':_0x3e2518,'onRoundStart':(_0x1f2c30,_0x1a7c84)=>{const _0x302723=_0x78975b;_0x43f407[_0x302723(0x110)]=_0x302723(0xbd)+(_0x1f2c30+0x1)+'/'+_0x1a7c84+_0x302723(0x12d);},'onRoundComplete':(_0x242629,_0x4b2d36,_0x108a5c)=>{const _0x51d856=_0x78975b,_0xd56dcb=formatElapsed(_0x4b2d36);_0x108a5c?console['log'](_0x51d856(0x12e)+(_0x242629+0x1)+'/'+_0x1a82ae[_0x51d856(0xfe)][_0x51d856(0xe6)]+_0x51d856(0x14d)+a5_0x4942b0[_0x51d856(0x146)]('✓')+'\x20('+_0xd56dcb+')'):console[_0x51d856(0xd7)](_0x51d856(0x12e)+(_0x242629+0x1)+'/'+_0x1a82ae[_0x51d856(0xfe)][_0x51d856(0xe6)]+'...\x20'+a5_0x4942b0[_0x51d856(0x11a)]('✗'));},'onEvaluationStart':()=>{const _0x5402d3=_0x78975b;_0x43f407[_0x5402d3(0x110)]=_0x5402d3(0xfd);},'onEvaluationComplete':_0x2850e2=>{const _0x3789e7=_0x78975b,_0xdf5783=formatElapsed(_0x2850e2);console[_0x3789e7(0xd7)](_0x3789e7(0x132)+a5_0x4942b0['green']('✓')+'\x20('+_0xdf5783+')');}});_0x43f407['stop'](),_0x253599[_0x78975b(0x105)](_0x492ae8);if(_0x492ae8[_0x78975b(0x11b)]==='PASS')console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x146)](_0x78975b(0xd3)+_0x492ae8['reason'])+a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xdf)));else _0x492ae8['status']===_0x78975b(0x121)?console['log'](a5_0x4942b0['red'](_0x78975b(0xee)+_0x492ae8[_0x78975b(0xf9)])+a5_0x4942b0[_0x78975b(0x118)]('\x20(new)')):console[_0x78975b(0xd7)](a5_0x4942b0['red']('✗\x20ERROR:\x20'+_0x492ae8[_0x78975b(0xf9)]));_0x492ae8[_0x78975b(0xf2)]&&console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x14a)+_0x492ae8[_0x78975b(0xf2)]));}catch(_0x1c1bde){_0x43f407[_0x78975b(0x11d)]();const _0x15f9c3=_0x1c1bde instanceof Error?_0x1c1bde[_0x78975b(0x113)]:String(_0x1c1bde);console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x152)+_0x15f9c3)),_0x253599[_0x78975b(0x105)]({'name':_0x1a82ae[_0x78975b(0x10c)],'status':_0x78975b(0x144),'reason':_0x15f9c3,'timestamp':new Date()[_0x78975b(0x151)](),'duration_ms':0x0});}}}console[_0x78975b(0xd7)]();const _0x1ab1b7=Date[_0x78975b(0x124)]()-_0x582f64,_0x4d73a4=_0x253599[_0x78975b(0x12f)](_0x1efff8=>_0x1efff8['status']===_0x78975b(0xb8))[_0x78975b(0xe6)],_0x3f3529=_0x253599[_0x78975b(0x12f)](_0x4df0f4=>_0x4df0f4[_0x78975b(0x11b)]==='FAIL')[_0x78975b(0xe6)],_0x10c4c2=_0x253599[_0x78975b(0x12f)](_0x576d81=>_0x576d81[_0x78975b(0x11b)]===_0x78975b(0x144))['length'];console[_0x78975b(0xd7)]('━'[_0x78975b(0xd2)](0x3c)),console[_0x78975b(0xd7)](_0x78975b(0xe2)),console['log']('━'['repeat'](0x3c)),console[_0x78975b(0xd7)](_0x78975b(0xe9)+_0x253599[_0x78975b(0xe6)]),console[_0x78975b(0xd7)](_0x78975b(0xb7)+a5_0x4942b0[_0x78975b(0x146)](_0x4d73a4)),console[_0x78975b(0xd7)]('Failed:\x20\x20\x20'+a5_0x4942b0[_0x78975b(0x11a)](_0x3f3529));_0x10c4c2>0x0&&console[_0x78975b(0xd7)](_0x78975b(0xc7)+a5_0x4942b0[_0x78975b(0x11a)](_0x10c4c2));console[_0x78975b(0xd7)]('Duration:\x20'+formatElapsed(_0x1ab1b7)),console[_0x78975b(0xd7)]('━'[_0x78975b(0xd2)](0x3c));const _0x13ab37={'summary':{'total':_0x253599[_0x78975b(0xe6)],'passed':_0x4d73a4,'failed':_0x3f3529,'errors':_0x10c4c2>0x0?_0x10c4c2:undefined,'duration_ms':_0x1ab1b7},'tests':_0x253599,'agent':{'project':_0x283964[_0x78975b(0x111)],'name':_0x283964[_0x78975b(0xe5)],'site':_0x2d65ab},'timestamp':new Date(_0x582f64)[_0x78975b(0x151)]()};if(_0x6dc066!==_0x78975b(0xf4)||_0x252595){const _0x3bf07c=formatResults(_0x13ab37,_0x6dc066);if(_0x252595)try{a5_0x184740[_0x78975b(0xef)](_0x252595,_0x3bf07c,_0x78975b(0x107)),console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x13d)+_0x252595));}catch(_0x32db1c){return console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0['red'](_0x78975b(0x10f)+_0x32db1c)),0x1;}else console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](_0x3bf07c);}const _0x23c94b=_0x253599[_0x78975b(0x12f)](_0x32440a=>_0x32440a[_0x78975b(0x11b)]!==_0x78975b(0xb8));return _0x23c94b['length']>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x5dc3(_0x5ce737,_0x4027ec){_0x5ce737=_0x5ce737-0x161;const _0x43351e=a5_0x4335();let _0x5dc37e=_0x43351e[_0x5ce737];return _0x5dc37e;}const a5_0x5808b5=a5_0x5dc3;(function(_0x241269,_0x1a823a){const _0x240466=a5_0x5dc3,_0x6c693b=_0x241269();while(!![]){try{const _0x27fd45=parseInt(_0x240466(0x195))/0x1*(parseInt(_0x240466(0x1c4))/0x2)+-parseInt(_0x240466(0x1ca))/0x3*(parseInt(_0x240466(0x16f))/0x4)+parseInt(_0x240466(0x1ce))/0x5*(parseInt(_0x240466(0x193))/0x6)+parseInt(_0x240466(0x1eb))/0x7+parseInt(_0x240466(0x196))/0x8+parseInt(_0x240466(0x1f3))/0x9*(-parseInt(_0x240466(0x1cb))/0xa)+parseInt(_0x240466(0x1a3))/0xb*(-parseInt(_0x240466(0x18b))/0xc);if(_0x27fd45===_0x1a823a)break;else _0x6c693b['push'](_0x6c693b['shift']());}catch(_0xfcbabf){_0x6c693b['push'](_0x6c693b['shift']());}}}(a5_0x4335,0x76b5c));import*as a5_0x30e4c0 from'node:fs';import*as a5_0x49f0f7 from'node:path';function a5_0x4335(){const _0x15a1ae=['✓\x20PASS:\x20','agent','resolve','✗\x20FAIL:\x20','text','message','utf-8','execute','Round\x201/','eval','agentDirs','6030948YvPtEG','Running\x20agent\x20tests...','Re-evaluation\x20Summary','\x20\x20Evaluating...\x20','site','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','round','agent:test','180CAOvDi','no_tests','\x20(new)','Test\x20Configuration:','log','Usage:','not\x20found','executeReeval','⚠\x20SKIPPED:\x20','404','Available\x20tags:\x20','ERROR','projectName','\x20\x20-\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','source','verbose','4448wtYyrp','toLowerCase','status','toISOString','dim','\x20\x20Agent:\x20','Re-evaluating\x20cached\x20test\x20run...','...\x20','forEach','projectDir','start','rounds','\x27\x20to\x20create\x20the\x20folder\x20structure.','jsonl','No\x20tests\x20found\x20matching:\x20','table','\x20\x20Project:\x20','tags','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','green','...','json','Error\x20writing\x20output\x20file:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20','no_local_folder','\x20-\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','12itXxGr','\x20\x20Round\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','writeFileSync','conversation_url','push',':\x20Sending\x20user\x20input...','Agent:\x20','558zigyJa','Failed:\x20\x20\x20','254209CyiQdZ','1299256IOPaoE','red','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','context','Re-evaluating...','resolveAgentId','dryRun','testYmlPath','filter','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Available\x20tests:\x20','tsv','Cached\x20run\x20from:\x20','9588161txgLUE','Round\x20','Conversation\x20URL:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','PASS','Either\x20switch\x20to\x20the\x20\x22','testName','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','agentName','\x20\x20Conversation:\x20','llmProject','Errors:\x20\x20\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','cyan','stop','white','Output\x20written\x20to:\x20','llm','\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)','Re-evaluating\x20','Evaluating\x20response...','FAIL','Total:\x20\x20\x20\x20','has','includes','map','New\x20tests\x20to\x20execute:\x20','timestamp','find','\x20(cached)','Site:\x20','Passed:\x20\x20\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','2nhjoqv','description','Executing\x20new\x20tests...','size','split','yellow','258ELEvDj','238900msUKMq','join','isSpinning','35115UvaHsS','Using\x20agent:\x20','\x22:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Failed\x20Tests:','tests','trim','test.yml','reeval','now','\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','length','repeat','reason','output','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','add','name'];a5_0x4335=function(){return _0x15a1ae;};return a5_0x4335();}import a5_0x5d7028 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_0x5808b5(0x1f2);[a5_0x5808b5(0x1c5)]=a5_0x5808b5(0x1af);async[a5_0x5808b5(0x1e7)](_0x50a9e4){const _0x5b5faa=a5_0x5808b5,{options:_0x218809,args:_0x48a83f,tdx:_0x40e0b3}=_0x50a9e4,_0x36c963=_0x48a83f[0x0]||'.',_0x36303d=_0x218809[_0x5b5faa(0x19c)],_0x465854=_0x218809,_0x14f980=_0x465854[_0x5b5faa(0x1e9)]===![],_0x4bbee8=_0x465854[_0x5b5faa(0x1d6)],_0x2f2d2d=_0x465854['name'],_0x160657=_0x465854[_0x5b5faa(0x180)],_0x58a133=_0x218809[_0x5b5faa(0x1ef)],_0x3b9a18=_0x465854[_0x5b5faa(0x1dc)];if(_0x4bbee8&&_0x14f980)return console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x1a6))),0x1;let _0x5122ee=_0x5b5faa(0x17e);if(_0x465854[_0x5b5faa(0x184)])_0x5122ee=_0x5b5faa(0x184);else{if(_0x465854[_0x5b5faa(0x17c)])_0x5122ee=_0x5b5faa(0x17c);else{if(_0x465854[_0x5b5faa(0x1a1)])_0x5122ee=_0x5b5faa(0x1a1);else{if(_0x465854[_0x5b5faa(0x17e)])_0x5122ee='table';}}}const _0x4dabfe=_0x465854[_0x5b5faa(0x1ad)];let _0x25be6c=_0x36c963;const _0x119433=a5_0x30e4c0['existsSync'](_0x36c963),_0x3cda97=_0x36c963==='.';if(!_0x119433||_0x3cda97){const _0x41b679=resolveProjectFromContext(_0x36c963,_0x4dabfe,{'requireFile':_0x5b5faa(0x1d5)});if(_0x41b679['found'])_0x25be6c=_0x41b679[_0x5b5faa(0x178)],_0x41b679[_0x5b5faa(0x16d)]===_0x5b5faa(0x199)&&console[_0x5b5faa(0x162)](a5_0x5d7028['dim'](_0x5b5faa(0x1cf)+_0x25be6c));else switch(_0x41b679[_0x5b5faa(0x1db)]){case'no_context':console[_0x5b5faa(0x162)](a5_0x5d7028['yellow'](_0x41b679[_0x5b5faa(0x1e5)])),console[_0x5b5faa(0x162)](),console[_0x5b5faa(0x162)](_0x5b5faa(0x163)),console['log'](_0x5b5faa(0x1d8)),console[_0x5b5faa(0x162)](_0x5b5faa(0x1b5)),console[_0x5b5faa(0x162)](),console[_0x5b5faa(0x162)](_0x5b5faa(0x186));return 0x1;case _0x5b5faa(0x188):console[_0x5b5faa(0x162)](a5_0x5d7028['yellow'](_0x41b679[_0x5b5faa(0x1e5)])),console[_0x5b5faa(0x162)](),console[_0x5b5faa(0x162)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x41b679['llmProject']+_0x5b5faa(0x17b));return 0x1;case'multiple_agents':{const _0x1f10d6=a5_0x49f0f7['basename'](_0x41b679[_0x5b5faa(0x178)]);console['log'](a5_0x5d7028[_0x5b5faa(0x1c9)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x41b679['llmProject']+'\x22:'));for(const _0x5a6320 of _0x41b679[_0x5b5faa(0x1ea)]){console[_0x5b5faa(0x162)](_0x5b5faa(0x16b)+_0x5a6320);}return console[_0x5b5faa(0x162)](),console[_0x5b5faa(0x162)](_0x5b5faa(0x1f0)+_0x1f10d6+'/<agent-name>'),0x1;}case _0x5b5faa(0x1f4):console['log'](a5_0x5d7028['yellow'](_0x5b5faa(0x1dd)+_0x41b679[_0x5b5faa(0x1ad)]+'\x22.')),console['log'](a5_0x5d7028[_0x5b5faa(0x173)]('Project\x20path:\x20'+_0x41b679['projectDir'])),console[_0x5b5faa(0x162)](),console['log'](_0x5b5faa(0x181));return 0x1;}}const {definition:_0x58e7bb,agentInfo:_0x39b845}=parseTestFile(_0x25be6c);let _0x36796a=_0x58e7bb['tests'];if(_0x2f2d2d){const _0x38634c=_0x2f2d2d[_0x5b5faa(0x1c8)](',')[_0x5b5faa(0x1bc)](_0x3c204b=>_0x3c204b[_0x5b5faa(0x1d4)]());_0x36796a=_0x58e7bb[_0x5b5faa(0x1d3)]['filter'](_0x116168=>_0x38634c[_0x5b5faa(0x1bb)](_0x116168[_0x5b5faa(0x1df)]));if(_0x36796a[_0x5b5faa(0x1d9)]===0x0)return console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x1c9)](_0x5b5faa(0x17d)+_0x2f2d2d)),console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x173)](_0x5b5faa(0x1a0)+_0x58e7bb[_0x5b5faa(0x1d3)][_0x5b5faa(0x1bc)](_0x5a019b=>_0x5a019b[_0x5b5faa(0x1df)])[_0x5b5faa(0x1cc)](',\x20'))),0x1;}if(_0x160657){const _0x327791=_0x160657['split'](',')[_0x5b5faa(0x1bc)](_0x1a4f32=>_0x1a4f32[_0x5b5faa(0x1d4)]()[_0x5b5faa(0x170)]());_0x36796a=_0x36796a[_0x5b5faa(0x19e)](_0x2bd346=>_0x2bd346[_0x5b5faa(0x180)]?.['some'](_0x2b9426=>_0x327791['includes'](_0x2b9426['toLowerCase']())));if(_0x36796a[_0x5b5faa(0x1d9)]===0x0){console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x1c9)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x160657));const _0x268f64=new Set();return _0x58e7bb[_0x5b5faa(0x1d3)]['forEach'](_0x30072d=>_0x30072d[_0x5b5faa(0x180)]?.[_0x5b5faa(0x177)](_0x32063b=>_0x268f64[_0x5b5faa(0x1de)](_0x32063b))),_0x268f64[_0x5b5faa(0x1c7)]>0x0?console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x173)](_0x5b5faa(0x168)+[..._0x268f64]['join'](',\x20'))):console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x173)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x4bbee8)return this['executeReeval'](_0x50a9e4,{'definition':{'tests':_0x36796a},'agentInfo':_0x39b845,'outputFormat':_0x5122ee,'outputFile':_0x3b9a18,'testNames':_0x2f2d2d});if(_0x36303d){console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x1b0)](_0x5b5faa(0x161))),console[_0x5b5faa(0x162)]('\x20\x20Site:\x20'+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x58a133)),console[_0x5b5faa(0x162)](_0x5b5faa(0x17f)+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x39b845[_0x5b5faa(0x16a)])),console['log'](_0x5b5faa(0x174)+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x39b845[_0x5b5faa(0x1ab)])),console['log'](),console[_0x5b5faa(0x162)]('Tests\x20found:\x20'+a5_0x5d7028['white'](_0x36796a['length']));for(let _0x412b9f=0x0;_0x412b9f<_0x36796a['length'];_0x412b9f++){const _0x2b90d2=_0x36796a[_0x412b9f],_0x467446=_0x2b90d2[_0x5b5faa(0x17a)]['length']===0x1?_0x5b5faa(0x1f1):_0x5b5faa(0x17a),_0x1f7cd0=_0x2b90d2[_0x5b5faa(0x180)]?.['length']?'\x20['+_0x2b90d2[_0x5b5faa(0x180)][_0x5b5faa(0x1cc)](',\x20')+']':'';console[_0x5b5faa(0x162)]('\x20\x20'+(_0x412b9f+0x1)+'.\x20'+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x2b90d2['name'])+'\x20('+_0x2b90d2[_0x5b5faa(0x17a)][_0x5b5faa(0x1d9)]+'\x20'+_0x467446+')'+a5_0x5d7028[_0x5b5faa(0x173)](_0x1f7cd0));}return 0x0;}let _0x178115,_0x274a58;try{_0x178115=await _0x40e0b3['llm']['resolveProjectId'](_0x39b845['projectName']);}catch(_0x1db48d){const _0x245ae3=_0x1db48d instanceof Error?_0x1db48d[_0x5b5faa(0x1e5)]:String(_0x1db48d);return _0x245ae3['includes'](_0x5b5faa(0x167))||_0x245ae3[_0x5b5faa(0x170)]()[_0x5b5faa(0x1bb)](_0x5b5faa(0x164))?console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x18a)+_0x39b845['projectName'])):console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x39b845['projectName']+'\x22:\x20'+_0x245ae3)),0x1;}try{_0x274a58=await _0x40e0b3['llm'][_0x5b5faa(0x19b)](_0x39b845[_0x5b5faa(0x1ab)],_0x178115);}catch(_0x543f1c){const _0x1ead73=_0x543f1c instanceof Error?_0x543f1c[_0x5b5faa(0x1e5)]:String(_0x543f1c);return _0x1ead73[_0x5b5faa(0x1bb)](_0x5b5faa(0x167))||_0x1ead73['toLowerCase']()['includes']('not\x20found')?console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x18d)+_0x39b845[_0x5b5faa(0x1ab)])):console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x19f)+_0x39b845[_0x5b5faa(0x1ab)]+_0x5b5faa(0x1d0)+_0x1ead73)),0x1;}let _0x2be255;if(!_0x14f980)try{_0x2be255=await setupEvaluatorAgent(_0x40e0b3[_0x5b5faa(0x1b4)],_0x218809[_0x5b5faa(0x16e)]);}catch(_0xd01501){const _0x5824fd=_0xd01501 instanceof Error?_0xd01501[_0x5b5faa(0x1e5)]:String(_0xd01501);return console['log'](a5_0x5d7028['red'](_0x5b5faa(0x16c)+_0x5824fd)),0x1;}console['log'](a5_0x5d7028[_0x5b5faa(0x1b0)](_0x5b5faa(0x1ec))),console['log'](_0x5b5faa(0x1c1)+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x58a133)),console['log'](_0x5b5faa(0x192)+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x39b845[_0x5b5faa(0x16a)]+'/'+_0x39b845[_0x5b5faa(0x1ab)])),console[_0x5b5faa(0x162)]();const _0x31611f=[],_0x3bfecd=[],_0x4bda40=Date[_0x5b5faa(0x1d7)]();for(let _0x530cb0=0x0;_0x530cb0<_0x36796a['length'];_0x530cb0++){const _0x57595e=_0x36796a[_0x530cb0];_0x36796a['length']>0x1?console[_0x5b5faa(0x162)]('Test\x20'+(_0x530cb0+0x1)+'/'+_0x36796a[_0x5b5faa(0x1d9)]+':\x20'+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x57595e[_0x5b5faa(0x1df)])):console['log']('Running\x20test:\x20'+a5_0x5d7028[_0x5b5faa(0x1b2)](_0x57595e[_0x5b5faa(0x1df)]));const _0x1f8a0a=createCommandSpinner(_0x5b5faa(0x1e8)+_0x57595e[_0x5b5faa(0x17a)][_0x5b5faa(0x1d9)]+':\x20Sending\x20user\x20input...');_0x1f8a0a['start']();try{const {result:_0x5b69a2,conversation:_0x1e3efd}=await runTest(_0x40e0b3[_0x5b5faa(0x1b4)],_0x57595e,{'agentId':_0x274a58,'projectId':_0x178115,'site':_0x58a133,'noEval':_0x14f980,'evaluatorId':_0x2be255,'onRoundStart':(_0x5bca65,_0x1bdc3f)=>{const _0x2f901f=_0x5b5faa;_0x1f8a0a[_0x2f901f(0x1e4)]=_0x2f901f(0x1a4)+(_0x5bca65+0x1)+'/'+_0x1bdc3f+_0x2f901f(0x191);},'onRoundComplete':(_0x3a8901,_0x17aa26,_0x25ca13)=>{const _0x368656=_0x5b5faa,_0x210de7=formatElapsed(_0x17aa26);_0x25ca13?console['log'](_0x368656(0x18c)+(_0x3a8901+0x1)+'/'+_0x57595e['rounds'][_0x368656(0x1d9)]+_0x368656(0x176)+a5_0x5d7028[_0x368656(0x182)]('✓')+'\x20('+_0x210de7+')'):console[_0x368656(0x162)]('\x20\x20Round\x20'+(_0x3a8901+0x1)+'/'+_0x57595e['rounds'][_0x368656(0x1d9)]+_0x368656(0x176)+a5_0x5d7028[_0x368656(0x197)]('✗'));},'onEvaluationStart':()=>{const _0x5c7361=_0x5b5faa;_0x1f8a0a[_0x5c7361(0x1e4)]=_0x5c7361(0x1b7);},'onEvaluationComplete':_0x2fe3df=>{const _0x1bbfc4=_0x5b5faa,_0x2eb446=formatElapsed(_0x2fe3df);console[_0x1bbfc4(0x162)](_0x1bbfc4(0x1ee)+a5_0x5d7028['green']('✓')+'\x20('+_0x2eb446+')');}});_0x1f8a0a['stop'](),_0x31611f[_0x5b5faa(0x190)](_0x5b69a2),_0x3bfecd['push'](_0x1e3efd);if(_0x5b69a2[_0x5b5faa(0x171)]===_0x5b5faa(0x1a7))console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x182)](_0x5b5faa(0x1e0)+_0x5b69a2['reason']));else _0x5b69a2[_0x5b5faa(0x171)]===_0x5b5faa(0x1b8)?console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x1e3)+_0x5b69a2[_0x5b5faa(0x1db)])):console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x187)+_0x5b69a2[_0x5b5faa(0x1db)]));_0x5b69a2[_0x5b5faa(0x18f)]&&console[_0x5b5faa(0x162)](a5_0x5d7028['dim'](_0x5b5faa(0x1a5)+_0x5b69a2['conversation_url'])),console[_0x5b5faa(0x162)]();}catch(_0x188124){_0x1f8a0a[_0x5b5faa(0x1b1)]();const _0xe00d9c=_0x188124 instanceof Error?_0x188124['message']:String(_0x188124);console[_0x5b5faa(0x162)](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x187)+_0xe00d9c)),console[_0x5b5faa(0x162)](),_0x31611f['push']({'name':_0x57595e[_0x5b5faa(0x1df)],'status':_0x5b5faa(0x169),'reason':_0xe00d9c,'timestamp':new Date()[_0x5b5faa(0x172)](),'duration_ms':0x0});}}const _0x388400=Date[_0x5b5faa(0x1d7)]()-_0x4bda40,_0x48c7cd=_0x31611f[_0x5b5faa(0x19e)](_0x17c80f=>_0x17c80f[_0x5b5faa(0x171)]==='PASS')[_0x5b5faa(0x1d9)],_0x46fe79=_0x31611f['filter'](_0xa6c15a=>_0xa6c15a['status']===_0x5b5faa(0x1b8))['length'],_0x125518=_0x31611f[_0x5b5faa(0x19e)](_0x6f086a=>_0x6f086a[_0x5b5faa(0x171)]===_0x5b5faa(0x169))[_0x5b5faa(0x1d9)];console[_0x5b5faa(0x162)]('━'['repeat'](0x3c)),console[_0x5b5faa(0x162)]('Test\x20Summary'),console[_0x5b5faa(0x162)]('━'[_0x5b5faa(0x1da)](0x3c)),console[_0x5b5faa(0x162)](_0x5b5faa(0x1b9)+_0x31611f['length']),console[_0x5b5faa(0x162)]('Passed:\x20\x20\x20'+a5_0x5d7028[_0x5b5faa(0x182)](_0x48c7cd)),console[_0x5b5faa(0x162)](_0x5b5faa(0x194)+a5_0x5d7028[_0x5b5faa(0x197)](_0x46fe79));_0x125518>0x0&&console[_0x5b5faa(0x162)](_0x5b5faa(0x1ae)+a5_0x5d7028[_0x5b5faa(0x197)](_0x125518));console['log']('Duration:\x20'+formatElapsed(_0x388400)),console[_0x5b5faa(0x162)]('━'[_0x5b5faa(0x1da)](0x3c));const _0x3f67e3=_0x31611f[_0x5b5faa(0x19e)](_0x4e1b18=>_0x4e1b18[_0x5b5faa(0x171)]!=='PASS');if(_0x3f67e3[_0x5b5faa(0x1d9)]>0x0){console[_0x5b5faa(0x162)](),console['log'](_0x5b5faa(0x1d2));for(const _0x2e5390 of _0x3f67e3){const _0x1328f6=a5_0x5d7028[_0x5b5faa(0x197)]('✗'),_0x5183b6=_0x2e5390[_0x5b5faa(0x1db)]['length']>0x32?_0x2e5390[_0x5b5faa(0x1db)]['substring'](0x0,0x32)+'...':_0x2e5390[_0x5b5faa(0x1db)];console[_0x5b5faa(0x162)]('\x20\x20'+_0x1328f6+'\x20'+_0x2e5390['name']+':\x20'+_0x5183b6);}}const _0x11103b={'summary':{'total':_0x31611f[_0x5b5faa(0x1d9)],'passed':_0x48c7cd,'failed':_0x46fe79,'errors':_0x125518>0x0?_0x125518:undefined,'duration_ms':_0x388400},'tests':_0x31611f,'agent':{'project':_0x39b845['projectName'],'name':_0x39b845[_0x5b5faa(0x1ab)],'site':_0x58a133},'timestamp':new Date(_0x4bda40)[_0x5b5faa(0x172)]()};try{const _0x2187c2=buildCachedTestRun(_0x3bfecd,{'site':_0x58a133,'projectId':_0x178115,'projectName':_0x39b845['projectName'],'agentId':_0x274a58,'agentName':_0x39b845[_0x5b5faa(0x1ab)],'testYmlPath':a5_0x49f0f7[_0x5b5faa(0x1e2)](_0x39b845[_0x5b5faa(0x19d)])});saveLastTestRun(_0x2187c2);}catch{}if(_0x5122ee!==_0x5b5faa(0x17e)||_0x3b9a18){const _0x13bec9=formatResults(_0x11103b,_0x5122ee);if(_0x3b9a18)try{a5_0x30e4c0[_0x5b5faa(0x18e)](_0x3b9a18,_0x13bec9,_0x5b5faa(0x1e6)),console[_0x5b5faa(0x162)](),console[_0x5b5faa(0x162)](a5_0x5d7028['dim'](_0x5b5faa(0x1b3)+_0x3b9a18));}catch(_0x54f1ee){return console[_0x5b5faa(0x162)](),console['log'](a5_0x5d7028[_0x5b5faa(0x197)](_0x5b5faa(0x185)+_0x54f1ee)),0x1;}else console[_0x5b5faa(0x162)](),console[_0x5b5faa(0x162)](_0x13bec9);}return _0x3f67e3[_0x5b5faa(0x1d9)]>0x0?0x1:0x0;}async[a5_0x5808b5(0x165)](_0x3066fe,_0x1165ac){const _0x244585=a5_0x5808b5,{options:_0x2fef80,tdx:_0x123c63}=_0x3066fe,{definition:_0x1f55d5,agentInfo:_0x4e284f,outputFormat:_0x4e7c3f,outputFile:_0x2ad804}=_0x1165ac,_0xf2b3c6=_0x2fef80['site'],_0x4dd560=loadLastTestRun();if(!_0x4dd560)return console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x197)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x244585(0x162)](a5_0x5d7028['dim'](_0x244585(0x1aa))),0x1;if(_0x4dd560[_0x244585(0x1e1)]['agentName']!==_0x4e284f['agentName'])return console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x197)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4dd560[_0x244585(0x1e1)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4e284f[_0x244585(0x1ab)]+'\x22.')),console[_0x244585(0x162)](a5_0x5d7028['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x342e61=new Set(_0x4dd560['conversations'][_0x244585(0x1bc)](_0x55e0ab=>_0x55e0ab[_0x244585(0x1a9)])),_0x314f52=_0x1f55d5['tests']['filter'](_0xd6b7a=>!_0x342e61[_0x244585(0x1ba)](_0xd6b7a[_0x244585(0x1df)]));if(_0x314f52[_0x244585(0x1d9)]>0x0&&_0x4dd560['site']!==_0xf2b3c6)return console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x197)](_0x244585(0x198))),console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x173)](_0x244585(0x1c3)+_0x4dd560[_0x244585(0x1ef)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0xf2b3c6+'\x22.')),console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x173)](_0x244585(0x1a8)+_0x4dd560[_0x244585(0x1ef)]+_0x244585(0x1d1))),0x1;const _0x245fc4=_0x1f55d5[_0x244585(0x1d3)][_0x244585(0x19e)](_0x25c04f=>_0x342e61[_0x244585(0x1ba)](_0x25c04f[_0x244585(0x1df)])),_0x446d4d=_0x314f52;let _0x5dee76;try{_0x5dee76=await setupEvaluatorAgent(_0x123c63[_0x244585(0x1b4)],_0x2fef80[_0x244585(0x16e)]);}catch(_0x267fcd){const _0x2fd6b6=_0x267fcd instanceof Error?_0x267fcd[_0x244585(0x1e5)]:String(_0x267fcd);return console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x197)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2fd6b6)),0x1;}console['log'](a5_0x5d7028['cyan'](_0x244585(0x175))),console[_0x244585(0x162)](_0x244585(0x1a2)+a5_0x5d7028[_0x244585(0x1b2)](_0x4dd560[_0x244585(0x1be)])),console[_0x244585(0x162)](_0x244585(0x192)+a5_0x5d7028[_0x244585(0x1b2)](_0x4dd560['agent'][_0x244585(0x16a)]+'/'+_0x4dd560['agent'][_0x244585(0x1ab)]));_0x446d4d[_0x244585(0x1d9)]>0x0&&console[_0x244585(0x162)](_0x244585(0x1bd)+a5_0x5d7028[_0x244585(0x1c9)](_0x446d4d[_0x244585(0x1d9)]));console[_0x244585(0x162)]();const _0x2ab29d=[],_0x89516d=Date[_0x244585(0x1d7)](),_0x426fa5=createCommandSpinner(_0x244585(0x19a));if(_0x245fc4[_0x244585(0x1d9)]>0x0)try{const _0x1e69a9=await reevaluateFromCache(_0x123c63['llm'],_0x4dd560,{'tests':_0x245fc4},{'evaluatorId':_0x5dee76,'onTestStart':(_0x21c0e0,_0x2f95de,_0x1677a7)=>{const _0x28c8db=_0x244585;_0x426fa5[_0x28c8db(0x1e4)]=_0x28c8db(0x1b6)+(_0x2f95de+0x1)+'/'+_0x1677a7+':\x20'+_0x21c0e0+_0x28c8db(0x183);if(!_0x426fa5[_0x28c8db(0x1cd)])_0x426fa5['start']();},'onTestComplete':(_0x3d8d4d,_0x33260e)=>{const _0x5f3dd4=_0x244585;_0x426fa5[_0x5f3dd4(0x1b1)]();if(_0x33260e[_0x5f3dd4(0x171)]===_0x5f3dd4(0x1a7))console[_0x5f3dd4(0x162)](a5_0x5d7028[_0x5f3dd4(0x182)](_0x5f3dd4(0x1e0)+_0x3d8d4d)+a5_0x5d7028[_0x5f3dd4(0x173)](_0x5f3dd4(0x1c0)));else _0x33260e['status']==='FAIL'?console[_0x5f3dd4(0x162)](a5_0x5d7028['red'](_0x5f3dd4(0x1e3)+_0x3d8d4d+_0x5f3dd4(0x189)+_0x33260e[_0x5f3dd4(0x1db)])+a5_0x5d7028[_0x5f3dd4(0x173)](_0x5f3dd4(0x1c0))):console[_0x5f3dd4(0x162)](a5_0x5d7028[_0x5f3dd4(0x197)](_0x5f3dd4(0x187)+_0x3d8d4d+_0x5f3dd4(0x189)+_0x33260e['reason']));_0x33260e['conversation_url']&&console[_0x5f3dd4(0x162)](a5_0x5d7028['dim'](_0x5f3dd4(0x1ac)+_0x33260e[_0x5f3dd4(0x18f)])),_0x2ab29d[_0x5f3dd4(0x190)](_0x33260e);},'onTestSkipped':(_0x34ca89,_0x197981)=>{const _0x15d85c=_0x244585;_0x426fa5[_0x15d85c(0x1b1)](),console['log'](a5_0x5d7028[_0x15d85c(0x1c9)](_0x15d85c(0x166)+_0x34ca89+'\x20-\x20'+_0x197981));}});for(const _0x3154c0 of _0x1e69a9){!_0x2ab29d[_0x244585(0x1bf)](_0x2bd994=>_0x2bd994['name']===_0x3154c0[_0x244585(0x1df)])&&_0x2ab29d[_0x244585(0x190)](_0x3154c0);}}catch(_0x1f3970){_0x426fa5[_0x244585(0x1b1)]();const _0x25f3d8=_0x1f3970 instanceof Error?_0x1f3970[_0x244585(0x1e5)]:String(_0x1f3970);return console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x197)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x25f3d8)),0x1;}_0x426fa5['stop']();if(_0x446d4d['length']>0x0){console[_0x244585(0x162)](),console['log'](a5_0x5d7028['cyan'](_0x244585(0x1c6)));const {projectId:_0x5cd28f,agentId:_0x3beca4}=_0x4dd560[_0x244585(0x1e1)];for(const _0x1aa8b4 of _0x446d4d){console[_0x244585(0x162)]('Running:\x20'+a5_0x5d7028[_0x244585(0x1b2)](_0x1aa8b4[_0x244585(0x1df)]));const _0x457d0a=createCommandSpinner('Round\x201/'+_0x1aa8b4['rounds'][_0x244585(0x1d9)]+':\x20Sending\x20user\x20input...');_0x457d0a[_0x244585(0x179)]();try{const {result:_0x4a79b1}=await runTest(_0x123c63[_0x244585(0x1b4)],_0x1aa8b4,{'agentId':_0x3beca4,'projectId':_0x5cd28f,'site':_0x4dd560[_0x244585(0x1ef)],'noEval':![],'evaluatorId':_0x5dee76,'onRoundStart':(_0x4a416b,_0x371706)=>{const _0x115be4=_0x244585;_0x457d0a['text']=_0x115be4(0x1a4)+(_0x4a416b+0x1)+'/'+_0x371706+_0x115be4(0x191);},'onRoundComplete':(_0x2ba9ff,_0x50d880,_0x23033a)=>{const _0x5545a9=_0x244585,_0x420785=formatElapsed(_0x50d880);_0x23033a?console[_0x5545a9(0x162)](_0x5545a9(0x18c)+(_0x2ba9ff+0x1)+'/'+_0x1aa8b4[_0x5545a9(0x17a)]['length']+'...\x20'+a5_0x5d7028[_0x5545a9(0x182)]('✓')+'\x20('+_0x420785+')'):console[_0x5545a9(0x162)](_0x5545a9(0x18c)+(_0x2ba9ff+0x1)+'/'+_0x1aa8b4[_0x5545a9(0x17a)][_0x5545a9(0x1d9)]+_0x5545a9(0x176)+a5_0x5d7028[_0x5545a9(0x197)]('✗'));},'onEvaluationStart':()=>{const _0x1a50d0=_0x244585;_0x457d0a['text']=_0x1a50d0(0x1b7);},'onEvaluationComplete':_0x219132=>{const _0x206ecd=_0x244585,_0x3e78f2=formatElapsed(_0x219132);console[_0x206ecd(0x162)]('\x20\x20Evaluating...\x20'+a5_0x5d7028[_0x206ecd(0x182)]('✓')+'\x20('+_0x3e78f2+')');}});_0x457d0a[_0x244585(0x1b1)](),_0x2ab29d[_0x244585(0x190)](_0x4a79b1);if(_0x4a79b1[_0x244585(0x171)]==='PASS')console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x182)](_0x244585(0x1e0)+_0x4a79b1[_0x244585(0x1db)])+a5_0x5d7028[_0x244585(0x173)](_0x244585(0x1f5)));else _0x4a79b1[_0x244585(0x171)]===_0x244585(0x1b8)?console[_0x244585(0x162)](a5_0x5d7028['red'](_0x244585(0x1e3)+_0x4a79b1[_0x244585(0x1db)])+a5_0x5d7028['dim'](_0x244585(0x1f5))):console['log'](a5_0x5d7028[_0x244585(0x197)](_0x244585(0x187)+_0x4a79b1[_0x244585(0x1db)]));_0x4a79b1[_0x244585(0x18f)]&&console[_0x244585(0x162)](a5_0x5d7028['dim'](_0x244585(0x1ac)+_0x4a79b1[_0x244585(0x18f)]));}catch(_0x10226a){_0x457d0a[_0x244585(0x1b1)]();const _0x21bc0b=_0x10226a instanceof Error?_0x10226a[_0x244585(0x1e5)]:String(_0x10226a);console['log'](a5_0x5d7028[_0x244585(0x197)](_0x244585(0x187)+_0x21bc0b)),_0x2ab29d[_0x244585(0x190)]({'name':_0x1aa8b4['name'],'status':_0x244585(0x169),'reason':_0x21bc0b,'timestamp':new Date()[_0x244585(0x172)](),'duration_ms':0x0});}}}console[_0x244585(0x162)]();const _0x294e32=Date[_0x244585(0x1d7)]()-_0x89516d,_0xaacadb=_0x2ab29d[_0x244585(0x19e)](_0x2f3a0f=>_0x2f3a0f['status']==='PASS')[_0x244585(0x1d9)],_0xa4c574=_0x2ab29d[_0x244585(0x19e)](_0x1673b9=>_0x1673b9[_0x244585(0x171)]===_0x244585(0x1b8))[_0x244585(0x1d9)],_0x3a542f=_0x2ab29d[_0x244585(0x19e)](_0x33bfeb=>_0x33bfeb[_0x244585(0x171)]===_0x244585(0x169))[_0x244585(0x1d9)];console[_0x244585(0x162)]('━'[_0x244585(0x1da)](0x3c)),console[_0x244585(0x162)](_0x244585(0x1ed)),console[_0x244585(0x162)]('━'[_0x244585(0x1da)](0x3c)),console[_0x244585(0x162)](_0x244585(0x1b9)+_0x2ab29d['length']),console[_0x244585(0x162)](_0x244585(0x1c2)+a5_0x5d7028[_0x244585(0x182)](_0xaacadb)),console[_0x244585(0x162)](_0x244585(0x194)+a5_0x5d7028[_0x244585(0x197)](_0xa4c574));_0x3a542f>0x0&&console[_0x244585(0x162)]('Errors:\x20\x20\x20'+a5_0x5d7028['red'](_0x3a542f));console[_0x244585(0x162)]('Duration:\x20'+formatElapsed(_0x294e32)),console[_0x244585(0x162)]('━'[_0x244585(0x1da)](0x3c));const _0x1ad95c={'summary':{'total':_0x2ab29d['length'],'passed':_0xaacadb,'failed':_0xa4c574,'errors':_0x3a542f>0x0?_0x3a542f:undefined,'duration_ms':_0x294e32},'tests':_0x2ab29d,'agent':{'project':_0x4e284f[_0x244585(0x16a)],'name':_0x4e284f[_0x244585(0x1ab)],'site':_0xf2b3c6},'timestamp':new Date(_0x89516d)[_0x244585(0x172)]()};if(_0x4e7c3f!==_0x244585(0x17e)||_0x2ad804){const _0x56a845=formatResults(_0x1ad95c,_0x4e7c3f);if(_0x2ad804)try{a5_0x30e4c0[_0x244585(0x18e)](_0x2ad804,_0x56a845,_0x244585(0x1e6)),console[_0x244585(0x162)](),console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x173)](_0x244585(0x1b3)+_0x2ad804));}catch(_0x1cb9f6){return console[_0x244585(0x162)](),console[_0x244585(0x162)](a5_0x5d7028[_0x244585(0x197)](_0x244585(0x185)+_0x1cb9f6)),0x1;}else console[_0x244585(0x162)](),console[_0x244585(0x162)](_0x56a845);}const _0x10c4d3=_0x2ab29d[_0x244585(0x19e)](_0x14c453=>_0x14c453[_0x244585(0x171)]!=='PASS');return _0x10c4d3[_0x244585(0x1d9)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x13dda2=a6_0x12da;(function(_0x1d6e96,_0x3457b9){const _0x382095=a6_0x12da,_0x455ee3=_0x1d6e96();while(!![]){try{const _0x23e527=parseInt(_0x382095(0x20d))/0x1+-parseInt(_0x382095(0x1fd))/0x2*(parseInt(_0x382095(0x1e8))/0x3)+parseInt(_0x382095(0x20b))/0x4*(-parseInt(_0x382095(0x1ec))/0x5)+-parseInt(_0x382095(0x20f))/0x6+-parseInt(_0x382095(0x1f8))/0x7*(-parseInt(_0x382095(0x1f3))/0x8)+-parseInt(_0x382095(0x219))/0x9*(parseInt(_0x382095(0x1ee))/0xa)+parseInt(_0x382095(0x1f2))/0xb;if(_0x23e527===_0x3457b9)break;else _0x455ee3['push'](_0x455ee3['shift']());}catch(_0x3b7993){_0x455ee3['push'](_0x455ee3['shift']());}}}(a6_0xb02f,0xe7cf6));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x12da(_0x21682a,_0x51b53c){_0x21682a=_0x21682a-0x1e1;const _0xb02f8f=a6_0xb02f();let _0x12dafd=_0xb02f8f[_0x21682a];return _0x12dafd;}const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization',a6_0x13dda2(0x1e1),a6_0x13dda2(0x216),a6_0x13dda2(0x202),'x-xsrf-token',a6_0x13dda2(0x21a),'x-trino-user']);function isSensitiveHeader(_0x4ddc8c){const _0x149f88=a6_0x13dda2;return SENSITIVE_HEADERS['has'](_0x4ddc8c[_0x149f88(0x1f9)]());}function a6_0xb02f(){const _0x46b7f6=['Endpoint\x20must\x20start\x20with\x20/:\x20','llm-proxy','length','set-cookie','cdp','status','739215PnZSVB','x-auth-token','indexOf','color','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Results\x20saved\x20to\x20','cookie','validate','llm','isArray','.\x20Valid\x20types:\x20','trim','verbose','1011NPEwpn','Error:\x20','Invalid\x20API\x20type:\x20','headers','190Jcdgnu','substring','40PJBVgI','body','GET','stack','54063416AlHciE','1909736HdtPOl','name','site','output','DELETE','7dShNeS','toLowerCase','type','file','toUpperCase','5786LHrtfU','error','readBodyFromFile','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','POST','set-cookie2','entries','request','data','header','noColor','join','api','.\x20Valid\x20methods:\x20','156532WVuBuo','trino','215347gYJbsy','log','9773346UofLys','\x0aStack\x20trace:\x0a','Invalid\x20header\x20format:\x20\x22','message'];a6_0xb02f=function(){return _0x46b7f6;};return a6_0xb02f();}function parseHeader(_0x5264ed){const _0x54634d=a6_0x13dda2,_0x552c6e=_0x5264ed[_0x54634d(0x21b)](':');if(_0x552c6e===-0x1)throw new Error(_0x54634d(0x211)+_0x5264ed+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x5662a9=_0x5264ed[_0x54634d(0x1ed)](0x0,_0x552c6e)[_0x54634d(0x1e6)](),_0x4a2893=_0x5264ed[_0x54634d(0x1ed)](_0x552c6e+0x1)[_0x54634d(0x1e6)]();if(!_0x5662a9)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5264ed+'\x22');return[_0x5662a9,_0x4a2893];}export class ApiCommand extends BaseCommand{[a6_0x13dda2(0x1f4)]='api';['description']=a6_0x13dda2(0x200);[a6_0x13dda2(0x1e2)](_0x2f64e3){const _0x5370b9=a6_0x13dda2,{args:_0xe64daf,options:_0x5c5581}=_0x2f64e3,_0x259187=_0x5c5581;if(_0xe64daf['length']===0x0)return _0x5370b9(0x21d);const _0x145bd=_0xe64daf[0x0];if(!_0x145bd['startsWith']('/'))return _0x5370b9(0x213)+_0x145bd;const _0x42cd0f=_0x259187['data'],_0xcf22f0=_0x259187['file'];if(_0x42cd0f&&_0xcf22f0)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x1b1fe1=_0x259187['method']||_0x5370b9(0x1f0),_0x141ac2=[_0x5370b9(0x1f0),_0x5370b9(0x201),'PUT',_0x5370b9(0x1f7),'PATCH'];if(!_0x141ac2['includes'](_0x1b1fe1[_0x5370b9(0x1fc)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x1b1fe1+_0x5370b9(0x20a)+_0x141ac2[_0x5370b9(0x208)](',\x20');const _0x472f6b=_0x259187[_0x5370b9(0x1fa)]||'td',_0x375eb9=['td',_0x5370b9(0x217),'workflow',_0x5370b9(0x20c),_0x5370b9(0x1e3),_0x5370b9(0x214)];if(!_0x375eb9['includes'](_0x472f6b))return _0x5370b9(0x1ea)+_0x472f6b+_0x5370b9(0x1e5)+_0x375eb9[_0x5370b9(0x208)](',\x20');return undefined;}async['execute'](_0x3b91c3){const _0x266c1e=a6_0x13dda2,{options:_0x5d9ee3,args:_0xf93a68,tdx:_0xb2758}=_0x3b91c3,_0x241fac=_0x5d9ee3,_0x3df282=_0xf93a68[0x0],_0x417550=(_0x241fac['method']||'GET')['toUpperCase'](),_0x8a4e00=_0x241fac['data'],_0x47f0df=_0x241fac[_0x266c1e(0x1fb)],_0xe3731=_0x241fac[_0x266c1e(0x206)],_0x31ee26=_0x241fac['type']||'td';try{const _0x2ea628={};if(_0xe3731){const _0x4da1df=Array[_0x266c1e(0x1e4)](_0xe3731)?_0xe3731:[_0xe3731];for(const _0x4423ef of _0x4da1df){const [_0x1b7f04,_0x4cc3e4]=parseHeader(_0x4423ef);_0x2ea628[_0x1b7f04]=_0x4cc3e4;}}let _0x53ebc9;if(_0x8a4e00)_0x53ebc9=_0x8a4e00;else{if(_0x47f0df)try{_0x53ebc9=RawAPI[_0x266c1e(0x1ff)](_0x47f0df);}catch(_0xb01c7){return console[_0x266c1e(0x1fe)]('Error:\x20'+(_0xb01c7 instanceof Error?_0xb01c7[_0x266c1e(0x212)]:String(_0xb01c7))),0x1;}}const _0x5cb846={'method':_0x417550,'apiType':_0x31ee26,'includeHeaders':_0x5d9ee3[_0x266c1e(0x1e7)]};_0x53ebc9&&(_0x5cb846[_0x266c1e(0x1ef)]=_0x53ebc9);Object['keys'](_0x2ea628)[_0x266c1e(0x215)]>0x0&&(_0x5cb846['headers']=_0x2ea628);if(_0x5d9ee3[_0x266c1e(0x1e7)]){const _0x31736b=resolveSite(_0x5d9ee3[_0x266c1e(0x1f5)]),_0x2c0b1e=getEndpoint(_0x31736b,_0x31ee26),_0x4c363f=''+_0x2c0b1e+_0x3df282;console['error']('>\x20'+_0x417550+'\x20'+_0x4c363f);const _0x491174=getAuthHeaders(_0x31736b),_0x4767eb={..._0x491174,..._0x2ea628};for(const [_0x54a7aa,_0x374605]of Object[_0x266c1e(0x203)](_0x4767eb)){!isSensitiveHeader(_0x54a7aa)&&console[_0x266c1e(0x1fe)]('>\x20'+_0x54a7aa+':\x20'+_0x374605);}_0x53ebc9&&console[_0x266c1e(0x1fe)]('>'),console['error']('');}const _0x578ce9=await _0xb2758[_0x266c1e(0x209)][_0x266c1e(0x204)](_0x3df282,_0x5cb846);if(_0x5d9ee3['verbose']&&_0x578ce9[_0x266c1e(0x1eb)]){console[_0x266c1e(0x1fe)]('<\x20HTTP/1.1\x20'+_0x578ce9[_0x266c1e(0x218)]);for(const [_0x2c316e,_0x31765e]of Object[_0x266c1e(0x203)](_0x578ce9[_0x266c1e(0x1eb)])){!isSensitiveHeader(_0x2c316e)&&console[_0x266c1e(0x1fe)]('<\x20'+_0x2c316e+':\x20'+_0x31765e);}console[_0x266c1e(0x1fe)]('');}const _0xc8488b=Boolean(_0x5d9ee3[_0x266c1e(0x1f6)]),_0x37ec9b={'color':_0x5d9ee3[_0x266c1e(0x21c)],'noColor':_0x5d9ee3[_0x266c1e(0x207)]||_0xc8488b&&!_0x5d9ee3[_0x266c1e(0x21c)]},_0x3e3b89=colorizeJSON(_0x578ce9[_0x266c1e(0x205)],_0x37ec9b);return _0x5d9ee3['output']?(writeFileSync(_0x5d9ee3['output'],_0x3e3b89),console[_0x266c1e(0x1fe)](_0x266c1e(0x21e)+_0x5d9ee3[_0x266c1e(0x1f6)])):console[_0x266c1e(0x20e)](_0x3e3b89),0x0;}catch(_0x2d10f9){return _0x2d10f9 instanceof Error?(console['error'](_0x266c1e(0x1e9)+_0x2d10f9[_0x266c1e(0x212)]),_0x5d9ee3[_0x266c1e(0x1e7)]&&_0x2d10f9[_0x266c1e(0x1f1)]&&console[_0x266c1e(0x1fe)](_0x266c1e(0x210)+_0x2d10f9[_0x266c1e(0x1f1)])):console[_0x266c1e(0x1fe)](_0x266c1e(0x1e9)+String(_0x2d10f9)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x43f9ab=a7_0x1eaf;(function(_0x394432,_0x457e5c){const _0xdb7663=a7_0x1eaf,_0x1b6db3=_0x394432();while(!![]){try{const _0x18154f=-parseInt(_0xdb7663(0x16a))/0x1+-parseInt(_0xdb7663(0x166))/0x2*(parseInt(_0xdb7663(0x141))/0x3)+parseInt(_0xdb7663(0x152))/0x4+parseInt(_0xdb7663(0x15c))/0x5*(parseInt(_0xdb7663(0x16c))/0x6)+-parseInt(_0xdb7663(0x16d))/0x7*(parseInt(_0xdb7663(0x14a))/0x8)+parseInt(_0xdb7663(0x137))/0x9*(parseInt(_0xdb7663(0x12a))/0xa)+parseInt(_0xdb7663(0x164))/0xb;if(_0x18154f===_0x457e5c)break;else _0x1b6db3['push'](_0x1b6db3['shift']());}catch(_0xa5e7ac){_0x1b6db3['push'](_0x1b6db3['shift']());}}}(a7_0x4ad2,0x42576));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x4ad2(){const _0x70304a=['1442304pRdVSV','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Setting\x20up\x20authentication\x20for\x20site:\x20','filter','jobs','auth','/app/mp/ak','tdx:\x20auth\x20clear','\x20(profile:\x20','getUserInfo','605eMbCsw','site','apiKey','warn','Setup\x20API\x20key\x20authentication\x20interactively','bold','log','select','7003733AlWNAW','message','908882WMUqVZ','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','description','\x20removed\x20from\x20keychain','335050KSeXgE','logLevel','13182snYQaZ','11046lmbWFW','yellow','email','You\x20can\x20find\x20your\x20API\x20key\x20at:','method','✗\x20Validation\x20failed:\x20','Validating\x20API\x20key...','✓\x20Default\x20site\x20set\x20to\x20','ERROR','30YbUPbz','first_name','status','✓\x20Profile\x20\x27','last_name','\x20for\x20profile:\x20','profile','error','Enter\x20your\x20TD\x20API\x20key:','\x27\x20registered','password','System\x20keychain\x20is\x20not\x20available','green','544689dEhMdR','No\x20credential\x20found','\x20\x20tdx','API\x20key\x20cannot\x20be\x20empty','OAuth\x20(browser\x20login)','trim','\x0aSetup\x20cancelled','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','execute','N/A','3MRPpTV','Remove\x20API\x20key\x20from\x20system\x20keychain','red','tdx\x20profile:\x20','tdx:\x20auth\x20setup','all','us01','Credential\x20type:\x20OAuth','join','1944uLqFBy','\x20and\x20','apikey','API\x20key','auth:setup','name','oauth','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'];a7_0x4ad2=function(){return _0x70304a;};return a7_0x4ad2();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x5952c2 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a7_0x1eaf(_0xb16ca9,_0x3a8237){_0xb16ca9=_0xb16ca9-0x124;const _0x4ad2fb=a7_0x4ad2();let _0x1eafcd=_0x4ad2fb[_0xb16ca9];return _0x1eafcd;}import a7_0x1e518c from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x43f9ab(0x14e);['description']=a7_0x43f9ab(0x160);async['execute'](_0x5a4ef8){const _0x2dfd7e=a7_0x43f9ab,{options:_0x1f2bcf}=_0x5a4ef8,_0x22fcb4=_0x1f2bcf[_0x2dfd7e(0x130)];console[_0x2dfd7e(0x162)](a7_0x1e518c[_0x2dfd7e(0x161)](_0x2dfd7e(0x145)));const _0x8b4973=_0x1f2bcf[_0x2dfd7e(0x15d)]||_0x2dfd7e(0x147),_0x31e322=await promptSiteSelection(_0x8b4973,_0x22fcb4,'Setup\x20cancelled');if(!_0x31e322)return 0x1;const _0x19aa0c=resolveSite(_0x31e322);if(isOAuthSupported(_0x19aa0c)){const _0x49d3ce=await a7_0x5952c2({'type':_0x2dfd7e(0x163),'name':_0x2dfd7e(0x125),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x2dfd7e(0x13b),'value':_0x2dfd7e(0x150)},{'title':'API\x20Key','value':_0x2dfd7e(0x14c)}]});if(!_0x49d3ce[_0x2dfd7e(0x125)])return console[_0x2dfd7e(0x162)](_0x2dfd7e(0x13d)),0x1;if(_0x49d3ce[_0x2dfd7e(0x125)]===_0x2dfd7e(0x150))return await runOAuthLoginFlow(_0x19aa0c,_0x22fcb4,_0x1f2bcf[_0x2dfd7e(0x16b)]??LogLevel[_0x2dfd7e(0x129)]),0x0;}console[_0x2dfd7e(0x162)](_0x2dfd7e(0x154)+_0x19aa0c),console[_0x2dfd7e(0x162)](_0x2dfd7e(0x124)),console[_0x2dfd7e(0x162)]('\x20\x20'+getConsoleUrl(_0x19aa0c,_0x2dfd7e(0x158)));const _0x21fbe2=await a7_0x5952c2({'type':_0x2dfd7e(0x134),'name':_0x2dfd7e(0x15e),'message':_0x2dfd7e(0x132),'validate':_0x1b89e9=>{const _0x199019=_0x2dfd7e;if(!_0x1b89e9||!_0x1b89e9['trim']())return _0x199019(0x13a);return!![];}});if(!_0x21fbe2[_0x2dfd7e(0x15e)])return console[_0x2dfd7e(0x162)](_0x2dfd7e(0x13d)),0x1;const _0x51367d=_0x21fbe2[_0x2dfd7e(0x15e)];console[_0x2dfd7e(0x162)](_0x2dfd7e(0x127));try{const _0x3bfe70=TDX['create']({'site':_0x19aa0c,'apiKey':_0x51367d[_0x2dfd7e(0x13c)](),'logLevel':_0x1f2bcf[_0x2dfd7e(0x16b)]??LogLevel[_0x2dfd7e(0x129)]}),_0x16190e=await _0x3bfe70[_0x2dfd7e(0x156)]['getUserInfo']();console[_0x2dfd7e(0x162)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x16190e[_0x2dfd7e(0x16f)]+')');const _0x2c54f2=await isKeychainAvailable();_0x2c54f2?(await saveAPIKeyAsync(_0x51367d[_0x2dfd7e(0x13c)](),_0x19aa0c,_0x22fcb4),console[_0x2dfd7e(0x162)](_0x2dfd7e(0x13e)+(_0x22fcb4?_0x2dfd7e(0x15a)+_0x22fcb4+')':''))):(console[_0x2dfd7e(0x15f)](a7_0x1e518c[_0x2dfd7e(0x16e)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x2dfd7e(0x15f)](a7_0x1e518c[_0x2dfd7e(0x16e)](_0x2dfd7e(0x167))));if(_0x22fcb4){const _0x34963b={'site':_0x19aa0c};saveProfileToUserConfig(_0x22fcb4,_0x34963b),console[_0x2dfd7e(0x162)](_0x2dfd7e(0x12d)+_0x22fcb4+_0x2dfd7e(0x133));}else saveDefaultSiteToUserConfig(_0x19aa0c),console[_0x2dfd7e(0x162)](_0x2dfd7e(0x128)+_0x19aa0c);const _0x1aff3f=_0x22fcb4?'\x20--profile\x20'+_0x22fcb4:'';return console['log'](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x2dfd7e(0x162)]('\x20\x20tdx'+_0x1aff3f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x2dfd7e(0x139)+_0x1aff3f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x391adf){if(_0x391adf instanceof HTTPClientError&&_0x391adf[_0x2dfd7e(0x12c)]===0x191)return printAuthError(_0x391adf),0x1;return console[_0x2dfd7e(0x131)](a7_0x1e518c[_0x2dfd7e(0x143)]('✗\x20Validation\x20failed:\x20'+(_0x391adf instanceof Error?_0x391adf[_0x2dfd7e(0x165)]:String(_0x391adf)))),console['error'](_0x2dfd7e(0x151)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x43f9ab(0x14f)]=a7_0x43f9ab(0x157);[a7_0x43f9ab(0x168)]=a7_0x43f9ab(0x153);async[a7_0x43f9ab(0x13f)](_0x5928f0){const _0x2792e3=a7_0x43f9ab,{options:_0x3f9297,tdx:_0x52c10c}=_0x5928f0,_0xa767f2=_0x3f9297[_0x2792e3(0x15d)],_0x41e560=_0x3f9297['profile'],_0x2d7a9c=_0x41e560?_0x41e560:_0x2792e3(0x140);console[_0x2792e3(0x162)](_0x2792e3(0x144)+_0x2d7a9c+'\x20(site:\x20'+_0xa767f2+')');const _0x3dc97b=await getOAuthTokens(_0x41e560);if(_0x3dc97b)console[_0x2792e3(0x162)](_0x2792e3(0x148)),console[_0x2792e3(0x162)]('Read\x20credential\x20from\x20keychain'+(_0x41e560?_0x2792e3(0x15a)+_0x41e560+')':''));else{const _0xe1a79=await resolveAPIKeyAsync(_0xa767f2,_0x41e560);if(_0xe1a79){const {source:_0x39bfba,isDeprecated:_0x29c76c}=_0xe1a79,_0x298cb4='Read\x20credential\x20from\x20'+_0x39bfba;console[_0x2792e3(0x162)](_0x29c76c?a7_0x1e518c['yellow'](_0x298cb4):_0x298cb4);}else console['log'](a7_0x1e518c[_0x2792e3(0x16e)](_0x2792e3(0x138)));}try{const _0x14f4f1=await _0x52c10c[_0x2792e3(0x156)][_0x2792e3(0x15b)]();return console[_0x2792e3(0x162)](a7_0x1e518c[_0x2792e3(0x136)]('✓\x20Authentication\x20successful\x0a')),console[_0x2792e3(0x162)]('User:\x20'+_0x14f4f1[_0x2792e3(0x16f)]),(_0x14f4f1['first_name']||_0x14f4f1['last_name'])&&console[_0x2792e3(0x162)]('Name:\x20'+[_0x14f4f1[_0x2792e3(0x12b)],_0x14f4f1[_0x2792e3(0x12e)]][_0x2792e3(0x155)](Boolean)[_0x2792e3(0x149)]('\x20')),0x0;}catch(_0x37fd12){return _0x37fd12 instanceof HTTPClientError&&_0x37fd12[_0x2792e3(0x12c)]===0x191?printAuthError(_0x37fd12,!![],_0x41e560):console[_0x2792e3(0x131)](a7_0x1e518c[_0x2792e3(0x143)](_0x2792e3(0x126)+(_0x37fd12 instanceof Error?_0x37fd12[_0x2792e3(0x165)]:String(_0x37fd12)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x43f9ab(0x14f)]='auth:clear';[a7_0x43f9ab(0x168)]=a7_0x43f9ab(0x142);async[a7_0x43f9ab(0x13f)](_0x22c058){const _0x11805e=a7_0x43f9ab,{options:_0x3cc143}=_0x22c058,_0x370734=_0x3cc143[_0x11805e(0x130)];console[_0x11805e(0x162)](a7_0x1e518c[_0x11805e(0x161)](_0x11805e(0x159)));const _0x42412f=await isKeychainAvailable();if(!_0x42412f)return console[_0x11805e(0x131)](a7_0x1e518c[_0x11805e(0x143)](_0x11805e(0x135))),0x1;const [_0x43fed9,_0x23272b]=await Promise[_0x11805e(0x146)]([deleteKeychainAPIKey(_0x370734),deleteOAuthTokens(_0x370734)]);if(_0x43fed9||_0x23272b){clearCredentialCache();const _0x45d30e=[_0x43fed9&&_0x11805e(0x14d),_0x23272b&&'OAuth\x20tokens'][_0x11805e(0x155)](Boolean)['join'](_0x11805e(0x14b));return console['log']('✓\x20'+_0x45d30e+_0x11805e(0x169)+(_0x370734?_0x11805e(0x15a)+_0x370734+')':'')),0x0;}else return console[_0x11805e(0x162)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x370734?_0x11805e(0x12f)+_0x370734:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0xb8ee83=a8_0x55b9;(function(_0x56b6d1,_0x42f5e0){const _0x538ea5=a8_0x55b9,_0x1b9952=_0x56b6d1();while(!![]){try{const _0x507a2b=parseInt(_0x538ea5(0x1e7))/0x1+-parseInt(_0x538ea5(0x1d9))/0x2*(parseInt(_0x538ea5(0x1db))/0x3)+-parseInt(_0x538ea5(0x1f0))/0x4+parseInt(_0x538ea5(0x1de))/0x5+parseInt(_0x538ea5(0x1e5))/0x6*(parseInt(_0x538ea5(0x1eb))/0x7)+-parseInt(_0x538ea5(0x1e4))/0x8*(-parseInt(_0x538ea5(0x1dd))/0x9)+-parseInt(_0x538ea5(0x1f5))/0xa;if(_0x507a2b===_0x42f5e0)break;else _0x1b9952['push'](_0x1b9952['shift']());}catch(_0x34886a){_0x1b9952['push'](_0x1b9952['shift']());}}}(a8_0x4b86,0x4ab27));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';function a8_0x55b9(_0x470b87,_0x48d981){_0x470b87=_0x470b87-0x1d0;const _0x4b869b=a8_0x4b86();let _0x55b943=_0x4b869b[_0x470b87];return _0x55b943;}function a8_0x4b86(){const _0x52fe50=['87536sLgHlo','36BEPBLm','email','346422BdjfRG','log','\x20(profile:\x20','ERROR','53578chIixS','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','696384dfpnPw','\x20--profile\x20','getUserInfo','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','logLevel','5400780ZQyTNj','green','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','/oauth/authorize','us01','execute','\x27\x20registered','\x20\x20tdx','description','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','714644NwmsXY','bold','3ZnPBfc','name','333uQxmcJ','2901275OzOhiz','create','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Opening\x20browser\x20for\x20authentication...','site','Login\x20cancelled'];a8_0x4b86=function(){return _0x52fe50;};return a8_0x4b86();}import{LogLevel}from'../utils/tdx-logger.js';import a8_0x52d237 from'chalk';export async function runOAuthLoginFlow(_0x16b431,_0x5daf5f,_0x5efdfa){const _0x5c7b1e=a8_0x55b9;if(!isOAuthSupported(_0x16b431))throw new Error(_0x5c7b1e(0x1ee)+_0x16b431+'.\x20'+_0x5c7b1e(0x1f3)+_0x5c7b1e(0x1ed));const _0x326292=await isKeychainAvailable();if(!_0x326292)throw new Error(_0x5c7b1e(0x1d1)+_0x5c7b1e(0x1ed));const _0x20fafb=getConsoleUrl(_0x16b431);console[_0x5c7b1e(0x1e8)](_0x5c7b1e(0x1e1)),console[_0x5c7b1e(0x1e8)]('\x20\x20'+_0x20fafb+_0x5c7b1e(0x1d2)),console[_0x5c7b1e(0x1e8)](_0x5c7b1e(0x1ec));const _0x273395=await startOAuthFlow(_0x16b431);console[_0x5c7b1e(0x1e8)]('Validating\x20OAuth\x20tokens...');const _0x40bf97=TDX[_0x5c7b1e(0x1df)]({'site':_0x16b431,'accessToken':_0x273395['access_token'],'logLevel':_0x5efdfa??LogLevel[_0x5c7b1e(0x1ea)]}),_0x202c73=await _0x40bf97['jobs'][_0x5c7b1e(0x1f2)]();console['log'](a8_0x52d237[_0x5c7b1e(0x1d0)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x202c73[_0x5c7b1e(0x1e6)]+')')),await saveOAuthTokens(_0x273395,_0x5daf5f),console[_0x5c7b1e(0x1e8)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x5daf5f?_0x5c7b1e(0x1e9)+_0x5daf5f+')':''));if(_0x5daf5f){const _0x5754b0={'site':_0x16b431};saveProfileToUserConfig(_0x5daf5f,_0x5754b0),console[_0x5c7b1e(0x1e8)]('✓\x20Profile\x20\x27'+_0x5daf5f+_0x5c7b1e(0x1d5));}const _0xdedcfd=_0x5daf5f?_0x5c7b1e(0x1f1)+_0x5daf5f:'';console[_0x5c7b1e(0x1e8)](),console[_0x5c7b1e(0x1e8)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x5c7b1e(0x1e8)](_0x5c7b1e(0x1d6)+_0xdedcfd+_0x5c7b1e(0x1d8)),console[_0x5c7b1e(0x1e8)](_0x5c7b1e(0x1d6)+_0xdedcfd+_0x5c7b1e(0x1e0));}export class AuthLoginCommand extends BaseCommand{[a8_0xb8ee83(0x1dc)]='auth:login';[a8_0xb8ee83(0x1d7)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async[a8_0xb8ee83(0x1d4)](_0x2ee7e5){const _0x5706b4=a8_0xb8ee83,{options:_0x587179}=_0x2ee7e5,_0xf4e07e=_0x587179['profile'];console[_0x5706b4(0x1e8)](a8_0x52d237[_0x5706b4(0x1da)]('tdx:\x20auth\x20login'));const _0x5b2cfd=_0x587179[_0x5706b4(0x1e2)]||_0x5706b4(0x1d3),_0x1ca58b=await promptSiteSelection(_0x5b2cfd,_0xf4e07e,_0x5706b4(0x1e3));if(!_0x1ca58b)return 0x1;const _0x172c70=resolveSite(_0x1ca58b);return console[_0x5706b4(0x1e8)](_0x5706b4(0x1ef)+_0x172c70),await runOAuthLoginFlow(_0x172c70,_0xf4e07e,_0x587179[_0x5706b4(0x1f4)]??LogLevel[_0x5706b4(0x1ea)]),0x0;}}
|