@treasuredata/tdx 2026.8.1 → 2026.8.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.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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-move-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.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.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/auth-token.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/types.d.ts +2 -0
- package/dist/sdk/cas/types.d.ts.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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/always-on-campaign-schema.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/cas.d.ts +4 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/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/claude-code-state.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/proxy-fetch.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_0x11e068=a3_0x2b69;(function(_0xd16b0d,_0x34f7c2){const _0x47ace5=a3_0x2b69,_0xfbbaae=_0xd16b0d();while(!![]){try{const _0x18012e=parseInt(_0x47ace5(0x71))/0x1+parseInt(_0x47ace5(0x78))/0x2+-parseInt(_0x47ace5(0x72))/0x3+parseInt(_0x47ace5(0x85))/0x4*(parseInt(_0x47ace5(0x6e))/0x5)+-parseInt(_0x47ace5(0x75))/0x6*(parseInt(_0x47ace5(0x7e))/0x7)+-parseInt(_0x47ace5(0x67))/0x8+parseInt(_0x47ace5(0x7a))/0x9;if(_0x18012e===_0x34f7c2)break;else _0xfbbaae['push'](_0xfbbaae['shift']());}catch(_0x15c854){_0xfbbaae['push'](_0xfbbaae['shift']());}}}(a3_0x2810,0x944a2));function a3_0x2b69(_0x4b36b9,_0x134428){_0x4b36b9=_0x4b36b9-0x67;const _0x2810d3=a3_0x2810();let _0x2b69df=_0x2810d3[_0x4b36b9];return _0x2b69df;}import{BaseCommand}from'./command.js';function a3_0x2810(){const _0x42c029=['cause','Error:\x20','error','Resolving\x20child\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','length','1630wAKmtF','Resolving\x20parent\x20segment\x20\x27','resolveSegmentId','1061320hufPVR','2319267CCeANw','verbose','activations','21738MCEMwt','List\x20activations\x20for\x20a\x20segment','site','2165860xEwzdp','resolveParentId','5095476dzJCsn','\x27...','description','Child\x20name:\x20','1757RwwoLB','\x20activation','Site:\x20','segment','execute','Parent\x20name:\x20','listActivations','9008XzMXGs','\x20\x20Cause:\x20','Resolved\x20parent\x20ID:\x20','message','data','Error:\x20Segment\x20name\x20is\x20required','9237680yRrNOw'];a3_0x2810=function(){return _0x42c029;};return a3_0x2810();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x11e068(0x74);[a3_0x11e068(0x7c)]=a3_0x11e068(0x76);async[a3_0x11e068(0x82)](_0x9c1c61){const _0x4603ac=a3_0x11e068,{options:_0x5db56c,args:_0x2e6710,tdx:_0x34c619}=_0x9c1c61;if(_0x2e6710['length']===0x0)return console['error'](_0x4603ac(0x8a)),console[_0x4603ac(0x6a)](_0x4603ac(0x6c)),0x1;try{const {parentId:_0x15783e,childId:_0x415962}=parseSegmentRef(_0x2e6710[0x0]);if(!_0x415962)return console[_0x4603ac(0x6a)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x4603ac(0x6a)](_0x4603ac(0x6c)),0x1;_0x5db56c[_0x4603ac(0x73)]&&(console[_0x4603ac(0x6a)](_0x4603ac(0x80)+_0x5db56c[_0x4603ac(0x77)]),console[_0x4603ac(0x6a)](_0x4603ac(0x83)+_0x15783e),console['error'](_0x4603ac(0x7d)+_0x415962));const _0x4db79b=await withSpinner(_0x4603ac(0x6f)+_0x15783e+'\x27...',()=>_0x34c619[_0x4603ac(0x81)][_0x4603ac(0x79)](_0x15783e),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x579b47=_0x4db79b[_0x4603ac(0x89)];_0x5db56c['verbose']&&console['error'](_0x4603ac(0x87)+_0x579b47);const _0xc91125=await withSpinner(_0x4603ac(0x6b)+_0x415962+_0x4603ac(0x7b),()=>_0x34c619['segment'][_0x4603ac(0x70)](_0x579b47,_0x415962),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x345d7b=_0xc91125[_0x4603ac(0x89)];_0x5db56c['verbose']&&console[_0x4603ac(0x6a)]('Resolved\x20child\x20ID:\x20'+_0x345d7b);const _0x4da30c=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x415962+'\x27...',()=>_0x34c619[_0x4603ac(0x81)][_0x4603ac(0x84)](_0x579b47,_0x345d7b),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x22b8c9=_0x4da30c[_0x4603ac(0x89)];return console[_0x4603ac(0x6a)]('✔\x20Found\x20'+_0x22b8c9[_0x4603ac(0x6d)]+_0x4603ac(0x7f)+(_0x22b8c9[_0x4603ac(0x6d)]!==0x1?'s':'')),await handleSDKOutput(_0x22b8c9,_0x5db56c),0x0;}catch(_0x30c70e){if(_0x30c70e instanceof SDKError)return console['error'](_0x4603ac(0x69)+_0x30c70e[_0x4603ac(0x88)]),_0x30c70e[_0x4603ac(0x68)]&&console['error'](_0x4603ac(0x86)+_0x30c70e[_0x4603ac(0x68)]),0x1;throw _0x30c70e;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x290369=a4_0x2261;(function(_0x116d4a,_0x288ffb){const _0xf49e27=a4_0x2261,_0x384cdc=_0x116d4a();while(!![]){try{const _0x5733b8=-parseInt(_0xf49e27(0x1fb))/0x1*(-parseInt(_0xf49e27(0x16a))/0x2)+-parseInt(_0xf49e27(0x1cb))/0x3+-parseInt(_0xf49e27(0x171))/0x4*(-parseInt(_0xf49e27(0x161))/0x5)+-parseInt(_0xf49e27(0x1f2))/0x6+parseInt(_0xf49e27(0x1ad))/0x7*(parseInt(_0xf49e27(0x1d3))/0x8)+-parseInt(_0xf49e27(0x1bc))/0x9+parseInt(_0xf49e27(0x199))/0xa*(parseInt(_0xf49e27(0x1fa))/0xb);if(_0x5733b8===_0x288ffb)break;else _0x384cdc['push'](_0x384cdc['shift']());}catch(_0x3becbd){_0x384cdc['push'](_0x384cdc['shift']());}}}(a4_0x3cb7,0x93adf));import a4_0xd2a568 from'chalk';import a4_0x3abeb3 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x3cb7(){const _0x3aedf7=['6868971vSdwcZ','\x20errors','Analyzing\x20project\x20\x22','site','\x0aPush\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','no_local_folder','llmProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','cyan','tdx.json','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Status:\x20','error','Errors:','1472751OURmoZ','\x20successfully','Using\x20project\x20from\x20context:\x20','\x22...','\x22\x20to\x20new\x20project\x20\x22','-\x20no\x20files\x20written','projectId','\x20--profile\x20','2813208tLPciQ','Source:\x20','force','\x20\x20Source:\x20','\x0aChanges\x20to\x20integration\x20\x27','sourceProjectName','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','new','agentName','Cancelled','Failed\x20to\x20push\x20agent:\x20','llm_project','experimentalArtifacts','execute','\x0aErrors\x20found:','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','prompts','\x20--name\x20','green','diff','\x0aError:','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Target:\x20','✔\x20Context\x20set:\x20','Using\x20project:\x20','integrations','agent.yml','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)','Using\x20local\x20project:\x20','Analyzing\x20changes\x20to\x20push...','pullAgent','5410632TffbYE','repeat','dirname','Agent\x20pulled\x20successfully','\x0aProject\x20pushed\x20with\x20errors','No\x20tdx.json\x20found\x20in\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Pulling\x20agent\x20\x22','6551721QfgUbB','287268cMNDjk','agents','New\x20project:\x20','Agent:\x20','\x22\x20to\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','red','agent:pull','cwd','\x20\x20Form\x20Interface\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','chatInterfaces','projectName','llm','counts','Pushing\x20agent\x20from\x20\x22','Using\x20context\x20project:\x20','Agent\x20','\x20total','join','\x22\x20to\x20a\x20different\x20profile','updated','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Chat\x20Interfaces:\x20','\x22:\x20','projectDir','experimentalKnowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Integrations:\x20','New\x20project\x20name\x20is\x20required','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','1675255ZYnCZD','Chat:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\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','created','dim','log','\x20\x20Prompt\x20\x22','reason','2tGLaIR','\x20\x20Prompts:\x20','action','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Would\x20clone:','knowledgeBases','\x20\x20Chat\x20Interface\x20\x22','4xstdiz','\x20\x20Knowledge\x20Base\x20\x22','\x20|\x20','newProjectId','Using\x20project\x20from\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','total','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Bases:\x20','yes','<new-name>','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agentId','\x20unchanged','\x20files\x20to\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','output','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20created','\x0aChanges\x20to\x20agent\x20\x27','textKnowledgeBases','Cannot\x20clone\x20from\x20context\x20project\x20\x22','-\x20nothing\x20pushed','dryRun','\x20=\x20','\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)','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','parse','Would\x20pull\x20agent:\x20','\x20\x20Integration\x20\x22','outputPath','\x20\x20Experimental\x20Artifact\x20\x22','Pushing\x20to\x20project...','pushProject','Would\x20push\x20agent:\x20','\x20new','30oKMDrM','pushAgent','cwd-config','errors','\x0aChanges\x20to\x20prompt\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Form\x20Interfaces:\x20','\x20\x20Experimental\x20Artifacts:\x20','context','push','Dry\x20run\x20-\x20no\x20files\x20written','\x20changed','INVALID_ARGUMENT','\x0aPull\x20summary\x20for\x20\x27','\x27\x20to\x20create\x20the\x20folder\x20structure.','formInterfaces','\x20\x20Agents:\x20','Project:\x20','Writing\x20files...','pullProject','7lIkXLU','Project\x20cloned\x20with\x20errors','\x20\x20Knowledge\x20Bases:\x20','found','no_context','\x0a✔\x20Pulled\x20','Using\x20current\x20project:\x20','yellow','description','agent','unchanged','\x20\x20Agent\x20\x22','arg-dir','name','profile'];a4_0x3cb7=function(){return _0x3aedf7;};return a4_0x3cb7();}function a4_0x2261(_0x29eeb0,_0x3b1e31){_0x29eeb0=_0x29eeb0-0x15a;const _0x3cb70f=a4_0x3cb7();let _0x2261f0=_0x3cb70f[_0x29eeb0];return _0x2261f0;}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(_0x34e12c){const _0x2729da=a4_0x2261,_0x7b691d=[];if(_0x34e12c[_0x2729da(0x177)]!==undefined)_0x7b691d['push'](_0x34e12c['total']+_0x2729da(0x20d));if(_0x34e12c['new']!==undefined&&_0x34e12c[_0x2729da(0x1da)]>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568[_0x2729da(0x1e5)](_0x34e12c[_0x2729da(0x1da)]+_0x2729da(0x198)));if(_0x34e12c[_0x2729da(0x165)]!==undefined&&_0x34e12c[_0x2729da(0x165)]>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568[_0x2729da(0x1e5)](_0x34e12c[_0x2729da(0x165)]+_0x2729da(0x185)));if(_0x34e12c[_0x2729da(0x210)]!==undefined&&_0x34e12c[_0x2729da(0x210)]>0x0)_0x7b691d['push'](a4_0xd2a568['yellow'](_0x34e12c['updated']+'\x20updated'));if(_0x34e12c[_0x2729da(0x1b7)]!==undefined&&_0x34e12c[_0x2729da(0x1b7)]>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568['gray'](_0x34e12c[_0x2729da(0x1b7)]+_0x2729da(0x17e)));if(_0x34e12c[_0x2729da(0x19c)]!==undefined&&_0x34e12c['errors']>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568['red'](_0x34e12c[_0x2729da(0x19c)]+_0x2729da(0x1bd)));return _0x7b691d['join'](',\x20');}function displayDiffs(_0x46c092,_0x53afb9,_0x1004c3,_0x50dbfd,_0xee59c3,_0x57ec11,_0x2bb6cc,_0x5000c2,_0x514238){const _0x103f17=a4_0x2261;for(const _0x5b3901 of _0x46c092){if(_0x5b3901[_0x103f17(0x1e6)]){const _0x5c9b34=_0x5b3901[_0x103f17(0x1db)]||_0x5b3901[_0x103f17(0x1ba)];console[_0x103f17(0x167)](_0x103f17(0x186)+_0x5c9b34+'\x27:'),console[_0x103f17(0x167)]('─'['repeat'](0x3c)),console[_0x103f17(0x167)](_0x5b3901[_0x103f17(0x1e6)]),console['log']('─'[_0x103f17(0x1f3)](0x3c));}}for(const _0x205cbe of _0x53afb9){_0x205cbe['diff']&&(console[_0x103f17(0x167)](_0x103f17(0x1f8)+_0x205cbe['name']+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x205cbe[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0xc147ff of _0x1004c3){_0xc147ff['diff']&&(console[_0x103f17(0x167)](_0x103f17(0x1d9)+_0xc147ff[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'['repeat'](0x3c)),console[_0x103f17(0x167)](_0xc147ff[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0x499375 of _0x50dbfd){_0x499375[_0x103f17(0x1e6)]&&(console[_0x103f17(0x167)](_0x103f17(0x19d)+_0x499375[_0x103f17(0x1ba)]+'\x27:'),console['log']('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x499375['diff']),console[_0x103f17(0x167)]('─'['repeat'](0x3c)));}for(const _0x27efe7 of _0xee59c3){_0x27efe7[_0x103f17(0x1e6)]&&(console[_0x103f17(0x167)](_0x103f17(0x1d7)+_0x27efe7['name']+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x27efe7[_0x103f17(0x1e6)]),console['log']('─'['repeat'](0x3c)));}for(const _0x19f257 of _0x57ec11){_0x19f257[_0x103f17(0x1e6)]&&(console['log'](_0x103f17(0x1e8)+_0x19f257[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'['repeat'](0x3c)),console[_0x103f17(0x167)](_0x19f257[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'['repeat'](0x3c)));}for(const _0x51e5c4 of _0x2bb6cc){_0x51e5c4[_0x103f17(0x1e6)]&&(console[_0x103f17(0x167)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x51e5c4[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console['log'](_0x51e5c4['diff']),console['log']('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0x1070bd of _0x5000c2){_0x1070bd['diff']&&(console[_0x103f17(0x167)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x1070bd['name']+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x1070bd[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0x538766 of _0x514238){_0x538766['diff']&&(console[_0x103f17(0x167)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x538766[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x538766[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x290369(0x202);[a4_0x290369(0x1b5)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x52908b){const _0x219d1c=a4_0x290369,{options:_0x113e71,args:_0x28aed9,tdx:_0x37e5f3}=_0x52908b,_0x513a90=_0x28aed9[0x0],_0x2c515b=_0x28aed9[0x1],_0x5b73ad=_0x113e71[_0x219d1c(0x183)],_0x3e797f=_0x113e71[_0x219d1c(0x18a)],_0xbf7753=_0x113e71[_0x219d1c(0x1d5)],_0x402bab=_0x113e71[_0x219d1c(0x17a)],_0x368f66=_0x113e71[_0x219d1c(0x1c3)],_0x271c69=_0x113e71[_0x219d1c(0x1b6)];let _0xd76d62;if(_0x513a90){const _0x3de1e0=a4_0x3abeb3['join'](_0x513a90,_0x219d1c(0x1c6));if(existsSync(_0x3de1e0))try{const _0x4edd9d=JSON['parse'](readFileSync(_0x3de1e0,'utf-8'));_0x4edd9d[_0x219d1c(0x1de)]&&(_0xd76d62={'llm_project':_0x4edd9d['llm_project']});}catch{}}const _0x1028fb=findAgentConfigPath(process[_0x219d1c(0x203)]());let _0x44708e;if(_0x1028fb)try{const _0x1664e7=JSON[_0x219d1c(0x190)](readFileSync(_0x1028fb,'utf-8'));_0x1664e7[_0x219d1c(0x1de)]&&(_0x44708e={'llm_project':_0x1664e7[_0x219d1c(0x1de)]});}catch{}const _0x14204c=resolveAgentPullArgs({'arg':_0x513a90,'agentNameArg':_0x2c515b,'agentFlag':_0x271c69,'contextProject':_0x368f66,'argDirConfig':_0xd76d62,'cwdConfigPath':_0x1028fb||undefined,'cwdConfig':_0x44708e}),{projectNameOrId:_0x2ba416,targetAgentName:_0x448c54,existingOutputDir:_0x43709c,source:_0x48c244}=_0x14204c;if(_0x48c244===_0x219d1c(0x1b9))console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x175)+a4_0x3abeb3[_0x219d1c(0x20e)](_0x513a90,_0x219d1c(0x1c6))+':\x20'+_0x2ba416));else{if(_0x48c244===_0x219d1c(0x19b))console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x166)]('Using\x20project:\x20'+_0x2ba416));else _0x48c244===_0x219d1c(0x1a1)&&console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x1cd)+_0x2ba416));}if(!_0x2ba416)return _0x271c69?(console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x18d))),console[_0x219d1c(0x167)](_0x219d1c(0x16d)),console[_0x219d1c(0x167)](_0x219d1c(0x211))):(console['log'](a4_0xd2a568['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x219d1c(0x167)](_0x219d1c(0x1ee)),console[_0x219d1c(0x167)]('\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[_0x219d1c(0x167)](_0x219d1c(0x182)),console[_0x219d1c(0x167)](_0x219d1c(0x164)),console[_0x219d1c(0x167)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x448c54){const {data:_0x358102}=await withSpinner(_0x219d1c(0x1f9)+_0x448c54+'\x22\x20from\x20project\x20\x22'+_0x2ba416+_0x219d1c(0x1ce),()=>_0x37e5f3[_0x219d1c(0x208)][_0x219d1c(0x1f1)](_0x2ba416,_0x448c54,_0x5b73ad,{'dryRun':_0x3e797f,'force':_0xbf7753}));if(_0x3e797f)return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x1a3))),console[_0x219d1c(0x167)](_0x219d1c(0x191)+_0x358102['agentName']),console[_0x219d1c(0x167)]('Output\x20path:\x20'+_0x358102[_0x219d1c(0x193)]),_0x358102['diff']&&(console[_0x219d1c(0x167)]('\x0aChanges:'),console['log']('─'[_0x219d1c(0x1f3)](0x3c)),console[_0x219d1c(0x167)](_0x358102[_0x219d1c(0x1e6)]),console[_0x219d1c(0x167)]('─'[_0x219d1c(0x1f3)](0x3c))),0x0;return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)](_0x219d1c(0x1f5))),console[_0x219d1c(0x167)]('Agent:\x20'+_0x358102[_0x219d1c(0x1db)]),console['log']('Output:\x20'+_0x358102['outputPath']),console[_0x219d1c(0x167)](_0x219d1c(0x1c8)+(_0x358102['isNew']?a4_0xd2a568['green'](_0x219d1c(0x1da)):_0x358102['hasChanges']?a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x210)):a4_0xd2a568['gray'](_0x219d1c(0x1b7)))),0x0;}const _0x48d009=_0x43709c||_0x5b73ad,{data:_0xfa3e19}=await withSpinner(_0x219d1c(0x1be)+_0x2ba416+_0x219d1c(0x1ce),()=>_0x37e5f3[_0x219d1c(0x208)][_0x219d1c(0x1ac)](_0x2ba416,_0x48d009,{'dryRun':!![]})),_0x46efd2=_0xfa3e19[_0x219d1c(0x209)]['agents']['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)]['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x187)][_0x219d1c(0x1da)]+_0xfa3e19['counts'][_0x219d1c(0x1e3)]['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1ec)][_0x219d1c(0x1da)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)]['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)][_0x219d1c(0x1da)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1a8)][_0x219d1c(0x1da)]+_0xfa3e19[_0x219d1c(0x209)]['chatInterfaces'][_0x219d1c(0x1da)],_0x2e6d1a=_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1fc)][_0x219d1c(0x210)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)]['updated']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x187)]['updated']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1e3)][_0x219d1c(0x210)]+_0xfa3e19['counts'][_0x219d1c(0x1ec)][_0x219d1c(0x210)]+_0xfa3e19['counts'][_0x219d1c(0x15c)][_0x219d1c(0x210)]+_0xfa3e19[_0x219d1c(0x209)]['experimentalArtifacts']['updated']+_0xfa3e19['counts'][_0x219d1c(0x1a8)][_0x219d1c(0x210)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x206)]['updated'],_0x1fa94d=_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1fc)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x187)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1e3)]['unchanged']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1ec)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)]['unchanged']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)][_0x219d1c(0x1b7)]+_0xfa3e19['counts'][_0x219d1c(0x1a8)][_0x219d1c(0x1b7)]+_0xfa3e19['counts'][_0x219d1c(0x206)][_0x219d1c(0x1b7)];console['log'](_0x219d1c(0x1a6)+_0xfa3e19[_0x219d1c(0x207)]+'\x27:'),console[_0x219d1c(0x167)]('\x20\x20'+a4_0xd2a568['green']('+\x20'+_0x46efd2+'\x20new')+_0x219d1c(0x173)+a4_0xd2a568['yellow']('~\x20'+_0x2e6d1a+_0x219d1c(0x1a4))+_0x219d1c(0x173)+a4_0xd2a568[_0x219d1c(0x166)]('=\x20'+_0x1fa94d+'\x20unchanged')),console[_0x219d1c(0x167)](_0x219d1c(0x1a9)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x1fc)])),console[_0x219d1c(0x167)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)])),console[_0x219d1c(0x167)](_0x219d1c(0x179)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x187)])),console[_0x219d1c(0x167)](_0x219d1c(0x16b)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x1e3)])),console[_0x219d1c(0x167)](_0x219d1c(0x15e)+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1ec)])),console[_0x219d1c(0x167)](_0x219d1c(0x19f)+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1a8)])),console[_0x219d1c(0x167)](_0x219d1c(0x212)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x206)]));const _0x364c63=_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)]['total']>0x0||_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)][_0x219d1c(0x177)]>0x0;_0x364c63&&(console[_0x219d1c(0x167)](_0x219d1c(0x163)+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)])),console[_0x219d1c(0x167)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)])));console[_0x219d1c(0x167)](_0x219d1c(0x1e9)+a4_0xd2a568[_0x219d1c(0x1c5)](_0xfa3e19['outputDir'])),displayDiffs(_0xfa3e19[_0x219d1c(0x1fc)],_0xfa3e19['knowledgeBases'],_0xfa3e19['textKnowledgeBases'],_0xfa3e19['prompts'],_0xfa3e19[_0x219d1c(0x1ec)],_0xfa3e19[_0x219d1c(0x15c)],_0xfa3e19['experimentalArtifacts'],_0xfa3e19[_0x219d1c(0x1a8)],_0xfa3e19[_0x219d1c(0x206)]);if(_0x3e797f)return console['log'](a4_0xd2a568[_0x219d1c(0x1b4)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x46efd2===0x0&&_0x2e6d1a===0x0)return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0xfa3e19[_0x219d1c(0x207)]},_0x113e71['session']),console[_0x219d1c(0x167)](a4_0xd2a568['green'](_0x219d1c(0x1ea)+a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x1de))+_0x219d1c(0x18b)+a4_0xd2a568[_0x219d1c(0x1c5)](_0xfa3e19['projectName']))),0x0;if(!_0x402bab&&!_0xbf7753){if(!isInteractive())return console[_0x219d1c(0x1c9)](a4_0xd2a568[_0x219d1c(0x201)](_0x219d1c(0x1e7)),_0x219d1c(0x181)),console['error'](a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x200))),0x1;const _0x150946=await confirmKey('\x0aWrite\x20'+(_0x46efd2+_0x2e6d1a)+'\x20files?');if(!_0x150946)return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x1dc)),_0x219d1c(0x1d0)),0x1;}const {data:_0x54d67e}=await withSpinner(_0x219d1c(0x1ab),()=>_0x37e5f3[_0x219d1c(0x208)]['pullProject'](_0x2ba416,_0x48d009,{'force':_0xbf7753}));return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)](_0x219d1c(0x1b2)+(_0x46efd2+_0x2e6d1a)+_0x219d1c(0x17f)+_0x54d67e['outputDir'])),saveSessionContext({'llm_project':_0x54d67e[_0x219d1c(0x207)]},_0x113e71['session']),console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)]('✔\x20Context\x20set:\x20'+a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x1de))+'\x20=\x20'+a4_0xd2a568[_0x219d1c(0x1c5)](_0x54d67e[_0x219d1c(0x207)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x290369(0x1b5)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x290369(0x1e0)](_0x5613a7){const _0x53810a=a4_0x290369,{options:_0x152ece,args:_0xd67464,tdx:_0x1d70cc}=_0x5613a7,_0x1b33b5=_0xd67464[0x0],_0x2f6ac3=_0x152ece[_0x53810a(0x1ba)],_0x1e3323=_0x152ece['dryRun'],_0x248b2c=_0x152ece[_0x53810a(0x17a)],_0x192b7f=_0x152ece[_0x53810a(0x1bf)],_0x2fa2f3=_0x152ece[_0x53810a(0x1c3)];let _0x6fdbc4;const _0x2a8ec2=findAgentConfigPath(process[_0x53810a(0x203)]());if(_0x1b33b5){const _0x5819c2=a4_0x3abeb3['join'](_0x1b33b5,'tdx.json');existsSync(_0x5819c2)?(_0x6fdbc4=_0x1b33b5,console[_0x53810a(0x167)](a4_0xd2a568['dim'](_0x53810a(0x1ef)+_0x1b33b5))):_0x6fdbc4=_0x1b33b5;}else{if(_0x2a8ec2)_0x6fdbc4=a4_0x3abeb3[_0x53810a(0x1f4)](_0x2a8ec2),console['log'](a4_0xd2a568['dim'](_0x53810a(0x1b3)+_0x6fdbc4));else{if(_0x2fa2f3){const _0x599484=sanitizeForFilesystem(_0x2fa2f3);let _0x3390ee=_0x599484,_0x1bbf74=a4_0x3abeb3[_0x53810a(0x20e)](process[_0x53810a(0x203)](),_0x53810a(0x1fc),_0x599484,_0x53810a(0x1c6));if(!existsSync(_0x1bbf74)){const _0x144046=normalizeName(_0x2fa2f3),_0x39444a=a4_0x3abeb3[_0x53810a(0x20e)](process['cwd'](),_0x53810a(0x1fc),_0x144046,'tdx.json');existsSync(_0x39444a)&&(_0x3390ee=_0x144046,_0x1bbf74=_0x39444a);}if(existsSync(_0x1bbf74))_0x6fdbc4=a4_0x3abeb3[_0x53810a(0x1f4)](_0x1bbf74),console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x166)]('Using\x20local\x20project:\x20'+_0x6fdbc4));else{const _0x3c33b2=_0x152ece[_0x53810a(0x1bb)];if(_0x3c33b2)throw new SDKError(ErrorCode[_0x53810a(0x1a5)],_0x53810a(0x188)+_0x2fa2f3+_0x53810a(0x20f),undefined,{'helpText':_0x53810a(0x1c7)+_0x53810a(0x180)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x2fa2f3+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3390ee+_0x53810a(0x1e4)+(_0x2f6ac3||_0x53810a(0x17b))+_0x53810a(0x1d2)+_0x3c33b2)});_0x6fdbc4=_0x2fa2f3,console['log'](a4_0xd2a568[_0x53810a(0x166)](_0x53810a(0x20b)+_0x2fa2f3));}}}}if(!_0x6fdbc4)return console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x1b4)](_0x53810a(0x160))),console[_0x53810a(0x167)](_0x53810a(0x18f)),console[_0x53810a(0x167)](_0x53810a(0x184)),console[_0x53810a(0x167)](_0x53810a(0x18c)),console[_0x53810a(0x167)](_0x53810a(0x19e)),0x1;if(!_0x2f6ac3)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x53810a(0x15f),undefined,{'helpText':_0x53810a(0x205)});if(!_0x248b2c&&!_0x1e3323){if(!isInteractive())return console['error'](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x1e7)),_0x53810a(0x181)),console[_0x53810a(0x1c9)](a4_0xd2a568['dim'](_0x53810a(0x200))),0x1;const _0x3ddfc3=await confirmKey('Clone\x20\x22'+_0x6fdbc4+_0x53810a(0x1cf)+_0x2f6ac3+'\x22?');if(!_0x3ddfc3)return console['log'](a4_0xd2a568[_0x53810a(0x1b4)](_0x53810a(0x1dc))),0x1;}const {data:_0x33935e}=await withSpinner('Cloning\x20\x22'+_0x6fdbc4+_0x53810a(0x1ff)+_0x2f6ac3+_0x53810a(0x1ce),()=>_0x1d70cc[_0x53810a(0x208)]['cloneProject'](_0x6fdbc4,_0x2f6ac3,{'dryRun':_0x1e3323}));if(_0x1e3323){console[_0x53810a(0x167)](a4_0xd2a568['yellow'](_0x53810a(0x15d))),console[_0x53810a(0x167)](_0x53810a(0x1d4)+_0x33935e['sourceProjectName']),console[_0x53810a(0x167)]('New\x20project:\x20'+_0x2f6ac3),console[_0x53810a(0x167)](_0x53810a(0x16e)),console[_0x53810a(0x167)](_0x53810a(0x1a9)+_0x33935e[_0x53810a(0x209)]['agents'][_0x53810a(0x165)]),console[_0x53810a(0x167)](_0x53810a(0x1af)+_0x33935e[_0x53810a(0x209)]['knowledgeBases']['created']),console['log'](_0x53810a(0x16b)+_0x33935e[_0x53810a(0x209)]['prompts'][_0x53810a(0x165)]),console[_0x53810a(0x167)]('\x20\x20Form\x20Interfaces:\x20'+_0x33935e[_0x53810a(0x209)][_0x53810a(0x1a8)][_0x53810a(0x165)]),console[_0x53810a(0x167)]('\x20\x20Chat\x20Interfaces:\x20'+_0x33935e[_0x53810a(0x209)][_0x53810a(0x206)][_0x53810a(0x165)]);const _0x1a0e68=_0x33935e['counts'][_0x53810a(0x15c)][_0x53810a(0x165)]>0x0||_0x33935e[_0x53810a(0x209)]['experimentalArtifacts']['created']>0x0;return _0x1a0e68&&(console['log'](_0x53810a(0x163)+_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)]['created']),console['log'](_0x53810a(0x1a0)+_0x33935e[_0x53810a(0x209)]['experimentalArtifacts'][_0x53810a(0x165)])),0x0;}const _0x233e58=_0x33935e['counts'][_0x53810a(0x1fc)][_0x53810a(0x19c)]>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x16f)][_0x53810a(0x19c)]>0x0||_0x33935e['counts'][_0x53810a(0x1e3)]['errors']>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x1a8)]['errors']>0x0||_0x33935e['counts'][_0x53810a(0x206)]['errors']>0x0||_0x33935e['counts'][_0x53810a(0x15c)][_0x53810a(0x19c)]>0x0||_0x33935e[_0x53810a(0x209)]['experimentalArtifacts'][_0x53810a(0x19c)]>0x0;_0x233e58?console[_0x53810a(0x167)](a4_0xd2a568['yellow'](_0x53810a(0x1ae))):console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x1e5)](_0x53810a(0x178)));console[_0x53810a(0x167)](_0x53810a(0x1d4)+_0x33935e[_0x53810a(0x1d8)]),console[_0x53810a(0x167)](_0x53810a(0x1fd)+_0x33935e['newProjectName']),console['log']('New\x20project\x20ID:\x20'+_0x33935e[_0x53810a(0x174)]),console[_0x53810a(0x167)](),console[_0x53810a(0x167)]('Summary:'),console[_0x53810a(0x167)](_0x53810a(0x1a9)+formatCountSummary(_0x33935e[_0x53810a(0x209)][_0x53810a(0x1fc)])),console[_0x53810a(0x167)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x33935e[_0x53810a(0x209)]['knowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x33935e['counts'][_0x53810a(0x1e3)])),console[_0x53810a(0x167)](_0x53810a(0x15e)+formatCountSummary(_0x33935e[_0x53810a(0x209)]['integrations'])),console['log'](_0x53810a(0x19f)+formatCountSummary(_0x33935e[_0x53810a(0x209)][_0x53810a(0x1a8)])),console['log'](_0x53810a(0x212)+formatCountSummary(_0x33935e[_0x53810a(0x209)][_0x53810a(0x206)]));const _0x581eb1=_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)][_0x53810a(0x165)]>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)]['updated']>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)][_0x53810a(0x1b7)]>0x0||_0x33935e['counts']['experimentalArtifacts'][_0x53810a(0x165)]>0x0||_0x33935e['counts']['experimentalArtifacts']['updated']>0x0||_0x33935e['counts'][_0x53810a(0x1df)][_0x53810a(0x1b7)]>0x0;_0x581eb1&&(console['log'](_0x53810a(0x163)+formatCountSummary(_0x33935e['counts']['experimentalKnowledgeBases'])),console[_0x53810a(0x167)](_0x53810a(0x1a0)+formatCountSummary(_0x33935e[_0x53810a(0x209)]['experimentalArtifacts'])));if(_0x233e58){console[_0x53810a(0x167)](),console['log'](a4_0xd2a568['red'](_0x53810a(0x1ca)));for(const _0xf017dd of _0x33935e['agents']){_0xf017dd['action']===_0x53810a(0x1c9)&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x1b8)+_0xf017dd[_0x53810a(0x1db)]+_0x53810a(0x15a)+_0xf017dd['error']));}for(const _0x54cf66 of _0x33935e[_0x53810a(0x16f)]){_0x54cf66[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console['log'](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x172)+_0x54cf66[_0x53810a(0x1ba)]+'\x22:\x20'+_0x54cf66[_0x53810a(0x1c9)]));}for(const _0x553018 of _0x33935e['prompts']){_0x553018['action']==='error'&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x168)+_0x553018[_0x53810a(0x1ba)]+'\x22:\x20'+_0x553018[_0x53810a(0x1c9)]));}for(const _0x3d097d of _0x33935e[_0x53810a(0x1ec)]){_0x3d097d[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)]('\x20\x20Integration\x20\x22'+_0x3d097d[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0x3d097d[_0x53810a(0x1c9)]));}for(const _0x5e5d72 of _0x33935e['formInterfaces']){_0x5e5d72[_0x53810a(0x16c)]==='error'&&console[_0x53810a(0x167)](a4_0xd2a568['red'](_0x53810a(0x204)+_0x5e5d72[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0x5e5d72['error']));}for(const _0x292381 of _0x33935e[_0x53810a(0x206)]){_0x292381[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x170)+_0x292381[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0x292381['error']));}for(const _0xa2ce5c of _0x33935e[_0x53810a(0x15c)]){_0xa2ce5c[_0x53810a(0x16c)]==='error'&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x17c)+_0xa2ce5c[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0xa2ce5c[_0x53810a(0x1c9)]));}for(const _0x665ea0 of _0x33935e[_0x53810a(0x1df)]){_0x665ea0[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console['log'](a4_0xd2a568['red'](_0x53810a(0x194)+_0x665ea0[_0x53810a(0x1ba)]+'\x22:\x20'+_0x665ea0[_0x53810a(0x1c9)]));}return 0x1;}console[_0x53810a(0x167)]();const _0x1bffea=getLLMProjectUrl(_0x192b7f,_0x33935e['newProjectId']);return console[_0x53810a(0x167)]('Project:\x20'+a4_0xd2a568[_0x53810a(0x1c5)](_0x1bffea)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x290369(0x1b5)]=a4_0x290369(0x1e2);async['execute'](_0x710a5d){const _0x413d3b=a4_0x290369,{options:_0x1ab0ee,args:_0x4e1fe3,tdx:_0x2a6036}=_0x710a5d;let _0x1a9a84=_0x4e1fe3[0x0]||process[_0x413d3b(0x203)]();const _0x570ce2=_0x1ab0ee[_0x413d3b(0x18a)],_0x426d5b=_0x1ab0ee['force'],_0x275640=_0x1ab0ee[_0x413d3b(0x17a)],_0x5a7730=_0x1ab0ee[_0x413d3b(0x1bf)],_0x23ec15=a4_0x3abeb3['join'](_0x1a9a84,_0x413d3b(0x1ed)),_0x2d30a8=existsSync(_0x23ec15);if(_0x2d30a8){const {data:_0x3f0be6}=await withSpinner(_0x413d3b(0x20a)+_0x1a9a84+_0x413d3b(0x1ce),()=>_0x2a6036[_0x413d3b(0x208)][_0x413d3b(0x19a)](_0x1a9a84,{'dryRun':_0x570ce2,'force':_0x426d5b}));if(_0x570ce2)return console['log'](a4_0xd2a568[_0x413d3b(0x1b4)](_0x413d3b(0x15d))),console[_0x413d3b(0x167)](_0x413d3b(0x197)+_0x3f0be6[_0x413d3b(0x1db)]),0x0;if(_0x3f0be6[_0x413d3b(0x16c)]===_0x413d3b(0x1c9))return console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1dd)+_0x3f0be6[_0x413d3b(0x1c9)])),0x1;console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1e5)](_0x413d3b(0x20c)+_0x3f0be6[_0x413d3b(0x16c)]+_0x413d3b(0x1cc))),console['log'](_0x413d3b(0x1fe)+_0x3f0be6[_0x413d3b(0x1db)]);if(_0x3f0be6[_0x413d3b(0x17d)]&&_0x3f0be6[_0x413d3b(0x1d1)]){const _0x2557df=getLLMAgentChatUrl(_0x5a7730,_0x3f0be6[_0x413d3b(0x1d1)],_0x3f0be6['agentId']);console[_0x413d3b(0x167)](_0x413d3b(0x162)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x2557df));}return 0x0;}const _0x255d97=_0x1ab0ee['llmProject'],_0x383f07=resolveProjectFromContext(_0x1a9a84,_0x255d97);if(_0x383f07[_0x413d3b(0x1b0)])_0x1a9a84=_0x383f07[_0x413d3b(0x15b)],_0x383f07['source']==='context'&&console[_0x413d3b(0x167)](a4_0xd2a568['dim'](_0x413d3b(0x1eb)+_0x1a9a84));else{let _0x1f674d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x383f07['reason']===_0x413d3b(0x1c2)&&(_0x1f674d=_0x383f07['message']+_0x413d3b(0x1c1)+_0x383f07[_0x413d3b(0x1c3)]+_0x413d3b(0x1a7));throw new SDKError(ErrorCode[_0x413d3b(0x1a5)],_0x383f07[_0x413d3b(0x169)]===_0x413d3b(0x1b1)?_0x383f07['message']:_0x413d3b(0x1f7)+_0x1a9a84,undefined,{'helpText':_0x1f674d});}const {data:_0x304a7a}=await withSpinner(_0x413d3b(0x1f0),()=>_0x2a6036[_0x413d3b(0x208)][_0x413d3b(0x196)](_0x1a9a84,{'dryRun':!![]})),_0x2daff9=_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1fc)][_0x413d3b(0x19c)]>0x0;if(_0x2daff9){console['log'](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1e1)));for(const _0x427a5a of _0x304a7a[_0x413d3b(0x1fc)]){_0x427a5a[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1b8)+_0x427a5a[_0x413d3b(0x1db)]+_0x413d3b(0x15a)+_0x427a5a[_0x413d3b(0x1c9)]));}return 0x1;}const _0x4da1e2=_0x304a7a['counts'][_0x413d3b(0x1fc)][_0x413d3b(0x165)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)][_0x413d3b(0x165)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x165)]+_0x304a7a['counts'][_0x413d3b(0x1e3)][_0x413d3b(0x165)]+_0x304a7a['counts'][_0x413d3b(0x1ec)]['created']+_0x304a7a['counts']['experimentalKnowledgeBases']['created']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)][_0x413d3b(0x165)]+_0x304a7a['counts']['formInterfaces']['created']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x206)]['created'],_0x53c7d5=_0x304a7a[_0x413d3b(0x209)]['agents'][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)]['updated']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1e3)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1ec)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)]['experimentalKnowledgeBases'][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)]['formInterfaces'][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x206)][_0x413d3b(0x210)],_0x10ab6d=_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1fc)][_0x413d3b(0x1b7)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)]['unchanged']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x1b7)]+_0x304a7a['counts'][_0x413d3b(0x1e3)][_0x413d3b(0x1b7)]+_0x304a7a['counts'][_0x413d3b(0x1ec)][_0x413d3b(0x1b7)]+_0x304a7a['counts'][_0x413d3b(0x15c)][_0x413d3b(0x1b7)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['unchanged']+_0x304a7a[_0x413d3b(0x209)]['formInterfaces'][_0x413d3b(0x1b7)]+_0x304a7a[_0x413d3b(0x209)]['chatInterfaces'][_0x413d3b(0x1b7)];console[_0x413d3b(0x167)]('\x0aPush\x20summary\x20for\x20\x27'+_0x304a7a['projectName']+'\x27:'),console[_0x413d3b(0x167)]('\x20\x20'+a4_0xd2a568[_0x413d3b(0x1e5)]('+\x20'+_0x4da1e2+_0x413d3b(0x198))+_0x413d3b(0x173)+a4_0xd2a568[_0x413d3b(0x1b4)]('~\x20'+_0x53c7d5+_0x413d3b(0x1a4))+_0x413d3b(0x173)+a4_0xd2a568[_0x413d3b(0x166)]('=\x20'+_0x10ab6d+_0x413d3b(0x17e))),console[_0x413d3b(0x167)]('\x20\x20Agents:\x20'+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1fc)])),console['log'](_0x413d3b(0x1af)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)])),console[_0x413d3b(0x167)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x304a7a['counts'][_0x413d3b(0x187)])),console[_0x413d3b(0x167)](_0x413d3b(0x16b)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1e3)])),console[_0x413d3b(0x167)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x304a7a['counts'][_0x413d3b(0x1ec)])),console[_0x413d3b(0x167)](_0x413d3b(0x19f)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1a8)])),console[_0x413d3b(0x167)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x304a7a['counts'][_0x413d3b(0x206)]));const _0xe14254=_0x304a7a['counts'][_0x413d3b(0x15c)][_0x413d3b(0x165)]>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x15c)][_0x413d3b(0x210)]>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x15c)]['unchanged']>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['created']>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['updated']>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['unchanged']>0x0;_0xe14254&&(console[_0x413d3b(0x167)](_0x413d3b(0x163)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x15c)])),console[_0x413d3b(0x167)](_0x413d3b(0x1a0)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)]['experimentalArtifacts'])));console[_0x413d3b(0x167)](_0x413d3b(0x1d6)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x1a9a84)),displayDiffs(_0x304a7a[_0x413d3b(0x1fc)],_0x304a7a[_0x413d3b(0x16f)],_0x304a7a[_0x413d3b(0x187)],_0x304a7a[_0x413d3b(0x1e3)],_0x304a7a['integrations'],_0x304a7a[_0x413d3b(0x15c)],_0x304a7a[_0x413d3b(0x1df)],_0x304a7a[_0x413d3b(0x1a8)],_0x304a7a[_0x413d3b(0x206)]);if(_0x570ce2)return console[_0x413d3b(0x167)](a4_0xd2a568['yellow'](_0x413d3b(0x1c4))),0x0;if(_0x4da1e2===0x0&&_0x53c7d5===0x0){console['log'](a4_0xd2a568[_0x413d3b(0x1e5)](_0x413d3b(0x176)));const _0x494df7=getLLMProjectUrl(_0x5a7730,_0x304a7a[_0x413d3b(0x1d1)]);return console['log'](_0x413d3b(0x1aa)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x494df7)),0x0;}if(!_0x275640&&!_0x426d5b){if(!isInteractive())return console[_0x413d3b(0x1c9)](a4_0xd2a568['red'](_0x413d3b(0x1e7)),_0x413d3b(0x181)),console[_0x413d3b(0x1c9)](a4_0xd2a568['dim'](_0x413d3b(0x200))),0x1;const _0xc48c3b=await confirmKey(_0x413d3b(0x1c0)+(_0x4da1e2+_0x53c7d5)+'\x20resources?');if(!_0xc48c3b)return console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1b4)]('Cancelled'),_0x413d3b(0x189)),0x1;}const {data:_0x29a75}=await withSpinner(_0x413d3b(0x195),()=>_0x2a6036[_0x413d3b(0x208)][_0x413d3b(0x196)](_0x1a9a84,{'force':_0x426d5b})),_0x50c055=_0x29a75['counts'][_0x413d3b(0x1fc)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x16f)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x1e3)]['errors']>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x1a8)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x206)]['errors']>0x0;if(_0x50c055){console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1b4)](_0x413d3b(0x1f6))),console[_0x413d3b(0x167)](),console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1ca)));for(const _0x35e2d1 of _0x29a75[_0x413d3b(0x1fc)]){_0x35e2d1[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console['log'](a4_0xd2a568['red'](_0x413d3b(0x1b8)+_0x35e2d1[_0x413d3b(0x1db)]+_0x413d3b(0x15a)+_0x35e2d1['error']));}for(const _0x53dd2f of _0x29a75[_0x413d3b(0x16f)]){_0x53dd2f[_0x413d3b(0x16c)]==='error'&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x53dd2f['name']+'\x22:\x20'+_0x53dd2f[_0x413d3b(0x1c9)]));}for(const _0x248fef of _0x29a75['textKnowledgeBases']){_0x248fef[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x18e)+_0x248fef['name']+_0x413d3b(0x15a)+_0x248fef[_0x413d3b(0x1c9)]));}for(const _0x22fe06 of _0x29a75[_0x413d3b(0x1e3)]){_0x22fe06[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console['log'](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x168)+_0x22fe06[_0x413d3b(0x1ba)]+'\x22:\x20'+_0x22fe06[_0x413d3b(0x1c9)]));}for(const _0xe10447 of _0x29a75[_0x413d3b(0x1ec)]){_0xe10447[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568['red'](_0x413d3b(0x192)+_0xe10447[_0x413d3b(0x1ba)]+_0x413d3b(0x15a)+_0xe10447[_0x413d3b(0x1c9)]));}for(const _0x443f66 of _0x29a75[_0x413d3b(0x1a8)]){_0x443f66[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x204)+_0x443f66[_0x413d3b(0x1ba)]+_0x413d3b(0x15a)+_0x443f66['error']));}for(const _0x4ab351 of _0x29a75[_0x413d3b(0x206)]){_0x4ab351['action']==='error'&&console[_0x413d3b(0x167)](a4_0xd2a568['red'](_0x413d3b(0x170)+_0x4ab351[_0x413d3b(0x1ba)]+_0x413d3b(0x15a)+_0x4ab351['error']));}return 0x1;}console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1e5)]('\x0a✔\x20Pushed\x20'+(_0x4da1e2+_0x53c7d5)+'\x20resources\x20to\x20\x27'+_0x29a75[_0x413d3b(0x207)]+'\x27'));const _0x3ff485=getLLMProjectUrl(_0x5a7730,_0x29a75[_0x413d3b(0x1d1)]);return console[_0x413d3b(0x167)](_0x413d3b(0x1aa)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x3ff485)),0x0;}}
|
|
1
|
+
const a4_0x36eeb0=a4_0x571a;(function(_0x7d4b47,_0x201f95){const _0x58060e=a4_0x571a,_0x123801=_0x7d4b47();while(!![]){try{const _0x481aa0=-parseInt(_0x58060e(0x205))/0x1+parseInt(_0x58060e(0x261))/0x2+-parseInt(_0x58060e(0x21d))/0x3+-parseInt(_0x58060e(0x21b))/0x4+parseInt(_0x58060e(0x1f9))/0x5+parseInt(_0x58060e(0x1cd))/0x6*(-parseInt(_0x58060e(0x255))/0x7)+parseInt(_0x58060e(0x223))/0x8;if(_0x481aa0===_0x201f95)break;else _0x123801['push'](_0x123801['shift']());}catch(_0x376579){_0x123801['push'](_0x123801['shift']());}}}(a4_0x2003,0x518a7));import a4_0x1f75c6 from'chalk';import a4_0x2c93ff from'path';function a4_0x2003(){const _0x24de6f=['\x20errors','\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','force','yes','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llmProject','dirname','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Agent:\x20','\x20=\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent:clone','-\x20no\x20files\x20written','agent:pull','cwd-config','\x20total','Pulling\x20agent\x20\x22','Using\x20project\x20from\x20','Cloning\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','751499aeWBqN','action','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','site','formInterfaces','cloneProject','name','tdx.json','\x20\x20Source:\x20','\x20\x20Chat\x20Interfaces:\x20','push','234818oeskTg','llm','\x20\x20Integration\x20\x22','\x0aChanges:','cyan','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','join','found','llm_project','Using\x20current\x20project:\x20','Summary:','\x20updated','counts','\x0aPush\x20summary\x20for\x20\x27','projectName','session','Using\x20project\x20from\x20context:\x20','log','yellow','Pushing\x20to\x20project...','INVALID_ARGUMENT','dryRun','repeat','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Agents:\x20','Using\x20context\x20project:\x20','agentId','-\x20nothing\x20pushed','\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','total','red','cwd','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20changed','reason','\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)','\x20|\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agents','textKnowledgeBases','Errors:','prompts','24FiJzPn','Failed\x20to\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','sourceProjectName','agent:push','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Integrations:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','New\x20project\x20ID:\x20','chatInterfaces','created','Analyzing\x20changes\x20to\x20push...','Would\x20clone:','error','Agent\x20pulled\x20successfully','projectDir','knowledgeBases','\x20--name\x20','✔\x20Context\x20set:\x20','\x0aWrite\x20','New\x20project\x20name\x20is\x20required','pushProject','Source:\x20','\x20files?','Dry\x20run\x20-\x20no\x20changes\x20made','\x20new','new','\x22\x20from\x20project\x20\x22','\x22:\x20','context','\x20resources?','\x20successfully','gray','newProjectName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','parse','\x0aChanges\x20to\x20agent\x20\x27','Agent\x20','experimentalKnowledgeBases','Cancelled','\x20unchanged','3012950oQIgAP','Pushing\x20agent\x20from\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20to\x20\x22','\x20\x20Form\x20Interfaces:\x20','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20Pushed\x20','Status:\x20','unchanged','New\x20project:\x20','628259OyObzg','execute','Output:\x20','\x20\x20Prompt\x20\x22','diff','dim','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','no_context','Dry\x20run\x20-\x20no\x20files\x20written','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','Using\x20project:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Knowledge\x20Bases:\x20','Project:\x20','Analyzing\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','updated','utf-8','projectId','\x20\x20Knowledge\x20Base\x20\x22','536772FksCWs','outputPath','1352034gUNSLn','integrations','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aChanges\x20to\x20chat\x20interface\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\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','10052400SFabSz','outputDir','message','\x20\x20Agent\x20\x22','Project\x20cloned\x20with\x20errors','MISSING_ARGUMENT','\x20files\x20to\x20','\x20\x20Target:\x20','Clone\x20\x22','\x0aError:','pushAgent','\x0aProject\x20pushed\x20with\x20errors','Output\x20path:\x20','\x22...','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)','description','Writing\x20files...','agentName','agent.yml','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','green','no_local_folder','profile','experimentalArtifacts','errors','Chat:\x20','\x20\x20Form\x20Interface\x20\x22'];a4_0x2003=function(){return _0x24de6f;};return a4_0x2003();}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(_0x3e27b6){const _0x31a8a4=a4_0x571a,_0x442319=[];if(_0x3e27b6[_0x31a8a4(0x1c0)]!==undefined)_0x442319[_0x31a8a4(0x260)](_0x3e27b6['total']+_0x31a8a4(0x250));if(_0x3e27b6['new']!==undefined&&_0x3e27b6[_0x31a8a4(0x1ea)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6[_0x31a8a4(0x1ea)]+_0x31a8a4(0x1e9)));if(_0x3e27b6[_0x31a8a4(0x1da)]!==undefined&&_0x3e27b6[_0x31a8a4(0x1da)]>0x0)_0x442319['push'](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6['created']+'\x20created'));if(_0x3e27b6[_0x31a8a4(0x217)]!==undefined&&_0x3e27b6[_0x31a8a4(0x217)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['yellow'](_0x3e27b6[_0x31a8a4(0x217)]+_0x31a8a4(0x26d)));if(_0x3e27b6[_0x31a8a4(0x203)]!==undefined&&_0x3e27b6[_0x31a8a4(0x203)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['gray'](_0x3e27b6['unchanged']+_0x31a8a4(0x1f8)));if(_0x3e27b6[_0x31a8a4(0x23b)]!==undefined&&_0x3e27b6[_0x31a8a4(0x23b)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['red'](_0x3e27b6[_0x31a8a4(0x23b)]+_0x31a8a4(0x23e)));return _0x442319[_0x31a8a4(0x268)](',\x20');}function displayDiffs(_0x2ffa4f,_0x9d833f,_0x4f4331,_0x276b1c,_0x5e58de,_0x4b72e1,_0x1d1914,_0x22bd58,_0x2cc75d){const _0x2742ba=a4_0x571a;for(const _0xc17d05 of _0x2ffa4f){if(_0xc17d05[_0x2742ba(0x209)]){const _0x4521fd=_0xc17d05[_0x2742ba(0x234)]||_0xc17d05['name'];console[_0x2742ba(0x1b4)](_0x2742ba(0x1f4)+_0x4521fd+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0xc17d05[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c));}}for(const _0x1e899d of _0x9d833f){_0x1e899d[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20b)+_0x1e899d[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1e899d[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x2a50b1 of _0x4f4331){_0x2a50b1['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x24b)+_0x2a50b1[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x2a50b1[_0x2742ba(0x209)]),console['log']('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x31e068 of _0x276b1c){_0x31e068[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x211)+_0x31e068['name']+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0x31e068[_0x2742ba(0x209)]),console['log']('─'['repeat'](0x3c)));}for(const _0x4362d5 of _0x5e58de){_0x4362d5[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20f)+_0x4362d5[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x4362d5[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x47e612 of _0x4b72e1){_0x47e612['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x254)+_0x47e612[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x47e612[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x3b9cea of _0x1d1914){_0x3b9cea[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x3b9cea[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x3b9cea[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x1f33a4 of _0x22bd58){_0x1f33a4[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x1d3)+_0x1f33a4[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1f33a4[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x4256c6 of _0x2cc75d){_0x4256c6['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x220)+_0x4256c6[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console['log'](_0x4256c6[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}}function a4_0x571a(_0x1c5970,_0x2394ca){_0x1c5970=_0x1c5970-0x1b3;const _0x200383=a4_0x2003();let _0x571a67=_0x200383[_0x1c5970];return _0x571a67;}export class AgentPullCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24e);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x266);async[a4_0x36eeb0(0x206)](_0x1912e5){const _0x4d2025=a4_0x36eeb0,{options:_0x17e537,args:_0x102bde,tdx:_0x241ce6}=_0x1912e5,_0xc525fe=_0x102bde[0x0],_0x2b2200=_0x102bde[0x1],_0x45a4a4=_0x17e537['output'],_0x4b7962=_0x17e537['dryRun'],_0x4f60de=_0x17e537[_0x4d2025(0x240)],_0x42bd8d=_0x17e537[_0x4d2025(0x241)],_0x4adb41=_0x17e537[_0x4d2025(0x243)],_0xb23fe0=_0x17e537[_0x4d2025(0x24a)];let _0x996e9d;if(_0xc525fe){const _0x37deb7=a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d));if(existsSync(_0x37deb7))try{const _0x16cf47=JSON[_0x4d2025(0x1f3)](readFileSync(_0x37deb7,'utf-8'));_0x16cf47['llm_project']&&(_0x996e9d={'llm_project':_0x16cf47[_0x4d2025(0x26a)]});}catch{}}const _0x5b0d25=findAgentConfigPath(process['cwd']());let _0x35361b;if(_0x5b0d25)try{const _0x49b6a9=JSON['parse'](readFileSync(_0x5b0d25,_0x4d2025(0x218)));_0x49b6a9[_0x4d2025(0x26a)]&&(_0x35361b={'llm_project':_0x49b6a9['llm_project']});}catch{}const _0x2f0b25=resolveAgentPullArgs({'arg':_0xc525fe,'agentNameArg':_0x2b2200,'agentFlag':_0xb23fe0,'contextProject':_0x4adb41,'argDirConfig':_0x996e9d,'cwdConfigPath':_0x5b0d25||undefined,'cwdConfig':_0x35361b}),{projectNameOrId:_0x3c2128,targetAgentName:_0x35d92d,existingOutputDir:_0x30c015,source:_0x49297c}=_0x2f0b25;if(_0x49297c==='arg-dir')console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x252)+a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d))+':\x20'+_0x3c2128));else{if(_0x49297c===_0x4d2025(0x24f))console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x210)+_0x3c2128));else _0x49297c===_0x4d2025(0x1ed)&&console['log'](a4_0x1f75c6['dim'](_0x4d2025(0x1b3)+_0x3c2128));}if(!_0x3c2128)return _0xb23fe0?(console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1ff))),console[_0x4d2025(0x1b4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x4d2025(0x1b4)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x1f75c6['yellow'](_0x4d2025(0x221))),console['log'](_0x4d2025(0x231)),console[_0x4d2025(0x1b4)](_0x4d2025(0x23f)),console['log'](_0x4d2025(0x1bf)),console[_0x4d2025(0x1b4)](_0x4d2025(0x222)),console[_0x4d2025(0x1b4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x35d92d){const {data:_0x522451}=await withSpinner(_0x4d2025(0x251)+_0x35d92d+_0x4d2025(0x1eb)+_0x3c2128+'\x22...',()=>_0x241ce6[_0x4d2025(0x262)]['pullAgent'](_0x3c2128,_0x35d92d,_0x45a4a4,{'dryRun':_0x4b7962,'force':_0x4f60de}));if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x20d))),console[_0x4d2025(0x1b4)](_0x4d2025(0x1cf)+_0x522451['agentName']),console[_0x4d2025(0x1b4)](_0x4d2025(0x22f)+_0x522451[_0x4d2025(0x21c)]),_0x522451['diff']&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x264)),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c)),console[_0x4d2025(0x1b4)](_0x522451[_0x4d2025(0x209)]),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c))),0x0;return console['log'](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1de))),console[_0x4d2025(0x1b4)](_0x4d2025(0x246)+_0x522451[_0x4d2025(0x234)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x207)+_0x522451[_0x4d2025(0x21c)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x202)+(_0x522451['isNew']?a4_0x1f75c6[_0x4d2025(0x237)]('new'):_0x522451['hasChanges']?a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x217)):a4_0x1f75c6[_0x4d2025(0x1f0)](_0x4d2025(0x203)))),0x0;}const _0x161b62=_0x30c015||_0x45a4a4,{data:_0x195aee}=await withSpinner(_0x4d2025(0x215)+_0x3c2128+_0x4d2025(0x230),()=>_0x241ce6['llm'][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'dryRun':!![]})),_0x237059=_0x195aee['counts'][_0x4d2025(0x1c9)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)][_0x4d2025(0x1ea)]+_0x195aee['counts'][_0x4d2025(0x1ca)]['new']+_0x195aee['counts'][_0x4d2025(0x1cc)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)]['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)]['formInterfaces']['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x1ea)],_0x3570e2=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)]['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)][_0x4d2025(0x217)]+_0x195aee['counts']['prompts'][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)]['integrations']['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x25a)][_0x4d2025(0x217)]+_0x195aee['counts'][_0x4d2025(0x1d9)][_0x4d2025(0x217)],_0x30bbde=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x1e0)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)]['experimentalKnowledgeBases'][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x25a)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x203)];console['log'](_0x4d2025(0x248)+_0x195aee[_0x4d2025(0x270)]+'\x27:'),console[_0x4d2025(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x4d2025(0x237)]('+\x20'+_0x237059+'\x20new')+_0x4d2025(0x1c7)+a4_0x1f75c6['yellow']('~\x20'+_0x3570e2+'\x20changed')+'\x20|\x20'+a4_0x1f75c6[_0x4d2025(0x20a)]('=\x20'+_0x30bbde+'\x20unchanged')),console['log'](_0x4d2025(0x1bb)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1c9)])),console[_0x4d2025(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)]['knowledgeBases'])),console[_0x4d2025(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1fe)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d6)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)])),console[_0x4d2025(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x195aee['counts']['formInterfaces'])),console[_0x4d2025(0x1b4)](_0x4d2025(0x25f)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)]));const _0x2f1eff=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1c0)]>0x0||_0x195aee['counts'][_0x4d2025(0x23a)]['total']>0x0;_0x2f1eff&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x267)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1f6)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d5)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x23a)])));console[_0x4d2025(0x1b4)](_0x4d2025(0x22a)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x224)])),displayDiffs(_0x195aee[_0x4d2025(0x1c9)],_0x195aee[_0x4d2025(0x1e0)],_0x195aee[_0x4d2025(0x1ca)],_0x195aee[_0x4d2025(0x1cc)],_0x195aee[_0x4d2025(0x21e)],_0x195aee[_0x4d2025(0x1f6)],_0x195aee[_0x4d2025(0x23a)],_0x195aee[_0x4d2025(0x25a)],_0x195aee[_0x4d2025(0x1d9)]);if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x237059===0x0&&_0x3570e2===0x0)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1c8))),saveSessionContext({'llm_project':_0x195aee['projectName']},_0x17e537['session']),console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+_0x4d2025(0x247)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x270)]))),0x0;if(!_0x42bd8d&&!_0x4f60de){if(!isInteractive())return console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x1c1)](_0x4d2025(0x22c)),_0x4d2025(0x1fb)),console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x200))),0x1;const _0x22799e=await confirmKey(_0x4d2025(0x1e3)+(_0x237059+_0x3570e2)+_0x4d2025(0x1e7));if(!_0x22799e)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1f7)),_0x4d2025(0x24d)),0x1;}const {data:_0x2c0eba}=await withSpinner(_0x4d2025(0x233),()=>_0x241ce6[_0x4d2025(0x262)][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'force':_0x4f60de}));return console['log'](a4_0x1f75c6[_0x4d2025(0x237)]('\x0a✔\x20Pulled\x20'+(_0x237059+_0x3570e2)+_0x4d2025(0x229)+_0x2c0eba[_0x4d2025(0x224)])),saveSessionContext({'llm_project':_0x2c0eba[_0x4d2025(0x270)]},_0x17e537[_0x4d2025(0x271)]),console['log'](a4_0x1f75c6['green'](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+'\x20=\x20'+a4_0x1f75c6['cyan'](_0x2c0eba[_0x4d2025(0x270)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24c);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x212);async['execute'](_0x13c57e){const _0x30a963=a4_0x36eeb0,{options:_0x2463bf,args:_0x279c0e,tdx:_0x4443aa}=_0x13c57e,_0x4a6d51=_0x279c0e[0x0],_0x386488=_0x2463bf[_0x30a963(0x25c)],_0x27038c=_0x2463bf[_0x30a963(0x1b8)],_0x33f833=_0x2463bf['yes'],_0x21636a=_0x2463bf['site'],_0x43ee3c=_0x2463bf['llmProject'];let _0x28f999;const _0x466f5b=findAgentConfigPath(process['cwd']());if(_0x4a6d51){const _0x35dbe1=a4_0x2c93ff['join'](_0x4a6d51,'tdx.json');existsSync(_0x35dbe1)?(_0x28f999=_0x4a6d51,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x20e)+_0x4a6d51))):_0x28f999=_0x4a6d51;}else{if(_0x466f5b)_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x466f5b),console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x26b)+_0x28f999));else{if(_0x43ee3c){const _0x10c8a4=sanitizeForFilesystem(_0x43ee3c);let _0x3b2ffe=_0x10c8a4,_0x149d78=a4_0x2c93ff['join'](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0x10c8a4,'tdx.json');if(!existsSync(_0x149d78)){const _0xf5f5c8=normalizeName(_0x43ee3c),_0x6b659=a4_0x2c93ff[_0x30a963(0x268)](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0xf5f5c8,'tdx.json');existsSync(_0x6b659)&&(_0x3b2ffe=_0xf5f5c8,_0x149d78=_0x6b659);}if(existsSync(_0x149d78))_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x149d78),console['log'](a4_0x1f75c6[_0x30a963(0x20a)]('Using\x20local\x20project:\x20'+_0x28f999));else{const _0x412223=_0x2463bf[_0x30a963(0x239)];if(_0x412223)throw new SDKError(ErrorCode[_0x30a963(0x1b7)],_0x30a963(0x1f2)+_0x43ee3c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x30a963(0x236)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x43ee3c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b2ffe+_0x30a963(0x1e1)+(_0x386488||'<new-name>')+'\x20--profile\x20'+_0x412223)});_0x28f999=_0x43ee3c,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x1bc)+_0x43ee3c));}}}}if(!_0x28f999)return console['log'](a4_0x1f75c6[_0x30a963(0x1b5)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x30a963(0x1b4)](_0x30a963(0x1c3)),console[_0x30a963(0x1b4)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x30a963(0x1b4)](_0x30a963(0x1c6)),console[_0x30a963(0x1b4)](_0x30a963(0x258)),0x1;if(!_0x386488)throw new SDKError(ErrorCode[_0x30a963(0x228)],_0x30a963(0x1e4),undefined,{'helpText':_0x30a963(0x242)});if(!_0x33f833&&!_0x27038c){if(!isInteractive())return console[_0x30a963(0x1dd)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x22c)),_0x30a963(0x1fb)),console['error'](a4_0x1f75c6['dim'](_0x30a963(0x200))),0x1;const _0x45d3d1=await confirmKey(_0x30a963(0x22b)+_0x28f999+'\x22\x20to\x20new\x20project\x20\x22'+_0x386488+'\x22?');if(!_0x45d3d1)return console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1f7))),0x1;}const {data:_0x1ac9c5}=await withSpinner(_0x30a963(0x253)+_0x28f999+_0x30a963(0x1fc)+_0x386488+_0x30a963(0x230),()=>_0x4443aa[_0x30a963(0x262)][_0x30a963(0x25b)](_0x28f999,_0x386488,{'dryRun':_0x27038c}));if(_0x27038c){console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1e8))),console['log']('Source:\x20'+_0x1ac9c5['sourceProjectName']),console['log'](_0x30a963(0x204)+_0x386488),console['log'](_0x30a963(0x1dc)),console[_0x30a963(0x1b4)]('\x20\x20Agents:\x20'+_0x1ac9c5['counts'][_0x30a963(0x1c9)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x213)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)][_0x30a963(0x1da)]),console['log'](_0x30a963(0x1fe)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x25a)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)][_0x30a963(0x1da)]);const _0x28e77f=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x1da)]>0x0;return _0x28e77f&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1d5)+_0x1ac9c5['counts']['experimentalArtifacts'][_0x30a963(0x1da)])),0x0;}const _0x50063c=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)]['errors']>0x0||_0x1ac9c5['counts'][_0x30a963(0x1cc)]['errors']>0x0||_0x1ac9c5['counts']['formInterfaces']['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['chatInterfaces'][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x23b)]>0x0;_0x50063c?console[_0x30a963(0x1b4)](a4_0x1f75c6['yellow'](_0x30a963(0x227))):console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x237)]('Project\x20cloned\x20successfully'));console[_0x30a963(0x1b4)](_0x30a963(0x1e6)+_0x1ac9c5[_0x30a963(0x1d0)]),console['log'](_0x30a963(0x204)+_0x1ac9c5[_0x30a963(0x1f1)]),console['log'](_0x30a963(0x1d8)+_0x1ac9c5['newProjectId']),console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](_0x30a963(0x26c)),console['log'](_0x30a963(0x1bb)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)])),console[_0x30a963(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)])),console[_0x30a963(0x1b4)](_0x30a963(0x1fe)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)])),console[_0x30a963(0x1b4)](_0x30a963(0x1d6)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)]['integrations'])),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x25a)])),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)]));const _0x584ccd=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['created']>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalKnowledgeBases'][_0x30a963(0x203)]>0x0||_0x1ac9c5['counts'][_0x30a963(0x23a)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x203)]>0x0;_0x584ccd&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x1f6)])),console[_0x30a963(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)])));if(_0x50063c){console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](a4_0x1f75c6['red'](_0x30a963(0x1cb)));for(const _0x1b0ba2 of _0x1ac9c5[_0x30a963(0x1c9)]){_0x1b0ba2['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6['red']('\x20\x20Agent\x20\x22'+_0x1b0ba2[_0x30a963(0x234)]+_0x30a963(0x1ec)+_0x1b0ba2[_0x30a963(0x1dd)]));}for(const _0x23d550 of _0x1ac9c5[_0x30a963(0x1e0)]){_0x23d550[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x21a)+_0x23d550[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x23d550['error']));}for(const _0x42834d of _0x1ac9c5[_0x30a963(0x1cc)]){_0x42834d['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Prompt\x20\x22'+_0x42834d[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x42834d[_0x30a963(0x1dd)]));}for(const _0x352944 of _0x1ac9c5[_0x30a963(0x21e)]){_0x352944[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x263)+_0x352944[_0x30a963(0x25c)]+'\x22:\x20'+_0x352944[_0x30a963(0x1dd)]));}for(const _0x168df6 of _0x1ac9c5[_0x30a963(0x25a)]){_0x168df6[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x23d)+_0x168df6[_0x30a963(0x25c)]+'\x22:\x20'+_0x168df6[_0x30a963(0x1dd)]));}for(const _0x31afc4 of _0x1ac9c5['chatInterfaces']){_0x31afc4[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Chat\x20Interface\x20\x22'+_0x31afc4['name']+_0x30a963(0x1ec)+_0x31afc4[_0x30a963(0x1dd)]));}for(const _0x30dae1 of _0x1ac9c5[_0x30a963(0x1f6)]){_0x30dae1[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x249)+_0x30dae1[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x30dae1[_0x30a963(0x1dd)]));}for(const _0x570b50 of _0x1ac9c5[_0x30a963(0x23a)]){_0x570b50[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x570b50[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x570b50['error']));}return 0x1;}console[_0x30a963(0x1b4)]();const _0x4dbb4d=getLLMProjectUrl(_0x21636a,_0x1ac9c5['newProjectId']);return console['log']('Project:\x20'+a4_0x1f75c6[_0x30a963(0x265)](_0x4dbb4d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x1d1);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x257);async[a4_0x36eeb0(0x206)](_0x56df93){const _0x31f9fe=a4_0x36eeb0,{options:_0x53655b,args:_0x500f33,tdx:_0x15cf94}=_0x56df93;let _0x1521b8=_0x500f33[0x0]||process[_0x31f9fe(0x1c2)]();const _0x222b1d=_0x53655b[_0x31f9fe(0x1b8)],_0x504701=_0x53655b[_0x31f9fe(0x240)],_0x3514f7=_0x53655b[_0x31f9fe(0x241)],_0x59bd9e=_0x53655b[_0x31f9fe(0x259)],_0x101197=a4_0x2c93ff[_0x31f9fe(0x268)](_0x1521b8,_0x31f9fe(0x235)),_0x52f1e5=existsSync(_0x101197);if(_0x52f1e5){const {data:_0x221a1e}=await withSpinner(_0x31f9fe(0x1fa)+_0x1521b8+_0x31f9fe(0x230),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x22d)](_0x1521b8,{'dryRun':_0x222b1d,'force':_0x504701}));if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x31f9fe(0x1b4)]('Would\x20push\x20agent:\x20'+_0x221a1e['agentName']),0x0;if(_0x221a1e[_0x31f9fe(0x256)]==='error')return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ce)+_0x221a1e['error'])),0x1;console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x1f5)+_0x221a1e[_0x31f9fe(0x256)]+_0x31f9fe(0x1ef))),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x246)+_0x221a1e['agentName']);if(_0x221a1e['agentId']&&_0x221a1e[_0x31f9fe(0x219)]){const _0x43bd0a=getLLMAgentChatUrl(_0x59bd9e,_0x221a1e[_0x31f9fe(0x219)],_0x221a1e[_0x31f9fe(0x1bd)]);console['log'](_0x31f9fe(0x23c)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x43bd0a));}return 0x0;}const _0x14c8a7=_0x53655b[_0x31f9fe(0x243)],_0x5904f5=resolveProjectFromContext(_0x1521b8,_0x14c8a7);if(_0x5904f5[_0x31f9fe(0x269)])_0x1521b8=_0x5904f5[_0x31f9fe(0x1df)],_0x5904f5['source']===_0x31f9fe(0x1ed)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['dim']('Using\x20project:\x20'+_0x1521b8));else{let _0x337af1='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x238)&&(_0x337af1=_0x5904f5[_0x31f9fe(0x225)]+_0x31f9fe(0x245)+_0x5904f5[_0x31f9fe(0x243)]+_0x31f9fe(0x21f));throw new SDKError(ErrorCode[_0x31f9fe(0x1b7)],_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x20c)?_0x5904f5[_0x31f9fe(0x225)]:_0x31f9fe(0x216)+_0x1521b8,undefined,{'helpText':_0x337af1});}const {data:_0x52bb31}=await withSpinner(_0x31f9fe(0x1db),()=>_0x15cf94[_0x31f9fe(0x262)]['pushProject'](_0x1521b8,{'dryRun':!![]})),_0x4d0448=_0x52bb31['counts'][_0x31f9fe(0x1c9)][_0x31f9fe(0x23b)]>0x0;if(_0x4d0448){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aErrors\x20found:'));for(const _0x53787 of _0x52bb31[_0x31f9fe(0x1c9)]){_0x53787[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x53787[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x53787[_0x31f9fe(0x1dd)]));}return 0x1;}const _0x1c9622=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x1da)]+_0x52bb31['counts']['knowledgeBases'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1ca)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)]['prompts'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x21e)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x25a)]['created']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]['created'],_0x1ae29a=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1e0)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x217)]+_0x52bb31['counts']['prompts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['updated']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)]['updated']+_0x52bb31['counts']['experimentalArtifacts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)]['formInterfaces'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)][_0x31f9fe(0x217)],_0x522a16=_0x52bb31[_0x31f9fe(0x26e)]['agents'][_0x31f9fe(0x203)]+_0x52bb31['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x25a)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)]['chatInterfaces']['unchanged'];console[_0x31f9fe(0x1b4)](_0x31f9fe(0x26f)+_0x52bb31[_0x31f9fe(0x270)]+'\x27:'),console[_0x31f9fe(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x31f9fe(0x237)]('+\x20'+_0x1c9622+_0x31f9fe(0x1e9))+_0x31f9fe(0x1c7)+a4_0x1f75c6[_0x31f9fe(0x1b5)]('~\x20'+_0x1ae29a+_0x31f9fe(0x1c4))+'\x20|\x20'+a4_0x1f75c6[_0x31f9fe(0x20a)]('=\x20'+_0x522a16+_0x31f9fe(0x1f8))),console[_0x31f9fe(0x1b4)]('\x20\x20Agents:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1e0)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d2)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['textKnowledgeBases'])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1fe)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1cc)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d6)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)])),console[_0x31f9fe(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x25a)])),console['log'](_0x31f9fe(0x25f)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]));const _0x562b2c=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]>0x0||_0x52bb31['counts'][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x203)]>0x0;_0x562b2c&&(console[_0x31f9fe(0x1b4)](_0x31f9fe(0x267)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1f6)])),console[_0x31f9fe(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'])));console[_0x31f9fe(0x1b4)](_0x31f9fe(0x25e)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x1521b8)),displayDiffs(_0x52bb31['agents'],_0x52bb31[_0x31f9fe(0x1e0)],_0x52bb31['textKnowledgeBases'],_0x52bb31[_0x31f9fe(0x1cc)],_0x52bb31[_0x31f9fe(0x21e)],_0x52bb31['experimentalKnowledgeBases'],_0x52bb31[_0x31f9fe(0x23a)],_0x52bb31[_0x31f9fe(0x25a)],_0x52bb31[_0x31f9fe(0x1d9)]);if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1c9622===0x0&&_0x1ae29a===0x0){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4384a0=getLLMProjectUrl(_0x59bd9e,_0x52bb31[_0x31f9fe(0x219)]);return console['log']('Project:\x20'+a4_0x1f75c6['cyan'](_0x4384a0)),0x0;}if(!_0x3514f7&&!_0x504701){if(!isInteractive())return console['error'](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x1f75c6['dim'](_0x31f9fe(0x200))),0x1;const _0x41da07=await confirmKey('\x0aPush\x20'+(_0x1c9622+_0x1ae29a)+_0x31f9fe(0x1ee));if(!_0x41da07)return console['log'](a4_0x1f75c6['yellow'](_0x31f9fe(0x1f7)),_0x31f9fe(0x1be)),0x1;}const {data:_0x51a762}=await withSpinner(_0x31f9fe(0x1b6),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x1e5)](_0x1521b8,{'force':_0x504701})),_0x4910cf=_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)]['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)]['formInterfaces']['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1d9)][_0x31f9fe(0x23b)]>0x0;if(_0x4910cf){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)](_0x31f9fe(0x22e))),console[_0x31f9fe(0x1b4)](),console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x1cb)));for(const _0x58a0c2 of _0x51a762[_0x31f9fe(0x1c9)]){_0x58a0c2[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x58a0c2[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x58a0c2[_0x31f9fe(0x1dd)]));}for(const _0x136b45 of _0x51a762[_0x31f9fe(0x1e0)]){_0x136b45[_0x31f9fe(0x256)]==='error'&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x136b45['name']+_0x31f9fe(0x1ec)+_0x136b45[_0x31f9fe(0x1dd)]));}for(const _0x256516 of _0x51a762['textKnowledgeBases']){_0x256516[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1d7)+_0x256516[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x256516[_0x31f9fe(0x1dd)]));}for(const _0x1dda2b of _0x51a762[_0x31f9fe(0x1cc)]){_0x1dda2b[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x208)+_0x1dda2b[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x1dda2b['error']));}for(const _0x12aa59 of _0x51a762[_0x31f9fe(0x21e)]){_0x12aa59[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x263)+_0x12aa59[_0x31f9fe(0x25c)]+'\x22:\x20'+_0x12aa59[_0x31f9fe(0x1dd)]));}for(const _0x2c6502 of _0x51a762[_0x31f9fe(0x25a)]){_0x2c6502['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x23d)+_0x2c6502['name']+_0x31f9fe(0x1ec)+_0x2c6502['error']));}for(const _0x2db326 of _0x51a762[_0x31f9fe(0x1d9)]){_0x2db326['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ba)+_0x2db326[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x2db326[_0x31f9fe(0x1dd)]));}return 0x1;}console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x201)+(_0x1c9622+_0x1ae29a)+'\x20resources\x20to\x20\x27'+_0x51a762[_0x31f9fe(0x270)]+'\x27'));const _0x2094a6=getLLMProjectUrl(_0x59bd9e,_0x51a762[_0x31f9fe(0x219)]);return console[_0x31f9fe(0x1b4)](_0x31f9fe(0x214)+a4_0x1f75c6['cyan'](_0x2094a6)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x36a7fd=a5_0x1792;(function(_0x20c6ea,_0x54ba70){const _0x4b1dcf=a5_0x1792,_0x2cda50=_0x20c6ea();while(!![]){try{const _0x1bca43=parseInt(_0x4b1dcf(0x184))/0x1*(-parseInt(_0x4b1dcf(0x13a))/0x2)+parseInt(_0x4b1dcf(0x194))/0x3+-parseInt(_0x4b1dcf(0x17f))/0x4*(-parseInt(_0x4b1dcf(0x105))/0x5)+-parseInt(_0x4b1dcf(0x114))/0x6*(parseInt(_0x4b1dcf(0x13f))/0x7)+parseInt(_0x4b1dcf(0x109))/0x8+-parseInt(_0x4b1dcf(0x138))/0x9+-parseInt(_0x4b1dcf(0x152))/0xa*(-parseInt(_0x4b1dcf(0x15c))/0xb);if(_0x1bca43===_0x54ba70)break;else _0x2cda50['push'](_0x2cda50['shift']());}catch(_0x4f097f){_0x2cda50['push'](_0x2cda50['shift']());}}}(a5_0x33cc,0xb4818));import*as a5_0x24e656 from'node:fs';function a5_0x1792(_0x1e7556,_0x15015d){_0x1e7556=_0x1e7556-0xfe;const _0x33cc23=a5_0x33cc();let _0x179223=_0x33cc23[_0x1e7556];return _0x179223;}import*as a5_0x5d8849 from'node:path';import a5_0x520e02 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{['name']='agent:test';[a5_0x36a7fd(0x14a)]=a5_0x36a7fd(0x15d);async[a5_0x36a7fd(0x10c)](_0x458b71){const _0x15baaa=a5_0x36a7fd,{options:_0x19eaf8,args:_0x25d73e,tdx:_0x5a9f98}=_0x458b71,_0x3e0b91=_0x25d73e[0x0]||'.',_0x2e71f3=_0x19eaf8[_0x15baaa(0x18b)],_0x3ae21e=_0x19eaf8,_0x48d092=_0x3ae21e[_0x15baaa(0x183)]===![],_0x5adfe0=_0x3ae21e['reeval'],_0x211384=_0x3ae21e[_0x15baaa(0x176)],_0x1f8a46=_0x3ae21e['tags'],_0x565add=_0x19eaf8[_0x15baaa(0x168)],_0xf6f1df=_0x3ae21e[_0x15baaa(0x103)];if(_0x5adfe0&&_0x48d092)return console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x153))),0x1;let _0x38a244=_0x15baaa(0x170);if(_0x3ae21e[_0x15baaa(0x12b)])_0x38a244='json';else{if(_0x3ae21e[_0x15baaa(0x166)])_0x38a244=_0x15baaa(0x166);else{if(_0x3ae21e[_0x15baaa(0x12d)])_0x38a244='tsv';else{if(_0x3ae21e[_0x15baaa(0x170)])_0x38a244=_0x15baaa(0x170);}}}const _0x2a0b21=_0x3ae21e[_0x15baaa(0x16d)];let _0x2e0245=_0x3e0b91;const _0x27765f=a5_0x24e656[_0x15baaa(0x15a)](_0x3e0b91),_0x31d6e9=_0x3e0b91==='.';if(!_0x27765f||_0x31d6e9){const _0x12a332=resolveProjectFromContext(_0x3e0b91,_0x2a0b21,{'requireFile':_0x15baaa(0x135)});if(_0x12a332['found'])_0x2e0245=_0x12a332[_0x15baaa(0x11e)],_0x12a332[_0x15baaa(0x125)]==='context'&&console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)]('Using\x20agent:\x20'+_0x2e0245));else switch(_0x12a332[_0x15baaa(0x10e)]){case _0x15baaa(0x145):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)](_0x12a332[_0x15baaa(0x180)])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)]('Usage:'),console[_0x15baaa(0x16f)](_0x15baaa(0x17e)),console['log'](_0x15baaa(0x16b)),console[_0x15baaa(0x16f)](),console['log'](_0x15baaa(0x15f));return 0x1;case'no_local_folder':console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)](_0x12a332[_0x15baaa(0x180)])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15baaa(0x131)+_0x12a332['llmProject']+_0x15baaa(0x106));return 0x1;case _0x15baaa(0x159):{const _0x1483f5=a5_0x5d8849[_0x15baaa(0x155)](_0x12a332[_0x15baaa(0x11e)]);console[_0x15baaa(0x16f)](a5_0x520e02['yellow'](_0x15baaa(0x190)+_0x12a332['llmProject']+'\x22:'));for(const _0xf18dc9 of _0x12a332['agentDirs']){console[_0x15baaa(0x16f)](_0x15baaa(0x124)+_0xf18dc9);}return console['log'](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1483f5+_0x15baaa(0x158)),0x1;}case _0x15baaa(0x11d):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)](_0x15baaa(0x11f)+_0x12a332['llmProject']+'\x22.')),console['log'](a5_0x520e02[_0x15baaa(0x142)]('Project\x20path:\x20'+_0x12a332['projectDir'])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15baaa(0x169));return 0x1;}}const {definition:_0x295f96,agentInfo:_0x335965}=parseTestFile(_0x2e0245);let _0x5f3a47=_0x295f96[_0x15baaa(0x10b)];if(_0x211384){const _0x50b4c4=_0x211384[_0x15baaa(0xff)](',')[_0x15baaa(0x17b)](_0x128c4d=>_0x128c4d[_0x15baaa(0x147)]());_0x5f3a47=_0x295f96[_0x15baaa(0x10b)][_0x15baaa(0x129)](_0x5c456e=>_0x50b4c4[_0x15baaa(0x18c)](_0x5c456e[_0x15baaa(0x176)]));if(_0x5f3a47[_0x15baaa(0x133)]===0x0)return console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)]('No\x20tests\x20found\x20matching:\x20'+_0x211384)),console['log'](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x14c)+_0x295f96[_0x15baaa(0x10b)][_0x15baaa(0x17b)](_0x1f34a5=>_0x1f34a5[_0x15baaa(0x176)])[_0x15baaa(0x160)](',\x20'))),0x1;}if(_0x1f8a46){const _0x3858d7=_0x1f8a46['split'](',')[_0x15baaa(0x17b)](_0xe94109=>_0xe94109[_0x15baaa(0x147)]()['toLowerCase']());_0x5f3a47=_0x5f3a47['filter'](_0x24c8ec=>_0x24c8ec[_0x15baaa(0x13b)]?.[_0x15baaa(0x17a)](_0x20e55f=>_0x3858d7[_0x15baaa(0x18c)](_0x20e55f[_0x15baaa(0x11a)]())));if(_0x5f3a47[_0x15baaa(0x133)]===0x0){console[_0x15baaa(0x16f)](a5_0x520e02['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1f8a46));const _0x1eaac1=new Set();return _0x295f96['tests'][_0x15baaa(0x18d)](_0x4eef19=>_0x4eef19[_0x15baaa(0x13b)]?.['forEach'](_0x1a4f99=>_0x1eaac1[_0x15baaa(0x179)](_0x1a4f99))),_0x1eaac1[_0x15baaa(0x128)]>0x0?console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x113)+[..._0x1eaac1][_0x15baaa(0x160)](',\x20'))):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x104))),0x1;}}if(_0x5adfe0)return this[_0x15baaa(0x157)](_0x458b71,{'definition':{'tests':_0x5f3a47},'agentInfo':_0x335965,'outputFormat':_0x38a244,'outputFile':_0xf6f1df,'testNames':_0x211384});if(_0x2e71f3){console['log'](a5_0x520e02[_0x15baaa(0x13c)](_0x15baaa(0x117))),console[_0x15baaa(0x16f)]('\x20\x20Site:\x20'+a5_0x520e02[_0x15baaa(0x177)](_0x565add)),console[_0x15baaa(0x16f)](_0x15baaa(0x185)+a5_0x520e02[_0x15baaa(0x177)](_0x335965[_0x15baaa(0x112)])),console[_0x15baaa(0x16f)](_0x15baaa(0x188)+a5_0x520e02['white'](_0x335965[_0x15baaa(0x132)])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15baaa(0x161)+a5_0x520e02[_0x15baaa(0x177)](_0x5f3a47[_0x15baaa(0x133)]));for(let _0x44fb3e=0x0;_0x44fb3e<_0x5f3a47[_0x15baaa(0x133)];_0x44fb3e++){const _0x391984=_0x5f3a47[_0x44fb3e],_0x1ea6cd=_0x391984[_0x15baaa(0x11b)][_0x15baaa(0x133)]===0x1?'round':'rounds',_0x5a45e5=_0x391984['tags']?.[_0x15baaa(0x133)]?'\x20['+_0x391984[_0x15baaa(0x13b)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x44fb3e+0x1)+'.\x20'+a5_0x520e02[_0x15baaa(0x177)](_0x391984[_0x15baaa(0x176)])+'\x20('+_0x391984['rounds'][_0x15baaa(0x133)]+'\x20'+_0x1ea6cd+')'+a5_0x520e02[_0x15baaa(0x142)](_0x5a45e5));}return 0x0;}let _0x189058,_0x5bcbd9;try{_0x189058=await _0x5a9f98[_0x15baaa(0x154)][_0x15baaa(0x12a)](_0x335965[_0x15baaa(0x112)]);}catch(_0x1baf2c){const _0x24e321=_0x1baf2c instanceof Error?_0x1baf2c[_0x15baaa(0x180)]:String(_0x1baf2c);return _0x24e321[_0x15baaa(0x18c)](_0x15baaa(0x118))||_0x24e321[_0x15baaa(0x11a)]()[_0x15baaa(0x18c)](_0x15baaa(0x14b))?console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x335965[_0x15baaa(0x112)])):console[_0x15baaa(0x16f)](a5_0x520e02['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x335965['projectName']+_0x15baaa(0x115)+_0x24e321)),0x1;}try{_0x5bcbd9=await _0x5a9f98[_0x15baaa(0x154)][_0x15baaa(0x175)](_0x335965[_0x15baaa(0x132)],_0x189058);}catch(_0x2f9c73){const _0xc8ef10=_0x2f9c73 instanceof Error?_0x2f9c73[_0x15baaa(0x180)]:String(_0x2f9c73);return _0xc8ef10[_0x15baaa(0x18c)](_0x15baaa(0x118))||_0xc8ef10['toLowerCase']()['includes'](_0x15baaa(0x14b))?console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x171)+_0x335965[_0x15baaa(0x132)])):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x335965[_0x15baaa(0x132)]+_0x15baaa(0x115)+_0xc8ef10)),0x1;}let _0x5f3355;if(!_0x48d092)try{_0x5f3355=await setupEvaluatorAgent(_0x5a9f98[_0x15baaa(0x154)],_0x19eaf8[_0x15baaa(0x13e)]);}catch(_0x459991){const _0x84e9a3=_0x459991 instanceof Error?_0x459991['message']:String(_0x459991);return console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x173)+_0x84e9a3)),0x1;}console['log'](a5_0x520e02[_0x15baaa(0x13c)](_0x15baaa(0x14f))),console['log'](_0x15baaa(0x127)+a5_0x520e02['white'](_0x565add)),console[_0x15baaa(0x16f)]('Agent:\x20'+a5_0x520e02[_0x15baaa(0x177)](_0x335965[_0x15baaa(0x112)]+'/'+_0x335965[_0x15baaa(0x132)])),console[_0x15baaa(0x16f)]();const _0x3c7204=[],_0x320600=[],_0x42109e=Date['now']();for(let _0x4440a1=0x0;_0x4440a1<_0x5f3a47[_0x15baaa(0x133)];_0x4440a1++){const _0x1028b7=_0x5f3a47[_0x4440a1];_0x5f3a47['length']>0x1?console['log'](_0x15baaa(0x192)+(_0x4440a1+0x1)+'/'+_0x5f3a47[_0x15baaa(0x133)]+':\x20'+a5_0x520e02['white'](_0x1028b7['name'])):console['log'](_0x15baaa(0x172)+a5_0x520e02[_0x15baaa(0x177)](_0x1028b7[_0x15baaa(0x176)]));const _0x149518=createCommandSpinner(_0x15baaa(0x122)+_0x1028b7[_0x15baaa(0x11b)][_0x15baaa(0x133)]+_0x15baaa(0x162));_0x149518[_0x15baaa(0x146)]();try{const {result:_0x1220a9,conversation:_0x4c83ff}=await runTest(_0x5a9f98[_0x15baaa(0x154)],_0x1028b7,{'agentId':_0x5bcbd9,'projectId':_0x189058,'site':_0x565add,'noEval':_0x48d092,'evaluatorId':_0x5f3355,'onRoundStart':(_0x3af214,_0x4e2a70)=>{const _0x46d4a8=_0x15baaa;_0x149518['text']=_0x46d4a8(0x134)+(_0x3af214+0x1)+'/'+_0x4e2a70+_0x46d4a8(0x162);},'onRoundComplete':(_0x29b574,_0x270ad8,_0x78b2d5)=>{const _0x2205ff=_0x15baaa,_0x3b3961=formatElapsed(_0x270ad8);_0x78b2d5?console[_0x2205ff(0x16f)](_0x2205ff(0x150)+(_0x29b574+0x1)+'/'+_0x1028b7[_0x2205ff(0x11b)][_0x2205ff(0x133)]+_0x2205ff(0x165)+a5_0x520e02[_0x2205ff(0x18f)]('✓')+'\x20('+_0x3b3961+')'):console[_0x2205ff(0x16f)]('\x20\x20Round\x20'+(_0x29b574+0x1)+'/'+_0x1028b7[_0x2205ff(0x11b)][_0x2205ff(0x133)]+_0x2205ff(0x165)+a5_0x520e02[_0x2205ff(0xfe)]('✗'));},'onEvaluationStart':()=>{const _0x368d57=_0x15baaa;_0x149518[_0x368d57(0x137)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5d0da0=>{const _0x16b096=formatElapsed(_0x5d0da0);console['log']('\x20\x20Evaluating...\x20'+a5_0x520e02['green']('✓')+'\x20('+_0x16b096+')');}});_0x149518[_0x15baaa(0x189)](),_0x3c7204['push'](_0x1220a9),_0x320600[_0x15baaa(0x110)](_0x4c83ff);if(_0x1220a9['status']==='PASS')console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x18f)](_0x15baaa(0x187)+_0x1220a9['reason']));else _0x1220a9[_0x15baaa(0x164)]==='FAIL'?console[_0x15baaa(0x16f)](a5_0x520e02['red'](_0x15baaa(0x163)+_0x1220a9[_0x15baaa(0x10e)])):console['log'](a5_0x520e02['red']('✗\x20ERROR:\x20'+_0x1220a9[_0x15baaa(0x10e)]));_0x1220a9['conversation_url']&&console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x156)+_0x1220a9[_0x15baaa(0x102)])),console[_0x15baaa(0x16f)]();}catch(_0x476e45){_0x149518[_0x15baaa(0x189)]();const _0x3fb406=_0x476e45 instanceof Error?_0x476e45[_0x15baaa(0x180)]:String(_0x476e45);console['log'](a5_0x520e02[_0x15baaa(0xfe)]('✗\x20ERROR:\x20'+_0x3fb406)),console[_0x15baaa(0x16f)](),_0x3c7204[_0x15baaa(0x110)]({'name':_0x1028b7['name'],'status':'ERROR','reason':_0x3fb406,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x573db7=Date[_0x15baaa(0x120)]()-_0x42109e,_0x2abbac=_0x3c7204[_0x15baaa(0x129)](_0x27cc1d=>_0x27cc1d[_0x15baaa(0x164)]===_0x15baaa(0x15b))[_0x15baaa(0x133)],_0x3f43aa=_0x3c7204[_0x15baaa(0x129)](_0x4baef3=>_0x4baef3[_0x15baaa(0x164)]===_0x15baaa(0x139))[_0x15baaa(0x133)],_0x25775e=_0x3c7204['filter'](_0x55e976=>_0x55e976[_0x15baaa(0x164)]===_0x15baaa(0x167))['length'];console['log']('━'[_0x15baaa(0x111)](0x3c)),console[_0x15baaa(0x16f)]('Test\x20Summary'),console[_0x15baaa(0x16f)]('━'[_0x15baaa(0x111)](0x3c)),console['log'](_0x15baaa(0x143)+_0x3c7204[_0x15baaa(0x133)]),console['log'](_0x15baaa(0x12c)+a5_0x520e02['green'](_0x2abbac)),console[_0x15baaa(0x16f)](_0x15baaa(0x149)+a5_0x520e02[_0x15baaa(0xfe)](_0x3f43aa));_0x25775e>0x0&&console[_0x15baaa(0x16f)](_0x15baaa(0x12e)+a5_0x520e02[_0x15baaa(0xfe)](_0x25775e));console[_0x15baaa(0x16f)](_0x15baaa(0x108)+formatElapsed(_0x573db7)),console[_0x15baaa(0x16f)]('━'['repeat'](0x3c));const _0x2dea29=_0x3c7204[_0x15baaa(0x129)](_0x3b5061=>_0x3b5061[_0x15baaa(0x164)]!==_0x15baaa(0x15b));if(_0x2dea29[_0x15baaa(0x133)]>0x0){console['log'](),console['log'](_0x15baaa(0x10a));for(const _0x279c41 of _0x2dea29){const _0x2db21c=a5_0x520e02[_0x15baaa(0xfe)]('✗'),_0x20c33e=_0x279c41[_0x15baaa(0x10e)][_0x15baaa(0x133)]>0x32?_0x279c41['reason'][_0x15baaa(0x178)](0x0,0x32)+_0x15baaa(0x16a):_0x279c41[_0x15baaa(0x10e)];console[_0x15baaa(0x16f)]('\x20\x20'+_0x2db21c+'\x20'+_0x279c41[_0x15baaa(0x176)]+':\x20'+_0x20c33e);}}const _0x1ae041={'summary':{'total':_0x3c7204[_0x15baaa(0x133)],'passed':_0x2abbac,'failed':_0x3f43aa,'errors':_0x25775e>0x0?_0x25775e:undefined,'duration_ms':_0x573db7},'tests':_0x3c7204,'agent':{'project':_0x335965['projectName'],'name':_0x335965[_0x15baaa(0x132)],'site':_0x565add},'timestamp':new Date(_0x42109e)[_0x15baaa(0x14e)]()};try{const _0xc595ef=buildCachedTestRun(_0x320600,{'site':_0x565add,'projectId':_0x189058,'projectName':_0x335965[_0x15baaa(0x112)],'agentId':_0x5bcbd9,'agentName':_0x335965[_0x15baaa(0x132)],'testYmlPath':a5_0x5d8849['resolve'](_0x335965[_0x15baaa(0x144)])});saveLastTestRun(_0xc595ef);}catch{}if(_0x38a244!==_0x15baaa(0x170)||_0xf6f1df){const _0x15d128=formatResults(_0x1ae041,_0x38a244);if(_0xf6f1df)try{a5_0x24e656[_0x15baaa(0x17d)](_0xf6f1df,_0x15d128,'utf-8'),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)]('Output\x20written\x20to:\x20'+_0xf6f1df));}catch(_0x568d26){return console[_0x15baaa(0x16f)](),console['log'](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x16e)+_0x568d26)),0x1;}else console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15d128);}return _0x2dea29[_0x15baaa(0x133)]>0x0?0x1:0x0;}async[a5_0x36a7fd(0x157)](_0x232fb5,_0x472431){const _0x4ff223=a5_0x36a7fd,{options:_0x1ca388,tdx:_0x3e84dc}=_0x232fb5,{definition:_0x24001d,agentInfo:_0x39f687,outputFormat:_0x2978c3,outputFile:_0x583723}=_0x472431,_0x20e3cb=_0x1ca388[_0x4ff223(0x168)],_0x36a0c0=loadLastTestRun();if(!_0x36a0c0)return console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x116))),console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x100))),0x1;if(_0x36a0c0[_0x4ff223(0x10d)][_0x4ff223(0x132)]!==_0x39f687[_0x4ff223(0x132)])return console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x36a0c0[_0x4ff223(0x10d)][_0x4ff223(0x132)]+_0x4ff223(0x130)+_0x39f687[_0x4ff223(0x132)]+'\x22.')),console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x191))),0x1;const _0x2db344=new Set(_0x36a0c0[_0x4ff223(0x10f)][_0x4ff223(0x17b)](_0x4f2465=>_0x4f2465[_0x4ff223(0x148)])),_0x46d49f=_0x24001d[_0x4ff223(0x10b)]['filter'](_0x33a563=>!_0x2db344['has'](_0x33a563[_0x4ff223(0x176)]));if(_0x46d49f[_0x4ff223(0x133)]>0x0&&_0x36a0c0[_0x4ff223(0x168)]!==_0x20e3cb)return console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x18a))),console[_0x4ff223(0x16f)](a5_0x520e02['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x36a0c0['site']+_0x4ff223(0x107)+_0x20e3cb+'\x22.')),console['log'](a5_0x520e02[_0x4ff223(0x142)]('Either\x20switch\x20to\x20the\x20\x22'+_0x36a0c0['site']+_0x4ff223(0x182))),0x1;const _0x5a81a7=_0x24001d['tests'][_0x4ff223(0x129)](_0x3fc48f=>_0x2db344[_0x4ff223(0x136)](_0x3fc48f['name'])),_0x130725=_0x46d49f;let _0x2d218a;try{_0x2d218a=await setupEvaluatorAgent(_0x3e84dc[_0x4ff223(0x154)],_0x1ca388[_0x4ff223(0x13e)]);}catch(_0xc96b8d){const _0x18659c=_0xc96b8d instanceof Error?_0xc96b8d[_0x4ff223(0x180)]:String(_0xc96b8d);return console[_0x4ff223(0x16f)](a5_0x520e02['red'](_0x4ff223(0x173)+_0x18659c)),0x1;}console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x13c)](_0x4ff223(0x151))),console[_0x4ff223(0x16f)](_0x4ff223(0x119)+a5_0x520e02[_0x4ff223(0x177)](_0x36a0c0[_0x4ff223(0x101)])),console['log'](_0x4ff223(0x15e)+a5_0x520e02[_0x4ff223(0x177)](_0x36a0c0['agent'][_0x4ff223(0x112)]+'/'+_0x36a0c0[_0x4ff223(0x10d)][_0x4ff223(0x132)]));_0x130725[_0x4ff223(0x133)]>0x0&&console['log'](_0x4ff223(0x16c)+a5_0x520e02['yellow'](_0x130725[_0x4ff223(0x133)]));console['log']();const _0x350a87=[],_0x174b21=Date[_0x4ff223(0x120)](),_0x13f0f3=createCommandSpinner('Re-evaluating...');if(_0x5a81a7[_0x4ff223(0x133)]>0x0)try{const _0xe6b6d6=await reevaluateFromCache(_0x3e84dc[_0x4ff223(0x154)],_0x36a0c0,{'tests':_0x5a81a7},{'evaluatorId':_0x2d218a,'onTestStart':(_0x377130,_0x1230aa,_0x2abc11)=>{const _0x16dd56=_0x4ff223;_0x13f0f3[_0x16dd56(0x137)]=_0x16dd56(0x141)+(_0x1230aa+0x1)+'/'+_0x2abc11+':\x20'+_0x377130+'...';if(!_0x13f0f3['isSpinning'])_0x13f0f3[_0x16dd56(0x146)]();},'onTestComplete':(_0x1cbfbb,_0x445905)=>{const _0x2c8247=_0x4ff223;_0x13f0f3[_0x2c8247(0x189)]();if(_0x445905[_0x2c8247(0x164)]===_0x2c8247(0x15b))console[_0x2c8247(0x16f)](a5_0x520e02[_0x2c8247(0x18f)](_0x2c8247(0x187)+_0x1cbfbb)+a5_0x520e02['dim'](_0x2c8247(0x121)));else _0x445905[_0x2c8247(0x164)]==='FAIL'?console['log'](a5_0x520e02[_0x2c8247(0xfe)](_0x2c8247(0x163)+_0x1cbfbb+'\x20-\x20'+_0x445905['reason'])+a5_0x520e02[_0x2c8247(0x142)]('\x20(cached)')):console[_0x2c8247(0x16f)](a5_0x520e02['red']('✗\x20ERROR:\x20'+_0x1cbfbb+_0x2c8247(0x181)+_0x445905[_0x2c8247(0x10e)]));_0x445905[_0x2c8247(0x102)]&&console['log'](a5_0x520e02[_0x2c8247(0x142)]('\x20\x20Conversation:\x20'+_0x445905['conversation_url'])),_0x350a87[_0x2c8247(0x110)](_0x445905);},'onTestSkipped':(_0x2cd7b0,_0x35dae9)=>{const _0x5ae3bc=_0x4ff223;_0x13f0f3[_0x5ae3bc(0x189)](),console[_0x5ae3bc(0x16f)](a5_0x520e02[_0x5ae3bc(0x12f)](_0x5ae3bc(0x14d)+_0x2cd7b0+_0x5ae3bc(0x181)+_0x35dae9));}});for(const _0x2ba575 of _0xe6b6d6){!_0x350a87[_0x4ff223(0x123)](_0x1829ad=>_0x1829ad[_0x4ff223(0x176)]===_0x2ba575[_0x4ff223(0x176)])&&_0x350a87['push'](_0x2ba575);}}catch(_0x589451){_0x13f0f3[_0x4ff223(0x189)]();const _0x8f9dc1=_0x589451 instanceof Error?_0x589451['message']:String(_0x589451);return console['log'](a5_0x520e02['red'](_0x4ff223(0x140)+_0x8f9dc1)),0x1;}_0x13f0f3[_0x4ff223(0x189)]();if(_0x130725[_0x4ff223(0x133)]>0x0){console[_0x4ff223(0x16f)](),console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x13c)]('Executing\x20new\x20tests...'));const {projectId:_0x501447,agentId:_0x43a7ac}=_0x36a0c0['agent'];for(const _0x3263b0 of _0x130725){console[_0x4ff223(0x16f)](_0x4ff223(0x18e)+a5_0x520e02[_0x4ff223(0x177)](_0x3263b0[_0x4ff223(0x176)]));const _0x1cb763=createCommandSpinner(_0x4ff223(0x122)+_0x3263b0[_0x4ff223(0x11b)][_0x4ff223(0x133)]+_0x4ff223(0x162));_0x1cb763[_0x4ff223(0x146)]();try{const {result:_0x51455c}=await runTest(_0x3e84dc[_0x4ff223(0x154)],_0x3263b0,{'agentId':_0x43a7ac,'projectId':_0x501447,'site':_0x36a0c0['site'],'noEval':![],'evaluatorId':_0x2d218a,'onRoundStart':(_0x4daf3f,_0x2a26aa)=>{const _0x48007f=_0x4ff223;_0x1cb763[_0x48007f(0x137)]='Round\x20'+(_0x4daf3f+0x1)+'/'+_0x2a26aa+_0x48007f(0x162);},'onRoundComplete':(_0x3e932b,_0x589c73,_0x55e81c)=>{const _0x43f815=_0x4ff223,_0x40db8e=formatElapsed(_0x589c73);_0x55e81c?console[_0x43f815(0x16f)](_0x43f815(0x150)+(_0x3e932b+0x1)+'/'+_0x3263b0[_0x43f815(0x11b)][_0x43f815(0x133)]+_0x43f815(0x165)+a5_0x520e02[_0x43f815(0x18f)]('✓')+'\x20('+_0x40db8e+')'):console[_0x43f815(0x16f)]('\x20\x20Round\x20'+(_0x3e932b+0x1)+'/'+_0x3263b0['rounds'][_0x43f815(0x133)]+_0x43f815(0x165)+a5_0x520e02[_0x43f815(0xfe)]('✗'));},'onEvaluationStart':()=>{const _0x4ffda6=_0x4ff223;_0x1cb763[_0x4ffda6(0x137)]=_0x4ffda6(0x174);},'onEvaluationComplete':_0x48e6cc=>{const _0x5d091b=_0x4ff223,_0x4a7e64=formatElapsed(_0x48e6cc);console[_0x5d091b(0x16f)]('\x20\x20Evaluating...\x20'+a5_0x520e02['green']('✓')+'\x20('+_0x4a7e64+')');}});_0x1cb763[_0x4ff223(0x189)](),_0x350a87[_0x4ff223(0x110)](_0x51455c);if(_0x51455c[_0x4ff223(0x164)]===_0x4ff223(0x15b))console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x18f)]('✓\x20PASS:\x20'+_0x51455c['reason'])+a5_0x520e02['dim'](_0x4ff223(0x193)));else _0x51455c[_0x4ff223(0x164)]==='FAIL'?console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x163)+_0x51455c[_0x4ff223(0x10e)])+a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x193))):console['log'](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x11c)+_0x51455c[_0x4ff223(0x10e)]));_0x51455c[_0x4ff223(0x102)]&&console['log'](a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x17c)+_0x51455c[_0x4ff223(0x102)]));}catch(_0x596ac6){_0x1cb763[_0x4ff223(0x189)]();const _0x21f881=_0x596ac6 instanceof Error?_0x596ac6[_0x4ff223(0x180)]:String(_0x596ac6);console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x11c)+_0x21f881)),_0x350a87[_0x4ff223(0x110)]({'name':_0x3263b0[_0x4ff223(0x176)],'status':'ERROR','reason':_0x21f881,'timestamp':new Date()[_0x4ff223(0x14e)](),'duration_ms':0x0});}}}console[_0x4ff223(0x16f)]();const _0x3692fc=Date[_0x4ff223(0x120)]()-_0x174b21,_0x417a89=_0x350a87[_0x4ff223(0x129)](_0x574bbe=>_0x574bbe[_0x4ff223(0x164)]===_0x4ff223(0x15b))['length'],_0xdaa0e9=_0x350a87[_0x4ff223(0x129)](_0x536baf=>_0x536baf[_0x4ff223(0x164)]===_0x4ff223(0x139))[_0x4ff223(0x133)],_0x3ebeee=_0x350a87['filter'](_0x365ab9=>_0x365ab9[_0x4ff223(0x164)]===_0x4ff223(0x167))[_0x4ff223(0x133)];console[_0x4ff223(0x16f)]('━'[_0x4ff223(0x111)](0x3c)),console[_0x4ff223(0x16f)](_0x4ff223(0x13d)),console[_0x4ff223(0x16f)]('━'['repeat'](0x3c)),console[_0x4ff223(0x16f)](_0x4ff223(0x143)+_0x350a87['length']),console['log'](_0x4ff223(0x12c)+a5_0x520e02[_0x4ff223(0x18f)](_0x417a89)),console[_0x4ff223(0x16f)]('Failed:\x20\x20\x20'+a5_0x520e02[_0x4ff223(0xfe)](_0xdaa0e9));_0x3ebeee>0x0&&console[_0x4ff223(0x16f)](_0x4ff223(0x12e)+a5_0x520e02[_0x4ff223(0xfe)](_0x3ebeee));console[_0x4ff223(0x16f)](_0x4ff223(0x108)+formatElapsed(_0x3692fc)),console[_0x4ff223(0x16f)]('━'['repeat'](0x3c));const _0x28790f={'summary':{'total':_0x350a87[_0x4ff223(0x133)],'passed':_0x417a89,'failed':_0xdaa0e9,'errors':_0x3ebeee>0x0?_0x3ebeee:undefined,'duration_ms':_0x3692fc},'tests':_0x350a87,'agent':{'project':_0x39f687['projectName'],'name':_0x39f687['agentName'],'site':_0x20e3cb},'timestamp':new Date(_0x174b21)[_0x4ff223(0x14e)]()};if(_0x2978c3!=='table'||_0x583723){const _0x349c62=formatResults(_0x28790f,_0x2978c3);if(_0x583723)try{a5_0x24e656[_0x4ff223(0x17d)](_0x583723,_0x349c62,_0x4ff223(0x186)),console[_0x4ff223(0x16f)](),console['log'](a5_0x520e02['dim'](_0x4ff223(0x126)+_0x583723));}catch(_0x9318d0){return console[_0x4ff223(0x16f)](),console['log'](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x16e)+_0x9318d0)),0x1;}else console[_0x4ff223(0x16f)](),console[_0x4ff223(0x16f)](_0x349c62);}const _0x34176c=_0x350a87[_0x4ff223(0x129)](_0x583d4f=>_0x583d4f['status']!=='PASS');return _0x34176c[_0x4ff223(0x133)]>0x0?0x1:0x0;}}function a5_0x33cc(){const _0x20d607=['toISOString','Running\x20agent\x20tests...','\x20\x20Round\x20','Re-evaluating\x20cached\x20test\x20run...','2656610AMMZgh','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','llm','basename','Conversation\x20URL:\x20','executeReeval','/<agent-name>','multiple_agents','existsSync','PASS','77ITQrUo','Run\x20tests\x20for\x20an\x20LLM\x20agent','Agent:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','join','Tests\x20found:\x20',':\x20Sending\x20user\x20input...','✗\x20FAIL:\x20','status','...\x20','jsonl','ERROR','site','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','...','\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)','New\x20tests\x20to\x20execute:\x20','llmProject','Error\x20writing\x20output\x20file:\x20','log','table','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Running\x20test:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Evaluating\x20response...','resolveAgentId','name','white','substring','add','some','map','\x20\x20Conversation:\x20','writeFileSync','\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','2396msKCCp','message','\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','eval','131ucDujr','\x20\x20Project:\x20','utf-8','✓\x20PASS:\x20','\x20\x20Agent:\x20','stop','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','dryRun','includes','forEach','Running:\x20','green','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Test\x20','\x20(new)','3169122gvtSXj','red','split','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','timestamp','conversation_url','output','No\x20tests\x20have\x20tags\x20defined.','3415vqQLbV','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22,\x20but\x20current\x20site\x20is\x20\x22','Duration:\x20','5735272yqFcdf','Failed\x20Tests:','tests','execute','agent','reason','conversations','push','repeat','projectName','Available\x20tags:\x20','31938GlHdai','\x22:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Test\x20Configuration:','404','Cached\x20run\x20from:\x20','toLowerCase','rounds','✗\x20ERROR:\x20','no_tests','projectDir','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','now','\x20(cached)','Round\x201/','find','\x20\x20-\x20','source','Output\x20written\x20to:\x20','Site:\x20','size','filter','resolveProjectId','json','Passed:\x20\x20\x20','tsv','Errors:\x20\x20\x20','yellow','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20','agentName','length','Round\x20','test.yml','has','text','11070432YIGSzU','FAIL','16690auuqEF','tags','cyan','Re-evaluation\x20Summary','verbose','1288OwqynJ','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Re-evaluating\x20','dim','Total:\x20\x20\x20\x20','testYmlPath','no_context','start','trim','testName','Failed:\x20\x20\x20','description','not\x20found','Available\x20tests:\x20','⚠\x20SKIPPED:\x20'];a5_0x33cc=function(){return _0x20d607;};return a5_0x33cc();}
|
|
1
|
+
const a5_0x1eeba6=a5_0x4f3a;(function(_0x19fc27,_0x1983ee){const _0x210449=a5_0x4f3a,_0x5e934f=_0x19fc27();while(!![]){try{const _0x3d5401=-parseInt(_0x210449(0x1de))/0x1+-parseInt(_0x210449(0x22e))/0x2+parseInt(_0x210449(0x218))/0x3+-parseInt(_0x210449(0x1bc))/0x4*(parseInt(_0x210449(0x20b))/0x5)+parseInt(_0x210449(0x20a))/0x6*(parseInt(_0x210449(0x1cb))/0x7)+parseInt(_0x210449(0x1bb))/0x8*(-parseInt(_0x210449(0x219))/0x9)+parseInt(_0x210449(0x24a))/0xa;if(_0x3d5401===_0x1983ee)break;else _0x5e934f['push'](_0x5e934f['shift']());}catch(_0x574884){_0x5e934f['push'](_0x5e934f['shift']());}}}(a5_0x5645,0xad794));import*as a5_0x11b47f from'node:fs';import*as a5_0x28d6f4 from'node:path';import a5_0x7e9951 from'chalk';import{BaseCommand}from'./command.js';function a5_0x5645(){const _0x2be640=['567721NmTekB','Conversation\x20URL:\x20','table','filter','conversation_url','Run\x20tests\x20for\x20an\x20LLM\x20agent','output','round','Output\x20written\x20to:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','jsonl','✗\x20ERROR:\x20','Test\x20Configuration:','agent:test','no_context','Project\x20path:\x20','agentDirs','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','New\x20tests\x20to\x20execute:\x20','has','\x20\x20-\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x201/','Executing\x20new\x20tests...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20(cached)','repeat','FAIL','\x20\x20Project:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','tags','Test\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Using\x20agent:\x20','✗\x20FAIL:\x20','map','Round\x20','\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)','timestamp','site','execute','rounds','1485948xlZMJZ','35QfvQHe','not\x20found','No\x20tests\x20found\x20with\x20tags:\x20','message','writeFileSync','\x27\x20to\x20create\x20the\x20folder\x20structure.','Re-evaluating...','multiple_agents','Running:\x20','projectDir','\x22:\x20','found','tests','256869LHgscP','288qjhSgo','forEach','log','join','Total:\x20\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','name','toLowerCase','red','Duration:\x20','isSpinning','executeReeval','includes','utf-8','testName','\x20-\x20','✓\x20PASS:\x20','size','\x20\x20Evaluating...\x20','...','404','1329940KPNmko','Either\x20switch\x20to\x20the\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_tests','some','Re-evaluation\x20Summary','llm','push','description','Failed\x20Tests:','ERROR','testYmlPath','dim','projectName','Errors:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','cyan','add',':\x20Sending\x20user\x20input...','text','resolveProjectId','...\x20','Tests\x20found:\x20','Agent:\x20','llmProject','toISOString','reason','green','35814560zRnfGj','agentName','eval','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Site:\x20','status','stop','270376sjRtuV','508568jXVOqt','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','context','start','source','resolveAgentId','dryRun','resolve','split','Passed:\x20\x20\x20','verbose','agent','Evaluating\x20response...','7GJicSH','length','substring','reeval','Error\x20writing\x20output\x20file:\x20','trim','basename','\x20\x20Conversation:\x20','⚠\x20SKIPPED:\x20','conversations','now','yellow','find','\x20\x20Agent:\x20','\x20\x20Round\x20','json','Available\x20tags:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','white'];a5_0x5645=function(){return _0x2be640;};return a5_0x5645();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x4f3a(_0x251af2,_0x200b02){_0x251af2=_0x251af2-0x1bb;const _0x56459f=a5_0x5645();let _0x4f3a26=_0x56459f[_0x251af2];return _0x4f3a26;}export class AgentTestCommand extends BaseCommand{[a5_0x1eeba6(0x21f)]=a5_0x1eeba6(0x1eb);[a5_0x1eeba6(0x236)]=a5_0x1eeba6(0x1e3);async[a5_0x1eeba6(0x208)](_0x4c842e){const _0x20b479=a5_0x1eeba6,{options:_0x235eeb,args:_0x4903c1,tdx:_0xfd7234}=_0x4c842e,_0x4a9771=_0x4903c1[0x0]||'.',_0x59078c=_0x235eeb[_0x20b479(0x1c4)],_0x3b1db6=_0x235eeb,_0x4f501b=_0x3b1db6[_0x20b479(0x24c)]===![],_0x1b57c6=_0x3b1db6[_0x20b479(0x1ce)],_0x1f6363=_0x3b1db6[_0x20b479(0x21f)],_0x5c81e3=_0x3b1db6[_0x20b479(0x1fe)],_0x1762d8=_0x235eeb[_0x20b479(0x207)],_0x373669=_0x3b1db6[_0x20b479(0x1e4)];if(_0x1b57c6&&_0x4f501b)return console['log'](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x23d))),0x1;let _0x1d5313='table';if(_0x3b1db6['json'])_0x1d5313=_0x20b479(0x1da);else{if(_0x3b1db6[_0x20b479(0x1e8)])_0x1d5313='jsonl';else{if(_0x3b1db6['tsv'])_0x1d5313='tsv';else{if(_0x3b1db6['table'])_0x1d5313=_0x20b479(0x1e0);}}}const _0x1eb7f=_0x3b1db6[_0x20b479(0x246)];let _0x561d8e=_0x4a9771;const _0x49dd35=a5_0x11b47f['existsSync'](_0x4a9771),_0x3347b2=_0x4a9771==='.';if(!_0x49dd35||_0x3347b2){const _0x53bcfe=resolveProjectFromContext(_0x4a9771,_0x1eb7f,{'requireFile':'test.yml'});if(_0x53bcfe[_0x20b479(0x216)])_0x561d8e=_0x53bcfe['projectDir'],_0x53bcfe[_0x20b479(0x1c2)]===_0x20b479(0x1c0)&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x201)+_0x561d8e));else switch(_0x53bcfe[_0x20b479(0x248)]){case _0x20b479(0x1ec):console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x53bcfe[_0x20b479(0x20e)])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x24e)),console['log'](_0x20b479(0x1bf)),console[_0x20b479(0x21b)](_0x20b479(0x205)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)](_0x53bcfe['message'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x1e7)+_0x53bcfe[_0x20b479(0x246)]+_0x20b479(0x210));return 0x1;case _0x20b479(0x212):{const _0xaf72fa=a5_0x28d6f4[_0x20b479(0x1d1)](_0x53bcfe[_0x20b479(0x214)]);console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x20b479(0x24d)+_0x53bcfe[_0x20b479(0x246)]+'\x22:'));for(const _0x3e4d35 of _0x53bcfe[_0x20b479(0x1ee)]){console[_0x20b479(0x21b)](_0x20b479(0x1f3)+_0x3e4d35);}return console['log'](),console[_0x20b479(0x21b)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0xaf72fa+'/<agent-name>'),0x1;}case _0x20b479(0x231):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x53bcfe[_0x20b479(0x246)]+'\x22.')),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1ed)+_0x53bcfe['projectDir'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x230));return 0x1;}}const {definition:_0x5b5439,agentInfo:_0x375398}=parseTestFile(_0x561d8e);let _0x6c2cc0=_0x5b5439[_0x20b479(0x217)];if(_0x1f6363){const _0x42a3a9=_0x1f6363[_0x20b479(0x1c6)](',')[_0x20b479(0x203)](_0x16bc93=>_0x16bc93[_0x20b479(0x1d0)]());_0x6c2cc0=_0x5b5439[_0x20b479(0x217)][_0x20b479(0x1e1)](_0x1ad3d2=>_0x42a3a9[_0x20b479(0x225)](_0x1ad3d2[_0x20b479(0x21f)]));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0)return console['log'](a5_0x7e9951['yellow'](_0x20b479(0x1ef)+_0x1f6363)),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)]('Available\x20tests:\x20'+_0x5b5439['tests'][_0x20b479(0x203)](_0x367c4b=>_0x367c4b[_0x20b479(0x21f)])[_0x20b479(0x21c)](',\x20'))),0x1;}if(_0x5c81e3){const _0x58dbf2=_0x5c81e3[_0x20b479(0x1c6)](',')['map'](_0x5fe8cc=>_0x5fe8cc['trim']()[_0x20b479(0x220)]());_0x6c2cc0=_0x6c2cc0[_0x20b479(0x1e1)](_0x7dab92=>_0x7dab92[_0x20b479(0x1fe)]?.[_0x20b479(0x232)](_0x501199=>_0x58dbf2[_0x20b479(0x225)](_0x501199[_0x20b479(0x220)]())));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0){console['log'](a5_0x7e9951[_0x20b479(0x1d6)](_0x20b479(0x20d)+_0x5c81e3));const _0x57fa00=new Set();return _0x5b5439[_0x20b479(0x217)][_0x20b479(0x21a)](_0x165a2a=>_0x165a2a[_0x20b479(0x1fe)]?.[_0x20b479(0x21a)](_0x2c541a=>_0x57fa00[_0x20b479(0x23f)](_0x2c541a))),_0x57fa00[_0x20b479(0x22a)]>0x0?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1db)+[..._0x57fa00][_0x20b479(0x21c)](',\x20'))):console[_0x20b479(0x21b)](a5_0x7e9951['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x1b57c6)return this[_0x20b479(0x224)](_0x4c842e,{'definition':{'tests':_0x6c2cc0},'agentInfo':_0x375398,'outputFormat':_0x1d5313,'outputFile':_0x373669,'testNames':_0x1f6363});if(_0x59078c){console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)](_0x20b479(0x1ea))),console[_0x20b479(0x21b)]('\x20\x20Site:\x20'+a5_0x7e9951['white'](_0x1762d8)),console['log'](_0x20b479(0x1fb)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)])),console[_0x20b479(0x21b)](_0x20b479(0x1d8)+a5_0x7e9951[_0x20b479(0x1dd)](_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x244)+a5_0x7e9951[_0x20b479(0x1dd)](_0x6c2cc0[_0x20b479(0x1cc)]));for(let _0x3bef6e=0x0;_0x3bef6e<_0x6c2cc0[_0x20b479(0x1cc)];_0x3bef6e++){const _0x1fa817=_0x6c2cc0[_0x3bef6e],_0x3a33cd=_0x1fa817['rounds'][_0x20b479(0x1cc)]===0x1?_0x20b479(0x1e5):_0x20b479(0x209),_0x474802=_0x1fa817['tags']?.[_0x20b479(0x1cc)]?'\x20['+_0x1fa817[_0x20b479(0x1fe)][_0x20b479(0x21c)](',\x20')+']':'';console[_0x20b479(0x21b)]('\x20\x20'+(_0x3bef6e+0x1)+'.\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x1fa817[_0x20b479(0x21f)])+'\x20('+_0x1fa817[_0x20b479(0x209)][_0x20b479(0x1cc)]+'\x20'+_0x3a33cd+')'+a5_0x7e9951[_0x20b479(0x23a)](_0x474802));}return 0x0;}let _0x25c749,_0x37c9c8;try{_0x25c749=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x242)](_0x375398[_0x20b479(0x23b)]);}catch(_0x55de34){const _0x2bdd44=_0x55de34 instanceof Error?_0x55de34[_0x20b479(0x20e)]:String(_0x55de34);return _0x2bdd44[_0x20b479(0x225)](_0x20b479(0x22d))||_0x2bdd44['toLowerCase']()[_0x20b479(0x225)](_0x20b479(0x20c))?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x375398[_0x20b479(0x23b)])):console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x1be)+_0x375398['projectName']+_0x20b479(0x215)+_0x2bdd44)),0x1;}try{_0x37c9c8=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x1c3)](_0x375398[_0x20b479(0x24b)],_0x25c749);}catch(_0x4a9979){const _0x51ceb2=_0x4a9979 instanceof Error?_0x4a9979['message']:String(_0x4a9979);return _0x51ceb2[_0x20b479(0x225)]('404')||_0x51ceb2[_0x20b479(0x220)]()[_0x20b479(0x225)]('not\x20found')?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1fc)+_0x375398[_0x20b479(0x24b)])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x375398['agentName']+_0x20b479(0x215)+_0x51ceb2)),0x1;}let _0x12fa7a;if(!_0x4f501b)try{_0x12fa7a=await setupEvaluatorAgent(_0xfd7234[_0x20b479(0x234)],_0x235eeb[_0x20b479(0x1c8)]);}catch(_0x133409){const _0x548037=_0x133409 instanceof Error?_0x133409[_0x20b479(0x20e)]:String(_0x133409);return console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1f0)+_0x548037)),0x1;}console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)]('Running\x20agent\x20tests...')),console[_0x20b479(0x21b)](_0x20b479(0x250)+a5_0x7e9951[_0x20b479(0x1dd)](_0x1762d8)),console[_0x20b479(0x21b)](_0x20b479(0x245)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)]+'/'+_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)]();const _0x4741b8=[],_0x143e71=[],_0x4d23b5=Date[_0x20b479(0x1d5)]();for(let _0xf7eb9c=0x0;_0xf7eb9c<_0x6c2cc0[_0x20b479(0x1cc)];_0xf7eb9c++){const _0x4055c2=_0x6c2cc0[_0xf7eb9c];_0x6c2cc0[_0x20b479(0x1cc)]>0x1?console[_0x20b479(0x21b)](_0x20b479(0x1ff)+(_0xf7eb9c+0x1)+'/'+_0x6c2cc0[_0x20b479(0x1cc)]+':\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)])):console[_0x20b479(0x21b)]('Running\x20test:\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)]));const _0x2666cf=createCommandSpinner(_0x20b479(0x1f5)+_0x4055c2[_0x20b479(0x209)][_0x20b479(0x1cc)]+_0x20b479(0x240));_0x2666cf[_0x20b479(0x1c1)]();try{const {result:_0x23d66d,conversation:_0x4dcf09}=await runTest(_0xfd7234[_0x20b479(0x234)],_0x4055c2,{'agentId':_0x37c9c8,'projectId':_0x25c749,'site':_0x1762d8,'noEval':_0x4f501b,'evaluatorId':_0x12fa7a,'onRoundStart':(_0x2141b9,_0x27da12)=>{const _0x4e7e7f=_0x20b479;_0x2666cf[_0x4e7e7f(0x241)]=_0x4e7e7f(0x204)+(_0x2141b9+0x1)+'/'+_0x27da12+_0x4e7e7f(0x240);},'onRoundComplete':(_0xd773e9,_0x4cecd4,_0x228b0f)=>{const _0x1763e9=_0x20b479,_0x1f01ef=formatElapsed(_0x4cecd4);_0x228b0f?console[_0x1763e9(0x21b)]('\x20\x20Round\x20'+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+'...\x20'+a5_0x7e9951['green']('✓')+'\x20('+_0x1f01ef+')'):console[_0x1763e9(0x21b)](_0x1763e9(0x1d9)+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+_0x1763e9(0x243)+a5_0x7e9951[_0x1763e9(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x11a60d=_0x20b479;_0x2666cf[_0x11a60d(0x241)]='Evaluating\x20response...';},'onEvaluationComplete':_0x530d79=>{const _0x2143ea=_0x20b479,_0x59fb31=formatElapsed(_0x530d79);console[_0x2143ea(0x21b)]('\x20\x20Evaluating...\x20'+a5_0x7e9951[_0x2143ea(0x249)]('✓')+'\x20('+_0x59fb31+')');}});_0x2666cf[_0x20b479(0x252)](),_0x4741b8[_0x20b479(0x235)](_0x23d66d),_0x143e71['push'](_0x4dcf09);if(_0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1bd))console[_0x20b479(0x21b)](a5_0x7e9951['green']('✓\x20PASS:\x20'+_0x23d66d[_0x20b479(0x248)]));else _0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1fa)?console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x202)+_0x23d66d['reason'])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1e9)+_0x23d66d['reason']));_0x23d66d[_0x20b479(0x1e2)]&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1df)+_0x23d66d[_0x20b479(0x1e2)])),console['log']();}catch(_0x3d09fb){_0x2666cf[_0x20b479(0x252)]();const _0x5cdc30=_0x3d09fb instanceof Error?_0x3d09fb[_0x20b479(0x20e)]:String(_0x3d09fb);console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20'+_0x5cdc30)),console[_0x20b479(0x21b)](),_0x4741b8['push']({'name':_0x4055c2['name'],'status':_0x20b479(0x238),'reason':_0x5cdc30,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x28776c=Date[_0x20b479(0x1d5)]()-_0x4d23b5,_0x379b21=_0x4741b8[_0x20b479(0x1e1)](_0x1fc965=>_0x1fc965[_0x20b479(0x251)]===_0x20b479(0x1bd))['length'],_0x34141b=_0x4741b8[_0x20b479(0x1e1)](_0x5edf62=>_0x5edf62[_0x20b479(0x251)]===_0x20b479(0x1fa))[_0x20b479(0x1cc)],_0x17ae92=_0x4741b8[_0x20b479(0x1e1)](_0x3a868f=>_0x3a868f[_0x20b479(0x251)]==='ERROR')[_0x20b479(0x1cc)];console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console['log']('Test\x20Summary'),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console[_0x20b479(0x21b)](_0x20b479(0x21d)+_0x4741b8[_0x20b479(0x1cc)]),console[_0x20b479(0x21b)](_0x20b479(0x1c7)+a5_0x7e9951[_0x20b479(0x249)](_0x379b21)),console[_0x20b479(0x21b)]('Failed:\x20\x20\x20'+a5_0x7e9951[_0x20b479(0x221)](_0x34141b));_0x17ae92>0x0&&console[_0x20b479(0x21b)]('Errors:\x20\x20\x20'+a5_0x7e9951['red'](_0x17ae92));console[_0x20b479(0x21b)](_0x20b479(0x222)+formatElapsed(_0x28776c)),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c));const _0x25dd57=_0x4741b8[_0x20b479(0x1e1)](_0x1cf4ba=>_0x1cf4ba[_0x20b479(0x251)]!==_0x20b479(0x1bd));if(_0x25dd57[_0x20b479(0x1cc)]>0x0){console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x237));for(const _0xab20ac of _0x25dd57){const _0x4abb02=a5_0x7e9951[_0x20b479(0x221)]('✗'),_0x2cb58d=_0xab20ac[_0x20b479(0x248)]['length']>0x32?_0xab20ac[_0x20b479(0x248)][_0x20b479(0x1cd)](0x0,0x32)+_0x20b479(0x22c):_0xab20ac[_0x20b479(0x248)];console[_0x20b479(0x21b)]('\x20\x20'+_0x4abb02+'\x20'+_0xab20ac['name']+':\x20'+_0x2cb58d);}}const _0x426451={'summary':{'total':_0x4741b8['length'],'passed':_0x379b21,'failed':_0x34141b,'errors':_0x17ae92>0x0?_0x17ae92:undefined,'duration_ms':_0x28776c},'tests':_0x4741b8,'agent':{'project':_0x375398[_0x20b479(0x23b)],'name':_0x375398[_0x20b479(0x24b)],'site':_0x1762d8},'timestamp':new Date(_0x4d23b5)['toISOString']()};try{const _0x14bd9b=buildCachedTestRun(_0x143e71,{'site':_0x1762d8,'projectId':_0x25c749,'projectName':_0x375398['projectName'],'agentId':_0x37c9c8,'agentName':_0x375398[_0x20b479(0x24b)],'testYmlPath':a5_0x28d6f4[_0x20b479(0x1c5)](_0x375398[_0x20b479(0x239)])});saveLastTestRun(_0x14bd9b);}catch{}if(_0x1d5313!==_0x20b479(0x1e0)||_0x373669){const _0x433b11=formatResults(_0x426451,_0x1d5313);if(_0x373669)try{a5_0x11b47f[_0x20b479(0x20f)](_0x373669,_0x433b11,_0x20b479(0x226)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1e6)+_0x373669));}catch(_0x4e6938){return console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('Error\x20writing\x20output\x20file:\x20'+_0x4e6938)),0x1;}else console['log'](),console['log'](_0x433b11);}return _0x25dd57[_0x20b479(0x1cc)]>0x0?0x1:0x0;}async[a5_0x1eeba6(0x224)](_0x5ec8ef,_0x147b40){const _0x4d1328=a5_0x1eeba6,{options:_0xdee4f4,tdx:_0x2634dc}=_0x5ec8ef,{definition:_0x37e42c,agentInfo:_0x2a6598,outputFormat:_0x4e711f,outputFile:_0x325a71}=_0x147b40,_0x1d42eb=_0xdee4f4[_0x4d1328(0x207)],_0x439fcd=loadLastTestRun();if(!_0x439fcd)return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1dc))),console[_0x4d1328(0x21b)](a5_0x7e9951['dim'](_0x4d1328(0x200))),0x1;if(_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]!==_0x2a6598['agentName'])return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]+_0x4d1328(0x1fd)+_0x2a6598[_0x4d1328(0x24b)]+'\x22.')),console['log'](a5_0x7e9951['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1c667d=new Set(_0x439fcd[_0x4d1328(0x1d4)][_0x4d1328(0x203)](_0x350825=>_0x350825[_0x4d1328(0x227)])),_0xd5ed56=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x4e21b5=>!_0x1c667d[_0x4d1328(0x1f2)](_0x4e21b5[_0x4d1328(0x21f)]));if(_0xd5ed56[_0x4d1328(0x1cc)]>0x0&&_0x439fcd['site']!==_0x1d42eb)return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x1f4)+_0x439fcd['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1d42eb+'\x22.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x22f)+_0x439fcd['site']+_0x4d1328(0x1f7))),0x1;const _0x2bf14e=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x1103c5=>_0x1c667d['has'](_0x1103c5[_0x4d1328(0x21f)])),_0x42b5e4=_0xd5ed56;let _0x350d4c;try{_0x350d4c=await setupEvaluatorAgent(_0x2634dc['llm'],_0xdee4f4[_0x4d1328(0x1c8)]);}catch(_0x3385db){const _0x37e3cf=_0x3385db instanceof Error?_0x3385db['message']:String(_0x3385db);return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1f0)+_0x37e3cf)),0x1;}console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x21e))),console['log']('Cached\x20run\x20from:\x20'+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x206)])),console[_0x4d1328(0x21b)](_0x4d1328(0x245)+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x23b)]+'/'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]));_0x42b5e4[_0x4d1328(0x1cc)]>0x0&&console[_0x4d1328(0x21b)](_0x4d1328(0x1f1)+a5_0x7e9951[_0x4d1328(0x1d6)](_0x42b5e4[_0x4d1328(0x1cc)]));console[_0x4d1328(0x21b)]();const _0x447816=[],_0x2f65b7=Date['now'](),_0x4a552f=createCommandSpinner(_0x4d1328(0x211));if(_0x2bf14e[_0x4d1328(0x1cc)]>0x0)try{const _0x59919f=await reevaluateFromCache(_0x2634dc[_0x4d1328(0x234)],_0x439fcd,{'tests':_0x2bf14e},{'evaluatorId':_0x350d4c,'onTestStart':(_0xec8c22,_0x289cba,_0x327488)=>{const _0x52cb01=_0x4d1328;_0x4a552f['text']='Re-evaluating\x20'+(_0x289cba+0x1)+'/'+_0x327488+':\x20'+_0xec8c22+'...';if(!_0x4a552f[_0x52cb01(0x223)])_0x4a552f['start']();},'onTestComplete':(_0x5e06be,_0x3575e7)=>{const _0x3b228d=_0x4d1328;_0x4a552f[_0x3b228d(0x252)]();if(_0x3575e7[_0x3b228d(0x251)]===_0x3b228d(0x1bd))console[_0x3b228d(0x21b)](a5_0x7e9951['green'](_0x3b228d(0x229)+_0x5e06be)+a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1f8)));else _0x3575e7[_0x3b228d(0x251)]==='FAIL'?console[_0x3b228d(0x21b)](a5_0x7e9951['red']('✗\x20FAIL:\x20'+_0x5e06be+_0x3b228d(0x228)+_0x3575e7['reason'])+a5_0x7e9951['dim'](_0x3b228d(0x1f8))):console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x221)](_0x3b228d(0x1e9)+_0x5e06be+_0x3b228d(0x228)+_0x3575e7[_0x3b228d(0x248)]));_0x3575e7[_0x3b228d(0x1e2)]&&console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1d2)+_0x3575e7[_0x3b228d(0x1e2)])),_0x447816['push'](_0x3575e7);},'onTestSkipped':(_0x2c20d8,_0x3c8895)=>{const _0x4f8625=_0x4d1328;_0x4a552f[_0x4f8625(0x252)](),console[_0x4f8625(0x21b)](a5_0x7e9951[_0x4f8625(0x1d6)](_0x4f8625(0x1d3)+_0x2c20d8+_0x4f8625(0x228)+_0x3c8895));}});for(const _0x272e9f of _0x59919f){!_0x447816[_0x4d1328(0x1d7)](_0x385c5c=>_0x385c5c[_0x4d1328(0x21f)]===_0x272e9f[_0x4d1328(0x21f)])&&_0x447816['push'](_0x272e9f);}}catch(_0x4856b1){_0x4a552f[_0x4d1328(0x252)]();const _0x13a177=_0x4856b1 instanceof Error?_0x4856b1[_0x4d1328(0x20e)]:String(_0x4856b1);return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x24f)+_0x13a177)),0x1;}_0x4a552f[_0x4d1328(0x252)]();if(_0x42b5e4['length']>0x0){console[_0x4d1328(0x21b)](),console['log'](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x1f6)));const {projectId:_0xca95c0,agentId:_0x56be0b}=_0x439fcd[_0x4d1328(0x1c9)];for(const _0x534016 of _0x42b5e4){console[_0x4d1328(0x21b)](_0x4d1328(0x213)+a5_0x7e9951['white'](_0x534016[_0x4d1328(0x21f)]));const _0xaff219=createCommandSpinner(_0x4d1328(0x1f5)+_0x534016[_0x4d1328(0x209)][_0x4d1328(0x1cc)]+_0x4d1328(0x240));_0xaff219[_0x4d1328(0x1c1)]();try{const {result:_0x346122}=await runTest(_0x2634dc['llm'],_0x534016,{'agentId':_0x56be0b,'projectId':_0xca95c0,'site':_0x439fcd[_0x4d1328(0x207)],'noEval':![],'evaluatorId':_0x350d4c,'onRoundStart':(_0xe20d2e,_0x314b5d)=>{const _0x363567=_0x4d1328;_0xaff219['text']=_0x363567(0x204)+(_0xe20d2e+0x1)+'/'+_0x314b5d+_0x363567(0x240);},'onRoundComplete':(_0x529a87,_0x1278c9,_0x4b0a8e)=>{const _0x27eca3=_0x4d1328,_0x3cddcd=formatElapsed(_0x1278c9);_0x4b0a8e?console[_0x27eca3(0x21b)](_0x27eca3(0x1d9)+(_0x529a87+0x1)+'/'+_0x534016[_0x27eca3(0x209)][_0x27eca3(0x1cc)]+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x249)]('✓')+'\x20('+_0x3cddcd+')'):console[_0x27eca3(0x21b)]('\x20\x20Round\x20'+(_0x529a87+0x1)+'/'+_0x534016['rounds']['length']+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x5870f8=_0x4d1328;_0xaff219[_0x5870f8(0x241)]=_0x5870f8(0x1ca);},'onEvaluationComplete':_0x3e2585=>{const _0x5f2f34=_0x4d1328,_0x3b3009=formatElapsed(_0x3e2585);console[_0x5f2f34(0x21b)](_0x5f2f34(0x22b)+a5_0x7e9951['green']('✓')+'\x20('+_0x3b3009+')');}});_0xaff219[_0x4d1328(0x252)](),_0x447816[_0x4d1328(0x235)](_0x346122);if(_0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1bd))console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x249)](_0x4d1328(0x229)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951[_0x4d1328(0x23a)]('\x20(new)'));else _0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1fa)?console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x202)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951['dim']('\x20(new)')):console['log'](a5_0x7e9951['red']('✗\x20ERROR:\x20'+_0x346122[_0x4d1328(0x248)]));_0x346122['conversation_url']&&console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('\x20\x20Conversation:\x20'+_0x346122[_0x4d1328(0x1e2)]));}catch(_0xcb19a7){_0xaff219[_0x4d1328(0x252)]();const _0x28c10d=_0xcb19a7 instanceof Error?_0xcb19a7[_0x4d1328(0x20e)]:String(_0xcb19a7);console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1e9)+_0x28c10d)),_0x447816[_0x4d1328(0x235)]({'name':_0x534016[_0x4d1328(0x21f)],'status':'ERROR','reason':_0x28c10d,'timestamp':new Date()[_0x4d1328(0x247)](),'duration_ms':0x0});}}}console['log']();const _0x89e063=Date[_0x4d1328(0x1d5)]()-_0x2f65b7,_0x55926b=_0x447816[_0x4d1328(0x1e1)](_0x4c6bc9=>_0x4c6bc9[_0x4d1328(0x251)]===_0x4d1328(0x1bd))['length'],_0x4cd68b=_0x447816[_0x4d1328(0x1e1)](_0xb53d3e=>_0xb53d3e[_0x4d1328(0x251)]===_0x4d1328(0x1fa))[_0x4d1328(0x1cc)],_0x557f24=_0x447816['filter'](_0x270645=>_0x270645['status']===_0x4d1328(0x238))[_0x4d1328(0x1cc)];console[_0x4d1328(0x21b)]('━'['repeat'](0x3c)),console[_0x4d1328(0x21b)](_0x4d1328(0x233)),console['log']('━'[_0x4d1328(0x1f9)](0x3c)),console[_0x4d1328(0x21b)]('Total:\x20\x20\x20\x20'+_0x447816[_0x4d1328(0x1cc)]),console['log'](_0x4d1328(0x1c7)+a5_0x7e9951['green'](_0x55926b)),console['log']('Failed:\x20\x20\x20'+a5_0x7e9951['red'](_0x4cd68b));_0x557f24>0x0&&console['log'](_0x4d1328(0x23c)+a5_0x7e9951[_0x4d1328(0x221)](_0x557f24));console['log'](_0x4d1328(0x222)+formatElapsed(_0x89e063)),console['log']('━'[_0x4d1328(0x1f9)](0x3c));const _0x4204c6={'summary':{'total':_0x447816[_0x4d1328(0x1cc)],'passed':_0x55926b,'failed':_0x4cd68b,'errors':_0x557f24>0x0?_0x557f24:undefined,'duration_ms':_0x89e063},'tests':_0x447816,'agent':{'project':_0x2a6598[_0x4d1328(0x23b)],'name':_0x2a6598[_0x4d1328(0x24b)],'site':_0x1d42eb},'timestamp':new Date(_0x2f65b7)[_0x4d1328(0x247)]()};if(_0x4e711f!==_0x4d1328(0x1e0)||_0x325a71){const _0x3facdb=formatResults(_0x4204c6,_0x4e711f);if(_0x325a71)try{a5_0x11b47f[_0x4d1328(0x20f)](_0x325a71,_0x3facdb,_0x4d1328(0x226)),console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('Output\x20written\x20to:\x20'+_0x325a71));}catch(_0x5841ab){return console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1cf)+_0x5841ab)),0x1;}else console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](_0x3facdb);}const _0x372df4=_0x447816[_0x4d1328(0x1e1)](_0x9f6cda=>_0x9f6cda[_0x4d1328(0x251)]!==_0x4d1328(0x1bd));return _0x372df4['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x28267b=a6_0xeb4d;(function(_0x221944,_0x537e5c){const _0x1d9659=a6_0xeb4d,_0x14f78c=_0x221944();while(!![]){try{const _0xc15141=-parseInt(_0x1d9659(0x1d6))/0x1*(parseInt(_0x1d9659(0x200))/0x2)+-parseInt(_0x1d9659(0x1d9))/0x3*(parseInt(_0x1d9659(0x1ca))/0x4)+parseInt(_0x1d9659(0x20a))/0x5*(parseInt(_0x1d9659(0x1cf))/0x6)+-parseInt(_0x1d9659(0x1f4))/0x7+parseInt(_0x1d9659(0x1c3))/0x8*(-parseInt(_0x1d9659(0x1f8))/0x9)+parseInt(_0x1d9659(0x1f0))/0xa*(-parseInt(_0x1d9659(0x1db))/0xb)+parseInt(_0x1d9659(0x1cc))/0xc;if(_0xc15141===_0x537e5c)break;else _0x14f78c['push'](_0x14f78c['shift']());}catch(_0x361981){_0x14f78c['push'](_0x14f78c['shift']());}}}(a6_0x77cc,0x357ba));function a6_0xeb4d(_0xdac4fd,_0x28645d){_0xdac4fd=_0xdac4fd-0x1c3;const _0x77cc5d=a6_0x77cc();let _0xeb4de0=_0x77cc5d[_0xdac4fd];return _0xeb4de0;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x28267b(0x1e0),a6_0x28267b(0x1e4),a6_0x28267b(0x1f5),'set-cookie','set-cookie2',a6_0x28267b(0x1f7),'x-auth-token',a6_0x28267b(0x1d2)]);function isSensitiveHeader(_0x2c5856){const _0x5bdea1=a6_0x28267b;return SENSITIVE_HEADERS['has'](_0x2c5856[_0x5bdea1(0x1e8)]());}function parseHeader(_0x202414){const _0x5d360f=a6_0x28267b,_0x25b43a=_0x202414[_0x5d360f(0x1dc)](':');if(_0x25b43a===-0x1)throw new Error(_0x5d360f(0x1c8)+_0x202414+_0x5d360f(0x1d4)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x494c70=_0x202414[_0x5d360f(0x1f9)](0x0,_0x25b43a)[_0x5d360f(0x1ea)](),_0x5638ad=_0x202414['substring'](_0x25b43a+0x1)[_0x5d360f(0x1ea)]();if(!_0x494c70)throw new Error(_0x5d360f(0x1d3)+_0x202414+'\x22');return[_0x494c70,_0x5638ad];}export class ApiCommand extends BaseCommand{[a6_0x28267b(0x205)]=a6_0x28267b(0x203);[a6_0x28267b(0x1d0)]=a6_0x28267b(0x1e6);[a6_0x28267b(0x1ed)](_0x54c8ed){const _0x506c88=a6_0x28267b,{args:_0x1fe732,options:_0x11d41c}=_0x54c8ed,_0x9be196=_0x11d41c;if(_0x1fe732['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x363d46=_0x1fe732[0x0];if(!_0x363d46['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x363d46;const _0x5d63ff=_0x9be196['data'],_0x29f59c=_0x9be196[_0x506c88(0x1de)];if(_0x5d63ff&&_0x29f59c)return _0x506c88(0x1e3);const _0x4c32bf=_0x9be196[_0x506c88(0x1f1)]||_0x506c88(0x1e1),_0xb94286=[_0x506c88(0x1e1),'POST',_0x506c88(0x1e9),'DELETE',_0x506c88(0x201)];if(!_0xb94286[_0x506c88(0x1e7)](_0x4c32bf['toUpperCase']()))return _0x506c88(0x1e2)+_0x4c32bf+_0x506c88(0x1eb)+_0xb94286[_0x506c88(0x1cb)](',\x20');const _0x3e566b=_0x9be196[_0x506c88(0x206)]||'td',_0x1bc3b7=['td',_0x506c88(0x1ec),_0x506c88(0x1ee),_0x506c88(0x1fc),_0x506c88(0x1fa),_0x506c88(0x1df),'cas'];if(!_0x1bc3b7[_0x506c88(0x1e7)](_0x3e566b))return _0x506c88(0x1c9)+_0x3e566b+_0x506c88(0x1c7)+_0x1bc3b7[_0x506c88(0x1cb)](',\x20');return undefined;}async[a6_0x28267b(0x207)](_0x3d60ec){const _0x378147=a6_0x28267b,{options:_0x1df3f3,args:_0x467100,tdx:_0x35ee08}=_0x3d60ec,_0x27c79a=_0x1df3f3,_0xf51a91=_0x467100[0x0],_0x4a2857=(_0x27c79a[_0x378147(0x1f1)]||_0x378147(0x1e1))[_0x378147(0x1f6)](),_0x31b7a7=_0x27c79a[_0x378147(0x1d7)],_0x50c5b1=_0x27c79a[_0x378147(0x1de)],_0x49bf0c=_0x27c79a[_0x378147(0x204)],_0x580aca=_0x27c79a['type']||'td';try{const _0x3b01ce={};if(_0x49bf0c){const _0x3319b3=Array[_0x378147(0x1ce)](_0x49bf0c)?_0x49bf0c:[_0x49bf0c];for(const _0x9ab822 of _0x3319b3){const [_0x334a55,_0x2a11f0]=parseHeader(_0x9ab822);_0x3b01ce[_0x334a55]=_0x2a11f0;}}let _0xaf8816;if(_0x31b7a7)_0xaf8816=_0x31b7a7;else{if(_0x50c5b1)try{_0xaf8816=RawAPI[_0x378147(0x1fd)](_0x50c5b1);}catch(_0x19c070){return console['error'](_0x378147(0x1da)+(_0x19c070 instanceof Error?_0x19c070[_0x378147(0x1f3)]:String(_0x19c070))),0x1;}}const _0x532942={'method':_0x4a2857,'apiType':_0x580aca,'includeHeaders':_0x1df3f3[_0x378147(0x1f2)]};_0xaf8816&&(_0x532942[_0x378147(0x1d8)]=_0xaf8816);Object[_0x378147(0x1dd)](_0x3b01ce)[_0x378147(0x1d5)]>0x0&&(_0x532942[_0x378147(0x209)]=_0x3b01ce);if(_0x1df3f3['verbose']){const _0x52d312=resolveSite(_0x1df3f3['site']??_0x378147(0x1fb)),_0x9536bc=getEndpoint(_0x52d312,_0x580aca),_0x9d978f=''+_0x9536bc+_0xf51a91;console[_0x378147(0x1c5)]('>\x20'+_0x4a2857+'\x20'+_0x9d978f);const _0x5ea8b2=getAuthHeaders(_0x52d312),_0x314637={..._0x5ea8b2,..._0x3b01ce};for(const [_0x3b430a,_0x3a1050]of Object['entries'](_0x314637)){!isSensitiveHeader(_0x3b430a)&&console[_0x378147(0x1c5)]('>\x20'+_0x3b430a+':\x20'+_0x3a1050);}_0xaf8816&&console[_0x378147(0x1c5)]('>'),console[_0x378147(0x1c5)]('');}const _0xddaa37=await _0x35ee08[_0x378147(0x203)][_0x378147(0x202)](_0xf51a91,_0x532942);if(_0x1df3f3[_0x378147(0x1f2)]&&_0xddaa37[_0x378147(0x209)]){console[_0x378147(0x1c5)]('<\x20HTTP/1.1\x20'+_0xddaa37[_0x378147(0x1ff)]);for(const [_0xbf1d5,_0x5aa252]of Object[_0x378147(0x1d1)](_0xddaa37[_0x378147(0x209)])){!isSensitiveHeader(_0xbf1d5)&&console[_0x378147(0x1c5)]('<\x20'+_0xbf1d5+':\x20'+_0x5aa252);}console['error']('');}const _0x4fbc70=Boolean(_0x1df3f3['output']),_0x627ee6={'color':_0x1df3f3[_0x378147(0x208)],'noColor':_0x1df3f3[_0x378147(0x1c4)]||_0x4fbc70&&!_0x1df3f3['color']},_0x1d5748=colorizeJSON(_0xddaa37[_0x378147(0x1d7)],_0x627ee6);return _0x1df3f3[_0x378147(0x1fe)]?(writeFileSync(_0x1df3f3[_0x378147(0x1fe)],_0x1d5748),console[_0x378147(0x1c5)](_0x378147(0x1ef)+_0x1df3f3[_0x378147(0x1fe)])):console[_0x378147(0x1cd)](_0x1d5748),0x0;}catch(_0x2d5d86){return _0x2d5d86 instanceof Error?(console['error'](_0x378147(0x1da)+_0x2d5d86[_0x378147(0x1f3)]),_0x1df3f3['verbose']&&_0x2d5d86['stack']&&console['error'](_0x378147(0x1c6)+_0x2d5d86[_0x378147(0x1e5)])):console[_0x378147(0x1c5)](_0x378147(0x1da)+String(_0x2d5d86)),0x1;}}}function a6_0x77cc(){const _0x323479=['stack','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','includes','toLowerCase','PUT','trim','.\x20Valid\x20methods:\x20','cdp','validate','workflow','Results\x20saved\x20to\x20','4330bzLAYN','method','verbose','message','485961VJnKrO','cookie','toUpperCase','x-xsrf-token','39843XHofKI','substring','llm','us01','trino','readBodyFromFile','output','status','20666mKAOrR','PATCH','request','api','header','name','type','execute','color','headers','873995ZUrFhF','632AGvCpt','noColor','error','\x0aStack\x20trace:\x0a','.\x20Valid\x20types:\x20','Invalid\x20header\x20format:\x20\x22','Invalid\x20API\x20type:\x20','683772shjkap','join','11819340twoyVW','log','isArray','6BekWAc','description','entries','x-trino-user','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x22.\x20','length','1gQqIOf','data','body','6AdFvyB','Error:\x20','4301DArYDq','indexOf','keys','file','llm-proxy','authorization','GET','Invalid\x20HTTP\x20method:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','proxy-authorization'];a6_0x77cc=function(){return _0x323479;};return a6_0x77cc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x2f4c21=a7_0x1a61;(function(_0x54a1fb,_0x3f5d39){const _0x183681=a7_0x1a61,_0x319669=_0x54a1fb();while(!![]){try{const _0x489be0=-parseInt(_0x183681(0x210))/0x1*(parseInt(_0x183681(0x200))/0x2)+parseInt(_0x183681(0x20d))/0x3+parseInt(_0x183681(0x22d))/0x4+parseInt(_0x183681(0x213))/0x5+parseInt(_0x183681(0x1eb))/0x6*(parseInt(_0x183681(0x20c))/0x7)+parseInt(_0x183681(0x1fa))/0x8+-parseInt(_0x183681(0x21a))/0x9*(parseInt(_0x183681(0x212))/0xa);if(_0x489be0===_0x3f5d39)break;else _0x319669['push'](_0x319669['shift']());}catch(_0x4d50d8){_0x319669['push'](_0x319669['shift']());}}}(a7_0x5a9b,0x1c3ec));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x5a9b(){const _0x1fb706=['Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','bold','trim','error','jobs','9WKQIHE','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','API\x20key\x20cannot\x20be\x20empty','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','✗\x20Validation\x20failed:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','yellow','\x0aSetup\x20cancelled','message','create','/app/mp/ak','OAuth\x20tokens','accountName','first_name','profile','Opening\x20browser\x20for\x20authentication...','Name:\x20','✓\x20Authentication\x20successful\x0a','827532atfqxu','text','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Remove\x20API\x20key\x20from\x20system\x20keychain','For\x20scripts\x20or\x20headless\x20servers','API\x20key','✓\x20Default\x20site\x20set\x20to\x20','\x20(site:\x20','logLevel','apiKey','\x20and\x20','\x20--profile\x20','join','\x27\x20registered','name','\x20(profile:\x20','Print\x20the\x20current\x20OAuth\x20access\x20token','tdx:\x20auth\x20clear','status','N/A','red','No\x20credential\x20found','Choose\x20how\x20to\x20sign\x20in:','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','✓\x20Profile\x20\x27','description','ERROR','tdx:\x20auth\x20setup','No\x20credentials\x20found\x20in\x20keychain','Use\x20an\x20API\x20key','Setup\x20cancelled','tdx\x20profile:\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','312084PoExRs','\x20\x20user_id:','\x20for\x20profile:\x20','Validating\x20API\x20key...','\x20\x20tdx','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','method','log','Credential\x20type:\x20OAuth','auth:token','Enter\x20your\x20TD\x20API\x20key:','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','getUserInfo','✓\x20Signed\x20in\x20successfully','1616936WNZOuJ','/oauth/authorize','auth:clear','filter','Validating\x20OAuth\x20tokens...','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','23062SltZnL','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','all','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','execute','last_name','site','dim','auth:setup','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','email','7zzxHlf','356421rVqBti','password','oauth','11nONDuH','account_id','4863400nPdHai','745260xUNmJq','warn'];a7_0x5a9b=function(){return _0x1fb706;};return a7_0x5a9b();}import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x1a61(_0x19fd1c,_0x51e06e){_0x19fd1c=_0x19fd1c-0x1db;const _0x5a9b0d=a7_0x5a9b();let _0x1a61d4=_0x5a9b0d[_0x19fd1c];return _0x1a61d4;}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x484d36 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_0x58010c from'chalk';export async function runOAuthLoginFlow(_0x5071b6,_0x4d497f,_0xa8a82c,_0x5c34db){const _0x2df7ec=a7_0x1a61,_0x4bf3da=await isKeychainAvailable();if(!_0x4bf3da)throw new Error(_0x2df7ec(0x22f)+_0x2df7ec(0x20a));let _0x413386=_0x5c34db?.[_0x2df7ec(0x227)];if(!_0x413386){const _0x4d72ab=await a7_0x484d36({'type':_0x2df7ec(0x22e),'name':_0x2df7ec(0x227),'message':_0x2df7ec(0x215)});if(_0x4d72ab[_0x2df7ec(0x227)]===undefined)throw new Error(_0x2df7ec(0x1e8));_0x413386=_0x4d72ab[_0x2df7ec(0x227)][_0x2df7ec(0x217)]()||undefined;}const _0x40da0b=getConsoleUrl(_0x5071b6);console[_0x2df7ec(0x1f2)](_0x2df7ec(0x22a));_0x413386?console[_0x2df7ec(0x1f2)]('\x20\x20'+_0x40da0b+'/users/initiate_sso\x20(account:\x20'+_0x413386+')'):console[_0x2df7ec(0x1f2)]('\x20\x20'+_0x40da0b+_0x2df7ec(0x1fb));console[_0x2df7ec(0x1f2)](_0x2df7ec(0x230));const _0x5bf498=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x447f09=await startOAuthFlow(_0x5071b6,{'accountName':_0x413386,'proxy':_0x5bf498});console[_0x2df7ec(0x1f2)](_0x2df7ec(0x1fe));const _0x5b27f6=TDX[_0x2df7ec(0x224)]({'site':_0x5071b6,'accessToken':_0x447f09['access_token'],'logLevel':_0xa8a82c??LogLevel[_0x2df7ec(0x1e4)]}),_0x20bd8b=await _0x5b27f6[_0x2df7ec(0x219)]['getUserInfo']();console[_0x2df7ec(0x1f2)](a7_0x58010c['green'](_0x2df7ec(0x1f9))),console[_0x2df7ec(0x1f2)]('\x20\x20'+a7_0x58010c['cyan'](_0x5071b6+':'+_0x20bd8b[_0x2df7ec(0x211)])+_0x2df7ec(0x1ec)+_0x20bd8b['id']+'\x20\x20('+_0x20bd8b[_0x2df7ec(0x20b)]+')');!_0x413386&&(console[_0x2df7ec(0x1f2)](a7_0x58010c[_0x2df7ec(0x207)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x2df7ec(0x1f2)](a7_0x58010c['dim'](_0x2df7ec(0x21c))),console[_0x2df7ec(0x1f2)](a7_0x58010c[_0x2df7ec(0x207)](_0x2df7ec(0x1ea))));await saveOAuthTokens(_0x447f09,_0x4d497f),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x1e1)+(_0x4d497f?_0x2df7ec(0x23d)+_0x4d497f+')':''));if(_0x4d497f){const _0x5a3174={'site':_0x5071b6};saveProfileToUserConfig(_0x4d497f,_0x5a3174),console[_0x2df7ec(0x1f2)]('✓\x20Profile\x20\x27'+_0x4d497f+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x5071b6),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x234)+_0x5071b6);const _0x29a225=_0x4d497f?_0x2df7ec(0x239)+_0x4d497f:'';console[_0x2df7ec(0x1f2)](),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x220)),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x1ef)+_0x29a225+_0x2df7ec(0x203)),console['log'](_0x2df7ec(0x1ef)+_0x29a225+_0x2df7ec(0x201));}export async function promptAuthMethod(){const _0x3bc00d=a7_0x1a61,_0x213303=await a7_0x484d36({'type':'select','name':_0x3bc00d(0x1f1),'message':_0x3bc00d(0x1e0),'choices':[{'title':_0x3bc00d(0x209),'description':_0x3bc00d(0x21e),'value':_0x3bc00d(0x20f)},{'title':_0x3bc00d(0x1e7),'description':_0x3bc00d(0x232),'value':'apikey'}]});return _0x213303[_0x3bc00d(0x1f1)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x2f4c21(0x23c)]=a7_0x2f4c21(0x208);[a7_0x2f4c21(0x1e3)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x44ed12){const _0x1af374=a7_0x2f4c21,{options:_0x4eecf2}=_0x44ed12,_0x403317=_0x4eecf2[_0x1af374(0x229)];console[_0x1af374(0x1f2)](a7_0x58010c[_0x1af374(0x216)](_0x1af374(0x1e5)));const _0x52f828=_0x4eecf2[_0x1af374(0x206)]||'us01',_0x2c9234=await promptSiteSelection(_0x52f828,_0x403317,_0x1af374(0x1e8));if(!_0x2c9234)return 0x1;const _0x471b83=resolveSite(_0x2c9234),_0x2299ae=await promptAuthMethod();if(!_0x2299ae)return console[_0x1af374(0x1f2)](_0x1af374(0x222)),0x1;if(_0x2299ae===_0x1af374(0x20f)){const {accountName:_0x3dab90}=_0x4eecf2;return await runOAuthLoginFlow(_0x471b83,_0x403317,_0x4eecf2[_0x1af374(0x236)]??LogLevel[_0x1af374(0x1e4)],{'accountName':_0x3dab90}),0x0;}console[_0x1af374(0x1f2)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x471b83),console[_0x1af374(0x1f2)](_0x1af374(0x1f6)),console[_0x1af374(0x1f2)]('\x20\x20'+getConsoleUrl(_0x471b83,_0x1af374(0x225)));const _0x51587d=await a7_0x484d36({'type':_0x1af374(0x20e),'name':'apiKey','message':_0x1af374(0x1f5),'validate':_0x28776f=>{const _0x3f22f0=_0x1af374;if(!_0x28776f||!_0x28776f[_0x3f22f0(0x217)]())return _0x3f22f0(0x21d);return!![];}});if(!_0x51587d[_0x1af374(0x237)])return console['log'](_0x1af374(0x222)),0x1;const _0x3f94d1=_0x51587d[_0x1af374(0x237)];console[_0x1af374(0x1f2)](_0x1af374(0x1ee));try{const _0x26c3c9=TDX[_0x1af374(0x224)]({'site':_0x471b83,'apiKey':_0x3f94d1[_0x1af374(0x217)](),'logLevel':_0x4eecf2[_0x1af374(0x236)]??LogLevel['ERROR']}),_0x120fc3=await _0x26c3c9['jobs']['getUserInfo']();console[_0x1af374(0x1f2)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x120fc3[_0x1af374(0x20b)]+')');const _0x2be9a4=await isKeychainAvailable();_0x2be9a4?(await saveAPIKeyAsync(_0x3f94d1[_0x1af374(0x217)](),_0x471b83,_0x403317),console[_0x1af374(0x1f2)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x403317?'\x20(profile:\x20'+_0x403317+')':''))):(console['warn'](a7_0x58010c[_0x1af374(0x221)](_0x1af374(0x1f0))),console[_0x1af374(0x214)](a7_0x58010c['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x403317){const _0x54d996={'site':_0x471b83};saveProfileToUserConfig(_0x403317,_0x54d996),console[_0x1af374(0x1f2)](_0x1af374(0x1e2)+_0x403317+_0x1af374(0x23b));}else saveDefaultSiteToUserConfig(_0x471b83),console[_0x1af374(0x1f2)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x471b83);const _0x4cbd4b=_0x403317?'\x20--profile\x20'+_0x403317:'';return console[_0x1af374(0x1f2)](),console[_0x1af374(0x1f2)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x1af374(0x1ef)+_0x4cbd4b+_0x1af374(0x203)),console['log']('\x20\x20tdx'+_0x4cbd4b+_0x1af374(0x201)),0x0;}catch(_0x548073){if(_0x548073 instanceof HTTPClientError&&_0x548073[_0x1af374(0x1dc)]===0x191)return printAuthError(_0x548073),0x1;return console[_0x1af374(0x218)](a7_0x58010c[_0x1af374(0x1de)](_0x1af374(0x21f)+(_0x548073 instanceof Error?_0x548073[_0x1af374(0x223)]:String(_0x548073)))),console[_0x1af374(0x218)](_0x1af374(0x21b)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x2f4c21(0x1f7);[a7_0x2f4c21(0x1e3)]=a7_0x2f4c21(0x1ff);async[a7_0x2f4c21(0x204)](_0x11b45d){const _0xf253d3=a7_0x2f4c21,{options:_0x4103ae,tdx:_0x39019f}=_0x11b45d,_0x3ad28c=_0x4103ae[_0xf253d3(0x206)],_0x321640=_0x4103ae[_0xf253d3(0x229)],_0x3a707b=_0x321640?_0x321640:_0xf253d3(0x1dd);console[_0xf253d3(0x1f2)](_0xf253d3(0x1e9)+_0x3a707b+_0xf253d3(0x235)+_0x3ad28c+')');const _0x26ded3=await getOAuthTokens(_0x321640);if(_0x26ded3)console[_0xf253d3(0x1f2)](_0xf253d3(0x1f3)),console['log']('Read\x20credential\x20from\x20keychain'+(_0x321640?'\x20(profile:\x20'+_0x321640+')':''));else{const _0x2c1ce6=await resolveAPIKeyAsync(_0x3ad28c,_0x321640);if(_0x2c1ce6){const {source:_0x4f22ea,isDeprecated:_0x39717d}=_0x2c1ce6,_0x21d3d7='Read\x20credential\x20from\x20'+_0x4f22ea;console[_0xf253d3(0x1f2)](_0x39717d?a7_0x58010c[_0xf253d3(0x221)](_0x21d3d7):_0x21d3d7);}else console['log'](a7_0x58010c[_0xf253d3(0x221)](_0xf253d3(0x1df)));}try{const _0x14a0eb=await _0x39019f[_0xf253d3(0x219)][_0xf253d3(0x1f8)]();return console[_0xf253d3(0x1f2)](a7_0x58010c['green'](_0xf253d3(0x22c))),console[_0xf253d3(0x1f2)]('User:\x20'+_0x14a0eb['email']),(_0x14a0eb[_0xf253d3(0x228)]||_0x14a0eb[_0xf253d3(0x205)])&&console[_0xf253d3(0x1f2)](_0xf253d3(0x22b)+[_0x14a0eb['first_name'],_0x14a0eb[_0xf253d3(0x205)]][_0xf253d3(0x1fd)](Boolean)[_0xf253d3(0x23a)]('\x20')),0x0;}catch(_0x1b4907){return _0x1b4907 instanceof HTTPClientError&&_0x1b4907[_0xf253d3(0x1dc)]===0x191?printAuthError(_0x1b4907,!![],_0x321640):console[_0xf253d3(0x218)](a7_0x58010c[_0xf253d3(0x1de)](_0xf253d3(0x21f)+(_0x1b4907 instanceof Error?_0x1b4907[_0xf253d3(0x223)]:String(_0x1b4907)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x2f4c21(0x23c)]=a7_0x2f4c21(0x1f4);[a7_0x2f4c21(0x1e3)]=a7_0x2f4c21(0x23e);async[a7_0x2f4c21(0x204)](_0x71a947){const _0xcc864e=a7_0x2f4c21,{options:_0x1d7197}=_0x71a947,_0xa67c10=await resolveOAuthAccessToken({'site':resolveSite(_0x1d7197[_0xcc864e(0x206)]||'us01'),'profile':_0x1d7197[_0xcc864e(0x229)],'proxy':loadGlobalProxy()});return console[_0xcc864e(0x1f2)](_0xa67c10),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x2f4c21(0x23c)]=a7_0x2f4c21(0x1fc);[a7_0x2f4c21(0x1e3)]=a7_0x2f4c21(0x231);async['execute'](_0x4f83a1){const _0x48fcfe=a7_0x2f4c21,{options:_0x3b29e9}=_0x4f83a1,_0x4a2a1a=_0x3b29e9[_0x48fcfe(0x229)];console[_0x48fcfe(0x1f2)](a7_0x58010c[_0x48fcfe(0x216)](_0x48fcfe(0x1db)));const _0x58e960=await isKeychainAvailable();if(!_0x58e960)return console['error'](a7_0x58010c[_0x48fcfe(0x1de)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x2a0e0a,_0x145f99]=await Promise[_0x48fcfe(0x202)]([deleteKeychainAPIKey(_0x4a2a1a),deleteOAuthTokens(_0x4a2a1a)]);if(_0x2a0e0a||_0x145f99){clearCredentialCache();const _0xea648=[_0x2a0e0a&&_0x48fcfe(0x233),_0x145f99&&_0x48fcfe(0x226)]['filter'](Boolean)[_0x48fcfe(0x23a)](_0x48fcfe(0x238));return console[_0x48fcfe(0x1f2)]('✓\x20'+_0xea648+'\x20removed\x20from\x20keychain'+(_0x4a2a1a?'\x20(profile:\x20'+_0x4a2a1a+')':'')),0x0;}else return console[_0x48fcfe(0x1f2)](_0x48fcfe(0x1e6)+(_0x4a2a1a?_0x48fcfe(0x1ed)+_0x4a2a1a:'')),0x1;}}
|
|
1
|
+
function a7_0x1b6b(){const _0x11edb5=['\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x27\x20registered','profile','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','apiKey','message','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx:\x20auth\x20clear','2544230TvAkoP','logLevel','auth:setup','jobs','/app/mp/ak','\x20\x20tdx','us01','all','You\x20can\x20find\x20your\x20API\x20key\x20at:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','getUserInfo','Name:\x20','cyan','yellow','29577eimzGC','red','No\x20credential\x20found','/users/initiate_sso\x20(account:\x20','\x20and\x20','Opening\x20browser\x20for\x20authentication...','\x20(profile:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20user_id:','auth','✓\x20Profile\x20\x27','select','Use\x20an\x20API\x20key','bold','537345YGCAdj','Choose\x20how\x20to\x20sign\x20in:','auth:clear','error','For\x20scripts\x20or\x20headless\x20servers','Validating\x20API\x20key...','method','2996040Fazytf','Validating\x20OAuth\x20tokens...','User:\x20','Setup\x20cancelled','password','first_name','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','last_name','System\x20keychain\x20is\x20not\x20available','/oauth/authorize','Print\x20the\x20current\x20OAuth\x20access\x20token','No\x20credentials\x20found\x20in\x20keychain','email','Credential\x20type:\x20OAuth','API\x20key\x20cannot\x20be\x20empty','OAuth\x20tokens','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20--profile\x20','oauth','name','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','execute','tdx:\x20auth\x20setup','2556631RAdVsk','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','filter','\x20(site:\x20','✓\x20Authentication\x20successful\x0a','accountName','status','Remove\x20API\x20key\x20from\x20system\x20keychain','join','apikey','1130GgKWdh','green','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Read\x20credential\x20from\x20','\x0aSetup\x20cancelled','N/A','\x20for\x20profile:\x20','trim','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','ERROR','site','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Default\x20site\x20set\x20to\x20','1384524ETkisK','access_token','create','auth:token','API\x20key','✓\x20Signed\x20in\x20successfully','description','warn','\x20\x20(','log','1968VeRjKg','6cHkVNe'];a7_0x1b6b=function(){return _0x11edb5;};return a7_0x1b6b();}const a7_0x42bd4e=a7_0x4d33;(function(_0x12404f,_0x388b69){const _0x8620db=a7_0x4d33,_0xf8ff1b=_0x12404f();while(!![]){try{const _0x2227f9=-parseInt(_0x8620db(0x89))/0x1+parseInt(_0x8620db(0xc0))/0x2*(parseInt(_0x8620db(0x6c))/0x3)+-parseInt(_0x8620db(0xcd))/0x4+-parseInt(_0x8620db(0x79))/0x5*(parseInt(_0x8620db(0x6d))/0x6)+parseInt(_0x8620db(0xb6))/0x7+parseInt(_0x8620db(0x9e))/0x8+parseInt(_0x8620db(0x97))/0x9;if(_0x2227f9===_0x388b69)break;else _0xf8ff1b['push'](_0xf8ff1b['shift']());}catch(_0x192d96){_0xf8ff1b['push'](_0xf8ff1b['shift']());}}}(a7_0x1b6b,0x45b59));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}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_0x3d0940 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_0x9e0d82 from'chalk';export async function runOAuthLoginFlow(_0x41339c,_0x29f0da,_0x109c68,_0x2c9ba4){const _0x10bcfb=a7_0x4d33,_0x2cc274=await isKeychainAvailable();if(!_0x2cc274)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x10bcfb(0x70));let _0xfe6955=_0x2c9ba4?.[_0x10bcfb(0xbb)];if(!_0xfe6955){const _0x18b18e=await a7_0x3d0940({'type':'text','name':'accountName','message':_0x10bcfb(0x71)});if(_0x18b18e['accountName']===undefined)throw new Error(_0x10bcfb(0xa1));_0xfe6955=_0x18b18e[_0x10bcfb(0xbb)][_0x10bcfb(0xc7)]()||undefined;}const _0x5542f2=getConsoleUrl(_0x41339c);console[_0x10bcfb(0x6b)](_0x10bcfb(0x8e));_0xfe6955?console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0x8c)+_0xfe6955+')'):console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0xa8));console['log'](_0x10bcfb(0xc2));const _0x2f1a67=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x30ef48=await startOAuthFlow(_0x41339c,{'accountName':_0xfe6955,'proxy':_0x2f1a67});console[_0x10bcfb(0x6b)](_0x10bcfb(0x9f));const _0x4807bb=TDX[_0x10bcfb(0xcf)]({'site':_0x41339c,'accessToken':_0x30ef48[_0x10bcfb(0xce)],'logLevel':_0x109c68??LogLevel['ERROR']}),_0x6f4b94=await _0x4807bb[_0x10bcfb(0x7c)][_0x10bcfb(0x85)]();console[_0x10bcfb(0x6b)](a7_0x9e0d82[_0x10bcfb(0xc1)](_0x10bcfb(0x67))),console[_0x10bcfb(0x6b)]('\x20\x20'+a7_0x9e0d82[_0x10bcfb(0x87)](_0x41339c+':'+_0x6f4b94['account_id'])+_0x10bcfb(0x91)+_0x6f4b94['id']+_0x10bcfb(0x6a)+_0x6f4b94['email']+')');!_0xfe6955&&(console['log'](a7_0x9e0d82['dim'](_0x10bcfb(0x6e))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0x74))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0xaf))));await saveOAuthTokens(_0x30ef48,_0x29f0da),console[_0x10bcfb(0x6b)](_0x10bcfb(0xa5)+(_0x29f0da?_0x10bcfb(0x8f)+_0x29f0da+')':''));if(_0x29f0da){const _0x5c7266={'site':_0x41339c};saveProfileToUserConfig(_0x29f0da,_0x5c7266),console[_0x10bcfb(0x6b)](_0x10bcfb(0x93)+_0x29f0da+_0x10bcfb(0x72));}else saveDefaultSiteToUserConfig(_0x41339c),console['log'](_0x10bcfb(0xcc)+_0x41339c);const _0x5de05b=_0x29f0da?'\x20--profile\x20'+_0x29f0da:'';console[_0x10bcfb(0x6b)](),console[_0x10bcfb(0x6b)](_0x10bcfb(0x82)),console['log'](_0x10bcfb(0x7e)+_0x5de05b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x10bcfb(0x6b)](_0x10bcfb(0x7e)+_0x5de05b+_0x10bcfb(0x90));}function a7_0x4d33(_0xf18cd4,_0x3f9975){_0xf18cd4=_0xf18cd4-0x66;const _0x1b6b09=a7_0x1b6b();let _0x4d334e=_0x1b6b09[_0xf18cd4];return _0x4d334e;}export async function promptAuthMethod(){const _0x391a10=a7_0x4d33,_0xeb5a92=await a7_0x3d0940({'type':_0x391a10(0x94),'name':_0x391a10(0x9d),'message':_0x391a10(0x98),'choices':[{'title':_0x391a10(0x6f),'description':_0x391a10(0xb7),'value':'oauth'},{'title':_0x391a10(0x95),'description':_0x391a10(0x9b),'value':_0x391a10(0xbf)}]});return _0xeb5a92[_0x391a10(0x9d)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x7b);[a7_0x42bd4e(0x68)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x42bd4e(0xb4)](_0x494e8d){const _0x48f354=a7_0x42bd4e,{options:_0xbf79ab}=_0x494e8d,_0x119e1d=_0xbf79ab[_0x48f354(0x73)];console[_0x48f354(0x6b)](a7_0x9e0d82['bold'](_0x48f354(0xb5)));const _0xee8aaa=_0xbf79ab[_0x48f354(0xca)]||_0x48f354(0x7f),_0x505a2b=await promptSiteSelection(_0xee8aaa,_0x119e1d,_0x48f354(0xa1));if(!_0x505a2b)return 0x1;const _0x1263ef=resolveSite(_0x505a2b),_0x2b3942=await promptAuthMethod();if(!_0x2b3942)return console['log'](_0x48f354(0xc4)),0x1;if(_0x2b3942===_0x48f354(0xb1)){const {accountName:_0x1aa189}=_0xbf79ab;return await runOAuthLoginFlow(_0x1263ef,_0x119e1d,_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)],{'accountName':_0x1aa189}),0x0;}console[_0x48f354(0x6b)](_0x48f354(0x77)+_0x1263ef),console['log'](_0x48f354(0x81)),console[_0x48f354(0x6b)]('\x20\x20'+getConsoleUrl(_0x1263ef,_0x48f354(0x7d)));const _0x52b6e9=await a7_0x3d0940({'type':_0x48f354(0xa2),'name':_0x48f354(0x75),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x5f3f06=>{const _0x152108=_0x48f354;if(!_0x5f3f06||!_0x5f3f06[_0x152108(0xc7)]())return _0x152108(0xad);return!![];}});if(!_0x52b6e9[_0x48f354(0x75)])return console[_0x48f354(0x6b)](_0x48f354(0xc4)),0x1;const _0x2903ba=_0x52b6e9[_0x48f354(0x75)];console['log'](_0x48f354(0x9c));try{const _0x2f8343=TDX[_0x48f354(0xcf)]({'site':_0x1263ef,'apiKey':_0x2903ba[_0x48f354(0xc7)](),'logLevel':_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)]}),_0x153fc6=await _0x2f8343['jobs'][_0x48f354(0x85)]();console[_0x48f354(0x6b)](_0x48f354(0xcb)+_0x153fc6[_0x48f354(0xab)]+')');const _0x2c9456=await isKeychainAvailable();_0x2c9456?(await saveAPIKeyAsync(_0x2903ba[_0x48f354(0xc7)](),_0x1263ef,_0x119e1d),console[_0x48f354(0x6b)](_0x48f354(0xc8)+(_0x119e1d?_0x48f354(0x8f)+_0x119e1d+')':''))):(console[_0x48f354(0x69)](a7_0x9e0d82['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x9e0d82['yellow'](_0x48f354(0x84))));if(_0x119e1d){const _0xdd8811={'site':_0x1263ef};saveProfileToUserConfig(_0x119e1d,_0xdd8811),console[_0x48f354(0x6b)](_0x48f354(0x93)+_0x119e1d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1263ef),console['log'](_0x48f354(0xcc)+_0x1263ef);const _0x323ba8=_0x119e1d?_0x48f354(0xb0)+_0x119e1d:'';return console['log'](),console[_0x48f354(0x6b)](_0x48f354(0x82)),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+_0x48f354(0x90)),0x0;}catch(_0x5a5c01){if(_0x5a5c01 instanceof HTTPClientError&&_0x5a5c01[_0x48f354(0xbc)]===0x191)return printAuthError(_0x5a5c01),0x1;return console[_0x48f354(0x9a)](a7_0x9e0d82[_0x48f354(0x8a)](_0x48f354(0x83)+(_0x5a5c01 instanceof Error?_0x5a5c01[_0x48f354(0x76)]:String(_0x5a5c01)))),console[_0x48f354(0x9a)](_0x48f354(0xb3)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x92);['description']=a7_0x42bd4e(0xa4);async['execute'](_0x2bbc3f){const _0x887826=a7_0x42bd4e,{options:_0x313548,tdx:_0x1f42a7}=_0x2bbc3f,_0x1b75d0=_0x313548[_0x887826(0xca)],_0x4eb0c4=_0x313548['profile'],_0x3136c5=_0x4eb0c4?_0x4eb0c4:_0x887826(0xc5);console[_0x887826(0x6b)]('tdx\x20profile:\x20'+_0x3136c5+_0x887826(0xb9)+_0x1b75d0+')');const _0x48903c=await getOAuthTokens(_0x4eb0c4);if(_0x48903c)console[_0x887826(0x6b)](_0x887826(0xac)),console[_0x887826(0x6b)]('Read\x20credential\x20from\x20keychain'+(_0x4eb0c4?_0x887826(0x8f)+_0x4eb0c4+')':''));else{const _0x302f74=await resolveAPIKeyAsync(_0x1b75d0,_0x4eb0c4);if(_0x302f74){const {source:_0x64e039,isDeprecated:_0x1047fa}=_0x302f74,_0x4022d9=_0x887826(0xc3)+_0x64e039;console[_0x887826(0x6b)](_0x1047fa?a7_0x9e0d82['yellow'](_0x4022d9):_0x4022d9);}else console[_0x887826(0x6b)](a7_0x9e0d82[_0x887826(0x88)](_0x887826(0x8b)));}try{const _0x3366ae=await _0x1f42a7[_0x887826(0x7c)][_0x887826(0x85)]();return console[_0x887826(0x6b)](a7_0x9e0d82['green'](_0x887826(0xba))),console[_0x887826(0x6b)](_0x887826(0xa0)+_0x3366ae['email']),(_0x3366ae[_0x887826(0xa3)]||_0x3366ae[_0x887826(0xa6)])&&console[_0x887826(0x6b)](_0x887826(0x86)+[_0x3366ae[_0x887826(0xa3)],_0x3366ae[_0x887826(0xa6)]][_0x887826(0xb8)](Boolean)[_0x887826(0xbe)]('\x20')),0x0;}catch(_0x152637){return _0x152637 instanceof HTTPClientError&&_0x152637[_0x887826(0xbc)]===0x191?printAuthError(_0x152637,!![],_0x4eb0c4):console[_0x887826(0x9a)](a7_0x9e0d82[_0x887826(0x8a)](_0x887826(0x83)+(_0x152637 instanceof Error?_0x152637['message']:String(_0x152637)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0xd0);['description']=a7_0x42bd4e(0xa9);async['execute'](_0x22af48){const _0x5dce7a=a7_0x42bd4e,{options:_0x2bb805}=_0x22af48,_0x3f793f=await resolveOAuthAccessToken({'site':resolveSite(_0x2bb805['site']||_0x5dce7a(0x7f)),'profile':_0x2bb805[_0x5dce7a(0x73)],'proxy':loadGlobalProxy()});return console['log'](_0x3f793f),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x99);[a7_0x42bd4e(0x68)]=a7_0x42bd4e(0xbd);async[a7_0x42bd4e(0xb4)](_0x3f3900){const _0x36dd51=a7_0x42bd4e,{options:_0x53c158}=_0x3f3900,_0x35895a=_0x53c158[_0x36dd51(0x73)];console[_0x36dd51(0x6b)](a7_0x9e0d82[_0x36dd51(0x96)](_0x36dd51(0x78)));const _0x232d58=await isKeychainAvailable();if(!_0x232d58)return console[_0x36dd51(0x9a)](a7_0x9e0d82[_0x36dd51(0x8a)](_0x36dd51(0xa7))),0x1;const [_0xd4e1fc,_0x40271c]=await Promise[_0x36dd51(0x80)]([deleteKeychainAPIKey(_0x35895a),deleteOAuthTokens(_0x35895a)]);if(_0xd4e1fc||_0x40271c){clearCredentialCache();const _0x4b6b98=[_0xd4e1fc&&_0x36dd51(0x66),_0x40271c&&_0x36dd51(0xae)][_0x36dd51(0xb8)](Boolean)[_0x36dd51(0xbe)](_0x36dd51(0x8d));return console[_0x36dd51(0x6b)]('✓\x20'+_0x4b6b98+'\x20removed\x20from\x20keychain'+(_0x35895a?_0x36dd51(0x8f)+_0x35895a+')':'')),0x0;}else return console[_0x36dd51(0x6b)](_0x36dd51(0xaa)+(_0x35895a?_0x36dd51(0xc6)+_0x35895a:'')),0x1;}}
|