@treasuredata/tdx 2026.3.11 → 2026.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x5277a7=a3_0x17c3;(function(_0x428160,_0x293384){const _0x2049c6=a3_0x17c3,_0x33755c=_0x428160();while(!![]){try{const _0x780eb1=-parseInt(_0x2049c6(0x14c))/0x1+parseInt(_0x2049c6(0x154))/0x2*(-parseInt(_0x2049c6(0x136))/0x3)+-parseInt(_0x2049c6(0x146))/0x4+parseInt(_0x2049c6(0x156))/0x5+-parseInt(_0x2049c6(0x155))/0x6+parseInt(_0x2049c6(0x147))/0x7*(parseInt(_0x2049c6(0x14a))/0x8)+parseInt(_0x2049c6(0x150))/0x9*(parseInt(_0x2049c6(0x151))/0xa);if(_0x780eb1===_0x293384)break;else _0x33755c['push'](_0x33755c['shift']());}catch(_0x49d4d9){_0x33755c['push'](_0x33755c['shift']());}}}(a3_0x59f9,0x236cf));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x59f9(){const _0x17f861=['activations','Site:\x20','8tDtQUa','Parent\x20name:\x20','284689AeOPKy','length','listActivations','Error:\x20','27JsOOMb','1878740uEHEAL','cause','execute','3958ICmpYJ','1605030xTzXbZ','762115DsyoiE','segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x27...','69uVqlNZ','message','name','\x20activation','verbose','Resolved\x20child\x20ID:\x20','✔\x20Found\x20','Error:\x20Segment\x20name\x20is\x20required','error','description','Resolving\x20parent\x20segment\x20\x27','Child\x20name:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','List\x20activations\x20for\x20a\x20segment','\x20\x20Cause:\x20','data','763088qxwDSZ','1522787MLnLFW'];a3_0x59f9=function(){return _0x17f861;};return a3_0x59f9();}import{withSpinner}from'../utils/spinner.js';function a3_0x17c3(_0x3bdcc1,_0x34af32){_0x3bdcc1=_0x3bdcc1-0x135;const _0x59f90c=a3_0x59f9();let _0x17c305=_0x59f90c[_0x3bdcc1];return _0x17c305;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x5277a7(0x138)]=a3_0x5277a7(0x148);[a3_0x5277a7(0x13f)]=a3_0x5277a7(0x143);async[a3_0x5277a7(0x153)](_0x585e3f){const _0x32b341=a3_0x5277a7,{options:_0x23e06c,args:_0x16c32c,tdx:_0x510bec}=_0x585e3f;if(_0x16c32c['length']===0x0)return console[_0x32b341(0x13e)](_0x32b341(0x13d)),console[_0x32b341(0x13e)](_0x32b341(0x142)),0x1;try{const {parentId:_0x30bcb0,childId:_0x14e29a}=parseSegmentRef(_0x16c32c[0x0]);if(!_0x14e29a)return console[_0x32b341(0x13e)](_0x32b341(0x158)),console[_0x32b341(0x13e)](_0x32b341(0x142)),0x1;_0x23e06c[_0x32b341(0x13a)]&&(console['error'](_0x32b341(0x149)+_0x23e06c['site']),console['error'](_0x32b341(0x14b)+_0x30bcb0),console[_0x32b341(0x13e)](_0x32b341(0x141)+_0x14e29a));const _0x16f381=await withSpinner(_0x32b341(0x140)+_0x30bcb0+_0x32b341(0x135),()=>_0x510bec[_0x32b341(0x157)]['resolveParentId'](_0x30bcb0),{'verbose':_0x23e06c[_0x32b341(0x13a)]}),_0x1df96d=_0x16f381['data'];_0x23e06c['verbose']&&console[_0x32b341(0x13e)]('Resolved\x20parent\x20ID:\x20'+_0x1df96d);const _0x7f0398=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x14e29a+_0x32b341(0x135),()=>_0x510bec[_0x32b341(0x157)]['resolveSegmentId'](_0x1df96d,_0x14e29a),{'verbose':_0x23e06c[_0x32b341(0x13a)]}),_0x4018ae=_0x7f0398[_0x32b341(0x145)];_0x23e06c['verbose']&&console['error'](_0x32b341(0x13b)+_0x4018ae);const _0x9e1343=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x14e29a+'\x27...',()=>_0x510bec[_0x32b341(0x157)][_0x32b341(0x14e)](_0x1df96d,_0x4018ae),{'verbose':_0x23e06c[_0x32b341(0x13a)]}),_0xfa7ed=_0x9e1343[_0x32b341(0x145)];return console[_0x32b341(0x13e)](_0x32b341(0x13c)+_0xfa7ed['length']+_0x32b341(0x139)+(_0xfa7ed[_0x32b341(0x14d)]!==0x1?'s':'')),await handleSDKOutput(_0xfa7ed,_0x23e06c),0x0;}catch(_0x2069dc){if(_0x2069dc instanceof SDKError)return console[_0x32b341(0x13e)](_0x32b341(0x14f)+_0x2069dc[_0x32b341(0x137)]),_0x2069dc[_0x32b341(0x152)]&&console['error'](_0x32b341(0x144)+_0x2069dc[_0x32b341(0x152)]),0x1;throw _0x2069dc;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a4_0x5480(){const _0x160adc=['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)','projectDir','\x20\x20Integration\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Using\x20project\x20from\x20','agentId','source','yellow','Pushing\x20agent\x20from\x20\x22','\x20unchanged','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','New\x20project:\x20','Summary:','agent:clone','description','\x20changed','red','site','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x22:\x20','Using\x20project:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','new','cyan','errors','llm_project','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dirname','output','green','\x0aChanges:','117298qNgnVZ','\x20\x20Text\x20Knowledge\x20Bases:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','297Hpaebv','join','\x0aChanges\x20to\x20prompt\x20\x27','experimentalKnowledgeBases','920549zwMTtB','\x20resources\x20to\x20\x27','\x20|\x20','agentName','Pulling\x20agent\x20\x22','Status:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x0a✔\x20Pulled\x20','push','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','textKnowledgeBases','Analyzing\x20project\x20\x22','136260cPlMFZ','llm','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20Experimental\x20Artifacts:\x20','Analyzing\x20changes\x20to\x20push...','yes','projectId','Would\x20push\x20agent:\x20','\x22\x20to\x20\x22','New\x20project\x20name\x20is\x20required','Clone\x20\x22','execute','Failed\x20to\x20push\x20agent:\x20','force','newProjectId','cwd','Source:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\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','\x20\x20Experimental\x20Artifact\x20\x22','Cloning\x20\x22','Using\x20project\x20from\x20context:\x20','tdx.json','6luAzrg','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','11XdxJlh','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aPush\x20summary\x20for\x20\x27','arg-dir','-\x20no\x20files\x20written','\x20files\x20to\x20','Chat:\x20','sourceProjectName','profile','agents','knowledgeBases','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','reason','log','updated','Would\x20pull\x20agent:\x20','\x20\x20Knowledge\x20Base\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent:\x20','Using\x20local\x20project:\x20','session','Using\x20context\x20project:\x20','outputDir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','pushAgent','llmProject','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)','cwd-config','Using\x20current\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Integrations:\x20','\x0aWrite\x20','pullProject','projectName','dim','unchanged','agent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','experimentalArtifacts','Pushing\x20to\x20project...','Agent\x20','repeat','\x20\x20Target:\x20','error','\x20=\x20','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','prompts','2261148tKbhkK','Project\x20cloned\x20with\x20errors','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','parse','MISSING_ARGUMENT','\x20\x20Agent\x20\x22','agent.yml','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent:pull','created','\x0aPush\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','utf-8','3ZoQYyi','\x20\x20Agents:\x20','\x22\x20to\x20new\x20project\x20\x22','\x20updated','\x0aError:','-\x20nothing\x20pushed','found','no_local_folder','\x20\x20Knowledge\x20Bases:\x20','63582GoUSMm','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Prompt\x20\x22','\x0a✔\x20Pushed\x20','✔\x20Context\x20set:\x20','cloneProject','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20successfully','New\x20project\x20ID:\x20','Cancelled','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','context','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20new','outputPath','Output\x20path:\x20','448955BpEDXI','total','4vjTOKw','Writing\x20files...','\x20\x20tdx\x20agent\x20pull\x20','Project\x20cloned\x20successfully','agent:push','diff','action','no_context','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','17864awRrgR','Would\x20clone:','pushProject','Output:\x20','integrations','\x0aPull\x20summary\x20for\x20\x27','dryRun','Agent\x20pulled\x20successfully','Cannot\x20clone\x20from\x20context\x20project\x20\x22','counts','message','\x22\x20from\x20project\x20\x22','name','\x22...','Errors:'];a4_0x5480=function(){return _0x160adc;};return a4_0x5480();}const a4_0x321400=a4_0xe70e;(function(_0x447803,_0x2798e8){const _0xcfebc4=a4_0xe70e,_0x3f39ed=_0x447803();while(!![]){try{const _0x197d48=parseInt(_0xcfebc4(0x1b0))/0x1*(parseInt(_0xcfebc4(0x204))/0x2)+-parseInt(_0xcfebc4(0x1b9))/0x3*(-parseInt(_0xcfebc4(0x1cd))/0x4)+-parseInt(_0xcfebc4(0x1cb))/0x5+-parseInt(_0xcfebc4(0x16b))/0x6*(-parseInt(_0xcfebc4(0x20b))/0x7)+-parseInt(_0xcfebc4(0x1d6))/0x8*(-parseInt(_0xcfebc4(0x207))/0x9)+parseInt(_0xcfebc4(0x217))/0xa*(parseInt(_0xcfebc4(0x16d))/0xb)+-parseInt(_0xcfebc4(0x1a3))/0xc;if(_0x197d48===_0x2798e8)break;else _0x3f39ed['push'](_0x3f39ed['shift']());}catch(_0x38ed98){_0x3f39ed['push'](_0x3f39ed['shift']());}}}(a4_0x5480,0x21a0f));import a4_0x48726e from'chalk';import a4_0x549855 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(_0x5a915c){const _0x1c1fc0=a4_0xe70e,_0x1902f8=[];if(_0x5a915c[_0x1c1fc0(0x1cc)]!==undefined)_0x1902f8[_0x1c1fc0(0x213)](_0x5a915c[_0x1c1fc0(0x1cc)]+'\x20total');if(_0x5a915c[_0x1c1fc0(0x1fb)]!==undefined&&_0x5a915c[_0x1c1fc0(0x1fb)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e['green'](_0x5a915c[_0x1c1fc0(0x1fb)]+_0x1c1fc0(0x1c8)));if(_0x5a915c[_0x1c1fc0(0x1ac)]!==undefined&&_0x5a915c[_0x1c1fc0(0x1ac)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e[_0x1c1fc0(0x202)](_0x5a915c['created']+'\x20created'));if(_0x5a915c[_0x1c1fc0(0x17c)]!==undefined&&_0x5a915c[_0x1c1fc0(0x17c)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e[_0x1c1fc0(0x1ec)](_0x5a915c['updated']+_0x1c1fc0(0x1b3)));if(_0x5a915c[_0x1c1fc0(0x192)]!==undefined&&_0x5a915c[_0x1c1fc0(0x192)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e['gray'](_0x5a915c['unchanged']+_0x1c1fc0(0x1ee)));if(_0x5a915c['errors']!==undefined&&_0x5a915c[_0x1c1fc0(0x1fd)]>0x0)_0x1902f8['push'](a4_0x48726e[_0x1c1fc0(0x1f5)](_0x5a915c[_0x1c1fc0(0x1fd)]+'\x20errors'));return _0x1902f8[_0x1c1fc0(0x208)](',\x20');}function displayDiffs(_0x27b3e3,_0x59a2df,_0x860326,_0xaf9e3f,_0x5eb2e5,_0x35b614,_0x5eefb7){const _0x17ae34=a4_0xe70e;for(const _0x26e606 of _0x27b3e3){if(_0x26e606['diff']){const _0x365c90=_0x26e606['agentName']||_0x26e606['name'];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x365c90+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console['log'](_0x26e606[_0x17ae34(0x1d2)]),console['log']('─'['repeat'](0x3c));}}for(const _0x114384 of _0x59a2df){_0x114384[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x1c4)+_0x114384[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x114384[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x49be6b of _0x860326){_0x49be6b[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x49be6b['name']+'\x27:'),console['log']('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x49be6b['diff']),console['log']('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x32a376 of _0xaf9e3f){_0x32a376[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x209)+_0x32a376['name']+'\x27:'),console[_0x17ae34(0x17b)]('─'['repeat'](0x3c)),console['log'](_0x32a376[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0xb797b7 of _0x5eb2e5){_0xb797b7[_0x17ae34(0x1d2)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0xb797b7[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0xb797b7[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x4aa33b of _0x35b614){_0x4aa33b[_0x17ae34(0x1d2)]&&(console['log'](_0x17ae34(0x16e)+_0x4aa33b[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console['log'](_0x4aa33b[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'['repeat'](0x3c)));}for(const _0x276274 of _0x5eefb7){_0x276274[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x1e8)+_0x276274['name']+'\x27:'),console['log']('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x276274[_0x17ae34(0x1d2)]),console['log']('─'[_0x17ae34(0x19c)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x321400(0x1ab);[a4_0x321400(0x1f3)]=a4_0x321400(0x1d5);async[a4_0x321400(0x222)](_0x1596b9){const _0x1e523b=a4_0x321400,{options:_0x3042a2,args:_0x29273a,tdx:_0x4e6ba3}=_0x1596b9,_0x1b7863=_0x29273a[0x0],_0x548e3d=_0x29273a[0x1],_0x597b96=_0x3042a2[_0x1e523b(0x201)],_0x3b339b=_0x3042a2['dryRun'],_0x49167d=_0x3042a2[_0x1e523b(0x224)],_0x34d586=_0x3042a2[_0x1e523b(0x21c)],_0x267c20=_0x3042a2[_0x1e523b(0x187)],_0x321731=_0x3042a2[_0x1e523b(0x193)];let _0x5e0cb8;if(_0x1b7863){const _0x143882=a4_0x549855[_0x1e523b(0x208)](_0x1b7863,_0x1e523b(0x16a));if(existsSync(_0x143882))try{const _0x21fde1=JSON[_0x1e523b(0x1a6)](readFileSync(_0x143882,_0x1e523b(0x1af)));_0x21fde1[_0x1e523b(0x1fe)]&&(_0x5e0cb8={'llm_project':_0x21fde1[_0x1e523b(0x1fe)]});}catch{}}const _0x10483c=findAgentConfigPath(process[_0x1e523b(0x226)]());let _0x241f43;if(_0x10483c)try{const _0x5ac312=JSON[_0x1e523b(0x1a6)](readFileSync(_0x10483c,_0x1e523b(0x1af)));_0x5ac312['llm_project']&&(_0x241f43={'llm_project':_0x5ac312[_0x1e523b(0x1fe)]});}catch{}const _0x3bb4ed=resolveAgentPullArgs({'arg':_0x1b7863,'agentNameArg':_0x548e3d,'agentFlag':_0x321731,'contextProject':_0x267c20,'argDirConfig':_0x5e0cb8,'cwdConfigPath':_0x10483c||undefined,'cwdConfig':_0x241f43}),{projectNameOrId:_0x5dd36f,targetAgentName:_0x954ff1,existingOutputDir:_0x1d3f3b,source:_0x1825a6}=_0x3bb4ed;if(_0x1825a6===_0x1e523b(0x170))console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1e9)+a4_0x549855['join'](_0x1b7863,_0x1e523b(0x16a))+':\x20'+_0x5dd36f));else{if(_0x1825a6===_0x1e523b(0x18a))console[_0x1e523b(0x17b)](a4_0x48726e['dim']('Using\x20project:\x20'+_0x5dd36f));else _0x1825a6===_0x1e523b(0x1c6)&&console[_0x1e523b(0x17b)](a4_0x48726e['dim'](_0x1e523b(0x169)+_0x5dd36f));}if(!_0x5dd36f)return _0x321731?(console[_0x1e523b(0x17b)](a4_0x48726e['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1e523b(0x17b)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x1e523b(0x194))):(console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x211))),console[_0x1e523b(0x17b)](_0x1e523b(0x1e5)),console[_0x1e523b(0x17b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x1e523b(0x17b)](_0x1e523b(0x166)),console[_0x1e523b(0x17b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x1e523b(0x17b)](_0x1e523b(0x219))),0x1;if(_0x954ff1){const {data:_0x413fcf}=await withSpinner(_0x1e523b(0x20f)+_0x954ff1+_0x1e523b(0x1e1)+_0x5dd36f+_0x1e523b(0x1e3),()=>_0x4e6ba3[_0x1e523b(0x218)]['pullAgent'](_0x5dd36f,_0x954ff1,_0x597b96,{'dryRun':_0x3b339b,'force':_0x49167d}));if(_0x3b339b)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x18c))),console[_0x1e523b(0x17b)](_0x1e523b(0x17d)+_0x413fcf[_0x1e523b(0x20e)]),console[_0x1e523b(0x17b)](_0x1e523b(0x1ca)+_0x413fcf[_0x1e523b(0x1c9)]),_0x413fcf[_0x1e523b(0x1d2)]&&(console[_0x1e523b(0x17b)](_0x1e523b(0x203)),console[_0x1e523b(0x17b)]('─'[_0x1e523b(0x19c)](0x3c)),console[_0x1e523b(0x17b)](_0x413fcf[_0x1e523b(0x1d2)]),console['log']('─'[_0x1e523b(0x19c)](0x3c))),0x0;return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x1dd))),console['log'](_0x1e523b(0x180)+_0x413fcf[_0x1e523b(0x20e)]),console[_0x1e523b(0x17b)](_0x1e523b(0x1d9)+_0x413fcf[_0x1e523b(0x1c9)]),console[_0x1e523b(0x17b)](_0x1e523b(0x210)+(_0x413fcf['isNew']?a4_0x48726e[_0x1e523b(0x202)]('new'):_0x413fcf['hasChanges']?a4_0x48726e['yellow'](_0x1e523b(0x17c)):a4_0x48726e[_0x1e523b(0x178)](_0x1e523b(0x192)))),0x0;}const _0x108f94=_0x1d3f3b||_0x597b96,{data:_0x81c24}=await withSpinner(_0x1e523b(0x216)+_0x5dd36f+_0x1e523b(0x1e3),()=>_0x4e6ba3[_0x1e523b(0x218)][_0x1e523b(0x18f)](_0x5dd36f,_0x108f94,{'dryRun':!![]})),_0x5904a8=_0x81c24['counts'][_0x1e523b(0x176)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1a2)]['new']+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)][_0x1e523b(0x1fb)]+_0x81c24['counts'][_0x1e523b(0x199)][_0x1e523b(0x1fb)],_0x1fe5b7=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)]['updated']+_0x81c24['counts'][_0x1e523b(0x1a2)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x17c)]+_0x81c24['counts'][_0x1e523b(0x20a)]['updated']+_0x81c24['counts'][_0x1e523b(0x199)]['updated'],_0x1b0e9b=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x192)]+_0x81c24['counts'][_0x1e523b(0x215)]['unchanged']+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1a2)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)]['experimentalKnowledgeBases'][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)]['experimentalArtifacts'][_0x1e523b(0x192)];console['log'](_0x1e523b(0x1db)+_0x81c24['projectName']+'\x27:'),console[_0x1e523b(0x17b)]('\x20\x20'+a4_0x48726e[_0x1e523b(0x202)]('+\x20'+_0x5904a8+_0x1e523b(0x1c8))+_0x1e523b(0x20d)+a4_0x48726e[_0x1e523b(0x1ec)]('~\x20'+_0x1fe5b7+_0x1e523b(0x1f4))+_0x1e523b(0x20d)+a4_0x48726e[_0x1e523b(0x191)]('=\x20'+_0x1b0e9b+_0x1e523b(0x1ee))),console['log'](_0x1e523b(0x1b1)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)])),console[_0x1e523b(0x17b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)])),console[_0x1e523b(0x17b)](_0x1e523b(0x205)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)])),console[_0x1e523b(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x81c24['counts'][_0x1e523b(0x1a2)])),console[_0x1e523b(0x17b)](_0x1e523b(0x18d)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)]));const _0x53f5d1=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)][_0x1e523b(0x1cc)]>0x0||_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x199)][_0x1e523b(0x1cc)]>0x0;_0x53f5d1&&(console[_0x1e523b(0x17b)](_0x1e523b(0x1aa)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)])),console[_0x1e523b(0x17b)](_0x1e523b(0x21a)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)]['experimentalArtifacts'])));console[_0x1e523b(0x17b)](_0x1e523b(0x19d)+a4_0x48726e[_0x1e523b(0x1fc)](_0x81c24[_0x1e523b(0x184)])),displayDiffs(_0x81c24[_0x1e523b(0x176)],_0x81c24[_0x1e523b(0x177)],_0x81c24[_0x1e523b(0x215)],_0x81c24[_0x1e523b(0x1a2)],_0x81c24[_0x1e523b(0x1da)],_0x81c24['experimentalKnowledgeBases'],_0x81c24[_0x1e523b(0x199)]);if(_0x3b339b)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x1a1))),0x0;if(_0x5904a8===0x0&&_0x1fe5b7===0x0)return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x197))),saveSessionContext({'llm_project':_0x81c24['projectName']},_0x3042a2[_0x1e523b(0x182)]),console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x1bd)+a4_0x48726e[_0x1e523b(0x191)]('llm_project')+_0x1e523b(0x19f)+a4_0x48726e[_0x1e523b(0x1fc)](_0x81c24['projectName']))),0x0;if(!_0x34d586&&!_0x49167d){if(!isInteractive())return console[_0x1e523b(0x19e)](a4_0x48726e[_0x1e523b(0x1f5)]('\x0aError:'),_0x1e523b(0x1ae)),console[_0x1e523b(0x19e)](a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1ff))),0x1;const _0x18b16e=await confirmKey(_0x1e523b(0x18e)+(_0x5904a8+_0x1fe5b7)+'\x20files?');if(!_0x18b16e)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x1c2)),_0x1e523b(0x171)),0x1;}const {data:_0x44964a}=await withSpinner(_0x1e523b(0x1ce),()=>_0x4e6ba3[_0x1e523b(0x218)][_0x1e523b(0x18f)](_0x5dd36f,_0x108f94,{'force':_0x49167d}));return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x212)+(_0x5904a8+_0x1fe5b7)+_0x1e523b(0x172)+_0x44964a[_0x1e523b(0x184)])),saveSessionContext({'llm_project':_0x44964a[_0x1e523b(0x190)]},_0x3042a2['session']),console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x202)]('✔\x20Context\x20set:\x20'+a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1fe))+_0x1e523b(0x19f)+a4_0x48726e['cyan'](_0x44964a[_0x1e523b(0x190)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x321400(0x1e2)]=a4_0x321400(0x1f2);[a4_0x321400(0x1f3)]=a4_0x321400(0x214);async['execute'](_0x5767da){const _0x27f328=a4_0x321400,{options:_0x24b6a6,args:_0x57cde5,tdx:_0x453e39}=_0x5767da,_0x5eaeba=_0x57cde5[0x0],_0x5e055d=_0x24b6a6[_0x27f328(0x1e2)],_0x29ebf6=_0x24b6a6[_0x27f328(0x1dc)],_0x1aab89=_0x24b6a6[_0x27f328(0x21c)],_0x463c1e=_0x24b6a6[_0x27f328(0x1f6)],_0x59bdcb=_0x24b6a6[_0x27f328(0x187)];let _0x42757f;const _0xbe597d=findAgentConfigPath(process[_0x27f328(0x226)]());if(_0x5eaeba){const _0x4c759d=a4_0x549855[_0x27f328(0x208)](_0x5eaeba,_0x27f328(0x16a));existsSync(_0x4c759d)?(_0x42757f=_0x5eaeba,console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x181)+_0x5eaeba))):_0x42757f=_0x5eaeba;}else{if(_0xbe597d)_0x42757f=a4_0x549855[_0x27f328(0x200)](_0xbe597d),console['log'](a4_0x48726e['dim'](_0x27f328(0x18b)+_0x42757f));else{if(_0x59bdcb){const _0x4925ab=sanitizeForFilesystem(_0x59bdcb);let _0x2fb1cd=_0x4925ab,_0xfcfdac=a4_0x549855[_0x27f328(0x208)](process[_0x27f328(0x226)](),'agents',_0x4925ab,'tdx.json');if(!existsSync(_0xfcfdac)){const _0xe28c77=normalizeName(_0x59bdcb),_0x1efd44=a4_0x549855[_0x27f328(0x208)](process[_0x27f328(0x226)](),_0x27f328(0x176),_0xe28c77,_0x27f328(0x16a));existsSync(_0x1efd44)&&(_0x2fb1cd=_0xe28c77,_0xfcfdac=_0x1efd44);}if(existsSync(_0xfcfdac))_0x42757f=a4_0x549855[_0x27f328(0x200)](_0xfcfdac),console[_0x27f328(0x17b)](a4_0x48726e['dim'](_0x27f328(0x181)+_0x42757f));else{const _0x5f19a0=_0x24b6a6[_0x27f328(0x175)];if(_0x5f19a0)throw new SDKError(ErrorCode[_0x27f328(0x188)],_0x27f328(0x1de)+_0x59bdcb+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x27f328(0x1ba)+_0x27f328(0x1fa)+(_0x27f328(0x1cf)+_0x59bdcb+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2fb1cd+'\x20--name\x20'+(_0x5e055d||'<new-name>')+_0x27f328(0x1a0)+_0x5f19a0)});_0x42757f=_0x59bdcb,console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x183)+_0x59bdcb));}}}}if(!_0x42757f)return console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1ec)](_0x27f328(0x17f))),console[_0x27f328(0x17b)](_0x27f328(0x165)),console[_0x27f328(0x17b)](_0x27f328(0x16c)),console[_0x27f328(0x17b)](_0x27f328(0x189)),console[_0x27f328(0x17b)](_0x27f328(0x1bf)),0x1;if(!_0x5e055d)throw new SDKError(ErrorCode[_0x27f328(0x1a7)],_0x27f328(0x220),undefined,{'helpText':_0x27f328(0x198)});if(!_0x1aab89&&!_0x29ebf6){if(!isInteractive())return console[_0x27f328(0x19e)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1b4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x27f328(0x19e)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x1ff))),0x1;const _0x14b51c=await confirmKey(_0x27f328(0x221)+_0x42757f+_0x27f328(0x1b2)+_0x5e055d+'\x22?');if(!_0x14b51c)return console['log'](a4_0x48726e['yellow'](_0x27f328(0x1c2))),0x1;}const {data:_0x3b8f39}=await withSpinner(_0x27f328(0x168)+_0x42757f+_0x27f328(0x21f)+_0x5e055d+_0x27f328(0x1e3),()=>_0x453e39[_0x27f328(0x218)][_0x27f328(0x1be)](_0x42757f,_0x5e055d,{'dryRun':_0x29ebf6}));if(_0x29ebf6){console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1ec)](_0x27f328(0x1c3))),console[_0x27f328(0x17b)](_0x27f328(0x164)+_0x3b8f39[_0x27f328(0x174)]),console['log']('New\x20project:\x20'+_0x5e055d),console[_0x27f328(0x17b)](_0x27f328(0x1d7)),console[_0x27f328(0x17b)](_0x27f328(0x1b1)+_0x3b8f39['counts'][_0x27f328(0x176)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x1b8)+_0x3b8f39['counts'][_0x27f328(0x177)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x1c5)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1a2)][_0x27f328(0x1ac)]);const _0x25a690=_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x1ac)]>0x0||_0x3b8f39['counts'][_0x27f328(0x199)][_0x27f328(0x1ac)]>0x0;return _0x25a690&&(console[_0x27f328(0x17b)](_0x27f328(0x1aa)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x21a)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)]['created'])),0x0;}const _0x3d2bae=_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x176)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x177)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1a2)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)]['experimentalKnowledgeBases'][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)][_0x27f328(0x1fd)]>0x0;_0x3d2bae?console[_0x27f328(0x17b)](a4_0x48726e['yellow'](_0x27f328(0x1a4))):console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x202)](_0x27f328(0x1d0)));console[_0x27f328(0x17b)]('Source:\x20'+_0x3b8f39['sourceProjectName']),console[_0x27f328(0x17b)](_0x27f328(0x1f0)+_0x3b8f39['newProjectName']),console[_0x27f328(0x17b)](_0x27f328(0x1c1)+_0x3b8f39[_0x27f328(0x225)]),console[_0x27f328(0x17b)](),console[_0x27f328(0x17b)](_0x27f328(0x1f1)),console[_0x27f328(0x17b)](_0x27f328(0x1b1)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x176)])),console[_0x27f328(0x17b)](_0x27f328(0x1b8)+formatCountSummary(_0x3b8f39['counts'][_0x27f328(0x177)])),console[_0x27f328(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3b8f39['counts'][_0x27f328(0x1a2)])),console[_0x27f328(0x17b)](_0x27f328(0x18d)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1da)]));const _0x1b7722=_0x3b8f39[_0x27f328(0x1df)]['experimentalKnowledgeBases'][_0x27f328(0x1ac)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x17c)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x192)]>0x0||_0x3b8f39[_0x27f328(0x1df)]['experimentalArtifacts']['created']>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)]['updated']>0x0||_0x3b8f39['counts'][_0x27f328(0x199)][_0x27f328(0x192)]>0x0;_0x1b7722&&(console[_0x27f328(0x17b)](_0x27f328(0x1aa)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)])),console[_0x27f328(0x17b)](_0x27f328(0x21a)+formatCountSummary(_0x3b8f39['counts']['experimentalArtifacts'])));if(_0x3d2bae){console[_0x27f328(0x17b)](),console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)]('Errors:'));for(const _0x258d54 of _0x3b8f39[_0x27f328(0x176)]){_0x258d54[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1a8)+_0x258d54[_0x27f328(0x20e)]+_0x27f328(0x1f8)+_0x258d54['error']));}for(const _0x412a19 of _0x3b8f39['knowledgeBases']){_0x412a19[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x17e)+_0x412a19[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x412a19[_0x27f328(0x19e)]));}for(const _0x55418e of _0x3b8f39[_0x27f328(0x1a2)]){_0x55418e[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1bb)+_0x55418e['name']+_0x27f328(0x1f8)+_0x55418e[_0x27f328(0x19e)]));}for(const _0x5c2b71 of _0x3b8f39['integrations']){_0x5c2b71['action']===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1e7)+_0x5c2b71[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x5c2b71['error']));}for(const _0x18d775 of _0x3b8f39['experimentalKnowledgeBases']){_0x18d775[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e['red'](_0x27f328(0x1c7)+_0x18d775[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x18d775[_0x27f328(0x19e)]));}for(const _0x476662 of _0x3b8f39[_0x27f328(0x199)]){_0x476662[_0x27f328(0x1d3)]==='error'&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x167)+_0x476662['name']+_0x27f328(0x1f8)+_0x476662[_0x27f328(0x19e)]));}return 0x1;}console[_0x27f328(0x17b)]();const _0x84daf9=getLLMProjectUrl(_0x463c1e,_0x3b8f39[_0x27f328(0x225)]);return console[_0x27f328(0x17b)](_0x27f328(0x196)+a4_0x48726e[_0x27f328(0x1fc)](_0x84daf9)),0x0;}}function a4_0xe70e(_0x3bf396,_0x277edc){_0x3bf396=_0x3bf396-0x164;const _0x548048=a4_0x5480();let _0xe70ee7=_0x548048[_0x3bf396];return _0xe70ee7;}export class AgentPushCommand extends BaseCommand{[a4_0x321400(0x1e2)]=a4_0x321400(0x1d1);[a4_0x321400(0x1f3)]=a4_0x321400(0x1ef);async[a4_0x321400(0x222)](_0x2a720b){const _0x1a54e3=a4_0x321400,{options:_0x3a6db8,args:_0x5dacba,tdx:_0x4fab18}=_0x2a720b;let _0x451ffb=_0x5dacba[0x0]||process['cwd']();const _0x12de37=_0x3a6db8['dryRun'],_0xa63e9b=_0x3a6db8[_0x1a54e3(0x224)],_0x191252=_0x3a6db8[_0x1a54e3(0x21c)],_0x28a9a7=_0x3a6db8['site'],_0x3bec93=a4_0x549855['join'](_0x451ffb,_0x1a54e3(0x1a9)),_0x355455=existsSync(_0x3bec93);if(_0x355455){const {data:_0x4086d6}=await withSpinner(_0x1a54e3(0x1ed)+_0x451ffb+_0x1a54e3(0x1e3),()=>_0x4fab18['llm'][_0x1a54e3(0x186)](_0x451ffb,{'dryRun':_0x12de37,'force':_0xa63e9b}));if(_0x12de37)return console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1ec)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1a54e3(0x17b)](_0x1a54e3(0x21e)+_0x4086d6[_0x1a54e3(0x20e)]),0x0;if(_0x4086d6['action']===_0x1a54e3(0x19e))return console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x223)+_0x4086d6[_0x1a54e3(0x19e)])),0x1;console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x19b)+_0x4086d6[_0x1a54e3(0x1d3)]+_0x1a54e3(0x1c0))),console['log']('Agent:\x20'+_0x4086d6[_0x1a54e3(0x20e)]);if(_0x4086d6[_0x1a54e3(0x1ea)]&&_0x4086d6['projectId']){const _0x8d9d4d=getLLMAgentChatUrl(_0x28a9a7,_0x4086d6[_0x1a54e3(0x21d)],_0x4086d6[_0x1a54e3(0x1ea)]);console['log'](_0x1a54e3(0x173)+a4_0x48726e[_0x1a54e3(0x1fc)](_0x8d9d4d));}return 0x0;}const _0x6cc956=_0x3a6db8[_0x1a54e3(0x187)],_0x549b31=resolveProjectFromContext(_0x451ffb,_0x6cc956);if(_0x549b31[_0x1a54e3(0x1b6)])_0x451ffb=_0x549b31[_0x1a54e3(0x1e6)],_0x549b31[_0x1a54e3(0x1eb)]===_0x1a54e3(0x1c6)&&console['log'](a4_0x48726e[_0x1a54e3(0x191)](_0x1a54e3(0x1f9)+_0x451ffb));else{let _0x49c105=_0x1a54e3(0x206);_0x549b31['reason']===_0x1a54e3(0x1b7)&&(_0x49c105=_0x549b31[_0x1a54e3(0x1e0)]+_0x1a54e3(0x1a5)+_0x549b31[_0x1a54e3(0x187)]+_0x1a54e3(0x179));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x549b31[_0x1a54e3(0x17a)]===_0x1a54e3(0x1d4)?_0x549b31[_0x1a54e3(0x1e0)]:'No\x20tdx.json\x20found\x20in\x20'+_0x451ffb,undefined,{'helpText':_0x49c105});}const {data:_0x5d7a02}=await withSpinner(_0x1a54e3(0x21b),()=>_0x4fab18[_0x1a54e3(0x218)][_0x1a54e3(0x1d8)](_0x451ffb,{'dryRun':!![]})),_0x1e7194=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['errors']>0x0;if(_0x1e7194){console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)]('\x0aErrors\x20found:'));for(const _0x3f8a7a of _0x5d7a02[_0x1a54e3(0x176)]){_0x3f8a7a['action']==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1a8)+_0x3f8a7a['agentName']+_0x1a54e3(0x1f8)+_0x3f8a7a[_0x1a54e3(0x19e)]));}return 0x1;}const _0x3e1a9e=_0x5d7a02[_0x1a54e3(0x1df)]['agents']['created']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['created']+_0x5d7a02[_0x1a54e3(0x1df)]['textKnowledgeBases']['created']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x1ac)]+_0x5d7a02['counts'][_0x1a54e3(0x1da)][_0x1a54e3(0x1ac)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)][_0x1a54e3(0x1ac)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x1ac)],_0x454f45=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['updated']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['updated']+_0x5d7a02[_0x1a54e3(0x1df)]['textKnowledgeBases'][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1da)]['updated']+_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)]['updated'],_0xcfa50c=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x215)][_0x1a54e3(0x192)]+_0x5d7a02[_0x1a54e3(0x1df)]['prompts'][_0x1a54e3(0x192)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1da)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)]['experimentalKnowledgeBases']['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x192)];console[_0x1a54e3(0x17b)](_0x1a54e3(0x16f)+_0x5d7a02[_0x1a54e3(0x190)]+'\x27:'),console[_0x1a54e3(0x17b)]('\x20\x20'+a4_0x48726e[_0x1a54e3(0x202)]('+\x20'+_0x3e1a9e+'\x20new')+_0x1a54e3(0x20d)+a4_0x48726e['yellow']('~\x20'+_0x454f45+_0x1a54e3(0x1f4))+'\x20|\x20'+a4_0x48726e[_0x1a54e3(0x191)]('=\x20'+_0xcfa50c+_0x1a54e3(0x1ee))),console[_0x1a54e3(0x17b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x1b8)+formatCountSummary(_0x5d7a02['counts'][_0x1a54e3(0x177)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x205)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x215)])),console[_0x1a54e3(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x18d)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)]['integrations']));const _0x35875e=_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x1ac)]>0x0||_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x17c)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)][_0x1a54e3(0x192)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x1ac)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)]['experimentalArtifacts']['updated']>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)]['unchanged']>0x0;_0x35875e&&(console[_0x1a54e3(0x17b)](_0x1a54e3(0x1aa)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x21a)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)])));console[_0x1a54e3(0x17b)]('\x20\x20Source:\x20'+a4_0x48726e[_0x1a54e3(0x1fc)](_0x451ffb)),displayDiffs(_0x5d7a02[_0x1a54e3(0x176)],_0x5d7a02[_0x1a54e3(0x177)],_0x5d7a02['textKnowledgeBases'],_0x5d7a02['prompts'],_0x5d7a02[_0x1a54e3(0x1da)],_0x5d7a02[_0x1a54e3(0x20a)],_0x5d7a02['experimentalArtifacts']);if(_0x12de37)return console[_0x1a54e3(0x17b)](a4_0x48726e['yellow'](_0x1a54e3(0x1f7))),0x0;if(_0x3e1a9e===0x0&&_0x454f45===0x0){console['log'](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x195)));const _0x3c7984=getLLMProjectUrl(_0x28a9a7,_0x5d7a02[_0x1a54e3(0x21d)]);return console['log'](_0x1a54e3(0x196)+a4_0x48726e['cyan'](_0x3c7984)),0x0;}if(!_0x191252&&!_0xa63e9b){if(!isInteractive())return console[_0x1a54e3(0x19e)](a4_0x48726e['red']('\x0aError:'),_0x1a54e3(0x1ae)),console[_0x1a54e3(0x19e)](a4_0x48726e['dim'](_0x1a54e3(0x1ff))),0x1;const _0x102e5d=await confirmKey(_0x1a54e3(0x1ad)+(_0x3e1a9e+_0x454f45)+'\x20resources?');if(!_0x102e5d)return console['log'](a4_0x48726e[_0x1a54e3(0x1ec)](_0x1a54e3(0x1c2)),_0x1a54e3(0x1b5)),0x1;}const {data:_0x21ba5e}=await withSpinner(_0x1a54e3(0x19a),()=>_0x4fab18[_0x1a54e3(0x218)][_0x1a54e3(0x1d8)](_0x451ffb,{'force':_0xa63e9b})),_0x95a502=_0x21ba5e['counts'][_0x1a54e3(0x176)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e['counts'][_0x1a54e3(0x177)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e[_0x1a54e3(0x1df)][_0x1a54e3(0x215)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x1fd)]>0x0;if(_0x95a502){console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1ec)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1e4)));for(const _0x101174 of _0x21ba5e[_0x1a54e3(0x176)]){_0x101174[_0x1a54e3(0x1d3)]==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1a8)+_0x101174[_0x1a54e3(0x20e)]+_0x1a54e3(0x1f8)+_0x101174['error']));}for(const _0x29ddc2 of _0x21ba5e['knowledgeBases']){_0x29ddc2[_0x1a54e3(0x1d3)]===_0x1a54e3(0x19e)&&console[_0x1a54e3(0x17b)](a4_0x48726e['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x29ddc2[_0x1a54e3(0x1e2)]+_0x1a54e3(0x1f8)+_0x29ddc2['error']));}for(const _0x589f8e of _0x21ba5e[_0x1a54e3(0x215)]){_0x589f8e[_0x1a54e3(0x1d3)]==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e['red'](_0x1a54e3(0x185)+_0x589f8e[_0x1a54e3(0x1e2)]+'\x22:\x20'+_0x589f8e[_0x1a54e3(0x19e)]));}for(const _0x46ccf5 of _0x21ba5e['prompts']){_0x46ccf5[_0x1a54e3(0x1d3)]===_0x1a54e3(0x19e)&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1bb)+_0x46ccf5[_0x1a54e3(0x1e2)]+_0x1a54e3(0x1f8)+_0x46ccf5['error']));}for(const _0x470644 of _0x21ba5e[_0x1a54e3(0x1da)]){_0x470644['action']===_0x1a54e3(0x19e)&&console['log'](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1e7)+_0x470644[_0x1a54e3(0x1e2)]+'\x22:\x20'+_0x470644['error']));}return 0x1;}console['log'](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x1bc)+(_0x3e1a9e+_0x454f45)+_0x1a54e3(0x20c)+_0x21ba5e[_0x1a54e3(0x190)]+'\x27'));const _0x429542=getLLMProjectUrl(_0x28a9a7,_0x21ba5e[_0x1a54e3(0x21d)]);return console[_0x1a54e3(0x17b)](_0x1a54e3(0x196)+a4_0x48726e[_0x1a54e3(0x1fc)](_0x429542)),0x0;}}
|
|
1
|
+
const a4_0x468322=a4_0x4f28;(function(_0x41f446,_0x5c5771){const _0x595e90=a4_0x4f28,_0x13a419=_0x41f446();while(!![]){try{const _0x4d5503=parseInt(_0x595e90(0x1eb))/0x1*(-parseInt(_0x595e90(0x1a9))/0x2)+-parseInt(_0x595e90(0x19c))/0x3*(-parseInt(_0x595e90(0x1cc))/0x4)+parseInt(_0x595e90(0x236))/0x5+parseInt(_0x595e90(0x234))/0x6*(-parseInt(_0x595e90(0x1e0))/0x7)+-parseInt(_0x595e90(0x204))/0x8+-parseInt(_0x595e90(0x22c))/0x9+parseInt(_0x595e90(0x1c5))/0xa*(parseInt(_0x595e90(0x1ff))/0xb);if(_0x4d5503===_0x5c5771)break;else _0x13a419['push'](_0x13a419['shift']());}catch(_0x1b148d){_0x13a419['push'](_0x13a419['shift']());}}}(a4_0x4e19,0x5a5ba));import a4_0x47f33c from'chalk';import a4_0x1a16d8 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';function a4_0x4f28(_0x49d73f,_0x22f73e){_0x49d73f=_0x49d73f-0x179;const _0x4e19d8=a4_0x4e19();let _0x4f2875=_0x4e19d8[_0x49d73f];return _0x4f2875;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x4e19(){const _0x354204=['Cannot\x20clone\x20from\x20context\x20project\x20\x22','✔\x20Context\x20set:\x20','Agent\x20','\x0aChanges:','Summary:','agent','prompts','\x20changed','cwd-config','\x0aPull\x20summary\x20for\x20\x27','\x0aError:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Would\x20pull\x20agent:\x20','Output\x20path:\x20','cyan','found','outputPath','Agent\x20pulled\x20successfully','\x20|\x20','execute','projectId','2692017JpsHNH','Cancelled','\x0aProject\x20pushed\x20with\x20errors','hasChanges','MISSING_ARGUMENT','action','\x20\x20Target:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','37626OxaOwH','Pushing\x20to\x20project...','1838410UIFLPA','yes','cloneProject','knowledgeBases','agentId','\x20\x20Integration\x20\x22','Pulling\x20agent\x20\x22','push','New\x20project\x20name\x20is\x20required','profile','\x20\x20Experimental\x20Artifacts:\x20','Agent:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x27\x20to\x20create\x20the\x20folder\x20structure.','Source:\x20','New\x20project:\x20','\x20\x20Agent\x20\x22','name','\x20=\x20','<new-name>','agents','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Bases:\x20','parse','\x22...','\x20\x20Knowledge\x20Base\x20\x22','projectName','llmProject','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0a✔\x20Pushed\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','outputDir','Errors:','isNew','\x20files?','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','site','18aIJyYj','\x0a✔\x20Pulled\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','agent:clone','\x20errors','diff','llm_project','Chat:\x20','\x20files\x20to\x20','pullAgent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','-\x20nothing\x20pushed','4GmsZbW','New\x20project\x20ID:\x20','Using\x20project\x20from\x20','No\x20tdx.json\x20found\x20in\x20','\x20unchanged','yellow','\x20\x20Prompts:\x20','\x20successfully','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)','log','\x0aChanges\x20to\x20agent\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20--profile\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Status:\x20','integrations','\x22\x20to\x20new\x20project\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','reason','\x20\x20Text\x20Knowledge\x20Bases:\x20','created','\x20\x20Agents:\x20','\x20\x20Integrations:\x20','Analyzing\x20project\x20\x22','experimentalKnowledgeBases','INVALID_ARGUMENT','textKnowledgeBases','20krFcmY','\x20\x20Prompt\x20\x22','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Base\x20\x22','arg-dir','red','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','148848hXwyRQ','unchanged','description','\x22:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Using\x20local\x20project:\x20','counts','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20tdx\x20agent\x20pull\x20','gray','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20created','agentName','updated','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Failed\x20to\x20push\x20agent:\x20','green','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dryRun','Project:\x20','665IgWDqi','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','error','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Clone\x20\x22','cwd','Using\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','Would\x20clone:','\x22\x20from\x20project\x20\x22','\x0aWrite\x20','310809LjrfeG','force','pushProject','tdx.json','source','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','dim','agent.yml','join','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','dirname','errors','\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','\x20\x20Source:\x20','new','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aPush\x20summary\x20for\x20\x27','pullProject','\x20new','10642610HzkNmf','total','repeat','Using\x20current\x20project:\x20','agent:pull','5115136gqCYAE','no_context','Project\x20cloned\x20with\x20errors','Would\x20push\x20agent:\x20','experimentalArtifacts','\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','sourceProjectName','\x0aChanges\x20to\x20integration\x20\x27','-\x20no\x20files\x20written','llm','newProjectId','output','\x22\x20to\x20\x22','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Using\x20project\x20from\x20context:\x20','Using\x20context\x20project:\x20','agent:push','session','\x20\x20tdx\x20agent\x20clone\x20agents/'];a4_0x4e19=function(){return _0x354204;};return a4_0x4e19();}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(_0x5b7f57){const _0x134a11=a4_0x4f28,_0x339dc6=[];if(_0x5b7f57['total']!==undefined)_0x339dc6[_0x134a11(0x17e)](_0x5b7f57['total']+'\x20total');if(_0x5b7f57[_0x134a11(0x1f9)]!==undefined&&_0x5b7f57['new']>0x0)_0x339dc6['push'](a4_0x47f33c['green'](_0x5b7f57[_0x134a11(0x1f9)]+_0x134a11(0x1fe)));if(_0x5b7f57[_0x134a11(0x1be)]!==undefined&&_0x5b7f57[_0x134a11(0x1be)]>0x0)_0x339dc6[_0x134a11(0x17e)](a4_0x47f33c['green'](_0x5b7f57[_0x134a11(0x1be)]+_0x134a11(0x1d7)));if(_0x5b7f57[_0x134a11(0x1d9)]!==undefined&&_0x5b7f57[_0x134a11(0x1d9)]>0x0)_0x339dc6[_0x134a11(0x17e)](a4_0x47f33c[_0x134a11(0x1ae)](_0x5b7f57[_0x134a11(0x1d9)]+'\x20updated'));if(_0x5b7f57['unchanged']!==undefined&&_0x5b7f57[_0x134a11(0x1cd)]>0x0)_0x339dc6[_0x134a11(0x17e)](a4_0x47f33c[_0x134a11(0x1d5)](_0x5b7f57[_0x134a11(0x1cd)]+_0x134a11(0x1ad)));if(_0x5b7f57[_0x134a11(0x1f6)]!==undefined&&_0x5b7f57[_0x134a11(0x1f6)]>0x0)_0x339dc6['push'](a4_0x47f33c[_0x134a11(0x1ca)](_0x5b7f57[_0x134a11(0x1f6)]+_0x134a11(0x1a1)));return _0x339dc6[_0x134a11(0x1f3)](',\x20');}function displayDiffs(_0x49cb71,_0x1c927e,_0x8a992,_0x68265d,_0x4fae26,_0x3e90c0,_0x5ea0d9){const _0x3d036f=a4_0x4f28;for(const _0x5a4b9b of _0x49cb71){if(_0x5a4b9b[_0x3d036f(0x1a2)]){const _0x1be630=_0x5a4b9b['agentName']||_0x5a4b9b[_0x3d036f(0x188)];console[_0x3d036f(0x1b2)](_0x3d036f(0x1b3)+_0x1be630+'\x27:'),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)),console['log'](_0x5a4b9b[_0x3d036f(0x1a2)]),console['log']('─'['repeat'](0x3c));}}for(const _0x36bafa of _0x1c927e){_0x36bafa['diff']&&(console[_0x3d036f(0x1b2)](_0x3d036f(0x193)+_0x36bafa[_0x3d036f(0x188)]+'\x27:'),console['log']('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x36bafa[_0x3d036f(0x1a2)]),console['log']('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x246289 of _0x8a992){_0x246289[_0x3d036f(0x1a2)]&&(console['log'](_0x3d036f(0x1f4)+_0x246289[_0x3d036f(0x188)]+'\x27:'),console['log']('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x246289[_0x3d036f(0x1a2)]),console[_0x3d036f(0x1b2)]('─'['repeat'](0x3c)));}for(const _0x185b9e of _0x68265d){_0x185b9e['diff']&&(console[_0x3d036f(0x1b2)](_0x3d036f(0x183)+_0x185b9e[_0x3d036f(0x188)]+'\x27:'),console[_0x3d036f(0x1b2)]('─'['repeat'](0x3c)),console[_0x3d036f(0x1b2)](_0x185b9e['diff']),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x3e2d16 of _0x4fae26){_0x3e2d16[_0x3d036f(0x1a2)]&&(console['log'](_0x3d036f(0x20b)+_0x3e2d16['name']+'\x27:'),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x3e2d16[_0x3d036f(0x1a2)]),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x23494f of _0x3e90c0){_0x23494f[_0x3d036f(0x1a2)]&&(console[_0x3d036f(0x1b2)](_0x3d036f(0x195)+_0x23494f['name']+'\x27:'),console['log']('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x23494f['diff']),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x1c3146 of _0x5ea0d9){_0x1c3146[_0x3d036f(0x1a2)]&&(console[_0x3d036f(0x1b2)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x1c3146['name']+'\x27:'),console[_0x3d036f(0x1b2)]('─'['repeat'](0x3c)),console[_0x3d036f(0x1b2)](_0x1c3146[_0x3d036f(0x1a2)]),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x468322(0x203);[a4_0x468322(0x1ce)]=a4_0x468322(0x1cb);async['execute'](_0x4c3f01){const _0x33ec46=a4_0x468322,{options:_0x3801cf,args:_0x23cf12,tdx:_0x15b246}=_0x4c3f01,_0x542ce5=_0x23cf12[0x0],_0x25660e=_0x23cf12[0x1],_0x30b30c=_0x3801cf[_0x33ec46(0x20f)],_0x1f7461=_0x3801cf[_0x33ec46(0x1de)],_0x408db7=_0x3801cf[_0x33ec46(0x1ec)],_0x493ac1=_0x3801cf[_0x33ec46(0x237)],_0xb4cd9f=_0x3801cf['llmProject'],_0x38dffd=_0x3801cf[_0x33ec46(0x21c)];let _0x30151f;if(_0x542ce5){const _0x314578=a4_0x1a16d8[_0x33ec46(0x1f3)](_0x542ce5,'tdx.json');if(existsSync(_0x314578))try{const _0x2b4878=JSON['parse'](readFileSync(_0x314578,'utf-8'));_0x2b4878[_0x33ec46(0x1a3)]&&(_0x30151f={'llm_project':_0x2b4878[_0x33ec46(0x1a3)]});}catch{}}const _0x19120b=findAgentConfigPath(process[_0x33ec46(0x1e5)]());let _0x26a01a;if(_0x19120b)try{const _0x3aca7f=JSON[_0x33ec46(0x18e)](readFileSync(_0x19120b,'utf-8'));_0x3aca7f[_0x33ec46(0x1a3)]&&(_0x26a01a={'llm_project':_0x3aca7f['llm_project']});}catch{}const _0xf78d9c=resolveAgentPullArgs({'arg':_0x542ce5,'agentNameArg':_0x25660e,'agentFlag':_0x38dffd,'contextProject':_0xb4cd9f,'argDirConfig':_0x30151f,'cwdConfigPath':_0x19120b||undefined,'cwdConfig':_0x26a01a}),{projectNameOrId:_0x434f84,targetAgentName:_0x68dcae,existingOutputDir:_0x39e48c,source:_0x2687fa}=_0xf78d9c;if(_0x2687fa===_0x33ec46(0x1c9))console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1f1)](_0x33ec46(0x1ab)+a4_0x1a16d8[_0x33ec46(0x1f3)](_0x542ce5,_0x33ec46(0x1ee))+':\x20'+_0x434f84));else{if(_0x2687fa===_0x33ec46(0x21f))console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1f1)]('Using\x20project:\x20'+_0x434f84));else _0x2687fa==='context'&&console['log'](a4_0x47f33c['dim'](_0x33ec46(0x212)+_0x434f84));}if(!_0x434f84)return _0x38dffd?(console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x1fa))),console[_0x33ec46(0x1b2)](_0x33ec46(0x19a)),console[_0x33ec46(0x1b2)](_0x33ec46(0x1d0))):(console[_0x33ec46(0x1b2)](a4_0x47f33c['yellow'](_0x33ec46(0x1d3))),console[_0x33ec46(0x1b2)](_0x33ec46(0x1b1)),console[_0x33ec46(0x1b2)](_0x33ec46(0x209)),console[_0x33ec46(0x1b2)](_0x33ec46(0x1f7)),console[_0x33ec46(0x1b2)](_0x33ec46(0x19f)),console[_0x33ec46(0x1b2)]('\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(_0x68dcae){const {data:_0x265a84}=await withSpinner(_0x33ec46(0x17d)+_0x68dcae+_0x33ec46(0x1e9)+_0x434f84+_0x33ec46(0x18f),()=>_0x15b246[_0x33ec46(0x20d)][_0x33ec46(0x1a6)](_0x434f84,_0x68dcae,_0x30b30c,{'dryRun':_0x1f7461,'force':_0x408db7}));if(_0x1f7461)return console[_0x33ec46(0x1b2)](a4_0x47f33c['yellow'](_0x33ec46(0x1e7))),console[_0x33ec46(0x1b2)](_0x33ec46(0x223)+_0x265a84[_0x33ec46(0x1d8)]),console[_0x33ec46(0x1b2)](_0x33ec46(0x224)+_0x265a84[_0x33ec46(0x227)]),_0x265a84[_0x33ec46(0x1a2)]&&(console[_0x33ec46(0x1b2)](_0x33ec46(0x21a)),console['log']('─'['repeat'](0x3c)),console[_0x33ec46(0x1b2)](_0x265a84[_0x33ec46(0x1a2)]),console[_0x33ec46(0x1b2)]('─'[_0x33ec46(0x201)](0x3c))),0x0;return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x228))),console[_0x33ec46(0x1b2)](_0x33ec46(0x182)+_0x265a84[_0x33ec46(0x1d8)]),console[_0x33ec46(0x1b2)]('Output:\x20'+_0x265a84[_0x33ec46(0x227)]),console['log'](_0x33ec46(0x1b8)+(_0x265a84[_0x33ec46(0x198)]?a4_0x47f33c['green'](_0x33ec46(0x1f9)):_0x265a84[_0x33ec46(0x22f)]?a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x1d9)):a4_0x47f33c[_0x33ec46(0x1d5)](_0x33ec46(0x1cd)))),0x0;}const _0x3e8db9=_0x39e48c||_0x30b30c,{data:_0x25e8b1}=await withSpinner(_0x33ec46(0x1c1)+_0x434f84+'\x22...',()=>_0x15b246[_0x33ec46(0x20d)][_0x33ec46(0x1fd)](_0x434f84,_0x3e8db9,{'dryRun':!![]})),_0x2807a9=_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x18b)]['new']+_0x25e8b1['counts']['knowledgeBases'][_0x33ec46(0x1f9)]+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c4)][_0x33ec46(0x1f9)]+_0x25e8b1['counts'][_0x33ec46(0x21d)]['new']+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1b9)][_0x33ec46(0x1f9)]+_0x25e8b1['counts'][_0x33ec46(0x1c2)][_0x33ec46(0x1f9)]+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x208)][_0x33ec46(0x1f9)],_0xbc69ef=_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x18b)]['updated']+_0x25e8b1['counts'][_0x33ec46(0x17a)]['updated']+_0x25e8b1[_0x33ec46(0x1d2)]['textKnowledgeBases'][_0x33ec46(0x1d9)]+_0x25e8b1[_0x33ec46(0x1d2)]['prompts'][_0x33ec46(0x1d9)]+_0x25e8b1[_0x33ec46(0x1d2)]['integrations']['updated']+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c2)][_0x33ec46(0x1d9)]+_0x25e8b1[_0x33ec46(0x1d2)]['experimentalArtifacts'][_0x33ec46(0x1d9)],_0x1428b4=_0x25e8b1['counts'][_0x33ec46(0x18b)]['unchanged']+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x17a)][_0x33ec46(0x1cd)]+_0x25e8b1['counts']['textKnowledgeBases'][_0x33ec46(0x1cd)]+_0x25e8b1[_0x33ec46(0x1d2)]['prompts'][_0x33ec46(0x1cd)]+_0x25e8b1['counts']['integrations'][_0x33ec46(0x1cd)]+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c2)]['unchanged']+_0x25e8b1[_0x33ec46(0x1d2)]['experimentalArtifacts'][_0x33ec46(0x1cd)];console[_0x33ec46(0x1b2)](_0x33ec46(0x220)+_0x25e8b1[_0x33ec46(0x191)]+'\x27:'),console[_0x33ec46(0x1b2)]('\x20\x20'+a4_0x47f33c[_0x33ec46(0x1dc)]('+\x20'+_0x2807a9+_0x33ec46(0x1fe))+_0x33ec46(0x229)+a4_0x47f33c[_0x33ec46(0x1ae)]('~\x20'+_0xbc69ef+_0x33ec46(0x21e))+_0x33ec46(0x229)+a4_0x47f33c[_0x33ec46(0x1f1)]('=\x20'+_0x1428b4+'\x20unchanged')),console[_0x33ec46(0x1b2)](_0x33ec46(0x1bf)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)]['agents'])),console[_0x33ec46(0x1b2)](_0x33ec46(0x18d)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x17a)])),console[_0x33ec46(0x1b2)](_0x33ec46(0x1bd)+formatCountSummary(_0x25e8b1['counts']['textKnowledgeBases'])),console[_0x33ec46(0x1b2)](_0x33ec46(0x1af)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)]['prompts'])),console[_0x33ec46(0x1b2)](_0x33ec46(0x1c0)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1b9)]));const _0x409888=_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c2)][_0x33ec46(0x200)]>0x0||_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x208)][_0x33ec46(0x200)]>0x0;_0x409888&&(console[_0x33ec46(0x1b2)](_0x33ec46(0x222)+formatCountSummary(_0x25e8b1['counts'][_0x33ec46(0x1c2)])),console['log'](_0x33ec46(0x181)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x208)])));console[_0x33ec46(0x1b2)](_0x33ec46(0x232)+a4_0x47f33c[_0x33ec46(0x225)](_0x25e8b1[_0x33ec46(0x196)])),displayDiffs(_0x25e8b1[_0x33ec46(0x18b)],_0x25e8b1[_0x33ec46(0x17a)],_0x25e8b1['textKnowledgeBases'],_0x25e8b1['prompts'],_0x25e8b1[_0x33ec46(0x1b9)],_0x25e8b1['experimentalKnowledgeBases'],_0x25e8b1[_0x33ec46(0x208)]);if(_0x1f7461)return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x1a7))),0x0;if(_0x2807a9===0x0&&_0xbc69ef===0x0)return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x233))),saveSessionContext({'llm_project':_0x25e8b1['projectName']},_0x3801cf[_0x33ec46(0x215)]),console[_0x33ec46(0x1b2)](a4_0x47f33c['green']('✔\x20Context\x20set:\x20'+a4_0x47f33c['dim'](_0x33ec46(0x1a3))+'\x20=\x20'+a4_0x47f33c[_0x33ec46(0x225)](_0x25e8b1['projectName']))),0x0;if(!_0x493ac1&&!_0x408db7){if(!isInteractive())return console['error'](a4_0x47f33c[_0x33ec46(0x1ca)]('\x0aError:'),_0x33ec46(0x19e)),console[_0x33ec46(0x1e2)](a4_0x47f33c[_0x33ec46(0x1f1)](_0x33ec46(0x1b7))),0x1;const _0x1d074e=await confirmKey(_0x33ec46(0x1ea)+(_0x2807a9+_0xbc69ef)+_0x33ec46(0x199));if(!_0x1d074e)return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x22d)),_0x33ec46(0x20c)),0x1;}const {data:_0x36cef7}=await withSpinner('Writing\x20files...',()=>_0x15b246['llm'][_0x33ec46(0x1fd)](_0x434f84,_0x3e8db9,{'force':_0x408db7}));return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x19d)+(_0x2807a9+_0xbc69ef)+_0x33ec46(0x1a5)+_0x36cef7[_0x33ec46(0x196)])),saveSessionContext({'llm_project':_0x36cef7[_0x33ec46(0x191)]},_0x3801cf[_0x33ec46(0x215)]),console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x218)+a4_0x47f33c[_0x33ec46(0x1f1)](_0x33ec46(0x1a3))+_0x33ec46(0x189)+a4_0x47f33c[_0x33ec46(0x225)](_0x36cef7[_0x33ec46(0x191)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x468322(0x1a0);[a4_0x468322(0x1ce)]=a4_0x468322(0x1e1);async[a4_0x468322(0x22a)](_0x3b24c9){const _0x3d012a=a4_0x468322,{options:_0x10b17d,args:_0x1f9fb0,tdx:_0x302bdb}=_0x3b24c9,_0x2e9765=_0x1f9fb0[0x0],_0x50ca4f=_0x10b17d[_0x3d012a(0x188)],_0x1dc194=_0x10b17d[_0x3d012a(0x1de)],_0x1e464c=_0x10b17d[_0x3d012a(0x237)],_0x332e3a=_0x10b17d[_0x3d012a(0x19b)],_0xf6bbb2=_0x10b17d[_0x3d012a(0x192)];let _0x54a641;const _0x77c670=findAgentConfigPath(process[_0x3d012a(0x1e5)]());if(_0x2e9765){const _0xe3b4d5=a4_0x1a16d8[_0x3d012a(0x1f3)](_0x2e9765,_0x3d012a(0x1ee));existsSync(_0xe3b4d5)?(_0x54a641=_0x2e9765,console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1f1)]('Using\x20local\x20project:\x20'+_0x2e9765))):_0x54a641=_0x2e9765;}else{if(_0x77c670)_0x54a641=a4_0x1a16d8[_0x3d012a(0x1f5)](_0x77c670),console[_0x3d012a(0x1b2)](a4_0x47f33c['dim'](_0x3d012a(0x202)+_0x54a641));else{if(_0xf6bbb2){const _0xdab222=sanitizeForFilesystem(_0xf6bbb2);let _0x28033e=_0xdab222,_0x16e7dd=a4_0x1a16d8['join'](process['cwd'](),_0x3d012a(0x18b),_0xdab222,_0x3d012a(0x1ee));if(!existsSync(_0x16e7dd)){const _0x180265=normalizeName(_0xf6bbb2),_0x231e58=a4_0x1a16d8[_0x3d012a(0x1f3)](process[_0x3d012a(0x1e5)](),_0x3d012a(0x18b),_0x180265,_0x3d012a(0x1ee));existsSync(_0x231e58)&&(_0x28033e=_0x180265,_0x16e7dd=_0x231e58);}if(existsSync(_0x16e7dd))_0x54a641=a4_0x1a16d8[_0x3d012a(0x1f5)](_0x16e7dd),console['log'](a4_0x47f33c['dim'](_0x3d012a(0x1d1)+_0x54a641));else{const _0x284357=_0x10b17d[_0x3d012a(0x180)];if(_0x284357)throw new SDKError(ErrorCode[_0x3d012a(0x1c3)],_0x3d012a(0x217)+_0xf6bbb2+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x3d012a(0x1bb)+_0x3d012a(0x1d6)+(_0x3d012a(0x1d4)+_0xf6bbb2+'\x0a')+(_0x3d012a(0x216)+_0x28033e+'\x20--name\x20'+(_0x50ca4f||_0x3d012a(0x18a))+_0x3d012a(0x1b6)+_0x284357)});_0x54a641=_0xf6bbb2,console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1f1)](_0x3d012a(0x213)+_0xf6bbb2));}}}}if(!_0x54a641)return console['log'](a4_0x47f33c[_0x3d012a(0x1ae)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x3d012a(0x1b2)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x3d012a(0x1b2)](_0x3d012a(0x1da)),console['log']('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x3d012a(0x1dd)),0x1;if(!_0x50ca4f)throw new SDKError(ErrorCode[_0x3d012a(0x230)],_0x3d012a(0x17f),undefined,{'helpText':_0x3d012a(0x1b4)});if(!_0x1e464c&&!_0x1dc194){if(!isInteractive())return console[_0x3d012a(0x1e2)](a4_0x47f33c['red'](_0x3d012a(0x221)),_0x3d012a(0x19e)),console['error'](a4_0x47f33c[_0x3d012a(0x1f1)](_0x3d012a(0x1b7))),0x1;const _0x374066=await confirmKey(_0x3d012a(0x1e4)+_0x54a641+_0x3d012a(0x1ba)+_0x50ca4f+'\x22?');if(!_0x374066)return console[_0x3d012a(0x1b2)](a4_0x47f33c['yellow'](_0x3d012a(0x22d))),0x1;}const {data:_0x5b7cf2}=await withSpinner('Cloning\x20\x22'+_0x54a641+_0x3d012a(0x210)+_0x50ca4f+'\x22...',()=>_0x302bdb[_0x3d012a(0x20d)][_0x3d012a(0x179)](_0x54a641,_0x50ca4f,{'dryRun':_0x1dc194}));if(_0x1dc194){console['log'](a4_0x47f33c[_0x3d012a(0x1ae)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x3d012a(0x1b2)](_0x3d012a(0x185)+_0x5b7cf2[_0x3d012a(0x20a)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x186)+_0x50ca4f),console[_0x3d012a(0x1b2)](_0x3d012a(0x1e8)),console['log'](_0x3d012a(0x1bf)+_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x18b)][_0x3d012a(0x1be)]),console['log'](_0x3d012a(0x18d)+_0x5b7cf2['counts'][_0x3d012a(0x17a)][_0x3d012a(0x1be)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x1af)+_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x21d)][_0x3d012a(0x1be)]);const _0x44f455=_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x1c2)][_0x3d012a(0x1be)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)]['experimentalArtifacts'][_0x3d012a(0x1be)]>0x0;return _0x44f455&&(console['log'](_0x3d012a(0x222)+_0x5b7cf2['counts']['experimentalKnowledgeBases'][_0x3d012a(0x1be)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x181)+_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x208)][_0x3d012a(0x1be)])),0x0;}const _0x471128=_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x18b)]['errors']>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x17a)][_0x3d012a(0x1f6)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x21d)][_0x3d012a(0x1f6)]>0x0||_0x5b7cf2['counts'][_0x3d012a(0x1c2)][_0x3d012a(0x1f6)]>0x0||_0x5b7cf2['counts'][_0x3d012a(0x208)][_0x3d012a(0x1f6)]>0x0;_0x471128?console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ae)](_0x3d012a(0x206))):console['log'](a4_0x47f33c[_0x3d012a(0x1dc)](_0x3d012a(0x1c7)));console[_0x3d012a(0x1b2)](_0x3d012a(0x185)+_0x5b7cf2[_0x3d012a(0x20a)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x186)+_0x5b7cf2['newProjectName']),console[_0x3d012a(0x1b2)](_0x3d012a(0x1aa)+_0x5b7cf2[_0x3d012a(0x20e)]),console['log'](),console[_0x3d012a(0x1b2)](_0x3d012a(0x21b)),console[_0x3d012a(0x1b2)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x18b)])),console['log'](_0x3d012a(0x18d)+formatCountSummary(_0x5b7cf2['counts']['knowledgeBases'])),console[_0x3d012a(0x1b2)](_0x3d012a(0x1af)+formatCountSummary(_0x5b7cf2['counts']['prompts'])),console[_0x3d012a(0x1b2)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5b7cf2['counts']['integrations']));const _0x5cb32f=_0x5b7cf2[_0x3d012a(0x1d2)]['experimentalKnowledgeBases'][_0x3d012a(0x1be)]>0x0||_0x5b7cf2['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x1c2)][_0x3d012a(0x1cd)]>0x0||_0x5b7cf2['counts'][_0x3d012a(0x208)][_0x3d012a(0x1be)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)]['experimentalArtifacts'][_0x3d012a(0x1d9)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x208)][_0x3d012a(0x1cd)]>0x0;_0x5cb32f&&(console['log'](_0x3d012a(0x222)+formatCountSummary(_0x5b7cf2['counts'][_0x3d012a(0x1c2)])),console['log'](_0x3d012a(0x181)+formatCountSummary(_0x5b7cf2['counts'][_0x3d012a(0x208)])));if(_0x471128){console['log'](),console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x197)));for(const _0x20ee18 of _0x5b7cf2[_0x3d012a(0x18b)]){_0x20ee18[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console['log'](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x187)+_0x20ee18[_0x3d012a(0x1d8)]+_0x3d012a(0x1cf)+_0x20ee18[_0x3d012a(0x1e2)]));}for(const _0x190ffe of _0x5b7cf2['knowledgeBases']){_0x190ffe[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x190)+_0x190ffe[_0x3d012a(0x188)]+_0x3d012a(0x1cf)+_0x190ffe[_0x3d012a(0x1e2)]));}for(const _0x4a1fe0 of _0x5b7cf2['prompts']){_0x4a1fe0[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console['log'](a4_0x47f33c[_0x3d012a(0x1ca)]('\x20\x20Prompt\x20\x22'+_0x4a1fe0['name']+_0x3d012a(0x1cf)+_0x4a1fe0[_0x3d012a(0x1e2)]));}for(const _0x541d15 of _0x5b7cf2[_0x3d012a(0x1b9)]){_0x541d15[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x17c)+_0x541d15['name']+_0x3d012a(0x1cf)+_0x541d15[_0x3d012a(0x1e2)]));}for(const _0x32a584 of _0x5b7cf2[_0x3d012a(0x1c2)]){_0x32a584['action']===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x211)+_0x32a584['name']+'\x22:\x20'+_0x32a584[_0x3d012a(0x1e2)]));}for(const _0x27545c of _0x5b7cf2[_0x3d012a(0x208)]){_0x27545c['action']===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x27545c[_0x3d012a(0x188)]+'\x22:\x20'+_0x27545c[_0x3d012a(0x1e2)]));}return 0x1;}console[_0x3d012a(0x1b2)]();const _0x94a397=getLLMProjectUrl(_0x332e3a,_0x5b7cf2[_0x3d012a(0x20e)]);return console['log'](_0x3d012a(0x1df)+a4_0x47f33c[_0x3d012a(0x225)](_0x94a397)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x468322(0x188)]=a4_0x468322(0x214);[a4_0x468322(0x1ce)]=a4_0x468322(0x18c);async[a4_0x468322(0x22a)](_0xfc529c){const _0x4eed85=a4_0x468322,{options:_0x3d5c7b,args:_0x132866,tdx:_0x1a1f63}=_0xfc529c;let _0x4050ac=_0x132866[0x0]||process[_0x4eed85(0x1e5)]();const _0x1f8578=_0x3d5c7b[_0x4eed85(0x1de)],_0x284782=_0x3d5c7b[_0x4eed85(0x1ec)],_0x465cf2=_0x3d5c7b[_0x4eed85(0x237)],_0x2c76cb=_0x3d5c7b[_0x4eed85(0x19b)],_0x142a7b=a4_0x1a16d8[_0x4eed85(0x1f3)](_0x4050ac,_0x4eed85(0x1f2)),_0x3cfdc1=existsSync(_0x142a7b);if(_0x3cfdc1){const {data:_0x184926}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x4050ac+'\x22...',()=>_0x1a1f63['llm']['pushAgent'](_0x4050ac,{'dryRun':_0x1f8578,'force':_0x284782}));if(_0x1f8578)return console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4eed85(0x1b2)](_0x4eed85(0x207)+_0x184926[_0x4eed85(0x1d8)]),0x0;if(_0x184926[_0x4eed85(0x231)]===_0x4eed85(0x1e2))return console['log'](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x1db)+_0x184926[_0x4eed85(0x1e2)])),0x1;console['log'](a4_0x47f33c['green'](_0x4eed85(0x219)+_0x184926[_0x4eed85(0x231)]+_0x4eed85(0x1b0))),console['log'](_0x4eed85(0x182)+_0x184926[_0x4eed85(0x1d8)]);if(_0x184926[_0x4eed85(0x17b)]&&_0x184926[_0x4eed85(0x22b)]){const _0xa38a8=getLLMAgentChatUrl(_0x2c76cb,_0x184926[_0x4eed85(0x22b)],_0x184926['agentId']);console[_0x4eed85(0x1b2)](_0x4eed85(0x1a4)+a4_0x47f33c['cyan'](_0xa38a8));}return 0x0;}const _0x5beeda=_0x3d5c7b[_0x4eed85(0x192)],_0x26e0e9=resolveProjectFromContext(_0x4050ac,_0x5beeda);if(_0x26e0e9[_0x4eed85(0x226)])_0x4050ac=_0x26e0e9['projectDir'],_0x26e0e9[_0x4eed85(0x1ef)]==='context'&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1f1)](_0x4eed85(0x1e6)+_0x4050ac));else{let _0x267214=_0x4eed85(0x1fb);_0x26e0e9[_0x4eed85(0x1bc)]==='no_local_folder'&&(_0x267214=_0x26e0e9['message']+_0x4eed85(0x1e3)+_0x26e0e9['llmProject']+_0x4eed85(0x184));throw new SDKError(ErrorCode[_0x4eed85(0x1c3)],_0x26e0e9[_0x4eed85(0x1bc)]===_0x4eed85(0x205)?_0x26e0e9['message']:_0x4eed85(0x1ac)+_0x4050ac,undefined,{'helpText':_0x267214});}const {data:_0x3e07a7}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x1a1f63['llm'][_0x4eed85(0x1ed)](_0x4050ac,{'dryRun':!![]})),_0x436ebe=_0x3e07a7['counts'][_0x4eed85(0x18b)]['errors']>0x0;if(_0x436ebe){console['log'](a4_0x47f33c[_0x4eed85(0x1ca)]('\x0aErrors\x20found:'));for(const _0x109032 of _0x3e07a7[_0x4eed85(0x18b)]){_0x109032[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x187)+_0x109032[_0x4eed85(0x1d8)]+_0x4eed85(0x1cf)+_0x109032[_0x4eed85(0x1e2)]));}return 0x1;}const _0x2cc85f=_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x18b)]['created']+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x17a)]['created']+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)][_0x4eed85(0x1be)]+_0x3e07a7['counts']['prompts'][_0x4eed85(0x1be)]+_0x3e07a7[_0x4eed85(0x1d2)]['integrations'][_0x4eed85(0x1be)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)][_0x4eed85(0x1be)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x208)][_0x4eed85(0x1be)],_0x10b001=_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x18b)][_0x4eed85(0x1d9)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x17a)][_0x4eed85(0x1d9)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)]['updated']+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x21d)][_0x4eed85(0x1d9)]+_0x3e07a7['counts'][_0x4eed85(0x1b9)][_0x4eed85(0x1d9)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)]['updated']+_0x3e07a7['counts'][_0x4eed85(0x208)][_0x4eed85(0x1d9)],_0x5d691d=_0x3e07a7['counts']['agents'][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)]['knowledgeBases'][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x21d)][_0x4eed85(0x1cd)]+_0x3e07a7['counts'][_0x4eed85(0x1b9)][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)][_0x4eed85(0x1cd)]+_0x3e07a7['counts']['experimentalArtifacts']['unchanged'];console['log'](_0x4eed85(0x1fc)+_0x3e07a7[_0x4eed85(0x191)]+'\x27:'),console[_0x4eed85(0x1b2)]('\x20\x20'+a4_0x47f33c[_0x4eed85(0x1dc)]('+\x20'+_0x2cc85f+_0x4eed85(0x1fe))+_0x4eed85(0x229)+a4_0x47f33c[_0x4eed85(0x1ae)]('~\x20'+_0x10b001+'\x20changed')+_0x4eed85(0x229)+a4_0x47f33c['dim']('=\x20'+_0x5d691d+_0x4eed85(0x1ad))),console[_0x4eed85(0x1b2)](_0x4eed85(0x1bf)+formatCountSummary(_0x3e07a7['counts'][_0x4eed85(0x18b)])),console[_0x4eed85(0x1b2)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3e07a7[_0x4eed85(0x1d2)]['knowledgeBases'])),console[_0x4eed85(0x1b2)](_0x4eed85(0x1bd)+formatCountSummary(_0x3e07a7['counts'][_0x4eed85(0x1c4)])),console[_0x4eed85(0x1b2)](_0x4eed85(0x1af)+formatCountSummary(_0x3e07a7['counts']['prompts'])),console[_0x4eed85(0x1b2)](_0x4eed85(0x1c0)+formatCountSummary(_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1b9)]));const _0x32b001=_0x3e07a7['counts']['experimentalKnowledgeBases'][_0x4eed85(0x1be)]>0x0||_0x3e07a7['counts'][_0x4eed85(0x1c2)][_0x4eed85(0x1d9)]>0x0||_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)][_0x4eed85(0x1cd)]>0x0||_0x3e07a7['counts'][_0x4eed85(0x208)][_0x4eed85(0x1be)]>0x0||_0x3e07a7['counts'][_0x4eed85(0x208)][_0x4eed85(0x1d9)]>0x0||_0x3e07a7['counts']['experimentalArtifacts']['unchanged']>0x0;_0x32b001&&(console['log'](_0x4eed85(0x222)+formatCountSummary(_0x3e07a7['counts'][_0x4eed85(0x1c2)])),console['log'](_0x4eed85(0x181)+formatCountSummary(_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x208)])));console[_0x4eed85(0x1b2)](_0x4eed85(0x1f8)+a4_0x47f33c[_0x4eed85(0x225)](_0x4050ac)),displayDiffs(_0x3e07a7[_0x4eed85(0x18b)],_0x3e07a7[_0x4eed85(0x17a)],_0x3e07a7[_0x4eed85(0x1c4)],_0x3e07a7[_0x4eed85(0x21d)],_0x3e07a7['integrations'],_0x3e07a7[_0x4eed85(0x1c2)],_0x3e07a7[_0x4eed85(0x208)]);if(_0x1f8578)return console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)](_0x4eed85(0x1b5))),0x0;if(_0x2cc85f===0x0&&_0x10b001===0x0){console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1dc)](_0x4eed85(0x1f0)));const _0xbed347=getLLMProjectUrl(_0x2c76cb,_0x3e07a7[_0x4eed85(0x22b)]);return console[_0x4eed85(0x1b2)](_0x4eed85(0x1df)+a4_0x47f33c[_0x4eed85(0x225)](_0xbed347)),0x0;}if(!_0x465cf2&&!_0x284782){if(!isInteractive())return console[_0x4eed85(0x1e2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x221)),_0x4eed85(0x19e)),console[_0x4eed85(0x1e2)](a4_0x47f33c['dim'](_0x4eed85(0x1b7))),0x1;const _0x285c23=await confirmKey('\x0aPush\x20'+(_0x2cc85f+_0x10b001)+'\x20resources?');if(!_0x285c23)return console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)](_0x4eed85(0x22d)),_0x4eed85(0x1a8)),0x1;}const {data:_0x4fd1be}=await withSpinner(_0x4eed85(0x235),()=>_0x1a1f63[_0x4eed85(0x20d)][_0x4eed85(0x1ed)](_0x4050ac,{'force':_0x284782})),_0x30e22f=_0x4fd1be[_0x4eed85(0x1d2)][_0x4eed85(0x18b)][_0x4eed85(0x1f6)]>0x0||_0x4fd1be[_0x4eed85(0x1d2)][_0x4eed85(0x17a)]['errors']>0x0||_0x4fd1be[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)][_0x4eed85(0x1f6)]>0x0||_0x4fd1be['counts'][_0x4eed85(0x21d)]['errors']>0x0;if(_0x30e22f){console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)](_0x4eed85(0x22e))),console[_0x4eed85(0x1b2)](),console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x197)));for(const _0x3372bf of _0x4fd1be[_0x4eed85(0x18b)]){_0x3372bf[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x187)+_0x3372bf['agentName']+_0x4eed85(0x1cf)+_0x3372bf[_0x4eed85(0x1e2)]));}for(const _0x55d95e of _0x4fd1be['knowledgeBases']){_0x55d95e[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x190)+_0x55d95e['name']+_0x4eed85(0x1cf)+_0x55d95e[_0x4eed85(0x1e2)]));}for(const _0x4aae82 of _0x4fd1be[_0x4eed85(0x1c4)]){_0x4aae82[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x1c8)+_0x4aae82[_0x4eed85(0x188)]+_0x4eed85(0x1cf)+_0x4aae82[_0x4eed85(0x1e2)]));}for(const _0x15582a of _0x4fd1be[_0x4eed85(0x21d)]){_0x15582a[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x1c6)+_0x15582a[_0x4eed85(0x188)]+_0x4eed85(0x1cf)+_0x15582a[_0x4eed85(0x1e2)]));}for(const _0x90e45d of _0x4fd1be[_0x4eed85(0x1b9)]){_0x90e45d[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)]('\x20\x20Integration\x20\x22'+_0x90e45d[_0x4eed85(0x188)]+_0x4eed85(0x1cf)+_0x90e45d[_0x4eed85(0x1e2)]));}return 0x1;}console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1dc)](_0x4eed85(0x194)+(_0x2cc85f+_0x10b001)+'\x20resources\x20to\x20\x27'+_0x4fd1be[_0x4eed85(0x191)]+'\x27'));const _0x20b54a=getLLMProjectUrl(_0x2c76cb,_0x4fd1be['projectId']);return console[_0x4eed85(0x1b2)](_0x4eed85(0x1df)+a4_0x47f33c[_0x4eed85(0x225)](_0x20b54a)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0xb0df85=a5_0x1e4a;function a5_0x1e4a(_0x3a36b2,_0x2a904a){_0x3a36b2=_0x3a36b2-0x138;const _0x2fe819=a5_0x2fe8();let _0x1e4a4f=_0x2fe819[_0x3a36b2];return _0x1e4a4f;}(function(_0xbd2e7,_0x424a1d){const _0x209128=a5_0x1e4a,_0x5b6166=_0xbd2e7();while(!![]){try{const _0x36d920=parseInt(_0x209128(0x143))/0x1*(parseInt(_0x209128(0x1c5))/0x2)+-parseInt(_0x209128(0x14b))/0x3*(-parseInt(_0x209128(0x175))/0x4)+-parseInt(_0x209128(0x158))/0x5*(parseInt(_0x209128(0x1c6))/0x6)+-parseInt(_0x209128(0x194))/0x7+parseInt(_0x209128(0x18f))/0x8*(-parseInt(_0x209128(0x190))/0x9)+parseInt(_0x209128(0x1c3))/0xa+parseInt(_0x209128(0x183))/0xb*(parseInt(_0x209128(0x1b7))/0xc);if(_0x36d920===_0x424a1d)break;else _0x5b6166['push'](_0x5b6166['shift']());}catch(_0xb151b8){_0x5b6166['push'](_0x5b6166['shift']());}}}(a5_0x2fe8,0xe4783));import*as a5_0x1a911a from'node:fs';import*as a5_0x163c04 from'node:path';import a5_0x1f5500 from'chalk';import{BaseCommand}from'./command.js';function a5_0x2fe8(){const _0x204497=['no_local_folder','Passed:\x20\x20\x20','reeval','isSpinning','size','no_context','green','\x20\x20Round\x20','status','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','PASS','jsonl','\x20\x20Site:\x20','✗\x20ERROR:\x20','toLowerCase','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','resolve','tags','Using\x20agent:\x20','Evaluating\x20response...','agent:test','No\x20tests\x20have\x20tags\x20defined.','ERROR','table','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Test\x20','stop','600DoqziF','start','reason','Executing\x20new\x20tests...','test.yml','log','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Conversation:\x20','\x20\x20Project:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Test\x20Summary','filter','...','55AKyQDf','output','found','agentDirs','length','has','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Agent:\x20','agentName','yellow','cyan','dim','8304vGntVP','9711KWkUgv','map','...\x20','Failed:\x20\x20\x20','6749904GbZLab','multiple_agents','Available\x20tests:\x20','✓\x20PASS:\x20','context','eval','verbose','Test\x20Configuration:','tsv','Total:\x20\x20\x20\x20','json','No\x20tests\x20found\x20with\x20tags:\x20','site','writeFileSync','split','tests','404','FAIL','description','agent','red','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','not\x20found','\x27\x20to\x20create\x20the\x20folder\x20structure.','Cached\x20run\x20from:\x20','join','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20-\x20','✗\x20FAIL:\x20','\x20\x20Agent:\x20','timestamp','Usage:','Available\x20tags:\x20','Re-evaluating...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','3536868wPggqQ','toISOString','now','resolveProjectId','\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','Conversation\x20URL:\x20','text','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','No\x20tests\x20found\x20matching:\x20','Tests\x20found:\x20','add','utf-8','14886040bokSdd','\x22:\x20','1880514sQQuhF','102shbPsA','Site:\x20','push','Re-evaluation\x20Summary','Output\x20written\x20to:\x20','New\x20tests\x20to\x20execute:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Running:\x20','includes','repeat','white','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','\x20(new)','✗\x20ERROR:\x20Project\x20not\x20found:\x20','llm','projectName','rounds','find','1ihRaBM','Error\x20writing\x20output\x20file:\x20','Project\x20path:\x20','message','Run\x20tests\x20for\x20an\x20LLM\x20agent','Round\x201/','Round\x20','no_tests','7413WCyLwq','llmProject','Duration:\x20','projectDir','Error:\x20No\x20previous\x20test\x20run\x20found.','execute','forEach',':\x20Sending\x20user\x20input...','conversations','name','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','trim','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','368565UhwTRF','conversation_url'];a5_0x2fe8=function(){return _0x204497;};return a5_0x2fe8();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xb0df85(0x154)]=a5_0xb0df85(0x16e);[a5_0xb0df85(0x1a6)]=a5_0xb0df85(0x147);async[a5_0xb0df85(0x150)](_0x1c1ced){const _0x447390=a5_0xb0df85,{options:_0x3ca6e7,args:_0x3e8562,tdx:_0x362700}=_0x1c1ced,_0x65541c=_0x3e8562[0x0]||'.',_0x18ac5d=_0x3ca6e7['dryRun'],_0x1e8f72=_0x3ca6e7,_0x202e12=_0x1e8f72[_0x447390(0x199)]===![],_0x492ff8=_0x1e8f72[_0x447390(0x15c)],_0x3437a8=_0x1e8f72['name'],_0x51fd06=_0x1e8f72[_0x447390(0x16b)],_0x3972b2=_0x3ca6e7[_0x447390(0x1a0)],_0x249c90=_0x1e8f72[_0x447390(0x184)];if(_0x492ff8&&_0x202e12)return console[_0x447390(0x17a)](a5_0x1f5500['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2309b4=_0x447390(0x171);if(_0x1e8f72[_0x447390(0x19e)])_0x2309b4=_0x447390(0x19e);else{if(_0x1e8f72[_0x447390(0x165)])_0x2309b4=_0x447390(0x165);else{if(_0x1e8f72[_0x447390(0x19c)])_0x2309b4='tsv';else{if(_0x1e8f72[_0x447390(0x171)])_0x2309b4=_0x447390(0x171);}}}const _0x260b47=_0x1e8f72[_0x447390(0x14c)];let _0x2d8b35=_0x65541c;const _0x1c4296=a5_0x1a911a['existsSync'](_0x65541c),_0x57a89b=_0x65541c==='.';if(!_0x1c4296||_0x57a89b){const _0x1f57a7=resolveProjectFromContext(_0x65541c,_0x260b47,{'requireFile':_0x447390(0x179)});if(_0x1f57a7[_0x447390(0x185)])_0x2d8b35=_0x1f57a7['projectDir'],_0x1f57a7['source']===_0x447390(0x198)&&console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x16c)+_0x2d8b35));else switch(_0x1f57a7[_0x447390(0x177)]){case _0x447390(0x15f):console['log'](a5_0x1f5500[_0x447390(0x18c)](_0x1f57a7[_0x447390(0x146)])),console[_0x447390(0x17a)](),console['log'](_0x447390(0x1b3)),console[_0x447390(0x17a)](_0x447390(0x1bb)),console[_0x447390(0x17a)]('\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[_0x447390(0x17a)](),console['log'](_0x447390(0x163));return 0x1;case _0x447390(0x15a):console['log'](a5_0x1f5500[_0x447390(0x18c)](_0x1f57a7[_0x447390(0x146)])),console[_0x447390(0x17a)](),console['log'](_0x447390(0x1cc)+_0x1f57a7[_0x447390(0x14c)]+_0x447390(0x1ab));return 0x1;case _0x447390(0x195):{const _0x5c7fcb=a5_0x163c04['basename'](_0x1f57a7['projectDir']);console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18c)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x1f57a7[_0x447390(0x14c)]+'\x22:'));for(const _0x4e0556 of _0x1f57a7[_0x447390(0x186)]){console[_0x447390(0x17a)]('\x20\x20-\x20'+_0x4e0556);}return console[_0x447390(0x17a)](),console[_0x447390(0x17a)](_0x447390(0x169)+_0x5c7fcb+'/<agent-name>'),0x1;}case _0x447390(0x14a):console[_0x447390(0x17a)](a5_0x1f5500['yellow'](_0x447390(0x155)+_0x1f57a7[_0x447390(0x14c)]+'\x22.')),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x145)+_0x1f57a7[_0x447390(0x14e)])),console[_0x447390(0x17a)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1cf8eb,agentInfo:_0x255fd3}=parseTestFile(_0x2d8b35);let _0x1a378b=_0x1cf8eb[_0x447390(0x1a3)];if(_0x3437a8){const _0x1b1ee5=_0x3437a8[_0x447390(0x1a2)](',')[_0x447390(0x191)](_0x2663c2=>_0x2663c2[_0x447390(0x156)]());_0x1a378b=_0x1cf8eb[_0x447390(0x1a3)][_0x447390(0x181)](_0x4505a1=>_0x1b1ee5['includes'](_0x4505a1[_0x447390(0x154)]));if(_0x1a378b['length']===0x0)return console['log'](a5_0x1f5500['yellow'](_0x447390(0x1bf)+_0x3437a8)),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x196)+_0x1cf8eb['tests'][_0x447390(0x191)](_0x5c15f6=>_0x5c15f6[_0x447390(0x154)])[_0x447390(0x1ad)](',\x20'))),0x1;}if(_0x51fd06){const _0x103603=_0x51fd06['split'](',')[_0x447390(0x191)](_0x2c55a5=>_0x2c55a5[_0x447390(0x156)]()['toLowerCase']());_0x1a378b=_0x1a378b[_0x447390(0x181)](_0xebe82a=>_0xebe82a[_0x447390(0x16b)]?.['some'](_0xaa9417=>_0x103603['includes'](_0xaa9417[_0x447390(0x168)]())));if(_0x1a378b[_0x447390(0x187)]===0x0){console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18c)](_0x447390(0x19f)+_0x51fd06));const _0x1cafb6=new Set();return _0x1cf8eb['tests'][_0x447390(0x151)](_0x395436=>_0x395436['tags']?.['forEach'](_0x856bcb=>_0x1cafb6[_0x447390(0x1c1)](_0x856bcb))),_0x1cafb6[_0x447390(0x15e)]>0x0?console['log'](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x1b4)+[..._0x1cafb6]['join'](',\x20'))):console['log'](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x16f))),0x1;}}if(_0x492ff8)return this['executeReeval'](_0x1c1ced,{'definition':{'tests':_0x1a378b},'agentInfo':_0x255fd3,'outputFormat':_0x2309b4,'outputFile':_0x249c90,'testNames':_0x3437a8});if(_0x18ac5d){console['log'](a5_0x1f5500[_0x447390(0x18d)](_0x447390(0x19b))),console[_0x447390(0x17a)](_0x447390(0x166)+a5_0x1f5500[_0x447390(0x13a)](_0x3972b2)),console['log'](_0x447390(0x17d)+a5_0x1f5500[_0x447390(0x13a)](_0x255fd3[_0x447390(0x140)])),console[_0x447390(0x17a)](_0x447390(0x1b1)+a5_0x1f5500['white'](_0x255fd3[_0x447390(0x18b)])),console['log'](),console['log'](_0x447390(0x1c0)+a5_0x1f5500['white'](_0x1a378b[_0x447390(0x187)]));for(let _0x2a6d77=0x0;_0x2a6d77<_0x1a378b[_0x447390(0x187)];_0x2a6d77++){const _0x36ff35=_0x1a378b[_0x2a6d77],_0x271367=_0x36ff35[_0x447390(0x141)][_0x447390(0x187)]===0x1?'round':'rounds',_0x274fa5=_0x36ff35[_0x447390(0x16b)]?.['length']?'\x20['+_0x36ff35[_0x447390(0x16b)]['join'](',\x20')+']':'';console[_0x447390(0x17a)]('\x20\x20'+(_0x2a6d77+0x1)+'.\x20'+a5_0x1f5500[_0x447390(0x13a)](_0x36ff35[_0x447390(0x154)])+'\x20('+_0x36ff35[_0x447390(0x141)][_0x447390(0x187)]+'\x20'+_0x271367+')'+a5_0x1f5500[_0x447390(0x18e)](_0x274fa5));}return 0x0;}let _0x5aeaaa,_0x6273dc;try{_0x5aeaaa=await _0x362700[_0x447390(0x13f)][_0x447390(0x1ba)](_0x255fd3['projectName']);}catch(_0x4e7124){const _0x3236fc=_0x4e7124 instanceof Error?_0x4e7124[_0x447390(0x146)]:String(_0x4e7124);return _0x3236fc[_0x447390(0x138)](_0x447390(0x1a4))||_0x3236fc[_0x447390(0x168)]()[_0x447390(0x138)](_0x447390(0x1aa))?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x13e)+_0x255fd3[_0x447390(0x140)])):console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x1a9)+_0x255fd3[_0x447390(0x140)]+'\x22:\x20'+_0x3236fc)),0x1;}try{_0x6273dc=await _0x362700[_0x447390(0x13f)]['resolveAgentId'](_0x255fd3[_0x447390(0x18b)],_0x5aeaaa);}catch(_0x3d79a2){const _0x416284=_0x3d79a2 instanceof Error?_0x3d79a2[_0x447390(0x146)]:String(_0x3d79a2);return _0x416284['includes']('404')||_0x416284[_0x447390(0x168)]()[_0x447390(0x138)]('not\x20found')?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x1b6)+_0x255fd3[_0x447390(0x18b)])):console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x189)+_0x255fd3[_0x447390(0x18b)]+_0x447390(0x1c4)+_0x416284)),0x1;}let _0x4486a5;if(!_0x202e12)try{_0x4486a5=await setupEvaluatorAgent(_0x362700[_0x447390(0x13f)],_0x3ca6e7[_0x447390(0x19a)]);}catch(_0x1940c0){const _0x3fc0f3=_0x1940c0 instanceof Error?_0x1940c0['message']:String(_0x1940c0);return console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3fc0f3)),0x1;}console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18d)]('Running\x20agent\x20tests...')),console[_0x447390(0x17a)](_0x447390(0x1c7)+a5_0x1f5500['white'](_0x3972b2)),console['log'](_0x447390(0x18a)+a5_0x1f5500[_0x447390(0x13a)](_0x255fd3['projectName']+'/'+_0x255fd3[_0x447390(0x18b)])),console[_0x447390(0x17a)]();const _0x2ac577=[],_0x421542=[],_0x11032d=Date[_0x447390(0x1b9)]();for(let _0x2854f9=0x0;_0x2854f9<_0x1a378b['length'];_0x2854f9++){const _0x224892=_0x1a378b[_0x2854f9];_0x1a378b[_0x447390(0x187)]>0x1?console[_0x447390(0x17a)](_0x447390(0x173)+(_0x2854f9+0x1)+'/'+_0x1a378b[_0x447390(0x187)]+':\x20'+a5_0x1f5500['white'](_0x224892[_0x447390(0x154)])):console['log']('Running\x20test:\x20'+a5_0x1f5500[_0x447390(0x13a)](_0x224892[_0x447390(0x154)]));const _0x211ad8=createCommandSpinner(_0x447390(0x148)+_0x224892[_0x447390(0x141)]['length']+_0x447390(0x152));_0x211ad8[_0x447390(0x176)]();try{const {result:_0xce5cc5,conversation:_0x239e3c}=await runTest(_0x362700[_0x447390(0x13f)],_0x224892,{'agentId':_0x6273dc,'projectId':_0x5aeaaa,'site':_0x3972b2,'noEval':_0x202e12,'evaluatorId':_0x4486a5,'onRoundStart':(_0x7e8822,_0x4bc2b3)=>{const _0x3cf4f5=_0x447390;_0x211ad8[_0x3cf4f5(0x1bd)]=_0x3cf4f5(0x149)+(_0x7e8822+0x1)+'/'+_0x4bc2b3+_0x3cf4f5(0x152);},'onRoundComplete':(_0x3c0025,_0x1c45af,_0x36ea84)=>{const _0x375beb=_0x447390,_0x46bb09=formatElapsed(_0x1c45af);_0x36ea84?console[_0x375beb(0x17a)](_0x375beb(0x161)+(_0x3c0025+0x1)+'/'+_0x224892['rounds'][_0x375beb(0x187)]+_0x375beb(0x192)+a5_0x1f5500[_0x375beb(0x160)]('✓')+'\x20('+_0x46bb09+')'):console[_0x375beb(0x17a)](_0x375beb(0x161)+(_0x3c0025+0x1)+'/'+_0x224892['rounds'][_0x375beb(0x187)]+_0x375beb(0x192)+a5_0x1f5500[_0x375beb(0x1a8)]('✗'));},'onEvaluationStart':()=>{const _0x3bd89e=_0x447390;_0x211ad8[_0x3bd89e(0x1bd)]=_0x3bd89e(0x16d);},'onEvaluationComplete':_0x2dc74b=>{const _0x45605a=_0x447390,_0x27a4e8=formatElapsed(_0x2dc74b);console[_0x45605a(0x17a)]('\x20\x20Evaluating...\x20'+a5_0x1f5500[_0x45605a(0x160)]('✓')+'\x20('+_0x27a4e8+')');}});_0x211ad8[_0x447390(0x174)](),_0x2ac577[_0x447390(0x1c8)](_0xce5cc5),_0x421542[_0x447390(0x1c8)](_0x239e3c);if(_0xce5cc5[_0x447390(0x162)]===_0x447390(0x164))console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x160)](_0x447390(0x197)+_0xce5cc5[_0x447390(0x177)]));else _0xce5cc5[_0x447390(0x162)]===_0x447390(0x1a5)?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20FAIL:\x20'+_0xce5cc5[_0x447390(0x177)])):console['log'](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x167)+_0xce5cc5[_0x447390(0x177)]));_0xce5cc5[_0x447390(0x159)]&&console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x1bc)+_0xce5cc5['conversation_url'])),console[_0x447390(0x17a)]();}catch(_0x3c7493){_0x211ad8['stop']();const _0xf9f83c=_0x3c7493 instanceof Error?_0x3c7493[_0x447390(0x146)]:String(_0x3c7493);console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20ERROR:\x20'+_0xf9f83c)),console[_0x447390(0x17a)](),_0x2ac577['push']({'name':_0x224892[_0x447390(0x154)],'status':_0x447390(0x170),'reason':_0xf9f83c,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x25dfe5=Date[_0x447390(0x1b9)]()-_0x11032d,_0x38a8aa=_0x2ac577[_0x447390(0x181)](_0x24c8e2=>_0x24c8e2[_0x447390(0x162)]==='PASS')[_0x447390(0x187)],_0x59034a=_0x2ac577[_0x447390(0x181)](_0x5d31c2=>_0x5d31c2[_0x447390(0x162)]===_0x447390(0x1a5))['length'],_0x4ee738=_0x2ac577[_0x447390(0x181)](_0x27b199=>_0x27b199[_0x447390(0x162)]==='ERROR')[_0x447390(0x187)];console[_0x447390(0x17a)]('━'[_0x447390(0x139)](0x3c)),console['log'](_0x447390(0x180)),console[_0x447390(0x17a)]('━'[_0x447390(0x139)](0x3c)),console['log'](_0x447390(0x19d)+_0x2ac577[_0x447390(0x187)]),console[_0x447390(0x17a)](_0x447390(0x15b)+a5_0x1f5500[_0x447390(0x160)](_0x38a8aa)),console['log'](_0x447390(0x193)+a5_0x1f5500[_0x447390(0x1a8)](_0x59034a));_0x4ee738>0x0&&console[_0x447390(0x17a)]('Errors:\x20\x20\x20'+a5_0x1f5500['red'](_0x4ee738));console[_0x447390(0x17a)](_0x447390(0x14d)+formatElapsed(_0x25dfe5)),console['log']('━'['repeat'](0x3c));const _0x31e14a=_0x2ac577[_0x447390(0x181)](_0x4a7b32=>_0x4a7b32[_0x447390(0x162)]!=='PASS');if(_0x31e14a['length']>0x0){console[_0x447390(0x17a)](),console['log']('Failed\x20Tests:');for(const _0x545113 of _0x31e14a){const _0x40f749=a5_0x1f5500['red']('✗'),_0x3b8057=_0x545113[_0x447390(0x177)][_0x447390(0x187)]>0x32?_0x545113[_0x447390(0x177)]['substring'](0x0,0x32)+'...':_0x545113[_0x447390(0x177)];console[_0x447390(0x17a)]('\x20\x20'+_0x40f749+'\x20'+_0x545113[_0x447390(0x154)]+':\x20'+_0x3b8057);}}const _0x170a6c={'summary':{'total':_0x2ac577[_0x447390(0x187)],'passed':_0x38a8aa,'failed':_0x59034a,'errors':_0x4ee738>0x0?_0x4ee738:undefined,'duration_ms':_0x25dfe5},'tests':_0x2ac577,'agent':{'project':_0x255fd3[_0x447390(0x140)],'name':_0x255fd3['agentName'],'site':_0x3972b2},'timestamp':new Date(_0x11032d)[_0x447390(0x1b8)]()};try{const _0x20a7c0=buildCachedTestRun(_0x421542,{'site':_0x3972b2,'projectId':_0x5aeaaa,'projectName':_0x255fd3[_0x447390(0x140)],'agentId':_0x6273dc,'agentName':_0x255fd3[_0x447390(0x18b)],'testYmlPath':a5_0x163c04[_0x447390(0x16a)](_0x255fd3['testYmlPath'])});saveLastTestRun(_0x20a7c0);}catch{}if(_0x2309b4!=='table'||_0x249c90){const _0x472577=formatResults(_0x170a6c,_0x2309b4);if(_0x249c90)try{a5_0x1a911a[_0x447390(0x1a1)](_0x249c90,_0x472577,_0x447390(0x1c2)),console[_0x447390(0x17a)](),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x1ca)+_0x249c90));}catch(_0x3ad8e2){return console[_0x447390(0x17a)](),console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x144)+_0x3ad8e2)),0x1;}else console[_0x447390(0x17a)](),console[_0x447390(0x17a)](_0x472577);}return _0x31e14a[_0x447390(0x187)]>0x0?0x1:0x0;}async['executeReeval'](_0x4ce18d,_0x2c3211){const _0x34468b=a5_0xb0df85,{options:_0x3d1013,tdx:_0x38193d}=_0x4ce18d,{definition:_0x54e22a,agentInfo:_0x3975dc,outputFormat:_0x31e6ce,outputFile:_0x2b9fe2}=_0x2c3211,_0x3473a2=_0x3d1013['site'],_0x420908=loadLastTestRun();if(!_0x420908)return console['log'](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x14f))),console['log'](a5_0x1f5500['dim'](_0x34468b(0x17e))),0x1;if(_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]!==_0x3975dc[_0x34468b(0x18b)])return console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x17f)+_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]+_0x34468b(0x13b)+_0x3975dc[_0x34468b(0x18b)]+'\x22.')),console['log'](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1be))),0x1;const _0x46ab01=new Set(_0x420908[_0x34468b(0x153)]['map'](_0x530e10=>_0x530e10['testName'])),_0x2c24ba=_0x54e22a[_0x34468b(0x1a3)][_0x34468b(0x181)](_0x21ef67=>!_0x46ab01[_0x34468b(0x188)](_0x21ef67['name']));if(_0x2c24ba[_0x34468b(0x187)]>0x0&&_0x420908[_0x34468b(0x1a0)]!==_0x3473a2)return console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x172))),console['log'](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1ae)+_0x420908[_0x34468b(0x1a0)]+_0x34468b(0x17b)+_0x3473a2+'\x22.')),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x13c)+_0x420908['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4d75dc=_0x54e22a[_0x34468b(0x1a3)][_0x34468b(0x181)](_0x27d256=>_0x46ab01[_0x34468b(0x188)](_0x27d256['name'])),_0x1d09f7=_0x2c24ba;let _0x17536c;try{_0x17536c=await setupEvaluatorAgent(_0x38193d[_0x34468b(0x13f)],_0x3d1013['verbose']);}catch(_0x2e1d18){const _0x2bb8a4=_0x2e1d18 instanceof Error?_0x2e1d18[_0x34468b(0x146)]:String(_0x2e1d18);return console[_0x34468b(0x17a)](a5_0x1f5500['red'](_0x34468b(0x157)+_0x2bb8a4)),0x1;}console['log'](a5_0x1f5500[_0x34468b(0x18d)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x34468b(0x17a)](_0x34468b(0x1ac)+a5_0x1f5500[_0x34468b(0x13a)](_0x420908[_0x34468b(0x1b2)])),console[_0x34468b(0x17a)](_0x34468b(0x18a)+a5_0x1f5500[_0x34468b(0x13a)](_0x420908[_0x34468b(0x1a7)]['projectName']+'/'+_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]));_0x1d09f7[_0x34468b(0x187)]>0x0&&console[_0x34468b(0x17a)](_0x34468b(0x1cb)+a5_0x1f5500[_0x34468b(0x18c)](_0x1d09f7[_0x34468b(0x187)]));console[_0x34468b(0x17a)]();const _0x29328d=[],_0x12d404=Date[_0x34468b(0x1b9)](),_0x30cdc5=createCommandSpinner(_0x34468b(0x1b5));if(_0x4d75dc[_0x34468b(0x187)]>0x0)try{const _0x4a0646=await reevaluateFromCache(_0x38193d[_0x34468b(0x13f)],_0x420908,{'tests':_0x4d75dc},{'evaluatorId':_0x17536c,'onTestStart':(_0x2cb884,_0x540e43,_0x471d64)=>{const _0x4739c8=_0x34468b;_0x30cdc5[_0x4739c8(0x1bd)]='Re-evaluating\x20'+(_0x540e43+0x1)+'/'+_0x471d64+':\x20'+_0x2cb884+_0x4739c8(0x182);if(!_0x30cdc5[_0x4739c8(0x15d)])_0x30cdc5[_0x4739c8(0x176)]();},'onTestComplete':(_0x27d8bf,_0x289f53)=>{const _0x474c80=_0x34468b;_0x30cdc5[_0x474c80(0x174)]();if(_0x289f53[_0x474c80(0x162)]===_0x474c80(0x164))console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x160)](_0x474c80(0x197)+_0x27d8bf)+a5_0x1f5500[_0x474c80(0x18e)]('\x20(cached)'));else _0x289f53[_0x474c80(0x162)]===_0x474c80(0x1a5)?console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x1a8)]('✗\x20FAIL:\x20'+_0x27d8bf+_0x474c80(0x1af)+_0x289f53['reason'])+a5_0x1f5500[_0x474c80(0x18e)]('\x20(cached)')):console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x1a8)](_0x474c80(0x167)+_0x27d8bf+'\x20-\x20'+_0x289f53[_0x474c80(0x177)]));_0x289f53[_0x474c80(0x159)]&&console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x18e)](_0x474c80(0x17c)+_0x289f53[_0x474c80(0x159)])),_0x29328d['push'](_0x289f53);},'onTestSkipped':(_0x3b350b,_0xfe552c)=>{const _0x4b368d=_0x34468b;_0x30cdc5['stop'](),console[_0x4b368d(0x17a)](a5_0x1f5500[_0x4b368d(0x18c)]('⚠\x20SKIPPED:\x20'+_0x3b350b+_0x4b368d(0x1af)+_0xfe552c));}});for(const _0x4b4ac2 of _0x4a0646){!_0x29328d[_0x34468b(0x142)](_0x1adf60=>_0x1adf60[_0x34468b(0x154)]===_0x4b4ac2[_0x34468b(0x154)])&&_0x29328d[_0x34468b(0x1c8)](_0x4b4ac2);}}catch(_0x2b195a){_0x30cdc5[_0x34468b(0x174)]();const _0x219917=_0x2b195a instanceof Error?_0x2b195a[_0x34468b(0x146)]:String(_0x2b195a);return console[_0x34468b(0x17a)](a5_0x1f5500['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x219917)),0x1;}_0x30cdc5['stop']();if(_0x1d09f7[_0x34468b(0x187)]>0x0){console['log'](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18d)](_0x34468b(0x178)));const {projectId:_0x2ef814,agentId:_0x101469}=_0x420908[_0x34468b(0x1a7)];for(const _0x410dd4 of _0x1d09f7){console['log'](_0x34468b(0x1cd)+a5_0x1f5500[_0x34468b(0x13a)](_0x410dd4['name']));const _0x5153c3=createCommandSpinner(_0x34468b(0x148)+_0x410dd4[_0x34468b(0x141)][_0x34468b(0x187)]+_0x34468b(0x152));_0x5153c3[_0x34468b(0x176)]();try{const {result:_0x260c29}=await runTest(_0x38193d['llm'],_0x410dd4,{'agentId':_0x101469,'projectId':_0x2ef814,'site':_0x420908[_0x34468b(0x1a0)],'noEval':![],'evaluatorId':_0x17536c,'onRoundStart':(_0x2dd463,_0x3d688f)=>{const _0x345218=_0x34468b;_0x5153c3[_0x345218(0x1bd)]=_0x345218(0x149)+(_0x2dd463+0x1)+'/'+_0x3d688f+_0x345218(0x152);},'onRoundComplete':(_0x533624,_0x57416e,_0x51bb61)=>{const _0x407f8e=_0x34468b,_0x4963c7=formatElapsed(_0x57416e);_0x51bb61?console[_0x407f8e(0x17a)]('\x20\x20Round\x20'+(_0x533624+0x1)+'/'+_0x410dd4['rounds'][_0x407f8e(0x187)]+_0x407f8e(0x192)+a5_0x1f5500[_0x407f8e(0x160)]('✓')+'\x20('+_0x4963c7+')'):console[_0x407f8e(0x17a)]('\x20\x20Round\x20'+(_0x533624+0x1)+'/'+_0x410dd4[_0x407f8e(0x141)][_0x407f8e(0x187)]+_0x407f8e(0x192)+a5_0x1f5500[_0x407f8e(0x1a8)]('✗'));},'onEvaluationStart':()=>{const _0x2ba94d=_0x34468b;_0x5153c3[_0x2ba94d(0x1bd)]='Evaluating\x20response...';},'onEvaluationComplete':_0x7b6a07=>{const _0x166207=_0x34468b,_0x442c74=formatElapsed(_0x7b6a07);console[_0x166207(0x17a)]('\x20\x20Evaluating...\x20'+a5_0x1f5500[_0x166207(0x160)]('✓')+'\x20('+_0x442c74+')');}});_0x5153c3[_0x34468b(0x174)](),_0x29328d[_0x34468b(0x1c8)](_0x260c29);if(_0x260c29[_0x34468b(0x162)]===_0x34468b(0x164))console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x160)](_0x34468b(0x197)+_0x260c29[_0x34468b(0x177)])+a5_0x1f5500['dim']('\x20(new)'));else _0x260c29[_0x34468b(0x162)]===_0x34468b(0x1a5)?console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x1b0)+_0x260c29['reason'])+a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x13d))):console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x167)+_0x260c29[_0x34468b(0x177)]));_0x260c29[_0x34468b(0x159)]&&console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x17c)+_0x260c29[_0x34468b(0x159)]));}catch(_0x1f6382){_0x5153c3[_0x34468b(0x174)]();const _0x275365=_0x1f6382 instanceof Error?_0x1f6382[_0x34468b(0x146)]:String(_0x1f6382);console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x167)+_0x275365)),_0x29328d[_0x34468b(0x1c8)]({'name':_0x410dd4['name'],'status':_0x34468b(0x170),'reason':_0x275365,'timestamp':new Date()[_0x34468b(0x1b8)](),'duration_ms':0x0});}}}console[_0x34468b(0x17a)]();const _0x2f77b0=Date[_0x34468b(0x1b9)]()-_0x12d404,_0x5d0a7a=_0x29328d[_0x34468b(0x181)](_0x2fd522=>_0x2fd522[_0x34468b(0x162)]===_0x34468b(0x164))[_0x34468b(0x187)],_0x1add85=_0x29328d[_0x34468b(0x181)](_0x23cf31=>_0x23cf31['status']===_0x34468b(0x1a5))[_0x34468b(0x187)],_0x1ee92a=_0x29328d[_0x34468b(0x181)](_0x351b0c=>_0x351b0c[_0x34468b(0x162)]===_0x34468b(0x170))[_0x34468b(0x187)];console[_0x34468b(0x17a)]('━'['repeat'](0x3c)),console[_0x34468b(0x17a)](_0x34468b(0x1c9)),console[_0x34468b(0x17a)]('━'['repeat'](0x3c)),console[_0x34468b(0x17a)]('Total:\x20\x20\x20\x20'+_0x29328d[_0x34468b(0x187)]),console[_0x34468b(0x17a)](_0x34468b(0x15b)+a5_0x1f5500[_0x34468b(0x160)](_0x5d0a7a)),console[_0x34468b(0x17a)]('Failed:\x20\x20\x20'+a5_0x1f5500['red'](_0x1add85));_0x1ee92a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1f5500[_0x34468b(0x1a8)](_0x1ee92a));console[_0x34468b(0x17a)](_0x34468b(0x14d)+formatElapsed(_0x2f77b0)),console[_0x34468b(0x17a)]('━'['repeat'](0x3c));const _0x3875bf={'summary':{'total':_0x29328d[_0x34468b(0x187)],'passed':_0x5d0a7a,'failed':_0x1add85,'errors':_0x1ee92a>0x0?_0x1ee92a:undefined,'duration_ms':_0x2f77b0},'tests':_0x29328d,'agent':{'project':_0x3975dc[_0x34468b(0x140)],'name':_0x3975dc[_0x34468b(0x18b)],'site':_0x3473a2},'timestamp':new Date(_0x12d404)[_0x34468b(0x1b8)]()};if(_0x31e6ce!=='table'||_0x2b9fe2){const _0x3a220a=formatResults(_0x3875bf,_0x31e6ce);if(_0x2b9fe2)try{a5_0x1a911a[_0x34468b(0x1a1)](_0x2b9fe2,_0x3a220a,'utf-8'),console[_0x34468b(0x17a)](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1ca)+_0x2b9fe2));}catch(_0x5819cf){return console['log'](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x144)+_0x5819cf)),0x1;}else console['log'](),console[_0x34468b(0x17a)](_0x3a220a);}const _0x15e7c4=_0x29328d[_0x34468b(0x181)](_0x5011c1=>_0x5011c1[_0x34468b(0x162)]!=='PASS');return _0x15e7c4[_0x34468b(0x187)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x51fdad=a5_0x5bb5;(function(_0x3b14ec,_0x86328b){const _0x5b32dd=a5_0x5bb5,_0xacc89=_0x3b14ec();while(!![]){try{const _0x4647d6=-parseInt(_0x5b32dd(0xf2))/0x1*(parseInt(_0x5b32dd(0x12c))/0x2)+-parseInt(_0x5b32dd(0x124))/0x3+-parseInt(_0x5b32dd(0xef))/0x4*(-parseInt(_0x5b32dd(0xee))/0x5)+-parseInt(_0x5b32dd(0x142))/0x6*(-parseInt(_0x5b32dd(0xec))/0x7)+parseInt(_0x5b32dd(0x138))/0x8+parseInt(_0x5b32dd(0x149))/0x9*(parseInt(_0x5b32dd(0xd4))/0xa)+-parseInt(_0x5b32dd(0x13a))/0xb*(parseInt(_0x5b32dd(0xf6))/0xc);if(_0x4647d6===_0x86328b)break;else _0xacc89['push'](_0xacc89['shift']());}catch(_0x1d83fa){_0xacc89['push'](_0xacc89['shift']());}}}(a5_0x4120,0xd1972));import*as a5_0x368b4c from'node:fs';function a5_0x4120(){const _0x138bb8=['site','\x20\x20Agent:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','toLowerCase','add','tsv','found','Duration:\x20','No\x20tests\x20found\x20matching:\x20','ERROR','Error\x20writing\x20output\x20file:\x20','executeReeval','context','message','tags','2248056lGiJWD','no_context','toISOString','\x27\x20to\x20create\x20the\x20folder\x20structure.','table','New\x20tests\x20to\x20execute:\x20','round','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','196474kcPupx','\x20\x20Site:\x20','name','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20-\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Running\x20agent\x20tests...','eval','reason','push','includes','4152024jeWlRC','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','286DGWhae','red','Re-evaluating\x20','✗\x20FAIL:\x20','join','Round\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20Round\x20','84ppMsuJ','trim','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','dim','forEach','conversation_url','resolve','99LMlbcr','Project\x20path:\x20','\x20(new)','Re-evaluation\x20Summary','repeat','Run\x20tests\x20for\x20an\x20LLM\x20agent','writeFileSync','white','Output\x20written\x20to:\x20','isSpinning','resolveAgentId','Total:\x20\x20\x20\x20','agentName','\x20\x20Project:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','...','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','log','rounds','jsonl','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Failed\x20Tests:','\x20\x20Conversation:\x20','Using\x20agent:\x20','description','Test\x20','FAIL','start','Re-evaluating\x20cached\x20test\x20run...','existsSync','no_tests','source','Passed:\x20\x20\x20','\x22:\x20','\x20\x20-\x20','green','Usage:','filter','597500YUJQVI','not\x20found','cyan','Failed:\x20\x20\x20','Tests\x20found:\x20','...\x20','Running:\x20','404','now','Round\x201/','No\x20tests\x20found\x20with\x20tags:\x20','text','Executing\x20new\x20tests...','size','✗\x20ERROR:\x20','Evaluating\x20response...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Either\x20switch\x20to\x20the\x20\x22','projectName','multiple_agents','projectDir','\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)','llmProject','Conversation\x20URL:\x20','396347zNeEPE','Test\x20Summary','5sbBwFJ','5186728zelPpz','status','agent:test','1VDaVyu','\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','\x20(cached)','Run\x20\x27tdx\x20agent\x20pull\x20','719796lHPsLx','Error:\x20No\x20previous\x20test\x20run\x20found.','stop','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','⚠\x20SKIPPED:\x20','some','agent','Errors:\x20\x20\x20','has','llm','✗\x20ERROR:\x20Project\x20not\x20found:\x20','utf-8','tests','Available\x20tags:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Available\x20tests:\x20','/<agent-name>','map','find','PASS','length','\x20\x20Evaluating...\x20','yellow','output','Site:\x20',':\x20Sending\x20user\x20input...','No\x20tests\x20have\x20tags\x20defined.','reeval','timestamp','Agent:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22'];a5_0x4120=function(){return _0x138bb8;};return a5_0x4120();}import*as a5_0x19d0ef from'node:path';import a5_0x5114ff from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x5bb5(_0x216a1b,_0x2aef58){_0x216a1b=_0x216a1b-0xb1;const _0x412017=a5_0x4120();let _0x5bb595=_0x412017[_0x216a1b];return _0x5bb595;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x51fdad(0x12e)]=a5_0x51fdad(0xf1);[a5_0x51fdad(0xc6)]=a5_0x51fdad(0xb3);async['execute'](_0x2d1b2c){const _0x7cf6d7=a5_0x51fdad,{options:_0x9aa1e,args:_0x1a7a64,tdx:_0x23f152}=_0x2d1b2c,_0x11265d=_0x1a7a64[0x0]||'.',_0x50ac11=_0x9aa1e['dryRun'],_0x50b2d6=_0x9aa1e,_0x1440a8=_0x50b2d6[_0x7cf6d7(0x134)]===![],_0x5e64b5=_0x50b2d6[_0x7cf6d7(0x111)],_0x343c3b=_0x50b2d6[_0x7cf6d7(0x12e)],_0x427d6c=_0x50b2d6[_0x7cf6d7(0x123)],_0x4e7836=_0x9aa1e[_0x7cf6d7(0x115)],_0x269fd1=_0x50b2d6[_0x7cf6d7(0x10d)];if(_0x5e64b5&&_0x1440a8)return console['log'](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xe4))),0x1;let _0x5375ef=_0x7cf6d7(0x128);if(_0x50b2d6['json'])_0x5375ef='json';else{if(_0x50b2d6[_0x7cf6d7(0xc1)])_0x5375ef=_0x7cf6d7(0xc1);else{if(_0x50b2d6['tsv'])_0x5375ef=_0x7cf6d7(0x11a);else{if(_0x50b2d6[_0x7cf6d7(0x128)])_0x5375ef=_0x7cf6d7(0x128);}}}const _0x22117e=_0x50b2d6[_0x7cf6d7(0xea)];let _0x58e311=_0x11265d;const _0x1c5ba5=a5_0x368b4c[_0x7cf6d7(0xcb)](_0x11265d),_0x306d10=_0x11265d==='.';if(!_0x1c5ba5||_0x306d10){const _0x16fa9f=resolveProjectFromContext(_0x11265d,_0x22117e,{'requireFile':'test.yml'});if(_0x16fa9f[_0x7cf6d7(0x11b)])_0x58e311=_0x16fa9f[_0x7cf6d7(0xe8)],_0x16fa9f[_0x7cf6d7(0xcd)]===_0x7cf6d7(0x121)&&console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0xc5)+_0x58e311));else switch(_0x16fa9f[_0x7cf6d7(0x135)]){case _0x7cf6d7(0x125):console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x16fa9f[_0x7cf6d7(0x122)])),console[_0x7cf6d7(0xbf)](),console['log'](_0x7cf6d7(0xd2)),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xf3)),console['log'](_0x7cf6d7(0xe9)),console[_0x7cf6d7(0xbf)](),console['log'](_0x7cf6d7(0xbe));return 0x1;case'no_local_folder':console['log'](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x16fa9f['message'])),console['log'](),console['log'](_0x7cf6d7(0xf5)+_0x16fa9f[_0x7cf6d7(0xea)]+_0x7cf6d7(0x127));return 0x1;case _0x7cf6d7(0xe7):{const _0x8f911f=a5_0x19d0ef['basename'](_0x16fa9f['projectDir']);console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x7cf6d7(0x12f)+_0x16fa9f[_0x7cf6d7(0xea)]+'\x22:'));for(const _0xfba7 of _0x16fa9f['agentDirs']){console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xd0)+_0xfba7);}return console['log'](),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0x131)+_0x8f911f+_0x7cf6d7(0x106)),0x1;}case _0x7cf6d7(0xcc):console['log'](a5_0x5114ff['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x16fa9f[_0x7cf6d7(0xea)]+'\x22.')),console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0x14a)+_0x16fa9f['projectDir'])),console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x9b9ee6,agentInfo:_0x424eb1}=parseTestFile(_0x58e311);let _0x1e830f=_0x9b9ee6[_0x7cf6d7(0x102)];if(_0x343c3b){const _0xe4a4c2=_0x343c3b['split'](',')[_0x7cf6d7(0x107)](_0x168edf=>_0x168edf[_0x7cf6d7(0x143)]());_0x1e830f=_0x9b9ee6['tests'][_0x7cf6d7(0xd3)](_0x3f1729=>_0xe4a4c2[_0x7cf6d7(0x137)](_0x3f1729[_0x7cf6d7(0x12e)]));if(_0x1e830f['length']===0x0)return console['log'](a5_0x5114ff['yellow'](_0x7cf6d7(0x11d)+_0x343c3b)),console[_0x7cf6d7(0xbf)](a5_0x5114ff['dim'](_0x7cf6d7(0x105)+_0x9b9ee6[_0x7cf6d7(0x102)][_0x7cf6d7(0x107)](_0x2d89e8=>_0x2d89e8[_0x7cf6d7(0x12e)])[_0x7cf6d7(0x13e)](',\x20'))),0x1;}if(_0x427d6c){const _0x546dd9=_0x427d6c['split'](',')[_0x7cf6d7(0x107)](_0x48a601=>_0x48a601[_0x7cf6d7(0x143)]()['toLowerCase']());_0x1e830f=_0x1e830f[_0x7cf6d7(0xd3)](_0x3c64b3=>_0x3c64b3[_0x7cf6d7(0x123)]?.[_0x7cf6d7(0xfb)](_0x19fc7b=>_0x546dd9[_0x7cf6d7(0x137)](_0x19fc7b[_0x7cf6d7(0x118)]())));if(_0x1e830f['length']===0x0){console['log'](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x7cf6d7(0xde)+_0x427d6c));const _0xa41230=new Set();return _0x9b9ee6[_0x7cf6d7(0x102)][_0x7cf6d7(0x146)](_0x2e1450=>_0x2e1450[_0x7cf6d7(0x123)]?.['forEach'](_0xbe9797=>_0xa41230[_0x7cf6d7(0x119)](_0xbe9797))),_0xa41230[_0x7cf6d7(0xe1)]>0x0?console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0x103)+[..._0xa41230][_0x7cf6d7(0x13e)](',\x20'))):console[_0x7cf6d7(0xbf)](a5_0x5114ff['dim'](_0x7cf6d7(0x110))),0x1;}}if(_0x5e64b5)return this[_0x7cf6d7(0x120)](_0x2d1b2c,{'definition':{'tests':_0x1e830f},'agentInfo':_0x424eb1,'outputFormat':_0x5375ef,'outputFile':_0x269fd1,'testNames':_0x343c3b});if(_0x50ac11){console['log'](a5_0x5114ff[_0x7cf6d7(0xd6)]('Test\x20Configuration:')),console['log'](_0x7cf6d7(0x12d)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x4e7836)),console['log'](_0x7cf6d7(0xbb)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x424eb1[_0x7cf6d7(0xe6)])),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0x116)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x424eb1[_0x7cf6d7(0xba)])),console[_0x7cf6d7(0xbf)](),console['log'](_0x7cf6d7(0xd8)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x1e830f['length']));for(let _0xf2c20e=0x0;_0xf2c20e<_0x1e830f[_0x7cf6d7(0x10a)];_0xf2c20e++){const _0x575c83=_0x1e830f[_0xf2c20e],_0x590efb=_0x575c83['rounds'][_0x7cf6d7(0x10a)]===0x1?_0x7cf6d7(0x12a):_0x7cf6d7(0xc0),_0x392d67=_0x575c83['tags']?.['length']?'\x20['+_0x575c83[_0x7cf6d7(0x123)]['join'](',\x20')+']':'';console[_0x7cf6d7(0xbf)]('\x20\x20'+(_0xf2c20e+0x1)+'.\x20'+a5_0x5114ff['white'](_0x575c83[_0x7cf6d7(0x12e)])+'\x20('+_0x575c83[_0x7cf6d7(0xc0)][_0x7cf6d7(0x10a)]+'\x20'+_0x590efb+')'+a5_0x5114ff[_0x7cf6d7(0x145)](_0x392d67));}return 0x0;}let _0x8d8b94,_0x46246d;try{_0x8d8b94=await _0x23f152['llm']['resolveProjectId'](_0x424eb1['projectName']);}catch(_0xc6f10d){const _0x589e67=_0xc6f10d instanceof Error?_0xc6f10d[_0x7cf6d7(0x122)]:String(_0xc6f10d);return _0x589e67['includes']('404')||_0x589e67[_0x7cf6d7(0x118)]()[_0x7cf6d7(0x137)](_0x7cf6d7(0xd5))?console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0x100)+_0x424eb1['projectName'])):console['log'](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xf9)+_0x424eb1['projectName']+_0x7cf6d7(0xcf)+_0x589e67)),0x1;}try{_0x46246d=await _0x23f152[_0x7cf6d7(0xff)][_0x7cf6d7(0xb8)](_0x424eb1[_0x7cf6d7(0xba)],_0x8d8b94);}catch(_0xd9ebec){const _0xc4fd6e=_0xd9ebec instanceof Error?_0xd9ebec['message']:String(_0xd9ebec);return _0xc4fd6e[_0x7cf6d7(0x137)](_0x7cf6d7(0xdb))||_0xc4fd6e[_0x7cf6d7(0x118)]()[_0x7cf6d7(0x137)](_0x7cf6d7(0xd5))?console[_0x7cf6d7(0xbf)](a5_0x5114ff['red'](_0x7cf6d7(0x12b)+_0x424eb1['agentName'])):console['log'](a5_0x5114ff['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x424eb1[_0x7cf6d7(0xba)]+_0x7cf6d7(0xcf)+_0xc4fd6e)),0x1;}let _0x1948dd;if(!_0x1440a8)try{_0x1948dd=await setupEvaluatorAgent(_0x23f152[_0x7cf6d7(0xff)],_0x9aa1e['verbose']);}catch(_0x56bd15){const _0x488882=_0x56bd15 instanceof Error?_0x56bd15['message']:String(_0x56bd15);return console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0x139)+_0x488882)),0x1;}console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0xd6)](_0x7cf6d7(0x133))),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0x10e)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x4e7836)),console['log'](_0x7cf6d7(0x113)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x424eb1[_0x7cf6d7(0xe6)]+'/'+_0x424eb1[_0x7cf6d7(0xba)])),console[_0x7cf6d7(0xbf)]();const _0x706691=[],_0x5f2feb=[],_0x859823=Date[_0x7cf6d7(0xdc)]();for(let _0x4d3fd3=0x0;_0x4d3fd3<_0x1e830f[_0x7cf6d7(0x10a)];_0x4d3fd3++){const _0x17708b=_0x1e830f[_0x4d3fd3];_0x1e830f[_0x7cf6d7(0x10a)]>0x1?console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xc7)+(_0x4d3fd3+0x1)+'/'+_0x1e830f[_0x7cf6d7(0x10a)]+':\x20'+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x17708b['name'])):console[_0x7cf6d7(0xbf)]('Running\x20test:\x20'+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x17708b[_0x7cf6d7(0x12e)]));const _0x26f7b7=createCommandSpinner(_0x7cf6d7(0xdd)+_0x17708b[_0x7cf6d7(0xc0)][_0x7cf6d7(0x10a)]+_0x7cf6d7(0x10f));_0x26f7b7[_0x7cf6d7(0xc9)]();try{const {result:_0x4187e9,conversation:_0x208010}=await runTest(_0x23f152[_0x7cf6d7(0xff)],_0x17708b,{'agentId':_0x46246d,'projectId':_0x8d8b94,'site':_0x4e7836,'noEval':_0x1440a8,'evaluatorId':_0x1948dd,'onRoundStart':(_0x37b7b3,_0x2d1a7a)=>{const _0x3dcbd5=_0x7cf6d7;_0x26f7b7['text']=_0x3dcbd5(0x13f)+(_0x37b7b3+0x1)+'/'+_0x2d1a7a+_0x3dcbd5(0x10f);},'onRoundComplete':(_0x179f9f,_0x27a706,_0x3cfb3a)=>{const _0x5103e7=_0x7cf6d7,_0x1e6dbc=formatElapsed(_0x27a706);_0x3cfb3a?console[_0x5103e7(0xbf)](_0x5103e7(0x141)+(_0x179f9f+0x1)+'/'+_0x17708b[_0x5103e7(0xc0)][_0x5103e7(0x10a)]+_0x5103e7(0xd9)+a5_0x5114ff[_0x5103e7(0xd1)]('✓')+'\x20('+_0x1e6dbc+')'):console['log'](_0x5103e7(0x141)+(_0x179f9f+0x1)+'/'+_0x17708b[_0x5103e7(0xc0)][_0x5103e7(0x10a)]+_0x5103e7(0xd9)+a5_0x5114ff['red']('✗'));},'onEvaluationStart':()=>{const _0x52f23c=_0x7cf6d7;_0x26f7b7['text']=_0x52f23c(0xe3);},'onEvaluationComplete':_0x40edd1=>{const _0x551137=_0x7cf6d7,_0x366905=formatElapsed(_0x40edd1);console[_0x551137(0xbf)]('\x20\x20Evaluating...\x20'+a5_0x5114ff[_0x551137(0xd1)]('✓')+'\x20('+_0x366905+')');}});_0x26f7b7[_0x7cf6d7(0xf8)](),_0x706691[_0x7cf6d7(0x136)](_0x4187e9),_0x5f2feb['push'](_0x208010);if(_0x4187e9['status']===_0x7cf6d7(0x109))console[_0x7cf6d7(0xbf)](a5_0x5114ff['green']('✓\x20PASS:\x20'+_0x4187e9[_0x7cf6d7(0x135)]));else _0x4187e9['status']===_0x7cf6d7(0xc8)?console[_0x7cf6d7(0xbf)](a5_0x5114ff['red'](_0x7cf6d7(0x13d)+_0x4187e9['reason'])):console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xe2)+_0x4187e9[_0x7cf6d7(0x135)]));_0x4187e9[_0x7cf6d7(0x147)]&&console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0xeb)+_0x4187e9[_0x7cf6d7(0x147)])),console['log']();}catch(_0x29335f){_0x26f7b7[_0x7cf6d7(0xf8)]();const _0x352107=_0x29335f instanceof Error?_0x29335f[_0x7cf6d7(0x122)]:String(_0x29335f);console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xe2)+_0x352107)),console[_0x7cf6d7(0xbf)](),_0x706691[_0x7cf6d7(0x136)]({'name':_0x17708b[_0x7cf6d7(0x12e)],'status':_0x7cf6d7(0x11e),'reason':_0x352107,'timestamp':new Date()[_0x7cf6d7(0x126)](),'duration_ms':0x0});}}const _0x288ea4=Date[_0x7cf6d7(0xdc)]()-_0x859823,_0x3e912c=_0x706691[_0x7cf6d7(0xd3)](_0x136902=>_0x136902[_0x7cf6d7(0xf0)]===_0x7cf6d7(0x109))[_0x7cf6d7(0x10a)],_0x4d97aa=_0x706691[_0x7cf6d7(0xd3)](_0x28906f=>_0x28906f['status']===_0x7cf6d7(0xc8))[_0x7cf6d7(0x10a)],_0xae72c4=_0x706691[_0x7cf6d7(0xd3)](_0x12d437=>_0x12d437[_0x7cf6d7(0xf0)]===_0x7cf6d7(0x11e))['length'];console[_0x7cf6d7(0xbf)]('━'[_0x7cf6d7(0xb2)](0x3c)),console['log'](_0x7cf6d7(0xed)),console['log']('━'['repeat'](0x3c)),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xb9)+_0x706691['length']),console['log'](_0x7cf6d7(0xce)+a5_0x5114ff[_0x7cf6d7(0xd1)](_0x3e912c)),console[_0x7cf6d7(0xbf)]('Failed:\x20\x20\x20'+a5_0x5114ff['red'](_0x4d97aa));_0xae72c4>0x0&&console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xfd)+a5_0x5114ff[_0x7cf6d7(0x13b)](_0xae72c4));console['log'](_0x7cf6d7(0x11c)+formatElapsed(_0x288ea4)),console[_0x7cf6d7(0xbf)]('━'[_0x7cf6d7(0xb2)](0x3c));const _0x2381f5=_0x706691[_0x7cf6d7(0xd3)](_0x2a89fc=>_0x2a89fc[_0x7cf6d7(0xf0)]!==_0x7cf6d7(0x109));if(_0x2381f5[_0x7cf6d7(0x10a)]>0x0){console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xc3));for(const _0x32ad0c of _0x2381f5){const _0x5e15c2=a5_0x5114ff['red']('✗'),_0x1cd833=_0x32ad0c[_0x7cf6d7(0x135)]['length']>0x32?_0x32ad0c[_0x7cf6d7(0x135)]['substring'](0x0,0x32)+_0x7cf6d7(0xbd):_0x32ad0c[_0x7cf6d7(0x135)];console[_0x7cf6d7(0xbf)]('\x20\x20'+_0x5e15c2+'\x20'+_0x32ad0c['name']+':\x20'+_0x1cd833);}}const _0x517bc3={'summary':{'total':_0x706691[_0x7cf6d7(0x10a)],'passed':_0x3e912c,'failed':_0x4d97aa,'errors':_0xae72c4>0x0?_0xae72c4:undefined,'duration_ms':_0x288ea4},'tests':_0x706691,'agent':{'project':_0x424eb1[_0x7cf6d7(0xe6)],'name':_0x424eb1[_0x7cf6d7(0xba)],'site':_0x4e7836},'timestamp':new Date(_0x859823)[_0x7cf6d7(0x126)]()};try{const _0x3f8d85=buildCachedTestRun(_0x5f2feb,{'site':_0x4e7836,'projectId':_0x8d8b94,'projectName':_0x424eb1[_0x7cf6d7(0xe6)],'agentId':_0x46246d,'agentName':_0x424eb1['agentName'],'testYmlPath':a5_0x19d0ef[_0x7cf6d7(0x148)](_0x424eb1['testYmlPath'])});saveLastTestRun(_0x3f8d85);}catch{}if(_0x5375ef!==_0x7cf6d7(0x128)||_0x269fd1){const _0x416a6a=formatResults(_0x517bc3,_0x5375ef);if(_0x269fd1)try{a5_0x368b4c[_0x7cf6d7(0xb4)](_0x269fd1,_0x416a6a,_0x7cf6d7(0x101)),console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0xb6)+_0x269fd1));}catch(_0x83aa99){return console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0x11f)+_0x83aa99)),0x1;}else console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](_0x416a6a);}return _0x2381f5[_0x7cf6d7(0x10a)]>0x0?0x1:0x0;}async[a5_0x51fdad(0x120)](_0x5aeda8,_0x492c05){const _0x4f7a22=a5_0x51fdad,{options:_0x109dd7,tdx:_0xd2652}=_0x5aeda8,{definition:_0x2bb14a,agentInfo:_0x4b998a,outputFormat:_0x5e503c,outputFile:_0x475252}=_0x492c05,_0x5b0ceb=_0x109dd7[_0x4f7a22(0x115)],_0x25ace0=loadLastTestRun();if(!_0x25ace0)return console[_0x4f7a22(0xbf)](a5_0x5114ff['red'](_0x4f7a22(0xf7))),console['log'](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0x132))),0x1;if(_0x25ace0['agent'][_0x4f7a22(0xba)]!==_0x4b998a[_0x4f7a22(0xba)])return console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0x140)+_0x25ace0[_0x4f7a22(0xfc)]['agentName']+_0x4f7a22(0x144)+_0x4b998a[_0x4f7a22(0xba)]+'\x22.')),console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0xbc))),0x1;const _0x5577f4=new Set(_0x25ace0['conversations'][_0x4f7a22(0x107)](_0x265869=>_0x265869['testName'])),_0x42385a=_0x2bb14a[_0x4f7a22(0x102)]['filter'](_0x44130c=>!_0x5577f4[_0x4f7a22(0xfe)](_0x44130c[_0x4f7a22(0x12e)]));if(_0x42385a[_0x4f7a22(0x10a)]>0x0&&_0x25ace0[_0x4f7a22(0x115)]!==_0x5b0ceb)return console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4f7a22(0xbf)](a5_0x5114ff['dim'](_0x4f7a22(0x114)+_0x25ace0[_0x4f7a22(0x115)]+_0x4f7a22(0x117)+_0x5b0ceb+'\x22.')),console[_0x4f7a22(0xbf)](a5_0x5114ff['dim'](_0x4f7a22(0xe5)+_0x25ace0['site']+_0x4f7a22(0x104))),0x1;const _0x1ce20f=_0x2bb14a[_0x4f7a22(0x102)][_0x4f7a22(0xd3)](_0x4f1e49=>_0x5577f4[_0x4f7a22(0xfe)](_0x4f1e49['name'])),_0x11d6dd=_0x42385a;let _0x4e4f32;try{_0x4e4f32=await setupEvaluatorAgent(_0xd2652['llm'],_0x109dd7['verbose']);}catch(_0x4b73fb){const _0x19d3ad=_0x4b73fb instanceof Error?_0x4b73fb[_0x4f7a22(0x122)]:String(_0x4b73fb);return console['log'](a5_0x5114ff['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x19d3ad)),0x1;}console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0xd6)](_0x4f7a22(0xca))),console[_0x4f7a22(0xbf)]('Cached\x20run\x20from:\x20'+a5_0x5114ff[_0x4f7a22(0xb5)](_0x25ace0[_0x4f7a22(0x112)])),console[_0x4f7a22(0xbf)](_0x4f7a22(0x113)+a5_0x5114ff[_0x4f7a22(0xb5)](_0x25ace0[_0x4f7a22(0xfc)][_0x4f7a22(0xe6)]+'/'+_0x25ace0[_0x4f7a22(0xfc)][_0x4f7a22(0xba)]));_0x11d6dd[_0x4f7a22(0x10a)]>0x0&&console[_0x4f7a22(0xbf)](_0x4f7a22(0x129)+a5_0x5114ff[_0x4f7a22(0x10c)](_0x11d6dd[_0x4f7a22(0x10a)]));console[_0x4f7a22(0xbf)]();const _0x4b4b3c=[],_0x20de4d=Date['now'](),_0x274f11=createCommandSpinner('Re-evaluating...');if(_0x1ce20f[_0x4f7a22(0x10a)]>0x0)try{const _0x40ba2f=await reevaluateFromCache(_0xd2652[_0x4f7a22(0xff)],_0x25ace0,{'tests':_0x1ce20f},{'evaluatorId':_0x4e4f32,'onTestStart':(_0x4ba5f4,_0x5e992c,_0x289b32)=>{const _0x2c67f7=_0x4f7a22;_0x274f11[_0x2c67f7(0xdf)]=_0x2c67f7(0x13c)+(_0x5e992c+0x1)+'/'+_0x289b32+':\x20'+_0x4ba5f4+_0x2c67f7(0xbd);if(!_0x274f11[_0x2c67f7(0xb7)])_0x274f11[_0x2c67f7(0xc9)]();},'onTestComplete':(_0x481d7b,_0xdad91e)=>{const _0x9dc638=_0x4f7a22;_0x274f11[_0x9dc638(0xf8)]();if(_0xdad91e['status']===_0x9dc638(0x109))console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0xd1)]('✓\x20PASS:\x20'+_0x481d7b)+a5_0x5114ff['dim'](_0x9dc638(0xf4)));else _0xdad91e[_0x9dc638(0xf0)]===_0x9dc638(0xc8)?console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0x13b)]('✗\x20FAIL:\x20'+_0x481d7b+'\x20-\x20'+_0xdad91e[_0x9dc638(0x135)])+a5_0x5114ff[_0x9dc638(0x145)]('\x20(cached)')):console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0x13b)]('✗\x20ERROR:\x20'+_0x481d7b+_0x9dc638(0x130)+_0xdad91e[_0x9dc638(0x135)]));_0xdad91e['conversation_url']&&console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0x145)](_0x9dc638(0xc4)+_0xdad91e['conversation_url'])),_0x4b4b3c[_0x9dc638(0x136)](_0xdad91e);},'onTestSkipped':(_0x24e4e7,_0x1c65e5)=>{const _0x7e019=_0x4f7a22;_0x274f11[_0x7e019(0xf8)](),console[_0x7e019(0xbf)](a5_0x5114ff['yellow'](_0x7e019(0xfa)+_0x24e4e7+_0x7e019(0x130)+_0x1c65e5));}});for(const _0x5e21a7 of _0x40ba2f){!_0x4b4b3c[_0x4f7a22(0x108)](_0x365378=>_0x365378[_0x4f7a22(0x12e)]===_0x5e21a7['name'])&&_0x4b4b3c[_0x4f7a22(0x136)](_0x5e21a7);}}catch(_0x3f5c65){_0x274f11[_0x4f7a22(0xf8)]();const _0x56a791=_0x3f5c65 instanceof Error?_0x3f5c65['message']:String(_0x3f5c65);return console['log'](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0xc2)+_0x56a791)),0x1;}_0x274f11['stop']();if(_0x11d6dd[_0x4f7a22(0x10a)]>0x0){console[_0x4f7a22(0xbf)](),console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0xd6)](_0x4f7a22(0xe0)));const {projectId:_0x28de2a,agentId:_0x3303a2}=_0x25ace0[_0x4f7a22(0xfc)];for(const _0x46d543 of _0x11d6dd){console[_0x4f7a22(0xbf)](_0x4f7a22(0xda)+a5_0x5114ff['white'](_0x46d543[_0x4f7a22(0x12e)]));const _0xbe8443=createCommandSpinner('Round\x201/'+_0x46d543[_0x4f7a22(0xc0)][_0x4f7a22(0x10a)]+':\x20Sending\x20user\x20input...');_0xbe8443[_0x4f7a22(0xc9)]();try{const {result:_0x2e1ad1}=await runTest(_0xd2652[_0x4f7a22(0xff)],_0x46d543,{'agentId':_0x3303a2,'projectId':_0x28de2a,'site':_0x25ace0[_0x4f7a22(0x115)],'noEval':![],'evaluatorId':_0x4e4f32,'onRoundStart':(_0x4f4c99,_0x2d2f92)=>{const _0x247c50=_0x4f7a22;_0xbe8443[_0x247c50(0xdf)]=_0x247c50(0x13f)+(_0x4f4c99+0x1)+'/'+_0x2d2f92+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x25c116,_0x25b1c9,_0x4ac7d0)=>{const _0x481c11=_0x4f7a22,_0x41e1ab=formatElapsed(_0x25b1c9);_0x4ac7d0?console[_0x481c11(0xbf)](_0x481c11(0x141)+(_0x25c116+0x1)+'/'+_0x46d543[_0x481c11(0xc0)][_0x481c11(0x10a)]+_0x481c11(0xd9)+a5_0x5114ff[_0x481c11(0xd1)]('✓')+'\x20('+_0x41e1ab+')'):console[_0x481c11(0xbf)]('\x20\x20Round\x20'+(_0x25c116+0x1)+'/'+_0x46d543[_0x481c11(0xc0)][_0x481c11(0x10a)]+'...\x20'+a5_0x5114ff[_0x481c11(0x13b)]('✗'));},'onEvaluationStart':()=>{const _0x3a60cb=_0x4f7a22;_0xbe8443[_0x3a60cb(0xdf)]=_0x3a60cb(0xe3);},'onEvaluationComplete':_0x47190e=>{const _0x26a73f=_0x4f7a22,_0x10f174=formatElapsed(_0x47190e);console[_0x26a73f(0xbf)](_0x26a73f(0x10b)+a5_0x5114ff[_0x26a73f(0xd1)]('✓')+'\x20('+_0x10f174+')');}});_0xbe8443[_0x4f7a22(0xf8)](),_0x4b4b3c[_0x4f7a22(0x136)](_0x2e1ad1);if(_0x2e1ad1['status']===_0x4f7a22(0x109))console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0xd1)]('✓\x20PASS:\x20'+_0x2e1ad1['reason'])+a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0x14b)));else _0x2e1ad1['status']===_0x4f7a22(0xc8)?console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0x13d)+_0x2e1ad1[_0x4f7a22(0x135)])+a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0x14b))):console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)]('✗\x20ERROR:\x20'+_0x2e1ad1[_0x4f7a22(0x135)]));_0x2e1ad1[_0x4f7a22(0x147)]&&console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0xc4)+_0x2e1ad1[_0x4f7a22(0x147)]));}catch(_0x8d314c){_0xbe8443[_0x4f7a22(0xf8)]();const _0x284868=_0x8d314c instanceof Error?_0x8d314c[_0x4f7a22(0x122)]:String(_0x8d314c);console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0xe2)+_0x284868)),_0x4b4b3c['push']({'name':_0x46d543[_0x4f7a22(0x12e)],'status':_0x4f7a22(0x11e),'reason':_0x284868,'timestamp':new Date()[_0x4f7a22(0x126)](),'duration_ms':0x0});}}}console[_0x4f7a22(0xbf)]();const _0x9c7f77=Date[_0x4f7a22(0xdc)]()-_0x20de4d,_0x3e12a2=_0x4b4b3c[_0x4f7a22(0xd3)](_0x414ec1=>_0x414ec1[_0x4f7a22(0xf0)]===_0x4f7a22(0x109))['length'],_0x49c6a9=_0x4b4b3c[_0x4f7a22(0xd3)](_0x274903=>_0x274903[_0x4f7a22(0xf0)]===_0x4f7a22(0xc8))['length'],_0x35df72=_0x4b4b3c['filter'](_0x4c8e85=>_0x4c8e85[_0x4f7a22(0xf0)]===_0x4f7a22(0x11e))[_0x4f7a22(0x10a)];console[_0x4f7a22(0xbf)]('━'[_0x4f7a22(0xb2)](0x3c)),console[_0x4f7a22(0xbf)](_0x4f7a22(0xb1)),console[_0x4f7a22(0xbf)]('━'['repeat'](0x3c)),console[_0x4f7a22(0xbf)](_0x4f7a22(0xb9)+_0x4b4b3c['length']),console[_0x4f7a22(0xbf)](_0x4f7a22(0xce)+a5_0x5114ff[_0x4f7a22(0xd1)](_0x3e12a2)),console[_0x4f7a22(0xbf)](_0x4f7a22(0xd7)+a5_0x5114ff[_0x4f7a22(0x13b)](_0x49c6a9));_0x35df72>0x0&&console[_0x4f7a22(0xbf)]('Errors:\x20\x20\x20'+a5_0x5114ff[_0x4f7a22(0x13b)](_0x35df72));console[_0x4f7a22(0xbf)](_0x4f7a22(0x11c)+formatElapsed(_0x9c7f77)),console[_0x4f7a22(0xbf)]('━'['repeat'](0x3c));const _0xe7ce85={'summary':{'total':_0x4b4b3c[_0x4f7a22(0x10a)],'passed':_0x3e12a2,'failed':_0x49c6a9,'errors':_0x35df72>0x0?_0x35df72:undefined,'duration_ms':_0x9c7f77},'tests':_0x4b4b3c,'agent':{'project':_0x4b998a[_0x4f7a22(0xe6)],'name':_0x4b998a[_0x4f7a22(0xba)],'site':_0x5b0ceb},'timestamp':new Date(_0x20de4d)[_0x4f7a22(0x126)]()};if(_0x5e503c!=='table'||_0x475252){const _0x35211b=formatResults(_0xe7ce85,_0x5e503c);if(_0x475252)try{a5_0x368b4c['writeFileSync'](_0x475252,_0x35211b,_0x4f7a22(0x101)),console[_0x4f7a22(0xbf)](),console['log'](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0xb6)+_0x475252));}catch(_0x4e5fc2){return console[_0x4f7a22(0xbf)](),console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)]('Error\x20writing\x20output\x20file:\x20'+_0x4e5fc2)),0x1;}else console['log'](),console[_0x4f7a22(0xbf)](_0x35211b);}const _0x51a0ad=_0x4b4b3c['filter'](_0x50ee84=>_0x50ee84['status']!==_0x4f7a22(0x109));return _0x51a0ad[_0x4f7a22(0x10a)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x45993c=a6_0x5a78;(function(_0x541e50,_0x5d3241){const _0x44ed37=a6_0x5a78,_0x458498=_0x541e50();while(!![]){try{const _0x35d283=-parseInt(_0x44ed37(0x192))/0x1+parseInt(_0x44ed37(0x1b3))/0x2*(parseInt(_0x44ed37(0x198))/0x3)+parseInt(_0x44ed37(0x17e))/0x4*(parseInt(_0x44ed37(0x18b))/0x5)+parseInt(_0x44ed37(0x1a2))/0x6+parseInt(_0x44ed37(0x189))/0x7*(-parseInt(_0x44ed37(0x18a))/0x8)+parseInt(_0x44ed37(0x17b))/0x9*(-parseInt(_0x44ed37(0x1bb))/0xa)+parseInt(_0x44ed37(0x17d))/0xb;if(_0x35d283===_0x5d3241)break;else _0x458498['push'](_0x458498['shift']());}catch(_0x280bbd){_0x458498['push'](_0x458498['shift']());}}}(a6_0x1d74,0x223c5));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x1d74(){const _0x5bb313=['998634iaVaSP','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','x-auth-token','proxy-authorization','substring','trim','GET','output','startsWith','message','body','length','Results\x20saved\x20to\x20','join','noColor','type','2GgZAAw','POST','set-cookie','cdp','error','request','.\x20Valid\x20methods:\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','20sreKFk','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','set-cookie2','name','x-trino-user','readBodyFromFile','721998weSJvb','site','2937814lPujUZ','4ONztts','llm-proxy','indexOf','method','description','data','execute','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PATCH','DELETE','\x22.\x20','7IxTLeV','1606808RpPNyy','1034745rGoKld','entries','keys','toLowerCase','Error:\x20','api','PUT','176320rFIHgU','isArray','file','llm','color','Invalid\x20API\x20type:\x20','112146bKBvkO','workflow','has','toUpperCase','validate','trino','Invalid\x20HTTP\x20method:\x20','headers','\x0aStack\x20trace:\x0a','stack'];a6_0x1d74=function(){return _0x5bb313;};return a6_0x1d74();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x45993c(0x1a6),'cookie',a6_0x45993c(0x1b5),a6_0x45993c(0x1bd),'x-xsrf-token',a6_0x45993c(0x1a5),a6_0x45993c(0x1bf)]);function isSensitiveHeader(_0x1cecd3){const _0x24f854=a6_0x45993c;return SENSITIVE_HEADERS[_0x24f854(0x19a)](_0x1cecd3[_0x24f854(0x18e)]());}function parseHeader(_0x5acf8b){const _0x6e7b95=a6_0x45993c,_0x5d1b00=_0x5acf8b[_0x6e7b95(0x180)](':');if(_0x5d1b00===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5acf8b+_0x6e7b95(0x188)+_0x6e7b95(0x185));const _0x40241e=_0x5acf8b[_0x6e7b95(0x1a7)](0x0,_0x5d1b00)[_0x6e7b95(0x1a8)](),_0x1b79bc=_0x5acf8b['substring'](_0x5d1b00+0x1)['trim']();if(!_0x40241e)throw new Error(_0x6e7b95(0x1ba)+_0x5acf8b+'\x22');return[_0x40241e,_0x1b79bc];}function a6_0x5a78(_0x4b1622,_0x5f402f){_0x4b1622=_0x4b1622-0x17b;const _0x1d7454=a6_0x1d74();let _0x5a7809=_0x1d7454[_0x4b1622];return _0x5a7809;}export class ApiCommand extends BaseCommand{[a6_0x45993c(0x1be)]=a6_0x45993c(0x190);[a6_0x45993c(0x182)]=a6_0x45993c(0x1a4);[a6_0x45993c(0x19c)](_0x1ad9c8){const _0x14c9d2=a6_0x45993c,{args:_0x31aa9e,options:_0x39e6c2}=_0x1ad9c8,_0x1cca12=_0x39e6c2;if(_0x31aa9e[_0x14c9d2(0x1ae)]===0x0)return _0x14c9d2(0x1bc);const _0x20972b=_0x31aa9e[0x0];if(!_0x20972b[_0x14c9d2(0x1ab)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x20972b;const _0x54ada4=_0x1cca12[_0x14c9d2(0x183)],_0x3d9696=_0x1cca12[_0x14c9d2(0x194)];if(_0x54ada4&&_0x3d9696)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x341584=_0x1cca12[_0x14c9d2(0x181)]||_0x14c9d2(0x1a9),_0x465249=['GET',_0x14c9d2(0x1b4),_0x14c9d2(0x191),_0x14c9d2(0x187),_0x14c9d2(0x186)];if(!_0x465249['includes'](_0x341584[_0x14c9d2(0x19b)]()))return _0x14c9d2(0x19e)+_0x341584+_0x14c9d2(0x1b9)+_0x465249['join'](',\x20');const _0x580ad7=_0x1cca12[_0x14c9d2(0x1b2)]||'td',_0x4b9065=['td',_0x14c9d2(0x1b6),_0x14c9d2(0x199),_0x14c9d2(0x19d),_0x14c9d2(0x195),_0x14c9d2(0x17f)];if(!_0x4b9065['includes'](_0x580ad7))return _0x14c9d2(0x197)+_0x580ad7+'.\x20Valid\x20types:\x20'+_0x4b9065[_0x14c9d2(0x1b0)](',\x20');return undefined;}async[a6_0x45993c(0x184)](_0x320d16){const _0x480bdb=a6_0x45993c,{options:_0x174f02,args:_0x58e087,tdx:_0x57d643}=_0x320d16,_0x2ee458=_0x174f02,_0x2e75dd=_0x58e087[0x0],_0x548693=(_0x2ee458[_0x480bdb(0x181)]||'GET')[_0x480bdb(0x19b)](),_0x1c845a=_0x2ee458[_0x480bdb(0x183)],_0x2019cd=_0x2ee458[_0x480bdb(0x194)],_0x2cd178=_0x2ee458['header'],_0x3e43d3=_0x2ee458[_0x480bdb(0x1b2)]||'td';try{const _0x1b3d9a={};if(_0x2cd178){const _0x26e2a2=Array[_0x480bdb(0x193)](_0x2cd178)?_0x2cd178:[_0x2cd178];for(const _0x13044e of _0x26e2a2){const [_0x49afbe,_0x38dbc5]=parseHeader(_0x13044e);_0x1b3d9a[_0x49afbe]=_0x38dbc5;}}let _0xff70d6;if(_0x1c845a)_0xff70d6=_0x1c845a;else{if(_0x2019cd)try{_0xff70d6=RawAPI[_0x480bdb(0x1c0)](_0x2019cd);}catch(_0x34e63d){return console[_0x480bdb(0x1b7)](_0x480bdb(0x18f)+(_0x34e63d instanceof Error?_0x34e63d[_0x480bdb(0x1ac)]:String(_0x34e63d))),0x1;}}const _0x1e5aa9={'method':_0x548693,'apiType':_0x3e43d3,'includeHeaders':_0x174f02[_0x480bdb(0x1a3)]};_0xff70d6&&(_0x1e5aa9[_0x480bdb(0x1ad)]=_0xff70d6);Object[_0x480bdb(0x18d)](_0x1b3d9a)[_0x480bdb(0x1ae)]>0x0&&(_0x1e5aa9[_0x480bdb(0x19f)]=_0x1b3d9a);if(_0x174f02[_0x480bdb(0x1a3)]){const _0x299f27=resolveSite(_0x174f02[_0x480bdb(0x17c)]),_0x1b3189=getEndpoint(_0x299f27,_0x3e43d3),_0x5795cc=''+_0x1b3189+_0x2e75dd;console[_0x480bdb(0x1b7)]('>\x20'+_0x548693+'\x20'+_0x5795cc);const _0x3c53f4=getAuthHeaders(_0x299f27),_0xa4961a={..._0x3c53f4,..._0x1b3d9a};for(const [_0x1396fa,_0x2786a6]of Object[_0x480bdb(0x18c)](_0xa4961a)){!isSensitiveHeader(_0x1396fa)&&console[_0x480bdb(0x1b7)]('>\x20'+_0x1396fa+':\x20'+_0x2786a6);}_0xff70d6&&console[_0x480bdb(0x1b7)]('>'),console[_0x480bdb(0x1b7)]('');}const _0x27fd52=await _0x57d643[_0x480bdb(0x190)][_0x480bdb(0x1b8)](_0x2e75dd,_0x1e5aa9);if(_0x174f02[_0x480bdb(0x1a3)]&&_0x27fd52[_0x480bdb(0x19f)]){console[_0x480bdb(0x1b7)]('<\x20HTTP/1.1\x20'+_0x27fd52['status']);for(const [_0x3999e9,_0x57c676]of Object[_0x480bdb(0x18c)](_0x27fd52['headers'])){!isSensitiveHeader(_0x3999e9)&&console['error']('<\x20'+_0x3999e9+':\x20'+_0x57c676);}console[_0x480bdb(0x1b7)]('');}const _0x3443c3=Boolean(_0x174f02[_0x480bdb(0x1aa)]),_0x2ab040={'color':_0x174f02[_0x480bdb(0x196)],'noColor':_0x174f02[_0x480bdb(0x1b1)]||_0x3443c3&&!_0x174f02[_0x480bdb(0x196)]},_0x1200b5=colorizeJSON(_0x27fd52['data'],_0x2ab040);return _0x174f02[_0x480bdb(0x1aa)]?(writeFileSync(_0x174f02['output'],_0x1200b5),console[_0x480bdb(0x1b7)](_0x480bdb(0x1af)+_0x174f02[_0x480bdb(0x1aa)])):console['log'](_0x1200b5),0x0;}catch(_0x32782e){return _0x32782e instanceof Error?(console[_0x480bdb(0x1b7)](_0x480bdb(0x18f)+_0x32782e[_0x480bdb(0x1ac)]),_0x174f02[_0x480bdb(0x1a3)]&&_0x32782e['stack']&&console[_0x480bdb(0x1b7)](_0x480bdb(0x1a0)+_0x32782e[_0x480bdb(0x1a1)])):console[_0x480bdb(0x1b7)](_0x480bdb(0x18f)+String(_0x32782e)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x51e174=a7_0x1763;(function(_0xcbd2e8,_0x41f046){const _0xcb80e9=a7_0x1763,_0x1e95a5=_0xcbd2e8();while(!![]){try{const _0x176f08=-parseInt(_0xcb80e9(0x18d))/0x1+-parseInt(_0xcb80e9(0x167))/0x2*(parseInt(_0xcb80e9(0x18f))/0x3)+parseInt(_0xcb80e9(0x17f))/0x4+-parseInt(_0xcb80e9(0x16a))/0x5+parseInt(_0xcb80e9(0x160))/0x6*(parseInt(_0xcb80e9(0x184))/0x7)+-parseInt(_0xcb80e9(0x198))/0x8+-parseInt(_0xcb80e9(0x165))/0x9*(-parseInt(_0xcb80e9(0x163))/0xa);if(_0x176f08===_0x41f046)break;else _0x1e95a5['push'](_0x1e95a5['shift']());}catch(_0x31ea8f){_0x1e95a5['push'](_0x1e95a5['shift']());}}}(a7_0x5719,0xc4d3f));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x5719(){const _0x412e37=['error','join','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setup\x20cancelled','✓\x20Profile\x20\x27','\x27\x20registered','method','site','API\x20key','tdx:\x20auth\x20setup','logLevel','✓\x20Authentication\x20successful\x0a','✓\x20Default\x20site\x20set\x20to\x20','✗\x20Validation\x20failed:\x20','description','OAuth\x20tokens','tdx:\x20auth\x20clear','User:\x20','oauth','execute','1849938MkSYeg','filter','N/A','120QiHwQi','You\x20can\x20find\x20your\x20API\x20key\x20at:','2509767sAzxYT','Choose\x20authentication\x20method:','8VAMwud','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','979995QvDqQh','\x20(site:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','apiKey','trim','log','API\x20Key','us01','jobs','ERROR','message','red','email','auth:clear','Enter\x20your\x20TD\x20API\x20key:','last_name','Read\x20credential\x20from\x20keychain','Setup\x20API\x20key\x20authentication\x20interactively','password','all','488496bZBolh','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','profile','\x20--profile\x20','14BhlQlW','Credential\x20type:\x20OAuth','status','No\x20credential\x20found','first_name','\x0aSetup\x20cancelled','warn','/app/mp/ak','No\x20credentials\x20found\x20in\x20keychain','986392kArGUl','tdx\x20profile:\x20','471477qqvbJv','\x20\x20tdx','OAuth\x20(browser\x20login)','yellow','green','create','Name:\x20','bold','\x20(profile:\x20','11743136pHRgjV','API\x20key\x20cannot\x20be\x20empty'];a7_0x5719=function(){return _0x412e37;};return a7_0x5719();}import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';function a7_0x1763(_0x3e0ffa,_0x2053f7){_0x3e0ffa=_0x3e0ffa-0x158;const _0x57198a=a7_0x5719();let _0x17632c=_0x57198a[_0x3e0ffa];return _0x17632c;}import a7_0x423a7f 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_0x19c47d from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x51e174(0x15a)]=a7_0x51e174(0x17c);async[a7_0x51e174(0x15f)](_0x577589){const _0x10a345=a7_0x51e174,{options:_0x46d222}=_0x577589,_0x4911ce=_0x46d222['profile'];console[_0x10a345(0x170)](a7_0x19c47d[_0x10a345(0x196)](_0x10a345(0x1a3)));const _0x3c398f=_0x46d222[_0x10a345(0x1a1)]||_0x10a345(0x172),_0x293adf=await promptSiteSelection(_0x3c398f,_0x4911ce,_0x10a345(0x19d));if(!_0x293adf)return 0x1;const _0x3fa9ff=resolveSite(_0x293adf);if(isOAuthSupported(_0x3fa9ff)){const _0x346f55=await a7_0x423a7f({'type':'select','name':_0x10a345(0x1a0),'message':_0x10a345(0x166),'choices':[{'title':_0x10a345(0x191),'value':_0x10a345(0x15e)},{'title':_0x10a345(0x171),'value':'apikey'}]});if(!_0x346f55[_0x10a345(0x1a0)])return console[_0x10a345(0x170)](_0x10a345(0x189)),0x1;if(_0x346f55['method']===_0x10a345(0x15e))return await runOAuthLoginFlow(_0x3fa9ff,_0x4911ce,_0x46d222[_0x10a345(0x1a4)]??LogLevel[_0x10a345(0x174)]),0x0;}console[_0x10a345(0x170)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3fa9ff),console[_0x10a345(0x170)](_0x10a345(0x164)),console[_0x10a345(0x170)]('\x20\x20'+getConsoleUrl(_0x3fa9ff,_0x10a345(0x18b)));const _0x375f4f=await a7_0x423a7f({'type':_0x10a345(0x17d),'name':_0x10a345(0x16e),'message':_0x10a345(0x179),'validate':_0xf2ab24=>{const _0x4ccc78=_0x10a345;if(!_0xf2ab24||!_0xf2ab24[_0x4ccc78(0x16f)]())return _0x4ccc78(0x199);return!![];}});if(!_0x375f4f[_0x10a345(0x16e)])return console[_0x10a345(0x170)](_0x10a345(0x189)),0x1;const _0x2592e1=_0x375f4f[_0x10a345(0x16e)];console[_0x10a345(0x170)]('Validating\x20API\x20key...');try{const _0x57578a=TDX[_0x10a345(0x194)]({'site':_0x3fa9ff,'apiKey':_0x2592e1['trim'](),'logLevel':_0x46d222[_0x10a345(0x1a4)]??LogLevel[_0x10a345(0x174)]}),_0xb2d118=await _0x57578a[_0x10a345(0x173)]['getUserInfo']();console['log'](_0x10a345(0x180)+_0xb2d118['email']+')');const _0x49a66a=await isKeychainAvailable();_0x49a66a?(await saveAPIKeyAsync(_0x2592e1[_0x10a345(0x16f)](),_0x3fa9ff,_0x4911ce),console[_0x10a345(0x170)](_0x10a345(0x181)+(_0x4911ce?_0x10a345(0x197)+_0x4911ce+')':''))):(console[_0x10a345(0x18a)](a7_0x19c47d[_0x10a345(0x192)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x10a345(0x18a)](a7_0x19c47d['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x4911ce){const _0x335b8d={'site':_0x3fa9ff};saveProfileToUserConfig(_0x4911ce,_0x335b8d),console['log'](_0x10a345(0x19e)+_0x4911ce+_0x10a345(0x19f));}else saveDefaultSiteToUserConfig(_0x3fa9ff),console[_0x10a345(0x170)](_0x10a345(0x158)+_0x3fa9ff);const _0x5b1f0d=_0x4911ce?_0x10a345(0x183)+_0x4911ce:'';return console['log'](),console[_0x10a345(0x170)](_0x10a345(0x168)),console[_0x10a345(0x170)](_0x10a345(0x190)+_0x5b1f0d+_0x10a345(0x16d)),console[_0x10a345(0x170)](_0x10a345(0x190)+_0x5b1f0d+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2961ba){if(_0x2961ba instanceof HTTPClientError&&_0x2961ba[_0x10a345(0x186)]===0x191)return printAuthError(_0x2961ba),0x1;return console[_0x10a345(0x19a)](a7_0x19c47d[_0x10a345(0x176)](_0x10a345(0x159)+(_0x2961ba instanceof Error?_0x2961ba[_0x10a345(0x175)]:String(_0x2961ba)))),console[_0x10a345(0x19a)](_0x10a345(0x19c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x51e174(0x15a)]=a7_0x51e174(0x169);async[a7_0x51e174(0x15f)](_0x5c47cb){const _0x22cb9=a7_0x51e174,{options:_0x57e1c1,tdx:_0x2d2482}=_0x5c47cb,_0x3e799b=_0x57e1c1[_0x22cb9(0x1a1)],_0x345de2=_0x57e1c1[_0x22cb9(0x182)],_0x304bb5=_0x345de2?_0x345de2:_0x22cb9(0x162);console[_0x22cb9(0x170)](_0x22cb9(0x18e)+_0x304bb5+_0x22cb9(0x16b)+_0x3e799b+')');const _0x4e1b60=await getOAuthTokens(_0x345de2);if(_0x4e1b60)console[_0x22cb9(0x170)](_0x22cb9(0x185)),console['log'](_0x22cb9(0x17b)+(_0x345de2?'\x20(profile:\x20'+_0x345de2+')':''));else{const _0x1230d3=await resolveAPIKeyAsync(_0x3e799b,_0x345de2);if(_0x1230d3){const {source:_0x2a7728,isDeprecated:_0x5b7ee0}=_0x1230d3,_0x399a1c='Read\x20credential\x20from\x20'+_0x2a7728;console[_0x22cb9(0x170)](_0x5b7ee0?a7_0x19c47d[_0x22cb9(0x192)](_0x399a1c):_0x399a1c);}else console[_0x22cb9(0x170)](a7_0x19c47d['yellow'](_0x22cb9(0x187)));}try{const _0x54f8be=await _0x2d2482[_0x22cb9(0x173)]['getUserInfo']();return console['log'](a7_0x19c47d[_0x22cb9(0x193)](_0x22cb9(0x1a5))),console[_0x22cb9(0x170)](_0x22cb9(0x15d)+_0x54f8be[_0x22cb9(0x177)]),(_0x54f8be['first_name']||_0x54f8be[_0x22cb9(0x17a)])&&console['log'](_0x22cb9(0x195)+[_0x54f8be[_0x22cb9(0x188)],_0x54f8be[_0x22cb9(0x17a)]][_0x22cb9(0x161)](Boolean)[_0x22cb9(0x19b)]('\x20')),0x0;}catch(_0x4d0b86){return _0x4d0b86 instanceof HTTPClientError&&_0x4d0b86[_0x22cb9(0x186)]===0x191?printAuthError(_0x4d0b86,!![],_0x345de2):console[_0x22cb9(0x19a)](a7_0x19c47d[_0x22cb9(0x176)](_0x22cb9(0x159)+(_0x4d0b86 instanceof Error?_0x4d0b86[_0x22cb9(0x175)]:String(_0x4d0b86)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x51e174(0x178);['description']=a7_0x51e174(0x16c);async[a7_0x51e174(0x15f)](_0x1db091){const _0xb29263=a7_0x51e174,{options:_0x352c98}=_0x1db091,_0x51e026=_0x352c98[_0xb29263(0x182)];console['log'](a7_0x19c47d[_0xb29263(0x196)](_0xb29263(0x15c)));const _0x3e705=await isKeychainAvailable();if(!_0x3e705)return console[_0xb29263(0x19a)](a7_0x19c47d['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x19239d,_0x338d83]=await Promise[_0xb29263(0x17e)]([deleteKeychainAPIKey(_0x51e026),deleteOAuthTokens(_0x51e026)]);if(_0x19239d||_0x338d83){clearCredentialCache();const _0x1d356b=[_0x19239d&&_0xb29263(0x1a2),_0x338d83&&_0xb29263(0x15b)][_0xb29263(0x161)](Boolean)['join']('\x20and\x20');return console[_0xb29263(0x170)]('✓\x20'+_0x1d356b+'\x20removed\x20from\x20keychain'+(_0x51e026?_0xb29263(0x197)+_0x51e026+')':'')),0x0;}else return console[_0xb29263(0x170)](_0xb29263(0x18c)+(_0x51e026?'\x20for\x20profile:\x20'+_0x51e026:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x2d39cb=a8_0x4218;(function(_0x3c4456,_0x355c9e){const _0xd5a25f=a8_0x4218,_0x4ea009=_0x3c4456();while(!![]){try{const _0x458be2=-parseInt(_0xd5a25f(0x11f))/0x1+parseInt(_0xd5a25f(0x129))/0x2*(-parseInt(_0xd5a25f(0x140))/0x3)+-parseInt(_0xd5a25f(0x12c))/0x4*(-parseInt(_0xd5a25f(0x121))/0x5)+parseInt(_0xd5a25f(0x13a))/0x6+parseInt(_0xd5a25f(0x125))/0x7+-parseInt(_0xd5a25f(0x11b))/0x8+-parseInt(_0xd5a25f(0x131))/0x9*(-parseInt(_0xd5a25f(0x11c))/0xa);if(_0x458be2===_0x355c9e)break;else _0x4ea009['push'](_0x4ea009['shift']());}catch(_0x1f7baa){_0x4ea009['push'](_0x4ea009['shift']());}}}(a8_0x279f,0x5627c));import{BaseCommand}from'./command.js';function a8_0x4218(_0x139a2a,_0x1dc799){_0x139a2a=_0x139a2a-0x117;const _0x279f26=a8_0x279f();let _0x4218b2=_0x279f26[_0x139a2a];return _0x4218b2;}import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x500d2a from'chalk';export async function runOAuthLoginFlow(_0x27308e,_0x3ef654,_0x88741e){const _0x4264fc=a8_0x4218;if(!isOAuthSupported(_0x27308e))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x27308e+'.\x20'+_0x4264fc(0x12d)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x44c954=await isKeychainAvailable();if(!_0x44c954)throw new Error(_0x4264fc(0x11e)+_0x4264fc(0x13c));const _0x470b26=getConsoleUrl(_0x27308e);console['log'](_0x4264fc(0x128)),console[_0x4264fc(0x122)]('\x20\x20'+_0x470b26+'/oauth/authorize'),console[_0x4264fc(0x122)](_0x4264fc(0x126));const _0x2da4fa=await startOAuthFlow(_0x27308e);console[_0x4264fc(0x122)](_0x4264fc(0x132));const _0x33b5d1=TDX['create']({'site':_0x27308e,'accessToken':_0x2da4fa['access_token'],'logLevel':_0x88741e??LogLevel[_0x4264fc(0x117)]}),_0x532154=await _0x33b5d1[_0x4264fc(0x11a)][_0x4264fc(0x135)]();console[_0x4264fc(0x122)](a8_0x500d2a[_0x4264fc(0x136)](_0x4264fc(0x11d)+_0x532154[_0x4264fc(0x118)]+')')),await saveOAuthTokens(_0x2da4fa,_0x3ef654),console[_0x4264fc(0x122)](_0x4264fc(0x133)+(_0x3ef654?_0x4264fc(0x13d)+_0x3ef654+')':''));if(_0x3ef654){const _0xd46ab3={'site':_0x27308e};saveProfileToUserConfig(_0x3ef654,_0xd46ab3),console[_0x4264fc(0x122)](_0x4264fc(0x124)+_0x3ef654+_0x4264fc(0x13e));}const _0x5e2783=_0x3ef654?_0x4264fc(0x138)+_0x3ef654:'';console[_0x4264fc(0x122)](),console[_0x4264fc(0x122)](_0x4264fc(0x130)),console[_0x4264fc(0x122)](_0x4264fc(0x120)+_0x5e2783+_0x4264fc(0x119)),console[_0x4264fc(0x122)](_0x4264fc(0x120)+_0x5e2783+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}function a8_0x279f(){const _0x38a84e=['name','execute','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','414sRespo','Validating\x20OAuth\x20tokens...','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','tdx:\x20auth\x20login','getUserInfo','green','Login\x20via\x20OAuth\x20(opens\x20browser)','\x20--profile\x20','bold','195474fgSDtk','us01','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x20(profile:\x20','\x27\x20registered','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','60678vocYGR','logLevel','description','ERROR','email','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','4963408RtruxM','103990tOvvyr','✓\x20Authentication\x20successful\x20(User:\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','268942ISjFSy','\x20\x20tdx','172045GoOlsq','log','auth:login','✓\x20Profile\x20\x27','4098857vAkKaQ','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','profile','Opening\x20browser\x20for\x20authentication...','6vspGkp','Login\x20cancelled','site','24NNvYAi','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'];a8_0x279f=function(){return _0x38a84e;};return a8_0x279f();}export class AuthLoginCommand extends BaseCommand{[a8_0x2d39cb(0x12e)]=a8_0x2d39cb(0x123);[a8_0x2d39cb(0x142)]=a8_0x2d39cb(0x137);async[a8_0x2d39cb(0x12f)](_0x32e5af){const _0x4cdac2=a8_0x2d39cb,{options:_0x2e32a3}=_0x32e5af,_0x5945ba=_0x2e32a3[_0x4cdac2(0x127)];console['log'](a8_0x500d2a[_0x4cdac2(0x139)](_0x4cdac2(0x134)));const _0x5967ac=_0x2e32a3[_0x4cdac2(0x12b)]||_0x4cdac2(0x13b),_0x1d9fb2=await promptSiteSelection(_0x5967ac,_0x5945ba,_0x4cdac2(0x12a));if(!_0x1d9fb2)return 0x1;const _0x4682a2=resolveSite(_0x1d9fb2);return console[_0x4cdac2(0x122)](_0x4cdac2(0x13f)+_0x4682a2),await runOAuthLoginFlow(_0x4682a2,_0x5945ba,_0x2e32a3[_0x4cdac2(0x141)]??LogLevel[_0x4cdac2(0x117)]),0x0;}}
|