@treasuredata/tdx 2026.3.6 → 2026.3.8
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-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/user-command.js.map +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.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a3_0x22192d=a3_0x2b8b;(function(_0x357c9b,_0x29a738){const _0x38abb6=a3_0x2b8b,_0xffa8c1=_0x357c9b();while(!![]){try{const _0x433277=-parseInt(_0x38abb6(0x186))/0x1*(-parseInt(_0x38abb6(0x173))/0x2)+parseInt(_0x38abb6(0x172))/0x3+-parseInt(_0x38abb6(0x17b))/0x4*(parseInt(_0x38abb6(0x183))/0x5)+-parseInt(_0x38abb6(0x17a))/0x6*(-parseInt(_0x38abb6(0x188))/0x7)+parseInt(_0x38abb6(0x17c))/0x8+parseInt(_0x38abb6(0x17d))/0x9+-parseInt(_0x38abb6(0x170))/0xa;if(_0x433277===_0x29a738)break;else _0xffa8c1['push'](_0xffa8c1['shift']());}catch(_0xa4d333){_0xffa8c1['push'](_0xffa8c1['shift']());}}}(a3_0x1c3b,0xefee3));function a3_0x1c3b(){const _0x59e8f9=['Site:\x20','\x20activation','resolveParentId','5TOQmnA','Error:\x20Segment\x20name\x20is\x20required','verbose','192629kKKrVb','Child\x20name:\x20','12564251zGCOYo','execute','Resolved\x20child\x20ID:\x20','listActivations','resolveSegmentId','List\x20activations\x20for\x20a\x20segment','length','error','data','Error:\x20','50707880hGQwMX','name','5173089zRiudE','18gtHrRo','Resolving\x20parent\x20segment\x20\x27','site','\x20\x20Cause:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x27...','message','6harUAe','5281924dIbHlx','4589456HpiDyp','13926825AWTjZM','segment','description'];a3_0x1c3b=function(){return _0x59e8f9;};return a3_0x1c3b();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x2b8b(_0x159d53,_0x42f49e){_0x159d53=_0x159d53-0x16b;const _0x1c3bbd=a3_0x1c3b();let _0x2b8b1e=_0x1c3bbd[_0x159d53];return _0x2b8b1e;}export class ActivationsCommand extends BaseCommand{[a3_0x22192d(0x171)]='activations';[a3_0x22192d(0x17f)]=a3_0x22192d(0x16b);async[a3_0x22192d(0x189)](_0x3ec368){const _0x12d247=a3_0x22192d,{options:_0x2309c1,args:_0x1c80eb,tdx:_0x155e61}=_0x3ec368;if(_0x1c80eb[_0x12d247(0x16c)]===0x0)return console[_0x12d247(0x16d)](_0x12d247(0x184)),console[_0x12d247(0x16d)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x4be9c3,childId:_0x33079c}=parseSegmentRef(_0x1c80eb[0x0]);if(!_0x33079c)return console[_0x12d247(0x16d)](_0x12d247(0x177)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x2309c1[_0x12d247(0x185)]&&(console['error'](_0x12d247(0x180)+_0x2309c1[_0x12d247(0x175)]),console[_0x12d247(0x16d)]('Parent\x20name:\x20'+_0x4be9c3),console[_0x12d247(0x16d)](_0x12d247(0x187)+_0x33079c));const _0x5c72f6=await withSpinner(_0x12d247(0x174)+_0x4be9c3+_0x12d247(0x178),()=>_0x155e61[_0x12d247(0x17e)][_0x12d247(0x182)](_0x4be9c3),{'verbose':_0x2309c1['verbose']}),_0x24b192=_0x5c72f6['data'];_0x2309c1[_0x12d247(0x185)]&&console[_0x12d247(0x16d)]('Resolved\x20parent\x20ID:\x20'+_0x24b192);const _0x205d4f=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x33079c+_0x12d247(0x178),()=>_0x155e61['segment'][_0x12d247(0x18c)](_0x24b192,_0x33079c),{'verbose':_0x2309c1['verbose']}),_0x1fd8ac=_0x205d4f[_0x12d247(0x16e)];_0x2309c1[_0x12d247(0x185)]&&console[_0x12d247(0x16d)](_0x12d247(0x18a)+_0x1fd8ac);const _0x2c8e4b=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x33079c+_0x12d247(0x178),()=>_0x155e61[_0x12d247(0x17e)][_0x12d247(0x18b)](_0x24b192,_0x1fd8ac),{'verbose':_0x2309c1['verbose']}),_0x2adda0=_0x2c8e4b[_0x12d247(0x16e)];return console[_0x12d247(0x16d)]('✔\x20Found\x20'+_0x2adda0[_0x12d247(0x16c)]+_0x12d247(0x181)+(_0x2adda0[_0x12d247(0x16c)]!==0x1?'s':'')),await handleSDKOutput(_0x2adda0,_0x2309c1),0x0;}catch(_0x23c0d2){if(_0x23c0d2 instanceof SDKError)return console[_0x12d247(0x16d)](_0x12d247(0x16f)+_0x23c0d2[_0x12d247(0x179)]),_0x23c0d2['cause']&&console[_0x12d247(0x16d)](_0x12d247(0x176)+_0x23c0d2['cause']),0x1;throw _0x23c0d2;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x10cef5=a4_0x5d32;(function(_0xed04b6,_0x26cc45){const _0x2c97b3=a4_0x5d32,_0x555de7=_0xed04b6();while(!![]){try{const _0x3feca8=-parseInt(_0x2c97b3(0x17b))/0x1*(-parseInt(_0x2c97b3(0x153))/0x2)+parseInt(_0x2c97b3(0x14e))/0x3*(-parseInt(_0x2c97b3(0x1b9))/0x4)+parseInt(_0x2c97b3(0x16e))/0x5*(parseInt(_0x2c97b3(0x1cb))/0x6)+parseInt(_0x2c97b3(0x149))/0x7*(parseInt(_0x2c97b3(0x1c6))/0x8)+parseInt(_0x2c97b3(0x1f1))/0x9+-parseInt(_0x2c97b3(0x152))/0xa*(parseInt(_0x2c97b3(0x1bb))/0xb)+-parseInt(_0x2c97b3(0x1bc))/0xc*(parseInt(_0x2c97b3(0x1cf))/0xd);if(_0x3feca8===_0x26cc45)break;else _0x555de7['push'](_0x555de7['shift']());}catch(_0x135c92){_0x555de7['push'](_0x555de7['shift']());}}}(a4_0x4c43,0x4a416));import a4_0x5b8e6c from'chalk';import a4_0x101732 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x5d32(_0x416e77,_0x1b0a0b){_0x416e77=_0x416e77-0x13b;const _0x4c4352=a4_0x4c43();let _0x5d3230=_0x4c4352[_0x416e77];return _0x5d3230;}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_0x4c43(){const _0x150301=['projectDir','message','\x0aChanges\x20to\x20agent\x20\x27','✔\x20Context\x20set:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20files?','\x20errors','pushProject','pullAgent','projectId','no_context','found','\x0aPull\x20summary\x20for\x20\x27','no_local_folder','diff','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Using\x20current\x20project:\x20','tdx.json','agentName','execute','agentId','3043557ZNXTvh','\x0aErrors\x20found:','agents','\x20resources?','Using\x20local\x20project:\x20','yes','textKnowledgeBases','\x20|\x20','\x0aChanges\x20to\x20integration\x20\x27','error','new','utf-8','\x20created','\x20--name\x20','cwd-config','Output:\x20','newProjectId','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','join','3177874hHjfuU','INVALID_ARGUMENT','\x20total','\x20new','\x20files\x20to\x20','1296GWKcOS','dryRun','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Knowledge\x20Bases:\x20','110IHxURl','446aPPSBf','llm','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)','cloneProject','experimentalArtifacts','push','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20=\x20','action','\x22:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Would\x20pull\x20agent:\x20','hasChanges','\x20changed','context','Cancelled','agent:push','\x0a✔\x20Pushed\x20','repeat','counts','New\x20project\x20name\x20is\x20required','outputDir','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','description','isNew','total','55KJjBBE','\x22\x20to\x20a\x20different\x20profile','llm_project','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','prompts','Using\x20project:\x20','Agent\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','force','\x20successfully','Using\x20context\x20project:\x20','Project\x20cloned\x20successfully','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','2669fWFuEe','\x20\x20Integration\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20resources\x20to\x20\x27','\x20\x20Agent\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','Project:\x20','\x0a✔\x20Pulled\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','parse','agent:pull','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x22...','integrations','\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','\x20updated','Writing\x20files...','llmProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aPush\x20summary\x20for\x20\x27','Source:\x20','Using\x20project\x20from\x20','<new-name>','arg-dir','Using\x20project\x20from\x20context:\x20','\x20\x20Prompt\x20\x22','\x22\x20from\x20project\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','\x22\x20to\x20new\x20project\x20\x22','dim','Would\x20push\x20agent:\x20','unchanged','Chat:\x20','Agent:\x20','\x0aError:','red','green','Dry\x20run\x20-\x20no\x20changes\x20made','name','Analyzing\x20changes\x20to\x20push...','\x20\x20Experimental\x20Artifacts:\x20','yellow','Errors:','reason','\x20\x20Integrations:\x20','source','No\x20tdx.json\x20found\x20in\x20','\x20\x20Source:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Target:\x20','projectName','\x0aWrite\x20','agent:clone','\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','experimentalKnowledgeBases','\x20\x20Prompts:\x20','updated','profile','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\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','cwd','created','200ogCTTj','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','185911NnqLAo','12qybLsG','\x20--profile\x20','dirname','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','errors','\x0aChanges:','session','Agent\x20pulled\x20successfully','\x20\x20Agents:\x20','-\x20nothing\x20pushed','8yZGEqe','knowledgeBases','\x0aChanges\x20to\x20prompt\x20\x27','pullProject','\x20\x20Experimental\x20Artifact\x20\x22','157764EXoqkN','-\x20no\x20files\x20written','cyan','agent','15143895vxZJdR','Failed\x20to\x20push\x20agent:\x20','log','gray','outputPath','New\x20project:\x20','\x20\x20Knowledge\x20Base\x20\x22','sourceProjectName','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Analyzing\x20project\x20\x22','Clone\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project'];a4_0x4c43=function(){return _0x150301;};return a4_0x4c43();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2df844){const _0x37835c=a4_0x5d32,_0x1fe2c2=[];if(_0x2df844['total']!==undefined)_0x1fe2c2['push'](_0x2df844['total']+_0x37835c(0x14b));if(_0x2df844[_0x37835c(0x13f)]!==undefined&&_0x2df844['new']>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x19f)](_0x2df844[_0x37835c(0x13f)]+_0x37835c(0x14c)));if(_0x2df844[_0x37835c(0x1b8)]!==undefined&&_0x2df844[_0x37835c(0x1b8)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x19f)](_0x2df844[_0x37835c(0x1b8)]+_0x37835c(0x141)));if(_0x2df844[_0x37835c(0x1b3)]!==undefined&&_0x2df844[_0x37835c(0x1b3)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x1a4)](_0x2df844[_0x37835c(0x1b3)]+_0x37835c(0x18a)));if(_0x2df844[_0x37835c(0x19a)]!==undefined&&_0x2df844[_0x37835c(0x19a)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x1d2)](_0x2df844['unchanged']+'\x20unchanged'));if(_0x2df844[_0x37835c(0x1c0)]!==undefined&&_0x2df844[_0x37835c(0x1c0)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x19e)](_0x2df844[_0x37835c(0x1c0)]+_0x37835c(0x1e2)));return _0x1fe2c2['join'](',\x20');}function displayDiffs(_0x43a8a6,_0x48dcd6,_0x470934,_0x277aa2,_0xb14dcb,_0x4eff3e,_0x3059bb){const _0x5b399b=a4_0x5d32;for(const _0x9f07ce of _0x43a8a6){if(_0x9f07ce['diff']){const _0x3b5f36=_0x9f07ce[_0x5b399b(0x1ee)]||_0x9f07ce[_0x5b399b(0x1a1)];console['log'](_0x5b399b(0x1de)+_0x3b5f36+'\x27:'),console[_0x5b399b(0x1d1)]('─'['repeat'](0x3c)),console[_0x5b399b(0x1d1)](_0x9f07ce[_0x5b399b(0x1ea)]),console['log']('─'[_0x5b399b(0x165)](0x3c));}}for(const _0x4987d4 of _0x48dcd6){_0x4987d4[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x169)+_0x4987d4[_0x5b399b(0x1a1)]+'\x27:'),console['log']('─'[_0x5b399b(0x165)](0x3c)),console[_0x5b399b(0x1d1)](_0x4987d4[_0x5b399b(0x1ea)]),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)));}for(const _0x4b4991 of _0x470934){_0x4b4991[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x4b4991['name']+'\x27:'),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)),console['log'](_0x4b4991['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x26c991 of _0x277aa2){_0x26c991['diff']&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x1c8)+_0x26c991['name']+'\x27:'),console['log']('─'[_0x5b399b(0x165)](0x3c)),console['log'](_0x26c991['diff']),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)));}for(const _0x2cb424 of _0xb14dcb){_0x2cb424[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x13d)+_0x2cb424['name']+'\x27:'),console[_0x5b399b(0x1d1)]('─'['repeat'](0x3c)),console[_0x5b399b(0x1d1)](_0x2cb424[_0x5b399b(0x1ea)]),console['log']('─'[_0x5b399b(0x165)](0x3c)));}for(const _0x55426b of _0x4eff3e){_0x55426b[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x55426b[_0x5b399b(0x1a1)]+'\x27:'),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)),console[_0x5b399b(0x1d1)](_0x55426b[_0x5b399b(0x1ea)]),console[_0x5b399b(0x1d1)]('─'['repeat'](0x3c)));}for(const _0x12201d of _0x3059bb){_0x12201d[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x171)+_0x12201d[_0x5b399b(0x1a1)]+'\x27:'),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)),console[_0x5b399b(0x1d1)](_0x12201d['diff']),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x10cef5(0x1a1)]=a4_0x10cef5(0x185);[a4_0x10cef5(0x16b)]=a4_0x10cef5(0x18d);async[a4_0x10cef5(0x1ef)](_0x596aae){const _0x566599=a4_0x10cef5,{options:_0x4da421,args:_0x1931d2,tdx:_0x3773d8}=_0x596aae,_0x256a06=_0x1931d2[0x0],_0x391e47=_0x1931d2[0x1],_0x47d163=_0x4da421['output'],_0x5edb83=_0x4da421['dryRun'],_0x152d5f=_0x4da421[_0x566599(0x176)],_0x2d75ae=_0x4da421[_0x566599(0x1f6)],_0x37f631=_0x4da421['llmProject'],_0x53f02a=_0x4da421[_0x566599(0x1ce)];let _0x194d6a;if(_0x256a06){const _0x56aa26=a4_0x101732[_0x566599(0x148)](_0x256a06,_0x566599(0x1ed));if(existsSync(_0x56aa26))try{const _0x51b438=JSON[_0x566599(0x184)](readFileSync(_0x56aa26,'utf-8'));_0x51b438[_0x566599(0x170)]&&(_0x194d6a={'llm_project':_0x51b438[_0x566599(0x170)]});}catch{}}const _0xdbcc52=findAgentConfigPath(process[_0x566599(0x1b7)]());let _0x4ad29f;if(_0xdbcc52)try{const _0x140658=JSON[_0x566599(0x184)](readFileSync(_0xdbcc52,_0x566599(0x140)));_0x140658[_0x566599(0x170)]&&(_0x4ad29f={'llm_project':_0x140658[_0x566599(0x170)]});}catch{}const _0x364c27=resolveAgentPullArgs({'arg':_0x256a06,'agentNameArg':_0x391e47,'agentFlag':_0x53f02a,'contextProject':_0x37f631,'argDirConfig':_0x194d6a,'cwdConfigPath':_0xdbcc52||undefined,'cwdConfig':_0x4ad29f}),{projectNameOrId:_0x20f499,targetAgentName:_0x946035,existingOutputDir:_0x5f18f8,source:_0xc08d8b}=_0x364c27;if(_0xc08d8b===_0x566599(0x192))console[_0x566599(0x1d1)](a4_0x5b8e6c['dim'](_0x566599(0x190)+a4_0x101732[_0x566599(0x148)](_0x256a06,_0x566599(0x1ed))+':\x20'+_0x20f499));else{if(_0xc08d8b===_0x566599(0x143))console[_0x566599(0x1d1)](a4_0x5b8e6c['dim'](_0x566599(0x173)+_0x20f499));else _0xc08d8b===_0x566599(0x161)&&console[_0x566599(0x1d1)](a4_0x5b8e6c['dim'](_0x566599(0x193)+_0x20f499));}if(!_0x20f499)return _0x53f02a?(console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x1a4)](_0x566599(0x186))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x566599(0x1d1)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x5b8e6c[_0x566599(0x1a4)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x566599(0x1d1)](_0x566599(0x155)),console['log']('\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[_0x566599(0x1d1)](_0x566599(0x1b6)),console[_0x566599(0x1d1)](_0x566599(0x1b0)),console[_0x566599(0x1d1)](_0x566599(0x189))),0x1;if(_0x946035){const {data:_0x2796b3}=await withSpinner('Pulling\x20agent\x20\x22'+_0x946035+_0x566599(0x195)+_0x20f499+_0x566599(0x187),()=>_0x3773d8['llm'][_0x566599(0x1e4)](_0x20f499,_0x946035,_0x47d163,{'dryRun':_0x5edb83,'force':_0x152d5f}));if(_0x5edb83)return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x1a4)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0x566599(0x15e)+_0x2796b3['agentName']),console[_0x566599(0x1d1)]('Output\x20path:\x20'+_0x2796b3['outputPath']),_0x2796b3[_0x566599(0x1ea)]&&(console[_0x566599(0x1d1)](_0x566599(0x1c1)),console['log']('─'[_0x566599(0x165)](0x3c)),console[_0x566599(0x1d1)](_0x2796b3['diff']),console[_0x566599(0x1d1)]('─'[_0x566599(0x165)](0x3c))),0x0;return console[_0x566599(0x1d1)](a4_0x5b8e6c['green'](_0x566599(0x1c3))),console[_0x566599(0x1d1)](_0x566599(0x19c)+_0x2796b3[_0x566599(0x1ee)]),console[_0x566599(0x1d1)](_0x566599(0x144)+_0x2796b3[_0x566599(0x1d3)]),console['log']('Status:\x20'+(_0x2796b3[_0x566599(0x16c)]?a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x13f)):_0x2796b3[_0x566599(0x15f)]?a4_0x5b8e6c['yellow'](_0x566599(0x1b3)):a4_0x5b8e6c[_0x566599(0x1d2)](_0x566599(0x19a)))),0x0;}const _0x40e3fc=_0x5f18f8||_0x47d163,{data:_0x2941c9}=await withSpinner(_0x566599(0x1d9)+_0x20f499+_0x566599(0x187),()=>_0x3773d8[_0x566599(0x154)]['pullProject'](_0x20f499,_0x40e3fc,{'dryRun':!![]})),_0x40926f=_0x2941c9['counts'][_0x566599(0x1f3)]['new']+_0x2941c9[_0x566599(0x166)]['knowledgeBases']['new']+_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'][_0x566599(0x13f)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x172)][_0x566599(0x13f)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x188)][_0x566599(0x13f)]+_0x2941c9['counts'][_0x566599(0x1b1)][_0x566599(0x13f)]+_0x2941c9[_0x566599(0x166)]['experimentalArtifacts']['new'],_0x150fee=_0x2941c9[_0x566599(0x166)][_0x566599(0x1f3)][_0x566599(0x1b3)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x1c7)][_0x566599(0x1b3)]+_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'][_0x566599(0x1b3)]+_0x2941c9['counts'][_0x566599(0x172)][_0x566599(0x1b3)]+_0x2941c9['counts'][_0x566599(0x188)][_0x566599(0x1b3)]+_0x2941c9['counts']['experimentalKnowledgeBases']['updated']+_0x2941c9[_0x566599(0x166)][_0x566599(0x157)][_0x566599(0x1b3)],_0x80e617=_0x2941c9[_0x566599(0x166)][_0x566599(0x1f3)][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x1c7)][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['prompts']['unchanged']+_0x2941c9[_0x566599(0x166)]['integrations'][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['experimentalKnowledgeBases'][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['experimentalArtifacts'][_0x566599(0x19a)];console[_0x566599(0x1d1)](_0x566599(0x1e8)+_0x2941c9[_0x566599(0x1ad)]+'\x27:'),console[_0x566599(0x1d1)]('\x20\x20'+a4_0x5b8e6c[_0x566599(0x19f)]('+\x20'+_0x40926f+'\x20new')+_0x566599(0x13c)+a4_0x5b8e6c[_0x566599(0x1a4)]('~\x20'+_0x150fee+_0x566599(0x160))+_0x566599(0x13c)+a4_0x5b8e6c['dim']('=\x20'+_0x80e617+'\x20unchanged')),console['log'](_0x566599(0x1c4)+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x1f3)])),console[_0x566599(0x1d1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2941c9[_0x566599(0x166)]['knowledgeBases'])),console[_0x566599(0x1d1)](_0x566599(0x159)+formatCountSummary(_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'])),console[_0x566599(0x1d1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x172)])),console[_0x566599(0x1d1)](_0x566599(0x1a7)+formatCountSummary(_0x2941c9['counts'][_0x566599(0x188)]));const _0x165ca8=_0x2941c9[_0x566599(0x166)][_0x566599(0x1b1)][_0x566599(0x16d)]>0x0||_0x2941c9[_0x566599(0x166)][_0x566599(0x157)]['total']>0x0;_0x165ca8&&(console['log'](_0x566599(0x1ab)+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x1b1)])),console['log'](_0x566599(0x1a3)+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x157)])));console[_0x566599(0x1d1)](_0x566599(0x1ac)+a4_0x5b8e6c[_0x566599(0x1cd)](_0x2941c9[_0x566599(0x168)])),displayDiffs(_0x2941c9[_0x566599(0x1f3)],_0x2941c9[_0x566599(0x1c7)],_0x2941c9[_0x566599(0x13b)],_0x2941c9[_0x566599(0x172)],_0x2941c9[_0x566599(0x188)],_0x2941c9['experimentalKnowledgeBases'],_0x2941c9[_0x566599(0x157)]);if(_0x5edb83)return console[_0x566599(0x1d1)](a4_0x5b8e6c['yellow'](_0x566599(0x17a))),0x0;if(_0x40926f===0x0&&_0x150fee===0x0)return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x1d8))),saveSessionContext({'llm_project':_0x2941c9[_0x566599(0x1ad)]},_0x4da421[_0x566599(0x1c2)]),console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x1df)+a4_0x5b8e6c[_0x566599(0x198)](_0x566599(0x170))+_0x566599(0x15a)+a4_0x5b8e6c[_0x566599(0x1cd)](_0x2941c9[_0x566599(0x1ad)]))),0x0;if(!_0x2d75ae&&!_0x152d5f){if(!isInteractive())return console[_0x566599(0x13e)](a4_0x5b8e6c['red'](_0x566599(0x19d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x566599(0x13e)](a4_0x5b8e6c[_0x566599(0x198)](_0x566599(0x1e0))),0x1;const _0x44f9f5=await confirmKey(_0x566599(0x1ae)+(_0x40926f+_0x150fee)+_0x566599(0x1e1));if(!_0x44f9f5)return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x1a4)](_0x566599(0x162)),_0x566599(0x1cc)),0x1;}const {data:_0x5c8488}=await withSpinner(_0x566599(0x18b),()=>_0x3773d8['llm'][_0x566599(0x1c9)](_0x20f499,_0x40e3fc,{'force':_0x152d5f}));return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x182)+(_0x40926f+_0x150fee)+_0x566599(0x14d)+_0x5c8488['outputDir'])),saveSessionContext({'llm_project':_0x5c8488[_0x566599(0x1ad)]},_0x4da421[_0x566599(0x1c2)]),console[_0x566599(0x1d1)](a4_0x5b8e6c['green'](_0x566599(0x1df)+a4_0x5b8e6c[_0x566599(0x198)](_0x566599(0x170))+_0x566599(0x15a)+a4_0x5b8e6c['cyan'](_0x5c8488[_0x566599(0x1ad)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x10cef5(0x1a1)]=a4_0x10cef5(0x1af);[a4_0x10cef5(0x16b)]=a4_0x10cef5(0x1db);async[a4_0x10cef5(0x1ef)](_0x3b4d95){const _0x2e2740=a4_0x10cef5,{options:_0x15bfd1,args:_0x49e68b,tdx:_0xe693ac}=_0x3b4d95,_0x53f647=_0x49e68b[0x0],_0x5c7c06=_0x15bfd1[_0x2e2740(0x1a1)],_0x47f045=_0x15bfd1[_0x2e2740(0x14f)],_0x4c8639=_0x15bfd1[_0x2e2740(0x1f6)],_0x571966=_0x15bfd1['site'],_0x41f820=_0x15bfd1[_0x2e2740(0x18c)];let _0x4da669;const _0x2eacd4=findAgentConfigPath(process[_0x2e2740(0x1b7)]());if(_0x53f647){const _0x1ee6fe=a4_0x101732[_0x2e2740(0x148)](_0x53f647,_0x2e2740(0x1ed));existsSync(_0x1ee6fe)?(_0x4da669=_0x53f647,console[_0x2e2740(0x1d1)](a4_0x5b8e6c['dim'](_0x2e2740(0x1f5)+_0x53f647))):_0x4da669=_0x53f647;}else{if(_0x2eacd4)_0x4da669=a4_0x101732[_0x2e2740(0x1be)](_0x2eacd4),console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x1ec)+_0x4da669));else{if(_0x41f820){const _0x5efb69=sanitizeForFilesystem(_0x41f820);let _0x278470=_0x5efb69,_0x487578=a4_0x101732[_0x2e2740(0x148)](process['cwd'](),_0x2e2740(0x1f3),_0x5efb69,_0x2e2740(0x1ed));if(!existsSync(_0x487578)){const _0x3f534c=normalizeName(_0x41f820),_0x48cda2=a4_0x101732[_0x2e2740(0x148)](process[_0x2e2740(0x1b7)](),'agents',_0x3f534c,'tdx.json');existsSync(_0x48cda2)&&(_0x278470=_0x3f534c,_0x487578=_0x48cda2);}if(existsSync(_0x487578))_0x4da669=a4_0x101732[_0x2e2740(0x1be)](_0x487578),console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x1f5)+_0x4da669));else{const _0xff35e8=_0x15bfd1[_0x2e2740(0x1b4)];if(_0xff35e8)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2e2740(0x17d)+_0x41f820+_0x2e2740(0x16f),undefined,{'helpText':_0x2e2740(0x1d7)+_0x2e2740(0x15d)+(_0x2e2740(0x196)+_0x41f820+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x278470+_0x2e2740(0x142)+(_0x5c7c06||_0x2e2740(0x191))+_0x2e2740(0x1bd)+_0xff35e8)});_0x4da669=_0x41f820,console['log'](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x178)+_0x41f820));}}}}if(!_0x4da669)return console['log'](a4_0x5b8e6c[_0x2e2740(0x1a4)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x2e2740(0x1d1)](_0x2e2740(0x146)),console[_0x2e2740(0x1d1)](_0x2e2740(0x147)),console[_0x2e2740(0x1d1)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x2e2740(0x1d1)](_0x2e2740(0x1bf)),0x1;if(!_0x5c7c06)throw new SDKError(ErrorCode[_0x2e2740(0x16a)],_0x2e2740(0x167),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x4c8639&&!_0x47f045){if(!isInteractive())return console['error'](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x19d)),_0x2e2740(0x175)),console[_0x2e2740(0x13e)](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x1e0))),0x1;const _0x15d01d=await confirmKey(_0x2e2740(0x1da)+_0x4da669+_0x2e2740(0x197)+_0x5c7c06+'\x22?');if(!_0x15d01d)return console['log'](a4_0x5b8e6c[_0x2e2740(0x1a4)](_0x2e2740(0x162))),0x1;}const {data:_0x386706}=await withSpinner('Cloning\x20\x22'+_0x4da669+'\x22\x20to\x20\x22'+_0x5c7c06+_0x2e2740(0x187),()=>_0xe693ac[_0x2e2740(0x154)][_0x2e2740(0x156)](_0x4da669,_0x5c7c06,{'dryRun':_0x47f045}));if(_0x47f045){console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x1a4)](_0x2e2740(0x1a0))),console['log'](_0x2e2740(0x18f)+_0x386706[_0x2e2740(0x1d6)]),console['log'](_0x2e2740(0x1d4)+_0x5c7c06),console[_0x2e2740(0x1d1)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1f3)][_0x2e2740(0x1b8)]),console[_0x2e2740(0x1d1)]('\x20\x20Knowledge\x20Bases:\x20'+_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1c7)][_0x2e2740(0x1b8)]),console[_0x2e2740(0x1d1)](_0x2e2740(0x1b2)+_0x386706[_0x2e2740(0x166)][_0x2e2740(0x172)]['created']);const _0x31aee9=_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)]['created']>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)]['created']>0x0;return _0x31aee9&&(console['log'](_0x2e2740(0x1ab)+_0x386706['counts'][_0x2e2740(0x1b1)]['created']),console[_0x2e2740(0x1d1)](_0x2e2740(0x1a3)+_0x386706['counts']['experimentalArtifacts']['created'])),0x0;}const _0x1fc2a0=_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1f3)]['errors']>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1c7)]['errors']>0x0||_0x386706['counts'][_0x2e2740(0x172)][_0x2e2740(0x1c0)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)][_0x2e2740(0x1c0)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)][_0x2e2740(0x1c0)]>0x0;_0x1fc2a0?console['log'](a4_0x5b8e6c[_0x2e2740(0x1a4)]('Project\x20cloned\x20with\x20errors')):console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19f)](_0x2e2740(0x179)));console[_0x2e2740(0x1d1)](_0x2e2740(0x18f)+_0x386706[_0x2e2740(0x1d6)]),console['log'](_0x2e2740(0x1d4)+_0x386706['newProjectName']),console[_0x2e2740(0x1d1)]('New\x20project\x20ID:\x20'+_0x386706[_0x2e2740(0x145)]),console[_0x2e2740(0x1d1)](),console['log']('Summary:'),console[_0x2e2740(0x1d1)](_0x2e2740(0x1c4)+formatCountSummary(_0x386706[_0x2e2740(0x166)]['agents'])),console[_0x2e2740(0x1d1)](_0x2e2740(0x151)+formatCountSummary(_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1c7)])),console[_0x2e2740(0x1d1)](_0x2e2740(0x1b2)+formatCountSummary(_0x386706['counts'][_0x2e2740(0x172)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x386706[_0x2e2740(0x166)]['integrations']));const _0x5892ab=_0x386706['counts']['experimentalKnowledgeBases'][_0x2e2740(0x1b8)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)][_0x2e2740(0x1b3)]>0x0||_0x386706['counts'][_0x2e2740(0x1b1)][_0x2e2740(0x19a)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)][_0x2e2740(0x1b8)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)][_0x2e2740(0x1b3)]>0x0||_0x386706['counts']['experimentalArtifacts']['unchanged']>0x0;_0x5892ab&&(console[_0x2e2740(0x1d1)](_0x2e2740(0x1ab)+formatCountSummary(_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)])),console[_0x2e2740(0x1d1)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)])));if(_0x1fc2a0){console[_0x2e2740(0x1d1)](),console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x1a5)));for(const _0x5eff84 of _0x386706[_0x2e2740(0x1f3)]){_0x5eff84[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x17f)+_0x5eff84[_0x2e2740(0x1ee)]+_0x2e2740(0x15c)+_0x5eff84[_0x2e2740(0x13e)]));}for(const _0x21848c of _0x386706[_0x2e2740(0x1c7)]){_0x21848c[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console['log'](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x1d5)+_0x21848c[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x21848c['error']));}for(const _0x1c2158 of _0x386706['prompts']){_0x1c2158['action']==='error'&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x194)+_0x1c2158[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x1c2158[_0x2e2740(0x13e)]));}for(const _0x521253 of _0x386706[_0x2e2740(0x188)]){_0x521253['action']===_0x2e2740(0x13e)&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)]('\x20\x20Integration\x20\x22'+_0x521253[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x521253['error']));}for(const _0x2e487 of _0x386706['experimentalKnowledgeBases']){_0x2e487[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c['red'](_0x2e2740(0x1b5)+_0x2e487[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x2e487[_0x2e2740(0x13e)]));}for(const _0x173808 of _0x386706['experimentalArtifacts']){_0x173808[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console['log'](a4_0x5b8e6c['red'](_0x2e2740(0x1ca)+_0x173808['name']+_0x2e2740(0x15c)+_0x173808[_0x2e2740(0x13e)]));}return 0x1;}console[_0x2e2740(0x1d1)]();const _0x254487=getLLMProjectUrl(_0x571966,_0x386706[_0x2e2740(0x145)]);return console['log']('Project:\x20'+a4_0x5b8e6c[_0x2e2740(0x1cd)](_0x254487)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x10cef5(0x1a1)]=a4_0x10cef5(0x163);[a4_0x10cef5(0x16b)]=a4_0x10cef5(0x1ba);async['execute'](_0x251422){const _0x57d79d=a4_0x10cef5,{options:_0x25da77,args:_0x152eaa,tdx:_0x143157}=_0x251422;let _0x1c53e5=_0x152eaa[0x0]||process['cwd']();const _0x1cdd7=_0x25da77[_0x57d79d(0x14f)],_0x2879ea=_0x25da77[_0x57d79d(0x176)],_0x242b4b=_0x25da77[_0x57d79d(0x1f6)],_0x8d7e60=_0x25da77['site'],_0x729942=a4_0x101732[_0x57d79d(0x148)](_0x1c53e5,'agent.yml'),_0x56880a=existsSync(_0x729942);if(_0x56880a){const {data:_0x195da3}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x1c53e5+'\x22...',()=>_0x143157[_0x57d79d(0x154)]['pushAgent'](_0x1c53e5,{'dryRun':_0x1cdd7,'force':_0x2879ea}));if(_0x1cdd7)return console[_0x57d79d(0x1d1)](a4_0x5b8e6c['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x57d79d(0x1d1)](_0x57d79d(0x199)+_0x195da3[_0x57d79d(0x1ee)]),0x0;if(_0x195da3['action']==='error')return console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x1d0)+_0x195da3[_0x57d79d(0x13e)])),0x1;console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19f)](_0x57d79d(0x174)+_0x195da3['action']+_0x57d79d(0x177))),console[_0x57d79d(0x1d1)](_0x57d79d(0x19c)+_0x195da3[_0x57d79d(0x1ee)]);if(_0x195da3[_0x57d79d(0x1f0)]&&_0x195da3[_0x57d79d(0x1e5)]){const _0x566583=getLLMAgentChatUrl(_0x8d7e60,_0x195da3['projectId'],_0x195da3['agentId']);console[_0x57d79d(0x1d1)](_0x57d79d(0x19b)+a4_0x5b8e6c['cyan'](_0x566583));}return 0x0;}const _0x3e7c40=_0x25da77[_0x57d79d(0x18c)],_0x273d84=resolveProjectFromContext(_0x1c53e5,_0x3e7c40);if(_0x273d84[_0x57d79d(0x1e7)])_0x1c53e5=_0x273d84[_0x57d79d(0x1dc)],_0x273d84[_0x57d79d(0x1a8)]===_0x57d79d(0x161)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c['dim'](_0x57d79d(0x173)+_0x1c53e5));else{let _0x3a1b94=_0x57d79d(0x1eb);_0x273d84[_0x57d79d(0x1a6)]===_0x57d79d(0x1e9)&&(_0x3a1b94=_0x273d84[_0x57d79d(0x1dd)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x273d84[_0x57d79d(0x18c)]+_0x57d79d(0x180));throw new SDKError(ErrorCode[_0x57d79d(0x14a)],_0x273d84[_0x57d79d(0x1a6)]===_0x57d79d(0x1e6)?_0x273d84[_0x57d79d(0x1dd)]:_0x57d79d(0x1a9)+_0x1c53e5,undefined,{'helpText':_0x3a1b94});}const {data:_0x42f5b7}=await withSpinner(_0x57d79d(0x1a2),()=>_0x143157[_0x57d79d(0x154)][_0x57d79d(0x1e3)](_0x1c53e5,{'dryRun':!![]})),_0x4de9e1=_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1f3)][_0x57d79d(0x1c0)]>0x0;if(_0x4de9e1){console['log'](a4_0x5b8e6c['red'](_0x57d79d(0x1f2)));for(const _0x10129d of _0x42f5b7['agents']){_0x10129d[_0x57d79d(0x15b)]==='error'&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)]('\x20\x20Agent\x20\x22'+_0x10129d['agentName']+_0x57d79d(0x15c)+_0x10129d[_0x57d79d(0x13e)]));}return 0x1;}const _0x3ce977=_0x42f5b7[_0x57d79d(0x166)]['agents'][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1c7)][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x13b)][_0x57d79d(0x1b8)]+_0x42f5b7['counts']['prompts'][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x188)][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1b1)]['created']+_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x1b8)],_0xa030d8=_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1f3)]['updated']+_0x42f5b7['counts'][_0x57d79d(0x1c7)]['updated']+_0x42f5b7[_0x57d79d(0x166)]['textKnowledgeBases'][_0x57d79d(0x1b3)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x172)]['updated']+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x188)]['updated']+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1b1)][_0x57d79d(0x1b3)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x157)][_0x57d79d(0x1b3)],_0x17fab4=_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1f3)]['unchanged']+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1c7)][_0x57d79d(0x19a)]+_0x42f5b7['counts']['textKnowledgeBases'][_0x57d79d(0x19a)]+_0x42f5b7[_0x57d79d(0x166)]['prompts'][_0x57d79d(0x19a)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x188)][_0x57d79d(0x19a)]+_0x42f5b7['counts'][_0x57d79d(0x1b1)][_0x57d79d(0x19a)]+_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x19a)];console[_0x57d79d(0x1d1)](_0x57d79d(0x18e)+_0x42f5b7[_0x57d79d(0x1ad)]+'\x27:'),console[_0x57d79d(0x1d1)]('\x20\x20'+a4_0x5b8e6c['green']('+\x20'+_0x3ce977+_0x57d79d(0x14c))+'\x20|\x20'+a4_0x5b8e6c[_0x57d79d(0x1a4)]('~\x20'+_0xa030d8+_0x57d79d(0x160))+_0x57d79d(0x13c)+a4_0x5b8e6c[_0x57d79d(0x198)]('=\x20'+_0x17fab4+'\x20unchanged')),console[_0x57d79d(0x1d1)](_0x57d79d(0x1c4)+formatCountSummary(_0x42f5b7['counts'][_0x57d79d(0x1f3)])),console[_0x57d79d(0x1d1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x42f5b7[_0x57d79d(0x166)]['knowledgeBases'])),console[_0x57d79d(0x1d1)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x13b)])),console['log'](_0x57d79d(0x1b2)+formatCountSummary(_0x42f5b7['counts']['prompts'])),console['log'](_0x57d79d(0x1a7)+formatCountSummary(_0x42f5b7['counts'][_0x57d79d(0x188)]));const _0x5e2519=_0x42f5b7['counts']['experimentalKnowledgeBases'][_0x57d79d(0x1b8)]>0x0||_0x42f5b7[_0x57d79d(0x166)]['experimentalKnowledgeBases'][_0x57d79d(0x1b3)]>0x0||_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1b1)][_0x57d79d(0x19a)]>0x0||_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x1b8)]>0x0||_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x1b3)]>0x0||_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x157)][_0x57d79d(0x19a)]>0x0;_0x5e2519&&(console[_0x57d79d(0x1d1)](_0x57d79d(0x1ab)+formatCountSummary(_0x42f5b7['counts']['experimentalKnowledgeBases'])),console[_0x57d79d(0x1d1)](_0x57d79d(0x1a3)+formatCountSummary(_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x157)])));console[_0x57d79d(0x1d1)](_0x57d79d(0x1aa)+a4_0x5b8e6c['cyan'](_0x1c53e5)),displayDiffs(_0x42f5b7[_0x57d79d(0x1f3)],_0x42f5b7[_0x57d79d(0x1c7)],_0x42f5b7[_0x57d79d(0x13b)],_0x42f5b7[_0x57d79d(0x172)],_0x42f5b7[_0x57d79d(0x188)],_0x42f5b7[_0x57d79d(0x1b1)],_0x42f5b7[_0x57d79d(0x157)]);if(_0x1cdd7)return console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x1a4)](_0x57d79d(0x150))),0x0;if(_0x3ce977===0x0&&_0xa030d8===0x0){console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19f)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x1dc800=getLLMProjectUrl(_0x8d7e60,_0x42f5b7[_0x57d79d(0x1e5)]);return console['log'](_0x57d79d(0x181)+a4_0x5b8e6c[_0x57d79d(0x1cd)](_0x1dc800)),0x0;}if(!_0x242b4b&&!_0x2879ea){if(!isInteractive())return console[_0x57d79d(0x13e)](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x19d)),_0x57d79d(0x175)),console[_0x57d79d(0x13e)](a4_0x5b8e6c['dim'](_0x57d79d(0x1e0))),0x1;const _0x1c1fdd=await confirmKey('\x0aPush\x20'+(_0x3ce977+_0xa030d8)+_0x57d79d(0x1f4));if(!_0x1c1fdd)return console['log'](a4_0x5b8e6c[_0x57d79d(0x1a4)](_0x57d79d(0x162)),_0x57d79d(0x1c5)),0x1;}const {data:_0x5a8b54}=await withSpinner('Pushing\x20to\x20project...',()=>_0x143157[_0x57d79d(0x154)][_0x57d79d(0x1e3)](_0x1c53e5,{'force':_0x2879ea})),_0x388a8a=_0x5a8b54['counts'][_0x57d79d(0x1f3)]['errors']>0x0||_0x5a8b54[_0x57d79d(0x166)][_0x57d79d(0x1c7)][_0x57d79d(0x1c0)]>0x0||_0x5a8b54[_0x57d79d(0x166)][_0x57d79d(0x13b)][_0x57d79d(0x1c0)]>0x0||_0x5a8b54[_0x57d79d(0x166)][_0x57d79d(0x172)][_0x57d79d(0x1c0)]>0x0;if(_0x388a8a){console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x1a4)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x57d79d(0x1d1)](),console[_0x57d79d(0x1d1)](a4_0x5b8e6c['red'](_0x57d79d(0x1a5)));for(const _0x281cb4 of _0x5a8b54[_0x57d79d(0x1f3)]){_0x281cb4[_0x57d79d(0x15b)]===_0x57d79d(0x13e)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)]('\x20\x20Agent\x20\x22'+_0x281cb4[_0x57d79d(0x1ee)]+_0x57d79d(0x15c)+_0x281cb4[_0x57d79d(0x13e)]));}for(const _0x3ff832 of _0x5a8b54[_0x57d79d(0x1c7)]){_0x3ff832[_0x57d79d(0x15b)]===_0x57d79d(0x13e)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x3ff832['name']+_0x57d79d(0x15c)+_0x3ff832['error']));}for(const _0x399fb8 of _0x5a8b54['textKnowledgeBases']){_0x399fb8['action']===_0x57d79d(0x13e)&&console['log'](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x183)+_0x399fb8[_0x57d79d(0x1a1)]+'\x22:\x20'+_0x399fb8[_0x57d79d(0x13e)]));}for(const _0x2760d2 of _0x5a8b54['prompts']){_0x2760d2[_0x57d79d(0x15b)]==='error'&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c['red'](_0x57d79d(0x194)+_0x2760d2[_0x57d79d(0x1a1)]+_0x57d79d(0x15c)+_0x2760d2[_0x57d79d(0x13e)]));}for(const _0x311345 of _0x5a8b54[_0x57d79d(0x188)]){_0x311345['action']===_0x57d79d(0x13e)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x17c)+_0x311345[_0x57d79d(0x1a1)]+'\x22:\x20'+_0x311345['error']));}return 0x1;}console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19f)](_0x57d79d(0x164)+(_0x3ce977+_0xa030d8)+_0x57d79d(0x17e)+_0x5a8b54[_0x57d79d(0x1ad)]+'\x27'));const _0x32148a=getLLMProjectUrl(_0x8d7e60,_0x5a8b54['projectId']);return console[_0x57d79d(0x1d1)](_0x57d79d(0x181)+a4_0x5b8e6c[_0x57d79d(0x1cd)](_0x32148a)),0x0;}}
|
|
1
|
+
const a4_0x49f1e9=a4_0x4ed4;(function(_0x5661f5,_0x2b93b5){const _0x163736=a4_0x4ed4,_0x5c6777=_0x5661f5();while(!![]){try{const _0x1107f5=parseInt(_0x163736(0x182))/0x1*(-parseInt(_0x163736(0x130))/0x2)+-parseInt(_0x163736(0x15d))/0x3*(parseInt(_0x163736(0x18f))/0x4)+-parseInt(_0x163736(0x158))/0x5*(-parseInt(_0x163736(0x1a5))/0x6)+parseInt(_0x163736(0x1b5))/0x7+parseInt(_0x163736(0x1af))/0x8*(-parseInt(_0x163736(0x16c))/0x9)+-parseInt(_0x163736(0x168))/0xa+parseInt(_0x163736(0x184))/0xb;if(_0x1107f5===_0x2b93b5)break;else _0x5c6777['push'](_0x5c6777['shift']());}catch(_0x454ddc){_0x5c6777['push'](_0x5c6777['shift']());}}}(a4_0x449a,0xc40eb));import a4_0x370cfc from'chalk';import a4_0xdab3b3 from'path';import{existsSync,readFileSync}from'fs';function a4_0x4ed4(_0x28b170,_0xbde919){_0x28b170=_0x28b170-0x127;const _0x449a1a=a4_0x449a();let _0x4ed4de=_0x449a1a[_0x28b170];return _0x4ed4de;}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(_0x3157ef){const _0x325405=a4_0x4ed4,_0x8c6674=[];if(_0x3157ef['total']!==undefined)_0x8c6674[_0x325405(0x1bf)](_0x3157ef[_0x325405(0x19a)]+_0x325405(0x17a));if(_0x3157ef[_0x325405(0x159)]!==undefined&&_0x3157ef[_0x325405(0x159)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc['green'](_0x3157ef['new']+_0x325405(0x180)));if(_0x3157ef[_0x325405(0x1bb)]!==undefined&&_0x3157ef[_0x325405(0x1bb)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc[_0x325405(0x134)](_0x3157ef[_0x325405(0x1bb)]+'\x20created'));if(_0x3157ef[_0x325405(0x1a9)]!==undefined&&_0x3157ef[_0x325405(0x1a9)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc[_0x325405(0x1ab)](_0x3157ef[_0x325405(0x1a9)]+_0x325405(0x12a)));if(_0x3157ef['unchanged']!==undefined&&_0x3157ef['unchanged']>0x0)_0x8c6674['push'](a4_0x370cfc[_0x325405(0x170)](_0x3157ef[_0x325405(0x17c)]+_0x325405(0x1d1)));if(_0x3157ef[_0x325405(0x1c1)]!==undefined&&_0x3157ef[_0x325405(0x1c1)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc[_0x325405(0x18b)](_0x3157ef[_0x325405(0x1c1)]+'\x20errors'));return _0x8c6674[_0x325405(0x174)](',\x20');}function displayDiffs(_0x5b9743,_0x3f9c6d,_0x437868,_0x1dd615,_0x1171fa,_0x39c1d8,_0x1ac032){const _0x305d52=a4_0x4ed4;for(const _0x1942c8 of _0x5b9743){if(_0x1942c8[_0x305d52(0x177)]){const _0xe31c17=_0x1942c8['agentName']||_0x1942c8[_0x305d52(0x19e)];console[_0x305d52(0x1ba)](_0x305d52(0x1b8)+_0xe31c17+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console[_0x305d52(0x1ba)](_0x1942c8[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c));}}for(const _0x15e76a of _0x3f9c6d){_0x15e76a[_0x305d52(0x177)]&&(console[_0x305d52(0x1ba)](_0x305d52(0x186)+_0x15e76a['name']+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console[_0x305d52(0x1ba)](_0x15e76a[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x287b9f of _0x437868){_0x287b9f['diff']&&(console[_0x305d52(0x1ba)](_0x305d52(0x1c9)+_0x287b9f['name']+'\x27:'),console[_0x305d52(0x1ba)]('─'['repeat'](0x3c)),console[_0x305d52(0x1ba)](_0x287b9f['diff']),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x432079 of _0x1dd615){_0x432079[_0x305d52(0x177)]&&(console[_0x305d52(0x1ba)](_0x305d52(0x12c)+_0x432079[_0x305d52(0x19e)]+'\x27:'),console['log']('─'[_0x305d52(0x13c)](0x3c)),console['log'](_0x432079['diff']),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x54cb64 of _0x1171fa){_0x54cb64[_0x305d52(0x177)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x54cb64[_0x305d52(0x19e)]+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console[_0x305d52(0x1ba)](_0x54cb64[_0x305d52(0x177)]),console['log']('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x42a638 of _0x39c1d8){_0x42a638[_0x305d52(0x177)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x42a638['name']+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console['log'](_0x42a638[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x1849de of _0x1ac032){_0x1849de['diff']&&(console['log'](_0x305d52(0x19d)+_0x1849de[_0x305d52(0x19e)]+'\x27:'),console[_0x305d52(0x1ba)]('─'['repeat'](0x3c)),console['log'](_0x1849de[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'['repeat'](0x3c)));}}function a4_0x449a(){const _0x31569b=['projectDir','\x20new','pushAgent','1389499qGemhH','force','29699109UhWeAz','agentId','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20--name\x20','dryRun','action','agent:pull','red','\x22...','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Agent\x20','8LvDXgR','cwd-config','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Prompts:\x20','counts','cwd','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Integration\x20\x22','Cancelled','Agent:\x20','pullProject','total','\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)','cloneProject','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','name','\x20files?','experimentalArtifacts','\x20|\x20','✔\x20Context\x20set:\x20','source','context','6mphGQc','\x20\x20Knowledge\x20Base\x20\x22','Agent\x20pulled\x20successfully','\x20\x20Integrations:\x20','updated','Dry\x20run\x20-\x20no\x20files\x20written','yellow','Errors:','integrations','dirname','184tJkifV','\x20\x20Experimental\x20Artifacts:\x20','isNew','knowledgeBases','Pushing\x20agent\x20from\x20\x22','\x20=\x20','4024748JwZfUI','\x0aErrors\x20found:','no_context','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','log','created','dim','Output:\x20','Using\x20local\x20project:\x20','push','Using\x20project\x20from\x20','errors','\x0aError:','\x20\x20Experimental\x20Artifact\x20\x22','Failed\x20to\x20push\x20agent:\x20','Project\x20cloned\x20with\x20errors','experimentalKnowledgeBases','Source:\x20','\x0aPush\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20--profile\x20','Cloning\x20\x22','Would\x20pull\x20agent:\x20','profile','outputPath','\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','tdx.json','\x20unchanged','newProjectId','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Using\x20context\x20project:\x20','parse','Analyzing\x20changes\x20to\x20push...','\x20updated','textKnowledgeBases','\x0aChanges\x20to\x20prompt\x20\x27','INVALID_ARGUMENT','pushProject','\x20changed','2gDKULg','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','outputDir','llm','green','site','Using\x20current\x20project:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','reason','MISSING_ARGUMENT','repeat','message','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Dry\x20run\x20-\x20no\x20changes\x20made','Clone\x20\x22','yes','\x20\x20Agent\x20\x22','\x0aProject\x20pushed\x20with\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','description','\x0aChanges:','Summary:','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Project:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','prompts','cyan','\x20\x20Agents:\x20','Using\x20project:\x20','llm_project','\x20\x20Prompt\x20\x22','agentName','Using\x20project\x20from\x20context:\x20','agent:push','\x20\x20Target:\x20','Chat:\x20','6797785ouabtQ','new','No\x20tdx.json\x20found\x20in\x20','\x0a✔\x20Pushed\x20','agents','776418fLmGVk','sourceProjectName','llmProject','\x0aPull\x20summary\x20for\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20resources?','\x20\x20Knowledge\x20Bases:\x20','\x22\x20to\x20new\x20project\x20\x22','newProjectName','9756200FKQrKy','Status:\x20','session','\x22:\x20','371214TJPLHP','error','projectName','utf-8','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','execute','Pushing\x20to\x20project...','join','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','New\x20project:\x20','diff','\x20\x20tdx\x20agent\x20pull\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20total','\x20successfully','unchanged','projectId','output'];a4_0x449a=function(){return _0x31569b;};return a4_0x449a();}export class AgentPullCommand extends BaseCommand{['name']=a4_0x49f1e9(0x18a);[a4_0x49f1e9(0x147)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x49f1e9(0x172)](_0x5b4d1a){const _0x487344=a4_0x49f1e9,{options:_0x4572b2,args:_0x332244,tdx:_0x1990bb}=_0x5b4d1a,_0x4076b3=_0x332244[0x0],_0x32df90=_0x332244[0x1],_0x46dee5=_0x4572b2[_0x487344(0x17e)],_0x671d2b=_0x4572b2[_0x487344(0x188)],_0x445cd2=_0x4572b2[_0x487344(0x183)],_0x47ed54=_0x4572b2[_0x487344(0x143)],_0x28e6c0=_0x4572b2['llmProject'],_0x1b9f1e=_0x4572b2['agent'];let _0x100d1d;if(_0x4076b3){const _0x2d10da=a4_0xdab3b3[_0x487344(0x174)](_0x4076b3,_0x487344(0x1d0));if(existsSync(_0x2d10da))try{const _0x2bf5d1=JSON[_0x487344(0x128)](readFileSync(_0x2d10da,'utf-8'));_0x2bf5d1[_0x487344(0x151)]&&(_0x100d1d={'llm_project':_0x2bf5d1[_0x487344(0x151)]});}catch{}}const _0x155cac=findAgentConfigPath(process['cwd']());let _0x27bff2;if(_0x155cac)try{const _0x450783=JSON[_0x487344(0x128)](readFileSync(_0x155cac,_0x487344(0x16f)));_0x450783[_0x487344(0x151)]&&(_0x27bff2={'llm_project':_0x450783[_0x487344(0x151)]});}catch{}const _0x2ed963=resolveAgentPullArgs({'arg':_0x4076b3,'agentNameArg':_0x32df90,'agentFlag':_0x1b9f1e,'contextProject':_0x28e6c0,'argDirConfig':_0x100d1d,'cwdConfigPath':_0x155cac||undefined,'cwdConfig':_0x27bff2}),{projectNameOrId:_0x226e7a,targetAgentName:_0x5ee102,existingOutputDir:_0x334d0e,source:_0x56268d}=_0x2ed963;if(_0x56268d==='arg-dir')console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x1c0)+a4_0xdab3b3[_0x487344(0x174)](_0x4076b3,_0x487344(0x1d0))+':\x20'+_0x226e7a));else{if(_0x56268d===_0x487344(0x190))console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x150)+_0x226e7a));else _0x56268d===_0x487344(0x1a4)&&console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x154)+_0x226e7a));}if(!_0x226e7a)return _0x1b9f1e?(console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1ab)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x487344(0x1ba)](_0x487344(0x162)),console[_0x487344(0x1ba)](_0x487344(0x18d))):(console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1ab)](_0x487344(0x137))),console[_0x487344(0x1ba)](_0x487344(0x1d3)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console['log'](_0x487344(0x1cf)),console[_0x487344(0x1ba)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x487344(0x1ba)]('\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(_0x5ee102){const {data:_0x480fba}=await withSpinner('Pulling\x20agent\x20\x22'+_0x5ee102+'\x22\x20from\x20project\x20\x22'+_0x226e7a+_0x487344(0x18c),()=>_0x1990bb[_0x487344(0x133)]['pullAgent'](_0x226e7a,_0x5ee102,_0x46dee5,{'dryRun':_0x671d2b,'force':_0x445cd2}));if(_0x671d2b)return console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1ab)](_0x487344(0x1aa))),console[_0x487344(0x1ba)](_0x487344(0x1cc)+_0x480fba[_0x487344(0x153)]),console[_0x487344(0x1ba)]('Output\x20path:\x20'+_0x480fba[_0x487344(0x1ce)]),_0x480fba[_0x487344(0x177)]&&(console['log'](_0x487344(0x148)),console['log']('─'['repeat'](0x3c)),console[_0x487344(0x1ba)](_0x480fba['diff']),console[_0x487344(0x1ba)]('─'[_0x487344(0x13c)](0x3c))),0x0;return console[_0x487344(0x1ba)](a4_0x370cfc['green'](_0x487344(0x1a7))),console[_0x487344(0x1ba)]('Agent:\x20'+_0x480fba['agentName']),console[_0x487344(0x1ba)](_0x487344(0x1bd)+_0x480fba[_0x487344(0x1ce)]),console[_0x487344(0x1ba)](_0x487344(0x169)+(_0x480fba[_0x487344(0x1b1)]?a4_0x370cfc['green'](_0x487344(0x159)):_0x480fba[_0x487344(0x13f)]?a4_0x370cfc[_0x487344(0x1ab)]('updated'):a4_0x370cfc[_0x487344(0x170)](_0x487344(0x17c)))),0x0;}const _0x4eff79=_0x334d0e||_0x46dee5,{data:_0x312e4b}=await withSpinner('Analyzing\x20project\x20\x22'+_0x226e7a+_0x487344(0x18c),()=>_0x1990bb[_0x487344(0x133)]['pullProject'](_0x226e7a,_0x4eff79,{'dryRun':!![]})),_0x5900d2=_0x312e4b[_0x487344(0x193)][_0x487344(0x15c)][_0x487344(0x159)]+_0x312e4b['counts']['knowledgeBases'][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)]['textKnowledgeBases'][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x14d)][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1ad)]['new']+_0x312e4b[_0x487344(0x193)][_0x487344(0x1c6)][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)]['experimentalArtifacts'][_0x487344(0x159)],_0x100650=_0x312e4b[_0x487344(0x193)][_0x487344(0x15c)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1b2)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x12b)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x14d)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)]['integrations']['updated']+_0x312e4b[_0x487344(0x193)][_0x487344(0x1c6)][_0x487344(0x1a9)]+_0x312e4b['counts'][_0x487344(0x1a0)][_0x487344(0x1a9)],_0x2b502a=_0x312e4b[_0x487344(0x193)][_0x487344(0x15c)][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)]['knowledgeBases'][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x12b)]['unchanged']+_0x312e4b[_0x487344(0x193)]['prompts'][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1ad)][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)]['experimentalKnowledgeBases'][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1a0)][_0x487344(0x17c)];console[_0x487344(0x1ba)](_0x487344(0x160)+_0x312e4b[_0x487344(0x16e)]+'\x27:'),console[_0x487344(0x1ba)]('\x20\x20'+a4_0x370cfc[_0x487344(0x134)]('+\x20'+_0x5900d2+_0x487344(0x180))+_0x487344(0x1a1)+a4_0x370cfc[_0x487344(0x1ab)]('~\x20'+_0x100650+_0x487344(0x12f))+'\x20|\x20'+a4_0x370cfc['dim']('=\x20'+_0x2b502a+_0x487344(0x1d1))),console[_0x487344(0x1ba)]('\x20\x20Agents:\x20'+formatCountSummary(_0x312e4b[_0x487344(0x193)]['agents'])),console[_0x487344(0x1ba)](_0x487344(0x165)+formatCountSummary(_0x312e4b[_0x487344(0x193)]['knowledgeBases'])),console[_0x487344(0x1ba)](_0x487344(0x191)+formatCountSummary(_0x312e4b['counts'][_0x487344(0x12b)])),console[_0x487344(0x1ba)](_0x487344(0x192)+formatCountSummary(_0x312e4b[_0x487344(0x193)]['prompts'])),console[_0x487344(0x1ba)](_0x487344(0x1a8)+formatCountSummary(_0x312e4b['counts']['integrations']));const _0x4f8974=_0x312e4b[_0x487344(0x193)]['experimentalKnowledgeBases'][_0x487344(0x19a)]>0x0||_0x312e4b[_0x487344(0x193)][_0x487344(0x1a0)]['total']>0x0;_0x4f8974&&(console[_0x487344(0x1ba)](_0x487344(0x163)+formatCountSummary(_0x312e4b['counts'][_0x487344(0x1c6)])),console[_0x487344(0x1ba)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x312e4b[_0x487344(0x193)]['experimentalArtifacts'])));console[_0x487344(0x1ba)](_0x487344(0x156)+a4_0x370cfc['cyan'](_0x312e4b[_0x487344(0x132)])),displayDiffs(_0x312e4b['agents'],_0x312e4b[_0x487344(0x1b2)],_0x312e4b[_0x487344(0x12b)],_0x312e4b[_0x487344(0x14d)],_0x312e4b[_0x487344(0x1ad)],_0x312e4b[_0x487344(0x1c6)],_0x312e4b['experimentalArtifacts']);if(_0x671d2b)return console['log'](a4_0x370cfc[_0x487344(0x1ab)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5900d2===0x0&&_0x100650===0x0)return console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x134)](_0x487344(0x131))),saveSessionContext({'llm_project':_0x312e4b[_0x487344(0x16e)]},_0x4572b2[_0x487344(0x16a)]),console[_0x487344(0x1ba)](a4_0x370cfc['green'](_0x487344(0x1a2)+a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x151))+_0x487344(0x1b4)+a4_0x370cfc[_0x487344(0x14e)](_0x312e4b['projectName']))),0x0;if(!_0x47ed54&&!_0x445cd2){if(!isInteractive())return console[_0x487344(0x16d)](a4_0x370cfc['red']('\x0aError:'),_0x487344(0x175)),console[_0x487344(0x16d)](a4_0x370cfc[_0x487344(0x1bc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x499dad=await confirmKey('\x0aWrite\x20'+(_0x5900d2+_0x100650)+_0x487344(0x19f));if(!_0x499dad)return console[_0x487344(0x1ba)](a4_0x370cfc['yellow'](_0x487344(0x197)),'-\x20no\x20files\x20written'),0x1;}const {data:_0xe9a508}=await withSpinner('Writing\x20files...',()=>_0x1990bb['llm'][_0x487344(0x199)](_0x226e7a,_0x4eff79,{'force':_0x445cd2}));return console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x134)]('\x0a✔\x20Pulled\x20'+(_0x5900d2+_0x100650)+'\x20files\x20to\x20'+_0xe9a508['outputDir'])),saveSessionContext({'llm_project':_0xe9a508['projectName']},_0x4572b2['session']),console['log'](a4_0x370cfc[_0x487344(0x134)]('✔\x20Context\x20set:\x20'+a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x151))+'\x20=\x20'+a4_0x370cfc['cyan'](_0xe9a508[_0x487344(0x16e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x49f1e9(0x147)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x49f1e9(0x172)](_0x420861){const _0x12c790=a4_0x49f1e9,{options:_0x3f0027,args:_0x2ca414,tdx:_0x21f8fd}=_0x420861,_0x5381da=_0x2ca414[0x0],_0x3245b5=_0x3f0027[_0x12c790(0x19e)],_0x7b3477=_0x3f0027[_0x12c790(0x188)],_0x5bd87e=_0x3f0027[_0x12c790(0x143)],_0x174417=_0x3f0027[_0x12c790(0x135)],_0x5481cf=_0x3f0027[_0x12c790(0x15f)];let _0x26f25b;const _0x26d628=findAgentConfigPath(process[_0x12c790(0x194)]());if(_0x5381da){const _0x3ee1d2=a4_0xdab3b3[_0x12c790(0x174)](_0x5381da,_0x12c790(0x1d0));existsSync(_0x3ee1d2)?(_0x26f25b=_0x5381da,console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x1be)+_0x5381da))):_0x26f25b=_0x5381da;}else{if(_0x26d628)_0x26f25b=a4_0xdab3b3[_0x12c790(0x1ae)](_0x26d628),console['log'](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x136)+_0x26f25b));else{if(_0x5481cf){const _0xe03093=sanitizeForFilesystem(_0x5481cf);let _0x565079=_0xe03093,_0x2ba935=a4_0xdab3b3[_0x12c790(0x174)](process[_0x12c790(0x194)](),_0x12c790(0x15c),_0xe03093,_0x12c790(0x1d0));if(!existsSync(_0x2ba935)){const _0x4b1f2b=normalizeName(_0x5481cf),_0x5eed20=a4_0xdab3b3[_0x12c790(0x174)](process[_0x12c790(0x194)](),'agents',_0x4b1f2b,_0x12c790(0x1d0));existsSync(_0x5eed20)&&(_0x565079=_0x4b1f2b,_0x2ba935=_0x5eed20);}if(existsSync(_0x2ba935))_0x26f25b=a4_0xdab3b3[_0x12c790(0x1ae)](_0x2ba935),console['log'](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x1be)+_0x26f25b));else{const _0x37308f=_0x3f0027[_0x12c790(0x1cd)];if(_0x37308f)throw new SDKError(ErrorCode[_0x12c790(0x12d)],_0x12c790(0x14c)+_0x5481cf+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x12c790(0x161)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x12c790(0x178)+_0x5481cf+'\x0a')+(_0x12c790(0x146)+_0x565079+_0x12c790(0x187)+(_0x3245b5||'<new-name>')+_0x12c790(0x1ca)+_0x37308f)});_0x26f25b=_0x5481cf,console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x127)+_0x5481cf));}}}}if(!_0x26f25b)return console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1ab)](_0x12c790(0x179))),console[_0x12c790(0x1ba)](_0x12c790(0x1b9)),console[_0x12c790(0x1ba)](_0x12c790(0x195)),console[_0x12c790(0x1ba)](_0x12c790(0x19b)),console[_0x12c790(0x1ba)](_0x12c790(0x14a)),0x1;if(!_0x3245b5)throw new SDKError(ErrorCode[_0x12c790(0x13b)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x5bd87e&&!_0x7b3477){if(!isInteractive())return console[_0x12c790(0x16d)](a4_0x370cfc[_0x12c790(0x18b)]('\x0aError:'),_0x12c790(0x175)),console[_0x12c790(0x16d)](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x140))),0x1;const _0x32f0fc=await confirmKey(_0x12c790(0x142)+_0x26f25b+_0x12c790(0x166)+_0x3245b5+'\x22?');if(!_0x32f0fc)return console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1ab)](_0x12c790(0x197))),0x1;}const {data:_0x20aca6}=await withSpinner(_0x12c790(0x1cb)+_0x26f25b+'\x22\x20to\x20\x22'+_0x3245b5+'\x22...',()=>_0x21f8fd[_0x12c790(0x133)][_0x12c790(0x19c)](_0x26f25b,_0x3245b5,{'dryRun':_0x7b3477}));if(_0x7b3477){console['log'](a4_0x370cfc['yellow'](_0x12c790(0x141))),console[_0x12c790(0x1ba)](_0x12c790(0x1c7)+_0x20aca6[_0x12c790(0x15e)]),console[_0x12c790(0x1ba)](_0x12c790(0x176)+_0x3245b5),console[_0x12c790(0x1ba)]('Would\x20clone:'),console[_0x12c790(0x1ba)](_0x12c790(0x14f)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x15c)][_0x12c790(0x1bb)]),console['log'](_0x12c790(0x165)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1b2)][_0x12c790(0x1bb)]),console['log'](_0x12c790(0x192)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x14d)][_0x12c790(0x1bb)]);const _0x52b89a=_0x20aca6['counts'][_0x12c790(0x1c6)][_0x12c790(0x1bb)]>0x0||_0x20aca6[_0x12c790(0x193)]['experimentalArtifacts'][_0x12c790(0x1bb)]>0x0;return _0x52b89a&&(console[_0x12c790(0x1ba)](_0x12c790(0x163)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1c6)][_0x12c790(0x1bb)]),console[_0x12c790(0x1ba)](_0x12c790(0x1b0)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)]['created'])),0x0;}const _0x1c1df8=_0x20aca6['counts']['agents'][_0x12c790(0x1c1)]>0x0||_0x20aca6['counts'][_0x12c790(0x1b2)][_0x12c790(0x1c1)]>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x14d)][_0x12c790(0x1c1)]>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1c6)][_0x12c790(0x1c1)]>0x0||_0x20aca6['counts'][_0x12c790(0x1a0)]['errors']>0x0;_0x1c1df8?console['log'](a4_0x370cfc[_0x12c790(0x1ab)](_0x12c790(0x1c5))):console['log'](a4_0x370cfc[_0x12c790(0x134)]('Project\x20cloned\x20successfully'));console[_0x12c790(0x1ba)](_0x12c790(0x1c7)+_0x20aca6['sourceProjectName']),console[_0x12c790(0x1ba)]('New\x20project:\x20'+_0x20aca6[_0x12c790(0x167)]),console[_0x12c790(0x1ba)]('New\x20project\x20ID:\x20'+_0x20aca6[_0x12c790(0x1d2)]),console['log'](),console['log'](_0x12c790(0x149)),console[_0x12c790(0x1ba)](_0x12c790(0x14f)+formatCountSummary(_0x20aca6['counts'][_0x12c790(0x15c)])),console['log'](_0x12c790(0x165)+formatCountSummary(_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1b2)])),console['log'](_0x12c790(0x192)+formatCountSummary(_0x20aca6[_0x12c790(0x193)]['prompts'])),console[_0x12c790(0x1ba)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x20aca6['counts'][_0x12c790(0x1ad)]));const _0x5ac67e=_0x20aca6[_0x12c790(0x193)]['experimentalKnowledgeBases']['created']>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1c6)][_0x12c790(0x1a9)]>0x0||_0x20aca6['counts'][_0x12c790(0x1c6)][_0x12c790(0x17c)]>0x0||_0x20aca6[_0x12c790(0x193)]['experimentalArtifacts'][_0x12c790(0x1bb)]>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)]['updated']>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)][_0x12c790(0x17c)]>0x0;_0x5ac67e&&(console[_0x12c790(0x1ba)](_0x12c790(0x163)+formatCountSummary(_0x20aca6['counts'][_0x12c790(0x1c6)])),console[_0x12c790(0x1ba)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)])));if(_0x1c1df8){console['log'](),console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x1ac)));for(const _0x3efad5 of _0x20aca6[_0x12c790(0x15c)]){_0x3efad5['action']===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x144)+_0x3efad5[_0x12c790(0x153)]+_0x12c790(0x16b)+_0x3efad5[_0x12c790(0x16d)]));}for(const _0x4ce51d of _0x20aca6['knowledgeBases']){_0x4ce51d[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x1a6)+_0x4ce51d[_0x12c790(0x19e)]+'\x22:\x20'+_0x4ce51d['error']));}for(const _0x3533b0 of _0x20aca6[_0x12c790(0x14d)]){_0x3533b0[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x152)+_0x3533b0[_0x12c790(0x19e)]+_0x12c790(0x16b)+_0x3533b0[_0x12c790(0x16d)]));}for(const _0x2ae860 of _0x20aca6[_0x12c790(0x1ad)]){_0x2ae860[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc['red'](_0x12c790(0x196)+_0x2ae860[_0x12c790(0x19e)]+_0x12c790(0x16b)+_0x2ae860[_0x12c790(0x16d)]));}for(const _0x16327c of _0x20aca6['experimentalKnowledgeBases']){_0x16327c[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc['red'](_0x12c790(0x13e)+_0x16327c['name']+_0x12c790(0x16b)+_0x16327c['error']));}for(const _0x38222c of _0x20aca6[_0x12c790(0x1a0)]){_0x38222c[_0x12c790(0x189)]==='error'&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x1c3)+_0x38222c[_0x12c790(0x19e)]+'\x22:\x20'+_0x38222c['error']));}return 0x1;}console[_0x12c790(0x1ba)]();const _0x3c4b73=getLLMProjectUrl(_0x174417,_0x20aca6['newProjectId']);return console[_0x12c790(0x1ba)](_0x12c790(0x14b)+a4_0x370cfc[_0x12c790(0x14e)](_0x3c4b73)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x49f1e9(0x19e)]=a4_0x49f1e9(0x155);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x49f1e9(0x172)](_0xc74499){const _0x4cd28e=a4_0x49f1e9,{options:_0x4aa071,args:_0x9aedb9,tdx:_0x17848b}=_0xc74499;let _0x413684=_0x9aedb9[0x0]||process[_0x4cd28e(0x194)]();const _0x484c66=_0x4aa071[_0x4cd28e(0x188)],_0x4b9c1f=_0x4aa071[_0x4cd28e(0x183)],_0x5e5b98=_0x4aa071['yes'],_0x3d1269=_0x4aa071['site'],_0x229337=a4_0xdab3b3[_0x4cd28e(0x174)](_0x413684,'agent.yml'),_0xaba77e=existsSync(_0x229337);if(_0xaba77e){const {data:_0x4dedcb}=await withSpinner(_0x4cd28e(0x1b3)+_0x413684+_0x4cd28e(0x18c),()=>_0x17848b[_0x4cd28e(0x133)][_0x4cd28e(0x181)](_0x413684,{'dryRun':_0x484c66,'force':_0x4b9c1f}));if(_0x484c66)return console[_0x4cd28e(0x1ba)](a4_0x370cfc['yellow'](_0x4cd28e(0x141))),console[_0x4cd28e(0x1ba)]('Would\x20push\x20agent:\x20'+_0x4dedcb['agentName']),0x0;if(_0x4dedcb[_0x4cd28e(0x189)]===_0x4cd28e(0x16d))return console[_0x4cd28e(0x1ba)](a4_0x370cfc['red'](_0x4cd28e(0x1c4)+_0x4dedcb['error'])),0x1;console[_0x4cd28e(0x1ba)](a4_0x370cfc['green'](_0x4cd28e(0x18e)+_0x4dedcb[_0x4cd28e(0x189)]+_0x4cd28e(0x17b))),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x198)+_0x4dedcb[_0x4cd28e(0x153)]);if(_0x4dedcb[_0x4cd28e(0x185)]&&_0x4dedcb['projectId']){const _0x74bab0=getLLMAgentChatUrl(_0x3d1269,_0x4dedcb['projectId'],_0x4dedcb[_0x4cd28e(0x185)]);console[_0x4cd28e(0x1ba)](_0x4cd28e(0x157)+a4_0x370cfc[_0x4cd28e(0x14e)](_0x74bab0));}return 0x0;}const _0x24cd75=_0x4aa071[_0x4cd28e(0x15f)],_0x42d0c3=resolveProjectFromContext(_0x413684,_0x24cd75);if(_0x42d0c3['found'])_0x413684=_0x42d0c3[_0x4cd28e(0x17f)],_0x42d0c3[_0x4cd28e(0x1a3)]===_0x4cd28e(0x1a4)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x1bc)](_0x4cd28e(0x150)+_0x413684));else{let _0x3d8c4b='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x42d0c3[_0x4cd28e(0x13a)]==='no_local_folder'&&(_0x3d8c4b=_0x42d0c3[_0x4cd28e(0x13d)]+_0x4cd28e(0x139)+_0x42d0c3['llmProject']+_0x4cd28e(0x171));throw new SDKError(ErrorCode[_0x4cd28e(0x12d)],_0x42d0c3[_0x4cd28e(0x13a)]===_0x4cd28e(0x1b7)?_0x42d0c3[_0x4cd28e(0x13d)]:_0x4cd28e(0x15a)+_0x413684,undefined,{'helpText':_0x3d8c4b});}const {data:_0x337800}=await withSpinner(_0x4cd28e(0x129),()=>_0x17848b[_0x4cd28e(0x133)][_0x4cd28e(0x12e)](_0x413684,{'dryRun':!![]})),_0x65d6c9=_0x337800['counts']['agents'][_0x4cd28e(0x1c1)]>0x0;if(_0x65d6c9){console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1b6)));for(const _0x261d6f of _0x337800[_0x4cd28e(0x15c)]){_0x261d6f[_0x4cd28e(0x189)]===_0x4cd28e(0x16d)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x144)+_0x261d6f[_0x4cd28e(0x153)]+_0x4cd28e(0x16b)+_0x261d6f[_0x4cd28e(0x16d)]));}return 0x1;}const _0x54eb13=_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x15c)]['created']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1b2)][_0x4cd28e(0x1bb)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x12b)][_0x4cd28e(0x1bb)]+_0x337800['counts']['prompts'][_0x4cd28e(0x1bb)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1ad)]['created']+_0x337800[_0x4cd28e(0x193)]['experimentalKnowledgeBases']['created']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)][_0x4cd28e(0x1bb)],_0x4eb015=_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x15c)]['updated']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1b2)][_0x4cd28e(0x1a9)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x12b)]['updated']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x14d)][_0x4cd28e(0x1a9)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1ad)][_0x4cd28e(0x1a9)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)][_0x4cd28e(0x1a9)]+_0x337800['counts']['experimentalArtifacts']['updated'],_0x173d70=_0x337800[_0x4cd28e(0x193)]['agents'][_0x4cd28e(0x17c)]+_0x337800['counts'][_0x4cd28e(0x1b2)][_0x4cd28e(0x17c)]+_0x337800['counts'][_0x4cd28e(0x12b)][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x14d)][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)]['integrations'][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)][_0x4cd28e(0x17c)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x337800[_0x4cd28e(0x16e)]+'\x27:'),console['log']('\x20\x20'+a4_0x370cfc['green']('+\x20'+_0x54eb13+_0x4cd28e(0x180))+_0x4cd28e(0x1a1)+a4_0x370cfc[_0x4cd28e(0x1ab)]('~\x20'+_0x4eb015+'\x20changed')+_0x4cd28e(0x1a1)+a4_0x370cfc[_0x4cd28e(0x1bc)]('=\x20'+_0x173d70+_0x4cd28e(0x1d1))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x15c)])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x165)+formatCountSummary(_0x337800[_0x4cd28e(0x193)]['knowledgeBases'])),console[_0x4cd28e(0x1ba)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x12b)])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x192)+formatCountSummary(_0x337800['counts']['prompts'])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x1a8)+formatCountSummary(_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1ad)]));const _0x1c3e24=_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)]['created']>0x0||_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)]['updated']>0x0||_0x337800['counts'][_0x4cd28e(0x1c6)][_0x4cd28e(0x17c)]>0x0||_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)]['created']>0x0||_0x337800['counts'][_0x4cd28e(0x1a0)][_0x4cd28e(0x1a9)]>0x0||_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)]['unchanged']>0x0;_0x1c3e24&&(console[_0x4cd28e(0x1ba)](_0x4cd28e(0x163)+formatCountSummary(_0x337800[_0x4cd28e(0x193)]['experimentalKnowledgeBases'])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x1b0)+formatCountSummary(_0x337800['counts'][_0x4cd28e(0x1a0)])));console['log']('\x20\x20Source:\x20'+a4_0x370cfc[_0x4cd28e(0x14e)](_0x413684)),displayDiffs(_0x337800[_0x4cd28e(0x15c)],_0x337800[_0x4cd28e(0x1b2)],_0x337800['textKnowledgeBases'],_0x337800[_0x4cd28e(0x14d)],_0x337800[_0x4cd28e(0x1ad)],_0x337800[_0x4cd28e(0x1c6)],_0x337800[_0x4cd28e(0x1a0)]);if(_0x484c66)return console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x1ab)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x54eb13===0x0&&_0x4eb015===0x0){console[_0x4cd28e(0x1ba)](a4_0x370cfc['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x44424b=getLLMProjectUrl(_0x3d1269,_0x337800[_0x4cd28e(0x17d)]);return console[_0x4cd28e(0x1ba)](_0x4cd28e(0x14b)+a4_0x370cfc[_0x4cd28e(0x14e)](_0x44424b)),0x0;}if(!_0x5e5b98&&!_0x4b9c1f){if(!isInteractive())return console[_0x4cd28e(0x16d)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1c2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4cd28e(0x16d)](a4_0x370cfc[_0x4cd28e(0x1bc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3e1ed5=await confirmKey(_0x4cd28e(0x1c8)+(_0x54eb13+_0x4eb015)+_0x4cd28e(0x164));if(!_0x3e1ed5)return console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x1ab)](_0x4cd28e(0x197)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x4b04f6}=await withSpinner(_0x4cd28e(0x173),()=>_0x17848b[_0x4cd28e(0x133)][_0x4cd28e(0x12e)](_0x413684,{'force':_0x4b9c1f})),_0x2d9967=_0x4b04f6[_0x4cd28e(0x193)][_0x4cd28e(0x15c)]['errors']>0x0||_0x4b04f6[_0x4cd28e(0x193)]['knowledgeBases'][_0x4cd28e(0x1c1)]>0x0||_0x4b04f6[_0x4cd28e(0x193)][_0x4cd28e(0x12b)]['errors']>0x0||_0x4b04f6['counts']['prompts'][_0x4cd28e(0x1c1)]>0x0;if(_0x2d9967){console['log'](a4_0x370cfc[_0x4cd28e(0x1ab)](_0x4cd28e(0x145))),console[_0x4cd28e(0x1ba)](),console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1ac)));for(const _0xf121ac of _0x4b04f6[_0x4cd28e(0x15c)]){_0xf121ac[_0x4cd28e(0x189)]==='error'&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)]('\x20\x20Agent\x20\x22'+_0xf121ac[_0x4cd28e(0x153)]+'\x22:\x20'+_0xf121ac[_0x4cd28e(0x16d)]));}for(const _0x391b75 of _0x4b04f6[_0x4cd28e(0x1b2)]){_0x391b75[_0x4cd28e(0x189)]===_0x4cd28e(0x16d)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1a6)+_0x391b75['name']+_0x4cd28e(0x16b)+_0x391b75[_0x4cd28e(0x16d)]));}for(const _0x59a0e6 of _0x4b04f6[_0x4cd28e(0x12b)]){_0x59a0e6[_0x4cd28e(0x189)]==='error'&&console[_0x4cd28e(0x1ba)](a4_0x370cfc['red'](_0x4cd28e(0x138)+_0x59a0e6[_0x4cd28e(0x19e)]+_0x4cd28e(0x16b)+_0x59a0e6[_0x4cd28e(0x16d)]));}for(const _0x5632a6 of _0x4b04f6[_0x4cd28e(0x14d)]){_0x5632a6[_0x4cd28e(0x189)]===_0x4cd28e(0x16d)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x152)+_0x5632a6['name']+_0x4cd28e(0x16b)+_0x5632a6[_0x4cd28e(0x16d)]));}for(const _0x2d8633 of _0x4b04f6[_0x4cd28e(0x1ad)]){_0x2d8633['action']==='error'&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)]('\x20\x20Integration\x20\x22'+_0x2d8633[_0x4cd28e(0x19e)]+'\x22:\x20'+_0x2d8633[_0x4cd28e(0x16d)]));}return 0x1;}console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x134)](_0x4cd28e(0x15b)+(_0x54eb13+_0x4eb015)+'\x20resources\x20to\x20\x27'+_0x4b04f6[_0x4cd28e(0x16e)]+'\x27'));const _0x3ee9b9=getLLMProjectUrl(_0x3d1269,_0x4b04f6['projectId']);return console[_0x4cd28e(0x1ba)](_0x4cd28e(0x14b)+a4_0x370cfc[_0x4cd28e(0x14e)](_0x3ee9b9)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x347955=a5_0x2b4b;(function(_0x2162ca,_0x417d3b){const _0x393b34=a5_0x2b4b,_0x49e47e=_0x2162ca();while(!![]){try{const _0x132bb1=-parseInt(_0x393b34(0x181))/0x1+parseInt(_0x393b34(0x19c))/0x2*(parseInt(_0x393b34(0x15a))/0x3)+-parseInt(_0x393b34(0x15f))/0x4+parseInt(_0x393b34(0x170))/0x5+parseInt(_0x393b34(0x168))/0x6*(-parseInt(_0x393b34(0x195))/0x7)+-parseInt(_0x393b34(0x1c6))/0x8+-parseInt(_0x393b34(0x198))/0x9*(-parseInt(_0x393b34(0x17e))/0xa);if(_0x132bb1===_0x417d3b)break;else _0x49e47e['push'](_0x49e47e['shift']());}catch(_0x249d17){_0x49e47e['push'](_0x49e47e['shift']());}}}(a5_0x1272,0x7439e));import*as a5_0x273097 from'node:fs';import*as a5_0x5766ba from'node:path';import a5_0xc31aa4 from'chalk';import{BaseCommand}from'./command.js';function a5_0x2b4b(_0x30f9b9,_0xf45bc7){_0x30f9b9=_0x30f9b9-0x14a;const _0x1272ae=a5_0x1272();let _0x2b4bed=_0x1272ae[_0x30f9b9];return _0x2b4bed;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x347955(0x1c5)]=a5_0x347955(0x1cb);['description']=a5_0x347955(0x17a);async[a5_0x347955(0x1c0)](_0x522cde){const _0x42f179=a5_0x347955,{options:_0x5d7545,args:_0x28e1d1,tdx:_0x3d2a46}=_0x522cde,_0x5aca44=_0x28e1d1[0x0]||'.',_0x163d7c=_0x5d7545[_0x42f179(0x159)],_0x39ae9c=_0x5d7545,_0x1f4047=_0x39ae9c[_0x42f179(0x14e)]===![],_0x1992f9=_0x39ae9c[_0x42f179(0x1b8)],_0x1cffcc=_0x39ae9c[_0x42f179(0x1c5)],_0x131839=_0x39ae9c[_0x42f179(0x199)],_0x5357f7=_0x5d7545[_0x42f179(0x1bd)],_0x2ee67f=_0x39ae9c[_0x42f179(0x14b)];if(_0x1992f9&&_0x1f4047)return console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x155))),0x1;let _0x25cbcf=_0x42f179(0x197);if(_0x39ae9c[_0x42f179(0x18e)])_0x25cbcf=_0x42f179(0x18e);else{if(_0x39ae9c[_0x42f179(0x172)])_0x25cbcf=_0x42f179(0x172);else{if(_0x39ae9c[_0x42f179(0x19a)])_0x25cbcf=_0x42f179(0x19a);else{if(_0x39ae9c[_0x42f179(0x197)])_0x25cbcf=_0x42f179(0x197);}}}const _0x15d967=_0x39ae9c[_0x42f179(0x1d6)];let _0x490107=_0x5aca44;const _0x51d4f9=a5_0x273097[_0x42f179(0x1b3)](_0x5aca44),_0x43fd68=_0x5aca44==='.';if(!_0x51d4f9||_0x43fd68){const _0xcd4f9b=resolveProjectFromContext(_0x5aca44,_0x15d967,{'requireFile':_0x42f179(0x1c7)});if(_0xcd4f9b[_0x42f179(0x18f)])_0x490107=_0xcd4f9b[_0x42f179(0x18c)],_0xcd4f9b[_0x42f179(0x167)]==='context'&&console[_0x42f179(0x184)](a5_0xc31aa4['dim']('Using\x20agent:\x20'+_0x490107));else switch(_0xcd4f9b['reason']){case'no_context':console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1ba)](_0xcd4f9b['message'])),console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x1b7)),console['log'](_0x42f179(0x17b)),console[_0x42f179(0x184)]('\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[_0x42f179(0x184)](),console[_0x42f179(0x184)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x42f179(0x16d):console[_0x42f179(0x184)](a5_0xc31aa4['yellow'](_0xcd4f9b[_0x42f179(0x164)])),console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x14a)+_0xcd4f9b[_0x42f179(0x1d6)]+_0x42f179(0x194));return 0x1;case _0x42f179(0x1d8):{const _0x31ae9e=a5_0x5766ba[_0x42f179(0x1ac)](_0xcd4f9b[_0x42f179(0x18c)]);console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1ba)](_0x42f179(0x17c)+_0xcd4f9b[_0x42f179(0x1d6)]+'\x22:'));for(const _0x22bc94 of _0xcd4f9b[_0x42f179(0x151)]){console['log'](_0x42f179(0x193)+_0x22bc94);}return console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x1d3)+_0x31ae9e+_0x42f179(0x1d0)),0x1;}case'no_tests':console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1ba)](_0x42f179(0x1d1)+_0xcd4f9b[_0x42f179(0x1d6)]+'\x22.')),console[_0x42f179(0x184)](a5_0xc31aa4['dim'](_0x42f179(0x17f)+_0xcd4f9b[_0x42f179(0x18c)])),console['log'](),console[_0x42f179(0x184)](_0x42f179(0x165));return 0x1;}}const {definition:_0x51adda,agentInfo:_0xc09493}=parseTestFile(_0x490107);let _0x6158bd=_0x51adda['tests'];if(_0x1cffcc){const _0x1196c9=_0x1cffcc['split'](',')[_0x42f179(0x188)](_0x120241=>_0x120241[_0x42f179(0x14c)]());_0x6158bd=_0x51adda[_0x42f179(0x174)][_0x42f179(0x1aa)](_0x393a5b=>_0x1196c9[_0x42f179(0x1a7)](_0x393a5b[_0x42f179(0x1c5)]));if(_0x6158bd['length']===0x0)return console['log'](a5_0xc31aa4[_0x42f179(0x1ba)]('No\x20tests\x20found\x20matching:\x20'+_0x1cffcc)),console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)](_0x42f179(0x1ce)+_0x51adda['tests'][_0x42f179(0x188)](_0x333410=>_0x333410['name'])[_0x42f179(0x1a5)](',\x20'))),0x1;}if(_0x131839){const _0x433ff3=_0x131839[_0x42f179(0x182)](',')[_0x42f179(0x188)](_0xc34a3d=>_0xc34a3d[_0x42f179(0x14c)]()[_0x42f179(0x1e0)]());_0x6158bd=_0x6158bd[_0x42f179(0x1aa)](_0x483d40=>_0x483d40[_0x42f179(0x199)]?.[_0x42f179(0x161)](_0x5bde8e=>_0x433ff3[_0x42f179(0x1a7)](_0x5bde8e[_0x42f179(0x1e0)]())));if(_0x6158bd['length']===0x0){console['log'](a5_0xc31aa4[_0x42f179(0x1ba)](_0x42f179(0x179)+_0x131839));const _0x2556e5=new Set();return _0x51adda['tests']['forEach'](_0x41f4b1=>_0x41f4b1[_0x42f179(0x199)]?.[_0x42f179(0x1d4)](_0x38c5c9=>_0x2556e5[_0x42f179(0x19f)](_0x38c5c9))),_0x2556e5[_0x42f179(0x1df)]>0x0?console['log'](a5_0xc31aa4['dim'](_0x42f179(0x1a9)+[..._0x2556e5][_0x42f179(0x1a5)](',\x20'))):console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)](_0x42f179(0x1de))),0x1;}}if(_0x1992f9)return this[_0x42f179(0x15e)](_0x522cde,{'definition':{'tests':_0x6158bd},'agentInfo':_0xc09493,'outputFormat':_0x25cbcf,'outputFile':_0x2ee67f,'testNames':_0x1cffcc});if(_0x163d7c){console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1e2)](_0x42f179(0x1af))),console[_0x42f179(0x184)]('\x20\x20Site:\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x5357f7)),console[_0x42f179(0x184)](_0x42f179(0x169)+a5_0xc31aa4[_0x42f179(0x16c)](_0xc09493[_0x42f179(0x177)])),console[_0x42f179(0x184)](_0x42f179(0x152)+a5_0xc31aa4['white'](_0xc09493[_0x42f179(0x1d2)])),console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x16a)+a5_0xc31aa4[_0x42f179(0x16c)](_0x6158bd[_0x42f179(0x1cc)]));for(let _0xb1b262=0x0;_0xb1b262<_0x6158bd[_0x42f179(0x1cc)];_0xb1b262++){const _0x21e5a3=_0x6158bd[_0xb1b262],_0x44ca17=_0x21e5a3[_0x42f179(0x1cf)][_0x42f179(0x1cc)]===0x1?_0x42f179(0x185):_0x42f179(0x1cf),_0x17cd69=_0x21e5a3[_0x42f179(0x199)]?.[_0x42f179(0x1cc)]?'\x20['+_0x21e5a3[_0x42f179(0x199)]['join'](',\x20')+']':'';console[_0x42f179(0x184)]('\x20\x20'+(_0xb1b262+0x1)+'.\x20'+a5_0xc31aa4['white'](_0x21e5a3[_0x42f179(0x1c5)])+'\x20('+_0x21e5a3['rounds']['length']+'\x20'+_0x44ca17+')'+a5_0xc31aa4[_0x42f179(0x16f)](_0x17cd69));}return 0x0;}let _0x3e8e07,_0x41b5cd;try{_0x3e8e07=await _0x3d2a46[_0x42f179(0x1b4)]['resolveProjectId'](_0xc09493[_0x42f179(0x177)]);}catch(_0x59088f){const _0x26de68=_0x59088f instanceof Error?_0x59088f[_0x42f179(0x164)]:String(_0x59088f);return _0x26de68['includes']('404')||_0x26de68['toLowerCase']()[_0x42f179(0x1a7)](_0x42f179(0x1b6))?console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x1a0)+_0xc09493['projectName'])):console['log'](a5_0xc31aa4['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xc09493[_0x42f179(0x177)]+_0x42f179(0x1ab)+_0x26de68)),0x1;}try{_0x41b5cd=await _0x3d2a46[_0x42f179(0x1b4)]['resolveAgentId'](_0xc09493[_0x42f179(0x1d2)],_0x3e8e07);}catch(_0x950083){const _0x2f9a1a=_0x950083 instanceof Error?_0x950083[_0x42f179(0x164)]:String(_0x950083);return _0x2f9a1a[_0x42f179(0x1a7)]('404')||_0x2f9a1a[_0x42f179(0x1e0)]()[_0x42f179(0x1a7)](_0x42f179(0x1b6))?console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xc09493[_0x42f179(0x1d2)])):console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x166)+_0xc09493[_0x42f179(0x1d2)]+_0x42f179(0x1ab)+_0x2f9a1a)),0x1;}let _0x486a5c;if(!_0x1f4047)try{_0x486a5c=await setupEvaluatorAgent(_0x3d2a46[_0x42f179(0x1b4)],_0x5d7545[_0x42f179(0x1bf)]);}catch(_0x41cd3f){const _0x30f663=_0x41cd3f instanceof Error?_0x41cd3f[_0x42f179(0x164)]:String(_0x41cd3f);return console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x196)+_0x30f663)),0x1;}console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1e2)](_0x42f179(0x156))),console['log']('Site:\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x5357f7)),console[_0x42f179(0x184)](_0x42f179(0x176)+a5_0xc31aa4[_0x42f179(0x16c)](_0xc09493['projectName']+'/'+_0xc09493['agentName'])),console[_0x42f179(0x184)]();const _0x504ac3=[],_0x3b073f=[],_0x577938=Date[_0x42f179(0x1da)]();for(let _0x5bbfe9=0x0;_0x5bbfe9<_0x6158bd['length'];_0x5bbfe9++){const _0x1158cd=_0x6158bd[_0x5bbfe9];_0x6158bd[_0x42f179(0x1cc)]>0x1?console[_0x42f179(0x184)]('Test\x20'+(_0x5bbfe9+0x1)+'/'+_0x6158bd[_0x42f179(0x1cc)]+':\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x1158cd[_0x42f179(0x1c5)])):console[_0x42f179(0x184)]('Running\x20test:\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x1158cd['name']));const _0x3d78e6=createCommandSpinner(_0x42f179(0x14f)+_0x1158cd['rounds'][_0x42f179(0x1cc)]+':\x20Sending\x20user\x20input...');_0x3d78e6[_0x42f179(0x15b)]();try{const {result:_0x61d49b,conversation:_0x20710e}=await runTest(_0x3d2a46[_0x42f179(0x1b4)],_0x1158cd,{'agentId':_0x41b5cd,'projectId':_0x3e8e07,'site':_0x5357f7,'noEval':_0x1f4047,'evaluatorId':_0x486a5c,'onRoundStart':(_0x47d7cd,_0x354e51)=>{const _0x371de0=_0x42f179;_0x3d78e6[_0x371de0(0x163)]=_0x371de0(0x178)+(_0x47d7cd+0x1)+'/'+_0x354e51+_0x371de0(0x1d7);},'onRoundComplete':(_0x38af5c,_0x394f63,_0x40158d)=>{const _0x4742f8=_0x42f179,_0x292edf=formatElapsed(_0x394f63);_0x40158d?console[_0x4742f8(0x184)]('\x20\x20Round\x20'+(_0x38af5c+0x1)+'/'+_0x1158cd[_0x4742f8(0x1cf)][_0x4742f8(0x1cc)]+_0x4742f8(0x190)+a5_0xc31aa4[_0x4742f8(0x19d)]('✓')+'\x20('+_0x292edf+')'):console[_0x4742f8(0x184)](_0x4742f8(0x1cd)+(_0x38af5c+0x1)+'/'+_0x1158cd[_0x4742f8(0x1cf)][_0x4742f8(0x1cc)]+_0x4742f8(0x190)+a5_0xc31aa4[_0x4742f8(0x160)]('✗'));},'onEvaluationStart':()=>{const _0x587821=_0x42f179;_0x3d78e6[_0x587821(0x163)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5abd18=>{const _0x1d8b33=_0x42f179,_0x617cf2=formatElapsed(_0x5abd18);console[_0x1d8b33(0x184)]('\x20\x20Evaluating...\x20'+a5_0xc31aa4[_0x1d8b33(0x19d)]('✓')+'\x20('+_0x617cf2+')');}});_0x3d78e6['stop'](),_0x504ac3[_0x42f179(0x191)](_0x61d49b),_0x3b073f[_0x42f179(0x191)](_0x20710e);if(_0x61d49b[_0x42f179(0x183)]===_0x42f179(0x19e))console[_0x42f179(0x184)](a5_0xc31aa4['green'](_0x42f179(0x15d)+_0x61d49b[_0x42f179(0x16e)]));else _0x61d49b['status']===_0x42f179(0x1b2)?console[_0x42f179(0x184)](a5_0xc31aa4['red'](_0x42f179(0x1c9)+_0x61d49b[_0x42f179(0x16e)])):console[_0x42f179(0x184)](a5_0xc31aa4['red'](_0x42f179(0x1d5)+_0x61d49b['reason']));_0x61d49b[_0x42f179(0x15c)]&&console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)](_0x42f179(0x186)+_0x61d49b[_0x42f179(0x15c)])),console[_0x42f179(0x184)]();}catch(_0x22ffa3){_0x3d78e6[_0x42f179(0x1a2)]();const _0x9e7a2e=_0x22ffa3 instanceof Error?_0x22ffa3['message']:String(_0x22ffa3);console[_0x42f179(0x184)](a5_0xc31aa4['red'](_0x42f179(0x1d5)+_0x9e7a2e)),console[_0x42f179(0x184)](),_0x504ac3[_0x42f179(0x191)]({'name':_0x1158cd[_0x42f179(0x1c5)],'status':_0x42f179(0x1b9),'reason':_0x9e7a2e,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x14e7c1=Date['now']()-_0x577938,_0x442fc9=_0x504ac3[_0x42f179(0x1aa)](_0x4d68a4=>_0x4d68a4[_0x42f179(0x183)]===_0x42f179(0x19e))[_0x42f179(0x1cc)],_0x2286a3=_0x504ac3[_0x42f179(0x1aa)](_0x542307=>_0x542307[_0x42f179(0x183)]===_0x42f179(0x1b2))[_0x42f179(0x1cc)],_0x17e142=_0x504ac3[_0x42f179(0x1aa)](_0x42573b=>_0x42573b[_0x42f179(0x183)]===_0x42f179(0x1b9))['length'];console[_0x42f179(0x184)]('━'[_0x42f179(0x1b0)](0x3c)),console[_0x42f179(0x184)]('Test\x20Summary'),console['log']('━'[_0x42f179(0x1b0)](0x3c)),console[_0x42f179(0x184)](_0x42f179(0x171)+_0x504ac3[_0x42f179(0x1cc)]),console['log'](_0x42f179(0x19b)+a5_0xc31aa4[_0x42f179(0x19d)](_0x442fc9)),console[_0x42f179(0x184)]('Failed:\x20\x20\x20'+a5_0xc31aa4[_0x42f179(0x160)](_0x2286a3));_0x17e142>0x0&&console[_0x42f179(0x184)](_0x42f179(0x16b)+a5_0xc31aa4[_0x42f179(0x160)](_0x17e142));console[_0x42f179(0x184)](_0x42f179(0x1ad)+formatElapsed(_0x14e7c1)),console[_0x42f179(0x184)]('━'[_0x42f179(0x1b0)](0x3c));const _0x259927=_0x504ac3[_0x42f179(0x1aa)](_0x43b7e1=>_0x43b7e1[_0x42f179(0x183)]!=='PASS');if(_0x259927[_0x42f179(0x1cc)]>0x0){console['log'](),console[_0x42f179(0x184)]('Failed\x20Tests:');for(const _0x59e7f9 of _0x259927){const _0x563c28=a5_0xc31aa4[_0x42f179(0x160)]('✗'),_0x147129=_0x59e7f9[_0x42f179(0x16e)][_0x42f179(0x1cc)]>0x32?_0x59e7f9['reason']['substring'](0x0,0x32)+_0x42f179(0x180):_0x59e7f9[_0x42f179(0x16e)];console['log']('\x20\x20'+_0x563c28+'\x20'+_0x59e7f9[_0x42f179(0x1c5)]+':\x20'+_0x147129);}}const _0x4f3e7e={'summary':{'total':_0x504ac3[_0x42f179(0x1cc)],'passed':_0x442fc9,'failed':_0x2286a3,'errors':_0x17e142>0x0?_0x17e142:undefined,'duration_ms':_0x14e7c1},'tests':_0x504ac3,'agent':{'project':_0xc09493[_0x42f179(0x177)],'name':_0xc09493[_0x42f179(0x1d2)],'site':_0x5357f7},'timestamp':new Date(_0x577938)[_0x42f179(0x18d)]()};try{const _0x5b9c11=buildCachedTestRun(_0x3b073f,{'site':_0x5357f7,'projectId':_0x3e8e07,'projectName':_0xc09493[_0x42f179(0x177)],'agentId':_0x41b5cd,'agentName':_0xc09493[_0x42f179(0x1d2)],'testYmlPath':a5_0x5766ba[_0x42f179(0x1a4)](_0xc09493['testYmlPath'])});saveLastTestRun(_0x5b9c11);}catch{}if(_0x25cbcf!==_0x42f179(0x197)||_0x2ee67f){const _0x538c70=formatResults(_0x4f3e7e,_0x25cbcf);if(_0x2ee67f)try{a5_0x273097[_0x42f179(0x192)](_0x2ee67f,_0x538c70,_0x42f179(0x1dd)),console['log'](),console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)]('Output\x20written\x20to:\x20'+_0x2ee67f));}catch(_0x56d19f){return console[_0x42f179(0x184)](),console['log'](a5_0xc31aa4['red'](_0x42f179(0x158)+_0x56d19f)),0x1;}else console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x538c70);}return _0x259927[_0x42f179(0x1cc)]>0x0?0x1:0x0;}async['executeReeval'](_0x5b1015,_0x50f36f){const _0x22c2ff=a5_0x347955,{options:_0x4c08f7,tdx:_0x3ec7c5}=_0x5b1015,{definition:_0x592a72,agentInfo:_0x1b50c8,outputFormat:_0x5a6e08,outputFile:_0x54ca96}=_0x50f36f,_0x318832=_0x4c08f7[_0x22c2ff(0x1bd)],_0x31368e=loadLastTestRun();if(!_0x31368e)return console['log'](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x1a3))),console['log'](a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x153))),0x1;if(_0x31368e[_0x22c2ff(0x1c1)][_0x22c2ff(0x1d2)]!==_0x1b50c8['agentName'])return console['log'](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x17d)+_0x31368e[_0x22c2ff(0x1c1)]['agentName']+_0x22c2ff(0x187)+_0x1b50c8['agentName']+'\x22.')),console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x173))),0x1;const _0x2d776f=new Set(_0x31368e[_0x22c2ff(0x18b)][_0x22c2ff(0x188)](_0x790313=>_0x790313[_0x22c2ff(0x154)])),_0x3872a9=_0x592a72[_0x22c2ff(0x174)][_0x22c2ff(0x1aa)](_0x5c38e7=>!_0x2d776f['has'](_0x5c38e7[_0x22c2ff(0x1c5)]));if(_0x3872a9[_0x22c2ff(0x1cc)]>0x0&&_0x31368e['site']!==_0x318832)return console['log'](a5_0xc31aa4['red'](_0x22c2ff(0x1ca))),console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x1bc)+_0x31368e[_0x22c2ff(0x1bd)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x318832+'\x22.')),console[_0x22c2ff(0x184)](a5_0xc31aa4['dim'](_0x22c2ff(0x1db)+_0x31368e[_0x22c2ff(0x1bd)]+_0x22c2ff(0x1b1))),0x1;const _0xd7dab1=_0x592a72[_0x22c2ff(0x174)][_0x22c2ff(0x1aa)](_0x302018=>_0x2d776f[_0x22c2ff(0x1c4)](_0x302018[_0x22c2ff(0x1c5)])),_0x4b436a=_0x3872a9;let _0x4ca981;try{_0x4ca981=await setupEvaluatorAgent(_0x3ec7c5[_0x22c2ff(0x1b4)],_0x4c08f7[_0x22c2ff(0x1bf)]);}catch(_0x5b6c56){const _0x1242bb=_0x5b6c56 instanceof Error?_0x5b6c56[_0x22c2ff(0x164)]:String(_0x5b6c56);return console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x196)+_0x1242bb)),0x1;}console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x1e2)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x22c2ff(0x184)](_0x22c2ff(0x1e1)+a5_0xc31aa4[_0x22c2ff(0x16c)](_0x31368e[_0x22c2ff(0x1a1)])),console[_0x22c2ff(0x184)](_0x22c2ff(0x176)+a5_0xc31aa4[_0x22c2ff(0x16c)](_0x31368e['agent'][_0x22c2ff(0x177)]+'/'+_0x31368e['agent'][_0x22c2ff(0x1d2)]));_0x4b436a[_0x22c2ff(0x1cc)]>0x0&&console['log'](_0x22c2ff(0x1dc)+a5_0xc31aa4[_0x22c2ff(0x1ba)](_0x4b436a['length']));console['log']();const _0x554270=[],_0x1e18bd=Date[_0x22c2ff(0x1da)](),_0x4d2842=createCommandSpinner(_0x22c2ff(0x189));if(_0xd7dab1[_0x22c2ff(0x1cc)]>0x0)try{const _0x426837=await reevaluateFromCache(_0x3ec7c5[_0x22c2ff(0x1b4)],_0x31368e,{'tests':_0xd7dab1},{'evaluatorId':_0x4ca981,'onTestStart':(_0x626a59,_0x14b45f,_0x4cc6db)=>{const _0x353f8b=_0x22c2ff;_0x4d2842[_0x353f8b(0x163)]=_0x353f8b(0x175)+(_0x14b45f+0x1)+'/'+_0x4cc6db+':\x20'+_0x626a59+_0x353f8b(0x180);if(!_0x4d2842[_0x353f8b(0x162)])_0x4d2842[_0x353f8b(0x15b)]();},'onTestComplete':(_0x5a8acf,_0x390e8e)=>{const _0x287fab=_0x22c2ff;_0x4d2842['stop']();if(_0x390e8e[_0x287fab(0x183)]===_0x287fab(0x19e))console['log'](a5_0xc31aa4['green'](_0x287fab(0x15d)+_0x5a8acf)+a5_0xc31aa4[_0x287fab(0x16f)](_0x287fab(0x1d9)));else _0x390e8e[_0x287fab(0x183)]===_0x287fab(0x1b2)?console[_0x287fab(0x184)](a5_0xc31aa4['red'](_0x287fab(0x1c9)+_0x5a8acf+'\x20-\x20'+_0x390e8e[_0x287fab(0x16e)])+a5_0xc31aa4[_0x287fab(0x16f)](_0x287fab(0x1d9))):console[_0x287fab(0x184)](a5_0xc31aa4[_0x287fab(0x160)](_0x287fab(0x1d5)+_0x5a8acf+'\x20-\x20'+_0x390e8e[_0x287fab(0x16e)]));_0x390e8e['conversation_url']&&console[_0x287fab(0x184)](a5_0xc31aa4[_0x287fab(0x16f)]('\x20\x20Conversation:\x20'+_0x390e8e[_0x287fab(0x15c)])),_0x554270[_0x287fab(0x191)](_0x390e8e);},'onTestSkipped':(_0x1afe96,_0x28a66c)=>{const _0x18772d=_0x22c2ff;_0x4d2842[_0x18772d(0x1a2)](),console[_0x18772d(0x184)](a5_0xc31aa4[_0x18772d(0x1ba)](_0x18772d(0x1be)+_0x1afe96+_0x18772d(0x157)+_0x28a66c));}});for(const _0x177a81 of _0x426837){!_0x554270[_0x22c2ff(0x14d)](_0x27c6c9=>_0x27c6c9[_0x22c2ff(0x1c5)]===_0x177a81['name'])&&_0x554270['push'](_0x177a81);}}catch(_0x4ae9cc){_0x4d2842[_0x22c2ff(0x1a2)]();const _0x1c3caf=_0x4ae9cc instanceof Error?_0x4ae9cc['message']:String(_0x4ae9cc);return console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x1bb)+_0x1c3caf)),0x1;}_0x4d2842[_0x22c2ff(0x1a2)]();if(_0x4b436a['length']>0x0){console[_0x22c2ff(0x184)](),console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x1e2)](_0x22c2ff(0x150)));const {projectId:_0x5307e6,agentId:_0x3a690f}=_0x31368e[_0x22c2ff(0x1c1)];for(const _0x3299ac of _0x4b436a){console[_0x22c2ff(0x184)](_0x22c2ff(0x1c3)+a5_0xc31aa4[_0x22c2ff(0x16c)](_0x3299ac['name']));const _0x1ad398=createCommandSpinner(_0x22c2ff(0x14f)+_0x3299ac[_0x22c2ff(0x1cf)]['length']+':\x20Sending\x20user\x20input...');_0x1ad398[_0x22c2ff(0x15b)]();try{const {result:_0x3119c7}=await runTest(_0x3ec7c5[_0x22c2ff(0x1b4)],_0x3299ac,{'agentId':_0x3a690f,'projectId':_0x5307e6,'site':_0x31368e[_0x22c2ff(0x1bd)],'noEval':![],'evaluatorId':_0x4ca981,'onRoundStart':(_0x20c27d,_0x2b3a7c)=>{const _0x445e36=_0x22c2ff;_0x1ad398['text']=_0x445e36(0x178)+(_0x20c27d+0x1)+'/'+_0x2b3a7c+_0x445e36(0x1d7);},'onRoundComplete':(_0x2ec9c1,_0x5d887d,_0xe0b7c4)=>{const _0x5aff5f=_0x22c2ff,_0x12e8e4=formatElapsed(_0x5d887d);_0xe0b7c4?console[_0x5aff5f(0x184)](_0x5aff5f(0x1cd)+(_0x2ec9c1+0x1)+'/'+_0x3299ac[_0x5aff5f(0x1cf)][_0x5aff5f(0x1cc)]+_0x5aff5f(0x190)+a5_0xc31aa4['green']('✓')+'\x20('+_0x12e8e4+')'):console[_0x5aff5f(0x184)](_0x5aff5f(0x1cd)+(_0x2ec9c1+0x1)+'/'+_0x3299ac[_0x5aff5f(0x1cf)][_0x5aff5f(0x1cc)]+'...\x20'+a5_0xc31aa4[_0x5aff5f(0x160)]('✗'));},'onEvaluationStart':()=>{const _0x532833=_0x22c2ff;_0x1ad398[_0x532833(0x163)]=_0x532833(0x18a);},'onEvaluationComplete':_0x5ff2bd=>{const _0x358b7f=_0x22c2ff,_0x50c044=formatElapsed(_0x5ff2bd);console[_0x358b7f(0x184)](_0x358b7f(0x1b5)+a5_0xc31aa4[_0x358b7f(0x19d)]('✓')+'\x20('+_0x50c044+')');}});_0x1ad398[_0x22c2ff(0x1a2)](),_0x554270[_0x22c2ff(0x191)](_0x3119c7);if(_0x3119c7[_0x22c2ff(0x183)]==='PASS')console['log'](a5_0xc31aa4[_0x22c2ff(0x19d)]('✓\x20PASS:\x20'+_0x3119c7[_0x22c2ff(0x16e)])+a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x1ae)));else _0x3119c7[_0x22c2ff(0x183)]===_0x22c2ff(0x1b2)?console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)]('✗\x20FAIL:\x20'+_0x3119c7['reason'])+a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x1ae))):console['log'](a5_0xc31aa4['red'](_0x22c2ff(0x1d5)+_0x3119c7[_0x22c2ff(0x16e)]));_0x3119c7[_0x22c2ff(0x15c)]&&console[_0x22c2ff(0x184)](a5_0xc31aa4['dim'](_0x22c2ff(0x1a6)+_0x3119c7['conversation_url']));}catch(_0xee0785){_0x1ad398['stop']();const _0x5e3a7b=_0xee0785 instanceof Error?_0xee0785[_0x22c2ff(0x164)]:String(_0xee0785);console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x1d5)+_0x5e3a7b)),_0x554270['push']({'name':_0x3299ac[_0x22c2ff(0x1c5)],'status':_0x22c2ff(0x1b9),'reason':_0x5e3a7b,'timestamp':new Date()[_0x22c2ff(0x18d)](),'duration_ms':0x0});}}}console[_0x22c2ff(0x184)]();const _0x3d2ad0=Date['now']()-_0x1e18bd,_0x4e1769=_0x554270[_0x22c2ff(0x1aa)](_0x440d78=>_0x440d78[_0x22c2ff(0x183)]===_0x22c2ff(0x19e))[_0x22c2ff(0x1cc)],_0x1e5b61=_0x554270['filter'](_0x308bef=>_0x308bef[_0x22c2ff(0x183)]===_0x22c2ff(0x1b2))['length'],_0x3250f2=_0x554270[_0x22c2ff(0x1aa)](_0x39352d=>_0x39352d[_0x22c2ff(0x183)]===_0x22c2ff(0x1b9))['length'];console[_0x22c2ff(0x184)]('━'[_0x22c2ff(0x1b0)](0x3c)),console[_0x22c2ff(0x184)](_0x22c2ff(0x1c8)),console[_0x22c2ff(0x184)]('━'[_0x22c2ff(0x1b0)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x554270['length']),console[_0x22c2ff(0x184)](_0x22c2ff(0x19b)+a5_0xc31aa4[_0x22c2ff(0x19d)](_0x4e1769)),console[_0x22c2ff(0x184)](_0x22c2ff(0x1c2)+a5_0xc31aa4['red'](_0x1e5b61));_0x3250f2>0x0&&console[_0x22c2ff(0x184)](_0x22c2ff(0x16b)+a5_0xc31aa4['red'](_0x3250f2));console[_0x22c2ff(0x184)]('Duration:\x20'+formatElapsed(_0x3d2ad0)),console['log']('━'[_0x22c2ff(0x1b0)](0x3c));const _0x44c488={'summary':{'total':_0x554270['length'],'passed':_0x4e1769,'failed':_0x1e5b61,'errors':_0x3250f2>0x0?_0x3250f2:undefined,'duration_ms':_0x3d2ad0},'tests':_0x554270,'agent':{'project':_0x1b50c8[_0x22c2ff(0x177)],'name':_0x1b50c8[_0x22c2ff(0x1d2)],'site':_0x318832},'timestamp':new Date(_0x1e18bd)[_0x22c2ff(0x18d)]()};if(_0x5a6e08!==_0x22c2ff(0x197)||_0x54ca96){const _0x12906f=formatResults(_0x44c488,_0x5a6e08);if(_0x54ca96)try{a5_0x273097[_0x22c2ff(0x192)](_0x54ca96,_0x12906f,_0x22c2ff(0x1dd)),console[_0x22c2ff(0x184)](),console[_0x22c2ff(0x184)](a5_0xc31aa4['dim'](_0x22c2ff(0x1a8)+_0x54ca96));}catch(_0x313a67){return console[_0x22c2ff(0x184)](),console['log'](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x158)+_0x313a67)),0x1;}else console[_0x22c2ff(0x184)](),console[_0x22c2ff(0x184)](_0x12906f);}const _0x88b298=_0x554270[_0x22c2ff(0x1aa)](_0x347678=>_0x347678[_0x22c2ff(0x183)]!==_0x22c2ff(0x19e));return _0x88b298[_0x22c2ff(0x1cc)]>0x0?0x1:0x0;}}function a5_0x1272(){const _0x4df020=['no_local_folder','reason','dim','328855Avqtch','Total:\x20\x20\x20\x20','jsonl','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','tests','Re-evaluating\x20','Agent:\x20','projectName','Round\x20','No\x20tests\x20found\x20with\x20tags:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','\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','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','6330670WuikRd','Project\x20path:\x20','...','872451VIkBQZ','split','status','log','round','Conversation\x20URL:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','map','Re-evaluating...','Evaluating\x20response...','conversations','projectDir','toISOString','json','found','...\x20','push','writeFileSync','\x20\x20-\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','1876xysobO','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','table','27dypKma','tags','tsv','Passed:\x20\x20\x20','6554EmUnky','green','PASS','add','✗\x20ERROR:\x20Project\x20not\x20found:\x20','timestamp','stop','Error:\x20No\x20previous\x20test\x20run\x20found.','resolve','join','\x20\x20Conversation:\x20','includes','Output\x20written\x20to:\x20','Available\x20tags:\x20','filter','\x22:\x20','basename','Duration:\x20','\x20(new)','Test\x20Configuration:','repeat','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','FAIL','existsSync','llm','\x20\x20Evaluating...\x20','not\x20found','Usage:','reeval','ERROR','yellow','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','site','⚠\x20SKIPPED:\x20','verbose','execute','agent','Failed:\x20\x20\x20','Running:\x20','has','name','675904fsKbjd','test.yml','Re-evaluation\x20Summary','✗\x20FAIL:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agent:test','length','\x20\x20Round\x20','Available\x20tests:\x20','rounds','/<agent-name>','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','agentName','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','forEach','✗\x20ERROR:\x20','llmProject',':\x20Sending\x20user\x20input...','multiple_agents','\x20(cached)','now','Either\x20switch\x20to\x20the\x20\x22','New\x20tests\x20to\x20execute:\x20','utf-8','No\x20tests\x20have\x20tags\x20defined.','size','toLowerCase','Cached\x20run\x20from:\x20','cyan','Run\x20\x27tdx\x20agent\x20pull\x20','output','trim','find','eval','Round\x201/','Executing\x20new\x20tests...','agentDirs','\x20\x20Agent:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','testName','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Running\x20agent\x20tests...','\x20-\x20','Error\x20writing\x20output\x20file:\x20','dryRun','327FSsWMN','start','conversation_url','✓\x20PASS:\x20','executeReeval','2216656pZVEhR','red','some','isSpinning','text','message','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','source','7500HrEXXH','\x20\x20Project:\x20','Tests\x20found:\x20','Errors:\x20\x20\x20','white'];a5_0x1272=function(){return _0x4df020;};return a5_0x1272();}
|
|
1
|
+
function a5_0x2ec1(_0x590f35,_0x1867a1){_0x590f35=_0x590f35-0x1c8;const _0x2bf96d=a5_0x2bf9();let _0x2ec186=_0x2bf96d[_0x590f35];return _0x2ec186;}const a5_0x5166cf=a5_0x2ec1;(function(_0x323bf6,_0x2346c3){const _0xf6572f=a5_0x2ec1,_0x64b20d=_0x323bf6();while(!![]){try{const _0x546613=parseInt(_0xf6572f(0x22e))/0x1+parseInt(_0xf6572f(0x24c))/0x2*(parseInt(_0xf6572f(0x25e))/0x3)+-parseInt(_0xf6572f(0x206))/0x4+-parseInt(_0xf6572f(0x1f2))/0x5*(parseInt(_0xf6572f(0x237))/0x6)+parseInt(_0xf6572f(0x23d))/0x7+-parseInt(_0xf6572f(0x1e7))/0x8+-parseInt(_0xf6572f(0x20f))/0x9*(parseInt(_0xf6572f(0x259))/0xa);if(_0x546613===_0x2346c3)break;else _0x64b20d['push'](_0x64b20d['shift']());}catch(_0x36b3c3){_0x64b20d['push'](_0x64b20d['shift']());}}}(a5_0x2bf9,0x64b61));import*as a5_0x1ace68 from'node:fs';function a5_0x2bf9(){const _0x9c0a50=['dim','944672DzrPau','no_context','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20(cached)','...\x20','projectDir','split','FAIL','\x20\x20Conversation:\x20','repeat','Errors:\x20\x20\x20','Total:\x20\x20\x20\x20','has','282580ppjURc','verbose','add','\x20\x20Site:\x20','now','3SdBVRu','No\x20tests\x20have\x20tags\x20defined.','description','rounds','red','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Re-evaluating...','Re-evaluating\x20cached\x20test\x20run...','trim','writeFileSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20FAIL:\x20','executeReeval','push','llmProject','projectName','execute','\x20\x20Evaluating...\x20','tests','⚠\x20SKIPPED:\x20','llm','stop','testName','✗\x20ERROR:\x20Project\x20not\x20found:\x20','jsonl','existsSync','eval','log','round','site','Usage:','toISOString','1541880ZwVwKW','forEach','no_tests','Re-evaluation\x20Summary','Test\x20Summary','✓\x20PASS:\x20','table','\x20-\x20','size','Round\x201/','Passed:\x20\x20\x20','317570szCfdx','source','Error\x20writing\x20output\x20file:\x20','reason','Either\x20switch\x20to\x20the\x20\x22','basename','Re-evaluating\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Run\x20tests\x20for\x20an\x20LLM\x20agent','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20(new)','agent:test','filter','includes','cyan','\x20\x20Project:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Round\x20','output','Running:\x20','29928OfUzKw','\x22:\x20','json','tsv','\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','ERROR','Tests\x20found:\x20','\x20\x20-\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','153WaUEVh','\x27\x20to\x20create\x20the\x20folder\x20structure.','toLowerCase','Conversation\x20URL:\x20','find','Running\x20agent\x20tests...','✗\x20ERROR:\x20','Evaluating\x20response...','conversation_url','PASS','message','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','green','resolveProjectId','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agentDirs','map','Error:\x20No\x20previous\x20test\x20run\x20found.','reeval','start','found','agentName','Duration:\x20','timestamp','...','\x22,\x20but\x20current\x20site\x20is\x20\x22','length','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','status','utf-8','757152GjrqFd','dryRun','white','Output\x20written\x20to:\x20','resolve','Failed:\x20\x20\x20','Running\x20test:\x20','test.yml','Agent:\x20','24CYFlxD','substring','yellow','Test\x20',':\x20Sending\x20user\x20input...','name','823788VmjIGt','404','No\x20tests\x20found\x20with\x20tags:\x20','conversations','Failed\x20Tests:','Run\x20\x27tdx\x20agent\x20pull\x20','Available\x20tests:\x20','tags','agent','text','join','Test\x20Configuration:','Available\x20tags:\x20','resolveAgentId'];a5_0x2bf9=function(){return _0x9c0a50;};return a5_0x2bf9();}import*as a5_0x503231 from'node:path';import a5_0x572ef7 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5166cf(0x23c)]=a5_0x5166cf(0x1fd);[a5_0x5166cf(0x1c9)]=a5_0x5166cf(0x1fa);async[a5_0x5166cf(0x1d7)](_0x225a38){const _0x56d81e=a5_0x5166cf,{options:_0x1937be,args:_0xc50313,tdx:_0x30d74d}=_0x225a38,_0x2229b9=_0xc50313[0x0]||'.',_0x1e3668=_0x1937be[_0x56d81e(0x22f)],_0x53742f=_0x1937be,_0x45f30e=_0x53742f[_0x56d81e(0x1e1)]===![],_0x83b535=_0x53742f[_0x56d81e(0x221)],_0x3e2a9d=_0x53742f[_0x56d81e(0x23c)],_0x2a4dc1=_0x53742f['tags'],_0x37fa51=_0x1937be[_0x56d81e(0x1e4)],_0x359e31=_0x53742f[_0x56d81e(0x204)];if(_0x83b535&&_0x45f30e)return console['log'](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1cc))),0x1;let _0x157dfd=_0x56d81e(0x1ed);if(_0x53742f[_0x56d81e(0x208)])_0x157dfd='json';else{if(_0x53742f[_0x56d81e(0x1df)])_0x157dfd=_0x56d81e(0x1df);else{if(_0x53742f[_0x56d81e(0x209)])_0x157dfd=_0x56d81e(0x209);else{if(_0x53742f[_0x56d81e(0x1ed)])_0x157dfd=_0x56d81e(0x1ed);}}}const _0x2659dc=_0x53742f['llmProject'];let _0x5c0881=_0x2229b9;const _0x178545=a5_0x1ace68[_0x56d81e(0x1e0)](_0x2229b9),_0x23e853=_0x2229b9==='.';if(!_0x178545||_0x23e853){const _0x23c84b=resolveProjectFromContext(_0x2229b9,_0x2659dc,{'requireFile':_0x56d81e(0x235)});if(_0x23c84b[_0x56d81e(0x223)])_0x5c0881=_0x23c84b[_0x56d81e(0x251)],_0x23c84b[_0x56d81e(0x1f3)]==='context'&&console['log'](a5_0x572ef7['dim']('Using\x20agent:\x20'+_0x5c0881));else switch(_0x23c84b[_0x56d81e(0x1f5)]){case _0x56d81e(0x24d):console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x239)](_0x23c84b[_0x56d81e(0x219)])),console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](_0x56d81e(0x1e5)),console['log'](_0x56d81e(0x20a)),console[_0x56d81e(0x1e2)]('\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[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console['log'](a5_0x572ef7['yellow'](_0x23c84b[_0x56d81e(0x219)])),console['log'](),console[_0x56d81e(0x1e2)](_0x56d81e(0x242)+_0x23c84b['llmProject']+_0x56d81e(0x210));return 0x1;case'multiple_agents':{const _0x573d57=a5_0x503231[_0x56d81e(0x1f7)](_0x23c84b[_0x56d81e(0x251)]);console['log'](a5_0x572ef7['yellow'](_0x56d81e(0x1f9)+_0x23c84b[_0x56d81e(0x1d5)]+'\x22:'));for(const _0x1b1766 of _0x23c84b[_0x56d81e(0x21e)]){console[_0x56d81e(0x1e2)](_0x56d81e(0x20d)+_0x1b1766);}return console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x573d57+'/<agent-name>'),0x1;}case _0x56d81e(0x1e9):console[_0x56d81e(0x1e2)](a5_0x572ef7['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x23c84b[_0x56d81e(0x1d5)]+'\x22.')),console['log'](a5_0x572ef7[_0x56d81e(0x24b)]('Project\x20path:\x20'+_0x23c84b[_0x56d81e(0x251)])),console['log'](),console['log'](_0x56d81e(0x1d1));return 0x1;}}const {definition:_0x3bdb36,agentInfo:_0x317a57}=parseTestFile(_0x5c0881);let _0x4b68e2=_0x3bdb36[_0x56d81e(0x1d9)];if(_0x3e2a9d){const _0x2c7c5d=_0x3e2a9d[_0x56d81e(0x252)](',')['map'](_0x14f327=>_0x14f327[_0x56d81e(0x1cf)]());_0x4b68e2=_0x3bdb36[_0x56d81e(0x1d9)]['filter'](_0x5adfce=>_0x2c7c5d['includes'](_0x5adfce['name']));if(_0x4b68e2[_0x56d81e(0x229)]===0x0)return console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x239)]('No\x20tests\x20found\x20matching:\x20'+_0x3e2a9d)),console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x243)+_0x3bdb36[_0x56d81e(0x1d9)][_0x56d81e(0x21f)](_0xa3a273=>_0xa3a273['name'])[_0x56d81e(0x247)](',\x20'))),0x1;}if(_0x2a4dc1){const _0x56ae61=_0x2a4dc1[_0x56d81e(0x252)](',')[_0x56d81e(0x21f)](_0x432572=>_0x432572[_0x56d81e(0x1cf)]()[_0x56d81e(0x211)]());_0x4b68e2=_0x4b68e2[_0x56d81e(0x1fe)](_0x15882d=>_0x15882d['tags']?.['some'](_0x5b1c56=>_0x56ae61[_0x56d81e(0x1ff)](_0x5b1c56[_0x56d81e(0x211)]())));if(_0x4b68e2[_0x56d81e(0x229)]===0x0){console['log'](a5_0x572ef7['yellow'](_0x56d81e(0x23f)+_0x2a4dc1));const _0x3e29ac=new Set();return _0x3bdb36[_0x56d81e(0x1d9)]['forEach'](_0x4e8176=>_0x4e8176[_0x56d81e(0x244)]?.[_0x56d81e(0x1e8)](_0x2096ea=>_0x3e29ac[_0x56d81e(0x25b)](_0x2096ea))),_0x3e29ac[_0x56d81e(0x1ef)]>0x0?console['log'](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x249)+[..._0x3e29ac][_0x56d81e(0x247)](',\x20'))):console['log'](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x1c8))),0x1;}}if(_0x83b535)return this['executeReeval'](_0x225a38,{'definition':{'tests':_0x4b68e2},'agentInfo':_0x317a57,'outputFormat':_0x157dfd,'outputFile':_0x359e31,'testNames':_0x3e2a9d});if(_0x1e3668){console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x200)](_0x56d81e(0x248))),console[_0x56d81e(0x1e2)](_0x56d81e(0x25c)+a5_0x572ef7[_0x56d81e(0x230)](_0x37fa51)),console[_0x56d81e(0x1e2)](_0x56d81e(0x201)+a5_0x572ef7[_0x56d81e(0x230)](_0x317a57[_0x56d81e(0x1d6)])),console[_0x56d81e(0x1e2)]('\x20\x20Agent:\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x317a57[_0x56d81e(0x224)])),console['log'](),console[_0x56d81e(0x1e2)](_0x56d81e(0x20c)+a5_0x572ef7[_0x56d81e(0x230)](_0x4b68e2[_0x56d81e(0x229)]));for(let _0x525316=0x0;_0x525316<_0x4b68e2[_0x56d81e(0x229)];_0x525316++){const _0x15e133=_0x4b68e2[_0x525316],_0x477534=_0x15e133[_0x56d81e(0x1ca)]['length']===0x1?_0x56d81e(0x1e3):_0x56d81e(0x1ca),_0x1f9867=_0x15e133[_0x56d81e(0x244)]?.['length']?'\x20['+_0x15e133[_0x56d81e(0x244)][_0x56d81e(0x247)](',\x20')+']':'';console[_0x56d81e(0x1e2)]('\x20\x20'+(_0x525316+0x1)+'.\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x15e133[_0x56d81e(0x23c)])+'\x20('+_0x15e133[_0x56d81e(0x1ca)][_0x56d81e(0x229)]+'\x20'+_0x477534+')'+a5_0x572ef7['dim'](_0x1f9867));}return 0x0;}let _0x569fb4,_0x54c2c5;try{_0x569fb4=await _0x30d74d[_0x56d81e(0x1db)][_0x56d81e(0x21c)](_0x317a57['projectName']);}catch(_0x55c09e){const _0x267575=_0x55c09e instanceof Error?_0x55c09e[_0x56d81e(0x219)]:String(_0x55c09e);return _0x267575[_0x56d81e(0x1ff)](_0x56d81e(0x23e))||_0x267575[_0x56d81e(0x211)]()[_0x56d81e(0x1ff)]('not\x20found')?console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1de)+_0x317a57['projectName'])):console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x21a)+_0x317a57[_0x56d81e(0x1d6)]+_0x56d81e(0x207)+_0x267575)),0x1;}try{_0x54c2c5=await _0x30d74d[_0x56d81e(0x1db)][_0x56d81e(0x24a)](_0x317a57[_0x56d81e(0x224)],_0x569fb4);}catch(_0x2be61e){const _0x2de758=_0x2be61e instanceof Error?_0x2be61e['message']:String(_0x2be61e);return _0x2de758[_0x56d81e(0x1ff)]('404')||_0x2de758[_0x56d81e(0x211)]()['includes']('not\x20found')?console['log'](a5_0x572ef7['red'](_0x56d81e(0x20e)+_0x317a57[_0x56d81e(0x224)])):console['log'](a5_0x572ef7[_0x56d81e(0x1cb)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x317a57['agentName']+_0x56d81e(0x207)+_0x2de758)),0x1;}let _0x599f5b;if(!_0x45f30e)try{_0x599f5b=await setupEvaluatorAgent(_0x30d74d[_0x56d81e(0x1db)],_0x1937be[_0x56d81e(0x25a)]);}catch(_0x50dab9){const _0x339bf5=_0x50dab9 instanceof Error?_0x50dab9[_0x56d81e(0x219)]:String(_0x50dab9);return console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x22b)+_0x339bf5)),0x1;}console['log'](a5_0x572ef7[_0x56d81e(0x200)](_0x56d81e(0x214))),console[_0x56d81e(0x1e2)]('Site:\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x37fa51)),console['log']('Agent:\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x317a57['projectName']+'/'+_0x317a57[_0x56d81e(0x224)])),console[_0x56d81e(0x1e2)]();const _0x216035=[],_0x3d0c8e=[],_0x5dfa2f=Date[_0x56d81e(0x25d)]();for(let _0x1fb083=0x0;_0x1fb083<_0x4b68e2[_0x56d81e(0x229)];_0x1fb083++){const _0x563dbf=_0x4b68e2[_0x1fb083];_0x4b68e2[_0x56d81e(0x229)]>0x1?console[_0x56d81e(0x1e2)](_0x56d81e(0x23a)+(_0x1fb083+0x1)+'/'+_0x4b68e2['length']+':\x20'+a5_0x572ef7['white'](_0x563dbf[_0x56d81e(0x23c)])):console[_0x56d81e(0x1e2)](_0x56d81e(0x234)+a5_0x572ef7['white'](_0x563dbf[_0x56d81e(0x23c)]));const _0x2be5c0=createCommandSpinner(_0x56d81e(0x1f0)+_0x563dbf[_0x56d81e(0x1ca)][_0x56d81e(0x229)]+_0x56d81e(0x23b));_0x2be5c0['start']();try{const {result:_0x3dc2f2,conversation:_0x2b82d6}=await runTest(_0x30d74d[_0x56d81e(0x1db)],_0x563dbf,{'agentId':_0x54c2c5,'projectId':_0x569fb4,'site':_0x37fa51,'noEval':_0x45f30e,'evaluatorId':_0x599f5b,'onRoundStart':(_0xf708c,_0x30410c)=>{const _0x5ba669=_0x56d81e;_0x2be5c0[_0x5ba669(0x246)]='Round\x20'+(_0xf708c+0x1)+'/'+_0x30410c+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1d9e31,_0xfb55b5,_0x1a5526)=>{const _0x36c412=_0x56d81e,_0x1499f6=formatElapsed(_0xfb55b5);_0x1a5526?console[_0x36c412(0x1e2)](_0x36c412(0x203)+(_0x1d9e31+0x1)+'/'+_0x563dbf[_0x36c412(0x1ca)][_0x36c412(0x229)]+_0x36c412(0x250)+a5_0x572ef7[_0x36c412(0x21b)]('✓')+'\x20('+_0x1499f6+')'):console[_0x36c412(0x1e2)](_0x36c412(0x203)+(_0x1d9e31+0x1)+'/'+_0x563dbf['rounds']['length']+_0x36c412(0x250)+a5_0x572ef7[_0x36c412(0x1cb)]('✗'));},'onEvaluationStart':()=>{const _0x5d02f9=_0x56d81e;_0x2be5c0[_0x5d02f9(0x246)]=_0x5d02f9(0x216);},'onEvaluationComplete':_0x4ee199=>{const _0xea1cec=_0x56d81e,_0x26d88b=formatElapsed(_0x4ee199);console[_0xea1cec(0x1e2)](_0xea1cec(0x1d8)+a5_0x572ef7[_0xea1cec(0x21b)]('✓')+'\x20('+_0x26d88b+')');}});_0x2be5c0[_0x56d81e(0x1dc)](),_0x216035[_0x56d81e(0x1d4)](_0x3dc2f2),_0x3d0c8e[_0x56d81e(0x1d4)](_0x2b82d6);if(_0x3dc2f2[_0x56d81e(0x22c)]===_0x56d81e(0x218))console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x21b)](_0x56d81e(0x1ec)+_0x3dc2f2[_0x56d81e(0x1f5)]));else _0x3dc2f2[_0x56d81e(0x22c)]===_0x56d81e(0x253)?console['log'](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1d2)+_0x3dc2f2['reason'])):console['log'](a5_0x572ef7['red'](_0x56d81e(0x215)+_0x3dc2f2['reason']));_0x3dc2f2['conversation_url']&&console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x212)+_0x3dc2f2[_0x56d81e(0x217)])),console[_0x56d81e(0x1e2)]();}catch(_0x24d4fa){_0x2be5c0[_0x56d81e(0x1dc)]();const _0x537faf=_0x24d4fa instanceof Error?_0x24d4fa[_0x56d81e(0x219)]:String(_0x24d4fa);console[_0x56d81e(0x1e2)](a5_0x572ef7['red'](_0x56d81e(0x215)+_0x537faf)),console[_0x56d81e(0x1e2)](),_0x216035['push']({'name':_0x563dbf[_0x56d81e(0x23c)],'status':_0x56d81e(0x20b),'reason':_0x537faf,'timestamp':new Date()[_0x56d81e(0x1e6)](),'duration_ms':0x0});}}const _0x30d87f=Date[_0x56d81e(0x25d)]()-_0x5dfa2f,_0x29d53b=_0x216035['filter'](_0x5865a7=>_0x5865a7[_0x56d81e(0x22c)]===_0x56d81e(0x218))['length'],_0x325719=_0x216035[_0x56d81e(0x1fe)](_0x12ca0a=>_0x12ca0a[_0x56d81e(0x22c)]==='FAIL')[_0x56d81e(0x229)],_0x12b714=_0x216035['filter'](_0x104fbc=>_0x104fbc[_0x56d81e(0x22c)]===_0x56d81e(0x20b))['length'];console[_0x56d81e(0x1e2)]('━'['repeat'](0x3c)),console[_0x56d81e(0x1e2)](_0x56d81e(0x1eb)),console[_0x56d81e(0x1e2)]('━'[_0x56d81e(0x255)](0x3c)),console[_0x56d81e(0x1e2)](_0x56d81e(0x257)+_0x216035[_0x56d81e(0x229)]),console['log'](_0x56d81e(0x1f1)+a5_0x572ef7[_0x56d81e(0x21b)](_0x29d53b)),console[_0x56d81e(0x1e2)](_0x56d81e(0x233)+a5_0x572ef7[_0x56d81e(0x1cb)](_0x325719));_0x12b714>0x0&&console[_0x56d81e(0x1e2)](_0x56d81e(0x256)+a5_0x572ef7[_0x56d81e(0x1cb)](_0x12b714));console[_0x56d81e(0x1e2)](_0x56d81e(0x225)+formatElapsed(_0x30d87f)),console[_0x56d81e(0x1e2)]('━'[_0x56d81e(0x255)](0x3c));const _0x11400d=_0x216035['filter'](_0x1cad3e=>_0x1cad3e['status']!=='PASS');if(_0x11400d[_0x56d81e(0x229)]>0x0){console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](_0x56d81e(0x241));for(const _0x29ae05 of _0x11400d){const _0x1107ad=a5_0x572ef7['red']('✗'),_0x1b8a97=_0x29ae05[_0x56d81e(0x1f5)][_0x56d81e(0x229)]>0x32?_0x29ae05['reason'][_0x56d81e(0x238)](0x0,0x32)+_0x56d81e(0x227):_0x29ae05['reason'];console['log']('\x20\x20'+_0x1107ad+'\x20'+_0x29ae05[_0x56d81e(0x23c)]+':\x20'+_0x1b8a97);}}const _0x1962f9={'summary':{'total':_0x216035['length'],'passed':_0x29d53b,'failed':_0x325719,'errors':_0x12b714>0x0?_0x12b714:undefined,'duration_ms':_0x30d87f},'tests':_0x216035,'agent':{'project':_0x317a57[_0x56d81e(0x1d6)],'name':_0x317a57[_0x56d81e(0x224)],'site':_0x37fa51},'timestamp':new Date(_0x5dfa2f)[_0x56d81e(0x1e6)]()};try{const _0xa95689=buildCachedTestRun(_0x3d0c8e,{'site':_0x37fa51,'projectId':_0x569fb4,'projectName':_0x317a57['projectName'],'agentId':_0x54c2c5,'agentName':_0x317a57[_0x56d81e(0x224)],'testYmlPath':a5_0x503231[_0x56d81e(0x232)](_0x317a57['testYmlPath'])});saveLastTestRun(_0xa95689);}catch{}if(_0x157dfd!==_0x56d81e(0x1ed)||_0x359e31){const _0x692f7e=formatResults(_0x1962f9,_0x157dfd);if(_0x359e31)try{a5_0x1ace68['writeFileSync'](_0x359e31,_0x692f7e,_0x56d81e(0x22d)),console[_0x56d81e(0x1e2)](),console['log'](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x231)+_0x359e31));}catch(_0x40dfe1){return console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1f4)+_0x40dfe1)),0x1;}else console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](_0x692f7e);}return _0x11400d[_0x56d81e(0x229)]>0x0?0x1:0x0;}async[a5_0x5166cf(0x1d3)](_0x1d191a,_0xa9ca30){const _0x2e8248=a5_0x5166cf,{options:_0x3b26d9,tdx:_0x1ab9f7}=_0x1d191a,{definition:_0x108d19,agentInfo:_0x1d7157,outputFormat:_0x2c7122,outputFile:_0x1d50c3}=_0xa9ca30,_0x2ca14b=_0x3b26d9[_0x2e8248(0x1e4)],_0x3f6370=loadLastTestRun();if(!_0x3f6370)return console['log'](a5_0x572ef7['red'](_0x2e8248(0x220))),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x3f6370[_0x2e8248(0x245)][_0x2e8248(0x224)]!==_0x1d7157[_0x2e8248(0x224)])return console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x22a)+_0x3f6370[_0x2e8248(0x245)][_0x2e8248(0x224)]+_0x2e8248(0x24e)+_0x1d7157['agentName']+'\x22.')),console['log'](a5_0x572ef7['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x696bee=new Set(_0x3f6370[_0x2e8248(0x240)]['map'](_0x24d8b1=>_0x24d8b1[_0x2e8248(0x1dd)])),_0x219603=_0x108d19[_0x2e8248(0x1d9)][_0x2e8248(0x1fe)](_0x15b892=>!_0x696bee[_0x2e8248(0x258)](_0x15b892['name']));if(_0x219603[_0x2e8248(0x229)]>0x0&&_0x3f6370[_0x2e8248(0x1e4)]!==_0x2ca14b)return console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x21d))),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x1fb)+_0x3f6370[_0x2e8248(0x1e4)]+_0x2e8248(0x228)+_0x2ca14b+'\x22.')),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x1f6)+_0x3f6370[_0x2e8248(0x1e4)]+_0x2e8248(0x202))),0x1;const _0x56066b=_0x108d19['tests'][_0x2e8248(0x1fe)](_0x2065e7=>_0x696bee[_0x2e8248(0x258)](_0x2065e7['name'])),_0xe996b0=_0x219603;let _0x4b52df;try{_0x4b52df=await setupEvaluatorAgent(_0x1ab9f7[_0x2e8248(0x1db)],_0x3b26d9['verbose']);}catch(_0x7940a9){const _0x3ffa75=_0x7940a9 instanceof Error?_0x7940a9['message']:String(_0x7940a9);return console['log'](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x22b)+_0x3ffa75)),0x1;}console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x200)](_0x2e8248(0x1ce))),console[_0x2e8248(0x1e2)]('Cached\x20run\x20from:\x20'+a5_0x572ef7[_0x2e8248(0x230)](_0x3f6370[_0x2e8248(0x226)])),console[_0x2e8248(0x1e2)](_0x2e8248(0x236)+a5_0x572ef7[_0x2e8248(0x230)](_0x3f6370['agent']['projectName']+'/'+_0x3f6370['agent'][_0x2e8248(0x224)]));_0xe996b0[_0x2e8248(0x229)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x572ef7['yellow'](_0xe996b0[_0x2e8248(0x229)]));console[_0x2e8248(0x1e2)]();const _0x4e5d8c=[],_0x456659=Date[_0x2e8248(0x25d)](),_0x577013=createCommandSpinner(_0x2e8248(0x1cd));if(_0x56066b[_0x2e8248(0x229)]>0x0)try{const _0x339388=await reevaluateFromCache(_0x1ab9f7[_0x2e8248(0x1db)],_0x3f6370,{'tests':_0x56066b},{'evaluatorId':_0x4b52df,'onTestStart':(_0x57eb70,_0x2bd9a6,_0x439a26)=>{const _0x50c1d2=_0x2e8248;_0x577013[_0x50c1d2(0x246)]=_0x50c1d2(0x1f8)+(_0x2bd9a6+0x1)+'/'+_0x439a26+':\x20'+_0x57eb70+_0x50c1d2(0x227);if(!_0x577013['isSpinning'])_0x577013[_0x50c1d2(0x222)]();},'onTestComplete':(_0xf6ad0a,_0x30dfc6)=>{const _0x5c7426=_0x2e8248;_0x577013['stop']();if(_0x30dfc6[_0x5c7426(0x22c)]==='PASS')console[_0x5c7426(0x1e2)](a5_0x572ef7['green'](_0x5c7426(0x1ec)+_0xf6ad0a)+a5_0x572ef7[_0x5c7426(0x24b)](_0x5c7426(0x24f)));else _0x30dfc6['status']===_0x5c7426(0x253)?console[_0x5c7426(0x1e2)](a5_0x572ef7[_0x5c7426(0x1cb)](_0x5c7426(0x1d2)+_0xf6ad0a+'\x20-\x20'+_0x30dfc6[_0x5c7426(0x1f5)])+a5_0x572ef7[_0x5c7426(0x24b)](_0x5c7426(0x24f))):console[_0x5c7426(0x1e2)](a5_0x572ef7['red'](_0x5c7426(0x215)+_0xf6ad0a+_0x5c7426(0x1ee)+_0x30dfc6[_0x5c7426(0x1f5)]));_0x30dfc6['conversation_url']&&console[_0x5c7426(0x1e2)](a5_0x572ef7['dim']('\x20\x20Conversation:\x20'+_0x30dfc6[_0x5c7426(0x217)])),_0x4e5d8c[_0x5c7426(0x1d4)](_0x30dfc6);},'onTestSkipped':(_0x536bc6,_0x4dc83c)=>{const _0x1a712f=_0x2e8248;_0x577013[_0x1a712f(0x1dc)](),console[_0x1a712f(0x1e2)](a5_0x572ef7[_0x1a712f(0x239)](_0x1a712f(0x1da)+_0x536bc6+_0x1a712f(0x1ee)+_0x4dc83c));}});for(const _0x330866 of _0x339388){!_0x4e5d8c[_0x2e8248(0x213)](_0xa3e517=>_0xa3e517[_0x2e8248(0x23c)]===_0x330866[_0x2e8248(0x23c)])&&_0x4e5d8c[_0x2e8248(0x1d4)](_0x330866);}}catch(_0x21a553){_0x577013[_0x2e8248(0x1dc)]();const _0xf6cb41=_0x21a553 instanceof Error?_0x21a553[_0x2e8248(0x219)]:String(_0x21a553);return console[_0x2e8248(0x1e2)](a5_0x572ef7['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0xf6cb41)),0x1;}_0x577013[_0x2e8248(0x1dc)]();if(_0xe996b0[_0x2e8248(0x229)]>0x0){console[_0x2e8248(0x1e2)](),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x200)]('Executing\x20new\x20tests...'));const {projectId:_0x1323aa,agentId:_0x4c6604}=_0x3f6370[_0x2e8248(0x245)];for(const _0x2c7dd9 of _0xe996b0){console['log'](_0x2e8248(0x205)+a5_0x572ef7['white'](_0x2c7dd9[_0x2e8248(0x23c)]));const _0x54e52=createCommandSpinner(_0x2e8248(0x1f0)+_0x2c7dd9[_0x2e8248(0x1ca)][_0x2e8248(0x229)]+':\x20Sending\x20user\x20input...');_0x54e52[_0x2e8248(0x222)]();try{const {result:_0x1046cb}=await runTest(_0x1ab9f7[_0x2e8248(0x1db)],_0x2c7dd9,{'agentId':_0x4c6604,'projectId':_0x1323aa,'site':_0x3f6370[_0x2e8248(0x1e4)],'noEval':![],'evaluatorId':_0x4b52df,'onRoundStart':(_0x4d77b2,_0x1edee1)=>{const _0x8b9fb5=_0x2e8248;_0x54e52[_0x8b9fb5(0x246)]='Round\x20'+(_0x4d77b2+0x1)+'/'+_0x1edee1+_0x8b9fb5(0x23b);},'onRoundComplete':(_0x3d1eeb,_0x5197ed,_0x297956)=>{const _0x2d0280=_0x2e8248,_0x3eae14=formatElapsed(_0x5197ed);_0x297956?console['log']('\x20\x20Round\x20'+(_0x3d1eeb+0x1)+'/'+_0x2c7dd9[_0x2d0280(0x1ca)]['length']+'...\x20'+a5_0x572ef7[_0x2d0280(0x21b)]('✓')+'\x20('+_0x3eae14+')'):console[_0x2d0280(0x1e2)]('\x20\x20Round\x20'+(_0x3d1eeb+0x1)+'/'+_0x2c7dd9[_0x2d0280(0x1ca)][_0x2d0280(0x229)]+_0x2d0280(0x250)+a5_0x572ef7[_0x2d0280(0x1cb)]('✗'));},'onEvaluationStart':()=>{const _0x50ec27=_0x2e8248;_0x54e52[_0x50ec27(0x246)]=_0x50ec27(0x216);},'onEvaluationComplete':_0x808845=>{const _0x529564=_0x2e8248,_0x158f3b=formatElapsed(_0x808845);console[_0x529564(0x1e2)](_0x529564(0x1d8)+a5_0x572ef7[_0x529564(0x21b)]('✓')+'\x20('+_0x158f3b+')');}});_0x54e52[_0x2e8248(0x1dc)](),_0x4e5d8c[_0x2e8248(0x1d4)](_0x1046cb);if(_0x1046cb[_0x2e8248(0x22c)]===_0x2e8248(0x218))console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x21b)](_0x2e8248(0x1ec)+_0x1046cb[_0x2e8248(0x1f5)])+a5_0x572ef7['dim']('\x20(new)'));else _0x1046cb[_0x2e8248(0x22c)]==='FAIL'?console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x1d2)+_0x1046cb['reason'])+a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x1fc))):console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x215)+_0x1046cb[_0x2e8248(0x1f5)]));_0x1046cb[_0x2e8248(0x217)]&&console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x254)+_0x1046cb[_0x2e8248(0x217)]));}catch(_0x5cbfc5){_0x54e52[_0x2e8248(0x1dc)]();const _0x5d3a80=_0x5cbfc5 instanceof Error?_0x5cbfc5[_0x2e8248(0x219)]:String(_0x5cbfc5);console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x215)+_0x5d3a80)),_0x4e5d8c[_0x2e8248(0x1d4)]({'name':_0x2c7dd9[_0x2e8248(0x23c)],'status':'ERROR','reason':_0x5d3a80,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x2e8248(0x1e2)]();const _0x4e4aaf=Date['now']()-_0x456659,_0x191209=_0x4e5d8c[_0x2e8248(0x1fe)](_0x290a13=>_0x290a13['status']===_0x2e8248(0x218))[_0x2e8248(0x229)],_0x4af17a=_0x4e5d8c[_0x2e8248(0x1fe)](_0x4e4522=>_0x4e4522['status']===_0x2e8248(0x253))[_0x2e8248(0x229)],_0x366744=_0x4e5d8c['filter'](_0x543414=>_0x543414[_0x2e8248(0x22c)]===_0x2e8248(0x20b))[_0x2e8248(0x229)];console['log']('━'[_0x2e8248(0x255)](0x3c)),console[_0x2e8248(0x1e2)](_0x2e8248(0x1ea)),console['log']('━'[_0x2e8248(0x255)](0x3c)),console[_0x2e8248(0x1e2)]('Total:\x20\x20\x20\x20'+_0x4e5d8c[_0x2e8248(0x229)]),console['log']('Passed:\x20\x20\x20'+a5_0x572ef7[_0x2e8248(0x21b)](_0x191209)),console['log']('Failed:\x20\x20\x20'+a5_0x572ef7['red'](_0x4af17a));_0x366744>0x0&&console[_0x2e8248(0x1e2)](_0x2e8248(0x256)+a5_0x572ef7[_0x2e8248(0x1cb)](_0x366744));console[_0x2e8248(0x1e2)](_0x2e8248(0x225)+formatElapsed(_0x4e4aaf)),console[_0x2e8248(0x1e2)]('━'[_0x2e8248(0x255)](0x3c));const _0x3dad6c={'summary':{'total':_0x4e5d8c['length'],'passed':_0x191209,'failed':_0x4af17a,'errors':_0x366744>0x0?_0x366744:undefined,'duration_ms':_0x4e4aaf},'tests':_0x4e5d8c,'agent':{'project':_0x1d7157[_0x2e8248(0x1d6)],'name':_0x1d7157[_0x2e8248(0x224)],'site':_0x2ca14b},'timestamp':new Date(_0x456659)[_0x2e8248(0x1e6)]()};if(_0x2c7122!==_0x2e8248(0x1ed)||_0x1d50c3){const _0xbcff1c=formatResults(_0x3dad6c,_0x2c7122);if(_0x1d50c3)try{a5_0x1ace68[_0x2e8248(0x1d0)](_0x1d50c3,_0xbcff1c,'utf-8'),console['log'](),console['log'](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x231)+_0x1d50c3));}catch(_0x1f462c){return console['log'](),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x1f4)+_0x1f462c)),0x1;}else console[_0x2e8248(0x1e2)](),console[_0x2e8248(0x1e2)](_0xbcff1c);}const _0x50a309=_0x4e5d8c[_0x2e8248(0x1fe)](_0x3161f4=>_0x3161f4[_0x2e8248(0x22c)]!==_0x2e8248(0x218));return _0x50a309[_0x2e8248(0x229)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0xff9c24=a6_0x4144;function a6_0x4144(_0x4e6baf,_0x398b69){_0x4e6baf=_0x4e6baf-0x12a;const _0x5d3456=a6_0x5d34();let _0x414445=_0x5d3456[_0x4e6baf];return _0x414445;}(function(_0x2a2a18,_0x41aef8){const _0x118309=a6_0x4144,_0x13d3a9=_0x2a2a18();while(!![]){try{const _0x2cad58=-parseInt(_0x118309(0x16c))/0x1*(parseInt(_0x118309(0x155))/0x2)+parseInt(_0x118309(0x163))/0x3*(-parseInt(_0x118309(0x13c))/0x4)+-parseInt(_0x118309(0x14f))/0x5*(parseInt(_0x118309(0x168))/0x6)+parseInt(_0x118309(0x159))/0x7+parseInt(_0x118309(0x14d))/0x8+parseInt(_0x118309(0x15f))/0x9*(-parseInt(_0x118309(0x151))/0xa)+-parseInt(_0x118309(0x157))/0xb*(-parseInt(_0x118309(0x13b))/0xc);if(_0x2cad58===_0x41aef8)break;else _0x13d3a9['push'](_0x13d3a9['shift']());}catch(_0x58540d){_0x13d3a9['push'](_0x13d3a9['shift']());}}}(a6_0x5d34,0xaf1c5));import{BaseCommand}from'./command.js';function a6_0x5d34(){const _0x311824=['indexOf','883756QDlfUK','status','22BZOMai','trim','3222401GecgJS','isArray','method','toLowerCase','llm','error','9tqybwL','validate','Endpoint\x20must\x20start\x20with\x20/:\x20','\x22.\x20','8571lWRqxZ','name','output','site','data','48fZnsRl','Invalid\x20HTTP\x20method:\x20','color','file','1XIpsRF','proxy-authorization','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','x-trino-user','DELETE','llm-proxy','Error:\x20','Results\x20saved\x20to\x20','type','set-cookie2','message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','.\x20Valid\x20methods:\x20','GET','noColor','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','set-cookie','description','entries','9179904TCdwzX','428eSaBlH','verbose','POST','cookie','api','substring','has','includes','x-auth-token','header','Invalid\x20header\x20format:\x20\x22','length','join','<\x20HTTP/1.1\x20','Invalid\x20API\x20type:\x20','.\x20Valid\x20types:\x20','body','7143696irCOeI','x-xsrf-token','174175WbXEdh','log','11397790dnorXv','toUpperCase','stack'];a6_0x5d34=function(){return _0x311824;};return a6_0x5d34();}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0xff9c24(0x16d),a6_0xff9c24(0x13f),a6_0xff9c24(0x138),a6_0xff9c24(0x130),a6_0xff9c24(0x14e),a6_0xff9c24(0x144),a6_0xff9c24(0x12a)]);function isSensitiveHeader(_0x7b1282){const _0x9ef4d1=a6_0xff9c24;return SENSITIVE_HEADERS[_0x9ef4d1(0x142)](_0x7b1282[_0x9ef4d1(0x15c)]());}function parseHeader(_0x1510a4){const _0x476254=a6_0xff9c24,_0x1b48da=_0x1510a4[_0x476254(0x154)](':');if(_0x1b48da===-0x1)throw new Error(_0x476254(0x146)+_0x1510a4+_0x476254(0x162)+_0x476254(0x132));const _0x5071d6=_0x1510a4[_0x476254(0x141)](0x0,_0x1b48da)[_0x476254(0x158)](),_0x1e807a=_0x1510a4['substring'](_0x1b48da+0x1)[_0x476254(0x158)]();if(!_0x5071d6)throw new Error(_0x476254(0x137)+_0x1510a4+'\x22');return[_0x5071d6,_0x1e807a];}export class ApiCommand extends BaseCommand{[a6_0xff9c24(0x164)]='api';[a6_0xff9c24(0x139)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0xff9c24(0x160)](_0x9e8937){const _0x285a53=a6_0xff9c24,{args:_0x2f050c,options:_0x3fc720}=_0x9e8937,_0xbeffd6=_0x3fc720;if(_0x2f050c[_0x285a53(0x147)]===0x0)return _0x285a53(0x16e);const _0x380dcd=_0x2f050c[0x0];if(!_0x380dcd['startsWith']('/'))return _0x285a53(0x161)+_0x380dcd;const _0x12b2c2=_0xbeffd6[_0x285a53(0x167)],_0x2bf4da=_0xbeffd6[_0x285a53(0x16b)];if(_0x12b2c2&&_0x2bf4da)return _0x285a53(0x133);const _0xa4a26a=_0xbeffd6[_0x285a53(0x15b)]||_0x285a53(0x135),_0x3dfeef=['GET',_0x285a53(0x13e),'PUT',_0x285a53(0x12b),'PATCH'];if(!_0x3dfeef[_0x285a53(0x143)](_0xa4a26a[_0x285a53(0x152)]()))return _0x285a53(0x169)+_0xa4a26a+_0x285a53(0x134)+_0x3dfeef[_0x285a53(0x148)](',\x20');const _0x466257=_0xbeffd6[_0x285a53(0x12f)]||'td',_0x1db654=['td','cdp','workflow','trino',_0x285a53(0x15d),_0x285a53(0x12c)];if(!_0x1db654['includes'](_0x466257))return _0x285a53(0x14a)+_0x466257+_0x285a53(0x14b)+_0x1db654[_0x285a53(0x148)](',\x20');return undefined;}async['execute'](_0x5f5030){const _0x3fe5d7=a6_0xff9c24,{options:_0x2b77f7,args:_0x24a049,tdx:_0x53f0b7}=_0x5f5030,_0x146b94=_0x2b77f7,_0x336283=_0x24a049[0x0],_0x33a798=(_0x146b94[_0x3fe5d7(0x15b)]||_0x3fe5d7(0x135))[_0x3fe5d7(0x152)](),_0x302109=_0x146b94[_0x3fe5d7(0x167)],_0x4acf8b=_0x146b94['file'],_0x4f02c0=_0x146b94[_0x3fe5d7(0x145)],_0x301be5=_0x146b94[_0x3fe5d7(0x12f)]||'td';try{const _0x25ae32={};if(_0x4f02c0){const _0x502de8=Array[_0x3fe5d7(0x15a)](_0x4f02c0)?_0x4f02c0:[_0x4f02c0];for(const _0x322b64 of _0x502de8){const [_0x2c58fe,_0x51d960]=parseHeader(_0x322b64);_0x25ae32[_0x2c58fe]=_0x51d960;}}let _0x19ca23;if(_0x302109)_0x19ca23=_0x302109;else{if(_0x4acf8b)try{_0x19ca23=RawAPI['readBodyFromFile'](_0x4acf8b);}catch(_0x3f03e7){return console[_0x3fe5d7(0x15e)](_0x3fe5d7(0x12d)+(_0x3f03e7 instanceof Error?_0x3f03e7[_0x3fe5d7(0x131)]:String(_0x3f03e7))),0x1;}}const _0x2fb146={'method':_0x33a798,'apiType':_0x301be5,'includeHeaders':_0x2b77f7[_0x3fe5d7(0x13d)]};_0x19ca23&&(_0x2fb146[_0x3fe5d7(0x14c)]=_0x19ca23);Object['keys'](_0x25ae32)[_0x3fe5d7(0x147)]>0x0&&(_0x2fb146['headers']=_0x25ae32);if(_0x2b77f7[_0x3fe5d7(0x13d)]){const _0x3786a8=resolveSite(_0x2b77f7[_0x3fe5d7(0x166)]),_0x1018e1=getEndpoint(_0x3786a8,_0x301be5),_0x4e363e=''+_0x1018e1+_0x336283;console[_0x3fe5d7(0x15e)]('>\x20'+_0x33a798+'\x20'+_0x4e363e);const _0x5a33a8=getAuthHeaders(_0x3786a8),_0x20c005={..._0x5a33a8,..._0x25ae32};for(const [_0x7c01ee,_0x2cf712]of Object[_0x3fe5d7(0x13a)](_0x20c005)){!isSensitiveHeader(_0x7c01ee)&&console[_0x3fe5d7(0x15e)]('>\x20'+_0x7c01ee+':\x20'+_0x2cf712);}_0x19ca23&&console[_0x3fe5d7(0x15e)]('>'),console[_0x3fe5d7(0x15e)]('');}const _0x3f9414=await _0x53f0b7[_0x3fe5d7(0x140)]['request'](_0x336283,_0x2fb146);if(_0x2b77f7[_0x3fe5d7(0x13d)]&&_0x3f9414['headers']){console[_0x3fe5d7(0x15e)](_0x3fe5d7(0x149)+_0x3f9414[_0x3fe5d7(0x156)]);for(const [_0x577305,_0xfd31eb]of Object[_0x3fe5d7(0x13a)](_0x3f9414['headers'])){!isSensitiveHeader(_0x577305)&&console[_0x3fe5d7(0x15e)]('<\x20'+_0x577305+':\x20'+_0xfd31eb);}console[_0x3fe5d7(0x15e)]('');}const _0x5bc3d2=Boolean(_0x2b77f7[_0x3fe5d7(0x165)]),_0x2a68ed={'color':_0x2b77f7[_0x3fe5d7(0x16a)],'noColor':_0x2b77f7[_0x3fe5d7(0x136)]||_0x5bc3d2&&!_0x2b77f7[_0x3fe5d7(0x16a)]},_0x2c47a0=colorizeJSON(_0x3f9414[_0x3fe5d7(0x167)],_0x2a68ed);return _0x2b77f7['output']?(writeFileSync(_0x2b77f7[_0x3fe5d7(0x165)],_0x2c47a0),console['error'](_0x3fe5d7(0x12e)+_0x2b77f7[_0x3fe5d7(0x165)])):console[_0x3fe5d7(0x150)](_0x2c47a0),0x0;}catch(_0x5d3b1a){return _0x5d3b1a instanceof Error?(console[_0x3fe5d7(0x15e)](_0x3fe5d7(0x12d)+_0x5d3b1a[_0x3fe5d7(0x131)]),_0x2b77f7[_0x3fe5d7(0x13d)]&&_0x5d3b1a[_0x3fe5d7(0x153)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x5d3b1a[_0x3fe5d7(0x153)])):console[_0x3fe5d7(0x15e)]('Error:\x20'+String(_0x5d3b1a)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x4cc1d2=a7_0x3c4b;function a7_0x2a9a(){const _0x40746a=['✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','5643pJQgYP','You\x20can\x20find\x20your\x20API\x20key\x20at:','No\x20credentials\x20found\x20in\x20keychain','jobs','Choose\x20authentication\x20method:','trim','tdx:\x20auth\x20setup','User:\x20','5727246shBmGK','log','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20(site:\x20','profile','API\x20key','\x20(profile:\x20','API\x20Key','Setup\x20API\x20key\x20authentication\x20interactively','Validating\x20API\x20key...','✓\x20Authentication\x20successful\x0a','red','message','getUserInfo','\x20for\x20profile:\x20','/app/mp/ak','Enter\x20your\x20TD\x20API\x20key:','filter','3968soZDYd','yellow','Setup\x20cancelled','API\x20key\x20cannot\x20be\x20empty','site','warn','create','No\x20credential\x20found','Setting\x20up\x20authentication\x20for\x20site:\x20','password','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Read\x20credential\x20from\x20','auth:clear','Read\x20credential\x20from\x20keychain','268aAmUMW','Remove\x20API\x20key\x20from\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','9812400CkgfVM','\x20removed\x20from\x20keychain','error','✓\x20Profile\x20\x27','us01','execute','method','Name:\x20','oauth','tdx\x20profile:\x20','6794217ulNrar','✗\x20Validation\x20failed:\x20','8834VkESgq','apikey','Credential\x20type:\x20OAuth','bold','all','ERROR','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','last_name','tdx:\x20auth\x20clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','description','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','apiKey','status','auth','logLevel','\x27\x20registered','7674855pzSZCU','join','email','✓\x20Default\x20site\x20set\x20to\x20','\x0aSetup\x20cancelled','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','3489400pSupNQ','System\x20keychain\x20is\x20not\x20available','first_name','name'];a7_0x2a9a=function(){return _0x40746a;};return a7_0x2a9a();}(function(_0x4f1791,_0x40e6ab){const _0x10557e=a7_0x3c4b,_0x45cc1d=_0x4f1791();while(!![]){try{const _0x259113=parseInt(_0x10557e(0x1ab))/0x1*(parseInt(_0x10557e(0x19c))/0x2)+parseInt(_0x10557e(0x1c7))/0x3*(parseInt(_0x10557e(0x1e1))/0x4)+parseInt(_0x10557e(0x1bc))/0x5+-parseInt(_0x10557e(0x19f))/0x6+-parseInt(_0x10557e(0x1cf))/0x7+-parseInt(_0x10557e(0x1c2))/0x8+-parseInt(_0x10557e(0x1a9))/0x9;if(_0x259113===_0x40e6ab)break;else _0x45cc1d['push'](_0x45cc1d['shift']());}catch(_0x2661ed){_0x45cc1d['push'](_0x45cc1d['shift']());}}}(a7_0x2a9a,0xe57ed));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x3c4b(_0x46cd82,_0x3054aa){_0x46cd82=_0x46cd82-0x190;const _0x2a9a18=a7_0x2a9a();let _0x3c4b6d=_0x2a9a18[_0x46cd82];return _0x3c4b6d;}import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x2d8506 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_0x5c29a9 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4cc1d2(0x1c5)]='auth:setup';[a7_0x4cc1d2(0x1b5)]=a7_0x4cc1d2(0x1d7);async[a7_0x4cc1d2(0x1a4)](_0x491cda){const _0x5a63f3=a7_0x4cc1d2,{options:_0x46b22a}=_0x491cda,_0x17d39f=_0x46b22a[_0x5a63f3(0x1d3)];console[_0x5a63f3(0x1d0)](a7_0x5c29a9[_0x5a63f3(0x1ae)](_0x5a63f3(0x1cd)));const _0x3642d4=_0x46b22a[_0x5a63f3(0x192)]||_0x5a63f3(0x1a3),_0x35ded0=await promptSiteSelection(_0x3642d4,_0x17d39f,_0x5a63f3(0x190));if(!_0x35ded0)return 0x1;const _0xa74909=resolveSite(_0x35ded0);if(isOAuthSupported(_0xa74909)){const _0x9971ac=await a7_0x2d8506({'type':'select','name':_0x5a63f3(0x1a5),'message':_0x5a63f3(0x1cb),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0x5a63f3(0x1a7)},{'title':_0x5a63f3(0x1d6),'value':_0x5a63f3(0x1ac)}]});if(!_0x9971ac[_0x5a63f3(0x1a5)])return console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1c0)),0x1;if(_0x9971ac[_0x5a63f3(0x1a5)]===_0x5a63f3(0x1a7))return await runOAuthLoginFlow(_0xa74909,_0x17d39f,_0x46b22a[_0x5a63f3(0x1ba)]??LogLevel[_0x5a63f3(0x1b0)]),0x0;}console['log'](_0x5a63f3(0x196)+_0xa74909),console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1c8)),console[_0x5a63f3(0x1d0)]('\x20\x20'+getConsoleUrl(_0xa74909,_0x5a63f3(0x1de)));const _0x2fe1b8=await a7_0x2d8506({'type':_0x5a63f3(0x197),'name':_0x5a63f3(0x1b7),'message':_0x5a63f3(0x1df),'validate':_0x71841b=>{const _0x57fa7e=_0x5a63f3;if(!_0x71841b||!_0x71841b[_0x57fa7e(0x1cc)]())return _0x57fa7e(0x191);return!![];}});if(!_0x2fe1b8[_0x5a63f3(0x1b7)])return console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1c0)),0x1;const _0x462b67=_0x2fe1b8['apiKey'];console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1d8));try{const _0x5cad58=TDX[_0x5a63f3(0x194)]({'site':_0xa74909,'apiKey':_0x462b67['trim'](),'logLevel':_0x46b22a[_0x5a63f3(0x1ba)]??LogLevel[_0x5a63f3(0x1b0)]}),_0x5c1863=await _0x5cad58[_0x5a63f3(0x1ca)][_0x5a63f3(0x1dc)]();console['log'](_0x5a63f3(0x1b1)+_0x5c1863[_0x5a63f3(0x1be)]+')');const _0x3af178=await isKeychainAvailable();_0x3af178?(await saveAPIKeyAsync(_0x462b67[_0x5a63f3(0x1cc)](),_0xa74909,_0x17d39f),console['log'](_0x5a63f3(0x1c6)+(_0x17d39f?_0x5a63f3(0x1d5)+_0x17d39f+')':''))):(console[_0x5a63f3(0x193)](a7_0x5c29a9[_0x5a63f3(0x1e2)](_0x5a63f3(0x19e))),console[_0x5a63f3(0x193)](a7_0x5c29a9[_0x5a63f3(0x1e2)](_0x5a63f3(0x1c1))));if(_0x17d39f){const _0x37ac95={'site':_0xa74909};saveProfileToUserConfig(_0x17d39f,_0x37ac95),console['log'](_0x5a63f3(0x1a2)+_0x17d39f+_0x5a63f3(0x1bb));}else saveDefaultSiteToUserConfig(_0xa74909),console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1bf)+_0xa74909);const _0x221a00=_0x17d39f?'\x20--profile\x20'+_0x17d39f:'';return console[_0x5a63f3(0x1d0)](),console[_0x5a63f3(0x1d0)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x5a63f3(0x1d0)]('\x20\x20tdx'+_0x221a00+_0x5a63f3(0x1d1)),console['log']('\x20\x20tdx'+_0x221a00+_0x5a63f3(0x1b6)),0x0;}catch(_0x1f554){if(_0x1f554 instanceof HTTPClientError&&_0x1f554[_0x5a63f3(0x1b8)]===0x191)return printAuthError(_0x1f554),0x1;return console[_0x5a63f3(0x1a1)](a7_0x5c29a9[_0x5a63f3(0x1da)](_0x5a63f3(0x1aa)+(_0x1f554 instanceof Error?_0x1f554[_0x5a63f3(0x1db)]:String(_0x1f554)))),console['error'](_0x5a63f3(0x198)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4cc1d2(0x1b9);[a7_0x4cc1d2(0x1b5)]=a7_0x4cc1d2(0x1b4);async[a7_0x4cc1d2(0x1a4)](_0x42ff11){const _0x424436=a7_0x4cc1d2,{options:_0x550b75,tdx:_0x3e572d}=_0x42ff11,_0x13527b=_0x550b75[_0x424436(0x192)],_0x1c67b0=_0x550b75[_0x424436(0x1d3)],_0x1173ec=_0x1c67b0?_0x1c67b0:'N/A';console[_0x424436(0x1d0)](_0x424436(0x1a8)+_0x1173ec+_0x424436(0x1d2)+_0x13527b+')');const _0x3e79c0=await getOAuthTokens(_0x1c67b0);if(_0x3e79c0)console[_0x424436(0x1d0)](_0x424436(0x1ad)),console[_0x424436(0x1d0)](_0x424436(0x19b)+(_0x1c67b0?_0x424436(0x1d5)+_0x1c67b0+')':''));else{const _0xe18ab9=await resolveAPIKeyAsync(_0x13527b,_0x1c67b0);if(_0xe18ab9){const {source:_0x1a34c4,isDeprecated:_0x43b45a}=_0xe18ab9,_0x40c929=_0x424436(0x199)+_0x1a34c4;console[_0x424436(0x1d0)](_0x43b45a?a7_0x5c29a9['yellow'](_0x40c929):_0x40c929);}else console[_0x424436(0x1d0)](a7_0x5c29a9[_0x424436(0x1e2)](_0x424436(0x195)));}try{const _0x11e73f=await _0x3e572d['jobs']['getUserInfo']();return console[_0x424436(0x1d0)](a7_0x5c29a9['green'](_0x424436(0x1d9))),console[_0x424436(0x1d0)](_0x424436(0x1ce)+_0x11e73f[_0x424436(0x1be)]),(_0x11e73f['first_name']||_0x11e73f[_0x424436(0x1b2)])&&console[_0x424436(0x1d0)](_0x424436(0x1a6)+[_0x11e73f[_0x424436(0x1c4)],_0x11e73f[_0x424436(0x1b2)]][_0x424436(0x1e0)](Boolean)[_0x424436(0x1bd)]('\x20')),0x0;}catch(_0x1d41d0){return _0x1d41d0 instanceof HTTPClientError&&_0x1d41d0['status']===0x191?printAuthError(_0x1d41d0,!![],_0x1c67b0):console[_0x424436(0x1a1)](a7_0x5c29a9[_0x424436(0x1da)](_0x424436(0x1aa)+(_0x1d41d0 instanceof Error?_0x1d41d0['message']:String(_0x1d41d0)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4cc1d2(0x1c5)]=a7_0x4cc1d2(0x19a);[a7_0x4cc1d2(0x1b5)]=a7_0x4cc1d2(0x19d);async[a7_0x4cc1d2(0x1a4)](_0x1db271){const _0x524b75=a7_0x4cc1d2,{options:_0x1383f9}=_0x1db271,_0x46cc2e=_0x1383f9['profile'];console['log'](a7_0x5c29a9[_0x524b75(0x1ae)](_0x524b75(0x1b3)));const _0x3c9290=await isKeychainAvailable();if(!_0x3c9290)return console[_0x524b75(0x1a1)](a7_0x5c29a9[_0x524b75(0x1da)](_0x524b75(0x1c3))),0x1;const [_0x385afa,_0x42fecd]=await Promise[_0x524b75(0x1af)]([deleteKeychainAPIKey(_0x46cc2e),deleteOAuthTokens(_0x46cc2e)]);if(_0x385afa||_0x42fecd){clearCredentialCache();const _0x16b114=[_0x385afa&&_0x524b75(0x1d4),_0x42fecd&&'OAuth\x20tokens'][_0x524b75(0x1e0)](Boolean)['join']('\x20and\x20');return console['log']('✓\x20'+_0x16b114+_0x524b75(0x1a0)+(_0x46cc2e?_0x524b75(0x1d5)+_0x46cc2e+')':'')),0x0;}else return console['log'](_0x524b75(0x1c9)+(_0x46cc2e?_0x524b75(0x1dd)+_0x46cc2e:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-command.js","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IACtC,IAAI,GAAG,YAAY,CAAC;IACpB,WAAW,GAAG,4CAA4C,CAAC;IAEpE,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,OAA6B,CAAC;QAEtD,8BAA8B;QAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAE3C,sBAAsB;QACtB,MAAM,WAAW,GAAI,OAAO,CAAC,IAAe,IAAI,MAAM,CAAC;QACvD,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAChF,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC;QAEpB,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAEvC,
|
|
1
|
+
{"version":3,"file":"auth-command.js","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"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"}
|