@treasuredata/tdx 2026.6.1 → 2026.6.2
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +2 -2
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +23 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workflow.d.ts +1 -1
- package/dist/sdk/types/workflow.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +23 -2
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.d.ts +4 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js.map +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x19c16d=a3_0x3278;(function(_0x26f848,_0x4be611){const _0x57a071=a3_0x3278,_0x214c68=_0x26f848();while(!![]){try{const _0x498f23=parseInt(_0x57a071(0x187))/0x1+-parseInt(_0x57a071(0x192))/0x2+parseInt(_0x57a071(0x185))/0x3+-parseInt(_0x57a071(0x199))/0x4+-parseInt(_0x57a071(0x18d))/0x5+parseInt(_0x57a071(0x183))/0x6*(-parseInt(_0x57a071(0x19f))/0x7)+parseInt(_0x57a071(0x186))/0x8*(parseInt(_0x57a071(0x17e))/0x9);if(_0x498f23===_0x4be611)break;else _0x214c68['push'](_0x214c68['shift']());}catch(_0x1ce9cb){_0x214c68['push'](_0x214c68['shift']());}}}(a3_0x4aac,0x284b4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x3278(_0x479c6a,_0x126516){_0x479c6a=_0x479c6a-0x17c;const _0x4aac59=a3_0x4aac();let _0x327850=_0x4aac59[_0x479c6a];return _0x327850;}import{withSpinner}from'../utils/spinner.js';function a3_0x4aac(){const _0xdaa879=['message','399928ZWwsSq','data','Listing\x20activations\x20for\x20segment\x20\x27','\x20activation','Site:\x20','segment','292607vzhmAW','Error:\x20','resolveSegmentId','\x20\x20Cause:\x20','84087yacXxW','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','error','verbose','Resolving\x20child\x20segment\x20\x27','12yqKMfv','List\x20activations\x20for\x20a\x20segment','24648RNrgsO','416crPUeG','74488DiXfyh','description','cause','✔\x20Found\x20','site','activations','134560LBCGwH','length','Parent\x20name:\x20','execute','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','386000QppdSQ','Error:\x20Segment\x20name\x20is\x20required','\x27...','Resolved\x20parent\x20ID:\x20','resolveParentId','Child\x20name:\x20'];a3_0x4aac=function(){return _0xdaa879;};return a3_0x4aac();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x19c16d(0x18c);[a3_0x19c16d(0x188)]=a3_0x19c16d(0x184);async[a3_0x19c16d(0x190)](_0x6209fa){const _0x130a63=a3_0x19c16d,{options:_0x2de78a,args:_0x396f0e,tdx:_0x15dd5c}=_0x6209fa;if(_0x396f0e[_0x130a63(0x18e)]===0x0)return console[_0x130a63(0x180)](_0x130a63(0x193)),console[_0x130a63(0x180)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x3d2635,childId:_0x2ad150}=parseSegmentRef(_0x396f0e[0x0]);if(!_0x2ad150)return console[_0x130a63(0x180)](_0x130a63(0x17f)),console[_0x130a63(0x180)](_0x130a63(0x191)),0x1;_0x2de78a[_0x130a63(0x181)]&&(console[_0x130a63(0x180)](_0x130a63(0x19d)+_0x2de78a[_0x130a63(0x18b)]),console[_0x130a63(0x180)](_0x130a63(0x18f)+_0x3d2635),console[_0x130a63(0x180)](_0x130a63(0x197)+_0x2ad150));const _0x546650=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3d2635+'\x27...',()=>_0x15dd5c['segment'][_0x130a63(0x196)](_0x3d2635),{'verbose':_0x2de78a['verbose']}),_0x5bc682=_0x546650['data'];_0x2de78a[_0x130a63(0x181)]&&console['error'](_0x130a63(0x195)+_0x5bc682);const _0x31c3d9=await withSpinner(_0x130a63(0x182)+_0x2ad150+_0x130a63(0x194),()=>_0x15dd5c['segment'][_0x130a63(0x17c)](_0x5bc682,_0x2ad150),{'verbose':_0x2de78a[_0x130a63(0x181)]}),_0x2b59cc=_0x31c3d9[_0x130a63(0x19a)];_0x2de78a['verbose']&&console['error']('Resolved\x20child\x20ID:\x20'+_0x2b59cc);const _0x5be922=await withSpinner(_0x130a63(0x19b)+_0x2ad150+'\x27...',()=>_0x15dd5c[_0x130a63(0x19e)]['listActivations'](_0x5bc682,_0x2b59cc),{'verbose':_0x2de78a[_0x130a63(0x181)]}),_0x5246ba=_0x5be922[_0x130a63(0x19a)];return console['error'](_0x130a63(0x18a)+_0x5246ba[_0x130a63(0x18e)]+_0x130a63(0x19c)+(_0x5246ba[_0x130a63(0x18e)]!==0x1?'s':'')),await handleSDKOutput(_0x5246ba,_0x2de78a),0x0;}catch(_0x52c38f){if(_0x52c38f instanceof SDKError)return console[_0x130a63(0x180)](_0x130a63(0x1a0)+_0x52c38f[_0x130a63(0x198)]),_0x52c38f[_0x130a63(0x189)]&&console[_0x130a63(0x180)](_0x130a63(0x17d)+_0x52c38f[_0x130a63(0x189)]),0x1;throw _0x52c38f;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x266e20=a4_0x2c69;function a4_0x2c69(_0x1d65f4,_0x41b0e4){_0x1d65f4=_0x1d65f4-0xba;const _0x4337b1=a4_0x4337();let _0x2c6956=_0x4337b1[_0x1d65f4];return _0x2c6956;}(function(_0x4632ea,_0x18b60a){const _0x27d007=a4_0x2c69,_0x2f89fe=_0x4632ea();while(!![]){try{const _0x446c82=parseInt(_0x27d007(0x168))/0x1*(parseInt(_0x27d007(0xc3))/0x2)+-parseInt(_0x27d007(0xbf))/0x3+parseInt(_0x27d007(0xc2))/0x4*(parseInt(_0x27d007(0x126))/0x5)+-parseInt(_0x27d007(0x15d))/0x6*(-parseInt(_0x27d007(0x103))/0x7)+-parseInt(_0x27d007(0x12f))/0x8*(-parseInt(_0x27d007(0x141))/0x9)+-parseInt(_0x27d007(0xfd))/0xa+-parseInt(_0x27d007(0x146))/0xb*(parseInt(_0x27d007(0x138))/0xc);if(_0x446c82===_0x18b60a)break;else _0x2f89fe['push'](_0x2f89fe['shift']());}catch(_0x863158){_0x2f89fe['push'](_0x2f89fe['shift']());}}}(a4_0x4337,0x60566));function a4_0x4337(){const _0x2799e1=['newProjectId','Using\x20project\x20from\x20','message','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)','8MtmiHg','Analyzing\x20project\x20\x22','\x20errors','\x0aPush\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','source','\x0aChanges\x20to\x20form\x20interface\x20\x27','Dry\x20run\x20-\x20no\x20changes\x20made','site','376176KwypIx','-\x20nothing\x20pushed','Project:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','force','diff','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','description','\x20\x20tdx\x20agent\x20clone\x20agents/','5226255RsDEst','cwd-config','\x20\x20Target:\x20','Using\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','352kyPEPf','\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\x20Knowledge\x20Bases:\x20','counts','\x22\x20to\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','\x22\x20to\x20new\x20project\x20\x22','\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','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aError:','\x20files\x20to\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Using\x20project\x20from\x20context:\x20','error','formInterfaces','\x20\x20Integrations:\x20','\x20successfully','\x0aProject\x20pushed\x20with\x20errors','<new-name>','agents','textKnowledgeBases','cloneProject','outputPath','19308grigkU','unchanged','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Source:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','New\x20project\x20ID:\x20','dim','Pulling\x20agent\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pushed\x20','69473cXbeRY','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Cancelled','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','projectId','action','\x20resources?','dryRun','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x20=\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','profile','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22:\x20','red','Agent:\x20','\x20total','errors','Chat:\x20','\x20\x20Experimental\x20Artifacts:\x20','New\x20project:\x20','repeat','1652967xOrIDp','Agent\x20pulled\x20successfully','new','8vgRlxA','20AmkLhF','Project\x20cloned\x20with\x20errors','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20unchanged','\x20changed','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','cyan','\x22...','dirname','found','prompts','\x20\x20Form\x20Interfaces:\x20','\x20created','Dry\x20run\x20-\x20no\x20files\x20written','\x20--name\x20','Using\x20local\x20project:\x20','Analyzing\x20changes\x20to\x20push...','\x20|\x20','execute','\x20\x20Prompts:\x20','chatInterfaces','no_local_folder','integrations','knowledgeBases','updated','projectName','✔\x20Context\x20set:\x20','agent:pull','Pushing\x20to\x20project...','llm','yes','\x0aErrors\x20found:','experimentalArtifacts','\x0aChanges:','\x0aChanges\x20to\x20integration\x20\x27','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','total','llmProject','pullProject','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','output','newProjectName','\x20\x20Prompt\x20\x22','\x0a✔\x20Pulled\x20','INVALID_ARGUMENT','utf-8','cwd','outputDir','\x20resources\x20to\x20\x27','log','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Using\x20current\x20project:\x20','green','Project\x20cloned\x20successfully','\x20updated','join','1972300nQKiVV','\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)','parse','yellow','\x20\x20Experimental\x20Artifact\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','455ziSaBG','Agent\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agentId','\x22\x20from\x20project\x20\x22','\x20files?','experimentalKnowledgeBases','-\x20no\x20files\x20written','\x20\x20Chat\x20Interface\x20\x22','created','agent:push','agent:clone','tdx.json','\x20\x20Chat\x20Interfaces:\x20','llm_project','Using\x20context\x20project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','\x20\x20Agents:\x20','push','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Form\x20Interface\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Pushing\x20agent\x20from\x20\x22','sourceProjectName','agentName','\x0aWrite\x20','Errors:','context','Writing\x20files...','no_context','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','1653395lrPMCN','New\x20project\x20name\x20is\x20required','\x20\x20Agent\x20\x22','Cloning\x20\x22','\x20new'];a4_0x4337=function(){return _0x2799e1;};return a4_0x4337();}import a4_0x3d8a18 from'chalk';import a4_0x213baf from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x51ae73){const _0x3bc71e=a4_0x2c69,_0x39d6db=[];if(_0x51ae73['total']!==undefined)_0x39d6db['push'](_0x51ae73[_0x3bc71e(0xe7)]+_0x3bc71e(0x179));if(_0x51ae73[_0x3bc71e(0xc1)]!==undefined&&_0x51ae73['new']>0x0)_0x39d6db[_0x3bc71e(0x118)](a4_0x3d8a18[_0x3bc71e(0xf9)](_0x51ae73['new']+_0x3bc71e(0x12a)));if(_0x51ae73[_0x3bc71e(0x10c)]!==undefined&&_0x51ae73[_0x3bc71e(0x10c)]>0x0)_0x39d6db[_0x3bc71e(0x118)](a4_0x3d8a18[_0x3bc71e(0xf9)](_0x51ae73[_0x3bc71e(0x10c)]+_0x3bc71e(0xcf)));if(_0x51ae73['updated']!==undefined&&_0x51ae73[_0x3bc71e(0xdb)]>0x0)_0x39d6db[_0x3bc71e(0x118)](a4_0x3d8a18[_0x3bc71e(0x100)](_0x51ae73[_0x3bc71e(0xdb)]+_0x3bc71e(0xfb)));if(_0x51ae73[_0x3bc71e(0x15e)]!==undefined&&_0x51ae73['unchanged']>0x0)_0x39d6db[_0x3bc71e(0x118)](a4_0x3d8a18['gray'](_0x51ae73[_0x3bc71e(0x15e)]+_0x3bc71e(0xc6)));if(_0x51ae73[_0x3bc71e(0xba)]!==undefined&&_0x51ae73['errors']>0x0)_0x39d6db[_0x3bc71e(0x118)](a4_0x3d8a18[_0x3bc71e(0x177)](_0x51ae73[_0x3bc71e(0xba)]+_0x3bc71e(0x131)));return _0x39d6db[_0x3bc71e(0xfc)](',\x20');}function displayDiffs(_0x23f3c2,_0x33b9e,_0x49881e,_0x2598ed,_0x58c4bd,_0x403e8c,_0x5b314a,_0x3dd3d7,_0x4a7168){const _0x405235=a4_0x2c69;for(const _0x464180 of _0x23f3c2){if(_0x464180[_0x405235(0x13d)]){const _0x567ea6=_0x464180['agentName']||_0x464180[_0x405235(0x114)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x567ea6+'\x27:'),console[_0x405235(0xf5)]('─'['repeat'](0x3c)),console[_0x405235(0xf5)](_0x464180['diff']),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c));}}for(const _0x11cadc of _0x33b9e){_0x11cadc[_0x405235(0x13d)]&&(console[_0x405235(0xf5)](_0x405235(0x115)+_0x11cadc[_0x405235(0x114)]+'\x27:'),console[_0x405235(0xf5)]('─'['repeat'](0x3c)),console[_0x405235(0xf5)](_0x11cadc['diff']),console['log']('─'[_0x405235(0xbe)](0x3c)));}for(const _0x5bd337 of _0x49881e){_0x5bd337[_0x405235(0x13d)]&&(console['log'](_0x405235(0x119)+_0x5bd337[_0x405235(0x114)]+'\x27:'),console[_0x405235(0xf5)]('─'['repeat'](0x3c)),console[_0x405235(0xf5)](_0x5bd337[_0x405235(0x13d)]),console[_0x405235(0xf5)]('─'['repeat'](0x3c)));}for(const _0x2f2ba5 of _0x2598ed){_0x2f2ba5[_0x405235(0x13d)]&&(console[_0x405235(0xf5)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2f2ba5[_0x405235(0x114)]+'\x27:'),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)),console[_0x405235(0xf5)](_0x2f2ba5[_0x405235(0x13d)]),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)));}for(const _0x510fd5 of _0x58c4bd){_0x510fd5[_0x405235(0x13d)]&&(console[_0x405235(0xf5)](_0x405235(0xe5)+_0x510fd5[_0x405235(0x114)]+'\x27:'),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)),console['log'](_0x510fd5[_0x405235(0x13d)]),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)));}for(const _0x176fa1 of _0x403e8c){_0x176fa1[_0x405235(0x13d)]&&(console[_0x405235(0xf5)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x176fa1[_0x405235(0x114)]+'\x27:'),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)),console[_0x405235(0xf5)](_0x176fa1[_0x405235(0x13d)]),console['log']('─'[_0x405235(0xbe)](0x3c)));}for(const _0x5d8aad of _0x5b314a){_0x5d8aad[_0x405235(0x13d)]&&(console['log'](_0x405235(0xe6)+_0x5d8aad[_0x405235(0x114)]+'\x27:'),console[_0x405235(0xf5)]('─'['repeat'](0x3c)),console[_0x405235(0xf5)](_0x5d8aad[_0x405235(0x13d)]),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)));}for(const _0x4b75c1 of _0x3dd3d7){_0x4b75c1[_0x405235(0x13d)]&&(console[_0x405235(0xf5)](_0x405235(0x135)+_0x4b75c1[_0x405235(0x114)]+'\x27:'),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)),console[_0x405235(0xf5)](_0x4b75c1[_0x405235(0x13d)]),console[_0x405235(0xf5)]('─'['repeat'](0x3c)));}for(const _0x31fda6 of _0x4a7168){_0x31fda6[_0x405235(0x13d)]&&(console[_0x405235(0xf5)](_0x405235(0xf7)+_0x31fda6['name']+'\x27:'),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)),console[_0x405235(0xf5)](_0x31fda6[_0x405235(0x13d)]),console[_0x405235(0xf5)]('─'[_0x405235(0xbe)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x266e20(0x114)]=a4_0x266e20(0xde);['description']=a4_0x266e20(0x105);async[a4_0x266e20(0xd5)](_0x48518c){const _0x3f59ed=a4_0x266e20,{options:_0x312f63,args:_0x11e3f7,tdx:_0x5d9a1a}=_0x48518c,_0x60b774=_0x11e3f7[0x0],_0x30f84b=_0x11e3f7[0x1],_0x420fbf=_0x312f63[_0x3f59ed(0xec)],_0x3ec6f5=_0x312f63[_0x3f59ed(0x16f)],_0x3350e2=_0x312f63[_0x3f59ed(0x13c)],_0x5a83e0=_0x312f63['yes'],_0x5e85de=_0x312f63[_0x3f59ed(0xe8)],_0x280c4b=_0x312f63['agent'];let _0x29bad7;if(_0x60b774){const _0x18cd3b=a4_0x213baf[_0x3f59ed(0xfc)](_0x60b774,_0x3f59ed(0x10f));if(existsSync(_0x18cd3b))try{const _0x9a85b3=JSON[_0x3f59ed(0xff)](readFileSync(_0x18cd3b,_0x3f59ed(0xf1)));_0x9a85b3['llm_project']&&(_0x29bad7={'llm_project':_0x9a85b3[_0x3f59ed(0x111)]});}catch{}}const _0x296137=findAgentConfigPath(process[_0x3f59ed(0xf2)]());let _0x952b72;if(_0x296137)try{const _0x2e5942=JSON[_0x3f59ed(0xff)](readFileSync(_0x296137,_0x3f59ed(0xf1)));_0x2e5942[_0x3f59ed(0x111)]&&(_0x952b72={'llm_project':_0x2e5942[_0x3f59ed(0x111)]});}catch{}const _0x46ceb5=resolveAgentPullArgs({'arg':_0x60b774,'agentNameArg':_0x30f84b,'agentFlag':_0x280c4b,'contextProject':_0x5e85de,'argDirConfig':_0x29bad7,'cwdConfigPath':_0x296137||undefined,'cwdConfig':_0x952b72}),{projectNameOrId:_0xb8ea28,targetAgentName:_0x25137e,existingOutputDir:_0x2eecd2,source:_0x2494e9}=_0x46ceb5;if(_0x2494e9==='arg-dir')console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0x164)](_0x3f59ed(0x12c)+a4_0x213baf[_0x3f59ed(0xfc)](_0x60b774,_0x3f59ed(0x10f))+':\x20'+_0xb8ea28));else{if(_0x2494e9===_0x3f59ed(0x142))console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0x164)](_0x3f59ed(0x144)+_0xb8ea28));else _0x2494e9===_0x3f59ed(0x122)&&console[_0x3f59ed(0xf5)](a4_0x3d8a18['dim'](_0x3f59ed(0x152)+_0xb8ea28));}if(!_0xb8ea28)return _0x280c4b?(console['log'](a4_0x3d8a18[_0x3f59ed(0x100)](_0x3f59ed(0x13b))),console[_0x3f59ed(0xf5)](_0x3f59ed(0x133)),console[_0x3f59ed(0xf5)](_0x3f59ed(0x169))):(console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0x100)](_0x3f59ed(0x102))),console[_0x3f59ed(0xf5)](_0x3f59ed(0x12e)),console[_0x3f59ed(0xf5)](_0x3f59ed(0x11b)),console[_0x3f59ed(0xf5)](_0x3f59ed(0x147)),console['log'](_0x3f59ed(0x171)),console[_0x3f59ed(0xf5)](_0x3f59ed(0x14d))),0x1;if(_0x25137e){const {data:_0x330f10}=await withSpinner(_0x3f59ed(0x165)+_0x25137e+_0x3f59ed(0x107)+_0xb8ea28+_0x3f59ed(0xca),()=>_0x5d9a1a[_0x3f59ed(0xe0)]['pullAgent'](_0xb8ea28,_0x25137e,_0x420fbf,{'dryRun':_0x3ec6f5,'force':_0x3350e2}));if(_0x3ec6f5)return console['log'](a4_0x3d8a18[_0x3f59ed(0x100)](_0x3f59ed(0xd0))),console['log']('Would\x20pull\x20agent:\x20'+_0x330f10['agentName']),console['log']('Output\x20path:\x20'+_0x330f10[_0x3f59ed(0x15c)]),_0x330f10[_0x3f59ed(0x13d)]&&(console[_0x3f59ed(0xf5)](_0x3f59ed(0xe4)),console[_0x3f59ed(0xf5)]('─'[_0x3f59ed(0xbe)](0x3c)),console[_0x3f59ed(0xf5)](_0x330f10[_0x3f59ed(0x13d)]),console[_0x3f59ed(0xf5)]('─'[_0x3f59ed(0xbe)](0x3c))),0x0;return console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0xf9)](_0x3f59ed(0xc0))),console[_0x3f59ed(0xf5)](_0x3f59ed(0x178)+_0x330f10['agentName']),console[_0x3f59ed(0xf5)]('Output:\x20'+_0x330f10[_0x3f59ed(0x15c)]),console[_0x3f59ed(0xf5)]('Status:\x20'+(_0x330f10['isNew']?a4_0x3d8a18[_0x3f59ed(0xf9)](_0x3f59ed(0xc1)):_0x330f10['hasChanges']?a4_0x3d8a18[_0x3f59ed(0x100)](_0x3f59ed(0xdb)):a4_0x3d8a18['gray'](_0x3f59ed(0x15e)))),0x0;}const _0x5f3e32=_0x2eecd2||_0x420fbf,{data:_0x7f6206}=await withSpinner(_0x3f59ed(0x130)+_0xb8ea28+'\x22...',()=>_0x5d9a1a[_0x3f59ed(0xe0)][_0x3f59ed(0xe9)](_0xb8ea28,_0x5f3e32,{'dryRun':!![]})),_0x595aa8=_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0x159)][_0x3f59ed(0xc1)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xda)][_0x3f59ed(0xc1)]+_0x7f6206[_0x3f59ed(0x149)]['textKnowledgeBases'][_0x3f59ed(0xc1)]+_0x7f6206['counts']['prompts']['new']+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xd9)]['new']+_0x7f6206[_0x3f59ed(0x149)]['experimentalKnowledgeBases'][_0x3f59ed(0xc1)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xe3)][_0x3f59ed(0xc1)]+_0x7f6206['counts'][_0x3f59ed(0x154)][_0x3f59ed(0xc1)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xd7)][_0x3f59ed(0xc1)],_0x5e77c7=_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0x159)][_0x3f59ed(0xdb)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xda)][_0x3f59ed(0xdb)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0x15a)][_0x3f59ed(0xdb)]+_0x7f6206[_0x3f59ed(0x149)]['prompts'][_0x3f59ed(0xdb)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xd9)][_0x3f59ed(0xdb)]+_0x7f6206['counts']['experimentalKnowledgeBases']['updated']+_0x7f6206['counts'][_0x3f59ed(0xe3)]['updated']+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0x154)][_0x3f59ed(0xdb)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xd7)][_0x3f59ed(0xdb)],_0x18e514=_0x7f6206['counts'][_0x3f59ed(0x159)][_0x3f59ed(0x15e)]+_0x7f6206[_0x3f59ed(0x149)]['knowledgeBases'][_0x3f59ed(0x15e)]+_0x7f6206[_0x3f59ed(0x149)]['textKnowledgeBases'][_0x3f59ed(0x15e)]+_0x7f6206['counts']['prompts'][_0x3f59ed(0x15e)]+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xd9)][_0x3f59ed(0x15e)]+_0x7f6206[_0x3f59ed(0x149)]['experimentalKnowledgeBases'][_0x3f59ed(0x15e)]+_0x7f6206['counts']['experimentalArtifacts']['unchanged']+_0x7f6206[_0x3f59ed(0x149)]['formInterfaces']['unchanged']+_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xd7)][_0x3f59ed(0x15e)];console[_0x3f59ed(0xf5)]('\x0aPull\x20summary\x20for\x20\x27'+_0x7f6206[_0x3f59ed(0xdc)]+'\x27:'),console[_0x3f59ed(0xf5)]('\x20\x20'+a4_0x3d8a18[_0x3f59ed(0xf9)]('+\x20'+_0x595aa8+_0x3f59ed(0x12a))+_0x3f59ed(0xd4)+a4_0x3d8a18[_0x3f59ed(0x100)]('~\x20'+_0x5e77c7+'\x20changed')+_0x3f59ed(0xd4)+a4_0x3d8a18[_0x3f59ed(0x164)]('=\x20'+_0x18e514+_0x3f59ed(0xc6))),console[_0x3f59ed(0xf5)](_0x3f59ed(0x117)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0x159)])),console[_0x3f59ed(0xf5)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x7f6206['counts']['knowledgeBases'])),console[_0x3f59ed(0xf5)](_0x3f59ed(0x173)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0x15a)])),console[_0x3f59ed(0xf5)](_0x3f59ed(0xd6)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)]['prompts'])),console[_0x3f59ed(0xf5)](_0x3f59ed(0x155)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)]['integrations'])),console[_0x3f59ed(0xf5)](_0x3f59ed(0xce)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)]['formInterfaces'])),console[_0x3f59ed(0xf5)](_0x3f59ed(0x110)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xd7)]));const _0x3b4143=_0x7f6206[_0x3f59ed(0x149)]['experimentalKnowledgeBases'][_0x3f59ed(0xe7)]>0x0||_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xe3)][_0x3f59ed(0xe7)]>0x0;_0x3b4143&&(console[_0x3f59ed(0xf5)](_0x3f59ed(0x125)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0x109)])),console['log'](_0x3f59ed(0xbc)+formatCountSummary(_0x7f6206[_0x3f59ed(0x149)][_0x3f59ed(0xe3)])));console[_0x3f59ed(0xf5)](_0x3f59ed(0x143)+a4_0x3d8a18['cyan'](_0x7f6206[_0x3f59ed(0xf3)])),displayDiffs(_0x7f6206[_0x3f59ed(0x159)],_0x7f6206[_0x3f59ed(0xda)],_0x7f6206['textKnowledgeBases'],_0x7f6206[_0x3f59ed(0xcd)],_0x7f6206[_0x3f59ed(0xd9)],_0x7f6206[_0x3f59ed(0x109)],_0x7f6206[_0x3f59ed(0xe3)],_0x7f6206[_0x3f59ed(0x154)],_0x7f6206[_0x3f59ed(0xd7)]);if(_0x3ec6f5)return console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0x100)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x595aa8===0x0&&_0x5e77c7===0x0)return console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0xf9)](_0x3f59ed(0xea))),saveSessionContext({'llm_project':_0x7f6206[_0x3f59ed(0xdc)]},_0x312f63[_0x3f59ed(0x170)]),console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0xf9)](_0x3f59ed(0xdd)+a4_0x3d8a18[_0x3f59ed(0x164)](_0x3f59ed(0x111))+_0x3f59ed(0x172)+a4_0x3d8a18['cyan'](_0x7f6206[_0x3f59ed(0xdc)]))),0x0;if(!_0x5a83e0&&!_0x3350e2){if(!isInteractive())return console['error'](a4_0x3d8a18[_0x3f59ed(0x177)](_0x3f59ed(0x14f)),_0x3f59ed(0x16b)),console['error'](a4_0x3d8a18['dim'](_0x3f59ed(0x113))),0x1;const _0x5845f3=await confirmKey(_0x3f59ed(0x120)+(_0x595aa8+_0x5e77c7)+_0x3f59ed(0x108));if(!_0x5845f3)return console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0x100)]('Cancelled'),_0x3f59ed(0x10a)),0x1;}const {data:_0x37a8ba}=await withSpinner(_0x3f59ed(0x123),()=>_0x5d9a1a[_0x3f59ed(0xe0)][_0x3f59ed(0xe9)](_0xb8ea28,_0x5f3e32,{'force':_0x3350e2}));return console['log'](a4_0x3d8a18[_0x3f59ed(0xf9)](_0x3f59ed(0xef)+(_0x595aa8+_0x5e77c7)+_0x3f59ed(0x150)+_0x37a8ba['outputDir'])),saveSessionContext({'llm_project':_0x37a8ba[_0x3f59ed(0xdc)]},_0x312f63['session']),console[_0x3f59ed(0xf5)](a4_0x3d8a18[_0x3f59ed(0xf9)](_0x3f59ed(0xdd)+a4_0x3d8a18['dim'](_0x3f59ed(0x111))+_0x3f59ed(0x172)+a4_0x3d8a18[_0x3f59ed(0xc9)](_0x37a8ba[_0x3f59ed(0xdc)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x266e20(0x10e);[a4_0x266e20(0x13f)]=a4_0x266e20(0xc8);async[a4_0x266e20(0xd5)](_0x2538f9){const _0x15d91a=a4_0x266e20,{options:_0x149910,args:_0x4cf8fa,tdx:_0x483d0d}=_0x2538f9,_0x418301=_0x4cf8fa[0x0],_0x304293=_0x149910['name'],_0x4e26b6=_0x149910[_0x15d91a(0x16f)],_0x3bdd5e=_0x149910[_0x15d91a(0xe1)],_0x4237a4=_0x149910[_0x15d91a(0x137)],_0x16dcdb=_0x149910[_0x15d91a(0xe8)];let _0x3e458b;const _0x19ab2a=findAgentConfigPath(process['cwd']());if(_0x418301){const _0x3e0e96=a4_0x213baf[_0x15d91a(0xfc)](_0x418301,_0x15d91a(0x10f));existsSync(_0x3e0e96)?(_0x3e458b=_0x418301,console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x164)](_0x15d91a(0xd2)+_0x418301))):_0x3e458b=_0x418301;}else{if(_0x19ab2a)_0x3e458b=a4_0x213baf[_0x15d91a(0xcb)](_0x19ab2a),console['log'](a4_0x3d8a18[_0x15d91a(0x164)](_0x15d91a(0xf8)+_0x3e458b));else{if(_0x16dcdb){const _0x124dcc=sanitizeForFilesystem(_0x16dcdb);let _0x22ee77=_0x124dcc,_0x4a4b24=a4_0x213baf[_0x15d91a(0xfc)](process[_0x15d91a(0xf2)](),_0x15d91a(0x159),_0x124dcc,'tdx.json');if(!existsSync(_0x4a4b24)){const _0x21d524=normalizeName(_0x16dcdb),_0x415de0=a4_0x213baf[_0x15d91a(0xfc)](process[_0x15d91a(0xf2)](),_0x15d91a(0x159),_0x21d524,_0x15d91a(0x10f));existsSync(_0x415de0)&&(_0x22ee77=_0x21d524,_0x4a4b24=_0x415de0);}if(existsSync(_0x4a4b24))_0x3e458b=a4_0x213baf[_0x15d91a(0xcb)](_0x4a4b24),console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x164)](_0x15d91a(0xd2)+_0x3e458b));else{const _0x1a6713=_0x149910[_0x15d91a(0x174)];if(_0x1a6713)throw new SDKError(ErrorCode[_0x15d91a(0xf0)],_0x15d91a(0x162)+_0x16dcdb+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x15d91a(0x175)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x16dcdb+'\x0a')+(_0x15d91a(0x140)+_0x22ee77+_0x15d91a(0xd1)+(_0x304293||_0x15d91a(0x158))+'\x20--profile\x20'+_0x1a6713)});_0x3e458b=_0x16dcdb,console['log'](a4_0x3d8a18[_0x15d91a(0x164)](_0x15d91a(0x112)+_0x16dcdb));}}}}if(!_0x3e458b)return console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x100)](_0x15d91a(0x11c))),console[_0x15d91a(0xf5)](_0x15d91a(0x151)),console['log'](_0x15d91a(0xeb)),console[_0x15d91a(0xf5)](_0x15d91a(0xfe)),console[_0x15d91a(0xf5)](_0x15d91a(0x166)),0x1;if(!_0x304293)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x15d91a(0x127),undefined,{'helpText':_0x15d91a(0x15f)});if(!_0x3bdd5e&&!_0x4e26b6){if(!isInteractive())return console[_0x15d91a(0x153)](a4_0x3d8a18[_0x15d91a(0x177)](_0x15d91a(0x14f)),_0x15d91a(0x16b)),console['error'](a4_0x3d8a18[_0x15d91a(0x164)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xc5c6b2=await confirmKey('Clone\x20\x22'+_0x3e458b+_0x15d91a(0x14c)+_0x304293+'\x22?');if(!_0xc5c6b2)return console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x100)](_0x15d91a(0x16a))),0x1;}const {data:_0x183914}=await withSpinner(_0x15d91a(0x129)+_0x3e458b+_0x15d91a(0x14a)+_0x304293+_0x15d91a(0xca),()=>_0x483d0d['llm'][_0x15d91a(0x15b)](_0x3e458b,_0x304293,{'dryRun':_0x4e26b6}));if(_0x4e26b6){console[_0x15d91a(0xf5)](a4_0x3d8a18['yellow'](_0x15d91a(0x136))),console[_0x15d91a(0xf5)](_0x15d91a(0x160)+_0x183914[_0x15d91a(0x11e)]),console[_0x15d91a(0xf5)](_0x15d91a(0xbd)+_0x304293),console[_0x15d91a(0xf5)]('Would\x20clone:'),console[_0x15d91a(0xf5)](_0x15d91a(0x117)+_0x183914[_0x15d91a(0x149)][_0x15d91a(0x159)][_0x15d91a(0x10c)]),console[_0x15d91a(0xf5)](_0x15d91a(0x148)+_0x183914[_0x15d91a(0x149)][_0x15d91a(0xda)]['created']),console[_0x15d91a(0xf5)]('\x20\x20Prompts:\x20'+_0x183914[_0x15d91a(0x149)][_0x15d91a(0xcd)][_0x15d91a(0x10c)]),console[_0x15d91a(0xf5)](_0x15d91a(0xce)+_0x183914['counts'][_0x15d91a(0x154)][_0x15d91a(0x10c)]),console[_0x15d91a(0xf5)](_0x15d91a(0x110)+_0x183914['counts']['chatInterfaces'][_0x15d91a(0x10c)]);const _0x73beb5=_0x183914[_0x15d91a(0x149)][_0x15d91a(0x109)][_0x15d91a(0x10c)]>0x0||_0x183914[_0x15d91a(0x149)][_0x15d91a(0xe3)][_0x15d91a(0x10c)]>0x0;return _0x73beb5&&(console['log'](_0x15d91a(0x125)+_0x183914[_0x15d91a(0x149)][_0x15d91a(0x109)]['created']),console[_0x15d91a(0xf5)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x183914[_0x15d91a(0x149)][_0x15d91a(0xe3)][_0x15d91a(0x10c)])),0x0;}const _0x296f10=_0x183914[_0x15d91a(0x149)][_0x15d91a(0x159)][_0x15d91a(0xba)]>0x0||_0x183914[_0x15d91a(0x149)][_0x15d91a(0xda)]['errors']>0x0||_0x183914['counts'][_0x15d91a(0xcd)][_0x15d91a(0xba)]>0x0||_0x183914[_0x15d91a(0x149)][_0x15d91a(0x154)][_0x15d91a(0xba)]>0x0||_0x183914['counts'][_0x15d91a(0xd7)][_0x15d91a(0xba)]>0x0||_0x183914[_0x15d91a(0x149)]['experimentalKnowledgeBases'][_0x15d91a(0xba)]>0x0||_0x183914[_0x15d91a(0x149)][_0x15d91a(0xe3)]['errors']>0x0;_0x296f10?console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x100)](_0x15d91a(0xc4))):console[_0x15d91a(0xf5)](a4_0x3d8a18['green'](_0x15d91a(0xfa)));console[_0x15d91a(0xf5)]('Source:\x20'+_0x183914[_0x15d91a(0x11e)]),console[_0x15d91a(0xf5)](_0x15d91a(0xbd)+_0x183914[_0x15d91a(0xed)]),console['log'](_0x15d91a(0x163)+_0x183914[_0x15d91a(0x12b)]),console[_0x15d91a(0xf5)](),console[_0x15d91a(0xf5)]('Summary:'),console['log'](_0x15d91a(0x117)+formatCountSummary(_0x183914[_0x15d91a(0x149)][_0x15d91a(0x159)])),console[_0x15d91a(0xf5)](_0x15d91a(0x148)+formatCountSummary(_0x183914[_0x15d91a(0x149)]['knowledgeBases'])),console['log'](_0x15d91a(0xd6)+formatCountSummary(_0x183914['counts'][_0x15d91a(0xcd)])),console['log'](_0x15d91a(0x155)+formatCountSummary(_0x183914[_0x15d91a(0x149)][_0x15d91a(0xd9)])),console[_0x15d91a(0xf5)](_0x15d91a(0xce)+formatCountSummary(_0x183914[_0x15d91a(0x149)][_0x15d91a(0x154)])),console[_0x15d91a(0xf5)](_0x15d91a(0x110)+formatCountSummary(_0x183914['counts']['chatInterfaces']));const _0x43df06=_0x183914[_0x15d91a(0x149)][_0x15d91a(0x109)][_0x15d91a(0x10c)]>0x0||_0x183914['counts'][_0x15d91a(0x109)][_0x15d91a(0xdb)]>0x0||_0x183914['counts'][_0x15d91a(0x109)]['unchanged']>0x0||_0x183914[_0x15d91a(0x149)][_0x15d91a(0xe3)]['created']>0x0||_0x183914['counts'][_0x15d91a(0xe3)][_0x15d91a(0xdb)]>0x0||_0x183914[_0x15d91a(0x149)][_0x15d91a(0xe3)][_0x15d91a(0x15e)]>0x0;_0x43df06&&(console['log'](_0x15d91a(0x125)+formatCountSummary(_0x183914[_0x15d91a(0x149)][_0x15d91a(0x109)])),console['log'](_0x15d91a(0xbc)+formatCountSummary(_0x183914[_0x15d91a(0x149)][_0x15d91a(0xe3)])));if(_0x296f10){console[_0x15d91a(0xf5)](),console['log'](a4_0x3d8a18[_0x15d91a(0x177)](_0x15d91a(0x121)));for(const _0x3bac60 of _0x183914[_0x15d91a(0x159)]){_0x3bac60[_0x15d91a(0x16d)]===_0x15d91a(0x153)&&console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x177)](_0x15d91a(0x128)+_0x3bac60[_0x15d91a(0x11f)]+_0x15d91a(0x176)+_0x3bac60[_0x15d91a(0x153)]));}for(const _0x81917f of _0x183914['knowledgeBases']){_0x81917f[_0x15d91a(0x16d)]===_0x15d91a(0x153)&&console['log'](a4_0x3d8a18['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x81917f['name']+_0x15d91a(0x176)+_0x81917f[_0x15d91a(0x153)]));}for(const _0x52962a of _0x183914['prompts']){_0x52962a['action']===_0x15d91a(0x153)&&console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x177)](_0x15d91a(0xee)+_0x52962a[_0x15d91a(0x114)]+_0x15d91a(0x176)+_0x52962a[_0x15d91a(0x153)]));}for(const _0xad4fb6 of _0x183914[_0x15d91a(0xd9)]){_0xad4fb6[_0x15d91a(0x16d)]==='error'&&console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x177)](_0x15d91a(0x116)+_0xad4fb6[_0x15d91a(0x114)]+_0x15d91a(0x176)+_0xad4fb6[_0x15d91a(0x153)]));}for(const _0x2bda7a of _0x183914[_0x15d91a(0x154)]){_0x2bda7a[_0x15d91a(0x16d)]===_0x15d91a(0x153)&&console['log'](a4_0x3d8a18[_0x15d91a(0x177)](_0x15d91a(0x11a)+_0x2bda7a['name']+_0x15d91a(0x176)+_0x2bda7a[_0x15d91a(0x153)]));}for(const _0x13e47e of _0x183914[_0x15d91a(0xd7)]){_0x13e47e[_0x15d91a(0x16d)]==='error'&&console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x177)]('\x20\x20Chat\x20Interface\x20\x22'+_0x13e47e[_0x15d91a(0x114)]+_0x15d91a(0x176)+_0x13e47e[_0x15d91a(0x153)]));}for(const _0x3dbb4b of _0x183914[_0x15d91a(0x109)]){_0x3dbb4b['action']===_0x15d91a(0x153)&&console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x177)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x3dbb4b['name']+'\x22:\x20'+_0x3dbb4b[_0x15d91a(0x153)]));}for(const _0xd2677b of _0x183914[_0x15d91a(0xe3)]){_0xd2677b[_0x15d91a(0x16d)]===_0x15d91a(0x153)&&console[_0x15d91a(0xf5)](a4_0x3d8a18[_0x15d91a(0x177)](_0x15d91a(0x101)+_0xd2677b[_0x15d91a(0x114)]+'\x22:\x20'+_0xd2677b['error']));}return 0x1;}console['log']();const _0x14a475=getLLMProjectUrl(_0x4237a4,_0x183914['newProjectId']);return console[_0x15d91a(0xf5)](_0x15d91a(0x13a)+a4_0x3d8a18[_0x15d91a(0xc9)](_0x14a475)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x266e20(0x114)]=a4_0x266e20(0x10d);[a4_0x266e20(0x13f)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x266e20(0xd5)](_0x42cefe){const _0x26aa54=a4_0x266e20,{options:_0x7efd54,args:_0x19241d,tdx:_0x411daa}=_0x42cefe;let _0x17bafc=_0x19241d[0x0]||process['cwd']();const _0x4814b7=_0x7efd54['dryRun'],_0x1f921a=_0x7efd54['force'],_0x5da212=_0x7efd54[_0x26aa54(0xe1)],_0x599b92=_0x7efd54[_0x26aa54(0x137)],_0x2d45e7=a4_0x213baf[_0x26aa54(0xfc)](_0x17bafc,'agent.yml'),_0x259574=existsSync(_0x2d45e7);if(_0x259574){const {data:_0x51c6e7}=await withSpinner(_0x26aa54(0x11d)+_0x17bafc+_0x26aa54(0xca),()=>_0x411daa[_0x26aa54(0xe0)]['pushAgent'](_0x17bafc,{'dryRun':_0x4814b7,'force':_0x1f921a}));if(_0x4814b7)return console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x100)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x26aa54(0xf5)]('Would\x20push\x20agent:\x20'+_0x51c6e7[_0x26aa54(0x11f)]),0x0;if(_0x51c6e7[_0x26aa54(0x16d)]===_0x26aa54(0x153))return console[_0x26aa54(0xf5)](a4_0x3d8a18['red'](_0x26aa54(0xf6)+_0x51c6e7[_0x26aa54(0x153)])),0x1;console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0xf9)](_0x26aa54(0x104)+_0x51c6e7[_0x26aa54(0x16d)]+_0x26aa54(0x156))),console[_0x26aa54(0xf5)](_0x26aa54(0x178)+_0x51c6e7[_0x26aa54(0x11f)]);if(_0x51c6e7['agentId']&&_0x51c6e7[_0x26aa54(0x16c)]){const _0x43af4f=getLLMAgentChatUrl(_0x599b92,_0x51c6e7['projectId'],_0x51c6e7[_0x26aa54(0x106)]);console[_0x26aa54(0xf5)](_0x26aa54(0xbb)+a4_0x3d8a18[_0x26aa54(0xc9)](_0x43af4f));}return 0x0;}const _0x321574=_0x7efd54[_0x26aa54(0xe8)],_0x50c8e7=resolveProjectFromContext(_0x17bafc,_0x321574);if(_0x50c8e7[_0x26aa54(0xcc)])_0x17bafc=_0x50c8e7['projectDir'],_0x50c8e7[_0x26aa54(0x134)]==='context'&&console[_0x26aa54(0xf5)](a4_0x3d8a18['dim']('Using\x20project:\x20'+_0x17bafc));else{let _0x397883=_0x26aa54(0x14e);_0x50c8e7['reason']===_0x26aa54(0xd8)&&(_0x397883=_0x50c8e7[_0x26aa54(0x12d)]+_0x26aa54(0xc5)+_0x50c8e7[_0x26aa54(0xe8)]+_0x26aa54(0x145));throw new SDKError(ErrorCode[_0x26aa54(0xf0)],_0x50c8e7['reason']===_0x26aa54(0x124)?_0x50c8e7['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x17bafc,undefined,{'helpText':_0x397883});}const {data:_0x59d71b}=await withSpinner(_0x26aa54(0xd3),()=>_0x411daa[_0x26aa54(0xe0)]['pushProject'](_0x17bafc,{'dryRun':!![]})),_0x33c197=_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x159)]['errors']>0x0;if(_0x33c197){console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x177)](_0x26aa54(0xe2)));for(const _0x1c146b of _0x59d71b[_0x26aa54(0x159)]){_0x1c146b[_0x26aa54(0x16d)]===_0x26aa54(0x153)&&console[_0x26aa54(0xf5)](a4_0x3d8a18['red']('\x20\x20Agent\x20\x22'+_0x1c146b[_0x26aa54(0x11f)]+'\x22:\x20'+_0x1c146b[_0x26aa54(0x153)]));}return 0x1;}const _0x5c233f=_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x159)][_0x26aa54(0x10c)]+_0x59d71b['counts'][_0x26aa54(0xda)]['created']+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x15a)][_0x26aa54(0x10c)]+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xcd)][_0x26aa54(0x10c)]+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xd9)][_0x26aa54(0x10c)]+_0x59d71b['counts'][_0x26aa54(0x109)][_0x26aa54(0x10c)]+_0x59d71b['counts']['experimentalArtifacts']['created']+_0x59d71b['counts']['formInterfaces']['created']+_0x59d71b['counts'][_0x26aa54(0xd7)]['created'],_0x9cc5c3=_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x159)][_0x26aa54(0xdb)]+_0x59d71b['counts'][_0x26aa54(0xda)][_0x26aa54(0xdb)]+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x15a)][_0x26aa54(0xdb)]+_0x59d71b['counts'][_0x26aa54(0xcd)][_0x26aa54(0xdb)]+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xd9)]['updated']+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x109)][_0x26aa54(0xdb)]+_0x59d71b['counts'][_0x26aa54(0xe3)][_0x26aa54(0xdb)]+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x154)][_0x26aa54(0xdb)]+_0x59d71b['counts'][_0x26aa54(0xd7)][_0x26aa54(0xdb)],_0x17c5f0=_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x159)][_0x26aa54(0x15e)]+_0x59d71b['counts'][_0x26aa54(0xda)]['unchanged']+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x15a)][_0x26aa54(0x15e)]+_0x59d71b['counts'][_0x26aa54(0xcd)][_0x26aa54(0x15e)]+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xd9)]['unchanged']+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x109)][_0x26aa54(0x15e)]+_0x59d71b[_0x26aa54(0x149)]['experimentalArtifacts']['unchanged']+_0x59d71b[_0x26aa54(0x149)]['formInterfaces'][_0x26aa54(0x15e)]+_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xd7)][_0x26aa54(0x15e)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x59d71b[_0x26aa54(0xdc)]+'\x27:'),console[_0x26aa54(0xf5)]('\x20\x20'+a4_0x3d8a18[_0x26aa54(0xf9)]('+\x20'+_0x5c233f+_0x26aa54(0x12a))+'\x20|\x20'+a4_0x3d8a18[_0x26aa54(0x100)]('~\x20'+_0x9cc5c3+_0x26aa54(0xc7))+_0x26aa54(0xd4)+a4_0x3d8a18[_0x26aa54(0x164)]('=\x20'+_0x17c5f0+'\x20unchanged')),console[_0x26aa54(0xf5)](_0x26aa54(0x117)+formatCountSummary(_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x159)])),console[_0x26aa54(0xf5)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x59d71b[_0x26aa54(0x149)]['knowledgeBases'])),console['log'](_0x26aa54(0x173)+formatCountSummary(_0x59d71b['counts']['textKnowledgeBases'])),console[_0x26aa54(0xf5)](_0x26aa54(0xd6)+formatCountSummary(_0x59d71b['counts'][_0x26aa54(0xcd)])),console[_0x26aa54(0xf5)](_0x26aa54(0x155)+formatCountSummary(_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xd9)])),console[_0x26aa54(0xf5)](_0x26aa54(0xce)+formatCountSummary(_0x59d71b['counts'][_0x26aa54(0x154)])),console[_0x26aa54(0xf5)](_0x26aa54(0x110)+formatCountSummary(_0x59d71b[_0x26aa54(0x149)]['chatInterfaces']));const _0x15974c=_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x109)][_0x26aa54(0x10c)]>0x0||_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x109)][_0x26aa54(0xdb)]>0x0||_0x59d71b[_0x26aa54(0x149)]['experimentalKnowledgeBases'][_0x26aa54(0x15e)]>0x0||_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xe3)]['created']>0x0||_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xe3)][_0x26aa54(0xdb)]>0x0||_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xe3)][_0x26aa54(0x15e)]>0x0;_0x15974c&&(console[_0x26aa54(0xf5)](_0x26aa54(0x125)+formatCountSummary(_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0x109)])),console['log'](_0x26aa54(0xbc)+formatCountSummary(_0x59d71b[_0x26aa54(0x149)][_0x26aa54(0xe3)])));console[_0x26aa54(0xf5)]('\x20\x20Source:\x20'+a4_0x3d8a18[_0x26aa54(0xc9)](_0x17bafc)),displayDiffs(_0x59d71b['agents'],_0x59d71b[_0x26aa54(0xda)],_0x59d71b[_0x26aa54(0x15a)],_0x59d71b[_0x26aa54(0xcd)],_0x59d71b['integrations'],_0x59d71b[_0x26aa54(0x109)],_0x59d71b['experimentalArtifacts'],_0x59d71b[_0x26aa54(0x154)],_0x59d71b[_0x26aa54(0xd7)]);if(_0x4814b7)return console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x100)](_0x26aa54(0x13e))),0x0;if(_0x5c233f===0x0&&_0x9cc5c3===0x0){console['log'](a4_0x3d8a18['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4385e9=getLLMProjectUrl(_0x599b92,_0x59d71b['projectId']);return console[_0x26aa54(0xf5)](_0x26aa54(0x13a)+a4_0x3d8a18['cyan'](_0x4385e9)),0x0;}if(!_0x5da212&&!_0x1f921a){if(!isInteractive())return console[_0x26aa54(0x153)](a4_0x3d8a18[_0x26aa54(0x177)](_0x26aa54(0x14f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x26aa54(0x153)](a4_0x3d8a18[_0x26aa54(0x164)](_0x26aa54(0x113))),0x1;const _0x26118f=await confirmKey(_0x26aa54(0x132)+(_0x5c233f+_0x9cc5c3)+_0x26aa54(0x16e));if(!_0x26118f)return console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x100)](_0x26aa54(0x16a)),_0x26aa54(0x139)),0x1;}const {data:_0x34fe8e}=await withSpinner(_0x26aa54(0xdf),()=>_0x411daa[_0x26aa54(0xe0)]['pushProject'](_0x17bafc,{'force':_0x1f921a})),_0x38f0a4=_0x34fe8e[_0x26aa54(0x149)][_0x26aa54(0x159)]['errors']>0x0||_0x34fe8e['counts']['knowledgeBases'][_0x26aa54(0xba)]>0x0||_0x34fe8e['counts'][_0x26aa54(0x15a)][_0x26aa54(0xba)]>0x0||_0x34fe8e[_0x26aa54(0x149)][_0x26aa54(0xcd)][_0x26aa54(0xba)]>0x0||_0x34fe8e[_0x26aa54(0x149)][_0x26aa54(0x154)][_0x26aa54(0xba)]>0x0||_0x34fe8e['counts'][_0x26aa54(0xd7)]['errors']>0x0;if(_0x38f0a4){console['log'](a4_0x3d8a18[_0x26aa54(0x100)](_0x26aa54(0x157))),console[_0x26aa54(0xf5)](),console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x177)](_0x26aa54(0x121)));for(const _0x324bad of _0x34fe8e[_0x26aa54(0x159)]){_0x324bad[_0x26aa54(0x16d)]===_0x26aa54(0x153)&&console[_0x26aa54(0xf5)](a4_0x3d8a18['red'](_0x26aa54(0x128)+_0x324bad['agentName']+'\x22:\x20'+_0x324bad[_0x26aa54(0x153)]));}for(const _0x8e3336 of _0x34fe8e['knowledgeBases']){_0x8e3336[_0x26aa54(0x16d)]===_0x26aa54(0x153)&&console[_0x26aa54(0xf5)](a4_0x3d8a18['red'](_0x26aa54(0x14b)+_0x8e3336[_0x26aa54(0x114)]+_0x26aa54(0x176)+_0x8e3336[_0x26aa54(0x153)]));}for(const _0x3ae8fa of _0x34fe8e[_0x26aa54(0x15a)]){_0x3ae8fa[_0x26aa54(0x16d)]===_0x26aa54(0x153)&&console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x177)](_0x26aa54(0x161)+_0x3ae8fa['name']+_0x26aa54(0x176)+_0x3ae8fa['error']));}for(const _0x1b9c26 of _0x34fe8e[_0x26aa54(0xcd)]){_0x1b9c26[_0x26aa54(0x16d)]===_0x26aa54(0x153)&&console[_0x26aa54(0xf5)](a4_0x3d8a18['red'](_0x26aa54(0xee)+_0x1b9c26[_0x26aa54(0x114)]+'\x22:\x20'+_0x1b9c26[_0x26aa54(0x153)]));}for(const _0x10a897 of _0x34fe8e[_0x26aa54(0xd9)]){_0x10a897[_0x26aa54(0x16d)]===_0x26aa54(0x153)&&console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x177)](_0x26aa54(0x116)+_0x10a897[_0x26aa54(0x114)]+'\x22:\x20'+_0x10a897[_0x26aa54(0x153)]));}for(const _0x4458e4 of _0x34fe8e['formInterfaces']){_0x4458e4[_0x26aa54(0x16d)]==='error'&&console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x177)](_0x26aa54(0x11a)+_0x4458e4[_0x26aa54(0x114)]+_0x26aa54(0x176)+_0x4458e4[_0x26aa54(0x153)]));}for(const _0x3bdf9c of _0x34fe8e[_0x26aa54(0xd7)]){_0x3bdf9c[_0x26aa54(0x16d)]==='error'&&console[_0x26aa54(0xf5)](a4_0x3d8a18[_0x26aa54(0x177)](_0x26aa54(0x10b)+_0x3bdf9c[_0x26aa54(0x114)]+_0x26aa54(0x176)+_0x3bdf9c[_0x26aa54(0x153)]));}return 0x1;}console['log'](a4_0x3d8a18[_0x26aa54(0xf9)](_0x26aa54(0x167)+(_0x5c233f+_0x9cc5c3)+_0x26aa54(0xf4)+_0x34fe8e['projectName']+'\x27'));const _0x15f0ba=getLLMProjectUrl(_0x599b92,_0x34fe8e[_0x26aa54(0x16c)]);return console[_0x26aa54(0xf5)]('Project:\x20'+a4_0x3d8a18[_0x26aa54(0xc9)](_0x15f0ba)),0x0;}}
|
|
1
|
+
const a4_0x2b5988=a4_0x76c6;(function(_0xbf8da2,_0xc4568e){const _0x555bbd=a4_0x76c6,_0x540447=_0xbf8da2();while(!![]){try{const _0x58ce43=parseInt(_0x555bbd(0x11b))/0x1+-parseInt(_0x555bbd(0xf9))/0x2+-parseInt(_0x555bbd(0x168))/0x3+-parseInt(_0x555bbd(0xe8))/0x4*(-parseInt(_0x555bbd(0x165))/0x5)+-parseInt(_0x555bbd(0x15e))/0x6*(-parseInt(_0x555bbd(0x181))/0x7)+parseInt(_0x555bbd(0x184))/0x8+parseInt(_0x555bbd(0x10f))/0x9;if(_0x58ce43===_0xc4568e)break;else _0x540447['push'](_0x540447['shift']());}catch(_0x423006){_0x540447['push'](_0x540447['shift']());}}}(a4_0x544e,0xda599));import a4_0x54d7bb from'chalk';import a4_0x20158c 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';function a4_0x76c6(_0x4acd41,_0x4bb614){_0x4acd41=_0x4acd41-0xdc;const _0x544edf=a4_0x544e();let _0x76c6a7=_0x544edf[_0x4acd41];return _0x76c6a7;}function a4_0x544e(){const _0x340f6e=['\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','knowledgeBases','502997zlGbTI','Project:\x20','\x20changed','\x20resources\x20to\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Prompts:\x20','\x20\x20Experimental\x20Artifacts:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Source:\x20','Cancelled','\x20\x20Knowledge\x20Base\x20\x22','counts','\x20total','unchanged','\x20\x20Source:\x20','\x20\x20Chat\x20Interface\x20\x22','\x20new','chatInterfaces','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','created','reason','\x0aProject\x20pushed\x20with\x20errors','projectId','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Project\x20cloned\x20successfully','\x22\x20to\x20\x22','experimentalKnowledgeBases','\x20unchanged','\x20files\x20to\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','session','\x20|\x20','llm_project','\x20\x20Prompt\x20\x22','parse','\x22\x20to\x20new\x20project\x20\x22','no_local_folder','Dry\x20run\x20-\x20no\x20files\x20written','log','yellow','repeat','Using\x20current\x20project:\x20','agent:push','gray','name','formInterfaces','\x20--name\x20','utf-8','INVALID_ARGUMENT','\x20\x20Text\x20Knowledge\x20Bases:\x20','action','red','tdx.json','✔\x20Context\x20set:\x20','\x20\x20Target:\x20','Failed\x20to\x20push\x20agent:\x20','\x20successfully','pushProject','arg-dir','dim','\x22:\x20','yes','integrations','<new-name>','\x0aChanges\x20to\x20form\x20interface\x20\x27','188772vRdfFQ','updated','experimentalArtifacts','\x20\x20Experimental\x20Artifact\x20\x22','outputDir','dirname','\x20\x20tdx\x20agent\x20clone\x20agents/','147895GdDMpx','\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)','Agent:\x20','3660411LvLbKh','Cloning\x20\x22','force','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x20\x20Text\x20Knowledge\x20Base\x20\x22','llm','Using\x20context\x20project:\x20','Using\x20project\x20from\x20context:\x20','Errors:','dryRun','Pulling\x20agent\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aWrite\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','New\x20project\x20ID:\x20','cwd','\x22\x20from\x20project\x20\x22','Using\x20local\x20project:\x20','Status:\x20','\x20created','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\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','total','Output\x20path:\x20','133OEWJjm','\x0aPull\x20summary\x20for\x20\x27','join','2887936mSMCKm','-\x20no\x20files\x20written','green','\x20\x20Chat\x20Interfaces:\x20','new','isNew','\x20\x20Knowledge\x20Bases:\x20','\x0aError:','\x20=\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','agents','\x20errors','\x20files?','source','agent','Project\x20cloned\x20with\x20errors','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','-\x20nothing\x20pushed','\x0aChanges:','no_context','cwd-config','push','message','context','\x20\x20Form\x20Interface\x20\x22','Chat:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','newProjectId','pullProject','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','sourceProjectName','Pushing\x20agent\x20from\x20\x22','New\x20project:\x20','agentId','cyan','Summary:','Clone\x20\x22','execute','\x20\x20Agent\x20\x22','52aWgXha','newProjectName','projectName','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Would\x20push\x20agent:\x20','New\x20project\x20name\x20is\x20required','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Agent\x20pulled\x20successfully','agent.yml','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Integrations:\x20','\x0a✔\x20Pulled\x20','description','\x20--profile\x20','pullAgent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','163190ZtPEzj','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Pushing\x20to\x20project...','\x0a✔\x20Pushed\x20','diff','Analyzing\x20changes\x20to\x20push...','site','\x20\x20Form\x20Interfaces:\x20','errors','cloneProject','\x0aErrors\x20found:','Using\x20project\x20from\x20','Dry\x20run\x20-\x20no\x20changes\x20made','llmProject','Analyzing\x20project\x20\x22','prompts','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','error','Writing\x20files...','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Using\x20project:\x20','3148191IpBBLM','agentName','\x22...','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','textKnowledgeBases','agent:clone','\x20\x20Agents:\x20','hasChanges','\x0aChanges\x20to\x20agent\x20\x27'];a4_0x544e=function(){return _0x340f6e;};return a4_0x544e();}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(_0x3a435e){const _0x251411=a4_0x76c6,_0x51a6f1=[];if(_0x3a435e[_0x251411(0x17f)]!==undefined)_0x51a6f1[_0x251411(0x199)](_0x3a435e[_0x251411(0x17f)]+_0x251411(0x127));if(_0x3a435e[_0x251411(0x188)]!==undefined&&_0x3a435e['new']>0x0)_0x51a6f1['push'](a4_0x54d7bb[_0x251411(0x186)](_0x3a435e[_0x251411(0x188)]+_0x251411(0x12b)));if(_0x3a435e[_0x251411(0x12e)]!==undefined&&_0x3a435e[_0x251411(0x12e)]>0x0)_0x51a6f1[_0x251411(0x199)](a4_0x54d7bb[_0x251411(0x186)](_0x3a435e[_0x251411(0x12e)]+_0x251411(0x17c)));if(_0x3a435e[_0x251411(0x15f)]!==undefined&&_0x3a435e[_0x251411(0x15f)]>0x0)_0x51a6f1[_0x251411(0x199)](a4_0x54d7bb[_0x251411(0x144)](_0x3a435e['updated']+'\x20updated'));if(_0x3a435e['unchanged']!==undefined&&_0x3a435e[_0x251411(0x128)]>0x0)_0x51a6f1[_0x251411(0x199)](a4_0x54d7bb[_0x251411(0x148)](_0x3a435e['unchanged']+_0x251411(0x138)));if(_0x3a435e[_0x251411(0x101)]!==undefined&&_0x3a435e[_0x251411(0x101)]>0x0)_0x51a6f1[_0x251411(0x199)](a4_0x54d7bb[_0x251411(0x150)](_0x3a435e[_0x251411(0x101)]+_0x251411(0x18f)));return _0x51a6f1[_0x251411(0x183)](',\x20');}function displayDiffs(_0x2b74af,_0x2f0d3f,_0x36e941,_0x232a57,_0x1a277c,_0x3019b1,_0x409e6a,_0x494c78,_0x2e3a30){const _0x15e13c=a4_0x76c6;for(const _0x2ef09a of _0x2b74af){if(_0x2ef09a[_0x15e13c(0xfd)]){const _0xa3bead=_0x2ef09a[_0x15e13c(0x110)]||_0x2ef09a[_0x15e13c(0x149)];console[_0x15e13c(0x143)](_0x15e13c(0x117)+_0xa3bead+'\x27:'),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)),console[_0x15e13c(0x143)](_0x2ef09a[_0x15e13c(0xfd)]),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c));}}for(const _0x17f1f8 of _0x2f0d3f){_0x17f1f8[_0x15e13c(0xfd)]&&(console[_0x15e13c(0x143)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x17f1f8[_0x15e13c(0x149)]+'\x27:'),console['log']('─'[_0x15e13c(0x145)](0x3c)),console[_0x15e13c(0x143)](_0x17f1f8[_0x15e13c(0xfd)]),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)));}for(const _0x2625e9 of _0x36e941){_0x2625e9[_0x15e13c(0xfd)]&&(console[_0x15e13c(0x143)](_0x15e13c(0x13a)+_0x2625e9['name']+'\x27:'),console[_0x15e13c(0x143)]('─'['repeat'](0x3c)),console[_0x15e13c(0x143)](_0x2625e9['diff']),console[_0x15e13c(0x143)]('─'['repeat'](0x3c)));}for(const _0x3cc715 of _0x232a57){_0x3cc715[_0x15e13c(0xfd)]&&(console[_0x15e13c(0x143)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x3cc715[_0x15e13c(0x149)]+'\x27:'),console['log']('─'[_0x15e13c(0x145)](0x3c)),console[_0x15e13c(0x143)](_0x3cc715[_0x15e13c(0xfd)]),console['log']('─'[_0x15e13c(0x145)](0x3c)));}for(const _0x4fc9a6 of _0x1a277c){_0x4fc9a6[_0x15e13c(0xfd)]&&(console[_0x15e13c(0x143)](_0x15e13c(0xf1)+_0x4fc9a6[_0x15e13c(0x149)]+'\x27:'),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)),console[_0x15e13c(0x143)](_0x4fc9a6[_0x15e13c(0xfd)]),console[_0x15e13c(0x143)]('─'['repeat'](0x3c)));}for(const _0x1829aa of _0x3019b1){_0x1829aa[_0x15e13c(0xfd)]&&(console[_0x15e13c(0x143)](_0x15e13c(0x118)+_0x1829aa[_0x15e13c(0x149)]+'\x27:'),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)),console[_0x15e13c(0x143)](_0x1829aa[_0x15e13c(0xfd)]),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)));}for(const _0x3f056f of _0x409e6a){_0x3f056f[_0x15e13c(0xfd)]&&(console['log'](_0x15e13c(0x133)+_0x3f056f[_0x15e13c(0x149)]+'\x27:'),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)),console[_0x15e13c(0x143)](_0x3f056f['diff']),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)));}for(const _0x4aac69 of _0x494c78){_0x4aac69['diff']&&(console[_0x15e13c(0x143)](_0x15e13c(0x15d)+_0x4aac69[_0x15e13c(0x149)]+'\x27:'),console[_0x15e13c(0x143)]('─'['repeat'](0x3c)),console[_0x15e13c(0x143)](_0x4aac69['diff']),console[_0x15e13c(0x143)]('─'['repeat'](0x3c)));}for(const _0x324984 of _0x2e3a30){_0x324984[_0x15e13c(0xfd)]&&(console[_0x15e13c(0x143)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x324984['name']+'\x27:'),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)),console['log'](_0x324984[_0x15e13c(0xfd)]),console[_0x15e13c(0x143)]('─'[_0x15e13c(0x145)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x2b5988(0xf4)]=a4_0x2b5988(0x11f);async['execute'](_0x265ab2){const _0x481e35=a4_0x2b5988,{options:_0x41181c,args:_0x11e7ba,tdx:_0xc4c44}=_0x265ab2,_0x520979=_0x11e7ba[0x0],_0x12692e=_0x11e7ba[0x1],_0x4b9207=_0x41181c['output'],_0x125a6e=_0x41181c[_0x481e35(0x171)],_0x28e97=_0x41181c['force'],_0x59441c=_0x41181c['yes'],_0x24d5ab=_0x41181c[_0x481e35(0x106)],_0x2f345d=_0x41181c[_0x481e35(0x192)];let _0x352a3c;if(_0x520979){const _0x150397=a4_0x20158c['join'](_0x520979,_0x481e35(0x151));if(existsSync(_0x150397))try{const _0x25bc08=JSON[_0x481e35(0x13f)](readFileSync(_0x150397,'utf-8'));_0x25bc08[_0x481e35(0x13d)]&&(_0x352a3c={'llm_project':_0x25bc08['llm_project']});}catch{}}const _0x3e4204=findAgentConfigPath(process[_0x481e35(0x178)]());let _0x152906;if(_0x3e4204)try{const _0x398810=JSON[_0x481e35(0x13f)](readFileSync(_0x3e4204,_0x481e35(0x14c)));_0x398810[_0x481e35(0x13d)]&&(_0x152906={'llm_project':_0x398810['llm_project']});}catch{}const _0x453431=resolveAgentPullArgs({'arg':_0x520979,'agentNameArg':_0x12692e,'agentFlag':_0x2f345d,'contextProject':_0x24d5ab,'argDirConfig':_0x352a3c,'cwdConfigPath':_0x3e4204||undefined,'cwdConfig':_0x152906}),{projectNameOrId:_0x29cb78,targetAgentName:_0x44183b,existingOutputDir:_0x412884,source:_0x1f8a00}=_0x453431;if(_0x1f8a00===_0x481e35(0x157))console[_0x481e35(0x143)](a4_0x54d7bb['dim'](_0x481e35(0x104)+a4_0x20158c[_0x481e35(0x183)](_0x520979,_0x481e35(0x151))+':\x20'+_0x29cb78));else{if(_0x1f8a00===_0x481e35(0x198))console[_0x481e35(0x143)](a4_0x54d7bb[_0x481e35(0x158)](_0x481e35(0x10e)+_0x29cb78));else _0x1f8a00===_0x481e35(0x19b)&&console['log'](a4_0x54d7bb[_0x481e35(0x158)](_0x481e35(0x16f)+_0x29cb78));}if(!_0x29cb78)return _0x2f345d?(console['log'](a4_0x54d7bb[_0x481e35(0x144)](_0x481e35(0x18d))),console[_0x481e35(0x143)](_0x481e35(0x176)),console['log'](_0x481e35(0xf8))):(console[_0x481e35(0x143)](a4_0x54d7bb[_0x481e35(0x144)](_0x481e35(0x10a))),console[_0x481e35(0x143)](_0x481e35(0x19e)),console[_0x481e35(0x143)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0x481e35(0x16b)),console[_0x481e35(0x143)](_0x481e35(0x17e))),0x1;if(_0x44183b){const {data:_0x2616cb}=await withSpinner(_0x481e35(0x172)+_0x44183b+_0x481e35(0x179)+_0x29cb78+_0x481e35(0x111),()=>_0xc4c44[_0x481e35(0x16d)][_0x481e35(0xf6)](_0x29cb78,_0x44183b,_0x4b9207,{'dryRun':_0x125a6e,'force':_0x28e97}));if(_0x125a6e)return console[_0x481e35(0x143)](a4_0x54d7bb['yellow'](_0x481e35(0x142))),console['log'](_0x481e35(0x132)+_0x2616cb[_0x481e35(0x110)]),console['log'](_0x481e35(0x180)+_0x2616cb['outputPath']),_0x2616cb['diff']&&(console['log'](_0x481e35(0x196)),console['log']('─'[_0x481e35(0x145)](0x3c)),console[_0x481e35(0x143)](_0x2616cb['diff']),console[_0x481e35(0x143)]('─'[_0x481e35(0x145)](0x3c))),0x0;return console['log'](a4_0x54d7bb[_0x481e35(0x186)](_0x481e35(0xef))),console['log'](_0x481e35(0x167)+_0x2616cb['agentName']),console[_0x481e35(0x143)]('Output:\x20'+_0x2616cb['outputPath']),console[_0x481e35(0x143)](_0x481e35(0x17b)+(_0x2616cb[_0x481e35(0x189)]?a4_0x54d7bb[_0x481e35(0x186)](_0x481e35(0x188)):_0x2616cb[_0x481e35(0x116)]?a4_0x54d7bb[_0x481e35(0x144)](_0x481e35(0x15f)):a4_0x54d7bb[_0x481e35(0x148)](_0x481e35(0x128)))),0x0;}const _0x9ed086=_0x412884||_0x4b9207,{data:_0x3e322a}=await withSpinner(_0x481e35(0x107)+_0x29cb78+_0x481e35(0x111),()=>_0xc4c44[_0x481e35(0x16d)][_0x481e35(0xdd)](_0x29cb78,_0x9ed086,{'dryRun':!![]})),_0x23c6fa=_0x3e322a[_0x481e35(0x126)][_0x481e35(0x18e)][_0x481e35(0x188)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x11a)][_0x481e35(0x188)]+_0x3e322a['counts'][_0x481e35(0x113)][_0x481e35(0x188)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x108)][_0x481e35(0x188)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x15b)][_0x481e35(0x188)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x137)][_0x481e35(0x188)]+_0x3e322a[_0x481e35(0x126)]['experimentalArtifacts'][_0x481e35(0x188)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x14a)]['new']+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x12c)][_0x481e35(0x188)],_0x3cf52b=_0x3e322a[_0x481e35(0x126)][_0x481e35(0x18e)]['updated']+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x11a)]['updated']+_0x3e322a[_0x481e35(0x126)]['textKnowledgeBases'][_0x481e35(0x15f)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x108)]['updated']+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x15b)][_0x481e35(0x15f)]+_0x3e322a['counts'][_0x481e35(0x137)]['updated']+_0x3e322a[_0x481e35(0x126)]['experimentalArtifacts'][_0x481e35(0x15f)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x14a)]['updated']+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x12c)][_0x481e35(0x15f)],_0x4dc8a0=_0x3e322a[_0x481e35(0x126)][_0x481e35(0x18e)]['unchanged']+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x11a)][_0x481e35(0x128)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x113)][_0x481e35(0x128)]+_0x3e322a[_0x481e35(0x126)]['prompts']['unchanged']+_0x3e322a['counts'][_0x481e35(0x15b)]['unchanged']+_0x3e322a[_0x481e35(0x126)]['experimentalKnowledgeBases'][_0x481e35(0x128)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x160)][_0x481e35(0x128)]+_0x3e322a['counts'][_0x481e35(0x14a)][_0x481e35(0x128)]+_0x3e322a[_0x481e35(0x126)][_0x481e35(0x12c)][_0x481e35(0x128)];console[_0x481e35(0x143)](_0x481e35(0x182)+_0x3e322a[_0x481e35(0xea)]+'\x27:'),console[_0x481e35(0x143)]('\x20\x20'+a4_0x54d7bb[_0x481e35(0x186)]('+\x20'+_0x23c6fa+_0x481e35(0x12b))+_0x481e35(0x13c)+a4_0x54d7bb[_0x481e35(0x144)]('~\x20'+_0x3cf52b+'\x20changed')+_0x481e35(0x13c)+a4_0x54d7bb[_0x481e35(0x158)]('=\x20'+_0x4dc8a0+_0x481e35(0x138))),console[_0x481e35(0x143)](_0x481e35(0x115)+formatCountSummary(_0x3e322a[_0x481e35(0x126)]['agents'])),console[_0x481e35(0x143)](_0x481e35(0x18a)+formatCountSummary(_0x3e322a[_0x481e35(0x126)][_0x481e35(0x11a)])),console[_0x481e35(0x143)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3e322a[_0x481e35(0x126)][_0x481e35(0x113)])),console[_0x481e35(0x143)](_0x481e35(0x120)+formatCountSummary(_0x3e322a['counts'][_0x481e35(0x108)])),console[_0x481e35(0x143)](_0x481e35(0xf2)+formatCountSummary(_0x3e322a[_0x481e35(0x126)][_0x481e35(0x15b)])),console[_0x481e35(0x143)](_0x481e35(0x100)+formatCountSummary(_0x3e322a[_0x481e35(0x126)]['formInterfaces'])),console['log'](_0x481e35(0x187)+formatCountSummary(_0x3e322a[_0x481e35(0x126)][_0x481e35(0x12c)]));const _0x34974b=_0x3e322a[_0x481e35(0x126)][_0x481e35(0x137)][_0x481e35(0x17f)]>0x0||_0x3e322a['counts'][_0x481e35(0x160)][_0x481e35(0x17f)]>0x0;_0x34974b&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3e322a[_0x481e35(0x126)][_0x481e35(0x137)])),console[_0x481e35(0x143)](_0x481e35(0x121)+formatCountSummary(_0x3e322a[_0x481e35(0x126)]['experimentalArtifacts'])));console[_0x481e35(0x143)](_0x481e35(0x153)+a4_0x54d7bb[_0x481e35(0xe3)](_0x3e322a[_0x481e35(0x162)])),displayDiffs(_0x3e322a[_0x481e35(0x18e)],_0x3e322a[_0x481e35(0x11a)],_0x3e322a[_0x481e35(0x113)],_0x3e322a[_0x481e35(0x108)],_0x3e322a['integrations'],_0x3e322a['experimentalKnowledgeBases'],_0x3e322a[_0x481e35(0x160)],_0x3e322a[_0x481e35(0x14a)],_0x3e322a[_0x481e35(0x12c)]);if(_0x125a6e)return console['log'](a4_0x54d7bb[_0x481e35(0x144)](_0x481e35(0xf7))),0x0;if(_0x23c6fa===0x0&&_0x3cf52b===0x0)return console[_0x481e35(0x143)](a4_0x54d7bb[_0x481e35(0x186)](_0x481e35(0x10d))),saveSessionContext({'llm_project':_0x3e322a[_0x481e35(0xea)]},_0x41181c[_0x481e35(0x13b)]),console[_0x481e35(0x143)](a4_0x54d7bb[_0x481e35(0x186)](_0x481e35(0x152)+a4_0x54d7bb[_0x481e35(0x158)](_0x481e35(0x13d))+_0x481e35(0x18c)+a4_0x54d7bb['cyan'](_0x3e322a['projectName']))),0x0;if(!_0x59441c&&!_0x28e97){if(!isInteractive())return console[_0x481e35(0x10b)](a4_0x54d7bb[_0x481e35(0x150)](_0x481e35(0x18b)),_0x481e35(0x194)),console[_0x481e35(0x10b)](a4_0x54d7bb[_0x481e35(0x158)](_0x481e35(0x175))),0x1;const _0x2cfd2e=await confirmKey(_0x481e35(0x174)+(_0x23c6fa+_0x3cf52b)+_0x481e35(0x190));if(!_0x2cfd2e)return console['log'](a4_0x54d7bb[_0x481e35(0x144)](_0x481e35(0x124)),_0x481e35(0x185)),0x1;}const {data:_0x34452c}=await withSpinner(_0x481e35(0x10c),()=>_0xc4c44['llm'][_0x481e35(0xdd)](_0x29cb78,_0x9ed086,{'force':_0x28e97}));return console[_0x481e35(0x143)](a4_0x54d7bb[_0x481e35(0x186)](_0x481e35(0xf3)+(_0x23c6fa+_0x3cf52b)+_0x481e35(0x139)+_0x34452c[_0x481e35(0x162)])),saveSessionContext({'llm_project':_0x34452c['projectName']},_0x41181c[_0x481e35(0x13b)]),console[_0x481e35(0x143)](a4_0x54d7bb[_0x481e35(0x186)](_0x481e35(0x152)+a4_0x54d7bb['dim']('llm_project')+'\x20=\x20'+a4_0x54d7bb['cyan'](_0x34452c[_0x481e35(0xea)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2b5988(0x149)]=a4_0x2b5988(0x114);[a4_0x2b5988(0xf4)]=a4_0x2b5988(0xfa);async['execute'](_0x91185e){const _0x22b957=a4_0x2b5988,{options:_0x2d03de,args:_0x39f0cf,tdx:_0x444134}=_0x91185e,_0x4977ff=_0x39f0cf[0x0],_0x397094=_0x2d03de[_0x22b957(0x149)],_0x348510=_0x2d03de[_0x22b957(0x171)],_0x475f79=_0x2d03de[_0x22b957(0x15a)],_0x4d845d=_0x2d03de[_0x22b957(0xff)],_0x77c3ab=_0x2d03de[_0x22b957(0x106)];let _0x164b2f;const _0xc72ea0=findAgentConfigPath(process['cwd']());if(_0x4977ff){const _0x131acc=a4_0x20158c[_0x22b957(0x183)](_0x4977ff,_0x22b957(0x151));existsSync(_0x131acc)?(_0x164b2f=_0x4977ff,console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x158)](_0x22b957(0x17a)+_0x4977ff))):_0x164b2f=_0x4977ff;}else{if(_0xc72ea0)_0x164b2f=a4_0x20158c[_0x22b957(0x163)](_0xc72ea0),console['log'](a4_0x54d7bb[_0x22b957(0x158)](_0x22b957(0x146)+_0x164b2f));else{if(_0x77c3ab){const _0x16b015=sanitizeForFilesystem(_0x77c3ab);let _0x2182d8=_0x16b015,_0x3c47b2=a4_0x20158c['join'](process[_0x22b957(0x178)](),'agents',_0x16b015,_0x22b957(0x151));if(!existsSync(_0x3c47b2)){const _0x3235c8=normalizeName(_0x77c3ab),_0x2b2df5=a4_0x20158c[_0x22b957(0x183)](process[_0x22b957(0x178)](),_0x22b957(0x18e),_0x3235c8,_0x22b957(0x151));existsSync(_0x2b2df5)&&(_0x2182d8=_0x3235c8,_0x3c47b2=_0x2b2df5);}if(existsSync(_0x3c47b2))_0x164b2f=a4_0x20158c['dirname'](_0x3c47b2),console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x158)](_0x22b957(0x17a)+_0x164b2f));else{const _0x203df3=_0x2d03de['profile'];if(_0x203df3)throw new SDKError(ErrorCode[_0x22b957(0x14d)],_0x22b957(0x122)+_0x77c3ab+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x22b957(0x134)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x77c3ab+'\x0a')+(_0x22b957(0x164)+_0x2182d8+_0x22b957(0x14b)+(_0x397094||_0x22b957(0x15c))+_0x22b957(0xf5)+_0x203df3)});_0x164b2f=_0x77c3ab,console['log'](a4_0x54d7bb['dim'](_0x22b957(0x16e)+_0x77c3ab));}}}}if(!_0x164b2f)return console['log'](a4_0x54d7bb[_0x22b957(0x144)](_0x22b957(0xeb))),console[_0x22b957(0x143)](_0x22b957(0x112)),console[_0x22b957(0x143)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x22b957(0x143)](_0x22b957(0x166)),console[_0x22b957(0x143)](_0x22b957(0xde)),0x1;if(!_0x397094)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x22b957(0xed),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x475f79&&!_0x348510){if(!isInteractive())return console['error'](a4_0x54d7bb[_0x22b957(0x150)](_0x22b957(0x18b)),_0x22b957(0x194)),console[_0x22b957(0x10b)](a4_0x54d7bb['dim'](_0x22b957(0x175))),0x1;const _0x17c658=await confirmKey(_0x22b957(0xe5)+_0x164b2f+_0x22b957(0x140)+_0x397094+'\x22?');if(!_0x17c658)return console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x144)](_0x22b957(0x124))),0x1;}const {data:_0x45ef0a}=await withSpinner(_0x22b957(0x169)+_0x164b2f+_0x22b957(0x136)+_0x397094+_0x22b957(0x111),()=>_0x444134[_0x22b957(0x16d)][_0x22b957(0x102)](_0x164b2f,_0x397094,{'dryRun':_0x348510}));if(_0x348510){console['log'](a4_0x54d7bb[_0x22b957(0x144)](_0x22b957(0x105))),console[_0x22b957(0x143)](_0x22b957(0x123)+_0x45ef0a[_0x22b957(0xdf)]),console[_0x22b957(0x143)](_0x22b957(0xe1)+_0x397094),console['log']('Would\x20clone:'),console[_0x22b957(0x143)](_0x22b957(0x115)+_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x18e)]['created']),console[_0x22b957(0x143)](_0x22b957(0x18a)+_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x11a)][_0x22b957(0x12e)]),console[_0x22b957(0x143)](_0x22b957(0x120)+_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x108)][_0x22b957(0x12e)]),console[_0x22b957(0x143)]('\x20\x20Form\x20Interfaces:\x20'+_0x45ef0a[_0x22b957(0x126)]['formInterfaces'][_0x22b957(0x12e)]),console[_0x22b957(0x143)]('\x20\x20Chat\x20Interfaces:\x20'+_0x45ef0a['counts'][_0x22b957(0x12c)]['created']);const _0x10326b=_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x137)][_0x22b957(0x12e)]>0x0||_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x160)][_0x22b957(0x12e)]>0x0;return _0x10326b&&(console['log'](_0x22b957(0x12d)+_0x45ef0a[_0x22b957(0x126)]['experimentalKnowledgeBases'][_0x22b957(0x12e)]),console['log'](_0x22b957(0x121)+_0x45ef0a['counts'][_0x22b957(0x160)][_0x22b957(0x12e)])),0x0;}const _0x24b909=_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x18e)][_0x22b957(0x101)]>0x0||_0x45ef0a[_0x22b957(0x126)]['knowledgeBases']['errors']>0x0||_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x108)][_0x22b957(0x101)]>0x0||_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x14a)]['errors']>0x0||_0x45ef0a['counts'][_0x22b957(0x12c)]['errors']>0x0||_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x137)][_0x22b957(0x101)]>0x0||_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x160)][_0x22b957(0x101)]>0x0;_0x24b909?console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x144)](_0x22b957(0x193))):console['log'](a4_0x54d7bb[_0x22b957(0x186)](_0x22b957(0x135)));console[_0x22b957(0x143)](_0x22b957(0x123)+_0x45ef0a[_0x22b957(0xdf)]),console['log']('New\x20project:\x20'+_0x45ef0a[_0x22b957(0xe9)]),console[_0x22b957(0x143)](_0x22b957(0x177)+_0x45ef0a[_0x22b957(0xdc)]),console[_0x22b957(0x143)](),console[_0x22b957(0x143)](_0x22b957(0xe4)),console[_0x22b957(0x143)]('\x20\x20Agents:\x20'+formatCountSummary(_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x18e)])),console[_0x22b957(0x143)](_0x22b957(0x18a)+formatCountSummary(_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x11a)])),console[_0x22b957(0x143)](_0x22b957(0x120)+formatCountSummary(_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x108)])),console[_0x22b957(0x143)](_0x22b957(0xf2)+formatCountSummary(_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x15b)])),console[_0x22b957(0x143)](_0x22b957(0x100)+formatCountSummary(_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x14a)])),console[_0x22b957(0x143)](_0x22b957(0x187)+formatCountSummary(_0x45ef0a['counts']['chatInterfaces']));const _0x3301b5=_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x137)][_0x22b957(0x12e)]>0x0||_0x45ef0a['counts']['experimentalKnowledgeBases'][_0x22b957(0x15f)]>0x0||_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x137)][_0x22b957(0x128)]>0x0||_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x160)][_0x22b957(0x12e)]>0x0||_0x45ef0a['counts'][_0x22b957(0x160)][_0x22b957(0x15f)]>0x0||_0x45ef0a['counts'][_0x22b957(0x160)][_0x22b957(0x128)]>0x0;_0x3301b5&&(console['log'](_0x22b957(0x12d)+formatCountSummary(_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x137)])),console['log'](_0x22b957(0x121)+formatCountSummary(_0x45ef0a[_0x22b957(0x126)][_0x22b957(0x160)])));if(_0x24b909){console['log'](),console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x150)](_0x22b957(0x170)));for(const _0x498427 of _0x45ef0a[_0x22b957(0x18e)]){_0x498427['action']===_0x22b957(0x10b)&&console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x150)](_0x22b957(0xe7)+_0x498427['agentName']+'\x22:\x20'+_0x498427[_0x22b957(0x10b)]));}for(const _0x496f0a of _0x45ef0a[_0x22b957(0x11a)]){_0x496f0a[_0x22b957(0x14f)]===_0x22b957(0x10b)&&console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x150)](_0x22b957(0x125)+_0x496f0a[_0x22b957(0x149)]+_0x22b957(0x159)+_0x496f0a['error']));}for(const _0x3b525c of _0x45ef0a[_0x22b957(0x108)]){_0x3b525c[_0x22b957(0x14f)]===_0x22b957(0x10b)&&console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x150)](_0x22b957(0x13e)+_0x3b525c['name']+_0x22b957(0x159)+_0x3b525c[_0x22b957(0x10b)]));}for(const _0x3d74b7 of _0x45ef0a['integrations']){_0x3d74b7[_0x22b957(0x14f)]==='error'&&console[_0x22b957(0x143)](a4_0x54d7bb['red']('\x20\x20Integration\x20\x22'+_0x3d74b7[_0x22b957(0x149)]+_0x22b957(0x159)+_0x3d74b7[_0x22b957(0x10b)]));}for(const _0x51f987 of _0x45ef0a[_0x22b957(0x14a)]){_0x51f987['action']==='error'&&console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x150)](_0x22b957(0x19c)+_0x51f987[_0x22b957(0x149)]+_0x22b957(0x159)+_0x51f987['error']));}for(const _0x863d30 of _0x45ef0a[_0x22b957(0x12c)]){_0x863d30['action']===_0x22b957(0x10b)&&console[_0x22b957(0x143)](a4_0x54d7bb['red'](_0x22b957(0x12a)+_0x863d30[_0x22b957(0x149)]+_0x22b957(0x159)+_0x863d30[_0x22b957(0x10b)]));}for(const _0x41f9a2 of _0x45ef0a[_0x22b957(0x137)]){_0x41f9a2['action']===_0x22b957(0x10b)&&console[_0x22b957(0x143)](a4_0x54d7bb[_0x22b957(0x150)](_0x22b957(0x17d)+_0x41f9a2['name']+'\x22:\x20'+_0x41f9a2[_0x22b957(0x10b)]));}for(const _0x2be937 of _0x45ef0a[_0x22b957(0x160)]){_0x2be937['action']===_0x22b957(0x10b)&&console[_0x22b957(0x143)](a4_0x54d7bb['red'](_0x22b957(0x161)+_0x2be937['name']+_0x22b957(0x159)+_0x2be937[_0x22b957(0x10b)]));}return 0x1;}console[_0x22b957(0x143)]();const _0x27f48f=getLLMProjectUrl(_0x4d845d,_0x45ef0a[_0x22b957(0xdc)]);return console[_0x22b957(0x143)]('Project:\x20'+a4_0x54d7bb[_0x22b957(0xe3)](_0x27f48f)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2b5988(0x149)]=a4_0x2b5988(0x147);['description']=a4_0x2b5988(0x173);async[a4_0x2b5988(0xe6)](_0x39227b){const _0xf2cf09=a4_0x2b5988,{options:_0x32a46e,args:_0x405234,tdx:_0x45df87}=_0x39227b;let _0x599451=_0x405234[0x0]||process['cwd']();const _0x330a8a=_0x32a46e['dryRun'],_0x57ecbb=_0x32a46e[_0xf2cf09(0x16a)],_0x2b80c0=_0x32a46e[_0xf2cf09(0x15a)],_0x4eb5da=_0x32a46e[_0xf2cf09(0xff)],_0x1a1dc4=a4_0x20158c[_0xf2cf09(0x183)](_0x599451,_0xf2cf09(0xf0)),_0x51e63b=existsSync(_0x1a1dc4);if(_0x51e63b){const {data:_0x4204cc}=await withSpinner(_0xf2cf09(0xe0)+_0x599451+'\x22...',()=>_0x45df87[_0xf2cf09(0x16d)]['pushAgent'](_0x599451,{'dryRun':_0x330a8a,'force':_0x57ecbb}));if(_0x330a8a)return console['log'](a4_0x54d7bb['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0xf2cf09(0x143)](_0xf2cf09(0xec)+_0x4204cc[_0xf2cf09(0x110)]),0x0;if(_0x4204cc[_0xf2cf09(0x14f)]===_0xf2cf09(0x10b))return console['log'](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0x154)+_0x4204cc[_0xf2cf09(0x10b)])),0x1;console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x186)]('Agent\x20'+_0x4204cc[_0xf2cf09(0x14f)]+_0xf2cf09(0x155))),console[_0xf2cf09(0x143)](_0xf2cf09(0x167)+_0x4204cc[_0xf2cf09(0x110)]);if(_0x4204cc[_0xf2cf09(0xe2)]&&_0x4204cc[_0xf2cf09(0x131)]){const _0x9f3615=getLLMAgentChatUrl(_0x4eb5da,_0x4204cc['projectId'],_0x4204cc[_0xf2cf09(0xe2)]);console[_0xf2cf09(0x143)](_0xf2cf09(0x19d)+a4_0x54d7bb[_0xf2cf09(0xe3)](_0x9f3615));}return 0x0;}const _0x7c88d7=_0x32a46e[_0xf2cf09(0x106)],_0xb9644c=resolveProjectFromContext(_0x599451,_0x7c88d7);if(_0xb9644c['found'])_0x599451=_0xb9644c['projectDir'],_0xb9644c[_0xf2cf09(0x191)]===_0xf2cf09(0x19b)&&console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x158)]('Using\x20project:\x20'+_0x599451));else{let _0x2eced5=_0xf2cf09(0x119);_0xb9644c[_0xf2cf09(0x12f)]===_0xf2cf09(0x141)&&(_0x2eced5=_0xb9644c[_0xf2cf09(0x19a)]+_0xf2cf09(0x109)+_0xb9644c[_0xf2cf09(0x106)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xb9644c[_0xf2cf09(0x12f)]===_0xf2cf09(0x197)?_0xb9644c[_0xf2cf09(0x19a)]:'No\x20tdx.json\x20found\x20in\x20'+_0x599451,undefined,{'helpText':_0x2eced5});}const {data:_0x521775}=await withSpinner(_0xf2cf09(0xfe),()=>_0x45df87[_0xf2cf09(0x16d)][_0xf2cf09(0x156)](_0x599451,{'dryRun':!![]})),_0x336f7d=_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x18e)][_0xf2cf09(0x101)]>0x0;if(_0x336f7d){console[_0xf2cf09(0x143)](a4_0x54d7bb['red'](_0xf2cf09(0x103)));for(const _0x15d21a of _0x521775[_0xf2cf09(0x18e)]){_0x15d21a[_0xf2cf09(0x14f)]===_0xf2cf09(0x10b)&&console['log'](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0xe7)+_0x15d21a[_0xf2cf09(0x110)]+_0xf2cf09(0x159)+_0x15d21a[_0xf2cf09(0x10b)]));}return 0x1;}const _0x84423c=_0x521775[_0xf2cf09(0x126)]['agents'][_0xf2cf09(0x12e)]+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x11a)][_0xf2cf09(0x12e)]+_0x521775[_0xf2cf09(0x126)]['textKnowledgeBases']['created']+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x108)]['created']+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x15b)][_0xf2cf09(0x12e)]+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x137)][_0xf2cf09(0x12e)]+_0x521775['counts']['experimentalArtifacts'][_0xf2cf09(0x12e)]+_0x521775['counts'][_0xf2cf09(0x14a)][_0xf2cf09(0x12e)]+_0x521775['counts'][_0xf2cf09(0x12c)][_0xf2cf09(0x12e)],_0x70284f=_0x521775[_0xf2cf09(0x126)]['agents'][_0xf2cf09(0x15f)]+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x11a)]['updated']+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x113)][_0xf2cf09(0x15f)]+_0x521775['counts'][_0xf2cf09(0x108)][_0xf2cf09(0x15f)]+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x15b)][_0xf2cf09(0x15f)]+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x137)][_0xf2cf09(0x15f)]+_0x521775[_0xf2cf09(0x126)]['experimentalArtifacts'][_0xf2cf09(0x15f)]+_0x521775['counts']['formInterfaces'][_0xf2cf09(0x15f)]+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x12c)]['updated'],_0x833590=_0x521775[_0xf2cf09(0x126)]['agents']['unchanged']+_0x521775[_0xf2cf09(0x126)]['knowledgeBases'][_0xf2cf09(0x128)]+_0x521775['counts'][_0xf2cf09(0x113)][_0xf2cf09(0x128)]+_0x521775['counts'][_0xf2cf09(0x108)][_0xf2cf09(0x128)]+_0x521775[_0xf2cf09(0x126)]['integrations']['unchanged']+_0x521775['counts']['experimentalKnowledgeBases']['unchanged']+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x160)][_0xf2cf09(0x128)]+_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x14a)][_0xf2cf09(0x128)]+_0x521775[_0xf2cf09(0x126)]['chatInterfaces'][_0xf2cf09(0x128)];console[_0xf2cf09(0x143)]('\x0aPush\x20summary\x20for\x20\x27'+_0x521775['projectName']+'\x27:'),console[_0xf2cf09(0x143)]('\x20\x20'+a4_0x54d7bb[_0xf2cf09(0x186)]('+\x20'+_0x84423c+_0xf2cf09(0x12b))+_0xf2cf09(0x13c)+a4_0x54d7bb[_0xf2cf09(0x144)]('~\x20'+_0x70284f+_0xf2cf09(0x11d))+_0xf2cf09(0x13c)+a4_0x54d7bb[_0xf2cf09(0x158)]('=\x20'+_0x833590+_0xf2cf09(0x138))),console[_0xf2cf09(0x143)](_0xf2cf09(0x115)+formatCountSummary(_0x521775['counts'][_0xf2cf09(0x18e)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x11a)])),console[_0xf2cf09(0x143)](_0xf2cf09(0x14e)+formatCountSummary(_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x113)])),console['log'](_0xf2cf09(0x120)+formatCountSummary(_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x108)])),console['log'](_0xf2cf09(0xf2)+formatCountSummary(_0x521775['counts'][_0xf2cf09(0x15b)])),console['log'](_0xf2cf09(0x100)+formatCountSummary(_0x521775[_0xf2cf09(0x126)]['formInterfaces'])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x12c)]));const _0x413702=_0x521775[_0xf2cf09(0x126)]['experimentalKnowledgeBases'][_0xf2cf09(0x12e)]>0x0||_0x521775[_0xf2cf09(0x126)]['experimentalKnowledgeBases']['updated']>0x0||_0x521775['counts'][_0xf2cf09(0x137)][_0xf2cf09(0x128)]>0x0||_0x521775['counts'][_0xf2cf09(0x160)][_0xf2cf09(0x12e)]>0x0||_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x160)][_0xf2cf09(0x15f)]>0x0||_0x521775['counts'][_0xf2cf09(0x160)][_0xf2cf09(0x128)]>0x0;_0x413702&&(console[_0xf2cf09(0x143)](_0xf2cf09(0x12d)+formatCountSummary(_0x521775[_0xf2cf09(0x126)][_0xf2cf09(0x137)])),console[_0xf2cf09(0x143)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x521775['counts']['experimentalArtifacts'])));console[_0xf2cf09(0x143)](_0xf2cf09(0x129)+a4_0x54d7bb[_0xf2cf09(0xe3)](_0x599451)),displayDiffs(_0x521775['agents'],_0x521775['knowledgeBases'],_0x521775['textKnowledgeBases'],_0x521775[_0xf2cf09(0x108)],_0x521775['integrations'],_0x521775[_0xf2cf09(0x137)],_0x521775[_0xf2cf09(0x160)],_0x521775[_0xf2cf09(0x14a)],_0x521775[_0xf2cf09(0x12c)]);if(_0x330a8a)return console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x144)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x84423c===0x0&&_0x70284f===0x0){console[_0xf2cf09(0x143)](a4_0x54d7bb['green'](_0xf2cf09(0xee)));const _0x25d69d=getLLMProjectUrl(_0x4eb5da,_0x521775[_0xf2cf09(0x131)]);return console['log'](_0xf2cf09(0x11c)+a4_0x54d7bb[_0xf2cf09(0xe3)](_0x25d69d)),0x0;}if(!_0x2b80c0&&!_0x57ecbb){if(!isInteractive())return console[_0xf2cf09(0x10b)](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0x18b)),_0xf2cf09(0x194)),console['error'](a4_0x54d7bb[_0xf2cf09(0x158)](_0xf2cf09(0x175))),0x1;const _0x131969=await confirmKey('\x0aPush\x20'+(_0x84423c+_0x70284f)+'\x20resources?');if(!_0x131969)return console['log'](a4_0x54d7bb['yellow'](_0xf2cf09(0x124)),_0xf2cf09(0x195)),0x1;}const {data:_0x2dc7a0}=await withSpinner(_0xf2cf09(0xfb),()=>_0x45df87[_0xf2cf09(0x16d)][_0xf2cf09(0x156)](_0x599451,{'force':_0x57ecbb})),_0x1cbcd2=_0x2dc7a0[_0xf2cf09(0x126)]['agents'][_0xf2cf09(0x101)]>0x0||_0x2dc7a0['counts'][_0xf2cf09(0x11a)][_0xf2cf09(0x101)]>0x0||_0x2dc7a0[_0xf2cf09(0x126)][_0xf2cf09(0x113)]['errors']>0x0||_0x2dc7a0[_0xf2cf09(0x126)]['prompts'][_0xf2cf09(0x101)]>0x0||_0x2dc7a0['counts'][_0xf2cf09(0x14a)]['errors']>0x0||_0x2dc7a0['counts'][_0xf2cf09(0x12c)][_0xf2cf09(0x101)]>0x0;if(_0x1cbcd2){console['log'](a4_0x54d7bb[_0xf2cf09(0x144)](_0xf2cf09(0x130))),console['log'](),console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0x170)));for(const _0xffc489 of _0x2dc7a0[_0xf2cf09(0x18e)]){_0xffc489[_0xf2cf09(0x14f)]==='error'&&console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0xe7)+_0xffc489['agentName']+_0xf2cf09(0x159)+_0xffc489['error']));}for(const _0x27aded of _0x2dc7a0[_0xf2cf09(0x11a)]){_0x27aded[_0xf2cf09(0x14f)]===_0xf2cf09(0x10b)&&console[_0xf2cf09(0x143)](a4_0x54d7bb['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x27aded[_0xf2cf09(0x149)]+_0xf2cf09(0x159)+_0x27aded[_0xf2cf09(0x10b)]));}for(const _0x98b533 of _0x2dc7a0['textKnowledgeBases']){_0x98b533[_0xf2cf09(0x14f)]===_0xf2cf09(0x10b)&&console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0x16c)+_0x98b533[_0xf2cf09(0x149)]+_0xf2cf09(0x159)+_0x98b533[_0xf2cf09(0x10b)]));}for(const _0x9500fb of _0x2dc7a0[_0xf2cf09(0x108)]){_0x9500fb[_0xf2cf09(0x14f)]==='error'&&console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0x13e)+_0x9500fb['name']+_0xf2cf09(0x159)+_0x9500fb[_0xf2cf09(0x10b)]));}for(const _0xf103b9 of _0x2dc7a0[_0xf2cf09(0x15b)]){_0xf103b9[_0xf2cf09(0x14f)]===_0xf2cf09(0x10b)&&console[_0xf2cf09(0x143)](a4_0x54d7bb['red']('\x20\x20Integration\x20\x22'+_0xf103b9[_0xf2cf09(0x149)]+_0xf2cf09(0x159)+_0xf103b9['error']));}for(const _0x3e309c of _0x2dc7a0[_0xf2cf09(0x14a)]){_0x3e309c[_0xf2cf09(0x14f)]===_0xf2cf09(0x10b)&&console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0x19c)+_0x3e309c['name']+_0xf2cf09(0x159)+_0x3e309c[_0xf2cf09(0x10b)]));}for(const _0x3ee5ee of _0x2dc7a0[_0xf2cf09(0x12c)]){_0x3ee5ee[_0xf2cf09(0x14f)]==='error'&&console['log'](a4_0x54d7bb[_0xf2cf09(0x150)](_0xf2cf09(0x12a)+_0x3ee5ee[_0xf2cf09(0x149)]+'\x22:\x20'+_0x3ee5ee['error']));}return 0x1;}console[_0xf2cf09(0x143)](a4_0x54d7bb[_0xf2cf09(0x186)](_0xf2cf09(0xfc)+(_0x84423c+_0x70284f)+_0xf2cf09(0x11e)+_0x2dc7a0[_0xf2cf09(0xea)]+'\x27'));const _0x589a58=getLLMProjectUrl(_0x4eb5da,_0x2dc7a0[_0xf2cf09(0x131)]);return console[_0xf2cf09(0x143)](_0xf2cf09(0x11c)+a4_0x54d7bb[_0xf2cf09(0xe3)](_0x589a58)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4cd0c8=a5_0x1204;function a5_0x2454(){const _0x29ca2c=[':\x20Sending\x20user\x20input...','filter','✗\x20ERROR:\x20','\x20\x20Project:\x20','writeFileSync','\x20(new)','58508hVVqTC','7EQTpwc','length','toLowerCase','resolve','testYmlPath','output','split','testName','agent','table','\x20\x20Agent:\x20','PASS','find','push','no_context','utf-8','some','start','Duration:\x20','log','reason','resolveProjectId','name','\x20(cached)','stop','Re-evaluating...','Failed\x20Tests:','projectName','/<agent-name>','map','Error\x20writing\x20output\x20file:\x20','✗\x20FAIL:\x20','3608100rAYYSq','add','No\x20tests\x20have\x20tags\x20defined.','tsv','Passed:\x20\x20\x20','808545iiZukr','\x20-\x20','Re-evaluating\x20','status','substring','repeat','69jMJaZv','\x20\x20Evaluating...\x20','trim','1486024AatDrk','conversation_url','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','not\x20found','Round\x20','Test\x20','7021860vtSRMa','Site:\x20','ERROR','Cached\x20run\x20is\x20from\x20site\x20\x22','text','FAIL','Usage:','Output\x20written\x20to:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Conversation\x20URL:\x20','verbose','cyan','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20\x20Round\x20','size','19226nHYwwo','basename','tests','json','8txtezq','No\x20tests\x20found\x20with\x20tags:\x20','Evaluating\x20response...','llm','llmProject','timestamp','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Conversation:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','...','Executing\x20new\x20tests...','description','Available\x20tags:\x20','Test\x20Configuration:','resolveAgentId','Total:\x20\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','found','no_tests','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','eval','site','existsSync','context','agentName','Round\x201/','has','Running:\x20','Either\x20switch\x20to\x20the\x20\x22','execute','no_local_folder','rounds','Re-evaluating\x20cached\x20test\x20run...','join','dim','toISOString','yellow','Cached\x20run\x20from:\x20','test.yml','\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)','jsonl','Running\x20test:\x20','\x22:\x20','white','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20-\x20','agent:test','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Re-evaluation\x20Summary','Agent:\x20','green','Running\x20agent\x20tests...','Run\x20\x27tdx\x20agent\x20pull\x20','red','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x27\x20to\x20create\x20the\x20folder\x20structure.','Errors:\x20\x20\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x20\x20Site:\x20','isSpinning','404','tags','dryRun','✓\x20PASS:\x20','now','reeval','includes','✗\x20ERROR:\x20Project\x20not\x20found:\x20','forEach','711492wdXcJt','message','New\x20tests\x20to\x20execute:\x20'];a5_0x2454=function(){return _0x29ca2c;};return a5_0x2454();}(function(_0x48060d,_0xf8c294){const _0x5a2701=a5_0x1204,_0x2a1df2=_0x48060d();while(!![]){try{const _0xeebaa5=parseInt(_0x5a2701(0x1de))/0x1*(parseInt(_0x5a2701(0x1e2))/0x2)+parseInt(_0x5a2701(0x1c6))/0x3*(-parseInt(_0x5a2701(0x232))/0x4)+parseInt(_0x5a2701(0x1c0))/0x5+parseInt(_0x5a2701(0x229))/0x6*(-parseInt(_0x5a2701(0x233))/0x7)+parseInt(_0x5a2701(0x1c9))/0x8+-parseInt(_0x5a2701(0x1bb))/0x9+parseInt(_0x5a2701(0x1cf))/0xa;if(_0xeebaa5===_0xf8c294)break;else _0x2a1df2['push'](_0x2a1df2['shift']());}catch(_0x52bdac){_0x2a1df2['push'](_0x2a1df2['shift']());}}}(a5_0x2454,0x42139));import*as a5_0x37cbb3 from'node:fs';import*as a5_0x9d51ca from'node:path';import a5_0x4ebb82 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x1204(_0x2edc71,_0x11d234){_0x2edc71=_0x2edc71-0x1ac;const _0x2454c5=a5_0x2454();let _0x120403=_0x2454c5[_0x2edc71];return _0x120403;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4cd0c8(0x1b1)]=a5_0x4cd0c8(0x212);[a5_0x4cd0c8(0x1ef)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x4cd0c8(0x201)](_0x55ca7a){const _0x4781df=a5_0x4cd0c8,{options:_0x3ac93e,args:_0x3cbee3,tdx:_0x4e5ab3}=_0x55ca7a,_0x2fa2c2=_0x3cbee3[0x0]||'.',_0x306ec2=_0x3ac93e[_0x4781df(0x222)],_0x16f36c=_0x3ac93e,_0x50a3ca=_0x16f36c[_0x4781df(0x1f8)]===![],_0x1f6331=_0x16f36c[_0x4781df(0x225)],_0x231a1b=_0x16f36c[_0x4781df(0x1b1)],_0x150021=_0x16f36c[_0x4781df(0x221)],_0x53b97e=_0x3ac93e[_0x4781df(0x1f9)],_0x5c063c=_0x16f36c[_0x4781df(0x238)];if(_0x1f6331&&_0x50a3ca)return console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x219)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x102459=_0x4781df(0x23c);if(_0x16f36c[_0x4781df(0x1e1)])_0x102459=_0x4781df(0x1e1);else{if(_0x16f36c['jsonl'])_0x102459=_0x4781df(0x20c);else{if(_0x16f36c[_0x4781df(0x1be)])_0x102459=_0x4781df(0x1be);else{if(_0x16f36c[_0x4781df(0x23c)])_0x102459=_0x4781df(0x23c);}}}const _0x18796d=_0x16f36c[_0x4781df(0x1e6)];let _0x247eed=_0x2fa2c2;const _0x191ac6=a5_0x37cbb3[_0x4781df(0x1fa)](_0x2fa2c2),_0x388e82=_0x2fa2c2==='.';if(!_0x191ac6||_0x388e82){const _0x1883e9=resolveProjectFromContext(_0x2fa2c2,_0x18796d,{'requireFile':_0x4781df(0x20a)});if(_0x1883e9[_0x4781df(0x1f5)])_0x247eed=_0x1883e9['projectDir'],_0x1883e9['source']===_0x4781df(0x1fb)&&console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x206)]('Using\x20agent:\x20'+_0x247eed));else switch(_0x1883e9['reason']){case _0x4781df(0x241):console[_0x4781df(0x1ae)](a5_0x4ebb82['yellow'](_0x1883e9['message'])),console[_0x4781df(0x1ae)](),console[_0x4781df(0x1ae)](_0x4781df(0x1d5)),console[_0x4781df(0x1ae)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x4781df(0x1ae)](_0x4781df(0x20b)),console[_0x4781df(0x1ae)](),console['log'](_0x4781df(0x21a));return 0x1;case _0x4781df(0x202):console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x208)](_0x1883e9[_0x4781df(0x22a)])),console[_0x4781df(0x1ae)](),console[_0x4781df(0x1ae)](_0x4781df(0x218)+_0x1883e9[_0x4781df(0x1e6)]+_0x4781df(0x21b));return 0x1;case'multiple_agents':{const _0x50cde9=a5_0x9d51ca[_0x4781df(0x1df)](_0x1883e9['projectDir']);console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x208)](_0x4781df(0x1eb)+_0x1883e9[_0x4781df(0x1e6)]+'\x22:'));for(const _0xfdac00 of _0x1883e9['agentDirs']){console[_0x4781df(0x1ae)](_0x4781df(0x211)+_0xfdac00);}return console['log'](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x50cde9+_0x4781df(0x1b7)),0x1;}case _0x4781df(0x1f6):console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x208)](_0x4781df(0x1f7)+_0x1883e9[_0x4781df(0x1e6)]+'\x22.')),console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x206)]('Project\x20path:\x20'+_0x1883e9['projectDir'])),console['log'](),console['log'](_0x4781df(0x1f4));return 0x1;}}const {definition:_0x186c02,agentInfo:_0xac490}=parseTestFile(_0x247eed);let _0x14febe=_0x186c02['tests'];if(_0x231a1b){const _0x2466cf=_0x231a1b[_0x4781df(0x239)](',')['map'](_0x3aab50=>_0x3aab50[_0x4781df(0x1c8)]());_0x14febe=_0x186c02['tests']['filter'](_0x520492=>_0x2466cf[_0x4781df(0x226)](_0x520492[_0x4781df(0x1b1)]));if(_0x14febe[_0x4781df(0x234)]===0x0)return console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x208)]('No\x20tests\x20found\x20matching:\x20'+_0x231a1b)),console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x206)]('Available\x20tests:\x20'+_0x186c02['tests'][_0x4781df(0x1b8)](_0x3183a9=>_0x3183a9[_0x4781df(0x1b1)])[_0x4781df(0x205)](',\x20'))),0x1;}if(_0x150021){const _0x4467ed=_0x150021[_0x4781df(0x239)](',')[_0x4781df(0x1b8)](_0x1e7591=>_0x1e7591[_0x4781df(0x1c8)]()[_0x4781df(0x235)]());_0x14febe=_0x14febe[_0x4781df(0x22d)](_0x2d21d8=>_0x2d21d8[_0x4781df(0x221)]?.[_0x4781df(0x243)](_0x1220c8=>_0x4467ed[_0x4781df(0x226)](_0x1220c8[_0x4781df(0x235)]())));if(_0x14febe[_0x4781df(0x234)]===0x0){console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x208)](_0x4781df(0x1e3)+_0x150021));const _0x330ad2=new Set();return _0x186c02[_0x4781df(0x1e0)][_0x4781df(0x228)](_0x17da2a=>_0x17da2a['tags']?.[_0x4781df(0x228)](_0x4a6eec=>_0x330ad2[_0x4781df(0x1bc)](_0x4a6eec))),_0x330ad2[_0x4781df(0x1dd)]>0x0?console['log'](a5_0x4ebb82[_0x4781df(0x206)](_0x4781df(0x1f0)+[..._0x330ad2][_0x4781df(0x205)](',\x20'))):console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x206)](_0x4781df(0x1bd))),0x1;}}if(_0x1f6331)return this['executeReeval'](_0x55ca7a,{'definition':{'tests':_0x14febe},'agentInfo':_0xac490,'outputFormat':_0x102459,'outputFile':_0x5c063c,'testNames':_0x231a1b});if(_0x306ec2){console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x1da)](_0x4781df(0x1f1))),console[_0x4781df(0x1ae)](_0x4781df(0x21e)+a5_0x4ebb82[_0x4781df(0x20f)](_0x53b97e)),console['log'](_0x4781df(0x22f)+a5_0x4ebb82[_0x4781df(0x20f)](_0xac490['projectName'])),console[_0x4781df(0x1ae)](_0x4781df(0x23d)+a5_0x4ebb82['white'](_0xac490[_0x4781df(0x1fc)])),console[_0x4781df(0x1ae)](),console[_0x4781df(0x1ae)]('Tests\x20found:\x20'+a5_0x4ebb82[_0x4781df(0x20f)](_0x14febe[_0x4781df(0x234)]));for(let _0x478a25=0x0;_0x478a25<_0x14febe['length'];_0x478a25++){const _0x2f6d5f=_0x14febe[_0x478a25],_0x3be661=_0x2f6d5f[_0x4781df(0x203)]['length']===0x1?'round':'rounds',_0x13f9c4=_0x2f6d5f[_0x4781df(0x221)]?.[_0x4781df(0x234)]?'\x20['+_0x2f6d5f['tags']['join'](',\x20')+']':'';console[_0x4781df(0x1ae)]('\x20\x20'+(_0x478a25+0x1)+'.\x20'+a5_0x4ebb82[_0x4781df(0x20f)](_0x2f6d5f[_0x4781df(0x1b1)])+'\x20('+_0x2f6d5f[_0x4781df(0x203)][_0x4781df(0x234)]+'\x20'+_0x3be661+')'+a5_0x4ebb82[_0x4781df(0x206)](_0x13f9c4));}return 0x0;}let _0x125b6b,_0x2f208f;try{_0x125b6b=await _0x4e5ab3[_0x4781df(0x1e5)][_0x4781df(0x1b0)](_0xac490['projectName']);}catch(_0x4f446f){const _0x13d893=_0x4f446f instanceof Error?_0x4f446f[_0x4781df(0x22a)]:String(_0x4f446f);return _0x13d893[_0x4781df(0x226)](_0x4781df(0x220))||_0x13d893[_0x4781df(0x235)]()[_0x4781df(0x226)]('not\x20found')?console['log'](a5_0x4ebb82['red'](_0x4781df(0x227)+_0xac490[_0x4781df(0x1b6)])):console['log'](a5_0x4ebb82[_0x4781df(0x219)](_0x4781df(0x1ea)+_0xac490[_0x4781df(0x1b6)]+'\x22:\x20'+_0x13d893)),0x1;}try{_0x2f208f=await _0x4e5ab3['llm'][_0x4781df(0x1f2)](_0xac490[_0x4781df(0x1fc)],_0x125b6b);}catch(_0x28560c){const _0x4378e6=_0x28560c instanceof Error?_0x28560c[_0x4781df(0x22a)]:String(_0x28560c);return _0x4378e6['includes'](_0x4781df(0x220))||_0x4378e6[_0x4781df(0x235)]()['includes'](_0x4781df(0x1cc))?console['log'](a5_0x4ebb82[_0x4781df(0x219)](_0x4781df(0x213)+_0xac490[_0x4781df(0x1fc)])):console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x219)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0xac490[_0x4781df(0x1fc)]+_0x4781df(0x20e)+_0x4378e6)),0x1;}let _0x3100ed;if(!_0x50a3ca)try{_0x3100ed=await setupEvaluatorAgent(_0x4e5ab3['llm'],_0x3ac93e[_0x4781df(0x1d9)]);}catch(_0xf40bed){const _0x4a19a9=_0xf40bed instanceof Error?_0xf40bed[_0x4781df(0x22a)]:String(_0xf40bed);return console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x219)](_0x4781df(0x1cb)+_0x4a19a9)),0x1;}console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x1da)](_0x4781df(0x217))),console[_0x4781df(0x1ae)](_0x4781df(0x1d0)+a5_0x4ebb82[_0x4781df(0x20f)](_0x53b97e)),console[_0x4781df(0x1ae)](_0x4781df(0x215)+a5_0x4ebb82[_0x4781df(0x20f)](_0xac490[_0x4781df(0x1b6)]+'/'+_0xac490['agentName'])),console[_0x4781df(0x1ae)]();const _0x1784f8=[],_0x328f7d=[],_0x25ca7e=Date['now']();for(let _0x43e097=0x0;_0x43e097<_0x14febe['length'];_0x43e097++){const _0x4dd171=_0x14febe[_0x43e097];_0x14febe[_0x4781df(0x234)]>0x1?console[_0x4781df(0x1ae)](_0x4781df(0x1ce)+(_0x43e097+0x1)+'/'+_0x14febe[_0x4781df(0x234)]+':\x20'+a5_0x4ebb82[_0x4781df(0x20f)](_0x4dd171[_0x4781df(0x1b1)])):console[_0x4781df(0x1ae)](_0x4781df(0x20d)+a5_0x4ebb82[_0x4781df(0x20f)](_0x4dd171[_0x4781df(0x1b1)]));const _0xdfe13a=createCommandSpinner(_0x4781df(0x1fd)+_0x4dd171[_0x4781df(0x203)][_0x4781df(0x234)]+_0x4781df(0x22c));_0xdfe13a[_0x4781df(0x1ac)]();try{const {result:_0x14124f,conversation:_0x4610c7}=await runTest(_0x4e5ab3[_0x4781df(0x1e5)],_0x4dd171,{'agentId':_0x2f208f,'projectId':_0x125b6b,'site':_0x53b97e,'noEval':_0x50a3ca,'evaluatorId':_0x3100ed,'onRoundStart':(_0x2936bc,_0x3f0ebf)=>{const _0xb4b83c=_0x4781df;_0xdfe13a['text']=_0xb4b83c(0x1cd)+(_0x2936bc+0x1)+'/'+_0x3f0ebf+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4d943e,_0x284091,_0x1db1c0)=>{const _0x34812b=_0x4781df,_0x2a1278=formatElapsed(_0x284091);_0x1db1c0?console[_0x34812b(0x1ae)]('\x20\x20Round\x20'+(_0x4d943e+0x1)+'/'+_0x4dd171[_0x34812b(0x203)][_0x34812b(0x234)]+'...\x20'+a5_0x4ebb82[_0x34812b(0x216)]('✓')+'\x20('+_0x2a1278+')'):console[_0x34812b(0x1ae)](_0x34812b(0x1dc)+(_0x4d943e+0x1)+'/'+_0x4dd171[_0x34812b(0x203)][_0x34812b(0x234)]+'...\x20'+a5_0x4ebb82[_0x34812b(0x219)]('✗'));},'onEvaluationStart':()=>{const _0x5c3c34=_0x4781df;_0xdfe13a['text']=_0x5c3c34(0x1e4);},'onEvaluationComplete':_0x54288e=>{const _0x2142b0=_0x4781df,_0x24eda6=formatElapsed(_0x54288e);console[_0x2142b0(0x1ae)](_0x2142b0(0x1c7)+a5_0x4ebb82['green']('✓')+'\x20('+_0x24eda6+')');}});_0xdfe13a[_0x4781df(0x1b3)](),_0x1784f8['push'](_0x14124f),_0x328f7d[_0x4781df(0x240)](_0x4610c7);if(_0x14124f['status']==='PASS')console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x216)](_0x4781df(0x223)+_0x14124f[_0x4781df(0x1af)]));else _0x14124f[_0x4781df(0x1c3)]===_0x4781df(0x1d4)?console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x219)](_0x4781df(0x1ba)+_0x14124f[_0x4781df(0x1af)])):console['log'](a5_0x4ebb82[_0x4781df(0x219)](_0x4781df(0x22e)+_0x14124f[_0x4781df(0x1af)]));_0x14124f[_0x4781df(0x1ca)]&&console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x206)](_0x4781df(0x1d8)+_0x14124f[_0x4781df(0x1ca)])),console[_0x4781df(0x1ae)]();}catch(_0x2a29cb){_0xdfe13a['stop']();const _0x4d3e83=_0x2a29cb instanceof Error?_0x2a29cb['message']:String(_0x2a29cb);console['log'](a5_0x4ebb82[_0x4781df(0x219)](_0x4781df(0x22e)+_0x4d3e83)),console[_0x4781df(0x1ae)](),_0x1784f8[_0x4781df(0x240)]({'name':_0x4dd171[_0x4781df(0x1b1)],'status':_0x4781df(0x1d1),'reason':_0x4d3e83,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x2e218b=Date['now']()-_0x25ca7e,_0x23dc76=_0x1784f8[_0x4781df(0x22d)](_0x551423=>_0x551423[_0x4781df(0x1c3)]==='PASS')[_0x4781df(0x234)],_0x3c2f36=_0x1784f8[_0x4781df(0x22d)](_0x17aa78=>_0x17aa78[_0x4781df(0x1c3)]===_0x4781df(0x1d4))['length'],_0x2ca58d=_0x1784f8[_0x4781df(0x22d)](_0x5e66b0=>_0x5e66b0[_0x4781df(0x1c3)]==='ERROR')['length'];console['log']('━'[_0x4781df(0x1c5)](0x3c)),console[_0x4781df(0x1ae)]('Test\x20Summary'),console[_0x4781df(0x1ae)]('━'[_0x4781df(0x1c5)](0x3c)),console[_0x4781df(0x1ae)](_0x4781df(0x1f3)+_0x1784f8[_0x4781df(0x234)]),console['log'](_0x4781df(0x1bf)+a5_0x4ebb82[_0x4781df(0x216)](_0x23dc76)),console[_0x4781df(0x1ae)]('Failed:\x20\x20\x20'+a5_0x4ebb82[_0x4781df(0x219)](_0x3c2f36));_0x2ca58d>0x0&&console[_0x4781df(0x1ae)](_0x4781df(0x21c)+a5_0x4ebb82[_0x4781df(0x219)](_0x2ca58d));console[_0x4781df(0x1ae)]('Duration:\x20'+formatElapsed(_0x2e218b)),console[_0x4781df(0x1ae)]('━'[_0x4781df(0x1c5)](0x3c));const _0x67083f=_0x1784f8[_0x4781df(0x22d)](_0x5a05a1=>_0x5a05a1[_0x4781df(0x1c3)]!==_0x4781df(0x23e));if(_0x67083f[_0x4781df(0x234)]>0x0){console[_0x4781df(0x1ae)](),console[_0x4781df(0x1ae)](_0x4781df(0x1b5));for(const _0xc61cd of _0x67083f){const _0x122ec9=a5_0x4ebb82[_0x4781df(0x219)]('✗'),_0x53451f=_0xc61cd[_0x4781df(0x1af)][_0x4781df(0x234)]>0x32?_0xc61cd[_0x4781df(0x1af)][_0x4781df(0x1c4)](0x0,0x32)+_0x4781df(0x1ed):_0xc61cd['reason'];console[_0x4781df(0x1ae)]('\x20\x20'+_0x122ec9+'\x20'+_0xc61cd[_0x4781df(0x1b1)]+':\x20'+_0x53451f);}}const _0x38e036={'summary':{'total':_0x1784f8[_0x4781df(0x234)],'passed':_0x23dc76,'failed':_0x3c2f36,'errors':_0x2ca58d>0x0?_0x2ca58d:undefined,'duration_ms':_0x2e218b},'tests':_0x1784f8,'agent':{'project':_0xac490[_0x4781df(0x1b6)],'name':_0xac490[_0x4781df(0x1fc)],'site':_0x53b97e},'timestamp':new Date(_0x25ca7e)['toISOString']()};try{const _0x59c72a=buildCachedTestRun(_0x328f7d,{'site':_0x53b97e,'projectId':_0x125b6b,'projectName':_0xac490['projectName'],'agentId':_0x2f208f,'agentName':_0xac490[_0x4781df(0x1fc)],'testYmlPath':a5_0x9d51ca[_0x4781df(0x236)](_0xac490[_0x4781df(0x237)])});saveLastTestRun(_0x59c72a);}catch{}if(_0x102459!==_0x4781df(0x23c)||_0x5c063c){const _0x6ec40b=formatResults(_0x38e036,_0x102459);if(_0x5c063c)try{a5_0x37cbb3[_0x4781df(0x230)](_0x5c063c,_0x6ec40b,_0x4781df(0x242)),console[_0x4781df(0x1ae)](),console[_0x4781df(0x1ae)](a5_0x4ebb82['dim'](_0x4781df(0x1d6)+_0x5c063c));}catch(_0x241722){return console[_0x4781df(0x1ae)](),console[_0x4781df(0x1ae)](a5_0x4ebb82[_0x4781df(0x219)](_0x4781df(0x1b9)+_0x241722)),0x1;}else console[_0x4781df(0x1ae)](),console[_0x4781df(0x1ae)](_0x6ec40b);}return _0x67083f[_0x4781df(0x234)]>0x0?0x1:0x0;}async['executeReeval'](_0x4fe6a0,_0x12ba97){const _0x263145=a5_0x4cd0c8,{options:_0x262839,tdx:_0x27a1e4}=_0x4fe6a0,{definition:_0x5c3326,agentInfo:_0x3de47a,outputFormat:_0xb132f5,outputFile:_0x2dd444}=_0x12ba97,_0x4542f3=_0x262839[_0x263145(0x1f9)],_0x371626=loadLastTestRun();if(!_0x371626)return console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x219)](_0x263145(0x1ec))),console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x206)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x371626[_0x263145(0x23b)][_0x263145(0x1fc)]!==_0x3de47a[_0x263145(0x1fc)])return console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x219)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x371626['agent'][_0x263145(0x1fc)]+_0x263145(0x1db)+_0x3de47a[_0x263145(0x1fc)]+'\x22.')),console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x206)](_0x263145(0x1d7))),0x1;const _0x35a7f1=new Set(_0x371626['conversations'][_0x263145(0x1b8)](_0x5aa962=>_0x5aa962[_0x263145(0x23a)])),_0x160997=_0x5c3326[_0x263145(0x1e0)][_0x263145(0x22d)](_0x1ccd8d=>!_0x35a7f1[_0x263145(0x1fe)](_0x1ccd8d[_0x263145(0x1b1)]));if(_0x160997['length']>0x0&&_0x371626[_0x263145(0x1f9)]!==_0x4542f3)return console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x219)](_0x263145(0x21d))),console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x206)](_0x263145(0x1d2)+_0x371626['site']+_0x263145(0x210)+_0x4542f3+'\x22.')),console['log'](a5_0x4ebb82[_0x263145(0x206)](_0x263145(0x200)+_0x371626[_0x263145(0x1f9)]+_0x263145(0x1e8))),0x1;const _0x3198ff=_0x5c3326['tests']['filter'](_0x56595e=>_0x35a7f1[_0x263145(0x1fe)](_0x56595e['name'])),_0x43ef15=_0x160997;let _0x54d747;try{_0x54d747=await setupEvaluatorAgent(_0x27a1e4['llm'],_0x262839['verbose']);}catch(_0xa79706){const _0x4cd727=_0xa79706 instanceof Error?_0xa79706[_0x263145(0x22a)]:String(_0xa79706);return console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x219)](_0x263145(0x1cb)+_0x4cd727)),0x1;}console['log'](a5_0x4ebb82[_0x263145(0x1da)](_0x263145(0x204))),console[_0x263145(0x1ae)](_0x263145(0x209)+a5_0x4ebb82[_0x263145(0x20f)](_0x371626[_0x263145(0x1e7)])),console[_0x263145(0x1ae)]('Agent:\x20'+a5_0x4ebb82[_0x263145(0x20f)](_0x371626['agent'][_0x263145(0x1b6)]+'/'+_0x371626[_0x263145(0x23b)]['agentName']));_0x43ef15[_0x263145(0x234)]>0x0&&console['log'](_0x263145(0x22b)+a5_0x4ebb82['yellow'](_0x43ef15[_0x263145(0x234)]));console[_0x263145(0x1ae)]();const _0x743743=[],_0x54d4d3=Date[_0x263145(0x224)](),_0x189138=createCommandSpinner(_0x263145(0x1b4));if(_0x3198ff[_0x263145(0x234)]>0x0)try{const _0x5104a9=await reevaluateFromCache(_0x27a1e4[_0x263145(0x1e5)],_0x371626,{'tests':_0x3198ff},{'evaluatorId':_0x54d747,'onTestStart':(_0x4e4c83,_0x1d7cf0,_0x260167)=>{const _0x5f378a=_0x263145;_0x189138[_0x5f378a(0x1d3)]=_0x5f378a(0x1c2)+(_0x1d7cf0+0x1)+'/'+_0x260167+':\x20'+_0x4e4c83+_0x5f378a(0x1ed);if(!_0x189138[_0x5f378a(0x21f)])_0x189138['start']();},'onTestComplete':(_0x2d171d,_0x14d552)=>{const _0x4547ef=_0x263145;_0x189138[_0x4547ef(0x1b3)]();if(_0x14d552[_0x4547ef(0x1c3)]===_0x4547ef(0x23e))console['log'](a5_0x4ebb82[_0x4547ef(0x216)](_0x4547ef(0x223)+_0x2d171d)+a5_0x4ebb82['dim'](_0x4547ef(0x1b2)));else _0x14d552['status']===_0x4547ef(0x1d4)?console[_0x4547ef(0x1ae)](a5_0x4ebb82[_0x4547ef(0x219)]('✗\x20FAIL:\x20'+_0x2d171d+_0x4547ef(0x1c1)+_0x14d552['reason'])+a5_0x4ebb82[_0x4547ef(0x206)](_0x4547ef(0x1b2))):console[_0x4547ef(0x1ae)](a5_0x4ebb82['red']('✗\x20ERROR:\x20'+_0x2d171d+'\x20-\x20'+_0x14d552['reason']));_0x14d552[_0x4547ef(0x1ca)]&&console[_0x4547ef(0x1ae)](a5_0x4ebb82[_0x4547ef(0x206)]('\x20\x20Conversation:\x20'+_0x14d552[_0x4547ef(0x1ca)])),_0x743743['push'](_0x14d552);},'onTestSkipped':(_0x28e0a3,_0x1b4fd2)=>{const _0x3a25bc=_0x263145;_0x189138['stop'](),console[_0x3a25bc(0x1ae)](a5_0x4ebb82[_0x3a25bc(0x208)]('⚠\x20SKIPPED:\x20'+_0x28e0a3+'\x20-\x20'+_0x1b4fd2));}});for(const _0x54378a of _0x5104a9){!_0x743743[_0x263145(0x23f)](_0x3595da=>_0x3595da['name']===_0x54378a[_0x263145(0x1b1)])&&_0x743743['push'](_0x54378a);}}catch(_0x3b1ebe){_0x189138[_0x263145(0x1b3)]();const _0x1ec0f6=_0x3b1ebe instanceof Error?_0x3b1ebe[_0x263145(0x22a)]:String(_0x3b1ebe);return console[_0x263145(0x1ae)](a5_0x4ebb82['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x1ec0f6)),0x1;}_0x189138[_0x263145(0x1b3)]();if(_0x43ef15['length']>0x0){console[_0x263145(0x1ae)](),console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x1da)](_0x263145(0x1ee)));const {projectId:_0x8217e7,agentId:_0x145b3c}=_0x371626['agent'];for(const _0x4848d0 of _0x43ef15){console['log'](_0x263145(0x1ff)+a5_0x4ebb82['white'](_0x4848d0[_0x263145(0x1b1)]));const _0x4842a3=createCommandSpinner(_0x263145(0x1fd)+_0x4848d0[_0x263145(0x203)][_0x263145(0x234)]+_0x263145(0x22c));_0x4842a3[_0x263145(0x1ac)]();try{const {result:_0x5152dd}=await runTest(_0x27a1e4[_0x263145(0x1e5)],_0x4848d0,{'agentId':_0x145b3c,'projectId':_0x8217e7,'site':_0x371626['site'],'noEval':![],'evaluatorId':_0x54d747,'onRoundStart':(_0x180d0d,_0x2f25cc)=>{const _0x184973=_0x263145;_0x4842a3[_0x184973(0x1d3)]=_0x184973(0x1cd)+(_0x180d0d+0x1)+'/'+_0x2f25cc+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x430801,_0x3dd3fb,_0x46193e)=>{const _0x520f5a=_0x263145,_0x20ba3d=formatElapsed(_0x3dd3fb);_0x46193e?console[_0x520f5a(0x1ae)](_0x520f5a(0x1dc)+(_0x430801+0x1)+'/'+_0x4848d0[_0x520f5a(0x203)][_0x520f5a(0x234)]+'...\x20'+a5_0x4ebb82['green']('✓')+'\x20('+_0x20ba3d+')'):console['log'](_0x520f5a(0x1dc)+(_0x430801+0x1)+'/'+_0x4848d0[_0x520f5a(0x203)][_0x520f5a(0x234)]+'...\x20'+a5_0x4ebb82['red']('✗'));},'onEvaluationStart':()=>{const _0x3c44eb=_0x263145;_0x4842a3[_0x3c44eb(0x1d3)]=_0x3c44eb(0x1e4);},'onEvaluationComplete':_0x389fd9=>{const _0x569588=_0x263145,_0x531f9c=formatElapsed(_0x389fd9);console[_0x569588(0x1ae)](_0x569588(0x1c7)+a5_0x4ebb82[_0x569588(0x216)]('✓')+'\x20('+_0x531f9c+')');}});_0x4842a3['stop'](),_0x743743['push'](_0x5152dd);if(_0x5152dd['status']===_0x263145(0x23e))console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x216)](_0x263145(0x223)+_0x5152dd[_0x263145(0x1af)])+a5_0x4ebb82[_0x263145(0x206)](_0x263145(0x231)));else _0x5152dd[_0x263145(0x1c3)]===_0x263145(0x1d4)?console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x219)](_0x263145(0x1ba)+_0x5152dd[_0x263145(0x1af)])+a5_0x4ebb82[_0x263145(0x206)](_0x263145(0x231))):console['log'](a5_0x4ebb82['red'](_0x263145(0x22e)+_0x5152dd[_0x263145(0x1af)]));_0x5152dd[_0x263145(0x1ca)]&&console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x206)](_0x263145(0x1e9)+_0x5152dd[_0x263145(0x1ca)]));}catch(_0x55577e){_0x4842a3[_0x263145(0x1b3)]();const _0x2432b1=_0x55577e instanceof Error?_0x55577e[_0x263145(0x22a)]:String(_0x55577e);console['log'](a5_0x4ebb82[_0x263145(0x219)](_0x263145(0x22e)+_0x2432b1)),_0x743743[_0x263145(0x240)]({'name':_0x4848d0[_0x263145(0x1b1)],'status':_0x263145(0x1d1),'reason':_0x2432b1,'timestamp':new Date()[_0x263145(0x207)](),'duration_ms':0x0});}}}console['log']();const _0x559e87=Date[_0x263145(0x224)]()-_0x54d4d3,_0x12962a=_0x743743[_0x263145(0x22d)](_0x2ecbda=>_0x2ecbda[_0x263145(0x1c3)]===_0x263145(0x23e))[_0x263145(0x234)],_0xc9279e=_0x743743[_0x263145(0x22d)](_0x34a989=>_0x34a989['status']===_0x263145(0x1d4))[_0x263145(0x234)],_0x3498ef=_0x743743['filter'](_0x3e2615=>_0x3e2615[_0x263145(0x1c3)]==='ERROR')[_0x263145(0x234)];console[_0x263145(0x1ae)]('━'['repeat'](0x3c)),console['log'](_0x263145(0x214)),console['log']('━'[_0x263145(0x1c5)](0x3c)),console[_0x263145(0x1ae)]('Total:\x20\x20\x20\x20'+_0x743743[_0x263145(0x234)]),console[_0x263145(0x1ae)]('Passed:\x20\x20\x20'+a5_0x4ebb82['green'](_0x12962a)),console[_0x263145(0x1ae)]('Failed:\x20\x20\x20'+a5_0x4ebb82[_0x263145(0x219)](_0xc9279e));_0x3498ef>0x0&&console[_0x263145(0x1ae)](_0x263145(0x21c)+a5_0x4ebb82[_0x263145(0x219)](_0x3498ef));console[_0x263145(0x1ae)](_0x263145(0x1ad)+formatElapsed(_0x559e87)),console[_0x263145(0x1ae)]('━'[_0x263145(0x1c5)](0x3c));const _0x303ab2={'summary':{'total':_0x743743[_0x263145(0x234)],'passed':_0x12962a,'failed':_0xc9279e,'errors':_0x3498ef>0x0?_0x3498ef:undefined,'duration_ms':_0x559e87},'tests':_0x743743,'agent':{'project':_0x3de47a[_0x263145(0x1b6)],'name':_0x3de47a['agentName'],'site':_0x4542f3},'timestamp':new Date(_0x54d4d3)['toISOString']()};if(_0xb132f5!==_0x263145(0x23c)||_0x2dd444){const _0x3d4134=formatResults(_0x303ab2,_0xb132f5);if(_0x2dd444)try{a5_0x37cbb3[_0x263145(0x230)](_0x2dd444,_0x3d4134,'utf-8'),console[_0x263145(0x1ae)](),console[_0x263145(0x1ae)](a5_0x4ebb82[_0x263145(0x206)](_0x263145(0x1d6)+_0x2dd444));}catch(_0xfd7145){return console[_0x263145(0x1ae)](),console['log'](a5_0x4ebb82[_0x263145(0x219)](_0x263145(0x1b9)+_0xfd7145)),0x1;}else console[_0x263145(0x1ae)](),console['log'](_0x3d4134);}const _0x2fc3d8=_0x743743[_0x263145(0x22d)](_0x922fce=>_0x922fce[_0x263145(0x1c3)]!==_0x263145(0x23e));return _0x2fc3d8[_0x263145(0x234)]>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x1358(_0xd7c9b8,_0x430c18){_0xd7c9b8=_0xd7c9b8-0x1d9;const _0x24e8ee=a5_0x24e8();let _0x135802=_0x24e8ee[_0xd7c9b8];return _0x135802;}const a5_0x115019=a5_0x1358;(function(_0x59e948,_0x199ddf){const _0x211dab=a5_0x1358,_0x53c771=_0x59e948();while(!![]){try{const _0x82026e=parseInt(_0x211dab(0x1f0))/0x1*(parseInt(_0x211dab(0x20e))/0x2)+parseInt(_0x211dab(0x23d))/0x3*(parseInt(_0x211dab(0x216))/0x4)+-parseInt(_0x211dab(0x222))/0x5+parseInt(_0x211dab(0x247))/0x6+-parseInt(_0x211dab(0x265))/0x7*(parseInt(_0x211dab(0x1f2))/0x8)+parseInt(_0x211dab(0x1e9))/0x9+parseInt(_0x211dab(0x1ee))/0xa*(parseInt(_0x211dab(0x243))/0xb);if(_0x82026e===_0x199ddf)break;else _0x53c771['push'](_0x53c771['shift']());}catch(_0x1d0326){_0x53c771['push'](_0x53c771['shift']());}}}(a5_0x24e8,0x9973a));import*as a5_0x21076d from'node:fs';function a5_0x24e8(){const _0x2d2d87=['trim','log','source','301584ukGaHC','agentDirs','tags','json','Running\x20test:\x20','Error\x20writing\x20output\x20file:\x20','dim','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','rounds','includes','description','5822120LwWosZ','not\x20found','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','green','...','multiple_agents','Round\x20','writeFileSync','cyan','Using\x20agent:\x20','repeat','test.yml','Available\x20tags:\x20','\x22:\x20','Either\x20switch\x20to\x20the\x20\x22','New\x20tests\x20to\x20execute:\x20','✗\x20FAIL:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','red','found','Conversation\x20URL:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Agent:\x20','Running\x20agent\x20tests...','...\x20','Available\x20tests:\x20','projectName','15YKxObM','conversation_url','agent:test','projectDir','message','reeval','20328zobDOy','stop','\x20(new)','Output\x20written\x20to:\x20','1292832cEvndF','resolveProjectId','forEach','Executing\x20new\x20tests...','No\x20tests\x20have\x20tags\x20defined.','now','Project\x20path:\x20','ERROR','PASS','toISOString','agent','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Evaluating\x20response...','name','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20','\x20-\x20','join','status','length','no_local_folder','substring','Run\x20tests\x20for\x20an\x20LLM\x20agent','filter','existsSync','Duration:\x20','/<agent-name>','Running:\x20','conversations','\x20\x20Agent:\x20','14cdYoGK','white','testYmlPath','Usage:','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22',':\x20Sending\x20user\x20input...','✓\x20PASS:\x20','Tests\x20found:\x20','verbose','push','split','eval','\x22,\x20but\x20current\x20site\x20is\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','Round\x201/','Total:\x20\x20\x20\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Re-evaluating\x20cached\x20test\x20run...','toLowerCase','yellow','tsv','execute','executeReeval','No\x20tests\x20found\x20matching:\x20','4670235DdZWuE','tests','resolve','Passed:\x20\x20\x20','Re-evaluating...','2710XTkuks','\x27\x20to\x20create\x20the\x20folder\x20structure.','19739VOLqyA','reason','4251080yaMoFk','llm','timestamp','table','site','Test\x20','basename','has','text','\x20\x20Round\x20','utf-8','agentName','Failed:\x20\x20\x20','Test\x20Configuration:','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','FAIL','size','find','Re-evaluation\x20Summary','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','llmProject','\x20\x20Conversation:\x20','\x20\x20Project:\x20','Errors:\x20\x20\x20','jsonl','no_context','map','Failed\x20Tests:','126eXQxdn','start','\x20(cached)','404','Re-evaluating\x20'];a5_0x24e8=function(){return _0x2d2d87;};return a5_0x24e8();}import*as a5_0x337a75 from'node:path';import a5_0x2494c8 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x115019(0x254)]=a5_0x115019(0x23f);[a5_0x115019(0x221)]=a5_0x115019(0x25d);async[a5_0x115019(0x1e6)](_0x188547){const _0x229c29=a5_0x115019,{options:_0x18f3e3,args:_0x47272a,tdx:_0x557b58}=_0x188547,_0x10b3cc=_0x47272a[0x0]||'.',_0x4192ab=_0x18f3e3['dryRun'],_0x25672d=_0x18f3e3,_0x3add42=_0x25672d[_0x229c29(0x1dc)]===![],_0x3e3d6d=_0x25672d[_0x229c29(0x242)],_0x4d17f3=_0x25672d['name'],_0x5df39a=_0x25672d[_0x229c29(0x218)],_0x4a6781=_0x18f3e3[_0x229c29(0x1f6)],_0x4291e0=_0x25672d['output'];if(_0x3e3d6d&&_0x3add42)return console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x234)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x5d7eaf=_0x229c29(0x1f5);if(_0x25672d[_0x229c29(0x219)])_0x5d7eaf='json';else{if(_0x25672d['jsonl'])_0x5d7eaf=_0x229c29(0x20a);else{if(_0x25672d['tsv'])_0x5d7eaf=_0x229c29(0x1e5);else{if(_0x25672d[_0x229c29(0x1f5)])_0x5d7eaf=_0x229c29(0x1f5);}}}const _0x3a2fc8=_0x25672d[_0x229c29(0x206)];let _0x217ce1=_0x10b3cc;const _0x26038f=a5_0x21076d[_0x229c29(0x25f)](_0x10b3cc),_0x160a91=_0x10b3cc==='.';if(!_0x26038f||_0x160a91){const _0x28218a=resolveProjectFromContext(_0x10b3cc,_0x3a2fc8,{'requireFile':_0x229c29(0x22d)});if(_0x28218a[_0x229c29(0x235)])_0x217ce1=_0x28218a[_0x229c29(0x240)],_0x28218a[_0x229c29(0x215)]==='context'&&console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x21c)](_0x229c29(0x22b)+_0x217ce1));else switch(_0x28218a[_0x229c29(0x1f1)]){case _0x229c29(0x20b):console['log'](a5_0x2494c8['yellow'](_0x28218a[_0x229c29(0x241)])),console[_0x229c29(0x214)](),console[_0x229c29(0x214)](_0x229c29(0x268)),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x229c29(0x214)]('\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[_0x229c29(0x214)](),console[_0x229c29(0x214)](_0x229c29(0x205));return 0x1;case _0x229c29(0x25b):console[_0x229c29(0x214)](a5_0x2494c8['yellow'](_0x28218a[_0x229c29(0x241)])),console[_0x229c29(0x214)](),console[_0x229c29(0x214)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x28218a[_0x229c29(0x206)]+_0x229c29(0x1ef));return 0x1;case _0x229c29(0x227):{const _0x1821a2=a5_0x337a75[_0x229c29(0x1f8)](_0x28218a[_0x229c29(0x240)]);console['log'](a5_0x2494c8[_0x229c29(0x1e4)](_0x229c29(0x237)+_0x28218a[_0x229c29(0x206)]+'\x22:'));for(const _0x3382c6 of _0x28218a[_0x229c29(0x217)]){console[_0x229c29(0x214)]('\x20\x20-\x20'+_0x3382c6);}return console[_0x229c29(0x214)](),console[_0x229c29(0x214)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1821a2+_0x229c29(0x261)),0x1;}case'no_tests':console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x1e4)](_0x229c29(0x252)+_0x28218a[_0x229c29(0x206)]+'\x22.')),console[_0x229c29(0x214)](a5_0x2494c8['dim'](_0x229c29(0x24d)+_0x28218a[_0x229c29(0x240)])),console[_0x229c29(0x214)](),console[_0x229c29(0x214)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0xe2c1ba,agentInfo:_0x244609}=parseTestFile(_0x217ce1);let _0x12857b=_0xe2c1ba[_0x229c29(0x1ea)];if(_0x4d17f3){const _0x73e172=_0x4d17f3['split'](',')[_0x229c29(0x20c)](_0x1fee5d=>_0x1fee5d[_0x229c29(0x213)]());_0x12857b=_0xe2c1ba[_0x229c29(0x1ea)]['filter'](_0x1c4050=>_0x73e172[_0x229c29(0x220)](_0x1c4050[_0x229c29(0x254)]));if(_0x12857b[_0x229c29(0x25a)]===0x0)return console['log'](a5_0x2494c8['yellow'](_0x229c29(0x1e8)+_0x4d17f3)),console['log'](a5_0x2494c8['dim'](_0x229c29(0x23b)+_0xe2c1ba[_0x229c29(0x1ea)][_0x229c29(0x20c)](_0xa3c79c=>_0xa3c79c['name'])[_0x229c29(0x258)](',\x20'))),0x1;}if(_0x5df39a){const _0x2daac0=_0x5df39a[_0x229c29(0x1db)](',')[_0x229c29(0x20c)](_0x575115=>_0x575115[_0x229c29(0x213)]()[_0x229c29(0x1e3)]());_0x12857b=_0x12857b[_0x229c29(0x25e)](_0x109fee=>_0x109fee[_0x229c29(0x218)]?.['some'](_0x43fa4c=>_0x2daac0[_0x229c29(0x220)](_0x43fa4c[_0x229c29(0x1e3)]())));if(_0x12857b[_0x229c29(0x25a)]===0x0){console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x1e4)](_0x229c29(0x1de)+_0x5df39a));const _0x364d25=new Set();return _0xe2c1ba[_0x229c29(0x1ea)]['forEach'](_0x38a9b1=>_0x38a9b1[_0x229c29(0x218)]?.[_0x229c29(0x249)](_0xb0913c=>_0x364d25['add'](_0xb0913c))),_0x364d25[_0x229c29(0x202)]>0x0?console['log'](a5_0x2494c8[_0x229c29(0x21c)](_0x229c29(0x22e)+[..._0x364d25]['join'](',\x20'))):console['log'](a5_0x2494c8[_0x229c29(0x21c)](_0x229c29(0x24b))),0x1;}}if(_0x3e3d6d)return this[_0x229c29(0x1e7)](_0x188547,{'definition':{'tests':_0x12857b},'agentInfo':_0x244609,'outputFormat':_0x5d7eaf,'outputFile':_0x4291e0,'testNames':_0x4d17f3});if(_0x4192ab){console['log'](a5_0x2494c8['cyan'](_0x229c29(0x1ff))),console['log']('\x20\x20Site:\x20'+a5_0x2494c8[_0x229c29(0x266)](_0x4a6781)),console[_0x229c29(0x214)](_0x229c29(0x208)+a5_0x2494c8[_0x229c29(0x266)](_0x244609[_0x229c29(0x23c)])),console[_0x229c29(0x214)](_0x229c29(0x264)+a5_0x2494c8[_0x229c29(0x266)](_0x244609[_0x229c29(0x1fd)])),console[_0x229c29(0x214)](),console[_0x229c29(0x214)](_0x229c29(0x26c)+a5_0x2494c8[_0x229c29(0x266)](_0x12857b[_0x229c29(0x25a)]));for(let _0x40a853=0x0;_0x40a853<_0x12857b[_0x229c29(0x25a)];_0x40a853++){const _0x3f0743=_0x12857b[_0x40a853],_0x3c268d=_0x3f0743[_0x229c29(0x21f)][_0x229c29(0x25a)]===0x1?'round':_0x229c29(0x21f),_0x452ba4=_0x3f0743[_0x229c29(0x218)]?.[_0x229c29(0x25a)]?'\x20['+_0x3f0743['tags'][_0x229c29(0x258)](',\x20')+']':'';console[_0x229c29(0x214)]('\x20\x20'+(_0x40a853+0x1)+'.\x20'+a5_0x2494c8[_0x229c29(0x266)](_0x3f0743[_0x229c29(0x254)])+'\x20('+_0x3f0743[_0x229c29(0x21f)][_0x229c29(0x25a)]+'\x20'+_0x3c268d+')'+a5_0x2494c8[_0x229c29(0x21c)](_0x452ba4));}return 0x0;}let _0x501805,_0x28a8d6;try{_0x501805=await _0x557b58[_0x229c29(0x1f3)][_0x229c29(0x248)](_0x244609[_0x229c29(0x23c)]);}catch(_0x24d5c7){const _0x51d119=_0x24d5c7 instanceof Error?_0x24d5c7[_0x229c29(0x241)]:String(_0x24d5c7);return _0x51d119[_0x229c29(0x220)](_0x229c29(0x211))||_0x51d119['toLowerCase']()[_0x229c29(0x220)]('not\x20found')?console[_0x229c29(0x214)](a5_0x2494c8['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x244609[_0x229c29(0x23c)])):console['log'](a5_0x2494c8[_0x229c29(0x234)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x244609[_0x229c29(0x23c)]+_0x229c29(0x22f)+_0x51d119)),0x1;}try{_0x28a8d6=await _0x557b58['llm']['resolveAgentId'](_0x244609[_0x229c29(0x1fd)],_0x501805);}catch(_0x511899){const _0x3d624=_0x511899 instanceof Error?_0x511899[_0x229c29(0x241)]:String(_0x511899);return _0x3d624[_0x229c29(0x220)](_0x229c29(0x211))||_0x3d624[_0x229c29(0x1e3)]()['includes'](_0x229c29(0x223))?console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x234)](_0x229c29(0x21e)+_0x244609[_0x229c29(0x1fd)])):console['log'](a5_0x2494c8[_0x229c29(0x234)](_0x229c29(0x200)+_0x244609[_0x229c29(0x1fd)]+_0x229c29(0x22f)+_0x3d624)),0x1;}let _0x1368d5;if(!_0x3add42)try{_0x1368d5=await setupEvaluatorAgent(_0x557b58[_0x229c29(0x1f3)],_0x18f3e3[_0x229c29(0x1d9)]);}catch(_0x46ea65){const _0x4e1f93=_0x46ea65 instanceof Error?_0x46ea65[_0x229c29(0x241)]:String(_0x46ea65);return console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x234)](_0x229c29(0x233)+_0x4e1f93)),0x1;}console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x22a)](_0x229c29(0x239))),console['log']('Site:\x20'+a5_0x2494c8['white'](_0x4a6781)),console[_0x229c29(0x214)](_0x229c29(0x238)+a5_0x2494c8[_0x229c29(0x266)](_0x244609[_0x229c29(0x23c)]+'/'+_0x244609[_0x229c29(0x1fd)])),console[_0x229c29(0x214)]();const _0x5a88bf=[],_0x428b47=[],_0x42a226=Date[_0x229c29(0x24c)]();for(let _0x2f0f1e=0x0;_0x2f0f1e<_0x12857b['length'];_0x2f0f1e++){const _0x5688f5=_0x12857b[_0x2f0f1e];_0x12857b[_0x229c29(0x25a)]>0x1?console[_0x229c29(0x214)](_0x229c29(0x1f7)+(_0x2f0f1e+0x1)+'/'+_0x12857b['length']+':\x20'+a5_0x2494c8[_0x229c29(0x266)](_0x5688f5[_0x229c29(0x254)])):console[_0x229c29(0x214)](_0x229c29(0x21a)+a5_0x2494c8['white'](_0x5688f5[_0x229c29(0x254)]));const _0x3ab7bc=createCommandSpinner(_0x229c29(0x1df)+_0x5688f5['rounds'][_0x229c29(0x25a)]+_0x229c29(0x26a));_0x3ab7bc[_0x229c29(0x20f)]();try{const {result:_0x1d8b21,conversation:_0x50ad8f}=await runTest(_0x557b58['llm'],_0x5688f5,{'agentId':_0x28a8d6,'projectId':_0x501805,'site':_0x4a6781,'noEval':_0x3add42,'evaluatorId':_0x1368d5,'onRoundStart':(_0x11b179,_0x8e458a)=>{const _0x1cf3bd=_0x229c29;_0x3ab7bc[_0x1cf3bd(0x1fa)]=_0x1cf3bd(0x228)+(_0x11b179+0x1)+'/'+_0x8e458a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x31014e,_0x3a7865,_0xb3932a)=>{const _0x473a8b=_0x229c29,_0x4866d3=formatElapsed(_0x3a7865);_0xb3932a?console[_0x473a8b(0x214)](_0x473a8b(0x1fb)+(_0x31014e+0x1)+'/'+_0x5688f5['rounds'][_0x473a8b(0x25a)]+'...\x20'+a5_0x2494c8[_0x473a8b(0x225)]('✓')+'\x20('+_0x4866d3+')'):console[_0x473a8b(0x214)]('\x20\x20Round\x20'+(_0x31014e+0x1)+'/'+_0x5688f5[_0x473a8b(0x21f)][_0x473a8b(0x25a)]+_0x473a8b(0x23a)+a5_0x2494c8['red']('✗'));},'onEvaluationStart':()=>{const _0x18c44b=_0x229c29;_0x3ab7bc['text']=_0x18c44b(0x253);},'onEvaluationComplete':_0x58325f=>{const _0x2aa119=_0x229c29,_0x398056=formatElapsed(_0x58325f);console[_0x2aa119(0x214)]('\x20\x20Evaluating...\x20'+a5_0x2494c8[_0x2aa119(0x225)]('✓')+'\x20('+_0x398056+')');}});_0x3ab7bc[_0x229c29(0x244)](),_0x5a88bf['push'](_0x1d8b21),_0x428b47['push'](_0x50ad8f);if(_0x1d8b21[_0x229c29(0x259)]===_0x229c29(0x24f))console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x225)](_0x229c29(0x26b)+_0x1d8b21[_0x229c29(0x1f1)]));else _0x1d8b21[_0x229c29(0x259)]===_0x229c29(0x201)?console['log'](a5_0x2494c8[_0x229c29(0x234)](_0x229c29(0x232)+_0x1d8b21['reason'])):console['log'](a5_0x2494c8[_0x229c29(0x234)](_0x229c29(0x256)+_0x1d8b21['reason']));_0x1d8b21[_0x229c29(0x23e)]&&console[_0x229c29(0x214)](a5_0x2494c8['dim'](_0x229c29(0x236)+_0x1d8b21['conversation_url'])),console[_0x229c29(0x214)]();}catch(_0xd54a8a){_0x3ab7bc[_0x229c29(0x244)]();const _0x74b686=_0xd54a8a instanceof Error?_0xd54a8a[_0x229c29(0x241)]:String(_0xd54a8a);console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x234)](_0x229c29(0x256)+_0x74b686)),console[_0x229c29(0x214)](),_0x5a88bf[_0x229c29(0x1da)]({'name':_0x5688f5[_0x229c29(0x254)],'status':'ERROR','reason':_0x74b686,'timestamp':new Date()[_0x229c29(0x250)](),'duration_ms':0x0});}}const _0x302426=Date[_0x229c29(0x24c)]()-_0x42a226,_0x2f90e7=_0x5a88bf['filter'](_0x467e67=>_0x467e67['status']===_0x229c29(0x24f))[_0x229c29(0x25a)],_0x50c36a=_0x5a88bf['filter'](_0x1efc35=>_0x1efc35['status']===_0x229c29(0x201))[_0x229c29(0x25a)],_0x1e9c3=_0x5a88bf[_0x229c29(0x25e)](_0x13790d=>_0x13790d[_0x229c29(0x259)]===_0x229c29(0x24e))[_0x229c29(0x25a)];console[_0x229c29(0x214)]('━'[_0x229c29(0x22c)](0x3c)),console[_0x229c29(0x214)]('Test\x20Summary'),console[_0x229c29(0x214)]('━'[_0x229c29(0x22c)](0x3c)),console['log'](_0x229c29(0x1e0)+_0x5a88bf[_0x229c29(0x25a)]),console[_0x229c29(0x214)](_0x229c29(0x1ec)+a5_0x2494c8['green'](_0x2f90e7)),console[_0x229c29(0x214)](_0x229c29(0x1fe)+a5_0x2494c8[_0x229c29(0x234)](_0x50c36a));_0x1e9c3>0x0&&console[_0x229c29(0x214)]('Errors:\x20\x20\x20'+a5_0x2494c8[_0x229c29(0x234)](_0x1e9c3));console[_0x229c29(0x214)](_0x229c29(0x260)+formatElapsed(_0x302426)),console[_0x229c29(0x214)]('━'[_0x229c29(0x22c)](0x3c));const _0x5bbafe=_0x5a88bf[_0x229c29(0x25e)](_0x29efe0=>_0x29efe0[_0x229c29(0x259)]!==_0x229c29(0x24f));if(_0x5bbafe['length']>0x0){console[_0x229c29(0x214)](),console[_0x229c29(0x214)](_0x229c29(0x20d));for(const _0x268467 of _0x5bbafe){const _0xb69e0f=a5_0x2494c8[_0x229c29(0x234)]('✗'),_0x1a4940=_0x268467['reason'][_0x229c29(0x25a)]>0x32?_0x268467['reason'][_0x229c29(0x25c)](0x0,0x32)+_0x229c29(0x226):_0x268467[_0x229c29(0x1f1)];console[_0x229c29(0x214)]('\x20\x20'+_0xb69e0f+'\x20'+_0x268467[_0x229c29(0x254)]+':\x20'+_0x1a4940);}}const _0x2c86e3={'summary':{'total':_0x5a88bf[_0x229c29(0x25a)],'passed':_0x2f90e7,'failed':_0x50c36a,'errors':_0x1e9c3>0x0?_0x1e9c3:undefined,'duration_ms':_0x302426},'tests':_0x5a88bf,'agent':{'project':_0x244609['projectName'],'name':_0x244609[_0x229c29(0x1fd)],'site':_0x4a6781},'timestamp':new Date(_0x42a226)[_0x229c29(0x250)]()};try{const _0x31abc6=buildCachedTestRun(_0x428b47,{'site':_0x4a6781,'projectId':_0x501805,'projectName':_0x244609[_0x229c29(0x23c)],'agentId':_0x28a8d6,'agentName':_0x244609[_0x229c29(0x1fd)],'testYmlPath':a5_0x337a75[_0x229c29(0x1eb)](_0x244609[_0x229c29(0x267)])});saveLastTestRun(_0x31abc6);}catch{}if(_0x5d7eaf!==_0x229c29(0x1f5)||_0x4291e0){const _0x930e24=formatResults(_0x2c86e3,_0x5d7eaf);if(_0x4291e0)try{a5_0x21076d[_0x229c29(0x229)](_0x4291e0,_0x930e24,_0x229c29(0x1fc)),console[_0x229c29(0x214)](),console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x21c)](_0x229c29(0x246)+_0x4291e0));}catch(_0x51c16a){return console[_0x229c29(0x214)](),console[_0x229c29(0x214)](a5_0x2494c8[_0x229c29(0x234)](_0x229c29(0x21b)+_0x51c16a)),0x1;}else console[_0x229c29(0x214)](),console[_0x229c29(0x214)](_0x930e24);}return _0x5bbafe[_0x229c29(0x25a)]>0x0?0x1:0x0;}async['executeReeval'](_0x462562,_0x586d89){const _0x487f99=a5_0x115019,{options:_0x534905,tdx:_0xb3e993}=_0x462562,{definition:_0x4ab262,agentInfo:_0x16a94b,outputFormat:_0x4569b2,outputFile:_0x3a3909}=_0x586d89,_0x145fe4=_0x534905[_0x487f99(0x1f6)],_0x50639b=loadLastTestRun();if(!_0x50639b)return console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x234)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x2494c8[_0x487f99(0x21c)](_0x487f99(0x255))),0x1;if(_0x50639b[_0x487f99(0x251)][_0x487f99(0x1fd)]!==_0x16a94b[_0x487f99(0x1fd)])return console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x234)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x50639b['agent'][_0x487f99(0x1fd)]+_0x487f99(0x269)+_0x16a94b['agentName']+'\x22.')),console['log'](a5_0x2494c8[_0x487f99(0x21c)](_0x487f99(0x21d))),0x1;const _0x5790b2=new Set(_0x50639b[_0x487f99(0x263)]['map'](_0x353590=>_0x353590['testName'])),_0x47de08=_0x4ab262[_0x487f99(0x1ea)][_0x487f99(0x25e)](_0x184675=>!_0x5790b2[_0x487f99(0x1f9)](_0x184675['name']));if(_0x47de08[_0x487f99(0x25a)]>0x0&&_0x50639b['site']!==_0x145fe4)return console['log'](a5_0x2494c8[_0x487f99(0x234)](_0x487f99(0x224))),console['log'](a5_0x2494c8[_0x487f99(0x21c)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x50639b[_0x487f99(0x1f6)]+_0x487f99(0x1dd)+_0x145fe4+'\x22.')),console[_0x487f99(0x214)](a5_0x2494c8['dim'](_0x487f99(0x230)+_0x50639b['site']+_0x487f99(0x1e1))),0x1;const _0x27a889=_0x4ab262['tests'][_0x487f99(0x25e)](_0x56e5f2=>_0x5790b2[_0x487f99(0x1f9)](_0x56e5f2['name'])),_0x36351b=_0x47de08;let _0xaf30ed;try{_0xaf30ed=await setupEvaluatorAgent(_0xb3e993[_0x487f99(0x1f3)],_0x534905[_0x487f99(0x1d9)]);}catch(_0x1dd123){const _0x9556e4=_0x1dd123 instanceof Error?_0x1dd123[_0x487f99(0x241)]:String(_0x1dd123);return console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x234)](_0x487f99(0x233)+_0x9556e4)),0x1;}console[_0x487f99(0x214)](a5_0x2494c8['cyan'](_0x487f99(0x1e2))),console[_0x487f99(0x214)]('Cached\x20run\x20from:\x20'+a5_0x2494c8[_0x487f99(0x266)](_0x50639b[_0x487f99(0x1f4)])),console['log']('Agent:\x20'+a5_0x2494c8[_0x487f99(0x266)](_0x50639b[_0x487f99(0x251)][_0x487f99(0x23c)]+'/'+_0x50639b['agent'][_0x487f99(0x1fd)]));_0x36351b[_0x487f99(0x25a)]>0x0&&console[_0x487f99(0x214)](_0x487f99(0x231)+a5_0x2494c8[_0x487f99(0x1e4)](_0x36351b[_0x487f99(0x25a)]));console['log']();const _0x4ba38f=[],_0x58f5a4=Date[_0x487f99(0x24c)](),_0xe5cc38=createCommandSpinner(_0x487f99(0x1ed));if(_0x27a889[_0x487f99(0x25a)]>0x0)try{const _0x57d677=await reevaluateFromCache(_0xb3e993['llm'],_0x50639b,{'tests':_0x27a889},{'evaluatorId':_0xaf30ed,'onTestStart':(_0x26dff5,_0x38f8e8,_0x28f56b)=>{const _0x11385c=_0x487f99;_0xe5cc38['text']=_0x11385c(0x212)+(_0x38f8e8+0x1)+'/'+_0x28f56b+':\x20'+_0x26dff5+_0x11385c(0x226);if(!_0xe5cc38['isSpinning'])_0xe5cc38[_0x11385c(0x20f)]();},'onTestComplete':(_0x47984d,_0xdb65e3)=>{const _0x2f51b1=_0x487f99;_0xe5cc38[_0x2f51b1(0x244)]();if(_0xdb65e3['status']==='PASS')console[_0x2f51b1(0x214)](a5_0x2494c8['green'](_0x2f51b1(0x26b)+_0x47984d)+a5_0x2494c8['dim'](_0x2f51b1(0x210)));else _0xdb65e3['status']===_0x2f51b1(0x201)?console['log'](a5_0x2494c8[_0x2f51b1(0x234)](_0x2f51b1(0x232)+_0x47984d+'\x20-\x20'+_0xdb65e3[_0x2f51b1(0x1f1)])+a5_0x2494c8[_0x2f51b1(0x21c)](_0x2f51b1(0x210))):console['log'](a5_0x2494c8['red'](_0x2f51b1(0x256)+_0x47984d+_0x2f51b1(0x257)+_0xdb65e3['reason']));_0xdb65e3[_0x2f51b1(0x23e)]&&console[_0x2f51b1(0x214)](a5_0x2494c8[_0x2f51b1(0x21c)](_0x2f51b1(0x207)+_0xdb65e3['conversation_url'])),_0x4ba38f['push'](_0xdb65e3);},'onTestSkipped':(_0x5a132b,_0x3e1dd4)=>{const _0x2d9998=_0x487f99;_0xe5cc38[_0x2d9998(0x244)](),console[_0x2d9998(0x214)](a5_0x2494c8['yellow']('⚠\x20SKIPPED:\x20'+_0x5a132b+_0x2d9998(0x257)+_0x3e1dd4));}});for(const _0x4e8af6 of _0x57d677){!_0x4ba38f[_0x487f99(0x203)](_0x519747=>_0x519747[_0x487f99(0x254)]===_0x4e8af6[_0x487f99(0x254)])&&_0x4ba38f['push'](_0x4e8af6);}}catch(_0x1d2170){_0xe5cc38[_0x487f99(0x244)]();const _0xba3aa2=_0x1d2170 instanceof Error?_0x1d2170[_0x487f99(0x241)]:String(_0x1d2170);return console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x234)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0xba3aa2)),0x1;}_0xe5cc38[_0x487f99(0x244)]();if(_0x36351b[_0x487f99(0x25a)]>0x0){console[_0x487f99(0x214)](),console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x22a)](_0x487f99(0x24a)));const {projectId:_0x2c06f3,agentId:_0x5414ef}=_0x50639b[_0x487f99(0x251)];for(const _0x4d7932 of _0x36351b){console[_0x487f99(0x214)](_0x487f99(0x262)+a5_0x2494c8[_0x487f99(0x266)](_0x4d7932[_0x487f99(0x254)]));const _0xb089f2=createCommandSpinner(_0x487f99(0x1df)+_0x4d7932[_0x487f99(0x21f)]['length']+_0x487f99(0x26a));_0xb089f2['start']();try{const {result:_0x74c49c}=await runTest(_0xb3e993['llm'],_0x4d7932,{'agentId':_0x5414ef,'projectId':_0x2c06f3,'site':_0x50639b[_0x487f99(0x1f6)],'noEval':![],'evaluatorId':_0xaf30ed,'onRoundStart':(_0x12b52b,_0x3fd962)=>{const _0xdf7abe=_0x487f99;_0xb089f2[_0xdf7abe(0x1fa)]=_0xdf7abe(0x228)+(_0x12b52b+0x1)+'/'+_0x3fd962+_0xdf7abe(0x26a);},'onRoundComplete':(_0x12d1c0,_0x16dfce,_0x4d092a)=>{const _0x445d34=_0x487f99,_0x2feff1=formatElapsed(_0x16dfce);_0x4d092a?console[_0x445d34(0x214)](_0x445d34(0x1fb)+(_0x12d1c0+0x1)+'/'+_0x4d7932['rounds'][_0x445d34(0x25a)]+'...\x20'+a5_0x2494c8[_0x445d34(0x225)]('✓')+'\x20('+_0x2feff1+')'):console[_0x445d34(0x214)]('\x20\x20Round\x20'+(_0x12d1c0+0x1)+'/'+_0x4d7932['rounds'][_0x445d34(0x25a)]+_0x445d34(0x23a)+a5_0x2494c8[_0x445d34(0x234)]('✗'));},'onEvaluationStart':()=>{const _0x3a4bcf=_0x487f99;_0xb089f2[_0x3a4bcf(0x1fa)]=_0x3a4bcf(0x253);},'onEvaluationComplete':_0x2eea5b=>{const _0x1662f2=_0x487f99,_0x58030b=formatElapsed(_0x2eea5b);console['log']('\x20\x20Evaluating...\x20'+a5_0x2494c8[_0x1662f2(0x225)]('✓')+'\x20('+_0x58030b+')');}});_0xb089f2[_0x487f99(0x244)](),_0x4ba38f[_0x487f99(0x1da)](_0x74c49c);if(_0x74c49c['status']===_0x487f99(0x24f))console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x225)]('✓\x20PASS:\x20'+_0x74c49c[_0x487f99(0x1f1)])+a5_0x2494c8[_0x487f99(0x21c)](_0x487f99(0x245)));else _0x74c49c[_0x487f99(0x259)]===_0x487f99(0x201)?console['log'](a5_0x2494c8['red']('✗\x20FAIL:\x20'+_0x74c49c[_0x487f99(0x1f1)])+a5_0x2494c8['dim'](_0x487f99(0x245))):console['log'](a5_0x2494c8['red'](_0x487f99(0x256)+_0x74c49c[_0x487f99(0x1f1)]));_0x74c49c[_0x487f99(0x23e)]&&console['log'](a5_0x2494c8[_0x487f99(0x21c)](_0x487f99(0x207)+_0x74c49c[_0x487f99(0x23e)]));}catch(_0x40bac9){_0xb089f2[_0x487f99(0x244)]();const _0x3bed1=_0x40bac9 instanceof Error?_0x40bac9['message']:String(_0x40bac9);console[_0x487f99(0x214)](a5_0x2494c8['red']('✗\x20ERROR:\x20'+_0x3bed1)),_0x4ba38f[_0x487f99(0x1da)]({'name':_0x4d7932['name'],'status':_0x487f99(0x24e),'reason':_0x3bed1,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x487f99(0x214)]();const _0x823a52=Date[_0x487f99(0x24c)]()-_0x58f5a4,_0x2249f8=_0x4ba38f[_0x487f99(0x25e)](_0x2cef85=>_0x2cef85['status']==='PASS')['length'],_0x515908=_0x4ba38f['filter'](_0x21e93e=>_0x21e93e['status']==='FAIL')[_0x487f99(0x25a)],_0x3754cd=_0x4ba38f[_0x487f99(0x25e)](_0x2879d9=>_0x2879d9[_0x487f99(0x259)]===_0x487f99(0x24e))[_0x487f99(0x25a)];console['log']('━'[_0x487f99(0x22c)](0x3c)),console['log'](_0x487f99(0x204)),console[_0x487f99(0x214)]('━'[_0x487f99(0x22c)](0x3c)),console[_0x487f99(0x214)](_0x487f99(0x1e0)+_0x4ba38f['length']),console[_0x487f99(0x214)](_0x487f99(0x1ec)+a5_0x2494c8[_0x487f99(0x225)](_0x2249f8)),console[_0x487f99(0x214)](_0x487f99(0x1fe)+a5_0x2494c8[_0x487f99(0x234)](_0x515908));_0x3754cd>0x0&&console['log'](_0x487f99(0x209)+a5_0x2494c8[_0x487f99(0x234)](_0x3754cd));console[_0x487f99(0x214)](_0x487f99(0x260)+formatElapsed(_0x823a52)),console[_0x487f99(0x214)]('━'['repeat'](0x3c));const _0x32483a={'summary':{'total':_0x4ba38f[_0x487f99(0x25a)],'passed':_0x2249f8,'failed':_0x515908,'errors':_0x3754cd>0x0?_0x3754cd:undefined,'duration_ms':_0x823a52},'tests':_0x4ba38f,'agent':{'project':_0x16a94b[_0x487f99(0x23c)],'name':_0x16a94b['agentName'],'site':_0x145fe4},'timestamp':new Date(_0x58f5a4)[_0x487f99(0x250)]()};if(_0x4569b2!==_0x487f99(0x1f5)||_0x3a3909){const _0x762f74=formatResults(_0x32483a,_0x4569b2);if(_0x3a3909)try{a5_0x21076d[_0x487f99(0x229)](_0x3a3909,_0x762f74,_0x487f99(0x1fc)),console[_0x487f99(0x214)](),console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x21c)]('Output\x20written\x20to:\x20'+_0x3a3909));}catch(_0x1e1745){return console[_0x487f99(0x214)](),console[_0x487f99(0x214)](a5_0x2494c8[_0x487f99(0x234)]('Error\x20writing\x20output\x20file:\x20'+_0x1e1745)),0x1;}else console['log'](),console[_0x487f99(0x214)](_0x762f74);}const _0x172a1f=_0x4ba38f['filter'](_0x4731b8=>_0x4731b8[_0x487f99(0x259)]!==_0x487f99(0x24f));return _0x172a1f[_0x487f99(0x25a)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x3c583c=a6_0x8756;(function(_0x15d7d9,_0x540592){const _0x3fbf3b=a6_0x8756,_0x19b5ec=_0x15d7d9();while(!![]){try{const _0x2e111e=-parseInt(_0x3fbf3b(0x9a))/0x1*(-parseInt(_0x3fbf3b(0xab))/0x2)+-parseInt(_0x3fbf3b(0xb5))/0x3*(-parseInt(_0x3fbf3b(0x83))/0x4)+-parseInt(_0x3fbf3b(0x7b))/0x5*(-parseInt(_0x3fbf3b(0x6f))/0x6)+parseInt(_0x3fbf3b(0x96))/0x7*(-parseInt(_0x3fbf3b(0x8e))/0x8)+-parseInt(_0x3fbf3b(0x99))/0x9+-parseInt(_0x3fbf3b(0xb0))/0xa+parseInt(_0x3fbf3b(0x76))/0xb;if(_0x2e111e===_0x540592)break;else _0x19b5ec['push'](_0x19b5ec['shift']());}catch(_0x231019){_0x19b5ec['push'](_0x19b5ec['shift']());}}}(a6_0x17f7,0x75730));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x8756(_0x42ba2c,_0x4c4fe1){_0x42ba2c=_0x42ba2c-0x6a;const _0x17f7d6=a6_0x17f7();let _0x875661=_0x17f7d6[_0x42ba2c];return _0x875661;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x3c583c(0xac),a6_0x3c583c(0x71),a6_0x3c583c(0xa0),a6_0x3c583c(0x9f),a6_0x3c583c(0x89),a6_0x3c583c(0x8a),'x-trino-user']);function isSensitiveHeader(_0x21758b){const _0x11b506=a6_0x3c583c;return SENSITIVE_HEADERS[_0x11b506(0x81)](_0x21758b[_0x11b506(0x7c)]());}function parseHeader(_0x2ba9b3){const _0x1150b2=a6_0x3c583c,_0x514019=_0x2ba9b3[_0x1150b2(0x8c)](':');if(_0x514019===-0x1)throw new Error(_0x1150b2(0x6a)+_0x2ba9b3+_0x1150b2(0x73)+_0x1150b2(0xaf));const _0x45593d=_0x2ba9b3['substring'](0x0,_0x514019)[_0x1150b2(0x87)](),_0x3de1e5=_0x2ba9b3[_0x1150b2(0xa7)](_0x514019+0x1)['trim']();if(!_0x45593d)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x2ba9b3+'\x22');return[_0x45593d,_0x3de1e5];}export class ApiCommand extends BaseCommand{[a6_0x3c583c(0x90)]='api';['description']=a6_0x3c583c(0x88);[a6_0x3c583c(0x79)](_0x530337){const _0x1a2a36=a6_0x3c583c,{args:_0x43a129,options:_0xcf4e7d}=_0x530337,_0x33fb63=_0xcf4e7d;if(_0x43a129['length']===0x0)return _0x1a2a36(0x7e);const _0x134a31=_0x43a129[0x0];if(!_0x134a31[_0x1a2a36(0x94)]('/'))return _0x1a2a36(0xb3)+_0x134a31;const _0x1d4469=_0x33fb63[_0x1a2a36(0x97)],_0x120a49=_0x33fb63[_0x1a2a36(0xa9)];if(_0x1d4469&&_0x120a49)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0xb4ed10=_0x33fb63[_0x1a2a36(0x9c)]||_0x1a2a36(0x9e),_0x182ff7=[_0x1a2a36(0x9e),_0x1a2a36(0xa4),_0x1a2a36(0xaa),_0x1a2a36(0x74),_0x1a2a36(0x95)];if(!_0x182ff7[_0x1a2a36(0x86)](_0xb4ed10['toUpperCase']()))return _0x1a2a36(0xa2)+_0xb4ed10+'.\x20Valid\x20methods:\x20'+_0x182ff7[_0x1a2a36(0x72)](',\x20');const _0x3f9669=_0x33fb63[_0x1a2a36(0x9b)]||'td',_0x10f091=['td',_0x1a2a36(0x9d),_0x1a2a36(0xa6),_0x1a2a36(0xad),_0x1a2a36(0x6d),'llm-proxy',_0x1a2a36(0xb1)];if(!_0x10f091[_0x1a2a36(0x86)](_0x3f9669))return _0x1a2a36(0x8f)+_0x3f9669+_0x1a2a36(0x7f)+_0x10f091[_0x1a2a36(0x72)](',\x20');return undefined;}async[a6_0x3c583c(0x6c)](_0x318d0f){const _0x1394b5=a6_0x3c583c,{options:_0x5f4368,args:_0x5656fa,tdx:_0x413512}=_0x318d0f,_0x20bbe6=_0x5f4368,_0x1526cd=_0x5656fa[0x0],_0x21b539=(_0x20bbe6[_0x1394b5(0x9c)]||'GET')[_0x1394b5(0x6e)](),_0x4f2b3a=_0x20bbe6[_0x1394b5(0x97)],_0x8f7352=_0x20bbe6[_0x1394b5(0xa9)],_0x31c7ba=_0x20bbe6[_0x1394b5(0x7a)],_0x15b7fc=_0x20bbe6[_0x1394b5(0x9b)]||'td';try{const _0x19eb01={};if(_0x31c7ba){const _0x1def16=Array[_0x1394b5(0xa3)](_0x31c7ba)?_0x31c7ba:[_0x31c7ba];for(const _0x49e7d8 of _0x1def16){const [_0x451bce,_0x4689de]=parseHeader(_0x49e7d8);_0x19eb01[_0x451bce]=_0x4689de;}}let _0x355dd5;if(_0x4f2b3a)_0x355dd5=_0x4f2b3a;else{if(_0x8f7352)try{_0x355dd5=RawAPI[_0x1394b5(0x92)](_0x8f7352);}catch(_0x174736){return console['error']('Error:\x20'+(_0x174736 instanceof Error?_0x174736['message']:String(_0x174736))),0x1;}}const _0x500b54={'method':_0x21b539,'apiType':_0x15b7fc,'includeHeaders':_0x5f4368['verbose']};_0x355dd5&&(_0x500b54[_0x1394b5(0x98)]=_0x355dd5);Object[_0x1394b5(0x91)](_0x19eb01)[_0x1394b5(0x77)]>0x0&&(_0x500b54[_0x1394b5(0x84)]=_0x19eb01);if(_0x5f4368[_0x1394b5(0x93)]){const _0x980483=resolveSite(_0x5f4368[_0x1394b5(0xb2)]),_0x178afd=getEndpoint(_0x980483,_0x15b7fc),_0xa3ff13=''+_0x178afd+_0x1526cd;console[_0x1394b5(0x78)]('>\x20'+_0x21b539+'\x20'+_0xa3ff13);const _0x172e0a=getAuthHeaders(_0x980483),_0x439c4f={..._0x172e0a,..._0x19eb01};for(const [_0x27b368,_0x2cf182]of Object[_0x1394b5(0x80)](_0x439c4f)){!isSensitiveHeader(_0x27b368)&&console[_0x1394b5(0x78)]('>\x20'+_0x27b368+':\x20'+_0x2cf182);}_0x355dd5&&console[_0x1394b5(0x78)]('>'),console['error']('');}const _0x1427d9=await _0x413512[_0x1394b5(0x6b)][_0x1394b5(0x82)](_0x1526cd,_0x500b54);if(_0x5f4368[_0x1394b5(0x93)]&&_0x1427d9[_0x1394b5(0x84)]){console[_0x1394b5(0x78)](_0x1394b5(0x7d)+_0x1427d9[_0x1394b5(0x8d)]);for(const [_0xfc498b,_0x4bcee1]of Object[_0x1394b5(0x80)](_0x1427d9[_0x1394b5(0x84)])){!isSensitiveHeader(_0xfc498b)&&console[_0x1394b5(0x78)]('<\x20'+_0xfc498b+':\x20'+_0x4bcee1);}console['error']('');}const _0x106f34=Boolean(_0x5f4368[_0x1394b5(0xae)]),_0x3e70da={'color':_0x5f4368['color'],'noColor':_0x5f4368[_0x1394b5(0xa5)]||_0x106f34&&!_0x5f4368[_0x1394b5(0x70)]},_0x5e2b0b=colorizeJSON(_0x1427d9[_0x1394b5(0x97)],_0x3e70da);return _0x5f4368['output']?(writeFileSync(_0x5f4368[_0x1394b5(0xae)],_0x5e2b0b),console[_0x1394b5(0x78)](_0x1394b5(0xa1)+_0x5f4368[_0x1394b5(0xae)])):console[_0x1394b5(0x8b)](_0x5e2b0b),0x0;}catch(_0x605257){return _0x605257 instanceof Error?(console[_0x1394b5(0x78)](_0x1394b5(0x85)+_0x605257[_0x1394b5(0xa8)]),_0x5f4368[_0x1394b5(0x93)]&&_0x605257['stack']&&console[_0x1394b5(0x78)](_0x1394b5(0xb4)+_0x605257[_0x1394b5(0x75)])):console[_0x1394b5(0x78)](_0x1394b5(0x85)+String(_0x605257)),0x1;}}}function a6_0x17f7(){const _0x2c9016=['error','validate','header','26330qhyeVs','toLowerCase','<\x20HTTP/1.1\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','.\x20Valid\x20types:\x20','entries','has','request','41548HbuRqj','headers','Error:\x20','includes','trim','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','x-xsrf-token','x-auth-token','log','indexOf','status','8ijKzvr','Invalid\x20API\x20type:\x20','name','keys','readBodyFromFile','verbose','startsWith','PATCH','701561HujmKN','data','body','2913183HNkwOl','2722aNmeYw','type','method','cdp','GET','set-cookie2','set-cookie','Results\x20saved\x20to\x20','Invalid\x20HTTP\x20method:\x20','isArray','POST','noColor','workflow','substring','message','file','PUT','186pyMQAa','proxy-authorization','trino','output','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','4732770PfKDKY','cas','site','Endpoint\x20must\x20start\x20with\x20/:\x20','\x0aStack\x20trace:\x0a','195UzXnHH','Invalid\x20header\x20format:\x20\x22','api','execute','llm','toUpperCase','462xRsLdg','color','cookie','join','\x22.\x20','DELETE','stack','489236WNwNjl','length'];a6_0x17f7=function(){return _0x2c9016;};return a6_0x17f7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x50383e=a7_0x232d;(function(_0x439b7a,_0x36f8a9){const _0x30d984=a7_0x232d,_0x238a4c=_0x439b7a();while(!![]){try{const _0x4db69c=-parseInt(_0x30d984(0xf4))/0x1+-parseInt(_0x30d984(0xab))/0x2+-parseInt(_0x30d984(0xc8))/0x3+-parseInt(_0x30d984(0x100))/0x4*(-parseInt(_0x30d984(0xc1))/0x5)+parseInt(_0x30d984(0xd4))/0x6*(-parseInt(_0x30d984(0xfc))/0x7)+parseInt(_0x30d984(0xe2))/0x8*(parseInt(_0x30d984(0xf0))/0x9)+-parseInt(_0x30d984(0xfe))/0xa;if(_0x4db69c===_0x36f8a9)break;else _0x238a4c['push'](_0x238a4c['shift']());}catch(_0x139f69){_0x238a4c['push'](_0x238a4c['shift']());}}}(a7_0x40a2,0x75357));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a7_0x40a2(){const _0x427811=['tdx\x20profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','getUserInfo','✓\x20Default\x20site\x20set\x20to\x20','\x20and\x20','8ibElWC','password','\x20\x20user_id:','trim','description','site','✓\x20Profile\x20\x27','Sign\x20in\x20with\x20browser\x20(recommended)','logLevel','\x27\x20registered','auth:clear','execute','N/A','apikey','8121285QBsExl','warn','\x20(site:\x20','\x20removed\x20from\x20keychain','248292MScKhB','Name:\x20','oauth','API\x20key','\x0aSetup\x20cancelled','yellow','accountName','auth:setup','49fiBYnF','us01','6568960kGBfsP','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','109108NPqcRx','\x20\x20tdx','Read\x20credential\x20from\x20','create','apiKey','Read\x20credential\x20from\x20keychain','access_token','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Validating\x20API\x20key...','method','Remove\x20API\x20key\x20from\x20system\x20keychain','User:\x20','ERROR','53998pYFMVu','message','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','/app/mp/ak','dim','Choose\x20how\x20to\x20sign\x20in:','email','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','filter','Validating\x20OAuth\x20tokens...','System\x20keychain\x20is\x20not\x20available','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','status','\x20(profile:\x20','OAuth\x20tokens','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','green','all','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','join','/users/initiate_sso\x20(account:\x20','125hhFQSN','error','Credential\x20type:\x20OAuth','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','jobs','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','bold','416886dUyAcm','first_name','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','profile','\x20--profile\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','No\x20credential\x20found','Enter\x20your\x20TD\x20API\x20key:','account_id','\x20for\x20profile:\x20','Setup\x20cancelled','cyan','28332fscSNL','select','You\x20can\x20find\x20your\x20API\x20key\x20at:','log','last_name','name','red','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','Setting\x20up\x20authentication\x20for\x20site:\x20'];a7_0x40a2=function(){return _0x427811;};return a7_0x40a2();}function a7_0x232d(_0x1d0259,_0x5efb63){_0x1d0259=_0x1d0259-0xaa;const _0x40a2f4=a7_0x40a2();let _0x232dbd=_0x40a2f4[_0x1d0259];return _0x232dbd;}import a7_0x3d30ba 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_0xe9106a from'chalk';export async function runOAuthLoginFlow(_0x491fae,_0xac2601,_0x616163,_0xe76dda){const _0x41e033=a7_0x232d,_0x3b0c85=await isKeychainAvailable();if(!_0x3b0c85)throw new Error(_0x41e033(0xb3)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x25fa88=_0xe76dda?.[_0x41e033(0xfa)];if(!_0x25fa88){const _0x3b9ef2=await a7_0x3d30ba({'type':'text','name':_0x41e033(0xfa),'message':_0x41e033(0xc6)});if(_0x3b9ef2[_0x41e033(0xfa)]===undefined)throw new Error(_0x41e033(0xd2));_0x25fa88=_0x3b9ef2[_0x41e033(0xfa)][_0x41e033(0xe5)]()||undefined;}const _0x1886f6=getConsoleUrl(_0x491fae);console[_0x41e033(0xd7)]('Opening\x20browser\x20for\x20authentication...');_0x25fa88?console[_0x41e033(0xd7)]('\x20\x20'+_0x1886f6+_0x41e033(0xc0)+_0x25fa88+')'):console['log']('\x20\x20'+_0x1886f6+'/oauth/authorize');console[_0x41e033(0xd7)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x1f741c=await startOAuthFlow(_0x491fae,{'accountName':_0x25fa88});console[_0x41e033(0xd7)](_0x41e033(0xb5));const _0x18e726=TDX['create']({'site':_0x491fae,'accessToken':_0x1f741c[_0x41e033(0x106)],'logLevel':_0x616163??LogLevel[_0x41e033(0xaa)]}),_0x326cd8=await _0x18e726[_0x41e033(0xc5)][_0x41e033(0xdf)]();console[_0x41e033(0xd7)](a7_0xe9106a[_0x41e033(0xbc)]('✓\x20Signed\x20in\x20successfully')),console[_0x41e033(0xd7)]('\x20\x20'+a7_0xe9106a[_0x41e033(0xd3)](_0x491fae+':'+_0x326cd8[_0x41e033(0xd0)])+_0x41e033(0xe4)+_0x326cd8['id']+'\x20\x20('+_0x326cd8[_0x41e033(0xb2)]+')');!_0x25fa88&&(console[_0x41e033(0xd7)](a7_0xe9106a[_0x41e033(0xb0)](_0x41e033(0xbe))),console['log'](a7_0xe9106a[_0x41e033(0xb0)](_0x41e033(0xae))),console[_0x41e033(0xd7)](a7_0xe9106a[_0x41e033(0xb0)](_0x41e033(0xca))));await saveOAuthTokens(_0x1f741c,_0xac2601),console[_0x41e033(0xd7)](_0x41e033(0xdb)+(_0xac2601?_0x41e033(0xb9)+_0xac2601+')':''));if(_0xac2601){const _0x4bf83c={'site':_0x491fae};saveProfileToUserConfig(_0xac2601,_0x4bf83c),console[_0x41e033(0xd7)]('✓\x20Profile\x20\x27'+_0xac2601+_0x41e033(0xeb));}else saveDefaultSiteToUserConfig(_0x491fae),console[_0x41e033(0xd7)](_0x41e033(0xe0)+_0x491fae);const _0x538bb3=_0xac2601?_0x41e033(0xcc)+_0xac2601:'';console[_0x41e033(0xd7)](),console[_0x41e033(0xd7)](_0x41e033(0xde)),console['log'](_0x41e033(0x101)+_0x538bb3+_0x41e033(0xcd)),console[_0x41e033(0xd7)](_0x41e033(0x101)+_0x538bb3+_0x41e033(0xad));}export async function promptAuthMethod(){const _0x360216=a7_0x232d,_0x57dece=await a7_0x3d30ba({'type':_0x360216(0xd5),'name':_0x360216(0x109),'message':_0x360216(0xb1),'choices':[{'title':_0x360216(0xe9),'description':_0x360216(0xc4),'value':_0x360216(0xf6)},{'title':'Use\x20an\x20API\x20key','description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x360216(0xef)}]});return _0x57dece['method']||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x50383e(0xd9)]=a7_0x50383e(0xfb);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x50383e(0xed)](_0xe85988){const _0x2eee92=a7_0x50383e,{options:_0x5882dd}=_0xe85988,_0x5841d5=_0x5882dd[_0x2eee92(0xcb)];console[_0x2eee92(0xd7)](a7_0xe9106a[_0x2eee92(0xc7)]('tdx:\x20auth\x20setup'));const _0x2650e5=_0x5882dd['site']||_0x2eee92(0xfd),_0x338f05=await promptSiteSelection(_0x2650e5,_0x5841d5,_0x2eee92(0xd2));if(!_0x338f05)return 0x1;const _0x34e60f=resolveSite(_0x338f05),_0x4dd144=await promptAuthMethod();if(!_0x4dd144)return console['log'](_0x2eee92(0xf8)),0x1;if(_0x4dd144===_0x2eee92(0xf6)){const {accountName:_0xf3ddf1}=_0x5882dd;return await runOAuthLoginFlow(_0x34e60f,_0x5841d5,_0x5882dd[_0x2eee92(0xea)]??LogLevel[_0x2eee92(0xaa)],{'accountName':_0xf3ddf1}),0x0;}console[_0x2eee92(0xd7)](_0x2eee92(0xdc)+_0x34e60f),console[_0x2eee92(0xd7)](_0x2eee92(0xd6)),console['log']('\x20\x20'+getConsoleUrl(_0x34e60f,_0x2eee92(0xaf)));const _0x204d8b=await a7_0x3d30ba({'type':_0x2eee92(0xe3),'name':_0x2eee92(0x104),'message':_0x2eee92(0xcf),'validate':_0x3c350a=>{if(!_0x3c350a||!_0x3c350a['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x204d8b[_0x2eee92(0x104)])return console[_0x2eee92(0xd7)]('\x0aSetup\x20cancelled'),0x1;const _0x3a5701=_0x204d8b[_0x2eee92(0x104)];console[_0x2eee92(0xd7)](_0x2eee92(0x108));try{const _0x1b455f=TDX[_0x2eee92(0x103)]({'site':_0x34e60f,'apiKey':_0x3a5701[_0x2eee92(0xe5)](),'logLevel':_0x5882dd[_0x2eee92(0xea)]??LogLevel[_0x2eee92(0xaa)]}),_0x56185d=await _0x1b455f[_0x2eee92(0xc5)][_0x2eee92(0xdf)]();console['log'](_0x2eee92(0xb7)+_0x56185d[_0x2eee92(0xb2)]+')');const _0x54e3b6=await isKeychainAvailable();_0x54e3b6?(await saveAPIKeyAsync(_0x3a5701[_0x2eee92(0xe5)](),_0x34e60f,_0x5841d5),console[_0x2eee92(0xd7)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5841d5?'\x20(profile:\x20'+_0x5841d5+')':''))):(console[_0x2eee92(0xf1)](a7_0xe9106a[_0x2eee92(0xf9)](_0x2eee92(0x107))),console[_0x2eee92(0xf1)](a7_0xe9106a[_0x2eee92(0xf9)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x5841d5){const _0x5e9f05={'site':_0x34e60f};saveProfileToUserConfig(_0x5841d5,_0x5e9f05),console[_0x2eee92(0xd7)](_0x2eee92(0xe8)+_0x5841d5+_0x2eee92(0xeb));}else saveDefaultSiteToUserConfig(_0x34e60f),console[_0x2eee92(0xd7)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x34e60f);const _0x369cc3=_0x5841d5?_0x2eee92(0xcc)+_0x5841d5:'';return console[_0x2eee92(0xd7)](),console[_0x2eee92(0xd7)](_0x2eee92(0xde)),console['log'](_0x2eee92(0x101)+_0x369cc3+_0x2eee92(0xcd)),console[_0x2eee92(0xd7)]('\x20\x20tdx'+_0x369cc3+_0x2eee92(0xad)),0x0;}catch(_0x24ac20){if(_0x24ac20 instanceof HTTPClientError&&_0x24ac20[_0x2eee92(0xb8)]===0x191)return printAuthError(_0x24ac20),0x1;return console[_0x2eee92(0xc2)](a7_0xe9106a[_0x2eee92(0xda)]('✗\x20Validation\x20failed:\x20'+(_0x24ac20 instanceof Error?_0x24ac20[_0x2eee92(0xac)]:String(_0x24ac20)))),console[_0x2eee92(0xc2)](_0x2eee92(0xbb)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x50383e(0xe6)]=a7_0x50383e(0xff);async[a7_0x50383e(0xed)](_0xce839c){const _0x1cdcbd=a7_0x50383e,{options:_0x4efb98,tdx:_0x546cae}=_0xce839c,_0x5ee202=_0x4efb98[_0x1cdcbd(0xe7)],_0x3c1358=_0x4efb98[_0x1cdcbd(0xcb)],_0x37b9a6=_0x3c1358?_0x3c1358:_0x1cdcbd(0xee);console[_0x1cdcbd(0xd7)](_0x1cdcbd(0xdd)+_0x37b9a6+_0x1cdcbd(0xf2)+_0x5ee202+')');const _0x2f584b=await getOAuthTokens(_0x3c1358);if(_0x2f584b)console[_0x1cdcbd(0xd7)](_0x1cdcbd(0xc3)),console[_0x1cdcbd(0xd7)](_0x1cdcbd(0x105)+(_0x3c1358?_0x1cdcbd(0xb9)+_0x3c1358+')':''));else{const _0x13f34e=await resolveAPIKeyAsync(_0x5ee202,_0x3c1358);if(_0x13f34e){const {source:_0x1a3462,isDeprecated:_0x25e441}=_0x13f34e,_0x498b4e=_0x1cdcbd(0x102)+_0x1a3462;console[_0x1cdcbd(0xd7)](_0x25e441?a7_0xe9106a[_0x1cdcbd(0xf9)](_0x498b4e):_0x498b4e);}else console[_0x1cdcbd(0xd7)](a7_0xe9106a[_0x1cdcbd(0xf9)](_0x1cdcbd(0xce)));}try{const _0x445ea2=await _0x546cae[_0x1cdcbd(0xc5)][_0x1cdcbd(0xdf)]();return console[_0x1cdcbd(0xd7)](a7_0xe9106a[_0x1cdcbd(0xbc)]('✓\x20Authentication\x20successful\x0a')),console[_0x1cdcbd(0xd7)](_0x1cdcbd(0x10b)+_0x445ea2[_0x1cdcbd(0xb2)]),(_0x445ea2[_0x1cdcbd(0xc9)]||_0x445ea2[_0x1cdcbd(0xd8)])&&console[_0x1cdcbd(0xd7)](_0x1cdcbd(0xf5)+[_0x445ea2[_0x1cdcbd(0xc9)],_0x445ea2['last_name']][_0x1cdcbd(0xb4)](Boolean)['join']('\x20')),0x0;}catch(_0x49b0c8){return _0x49b0c8 instanceof HTTPClientError&&_0x49b0c8[_0x1cdcbd(0xb8)]===0x191?printAuthError(_0x49b0c8,!![],_0x3c1358):console[_0x1cdcbd(0xc2)](a7_0xe9106a[_0x1cdcbd(0xda)]('✗\x20Validation\x20failed:\x20'+(_0x49b0c8 instanceof Error?_0x49b0c8[_0x1cdcbd(0xac)]:String(_0x49b0c8)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x50383e(0xd9)]=a7_0x50383e(0xec);[a7_0x50383e(0xe6)]=a7_0x50383e(0x10a);async['execute'](_0x476226){const _0x10a5df=a7_0x50383e,{options:_0xcc0749}=_0x476226,_0x3018ad=_0xcc0749[_0x10a5df(0xcb)];console[_0x10a5df(0xd7)](a7_0xe9106a[_0x10a5df(0xc7)]('tdx:\x20auth\x20clear'));const _0x16b107=await isKeychainAvailable();if(!_0x16b107)return console['error'](a7_0xe9106a['red'](_0x10a5df(0xb6))),0x1;const [_0x117ad2,_0x21f5f8]=await Promise[_0x10a5df(0xbd)]([deleteKeychainAPIKey(_0x3018ad),deleteOAuthTokens(_0x3018ad)]);if(_0x117ad2||_0x21f5f8){clearCredentialCache();const _0xb5a39=[_0x117ad2&&_0x10a5df(0xf7),_0x21f5f8&&_0x10a5df(0xba)][_0x10a5df(0xb4)](Boolean)[_0x10a5df(0xbf)](_0x10a5df(0xe1));return console[_0x10a5df(0xd7)]('✓\x20'+_0xb5a39+_0x10a5df(0xf3)+(_0x3018ad?_0x10a5df(0xb9)+_0x3018ad+')':'')),0x0;}else return console[_0x10a5df(0xd7)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x3018ad?_0x10a5df(0xd1)+_0x3018ad:'')),0x1;}}
|
|
1
|
+
const a7_0x5867b1=a7_0x749f;(function(_0x3128d0,_0x40b568){const _0x2e6b50=a7_0x749f,_0x579c4a=_0x3128d0();while(!![]){try{const _0x44480c=-parseInt(_0x2e6b50(0x111))/0x1*(-parseInt(_0x2e6b50(0x16a))/0x2)+-parseInt(_0x2e6b50(0x154))/0x3+parseInt(_0x2e6b50(0x143))/0x4+-parseInt(_0x2e6b50(0x167))/0x5*(-parseInt(_0x2e6b50(0x120))/0x6)+-parseInt(_0x2e6b50(0x12d))/0x7*(-parseInt(_0x2e6b50(0x158))/0x8)+-parseInt(_0x2e6b50(0x15f))/0x9*(-parseInt(_0x2e6b50(0x12a))/0xa)+-parseInt(_0x2e6b50(0x14d))/0xb;if(_0x44480c===_0x40b568)break;else _0x579c4a['push'](_0x579c4a['shift']());}catch(_0x536e32){_0x579c4a['push'](_0x579c4a['shift']());}}}(a7_0x56f5,0x920e6));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x1cdca6 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a7_0x749f(_0x353ff3,_0x171d48){_0x353ff3=_0x353ff3-0x110;const _0x56f50f=a7_0x56f5();let _0x749f76=_0x56f50f[_0x353ff3];return _0x749f76;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x2aad28 from'chalk';export async function runOAuthLoginFlow(_0x2076b0,_0x401f0e,_0x396167,_0x1b53ed){const _0x4a0445=a7_0x749f,_0x37ee69=await isKeychainAvailable();if(!_0x37ee69)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x4a0445(0x135));let _0x1652d9=_0x1b53ed?.[_0x4a0445(0x112)];if(!_0x1652d9){const _0x3ef93e=await a7_0x1cdca6({'type':_0x4a0445(0x12b),'name':_0x4a0445(0x112),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x3ef93e[_0x4a0445(0x112)]===undefined)throw new Error(_0x4a0445(0x138));_0x1652d9=_0x3ef93e[_0x4a0445(0x112)]['trim']()||undefined;}const _0x40fe89=getConsoleUrl(_0x2076b0);console[_0x4a0445(0x15d)](_0x4a0445(0x144));_0x1652d9?console[_0x4a0445(0x15d)]('\x20\x20'+_0x40fe89+'/users/initiate_sso\x20(account:\x20'+_0x1652d9+')'):console[_0x4a0445(0x15d)]('\x20\x20'+_0x40fe89+'/oauth/authorize');console[_0x4a0445(0x15d)](_0x4a0445(0x12e));const _0x20fbe9=await startOAuthFlow(_0x2076b0,{'accountName':_0x1652d9});console[_0x4a0445(0x15d)](_0x4a0445(0x15e));const _0x347d65=TDX[_0x4a0445(0x165)]({'site':_0x2076b0,'accessToken':_0x20fbe9['access_token'],'logLevel':_0x396167??LogLevel[_0x4a0445(0x133)]}),_0x549139=await _0x347d65[_0x4a0445(0x146)][_0x4a0445(0x15b)]();console['log'](a7_0x2aad28[_0x4a0445(0x13c)]('✓\x20Signed\x20in\x20successfully')),console[_0x4a0445(0x15d)]('\x20\x20'+a7_0x2aad28[_0x4a0445(0x141)](_0x2076b0+':'+_0x549139['account_id'])+'\x20\x20user_id:'+_0x549139['id']+'\x20\x20('+_0x549139[_0x4a0445(0x110)]+')');!_0x1652d9&&(console[_0x4a0445(0x15d)](a7_0x2aad28[_0x4a0445(0x14e)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console['log'](a7_0x2aad28[_0x4a0445(0x14e)](_0x4a0445(0x130))),console[_0x4a0445(0x15d)](a7_0x2aad28['dim'](_0x4a0445(0x119))));await saveOAuthTokens(_0x20fbe9,_0x401f0e),console[_0x4a0445(0x15d)](_0x4a0445(0x125)+(_0x401f0e?_0x4a0445(0x157)+_0x401f0e+')':''));if(_0x401f0e){const _0x10cd4f={'site':_0x2076b0};saveProfileToUserConfig(_0x401f0e,_0x10cd4f),console['log'](_0x4a0445(0x166)+_0x401f0e+_0x4a0445(0x159));}else saveDefaultSiteToUserConfig(_0x2076b0),console['log'](_0x4a0445(0x126)+_0x2076b0);const _0x2f5083=_0x401f0e?_0x4a0445(0x145)+_0x401f0e:'';console[_0x4a0445(0x15d)](),console[_0x4a0445(0x15d)](_0x4a0445(0x12c)),console[_0x4a0445(0x15d)]('\x20\x20tdx'+_0x2f5083+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x4a0445(0x15d)](_0x4a0445(0x11d)+_0x2f5083+_0x4a0445(0x161));}export async function promptAuthMethod(){const _0x19a6b3=a7_0x749f,_0x5dc301=await a7_0x1cdca6({'type':_0x19a6b3(0x142),'name':_0x19a6b3(0x152),'message':_0x19a6b3(0x151),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x19a6b3(0x117),'value':_0x19a6b3(0x160)},{'title':_0x19a6b3(0x16d),'description':_0x19a6b3(0x16c),'value':_0x19a6b3(0x124)}]});return _0x5dc301[_0x19a6b3(0x152)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x5867b1(0x114)]=a7_0x5867b1(0x16b);[a7_0x5867b1(0x116)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x5867b1(0x168)](_0x368fea){const _0x23a60f=a7_0x5867b1,{options:_0x22ca22}=_0x368fea,_0x18b319=_0x22ca22['profile'];console['log'](a7_0x2aad28[_0x23a60f(0x11b)](_0x23a60f(0x121)));const _0x1c6b97=_0x22ca22[_0x23a60f(0x132)]||'us01',_0x15d449=await promptSiteSelection(_0x1c6b97,_0x18b319,_0x23a60f(0x138));if(!_0x15d449)return 0x1;const _0x144344=resolveSite(_0x15d449),_0x3198e6=await promptAuthMethod();if(!_0x3198e6)return console[_0x23a60f(0x15d)](_0x23a60f(0x137)),0x1;if(_0x3198e6===_0x23a60f(0x160)){const {accountName:_0x38aaf1}=_0x22ca22;return await runOAuthLoginFlow(_0x144344,_0x18b319,_0x22ca22[_0x23a60f(0x136)]??LogLevel[_0x23a60f(0x133)],{'accountName':_0x38aaf1}),0x0;}console[_0x23a60f(0x15d)](_0x23a60f(0x123)+_0x144344),console['log'](_0x23a60f(0x13d)),console[_0x23a60f(0x15d)]('\x20\x20'+getConsoleUrl(_0x144344,'/app/mp/ak'));const _0x1aa103=await a7_0x1cdca6({'type':_0x23a60f(0x14b),'name':_0x23a60f(0x15c),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x403b1e=>{const _0x598dab=_0x23a60f;if(!_0x403b1e||!_0x403b1e[_0x598dab(0x153)]())return _0x598dab(0x13f);return!![];}});if(!_0x1aa103[_0x23a60f(0x15c)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x3bb0cb=_0x1aa103[_0x23a60f(0x15c)];console[_0x23a60f(0x15d)](_0x23a60f(0x13a));try{const _0xf9d644=TDX[_0x23a60f(0x165)]({'site':_0x144344,'apiKey':_0x3bb0cb[_0x23a60f(0x153)](),'logLevel':_0x22ca22[_0x23a60f(0x136)]??LogLevel[_0x23a60f(0x133)]}),_0x4e513b=await _0xf9d644[_0x23a60f(0x146)]['getUserInfo']();console[_0x23a60f(0x15d)](_0x23a60f(0x11c)+_0x4e513b[_0x23a60f(0x110)]+')');const _0x48a3f3=await isKeychainAvailable();_0x48a3f3?(await saveAPIKeyAsync(_0x3bb0cb[_0x23a60f(0x153)](),_0x144344,_0x18b319),console[_0x23a60f(0x15d)](_0x23a60f(0x16f)+(_0x18b319?_0x23a60f(0x157)+_0x18b319+')':''))):(console['warn'](a7_0x2aad28[_0x23a60f(0x127)](_0x23a60f(0x15a))),console['warn'](a7_0x2aad28[_0x23a60f(0x127)](_0x23a60f(0x115))));if(_0x18b319){const _0x3bfcd6={'site':_0x144344};saveProfileToUserConfig(_0x18b319,_0x3bfcd6),console[_0x23a60f(0x15d)]('✓\x20Profile\x20\x27'+_0x18b319+_0x23a60f(0x159));}else saveDefaultSiteToUserConfig(_0x144344),console[_0x23a60f(0x15d)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x144344);const _0x521a56=_0x18b319?'\x20--profile\x20'+_0x18b319:'';return console[_0x23a60f(0x15d)](),console[_0x23a60f(0x15d)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x23a60f(0x15d)]('\x20\x20tdx'+_0x521a56+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x23a60f(0x15d)](_0x23a60f(0x11d)+_0x521a56+_0x23a60f(0x161)),0x0;}catch(_0x1a830f){if(_0x1a830f instanceof HTTPClientError&&_0x1a830f[_0x23a60f(0x11f)]===0x191)return printAuthError(_0x1a830f),0x1;return console['error'](a7_0x2aad28[_0x23a60f(0x118)](_0x23a60f(0x150)+(_0x1a830f instanceof Error?_0x1a830f['message']:String(_0x1a830f)))),console[_0x23a60f(0x164)](_0x23a60f(0x134)),0x1;}}}function a7_0x56f5(){const _0x42a3c3=['message','✗\x20Validation\x20failed:\x20','Choose\x20how\x20to\x20sign\x20in:','method','trim','1955097CkAhTn','API\x20key','N/A','\x20(profile:\x20','24368LUzecs','\x27\x20registered','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','getUserInfo','apiKey','log','Validating\x20OAuth\x20tokens...','180828LUkdMI','oauth','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','No\x20credential\x20found','Read\x20credential\x20from\x20','error','create','✓\x20Profile\x20\x27','286170pIOmXf','execute','Credential\x20type:\x20OAuth','12142rWxaYM','auth:setup','For\x20scripts\x20or\x20headless\x20servers','Use\x20an\x20API\x20key','No\x20credentials\x20found\x20in\x20keychain','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','email','181BBYawP','accountName','first_name','name','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','description','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','red','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20for\x20profile:\x20','bold','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20\x20tdx','last_name','status','102tqKAeF','tdx:\x20auth\x20setup','User:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','apikey','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','✓\x20Default\x20site\x20set\x20to\x20','yellow','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20and\x20','50kOjuSL','text','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','2513diupmI','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','all','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','auth:clear','site','ERROR','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','logLevel','\x0aSetup\x20cancelled','Setup\x20cancelled','join','Validating\x20API\x20key...','profile','green','You\x20can\x20find\x20your\x20API\x20key\x20at:','Remove\x20API\x20key\x20from\x20system\x20keychain','API\x20key\x20cannot\x20be\x20empty','\x20(site:\x20','cyan','select','3039792lQzbhy','Opening\x20browser\x20for\x20authentication...','\x20--profile\x20','jobs','filter','tdx:\x20auth\x20clear','tdx\x20profile:\x20','Name:\x20','password','OAuth\x20tokens','30533866xxUeEc','dim'];a7_0x56f5=function(){return _0x42a3c3;};return a7_0x56f5();}export class AuthStatusCommand extends BaseCommand{[a7_0x5867b1(0x114)]='auth';['description']=a7_0x5867b1(0x128);async[a7_0x5867b1(0x168)](_0x256ac2){const _0x564bd4=a7_0x5867b1,{options:_0x37dad1,tdx:_0x56e24c}=_0x256ac2,_0xcd2e72=_0x37dad1['site'],_0x3a5e4e=_0x37dad1[_0x564bd4(0x13b)],_0x272ae5=_0x3a5e4e?_0x3a5e4e:_0x564bd4(0x156);console[_0x564bd4(0x15d)](_0x564bd4(0x149)+_0x272ae5+_0x564bd4(0x140)+_0xcd2e72+')');const _0x3be03e=await getOAuthTokens(_0x3a5e4e);if(_0x3be03e)console[_0x564bd4(0x15d)](_0x564bd4(0x169)),console[_0x564bd4(0x15d)]('Read\x20credential\x20from\x20keychain'+(_0x3a5e4e?_0x564bd4(0x157)+_0x3a5e4e+')':''));else{const _0x3e0827=await resolveAPIKeyAsync(_0xcd2e72,_0x3a5e4e);if(_0x3e0827){const {source:_0x1af979,isDeprecated:_0x15ecb3}=_0x3e0827,_0x7af364=_0x564bd4(0x163)+_0x1af979;console['log'](_0x15ecb3?a7_0x2aad28[_0x564bd4(0x127)](_0x7af364):_0x7af364);}else console[_0x564bd4(0x15d)](a7_0x2aad28[_0x564bd4(0x127)](_0x564bd4(0x162)));}try{const _0x90cbba=await _0x56e24c[_0x564bd4(0x146)][_0x564bd4(0x15b)]();return console[_0x564bd4(0x15d)](a7_0x2aad28[_0x564bd4(0x13c)]('✓\x20Authentication\x20successful\x0a')),console[_0x564bd4(0x15d)](_0x564bd4(0x122)+_0x90cbba[_0x564bd4(0x110)]),(_0x90cbba['first_name']||_0x90cbba[_0x564bd4(0x11e)])&&console[_0x564bd4(0x15d)](_0x564bd4(0x14a)+[_0x90cbba[_0x564bd4(0x113)],_0x90cbba[_0x564bd4(0x11e)]][_0x564bd4(0x147)](Boolean)[_0x564bd4(0x139)]('\x20')),0x0;}catch(_0x2cbce3){return _0x2cbce3 instanceof HTTPClientError&&_0x2cbce3[_0x564bd4(0x11f)]===0x191?printAuthError(_0x2cbce3,!![],_0x3a5e4e):console[_0x564bd4(0x164)](a7_0x2aad28['red'](_0x564bd4(0x150)+(_0x2cbce3 instanceof Error?_0x2cbce3[_0x564bd4(0x14f)]:String(_0x2cbce3)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x5867b1(0x114)]=a7_0x5867b1(0x131);[a7_0x5867b1(0x116)]=a7_0x5867b1(0x13e);async[a7_0x5867b1(0x168)](_0x163a2f){const _0x1ec269=a7_0x5867b1,{options:_0x402385}=_0x163a2f,_0x4ac4f6=_0x402385['profile'];console[_0x1ec269(0x15d)](a7_0x2aad28[_0x1ec269(0x11b)](_0x1ec269(0x148)));const _0x1e0918=await isKeychainAvailable();if(!_0x1e0918)return console[_0x1ec269(0x164)](a7_0x2aad28[_0x1ec269(0x118)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x5f8a45,_0x4ccd37]=await Promise[_0x1ec269(0x12f)]([deleteKeychainAPIKey(_0x4ac4f6),deleteOAuthTokens(_0x4ac4f6)]);if(_0x5f8a45||_0x4ccd37){clearCredentialCache();const _0x21400a=[_0x5f8a45&&_0x1ec269(0x155),_0x4ccd37&&_0x1ec269(0x14c)]['filter'](Boolean)[_0x1ec269(0x139)](_0x1ec269(0x129));return console[_0x1ec269(0x15d)]('✓\x20'+_0x21400a+'\x20removed\x20from\x20keychain'+(_0x4ac4f6?'\x20(profile:\x20'+_0x4ac4f6+')':'')),0x0;}else return console[_0x1ec269(0x15d)](_0x1ec269(0x16e)+(_0x4ac4f6?_0x1ec269(0x11a)+_0x4ac4f6:'')),0x1;}}
|