@treasuredata/tdx 2026.3.40 → 2026.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +3 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/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/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a3_0x69f7(){const _0xec5068=['2042942PgoSaS','verbose','Error:\x20Segment\x20name\x20is\x20required','activations','10xBRbCr','53920oBcebP','resolveParentId','cause','2325952wCWQwf','error','2049488bpcVfR','execute','Resolving\x20parent\x20segment\x20\x27','Listing\x20activations\x20for\x20segment\x20\x27','segment','\x20\x20Cause:\x20','data','site','31626GmBsrp','description','Resolved\x20parent\x20ID:\x20','Parent\x20name:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x20activation','List\x20activations\x20for\x20a\x20segment','1773555YWMqtu','\x27...','3aILXCz','Resolved\x20child\x20ID:\x20','Error:\x20','18KCgNWd','110630SEwYIC','listActivations','Site:\x20','message','102leutuy','length','resolveSegmentId'];a3_0x69f7=function(){return _0xec5068;};return a3_0x69f7();}const a3_0x1a6cfe=a3_0x5b6b;(function(_0x3068ec,_0x58813a){const _0x80e296=a3_0x5b6b,_0x88d5b4=_0x3068ec();while(!![]){try{const _0x171d94=parseInt(_0x80e296(0x1e6))/0x1*(parseInt(_0x80e296(0x203))/0x2)+-parseInt(_0x80e296(0x1e4))/0x3+parseInt(_0x80e296(0x1f6))/0x4+parseInt(_0x80e296(0x1ea))/0x5*(parseInt(_0x80e296(0x1ee))/0x6)+-parseInt(_0x80e296(0x1fb))/0x7+-parseInt(_0x80e296(0x1f9))/0x8*(-parseInt(_0x80e296(0x1e9))/0x9)+parseInt(_0x80e296(0x1f5))/0xa*(parseInt(_0x80e296(0x1f1))/0xb);if(_0x171d94===_0x58813a)break;else _0x88d5b4['push'](_0x88d5b4['shift']());}catch(_0x25c8f9){_0x88d5b4['push'](_0x88d5b4['shift']());}}}(a3_0x69f7,0x4e32e));import{BaseCommand}from'./command.js';function a3_0x5b6b(_0x2e830d,_0x55c675){_0x2e830d=_0x2e830d-0x1e2;const _0x69f7b6=a3_0x69f7();let _0x5b6b39=_0x69f7b6[_0x2e830d];return _0x5b6b39;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x1a6cfe(0x1f4);[a3_0x1a6cfe(0x204)]=a3_0x1a6cfe(0x1e3);async[a3_0x1a6cfe(0x1fc)](_0x1eee85){const _0x37977b=a3_0x1a6cfe,{options:_0x3178bc,args:_0x198c60,tdx:_0x1488ac}=_0x1eee85;if(_0x198c60[_0x37977b(0x1ef)]===0x0)return console[_0x37977b(0x1fa)](_0x37977b(0x1f3)),console[_0x37977b(0x1fa)](_0x37977b(0x208)),0x1;try{const {parentId:_0x3ada9f,childId:_0x171be8}=parseSegmentRef(_0x198c60[0x0]);if(!_0x171be8)return console[_0x37977b(0x1fa)](_0x37977b(0x207)),console[_0x37977b(0x1fa)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x3178bc['verbose']&&(console['error'](_0x37977b(0x1ec)+_0x3178bc[_0x37977b(0x202)]),console['error'](_0x37977b(0x206)+_0x3ada9f),console[_0x37977b(0x1fa)]('Child\x20name:\x20'+_0x171be8));const _0x39cd87=await withSpinner(_0x37977b(0x1fd)+_0x3ada9f+_0x37977b(0x1e5),()=>_0x1488ac['segment'][_0x37977b(0x1f7)](_0x3ada9f),{'verbose':_0x3178bc[_0x37977b(0x1f2)]}),_0x1c781e=_0x39cd87[_0x37977b(0x201)];_0x3178bc[_0x37977b(0x1f2)]&&console[_0x37977b(0x1fa)](_0x37977b(0x205)+_0x1c781e);const _0xf83dd1=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x171be8+_0x37977b(0x1e5),()=>_0x1488ac['segment'][_0x37977b(0x1f0)](_0x1c781e,_0x171be8),{'verbose':_0x3178bc[_0x37977b(0x1f2)]}),_0x43a072=_0xf83dd1[_0x37977b(0x201)];_0x3178bc[_0x37977b(0x1f2)]&&console['error'](_0x37977b(0x1e7)+_0x43a072);const _0x64cb68=await withSpinner(_0x37977b(0x1fe)+_0x171be8+_0x37977b(0x1e5),()=>_0x1488ac[_0x37977b(0x1ff)][_0x37977b(0x1eb)](_0x1c781e,_0x43a072),{'verbose':_0x3178bc[_0x37977b(0x1f2)]}),_0x2f1b38=_0x64cb68[_0x37977b(0x201)];return console['error']('✔\x20Found\x20'+_0x2f1b38[_0x37977b(0x1ef)]+_0x37977b(0x1e2)+(_0x2f1b38['length']!==0x1?'s':'')),await handleSDKOutput(_0x2f1b38,_0x3178bc),0x0;}catch(_0x43e323){if(_0x43e323 instanceof SDKError)return console[_0x37977b(0x1fa)](_0x37977b(0x1e8)+_0x43e323[_0x37977b(0x1ed)]),_0x43e323[_0x37977b(0x1f8)]&&console[_0x37977b(0x1fa)](_0x37977b(0x200)+_0x43e323[_0x37977b(0x1f8)]),0x1;throw _0x43e323;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0xdddc94=a4_0x1c1f;(function(_0x32fa1d,_0x3ba4d7){const _0x2b8cff=a4_0x1c1f,_0x438672=_0x32fa1d();while(!![]){try{const _0x108850=-parseInt(_0x2b8cff(0x244))/0x1+-parseInt(_0x2b8cff(0x1ce))/0x2*(-parseInt(_0x2b8cff(0x23a))/0x3)+-parseInt(_0x2b8cff(0x1ba))/0x4*(parseInt(_0x2b8cff(0x1c7))/0x5)+-parseInt(_0x2b8cff(0x1f8))/0x6*(parseInt(_0x2b8cff(0x251))/0x7)+parseInt(_0x2b8cff(0x1f5))/0x8*(-parseInt(_0x2b8cff(0x24d))/0x9)+parseInt(_0x2b8cff(0x1eb))/0xa*(-parseInt(_0x2b8cff(0x1b8))/0xb)+parseInt(_0x2b8cff(0x237))/0xc*(parseInt(_0x2b8cff(0x1c1))/0xd);if(_0x108850===_0x3ba4d7)break;else _0x438672['push'](_0x438672['shift']());}catch(_0x179ad0){_0x438672['push'](_0x438672['shift']());}}}(a4_0x1929,0xc797d));import a4_0x6bacc from'chalk';import a4_0x5584d4 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x1929(){const _0x4dd992=['Project\x20cloned\x20successfully','output','49LMcuPR','Using\x20context\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Artifact\x20\x22','\x22:\x20','\x0aErrors\x20found:','yes','projectName','experimentalKnowledgeBases','Using\x20project:\x20','\x20\x20Agent\x20\x22','site','\x20\x20Knowledge\x20Base\x20\x22','Using\x20current\x20project:\x20','\x0aProject\x20pushed\x20with\x20errors','pullProject','projectId','Would\x20push\x20agent:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Failed\x20to\x20push\x20agent:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','dim','dirname','\x20=\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','parse','\x20total','agent:push','prompts','\x0aPull\x20summary\x20for\x20\x27','14486714zExunz','red','1316MTnpof','\x20\x20Integration\x20\x22','description','name','\x20|\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','join','5525MJVrrL','agent:pull','\x20\x20Knowledge\x20Bases:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','execute','\x20--name\x20','15085oUIcqL','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','outputDir','\x20successfully','updated','yellow','push','2522024mZHEMu','reason','\x20new','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\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)','arg-dir','experimentalArtifacts','utf-8','gray','green','counts','Pulling\x20agent\x20\x22','integrations','\x20files?','repeat','Agent:\x20','created','Cancelled','profile','MISSING_ARGUMENT','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','knowledgeBases','\x20files\x20to\x20','error','force','Errors:','pullAgent','new','10ILEDWL','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Prompt\x20\x22','cyan','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','newProjectId','agentName','-\x20no\x20files\x20written','\x20\x20Text\x20Knowledge\x20Bases:\x20','\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','296RBuYze','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','235890iZpEKC','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','errors','\x22\x20to\x20\x22','Output\x20path:\x20','\x0a✔\x20Pushed\x20','cwd','-\x20nothing\x20pushed','\x0aChanges:','unchanged','\x20\x20Source:\x20','\x0aPush\x20','sourceProjectName','projectDir','Agent\x20','✔\x20Context\x20set:\x20','\x20resources\x20to\x20\x27','Would\x20clone:','\x20\x20Target:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','message','action','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)','INVALID_ARGUMENT','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','found','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','context','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20changed','log','cloneProject','\x0aChanges\x20to\x20prompt\x20\x27','Agent\x20pulled\x20successfully','No\x20tdx.json\x20found\x20in\x20','outputPath','dryRun','New\x20project:\x20','\x20\x20Integrations:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aError:','\x20unchanged','\x20\x20Text\x20Knowledge\x20Base\x20\x22','New\x20project\x20name\x20is\x20required','Status:\x20','\x0aChanges\x20to\x20agent\x20\x27','llm','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','no_local_folder','\x22\x20from\x20project\x20\x22','agent.yml','diff','pushProject','\x20created','agentId','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','81912ZMjrwe','hasChanges','agents','3uLZOIg','textKnowledgeBases','Using\x20local\x20project:\x20','tdx.json','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Output:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20Pulled\x20','llm_project','Pushing\x20agent\x20from\x20\x22','360009VQXUPn','\x22...','Source:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','total','llmProject','\x20resources?','Writing\x20files...','Analyzing\x20project\x20\x22','97236NJlDNF','\x22\x20to\x20new\x20project\x20\x22'];a4_0x1929=function(){return _0x4dd992;};return a4_0x1929();}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(_0x28cd43){const _0x5189b9=a4_0x1c1f,_0x1e19b1=[];if(_0x28cd43[_0x5189b9(0x248)]!==undefined)_0x1e19b1[_0x5189b9(0x1cd)](_0x28cd43['total']+_0x5189b9(0x26b));if(_0x28cd43[_0x5189b9(0x1ea)]!==undefined&&_0x28cd43['new']>0x0)_0x1e19b1['push'](a4_0x6bacc[_0x5189b9(0x1d7)](_0x28cd43['new']+_0x5189b9(0x1d0)));if(_0x28cd43[_0x5189b9(0x1de)]!==undefined&&_0x28cd43[_0x5189b9(0x1de)]>0x0)_0x1e19b1[_0x5189b9(0x1cd)](a4_0x6bacc[_0x5189b9(0x1d7)](_0x28cd43['created']+_0x5189b9(0x232)));if(_0x28cd43['updated']!==undefined&&_0x28cd43[_0x5189b9(0x1cb)]>0x0)_0x1e19b1[_0x5189b9(0x1cd)](a4_0x6bacc['yellow'](_0x28cd43[_0x5189b9(0x1cb)]+'\x20updated'));if(_0x28cd43['unchanged']!==undefined&&_0x28cd43[_0x5189b9(0x202)]>0x0)_0x1e19b1[_0x5189b9(0x1cd)](a4_0x6bacc[_0x5189b9(0x1d6)](_0x28cd43['unchanged']+_0x5189b9(0x226)));if(_0x28cd43[_0x5189b9(0x1fb)]!==undefined&&_0x28cd43[_0x5189b9(0x1fb)]>0x0)_0x1e19b1['push'](a4_0x6bacc[_0x5189b9(0x1b9)](_0x28cd43[_0x5189b9(0x1fb)]+'\x20errors'));return _0x1e19b1[_0x5189b9(0x1c0)](',\x20');}function displayDiffs(_0x3cb820,_0x476105,_0x1451ff,_0x53e2bf,_0x47d790,_0x3e8629,_0x35fdf4){const _0x1ebc0b=a4_0x1c1f;for(const _0x408604 of _0x3cb820){if(_0x408604[_0x1ebc0b(0x230)]){const _0x159941=_0x408604['agentName']||_0x408604[_0x1ebc0b(0x1bd)];console['log'](_0x1ebc0b(0x22a)+_0x159941+'\x27:'),console[_0x1ebc0b(0x21b)]('─'['repeat'](0x3c)),console[_0x1ebc0b(0x21b)](_0x408604[_0x1ebc0b(0x230)]),console['log']('─'[_0x1ebc0b(0x1dc)](0x3c));}}for(const _0x3ae780 of _0x476105){_0x3ae780[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)](_0x1ebc0b(0x219)+_0x3ae780[_0x1ebc0b(0x1bd)]+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x3ae780['diff']),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x59c651 of _0x1451ff){_0x59c651[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x59c651[_0x1ebc0b(0x1bd)]+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x59c651[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'['repeat'](0x3c)));}for(const _0x21232b of _0x53e2bf){_0x21232b[_0x1ebc0b(0x230)]&&(console['log'](_0x1ebc0b(0x21d)+_0x21232b['name']+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x21232b[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x434374 of _0x47d790){_0x434374[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x434374[_0x1ebc0b(0x1bd)]+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x434374[_0x1ebc0b(0x230)]),console['log']('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x190e2c of _0x3e8629){_0x190e2c[_0x1ebc0b(0x230)]&&(console['log'](_0x1ebc0b(0x269)+_0x190e2c[_0x1ebc0b(0x1bd)]+'\x27:'),console['log']('─'[_0x1ebc0b(0x1dc)](0x3c)),console['log'](_0x190e2c[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x28d332 of _0x35fdf4){_0x28d332[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)](_0x1ebc0b(0x22c)+_0x28d332['name']+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x28d332[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0xdddc94(0x1bd)]=a4_0xdddc94(0x1c2);['description']=a4_0xdddc94(0x253);async[a4_0xdddc94(0x1c5)](_0x57fc58){const _0x185eb4=a4_0xdddc94,{options:_0x46f498,args:_0x296d9a,tdx:_0x1ed030}=_0x57fc58,_0x317b84=_0x296d9a[0x0],_0xb54777=_0x296d9a[0x1],_0x3f5a10=_0x46f498[_0x185eb4(0x250)],_0x2828b0=_0x46f498[_0x185eb4(0x221)],_0x4f638a=_0x46f498[_0x185eb4(0x1e7)],_0x38372c=_0x46f498[_0x185eb4(0x257)],_0x463943=_0x46f498[_0x185eb4(0x249)],_0x303e80=_0x46f498['agent'];let _0x77dea;if(_0x317b84){const _0x11a987=a4_0x5584d4['join'](_0x317b84,_0x185eb4(0x23d));if(existsSync(_0x11a987))try{const _0x2a3a48=JSON[_0x185eb4(0x26a)](readFileSync(_0x11a987,_0x185eb4(0x1d5)));_0x2a3a48[_0x185eb4(0x242)]&&(_0x77dea={'llm_project':_0x2a3a48[_0x185eb4(0x242)]});}catch{}}const _0x1ba6e5=findAgentConfigPath(process[_0x185eb4(0x1ff)]());let _0x5cdb38;if(_0x1ba6e5)try{const _0xdcc8d=JSON[_0x185eb4(0x26a)](readFileSync(_0x1ba6e5,'utf-8'));_0xdcc8d[_0x185eb4(0x242)]&&(_0x5cdb38={'llm_project':_0xdcc8d[_0x185eb4(0x242)]});}catch{}const _0x320d71=resolveAgentPullArgs({'arg':_0x317b84,'agentNameArg':_0xb54777,'agentFlag':_0x303e80,'contextProject':_0x463943,'argDirConfig':_0x77dea,'cwdConfigPath':_0x1ba6e5||undefined,'cwdConfig':_0x5cdb38}),{projectNameOrId:_0x21c1bf,targetAgentName:_0x10340b,existingOutputDir:_0x372b45,source:_0x34697c}=_0x320d71;if(_0x34697c===_0x185eb4(0x1d3))console['log'](a4_0x6bacc[_0x185eb4(0x266)]('Using\x20project\x20from\x20'+a4_0x5584d4['join'](_0x317b84,_0x185eb4(0x23d))+':\x20'+_0x21c1bf));else{if(_0x34697c==='cwd-config')console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x266)](_0x185eb4(0x25a)+_0x21c1bf));else _0x34697c===_0x185eb4(0x217)&&console['log'](a4_0x6bacc['dim']('Using\x20project\x20from\x20context:\x20'+_0x21c1bf));}if(!_0x21c1bf)return _0x303e80?(console['log'](a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x214))),console[_0x185eb4(0x21b)](_0x185eb4(0x20c)),console['log'](_0x185eb4(0x1ef))):(console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x211))),console['log'](_0x185eb4(0x20f)),console[_0x185eb4(0x21b)](_0x185eb4(0x1f4)),console[_0x185eb4(0x21b)](_0x185eb4(0x1bf)),console[_0x185eb4(0x21b)]('\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[_0x185eb4(0x21b)](_0x185eb4(0x235))),0x1;if(_0x10340b){const {data:_0x2abe3f}=await withSpinner(_0x185eb4(0x1d9)+_0x10340b+_0x185eb4(0x22e)+_0x21c1bf+_0x185eb4(0x245),()=>_0x1ed030[_0x185eb4(0x22b)][_0x185eb4(0x1e9)](_0x21c1bf,_0x10340b,_0x3f5a10,{'dryRun':_0x2828b0,'force':_0x4f638a}));if(_0x2828b0)return console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1cc)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x185eb4(0x21b)]('Would\x20pull\x20agent:\x20'+_0x2abe3f[_0x185eb4(0x1f1)]),console['log'](_0x185eb4(0x1fd)+_0x2abe3f[_0x185eb4(0x220)]),_0x2abe3f[_0x185eb4(0x230)]&&(console[_0x185eb4(0x21b)](_0x185eb4(0x201)),console[_0x185eb4(0x21b)]('─'[_0x185eb4(0x1dc)](0x3c)),console[_0x185eb4(0x21b)](_0x2abe3f['diff']),console[_0x185eb4(0x21b)]('─'[_0x185eb4(0x1dc)](0x3c))),0x0;return console['log'](a4_0x6bacc[_0x185eb4(0x1d7)](_0x185eb4(0x21e))),console[_0x185eb4(0x21b)](_0x185eb4(0x1dd)+_0x2abe3f[_0x185eb4(0x1f1)]),console[_0x185eb4(0x21b)](_0x185eb4(0x23f)+_0x2abe3f[_0x185eb4(0x220)]),console['log'](_0x185eb4(0x229)+(_0x2abe3f['isNew']?a4_0x6bacc[_0x185eb4(0x1d7)](_0x185eb4(0x1ea)):_0x2abe3f[_0x185eb4(0x238)]?a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x1cb)):a4_0x6bacc[_0x185eb4(0x1d6)](_0x185eb4(0x202)))),0x0;}const _0x1eb64e=_0x372b45||_0x3f5a10,{data:_0x36b5df}=await withSpinner(_0x185eb4(0x24c)+_0x21c1bf+_0x185eb4(0x245),()=>_0x1ed030[_0x185eb4(0x22b)][_0x185eb4(0x260)](_0x21c1bf,_0x1eb64e,{'dryRun':!![]})),_0x828f33=_0x36b5df['counts']['agents'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['knowledgeBases'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x23b)][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['prompts'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['integrations'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['experimentalArtifacts'][_0x185eb4(0x1ea)],_0x5e0d3c=_0x36b5df[_0x185eb4(0x1d8)]['agents'][_0x185eb4(0x1cb)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1e4)]['updated']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x23b)][_0x185eb4(0x1cb)]+_0x36b5df['counts']['prompts']['updated']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1da)][_0x185eb4(0x1cb)]+_0x36b5df[_0x185eb4(0x1d8)]['experimentalKnowledgeBases']['updated']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1d4)][_0x185eb4(0x1cb)],_0x169f3b=_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x239)][_0x185eb4(0x202)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1e4)][_0x185eb4(0x202)]+_0x36b5df['counts'][_0x185eb4(0x23b)][_0x185eb4(0x202)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1b6)]['unchanged']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1da)]['unchanged']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)][_0x185eb4(0x202)]+_0x36b5df['counts'][_0x185eb4(0x1d4)]['unchanged'];console[_0x185eb4(0x21b)](_0x185eb4(0x1b7)+_0x36b5df[_0x185eb4(0x258)]+'\x27:'),console[_0x185eb4(0x21b)]('\x20\x20'+a4_0x6bacc[_0x185eb4(0x1d7)]('+\x20'+_0x828f33+_0x185eb4(0x1d0))+_0x185eb4(0x1be)+a4_0x6bacc[_0x185eb4(0x1cc)]('~\x20'+_0x5e0d3c+_0x185eb4(0x21a))+_0x185eb4(0x1be)+a4_0x6bacc['dim']('=\x20'+_0x169f3b+_0x185eb4(0x226))),console['log'](_0x185eb4(0x1f6)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x239)])),console['log'](_0x185eb4(0x1c3)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1e4)])),console[_0x185eb4(0x21b)](_0x185eb4(0x1f3)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x23b)])),console[_0x185eb4(0x21b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1b6)])),console[_0x185eb4(0x21b)](_0x185eb4(0x223)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)]['integrations']));const _0xb6e778=_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)][_0x185eb4(0x248)]>0x0||_0x36b5df['counts'][_0x185eb4(0x1d4)][_0x185eb4(0x248)]>0x0;_0xb6e778&&(console[_0x185eb4(0x21b)](_0x185eb4(0x236)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)])),console[_0x185eb4(0x21b)](_0x185eb4(0x1e3)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)]['experimentalArtifacts'])));console['log'](_0x185eb4(0x20b)+a4_0x6bacc['cyan'](_0x36b5df[_0x185eb4(0x1c9)])),displayDiffs(_0x36b5df[_0x185eb4(0x239)],_0x36b5df['knowledgeBases'],_0x36b5df[_0x185eb4(0x23b)],_0x36b5df[_0x185eb4(0x1b6)],_0x36b5df[_0x185eb4(0x1da)],_0x36b5df[_0x185eb4(0x259)],_0x36b5df[_0x185eb4(0x1d4)]);if(_0x2828b0)return console[_0x185eb4(0x21b)](a4_0x6bacc['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x828f33===0x0&&_0x5e0d3c===0x0)return console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1d7)](_0x185eb4(0x1d1))),saveSessionContext({'llm_project':_0x36b5df[_0x185eb4(0x258)]},_0x46f498[_0x185eb4(0x234)]),console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1d7)]('✔\x20Context\x20set:\x20'+a4_0x6bacc[_0x185eb4(0x266)]('llm_project')+_0x185eb4(0x268)+a4_0x6bacc['cyan'](_0x36b5df[_0x185eb4(0x258)]))),0x0;if(!_0x38372c&&!_0x4f638a){if(!isInteractive())return console[_0x185eb4(0x1e6)](a4_0x6bacc['red'](_0x185eb4(0x225)),_0x185eb4(0x263)),console[_0x185eb4(0x1e6)](a4_0x6bacc[_0x185eb4(0x266)](_0x185eb4(0x1f9))),0x1;const _0x5458a5=await confirmKey('\x0aWrite\x20'+(_0x828f33+_0x5e0d3c)+_0x185eb4(0x1db));if(!_0x5458a5)return console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x1df)),_0x185eb4(0x1f2)),0x1;}const {data:_0x1e13f0}=await withSpinner(_0x185eb4(0x24b),()=>_0x1ed030['llm'][_0x185eb4(0x260)](_0x21c1bf,_0x1eb64e,{'force':_0x4f638a}));return console[_0x185eb4(0x21b)](a4_0x6bacc['green'](_0x185eb4(0x241)+(_0x828f33+_0x5e0d3c)+_0x185eb4(0x1e5)+_0x1e13f0[_0x185eb4(0x1c9)])),saveSessionContext({'llm_project':_0x1e13f0[_0x185eb4(0x258)]},_0x46f498[_0x185eb4(0x234)]),console[_0x185eb4(0x21b)](a4_0x6bacc['green'](_0x185eb4(0x208)+a4_0x6bacc[_0x185eb4(0x266)](_0x185eb4(0x242))+_0x185eb4(0x268)+a4_0x6bacc[_0x185eb4(0x1ee)](_0x1e13f0['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0xdddc94(0x1bd)]='agent:clone';[a4_0xdddc94(0x1bc)]=a4_0xdddc94(0x240);async[a4_0xdddc94(0x1c5)](_0x32a1f1){const _0x533782=a4_0xdddc94,{options:_0x4bf4ce,args:_0x437ecd,tdx:_0x46bd14}=_0x32a1f1,_0x3e7ac7=_0x437ecd[0x0],_0x378569=_0x4bf4ce[_0x533782(0x1bd)],_0x4c329f=_0x4bf4ce['dryRun'],_0xcf54c0=_0x4bf4ce['yes'],_0x1b629a=_0x4bf4ce['site'],_0x448b62=_0x4bf4ce[_0x533782(0x249)];let _0xc5a795;const _0x36aaec=findAgentConfigPath(process[_0x533782(0x1ff)]());if(_0x3e7ac7){const _0x1fae2b=a4_0x5584d4[_0x533782(0x1c0)](_0x3e7ac7,_0x533782(0x23d));existsSync(_0x1fae2b)?(_0xc5a795=_0x3e7ac7,console[_0x533782(0x21b)](a4_0x6bacc['dim'](_0x533782(0x23c)+_0x3e7ac7))):_0xc5a795=_0x3e7ac7;}else{if(_0x36aaec)_0xc5a795=a4_0x5584d4[_0x533782(0x267)](_0x36aaec),console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x266)](_0x533782(0x25e)+_0xc5a795));else{if(_0x448b62){const _0x297bb2=sanitizeForFilesystem(_0x448b62);let _0x3f198e=_0x297bb2,_0x2e84c1=a4_0x5584d4[_0x533782(0x1c0)](process[_0x533782(0x1ff)](),'agents',_0x297bb2,_0x533782(0x23d));if(!existsSync(_0x2e84c1)){const _0x2bd2e0=normalizeName(_0x448b62),_0x59f2a5=a4_0x5584d4[_0x533782(0x1c0)](process['cwd'](),_0x533782(0x239),_0x2bd2e0,_0x533782(0x23d));existsSync(_0x59f2a5)&&(_0x3f198e=_0x2bd2e0,_0x2e84c1=_0x59f2a5);}if(existsSync(_0x2e84c1))_0xc5a795=a4_0x5584d4[_0x533782(0x267)](_0x2e84c1),console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x266)](_0x533782(0x23c)+_0xc5a795));else{const _0x1a429e=_0x4bf4ce[_0x533782(0x1e0)];if(_0x1a429e)throw new SDKError(ErrorCode[_0x533782(0x210)],_0x533782(0x23e)+_0x448b62+_0x533782(0x215),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x533782(0x224)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x448b62+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3f198e+_0x533782(0x1c6)+(_0x378569||'<new-name>')+'\x20--profile\x20'+_0x1a429e)});_0xc5a795=_0x448b62,console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x266)](_0x533782(0x252)+_0x448b62));}}}}if(!_0xc5a795)return console['log'](a4_0x6bacc[_0x533782(0x1cc)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x533782(0x21b)](_0x533782(0x1f7)),console[_0x533782(0x21b)](_0x533782(0x1c8)),console[_0x533782(0x21b)](_0x533782(0x1d2)),console[_0x533782(0x21b)](_0x533782(0x247)),0x1;if(!_0x378569)throw new SDKError(ErrorCode[_0x533782(0x1e1)],_0x533782(0x228),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0xcf54c0&&!_0x4c329f){if(!isInteractive())return console[_0x533782(0x1e6)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x225)),_0x533782(0x263)),console[_0x533782(0x1e6)](a4_0x6bacc[_0x533782(0x266)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xef42=await confirmKey('Clone\x20\x22'+_0xc5a795+_0x533782(0x24e)+_0x378569+'\x22?');if(!_0xef42)return console[_0x533782(0x21b)](a4_0x6bacc['yellow']('Cancelled')),0x1;}const {data:_0x1d1731}=await withSpinner('Cloning\x20\x22'+_0xc5a795+_0x533782(0x1fc)+_0x378569+'\x22...',()=>_0x46bd14[_0x533782(0x22b)][_0x533782(0x21c)](_0xc5a795,_0x378569,{'dryRun':_0x4c329f}));if(_0x4c329f){console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1cc)](_0x533782(0x1c4))),console[_0x533782(0x21b)]('Source:\x20'+_0x1d1731['sourceProjectName']),console[_0x533782(0x21b)](_0x533782(0x222)+_0x378569),console[_0x533782(0x21b)](_0x533782(0x20a)),console['log'](_0x533782(0x1f6)+_0x1d1731['counts'][_0x533782(0x239)][_0x533782(0x1de)]),console[_0x533782(0x21b)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1e4)]['created']),console[_0x533782(0x21b)](_0x533782(0x218)+_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1b6)][_0x533782(0x1de)]);const _0x6fcf5f=_0x1d1731[_0x533782(0x1d8)][_0x533782(0x259)]['created']>0x0||_0x1d1731[_0x533782(0x1d8)]['experimentalArtifacts'][_0x533782(0x1de)]>0x0;return _0x6fcf5f&&(console[_0x533782(0x21b)](_0x533782(0x236)+_0x1d1731[_0x533782(0x1d8)][_0x533782(0x259)][_0x533782(0x1de)]),console[_0x533782(0x21b)](_0x533782(0x1e3)+_0x1d1731[_0x533782(0x1d8)]['experimentalArtifacts'][_0x533782(0x1de)])),0x0;}const _0x109f5d=_0x1d1731[_0x533782(0x1d8)][_0x533782(0x239)][_0x533782(0x1fb)]>0x0||_0x1d1731[_0x533782(0x1d8)]['knowledgeBases']['errors']>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1b6)][_0x533782(0x1fb)]>0x0||_0x1d1731['counts'][_0x533782(0x259)][_0x533782(0x1fb)]>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1d4)][_0x533782(0x1fb)]>0x0;_0x109f5d?console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1cc)]('Project\x20cloned\x20with\x20errors')):console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1d7)](_0x533782(0x24f)));console['log'](_0x533782(0x246)+_0x1d1731[_0x533782(0x205)]),console[_0x533782(0x21b)]('New\x20project:\x20'+_0x1d1731['newProjectName']),console['log']('New\x20project\x20ID:\x20'+_0x1d1731[_0x533782(0x1f0)]),console[_0x533782(0x21b)](),console[_0x533782(0x21b)]('Summary:'),console[_0x533782(0x21b)](_0x533782(0x1f6)+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x239)])),console[_0x533782(0x21b)](_0x533782(0x1c3)+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1e4)])),console['log'](_0x533782(0x218)+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1b6)])),console[_0x533782(0x21b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1da)]));const _0x34f967=_0x1d1731[_0x533782(0x1d8)]['experimentalKnowledgeBases'][_0x533782(0x1de)]>0x0||_0x1d1731[_0x533782(0x1d8)]['experimentalKnowledgeBases'][_0x533782(0x1cb)]>0x0||_0x1d1731['counts']['experimentalKnowledgeBases'][_0x533782(0x202)]>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1d4)][_0x533782(0x1de)]>0x0||_0x1d1731['counts'][_0x533782(0x1d4)][_0x533782(0x1cb)]>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1d4)][_0x533782(0x202)]>0x0;_0x34f967&&(console[_0x533782(0x21b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x259)])),console[_0x533782(0x21b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1d1731['counts']['experimentalArtifacts'])));if(_0x109f5d){console['log'](),console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x1e8)));for(const _0x2541b3 of _0x1d1731['agents']){_0x2541b3[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x25b)+_0x2541b3['agentName']+_0x533782(0x255)+_0x2541b3[_0x533782(0x1e6)]));}for(const _0x3a98d1 of _0x1d1731[_0x533782(0x1e4)]){_0x3a98d1[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x3a98d1[_0x533782(0x1bd)]+_0x533782(0x255)+_0x3a98d1[_0x533782(0x1e6)]));}for(const _0xd628fa of _0x1d1731[_0x533782(0x1b6)]){_0xd628fa[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x1ed)+_0xd628fa[_0x533782(0x1bd)]+_0x533782(0x255)+_0xd628fa['error']));}for(const _0x468f3d of _0x1d1731[_0x533782(0x1da)]){_0x468f3d[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x1bb)+_0x468f3d['name']+'\x22:\x20'+_0x468f3d[_0x533782(0x1e6)]));}for(const _0x4d54d0 of _0x1d1731[_0x533782(0x259)]){_0x4d54d0[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x216)+_0x4d54d0['name']+'\x22:\x20'+_0x4d54d0[_0x533782(0x1e6)]));}for(const _0xaf3eae of _0x1d1731['experimentalArtifacts']){_0xaf3eae[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x254)+_0xaf3eae[_0x533782(0x1bd)]+'\x22:\x20'+_0xaf3eae['error']));}return 0x1;}console['log']();const _0x62cebc=getLLMProjectUrl(_0x1b629a,_0x1d1731['newProjectId']);return console[_0x533782(0x21b)]('Project:\x20'+a4_0x6bacc['cyan'](_0x62cebc)),0x0;}}function a4_0x1c1f(_0x30128f,_0x259904){_0x30128f=_0x30128f-0x1b6;const _0x1929e7=a4_0x1929();let _0x1c1ffe=_0x1929e7[_0x30128f];return _0x1c1ffe;}export class AgentPushCommand extends BaseCommand{['name']=a4_0xdddc94(0x26c);[a4_0xdddc94(0x1bc)]=a4_0xdddc94(0x1ec);async[a4_0xdddc94(0x1c5)](_0x440da0){const _0x381d9e=a4_0xdddc94,{options:_0x36f36a,args:_0x3ca19b,tdx:_0xdc8a1c}=_0x440da0;let _0x4a94ba=_0x3ca19b[0x0]||process['cwd']();const _0x284615=_0x36f36a[_0x381d9e(0x221)],_0x470925=_0x36f36a[_0x381d9e(0x1e7)],_0x37a0e6=_0x36f36a['yes'],_0x34a065=_0x36f36a[_0x381d9e(0x25c)],_0x1ee1ff=a4_0x5584d4['join'](_0x4a94ba,_0x381d9e(0x22f)),_0x416f6f=existsSync(_0x1ee1ff);if(_0x416f6f){const {data:_0x1d4b2f}=await withSpinner(_0x381d9e(0x243)+_0x4a94ba+'\x22...',()=>_0xdc8a1c[_0x381d9e(0x22b)]['pushAgent'](_0x4a94ba,{'dryRun':_0x284615,'force':_0x470925}));if(_0x284615)return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x1c4))),console[_0x381d9e(0x21b)](_0x381d9e(0x262)+_0x1d4b2f[_0x381d9e(0x1f1)]),0x0;if(_0x1d4b2f[_0x381d9e(0x20e)]===_0x381d9e(0x1e6))return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x264)+_0x1d4b2f[_0x381d9e(0x1e6)])),0x1;console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1d7)](_0x381d9e(0x207)+_0x1d4b2f[_0x381d9e(0x20e)]+_0x381d9e(0x1ca))),console[_0x381d9e(0x21b)](_0x381d9e(0x1dd)+_0x1d4b2f[_0x381d9e(0x1f1)]);if(_0x1d4b2f['agentId']&&_0x1d4b2f[_0x381d9e(0x261)]){const _0xf7daa5=getLLMAgentChatUrl(_0x34a065,_0x1d4b2f[_0x381d9e(0x261)],_0x1d4b2f[_0x381d9e(0x233)]);console['log']('Chat:\x20'+a4_0x6bacc[_0x381d9e(0x1ee)](_0xf7daa5));}return 0x0;}const _0xb03ff3=_0x36f36a[_0x381d9e(0x249)],_0x53ae73=resolveProjectFromContext(_0x4a94ba,_0xb03ff3);if(_0x53ae73[_0x381d9e(0x212)])_0x4a94ba=_0x53ae73[_0x381d9e(0x206)],_0x53ae73[_0x381d9e(0x1fa)]==='context'&&console['log'](a4_0x6bacc[_0x381d9e(0x266)](_0x381d9e(0x25a)+_0x4a94ba));else{let _0x342dae='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x53ae73[_0x381d9e(0x1cf)]===_0x381d9e(0x22d)&&(_0x342dae=_0x53ae73[_0x381d9e(0x20d)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x53ae73[_0x381d9e(0x249)]+_0x381d9e(0x265));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53ae73[_0x381d9e(0x1cf)]==='no_context'?_0x53ae73[_0x381d9e(0x20d)]:_0x381d9e(0x21f)+_0x4a94ba,undefined,{'helpText':_0x342dae});}const {data:_0x20598e}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xdc8a1c[_0x381d9e(0x22b)][_0x381d9e(0x231)](_0x4a94ba,{'dryRun':!![]})),_0x589bd5=_0x20598e['counts'][_0x381d9e(0x239)][_0x381d9e(0x1fb)]>0x0;if(_0x589bd5){console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x256)));for(const _0x3cab0e of _0x20598e[_0x381d9e(0x239)]){_0x3cab0e[_0x381d9e(0x20e)]==='error'&&console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x25b)+_0x3cab0e[_0x381d9e(0x1f1)]+_0x381d9e(0x255)+_0x3cab0e[_0x381d9e(0x1e6)]));}return 0x1;}const _0xe708c6=_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x239)]['created']+_0x20598e['counts'][_0x381d9e(0x1e4)]['created']+_0x20598e['counts'][_0x381d9e(0x23b)][_0x381d9e(0x1de)]+_0x20598e['counts'][_0x381d9e(0x1b6)]['created']+_0x20598e[_0x381d9e(0x1d8)]['integrations'][_0x381d9e(0x1de)]+_0x20598e['counts'][_0x381d9e(0x259)]['created']+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)]['created'],_0x2624b6=_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x239)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1e4)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x23b)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1b6)]['updated']+_0x20598e['counts'][_0x381d9e(0x1da)][_0x381d9e(0x1cb)]+_0x20598e['counts'][_0x381d9e(0x259)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)]['experimentalArtifacts'][_0x381d9e(0x1cb)],_0x101d68=_0x20598e[_0x381d9e(0x1d8)]['agents'][_0x381d9e(0x202)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1e4)]['unchanged']+_0x20598e['counts'][_0x381d9e(0x23b)]['unchanged']+_0x20598e['counts'][_0x381d9e(0x1b6)][_0x381d9e(0x202)]+_0x20598e['counts'][_0x381d9e(0x1da)][_0x381d9e(0x202)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x259)]['unchanged']+_0x20598e['counts'][_0x381d9e(0x1d4)][_0x381d9e(0x202)];console[_0x381d9e(0x21b)](_0x381d9e(0x1e2)+_0x20598e[_0x381d9e(0x258)]+'\x27:'),console['log']('\x20\x20'+a4_0x6bacc[_0x381d9e(0x1d7)]('+\x20'+_0xe708c6+_0x381d9e(0x1d0))+_0x381d9e(0x1be)+a4_0x6bacc[_0x381d9e(0x1cc)]('~\x20'+_0x2624b6+'\x20changed')+_0x381d9e(0x1be)+a4_0x6bacc[_0x381d9e(0x266)]('=\x20'+_0x101d68+_0x381d9e(0x226))),console[_0x381d9e(0x21b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x239)])),console[_0x381d9e(0x21b)](_0x381d9e(0x1c3)+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)]['knowledgeBases'])),console['log'](_0x381d9e(0x1f3)+formatCountSummary(_0x20598e['counts'][_0x381d9e(0x23b)])),console[_0x381d9e(0x21b)](_0x381d9e(0x218)+formatCountSummary(_0x20598e['counts'][_0x381d9e(0x1b6)])),console[_0x381d9e(0x21b)](_0x381d9e(0x223)+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1da)]));const _0x22da06=_0x20598e[_0x381d9e(0x1d8)]['experimentalKnowledgeBases'][_0x381d9e(0x1de)]>0x0||_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x259)][_0x381d9e(0x1cb)]>0x0||_0x20598e['counts'][_0x381d9e(0x259)]['unchanged']>0x0||_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)]['created']>0x0||_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)][_0x381d9e(0x1cb)]>0x0||_0x20598e['counts'][_0x381d9e(0x1d4)][_0x381d9e(0x202)]>0x0;_0x22da06&&(console[_0x381d9e(0x21b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x20598e['counts']['experimentalKnowledgeBases'])),console[_0x381d9e(0x21b)](_0x381d9e(0x1e3)+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)])));console[_0x381d9e(0x21b)](_0x381d9e(0x203)+a4_0x6bacc[_0x381d9e(0x1ee)](_0x4a94ba)),displayDiffs(_0x20598e[_0x381d9e(0x239)],_0x20598e[_0x381d9e(0x1e4)],_0x20598e[_0x381d9e(0x23b)],_0x20598e['prompts'],_0x20598e[_0x381d9e(0x1da)],_0x20598e[_0x381d9e(0x259)],_0x20598e[_0x381d9e(0x1d4)]);if(_0x284615)return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x213))),0x0;if(_0xe708c6===0x0&&_0x2624b6===0x0){console[_0x381d9e(0x21b)](a4_0x6bacc['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x26b863=getLLMProjectUrl(_0x34a065,_0x20598e['projectId']);return console[_0x381d9e(0x21b)]('Project:\x20'+a4_0x6bacc[_0x381d9e(0x1ee)](_0x26b863)),0x0;}if(!_0x37a0e6&&!_0x470925){if(!isInteractive())return console[_0x381d9e(0x1e6)](a4_0x6bacc['red'](_0x381d9e(0x225)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x381d9e(0x1e6)](a4_0x6bacc[_0x381d9e(0x266)](_0x381d9e(0x1f9))),0x1;const _0x5a7a7b=await confirmKey(_0x381d9e(0x204)+(_0xe708c6+_0x2624b6)+_0x381d9e(0x24a));if(!_0x5a7a7b)return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x1df)),_0x381d9e(0x200)),0x1;}const {data:_0x24d48f}=await withSpinner('Pushing\x20to\x20project...',()=>_0xdc8a1c[_0x381d9e(0x22b)]['pushProject'](_0x4a94ba,{'force':_0x470925})),_0x461485=_0x24d48f[_0x381d9e(0x1d8)][_0x381d9e(0x239)]['errors']>0x0||_0x24d48f[_0x381d9e(0x1d8)]['knowledgeBases']['errors']>0x0||_0x24d48f[_0x381d9e(0x1d8)][_0x381d9e(0x23b)][_0x381d9e(0x1fb)]>0x0||_0x24d48f[_0x381d9e(0x1d8)][_0x381d9e(0x1b6)][_0x381d9e(0x1fb)]>0x0;if(_0x461485){console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x25f))),console['log'](),console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x1e8)));for(const _0x277e25 of _0x24d48f[_0x381d9e(0x239)]){_0x277e25[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x25b)+_0x277e25['agentName']+_0x381d9e(0x255)+_0x277e25[_0x381d9e(0x1e6)]));}for(const _0x2b8679 of _0x24d48f[_0x381d9e(0x1e4)]){_0x2b8679['action']===_0x381d9e(0x1e6)&&console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x25d)+_0x2b8679['name']+_0x381d9e(0x255)+_0x2b8679[_0x381d9e(0x1e6)]));}for(const _0xf130d2 of _0x24d48f[_0x381d9e(0x23b)]){_0xf130d2[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x227)+_0xf130d2[_0x381d9e(0x1bd)]+'\x22:\x20'+_0xf130d2[_0x381d9e(0x1e6)]));}for(const _0xe918ed of _0x24d48f[_0x381d9e(0x1b6)]){_0xe918ed[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x1ed)+_0xe918ed['name']+'\x22:\x20'+_0xe918ed['error']));}for(const _0x2d9e1a of _0x24d48f['integrations']){_0x2d9e1a[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x1bb)+_0x2d9e1a[_0x381d9e(0x1bd)]+'\x22:\x20'+_0x2d9e1a['error']));}return 0x1;}console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1d7)](_0x381d9e(0x1fe)+(_0xe708c6+_0x2624b6)+_0x381d9e(0x209)+_0x24d48f[_0x381d9e(0x258)]+'\x27'));const _0x2127bc=getLLMProjectUrl(_0x34a065,_0x24d48f['projectId']);return console[_0x381d9e(0x21b)]('Project:\x20'+a4_0x6bacc[_0x381d9e(0x1ee)](_0x2127bc)),0x0;}}
|
|
1
|
+
function a4_0x214e(){const _0xffbf91=['Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Agents:\x20','integrations','Cancelled','Dry\x20run\x20-\x20no\x20changes\x20made','newProjectName','109267FnZPys','Failed\x20to\x20push\x20agent:\x20','\x0aError:','outputDir','Project:\x20','\x0aPush\x20summary\x20for\x20\x27','Using\x20project\x20from\x20','agent:pull','-\x20no\x20files\x20written','created','6049834iKqIHe','Using\x20project\x20from\x20context:\x20','\x20\x20Prompt\x20\x22','message','red','Pushing\x20agent\x20from\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Would\x20clone:','pushProject','description','Pulling\x20agent\x20\x22','\x20\x20Integration\x20\x22','INVALID_ARGUMENT','2629148KSELQr','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','No\x20tdx.json\x20found\x20in\x20','Cloning\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','\x22\x20to\x20\x22','Analyzing\x20changes\x20to\x20push...','agent','\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','\x0aChanges\x20to\x20prompt\x20\x27','cwd','join','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','dryRun','newProjectId','\x20\x20Target:\x20','Output:\x20','\x20updated','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20successfully','5205880wAYVwW','\x20\x20Agent\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','prompts','pullProject','\x20\x20Knowledge\x20Base\x20\x22','context','\x0a✔\x20Pushed\x20','Dry\x20run\x20-\x20no\x20files\x20written','reason','\x0aProject\x20pushed\x20with\x20errors','\x0aPush\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','action','site','\x20resources?','\x20total','\x0aWrite\x20','isNew','no_context','gray','<new-name>','knowledgeBases','cyan','\x0aChanges:','\x20--name\x20','\x0aErrors\x20found:','yellow','Clone\x20\x22','force','\x20|\x20','\x22...','\x0aPull\x20summary\x20for\x20\x27','agent:clone','yes','New\x20project\x20name\x20is\x20required','Agent:\x20','projectName','\x20resources\x20to\x20\x27','llm_project','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Using\x20local\x20project:\x20','6021288NgKRGW','llm','\x22:\x20','Errors:','dim','\x20=\x20','\x20changed','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\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','counts','Using\x20project:\x20','errors','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Pushing\x20to\x20project...','session','769686oWxbbZ','\x20\x20Text\x20Knowledge\x20Base\x20\x22','diff','agents','\x20\x20Knowledge\x20Bases:\x20','experimentalKnowledgeBases','\x20created','Source:\x20','experimentalArtifacts','\x20new','New\x20project\x20ID:\x20','updated','new','✔\x20Context\x20set:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agent.yml','utf-8','Project\x20cloned\x20with\x20errors','MISSING_ARGUMENT','name','push','\x22\x20to\x20a\x20different\x20profile','Writing\x20files...','9467096TdwGJO','\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','agentId','tdx.json','agent:push','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','10mvflim','projectId','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','hasChanges','error','\x20\x20Experimental\x20Artifacts:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20unchanged','\x20\x20Integrations:\x20','Agent\x20pulled\x20successfully','total','parse','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Output\x20path:\x20','textKnowledgeBases','log','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Would\x20pull\x20agent:\x20','outputPath','\x20\x20Prompts:\x20','\x20errors','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Summary:','agentName','projectDir','dirname','llmProject','green','pullAgent','repeat','Project\x20cloned\x20successfully','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Agent\x20','unchanged','execute','\x20files\x20to\x20','Using\x20current\x20project:\x20','\x0a✔\x20Pulled\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','New\x20project:\x20'];a4_0x214e=function(){return _0xffbf91;};return a4_0x214e();}const a4_0x18b462=a4_0x3a7c;(function(_0x4b6763,_0x32b8a7){const _0x166e46=a4_0x3a7c,_0x55f4c2=_0x4b6763();while(!![]){try{const _0x323edd=parseInt(_0x166e46(0x166))/0x1+-parseInt(_0x166e46(0x135))/0x2*(-parseInt(_0x166e46(0x117))/0x3)+-parseInt(_0x166e46(0xc7))/0x4+parseInt(_0x166e46(0xdd))/0x5+parseInt(_0x166e46(0x108))/0x6+-parseInt(_0x166e46(0xba))/0x7+-parseInt(_0x166e46(0x12f))/0x8;if(_0x323edd===_0x32b8a7)break;else _0x55f4c2['push'](_0x55f4c2['shift']());}catch(_0x46a81c){_0x55f4c2['push'](_0x55f4c2['shift']());}}}(a4_0x214e,0xb2ad9));import a4_0x8a6c57 from'chalk';import a4_0x2da4c6 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x3943b0){const _0x49a78a=a4_0x3a7c,_0x341356=[];if(_0x3943b0['total']!==undefined)_0x341356[_0x49a78a(0x12c)](_0x3943b0[_0x49a78a(0x13f)]+_0x49a78a(0xee));if(_0x3943b0['new']!==undefined&&_0x3943b0[_0x49a78a(0x123)]>0x0)_0x341356['push'](a4_0x8a6c57[_0x49a78a(0x150)](_0x3943b0[_0x49a78a(0x123)]+'\x20new'));if(_0x3943b0[_0x49a78a(0xb9)]!==undefined&&_0x3943b0[_0x49a78a(0xb9)]>0x0)_0x341356[_0x49a78a(0x12c)](a4_0x8a6c57[_0x49a78a(0x150)](_0x3943b0['created']+_0x49a78a(0x11d)));if(_0x3943b0[_0x49a78a(0x122)]!==undefined&&_0x3943b0['updated']>0x0)_0x341356['push'](a4_0x8a6c57[_0x49a78a(0xf9)](_0x3943b0[_0x49a78a(0x122)]+_0x49a78a(0xda)));if(_0x3943b0[_0x49a78a(0x156)]!==undefined&&_0x3943b0[_0x49a78a(0x156)]>0x0)_0x341356['push'](a4_0x8a6c57[_0x49a78a(0xf2)](_0x3943b0[_0x49a78a(0x156)]+'\x20unchanged'));if(_0x3943b0[_0x49a78a(0x113)]!==undefined&&_0x3943b0[_0x49a78a(0x113)]>0x0)_0x341356[_0x49a78a(0x12c)](a4_0x8a6c57[_0x49a78a(0xbe)](_0x3943b0[_0x49a78a(0x113)]+_0x49a78a(0x149)));return _0x341356[_0x49a78a(0xd2)](',\x20');}function a4_0x3a7c(_0xec796f,_0x11a3d0){_0xec796f=_0xec796f-0xb7;const _0x214e6e=a4_0x214e();let _0x3a7c3f=_0x214e6e[_0xec796f];return _0x3a7c3f;}function displayDiffs(_0x2b70a2,_0x49ab41,_0x5d4b05,_0x495dee,_0x366ffb,_0x51780c,_0x342324){const _0x182f17=a4_0x3a7c;for(const _0xe76f11 of _0x2b70a2){if(_0xe76f11['diff']){const _0x2963bb=_0xe76f11[_0x182f17(0x14c)]||_0xe76f11[_0x182f17(0x12b)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x2963bb+'\x27:'),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)),console['log'](_0xe76f11[_0x182f17(0x119)]),console['log']('─'[_0x182f17(0x152)](0x3c));}}for(const _0xef6518 of _0x49ab41){_0xef6518[_0x182f17(0x119)]&&(console[_0x182f17(0x144)](_0x182f17(0x13b)+_0xef6518[_0x182f17(0x12b)]+'\x27:'),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)),console[_0x182f17(0x144)](_0xef6518['diff']),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)));}for(const _0x2631f9 of _0x5d4b05){_0x2631f9[_0x182f17(0x119)]&&(console['log'](_0x182f17(0x15e)+_0x2631f9['name']+'\x27:'),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)),console['log'](_0x2631f9[_0x182f17(0x119)]),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)));}for(const _0x23e2a8 of _0x495dee){_0x23e2a8['diff']&&(console['log'](_0x182f17(0xd0)+_0x23e2a8[_0x182f17(0x12b)]+'\x27:'),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)),console[_0x182f17(0x144)](_0x23e2a8[_0x182f17(0x119)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3c504c of _0x366ffb){_0x3c504c[_0x182f17(0x119)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x3c504c[_0x182f17(0x12b)]+'\x27:'),console[_0x182f17(0x144)]('─'['repeat'](0x3c)),console['log'](_0x3c504c[_0x182f17(0x119)]),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)));}for(const _0x1e476e of _0x51780c){_0x1e476e[_0x182f17(0x119)]&&(console[_0x182f17(0x144)](_0x182f17(0x141)+_0x1e476e[_0x182f17(0x12b)]+'\x27:'),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)),console['log'](_0x1e476e['diff']),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)));}for(const _0x34f86d of _0x342324){_0x34f86d[_0x182f17(0x119)]&&(console[_0x182f17(0x144)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x34f86d[_0x182f17(0x12b)]+'\x27:'),console[_0x182f17(0x144)]('─'[_0x182f17(0x152)](0x3c)),console[_0x182f17(0x144)](_0x34f86d['diff']),console[_0x182f17(0x144)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x18b462(0x12b)]=a4_0x18b462(0xb7);[a4_0x18b462(0xc3)]=a4_0x18b462(0x154);async['execute'](_0x4812b){const _0x4c991a=a4_0x18b462,{options:_0x14b748,args:_0x3516fa,tdx:_0x22b597}=_0x4812b,_0x12619f=_0x3516fa[0x0],_0x4550e8=_0x3516fa[0x1],_0x3457db=_0x14b748['output'],_0x12c257=_0x14b748[_0x4c991a(0xd6)],_0x394675=_0x14b748[_0x4c991a(0xfb)],_0xfa58f5=_0x14b748[_0x4c991a(0x100)],_0x8eedc9=_0x14b748['llmProject'],_0x44593e=_0x14b748[_0x4c991a(0xce)];let _0x565fb9;if(_0x12619f){const _0x706722=a4_0x2da4c6[_0x4c991a(0xd2)](_0x12619f,_0x4c991a(0x132));if(existsSync(_0x706722))try{const _0x4ddabd=JSON[_0x4c991a(0x140)](readFileSync(_0x706722,_0x4c991a(0x128)));_0x4ddabd[_0x4c991a(0x105)]&&(_0x565fb9={'llm_project':_0x4ddabd[_0x4c991a(0x105)]});}catch{}}const _0x5aaf77=findAgentConfigPath(process[_0x4c991a(0xd1)]());let _0x176539;if(_0x5aaf77)try{const _0x124097=JSON[_0x4c991a(0x140)](readFileSync(_0x5aaf77,_0x4c991a(0x128)));_0x124097[_0x4c991a(0x105)]&&(_0x176539={'llm_project':_0x124097['llm_project']});}catch{}const _0x33b40b=resolveAgentPullArgs({'arg':_0x12619f,'agentNameArg':_0x4550e8,'agentFlag':_0x44593e,'contextProject':_0x8eedc9,'argDirConfig':_0x565fb9,'cwdConfigPath':_0x5aaf77||undefined,'cwdConfig':_0x176539}),{projectNameOrId:_0xdb3876,targetAgentName:_0x2d5307,existingOutputDir:_0x32d0f1,source:_0x29734a}=_0x33b40b;if(_0x29734a==='arg-dir')console[_0x4c991a(0x144)](a4_0x8a6c57['dim'](_0x4c991a(0x16c)+a4_0x2da4c6[_0x4c991a(0xd2)](_0x12619f,_0x4c991a(0x132))+':\x20'+_0xdb3876));else{if(_0x29734a==='cwd-config')console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0x10c)](_0x4c991a(0x112)+_0xdb3876));else _0x29734a===_0x4c991a(0xe3)&&console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0x10c)](_0x4c991a(0xbb)+_0xdb3876));}if(!_0xdb3876)return _0x44593e?(console[_0x4c991a(0x144)](a4_0x8a6c57['yellow'](_0x4c991a(0x114))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x4c991a(0x137))):(console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0xf9)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x4c991a(0x144)]('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)'),console['log'](_0x4c991a(0x130)),console[_0x4c991a(0x144)](_0x4c991a(0xcb)),console['log'](_0x4c991a(0xcf)),console[_0x4c991a(0x144)](_0x4c991a(0x110))),0x1;if(_0x2d5307){const {data:_0x5251e6}=await withSpinner(_0x4c991a(0xc4)+_0x2d5307+'\x22\x20from\x20project\x20\x22'+_0xdb3876+_0x4c991a(0xfd),()=>_0x22b597[_0x4c991a(0x109)][_0x4c991a(0x151)](_0xdb3876,_0x2d5307,_0x3457db,{'dryRun':_0x12c257,'force':_0x394675}));if(_0x12c257)return console[_0x4c991a(0x144)](a4_0x8a6c57['yellow'](_0x4c991a(0xe5))),console[_0x4c991a(0x144)](_0x4c991a(0x146)+_0x5251e6[_0x4c991a(0x14c)]),console[_0x4c991a(0x144)](_0x4c991a(0x142)+_0x5251e6[_0x4c991a(0x147)]),_0x5251e6[_0x4c991a(0x119)]&&(console[_0x4c991a(0x144)](_0x4c991a(0xf6)),console[_0x4c991a(0x144)]('─'['repeat'](0x3c)),console[_0x4c991a(0x144)](_0x5251e6[_0x4c991a(0x119)]),console[_0x4c991a(0x144)]('─'[_0x4c991a(0x152)](0x3c))),0x0;return console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0x150)](_0x4c991a(0x13e))),console['log'](_0x4c991a(0x102)+_0x5251e6[_0x4c991a(0x14c)]),console[_0x4c991a(0x144)](_0x4c991a(0xd9)+_0x5251e6[_0x4c991a(0x147)]),console['log']('Status:\x20'+(_0x5251e6[_0x4c991a(0xf0)]?a4_0x8a6c57[_0x4c991a(0x150)]('new'):_0x5251e6[_0x4c991a(0x138)]?a4_0x8a6c57[_0x4c991a(0xf9)](_0x4c991a(0x122)):a4_0x8a6c57['gray']('unchanged'))),0x0;}const _0x51534c=_0x32d0f1||_0x3457db,{data:_0x43bd85}=await withSpinner('Analyzing\x20project\x20\x22'+_0xdb3876+'\x22...',()=>_0x22b597['llm']['pullProject'](_0xdb3876,_0x51534c,{'dryRun':!![]})),_0xccac78=_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11a)][_0x4c991a(0x123)]+_0x43bd85[_0x4c991a(0x111)]['knowledgeBases'][_0x4c991a(0x123)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x143)][_0x4c991a(0x123)]+_0x43bd85['counts'][_0x4c991a(0xe0)][_0x4c991a(0x123)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x162)][_0x4c991a(0x123)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11c)][_0x4c991a(0x123)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11f)][_0x4c991a(0x123)],_0x4c29be=_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11a)][_0x4c991a(0x122)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0xf4)][_0x4c991a(0x122)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x143)][_0x4c991a(0x122)]+_0x43bd85[_0x4c991a(0x111)]['prompts']['updated']+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x162)][_0x4c991a(0x122)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11c)][_0x4c991a(0x122)]+_0x43bd85['counts'][_0x4c991a(0x11f)][_0x4c991a(0x122)],_0xf76bdc=_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11a)]['unchanged']+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0xf4)]['unchanged']+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x143)][_0x4c991a(0x156)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0xe0)][_0x4c991a(0x156)]+_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x162)][_0x4c991a(0x156)]+_0x43bd85['counts'][_0x4c991a(0x11c)][_0x4c991a(0x156)]+_0x43bd85[_0x4c991a(0x111)]['experimentalArtifacts'][_0x4c991a(0x156)];console[_0x4c991a(0x144)](_0x4c991a(0xfe)+_0x43bd85[_0x4c991a(0x103)]+'\x27:'),console[_0x4c991a(0x144)]('\x20\x20'+a4_0x8a6c57[_0x4c991a(0x150)]('+\x20'+_0xccac78+'\x20new')+_0x4c991a(0xfc)+a4_0x8a6c57[_0x4c991a(0xf9)]('~\x20'+_0x4c29be+_0x4c991a(0x10e))+_0x4c991a(0xfc)+a4_0x8a6c57[_0x4c991a(0x10c)]('=\x20'+_0xf76bdc+_0x4c991a(0x13c))),console[_0x4c991a(0x144)](_0x4c991a(0x161)+formatCountSummary(_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11a)])),console[_0x4c991a(0x144)](_0x4c991a(0x11b)+formatCountSummary(_0x43bd85['counts'][_0x4c991a(0xf4)])),console[_0x4c991a(0x144)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x143)])),console['log'](_0x4c991a(0x148)+formatCountSummary(_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0xe0)])),console[_0x4c991a(0x144)](_0x4c991a(0x13d)+formatCountSummary(_0x43bd85['counts'][_0x4c991a(0x162)]));const _0x29e7a4=_0x43bd85[_0x4c991a(0x111)]['experimentalKnowledgeBases']['total']>0x0||_0x43bd85['counts']['experimentalArtifacts']['total']>0x0;_0x29e7a4&&(console['log'](_0x4c991a(0xdb)+formatCountSummary(_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11c)])),console[_0x4c991a(0x144)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x43bd85[_0x4c991a(0x111)][_0x4c991a(0x11f)])));console[_0x4c991a(0x144)](_0x4c991a(0xd8)+a4_0x8a6c57[_0x4c991a(0xf5)](_0x43bd85[_0x4c991a(0x169)])),displayDiffs(_0x43bd85['agents'],_0x43bd85[_0x4c991a(0xf4)],_0x43bd85[_0x4c991a(0x143)],_0x43bd85[_0x4c991a(0xe0)],_0x43bd85[_0x4c991a(0x162)],_0x43bd85[_0x4c991a(0x11c)],_0x43bd85[_0x4c991a(0x11f)]);if(_0x12c257)return console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0xf9)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xccac78===0x0&&_0x4c29be===0x0)return console['log'](a4_0x8a6c57[_0x4c991a(0x150)](_0x4c991a(0x15f))),saveSessionContext({'llm_project':_0x43bd85[_0x4c991a(0x103)]},_0x14b748['session']),console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0x150)](_0x4c991a(0x124)+a4_0x8a6c57[_0x4c991a(0x10c)](_0x4c991a(0x105))+_0x4c991a(0x10d)+a4_0x8a6c57[_0x4c991a(0xf5)](_0x43bd85[_0x4c991a(0x103)]))),0x0;if(!_0xfa58f5&&!_0x394675){if(!isInteractive())return console[_0x4c991a(0x139)](a4_0x8a6c57[_0x4c991a(0xbe)](_0x4c991a(0x168)),_0x4c991a(0x125)),console[_0x4c991a(0x139)](a4_0x8a6c57[_0x4c991a(0x10c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x10d80e=await confirmKey(_0x4c991a(0xef)+(_0xccac78+_0x4c29be)+'\x20files?');if(!_0x10d80e)return console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0xf9)]('Cancelled'),_0x4c991a(0xb8)),0x1;}const {data:_0x478e71}=await withSpinner(_0x4c991a(0x12e),()=>_0x22b597[_0x4c991a(0x109)][_0x4c991a(0xe1)](_0xdb3876,_0x51534c,{'force':_0x394675}));return console[_0x4c991a(0x144)](a4_0x8a6c57[_0x4c991a(0x150)](_0x4c991a(0x15a)+(_0xccac78+_0x4c29be)+_0x4c991a(0x158)+_0x478e71[_0x4c991a(0x169)])),saveSessionContext({'llm_project':_0x478e71['projectName']},_0x14b748[_0x4c991a(0x116)]),console['log'](a4_0x8a6c57[_0x4c991a(0x150)]('✔\x20Context\x20set:\x20'+a4_0x8a6c57['dim']('llm_project')+_0x4c991a(0x10d)+a4_0x8a6c57['cyan'](_0x478e71['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x18b462(0xff);[a4_0x18b462(0xc3)]=a4_0x18b462(0xd5);async['execute'](_0x53bf27){const _0x52ec1d=a4_0x18b462,{options:_0x4d9a99,args:_0x5cee4f,tdx:_0x2b478a}=_0x53bf27,_0x34cc5b=_0x5cee4f[0x0],_0x55f9fe=_0x4d9a99[_0x52ec1d(0x12b)],_0x4cc047=_0x4d9a99[_0x52ec1d(0xd6)],_0x544044=_0x4d9a99[_0x52ec1d(0x100)],_0x3ecfbd=_0x4d9a99[_0x52ec1d(0xec)],_0x34685f=_0x4d9a99['llmProject'];let _0x220de1;const _0x321c45=findAgentConfigPath(process['cwd']());if(_0x34cc5b){const _0x21d287=a4_0x2da4c6[_0x52ec1d(0xd2)](_0x34cc5b,'tdx.json');existsSync(_0x21d287)?(_0x220de1=_0x34cc5b,console[_0x52ec1d(0x144)](a4_0x8a6c57['dim'](_0x52ec1d(0x107)+_0x34cc5b))):_0x220de1=_0x34cc5b;}else{if(_0x321c45)_0x220de1=a4_0x2da4c6[_0x52ec1d(0x14e)](_0x321c45),console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0x10c)](_0x52ec1d(0x159)+_0x220de1));else{if(_0x34685f){const _0x9e5c85=sanitizeForFilesystem(_0x34685f);let _0x36a9bc=_0x9e5c85,_0x4a9b95=a4_0x2da4c6[_0x52ec1d(0xd2)](process[_0x52ec1d(0xd1)](),_0x52ec1d(0x11a),_0x9e5c85,_0x52ec1d(0x132));if(!existsSync(_0x4a9b95)){const _0x407eac=normalizeName(_0x34685f),_0x5d3641=a4_0x2da4c6[_0x52ec1d(0xd2)](process[_0x52ec1d(0xd1)](),_0x52ec1d(0x11a),_0x407eac,'tdx.json');existsSync(_0x5d3641)&&(_0x36a9bc=_0x407eac,_0x4a9b95=_0x5d3641);}if(existsSync(_0x4a9b95))_0x220de1=a4_0x2da4c6[_0x52ec1d(0x14e)](_0x4a9b95),console[_0x52ec1d(0x144)](a4_0x8a6c57['dim'](_0x52ec1d(0x107)+_0x220de1));else{const _0x29764f=_0x4d9a99['profile'];if(_0x29764f)throw new SDKError(ErrorCode[_0x52ec1d(0xc6)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x34685f+_0x52ec1d(0x12d),undefined,{'helpText':_0x52ec1d(0x14a)+_0x52ec1d(0x126)+(_0x52ec1d(0xd3)+_0x34685f+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x36a9bc+_0x52ec1d(0xf7)+(_0x55f9fe||_0x52ec1d(0xf3))+'\x20--profile\x20'+_0x29764f)});_0x220de1=_0x34685f,console['log'](a4_0x8a6c57[_0x52ec1d(0x10c)]('Using\x20context\x20project:\x20'+_0x34685f));}}}}if(!_0x220de1)return console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xf9)](_0x52ec1d(0x134))),console[_0x52ec1d(0x144)](_0x52ec1d(0xc8)),console[_0x52ec1d(0x144)](_0x52ec1d(0x15b)),console[_0x52ec1d(0x144)]('\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[_0x52ec1d(0x144)](_0x52ec1d(0x10f)),0x1;if(!_0x55f9fe)throw new SDKError(ErrorCode[_0x52ec1d(0x12a)],_0x52ec1d(0x101),undefined,{'helpText':_0x52ec1d(0xc0)});if(!_0x544044&&!_0x4cc047){if(!isInteractive())return console[_0x52ec1d(0x139)](a4_0x8a6c57[_0x52ec1d(0xbe)](_0x52ec1d(0x168)),_0x52ec1d(0x125)),console[_0x52ec1d(0x139)](a4_0x8a6c57['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4317b1=await confirmKey(_0x52ec1d(0xfa)+_0x220de1+_0x52ec1d(0x160)+_0x55f9fe+'\x22?');if(!_0x4317b1)return console['log'](a4_0x8a6c57[_0x52ec1d(0xf9)](_0x52ec1d(0x163))),0x1;}const {data:_0x83c3ac}=await withSpinner(_0x52ec1d(0xca)+_0x220de1+_0x52ec1d(0xcc)+_0x55f9fe+_0x52ec1d(0xfd),()=>_0x2b478a[_0x52ec1d(0x109)]['cloneProject'](_0x220de1,_0x55f9fe,{'dryRun':_0x4cc047}));if(_0x4cc047){console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xf9)](_0x52ec1d(0x164))),console[_0x52ec1d(0x144)](_0x52ec1d(0x11e)+_0x83c3ac['sourceProjectName']),console[_0x52ec1d(0x144)]('New\x20project:\x20'+_0x55f9fe),console[_0x52ec1d(0x144)](_0x52ec1d(0xc1)),console[_0x52ec1d(0x144)](_0x52ec1d(0x161)+_0x83c3ac['counts'][_0x52ec1d(0x11a)][_0x52ec1d(0xb9)]),console[_0x52ec1d(0x144)]('\x20\x20Knowledge\x20Bases:\x20'+_0x83c3ac['counts'][_0x52ec1d(0xf4)][_0x52ec1d(0xb9)]),console[_0x52ec1d(0x144)](_0x52ec1d(0x148)+_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0xe0)][_0x52ec1d(0xb9)]);const _0x58be35=_0x83c3ac['counts'][_0x52ec1d(0x11c)][_0x52ec1d(0xb9)]>0x0||_0x83c3ac['counts'][_0x52ec1d(0x11f)][_0x52ec1d(0xb9)]>0x0;return _0x58be35&&(console[_0x52ec1d(0x144)](_0x52ec1d(0xdb)+_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11c)]['created']),console[_0x52ec1d(0x144)](_0x52ec1d(0x13a)+_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11f)][_0x52ec1d(0xb9)])),0x0;}const _0x4765c6=_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11a)]['errors']>0x0||_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0xf4)][_0x52ec1d(0x113)]>0x0||_0x83c3ac[_0x52ec1d(0x111)]['prompts'][_0x52ec1d(0x113)]>0x0||_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11c)][_0x52ec1d(0x113)]>0x0||_0x83c3ac[_0x52ec1d(0x111)]['experimentalArtifacts'][_0x52ec1d(0x113)]>0x0;_0x4765c6?console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xf9)](_0x52ec1d(0x129))):console[_0x52ec1d(0x144)](a4_0x8a6c57['green'](_0x52ec1d(0x153)));console[_0x52ec1d(0x144)]('Source:\x20'+_0x83c3ac['sourceProjectName']),console[_0x52ec1d(0x144)](_0x52ec1d(0x15c)+_0x83c3ac[_0x52ec1d(0x165)]),console[_0x52ec1d(0x144)](_0x52ec1d(0x121)+_0x83c3ac[_0x52ec1d(0xd7)]),console['log'](),console[_0x52ec1d(0x144)](_0x52ec1d(0x14b)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x83c3ac[_0x52ec1d(0x111)]['agents'])),console[_0x52ec1d(0x144)](_0x52ec1d(0x11b)+formatCountSummary(_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0xf4)])),console[_0x52ec1d(0x144)](_0x52ec1d(0x148)+formatCountSummary(_0x83c3ac[_0x52ec1d(0x111)]['prompts'])),console[_0x52ec1d(0x144)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x83c3ac[_0x52ec1d(0x111)]['integrations']));const _0x3c8de3=_0x83c3ac[_0x52ec1d(0x111)]['experimentalKnowledgeBases'][_0x52ec1d(0xb9)]>0x0||_0x83c3ac['counts'][_0x52ec1d(0x11c)][_0x52ec1d(0x122)]>0x0||_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11c)][_0x52ec1d(0x156)]>0x0||_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11f)]['created']>0x0||_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11f)][_0x52ec1d(0x122)]>0x0||_0x83c3ac[_0x52ec1d(0x111)][_0x52ec1d(0x11f)][_0x52ec1d(0x156)]>0x0;_0x3c8de3&&(console[_0x52ec1d(0x144)](_0x52ec1d(0xdb)+formatCountSummary(_0x83c3ac[_0x52ec1d(0x111)]['experimentalKnowledgeBases'])),console[_0x52ec1d(0x144)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x83c3ac['counts'][_0x52ec1d(0x11f)])));if(_0x4765c6){console['log'](),console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xbe)](_0x52ec1d(0x10b)));for(const _0x37e2b4 of _0x83c3ac[_0x52ec1d(0x11a)]){_0x37e2b4['action']===_0x52ec1d(0x139)&&console['log'](a4_0x8a6c57[_0x52ec1d(0xbe)]('\x20\x20Agent\x20\x22'+_0x37e2b4['agentName']+_0x52ec1d(0x10a)+_0x37e2b4[_0x52ec1d(0x139)]));}for(const _0x191168 of _0x83c3ac['knowledgeBases']){_0x191168[_0x52ec1d(0xeb)]==='error'&&console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xbe)](_0x52ec1d(0xe2)+_0x191168['name']+_0x52ec1d(0x10a)+_0x191168[_0x52ec1d(0x139)]));}for(const _0xa8855c of _0x83c3ac[_0x52ec1d(0xe0)]){_0xa8855c[_0x52ec1d(0xeb)]===_0x52ec1d(0x139)&&console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xbe)](_0x52ec1d(0xbc)+_0xa8855c['name']+_0x52ec1d(0x10a)+_0xa8855c[_0x52ec1d(0x139)]));}for(const _0x3ab61e of _0x83c3ac[_0x52ec1d(0x162)]){_0x3ab61e[_0x52ec1d(0xeb)]===_0x52ec1d(0x139)&&console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xbe)](_0x52ec1d(0xc5)+_0x3ab61e[_0x52ec1d(0x12b)]+_0x52ec1d(0x10a)+_0x3ab61e[_0x52ec1d(0x139)]));}for(const _0x3bdeee of _0x83c3ac[_0x52ec1d(0x11c)]){_0x3bdeee[_0x52ec1d(0xeb)]==='error'&&console[_0x52ec1d(0x144)](a4_0x8a6c57[_0x52ec1d(0xbe)](_0x52ec1d(0x106)+_0x3bdeee[_0x52ec1d(0x12b)]+'\x22:\x20'+_0x3bdeee[_0x52ec1d(0x139)]));}for(const _0x2c0f48 of _0x83c3ac[_0x52ec1d(0x11f)]){_0x2c0f48[_0x52ec1d(0xeb)]===_0x52ec1d(0x139)&&console['log'](a4_0x8a6c57['red'](_0x52ec1d(0xe9)+_0x2c0f48[_0x52ec1d(0x12b)]+_0x52ec1d(0x10a)+_0x2c0f48[_0x52ec1d(0x139)]));}return 0x1;}console[_0x52ec1d(0x144)]();const _0x55898e=getLLMProjectUrl(_0x3ecfbd,_0x83c3ac[_0x52ec1d(0xd7)]);return console['log'](_0x52ec1d(0x16a)+a4_0x8a6c57[_0x52ec1d(0xf5)](_0x55898e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x18b462(0x12b)]=a4_0x18b462(0x133);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x18b462(0x157)](_0xf421e0){const _0x347c84=a4_0x18b462,{options:_0x34f77d,args:_0x22af49,tdx:_0x2c59a1}=_0xf421e0;let _0x222342=_0x22af49[0x0]||process['cwd']();const _0x40def8=_0x34f77d[_0x347c84(0xd6)],_0x2f96fd=_0x34f77d['force'],_0xce5b49=_0x34f77d[_0x347c84(0x100)],_0xe30d9d=_0x34f77d[_0x347c84(0xec)],_0x1af2bd=a4_0x2da4c6['join'](_0x222342,_0x347c84(0x127)),_0x475d26=existsSync(_0x1af2bd);if(_0x475d26){const {data:_0x4db6c5}=await withSpinner(_0x347c84(0xbf)+_0x222342+_0x347c84(0xfd),()=>_0x2c59a1['llm']['pushAgent'](_0x222342,{'dryRun':_0x40def8,'force':_0x2f96fd}));if(_0x40def8)return console[_0x347c84(0x144)](a4_0x8a6c57['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x347c84(0x144)](_0x347c84(0x15d)+_0x4db6c5[_0x347c84(0x14c)]),0x0;if(_0x4db6c5[_0x347c84(0xeb)]===_0x347c84(0x139))return console[_0x347c84(0x144)](a4_0x8a6c57['red'](_0x347c84(0x167)+_0x4db6c5[_0x347c84(0x139)])),0x1;console[_0x347c84(0x144)](a4_0x8a6c57[_0x347c84(0x150)](_0x347c84(0x155)+_0x4db6c5[_0x347c84(0xeb)]+_0x347c84(0xdc))),console[_0x347c84(0x144)](_0x347c84(0x102)+_0x4db6c5[_0x347c84(0x14c)]);if(_0x4db6c5[_0x347c84(0x131)]&&_0x4db6c5[_0x347c84(0x136)]){const _0x429965=getLLMAgentChatUrl(_0xe30d9d,_0x4db6c5[_0x347c84(0x136)],_0x4db6c5[_0x347c84(0x131)]);console['log']('Chat:\x20'+a4_0x8a6c57['cyan'](_0x429965));}return 0x0;}const _0x1df3f1=_0x34f77d[_0x347c84(0x14f)],_0x381a7d=resolveProjectFromContext(_0x222342,_0x1df3f1);if(_0x381a7d['found'])_0x222342=_0x381a7d[_0x347c84(0x14d)],_0x381a7d['source']===_0x347c84(0xe3)&&console[_0x347c84(0x144)](a4_0x8a6c57[_0x347c84(0x10c)](_0x347c84(0x112)+_0x222342));else{let _0x588546=_0x347c84(0x145);_0x381a7d[_0x347c84(0xe6)]==='no_local_folder'&&(_0x588546=_0x381a7d[_0x347c84(0xbd)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x381a7d[_0x347c84(0x14f)]+_0x347c84(0xea));throw new SDKError(ErrorCode[_0x347c84(0xc6)],_0x381a7d[_0x347c84(0xe6)]===_0x347c84(0xf1)?_0x381a7d['message']:_0x347c84(0xc9)+_0x222342,undefined,{'helpText':_0x588546});}const {data:_0x3c9eb7}=await withSpinner(_0x347c84(0xcd),()=>_0x2c59a1[_0x347c84(0x109)][_0x347c84(0xc2)](_0x222342,{'dryRun':!![]})),_0x3a0ebb=_0x3c9eb7['counts']['agents']['errors']>0x0;if(_0x3a0ebb){console[_0x347c84(0x144)](a4_0x8a6c57['red'](_0x347c84(0xf8)));for(const _0x5226c0 of _0x3c9eb7[_0x347c84(0x11a)]){_0x5226c0[_0x347c84(0xeb)]===_0x347c84(0x139)&&console[_0x347c84(0x144)](a4_0x8a6c57['red'](_0x347c84(0xde)+_0x5226c0[_0x347c84(0x14c)]+_0x347c84(0x10a)+_0x5226c0[_0x347c84(0x139)]));}return 0x1;}const _0x1b9b43=_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11a)][_0x347c84(0xb9)]+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0xf4)][_0x347c84(0xb9)]+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x143)]['created']+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0xe0)][_0x347c84(0xb9)]+_0x3c9eb7[_0x347c84(0x111)]['integrations'][_0x347c84(0xb9)]+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11c)][_0x347c84(0xb9)]+_0x3c9eb7['counts']['experimentalArtifacts'][_0x347c84(0xb9)],_0x3dfc52=_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11a)][_0x347c84(0x122)]+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0xf4)][_0x347c84(0x122)]+_0x3c9eb7['counts']['textKnowledgeBases']['updated']+_0x3c9eb7['counts'][_0x347c84(0xe0)][_0x347c84(0x122)]+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x162)][_0x347c84(0x122)]+_0x3c9eb7[_0x347c84(0x111)]['experimentalKnowledgeBases'][_0x347c84(0x122)]+_0x3c9eb7[_0x347c84(0x111)]['experimentalArtifacts'][_0x347c84(0x122)],_0x510d68=_0x3c9eb7[_0x347c84(0x111)]['agents'][_0x347c84(0x156)]+_0x3c9eb7[_0x347c84(0x111)]['knowledgeBases'][_0x347c84(0x156)]+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x143)][_0x347c84(0x156)]+_0x3c9eb7['counts'][_0x347c84(0xe0)][_0x347c84(0x156)]+_0x3c9eb7['counts'][_0x347c84(0x162)][_0x347c84(0x156)]+_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11c)][_0x347c84(0x156)]+_0x3c9eb7[_0x347c84(0x111)]['experimentalArtifacts'][_0x347c84(0x156)];console[_0x347c84(0x144)](_0x347c84(0x16b)+_0x3c9eb7[_0x347c84(0x103)]+'\x27:'),console[_0x347c84(0x144)]('\x20\x20'+a4_0x8a6c57[_0x347c84(0x150)]('+\x20'+_0x1b9b43+_0x347c84(0x120))+_0x347c84(0xfc)+a4_0x8a6c57[_0x347c84(0xf9)]('~\x20'+_0x3dfc52+_0x347c84(0x10e))+_0x347c84(0xfc)+a4_0x8a6c57[_0x347c84(0x10c)]('=\x20'+_0x510d68+_0x347c84(0x13c))),console['log'](_0x347c84(0x161)+formatCountSummary(_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11a)])),console[_0x347c84(0x144)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3c9eb7[_0x347c84(0x111)]['knowledgeBases'])),console['log'](_0x347c84(0xd4)+formatCountSummary(_0x3c9eb7['counts'][_0x347c84(0x143)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0xe0)])),console['log'](_0x347c84(0x13d)+formatCountSummary(_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x162)]));const _0x51e56d=_0x3c9eb7['counts']['experimentalKnowledgeBases'][_0x347c84(0xb9)]>0x0||_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11c)]['updated']>0x0||_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11c)][_0x347c84(0x156)]>0x0||_0x3c9eb7[_0x347c84(0x111)]['experimentalArtifacts'][_0x347c84(0xb9)]>0x0||_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11f)][_0x347c84(0x122)]>0x0||_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11f)][_0x347c84(0x156)]>0x0;_0x51e56d&&(console['log'](_0x347c84(0xdb)+formatCountSummary(_0x3c9eb7[_0x347c84(0x111)][_0x347c84(0x11c)])),console[_0x347c84(0x144)](_0x347c84(0x13a)+formatCountSummary(_0x3c9eb7[_0x347c84(0x111)]['experimentalArtifacts'])));console[_0x347c84(0x144)]('\x20\x20Source:\x20'+a4_0x8a6c57[_0x347c84(0xf5)](_0x222342)),displayDiffs(_0x3c9eb7[_0x347c84(0x11a)],_0x3c9eb7[_0x347c84(0xf4)],_0x3c9eb7[_0x347c84(0x143)],_0x3c9eb7[_0x347c84(0xe0)],_0x3c9eb7['integrations'],_0x3c9eb7[_0x347c84(0x11c)],_0x3c9eb7[_0x347c84(0x11f)]);if(_0x40def8)return console['log'](a4_0x8a6c57[_0x347c84(0xf9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1b9b43===0x0&&_0x3dfc52===0x0){console['log'](a4_0x8a6c57[_0x347c84(0x150)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2453a9=getLLMProjectUrl(_0xe30d9d,_0x3c9eb7[_0x347c84(0x136)]);return console[_0x347c84(0x144)](_0x347c84(0x16a)+a4_0x8a6c57[_0x347c84(0xf5)](_0x2453a9)),0x0;}if(!_0xce5b49&&!_0x2f96fd){if(!isInteractive())return console[_0x347c84(0x139)](a4_0x8a6c57[_0x347c84(0xbe)]('\x0aError:'),_0x347c84(0x125)),console['error'](a4_0x8a6c57['dim'](_0x347c84(0xdf))),0x1;const _0x307116=await confirmKey(_0x347c84(0xe8)+(_0x1b9b43+_0x3dfc52)+_0x347c84(0xed));if(!_0x307116)return console[_0x347c84(0x144)](a4_0x8a6c57[_0x347c84(0xf9)](_0x347c84(0x163)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x4e3c2e}=await withSpinner(_0x347c84(0x115),()=>_0x2c59a1['llm'][_0x347c84(0xc2)](_0x222342,{'force':_0x2f96fd})),_0x193a8b=_0x4e3c2e[_0x347c84(0x111)]['agents'][_0x347c84(0x113)]>0x0||_0x4e3c2e[_0x347c84(0x111)][_0x347c84(0xf4)][_0x347c84(0x113)]>0x0||_0x4e3c2e[_0x347c84(0x111)]['textKnowledgeBases'][_0x347c84(0x113)]>0x0||_0x4e3c2e[_0x347c84(0x111)][_0x347c84(0xe0)][_0x347c84(0x113)]>0x0;if(_0x193a8b){console[_0x347c84(0x144)](a4_0x8a6c57[_0x347c84(0xf9)](_0x347c84(0xe7))),console['log'](),console[_0x347c84(0x144)](a4_0x8a6c57['red'](_0x347c84(0x10b)));for(const _0x1f7a86 of _0x4e3c2e[_0x347c84(0x11a)]){_0x1f7a86[_0x347c84(0xeb)]===_0x347c84(0x139)&&console[_0x347c84(0x144)](a4_0x8a6c57[_0x347c84(0xbe)](_0x347c84(0xde)+_0x1f7a86[_0x347c84(0x14c)]+_0x347c84(0x10a)+_0x1f7a86[_0x347c84(0x139)]));}for(const _0x3ae950 of _0x4e3c2e[_0x347c84(0xf4)]){_0x3ae950['action']===_0x347c84(0x139)&&console[_0x347c84(0x144)](a4_0x8a6c57['red'](_0x347c84(0xe2)+_0x3ae950[_0x347c84(0x12b)]+_0x347c84(0x10a)+_0x3ae950['error']));}for(const _0x3ebed5 of _0x4e3c2e[_0x347c84(0x143)]){_0x3ebed5[_0x347c84(0xeb)]===_0x347c84(0x139)&&console[_0x347c84(0x144)](a4_0x8a6c57[_0x347c84(0xbe)](_0x347c84(0x118)+_0x3ebed5['name']+_0x347c84(0x10a)+_0x3ebed5[_0x347c84(0x139)]));}for(const _0x29cadd of _0x4e3c2e[_0x347c84(0xe0)]){_0x29cadd[_0x347c84(0xeb)]===_0x347c84(0x139)&&console['log'](a4_0x8a6c57[_0x347c84(0xbe)]('\x20\x20Prompt\x20\x22'+_0x29cadd[_0x347c84(0x12b)]+'\x22:\x20'+_0x29cadd[_0x347c84(0x139)]));}for(const _0x568055 of _0x4e3c2e[_0x347c84(0x162)]){_0x568055[_0x347c84(0xeb)]===_0x347c84(0x139)&&console[_0x347c84(0x144)](a4_0x8a6c57['red'](_0x347c84(0xc5)+_0x568055[_0x347c84(0x12b)]+_0x347c84(0x10a)+_0x568055['error']));}return 0x1;}console[_0x347c84(0x144)](a4_0x8a6c57[_0x347c84(0x150)](_0x347c84(0xe4)+(_0x1b9b43+_0x3dfc52)+_0x347c84(0x104)+_0x4e3c2e[_0x347c84(0x103)]+'\x27'));const _0x469833=getLLMProjectUrl(_0xe30d9d,_0x4e3c2e[_0x347c84(0x136)]);return console[_0x347c84(0x144)]('Project:\x20'+a4_0x8a6c57['cyan'](_0x469833)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x218a66=a5_0x50d7;(function(_0x3c73ff,_0x1454e0){const _0x3dd1ed=a5_0x50d7,_0x199b7c=_0x3c73ff();while(!![]){try{const _0x3d4639=parseInt(_0x3dd1ed(0x236))/0x1+-parseInt(_0x3dd1ed(0x22e))/0x2*(parseInt(_0x3dd1ed(0x209))/0x3)+parseInt(_0x3dd1ed(0x21b))/0x4+parseInt(_0x3dd1ed(0x1d3))/0x5*(parseInt(_0x3dd1ed(0x257))/0x6)+-parseInt(_0x3dd1ed(0x243))/0x7*(-parseInt(_0x3dd1ed(0x205))/0x8)+parseInt(_0x3dd1ed(0x211))/0x9+-parseInt(_0x3dd1ed(0x24c))/0xa;if(_0x3d4639===_0x1454e0)break;else _0x199b7c['push'](_0x199b7c['shift']());}catch(_0x386f2a){_0x199b7c['push'](_0x199b7c['shift']());}}}(a5_0x2ee9,0xb8655));import*as a5_0x3895a8 from'node:fs';import*as a5_0x4c929d from'node:path';import a5_0xbb67a4 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x2ee9(){const _0x341c42=['add','Re-evaluation\x20Summary','filter','resolveAgentId','length','...\x20','tsv','✗\x20FAIL:\x20','no_tests','✗\x20ERROR:\x20','resolve','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agentName','projectDir','808EHloSL','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','resolveProjectId','Errors:\x20\x20\x20','145974wNQfqP','/<agent-name>','executeReeval','red','Re-evaluating...','✓\x20PASS:\x20','dim','site','1531476gEqWPb','\x20(new)','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval',':\x20Sending\x20user\x20input...','multiple_agents','Passed:\x20\x20\x20','basename','ERROR','Either\x20switch\x20to\x20the\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','5288984iPjRea','utf-8','white','\x22,\x20but\x20current\x20site\x20is\x20\x22','Test\x20Configuration:','Total:\x20\x20\x20\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','output','existsSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','found','jsonl','FAIL','now','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x201/','Test\x20Summary','repeat','Round\x20','62fQjfjX','cyan','Evaluating\x20response...','tests','includes','Site:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','289217ieaHBE','No\x20tests\x20have\x20tags\x20defined.','join','...','\x20(cached)','size','push','\x20\x20Conversation:\x20','map','projectName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','toISOString','\x20\x20Evaluating...\x20','100856RCjBdt','no_local_folder','forEach','Error:\x20No\x20previous\x20test\x20run\x20found.','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','eval','llmProject','18002650zZjYsG','Run\x20\x27tdx\x20agent\x20pull\x20','not\x20found','\x22:\x20','split','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','json','\x20\x20Site:\x20','rounds','Available\x20tags:\x20','table','4962678mrWQJu','conversation_url','testYmlPath','stop','404','Output\x20written\x20to:\x20','reason','toLowerCase','description','Re-evaluating\x20','no_context','llm','5FvTOIr','context','log','verbose','No\x20tests\x20found\x20matching:\x20','conversations','testName','Error\x20writing\x20output\x20file:\x20','Agent:\x20','agent','source','⚠\x20SKIPPED:\x20','tags','yellow','message','status','text','Re-evaluating\x20cached\x20test\x20run...','has','name','New\x20tests\x20to\x20execute:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','reeval','\x20\x20Round\x20','PASS','Project\x20path:\x20','\x20-\x20','start','green','agentDirs','find','Conversation\x20URL:\x20','Failed:\x20\x20\x20','\x20\x20Project:\x20','Tests\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'];a5_0x2ee9=function(){return _0x341c42;};return a5_0x2ee9();}function a5_0x50d7(_0x50210a,_0x52ef95){_0x50210a=_0x50210a-0x1d3;const _0x2ee971=a5_0x2ee9();let _0x50d78d=_0x2ee971[_0x50210a];return _0x50d78d;}export class AgentTestCommand extends BaseCommand{['name']='agent:test';[a5_0x218a66(0x25f)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0xf2ae35){const _0x359cae=a5_0x218a66,{options:_0x299263,args:_0x134629,tdx:_0x37daa8}=_0xf2ae35,_0x2ecbb6=_0x134629[0x0]||'.',_0x53e934=_0x299263['dryRun'],_0x41c8a4=_0x299263,_0x270141=_0x41c8a4[_0x359cae(0x24a)]===![],_0x2b8edd=_0x41c8a4[_0x359cae(0x1e9)],_0x39e656=_0x41c8a4['name'],_0x1f68a8=_0x41c8a4[_0x359cae(0x1df)],_0x1096eb=_0x299263[_0x359cae(0x210)],_0x5e0167=_0x41c8a4[_0x359cae(0x222)];if(_0x2b8edd&&_0x270141)return console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x213))),0x1;let _0x2e51a6=_0x359cae(0x256);if(_0x41c8a4[_0x359cae(0x252)])_0x2e51a6=_0x359cae(0x252);else{if(_0x41c8a4[_0x359cae(0x226)])_0x2e51a6='jsonl';else{if(_0x41c8a4[_0x359cae(0x1fd)])_0x2e51a6=_0x359cae(0x1fd);else{if(_0x41c8a4[_0x359cae(0x256)])_0x2e51a6=_0x359cae(0x256);}}}const _0x4b5e71=_0x41c8a4[_0x359cae(0x24b)];let _0x3d5287=_0x2ecbb6;const _0x2db542=a5_0x3895a8[_0x359cae(0x223)](_0x2ecbb6),_0x4dc245=_0x2ecbb6==='.';if(!_0x2db542||_0x4dc245){const _0x32e6a2=resolveProjectFromContext(_0x2ecbb6,_0x4b5e71,{'requireFile':'test.yml'});if(_0x32e6a2[_0x359cae(0x225)])_0x3d5287=_0x32e6a2[_0x359cae(0x204)],_0x32e6a2[_0x359cae(0x1dd)]===_0x359cae(0x1d4)&&console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)]('Using\x20agent:\x20'+_0x3d5287));else switch(_0x32e6a2[_0x359cae(0x25d)]){case _0x359cae(0x261):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x32e6a2[_0x359cae(0x1e1)])),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)]('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x359cae(0x1d5)](_0x359cae(0x1e8)),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x359cae(0x221));return 0x1;case _0x359cae(0x244):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x32e6a2[_0x359cae(0x1e1)])),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x359cae(0x24d)+_0x32e6a2[_0x359cae(0x24b)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x359cae(0x215):{const _0x3977be=a5_0x4c929d[_0x359cae(0x217)](_0x32e6a2[_0x359cae(0x204)]);console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x240)+_0x32e6a2[_0x359cae(0x24b)]+'\x22:'));for(const _0x2a66a5 of _0x32e6a2[_0x359cae(0x1f0)]){console[_0x359cae(0x1d5)]('\x20\x20-\x20'+_0x2a66a5);}return console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3977be+_0x359cae(0x20a)),0x1;}case _0x359cae(0x1ff):console['log'](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x206)+_0x32e6a2[_0x359cae(0x24b)]+'\x22.')),console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x1ec)+_0x32e6a2['projectDir'])),console['log'](),console[_0x359cae(0x1d5)](_0x359cae(0x224));return 0x1;}}const {definition:_0x114444,agentInfo:_0x338b51}=parseTestFile(_0x3d5287);let _0x49ee94=_0x114444[_0x359cae(0x231)];if(_0x39e656){const _0x471a3f=_0x39e656[_0x359cae(0x250)](',')[_0x359cae(0x23e)](_0x5d9158=>_0x5d9158['trim']());_0x49ee94=_0x114444['tests']['filter'](_0x1b31fe=>_0x471a3f[_0x359cae(0x232)](_0x1b31fe[_0x359cae(0x1e6)]));if(_0x49ee94['length']===0x0)return console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x1d7)+_0x39e656)),console[_0x359cae(0x1d5)](a5_0xbb67a4['dim']('Available\x20tests:\x20'+_0x114444[_0x359cae(0x231)][_0x359cae(0x23e)](_0x59161e=>_0x59161e[_0x359cae(0x1e6)])[_0x359cae(0x238)](',\x20'))),0x1;}if(_0x1f68a8){const _0x16f725=_0x1f68a8[_0x359cae(0x250)](',')[_0x359cae(0x23e)](_0x3e3f75=>_0x3e3f75['trim']()[_0x359cae(0x25e)]());_0x49ee94=_0x49ee94[_0x359cae(0x1f9)](_0xe7d7c3=>_0xe7d7c3[_0x359cae(0x1df)]?.['some'](_0x21644c=>_0x16f725[_0x359cae(0x232)](_0x21644c[_0x359cae(0x25e)]())));if(_0x49ee94[_0x359cae(0x1fb)]===0x0){console['log'](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x235)+_0x1f68a8));const _0x119811=new Set();return _0x114444[_0x359cae(0x231)][_0x359cae(0x245)](_0x534d2e=>_0x534d2e[_0x359cae(0x1df)]?.['forEach'](_0x157eb0=>_0x119811[_0x359cae(0x1f7)](_0x157eb0))),_0x119811[_0x359cae(0x23b)]>0x0?console['log'](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x255)+[..._0x119811][_0x359cae(0x238)](',\x20'))):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x237))),0x1;}}if(_0x2b8edd)return this[_0x359cae(0x20b)](_0xf2ae35,{'definition':{'tests':_0x49ee94},'agentInfo':_0x338b51,'outputFormat':_0x2e51a6,'outputFile':_0x5e0167,'testNames':_0x39e656});if(_0x53e934){console[_0x359cae(0x1d5)](a5_0xbb67a4['cyan'](_0x359cae(0x21f))),console[_0x359cae(0x1d5)](_0x359cae(0x253)+a5_0xbb67a4['white'](_0x1096eb)),console[_0x359cae(0x1d5)](_0x359cae(0x1f4)+a5_0xbb67a4[_0x359cae(0x21d)](_0x338b51[_0x359cae(0x23f)])),console[_0x359cae(0x1d5)]('\x20\x20Agent:\x20'+a5_0xbb67a4['white'](_0x338b51[_0x359cae(0x203)])),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x359cae(0x1f5)+a5_0xbb67a4[_0x359cae(0x21d)](_0x49ee94[_0x359cae(0x1fb)]));for(let _0x27a20e=0x0;_0x27a20e<_0x49ee94[_0x359cae(0x1fb)];_0x27a20e++){const _0x3d311c=_0x49ee94[_0x27a20e],_0x330246=_0x3d311c[_0x359cae(0x254)][_0x359cae(0x1fb)]===0x1?'round':'rounds',_0x2f7972=_0x3d311c[_0x359cae(0x1df)]?.[_0x359cae(0x1fb)]?'\x20['+_0x3d311c['tags'][_0x359cae(0x238)](',\x20')+']':'';console[_0x359cae(0x1d5)]('\x20\x20'+(_0x27a20e+0x1)+'.\x20'+a5_0xbb67a4[_0x359cae(0x21d)](_0x3d311c['name'])+'\x20('+_0x3d311c['rounds'][_0x359cae(0x1fb)]+'\x20'+_0x330246+')'+a5_0xbb67a4[_0x359cae(0x20f)](_0x2f7972));}return 0x0;}let _0x42c564,_0x1f1d53;try{_0x42c564=await _0x37daa8[_0x359cae(0x262)][_0x359cae(0x207)](_0x338b51[_0x359cae(0x23f)]);}catch(_0x2d57fa){const _0x54e453=_0x2d57fa instanceof Error?_0x2d57fa[_0x359cae(0x1e1)]:String(_0x2d57fa);return _0x54e453[_0x359cae(0x232)](_0x359cae(0x25b))||_0x54e453[_0x359cae(0x25e)]()['includes'](_0x359cae(0x24e))?console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x249)+_0x338b51[_0x359cae(0x23f)])):console[_0x359cae(0x1d5)](a5_0xbb67a4['red'](_0x359cae(0x202)+_0x338b51[_0x359cae(0x23f)]+_0x359cae(0x24f)+_0x54e453)),0x1;}try{_0x1f1d53=await _0x37daa8[_0x359cae(0x262)][_0x359cae(0x1fa)](_0x338b51[_0x359cae(0x203)],_0x42c564);}catch(_0x1d9ec3){const _0x3d9f3e=_0x1d9ec3 instanceof Error?_0x1d9ec3[_0x359cae(0x1e1)]:String(_0x1d9ec3);return _0x3d9f3e[_0x359cae(0x232)]('404')||_0x3d9f3e[_0x359cae(0x25e)]()[_0x359cae(0x232)](_0x359cae(0x24e))?console[_0x359cae(0x1d5)](a5_0xbb67a4['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x338b51[_0x359cae(0x203)])):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x1f6)+_0x338b51[_0x359cae(0x203)]+_0x359cae(0x24f)+_0x3d9f3e)),0x1;}let _0x5b2f22;if(!_0x270141)try{_0x5b2f22=await setupEvaluatorAgent(_0x37daa8[_0x359cae(0x262)],_0x299263[_0x359cae(0x1d6)]);}catch(_0x587669){const _0x5b816a=_0x587669 instanceof Error?_0x587669[_0x359cae(0x1e1)]:String(_0x587669);return console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x248)+_0x5b816a)),0x1;}console[_0x359cae(0x1d5)](a5_0xbb67a4['cyan']('Running\x20agent\x20tests...')),console[_0x359cae(0x1d5)](_0x359cae(0x233)+a5_0xbb67a4[_0x359cae(0x21d)](_0x1096eb)),console['log'](_0x359cae(0x1db)+a5_0xbb67a4[_0x359cae(0x21d)](_0x338b51[_0x359cae(0x23f)]+'/'+_0x338b51[_0x359cae(0x203)])),console[_0x359cae(0x1d5)]();const _0x42c146=[],_0x56ae5a=[],_0x745ba=Date[_0x359cae(0x228)]();for(let _0x50df2a=0x0;_0x50df2a<_0x49ee94[_0x359cae(0x1fb)];_0x50df2a++){const _0x4356d4=_0x49ee94[_0x50df2a];_0x49ee94['length']>0x1?console[_0x359cae(0x1d5)]('Test\x20'+(_0x50df2a+0x1)+'/'+_0x49ee94['length']+':\x20'+a5_0xbb67a4[_0x359cae(0x21d)](_0x4356d4[_0x359cae(0x1e6)])):console['log']('Running\x20test:\x20'+a5_0xbb67a4['white'](_0x4356d4[_0x359cae(0x1e6)]));const _0x2fde68=createCommandSpinner('Round\x201/'+_0x4356d4[_0x359cae(0x254)]['length']+':\x20Sending\x20user\x20input...');_0x2fde68[_0x359cae(0x1ee)]();try{const {result:_0x2fea1f,conversation:_0x2f3faf}=await runTest(_0x37daa8[_0x359cae(0x262)],_0x4356d4,{'agentId':_0x1f1d53,'projectId':_0x42c564,'site':_0x1096eb,'noEval':_0x270141,'evaluatorId':_0x5b2f22,'onRoundStart':(_0x3700e2,_0xb9e456)=>{const _0x53c28a=_0x359cae;_0x2fde68[_0x53c28a(0x1e3)]=_0x53c28a(0x22d)+(_0x3700e2+0x1)+'/'+_0xb9e456+_0x53c28a(0x214);},'onRoundComplete':(_0x2ad0ad,_0x16f39e,_0x4ef1f8)=>{const _0x1da93a=_0x359cae,_0x4ee079=formatElapsed(_0x16f39e);_0x4ef1f8?console[_0x1da93a(0x1d5)](_0x1da93a(0x1ea)+(_0x2ad0ad+0x1)+'/'+_0x4356d4[_0x1da93a(0x254)][_0x1da93a(0x1fb)]+_0x1da93a(0x1fc)+a5_0xbb67a4[_0x1da93a(0x1ef)]('✓')+'\x20('+_0x4ee079+')'):console['log']('\x20\x20Round\x20'+(_0x2ad0ad+0x1)+'/'+_0x4356d4[_0x1da93a(0x254)][_0x1da93a(0x1fb)]+_0x1da93a(0x1fc)+a5_0xbb67a4['red']('✗'));},'onEvaluationStart':()=>{const _0x3161e1=_0x359cae;_0x2fde68['text']=_0x3161e1(0x230);},'onEvaluationComplete':_0x57b997=>{const _0x1e96e7=_0x359cae,_0x56432d=formatElapsed(_0x57b997);console[_0x1e96e7(0x1d5)](_0x1e96e7(0x242)+a5_0xbb67a4[_0x1e96e7(0x1ef)]('✓')+'\x20('+_0x56432d+')');}});_0x2fde68[_0x359cae(0x25a)](),_0x42c146[_0x359cae(0x23c)](_0x2fea1f),_0x56ae5a[_0x359cae(0x23c)](_0x2f3faf);if(_0x2fea1f[_0x359cae(0x1e2)]===_0x359cae(0x1eb))console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1ef)]('✓\x20PASS:\x20'+_0x2fea1f['reason']));else _0x2fea1f['status']===_0x359cae(0x227)?console['log'](a5_0xbb67a4['red'](_0x359cae(0x1fe)+_0x2fea1f[_0x359cae(0x25d)])):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x200)+_0x2fea1f[_0x359cae(0x25d)]));_0x2fea1f[_0x359cae(0x258)]&&console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x1f2)+_0x2fea1f[_0x359cae(0x258)])),console[_0x359cae(0x1d5)]();}catch(_0x536446){_0x2fde68[_0x359cae(0x25a)]();const _0x26e9cf=_0x536446 instanceof Error?_0x536446[_0x359cae(0x1e1)]:String(_0x536446);console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x200)+_0x26e9cf)),console[_0x359cae(0x1d5)](),_0x42c146[_0x359cae(0x23c)]({'name':_0x4356d4[_0x359cae(0x1e6)],'status':_0x359cae(0x218),'reason':_0x26e9cf,'timestamp':new Date()[_0x359cae(0x241)](),'duration_ms':0x0});}}const _0x162d89=Date[_0x359cae(0x228)]()-_0x745ba,_0x51abf4=_0x42c146[_0x359cae(0x1f9)](_0x3a6814=>_0x3a6814['status']===_0x359cae(0x1eb))[_0x359cae(0x1fb)],_0x14a6a8=_0x42c146[_0x359cae(0x1f9)](_0x2a5f67=>_0x2a5f67[_0x359cae(0x1e2)]==='FAIL')[_0x359cae(0x1fb)],_0x2917e8=_0x42c146[_0x359cae(0x1f9)](_0x3b02e1=>_0x3b02e1['status']==='ERROR')['length'];console[_0x359cae(0x1d5)]('━'['repeat'](0x3c)),console[_0x359cae(0x1d5)](_0x359cae(0x22b)),console[_0x359cae(0x1d5)]('━'[_0x359cae(0x22c)](0x3c)),console[_0x359cae(0x1d5)](_0x359cae(0x220)+_0x42c146[_0x359cae(0x1fb)]),console['log'](_0x359cae(0x216)+a5_0xbb67a4[_0x359cae(0x1ef)](_0x51abf4)),console[_0x359cae(0x1d5)](_0x359cae(0x1f3)+a5_0xbb67a4[_0x359cae(0x20c)](_0x14a6a8));_0x2917e8>0x0&&console[_0x359cae(0x1d5)]('Errors:\x20\x20\x20'+a5_0xbb67a4[_0x359cae(0x20c)](_0x2917e8));console[_0x359cae(0x1d5)]('Duration:\x20'+formatElapsed(_0x162d89)),console[_0x359cae(0x1d5)]('━'[_0x359cae(0x22c)](0x3c));const _0x488404=_0x42c146[_0x359cae(0x1f9)](_0x502d3b=>_0x502d3b['status']!==_0x359cae(0x1eb));if(_0x488404[_0x359cae(0x1fb)]>0x0){console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)]('Failed\x20Tests:');for(const _0x46a09b of _0x488404){const _0x58e0c6=a5_0xbb67a4['red']('✗'),_0x34632b=_0x46a09b[_0x359cae(0x25d)][_0x359cae(0x1fb)]>0x32?_0x46a09b[_0x359cae(0x25d)]['substring'](0x0,0x32)+_0x359cae(0x239):_0x46a09b[_0x359cae(0x25d)];console[_0x359cae(0x1d5)]('\x20\x20'+_0x58e0c6+'\x20'+_0x46a09b[_0x359cae(0x1e6)]+':\x20'+_0x34632b);}}const _0x584b92={'summary':{'total':_0x42c146['length'],'passed':_0x51abf4,'failed':_0x14a6a8,'errors':_0x2917e8>0x0?_0x2917e8:undefined,'duration_ms':_0x162d89},'tests':_0x42c146,'agent':{'project':_0x338b51[_0x359cae(0x23f)],'name':_0x338b51['agentName'],'site':_0x1096eb},'timestamp':new Date(_0x745ba)[_0x359cae(0x241)]()};try{const _0x5d8edf=buildCachedTestRun(_0x56ae5a,{'site':_0x1096eb,'projectId':_0x42c564,'projectName':_0x338b51['projectName'],'agentId':_0x1f1d53,'agentName':_0x338b51[_0x359cae(0x203)],'testYmlPath':a5_0x4c929d[_0x359cae(0x201)](_0x338b51[_0x359cae(0x259)])});saveLastTestRun(_0x5d8edf);}catch{}if(_0x2e51a6!=='table'||_0x5e0167){const _0x1a9789=formatResults(_0x584b92,_0x2e51a6);if(_0x5e0167)try{a5_0x3895a8['writeFileSync'](_0x5e0167,_0x1a9789,_0x359cae(0x21c)),console['log'](),console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)]('Output\x20written\x20to:\x20'+_0x5e0167));}catch(_0x1ce855){return console['log'](),console['log'](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x1da)+_0x1ce855)),0x1;}else console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x1a9789);}return _0x488404['length']>0x0?0x1:0x0;}async[a5_0x218a66(0x20b)](_0x12685a,_0x447b21){const _0x3f4080=a5_0x218a66,{options:_0x14b5ee,tdx:_0x46b2b8}=_0x12685a,{definition:_0x51909e,agentInfo:_0x3861f5,outputFormat:_0x56d2f3,outputFile:_0x18789c}=_0x447b21,_0x335e55=_0x14b5ee[_0x3f4080(0x210)],_0x2ea448=loadLastTestRun();if(!_0x2ea448)return console[_0x3f4080(0x1d5)](a5_0xbb67a4['red'](_0x3f4080(0x246))),console['log'](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x247))),0x1;if(_0x2ea448[_0x3f4080(0x1dc)]['agentName']!==_0x3861f5[_0x3f4080(0x203)])return console[_0x3f4080(0x1d5)](a5_0xbb67a4['red'](_0x3f4080(0x234)+_0x2ea448[_0x3f4080(0x1dc)][_0x3f4080(0x203)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x3861f5[_0x3f4080(0x203)]+'\x22.')),console['log'](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x251))),0x1;const _0x5aa76f=new Set(_0x2ea448[_0x3f4080(0x1d8)][_0x3f4080(0x23e)](_0x4da8ec=>_0x4da8ec[_0x3f4080(0x1d9)])),_0x3a33cd=_0x51909e['tests'][_0x3f4080(0x1f9)](_0x28a38e=>!_0x5aa76f[_0x3f4080(0x1e5)](_0x28a38e[_0x3f4080(0x1e6)]));if(_0x3a33cd['length']>0x0&&_0x2ea448['site']!==_0x335e55)return console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x229)+_0x2ea448[_0x3f4080(0x210)]+_0x3f4080(0x21e)+_0x335e55+'\x22.')),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x219)+_0x2ea448[_0x3f4080(0x210)]+_0x3f4080(0x21a))),0x1;const _0xcde5bd=_0x51909e[_0x3f4080(0x231)]['filter'](_0x2bc678=>_0x5aa76f[_0x3f4080(0x1e5)](_0x2bc678[_0x3f4080(0x1e6)])),_0x5c67cc=_0x3a33cd;let _0x36bf3a;try{_0x36bf3a=await setupEvaluatorAgent(_0x46b2b8[_0x3f4080(0x262)],_0x14b5ee[_0x3f4080(0x1d6)]);}catch(_0x1fb901){const _0xc2c88a=_0x1fb901 instanceof Error?_0x1fb901[_0x3f4080(0x1e1)]:String(_0x1fb901);return console[_0x3f4080(0x1d5)](a5_0xbb67a4['red'](_0x3f4080(0x248)+_0xc2c88a)),0x1;}console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x22f)](_0x3f4080(0x1e4))),console[_0x3f4080(0x1d5)]('Cached\x20run\x20from:\x20'+a5_0xbb67a4[_0x3f4080(0x21d)](_0x2ea448['timestamp'])),console[_0x3f4080(0x1d5)](_0x3f4080(0x1db)+a5_0xbb67a4[_0x3f4080(0x21d)](_0x2ea448['agent'][_0x3f4080(0x23f)]+'/'+_0x2ea448[_0x3f4080(0x1dc)]['agentName']));_0x5c67cc[_0x3f4080(0x1fb)]>0x0&&console[_0x3f4080(0x1d5)](_0x3f4080(0x1e7)+a5_0xbb67a4['yellow'](_0x5c67cc[_0x3f4080(0x1fb)]));console[_0x3f4080(0x1d5)]();const _0x5b78af=[],_0x107377=Date['now'](),_0x34c33e=createCommandSpinner(_0x3f4080(0x20d));if(_0xcde5bd[_0x3f4080(0x1fb)]>0x0)try{const _0x1423ab=await reevaluateFromCache(_0x46b2b8[_0x3f4080(0x262)],_0x2ea448,{'tests':_0xcde5bd},{'evaluatorId':_0x36bf3a,'onTestStart':(_0x435feb,_0x32ffb8,_0x26c64a)=>{const _0x4767a2=_0x3f4080;_0x34c33e[_0x4767a2(0x1e3)]=_0x4767a2(0x260)+(_0x32ffb8+0x1)+'/'+_0x26c64a+':\x20'+_0x435feb+_0x4767a2(0x239);if(!_0x34c33e['isSpinning'])_0x34c33e['start']();},'onTestComplete':(_0x18172a,_0x58a0a2)=>{const _0x2a0174=_0x3f4080;_0x34c33e[_0x2a0174(0x25a)]();if(_0x58a0a2[_0x2a0174(0x1e2)]===_0x2a0174(0x1eb))console[_0x2a0174(0x1d5)](a5_0xbb67a4[_0x2a0174(0x1ef)](_0x2a0174(0x20e)+_0x18172a)+a5_0xbb67a4['dim'](_0x2a0174(0x23a)));else _0x58a0a2[_0x2a0174(0x1e2)]===_0x2a0174(0x227)?console['log'](a5_0xbb67a4['red']('✗\x20FAIL:\x20'+_0x18172a+_0x2a0174(0x1ed)+_0x58a0a2['reason'])+a5_0xbb67a4[_0x2a0174(0x20f)](_0x2a0174(0x23a))):console['log'](a5_0xbb67a4[_0x2a0174(0x20c)]('✗\x20ERROR:\x20'+_0x18172a+_0x2a0174(0x1ed)+_0x58a0a2[_0x2a0174(0x25d)]));_0x58a0a2[_0x2a0174(0x258)]&&console[_0x2a0174(0x1d5)](a5_0xbb67a4[_0x2a0174(0x20f)]('\x20\x20Conversation:\x20'+_0x58a0a2[_0x2a0174(0x258)])),_0x5b78af[_0x2a0174(0x23c)](_0x58a0a2);},'onTestSkipped':(_0x8465d1,_0x126e76)=>{const _0x55834e=_0x3f4080;_0x34c33e[_0x55834e(0x25a)](),console[_0x55834e(0x1d5)](a5_0xbb67a4['yellow'](_0x55834e(0x1de)+_0x8465d1+_0x55834e(0x1ed)+_0x126e76));}});for(const _0x1953fe of _0x1423ab){!_0x5b78af[_0x3f4080(0x1f1)](_0x2ddded=>_0x2ddded[_0x3f4080(0x1e6)]===_0x1953fe[_0x3f4080(0x1e6)])&&_0x5b78af['push'](_0x1953fe);}}catch(_0x2ea1e9){_0x34c33e['stop']();const _0x2cb513=_0x2ea1e9 instanceof Error?_0x2ea1e9[_0x3f4080(0x1e1)]:String(_0x2ea1e9);return console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x2cb513)),0x1;}_0x34c33e['stop']();if(_0x5c67cc[_0x3f4080(0x1fb)]>0x0){console[_0x3f4080(0x1d5)](),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x22f)]('Executing\x20new\x20tests...'));const {projectId:_0x51a750,agentId:_0x6d2a74}=_0x2ea448[_0x3f4080(0x1dc)];for(const _0x289d76 of _0x5c67cc){console[_0x3f4080(0x1d5)]('Running:\x20'+a5_0xbb67a4[_0x3f4080(0x21d)](_0x289d76[_0x3f4080(0x1e6)]));const _0x3a434c=createCommandSpinner(_0x3f4080(0x22a)+_0x289d76[_0x3f4080(0x254)][_0x3f4080(0x1fb)]+_0x3f4080(0x214));_0x3a434c['start']();try{const {result:_0x3deb36}=await runTest(_0x46b2b8['llm'],_0x289d76,{'agentId':_0x6d2a74,'projectId':_0x51a750,'site':_0x2ea448[_0x3f4080(0x210)],'noEval':![],'evaluatorId':_0x36bf3a,'onRoundStart':(_0x13d922,_0x687a60)=>{const _0x1c2542=_0x3f4080;_0x3a434c[_0x1c2542(0x1e3)]=_0x1c2542(0x22d)+(_0x13d922+0x1)+'/'+_0x687a60+_0x1c2542(0x214);},'onRoundComplete':(_0xb8c4ad,_0x589cd5,_0x93f23b)=>{const _0x3dd7a4=_0x3f4080,_0x51cc32=formatElapsed(_0x589cd5);_0x93f23b?console[_0x3dd7a4(0x1d5)](_0x3dd7a4(0x1ea)+(_0xb8c4ad+0x1)+'/'+_0x289d76[_0x3dd7a4(0x254)]['length']+_0x3dd7a4(0x1fc)+a5_0xbb67a4[_0x3dd7a4(0x1ef)]('✓')+'\x20('+_0x51cc32+')'):console[_0x3dd7a4(0x1d5)](_0x3dd7a4(0x1ea)+(_0xb8c4ad+0x1)+'/'+_0x289d76[_0x3dd7a4(0x254)][_0x3dd7a4(0x1fb)]+'...\x20'+a5_0xbb67a4[_0x3dd7a4(0x20c)]('✗'));},'onEvaluationStart':()=>{const _0x55c040=_0x3f4080;_0x3a434c[_0x55c040(0x1e3)]=_0x55c040(0x230);},'onEvaluationComplete':_0x32a21a=>{const _0x41f52f=_0x3f4080,_0x38cb3b=formatElapsed(_0x32a21a);console[_0x41f52f(0x1d5)]('\x20\x20Evaluating...\x20'+a5_0xbb67a4[_0x41f52f(0x1ef)]('✓')+'\x20('+_0x38cb3b+')');}});_0x3a434c[_0x3f4080(0x25a)](),_0x5b78af[_0x3f4080(0x23c)](_0x3deb36);if(_0x3deb36[_0x3f4080(0x1e2)]===_0x3f4080(0x1eb))console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x1ef)](_0x3f4080(0x20e)+_0x3deb36['reason'])+a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x212)));else _0x3deb36[_0x3f4080(0x1e2)]==='FAIL'?console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)](_0x3f4080(0x1fe)+_0x3deb36[_0x3f4080(0x25d)])+a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x212))):console['log'](a5_0xbb67a4[_0x3f4080(0x20c)](_0x3f4080(0x200)+_0x3deb36[_0x3f4080(0x25d)]));_0x3deb36[_0x3f4080(0x258)]&&console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x23d)+_0x3deb36['conversation_url']));}catch(_0x3a41b3){_0x3a434c[_0x3f4080(0x25a)]();const _0x4c4339=_0x3a41b3 instanceof Error?_0x3a41b3['message']:String(_0x3a41b3);console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)]('✗\x20ERROR:\x20'+_0x4c4339)),_0x5b78af[_0x3f4080(0x23c)]({'name':_0x289d76[_0x3f4080(0x1e6)],'status':_0x3f4080(0x218),'reason':_0x4c4339,'timestamp':new Date()[_0x3f4080(0x241)](),'duration_ms':0x0});}}}console['log']();const _0x1c9b12=Date[_0x3f4080(0x228)]()-_0x107377,_0x4e83a5=_0x5b78af['filter'](_0x351aa0=>_0x351aa0[_0x3f4080(0x1e2)]==='PASS')['length'],_0x4b64fe=_0x5b78af[_0x3f4080(0x1f9)](_0x4fa10d=>_0x4fa10d[_0x3f4080(0x1e2)]==='FAIL')['length'],_0x3292ed=_0x5b78af[_0x3f4080(0x1f9)](_0x360db5=>_0x360db5[_0x3f4080(0x1e2)]===_0x3f4080(0x218))[_0x3f4080(0x1fb)];console[_0x3f4080(0x1d5)]('━'['repeat'](0x3c)),console[_0x3f4080(0x1d5)](_0x3f4080(0x1f8)),console[_0x3f4080(0x1d5)]('━'[_0x3f4080(0x22c)](0x3c)),console[_0x3f4080(0x1d5)](_0x3f4080(0x220)+_0x5b78af[_0x3f4080(0x1fb)]),console[_0x3f4080(0x1d5)]('Passed:\x20\x20\x20'+a5_0xbb67a4[_0x3f4080(0x1ef)](_0x4e83a5)),console[_0x3f4080(0x1d5)](_0x3f4080(0x1f3)+a5_0xbb67a4[_0x3f4080(0x20c)](_0x4b64fe));_0x3292ed>0x0&&console['log'](_0x3f4080(0x208)+a5_0xbb67a4['red'](_0x3292ed));console[_0x3f4080(0x1d5)]('Duration:\x20'+formatElapsed(_0x1c9b12)),console['log']('━'['repeat'](0x3c));const _0x516f4e={'summary':{'total':_0x5b78af[_0x3f4080(0x1fb)],'passed':_0x4e83a5,'failed':_0x4b64fe,'errors':_0x3292ed>0x0?_0x3292ed:undefined,'duration_ms':_0x1c9b12},'tests':_0x5b78af,'agent':{'project':_0x3861f5['projectName'],'name':_0x3861f5[_0x3f4080(0x203)],'site':_0x335e55},'timestamp':new Date(_0x107377)[_0x3f4080(0x241)]()};if(_0x56d2f3!==_0x3f4080(0x256)||_0x18789c){const _0x4624c2=formatResults(_0x516f4e,_0x56d2f3);if(_0x18789c)try{a5_0x3895a8['writeFileSync'](_0x18789c,_0x4624c2,_0x3f4080(0x21c)),console[_0x3f4080(0x1d5)](),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x25c)+_0x18789c));}catch(_0x314db9){return console['log'](),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)](_0x3f4080(0x1da)+_0x314db9)),0x1;}else console['log'](),console[_0x3f4080(0x1d5)](_0x4624c2);}const _0x1d6526=_0x5b78af[_0x3f4080(0x1f9)](_0x4e28fd=>_0x4e28fd[_0x3f4080(0x1e2)]!==_0x3f4080(0x1eb));return _0x1d6526[_0x3f4080(0x1fb)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x41336d=a5_0x86b8;(function(_0x4f2a84,_0x599294){const _0x132999=a5_0x86b8,_0x44c44c=_0x4f2a84();while(!![]){try{const _0x2788d5=parseInt(_0x132999(0xd7))/0x1*(-parseInt(_0x132999(0x132))/0x2)+parseInt(_0x132999(0x10c))/0x3+-parseInt(_0x132999(0x140))/0x4*(parseInt(_0x132999(0xee))/0x5)+-parseInt(_0x132999(0xe7))/0x6+parseInt(_0x132999(0xfa))/0x7+-parseInt(_0x132999(0x159))/0x8*(-parseInt(_0x132999(0x16a))/0x9)+parseInt(_0x132999(0x11b))/0xa;if(_0x2788d5===_0x599294)break;else _0x44c44c['push'](_0x44c44c['shift']());}catch(_0x476c90){_0x44c44c['push'](_0x44c44c['shift']());}}}(a5_0x12ef,0x31299));import*as a5_0x497534 from'node:fs';import*as a5_0x50a11a from'node:path';import a5_0x1ba83f from'chalk';function a5_0x86b8(_0x38abd1,_0x1d7c9f){_0x38abd1=_0x38abd1-0xd7;const _0x12ef74=a5_0x12ef();let _0x86b8b8=_0x12ef74[_0x38abd1];return _0x86b8b8;}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x12ef(){const _0x5c3dfe=['repeat','isSpinning','Test\x20','1160796KZnXBN','text','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','yellow','output','\x20\x20Round\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','5fJBthO','agentName','\x20\x20Conversation:\x20','white','Executing\x20new\x20tests...','Re-evaluation\x20Summary','find','✗\x20ERROR:\x20','✗\x20FAIL:\x20','start','Running\x20agent\x20tests...','PASS','2254063kgUXhg','Site:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','cyan','jsonl','llm','agent:test','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','writeFileSync','Cached\x20run\x20from:\x20','resolveAgentId','forEach','Output\x20written\x20to:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','dryRun','tsv','Either\x20switch\x20to\x20the\x20\x22','filter','141624vToufN','\x20\x20-\x20','length','llmProject','Duration:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','existsSync','FAIL','Cached\x20run\x20is\x20from\x20site\x20\x22','Project\x20path:\x20','Usage:','...\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Tests\x20found:\x20','5274550LQvnws','rounds','execute','Agent:\x20','includes','\x27\x20to\x20create\x20the\x20folder\x20structure.','conversation_url','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20\x20Project:\x20','Available\x20tags:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','ERROR','no_tests','name','status','stop','join','Error\x20writing\x20output\x20file:\x20','trim','message','Using\x20agent:\x20','found','agentDirs','69294WbfwBh','testYmlPath','No\x20tests\x20have\x20tags\x20defined.','projectName','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20-\x20','Re-evaluating\x20cached\x20test\x20run...','map','⚠\x20SKIPPED:\x20','Failed\x20Tests:','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','tags','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_context','1540744sZmOPA','test.yml','json','Round\x20','Re-evaluating\x20','executeReeval','404','/<agent-name>','utf-8','resolve','Test\x20Summary','dim','\x20(new)','agent','Failed:\x20\x20\x20','Available\x20tests:\x20','\x22:\x20','No\x20tests\x20found\x20with\x20tags:\x20','testName','No\x20tests\x20found\x20matching:\x20','now','Running:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','timestamp','table','8MYXLbB','site','Errors:\x20\x20\x20','verbose','reason','conversations','round','tests','projectDir','add','split','toISOString','\x20\x20Site:\x20','push','red','Re-evaluating...','\x20\x20Evaluating...\x20','2380194ECzkjC','✓\x20PASS:\x20','no_local_folder','Passed:\x20\x20\x20','Total:\x20\x20\x20\x20','Conversation\x20URL:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','description','11QbXILp','basename','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','log','Evaluating\x20response...','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Running\x20test:\x20','toLowerCase','\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',':\x20Sending\x20user\x20input...','green','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Round\x201/'];a5_0x12ef=function(){return _0x5c3dfe;};return a5_0x12ef();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x41336d(0x128)]=a5_0x41336d(0x100);[a5_0x41336d(0x171)]=a5_0x41336d(0x122);async[a5_0x41336d(0x11d)](_0x250458){const _0x3e1921=a5_0x41336d,{options:_0x19d03c,args:_0x574ff5,tdx:_0x2ae726}=_0x250458,_0x550c89=_0x574ff5[0x0]||'.',_0x2ae7bd=_0x19d03c[_0x3e1921(0x108)],_0x2bbaf9=_0x19d03c,_0x3d1392=_0x2bbaf9['eval']===![],_0x58180d=_0x2bbaf9['reeval'],_0x4b591a=_0x2bbaf9[_0x3e1921(0x128)],_0x38673c=_0x2bbaf9[_0x3e1921(0x13d)],_0x2faca7=_0x19d03c['site'],_0x1af459=_0x2bbaf9[_0x3e1921(0xeb)];if(_0x58180d&&_0x3d1392)return console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x167)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0xce3709=_0x3e1921(0x158);if(_0x2bbaf9['json'])_0xce3709=_0x3e1921(0x142);else{if(_0x2bbaf9[_0x3e1921(0xfe)])_0xce3709='jsonl';else{if(_0x2bbaf9[_0x3e1921(0x109)])_0xce3709=_0x3e1921(0x109);else{if(_0x2bbaf9[_0x3e1921(0x158)])_0xce3709=_0x3e1921(0x158);}}}const _0x44a56f=_0x2bbaf9[_0x3e1921(0x10f)];let _0x5753b4=_0x550c89;const _0x2ba712=a5_0x497534[_0x3e1921(0x112)](_0x550c89),_0x43c3e4=_0x550c89==='.';if(!_0x2ba712||_0x43c3e4){const _0x159f0d=resolveProjectFromContext(_0x550c89,_0x44a56f,{'requireFile':_0x3e1921(0x141)});if(_0x159f0d[_0x3e1921(0x130)])_0x5753b4=_0x159f0d['projectDir'],_0x159f0d['source']==='context'&&console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x14b)](_0x3e1921(0x12f)+_0x5753b4));else switch(_0x159f0d[_0x3e1921(0x15d)]){case _0x3e1921(0x13f):console[_0x3e1921(0xda)](a5_0x1ba83f['yellow'](_0x159f0d[_0x3e1921(0x12e)])),console['log'](),console[_0x3e1921(0xda)](_0x3e1921(0x116)),console[_0x3e1921(0xda)](_0x3e1921(0xdf)),console[_0x3e1921(0xda)](_0x3e1921(0x119)),console[_0x3e1921(0xda)](),console[_0x3e1921(0xda)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x3e1921(0x16c):console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0xea)](_0x159f0d[_0x3e1921(0x12e)])),console[_0x3e1921(0xda)](),console[_0x3e1921(0xda)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x159f0d[_0x3e1921(0x10f)]+_0x3e1921(0x120));return 0x1;case'multiple_agents':{const _0x4cfed1=a5_0x50a11a[_0x3e1921(0xd8)](_0x159f0d[_0x3e1921(0x161)]);console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0xea)](_0x3e1921(0x107)+_0x159f0d[_0x3e1921(0x10f)]+'\x22:'));for(const _0x2bb243 of _0x159f0d[_0x3e1921(0x131)]){console[_0x3e1921(0xda)](_0x3e1921(0x10d)+_0x2bb243);}return console[_0x3e1921(0xda)](),console[_0x3e1921(0xda)](_0x3e1921(0x13c)+_0x4cfed1+_0x3e1921(0x147)),0x1;}case _0x3e1921(0x127):console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0xea)](_0x3e1921(0x170)+_0x159f0d[_0x3e1921(0x10f)]+'\x22.')),console['log'](a5_0x1ba83f[_0x3e1921(0x14b)](_0x3e1921(0x115)+_0x159f0d[_0x3e1921(0x161)])),console[_0x3e1921(0xda)](),console[_0x3e1921(0xda)](_0x3e1921(0x13e));return 0x1;}}const {definition:_0x34aad1,agentInfo:_0x10950e}=parseTestFile(_0x5753b4);let _0x5228d1=_0x34aad1[_0x3e1921(0x160)];if(_0x4b591a){const _0x13177c=_0x4b591a['split'](',')[_0x3e1921(0x139)](_0x2bab26=>_0x2bab26['trim']());_0x5228d1=_0x34aad1[_0x3e1921(0x160)]['filter'](_0x41d6a3=>_0x13177c[_0x3e1921(0x11f)](_0x41d6a3[_0x3e1921(0x128)]));if(_0x5228d1[_0x3e1921(0x10e)]===0x0)return console[_0x3e1921(0xda)](a5_0x1ba83f['yellow'](_0x3e1921(0x153)+_0x4b591a)),console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x14b)](_0x3e1921(0x14f)+_0x34aad1[_0x3e1921(0x160)][_0x3e1921(0x139)](_0xd237ed=>_0xd237ed[_0x3e1921(0x128)])[_0x3e1921(0x12b)](',\x20'))),0x1;}if(_0x38673c){const _0xffe57e=_0x38673c[_0x3e1921(0x163)](',')[_0x3e1921(0x139)](_0x34ee4e=>_0x34ee4e[_0x3e1921(0x12d)]()['toLowerCase']());_0x5228d1=_0x5228d1[_0x3e1921(0x10b)](_0x102f59=>_0x102f59[_0x3e1921(0x13d)]?.['some'](_0x57ac45=>_0xffe57e['includes'](_0x57ac45[_0x3e1921(0xde)]())));if(_0x5228d1['length']===0x0){console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0xea)](_0x3e1921(0x151)+_0x38673c));const _0xbbad54=new Set();return _0x34aad1['tests'][_0x3e1921(0x105)](_0x58e768=>_0x58e768[_0x3e1921(0x13d)]?.[_0x3e1921(0x105)](_0x20fd71=>_0xbbad54[_0x3e1921(0x162)](_0x20fd71))),_0xbbad54['size']>0x0?console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x14b)](_0x3e1921(0x124)+[..._0xbbad54][_0x3e1921(0x12b)](',\x20'))):console[_0x3e1921(0xda)](a5_0x1ba83f['dim'](_0x3e1921(0x134))),0x1;}}if(_0x58180d)return this[_0x3e1921(0x145)](_0x250458,{'definition':{'tests':_0x5228d1},'agentInfo':_0x10950e,'outputFormat':_0xce3709,'outputFile':_0x1af459,'testNames':_0x4b591a});if(_0x2ae7bd){console['log'](a5_0x1ba83f[_0x3e1921(0xfd)]('Test\x20Configuration:')),console[_0x3e1921(0xda)](_0x3e1921(0x165)+a5_0x1ba83f[_0x3e1921(0xf1)](_0x2faca7)),console['log'](_0x3e1921(0x123)+a5_0x1ba83f[_0x3e1921(0xf1)](_0x10950e[_0x3e1921(0x135)])),console[_0x3e1921(0xda)]('\x20\x20Agent:\x20'+a5_0x1ba83f[_0x3e1921(0xf1)](_0x10950e[_0x3e1921(0xef)])),console[_0x3e1921(0xda)](),console[_0x3e1921(0xda)](_0x3e1921(0x11a)+a5_0x1ba83f['white'](_0x5228d1[_0x3e1921(0x10e)]));for(let _0x46f801=0x0;_0x46f801<_0x5228d1[_0x3e1921(0x10e)];_0x46f801++){const _0x2b0719=_0x5228d1[_0x46f801],_0x290595=_0x2b0719[_0x3e1921(0x11c)][_0x3e1921(0x10e)]===0x1?_0x3e1921(0x15f):_0x3e1921(0x11c),_0x5c5e23=_0x2b0719[_0x3e1921(0x13d)]?.[_0x3e1921(0x10e)]?'\x20['+_0x2b0719[_0x3e1921(0x13d)][_0x3e1921(0x12b)](',\x20')+']':'';console[_0x3e1921(0xda)]('\x20\x20'+(_0x46f801+0x1)+'.\x20'+a5_0x1ba83f['white'](_0x2b0719[_0x3e1921(0x128)])+'\x20('+_0x2b0719[_0x3e1921(0x11c)][_0x3e1921(0x10e)]+'\x20'+_0x290595+')'+a5_0x1ba83f[_0x3e1921(0x14b)](_0x5c5e23));}return 0x0;}let _0x29e28b,_0x88ed3b;try{_0x29e28b=await _0x2ae726[_0x3e1921(0xff)]['resolveProjectId'](_0x10950e['projectName']);}catch(_0x46c4fb){const _0x1a660b=_0x46c4fb instanceof Error?_0x46c4fb['message']:String(_0x46c4fb);return _0x1a660b[_0x3e1921(0x11f)](_0x3e1921(0x146))||_0x1a660b[_0x3e1921(0xde)]()[_0x3e1921(0x11f)]('not\x20found')?console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0xdc)+_0x10950e[_0x3e1921(0x135)])):console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0x136)+_0x10950e[_0x3e1921(0x135)]+_0x3e1921(0x150)+_0x1a660b)),0x1;}try{_0x88ed3b=await _0x2ae726[_0x3e1921(0xff)][_0x3e1921(0x104)](_0x10950e['agentName'],_0x29e28b);}catch(_0x297174){const _0xb3a721=_0x297174 instanceof Error?_0x297174['message']:String(_0x297174);return _0xb3a721['includes'](_0x3e1921(0x146))||_0xb3a721[_0x3e1921(0xde)]()[_0x3e1921(0x11f)]('not\x20found')?console['log'](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0x118)+_0x10950e[_0x3e1921(0xef)])):console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0xd9)+_0x10950e['agentName']+'\x22:\x20'+_0xb3a721)),0x1;}let _0x4c9ad9;if(!_0x3d1392)try{_0x4c9ad9=await setupEvaluatorAgent(_0x2ae726[_0x3e1921(0xff)],_0x19d03c[_0x3e1921(0x15c)]);}catch(_0xa2a1eb){const _0x4be480=_0xa2a1eb instanceof Error?_0xa2a1eb[_0x3e1921(0x12e)]:String(_0xa2a1eb);return console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0xfc)+_0x4be480)),0x1;}console['log'](a5_0x1ba83f[_0x3e1921(0xfd)](_0x3e1921(0xf8))),console[_0x3e1921(0xda)](_0x3e1921(0xfb)+a5_0x1ba83f[_0x3e1921(0xf1)](_0x2faca7)),console[_0x3e1921(0xda)](_0x3e1921(0x11e)+a5_0x1ba83f[_0x3e1921(0xf1)](_0x10950e[_0x3e1921(0x135)]+'/'+_0x10950e['agentName'])),console['log']();const _0x458e25=[],_0xf38d93=[],_0x563ac0=Date[_0x3e1921(0x154)]();for(let _0x18efda=0x0;_0x18efda<_0x5228d1[_0x3e1921(0x10e)];_0x18efda++){const _0x3cc43a=_0x5228d1[_0x18efda];_0x5228d1[_0x3e1921(0x10e)]>0x1?console[_0x3e1921(0xda)](_0x3e1921(0xe6)+(_0x18efda+0x1)+'/'+_0x5228d1[_0x3e1921(0x10e)]+':\x20'+a5_0x1ba83f[_0x3e1921(0xf1)](_0x3cc43a['name'])):console['log'](_0x3e1921(0xdd)+a5_0x1ba83f[_0x3e1921(0xf1)](_0x3cc43a['name']));const _0x426f55=createCommandSpinner(_0x3e1921(0xe3)+_0x3cc43a[_0x3e1921(0x11c)]['length']+_0x3e1921(0xe0));_0x426f55[_0x3e1921(0xf7)]();try{const {result:_0x3c0c8b,conversation:_0x16092d}=await runTest(_0x2ae726[_0x3e1921(0xff)],_0x3cc43a,{'agentId':_0x88ed3b,'projectId':_0x29e28b,'site':_0x2faca7,'noEval':_0x3d1392,'evaluatorId':_0x4c9ad9,'onRoundStart':(_0x2640d2,_0x29b3a2)=>{const _0x1dfdd1=_0x3e1921;_0x426f55[_0x1dfdd1(0xe8)]=_0x1dfdd1(0x143)+(_0x2640d2+0x1)+'/'+_0x29b3a2+_0x1dfdd1(0xe0);},'onRoundComplete':(_0x159922,_0x492a3f,_0x490062)=>{const _0x2fdfbf=_0x3e1921,_0x36e641=formatElapsed(_0x492a3f);_0x490062?console['log'](_0x2fdfbf(0xec)+(_0x159922+0x1)+'/'+_0x3cc43a[_0x2fdfbf(0x11c)][_0x2fdfbf(0x10e)]+'...\x20'+a5_0x1ba83f[_0x2fdfbf(0xe1)]('✓')+'\x20('+_0x36e641+')'):console[_0x2fdfbf(0xda)](_0x2fdfbf(0xec)+(_0x159922+0x1)+'/'+_0x3cc43a[_0x2fdfbf(0x11c)][_0x2fdfbf(0x10e)]+_0x2fdfbf(0x117)+a5_0x1ba83f[_0x2fdfbf(0x167)]('✗'));},'onEvaluationStart':()=>{const _0x55db78=_0x3e1921;_0x426f55[_0x55db78(0xe8)]=_0x55db78(0xdb);},'onEvaluationComplete':_0x98927d=>{const _0x5265ae=_0x3e1921,_0x225500=formatElapsed(_0x98927d);console['log'](_0x5265ae(0x169)+a5_0x1ba83f[_0x5265ae(0xe1)]('✓')+'\x20('+_0x225500+')');}});_0x426f55['stop'](),_0x458e25[_0x3e1921(0x166)](_0x3c0c8b),_0xf38d93[_0x3e1921(0x166)](_0x16092d);if(_0x3c0c8b[_0x3e1921(0x129)]===_0x3e1921(0xf9))console['log'](a5_0x1ba83f[_0x3e1921(0xe1)](_0x3e1921(0x16b)+_0x3c0c8b[_0x3e1921(0x15d)]));else _0x3c0c8b['status']==='FAIL'?console['log'](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0xf6)+_0x3c0c8b['reason'])):console['log'](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0xf5)+_0x3c0c8b[_0x3e1921(0x15d)]));_0x3c0c8b['conversation_url']&&console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x14b)](_0x3e1921(0x16f)+_0x3c0c8b[_0x3e1921(0x121)])),console[_0x3e1921(0xda)]();}catch(_0x2ade64){_0x426f55[_0x3e1921(0x12a)]();const _0x3902a8=_0x2ade64 instanceof Error?_0x2ade64[_0x3e1921(0x12e)]:String(_0x2ade64);console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x167)](_0x3e1921(0xf5)+_0x3902a8)),console['log'](),_0x458e25['push']({'name':_0x3cc43a['name'],'status':_0x3e1921(0x126),'reason':_0x3902a8,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x218ce0=Date['now']()-_0x563ac0,_0x34f3f8=_0x458e25[_0x3e1921(0x10b)](_0x593061=>_0x593061['status']===_0x3e1921(0xf9))[_0x3e1921(0x10e)],_0x22b5b5=_0x458e25[_0x3e1921(0x10b)](_0x264fe8=>_0x264fe8[_0x3e1921(0x129)]==='FAIL')['length'],_0x4167be=_0x458e25[_0x3e1921(0x10b)](_0x547bc3=>_0x547bc3[_0x3e1921(0x129)]===_0x3e1921(0x126))[_0x3e1921(0x10e)];console[_0x3e1921(0xda)]('━'[_0x3e1921(0xe4)](0x3c)),console[_0x3e1921(0xda)](_0x3e1921(0x14a)),console[_0x3e1921(0xda)]('━'[_0x3e1921(0xe4)](0x3c)),console[_0x3e1921(0xda)](_0x3e1921(0x16e)+_0x458e25[_0x3e1921(0x10e)]),console[_0x3e1921(0xda)](_0x3e1921(0x16d)+a5_0x1ba83f[_0x3e1921(0xe1)](_0x34f3f8)),console[_0x3e1921(0xda)]('Failed:\x20\x20\x20'+a5_0x1ba83f['red'](_0x22b5b5));_0x4167be>0x0&&console[_0x3e1921(0xda)](_0x3e1921(0x15b)+a5_0x1ba83f[_0x3e1921(0x167)](_0x4167be));console[_0x3e1921(0xda)](_0x3e1921(0x110)+formatElapsed(_0x218ce0)),console[_0x3e1921(0xda)]('━'[_0x3e1921(0xe4)](0x3c));const _0xbc3c30=_0x458e25[_0x3e1921(0x10b)](_0x3560d0=>_0x3560d0[_0x3e1921(0x129)]!==_0x3e1921(0xf9));if(_0xbc3c30['length']>0x0){console[_0x3e1921(0xda)](),console[_0x3e1921(0xda)](_0x3e1921(0x13b));for(const _0x5b8f67 of _0xbc3c30){const _0x41eb07=a5_0x1ba83f[_0x3e1921(0x167)]('✗'),_0x523e74=_0x5b8f67[_0x3e1921(0x15d)]['length']>0x32?_0x5b8f67['reason']['substring'](0x0,0x32)+'...':_0x5b8f67['reason'];console['log']('\x20\x20'+_0x41eb07+'\x20'+_0x5b8f67[_0x3e1921(0x128)]+':\x20'+_0x523e74);}}const _0x25eb4c={'summary':{'total':_0x458e25[_0x3e1921(0x10e)],'passed':_0x34f3f8,'failed':_0x22b5b5,'errors':_0x4167be>0x0?_0x4167be:undefined,'duration_ms':_0x218ce0},'tests':_0x458e25,'agent':{'project':_0x10950e['projectName'],'name':_0x10950e[_0x3e1921(0xef)],'site':_0x2faca7},'timestamp':new Date(_0x563ac0)[_0x3e1921(0x164)]()};try{const _0x301cd8=buildCachedTestRun(_0xf38d93,{'site':_0x2faca7,'projectId':_0x29e28b,'projectName':_0x10950e['projectName'],'agentId':_0x88ed3b,'agentName':_0x10950e['agentName'],'testYmlPath':a5_0x50a11a[_0x3e1921(0x149)](_0x10950e[_0x3e1921(0x133)])});saveLastTestRun(_0x301cd8);}catch{}if(_0xce3709!==_0x3e1921(0x158)||_0x1af459){const _0x5f5913=formatResults(_0x25eb4c,_0xce3709);if(_0x1af459)try{a5_0x497534[_0x3e1921(0x102)](_0x1af459,_0x5f5913,_0x3e1921(0x148)),console['log'](),console[_0x3e1921(0xda)](a5_0x1ba83f[_0x3e1921(0x14b)](_0x3e1921(0x106)+_0x1af459));}catch(_0x129d5d){return console[_0x3e1921(0xda)](),console['log'](a5_0x1ba83f[_0x3e1921(0x167)]('Error\x20writing\x20output\x20file:\x20'+_0x129d5d)),0x1;}else console[_0x3e1921(0xda)](),console['log'](_0x5f5913);}return _0xbc3c30[_0x3e1921(0x10e)]>0x0?0x1:0x0;}async[a5_0x41336d(0x145)](_0x5210b0,_0x448061){const _0x237713=a5_0x41336d,{options:_0x3ee6a7,tdx:_0x3d5b99}=_0x5210b0,{definition:_0x150717,agentInfo:_0x41ac00,outputFormat:_0x3ee69e,outputFile:_0x30f8c9}=_0x448061,_0x38e6cb=_0x3ee6a7[_0x237713(0x15a)],_0x57212d=loadLastTestRun();if(!_0x57212d)return console['log'](a5_0x1ba83f['red'](_0x237713(0xed))),console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0x14b)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x57212d[_0x237713(0x14d)]['agentName']!==_0x41ac00[_0x237713(0xef)])return console[_0x237713(0xda)](a5_0x1ba83f['red'](_0x237713(0x101)+_0x57212d[_0x237713(0x14d)][_0x237713(0xef)]+_0x237713(0x156)+_0x41ac00[_0x237713(0xef)]+'\x22.')),console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0x14b)](_0x237713(0x111))),0x1;const _0x2d6781=new Set(_0x57212d[_0x237713(0x15e)][_0x237713(0x139)](_0x3f088e=>_0x3f088e[_0x237713(0x152)])),_0x31260d=_0x150717[_0x237713(0x160)][_0x237713(0x10b)](_0x2dd5ce=>!_0x2d6781['has'](_0x2dd5ce['name']));if(_0x31260d[_0x237713(0x10e)]>0x0&&_0x57212d[_0x237713(0x15a)]!==_0x38e6cb)return console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0x167)](_0x237713(0xe9))),console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0x14b)](_0x237713(0x114)+_0x57212d[_0x237713(0x15a)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x38e6cb+'\x22.')),console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0x14b)](_0x237713(0x10a)+_0x57212d[_0x237713(0x15a)]+_0x237713(0xe2))),0x1;const _0x48488f=_0x150717['tests'][_0x237713(0x10b)](_0x45e1e0=>_0x2d6781['has'](_0x45e1e0['name'])),_0x35724d=_0x31260d;let _0x31a1b2;try{_0x31a1b2=await setupEvaluatorAgent(_0x3d5b99[_0x237713(0xff)],_0x3ee6a7[_0x237713(0x15c)]);}catch(_0x20dfb3){const _0x33e676=_0x20dfb3 instanceof Error?_0x20dfb3[_0x237713(0x12e)]:String(_0x20dfb3);return console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0x167)](_0x237713(0xfc)+_0x33e676)),0x1;}console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0xfd)](_0x237713(0x138))),console[_0x237713(0xda)](_0x237713(0x103)+a5_0x1ba83f[_0x237713(0xf1)](_0x57212d[_0x237713(0x157)])),console[_0x237713(0xda)](_0x237713(0x11e)+a5_0x1ba83f[_0x237713(0xf1)](_0x57212d['agent'][_0x237713(0x135)]+'/'+_0x57212d[_0x237713(0x14d)][_0x237713(0xef)]));_0x35724d[_0x237713(0x10e)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x1ba83f[_0x237713(0xea)](_0x35724d['length']));console[_0x237713(0xda)]();const _0x33b6bc=[],_0x3ca57b=Date[_0x237713(0x154)](),_0x1a2be6=createCommandSpinner(_0x237713(0x168));if(_0x48488f['length']>0x0)try{const _0x15656e=await reevaluateFromCache(_0x3d5b99['llm'],_0x57212d,{'tests':_0x48488f},{'evaluatorId':_0x31a1b2,'onTestStart':(_0x1f47bf,_0x164a9c,_0x380bd3)=>{const _0x4c25c1=_0x237713;_0x1a2be6[_0x4c25c1(0xe8)]=_0x4c25c1(0x144)+(_0x164a9c+0x1)+'/'+_0x380bd3+':\x20'+_0x1f47bf+'...';if(!_0x1a2be6[_0x4c25c1(0xe5)])_0x1a2be6[_0x4c25c1(0xf7)]();},'onTestComplete':(_0x5a4f93,_0x11d490)=>{const _0x3f0e68=_0x237713;_0x1a2be6[_0x3f0e68(0x12a)]();if(_0x11d490[_0x3f0e68(0x129)]===_0x3f0e68(0xf9))console['log'](a5_0x1ba83f[_0x3f0e68(0xe1)]('✓\x20PASS:\x20'+_0x5a4f93)+a5_0x1ba83f[_0x3f0e68(0x14b)]('\x20(cached)'));else _0x11d490['status']===_0x3f0e68(0x113)?console['log'](a5_0x1ba83f[_0x3f0e68(0x167)]('✗\x20FAIL:\x20'+_0x5a4f93+'\x20-\x20'+_0x11d490['reason'])+a5_0x1ba83f['dim']('\x20(cached)')):console['log'](a5_0x1ba83f[_0x3f0e68(0x167)](_0x3f0e68(0xf5)+_0x5a4f93+_0x3f0e68(0x137)+_0x11d490[_0x3f0e68(0x15d)]));_0x11d490[_0x3f0e68(0x121)]&&console[_0x3f0e68(0xda)](a5_0x1ba83f[_0x3f0e68(0x14b)]('\x20\x20Conversation:\x20'+_0x11d490[_0x3f0e68(0x121)])),_0x33b6bc[_0x3f0e68(0x166)](_0x11d490);},'onTestSkipped':(_0x58bb2d,_0x5d0f57)=>{const _0x8956f8=_0x237713;_0x1a2be6[_0x8956f8(0x12a)](),console[_0x8956f8(0xda)](a5_0x1ba83f[_0x8956f8(0xea)](_0x8956f8(0x13a)+_0x58bb2d+'\x20-\x20'+_0x5d0f57));}});for(const _0x355704 of _0x15656e){!_0x33b6bc[_0x237713(0xf4)](_0x4e6b9b=>_0x4e6b9b['name']===_0x355704[_0x237713(0x128)])&&_0x33b6bc[_0x237713(0x166)](_0x355704);}}catch(_0x1b4a33){_0x1a2be6[_0x237713(0x12a)]();const _0x91ef73=_0x1b4a33 instanceof Error?_0x1b4a33['message']:String(_0x1b4a33);return console['log'](a5_0x1ba83f[_0x237713(0x167)](_0x237713(0x125)+_0x91ef73)),0x1;}_0x1a2be6[_0x237713(0x12a)]();if(_0x35724d['length']>0x0){console[_0x237713(0xda)](),console['log'](a5_0x1ba83f['cyan'](_0x237713(0xf2)));const {projectId:_0x286f4b,agentId:_0x15230b}=_0x57212d[_0x237713(0x14d)];for(const _0x597a1b of _0x35724d){console[_0x237713(0xda)](_0x237713(0x155)+a5_0x1ba83f['white'](_0x597a1b[_0x237713(0x128)]));const _0x424800=createCommandSpinner(_0x237713(0xe3)+_0x597a1b[_0x237713(0x11c)][_0x237713(0x10e)]+_0x237713(0xe0));_0x424800[_0x237713(0xf7)]();try{const {result:_0x53a7fe}=await runTest(_0x3d5b99[_0x237713(0xff)],_0x597a1b,{'agentId':_0x15230b,'projectId':_0x286f4b,'site':_0x57212d[_0x237713(0x15a)],'noEval':![],'evaluatorId':_0x31a1b2,'onRoundStart':(_0x53f770,_0x2182d5)=>{const _0xeecd58=_0x237713;_0x424800[_0xeecd58(0xe8)]=_0xeecd58(0x143)+(_0x53f770+0x1)+'/'+_0x2182d5+_0xeecd58(0xe0);},'onRoundComplete':(_0x5723c4,_0x5d1cde,_0x53840c)=>{const _0x5e923a=_0x237713,_0x164832=formatElapsed(_0x5d1cde);_0x53840c?console['log']('\x20\x20Round\x20'+(_0x5723c4+0x1)+'/'+_0x597a1b[_0x5e923a(0x11c)][_0x5e923a(0x10e)]+_0x5e923a(0x117)+a5_0x1ba83f[_0x5e923a(0xe1)]('✓')+'\x20('+_0x164832+')'):console[_0x5e923a(0xda)](_0x5e923a(0xec)+(_0x5723c4+0x1)+'/'+_0x597a1b[_0x5e923a(0x11c)]['length']+_0x5e923a(0x117)+a5_0x1ba83f[_0x5e923a(0x167)]('✗'));},'onEvaluationStart':()=>{const _0xc33b2d=_0x237713;_0x424800[_0xc33b2d(0xe8)]=_0xc33b2d(0xdb);},'onEvaluationComplete':_0x34fe8f=>{const _0xbe7736=_0x237713,_0x2a087b=formatElapsed(_0x34fe8f);console['log'](_0xbe7736(0x169)+a5_0x1ba83f['green']('✓')+'\x20('+_0x2a087b+')');}});_0x424800['stop'](),_0x33b6bc['push'](_0x53a7fe);if(_0x53a7fe[_0x237713(0x129)]===_0x237713(0xf9))console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0xe1)]('✓\x20PASS:\x20'+_0x53a7fe[_0x237713(0x15d)])+a5_0x1ba83f[_0x237713(0x14b)](_0x237713(0x14c)));else _0x53a7fe[_0x237713(0x129)]===_0x237713(0x113)?console[_0x237713(0xda)](a5_0x1ba83f['red'](_0x237713(0xf6)+_0x53a7fe[_0x237713(0x15d)])+a5_0x1ba83f['dim'](_0x237713(0x14c))):console[_0x237713(0xda)](a5_0x1ba83f[_0x237713(0x167)](_0x237713(0xf5)+_0x53a7fe[_0x237713(0x15d)]));_0x53a7fe[_0x237713(0x121)]&&console['log'](a5_0x1ba83f[_0x237713(0x14b)](_0x237713(0xf0)+_0x53a7fe['conversation_url']));}catch(_0x501c15){_0x424800[_0x237713(0x12a)]();const _0x830b94=_0x501c15 instanceof Error?_0x501c15[_0x237713(0x12e)]:String(_0x501c15);console['log'](a5_0x1ba83f[_0x237713(0x167)](_0x237713(0xf5)+_0x830b94)),_0x33b6bc['push']({'name':_0x597a1b[_0x237713(0x128)],'status':_0x237713(0x126),'reason':_0x830b94,'timestamp':new Date()[_0x237713(0x164)](),'duration_ms':0x0});}}}console[_0x237713(0xda)]();const _0x23fab6=Date[_0x237713(0x154)]()-_0x3ca57b,_0x2967f9=_0x33b6bc[_0x237713(0x10b)](_0x57e2eb=>_0x57e2eb[_0x237713(0x129)]===_0x237713(0xf9))[_0x237713(0x10e)],_0xb3d84a=_0x33b6bc[_0x237713(0x10b)](_0x15bbcb=>_0x15bbcb[_0x237713(0x129)]===_0x237713(0x113))['length'],_0x43d2f9=_0x33b6bc[_0x237713(0x10b)](_0x1f4ce5=>_0x1f4ce5[_0x237713(0x129)]===_0x237713(0x126))[_0x237713(0x10e)];console['log']('━'[_0x237713(0xe4)](0x3c)),console['log'](_0x237713(0xf3)),console[_0x237713(0xda)]('━'['repeat'](0x3c)),console[_0x237713(0xda)]('Total:\x20\x20\x20\x20'+_0x33b6bc['length']),console['log']('Passed:\x20\x20\x20'+a5_0x1ba83f[_0x237713(0xe1)](_0x2967f9)),console[_0x237713(0xda)](_0x237713(0x14e)+a5_0x1ba83f[_0x237713(0x167)](_0xb3d84a));_0x43d2f9>0x0&&console[_0x237713(0xda)](_0x237713(0x15b)+a5_0x1ba83f['red'](_0x43d2f9));console[_0x237713(0xda)](_0x237713(0x110)+formatElapsed(_0x23fab6)),console[_0x237713(0xda)]('━'['repeat'](0x3c));const _0x21726e={'summary':{'total':_0x33b6bc[_0x237713(0x10e)],'passed':_0x2967f9,'failed':_0xb3d84a,'errors':_0x43d2f9>0x0?_0x43d2f9:undefined,'duration_ms':_0x23fab6},'tests':_0x33b6bc,'agent':{'project':_0x41ac00[_0x237713(0x135)],'name':_0x41ac00[_0x237713(0xef)],'site':_0x38e6cb},'timestamp':new Date(_0x3ca57b)[_0x237713(0x164)]()};if(_0x3ee69e!==_0x237713(0x158)||_0x30f8c9){const _0x171812=formatResults(_0x21726e,_0x3ee69e);if(_0x30f8c9)try{a5_0x497534[_0x237713(0x102)](_0x30f8c9,_0x171812,_0x237713(0x148)),console[_0x237713(0xda)](),console['log'](a5_0x1ba83f[_0x237713(0x14b)](_0x237713(0x106)+_0x30f8c9));}catch(_0x2fa82a){return console['log'](),console['log'](a5_0x1ba83f[_0x237713(0x167)](_0x237713(0x12c)+_0x2fa82a)),0x1;}else console[_0x237713(0xda)](),console[_0x237713(0xda)](_0x171812);}const _0x1348e5=_0x33b6bc[_0x237713(0x10b)](_0xef54ff=>_0xef54ff[_0x237713(0x129)]!==_0x237713(0xf9));return _0x1348e5['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a6_0x570a7b=a6_0x36df;function a6_0x36df(_0xb0635,_0xc8e5a5){_0xb0635=_0xb0635-0x1e6;const _0x3c9d5c=a6_0x3c9d();let _0x36dfb8=_0x3c9d5c[_0xb0635];return _0x36dfb8;}(function(_0x4d61a8,_0x880424){const _0x46d413=a6_0x36df,_0x5c8b7a=_0x4d61a8();while(!![]){try{const _0x3b4c8c=-parseInt(_0x46d413(0x1ee))/0x1+parseInt(_0x46d413(0x216))/0x2+-parseInt(_0x46d413(0x1f5))/0x3*(parseInt(_0x46d413(0x1e8))/0x4)+parseInt(_0x46d413(0x21a))/0x5*(parseInt(_0x46d413(0x1ea))/0x6)+parseInt(_0x46d413(0x20b))/0x7+-parseInt(_0x46d413(0x1f8))/0x8+-parseInt(_0x46d413(0x1e7))/0x9;if(_0x3b4c8c===_0x880424)break;else _0x5c8b7a['push'](_0x5c8b7a['shift']());}catch(_0x3155a1){_0x5c8b7a['push'](_0x5c8b7a['shift']());}}}(a6_0x3c9d,0x6d9e5));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x570a7b(0x21d),a6_0x570a7b(0x20f),'cookie',a6_0x570a7b(0x1fb),a6_0x570a7b(0x220),a6_0x570a7b(0x1e6),'x-auth-token',a6_0x570a7b(0x202)]);function a6_0x3c9d(){const _0x15547c=['Header\x20key\x20cannot\x20be\x20empty:\x20\x22','workflow','929378quHCLe','length','body','log','67005CnxqDg','substring','message','authorization','GET','error','set-cookie2','PUT','readBodyFromFile','Results\x20saved\x20to\x20','join','cdp','x-xsrf-token','983889qtOluv','315516okTSHE','<\x20HTTP/1.1\x20','246wFpNda','output','color','indexOf','32832AUWNXd','Error:\x20','data','.\x20Valid\x20methods:\x20','.\x20Valid\x20types:\x20','entries','startsWith','15CQDGDy','verbose','llm-proxy','4931248baAFGY','headers','keys','set-cookie','llm','stack','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','includes','api','toLowerCase','x-trino-user','has','PATCH','file','method','noColor','trim','\x0aStack\x20trace:\x0a','Invalid\x20header\x20format:\x20\x22','4114747AONgEy','header','POST','description','proxy-authorization','site','Invalid\x20HTTP\x20method:\x20','type','\x22.\x20'];a6_0x3c9d=function(){return _0x15547c;};return a6_0x3c9d();}function isSensitiveHeader(_0x3e58f4){const _0x154d65=a6_0x570a7b;return SENSITIVE_HEADERS[_0x154d65(0x203)](_0x3e58f4[_0x154d65(0x201)]());}function parseHeader(_0x14f629){const _0xf353a0=a6_0x570a7b,_0x37aff5=_0x14f629[_0xf353a0(0x1ed)](':');if(_0x37aff5===-0x1)throw new Error(_0xf353a0(0x20a)+_0x14f629+_0xf353a0(0x213)+_0xf353a0(0x1fe));const _0x57e33a=_0x14f629['substring'](0x0,_0x37aff5)['trim'](),_0x2f6acd=_0x14f629[_0xf353a0(0x21b)](_0x37aff5+0x1)[_0xf353a0(0x208)]();if(!_0x57e33a)throw new Error(_0xf353a0(0x214)+_0x14f629+'\x22');return[_0x57e33a,_0x2f6acd];}export class ApiCommand extends BaseCommand{['name']=a6_0x570a7b(0x200);[a6_0x570a7b(0x20e)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x2b8423){const _0x1f7bc6=a6_0x570a7b,{args:_0x603bc5,options:_0x349093}=_0x2b8423,_0x3927c7=_0x349093;if(_0x603bc5[_0x1f7bc6(0x217)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x57c93a=_0x603bc5[0x0];if(!_0x57c93a[_0x1f7bc6(0x1f4)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x57c93a;const _0x15d229=_0x3927c7[_0x1f7bc6(0x1f0)],_0x253a75=_0x3927c7[_0x1f7bc6(0x205)];if(_0x15d229&&_0x253a75)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x2914b2=_0x3927c7[_0x1f7bc6(0x206)]||_0x1f7bc6(0x21e),_0x3e5c60=['GET',_0x1f7bc6(0x20d),_0x1f7bc6(0x221),'DELETE',_0x1f7bc6(0x204)];if(!_0x3e5c60[_0x1f7bc6(0x1ff)](_0x2914b2['toUpperCase']()))return _0x1f7bc6(0x211)+_0x2914b2+_0x1f7bc6(0x1f1)+_0x3e5c60[_0x1f7bc6(0x224)](',\x20');const _0x2d5401=_0x3927c7[_0x1f7bc6(0x212)]||'td',_0x3ab757=['td',_0x1f7bc6(0x225),_0x1f7bc6(0x215),'trino',_0x1f7bc6(0x1fc),_0x1f7bc6(0x1f7),'cas'];if(!_0x3ab757[_0x1f7bc6(0x1ff)](_0x2d5401))return'Invalid\x20API\x20type:\x20'+_0x2d5401+_0x1f7bc6(0x1f2)+_0x3ab757[_0x1f7bc6(0x224)](',\x20');return undefined;}async['execute'](_0x119a5b){const _0x311948=a6_0x570a7b,{options:_0x69d608,args:_0x35ed82,tdx:_0x59a85c}=_0x119a5b,_0x18ec9e=_0x69d608,_0x1fedc8=_0x35ed82[0x0],_0xdfedba=(_0x18ec9e['method']||_0x311948(0x21e))['toUpperCase'](),_0x60258e=_0x18ec9e[_0x311948(0x1f0)],_0x14316f=_0x18ec9e[_0x311948(0x205)],_0x155296=_0x18ec9e[_0x311948(0x20c)],_0x4994db=_0x18ec9e['type']||'td';try{const _0x11fda4={};if(_0x155296){const _0x2b7e7c=Array['isArray'](_0x155296)?_0x155296:[_0x155296];for(const _0x68c96b of _0x2b7e7c){const [_0x21ff7b,_0x361f1e]=parseHeader(_0x68c96b);_0x11fda4[_0x21ff7b]=_0x361f1e;}}let _0x39289a;if(_0x60258e)_0x39289a=_0x60258e;else{if(_0x14316f)try{_0x39289a=RawAPI[_0x311948(0x222)](_0x14316f);}catch(_0xdcf3f1){return console['error'](_0x311948(0x1ef)+(_0xdcf3f1 instanceof Error?_0xdcf3f1['message']:String(_0xdcf3f1))),0x1;}}const _0xd0ad57={'method':_0xdfedba,'apiType':_0x4994db,'includeHeaders':_0x69d608[_0x311948(0x1f6)]};_0x39289a&&(_0xd0ad57[_0x311948(0x218)]=_0x39289a);Object[_0x311948(0x1fa)](_0x11fda4)[_0x311948(0x217)]>0x0&&(_0xd0ad57[_0x311948(0x1f9)]=_0x11fda4);if(_0x69d608[_0x311948(0x1f6)]){const _0x2a32b0=resolveSite(_0x69d608[_0x311948(0x210)]),_0x336e5a=getEndpoint(_0x2a32b0,_0x4994db),_0x5e15e0=''+_0x336e5a+_0x1fedc8;console[_0x311948(0x21f)]('>\x20'+_0xdfedba+'\x20'+_0x5e15e0);const _0x462201=getAuthHeaders(_0x2a32b0),_0x11b029={..._0x462201,..._0x11fda4};for(const [_0x2c947c,_0x58d8c0]of Object[_0x311948(0x1f3)](_0x11b029)){!isSensitiveHeader(_0x2c947c)&&console['error']('>\x20'+_0x2c947c+':\x20'+_0x58d8c0);}_0x39289a&&console[_0x311948(0x21f)]('>'),console['error']('');}const _0x37f6ad=await _0x59a85c['api']['request'](_0x1fedc8,_0xd0ad57);if(_0x69d608[_0x311948(0x1f6)]&&_0x37f6ad[_0x311948(0x1f9)]){console[_0x311948(0x21f)](_0x311948(0x1e9)+_0x37f6ad['status']);for(const [_0x3dec3b,_0x5b75ba]of Object[_0x311948(0x1f3)](_0x37f6ad[_0x311948(0x1f9)])){!isSensitiveHeader(_0x3dec3b)&&console[_0x311948(0x21f)]('<\x20'+_0x3dec3b+':\x20'+_0x5b75ba);}console[_0x311948(0x21f)]('');}const _0xceed7b=Boolean(_0x69d608[_0x311948(0x1eb)]),_0x2a0ae0={'color':_0x69d608[_0x311948(0x1ec)],'noColor':_0x69d608[_0x311948(0x207)]||_0xceed7b&&!_0x69d608[_0x311948(0x1ec)]},_0x36fe24=colorizeJSON(_0x37f6ad[_0x311948(0x1f0)],_0x2a0ae0);return _0x69d608['output']?(writeFileSync(_0x69d608[_0x311948(0x1eb)],_0x36fe24),console[_0x311948(0x21f)](_0x311948(0x223)+_0x69d608[_0x311948(0x1eb)])):console[_0x311948(0x219)](_0x36fe24),0x0;}catch(_0x41b3e9){return _0x41b3e9 instanceof Error?(console[_0x311948(0x21f)]('Error:\x20'+_0x41b3e9[_0x311948(0x21c)]),_0x69d608[_0x311948(0x1f6)]&&_0x41b3e9[_0x311948(0x1fd)]&&console['error'](_0x311948(0x209)+_0x41b3e9[_0x311948(0x1fd)])):console[_0x311948(0x21f)](_0x311948(0x1ef)+String(_0x41b3e9)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x1482d3=a7_0x453f;function a7_0x453f(_0x2b8067,_0x558267){_0x2b8067=_0x2b8067-0x113;const _0x38bb5a=a7_0x38bb();let _0x453f45=_0x38bb5a[_0x2b8067];return _0x453f45;}(function(_0x4ef69e,_0x2138a8){const _0x1f584d=a7_0x453f,_0x1ca077=_0x4ef69e();while(!![]){try{const _0x13e66e=-parseInt(_0x1f584d(0x11a))/0x1*(parseInt(_0x1f584d(0x127))/0x2)+-parseInt(_0x1f584d(0x148))/0x3+-parseInt(_0x1f584d(0x12c))/0x4+parseInt(_0x1f584d(0x15e))/0x5*(-parseInt(_0x1f584d(0x11c))/0x6)+parseInt(_0x1f584d(0x152))/0x7+-parseInt(_0x1f584d(0x159))/0x8*(-parseInt(_0x1f584d(0x12a))/0x9)+-parseInt(_0x1f584d(0x14f))/0xa*(-parseInt(_0x1f584d(0x162))/0xb);if(_0x13e66e===_0x2138a8)break;else _0x1ca077['push'](_0x1ca077['shift']());}catch(_0x48e7a5){_0x1ca077['push'](_0x1ca077['shift']());}}}(a7_0x38bb,0x2743c));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x50c06d from'prompts';function a7_0x38bb(){const _0x46c2bc=['OAuth\x20tokens','profile','Validating\x20API\x20key...','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','tdx:\x20auth\x20clear','\x20for\x20profile:\x20','last_name','5303OIumAM','bold','23874ShKPRS','red','/app/mp/ak','Setup\x20API\x20key\x20authentication\x20interactively','Credential\x20type:\x20OAuth','tdx:\x20auth\x20setup','✗\x20Validation\x20failed:\x20','\x20removed\x20from\x20keychain','green','yellow','No\x20credentials\x20found\x20in\x20keychain','46YQSlct','apikey','email','37881TgrXdX','\x20--profile\x20','947988JuYwNk','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20(profile:\x20','filter','Choose\x20authentication\x20method:','Setting\x20up\x20authentication\x20for\x20site:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','auth:setup','first_name','log','method','select','API\x20key','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','error','\x20(site:\x20','\x0aSetup\x20cancelled','warn','logLevel','✓\x20Authentication\x20successful\x0a','apiKey','You\x20can\x20find\x20your\x20API\x20key\x20at:','User:\x20','create','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','OAuth\x20(browser\x20login)','join','all','330192JfamNy','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','password','Name:\x20','name','status','\x27\x20registered','5415920luAuCR','jobs','API\x20key\x20cannot\x20be\x20empty','1870120Yprxiz','Remove\x20API\x20key\x20from\x20system\x20keychain','message','site','trim','execute','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','144ciAufH','getUserInfo','System\x20keychain\x20is\x20not\x20available','Read\x20credential\x20from\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','320lxDCyZ','Enter\x20your\x20TD\x20API\x20key:','oauth','\x20\x20tdx','11HGMWzF'];a7_0x38bb=function(){return _0x46c2bc;};return a7_0x38bb();}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x2ef49e from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x1482d3(0x14c)]=a7_0x1482d3(0x133);['description']=a7_0x1482d3(0x11f);async['execute'](_0x357bd3){const _0x7a5fb1=a7_0x1482d3,{options:_0x5d5cc3}=_0x357bd3,_0x1ade9b=_0x5d5cc3['profile'];console[_0x7a5fb1(0x135)](a7_0x2ef49e['bold'](_0x7a5fb1(0x121)));const _0x11f4a1=_0x5d5cc3['site']||'us01',_0x209ca4=await promptSiteSelection(_0x11f4a1,_0x1ade9b,'Setup\x20cancelled');if(!_0x209ca4)return 0x1;const _0x3001bd=resolveSite(_0x209ca4);if(isOAuthSupported(_0x3001bd)){const _0x227259=await a7_0x50c06d({'type':_0x7a5fb1(0x137),'name':_0x7a5fb1(0x136),'message':_0x7a5fb1(0x130),'choices':[{'title':_0x7a5fb1(0x145),'value':_0x7a5fb1(0x160)},{'title':'API\x20Key','value':_0x7a5fb1(0x128)}]});if(!_0x227259[_0x7a5fb1(0x136)])return console[_0x7a5fb1(0x135)](_0x7a5fb1(0x13c)),0x1;if(_0x227259[_0x7a5fb1(0x136)]===_0x7a5fb1(0x160))return await runOAuthLoginFlow(_0x3001bd,_0x1ade9b,_0x5d5cc3[_0x7a5fb1(0x13e)]??LogLevel['ERROR']),0x0;}console[_0x7a5fb1(0x135)](_0x7a5fb1(0x131)+_0x3001bd),console['log'](_0x7a5fb1(0x141)),console[_0x7a5fb1(0x135)]('\x20\x20'+getConsoleUrl(_0x3001bd,_0x7a5fb1(0x11e)));const _0x4cdc3d=await a7_0x50c06d({'type':_0x7a5fb1(0x14a),'name':'apiKey','message':_0x7a5fb1(0x15f),'validate':_0x597b3f=>{const _0x35aab7=_0x7a5fb1;if(!_0x597b3f||!_0x597b3f[_0x35aab7(0x156)]())return _0x35aab7(0x151);return!![];}});if(!_0x4cdc3d[_0x7a5fb1(0x140)])return console[_0x7a5fb1(0x135)](_0x7a5fb1(0x13c)),0x1;const _0x3ed92d=_0x4cdc3d[_0x7a5fb1(0x140)];console[_0x7a5fb1(0x135)](_0x7a5fb1(0x115));try{const _0x27610a=TDX[_0x7a5fb1(0x143)]({'site':_0x3001bd,'apiKey':_0x3ed92d['trim'](),'logLevel':_0x5d5cc3[_0x7a5fb1(0x13e)]??LogLevel['ERROR']}),_0x54ff5e=await _0x27610a[_0x7a5fb1(0x150)][_0x7a5fb1(0x15a)]();console['log'](_0x7a5fb1(0x116)+_0x54ff5e[_0x7a5fb1(0x129)]+')');const _0x1b0eb0=await isKeychainAvailable();_0x1b0eb0?(await saveAPIKeyAsync(_0x3ed92d['trim'](),_0x3001bd,_0x1ade9b),console[_0x7a5fb1(0x135)](_0x7a5fb1(0x139)+(_0x1ade9b?_0x7a5fb1(0x12e)+_0x1ade9b+')':''))):(console[_0x7a5fb1(0x13d)](a7_0x2ef49e[_0x7a5fb1(0x125)](_0x7a5fb1(0x158))),console[_0x7a5fb1(0x13d)](a7_0x2ef49e['yellow'](_0x7a5fb1(0x15d))));if(_0x1ade9b){const _0x37bd7a={'site':_0x3001bd};saveProfileToUserConfig(_0x1ade9b,_0x37bd7a),console[_0x7a5fb1(0x135)]('✓\x20Profile\x20\x27'+_0x1ade9b+_0x7a5fb1(0x14e));}else saveDefaultSiteToUserConfig(_0x3001bd),console[_0x7a5fb1(0x135)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x3001bd);const _0x35c386=_0x1ade9b?_0x7a5fb1(0x12b)+_0x1ade9b:'';return console[_0x7a5fb1(0x135)](),console['log'](_0x7a5fb1(0x12d)),console[_0x7a5fb1(0x135)](_0x7a5fb1(0x161)+_0x35c386+_0x7a5fb1(0x144)),console['log'](_0x7a5fb1(0x161)+_0x35c386+_0x7a5fb1(0x149)),0x0;}catch(_0x390951){if(_0x390951 instanceof HTTPClientError&&_0x390951[_0x7a5fb1(0x14d)]===0x191)return printAuthError(_0x390951),0x1;return console[_0x7a5fb1(0x13a)](a7_0x2ef49e[_0x7a5fb1(0x11d)](_0x7a5fb1(0x122)+(_0x390951 instanceof Error?_0x390951[_0x7a5fb1(0x154)]:String(_0x390951)))),console[_0x7a5fb1(0x13a)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';['description']=a7_0x1482d3(0x132);async[a7_0x1482d3(0x157)](_0x14bf3c){const _0x51117b=a7_0x1482d3,{options:_0x2e34f8,tdx:_0xf0a9b2}=_0x14bf3c,_0x57100c=_0x2e34f8[_0x51117b(0x155)],_0xa4989=_0x2e34f8[_0x51117b(0x114)],_0x30d0ef=_0xa4989?_0xa4989:'N/A';console[_0x51117b(0x135)]('tdx\x20profile:\x20'+_0x30d0ef+_0x51117b(0x13b)+_0x57100c+')');const _0x2c1d63=await getOAuthTokens(_0xa4989);if(_0x2c1d63)console[_0x51117b(0x135)](_0x51117b(0x120)),console[_0x51117b(0x135)]('Read\x20credential\x20from\x20keychain'+(_0xa4989?'\x20(profile:\x20'+_0xa4989+')':''));else{const _0x589083=await resolveAPIKeyAsync(_0x57100c,_0xa4989);if(_0x589083){const {source:_0x371b7e,isDeprecated:_0x4fdc5d}=_0x589083,_0x362e64=_0x51117b(0x15c)+_0x371b7e;console['log'](_0x4fdc5d?a7_0x2ef49e[_0x51117b(0x125)](_0x362e64):_0x362e64);}else console[_0x51117b(0x135)](a7_0x2ef49e[_0x51117b(0x125)]('No\x20credential\x20found'));}try{const _0x2a8c03=await _0xf0a9b2[_0x51117b(0x150)][_0x51117b(0x15a)]();return console[_0x51117b(0x135)](a7_0x2ef49e[_0x51117b(0x124)](_0x51117b(0x13f))),console[_0x51117b(0x135)](_0x51117b(0x142)+_0x2a8c03[_0x51117b(0x129)]),(_0x2a8c03[_0x51117b(0x134)]||_0x2a8c03[_0x51117b(0x119)])&&console[_0x51117b(0x135)](_0x51117b(0x14b)+[_0x2a8c03[_0x51117b(0x134)],_0x2a8c03[_0x51117b(0x119)]][_0x51117b(0x12f)](Boolean)[_0x51117b(0x146)]('\x20')),0x0;}catch(_0x5be051){return _0x5be051 instanceof HTTPClientError&&_0x5be051[_0x51117b(0x14d)]===0x191?printAuthError(_0x5be051,!![],_0xa4989):console['error'](a7_0x2ef49e['red']('✗\x20Validation\x20failed:\x20'+(_0x5be051 instanceof Error?_0x5be051['message']:String(_0x5be051)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';['description']=a7_0x1482d3(0x153);async[a7_0x1482d3(0x157)](_0xa51733){const _0xea287=a7_0x1482d3,{options:_0x4489a2}=_0xa51733,_0x5744b6=_0x4489a2[_0xea287(0x114)];console['log'](a7_0x2ef49e[_0xea287(0x11b)](_0xea287(0x117)));const _0x7230a3=await isKeychainAvailable();if(!_0x7230a3)return console[_0xea287(0x13a)](a7_0x2ef49e[_0xea287(0x11d)](_0xea287(0x15b))),0x1;const [_0x115bdc,_0x45f35d]=await Promise[_0xea287(0x147)]([deleteKeychainAPIKey(_0x5744b6),deleteOAuthTokens(_0x5744b6)]);if(_0x115bdc||_0x45f35d){clearCredentialCache();const _0x11f23e=[_0x115bdc&&_0xea287(0x138),_0x45f35d&&_0xea287(0x113)][_0xea287(0x12f)](Boolean)['join']('\x20and\x20');return console['log']('✓\x20'+_0x11f23e+_0xea287(0x123)+(_0x5744b6?_0xea287(0x12e)+_0x5744b6+')':'')),0x0;}else return console[_0xea287(0x135)](_0xea287(0x126)+(_0x5744b6?_0xea287(0x118)+_0x5744b6:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x229d3d=a8_0x5133;(function(_0x64dbff,_0x216b20){const _0x103de1=a8_0x5133,_0x160179=_0x64dbff();while(!![]){try{const _0x4f97a0=parseInt(_0x103de1(0x1bd))/0x1*(-parseInt(_0x103de1(0x1df))/0x2)+-parseInt(_0x103de1(0x1ca))/0x3+parseInt(_0x103de1(0x1d4))/0x4+-parseInt(_0x103de1(0x1cd))/0x5+-parseInt(_0x103de1(0x1e0))/0x6+parseInt(_0x103de1(0x1e2))/0x7*(parseInt(_0x103de1(0x1c5))/0x8)+parseInt(_0x103de1(0x1de))/0x9;if(_0x4f97a0===_0x216b20)break;else _0x160179['push'](_0x160179['shift']());}catch(_0x497bab){_0x160179['push'](_0x160179['shift']());}}}(a8_0x5d28,0xa303f));function a8_0x5d28(){const _0x3c1b66=['log','128nMfZus','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','us01','getUserInfo','profile','1005399zGQcAP','tdx:\x20auth\x20login','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','3152540WNWrYH','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','access_token','execute','bold','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Validating\x20OAuth\x20tokens...','797556YCkXll','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:login','Login\x20via\x20OAuth\x20(opens\x20browser)','create','/oauth/authorize','email','ERROR','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Authentication\x20successful\x20(User:\x20','25794144NPJkSa','14394LRHJho','3575172cKhoec','green','21455EtQfFp','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20\x20tdx','123AUTqZw','name','\x20(profile:\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','site','Login\x20cancelled','\x20--profile\x20'];a8_0x5d28=function(){return _0x3c1b66;};return a8_0x5d28();}import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';function a8_0x5133(_0x433b1c,_0x189b9c){_0x433b1c=_0x433b1c-0x1bd;const _0x5d28e0=a8_0x5d28();let _0x51333c=_0x5d28e0[_0x433b1c];return _0x51333c;}import{LogLevel}from'../utils/tdx-logger.js';import a8_0x21ba2f from'chalk';export async function runOAuthLoginFlow(_0x5da30c,_0x198e7b,_0x2896e1){const _0x115eb4=a8_0x5133;if(!isOAuthSupported(_0x5da30c))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x5da30c+'.\x20'+_0x115eb4(0x1c6)+_0x115eb4(0x1d2));const _0x160297=await isKeychainAvailable();if(!_0x160297)throw new Error(_0x115eb4(0x1c0)+_0x115eb4(0x1d2));const _0x19f946=getConsoleUrl(_0x5da30c);console['log']('Opening\x20browser\x20for\x20authentication...'),console[_0x115eb4(0x1c4)]('\x20\x20'+_0x19f946+_0x115eb4(0x1d9)),console[_0x115eb4(0x1c4)](_0x115eb4(0x1cc));const _0x25880e=await startOAuthFlow(_0x5da30c);console[_0x115eb4(0x1c4)](_0x115eb4(0x1d3));const _0x13d3b5=TDX[_0x115eb4(0x1d8)]({'site':_0x5da30c,'accessToken':_0x25880e[_0x115eb4(0x1cf)],'logLevel':_0x2896e1??LogLevel[_0x115eb4(0x1db)]}),_0x882dc5=await _0x13d3b5['jobs'][_0x115eb4(0x1c8)]();console[_0x115eb4(0x1c4)](a8_0x21ba2f[_0x115eb4(0x1e1)](_0x115eb4(0x1dd)+_0x882dc5[_0x115eb4(0x1da)]+')')),await saveOAuthTokens(_0x25880e,_0x198e7b),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x198e7b?_0x115eb4(0x1bf)+_0x198e7b+')':''));if(_0x198e7b){const _0xb8fe9a={'site':_0x5da30c};saveProfileToUserConfig(_0x198e7b,_0xb8fe9a),console[_0x115eb4(0x1c4)]('✓\x20Profile\x20\x27'+_0x198e7b+'\x27\x20registered');}const _0x1b85c9=_0x198e7b?_0x115eb4(0x1c3)+_0x198e7b:'';console['log'](),console[_0x115eb4(0x1c4)](_0x115eb4(0x1ce)),console[_0x115eb4(0x1c4)](_0x115eb4(0x1e4)+_0x1b85c9+_0x115eb4(0x1d5)),console[_0x115eb4(0x1c4)]('\x20\x20tdx'+_0x1b85c9+_0x115eb4(0x1dc));}export class AuthLoginCommand extends BaseCommand{[a8_0x229d3d(0x1be)]=a8_0x229d3d(0x1d6);['description']=a8_0x229d3d(0x1d7);async[a8_0x229d3d(0x1d0)](_0x24f1b5){const _0x2a5306=a8_0x229d3d,{options:_0x4cf309}=_0x24f1b5,_0x38044b=_0x4cf309[_0x2a5306(0x1c9)];console[_0x2a5306(0x1c4)](a8_0x21ba2f[_0x2a5306(0x1d1)](_0x2a5306(0x1cb)));const _0x4cf4fb=_0x4cf309[_0x2a5306(0x1c1)]||_0x2a5306(0x1c7),_0x19e2c6=await promptSiteSelection(_0x4cf4fb,_0x38044b,_0x2a5306(0x1c2));if(!_0x19e2c6)return 0x1;const _0x4113bd=resolveSite(_0x19e2c6);return console[_0x2a5306(0x1c4)](_0x2a5306(0x1e3)+_0x4113bd),await runOAuthLoginFlow(_0x4113bd,_0x38044b,_0x4cf309['logLevel']??LogLevel[_0x2a5306(0x1db)]),0x0;}}
|