@treasuredata/tdx 2026.3.18 → 2026.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x136739=a3_0x1ff1;function a3_0x1ff1(_0x14bd39,_0x170c44){_0x14bd39=_0x14bd39-0x6e;const _0x380b57=a3_0x380b();let _0x1ff132=_0x380b57[_0x14bd39];return _0x1ff132;}(function(_0x386245,_0x2b7c85){const _0x3ca440=a3_0x1ff1,_0x1ed308=_0x386245();while(!![]){try{const _0x5be749=parseInt(_0x3ca440(0x74))/0x1+parseInt(_0x3ca440(0x6f))/0x2+-parseInt(_0x3ca440(0x79))/0x3*(parseInt(_0x3ca440(0x80))/0x4)+-parseInt(_0x3ca440(0x8c))/0x5*(-parseInt(_0x3ca440(0x6e))/0x6)+parseInt(_0x3ca440(0x92))/0x7*(-parseInt(_0x3ca440(0x93))/0x8)+parseInt(_0x3ca440(0x89))/0x9*(-parseInt(_0x3ca440(0x7e))/0xa)+parseInt(_0x3ca440(0x77))/0xb*(parseInt(_0x3ca440(0x76))/0xc);if(_0x5be749===_0x2b7c85)break;else _0x1ed308['push'](_0x1ed308['shift']());}catch(_0x135d59){_0x1ed308['push'](_0x1ed308['shift']());}}}(a3_0x380b,0x26d22));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x380b(){const _0x386b1e=['execute','Listing\x20activations\x20for\x20segment\x20\x27','error','List\x20activations\x20for\x20a\x20segment','99thWyVd','verbose','Child\x20name:\x20','656875LfppoG','name','length','Error:\x20Segment\x20name\x20is\x20required','Resolved\x20child\x20ID:\x20','segment','105wAwKtu','164872gbKSMS','6yzjxOd','121130HbcdAz','Error:\x20','Parent\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','✔\x20Found\x20','58087oDVcvF','description','4827348yWBwOU','11TLgArZ','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','2199uHRKOO','\x27...','Resolving\x20child\x20segment\x20\x27','resolveSegmentId','listActivations','70130BxSffr','Resolved\x20parent\x20ID:\x20','584WGNnSj','message','cause','resolveParentId','data'];a3_0x380b=function(){return _0x386b1e;};return a3_0x380b();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x136739(0x8d)]='activations';[a3_0x136739(0x75)]=a3_0x136739(0x88);async[a3_0x136739(0x85)](_0x132275){const _0x2e0078=a3_0x136739,{options:_0x5c08ea,args:_0x3ab95e,tdx:_0x38d450}=_0x132275;if(_0x3ab95e[_0x2e0078(0x8e)]===0x0)return console[_0x2e0078(0x87)](_0x2e0078(0x8f)),console[_0x2e0078(0x87)](_0x2e0078(0x78)),0x1;try{const {parentId:_0x4898bb,childId:_0x1e543c}=parseSegmentRef(_0x3ab95e[0x0]);if(!_0x1e543c)return console[_0x2e0078(0x87)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x2e0078(0x87)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x5c08ea[_0x2e0078(0x8a)]&&(console[_0x2e0078(0x87)]('Site:\x20'+_0x5c08ea['site']),console[_0x2e0078(0x87)](_0x2e0078(0x71)+_0x4898bb),console[_0x2e0078(0x87)](_0x2e0078(0x8b)+_0x1e543c));const _0x307e33=await withSpinner(_0x2e0078(0x72)+_0x4898bb+_0x2e0078(0x7a),()=>_0x38d450['segment'][_0x2e0078(0x83)](_0x4898bb),{'verbose':_0x5c08ea['verbose']}),_0xaede6c=_0x307e33[_0x2e0078(0x84)];_0x5c08ea[_0x2e0078(0x8a)]&&console[_0x2e0078(0x87)](_0x2e0078(0x7f)+_0xaede6c);const _0x51d544=await withSpinner(_0x2e0078(0x7b)+_0x1e543c+'\x27...',()=>_0x38d450[_0x2e0078(0x91)][_0x2e0078(0x7c)](_0xaede6c,_0x1e543c),{'verbose':_0x5c08ea[_0x2e0078(0x8a)]}),_0x47c250=_0x51d544[_0x2e0078(0x84)];_0x5c08ea[_0x2e0078(0x8a)]&&console[_0x2e0078(0x87)](_0x2e0078(0x90)+_0x47c250);const _0x782856=await withSpinner(_0x2e0078(0x86)+_0x1e543c+_0x2e0078(0x7a),()=>_0x38d450[_0x2e0078(0x91)][_0x2e0078(0x7d)](_0xaede6c,_0x47c250),{'verbose':_0x5c08ea[_0x2e0078(0x8a)]}),_0x5c43e8=_0x782856[_0x2e0078(0x84)];return console[_0x2e0078(0x87)](_0x2e0078(0x73)+_0x5c43e8[_0x2e0078(0x8e)]+'\x20activation'+(_0x5c43e8[_0x2e0078(0x8e)]!==0x1?'s':'')),await handleSDKOutput(_0x5c43e8,_0x5c08ea),0x0;}catch(_0x152924){if(_0x152924 instanceof SDKError)return console[_0x2e0078(0x87)](_0x2e0078(0x70)+_0x152924[_0x2e0078(0x81)]),_0x152924[_0x2e0078(0x82)]&&console[_0x2e0078(0x87)]('\x20\x20Cause:\x20'+_0x152924[_0x2e0078(0x82)]),0x1;throw _0x152924;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x414ac0=a4_0x2985;(function(_0x2035d0,_0x18a4be){const _0x5f266b=a4_0x2985,_0xef2143=_0x2035d0();while(!![]){try{const _0x516ae7=-parseInt(_0x5f266b(0xdd))/0x1+parseInt(_0x5f266b(0xbe))/0x2+-parseInt(_0x5f266b(0xb8))/0x3+-parseInt(_0x5f266b(0x11c))/0x4*(parseInt(_0x5f266b(0xcf))/0x5)+parseInt(_0x5f266b(0xb3))/0x6*(parseInt(_0x5f266b(0xc0))/0x7)+parseInt(_0x5f266b(0x115))/0x8*(parseInt(_0x5f266b(0x101))/0x9)+parseInt(_0x5f266b(0x94))/0xa;if(_0x516ae7===_0x18a4be)break;else _0xef2143['push'](_0xef2143['shift']());}catch(_0x38eb71){_0xef2143['push'](_0xef2143['shift']());}}}(a4_0x99bb,0x36c43));import a4_0x13b9bc from'chalk';import a4_0x4bb12e from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x99bb(){const _0x3c86d1=['\x0aChanges\x20to\x20integration\x20\x27','401460zSRDPg','Cancelled','\x20errors','utf-8','outputDir','693972JIGzEC','New\x20project:\x20','execute','\x20\x20Prompt\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20resources?','405324TPUzhD','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','28HNkVJz','\x20--name\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','projectName','cyan','Using\x20project:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yellow','INVALID_ARGUMENT','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Integration\x20\x22','tdx.json','Analyzing\x20changes\x20to\x20push...','description','no_context','1024615bKdNYB','Using\x20project\x20from\x20context:\x20','llm_project','✔\x20Context\x20set:\x20','knowledgeBases','sourceProjectName','Using\x20local\x20project:\x20','Failed\x20to\x20push\x20agent:\x20','parse','name','site','\x20=\x20','agentName','\x0aErrors\x20found:','237152qnyTFE','dim','pushProject','\x20\x20tdx\x20agent\x20clone\x20agents/','Writing\x20files...','counts','\x22...','\x0aChanges\x20to\x20agent\x20\x27','hasChanges','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)','force','Agent:\x20','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Chat:\x20','dryRun','created','projectId','total','\x22:\x20','Status:\x20','Project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','isNew','Using\x20context\x20project:\x20','textKnowledgeBases','Output:\x20','\x0aWrite\x20','agent:clone','agents','\x0aProject\x20pushed\x20with\x20errors','pullProject','experimentalArtifacts','\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Using\x20project\x20from\x20','1194309zcKZSd','\x20changed','\x20\x20Knowledge\x20Bases:\x20','\x20|\x20','agent','Pushing\x20agent\x20from\x20\x22','pushAgent','\x20\x20Prompts:\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','\x0aPush\x20','push','cloneProject','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','new','\x20updated','diff','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Source:\x20','\x20\x20Target:\x20','gray','16cuCaSe','llmProject','\x20\x20Agents:\x20','-\x20nothing\x20pushed','\x20\x20Source:\x20','newProjectId','\x0a✔\x20Pulled\x20','4OJUIRU','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','New\x20project\x20ID:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','join','\x22\x20to\x20new\x20project\x20\x22','errors','outputPath','\x20total','session','\x20unchanged','\x20\x20Text\x20Knowledge\x20Bases:\x20','Pulling\x20agent\x20\x22','\x22\x20from\x20project\x20\x22','Agent\x20pulled\x20successfully','message','\x20new','\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','Project\x20cloned\x20with\x20errors','action','yes','Errors:','Using\x20current\x20project:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22\x20to\x20\x22','cwd','agentId','\x0aPull\x20summary\x20for\x20\x27','found','Agent\x20','integrations','no_local_folder','green','\x0aChanges:','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Experimental\x20Artifact\x20\x22','\x20files?','agent:push','<new-name>','\x20\x20tdx\x20agent\x20pull\x20','No\x20tdx.json\x20found\x20in\x20','reason','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Base\x20\x22','experimentalKnowledgeBases','repeat','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','1620180jHodqu','prompts','llm','log','arg-dir','cwd-config','\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)','\x22\x20to\x20a\x20different\x20profile','Analyzing\x20project\x20\x22','Would\x20push\x20agent:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Project\x20cloned\x20successfully','New\x20project\x20name\x20is\x20required','Would\x20pull\x20agent:\x20','unchanged','\x20created','\x0aChanges\x20to\x20prompt\x20\x27','red','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Dry\x20run\x20-\x20no\x20changes\x20made','context','Summary:','\x0aError:','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','updated','\x20\x20Integrations:\x20','error','Output\x20path:\x20','dirname'];a4_0x99bb=function(){return _0x3c86d1;};return a4_0x99bb();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x2985(_0x2cd53a,_0x32f86f){_0x2cd53a=_0x2cd53a-0x7a;const _0x99bbcc=a4_0x99bb();let _0x29850a=_0x99bbcc[_0x2cd53a];return _0x29850a;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2cb894){const _0x57862a=a4_0x2985,_0x5818af=[];if(_0x2cb894['total']!==undefined)_0x5818af['push'](_0x2cb894[_0x57862a(0xef)]+_0x57862a(0x124));if(_0x2cb894[_0x57862a(0x10e)]!==undefined&&_0x2cb894['new']>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc[_0x57862a(0x85)](_0x2cb894[_0x57862a(0x10e)]+_0x57862a(0x12c)));if(_0x2cb894['created']!==undefined&&_0x2cb894[_0x57862a(0xed)]>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc[_0x57862a(0x85)](_0x2cb894[_0x57862a(0xed)]+_0x57862a(0xa4)));if(_0x2cb894[_0x57862a(0xad)]!==undefined&&_0x2cb894[_0x57862a(0xad)]>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc['yellow'](_0x2cb894[_0x57862a(0xad)]+_0x57862a(0x10f)));if(_0x2cb894[_0x57862a(0xa3)]!==undefined&&_0x2cb894['unchanged']>0x0)_0x5818af[_0x57862a(0x10b)](a4_0x13b9bc['gray'](_0x2cb894[_0x57862a(0xa3)]+_0x57862a(0x126)));if(_0x2cb894[_0x57862a(0x122)]!==undefined&&_0x2cb894[_0x57862a(0x122)]>0x0)_0x5818af['push'](a4_0x13b9bc[_0x57862a(0xa6)](_0x2cb894[_0x57862a(0x122)]+_0x57862a(0xb5)));return _0x5818af[_0x57862a(0x120)](',\x20');}function displayDiffs(_0x40efad,_0x27bbdf,_0x263ee4,_0x348acc,_0x457903,_0x2288b4,_0x4209ba){const _0x452ad6=a4_0x2985;for(const _0x285ef6 of _0x40efad){if(_0x285ef6[_0x452ad6(0x110)]){const _0x13dd2c=_0x285ef6[_0x452ad6(0xdb)]||_0x285ef6['name'];console[_0x452ad6(0x97)](_0x452ad6(0xe4)+_0x13dd2c+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x452ad6(0x97)](_0x285ef6[_0x452ad6(0x110)]),console['log']('─'[_0x452ad6(0x92)](0x3c));}}for(const _0x3e54c4 of _0x27bbdf){_0x3e54c4[_0x452ad6(0x110)]&&(console[_0x452ad6(0x97)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x3e54c4['name']+'\x27:'),console[_0x452ad6(0x97)]('─'['repeat'](0x3c)),console['log'](_0x3e54c4[_0x452ad6(0x110)]),console['log']('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x17affb of _0x263ee4){_0x17affb['diff']&&(console[_0x452ad6(0x97)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x17affb[_0x452ad6(0xd8)]+'\x27:'),console[_0x452ad6(0x97)]('─'['repeat'](0x3c)),console[_0x452ad6(0x97)](_0x17affb[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x1297aa of _0x348acc){_0x1297aa['diff']&&(console[_0x452ad6(0x97)](_0x452ad6(0xa5)+_0x1297aa['name']+'\x27:'),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)),console[_0x452ad6(0x97)](_0x1297aa[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x1cdd00 of _0x457903){_0x1cdd00[_0x452ad6(0x110)]&&(console[_0x452ad6(0x97)](_0x452ad6(0xb2)+_0x1cdd00['name']+'\x27:'),console[_0x452ad6(0x97)]('─'['repeat'](0x3c)),console[_0x452ad6(0x97)](_0x1cdd00[_0x452ad6(0x110)]),console['log']('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x40bd8d of _0x2288b4){_0x40bd8d['diff']&&(console[_0x452ad6(0x97)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x40bd8d[_0x452ad6(0xd8)]+'\x27:'),console['log']('─'[_0x452ad6(0x92)](0x3c)),console[_0x452ad6(0x97)](_0x40bd8d[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}for(const _0x9d5fa5 of _0x4209ba){_0x9d5fa5[_0x452ad6(0x110)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x9d5fa5[_0x452ad6(0xd8)]+'\x27:'),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)),console[_0x452ad6(0x97)](_0x9d5fa5[_0x452ad6(0x110)]),console[_0x452ad6(0x97)]('─'[_0x452ad6(0x92)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x414ac0(0xcd)]=a4_0x414ac0(0x93);async['execute'](_0x17c732){const _0x2ff5bf=a4_0x414ac0,{options:_0xb3195c,args:_0x27e289,tdx:_0x49a75c}=_0x17c732,_0x11899a=_0x27e289[0x0],_0x1ec2cd=_0x27e289[0x1],_0x5ebb68=_0xb3195c['output'],_0x532de1=_0xb3195c[_0x2ff5bf(0xec)],_0x29669a=_0xb3195c['force'],_0x10d3f0=_0xb3195c[_0x2ff5bf(0x130)],_0x3194f6=_0xb3195c[_0x2ff5bf(0x116)],_0x5a697c=_0xb3195c[_0x2ff5bf(0x105)];let _0x17f524;if(_0x11899a){const _0xc0cc1=a4_0x4bb12e['join'](_0x11899a,_0x2ff5bf(0xcb));if(existsSync(_0xc0cc1))try{const _0x1aae3b=JSON[_0x2ff5bf(0xd7)](readFileSync(_0xc0cc1,_0x2ff5bf(0xb6)));_0x1aae3b[_0x2ff5bf(0xd1)]&&(_0x17f524={'llm_project':_0x1aae3b[_0x2ff5bf(0xd1)]});}catch{}}const _0x3ba971=findAgentConfigPath(process['cwd']());let _0x235342;if(_0x3ba971)try{const _0x2b1717=JSON['parse'](readFileSync(_0x3ba971,_0x2ff5bf(0xb6)));_0x2b1717[_0x2ff5bf(0xd1)]&&(_0x235342={'llm_project':_0x2b1717['llm_project']});}catch{}const _0x4b633e=resolveAgentPullArgs({'arg':_0x11899a,'agentNameArg':_0x1ec2cd,'agentFlag':_0x5a697c,'contextProject':_0x3194f6,'argDirConfig':_0x17f524,'cwdConfigPath':_0x3ba971||undefined,'cwdConfig':_0x235342}),{projectNameOrId:_0xf909f9,targetAgentName:_0xae1d6a,existingOutputDir:_0x35b246,source:_0x1d0bcd}=_0x4b633e;if(_0x1d0bcd===_0x2ff5bf(0x98))console[_0x2ff5bf(0x97)](a4_0x13b9bc['dim'](_0x2ff5bf(0x100)+a4_0x4bb12e['join'](_0x11899a,'tdx.json')+':\x20'+_0xf909f9));else{if(_0x1d0bcd===_0x2ff5bf(0x99))console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0xde)](_0x2ff5bf(0xc5)+_0xf909f9));else _0x1d0bcd==='context'&&console['log'](a4_0x13b9bc[_0x2ff5bf(0xde)](_0x2ff5bf(0xd0)+_0xf909f9));}if(!_0xf909f9)return _0x5a697c?(console[_0x2ff5bf(0x97)](a4_0x13b9bc['yellow'](_0x2ff5bf(0x111))),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xf3)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xbc))):(console['log'](a4_0x13b9bc[_0x2ff5bf(0xc7)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xe6)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0x87)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0x12d)),console[_0x2ff5bf(0x97)](_0x2ff5bf(0x109)),console[_0x2ff5bf(0x97)]('\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(_0xae1d6a){const {data:_0x24a323}=await withSpinner(_0x2ff5bf(0x128)+_0xae1d6a+_0x2ff5bf(0x129)+_0xf909f9+'\x22...',()=>_0x49a75c[_0x2ff5bf(0x96)]['pullAgent'](_0xf909f9,_0xae1d6a,_0x5ebb68,{'dryRun':_0x532de1,'force':_0x29669a}));if(_0x532de1)return console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0xc7)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xa2)+_0x24a323[_0x2ff5bf(0xdb)]),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xb0)+_0x24a323[_0x2ff5bf(0x123)]),_0x24a323[_0x2ff5bf(0x110)]&&(console[_0x2ff5bf(0x97)](_0x2ff5bf(0x86)),console[_0x2ff5bf(0x97)]('─'[_0x2ff5bf(0x92)](0x3c)),console[_0x2ff5bf(0x97)](_0x24a323[_0x2ff5bf(0x110)]),console[_0x2ff5bf(0x97)]('─'[_0x2ff5bf(0x92)](0x3c))),0x0;return console[_0x2ff5bf(0x97)](a4_0x13b9bc['green'](_0x2ff5bf(0x12a))),console[_0x2ff5bf(0x97)]('Agent:\x20'+_0x24a323[_0x2ff5bf(0xdb)]),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xf7)+_0x24a323['outputPath']),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xf1)+(_0x24a323[_0x2ff5bf(0xf4)]?a4_0x13b9bc[_0x2ff5bf(0x85)](_0x2ff5bf(0x10e)):_0x24a323[_0x2ff5bf(0xe5)]?a4_0x13b9bc[_0x2ff5bf(0xc7)](_0x2ff5bf(0xad)):a4_0x13b9bc[_0x2ff5bf(0x114)]('unchanged'))),0x0;}const _0x41eca6=_0x35b246||_0x5ebb68,{data:_0x313168}=await withSpinner(_0x2ff5bf(0x9c)+_0xf909f9+_0x2ff5bf(0xe3),()=>_0x49a75c[_0x2ff5bf(0x96)][_0x2ff5bf(0xfc)](_0xf909f9,_0x41eca6,{'dryRun':!![]})),_0x30af77=_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfa)][_0x2ff5bf(0x10e)]+_0x313168['counts'][_0x2ff5bf(0xd3)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xf6)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x95)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x83)][_0x2ff5bf(0x10e)]+_0x313168['counts'][_0x2ff5bf(0x91)][_0x2ff5bf(0x10e)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfd)][_0x2ff5bf(0x10e)],_0x43cd8e=_0x313168['counts'][_0x2ff5bf(0xfa)][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xd3)][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)]['textKnowledgeBases']['updated']+_0x313168[_0x2ff5bf(0xe2)]['prompts'][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x83)]['updated']+_0x313168[_0x2ff5bf(0xe2)]['experimentalKnowledgeBases'][_0x2ff5bf(0xad)]+_0x313168[_0x2ff5bf(0xe2)]['experimentalArtifacts']['updated'],_0x5ccf0b=_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfa)][_0x2ff5bf(0xa3)]+_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xd3)][_0x2ff5bf(0xa3)]+_0x313168['counts'][_0x2ff5bf(0xf6)][_0x2ff5bf(0xa3)]+_0x313168['counts'][_0x2ff5bf(0x95)][_0x2ff5bf(0xa3)]+_0x313168[_0x2ff5bf(0xe2)]['integrations'][_0x2ff5bf(0xa3)]+_0x313168['counts'][_0x2ff5bf(0x91)][_0x2ff5bf(0xa3)]+_0x313168[_0x2ff5bf(0xe2)]['experimentalArtifacts'][_0x2ff5bf(0xa3)];console[_0x2ff5bf(0x97)](_0x2ff5bf(0x80)+_0x313168[_0x2ff5bf(0xc3)]+'\x27:'),console[_0x2ff5bf(0x97)]('\x20\x20'+a4_0x13b9bc['green']('+\x20'+_0x30af77+_0x2ff5bf(0x12c))+'\x20|\x20'+a4_0x13b9bc[_0x2ff5bf(0xc7)]('~\x20'+_0x43cd8e+_0x2ff5bf(0x102))+_0x2ff5bf(0x104)+a4_0x13b9bc[_0x2ff5bf(0xde)]('=\x20'+_0x5ccf0b+_0x2ff5bf(0x126))),console['log'](_0x2ff5bf(0x117)+formatCountSummary(_0x313168['counts'][_0x2ff5bf(0xfa)])),console[_0x2ff5bf(0x97)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x313168['counts']['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x313168['counts'][_0x2ff5bf(0xf6)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x313168['counts'][_0x2ff5bf(0x95)])),console[_0x2ff5bf(0x97)](_0x2ff5bf(0xae)+formatCountSummary(_0x313168[_0x2ff5bf(0xe2)]['integrations']));const _0x368315=_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x91)][_0x2ff5bf(0xef)]>0x0||_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0xfd)]['total']>0x0;_0x368315&&(console['log'](_0x2ff5bf(0x11d)+formatCountSummary(_0x313168[_0x2ff5bf(0xe2)][_0x2ff5bf(0x91)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x313168[_0x2ff5bf(0xe2)]['experimentalArtifacts'])));console['log'](_0x2ff5bf(0x113)+a4_0x13b9bc['cyan'](_0x313168[_0x2ff5bf(0xb7)])),displayDiffs(_0x313168[_0x2ff5bf(0xfa)],_0x313168[_0x2ff5bf(0xd3)],_0x313168[_0x2ff5bf(0xf6)],_0x313168['prompts'],_0x313168[_0x2ff5bf(0x83)],_0x313168[_0x2ff5bf(0x91)],_0x313168[_0x2ff5bf(0xfd)]);if(_0x532de1)return console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0xc7)](_0x2ff5bf(0xc6))),0x0;if(_0x30af77===0x0&&_0x43cd8e===0x0)return console[_0x2ff5bf(0x97)](a4_0x13b9bc['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x313168['projectName']},_0xb3195c[_0x2ff5bf(0x125)]),console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0x85)](_0x2ff5bf(0xd2)+a4_0x13b9bc[_0x2ff5bf(0xde)](_0x2ff5bf(0xd1))+_0x2ff5bf(0xda)+a4_0x13b9bc[_0x2ff5bf(0xc4)](_0x313168['projectName']))),0x0;if(!_0x10d3f0&&!_0x29669a){if(!isInteractive())return console['error'](a4_0x13b9bc[_0x2ff5bf(0xa6)](_0x2ff5bf(0xab)),_0x2ff5bf(0x9e)),console[_0x2ff5bf(0xaf)](a4_0x13b9bc['dim'](_0x2ff5bf(0xc9))),0x1;const _0x6f90b9=await confirmKey(_0x2ff5bf(0xf8)+(_0x30af77+_0x43cd8e)+_0x2ff5bf(0x89));if(!_0x6f90b9)return console[_0x2ff5bf(0x97)](a4_0x13b9bc['yellow'](_0x2ff5bf(0xb4)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x44b2ed}=await withSpinner(_0x2ff5bf(0xe1),()=>_0x49a75c[_0x2ff5bf(0x96)][_0x2ff5bf(0xfc)](_0xf909f9,_0x41eca6,{'force':_0x29669a}));return console[_0x2ff5bf(0x97)](a4_0x13b9bc[_0x2ff5bf(0x85)](_0x2ff5bf(0x11b)+(_0x30af77+_0x43cd8e)+_0x2ff5bf(0xfe)+_0x44b2ed[_0x2ff5bf(0xb7)])),saveSessionContext({'llm_project':_0x44b2ed['projectName']},_0xb3195c[_0x2ff5bf(0x125)]),console[_0x2ff5bf(0x97)](a4_0x13b9bc['green'](_0x2ff5bf(0xd2)+a4_0x13b9bc['dim'](_0x2ff5bf(0xd1))+_0x2ff5bf(0xda)+a4_0x13b9bc['cyan'](_0x44b2ed['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x414ac0(0xd8)]=a4_0x414ac0(0xf9);[a4_0x414ac0(0xcd)]=a4_0x414ac0(0xa7);async[a4_0x414ac0(0xba)](_0x1ae2dc){const _0x524480=a4_0x414ac0,{options:_0x755412,args:_0x37afac,tdx:_0xb6144b}=_0x1ae2dc,_0x2fdb7b=_0x37afac[0x0],_0x22d068=_0x755412[_0x524480(0xd8)],_0x28fc25=_0x755412['dryRun'],_0x265583=_0x755412['yes'],_0x4233ca=_0x755412[_0x524480(0xd9)],_0x3724e6=_0x755412[_0x524480(0x116)];let _0x1c1942;const _0x2195ef=findAgentConfigPath(process[_0x524480(0x7e)]());if(_0x2fdb7b){const _0x49a2ed=a4_0x4bb12e[_0x524480(0x120)](_0x2fdb7b,_0x524480(0xcb));existsSync(_0x49a2ed)?(_0x1c1942=_0x2fdb7b,console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xde)](_0x524480(0xd5)+_0x2fdb7b))):_0x1c1942=_0x2fdb7b;}else{if(_0x2195ef)_0x1c1942=a4_0x4bb12e[_0x524480(0xb1)](_0x2195ef),console['log'](a4_0x13b9bc['dim'](_0x524480(0x7b)+_0x1c1942));else{if(_0x3724e6){const _0x3bb0db=sanitizeForFilesystem(_0x3724e6);let _0x2e3562=_0x3bb0db,_0x4144e5=a4_0x4bb12e['join'](process[_0x524480(0x7e)](),_0x524480(0xfa),_0x3bb0db,'tdx.json');if(!existsSync(_0x4144e5)){const _0x15afb6=normalizeName(_0x3724e6),_0x5bdbf0=a4_0x4bb12e[_0x524480(0x120)](process[_0x524480(0x7e)](),_0x524480(0xfa),_0x15afb6,_0x524480(0xcb));existsSync(_0x5bdbf0)&&(_0x2e3562=_0x15afb6,_0x4144e5=_0x5bdbf0);}if(existsSync(_0x4144e5))_0x1c1942=a4_0x4bb12e[_0x524480(0xb1)](_0x4144e5),console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xde)](_0x524480(0xd5)+_0x1c1942));else{const _0x5ce78e=_0x755412['profile'];if(_0x5ce78e)throw new SDKError(ErrorCode[_0x524480(0xc8)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3724e6+_0x524480(0x9b),undefined,{'helpText':_0x524480(0x7c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x524480(0x8c)+_0x3724e6+'\x0a')+(_0x524480(0xe0)+_0x2e3562+_0x524480(0xc1)+(_0x22d068||_0x524480(0x8b))+'\x20--profile\x20'+_0x5ce78e)});_0x1c1942=_0x3724e6,console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xde)](_0x524480(0xf5)+_0x3724e6));}}}}if(!_0x1c1942)return console[_0x524480(0x97)](a4_0x13b9bc['yellow'](_0x524480(0x9f))),console[_0x524480(0x97)](_0x524480(0xac)),console['log'](_0x524480(0x10d)),console[_0x524480(0x97)](_0x524480(0x9a)),console[_0x524480(0x97)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x22d068)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x524480(0xa1),undefined,{'helpText':_0x524480(0x11f)});if(!_0x265583&&!_0x28fc25){if(!isInteractive())return console[_0x524480(0xaf)](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0xab)),_0x524480(0x9e)),console[_0x524480(0xaf)](a4_0x13b9bc[_0x524480(0xde)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x482cb3=await confirmKey('Clone\x20\x22'+_0x1c1942+_0x524480(0x121)+_0x22d068+'\x22?');if(!_0x482cb3)return console[_0x524480(0x97)](a4_0x13b9bc['yellow']('Cancelled')),0x1;}const {data:_0x2aee27}=await withSpinner('Cloning\x20\x22'+_0x1c1942+_0x524480(0x7d)+_0x22d068+_0x524480(0xe3),()=>_0xb6144b['llm'][_0x524480(0x10c)](_0x1c1942,_0x22d068,{'dryRun':_0x28fc25}));if(_0x28fc25){console['log'](a4_0x13b9bc[_0x524480(0xc7)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x524480(0x97)](_0x524480(0x112)+_0x2aee27[_0x524480(0xd4)]),console[_0x524480(0x97)](_0x524480(0xb9)+_0x22d068),console[_0x524480(0x97)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x2aee27[_0x524480(0xe2)][_0x524480(0xfa)]['created']),console[_0x524480(0x97)](_0x524480(0x103)+_0x2aee27['counts']['knowledgeBases'][_0x524480(0xed)]),console['log']('\x20\x20Prompts:\x20'+_0x2aee27[_0x524480(0xe2)]['prompts'][_0x524480(0xed)]);const _0x23ba3a=_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xed)]>0x0||_0x2aee27[_0x524480(0xe2)]['experimentalArtifacts'][_0x524480(0xed)]>0x0;return _0x23ba3a&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x2aee27[_0x524480(0xe2)]['experimentalKnowledgeBases'][_0x524480(0xed)]),console[_0x524480(0x97)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)]['created'])),0x0;}const _0x2b1b3e=_0x2aee27['counts'][_0x524480(0xfa)][_0x524480(0x122)]>0x0||_0x2aee27['counts'][_0x524480(0xd3)]['errors']>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x95)][_0x524480(0x122)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)]['errors']>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)]['errors']>0x0;_0x2b1b3e?console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xc7)](_0x524480(0x12e))):console['log'](a4_0x13b9bc[_0x524480(0x85)](_0x524480(0xa0)));console[_0x524480(0x97)](_0x524480(0x112)+_0x2aee27[_0x524480(0xd4)]),console[_0x524480(0x97)]('New\x20project:\x20'+_0x2aee27['newProjectName']),console['log'](_0x524480(0x11e)+_0x2aee27[_0x524480(0x11a)]),console[_0x524480(0x97)](),console[_0x524480(0x97)](_0x524480(0xaa)),console['log'](_0x524480(0x117)+formatCountSummary(_0x2aee27[_0x524480(0xe2)][_0x524480(0xfa)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2aee27[_0x524480(0xe2)][_0x524480(0xd3)])),console['log'](_0x524480(0x108)+formatCountSummary(_0x2aee27['counts'][_0x524480(0x95)])),console[_0x524480(0x97)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2aee27[_0x524480(0xe2)]['integrations']));const _0x2275c7=_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xed)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xad)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0x91)][_0x524480(0xa3)]>0x0||_0x2aee27[_0x524480(0xe2)]['experimentalArtifacts'][_0x524480(0xed)]>0x0||_0x2aee27['counts']['experimentalArtifacts'][_0x524480(0xad)]>0x0||_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)]['unchanged']>0x0;_0x2275c7&&(console[_0x524480(0x97)](_0x524480(0x11d)+formatCountSummary(_0x2aee27['counts']['experimentalKnowledgeBases'])),console[_0x524480(0x97)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2aee27[_0x524480(0xe2)][_0x524480(0xfd)])));if(_0x2b1b3e){console[_0x524480(0x97)](),console['log'](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0x7a)));for(const _0x1af969 of _0x2aee27['agents']){_0x1af969['action']===_0x524480(0xaf)&&console['log'](a4_0x13b9bc[_0x524480(0xa6)]('\x20\x20Agent\x20\x22'+_0x1af969['agentName']+_0x524480(0xf0)+_0x1af969[_0x524480(0xaf)]));}for(const _0x325043 of _0x2aee27[_0x524480(0xd3)]){_0x325043[_0x524480(0x12f)]==='error'&&console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0x90)+_0x325043[_0x524480(0xd8)]+_0x524480(0xf0)+_0x325043['error']));}for(const _0x27793a of _0x2aee27[_0x524480(0x95)]){_0x27793a[_0x524480(0x12f)]===_0x524480(0xaf)&&console[_0x524480(0x97)](a4_0x13b9bc['red']('\x20\x20Prompt\x20\x22'+_0x27793a['name']+_0x524480(0xf0)+_0x27793a[_0x524480(0xaf)]));}for(const _0x2198ca of _0x2aee27[_0x524480(0x83)]){_0x2198ca['action']===_0x524480(0xaf)&&console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0xca)+_0x2198ca['name']+'\x22:\x20'+_0x2198ca[_0x524480(0xaf)]));}for(const _0x375e29 of _0x2aee27['experimentalKnowledgeBases']){_0x375e29[_0x524480(0x12f)]===_0x524480(0xaf)&&console[_0x524480(0x97)](a4_0x13b9bc[_0x524480(0xa6)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x375e29[_0x524480(0xd8)]+_0x524480(0xf0)+_0x375e29[_0x524480(0xaf)]));}for(const _0x2df7c5 of _0x2aee27[_0x524480(0xfd)]){_0x2df7c5[_0x524480(0x12f)]==='error'&&console['log'](a4_0x13b9bc[_0x524480(0xa6)](_0x524480(0x88)+_0x2df7c5[_0x524480(0xd8)]+_0x524480(0xf0)+_0x2df7c5[_0x524480(0xaf)]));}return 0x1;}console['log']();const _0x15dc53=getLLMProjectUrl(_0x4233ca,_0x2aee27[_0x524480(0x11a)]);return console[_0x524480(0x97)](_0x524480(0xf2)+a4_0x13b9bc['cyan'](_0x15dc53)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x414ac0(0xd8)]=a4_0x414ac0(0x8a);[a4_0x414ac0(0xcd)]=a4_0x414ac0(0x8f);async[a4_0x414ac0(0xba)](_0x1f183c){const _0x1a77d2=a4_0x414ac0,{options:_0x15d8be,args:_0x334f40,tdx:_0x402b5e}=_0x1f183c;let _0x48d2f4=_0x334f40[0x0]||process['cwd']();const _0xbbaf47=_0x15d8be['dryRun'],_0x49c1be=_0x15d8be[_0x1a77d2(0xe7)],_0xb6c27=_0x15d8be['yes'],_0x246e68=_0x15d8be['site'],_0x1b996d=a4_0x4bb12e[_0x1a77d2(0x120)](_0x48d2f4,'agent.yml'),_0x195fc4=existsSync(_0x1b996d);if(_0x195fc4){const {data:_0x43bb5d}=await withSpinner(_0x1a77d2(0x106)+_0x48d2f4+_0x1a77d2(0xe3),()=>_0x402b5e['llm'][_0x1a77d2(0x107)](_0x48d2f4,{'dryRun':_0xbbaf47,'force':_0x49c1be}));if(_0xbbaf47)return console['log'](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xa8))),console[_0x1a77d2(0x97)](_0x1a77d2(0x9d)+_0x43bb5d['agentName']),0x0;if(_0x43bb5d['action']===_0x1a77d2(0xaf))return console[_0x1a77d2(0x97)](a4_0x13b9bc['red'](_0x1a77d2(0xd6)+_0x43bb5d[_0x1a77d2(0xaf)])),0x1;console['log'](a4_0x13b9bc[_0x1a77d2(0x85)](_0x1a77d2(0x82)+_0x43bb5d[_0x1a77d2(0x12f)]+'\x20successfully')),console[_0x1a77d2(0x97)](_0x1a77d2(0xe8)+_0x43bb5d[_0x1a77d2(0xdb)]);if(_0x43bb5d[_0x1a77d2(0x7f)]&&_0x43bb5d[_0x1a77d2(0xee)]){const _0x5e7a2d=getLLMAgentChatUrl(_0x246e68,_0x43bb5d[_0x1a77d2(0xee)],_0x43bb5d[_0x1a77d2(0x7f)]);console[_0x1a77d2(0x97)](_0x1a77d2(0xeb)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x5e7a2d));}return 0x0;}const _0x38448a=_0x15d8be['llmProject'],_0x40fc6e=resolveProjectFromContext(_0x48d2f4,_0x38448a);if(_0x40fc6e[_0x1a77d2(0x81)])_0x48d2f4=_0x40fc6e['projectDir'],_0x40fc6e['source']===_0x1a77d2(0xa9)&&console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xde)](_0x1a77d2(0xc5)+_0x48d2f4));else{let _0x3dcf68=_0x1a77d2(0xc2);_0x40fc6e[_0x1a77d2(0x8e)]===_0x1a77d2(0x84)&&(_0x3dcf68=_0x40fc6e[_0x1a77d2(0x12b)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x40fc6e[_0x1a77d2(0x116)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x1a77d2(0xc8)],_0x40fc6e[_0x1a77d2(0x8e)]===_0x1a77d2(0xce)?_0x40fc6e['message']:_0x1a77d2(0x8d)+_0x48d2f4,undefined,{'helpText':_0x3dcf68});}const {data:_0x795cc4}=await withSpinner(_0x1a77d2(0xcc),()=>_0x402b5e[_0x1a77d2(0x96)][_0x1a77d2(0xdf)](_0x48d2f4,{'dryRun':!![]})),_0x4bea4f=_0x795cc4['counts'][_0x1a77d2(0xfa)][_0x1a77d2(0x122)]>0x0;if(_0x4bea4f){console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xdc)));for(const _0x10a0ae of _0x795cc4[_0x1a77d2(0xfa)]){_0x10a0ae[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)]('\x20\x20Agent\x20\x22'+_0x10a0ae[_0x1a77d2(0xdb)]+_0x1a77d2(0xf0)+_0x10a0ae[_0x1a77d2(0xaf)]));}return 0x1;}const _0x1dc56a=_0x795cc4[_0x1a77d2(0xe2)]['agents'][_0x1a77d2(0xed)]+_0x795cc4['counts'][_0x1a77d2(0xd3)][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)]['textKnowledgeBases'][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x95)][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)]['integrations'][_0x1a77d2(0xed)]+_0x795cc4['counts'][_0x1a77d2(0x91)][_0x1a77d2(0xed)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xed)],_0x267c5f=_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfa)]['updated']+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xf6)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x95)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x83)][_0x1a77d2(0xad)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x91)][_0x1a77d2(0xad)]+_0x795cc4['counts'][_0x1a77d2(0xfd)][_0x1a77d2(0xad)],_0x2dc851=_0x795cc4['counts'][_0x1a77d2(0xfa)][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xf6)][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)]['prompts']['unchanged']+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x83)][_0x1a77d2(0xa3)]+_0x795cc4['counts']['experimentalKnowledgeBases'][_0x1a77d2(0xa3)]+_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xa3)];console[_0x1a77d2(0x97)]('\x0aPush\x20summary\x20for\x20\x27'+_0x795cc4['projectName']+'\x27:'),console[_0x1a77d2(0x97)]('\x20\x20'+a4_0x13b9bc['green']('+\x20'+_0x1dc56a+'\x20new')+'\x20|\x20'+a4_0x13b9bc[_0x1a77d2(0xc7)]('~\x20'+_0x267c5f+_0x1a77d2(0x102))+'\x20|\x20'+a4_0x13b9bc[_0x1a77d2(0xde)]('=\x20'+_0x2dc851+_0x1a77d2(0x126))),console[_0x1a77d2(0x97)](_0x1a77d2(0x117)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfa)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)])),console['log'](_0x1a77d2(0x127)+formatCountSummary(_0x795cc4['counts'][_0x1a77d2(0xf6)])),console[_0x1a77d2(0x97)](_0x1a77d2(0x108)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x95)])),console[_0x1a77d2(0x97)](_0x1a77d2(0xae)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x83)]));const _0x26d1e6=_0x795cc4['counts'][_0x1a77d2(0x91)]['created']>0x0||_0x795cc4['counts']['experimentalKnowledgeBases'][_0x1a77d2(0xad)]>0x0||_0x795cc4['counts'][_0x1a77d2(0x91)][_0x1a77d2(0xa3)]>0x0||_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)]['created']>0x0||_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xad)]>0x0||_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0xfd)][_0x1a77d2(0xa3)]>0x0;_0x26d1e6&&(console[_0x1a77d2(0x97)](_0x1a77d2(0x11d)+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)][_0x1a77d2(0x91)])),console[_0x1a77d2(0x97)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x795cc4[_0x1a77d2(0xe2)]['experimentalArtifacts'])));console[_0x1a77d2(0x97)](_0x1a77d2(0x119)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x48d2f4)),displayDiffs(_0x795cc4['agents'],_0x795cc4[_0x1a77d2(0xd3)],_0x795cc4[_0x1a77d2(0xf6)],_0x795cc4[_0x1a77d2(0x95)],_0x795cc4[_0x1a77d2(0x83)],_0x795cc4[_0x1a77d2(0x91)],_0x795cc4[_0x1a77d2(0xfd)]);if(_0xbbaf47)return console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xff))),0x0;if(_0x1dc56a===0x0&&_0x267c5f===0x0){console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0x85)](_0x1a77d2(0xbf)));const _0x3135de=getLLMProjectUrl(_0x246e68,_0x795cc4[_0x1a77d2(0xee)]);return console[_0x1a77d2(0x97)](_0x1a77d2(0xf2)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x3135de)),0x0;}if(!_0xb6c27&&!_0x49c1be){if(!isInteractive())return console['error'](a4_0x13b9bc['red']('\x0aError:'),_0x1a77d2(0x9e)),console[_0x1a77d2(0xaf)](a4_0x13b9bc[_0x1a77d2(0xde)](_0x1a77d2(0xc9))),0x1;const _0xb4ff3b=await confirmKey(_0x1a77d2(0x10a)+(_0x1dc56a+_0x267c5f)+_0x1a77d2(0xbd));if(!_0xb4ff3b)return console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xb4)),_0x1a77d2(0x118)),0x1;}const {data:_0x23806f}=await withSpinner('Pushing\x20to\x20project...',()=>_0x402b5e[_0x1a77d2(0x96)][_0x1a77d2(0xdf)](_0x48d2f4,{'force':_0x49c1be})),_0x59422b=_0x23806f['counts'][_0x1a77d2(0xfa)][_0x1a77d2(0x122)]>0x0||_0x23806f[_0x1a77d2(0xe2)][_0x1a77d2(0xd3)][_0x1a77d2(0x122)]>0x0||_0x23806f[_0x1a77d2(0xe2)][_0x1a77d2(0xf6)][_0x1a77d2(0x122)]>0x0||_0x23806f[_0x1a77d2(0xe2)][_0x1a77d2(0x95)]['errors']>0x0;if(_0x59422b){console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xc7)](_0x1a77d2(0xfb))),console[_0x1a77d2(0x97)](),console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0x7a)));for(const _0x459db3 of _0x23806f[_0x1a77d2(0xfa)]){_0x459db3[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xe9)+_0x459db3[_0x1a77d2(0xdb)]+_0x1a77d2(0xf0)+_0x459db3[_0x1a77d2(0xaf)]));}for(const _0x21e51b of _0x23806f['knowledgeBases']){_0x21e51b[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x21e51b[_0x1a77d2(0xd8)]+_0x1a77d2(0xf0)+_0x21e51b[_0x1a77d2(0xaf)]));}for(const _0x54fc72 of _0x23806f['textKnowledgeBases']){_0x54fc72['action']===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xea)+_0x54fc72['name']+'\x22:\x20'+_0x54fc72['error']));}for(const _0x27c6ae of _0x23806f['prompts']){_0x27c6ae[_0x1a77d2(0x12f)]===_0x1a77d2(0xaf)&&console['log'](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xbb)+_0x27c6ae['name']+_0x1a77d2(0xf0)+_0x27c6ae[_0x1a77d2(0xaf)]));}for(const _0x397f73 of _0x23806f[_0x1a77d2(0x83)]){_0x397f73['action']===_0x1a77d2(0xaf)&&console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0xa6)](_0x1a77d2(0xca)+_0x397f73['name']+'\x22:\x20'+_0x397f73[_0x1a77d2(0xaf)]));}return 0x1;}console[_0x1a77d2(0x97)](a4_0x13b9bc[_0x1a77d2(0x85)]('\x0a✔\x20Pushed\x20'+(_0x1dc56a+_0x267c5f)+'\x20resources\x20to\x20\x27'+_0x23806f[_0x1a77d2(0xc3)]+'\x27'));const _0x3a2269=getLLMProjectUrl(_0x246e68,_0x23806f[_0x1a77d2(0xee)]);return console['log'](_0x1a77d2(0xf2)+a4_0x13b9bc[_0x1a77d2(0xc4)](_0x3a2269)),0x0;}}
|
|
1
|
+
const a4_0x331360=a4_0x5a2e;(function(_0x573a2f,_0x2ed40c){const _0x5518dc=a4_0x5a2e,_0x341a4b=_0x573a2f();while(!![]){try{const _0x1aff3a=parseInt(_0x5518dc(0xba))/0x1+parseInt(_0x5518dc(0x123))/0x2*(-parseInt(_0x5518dc(0xb5))/0x3)+parseInt(_0x5518dc(0x142))/0x4+-parseInt(_0x5518dc(0xc6))/0x5+parseInt(_0x5518dc(0xc4))/0x6*(-parseInt(_0x5518dc(0x160))/0x7)+parseInt(_0x5518dc(0xea))/0x8+parseInt(_0x5518dc(0xfe))/0x9;if(_0x1aff3a===_0x2ed40c)break;else _0x341a4b['push'](_0x341a4b['shift']());}catch(_0x172cd9){_0x341a4b['push'](_0x341a4b['shift']());}}}(a4_0x1d91,0x8a4a4));import a4_0x5f490c from'chalk';import a4_0x4515b8 from'path';import{existsSync,readFileSync}from'fs';function a4_0x1d91(){const _0x17504e=['\x20\x20Experimental\x20Knowledge\x20Bases:\x20','source','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0a✔\x20Pushed\x20','Cloning\x20\x22','projectDir','Pushing\x20agent\x20from\x20\x22','Cancelled','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','gray','experimentalKnowledgeBases','Using\x20local\x20project:\x20','\x20total','outputPath','integrations','311376mxDlRC','\x20=\x20','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Base\x20\x22','Writing\x20files...','New\x20project:\x20','Project\x20cloned\x20successfully','\x20\x20Experimental\x20Artifact\x20\x22','\x22:\x20','reason','\x22\x20to\x20new\x20project\x20\x22','profile','cwd','Project:\x20','dim','\x20\x20Integrations:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','found','Analyzing\x20changes\x20to\x20push...','agent:clone','no_context','yes','\x20--profile\x20','\x0aChanges\x20to\x20agent\x20\x27','log','total','Source:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aChanges\x20to\x20integration\x20\x27','\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','63413EYTfxm','<new-name>','agent.yml','\x0aPull\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','join','action','\x0aError:','red','projectId','\x20updated','projectName','Output\x20path:\x20','cyan','\x0aProject\x20pushed\x20with\x20errors','description','knowledgeBases','\x20\x20Text\x20Knowledge\x20Base\x20\x22','555sOOIMV','newProjectId','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','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)','pullProject','93560TpNGhg','\x20\x20Knowledge\x20Bases:\x20','\x20errors','cloneProject','Would\x20pull\x20agent:\x20','Output:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','new','utf-8','green','258smkHYd','Would\x20clone:','2430670cihoUt','-\x20no\x20files\x20written','\x20\x20Target:\x20','Clone\x20\x22','\x22\x20to\x20\x22','diff','counts','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','experimentalArtifacts','llm','\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','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Analyzing\x20project\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','site','-\x20nothing\x20pushed','\x0aErrors\x20found:','push','\x0aChanges:','Chat:\x20','\x20\x20Agents:\x20','\x20|\x20','tdx.json','New\x20project\x20name\x20is\x20required','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','prompts','\x22\x20from\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','yellow','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x27\x20to\x20create\x20the\x20folder\x20structure.','newProjectName','\x20\x20Prompt\x20\x22','hasChanges','arg-dir','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','1362616lipgNi','Using\x20project:\x20','textKnowledgeBases','agents','Errors:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20context\x20project:\x20','llm_project','message','\x20unchanged','name','repeat','Using\x20current\x20project:\x20','pushProject','cwd-config','\x20\x20Agent\x20\x22','\x20\x20Integration\x20\x22','\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)','agentId','llmProject','12136149aYMhyo','agent:push','execute','Would\x20push\x20agent:\x20','Project\x20cloned\x20with\x20errors','\x20changed','Pushing\x20to\x20project...','errors','parse','\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','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20resources\x20to\x20\x27','Status:\x20','agentName','✔\x20Context\x20set:\x20','dryRun','INVALID_ARGUMENT','\x0aWrite\x20','Agent\x20','\x20--name\x20','\x0aPush\x20summary\x20for\x20\x27','force','outputDir','Using\x20project\x20from\x20context:\x20','created','no_local_folder','agent','error','unchanged','\x20new','\x20files\x20to\x20','\x0a✔\x20Pulled\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','New\x20project\x20ID:\x20','updated','Summary:','agent:pull','2682GufHvo','\x20\x20Text\x20Knowledge\x20Bases:\x20','isNew','Cannot\x20clone\x20from\x20context\x20project\x20\x22','sourceProjectName','session','Using\x20project\x20from\x20','Agent:\x20','context','\x22...','\x22\x20to\x20a\x20different\x20profile','dirname','Dry\x20run\x20-\x20no\x20changes\x20made','\x20created'];a4_0x1d91=function(){return _0x17504e;};return a4_0x1d91();}function a4_0x5a2e(_0x460d4a,_0x47ae2a){_0x460d4a=_0x460d4a-0xaf;const _0x1d9114=a4_0x1d91();let _0x5a2e35=_0x1d9114[_0x460d4a];return _0x5a2e35;}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(_0x2a0e6a){const _0x592f38=a4_0x5a2e,_0x39ff7d=[];if(_0x2a0e6a[_0x592f38(0x15b)]!==undefined)_0x39ff7d[_0x592f38(0xd7)](_0x2a0e6a[_0x592f38(0x15b)]+_0x592f38(0x13f));if(_0x2a0e6a[_0x592f38(0xc1)]!==undefined&&_0x2a0e6a[_0x592f38(0xc1)]>0x0)_0x39ff7d['push'](a4_0x5f490c[_0x592f38(0xc3)](_0x2a0e6a['new']+_0x592f38(0x11b)));if(_0x2a0e6a[_0x592f38(0x116)]!==undefined&&_0x2a0e6a[_0x592f38(0x116)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c[_0x592f38(0xc3)](_0x2a0e6a['created']+_0x592f38(0x130)));if(_0x2a0e6a[_0x592f38(0x120)]!==undefined&&_0x2a0e6a[_0x592f38(0x120)]>0x0)_0x39ff7d['push'](a4_0x5f490c[_0x592f38(0xe2)](_0x2a0e6a[_0x592f38(0x120)]+_0x592f38(0x16a)));if(_0x2a0e6a[_0x592f38(0x11a)]!==undefined&&_0x2a0e6a[_0x592f38(0x11a)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c[_0x592f38(0x13c)](_0x2a0e6a['unchanged']+_0x592f38(0xf3)));if(_0x2a0e6a[_0x592f38(0x105)]!==undefined&&_0x2a0e6a[_0x592f38(0x105)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c['red'](_0x2a0e6a['errors']+_0x592f38(0xbc)));return _0x39ff7d[_0x592f38(0x165)](',\x20');}function displayDiffs(_0x322372,_0x18a472,_0x2fef93,_0x3eb37a,_0x457325,_0x21918f,_0x4012d2){const _0x5ec1b4=a4_0x5a2e;for(const _0x52af83 of _0x322372){if(_0x52af83[_0x5ec1b4(0xcb)]){const _0x4c050d=_0x52af83[_0x5ec1b4(0x10b)]||_0x52af83[_0x5ec1b4(0xf4)];console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x159)+_0x4c050d+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console[_0x5ec1b4(0x15a)](_0x52af83[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c));}}for(const _0x332ff9 of _0x18a472){_0x332ff9[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x108)+_0x332ff9['name']+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console[_0x5ec1b4(0x15a)](_0x332ff9[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x419e2b of _0x2fef93){_0x419e2b['diff']&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x164)+_0x419e2b[_0x5ec1b4(0xf4)]+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console['log'](_0x419e2b['diff']),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x51f7c0 of _0x3eb37a){_0x51f7c0[_0x5ec1b4(0xcb)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x51f7c0[_0x5ec1b4(0xf4)]+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console[_0x5ec1b4(0x15a)](_0x51f7c0[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)));}for(const _0x3aea6d of _0x457325){_0x3aea6d[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x15e)+_0x3aea6d['name']+'\x27:'),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)),console['log'](_0x3aea6d[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x5408dd of _0x21918f){_0x5408dd[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x5408dd['name']+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console['log'](_0x5408dd[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x3cd39b of _0x4012d2){_0x3cd39b[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x134)+_0x3cd39b['name']+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console['log'](_0x3cd39b[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x331360(0x122);[a4_0x331360(0xb2)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x30e5f0){const _0x4164e1=a4_0x331360,{options:_0x5c0528,args:_0x1e5fe9,tdx:_0x2c3198}=_0x30e5f0,_0x54962e=_0x1e5fe9[0x0],_0x58fd2a=_0x1e5fe9[0x1],_0x5aa254=_0x5c0528['output'],_0x13159a=_0x5c0528[_0x4164e1(0x10d)],_0x5f09c2=_0x5c0528[_0x4164e1(0x113)],_0x3f1383=_0x5c0528[_0x4164e1(0x157)],_0x434f10=_0x5c0528['llmProject'],_0x1d0859=_0x5c0528[_0x4164e1(0x118)];let _0xf52789;if(_0x54962e){const _0xde893f=a4_0x4515b8[_0x4164e1(0x165)](_0x54962e,_0x4164e1(0xdc));if(existsSync(_0xde893f))try{const _0x4102b6=JSON[_0x4164e1(0x106)](readFileSync(_0xde893f,_0x4164e1(0xc2)));_0x4102b6['llm_project']&&(_0xf52789={'llm_project':_0x4102b6['llm_project']});}catch{}}const _0xcbfdd8=findAgentConfigPath(process[_0x4164e1(0x14e)]());let _0x2901ed;if(_0xcbfdd8)try{const _0x343955=JSON[_0x4164e1(0x106)](readFileSync(_0xcbfdd8,_0x4164e1(0xc2)));_0x343955[_0x4164e1(0xf1)]&&(_0x2901ed={'llm_project':_0x343955[_0x4164e1(0xf1)]});}catch{}const _0x146279=resolveAgentPullArgs({'arg':_0x54962e,'agentNameArg':_0x58fd2a,'agentFlag':_0x1d0859,'contextProject':_0x434f10,'argDirConfig':_0xf52789,'cwdConfigPath':_0xcbfdd8||undefined,'cwdConfig':_0x2901ed}),{projectNameOrId:_0x3d448e,targetAgentName:_0x4affc6,existingOutputDir:_0x5dc4be,source:_0x14adf3}=_0x146279;if(_0x14adf3===_0x4164e1(0xe8))console['log'](a4_0x5f490c[_0x4164e1(0x150)](_0x4164e1(0x129)+a4_0x4515b8[_0x4164e1(0x165)](_0x54962e,'tdx.json')+':\x20'+_0x3d448e));else{if(_0x14adf3===_0x4164e1(0xf8))console['log'](a4_0x5f490c['dim'](_0x4164e1(0xeb)+_0x3d448e));else _0x14adf3===_0x4164e1(0x12b)&&console[_0x4164e1(0x15a)](a4_0x5f490c['dim'](_0x4164e1(0x115)+_0x3d448e));}if(!_0x3d448e)return _0x1d0859?(console['log'](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x13b))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x4164e1(0x152))):(console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x4164e1(0xb8)),console[_0x4164e1(0x15a)]('\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[_0x4164e1(0x15a)](_0x4164e1(0xd0)),console['log'](_0x4164e1(0x15f)),console[_0x4164e1(0x15a)](_0x4164e1(0x107))),0x1;if(_0x4affc6){const {data:_0x531c09}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4affc6+_0x4164e1(0xe0)+_0x3d448e+_0x4164e1(0x12c),()=>_0x2c3198[_0x4164e1(0xcf)]['pullAgent'](_0x3d448e,_0x4affc6,_0x5aa254,{'dryRun':_0x13159a,'force':_0x5f09c2}));if(_0x13159a)return console[_0x4164e1(0x15a)](a4_0x5f490c['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x4164e1(0x15a)](_0x4164e1(0xbe)+_0x531c09[_0x4164e1(0x10b)]),console[_0x4164e1(0x15a)](_0x4164e1(0xaf)+_0x531c09[_0x4164e1(0x140)]),_0x531c09[_0x4164e1(0xcb)]&&(console[_0x4164e1(0x15a)](_0x4164e1(0xd8)),console['log']('─'[_0x4164e1(0xf5)](0x3c)),console['log'](_0x531c09[_0x4164e1(0xcb)]),console['log']('─'[_0x4164e1(0xf5)](0x3c))),0x0;return console[_0x4164e1(0x15a)](a4_0x5f490c['green']('Agent\x20pulled\x20successfully')),console[_0x4164e1(0x15a)](_0x4164e1(0x12a)+_0x531c09[_0x4164e1(0x10b)]),console[_0x4164e1(0x15a)](_0x4164e1(0xbf)+_0x531c09[_0x4164e1(0x140)]),console[_0x4164e1(0x15a)](_0x4164e1(0x10a)+(_0x531c09[_0x4164e1(0x125)]?a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0xc1)):_0x531c09[_0x4164e1(0xe7)]?a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x120)):a4_0x5f490c[_0x4164e1(0x13c)](_0x4164e1(0x11a)))),0x0;}const _0x527d93=_0x5dc4be||_0x5aa254,{data:_0x1af576}=await withSpinner(_0x4164e1(0xd2)+_0x3d448e+'\x22...',()=>_0x2c3198[_0x4164e1(0xcf)]['pullProject'](_0x3d448e,_0x527d93,{'dryRun':!![]})),_0x12fe96=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)]['knowledgeBases'][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xec)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)]['experimentalKnowledgeBases'][_0x4164e1(0xc1)]+_0x1af576['counts'][_0x4164e1(0xce)][_0x4164e1(0xc1)],_0x46faa7=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)]['updated']+_0x1af576['counts'][_0x4164e1(0xb3)][_0x4164e1(0x120)]+_0x1af576['counts']['textKnowledgeBases']['updated']+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0x120)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)]['updated']+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x120)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x120)],_0x2be3da=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)]['knowledgeBases']['unchanged']+_0x1af576['counts'][_0x4164e1(0xec)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x11a)];console['log'](_0x4164e1(0x163)+_0x1af576[_0x4164e1(0x16b)]+'\x27:'),console['log']('\x20\x20'+a4_0x5f490c[_0x4164e1(0xc3)]('+\x20'+_0x12fe96+_0x4164e1(0x11b))+_0x4164e1(0xdb)+a4_0x5f490c[_0x4164e1(0xe2)]('~\x20'+_0x46faa7+_0x4164e1(0x103))+_0x4164e1(0xdb)+a4_0x5f490c[_0x4164e1(0x150)]('=\x20'+_0x2be3da+'\x20unchanged')),console[_0x4164e1(0x15a)](_0x4164e1(0xda)+formatCountSummary(_0x1af576['counts'][_0x4164e1(0xed)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1af576[_0x4164e1(0xcc)]['knowledgeBases'])),console[_0x4164e1(0x15a)](_0x4164e1(0x124)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)]['textKnowledgeBases'])),console[_0x4164e1(0x15a)](_0x4164e1(0x13a)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)])),console['log'](_0x4164e1(0x151)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)]));const _0x1332ec=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x15b)]>0x0||_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x15b)]>0x0;_0x1332ec&&(console['log'](_0x4164e1(0x131)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)])),console[_0x4164e1(0x15a)](_0x4164e1(0x144)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)])));console[_0x4164e1(0x15a)](_0x4164e1(0xc8)+a4_0x5f490c[_0x4164e1(0xb0)](_0x1af576['outputDir'])),displayDiffs(_0x1af576[_0x4164e1(0xed)],_0x1af576[_0x4164e1(0xb3)],_0x1af576[_0x4164e1(0xec)],_0x1af576[_0x4164e1(0xdf)],_0x1af576[_0x4164e1(0x141)],_0x1af576[_0x4164e1(0x13d)],_0x1af576[_0x4164e1(0xce)]);if(_0x13159a)return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x133))),0x0;if(_0x12fe96===0x0&&_0x46faa7===0x0)return console['log'](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0xe9))),saveSessionContext({'llm_project':_0x1af576[_0x4164e1(0x16b)]},_0x5c0528[_0x4164e1(0x128)]),console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xc3)]('✔\x20Context\x20set:\x20'+a4_0x5f490c[_0x4164e1(0x150)]('llm_project')+_0x4164e1(0x143)+a4_0x5f490c[_0x4164e1(0xb0)](_0x1af576['projectName']))),0x0;if(!_0x3f1383&&!_0x5f09c2){if(!isInteractive())return console[_0x4164e1(0x119)](a4_0x5f490c['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4164e1(0x119)](a4_0x5f490c['dim'](_0x4164e1(0xd3))),0x1;const _0x85b247=await confirmKey(_0x4164e1(0x10f)+(_0x12fe96+_0x46faa7)+'\x20files?');if(!_0x85b247)return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x139)),_0x4164e1(0xc7)),0x1;}const {data:_0x28bef9}=await withSpinner(_0x4164e1(0x146),()=>_0x2c3198[_0x4164e1(0xcf)][_0x4164e1(0xb9)](_0x3d448e,_0x527d93,{'force':_0x5f09c2}));return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0x11d)+(_0x12fe96+_0x46faa7)+_0x4164e1(0x11c)+_0x28bef9[_0x4164e1(0x114)])),saveSessionContext({'llm_project':_0x28bef9['projectName']},_0x5c0528['session']),console['log'](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0x10c)+a4_0x5f490c[_0x4164e1(0x150)](_0x4164e1(0xf1))+_0x4164e1(0x143)+a4_0x5f490c[_0x4164e1(0xb0)](_0x28bef9[_0x4164e1(0x16b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x331360(0xf4)]=a4_0x331360(0x155);[a4_0x331360(0xb2)]=a4_0x331360(0x15d);async[a4_0x331360(0x100)](_0x5485a6){const _0x233d51=a4_0x331360,{options:_0x289af8,args:_0xe12882,tdx:_0x4868fe}=_0x5485a6,_0x5ca833=_0xe12882[0x0],_0x2c5151=_0x289af8[_0x233d51(0xf4)],_0x56fe8d=_0x289af8[_0x233d51(0x10d)],_0x568b29=_0x289af8[_0x233d51(0x157)],_0x1a1c46=_0x289af8[_0x233d51(0xd4)],_0x3a9416=_0x289af8[_0x233d51(0xfd)];let _0x3e81f8;const _0x524043=findAgentConfigPath(process['cwd']());if(_0x5ca833){const _0x293526=a4_0x4515b8[_0x233d51(0x165)](_0x5ca833,_0x233d51(0xdc));existsSync(_0x293526)?(_0x3e81f8=_0x5ca833,console['log'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0x13e)+_0x5ca833))):_0x3e81f8=_0x5ca833;}else{if(_0x524043)_0x3e81f8=a4_0x4515b8[_0x233d51(0x12e)](_0x524043),console[_0x233d51(0x15a)](a4_0x5f490c['dim'](_0x233d51(0xf6)+_0x3e81f8));else{if(_0x3a9416){const _0x4b90ae=sanitizeForFilesystem(_0x3a9416);let _0x1a75a2=_0x4b90ae,_0x524674=a4_0x4515b8['join'](process[_0x233d51(0x14e)](),_0x233d51(0xed),_0x4b90ae,'tdx.json');if(!existsSync(_0x524674)){const _0x568a34=normalizeName(_0x3a9416),_0x3c744f=a4_0x4515b8[_0x233d51(0x165)](process[_0x233d51(0x14e)](),'agents',_0x568a34,_0x233d51(0xdc));existsSync(_0x3c744f)&&(_0x1a75a2=_0x568a34,_0x524674=_0x3c744f);}if(existsSync(_0x524674))_0x3e81f8=a4_0x4515b8[_0x233d51(0x12e)](_0x524674),console['log'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0x13e)+_0x3e81f8));else{const _0x1d610d=_0x289af8[_0x233d51(0x14d)];if(_0x1d610d)throw new SDKError(ErrorCode[_0x233d51(0x10e)],_0x233d51(0x126)+_0x3a9416+_0x233d51(0x12d),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x233d51(0xef)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x3a9416+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x1a75a2+_0x233d51(0x111)+(_0x2c5151||_0x233d51(0x161))+_0x233d51(0x158)+_0x1d610d)});_0x3e81f8=_0x3a9416,console[_0x233d51(0x15a)](a4_0x5f490c['dim'](_0x233d51(0xf0)+_0x3a9416));}}}}if(!_0x3e81f8)return console['log'](a4_0x5f490c[_0x233d51(0xe2)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x233d51(0x15a)](_0x233d51(0xcd)),console[_0x233d51(0x15a)](_0x233d51(0xe3)),console[_0x233d51(0x15a)](_0x233d51(0xfb)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x2c5151)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x233d51(0xdd),undefined,{'helpText':_0x233d51(0xb7)});if(!_0x568b29&&!_0x56fe8d){if(!isInteractive())return console[_0x233d51(0x119)](a4_0x5f490c[_0x233d51(0x168)]('\x0aError:'),_0x233d51(0xde)),console['error'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0xd3))),0x1;const _0x2f4451=await confirmKey(_0x233d51(0xc9)+_0x3e81f8+_0x233d51(0x14c)+_0x2c5151+'\x22?');if(!_0x2f4451)return console['log'](a4_0x5f490c[_0x233d51(0xe2)]('Cancelled')),0x1;}const {data:_0x149ee9}=await withSpinner(_0x233d51(0x136)+_0x3e81f8+_0x233d51(0xca)+_0x2c5151+_0x233d51(0x12c),()=>_0x4868fe[_0x233d51(0xcf)][_0x233d51(0xbd)](_0x3e81f8,_0x2c5151,{'dryRun':_0x56fe8d}));if(_0x56fe8d){console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0xe2)](_0x233d51(0x12f))),console[_0x233d51(0x15a)](_0x233d51(0x15c)+_0x149ee9[_0x233d51(0x127)]),console[_0x233d51(0x15a)](_0x233d51(0x147)+_0x2c5151),console[_0x233d51(0x15a)](_0x233d51(0xc5)),console[_0x233d51(0x15a)](_0x233d51(0xda)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)][_0x233d51(0x116)]),console[_0x233d51(0x15a)](_0x233d51(0xbb)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)][_0x233d51(0x116)]),console['log'](_0x233d51(0x13a)+_0x149ee9['counts']['prompts'][_0x233d51(0x116)]);const _0x159965=_0x149ee9['counts'][_0x233d51(0x13d)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)]>0x0;return _0x159965&&(console[_0x233d51(0x15a)](_0x233d51(0x131)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x116)]),console['log'](_0x233d51(0x144)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)])),0x0;}const _0x3d17c9=_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xdf)][_0x233d51(0x105)]>0x0||_0x149ee9['counts'][_0x233d51(0x13d)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x105)]>0x0;_0x3d17c9?console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0xe2)](_0x233d51(0x102))):console[_0x233d51(0x15a)](a4_0x5f490c['green'](_0x233d51(0x148)));console[_0x233d51(0x15a)](_0x233d51(0x15c)+_0x149ee9[_0x233d51(0x127)]),console[_0x233d51(0x15a)](_0x233d51(0x147)+_0x149ee9[_0x233d51(0xe5)]),console['log'](_0x233d51(0x11f)+_0x149ee9[_0x233d51(0xb6)]),console[_0x233d51(0x15a)](),console[_0x233d51(0x15a)](_0x233d51(0x121)),console[_0x233d51(0x15a)](_0x233d51(0xda)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)])),console[_0x233d51(0x15a)](_0x233d51(0xbb)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)])),console[_0x233d51(0x15a)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xdf)])),console['log'](_0x233d51(0x151)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x141)]));const _0x19f889=_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)]['experimentalKnowledgeBases'][_0x233d51(0x120)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x11a)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x120)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x11a)]>0x0;_0x19f889&&(console['log'](_0x233d51(0x131)+formatCountSummary(_0x149ee9['counts'][_0x233d51(0x13d)])),console[_0x233d51(0x15a)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x149ee9[_0x233d51(0xcc)]['experimentalArtifacts'])));if(_0x3d17c9){console[_0x233d51(0x15a)](),console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)]('Errors:'));for(const _0x527b79 of _0x149ee9[_0x233d51(0xed)]){_0x527b79[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0xf9)+_0x527b79[_0x233d51(0x10b)]+_0x233d51(0x14a)+_0x527b79['error']));}for(const _0x26049a of _0x149ee9[_0x233d51(0xb3)]){_0x26049a[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0x145)+_0x26049a[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x26049a[_0x233d51(0x119)]));}for(const _0x27c590 of _0x149ee9['prompts']){_0x27c590['action']==='error'&&console['log'](a4_0x5f490c[_0x233d51(0x168)]('\x20\x20Prompt\x20\x22'+_0x27c590[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x27c590[_0x233d51(0x119)]));}for(const _0x1d2544 of _0x149ee9['integrations']){_0x1d2544['action']==='error'&&console['log'](a4_0x5f490c['red'](_0x233d51(0xfa)+_0x1d2544[_0x233d51(0xf4)]+'\x22:\x20'+_0x1d2544[_0x233d51(0x119)]));}for(const _0x40afe1 of _0x149ee9[_0x233d51(0x13d)]){_0x40afe1[_0x233d51(0x166)]===_0x233d51(0x119)&&console['log'](a4_0x5f490c[_0x233d51(0x168)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x40afe1[_0x233d51(0xf4)]+'\x22:\x20'+_0x40afe1[_0x233d51(0x119)]));}for(const _0x304706 of _0x149ee9['experimentalArtifacts']){_0x304706[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0x149)+_0x304706[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x304706[_0x233d51(0x119)]));}return 0x1;}console[_0x233d51(0x15a)]();const _0x383676=getLLMProjectUrl(_0x1a1c46,_0x149ee9[_0x233d51(0xb6)]);return console['log'](_0x233d51(0x14f)+a4_0x5f490c[_0x233d51(0xb0)](_0x383676)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x331360(0xf4)]=a4_0x331360(0xff);[a4_0x331360(0xb2)]=a4_0x331360(0x11e);async[a4_0x331360(0x100)](_0x51702e){const _0xe5d998=a4_0x331360,{options:_0x486db1,args:_0x2282dd,tdx:_0x2ecfc7}=_0x51702e;let _0xa813c8=_0x2282dd[0x0]||process[_0xe5d998(0x14e)]();const _0x41ff62=_0x486db1['dryRun'],_0x232106=_0x486db1['force'],_0x31c85f=_0x486db1['yes'],_0x488537=_0x486db1[_0xe5d998(0xd4)],_0xa77caa=a4_0x4515b8[_0xe5d998(0x165)](_0xa813c8,_0xe5d998(0x162)),_0x3b7b6b=existsSync(_0xa77caa);if(_0x3b7b6b){const {data:_0x52649a}=await withSpinner(_0xe5d998(0x138)+_0xa813c8+_0xe5d998(0x12c),()=>_0x2ecfc7['llm']['pushAgent'](_0xa813c8,{'dryRun':_0x41ff62,'force':_0x232106}));if(_0x41ff62)return console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xe2)](_0xe5d998(0x12f))),console[_0xe5d998(0x15a)](_0xe5d998(0x101)+_0x52649a[_0xe5d998(0x10b)]),0x0;if(_0x52649a['action']===_0xe5d998(0x119))return console['log'](a4_0x5f490c[_0xe5d998(0x168)]('Failed\x20to\x20push\x20agent:\x20'+_0x52649a[_0xe5d998(0x119)])),0x1;console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)](_0xe5d998(0x110)+_0x52649a[_0xe5d998(0x166)]+'\x20successfully')),console[_0xe5d998(0x15a)](_0xe5d998(0x12a)+_0x52649a['agentName']);if(_0x52649a[_0xe5d998(0xfc)]&&_0x52649a[_0xe5d998(0x169)]){const _0x5a87d1=getLLMAgentChatUrl(_0x488537,_0x52649a[_0xe5d998(0x169)],_0x52649a[_0xe5d998(0xfc)]);console[_0xe5d998(0x15a)](_0xe5d998(0xd9)+a4_0x5f490c[_0xe5d998(0xb0)](_0x5a87d1));}return 0x0;}const _0xb4d210=_0x486db1[_0xe5d998(0xfd)],_0x2dcc66=resolveProjectFromContext(_0xa813c8,_0xb4d210);if(_0x2dcc66[_0xe5d998(0x153)])_0xa813c8=_0x2dcc66[_0xe5d998(0x137)],_0x2dcc66[_0xe5d998(0x132)]===_0xe5d998(0x12b)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x150)](_0xe5d998(0xeb)+_0xa813c8));else{let _0x3bee25=_0xe5d998(0xd1);_0x2dcc66[_0xe5d998(0x14b)]===_0xe5d998(0x117)&&(_0x3bee25=_0x2dcc66[_0xe5d998(0xf2)]+_0xe5d998(0xc0)+_0x2dcc66[_0xe5d998(0xfd)]+_0xe5d998(0xe4));throw new SDKError(ErrorCode[_0xe5d998(0x10e)],_0x2dcc66[_0xe5d998(0x14b)]===_0xe5d998(0x156)?_0x2dcc66[_0xe5d998(0xf2)]:_0xe5d998(0xe1)+_0xa813c8,undefined,{'helpText':_0x3bee25});}const {data:_0x2101a7}=await withSpinner(_0xe5d998(0x154),()=>_0x2ecfc7[_0xe5d998(0xcf)][_0xe5d998(0xf7)](_0xa813c8,{'dryRun':!![]})),_0x45df95=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x105)]>0x0;if(_0x45df95){console[_0xe5d998(0x15a)](a4_0x5f490c['red'](_0xe5d998(0xd6)));for(const _0x690b87 of _0x2101a7[_0xe5d998(0xed)]){_0x690b87[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)]('\x20\x20Agent\x20\x22'+_0x690b87[_0xe5d998(0x10b)]+_0xe5d998(0x14a)+_0x690b87[_0xe5d998(0x119)]));}return 0x1;}const _0x59ae31=_0x2101a7[_0xe5d998(0xcc)]['agents'][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x141)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)]['experimentalKnowledgeBases'][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)]['created'],_0x5a3dbb=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)]['updated']+_0x2101a7[_0xe5d998(0xcc)]['prompts'][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)]['integrations'][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x120)],_0x37eddb=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x11a)]+_0x2101a7['counts'][_0xe5d998(0xb3)]['unchanged']+_0x2101a7['counts'][_0xe5d998(0xec)][_0xe5d998(0x11a)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x11a)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x141)]['unchanged']+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)]['unchanged']+_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x11a)];console['log'](_0xe5d998(0x112)+_0x2101a7[_0xe5d998(0x16b)]+'\x27:'),console[_0xe5d998(0x15a)]('\x20\x20'+a4_0x5f490c[_0xe5d998(0xc3)]('+\x20'+_0x59ae31+'\x20new')+_0xe5d998(0xdb)+a4_0x5f490c['yellow']('~\x20'+_0x5a3dbb+'\x20changed')+_0xe5d998(0xdb)+a4_0x5f490c[_0xe5d998(0x150)]('=\x20'+_0x37eddb+_0xe5d998(0xf3))),console['log'](_0xe5d998(0xda)+formatCountSummary(_0x2101a7['counts'][_0xe5d998(0xed)])),console[_0xe5d998(0x15a)](_0xe5d998(0xbb)+formatCountSummary(_0x2101a7['counts'][_0xe5d998(0xb3)])),console['log'](_0xe5d998(0x124)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)])),console[_0xe5d998(0x15a)](_0xe5d998(0x13a)+formatCountSummary(_0x2101a7['counts']['prompts'])),console[_0xe5d998(0x15a)](_0xe5d998(0x151)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)]['integrations']));const _0x176993=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x116)]>0x0||_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x120)]>0x0||_0x2101a7['counts'][_0xe5d998(0x13d)]['unchanged']>0x0||_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)][_0xe5d998(0x116)]>0x0||_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x120)]>0x0||_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x11a)]>0x0;_0x176993&&(console['log'](_0xe5d998(0x131)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)])));console[_0xe5d998(0x15a)]('\x20\x20Source:\x20'+a4_0x5f490c[_0xe5d998(0xb0)](_0xa813c8)),displayDiffs(_0x2101a7['agents'],_0x2101a7[_0xe5d998(0xb3)],_0x2101a7[_0xe5d998(0xec)],_0x2101a7['prompts'],_0x2101a7[_0xe5d998(0x141)],_0x2101a7[_0xe5d998(0x13d)],_0x2101a7['experimentalArtifacts']);if(_0x41ff62)return console['log'](a4_0x5f490c['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x59ae31===0x0&&_0x5a3dbb===0x0){console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x36ff45=getLLMProjectUrl(_0x488537,_0x2101a7[_0xe5d998(0x169)]);return console[_0xe5d998(0x15a)](_0xe5d998(0x14f)+a4_0x5f490c[_0xe5d998(0xb0)](_0x36ff45)),0x0;}if(!_0x31c85f&&!_0x232106){if(!isInteractive())return console[_0xe5d998(0x119)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0x167)),_0xe5d998(0xde)),console[_0xe5d998(0x119)](a4_0x5f490c[_0xe5d998(0x150)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x582951=await confirmKey('\x0aPush\x20'+(_0x59ae31+_0x5a3dbb)+'\x20resources?');if(!_0x582951)return console[_0xe5d998(0x15a)](a4_0x5f490c['yellow'](_0xe5d998(0x139)),_0xe5d998(0xd5)),0x1;}const {data:_0x53ee01}=await withSpinner(_0xe5d998(0x104),()=>_0x2ecfc7[_0xe5d998(0xcf)]['pushProject'](_0xa813c8,{'force':_0x232106})),_0x19d1ab=_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x105)]>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x105)]>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xec)]['errors']>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x105)]>0x0;if(_0x19d1ab){console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xe2)](_0xe5d998(0xb1))),console[_0xe5d998(0x15a)](),console[_0xe5d998(0x15a)](a4_0x5f490c['red'](_0xe5d998(0xee)));for(const _0x38fd21 of _0x53ee01[_0xe5d998(0xed)]){_0x38fd21['action']===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xf9)+_0x38fd21['agentName']+_0xe5d998(0x14a)+_0x38fd21[_0xe5d998(0x119)]));}for(const _0x5014fa of _0x53ee01[_0xe5d998(0xb3)]){_0x5014fa[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0x145)+_0x5014fa['name']+_0xe5d998(0x14a)+_0x5014fa[_0xe5d998(0x119)]));}for(const _0x3f25b0 of _0x53ee01[_0xe5d998(0xec)]){_0x3f25b0[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console['log'](a4_0x5f490c['red'](_0xe5d998(0xb4)+_0x3f25b0[_0xe5d998(0xf4)]+_0xe5d998(0x14a)+_0x3f25b0[_0xe5d998(0x119)]));}for(const _0x92e369 of _0x53ee01['prompts']){_0x92e369[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xe6)+_0x92e369[_0xe5d998(0xf4)]+_0xe5d998(0x14a)+_0x92e369[_0xe5d998(0x119)]));}for(const _0x54d352 of _0x53ee01['integrations']){_0x54d352['action']===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xfa)+_0x54d352['name']+'\x22:\x20'+_0x54d352[_0xe5d998(0x119)]));}return 0x1;}console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)](_0xe5d998(0x135)+(_0x59ae31+_0x5a3dbb)+_0xe5d998(0x109)+_0x53ee01[_0xe5d998(0x16b)]+'\x27'));const _0x5cc9c4=getLLMProjectUrl(_0x488537,_0x53ee01['projectId']);return console[_0xe5d998(0x15a)](_0xe5d998(0x14f)+a4_0x5f490c[_0xe5d998(0xb0)](_0x5cc9c4)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x425988=a5_0x29f4;(function(_0xc1082d,_0x119e0f){const _0x3cc229=a5_0x29f4,_0x3420b8=_0xc1082d();while(!![]){try{const _0x2ac8d6=parseInt(_0x3cc229(0x15d))/0x1+-parseInt(_0x3cc229(0x183))/0x2*(-parseInt(_0x3cc229(0x17a))/0x3)+-parseInt(_0x3cc229(0x164))/0x4*(-parseInt(_0x3cc229(0x137))/0x5)+parseInt(_0x3cc229(0x131))/0x6*(parseInt(_0x3cc229(0x16a))/0x7)+-parseInt(_0x3cc229(0x1b1))/0x8+-parseInt(_0x3cc229(0x18e))/0x9+-parseInt(_0x3cc229(0x135))/0xa;if(_0x2ac8d6===_0x119e0f)break;else _0x3420b8['push'](_0x3420b8['shift']());}catch(_0x1b72e2){_0x3420b8['push'](_0x3420b8['shift']());}}}(a5_0x2cf0,0x18b1e));import*as a5_0x487957 from'node:fs';import*as a5_0xcad501 from'node:path';import a5_0x274d4d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x29f4(_0x1b4246,_0x148c63){_0x1b4246=_0x1b4246-0x129;const _0x2cf0a9=a5_0x2cf0();let _0x29f431=_0x2cf0a9[_0x1b4246];return _0x29f431;}function a5_0x2cf0(){const _0x4c5409=['testYmlPath','green','verbose','includes','\x20\x20Agent:\x20','FAIL','substring','eval','dim','now','\x20(cached)','Re-evaluating\x20','Site:\x20','9itliDt','Error:\x20No\x20previous\x20test\x20run\x20found.','...','projectName','agent:test','dryRun','New\x20tests\x20to\x20execute:\x20','forEach','join','74012XqhHIa','Running\x20agent\x20tests...','Test\x20Summary','tsv','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Test\x20Configuration:','round','map','\x20(new)','red','✗\x20ERROR:\x20','1627038LYMkNQ','existsSync','name','reason','executeReeval','agentDirs','not\x20found','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','agentName','cyan','Run\x20tests\x20for\x20an\x20LLM\x20agent','404','filter','Duration:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✓\x20PASS:\x20','found','Round\x20','\x20-\x20','start','toLowerCase','Agent:\x20','output','no_tests','some','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20FAIL:\x20','Available\x20tags:\x20','Tests\x20found:\x20','conversations','rounds','llm','\x20\x20Conversation:\x20','length','Passed:\x20\x20\x20','1171224ZpXjJQ','agent','reeval','\x20\x20Round\x20','Errors:\x20\x20\x20','Output\x20written\x20to:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','/<agent-name>','\x22,\x20but\x20current\x20site\x20is\x20\x22','Evaluating\x20response...',':\x20Sending\x20user\x20input...','basename','837222PSDiey','Project\x20path:\x20','No\x20tests\x20have\x20tags\x20defined.','...\x20','921670BIJOBC','no_context','729415JaZEwx','message','⚠\x20SKIPPED:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','table','No\x20tests\x20found\x20with\x20tags:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','yellow','Re-evaluating...','resolve','tests','json','timestamp','split','testName','stop','white','Either\x20switch\x20to\x20the\x20\x22','status','Failed:\x20\x20\x20','ERROR','has','tags','no_local_folder','PASS','text','size','jsonl','conversation_url','utf-8','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','log','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20Site:\x20','push','find','\x22:\x20','124064vnbSMb','repeat','writeFileSync','add','Running:\x20','toISOString','test.yml','4IwdTLr','Re-evaluating\x20cached\x20test\x20run...','projectDir','llmProject','No\x20tests\x20found\x20matching:\x20','Using\x20agent:\x20','7pePsda','Test\x20','site'];a5_0x2cf0=function(){return _0x4c5409;};return a5_0x2cf0();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x425988(0x190)]=a5_0x425988(0x17e);['description']=a5_0x425988(0x198);async['execute'](_0x23cabc){const _0x5dcc18=a5_0x425988,{options:_0x365661,args:_0xed7c38,tdx:_0x1c10b5}=_0x23cabc,_0x2b68b1=_0xed7c38[0x0]||'.',_0x191251=_0x365661[_0x5dcc18(0x17f)],_0x1e2e04=_0x365661,_0x29db99=_0x1e2e04[_0x5dcc18(0x174)]===![],_0x25979b=_0x1e2e04[_0x5dcc18(0x1b3)],_0x5267ef=_0x1e2e04['name'],_0x5a3cee=_0x1e2e04[_0x5dcc18(0x14e)],_0x2a286d=_0x365661[_0x5dcc18(0x16c)],_0xf9049c=_0x1e2e04[_0x5dcc18(0x1a4)];if(_0x25979b&&_0x29db99)return console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)](_0x5dcc18(0x13b))),0x1;let _0x37597d=_0x5dcc18(0x13c);if(_0x1e2e04['json'])_0x37597d=_0x5dcc18(0x143);else{if(_0x1e2e04[_0x5dcc18(0x153)])_0x37597d=_0x5dcc18(0x153);else{if(_0x1e2e04[_0x5dcc18(0x186)])_0x37597d=_0x5dcc18(0x186);else{if(_0x1e2e04[_0x5dcc18(0x13c)])_0x37597d=_0x5dcc18(0x13c);}}}const _0xcb5f04=_0x1e2e04[_0x5dcc18(0x167)];let _0x186ccc=_0x2b68b1;const _0x43deff=a5_0x487957[_0x5dcc18(0x18f)](_0x2b68b1),_0x59db02=_0x2b68b1==='.';if(!_0x43deff||_0x59db02){const _0x5606f7=resolveProjectFromContext(_0x2b68b1,_0xcb5f04,{'requireFile':_0x5dcc18(0x163)});if(_0x5606f7[_0x5dcc18(0x19e)])_0x186ccc=_0x5606f7[_0x5dcc18(0x166)],_0x5606f7['source']==='context'&&console['log'](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x169)+_0x186ccc));else switch(_0x5606f7['reason']){case _0x5dcc18(0x136):console['log'](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5606f7[_0x5dcc18(0x138)])),console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)]('Usage:'),console[_0x5dcc18(0x157)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x5dcc18(0x157)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x5dcc18(0x14f):console[_0x5dcc18(0x157)](a5_0x274d4d['yellow'](_0x5606f7[_0x5dcc18(0x138)])),console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x5dcc18(0x13a)+_0x5606f7[_0x5dcc18(0x167)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0xe0bde0=a5_0xcad501[_0x5dcc18(0x130)](_0x5606f7['projectDir']);console[_0x5dcc18(0x157)](a5_0x274d4d['yellow'](_0x5dcc18(0x156)+_0x5606f7[_0x5dcc18(0x167)]+'\x22:'));for(const _0x509d3c of _0x5606f7[_0x5dcc18(0x193)]){console[_0x5dcc18(0x157)]('\x20\x20-\x20'+_0x509d3c);}return console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x5dcc18(0x1a7)+_0xe0bde0+_0x5dcc18(0x12c)),0x1;}case _0x5dcc18(0x1a5):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5dcc18(0x13e)+_0x5606f7[_0x5dcc18(0x167)]+'\x22.')),console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x132)+_0x5606f7[_0x5dcc18(0x166)])),console[_0x5dcc18(0x157)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x27d234,agentInfo:_0x8e4041}=parseTestFile(_0x186ccc);let _0x393941=_0x27d234[_0x5dcc18(0x142)];if(_0x5267ef){const _0x5ba9b6=_0x5267ef[_0x5dcc18(0x145)](',')[_0x5dcc18(0x18a)](_0x10ae5e=>_0x10ae5e['trim']());_0x393941=_0x27d234[_0x5dcc18(0x142)][_0x5dcc18(0x19a)](_0x1e9065=>_0x5ba9b6[_0x5dcc18(0x170)](_0x1e9065['name']));if(_0x393941[_0x5dcc18(0x1af)]===0x0)return console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5dcc18(0x168)+_0x5267ef)),console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x175)]('Available\x20tests:\x20'+_0x27d234[_0x5dcc18(0x142)]['map'](_0x2f12a7=>_0x2f12a7['name'])['join'](',\x20'))),0x1;}if(_0x5a3cee){const _0x37c89c=_0x5a3cee['split'](',')[_0x5dcc18(0x18a)](_0x4dfc1b=>_0x4dfc1b['trim']()[_0x5dcc18(0x1a2)]());_0x393941=_0x393941[_0x5dcc18(0x19a)](_0x40f70a=>_0x40f70a['tags']?.[_0x5dcc18(0x1a6)](_0x35fe4b=>_0x37c89c[_0x5dcc18(0x170)](_0x35fe4b['toLowerCase']())));if(_0x393941[_0x5dcc18(0x1af)]===0x0){console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x13f)](_0x5dcc18(0x13d)+_0x5a3cee));const _0x56875e=new Set();return _0x27d234[_0x5dcc18(0x142)][_0x5dcc18(0x181)](_0x31d2e8=>_0x31d2e8[_0x5dcc18(0x14e)]?.[_0x5dcc18(0x181)](_0x512a26=>_0x56875e[_0x5dcc18(0x160)](_0x512a26))),_0x56875e[_0x5dcc18(0x152)]>0x0?console['log'](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x1a9)+[..._0x56875e][_0x5dcc18(0x182)](',\x20'))):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x175)](_0x5dcc18(0x133))),0x1;}}if(_0x25979b)return this[_0x5dcc18(0x192)](_0x23cabc,{'definition':{'tests':_0x393941},'agentInfo':_0x8e4041,'outputFormat':_0x37597d,'outputFile':_0xf9049c,'testNames':_0x5267ef});if(_0x191251){console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x197)](_0x5dcc18(0x188))),console['log'](_0x5dcc18(0x159)+a5_0x274d4d[_0x5dcc18(0x148)](_0x2a286d)),console['log']('\x20\x20Project:\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x8e4041['projectName'])),console[_0x5dcc18(0x157)](_0x5dcc18(0x171)+a5_0x274d4d[_0x5dcc18(0x148)](_0x8e4041[_0x5dcc18(0x196)])),console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x5dcc18(0x1aa)+a5_0x274d4d[_0x5dcc18(0x148)](_0x393941[_0x5dcc18(0x1af)]));for(let _0x53d83c=0x0;_0x53d83c<_0x393941[_0x5dcc18(0x1af)];_0x53d83c++){const _0x52480e=_0x393941[_0x53d83c],_0xa96578=_0x52480e['rounds'][_0x5dcc18(0x1af)]===0x1?_0x5dcc18(0x189):_0x5dcc18(0x1ac),_0x5193f0=_0x52480e[_0x5dcc18(0x14e)]?.['length']?'\x20['+_0x52480e[_0x5dcc18(0x14e)][_0x5dcc18(0x182)](',\x20')+']':'';console[_0x5dcc18(0x157)]('\x20\x20'+(_0x53d83c+0x1)+'.\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x52480e['name'])+'\x20('+_0x52480e[_0x5dcc18(0x1ac)][_0x5dcc18(0x1af)]+'\x20'+_0xa96578+')'+a5_0x274d4d[_0x5dcc18(0x175)](_0x5193f0));}return 0x0;}let _0x244da0,_0x468501;try{_0x244da0=await _0x1c10b5[_0x5dcc18(0x1ad)]['resolveProjectId'](_0x8e4041[_0x5dcc18(0x17d)]);}catch(_0x118e3c){const _0x1df888=_0x118e3c instanceof Error?_0x118e3c[_0x5dcc18(0x138)]:String(_0x118e3c);return _0x1df888['includes']('404')||_0x1df888[_0x5dcc18(0x1a2)]()[_0x5dcc18(0x170)](_0x5dcc18(0x194))?console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x8e4041[_0x5dcc18(0x17d)])):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x8e4041[_0x5dcc18(0x17d)]+_0x5dcc18(0x15c)+_0x1df888)),0x1;}try{_0x468501=await _0x1c10b5['llm']['resolveAgentId'](_0x8e4041[_0x5dcc18(0x196)],_0x244da0);}catch(_0x116db7){const _0x2ab2ee=_0x116db7 instanceof Error?_0x116db7['message']:String(_0x116db7);return _0x2ab2ee['includes'](_0x5dcc18(0x199))||_0x2ab2ee[_0x5dcc18(0x1a2)]()[_0x5dcc18(0x170)](_0x5dcc18(0x194))?console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)](_0x5dcc18(0x195)+_0x8e4041['agentName'])):console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x8e4041['agentName']+_0x5dcc18(0x15c)+_0x2ab2ee)),0x1;}let _0x4ee521;if(!_0x29db99)try{_0x4ee521=await setupEvaluatorAgent(_0x1c10b5[_0x5dcc18(0x1ad)],_0x365661[_0x5dcc18(0x16f)]);}catch(_0x36f711){const _0x538141=_0x36f711 instanceof Error?_0x36f711[_0x5dcc18(0x138)]:String(_0x36f711);return console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x538141)),0x1;}console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x197)](_0x5dcc18(0x184))),console[_0x5dcc18(0x157)](_0x5dcc18(0x179)+a5_0x274d4d[_0x5dcc18(0x148)](_0x2a286d)),console['log'](_0x5dcc18(0x1a3)+a5_0x274d4d['white'](_0x8e4041[_0x5dcc18(0x17d)]+'/'+_0x8e4041[_0x5dcc18(0x196)])),console[_0x5dcc18(0x157)]();const _0x5972ab=[],_0x5a6c81=[],_0x43fbbd=Date[_0x5dcc18(0x176)]();for(let _0x15df6d=0x0;_0x15df6d<_0x393941[_0x5dcc18(0x1af)];_0x15df6d++){const _0x238de6=_0x393941[_0x15df6d];_0x393941['length']>0x1?console[_0x5dcc18(0x157)](_0x5dcc18(0x16b)+(_0x15df6d+0x1)+'/'+_0x393941[_0x5dcc18(0x1af)]+':\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x238de6[_0x5dcc18(0x190)])):console[_0x5dcc18(0x157)]('Running\x20test:\x20'+a5_0x274d4d[_0x5dcc18(0x148)](_0x238de6['name']));const _0x3a0f97=createCommandSpinner('Round\x201/'+_0x238de6[_0x5dcc18(0x1ac)][_0x5dcc18(0x1af)]+_0x5dcc18(0x12f));_0x3a0f97[_0x5dcc18(0x1a1)]();try{const {result:_0x433d01,conversation:_0x56786a}=await runTest(_0x1c10b5[_0x5dcc18(0x1ad)],_0x238de6,{'agentId':_0x468501,'projectId':_0x244da0,'site':_0x2a286d,'noEval':_0x29db99,'evaluatorId':_0x4ee521,'onRoundStart':(_0x22b7b8,_0x568091)=>{const _0x747419=_0x5dcc18;_0x3a0f97['text']=_0x747419(0x19f)+(_0x22b7b8+0x1)+'/'+_0x568091+_0x747419(0x12f);},'onRoundComplete':(_0x3ff152,_0x1dbaf7,_0x498cfb)=>{const _0x3f9d47=_0x5dcc18,_0x2da17e=formatElapsed(_0x1dbaf7);_0x498cfb?console[_0x3f9d47(0x157)]('\x20\x20Round\x20'+(_0x3ff152+0x1)+'/'+_0x238de6['rounds'][_0x3f9d47(0x1af)]+_0x3f9d47(0x134)+a5_0x274d4d[_0x3f9d47(0x16e)]('✓')+'\x20('+_0x2da17e+')'):console[_0x3f9d47(0x157)](_0x3f9d47(0x1b4)+(_0x3ff152+0x1)+'/'+_0x238de6['rounds'][_0x3f9d47(0x1af)]+_0x3f9d47(0x134)+a5_0x274d4d[_0x3f9d47(0x18c)]('✗'));},'onEvaluationStart':()=>{const _0x34ed64=_0x5dcc18;_0x3a0f97[_0x34ed64(0x151)]=_0x34ed64(0x12e);},'onEvaluationComplete':_0x5aab1d=>{const _0x273ed9=_0x5dcc18,_0x21691d=formatElapsed(_0x5aab1d);console[_0x273ed9(0x157)]('\x20\x20Evaluating...\x20'+a5_0x274d4d['green']('✓')+'\x20('+_0x21691d+')');}});_0x3a0f97['stop'](),_0x5972ab['push'](_0x433d01),_0x5a6c81[_0x5dcc18(0x15a)](_0x56786a);if(_0x433d01['status']===_0x5dcc18(0x150))console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x16e)](_0x5dcc18(0x19d)+_0x433d01[_0x5dcc18(0x191)]));else _0x433d01[_0x5dcc18(0x14a)]===_0x5dcc18(0x172)?console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('✗\x20FAIL:\x20'+_0x433d01[_0x5dcc18(0x191)])):console[_0x5dcc18(0x157)](a5_0x274d4d['red'](_0x5dcc18(0x18d)+_0x433d01['reason']));_0x433d01[_0x5dcc18(0x154)]&&console[_0x5dcc18(0x157)](a5_0x274d4d['dim']('Conversation\x20URL:\x20'+_0x433d01[_0x5dcc18(0x154)])),console[_0x5dcc18(0x157)]();}catch(_0x2006e7){_0x3a0f97[_0x5dcc18(0x147)]();const _0xf9ad6a=_0x2006e7 instanceof Error?_0x2006e7[_0x5dcc18(0x138)]:String(_0x2006e7);console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)](_0x5dcc18(0x18d)+_0xf9ad6a)),console[_0x5dcc18(0x157)](),_0x5972ab['push']({'name':_0x238de6[_0x5dcc18(0x190)],'status':_0x5dcc18(0x14c),'reason':_0xf9ad6a,'timestamp':new Date()[_0x5dcc18(0x162)](),'duration_ms':0x0});}}const _0x3b7e28=Date['now']()-_0x43fbbd,_0x1c383b=_0x5972ab['filter'](_0x2b049c=>_0x2b049c[_0x5dcc18(0x14a)]===_0x5dcc18(0x150))[_0x5dcc18(0x1af)],_0xce7949=_0x5972ab[_0x5dcc18(0x19a)](_0x43a65f=>_0x43a65f[_0x5dcc18(0x14a)]===_0x5dcc18(0x172))[_0x5dcc18(0x1af)],_0x53751c=_0x5972ab[_0x5dcc18(0x19a)](_0x1184cd=>_0x1184cd[_0x5dcc18(0x14a)]===_0x5dcc18(0x14c))[_0x5dcc18(0x1af)];console['log']('━'[_0x5dcc18(0x15e)](0x3c)),console[_0x5dcc18(0x157)](_0x5dcc18(0x185)),console[_0x5dcc18(0x157)]('━'[_0x5dcc18(0x15e)](0x3c)),console[_0x5dcc18(0x157)]('Total:\x20\x20\x20\x20'+_0x5972ab[_0x5dcc18(0x1af)]),console[_0x5dcc18(0x157)]('Passed:\x20\x20\x20'+a5_0x274d4d[_0x5dcc18(0x16e)](_0x1c383b)),console[_0x5dcc18(0x157)](_0x5dcc18(0x14b)+a5_0x274d4d[_0x5dcc18(0x18c)](_0xce7949));_0x53751c>0x0&&console[_0x5dcc18(0x157)](_0x5dcc18(0x129)+a5_0x274d4d['red'](_0x53751c));console[_0x5dcc18(0x157)](_0x5dcc18(0x19b)+formatElapsed(_0x3b7e28)),console[_0x5dcc18(0x157)]('━'[_0x5dcc18(0x15e)](0x3c));const _0x164c91=_0x5972ab[_0x5dcc18(0x19a)](_0x21c2f8=>_0x21c2f8[_0x5dcc18(0x14a)]!==_0x5dcc18(0x150));if(_0x164c91[_0x5dcc18(0x1af)]>0x0){console['log'](),console[_0x5dcc18(0x157)]('Failed\x20Tests:');for(const _0x3bfbd9 of _0x164c91){const _0x45edeb=a5_0x274d4d[_0x5dcc18(0x18c)]('✗'),_0x6ea7f1=_0x3bfbd9[_0x5dcc18(0x191)][_0x5dcc18(0x1af)]>0x32?_0x3bfbd9[_0x5dcc18(0x191)][_0x5dcc18(0x173)](0x0,0x32)+_0x5dcc18(0x17c):_0x3bfbd9[_0x5dcc18(0x191)];console[_0x5dcc18(0x157)]('\x20\x20'+_0x45edeb+'\x20'+_0x3bfbd9[_0x5dcc18(0x190)]+':\x20'+_0x6ea7f1);}}const _0x3858ab={'summary':{'total':_0x5972ab['length'],'passed':_0x1c383b,'failed':_0xce7949,'errors':_0x53751c>0x0?_0x53751c:undefined,'duration_ms':_0x3b7e28},'tests':_0x5972ab,'agent':{'project':_0x8e4041[_0x5dcc18(0x17d)],'name':_0x8e4041['agentName'],'site':_0x2a286d},'timestamp':new Date(_0x43fbbd)['toISOString']()};try{const _0x25444c=buildCachedTestRun(_0x5a6c81,{'site':_0x2a286d,'projectId':_0x244da0,'projectName':_0x8e4041[_0x5dcc18(0x17d)],'agentId':_0x468501,'agentName':_0x8e4041[_0x5dcc18(0x196)],'testYmlPath':a5_0xcad501[_0x5dcc18(0x141)](_0x8e4041[_0x5dcc18(0x16d)])});saveLastTestRun(_0x25444c);}catch{}if(_0x37597d!==_0x5dcc18(0x13c)||_0xf9049c){const _0x3f588f=formatResults(_0x3858ab,_0x37597d);if(_0xf9049c)try{a5_0x487957[_0x5dcc18(0x15f)](_0xf9049c,_0x3f588f,'utf-8'),console[_0x5dcc18(0x157)](),console['log'](a5_0x274d4d[_0x5dcc18(0x175)]('Output\x20written\x20to:\x20'+_0xf9049c));}catch(_0x553140){return console['log'](),console[_0x5dcc18(0x157)](a5_0x274d4d[_0x5dcc18(0x18c)]('Error\x20writing\x20output\x20file:\x20'+_0x553140)),0x1;}else console[_0x5dcc18(0x157)](),console[_0x5dcc18(0x157)](_0x3f588f);}return _0x164c91[_0x5dcc18(0x1af)]>0x0?0x1:0x0;}async[a5_0x425988(0x192)](_0x585462,_0xb11a51){const _0x4d5562=a5_0x425988,{options:_0x24d861,tdx:_0x16829f}=_0x585462,{definition:_0x1afb96,agentInfo:_0x82aa60,outputFormat:_0x5235b3,outputFile:_0x77df43}=_0xb11a51,_0x3e6d76=_0x24d861[_0x4d5562(0x16c)],_0x1a9474=loadLastTestRun();if(!_0x1a9474)return console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)](_0x4d5562(0x17b))),console[_0x4d5562(0x157)](a5_0x274d4d['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x1a9474[_0x4d5562(0x1b2)][_0x4d5562(0x196)]!==_0x82aa60['agentName'])return console[_0x4d5562(0x157)](a5_0x274d4d['red'](_0x4d5562(0x158)+_0x1a9474[_0x4d5562(0x1b2)][_0x4d5562(0x196)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x82aa60[_0x4d5562(0x196)]+'\x22.')),console['log'](a5_0x274d4d['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1d520d=new Set(_0x1a9474[_0x4d5562(0x1ab)]['map'](_0x41d0bb=>_0x41d0bb[_0x4d5562(0x146)])),_0x41adfa=_0x1afb96[_0x4d5562(0x142)]['filter'](_0x95a178=>!_0x1d520d['has'](_0x95a178[_0x4d5562(0x190)]));if(_0x41adfa[_0x4d5562(0x1af)]>0x0&&_0x1a9474[_0x4d5562(0x16c)]!==_0x3e6d76)return console[_0x4d5562(0x157)](a5_0x274d4d['red'](_0x4d5562(0x12b))),console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x175)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x1a9474[_0x4d5562(0x16c)]+_0x4d5562(0x12d)+_0x3e6d76+'\x22.')),console[_0x4d5562(0x157)](a5_0x274d4d['dim'](_0x4d5562(0x149)+_0x1a9474['site']+_0x4d5562(0x19c))),0x1;const _0x3a3627=_0x1afb96[_0x4d5562(0x142)][_0x4d5562(0x19a)](_0x1bc800=>_0x1d520d[_0x4d5562(0x14d)](_0x1bc800['name'])),_0x465fa9=_0x41adfa;let _0x51c953;try{_0x51c953=await setupEvaluatorAgent(_0x16829f[_0x4d5562(0x1ad)],_0x24d861[_0x4d5562(0x16f)]);}catch(_0x20a10b){const _0x3eeae8=_0x20a10b instanceof Error?_0x20a10b['message']:String(_0x20a10b);return console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3eeae8)),0x1;}console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x197)](_0x4d5562(0x165))),console[_0x4d5562(0x157)]('Cached\x20run\x20from:\x20'+a5_0x274d4d['white'](_0x1a9474[_0x4d5562(0x144)])),console[_0x4d5562(0x157)](_0x4d5562(0x1a3)+a5_0x274d4d[_0x4d5562(0x148)](_0x1a9474[_0x4d5562(0x1b2)][_0x4d5562(0x17d)]+'/'+_0x1a9474[_0x4d5562(0x1b2)]['agentName']));_0x465fa9[_0x4d5562(0x1af)]>0x0&&console[_0x4d5562(0x157)](_0x4d5562(0x180)+a5_0x274d4d['yellow'](_0x465fa9['length']));console[_0x4d5562(0x157)]();const _0x2a8fe4=[],_0x3ec432=Date['now'](),_0x25b8ab=createCommandSpinner(_0x4d5562(0x140));if(_0x3a3627[_0x4d5562(0x1af)]>0x0)try{const _0x302672=await reevaluateFromCache(_0x16829f[_0x4d5562(0x1ad)],_0x1a9474,{'tests':_0x3a3627},{'evaluatorId':_0x51c953,'onTestStart':(_0x1dfe8b,_0x252cf5,_0xe26a8)=>{const _0x529cf1=_0x4d5562;_0x25b8ab[_0x529cf1(0x151)]=_0x529cf1(0x178)+(_0x252cf5+0x1)+'/'+_0xe26a8+':\x20'+_0x1dfe8b+_0x529cf1(0x17c);if(!_0x25b8ab['isSpinning'])_0x25b8ab[_0x529cf1(0x1a1)]();},'onTestComplete':(_0x38b568,_0x474598)=>{const _0xe9dc8=_0x4d5562;_0x25b8ab[_0xe9dc8(0x147)]();if(_0x474598[_0xe9dc8(0x14a)]===_0xe9dc8(0x150))console[_0xe9dc8(0x157)](a5_0x274d4d[_0xe9dc8(0x16e)](_0xe9dc8(0x19d)+_0x38b568)+a5_0x274d4d[_0xe9dc8(0x175)](_0xe9dc8(0x177)));else _0x474598[_0xe9dc8(0x14a)]===_0xe9dc8(0x172)?console[_0xe9dc8(0x157)](a5_0x274d4d['red'](_0xe9dc8(0x1a8)+_0x38b568+'\x20-\x20'+_0x474598[_0xe9dc8(0x191)])+a5_0x274d4d[_0xe9dc8(0x175)](_0xe9dc8(0x177))):console[_0xe9dc8(0x157)](a5_0x274d4d[_0xe9dc8(0x18c)](_0xe9dc8(0x18d)+_0x38b568+_0xe9dc8(0x1a0)+_0x474598[_0xe9dc8(0x191)]));_0x474598[_0xe9dc8(0x154)]&&console[_0xe9dc8(0x157)](a5_0x274d4d[_0xe9dc8(0x175)](_0xe9dc8(0x1ae)+_0x474598[_0xe9dc8(0x154)])),_0x2a8fe4[_0xe9dc8(0x15a)](_0x474598);},'onTestSkipped':(_0x27bc2a,_0x1d468c)=>{const _0x481339=_0x4d5562;_0x25b8ab[_0x481339(0x147)](),console[_0x481339(0x157)](a5_0x274d4d[_0x481339(0x13f)](_0x481339(0x139)+_0x27bc2a+_0x481339(0x1a0)+_0x1d468c));}});for(const _0x33863c of _0x302672){!_0x2a8fe4[_0x4d5562(0x15b)](_0x3345d3=>_0x3345d3[_0x4d5562(0x190)]===_0x33863c[_0x4d5562(0x190)])&&_0x2a8fe4['push'](_0x33863c);}}catch(_0x4d7316){_0x25b8ab['stop']();const _0x1d6402=_0x4d7316 instanceof Error?_0x4d7316[_0x4d5562(0x138)]:String(_0x4d7316);return console['log'](a5_0x274d4d[_0x4d5562(0x18c)](_0x4d5562(0x187)+_0x1d6402)),0x1;}_0x25b8ab[_0x4d5562(0x147)]();if(_0x465fa9[_0x4d5562(0x1af)]>0x0){console[_0x4d5562(0x157)](),console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x197)]('Executing\x20new\x20tests...'));const {projectId:_0x127b49,agentId:_0x360aa2}=_0x1a9474[_0x4d5562(0x1b2)];for(const _0x47cad2 of _0x465fa9){console[_0x4d5562(0x157)](_0x4d5562(0x161)+a5_0x274d4d[_0x4d5562(0x148)](_0x47cad2['name']));const _0x28eeed=createCommandSpinner('Round\x201/'+_0x47cad2[_0x4d5562(0x1ac)]['length']+_0x4d5562(0x12f));_0x28eeed['start']();try{const {result:_0x30afb0}=await runTest(_0x16829f[_0x4d5562(0x1ad)],_0x47cad2,{'agentId':_0x360aa2,'projectId':_0x127b49,'site':_0x1a9474[_0x4d5562(0x16c)],'noEval':![],'evaluatorId':_0x51c953,'onRoundStart':(_0x57f1b2,_0x5a34be)=>{const _0x58788a=_0x4d5562;_0x28eeed[_0x58788a(0x151)]='Round\x20'+(_0x57f1b2+0x1)+'/'+_0x5a34be+_0x58788a(0x12f);},'onRoundComplete':(_0x5e964a,_0x1af41b,_0x2f2657)=>{const _0x1b66a7=_0x4d5562,_0x1eb214=formatElapsed(_0x1af41b);_0x2f2657?console['log'](_0x1b66a7(0x1b4)+(_0x5e964a+0x1)+'/'+_0x47cad2[_0x1b66a7(0x1ac)]['length']+'...\x20'+a5_0x274d4d[_0x1b66a7(0x16e)]('✓')+'\x20('+_0x1eb214+')'):console[_0x1b66a7(0x157)](_0x1b66a7(0x1b4)+(_0x5e964a+0x1)+'/'+_0x47cad2[_0x1b66a7(0x1ac)]['length']+_0x1b66a7(0x134)+a5_0x274d4d[_0x1b66a7(0x18c)]('✗'));},'onEvaluationStart':()=>{const _0x3fe2cc=_0x4d5562;_0x28eeed[_0x3fe2cc(0x151)]=_0x3fe2cc(0x12e);},'onEvaluationComplete':_0x48a075=>{const _0x45df4f=_0x4d5562,_0x177ee2=formatElapsed(_0x48a075);console[_0x45df4f(0x157)]('\x20\x20Evaluating...\x20'+a5_0x274d4d[_0x45df4f(0x16e)]('✓')+'\x20('+_0x177ee2+')');}});_0x28eeed[_0x4d5562(0x147)](),_0x2a8fe4[_0x4d5562(0x15a)](_0x30afb0);if(_0x30afb0[_0x4d5562(0x14a)]===_0x4d5562(0x150))console[_0x4d5562(0x157)](a5_0x274d4d['green'](_0x4d5562(0x19d)+_0x30afb0[_0x4d5562(0x191)])+a5_0x274d4d['dim'](_0x4d5562(0x18b)));else _0x30afb0['status']===_0x4d5562(0x172)?console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)]('✗\x20FAIL:\x20'+_0x30afb0[_0x4d5562(0x191)])+a5_0x274d4d[_0x4d5562(0x175)](_0x4d5562(0x18b))):console[_0x4d5562(0x157)](a5_0x274d4d['red'](_0x4d5562(0x18d)+_0x30afb0[_0x4d5562(0x191)]));_0x30afb0['conversation_url']&&console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x175)](_0x4d5562(0x1ae)+_0x30afb0[_0x4d5562(0x154)]));}catch(_0x211c3d){_0x28eeed[_0x4d5562(0x147)]();const _0x4a7cbf=_0x211c3d instanceof Error?_0x211c3d[_0x4d5562(0x138)]:String(_0x211c3d);console[_0x4d5562(0x157)](a5_0x274d4d[_0x4d5562(0x18c)](_0x4d5562(0x18d)+_0x4a7cbf)),_0x2a8fe4[_0x4d5562(0x15a)]({'name':_0x47cad2[_0x4d5562(0x190)],'status':_0x4d5562(0x14c),'reason':_0x4a7cbf,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x4d5562(0x157)]();const _0x2e3b34=Date['now']()-_0x3ec432,_0x57efd9=_0x2a8fe4[_0x4d5562(0x19a)](_0x1ae5a9=>_0x1ae5a9[_0x4d5562(0x14a)]===_0x4d5562(0x150))[_0x4d5562(0x1af)],_0xd21c00=_0x2a8fe4[_0x4d5562(0x19a)](_0x3402cd=>_0x3402cd['status']===_0x4d5562(0x172))[_0x4d5562(0x1af)],_0x294b94=_0x2a8fe4[_0x4d5562(0x19a)](_0x52888a=>_0x52888a[_0x4d5562(0x14a)]===_0x4d5562(0x14c))[_0x4d5562(0x1af)];console[_0x4d5562(0x157)]('━'['repeat'](0x3c)),console[_0x4d5562(0x157)]('Re-evaluation\x20Summary'),console[_0x4d5562(0x157)]('━'[_0x4d5562(0x15e)](0x3c)),console[_0x4d5562(0x157)]('Total:\x20\x20\x20\x20'+_0x2a8fe4[_0x4d5562(0x1af)]),console['log'](_0x4d5562(0x1b0)+a5_0x274d4d[_0x4d5562(0x16e)](_0x57efd9)),console[_0x4d5562(0x157)]('Failed:\x20\x20\x20'+a5_0x274d4d[_0x4d5562(0x18c)](_0xd21c00));_0x294b94>0x0&&console[_0x4d5562(0x157)](_0x4d5562(0x129)+a5_0x274d4d[_0x4d5562(0x18c)](_0x294b94));console[_0x4d5562(0x157)]('Duration:\x20'+formatElapsed(_0x2e3b34)),console[_0x4d5562(0x157)]('━'['repeat'](0x3c));const _0x4f0b27={'summary':{'total':_0x2a8fe4[_0x4d5562(0x1af)],'passed':_0x57efd9,'failed':_0xd21c00,'errors':_0x294b94>0x0?_0x294b94:undefined,'duration_ms':_0x2e3b34},'tests':_0x2a8fe4,'agent':{'project':_0x82aa60['projectName'],'name':_0x82aa60['agentName'],'site':_0x3e6d76},'timestamp':new Date(_0x3ec432)[_0x4d5562(0x162)]()};if(_0x5235b3!==_0x4d5562(0x13c)||_0x77df43){const _0x2742d2=formatResults(_0x4f0b27,_0x5235b3);if(_0x77df43)try{a5_0x487957[_0x4d5562(0x15f)](_0x77df43,_0x2742d2,_0x4d5562(0x155)),console['log'](),console['log'](a5_0x274d4d[_0x4d5562(0x175)](_0x4d5562(0x12a)+_0x77df43));}catch(_0x427c5f){return console[_0x4d5562(0x157)](),console[_0x4d5562(0x157)](a5_0x274d4d['red']('Error\x20writing\x20output\x20file:\x20'+_0x427c5f)),0x1;}else console[_0x4d5562(0x157)](),console[_0x4d5562(0x157)](_0x2742d2);}const _0x4c7af5=_0x2a8fe4[_0x4d5562(0x19a)](_0x2ef705=>_0x2ef705['status']!=='PASS');return _0x4c7af5[_0x4d5562(0x1af)]>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x19f7(){const _0x56d9af=['Re-evaluating\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','substring','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','tags','output','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','dryRun','reeval','log','table','join','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20-\x20','find','Re-evaluating...','map','FAIL','387aqsjLm','llm','\x27\x20to\x20create\x20the\x20folder\x20structure.','Duration:\x20','404','344daqqSj','jsonl','Round\x201/','164299jPYDen','basename','white','filter','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','executeReeval','toLowerCase','Cached\x20run\x20is\x20from\x20site\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','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','No\x20tests\x20found\x20with\x20tags:\x20','yellow','verbose','message','agentDirs','llmProject','no_local_folder','Run\x20\x27tdx\x20agent\x20pull\x20','No\x20tests\x20found\x20matching:\x20','Test\x20','push','\x20\x20Agent:\x20','rounds','not\x20found','repeat','Output\x20written\x20to:\x20','reason','Cached\x20run\x20from:\x20','\x20\x20Evaluating...\x20','isSpinning','⚠\x20SKIPPED:\x20','size','Using\x20agent:\x20','Passed:\x20\x20\x20','length','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','context','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','eval','description','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','add','tsv','Re-evaluation\x20Summary','site','no_tests','Round\x20','cyan','resolve','testYmlPath','Agent:\x20','projectName','no_context','1380010kruwQT','42oQfbnn','\x20(new)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','includes','1929180JwZrjp','\x20\x20Round\x20','start','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','text','round','Failed:\x20\x20\x20','forEach','conversations','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Site:\x20','red',':\x20Sending\x20user\x20input...','some','now','json','source','has','\x20-\x20','Either\x20switch\x20to\x20the\x20\x22','\x20\x20Conversation:\x20','PASS','name','...\x20','green','✗\x20FAIL:\x20','10105HpsmnA','32753RbFaBb','\x20\x20Project:\x20','dim','\x20(cached)','agentName','projectDir','114KrWxAc','trim','\x22:\x20','37486vaqwRf','stop','agent','...','Project\x20path:\x20','timestamp','Errors:\x20\x20\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','execute','Usage:','30120icvUIc','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','conversation_url','Test\x20Configuration:','ERROR','✓\x20PASS:\x20','Evaluating\x20response...','Available\x20tests:\x20','Running\x20test:\x20','writeFileSync','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\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)','agent:test','Executing\x20new\x20tests...','Error\x20writing\x20output\x20file:\x20','Test\x20Summary','New\x20tests\x20to\x20execute:\x20','Total:\x20\x20\x20\x20','found','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','tests','status','toISOString','✗\x20ERROR:\x20Agent\x20not\x20found:\x20'];a5_0x19f7=function(){return _0x56d9af;};return a5_0x19f7();}const a5_0xa60653=a5_0x5a2b;(function(_0x436f16,_0x20da0d){const _0x4439da=a5_0x5a2b,_0x3ebfef=_0x436f16();while(!![]){try{const _0x3b7f84=-parseInt(_0x4439da(0xd4))/0x1+parseInt(_0x4439da(0x96))/0x2*(parseInt(_0x4439da(0x10b))/0x3)+-parseInt(_0x4439da(0xd1))/0x4*(-parseInt(_0x4439da(0x8c))/0x5)+-parseInt(_0x4439da(0x93))/0x6*(-parseInt(_0x4439da(0x8d))/0x7)+-parseInt(_0x4439da(0xa0))/0x8*(parseInt(_0x4439da(0xcc))/0x9)+parseInt(_0x4439da(0x10a))/0xa+-parseInt(_0x4439da(0x10f))/0xb;if(_0x3b7f84===_0x20da0d)break;else _0x3ebfef['push'](_0x3ebfef['shift']());}catch(_0x189382){_0x3ebfef['push'](_0x3ebfef['shift']());}}}(a5_0x19f7,0x27700));import*as a5_0x35afb0 from'node:fs';import*as a5_0x46fc01 from'node:path';import a5_0xdc0274 from'chalk';function a5_0x5a2b(_0x2a3d3b,_0x556ea7){_0x2a3d3b=_0x2a3d3b-0x7b;const _0x19f724=a5_0x19f7();let _0x5a2b01=_0x19f724[_0x2a3d3b];return _0x5a2b01;}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']=a5_0xa60653(0xad);[a5_0xa60653(0xfb)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0xa60653(0x9e)](_0x40484a){const _0x2396e4=a5_0xa60653,{options:_0x5ad9f8,args:_0x57c72d,tdx:_0x5a4514}=_0x40484a,_0xebda57=_0x57c72d[0x0]||'.',_0x1314c0=_0x5ad9f8[_0x2396e4(0xc1)],_0x43e520=_0x5ad9f8,_0x5f46aa=_0x43e520[_0x2396e4(0xfa)]===![],_0x2566d5=_0x43e520[_0x2396e4(0xc2)],_0x324f87=_0x43e520[_0x2396e4(0x88)],_0x22fe20=_0x43e520[_0x2396e4(0xbe)],_0x556b3e=_0x5ad9f8[_0x2396e4(0x101)],_0x564118=_0x43e520[_0x2396e4(0xbf)];if(_0x2566d5&&_0x5f46aa)return console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x112))),0x1;let _0x205c23=_0x2396e4(0xc4);if(_0x43e520[_0x2396e4(0x81)])_0x205c23=_0x2396e4(0x81);else{if(_0x43e520[_0x2396e4(0xd2)])_0x205c23=_0x2396e4(0xd2);else{if(_0x43e520[_0x2396e4(0xff)])_0x205c23=_0x2396e4(0xff);else{if(_0x43e520[_0x2396e4(0xc4)])_0x205c23=_0x2396e4(0xc4);}}}const _0x1f42a3=_0x43e520[_0x2396e4(0xe3)];let _0x48f75a=_0xebda57;const _0x17d191=a5_0x35afb0['existsSync'](_0xebda57),_0x20e5f0=_0xebda57==='.';if(!_0x17d191||_0x20e5f0){const _0x432388=resolveProjectFromContext(_0xebda57,_0x1f42a3,{'requireFile':'test.yml'});if(_0x432388[_0x2396e4(0xb3)])_0x48f75a=_0x432388[_0x2396e4(0x92)],_0x432388[_0x2396e4(0x82)]===_0x2396e4(0xf8)&&console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xf4)+_0x48f75a));else switch(_0x432388['reason']){case _0x2396e4(0x109):console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x432388[_0x2396e4(0xe1)])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0x9f)),console[_0x2396e4(0xc3)](_0x2396e4(0xdc)),console[_0x2396e4(0xc3)](_0x2396e4(0xac)),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xa1));return 0x1;case _0x2396e4(0xe4):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0xdf)](_0x432388['message'])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xe5)+_0x432388[_0x2396e4(0xe3)]+_0x2396e4(0xce));return 0x1;case'multiple_agents':{const _0x4ac9a0=a5_0x46fc01[_0x2396e4(0xd5)](_0x432388[_0x2396e4(0x92)]);console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x2396e4(0xb5)+_0x432388[_0x2396e4(0xe3)]+'\x22:'));for(const _0x2e1886 of _0x432388[_0x2396e4(0xe2)]){console[_0x2396e4(0xc3)](_0x2396e4(0xc7)+_0x2e1886);}return console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xdd)+_0x4ac9a0+'/<agent-name>'),0x1;}case _0x2396e4(0x102):console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x2396e4(0xf7)+_0x432388[_0x2396e4(0xe3)]+'\x22.')),console[_0x2396e4(0xc3)](a5_0xdc0274['dim'](_0x2396e4(0x9a)+_0x432388['projectDir'])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0x7b));return 0x1;}}const {definition:_0x1e36f6,agentInfo:_0x635603}=parseTestFile(_0x48f75a);let _0x1ba8b7=_0x1e36f6[_0x2396e4(0xb6)];if(_0x324f87){const _0xbb240b=_0x324f87['split'](',')[_0x2396e4(0xca)](_0x205a9b=>_0x205a9b[_0x2396e4(0x94)]());_0x1ba8b7=_0x1e36f6[_0x2396e4(0xb6)]['filter'](_0x2f36d2=>_0xbb240b[_0x2396e4(0x10e)](_0x2f36d2['name']));if(_0x1ba8b7[_0x2396e4(0xf6)]===0x0)return console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0xdf)](_0x2396e4(0xe6)+_0x324f87)),console['log'](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xa7)+_0x1e36f6[_0x2396e4(0xb6)][_0x2396e4(0xca)](_0x21f330=>_0x21f330[_0x2396e4(0x88)])['join'](',\x20'))),0x1;}if(_0x22fe20){const _0x3570aa=_0x22fe20['split'](',')[_0x2396e4(0xca)](_0x57de94=>_0x57de94['trim']()[_0x2396e4(0xda)]());_0x1ba8b7=_0x1ba8b7[_0x2396e4(0xd7)](_0x5db7a3=>_0x5db7a3[_0x2396e4(0xbe)]?.[_0x2396e4(0x7f)](_0x10df41=>_0x3570aa['includes'](_0x10df41[_0x2396e4(0xda)]())));if(_0x1ba8b7[_0x2396e4(0xf6)]===0x0){console['log'](a5_0xdc0274[_0x2396e4(0xdf)](_0x2396e4(0xde)+_0x22fe20));const _0x1308dd=new Set();return _0x1e36f6['tests'][_0x2396e4(0x116)](_0x138d4e=>_0x138d4e['tags']?.['forEach'](_0x4bef0c=>_0x1308dd[_0x2396e4(0xfe)](_0x4bef0c))),_0x1308dd[_0x2396e4(0xf3)]>0x0?console[_0x2396e4(0xc3)](a5_0xdc0274['dim'](_0x2396e4(0xfc)+[..._0x1308dd][_0x2396e4(0xc5)](',\x20'))):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xaa))),0x1;}}if(_0x2566d5)return this['executeReeval'](_0x40484a,{'definition':{'tests':_0x1ba8b7},'agentInfo':_0x635603,'outputFormat':_0x205c23,'outputFile':_0x564118,'testNames':_0x324f87});if(_0x1314c0){console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x104)](_0x2396e4(0xa3))),console[_0x2396e4(0xc3)]('\x20\x20Site:\x20'+a5_0xdc0274[_0x2396e4(0xd6)](_0x556b3e)),console[_0x2396e4(0xc3)](_0x2396e4(0x8e)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x108)])),console[_0x2396e4(0xc3)](_0x2396e4(0xe9)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x91)])),console['log'](),console['log']('Tests\x20found:\x20'+a5_0xdc0274[_0x2396e4(0xd6)](_0x1ba8b7[_0x2396e4(0xf6)]));for(let _0x38211c=0x0;_0x38211c<_0x1ba8b7[_0x2396e4(0xf6)];_0x38211c++){const _0x42ae24=_0x1ba8b7[_0x38211c],_0x1ddf8c=_0x42ae24[_0x2396e4(0xea)][_0x2396e4(0xf6)]===0x1?_0x2396e4(0x114):_0x2396e4(0xea),_0xf5e382=_0x42ae24[_0x2396e4(0xbe)]?.[_0x2396e4(0xf6)]?'\x20['+_0x42ae24[_0x2396e4(0xbe)][_0x2396e4(0xc5)](',\x20')+']':'';console[_0x2396e4(0xc3)]('\x20\x20'+(_0x38211c+0x1)+'.\x20'+a5_0xdc0274['white'](_0x42ae24[_0x2396e4(0x88)])+'\x20('+_0x42ae24[_0x2396e4(0xea)][_0x2396e4(0xf6)]+'\x20'+_0x1ddf8c+')'+a5_0xdc0274[_0x2396e4(0x8f)](_0xf5e382));}return 0x0;}let _0x1cf430,_0x22440f;try{_0x1cf430=await _0x5a4514[_0x2396e4(0xcd)]['resolveProjectId'](_0x635603[_0x2396e4(0x108)]);}catch(_0x5f3257){const _0x3bdf1f=_0x5f3257 instanceof Error?_0x5f3257[_0x2396e4(0xe1)]:String(_0x5f3257);return _0x3bdf1f[_0x2396e4(0x10e)](_0x2396e4(0xd0))||_0x3bdf1f['toLowerCase']()[_0x2396e4(0x10e)](_0x2396e4(0xeb))?console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xb4)+_0x635603[_0x2396e4(0x108)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xfd)+_0x635603[_0x2396e4(0x108)]+_0x2396e4(0x95)+_0x3bdf1f)),0x1;}try{_0x22440f=await _0x5a4514[_0x2396e4(0xcd)]['resolveAgentId'](_0x635603['agentName'],_0x1cf430);}catch(_0x20daba){const _0x69db97=_0x20daba instanceof Error?_0x20daba[_0x2396e4(0xe1)]:String(_0x20daba);return _0x69db97[_0x2396e4(0x10e)]('404')||_0x69db97[_0x2396e4(0xda)]()[_0x2396e4(0x10e)]('not\x20found')?console[_0x2396e4(0xc3)](a5_0xdc0274['red'](_0x2396e4(0xb9)+_0x635603[_0x2396e4(0x91)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x10d)+_0x635603[_0x2396e4(0x91)]+'\x22:\x20'+_0x69db97)),0x1;}let _0x4d4bf6;if(!_0x5f46aa)try{_0x4d4bf6=await setupEvaluatorAgent(_0x5a4514[_0x2396e4(0xcd)],_0x5ad9f8['verbose']);}catch(_0x86f09b){const _0x41ad79=_0x86f09b instanceof Error?_0x86f09b[_0x2396e4(0xe1)]:String(_0x86f09b);return console['log'](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xc6)+_0x41ad79)),0x1;}console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x104)]('Running\x20agent\x20tests...')),console['log'](_0x2396e4(0x7c)+a5_0xdc0274[_0x2396e4(0xd6)](_0x556b3e)),console['log'](_0x2396e4(0x107)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x108)]+'/'+_0x635603[_0x2396e4(0x91)])),console[_0x2396e4(0xc3)]();const _0x4751f7=[],_0x3aaa1c=[],_0x425be1=Date[_0x2396e4(0x80)]();for(let _0x2af7fd=0x0;_0x2af7fd<_0x1ba8b7[_0x2396e4(0xf6)];_0x2af7fd++){const _0x4738cf=_0x1ba8b7[_0x2af7fd];_0x1ba8b7[_0x2396e4(0xf6)]>0x1?console[_0x2396e4(0xc3)](_0x2396e4(0xe7)+(_0x2af7fd+0x1)+'/'+_0x1ba8b7['length']+':\x20'+a5_0xdc0274['white'](_0x4738cf['name'])):console[_0x2396e4(0xc3)](_0x2396e4(0xa8)+a5_0xdc0274[_0x2396e4(0xd6)](_0x4738cf[_0x2396e4(0x88)]));const _0x42333a=createCommandSpinner(_0x2396e4(0xd3)+_0x4738cf['rounds'][_0x2396e4(0xf6)]+_0x2396e4(0x7e));_0x42333a['start']();try{const {result:_0x3db7d7,conversation:_0x3695d9}=await runTest(_0x5a4514[_0x2396e4(0xcd)],_0x4738cf,{'agentId':_0x22440f,'projectId':_0x1cf430,'site':_0x556b3e,'noEval':_0x5f46aa,'evaluatorId':_0x4d4bf6,'onRoundStart':(_0x181fa4,_0x50462a)=>{const _0x4e84ca=_0x2396e4;_0x42333a[_0x4e84ca(0x113)]=_0x4e84ca(0x103)+(_0x181fa4+0x1)+'/'+_0x50462a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1e76e1,_0xa5abd1,_0x69c190)=>{const _0x19ba64=_0x2396e4,_0x39342e=formatElapsed(_0xa5abd1);_0x69c190?console[_0x19ba64(0xc3)](_0x19ba64(0x110)+(_0x1e76e1+0x1)+'/'+_0x4738cf[_0x19ba64(0xea)][_0x19ba64(0xf6)]+'...\x20'+a5_0xdc0274['green']('✓')+'\x20('+_0x39342e+')'):console[_0x19ba64(0xc3)](_0x19ba64(0x110)+(_0x1e76e1+0x1)+'/'+_0x4738cf['rounds'][_0x19ba64(0xf6)]+_0x19ba64(0x89)+a5_0xdc0274[_0x19ba64(0x7d)]('✗'));},'onEvaluationStart':()=>{const _0x31bb4d=_0x2396e4;_0x42333a[_0x31bb4d(0x113)]=_0x31bb4d(0xa6);},'onEvaluationComplete':_0xcd6f1b=>{const _0x3d3627=_0x2396e4,_0x3d83b7=formatElapsed(_0xcd6f1b);console[_0x3d3627(0xc3)]('\x20\x20Evaluating...\x20'+a5_0xdc0274[_0x3d3627(0x8a)]('✓')+'\x20('+_0x3d83b7+')');}});_0x42333a[_0x2396e4(0x97)](),_0x4751f7['push'](_0x3db7d7),_0x3aaa1c[_0x2396e4(0xe8)](_0x3695d9);if(_0x3db7d7[_0x2396e4(0xb7)]===_0x2396e4(0x87))console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8a)](_0x2396e4(0xa5)+_0x3db7d7['reason']));else _0x3db7d7[_0x2396e4(0xb7)]===_0x2396e4(0xcb)?console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x8b)+_0x3db7d7[_0x2396e4(0xee)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)]('✗\x20ERROR:\x20'+_0x3db7d7[_0x2396e4(0xee)]));_0x3db7d7[_0x2396e4(0xa2)]&&console[_0x2396e4(0xc3)](a5_0xdc0274['dim']('Conversation\x20URL:\x20'+_0x3db7d7['conversation_url'])),console[_0x2396e4(0xc3)]();}catch(_0x5cf1d3){_0x42333a[_0x2396e4(0x97)]();const _0x4d0c9a=_0x5cf1d3 instanceof Error?_0x5cf1d3['message']:String(_0x5cf1d3);console['log'](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xab)+_0x4d0c9a)),console[_0x2396e4(0xc3)](),_0x4751f7[_0x2396e4(0xe8)]({'name':_0x4738cf['name'],'status':_0x2396e4(0xa4),'reason':_0x4d0c9a,'timestamp':new Date()[_0x2396e4(0xb8)](),'duration_ms':0x0});}}const _0x8a8384=Date[_0x2396e4(0x80)]()-_0x425be1,_0x565759=_0x4751f7[_0x2396e4(0xd7)](_0x2c8d1e=>_0x2c8d1e[_0x2396e4(0xb7)]===_0x2396e4(0x87))[_0x2396e4(0xf6)],_0x1a0b3a=_0x4751f7[_0x2396e4(0xd7)](_0x452c81=>_0x452c81[_0x2396e4(0xb7)]===_0x2396e4(0xcb))[_0x2396e4(0xf6)],_0x36f2f5=_0x4751f7[_0x2396e4(0xd7)](_0x1f141b=>_0x1f141b['status']==='ERROR')[_0x2396e4(0xf6)];console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c)),console[_0x2396e4(0xc3)](_0x2396e4(0xb0)),console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c)),console[_0x2396e4(0xc3)](_0x2396e4(0xb2)+_0x4751f7['length']),console[_0x2396e4(0xc3)](_0x2396e4(0xf5)+a5_0xdc0274[_0x2396e4(0x8a)](_0x565759)),console[_0x2396e4(0xc3)](_0x2396e4(0x115)+a5_0xdc0274[_0x2396e4(0x7d)](_0x1a0b3a));_0x36f2f5>0x0&&console[_0x2396e4(0xc3)](_0x2396e4(0x9c)+a5_0xdc0274[_0x2396e4(0x7d)](_0x36f2f5));console[_0x2396e4(0xc3)](_0x2396e4(0xcf)+formatElapsed(_0x8a8384)),console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c));const _0x194a34=_0x4751f7['filter'](_0x2486ff=>_0x2486ff['status']!==_0x2396e4(0x87));if(_0x194a34[_0x2396e4(0xf6)]>0x0){console['log'](),console[_0x2396e4(0xc3)]('Failed\x20Tests:');for(const _0x487169 of _0x194a34){const _0x344fc8=a5_0xdc0274[_0x2396e4(0x7d)]('✗'),_0x313a4d=_0x487169[_0x2396e4(0xee)]['length']>0x32?_0x487169[_0x2396e4(0xee)][_0x2396e4(0xbc)](0x0,0x32)+'...':_0x487169[_0x2396e4(0xee)];console['log']('\x20\x20'+_0x344fc8+'\x20'+_0x487169['name']+':\x20'+_0x313a4d);}}const _0x515f5f={'summary':{'total':_0x4751f7[_0x2396e4(0xf6)],'passed':_0x565759,'failed':_0x1a0b3a,'errors':_0x36f2f5>0x0?_0x36f2f5:undefined,'duration_ms':_0x8a8384},'tests':_0x4751f7,'agent':{'project':_0x635603['projectName'],'name':_0x635603[_0x2396e4(0x91)],'site':_0x556b3e},'timestamp':new Date(_0x425be1)[_0x2396e4(0xb8)]()};try{const _0x56e6d7=buildCachedTestRun(_0x3aaa1c,{'site':_0x556b3e,'projectId':_0x1cf430,'projectName':_0x635603[_0x2396e4(0x108)],'agentId':_0x22440f,'agentName':_0x635603['agentName'],'testYmlPath':a5_0x46fc01[_0x2396e4(0x105)](_0x635603[_0x2396e4(0x106)])});saveLastTestRun(_0x56e6d7);}catch{}if(_0x205c23!==_0x2396e4(0xc4)||_0x564118){const _0x2fd7b8=formatResults(_0x515f5f,_0x205c23);if(_0x564118)try{a5_0x35afb0[_0x2396e4(0xa9)](_0x564118,_0x2fd7b8,'utf-8'),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xed)+_0x564118));}catch(_0x1aed0d){return console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xaf)+_0x1aed0d)),0x1;}else console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2fd7b8);}return _0x194a34[_0x2396e4(0xf6)]>0x0?0x1:0x0;}async[a5_0xa60653(0xd9)](_0x1562ef,_0x1f37cc){const _0x5eb8d8=a5_0xa60653,{options:_0x3f994f,tdx:_0x2398a9}=_0x1562ef,{definition:_0x513cd6,agentInfo:_0x23abbc,outputFormat:_0x4c0b09,outputFile:_0x35c144}=_0x1f37cc,_0x7c8bc3=_0x3f994f['site'],_0x37008e=loadLastTestRun();if(!_0x37008e)return console[_0x5eb8d8(0xc3)](a5_0xdc0274['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xf9))),0x1;if(_0x37008e[_0x5eb8d8(0x98)][_0x5eb8d8(0x91)]!==_0x23abbc[_0x5eb8d8(0x91)])return console[_0x5eb8d8(0xc3)](a5_0xdc0274['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x37008e['agent'][_0x5eb8d8(0x91)]+_0x5eb8d8(0xc0)+_0x23abbc['agentName']+'\x22.')),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x8f)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x4f5e4d=new Set(_0x37008e[_0x5eb8d8(0x117)]['map'](_0x31028a=>_0x31028a['testName'])),_0x4460b4=_0x513cd6[_0x5eb8d8(0xb6)][_0x5eb8d8(0xd7)](_0xb1b295=>!_0x4f5e4d[_0x5eb8d8(0x83)](_0xb1b295[_0x5eb8d8(0x88)]));if(_0x4460b4[_0x5eb8d8(0xf6)]>0x0&&_0x37008e['site']!==_0x7c8bc3)return console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xbb))),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xdb)+_0x37008e[_0x5eb8d8(0x101)]+_0x5eb8d8(0x9d)+_0x7c8bc3+'\x22.')),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0x85)+_0x37008e['site']+_0x5eb8d8(0xbd))),0x1;const _0x53e98f=_0x513cd6[_0x5eb8d8(0xb6)]['filter'](_0x335b0e=>_0x4f5e4d[_0x5eb8d8(0x83)](_0x335b0e[_0x5eb8d8(0x88)])),_0x46fc2a=_0x4460b4;let _0x1cc551;try{_0x1cc551=await setupEvaluatorAgent(_0x2398a9[_0x5eb8d8(0xcd)],_0x3f994f[_0x5eb8d8(0xe0)]);}catch(_0x47be4e){const _0x3382ce=_0x47be4e instanceof Error?_0x47be4e[_0x5eb8d8(0xe1)]:String(_0x47be4e);return console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xc6)+_0x3382ce)),0x1;}console[_0x5eb8d8(0xc3)](a5_0xdc0274['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xef)+a5_0xdc0274['white'](_0x37008e[_0x5eb8d8(0x9b)])),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0x107)+a5_0xdc0274['white'](_0x37008e[_0x5eb8d8(0x98)]['projectName']+'/'+_0x37008e[_0x5eb8d8(0x98)][_0x5eb8d8(0x91)]));_0x46fc2a['length']>0x0&&console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xb1)+a5_0xdc0274[_0x5eb8d8(0xdf)](_0x46fc2a[_0x5eb8d8(0xf6)]));console['log']();const _0x2e0d78=[],_0x57dd83=Date[_0x5eb8d8(0x80)](),_0x4ae20f=createCommandSpinner(_0x5eb8d8(0xc9));if(_0x53e98f[_0x5eb8d8(0xf6)]>0x0)try{const _0xd68473=await reevaluateFromCache(_0x2398a9['llm'],_0x37008e,{'tests':_0x53e98f},{'evaluatorId':_0x1cc551,'onTestStart':(_0x423b57,_0x38c41c,_0xf8df9)=>{const _0xd3e4f0=_0x5eb8d8;_0x4ae20f[_0xd3e4f0(0x113)]=_0xd3e4f0(0xba)+(_0x38c41c+0x1)+'/'+_0xf8df9+':\x20'+_0x423b57+_0xd3e4f0(0x99);if(!_0x4ae20f[_0xd3e4f0(0xf1)])_0x4ae20f['start']();},'onTestComplete':(_0x5d6d5d,_0x5575d4)=>{const _0x479483=_0x5eb8d8;_0x4ae20f[_0x479483(0x97)]();if(_0x5575d4[_0x479483(0xb7)]===_0x479483(0x87))console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x8a)]('✓\x20PASS:\x20'+_0x5d6d5d)+a5_0xdc0274[_0x479483(0x8f)](_0x479483(0x90)));else _0x5575d4[_0x479483(0xb7)]===_0x479483(0xcb)?console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x7d)](_0x479483(0x8b)+_0x5d6d5d+_0x479483(0x84)+_0x5575d4['reason'])+a5_0xdc0274[_0x479483(0x8f)]('\x20(cached)')):console['log'](a5_0xdc0274[_0x479483(0x7d)](_0x479483(0xab)+_0x5d6d5d+_0x479483(0x84)+_0x5575d4[_0x479483(0xee)]));_0x5575d4[_0x479483(0xa2)]&&console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x8f)](_0x479483(0x86)+_0x5575d4[_0x479483(0xa2)])),_0x2e0d78[_0x479483(0xe8)](_0x5575d4);},'onTestSkipped':(_0x467684,_0x47368f)=>{const _0x5d7a26=_0x5eb8d8;_0x4ae20f[_0x5d7a26(0x97)](),console[_0x5d7a26(0xc3)](a5_0xdc0274[_0x5d7a26(0xdf)](_0x5d7a26(0xf2)+_0x467684+'\x20-\x20'+_0x47368f));}});for(const _0x328a4a of _0xd68473){!_0x2e0d78[_0x5eb8d8(0xc8)](_0x3576de=>_0x3576de['name']===_0x328a4a[_0x5eb8d8(0x88)])&&_0x2e0d78[_0x5eb8d8(0xe8)](_0x328a4a);}}catch(_0x403b98){_0x4ae20f[_0x5eb8d8(0x97)]();const _0x281746=_0x403b98 instanceof Error?_0x403b98['message']:String(_0x403b98);return console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xd8)+_0x281746)),0x1;}_0x4ae20f['stop']();if(_0x46fc2a[_0x5eb8d8(0xf6)]>0x0){console['log'](),console['log'](a5_0xdc0274[_0x5eb8d8(0x104)](_0x5eb8d8(0xae)));const {projectId:_0x5898a7,agentId:_0x462098}=_0x37008e[_0x5eb8d8(0x98)];for(const _0x5892a1 of _0x46fc2a){console['log']('Running:\x20'+a5_0xdc0274[_0x5eb8d8(0xd6)](_0x5892a1['name']));const _0x44333b=createCommandSpinner(_0x5eb8d8(0xd3)+_0x5892a1[_0x5eb8d8(0xea)][_0x5eb8d8(0xf6)]+':\x20Sending\x20user\x20input...');_0x44333b[_0x5eb8d8(0x111)]();try{const {result:_0x19ad13}=await runTest(_0x2398a9['llm'],_0x5892a1,{'agentId':_0x462098,'projectId':_0x5898a7,'site':_0x37008e[_0x5eb8d8(0x101)],'noEval':![],'evaluatorId':_0x1cc551,'onRoundStart':(_0x5481bc,_0x5b0563)=>{const _0x1c33fb=_0x5eb8d8;_0x44333b['text']='Round\x20'+(_0x5481bc+0x1)+'/'+_0x5b0563+_0x1c33fb(0x7e);},'onRoundComplete':(_0x54529d,_0x303a9f,_0x397f0d)=>{const _0x254918=_0x5eb8d8,_0x33b918=formatElapsed(_0x303a9f);_0x397f0d?console[_0x254918(0xc3)](_0x254918(0x110)+(_0x54529d+0x1)+'/'+_0x5892a1[_0x254918(0xea)]['length']+_0x254918(0x89)+a5_0xdc0274[_0x254918(0x8a)]('✓')+'\x20('+_0x33b918+')'):console[_0x254918(0xc3)]('\x20\x20Round\x20'+(_0x54529d+0x1)+'/'+_0x5892a1[_0x254918(0xea)][_0x254918(0xf6)]+_0x254918(0x89)+a5_0xdc0274['red']('✗'));},'onEvaluationStart':()=>{const _0x5c0e60=_0x5eb8d8;_0x44333b[_0x5c0e60(0x113)]=_0x5c0e60(0xa6);},'onEvaluationComplete':_0x1b08c8=>{const _0x3d0037=_0x5eb8d8,_0xe8690=formatElapsed(_0x1b08c8);console['log'](_0x3d0037(0xf0)+a5_0xdc0274[_0x3d0037(0x8a)]('✓')+'\x20('+_0xe8690+')');}});_0x44333b[_0x5eb8d8(0x97)](),_0x2e0d78[_0x5eb8d8(0xe8)](_0x19ad13);if(_0x19ad13[_0x5eb8d8(0xb7)]===_0x5eb8d8(0x87))console['log'](a5_0xdc0274[_0x5eb8d8(0x8a)]('✓\x20PASS:\x20'+_0x19ad13[_0x5eb8d8(0xee)])+a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0x10c)));else _0x19ad13[_0x5eb8d8(0xb7)]==='FAIL'?console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0x8b)+_0x19ad13[_0x5eb8d8(0xee)])+a5_0xdc0274[_0x5eb8d8(0x8f)]('\x20(new)')):console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xab)+_0x19ad13[_0x5eb8d8(0xee)]));_0x19ad13[_0x5eb8d8(0xa2)]&&console[_0x5eb8d8(0xc3)](a5_0xdc0274['dim']('\x20\x20Conversation:\x20'+_0x19ad13[_0x5eb8d8(0xa2)]));}catch(_0x350dad){_0x44333b[_0x5eb8d8(0x97)]();const _0x597ee9=_0x350dad instanceof Error?_0x350dad[_0x5eb8d8(0xe1)]:String(_0x350dad);console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xab)+_0x597ee9)),_0x2e0d78[_0x5eb8d8(0xe8)]({'name':_0x5892a1['name'],'status':_0x5eb8d8(0xa4),'reason':_0x597ee9,'timestamp':new Date()[_0x5eb8d8(0xb8)](),'duration_ms':0x0});}}}console[_0x5eb8d8(0xc3)]();const _0x254265=Date[_0x5eb8d8(0x80)]()-_0x57dd83,_0x4f62d3=_0x2e0d78[_0x5eb8d8(0xd7)](_0x24b661=>_0x24b661[_0x5eb8d8(0xb7)]===_0x5eb8d8(0x87))[_0x5eb8d8(0xf6)],_0x381cd3=_0x2e0d78['filter'](_0x525298=>_0x525298['status']===_0x5eb8d8(0xcb))['length'],_0x5a713a=_0x2e0d78[_0x5eb8d8(0xd7)](_0xdf7485=>_0xdf7485[_0x5eb8d8(0xb7)]==='ERROR')['length'];console[_0x5eb8d8(0xc3)]('━'[_0x5eb8d8(0xec)](0x3c)),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0x100)),console['log']('━'[_0x5eb8d8(0xec)](0x3c)),console['log'](_0x5eb8d8(0xb2)+_0x2e0d78['length']),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xf5)+a5_0xdc0274[_0x5eb8d8(0x8a)](_0x4f62d3)),console['log'](_0x5eb8d8(0x115)+a5_0xdc0274[_0x5eb8d8(0x7d)](_0x381cd3));_0x5a713a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5a713a));console[_0x5eb8d8(0xc3)]('Duration:\x20'+formatElapsed(_0x254265)),console[_0x5eb8d8(0xc3)]('━'[_0x5eb8d8(0xec)](0x3c));const _0x5862e9={'summary':{'total':_0x2e0d78[_0x5eb8d8(0xf6)],'passed':_0x4f62d3,'failed':_0x381cd3,'errors':_0x5a713a>0x0?_0x5a713a:undefined,'duration_ms':_0x254265},'tests':_0x2e0d78,'agent':{'project':_0x23abbc[_0x5eb8d8(0x108)],'name':_0x23abbc['agentName'],'site':_0x7c8bc3},'timestamp':new Date(_0x57dd83)[_0x5eb8d8(0xb8)]()};if(_0x4c0b09!=='table'||_0x35c144){const _0x14b866=formatResults(_0x5862e9,_0x4c0b09);if(_0x35c144)try{a5_0x35afb0[_0x5eb8d8(0xa9)](_0x35c144,_0x14b866,'utf-8'),console[_0x5eb8d8(0xc3)](),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xed)+_0x35c144));}catch(_0x2041cf){return console[_0x5eb8d8(0xc3)](),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xaf)+_0x2041cf)),0x1;}else console['log'](),console[_0x5eb8d8(0xc3)](_0x14b866);}const _0xa8bf2f=_0x2e0d78[_0x5eb8d8(0xd7)](_0x7a4a6a=>_0x7a4a6a[_0x5eb8d8(0xb7)]!==_0x5eb8d8(0x87));return _0xa8bf2f[_0x5eb8d8(0xf6)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x14f6ab=a6_0x2171;(function(_0x2d2d52,_0x329331){const _0x1d233a=a6_0x2171,_0x54265f=_0x2d2d52();while(!![]){try{const _0x243423=parseInt(_0x1d233a(0x1c9))/0x1*(parseInt(_0x1d233a(0x1e9))/0x2)+-parseInt(_0x1d233a(0x1ca))/0x3*(parseInt(_0x1d233a(0x1d8))/0x4)+-parseInt(_0x1d233a(0x1c1))/0x5*(parseInt(_0x1d233a(0x1f7))/0x6)+parseInt(_0x1d233a(0x1be))/0x7*(-parseInt(_0x1d233a(0x1bf))/0x8)+-parseInt(_0x1d233a(0x1e6))/0x9+parseInt(_0x1d233a(0x1f9))/0xa*(-parseInt(_0x1d233a(0x1ef))/0xb)+-parseInt(_0x1d233a(0x1e4))/0xc*(-parseInt(_0x1d233a(0x1d5))/0xd);if(_0x243423===_0x329331)break;else _0x54265f['push'](_0x54265f['shift']());}catch(_0x46f25c){_0x54265f['push'](_0x54265f['shift']());}}}(a6_0x3c28,0xc2b12));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x2171(_0x1ddd1a,_0x1b73d1){_0x1ddd1a=_0x1ddd1a-0x1bc;const _0x3c287e=a6_0x3c28();let _0x2171b8=_0x3c287e[_0x1ddd1a];return _0x2171b8;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x3c28(){const _0x26b55a=['GET','method','POST','set-cookie','\x22.\x20','stack','entries','join','trim','workflow','36cIsYUA','substring','12385152UuMpvN','PATCH','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','292aoNxPA','name','type','Invalid\x20API\x20type:\x20','message','PUT','6997859yrVxWP','cookie','Endpoint\x20must\x20start\x20with\x20/:\x20','keys','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','cdp','proxy-authorization','file','1926636bFqdGk','.\x20Valid\x20methods:\x20','10SzvOZe','authorization','has','verbose','data','headers','validate','1911343KvjGwy','16lmuvco','description','5MFvxsd','indexOf','length','isArray','Invalid\x20HTTP\x20method:\x20','includes','log','output','9959FRPtyk','4182slVjzC','Error:\x20','x-xsrf-token','x-auth-token','api','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','color','request','llm-proxy','status','error','11946337fWTlmX','\x0aStack\x20trace:\x0a','header','1532gICYSc','DELETE'];a6_0x3c28=function(){return _0x26b55a;};return a6_0x3c28();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x14f6ab(0x1fa),a6_0x14f6ab(0x1f5),a6_0x14f6ab(0x1f0),a6_0x14f6ab(0x1dd),'set-cookie2',a6_0x14f6ab(0x1cc),a6_0x14f6ab(0x1cd),'x-trino-user']);function isSensitiveHeader(_0x3a7382){const _0x5318bc=a6_0x14f6ab;return SENSITIVE_HEADERS[_0x5318bc(0x1fb)](_0x3a7382['toLowerCase']());}function parseHeader(_0x425ed7){const _0xe699df=a6_0x14f6ab,_0x5f1972=_0x425ed7[_0xe699df(0x1c2)](':');if(_0x5f1972===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x425ed7+_0xe699df(0x1de)+_0xe699df(0x1e8));const _0x5c5443=_0x425ed7[_0xe699df(0x1e5)](0x0,_0x5f1972)[_0xe699df(0x1e2)](),_0x3920=_0x425ed7[_0xe699df(0x1e5)](_0x5f1972+0x1)['trim']();if(!_0x5c5443)throw new Error(_0xe699df(0x1cf)+_0x425ed7+'\x22');return[_0x5c5443,_0x3920];}export class ApiCommand extends BaseCommand{[a6_0x14f6ab(0x1ea)]=a6_0x14f6ab(0x1ce);[a6_0x14f6ab(0x1c0)]=a6_0x14f6ab(0x1f3);[a6_0x14f6ab(0x1bd)](_0x58fba3){const _0x226abc=a6_0x14f6ab,{args:_0xdd567,options:_0x48df5b}=_0x58fba3,_0x483da7=_0x48df5b;if(_0xdd567[_0x226abc(0x1c3)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x35f0e9=_0xdd567[0x0];if(!_0x35f0e9['startsWith']('/'))return _0x226abc(0x1f1)+_0x35f0e9;const _0x579f51=_0x483da7[_0x226abc(0x1fd)],_0x1f1f02=_0x483da7[_0x226abc(0x1f6)];if(_0x579f51&&_0x1f1f02)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x169ec5=_0x483da7[_0x226abc(0x1db)]||_0x226abc(0x1da),_0xb7e899=[_0x226abc(0x1da),_0x226abc(0x1dc),_0x226abc(0x1ee),_0x226abc(0x1d9),_0x226abc(0x1e7)];if(!_0xb7e899[_0x226abc(0x1c6)](_0x169ec5['toUpperCase']()))return _0x226abc(0x1c5)+_0x169ec5+_0x226abc(0x1f8)+_0xb7e899[_0x226abc(0x1e1)](',\x20');const _0xa11364=_0x483da7[_0x226abc(0x1eb)]||'td',_0x360d40=['td',_0x226abc(0x1f4),_0x226abc(0x1e3),'trino','llm',_0x226abc(0x1d2)];if(!_0x360d40[_0x226abc(0x1c6)](_0xa11364))return _0x226abc(0x1ec)+_0xa11364+'.\x20Valid\x20types:\x20'+_0x360d40['join'](',\x20');return undefined;}async['execute'](_0x52dcba){const _0x5c5bf2=a6_0x14f6ab,{options:_0x22e707,args:_0x5e0cc8,tdx:_0xec6e16}=_0x52dcba,_0x4a905e=_0x22e707,_0x220481=_0x5e0cc8[0x0],_0x4dfee1=(_0x4a905e[_0x5c5bf2(0x1db)]||'GET')['toUpperCase'](),_0x509b20=_0x4a905e['data'],_0x1c9a84=_0x4a905e['file'],_0x4b9025=_0x4a905e[_0x5c5bf2(0x1d7)],_0x3392f9=_0x4a905e[_0x5c5bf2(0x1eb)]||'td';try{const _0x472f7e={};if(_0x4b9025){const _0x45fae8=Array[_0x5c5bf2(0x1c4)](_0x4b9025)?_0x4b9025:[_0x4b9025];for(const _0x3faaed of _0x45fae8){const [_0x49232a,_0xf04a1a]=parseHeader(_0x3faaed);_0x472f7e[_0x49232a]=_0xf04a1a;}}let _0x5d834f;if(_0x509b20)_0x5d834f=_0x509b20;else{if(_0x1c9a84)try{_0x5d834f=RawAPI['readBodyFromFile'](_0x1c9a84);}catch(_0xc845cd){return console[_0x5c5bf2(0x1d4)](_0x5c5bf2(0x1cb)+(_0xc845cd instanceof Error?_0xc845cd[_0x5c5bf2(0x1ed)]:String(_0xc845cd))),0x1;}}const _0x1ac7bf={'method':_0x4dfee1,'apiType':_0x3392f9,'includeHeaders':_0x22e707['verbose']};_0x5d834f&&(_0x1ac7bf['body']=_0x5d834f);Object[_0x5c5bf2(0x1f2)](_0x472f7e)['length']>0x0&&(_0x1ac7bf[_0x5c5bf2(0x1bc)]=_0x472f7e);if(_0x22e707['verbose']){const _0x3f9bba=resolveSite(_0x22e707['site']),_0x5ce3f3=getEndpoint(_0x3f9bba,_0x3392f9),_0x248e80=''+_0x5ce3f3+_0x220481;console[_0x5c5bf2(0x1d4)]('>\x20'+_0x4dfee1+'\x20'+_0x248e80);const _0x480aea=getAuthHeaders(_0x3f9bba),_0x39505a={..._0x480aea,..._0x472f7e};for(const [_0x3df141,_0x3fe07a]of Object[_0x5c5bf2(0x1e0)](_0x39505a)){!isSensitiveHeader(_0x3df141)&&console['error']('>\x20'+_0x3df141+':\x20'+_0x3fe07a);}_0x5d834f&&console[_0x5c5bf2(0x1d4)]('>'),console[_0x5c5bf2(0x1d4)]('');}const _0xaf9d8c=await _0xec6e16[_0x5c5bf2(0x1ce)][_0x5c5bf2(0x1d1)](_0x220481,_0x1ac7bf);if(_0x22e707[_0x5c5bf2(0x1fc)]&&_0xaf9d8c['headers']){console[_0x5c5bf2(0x1d4)]('<\x20HTTP/1.1\x20'+_0xaf9d8c[_0x5c5bf2(0x1d3)]);for(const [_0x2e96a6,_0x14b299]of Object[_0x5c5bf2(0x1e0)](_0xaf9d8c['headers'])){!isSensitiveHeader(_0x2e96a6)&&console['error']('<\x20'+_0x2e96a6+':\x20'+_0x14b299);}console[_0x5c5bf2(0x1d4)]('');}const _0x5dc4d1=Boolean(_0x22e707[_0x5c5bf2(0x1c8)]),_0x5c3bf0={'color':_0x22e707[_0x5c5bf2(0x1d0)],'noColor':_0x22e707['noColor']||_0x5dc4d1&&!_0x22e707[_0x5c5bf2(0x1d0)]},_0x3dfe52=colorizeJSON(_0xaf9d8c['data'],_0x5c3bf0);return _0x22e707[_0x5c5bf2(0x1c8)]?(writeFileSync(_0x22e707[_0x5c5bf2(0x1c8)],_0x3dfe52),console[_0x5c5bf2(0x1d4)]('Results\x20saved\x20to\x20'+_0x22e707['output'])):console[_0x5c5bf2(0x1c7)](_0x3dfe52),0x0;}catch(_0x56590e){return _0x56590e instanceof Error?(console[_0x5c5bf2(0x1d4)](_0x5c5bf2(0x1cb)+_0x56590e[_0x5c5bf2(0x1ed)]),_0x22e707['verbose']&&_0x56590e['stack']&&console[_0x5c5bf2(0x1d4)](_0x5c5bf2(0x1d6)+_0x56590e[_0x5c5bf2(0x1df)])):console['error'](_0x5c5bf2(0x1cb)+String(_0x56590e)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x317fae=a7_0x1169;(function(_0x53fcbd,_0x41b2a1){const _0x3ba0fc=a7_0x1169,_0x5075d1=_0x53fcbd();while(!![]){try{const _0x52c392=parseInt(_0x3ba0fc(0x215))/0x1+parseInt(_0x3ba0fc(0x1f0))/0x2+-parseInt(_0x3ba0fc(0x208))/0x3*(-parseInt(_0x3ba0fc(0x218))/0x4)+-parseInt(_0x3ba0fc(0x1e1))/0x5*(parseInt(_0x3ba0fc(0x21c))/0x6)+parseInt(_0x3ba0fc(0x1fe))/0x7*(-parseInt(_0x3ba0fc(0x21e))/0x8)+parseInt(_0x3ba0fc(0x210))/0x9*(-parseInt(_0x3ba0fc(0x20c))/0xa)+parseInt(_0x3ba0fc(0x1f9))/0xb;if(_0x52c392===_0x41b2a1)break;else _0x5075d1['push'](_0x5075d1['shift']());}catch(_0xf53562){_0x5075d1['push'](_0x5075d1['shift']());}}}(a7_0x5426,0xb0a5a));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x5426(){const _0xcd7bd8=['\x20--profile\x20','OAuth\x20(browser\x20login)','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','No\x20credential\x20found','name','apikey','✗\x20Validation\x20failed:\x20','auth','log','55LRzInV','\x20(site:\x20','ERROR','first_name','Choose\x20authentication\x20method:','password','yellow','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','trim','all','description','logLevel','jobs','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','1912694feVmpV','OAuth\x20tokens','\x20for\x20profile:\x20','auth:clear','\x27\x20registered','\x0aSetup\x20cancelled','User:\x20','✓\x20Profile\x20\x27','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','17423626IwpWXx','API\x20key\x20cannot\x20be\x20empty','us01','/app/mp/ak','execute','91vpdmXO','Setting\x20up\x20authentication\x20for\x20site:\x20','Setup\x20cancelled','join','tdx:\x20auth\x20clear','System\x20keychain\x20is\x20not\x20available','API\x20key','Read\x20credential\x20from\x20keychain','\x20\x20tdx','warn','31287RcSOuB','Read\x20credential\x20from\x20','profile','error','339550HvVGlz','last_name','oauth','tdx:\x20auth\x20setup','333KXRfWk','site','filter','select','Enter\x20your\x20TD\x20API\x20key:','844160MGjNUw','N/A','method','40uXOEUT','Validating\x20API\x20key...','red','apiKey','290244hKLLOr','\x20(profile:\x20','601088HyQZsh','tdx\x20profile:\x20','bold'];a7_0x5426=function(){return _0xcd7bd8;};return a7_0x5426();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x1169(_0x39a5d9,_0x4c7aff){_0x39a5d9=_0x39a5d9-0x1d8;const _0x5426a1=a7_0x5426();let _0x116957=_0x5426a1[_0x39a5d9];return _0x116957;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x2abc05 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_0x52e211 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x317fae(0x1dc)]='auth:setup';[a7_0x317fae(0x1eb)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x317fae(0x1fd)](_0x3cad50){const _0x223996=a7_0x317fae,{options:_0x4e6a87}=_0x3cad50,_0x969e7b=_0x4e6a87[_0x223996(0x20a)];console[_0x223996(0x1e0)](a7_0x52e211[_0x223996(0x220)](_0x223996(0x20f)));const _0x5621e3=_0x4e6a87[_0x223996(0x211)]||_0x223996(0x1fb),_0x4cfa76=await promptSiteSelection(_0x5621e3,_0x969e7b,_0x223996(0x200));if(!_0x4cfa76)return 0x1;const _0x402201=resolveSite(_0x4cfa76);if(isOAuthSupported(_0x402201)){const _0x11f482=await a7_0x2abc05({'type':_0x223996(0x213),'name':'method','message':_0x223996(0x1e5),'choices':[{'title':_0x223996(0x1d9),'value':_0x223996(0x20e)},{'title':'API\x20Key','value':_0x223996(0x1dd)}]});if(!_0x11f482[_0x223996(0x217)])return console['log'](_0x223996(0x1f5)),0x1;if(_0x11f482[_0x223996(0x217)]===_0x223996(0x20e))return await runOAuthLoginFlow(_0x402201,_0x969e7b,_0x4e6a87[_0x223996(0x1ec)]??LogLevel['ERROR']),0x0;}console[_0x223996(0x1e0)](_0x223996(0x1ff)+_0x402201),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x223996(0x1e0)]('\x20\x20'+getConsoleUrl(_0x402201,_0x223996(0x1fc)));const _0x1ec806=await a7_0x2abc05({'type':_0x223996(0x1e6),'name':_0x223996(0x21b),'message':_0x223996(0x214),'validate':_0x1c36c1=>{const _0xcf7124=_0x223996;if(!_0x1c36c1||!_0x1c36c1[_0xcf7124(0x1e9)]())return _0xcf7124(0x1fa);return!![];}});if(!_0x1ec806['apiKey'])return console[_0x223996(0x1e0)](_0x223996(0x1f5)),0x1;const _0x16bfaa=_0x1ec806['apiKey'];console['log'](_0x223996(0x219));try{const _0x4f7d98=TDX['create']({'site':_0x402201,'apiKey':_0x16bfaa['trim'](),'logLevel':_0x4e6a87['logLevel']??LogLevel[_0x223996(0x1e3)]}),_0x309a76=await _0x4f7d98[_0x223996(0x1ed)]['getUserInfo']();console[_0x223996(0x1e0)](_0x223996(0x1ef)+_0x309a76['email']+')');const _0xbc5810=await isKeychainAvailable();_0xbc5810?(await saveAPIKeyAsync(_0x16bfaa['trim'](),_0x402201,_0x969e7b),console[_0x223996(0x1e0)](_0x223996(0x1da)+(_0x969e7b?_0x223996(0x21d)+_0x969e7b+')':''))):(console['warn'](a7_0x52e211['yellow'](_0x223996(0x1ee))),console[_0x223996(0x207)](a7_0x52e211[_0x223996(0x1e7)](_0x223996(0x1f8))));if(_0x969e7b){const _0x4e82c8={'site':_0x402201};saveProfileToUserConfig(_0x969e7b,_0x4e82c8),console['log'](_0x223996(0x1f7)+_0x969e7b+_0x223996(0x1f4));}else saveDefaultSiteToUserConfig(_0x402201),console[_0x223996(0x1e0)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x402201);const _0x36346f=_0x969e7b?_0x223996(0x1d8)+_0x969e7b:'';return console[_0x223996(0x1e0)](),console[_0x223996(0x1e0)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x223996(0x206)+_0x36346f+_0x223996(0x1e8)),console['log']('\x20\x20tdx'+_0x36346f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x9b6f64){if(_0x9b6f64 instanceof HTTPClientError&&_0x9b6f64['status']===0x191)return printAuthError(_0x9b6f64),0x1;return console[_0x223996(0x20b)](a7_0x52e211['red']('✗\x20Validation\x20failed:\x20'+(_0x9b6f64 instanceof Error?_0x9b6f64['message']:String(_0x9b6f64)))),console[_0x223996(0x20b)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x317fae(0x1dc)]=a7_0x317fae(0x1df);[a7_0x317fae(0x1eb)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0xcbe773){const _0x5d612d=a7_0x317fae,{options:_0xe3c61c,tdx:_0x1e0fa6}=_0xcbe773,_0xc65ccb=_0xe3c61c[_0x5d612d(0x211)],_0x321e82=_0xe3c61c[_0x5d612d(0x20a)],_0x27271c=_0x321e82?_0x321e82:_0x5d612d(0x216);console[_0x5d612d(0x1e0)](_0x5d612d(0x21f)+_0x27271c+_0x5d612d(0x1e2)+_0xc65ccb+')');const _0x538003=await getOAuthTokens(_0x321e82);if(_0x538003)console[_0x5d612d(0x1e0)]('Credential\x20type:\x20OAuth'),console[_0x5d612d(0x1e0)](_0x5d612d(0x205)+(_0x321e82?_0x5d612d(0x21d)+_0x321e82+')':''));else{const _0x399802=await resolveAPIKeyAsync(_0xc65ccb,_0x321e82);if(_0x399802){const {source:_0x5ae292,isDeprecated:_0x5b0808}=_0x399802,_0x224c9f=_0x5d612d(0x209)+_0x5ae292;console[_0x5d612d(0x1e0)](_0x5b0808?a7_0x52e211[_0x5d612d(0x1e7)](_0x224c9f):_0x224c9f);}else console['log'](a7_0x52e211[_0x5d612d(0x1e7)](_0x5d612d(0x1db)));}try{const _0x4a8c7e=await _0x1e0fa6[_0x5d612d(0x1ed)]['getUserInfo']();return console[_0x5d612d(0x1e0)](a7_0x52e211['green']('✓\x20Authentication\x20successful\x0a')),console['log'](_0x5d612d(0x1f6)+_0x4a8c7e['email']),(_0x4a8c7e[_0x5d612d(0x1e4)]||_0x4a8c7e[_0x5d612d(0x20d)])&&console[_0x5d612d(0x1e0)]('Name:\x20'+[_0x4a8c7e[_0x5d612d(0x1e4)],_0x4a8c7e['last_name']][_0x5d612d(0x212)](Boolean)[_0x5d612d(0x201)]('\x20')),0x0;}catch(_0x5f03d2){return _0x5f03d2 instanceof HTTPClientError&&_0x5f03d2['status']===0x191?printAuthError(_0x5f03d2,!![],_0x321e82):console['error'](a7_0x52e211[_0x5d612d(0x21a)](_0x5d612d(0x1de)+(_0x5f03d2 instanceof Error?_0x5f03d2['message']:String(_0x5f03d2)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x317fae(0x1dc)]=a7_0x317fae(0x1f3);[a7_0x317fae(0x1eb)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x136464){const _0x358479=a7_0x317fae,{options:_0x44f91f}=_0x136464,_0x30d28e=_0x44f91f[_0x358479(0x20a)];console[_0x358479(0x1e0)](a7_0x52e211[_0x358479(0x220)](_0x358479(0x202)));const _0xd1d492=await isKeychainAvailable();if(!_0xd1d492)return console['error'](a7_0x52e211['red'](_0x358479(0x203))),0x1;const [_0x83651,_0x3a9093]=await Promise[_0x358479(0x1ea)]([deleteKeychainAPIKey(_0x30d28e),deleteOAuthTokens(_0x30d28e)]);if(_0x83651||_0x3a9093){clearCredentialCache();const _0x4a577f=[_0x83651&&_0x358479(0x204),_0x3a9093&&_0x358479(0x1f1)]['filter'](Boolean)[_0x358479(0x201)]('\x20and\x20');return console[_0x358479(0x1e0)]('✓\x20'+_0x4a577f+'\x20removed\x20from\x20keychain'+(_0x30d28e?_0x358479(0x21d)+_0x30d28e+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x30d28e?_0x358479(0x1f2)+_0x30d28e:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a8_0x32d5(_0x59b560,_0x45f077){_0x59b560=_0x59b560-0x10d;const _0x283742=a8_0x2837();let _0x32d532=_0x283742[_0x59b560];return _0x32d532;}const a8_0x58b372=a8_0x32d5;(function(_0x4ebef5,_0x302450){const _0x4b5c15=a8_0x32d5,_0x3e1534=_0x4ebef5();while(!![]){try{const _0x3c3619=parseInt(_0x4b5c15(0x12f))/0x1*(parseInt(_0x4b5c15(0x134))/0x2)+parseInt(_0x4b5c15(0x131))/0x3*(-parseInt(_0x4b5c15(0x11f))/0x4)+-parseInt(_0x4b5c15(0x114))/0x5*(-parseInt(_0x4b5c15(0x11b))/0x6)+-parseInt(_0x4b5c15(0x12b))/0x7+-parseInt(_0x4b5c15(0x11c))/0x8*(-parseInt(_0x4b5c15(0x10f))/0x9)+-parseInt(_0x4b5c15(0x125))/0xa+parseInt(_0x4b5c15(0x130))/0xb;if(_0x3c3619===_0x302450)break;else _0x3e1534['push'](_0x3e1534['shift']());}catch(_0x2cf39c){_0x3e1534['push'](_0x3e1534['shift']());}}}(a8_0x2837,0x2110f));import{BaseCommand}from'./command.js';function a8_0x2837(){const _0x1c2c92=['OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','198MZhUJe','create','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20(profile:\x20','us01','5kMlFWf','\x27\x20registered','ERROR','\x20\x20tdx','log','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','green','144114LSSuKo','49552eEhUxG','access_token','\x20--profile\x20','652efDwvb','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','name','Login\x20cancelled','execute','profile','2550220JsiHdz','Opening\x20browser\x20for\x20authentication...','jobs','site','✓\x20Authentication\x20successful\x20(User:\x20','email','1540357bPVLsa','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','✓\x20Profile\x20\x27','109jnGPlY','6693665Zvymxz','4446UFGZru','Login\x20via\x20OAuth\x20(opens\x20browser)','bold','1528GnUFPe','tdx:\x20auth\x20login'];a8_0x2837=function(){return _0x1c2c92;};return a8_0x2837();}import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x1a3081 from'chalk';export async function runOAuthLoginFlow(_0x221ac4,_0x184cfb,_0x21d129){const _0x1f14eb=a8_0x32d5;if(!isOAuthSupported(_0x221ac4))throw new Error(_0x1f14eb(0x10d)+_0x221ac4+'.\x20'+_0x1f14eb(0x10e)+_0x1f14eb(0x119));const _0x4fe920=await isKeychainAvailable();if(!_0x4fe920)throw new Error(_0x1f14eb(0x12c)+_0x1f14eb(0x119));const _0xc80a8c=getConsoleUrl(_0x221ac4);console['log'](_0x1f14eb(0x126)),console[_0x1f14eb(0x118)]('\x20\x20'+_0xc80a8c+'/oauth/authorize'),console[_0x1f14eb(0x118)](_0x1f14eb(0x111));const _0x40b1df=await startOAuthFlow(_0x221ac4);console[_0x1f14eb(0x118)]('Validating\x20OAuth\x20tokens...');const _0xf6e7a4=TDX[_0x1f14eb(0x110)]({'site':_0x221ac4,'accessToken':_0x40b1df[_0x1f14eb(0x11d)],'logLevel':_0x21d129??LogLevel[_0x1f14eb(0x116)]}),_0x2915d0=await _0xf6e7a4[_0x1f14eb(0x127)]['getUserInfo']();console['log'](a8_0x1a3081[_0x1f14eb(0x11a)](_0x1f14eb(0x129)+_0x2915d0[_0x1f14eb(0x12a)]+')')),await saveOAuthTokens(_0x40b1df,_0x184cfb),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x184cfb?_0x1f14eb(0x112)+_0x184cfb+')':''));if(_0x184cfb){const _0xb415fd={'site':_0x221ac4};saveProfileToUserConfig(_0x184cfb,_0xb415fd),console['log'](_0x1f14eb(0x12e)+_0x184cfb+_0x1f14eb(0x115));}const _0x270067=_0x184cfb?_0x1f14eb(0x11e)+_0x184cfb:'';console[_0x1f14eb(0x118)](),console[_0x1f14eb(0x118)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1f14eb(0x118)](_0x1f14eb(0x117)+_0x270067+_0x1f14eb(0x120)),console[_0x1f14eb(0x118)](_0x1f14eb(0x117)+_0x270067+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x58b372(0x121)]='auth:login';['description']=a8_0x58b372(0x132);async[a8_0x58b372(0x123)](_0xf37e22){const _0xb88fd8=a8_0x58b372,{options:_0x487ebe}=_0xf37e22,_0x7ca5b0=_0x487ebe[_0xb88fd8(0x124)];console[_0xb88fd8(0x118)](a8_0x1a3081[_0xb88fd8(0x133)](_0xb88fd8(0x135)));const _0x26358d=_0x487ebe[_0xb88fd8(0x128)]||_0xb88fd8(0x113),_0x24dbc5=await promptSiteSelection(_0x26358d,_0x7ca5b0,_0xb88fd8(0x122));if(!_0x24dbc5)return 0x1;const _0x38ee0f=resolveSite(_0x24dbc5);return console[_0xb88fd8(0x118)](_0xb88fd8(0x12d)+_0x38ee0f),await runOAuthLoginFlow(_0x38ee0f,_0x7ca5b0,_0x487ebe['logLevel']??LogLevel[_0xb88fd8(0x116)]),0x0;}}
|