@treasuredata/tdx 2026.3.29 → 2026.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x1c1b57=a3_0x355c;(function(_0x175b6a,_0x58b1c3){const _0x3c0029=a3_0x355c,_0x3c8350=_0x175b6a();while(!![]){try{const _0x4574e5=parseInt(_0x3c0029(0xfb))/0x1+-parseInt(_0x3c0029(0x103))/0x2+parseInt(_0x3c0029(0x101))/0x3*(-parseInt(_0x3c0029(0x108))/0x4)+parseInt(_0x3c0029(0x117))/0x5*(parseInt(_0x3c0029(0x110))/0x6)+-parseInt(_0x3c0029(0xfc))/0x7+-parseInt(_0x3c0029(0x115))/0x8*(-parseInt(_0x3c0029(0x10c))/0x9)+-parseInt(_0x3c0029(0xf6))/0xa*(-parseInt(_0x3c0029(0x10a))/0xb);if(_0x4574e5===_0x58b1c3)break;else _0x3c8350['push'](_0x3c8350['shift']());}catch(_0x2805a1){_0x3c8350['push'](_0x3c8350['shift']());}}}(a3_0x1be5,0xe9f4d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x355c(_0x121ec5,_0x27f953){_0x121ec5=_0x121ec5-0xf4;const _0x1be5ea=a3_0x1be5();let _0x355c75=_0x1be5ea[_0x121ec5];return _0x355c75;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x1c1b57(0x104)]=a3_0x1c1b57(0x116);['description']=a3_0x1c1b57(0xfd);async[a3_0x1c1b57(0x109)](_0x4c8559){const _0x5a93e5=a3_0x1c1b57,{options:_0x1498ea,args:_0x4ed0a7,tdx:_0x5d2a65}=_0x4c8559;if(_0x4ed0a7['length']===0x0)return console[_0x5a93e5(0x10f)](_0x5a93e5(0x118)),console[_0x5a93e5(0x10f)](_0x5a93e5(0x10d)),0x1;try{const {parentId:_0x3fb54b,childId:_0x33cf11}=parseSegmentRef(_0x4ed0a7[0x0]);if(!_0x33cf11)return console[_0x5a93e5(0x10f)](_0x5a93e5(0x106)),console[_0x5a93e5(0x10f)](_0x5a93e5(0x10d)),0x1;_0x1498ea['verbose']&&(console[_0x5a93e5(0x10f)](_0x5a93e5(0xfa)+_0x1498ea[_0x5a93e5(0x102)]),console[_0x5a93e5(0x10f)](_0x5a93e5(0xf8)+_0x3fb54b),console['error'](_0x5a93e5(0xf5)+_0x33cf11));const _0xd0dc8b=await withSpinner(_0x5a93e5(0x113)+_0x3fb54b+_0x5a93e5(0xfe),()=>_0x5d2a65[_0x5a93e5(0x107)]['resolveParentId'](_0x3fb54b),{'verbose':_0x1498ea[_0x5a93e5(0x114)]}),_0x3df559=_0xd0dc8b[_0x5a93e5(0x105)];_0x1498ea[_0x5a93e5(0x114)]&&console['error'](_0x5a93e5(0xf4)+_0x3df559);const _0x4b603a=await withSpinner(_0x5a93e5(0xf7)+_0x33cf11+_0x5a93e5(0xfe),()=>_0x5d2a65[_0x5a93e5(0x107)][_0x5a93e5(0x111)](_0x3df559,_0x33cf11),{'verbose':_0x1498ea[_0x5a93e5(0x114)]}),_0x249e5a=_0x4b603a[_0x5a93e5(0x105)];_0x1498ea[_0x5a93e5(0x114)]&&console[_0x5a93e5(0x10f)](_0x5a93e5(0x100)+_0x249e5a);const _0x3f0987=await withSpinner(_0x5a93e5(0x10b)+_0x33cf11+_0x5a93e5(0xfe),()=>_0x5d2a65[_0x5a93e5(0x107)]['listActivations'](_0x3df559,_0x249e5a),{'verbose':_0x1498ea[_0x5a93e5(0x114)]}),_0x1c27fe=_0x3f0987['data'];return console[_0x5a93e5(0x10f)](_0x5a93e5(0xf9)+_0x1c27fe['length']+'\x20activation'+(_0x1c27fe['length']!==0x1?'s':'')),await handleSDKOutput(_0x1c27fe,_0x1498ea),0x0;}catch(_0x1ed8b3){if(_0x1ed8b3 instanceof SDKError)return console[_0x5a93e5(0x10f)](_0x5a93e5(0x112)+_0x1ed8b3[_0x5a93e5(0xff)]),_0x1ed8b3[_0x5a93e5(0x10e)]&&console['error']('\x20\x20Cause:\x20'+_0x1ed8b3['cause']),0x1;throw _0x1ed8b3;}}}function a3_0x1be5(){const _0x4b0a53=['16PAYMvm','execute','4037oKxDRj','Listing\x20activations\x20for\x20segment\x20\x27','81747xVKNyl','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','cause','error','1020SkAziQ','resolveSegmentId','Error:\x20','Resolving\x20parent\x20segment\x20\x27','verbose','496HHemkL','activations','39395PQYyeU','Error:\x20Segment\x20name\x20is\x20required','Resolved\x20parent\x20ID:\x20','Child\x20name:\x20','37430uZxAEW','Resolving\x20child\x20segment\x20\x27','Parent\x20name:\x20','✔\x20Found\x20','Site:\x20','1348793bISxto','3973662AymLkv','List\x20activations\x20for\x20a\x20segment','\x27...','message','Resolved\x20child\x20ID:\x20','1231686hIKUIX','site','2913702kJpRDC','name','data','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','segment'];a3_0x1be5=function(){return _0x4b0a53;};return a3_0x1be5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x150f60=a4_0x2e06;(function(_0x3a1149,_0x15485e){const _0xd8c864=a4_0x2e06,_0x19ba71=_0x3a1149();while(!![]){try{const _0x9df016=parseInt(_0xd8c864(0x18b))/0x1*(-parseInt(_0xd8c864(0x16f))/0x2)+parseInt(_0xd8c864(0x159))/0x3+-parseInt(_0xd8c864(0x128))/0x4+parseInt(_0xd8c864(0x151))/0x5*(-parseInt(_0xd8c864(0x190))/0x6)+parseInt(_0xd8c864(0x1ce))/0x7+parseInt(_0xd8c864(0x1d5))/0x8+parseInt(_0xd8c864(0x15d))/0x9*(-parseInt(_0xd8c864(0x1dc))/0xa);if(_0x9df016===_0x15485e)break;else _0x19ba71['push'](_0x19ba71['shift']());}catch(_0x3bbb29){_0x19ba71['push'](_0x19ba71['shift']());}}}(a4_0xef3b,0x2c83c));import a4_0x5c10dc from'chalk';import a4_0x1df191 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_0xef3b(){const _0x5800bc=['\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Agent\x20','yellow','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','push','\x0a✔\x20Pulled\x20','textKnowledgeBases','error','\x20\x20Integrations:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','No\x20tdx.json\x20found\x20in\x20','Using\x20context\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Target:\x20','updated','hasChanges','log','llmProject','-\x20no\x20files\x20written','Agent:\x20','\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\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20created','green','diff','Output\x20path:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','yes','MISSING_ARGUMENT','name','counts','Summary:','119980MrSfAG','\x22...','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','INVALID_ARGUMENT','\x20\x20Prompts:\x20','agent:clone','projectDir','582270EhdkOa','pushProject','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Source:\x20','737883sKyFRl','\x22\x20to\x20\x22','Using\x20local\x20project:\x20','outputPath','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agent.yml','projectName','\x20\x20Integration\x20\x22','utf-8','Pushing\x20agent\x20from\x20\x22','Using\x20current\x20project:\x20','agents','execute','\x20successfully','cyan','\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','created','<new-name>','599802fWjwuK','\x20updated','Pushing\x20to\x20project...','cwd','Would\x20pull\x20agent:\x20','Using\x20project:\x20','dim','knowledgeBases','parse','errors','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Dry\x20run\x20-\x20no\x20changes\x20made','Clone\x20\x22','\x20|\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','outputDir','agent:pull','session','pushAgent','experimentalArtifacts','\x20\x20tdx\x20agent\x20clone\x20agents/','Using\x20project\x20from\x20','\x20unchanged','Errors:','agentId','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','new','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','1jJRdDH','\x0aPush\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','60jWORdp','\x20\x20Agents:\x20','Project:\x20','arg-dir','\x20files\x20to\x20','dirname','\x20files?','\x20new','Project\x20cloned\x20with\x20errors','\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','sourceProjectName','newProjectId','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','force','action','Agent\x20pulled\x20successfully','dryRun','\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','\x20resources?','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','prompts','unchanged','join','\x0a✔\x20Pushed\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','✔\x20Context\x20set:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Cannot\x20clone\x20from\x20context\x20project\x20\x22','New\x20project:\x20','source','Cancelled','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','experimentalKnowledgeBases','pullProject','\x20changed','message','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','integrations','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Agent\x20\x22','New\x20project\x20name\x20is\x20required','pullAgent','tdx.json','Analyzing\x20changes\x20to\x20push...','\x0aWrite\x20','output','\x20errors','cloneProject','\x0aChanges:','agent','\x0aChanges\x20to\x20prompt\x20\x27','repeat','red','newProjectName','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Experimental\x20Artifacts:\x20','llm_project','reason','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1778672XdWYnf','total','Status:\x20','context','New\x20project\x20ID:\x20','gray','llm','2872984PmjZRo','Would\x20push\x20agent:\x20','no_local_folder','description','Source:\x20','Output:\x20','\x20=\x20','10BfLeVF','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x22:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20--name\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Writing\x20files...','12516KPhvtx','\x22\x20to\x20a\x20different\x20profile','agentName','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','projectId','\x0aProject\x20pushed\x20with\x20errors','\x20total','site','\x0aError:'];a4_0xef3b=function(){return _0x5800bc;};return a4_0xef3b();}function a4_0x2e06(_0x5927d5,_0x8f2648){_0x5927d5=_0x5927d5-0x123;const _0xef3bcb=a4_0xef3b();let _0x2e063f=_0xef3bcb[_0x5927d5];return _0x2e063f;}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(_0x673161){const _0x20723d=a4_0x2e06,_0x4616c8=[];if(_0x673161[_0x20723d(0x1cf)]!==undefined)_0x4616c8[_0x20723d(0x135)](_0x673161[_0x20723d(0x1cf)]+_0x20723d(0x12e));if(_0x673161[_0x20723d(0x189)]!==undefined&&_0x673161[_0x20723d(0x189)]>0x0)_0x4616c8['push'](a4_0x5c10dc['green'](_0x673161[_0x20723d(0x189)]+_0x20723d(0x197)));if(_0x673161['created']!==undefined&&_0x673161[_0x20723d(0x16d)]>0x0)_0x4616c8['push'](a4_0x5c10dc[_0x20723d(0x148)](_0x673161['created']+_0x20723d(0x147)));if(_0x673161['updated']!==undefined&&_0x673161[_0x20723d(0x13f)]>0x0)_0x4616c8[_0x20723d(0x135)](a4_0x5c10dc['yellow'](_0x673161[_0x20723d(0x13f)]+_0x20723d(0x170)));if(_0x673161[_0x20723d(0x1a5)]!==undefined&&_0x673161[_0x20723d(0x1a5)]>0x0)_0x4616c8['push'](a4_0x5c10dc['gray'](_0x673161[_0x20723d(0x1a5)]+_0x20723d(0x185)));if(_0x673161['errors']!==undefined&&_0x673161[_0x20723d(0x178)]>0x0)_0x4616c8['push'](a4_0x5c10dc[_0x20723d(0x1c7)](_0x673161['errors']+_0x20723d(0x1c1)));return _0x4616c8[_0x20723d(0x1a6)](',\x20');}function displayDiffs(_0x523e50,_0x2e15a2,_0x1591d8,_0xb96966,_0x30f46b,_0x3a3875,_0x5cf586){const _0x3278f3=a4_0x2e06;for(const _0x26a70b of _0x523e50){if(_0x26a70b[_0x3278f3(0x149)]){const _0x22b8ac=_0x26a70b[_0x3278f3(0x12a)]||_0x26a70b[_0x3278f3(0x14e)];console[_0x3278f3(0x141)](_0x3278f3(0x154)+_0x22b8ac+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x26a70b[_0x3278f3(0x149)]),console['log']('─'[_0x3278f3(0x1c6)](0x3c));}}for(const _0x1dc7ba of _0x2e15a2){_0x1dc7ba['diff']&&(console[_0x3278f3(0x141)](_0x3278f3(0x134)+_0x1dc7ba[_0x3278f3(0x14e)]+'\x27:'),console['log']('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x1dc7ba[_0x3278f3(0x149)]),console['log']('─'[_0x3278f3(0x1c6)](0x3c)));}for(const _0x653b8b of _0x1591d8){_0x653b8b[_0x3278f3(0x149)]&&(console[_0x3278f3(0x141)](_0x3278f3(0x1a3)+_0x653b8b[_0x3278f3(0x14e)]+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x653b8b[_0x3278f3(0x149)]),console[_0x3278f3(0x141)]('─'['repeat'](0x3c)));}for(const _0x5f23a1 of _0xb96966){_0x5f23a1[_0x3278f3(0x149)]&&(console['log'](_0x3278f3(0x1c5)+_0x5f23a1[_0x3278f3(0x14e)]+'\x27:'),console['log']('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x5f23a1['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x2b5ea5 of _0x30f46b){_0x2b5ea5[_0x3278f3(0x149)]&&(console['log'](_0x3278f3(0x13d)+_0x2b5ea5[_0x3278f3(0x14e)]+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x2b5ea5[_0x3278f3(0x149)]),console[_0x3278f3(0x141)]('─'['repeat'](0x3c)));}for(const _0x4b57b0 of _0x3a3875){_0x4b57b0[_0x3278f3(0x149)]&&(console[_0x3278f3(0x141)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4b57b0[_0x3278f3(0x14e)]+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console['log'](_0x4b57b0[_0x3278f3(0x149)]),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)));}for(const _0x45050a of _0x5cf586){_0x45050a[_0x3278f3(0x149)]&&(console[_0x3278f3(0x141)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x45050a['name']+'\x27:'),console['log']('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x45050a['diff']),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x150f60(0x14e)]=a4_0x150f60(0x17f);['description']=a4_0x150f60(0x1b6);async[a4_0x150f60(0x169)](_0x55699a){const _0x5d61d5=a4_0x150f60,{options:_0x42ae5d,args:_0x4b29e8,tdx:_0x4cf83d}=_0x55699a,_0x57f5b1=_0x4b29e8[0x0],_0x4d9cdb=_0x4b29e8[0x1],_0x1bcc21=_0x42ae5d[_0x5d61d5(0x1c0)],_0x1fe289=_0x42ae5d['dryRun'],_0x558399=_0x42ae5d[_0x5d61d5(0x19d)],_0xc27a0a=_0x42ae5d[_0x5d61d5(0x14c)],_0x48a367=_0x42ae5d[_0x5d61d5(0x142)],_0x163f68=_0x42ae5d[_0x5d61d5(0x1c4)];let _0x1d8185;if(_0x57f5b1){const _0x12c117=a4_0x1df191['join'](_0x57f5b1,_0x5d61d5(0x1bd));if(existsSync(_0x12c117))try{const _0x311f3a=JSON['parse'](readFileSync(_0x12c117,_0x5d61d5(0x165)));_0x311f3a[_0x5d61d5(0x1cb)]&&(_0x1d8185={'llm_project':_0x311f3a[_0x5d61d5(0x1cb)]});}catch{}}const _0x2a59ef=findAgentConfigPath(process[_0x5d61d5(0x172)]());let _0x2db52c;if(_0x2a59ef)try{const _0x1bf02e=JSON[_0x5d61d5(0x177)](readFileSync(_0x2a59ef,_0x5d61d5(0x165)));_0x1bf02e[_0x5d61d5(0x1cb)]&&(_0x2db52c={'llm_project':_0x1bf02e[_0x5d61d5(0x1cb)]});}catch{}const _0x5030be=resolveAgentPullArgs({'arg':_0x57f5b1,'agentNameArg':_0x4d9cdb,'agentFlag':_0x163f68,'contextProject':_0x48a367,'argDirConfig':_0x1d8185,'cwdConfigPath':_0x2a59ef||undefined,'cwdConfig':_0x2db52c}),{projectNameOrId:_0x413faa,targetAgentName:_0x56d887,existingOutputDir:_0x5be13d,source:_0x29cec2}=_0x5030be;if(_0x29cec2===_0x5d61d5(0x193))console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x184)+a4_0x1df191[_0x5d61d5(0x1a6)](_0x57f5b1,'tdx.json')+':\x20'+_0x413faa));else{if(_0x29cec2==='cwd-config')console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x174)+_0x413faa));else _0x29cec2===_0x5d61d5(0x1d1)&&console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x175)]('Using\x20project\x20from\x20context:\x20'+_0x413faa));}if(!_0x413faa)return _0x163f68?(console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x12b))),console[_0x5d61d5(0x141)](_0x5d61d5(0x1a8)),console[_0x5d61d5(0x141)](_0x5d61d5(0x1aa))):(console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x188))),console[_0x5d61d5(0x141)](_0x5d61d5(0x1af)),console[_0x5d61d5(0x141)](_0x5d61d5(0x16c)),console[_0x5d61d5(0x141)](_0x5d61d5(0x145)),console['log'](_0x5d61d5(0x199)),console[_0x5d61d5(0x141)](_0x5d61d5(0x1a1))),0x1;if(_0x56d887){const {data:_0x42b335}=await withSpinner('Pulling\x20agent\x20\x22'+_0x56d887+'\x22\x20from\x20project\x20\x22'+_0x413faa+_0x5d61d5(0x152),()=>_0x4cf83d['llm'][_0x5d61d5(0x1bc)](_0x413faa,_0x56d887,_0x1bcc21,{'dryRun':_0x1fe289,'force':_0x558399}));if(_0x1fe289)return console['log'](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x18e))),console[_0x5d61d5(0x141)](_0x5d61d5(0x173)+_0x42b335[_0x5d61d5(0x12a)]),console[_0x5d61d5(0x141)](_0x5d61d5(0x14a)+_0x42b335[_0x5d61d5(0x160)]),_0x42b335[_0x5d61d5(0x149)]&&(console[_0x5d61d5(0x141)](_0x5d61d5(0x1c3)),console[_0x5d61d5(0x141)]('─'[_0x5d61d5(0x1c6)](0x3c)),console[_0x5d61d5(0x141)](_0x42b335[_0x5d61d5(0x149)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x19f))),console['log'](_0x5d61d5(0x144)+_0x42b335[_0x5d61d5(0x12a)]),console[_0x5d61d5(0x141)](_0x5d61d5(0x1da)+_0x42b335[_0x5d61d5(0x160)]),console[_0x5d61d5(0x141)](_0x5d61d5(0x1d0)+(_0x42b335['isNew']?a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x189)):_0x42b335[_0x5d61d5(0x140)]?a4_0x5c10dc['yellow'](_0x5d61d5(0x13f)):a4_0x5c10dc[_0x5d61d5(0x1d3)](_0x5d61d5(0x1a5)))),0x0;}const _0x56f155=_0x5be13d||_0x1bcc21,{data:_0x5ba55d}=await withSpinner('Analyzing\x20project\x20\x22'+_0x413faa+_0x5d61d5(0x152),()=>_0x4cf83d[_0x5d61d5(0x1d4)][_0x5d61d5(0x1b1)](_0x413faa,_0x56f155,{'dryRun':!![]})),_0x59c970=_0x5ba55d[_0x5d61d5(0x14f)]['agents']['new']+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x176)]['new']+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x137)]['new']+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1a4)][_0x5d61d5(0x189)]+_0x5ba55d['counts'][_0x5d61d5(0x1b5)][_0x5d61d5(0x189)]+_0x5ba55d['counts'][_0x5d61d5(0x1b0)][_0x5d61d5(0x189)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x182)]['new'],_0xccfa87=_0x5ba55d['counts'][_0x5d61d5(0x168)][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)]['knowledgeBases']['updated']+_0x5ba55d[_0x5d61d5(0x14f)]['textKnowledgeBases'][_0x5d61d5(0x13f)]+_0x5ba55d['counts'][_0x5d61d5(0x1a4)][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b5)][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)]['experimentalKnowledgeBases'][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)]['experimentalArtifacts']['updated'],_0x48d6d0=_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x168)][_0x5d61d5(0x1a5)]+_0x5ba55d[_0x5d61d5(0x14f)]['knowledgeBases'][_0x5d61d5(0x1a5)]+_0x5ba55d['counts']['textKnowledgeBases'][_0x5d61d5(0x1a5)]+_0x5ba55d['counts'][_0x5d61d5(0x1a4)][_0x5d61d5(0x1a5)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b5)]['unchanged']+_0x5ba55d['counts'][_0x5d61d5(0x1b0)][_0x5d61d5(0x1a5)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x182)][_0x5d61d5(0x1a5)];console[_0x5d61d5(0x141)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5ba55d[_0x5d61d5(0x163)]+'\x27:'),console['log']('\x20\x20'+a4_0x5c10dc['green']('+\x20'+_0x59c970+_0x5d61d5(0x197))+_0x5d61d5(0x17c)+a4_0x5c10dc[_0x5d61d5(0x133)]('~\x20'+_0xccfa87+_0x5d61d5(0x1b2))+_0x5d61d5(0x17c)+a4_0x5c10dc['dim']('=\x20'+_0x48d6d0+_0x5d61d5(0x185))),console[_0x5d61d5(0x141)](_0x5d61d5(0x191)+formatCountSummary(_0x5ba55d['counts']['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5ba55d['counts']['knowledgeBases'])),console['log'](_0x5d61d5(0x1b8)+formatCountSummary(_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x137)])),console[_0x5d61d5(0x141)](_0x5d61d5(0x156)+formatCountSummary(_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1a4)])),console['log'](_0x5d61d5(0x139)+formatCountSummary(_0x5ba55d['counts']['integrations']));const _0x5b8da5=_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b0)][_0x5d61d5(0x1cf)]>0x0||_0x5ba55d[_0x5d61d5(0x14f)]['experimentalArtifacts']['total']>0x0;_0x5b8da5&&(console['log'](_0x5d61d5(0x18f)+formatCountSummary(_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b0)])),console[_0x5d61d5(0x141)](_0x5d61d5(0x1ca)+formatCountSummary(_0x5ba55d['counts']['experimentalArtifacts'])));console[_0x5d61d5(0x141)](_0x5d61d5(0x13e)+a4_0x5c10dc[_0x5d61d5(0x16b)](_0x5ba55d[_0x5d61d5(0x17e)])),displayDiffs(_0x5ba55d[_0x5d61d5(0x168)],_0x5ba55d[_0x5d61d5(0x176)],_0x5ba55d[_0x5d61d5(0x137)],_0x5ba55d[_0x5d61d5(0x1a4)],_0x5ba55d['integrations'],_0x5ba55d['experimentalKnowledgeBases'],_0x5ba55d['experimentalArtifacts']);if(_0x1fe289)return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x131))),0x0;if(_0x59c970===0x0&&_0xccfa87===0x0)return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x14b))),saveSessionContext({'llm_project':_0x5ba55d['projectName']},_0x42ae5d[_0x5d61d5(0x180)]),console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x1a9)+a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x1cb))+_0x5d61d5(0x1db)+a4_0x5c10dc[_0x5d61d5(0x16b)](_0x5ba55d[_0x5d61d5(0x163)]))),0x0;if(!_0xc27a0a&&!_0x558399){if(!isInteractive())return console['error'](a4_0x5c10dc[_0x5d61d5(0x1c7)]('\x0aError:'),_0x5d61d5(0x179)),console[_0x5d61d5(0x138)](a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x1cd))),0x1;const _0xcdb5ee=await confirmKey(_0x5d61d5(0x1bf)+(_0x59c970+_0xccfa87)+_0x5d61d5(0x196));if(!_0xcdb5ee)return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x1ae)),_0x5d61d5(0x143)),0x1;}const {data:_0x4dcbc1}=await withSpinner(_0x5d61d5(0x127),()=>_0x4cf83d[_0x5d61d5(0x1d4)][_0x5d61d5(0x1b1)](_0x413faa,_0x56f155,{'force':_0x558399}));return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x136)+(_0x59c970+_0xccfa87)+_0x5d61d5(0x194)+_0x4dcbc1[_0x5d61d5(0x17e)])),saveSessionContext({'llm_project':_0x4dcbc1[_0x5d61d5(0x163)]},_0x42ae5d[_0x5d61d5(0x180)]),console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x1a9)+a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x1cb))+_0x5d61d5(0x1db)+a4_0x5c10dc[_0x5d61d5(0x16b)](_0x4dcbc1[_0x5d61d5(0x163)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x150f60(0x14e)]=a4_0x150f60(0x157);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x150f60(0x169)](_0x86d43d){const _0x2a3405=a4_0x150f60,{options:_0x1fd14f,args:_0x4f6b19,tdx:_0x406cf9}=_0x86d43d,_0x58c239=_0x4f6b19[0x0],_0x3d41cf=_0x1fd14f[_0x2a3405(0x14e)],_0x461df7=_0x1fd14f[_0x2a3405(0x1a0)],_0x1656c1=_0x1fd14f[_0x2a3405(0x14c)],_0xe46107=_0x1fd14f[_0x2a3405(0x12f)],_0x5f1b57=_0x1fd14f['llmProject'];let _0x2add9d;const _0x1e4f30=findAgentConfigPath(process[_0x2a3405(0x172)]());if(_0x58c239){const _0x4999e3=a4_0x1df191[_0x2a3405(0x1a6)](_0x58c239,'tdx.json');existsSync(_0x4999e3)?(_0x2add9d=_0x58c239,console['log'](a4_0x5c10dc[_0x2a3405(0x175)](_0x2a3405(0x15f)+_0x58c239))):_0x2add9d=_0x58c239;}else{if(_0x1e4f30)_0x2add9d=a4_0x1df191['dirname'](_0x1e4f30),console['log'](a4_0x5c10dc['dim'](_0x2a3405(0x167)+_0x2add9d));else{if(_0x5f1b57){const _0x5bed2d=sanitizeForFilesystem(_0x5f1b57);let _0x555afd=_0x5bed2d,_0x502382=a4_0x1df191[_0x2a3405(0x1a6)](process[_0x2a3405(0x172)](),'agents',_0x5bed2d,'tdx.json');if(!existsSync(_0x502382)){const _0x14346d=normalizeName(_0x5f1b57),_0x44068d=a4_0x1df191[_0x2a3405(0x1a6)](process['cwd'](),'agents',_0x14346d,_0x2a3405(0x1bd));existsSync(_0x44068d)&&(_0x555afd=_0x14346d,_0x502382=_0x44068d);}if(existsSync(_0x502382))_0x2add9d=a4_0x1df191[_0x2a3405(0x195)](_0x502382),console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x175)]('Using\x20local\x20project:\x20'+_0x2add9d));else{const _0x3a6b20=_0x1fd14f['profile'];if(_0x3a6b20)throw new SDKError(ErrorCode[_0x2a3405(0x155)],_0x2a3405(0x1ab)+_0x5f1b57+_0x2a3405(0x129),undefined,{'helpText':_0x2a3405(0x126)+_0x2a3405(0x161)+(_0x2a3405(0x15b)+_0x5f1b57+'\x0a')+(_0x2a3405(0x183)+_0x555afd+_0x2a3405(0x125)+(_0x3d41cf||_0x2a3405(0x16e))+'\x20--profile\x20'+_0x3a6b20)});_0x2add9d=_0x5f1b57,console[_0x2a3405(0x141)](a4_0x5c10dc['dim'](_0x2a3405(0x13c)+_0x5f1b57));}}}}if(!_0x2add9d)return console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x133)](_0x2a3405(0x18d))),console[_0x2a3405(0x141)](_0x2a3405(0x146)),console[_0x2a3405(0x141)](_0x2a3405(0x1dd)),console[_0x2a3405(0x141)]('\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[_0x2a3405(0x141)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3d41cf)throw new SDKError(ErrorCode[_0x2a3405(0x14d)],_0x2a3405(0x1bb),undefined,{'helpText':_0x2a3405(0x13a)});if(!_0x1656c1&&!_0x461df7){if(!isInteractive())return console[_0x2a3405(0x138)](a4_0x5c10dc['red'](_0x2a3405(0x130)),_0x2a3405(0x179)),console[_0x2a3405(0x138)](a4_0x5c10dc['dim'](_0x2a3405(0x1cd))),0x1;const _0x54be16=await confirmKey(_0x2a3405(0x17b)+_0x2add9d+'\x22\x20to\x20new\x20project\x20\x22'+_0x3d41cf+'\x22?');if(!_0x54be16)return console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x133)](_0x2a3405(0x1ae))),0x1;}const {data:_0x3e55f1}=await withSpinner('Cloning\x20\x22'+_0x2add9d+_0x2a3405(0x15e)+_0x3d41cf+'\x22...',()=>_0x406cf9[_0x2a3405(0x1d4)][_0x2a3405(0x1c2)](_0x2add9d,_0x3d41cf,{'dryRun':_0x461df7}));if(_0x461df7){console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x133)](_0x2a3405(0x17a))),console[_0x2a3405(0x141)]('Source:\x20'+_0x3e55f1[_0x2a3405(0x19a)]),console['log'](_0x2a3405(0x1ac)+_0x3d41cf),console[_0x2a3405(0x141)]('Would\x20clone:'),console['log'](_0x2a3405(0x191)+_0x3e55f1[_0x2a3405(0x14f)]['agents']['created']),console[_0x2a3405(0x141)](_0x2a3405(0x1c9)+_0x3e55f1[_0x2a3405(0x14f)]['knowledgeBases'][_0x2a3405(0x16d)]),console['log']('\x20\x20Prompts:\x20'+_0x3e55f1[_0x2a3405(0x14f)]['prompts'][_0x2a3405(0x16d)]);const _0x5da87e=_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x1b0)][_0x2a3405(0x16d)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)]['created']>0x0;return _0x5da87e&&(console[_0x2a3405(0x141)](_0x2a3405(0x18f)+_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'][_0x2a3405(0x16d)]),console['log'](_0x2a3405(0x1ca)+_0x3e55f1['counts'][_0x2a3405(0x182)]['created'])),0x0;}const _0x5ae92a=_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x168)][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x176)][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)]['prompts'][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x1b0)][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)][_0x2a3405(0x178)]>0x0;_0x5ae92a?console['log'](a4_0x5c10dc['yellow'](_0x2a3405(0x198))):console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x148)](_0x2a3405(0x1b7)));console['log'](_0x2a3405(0x1d9)+_0x3e55f1[_0x2a3405(0x19a)]),console[_0x2a3405(0x141)](_0x2a3405(0x1ac)+_0x3e55f1[_0x2a3405(0x1c8)]),console[_0x2a3405(0x141)](_0x2a3405(0x1d2)+_0x3e55f1[_0x2a3405(0x19b)]),console[_0x2a3405(0x141)](),console['log'](_0x2a3405(0x150)),console['log'](_0x2a3405(0x191)+formatCountSummary(_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x168)])),console[_0x2a3405(0x141)](_0x2a3405(0x1c9)+formatCountSummary(_0x3e55f1['counts'][_0x2a3405(0x176)])),console[_0x2a3405(0x141)](_0x2a3405(0x156)+formatCountSummary(_0x3e55f1['counts'][_0x2a3405(0x1a4)])),console[_0x2a3405(0x141)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x1b5)]));const _0x5678c1=_0x3e55f1['counts'][_0x2a3405(0x1b0)][_0x2a3405(0x16d)]>0x0||_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'][_0x2a3405(0x13f)]>0x0||_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'][_0x2a3405(0x1a5)]>0x0||_0x3e55f1['counts'][_0x2a3405(0x182)][_0x2a3405(0x16d)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)][_0x2a3405(0x13f)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)]['unchanged']>0x0;_0x5678c1&&(console[_0x2a3405(0x141)](_0x2a3405(0x18f)+formatCountSummary(_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'])),console['log'](_0x2a3405(0x1ca)+formatCountSummary(_0x3e55f1['counts'][_0x2a3405(0x182)])));if(_0x5ae92a){console[_0x2a3405(0x141)](),console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x186)));for(const _0x5ca45e of _0x3e55f1[_0x2a3405(0x168)]){_0x5ca45e['action']===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x1ba)+_0x5ca45e[_0x2a3405(0x12a)]+_0x2a3405(0x123)+_0x5ca45e[_0x2a3405(0x138)]));}for(const _0x2f92a7 of _0x3e55f1[_0x2a3405(0x176)]){_0x2f92a7[_0x2a3405(0x19e)]===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x124)+_0x2f92a7['name']+_0x2a3405(0x123)+_0x2f92a7['error']));}for(const _0x2a242b of _0x3e55f1[_0x2a3405(0x1a4)]){_0x2a242b[_0x2a3405(0x19e)]===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)]('\x20\x20Prompt\x20\x22'+_0x2a242b[_0x2a3405(0x14e)]+_0x2a3405(0x123)+_0x2a242b['error']));}for(const _0x44f2c3 of _0x3e55f1[_0x2a3405(0x1b5)]){_0x44f2c3['action']===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x164)+_0x44f2c3['name']+'\x22:\x20'+_0x44f2c3[_0x2a3405(0x138)]));}for(const _0x483599 of _0x3e55f1[_0x2a3405(0x1b0)]){_0x483599[_0x2a3405(0x19e)]==='error'&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x483599[_0x2a3405(0x14e)]+_0x2a3405(0x123)+_0x483599[_0x2a3405(0x138)]));}for(const _0x5c8304 of _0x3e55f1[_0x2a3405(0x182)]){_0x5c8304[_0x2a3405(0x19e)]===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5c8304[_0x2a3405(0x14e)]+'\x22:\x20'+_0x5c8304['error']));}return 0x1;}console[_0x2a3405(0x141)]();const _0x5060f8=getLLMProjectUrl(_0xe46107,_0x3e55f1['newProjectId']);return console[_0x2a3405(0x141)](_0x2a3405(0x192)+a4_0x5c10dc[_0x2a3405(0x16b)](_0x5060f8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x150f60(0x14e)]='agent:push';[a4_0x150f60(0x1d8)]=a4_0x150f60(0x18a);async['execute'](_0x4494ba){const _0x424273=a4_0x150f60,{options:_0x126740,args:_0x3fdb45,tdx:_0x30af1d}=_0x4494ba;let _0x592686=_0x3fdb45[0x0]||process[_0x424273(0x172)]();const _0x595573=_0x126740[_0x424273(0x1a0)],_0x57e96c=_0x126740[_0x424273(0x19d)],_0x331a3e=_0x126740[_0x424273(0x14c)],_0x54ce39=_0x126740[_0x424273(0x12f)],_0x96a35a=a4_0x1df191[_0x424273(0x1a6)](_0x592686,_0x424273(0x162)),_0x385758=existsSync(_0x96a35a);if(_0x385758){const {data:_0xa1cd49}=await withSpinner(_0x424273(0x166)+_0x592686+_0x424273(0x152),()=>_0x30af1d[_0x424273(0x1d4)][_0x424273(0x181)](_0x592686,{'dryRun':_0x595573,'force':_0x57e96c}));if(_0x595573)return console['log'](a4_0x5c10dc[_0x424273(0x133)](_0x424273(0x17a))),console[_0x424273(0x141)](_0x424273(0x1d6)+_0xa1cd49[_0x424273(0x12a)]),0x0;if(_0xa1cd49[_0x424273(0x19e)]===_0x424273(0x138))return console['log'](a4_0x5c10dc[_0x424273(0x1c7)]('Failed\x20to\x20push\x20agent:\x20'+_0xa1cd49[_0x424273(0x138)])),0x1;console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x148)](_0x424273(0x132)+_0xa1cd49[_0x424273(0x19e)]+_0x424273(0x16a))),console['log'](_0x424273(0x144)+_0xa1cd49[_0x424273(0x12a)]);if(_0xa1cd49[_0x424273(0x187)]&&_0xa1cd49[_0x424273(0x12c)]){const _0x5577ff=getLLMAgentChatUrl(_0x54ce39,_0xa1cd49[_0x424273(0x12c)],_0xa1cd49[_0x424273(0x187)]);console[_0x424273(0x141)]('Chat:\x20'+a4_0x5c10dc[_0x424273(0x16b)](_0x5577ff));}return 0x0;}const _0x561e18=_0x126740[_0x424273(0x142)],_0x45853d=resolveProjectFromContext(_0x592686,_0x561e18);if(_0x45853d['found'])_0x592686=_0x45853d[_0x424273(0x158)],_0x45853d[_0x424273(0x1ad)]===_0x424273(0x1d1)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x175)](_0x424273(0x174)+_0x592686));else{let _0x4abeb0=_0x424273(0x17d);_0x45853d[_0x424273(0x1cc)]===_0x424273(0x1d7)&&(_0x4abeb0=_0x45853d['message']+_0x424273(0x19c)+_0x45853d[_0x424273(0x142)]+_0x424273(0x1b9));throw new SDKError(ErrorCode[_0x424273(0x155)],_0x45853d[_0x424273(0x1cc)]==='no_context'?_0x45853d[_0x424273(0x1b3)]:_0x424273(0x13b)+_0x592686,undefined,{'helpText':_0x4abeb0});}const {data:_0x14f269}=await withSpinner(_0x424273(0x1be),()=>_0x30af1d['llm'][_0x424273(0x15a)](_0x592686,{'dryRun':!![]})),_0x217edd=_0x14f269['counts'][_0x424273(0x168)][_0x424273(0x178)]>0x0;if(_0x217edd){console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('\x0aErrors\x20found:'));for(const _0x31ac2a of _0x14f269[_0x424273(0x168)]){_0x31ac2a[_0x424273(0x19e)]===_0x424273(0x138)&&console['log'](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x1ba)+_0x31ac2a[_0x424273(0x12a)]+'\x22:\x20'+_0x31ac2a['error']));}return 0x1;}const _0x1d864e=_0x14f269['counts'][_0x424273(0x168)]['created']+_0x14f269[_0x424273(0x14f)]['knowledgeBases'][_0x424273(0x16d)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x137)][_0x424273(0x16d)]+_0x14f269[_0x424273(0x14f)]['prompts']['created']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b5)]['created']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x16d)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x182)]['created'],_0x2fb15e=_0x14f269[_0x424273(0x14f)][_0x424273(0x168)][_0x424273(0x13f)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x176)][_0x424273(0x13f)]+_0x14f269[_0x424273(0x14f)]['textKnowledgeBases']['updated']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1a4)]['updated']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b5)][_0x424273(0x13f)]+_0x14f269[_0x424273(0x14f)]['experimentalKnowledgeBases']['updated']+_0x14f269[_0x424273(0x14f)][_0x424273(0x182)]['updated'],_0x217908=_0x14f269['counts'][_0x424273(0x168)]['unchanged']+_0x14f269[_0x424273(0x14f)][_0x424273(0x176)]['unchanged']+_0x14f269[_0x424273(0x14f)][_0x424273(0x137)]['unchanged']+_0x14f269[_0x424273(0x14f)]['prompts'][_0x424273(0x1a5)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b5)][_0x424273(0x1a5)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x1a5)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x182)][_0x424273(0x1a5)];console[_0x424273(0x141)]('\x0aPush\x20summary\x20for\x20\x27'+_0x14f269[_0x424273(0x163)]+'\x27:'),console[_0x424273(0x141)]('\x20\x20'+a4_0x5c10dc[_0x424273(0x148)]('+\x20'+_0x1d864e+_0x424273(0x197))+_0x424273(0x17c)+a4_0x5c10dc[_0x424273(0x133)]('~\x20'+_0x2fb15e+'\x20changed')+_0x424273(0x17c)+a4_0x5c10dc[_0x424273(0x175)]('=\x20'+_0x217908+_0x424273(0x185))),console[_0x424273(0x141)](_0x424273(0x191)+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x168)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x176)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x137)])),console[_0x424273(0x141)](_0x424273(0x156)+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x1a4)])),console['log'](_0x424273(0x139)+formatCountSummary(_0x14f269[_0x424273(0x14f)]['integrations']));const _0x24bdaa=_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x16d)]>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x13f)]>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x1a5)]>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x182)][_0x424273(0x16d)]>0x0||_0x14f269['counts']['experimentalArtifacts']['updated']>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x182)][_0x424273(0x1a5)]>0x0;_0x24bdaa&&(console[_0x424273(0x141)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14f269[_0x424273(0x14f)]['experimentalKnowledgeBases'])),console[_0x424273(0x141)](_0x424273(0x1ca)+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x182)])));console['log'](_0x424273(0x15c)+a4_0x5c10dc[_0x424273(0x16b)](_0x592686)),displayDiffs(_0x14f269[_0x424273(0x168)],_0x14f269[_0x424273(0x176)],_0x14f269[_0x424273(0x137)],_0x14f269[_0x424273(0x1a4)],_0x14f269[_0x424273(0x1b5)],_0x14f269['experimentalKnowledgeBases'],_0x14f269['experimentalArtifacts']);if(_0x595573)return console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x133)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1d864e===0x0&&_0x2fb15e===0x0){console[_0x424273(0x141)](a4_0x5c10dc['green'](_0x424273(0x1b4)));const _0x3baf0a=getLLMProjectUrl(_0x54ce39,_0x14f269['projectId']);return console[_0x424273(0x141)](_0x424273(0x192)+a4_0x5c10dc[_0x424273(0x16b)](_0x3baf0a)),0x0;}if(!_0x331a3e&&!_0x57e96c){if(!isInteractive())return console['error'](a4_0x5c10dc[_0x424273(0x1c7)]('\x0aError:'),_0x424273(0x179)),console['error'](a4_0x5c10dc[_0x424273(0x175)](_0x424273(0x1cd))),0x1;const _0x5226d0=await confirmKey(_0x424273(0x18c)+(_0x1d864e+_0x2fb15e)+_0x424273(0x1a2));if(!_0x5226d0)return console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x133)](_0x424273(0x1ae)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x20cba4}=await withSpinner(_0x424273(0x171),()=>_0x30af1d['llm'][_0x424273(0x15a)](_0x592686,{'force':_0x57e96c})),_0x1dda06=_0x20cba4[_0x424273(0x14f)][_0x424273(0x168)][_0x424273(0x178)]>0x0||_0x20cba4[_0x424273(0x14f)][_0x424273(0x176)][_0x424273(0x178)]>0x0||_0x20cba4[_0x424273(0x14f)][_0x424273(0x137)][_0x424273(0x178)]>0x0||_0x20cba4[_0x424273(0x14f)]['prompts'][_0x424273(0x178)]>0x0;if(_0x1dda06){console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x133)](_0x424273(0x12d))),console[_0x424273(0x141)](),console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('Errors:'));for(const _0x311c5b of _0x20cba4[_0x424273(0x168)]){_0x311c5b[_0x424273(0x19e)]===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('\x20\x20Agent\x20\x22'+_0x311c5b[_0x424273(0x12a)]+_0x424273(0x123)+_0x311c5b[_0x424273(0x138)]));}for(const _0x8e39dd of _0x20cba4[_0x424273(0x176)]){_0x8e39dd[_0x424273(0x19e)]==='error'&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x124)+_0x8e39dd[_0x424273(0x14e)]+_0x424273(0x123)+_0x8e39dd[_0x424273(0x138)]));}for(const _0xac6764 of _0x20cba4[_0x424273(0x137)]){_0xac6764[_0x424273(0x19e)]===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x153)+_0xac6764['name']+_0x424273(0x123)+_0xac6764[_0x424273(0x138)]));}for(const _0x2dfde6 of _0x20cba4[_0x424273(0x1a4)]){_0x2dfde6[_0x424273(0x19e)]===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('\x20\x20Prompt\x20\x22'+_0x2dfde6[_0x424273(0x14e)]+_0x424273(0x123)+_0x2dfde6['error']));}for(const _0x1cbd65 of _0x20cba4[_0x424273(0x1b5)]){_0x1cbd65['action']===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x164)+_0x1cbd65[_0x424273(0x14e)]+_0x424273(0x123)+_0x1cbd65['error']));}return 0x1;}console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x148)](_0x424273(0x1a7)+(_0x1d864e+_0x2fb15e)+'\x20resources\x20to\x20\x27'+_0x20cba4[_0x424273(0x163)]+'\x27'));const _0x488e02=getLLMProjectUrl(_0x54ce39,_0x20cba4[_0x424273(0x12c)]);return console['log'](_0x424273(0x192)+a4_0x5c10dc[_0x424273(0x16b)](_0x488e02)),0x0;}}
|
|
1
|
+
const a4_0x19fb4f=a4_0x5d0b;(function(_0x3671b6,_0xc55ed4){const _0x1e3596=a4_0x5d0b,_0x4007b1=_0x3671b6();while(!![]){try{const _0x388f09=-parseInt(_0x1e3596(0xae))/0x1+-parseInt(_0x1e3596(0xfe))/0x2+-parseInt(_0x1e3596(0xe6))/0x3+parseInt(_0x1e3596(0xab))/0x4+parseInt(_0x1e3596(0xbc))/0x5*(-parseInt(_0x1e3596(0x10e))/0x6)+-parseInt(_0x1e3596(0x99))/0x7+parseInt(_0x1e3596(0xc8))/0x8;if(_0x388f09===_0xc55ed4)break;else _0x4007b1['push'](_0x4007b1['shift']());}catch(_0x4973aa){_0x4007b1['push'](_0x4007b1['shift']());}}}(a4_0x5baa,0xa04b5));import a4_0x5db7f6 from'chalk';import a4_0x49b9cd from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x5baa(){const _0x4f555d=['join','dirname','source','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20unchanged','No\x20tdx.json\x20found\x20in\x20','Cloning\x20\x22','INVALID_ARGUMENT','\x0a✔\x20Pushed\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Project\x20cloned\x20successfully','<new-name>','\x20\x20Prompt\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20total','sourceProjectName','Project\x20cloned\x20with\x20errors','log','agentName','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aError:','dryRun','newProjectName','cwd','counts','3640147PNlpLW','New\x20project\x20ID:\x20','Clone\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','\x20created','\x20\x20Prompts:\x20','\x20resources\x20to\x20\x27','\x0aPush\x20summary\x20for\x20\x27','\x20--name\x20','execute','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','Analyzing\x20project\x20\x22','New\x20project:\x20','\x20errors','-\x20nothing\x20pushed','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Output\x20path:\x20','4090632dmyQqa','llmProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','72445doPepN','\x20\x20Integrations:\x20','\x20successfully','error','created','unchanged','\x20\x20Experimental\x20Artifacts:\x20','prompts','experimentalKnowledgeBases','Errors:','✔\x20Context\x20set:\x20','action','green','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','431315BsmAdm','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent:clone','yes','Using\x20context\x20project:\x20','parse','push','Pushing\x20to\x20project...','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20files\x20to\x20','pushAgent','reason','14990160SUxcfg','projectId','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)','\x0aProject\x20pushed\x20with\x20errors','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Agent:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','yellow','\x0aChanges:','\x20updated','agents','integrations','site','Source:\x20','New\x20project\x20name\x20is\x20required','repeat','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','llm_project','\x20files?','\x20\x20Source:\x20','newProjectId','updated','utf-8','textKnowledgeBases','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','outputPath','\x0aChanges\x20to\x20prompt\x20\x27','\x20--profile\x20','2909949dWtLGW','arg-dir','agent:pull','agent','agent:push','\x20changed','name','\x20\x20Target:\x20','\x0aPush\x20','Summary:','\x22\x20to\x20\x22','message','\x0aChanges\x20to\x20integration\x20\x27','Pulling\x20agent\x20\x22','pullProject','projectName','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','context','llm','pullAgent','found','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Chat:\x20','1182302zDehOa','\x20new','\x20\x20Integration\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x22:\x20','cloneProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Experimental\x20Artifact\x20\x22','isNew','\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','new','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','total','diff','cyan','\x20\x20Agents:\x20','6pHPrpE','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','dim','Project:\x20','Using\x20local\x20project:\x20','Writing\x20files...','projectDir','red','Would\x20clone:','\x0a✔\x20Pulled\x20','Agent\x20pulled\x20successfully','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','knowledgeBases','outputDir','Using\x20project:\x20','profile','\x20\x20Agent\x20\x22','agent.yml','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','experimentalArtifacts','description','tdx.json','hasChanges','Cancelled','force','agentId','pushProject','\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\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)','Analyzing\x20changes\x20to\x20push...','errors','\x20|\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20Knowledge\x20Bases:\x20','Dry\x20run\x20-\x20no\x20files\x20written','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x22...','\x20=\x20','Dry\x20run\x20-\x20no\x20changes\x20made','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'];a4_0x5baa=function(){return _0x4f555d;};return a4_0x5baa();}function a4_0x5d0b(_0x5b037e,_0x155f4f){_0x5b037e=_0x5b037e-0x8e;const _0x5baaf8=a4_0x5baa();let _0x5d0b56=_0x5baaf8[_0x5b037e];return _0x5d0b56;}function formatCountSummary(_0x1f4e46){const _0x47e8c2=a4_0x5d0b,_0xbbe90d=[];if(_0x1f4e46['total']!==undefined)_0xbbe90d['push'](_0x1f4e46[_0x47e8c2(0x10a)]+_0x47e8c2(0x8e));if(_0x1f4e46[_0x47e8c2(0x108)]!==undefined&&_0x1f4e46[_0x47e8c2(0x108)]>0x0)_0xbbe90d['push'](a4_0x5db7f6[_0x47e8c2(0xba)](_0x1f4e46['new']+_0x47e8c2(0xff)));if(_0x1f4e46[_0x47e8c2(0xb2)]!==undefined&&_0x1f4e46[_0x47e8c2(0xb2)]>0x0)_0xbbe90d[_0x47e8c2(0xc2)](a4_0x5db7f6['green'](_0x1f4e46[_0x47e8c2(0xb2)]+_0x47e8c2(0x9d)));if(_0x1f4e46['updated']!==undefined&&_0x1f4e46[_0x47e8c2(0xdf)]>0x0)_0xbbe90d[_0x47e8c2(0xc2)](a4_0x5db7f6[_0x47e8c2(0xd0)](_0x1f4e46[_0x47e8c2(0xdf)]+_0x47e8c2(0xd2)));if(_0x1f4e46['unchanged']!==undefined&&_0x1f4e46[_0x47e8c2(0xb3)]>0x0)_0xbbe90d['push'](a4_0x5db7f6['gray'](_0x1f4e46['unchanged']+_0x47e8c2(0x13c)));if(_0x1f4e46['errors']!==undefined&&_0x1f4e46[_0x47e8c2(0x12d)]>0x0)_0xbbe90d[_0x47e8c2(0xc2)](a4_0x5db7f6[_0x47e8c2(0x115)](_0x1f4e46[_0x47e8c2(0x12d)]+_0x47e8c2(0xa7)));return _0xbbe90d[_0x47e8c2(0x138)](',\x20');}function displayDiffs(_0x16209f,_0x5d5363,_0x3b2804,_0x59ee5d,_0x776c2f,_0x3d0852,_0x2cb773){const _0x103e15=a4_0x5d0b;for(const _0x396d53 of _0x16209f){if(_0x396d53[_0x103e15(0x10b)]){const _0x5b25a0=_0x396d53[_0x103e15(0x92)]||_0x396d53[_0x103e15(0xec)];console[_0x103e15(0x91)](_0x103e15(0xa4)+_0x5b25a0+'\x27:'),console[_0x103e15(0x91)]('─'['repeat'](0x3c)),console[_0x103e15(0x91)](_0x396d53['diff']),console[_0x103e15(0x91)]('─'['repeat'](0x3c));}}for(const _0x210559 of _0x5d5363){_0x210559[_0x103e15(0x10b)]&&(console[_0x103e15(0x91)](_0x103e15(0x142)+_0x210559[_0x103e15(0xec)]+'\x27:'),console[_0x103e15(0x91)]('─'[_0x103e15(0xd8)](0x3c)),console[_0x103e15(0x91)](_0x210559[_0x103e15(0x10b)]),console['log']('─'['repeat'](0x3c)));}for(const _0xf26521 of _0x3b2804){_0xf26521[_0x103e15(0x10b)]&&(console[_0x103e15(0x91)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0xf26521['name']+'\x27:'),console[_0x103e15(0x91)]('─'[_0x103e15(0xd8)](0x3c)),console[_0x103e15(0x91)](_0xf26521[_0x103e15(0x10b)]),console[_0x103e15(0x91)]('─'[_0x103e15(0xd8)](0x3c)));}for(const _0x21adcf of _0x59ee5d){_0x21adcf[_0x103e15(0x10b)]&&(console['log'](_0x103e15(0xe4)+_0x21adcf['name']+'\x27:'),console[_0x103e15(0x91)]('─'['repeat'](0x3c)),console['log'](_0x21adcf[_0x103e15(0x10b)]),console[_0x103e15(0x91)]('─'['repeat'](0x3c)));}for(const _0x8e0dfd of _0x776c2f){_0x8e0dfd[_0x103e15(0x10b)]&&(console[_0x103e15(0x91)](_0x103e15(0xf2)+_0x8e0dfd[_0x103e15(0xec)]+'\x27:'),console[_0x103e15(0x91)]('─'['repeat'](0x3c)),console['log'](_0x8e0dfd[_0x103e15(0x10b)]),console['log']('─'['repeat'](0x3c)));}for(const _0x5989a4 of _0x3d0852){_0x5989a4[_0x103e15(0x10b)]&&(console['log'](_0x103e15(0x13b)+_0x5989a4[_0x103e15(0xec)]+'\x27:'),console['log']('─'[_0x103e15(0xd8)](0x3c)),console[_0x103e15(0x91)](_0x5989a4['diff']),console[_0x103e15(0x91)]('─'[_0x103e15(0xd8)](0x3c)));}for(const _0x29eb55 of _0x2cb773){_0x29eb55[_0x103e15(0x10b)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x29eb55[_0x103e15(0xec)]+'\x27:'),console[_0x103e15(0x91)]('─'[_0x103e15(0xd8)](0x3c)),console[_0x103e15(0x91)](_0x29eb55[_0x103e15(0x10b)]),console['log']('─'[_0x103e15(0xd8)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x19fb4f(0xec)]=a4_0x19fb4f(0xe8);[a4_0x19fb4f(0x123)]=a4_0x19fb4f(0x143);async[a4_0x19fb4f(0xa2)](_0x354221){const _0x285be6=a4_0x19fb4f,{options:_0x2456cb,args:_0x5e3f02,tdx:_0x35a874}=_0x354221,_0x6c7cf6=_0x5e3f02[0x0],_0x5b789f=_0x5e3f02[0x1],_0x293a97=_0x2456cb['output'],_0x437833=_0x2456cb[_0x285be6(0x95)],_0x91219b=_0x2456cb[_0x285be6(0x127)],_0x6807f6=_0x2456cb[_0x285be6(0xbf)],_0x4aa898=_0x2456cb['llmProject'],_0x2ed4df=_0x2456cb[_0x285be6(0xe9)];let _0x380d1d;if(_0x6c7cf6){const _0x377b93=a4_0x49b9cd[_0x285be6(0x138)](_0x6c7cf6,_0x285be6(0x124));if(existsSync(_0x377b93))try{const _0x233340=JSON[_0x285be6(0xc1)](readFileSync(_0x377b93,_0x285be6(0xe0)));_0x233340[_0x285be6(0xdb)]&&(_0x380d1d={'llm_project':_0x233340[_0x285be6(0xdb)]});}catch{}}const _0x5089f2=findAgentConfigPath(process[_0x285be6(0x97)]());let _0x3cb896;if(_0x5089f2)try{const _0x17b1fa=JSON[_0x285be6(0xc1)](readFileSync(_0x5089f2,_0x285be6(0xe0)));_0x17b1fa[_0x285be6(0xdb)]&&(_0x3cb896={'llm_project':_0x17b1fa[_0x285be6(0xdb)]});}catch{}const _0x2f4931=resolveAgentPullArgs({'arg':_0x6c7cf6,'agentNameArg':_0x5b789f,'agentFlag':_0x2ed4df,'contextProject':_0x4aa898,'argDirConfig':_0x380d1d,'cwdConfigPath':_0x5089f2||undefined,'cwdConfig':_0x3cb896}),{projectNameOrId:_0x683607,targetAgentName:_0x1fe437,existingOutputDir:_0x2a8cc0,source:_0x38268c}=_0x2f4931;if(_0x38268c===_0x285be6(0xe7))console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0x110)]('Using\x20project\x20from\x20'+a4_0x49b9cd[_0x285be6(0x138)](_0x6c7cf6,_0x285be6(0x124))+':\x20'+_0x683607));else{if(_0x38268c==='cwd-config')console[_0x285be6(0x91)](a4_0x5db7f6['dim']('Using\x20project:\x20'+_0x683607));else _0x38268c===_0x285be6(0xf8)&&console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0x110)]('Using\x20project\x20from\x20context:\x20'+_0x683607));}if(!_0x683607)return _0x2ed4df?(console['log'](a4_0x5db7f6[_0x285be6(0xd0)](_0x285be6(0xcd))),console[_0x285be6(0x91)](_0x285be6(0x141)),console[_0x285be6(0x91)](_0x285be6(0xfc))):(console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xd0)](_0x285be6(0xcc))),console[_0x285be6(0x91)](_0x285be6(0xca)),console[_0x285be6(0x91)](_0x285be6(0x104)),console[_0x285be6(0x91)](_0x285be6(0x107)),console[_0x285be6(0x91)]('\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[_0x285be6(0x91)](_0x285be6(0x12a))),0x1;if(_0x1fe437){const {data:_0x4f8601}=await withSpinner(_0x285be6(0xf3)+_0x1fe437+'\x22\x20from\x20project\x20\x22'+_0x683607+'\x22...',()=>_0x35a874[_0x285be6(0xf9)][_0x285be6(0xfa)](_0x683607,_0x1fe437,_0x293a97,{'dryRun':_0x437833,'force':_0x91219b}));if(_0x437833)return console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xd0)](_0x285be6(0x132))),console['log'](_0x285be6(0xa3)+_0x4f8601[_0x285be6(0x92)]),console[_0x285be6(0x91)](_0x285be6(0xaa)+_0x4f8601[_0x285be6(0xe3)]),_0x4f8601['diff']&&(console[_0x285be6(0x91)](_0x285be6(0xd1)),console[_0x285be6(0x91)]('─'[_0x285be6(0xd8)](0x3c)),console['log'](_0x4f8601[_0x285be6(0x10b)]),console[_0x285be6(0x91)]('─'[_0x285be6(0xd8)](0x3c))),0x0;return console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xba)](_0x285be6(0x118))),console['log'](_0x285be6(0xce)+_0x4f8601[_0x285be6(0x92)]),console[_0x285be6(0x91)]('Output:\x20'+_0x4f8601['outputPath']),console[_0x285be6(0x91)]('Status:\x20'+(_0x4f8601[_0x285be6(0x106)]?a4_0x5db7f6[_0x285be6(0xba)]('new'):_0x4f8601[_0x285be6(0x125)]?a4_0x5db7f6['yellow'](_0x285be6(0xdf)):a4_0x5db7f6['gray'](_0x285be6(0xb3)))),0x0;}const _0x168149=_0x2a8cc0||_0x293a97,{data:_0x3bd9cb}=await withSpinner(_0x285be6(0xa5)+_0x683607+_0x285be6(0x134),()=>_0x35a874['llm'][_0x285be6(0xf4)](_0x683607,_0x168149,{'dryRun':!![]})),_0x1aab1b=_0x3bd9cb[_0x285be6(0x98)]['agents'][_0x285be6(0x108)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0x11a)][_0x285be6(0x108)]+_0x3bd9cb[_0x285be6(0x98)]['textKnowledgeBases']['new']+_0x3bd9cb['counts'][_0x285be6(0xb5)][_0x285be6(0x108)]+_0x3bd9cb[_0x285be6(0x98)]['integrations'][_0x285be6(0x108)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xb6)][_0x285be6(0x108)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0x122)][_0x285be6(0x108)],_0xa01e74=_0x3bd9cb[_0x285be6(0x98)]['agents'][_0x285be6(0xdf)]+_0x3bd9cb[_0x285be6(0x98)]['knowledgeBases'][_0x285be6(0xdf)]+_0x3bd9cb['counts'][_0x285be6(0xe1)][_0x285be6(0xdf)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xb5)][_0x285be6(0xdf)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xd4)][_0x285be6(0xdf)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xb6)][_0x285be6(0xdf)]+_0x3bd9cb['counts'][_0x285be6(0x122)][_0x285be6(0xdf)],_0x45718e=_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xd3)][_0x285be6(0xb3)]+_0x3bd9cb['counts'][_0x285be6(0x11a)]['unchanged']+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xe1)][_0x285be6(0xb3)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xb5)]['unchanged']+_0x3bd9cb['counts']['integrations'][_0x285be6(0xb3)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xb6)][_0x285be6(0xb3)]+_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0x122)][_0x285be6(0xb3)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x3bd9cb[_0x285be6(0xf5)]+'\x27:'),console[_0x285be6(0x91)]('\x20\x20'+a4_0x5db7f6[_0x285be6(0xba)]('+\x20'+_0x1aab1b+_0x285be6(0xff))+_0x285be6(0x12e)+a4_0x5db7f6['yellow']('~\x20'+_0xa01e74+_0x285be6(0xeb))+_0x285be6(0x12e)+a4_0x5db7f6[_0x285be6(0x110)]('=\x20'+_0x45718e+'\x20unchanged')),console[_0x285be6(0x91)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xd3)])),console[_0x285be6(0x91)](_0x285be6(0x131)+formatCountSummary(_0x3bd9cb['counts'][_0x285be6(0x11a)])),console[_0x285be6(0x91)](_0x285be6(0xf7)+formatCountSummary(_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xe1)])),console[_0x285be6(0x91)](_0x285be6(0x9e)+formatCountSummary(_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xb5)])),console['log'](_0x285be6(0xaf)+formatCountSummary(_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xd4)]));const _0x384ab8=_0x3bd9cb[_0x285be6(0x98)]['experimentalKnowledgeBases'][_0x285be6(0x10a)]>0x0||_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0x122)][_0x285be6(0x10a)]>0x0;_0x384ab8&&(console['log'](_0x285be6(0x101)+formatCountSummary(_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0xb6)])),console[_0x285be6(0x91)](_0x285be6(0xb4)+formatCountSummary(_0x3bd9cb[_0x285be6(0x98)][_0x285be6(0x122)])));console[_0x285be6(0x91)](_0x285be6(0xed)+a4_0x5db7f6[_0x285be6(0x10c)](_0x3bd9cb[_0x285be6(0x11b)])),displayDiffs(_0x3bd9cb['agents'],_0x3bd9cb[_0x285be6(0x11a)],_0x3bd9cb[_0x285be6(0xe1)],_0x3bd9cb[_0x285be6(0xb5)],_0x3bd9cb[_0x285be6(0xd4)],_0x3bd9cb[_0x285be6(0xb6)],_0x3bd9cb[_0x285be6(0x122)]);if(_0x437833)return console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xd0)](_0x285be6(0x121))),0x0;if(_0x1aab1b===0x0&&_0xa01e74===0x0)return console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xba)](_0x285be6(0x109))),saveSessionContext({'llm_project':_0x3bd9cb[_0x285be6(0xf5)]},_0x2456cb['session']),console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xba)](_0x285be6(0xb8)+a4_0x5db7f6[_0x285be6(0x110)](_0x285be6(0xdb))+_0x285be6(0x135)+a4_0x5db7f6[_0x285be6(0x10c)](_0x3bd9cb[_0x285be6(0xf5)]))),0x0;if(!_0x6807f6&&!_0x91219b){if(!isInteractive())return console[_0x285be6(0xb1)](a4_0x5db7f6[_0x285be6(0x115)](_0x285be6(0x94)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x285be6(0xb1)](a4_0x5db7f6['dim'](_0x285be6(0x147))),0x1;const _0x250553=await confirmKey('\x0aWrite\x20'+(_0x1aab1b+_0xa01e74)+_0x285be6(0xdc));if(!_0x250553)return console[_0x285be6(0x91)](a4_0x5db7f6['yellow']('Cancelled'),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1f2bf3}=await withSpinner(_0x285be6(0x113),()=>_0x35a874[_0x285be6(0xf9)][_0x285be6(0xf4)](_0x683607,_0x168149,{'force':_0x91219b}));return console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xba)](_0x285be6(0x117)+(_0x1aab1b+_0xa01e74)+_0x285be6(0xc5)+_0x1f2bf3[_0x285be6(0x11b)])),saveSessionContext({'llm_project':_0x1f2bf3[_0x285be6(0xf5)]},_0x2456cb['session']),console[_0x285be6(0x91)](a4_0x5db7f6[_0x285be6(0xba)](_0x285be6(0xb8)+a4_0x5db7f6[_0x285be6(0x110)](_0x285be6(0xdb))+'\x20=\x20'+a4_0x5db7f6['cyan'](_0x1f2bf3[_0x285be6(0xf5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x19fb4f(0xec)]=a4_0x19fb4f(0xbe);[a4_0x19fb4f(0x123)]=a4_0x19fb4f(0xbb);async[a4_0x19fb4f(0xa2)](_0x2b778c){const _0x3c899b=a4_0x19fb4f,{options:_0x5d51b4,args:_0x1895fc,tdx:_0x1bfb07}=_0x2b778c,_0x4b49bf=_0x1895fc[0x0],_0x49f555=_0x5d51b4['name'],_0x571fcd=_0x5d51b4[_0x3c899b(0x95)],_0x5cdf13=_0x5d51b4[_0x3c899b(0xbf)],_0x3a763b=_0x5d51b4[_0x3c899b(0xd5)],_0x2ff1fc=_0x5d51b4[_0x3c899b(0xac)];let _0x21bbe7;const _0x579bdd=findAgentConfigPath(process[_0x3c899b(0x97)]());if(_0x4b49bf){const _0x25bad0=a4_0x49b9cd[_0x3c899b(0x138)](_0x4b49bf,_0x3c899b(0x124));existsSync(_0x25bad0)?(_0x21bbe7=_0x4b49bf,console['log'](a4_0x5db7f6['dim'](_0x3c899b(0x112)+_0x4b49bf))):_0x21bbe7=_0x4b49bf;}else{if(_0x579bdd)_0x21bbe7=a4_0x49b9cd['dirname'](_0x579bdd),console['log'](a4_0x5db7f6['dim']('Using\x20current\x20project:\x20'+_0x21bbe7));else{if(_0x2ff1fc){const _0x4a9384=sanitizeForFilesystem(_0x2ff1fc);let _0x5197f0=_0x4a9384,_0x4546e2=a4_0x49b9cd['join'](process['cwd'](),_0x3c899b(0xd3),_0x4a9384,_0x3c899b(0x124));if(!existsSync(_0x4546e2)){const _0x583d33=normalizeName(_0x2ff1fc),_0x4af844=a4_0x49b9cd[_0x3c899b(0x138)](process[_0x3c899b(0x97)](),_0x3c899b(0xd3),_0x583d33,_0x3c899b(0x124));existsSync(_0x4af844)&&(_0x5197f0=_0x583d33,_0x4546e2=_0x4af844);}if(existsSync(_0x4546e2))_0x21bbe7=a4_0x49b9cd[_0x3c899b(0x139)](_0x4546e2),console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0x110)](_0x3c899b(0x112)+_0x21bbe7));else{const _0x4715e7=_0x5d51b4[_0x3c899b(0x11d)];if(_0x4715e7)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3c899b(0x120)+_0x2ff1fc+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x3c899b(0xcf)+_0x3c899b(0xd9)+(_0x3c899b(0x9c)+_0x2ff1fc+'\x0a')+(_0x3c899b(0x130)+_0x5197f0+_0x3c899b(0xa1)+(_0x49f555||_0x3c899b(0x145))+_0x3c899b(0xe5)+_0x4715e7)});_0x21bbe7=_0x2ff1fc,console['log'](a4_0x5db7f6[_0x3c899b(0x110)](_0x3c899b(0xc0)+_0x2ff1fc));}}}}if(!_0x21bbe7)return console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0xd0)](_0x3c899b(0x133))),console[_0x3c899b(0x91)](_0x3c899b(0xc4)),console[_0x3c899b(0x91)](_0x3c899b(0xda)),console[_0x3c899b(0x91)](_0x3c899b(0x12b)),console[_0x3c899b(0x91)](_0x3c899b(0xe2)),0x1;if(!_0x49f555)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x3c899b(0xd7),undefined,{'helpText':_0x3c899b(0x93)});if(!_0x5cdf13&&!_0x571fcd){if(!isInteractive())return console[_0x3c899b(0xb1)](a4_0x5db7f6[_0x3c899b(0x115)](_0x3c899b(0x94)),_0x3c899b(0x137)),console[_0x3c899b(0xb1)](a4_0x5db7f6[_0x3c899b(0x110)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x69e42c=await confirmKey(_0x3c899b(0x9b)+_0x21bbe7+_0x3c899b(0xf6)+_0x49f555+'\x22?');if(!_0x69e42c)return console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0xd0)](_0x3c899b(0x126))),0x1;}const {data:_0x20a57f}=await withSpinner(_0x3c899b(0x13e)+_0x21bbe7+_0x3c899b(0xf0)+_0x49f555+_0x3c899b(0x134),()=>_0x1bfb07[_0x3c899b(0xf9)][_0x3c899b(0x103)](_0x21bbe7,_0x49f555,{'dryRun':_0x571fcd}));if(_0x571fcd){console[_0x3c899b(0x91)](a4_0x5db7f6['yellow'](_0x3c899b(0x136))),console[_0x3c899b(0x91)]('Source:\x20'+_0x20a57f[_0x3c899b(0x8f)]),console[_0x3c899b(0x91)](_0x3c899b(0xa6)+_0x49f555),console[_0x3c899b(0x91)](_0x3c899b(0x116)),console['log'](_0x3c899b(0x10d)+_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xd3)]['created']),console[_0x3c899b(0x91)](_0x3c899b(0x131)+_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0x11a)][_0x3c899b(0xb2)]),console[_0x3c899b(0x91)]('\x20\x20Prompts:\x20'+_0x20a57f['counts'][_0x3c899b(0xb5)][_0x3c899b(0xb2)]);const _0x5369b2=_0x20a57f[_0x3c899b(0x98)]['experimentalKnowledgeBases'][_0x3c899b(0xb2)]>0x0||_0x20a57f['counts'][_0x3c899b(0x122)][_0x3c899b(0xb2)]>0x0;return _0x5369b2&&(console[_0x3c899b(0x91)](_0x3c899b(0x101)+_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xb6)][_0x3c899b(0xb2)]),console[_0x3c899b(0x91)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0x122)][_0x3c899b(0xb2)])),0x0;}const _0x391acb=_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xd3)][_0x3c899b(0x12d)]>0x0||_0x20a57f[_0x3c899b(0x98)]['knowledgeBases'][_0x3c899b(0x12d)]>0x0||_0x20a57f['counts'][_0x3c899b(0xb5)][_0x3c899b(0x12d)]>0x0||_0x20a57f['counts'][_0x3c899b(0xb6)][_0x3c899b(0x12d)]>0x0||_0x20a57f['counts'][_0x3c899b(0x122)][_0x3c899b(0x12d)]>0x0;_0x391acb?console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0xd0)](_0x3c899b(0x90))):console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0xba)](_0x3c899b(0x144)));console[_0x3c899b(0x91)](_0x3c899b(0xd6)+_0x20a57f['sourceProjectName']),console[_0x3c899b(0x91)](_0x3c899b(0xa6)+_0x20a57f[_0x3c899b(0x96)]),console['log'](_0x3c899b(0x9a)+_0x20a57f[_0x3c899b(0xde)]),console['log'](),console['log'](_0x3c899b(0xef)),console[_0x3c899b(0x91)](_0x3c899b(0x10d)+formatCountSummary(_0x20a57f[_0x3c899b(0x98)]['agents'])),console[_0x3c899b(0x91)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x20a57f['counts'][_0x3c899b(0x11a)])),console['log'](_0x3c899b(0x9e)+formatCountSummary(_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xb5)])),console[_0x3c899b(0x91)](_0x3c899b(0xaf)+formatCountSummary(_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xd4)]));const _0x58a019=_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xb6)][_0x3c899b(0xb2)]>0x0||_0x20a57f['counts'][_0x3c899b(0xb6)][_0x3c899b(0xdf)]>0x0||_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xb6)][_0x3c899b(0xb3)]>0x0||_0x20a57f['counts']['experimentalArtifacts'][_0x3c899b(0xb2)]>0x0||_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0x122)][_0x3c899b(0xdf)]>0x0||_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0x122)][_0x3c899b(0xb3)]>0x0;_0x58a019&&(console[_0x3c899b(0x91)](_0x3c899b(0x101)+formatCountSummary(_0x20a57f[_0x3c899b(0x98)][_0x3c899b(0xb6)])),console[_0x3c899b(0x91)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x20a57f[_0x3c899b(0x98)]['experimentalArtifacts'])));if(_0x391acb){console[_0x3c899b(0x91)](),console[_0x3c899b(0x91)](a4_0x5db7f6['red'](_0x3c899b(0xb7)));for(const _0xcdce28 of _0x20a57f[_0x3c899b(0xd3)]){_0xcdce28[_0x3c899b(0xb9)]===_0x3c899b(0xb1)&&console[_0x3c899b(0x91)](a4_0x5db7f6['red'](_0x3c899b(0x11e)+_0xcdce28[_0x3c899b(0x92)]+_0x3c899b(0x102)+_0xcdce28[_0x3c899b(0xb1)]));}for(const _0x1c2fda of _0x20a57f[_0x3c899b(0x11a)]){_0x1c2fda[_0x3c899b(0xb9)]==='error'&&console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0x115)](_0x3c899b(0x12f)+_0x1c2fda[_0x3c899b(0xec)]+'\x22:\x20'+_0x1c2fda[_0x3c899b(0xb1)]));}for(const _0x2939fb of _0x20a57f[_0x3c899b(0xb5)]){_0x2939fb[_0x3c899b(0xb9)]===_0x3c899b(0xb1)&&console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0x115)]('\x20\x20Prompt\x20\x22'+_0x2939fb['name']+_0x3c899b(0x102)+_0x2939fb[_0x3c899b(0xb1)]));}for(const _0x17eab4 of _0x20a57f['integrations']){_0x17eab4[_0x3c899b(0xb9)]==='error'&&console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0x115)](_0x3c899b(0x100)+_0x17eab4['name']+_0x3c899b(0x102)+_0x17eab4['error']));}for(const _0x3ea1b2 of _0x20a57f[_0x3c899b(0xb6)]){_0x3ea1b2['action']===_0x3c899b(0xb1)&&console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0x115)](_0x3c899b(0xbd)+_0x3ea1b2[_0x3c899b(0xec)]+_0x3c899b(0x102)+_0x3ea1b2[_0x3c899b(0xb1)]));}for(const _0x2a9c79 of _0x20a57f['experimentalArtifacts']){_0x2a9c79[_0x3c899b(0xb9)]===_0x3c899b(0xb1)&&console[_0x3c899b(0x91)](a4_0x5db7f6[_0x3c899b(0x115)](_0x3c899b(0x105)+_0x2a9c79[_0x3c899b(0xec)]+_0x3c899b(0x102)+_0x2a9c79['error']));}return 0x1;}console[_0x3c899b(0x91)]();const _0x50ca95=getLLMProjectUrl(_0x3a763b,_0x20a57f[_0x3c899b(0xde)]);return console[_0x3c899b(0x91)](_0x3c899b(0x111)+a4_0x5db7f6[_0x3c899b(0x10c)](_0x50ca95)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x19fb4f(0xec)]=a4_0x19fb4f(0xea);[a4_0x19fb4f(0x123)]=a4_0x19fb4f(0x148);async[a4_0x19fb4f(0xa2)](_0x65dca8){const _0x54ed26=a4_0x19fb4f,{options:_0x2c08bc,args:_0x402aef,tdx:_0x24e4eb}=_0x65dca8;let _0x39b894=_0x402aef[0x0]||process[_0x54ed26(0x97)]();const _0x107bb6=_0x2c08bc[_0x54ed26(0x95)],_0x331e32=_0x2c08bc[_0x54ed26(0x127)],_0x43b2ec=_0x2c08bc[_0x54ed26(0xbf)],_0x3a785f=_0x2c08bc['site'],_0x556695=a4_0x49b9cd[_0x54ed26(0x138)](_0x39b894,_0x54ed26(0x11f)),_0x2949b6=existsSync(_0x556695);if(_0x2949b6){const {data:_0x33570f}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x39b894+_0x54ed26(0x134),()=>_0x24e4eb[_0x54ed26(0xf9)][_0x54ed26(0xc6)](_0x39b894,{'dryRun':_0x107bb6,'force':_0x331e32}));if(_0x107bb6)return console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0xd0)](_0x54ed26(0x136))),console['log']('Would\x20push\x20agent:\x20'+_0x33570f[_0x54ed26(0x92)]),0x0;if(_0x33570f[_0x54ed26(0xb9)]===_0x54ed26(0xb1))return console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0x115)]('Failed\x20to\x20push\x20agent:\x20'+_0x33570f[_0x54ed26(0xb1)])),0x1;console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0xba)]('Agent\x20'+_0x33570f[_0x54ed26(0xb9)]+_0x54ed26(0xb0))),console[_0x54ed26(0x91)](_0x54ed26(0xce)+_0x33570f[_0x54ed26(0x92)]);if(_0x33570f[_0x54ed26(0x128)]&&_0x33570f['projectId']){const _0x4f0ec0=getLLMAgentChatUrl(_0x3a785f,_0x33570f['projectId'],_0x33570f[_0x54ed26(0x128)]);console['log'](_0x54ed26(0xfd)+a4_0x5db7f6[_0x54ed26(0x10c)](_0x4f0ec0));}return 0x0;}const _0x3f0bd6=_0x2c08bc[_0x54ed26(0xac)],_0x14911a=resolveProjectFromContext(_0x39b894,_0x3f0bd6);if(_0x14911a[_0x54ed26(0xfb)])_0x39b894=_0x14911a[_0x54ed26(0x114)],_0x14911a[_0x54ed26(0x13a)]===_0x54ed26(0xf8)&&console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0x110)](_0x54ed26(0x11c)+_0x39b894));else{let _0x4fd922=_0x54ed26(0x119);_0x14911a[_0x54ed26(0xc7)]==='no_local_folder'&&(_0x4fd922=_0x14911a[_0x54ed26(0xf1)]+_0x54ed26(0x10f)+_0x14911a['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x54ed26(0x13f)],_0x14911a['reason']==='no_context'?_0x14911a[_0x54ed26(0xf1)]:_0x54ed26(0x13d)+_0x39b894,undefined,{'helpText':_0x4fd922});}const {data:_0x3fadaf}=await withSpinner(_0x54ed26(0x12c),()=>_0x24e4eb[_0x54ed26(0xf9)][_0x54ed26(0x129)](_0x39b894,{'dryRun':!![]})),_0x41a2e3=_0x3fadaf['counts'][_0x54ed26(0xd3)][_0x54ed26(0x12d)]>0x0;if(_0x41a2e3){console[_0x54ed26(0x91)](a4_0x5db7f6['red']('\x0aErrors\x20found:'));for(const _0x14fd07 of _0x3fadaf['agents']){_0x14fd07['action']===_0x54ed26(0xb1)&&console[_0x54ed26(0x91)](a4_0x5db7f6['red'](_0x54ed26(0x11e)+_0x14fd07[_0x54ed26(0x92)]+_0x54ed26(0x102)+_0x14fd07['error']));}return 0x1;}const _0xdf89e3=_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xd3)][_0x54ed26(0xb2)]+_0x3fadaf['counts'][_0x54ed26(0x11a)][_0x54ed26(0xb2)]+_0x3fadaf[_0x54ed26(0x98)]['textKnowledgeBases'][_0x54ed26(0xb2)]+_0x3fadaf['counts'][_0x54ed26(0xb5)][_0x54ed26(0xb2)]+_0x3fadaf[_0x54ed26(0x98)]['integrations']['created']+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb6)]['created']+_0x3fadaf[_0x54ed26(0x98)]['experimentalArtifacts'][_0x54ed26(0xb2)],_0x955f1d=_0x3fadaf[_0x54ed26(0x98)]['agents'][_0x54ed26(0xdf)]+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0x11a)]['updated']+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xe1)]['updated']+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb5)][_0x54ed26(0xdf)]+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xd4)][_0x54ed26(0xdf)]+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb6)][_0x54ed26(0xdf)]+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0x122)][_0x54ed26(0xdf)],_0xea6429=_0x3fadaf['counts'][_0x54ed26(0xd3)][_0x54ed26(0xb3)]+_0x3fadaf['counts'][_0x54ed26(0x11a)][_0x54ed26(0xb3)]+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xe1)]['unchanged']+_0x3fadaf['counts'][_0x54ed26(0xb5)][_0x54ed26(0xb3)]+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xd4)][_0x54ed26(0xb3)]+_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb6)][_0x54ed26(0xb3)]+_0x3fadaf[_0x54ed26(0x98)]['experimentalArtifacts']['unchanged'];console[_0x54ed26(0x91)](_0x54ed26(0xa0)+_0x3fadaf[_0x54ed26(0xf5)]+'\x27:'),console[_0x54ed26(0x91)]('\x20\x20'+a4_0x5db7f6[_0x54ed26(0xba)]('+\x20'+_0xdf89e3+_0x54ed26(0xff))+_0x54ed26(0x12e)+a4_0x5db7f6[_0x54ed26(0xd0)]('~\x20'+_0x955f1d+_0x54ed26(0xeb))+'\x20|\x20'+a4_0x5db7f6[_0x54ed26(0x110)]('=\x20'+_0xea6429+_0x54ed26(0x13c))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xd3)])),console[_0x54ed26(0x91)](_0x54ed26(0x131)+formatCountSummary(_0x3fadaf[_0x54ed26(0x98)]['knowledgeBases'])),console['log'](_0x54ed26(0xf7)+formatCountSummary(_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xe1)])),console[_0x54ed26(0x91)](_0x54ed26(0x9e)+formatCountSummary(_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb5)])),console[_0x54ed26(0x91)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xd4)]));const _0x3ab778=_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb6)][_0x54ed26(0xb2)]>0x0||_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb6)][_0x54ed26(0xdf)]>0x0||_0x3fadaf[_0x54ed26(0x98)]['experimentalKnowledgeBases'][_0x54ed26(0xb3)]>0x0||_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0x122)][_0x54ed26(0xb2)]>0x0||_0x3fadaf['counts'][_0x54ed26(0x122)][_0x54ed26(0xdf)]>0x0||_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0x122)]['unchanged']>0x0;_0x3ab778&&(console[_0x54ed26(0x91)](_0x54ed26(0x101)+formatCountSummary(_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0xb6)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3fadaf[_0x54ed26(0x98)][_0x54ed26(0x122)])));console['log'](_0x54ed26(0xdd)+a4_0x5db7f6[_0x54ed26(0x10c)](_0x39b894)),displayDiffs(_0x3fadaf[_0x54ed26(0xd3)],_0x3fadaf['knowledgeBases'],_0x3fadaf[_0x54ed26(0xe1)],_0x3fadaf[_0x54ed26(0xb5)],_0x3fadaf['integrations'],_0x3fadaf[_0x54ed26(0xb6)],_0x3fadaf[_0x54ed26(0x122)]);if(_0x107bb6)return console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0xd0)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0xdf89e3===0x0&&_0x955f1d===0x0){console['log'](a4_0x5db7f6[_0x54ed26(0xba)](_0x54ed26(0xa9)));const _0x10d924=getLLMProjectUrl(_0x3a785f,_0x3fadaf[_0x54ed26(0xc9)]);return console['log'](_0x54ed26(0x111)+a4_0x5db7f6[_0x54ed26(0x10c)](_0x10d924)),0x0;}if(!_0x43b2ec&&!_0x331e32){if(!isInteractive())return console[_0x54ed26(0xb1)](a4_0x5db7f6[_0x54ed26(0x115)](_0x54ed26(0x94)),_0x54ed26(0x137)),console[_0x54ed26(0xb1)](a4_0x5db7f6[_0x54ed26(0x110)](_0x54ed26(0x147))),0x1;const _0x35e1a7=await confirmKey(_0x54ed26(0xee)+(_0xdf89e3+_0x955f1d)+'\x20resources?');if(!_0x35e1a7)return console[_0x54ed26(0x91)](a4_0x5db7f6['yellow']('Cancelled'),_0x54ed26(0xa8)),0x1;}const {data:_0x37c85f}=await withSpinner(_0x54ed26(0xc3),()=>_0x24e4eb[_0x54ed26(0xf9)]['pushProject'](_0x39b894,{'force':_0x331e32})),_0x421b31=_0x37c85f['counts'][_0x54ed26(0xd3)][_0x54ed26(0x12d)]>0x0||_0x37c85f[_0x54ed26(0x98)][_0x54ed26(0x11a)][_0x54ed26(0x12d)]>0x0||_0x37c85f['counts'][_0x54ed26(0xe1)]['errors']>0x0||_0x37c85f[_0x54ed26(0x98)]['prompts'][_0x54ed26(0x12d)]>0x0;if(_0x421b31){console[_0x54ed26(0x91)](a4_0x5db7f6['yellow'](_0x54ed26(0xcb))),console[_0x54ed26(0x91)](),console['log'](a4_0x5db7f6['red']('Errors:'));for(const _0x5a6d45 of _0x37c85f['agents']){_0x5a6d45[_0x54ed26(0xb9)]===_0x54ed26(0xb1)&&console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0x115)](_0x54ed26(0x11e)+_0x5a6d45[_0x54ed26(0x92)]+_0x54ed26(0x102)+_0x5a6d45['error']));}for(const _0x5b3dc3 of _0x37c85f[_0x54ed26(0x11a)]){_0x5b3dc3[_0x54ed26(0xb9)]===_0x54ed26(0xb1)&&console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0x115)](_0x54ed26(0x12f)+_0x5b3dc3[_0x54ed26(0xec)]+_0x54ed26(0x102)+_0x5b3dc3['error']));}for(const _0x7e5ff7 of _0x37c85f[_0x54ed26(0xe1)]){_0x7e5ff7[_0x54ed26(0xb9)]===_0x54ed26(0xb1)&&console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0x115)](_0x54ed26(0xad)+_0x7e5ff7['name']+_0x54ed26(0x102)+_0x7e5ff7[_0x54ed26(0xb1)]));}for(const _0x4eb7c4 of _0x37c85f['prompts']){_0x4eb7c4['action']===_0x54ed26(0xb1)&&console[_0x54ed26(0x91)](a4_0x5db7f6['red'](_0x54ed26(0x146)+_0x4eb7c4[_0x54ed26(0xec)]+_0x54ed26(0x102)+_0x4eb7c4[_0x54ed26(0xb1)]));}for(const _0xe1ba40 of _0x37c85f[_0x54ed26(0xd4)]){_0xe1ba40[_0x54ed26(0xb9)]===_0x54ed26(0xb1)&&console[_0x54ed26(0x91)](a4_0x5db7f6[_0x54ed26(0x115)](_0x54ed26(0x100)+_0xe1ba40[_0x54ed26(0xec)]+_0x54ed26(0x102)+_0xe1ba40[_0x54ed26(0xb1)]));}return 0x1;}console['log'](a4_0x5db7f6[_0x54ed26(0xba)](_0x54ed26(0x140)+(_0xdf89e3+_0x955f1d)+_0x54ed26(0x9f)+_0x37c85f[_0x54ed26(0xf5)]+'\x27'));const _0x1c68dc=getLLMProjectUrl(_0x3a785f,_0x37c85f[_0x54ed26(0xc9)]);return console[_0x54ed26(0x91)]('Project:\x20'+a4_0x5db7f6['cyan'](_0x1c68dc)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x2953bf=a5_0x3dd2;(function(_0x17ea45,_0x2ebb2b){const _0xf3d512=a5_0x3dd2,_0x1d200d=_0x17ea45();while(!![]){try{const _0xee40ad=parseInt(_0xf3d512(0x218))/0x1*(-parseInt(_0xf3d512(0x225))/0x2)+-parseInt(_0xf3d512(0x231))/0x3*(parseInt(_0xf3d512(0x1d7))/0x4)+-parseInt(_0xf3d512(0x1f4))/0x5*(-parseInt(_0xf3d512(0x1cf))/0x6)+parseInt(_0xf3d512(0x237))/0x7+parseInt(_0xf3d512(0x1d5))/0x8+-parseInt(_0xf3d512(0x1f2))/0x9+-parseInt(_0xf3d512(0x22c))/0xa*(parseInt(_0xf3d512(0x23a))/0xb);if(_0xee40ad===_0x2ebb2b)break;else _0x1d200d['push'](_0x1d200d['shift']());}catch(_0x1c02ba){_0x1d200d['push'](_0x1d200d['shift']());}}}(a5_0x57df,0x81e00));import*as a5_0x47fc09 from'node:fs';import*as a5_0x46291d from'node:path';function a5_0x57df(){const _0x1d8ae4=['status','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','name','resolve','context','basename','red','includes','✓\x20PASS:\x20','...\x20','conversation_url','llmProject','json','table','testYmlPath','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20(cached)','Error\x20writing\x20output\x20file:\x20','\x20\x20Evaluating...\x20','Passed:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Project\x20path:\x20','\x20-\x20','...','ERROR','resolveAgentId','existsSync','filter','cyan','FAIL','\x22:\x20','found','no_context','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','now','message','177534GrBeAK','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','tsv','conversations','\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)','✗\x20ERROR:\x20','5595832jDREsK','eval','68HBuCdG','Conversation\x20URL:\x20','toLowerCase','length','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','dim','execute','stop','no_tests','testName','Running\x20test:\x20','404','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','agentName','has','Evaluating\x20response...','Re-evaluating...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','llm','repeat','\x20\x20Agent:\x20',':\x20Sending\x20user\x20input...','/<agent-name>','size','tags','\x20\x20Round\x20','PASS','6090822WtAqZL','text','150zLkTFb','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Test\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','projectDir','✗\x20FAIL:\x20','Tests\x20found:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20(new)','reeval','Test\x20Configuration:','agent:test','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','rounds','agent','timestamp','round','Run\x20\x27tdx\x20agent\x20pull\x20','test.yml','Round\x20','writeFileSync','Cached\x20run\x20is\x20from\x20site\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','jsonl','Re-evaluation\x20Summary','Executing\x20new\x20tests...','\x20\x20Project:\x20','start','Running:\x20','output','Agent:\x20','push','\x20\x20Conversation:\x20','tests','\x20\x20Site:\x20','Site:\x20','1862xlPURU','forEach','Either\x20switch\x20to\x20the\x20\x22','map','Failed\x20Tests:','toISOString','Errors:\x20\x20\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Output\x20written\x20to:\x20','white','log','Running\x20agent\x20tests...','split','54tdfKkt','not\x20found','join','Duration:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x22,\x20but\x20current\x20site\x20is\x20\x22','verbose','3747510vokTGQ','No\x20tests\x20found\x20matching:\x20','New\x20tests\x20to\x20execute:\x20','⚠\x20SKIPPED:\x20','No\x20tests\x20have\x20tags\x20defined.','15612SefljF','yellow','Failed:\x20\x20\x20','add','\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','Round\x201/','945490EFilsp','site','utf-8','11wTCtPC','green','Re-evaluating\x20','Total:\x20\x20\x20\x20','executeReeval','projectName','Using\x20agent:\x20','reason'];a5_0x57df=function(){return _0x1d8ae4;};return a5_0x57df();}import a5_0xf9e0d5 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x3dd2(_0x2851e7,_0x23b723){_0x2851e7=_0x2851e7-0x1c3;const _0x57df41=a5_0x57df();let _0x3dd2cf=_0x57df41[_0x2851e7];return _0x3dd2cf;}export class AgentTestCommand extends BaseCommand{['name']=a5_0x2953bf(0x1ff);['description']=a5_0x2953bf(0x1f7);async[a5_0x2953bf(0x1dd)](_0x977772){const _0x3a62b0=a5_0x2953bf,{options:_0x1829ce,args:_0x1957ab,tdx:_0x2aa328}=_0x977772,_0x23d909=_0x1957ab[0x0]||'.',_0x3505ed=_0x1829ce['dryRun'],_0x13a50a=_0x1829ce,_0x95155a=_0x13a50a[_0x3a62b0(0x1d6)]===![],_0x191aa9=_0x13a50a[_0x3a62b0(0x1fd)],_0x2db77b=_0x13a50a[_0x3a62b0(0x244)],_0x1f95ca=_0x13a50a[_0x3a62b0(0x1ef)],_0xd8d34c=_0x1829ce[_0x3a62b0(0x238)],_0x444805=_0x13a50a[_0x3a62b0(0x211)];if(_0x191aa9&&_0x95155a)return console['log'](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1e8))),0x1;let _0x11df7d=_0x3a62b0(0x24f);if(_0x13a50a[_0x3a62b0(0x24e)])_0x11df7d=_0x3a62b0(0x24e);else{if(_0x13a50a['jsonl'])_0x11df7d=_0x3a62b0(0x20b);else{if(_0x13a50a[_0x3a62b0(0x1d1)])_0x11df7d=_0x3a62b0(0x1d1);else{if(_0x13a50a[_0x3a62b0(0x24f)])_0x11df7d=_0x3a62b0(0x24f);}}}const _0x76cbfd=_0x13a50a[_0x3a62b0(0x24d)];let _0x3dba63=_0x23d909;const _0x2ec65a=a5_0x47fc09[_0x3a62b0(0x1c5)](_0x23d909),_0x1305b8=_0x23d909==='.';if(!_0x2ec65a||_0x1305b8){const _0x4620fb=resolveProjectFromContext(_0x23d909,_0x76cbfd,{'requireFile':_0x3a62b0(0x206)});if(_0x4620fb[_0x3a62b0(0x1ca)])_0x3dba63=_0x4620fb[_0x3a62b0(0x1f8)],_0x4620fb['source']===_0x3a62b0(0x246)&&console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x3a62b0(0x240)+_0x3dba63));else switch(_0x4620fb['reason']){case _0x3a62b0(0x1cb):console[_0x3a62b0(0x222)](a5_0xf9e0d5['yellow'](_0x4620fb['message'])),console['log'](),console[_0x3a62b0(0x222)]('Usage:'),console['log'](_0x3a62b0(0x235)),console[_0x3a62b0(0x222)](_0x3a62b0(0x1d3)),console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x3a62b0(0x243));return 0x1;case'no_local_folder':console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x232)](_0x4620fb[_0x3a62b0(0x1ce)])),console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x3a62b0(0x205)+_0x4620fb[_0x3a62b0(0x24d)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x44e159=a5_0x46291d[_0x3a62b0(0x247)](_0x4620fb['projectDir']);console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x232)](_0x3a62b0(0x1f5)+_0x4620fb[_0x3a62b0(0x24d)]+'\x22:'));for(const _0x274c1b of _0x4620fb['agentDirs']){console[_0x3a62b0(0x222)]('\x20\x20-\x20'+_0x274c1b);}return console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x3a62b0(0x21f)+_0x44e159+_0x3a62b0(0x1ed)),0x1;}case _0x3a62b0(0x1df):console['log'](a5_0xf9e0d5[_0x3a62b0(0x232)](_0x3a62b0(0x20a)+_0x4620fb[_0x3a62b0(0x24d)]+'\x22.')),console[_0x3a62b0(0x222)](a5_0xf9e0d5['dim'](_0x3a62b0(0x259)+_0x4620fb[_0x3a62b0(0x1f8)])),console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x5eb08c,agentInfo:_0x904a01}=parseTestFile(_0x3dba63);let _0x55f6cd=_0x5eb08c[_0x3a62b0(0x215)];if(_0x2db77b){const _0x1aaf96=_0x2db77b[_0x3a62b0(0x224)](',')[_0x3a62b0(0x21b)](_0x5198fd=>_0x5198fd['trim']());_0x55f6cd=_0x5eb08c[_0x3a62b0(0x215)]['filter'](_0x21cf61=>_0x1aaf96['includes'](_0x21cf61[_0x3a62b0(0x244)]));if(_0x55f6cd['length']===0x0)return console[_0x3a62b0(0x222)](a5_0xf9e0d5['yellow'](_0x3a62b0(0x22d)+_0x2db77b)),console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)]('Available\x20tests:\x20'+_0x5eb08c['tests']['map'](_0x25cc60=>_0x25cc60['name'])[_0x3a62b0(0x227)](',\x20'))),0x1;}if(_0x1f95ca){const _0x59e41f=_0x1f95ca['split'](',')['map'](_0x4c044a=>_0x4c044a['trim']()[_0x3a62b0(0x1d9)]());_0x55f6cd=_0x55f6cd[_0x3a62b0(0x1c6)](_0x48847b=>_0x48847b[_0x3a62b0(0x1ef)]?.['some'](_0x5a7266=>_0x59e41f['includes'](_0x5a7266[_0x3a62b0(0x1d9)]())));if(_0x55f6cd[_0x3a62b0(0x1da)]===0x0){console['log'](a5_0xf9e0d5['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1f95ca));const _0x45a8b5=new Set();return _0x5eb08c[_0x3a62b0(0x215)][_0x3a62b0(0x219)](_0x596df8=>_0x596df8[_0x3a62b0(0x1ef)]?.['forEach'](_0x21f47e=>_0x45a8b5[_0x3a62b0(0x234)](_0x21f47e))),_0x45a8b5[_0x3a62b0(0x1ee)]>0x0?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)]('Available\x20tags:\x20'+[..._0x45a8b5][_0x3a62b0(0x227)](',\x20'))):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x3a62b0(0x230))),0x1;}}if(_0x191aa9)return this['executeReeval'](_0x977772,{'definition':{'tests':_0x55f6cd},'agentInfo':_0x904a01,'outputFormat':_0x11df7d,'outputFile':_0x444805,'testNames':_0x2db77b});if(_0x3505ed){console[_0x3a62b0(0x222)](a5_0xf9e0d5['cyan'](_0x3a62b0(0x1fe))),console[_0x3a62b0(0x222)](_0x3a62b0(0x216)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0xd8d34c)),console[_0x3a62b0(0x222)](_0x3a62b0(0x20e)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x904a01[_0x3a62b0(0x23f)])),console[_0x3a62b0(0x222)](_0x3a62b0(0x1eb)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x904a01[_0x3a62b0(0x1e4)])),console[_0x3a62b0(0x222)](),console['log'](_0x3a62b0(0x1fa)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x55f6cd[_0x3a62b0(0x1da)]));for(let _0x3ec889=0x0;_0x3ec889<_0x55f6cd[_0x3a62b0(0x1da)];_0x3ec889++){const _0x57f31c=_0x55f6cd[_0x3ec889],_0x33dc25=_0x57f31c[_0x3a62b0(0x201)]['length']===0x1?_0x3a62b0(0x204):_0x3a62b0(0x201),_0x43a152=_0x57f31c[_0x3a62b0(0x1ef)]?.[_0x3a62b0(0x1da)]?'\x20['+_0x57f31c[_0x3a62b0(0x1ef)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x3ec889+0x1)+'.\x20'+a5_0xf9e0d5['white'](_0x57f31c[_0x3a62b0(0x244)])+'\x20('+_0x57f31c[_0x3a62b0(0x201)]['length']+'\x20'+_0x33dc25+')'+a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x43a152));}return 0x0;}let _0x25aaec,_0x4bbdbc;try{_0x25aaec=await _0x2aa328[_0x3a62b0(0x1e9)]['resolveProjectId'](_0x904a01['projectName']);}catch(_0x2a4d26){const _0x493980=_0x2a4d26 instanceof Error?_0x2a4d26[_0x3a62b0(0x1ce)]:String(_0x2a4d26);return _0x493980[_0x3a62b0(0x249)](_0x3a62b0(0x1e2))||_0x493980[_0x3a62b0(0x1d9)]()['includes'](_0x3a62b0(0x226))?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x258)+_0x904a01[_0x3a62b0(0x23f)])):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x229)+_0x904a01['projectName']+'\x22:\x20'+_0x493980)),0x1;}try{_0x4bbdbc=await _0x2aa328[_0x3a62b0(0x1e9)][_0x3a62b0(0x1c4)](_0x904a01[_0x3a62b0(0x1e4)],_0x25aaec);}catch(_0x48f78b){const _0x132092=_0x48f78b instanceof Error?_0x48f78b[_0x3a62b0(0x1ce)]:String(_0x48f78b);return _0x132092[_0x3a62b0(0x249)](_0x3a62b0(0x1e2))||_0x132092[_0x3a62b0(0x1d9)]()[_0x3a62b0(0x249)](_0x3a62b0(0x226))?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1cc)+_0x904a01[_0x3a62b0(0x1e4)])):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x253)+_0x904a01[_0x3a62b0(0x1e4)]+_0x3a62b0(0x1c9)+_0x132092)),0x1;}let _0x586340;if(!_0x95155a)try{_0x586340=await setupEvaluatorAgent(_0x2aa328[_0x3a62b0(0x1e9)],_0x1829ce[_0x3a62b0(0x22b)]);}catch(_0x425556){const _0x1111e9=_0x425556 instanceof Error?_0x425556[_0x3a62b0(0x1ce)]:String(_0x425556);return console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x252)+_0x1111e9)),0x1;}console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1c7)](_0x3a62b0(0x223))),console[_0x3a62b0(0x222)](_0x3a62b0(0x217)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0xd8d34c)),console[_0x3a62b0(0x222)]('Agent:\x20'+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x904a01[_0x3a62b0(0x23f)]+'/'+_0x904a01['agentName'])),console[_0x3a62b0(0x222)]();const _0x20072f=[],_0x4fb6fd=[],_0x3b633a=Date['now']();for(let _0x508e3b=0x0;_0x508e3b<_0x55f6cd[_0x3a62b0(0x1da)];_0x508e3b++){const _0x3abd0b=_0x55f6cd[_0x508e3b];_0x55f6cd['length']>0x1?console[_0x3a62b0(0x222)](_0x3a62b0(0x1f6)+(_0x508e3b+0x1)+'/'+_0x55f6cd[_0x3a62b0(0x1da)]+':\x20'+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x3abd0b[_0x3a62b0(0x244)])):console[_0x3a62b0(0x222)](_0x3a62b0(0x1e1)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x3abd0b['name']));const _0x5854d3=createCommandSpinner(_0x3a62b0(0x236)+_0x3abd0b['rounds'][_0x3a62b0(0x1da)]+_0x3a62b0(0x1ec));_0x5854d3[_0x3a62b0(0x20f)]();try{const {result:_0x1ca414,conversation:_0x4552cd}=await runTest(_0x2aa328['llm'],_0x3abd0b,{'agentId':_0x4bbdbc,'projectId':_0x25aaec,'site':_0xd8d34c,'noEval':_0x95155a,'evaluatorId':_0x586340,'onRoundStart':(_0x37cf29,_0x1cee49)=>{const _0x33ef4a=_0x3a62b0;_0x5854d3['text']=_0x33ef4a(0x207)+(_0x37cf29+0x1)+'/'+_0x1cee49+_0x33ef4a(0x1ec);},'onRoundComplete':(_0x461046,_0x403351,_0x1a59eb)=>{const _0x45f562=_0x3a62b0,_0x23b6d7=formatElapsed(_0x403351);_0x1a59eb?console['log'](_0x45f562(0x1f0)+(_0x461046+0x1)+'/'+_0x3abd0b[_0x45f562(0x201)][_0x45f562(0x1da)]+_0x45f562(0x24b)+a5_0xf9e0d5['green']('✓')+'\x20('+_0x23b6d7+')'):console[_0x45f562(0x222)](_0x45f562(0x1f0)+(_0x461046+0x1)+'/'+_0x3abd0b[_0x45f562(0x201)]['length']+_0x45f562(0x24b)+a5_0xf9e0d5[_0x45f562(0x248)]('✗'));},'onEvaluationStart':()=>{const _0x23d033=_0x3a62b0;_0x5854d3[_0x23d033(0x1f3)]=_0x23d033(0x1e6);},'onEvaluationComplete':_0x4f209b=>{const _0x1a52ea=_0x3a62b0,_0x204a31=formatElapsed(_0x4f209b);console[_0x1a52ea(0x222)](_0x1a52ea(0x256)+a5_0xf9e0d5[_0x1a52ea(0x23b)]('✓')+'\x20('+_0x204a31+')');}});_0x5854d3[_0x3a62b0(0x1de)](),_0x20072f[_0x3a62b0(0x213)](_0x1ca414),_0x4fb6fd[_0x3a62b0(0x213)](_0x4552cd);if(_0x1ca414[_0x3a62b0(0x242)]===_0x3a62b0(0x1f1))console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x23b)](_0x3a62b0(0x24a)+_0x1ca414[_0x3a62b0(0x241)]));else _0x1ca414[_0x3a62b0(0x242)]===_0x3a62b0(0x1c8)?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1f9)+_0x1ca414[_0x3a62b0(0x241)])):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1d4)+_0x1ca414[_0x3a62b0(0x241)]));_0x1ca414[_0x3a62b0(0x24c)]&&console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x3a62b0(0x1d8)+_0x1ca414[_0x3a62b0(0x24c)])),console['log']();}catch(_0xe57db4){_0x5854d3[_0x3a62b0(0x1de)]();const _0x99d3cf=_0xe57db4 instanceof Error?_0xe57db4[_0x3a62b0(0x1ce)]:String(_0xe57db4);console['log'](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1d4)+_0x99d3cf)),console[_0x3a62b0(0x222)](),_0x20072f['push']({'name':_0x3abd0b['name'],'status':_0x3a62b0(0x1c3),'reason':_0x99d3cf,'timestamp':new Date()[_0x3a62b0(0x21d)](),'duration_ms':0x0});}}const _0x1992dd=Date[_0x3a62b0(0x1cd)]()-_0x3b633a,_0x2f0ff1=_0x20072f[_0x3a62b0(0x1c6)](_0x2acc5c=>_0x2acc5c[_0x3a62b0(0x242)]===_0x3a62b0(0x1f1))[_0x3a62b0(0x1da)],_0x59abda=_0x20072f['filter'](_0x2a6de3=>_0x2a6de3['status']==='FAIL')['length'],_0x416e83=_0x20072f[_0x3a62b0(0x1c6)](_0x47a589=>_0x47a589[_0x3a62b0(0x242)]===_0x3a62b0(0x1c3))['length'];console[_0x3a62b0(0x222)]('━'[_0x3a62b0(0x1ea)](0x3c)),console[_0x3a62b0(0x222)]('Test\x20Summary'),console[_0x3a62b0(0x222)]('━'[_0x3a62b0(0x1ea)](0x3c)),console[_0x3a62b0(0x222)](_0x3a62b0(0x23d)+_0x20072f[_0x3a62b0(0x1da)]),console['log'](_0x3a62b0(0x257)+a5_0xf9e0d5[_0x3a62b0(0x23b)](_0x2f0ff1)),console[_0x3a62b0(0x222)](_0x3a62b0(0x233)+a5_0xf9e0d5[_0x3a62b0(0x248)](_0x59abda));_0x416e83>0x0&&console[_0x3a62b0(0x222)](_0x3a62b0(0x21e)+a5_0xf9e0d5[_0x3a62b0(0x248)](_0x416e83));console['log'](_0x3a62b0(0x228)+formatElapsed(_0x1992dd)),console[_0x3a62b0(0x222)]('━'[_0x3a62b0(0x1ea)](0x3c));const _0x1d0d5e=_0x20072f['filter'](_0x3a2f15=>_0x3a2f15[_0x3a62b0(0x242)]!==_0x3a62b0(0x1f1));if(_0x1d0d5e[_0x3a62b0(0x1da)]>0x0){console['log'](),console['log'](_0x3a62b0(0x21c));for(const _0x5f519a of _0x1d0d5e){const _0x246101=a5_0xf9e0d5[_0x3a62b0(0x248)]('✗'),_0x51f124=_0x5f519a['reason'][_0x3a62b0(0x1da)]>0x32?_0x5f519a[_0x3a62b0(0x241)]['substring'](0x0,0x32)+_0x3a62b0(0x25b):_0x5f519a['reason'];console[_0x3a62b0(0x222)]('\x20\x20'+_0x246101+'\x20'+_0x5f519a[_0x3a62b0(0x244)]+':\x20'+_0x51f124);}}const _0x32f69={'summary':{'total':_0x20072f[_0x3a62b0(0x1da)],'passed':_0x2f0ff1,'failed':_0x59abda,'errors':_0x416e83>0x0?_0x416e83:undefined,'duration_ms':_0x1992dd},'tests':_0x20072f,'agent':{'project':_0x904a01['projectName'],'name':_0x904a01[_0x3a62b0(0x1e4)],'site':_0xd8d34c},'timestamp':new Date(_0x3b633a)[_0x3a62b0(0x21d)]()};try{const _0x2110da=buildCachedTestRun(_0x4fb6fd,{'site':_0xd8d34c,'projectId':_0x25aaec,'projectName':_0x904a01[_0x3a62b0(0x23f)],'agentId':_0x4bbdbc,'agentName':_0x904a01['agentName'],'testYmlPath':a5_0x46291d[_0x3a62b0(0x245)](_0x904a01[_0x3a62b0(0x250)])});saveLastTestRun(_0x2110da);}catch{}if(_0x11df7d!==_0x3a62b0(0x24f)||_0x444805){const _0x9a77eb=formatResults(_0x32f69,_0x11df7d);if(_0x444805)try{a5_0x47fc09[_0x3a62b0(0x208)](_0x444805,_0x9a77eb,_0x3a62b0(0x239)),console[_0x3a62b0(0x222)](),console['log'](a5_0xf9e0d5['dim'](_0x3a62b0(0x220)+_0x444805));}catch(_0x2b69cc){return console['log'](),console[_0x3a62b0(0x222)](a5_0xf9e0d5['red']('Error\x20writing\x20output\x20file:\x20'+_0x2b69cc)),0x1;}else console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x9a77eb);}return _0x1d0d5e[_0x3a62b0(0x1da)]>0x0?0x1:0x0;}async[a5_0x2953bf(0x23e)](_0x5796c6,_0xb56818){const _0x553228=a5_0x2953bf,{options:_0x47f881,tdx:_0x2fc7f0}=_0x5796c6,{definition:_0x52acd9,agentInfo:_0x1a64d6,outputFormat:_0x235333,outputFile:_0x128d7a}=_0xb56818,_0x2ec1bc=_0x47f881[_0x553228(0x238)],_0x1a2fbf=loadLastTestRun();if(!_0x1a2fbf)return console['log'](a5_0xf9e0d5['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x1e3))),0x1;if(_0x1a2fbf['agent'][_0x553228(0x1e4)]!==_0x1a64d6[_0x553228(0x1e4)])return console['log'](a5_0xf9e0d5['red'](_0x553228(0x1db)+_0x1a2fbf['agent'][_0x553228(0x1e4)]+_0x553228(0x1fb)+_0x1a64d6[_0x553228(0x1e4)]+'\x22.')),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x200))),0x1;const _0x23915c=new Set(_0x1a2fbf[_0x553228(0x1d2)][_0x553228(0x21b)](_0x1901fd=>_0x1901fd[_0x553228(0x1e0)])),_0xfda62d=_0x52acd9[_0x553228(0x215)][_0x553228(0x1c6)](_0x38decd=>!_0x23915c[_0x553228(0x1e5)](_0x38decd[_0x553228(0x244)]));if(_0xfda62d[_0x553228(0x1da)]>0x0&&_0x1a2fbf[_0x553228(0x238)]!==_0x2ec1bc)return console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x248)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x209)+_0x1a2fbf[_0x553228(0x238)]+_0x553228(0x22a)+_0x2ec1bc+'\x22.')),console[_0x553228(0x222)](a5_0xf9e0d5['dim'](_0x553228(0x21a)+_0x1a2fbf[_0x553228(0x238)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x15e5d2=_0x52acd9[_0x553228(0x215)]['filter'](_0x334db1=>_0x23915c[_0x553228(0x1e5)](_0x334db1[_0x553228(0x244)])),_0x330697=_0xfda62d;let _0x3d186d;try{_0x3d186d=await setupEvaluatorAgent(_0x2fc7f0[_0x553228(0x1e9)],_0x47f881[_0x553228(0x22b)]);}catch(_0x33fa0f){const _0x219086=_0x33fa0f instanceof Error?_0x33fa0f['message']:String(_0x33fa0f);return console[_0x553228(0x222)](a5_0xf9e0d5['red'](_0x553228(0x252)+_0x219086)),0x1;}console['log'](a5_0xf9e0d5[_0x553228(0x1c7)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x553228(0x222)](_0x553228(0x251)+a5_0xf9e0d5[_0x553228(0x221)](_0x1a2fbf[_0x553228(0x203)])),console[_0x553228(0x222)](_0x553228(0x212)+a5_0xf9e0d5[_0x553228(0x221)](_0x1a2fbf[_0x553228(0x202)][_0x553228(0x23f)]+'/'+_0x1a2fbf[_0x553228(0x202)][_0x553228(0x1e4)]));_0x330697[_0x553228(0x1da)]>0x0&&console[_0x553228(0x222)](_0x553228(0x22e)+a5_0xf9e0d5[_0x553228(0x232)](_0x330697[_0x553228(0x1da)]));console[_0x553228(0x222)]();const _0x5ae37b=[],_0x148530=Date[_0x553228(0x1cd)](),_0x4e6508=createCommandSpinner(_0x553228(0x1e7));if(_0x15e5d2[_0x553228(0x1da)]>0x0)try{const _0x534174=await reevaluateFromCache(_0x2fc7f0['llm'],_0x1a2fbf,{'tests':_0x15e5d2},{'evaluatorId':_0x3d186d,'onTestStart':(_0x2d0d4c,_0x2dc60d,_0x31b420)=>{const _0x221a08=_0x553228;_0x4e6508['text']=_0x221a08(0x23c)+(_0x2dc60d+0x1)+'/'+_0x31b420+':\x20'+_0x2d0d4c+_0x221a08(0x25b);if(!_0x4e6508['isSpinning'])_0x4e6508[_0x221a08(0x20f)]();},'onTestComplete':(_0x38d5cc,_0x1cec43)=>{const _0x37fcb5=_0x553228;_0x4e6508['stop']();if(_0x1cec43[_0x37fcb5(0x242)]===_0x37fcb5(0x1f1))console[_0x37fcb5(0x222)](a5_0xf9e0d5['green'](_0x37fcb5(0x24a)+_0x38d5cc)+a5_0xf9e0d5[_0x37fcb5(0x1dc)](_0x37fcb5(0x254)));else _0x1cec43[_0x37fcb5(0x242)]===_0x37fcb5(0x1c8)?console[_0x37fcb5(0x222)](a5_0xf9e0d5[_0x37fcb5(0x248)](_0x37fcb5(0x1f9)+_0x38d5cc+_0x37fcb5(0x25a)+_0x1cec43[_0x37fcb5(0x241)])+a5_0xf9e0d5[_0x37fcb5(0x1dc)]('\x20(cached)')):console[_0x37fcb5(0x222)](a5_0xf9e0d5[_0x37fcb5(0x248)](_0x37fcb5(0x1d4)+_0x38d5cc+_0x37fcb5(0x25a)+_0x1cec43[_0x37fcb5(0x241)]));_0x1cec43['conversation_url']&&console[_0x37fcb5(0x222)](a5_0xf9e0d5[_0x37fcb5(0x1dc)](_0x37fcb5(0x214)+_0x1cec43[_0x37fcb5(0x24c)])),_0x5ae37b[_0x37fcb5(0x213)](_0x1cec43);},'onTestSkipped':(_0x2b5f4e,_0x4b32fe)=>{const _0x77d709=_0x553228;_0x4e6508['stop'](),console['log'](a5_0xf9e0d5[_0x77d709(0x232)](_0x77d709(0x22f)+_0x2b5f4e+_0x77d709(0x25a)+_0x4b32fe));}});for(const _0x17b9f5 of _0x534174){!_0x5ae37b['find'](_0x38215c=>_0x38215c['name']===_0x17b9f5[_0x553228(0x244)])&&_0x5ae37b[_0x553228(0x213)](_0x17b9f5);}}catch(_0x4546d1){_0x4e6508['stop']();const _0x541f54=_0x4546d1 instanceof Error?_0x4546d1[_0x553228(0x1ce)]:String(_0x4546d1);return console['log'](a5_0xf9e0d5[_0x553228(0x248)](_0x553228(0x1d0)+_0x541f54)),0x1;}_0x4e6508[_0x553228(0x1de)]();if(_0x330697[_0x553228(0x1da)]>0x0){console[_0x553228(0x222)](),console[_0x553228(0x222)](a5_0xf9e0d5['cyan'](_0x553228(0x20d)));const {projectId:_0x76dae8,agentId:_0x1cfba8}=_0x1a2fbf[_0x553228(0x202)];for(const _0x22f674 of _0x330697){console[_0x553228(0x222)](_0x553228(0x210)+a5_0xf9e0d5[_0x553228(0x221)](_0x22f674[_0x553228(0x244)]));const _0xc36ba4=createCommandSpinner(_0x553228(0x236)+_0x22f674[_0x553228(0x201)][_0x553228(0x1da)]+':\x20Sending\x20user\x20input...');_0xc36ba4['start']();try{const {result:_0x149a69}=await runTest(_0x2fc7f0[_0x553228(0x1e9)],_0x22f674,{'agentId':_0x1cfba8,'projectId':_0x76dae8,'site':_0x1a2fbf[_0x553228(0x238)],'noEval':![],'evaluatorId':_0x3d186d,'onRoundStart':(_0x4139a6,_0x12acbe)=>{const _0x22a189=_0x553228;_0xc36ba4[_0x22a189(0x1f3)]='Round\x20'+(_0x4139a6+0x1)+'/'+_0x12acbe+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x48933c,_0x5f43ea,_0x4890ed)=>{const _0x3becba=_0x553228,_0x5318ce=formatElapsed(_0x5f43ea);_0x4890ed?console[_0x3becba(0x222)](_0x3becba(0x1f0)+(_0x48933c+0x1)+'/'+_0x22f674[_0x3becba(0x201)][_0x3becba(0x1da)]+'...\x20'+a5_0xf9e0d5[_0x3becba(0x23b)]('✓')+'\x20('+_0x5318ce+')'):console[_0x3becba(0x222)](_0x3becba(0x1f0)+(_0x48933c+0x1)+'/'+_0x22f674[_0x3becba(0x201)][_0x3becba(0x1da)]+_0x3becba(0x24b)+a5_0xf9e0d5['red']('✗'));},'onEvaluationStart':()=>{const _0x1eec89=_0x553228;_0xc36ba4[_0x1eec89(0x1f3)]=_0x1eec89(0x1e6);},'onEvaluationComplete':_0x38569c=>{const _0x3bf347=_0x553228,_0x359802=formatElapsed(_0x38569c);console[_0x3bf347(0x222)](_0x3bf347(0x256)+a5_0xf9e0d5['green']('✓')+'\x20('+_0x359802+')');}});_0xc36ba4[_0x553228(0x1de)](),_0x5ae37b[_0x553228(0x213)](_0x149a69);if(_0x149a69[_0x553228(0x242)]===_0x553228(0x1f1))console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x23b)](_0x553228(0x24a)+_0x149a69['reason'])+a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x1fc)));else _0x149a69[_0x553228(0x242)]===_0x553228(0x1c8)?console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x248)]('✗\x20FAIL:\x20'+_0x149a69[_0x553228(0x241)])+a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x1fc))):console['log'](a5_0xf9e0d5[_0x553228(0x248)](_0x553228(0x1d4)+_0x149a69['reason']));_0x149a69[_0x553228(0x24c)]&&console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x214)+_0x149a69[_0x553228(0x24c)]));}catch(_0x4c3aea){_0xc36ba4[_0x553228(0x1de)]();const _0x503f04=_0x4c3aea instanceof Error?_0x4c3aea[_0x553228(0x1ce)]:String(_0x4c3aea);console[_0x553228(0x222)](a5_0xf9e0d5['red'](_0x553228(0x1d4)+_0x503f04)),_0x5ae37b[_0x553228(0x213)]({'name':_0x22f674[_0x553228(0x244)],'status':_0x553228(0x1c3),'reason':_0x503f04,'timestamp':new Date()[_0x553228(0x21d)](),'duration_ms':0x0});}}}console[_0x553228(0x222)]();const _0x33de0c=Date['now']()-_0x148530,_0x4434a8=_0x5ae37b[_0x553228(0x1c6)](_0x23ec93=>_0x23ec93[_0x553228(0x242)]===_0x553228(0x1f1))[_0x553228(0x1da)],_0x9e50b2=_0x5ae37b['filter'](_0x3233d9=>_0x3233d9[_0x553228(0x242)]===_0x553228(0x1c8))[_0x553228(0x1da)],_0x34e6c9=_0x5ae37b[_0x553228(0x1c6)](_0xc6feee=>_0xc6feee[_0x553228(0x242)]===_0x553228(0x1c3))[_0x553228(0x1da)];console['log']('━'[_0x553228(0x1ea)](0x3c)),console['log'](_0x553228(0x20c)),console[_0x553228(0x222)]('━'[_0x553228(0x1ea)](0x3c)),console['log'](_0x553228(0x23d)+_0x5ae37b[_0x553228(0x1da)]),console['log'](_0x553228(0x257)+a5_0xf9e0d5[_0x553228(0x23b)](_0x4434a8)),console[_0x553228(0x222)]('Failed:\x20\x20\x20'+a5_0xf9e0d5[_0x553228(0x248)](_0x9e50b2));_0x34e6c9>0x0&&console[_0x553228(0x222)]('Errors:\x20\x20\x20'+a5_0xf9e0d5[_0x553228(0x248)](_0x34e6c9));console['log'](_0x553228(0x228)+formatElapsed(_0x33de0c)),console['log']('━'[_0x553228(0x1ea)](0x3c));const _0x3c9469={'summary':{'total':_0x5ae37b[_0x553228(0x1da)],'passed':_0x4434a8,'failed':_0x9e50b2,'errors':_0x34e6c9>0x0?_0x34e6c9:undefined,'duration_ms':_0x33de0c},'tests':_0x5ae37b,'agent':{'project':_0x1a64d6[_0x553228(0x23f)],'name':_0x1a64d6[_0x553228(0x1e4)],'site':_0x2ec1bc},'timestamp':new Date(_0x148530)[_0x553228(0x21d)]()};if(_0x235333!=='table'||_0x128d7a){const _0x266e51=formatResults(_0x3c9469,_0x235333);if(_0x128d7a)try{a5_0x47fc09[_0x553228(0x208)](_0x128d7a,_0x266e51,'utf-8'),console[_0x553228(0x222)](),console['log'](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x220)+_0x128d7a));}catch(_0x2383db){return console[_0x553228(0x222)](),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x248)](_0x553228(0x255)+_0x2383db)),0x1;}else console['log'](),console[_0x553228(0x222)](_0x266e51);}const _0x4ce779=_0x5ae37b[_0x553228(0x1c6)](_0xa541f2=>_0xa541f2['status']!=='PASS');return _0x4ce779[_0x553228(0x1da)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x14c650=a5_0x92de;(function(_0x109efc,_0x4dc5b1){const _0x50b929=a5_0x92de,_0x581c9e=_0x109efc();while(!![]){try{const _0x26791d=parseInt(_0x50b929(0x1c1))/0x1*(-parseInt(_0x50b929(0x181))/0x2)+-parseInt(_0x50b929(0x172))/0x3*(parseInt(_0x50b929(0x196))/0x4)+parseInt(_0x50b929(0x1e2))/0x5*(parseInt(_0x50b929(0x1ad))/0x6)+-parseInt(_0x50b929(0x1bf))/0x7+parseInt(_0x50b929(0x171))/0x8*(-parseInt(_0x50b929(0x194))/0x9)+parseInt(_0x50b929(0x16a))/0xa*(-parseInt(_0x50b929(0x1cb))/0xb)+parseInt(_0x50b929(0x1ae))/0xc*(parseInt(_0x50b929(0x1e3))/0xd);if(_0x26791d===_0x4dc5b1)break;else _0x581c9e['push'](_0x581c9e['shift']());}catch(_0x1b3873){_0x581c9e['push'](_0x581c9e['shift']());}}}(a5_0x1fbd,0x72580));import*as a5_0x459af4 from'node:fs';import*as a5_0x55094e from'node:path';import a5_0x44b01b from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x92de(_0x4c4ce2,_0x375f78){_0x4c4ce2=_0x4c4ce2-0x15f;const _0x1fbd25=a5_0x1fbd();let _0x92de9b=_0x1fbd25[_0x4c4ce2];return _0x92de9b;}export class AgentTestCommand extends BaseCommand{[a5_0x14c650(0x16f)]=a5_0x14c650(0x184);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x14c650(0x1ef)](_0x21b8aa){const _0x5a8a01=a5_0x14c650,{options:_0x514c5f,args:_0x2214da,tdx:_0x1df368}=_0x21b8aa,_0x1cefc1=_0x2214da[0x0]||'.',_0x4b4361=_0x514c5f['dryRun'],_0x4d3df4=_0x514c5f,_0x335297=_0x4d3df4['eval']===![],_0x5dd689=_0x4d3df4[_0x5a8a01(0x18c)],_0x331d17=_0x4d3df4['name'],_0x16d523=_0x4d3df4[_0x5a8a01(0x16d)],_0x220dfb=_0x514c5f['site'],_0x152782=_0x4d3df4[_0x5a8a01(0x1e4)];if(_0x5dd689&&_0x335297)return console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x1d3)](_0x5a8a01(0x18e))),0x1;let _0x19c328='table';if(_0x4d3df4[_0x5a8a01(0x1bb)])_0x19c328='json';else{if(_0x4d3df4[_0x5a8a01(0x1d0)])_0x19c328='jsonl';else{if(_0x4d3df4[_0x5a8a01(0x1da)])_0x19c328='tsv';else{if(_0x4d3df4[_0x5a8a01(0x1f0)])_0x19c328=_0x5a8a01(0x1f0);}}}const _0x3c899c=_0x4d3df4[_0x5a8a01(0x16e)];let _0x4403c7=_0x1cefc1;const _0x58e39b=a5_0x459af4[_0x5a8a01(0x164)](_0x1cefc1),_0x4b44d7=_0x1cefc1==='.';if(!_0x58e39b||_0x4b44d7){const _0x162e66=resolveProjectFromContext(_0x1cefc1,_0x3c899c,{'requireFile':_0x5a8a01(0x170)});if(_0x162e66['found'])_0x4403c7=_0x162e66[_0x5a8a01(0x1c2)],_0x162e66[_0x5a8a01(0x1ba)]===_0x5a8a01(0x1b2)&&console['log'](a5_0x44b01b[_0x5a8a01(0x182)]('Using\x20agent:\x20'+_0x4403c7));else switch(_0x162e66[_0x5a8a01(0x17e)]){case _0x5a8a01(0x1af):console['log'](a5_0x44b01b[_0x5a8a01(0x185)](_0x162e66[_0x5a8a01(0x197)])),console[_0x5a8a01(0x1dd)](),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1aa)),console['log'](_0x5a8a01(0x179)),console[_0x5a8a01(0x1dd)]('\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[_0x5a8a01(0x1dd)](),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1a1));return 0x1;case _0x5a8a01(0x1c5):console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x185)](_0x162e66['message'])),console[_0x5a8a01(0x1dd)](),console[_0x5a8a01(0x1dd)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x162e66['llmProject']+_0x5a8a01(0x180));return 0x1;case _0x5a8a01(0x17b):{const _0x358d2b=a5_0x55094e[_0x5a8a01(0x1b5)](_0x162e66[_0x5a8a01(0x1c2)]);console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x185)](_0x5a8a01(0x1a5)+_0x162e66[_0x5a8a01(0x16e)]+'\x22:'));for(const _0x214941 of _0x162e66[_0x5a8a01(0x1eb)]){console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1f4)+_0x214941);}return console[_0x5a8a01(0x1dd)](),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1a9)+_0x358d2b+_0x5a8a01(0x1ca)),0x1;}case _0x5a8a01(0x174):console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x185)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x162e66[_0x5a8a01(0x16e)]+'\x22.')),console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x182)]('Project\x20path:\x20'+_0x162e66[_0x5a8a01(0x1c2)])),console[_0x5a8a01(0x1dd)](),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1d9));return 0x1;}}const {definition:_0x25e8e8,agentInfo:_0x290a65}=parseTestFile(_0x4403c7);let _0x39d20f=_0x25e8e8[_0x5a8a01(0x168)];if(_0x331d17){const _0x1bd6a3=_0x331d17[_0x5a8a01(0x1cd)](',')[_0x5a8a01(0x1a0)](_0x473d25=>_0x473d25['trim']());_0x39d20f=_0x25e8e8[_0x5a8a01(0x168)][_0x5a8a01(0x1b7)](_0x337072=>_0x1bd6a3['includes'](_0x337072[_0x5a8a01(0x16f)]));if(_0x39d20f['length']===0x0)return console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x185)]('No\x20tests\x20found\x20matching:\x20'+_0x331d17)),console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x182)](_0x5a8a01(0x165)+_0x25e8e8['tests'][_0x5a8a01(0x1a0)](_0x4fb0b2=>_0x4fb0b2[_0x5a8a01(0x16f)])[_0x5a8a01(0x175)](',\x20'))),0x1;}if(_0x16d523){const _0x5513d9=_0x16d523['split'](',')[_0x5a8a01(0x1a0)](_0x343bb4=>_0x343bb4[_0x5a8a01(0x1cc)]()[_0x5a8a01(0x1b4)]());_0x39d20f=_0x39d20f[_0x5a8a01(0x1b7)](_0x5308f4=>_0x5308f4[_0x5a8a01(0x16d)]?.[_0x5a8a01(0x15f)](_0x92b42c=>_0x5513d9[_0x5a8a01(0x189)](_0x92b42c[_0x5a8a01(0x1b4)]())));if(_0x39d20f['length']===0x0){console[_0x5a8a01(0x1dd)](a5_0x44b01b['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x16d523));const _0x289b42=new Set();return _0x25e8e8[_0x5a8a01(0x168)][_0x5a8a01(0x1b3)](_0x792510=>_0x792510[_0x5a8a01(0x16d)]?.[_0x5a8a01(0x1b3)](_0x210adc=>_0x289b42[_0x5a8a01(0x192)](_0x210adc))),_0x289b42['size']>0x0?console['log'](a5_0x44b01b[_0x5a8a01(0x182)](_0x5a8a01(0x1ee)+[..._0x289b42][_0x5a8a01(0x175)](',\x20'))):console[_0x5a8a01(0x1dd)](a5_0x44b01b['dim'](_0x5a8a01(0x16c))),0x1;}}if(_0x5dd689)return this[_0x5a8a01(0x1c9)](_0x21b8aa,{'definition':{'tests':_0x39d20f},'agentInfo':_0x290a65,'outputFormat':_0x19c328,'outputFile':_0x152782,'testNames':_0x331d17});if(_0x4b4361){console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x173)](_0x5a8a01(0x1ec))),console['log'](_0x5a8a01(0x186)+a5_0x44b01b[_0x5a8a01(0x1de)](_0x220dfb)),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x166)+a5_0x44b01b[_0x5a8a01(0x1de)](_0x290a65[_0x5a8a01(0x1ed)])),console[_0x5a8a01(0x1dd)]('\x20\x20Agent:\x20'+a5_0x44b01b[_0x5a8a01(0x1de)](_0x290a65[_0x5a8a01(0x1e6)])),console['log'](),console['log']('Tests\x20found:\x20'+a5_0x44b01b['white'](_0x39d20f[_0x5a8a01(0x1c3)]));for(let _0x3c292f=0x0;_0x3c292f<_0x39d20f[_0x5a8a01(0x1c3)];_0x3c292f++){const _0x46b2b2=_0x39d20f[_0x3c292f],_0x343633=_0x46b2b2[_0x5a8a01(0x19c)][_0x5a8a01(0x1c3)]===0x1?_0x5a8a01(0x1ac):'rounds',_0x3012ce=_0x46b2b2[_0x5a8a01(0x16d)]?.['length']?'\x20['+_0x46b2b2[_0x5a8a01(0x16d)][_0x5a8a01(0x175)](',\x20')+']':'';console['log']('\x20\x20'+(_0x3c292f+0x1)+'.\x20'+a5_0x44b01b['white'](_0x46b2b2[_0x5a8a01(0x16f)])+'\x20('+_0x46b2b2[_0x5a8a01(0x19c)]['length']+'\x20'+_0x343633+')'+a5_0x44b01b[_0x5a8a01(0x182)](_0x3012ce));}return 0x0;}let _0x4a2e81,_0x267463;try{_0x4a2e81=await _0x1df368[_0x5a8a01(0x1f3)][_0x5a8a01(0x1a3)](_0x290a65[_0x5a8a01(0x1ed)]);}catch(_0x240a4d){const _0x3d0f3e=_0x240a4d instanceof Error?_0x240a4d[_0x5a8a01(0x197)]:String(_0x240a4d);return _0x3d0f3e['includes']('404')||_0x3d0f3e[_0x5a8a01(0x1b4)]()['includes'](_0x5a8a01(0x1bc))?console['log'](a5_0x44b01b['red'](_0x5a8a01(0x1d1)+_0x290a65[_0x5a8a01(0x1ed)])):console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x1d3)](_0x5a8a01(0x1ea)+_0x290a65[_0x5a8a01(0x1ed)]+'\x22:\x20'+_0x3d0f3e)),0x1;}try{_0x267463=await _0x1df368['llm']['resolveAgentId'](_0x290a65[_0x5a8a01(0x1e6)],_0x4a2e81);}catch(_0x34eaa8){const _0x36a762=_0x34eaa8 instanceof Error?_0x34eaa8[_0x5a8a01(0x197)]:String(_0x34eaa8);return _0x36a762[_0x5a8a01(0x189)](_0x5a8a01(0x1a8))||_0x36a762[_0x5a8a01(0x1b4)]()[_0x5a8a01(0x189)]('not\x20found')?console[_0x5a8a01(0x1dd)](a5_0x44b01b['red'](_0x5a8a01(0x193)+_0x290a65[_0x5a8a01(0x1e6)])):console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x1d3)](_0x5a8a01(0x1db)+_0x290a65[_0x5a8a01(0x1e6)]+_0x5a8a01(0x188)+_0x36a762)),0x1;}let _0x8e53d7;if(!_0x335297)try{_0x8e53d7=await setupEvaluatorAgent(_0x1df368['llm'],_0x514c5f[_0x5a8a01(0x198)]);}catch(_0x83bcd1){const _0x28495d=_0x83bcd1 instanceof Error?_0x83bcd1[_0x5a8a01(0x197)]:String(_0x83bcd1);return console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x1d3)](_0x5a8a01(0x1d5)+_0x28495d)),0x1;}console['log'](a5_0x44b01b[_0x5a8a01(0x173)](_0x5a8a01(0x1dc))),console[_0x5a8a01(0x1dd)]('Site:\x20'+a5_0x44b01b['white'](_0x220dfb)),console['log'](_0x5a8a01(0x1be)+a5_0x44b01b[_0x5a8a01(0x1de)](_0x290a65[_0x5a8a01(0x1ed)]+'/'+_0x290a65['agentName'])),console['log']();const _0x4657f0=[],_0x25ea48=[],_0x2e6f78=Date[_0x5a8a01(0x1e1)]();for(let _0x92355e=0x0;_0x92355e<_0x39d20f[_0x5a8a01(0x1c3)];_0x92355e++){const _0x157e16=_0x39d20f[_0x92355e];_0x39d20f[_0x5a8a01(0x1c3)]>0x1?console[_0x5a8a01(0x1dd)]('Test\x20'+(_0x92355e+0x1)+'/'+_0x39d20f[_0x5a8a01(0x1c3)]+':\x20'+a5_0x44b01b[_0x5a8a01(0x1de)](_0x157e16['name'])):console['log'](_0x5a8a01(0x1c0)+a5_0x44b01b[_0x5a8a01(0x1de)](_0x157e16[_0x5a8a01(0x16f)]));const _0x5e5fe8=createCommandSpinner(_0x5a8a01(0x190)+_0x157e16[_0x5a8a01(0x19c)][_0x5a8a01(0x1c3)]+':\x20Sending\x20user\x20input...');_0x5e5fe8['start']();try{const {result:_0x9fc090,conversation:_0x371c88}=await runTest(_0x1df368[_0x5a8a01(0x1f3)],_0x157e16,{'agentId':_0x267463,'projectId':_0x4a2e81,'site':_0x220dfb,'noEval':_0x335297,'evaluatorId':_0x8e53d7,'onRoundStart':(_0x1c43b6,_0x5d4907)=>{const _0x3bd966=_0x5a8a01;_0x5e5fe8[_0x3bd966(0x183)]=_0x3bd966(0x17f)+(_0x1c43b6+0x1)+'/'+_0x5d4907+_0x3bd966(0x169);},'onRoundComplete':(_0x25d6a7,_0x58b9db,_0xaed4a0)=>{const _0xadfaa=_0x5a8a01,_0x35d6ac=formatElapsed(_0x58b9db);_0xaed4a0?console[_0xadfaa(0x1dd)](_0xadfaa(0x177)+(_0x25d6a7+0x1)+'/'+_0x157e16[_0xadfaa(0x19c)][_0xadfaa(0x1c3)]+_0xadfaa(0x1a6)+a5_0x44b01b[_0xadfaa(0x1df)]('✓')+'\x20('+_0x35d6ac+')'):console[_0xadfaa(0x1dd)](_0xadfaa(0x177)+(_0x25d6a7+0x1)+'/'+_0x157e16[_0xadfaa(0x19c)][_0xadfaa(0x1c3)]+_0xadfaa(0x1a6)+a5_0x44b01b[_0xadfaa(0x1d3)]('✗'));},'onEvaluationStart':()=>{const _0x4af42c=_0x5a8a01;_0x5e5fe8[_0x4af42c(0x183)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4142bd=>{const _0x28d004=_0x5a8a01,_0x4b70dd=formatElapsed(_0x4142bd);console[_0x28d004(0x1dd)](_0x28d004(0x1c8)+a5_0x44b01b[_0x28d004(0x1df)]('✓')+'\x20('+_0x4b70dd+')');}});_0x5e5fe8[_0x5a8a01(0x178)](),_0x4657f0['push'](_0x9fc090),_0x25ea48['push'](_0x371c88);if(_0x9fc090[_0x5a8a01(0x1cf)]===_0x5a8a01(0x1bd))console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x1df)]('✓\x20PASS:\x20'+_0x9fc090[_0x5a8a01(0x17e)]));else _0x9fc090[_0x5a8a01(0x1cf)]==='FAIL'?console['log'](a5_0x44b01b[_0x5a8a01(0x1d3)](_0x5a8a01(0x19b)+_0x9fc090['reason'])):console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x1d3)](_0x5a8a01(0x19f)+_0x9fc090[_0x5a8a01(0x17e)]));_0x9fc090[_0x5a8a01(0x1c4)]&&console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x182)]('Conversation\x20URL:\x20'+_0x9fc090[_0x5a8a01(0x1c4)])),console['log']();}catch(_0x5d342d){_0x5e5fe8[_0x5a8a01(0x178)]();const _0x567901=_0x5d342d instanceof Error?_0x5d342d[_0x5a8a01(0x197)]:String(_0x5d342d);console[_0x5a8a01(0x1dd)](a5_0x44b01b['red'](_0x5a8a01(0x19f)+_0x567901)),console[_0x5a8a01(0x1dd)](),_0x4657f0['push']({'name':_0x157e16[_0x5a8a01(0x16f)],'status':'ERROR','reason':_0x567901,'timestamp':new Date()[_0x5a8a01(0x1ab)](),'duration_ms':0x0});}}const _0x4eebb3=Date[_0x5a8a01(0x1e1)]()-_0x2e6f78,_0x488166=_0x4657f0['filter'](_0x520d4e=>_0x520d4e[_0x5a8a01(0x1cf)]===_0x5a8a01(0x1bd))[_0x5a8a01(0x1c3)],_0x36d74c=_0x4657f0[_0x5a8a01(0x1b7)](_0x509dc5=>_0x509dc5['status']===_0x5a8a01(0x161))[_0x5a8a01(0x1c3)],_0x80431e=_0x4657f0[_0x5a8a01(0x1b7)](_0xe2c20d=>_0xe2c20d[_0x5a8a01(0x1cf)]==='ERROR')[_0x5a8a01(0x1c3)];console[_0x5a8a01(0x1dd)]('━'[_0x5a8a01(0x1f7)](0x3c)),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1a2)),console[_0x5a8a01(0x1dd)]('━'['repeat'](0x3c)),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1e8)+_0x4657f0[_0x5a8a01(0x1c3)]),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x163)+a5_0x44b01b[_0x5a8a01(0x1df)](_0x488166)),console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1c7)+a5_0x44b01b['red'](_0x36d74c));_0x80431e>0x0&&console[_0x5a8a01(0x1dd)](_0x5a8a01(0x1b6)+a5_0x44b01b['red'](_0x80431e));console['log']('Duration:\x20'+formatElapsed(_0x4eebb3)),console[_0x5a8a01(0x1dd)]('━'[_0x5a8a01(0x1f7)](0x3c));const _0x20ccb4=_0x4657f0['filter'](_0x1b2d63=>_0x1b2d63[_0x5a8a01(0x1cf)]!==_0x5a8a01(0x1bd));if(_0x20ccb4['length']>0x0){console[_0x5a8a01(0x1dd)](),console['log']('Failed\x20Tests:');for(const _0x571157 of _0x20ccb4){const _0x2f53da=a5_0x44b01b['red']('✗'),_0x2ebb1e=_0x571157[_0x5a8a01(0x17e)][_0x5a8a01(0x1c3)]>0x32?_0x571157['reason'][_0x5a8a01(0x1b9)](0x0,0x32)+_0x5a8a01(0x176):_0x571157[_0x5a8a01(0x17e)];console[_0x5a8a01(0x1dd)]('\x20\x20'+_0x2f53da+'\x20'+_0x571157[_0x5a8a01(0x16f)]+':\x20'+_0x2ebb1e);}}const _0x48ef4f={'summary':{'total':_0x4657f0['length'],'passed':_0x488166,'failed':_0x36d74c,'errors':_0x80431e>0x0?_0x80431e:undefined,'duration_ms':_0x4eebb3},'tests':_0x4657f0,'agent':{'project':_0x290a65['projectName'],'name':_0x290a65[_0x5a8a01(0x1e6)],'site':_0x220dfb},'timestamp':new Date(_0x2e6f78)[_0x5a8a01(0x1ab)]()};try{const _0x1b87a5=buildCachedTestRun(_0x25ea48,{'site':_0x220dfb,'projectId':_0x4a2e81,'projectName':_0x290a65[_0x5a8a01(0x1ed)],'agentId':_0x267463,'agentName':_0x290a65['agentName'],'testYmlPath':a5_0x55094e[_0x5a8a01(0x160)](_0x290a65[_0x5a8a01(0x1d2)])});saveLastTestRun(_0x1b87a5);}catch{}if(_0x19c328!=='table'||_0x152782){const _0x512b69=formatResults(_0x48ef4f,_0x19c328);if(_0x152782)try{a5_0x459af4[_0x5a8a01(0x191)](_0x152782,_0x512b69,_0x5a8a01(0x1f2)),console['log'](),console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x182)]('Output\x20written\x20to:\x20'+_0x152782));}catch(_0x250f5c){return console[_0x5a8a01(0x1dd)](),console[_0x5a8a01(0x1dd)](a5_0x44b01b[_0x5a8a01(0x1d3)](_0x5a8a01(0x1f6)+_0x250f5c)),0x1;}else console[_0x5a8a01(0x1dd)](),console[_0x5a8a01(0x1dd)](_0x512b69);}return _0x20ccb4['length']>0x0?0x1:0x0;}async[a5_0x14c650(0x1c9)](_0x1bb2af,_0x2c7d3c){const _0x5a2df6=a5_0x14c650,{options:_0x5bc169,tdx:_0x25c166}=_0x1bb2af,{definition:_0x5e0302,agentInfo:_0x5a7833,outputFormat:_0x3bf4b6,outputFile:_0x1ecf69}=_0x2c7d3c,_0x5ed40d=_0x5bc169[_0x5a2df6(0x17c)],_0x55a5b=loadLastTestRun();if(!_0x55a5b)return console[_0x5a2df6(0x1dd)](a5_0x44b01b['red'](_0x5a2df6(0x1a7))),console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x182)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x55a5b[_0x5a2df6(0x1d6)][_0x5a2df6(0x1e6)]!==_0x5a7833['agentName'])return console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x1d3)](_0x5a2df6(0x1d4)+_0x55a5b['agent'][_0x5a2df6(0x1e6)]+_0x5a2df6(0x1d7)+_0x5a7833['agentName']+'\x22.')),console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x182)](_0x5a2df6(0x1b8))),0x1;const _0xb5bddd=new Set(_0x55a5b[_0x5a2df6(0x187)][_0x5a2df6(0x1a0)](_0x750cec=>_0x750cec[_0x5a2df6(0x162)])),_0x1faa4c=_0x5e0302[_0x5a2df6(0x168)]['filter'](_0x5479ec=>!_0xb5bddd[_0x5a2df6(0x199)](_0x5479ec[_0x5a2df6(0x16f)]));if(_0x1faa4c['length']>0x0&&_0x55a5b[_0x5a2df6(0x17c)]!==_0x5ed40d)return console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x1d3)](_0x5a2df6(0x18b))),console['log'](a5_0x44b01b[_0x5a2df6(0x182)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x55a5b[_0x5a2df6(0x17c)]+_0x5a2df6(0x19d)+_0x5ed40d+'\x22.')),console[_0x5a2df6(0x1dd)](a5_0x44b01b['dim'](_0x5a2df6(0x1b0)+_0x55a5b[_0x5a2df6(0x17c)]+_0x5a2df6(0x1e5))),0x1;const _0x4e111f=_0x5e0302['tests']['filter'](_0x87fe18=>_0xb5bddd[_0x5a2df6(0x199)](_0x87fe18['name'])),_0x12765a=_0x1faa4c;let _0x17880e;try{_0x17880e=await setupEvaluatorAgent(_0x25c166['llm'],_0x5bc169[_0x5a2df6(0x198)]);}catch(_0x4b280a){const _0x36b5b0=_0x4b280a instanceof Error?_0x4b280a[_0x5a2df6(0x197)]:String(_0x4b280a);return console['log'](a5_0x44b01b[_0x5a2df6(0x1d3)](_0x5a2df6(0x1d5)+_0x36b5b0)),0x1;}console['log'](a5_0x44b01b[_0x5a2df6(0x173)](_0x5a2df6(0x18d))),console[_0x5a2df6(0x1dd)](_0x5a2df6(0x1a4)+a5_0x44b01b[_0x5a2df6(0x1de)](_0x55a5b[_0x5a2df6(0x16b)])),console['log']('Agent:\x20'+a5_0x44b01b[_0x5a2df6(0x1de)](_0x55a5b[_0x5a2df6(0x1d6)][_0x5a2df6(0x1ed)]+'/'+_0x55a5b[_0x5a2df6(0x1d6)][_0x5a2df6(0x1e6)]));_0x12765a['length']>0x0&&console[_0x5a2df6(0x1dd)]('New\x20tests\x20to\x20execute:\x20'+a5_0x44b01b[_0x5a2df6(0x185)](_0x12765a[_0x5a2df6(0x1c3)]));console[_0x5a2df6(0x1dd)]();const _0x86b8f7=[],_0x4a04e0=Date[_0x5a2df6(0x1e1)](),_0x2294d6=createCommandSpinner('Re-evaluating...');if(_0x4e111f['length']>0x0)try{const _0xe38320=await reevaluateFromCache(_0x25c166['llm'],_0x55a5b,{'tests':_0x4e111f},{'evaluatorId':_0x17880e,'onTestStart':(_0x3d55c3,_0x32ec0c,_0x3603da)=>{const _0x2fe18b=_0x5a2df6;_0x2294d6[_0x2fe18b(0x183)]=_0x2fe18b(0x1e0)+(_0x32ec0c+0x1)+'/'+_0x3603da+':\x20'+_0x3d55c3+_0x2fe18b(0x176);if(!_0x2294d6[_0x2fe18b(0x18f)])_0x2294d6[_0x2fe18b(0x1c6)]();},'onTestComplete':(_0x52f865,_0x451660)=>{const _0x24bad7=_0x5a2df6;_0x2294d6[_0x24bad7(0x178)]();if(_0x451660[_0x24bad7(0x1cf)]==='PASS')console['log'](a5_0x44b01b['green'](_0x24bad7(0x1d8)+_0x52f865)+a5_0x44b01b['dim'](_0x24bad7(0x17a)));else _0x451660[_0x24bad7(0x1cf)]===_0x24bad7(0x161)?console[_0x24bad7(0x1dd)](a5_0x44b01b[_0x24bad7(0x1d3)](_0x24bad7(0x19b)+_0x52f865+'\x20-\x20'+_0x451660[_0x24bad7(0x17e)])+a5_0x44b01b[_0x24bad7(0x182)]('\x20(cached)')):console[_0x24bad7(0x1dd)](a5_0x44b01b[_0x24bad7(0x1d3)](_0x24bad7(0x19f)+_0x52f865+_0x24bad7(0x1b1)+_0x451660[_0x24bad7(0x17e)]));_0x451660['conversation_url']&&console[_0x24bad7(0x1dd)](a5_0x44b01b[_0x24bad7(0x182)](_0x24bad7(0x195)+_0x451660[_0x24bad7(0x1c4)])),_0x86b8f7[_0x24bad7(0x19e)](_0x451660);},'onTestSkipped':(_0x19ca3b,_0x494968)=>{const _0x5cbfea=_0x5a2df6;_0x2294d6[_0x5cbfea(0x178)](),console[_0x5cbfea(0x1dd)](a5_0x44b01b[_0x5cbfea(0x185)](_0x5cbfea(0x18a)+_0x19ca3b+_0x5cbfea(0x1b1)+_0x494968));}});for(const _0x405df1 of _0xe38320){!_0x86b8f7[_0x5a2df6(0x1f5)](_0x323ec1=>_0x323ec1[_0x5a2df6(0x16f)]===_0x405df1[_0x5a2df6(0x16f)])&&_0x86b8f7[_0x5a2df6(0x19e)](_0x405df1);}}catch(_0x2c6fd7){_0x2294d6[_0x5a2df6(0x178)]();const _0x1a5230=_0x2c6fd7 instanceof Error?_0x2c6fd7[_0x5a2df6(0x197)]:String(_0x2c6fd7);return console[_0x5a2df6(0x1dd)](a5_0x44b01b['red'](_0x5a2df6(0x1f1)+_0x1a5230)),0x1;}_0x2294d6['stop']();if(_0x12765a[_0x5a2df6(0x1c3)]>0x0){console[_0x5a2df6(0x1dd)](),console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x173)]('Executing\x20new\x20tests...'));const {projectId:_0x3228a8,agentId:_0x2389d3}=_0x55a5b[_0x5a2df6(0x1d6)];for(const _0x1a0cca of _0x12765a){console[_0x5a2df6(0x1dd)](_0x5a2df6(0x17d)+a5_0x44b01b[_0x5a2df6(0x1de)](_0x1a0cca[_0x5a2df6(0x16f)]));const _0x558fad=createCommandSpinner('Round\x201/'+_0x1a0cca[_0x5a2df6(0x19c)][_0x5a2df6(0x1c3)]+_0x5a2df6(0x169));_0x558fad[_0x5a2df6(0x1c6)]();try{const {result:_0x446718}=await runTest(_0x25c166[_0x5a2df6(0x1f3)],_0x1a0cca,{'agentId':_0x2389d3,'projectId':_0x3228a8,'site':_0x55a5b[_0x5a2df6(0x17c)],'noEval':![],'evaluatorId':_0x17880e,'onRoundStart':(_0xbdd05f,_0x1a7f09)=>{const _0x96b372=_0x5a2df6;_0x558fad[_0x96b372(0x183)]=_0x96b372(0x17f)+(_0xbdd05f+0x1)+'/'+_0x1a7f09+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x374cf2,_0x4e335d,_0x426ce4)=>{const _0x48bda3=_0x5a2df6,_0x1cd7a4=formatElapsed(_0x4e335d);_0x426ce4?console[_0x48bda3(0x1dd)](_0x48bda3(0x177)+(_0x374cf2+0x1)+'/'+_0x1a0cca[_0x48bda3(0x19c)][_0x48bda3(0x1c3)]+_0x48bda3(0x1a6)+a5_0x44b01b[_0x48bda3(0x1df)]('✓')+'\x20('+_0x1cd7a4+')'):console['log'](_0x48bda3(0x177)+(_0x374cf2+0x1)+'/'+_0x1a0cca[_0x48bda3(0x19c)][_0x48bda3(0x1c3)]+_0x48bda3(0x1a6)+a5_0x44b01b['red']('✗'));},'onEvaluationStart':()=>{const _0xff6170=_0x5a2df6;_0x558fad[_0xff6170(0x183)]=_0xff6170(0x1e7);},'onEvaluationComplete':_0xac6ba4=>{const _0x1daef3=_0x5a2df6,_0x3c7fa3=formatElapsed(_0xac6ba4);console[_0x1daef3(0x1dd)](_0x1daef3(0x1c8)+a5_0x44b01b[_0x1daef3(0x1df)]('✓')+'\x20('+_0x3c7fa3+')');}});_0x558fad[_0x5a2df6(0x178)](),_0x86b8f7[_0x5a2df6(0x19e)](_0x446718);if(_0x446718[_0x5a2df6(0x1cf)]===_0x5a2df6(0x1bd))console['log'](a5_0x44b01b['green'](_0x5a2df6(0x1d8)+_0x446718[_0x5a2df6(0x17e)])+a5_0x44b01b['dim'](_0x5a2df6(0x19a)));else _0x446718[_0x5a2df6(0x1cf)]===_0x5a2df6(0x161)?console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x1d3)]('✗\x20FAIL:\x20'+_0x446718[_0x5a2df6(0x17e)])+a5_0x44b01b[_0x5a2df6(0x182)](_0x5a2df6(0x19a))):console[_0x5a2df6(0x1dd)](a5_0x44b01b['red']('✗\x20ERROR:\x20'+_0x446718[_0x5a2df6(0x17e)]));_0x446718[_0x5a2df6(0x1c4)]&&console['log'](a5_0x44b01b[_0x5a2df6(0x182)](_0x5a2df6(0x195)+_0x446718[_0x5a2df6(0x1c4)]));}catch(_0x2c9e86){_0x558fad[_0x5a2df6(0x178)]();const _0x83ef2f=_0x2c9e86 instanceof Error?_0x2c9e86[_0x5a2df6(0x197)]:String(_0x2c9e86);console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x1d3)](_0x5a2df6(0x19f)+_0x83ef2f)),_0x86b8f7[_0x5a2df6(0x19e)]({'name':_0x1a0cca[_0x5a2df6(0x16f)],'status':'ERROR','reason':_0x83ef2f,'timestamp':new Date()[_0x5a2df6(0x1ab)](),'duration_ms':0x0});}}}console[_0x5a2df6(0x1dd)]();const _0x48acf2=Date[_0x5a2df6(0x1e1)]()-_0x4a04e0,_0xd0a582=_0x86b8f7[_0x5a2df6(0x1b7)](_0x170b5f=>_0x170b5f[_0x5a2df6(0x1cf)]===_0x5a2df6(0x1bd))['length'],_0x514199=_0x86b8f7[_0x5a2df6(0x1b7)](_0x27ea78=>_0x27ea78[_0x5a2df6(0x1cf)]===_0x5a2df6(0x161))[_0x5a2df6(0x1c3)],_0x2a86a9=_0x86b8f7['filter'](_0xa66ecc=>_0xa66ecc[_0x5a2df6(0x1cf)]===_0x5a2df6(0x1ce))[_0x5a2df6(0x1c3)];console['log']('━'[_0x5a2df6(0x1f7)](0x3c)),console[_0x5a2df6(0x1dd)]('Re-evaluation\x20Summary'),console['log']('━'['repeat'](0x3c)),console[_0x5a2df6(0x1dd)](_0x5a2df6(0x1e8)+_0x86b8f7[_0x5a2df6(0x1c3)]),console[_0x5a2df6(0x1dd)](_0x5a2df6(0x163)+a5_0x44b01b[_0x5a2df6(0x1df)](_0xd0a582)),console[_0x5a2df6(0x1dd)]('Failed:\x20\x20\x20'+a5_0x44b01b['red'](_0x514199));_0x2a86a9>0x0&&console['log'](_0x5a2df6(0x1b6)+a5_0x44b01b[_0x5a2df6(0x1d3)](_0x2a86a9));console[_0x5a2df6(0x1dd)](_0x5a2df6(0x167)+formatElapsed(_0x48acf2)),console[_0x5a2df6(0x1dd)]('━'[_0x5a2df6(0x1f7)](0x3c));const _0x3ed748={'summary':{'total':_0x86b8f7[_0x5a2df6(0x1c3)],'passed':_0xd0a582,'failed':_0x514199,'errors':_0x2a86a9>0x0?_0x2a86a9:undefined,'duration_ms':_0x48acf2},'tests':_0x86b8f7,'agent':{'project':_0x5a7833[_0x5a2df6(0x1ed)],'name':_0x5a7833[_0x5a2df6(0x1e6)],'site':_0x5ed40d},'timestamp':new Date(_0x4a04e0)['toISOString']()};if(_0x3bf4b6!==_0x5a2df6(0x1f0)||_0x1ecf69){const _0x12c2fd=formatResults(_0x3ed748,_0x3bf4b6);if(_0x1ecf69)try{a5_0x459af4['writeFileSync'](_0x1ecf69,_0x12c2fd,'utf-8'),console[_0x5a2df6(0x1dd)](),console['log'](a5_0x44b01b['dim'](_0x5a2df6(0x1e9)+_0x1ecf69));}catch(_0x131cda){return console['log'](),console[_0x5a2df6(0x1dd)](a5_0x44b01b[_0x5a2df6(0x1d3)](_0x5a2df6(0x1f6)+_0x131cda)),0x1;}else console['log'](),console[_0x5a2df6(0x1dd)](_0x12c2fd);}const _0x27860e=_0x86b8f7[_0x5a2df6(0x1b7)](_0x3bab88=>_0x3bab88[_0x5a2df6(0x1cf)]!==_0x5a2df6(0x1bd));return _0x27860e[_0x5a2df6(0x1c3)]>0x0?0x1:0x0;}}function a5_0x1fbd(){const _0x154cf9=['6449790hpwWNc','timestamp','No\x20tests\x20have\x20tags\x20defined.','tags','llmProject','name','test.yml','887912bHXSTA','501yFReUo','cyan','no_tests','join','...','\x20\x20Round\x20','stop','\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)','multiple_agents','site','Running:\x20','reason','Round\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','143374TEnpCq','dim','text','agent:test','yellow','\x20\x20Site:\x20','conversations','\x22:\x20','includes','⚠\x20SKIPPED:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','reeval','Re-evaluating\x20cached\x20test\x20run...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','isSpinning','Round\x201/','writeFileSync','add','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','9ojUhPF','\x20\x20Conversation:\x20','5704mwjYJk','message','verbose','has','\x20(new)','✗\x20FAIL:\x20','rounds','\x22,\x20but\x20current\x20site\x20is\x20\x22','push','✗\x20ERROR:\x20','map','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Test\x20Summary','resolveProjectId','Cached\x20run\x20from:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','...\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','404','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Usage:','toISOString','round','4430514hizdmy','2412492ITdSto','no_context','Either\x20switch\x20to\x20the\x20\x22','\x20-\x20','context','forEach','toLowerCase','basename','Errors:\x20\x20\x20','filter','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','substring','source','json','not\x20found','PASS','Agent:\x20','1270045VCFNjr','Running\x20test:\x20','7udKoVs','projectDir','length','conversation_url','no_local_folder','start','Failed:\x20\x20\x20','\x20\x20Evaluating...\x20','executeReeval','/<agent-name>','11vWKBcw','trim','split','ERROR','status','jsonl','✗\x20ERROR:\x20Project\x20not\x20found:\x20','testYmlPath','red','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agent','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','✓\x20PASS:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','tsv','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Running\x20agent\x20tests...','log','white','green','Re-evaluating\x20','now','5vQzTDl','91ZBVAbW','output','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','agentName','Evaluating\x20response...','Total:\x20\x20\x20\x20','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agentDirs','Test\x20Configuration:','projectName','Available\x20tags:\x20','execute','table','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','utf-8','llm','\x20\x20-\x20','find','Error\x20writing\x20output\x20file:\x20','repeat','some','resolve','FAIL','testName','Passed:\x20\x20\x20','existsSync','Available\x20tests:\x20','\x20\x20Project:\x20','Duration:\x20','tests',':\x20Sending\x20user\x20input...'];a5_0x1fbd=function(){return _0x154cf9;};return a5_0x1fbd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x1096d0=a6_0x7f8b;(function(_0x168874,_0x74c000){const _0x1db648=a6_0x7f8b,_0xc0148=_0x168874();while(!![]){try{const _0x2154e9=parseInt(_0x1db648(0xb3))/0x1+-parseInt(_0x1db648(0xcc))/0x2*(parseInt(_0x1db648(0xe8))/0x3)+-parseInt(_0x1db648(0xe7))/0x4*(parseInt(_0x1db648(0xe1))/0x5)+-parseInt(_0x1db648(0xe9))/0x6*(parseInt(_0x1db648(0xb1))/0x7)+-parseInt(_0x1db648(0xd8))/0x8+parseInt(_0x1db648(0xce))/0x9*(parseInt(_0x1db648(0xd3))/0xa)+parseInt(_0x1db648(0xe6))/0xb;if(_0x2154e9===_0x74c000)break;else _0xc0148['push'](_0xc0148['shift']());}catch(_0x281494){_0xc0148['push'](_0xc0148['shift']());}}}(a6_0x5a31,0x627ad));import{BaseCommand}from'./command.js';function a6_0x7f8b(_0x8f59f7,_0x29bc69){_0x8f59f7=_0x8f59f7-0xad;const _0x5a3179=a6_0x5a31();let _0x7f8b7d=_0x5a3179[_0x8f59f7];return _0x7f8b7d;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x1096d0(0xdd),a6_0x1096d0(0xb6),a6_0x1096d0(0xc5),'set-cookie','set-cookie2',a6_0x1096d0(0xae),'x-auth-token','x-trino-user']);function isSensitiveHeader(_0x1a2eeb){return SENSITIVE_HEADERS['has'](_0x1a2eeb['toLowerCase']());}function parseHeader(_0x448039){const _0x574a17=a6_0x1096d0,_0x40b5c4=_0x448039[_0x574a17(0xdb)](':');if(_0x40b5c4===-0x1)throw new Error(_0x574a17(0xd5)+_0x448039+_0x574a17(0xe2)+_0x574a17(0xd9));const _0x460b9a=_0x448039['substring'](0x0,_0x40b5c4)[_0x574a17(0xed)](),_0x1334d2=_0x448039[_0x574a17(0xd1)](_0x40b5c4+0x1)['trim']();if(!_0x460b9a)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x448039+'\x22');return[_0x460b9a,_0x1334d2];}function a6_0x5a31(){const _0x1dfe38=['Error:\x20','<\x20HTTP/1.1\x20','noColor','12493811ilHgUU','931892UHSDcu','76086LbGmxR','66rbdgBY','isArray','data','PUT','trim','header','llm','x-xsrf-token','headers','error','450611HhpZef','Endpoint\x20must\x20start\x20with\x20/:\x20','393151rXreRt','DELETE','.\x20Valid\x20methods:\x20','proxy-authorization','workflow','.\x20Valid\x20types:\x20','includes','GET','method','execute','color','Invalid\x20API\x20type:\x20','description','Invalid\x20HTTP\x20method:\x20','stack','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','message','log','cookie','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','trino','PATCH','status','validate','entries','4bhxtkx','POST','522XsMAYQ','output','verbose','substring','type','75540ZTYFvH','\x0aStack\x20trace:\x0a','Invalid\x20header\x20format:\x20\x22','api','readBodyFromFile','4575288qcLcGq','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Results\x20saved\x20to\x20','indexOf','file','authorization','name','toUpperCase','join','5RaWBgg','\x22.\x20'];a6_0x5a31=function(){return _0x1dfe38;};return a6_0x5a31();}export class ApiCommand extends BaseCommand{[a6_0x1096d0(0xde)]=a6_0x1096d0(0xd6);[a6_0x1096d0(0xbf)]=a6_0x1096d0(0xc2);[a6_0x1096d0(0xca)](_0xf996ed){const _0x2940ab=a6_0x1096d0,{args:_0x20777e,options:_0x5aca05}=_0xf996ed,_0x2123da=_0x5aca05;if(_0x20777e['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x45cccd=_0x20777e[0x0];if(!_0x45cccd['startsWith']('/'))return _0x2940ab(0xb2)+_0x45cccd;const _0x4fad7d=_0x2123da[_0x2940ab(0xeb)],_0x10d2b7=_0x2123da[_0x2940ab(0xdc)];if(_0x4fad7d&&_0x10d2b7)return _0x2940ab(0xc6);const _0x5c2217=_0x2123da[_0x2940ab(0xbb)]||_0x2940ab(0xba),_0x3d2907=['GET',_0x2940ab(0xcd),_0x2940ab(0xec),_0x2940ab(0xb4),_0x2940ab(0xc8)];if(!_0x3d2907['includes'](_0x5c2217[_0x2940ab(0xdf)]()))return _0x2940ab(0xc0)+_0x5c2217+_0x2940ab(0xb5)+_0x3d2907['join'](',\x20');const _0x4d094f=_0x2123da[_0x2940ab(0xd2)]||'td',_0x56acca=['td','cdp',_0x2940ab(0xb7),_0x2940ab(0xc7),_0x2940ab(0xad),'llm-proxy'];if(!_0x56acca[_0x2940ab(0xb9)](_0x4d094f))return _0x2940ab(0xbe)+_0x4d094f+_0x2940ab(0xb8)+_0x56acca[_0x2940ab(0xe0)](',\x20');return undefined;}async[a6_0x1096d0(0xbc)](_0x532984){const _0x1f8b5c=a6_0x1096d0,{options:_0x5451c8,args:_0x117dd9,tdx:_0x9ab1ee}=_0x532984,_0x296879=_0x5451c8,_0xf332db=_0x117dd9[0x0],_0x110354=(_0x296879[_0x1f8b5c(0xbb)]||_0x1f8b5c(0xba))[_0x1f8b5c(0xdf)](),_0x44e4e5=_0x296879['data'],_0x2cef12=_0x296879[_0x1f8b5c(0xdc)],_0x244f9b=_0x296879[_0x1f8b5c(0xee)],_0x28642e=_0x296879[_0x1f8b5c(0xd2)]||'td';try{const _0x1ccd42={};if(_0x244f9b){const _0xd7edf=Array[_0x1f8b5c(0xea)](_0x244f9b)?_0x244f9b:[_0x244f9b];for(const _0x114ce7 of _0xd7edf){const [_0x245eca,_0x5c0e64]=parseHeader(_0x114ce7);_0x1ccd42[_0x245eca]=_0x5c0e64;}}let _0x3796ca;if(_0x44e4e5)_0x3796ca=_0x44e4e5;else{if(_0x2cef12)try{_0x3796ca=RawAPI[_0x1f8b5c(0xd7)](_0x2cef12);}catch(_0x148d58){return console[_0x1f8b5c(0xb0)](_0x1f8b5c(0xe3)+(_0x148d58 instanceof Error?_0x148d58[_0x1f8b5c(0xc3)]:String(_0x148d58))),0x1;}}const _0x221d5e={'method':_0x110354,'apiType':_0x28642e,'includeHeaders':_0x5451c8[_0x1f8b5c(0xd0)]};_0x3796ca&&(_0x221d5e['body']=_0x3796ca);Object['keys'](_0x1ccd42)['length']>0x0&&(_0x221d5e[_0x1f8b5c(0xaf)]=_0x1ccd42);if(_0x5451c8[_0x1f8b5c(0xd0)]){const _0x4059f7=resolveSite(_0x5451c8['site']),_0x52ec02=getEndpoint(_0x4059f7,_0x28642e),_0x1a7e20=''+_0x52ec02+_0xf332db;console[_0x1f8b5c(0xb0)]('>\x20'+_0x110354+'\x20'+_0x1a7e20);const _0x41472e=getAuthHeaders(_0x4059f7),_0x1095fc={..._0x41472e,..._0x1ccd42};for(const [_0xafd818,_0x4ed053]of Object[_0x1f8b5c(0xcb)](_0x1095fc)){!isSensitiveHeader(_0xafd818)&&console[_0x1f8b5c(0xb0)]('>\x20'+_0xafd818+':\x20'+_0x4ed053);}_0x3796ca&&console[_0x1f8b5c(0xb0)]('>'),console[_0x1f8b5c(0xb0)]('');}const _0x2aff91=await _0x9ab1ee[_0x1f8b5c(0xd6)]['request'](_0xf332db,_0x221d5e);if(_0x5451c8[_0x1f8b5c(0xd0)]&&_0x2aff91[_0x1f8b5c(0xaf)]){console[_0x1f8b5c(0xb0)](_0x1f8b5c(0xe4)+_0x2aff91[_0x1f8b5c(0xc9)]);for(const [_0x5f294f,_0x166328]of Object['entries'](_0x2aff91[_0x1f8b5c(0xaf)])){!isSensitiveHeader(_0x5f294f)&&console[_0x1f8b5c(0xb0)]('<\x20'+_0x5f294f+':\x20'+_0x166328);}console['error']('');}const _0x265f2a=Boolean(_0x5451c8[_0x1f8b5c(0xcf)]),_0x35162b={'color':_0x5451c8[_0x1f8b5c(0xbd)],'noColor':_0x5451c8[_0x1f8b5c(0xe5)]||_0x265f2a&&!_0x5451c8[_0x1f8b5c(0xbd)]},_0x102660=colorizeJSON(_0x2aff91[_0x1f8b5c(0xeb)],_0x35162b);return _0x5451c8['output']?(writeFileSync(_0x5451c8['output'],_0x102660),console['error'](_0x1f8b5c(0xda)+_0x5451c8[_0x1f8b5c(0xcf)])):console[_0x1f8b5c(0xc4)](_0x102660),0x0;}catch(_0x1a3dd7){return _0x1a3dd7 instanceof Error?(console[_0x1f8b5c(0xb0)](_0x1f8b5c(0xe3)+_0x1a3dd7[_0x1f8b5c(0xc3)]),_0x5451c8[_0x1f8b5c(0xd0)]&&_0x1a3dd7[_0x1f8b5c(0xc1)]&&console[_0x1f8b5c(0xb0)](_0x1f8b5c(0xd4)+_0x1a3dd7[_0x1f8b5c(0xc1)])):console[_0x1f8b5c(0xb0)]('Error:\x20'+String(_0x1a3dd7)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a7_0x34f7(_0xb1e3bc,_0x1f6cc4){_0xb1e3bc=_0xb1e3bc-0x18c;const _0x1ab1c4=a7_0x1ab1();let _0x34f7be=_0x1ab1c4[_0xb1e3bc];return _0x34f7be;}const a7_0x56d7d7=a7_0x34f7;(function(_0x3d74af,_0xbdfd65){const _0x2d679c=a7_0x34f7,_0x2a8027=_0x3d74af();while(!![]){try{const _0x452ec2=-parseInt(_0x2d679c(0x1ba))/0x1+parseInt(_0x2d679c(0x1c1))/0x2*(-parseInt(_0x2d679c(0x1b3))/0x3)+parseInt(_0x2d679c(0x1bd))/0x4+-parseInt(_0x2d679c(0x1d7))/0x5+-parseInt(_0x2d679c(0x1d5))/0x6*(-parseInt(_0x2d679c(0x1d3))/0x7)+parseInt(_0x2d679c(0x1cb))/0x8+-parseInt(_0x2d679c(0x1b1))/0x9*(-parseInt(_0x2d679c(0x1d1))/0xa);if(_0x452ec2===_0xbdfd65)break;else _0x2a8027['push'](_0x2a8027['shift']());}catch(_0x26a717){_0x2a8027['push'](_0x2a8027['shift']());}}}(a7_0x1ab1,0xb4579));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';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x56c1a8 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_0x281652 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x56d7d7(0x18f)]=a7_0x56d7d7(0x1c8);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x23be9c){const _0x4cfee7=a7_0x56d7d7,{options:_0x5e3084}=_0x23be9c,_0x5d2d90=_0x5e3084[_0x4cfee7(0x198)];console['log'](a7_0x281652[_0x4cfee7(0x196)]('tdx:\x20auth\x20setup'));const _0x52044d=_0x5e3084[_0x4cfee7(0x1a8)]||_0x4cfee7(0x1ac),_0x16aaa3=await promptSiteSelection(_0x52044d,_0x5d2d90,_0x4cfee7(0x18c));if(!_0x16aaa3)return 0x1;const _0x5a14b9=resolveSite(_0x16aaa3);if(isOAuthSupported(_0x5a14b9)){const _0x595279=await a7_0x56c1a8({'type':_0x4cfee7(0x1be),'name':'method','message':'Choose\x20authentication\x20method:','choices':[{'title':_0x4cfee7(0x1a1),'value':_0x4cfee7(0x1a4)},{'title':_0x4cfee7(0x1a0),'value':_0x4cfee7(0x1d0)}]});if(!_0x595279[_0x4cfee7(0x19e)])return console[_0x4cfee7(0x18e)](_0x4cfee7(0x1a9)),0x1;if(_0x595279[_0x4cfee7(0x19e)]===_0x4cfee7(0x1a4))return await runOAuthLoginFlow(_0x5a14b9,_0x5d2d90,_0x5e3084[_0x4cfee7(0x1b9)]??LogLevel[_0x4cfee7(0x1b8)]),0x0;}console[_0x4cfee7(0x18e)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5a14b9),console[_0x4cfee7(0x18e)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x4cfee7(0x18e)]('\x20\x20'+getConsoleUrl(_0x5a14b9,_0x4cfee7(0x1cf)));const _0x4c8172=await a7_0x56c1a8({'type':_0x4cfee7(0x1b4),'name':'apiKey','message':_0x4cfee7(0x1b5),'validate':_0x2ca4f8=>{if(!_0x2ca4f8||!_0x2ca4f8['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x4c8172[_0x4cfee7(0x1b6)])return console[_0x4cfee7(0x18e)]('\x0aSetup\x20cancelled'),0x1;const _0x3142b6=_0x4c8172[_0x4cfee7(0x1b6)];console[_0x4cfee7(0x18e)](_0x4cfee7(0x1cd));try{const _0x2ec6c7=TDX[_0x4cfee7(0x1c0)]({'site':_0x5a14b9,'apiKey':_0x3142b6['trim'](),'logLevel':_0x5e3084[_0x4cfee7(0x1b9)]??LogLevel[_0x4cfee7(0x1b8)]}),_0x5cb14b=await _0x2ec6c7['jobs'][_0x4cfee7(0x1d6)]();console[_0x4cfee7(0x18e)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5cb14b[_0x4cfee7(0x192)]+')');const _0x4ac033=await isKeychainAvailable();_0x4ac033?(await saveAPIKeyAsync(_0x3142b6[_0x4cfee7(0x1bb)](),_0x5a14b9,_0x5d2d90),console[_0x4cfee7(0x18e)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5d2d90?_0x4cfee7(0x1c9)+_0x5d2d90+')':''))):(console[_0x4cfee7(0x18d)](a7_0x281652[_0x4cfee7(0x19c)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x281652['yellow'](_0x4cfee7(0x1c4))));if(_0x5d2d90){const _0x4a6a77={'site':_0x5a14b9};saveProfileToUserConfig(_0x5d2d90,_0x4a6a77),console[_0x4cfee7(0x18e)]('✓\x20Profile\x20\x27'+_0x5d2d90+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x5a14b9),console[_0x4cfee7(0x18e)](_0x4cfee7(0x1a3)+_0x5a14b9);const _0x5c0fd7=_0x5d2d90?_0x4cfee7(0x193)+_0x5d2d90:'';return console[_0x4cfee7(0x18e)](),console[_0x4cfee7(0x18e)](_0x4cfee7(0x1d2)),console[_0x4cfee7(0x18e)](_0x4cfee7(0x1ce)+_0x5c0fd7+_0x4cfee7(0x1c6)),console[_0x4cfee7(0x18e)](_0x4cfee7(0x1ce)+_0x5c0fd7+_0x4cfee7(0x19d)),0x0;}catch(_0x45fa23){if(_0x45fa23 instanceof HTTPClientError&&_0x45fa23[_0x4cfee7(0x1ae)]===0x191)return printAuthError(_0x45fa23),0x1;return console['error'](a7_0x281652[_0x4cfee7(0x1aa)]('✗\x20Validation\x20failed:\x20'+(_0x45fa23 instanceof Error?_0x45fa23['message']:String(_0x45fa23)))),console[_0x4cfee7(0x1af)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x56d7d7(0x18f)]=a7_0x56d7d7(0x1ad);[a7_0x56d7d7(0x1b7)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x56d7d7(0x1b2)](_0xa174a7){const _0x10bc5c=a7_0x56d7d7,{options:_0x1863ef,tdx:_0x2c8727}=_0xa174a7,_0x4a0359=_0x1863ef['site'],_0x2c51a9=_0x1863ef['profile'],_0x1f36d6=_0x2c51a9?_0x2c51a9:_0x10bc5c(0x1d4);console['log'](_0x10bc5c(0x19b)+_0x1f36d6+_0x10bc5c(0x1a2)+_0x4a0359+')');const _0x132cc9=await getOAuthTokens(_0x2c51a9);if(_0x132cc9)console[_0x10bc5c(0x18e)](_0x10bc5c(0x1a5)),console[_0x10bc5c(0x18e)](_0x10bc5c(0x194)+(_0x2c51a9?_0x10bc5c(0x1c9)+_0x2c51a9+')':''));else{const _0x279beb=await resolveAPIKeyAsync(_0x4a0359,_0x2c51a9);if(_0x279beb){const {source:_0xe737ec,isDeprecated:_0x1fe12b}=_0x279beb,_0x36c64b=_0x10bc5c(0x1bc)+_0xe737ec;console['log'](_0x1fe12b?a7_0x281652[_0x10bc5c(0x19c)](_0x36c64b):_0x36c64b);}else console[_0x10bc5c(0x18e)](a7_0x281652[_0x10bc5c(0x19c)]('No\x20credential\x20found'));}try{const _0x49dd97=await _0x2c8727[_0x10bc5c(0x1cc)]['getUserInfo']();return console[_0x10bc5c(0x18e)](a7_0x281652[_0x10bc5c(0x1c5)](_0x10bc5c(0x195))),console[_0x10bc5c(0x18e)](_0x10bc5c(0x1a7)+_0x49dd97[_0x10bc5c(0x192)]),(_0x49dd97[_0x10bc5c(0x19a)]||_0x49dd97[_0x10bc5c(0x1bf)])&&console['log'](_0x10bc5c(0x1c3)+[_0x49dd97[_0x10bc5c(0x19a)],_0x49dd97[_0x10bc5c(0x1bf)]][_0x10bc5c(0x191)](Boolean)['join']('\x20')),0x0;}catch(_0x61cde9){return _0x61cde9 instanceof HTTPClientError&&_0x61cde9[_0x10bc5c(0x1ae)]===0x191?printAuthError(_0x61cde9,!![],_0x2c51a9):console[_0x10bc5c(0x1af)](a7_0x281652['red'](_0x10bc5c(0x1ca)+(_0x61cde9 instanceof Error?_0x61cde9[_0x10bc5c(0x197)]:String(_0x61cde9)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x56d7d7(0x1b7)]=a7_0x56d7d7(0x1a6);async[a7_0x56d7d7(0x1b2)](_0x2025a1){const _0x376ab5=a7_0x56d7d7,{options:_0x6bd9c8}=_0x2025a1,_0x7a4475=_0x6bd9c8[_0x376ab5(0x198)];console[_0x376ab5(0x18e)](a7_0x281652[_0x376ab5(0x196)](_0x376ab5(0x1c7)));const _0x167f1e=await isKeychainAvailable();if(!_0x167f1e)return console[_0x376ab5(0x1af)](a7_0x281652[_0x376ab5(0x1aa)](_0x376ab5(0x190))),0x1;const [_0x3c2beb,_0x9c0c8c]=await Promise['all']([deleteKeychainAPIKey(_0x7a4475),deleteOAuthTokens(_0x7a4475)]);if(_0x3c2beb||_0x9c0c8c){clearCredentialCache();const _0x5adba2=[_0x3c2beb&&'API\x20key',_0x9c0c8c&&_0x376ab5(0x1b0)][_0x376ab5(0x191)](Boolean)[_0x376ab5(0x19f)](_0x376ab5(0x1ab));return console[_0x376ab5(0x18e)]('✓\x20'+_0x5adba2+'\x20removed\x20from\x20keychain'+(_0x7a4475?_0x376ab5(0x1c9)+_0x7a4475+')':'')),0x0;}else return console[_0x376ab5(0x18e)](_0x376ab5(0x199)+(_0x7a4475?_0x376ab5(0x1c2)+_0x7a4475:'')),0x1;}}function a7_0x1ab1(){const _0xcd309b=['red','\x20and\x20','us01','auth','status','error','OAuth\x20tokens','839619YzCMIY','execute','3FwbgnS','password','Enter\x20your\x20TD\x20API\x20key:','apiKey','description','ERROR','logLevel','195415AhkiIr','trim','Read\x20credential\x20from\x20','2805200ACwbhp','select','last_name','create','1013000sgKzJI','\x20for\x20profile:\x20','Name:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','green','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','tdx:\x20auth\x20clear','auth:setup','\x20(profile:\x20','✗\x20Validation\x20failed:\x20','5595136KAGLKV','jobs','Validating\x20API\x20key...','\x20\x20tdx','/app/mp/ak','apikey','20HEbbiE','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','475853LGivmh','N/A','102ZDhpZE','getUserInfo','6511605zWncXv','Setup\x20cancelled','warn','log','name','System\x20keychain\x20is\x20not\x20available','filter','email','\x20--profile\x20','Read\x20credential\x20from\x20keychain','✓\x20Authentication\x20successful\x0a','bold','message','profile','No\x20credentials\x20found\x20in\x20keychain','first_name','tdx\x20profile:\x20','yellow','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','method','join','API\x20Key','OAuth\x20(browser\x20login)','\x20(site:\x20','✓\x20Default\x20site\x20set\x20to\x20','oauth','Credential\x20type:\x20OAuth','Remove\x20API\x20key\x20from\x20system\x20keychain','User:\x20','site','\x0aSetup\x20cancelled'];a7_0x1ab1=function(){return _0xcd309b;};return a7_0x1ab1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x4a08b4=a8_0x3973;(function(_0x3ab508,_0x1dabe5){const _0x8dcf2f=a8_0x3973,_0x3593ca=_0x3ab508();while(!![]){try{const _0x1bbf14=parseInt(_0x8dcf2f(0xbc))/0x1*(parseInt(_0x8dcf2f(0xaf))/0x2)+-parseInt(_0x8dcf2f(0xb5))/0x3+-parseInt(_0x8dcf2f(0xa2))/0x4*(parseInt(_0x8dcf2f(0xc0))/0x5)+parseInt(_0x8dcf2f(0xb0))/0x6+parseInt(_0x8dcf2f(0xa3))/0x7+-parseInt(_0x8dcf2f(0xab))/0x8*(parseInt(_0x8dcf2f(0xb8))/0x9)+parseInt(_0x8dcf2f(0xb7))/0xa;if(_0x1bbf14===_0x1dabe5)break;else _0x3593ca['push'](_0x3593ca['shift']());}catch(_0x100d63){_0x3593ca['push'](_0x3593ca['shift']());}}}(a8_0x4115,0x88d79));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';function a8_0x3973(_0x14f56c,_0x4ec79c){_0x14f56c=_0x14f56c-0x9f;const _0x411546=a8_0x4115();let _0x3973ea=_0x411546[_0x14f56c];return _0x3973ea;}import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0x4115(){const _0x347568=['✓\x20Profile\x20\x27','log','Login\x20via\x20OAuth\x20(opens\x20browser)','338292TdEHgB','\x20(profile:\x20','5906740sdMrRN','9UZUWzj','✓\x20Authentication\x20successful\x20(User:\x20','create','Login\x20cancelled','2797nLTyzF','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','2195kQMqtD','site','auth:login','\x20\x20tdx','description','name','4596DyBCqa','1625659cCDFip','tdx:\x20auth\x20login','execute','\x20--profile\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','access_token','bold','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','5559056ZBLGEA','profile','ERROR','Validating\x20OAuth\x20tokens...','376XFwubS','3142890PcxXrw','Authenticating\x20via\x20OAuth\x20for\x20site:\x20'];a8_0x4115=function(){return _0x347568;};return a8_0x4115();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x6f8f2a from'chalk';export async function runOAuthLoginFlow(_0xd547ad,_0x2ad1b6,_0x37d5f0){const _0x2f5492=a8_0x3973;if(!isOAuthSupported(_0xd547ad))throw new Error(_0x2f5492(0xbe)+_0xd547ad+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x3854ad=await isKeychainAvailable();if(!_0x3854ad)throw new Error(_0x2f5492(0xa7)+_0x2f5492(0xbd));const _0x1ea6e6=getConsoleUrl(_0xd547ad);console[_0x2f5492(0xb3)]('Opening\x20browser\x20for\x20authentication...'),console[_0x2f5492(0xb3)]('\x20\x20'+_0x1ea6e6+'/oauth/authorize'),console['log'](_0x2f5492(0xbf));const _0x2e9e34=await startOAuthFlow(_0xd547ad);console[_0x2f5492(0xb3)](_0x2f5492(0xae));const _0x94aa7=TDX[_0x2f5492(0xba)]({'site':_0xd547ad,'accessToken':_0x2e9e34[_0x2f5492(0xa8)],'logLevel':_0x37d5f0??LogLevel[_0x2f5492(0xad)]}),_0x9f9bfa=await _0x94aa7['jobs']['getUserInfo']();console[_0x2f5492(0xb3)](a8_0x6f8f2a['green'](_0x2f5492(0xb9)+_0x9f9bfa['email']+')')),await saveOAuthTokens(_0x2e9e34,_0x2ad1b6),console[_0x2f5492(0xb3)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x2ad1b6?_0x2f5492(0xb6)+_0x2ad1b6+')':''));if(_0x2ad1b6){const _0x3c8b62={'site':_0xd547ad};saveProfileToUserConfig(_0x2ad1b6,_0x3c8b62),console[_0x2f5492(0xb3)](_0x2f5492(0xb2)+_0x2ad1b6+'\x27\x20registered');}const _0x12c395=_0x2ad1b6?_0x2f5492(0xa6)+_0x2ad1b6:'';console[_0x2f5492(0xb3)](),console['log'](_0x2f5492(0xaa)),console[_0x2f5492(0xb3)]('\x20\x20tdx'+_0x12c395+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x2f5492(0xb3)](_0x2f5492(0x9f)+_0x12c395+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x4a08b4(0xa1)]=a8_0x4a08b4(0xc2);[a8_0x4a08b4(0xa0)]=a8_0x4a08b4(0xb4);async[a8_0x4a08b4(0xa5)](_0x206bbf){const _0x1aa767=a8_0x4a08b4,{options:_0x18fba9}=_0x206bbf,_0x2b33da=_0x18fba9[_0x1aa767(0xac)];console[_0x1aa767(0xb3)](a8_0x6f8f2a[_0x1aa767(0xa9)](_0x1aa767(0xa4)));const _0x2986b0=_0x18fba9[_0x1aa767(0xc1)]||'us01',_0x99917f=await promptSiteSelection(_0x2986b0,_0x2b33da,_0x1aa767(0xbb));if(!_0x99917f)return 0x1;const _0x3380ab=resolveSite(_0x99917f);return console[_0x1aa767(0xb3)](_0x1aa767(0xb1)+_0x3380ab),await runOAuthLoginFlow(_0x3380ab,_0x2b33da,_0x18fba9['logLevel']??LogLevel[_0x1aa767(0xad)]),0x0;}}
|