@treasuredata/tdx 2026.4.12 → 2026.4.14
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/access-tracker.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_0xf83002=a3_0x4ea4;function a3_0x4ea4(_0x4a3724,_0x12712c){_0x4a3724=_0x4a3724-0x71;const _0x2a8939=a3_0x2a89();let _0x4ea4e5=_0x2a8939[_0x4a3724];return _0x4ea4e5;}(function(_0x395a22,_0xbade96){const _0x49efed=a3_0x4ea4,_0x4191c7=_0x395a22();while(!![]){try{const _0x30fed5=-parseInt(_0x49efed(0x8d))/0x1*(-parseInt(_0x49efed(0x78))/0x2)+parseInt(_0x49efed(0x8f))/0x3+parseInt(_0x49efed(0x7b))/0x4+parseInt(_0x49efed(0x7d))/0x5+-parseInt(_0x49efed(0x83))/0x6*(-parseInt(_0x49efed(0x8c))/0x7)+-parseInt(_0x49efed(0x8b))/0x8+parseInt(_0x49efed(0x86))/0x9*(-parseInt(_0x49efed(0x92))/0xa);if(_0x30fed5===_0xbade96)break;else _0x4191c7['push'](_0x4191c7['shift']());}catch(_0x445b6f){_0x4191c7['push'](_0x4191c7['shift']());}}}(a3_0x2a89,0x3960f));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_0x2a89(){const _0x5a6907=['1784664sABMJC','cause','2206805RgyuNm','resolveParentId','listActivations','List\x20activations\x20for\x20a\x20segment','error','✔\x20Found\x20','102tZuuNG','Site:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','7617906IPYCVf','Error:\x20Segment\x20name\x20is\x20required','message','segment','Resolving\x20parent\x20segment\x20\x27','662048DOpVsL','131817hHvKXJ','36583tQByNP','Resolved\x20child\x20ID:\x20','1201740SURPtJ','verbose','description','20bchHai','\x20activation','Resolving\x20child\x20segment\x20\x27','Error:\x20','data','Parent\x20name:\x20','Resolved\x20parent\x20ID:\x20','\x27...','length','site','22gdFZIU','Child\x20name:\x20','activations'];a3_0x2a89=function(){return _0x5a6907;};return a3_0x2a89();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0xf83002(0x7a);[a3_0xf83002(0x91)]=a3_0xf83002(0x80);async['execute'](_0x471df4){const _0x33c9f1=a3_0xf83002,{options:_0x186679,args:_0x2cfdc2,tdx:_0xbf1ccd}=_0x471df4;if(_0x2cfdc2[_0x33c9f1(0x76)]===0x0)return console[_0x33c9f1(0x81)](_0x33c9f1(0x87)),console[_0x33c9f1(0x81)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x3a90f3,childId:_0x41ae87}=parseSegmentRef(_0x2cfdc2[0x0]);if(!_0x41ae87)return console[_0x33c9f1(0x81)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x33c9f1(0x81)](_0x33c9f1(0x85)),0x1;_0x186679[_0x33c9f1(0x90)]&&(console[_0x33c9f1(0x81)](_0x33c9f1(0x84)+_0x186679[_0x33c9f1(0x77)]),console['error'](_0x33c9f1(0x73)+_0x3a90f3),console[_0x33c9f1(0x81)](_0x33c9f1(0x79)+_0x41ae87));const _0x46b63c=await withSpinner(_0x33c9f1(0x8a)+_0x3a90f3+_0x33c9f1(0x75),()=>_0xbf1ccd[_0x33c9f1(0x89)][_0x33c9f1(0x7e)](_0x3a90f3),{'verbose':_0x186679[_0x33c9f1(0x90)]}),_0x10fb24=_0x46b63c[_0x33c9f1(0x72)];_0x186679[_0x33c9f1(0x90)]&&console[_0x33c9f1(0x81)](_0x33c9f1(0x74)+_0x10fb24);const _0x2de8da=await withSpinner(_0x33c9f1(0x94)+_0x41ae87+_0x33c9f1(0x75),()=>_0xbf1ccd[_0x33c9f1(0x89)]['resolveSegmentId'](_0x10fb24,_0x41ae87),{'verbose':_0x186679[_0x33c9f1(0x90)]}),_0x3f86af=_0x2de8da[_0x33c9f1(0x72)];_0x186679[_0x33c9f1(0x90)]&&console[_0x33c9f1(0x81)](_0x33c9f1(0x8e)+_0x3f86af);const _0x3978bf=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x41ae87+_0x33c9f1(0x75),()=>_0xbf1ccd[_0x33c9f1(0x89)][_0x33c9f1(0x7f)](_0x10fb24,_0x3f86af),{'verbose':_0x186679['verbose']}),_0x150399=_0x3978bf[_0x33c9f1(0x72)];return console[_0x33c9f1(0x81)](_0x33c9f1(0x82)+_0x150399['length']+_0x33c9f1(0x93)+(_0x150399['length']!==0x1?'s':'')),await handleSDKOutput(_0x150399,_0x186679),0x0;}catch(_0x20d3be){if(_0x20d3be instanceof SDKError)return console[_0x33c9f1(0x81)](_0x33c9f1(0x71)+_0x20d3be[_0x33c9f1(0x88)]),_0x20d3be[_0x33c9f1(0x7c)]&&console[_0x33c9f1(0x81)]('\x20\x20Cause:\x20'+_0x20d3be[_0x33c9f1(0x7c)]),0x1;throw _0x20d3be;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x4c384c=a4_0x1cf8;(function(_0x5c72e2,_0x5b153b){const _0x3b1020=a4_0x1cf8,_0x405b61=_0x5c72e2();while(!![]){try{const _0x5e6470=parseInt(_0x3b1020(0x164))/0x1*(parseInt(_0x3b1020(0xd6))/0x2)+-parseInt(_0x3b1020(0xe0))/0x3*(parseInt(_0x3b1020(0x108))/0x4)+parseInt(_0x3b1020(0x14f))/0x5+-parseInt(_0x3b1020(0x122))/0x6*(-parseInt(_0x3b1020(0xba))/0x7)+-parseInt(_0x3b1020(0xbc))/0x8*(parseInt(_0x3b1020(0xfc))/0x9)+-parseInt(_0x3b1020(0xd4))/0xa+-parseInt(_0x3b1020(0xfb))/0xb*(-parseInt(_0x3b1020(0xb5))/0xc);if(_0x5e6470===_0x5b153b)break;else _0x405b61['push'](_0x405b61['shift']());}catch(_0x10eb79){_0x405b61['push'](_0x405b61['shift']());}}}(a4_0x17ca,0xe0008));import a4_0x551269 from'chalk';import a4_0x4decad from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x1cf8(_0x612d57,_0x59f828){_0x612d57=_0x612d57-0xb0;const _0x17ca88=a4_0x17ca();let _0x1cf84e=_0x17ca88[_0x612d57];return _0x1cf84e;}import{saveSessionContext}from'../core/session.js';function a4_0x17ca(){const _0x39f906=['no_local_folder','site','Cloning\x20\x22','join','yellow','log','agent:pull','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','8UcPeQp','\x0aChanges\x20to\x20chat\x20interface\x20\x27','force','\x0aError:','projectDir','new','\x20files\x20to\x20','-\x20no\x20files\x20written','prompts','\x20created','errors','reason','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20=\x20','Pushing\x20to\x20project...','textKnowledgeBases','Cancelled','cwd','Analyzing\x20project\x20\x22','Would\x20push\x20agent:\x20','\x0a✔\x20Pulled\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20--name\x20','6HVcQdT','agent.yml','red','\x0aChanges\x20to\x20integration\x20\x27','error','llmProject','repeat','\x22\x20to\x20new\x20project\x20\x22','llm_project','green','integrations','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','newProjectName','projectId','\x22...','\x22\x20from\x20project\x20\x22','chatInterfaces','\x0aChanges:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20changed','\x20new','\x20|\x20','name','New\x20project\x20ID:\x20','llm','Using\x20project\x20from\x20context:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','outputDir','yes','\x20\x20Knowledge\x20Base\x20\x22','action','\x0aPush\x20','\x20errors','pushAgent','\x0aProject\x20pushed\x20with\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','No\x20tdx.json\x20found\x20in\x20','parse','Project\x20cloned\x20successfully','\x22\x20to\x20a\x20different\x20profile','Output\x20path:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','cyan','\x22:\x20','2059925vKxtjg','\x20\x20Form\x20Interface\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','Clone\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Chat\x20Interfaces:\x20','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','agentName','unchanged','\x0aChanges\x20to\x20form\x20interface\x20\x27','-\x20nothing\x20pushed','pushProject','Agent\x20pulled\x20successfully','projectName','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','tdx.json','counts','Agent:\x20','\x20\x20Experimental\x20Artifacts:\x20','427722pqYTtO','New\x20project:\x20','session','knowledgeBases','Output:\x20','Status:\x20','agents','Source:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','push','\x0aChanges\x20to\x20prompt\x20\x27','Using\x20current\x20project:\x20','132somdge','updated','\x0a✔\x20Pushed\x20','\x20\x20Prompts:\x20','Errors:','5207713FrgOID','pullAgent','10768owSmMe','pullProject','\x0aPull\x20summary\x20for\x20\x27','message','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20Integrations:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','context','Would\x20clone:','profile','sourceProjectName','Project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','experimentalArtifacts','\x20\x20Chat\x20Interface\x20\x22','gray','\x0aErrors\x20found:','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Using\x20context\x20project:\x20','Would\x20pull\x20agent:\x20','source','formInterfaces','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Prompt\x20\x22','2284090gCdpvP','experimentalKnowledgeBases','4jvhQjB','\x20\x20Agent\x20\x22','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20unchanged','\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\x20from\x20','created','Summary:','agent:push','execute','657240tRYRFJ','diff','\x20\x20Agents:\x20','dirname','Failed\x20to\x20push\x20agent:\x20','\x20\x20Knowledge\x20Bases:\x20','agentId','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','dim','description','✔\x20Context\x20set:\x20','Project\x20cloned\x20with\x20errors','outputPath','Using\x20local\x20project:\x20','\x0aPush\x20summary\x20for\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','hasChanges','Analyzing\x20changes\x20to\x20push...','\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','utf-8','\x20\x20Form\x20Interfaces:\x20','dryRun','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','total','INVALID_ARGUMENT','\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)','Cannot\x20clone\x20from\x20context\x20project\x20\x22','1057331MuyWzh','9927GnBQnp','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','<new-name>','\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'];a4_0x17ca=function(){return _0x39f906;};return a4_0x17ca();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x34cfde){const _0x1e095c=a4_0x1cf8,_0x10b0ab=[];if(_0x34cfde[_0x1e095c(0xf7)]!==undefined)_0x10b0ab[_0x1e095c(0xb2)](_0x34cfde[_0x1e095c(0xf7)]+'\x20total');if(_0x34cfde['new']!==undefined&&_0x34cfde[_0x1e095c(0x10d)]>0x0)_0x10b0ab[_0x1e095c(0xb2)](a4_0x551269['green'](_0x34cfde['new']+_0x1e095c(0x136)));if(_0x34cfde[_0x1e095c(0xdc)]!==undefined&&_0x34cfde[_0x1e095c(0xdc)]>0x0)_0x10b0ab['push'](a4_0x551269[_0x1e095c(0x12b)](_0x34cfde[_0x1e095c(0xdc)]+_0x1e095c(0x111)));if(_0x34cfde['updated']!==undefined&&_0x34cfde[_0x1e095c(0xb6)]>0x0)_0x10b0ab[_0x1e095c(0xb2)](a4_0x551269[_0x1e095c(0x104)](_0x34cfde['updated']+'\x20updated'));if(_0x34cfde['unchanged']!==undefined&&_0x34cfde[_0x1e095c(0x159)]>0x0)_0x10b0ab['push'](a4_0x551269[_0x1e095c(0xcb)](_0x34cfde[_0x1e095c(0x159)]+_0x1e095c(0xd9)));if(_0x34cfde[_0x1e095c(0x112)]!==undefined&&_0x34cfde[_0x1e095c(0x112)]>0x0)_0x10b0ab[_0x1e095c(0xb2)](a4_0x551269[_0x1e095c(0x124)](_0x34cfde['errors']+_0x1e095c(0x142)));return _0x10b0ab[_0x1e095c(0x103)](',\x20');}function displayDiffs(_0x3556db,_0x168a0f,_0x3a190c,_0x579199,_0x283df0,_0x131492,_0x586845,_0x330fde,_0x23f09c){const _0x3a460d=a4_0x1cf8;for(const _0x673572 of _0x3556db){if(_0x673572[_0x3a460d(0xe1)]){const _0x3cf1f2=_0x673572['agentName']||_0x673572[_0x3a460d(0x138)];console[_0x3a460d(0x105)](_0x3a460d(0xd2)+_0x3cf1f2+'\x27:'),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)),console[_0x3a460d(0x105)](_0x673572['diff']),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c));}}for(const _0x1d8836 of _0x168a0f){_0x1d8836[_0x3a460d(0xe1)]&&(console[_0x3a460d(0x105)](_0x3a460d(0x11d)+_0x1d8836[_0x3a460d(0x138)]+'\x27:'),console['log']('─'[_0x3a460d(0x128)](0x3c)),console['log'](_0x1d8836['diff']),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)));}for(const _0x5ebefe of _0x3a190c){_0x5ebefe[_0x3a460d(0xe1)]&&(console[_0x3a460d(0x105)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x5ebefe[_0x3a460d(0x138)]+'\x27:'),console['log']('─'[_0x3a460d(0x128)](0x3c)),console[_0x3a460d(0x105)](_0x5ebefe['diff']),console[_0x3a460d(0x105)]('─'['repeat'](0x3c)));}for(const _0x54dfa6 of _0x579199){_0x54dfa6[_0x3a460d(0xe1)]&&(console[_0x3a460d(0x105)](_0x3a460d(0xb3)+_0x54dfa6[_0x3a460d(0x138)]+'\x27:'),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)),console[_0x3a460d(0x105)](_0x54dfa6[_0x3a460d(0xe1)]),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)));}for(const _0x501fc1 of _0x283df0){_0x501fc1['diff']&&(console[_0x3a460d(0x105)](_0x3a460d(0x125)+_0x501fc1[_0x3a460d(0x138)]+'\x27:'),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)),console[_0x3a460d(0x105)](_0x501fc1[_0x3a460d(0xe1)]),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)));}for(const _0x843364 of _0x131492){_0x843364['diff']&&(console[_0x3a460d(0x105)](_0x3a460d(0x157)+_0x843364[_0x3a460d(0x138)]+'\x27:'),console[_0x3a460d(0x105)]('─'['repeat'](0x3c)),console[_0x3a460d(0x105)](_0x843364['diff']),console['log']('─'[_0x3a460d(0x128)](0x3c)));}for(const _0x42ac73 of _0x586845){_0x42ac73[_0x3a460d(0xe1)]&&(console[_0x3a460d(0x105)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x42ac73[_0x3a460d(0x138)]+'\x27:'),console['log']('─'[_0x3a460d(0x128)](0x3c)),console[_0x3a460d(0x105)](_0x42ac73['diff']),console['log']('─'[_0x3a460d(0x128)](0x3c)));}for(const _0x154890 of _0x330fde){_0x154890[_0x3a460d(0xe1)]&&(console['log'](_0x3a460d(0x15a)+_0x154890['name']+'\x27:'),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)),console[_0x3a460d(0x105)](_0x154890[_0x3a460d(0xe1)]),console['log']('─'['repeat'](0x3c)));}for(const _0xccdda9 of _0x23f09c){_0xccdda9[_0x3a460d(0xe1)]&&(console[_0x3a460d(0x105)](_0x3a460d(0x109)+_0xccdda9['name']+'\x27:'),console[_0x3a460d(0x105)]('─'['repeat'](0x3c)),console[_0x3a460d(0x105)](_0xccdda9['diff']),console[_0x3a460d(0x105)]('─'[_0x3a460d(0x128)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x4c384c(0x106);['description']=a4_0x4c384c(0x153);async[a4_0x4c384c(0xdf)](_0x239587){const _0x363adb=a4_0x4c384c,{options:_0x39efc4,args:_0x25d0ba,tdx:_0x4c1981}=_0x239587,_0x373e3f=_0x25d0ba[0x0],_0x36ced1=_0x25d0ba[0x1],_0x2ac7ee=_0x39efc4['output'],_0x4fe65a=_0x39efc4[_0x363adb(0xf5)],_0x5efb47=_0x39efc4[_0x363adb(0x10a)],_0x1cb6e8=_0x39efc4[_0x363adb(0x13e)],_0x2729bc=_0x39efc4[_0x363adb(0x127)],_0x354891=_0x39efc4['agent'];let _0x3435fb;if(_0x373e3f){const _0x316467=a4_0x4decad[_0x363adb(0x103)](_0x373e3f,_0x363adb(0x160));if(existsSync(_0x316467))try{const _0x229c37=JSON[_0x363adb(0x148)](readFileSync(_0x316467,'utf-8'));_0x229c37[_0x363adb(0x12a)]&&(_0x3435fb={'llm_project':_0x229c37[_0x363adb(0x12a)]});}catch{}}const _0x32f24e=findAgentConfigPath(process['cwd']());let _0x753818;if(_0x32f24e)try{const _0x469d26=JSON['parse'](readFileSync(_0x32f24e,_0x363adb(0xf3)));_0x469d26[_0x363adb(0x12a)]&&(_0x753818={'llm_project':_0x469d26[_0x363adb(0x12a)]});}catch{}const _0x5d83a8=resolveAgentPullArgs({'arg':_0x373e3f,'agentNameArg':_0x36ced1,'agentFlag':_0x354891,'contextProject':_0x2729bc,'argDirConfig':_0x3435fb,'cwdConfigPath':_0x32f24e||undefined,'cwdConfig':_0x753818}),{projectNameOrId:_0x3dff8e,targetAgentName:_0x191af0,existingOutputDir:_0x585022,source:_0x537df6}=_0x5d83a8;if(_0x537df6==='arg-dir')console['log'](a4_0x551269['dim'](_0x363adb(0xdb)+a4_0x4decad['join'](_0x373e3f,_0x363adb(0x160))+':\x20'+_0x3dff8e));else{if(_0x537df6==='cwd-config')console['log'](a4_0x551269[_0x363adb(0xe8)]('Using\x20project:\x20'+_0x3dff8e));else _0x537df6===_0x363adb(0xc3)&&console[_0x363adb(0x105)](a4_0x551269['dim'](_0x363adb(0x13b)+_0x3dff8e));}if(!_0x3dff8e)return _0x354891?(console[_0x363adb(0x105)](a4_0x551269[_0x363adb(0x104)](_0x363adb(0xf6))),console[_0x363adb(0x105)](_0x363adb(0xe7)),console[_0x363adb(0x105)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x363adb(0x105)](a4_0x551269[_0x363adb(0x104)](_0x363adb(0x120))),console['log']('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[_0x363adb(0x105)](_0x363adb(0xff)),console[_0x363adb(0x105)](_0x363adb(0xda)),console[_0x363adb(0x105)](_0x363adb(0xf2)),console[_0x363adb(0x105)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x191af0){const {data:_0x1e2303}=await withSpinner('Pulling\x20agent\x20\x22'+_0x191af0+_0x363adb(0x131)+_0x3dff8e+_0x363adb(0x130),()=>_0x4c1981[_0x363adb(0x13a)][_0x363adb(0xbb)](_0x3dff8e,_0x191af0,_0x2ac7ee,{'dryRun':_0x4fe65a,'force':_0x5efb47}));if(_0x4fe65a)return console[_0x363adb(0x105)](a4_0x551269[_0x363adb(0x104)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x363adb(0x105)](_0x363adb(0xcf)+_0x1e2303[_0x363adb(0x158)]),console[_0x363adb(0x105)](_0x363adb(0x14b)+_0x1e2303['outputPath']),_0x1e2303['diff']&&(console[_0x363adb(0x105)](_0x363adb(0x133)),console[_0x363adb(0x105)]('─'[_0x363adb(0x128)](0x3c)),console['log'](_0x1e2303['diff']),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x363adb(0x105)](a4_0x551269[_0x363adb(0x12b)](_0x363adb(0x15d))),console[_0x363adb(0x105)](_0x363adb(0x162)+_0x1e2303[_0x363adb(0x158)]),console[_0x363adb(0x105)](_0x363adb(0x168)+_0x1e2303[_0x363adb(0xec)]),console[_0x363adb(0x105)](_0x363adb(0x169)+(_0x1e2303['isNew']?a4_0x551269['green'](_0x363adb(0x10d)):_0x1e2303[_0x363adb(0xf0)]?a4_0x551269['yellow'](_0x363adb(0xb6)):a4_0x551269[_0x363adb(0xcb)]('unchanged'))),0x0;}const _0x114799=_0x585022||_0x2ac7ee,{data:_0x2e12f2}=await withSpinner(_0x363adb(0x11a)+_0x3dff8e+_0x363adb(0x130),()=>_0x4c1981['llm'][_0x363adb(0xbd)](_0x3dff8e,_0x114799,{'dryRun':!![]})),_0x583525=_0x2e12f2['counts']['agents'][_0x363adb(0x10d)]+_0x2e12f2['counts']['knowledgeBases'][_0x363adb(0x10d)]+_0x2e12f2[_0x363adb(0x161)]['textKnowledgeBases'][_0x363adb(0x10d)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x110)][_0x363adb(0x10d)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x12c)]['new']+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xd5)][_0x363adb(0x10d)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xc9)]['new']+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xd1)]['new']+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x132)][_0x363adb(0x10d)],_0x34e96c=_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x16a)][_0x363adb(0xb6)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x167)][_0x363adb(0xb6)]+_0x2e12f2[_0x363adb(0x161)]['textKnowledgeBases'][_0x363adb(0xb6)]+_0x2e12f2['counts']['prompts'][_0x363adb(0xb6)]+_0x2e12f2['counts']['integrations'][_0x363adb(0xb6)]+_0x2e12f2['counts'][_0x363adb(0xd5)][_0x363adb(0xb6)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xc9)]['updated']+_0x2e12f2[_0x363adb(0x161)]['formInterfaces'][_0x363adb(0xb6)]+_0x2e12f2['counts'][_0x363adb(0x132)][_0x363adb(0xb6)],_0x109173=_0x2e12f2[_0x363adb(0x161)]['agents']['unchanged']+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x167)][_0x363adb(0x159)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x117)][_0x363adb(0x159)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x110)][_0x363adb(0x159)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x12c)][_0x363adb(0x159)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xd5)][_0x363adb(0x159)]+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xc9)][_0x363adb(0x159)]+_0x2e12f2['counts'][_0x363adb(0xd1)]['unchanged']+_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x132)]['unchanged'];console[_0x363adb(0x105)](_0x363adb(0xbe)+_0x2e12f2['projectName']+'\x27:'),console[_0x363adb(0x105)]('\x20\x20'+a4_0x551269[_0x363adb(0x12b)]('+\x20'+_0x583525+_0x363adb(0x136))+'\x20|\x20'+a4_0x551269['yellow']('~\x20'+_0x34e96c+_0x363adb(0x135))+_0x363adb(0x137)+a4_0x551269[_0x363adb(0xe8)]('=\x20'+_0x109173+_0x363adb(0xd9))),console[_0x363adb(0x105)](_0x363adb(0xe2)+formatCountSummary(_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x16a)])),console[_0x363adb(0x105)](_0x363adb(0xe5)+formatCountSummary(_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x167)])),console['log'](_0x363adb(0x13c)+formatCountSummary(_0x2e12f2['counts'][_0x363adb(0x117)])),console[_0x363adb(0x105)](_0x363adb(0xb8)+formatCountSummary(_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x110)])),console[_0x363adb(0x105)](_0x363adb(0xc1)+formatCountSummary(_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x12c)])),console[_0x363adb(0x105)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xd1)])),console[_0x363adb(0x105)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x2e12f2[_0x363adb(0x161)][_0x363adb(0x132)]));const _0x3f2301=_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xd5)]['total']>0x0||_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xc9)][_0x363adb(0xf7)]>0x0;_0x3f2301&&(console[_0x363adb(0x105)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2e12f2[_0x363adb(0x161)][_0x363adb(0xd5)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2e12f2['counts'][_0x363adb(0xc9)])));console[_0x363adb(0x105)]('\x20\x20Target:\x20'+a4_0x551269[_0x363adb(0x14d)](_0x2e12f2[_0x363adb(0x13d)])),displayDiffs(_0x2e12f2[_0x363adb(0x16a)],_0x2e12f2[_0x363adb(0x167)],_0x2e12f2['textKnowledgeBases'],_0x2e12f2['prompts'],_0x2e12f2[_0x363adb(0x12c)],_0x2e12f2[_0x363adb(0xd5)],_0x2e12f2[_0x363adb(0xc9)],_0x2e12f2[_0x363adb(0xd1)],_0x2e12f2[_0x363adb(0x132)]);if(_0x4fe65a)return console[_0x363adb(0x105)](a4_0x551269[_0x363adb(0x104)](_0x363adb(0x146))),0x0;if(_0x583525===0x0&&_0x34e96c===0x0)return console[_0x363adb(0x105)](a4_0x551269['green'](_0x363adb(0x107))),saveSessionContext({'llm_project':_0x2e12f2[_0x363adb(0x15e)]},_0x39efc4[_0x363adb(0x166)]),console[_0x363adb(0x105)](a4_0x551269['green'](_0x363adb(0xea)+a4_0x551269[_0x363adb(0xe8)](_0x363adb(0x12a))+_0x363adb(0x115)+a4_0x551269['cyan'](_0x2e12f2[_0x363adb(0x15e)]))),0x0;if(!_0x1cb6e8&&!_0x5efb47){if(!isInteractive())return console['error'](a4_0x551269['red']('\x0aError:'),_0x363adb(0x14c)),console[_0x363adb(0x126)](a4_0x551269[_0x363adb(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x29bc1a=await confirmKey('\x0aWrite\x20'+(_0x583525+_0x34e96c)+'\x20files?');if(!_0x29bc1a)return console[_0x363adb(0x105)](a4_0x551269['yellow']('Cancelled'),_0x363adb(0x10f)),0x1;}const {data:_0x2529ef}=await withSpinner('Writing\x20files...',()=>_0x4c1981['llm'][_0x363adb(0xbd)](_0x3dff8e,_0x114799,{'force':_0x5efb47}));return console[_0x363adb(0x105)](a4_0x551269[_0x363adb(0x12b)](_0x363adb(0x11c)+(_0x583525+_0x34e96c)+_0x363adb(0x10e)+_0x2529ef[_0x363adb(0x13d)])),saveSessionContext({'llm_project':_0x2529ef[_0x363adb(0x15e)]},_0x39efc4[_0x363adb(0x166)]),console[_0x363adb(0x105)](a4_0x551269['green'](_0x363adb(0xea)+a4_0x551269['dim']('llm_project')+_0x363adb(0x115)+a4_0x551269[_0x363adb(0x14d)](_0x2529ef[_0x363adb(0x15e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4c384c(0x138)]='agent:clone';[a4_0x4c384c(0xe9)]=a4_0x4c384c(0x15f);async['execute'](_0x57fce2){const _0x401a71=a4_0x4c384c,{options:_0x7724d6,args:_0x3345ce,tdx:_0x377b39}=_0x57fce2,_0x400347=_0x3345ce[0x0],_0x1580dd=_0x7724d6[_0x401a71(0x138)],_0xbc1515=_0x7724d6[_0x401a71(0xf5)],_0x104293=_0x7724d6[_0x401a71(0x13e)],_0x2e0a96=_0x7724d6[_0x401a71(0x101)],_0x39f208=_0x7724d6[_0x401a71(0x127)];let _0x2b2edc;const _0x40a016=findAgentConfigPath(process[_0x401a71(0x119)]());if(_0x400347){const _0x2f732f=a4_0x4decad['join'](_0x400347,_0x401a71(0x160));existsSync(_0x2f732f)?(_0x2b2edc=_0x400347,console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0xe8)](_0x401a71(0xed)+_0x400347))):_0x2b2edc=_0x400347;}else{if(_0x40a016)_0x2b2edc=a4_0x4decad[_0x401a71(0xe3)](_0x40a016),console[_0x401a71(0x105)](a4_0x551269['dim'](_0x401a71(0xb4)+_0x2b2edc));else{if(_0x39f208){const _0x1dd532=sanitizeForFilesystem(_0x39f208);let _0x3e5414=_0x1dd532,_0x230540=a4_0x4decad[_0x401a71(0x103)](process[_0x401a71(0x119)](),_0x401a71(0x16a),_0x1dd532,_0x401a71(0x160));if(!existsSync(_0x230540)){const _0x4e4799=normalizeName(_0x39f208),_0x2da1c0=a4_0x4decad[_0x401a71(0x103)](process['cwd'](),'agents',_0x4e4799,'tdx.json');existsSync(_0x2da1c0)&&(_0x3e5414=_0x4e4799,_0x230540=_0x2da1c0);}if(existsSync(_0x230540))_0x2b2edc=a4_0x4decad[_0x401a71(0xe3)](_0x230540),console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0xe8)]('Using\x20local\x20project:\x20'+_0x2b2edc));else{const _0x2966=_0x7724d6[_0x401a71(0xc5)];if(_0x2966)throw new SDKError(ErrorCode[_0x401a71(0xf8)],_0x401a71(0xfa)+_0x39f208+_0x401a71(0x14a),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x401a71(0x154)+_0x39f208+'\x0a')+(_0x401a71(0xc0)+_0x3e5414+_0x401a71(0x121)+(_0x1580dd||_0x401a71(0xfe))+'\x20--profile\x20'+_0x2966)});_0x2b2edc=_0x39f208,console[_0x401a71(0x105)](a4_0x551269['dim'](_0x401a71(0xce)+_0x39f208));}}}}if(!_0x2b2edc)return console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0x104)](_0x401a71(0x134))),console['log'](_0x401a71(0x12d)),console[_0x401a71(0x105)](_0x401a71(0xcd)),console['log'](_0x401a71(0xf9)),console[_0x401a71(0x105)](_0x401a71(0x11f)),0x1;if(!_0x1580dd)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x401a71(0xc2)});if(!_0x104293&&!_0xbc1515){if(!isInteractive())return console[_0x401a71(0x126)](a4_0x551269[_0x401a71(0x124)]('\x0aError:'),_0x401a71(0x14c)),console[_0x401a71(0x126)](a4_0x551269[_0x401a71(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x404966=await confirmKey(_0x401a71(0x152)+_0x2b2edc+_0x401a71(0x129)+_0x1580dd+'\x22?');if(!_0x404966)return console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0x104)](_0x401a71(0x118))),0x1;}const {data:_0x638c09}=await withSpinner(_0x401a71(0x102)+_0x2b2edc+'\x22\x20to\x20\x22'+_0x1580dd+'\x22...',()=>_0x377b39[_0x401a71(0x13a)]['cloneProject'](_0x2b2edc,_0x1580dd,{'dryRun':_0xbc1515}));if(_0xbc1515){console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0x104)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x401a71(0x105)]('Source:\x20'+_0x638c09[_0x401a71(0xc6)]),console[_0x401a71(0x105)](_0x401a71(0x165)+_0x1580dd),console['log'](_0x401a71(0xc4)),console[_0x401a71(0x105)](_0x401a71(0xe2)+_0x638c09[_0x401a71(0x161)][_0x401a71(0x16a)]['created']),console[_0x401a71(0x105)]('\x20\x20Knowledge\x20Bases:\x20'+_0x638c09['counts']['knowledgeBases'][_0x401a71(0xdc)]),console[_0x401a71(0x105)]('\x20\x20Prompts:\x20'+_0x638c09[_0x401a71(0x161)][_0x401a71(0x110)][_0x401a71(0xdc)]),console['log'](_0x401a71(0xf4)+_0x638c09[_0x401a71(0x161)][_0x401a71(0xd1)][_0x401a71(0xdc)]),console[_0x401a71(0x105)](_0x401a71(0x155)+_0x638c09['counts'][_0x401a71(0x132)][_0x401a71(0xdc)]);const _0x247698=_0x638c09[_0x401a71(0x161)][_0x401a71(0xd5)][_0x401a71(0xdc)]>0x0||_0x638c09[_0x401a71(0x161)][_0x401a71(0xc9)][_0x401a71(0xdc)]>0x0;return _0x247698&&(console[_0x401a71(0x105)](_0x401a71(0xb1)+_0x638c09[_0x401a71(0x161)][_0x401a71(0xd5)][_0x401a71(0xdc)]),console[_0x401a71(0x105)](_0x401a71(0x163)+_0x638c09[_0x401a71(0x161)]['experimentalArtifacts'][_0x401a71(0xdc)])),0x0;}const _0x4b7cac=_0x638c09[_0x401a71(0x161)][_0x401a71(0x16a)]['errors']>0x0||_0x638c09[_0x401a71(0x161)][_0x401a71(0x167)]['errors']>0x0||_0x638c09[_0x401a71(0x161)][_0x401a71(0x110)][_0x401a71(0x112)]>0x0||_0x638c09['counts'][_0x401a71(0xd1)][_0x401a71(0x112)]>0x0||_0x638c09[_0x401a71(0x161)]['chatInterfaces'][_0x401a71(0x112)]>0x0||_0x638c09['counts'][_0x401a71(0xd5)][_0x401a71(0x112)]>0x0||_0x638c09['counts'][_0x401a71(0xc9)][_0x401a71(0x112)]>0x0;_0x4b7cac?console[_0x401a71(0x105)](a4_0x551269['yellow'](_0x401a71(0xeb))):console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0x12b)](_0x401a71(0x149)));console['log'](_0x401a71(0xb0)+_0x638c09[_0x401a71(0xc6)]),console[_0x401a71(0x105)](_0x401a71(0x165)+_0x638c09[_0x401a71(0x12e)]),console[_0x401a71(0x105)](_0x401a71(0x139)+_0x638c09['newProjectId']),console[_0x401a71(0x105)](),console['log'](_0x401a71(0xdd)),console[_0x401a71(0x105)](_0x401a71(0xe2)+formatCountSummary(_0x638c09[_0x401a71(0x161)][_0x401a71(0x16a)])),console[_0x401a71(0x105)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x638c09['counts'][_0x401a71(0x167)])),console[_0x401a71(0x105)](_0x401a71(0xb8)+formatCountSummary(_0x638c09[_0x401a71(0x161)][_0x401a71(0x110)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x638c09[_0x401a71(0x161)][_0x401a71(0x12c)])),console[_0x401a71(0x105)](_0x401a71(0xf4)+formatCountSummary(_0x638c09['counts'][_0x401a71(0xd1)])),console['log'](_0x401a71(0x155)+formatCountSummary(_0x638c09[_0x401a71(0x161)][_0x401a71(0x132)]));const _0x2a2c6c=_0x638c09[_0x401a71(0x161)][_0x401a71(0xd5)][_0x401a71(0xdc)]>0x0||_0x638c09[_0x401a71(0x161)]['experimentalKnowledgeBases'][_0x401a71(0xb6)]>0x0||_0x638c09[_0x401a71(0x161)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x638c09[_0x401a71(0x161)][_0x401a71(0xc9)]['created']>0x0||_0x638c09[_0x401a71(0x161)][_0x401a71(0xc9)][_0x401a71(0xb6)]>0x0||_0x638c09[_0x401a71(0x161)][_0x401a71(0xc9)][_0x401a71(0x159)]>0x0;_0x2a2c6c&&(console[_0x401a71(0x105)](_0x401a71(0xb1)+formatCountSummary(_0x638c09[_0x401a71(0x161)][_0x401a71(0xd5)])),console['log'](_0x401a71(0x163)+formatCountSummary(_0x638c09[_0x401a71(0x161)][_0x401a71(0xc9)])));if(_0x4b7cac){console['log'](),console[_0x401a71(0x105)](a4_0x551269['red'](_0x401a71(0xb9)));for(const _0x23d69f of _0x638c09['agents']){_0x23d69f[_0x401a71(0x140)]==='error'&&console['log'](a4_0x551269['red'](_0x401a71(0xd7)+_0x23d69f[_0x401a71(0x158)]+_0x401a71(0x14e)+_0x23d69f['error']));}for(const _0x2385bc of _0x638c09[_0x401a71(0x167)]){_0x2385bc[_0x401a71(0x140)]===_0x401a71(0x126)&&console[_0x401a71(0x105)](a4_0x551269['red'](_0x401a71(0x13f)+_0x2385bc['name']+_0x401a71(0x14e)+_0x2385bc[_0x401a71(0x126)]));}for(const _0x1c7fc7 of _0x638c09[_0x401a71(0x110)]){_0x1c7fc7[_0x401a71(0x140)]==='error'&&console[_0x401a71(0x105)](a4_0x551269['red']('\x20\x20Prompt\x20\x22'+_0x1c7fc7['name']+_0x401a71(0x14e)+_0x1c7fc7[_0x401a71(0x126)]));}for(const _0xece885 of _0x638c09[_0x401a71(0x12c)]){_0xece885['action']===_0x401a71(0x126)&&console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0x124)](_0x401a71(0x11e)+_0xece885[_0x401a71(0x138)]+'\x22:\x20'+_0xece885['error']));}for(const _0x25d544 of _0x638c09[_0x401a71(0xd1)]){_0x25d544[_0x401a71(0x140)]===_0x401a71(0x126)&&console['log'](a4_0x551269[_0x401a71(0x124)](_0x401a71(0x150)+_0x25d544['name']+'\x22:\x20'+_0x25d544['error']));}for(const _0x134851 of _0x638c09['chatInterfaces']){_0x134851[_0x401a71(0x140)]===_0x401a71(0x126)&&console[_0x401a71(0x105)](a4_0x551269[_0x401a71(0x124)](_0x401a71(0xca)+_0x134851['name']+_0x401a71(0x14e)+_0x134851[_0x401a71(0x126)]));}for(const _0x2c1423 of _0x638c09['experimentalKnowledgeBases']){_0x2c1423[_0x401a71(0x140)]===_0x401a71(0x126)&&console[_0x401a71(0x105)](a4_0x551269['red'](_0x401a71(0xd8)+_0x2c1423[_0x401a71(0x138)]+_0x401a71(0x14e)+_0x2c1423[_0x401a71(0x126)]));}for(const _0x2b809b of _0x638c09['experimentalArtifacts']){_0x2b809b[_0x401a71(0x140)]===_0x401a71(0x126)&&console[_0x401a71(0x105)](a4_0x551269['red'](_0x401a71(0x151)+_0x2b809b[_0x401a71(0x138)]+'\x22:\x20'+_0x2b809b[_0x401a71(0x126)]));}return 0x1;}console[_0x401a71(0x105)]();const _0x3f6afe=getLLMProjectUrl(_0x2e0a96,_0x638c09['newProjectId']);return console[_0x401a71(0x105)](_0x401a71(0xc7)+a4_0x551269['cyan'](_0x3f6afe)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x4c384c(0xde);[a4_0x4c384c(0xe9)]=a4_0x4c384c(0xef);async[a4_0x4c384c(0xdf)](_0x10098d){const _0x54d767=a4_0x4c384c,{options:_0x389fb0,args:_0x1d3d7b,tdx:_0x52e9cc}=_0x10098d;let _0x28f5a4=_0x1d3d7b[0x0]||process[_0x54d767(0x119)]();const _0x27d7ed=_0x389fb0[_0x54d767(0xf5)],_0x2f6abd=_0x389fb0[_0x54d767(0x10a)],_0x4019b4=_0x389fb0['yes'],_0x49d54c=_0x389fb0[_0x54d767(0x101)],_0x3d94ee=a4_0x4decad['join'](_0x28f5a4,_0x54d767(0x123)),_0x18b443=existsSync(_0x3d94ee);if(_0x18b443){const {data:_0x18e63f}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x28f5a4+_0x54d767(0x130),()=>_0x52e9cc[_0x54d767(0x13a)][_0x54d767(0x143)](_0x28f5a4,{'dryRun':_0x27d7ed,'force':_0x2f6abd}));if(_0x27d7ed)return console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x104)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x54d767(0x105)](_0x54d767(0x11b)+_0x18e63f[_0x54d767(0x158)]),0x0;if(_0x18e63f[_0x54d767(0x140)]===_0x54d767(0x126))return console[_0x54d767(0x105)](a4_0x551269['red'](_0x54d767(0xe4)+_0x18e63f['error'])),0x1;console['log'](a4_0x551269[_0x54d767(0x12b)]('Agent\x20'+_0x18e63f[_0x54d767(0x140)]+'\x20successfully')),console[_0x54d767(0x105)](_0x54d767(0x162)+_0x18e63f['agentName']);if(_0x18e63f[_0x54d767(0xe6)]&&_0x18e63f['projectId']){const _0x1b9093=getLLMAgentChatUrl(_0x49d54c,_0x18e63f['projectId'],_0x18e63f[_0x54d767(0xe6)]);console[_0x54d767(0x105)]('Chat:\x20'+a4_0x551269['cyan'](_0x1b9093));}return 0x0;}const _0x4d82cf=_0x389fb0[_0x54d767(0x127)],_0x3080aa=resolveProjectFromContext(_0x28f5a4,_0x4d82cf);if(_0x3080aa['found'])_0x28f5a4=_0x3080aa[_0x54d767(0x10c)],_0x3080aa[_0x54d767(0xd0)]===_0x54d767(0xc3)&&console[_0x54d767(0x105)](a4_0x551269['dim']('Using\x20project:\x20'+_0x28f5a4));else{let _0x299c75='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x3080aa[_0x54d767(0x113)]===_0x54d767(0x100)&&(_0x299c75=_0x3080aa[_0x54d767(0xbf)]+_0x54d767(0xfd)+_0x3080aa[_0x54d767(0x127)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x54d767(0xf8)],_0x3080aa[_0x54d767(0x113)]==='no_context'?_0x3080aa[_0x54d767(0xbf)]:_0x54d767(0x147)+_0x28f5a4,undefined,{'helpText':_0x299c75});}const {data:_0x12cd62}=await withSpinner(_0x54d767(0xf1),()=>_0x52e9cc[_0x54d767(0x13a)][_0x54d767(0x15c)](_0x28f5a4,{'dryRun':!![]})),_0x1cf0be=_0x12cd62[_0x54d767(0x161)][_0x54d767(0x16a)][_0x54d767(0x112)]>0x0;if(_0x1cf0be){console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x124)](_0x54d767(0xcc)));for(const _0x6a746d of _0x12cd62['agents']){_0x6a746d['action']===_0x54d767(0x126)&&console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x124)](_0x54d767(0xd7)+_0x6a746d['agentName']+_0x54d767(0x14e)+_0x6a746d[_0x54d767(0x126)]));}return 0x1;}const _0x42045b=_0x12cd62[_0x54d767(0x161)][_0x54d767(0x16a)]['created']+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x167)][_0x54d767(0xdc)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x117)][_0x54d767(0xdc)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x110)][_0x54d767(0xdc)]+_0x12cd62['counts'][_0x54d767(0x12c)]['created']+_0x12cd62[_0x54d767(0x161)]['experimentalKnowledgeBases'][_0x54d767(0xdc)]+_0x12cd62['counts'][_0x54d767(0xc9)][_0x54d767(0xdc)]+_0x12cd62[_0x54d767(0x161)]['formInterfaces'][_0x54d767(0xdc)]+_0x12cd62[_0x54d767(0x161)]['chatInterfaces'][_0x54d767(0xdc)],_0x380990=_0x12cd62[_0x54d767(0x161)][_0x54d767(0x16a)]['updated']+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x167)][_0x54d767(0xb6)]+_0x12cd62['counts'][_0x54d767(0x117)][_0x54d767(0xb6)]+_0x12cd62['counts'][_0x54d767(0x110)]['updated']+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x12c)][_0x54d767(0xb6)]+_0x12cd62[_0x54d767(0x161)]['experimentalKnowledgeBases'][_0x54d767(0xb6)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0xc9)][_0x54d767(0xb6)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0xd1)][_0x54d767(0xb6)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x132)]['updated'],_0x364fa2=_0x12cd62[_0x54d767(0x161)][_0x54d767(0x16a)][_0x54d767(0x159)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x167)][_0x54d767(0x159)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x117)][_0x54d767(0x159)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0x110)][_0x54d767(0x159)]+_0x12cd62[_0x54d767(0x161)]['integrations'][_0x54d767(0x159)]+_0x12cd62['counts']['experimentalKnowledgeBases']['unchanged']+_0x12cd62[_0x54d767(0x161)]['experimentalArtifacts'][_0x54d767(0x159)]+_0x12cd62[_0x54d767(0x161)][_0x54d767(0xd1)]['unchanged']+_0x12cd62['counts'][_0x54d767(0x132)][_0x54d767(0x159)];console[_0x54d767(0x105)](_0x54d767(0xee)+_0x12cd62[_0x54d767(0x15e)]+'\x27:'),console[_0x54d767(0x105)]('\x20\x20'+a4_0x551269[_0x54d767(0x12b)]('+\x20'+_0x42045b+_0x54d767(0x136))+_0x54d767(0x137)+a4_0x551269[_0x54d767(0x104)]('~\x20'+_0x380990+_0x54d767(0x135))+_0x54d767(0x137)+a4_0x551269[_0x54d767(0xe8)]('=\x20'+_0x364fa2+_0x54d767(0xd9))),console[_0x54d767(0x105)]('\x20\x20Agents:\x20'+formatCountSummary(_0x12cd62[_0x54d767(0x161)]['agents'])),console[_0x54d767(0x105)](_0x54d767(0xe5)+formatCountSummary(_0x12cd62['counts'][_0x54d767(0x167)])),console['log'](_0x54d767(0x13c)+formatCountSummary(_0x12cd62['counts'][_0x54d767(0x117)])),console[_0x54d767(0x105)](_0x54d767(0xb8)+formatCountSummary(_0x12cd62[_0x54d767(0x161)][_0x54d767(0x110)])),console['log'](_0x54d767(0xc1)+formatCountSummary(_0x12cd62[_0x54d767(0x161)][_0x54d767(0x12c)])),console[_0x54d767(0x105)](_0x54d767(0xf4)+formatCountSummary(_0x12cd62[_0x54d767(0x161)][_0x54d767(0xd1)])),console[_0x54d767(0x105)](_0x54d767(0x155)+formatCountSummary(_0x12cd62[_0x54d767(0x161)][_0x54d767(0x132)]));const _0x35c153=_0x12cd62['counts'][_0x54d767(0xd5)][_0x54d767(0xdc)]>0x0||_0x12cd62[_0x54d767(0x161)][_0x54d767(0xd5)][_0x54d767(0xb6)]>0x0||_0x12cd62['counts'][_0x54d767(0xd5)]['unchanged']>0x0||_0x12cd62['counts'][_0x54d767(0xc9)][_0x54d767(0xdc)]>0x0||_0x12cd62[_0x54d767(0x161)]['experimentalArtifacts'][_0x54d767(0xb6)]>0x0||_0x12cd62[_0x54d767(0x161)][_0x54d767(0xc9)][_0x54d767(0x159)]>0x0;_0x35c153&&(console[_0x54d767(0x105)](_0x54d767(0xb1)+formatCountSummary(_0x12cd62[_0x54d767(0x161)][_0x54d767(0xd5)])),console['log'](_0x54d767(0x163)+formatCountSummary(_0x12cd62[_0x54d767(0x161)][_0x54d767(0xc9)])));console[_0x54d767(0x105)]('\x20\x20Source:\x20'+a4_0x551269[_0x54d767(0x14d)](_0x28f5a4)),displayDiffs(_0x12cd62[_0x54d767(0x16a)],_0x12cd62[_0x54d767(0x167)],_0x12cd62[_0x54d767(0x117)],_0x12cd62['prompts'],_0x12cd62[_0x54d767(0x12c)],_0x12cd62[_0x54d767(0xd5)],_0x12cd62[_0x54d767(0xc9)],_0x12cd62[_0x54d767(0xd1)],_0x12cd62['chatInterfaces']);if(_0x27d7ed)return console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x104)](_0x54d767(0x114))),0x0;if(_0x42045b===0x0&&_0x380990===0x0){console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x12b)](_0x54d767(0x145)));const _0x3cb0b4=getLLMProjectUrl(_0x49d54c,_0x12cd62[_0x54d767(0x12f)]);return console[_0x54d767(0x105)](_0x54d767(0xc7)+a4_0x551269[_0x54d767(0x14d)](_0x3cb0b4)),0x0;}if(!_0x4019b4&&!_0x2f6abd){if(!isInteractive())return console['error'](a4_0x551269[_0x54d767(0x124)](_0x54d767(0x10b)),_0x54d767(0x14c)),console[_0x54d767(0x126)](a4_0x551269[_0x54d767(0xe8)](_0x54d767(0xc8))),0x1;const _0x2e051b=await confirmKey(_0x54d767(0x141)+(_0x42045b+_0x380990)+'\x20resources?');if(!_0x2e051b)return console['log'](a4_0x551269['yellow'](_0x54d767(0x118)),_0x54d767(0x15b)),0x1;}const {data:_0x33f2ee}=await withSpinner(_0x54d767(0x116),()=>_0x52e9cc['llm']['pushProject'](_0x28f5a4,{'force':_0x2f6abd})),_0x32f342=_0x33f2ee[_0x54d767(0x161)][_0x54d767(0x16a)][_0x54d767(0x112)]>0x0||_0x33f2ee[_0x54d767(0x161)][_0x54d767(0x167)][_0x54d767(0x112)]>0x0||_0x33f2ee[_0x54d767(0x161)][_0x54d767(0x117)][_0x54d767(0x112)]>0x0||_0x33f2ee['counts'][_0x54d767(0x110)][_0x54d767(0x112)]>0x0||_0x33f2ee[_0x54d767(0x161)][_0x54d767(0xd1)][_0x54d767(0x112)]>0x0||_0x33f2ee[_0x54d767(0x161)]['chatInterfaces']['errors']>0x0;if(_0x32f342){console['log'](a4_0x551269['yellow'](_0x54d767(0x144))),console[_0x54d767(0x105)](),console['log'](a4_0x551269['red'](_0x54d767(0xb9)));for(const _0x3f5596 of _0x33f2ee[_0x54d767(0x16a)]){_0x3f5596[_0x54d767(0x140)]===_0x54d767(0x126)&&console[_0x54d767(0x105)](a4_0x551269['red'](_0x54d767(0xd7)+_0x3f5596['agentName']+_0x54d767(0x14e)+_0x3f5596['error']));}for(const _0xb34c72 of _0x33f2ee[_0x54d767(0x167)]){_0xb34c72[_0x54d767(0x140)]==='error'&&console['log'](a4_0x551269[_0x54d767(0x124)]('\x20\x20Knowledge\x20Base\x20\x22'+_0xb34c72[_0x54d767(0x138)]+'\x22:\x20'+_0xb34c72['error']));}for(const _0x3649c5 of _0x33f2ee[_0x54d767(0x117)]){_0x3649c5[_0x54d767(0x140)]===_0x54d767(0x126)&&console[_0x54d767(0x105)](a4_0x551269['red']('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x3649c5[_0x54d767(0x138)]+'\x22:\x20'+_0x3649c5[_0x54d767(0x126)]));}for(const _0x3438b1 of _0x33f2ee[_0x54d767(0x110)]){_0x3438b1[_0x54d767(0x140)]===_0x54d767(0x126)&&console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x124)](_0x54d767(0xd3)+_0x3438b1[_0x54d767(0x138)]+_0x54d767(0x14e)+_0x3438b1['error']));}for(const _0x46a19c of _0x33f2ee['integrations']){_0x46a19c['action']==='error'&&console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x124)](_0x54d767(0x11e)+_0x46a19c[_0x54d767(0x138)]+_0x54d767(0x14e)+_0x46a19c[_0x54d767(0x126)]));}for(const _0x1a10f4 of _0x33f2ee[_0x54d767(0xd1)]){_0x1a10f4[_0x54d767(0x140)]===_0x54d767(0x126)&&console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x124)]('\x20\x20Form\x20Interface\x20\x22'+_0x1a10f4['name']+'\x22:\x20'+_0x1a10f4['error']));}for(const _0x529f20 of _0x33f2ee[_0x54d767(0x132)]){_0x529f20[_0x54d767(0x140)]===_0x54d767(0x126)&&console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x124)](_0x54d767(0xca)+_0x529f20[_0x54d767(0x138)]+_0x54d767(0x14e)+_0x529f20['error']));}return 0x1;}console[_0x54d767(0x105)](a4_0x551269[_0x54d767(0x12b)](_0x54d767(0xb7)+(_0x42045b+_0x380990)+_0x54d767(0x156)+_0x33f2ee[_0x54d767(0x15e)]+'\x27'));const _0xab37f8=getLLMProjectUrl(_0x49d54c,_0x33f2ee[_0x54d767(0x12f)]);return console[_0x54d767(0x105)](_0x54d767(0xc7)+a4_0x551269[_0x54d767(0x14d)](_0xab37f8)),0x0;}}
|
|
1
|
+
const a4_0x1484db=a4_0x56ef;(function(_0x190b47,_0x56808f){const _0x3e0f6d=a4_0x56ef,_0x3c547a=_0x190b47();while(!![]){try{const _0x560f0f=parseInt(_0x3e0f6d(0x13b))/0x1*(parseInt(_0x3e0f6d(0xe2))/0x2)+-parseInt(_0x3e0f6d(0xee))/0x3*(parseInt(_0x3e0f6d(0x12c))/0x4)+parseInt(_0x3e0f6d(0x14a))/0x5+-parseInt(_0x3e0f6d(0xe0))/0x6*(parseInt(_0x3e0f6d(0xd1))/0x7)+parseInt(_0x3e0f6d(0xdf))/0x8*(parseInt(_0x3e0f6d(0x115))/0x9)+-parseInt(_0x3e0f6d(0x11b))/0xa+parseInt(_0x3e0f6d(0xd4))/0xb;if(_0x560f0f===_0x56808f)break;else _0x3c547a['push'](_0x3c547a['shift']());}catch(_0x35730c){_0x3c547a['push'](_0x3c547a['shift']());}}}(a4_0x25c4,0xa3247));import a4_0x34bb3b from'chalk';import a4_0x1764f5 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x334616){const _0xa7d05b=a4_0x56ef,_0x34dc5d=[];if(_0x334616[_0xa7d05b(0xab)]!==undefined)_0x34dc5d['push'](_0x334616[_0xa7d05b(0xab)]+_0xa7d05b(0x154));if(_0x334616[_0xa7d05b(0xe7)]!==undefined&&_0x334616['new']>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b[_0xa7d05b(0x165)](_0x334616[_0xa7d05b(0xe7)]+_0xa7d05b(0x163)));if(_0x334616[_0xa7d05b(0x145)]!==undefined&&_0x334616[_0xa7d05b(0x145)]>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b['green'](_0x334616[_0xa7d05b(0x145)]+'\x20created'));if(_0x334616[_0xa7d05b(0xe8)]!==undefined&&_0x334616['updated']>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b[_0xa7d05b(0xb6)](_0x334616['updated']+_0xa7d05b(0xb3)));if(_0x334616['unchanged']!==undefined&&_0x334616[_0xa7d05b(0x112)]>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b['gray'](_0x334616[_0xa7d05b(0x112)]+_0xa7d05b(0x15c)));if(_0x334616[_0xa7d05b(0xe1)]!==undefined&&_0x334616[_0xa7d05b(0xe1)]>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b[_0xa7d05b(0xed)](_0x334616[_0xa7d05b(0xe1)]+_0xa7d05b(0x137)));return _0x34dc5d[_0xa7d05b(0xef)](',\x20');}function displayDiffs(_0xaa79f7,_0x4dc64c,_0x3e5de0,_0x52ce89,_0x1de8ff,_0x41f6f9,_0x18b7b1,_0x4e95be,_0x3bf32c){const _0x5a7631=a4_0x56ef;for(const _0x4b2ab8 of _0xaa79f7){if(_0x4b2ab8[_0x5a7631(0xac)]){const _0x21148d=_0x4b2ab8[_0x5a7631(0x120)]||_0x4b2ab8[_0x5a7631(0x12b)];console[_0x5a7631(0xf1)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x21148d+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x4b2ab8['diff']),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c));}}for(const _0x51b233 of _0x4dc64c){_0x51b233[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0xbc)+_0x51b233['name']+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x51b233[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0xfc40ec of _0x3e5de0){_0xfc40ec[_0x5a7631(0xac)]&&(console['log'](_0x5a7631(0x108)+_0xfc40ec[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console['log'](_0xfc40ec[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x2d37aa of _0x52ce89){_0x2d37aa[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0xb1)+_0x2d37aa['name']+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x2d37aa['diff']),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x367f44 of _0x1de8ff){_0x367f44['diff']&&(console[_0x5a7631(0xf1)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x367f44[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x367f44['diff']),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x49321c of _0x41f6f9){_0x49321c[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0xa8)+_0x49321c[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x49321c[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x1ca237 of _0x18b7b1){_0x1ca237[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0x136)+_0x1ca237[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x1ca237[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x2f99db of _0x4e95be){_0x2f99db['diff']&&(console[_0x5a7631(0xf1)](_0x5a7631(0x149)+_0x2f99db['name']+'\x27:'),console[_0x5a7631(0xf1)]('─'['repeat'](0x3c)),console[_0x5a7631(0xf1)](_0x2f99db[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0xe3d0a2 of _0x3bf32c){_0xe3d0a2[_0x5a7631(0xac)]&&(console['log'](_0x5a7631(0x138)+_0xe3d0a2[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0xe3d0a2[_0x5a7631(0xac)]),console['log']('─'[_0x5a7631(0xd5)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1484db(0x12b)]=a4_0x1484db(0x13e);[a4_0x1484db(0xc6)]=a4_0x1484db(0xc8);async[a4_0x1484db(0x100)](_0x5c6804){const _0x37fc06=a4_0x1484db,{options:_0x4a5dc3,args:_0x12880a,tdx:_0x303ef5}=_0x5c6804,_0x204a5f=_0x12880a[0x0],_0xa6fd17=_0x12880a[0x1],_0x21f7ce=_0x4a5dc3['output'],_0x39c16d=_0x4a5dc3['dryRun'],_0x39688f=_0x4a5dc3[_0x37fc06(0x144)],_0x2705d7=_0x4a5dc3[_0x37fc06(0xb2)],_0xc33837=_0x4a5dc3[_0x37fc06(0xec)],_0x39a3e7=_0x4a5dc3[_0x37fc06(0xff)];let _0x525fde;if(_0x204a5f){const _0x3773df=a4_0x1764f5[_0x37fc06(0xef)](_0x204a5f,_0x37fc06(0x117));if(existsSync(_0x3773df))try{const _0x5069b0=JSON[_0x37fc06(0x14c)](readFileSync(_0x3773df,_0x37fc06(0xfb)));_0x5069b0[_0x37fc06(0x106)]&&(_0x525fde={'llm_project':_0x5069b0[_0x37fc06(0x106)]});}catch{}}const _0x40b12a=findAgentConfigPath(process[_0x37fc06(0xaa)]());let _0x261888;if(_0x40b12a)try{const _0x55d3ee=JSON['parse'](readFileSync(_0x40b12a,_0x37fc06(0xfb)));_0x55d3ee['llm_project']&&(_0x261888={'llm_project':_0x55d3ee[_0x37fc06(0x106)]});}catch{}const _0x71c90=resolveAgentPullArgs({'arg':_0x204a5f,'agentNameArg':_0xa6fd17,'agentFlag':_0x39a3e7,'contextProject':_0xc33837,'argDirConfig':_0x525fde,'cwdConfigPath':_0x40b12a||undefined,'cwdConfig':_0x261888}),{projectNameOrId:_0x2c7871,targetAgentName:_0x45477a,existingOutputDir:_0x1746f8,source:_0x3262ef}=_0x71c90;if(_0x3262ef===_0x37fc06(0x11a))console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0xc9)+a4_0x1764f5['join'](_0x204a5f,_0x37fc06(0x117))+':\x20'+_0x2c7871));else{if(_0x3262ef==='cwd-config')console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0x140)+_0x2c7871));else _0x3262ef==='context'&&console['log'](a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0x143)+_0x2c7871));}if(!_0x2c7871)return _0x39a3e7?(console['log'](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0x134))),console['log'](_0x37fc06(0xde)),console[_0x37fc06(0xf1)](_0x37fc06(0xd7))):(console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x37fc06(0xf1)](_0x37fc06(0xcf)),console['log'](_0x37fc06(0xc2)),console[_0x37fc06(0xf1)](_0x37fc06(0x139)),console[_0x37fc06(0xf1)](_0x37fc06(0x153)),console[_0x37fc06(0xf1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x45477a){const {data:_0x42b9a8}=await withSpinner(_0x37fc06(0xa9)+_0x45477a+_0x37fc06(0xf3)+_0x2c7871+_0x37fc06(0xfe),()=>_0x303ef5['llm'][_0x37fc06(0xe3)](_0x2c7871,_0x45477a,_0x21f7ce,{'dryRun':_0x39c16d,'force':_0x39688f}));if(_0x39c16d)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0x105))),console['log'](_0x37fc06(0x122)+_0x42b9a8[_0x37fc06(0x120)]),console[_0x37fc06(0xf1)]('Output\x20path:\x20'+_0x42b9a8[_0x37fc06(0xbf)]),_0x42b9a8[_0x37fc06(0xac)]&&(console[_0x37fc06(0xf1)](_0x37fc06(0xd3)),console[_0x37fc06(0xf1)]('─'[_0x37fc06(0xd5)](0x3c)),console['log'](_0x42b9a8[_0x37fc06(0xac)]),console[_0x37fc06(0xf1)]('─'[_0x37fc06(0xd5)](0x3c))),0x0;return console[_0x37fc06(0xf1)](a4_0x34bb3b['green'](_0x37fc06(0x103))),console['log']('Agent:\x20'+_0x42b9a8['agentName']),console[_0x37fc06(0xf1)](_0x37fc06(0xad)+_0x42b9a8['outputPath']),console['log'](_0x37fc06(0x161)+(_0x42b9a8[_0x37fc06(0xe9)]?a4_0x34bb3b['green'](_0x37fc06(0xe7)):_0x42b9a8[_0x37fc06(0x14e)]?a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0xe8)):a4_0x34bb3b[_0x37fc06(0xbe)](_0x37fc06(0x112)))),0x0;}const _0x1bca85=_0x1746f8||_0x21f7ce,{data:_0x22b7c1}=await withSpinner(_0x37fc06(0x119)+_0x2c7871+_0x37fc06(0xfe),()=>_0x303ef5[_0x37fc06(0xf4)][_0x37fc06(0xbb)](_0x2c7871,_0x1bca85,{'dryRun':!![]})),_0x49bb6a=_0x22b7c1['counts']['agents'][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x114)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)]['textKnowledgeBases'][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x13f)][_0x37fc06(0xe7)]+_0x22b7c1['counts'][_0x37fc06(0x146)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xf9)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x128)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xc1)]['new']+_0x22b7c1[_0x37fc06(0xf2)]['chatInterfaces'][_0x37fc06(0xe7)],_0x2c2fc3=_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x10a)]['updated']+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x114)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x101)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)]['prompts'][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x146)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)]['experimentalKnowledgeBases'][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x128)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xc1)][_0x37fc06(0xe8)]+_0x22b7c1['counts'][_0x37fc06(0x11c)][_0x37fc06(0xe8)],_0x43b647=_0x22b7c1['counts'][_0x37fc06(0x10a)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x114)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x101)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x13f)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x146)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xf9)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x128)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)]['formInterfaces'][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)]['chatInterfaces'][_0x37fc06(0x112)];console[_0x37fc06(0xf1)]('\x0aPull\x20summary\x20for\x20\x27'+_0x22b7c1[_0x37fc06(0xc4)]+'\x27:'),console[_0x37fc06(0xf1)]('\x20\x20'+a4_0x34bb3b['green']('+\x20'+_0x49bb6a+_0x37fc06(0x163))+_0x37fc06(0xe6)+a4_0x34bb3b[_0x37fc06(0xb6)]('~\x20'+_0x2c2fc3+_0x37fc06(0x110))+_0x37fc06(0xe6)+a4_0x34bb3b['dim']('=\x20'+_0x43b647+_0x37fc06(0x15c))),console['log'](_0x37fc06(0xb5)+formatCountSummary(_0x22b7c1['counts'][_0x37fc06(0x10a)])),console[_0x37fc06(0xf1)](_0x37fc06(0x164)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x13f)])),console[_0x37fc06(0xf1)](_0x37fc06(0x10c)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x146)])),console['log']('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xc1)])),console[_0x37fc06(0xf1)](_0x37fc06(0x168)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['chatInterfaces']));const _0x1bd7fe=_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xf9)][_0x37fc06(0xab)]>0x0||_0x22b7c1[_0x37fc06(0xf2)]['experimentalArtifacts'][_0x37fc06(0xab)]>0x0;_0x1bd7fe&&(console['log'](_0x37fc06(0x102)+formatCountSummary(_0x22b7c1['counts'][_0x37fc06(0xf9)])),console[_0x37fc06(0xf1)](_0x37fc06(0x141)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['experimentalArtifacts'])));console[_0x37fc06(0xf1)]('\x20\x20Target:\x20'+a4_0x34bb3b['cyan'](_0x22b7c1[_0x37fc06(0xcd)])),displayDiffs(_0x22b7c1[_0x37fc06(0x10a)],_0x22b7c1[_0x37fc06(0x114)],_0x22b7c1['textKnowledgeBases'],_0x22b7c1[_0x37fc06(0x13f)],_0x22b7c1[_0x37fc06(0x146)],_0x22b7c1[_0x37fc06(0xf9)],_0x22b7c1[_0x37fc06(0x128)],_0x22b7c1['formInterfaces'],_0x22b7c1[_0x37fc06(0x11c)]);if(_0x39c16d)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0x152))),0x0;if(_0x49bb6a===0x0&&_0x2c2fc3===0x0)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x165)](_0x37fc06(0xd8))),saveSessionContext({'llm_project':_0x22b7c1[_0x37fc06(0xc4)]},_0x4a5dc3[_0x37fc06(0xb7)]),console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x165)](_0x37fc06(0xbd)+a4_0x34bb3b['dim']('llm_project')+'\x20=\x20'+a4_0x34bb3b[_0x37fc06(0xf8)](_0x22b7c1['projectName']))),0x0;if(!_0x2705d7&&!_0x39688f){if(!isInteractive())return console[_0x37fc06(0x10f)](a4_0x34bb3b[_0x37fc06(0xed)](_0x37fc06(0x12f)),_0x37fc06(0xc3)),console[_0x37fc06(0x10f)](a4_0x34bb3b[_0x37fc06(0x11e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1e308e=await confirmKey(_0x37fc06(0xe5)+(_0x49bb6a+_0x2c2fc3)+_0x37fc06(0x15d));if(!_0x1e308e)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0xce)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1dc52c}=await withSpinner(_0x37fc06(0x107),()=>_0x303ef5[_0x37fc06(0xf4)]['pullProject'](_0x2c7871,_0x1bca85,{'force':_0x39688f}));return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x165)](_0x37fc06(0x13d)+(_0x49bb6a+_0x2c2fc3)+_0x37fc06(0xb4)+_0x1dc52c[_0x37fc06(0xcd)])),saveSessionContext({'llm_project':_0x1dc52c['projectName']},_0x4a5dc3['session']),console['log'](a4_0x34bb3b['green'](_0x37fc06(0xbd)+a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0x106))+_0x37fc06(0xf7)+a4_0x34bb3b[_0x37fc06(0xf8)](_0x1dc52c[_0x37fc06(0xc4)]))),0x0;}}function a4_0x56ef(_0x23bff5,_0x390237){_0x23bff5=_0x23bff5-0xa8;const _0x25c493=a4_0x25c4();let _0x56ef28=_0x25c493[_0x23bff5];return _0x56ef28;}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x1484db(0x15b);[a4_0x1484db(0xc6)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x1484db(0x100)](_0xcdab12){const _0x2162be=a4_0x1484db,{options:_0x545184,args:_0x55938b,tdx:_0x40801c}=_0xcdab12,_0x179cca=_0x55938b[0x0],_0x447e1e=_0x545184[_0x2162be(0x12b)],_0xb6955=_0x545184[_0x2162be(0xc5)],_0x44c640=_0x545184['yes'],_0x4c3345=_0x545184[_0x2162be(0x14f)],_0x4ffc4a=_0x545184[_0x2162be(0xec)];let _0x8b025f;const _0x3e2fe7=findAgentConfigPath(process[_0x2162be(0xaa)]());if(_0x179cca){const _0x4c2ab3=a4_0x1764f5[_0x2162be(0xef)](_0x179cca,_0x2162be(0x117));existsSync(_0x4c2ab3)?(_0x8b025f=_0x179cca,console['log'](a4_0x34bb3b[_0x2162be(0x11e)](_0x2162be(0x148)+_0x179cca))):_0x8b025f=_0x179cca;}else{if(_0x3e2fe7)_0x8b025f=a4_0x1764f5[_0x2162be(0xcc)](_0x3e2fe7),console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0x11e)](_0x2162be(0x12d)+_0x8b025f));else{if(_0x4ffc4a){const _0x4b7995=sanitizeForFilesystem(_0x4ffc4a);let _0x225c04=_0x4b7995,_0x30f558=a4_0x1764f5[_0x2162be(0xef)](process[_0x2162be(0xaa)](),_0x2162be(0x10a),_0x4b7995,_0x2162be(0x117));if(!existsSync(_0x30f558)){const _0x4d4305=normalizeName(_0x4ffc4a),_0x3df9ee=a4_0x1764f5['join'](process[_0x2162be(0xaa)](),'agents',_0x4d4305,'tdx.json');existsSync(_0x3df9ee)&&(_0x225c04=_0x4d4305,_0x30f558=_0x3df9ee);}if(existsSync(_0x30f558))_0x8b025f=a4_0x1764f5['dirname'](_0x30f558),console['log'](a4_0x34bb3b['dim']('Using\x20local\x20project:\x20'+_0x8b025f));else{const _0x29597b=_0x545184['profile'];if(_0x29597b)throw new SDKError(ErrorCode[_0x2162be(0xdc)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4ffc4a+_0x2162be(0x167),undefined,{'helpText':_0x2162be(0x14b)+_0x2162be(0xdb)+(_0x2162be(0xd0)+_0x4ffc4a+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x225c04+_0x2162be(0xda)+(_0x447e1e||_0x2162be(0x142))+_0x2162be(0x130)+_0x29597b)});_0x8b025f=_0x4ffc4a,console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0x11e)](_0x2162be(0xd6)+_0x4ffc4a));}}}}if(!_0x8b025f)return console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xb6)](_0x2162be(0x160))),console['log'](_0x2162be(0x129)),console[_0x2162be(0xf1)](_0x2162be(0xc0)),console[_0x2162be(0xf1)](_0x2162be(0xd2)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x447e1e)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2162be(0xfa),undefined,{'helpText':_0x2162be(0xdd)});if(!_0x44c640&&!_0xb6955){if(!isInteractive())return console[_0x2162be(0x10f)](a4_0x34bb3b[_0x2162be(0xed)]('\x0aError:'),_0x2162be(0xc3)),console[_0x2162be(0x10f)](a4_0x34bb3b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2162f8=await confirmKey('Clone\x20\x22'+_0x8b025f+_0x2162be(0xc7)+_0x447e1e+'\x22?');if(!_0x2162f8)return console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xb6)]('Cancelled')),0x1;}const {data:_0x2c506d}=await withSpinner(_0x2162be(0x124)+_0x8b025f+_0x2162be(0x12a)+_0x447e1e+_0x2162be(0xfe),()=>_0x40801c['llm']['cloneProject'](_0x8b025f,_0x447e1e,{'dryRun':_0xb6955}));if(_0xb6955){console[_0x2162be(0xf1)](a4_0x34bb3b['yellow'](_0x2162be(0x10d))),console[_0x2162be(0xf1)](_0x2162be(0x166)+_0x2c506d[_0x2162be(0x109)]),console['log']('New\x20project:\x20'+_0x447e1e),console[_0x2162be(0xf1)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x2c506d['counts']['agents'][_0x2162be(0x145)]),console[_0x2162be(0xf1)](_0x2162be(0x164)+_0x2c506d[_0x2162be(0xf2)]['knowledgeBases'][_0x2162be(0x145)]),console[_0x2162be(0xf1)](_0x2162be(0x158)+_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x13f)]['created']),console['log']('\x20\x20Form\x20Interfaces:\x20'+_0x2c506d['counts'][_0x2162be(0xc1)][_0x2162be(0x145)]),console['log'](_0x2162be(0x168)+_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x11c)]['created']);const _0x70bfac=_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)][_0x2162be(0x145)]>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x128)][_0x2162be(0x145)]>0x0;return _0x70bfac&&(console[_0x2162be(0xf1)](_0x2162be(0x102)+_0x2c506d[_0x2162be(0xf2)]['experimentalKnowledgeBases']['created']),console[_0x2162be(0xf1)](_0x2162be(0x141)+_0x2c506d[_0x2162be(0xf2)]['experimentalArtifacts'][_0x2162be(0x145)])),0x0;}const _0x5c6a05=_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x10a)][_0x2162be(0xe1)]>0x0||_0x2c506d['counts'][_0x2162be(0x114)][_0x2162be(0xe1)]>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x13f)]['errors']>0x0||_0x2c506d[_0x2162be(0xf2)]['formInterfaces']['errors']>0x0||_0x2c506d[_0x2162be(0xf2)]['chatInterfaces']['errors']>0x0||_0x2c506d['counts'][_0x2162be(0xf9)][_0x2162be(0xe1)]>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x128)]['errors']>0x0;_0x5c6a05?console[_0x2162be(0xf1)](a4_0x34bb3b['yellow'](_0x2162be(0x135))):console['log'](a4_0x34bb3b[_0x2162be(0x165)](_0x2162be(0xca)));console['log'](_0x2162be(0x166)+_0x2c506d[_0x2162be(0x109)]),console[_0x2162be(0xf1)](_0x2162be(0x111)+_0x2c506d[_0x2162be(0xf6)]),console[_0x2162be(0xf1)]('New\x20project\x20ID:\x20'+_0x2c506d['newProjectId']),console[_0x2162be(0xf1)](),console['log']('Summary:'),console[_0x2162be(0xf1)](_0x2162be(0xb5)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x10a)])),console[_0x2162be(0xf1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x114)])),console['log'](_0x2162be(0x158)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x13f)])),console[_0x2162be(0xf1)](_0x2162be(0x10c)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x146)])),console[_0x2162be(0xf1)](_0x2162be(0x155)+formatCountSummary(_0x2c506d['counts'][_0x2162be(0xc1)])),console[_0x2162be(0xf1)](_0x2162be(0x168)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x11c)]));const _0x106010=_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)][_0x2162be(0x145)]>0x0||_0x2c506d['counts'][_0x2162be(0xf9)]['updated']>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)][_0x2162be(0x112)]>0x0||_0x2c506d['counts']['experimentalArtifacts'][_0x2162be(0x145)]>0x0||_0x2c506d[_0x2162be(0xf2)]['experimentalArtifacts'][_0x2162be(0xe8)]>0x0||_0x2c506d['counts'][_0x2162be(0x128)][_0x2162be(0x112)]>0x0;_0x106010&&(console[_0x2162be(0xf1)](_0x2162be(0x102)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)])),console[_0x2162be(0xf1)](_0x2162be(0x141)+formatCountSummary(_0x2c506d['counts'][_0x2162be(0x128)])));if(_0x5c6a05){console[_0x2162be(0xf1)](),console['log'](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0xe4)));for(const _0x137386 of _0x2c506d[_0x2162be(0x10a)]){_0x137386['action']==='error'&&console[_0x2162be(0xf1)](a4_0x34bb3b['red'](_0x2162be(0xf0)+_0x137386[_0x2162be(0x120)]+'\x22:\x20'+_0x137386[_0x2162be(0x10f)]));}for(const _0x2b8a4d of _0x2c506d['knowledgeBases']){_0x2b8a4d[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x2b8a4d[_0x2162be(0x12b)]+'\x22:\x20'+_0x2b8a4d[_0x2162be(0x10f)]));}for(const _0x3d5ee1 of _0x2c506d[_0x2162be(0x13f)]){_0x3d5ee1[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0x162)+_0x3d5ee1['name']+_0x2162be(0x147)+_0x3d5ee1[_0x2162be(0x10f)]));}for(const _0x203b17 of _0x2c506d['integrations']){_0x203b17[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0xfc)+_0x203b17[_0x2162be(0x12b)]+_0x2162be(0x147)+_0x203b17[_0x2162be(0x10f)]));}for(const _0x1110c6 of _0x2c506d[_0x2162be(0xc1)]){_0x1110c6[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)]('\x20\x20Form\x20Interface\x20\x22'+_0x1110c6['name']+_0x2162be(0x147)+_0x1110c6[_0x2162be(0x10f)]));}for(const _0x2f7cdb of _0x2c506d[_0x2162be(0x11c)]){_0x2f7cdb[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b['red'](_0x2162be(0xb0)+_0x2f7cdb[_0x2162be(0x12b)]+_0x2162be(0x147)+_0x2f7cdb[_0x2162be(0x10f)]));}for(const _0x1ed0b3 of _0x2c506d[_0x2162be(0xf9)]){_0x1ed0b3[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0x121)+_0x1ed0b3['name']+'\x22:\x20'+_0x1ed0b3['error']));}for(const _0x4d33bb of _0x2c506d[_0x2162be(0x128)]){_0x4d33bb[_0x2162be(0x159)]==='error'&&console[_0x2162be(0xf1)](a4_0x34bb3b['red'](_0x2162be(0xd9)+_0x4d33bb[_0x2162be(0x12b)]+'\x22:\x20'+_0x4d33bb[_0x2162be(0x10f)]));}return 0x1;}console['log']();const _0x2d8192=getLLMProjectUrl(_0x4c3345,_0x2c506d['newProjectId']);return console['log'](_0x2162be(0x132)+a4_0x34bb3b['cyan'](_0x2d8192)),0x0;}}function a4_0x25c4(){const _0xeb7471=['156yQGDSm','errors','1754020SpRcyv','pullAgent','Errors:','\x0aWrite\x20','\x20|\x20','new','updated','isNew','found','Pushing\x20to\x20project...','llmProject','red','3525iNFqWs','join','\x20\x20Agent\x20\x22','log','counts','\x22\x20from\x20project\x20\x22','llm','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','newProjectName','\x20=\x20','cyan','experimentalKnowledgeBases','New\x20project\x20name\x20is\x20required','utf-8','\x20\x20Integration\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','\x22...','agent','execute','textKnowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Agent\x20pulled\x20successfully','projectDir','Dry\x20run\x20-\x20no\x20files\x20written','llm_project','Writing\x20files...','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','sourceProjectName','agents','message','\x20\x20Integrations:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','agentId','error','\x20changed','New\x20project:\x20','unchanged','Agent\x20','knowledgeBases','181017RSGqmX','\x0aProject\x20pushed\x20with\x20errors','tdx.json','\x20\x20Text\x20Knowledge\x20Bases:\x20','Analyzing\x20project\x20\x22','arg-dir','6039910KSpoVn','chatInterfaces','no_context','dim','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','agentName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Would\x20pull\x20agent:\x20','Agent:\x20','Cloning\x20\x22','\x20resources?','\x20resources\x20to\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','experimentalArtifacts','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x22\x20to\x20\x22','name','2776AGwMHl','Using\x20current\x20project:\x20','Analyzing\x20changes\x20to\x20push...','\x0aError:','\x20--profile\x20','context','Project:\x20','pushProject','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20errors','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\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','push','1ScKITE','Would\x20push\x20agent:\x20','\x0a✔\x20Pulled\x20','agent:pull','prompts','Using\x20project:\x20','\x20\x20Experimental\x20Artifacts:\x20','<new-name>','Using\x20project\x20from\x20context:\x20','force','created','integrations','\x22:\x20','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','2881135URuYFH','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','parse','\x0aPush\x20summary\x20for\x20\x27','hasChanges','site','\x27\x20to\x20create\x20the\x20folder\x20structure.','Pushing\x20agent\x20from\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\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','\x20total','\x20\x20Form\x20Interfaces:\x20','agent:push','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Prompts:\x20','action','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agent:clone','\x20unchanged','\x20files?','pushAgent','reason','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Status:\x20','\x20\x20Prompt\x20\x22','\x20new','\x20\x20Knowledge\x20Bases:\x20','green','Source:\x20','\x22\x20to\x20a\x20different\x20profile','\x20\x20Chat\x20Interfaces:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Pulling\x20agent\x20\x22','cwd','total','diff','Output:\x20','No\x20tdx.json\x20found\x20in\x20','\x20successfully','\x20\x20Chat\x20Interface\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','yes','\x20updated','\x20files\x20to\x20','\x20\x20Agents:\x20','yellow','session','\x0aPush\x20','source','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','pullProject','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','✔\x20Context\x20set:\x20','gray','outputPath','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','formInterfaces','\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','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','projectName','dryRun','description','\x22\x20to\x20new\x20project\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Using\x20project\x20from\x20','Project\x20cloned\x20successfully','projectId','dirname','outputDir','Cancelled','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\x20tdx\x20agent\x20pull\x20','275569CJpTmn','\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)','\x0aChanges:','16689046jwsiii','repeat','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Experimental\x20Artifact\x20\x22','\x20--name\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','INVALID_ARGUMENT','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','56ltuPVo'];a4_0x25c4=function(){return _0xeb7471;};return a4_0x25c4();}export class AgentPushCommand extends BaseCommand{[a4_0x1484db(0x12b)]=a4_0x1484db(0x156);[a4_0x1484db(0xc6)]=a4_0x1484db(0x157);async[a4_0x1484db(0x100)](_0x13a563){const _0x34fe97=a4_0x1484db,{options:_0x343750,args:_0xca1f24,tdx:_0x208108}=_0x13a563;let _0x4c9ac1=_0xca1f24[0x0]||process[_0x34fe97(0xaa)]();const _0x54bfd0=_0x343750[_0x34fe97(0xc5)],_0x394d67=_0x343750[_0x34fe97(0x144)],_0x1dfd29=_0x343750[_0x34fe97(0xb2)],_0x50e31d=_0x343750[_0x34fe97(0x14f)],_0x532239=a4_0x1764f5[_0x34fe97(0xef)](_0x4c9ac1,'agent.yml'),_0x7d43ff=existsSync(_0x532239);if(_0x7d43ff){const {data:_0x339718}=await withSpinner(_0x34fe97(0x151)+_0x4c9ac1+_0x34fe97(0xfe),()=>_0x208108[_0x34fe97(0xf4)][_0x34fe97(0x15e)](_0x4c9ac1,{'dryRun':_0x54bfd0,'force':_0x394d67}));if(_0x54bfd0)return console['log'](a4_0x34bb3b[_0x34fe97(0xb6)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x34fe97(0xf1)](_0x34fe97(0x13c)+_0x339718[_0x34fe97(0x120)]),0x0;if(_0x339718[_0x34fe97(0x159)]===_0x34fe97(0x10f))return console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)]('Failed\x20to\x20push\x20agent:\x20'+_0x339718[_0x34fe97(0x10f)])),0x1;console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x165)](_0x34fe97(0x113)+_0x339718[_0x34fe97(0x159)]+_0x34fe97(0xaf))),console['log'](_0x34fe97(0x123)+_0x339718[_0x34fe97(0x120)]);if(_0x339718[_0x34fe97(0x10e)]&&_0x339718['projectId']){const _0x28f4db=getLLMAgentChatUrl(_0x50e31d,_0x339718['projectId'],_0x339718[_0x34fe97(0x10e)]);console[_0x34fe97(0xf1)]('Chat:\x20'+a4_0x34bb3b[_0x34fe97(0xf8)](_0x28f4db));}return 0x0;}const _0x3769d6=_0x343750[_0x34fe97(0xec)],_0x2eb0f9=resolveProjectFromContext(_0x4c9ac1,_0x3769d6);if(_0x2eb0f9[_0x34fe97(0xea)])_0x4c9ac1=_0x2eb0f9[_0x34fe97(0x104)],_0x2eb0f9[_0x34fe97(0xb9)]===_0x34fe97(0x131)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x11e)](_0x34fe97(0x140)+_0x4c9ac1));else{let _0xfb0092=_0x34fe97(0xf5);_0x2eb0f9['reason']==='no_local_folder'&&(_0xfb0092=_0x2eb0f9['message']+_0x34fe97(0xba)+_0x2eb0f9[_0x34fe97(0xec)]+_0x34fe97(0x150));throw new SDKError(ErrorCode[_0x34fe97(0xdc)],_0x2eb0f9[_0x34fe97(0x15f)]===_0x34fe97(0x11d)?_0x2eb0f9[_0x34fe97(0x10b)]:_0x34fe97(0xae)+_0x4c9ac1,undefined,{'helpText':_0xfb0092});}const {data:_0x4ff319}=await withSpinner(_0x34fe97(0x12e),()=>_0x208108[_0x34fe97(0xf4)][_0x34fe97(0x133)](_0x4c9ac1,{'dryRun':!![]})),_0x3c225c=_0x4ff319[_0x34fe97(0xf2)]['agents'][_0x34fe97(0xe1)]>0x0;if(_0x3c225c){console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)]('\x0aErrors\x20found:'));for(const _0xddfcfc of _0x4ff319['agents']){_0xddfcfc[_0x34fe97(0x159)]==='error'&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xf0)+_0xddfcfc[_0x34fe97(0x120)]+_0x34fe97(0x147)+_0xddfcfc[_0x34fe97(0x10f)]));}return 0x1;}const _0x14bc0b=_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x10a)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)]['created']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x13f)]['created']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x146)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)]['experimentalKnowledgeBases'][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)][_0x34fe97(0x145)]+_0x4ff319['counts'][_0x34fe97(0xc1)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x11c)]['created'],_0x22ee59=_0x4ff319['counts']['agents'][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x13f)][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x146)]['updated']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)]['updated']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)]['updated']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xc1)][_0x34fe97(0xe8)]+_0x4ff319['counts'][_0x34fe97(0x11c)][_0x34fe97(0xe8)],_0x5e2b1f=_0x4ff319['counts']['agents'][_0x34fe97(0x112)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)][_0x34fe97(0x112)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)]['unchanged']+_0x4ff319['counts'][_0x34fe97(0x13f)][_0x34fe97(0x112)]+_0x4ff319['counts'][_0x34fe97(0x146)]['unchanged']+_0x4ff319['counts'][_0x34fe97(0xf9)][_0x34fe97(0x112)]+_0x4ff319['counts'][_0x34fe97(0x128)]['unchanged']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xc1)][_0x34fe97(0x112)]+_0x4ff319['counts'][_0x34fe97(0x11c)]['unchanged'];console[_0x34fe97(0xf1)](_0x34fe97(0x14d)+_0x4ff319[_0x34fe97(0xc4)]+'\x27:'),console[_0x34fe97(0xf1)]('\x20\x20'+a4_0x34bb3b['green']('+\x20'+_0x14bc0b+_0x34fe97(0x163))+_0x34fe97(0xe6)+a4_0x34bb3b['yellow']('~\x20'+_0x22ee59+_0x34fe97(0x110))+_0x34fe97(0xe6)+a4_0x34bb3b[_0x34fe97(0x11e)]('=\x20'+_0x5e2b1f+_0x34fe97(0x15c))),console[_0x34fe97(0xf1)](_0x34fe97(0xb5)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x10a)])),console[_0x34fe97(0xf1)](_0x34fe97(0x164)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)])),console['log'](_0x34fe97(0x118)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)])),console['log'](_0x34fe97(0x158)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x13f)])),console[_0x34fe97(0xf1)](_0x34fe97(0x10c)+formatCountSummary(_0x4ff319['counts'][_0x34fe97(0x146)])),console['log'](_0x34fe97(0x155)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)]['formInterfaces'])),console[_0x34fe97(0xf1)](_0x34fe97(0x168)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x11c)]));const _0x2e2737=_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)][_0x34fe97(0x145)]>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)][_0x34fe97(0xe8)]>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)]['unchanged']>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)][_0x34fe97(0x145)]>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)][_0x34fe97(0xe8)]>0x0||_0x4ff319['counts'][_0x34fe97(0x128)]['unchanged']>0x0;_0x2e2737&&(console[_0x34fe97(0xf1)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)]['experimentalKnowledgeBases'])),console[_0x34fe97(0xf1)](_0x34fe97(0x141)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)]['experimentalArtifacts'])));console[_0x34fe97(0xf1)]('\x20\x20Source:\x20'+a4_0x34bb3b[_0x34fe97(0xf8)](_0x4c9ac1)),displayDiffs(_0x4ff319['agents'],_0x4ff319['knowledgeBases'],_0x4ff319[_0x34fe97(0x101)],_0x4ff319['prompts'],_0x4ff319[_0x34fe97(0x146)],_0x4ff319[_0x34fe97(0xf9)],_0x4ff319[_0x34fe97(0x128)],_0x4ff319[_0x34fe97(0xc1)],_0x4ff319[_0x34fe97(0x11c)]);if(_0x54bfd0)return console[_0x34fe97(0xf1)](a4_0x34bb3b['yellow'](_0x34fe97(0x11f))),0x0;if(_0x14bc0b===0x0&&_0x22ee59===0x0){console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x165)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2cdb90=getLLMProjectUrl(_0x50e31d,_0x4ff319[_0x34fe97(0xcb)]);return console[_0x34fe97(0xf1)](_0x34fe97(0x132)+a4_0x34bb3b[_0x34fe97(0xf8)](_0x2cdb90)),0x0;}if(!_0x1dfd29&&!_0x394d67){if(!isInteractive())return console[_0x34fe97(0x10f)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0x12f)),_0x34fe97(0xc3)),console[_0x34fe97(0x10f)](a4_0x34bb3b['dim'](_0x34fe97(0x15a))),0x1;const _0x7f9596=await confirmKey(_0x34fe97(0xb8)+(_0x14bc0b+_0x22ee59)+_0x34fe97(0x125));if(!_0x7f9596)return console['log'](a4_0x34bb3b[_0x34fe97(0xb6)](_0x34fe97(0xce)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x25f29d}=await withSpinner(_0x34fe97(0xeb),()=>_0x208108[_0x34fe97(0xf4)]['pushProject'](_0x4c9ac1,{'force':_0x394d67})),_0x57144d=_0x25f29d[_0x34fe97(0xf2)][_0x34fe97(0x10a)]['errors']>0x0||_0x25f29d['counts'][_0x34fe97(0x114)][_0x34fe97(0xe1)]>0x0||_0x25f29d['counts'][_0x34fe97(0x101)][_0x34fe97(0xe1)]>0x0||_0x25f29d[_0x34fe97(0xf2)][_0x34fe97(0x13f)][_0x34fe97(0xe1)]>0x0||_0x25f29d[_0x34fe97(0xf2)][_0x34fe97(0xc1)][_0x34fe97(0xe1)]>0x0||_0x25f29d['counts'][_0x34fe97(0x11c)][_0x34fe97(0xe1)]>0x0;if(_0x57144d){console[_0x34fe97(0xf1)](a4_0x34bb3b['yellow'](_0x34fe97(0x116))),console['log'](),console[_0x34fe97(0xf1)](a4_0x34bb3b['red'](_0x34fe97(0xe4)));for(const _0x31e1e9 of _0x25f29d['agents']){_0x31e1e9[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b['red'](_0x34fe97(0xf0)+_0x31e1e9[_0x34fe97(0x120)]+_0x34fe97(0x147)+_0x31e1e9[_0x34fe97(0x10f)]));}for(const _0x282c11 of _0x25f29d[_0x34fe97(0x114)]){_0x282c11[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xfd)+_0x282c11[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x282c11[_0x34fe97(0x10f)]));}for(const _0xdf3652 of _0x25f29d['textKnowledgeBases']){_0xdf3652[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console['log'](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0x127)+_0xdf3652['name']+_0x34fe97(0x147)+_0xdf3652[_0x34fe97(0x10f)]));}for(const _0x3fe858 of _0x25f29d[_0x34fe97(0x13f)]){_0x3fe858[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0x162)+_0x3fe858[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x3fe858[_0x34fe97(0x10f)]));}for(const _0x18e86b of _0x25f29d[_0x34fe97(0x146)]){_0x18e86b[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xfc)+_0x18e86b[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x18e86b[_0x34fe97(0x10f)]));}for(const _0x18f7d3 of _0x25f29d[_0x34fe97(0xc1)]){_0x18f7d3[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b['red']('\x20\x20Form\x20Interface\x20\x22'+_0x18f7d3[_0x34fe97(0x12b)]+'\x22:\x20'+_0x18f7d3[_0x34fe97(0x10f)]));}for(const _0x2c24be of _0x25f29d[_0x34fe97(0x11c)]){_0x2c24be[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xb0)+_0x2c24be[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x2c24be[_0x34fe97(0x10f)]));}return 0x1;}console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x165)]('\x0a✔\x20Pushed\x20'+(_0x14bc0b+_0x22ee59)+_0x34fe97(0x126)+_0x25f29d[_0x34fe97(0xc4)]+'\x27'));const _0x55a6d9=getLLMProjectUrl(_0x50e31d,_0x25f29d['projectId']);return console['log']('Project:\x20'+a4_0x34bb3b['cyan'](_0x55a6d9)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x31050b=a5_0x6c19;(function(_0x5199e7,_0x5a555a){const _0x95b7c4=a5_0x6c19,_0x1267b9=_0x5199e7();while(!![]){try{const _0x31dd6c=parseInt(_0x95b7c4(0x144))/0x1*(parseInt(_0x95b7c4(0x11f))/0x2)+parseInt(_0x95b7c4(0xea))/0x3+parseInt(_0x95b7c4(0x11b))/0x4*(-parseInt(_0x95b7c4(0x150))/0x5)+parseInt(_0x95b7c4(0x12f))/0x6*(-parseInt(_0x95b7c4(0x106))/0x7)+parseInt(_0x95b7c4(0x174))/0x8+-parseInt(_0x95b7c4(0x14a))/0x9+-parseInt(_0x95b7c4(0x124))/0xa;if(_0x31dd6c===_0x5a555a)break;else _0x1267b9['push'](_0x1267b9['shift']());}catch(_0x566f0d){_0x1267b9['push'](_0x1267b9['shift']());}}}(a5_0x2933,0x69ff6));import*as a5_0x34bd6e from'node:fs';import*as a5_0x562d42 from'node:path';import a5_0x1a0b6a from'chalk';import{BaseCommand}from'./command.js';function a5_0x2933(){const _0x135586=['output','filter','Errors:\x20\x20\x20','Conversation\x20URL:\x20','1813ESYLpd','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','round','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Round\x201/','writeFileSync','table','\x20\x20Agent:\x20','agent:test','Running\x20agent\x20tests...','join','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','green','map','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22',':\x20Sending\x20user\x20input...','Agent:\x20','conversations','✗\x20FAIL:\x20','basename','timestamp','26264yyKwal','text','execute','Tests\x20found:\x20','2YfGYZS','has','tags','forEach','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','3409690pyJGdW','red','...','stop','llmProject','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','context','resolveProjectId','Cached\x20run\x20is\x20from\x20site\x20\x22','PASS','Total:\x20\x20\x20\x20','18024QrNelS','Failed\x20Tests:','Available\x20tests:\x20','site','\x20(new)','\x27\x20to\x20create\x20the\x20folder\x20structure.','testYmlPath','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✓\x20PASS:\x20','Using\x20agent:\x20','find','tsv','no_tests','message','Evaluating\x20response...','now','json','...\x20','⚠\x20SKIPPED:\x20','executeReeval','add','521929QOfbXK','agentName','Cached\x20run\x20from:\x20','isSpinning','FAIL','Duration:\x20','2650005AqSegC','start','reeval','llm','New\x20tests\x20to\x20execute:\x20','yellow','65rMenyp','testName','Re-evaluating...','utf-8','Test\x20','404','repeat','Test\x20Configuration:','name','\x22:\x20','length','includes','toLowerCase','resolve','\x20\x20Site:\x20','projectDir','agent','Test\x20Summary','\x20\x20Project:\x20','status','✗\x20ERROR:\x20','\x20(cached)','Run\x20tests\x20for\x20an\x20LLM\x20agent','some','size','trim','Executing\x20new\x20tests...','existsSync','push','agentDirs','\x20\x20Evaluating...\x20','\x20\x20Round\x20','dim','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','not\x20found','5144080prLFMD','rounds','Run\x20\x27tdx\x20agent\x20pull\x20','Running:\x20','Re-evaluating\x20','projectName','conversation_url','log','cyan','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Re-evaluating\x20cached\x20test\x20run...','tests','Output\x20written\x20to:\x20','Project\x20path:\x20','/<agent-name>','white','resolveAgentId','source','\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)','2304105ITnhzZ','Error\x20writing\x20output\x20file:\x20','multiple_agents','reason','Running\x20test:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20-\x20','\x20-\x20','description','No\x20tests\x20have\x20tags\x20defined.','\x20\x20Conversation:\x20','ERROR','Error:\x20No\x20previous\x20test\x20run\x20found.','toISOString','Failed:\x20\x20\x20','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','jsonl','split','found','dryRun','eval','Re-evaluation\x20Summary','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.'];a5_0x2933=function(){return _0x135586;};return a5_0x2933();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x6c19(_0x5901f,_0x2cf7bd){_0x5901f=_0x5901f-0xe6;const _0x2933c5=a5_0x2933();let _0x6c19ba=_0x2933c5[_0x5901f];return _0x6c19ba;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x31050b(0x10e);[a5_0x31050b(0xf2)]=a5_0x31050b(0x166);async[a5_0x31050b(0x11d)](_0x2a8fe1){const _0x41cd69=a5_0x31050b,{options:_0x231ada,args:_0x2cacd1,tdx:_0x59be21}=_0x2a8fe1,_0x50f12e=_0x2cacd1[0x0]||'.',_0x2596d3=_0x231ada[_0x41cd69(0xfe)],_0x5cb211=_0x231ada,_0x2f3b4d=_0x5cb211[_0x41cd69(0xff)]===![],_0x1baac4=_0x5cb211[_0x41cd69(0x14c)],_0x1084e7=_0x5cb211[_0x41cd69(0x158)],_0x5595c8=_0x5cb211[_0x41cd69(0x121)],_0x3106af=_0x231ada['site'],_0x1923fa=_0x5cb211[_0x41cd69(0x102)];if(_0x1baac4&&_0x2f3b4d)return console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x125)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3aaac8=_0x41cd69(0x10c);if(_0x5cb211[_0x41cd69(0x13f)])_0x3aaac8=_0x41cd69(0x13f);else{if(_0x5cb211['jsonl'])_0x3aaac8=_0x41cd69(0xfb);else{if(_0x5cb211['tsv'])_0x3aaac8=_0x41cd69(0x13a);else{if(_0x5cb211[_0x41cd69(0x10c)])_0x3aaac8=_0x41cd69(0x10c);}}}const _0x1e5404=_0x5cb211['llmProject'];let _0x4b132f=_0x50f12e;const _0x2370ce=a5_0x34bd6e[_0x41cd69(0x16b)](_0x50f12e),_0x52bed7=_0x50f12e==='.';if(!_0x2370ce||_0x52bed7){const _0x155e67=resolveProjectFromContext(_0x50f12e,_0x1e5404,{'requireFile':'test.yml'});if(_0x155e67[_0x41cd69(0xfd)])_0x4b132f=_0x155e67['projectDir'],_0x155e67[_0x41cd69(0xe8)]===_0x41cd69(0x12a)&&console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x170)](_0x41cd69(0x138)+_0x4b132f));else switch(_0x155e67[_0x41cd69(0xed)]){case'no_context':console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x14f)](_0x155e67[_0x41cd69(0x13c)])),console['log'](),console[_0x41cd69(0x17b)]('Usage:'),console[_0x41cd69(0x17b)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log'](_0x41cd69(0xe9)),console['log'](),console['log'](_0x41cd69(0x123));return 0x1;case'no_local_folder':console[_0x41cd69(0x17b)](a5_0x1a0b6a['yellow'](_0x155e67[_0x41cd69(0x13c)])),console[_0x41cd69(0x17b)](),console[_0x41cd69(0x17b)](_0x41cd69(0x176)+_0x155e67[_0x41cd69(0x128)]+_0x41cd69(0x134));return 0x1;case _0x41cd69(0xec):{const _0x433c1a=a5_0x562d42[_0x41cd69(0x119)](_0x155e67[_0x41cd69(0x15f)]);console[_0x41cd69(0x17b)](a5_0x1a0b6a['yellow'](_0x41cd69(0x172)+_0x155e67[_0x41cd69(0x128)]+'\x22:'));for(const _0x14a875 of _0x155e67[_0x41cd69(0x16d)]){console[_0x41cd69(0x17b)](_0x41cd69(0xf0)+_0x14a875);}return console['log'](),console[_0x41cd69(0x17b)](_0x41cd69(0x136)+_0x433c1a+_0x41cd69(0x182)),0x1;}case _0x41cd69(0x13b):console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x14f)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x155e67[_0x41cd69(0x128)]+'\x22.')),console[_0x41cd69(0x17b)](a5_0x1a0b6a['dim'](_0x41cd69(0x181)+_0x155e67['projectDir'])),console['log'](),console[_0x41cd69(0x17b)](_0x41cd69(0x109));return 0x1;}}const {definition:_0x3d801e,agentInfo:_0x3d558a}=parseTestFile(_0x4b132f);let _0x52fb50=_0x3d801e[_0x41cd69(0x17f)];if(_0x1084e7){const _0x3c86c3=_0x1084e7[_0x41cd69(0xfc)](',')[_0x41cd69(0x113)](_0x117d8e=>_0x117d8e['trim']());_0x52fb50=_0x3d801e[_0x41cd69(0x17f)][_0x41cd69(0x103)](_0x5597dd=>_0x3c86c3['includes'](_0x5597dd[_0x41cd69(0x158)]));if(_0x52fb50[_0x41cd69(0x15a)]===0x0)return console['log'](a5_0x1a0b6a[_0x41cd69(0x14f)]('No\x20tests\x20found\x20matching:\x20'+_0x1084e7)),console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x170)](_0x41cd69(0x131)+_0x3d801e['tests']['map'](_0x47b890=>_0x47b890[_0x41cd69(0x158)])['join'](',\x20'))),0x1;}if(_0x5595c8){const _0x469fc5=_0x5595c8[_0x41cd69(0xfc)](',')[_0x41cd69(0x113)](_0x2c056a=>_0x2c056a[_0x41cd69(0x169)]()[_0x41cd69(0x15c)]());_0x52fb50=_0x52fb50['filter'](_0x2895e2=>_0x2895e2['tags']?.[_0x41cd69(0x167)](_0x5800eb=>_0x469fc5[_0x41cd69(0x15b)](_0x5800eb[_0x41cd69(0x15c)]())));if(_0x52fb50['length']===0x0){console['log'](a5_0x1a0b6a[_0x41cd69(0x14f)](_0x41cd69(0xf9)+_0x5595c8));const _0x473c1a=new Set();return _0x3d801e[_0x41cd69(0x17f)][_0x41cd69(0x122)](_0x6bd53d=>_0x6bd53d[_0x41cd69(0x121)]?.[_0x41cd69(0x122)](_0x4d0637=>_0x473c1a[_0x41cd69(0x143)](_0x4d0637))),_0x473c1a[_0x41cd69(0x168)]>0x0?console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x170)]('Available\x20tags:\x20'+[..._0x473c1a][_0x41cd69(0x110)](',\x20'))):console['log'](a5_0x1a0b6a['dim'](_0x41cd69(0xf3))),0x1;}}if(_0x1baac4)return this[_0x41cd69(0x142)](_0x2a8fe1,{'definition':{'tests':_0x52fb50},'agentInfo':_0x3d558a,'outputFormat':_0x3aaac8,'outputFile':_0x1923fa,'testNames':_0x1084e7});if(_0x2596d3){console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x17c)](_0x41cd69(0x157))),console['log'](_0x41cd69(0x15e)+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x3106af)),console[_0x41cd69(0x17b)](_0x41cd69(0x162)+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x3d558a[_0x41cd69(0x179)])),console[_0x41cd69(0x17b)](_0x41cd69(0x10d)+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x3d558a[_0x41cd69(0x145)])),console['log'](),console['log'](_0x41cd69(0x11e)+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x52fb50[_0x41cd69(0x15a)]));for(let _0x14f8a4=0x0;_0x14f8a4<_0x52fb50[_0x41cd69(0x15a)];_0x14f8a4++){const _0x4d47c6=_0x52fb50[_0x14f8a4],_0x1012fa=_0x4d47c6[_0x41cd69(0x175)][_0x41cd69(0x15a)]===0x1?_0x41cd69(0x108):_0x41cd69(0x175),_0x57bd24=_0x4d47c6['tags']?.[_0x41cd69(0x15a)]?'\x20['+_0x4d47c6[_0x41cd69(0x121)][_0x41cd69(0x110)](',\x20')+']':'';console['log']('\x20\x20'+(_0x14f8a4+0x1)+'.\x20'+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x4d47c6[_0x41cd69(0x158)])+'\x20('+_0x4d47c6['rounds'][_0x41cd69(0x15a)]+'\x20'+_0x1012fa+')'+a5_0x1a0b6a[_0x41cd69(0x170)](_0x57bd24));}return 0x0;}let _0x4de1ef,_0x2d8e62;try{_0x4de1ef=await _0x59be21[_0x41cd69(0x14d)][_0x41cd69(0x12b)](_0x3d558a[_0x41cd69(0x179)]);}catch(_0x43a82b){const _0x15a492=_0x43a82b instanceof Error?_0x43a82b[_0x41cd69(0x13c)]:String(_0x43a82b);return _0x15a492[_0x41cd69(0x15b)]('404')||_0x15a492[_0x41cd69(0x15c)]()['includes'](_0x41cd69(0x173))?console[_0x41cd69(0x17b)](a5_0x1a0b6a['red'](_0x41cd69(0xfa)+_0x3d558a[_0x41cd69(0x179)])):console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x125)](_0x41cd69(0x114)+_0x3d558a[_0x41cd69(0x179)]+'\x22:\x20'+_0x15a492)),0x1;}try{_0x2d8e62=await _0x59be21[_0x41cd69(0x14d)][_0x41cd69(0xe7)](_0x3d558a[_0x41cd69(0x145)],_0x4de1ef);}catch(_0x5a8db4){const _0x52e5c8=_0x5a8db4 instanceof Error?_0x5a8db4['message']:String(_0x5a8db4);return _0x52e5c8[_0x41cd69(0x15b)](_0x41cd69(0x155))||_0x52e5c8[_0x41cd69(0x15c)]()[_0x41cd69(0x15b)](_0x41cd69(0x173))?console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x125)](_0x41cd69(0x107)+_0x3d558a[_0x41cd69(0x145)])):console['log'](a5_0x1a0b6a[_0x41cd69(0x125)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x3d558a[_0x41cd69(0x145)]+_0x41cd69(0x159)+_0x52e5c8)),0x1;}let _0x962653;if(!_0x2f3b4d)try{_0x962653=await setupEvaluatorAgent(_0x59be21['llm'],_0x231ada['verbose']);}catch(_0x1d827b){const _0x555ff5=_0x1d827b instanceof Error?_0x1d827b[_0x41cd69(0x13c)]:String(_0x1d827b);return console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x125)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x555ff5)),0x1;}console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x17c)](_0x41cd69(0x10f))),console[_0x41cd69(0x17b)]('Site:\x20'+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x3106af)),console['log'](_0x41cd69(0x116)+a5_0x1a0b6a['white'](_0x3d558a['projectName']+'/'+_0x3d558a[_0x41cd69(0x145)])),console['log']();const _0x26983e=[],_0x2d9a8b=[],_0x13de04=Date['now']();for(let _0x2274cf=0x0;_0x2274cf<_0x52fb50[_0x41cd69(0x15a)];_0x2274cf++){const _0x55fc55=_0x52fb50[_0x2274cf];_0x52fb50[_0x41cd69(0x15a)]>0x1?console[_0x41cd69(0x17b)](_0x41cd69(0x154)+(_0x2274cf+0x1)+'/'+_0x52fb50[_0x41cd69(0x15a)]+':\x20'+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x55fc55['name'])):console[_0x41cd69(0x17b)](_0x41cd69(0xee)+a5_0x1a0b6a[_0x41cd69(0xe6)](_0x55fc55[_0x41cd69(0x158)]));const _0x33a351=createCommandSpinner(_0x41cd69(0x10a)+_0x55fc55[_0x41cd69(0x175)][_0x41cd69(0x15a)]+_0x41cd69(0x115));_0x33a351[_0x41cd69(0x14b)]();try{const {result:_0xb99ac4,conversation:_0x2010a2}=await runTest(_0x59be21['llm'],_0x55fc55,{'agentId':_0x2d8e62,'projectId':_0x4de1ef,'site':_0x3106af,'noEval':_0x2f3b4d,'evaluatorId':_0x962653,'onRoundStart':(_0xae9bdb,_0x49b433)=>{const _0x3e905e=_0x41cd69;_0x33a351[_0x3e905e(0x11c)]='Round\x20'+(_0xae9bdb+0x1)+'/'+_0x49b433+_0x3e905e(0x115);},'onRoundComplete':(_0x39d901,_0x4bb68f,_0x5819c9)=>{const _0x46a451=_0x41cd69,_0x5a480c=formatElapsed(_0x4bb68f);_0x5819c9?console[_0x46a451(0x17b)](_0x46a451(0x16f)+(_0x39d901+0x1)+'/'+_0x55fc55[_0x46a451(0x175)][_0x46a451(0x15a)]+_0x46a451(0x140)+a5_0x1a0b6a['green']('✓')+'\x20('+_0x5a480c+')'):console[_0x46a451(0x17b)](_0x46a451(0x16f)+(_0x39d901+0x1)+'/'+_0x55fc55[_0x46a451(0x175)]['length']+'...\x20'+a5_0x1a0b6a[_0x46a451(0x125)]('✗'));},'onEvaluationStart':()=>{const _0x2388b8=_0x41cd69;_0x33a351['text']=_0x2388b8(0x13d);},'onEvaluationComplete':_0x1e265a=>{const _0x4da1d1=_0x41cd69,_0x9793b3=formatElapsed(_0x1e265a);console['log'](_0x4da1d1(0x16e)+a5_0x1a0b6a[_0x4da1d1(0x112)]('✓')+'\x20('+_0x9793b3+')');}});_0x33a351[_0x41cd69(0x127)](),_0x26983e[_0x41cd69(0x16c)](_0xb99ac4),_0x2d9a8b[_0x41cd69(0x16c)](_0x2010a2);if(_0xb99ac4[_0x41cd69(0x163)]==='PASS')console['log'](a5_0x1a0b6a['green'](_0x41cd69(0x137)+_0xb99ac4[_0x41cd69(0xed)]));else _0xb99ac4['status']===_0x41cd69(0x148)?console[_0x41cd69(0x17b)](a5_0x1a0b6a['red']('✗\x20FAIL:\x20'+_0xb99ac4['reason'])):console[_0x41cd69(0x17b)](a5_0x1a0b6a['red'](_0x41cd69(0x164)+_0xb99ac4[_0x41cd69(0xed)]));_0xb99ac4[_0x41cd69(0x17a)]&&console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x170)](_0x41cd69(0x105)+_0xb99ac4[_0x41cd69(0x17a)])),console[_0x41cd69(0x17b)]();}catch(_0x2cd23b){_0x33a351[_0x41cd69(0x127)]();const _0x21c404=_0x2cd23b instanceof Error?_0x2cd23b[_0x41cd69(0x13c)]:String(_0x2cd23b);console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x125)](_0x41cd69(0x164)+_0x21c404)),console[_0x41cd69(0x17b)](),_0x26983e[_0x41cd69(0x16c)]({'name':_0x55fc55[_0x41cd69(0x158)],'status':_0x41cd69(0xf5),'reason':_0x21c404,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x496a98=Date[_0x41cd69(0x13e)]()-_0x13de04,_0x112a5e=_0x26983e[_0x41cd69(0x103)](_0x23d490=>_0x23d490[_0x41cd69(0x163)]===_0x41cd69(0x12d))['length'],_0x3c8a9d=_0x26983e['filter'](_0x4371a2=>_0x4371a2[_0x41cd69(0x163)]==='FAIL')[_0x41cd69(0x15a)],_0x2508fe=_0x26983e[_0x41cd69(0x103)](_0x59d3f7=>_0x59d3f7['status']===_0x41cd69(0xf5))[_0x41cd69(0x15a)];console[_0x41cd69(0x17b)]('━'['repeat'](0x3c)),console[_0x41cd69(0x17b)](_0x41cd69(0x161)),console[_0x41cd69(0x17b)]('━'[_0x41cd69(0x156)](0x3c)),console[_0x41cd69(0x17b)](_0x41cd69(0x12e)+_0x26983e[_0x41cd69(0x15a)]),console['log']('Passed:\x20\x20\x20'+a5_0x1a0b6a[_0x41cd69(0x112)](_0x112a5e)),console[_0x41cd69(0x17b)](_0x41cd69(0xf8)+a5_0x1a0b6a[_0x41cd69(0x125)](_0x3c8a9d));_0x2508fe>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1a0b6a[_0x41cd69(0x125)](_0x2508fe));console[_0x41cd69(0x17b)](_0x41cd69(0x149)+formatElapsed(_0x496a98)),console['log']('━'[_0x41cd69(0x156)](0x3c));const _0x3d4b6f=_0x26983e['filter'](_0x4c966b=>_0x4c966b[_0x41cd69(0x163)]!=='PASS');if(_0x3d4b6f[_0x41cd69(0x15a)]>0x0){console[_0x41cd69(0x17b)](),console[_0x41cd69(0x17b)](_0x41cd69(0x130));for(const _0x5cdb26 of _0x3d4b6f){const _0x19c57c=a5_0x1a0b6a[_0x41cd69(0x125)]('✗'),_0x4bddbd=_0x5cdb26[_0x41cd69(0xed)][_0x41cd69(0x15a)]>0x32?_0x5cdb26[_0x41cd69(0xed)]['substring'](0x0,0x32)+_0x41cd69(0x126):_0x5cdb26[_0x41cd69(0xed)];console[_0x41cd69(0x17b)]('\x20\x20'+_0x19c57c+'\x20'+_0x5cdb26[_0x41cd69(0x158)]+':\x20'+_0x4bddbd);}}const _0x1c461e={'summary':{'total':_0x26983e[_0x41cd69(0x15a)],'passed':_0x112a5e,'failed':_0x3c8a9d,'errors':_0x2508fe>0x0?_0x2508fe:undefined,'duration_ms':_0x496a98},'tests':_0x26983e,'agent':{'project':_0x3d558a['projectName'],'name':_0x3d558a[_0x41cd69(0x145)],'site':_0x3106af},'timestamp':new Date(_0x13de04)['toISOString']()};try{const _0x4529a4=buildCachedTestRun(_0x2d9a8b,{'site':_0x3106af,'projectId':_0x4de1ef,'projectName':_0x3d558a['projectName'],'agentId':_0x2d8e62,'agentName':_0x3d558a[_0x41cd69(0x145)],'testYmlPath':a5_0x562d42[_0x41cd69(0x15d)](_0x3d558a[_0x41cd69(0x135)])});saveLastTestRun(_0x4529a4);}catch{}if(_0x3aaac8!=='table'||_0x1923fa){const _0x40b549=formatResults(_0x1c461e,_0x3aaac8);if(_0x1923fa)try{a5_0x34bd6e[_0x41cd69(0x10b)](_0x1923fa,_0x40b549,_0x41cd69(0x153)),console['log'](),console[_0x41cd69(0x17b)](a5_0x1a0b6a[_0x41cd69(0x170)](_0x41cd69(0x180)+_0x1923fa));}catch(_0x4e5264){return console[_0x41cd69(0x17b)](),console['log'](a5_0x1a0b6a['red'](_0x41cd69(0xeb)+_0x4e5264)),0x1;}else console['log'](),console[_0x41cd69(0x17b)](_0x40b549);}return _0x3d4b6f['length']>0x0?0x1:0x0;}async[a5_0x31050b(0x142)](_0x21734e,_0x157a86){const _0x31fe02=a5_0x31050b,{options:_0x2c4abb,tdx:_0x3b8cf5}=_0x21734e,{definition:_0x12c905,agentInfo:_0x38a812,outputFormat:_0x483904,outputFile:_0x3a7065}=_0x157a86,_0x77d72a=_0x2c4abb[_0x31fe02(0x132)],_0x39e126=loadLastTestRun();if(!_0x39e126)return console['log'](a5_0x1a0b6a[_0x31fe02(0x125)](_0x31fe02(0xf6))),console['log'](a5_0x1a0b6a[_0x31fe02(0x170)](_0x31fe02(0x101))),0x1;if(_0x39e126[_0x31fe02(0x160)][_0x31fe02(0x145)]!==_0x38a812[_0x31fe02(0x145)])return console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x125)](_0x31fe02(0x129)+_0x39e126[_0x31fe02(0x160)][_0x31fe02(0x145)]+_0x31fe02(0x171)+_0x38a812['agentName']+'\x22.')),console[_0x31fe02(0x17b)](a5_0x1a0b6a['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0xb2ac18=new Set(_0x39e126[_0x31fe02(0x117)][_0x31fe02(0x113)](_0x3dd31e=>_0x3dd31e[_0x31fe02(0x151)])),_0xadde30=_0x12c905['tests'][_0x31fe02(0x103)](_0x46e0f6=>!_0xb2ac18[_0x31fe02(0x120)](_0x46e0f6[_0x31fe02(0x158)]));if(_0xadde30[_0x31fe02(0x15a)]>0x0&&_0x39e126[_0x31fe02(0x132)]!==_0x77d72a)return console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x125)](_0x31fe02(0x17d))),console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x170)](_0x31fe02(0x12c)+_0x39e126['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x77d72a+'\x22.')),console['log'](a5_0x1a0b6a[_0x31fe02(0x170)]('Either\x20switch\x20to\x20the\x20\x22'+_0x39e126[_0x31fe02(0x132)]+_0x31fe02(0x111))),0x1;const _0x325789=_0x12c905[_0x31fe02(0x17f)][_0x31fe02(0x103)](_0x13f66a=>_0xb2ac18[_0x31fe02(0x120)](_0x13f66a[_0x31fe02(0x158)])),_0x54d6d8=_0xadde30;let _0x494e18;try{_0x494e18=await setupEvaluatorAgent(_0x3b8cf5[_0x31fe02(0x14d)],_0x2c4abb['verbose']);}catch(_0x1e004e){const _0x1295b1=_0x1e004e instanceof Error?_0x1e004e[_0x31fe02(0x13c)]:String(_0x1e004e);return console['log'](a5_0x1a0b6a['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1295b1)),0x1;}console['log'](a5_0x1a0b6a[_0x31fe02(0x17c)](_0x31fe02(0x17e))),console[_0x31fe02(0x17b)](_0x31fe02(0x146)+a5_0x1a0b6a['white'](_0x39e126[_0x31fe02(0x11a)])),console[_0x31fe02(0x17b)](_0x31fe02(0x116)+a5_0x1a0b6a[_0x31fe02(0xe6)](_0x39e126[_0x31fe02(0x160)][_0x31fe02(0x179)]+'/'+_0x39e126[_0x31fe02(0x160)][_0x31fe02(0x145)]));_0x54d6d8[_0x31fe02(0x15a)]>0x0&&console['log'](_0x31fe02(0x14e)+a5_0x1a0b6a['yellow'](_0x54d6d8[_0x31fe02(0x15a)]));console[_0x31fe02(0x17b)]();const _0x162913=[],_0x5b4d6f=Date[_0x31fe02(0x13e)](),_0x5c566f=createCommandSpinner(_0x31fe02(0x152));if(_0x325789[_0x31fe02(0x15a)]>0x0)try{const _0x47abfe=await reevaluateFromCache(_0x3b8cf5[_0x31fe02(0x14d)],_0x39e126,{'tests':_0x325789},{'evaluatorId':_0x494e18,'onTestStart':(_0x58f3a2,_0x32cd58,_0x193170)=>{const _0x4bd887=_0x31fe02;_0x5c566f[_0x4bd887(0x11c)]=_0x4bd887(0x178)+(_0x32cd58+0x1)+'/'+_0x193170+':\x20'+_0x58f3a2+_0x4bd887(0x126);if(!_0x5c566f[_0x4bd887(0x147)])_0x5c566f['start']();},'onTestComplete':(_0x2159ba,_0x56c530)=>{const _0x253b87=_0x31fe02;_0x5c566f[_0x253b87(0x127)]();if(_0x56c530[_0x253b87(0x163)]===_0x253b87(0x12d))console[_0x253b87(0x17b)](a5_0x1a0b6a[_0x253b87(0x112)](_0x253b87(0x137)+_0x2159ba)+a5_0x1a0b6a[_0x253b87(0x170)](_0x253b87(0x165)));else _0x56c530[_0x253b87(0x163)]==='FAIL'?console[_0x253b87(0x17b)](a5_0x1a0b6a[_0x253b87(0x125)](_0x253b87(0x118)+_0x2159ba+_0x253b87(0xf1)+_0x56c530[_0x253b87(0xed)])+a5_0x1a0b6a[_0x253b87(0x170)]('\x20(cached)')):console[_0x253b87(0x17b)](a5_0x1a0b6a[_0x253b87(0x125)](_0x253b87(0x164)+_0x2159ba+'\x20-\x20'+_0x56c530['reason']));_0x56c530[_0x253b87(0x17a)]&&console['log'](a5_0x1a0b6a['dim'](_0x253b87(0xf4)+_0x56c530[_0x253b87(0x17a)])),_0x162913['push'](_0x56c530);},'onTestSkipped':(_0x1e8de8,_0x19c678)=>{const _0x434cee=_0x31fe02;_0x5c566f['stop'](),console[_0x434cee(0x17b)](a5_0x1a0b6a[_0x434cee(0x14f)](_0x434cee(0x141)+_0x1e8de8+_0x434cee(0xf1)+_0x19c678));}});for(const _0x2cbcd0 of _0x47abfe){!_0x162913[_0x31fe02(0x139)](_0x39f0c7=>_0x39f0c7[_0x31fe02(0x158)]===_0x2cbcd0[_0x31fe02(0x158)])&&_0x162913[_0x31fe02(0x16c)](_0x2cbcd0);}}catch(_0x4597dd){_0x5c566f[_0x31fe02(0x127)]();const _0x93c1fb=_0x4597dd instanceof Error?_0x4597dd[_0x31fe02(0x13c)]:String(_0x4597dd);return console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x125)](_0x31fe02(0xef)+_0x93c1fb)),0x1;}_0x5c566f[_0x31fe02(0x127)]();if(_0x54d6d8[_0x31fe02(0x15a)]>0x0){console[_0x31fe02(0x17b)](),console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x17c)](_0x31fe02(0x16a)));const {projectId:_0x4e324c,agentId:_0x2d99b7}=_0x39e126[_0x31fe02(0x160)];for(const _0x39e204 of _0x54d6d8){console[_0x31fe02(0x17b)](_0x31fe02(0x177)+a5_0x1a0b6a[_0x31fe02(0xe6)](_0x39e204[_0x31fe02(0x158)]));const _0xfa0060=createCommandSpinner('Round\x201/'+_0x39e204['rounds'][_0x31fe02(0x15a)]+_0x31fe02(0x115));_0xfa0060[_0x31fe02(0x14b)]();try{const {result:_0x43633c}=await runTest(_0x3b8cf5[_0x31fe02(0x14d)],_0x39e204,{'agentId':_0x2d99b7,'projectId':_0x4e324c,'site':_0x39e126['site'],'noEval':![],'evaluatorId':_0x494e18,'onRoundStart':(_0x587396,_0x1416f4)=>{const _0xab7a47=_0x31fe02;_0xfa0060[_0xab7a47(0x11c)]='Round\x20'+(_0x587396+0x1)+'/'+_0x1416f4+_0xab7a47(0x115);},'onRoundComplete':(_0x3966b6,_0x235601,_0x56538a)=>{const _0x149230=_0x31fe02,_0x54e170=formatElapsed(_0x235601);_0x56538a?console['log']('\x20\x20Round\x20'+(_0x3966b6+0x1)+'/'+_0x39e204[_0x149230(0x175)][_0x149230(0x15a)]+_0x149230(0x140)+a5_0x1a0b6a[_0x149230(0x112)]('✓')+'\x20('+_0x54e170+')'):console[_0x149230(0x17b)](_0x149230(0x16f)+(_0x3966b6+0x1)+'/'+_0x39e204[_0x149230(0x175)][_0x149230(0x15a)]+_0x149230(0x140)+a5_0x1a0b6a[_0x149230(0x125)]('✗'));},'onEvaluationStart':()=>{_0xfa0060['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x579147=>{const _0x113247=_0x31fe02,_0x3ebf64=formatElapsed(_0x579147);console[_0x113247(0x17b)](_0x113247(0x16e)+a5_0x1a0b6a['green']('✓')+'\x20('+_0x3ebf64+')');}});_0xfa0060['stop'](),_0x162913[_0x31fe02(0x16c)](_0x43633c);if(_0x43633c[_0x31fe02(0x163)]==='PASS')console[_0x31fe02(0x17b)](a5_0x1a0b6a['green'](_0x31fe02(0x137)+_0x43633c[_0x31fe02(0xed)])+a5_0x1a0b6a[_0x31fe02(0x170)]('\x20(new)'));else _0x43633c[_0x31fe02(0x163)]===_0x31fe02(0x148)?console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x125)](_0x31fe02(0x118)+_0x43633c[_0x31fe02(0xed)])+a5_0x1a0b6a[_0x31fe02(0x170)](_0x31fe02(0x133))):console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x125)](_0x31fe02(0x164)+_0x43633c[_0x31fe02(0xed)]));_0x43633c['conversation_url']&&console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x170)](_0x31fe02(0xf4)+_0x43633c['conversation_url']));}catch(_0x27f0d3){_0xfa0060[_0x31fe02(0x127)]();const _0x3f4e03=_0x27f0d3 instanceof Error?_0x27f0d3['message']:String(_0x27f0d3);console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x125)]('✗\x20ERROR:\x20'+_0x3f4e03)),_0x162913[_0x31fe02(0x16c)]({'name':_0x39e204[_0x31fe02(0x158)],'status':'ERROR','reason':_0x3f4e03,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x31fe02(0x17b)]();const _0x371634=Date[_0x31fe02(0x13e)]()-_0x5b4d6f,_0x411f68=_0x162913[_0x31fe02(0x103)](_0x4e6fe5=>_0x4e6fe5[_0x31fe02(0x163)]===_0x31fe02(0x12d))[_0x31fe02(0x15a)],_0x2e46e9=_0x162913[_0x31fe02(0x103)](_0x29c886=>_0x29c886[_0x31fe02(0x163)]===_0x31fe02(0x148))['length'],_0x51a13b=_0x162913[_0x31fe02(0x103)](_0x11dce9=>_0x11dce9[_0x31fe02(0x163)]===_0x31fe02(0xf5))[_0x31fe02(0x15a)];console[_0x31fe02(0x17b)]('━'[_0x31fe02(0x156)](0x3c)),console[_0x31fe02(0x17b)](_0x31fe02(0x100)),console[_0x31fe02(0x17b)]('━'[_0x31fe02(0x156)](0x3c)),console['log'](_0x31fe02(0x12e)+_0x162913[_0x31fe02(0x15a)]),console['log']('Passed:\x20\x20\x20'+a5_0x1a0b6a[_0x31fe02(0x112)](_0x411f68)),console[_0x31fe02(0x17b)](_0x31fe02(0xf8)+a5_0x1a0b6a[_0x31fe02(0x125)](_0x2e46e9));_0x51a13b>0x0&&console[_0x31fe02(0x17b)](_0x31fe02(0x104)+a5_0x1a0b6a[_0x31fe02(0x125)](_0x51a13b));console[_0x31fe02(0x17b)](_0x31fe02(0x149)+formatElapsed(_0x371634)),console[_0x31fe02(0x17b)]('━'[_0x31fe02(0x156)](0x3c));const _0xcc6acf={'summary':{'total':_0x162913['length'],'passed':_0x411f68,'failed':_0x2e46e9,'errors':_0x51a13b>0x0?_0x51a13b:undefined,'duration_ms':_0x371634},'tests':_0x162913,'agent':{'project':_0x38a812['projectName'],'name':_0x38a812[_0x31fe02(0x145)],'site':_0x77d72a},'timestamp':new Date(_0x5b4d6f)[_0x31fe02(0xf7)]()};if(_0x483904!=='table'||_0x3a7065){const _0x95471f=formatResults(_0xcc6acf,_0x483904);if(_0x3a7065)try{a5_0x34bd6e[_0x31fe02(0x10b)](_0x3a7065,_0x95471f,_0x31fe02(0x153)),console[_0x31fe02(0x17b)](),console[_0x31fe02(0x17b)](a5_0x1a0b6a[_0x31fe02(0x170)](_0x31fe02(0x180)+_0x3a7065));}catch(_0x2386ef){return console['log'](),console[_0x31fe02(0x17b)](a5_0x1a0b6a['red']('Error\x20writing\x20output\x20file:\x20'+_0x2386ef)),0x1;}else console['log'](),console[_0x31fe02(0x17b)](_0x95471f);}const _0xcbc3a3=_0x162913[_0x31fe02(0x103)](_0x5e3221=>_0x5e3221[_0x31fe02(0x163)]!=='PASS');return _0xcbc3a3[_0x31fe02(0x15a)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x3628a1=a5_0x330e;function a5_0x330e(_0x394d36,_0x480c52){_0x394d36=_0x394d36-0x167;const _0x20bafe=a5_0x20ba();let _0x330e32=_0x20bafe[_0x394d36];return _0x330e32;}(function(_0x574998,_0x2da5eb){const _0x4e8071=a5_0x330e,_0x1320d3=_0x574998();while(!![]){try{const _0x53fea7=-parseInt(_0x4e8071(0x17c))/0x1+parseInt(_0x4e8071(0x1f1))/0x2*(parseInt(_0x4e8071(0x189))/0x3)+parseInt(_0x4e8071(0x1fb))/0x4+parseInt(_0x4e8071(0x170))/0x5+-parseInt(_0x4e8071(0x194))/0x6+parseInt(_0x4e8071(0x1e3))/0x7+-parseInt(_0x4e8071(0x1ba))/0x8;if(_0x53fea7===_0x2da5eb)break;else _0x1320d3['push'](_0x1320d3['shift']());}catch(_0x31f25c){_0x1320d3['push'](_0x1320d3['shift']());}}}(a5_0x20ba,0x9ebdb));import*as a5_0x90e4db from'node:fs';import*as a5_0x390327 from'node:path';import a5_0x38cb53 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x20ba(){const _0x207276=['start','\x27\x20to\x20create\x20the\x20folder\x20structure.','cyan','rounds','834110PGJwxO','repeat','Duration:\x20','verbose','eval','trim','json','red','Output\x20written\x20to:\x20','forEach','2522704RauEMG','add','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','found','✗\x20FAIL:\x20','reeval','stop','now','testName','yellow','✗\x20ERROR:\x20Project\x20not\x20found:\x20','projectName','no_tests','\x20\x20-\x20','3597325oixAGb','join','Either\x20switch\x20to\x20the\x20\x22','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','filter','\x20(new)','ERROR','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20\x20Project:\x20','jsonl','No\x20tests\x20have\x20tags\x20defined.','has','110217rXCjAF','split','map','conversation_url','Error:\x20No\x20previous\x20test\x20run\x20found.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','log','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Passed:\x20\x20\x20','\x20\x20Round\x20','PASS','llm','\x22,\x20but\x20current\x20site\x20is\x20\x22','9MAKArg','dryRun','Re-evaluating\x20cached\x20test\x20run...','Total:\x20\x20\x20\x20','Cached\x20run\x20from:\x20','white','site','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Available\x20tests:\x20','resolveProjectId','New\x20tests\x20to\x20execute:\x20','1522548bDvSNO','description','toISOString','Site:\x20','agent','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x22:\x20','Usage:','404',':\x20Sending\x20user\x20input...','dim','no_context','table','tsv','Error\x20writing\x20output\x20file:\x20','Executing\x20new\x20tests...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','...\x20','Evaluating\x20response...','resolve','✗\x20ERROR:\x20','Tests\x20found:\x20','testYmlPath','source','agentName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','tags','Conversation\x20URL:\x20','writeFileSync','Test\x20Configuration:','toLowerCase','Running\x20agent\x20tests...','No\x20tests\x20found\x20matching:\x20','Project\x20path:\x20','includes','Failed:\x20\x20\x20','\x20\x20Agent:\x20','✓\x20PASS:\x20','17332280wFvGit','push','Agent:\x20','No\x20tests\x20found\x20with\x20tags:\x20','resolveAgentId','\x20(cached)','\x20\x20Site:\x20','message','green','Re-evaluating\x20','Round\x201/','basename','size','Available\x20tags:\x20','Running:\x20','tests','Failed\x20Tests:','text','⚠\x20SKIPPED:\x20','\x20-\x20','Round\x20','utf-8','substring','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','llmProject','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Run\x20\x27tdx\x20agent\x20pull\x20','agentDirs','executeReeval','test.yml','FAIL','Errors:\x20\x20\x20','multiple_agents','find','\x20\x20Evaluating...\x20','execute','agent:test','\x20\x20Conversation:\x20','Running\x20test:\x20','...','reason','4055849hoITWN','length','Using\x20agent:\x20','Re-evaluating...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','some','timestamp','projectDir','name','status'];a5_0x20ba=function(){return _0x207276;};return a5_0x20ba();}export class AgentTestCommand extends BaseCommand{[a5_0x3628a1(0x1eb)]=a5_0x3628a1(0x1de);[a5_0x3628a1(0x195)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x3628a1(0x1dd)](_0x19fe5d){const _0x1e7018=a5_0x3628a1,{options:_0x4a6ab8,args:_0x6f7d,tdx:_0x54d8cf}=_0x19fe5d,_0x370869=_0x6f7d[0x0]||'.',_0x5d5f3d=_0x4a6ab8[_0x1e7018(0x18a)],_0x18bc40=_0x4a6ab8,_0x27fec8=_0x18bc40[_0x1e7018(0x1f5)]===![],_0x3aaf08=_0x18bc40[_0x1e7018(0x167)],_0x406343=_0x18bc40[_0x1e7018(0x1eb)],_0x310863=_0x18bc40[_0x1e7018(0x1ae)],_0x4cc472=_0x4a6ab8[_0x1e7018(0x18f)],_0x2fc1d4=_0x18bc40['output'];if(_0x3aaf08&&_0x27fec8)return console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x173))),0x1;let _0x1bdaec=_0x1e7018(0x1a0);if(_0x18bc40[_0x1e7018(0x1f7)])_0x1bdaec='json';else{if(_0x18bc40[_0x1e7018(0x179)])_0x1bdaec='jsonl';else{if(_0x18bc40[_0x1e7018(0x1a1)])_0x1bdaec=_0x1e7018(0x1a1);else{if(_0x18bc40[_0x1e7018(0x1a0)])_0x1bdaec=_0x1e7018(0x1a0);}}}const _0x17c10b=_0x18bc40[_0x1e7018(0x1d2)];let _0x367513=_0x370869;const _0xfe0473=a5_0x90e4db['existsSync'](_0x370869),_0x4da76f=_0x370869==='.';if(!_0xfe0473||_0x4da76f){const _0x5f2360=resolveProjectFromContext(_0x370869,_0x17c10b,{'requireFile':_0x1e7018(0x1d7)});if(_0x5f2360[_0x1e7018(0x1fe)])_0x367513=_0x5f2360[_0x1e7018(0x1ea)],_0x5f2360[_0x1e7018(0x1ab)]==='context'&&console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1e5)+_0x367513));else switch(_0x5f2360[_0x1e7018(0x1e2)]){case _0x1e7018(0x19f):console['log'](a5_0x38cb53[_0x1e7018(0x16b)](_0x5f2360[_0x1e7018(0x1c1)])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x19b)),console[_0x1e7018(0x182)](_0x1e7018(0x183)),console[_0x1e7018(0x182)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1fd));return 0x1;case'no_local_folder':console['log'](a5_0x38cb53['yellow'](_0x5f2360['message'])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1d4)+_0x5f2360[_0x1e7018(0x1d2)]+_0x1e7018(0x1ee));return 0x1;case _0x1e7018(0x1da):{const _0x56eb9a=a5_0x390327[_0x1e7018(0x1c5)](_0x5f2360[_0x1e7018(0x1ea)]);console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x16b)](_0x1e7018(0x1ad)+_0x5f2360[_0x1e7018(0x1d2)]+'\x22:'));for(const _0x1ef167 of _0x5f2360[_0x1e7018(0x1d5)]){console['log'](_0x1e7018(0x16f)+_0x1ef167);}return console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x181)+_0x56eb9a+'/<agent-name>'),0x1;}case _0x1e7018(0x16e):console['log'](a5_0x38cb53[_0x1e7018(0x16b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5f2360[_0x1e7018(0x1d2)]+'\x22.')),console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1b5)+_0x5f2360[_0x1e7018(0x1ea)])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1e7));return 0x1;}}const {definition:_0x1045b5,agentInfo:_0xf1ede8}=parseTestFile(_0x367513);let _0x381dc9=_0x1045b5['tests'];if(_0x406343){const _0x42b402=_0x406343[_0x1e7018(0x17d)](',')[_0x1e7018(0x17e)](_0x26a3e0=>_0x26a3e0[_0x1e7018(0x1f6)]());_0x381dc9=_0x1045b5[_0x1e7018(0x1c9)][_0x1e7018(0x174)](_0x2ab366=>_0x42b402[_0x1e7018(0x1b6)](_0x2ab366[_0x1e7018(0x1eb)]));if(_0x381dc9[_0x1e7018(0x1e4)]===0x0)return console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x16b)](_0x1e7018(0x1b4)+_0x406343)),console['log'](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x191)+_0x1045b5['tests'][_0x1e7018(0x17e)](_0x426170=>_0x426170[_0x1e7018(0x1eb)])['join'](',\x20'))),0x1;}if(_0x310863){const _0x50d5cc=_0x310863[_0x1e7018(0x17d)](',')[_0x1e7018(0x17e)](_0x4c813f=>_0x4c813f[_0x1e7018(0x1f6)]()[_0x1e7018(0x1b2)]());_0x381dc9=_0x381dc9['filter'](_0x48c9b4=>_0x48c9b4[_0x1e7018(0x1ae)]?.[_0x1e7018(0x1e8)](_0x81f21b=>_0x50d5cc[_0x1e7018(0x1b6)](_0x81f21b['toLowerCase']())));if(_0x381dc9[_0x1e7018(0x1e4)]===0x0){console['log'](a5_0x38cb53[_0x1e7018(0x16b)](_0x1e7018(0x1bd)+_0x310863));const _0x56cbaf=new Set();return _0x1045b5[_0x1e7018(0x1c9)][_0x1e7018(0x1fa)](_0x426564=>_0x426564['tags']?.[_0x1e7018(0x1fa)](_0x3e2839=>_0x56cbaf[_0x1e7018(0x1fc)](_0x3e2839))),_0x56cbaf[_0x1e7018(0x1c6)]>0x0?console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1c7)+[..._0x56cbaf][_0x1e7018(0x171)](',\x20'))):console[_0x1e7018(0x182)](a5_0x38cb53['dim'](_0x1e7018(0x17a))),0x1;}}if(_0x3aaf08)return this['executeReeval'](_0x19fe5d,{'definition':{'tests':_0x381dc9},'agentInfo':_0xf1ede8,'outputFormat':_0x1bdaec,'outputFile':_0x2fc1d4,'testNames':_0x406343});if(_0x5d5f3d){console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1ef)](_0x1e7018(0x1b1))),console['log'](_0x1e7018(0x1c0)+a5_0x38cb53[_0x1e7018(0x18e)](_0x4cc472)),console[_0x1e7018(0x182)](_0x1e7018(0x178)+a5_0x38cb53[_0x1e7018(0x18e)](_0xf1ede8['projectName'])),console[_0x1e7018(0x182)](_0x1e7018(0x1b8)+a5_0x38cb53['white'](_0xf1ede8[_0x1e7018(0x1ac)])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1a9)+a5_0x38cb53[_0x1e7018(0x18e)](_0x381dc9[_0x1e7018(0x1e4)]));for(let _0x1a40a3=0x0;_0x1a40a3<_0x381dc9[_0x1e7018(0x1e4)];_0x1a40a3++){const _0x3dde68=_0x381dc9[_0x1a40a3],_0x1755bd=_0x3dde68[_0x1e7018(0x1f0)][_0x1e7018(0x1e4)]===0x1?'round':_0x1e7018(0x1f0),_0x46d998=_0x3dde68['tags']?.[_0x1e7018(0x1e4)]?'\x20['+_0x3dde68[_0x1e7018(0x1ae)][_0x1e7018(0x171)](',\x20')+']':'';console[_0x1e7018(0x182)]('\x20\x20'+(_0x1a40a3+0x1)+'.\x20'+a5_0x38cb53[_0x1e7018(0x18e)](_0x3dde68[_0x1e7018(0x1eb)])+'\x20('+_0x3dde68['rounds'][_0x1e7018(0x1e4)]+'\x20'+_0x1755bd+')'+a5_0x38cb53[_0x1e7018(0x19e)](_0x46d998));}return 0x0;}let _0x372212,_0x59b3ae;try{_0x372212=await _0x54d8cf[_0x1e7018(0x187)][_0x1e7018(0x192)](_0xf1ede8['projectName']);}catch(_0x45eb10){const _0x2247f6=_0x45eb10 instanceof Error?_0x45eb10[_0x1e7018(0x1c1)]:String(_0x45eb10);return _0x2247f6['includes'](_0x1e7018(0x19c))||_0x2247f6[_0x1e7018(0x1b2)]()['includes']('not\x20found')?console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x16c)+_0xf1ede8[_0x1e7018(0x16d)])):console['log'](a5_0x38cb53[_0x1e7018(0x1f8)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xf1ede8[_0x1e7018(0x16d)]+_0x1e7018(0x19a)+_0x2247f6)),0x1;}try{_0x59b3ae=await _0x54d8cf[_0x1e7018(0x187)][_0x1e7018(0x1be)](_0xf1ede8['agentName'],_0x372212);}catch(_0x12446f){const _0x120cb3=_0x12446f instanceof Error?_0x12446f[_0x1e7018(0x1c1)]:String(_0x12446f);return _0x120cb3[_0x1e7018(0x1b6)](_0x1e7018(0x19c))||_0x120cb3[_0x1e7018(0x1b2)]()[_0x1e7018(0x1b6)]('not\x20found')?console['log'](a5_0x38cb53[_0x1e7018(0x1f8)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xf1ede8[_0x1e7018(0x1ac)])):console[_0x1e7018(0x182)](a5_0x38cb53['red'](_0x1e7018(0x1d1)+_0xf1ede8[_0x1e7018(0x1ac)]+_0x1e7018(0x19a)+_0x120cb3)),0x1;}let _0x1b1981;if(!_0x27fec8)try{_0x1b1981=await setupEvaluatorAgent(_0x54d8cf[_0x1e7018(0x187)],_0x4a6ab8[_0x1e7018(0x1f4)]);}catch(_0x15af70){const _0x360b64=_0x15af70 instanceof Error?_0x15af70[_0x1e7018(0x1c1)]:String(_0x15af70);return console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1a4)+_0x360b64)),0x1;}console[_0x1e7018(0x182)](a5_0x38cb53['cyan'](_0x1e7018(0x1b3))),console[_0x1e7018(0x182)](_0x1e7018(0x197)+a5_0x38cb53['white'](_0x4cc472)),console['log'](_0x1e7018(0x1bc)+a5_0x38cb53[_0x1e7018(0x18e)](_0xf1ede8['projectName']+'/'+_0xf1ede8[_0x1e7018(0x1ac)])),console[_0x1e7018(0x182)]();const _0x45e0c6=[],_0x421bf8=[],_0x5a67b9=Date[_0x1e7018(0x169)]();for(let _0x5ca2c6=0x0;_0x5ca2c6<_0x381dc9[_0x1e7018(0x1e4)];_0x5ca2c6++){const _0x31b6cd=_0x381dc9[_0x5ca2c6];_0x381dc9[_0x1e7018(0x1e4)]>0x1?console['log']('Test\x20'+(_0x5ca2c6+0x1)+'/'+_0x381dc9['length']+':\x20'+a5_0x38cb53['white'](_0x31b6cd[_0x1e7018(0x1eb)])):console[_0x1e7018(0x182)](_0x1e7018(0x1e0)+a5_0x38cb53[_0x1e7018(0x18e)](_0x31b6cd['name']));const _0x4522d8=createCommandSpinner(_0x1e7018(0x1c4)+_0x31b6cd[_0x1e7018(0x1f0)][_0x1e7018(0x1e4)]+':\x20Sending\x20user\x20input...');_0x4522d8[_0x1e7018(0x1ed)]();try{const {result:_0x579b56,conversation:_0x3518aa}=await runTest(_0x54d8cf[_0x1e7018(0x187)],_0x31b6cd,{'agentId':_0x59b3ae,'projectId':_0x372212,'site':_0x4cc472,'noEval':_0x27fec8,'evaluatorId':_0x1b1981,'onRoundStart':(_0x1b377d,_0x51768c)=>{const _0x5e6d52=_0x1e7018;_0x4522d8[_0x5e6d52(0x1cb)]=_0x5e6d52(0x1ce)+(_0x1b377d+0x1)+'/'+_0x51768c+_0x5e6d52(0x19d);},'onRoundComplete':(_0x2277be,_0x31978b,_0x264455)=>{const _0x30dd6f=_0x1e7018,_0x2a8f95=formatElapsed(_0x31978b);_0x264455?console[_0x30dd6f(0x182)](_0x30dd6f(0x185)+(_0x2277be+0x1)+'/'+_0x31b6cd[_0x30dd6f(0x1f0)]['length']+_0x30dd6f(0x1a5)+a5_0x38cb53[_0x30dd6f(0x1c2)]('✓')+'\x20('+_0x2a8f95+')'):console[_0x30dd6f(0x182)](_0x30dd6f(0x185)+(_0x2277be+0x1)+'/'+_0x31b6cd[_0x30dd6f(0x1f0)][_0x30dd6f(0x1e4)]+_0x30dd6f(0x1a5)+a5_0x38cb53[_0x30dd6f(0x1f8)]('✗'));},'onEvaluationStart':()=>{const _0x296dee=_0x1e7018;_0x4522d8[_0x296dee(0x1cb)]=_0x296dee(0x1a6);},'onEvaluationComplete':_0x2da0b5=>{const _0x21553a=_0x1e7018,_0x4afd91=formatElapsed(_0x2da0b5);console[_0x21553a(0x182)]('\x20\x20Evaluating...\x20'+a5_0x38cb53[_0x21553a(0x1c2)]('✓')+'\x20('+_0x4afd91+')');}});_0x4522d8[_0x1e7018(0x168)](),_0x45e0c6[_0x1e7018(0x1bb)](_0x579b56),_0x421bf8[_0x1e7018(0x1bb)](_0x3518aa);if(_0x579b56[_0x1e7018(0x1ec)]===_0x1e7018(0x186))console[_0x1e7018(0x182)](a5_0x38cb53['green'](_0x1e7018(0x1b9)+_0x579b56[_0x1e7018(0x1e2)]));else _0x579b56[_0x1e7018(0x1ec)]===_0x1e7018(0x1d8)?console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1ff)+_0x579b56[_0x1e7018(0x1e2)])):console['log'](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1a8)+_0x579b56[_0x1e7018(0x1e2)]));_0x579b56[_0x1e7018(0x17f)]&&console['log'](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1af)+_0x579b56[_0x1e7018(0x17f)])),console[_0x1e7018(0x182)]();}catch(_0x12f2c9){_0x4522d8[_0x1e7018(0x168)]();const _0x46987a=_0x12f2c9 instanceof Error?_0x12f2c9[_0x1e7018(0x1c1)]:String(_0x12f2c9);console[_0x1e7018(0x182)](a5_0x38cb53['red'](_0x1e7018(0x1a8)+_0x46987a)),console[_0x1e7018(0x182)](),_0x45e0c6[_0x1e7018(0x1bb)]({'name':_0x31b6cd['name'],'status':_0x1e7018(0x176),'reason':_0x46987a,'timestamp':new Date()[_0x1e7018(0x196)](),'duration_ms':0x0});}}const _0x132105=Date[_0x1e7018(0x169)]()-_0x5a67b9,_0x4b0307=_0x45e0c6[_0x1e7018(0x174)](_0x332844=>_0x332844[_0x1e7018(0x1ec)]===_0x1e7018(0x186))[_0x1e7018(0x1e4)],_0x55faa0=_0x45e0c6['filter'](_0x287d24=>_0x287d24[_0x1e7018(0x1ec)]===_0x1e7018(0x1d8))[_0x1e7018(0x1e4)],_0x10feb6=_0x45e0c6[_0x1e7018(0x174)](_0xdce649=>_0xdce649[_0x1e7018(0x1ec)]===_0x1e7018(0x176))[_0x1e7018(0x1e4)];console[_0x1e7018(0x182)]('━'[_0x1e7018(0x1f2)](0x3c)),console[_0x1e7018(0x182)]('Test\x20Summary'),console[_0x1e7018(0x182)]('━'[_0x1e7018(0x1f2)](0x3c)),console[_0x1e7018(0x182)](_0x1e7018(0x18c)+_0x45e0c6['length']),console[_0x1e7018(0x182)](_0x1e7018(0x184)+a5_0x38cb53[_0x1e7018(0x1c2)](_0x4b0307)),console[_0x1e7018(0x182)](_0x1e7018(0x1b7)+a5_0x38cb53[_0x1e7018(0x1f8)](_0x55faa0));_0x10feb6>0x0&&console[_0x1e7018(0x182)](_0x1e7018(0x1d9)+a5_0x38cb53[_0x1e7018(0x1f8)](_0x10feb6));console[_0x1e7018(0x182)](_0x1e7018(0x1f3)+formatElapsed(_0x132105)),console[_0x1e7018(0x182)]('━'[_0x1e7018(0x1f2)](0x3c));const _0x2d6322=_0x45e0c6[_0x1e7018(0x174)](_0x43d514=>_0x43d514[_0x1e7018(0x1ec)]!==_0x1e7018(0x186));if(_0x2d6322[_0x1e7018(0x1e4)]>0x0){console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1ca));for(const _0x2a197f of _0x2d6322){const _0x599c98=a5_0x38cb53[_0x1e7018(0x1f8)]('✗'),_0x590d26=_0x2a197f[_0x1e7018(0x1e2)]['length']>0x32?_0x2a197f[_0x1e7018(0x1e2)][_0x1e7018(0x1d0)](0x0,0x32)+'...':_0x2a197f[_0x1e7018(0x1e2)];console[_0x1e7018(0x182)]('\x20\x20'+_0x599c98+'\x20'+_0x2a197f[_0x1e7018(0x1eb)]+':\x20'+_0x590d26);}}const _0x3648a2={'summary':{'total':_0x45e0c6[_0x1e7018(0x1e4)],'passed':_0x4b0307,'failed':_0x55faa0,'errors':_0x10feb6>0x0?_0x10feb6:undefined,'duration_ms':_0x132105},'tests':_0x45e0c6,'agent':{'project':_0xf1ede8[_0x1e7018(0x16d)],'name':_0xf1ede8[_0x1e7018(0x1ac)],'site':_0x4cc472},'timestamp':new Date(_0x5a67b9)['toISOString']()};try{const _0x459374=buildCachedTestRun(_0x421bf8,{'site':_0x4cc472,'projectId':_0x372212,'projectName':_0xf1ede8[_0x1e7018(0x16d)],'agentId':_0x59b3ae,'agentName':_0xf1ede8[_0x1e7018(0x1ac)],'testYmlPath':a5_0x390327[_0x1e7018(0x1a7)](_0xf1ede8[_0x1e7018(0x1aa)])});saveLastTestRun(_0x459374);}catch{}if(_0x1bdaec!==_0x1e7018(0x1a0)||_0x2fc1d4){const _0x1161a7=formatResults(_0x3648a2,_0x1bdaec);if(_0x2fc1d4)try{a5_0x90e4db[_0x1e7018(0x1b0)](_0x2fc1d4,_0x1161a7,_0x1e7018(0x1cf)),console[_0x1e7018(0x182)](),console['log'](a5_0x38cb53['dim'](_0x1e7018(0x1f9)+_0x2fc1d4));}catch(_0x5d82de){return console['log'](),console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1a2)+_0x5d82de)),0x1;}else console[_0x1e7018(0x182)](),console['log'](_0x1161a7);}return _0x2d6322[_0x1e7018(0x1e4)]>0x0?0x1:0x0;}async[a5_0x3628a1(0x1d6)](_0x476253,_0x1023c5){const _0x2edda9=a5_0x3628a1,{options:_0x201950,tdx:_0x16ab15}=_0x476253,{definition:_0x5f8749,agentInfo:_0x4b430e,outputFormat:_0x3d9dc4,outputFile:_0x45747f}=_0x1023c5,_0x2b4ceb=_0x201950[_0x2edda9(0x18f)],_0x86cea=loadLastTestRun();if(!_0x86cea)return console[_0x2edda9(0x182)](a5_0x38cb53['red'](_0x2edda9(0x180))),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x190))),0x1;if(_0x86cea[_0x2edda9(0x198)][_0x2edda9(0x1ac)]!==_0x4b430e[_0x2edda9(0x1ac)])return console['log'](a5_0x38cb53[_0x2edda9(0x1f8)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x86cea[_0x2edda9(0x198)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4b430e[_0x2edda9(0x1ac)]+'\x22.')),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x177))),0x1;const _0x4138df=new Set(_0x86cea['conversations'][_0x2edda9(0x17e)](_0x3cb518=>_0x3cb518[_0x2edda9(0x16a)])),_0x56d391=_0x5f8749[_0x2edda9(0x1c9)][_0x2edda9(0x174)](_0x513b09=>!_0x4138df[_0x2edda9(0x17b)](_0x513b09[_0x2edda9(0x1eb)]));if(_0x56d391['length']>0x0&&_0x86cea['site']!==_0x2b4ceb)return console[_0x2edda9(0x182)](a5_0x38cb53['red'](_0x2edda9(0x1d3))),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x86cea['site']+_0x2edda9(0x188)+_0x2b4ceb+'\x22.')),console[_0x2edda9(0x182)](a5_0x38cb53['dim'](_0x2edda9(0x172)+_0x86cea[_0x2edda9(0x18f)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x3e8010=_0x5f8749[_0x2edda9(0x1c9)][_0x2edda9(0x174)](_0xa4edcd=>_0x4138df[_0x2edda9(0x17b)](_0xa4edcd[_0x2edda9(0x1eb)])),_0x3bafa7=_0x56d391;let _0x247cdd;try{_0x247cdd=await setupEvaluatorAgent(_0x16ab15[_0x2edda9(0x187)],_0x201950[_0x2edda9(0x1f4)]);}catch(_0x3a2a4b){const _0x400bd8=_0x3a2a4b instanceof Error?_0x3a2a4b[_0x2edda9(0x1c1)]:String(_0x3a2a4b);return console[_0x2edda9(0x182)](a5_0x38cb53['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x400bd8)),0x1;}console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1ef)](_0x2edda9(0x18b))),console[_0x2edda9(0x182)](_0x2edda9(0x18d)+a5_0x38cb53['white'](_0x86cea[_0x2edda9(0x1e9)])),console['log'](_0x2edda9(0x1bc)+a5_0x38cb53[_0x2edda9(0x18e)](_0x86cea[_0x2edda9(0x198)][_0x2edda9(0x16d)]+'/'+_0x86cea[_0x2edda9(0x198)][_0x2edda9(0x1ac)]));_0x3bafa7[_0x2edda9(0x1e4)]>0x0&&console['log'](_0x2edda9(0x193)+a5_0x38cb53[_0x2edda9(0x16b)](_0x3bafa7['length']));console[_0x2edda9(0x182)]();const _0x5388d3=[],_0x1eedcd=Date[_0x2edda9(0x169)](),_0x179bdd=createCommandSpinner(_0x2edda9(0x1e6));if(_0x3e8010['length']>0x0)try{const _0x962e6e=await reevaluateFromCache(_0x16ab15['llm'],_0x86cea,{'tests':_0x3e8010},{'evaluatorId':_0x247cdd,'onTestStart':(_0x3f3505,_0x434b35,_0x50355c)=>{const _0x2ebc5d=_0x2edda9;_0x179bdd['text']=_0x2ebc5d(0x1c3)+(_0x434b35+0x1)+'/'+_0x50355c+':\x20'+_0x3f3505+_0x2ebc5d(0x1e1);if(!_0x179bdd['isSpinning'])_0x179bdd[_0x2ebc5d(0x1ed)]();},'onTestComplete':(_0x2542af,_0x4dcaa2)=>{const _0x399d94=_0x2edda9;_0x179bdd[_0x399d94(0x168)]();if(_0x4dcaa2[_0x399d94(0x1ec)]===_0x399d94(0x186))console['log'](a5_0x38cb53['green'](_0x399d94(0x1b9)+_0x2542af)+a5_0x38cb53[_0x399d94(0x19e)](_0x399d94(0x1bf)));else _0x4dcaa2[_0x399d94(0x1ec)]==='FAIL'?console[_0x399d94(0x182)](a5_0x38cb53[_0x399d94(0x1f8)](_0x399d94(0x1ff)+_0x2542af+_0x399d94(0x1cd)+_0x4dcaa2['reason'])+a5_0x38cb53[_0x399d94(0x19e)](_0x399d94(0x1bf))):console['log'](a5_0x38cb53[_0x399d94(0x1f8)](_0x399d94(0x1a8)+_0x2542af+'\x20-\x20'+_0x4dcaa2[_0x399d94(0x1e2)]));_0x4dcaa2[_0x399d94(0x17f)]&&console[_0x399d94(0x182)](a5_0x38cb53[_0x399d94(0x19e)](_0x399d94(0x1df)+_0x4dcaa2[_0x399d94(0x17f)])),_0x5388d3[_0x399d94(0x1bb)](_0x4dcaa2);},'onTestSkipped':(_0x333dad,_0x2bf4df)=>{const _0x5e1bd3=_0x2edda9;_0x179bdd['stop'](),console['log'](a5_0x38cb53[_0x5e1bd3(0x16b)](_0x5e1bd3(0x1cc)+_0x333dad+'\x20-\x20'+_0x2bf4df));}});for(const _0x2c63fb of _0x962e6e){!_0x5388d3[_0x2edda9(0x1db)](_0x3265d2=>_0x3265d2['name']===_0x2c63fb[_0x2edda9(0x1eb)])&&_0x5388d3[_0x2edda9(0x1bb)](_0x2c63fb);}}catch(_0x1e1620){_0x179bdd['stop']();const _0x1be167=_0x1e1620 instanceof Error?_0x1e1620['message']:String(_0x1e1620);return console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1f8)](_0x2edda9(0x199)+_0x1be167)),0x1;}_0x179bdd[_0x2edda9(0x168)]();if(_0x3bafa7[_0x2edda9(0x1e4)]>0x0){console[_0x2edda9(0x182)](),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1ef)](_0x2edda9(0x1a3)));const {projectId:_0x5b117e,agentId:_0x2891ba}=_0x86cea[_0x2edda9(0x198)];for(const _0x5913f6 of _0x3bafa7){console[_0x2edda9(0x182)](_0x2edda9(0x1c8)+a5_0x38cb53[_0x2edda9(0x18e)](_0x5913f6[_0x2edda9(0x1eb)]));const _0x19b058=createCommandSpinner('Round\x201/'+_0x5913f6[_0x2edda9(0x1f0)]['length']+':\x20Sending\x20user\x20input...');_0x19b058[_0x2edda9(0x1ed)]();try{const {result:_0x588130}=await runTest(_0x16ab15[_0x2edda9(0x187)],_0x5913f6,{'agentId':_0x2891ba,'projectId':_0x5b117e,'site':_0x86cea[_0x2edda9(0x18f)],'noEval':![],'evaluatorId':_0x247cdd,'onRoundStart':(_0x106130,_0x40ca65)=>{const _0x40d801=_0x2edda9;_0x19b058[_0x40d801(0x1cb)]=_0x40d801(0x1ce)+(_0x106130+0x1)+'/'+_0x40ca65+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2423bd,_0x19a784,_0x495cfc)=>{const _0x5a2a48=_0x2edda9,_0x40fa44=formatElapsed(_0x19a784);_0x495cfc?console[_0x5a2a48(0x182)]('\x20\x20Round\x20'+(_0x2423bd+0x1)+'/'+_0x5913f6[_0x5a2a48(0x1f0)][_0x5a2a48(0x1e4)]+'...\x20'+a5_0x38cb53[_0x5a2a48(0x1c2)]('✓')+'\x20('+_0x40fa44+')'):console[_0x5a2a48(0x182)](_0x5a2a48(0x185)+(_0x2423bd+0x1)+'/'+_0x5913f6['rounds'][_0x5a2a48(0x1e4)]+_0x5a2a48(0x1a5)+a5_0x38cb53[_0x5a2a48(0x1f8)]('✗'));},'onEvaluationStart':()=>{const _0x26a878=_0x2edda9;_0x19b058[_0x26a878(0x1cb)]='Evaluating\x20response...';},'onEvaluationComplete':_0x533bb3=>{const _0x94187d=_0x2edda9,_0x2eeea4=formatElapsed(_0x533bb3);console[_0x94187d(0x182)](_0x94187d(0x1dc)+a5_0x38cb53['green']('✓')+'\x20('+_0x2eeea4+')');}});_0x19b058[_0x2edda9(0x168)](),_0x5388d3['push'](_0x588130);if(_0x588130[_0x2edda9(0x1ec)]===_0x2edda9(0x186))console['log'](a5_0x38cb53[_0x2edda9(0x1c2)](_0x2edda9(0x1b9)+_0x588130[_0x2edda9(0x1e2)])+a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x175)));else _0x588130[_0x2edda9(0x1ec)]===_0x2edda9(0x1d8)?console[_0x2edda9(0x182)](a5_0x38cb53['red'](_0x2edda9(0x1ff)+_0x588130['reason'])+a5_0x38cb53['dim'](_0x2edda9(0x175))):console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1f8)]('✗\x20ERROR:\x20'+_0x588130[_0x2edda9(0x1e2)]));_0x588130[_0x2edda9(0x17f)]&&console[_0x2edda9(0x182)](a5_0x38cb53['dim'](_0x2edda9(0x1df)+_0x588130[_0x2edda9(0x17f)]));}catch(_0x4ded10){_0x19b058[_0x2edda9(0x168)]();const _0x57907b=_0x4ded10 instanceof Error?_0x4ded10[_0x2edda9(0x1c1)]:String(_0x4ded10);console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1f8)](_0x2edda9(0x1a8)+_0x57907b)),_0x5388d3[_0x2edda9(0x1bb)]({'name':_0x5913f6[_0x2edda9(0x1eb)],'status':_0x2edda9(0x176),'reason':_0x57907b,'timestamp':new Date()[_0x2edda9(0x196)](),'duration_ms':0x0});}}}console['log']();const _0x54144b=Date[_0x2edda9(0x169)]()-_0x1eedcd,_0x525740=_0x5388d3[_0x2edda9(0x174)](_0x454a73=>_0x454a73[_0x2edda9(0x1ec)]===_0x2edda9(0x186))[_0x2edda9(0x1e4)],_0x5d0cf7=_0x5388d3[_0x2edda9(0x174)](_0x52ee9b=>_0x52ee9b['status']==='FAIL')[_0x2edda9(0x1e4)],_0x33518a=_0x5388d3['filter'](_0x407731=>_0x407731[_0x2edda9(0x1ec)]===_0x2edda9(0x176))[_0x2edda9(0x1e4)];console['log']('━'[_0x2edda9(0x1f2)](0x3c)),console[_0x2edda9(0x182)]('Re-evaluation\x20Summary'),console['log']('━'[_0x2edda9(0x1f2)](0x3c)),console[_0x2edda9(0x182)](_0x2edda9(0x18c)+_0x5388d3[_0x2edda9(0x1e4)]),console[_0x2edda9(0x182)](_0x2edda9(0x184)+a5_0x38cb53[_0x2edda9(0x1c2)](_0x525740)),console[_0x2edda9(0x182)](_0x2edda9(0x1b7)+a5_0x38cb53[_0x2edda9(0x1f8)](_0x5d0cf7));_0x33518a>0x0&&console[_0x2edda9(0x182)](_0x2edda9(0x1d9)+a5_0x38cb53[_0x2edda9(0x1f8)](_0x33518a));console[_0x2edda9(0x182)](_0x2edda9(0x1f3)+formatElapsed(_0x54144b)),console[_0x2edda9(0x182)]('━'[_0x2edda9(0x1f2)](0x3c));const _0x470d9c={'summary':{'total':_0x5388d3[_0x2edda9(0x1e4)],'passed':_0x525740,'failed':_0x5d0cf7,'errors':_0x33518a>0x0?_0x33518a:undefined,'duration_ms':_0x54144b},'tests':_0x5388d3,'agent':{'project':_0x4b430e['projectName'],'name':_0x4b430e[_0x2edda9(0x1ac)],'site':_0x2b4ceb},'timestamp':new Date(_0x1eedcd)[_0x2edda9(0x196)]()};if(_0x3d9dc4!==_0x2edda9(0x1a0)||_0x45747f){const _0x207853=formatResults(_0x470d9c,_0x3d9dc4);if(_0x45747f)try{a5_0x90e4db[_0x2edda9(0x1b0)](_0x45747f,_0x207853,_0x2edda9(0x1cf)),console[_0x2edda9(0x182)](),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x1f9)+_0x45747f));}catch(_0x301996){return console[_0x2edda9(0x182)](),console['log'](a5_0x38cb53[_0x2edda9(0x1f8)](_0x2edda9(0x1a2)+_0x301996)),0x1;}else console[_0x2edda9(0x182)](),console['log'](_0x207853);}const _0x52fc2f=_0x5388d3[_0x2edda9(0x174)](_0x11d0c0=>_0x11d0c0[_0x2edda9(0x1ec)]!==_0x2edda9(0x186));return _0x52fc2f[_0x2edda9(0x1e4)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a6_0x52880d=a6_0x1a4a;(function(_0x2a4bf0,_0x35e822){const _0x4b6a14=a6_0x1a4a,_0xb1b935=_0x2a4bf0();while(!![]){try{const _0xeede29=parseInt(_0x4b6a14(0x1e9))/0x1*(parseInt(_0x4b6a14(0x211))/0x2)+parseInt(_0x4b6a14(0x218))/0x3*(parseInt(_0x4b6a14(0x1eb))/0x4)+parseInt(_0x4b6a14(0x1da))/0x5*(-parseInt(_0x4b6a14(0x215))/0x6)+parseInt(_0x4b6a14(0x1fc))/0x7*(parseInt(_0x4b6a14(0x1f0))/0x8)+-parseInt(_0x4b6a14(0x1f1))/0x9+-parseInt(_0x4b6a14(0x1d2))/0xa+-parseInt(_0x4b6a14(0x1ff))/0xb*(-parseInt(_0x4b6a14(0x1df))/0xc);if(_0xeede29===_0x35e822)break;else _0xb1b935['push'](_0xb1b935['shift']());}catch(_0x52e6dc){_0xb1b935['push'](_0xb1b935['shift']());}}}(a6_0x1c83,0xaa05e));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x1a4a(_0x47e917,_0x14efe0){_0x47e917=_0x47e917-0x1d2;const _0x1c8384=a6_0x1c83();let _0x1a4aa6=_0x1c8384[_0x47e917];return _0x1a4aa6;}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x1c83(){const _0x196227=['status','x-trino-user','cookie','1FHzsCE','color','764qqhTai','Error:\x20','file','set-cookie2','error','32pYwras','10841895gkgFUk','toUpperCase','execute','Results\x20saved\x20to\x20','body','PUT','substring','x-xsrf-token','headers','cas','entries','490301jPJdyI','toLowerCase','Invalid\x20HTTP\x20method:\x20','77XHteOI','isArray','verbose','set-cookie','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','llm','keys','noColor','startsWith','cdp','output','data','<\x20HTTP/1.1\x20','authorization','has','header','DELETE','POST','2631638OLrSQD','proxy-authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','site','6RihyYD','length','method','8334PohKZL','11421660KBChRX','message','GET','api','stack','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Invalid\x20API\x20type:\x20','trim','1005115NkkHcF','description','request','type','join','1916004tnWZkG','trino','llm-proxy','includes','name','.\x20Valid\x20methods:\x20','\x0aStack\x20trace:\x0a'];a6_0x1c83=function(){return _0x196227;};return a6_0x1c83();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x52880d(0x20c),a6_0x52880d(0x212),a6_0x52880d(0x1e8),a6_0x52880d(0x202),a6_0x52880d(0x1ee),a6_0x52880d(0x1f8),'x-auth-token',a6_0x52880d(0x1e7)]);function isSensitiveHeader(_0x50f74b){const _0x4be07f=a6_0x52880d;return SENSITIVE_HEADERS[_0x4be07f(0x20d)](_0x50f74b[_0x4be07f(0x1fd)]());}function parseHeader(_0x269edd){const _0x1b7a3b=a6_0x52880d,_0x589c7d=_0x269edd['indexOf'](':');if(_0x589c7d===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x269edd+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x2f4d26=_0x269edd[_0x1b7a3b(0x1f7)](0x0,_0x589c7d)[_0x1b7a3b(0x1d9)](),_0x19c989=_0x269edd['substring'](_0x589c7d+0x1)[_0x1b7a3b(0x1d9)]();if(!_0x2f4d26)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x269edd+'\x22');return[_0x2f4d26,_0x19c989];}export class ApiCommand extends BaseCommand{[a6_0x52880d(0x1e3)]=a6_0x52880d(0x1d5);[a6_0x52880d(0x1db)]=a6_0x52880d(0x203);['validate'](_0x3b6eab){const _0x3c3798=a6_0x52880d,{args:_0x36e8de,options:_0x109bb0}=_0x3b6eab,_0x30b8f0=_0x109bb0;if(_0x36e8de[_0x3c3798(0x216)]===0x0)return _0x3c3798(0x1d7);const _0x43c8ff=_0x36e8de[0x0];if(!_0x43c8ff[_0x3c3798(0x207)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x43c8ff;const _0x518143=_0x30b8f0['data'],_0x21431d=_0x30b8f0[_0x3c3798(0x1ed)];if(_0x518143&&_0x21431d)return _0x3c3798(0x213);const _0xc44ce8=_0x30b8f0['method']||_0x3c3798(0x1d4),_0x503aec=[_0x3c3798(0x1d4),_0x3c3798(0x210),_0x3c3798(0x1f6),_0x3c3798(0x20f),'PATCH'];if(!_0x503aec[_0x3c3798(0x1e2)](_0xc44ce8[_0x3c3798(0x1f2)]()))return _0x3c3798(0x1fe)+_0xc44ce8+_0x3c3798(0x1e4)+_0x503aec[_0x3c3798(0x1de)](',\x20');const _0x531624=_0x30b8f0[_0x3c3798(0x1dd)]||'td',_0x2df98a=['td',_0x3c3798(0x208),'workflow',_0x3c3798(0x1e0),_0x3c3798(0x204),_0x3c3798(0x1e1),_0x3c3798(0x1fa)];if(!_0x2df98a[_0x3c3798(0x1e2)](_0x531624))return _0x3c3798(0x1d8)+_0x531624+'.\x20Valid\x20types:\x20'+_0x2df98a[_0x3c3798(0x1de)](',\x20');return undefined;}async[a6_0x52880d(0x1f3)](_0xa013c7){const _0x5f5da8=a6_0x52880d,{options:_0x3f6540,args:_0x2fd540,tdx:_0x148e74}=_0xa013c7,_0x23a5d8=_0x3f6540,_0x39af6e=_0x2fd540[0x0],_0x28199f=(_0x23a5d8[_0x5f5da8(0x217)]||'GET')[_0x5f5da8(0x1f2)](),_0x3187d8=_0x23a5d8[_0x5f5da8(0x20a)],_0x52e9f8=_0x23a5d8[_0x5f5da8(0x1ed)],_0x4d07ca=_0x23a5d8[_0x5f5da8(0x20e)],_0x4ed20d=_0x23a5d8[_0x5f5da8(0x1dd)]||'td';try{const _0x4c4c49={};if(_0x4d07ca){const _0x1be1e4=Array[_0x5f5da8(0x200)](_0x4d07ca)?_0x4d07ca:[_0x4d07ca];for(const _0x1fbfb4 of _0x1be1e4){const [_0x5d9c02,_0x21bb56]=parseHeader(_0x1fbfb4);_0x4c4c49[_0x5d9c02]=_0x21bb56;}}let _0x404f72;if(_0x3187d8)_0x404f72=_0x3187d8;else{if(_0x52e9f8)try{_0x404f72=RawAPI['readBodyFromFile'](_0x52e9f8);}catch(_0x3489e2){return console['error']('Error:\x20'+(_0x3489e2 instanceof Error?_0x3489e2[_0x5f5da8(0x1d3)]:String(_0x3489e2))),0x1;}}const _0x3c2ca2={'method':_0x28199f,'apiType':_0x4ed20d,'includeHeaders':_0x3f6540[_0x5f5da8(0x201)]};_0x404f72&&(_0x3c2ca2[_0x5f5da8(0x1f5)]=_0x404f72);Object[_0x5f5da8(0x205)](_0x4c4c49)[_0x5f5da8(0x216)]>0x0&&(_0x3c2ca2[_0x5f5da8(0x1f9)]=_0x4c4c49);if(_0x3f6540[_0x5f5da8(0x201)]){const _0x569e94=resolveSite(_0x3f6540[_0x5f5da8(0x214)]),_0x196ce4=getEndpoint(_0x569e94,_0x4ed20d),_0x3c1195=''+_0x196ce4+_0x39af6e;console[_0x5f5da8(0x1ef)]('>\x20'+_0x28199f+'\x20'+_0x3c1195);const _0x551362=getAuthHeaders(_0x569e94),_0x206acd={..._0x551362,..._0x4c4c49};for(const [_0x1210e7,_0x2d25d3]of Object['entries'](_0x206acd)){!isSensitiveHeader(_0x1210e7)&&console[_0x5f5da8(0x1ef)]('>\x20'+_0x1210e7+':\x20'+_0x2d25d3);}_0x404f72&&console['error']('>'),console[_0x5f5da8(0x1ef)]('');}const _0x1ce0b0=await _0x148e74['api'][_0x5f5da8(0x1dc)](_0x39af6e,_0x3c2ca2);if(_0x3f6540[_0x5f5da8(0x201)]&&_0x1ce0b0[_0x5f5da8(0x1f9)]){console['error'](_0x5f5da8(0x20b)+_0x1ce0b0[_0x5f5da8(0x1e6)]);for(const [_0x57f800,_0x505d2f]of Object[_0x5f5da8(0x1fb)](_0x1ce0b0[_0x5f5da8(0x1f9)])){!isSensitiveHeader(_0x57f800)&&console[_0x5f5da8(0x1ef)]('<\x20'+_0x57f800+':\x20'+_0x505d2f);}console[_0x5f5da8(0x1ef)]('');}const _0x4d307d=Boolean(_0x3f6540[_0x5f5da8(0x209)]),_0x2c3f9b={'color':_0x3f6540[_0x5f5da8(0x1ea)],'noColor':_0x3f6540[_0x5f5da8(0x206)]||_0x4d307d&&!_0x3f6540['color']},_0x2061e4=colorizeJSON(_0x1ce0b0[_0x5f5da8(0x20a)],_0x2c3f9b);return _0x3f6540['output']?(writeFileSync(_0x3f6540['output'],_0x2061e4),console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1f4)+_0x3f6540[_0x5f5da8(0x209)])):console['log'](_0x2061e4),0x0;}catch(_0x3985fd){return _0x3985fd instanceof Error?(console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1ec)+_0x3985fd[_0x5f5da8(0x1d3)]),_0x3f6540['verbose']&&_0x3985fd['stack']&&console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1e5)+_0x3985fd[_0x5f5da8(0x1d6)])):console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1ec)+String(_0x3985fd)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x11ee0e=a7_0x9fa2;(function(_0x3f5f0e,_0xe4ce30){const _0x5a7eac=a7_0x9fa2,_0x43abcd=_0x3f5f0e();while(!![]){try{const _0x4c881e=-parseInt(_0x5a7eac(0x97))/0x1*(parseInt(_0x5a7eac(0xb5))/0x2)+parseInt(_0x5a7eac(0xc7))/0x3*(parseInt(_0x5a7eac(0xab))/0x4)+parseInt(_0x5a7eac(0xc9))/0x5+parseInt(_0x5a7eac(0xd1))/0x6*(parseInt(_0x5a7eac(0xb4))/0x7)+-parseInt(_0x5a7eac(0xaa))/0x8*(parseInt(_0x5a7eac(0xa7))/0x9)+parseInt(_0x5a7eac(0x85))/0xa*(parseInt(_0x5a7eac(0xd2))/0xb)+-parseInt(_0x5a7eac(0x9b))/0xc;if(_0x4c881e===_0xe4ce30)break;else _0x43abcd['push'](_0x43abcd['shift']());}catch(_0x2d5a71){_0x43abcd['push'](_0x43abcd['shift']());}}}(a7_0x59e7,0xace98));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';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x5dcc1b 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_0x59e7(){const _0x56f152=['\x0aSetup\x20cancelled','✗\x20Validation\x20failed:\x20','method','join','/app/mp/ak','auth:clear','select','dim','first_name','apikey','\x20(site:\x20','status','description','profile','API\x20key\x20cannot\x20be\x20empty','red','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','1044006sxmKrO','warn','3113920stDqol','green','Enter\x20your\x20TD\x20API\x20key:','\x20and\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','site','log','trim','13206fHPzCI','7014359mqPPQk','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','us01','/users/initiate_sso\x20(account:\x20','error','\x20for\x20profile:\x20','Choose\x20how\x20to\x20sign\x20in:','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Setting\x20up\x20authentication\x20for\x20site:\x20','oauth','filter','\x20(profile:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','email','auth:setup','access_token','\x27\x20registered','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','10pujpYs','Read\x20credential\x20from\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20\x20tdx','jobs','all','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','tdx\x20profile:\x20','yellow','last_name','bold','User:\x20','✓\x20Default\x20site\x20set\x20to\x20','getUserInfo','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','auth','For\x20scripts\x20or\x20headless\x20servers','19tcjpix','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','cyan','tdx:\x20auth\x20setup','10750584LVEXnc','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20user_id:','ERROR','Remove\x20API\x20key\x20from\x20system\x20keychain','create','No\x20credential\x20found','logLevel','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Name:\x20','apiKey','✓\x20Authentication\x20successful\x0a','27mhfnyo','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Credential\x20type:\x20OAuth','2917648ZLDZgO','16XuXUaK','execute','accountName','Validating\x20API\x20key...','message','\x20--profile\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Profile\x20\x27','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','2667ietSAq','83452EVajkY'];a7_0x59e7=function(){return _0x56f152;};return a7_0x59e7();}import a7_0x320ea9 from'chalk';export async function runOAuthLoginFlow(_0x302d3e,_0x29ba82,_0x58b2f8,_0x1e9707){const _0xeefb24=a7_0x9fa2,_0x138805=await isKeychainAvailable();if(!_0x138805)throw new Error(_0xeefb24(0xa8)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x2f0157=_0x1e9707?.['accountName'];if(!_0x2f0157){const _0x477bce=await a7_0x5dcc1b({'type':'text','name':_0xeefb24(0xad),'message':_0xeefb24(0xda)});if(_0x477bce[_0xeefb24(0xad)]===undefined)throw new Error('Setup\x20cancelled');_0x2f0157=_0x477bce[_0xeefb24(0xad)][_0xeefb24(0xd0)]()||undefined;}const _0x577149=getConsoleUrl(_0x302d3e);console[_0xeefb24(0xcf)]('Opening\x20browser\x20for\x20authentication...');_0x2f0157?console[_0xeefb24(0xcf)]('\x20\x20'+_0x577149+_0xeefb24(0xd6)+_0x2f0157+')'):console[_0xeefb24(0xcf)]('\x20\x20'+_0x577149+'/oauth/authorize');console[_0xeefb24(0xcf)](_0xeefb24(0x8c));const _0x2caa4d=await startOAuthFlow(_0x302d3e,{'accountName':_0x2f0157});console[_0xeefb24(0xcf)]('Validating\x20OAuth\x20tokens...');const _0x231a65=TDX['create']({'site':_0x302d3e,'accessToken':_0x2caa4d[_0xeefb24(0xe3)],'logLevel':_0x58b2f8??LogLevel[_0xeefb24(0x9e)]}),_0x382c16=await _0x231a65[_0xeefb24(0x89)]['getUserInfo']();console[_0xeefb24(0xcf)](a7_0x320ea9['green']('✓\x20Signed\x20in\x20successfully')),console[_0xeefb24(0xcf)]('\x20\x20'+a7_0x320ea9[_0xeefb24(0x99)](_0x302d3e+':'+_0x382c16['account_id'])+_0xeefb24(0x9d)+_0x382c16['id']+'\x20\x20('+_0x382c16[_0xeefb24(0xe1)]+')');!_0x2f0157&&(console[_0xeefb24(0xcf)](a7_0x320ea9['dim'](_0xeefb24(0xe5))),console[_0xeefb24(0xcf)](a7_0x320ea9[_0xeefb24(0xbd)](_0xeefb24(0x8b))),console[_0xeefb24(0xcf)](a7_0x320ea9['dim'](_0xeefb24(0x87))));await saveOAuthTokens(_0x2caa4d,_0x29ba82),console[_0xeefb24(0xcf)](_0xeefb24(0xb3)+(_0x29ba82?_0xeefb24(0xdf)+_0x29ba82+')':''));if(_0x29ba82){const _0x497cdf={'site':_0x302d3e};saveProfileToUserConfig(_0x29ba82,_0x497cdf),console[_0xeefb24(0xcf)](_0xeefb24(0xb2)+_0x29ba82+_0xeefb24(0xe4));}else saveDefaultSiteToUserConfig(_0x302d3e),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x302d3e);const _0xe3cbd7=_0x29ba82?_0xeefb24(0xb0)+_0x29ba82:'';console[_0xeefb24(0xcf)](),console[_0xeefb24(0xcf)](_0xeefb24(0xa3)),console[_0xeefb24(0xcf)](_0xeefb24(0x88)+_0xe3cbd7+_0xeefb24(0xdb)),console[_0xeefb24(0xcf)](_0xeefb24(0x88)+_0xe3cbd7+_0xeefb24(0x98));}export async function promptAuthMethod(){const _0x7a2882=a7_0x9fa2,_0x455d97=await a7_0x5dcc1b({'type':_0x7a2882(0xbc),'name':_0x7a2882(0xb8),'message':_0x7a2882(0xd9),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x7a2882(0xd3),'value':_0x7a2882(0xdd)},{'title':'Use\x20an\x20API\x20key','description':_0x7a2882(0x96),'value':_0x7a2882(0xbf)}]});return _0x455d97[_0x7a2882(0xb8)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x11ee0e(0xe2);[a7_0x11ee0e(0xc2)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x11ee0e(0xac)](_0x1dd832){const _0xccad71=a7_0x11ee0e,{options:_0x4811fc}=_0x1dd832,_0x32fb9d=_0x4811fc[_0xccad71(0xc3)];console[_0xccad71(0xcf)](a7_0x320ea9[_0xccad71(0x90)](_0xccad71(0x9a)));const _0xb36011=_0x4811fc[_0xccad71(0xce)]||_0xccad71(0xd5),_0x11d1fc=await promptSiteSelection(_0xb36011,_0x32fb9d,'Setup\x20cancelled');if(!_0x11d1fc)return 0x1;const _0x1b28c9=resolveSite(_0x11d1fc),_0x2232f6=await promptAuthMethod();if(!_0x2232f6)return console['log'](_0xccad71(0xb6)),0x1;if(_0x2232f6===_0xccad71(0xdd)){const {accountName:_0x4f97a4}=_0x4811fc;return await runOAuthLoginFlow(_0x1b28c9,_0x32fb9d,_0x4811fc[_0xccad71(0xa2)]??LogLevel[_0xccad71(0x9e)],{'accountName':_0x4f97a4}),0x0;}console[_0xccad71(0xcf)](_0xccad71(0xdc)+_0x1b28c9),console[_0xccad71(0xcf)](_0xccad71(0xcd)),console[_0xccad71(0xcf)]('\x20\x20'+getConsoleUrl(_0x1b28c9,_0xccad71(0xba)));const _0x305ba6=await a7_0x5dcc1b({'type':'password','name':'apiKey','message':_0xccad71(0xcb),'validate':_0x58f94f=>{const _0x2e93c5=_0xccad71;if(!_0x58f94f||!_0x58f94f[_0x2e93c5(0xd0)]())return _0x2e93c5(0xc4);return!![];}});if(!_0x305ba6[_0xccad71(0xa5)])return console['log'](_0xccad71(0xb6)),0x1;const _0x11507e=_0x305ba6[_0xccad71(0xa5)];console[_0xccad71(0xcf)](_0xccad71(0xae));try{const _0x3ef149=TDX[_0xccad71(0xa0)]({'site':_0x1b28c9,'apiKey':_0x11507e[_0xccad71(0xd0)](),'logLevel':_0x4811fc[_0xccad71(0xa2)]??LogLevel['ERROR']}),_0x2aa5c4=await _0x3ef149[_0xccad71(0x89)]['getUserInfo']();console[_0xccad71(0xcf)](_0xccad71(0xb1)+_0x2aa5c4[_0xccad71(0xe1)]+')');const _0x3bdeb7=await isKeychainAvailable();_0x3bdeb7?(await saveAPIKeyAsync(_0x11507e['trim'](),_0x1b28c9,_0x32fb9d),console[_0xccad71(0xcf)](_0xccad71(0xe0)+(_0x32fb9d?_0xccad71(0xdf)+_0x32fb9d+')':''))):(console[_0xccad71(0xc8)](a7_0x320ea9[_0xccad71(0x8e)](_0xccad71(0x94))),console[_0xccad71(0xc8)](a7_0x320ea9[_0xccad71(0x8e)](_0xccad71(0xd4))));if(_0x32fb9d){const _0x3b0b16={'site':_0x1b28c9};saveProfileToUserConfig(_0x32fb9d,_0x3b0b16),console['log'](_0xccad71(0xb2)+_0x32fb9d+_0xccad71(0xe4));}else saveDefaultSiteToUserConfig(_0x1b28c9),console[_0xccad71(0xcf)](_0xccad71(0x92)+_0x1b28c9);const _0x48f462=_0x32fb9d?_0xccad71(0xb0)+_0x32fb9d:'';return console[_0xccad71(0xcf)](),console[_0xccad71(0xcf)](_0xccad71(0xa3)),console[_0xccad71(0xcf)]('\x20\x20tdx'+_0x48f462+_0xccad71(0xdb)),console[_0xccad71(0xcf)](_0xccad71(0x88)+_0x48f462+_0xccad71(0x98)),0x0;}catch(_0x26857c){if(_0x26857c instanceof HTTPClientError&&_0x26857c['status']===0x191)return printAuthError(_0x26857c),0x1;return console[_0xccad71(0xd7)](a7_0x320ea9[_0xccad71(0xc5)](_0xccad71(0xb7)+(_0x26857c instanceof Error?_0x26857c[_0xccad71(0xaf)]:String(_0x26857c)))),console[_0xccad71(0xd7)](_0xccad71(0xc6)),0x1;}}}function a7_0x9fa2(_0x15aa33,_0x220208){_0x15aa33=_0x15aa33-0x85;const _0x59e779=a7_0x59e7();let _0x9fa2e0=_0x59e779[_0x15aa33];return _0x9fa2e0;}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x11ee0e(0x95);[a7_0x11ee0e(0xc2)]=a7_0x11ee0e(0x9c);async[a7_0x11ee0e(0xac)](_0x119091){const _0x17ed5c=a7_0x11ee0e,{options:_0x5008d5,tdx:_0x36bf98}=_0x119091,_0x4d5f9b=_0x5008d5[_0x17ed5c(0xce)],_0x1b7cc9=_0x5008d5[_0x17ed5c(0xc3)],_0x448a80=_0x1b7cc9?_0x1b7cc9:'N/A';console[_0x17ed5c(0xcf)](_0x17ed5c(0x8d)+_0x448a80+_0x17ed5c(0xc0)+_0x4d5f9b+')');const _0x5ad173=await getOAuthTokens(_0x1b7cc9);if(_0x5ad173)console['log'](_0x17ed5c(0xa9)),console['log']('Read\x20credential\x20from\x20keychain'+(_0x1b7cc9?_0x17ed5c(0xdf)+_0x1b7cc9+')':''));else{const _0x20a444=await resolveAPIKeyAsync(_0x4d5f9b,_0x1b7cc9);if(_0x20a444){const {source:_0x58ae31,isDeprecated:_0x43afcd}=_0x20a444,_0x5cef45=_0x17ed5c(0x86)+_0x58ae31;console[_0x17ed5c(0xcf)](_0x43afcd?a7_0x320ea9[_0x17ed5c(0x8e)](_0x5cef45):_0x5cef45);}else console[_0x17ed5c(0xcf)](a7_0x320ea9[_0x17ed5c(0x8e)](_0x17ed5c(0xa1)));}try{const _0x6f8f87=await _0x36bf98[_0x17ed5c(0x89)][_0x17ed5c(0x93)]();return console[_0x17ed5c(0xcf)](a7_0x320ea9[_0x17ed5c(0xca)](_0x17ed5c(0xa6))),console[_0x17ed5c(0xcf)](_0x17ed5c(0x91)+_0x6f8f87['email']),(_0x6f8f87[_0x17ed5c(0xbe)]||_0x6f8f87[_0x17ed5c(0x8f)])&&console[_0x17ed5c(0xcf)](_0x17ed5c(0xa4)+[_0x6f8f87[_0x17ed5c(0xbe)],_0x6f8f87['last_name']][_0x17ed5c(0xde)](Boolean)[_0x17ed5c(0xb9)]('\x20')),0x0;}catch(_0x86a28b){return _0x86a28b instanceof HTTPClientError&&_0x86a28b[_0x17ed5c(0xc1)]===0x191?printAuthError(_0x86a28b,!![],_0x1b7cc9):console[_0x17ed5c(0xd7)](a7_0x320ea9[_0x17ed5c(0xc5)](_0x17ed5c(0xb7)+(_0x86a28b instanceof Error?_0x86a28b[_0x17ed5c(0xaf)]:String(_0x86a28b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x11ee0e(0xbb);[a7_0x11ee0e(0xc2)]=a7_0x11ee0e(0x9f);async[a7_0x11ee0e(0xac)](_0x2813cc){const _0x552a8b=a7_0x11ee0e,{options:_0x1a9281}=_0x2813cc,_0x3d38c1=_0x1a9281[_0x552a8b(0xc3)];console['log'](a7_0x320ea9[_0x552a8b(0x90)]('tdx:\x20auth\x20clear'));const _0x393419=await isKeychainAvailable();if(!_0x393419)return console[_0x552a8b(0xd7)](a7_0x320ea9[_0x552a8b(0xc5)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x438fe3,_0x3e45bb]=await Promise[_0x552a8b(0x8a)]([deleteKeychainAPIKey(_0x3d38c1),deleteOAuthTokens(_0x3d38c1)]);if(_0x438fe3||_0x3e45bb){clearCredentialCache();const _0x3e5f59=[_0x438fe3&&'API\x20key',_0x3e45bb&&'OAuth\x20tokens'][_0x552a8b(0xde)](Boolean)[_0x552a8b(0xb9)](_0x552a8b(0xcc));return console[_0x552a8b(0xcf)]('✓\x20'+_0x3e5f59+'\x20removed\x20from\x20keychain'+(_0x3d38c1?_0x552a8b(0xdf)+_0x3d38c1+')':'')),0x0;}else return console[_0x552a8b(0xcf)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x3d38c1?_0x552a8b(0xd8)+_0x3d38c1:'')),0x1;}}
|
|
1
|
+
const a7_0x5eb460=a7_0x3938;(function(_0x1ab310,_0x74b01b){const _0x2c783c=a7_0x3938,_0x489b3f=_0x1ab310();while(!![]){try{const _0x557c3b=-parseInt(_0x2c783c(0x208))/0x1*(-parseInt(_0x2c783c(0x1d0))/0x2)+parseInt(_0x2c783c(0x1f0))/0x3+-parseInt(_0x2c783c(0x1de))/0x4*(parseInt(_0x2c783c(0x1ee))/0x5)+parseInt(_0x2c783c(0x204))/0x6+parseInt(_0x2c783c(0x1d4))/0x7*(-parseInt(_0x2c783c(0x1c8))/0x8)+parseInt(_0x2c783c(0x20d))/0x9+-parseInt(_0x2c783c(0x1f7))/0xa;if(_0x557c3b===_0x74b01b)break;else _0x489b3f['push'](_0x489b3f['shift']());}catch(_0x3888ea){_0x489b3f['push'](_0x489b3f['shift']());}}}(a7_0x23f9,0x19b6d));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';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x452c4e 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_0x51a04b from'chalk';export async function runOAuthLoginFlow(_0x1b2819,_0x449bb5,_0x5a419a,_0x4cab59){const _0x1fcf8c=a7_0x3938,_0x51041f=await isKeychainAvailable();if(!_0x51041f)throw new Error(_0x1fcf8c(0x1ed)+_0x1fcf8c(0x215));let _0x409aac=_0x4cab59?.[_0x1fcf8c(0x1e2)];if(!_0x409aac){const _0x241a77=await a7_0x452c4e({'type':'text','name':_0x1fcf8c(0x1e2),'message':_0x1fcf8c(0x1eb)});if(_0x241a77[_0x1fcf8c(0x1e2)]===undefined)throw new Error(_0x1fcf8c(0x20e));_0x409aac=_0x241a77['accountName']['trim']()||undefined;}const _0x1a7aa5=getConsoleUrl(_0x1b2819);console['log'](_0x1fcf8c(0x1db));_0x409aac?console['log']('\x20\x20'+_0x1a7aa5+_0x1fcf8c(0x219)+_0x409aac+')'):console['log']('\x20\x20'+_0x1a7aa5+_0x1fcf8c(0x1cf));console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x21f));const _0x47da90=await startOAuthFlow(_0x1b2819,{'accountName':_0x409aac});console[_0x1fcf8c(0x1ff)]('Validating\x20OAuth\x20tokens...');const _0x459ee3=TDX['create']({'site':_0x1b2819,'accessToken':_0x47da90[_0x1fcf8c(0x1e5)],'logLevel':_0x5a419a??LogLevel[_0x1fcf8c(0x218)]}),_0x467d75=await _0x459ee3[_0x1fcf8c(0x21e)][_0x1fcf8c(0x1ca)]();console[_0x1fcf8c(0x1ff)](a7_0x51a04b[_0x1fcf8c(0x1cb)]('✓\x20Signed\x20in\x20successfully')),console[_0x1fcf8c(0x1ff)]('\x20\x20'+a7_0x51a04b[_0x1fcf8c(0x1ec)](_0x1b2819+':'+_0x467d75[_0x1fcf8c(0x1e6)])+'\x20\x20user_id:'+_0x467d75['id']+'\x20\x20('+_0x467d75[_0x1fcf8c(0x1e8)]+')');!_0x409aac&&(console[_0x1fcf8c(0x1ff)](a7_0x51a04b['dim'](_0x1fcf8c(0x211))),console[_0x1fcf8c(0x1ff)](a7_0x51a04b[_0x1fcf8c(0x214)](_0x1fcf8c(0x1c5))),console[_0x1fcf8c(0x1ff)](a7_0x51a04b[_0x1fcf8c(0x214)](_0x1fcf8c(0x206))));await saveOAuthTokens(_0x47da90,_0x449bb5),console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x1df)+(_0x449bb5?_0x1fcf8c(0x212)+_0x449bb5+')':''));if(_0x449bb5){const _0x40b603={'site':_0x1b2819};saveProfileToUserConfig(_0x449bb5,_0x40b603),console[_0x1fcf8c(0x1ff)]('✓\x20Profile\x20\x27'+_0x449bb5+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1b2819),console[_0x1fcf8c(0x1ff)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x1b2819);const _0x2960a0=_0x449bb5?_0x1fcf8c(0x1f1)+_0x449bb5:'';console[_0x1fcf8c(0x1ff)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x200)+_0x2960a0+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x200)+_0x2960a0+_0x1fcf8c(0x1fe));}function a7_0x23f9(){const _0x179fcc=['accountName','profile','password','access_token','account_id','auth:setup','email','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','first_name','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','cyan','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','249955rtoTll','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','45264xaxgMS','\x20--profile\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','tdx:\x20auth\x20clear','yellow','For\x20scripts\x20or\x20headless\x20servers','warn','1616250pBUxVf','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','join','all','System\x20keychain\x20is\x20not\x20available','✗\x20Validation\x20failed:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','log','\x20\x20tdx','auth','create','Setup\x20API\x20key\x20authentication\x20interactively','1011474OjPaLY','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20(site:\x20','6siPDio','status','logLevel','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20an\x20API\x20key','947331Pfaivm','Setup\x20cancelled','Read\x20credential\x20from\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x20(profile:\x20','message','dim','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','auth:clear','name','ERROR','/users/initiate_sso\x20(account:\x20','\x20for\x20profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','bold','tdx\x20profile:\x20','jobs','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','User:\x20','✓\x20Authentication\x20successful\x0a','filter','select','red','execute','/app/mp/ak','last_name','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','✓\x20Default\x20site\x20set\x20to\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','60664DXLPgx','apiKey','getUserInfo','green','Credential\x20type:\x20OAuth','\x20removed\x20from\x20keychain','trim','/oauth/authorize','11866EZqUIT','error','us01','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','7ALrGVZ','No\x20credential\x20found','\x20and\x20','No\x20credentials\x20found\x20in\x20keychain','oauth','OAuth\x20tokens','\x0aSetup\x20cancelled','Opening\x20browser\x20for\x20authentication...','site','Enter\x20your\x20TD\x20API\x20key:','4WSGAxe','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','description','method'];a7_0x23f9=function(){return _0x179fcc;};return a7_0x23f9();}export async function promptAuthMethod(){const _0x3de7bb=a7_0x3938,_0x43c85d=await a7_0x452c4e({'type':_0x3de7bb(0x223),'name':_0x3de7bb(0x1e1),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x3de7bb(0x20b),'description':_0x3de7bb(0x1fd),'value':'oauth'},{'title':_0x3de7bb(0x20c),'description':_0x3de7bb(0x1f5),'value':'apikey'}]});return _0x43c85d[_0x3de7bb(0x1e1)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x5eb460(0x1e7);[a7_0x5eb460(0x1e0)]=a7_0x5eb460(0x203);async[a7_0x5eb460(0x225)](_0x21a905){const _0x51f82e=a7_0x5eb460,{options:_0x3f0cc4}=_0x21a905,_0x344207=_0x3f0cc4[_0x51f82e(0x1e3)];console[_0x51f82e(0x1ff)](a7_0x51a04b['bold']('tdx:\x20auth\x20setup'));const _0x5821f6=_0x3f0cc4['site']||_0x51f82e(0x1d2),_0x4eb439=await promptSiteSelection(_0x5821f6,_0x344207,_0x51f82e(0x20e));if(!_0x4eb439)return 0x1;const _0x191b50=resolveSite(_0x4eb439),_0x2e855d=await promptAuthMethod();if(!_0x2e855d)return console[_0x51f82e(0x1ff)](_0x51f82e(0x1da)),0x1;if(_0x2e855d===_0x51f82e(0x1d8)){const {accountName:_0xa10c2f}=_0x3f0cc4;return await runOAuthLoginFlow(_0x191b50,_0x344207,_0x3f0cc4[_0x51f82e(0x20a)]??LogLevel[_0x51f82e(0x218)],{'accountName':_0xa10c2f}),0x0;}console[_0x51f82e(0x1ff)](_0x51f82e(0x205)+_0x191b50),console[_0x51f82e(0x1ff)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x191b50,_0x51f82e(0x1c3)));const _0x5c250e=await a7_0x452c4e({'type':_0x51f82e(0x1e4),'name':_0x51f82e(0x1c9),'message':_0x51f82e(0x1dd),'validate':_0x485877=>{const _0x1a2db5=_0x51f82e;if(!_0x485877||!_0x485877[_0x1a2db5(0x1ce)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x5c250e[_0x51f82e(0x1c9)])return console[_0x51f82e(0x1ff)](_0x51f82e(0x1da)),0x1;const _0x593a22=_0x5c250e['apiKey'];console[_0x51f82e(0x1ff)]('Validating\x20API\x20key...');try{const _0x19e4f9=TDX[_0x51f82e(0x202)]({'site':_0x191b50,'apiKey':_0x593a22[_0x51f82e(0x1ce)](),'logLevel':_0x3f0cc4['logLevel']??LogLevel[_0x51f82e(0x218)]}),_0x1d6e36=await _0x19e4f9[_0x51f82e(0x21e)]['getUserInfo']();console[_0x51f82e(0x1ff)](_0x51f82e(0x1e9)+_0x1d6e36[_0x51f82e(0x1e8)]+')');const _0x474d8a=await isKeychainAvailable();_0x474d8a?(await saveAPIKeyAsync(_0x593a22[_0x51f82e(0x1ce)](),_0x191b50,_0x344207),console[_0x51f82e(0x1ff)](_0x51f82e(0x1f2)+(_0x344207?_0x51f82e(0x212)+_0x344207+')':''))):(console['warn'](a7_0x51a04b[_0x51f82e(0x1f4)](_0x51f82e(0x1d3))),console[_0x51f82e(0x1f6)](a7_0x51a04b[_0x51f82e(0x1f4)](_0x51f82e(0x1ef))));if(_0x344207){const _0x476591={'site':_0x191b50};saveProfileToUserConfig(_0x344207,_0x476591),console[_0x51f82e(0x1ff)]('✓\x20Profile\x20\x27'+_0x344207+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x191b50),console['log'](_0x51f82e(0x1c6)+_0x191b50);const _0x314bc2=_0x344207?_0x51f82e(0x1f1)+_0x344207:'';return console[_0x51f82e(0x1ff)](),console[_0x51f82e(0x1ff)](_0x51f82e(0x21b)),console[_0x51f82e(0x1ff)](_0x51f82e(0x200)+_0x314bc2+_0x51f82e(0x1c7)),console[_0x51f82e(0x1ff)]('\x20\x20tdx'+_0x314bc2+_0x51f82e(0x1fe)),0x0;}catch(_0x337d98){if(_0x337d98 instanceof HTTPClientError&&_0x337d98[_0x51f82e(0x209)]===0x191)return printAuthError(_0x337d98),0x1;return console[_0x51f82e(0x1d1)](a7_0x51a04b[_0x51f82e(0x224)](_0x51f82e(0x1fc)+(_0x337d98 instanceof Error?_0x337d98[_0x51f82e(0x213)]:String(_0x337d98)))),console['error'](_0x51f82e(0x210)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x5eb460(0x217)]=a7_0x5eb460(0x201);[a7_0x5eb460(0x1e0)]=a7_0x5eb460(0x1f8);async[a7_0x5eb460(0x225)](_0x5e4440){const _0x5c813a=a7_0x5eb460,{options:_0x2f2be2,tdx:_0x2d38be}=_0x5e4440,_0x16640c=_0x2f2be2[_0x5c813a(0x1dc)],_0x1f14d5=_0x2f2be2[_0x5c813a(0x1e3)],_0x455dcf=_0x1f14d5?_0x1f14d5:'N/A';console[_0x5c813a(0x1ff)](_0x5c813a(0x21d)+_0x455dcf+_0x5c813a(0x207)+_0x16640c+')');const _0x7db35e=await getOAuthTokens(_0x1f14d5);if(_0x7db35e)console[_0x5c813a(0x1ff)](_0x5c813a(0x1cc)),console[_0x5c813a(0x1ff)]('Read\x20credential\x20from\x20keychain'+(_0x1f14d5?_0x5c813a(0x212)+_0x1f14d5+')':''));else{const _0x479e5e=await resolveAPIKeyAsync(_0x16640c,_0x1f14d5);if(_0x479e5e){const {source:_0x418969,isDeprecated:_0x34ad4c}=_0x479e5e,_0x1b394c=_0x5c813a(0x20f)+_0x418969;console['log'](_0x34ad4c?a7_0x51a04b[_0x5c813a(0x1f4)](_0x1b394c):_0x1b394c);}else console[_0x5c813a(0x1ff)](a7_0x51a04b[_0x5c813a(0x1f4)](_0x5c813a(0x1d5)));}try{const _0x596f7e=await _0x2d38be[_0x5c813a(0x21e)][_0x5c813a(0x1ca)]();return console['log'](a7_0x51a04b[_0x5c813a(0x1cb)](_0x5c813a(0x221))),console[_0x5c813a(0x1ff)](_0x5c813a(0x220)+_0x596f7e[_0x5c813a(0x1e8)]),(_0x596f7e[_0x5c813a(0x1ea)]||_0x596f7e[_0x5c813a(0x1c4)])&&console['log']('Name:\x20'+[_0x596f7e[_0x5c813a(0x1ea)],_0x596f7e[_0x5c813a(0x1c4)]][_0x5c813a(0x222)](Boolean)['join']('\x20')),0x0;}catch(_0x1f469e){return _0x1f469e instanceof HTTPClientError&&_0x1f469e[_0x5c813a(0x209)]===0x191?printAuthError(_0x1f469e,!![],_0x1f14d5):console[_0x5c813a(0x1d1)](a7_0x51a04b[_0x5c813a(0x224)]('✗\x20Validation\x20failed:\x20'+(_0x1f469e instanceof Error?_0x1f469e[_0x5c813a(0x213)]:String(_0x1f469e)))),0x1;}}}function a7_0x3938(_0xbed79e,_0x140e33){_0xbed79e=_0xbed79e-0x1c3;const _0x23f9bd=a7_0x23f9();let _0x393804=_0x23f9bd[_0xbed79e];return _0x393804;}export class AuthClearCommand extends BaseCommand{['name']=a7_0x5eb460(0x216);[a7_0x5eb460(0x1e0)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x3a6212){const _0x24704d=a7_0x5eb460,{options:_0x1af795}=_0x3a6212,_0x466bff=_0x1af795['profile'];console['log'](a7_0x51a04b[_0x24704d(0x21c)](_0x24704d(0x1f3)));const _0x3659a0=await isKeychainAvailable();if(!_0x3659a0)return console[_0x24704d(0x1d1)](a7_0x51a04b[_0x24704d(0x224)](_0x24704d(0x1fb))),0x1;const [_0x1929e1,_0x3054af]=await Promise[_0x24704d(0x1fa)]([deleteKeychainAPIKey(_0x466bff),deleteOAuthTokens(_0x466bff)]);if(_0x1929e1||_0x3054af){clearCredentialCache();const _0x745dfa=[_0x1929e1&&'API\x20key',_0x3054af&&_0x24704d(0x1d9)]['filter'](Boolean)[_0x24704d(0x1f9)](_0x24704d(0x1d6));return console[_0x24704d(0x1ff)]('✓\x20'+_0x745dfa+_0x24704d(0x1cd)+(_0x466bff?_0x24704d(0x212)+_0x466bff+')':'')),0x0;}else return console['log'](_0x24704d(0x1d7)+(_0x466bff?_0x24704d(0x21a)+_0x466bff:'')),0x1;}}
|