@treasuredata/tdx 2026.4.2 → 2026.4.4
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.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/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x49c48c=a3_0x2311;function a3_0x2311(_0x804cf6,_0x1dd7b7){_0x804cf6=_0x804cf6-0x129;const _0x2c5cde=a3_0x2c5c();let _0x23118e=_0x2c5cde[_0x804cf6];return _0x23118e;}(function(_0x487f45,_0xccaae7){const _0x1c7b98=a3_0x2311,_0x5dabba=_0x487f45();while(!![]){try{const _0x35c4ed=parseInt(_0x1c7b98(0x133))/0x1*(-parseInt(_0x1c7b98(0x139))/0x2)+parseInt(_0x1c7b98(0x13e))/0x3+-parseInt(_0x1c7b98(0x13c))/0x4+parseInt(_0x1c7b98(0x132))/0x5+parseInt(_0x1c7b98(0x130))/0x6*(parseInt(_0x1c7b98(0x13b))/0x7)+parseInt(_0x1c7b98(0x140))/0x8+parseInt(_0x1c7b98(0x149))/0x9;if(_0x35c4ed===_0xccaae7)break;else _0x5dabba['push'](_0x5dabba['shift']());}catch(_0x67d753){_0x5dabba['push'](_0x5dabba['shift']());}}}(a3_0x2c5c,0x5e267));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x2c5c(){const _0x3ca245=['Resolved\x20parent\x20ID:\x20','error','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','resolveParentId','Error:\x20','List\x20activations\x20for\x20a\x20segment','Resolving\x20parent\x20segment\x20\x27','execute','✔\x20Found\x20','2160126YfbKak','listActivations','886200QMvjJz','2950LJxxvT','length','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveSegmentId','\x20activation','cause','362dJIxnD','Site:\x20','7EFxDss','343432UfXpRa','name','1177572deQzpB','\x20\x20Cause:\x20','72072IbaRpt','data','segment','activations','Error:\x20Segment\x20name\x20is\x20required','Child\x20name:\x20','Resolved\x20child\x20ID:\x20','\x27...','message','599877BOddBZ','verbose'];a3_0x2c5c=function(){return _0x3ca245;};return a3_0x2c5c();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x49c48c(0x13d)]=a3_0x49c48c(0x143);['description']=a3_0x49c48c(0x12c);async[a3_0x49c48c(0x12e)](_0x2a1134){const _0x400a17=a3_0x49c48c,{options:_0x148b09,args:_0x4776e1,tdx:_0x25bfe7}=_0x2a1134;if(_0x4776e1[_0x400a17(0x134)]===0x0)return console[_0x400a17(0x14c)](_0x400a17(0x144)),console[_0x400a17(0x14c)](_0x400a17(0x135)),0x1;try{const {parentId:_0x1ee2b7,childId:_0x22b28d}=parseSegmentRef(_0x4776e1[0x0]);if(!_0x22b28d)return console[_0x400a17(0x14c)](_0x400a17(0x129)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x148b09[_0x400a17(0x14a)]&&(console[_0x400a17(0x14c)](_0x400a17(0x13a)+_0x148b09['site']),console[_0x400a17(0x14c)]('Parent\x20name:\x20'+_0x1ee2b7),console[_0x400a17(0x14c)](_0x400a17(0x145)+_0x22b28d));const _0x7f28d=await withSpinner(_0x400a17(0x12d)+_0x1ee2b7+_0x400a17(0x147),()=>_0x25bfe7['segment'][_0x400a17(0x12a)](_0x1ee2b7),{'verbose':_0x148b09[_0x400a17(0x14a)]}),_0x4d3c59=_0x7f28d[_0x400a17(0x141)];_0x148b09[_0x400a17(0x14a)]&&console[_0x400a17(0x14c)](_0x400a17(0x14b)+_0x4d3c59);const _0x424952=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x22b28d+_0x400a17(0x147),()=>_0x25bfe7[_0x400a17(0x142)][_0x400a17(0x136)](_0x4d3c59,_0x22b28d),{'verbose':_0x148b09[_0x400a17(0x14a)]}),_0x392437=_0x424952[_0x400a17(0x141)];_0x148b09[_0x400a17(0x14a)]&&console[_0x400a17(0x14c)](_0x400a17(0x146)+_0x392437);const _0x1edc48=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x22b28d+_0x400a17(0x147),()=>_0x25bfe7['segment'][_0x400a17(0x131)](_0x4d3c59,_0x392437),{'verbose':_0x148b09[_0x400a17(0x14a)]}),_0x2c3e62=_0x1edc48[_0x400a17(0x141)];return console[_0x400a17(0x14c)](_0x400a17(0x12f)+_0x2c3e62[_0x400a17(0x134)]+_0x400a17(0x137)+(_0x2c3e62[_0x400a17(0x134)]!==0x1?'s':'')),await handleSDKOutput(_0x2c3e62,_0x148b09),0x0;}catch(_0x174e6e){if(_0x174e6e instanceof SDKError)return console['error'](_0x400a17(0x12b)+_0x174e6e[_0x400a17(0x148)]),_0x174e6e[_0x400a17(0x138)]&&console['error'](_0x400a17(0x13f)+_0x174e6e['cause']),0x1;throw _0x174e6e;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x199530=a4_0x53e7;function a4_0x36eb(){const _0x1a9a6c=['name','agent:push','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','pushProject','✔\x20Context\x20set:\x20','\x20\x20Form\x20Interfaces:\x20','projectDir','\x0aErrors\x20found:','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','No\x20tdx.json\x20found\x20in\x20','agents','\x0aPush\x20summary\x20for\x20\x27','yellow','llm_project','\x20\x20Form\x20Interface\x20\x22','Cloning\x20\x22','\x22...','found','\x20created','outputDir','counts','push','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','cyan','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20new','repeat','yes','Cancelled','\x0aChanges\x20to\x20agent\x20\x27','Agent\x20pulled\x20successfully','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','sourceProjectName','\x0aChanges\x20to\x20integration\x20\x27','integrations','\x20\x20Chat\x20Interfaces:\x20','newProjectId','join','prompts','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','source','\x0aPull\x20summary\x20for\x20\x27','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20resources\x20to\x20\x27','llmProject','\x20\x20Knowledge\x20Bases:\x20','Status:\x20','Failed\x20to\x20push\x20agent:\x20','\x20\x20Prompt\x20\x22','created','reason','agentName','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','diff','utf-8','New\x20project:\x20','Using\x20project\x20from\x20','\x20unchanged','description','Pushing\x20agent\x20from\x20\x22','Pulling\x20agent\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','7676720WARfPB','390DghAxa','\x20\x20Integrations:\x20','agentId','textKnowledgeBases','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Project\x20cloned\x20successfully','\x0aChanges:','formInterfaces','\x0aProject\x20pushed\x20with\x20errors','\x20updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20Prompts:\x20','site','Output:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','5351988oJdibc','no_local_folder','Project:\x20','profile','total','force','\x20\x20Chat\x20Interface\x20\x22','263842TkRuIH','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','new','parse','experimentalArtifacts','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','updated','\x0aPush\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Using\x20local\x20project:\x20','errors','Agent:\x20','99aKGZqM','dirname','9002154ZQFeYF','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x27\x20to\x20create\x20the\x20folder\x20structure.','Using\x20project:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20tdx\x20agent\x20pull\x20','\x20|\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','error','execute','green','Summary:','\x20successfully','\x20=\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20files?','dim','projectId','Using\x20project\x20from\x20context:\x20','\x20\x20Agents:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','message','Output\x20path:\x20','New\x20project\x20ID:\x20','experimentalKnowledgeBases','Using\x20context\x20project:\x20','llm','Agent\x20','\x0a✔\x20Pushed\x20','Errors:','unchanged','hasChanges','\x22:\x20','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)','\x20\x20Experimental\x20Artifact\x20\x22','Source:\x20','-\x20no\x20files\x20written','Analyzing\x20changes\x20to\x20push...','tdx.json','\x20changed','-\x20nothing\x20pushed','\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','INVALID_ARGUMENT','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Would\x20clone:','action','chatInterfaces','outputPath','\x20files\x20to\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','log','\x20\x20Integration\x20\x22','<new-name>','pullProject','Analyzing\x20project\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Text\x20Knowledge\x20Base\x20\x22','red','agent:pull','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','dryRun','\x0aWrite\x20','newProjectName','30572sBOkcI','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Experimental\x20Artifacts:\x20','1537563BtbNFP','Writing\x20files...','\x22\x20from\x20project\x20\x22','\x0aChanges\x20to\x20chat\x20interface\x20\x27','cwd','arg-dir','3445180CIOswC','\x0aError:','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','agent','Project\x20cloned\x20with\x20errors','projectName','\x20--name\x20','knowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','2NVOkaU'];a4_0x36eb=function(){return _0x1a9a6c;};return a4_0x36eb();}(function(_0x191aa5,_0x3dbaad){const _0x2c4652=a4_0x53e7,_0x1e0031=_0x191aa5();while(!![]){try{const _0x3c13c9=parseInt(_0x2c4652(0x1aa))/0x1+-parseInt(_0x2c4652(0x20a))/0x2*(-parseInt(_0x2c4652(0x1fb))/0x3)+-parseInt(_0x2c4652(0x1f8))/0x4*(-parseInt(_0x2c4652(0x192))/0x5)+parseInt(_0x2c4652(0x1a3))/0x6+parseInt(_0x2c4652(0x1b8))/0x7+parseInt(_0x2c4652(0x191))/0x8+-parseInt(_0x2c4652(0x1b6))/0x9*(parseInt(_0x2c4652(0x201))/0xa);if(_0x3c13c9===_0x3dbaad)break;else _0x1e0031['push'](_0x1e0031['shift']());}catch(_0x307b85){_0x1e0031['push'](_0x1e0031['shift']());}}}(a4_0x36eb,0xafe2d));import a4_0x4e69c3 from'chalk';import a4_0x159861 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x53e7(_0x38a947,_0x4dc51b){_0x38a947=_0x38a947-0x177;const _0x36ebf5=a4_0x36eb();let _0x53e774=_0x36ebf5[_0x38a947];return _0x53e774;}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(_0x318c1c){const _0x43e801=a4_0x53e7,_0x46b4a3=[];if(_0x318c1c['total']!==undefined)_0x46b4a3[_0x43e801(0x220)](_0x318c1c[_0x43e801(0x1a7)]+'\x20total');if(_0x318c1c['new']!==undefined&&_0x318c1c[_0x43e801(0x1ac)]>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x1c3)](_0x318c1c[_0x43e801(0x1ac)]+_0x43e801(0x224)));if(_0x318c1c['created']!==undefined&&_0x318c1c[_0x43e801(0x183)]>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x1c3)](_0x318c1c[_0x43e801(0x183)]+_0x43e801(0x21d)));if(_0x318c1c[_0x43e801(0x1b0)]!==undefined&&_0x318c1c['updated']>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x217)](_0x318c1c[_0x43e801(0x1b0)]+_0x43e801(0x19d)));if(_0x318c1c[_0x43e801(0x1d7)]!==undefined&&_0x318c1c[_0x43e801(0x1d7)]>0x0)_0x46b4a3['push'](a4_0x4e69c3['gray'](_0x318c1c[_0x43e801(0x1d7)]+_0x43e801(0x18c)));if(_0x318c1c['errors']!==undefined&&_0x318c1c[_0x43e801(0x1b4)]>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x1f2)](_0x318c1c[_0x43e801(0x1b4)]+'\x20errors'));return _0x46b4a3['join'](',\x20');}function displayDiffs(_0x1d3374,_0x4019e8,_0xe68a66,_0x59e2d2,_0x4479f4,_0x378f8e,_0x5bd859,_0x272529,_0x4484b3){const _0x4f9c3c=a4_0x53e7;for(const _0x4b423f of _0x1d3374){if(_0x4b423f[_0x4f9c3c(0x188)]){const _0x2532d8=_0x4b423f[_0x4f9c3c(0x185)]||_0x4b423f[_0x4f9c3c(0x20b)];console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x228)+_0x2532d8+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x4b423f[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c));}}for(const _0x4fb3ef of _0x4019e8){_0x4fb3ef[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x198)+_0x4fb3ef['name']+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)),console[_0x4f9c3c(0x1eb)](_0x4fb3ef[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0xe65090 of _0xe68a66){_0xe65090[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x1a2)+_0xe65090[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0xe65090[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x1d0a63 of _0x59e2d2){_0x1d0a63[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1d0a63[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x1d0a63[_0x4f9c3c(0x188)]),console['log']('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x4150e0 of _0x4479f4){_0x4150e0[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x22d)+_0x4150e0[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)),console[_0x4f9c3c(0x1eb)](_0x4150e0[_0x4f9c3c(0x188)]),console['log']('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x18fd81 of _0x378f8e){_0x18fd81[_0x4f9c3c(0x188)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x18fd81['name']+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)),console[_0x4f9c3c(0x1eb)](_0x18fd81['diff']),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x492aac of _0x5bd859){_0x492aac['diff']&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x187)+_0x492aac['name']+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x492aac[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)));}for(const _0x3e53e5 of _0x272529){_0x3e53e5['diff']&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x22b)+_0x3e53e5[_0x4f9c3c(0x20b)]+'\x27:'),console['log']('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x3e53e5[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x46873a of _0x4484b3){_0x46873a['diff']&&(console['log'](_0x4f9c3c(0x1fe)+_0x46873a[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x46873a[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x199530(0x20b)]=a4_0x199530(0x1f3);[a4_0x199530(0x18d)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x11cf07){const _0xff20da=a4_0x199530,{options:_0x23c072,args:_0x7435ed,tdx:_0x53aa24}=_0x11cf07,_0x145558=_0x7435ed[0x0],_0x506e76=_0x7435ed[0x1],_0x2616cd=_0x23c072['output'],_0x300167=_0x23c072[_0xff20da(0x1f5)],_0x577621=_0x23c072[_0xff20da(0x1a8)],_0x321ad7=_0x23c072['yes'],_0x34f5a7=_0x23c072[_0xff20da(0x17e)],_0x1b1bb6=_0x23c072[_0xff20da(0x204)];let _0x9ca064;if(_0x145558){const _0x1de510=a4_0x159861[_0xff20da(0x177)](_0x145558,'tdx.json');if(existsSync(_0x1de510))try{const _0x59e722=JSON[_0xff20da(0x1ad)](readFileSync(_0x1de510,_0xff20da(0x189)));_0x59e722[_0xff20da(0x218)]&&(_0x9ca064={'llm_project':_0x59e722[_0xff20da(0x218)]});}catch{}}const _0x3d7d54=findAgentConfigPath(process['cwd']());let _0x16ecee;if(_0x3d7d54)try{const _0x36481f=JSON[_0xff20da(0x1ad)](readFileSync(_0x3d7d54,_0xff20da(0x189)));_0x36481f[_0xff20da(0x218)]&&(_0x16ecee={'llm_project':_0x36481f[_0xff20da(0x218)]});}catch{}const _0xdcd62f=resolveAgentPullArgs({'arg':_0x145558,'agentNameArg':_0x506e76,'agentFlag':_0x1b1bb6,'contextProject':_0x34f5a7,'argDirConfig':_0x9ca064,'cwdConfigPath':_0x3d7d54||undefined,'cwdConfig':_0x16ecee}),{projectNameOrId:_0x5e410f,targetAgentName:_0x2060a1,existingOutputDir:_0x7f88e9,source:_0xfe67f6}=_0xdcd62f;if(_0xfe67f6===_0xff20da(0x200))console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c9)](_0xff20da(0x18b)+a4_0x159861[_0xff20da(0x177)](_0x145558,_0xff20da(0x1df))+':\x20'+_0x5e410f));else{if(_0xfe67f6==='cwd-config')console[_0xff20da(0x1eb)](a4_0x4e69c3['dim'](_0xff20da(0x1bb)+_0x5e410f));else _0xfe67f6==='context'&&console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c9)](_0xff20da(0x1cb)+_0x5e410f));}if(!_0x5e410f)return _0x1b1bb6?(console[_0xff20da(0x1eb)](a4_0x4e69c3['yellow'](_0xff20da(0x17c))),console[_0xff20da(0x1eb)](_0xff20da(0x1f0)),console[_0xff20da(0x1eb)](_0xff20da(0x1e4))):(console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x217)](_0xff20da(0x1cd))),console[_0xff20da(0x1eb)](_0xff20da(0x1da)),console[_0xff20da(0x1eb)](_0xff20da(0x1b2)),console[_0xff20da(0x1eb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0xff20da(0x1e2)),console[_0xff20da(0x1eb)](_0xff20da(0x19e))),0x1;if(_0x2060a1){const {data:_0x1e27be}=await withSpinner(_0xff20da(0x18f)+_0x2060a1+_0xff20da(0x1fd)+_0x5e410f+_0xff20da(0x21b),()=>_0x53aa24[_0xff20da(0x1d3)]['pullAgent'](_0x5e410f,_0x2060a1,_0x2616cd,{'dryRun':_0x300167,'force':_0x577621}));if(_0x300167)return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x217)](_0xff20da(0x190))),console[_0xff20da(0x1eb)](_0xff20da(0x22a)+_0x1e27be['agentName']),console['log'](_0xff20da(0x1cf)+_0x1e27be['outputPath']),_0x1e27be[_0xff20da(0x188)]&&(console[_0xff20da(0x1eb)](_0xff20da(0x19a)),console[_0xff20da(0x1eb)]('─'[_0xff20da(0x225)](0x3c)),console[_0xff20da(0x1eb)](_0x1e27be[_0xff20da(0x188)]),console[_0xff20da(0x1eb)]('─'[_0xff20da(0x225)](0x3c))),0x0;return console[_0xff20da(0x1eb)](a4_0x4e69c3['green'](_0xff20da(0x229))),console['log'](_0xff20da(0x1b5)+_0x1e27be[_0xff20da(0x185)]),console['log'](_0xff20da(0x1a1)+_0x1e27be[_0xff20da(0x1e8)]),console[_0xff20da(0x1eb)](_0xff20da(0x180)+(_0x1e27be['isNew']?a4_0x4e69c3[_0xff20da(0x1c3)](_0xff20da(0x1ac)):_0x1e27be[_0xff20da(0x1d8)]?a4_0x4e69c3[_0xff20da(0x217)](_0xff20da(0x1b0)):a4_0x4e69c3['gray'](_0xff20da(0x1d7)))),0x0;}const _0x367c7a=_0x7f88e9||_0x2616cd,{data:_0x5ce92c}=await withSpinner(_0xff20da(0x1ef)+_0x5e410f+'\x22...',()=>_0x53aa24[_0xff20da(0x1d3)][_0xff20da(0x1ee)](_0x5e410f,_0x367c7a,{'dryRun':!![]})),_0x2bc41d=_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x215)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)]['knowledgeBases'][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x178)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x22e)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1d1)]['new']+_0x5ce92c['counts'][_0xff20da(0x1ae)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x19b)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1e7)][_0xff20da(0x1ac)],_0x282c89=_0x5ce92c[_0xff20da(0x21f)]['agents'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['knowledgeBases'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x178)][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['integrations'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['experimentalKnowledgeBases'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['experimentalArtifacts'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x19b)][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1e7)][_0xff20da(0x1b0)],_0xf8d98d=_0x5ce92c['counts'][_0xff20da(0x215)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)]['knowledgeBases'][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x178)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x22e)][_0xff20da(0x1d7)]+_0x5ce92c['counts'][_0xff20da(0x1d1)][_0xff20da(0x1d7)]+_0x5ce92c['counts'][_0xff20da(0x1ae)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)]['formInterfaces'][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)]['chatInterfaces']['unchanged'];console[_0xff20da(0x1eb)](_0xff20da(0x17b)+_0x5ce92c[_0xff20da(0x206)]+'\x27:'),console[_0xff20da(0x1eb)]('\x20\x20'+a4_0x4e69c3[_0xff20da(0x1c3)]('+\x20'+_0x2bc41d+'\x20new')+_0xff20da(0x1be)+a4_0x4e69c3[_0xff20da(0x217)]('~\x20'+_0x282c89+_0xff20da(0x1e0))+_0xff20da(0x1be)+a4_0x4e69c3[_0xff20da(0x1c9)]('=\x20'+_0xf8d98d+_0xff20da(0x18c))),console[_0xff20da(0x1eb)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x215)])),console[_0xff20da(0x1eb)](_0xff20da(0x17f)+formatCountSummary(_0x5ce92c['counts'][_0xff20da(0x208)])),console[_0xff20da(0x1eb)](_0xff20da(0x1bf)+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)])),console[_0xff20da(0x1eb)](_0xff20da(0x19f)+formatCountSummary(_0x5ce92c['counts'][_0xff20da(0x178)])),console['log'](_0xff20da(0x193)+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x22e)])),console[_0xff20da(0x1eb)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x19b)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1e7)]));const _0x347d06=_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1d1)][_0xff20da(0x1a7)]>0x0||_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1ae)]['total']>0x0;_0x347d06&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1d1)])),console[_0xff20da(0x1eb)](_0xff20da(0x1fa)+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1ae)])));console[_0xff20da(0x1eb)]('\x20\x20Target:\x20'+a4_0x4e69c3[_0xff20da(0x222)](_0x5ce92c[_0xff20da(0x21e)])),displayDiffs(_0x5ce92c[_0xff20da(0x215)],_0x5ce92c[_0xff20da(0x208)],_0x5ce92c[_0xff20da(0x195)],_0x5ce92c[_0xff20da(0x178)],_0x5ce92c[_0xff20da(0x22e)],_0x5ce92c[_0xff20da(0x1d1)],_0x5ce92c[_0xff20da(0x1ae)],_0x5ce92c[_0xff20da(0x19b)],_0x5ce92c[_0xff20da(0x1e7)]);if(_0x300167)return console['log'](a4_0x4e69c3['yellow'](_0xff20da(0x1bc))),0x0;if(_0x2bc41d===0x0&&_0x282c89===0x0)return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c3)](_0xff20da(0x1c0))),saveSessionContext({'llm_project':_0x5ce92c['projectName']},_0x23c072['session']),console['log'](a4_0x4e69c3['green'](_0xff20da(0x20f)+a4_0x4e69c3[_0xff20da(0x1c9)]('llm_project')+'\x20=\x20'+a4_0x4e69c3[_0xff20da(0x222)](_0x5ce92c['projectName']))),0x0;if(!_0x321ad7&&!_0x577621){if(!isInteractive())return console[_0xff20da(0x1c1)](a4_0x4e69c3[_0xff20da(0x1f2)]('\x0aError:'),_0xff20da(0x1b9)),console[_0xff20da(0x1c1)](a4_0x4e69c3['dim'](_0xff20da(0x197))),0x1;const _0x1e0499=await confirmKey(_0xff20da(0x1f6)+(_0x2bc41d+_0x282c89)+_0xff20da(0x1c8));if(!_0x1e0499)return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x217)]('Cancelled'),_0xff20da(0x1dd)),0x1;}const {data:_0x14fd91}=await withSpinner(_0xff20da(0x1fc),()=>_0x53aa24[_0xff20da(0x1d3)][_0xff20da(0x1ee)](_0x5e410f,_0x367c7a,{'force':_0x577621}));return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c3)]('\x0a✔\x20Pulled\x20'+(_0x2bc41d+_0x282c89)+_0xff20da(0x1e9)+_0x14fd91[_0xff20da(0x21e)])),saveSessionContext({'llm_project':_0x14fd91[_0xff20da(0x206)]},_0x23c072['session']),console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c3)](_0xff20da(0x20f)+a4_0x4e69c3[_0xff20da(0x1c9)](_0xff20da(0x218))+_0xff20da(0x1c6)+a4_0x4e69c3['cyan'](_0x14fd91[_0xff20da(0x206)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x199530(0x20b)]='agent:clone';[a4_0x199530(0x18d)]=a4_0x199530(0x203);async[a4_0x199530(0x1c2)](_0x15fdea){const _0x4084d9=a4_0x199530,{options:_0x4fa235,args:_0x47c93f,tdx:_0x17a07a}=_0x15fdea,_0x54589d=_0x47c93f[0x0],_0x3dc604=_0x4fa235[_0x4084d9(0x20b)],_0x598d8a=_0x4fa235[_0x4084d9(0x1f5)],_0x1e315c=_0x4fa235[_0x4084d9(0x226)],_0x4892bc=_0x4fa235[_0x4084d9(0x1a0)],_0x4e7cda=_0x4fa235[_0x4084d9(0x17e)];let _0x768dea;const _0x45ec3b=findAgentConfigPath(process['cwd']());if(_0x54589d){const _0x542973=a4_0x159861[_0x4084d9(0x177)](_0x54589d,_0x4084d9(0x1df));existsSync(_0x542973)?(_0x768dea=_0x54589d,console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x1b3)+_0x54589d))):_0x768dea=_0x54589d;}else{if(_0x45ec3b)_0x768dea=a4_0x159861[_0x4084d9(0x1b7)](_0x45ec3b),console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1c9)]('Using\x20current\x20project:\x20'+_0x768dea));else{if(_0x4e7cda){const _0x2f9a5a=sanitizeForFilesystem(_0x4e7cda);let _0x4567ac=_0x2f9a5a,_0x364ed7=a4_0x159861['join'](process[_0x4084d9(0x1ff)](),_0x4084d9(0x215),_0x2f9a5a,_0x4084d9(0x1df));if(!existsSync(_0x364ed7)){const _0x44876a=normalizeName(_0x4e7cda),_0xbc504e=a4_0x159861[_0x4084d9(0x177)](process[_0x4084d9(0x1ff)](),_0x4084d9(0x215),_0x44876a,_0x4084d9(0x1df));existsSync(_0xbc504e)&&(_0x4567ac=_0x44876a,_0x364ed7=_0xbc504e);}if(existsSync(_0x364ed7))_0x768dea=a4_0x159861[_0x4084d9(0x1b7)](_0x364ed7),console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x1b3)+_0x768dea));else{const _0x3653ea=_0x4fa235[_0x4084d9(0x1a6)];if(_0x3653ea)throw new SDKError(ErrorCode[_0x4084d9(0x1e3)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4e7cda+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x4084d9(0x1ab)+_0x4084d9(0x1f9)+(_0x4084d9(0x1bd)+_0x4e7cda+'\x0a')+(_0x4084d9(0x1ea)+_0x4567ac+_0x4084d9(0x207)+(_0x3dc604||_0x4084d9(0x1ed))+'\x20--profile\x20'+_0x3653ea)});_0x768dea=_0x4e7cda,console['log'](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x1d2)+_0x4e7cda));}}}}if(!_0x768dea)return console[_0x4084d9(0x1eb)](a4_0x4e69c3['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x4084d9(0x1eb)](_0x4084d9(0x179)),console[_0x4084d9(0x1eb)](_0x4084d9(0x20d)),console[_0x4084d9(0x1eb)](_0x4084d9(0x223)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3dc604)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x1e315c&&!_0x598d8a){if(!isInteractive())return console['error'](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x202)),_0x4084d9(0x1b9)),console[_0x4084d9(0x1c1)](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x197))),0x1;const _0x53f5bf=await confirmKey('Clone\x20\x22'+_0x768dea+'\x22\x20to\x20new\x20project\x20\x22'+_0x3dc604+'\x22?');if(!_0x53f5bf)return console['log'](a4_0x4e69c3[_0x4084d9(0x217)](_0x4084d9(0x227))),0x1;}const {data:_0x9eb3f1}=await withSpinner(_0x4084d9(0x21a)+_0x768dea+'\x22\x20to\x20\x22'+_0x3dc604+_0x4084d9(0x21b),()=>_0x17a07a['llm']['cloneProject'](_0x768dea,_0x3dc604,{'dryRun':_0x598d8a}));if(_0x598d8a){console['log'](a4_0x4e69c3['yellow'](_0x4084d9(0x209))),console['log'](_0x4084d9(0x1dc)+_0x9eb3f1['sourceProjectName']),console[_0x4084d9(0x1eb)]('New\x20project:\x20'+_0x3dc604),console[_0x4084d9(0x1eb)](_0x4084d9(0x1e5)),console[_0x4084d9(0x1eb)](_0x4084d9(0x1cc)+_0x9eb3f1[_0x4084d9(0x21f)]['agents'][_0x4084d9(0x183)]),console[_0x4084d9(0x1eb)](_0x4084d9(0x17f)+_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x208)]['created']),console[_0x4084d9(0x1eb)]('\x20\x20Prompts:\x20'+_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x178)][_0x4084d9(0x183)]),console[_0x4084d9(0x1eb)](_0x4084d9(0x210)+_0x9eb3f1[_0x4084d9(0x21f)]['formInterfaces']['created']),console[_0x4084d9(0x1eb)](_0x4084d9(0x22f)+_0x9eb3f1['counts'][_0x4084d9(0x1e7)][_0x4084d9(0x183)]);const _0x2cdf24=_0x9eb3f1[_0x4084d9(0x21f)]['experimentalKnowledgeBases'][_0x4084d9(0x183)]>0x0||_0x9eb3f1['counts']['experimentalArtifacts'][_0x4084d9(0x183)]>0x0;return _0x2cdf24&&(console[_0x4084d9(0x1eb)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)][_0x4084d9(0x183)]),console['log'](_0x4084d9(0x1fa)+_0x9eb3f1['counts'][_0x4084d9(0x1ae)][_0x4084d9(0x183)])),0x0;}const _0x5ce740=_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x215)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x208)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x178)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)]['formInterfaces']['errors']>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1e7)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1['counts'][_0x4084d9(0x1d1)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)][_0x4084d9(0x1b4)]>0x0;_0x5ce740?console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x217)](_0x4084d9(0x205))):console[_0x4084d9(0x1eb)](a4_0x4e69c3['green'](_0x4084d9(0x199)));console[_0x4084d9(0x1eb)](_0x4084d9(0x1dc)+_0x9eb3f1[_0x4084d9(0x22c)]),console['log'](_0x4084d9(0x18a)+_0x9eb3f1[_0x4084d9(0x1f7)]),console['log'](_0x4084d9(0x1d0)+_0x9eb3f1['newProjectId']),console['log'](),console[_0x4084d9(0x1eb)](_0x4084d9(0x1c4)),console['log'](_0x4084d9(0x1cc)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x215)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x17f)+formatCountSummary(_0x9eb3f1['counts'][_0x4084d9(0x208)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x19f)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x178)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x193)+formatCountSummary(_0x9eb3f1['counts']['integrations'])),console[_0x4084d9(0x1eb)](_0x4084d9(0x210)+formatCountSummary(_0x9eb3f1['counts'][_0x4084d9(0x19b)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x22f)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1e7)]));const _0x338a9b=_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)][_0x4084d9(0x183)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)]['updated']>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)][_0x4084d9(0x1d7)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)][_0x4084d9(0x183)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)]['experimentalArtifacts']['updated']>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)]['unchanged']>0x0;_0x338a9b&&(console[_0x4084d9(0x1eb)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x1fa)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)])));if(_0x5ce740){console['log'](),console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x1d6)));for(const _0x4f6e17 of _0x9eb3f1['agents']){_0x4f6e17[_0x4084d9(0x1e6)]==='error'&&console[_0x4084d9(0x1eb)](a4_0x4e69c3['red'](_0x4084d9(0x186)+_0x4f6e17[_0x4084d9(0x185)]+'\x22:\x20'+_0x4f6e17['error']));}for(const _0x1ab20c of _0x9eb3f1[_0x4084d9(0x208)]){_0x1ab20c[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x1ab20c[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x1ab20c[_0x4084d9(0x1c1)]));}for(const _0x261c45 of _0x9eb3f1[_0x4084d9(0x178)]){_0x261c45[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x182)+_0x261c45['name']+'\x22:\x20'+_0x261c45['error']));}for(const _0x5b5c60 of _0x9eb3f1[_0x4084d9(0x22e)]){_0x5b5c60[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console['log'](a4_0x4e69c3['red'](_0x4084d9(0x1ec)+_0x5b5c60[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x5b5c60[_0x4084d9(0x1c1)]));}for(const _0x42d178 of _0x9eb3f1[_0x4084d9(0x19b)]){_0x42d178[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x219)+_0x42d178['name']+_0x4084d9(0x1d9)+_0x42d178['error']));}for(const _0x3fc0ba of _0x9eb3f1[_0x4084d9(0x1e7)]){_0x3fc0ba['action']===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3['red'](_0x4084d9(0x1a9)+_0x3fc0ba[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x3fc0ba[_0x4084d9(0x1c1)]));}for(const _0x335a04 of _0x9eb3f1[_0x4084d9(0x1d1)]){_0x335a04[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x335a04[_0x4084d9(0x20b)]+'\x22:\x20'+_0x335a04[_0x4084d9(0x1c1)]));}for(const _0x326a1b of _0x9eb3f1[_0x4084d9(0x1ae)]){_0x326a1b[_0x4084d9(0x1e6)]==='error'&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x1db)+_0x326a1b[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x326a1b[_0x4084d9(0x1c1)]));}return 0x1;}console[_0x4084d9(0x1eb)]();const _0x1e4c08=getLLMProjectUrl(_0x4892bc,_0x9eb3f1[_0x4084d9(0x230)]);return console['log'](_0x4084d9(0x1a5)+a4_0x4e69c3['cyan'](_0x1e4c08)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x199530(0x20b)]=a4_0x199530(0x20c);['description']=a4_0x199530(0x221);async[a4_0x199530(0x1c2)](_0x35f2a4){const _0x4fa01c=a4_0x199530,{options:_0x2b0300,args:_0x58e47c,tdx:_0x3fa027}=_0x35f2a4;let _0x267b76=_0x58e47c[0x0]||process[_0x4fa01c(0x1ff)]();const _0xf871b4=_0x2b0300[_0x4fa01c(0x1f5)],_0x44878e=_0x2b0300[_0x4fa01c(0x1a8)],_0xacbea6=_0x2b0300[_0x4fa01c(0x226)],_0x14ea7c=_0x2b0300['site'],_0x1edcb4=a4_0x159861[_0x4fa01c(0x177)](_0x267b76,'agent.yml'),_0x58e181=existsSync(_0x1edcb4);if(_0x58e181){const {data:_0x34535d}=await withSpinner(_0x4fa01c(0x18e)+_0x267b76+_0x4fa01c(0x21b),()=>_0x3fa027['llm']['pushAgent'](_0x267b76,{'dryRun':_0xf871b4,'force':_0x44878e}));if(_0xf871b4)return console[_0x4fa01c(0x1eb)](a4_0x4e69c3['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4fa01c(0x1eb)]('Would\x20push\x20agent:\x20'+_0x34535d[_0x4fa01c(0x185)]),0x0;if(_0x34535d[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1))return console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x181)+_0x34535d['error'])),0x1;console['log'](a4_0x4e69c3[_0x4fa01c(0x1c3)](_0x4fa01c(0x1d4)+_0x34535d[_0x4fa01c(0x1e6)]+_0x4fa01c(0x1c5))),console['log'](_0x4fa01c(0x1b5)+_0x34535d[_0x4fa01c(0x185)]);if(_0x34535d[_0x4fa01c(0x194)]&&_0x34535d[_0x4fa01c(0x1ca)]){const _0x528ed8=getLLMAgentChatUrl(_0x14ea7c,_0x34535d[_0x4fa01c(0x1ca)],_0x34535d['agentId']);console[_0x4fa01c(0x1eb)]('Chat:\x20'+a4_0x4e69c3[_0x4fa01c(0x222)](_0x528ed8));}return 0x0;}const _0x57fddf=_0x2b0300['llmProject'],_0x19aa37=resolveProjectFromContext(_0x267b76,_0x57fddf);if(_0x19aa37[_0x4fa01c(0x21c)])_0x267b76=_0x19aa37[_0x4fa01c(0x211)],_0x19aa37[_0x4fa01c(0x17a)]===_0x4fa01c(0x196)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1c9)]('Using\x20project:\x20'+_0x267b76));else{let _0x238b35='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x19aa37['reason']===_0x4fa01c(0x1a4)&&(_0x238b35=_0x19aa37[_0x4fa01c(0x1ce)]+_0x4fa01c(0x1f4)+_0x19aa37[_0x4fa01c(0x17e)]+_0x4fa01c(0x1ba));throw new SDKError(ErrorCode[_0x4fa01c(0x1e3)],_0x19aa37[_0x4fa01c(0x184)]==='no_context'?_0x19aa37[_0x4fa01c(0x1ce)]:_0x4fa01c(0x214)+_0x267b76,undefined,{'helpText':_0x238b35});}const {data:_0x29b36e}=await withSpinner(_0x4fa01c(0x1de),()=>_0x3fa027[_0x4fa01c(0x1d3)][_0x4fa01c(0x20e)](_0x267b76,{'dryRun':!![]})),_0x34df17=_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x215)][_0x4fa01c(0x1b4)]>0x0;if(_0x34df17){console['log'](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x212)));for(const _0x2cf630 of _0x29b36e[_0x4fa01c(0x215)]){_0x2cf630[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)]('\x20\x20Agent\x20\x22'+_0x2cf630[_0x4fa01c(0x185)]+_0x4fa01c(0x1d9)+_0x2cf630[_0x4fa01c(0x1c1)]));}return 0x1;}const _0x9bdad8=_0x29b36e[_0x4fa01c(0x21f)]['agents']['created']+_0x29b36e[_0x4fa01c(0x21f)]['knowledgeBases']['created']+_0x29b36e['counts'][_0x4fa01c(0x195)]['created']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x178)]['created']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)][_0x4fa01c(0x183)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)][_0x4fa01c(0x183)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1ae)]['created']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)][_0x4fa01c(0x183)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1e7)]['created'],_0x3eef71=_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x215)]['updated']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x208)]['updated']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x195)][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x178)][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)][_0x4fa01c(0x1b0)]+_0x29b36e['counts'][_0x4fa01c(0x1d1)][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)]['experimentalArtifacts'][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)]['formInterfaces']['updated']+_0x29b36e['counts'][_0x4fa01c(0x1e7)][_0x4fa01c(0x1b0)],_0x564137=_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x215)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)]['knowledgeBases'][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x195)]['unchanged']+_0x29b36e['counts']['prompts'][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)]['unchanged']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1ae)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1e7)][_0x4fa01c(0x1d7)];console[_0x4fa01c(0x1eb)](_0x4fa01c(0x216)+_0x29b36e[_0x4fa01c(0x206)]+'\x27:'),console[_0x4fa01c(0x1eb)]('\x20\x20'+a4_0x4e69c3[_0x4fa01c(0x1c3)]('+\x20'+_0x9bdad8+_0x4fa01c(0x224))+_0x4fa01c(0x1be)+a4_0x4e69c3[_0x4fa01c(0x217)]('~\x20'+_0x3eef71+_0x4fa01c(0x1e0))+_0x4fa01c(0x1be)+a4_0x4e69c3[_0x4fa01c(0x1c9)]('=\x20'+_0x564137+_0x4fa01c(0x18c))),console[_0x4fa01c(0x1eb)](_0x4fa01c(0x1cc)+formatCountSummary(_0x29b36e['counts'][_0x4fa01c(0x215)])),console[_0x4fa01c(0x1eb)](_0x4fa01c(0x17f)+formatCountSummary(_0x29b36e['counts'][_0x4fa01c(0x208)])),console[_0x4fa01c(0x1eb)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x195)])),console['log'](_0x4fa01c(0x19f)+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x178)])),console[_0x4fa01c(0x1eb)](_0x4fa01c(0x193)+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)])),console[_0x4fa01c(0x1eb)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)])),console[_0x4fa01c(0x1eb)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)]['chatInterfaces']));const _0x2906b6=_0x29b36e[_0x4fa01c(0x21f)]['experimentalKnowledgeBases'][_0x4fa01c(0x183)]>0x0||_0x29b36e['counts'][_0x4fa01c(0x1d1)][_0x4fa01c(0x1b0)]>0x0||_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)][_0x4fa01c(0x1d7)]>0x0||_0x29b36e['counts'][_0x4fa01c(0x1ae)][_0x4fa01c(0x183)]>0x0||_0x29b36e['counts'][_0x4fa01c(0x1ae)][_0x4fa01c(0x1b0)]>0x0||_0x29b36e[_0x4fa01c(0x21f)]['experimentalArtifacts'][_0x4fa01c(0x1d7)]>0x0;_0x2906b6&&(console[_0x4fa01c(0x1eb)](_0x4fa01c(0x1af)+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)])),console[_0x4fa01c(0x1eb)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x29b36e['counts'][_0x4fa01c(0x1ae)])));console[_0x4fa01c(0x1eb)]('\x20\x20Source:\x20'+a4_0x4e69c3[_0x4fa01c(0x222)](_0x267b76)),displayDiffs(_0x29b36e['agents'],_0x29b36e['knowledgeBases'],_0x29b36e[_0x4fa01c(0x195)],_0x29b36e[_0x4fa01c(0x178)],_0x29b36e['integrations'],_0x29b36e['experimentalKnowledgeBases'],_0x29b36e[_0x4fa01c(0x1ae)],_0x29b36e[_0x4fa01c(0x19b)],_0x29b36e['chatInterfaces']);if(_0xf871b4)return console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x217)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x9bdad8===0x0&&_0x3eef71===0x0){console[_0x4fa01c(0x1eb)](a4_0x4e69c3['green'](_0x4fa01c(0x213)));const _0x40d21e=getLLMProjectUrl(_0x14ea7c,_0x29b36e[_0x4fa01c(0x1ca)]);return console['log'](_0x4fa01c(0x1a5)+a4_0x4e69c3[_0x4fa01c(0x222)](_0x40d21e)),0x0;}if(!_0xacbea6&&!_0x44878e){if(!isInteractive())return console[_0x4fa01c(0x1c1)](a4_0x4e69c3['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4fa01c(0x1c1)](a4_0x4e69c3[_0x4fa01c(0x1c9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ae0c1=await confirmKey(_0x4fa01c(0x1b1)+(_0x9bdad8+_0x3eef71)+'\x20resources?');if(!_0x3ae0c1)return console[_0x4fa01c(0x1eb)](a4_0x4e69c3['yellow'](_0x4fa01c(0x227)),_0x4fa01c(0x1e1)),0x1;}const {data:_0x4c5bdd}=await withSpinner('Pushing\x20to\x20project...',()=>_0x3fa027[_0x4fa01c(0x1d3)][_0x4fa01c(0x20e)](_0x267b76,{'force':_0x44878e})),_0x1ba7ac=_0x4c5bdd[_0x4fa01c(0x21f)][_0x4fa01c(0x215)]['errors']>0x0||_0x4c5bdd[_0x4fa01c(0x21f)]['knowledgeBases'][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd[_0x4fa01c(0x21f)]['textKnowledgeBases'][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd['counts']['prompts'][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd[_0x4fa01c(0x21f)][_0x4fa01c(0x1e7)][_0x4fa01c(0x1b4)]>0x0;if(_0x1ba7ac){console[_0x4fa01c(0x1eb)](a4_0x4e69c3['yellow'](_0x4fa01c(0x19c))),console['log'](),console[_0x4fa01c(0x1eb)](a4_0x4e69c3['red']('Errors:'));for(const _0x1365da of _0x4c5bdd[_0x4fa01c(0x215)]){_0x1365da[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3['red']('\x20\x20Agent\x20\x22'+_0x1365da[_0x4fa01c(0x185)]+_0x4fa01c(0x1d9)+_0x1365da[_0x4fa01c(0x1c1)]));}for(const _0x3359c9 of _0x4c5bdd['knowledgeBases']){_0x3359c9[_0x4fa01c(0x1e6)]==='error'&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x1c7)+_0x3359c9[_0x4fa01c(0x20b)]+_0x4fa01c(0x1d9)+_0x3359c9[_0x4fa01c(0x1c1)]));}for(const _0x96afff of _0x4c5bdd[_0x4fa01c(0x195)]){_0x96afff[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console['log'](a4_0x4e69c3['red'](_0x4fa01c(0x1f1)+_0x96afff[_0x4fa01c(0x20b)]+_0x4fa01c(0x1d9)+_0x96afff[_0x4fa01c(0x1c1)]));}for(const _0x448791 of _0x4c5bdd[_0x4fa01c(0x178)]){_0x448791[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x182)+_0x448791['name']+'\x22:\x20'+_0x448791['error']));}for(const _0x416d87 of _0x4c5bdd[_0x4fa01c(0x22e)]){_0x416d87[_0x4fa01c(0x1e6)]==='error'&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x1ec)+_0x416d87['name']+_0x4fa01c(0x1d9)+_0x416d87[_0x4fa01c(0x1c1)]));}for(const _0x37e465 of _0x4c5bdd[_0x4fa01c(0x19b)]){_0x37e465[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x219)+_0x37e465['name']+_0x4fa01c(0x1d9)+_0x37e465[_0x4fa01c(0x1c1)]));}for(const _0x500616 of _0x4c5bdd[_0x4fa01c(0x1e7)]){_0x500616[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console['log'](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x1a9)+_0x500616[_0x4fa01c(0x20b)]+_0x4fa01c(0x1d9)+_0x500616[_0x4fa01c(0x1c1)]));}return 0x1;}console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1c3)](_0x4fa01c(0x1d5)+(_0x9bdad8+_0x3eef71)+_0x4fa01c(0x17d)+_0x4c5bdd[_0x4fa01c(0x206)]+'\x27'));const _0x441c03=getLLMProjectUrl(_0x14ea7c,_0x4c5bdd[_0x4fa01c(0x1ca)]);return console[_0x4fa01c(0x1eb)](_0x4fa01c(0x1a5)+a4_0x4e69c3[_0x4fa01c(0x222)](_0x441c03)),0x0;}}
|
|
1
|
+
const a4_0x5dd844=a4_0x32b6;(function(_0x3a1af5,_0x1d5667){const _0x136010=a4_0x32b6,_0x5da64b=_0x3a1af5();while(!![]){try{const _0x19a5d1=parseInt(_0x136010(0x155))/0x1+-parseInt(_0x136010(0xe7))/0x2*(-parseInt(_0x136010(0x175))/0x3)+parseInt(_0x136010(0x12b))/0x4*(parseInt(_0x136010(0x16a))/0x5)+-parseInt(_0x136010(0x165))/0x6+-parseInt(_0x136010(0xe4))/0x7*(parseInt(_0x136010(0x11b))/0x8)+parseInt(_0x136010(0x1a6))/0x9*(parseInt(_0x136010(0x18c))/0xa)+parseInt(_0x136010(0xf4))/0xb*(-parseInt(_0x136010(0x148))/0xc);if(_0x19a5d1===_0x1d5667)break;else _0x5da64b['push'](_0x5da64b['shift']());}catch(_0x5d2ab7){_0x5da64b['push'](_0x5da64b['shift']());}}}(a4_0x3779,0x4689e));function a4_0x3779(){const _0x494c2b=['New\x20project\x20name\x20is\x20required','\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','Using\x20project\x20from\x20context:\x20','diff','agentId','\x22\x20to\x20a\x20different\x20profile','Cannot\x20clone\x20from\x20context\x20project\x20\x22','prompts','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','created','Output:\x20','projectName','llmProject','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aPush\x20','no_local_folder','\x20\x20Knowledge\x20Bases:\x20','errors','no_context','\x20\x20Chat\x20Interface\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','New\x20project\x20ID:\x20','8304rVSUdJ','\x20successfully','chatInterfaces','\x20new','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aPull\x20summary\x20for\x20\x27','red','Output\x20path:\x20','error','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','MISSING_ARGUMENT','\x20created','\x20resources\x20to\x20\x27','170866zWmLli','Dry\x20run\x20-\x20no\x20files\x20written','repeat','cwd-config','\x0a✔\x20Pulled\x20','arg-dir','projectDir','\x20resources?','\x0aChanges\x20to\x20prompt\x20\x27','execute','\x20\x20Experimental\x20Artifact\x20\x22','description','\x20changed','agent:clone','\x20\x20Form\x20Interface\x20\x22','\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','524280wIOzbJ','\x20\x20Integrations:\x20','\x20\x20Prompt\x20\x22','Agent:\x20','yes','130OssIyl','textKnowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','newProjectName','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20--profile\x20','\x20\x20Experimental\x20Artifacts:\x20','green','\x20\x20Agents:\x20','message','21GgVtZH','\x20files?','integrations','force','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aChanges\x20to\x20chat\x20interface\x20\x27','pullAgent','\x20files\x20to\x20','join','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20errors','\x0aError:','\x20\x20Chat\x20Interfaces:\x20','dryRun','\x0aErrors\x20found:','pushProject','experimentalArtifacts','context','\x20\x20Text\x20Knowledge\x20Bases:\x20','agent:pull','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','458020vAWhhZ','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\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','Using\x20project:\x20','Cloning\x20\x22','\x22...','experimentalKnowledgeBases','cyan','\x0a✔\x20Pushed\x20','Source:\x20','✔\x20Context\x20set:\x20','<new-name>','llm_project','\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','Would\x20pull\x20agent:\x20','dim','Errors:','Using\x20context\x20project:\x20','parse','\x20\x20Source:\x20','found','Summary:','\x27\x20to\x20create\x20the\x20folder\x20structure.','Would\x20push\x20agent:\x20','reason','\x0aProject\x20pushed\x20with\x20errors','9dpnEwO','\x20|\x20','cwd','\x20\x20Form\x20Interfaces:\x20','\x22\x20from\x20project\x20\x22','pullProject','projectId','483lwZPgm','\x20\x20Integration\x20\x22','cloneProject','131658IhBQZm','unchanged','dirname','tdx.json','outputDir','\x20\x20Knowledge\x20Base\x20\x22','New\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','updated','Cancelled','sourceProjectName','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20updated','2112VYiHvq','profile','Pushing\x20to\x20project...','knowledgeBases','yellow','gray','\x20\x20tdx\x20agent\x20pull\x20','new','Project:\x20','action','Analyzing\x20project\x20\x22','agent.yml','Using\x20project\x20from\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Failed\x20to\x20push\x20agent:\x20','Status:\x20','Project\x20cloned\x20successfully','counts','INVALID_ARGUMENT','\x20=\x20','site','agents','\x0aPush\x20summary\x20for\x20\x27','llm','session','\x20\x20Agent\x20\x22','name','Agent\x20pulled\x20successfully','source','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x22:\x20','formInterfaces','Using\x20local\x20project:\x20','Agent\x20','agent:push','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','41112pYWRfg','newProjectId','outputPath','utf-8','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','total','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Chat:\x20','Pushing\x20agent\x20from\x20\x22','Clone\x20\x22','\x20\x20Prompts:\x20','\x0aChanges:','Analyzing\x20changes\x20to\x20push...','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20unchanged','\x20\x20Target:\x20','28660oewYIB','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','log','agentName','\x0aWrite\x20','Project\x20cloned\x20with\x20errors','push'];a4_0x3779=function(){return _0x494c2b;};return a4_0x3779();}import a4_0x35d933 from'chalk';import a4_0x468d61 from'path';function a4_0x32b6(_0x4a26ac,_0x3a3be9){_0x4a26ac=_0x4a26ac-0xe0;const _0x3779b6=a4_0x3779();let _0x32b6fd=_0x3779b6[_0x4a26ac];return _0x32b6fd;}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1f2e50){const _0x4e7f10=a4_0x32b6,_0x54f812=[];if(_0x1f2e50[_0x4e7f10(0x120)]!==undefined)_0x54f812[_0x4e7f10(0x131)](_0x1f2e50['total']+'\x20total');if(_0x1f2e50[_0x4e7f10(0xfb)]!==undefined&&_0x1f2e50[_0x4e7f10(0xfb)]>0x0)_0x54f812[_0x4e7f10(0x131)](a4_0x35d933[_0x4e7f10(0x172)](_0x1f2e50['new']+_0x4e7f10(0x14b)));if(_0x1f2e50[_0x4e7f10(0x13b)]!==undefined&&_0x1f2e50[_0x4e7f10(0x13b)]>0x0)_0x54f812[_0x4e7f10(0x131)](a4_0x35d933['green'](_0x1f2e50['created']+_0x4e7f10(0x153)));if(_0x1f2e50['updated']!==undefined&&_0x1f2e50['updated']>0x0)_0x54f812[_0x4e7f10(0x131)](a4_0x35d933[_0x4e7f10(0xf8)](_0x1f2e50[_0x4e7f10(0xef)]+_0x4e7f10(0xf3)));if(_0x1f2e50[_0x4e7f10(0xe8)]!==undefined&&_0x1f2e50[_0x4e7f10(0xe8)]>0x0)_0x54f812[_0x4e7f10(0x131)](a4_0x35d933[_0x4e7f10(0xf9)](_0x1f2e50[_0x4e7f10(0xe8)]+_0x4e7f10(0x129)));if(_0x1f2e50[_0x4e7f10(0x143)]!==undefined&&_0x1f2e50[_0x4e7f10(0x143)]>0x0)_0x54f812[_0x4e7f10(0x131)](a4_0x35d933['red'](_0x1f2e50['errors']+_0x4e7f10(0x181)));return _0x54f812[_0x4e7f10(0x17e)](',\x20');}function displayDiffs(_0x4a561b,_0x2b7022,_0x393dbb,_0x151bda,_0x4a985b,_0x2c99b0,_0x31689d,_0x219da4,_0x75b55c){const _0x1bb01b=a4_0x32b6;for(const _0x369d18 of _0x4a561b){if(_0x369d18[_0x1bb01b(0x135)]){const _0x5127f1=_0x369d18['agentName']||_0x369d18[_0x1bb01b(0x10e)];console[_0x1bb01b(0x12d)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x5127f1+'\x27:'),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)),console[_0x1bb01b(0x12d)](_0x369d18[_0x1bb01b(0x135)]),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c));}}for(const _0x1c367f of _0x2b7022){_0x1c367f[_0x1bb01b(0x135)]&&(console['log'](_0x1bb01b(0x101)+_0x1c367f['name']+'\x27:'),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)),console[_0x1bb01b(0x12d)](_0x1c367f[_0x1bb01b(0x135)]),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)));}for(const _0x6ef322 of _0x393dbb){_0x6ef322[_0x1bb01b(0x135)]&&(console[_0x1bb01b(0x12d)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x6ef322['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x1bb01b(0x12d)](_0x6ef322[_0x1bb01b(0x135)]),console['log']('─'[_0x1bb01b(0x157)](0x3c)));}for(const _0x547d5c of _0x151bda){_0x547d5c[_0x1bb01b(0x135)]&&(console[_0x1bb01b(0x12d)](_0x1bb01b(0x15d)+_0x547d5c[_0x1bb01b(0x10e)]+'\x27:'),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)),console[_0x1bb01b(0x12d)](_0x547d5c['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x36a38c of _0x4a985b){_0x36a38c['diff']&&(console[_0x1bb01b(0x12d)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x36a38c[_0x1bb01b(0x10e)]+'\x27:'),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)),console[_0x1bb01b(0x12d)](_0x36a38c[_0x1bb01b(0x135)]),console[_0x1bb01b(0x12d)]('─'['repeat'](0x3c)));}for(const _0x10784a of _0x2c99b0){_0x10784a[_0x1bb01b(0x135)]&&(console[_0x1bb01b(0x12d)](_0x1bb01b(0x114)+_0x10784a[_0x1bb01b(0x10e)]+'\x27:'),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)),console[_0x1bb01b(0x12d)](_0x10784a[_0x1bb01b(0x135)]),console['log']('─'[_0x1bb01b(0x157)](0x3c)));}for(const _0x3ee2c5 of _0x31689d){_0x3ee2c5[_0x1bb01b(0x135)]&&(console[_0x1bb01b(0x12d)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x3ee2c5['name']+'\x27:'),console['log']('─'[_0x1bb01b(0x157)](0x3c)),console[_0x1bb01b(0x12d)](_0x3ee2c5['diff']),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)));}for(const _0x3184df of _0x219da4){_0x3184df[_0x1bb01b(0x135)]&&(console[_0x1bb01b(0x12d)](_0x1bb01b(0x16e)+_0x3184df[_0x1bb01b(0x10e)]+'\x27:'),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)),console['log'](_0x3184df[_0x1bb01b(0x135)]),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)));}for(const _0x14abd9 of _0x75b55c){_0x14abd9['diff']&&(console[_0x1bb01b(0x12d)](_0x1bb01b(0x17b)+_0x14abd9['name']+'\x27:'),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)),console['log'](_0x14abd9[_0x1bb01b(0x135)]),console[_0x1bb01b(0x12d)]('─'[_0x1bb01b(0x157)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5dd844(0x10e)]=a4_0x5dd844(0x18a);['description']=a4_0x5dd844(0xee);async[a4_0x5dd844(0x15e)](_0x24e7a1){const _0x206c3f=a4_0x5dd844,{options:_0x3ef74f,args:_0x473a4c,tdx:_0xf8495b}=_0x24e7a1,_0x3ff7a9=_0x473a4c[0x0],_0x1c8121=_0x473a4c[0x1],_0x2cf972=_0x3ef74f['output'],_0x78b6b4=_0x3ef74f[_0x206c3f(0x184)],_0x100482=_0x3ef74f[_0x206c3f(0x178)],_0xd2b6dd=_0x3ef74f[_0x206c3f(0x169)],_0x1ab350=_0x3ef74f[_0x206c3f(0x13e)],_0x254003=_0x3ef74f['agent'];let _0x3a8a9f;if(_0x3ff7a9){const _0x398587=a4_0x468d61[_0x206c3f(0x17e)](_0x3ff7a9,_0x206c3f(0xea));if(existsSync(_0x398587))try{const _0x34b2b5=JSON[_0x206c3f(0x19e)](readFileSync(_0x398587,_0x206c3f(0x11e)));_0x34b2b5[_0x206c3f(0x198)]&&(_0x3a8a9f={'llm_project':_0x34b2b5['llm_project']});}catch{}}const _0x37ad4e=findAgentConfigPath(process[_0x206c3f(0x1a8)]());let _0x2c5ee0;if(_0x37ad4e)try{const _0x452b9d=JSON[_0x206c3f(0x19e)](readFileSync(_0x37ad4e,_0x206c3f(0x11e)));_0x452b9d[_0x206c3f(0x198)]&&(_0x2c5ee0={'llm_project':_0x452b9d[_0x206c3f(0x198)]});}catch{}const _0x2fe0d9=resolveAgentPullArgs({'arg':_0x3ff7a9,'agentNameArg':_0x1c8121,'agentFlag':_0x254003,'contextProject':_0x1ab350,'argDirConfig':_0x3a8a9f,'cwdConfigPath':_0x37ad4e||undefined,'cwdConfig':_0x2c5ee0}),{projectNameOrId:_0x940298,targetAgentName:_0x6c6170,existingOutputDir:_0x521ad5,source:_0x2e7b4c}=_0x2fe0d9;if(_0x2e7b4c===_0x206c3f(0x15a))console[_0x206c3f(0x12d)](a4_0x35d933[_0x206c3f(0x19b)](_0x206c3f(0x100)+a4_0x468d61[_0x206c3f(0x17e)](_0x3ff7a9,_0x206c3f(0xea))+':\x20'+_0x940298));else{if(_0x2e7b4c===_0x206c3f(0x158))console[_0x206c3f(0x12d)](a4_0x35d933[_0x206c3f(0x19b)](_0x206c3f(0x18f)+_0x940298));else _0x2e7b4c===_0x206c3f(0x188)&&console[_0x206c3f(0x12d)](a4_0x35d933['dim'](_0x206c3f(0x134)+_0x940298));}if(!_0x940298)return _0x254003?(console[_0x206c3f(0x12d)](a4_0x35d933['yellow'](_0x206c3f(0x128))),console[_0x206c3f(0x12d)](_0x206c3f(0x179)),console[_0x206c3f(0x12d)](_0x206c3f(0x11a))):(console[_0x206c3f(0x12d)](a4_0x35d933['yellow'](_0x206c3f(0x146))),console[_0x206c3f(0x12d)]('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['log'](_0x206c3f(0x164)),console[_0x206c3f(0x12d)](_0x206c3f(0x18e)),console[_0x206c3f(0x12d)](_0x206c3f(0x133)),console[_0x206c3f(0x12d)](_0x206c3f(0x199))),0x1;if(_0x6c6170){const {data:_0x166adc}=await withSpinner('Pulling\x20agent\x20\x22'+_0x6c6170+_0x206c3f(0xe1)+_0x940298+_0x206c3f(0x191),()=>_0xf8495b[_0x206c3f(0x10b)][_0x206c3f(0x17c)](_0x940298,_0x6c6170,_0x2cf972,{'dryRun':_0x78b6b4,'force':_0x100482}));if(_0x78b6b4)return console['log'](a4_0x35d933['yellow'](_0x206c3f(0x156))),console[_0x206c3f(0x12d)](_0x206c3f(0x19a)+_0x166adc[_0x206c3f(0x12e)]),console[_0x206c3f(0x12d)](_0x206c3f(0x14f)+_0x166adc[_0x206c3f(0x11d)]),_0x166adc[_0x206c3f(0x135)]&&(console[_0x206c3f(0x12d)](_0x206c3f(0x126)),console[_0x206c3f(0x12d)]('─'[_0x206c3f(0x157)](0x3c)),console[_0x206c3f(0x12d)](_0x166adc[_0x206c3f(0x135)]),console[_0x206c3f(0x12d)]('─'[_0x206c3f(0x157)](0x3c))),0x0;return console[_0x206c3f(0x12d)](a4_0x35d933['green'](_0x206c3f(0x10f))),console[_0x206c3f(0x12d)](_0x206c3f(0x168)+_0x166adc['agentName']),console['log'](_0x206c3f(0x13c)+_0x166adc[_0x206c3f(0x11d)]),console['log'](_0x206c3f(0x103)+(_0x166adc['isNew']?a4_0x35d933['green'](_0x206c3f(0xfb)):_0x166adc['hasChanges']?a4_0x35d933['yellow'](_0x206c3f(0xef)):a4_0x35d933[_0x206c3f(0xf9)](_0x206c3f(0xe8)))),0x0;}const _0xe5a8e4=_0x521ad5||_0x2cf972,{data:_0x4bc2ea}=await withSpinner(_0x206c3f(0xfe)+_0x940298+_0x206c3f(0x191),()=>_0xf8495b[_0x206c3f(0x10b)]['pullProject'](_0x940298,_0xe5a8e4,{'dryRun':!![]})),_0x4c4fa8=_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x109)][_0x206c3f(0xfb)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0xf7)]['new']+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x16b)][_0x206c3f(0xfb)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x139)]['new']+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x177)][_0x206c3f(0xfb)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x192)][_0x206c3f(0xfb)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x187)][_0x206c3f(0xfb)]+_0x4bc2ea[_0x206c3f(0x105)]['formInterfaces'][_0x206c3f(0xfb)]+_0x4bc2ea['counts'][_0x206c3f(0x14a)][_0x206c3f(0xfb)],_0x36cb8a=_0x4bc2ea[_0x206c3f(0x105)]['agents'][_0x206c3f(0xef)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0xf7)][_0x206c3f(0xef)]+_0x4bc2ea['counts'][_0x206c3f(0x16b)][_0x206c3f(0xef)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x139)][_0x206c3f(0xef)]+_0x4bc2ea['counts'][_0x206c3f(0x177)][_0x206c3f(0xef)]+_0x4bc2ea['counts'][_0x206c3f(0x192)][_0x206c3f(0xef)]+_0x4bc2ea['counts'][_0x206c3f(0x187)][_0x206c3f(0xef)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x116)][_0x206c3f(0xef)]+_0x4bc2ea['counts'][_0x206c3f(0x14a)][_0x206c3f(0xef)],_0x12418e=_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x109)]['unchanged']+_0x4bc2ea['counts'][_0x206c3f(0xf7)][_0x206c3f(0xe8)]+_0x4bc2ea[_0x206c3f(0x105)]['textKnowledgeBases'][_0x206c3f(0xe8)]+_0x4bc2ea['counts'][_0x206c3f(0x139)][_0x206c3f(0xe8)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x177)][_0x206c3f(0xe8)]+_0x4bc2ea['counts'][_0x206c3f(0x192)]['unchanged']+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x187)][_0x206c3f(0xe8)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x116)][_0x206c3f(0xe8)]+_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x14a)][_0x206c3f(0xe8)];console[_0x206c3f(0x12d)](_0x206c3f(0x14d)+_0x4bc2ea[_0x206c3f(0x13d)]+'\x27:'),console[_0x206c3f(0x12d)]('\x20\x20'+a4_0x35d933[_0x206c3f(0x172)]('+\x20'+_0x4c4fa8+_0x206c3f(0x14b))+_0x206c3f(0x1a7)+a4_0x35d933[_0x206c3f(0xf8)]('~\x20'+_0x36cb8a+_0x206c3f(0x161))+_0x206c3f(0x1a7)+a4_0x35d933[_0x206c3f(0x19b)]('=\x20'+_0x12418e+'\x20unchanged')),console[_0x206c3f(0x12d)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4bc2ea[_0x206c3f(0x105)]['agents'])),console[_0x206c3f(0x12d)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0xf7)])),console[_0x206c3f(0x12d)](_0x206c3f(0x189)+formatCountSummary(_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x16b)])),console[_0x206c3f(0x12d)](_0x206c3f(0x125)+formatCountSummary(_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x139)])),console[_0x206c3f(0x12d)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4bc2ea['counts'][_0x206c3f(0x177)])),console['log']('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x4bc2ea['counts'][_0x206c3f(0x116)])),console[_0x206c3f(0x12d)](_0x206c3f(0x183)+formatCountSummary(_0x4bc2ea[_0x206c3f(0x105)]['chatInterfaces']));const _0x3d809a=_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x192)][_0x206c3f(0x120)]>0x0||_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x187)][_0x206c3f(0x120)]>0x0;_0x3d809a&&(console['log'](_0x206c3f(0x14c)+formatCountSummary(_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x192)])),console['log'](_0x206c3f(0x171)+formatCountSummary(_0x4bc2ea[_0x206c3f(0x105)][_0x206c3f(0x187)])));console['log'](_0x206c3f(0x12a)+a4_0x35d933['cyan'](_0x4bc2ea[_0x206c3f(0xeb)])),displayDiffs(_0x4bc2ea[_0x206c3f(0x109)],_0x4bc2ea[_0x206c3f(0xf7)],_0x4bc2ea[_0x206c3f(0x16b)],_0x4bc2ea[_0x206c3f(0x139)],_0x4bc2ea[_0x206c3f(0x177)],_0x4bc2ea['experimentalKnowledgeBases'],_0x4bc2ea[_0x206c3f(0x187)],_0x4bc2ea['formInterfaces'],_0x4bc2ea[_0x206c3f(0x14a)]);if(_0x78b6b4)return console[_0x206c3f(0x12d)](a4_0x35d933['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4c4fa8===0x0&&_0x36cb8a===0x0)return console[_0x206c3f(0x12d)](a4_0x35d933[_0x206c3f(0x172)](_0x206c3f(0x180))),saveSessionContext({'llm_project':_0x4bc2ea[_0x206c3f(0x13d)]},_0x3ef74f[_0x206c3f(0x10c)]),console[_0x206c3f(0x12d)](a4_0x35d933[_0x206c3f(0x172)](_0x206c3f(0x196)+a4_0x35d933[_0x206c3f(0x19b)](_0x206c3f(0x198))+_0x206c3f(0x107)+a4_0x35d933['cyan'](_0x4bc2ea[_0x206c3f(0x13d)]))),0x0;if(!_0xd2b6dd&&!_0x100482){if(!isInteractive())return console[_0x206c3f(0x150)](a4_0x35d933[_0x206c3f(0x14e)](_0x206c3f(0x182)),_0x206c3f(0x18b)),console['error'](a4_0x35d933[_0x206c3f(0x19b)](_0x206c3f(0x17f))),0x1;const _0x322941=await confirmKey(_0x206c3f(0x12f)+(_0x4c4fa8+_0x36cb8a)+_0x206c3f(0x176));if(!_0x322941)return console[_0x206c3f(0x12d)](a4_0x35d933['yellow'](_0x206c3f(0xf0)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x303202}=await withSpinner('Writing\x20files...',()=>_0xf8495b[_0x206c3f(0x10b)][_0x206c3f(0xe2)](_0x940298,_0xe5a8e4,{'force':_0x100482}));return console[_0x206c3f(0x12d)](a4_0x35d933[_0x206c3f(0x172)](_0x206c3f(0x159)+(_0x4c4fa8+_0x36cb8a)+_0x206c3f(0x17d)+_0x303202[_0x206c3f(0xeb)])),saveSessionContext({'llm_project':_0x303202[_0x206c3f(0x13d)]},_0x3ef74f[_0x206c3f(0x10c)]),console[_0x206c3f(0x12d)](a4_0x35d933[_0x206c3f(0x172)](_0x206c3f(0x196)+a4_0x35d933[_0x206c3f(0x19b)](_0x206c3f(0x198))+_0x206c3f(0x107)+a4_0x35d933[_0x206c3f(0x193)](_0x303202[_0x206c3f(0x13d)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5dd844(0x10e)]=a4_0x5dd844(0x162);[a4_0x5dd844(0x160)]=a4_0x5dd844(0x151);async['execute'](_0x2c10d4){const _0x2b3c5d=a4_0x5dd844,{options:_0x50dca4,args:_0x1c3aac,tdx:_0x314b9c}=_0x2c10d4,_0x4c82a0=_0x1c3aac[0x0],_0x4b5b81=_0x50dca4[_0x2b3c5d(0x10e)],_0x5045a5=_0x50dca4[_0x2b3c5d(0x184)],_0x10a461=_0x50dca4[_0x2b3c5d(0x169)],_0x387d4a=_0x50dca4[_0x2b3c5d(0x108)],_0x29d06c=_0x50dca4[_0x2b3c5d(0x13e)];let _0x1cfb08;const _0x35df6a=findAgentConfigPath(process[_0x2b3c5d(0x1a8)]());if(_0x4c82a0){const _0x27a082=a4_0x468d61[_0x2b3c5d(0x17e)](_0x4c82a0,_0x2b3c5d(0xea));existsSync(_0x27a082)?(_0x1cfb08=_0x4c82a0,console[_0x2b3c5d(0x12d)](a4_0x35d933['dim'](_0x2b3c5d(0x117)+_0x4c82a0))):_0x1cfb08=_0x4c82a0;}else{if(_0x35df6a)_0x1cfb08=a4_0x468d61['dirname'](_0x35df6a),console['log'](a4_0x35d933[_0x2b3c5d(0x19b)]('Using\x20current\x20project:\x20'+_0x1cfb08));else{if(_0x29d06c){const _0xeceb5b=sanitizeForFilesystem(_0x29d06c);let _0x55b6a5=_0xeceb5b,_0x333c7d=a4_0x468d61[_0x2b3c5d(0x17e)](process[_0x2b3c5d(0x1a8)](),_0x2b3c5d(0x109),_0xeceb5b,_0x2b3c5d(0xea));if(!existsSync(_0x333c7d)){const _0x257c92=normalizeName(_0x29d06c),_0x5ca4f3=a4_0x468d61['join'](process[_0x2b3c5d(0x1a8)](),_0x2b3c5d(0x109),_0x257c92,_0x2b3c5d(0xea));existsSync(_0x5ca4f3)&&(_0x55b6a5=_0x257c92,_0x333c7d=_0x5ca4f3);}if(existsSync(_0x333c7d))_0x1cfb08=a4_0x468d61[_0x2b3c5d(0xe9)](_0x333c7d),console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x19b)](_0x2b3c5d(0x117)+_0x1cfb08));else{const _0x4c588d=_0x50dca4[_0x2b3c5d(0xf5)];if(_0x4c588d)throw new SDKError(ErrorCode[_0x2b3c5d(0x106)],_0x2b3c5d(0x138)+_0x29d06c+_0x2b3c5d(0x137),undefined,{'helpText':_0x2b3c5d(0x111)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x2b3c5d(0xfa)+_0x29d06c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x55b6a5+'\x20--name\x20'+(_0x4b5b81||_0x2b3c5d(0x197))+_0x2b3c5d(0x170)+_0x4c588d)});_0x1cfb08=_0x29d06c,console[_0x2b3c5d(0x12d)](a4_0x35d933['dim'](_0x2b3c5d(0x19d)+_0x29d06c));}}}}if(!_0x1cfb08)return console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0xf8)](_0x2b3c5d(0x17a))),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x13f)),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x18d)),console[_0x2b3c5d(0x12d)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x2b3c5d(0x13a)),0x1;if(!_0x4b5b81)throw new SDKError(ErrorCode[_0x2b3c5d(0x152)],_0x2b3c5d(0x132),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x10a461&&!_0x5045a5){if(!isInteractive())return console['error'](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0x182)),_0x2b3c5d(0x18b)),console['error'](a4_0x35d933[_0x2b3c5d(0x19b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3cc7a6=await confirmKey(_0x2b3c5d(0x124)+_0x1cfb08+'\x22\x20to\x20new\x20project\x20\x22'+_0x4b5b81+'\x22?');if(!_0x3cc7a6)return console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0xf8)](_0x2b3c5d(0xf0))),0x1;}const {data:_0x54ec8d}=await withSpinner(_0x2b3c5d(0x190)+_0x1cfb08+'\x22\x20to\x20\x22'+_0x4b5b81+_0x2b3c5d(0x191),()=>_0x314b9c[_0x2b3c5d(0x10b)][_0x2b3c5d(0xe6)](_0x1cfb08,_0x4b5b81,{'dryRun':_0x5045a5}));if(_0x5045a5){console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0xf8)](_0x2b3c5d(0x16c))),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x195)+_0x54ec8d[_0x2b3c5d(0xf1)]),console['log'](_0x2b3c5d(0xed)+_0x4b5b81),console[_0x2b3c5d(0x12d)]('Would\x20clone:'),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x173)+_0x54ec8d['counts'][_0x2b3c5d(0x109)][_0x2b3c5d(0x13b)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x54ec8d[_0x2b3c5d(0x105)]['knowledgeBases'][_0x2b3c5d(0x13b)]),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x125)+_0x54ec8d['counts'][_0x2b3c5d(0x139)][_0x2b3c5d(0x13b)]),console['log'](_0x2b3c5d(0xe0)+_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x116)][_0x2b3c5d(0x13b)]),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x183)+_0x54ec8d['counts'][_0x2b3c5d(0x14a)][_0x2b3c5d(0x13b)]);const _0x21066c=_0x54ec8d['counts']['experimentalKnowledgeBases'][_0x2b3c5d(0x13b)]>0x0||_0x54ec8d['counts'][_0x2b3c5d(0x187)][_0x2b3c5d(0x13b)]>0x0;return _0x21066c&&(console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x14c)+_0x54ec8d['counts']['experimentalKnowledgeBases']['created']),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x171)+_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x187)][_0x2b3c5d(0x13b)])),0x0;}const _0x389fb6=_0x54ec8d['counts']['agents']['errors']>0x0||_0x54ec8d['counts'][_0x2b3c5d(0xf7)][_0x2b3c5d(0x143)]>0x0||_0x54ec8d[_0x2b3c5d(0x105)]['prompts']['errors']>0x0||_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x116)][_0x2b3c5d(0x143)]>0x0||_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x14a)][_0x2b3c5d(0x143)]>0x0||_0x54ec8d['counts'][_0x2b3c5d(0x192)][_0x2b3c5d(0x143)]>0x0||_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x187)][_0x2b3c5d(0x143)]>0x0;_0x389fb6?console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0xf8)](_0x2b3c5d(0x130))):console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x172)](_0x2b3c5d(0x104)));console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x195)+_0x54ec8d[_0x2b3c5d(0xf1)]),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0xed)+_0x54ec8d[_0x2b3c5d(0x16d)]),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x147)+_0x54ec8d[_0x2b3c5d(0x11c)]),console['log'](),console['log'](_0x2b3c5d(0x1a1)),console['log'](_0x2b3c5d(0x173)+formatCountSummary(_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x109)])),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x142)+formatCountSummary(_0x54ec8d[_0x2b3c5d(0x105)]['knowledgeBases'])),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x125)+formatCountSummary(_0x54ec8d['counts'][_0x2b3c5d(0x139)])),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x166)+formatCountSummary(_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x177)])),console['log']('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x116)])),console['log'](_0x2b3c5d(0x183)+formatCountSummary(_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x14a)]));const _0x770021=_0x54ec8d['counts'][_0x2b3c5d(0x192)][_0x2b3c5d(0x13b)]>0x0||_0x54ec8d[_0x2b3c5d(0x105)]['experimentalKnowledgeBases']['updated']>0x0||_0x54ec8d[_0x2b3c5d(0x105)][_0x2b3c5d(0x192)]['unchanged']>0x0||_0x54ec8d['counts'][_0x2b3c5d(0x187)][_0x2b3c5d(0x13b)]>0x0||_0x54ec8d[_0x2b3c5d(0x105)]['experimentalArtifacts']['updated']>0x0||_0x54ec8d['counts'][_0x2b3c5d(0x187)][_0x2b3c5d(0xe8)]>0x0;_0x770021&&(console[_0x2b3c5d(0x12d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x54ec8d['counts'][_0x2b3c5d(0x192)])),console[_0x2b3c5d(0x12d)](_0x2b3c5d(0x171)+formatCountSummary(_0x54ec8d['counts'][_0x2b3c5d(0x187)])));if(_0x389fb6){console[_0x2b3c5d(0x12d)](),console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0x19c)));for(const _0x4eeb0f of _0x54ec8d[_0x2b3c5d(0x109)]){_0x4eeb0f[_0x2b3c5d(0xfd)]===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)]('\x20\x20Agent\x20\x22'+_0x4eeb0f[_0x2b3c5d(0x12e)]+_0x2b3c5d(0x115)+_0x4eeb0f[_0x2b3c5d(0x150)]));}for(const _0x384073 of _0x54ec8d[_0x2b3c5d(0xf7)]){_0x384073[_0x2b3c5d(0xfd)]===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0xec)+_0x384073['name']+'\x22:\x20'+_0x384073['error']));}for(const _0xf42e28 of _0x54ec8d[_0x2b3c5d(0x139)]){_0xf42e28[_0x2b3c5d(0xfd)]===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0x167)+_0xf42e28[_0x2b3c5d(0x10e)]+_0x2b3c5d(0x115)+_0xf42e28['error']));}for(const _0x26bcf1 of _0x54ec8d[_0x2b3c5d(0x177)]){_0x26bcf1['action']===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0xe5)+_0x26bcf1['name']+_0x2b3c5d(0x115)+_0x26bcf1['error']));}for(const _0x50fe37 of _0x54ec8d[_0x2b3c5d(0x116)]){_0x50fe37[_0x2b3c5d(0xfd)]===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)]('\x20\x20Form\x20Interface\x20\x22'+_0x50fe37[_0x2b3c5d(0x10e)]+'\x22:\x20'+_0x50fe37['error']));}for(const _0x5aedb0 of _0x54ec8d['chatInterfaces']){_0x5aedb0[_0x2b3c5d(0xfd)]===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0x145)+_0x5aedb0[_0x2b3c5d(0x10e)]+_0x2b3c5d(0x115)+_0x5aedb0[_0x2b3c5d(0x150)]));}for(const _0x15d559 of _0x54ec8d[_0x2b3c5d(0x192)]){_0x15d559[_0x2b3c5d(0xfd)]===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0x112)+_0x15d559[_0x2b3c5d(0x10e)]+_0x2b3c5d(0x115)+_0x15d559[_0x2b3c5d(0x150)]));}for(const _0x5598ec of _0x54ec8d[_0x2b3c5d(0x187)]){_0x5598ec[_0x2b3c5d(0xfd)]===_0x2b3c5d(0x150)&&console[_0x2b3c5d(0x12d)](a4_0x35d933[_0x2b3c5d(0x14e)](_0x2b3c5d(0x15f)+_0x5598ec[_0x2b3c5d(0x10e)]+_0x2b3c5d(0x115)+_0x5598ec[_0x2b3c5d(0x150)]));}return 0x1;}console[_0x2b3c5d(0x12d)]();const _0x19799e=getLLMProjectUrl(_0x387d4a,_0x54ec8d['newProjectId']);return console[_0x2b3c5d(0x12d)](_0x2b3c5d(0xfc)+a4_0x35d933[_0x2b3c5d(0x193)](_0x19799e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5dd844(0x10e)]=a4_0x5dd844(0x119);[a4_0x5dd844(0x160)]=a4_0x5dd844(0x12c);async['execute'](_0x3f2339){const _0x588482=a4_0x5dd844,{options:_0x162f71,args:_0x37b526,tdx:_0x197f17}=_0x3f2339;let _0x5085a7=_0x37b526[0x0]||process[_0x588482(0x1a8)]();const _0x5194fa=_0x162f71[_0x588482(0x184)],_0x5a46c0=_0x162f71[_0x588482(0x178)],_0x18495c=_0x162f71[_0x588482(0x169)],_0xd8ccae=_0x162f71['site'],_0x589a71=a4_0x468d61[_0x588482(0x17e)](_0x5085a7,_0x588482(0xff)),_0x2b9027=existsSync(_0x589a71);if(_0x2b9027){const {data:_0x49deae}=await withSpinner(_0x588482(0x123)+_0x5085a7+_0x588482(0x191),()=>_0x197f17[_0x588482(0x10b)]['pushAgent'](_0x5085a7,{'dryRun':_0x5194fa,'force':_0x5a46c0}));if(_0x5194fa)return console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0xf8)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x588482(0x12d)](_0x588482(0x1a3)+_0x49deae[_0x588482(0x12e)]),0x0;if(_0x49deae[_0x588482(0xfd)]===_0x588482(0x150))return console['log'](a4_0x35d933[_0x588482(0x14e)](_0x588482(0x102)+_0x49deae[_0x588482(0x150)])),0x1;console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0x172)](_0x588482(0x118)+_0x49deae['action']+_0x588482(0x149))),console[_0x588482(0x12d)](_0x588482(0x168)+_0x49deae[_0x588482(0x12e)]);if(_0x49deae['agentId']&&_0x49deae[_0x588482(0xe3)]){const _0x29755b=getLLMAgentChatUrl(_0xd8ccae,_0x49deae[_0x588482(0xe3)],_0x49deae[_0x588482(0x136)]);console[_0x588482(0x12d)](_0x588482(0x122)+a4_0x35d933[_0x588482(0x193)](_0x29755b));}return 0x0;}const _0x56724c=_0x162f71['llmProject'],_0xa2ca22=resolveProjectFromContext(_0x5085a7,_0x56724c);if(_0xa2ca22[_0x588482(0x1a0)])_0x5085a7=_0xa2ca22[_0x588482(0x15b)],_0xa2ca22[_0x588482(0x110)]===_0x588482(0x188)&&console[_0x588482(0x12d)](a4_0x35d933['dim']('Using\x20project:\x20'+_0x5085a7));else{let _0xc870ff=_0x588482(0x121);_0xa2ca22[_0x588482(0x1a4)]===_0x588482(0x141)&&(_0xc870ff=_0xa2ca22[_0x588482(0x174)]+_0x588482(0x11f)+_0xa2ca22['llmProject']+_0x588482(0x1a2));throw new SDKError(ErrorCode[_0x588482(0x106)],_0xa2ca22[_0x588482(0x1a4)]===_0x588482(0x144)?_0xa2ca22[_0x588482(0x174)]:'No\x20tdx.json\x20found\x20in\x20'+_0x5085a7,undefined,{'helpText':_0xc870ff});}const {data:_0x10c8fc}=await withSpinner(_0x588482(0x127),()=>_0x197f17[_0x588482(0x10b)]['pushProject'](_0x5085a7,{'dryRun':!![]})),_0x161011=_0x10c8fc[_0x588482(0x105)][_0x588482(0x109)][_0x588482(0x143)]>0x0;if(_0x161011){console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0x14e)](_0x588482(0x185)));for(const _0x4ed592 of _0x10c8fc[_0x588482(0x109)]){_0x4ed592[_0x588482(0xfd)]===_0x588482(0x150)&&console[_0x588482(0x12d)](a4_0x35d933['red']('\x20\x20Agent\x20\x22'+_0x4ed592['agentName']+_0x588482(0x115)+_0x4ed592[_0x588482(0x150)]));}return 0x1;}const _0x4ae20a=_0x10c8fc['counts'][_0x588482(0x109)][_0x588482(0x13b)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0xf7)]['created']+_0x10c8fc[_0x588482(0x105)]['textKnowledgeBases'][_0x588482(0x13b)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x139)][_0x588482(0x13b)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x177)]['created']+_0x10c8fc['counts'][_0x588482(0x192)][_0x588482(0x13b)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x187)][_0x588482(0x13b)]+_0x10c8fc['counts'][_0x588482(0x116)][_0x588482(0x13b)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x14a)][_0x588482(0x13b)],_0x1c0345=_0x10c8fc[_0x588482(0x105)]['agents'][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0xf7)][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)]['textKnowledgeBases'][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)]['prompts'][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)]['integrations'][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x192)][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)]['experimentalArtifacts'][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x116)][_0x588482(0xef)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x14a)][_0x588482(0xef)],_0x5b5baa=_0x10c8fc[_0x588482(0x105)][_0x588482(0x109)][_0x588482(0xe8)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0xf7)][_0x588482(0xe8)]+_0x10c8fc['counts'][_0x588482(0x16b)][_0x588482(0xe8)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x139)][_0x588482(0xe8)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x177)][_0x588482(0xe8)]+_0x10c8fc['counts'][_0x588482(0x192)][_0x588482(0xe8)]+_0x10c8fc[_0x588482(0x105)]['experimentalArtifacts'][_0x588482(0xe8)]+_0x10c8fc[_0x588482(0x105)][_0x588482(0x116)][_0x588482(0xe8)]+_0x10c8fc['counts'][_0x588482(0x14a)][_0x588482(0xe8)];console['log'](_0x588482(0x10a)+_0x10c8fc[_0x588482(0x13d)]+'\x27:'),console[_0x588482(0x12d)]('\x20\x20'+a4_0x35d933['green']('+\x20'+_0x4ae20a+_0x588482(0x14b))+'\x20|\x20'+a4_0x35d933['yellow']('~\x20'+_0x1c0345+_0x588482(0x161))+_0x588482(0x1a7)+a4_0x35d933[_0x588482(0x19b)]('=\x20'+_0x5b5baa+_0x588482(0x129))),console['log'](_0x588482(0x173)+formatCountSummary(_0x10c8fc[_0x588482(0x105)]['agents'])),console[_0x588482(0x12d)](_0x588482(0x142)+formatCountSummary(_0x10c8fc[_0x588482(0x105)][_0x588482(0xf7)])),console['log'](_0x588482(0x189)+formatCountSummary(_0x10c8fc[_0x588482(0x105)][_0x588482(0x16b)])),console[_0x588482(0x12d)](_0x588482(0x125)+formatCountSummary(_0x10c8fc[_0x588482(0x105)]['prompts'])),console['log'](_0x588482(0x166)+formatCountSummary(_0x10c8fc[_0x588482(0x105)][_0x588482(0x177)])),console[_0x588482(0x12d)](_0x588482(0xe0)+formatCountSummary(_0x10c8fc[_0x588482(0x105)][_0x588482(0x116)])),console['log'](_0x588482(0x183)+formatCountSummary(_0x10c8fc[_0x588482(0x105)][_0x588482(0x14a)]));const _0x1fe5b7=_0x10c8fc[_0x588482(0x105)][_0x588482(0x192)][_0x588482(0x13b)]>0x0||_0x10c8fc[_0x588482(0x105)][_0x588482(0x192)][_0x588482(0xef)]>0x0||_0x10c8fc[_0x588482(0x105)]['experimentalKnowledgeBases'][_0x588482(0xe8)]>0x0||_0x10c8fc['counts'][_0x588482(0x187)]['created']>0x0||_0x10c8fc[_0x588482(0x105)][_0x588482(0x187)][_0x588482(0xef)]>0x0||_0x10c8fc[_0x588482(0x105)][_0x588482(0x187)][_0x588482(0xe8)]>0x0;_0x1fe5b7&&(console[_0x588482(0x12d)](_0x588482(0x14c)+formatCountSummary(_0x10c8fc[_0x588482(0x105)]['experimentalKnowledgeBases'])),console['log'](_0x588482(0x171)+formatCountSummary(_0x10c8fc[_0x588482(0x105)][_0x588482(0x187)])));console[_0x588482(0x12d)](_0x588482(0x19f)+a4_0x35d933['cyan'](_0x5085a7)),displayDiffs(_0x10c8fc['agents'],_0x10c8fc[_0x588482(0xf7)],_0x10c8fc['textKnowledgeBases'],_0x10c8fc[_0x588482(0x139)],_0x10c8fc['integrations'],_0x10c8fc[_0x588482(0x192)],_0x10c8fc[_0x588482(0x187)],_0x10c8fc[_0x588482(0x116)],_0x10c8fc['chatInterfaces']);if(_0x5194fa)return console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0xf8)](_0x588482(0xf2))),0x0;if(_0x4ae20a===0x0&&_0x1c0345===0x0){console[_0x588482(0x12d)](a4_0x35d933['green'](_0x588482(0x16f)));const _0xe5c5f2=getLLMProjectUrl(_0xd8ccae,_0x10c8fc['projectId']);return console['log'](_0x588482(0xfc)+a4_0x35d933[_0x588482(0x193)](_0xe5c5f2)),0x0;}if(!_0x18495c&&!_0x5a46c0){if(!isInteractive())return console['error'](a4_0x35d933[_0x588482(0x14e)](_0x588482(0x182)),_0x588482(0x18b)),console[_0x588482(0x150)](a4_0x35d933['dim'](_0x588482(0x17f))),0x1;const _0xeafc7f=await confirmKey(_0x588482(0x140)+(_0x4ae20a+_0x1c0345)+_0x588482(0x15c));if(!_0xeafc7f)return console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0xf8)](_0x588482(0xf0)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x47adb0}=await withSpinner(_0x588482(0xf6),()=>_0x197f17[_0x588482(0x10b)][_0x588482(0x186)](_0x5085a7,{'force':_0x5a46c0})),_0x3236ff=_0x47adb0[_0x588482(0x105)][_0x588482(0x109)][_0x588482(0x143)]>0x0||_0x47adb0[_0x588482(0x105)][_0x588482(0xf7)]['errors']>0x0||_0x47adb0[_0x588482(0x105)][_0x588482(0x16b)][_0x588482(0x143)]>0x0||_0x47adb0[_0x588482(0x105)]['prompts'][_0x588482(0x143)]>0x0||_0x47adb0[_0x588482(0x105)]['formInterfaces'][_0x588482(0x143)]>0x0||_0x47adb0[_0x588482(0x105)][_0x588482(0x14a)][_0x588482(0x143)]>0x0;if(_0x3236ff){console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0xf8)](_0x588482(0x1a5))),console['log'](),console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0x14e)]('Errors:'));for(const _0x48023e of _0x47adb0['agents']){_0x48023e['action']===_0x588482(0x150)&&console['log'](a4_0x35d933[_0x588482(0x14e)](_0x588482(0x10d)+_0x48023e[_0x588482(0x12e)]+'\x22:\x20'+_0x48023e[_0x588482(0x150)]));}for(const _0x5eb22f of _0x47adb0['knowledgeBases']){_0x5eb22f[_0x588482(0xfd)]===_0x588482(0x150)&&console['log'](a4_0x35d933[_0x588482(0x14e)](_0x588482(0xec)+_0x5eb22f[_0x588482(0x10e)]+_0x588482(0x115)+_0x5eb22f[_0x588482(0x150)]));}for(const _0x40c9cc of _0x47adb0[_0x588482(0x16b)]){_0x40c9cc[_0x588482(0xfd)]===_0x588482(0x150)&&console['log'](a4_0x35d933[_0x588482(0x14e)](_0x588482(0x113)+_0x40c9cc['name']+'\x22:\x20'+_0x40c9cc[_0x588482(0x150)]));}for(const _0x33c73f of _0x47adb0['prompts']){_0x33c73f[_0x588482(0xfd)]===_0x588482(0x150)&&console[_0x588482(0x12d)](a4_0x35d933['red'](_0x588482(0x167)+_0x33c73f[_0x588482(0x10e)]+_0x588482(0x115)+_0x33c73f[_0x588482(0x150)]));}for(const _0x1c155b of _0x47adb0[_0x588482(0x177)]){_0x1c155b[_0x588482(0xfd)]===_0x588482(0x150)&&console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0x14e)](_0x588482(0xe5)+_0x1c155b['name']+_0x588482(0x115)+_0x1c155b[_0x588482(0x150)]));}for(const _0x243ddd of _0x47adb0[_0x588482(0x116)]){_0x243ddd[_0x588482(0xfd)]===_0x588482(0x150)&&console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0x14e)](_0x588482(0x163)+_0x243ddd['name']+_0x588482(0x115)+_0x243ddd[_0x588482(0x150)]));}for(const _0x4593be of _0x47adb0['chatInterfaces']){_0x4593be[_0x588482(0xfd)]===_0x588482(0x150)&&console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0x14e)](_0x588482(0x145)+_0x4593be['name']+_0x588482(0x115)+_0x4593be['error']));}return 0x1;}console[_0x588482(0x12d)](a4_0x35d933[_0x588482(0x172)](_0x588482(0x194)+(_0x4ae20a+_0x1c0345)+_0x588482(0x154)+_0x47adb0[_0x588482(0x13d)]+'\x27'));const _0x40e461=getLLMProjectUrl(_0xd8ccae,_0x47adb0['projectId']);return console[_0x588482(0x12d)]('Project:\x20'+a4_0x35d933[_0x588482(0x193)](_0x40e461)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x288ad2=a5_0x5f02;(function(_0x203cec,_0x61f7b2){const _0x5c8186=a5_0x5f02,_0x459a42=_0x203cec();while(!![]){try{const _0x555b48=-parseInt(_0x5c8186(0x14c))/0x1+parseInt(_0x5c8186(0x11a))/0x2+-parseInt(_0x5c8186(0x10f))/0x3+parseInt(_0x5c8186(0x112))/0x4*(-parseInt(_0x5c8186(0x125))/0x5)+parseInt(_0x5c8186(0xec))/0x6*(parseInt(_0x5c8186(0xd7))/0x7)+parseInt(_0x5c8186(0x103))/0x8*(-parseInt(_0x5c8186(0xf4))/0x9)+parseInt(_0x5c8186(0xd1))/0xa*(parseInt(_0x5c8186(0xfc))/0xb);if(_0x555b48===_0x61f7b2)break;else _0x459a42['push'](_0x459a42['shift']());}catch(_0x11b700){_0x459a42['push'](_0x459a42['shift']());}}}(a5_0x8f17,0xc9952));import*as a5_0x4f2e51 from'node:fs';import*as a5_0x36f54c from'node:path';import a5_0x3be005 from'chalk';import{BaseCommand}from'./command.js';function a5_0x8f17(){const _0xe0cb14=['projectName','No\x20tests\x20have\x20tags\x20defined.','context','filter','timestamp','FAIL','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','not\x20found','PASS','agent:test','utf-8','Failed:\x20\x20\x20','Errors:\x20\x20\x20','Available\x20tags:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','length','606nyjVwl','white','toISOString','\x20(cached)','execute','tests','Re-evaluation\x20Summary','✓\x20PASS:\x20','4788FVJvvk','has','Conversation\x20URL:\x20','push','some','round','agentName','\x20\x20Site:\x20','24641518hgJTFo','status','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','test.yml','dim','reason','trim','8696KfKoLq','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20-\x20','includes','Re-evaluating\x20','✗\x20FAIL:\x20','\x22:\x20','\x20(new)','green','find','basename','Project\x20path:\x20','3673389LBALCz','Error:\x20No\x20previous\x20test\x20run\x20found.','substring','52KYADqX','yellow','jsonl','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','tags','\x20\x20Conversation:\x20','Either\x20switch\x20to\x20the\x20\x22','Duration:\x20','570832Awowlq','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','repeat','Cached\x20run\x20is\x20from\x20site\x20\x22','name','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20Summary','\x20\x20Round\x20','\x20-\x20','20285BXYNCh','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20','resolveAgentId','resolve','Agent:\x20','Output\x20written\x20to:\x20','cyan','toLowerCase','New\x20tests\x20to\x20execute:\x20','red','Passed:\x20\x20\x20','writeFileSync','\x20\x20Agent:\x20','...','Round\x201/','\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','stop','Tests\x20found:\x20','join','Test\x20Configuration:','map','/<agent-name>','eval','\x22,\x20but\x20current\x20site\x20is\x20\x22','...\x20','agent','Running\x20test:\x20','log','Total:\x20\x20\x20\x20','rounds','dryRun','conversation_url','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','split','forEach','ERROR','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','812671GuKjlO','llmProject','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','executeReeval','text',':\x20Sending\x20user\x20input...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','tsv','\x20\x20Project:\x20','404','site','projectDir','add','Run\x20\x27tdx\x20agent\x20pull\x20','table','No\x20tests\x20found\x20matching:\x20','description','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','llm','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Failed\x20Tests:','⚠\x20SKIPPED:\x20','start','now','Using\x20agent:\x20','\x20\x20Evaluating...\x20','Re-evaluating\x20cached\x20test\x20run...','Running\x20agent\x20tests...','10sSEjLd','testYmlPath','Site:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Evaluating\x20response...','No\x20tests\x20found\x20with\x20tags:\x20','67109AWxJiR','Available\x20tests:\x20','Re-evaluating...','reeval','Round\x20'];a5_0x8f17=function(){return _0xe0cb14;};return a5_0x8f17();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x5f02(_0x406a77,_0x5be7f3){_0x406a77=_0x406a77-0xc7;const _0x8f1700=a5_0x8f17();let _0x5f029f=_0x8f1700[_0x406a77];return _0x5f029f;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x288ad2(0x11e)]=a5_0x288ad2(0xe5);[a5_0x288ad2(0x15c)]=a5_0x288ad2(0xd4);async[a5_0x288ad2(0xf0)](_0x5a3406){const _0x5241a7=a5_0x288ad2,{options:_0x22dc0f,args:_0x1eb205,tdx:_0x48b81c}=_0x5a3406,_0x1fb218=_0x1eb205[0x0]||'.',_0x8030bd=_0x22dc0f[_0x5241a7(0x144)],_0x89587f=_0x22dc0f,_0x25d824=_0x89587f[_0x5241a7(0x13c)]===![],_0x3a1b6e=_0x89587f[_0x5241a7(0xda)],_0xe9ba32=_0x89587f[_0x5241a7(0x11e)],_0x237838=_0x89587f[_0x5241a7(0x116)],_0x45d3a4=_0x22dc0f[_0x5241a7(0x156)],_0x52c471=_0x89587f['output'];if(_0x3a1b6e&&_0x25d824)return console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x14e))),0x1;let _0x41e362='table';if(_0x89587f['json'])_0x41e362='json';else{if(_0x89587f[_0x5241a7(0x114)])_0x41e362='jsonl';else{if(_0x89587f[_0x5241a7(0x153)])_0x41e362=_0x5241a7(0x153);else{if(_0x89587f[_0x5241a7(0x15a)])_0x41e362=_0x5241a7(0x15a);}}}const _0x302d96=_0x89587f[_0x5241a7(0x14d)];let _0x57e864=_0x1fb218;const _0x28fd48=a5_0x4f2e51['existsSync'](_0x1fb218),_0x43515c=_0x1fb218==='.';if(!_0x28fd48||_0x43515c){const _0x108390=resolveProjectFromContext(_0x1fb218,_0x302d96,{'requireFile':_0x5241a7(0xff)});if(_0x108390['found'])_0x57e864=_0x108390[_0x5241a7(0x157)],_0x108390['source']===_0x5241a7(0xde)&&console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xcd)+_0x57e864));else switch(_0x108390[_0x5241a7(0x101)]){case'no_context':console[_0x5241a7(0x141)](a5_0x3be005['yellow'](_0x108390[_0x5241a7(0x147)])),console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x5241a7(0x15f)),console[_0x5241a7(0x141)](_0x5241a7(0x135)),console['log'](_0x5241a7(0x11b)),console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0xc8));return 0x1;case'no_local_folder':console['log'](a5_0x3be005['yellow'](_0x108390['message'])),console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0x159)+_0x108390[_0x5241a7(0x14d)]+_0x5241a7(0x146));return 0x1;case'multiple_agents':{const _0x5d7b6b=a5_0x36f54c[_0x5241a7(0x10d)](_0x108390[_0x5241a7(0x157)]);console[_0x5241a7(0x141)](a5_0x3be005['yellow'](_0x5241a7(0x15e)+_0x108390[_0x5241a7(0x14d)]+'\x22:'));for(const _0x52ad4f of _0x108390['agentDirs']){console[_0x5241a7(0x141)](_0x5241a7(0x105)+_0x52ad4f);}return console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0x126)+_0x5d7b6b+_0x5241a7(0x13b)),0x1;}case'no_tests':console['log'](a5_0x3be005['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x108390[_0x5241a7(0x14d)]+'\x22.')),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0x10e)+_0x108390[_0x5241a7(0x157)])),console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0xea));return 0x1;}}const {definition:_0x43a75b,agentInfo:_0x287cea}=parseTestFile(_0x57e864);let _0x36e891=_0x43a75b[_0x5241a7(0xf1)];if(_0xe9ba32){const _0x1f7617=_0xe9ba32[_0x5241a7(0x148)](',')['map'](_0x3f31c7=>_0x3f31c7['trim']());_0x36e891=_0x43a75b[_0x5241a7(0xf1)][_0x5241a7(0xdf)](_0x401f0d=>_0x1f7617['includes'](_0x401f0d[_0x5241a7(0x11e)]));if(_0x36e891[_0x5241a7(0xeb)]===0x0)return console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x113)](_0x5241a7(0x15b)+_0xe9ba32)),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xd8)+_0x43a75b[_0x5241a7(0xf1)]['map'](_0x450d6b=>_0x450d6b[_0x5241a7(0x11e)])[_0x5241a7(0x138)](',\x20'))),0x1;}if(_0x237838){const _0x579a3a=_0x237838[_0x5241a7(0x148)](',')['map'](_0x68cf68=>_0x68cf68[_0x5241a7(0x102)]()[_0x5241a7(0x12d)]());_0x36e891=_0x36e891[_0x5241a7(0xdf)](_0x161b33=>_0x161b33[_0x5241a7(0x116)]?.[_0x5241a7(0xf8)](_0x3a9a36=>_0x579a3a[_0x5241a7(0x106)](_0x3a9a36[_0x5241a7(0x12d)]())));if(_0x36e891[_0x5241a7(0xeb)]===0x0){console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x113)](_0x5241a7(0xd6)+_0x237838));const _0x20bd35=new Set();return _0x43a75b[_0x5241a7(0xf1)][_0x5241a7(0x149)](_0x4f6c91=>_0x4f6c91[_0x5241a7(0x116)]?.[_0x5241a7(0x149)](_0x4c7438=>_0x20bd35[_0x5241a7(0x158)](_0x4c7438))),_0x20bd35['size']>0x0?console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xe9)+[..._0x20bd35][_0x5241a7(0x138)](',\x20'))):console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xdd))),0x1;}}if(_0x3a1b6e)return this[_0x5241a7(0x14f)](_0x5a3406,{'definition':{'tests':_0x36e891},'agentInfo':_0x287cea,'outputFormat':_0x41e362,'outputFile':_0x52c471,'testNames':_0xe9ba32});if(_0x8030bd){console['log'](a5_0x3be005[_0x5241a7(0x12c)](_0x5241a7(0x139))),console['log'](_0x5241a7(0xfb)+a5_0x3be005[_0x5241a7(0xed)](_0x45d3a4)),console[_0x5241a7(0x141)](_0x5241a7(0x154)+a5_0x3be005[_0x5241a7(0xed)](_0x287cea[_0x5241a7(0xdc)])),console[_0x5241a7(0x141)](_0x5241a7(0x132)+a5_0x3be005[_0x5241a7(0xed)](_0x287cea[_0x5241a7(0xfa)])),console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x5241a7(0x137)+a5_0x3be005[_0x5241a7(0xed)](_0x36e891[_0x5241a7(0xeb)]));for(let _0x58b496=0x0;_0x58b496<_0x36e891[_0x5241a7(0xeb)];_0x58b496++){const _0x55c8a1=_0x36e891[_0x58b496],_0x20cb24=_0x55c8a1[_0x5241a7(0x143)][_0x5241a7(0xeb)]===0x1?_0x5241a7(0xf9):_0x5241a7(0x143),_0x27b2a3=_0x55c8a1['tags']?.[_0x5241a7(0xeb)]?'\x20['+_0x55c8a1['tags'][_0x5241a7(0x138)](',\x20')+']':'';console[_0x5241a7(0x141)]('\x20\x20'+(_0x58b496+0x1)+'.\x20'+a5_0x3be005[_0x5241a7(0xed)](_0x55c8a1['name'])+'\x20('+_0x55c8a1[_0x5241a7(0x143)][_0x5241a7(0xeb)]+'\x20'+_0x20cb24+')'+a5_0x3be005[_0x5241a7(0x100)](_0x27b2a3));}return 0x0;}let _0x8fb466,_0x3cfec8;try{_0x8fb466=await _0x48b81c[_0x5241a7(0xc7)]['resolveProjectId'](_0x287cea[_0x5241a7(0xdc)]);}catch(_0x21cb59){const _0x1bd43c=_0x21cb59 instanceof Error?_0x21cb59[_0x5241a7(0x147)]:String(_0x21cb59);return _0x1bd43c[_0x5241a7(0x106)]('404')||_0x1bd43c[_0x5241a7(0x12d)]()[_0x5241a7(0x106)](_0x5241a7(0xe3))?console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x287cea[_0x5241a7(0xdc)])):console[_0x5241a7(0x141)](a5_0x3be005['red'](_0x5241a7(0xe2)+_0x287cea[_0x5241a7(0xdc)]+_0x5241a7(0x109)+_0x1bd43c)),0x1;}try{_0x3cfec8=await _0x48b81c['llm'][_0x5241a7(0x128)](_0x287cea[_0x5241a7(0xfa)],_0x8fb466);}catch(_0x58fce6){const _0xe95e45=_0x58fce6 instanceof Error?_0x58fce6['message']:String(_0x58fce6);return _0xe95e45[_0x5241a7(0x106)](_0x5241a7(0x155))||_0xe95e45[_0x5241a7(0x12d)]()[_0x5241a7(0x106)]('not\x20found')?console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x115)+_0x287cea['agentName'])):console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x120)+_0x287cea[_0x5241a7(0xfa)]+_0x5241a7(0x109)+_0xe95e45)),0x1;}let _0x55d927;if(!_0x25d824)try{_0x55d927=await setupEvaluatorAgent(_0x48b81c[_0x5241a7(0xc7)],_0x22dc0f['verbose']);}catch(_0x1804c1){const _0x505b43=_0x1804c1 instanceof Error?_0x1804c1[_0x5241a7(0x147)]:String(_0x1804c1);return console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x152)+_0x505b43)),0x1;}console['log'](a5_0x3be005[_0x5241a7(0x12c)](_0x5241a7(0xd0))),console[_0x5241a7(0x141)](_0x5241a7(0xd3)+a5_0x3be005[_0x5241a7(0xed)](_0x45d3a4)),console['log'](_0x5241a7(0x12a)+a5_0x3be005[_0x5241a7(0xed)](_0x287cea[_0x5241a7(0xdc)]+'/'+_0x287cea[_0x5241a7(0xfa)])),console[_0x5241a7(0x141)]();const _0x101f6c=[],_0x5c985e=[],_0x76928c=Date[_0x5241a7(0xcc)]();for(let _0x105425=0x0;_0x105425<_0x36e891[_0x5241a7(0xeb)];_0x105425++){const _0x4855f3=_0x36e891[_0x105425];_0x36e891[_0x5241a7(0xeb)]>0x1?console['log']('Test\x20'+(_0x105425+0x1)+'/'+_0x36e891[_0x5241a7(0xeb)]+':\x20'+a5_0x3be005[_0x5241a7(0xed)](_0x4855f3[_0x5241a7(0x11e)])):console[_0x5241a7(0x141)](_0x5241a7(0x140)+a5_0x3be005[_0x5241a7(0xed)](_0x4855f3[_0x5241a7(0x11e)]));const _0x2022b8=createCommandSpinner(_0x5241a7(0x134)+_0x4855f3[_0x5241a7(0x143)]['length']+_0x5241a7(0x151));_0x2022b8[_0x5241a7(0xcb)]();try{const {result:_0x2d4328,conversation:_0x1ad108}=await runTest(_0x48b81c[_0x5241a7(0xc7)],_0x4855f3,{'agentId':_0x3cfec8,'projectId':_0x8fb466,'site':_0x45d3a4,'noEval':_0x25d824,'evaluatorId':_0x55d927,'onRoundStart':(_0x4bf3e4,_0x351245)=>{const _0x59c252=_0x5241a7;_0x2022b8['text']=_0x59c252(0xdb)+(_0x4bf3e4+0x1)+'/'+_0x351245+_0x59c252(0x151);},'onRoundComplete':(_0x5886ef,_0x3d93ec,_0x55a36f)=>{const _0x274d83=_0x5241a7,_0x957014=formatElapsed(_0x3d93ec);_0x55a36f?console[_0x274d83(0x141)](_0x274d83(0x123)+(_0x5886ef+0x1)+'/'+_0x4855f3[_0x274d83(0x143)]['length']+_0x274d83(0x13e)+a5_0x3be005['green']('✓')+'\x20('+_0x957014+')'):console['log'](_0x274d83(0x123)+(_0x5886ef+0x1)+'/'+_0x4855f3[_0x274d83(0x143)][_0x274d83(0xeb)]+'...\x20'+a5_0x3be005[_0x274d83(0x12f)]('✗'));},'onEvaluationStart':()=>{const _0xef914f=_0x5241a7;_0x2022b8[_0xef914f(0x150)]=_0xef914f(0xd5);},'onEvaluationComplete':_0x2da938=>{const _0x2dbb58=_0x5241a7,_0x137835=formatElapsed(_0x2da938);console[_0x2dbb58(0x141)](_0x2dbb58(0xce)+a5_0x3be005[_0x2dbb58(0x10b)]('✓')+'\x20('+_0x137835+')');}});_0x2022b8['stop'](),_0x101f6c[_0x5241a7(0xf7)](_0x2d4328),_0x5c985e['push'](_0x1ad108);if(_0x2d4328['status']===_0x5241a7(0xe4))console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x10b)](_0x5241a7(0xf3)+_0x2d4328[_0x5241a7(0x101)]));else _0x2d4328[_0x5241a7(0xfd)]===_0x5241a7(0xe1)?console['log'](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x108)+_0x2d4328[_0x5241a7(0x101)])):console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x127)+_0x2d4328[_0x5241a7(0x101)]));_0x2d4328[_0x5241a7(0x145)]&&console['log'](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xf6)+_0x2d4328[_0x5241a7(0x145)])),console[_0x5241a7(0x141)]();}catch(_0x4787d0){_0x2022b8[_0x5241a7(0x136)]();const _0x4c0d95=_0x4787d0 instanceof Error?_0x4787d0['message']:String(_0x4787d0);console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x127)+_0x4c0d95)),console[_0x5241a7(0x141)](),_0x101f6c[_0x5241a7(0xf7)]({'name':_0x4855f3[_0x5241a7(0x11e)],'status':_0x5241a7(0x14a),'reason':_0x4c0d95,'timestamp':new Date()[_0x5241a7(0xee)](),'duration_ms':0x0});}}const _0x36b81f=Date[_0x5241a7(0xcc)]()-_0x76928c,_0xe37d37=_0x101f6c[_0x5241a7(0xdf)](_0x3bcc27=>_0x3bcc27[_0x5241a7(0xfd)]===_0x5241a7(0xe4))[_0x5241a7(0xeb)],_0x58a349=_0x101f6c[_0x5241a7(0xdf)](_0x191a05=>_0x191a05[_0x5241a7(0xfd)]===_0x5241a7(0xe1))[_0x5241a7(0xeb)],_0x394510=_0x101f6c[_0x5241a7(0xdf)](_0xe798b2=>_0xe798b2['status']==='ERROR')[_0x5241a7(0xeb)];console[_0x5241a7(0x141)]('━'[_0x5241a7(0x11c)](0x3c)),console[_0x5241a7(0x141)](_0x5241a7(0x122)),console[_0x5241a7(0x141)]('━'[_0x5241a7(0x11c)](0x3c)),console[_0x5241a7(0x141)]('Total:\x20\x20\x20\x20'+_0x101f6c[_0x5241a7(0xeb)]),console[_0x5241a7(0x141)](_0x5241a7(0x130)+a5_0x3be005['green'](_0xe37d37)),console[_0x5241a7(0x141)](_0x5241a7(0xe7)+a5_0x3be005['red'](_0x58a349));_0x394510>0x0&&console[_0x5241a7(0x141)]('Errors:\x20\x20\x20'+a5_0x3be005['red'](_0x394510));console[_0x5241a7(0x141)](_0x5241a7(0x119)+formatElapsed(_0x36b81f)),console[_0x5241a7(0x141)]('━'[_0x5241a7(0x11c)](0x3c));const _0x298b8c=_0x101f6c['filter'](_0x576701=>_0x576701[_0x5241a7(0xfd)]!==_0x5241a7(0xe4));if(_0x298b8c[_0x5241a7(0xeb)]>0x0){console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x5241a7(0xc9));for(const _0x3cb89a of _0x298b8c){const _0x2d0eb7=a5_0x3be005[_0x5241a7(0x12f)]('✗'),_0x2a2e23=_0x3cb89a[_0x5241a7(0x101)][_0x5241a7(0xeb)]>0x32?_0x3cb89a[_0x5241a7(0x101)][_0x5241a7(0x111)](0x0,0x32)+_0x5241a7(0x133):_0x3cb89a[_0x5241a7(0x101)];console[_0x5241a7(0x141)]('\x20\x20'+_0x2d0eb7+'\x20'+_0x3cb89a[_0x5241a7(0x11e)]+':\x20'+_0x2a2e23);}}const _0x4f489f={'summary':{'total':_0x101f6c[_0x5241a7(0xeb)],'passed':_0xe37d37,'failed':_0x58a349,'errors':_0x394510>0x0?_0x394510:undefined,'duration_ms':_0x36b81f},'tests':_0x101f6c,'agent':{'project':_0x287cea[_0x5241a7(0xdc)],'name':_0x287cea['agentName'],'site':_0x45d3a4},'timestamp':new Date(_0x76928c)[_0x5241a7(0xee)]()};try{const _0xa491f6=buildCachedTestRun(_0x5c985e,{'site':_0x45d3a4,'projectId':_0x8fb466,'projectName':_0x287cea[_0x5241a7(0xdc)],'agentId':_0x3cfec8,'agentName':_0x287cea[_0x5241a7(0xfa)],'testYmlPath':a5_0x36f54c[_0x5241a7(0x129)](_0x287cea[_0x5241a7(0xd2)])});saveLastTestRun(_0xa491f6);}catch{}if(_0x41e362!==_0x5241a7(0x15a)||_0x52c471){const _0x8f43c7=formatResults(_0x4f489f,_0x41e362);if(_0x52c471)try{a5_0x4f2e51[_0x5241a7(0x131)](_0x52c471,_0x8f43c7,_0x5241a7(0xe6)),console['log'](),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0x12b)+_0x52c471));}catch(_0x34b059){return console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)]('Error\x20writing\x20output\x20file:\x20'+_0x34b059)),0x1;}else console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x8f43c7);}return _0x298b8c[_0x5241a7(0xeb)]>0x0?0x1:0x0;}async['executeReeval'](_0x5a19e7,_0x1e3cc2){const _0x3ebbaa=a5_0x288ad2,{options:_0x228a1c,tdx:_0xa112e}=_0x5a19e7,{definition:_0x486b30,agentInfo:_0x202005,outputFormat:_0x29cfb5,outputFile:_0x137657}=_0x1e3cc2,_0x206304=_0x228a1c[_0x3ebbaa(0x156)],_0x51ff7d=loadLastTestRun();if(!_0x51ff7d)return console[_0x3ebbaa(0x141)](a5_0x3be005['red'](_0x3ebbaa(0x110))),console[_0x3ebbaa(0x141)](a5_0x3be005['dim'](_0x3ebbaa(0x14b))),0x1;if(_0x51ff7d[_0x3ebbaa(0x13f)]['agentName']!==_0x202005['agentName'])return console['log'](a5_0x3be005[_0x3ebbaa(0x12f)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x51ff7d['agent']['agentName']+_0x3ebbaa(0xfe)+_0x202005[_0x3ebbaa(0xfa)]+'\x22.')),console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x15d))),0x1;const _0x4d8f88=new Set(_0x51ff7d['conversations'][_0x3ebbaa(0x13a)](_0x59ca60=>_0x59ca60['testName'])),_0x239f30=_0x486b30['tests'][_0x3ebbaa(0xdf)](_0x3b4029=>!_0x4d8f88[_0x3ebbaa(0xf5)](_0x3b4029[_0x3ebbaa(0x11e)]));if(_0x239f30[_0x3ebbaa(0xeb)]>0x0&&_0x51ff7d[_0x3ebbaa(0x156)]!==_0x206304)return console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x11f))),console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x11d)+_0x51ff7d[_0x3ebbaa(0x156)]+_0x3ebbaa(0x13d)+_0x206304+'\x22.')),console['log'](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x118)+_0x51ff7d[_0x3ebbaa(0x156)]+_0x3ebbaa(0x121))),0x1;const _0x4efb53=_0x486b30[_0x3ebbaa(0xf1)][_0x3ebbaa(0xdf)](_0x3badd7=>_0x4d8f88[_0x3ebbaa(0xf5)](_0x3badd7[_0x3ebbaa(0x11e)])),_0x2203f6=_0x239f30;let _0x248c7b;try{_0x248c7b=await setupEvaluatorAgent(_0xa112e[_0x3ebbaa(0xc7)],_0x228a1c['verbose']);}catch(_0x233060){const _0x1761d1=_0x233060 instanceof Error?_0x233060[_0x3ebbaa(0x147)]:String(_0x233060);return console['log'](a5_0x3be005['red'](_0x3ebbaa(0x152)+_0x1761d1)),0x1;}console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12c)](_0x3ebbaa(0xcf))),console[_0x3ebbaa(0x141)]('Cached\x20run\x20from:\x20'+a5_0x3be005['white'](_0x51ff7d[_0x3ebbaa(0xe0)])),console[_0x3ebbaa(0x141)]('Agent:\x20'+a5_0x3be005[_0x3ebbaa(0xed)](_0x51ff7d[_0x3ebbaa(0x13f)][_0x3ebbaa(0xdc)]+'/'+_0x51ff7d['agent'][_0x3ebbaa(0xfa)]));_0x2203f6[_0x3ebbaa(0xeb)]>0x0&&console['log'](_0x3ebbaa(0x12e)+a5_0x3be005['yellow'](_0x2203f6[_0x3ebbaa(0xeb)]));console[_0x3ebbaa(0x141)]();const _0x4a292f=[],_0x519034=Date[_0x3ebbaa(0xcc)](),_0x109668=createCommandSpinner(_0x3ebbaa(0xd9));if(_0x4efb53[_0x3ebbaa(0xeb)]>0x0)try{const _0x386ec2=await reevaluateFromCache(_0xa112e[_0x3ebbaa(0xc7)],_0x51ff7d,{'tests':_0x4efb53},{'evaluatorId':_0x248c7b,'onTestStart':(_0x34799c,_0x5713c1,_0x21159f)=>{const _0x2d25ab=_0x3ebbaa;_0x109668[_0x2d25ab(0x150)]=_0x2d25ab(0x107)+(_0x5713c1+0x1)+'/'+_0x21159f+':\x20'+_0x34799c+_0x2d25ab(0x133);if(!_0x109668['isSpinning'])_0x109668[_0x2d25ab(0xcb)]();},'onTestComplete':(_0xb5ef73,_0x93ff46)=>{const _0x595244=_0x3ebbaa;_0x109668[_0x595244(0x136)]();if(_0x93ff46['status']===_0x595244(0xe4))console[_0x595244(0x141)](a5_0x3be005[_0x595244(0x10b)](_0x595244(0xf3)+_0xb5ef73)+a5_0x3be005[_0x595244(0x100)]('\x20(cached)'));else _0x93ff46[_0x595244(0xfd)]===_0x595244(0xe1)?console[_0x595244(0x141)](a5_0x3be005['red']('✗\x20FAIL:\x20'+_0xb5ef73+_0x595244(0x124)+_0x93ff46[_0x595244(0x101)])+a5_0x3be005[_0x595244(0x100)](_0x595244(0xef))):console[_0x595244(0x141)](a5_0x3be005[_0x595244(0x12f)](_0x595244(0x127)+_0xb5ef73+_0x595244(0x124)+_0x93ff46[_0x595244(0x101)]));_0x93ff46['conversation_url']&&console['log'](a5_0x3be005['dim'](_0x595244(0x117)+_0x93ff46['conversation_url'])),_0x4a292f[_0x595244(0xf7)](_0x93ff46);},'onTestSkipped':(_0x31e81b,_0xc01899)=>{const _0x2d9858=_0x3ebbaa;_0x109668['stop'](),console[_0x2d9858(0x141)](a5_0x3be005[_0x2d9858(0x113)](_0x2d9858(0xca)+_0x31e81b+'\x20-\x20'+_0xc01899));}});for(const _0x180403 of _0x386ec2){!_0x4a292f[_0x3ebbaa(0x10c)](_0x2d75a0=>_0x2d75a0[_0x3ebbaa(0x11e)]===_0x180403[_0x3ebbaa(0x11e)])&&_0x4a292f[_0x3ebbaa(0xf7)](_0x180403);}}catch(_0x3abedb){_0x109668['stop']();const _0x27814a=_0x3abedb instanceof Error?_0x3abedb['message']:String(_0x3abedb);return console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x104)+_0x27814a)),0x1;}_0x109668[_0x3ebbaa(0x136)]();if(_0x2203f6[_0x3ebbaa(0xeb)]>0x0){console['log'](),console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12c)]('Executing\x20new\x20tests...'));const {projectId:_0x5db8ed,agentId:_0x52fd70}=_0x51ff7d[_0x3ebbaa(0x13f)];for(const _0x3a1240 of _0x2203f6){console['log']('Running:\x20'+a5_0x3be005[_0x3ebbaa(0xed)](_0x3a1240['name']));const _0x4e67d7=createCommandSpinner(_0x3ebbaa(0x134)+_0x3a1240[_0x3ebbaa(0x143)]['length']+_0x3ebbaa(0x151));_0x4e67d7[_0x3ebbaa(0xcb)]();try{const {result:_0x43f4ef}=await runTest(_0xa112e[_0x3ebbaa(0xc7)],_0x3a1240,{'agentId':_0x52fd70,'projectId':_0x5db8ed,'site':_0x51ff7d['site'],'noEval':![],'evaluatorId':_0x248c7b,'onRoundStart':(_0x150e59,_0x46204c)=>{const _0x559463=_0x3ebbaa;_0x4e67d7['text']=_0x559463(0xdb)+(_0x150e59+0x1)+'/'+_0x46204c+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1d7bb0,_0x565848,_0x40eb87)=>{const _0x34700d=_0x3ebbaa,_0xf0e3ab=formatElapsed(_0x565848);_0x40eb87?console[_0x34700d(0x141)](_0x34700d(0x123)+(_0x1d7bb0+0x1)+'/'+_0x3a1240[_0x34700d(0x143)][_0x34700d(0xeb)]+'...\x20'+a5_0x3be005[_0x34700d(0x10b)]('✓')+'\x20('+_0xf0e3ab+')'):console[_0x34700d(0x141)](_0x34700d(0x123)+(_0x1d7bb0+0x1)+'/'+_0x3a1240[_0x34700d(0x143)][_0x34700d(0xeb)]+_0x34700d(0x13e)+a5_0x3be005[_0x34700d(0x12f)]('✗'));},'onEvaluationStart':()=>{const _0x167f08=_0x3ebbaa;_0x4e67d7[_0x167f08(0x150)]='Evaluating\x20response...';},'onEvaluationComplete':_0x440962=>{const _0x390ac5=_0x3ebbaa,_0x59ea6e=formatElapsed(_0x440962);console[_0x390ac5(0x141)](_0x390ac5(0xce)+a5_0x3be005[_0x390ac5(0x10b)]('✓')+'\x20('+_0x59ea6e+')');}});_0x4e67d7[_0x3ebbaa(0x136)](),_0x4a292f['push'](_0x43f4ef);if(_0x43f4ef[_0x3ebbaa(0xfd)]===_0x3ebbaa(0xe4))console[_0x3ebbaa(0x141)](a5_0x3be005['green']('✓\x20PASS:\x20'+_0x43f4ef[_0x3ebbaa(0x101)])+a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x10a)));else _0x43f4ef['status']==='FAIL'?console['log'](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x108)+_0x43f4ef[_0x3ebbaa(0x101)])+a5_0x3be005['dim'](_0x3ebbaa(0x10a))):console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x127)+_0x43f4ef[_0x3ebbaa(0x101)]));_0x43f4ef[_0x3ebbaa(0x145)]&&console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x117)+_0x43f4ef['conversation_url']));}catch(_0x295196){_0x4e67d7[_0x3ebbaa(0x136)]();const _0x54c7ce=_0x295196 instanceof Error?_0x295196[_0x3ebbaa(0x147)]:String(_0x295196);console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)]('✗\x20ERROR:\x20'+_0x54c7ce)),_0x4a292f['push']({'name':_0x3a1240[_0x3ebbaa(0x11e)],'status':_0x3ebbaa(0x14a),'reason':_0x54c7ce,'timestamp':new Date()[_0x3ebbaa(0xee)](),'duration_ms':0x0});}}}console['log']();const _0x51656a=Date[_0x3ebbaa(0xcc)]()-_0x519034,_0x5a6589=_0x4a292f[_0x3ebbaa(0xdf)](_0x59f40a=>_0x59f40a[_0x3ebbaa(0xfd)]==='PASS')['length'],_0x99d149=_0x4a292f[_0x3ebbaa(0xdf)](_0xc84dcc=>_0xc84dcc[_0x3ebbaa(0xfd)]===_0x3ebbaa(0xe1))[_0x3ebbaa(0xeb)],_0x3e1e4a=_0x4a292f[_0x3ebbaa(0xdf)](_0x491e08=>_0x491e08[_0x3ebbaa(0xfd)]==='ERROR')['length'];console[_0x3ebbaa(0x141)]('━'[_0x3ebbaa(0x11c)](0x3c)),console[_0x3ebbaa(0x141)](_0x3ebbaa(0xf2)),console[_0x3ebbaa(0x141)]('━'[_0x3ebbaa(0x11c)](0x3c)),console[_0x3ebbaa(0x141)](_0x3ebbaa(0x142)+_0x4a292f[_0x3ebbaa(0xeb)]),console[_0x3ebbaa(0x141)](_0x3ebbaa(0x130)+a5_0x3be005[_0x3ebbaa(0x10b)](_0x5a6589)),console[_0x3ebbaa(0x141)]('Failed:\x20\x20\x20'+a5_0x3be005[_0x3ebbaa(0x12f)](_0x99d149));_0x3e1e4a>0x0&&console['log'](_0x3ebbaa(0xe8)+a5_0x3be005[_0x3ebbaa(0x12f)](_0x3e1e4a));console[_0x3ebbaa(0x141)](_0x3ebbaa(0x119)+formatElapsed(_0x51656a)),console[_0x3ebbaa(0x141)]('━'[_0x3ebbaa(0x11c)](0x3c));const _0x2189b6={'summary':{'total':_0x4a292f[_0x3ebbaa(0xeb)],'passed':_0x5a6589,'failed':_0x99d149,'errors':_0x3e1e4a>0x0?_0x3e1e4a:undefined,'duration_ms':_0x51656a},'tests':_0x4a292f,'agent':{'project':_0x202005[_0x3ebbaa(0xdc)],'name':_0x202005['agentName'],'site':_0x206304},'timestamp':new Date(_0x519034)[_0x3ebbaa(0xee)]()};if(_0x29cfb5!=='table'||_0x137657){const _0x4bc716=formatResults(_0x2189b6,_0x29cfb5);if(_0x137657)try{a5_0x4f2e51[_0x3ebbaa(0x131)](_0x137657,_0x4bc716,_0x3ebbaa(0xe6)),console[_0x3ebbaa(0x141)](),console['log'](a5_0x3be005['dim'](_0x3ebbaa(0x12b)+_0x137657));}catch(_0x344c3c){return console[_0x3ebbaa(0x141)](),console[_0x3ebbaa(0x141)](a5_0x3be005['red']('Error\x20writing\x20output\x20file:\x20'+_0x344c3c)),0x1;}else console['log'](),console['log'](_0x4bc716);}const _0x37f5d9=_0x4a292f[_0x3ebbaa(0xdf)](_0x443cde=>_0x443cde[_0x3ebbaa(0xfd)]!=='PASS');return _0x37f5d9[_0x3ebbaa(0xeb)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x46e493=a5_0x4915;(function(_0x52264e,_0x404d02){const _0x57aa91=a5_0x4915,_0x19f617=_0x52264e();while(!![]){try{const _0x592fa3=parseInt(_0x57aa91(0x111))/0x1+-parseInt(_0x57aa91(0xf6))/0x2+parseInt(_0x57aa91(0xc8))/0x3+parseInt(_0x57aa91(0xb2))/0x4+parseInt(_0x57aa91(0xbd))/0x5*(parseInt(_0x57aa91(0xcc))/0x6)+parseInt(_0x57aa91(0xde))/0x7*(-parseInt(_0x57aa91(0x11c))/0x8)+parseInt(_0x57aa91(0xa2))/0x9;if(_0x592fa3===_0x404d02)break;else _0x19f617['push'](_0x19f617['shift']());}catch(_0x412632){_0x19f617['push'](_0x19f617['shift']());}}}(a5_0x5047,0xb18df));import*as a5_0x2af5e4 from'node:fs';function a5_0x5047(){const _0x4f55b0=['Running\x20agent\x20tests...','json','Error:\x20Cached\x20run\x20is\x20for\x20agent\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','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','writeFileSync','testName','Re-evaluation\x20Summary','\x20(new)','152811ArHuAA','Cached\x20run\x20from:\x20','trim','Using\x20agent:\x20','6TSyasQ','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Agent:\x20','agentName','/<agent-name>','No\x20tests\x20found\x20matching:\x20','Running:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','conversation_url','executeReeval','resolveAgentId','Executing\x20new\x20tests...','projectDir','Available\x20tests:\x20','description','\x22:\x20','message','split','67760HOFhQq','FAIL','add','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20Agent:\x20','size','toLowerCase','stop','execute','rounds','Run\x20\x27tdx\x20agent\x20pull\x20','cyan','resolveProjectId','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✓\x20PASS:\x20','context','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','green','Failed\x20Tests:','dim','Total:\x20\x20\x20\x20','timestamp','\x20\x20Conversation:\x20','1643488hFIBQN','includes','testYmlPath','name','ERROR','Failed:\x20\x20\x20','agent:test','output','tags','\x20(cached)','Conversation\x20URL:\x20','no_context','\x20\x20Evaluating...\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','dryRun','source','start','basename','red','New\x20tests\x20to\x20execute:\x20',':\x20Sending\x20user\x20input...','Project\x20path:\x20','push','Tests\x20found:\x20','site','PASS','llm','353282eitacT','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','jsonl','Running\x20test:\x20','...','Round\x201/','not\x20found','reeval','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20-\x20','llmProject','1160DCNnQe','reason','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','verbose','\x20\x20Round\x20','Output\x20written\x20to:\x20','404','yellow','join','projectName','eval','Re-evaluating\x20','utf-8','\x20\x20-\x20','Error\x20writing\x20output\x20file:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','filter','status','Errors:\x20\x20\x20','test.yml','\x20\x20Site:\x20','log','existsSync','agent','toISOString','tsv','Round\x20','...\x20','length','13728573gGFzUJ','Evaluating\x20response...','✗\x20ERROR:\x20Project\x20not\x20found:\x20','some','Test\x20Summary','Re-evaluating\x20cached\x20test\x20run...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Test\x20Configuration:','\x20\x20Project:\x20','No\x20tests\x20have\x20tags\x20defined.','✗\x20FAIL:\x20','table','✗\x20ERROR:\x20','resolve','now','map','1725228QAxHPV','found','white','forEach','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Duration:\x20','Passed:\x20\x20\x20','has','text','isSpinning','repeat','2958420rskQAT','tests'];a5_0x5047=function(){return _0x4f55b0;};return a5_0x5047();}import*as a5_0x1ad22c from'node:path';import a5_0x21012e from'chalk';import{BaseCommand}from'./command.js';function a5_0x4915(_0x237155,_0x6119ba){_0x237155=_0x237155-0x8e;const _0x504797=a5_0x5047();let _0x49156f=_0x504797[_0x237155];return _0x49156f;}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_0x46e493(0xf9)]=a5_0x46e493(0xfc);[a5_0x46e493(0xda)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x46e493(0xe6)](_0x5d55cc){const _0x95bfba=a5_0x46e493,{options:_0x599fcf,args:_0x29dfe2,tdx:_0x246ad3}=_0x5d55cc,_0x1fb805=_0x29dfe2[0x0]||'.',_0x38c9f2=_0x599fcf[_0x95bfba(0x104)],_0x1f8a4b=_0x599fcf,_0x380b9f=_0x1f8a4b[_0x95bfba(0x8f)]===![],_0x14be28=_0x1f8a4b[_0x95bfba(0x118)],_0x3dd634=_0x1f8a4b[_0x95bfba(0xf9)],_0x320580=_0x1f8a4b[_0x95bfba(0xfe)],_0x551194=_0x599fcf['site'],_0x52955e=_0x1f8a4b[_0x95bfba(0xfd)];if(_0x14be28&&_0x380b9f)return console['log'](a5_0x21012e[_0x95bfba(0x108)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x18c23e=_0x95bfba(0xad);if(_0x1f8a4b['json'])_0x18c23e=_0x95bfba(0xc0);else{if(_0x1f8a4b[_0x95bfba(0x113)])_0x18c23e=_0x95bfba(0x113);else{if(_0x1f8a4b[_0x95bfba(0x9e)])_0x18c23e='tsv';else{if(_0x1f8a4b[_0x95bfba(0xad)])_0x18c23e=_0x95bfba(0xad);}}}const _0x503b1c=_0x1f8a4b['llmProject'];let _0x5fedb0=_0x1fb805;const _0x56b897=a5_0x2af5e4[_0x95bfba(0x9b)](_0x1fb805),_0x491c71=_0x1fb805==='.';if(!_0x56b897||_0x491c71){const _0x57650c=resolveProjectFromContext(_0x1fb805,_0x503b1c,{'requireFile':_0x95bfba(0x98)});if(_0x57650c[_0x95bfba(0xb3)])_0x5fedb0=_0x57650c[_0x95bfba(0xd8)],_0x57650c[_0x95bfba(0x105)]===_0x95bfba(0xed)&&console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0xf2)](_0x95bfba(0xcb)+_0x5fedb0));else switch(_0x57650c[_0x95bfba(0x11d)]){case _0x95bfba(0x101):console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x123)](_0x57650c[_0x95bfba(0xdc)])),console[_0x95bfba(0x9a)](),console[_0x95bfba(0x9a)]('Usage:'),console[_0x95bfba(0x9a)](_0x95bfba(0xc2)),console[_0x95bfba(0x9a)](_0x95bfba(0xcd)),console[_0x95bfba(0x9a)](),console[_0x95bfba(0x9a)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x123)](_0x57650c[_0x95bfba(0xdc)])),console[_0x95bfba(0x9a)](),console['log'](_0x95bfba(0xe8)+_0x57650c[_0x95bfba(0x11b)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x2353d8=a5_0x1ad22c[_0x95bfba(0x107)](_0x57650c[_0x95bfba(0xd8)]);console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x123)](_0x95bfba(0xeb)+_0x57650c['llmProject']+'\x22:'));for(const _0x65eba6 of _0x57650c['agentDirs']){console[_0x95bfba(0x9a)](_0x95bfba(0x92)+_0x65eba6);}return console[_0x95bfba(0x9a)](),console['log'](_0x95bfba(0xd3)+_0x2353d8+_0x95bfba(0xd0)),0x1;}case'no_tests':console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x123)](_0x95bfba(0xb6)+_0x57650c[_0x95bfba(0x11b)]+'\x22.')),console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0xf2)](_0x95bfba(0x10b)+_0x57650c[_0x95bfba(0xd8)])),console[_0x95bfba(0x9a)](),console['log'](_0x95bfba(0xa8));return 0x1;}}const {definition:_0x376308,agentInfo:_0x1bcc54}=parseTestFile(_0x5fedb0);let _0xc2b5f4=_0x376308['tests'];if(_0x3dd634){const _0x50fad7=_0x3dd634['split'](',')[_0x95bfba(0xb1)](_0x1ae940=>_0x1ae940[_0x95bfba(0xca)]());_0xc2b5f4=_0x376308[_0x95bfba(0xbe)][_0x95bfba(0x95)](_0x4be75d=>_0x50fad7[_0x95bfba(0xf7)](_0x4be75d[_0x95bfba(0xf9)]));if(_0xc2b5f4[_0x95bfba(0xa1)]===0x0)return console['log'](a5_0x21012e[_0x95bfba(0x123)](_0x95bfba(0xd1)+_0x3dd634)),console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0xf2)](_0x95bfba(0xd9)+_0x376308[_0x95bfba(0xbe)][_0x95bfba(0xb1)](_0x54fa95=>_0x54fa95[_0x95bfba(0xf9)])[_0x95bfba(0x124)](',\x20'))),0x1;}if(_0x320580){const _0x18bc15=_0x320580[_0x95bfba(0xdd)](',')['map'](_0x23b7cd=>_0x23b7cd[_0x95bfba(0xca)]()[_0x95bfba(0xe4)]());_0xc2b5f4=_0xc2b5f4[_0x95bfba(0x95)](_0x3bc1c2=>_0x3bc1c2['tags']?.[_0x95bfba(0xa5)](_0x579573=>_0x18bc15[_0x95bfba(0xf7)](_0x579573[_0x95bfba(0xe4)]())));if(_0xc2b5f4['length']===0x0){console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x123)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x320580));const _0xf96368=new Set();return _0x376308[_0x95bfba(0xbe)][_0x95bfba(0xb5)](_0x25d4f0=>_0x25d4f0[_0x95bfba(0xfe)]?.[_0x95bfba(0xb5)](_0x1f8872=>_0xf96368[_0x95bfba(0xe0)](_0x1f8872))),_0xf96368[_0x95bfba(0xe3)]>0x0?console[_0x95bfba(0x9a)](a5_0x21012e['dim']('Available\x20tags:\x20'+[..._0xf96368]['join'](',\x20'))):console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0xf2)](_0x95bfba(0xab))),0x1;}}if(_0x14be28)return this[_0x95bfba(0xd5)](_0x5d55cc,{'definition':{'tests':_0xc2b5f4},'agentInfo':_0x1bcc54,'outputFormat':_0x18c23e,'outputFile':_0x52955e,'testNames':_0x3dd634});if(_0x38c9f2){console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0xe9)](_0x95bfba(0xa9))),console[_0x95bfba(0x9a)](_0x95bfba(0x99)+a5_0x21012e['white'](_0x551194)),console[_0x95bfba(0x9a)](_0x95bfba(0xaa)+a5_0x21012e[_0x95bfba(0xb4)](_0x1bcc54[_0x95bfba(0x8e)])),console['log'](_0x95bfba(0xe2)+a5_0x21012e[_0x95bfba(0xb4)](_0x1bcc54[_0x95bfba(0xcf)])),console['log'](),console['log'](_0x95bfba(0x10d)+a5_0x21012e[_0x95bfba(0xb4)](_0xc2b5f4[_0x95bfba(0xa1)]));for(let _0x1433f2=0x0;_0x1433f2<_0xc2b5f4[_0x95bfba(0xa1)];_0x1433f2++){const _0x56e9de=_0xc2b5f4[_0x1433f2],_0x5d8527=_0x56e9de[_0x95bfba(0xe7)][_0x95bfba(0xa1)]===0x1?'round':_0x95bfba(0xe7),_0x282936=_0x56e9de['tags']?.[_0x95bfba(0xa1)]?'\x20['+_0x56e9de['tags']['join'](',\x20')+']':'';console[_0x95bfba(0x9a)]('\x20\x20'+(_0x1433f2+0x1)+'.\x20'+a5_0x21012e['white'](_0x56e9de['name'])+'\x20('+_0x56e9de[_0x95bfba(0xe7)][_0x95bfba(0xa1)]+'\x20'+_0x5d8527+')'+a5_0x21012e['dim'](_0x282936));}return 0x0;}let _0x23cdb0,_0x64c41;try{_0x23cdb0=await _0x246ad3[_0x95bfba(0x110)][_0x95bfba(0xea)](_0x1bcc54[_0x95bfba(0x8e)]);}catch(_0x586582){const _0x5c2b75=_0x586582 instanceof Error?_0x586582['message']:String(_0x586582);return _0x5c2b75[_0x95bfba(0xf7)](_0x95bfba(0x122))||_0x5c2b75['toLowerCase']()[_0x95bfba(0xf7)]('not\x20found')?console['log'](a5_0x21012e['red'](_0x95bfba(0xa4)+_0x1bcc54[_0x95bfba(0x8e)])):console['log'](a5_0x21012e['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x1bcc54['projectName']+_0x95bfba(0xdb)+_0x5c2b75)),0x1;}try{_0x64c41=await _0x246ad3[_0x95bfba(0x110)][_0x95bfba(0xd6)](_0x1bcc54[_0x95bfba(0xcf)],_0x23cdb0);}catch(_0x3fb851){const _0x14ed71=_0x3fb851 instanceof Error?_0x3fb851['message']:String(_0x3fb851);return _0x14ed71[_0x95bfba(0xf7)]('404')||_0x14ed71[_0x95bfba(0xe4)]()[_0x95bfba(0xf7)](_0x95bfba(0x117))?console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x108)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1bcc54['agentName'])):console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x108)](_0x95bfba(0x112)+_0x1bcc54[_0x95bfba(0xcf)]+_0x95bfba(0xdb)+_0x14ed71)),0x1;}let _0x1a183e;if(!_0x380b9f)try{_0x1a183e=await setupEvaluatorAgent(_0x246ad3[_0x95bfba(0x110)],_0x599fcf[_0x95bfba(0x11f)]);}catch(_0x10c349){const _0x2c53eb=_0x10c349 instanceof Error?_0x10c349[_0x95bfba(0xdc)]:String(_0x10c349);return console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x108)](_0x95bfba(0xe1)+_0x2c53eb)),0x1;}console['log'](a5_0x21012e[_0x95bfba(0xe9)](_0x95bfba(0xbf))),console[_0x95bfba(0x9a)]('Site:\x20'+a5_0x21012e['white'](_0x551194)),console['log'](_0x95bfba(0xce)+a5_0x21012e[_0x95bfba(0xb4)](_0x1bcc54[_0x95bfba(0x8e)]+'/'+_0x1bcc54['agentName'])),console[_0x95bfba(0x9a)]();const _0x36cf2f=[],_0x4e3942=[],_0x240234=Date['now']();for(let _0xbf359f=0x0;_0xbf359f<_0xc2b5f4[_0x95bfba(0xa1)];_0xbf359f++){const _0x13f982=_0xc2b5f4[_0xbf359f];_0xc2b5f4[_0x95bfba(0xa1)]>0x1?console[_0x95bfba(0x9a)]('Test\x20'+(_0xbf359f+0x1)+'/'+_0xc2b5f4['length']+':\x20'+a5_0x21012e[_0x95bfba(0xb4)](_0x13f982[_0x95bfba(0xf9)])):console['log'](_0x95bfba(0x114)+a5_0x21012e[_0x95bfba(0xb4)](_0x13f982[_0x95bfba(0xf9)]));const _0x32aaf9=createCommandSpinner(_0x95bfba(0x116)+_0x13f982[_0x95bfba(0xe7)][_0x95bfba(0xa1)]+':\x20Sending\x20user\x20input...');_0x32aaf9['start']();try{const {result:_0xec42e3,conversation:_0x12a163}=await runTest(_0x246ad3[_0x95bfba(0x110)],_0x13f982,{'agentId':_0x64c41,'projectId':_0x23cdb0,'site':_0x551194,'noEval':_0x380b9f,'evaluatorId':_0x1a183e,'onRoundStart':(_0x5d6763,_0x500cd0)=>{const _0x400319=_0x95bfba;_0x32aaf9[_0x400319(0xba)]=_0x400319(0x9f)+(_0x5d6763+0x1)+'/'+_0x500cd0+_0x400319(0x10a);},'onRoundComplete':(_0x3137ea,_0x40cc64,_0x10f7f5)=>{const _0x3c74c9=_0x95bfba,_0x3cdb91=formatElapsed(_0x40cc64);_0x10f7f5?console[_0x3c74c9(0x9a)](_0x3c74c9(0x120)+(_0x3137ea+0x1)+'/'+_0x13f982[_0x3c74c9(0xe7)][_0x3c74c9(0xa1)]+_0x3c74c9(0xa0)+a5_0x21012e['green']('✓')+'\x20('+_0x3cdb91+')'):console['log'](_0x3c74c9(0x120)+(_0x3137ea+0x1)+'/'+_0x13f982[_0x3c74c9(0xe7)][_0x3c74c9(0xa1)]+'...\x20'+a5_0x21012e[_0x3c74c9(0x108)]('✗'));},'onEvaluationStart':()=>{const _0x1559e7=_0x95bfba;_0x32aaf9['text']=_0x1559e7(0xa3);},'onEvaluationComplete':_0x3785bf=>{const _0x4a189a=_0x95bfba,_0x5ec445=formatElapsed(_0x3785bf);console[_0x4a189a(0x9a)]('\x20\x20Evaluating...\x20'+a5_0x21012e[_0x4a189a(0xf0)]('✓')+'\x20('+_0x5ec445+')');}});_0x32aaf9[_0x95bfba(0xe5)](),_0x36cf2f[_0x95bfba(0x10c)](_0xec42e3),_0x4e3942[_0x95bfba(0x10c)](_0x12a163);if(_0xec42e3[_0x95bfba(0x96)]==='PASS')console['log'](a5_0x21012e['green'](_0x95bfba(0xec)+_0xec42e3[_0x95bfba(0x11d)]));else _0xec42e3[_0x95bfba(0x96)]===_0x95bfba(0xdf)?console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x108)](_0x95bfba(0xac)+_0xec42e3['reason'])):console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x108)](_0x95bfba(0xae)+_0xec42e3['reason']));_0xec42e3[_0x95bfba(0xd4)]&&console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0xf2)](_0x95bfba(0x100)+_0xec42e3[_0x95bfba(0xd4)])),console[_0x95bfba(0x9a)]();}catch(_0x48f240){_0x32aaf9['stop']();const _0x58bb26=_0x48f240 instanceof Error?_0x48f240['message']:String(_0x48f240);console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x108)](_0x95bfba(0xae)+_0x58bb26)),console['log'](),_0x36cf2f[_0x95bfba(0x10c)]({'name':_0x13f982[_0x95bfba(0xf9)],'status':_0x95bfba(0xfa),'reason':_0x58bb26,'timestamp':new Date()[_0x95bfba(0x9d)](),'duration_ms':0x0});}}const _0x429dbb=Date[_0x95bfba(0xb0)]()-_0x240234,_0x12c797=_0x36cf2f['filter'](_0x465ace=>_0x465ace['status']==='PASS')[_0x95bfba(0xa1)],_0x2fc3d6=_0x36cf2f[_0x95bfba(0x95)](_0x188e93=>_0x188e93[_0x95bfba(0x96)]==='FAIL')[_0x95bfba(0xa1)],_0x22bdd8=_0x36cf2f[_0x95bfba(0x95)](_0x474cc7=>_0x474cc7['status']==='ERROR')[_0x95bfba(0xa1)];console[_0x95bfba(0x9a)]('━'[_0x95bfba(0xbc)](0x3c)),console[_0x95bfba(0x9a)](_0x95bfba(0xa6)),console[_0x95bfba(0x9a)]('━'[_0x95bfba(0xbc)](0x3c)),console['log'](_0x95bfba(0xf3)+_0x36cf2f['length']),console['log'](_0x95bfba(0xb8)+a5_0x21012e[_0x95bfba(0xf0)](_0x12c797)),console[_0x95bfba(0x9a)]('Failed:\x20\x20\x20'+a5_0x21012e['red'](_0x2fc3d6));_0x22bdd8>0x0&&console['log'](_0x95bfba(0x97)+a5_0x21012e[_0x95bfba(0x108)](_0x22bdd8));console[_0x95bfba(0x9a)](_0x95bfba(0xb7)+formatElapsed(_0x429dbb)),console[_0x95bfba(0x9a)]('━'['repeat'](0x3c));const _0x65a6e0=_0x36cf2f[_0x95bfba(0x95)](_0x1529eb=>_0x1529eb[_0x95bfba(0x96)]!=='PASS');if(_0x65a6e0['length']>0x0){console[_0x95bfba(0x9a)](),console[_0x95bfba(0x9a)](_0x95bfba(0xf1));for(const _0x1672ad of _0x65a6e0){const _0x978d79=a5_0x21012e[_0x95bfba(0x108)]('✗'),_0x3ff05c=_0x1672ad[_0x95bfba(0x11d)][_0x95bfba(0xa1)]>0x32?_0x1672ad[_0x95bfba(0x11d)]['substring'](0x0,0x32)+_0x95bfba(0x115):_0x1672ad[_0x95bfba(0x11d)];console['log']('\x20\x20'+_0x978d79+'\x20'+_0x1672ad['name']+':\x20'+_0x3ff05c);}}const _0x9764d9={'summary':{'total':_0x36cf2f['length'],'passed':_0x12c797,'failed':_0x2fc3d6,'errors':_0x22bdd8>0x0?_0x22bdd8:undefined,'duration_ms':_0x429dbb},'tests':_0x36cf2f,'agent':{'project':_0x1bcc54[_0x95bfba(0x8e)],'name':_0x1bcc54[_0x95bfba(0xcf)],'site':_0x551194},'timestamp':new Date(_0x240234)[_0x95bfba(0x9d)]()};try{const _0x1c223d=buildCachedTestRun(_0x4e3942,{'site':_0x551194,'projectId':_0x23cdb0,'projectName':_0x1bcc54['projectName'],'agentId':_0x64c41,'agentName':_0x1bcc54[_0x95bfba(0xcf)],'testYmlPath':a5_0x1ad22c[_0x95bfba(0xaf)](_0x1bcc54[_0x95bfba(0xf8)])});saveLastTestRun(_0x1c223d);}catch{}if(_0x18c23e!=='table'||_0x52955e){const _0x3db860=formatResults(_0x9764d9,_0x18c23e);if(_0x52955e)try{a5_0x2af5e4[_0x95bfba(0xc4)](_0x52955e,_0x3db860,'utf-8'),console[_0x95bfba(0x9a)](),console['log'](a5_0x21012e['dim']('Output\x20written\x20to:\x20'+_0x52955e));}catch(_0x4b4ead){return console[_0x95bfba(0x9a)](),console[_0x95bfba(0x9a)](a5_0x21012e[_0x95bfba(0x108)](_0x95bfba(0x93)+_0x4b4ead)),0x1;}else console[_0x95bfba(0x9a)](),console['log'](_0x3db860);}return _0x65a6e0['length']>0x0?0x1:0x0;}async[a5_0x46e493(0xd5)](_0x3fbf0f,_0x42e07e){const _0x43ade4=a5_0x46e493,{options:_0x230016,tdx:_0x9c254a}=_0x3fbf0f,{definition:_0x1bfc48,agentInfo:_0x4d5c79,outputFormat:_0x301608,outputFile:_0x4690c3}=_0x42e07e,_0x4fe331=_0x230016[_0x43ade4(0x10e)],_0x5b465e=loadLastTestRun();if(!_0x5b465e)return console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)](_0x43ade4(0x119))),console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0xf2)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x5b465e[_0x43ade4(0x9c)]['agentName']!==_0x4d5c79[_0x43ade4(0xcf)])return console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)](_0x43ade4(0xc1)+_0x5b465e['agent']['agentName']+_0x43ade4(0x94)+_0x4d5c79[_0x43ade4(0xcf)]+'\x22.')),console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0xf2)](_0x43ade4(0xc3))),0x1;const _0x2c8810=new Set(_0x5b465e['conversations']['map'](_0x363554=>_0x363554[_0x43ade4(0xc5)])),_0xcac7a4=_0x1bfc48['tests'][_0x43ade4(0x95)](_0x1ee95b=>!_0x2c8810[_0x43ade4(0xb9)](_0x1ee95b[_0x43ade4(0xf9)]));if(_0xcac7a4[_0x43ade4(0xa1)]>0x0&&_0x5b465e[_0x43ade4(0x10e)]!==_0x4fe331)return console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)](_0x43ade4(0x11e))),console[_0x43ade4(0x9a)](a5_0x21012e['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x5b465e[_0x43ade4(0x10e)]+_0x43ade4(0x103)+_0x4fe331+'\x22.')),console['log'](a5_0x21012e[_0x43ade4(0xf2)]('Either\x20switch\x20to\x20the\x20\x22'+_0x5b465e[_0x43ade4(0x10e)]+_0x43ade4(0xee))),0x1;const _0x192c47=_0x1bfc48[_0x43ade4(0xbe)][_0x43ade4(0x95)](_0x4c87ec=>_0x2c8810[_0x43ade4(0xb9)](_0x4c87ec['name'])),_0x252c09=_0xcac7a4;let _0x4b21cf;try{_0x4b21cf=await setupEvaluatorAgent(_0x9c254a['llm'],_0x230016[_0x43ade4(0x11f)]);}catch(_0x448686){const _0x3c6b20=_0x448686 instanceof Error?_0x448686[_0x43ade4(0xdc)]:String(_0x448686);return console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)](_0x43ade4(0xe1)+_0x3c6b20)),0x1;}console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0xe9)](_0x43ade4(0xa7))),console[_0x43ade4(0x9a)](_0x43ade4(0xc9)+a5_0x21012e[_0x43ade4(0xb4)](_0x5b465e[_0x43ade4(0xf4)])),console[_0x43ade4(0x9a)](_0x43ade4(0xce)+a5_0x21012e['white'](_0x5b465e[_0x43ade4(0x9c)]['projectName']+'/'+_0x5b465e[_0x43ade4(0x9c)][_0x43ade4(0xcf)]));_0x252c09['length']>0x0&&console[_0x43ade4(0x9a)](_0x43ade4(0x109)+a5_0x21012e[_0x43ade4(0x123)](_0x252c09['length']));console[_0x43ade4(0x9a)]();const _0x343445=[],_0x5005b1=Date['now'](),_0x42a871=createCommandSpinner('Re-evaluating...');if(_0x192c47[_0x43ade4(0xa1)]>0x0)try{const _0x49df1e=await reevaluateFromCache(_0x9c254a[_0x43ade4(0x110)],_0x5b465e,{'tests':_0x192c47},{'evaluatorId':_0x4b21cf,'onTestStart':(_0x56bcd8,_0x19f651,_0x522e8e)=>{const _0x42307a=_0x43ade4;_0x42a871[_0x42307a(0xba)]=_0x42307a(0x90)+(_0x19f651+0x1)+'/'+_0x522e8e+':\x20'+_0x56bcd8+_0x42307a(0x115);if(!_0x42a871[_0x42307a(0xbb)])_0x42a871[_0x42307a(0x106)]();},'onTestComplete':(_0x4d657f,_0x241df0)=>{const _0x617b1b=_0x43ade4;_0x42a871['stop']();if(_0x241df0[_0x617b1b(0x96)]===_0x617b1b(0x10f))console[_0x617b1b(0x9a)](a5_0x21012e['green'](_0x617b1b(0xec)+_0x4d657f)+a5_0x21012e[_0x617b1b(0xf2)](_0x617b1b(0xff)));else _0x241df0[_0x617b1b(0x96)]===_0x617b1b(0xdf)?console[_0x617b1b(0x9a)](a5_0x21012e[_0x617b1b(0x108)](_0x617b1b(0xac)+_0x4d657f+'\x20-\x20'+_0x241df0[_0x617b1b(0x11d)])+a5_0x21012e[_0x617b1b(0xf2)](_0x617b1b(0xff))):console[_0x617b1b(0x9a)](a5_0x21012e[_0x617b1b(0x108)](_0x617b1b(0xae)+_0x4d657f+'\x20-\x20'+_0x241df0[_0x617b1b(0x11d)]));_0x241df0[_0x617b1b(0xd4)]&&console['log'](a5_0x21012e[_0x617b1b(0xf2)](_0x617b1b(0xf5)+_0x241df0['conversation_url'])),_0x343445[_0x617b1b(0x10c)](_0x241df0);},'onTestSkipped':(_0x39ec4b,_0x594b19)=>{const _0x106b30=_0x43ade4;_0x42a871['stop'](),console[_0x106b30(0x9a)](a5_0x21012e['yellow']('⚠\x20SKIPPED:\x20'+_0x39ec4b+_0x106b30(0x11a)+_0x594b19));}});for(const _0x467c61 of _0x49df1e){!_0x343445['find'](_0x43a8d3=>_0x43a8d3[_0x43ade4(0xf9)]===_0x467c61[_0x43ade4(0xf9)])&&_0x343445[_0x43ade4(0x10c)](_0x467c61);}}catch(_0xa24a67){_0x42a871[_0x43ade4(0xe5)]();const _0x2f8958=_0xa24a67 instanceof Error?_0xa24a67[_0x43ade4(0xdc)]:String(_0xa24a67);return console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)](_0x43ade4(0xef)+_0x2f8958)),0x1;}_0x42a871['stop']();if(_0x252c09[_0x43ade4(0xa1)]>0x0){console[_0x43ade4(0x9a)](),console[_0x43ade4(0x9a)](a5_0x21012e['cyan'](_0x43ade4(0xd7)));const {projectId:_0x4c43dc,agentId:_0x1c93bb}=_0x5b465e[_0x43ade4(0x9c)];for(const _0x1f9377 of _0x252c09){console[_0x43ade4(0x9a)](_0x43ade4(0xd2)+a5_0x21012e['white'](_0x1f9377['name']));const _0x3a33a4=createCommandSpinner(_0x43ade4(0x116)+_0x1f9377[_0x43ade4(0xe7)][_0x43ade4(0xa1)]+_0x43ade4(0x10a));_0x3a33a4['start']();try{const {result:_0x1ff229}=await runTest(_0x9c254a[_0x43ade4(0x110)],_0x1f9377,{'agentId':_0x1c93bb,'projectId':_0x4c43dc,'site':_0x5b465e[_0x43ade4(0x10e)],'noEval':![],'evaluatorId':_0x4b21cf,'onRoundStart':(_0x4566b4,_0x4eb411)=>{const _0x743798=_0x43ade4;_0x3a33a4[_0x743798(0xba)]=_0x743798(0x9f)+(_0x4566b4+0x1)+'/'+_0x4eb411+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x107a3a,_0x16a9f2,_0x38e40b)=>{const _0x49ea8a=_0x43ade4,_0x36a62a=formatElapsed(_0x16a9f2);_0x38e40b?console['log'](_0x49ea8a(0x120)+(_0x107a3a+0x1)+'/'+_0x1f9377[_0x49ea8a(0xe7)]['length']+_0x49ea8a(0xa0)+a5_0x21012e[_0x49ea8a(0xf0)]('✓')+'\x20('+_0x36a62a+')'):console[_0x49ea8a(0x9a)]('\x20\x20Round\x20'+(_0x107a3a+0x1)+'/'+_0x1f9377['rounds'][_0x49ea8a(0xa1)]+_0x49ea8a(0xa0)+a5_0x21012e[_0x49ea8a(0x108)]('✗'));},'onEvaluationStart':()=>{_0x3a33a4['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x4558b8=>{const _0x5cc414=_0x43ade4,_0x2b1022=formatElapsed(_0x4558b8);console[_0x5cc414(0x9a)](_0x5cc414(0x102)+a5_0x21012e['green']('✓')+'\x20('+_0x2b1022+')');}});_0x3a33a4[_0x43ade4(0xe5)](),_0x343445['push'](_0x1ff229);if(_0x1ff229[_0x43ade4(0x96)]==='PASS')console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0xf0)](_0x43ade4(0xec)+_0x1ff229[_0x43ade4(0x11d)])+a5_0x21012e[_0x43ade4(0xf2)](_0x43ade4(0xc7)));else _0x1ff229[_0x43ade4(0x96)]===_0x43ade4(0xdf)?console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)]('✗\x20FAIL:\x20'+_0x1ff229[_0x43ade4(0x11d)])+a5_0x21012e[_0x43ade4(0xf2)](_0x43ade4(0xc7))):console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)](_0x43ade4(0xae)+_0x1ff229['reason']));_0x1ff229[_0x43ade4(0xd4)]&&console['log'](a5_0x21012e['dim'](_0x43ade4(0xf5)+_0x1ff229[_0x43ade4(0xd4)]));}catch(_0x351e7b){_0x3a33a4['stop']();const _0x7f4560=_0x351e7b instanceof Error?_0x351e7b[_0x43ade4(0xdc)]:String(_0x351e7b);console[_0x43ade4(0x9a)](a5_0x21012e[_0x43ade4(0x108)](_0x43ade4(0xae)+_0x7f4560)),_0x343445['push']({'name':_0x1f9377['name'],'status':'ERROR','reason':_0x7f4560,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x43ade4(0x9a)]();const _0x2a4812=Date[_0x43ade4(0xb0)]()-_0x5005b1,_0xd638b3=_0x343445[_0x43ade4(0x95)](_0x4e596f=>_0x4e596f[_0x43ade4(0x96)]==='PASS')[_0x43ade4(0xa1)],_0x29c35a=_0x343445[_0x43ade4(0x95)](_0x2e6248=>_0x2e6248[_0x43ade4(0x96)]==='FAIL')[_0x43ade4(0xa1)],_0x28dffb=_0x343445[_0x43ade4(0x95)](_0x317f98=>_0x317f98['status']===_0x43ade4(0xfa))['length'];console['log']('━'[_0x43ade4(0xbc)](0x3c)),console[_0x43ade4(0x9a)](_0x43ade4(0xc6)),console[_0x43ade4(0x9a)]('━'['repeat'](0x3c)),console[_0x43ade4(0x9a)]('Total:\x20\x20\x20\x20'+_0x343445[_0x43ade4(0xa1)]),console[_0x43ade4(0x9a)](_0x43ade4(0xb8)+a5_0x21012e[_0x43ade4(0xf0)](_0xd638b3)),console[_0x43ade4(0x9a)](_0x43ade4(0xfb)+a5_0x21012e[_0x43ade4(0x108)](_0x29c35a));_0x28dffb>0x0&&console[_0x43ade4(0x9a)](_0x43ade4(0x97)+a5_0x21012e['red'](_0x28dffb));console[_0x43ade4(0x9a)](_0x43ade4(0xb7)+formatElapsed(_0x2a4812)),console[_0x43ade4(0x9a)]('━'['repeat'](0x3c));const _0x36c6e3={'summary':{'total':_0x343445['length'],'passed':_0xd638b3,'failed':_0x29c35a,'errors':_0x28dffb>0x0?_0x28dffb:undefined,'duration_ms':_0x2a4812},'tests':_0x343445,'agent':{'project':_0x4d5c79[_0x43ade4(0x8e)],'name':_0x4d5c79[_0x43ade4(0xcf)],'site':_0x4fe331},'timestamp':new Date(_0x5005b1)[_0x43ade4(0x9d)]()};if(_0x301608!=='table'||_0x4690c3){const _0x304c76=formatResults(_0x36c6e3,_0x301608);if(_0x4690c3)try{a5_0x2af5e4['writeFileSync'](_0x4690c3,_0x304c76,_0x43ade4(0x91)),console[_0x43ade4(0x9a)](),console[_0x43ade4(0x9a)](a5_0x21012e['dim'](_0x43ade4(0x121)+_0x4690c3));}catch(_0x5739da){return console[_0x43ade4(0x9a)](),console['log'](a5_0x21012e['red'](_0x43ade4(0x93)+_0x5739da)),0x1;}else console[_0x43ade4(0x9a)](),console[_0x43ade4(0x9a)](_0x304c76);}const _0x54fd48=_0x343445[_0x43ade4(0x95)](_0x14fd7d=>_0x14fd7d['status']!==_0x43ade4(0x10f));return _0x54fd48[_0x43ade4(0xa1)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x4efa6a=a6_0x4206;(function(_0x41a61f,_0x5b934d){const _0x2c77bf=a6_0x4206,_0xe6954c=_0x41a61f();while(!![]){try{const _0x9acd88=-parseInt(_0x2c77bf(0xd8))/0x1*(-parseInt(_0x2c77bf(0xf7))/0x2)+parseInt(_0x2c77bf(0xcc))/0x3*(parseInt(_0x2c77bf(0xe8))/0x4)+parseInt(_0x2c77bf(0xcb))/0x5+-parseInt(_0x2c77bf(0xf3))/0x6*(parseInt(_0x2c77bf(0xf6))/0x7)+-parseInt(_0x2c77bf(0xcf))/0x8+-parseInt(_0x2c77bf(0xd6))/0x9*(-parseInt(_0x2c77bf(0xc9))/0xa)+-parseInt(_0x2c77bf(0x103))/0xb*(-parseInt(_0x2c77bf(0xe4))/0xc);if(_0x9acd88===_0x5b934d)break;else _0xe6954c['push'](_0xe6954c['shift']());}catch(_0x11b98f){_0xe6954c['push'](_0xe6954c['shift']());}}}(a6_0x2be2,0xc3ed2));import{BaseCommand}from'./command.js';function a6_0x2be2(){const _0x3f4d48=['message','output','error','421836VFUqhL','DELETE','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-xsrf-token','356Zrivmx','GET','headers','verbose','set-cookie','body','cdp','api','method','includes','indexOf','1171356PgXNUh','execute','llm','56uISRpL','2cHMHYc','keys','Invalid\x20HTTP\x20method:\x20','.\x20Valid\x20methods:\x20','join','name','entries','toUpperCase','type','startsWith','set-cookie2','file','209fUiaFO','has','PATCH','authorization','POST','trim','status','300IbLPTQ','Error:\x20','6382355MpbmUU','40857ZEBMMs','length','proxy-authorization','7618120BrKpoC','stack','data','trino','site','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Invalid\x20header\x20format:\x20\x22','30132YvqKWs','substring','59678dQsPYV','x-auth-token','Endpoint\x20must\x20start\x20with\x20/:\x20','x-trino-user','request','color','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','\x22.\x20','Invalid\x20API\x20type:\x20'];a6_0x2be2=function(){return _0x3f4d48;};return a6_0x2be2();}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x4206(_0x29514b,_0x483783){_0x29514b=_0x29514b-0xc4;const _0x2be2a5=a6_0x2be2();let _0x420644=_0x2be2a5[_0x29514b];return _0x420644;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4efa6a(0xc5),a6_0x4efa6a(0xce),'cookie',a6_0x4efa6a(0xec),a6_0x4efa6a(0x101),a6_0x4efa6a(0xe7),a6_0x4efa6a(0xd9),a6_0x4efa6a(0xdb)]);function isSensitiveHeader(_0x18bb1c){const _0x5f0c87=a6_0x4efa6a;return SENSITIVE_HEADERS[_0x5f0c87(0x104)](_0x18bb1c['toLowerCase']());}function parseHeader(_0x482507){const _0x3cab91=a6_0x4efa6a,_0x5cd521=_0x482507[_0x3cab91(0xf2)](':');if(_0x5cd521===-0x1)throw new Error(_0x3cab91(0xd5)+_0x482507+_0x3cab91(0xdf)+_0x3cab91(0xe6));const _0x47f4e1=_0x482507[_0x3cab91(0xd7)](0x0,_0x5cd521)['trim'](),_0x13b188=_0x482507[_0x3cab91(0xd7)](_0x5cd521+0x1)[_0x3cab91(0xc7)]();if(!_0x47f4e1)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x482507+'\x22');return[_0x47f4e1,_0x13b188];}export class ApiCommand extends BaseCommand{[a6_0x4efa6a(0xfc)]=a6_0x4efa6a(0xef);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x107e7d){const _0xf05fd4=a6_0x4efa6a,{args:_0x1257c6,options:_0x4c4a0f}=_0x107e7d,_0x407821=_0x4c4a0f;if(_0x1257c6[_0xf05fd4(0xcd)]===0x0)return _0xf05fd4(0xd4);const _0x33315b=_0x1257c6[0x0];if(!_0x33315b[_0xf05fd4(0x100)]('/'))return _0xf05fd4(0xda)+_0x33315b;const _0x5e9b70=_0x407821['data'],_0x47d9b9=_0x407821[_0xf05fd4(0x102)];if(_0x5e9b70&&_0x47d9b9)return _0xf05fd4(0xde);const _0x98cd70=_0x407821[_0xf05fd4(0xf0)]||_0xf05fd4(0xe9),_0x4389c0=['GET',_0xf05fd4(0xc6),'PUT',_0xf05fd4(0xe5),_0xf05fd4(0xc4)];if(!_0x4389c0[_0xf05fd4(0xf1)](_0x98cd70[_0xf05fd4(0xfe)]()))return _0xf05fd4(0xf9)+_0x98cd70+_0xf05fd4(0xfa)+_0x4389c0[_0xf05fd4(0xfb)](',\x20');const _0x32cfdd=_0x407821[_0xf05fd4(0xff)]||'td',_0x9e61f8=['td',_0xf05fd4(0xee),'workflow',_0xf05fd4(0xd2),_0xf05fd4(0xf5),'llm-proxy','cas'];if(!_0x9e61f8[_0xf05fd4(0xf1)](_0x32cfdd))return _0xf05fd4(0xe0)+_0x32cfdd+'.\x20Valid\x20types:\x20'+_0x9e61f8[_0xf05fd4(0xfb)](',\x20');return undefined;}async[a6_0x4efa6a(0xf4)](_0x14e4f0){const _0x269427=a6_0x4efa6a,{options:_0x11dab6,args:_0x2f1f57,tdx:_0x59a661}=_0x14e4f0,_0x4b5e7d=_0x11dab6,_0x8b60d4=_0x2f1f57[0x0],_0x436d18=(_0x4b5e7d[_0x269427(0xf0)]||_0x269427(0xe9))[_0x269427(0xfe)](),_0x444b65=_0x4b5e7d[_0x269427(0xd1)],_0x560c1f=_0x4b5e7d['file'],_0x1bef99=_0x4b5e7d['header'],_0x3409af=_0x4b5e7d[_0x269427(0xff)]||'td';try{const _0x2b9a94={};if(_0x1bef99){const _0x3233e5=Array['isArray'](_0x1bef99)?_0x1bef99:[_0x1bef99];for(const _0x5d6d37 of _0x3233e5){const [_0x3d651d,_0x2fe54d]=parseHeader(_0x5d6d37);_0x2b9a94[_0x3d651d]=_0x2fe54d;}}let _0x4c24bc;if(_0x444b65)_0x4c24bc=_0x444b65;else{if(_0x560c1f)try{_0x4c24bc=RawAPI['readBodyFromFile'](_0x560c1f);}catch(_0x486713){return console['error'](_0x269427(0xca)+(_0x486713 instanceof Error?_0x486713[_0x269427(0xe1)]:String(_0x486713))),0x1;}}const _0x1523c0={'method':_0x436d18,'apiType':_0x3409af,'includeHeaders':_0x11dab6[_0x269427(0xeb)]};_0x4c24bc&&(_0x1523c0[_0x269427(0xed)]=_0x4c24bc);Object[_0x269427(0xf8)](_0x2b9a94)[_0x269427(0xcd)]>0x0&&(_0x1523c0[_0x269427(0xea)]=_0x2b9a94);if(_0x11dab6[_0x269427(0xeb)]){const _0x57f5f3=resolveSite(_0x11dab6[_0x269427(0xd3)]),_0x8192bd=getEndpoint(_0x57f5f3,_0x3409af),_0x1c52df=''+_0x8192bd+_0x8b60d4;console[_0x269427(0xe3)]('>\x20'+_0x436d18+'\x20'+_0x1c52df);const _0x485a96=getAuthHeaders(_0x57f5f3),_0x1c8d33={..._0x485a96,..._0x2b9a94};for(const [_0x5e7ffd,_0x5421bc]of Object[_0x269427(0xfd)](_0x1c8d33)){!isSensitiveHeader(_0x5e7ffd)&&console['error']('>\x20'+_0x5e7ffd+':\x20'+_0x5421bc);}_0x4c24bc&&console['error']('>'),console[_0x269427(0xe3)]('');}const _0x427533=await _0x59a661[_0x269427(0xef)][_0x269427(0xdc)](_0x8b60d4,_0x1523c0);if(_0x11dab6[_0x269427(0xeb)]&&_0x427533[_0x269427(0xea)]){console[_0x269427(0xe3)]('<\x20HTTP/1.1\x20'+_0x427533[_0x269427(0xc8)]);for(const [_0x47b0a2,_0x2868d0]of Object[_0x269427(0xfd)](_0x427533['headers'])){!isSensitiveHeader(_0x47b0a2)&&console[_0x269427(0xe3)]('<\x20'+_0x47b0a2+':\x20'+_0x2868d0);}console[_0x269427(0xe3)]('');}const _0x774b9=Boolean(_0x11dab6[_0x269427(0xe2)]),_0x5dd204={'color':_0x11dab6[_0x269427(0xdd)],'noColor':_0x11dab6['noColor']||_0x774b9&&!_0x11dab6[_0x269427(0xdd)]},_0x31d53b=colorizeJSON(_0x427533[_0x269427(0xd1)],_0x5dd204);return _0x11dab6['output']?(writeFileSync(_0x11dab6[_0x269427(0xe2)],_0x31d53b),console[_0x269427(0xe3)]('Results\x20saved\x20to\x20'+_0x11dab6[_0x269427(0xe2)])):console['log'](_0x31d53b),0x0;}catch(_0x2e5467){return _0x2e5467 instanceof Error?(console[_0x269427(0xe3)](_0x269427(0xca)+_0x2e5467[_0x269427(0xe1)]),_0x11dab6[_0x269427(0xeb)]&&_0x2e5467['stack']&&console[_0x269427(0xe3)]('\x0aStack\x20trace:\x0a'+_0x2e5467[_0x269427(0xd0)])):console[_0x269427(0xe3)](_0x269427(0xca)+String(_0x2e5467)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x1893b4=a7_0x214b;(function(_0xa26d62,_0x36c948){const _0x435580=a7_0x214b,_0x16915f=_0xa26d62();while(!![]){try{const _0x2c2fdc=parseInt(_0x435580(0x153))/0x1+parseInt(_0x435580(0x129))/0x2+-parseInt(_0x435580(0x119))/0x3+-parseInt(_0x435580(0x166))/0x4*(-parseInt(_0x435580(0x171))/0x5)+parseInt(_0x435580(0x168))/0x6+-parseInt(_0x435580(0x135))/0x7*(parseInt(_0x435580(0x142))/0x8)+-parseInt(_0x435580(0x137))/0x9;if(_0x2c2fdc===_0x36c948)break;else _0x16915f['push'](_0x16915f['shift']());}catch(_0x21bfa2){_0x16915f['push'](_0x16915f['shift']());}}}(a7_0xd146,0xd46eb));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x214b(_0x443d31,_0x588d54){_0x443d31=_0x443d31-0x113;const _0xd14600=a7_0xd146();let _0x214b1b=_0xd14600[_0x443d31];return _0x214b1b;}import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x28025a 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_0xd146(){const _0x5e63cd=['auth:setup','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20(profile:\x20','status','auth:clear','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Setting\x20up\x20authentication\x20for\x20site:\x20','No\x20credential\x20found','select','\x20\x20tdx','\x20\x20(','warn','API\x20key\x20cannot\x20be\x20empty','all','green','Read\x20credential\x20from\x20','44EfVsSh','last_name','2006286zmaTsP','apikey','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20an\x20API\x20key','tdx:\x20auth\x20clear','/app/mp/ak','logLevel','API\x20key','us01','743310fMesXS','execute','account_id','\x27\x20registered','cyan','✓\x20Profile\x20\x27','text','✓\x20Default\x20site\x20set\x20to\x20','access_token','5015172ktTLGL','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','description','Credential\x20type:\x20OAuth','✓\x20Signed\x20in\x20successfully','Choose\x20how\x20to\x20sign\x20in:','trim','Validating\x20API\x20key...','\x0aSetup\x20cancelled','\x20\x20user_id:','Opening\x20browser\x20for\x20authentication...','method','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','tdx\x20profile:\x20','dim','✗\x20Validation\x20failed:\x20','1794924bIeAGG','profile','email','tdx:\x20auth\x20setup','join','yellow','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','/oauth/authorize','red','System\x20keychain\x20is\x20not\x20available','apiKey','You\x20can\x20find\x20your\x20API\x20key\x20at:','14bMrmCH','message','6105078XWbKEv','Setup\x20cancelled','ERROR','Read\x20credential\x20from\x20keychain','✓\x20Authentication\x20successful\x0a','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20--profile\x20','filter','log','error','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','411816TJjYDZ','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','oauth','name','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20and\x20','getUserInfo','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','jobs','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','N/A','accountName','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','For\x20scripts\x20or\x20headless\x20servers','create','bold','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','456018NOKWGT','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.'];a7_0xd146=function(){return _0x5e63cd;};return a7_0xd146();}import a7_0x3086a0 from'chalk';export async function runOAuthLoginFlow(_0x2217a1,_0x2e8239,_0x55ceed,_0x48608c){const _0x31a2db=a7_0x214b,_0x26ae7c=await isKeychainAvailable();if(!_0x26ae7c)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x31a2db(0x155));let _0x3b2b76=_0x48608c?.[_0x31a2db(0x14d)];if(!_0x3b2b76){const _0x4c801f=await a7_0x28025a({'type':_0x31a2db(0x116),'name':'accountName','message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x4c801f[_0x31a2db(0x14d)]===undefined)throw new Error('Setup\x20cancelled');_0x3b2b76=_0x4c801f['accountName'][_0x31a2db(0x11f)]()||undefined;}const _0x1626d2=getConsoleUrl(_0x2217a1);console['log'](_0x31a2db(0x123));_0x3b2b76?console[_0x31a2db(0x13f)]('\x20\x20'+_0x1626d2+'/users/initiate_sso\x20(account:\x20'+_0x3b2b76+')'):console[_0x31a2db(0x13f)]('\x20\x20'+_0x1626d2+_0x31a2db(0x130));console['log'](_0x31a2db(0x146));const _0x1603ec=await startOAuthFlow(_0x2217a1,{'accountName':_0x3b2b76});console[_0x31a2db(0x13f)]('Validating\x20OAuth\x20tokens...');const _0x1cdeae=TDX[_0x31a2db(0x150)]({'site':_0x2217a1,'accessToken':_0x1603ec[_0x31a2db(0x118)],'logLevel':_0x55ceed??LogLevel[_0x31a2db(0x139)]}),_0x1c425e=await _0x1cdeae[_0x31a2db(0x14a)][_0x31a2db(0x148)]();console[_0x31a2db(0x13f)](a7_0x3086a0[_0x31a2db(0x164)](_0x31a2db(0x11d))),console['log']('\x20\x20'+a7_0x3086a0[_0x31a2db(0x114)](_0x2217a1+':'+_0x1c425e[_0x31a2db(0x173)])+_0x31a2db(0x122)+_0x1c425e['id']+_0x31a2db(0x160)+_0x1c425e[_0x31a2db(0x12b)]+')');!_0x3b2b76&&(console['log'](a7_0x3086a0[_0x31a2db(0x127)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x31a2db(0x13f)](a7_0x3086a0[_0x31a2db(0x127)](_0x31a2db(0x152))),console[_0x31a2db(0x13f)](a7_0x3086a0[_0x31a2db(0x127)](_0x31a2db(0x125))));await saveOAuthTokens(_0x1603ec,_0x2e8239),console['log'](_0x31a2db(0x13c)+(_0x2e8239?'\x20(profile:\x20'+_0x2e8239+')':''));if(_0x2e8239){const _0x2a7798={'site':_0x2217a1};saveProfileToUserConfig(_0x2e8239,_0x2a7798),console[_0x31a2db(0x13f)](_0x31a2db(0x115)+_0x2e8239+_0x31a2db(0x113));}else saveDefaultSiteToUserConfig(_0x2217a1),console[_0x31a2db(0x13f)](_0x31a2db(0x117)+_0x2217a1);const _0x3181c6=_0x2e8239?_0x31a2db(0x13d)+_0x2e8239:'';console[_0x31a2db(0x13f)](),console[_0x31a2db(0x13f)](_0x31a2db(0x14b)),console[_0x31a2db(0x13f)](_0x31a2db(0x15f)+_0x3181c6+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x31a2db(0x13f)]('\x20\x20tdx'+_0x3181c6+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x3de034=a7_0x214b,_0x5a074d=await a7_0x28025a({'type':_0x3de034(0x15e),'name':_0x3de034(0x124),'message':_0x3de034(0x11e),'choices':[{'title':_0x3de034(0x16a),'description':_0x3de034(0x143),'value':'oauth'},{'title':_0x3de034(0x16b),'description':_0x3de034(0x14f),'value':_0x3de034(0x169)}]});return _0x5a074d[_0x3de034(0x124)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1893b4(0x145)]=a7_0x1893b4(0x156);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x1893b4(0x172)](_0x4fe430){const _0x49b78a=a7_0x1893b4,{options:_0x4e2424}=_0x4fe430,_0x2a1f8e=_0x4e2424['profile'];console[_0x49b78a(0x13f)](a7_0x3086a0[_0x49b78a(0x151)](_0x49b78a(0x12c)));const _0x2712cf=_0x4e2424['site']||_0x49b78a(0x170),_0x1639d8=await promptSiteSelection(_0x2712cf,_0x2a1f8e,_0x49b78a(0x138));if(!_0x1639d8)return 0x1;const _0x4a471f=resolveSite(_0x1639d8),_0x162217=await promptAuthMethod();if(!_0x162217)return console[_0x49b78a(0x13f)](_0x49b78a(0x121)),0x1;if(_0x162217===_0x49b78a(0x144)){const {accountName:_0xeff82e}=_0x4e2424;return await runOAuthLoginFlow(_0x4a471f,_0x2a1f8e,_0x4e2424[_0x49b78a(0x16e)]??LogLevel[_0x49b78a(0x139)],{'accountName':_0xeff82e}),0x0;}console[_0x49b78a(0x13f)](_0x49b78a(0x15c)+_0x4a471f),console['log'](_0x49b78a(0x134)),console[_0x49b78a(0x13f)]('\x20\x20'+getConsoleUrl(_0x4a471f,_0x49b78a(0x16d)));const _0x59df91=await a7_0x28025a({'type':'password','name':_0x49b78a(0x133),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xebd357=>{const _0x2ed4dc=_0x49b78a;if(!_0xebd357||!_0xebd357[_0x2ed4dc(0x11f)]())return _0x2ed4dc(0x162);return!![];}});if(!_0x59df91['apiKey'])return console[_0x49b78a(0x13f)](_0x49b78a(0x121)),0x1;const _0xdb493d=_0x59df91['apiKey'];console[_0x49b78a(0x13f)](_0x49b78a(0x120));try{const _0x554207=TDX[_0x49b78a(0x150)]({'site':_0x4a471f,'apiKey':_0xdb493d[_0x49b78a(0x11f)](),'logLevel':_0x4e2424[_0x49b78a(0x16e)]??LogLevel['ERROR']}),_0x4d7f19=await _0x554207[_0x49b78a(0x14a)]['getUserInfo']();console[_0x49b78a(0x13f)](_0x49b78a(0x12f)+_0x4d7f19[_0x49b78a(0x12b)]+')');const _0x157e5c=await isKeychainAvailable();_0x157e5c?(await saveAPIKeyAsync(_0xdb493d['trim'](),_0x4a471f,_0x2a1f8e),console[_0x49b78a(0x13f)](_0x49b78a(0x11a)+(_0x2a1f8e?_0x49b78a(0x158)+_0x2a1f8e+')':''))):(console[_0x49b78a(0x161)](a7_0x3086a0[_0x49b78a(0x12e)](_0x49b78a(0x15b))),console[_0x49b78a(0x161)](a7_0x3086a0['yellow'](_0x49b78a(0x141))));if(_0x2a1f8e){const _0x38db90={'site':_0x4a471f};saveProfileToUserConfig(_0x2a1f8e,_0x38db90),console['log'](_0x49b78a(0x115)+_0x2a1f8e+_0x49b78a(0x113));}else saveDefaultSiteToUserConfig(_0x4a471f),console[_0x49b78a(0x13f)](_0x49b78a(0x117)+_0x4a471f);const _0x2694ed=_0x2a1f8e?_0x49b78a(0x13d)+_0x2a1f8e:'';return console[_0x49b78a(0x13f)](),console[_0x49b78a(0x13f)](_0x49b78a(0x14b)),console[_0x49b78a(0x13f)](_0x49b78a(0x15f)+_0x2694ed+_0x49b78a(0x154)),console[_0x49b78a(0x13f)](_0x49b78a(0x15f)+_0x2694ed+_0x49b78a(0x14e)),0x0;}catch(_0x52e16a){if(_0x52e16a instanceof HTTPClientError&&_0x52e16a[_0x49b78a(0x159)]===0x191)return printAuthError(_0x52e16a),0x1;return console[_0x49b78a(0x140)](a7_0x3086a0[_0x49b78a(0x131)](_0x49b78a(0x128)+(_0x52e16a instanceof Error?_0x52e16a[_0x49b78a(0x136)]:String(_0x52e16a)))),console[_0x49b78a(0x140)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1893b4(0x145)]='auth';[a7_0x1893b4(0x11b)]=a7_0x1893b4(0x149);async['execute'](_0x107e2c){const _0x21bfd6=a7_0x1893b4,{options:_0x365ddf,tdx:_0x491011}=_0x107e2c,_0x144269=_0x365ddf['site'],_0x143bc9=_0x365ddf[_0x21bfd6(0x12a)],_0x4c077c=_0x143bc9?_0x143bc9:_0x21bfd6(0x14c);console['log'](_0x21bfd6(0x126)+_0x4c077c+'\x20(site:\x20'+_0x144269+')');const _0x1731fb=await getOAuthTokens(_0x143bc9);if(_0x1731fb)console[_0x21bfd6(0x13f)](_0x21bfd6(0x11c)),console[_0x21bfd6(0x13f)](_0x21bfd6(0x13a)+(_0x143bc9?_0x21bfd6(0x158)+_0x143bc9+')':''));else{const _0x52170b=await resolveAPIKeyAsync(_0x144269,_0x143bc9);if(_0x52170b){const {source:_0x420cfa,isDeprecated:_0x147058}=_0x52170b,_0x3c1bc0=_0x21bfd6(0x165)+_0x420cfa;console[_0x21bfd6(0x13f)](_0x147058?a7_0x3086a0[_0x21bfd6(0x12e)](_0x3c1bc0):_0x3c1bc0);}else console[_0x21bfd6(0x13f)](a7_0x3086a0[_0x21bfd6(0x12e)](_0x21bfd6(0x15d)));}try{const _0x49e2a8=await _0x491011[_0x21bfd6(0x14a)][_0x21bfd6(0x148)]();return console[_0x21bfd6(0x13f)](a7_0x3086a0[_0x21bfd6(0x164)](_0x21bfd6(0x13b))),console[_0x21bfd6(0x13f)]('User:\x20'+_0x49e2a8[_0x21bfd6(0x12b)]),(_0x49e2a8['first_name']||_0x49e2a8['last_name'])&&console[_0x21bfd6(0x13f)]('Name:\x20'+[_0x49e2a8['first_name'],_0x49e2a8[_0x21bfd6(0x167)]]['filter'](Boolean)[_0x21bfd6(0x12d)]('\x20')),0x0;}catch(_0x4d3522){return _0x4d3522 instanceof HTTPClientError&&_0x4d3522[_0x21bfd6(0x159)]===0x191?printAuthError(_0x4d3522,!![],_0x143bc9):console[_0x21bfd6(0x140)](a7_0x3086a0['red']('✗\x20Validation\x20failed:\x20'+(_0x4d3522 instanceof Error?_0x4d3522['message']:String(_0x4d3522)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1893b4(0x145)]=a7_0x1893b4(0x15a);[a7_0x1893b4(0x11b)]=a7_0x1893b4(0x157);async['execute'](_0x2c9bc0){const _0x272416=a7_0x1893b4,{options:_0x2fcc78}=_0x2c9bc0,_0x1b41cb=_0x2fcc78[_0x272416(0x12a)];console[_0x272416(0x13f)](a7_0x3086a0[_0x272416(0x151)](_0x272416(0x16c)));const _0x1ab44d=await isKeychainAvailable();if(!_0x1ab44d)return console['error'](a7_0x3086a0[_0x272416(0x131)](_0x272416(0x132))),0x1;const [_0x30163f,_0x3f5f14]=await Promise[_0x272416(0x163)]([deleteKeychainAPIKey(_0x1b41cb),deleteOAuthTokens(_0x1b41cb)]);if(_0x30163f||_0x3f5f14){clearCredentialCache();const _0x230ad3=[_0x30163f&&_0x272416(0x16f),_0x3f5f14&&'OAuth\x20tokens'][_0x272416(0x13e)](Boolean)[_0x272416(0x12d)](_0x272416(0x147));return console[_0x272416(0x13f)]('✓\x20'+_0x230ad3+'\x20removed\x20from\x20keychain'+(_0x1b41cb?'\x20(profile:\x20'+_0x1b41cb+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x1b41cb?'\x20for\x20profile:\x20'+_0x1b41cb:'')),0x1;}}
|
|
1
|
+
const a7_0xacb7f9=a7_0x3389;(function(_0x5a2f51,_0x520847){const _0x4fefc0=a7_0x3389,_0x5ee43a=_0x5a2f51();while(!![]){try{const _0x9ce7b5=-parseInt(_0x4fefc0(0xab))/0x1+-parseInt(_0x4fefc0(0xac))/0x2*(parseInt(_0x4fefc0(0xc0))/0x3)+parseInt(_0x4fefc0(0xc2))/0x4+-parseInt(_0x4fefc0(0xa8))/0x5+parseInt(_0x4fefc0(0xea))/0x6+parseInt(_0x4fefc0(0xc1))/0x7*(-parseInt(_0x4fefc0(0xa3))/0x8)+parseInt(_0x4fefc0(0xcb))/0x9*(parseInt(_0x4fefc0(0xe6))/0xa);if(_0x9ce7b5===_0x520847)break;else _0x5ee43a['push'](_0x5ee43a['shift']());}catch(_0x57cbf3){_0x5ee43a['push'](_0x5ee43a['shift']());}}}(a7_0x14b8,0x9ee5a));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x3389(_0x1a143a,_0x27bb36){_0x1a143a=_0x1a143a-0x8c;const _0x14b8a1=a7_0x14b8();let _0x338980=_0x14b8a1[_0x1a143a];return _0x338980;}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x544a06 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4827af from'chalk';export async function runOAuthLoginFlow(_0x206a35,_0x4aa200,_0x5581b3,_0x3ac8e3){const _0x3c1b45=a7_0x3389,_0x151d8a=await isKeychainAvailable();if(!_0x151d8a)throw new Error(_0x3c1b45(0xcf)+_0x3c1b45(0xb0));let _0x1d416a=_0x3ac8e3?.[_0x3c1b45(0xd4)];if(!_0x1d416a){const _0x385bed=await a7_0x544a06({'type':_0x3c1b45(0xe5),'name':_0x3c1b45(0xd4),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x385bed[_0x3c1b45(0xd4)]===undefined)throw new Error('Setup\x20cancelled');_0x1d416a=_0x385bed[_0x3c1b45(0xd4)][_0x3c1b45(0x9f)]()||undefined;}const _0x46dee7=getConsoleUrl(_0x206a35);console[_0x3c1b45(0xe3)](_0x3c1b45(0xdc));_0x1d416a?console[_0x3c1b45(0xe3)]('\x20\x20'+_0x46dee7+_0x3c1b45(0x97)+_0x1d416a+')'):console[_0x3c1b45(0xe3)]('\x20\x20'+_0x46dee7+_0x3c1b45(0xb7));console['log'](_0x3c1b45(0xb3));const _0xbfcc6d=await startOAuthFlow(_0x206a35,{'accountName':_0x1d416a});console['log']('Validating\x20OAuth\x20tokens...');const _0x57f472=TDX[_0x3c1b45(0xc4)]({'site':_0x206a35,'accessToken':_0xbfcc6d['access_token'],'logLevel':_0x5581b3??LogLevel[_0x3c1b45(0x95)]}),_0x137a88=await _0x57f472[_0x3c1b45(0xd0)]['getUserInfo']();console[_0x3c1b45(0xe3)](a7_0x4827af[_0x3c1b45(0xb4)](_0x3c1b45(0xe2))),console[_0x3c1b45(0xe3)]('\x20\x20'+a7_0x4827af[_0x3c1b45(0x9e)](_0x206a35+':'+_0x137a88['account_id'])+_0x3c1b45(0xaa)+_0x137a88['id']+_0x3c1b45(0xa1)+_0x137a88[_0x3c1b45(0xa5)]+')');!_0x1d416a&&(console[_0x3c1b45(0xe3)](a7_0x4827af[_0x3c1b45(0xb1)](_0x3c1b45(0xec))),console[_0x3c1b45(0xe3)](a7_0x4827af[_0x3c1b45(0xb1)](_0x3c1b45(0xb2))),console[_0x3c1b45(0xe3)](a7_0x4827af['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0xbfcc6d,_0x4aa200),console[_0x3c1b45(0xe3)](_0x3c1b45(0xa6)+(_0x4aa200?_0x3c1b45(0x94)+_0x4aa200+')':''));if(_0x4aa200){const _0x44a026={'site':_0x206a35};saveProfileToUserConfig(_0x4aa200,_0x44a026),console[_0x3c1b45(0xe3)]('✓\x20Profile\x20\x27'+_0x4aa200+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x206a35),console[_0x3c1b45(0xe3)](_0x3c1b45(0xd5)+_0x206a35);const _0xe5f913=_0x4aa200?_0x3c1b45(0x93)+_0x4aa200:'';console['log'](),console[_0x3c1b45(0xe3)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0xe5f913+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x3c1b45(0xe3)](_0x3c1b45(0x8c)+_0xe5f913+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x4d9d9f=a7_0x3389,_0x37dfcf=await a7_0x544a06({'type':_0x4d9d9f(0xa7),'name':_0x4d9d9f(0xd7),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x4d9d9f(0xcc),'value':_0x4d9d9f(0xb8)},{'title':_0x4d9d9f(0xe9),'description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x4d9d9f(0xce)}]});return _0x37dfcf[_0x4d9d9f(0xd7)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0xacb7f9(0xdb)]=a7_0xacb7f9(0x91);[a7_0xacb7f9(0xc3)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0xacb7f9(0xae)](_0x3c55e4){const _0x13abae=a7_0xacb7f9,{options:_0x1a2ddd}=_0x3c55e4,_0x1bb8c6=_0x1a2ddd[_0x13abae(0xcd)];console['log'](a7_0x4827af[_0x13abae(0x8d)](_0x13abae(0x9a)));const _0x4f6a76=_0x1a2ddd[_0x13abae(0x8e)]||_0x13abae(0x96),_0x110930=await promptSiteSelection(_0x4f6a76,_0x1bb8c6,_0x13abae(0xbc));if(!_0x110930)return 0x1;const _0x3a9559=resolveSite(_0x110930),_0x1105d5=await promptAuthMethod();if(!_0x1105d5)return console['log']('\x0aSetup\x20cancelled'),0x1;if(_0x1105d5===_0x13abae(0xb8)){const {accountName:_0x1d8f52}=_0x1a2ddd;return await runOAuthLoginFlow(_0x3a9559,_0x1bb8c6,_0x1a2ddd[_0x13abae(0x99)]??LogLevel[_0x13abae(0x95)],{'accountName':_0x1d8f52}),0x0;}console[_0x13abae(0xe3)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3a9559),console[_0x13abae(0xe3)](_0x13abae(0xb6)),console[_0x13abae(0xe3)]('\x20\x20'+getConsoleUrl(_0x3a9559,_0x13abae(0xb5)));const _0x4995e6=await a7_0x544a06({'type':_0x13abae(0xa2),'name':'apiKey','message':_0x13abae(0xa4),'validate':_0x23b7fd=>{const _0x45e2c9=_0x13abae;if(!_0x23b7fd||!_0x23b7fd[_0x45e2c9(0x9f)]())return _0x45e2c9(0xb9);return!![];}});if(!_0x4995e6[_0x13abae(0x98)])return console[_0x13abae(0xe3)](_0x13abae(0xc6)),0x1;const _0x128d92=_0x4995e6[_0x13abae(0x98)];console['log'](_0x13abae(0xd9));try{const _0x169aec=TDX[_0x13abae(0xc4)]({'site':_0x3a9559,'apiKey':_0x128d92[_0x13abae(0x9f)](),'logLevel':_0x1a2ddd['logLevel']??LogLevel[_0x13abae(0x95)]}),_0x396e7a=await _0x169aec[_0x13abae(0xd0)][_0x13abae(0xd2)]();console[_0x13abae(0xe3)](_0x13abae(0x8f)+_0x396e7a[_0x13abae(0xa5)]+')');const _0x3b81f1=await isKeychainAvailable();_0x3b81f1?(await saveAPIKeyAsync(_0x128d92['trim'](),_0x3a9559,_0x1bb8c6),console['log'](_0x13abae(0xa0)+(_0x1bb8c6?'\x20(profile:\x20'+_0x1bb8c6+')':''))):(console[_0x13abae(0xdf)](a7_0x4827af[_0x13abae(0xe8)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x13abae(0xdf)](a7_0x4827af[_0x13abae(0xe8)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x1bb8c6){const _0x3f3400={'site':_0x3a9559};saveProfileToUserConfig(_0x1bb8c6,_0x3f3400),console[_0x13abae(0xe3)]('✓\x20Profile\x20\x27'+_0x1bb8c6+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3a9559),console[_0x13abae(0xe3)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x3a9559);const _0x5da77b=_0x1bb8c6?'\x20--profile\x20'+_0x1bb8c6:'';return console[_0x13abae(0xe3)](),console[_0x13abae(0xe3)](_0x13abae(0xe4)),console[_0x13abae(0xe3)]('\x20\x20tdx'+_0x5da77b+_0x13abae(0x9d)),console['log'](_0x13abae(0x8c)+_0x5da77b+_0x13abae(0xad)),0x0;}catch(_0x1d51f7){if(_0x1d51f7 instanceof HTTPClientError&&_0x1d51f7['status']===0x191)return printAuthError(_0x1d51f7),0x1;return console[_0x13abae(0xdd)](a7_0x4827af['red'](_0x13abae(0xe0)+(_0x1d51f7 instanceof Error?_0x1d51f7[_0x13abae(0xc9)]:String(_0x1d51f7)))),console[_0x13abae(0xdd)](_0x13abae(0xd8)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xacb7f9(0xdb)]=a7_0xacb7f9(0xd3);[a7_0xacb7f9(0xc3)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0xacb7f9(0xae)](_0x347cd3){const _0x36ecd3=a7_0xacb7f9,{options:_0x7c8065,tdx:_0x20a4ae}=_0x347cd3,_0x1441d3=_0x7c8065['site'],_0x26a80b=_0x7c8065['profile'],_0x5a5f2f=_0x26a80b?_0x26a80b:_0x36ecd3(0xed);console[_0x36ecd3(0xe3)](_0x36ecd3(0xca)+_0x5a5f2f+_0x36ecd3(0xba)+_0x1441d3+')');const _0x4d90ae=await getOAuthTokens(_0x26a80b);if(_0x4d90ae)console['log'](_0x36ecd3(0xd6)),console[_0x36ecd3(0xe3)](_0x36ecd3(0xe7)+(_0x26a80b?_0x36ecd3(0x94)+_0x26a80b+')':''));else{const _0x57b7dc=await resolveAPIKeyAsync(_0x1441d3,_0x26a80b);if(_0x57b7dc){const {source:_0x7f2318,isDeprecated:_0x1e3afb}=_0x57b7dc,_0x50bcc3=_0x36ecd3(0xc5)+_0x7f2318;console[_0x36ecd3(0xe3)](_0x1e3afb?a7_0x4827af[_0x36ecd3(0xe8)](_0x50bcc3):_0x50bcc3);}else console[_0x36ecd3(0xe3)](a7_0x4827af[_0x36ecd3(0xe8)](_0x36ecd3(0x92)));}try{const _0x324393=await _0x20a4ae[_0x36ecd3(0xd0)][_0x36ecd3(0xd2)]();return console['log'](a7_0x4827af[_0x36ecd3(0xb4)](_0x36ecd3(0xa9))),console['log']('User:\x20'+_0x324393[_0x36ecd3(0xa5)]),(_0x324393[_0x36ecd3(0x9b)]||_0x324393[_0x36ecd3(0xbe)])&&console[_0x36ecd3(0xe3)](_0x36ecd3(0xc8)+[_0x324393['first_name'],_0x324393['last_name']]['filter'](Boolean)[_0x36ecd3(0xeb)]('\x20')),0x0;}catch(_0x367ae2){return _0x367ae2 instanceof HTTPClientError&&_0x367ae2[_0x36ecd3(0xbb)]===0x191?printAuthError(_0x367ae2,!![],_0x26a80b):console[_0x36ecd3(0xdd)](a7_0x4827af['red'](_0x36ecd3(0xe0)+(_0x367ae2 instanceof Error?_0x367ae2[_0x36ecd3(0xc9)]:String(_0x367ae2)))),0x1;}}}function a7_0x14b8(){const _0x3203b0=['email','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','select','2079250helEKn','✓\x20Authentication\x20successful\x0a','\x20\x20user_id:','1290430zhFcFi','62NSlEAy','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','execute','System\x20keychain\x20is\x20not\x20available','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','dim','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','green','/app/mp/ak','You\x20can\x20find\x20your\x20API\x20key\x20at:','/oauth/authorize','oauth','API\x20key\x20cannot\x20be\x20empty','\x20(site:\x20','status','Setup\x20cancelled','auth:clear','last_name','\x20removed\x20from\x20keychain','48999Spcevw','55839hiWNbl','718776tFOHyi','description','create','Read\x20credential\x20from\x20','\x0aSetup\x20cancelled','\x20and\x20','Name:\x20','message','tdx\x20profile:\x20','26451bNiedn','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','profile','apikey','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','jobs','API\x20key','getUserInfo','auth','accountName','✓\x20Default\x20site\x20set\x20to\x20','Credential\x20type:\x20OAuth','method','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Validating\x20API\x20key...','Remove\x20API\x20key\x20from\x20system\x20keychain','name','Opening\x20browser\x20for\x20authentication...','error','all','warn','✗\x20Validation\x20failed:\x20','OAuth\x20tokens','✓\x20Signed\x20in\x20successfully','log','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','text','10930CphvUO','Read\x20credential\x20from\x20keychain','yellow','Use\x20an\x20API\x20key','1662606aCrarm','join','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','N/A','\x20\x20tdx','bold','site','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','red','auth:setup','No\x20credential\x20found','\x20--profile\x20','\x20(profile:\x20','ERROR','us01','/users/initiate_sso\x20(account:\x20','apiKey','logLevel','tdx:\x20auth\x20setup','first_name','tdx:\x20auth\x20clear','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','cyan','trim','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20\x20(','password','808sMXvef','Enter\x20your\x20TD\x20API\x20key:'];a7_0x14b8=function(){return _0x3203b0;};return a7_0x14b8();}export class AuthClearCommand extends BaseCommand{[a7_0xacb7f9(0xdb)]=a7_0xacb7f9(0xbd);[a7_0xacb7f9(0xc3)]=a7_0xacb7f9(0xda);async[a7_0xacb7f9(0xae)](_0x447e26){const _0x169938=a7_0xacb7f9,{options:_0x314c85}=_0x447e26,_0x3a4dfa=_0x314c85['profile'];console['log'](a7_0x4827af[_0x169938(0x8d)](_0x169938(0x9c)));const _0x51823c=await isKeychainAvailable();if(!_0x51823c)return console[_0x169938(0xdd)](a7_0x4827af[_0x169938(0x90)](_0x169938(0xaf))),0x1;const [_0x493616,_0x32016f]=await Promise[_0x169938(0xde)]([deleteKeychainAPIKey(_0x3a4dfa),deleteOAuthTokens(_0x3a4dfa)]);if(_0x493616||_0x32016f){clearCredentialCache();const _0x31394a=[_0x493616&&_0x169938(0xd1),_0x32016f&&_0x169938(0xe1)]['filter'](Boolean)[_0x169938(0xeb)](_0x169938(0xc7));return console[_0x169938(0xe3)]('✓\x20'+_0x31394a+_0x169938(0xbf)+(_0x3a4dfa?_0x169938(0x94)+_0x3a4dfa+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x3a4dfa?'\x20for\x20profile:\x20'+_0x3a4dfa:'')),0x1;}}
|