@treasuredata/tdx 2026.3.10 → 2026.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a3_0x5b7a7b=a3_0x12ce;function a3_0x12ce(_0x4912e0,_0x159c0b){_0x4912e0=_0x4912e0-0x15e;const _0x1ab9a4=a3_0x1ab9();let _0x12ce72=_0x1ab9a4[_0x4912e0];return _0x12ce72;}(function(_0x27293a,_0x38bae1){const _0x4e2321=a3_0x12ce,_0x2588fb=_0x27293a();while(!![]){try{const _0x3278e0=-parseInt(_0x4e2321(0x17e))/0x1+-parseInt(_0x4e2321(0x16c))/0x2*(parseInt(_0x4e2321(0x17a))/0x3)+-parseInt(_0x4e2321(0x176))/0x4*(parseInt(_0x4e2321(0x172))/0x5)+-parseInt(_0x4e2321(0x160))/0x6*(-parseInt(_0x4e2321(0x16b))/0x7)+parseInt(_0x4e2321(0x175))/0x8*(parseInt(_0x4e2321(0x181))/0x9)+-parseInt(_0x4e2321(0x180))/0xa+parseInt(_0x4e2321(0x170))/0xb;if(_0x3278e0===_0x38bae1)break;else _0x2588fb['push'](_0x2588fb['shift']());}catch(_0x1c0b3e){_0x2588fb['push'](_0x2588fb['shift']());}}}(a3_0x1ab9,0x2d688));function a3_0x1ab9(){const _0x198518=['Error:\x20Segment\x20name\x20is\x20required','Resolved\x20parent\x20ID:\x20','Site:\x20','✔\x20Found\x20','resolveSegmentId','data','activations','7qkMiye','10qtoqHT','resolveParentId','Resolved\x20child\x20ID:\x20','Resolving\x20child\x20segment\x20\x27','8280338TuuGIx','name','10915gHQLSV','List\x20activations\x20for\x20a\x20segment','description','32zynxuV','384eYCWij','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','execute','message','179061nDzUeq','Resolving\x20parent\x20segment\x20\x27','Parent\x20name:\x20','error','68691YFgNhr','Listing\x20activations\x20for\x20segment\x20\x27','3690610zwHeOJ','37161WtyZHM','verbose','cause','segment','\x27...','2174838rcZnKc','length','Error:\x20','\x20\x20Cause:\x20'];a3_0x1ab9=function(){return _0x198518;};return a3_0x1ab9();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x5b7a7b(0x171)]=a3_0x5b7a7b(0x16a);[a3_0x5b7a7b(0x174)]=a3_0x5b7a7b(0x173);async[a3_0x5b7a7b(0x178)](_0x22326b){const _0x4522c8=a3_0x5b7a7b,{options:_0x17a543,args:_0x3f2c1c,tdx:_0x49f109}=_0x22326b;if(_0x3f2c1c[_0x4522c8(0x161)]===0x0)return console[_0x4522c8(0x17d)](_0x4522c8(0x164)),console[_0x4522c8(0x17d)](_0x4522c8(0x177)),0x1;try{const {parentId:_0x53d0c9,childId:_0x3affb6}=parseSegmentRef(_0x3f2c1c[0x0]);if(!_0x3affb6)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x4522c8(0x17d)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x17a543[_0x4522c8(0x182)]&&(console[_0x4522c8(0x17d)](_0x4522c8(0x166)+_0x17a543['site']),console[_0x4522c8(0x17d)](_0x4522c8(0x17c)+_0x53d0c9),console[_0x4522c8(0x17d)]('Child\x20name:\x20'+_0x3affb6));const _0x5a3293=await withSpinner(_0x4522c8(0x17b)+_0x53d0c9+_0x4522c8(0x15f),()=>_0x49f109[_0x4522c8(0x15e)][_0x4522c8(0x16d)](_0x53d0c9),{'verbose':_0x17a543['verbose']}),_0x57a7d4=_0x5a3293[_0x4522c8(0x169)];_0x17a543[_0x4522c8(0x182)]&&console[_0x4522c8(0x17d)](_0x4522c8(0x165)+_0x57a7d4);const _0x56bda9=await withSpinner(_0x4522c8(0x16f)+_0x3affb6+_0x4522c8(0x15f),()=>_0x49f109[_0x4522c8(0x15e)][_0x4522c8(0x168)](_0x57a7d4,_0x3affb6),{'verbose':_0x17a543[_0x4522c8(0x182)]}),_0xba49f7=_0x56bda9[_0x4522c8(0x169)];_0x17a543['verbose']&&console[_0x4522c8(0x17d)](_0x4522c8(0x16e)+_0xba49f7);const _0x1cef86=await withSpinner(_0x4522c8(0x17f)+_0x3affb6+'\x27...',()=>_0x49f109['segment']['listActivations'](_0x57a7d4,_0xba49f7),{'verbose':_0x17a543[_0x4522c8(0x182)]}),_0x4ee4a5=_0x1cef86[_0x4522c8(0x169)];return console[_0x4522c8(0x17d)](_0x4522c8(0x167)+_0x4ee4a5[_0x4522c8(0x161)]+'\x20activation'+(_0x4ee4a5[_0x4522c8(0x161)]!==0x1?'s':'')),await handleSDKOutput(_0x4ee4a5,_0x17a543),0x0;}catch(_0xd70785){if(_0xd70785 instanceof SDKError)return console[_0x4522c8(0x17d)](_0x4522c8(0x162)+_0xd70785[_0x4522c8(0x179)]),_0xd70785['cause']&&console[_0x4522c8(0x17d)](_0x4522c8(0x163)+_0xd70785[_0x4522c8(0x183)]),0x1;throw _0xd70785;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x601200=a4_0x1297;(function(_0x1e4344,_0x41d99a){const _0x446499=a4_0x1297,_0x24ac8b=_0x1e4344();while(!![]){try{const _0x3f33ec=-parseInt(_0x446499(0x105))/0x1+-parseInt(_0x446499(0x108))/0x2*(-parseInt(_0x446499(0x100))/0x3)+-parseInt(_0x446499(0x16b))/0x4*(-parseInt(_0x446499(0xe9))/0x5)+-parseInt(_0x446499(0xe5))/0x6*(parseInt(_0x446499(0x102))/0x7)+parseInt(_0x446499(0x118))/0x8+parseInt(_0x446499(0xd4))/0x9+-parseInt(_0x446499(0xba))/0xa*(parseInt(_0x446499(0x145))/0xb);if(_0x3f33ec===_0x41d99a)break;else _0x24ac8b['push'](_0x24ac8b['shift']());}catch(_0x542d86){_0x24ac8b['push'](_0x24ac8b['shift']());}}}(a4_0x3134,0x1970a));function a4_0x1297(_0x450cb1,_0xbe4519){_0x450cb1=_0x450cb1-0xb0;const _0x313403=a4_0x3134();let _0x129786=_0x313403[_0x450cb1];return _0x129786;}import a4_0x2b303b from'chalk';import a4_0xe8fa2f from'path';function a4_0x3134(){const _0x2987d6=['Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','cloneProject','updated','\x20--name\x20','reason','agentId','Project\x20cloned\x20successfully','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Dry\x20run\x20-\x20no\x20changes\x20made','pushAgent','pushProject','\x20changed','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','cwd-config','diff','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20Pulled\x20','Cancelled','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Using\x20project\x20from\x20','agent:push','yellow','Pushing\x20to\x20project...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aWrite\x20','Using\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Agent\x20\x22','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','output','Dry\x20run\x20-\x20no\x20files\x20written','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','387937zekdbX','projectDir','\x0aPull\x20summary\x20for\x20\x27','\x20created','Source:\x20','-\x20no\x20files\x20written','\x20|\x20','\x20\x20Knowledge\x20Bases:\x20','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','Agent\x20','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0a✔\x20Pushed\x20','\x0aPush\x20','\x22\x20to\x20a\x20different\x20profile','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','session','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','arg-dir','pullAgent','Using\x20project\x20from\x20context:\x20','\x20\x20Prompts:\x20','\x20files?','\x20errors','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20--profile\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','name','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','utf-8','\x0aError:','textKnowledgeBases','87908AwBHJG','prompts','integrations','Output\x20path:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','log','<new-name>','agent','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Status:\x20','Would\x20pull\x20agent:\x20','30EFgCKM','error','llmProject','tdx.json','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20resources?','Clone\x20\x22','dim','\x20\x20Target:\x20','llm_project','New\x20project\x20name\x20is\x20required','site','\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','green','join','description','isNew','force','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20integration\x20\x27','created','\x20\x20Agents:\x20','\x20updated','\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','unchanged','446670bKfLdO','counts','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Project\x20cloned\x20with\x20errors','agent.yml','No\x20tdx.json\x20found\x20in\x20','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','no_context','Failed\x20to\x20push\x20agent:\x20','experimentalArtifacts','new','Would\x20clone:','Pulling\x20agent\x20\x22','\x20=\x20','action','\x20\x20Prompt\x20\x22','919902YDUzgh','New\x20project:\x20','repeat','agent:pull','10GkkRrQ','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20files\x20to\x20','push','projectId','outputPath','dryRun','cwd','\x20new','\x0aChanges:','Agent:\x20','agent:clone','newProjectId','cyan','Project:\x20','knowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Integrations:\x20','red','\x20\x20Integration\x20\x22','total','llm','12WljkkE','\x20\x20Experimental\x20Artifacts:\x20','7DdtYyU','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','execute','76281ODMcGg','yes','hasChanges','102636vXOjke','New\x20project\x20ID:\x20','agents','-\x20nothing\x20pushed','message','\x20total','gray','Output:\x20','Chat:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22...','Using\x20local\x20project:\x20','projectName','Errors:','experimentalKnowledgeBases','profile','1125960XcjVVB','\x0aChanges\x20to\x20agent\x20\x27','dirname','errors','parse','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','sourceProjectName','Using\x20context\x20project:\x20','outputDir','INVALID_ARGUMENT'];a4_0x3134=function(){return _0x2987d6;};return a4_0x3134();}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(_0x1b8ade){const _0x18adc7=a4_0x1297,_0x621797=[];if(_0x1b8ade[_0x18adc7(0xfe)]!==undefined)_0x621797[_0x18adc7(0xec)](_0x1b8ade[_0x18adc7(0xfe)]+_0x18adc7(0x10d));if(_0x1b8ade[_0x18adc7(0xdf)]!==undefined&&_0x1b8ade[_0x18adc7(0xdf)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xdf)]+_0x18adc7(0xf1)));if(_0x1b8ade[_0x18adc7(0xce)]!==undefined&&_0x1b8ade[_0x18adc7(0xce)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xce)]+_0x18adc7(0x148)));if(_0x1b8ade[_0x18adc7(0x126)]!==undefined&&_0x1b8ade[_0x18adc7(0x126)]>0x0)_0x621797['push'](a4_0x2b303b['yellow'](_0x1b8ade[_0x18adc7(0x126)]+_0x18adc7(0xd0)));if(_0x1b8ade[_0x18adc7(0xd3)]!==undefined&&_0x1b8ade[_0x18adc7(0xd3)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0x10e)](_0x1b8ade[_0x18adc7(0xd3)]+'\x20unchanged'));if(_0x1b8ade[_0x18adc7(0x11b)]!==undefined&&_0x1b8ade['errors']>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b['red'](_0x1b8ade[_0x18adc7(0x11b)]+_0x18adc7(0x160)));return _0x621797[_0x18adc7(0xc8)](',\x20');}function displayDiffs(_0x3c1701,_0x2bb363,_0x540645,_0x49dcdf,_0x43988e,_0x650d95,_0x4876ea){const _0x50a897=a4_0x1297;for(const _0x538fdf of _0x3c1701){if(_0x538fdf['diff']){const _0x524602=_0x538fdf[_0x50a897(0x156)]||_0x538fdf[_0x50a897(0x165)];console[_0x50a897(0xb4)](_0x50a897(0x119)+_0x524602+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x538fdf[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c));}}for(const _0xaed32f of _0x2bb363){_0xaed32f[_0x50a897(0x132)]&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0xaed32f[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0xaed32f['diff']),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x3511ed of _0x540645){_0x3511ed[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0x12b)+_0x3511ed[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x3511ed[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x2c9368 of _0x49dcdf){_0x2c9368[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2c9368[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x2c9368[_0x50a897(0x132)]),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x5e228c of _0x43988e){_0x5e228c[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xcd)+_0x5e228c['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x5e228c['diff']),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x4f62ec of _0x650d95){_0x4f62ec[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4f62ec[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x4f62ec[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x1ed7bc of _0x4876ea){_0x1ed7bc[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xdb)+_0x1ed7bc['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x1ed7bc['diff']),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xe8);[a4_0x601200(0xc9)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x601200(0x104)](_0x5eb65b){const _0x288110=a4_0x601200,{options:_0x107e21,args:_0xc8e6a7,tdx:_0x583683}=_0x5eb65b,_0x3f36eb=_0xc8e6a7[0x0],_0x1d3f2e=_0xc8e6a7[0x1],_0x291846=_0x107e21[_0x288110(0x142)],_0x5631c5=_0x107e21['dryRun'],_0x4356ba=_0x107e21['force'],_0x2e4fca=_0x107e21['yes'],_0x8200d1=_0x107e21[_0x288110(0xbc)],_0x1dbe46=_0x107e21[_0x288110(0xb6)];let _0x28d24b;if(_0x3f36eb){const _0xd9fdd8=a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd));if(existsSync(_0xd9fdd8))try{const _0x52e15d=JSON[_0x288110(0x11c)](readFileSync(_0xd9fdd8,_0x288110(0x168)));_0x52e15d['llm_project']&&(_0x28d24b={'llm_project':_0x52e15d['llm_project']});}catch{}}const _0x143467=findAgentConfigPath(process[_0x288110(0xf0)]());let _0x22ec9c;if(_0x143467)try{const _0xca9784=JSON[_0x288110(0x11c)](readFileSync(_0x143467,_0x288110(0x168)));_0xca9784[_0x288110(0xc3)]&&(_0x22ec9c={'llm_project':_0xca9784[_0x288110(0xc3)]});}catch{}const _0x382d19=resolveAgentPullArgs({'arg':_0x3f36eb,'agentNameArg':_0x1d3f2e,'agentFlag':_0x1dbe46,'contextProject':_0x8200d1,'argDirConfig':_0x28d24b,'cwdConfigPath':_0x143467||undefined,'cwdConfig':_0x22ec9c}),{projectNameOrId:_0x361870,targetAgentName:_0x2dc2b4,existingOutputDir:_0x179572,source:_0x38af30}=_0x382d19;if(_0x38af30===_0x288110(0x15b))console['log'](a4_0x2b303b['dim'](_0x288110(0x138)+a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd))+':\x20'+_0x361870));else{if(_0x38af30===_0x288110(0x131))console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x13e)+_0x361870));else _0x38af30===_0x288110(0x14d)&&console['log'](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x15d)+_0x361870));}if(!_0x361870)return _0x1dbe46?(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x159))),console[_0x288110(0xb4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x288110(0xb4)](_0x288110(0x11d))):(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x111))),console['log']('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[_0x288110(0xb4)](_0x288110(0xc6)),console[_0x288110(0xb4)](_0x288110(0xd1)),console[_0x288110(0xb4)]('\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['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x2dc2b4){const {data:_0x5f46c4}=await withSpinner(_0x288110(0xe1)+_0x2dc2b4+'\x22\x20from\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm'][_0x288110(0x15c)](_0x361870,_0x2dc2b4,_0x291846,{'dryRun':_0x5631c5,'force':_0x4356ba}));if(_0x5631c5)return console['log'](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x143))),console[_0x288110(0xb4)](_0x288110(0xb9)+_0x5f46c4[_0x288110(0x156)]),console[_0x288110(0xb4)](_0x288110(0xb2)+_0x5f46c4[_0x288110(0xee)]),_0x5f46c4[_0x288110(0x132)]&&(console[_0x288110(0xb4)](_0x288110(0xf2)),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c)),console[_0x288110(0xb4)](_0x5f46c4['diff']),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c))),0x0;return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('Agent\x20pulled\x20successfully')),console[_0x288110(0xb4)](_0x288110(0xf3)+_0x5f46c4[_0x288110(0x156)]),console['log'](_0x288110(0x10f)+_0x5f46c4[_0x288110(0xee)]),console[_0x288110(0xb4)](_0x288110(0xb8)+(_0x5f46c4[_0x288110(0xca)]?a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xdf)):_0x5f46c4[_0x288110(0x107)]?a4_0x2b303b['yellow'](_0x288110(0x126)):a4_0x2b303b['gray'](_0x288110(0xd3)))),0x0;}const _0x2fee21=_0x179572||_0x291846,{data:_0x302a34}=await withSpinner('Analyzing\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm']['pullProject'](_0x361870,_0x2fee21,{'dryRun':!![]})),_0x1e9983=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)]['knowledgeBases'][_0x288110(0xdf)]+_0x302a34['counts'][_0x288110(0x16a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)]['new']+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x116)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['new'],_0x5c4e1d=_0x302a34['counts'][_0x288110(0x10a)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['updated']+_0x302a34['counts']['prompts'][_0x288110(0x126)]+_0x302a34['counts'][_0x288110(0xb1)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases']['updated']+_0x302a34['counts'][_0x288110(0xde)][_0x288110(0x126)],_0x1319e6=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['unchanged']+_0x302a34['counts'][_0x288110(0xb0)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xd3)]+_0x302a34['counts'][_0x288110(0x116)]['unchanged']+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['unchanged'];console[_0x288110(0xb4)](_0x288110(0x147)+_0x302a34[_0x288110(0x114)]+'\x27:'),console[_0x288110(0xb4)]('\x20\x20'+a4_0x2b303b[_0x288110(0xc7)]('+\x20'+_0x1e9983+'\x20new')+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0x13a)]('~\x20'+_0x5c4e1d+_0x288110(0x12f))+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0xc1)]('=\x20'+_0x1319e6+'\x20unchanged')),console['log'](_0x288110(0xcf)+formatCountSummary(_0x302a34[_0x288110(0xd5)]['agents'])),console[_0x288110(0xb4)](_0x288110(0x14c)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)])),console[_0x288110(0xb4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)])),console[_0x288110(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)])),console[_0x288110(0xb4)](_0x288110(0xfb)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb1)]));const _0x23bf14=_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases'][_0x288110(0xfe)]>0x0||_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['total']>0x0;_0x23bf14&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x116)])),console['log'](_0x288110(0x101)+formatCountSummary(_0x302a34['counts']['experimentalArtifacts'])));console[_0x288110(0xb4)](_0x288110(0xc2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x121)])),displayDiffs(_0x302a34[_0x288110(0x10a)],_0x302a34['knowledgeBases'],_0x302a34[_0x288110(0x16a)],_0x302a34['prompts'],_0x302a34['integrations'],_0x302a34[_0x288110(0x116)],_0x302a34[_0x288110(0xde)]);if(_0x5631c5)return console[_0x288110(0xb4)](a4_0x2b303b['yellow'](_0x288110(0x162))),0x0;if(_0x1e9983===0x0&&_0x5c4e1d===0x0)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xbe))),saveSessionContext({'llm_project':_0x302a34[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console['log'](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x161)+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x114)]))),0x0;if(!_0x2e4fca&&!_0x4356ba){if(!isInteractive())return console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xfc)](_0x288110(0x169)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x14e))),0x1;const _0x372669=await confirmKey(_0x288110(0x13d)+(_0x1e9983+_0x5c4e1d)+_0x288110(0x15f));if(!_0x372669)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x136)),_0x288110(0x14a)),0x1;}const {data:_0x3ca051}=await withSpinner('Writing\x20files...',()=>_0x583683[_0x288110(0xff)]['pullProject'](_0x361870,_0x2fee21,{'force':_0x4356ba}));return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x135)+(_0x1e9983+_0x5c4e1d)+_0x288110(0xeb)+_0x3ca051[_0x288110(0x121)])),saveSessionContext({'llm_project':_0x3ca051[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('✔\x20Context\x20set:\x20'+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b['cyan'](_0x3ca051[_0x288110(0x114)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xf4);[a4_0x601200(0xc9)]=a4_0x601200(0xb7);async[a4_0x601200(0x104)](_0x327271){const _0x752529=a4_0x601200,{options:_0x47afcd,args:_0x1518aa,tdx:_0x103842}=_0x327271,_0x3c2f41=_0x1518aa[0x0],_0x54abcb=_0x47afcd[_0x752529(0x165)],_0x37cf96=_0x47afcd['dryRun'],_0x4f4f50=_0x47afcd[_0x752529(0x106)],_0x13c5b6=_0x47afcd[_0x752529(0xc5)],_0xf84414=_0x47afcd[_0x752529(0xbc)];let _0x4f15ba;const _0x542d57=findAgentConfigPath(process[_0x752529(0xf0)]());if(_0x3c2f41){const _0x3eec7e=a4_0xe8fa2f[_0x752529(0xc8)](_0x3c2f41,'tdx.json');existsSync(_0x3eec7e)?(_0x4f15ba=_0x3c2f41,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x3c2f41))):_0x4f15ba=_0x3c2f41;}else{if(_0x542d57)_0x4f15ba=a4_0xe8fa2f[_0x752529(0x11a)](_0x542d57),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)]('Using\x20current\x20project:\x20'+_0x4f15ba));else{if(_0xf84414){const _0x1b76a3=sanitizeForFilesystem(_0xf84414);let _0x14eb81=_0x1b76a3,_0x298628=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x1b76a3,'tdx.json');if(!existsSync(_0x298628)){const _0x229c9e=normalizeName(_0xf84414),_0x5b00b6=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x229c9e,'tdx.json');existsSync(_0x5b00b6)&&(_0x14eb81=_0x229c9e,_0x298628=_0x5b00b6);}if(existsSync(_0x298628))_0x4f15ba=a4_0xe8fa2f['dirname'](_0x298628),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x4f15ba));else{const _0xc76242=_0x47afcd[_0x752529(0x117)];if(_0xc76242)throw new SDKError(ErrorCode[_0x752529(0x122)],_0x752529(0x157)+_0xf84414+_0x752529(0x155),undefined,{'helpText':_0x752529(0x130)+_0x752529(0xb3)+(_0x752529(0x133)+_0xf84414+'\x0a')+(_0x752529(0x152)+_0x14eb81+_0x752529(0x127)+(_0x54abcb||_0x752529(0xb5))+_0x752529(0x163)+_0xc76242)});_0x4f15ba=_0xf84414,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x120)+_0xf84414));}}}}if(!_0x4f15ba)return console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x103))),console['log'](_0x752529(0x137)),console['log'](_0x752529(0x167)),console[_0x752529(0xb4)]('\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['log'](_0x752529(0x15a)),0x1;if(!_0x54abcb)throw new SDKError(ErrorCode[_0x752529(0x151)],_0x752529(0xc4),undefined,{'helpText':_0x752529(0x123)});if(!_0x4f4f50&&!_0x37cf96){if(!isInteractive())return console[_0x752529(0xbb)](a4_0x2b303b['red'](_0x752529(0x169)),_0x752529(0x144)),console['error'](a4_0x2b303b[_0x752529(0xc1)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1dea9a=await confirmKey(_0x752529(0xc0)+_0x4f15ba+_0x752529(0x166)+_0x54abcb+'\x22?');if(!_0x1dea9a)return console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0x136))),0x1;}const {data:_0x51e613}=await withSpinner('Cloning\x20\x22'+_0x4f15ba+_0x752529(0xd2)+_0x54abcb+_0x752529(0x112),()=>_0x103842[_0x752529(0xff)][_0x752529(0x125)](_0x4f15ba,_0x54abcb,{'dryRun':_0x37cf96}));if(_0x37cf96){console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x12c))),console['log']('Source:\x20'+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x54abcb),console['log'](_0x752529(0xe0)),console[_0x752529(0xb4)](_0x752529(0xcf)+_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0xce)]),console['log'](_0x752529(0x14c)+_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0xce)]),console[_0x752529(0xb4)]('\x20\x20Prompts:\x20'+_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)][_0x752529(0xce)]);const _0x40e690=_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['created']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['created']>0x0;return _0x40e690&&(console[_0x752529(0xb4)](_0x752529(0xf9)+_0x51e613['counts'][_0x752529(0x116)][_0x752529(0xce)]),console['log'](_0x752529(0x101)+_0x51e613['counts'][_0x752529(0xde)][_0x752529(0xce)])),0x0;}const _0x24b165=_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0x11b)]>0x0||_0x51e613['counts'][_0x752529(0xb0)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['errors']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['errors']>0x0;_0x24b165?console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0xd7))):console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc7)](_0x752529(0x12a)));console['log'](_0x752529(0x149)+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x51e613['newProjectName']),console[_0x752529(0xb4)](_0x752529(0x109)+_0x51e613['newProjectId']),console[_0x752529(0xb4)](),console['log']('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)])),console[_0x752529(0xb4)](_0x752529(0x14c)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)])),console[_0x752529(0xb4)](_0x752529(0x15e)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)])),console['log'](_0x752529(0xfb)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['integrations']));const _0x127b3f=_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0xce)]>0x0||_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['unchanged']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xce)]>0x0||_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xd3)]>0x0;_0x127b3f&&(console[_0x752529(0xb4)](_0x752529(0xf9)+formatCountSummary(_0x51e613['counts'][_0x752529(0x116)])),console[_0x752529(0xb4)](_0x752529(0x101)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'])));if(_0x24b165){console[_0x752529(0xb4)](),console[_0x752529(0xb4)](a4_0x2b303b['red'](_0x752529(0x115)));for(const _0x43f9d7 of _0x51e613[_0x752529(0x10a)]){_0x43f9d7[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x140)+_0x43f9d7[_0x752529(0x156)]+_0x752529(0x11e)+_0x43f9d7[_0x752529(0xbb)]));}for(const _0x3b7cb8 of _0x51e613['knowledgeBases']){_0x3b7cb8['action']==='error'&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3b7cb8['name']+_0x752529(0x11e)+_0x3b7cb8[_0x752529(0xbb)]));}for(const _0x5887d5 of _0x51e613[_0x752529(0xb0)]){_0x5887d5['action']==='error'&&console['log'](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Prompt\x20\x22'+_0x5887d5[_0x752529(0x165)]+_0x752529(0x11e)+_0x5887d5['error']));}for(const _0x7a1e91 of _0x51e613[_0x752529(0xb1)]){_0x7a1e91['action']===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfd)+_0x7a1e91[_0x752529(0x165)]+_0x752529(0x11e)+_0x7a1e91[_0x752529(0xbb)]));}for(const _0x3f6ecc of _0x51e613[_0x752529(0x116)]){_0x3f6ecc[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfa)+_0x3f6ecc[_0x752529(0x165)]+_0x752529(0x11e)+_0x3f6ecc['error']));}for(const _0x4233a1 of _0x51e613[_0x752529(0xde)]){_0x4233a1[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x13f)+_0x4233a1[_0x752529(0x165)]+_0x752529(0x11e)+_0x4233a1['error']));}return 0x1;}console[_0x752529(0xb4)]();const _0xcf5265=getLLMProjectUrl(_0x13c5b6,_0x51e613[_0x752529(0xf5)]);return console[_0x752529(0xb4)](_0x752529(0xf7)+a4_0x2b303b[_0x752529(0xf6)](_0xcf5265)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0x139);[a4_0x601200(0xc9)]=a4_0x601200(0x164);async[a4_0x601200(0x104)](_0x18c00f){const _0x395f8e=a4_0x601200,{options:_0x2be765,args:_0xafe6ca,tdx:_0x3216d8}=_0x18c00f;let _0x19bcee=_0xafe6ca[0x0]||process[_0x395f8e(0xf0)]();const _0x2baf17=_0x2be765[_0x395f8e(0xef)],_0x1e38fe=_0x2be765[_0x395f8e(0xcb)],_0x2b6dc2=_0x2be765[_0x395f8e(0x106)],_0x391e49=_0x2be765[_0x395f8e(0xc5)],_0x10c0c5=a4_0xe8fa2f['join'](_0x19bcee,_0x395f8e(0xd8)),_0x34b3a5=existsSync(_0x10c0c5);if(_0x34b3a5){const {data:_0x1308be}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x19bcee+_0x395f8e(0x112),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12d)](_0x19bcee,{'dryRun':_0x2baf17,'force':_0x1e38fe}));if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x12c))),console[_0x395f8e(0xb4)]('Would\x20push\x20agent:\x20'+_0x1308be[_0x395f8e(0x156)]),0x0;if(_0x1308be[_0x395f8e(0xe3)]===_0x395f8e(0xbb))return console[_0x395f8e(0xb4)](a4_0x2b303b['red'](_0x395f8e(0xdd)+_0x1308be['error'])),0x1;console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x150)+_0x1308be[_0x395f8e(0xe3)]+'\x20successfully')),console[_0x395f8e(0xb4)]('Agent:\x20'+_0x1308be[_0x395f8e(0x156)]);if(_0x1308be[_0x395f8e(0x129)]&&_0x1308be[_0x395f8e(0xed)]){const _0x5efd28=getLLMAgentChatUrl(_0x391e49,_0x1308be[_0x395f8e(0xed)],_0x1308be[_0x395f8e(0x129)]);console[_0x395f8e(0xb4)](_0x395f8e(0x110)+a4_0x2b303b[_0x395f8e(0xf6)](_0x5efd28));}return 0x0;}const _0x1153f4=_0x2be765[_0x395f8e(0xbc)],_0x3b7cc=resolveProjectFromContext(_0x19bcee,_0x1153f4);if(_0x3b7cc['found'])_0x19bcee=_0x3b7cc[_0x395f8e(0x146)],_0x3b7cc[_0x395f8e(0x14f)]===_0x395f8e(0x14d)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x13e)+_0x19bcee));else{let _0x425a81=_0x395f8e(0x13c);_0x3b7cc['reason']==='no_local_folder'&&(_0x425a81=_0x3b7cc[_0x395f8e(0x10c)]+_0x395f8e(0x124)+_0x3b7cc[_0x395f8e(0xbc)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x395f8e(0x122)],_0x3b7cc[_0x395f8e(0x128)]===_0x395f8e(0xdc)?_0x3b7cc[_0x395f8e(0x10c)]:_0x395f8e(0xd9)+_0x19bcee,undefined,{'helpText':_0x425a81});}const {data:_0x9bd05f}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'dryRun':!![]})),_0x3196aa=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x10a)]['errors']>0x0;if(_0x3196aa){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)]('\x0aErrors\x20found:'));for(const _0x4ef963 of _0x9bd05f[_0x395f8e(0x10a)]){_0x4ef963[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x4ef963[_0x395f8e(0x156)]+_0x395f8e(0x11e)+_0x4ef963[_0x395f8e(0xbb)]));}return 0x1;}const _0x4f8897=_0x9bd05f['counts'][_0x395f8e(0x10a)]['created']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xf8)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts'][_0x395f8e(0xce)],_0x154138=_0x9bd05f[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x126)]+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalKnowledgeBases'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)],_0x17c47f=_0x9bd05f[_0x395f8e(0xd5)]['agents']['unchanged']+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0x16a)]['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0xd3)]+_0x9bd05f[_0x395f8e(0xd5)]['integrations']['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0xde)][_0x395f8e(0xd3)];console[_0x395f8e(0xb4)]('\x0aPush\x20summary\x20for\x20\x27'+_0x9bd05f[_0x395f8e(0x114)]+'\x27:'),console['log']('\x20\x20'+a4_0x2b303b[_0x395f8e(0xc7)]('+\x20'+_0x4f8897+'\x20new')+_0x395f8e(0x14b)+a4_0x2b303b['yellow']('~\x20'+_0x154138+_0x395f8e(0x12f))+_0x395f8e(0x14b)+a4_0x2b303b[_0x395f8e(0xc1)]('=\x20'+_0x17c47f+'\x20unchanged')),console[_0x395f8e(0xb4)](_0x395f8e(0xcf)+formatCountSummary(_0x9bd05f['counts'][_0x395f8e(0x10a)])),console['log'](_0x395f8e(0x14c)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)]['knowledgeBases'])),console[_0x395f8e(0xb4)](_0x395f8e(0xea)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)])),console[_0x395f8e(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x9bd05f['counts']['prompts'])),console['log'](_0x395f8e(0xfb)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)]));const _0x2716f5=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)]['updated']>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)]>0x0||_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts']['unchanged']>0x0;_0x2716f5&&(console[_0x395f8e(0xb4)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)])),console[_0x395f8e(0xb4)](_0x395f8e(0x101)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)])));console['log']('\x20\x20Source:\x20'+a4_0x2b303b[_0x395f8e(0xf6)](_0x19bcee)),displayDiffs(_0x9bd05f[_0x395f8e(0x10a)],_0x9bd05f[_0x395f8e(0xf8)],_0x9bd05f['textKnowledgeBases'],_0x9bd05f[_0x395f8e(0xb0)],_0x9bd05f[_0x395f8e(0xb1)],_0x9bd05f[_0x395f8e(0x116)],_0x9bd05f[_0x395f8e(0xde)]);if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x141))),0x0;if(_0x4f8897===0x0&&_0x154138===0x0){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3636a3=getLLMProjectUrl(_0x391e49,_0x9bd05f['projectId']);return console[_0x395f8e(0xb4)](_0x395f8e(0xf7)+a4_0x2b303b['cyan'](_0x3636a3)),0x0;}if(!_0x2b6dc2&&!_0x1e38fe){if(!isInteractive())return console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x169)),_0x395f8e(0x144)),console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x14e))),0x1;const _0x43ef74=await confirmKey(_0x395f8e(0x154)+(_0x4f8897+_0x154138)+_0x395f8e(0xbf));if(!_0x43ef74)return console[_0x395f8e(0xb4)](a4_0x2b303b['yellow'](_0x395f8e(0x136)),_0x395f8e(0x10b)),0x1;}const {data:_0x55c45b}=await withSpinner(_0x395f8e(0x13b),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'force':_0x1e38fe})),_0x253f24=_0x55c45b[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x11b)]>0x0||_0x55c45b['counts'][_0x395f8e(0xf8)]['errors']>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x11b)]>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0x11b)]>0x0;if(_0x253f24){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0x13a)](_0x395f8e(0xcc))),console[_0x395f8e(0xb4)](),console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x115)));for(const _0x2d218b of _0x55c45b[_0x395f8e(0x10a)]){_0x2d218b[_0x395f8e(0xe3)]==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x2d218b['agentName']+_0x395f8e(0x11e)+_0x2d218b[_0x395f8e(0xbb)]));}for(const _0x3da534 of _0x55c45b[_0x395f8e(0xf8)]){_0x3da534[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x134)+_0x3da534['name']+_0x395f8e(0x11e)+_0x3da534[_0x395f8e(0xbb)]));}for(const _0x2783a2 of _0x55c45b[_0x395f8e(0x16a)]){_0x2783a2[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xd6)+_0x2783a2[_0x395f8e(0x165)]+_0x395f8e(0x11e)+_0x2783a2[_0x395f8e(0xbb)]));}for(const _0xf9e442 of _0x55c45b[_0x395f8e(0xb0)]){_0xf9e442['action']==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xe4)+_0xf9e442[_0x395f8e(0x165)]+'\x22:\x20'+_0xf9e442[_0x395f8e(0xbb)]));}for(const _0x2cf2c3 of _0x55c45b['integrations']){_0x2cf2c3[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xfd)+_0x2cf2c3['name']+_0x395f8e(0x11e)+_0x2cf2c3[_0x395f8e(0xbb)]));}return 0x1;}console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x153)+(_0x4f8897+_0x154138)+_0x395f8e(0xda)+_0x55c45b[_0x395f8e(0x114)]+'\x27'));const _0x408d50=getLLMProjectUrl(_0x391e49,_0x55c45b[_0x395f8e(0xed)]);return console['log'](_0x395f8e(0xf7)+a4_0x2b303b[_0x395f8e(0xf6)](_0x408d50)),0x0;}}
|
|
1
|
+
function a4_0x5480(){const _0x160adc=['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)','projectDir','\x20\x20Integration\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Using\x20project\x20from\x20','agentId','source','yellow','Pushing\x20agent\x20from\x20\x22','\x20unchanged','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','New\x20project:\x20','Summary:','agent:clone','description','\x20changed','red','site','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x22:\x20','Using\x20project:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','new','cyan','errors','llm_project','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dirname','output','green','\x0aChanges:','117298qNgnVZ','\x20\x20Text\x20Knowledge\x20Bases:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','297Hpaebv','join','\x0aChanges\x20to\x20prompt\x20\x27','experimentalKnowledgeBases','920549zwMTtB','\x20resources\x20to\x20\x27','\x20|\x20','agentName','Pulling\x20agent\x20\x22','Status:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x0a✔\x20Pulled\x20','push','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','textKnowledgeBases','Analyzing\x20project\x20\x22','136260cPlMFZ','llm','\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\x20Artifacts:\x20','Analyzing\x20changes\x20to\x20push...','yes','projectId','Would\x20push\x20agent:\x20','\x22\x20to\x20\x22','New\x20project\x20name\x20is\x20required','Clone\x20\x22','execute','Failed\x20to\x20push\x20agent:\x20','force','newProjectId','cwd','Source:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20Experimental\x20Artifact\x20\x22','Cloning\x20\x22','Using\x20project\x20from\x20context:\x20','tdx.json','6luAzrg','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','11XdxJlh','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aPush\x20summary\x20for\x20\x27','arg-dir','-\x20no\x20files\x20written','\x20files\x20to\x20','Chat:\x20','sourceProjectName','profile','agents','knowledgeBases','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','reason','log','updated','Would\x20pull\x20agent:\x20','\x20\x20Knowledge\x20Base\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent:\x20','Using\x20local\x20project:\x20','session','Using\x20context\x20project:\x20','outputDir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','pushAgent','llmProject','INVALID_ARGUMENT','\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)','cwd-config','Using\x20current\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Integrations:\x20','\x0aWrite\x20','pullProject','projectName','dim','unchanged','agent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','experimentalArtifacts','Pushing\x20to\x20project...','Agent\x20','repeat','\x20\x20Target:\x20','error','\x20=\x20','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','prompts','2261148tKbhkK','Project\x20cloned\x20with\x20errors','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','parse','MISSING_ARGUMENT','\x20\x20Agent\x20\x22','agent.yml','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent:pull','created','\x0aPush\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','utf-8','3ZoQYyi','\x20\x20Agents:\x20','\x22\x20to\x20new\x20project\x20\x22','\x20updated','\x0aError:','-\x20nothing\x20pushed','found','no_local_folder','\x20\x20Knowledge\x20Bases:\x20','63582GoUSMm','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Prompt\x20\x22','\x0a✔\x20Pushed\x20','✔\x20Context\x20set:\x20','cloneProject','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20successfully','New\x20project\x20ID:\x20','Cancelled','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','context','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20new','outputPath','Output\x20path:\x20','448955BpEDXI','total','4vjTOKw','Writing\x20files...','\x20\x20tdx\x20agent\x20pull\x20','Project\x20cloned\x20successfully','agent:push','diff','action','no_context','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','17864awRrgR','Would\x20clone:','pushProject','Output:\x20','integrations','\x0aPull\x20summary\x20for\x20\x27','dryRun','Agent\x20pulled\x20successfully','Cannot\x20clone\x20from\x20context\x20project\x20\x22','counts','message','\x22\x20from\x20project\x20\x22','name','\x22...','Errors:'];a4_0x5480=function(){return _0x160adc;};return a4_0x5480();}const a4_0x321400=a4_0xe70e;(function(_0x447803,_0x2798e8){const _0xcfebc4=a4_0xe70e,_0x3f39ed=_0x447803();while(!![]){try{const _0x197d48=parseInt(_0xcfebc4(0x1b0))/0x1*(parseInt(_0xcfebc4(0x204))/0x2)+-parseInt(_0xcfebc4(0x1b9))/0x3*(-parseInt(_0xcfebc4(0x1cd))/0x4)+-parseInt(_0xcfebc4(0x1cb))/0x5+-parseInt(_0xcfebc4(0x16b))/0x6*(-parseInt(_0xcfebc4(0x20b))/0x7)+-parseInt(_0xcfebc4(0x1d6))/0x8*(-parseInt(_0xcfebc4(0x207))/0x9)+parseInt(_0xcfebc4(0x217))/0xa*(parseInt(_0xcfebc4(0x16d))/0xb)+-parseInt(_0xcfebc4(0x1a3))/0xc;if(_0x197d48===_0x2798e8)break;else _0x3f39ed['push'](_0x3f39ed['shift']());}catch(_0x38ed98){_0x3f39ed['push'](_0x3f39ed['shift']());}}}(a4_0x5480,0x21a0f));import a4_0x48726e from'chalk';import a4_0x549855 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(_0x5a915c){const _0x1c1fc0=a4_0xe70e,_0x1902f8=[];if(_0x5a915c[_0x1c1fc0(0x1cc)]!==undefined)_0x1902f8[_0x1c1fc0(0x213)](_0x5a915c[_0x1c1fc0(0x1cc)]+'\x20total');if(_0x5a915c[_0x1c1fc0(0x1fb)]!==undefined&&_0x5a915c[_0x1c1fc0(0x1fb)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e['green'](_0x5a915c[_0x1c1fc0(0x1fb)]+_0x1c1fc0(0x1c8)));if(_0x5a915c[_0x1c1fc0(0x1ac)]!==undefined&&_0x5a915c[_0x1c1fc0(0x1ac)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e[_0x1c1fc0(0x202)](_0x5a915c['created']+'\x20created'));if(_0x5a915c[_0x1c1fc0(0x17c)]!==undefined&&_0x5a915c[_0x1c1fc0(0x17c)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e[_0x1c1fc0(0x1ec)](_0x5a915c['updated']+_0x1c1fc0(0x1b3)));if(_0x5a915c[_0x1c1fc0(0x192)]!==undefined&&_0x5a915c[_0x1c1fc0(0x192)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e['gray'](_0x5a915c['unchanged']+_0x1c1fc0(0x1ee)));if(_0x5a915c['errors']!==undefined&&_0x5a915c[_0x1c1fc0(0x1fd)]>0x0)_0x1902f8['push'](a4_0x48726e[_0x1c1fc0(0x1f5)](_0x5a915c[_0x1c1fc0(0x1fd)]+'\x20errors'));return _0x1902f8[_0x1c1fc0(0x208)](',\x20');}function displayDiffs(_0x27b3e3,_0x59a2df,_0x860326,_0xaf9e3f,_0x5eb2e5,_0x35b614,_0x5eefb7){const _0x17ae34=a4_0xe70e;for(const _0x26e606 of _0x27b3e3){if(_0x26e606['diff']){const _0x365c90=_0x26e606['agentName']||_0x26e606['name'];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x365c90+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console['log'](_0x26e606[_0x17ae34(0x1d2)]),console['log']('─'['repeat'](0x3c));}}for(const _0x114384 of _0x59a2df){_0x114384[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x1c4)+_0x114384[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x114384[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x49be6b of _0x860326){_0x49be6b[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x49be6b['name']+'\x27:'),console['log']('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x49be6b['diff']),console['log']('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x32a376 of _0xaf9e3f){_0x32a376[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x209)+_0x32a376['name']+'\x27:'),console[_0x17ae34(0x17b)]('─'['repeat'](0x3c)),console['log'](_0x32a376[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0xb797b7 of _0x5eb2e5){_0xb797b7[_0x17ae34(0x1d2)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0xb797b7[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0xb797b7[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x4aa33b of _0x35b614){_0x4aa33b[_0x17ae34(0x1d2)]&&(console['log'](_0x17ae34(0x16e)+_0x4aa33b[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console['log'](_0x4aa33b[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'['repeat'](0x3c)));}for(const _0x276274 of _0x5eefb7){_0x276274[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x1e8)+_0x276274['name']+'\x27:'),console['log']('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x276274[_0x17ae34(0x1d2)]),console['log']('─'[_0x17ae34(0x19c)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x321400(0x1ab);[a4_0x321400(0x1f3)]=a4_0x321400(0x1d5);async[a4_0x321400(0x222)](_0x1596b9){const _0x1e523b=a4_0x321400,{options:_0x3042a2,args:_0x29273a,tdx:_0x4e6ba3}=_0x1596b9,_0x1b7863=_0x29273a[0x0],_0x548e3d=_0x29273a[0x1],_0x597b96=_0x3042a2[_0x1e523b(0x201)],_0x3b339b=_0x3042a2['dryRun'],_0x49167d=_0x3042a2[_0x1e523b(0x224)],_0x34d586=_0x3042a2[_0x1e523b(0x21c)],_0x267c20=_0x3042a2[_0x1e523b(0x187)],_0x321731=_0x3042a2[_0x1e523b(0x193)];let _0x5e0cb8;if(_0x1b7863){const _0x143882=a4_0x549855[_0x1e523b(0x208)](_0x1b7863,_0x1e523b(0x16a));if(existsSync(_0x143882))try{const _0x21fde1=JSON[_0x1e523b(0x1a6)](readFileSync(_0x143882,_0x1e523b(0x1af)));_0x21fde1[_0x1e523b(0x1fe)]&&(_0x5e0cb8={'llm_project':_0x21fde1[_0x1e523b(0x1fe)]});}catch{}}const _0x10483c=findAgentConfigPath(process[_0x1e523b(0x226)]());let _0x241f43;if(_0x10483c)try{const _0x5ac312=JSON[_0x1e523b(0x1a6)](readFileSync(_0x10483c,_0x1e523b(0x1af)));_0x5ac312['llm_project']&&(_0x241f43={'llm_project':_0x5ac312[_0x1e523b(0x1fe)]});}catch{}const _0x3bb4ed=resolveAgentPullArgs({'arg':_0x1b7863,'agentNameArg':_0x548e3d,'agentFlag':_0x321731,'contextProject':_0x267c20,'argDirConfig':_0x5e0cb8,'cwdConfigPath':_0x10483c||undefined,'cwdConfig':_0x241f43}),{projectNameOrId:_0x5dd36f,targetAgentName:_0x954ff1,existingOutputDir:_0x1d3f3b,source:_0x1825a6}=_0x3bb4ed;if(_0x1825a6===_0x1e523b(0x170))console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1e9)+a4_0x549855['join'](_0x1b7863,_0x1e523b(0x16a))+':\x20'+_0x5dd36f));else{if(_0x1825a6===_0x1e523b(0x18a))console[_0x1e523b(0x17b)](a4_0x48726e['dim']('Using\x20project:\x20'+_0x5dd36f));else _0x1825a6===_0x1e523b(0x1c6)&&console[_0x1e523b(0x17b)](a4_0x48726e['dim'](_0x1e523b(0x169)+_0x5dd36f));}if(!_0x5dd36f)return _0x321731?(console[_0x1e523b(0x17b)](a4_0x48726e['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1e523b(0x17b)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x1e523b(0x194))):(console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x211))),console[_0x1e523b(0x17b)](_0x1e523b(0x1e5)),console[_0x1e523b(0x17b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x1e523b(0x17b)](_0x1e523b(0x166)),console[_0x1e523b(0x17b)]('\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[_0x1e523b(0x17b)](_0x1e523b(0x219))),0x1;if(_0x954ff1){const {data:_0x413fcf}=await withSpinner(_0x1e523b(0x20f)+_0x954ff1+_0x1e523b(0x1e1)+_0x5dd36f+_0x1e523b(0x1e3),()=>_0x4e6ba3[_0x1e523b(0x218)]['pullAgent'](_0x5dd36f,_0x954ff1,_0x597b96,{'dryRun':_0x3b339b,'force':_0x49167d}));if(_0x3b339b)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x18c))),console[_0x1e523b(0x17b)](_0x1e523b(0x17d)+_0x413fcf[_0x1e523b(0x20e)]),console[_0x1e523b(0x17b)](_0x1e523b(0x1ca)+_0x413fcf[_0x1e523b(0x1c9)]),_0x413fcf[_0x1e523b(0x1d2)]&&(console[_0x1e523b(0x17b)](_0x1e523b(0x203)),console[_0x1e523b(0x17b)]('─'[_0x1e523b(0x19c)](0x3c)),console[_0x1e523b(0x17b)](_0x413fcf[_0x1e523b(0x1d2)]),console['log']('─'[_0x1e523b(0x19c)](0x3c))),0x0;return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x1dd))),console['log'](_0x1e523b(0x180)+_0x413fcf[_0x1e523b(0x20e)]),console[_0x1e523b(0x17b)](_0x1e523b(0x1d9)+_0x413fcf[_0x1e523b(0x1c9)]),console[_0x1e523b(0x17b)](_0x1e523b(0x210)+(_0x413fcf['isNew']?a4_0x48726e[_0x1e523b(0x202)]('new'):_0x413fcf['hasChanges']?a4_0x48726e['yellow'](_0x1e523b(0x17c)):a4_0x48726e[_0x1e523b(0x178)](_0x1e523b(0x192)))),0x0;}const _0x108f94=_0x1d3f3b||_0x597b96,{data:_0x81c24}=await withSpinner(_0x1e523b(0x216)+_0x5dd36f+_0x1e523b(0x1e3),()=>_0x4e6ba3[_0x1e523b(0x218)][_0x1e523b(0x18f)](_0x5dd36f,_0x108f94,{'dryRun':!![]})),_0x5904a8=_0x81c24['counts'][_0x1e523b(0x176)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1a2)]['new']+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)][_0x1e523b(0x1fb)]+_0x81c24['counts'][_0x1e523b(0x199)][_0x1e523b(0x1fb)],_0x1fe5b7=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)]['updated']+_0x81c24['counts'][_0x1e523b(0x1a2)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x17c)]+_0x81c24['counts'][_0x1e523b(0x20a)]['updated']+_0x81c24['counts'][_0x1e523b(0x199)]['updated'],_0x1b0e9b=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x192)]+_0x81c24['counts'][_0x1e523b(0x215)]['unchanged']+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1a2)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)]['experimentalKnowledgeBases'][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)]['experimentalArtifacts'][_0x1e523b(0x192)];console['log'](_0x1e523b(0x1db)+_0x81c24['projectName']+'\x27:'),console[_0x1e523b(0x17b)]('\x20\x20'+a4_0x48726e[_0x1e523b(0x202)]('+\x20'+_0x5904a8+_0x1e523b(0x1c8))+_0x1e523b(0x20d)+a4_0x48726e[_0x1e523b(0x1ec)]('~\x20'+_0x1fe5b7+_0x1e523b(0x1f4))+_0x1e523b(0x20d)+a4_0x48726e[_0x1e523b(0x191)]('=\x20'+_0x1b0e9b+_0x1e523b(0x1ee))),console['log'](_0x1e523b(0x1b1)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)])),console[_0x1e523b(0x17b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)])),console[_0x1e523b(0x17b)](_0x1e523b(0x205)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)])),console[_0x1e523b(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x81c24['counts'][_0x1e523b(0x1a2)])),console[_0x1e523b(0x17b)](_0x1e523b(0x18d)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)]));const _0x53f5d1=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)][_0x1e523b(0x1cc)]>0x0||_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x199)][_0x1e523b(0x1cc)]>0x0;_0x53f5d1&&(console[_0x1e523b(0x17b)](_0x1e523b(0x1aa)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)])),console[_0x1e523b(0x17b)](_0x1e523b(0x21a)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)]['experimentalArtifacts'])));console[_0x1e523b(0x17b)](_0x1e523b(0x19d)+a4_0x48726e[_0x1e523b(0x1fc)](_0x81c24[_0x1e523b(0x184)])),displayDiffs(_0x81c24[_0x1e523b(0x176)],_0x81c24[_0x1e523b(0x177)],_0x81c24[_0x1e523b(0x215)],_0x81c24[_0x1e523b(0x1a2)],_0x81c24[_0x1e523b(0x1da)],_0x81c24['experimentalKnowledgeBases'],_0x81c24[_0x1e523b(0x199)]);if(_0x3b339b)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x1a1))),0x0;if(_0x5904a8===0x0&&_0x1fe5b7===0x0)return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x197))),saveSessionContext({'llm_project':_0x81c24['projectName']},_0x3042a2[_0x1e523b(0x182)]),console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x1bd)+a4_0x48726e[_0x1e523b(0x191)]('llm_project')+_0x1e523b(0x19f)+a4_0x48726e[_0x1e523b(0x1fc)](_0x81c24['projectName']))),0x0;if(!_0x34d586&&!_0x49167d){if(!isInteractive())return console[_0x1e523b(0x19e)](a4_0x48726e[_0x1e523b(0x1f5)]('\x0aError:'),_0x1e523b(0x1ae)),console[_0x1e523b(0x19e)](a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1ff))),0x1;const _0x18b16e=await confirmKey(_0x1e523b(0x18e)+(_0x5904a8+_0x1fe5b7)+'\x20files?');if(!_0x18b16e)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x1c2)),_0x1e523b(0x171)),0x1;}const {data:_0x44964a}=await withSpinner(_0x1e523b(0x1ce),()=>_0x4e6ba3[_0x1e523b(0x218)][_0x1e523b(0x18f)](_0x5dd36f,_0x108f94,{'force':_0x49167d}));return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x212)+(_0x5904a8+_0x1fe5b7)+_0x1e523b(0x172)+_0x44964a[_0x1e523b(0x184)])),saveSessionContext({'llm_project':_0x44964a[_0x1e523b(0x190)]},_0x3042a2['session']),console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x202)]('✔\x20Context\x20set:\x20'+a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1fe))+_0x1e523b(0x19f)+a4_0x48726e['cyan'](_0x44964a[_0x1e523b(0x190)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x321400(0x1e2)]=a4_0x321400(0x1f2);[a4_0x321400(0x1f3)]=a4_0x321400(0x214);async['execute'](_0x5767da){const _0x27f328=a4_0x321400,{options:_0x24b6a6,args:_0x57cde5,tdx:_0x453e39}=_0x5767da,_0x5eaeba=_0x57cde5[0x0],_0x5e055d=_0x24b6a6[_0x27f328(0x1e2)],_0x29ebf6=_0x24b6a6[_0x27f328(0x1dc)],_0x1aab89=_0x24b6a6[_0x27f328(0x21c)],_0x463c1e=_0x24b6a6[_0x27f328(0x1f6)],_0x59bdcb=_0x24b6a6[_0x27f328(0x187)];let _0x42757f;const _0xbe597d=findAgentConfigPath(process[_0x27f328(0x226)]());if(_0x5eaeba){const _0x4c759d=a4_0x549855[_0x27f328(0x208)](_0x5eaeba,_0x27f328(0x16a));existsSync(_0x4c759d)?(_0x42757f=_0x5eaeba,console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x181)+_0x5eaeba))):_0x42757f=_0x5eaeba;}else{if(_0xbe597d)_0x42757f=a4_0x549855[_0x27f328(0x200)](_0xbe597d),console['log'](a4_0x48726e['dim'](_0x27f328(0x18b)+_0x42757f));else{if(_0x59bdcb){const _0x4925ab=sanitizeForFilesystem(_0x59bdcb);let _0x2fb1cd=_0x4925ab,_0xfcfdac=a4_0x549855[_0x27f328(0x208)](process[_0x27f328(0x226)](),'agents',_0x4925ab,'tdx.json');if(!existsSync(_0xfcfdac)){const _0xe28c77=normalizeName(_0x59bdcb),_0x1efd44=a4_0x549855[_0x27f328(0x208)](process[_0x27f328(0x226)](),_0x27f328(0x176),_0xe28c77,_0x27f328(0x16a));existsSync(_0x1efd44)&&(_0x2fb1cd=_0xe28c77,_0xfcfdac=_0x1efd44);}if(existsSync(_0xfcfdac))_0x42757f=a4_0x549855[_0x27f328(0x200)](_0xfcfdac),console[_0x27f328(0x17b)](a4_0x48726e['dim'](_0x27f328(0x181)+_0x42757f));else{const _0x5f19a0=_0x24b6a6[_0x27f328(0x175)];if(_0x5f19a0)throw new SDKError(ErrorCode[_0x27f328(0x188)],_0x27f328(0x1de)+_0x59bdcb+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x27f328(0x1ba)+_0x27f328(0x1fa)+(_0x27f328(0x1cf)+_0x59bdcb+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2fb1cd+'\x20--name\x20'+(_0x5e055d||'<new-name>')+_0x27f328(0x1a0)+_0x5f19a0)});_0x42757f=_0x59bdcb,console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x183)+_0x59bdcb));}}}}if(!_0x42757f)return console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1ec)](_0x27f328(0x17f))),console[_0x27f328(0x17b)](_0x27f328(0x165)),console[_0x27f328(0x17b)](_0x27f328(0x16c)),console[_0x27f328(0x17b)](_0x27f328(0x189)),console[_0x27f328(0x17b)](_0x27f328(0x1bf)),0x1;if(!_0x5e055d)throw new SDKError(ErrorCode[_0x27f328(0x1a7)],_0x27f328(0x220),undefined,{'helpText':_0x27f328(0x198)});if(!_0x1aab89&&!_0x29ebf6){if(!isInteractive())return console[_0x27f328(0x19e)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1b4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x27f328(0x19e)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x1ff))),0x1;const _0x14b51c=await confirmKey(_0x27f328(0x221)+_0x42757f+_0x27f328(0x1b2)+_0x5e055d+'\x22?');if(!_0x14b51c)return console['log'](a4_0x48726e['yellow'](_0x27f328(0x1c2))),0x1;}const {data:_0x3b8f39}=await withSpinner(_0x27f328(0x168)+_0x42757f+_0x27f328(0x21f)+_0x5e055d+_0x27f328(0x1e3),()=>_0x453e39[_0x27f328(0x218)][_0x27f328(0x1be)](_0x42757f,_0x5e055d,{'dryRun':_0x29ebf6}));if(_0x29ebf6){console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1ec)](_0x27f328(0x1c3))),console[_0x27f328(0x17b)](_0x27f328(0x164)+_0x3b8f39[_0x27f328(0x174)]),console['log']('New\x20project:\x20'+_0x5e055d),console[_0x27f328(0x17b)](_0x27f328(0x1d7)),console[_0x27f328(0x17b)](_0x27f328(0x1b1)+_0x3b8f39['counts'][_0x27f328(0x176)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x1b8)+_0x3b8f39['counts'][_0x27f328(0x177)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x1c5)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1a2)][_0x27f328(0x1ac)]);const _0x25a690=_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x1ac)]>0x0||_0x3b8f39['counts'][_0x27f328(0x199)][_0x27f328(0x1ac)]>0x0;return _0x25a690&&(console[_0x27f328(0x17b)](_0x27f328(0x1aa)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x21a)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)]['created'])),0x0;}const _0x3d2bae=_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x176)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x177)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1a2)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)]['experimentalKnowledgeBases'][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)][_0x27f328(0x1fd)]>0x0;_0x3d2bae?console[_0x27f328(0x17b)](a4_0x48726e['yellow'](_0x27f328(0x1a4))):console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x202)](_0x27f328(0x1d0)));console[_0x27f328(0x17b)]('Source:\x20'+_0x3b8f39['sourceProjectName']),console[_0x27f328(0x17b)](_0x27f328(0x1f0)+_0x3b8f39['newProjectName']),console[_0x27f328(0x17b)](_0x27f328(0x1c1)+_0x3b8f39[_0x27f328(0x225)]),console[_0x27f328(0x17b)](),console[_0x27f328(0x17b)](_0x27f328(0x1f1)),console[_0x27f328(0x17b)](_0x27f328(0x1b1)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x176)])),console[_0x27f328(0x17b)](_0x27f328(0x1b8)+formatCountSummary(_0x3b8f39['counts'][_0x27f328(0x177)])),console[_0x27f328(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3b8f39['counts'][_0x27f328(0x1a2)])),console[_0x27f328(0x17b)](_0x27f328(0x18d)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1da)]));const _0x1b7722=_0x3b8f39[_0x27f328(0x1df)]['experimentalKnowledgeBases'][_0x27f328(0x1ac)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x17c)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x192)]>0x0||_0x3b8f39[_0x27f328(0x1df)]['experimentalArtifacts']['created']>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)]['updated']>0x0||_0x3b8f39['counts'][_0x27f328(0x199)][_0x27f328(0x192)]>0x0;_0x1b7722&&(console[_0x27f328(0x17b)](_0x27f328(0x1aa)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)])),console[_0x27f328(0x17b)](_0x27f328(0x21a)+formatCountSummary(_0x3b8f39['counts']['experimentalArtifacts'])));if(_0x3d2bae){console[_0x27f328(0x17b)](),console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)]('Errors:'));for(const _0x258d54 of _0x3b8f39[_0x27f328(0x176)]){_0x258d54[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1a8)+_0x258d54[_0x27f328(0x20e)]+_0x27f328(0x1f8)+_0x258d54['error']));}for(const _0x412a19 of _0x3b8f39['knowledgeBases']){_0x412a19[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x17e)+_0x412a19[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x412a19[_0x27f328(0x19e)]));}for(const _0x55418e of _0x3b8f39[_0x27f328(0x1a2)]){_0x55418e[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1bb)+_0x55418e['name']+_0x27f328(0x1f8)+_0x55418e[_0x27f328(0x19e)]));}for(const _0x5c2b71 of _0x3b8f39['integrations']){_0x5c2b71['action']===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1e7)+_0x5c2b71[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x5c2b71['error']));}for(const _0x18d775 of _0x3b8f39['experimentalKnowledgeBases']){_0x18d775[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e['red'](_0x27f328(0x1c7)+_0x18d775[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x18d775[_0x27f328(0x19e)]));}for(const _0x476662 of _0x3b8f39[_0x27f328(0x199)]){_0x476662[_0x27f328(0x1d3)]==='error'&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x167)+_0x476662['name']+_0x27f328(0x1f8)+_0x476662[_0x27f328(0x19e)]));}return 0x1;}console[_0x27f328(0x17b)]();const _0x84daf9=getLLMProjectUrl(_0x463c1e,_0x3b8f39[_0x27f328(0x225)]);return console[_0x27f328(0x17b)](_0x27f328(0x196)+a4_0x48726e[_0x27f328(0x1fc)](_0x84daf9)),0x0;}}function a4_0xe70e(_0x3bf396,_0x277edc){_0x3bf396=_0x3bf396-0x164;const _0x548048=a4_0x5480();let _0xe70ee7=_0x548048[_0x3bf396];return _0xe70ee7;}export class AgentPushCommand extends BaseCommand{[a4_0x321400(0x1e2)]=a4_0x321400(0x1d1);[a4_0x321400(0x1f3)]=a4_0x321400(0x1ef);async[a4_0x321400(0x222)](_0x2a720b){const _0x1a54e3=a4_0x321400,{options:_0x3a6db8,args:_0x5dacba,tdx:_0x4fab18}=_0x2a720b;let _0x451ffb=_0x5dacba[0x0]||process['cwd']();const _0x12de37=_0x3a6db8['dryRun'],_0xa63e9b=_0x3a6db8[_0x1a54e3(0x224)],_0x191252=_0x3a6db8[_0x1a54e3(0x21c)],_0x28a9a7=_0x3a6db8['site'],_0x3bec93=a4_0x549855['join'](_0x451ffb,_0x1a54e3(0x1a9)),_0x355455=existsSync(_0x3bec93);if(_0x355455){const {data:_0x4086d6}=await withSpinner(_0x1a54e3(0x1ed)+_0x451ffb+_0x1a54e3(0x1e3),()=>_0x4fab18['llm'][_0x1a54e3(0x186)](_0x451ffb,{'dryRun':_0x12de37,'force':_0xa63e9b}));if(_0x12de37)return console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1ec)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1a54e3(0x17b)](_0x1a54e3(0x21e)+_0x4086d6[_0x1a54e3(0x20e)]),0x0;if(_0x4086d6['action']===_0x1a54e3(0x19e))return console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x223)+_0x4086d6[_0x1a54e3(0x19e)])),0x1;console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x19b)+_0x4086d6[_0x1a54e3(0x1d3)]+_0x1a54e3(0x1c0))),console['log']('Agent:\x20'+_0x4086d6[_0x1a54e3(0x20e)]);if(_0x4086d6[_0x1a54e3(0x1ea)]&&_0x4086d6['projectId']){const _0x8d9d4d=getLLMAgentChatUrl(_0x28a9a7,_0x4086d6[_0x1a54e3(0x21d)],_0x4086d6[_0x1a54e3(0x1ea)]);console['log'](_0x1a54e3(0x173)+a4_0x48726e[_0x1a54e3(0x1fc)](_0x8d9d4d));}return 0x0;}const _0x6cc956=_0x3a6db8[_0x1a54e3(0x187)],_0x549b31=resolveProjectFromContext(_0x451ffb,_0x6cc956);if(_0x549b31[_0x1a54e3(0x1b6)])_0x451ffb=_0x549b31[_0x1a54e3(0x1e6)],_0x549b31[_0x1a54e3(0x1eb)]===_0x1a54e3(0x1c6)&&console['log'](a4_0x48726e[_0x1a54e3(0x191)](_0x1a54e3(0x1f9)+_0x451ffb));else{let _0x49c105=_0x1a54e3(0x206);_0x549b31['reason']===_0x1a54e3(0x1b7)&&(_0x49c105=_0x549b31[_0x1a54e3(0x1e0)]+_0x1a54e3(0x1a5)+_0x549b31[_0x1a54e3(0x187)]+_0x1a54e3(0x179));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x549b31[_0x1a54e3(0x17a)]===_0x1a54e3(0x1d4)?_0x549b31[_0x1a54e3(0x1e0)]:'No\x20tdx.json\x20found\x20in\x20'+_0x451ffb,undefined,{'helpText':_0x49c105});}const {data:_0x5d7a02}=await withSpinner(_0x1a54e3(0x21b),()=>_0x4fab18[_0x1a54e3(0x218)][_0x1a54e3(0x1d8)](_0x451ffb,{'dryRun':!![]})),_0x1e7194=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['errors']>0x0;if(_0x1e7194){console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)]('\x0aErrors\x20found:'));for(const _0x3f8a7a of _0x5d7a02[_0x1a54e3(0x176)]){_0x3f8a7a['action']==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1a8)+_0x3f8a7a['agentName']+_0x1a54e3(0x1f8)+_0x3f8a7a[_0x1a54e3(0x19e)]));}return 0x1;}const _0x3e1a9e=_0x5d7a02[_0x1a54e3(0x1df)]['agents']['created']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['created']+_0x5d7a02[_0x1a54e3(0x1df)]['textKnowledgeBases']['created']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x1ac)]+_0x5d7a02['counts'][_0x1a54e3(0x1da)][_0x1a54e3(0x1ac)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)][_0x1a54e3(0x1ac)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x1ac)],_0x454f45=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['updated']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['updated']+_0x5d7a02[_0x1a54e3(0x1df)]['textKnowledgeBases'][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1da)]['updated']+_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)]['updated'],_0xcfa50c=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x215)][_0x1a54e3(0x192)]+_0x5d7a02[_0x1a54e3(0x1df)]['prompts'][_0x1a54e3(0x192)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1da)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)]['experimentalKnowledgeBases']['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x192)];console[_0x1a54e3(0x17b)](_0x1a54e3(0x16f)+_0x5d7a02[_0x1a54e3(0x190)]+'\x27:'),console[_0x1a54e3(0x17b)]('\x20\x20'+a4_0x48726e[_0x1a54e3(0x202)]('+\x20'+_0x3e1a9e+'\x20new')+_0x1a54e3(0x20d)+a4_0x48726e['yellow']('~\x20'+_0x454f45+_0x1a54e3(0x1f4))+'\x20|\x20'+a4_0x48726e[_0x1a54e3(0x191)]('=\x20'+_0xcfa50c+_0x1a54e3(0x1ee))),console[_0x1a54e3(0x17b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x1b8)+formatCountSummary(_0x5d7a02['counts'][_0x1a54e3(0x177)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x205)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x215)])),console[_0x1a54e3(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x18d)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)]['integrations']));const _0x35875e=_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x1ac)]>0x0||_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x17c)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)][_0x1a54e3(0x192)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x1ac)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)]['experimentalArtifacts']['updated']>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)]['unchanged']>0x0;_0x35875e&&(console[_0x1a54e3(0x17b)](_0x1a54e3(0x1aa)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x21a)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)])));console[_0x1a54e3(0x17b)]('\x20\x20Source:\x20'+a4_0x48726e[_0x1a54e3(0x1fc)](_0x451ffb)),displayDiffs(_0x5d7a02[_0x1a54e3(0x176)],_0x5d7a02[_0x1a54e3(0x177)],_0x5d7a02['textKnowledgeBases'],_0x5d7a02['prompts'],_0x5d7a02[_0x1a54e3(0x1da)],_0x5d7a02[_0x1a54e3(0x20a)],_0x5d7a02['experimentalArtifacts']);if(_0x12de37)return console[_0x1a54e3(0x17b)](a4_0x48726e['yellow'](_0x1a54e3(0x1f7))),0x0;if(_0x3e1a9e===0x0&&_0x454f45===0x0){console['log'](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x195)));const _0x3c7984=getLLMProjectUrl(_0x28a9a7,_0x5d7a02[_0x1a54e3(0x21d)]);return console['log'](_0x1a54e3(0x196)+a4_0x48726e['cyan'](_0x3c7984)),0x0;}if(!_0x191252&&!_0xa63e9b){if(!isInteractive())return console[_0x1a54e3(0x19e)](a4_0x48726e['red']('\x0aError:'),_0x1a54e3(0x1ae)),console[_0x1a54e3(0x19e)](a4_0x48726e['dim'](_0x1a54e3(0x1ff))),0x1;const _0x102e5d=await confirmKey(_0x1a54e3(0x1ad)+(_0x3e1a9e+_0x454f45)+'\x20resources?');if(!_0x102e5d)return console['log'](a4_0x48726e[_0x1a54e3(0x1ec)](_0x1a54e3(0x1c2)),_0x1a54e3(0x1b5)),0x1;}const {data:_0x21ba5e}=await withSpinner(_0x1a54e3(0x19a),()=>_0x4fab18[_0x1a54e3(0x218)][_0x1a54e3(0x1d8)](_0x451ffb,{'force':_0xa63e9b})),_0x95a502=_0x21ba5e['counts'][_0x1a54e3(0x176)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e['counts'][_0x1a54e3(0x177)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e[_0x1a54e3(0x1df)][_0x1a54e3(0x215)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x1fd)]>0x0;if(_0x95a502){console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1ec)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1e4)));for(const _0x101174 of _0x21ba5e[_0x1a54e3(0x176)]){_0x101174[_0x1a54e3(0x1d3)]==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1a8)+_0x101174[_0x1a54e3(0x20e)]+_0x1a54e3(0x1f8)+_0x101174['error']));}for(const _0x29ddc2 of _0x21ba5e['knowledgeBases']){_0x29ddc2[_0x1a54e3(0x1d3)]===_0x1a54e3(0x19e)&&console[_0x1a54e3(0x17b)](a4_0x48726e['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x29ddc2[_0x1a54e3(0x1e2)]+_0x1a54e3(0x1f8)+_0x29ddc2['error']));}for(const _0x589f8e of _0x21ba5e[_0x1a54e3(0x215)]){_0x589f8e[_0x1a54e3(0x1d3)]==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e['red'](_0x1a54e3(0x185)+_0x589f8e[_0x1a54e3(0x1e2)]+'\x22:\x20'+_0x589f8e[_0x1a54e3(0x19e)]));}for(const _0x46ccf5 of _0x21ba5e['prompts']){_0x46ccf5[_0x1a54e3(0x1d3)]===_0x1a54e3(0x19e)&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1bb)+_0x46ccf5[_0x1a54e3(0x1e2)]+_0x1a54e3(0x1f8)+_0x46ccf5['error']));}for(const _0x470644 of _0x21ba5e[_0x1a54e3(0x1da)]){_0x470644['action']===_0x1a54e3(0x19e)&&console['log'](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1e7)+_0x470644[_0x1a54e3(0x1e2)]+'\x22:\x20'+_0x470644['error']));}return 0x1;}console['log'](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x1bc)+(_0x3e1a9e+_0x454f45)+_0x1a54e3(0x20c)+_0x21ba5e[_0x1a54e3(0x190)]+'\x27'));const _0x429542=getLLMProjectUrl(_0x28a9a7,_0x21ba5e[_0x1a54e3(0x21d)]);return console[_0x1a54e3(0x17b)](_0x1a54e3(0x196)+a4_0x48726e[_0x1a54e3(0x1fc)](_0x429542)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x523791=a5_0x3c02;(function(_0x194fc2,_0x4c1ec9){const _0x8b398f=a5_0x3c02,_0x34af21=_0x194fc2();while(!![]){try{const _0x2dd514=parseInt(_0x8b398f(0x15d))/0x1+parseInt(_0x8b398f(0xf2))/0x2*(-parseInt(_0x8b398f(0x17d))/0x3)+parseInt(_0x8b398f(0x152))/0x4+-parseInt(_0x8b398f(0xf9))/0x5*(parseInt(_0x8b398f(0x14c))/0x6)+parseInt(_0x8b398f(0x14d))/0x7+parseInt(_0x8b398f(0xf0))/0x8*(-parseInt(_0x8b398f(0x13b))/0x9)+parseInt(_0x8b398f(0xfe))/0xa;if(_0x2dd514===_0x4c1ec9)break;else _0x34af21['push'](_0x34af21['shift']());}catch(_0x46c15d){_0x34af21['push'](_0x34af21['shift']());}}}(a5_0x381d,0x341fa));import*as a5_0x5ec645 from'node:fs';import*as a5_0x418b8b from'node:path';import a5_0x565188 from'chalk';import{BaseCommand}from'./command.js';function a5_0x3c02(_0x3258fc,_0x56c78a){_0x3258fc=_0x3258fc-0xec;const _0x381dd2=a5_0x381d();let _0x3c02c2=_0x381dd2[_0x3258fc];return _0x3c02c2;}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_0x381d(){const _0x3aef13=['green','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','no_tests','4596sDuuHq','774781ygYMMA','Project\x20path:\x20','split','conversations','agentDirs','751340BDZYNi','\x20\x20Site:\x20','status','...','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','repeat','text','filter','Re-evaluating\x20cached\x20test\x20run...','144903LUKPGw','Round\x20','start','agentName','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','json','verbose','FAIL','cyan','\x20-\x20','output','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Test\x20Summary','Running:\x20','white','resolveProjectId','\x20\x20Round\x20','table','Evaluating\x20response...','not\x20found','Site:\x20','tags','Tests\x20found:\x20','ERROR','message','...\x20','has','PASS','Round\x201/','timestamp','228024bVvdlh','Run\x20\x27tdx\x20agent\x20pull\x20',':\x20Sending\x20user\x20input...','Output\x20written\x20to:\x20','Running\x20agent\x20tests...','/<agent-name>','16BTUhgj','tests','4CGbHgo','found','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20matching:\x20','jsonl','Passed:\x20\x20\x20','join','2270vfmnWi','substring','\x20\x20Evaluating...\x20','forEach','length','5304230cbLjca','context','dim','name','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tsv','red','yellow','reason','stop','toLowerCase','Test\x20','\x20\x20-\x20','agent','Cached\x20run\x20from:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','Running\x20test:\x20','no_local_folder','\x20\x20Agent:\x20','resolve','multiple_agents','Errors:\x20\x20\x20','basename','New\x20tests\x20to\x20execute:\x20','agent:test','add','dryRun','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20(new)','404','rounds','push','Either\x20switch\x20to\x20the\x20\x22','⚠\x20SKIPPED:\x20','log','llm','description','resolveAgentId','Conversation\x20URL:\x20','Agent:\x20','includes','Test\x20Configuration:','some','projectName','executeReeval','Re-evaluation\x20Summary','now','writeFileSync','toISOString','trim','✗\x20FAIL:\x20','llmProject','\x22:\x20','no_context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','testYmlPath','Using\x20agent:\x20','\x20\x20Project:\x20','size','✗\x20ERROR:\x20','1172547wVrKxp','reeval','conversation_url','projectDir','site','existsSync','map','No\x20tests\x20found\x20with\x20tags:\x20','\x20(cached)','Failed:\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Duration:\x20','\x20\x20Conversation:\x20','isSpinning'];a5_0x381d=function(){return _0x3aef13;};return a5_0x381d();}export class AgentTestCommand extends BaseCommand{[a5_0x523791(0x101)]=a5_0x523791(0x116);[a5_0x523791(0x122)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0xbcd5c9){const _0x5e3d2d=a5_0x523791,{options:_0xcd4e8f,args:_0x14f658,tdx:_0x41a4f5}=_0xbcd5c9,_0x4d0760=_0x14f658[0x0]||'.',_0x420fd1=_0xcd4e8f[_0x5e3d2d(0x118)],_0x1e3953=_0xcd4e8f,_0x329d4d=_0x1e3953['eval']===![],_0x2894c6=_0x1e3953[_0x5e3d2d(0x13c)],_0x59f3b4=_0x1e3953['name'],_0x2e039f=_0x1e3953[_0x5e3d2d(0x174)],_0x248220=_0xcd4e8f[_0x5e3d2d(0x13f)],_0x3c2901=_0x1e3953[_0x5e3d2d(0x167)];if(_0x2894c6&&_0x329d4d)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x102))),0x1;let _0x535b4f=_0x5e3d2d(0x170);if(_0x1e3953[_0x5e3d2d(0x162)])_0x535b4f='json';else{if(_0x1e3953[_0x5e3d2d(0xf6)])_0x535b4f=_0x5e3d2d(0xf6);else{if(_0x1e3953[_0x5e3d2d(0x103)])_0x535b4f=_0x5e3d2d(0x103);else{if(_0x1e3953[_0x5e3d2d(0x170)])_0x535b4f=_0x5e3d2d(0x170);}}}const _0x4b5e84=_0x1e3953['llmProject'];let _0x55b9aa=_0x4d0760;const _0x1e9881=a5_0x5ec645[_0x5e3d2d(0x140)](_0x4d0760),_0xe6458=_0x4d0760==='.';if(!_0x1e9881||_0xe6458){const _0x6a5bee=resolveProjectFromContext(_0x4d0760,_0x4b5e84,{'requireFile':'test.yml'});if(_0x6a5bee[_0x5e3d2d(0xf3)])_0x55b9aa=_0x6a5bee['projectDir'],_0x6a5bee['source']===_0x5e3d2d(0xff)&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x137)+_0x55b9aa));else switch(_0x6a5bee[_0x5e3d2d(0x106)]){case _0x5e3d2d(0x133):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)]('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[_0x5e3d2d(0x120)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x14a));return 0x1;case _0x5e3d2d(0x10f):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x17e)+_0x6a5bee['llmProject']+_0x5e3d2d(0x158));return 0x1;case _0x5e3d2d(0x112):{const _0x4e10b3=a5_0x418b8b[_0x5e3d2d(0x114)](_0x6a5bee[_0x5e3d2d(0x13e)]);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x134)+_0x6a5bee[_0x5e3d2d(0x131)]+'\x22:'));for(const _0x35b61d of _0x6a5bee[_0x5e3d2d(0x151)]){console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10a)+_0x35b61d);}return console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x168)+_0x4e10b3+_0x5e3d2d(0xef)),0x1;}case _0x5e3d2d(0x14b):console[_0x5e3d2d(0x120)](a5_0x565188['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x6a5bee['llmProject']+'\x22.')),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x14e)+_0x6a5bee[_0x5e3d2d(0x13e)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x145));return 0x1;}}const {definition:_0x571796,agentInfo:_0x1d7abd}=parseTestFile(_0x55b9aa);let _0x1a368c=_0x571796['tests'];if(_0x59f3b4){const _0x39dd55=_0x59f3b4['split'](',')[_0x5e3d2d(0x141)](_0x28f6b0=>_0x28f6b0[_0x5e3d2d(0x12f)]());_0x1a368c=_0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0x15b)](_0xe7f222=>_0x39dd55[_0x5e3d2d(0x126)](_0xe7f222[_0x5e3d2d(0x101)]));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0xf5)+_0x59f3b4)),console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tests:\x20'+_0x571796['tests'][_0x5e3d2d(0x141)](_0x5d8324=>_0x5d8324[_0x5e3d2d(0x101)])['join'](',\x20'))),0x1;}if(_0x2e039f){const _0x39fb8b=_0x2e039f[_0x5e3d2d(0x14f)](',')['map'](_0x2588bc=>_0x2588bc[_0x5e3d2d(0x12f)]()['toLowerCase']());_0x1a368c=_0x1a368c[_0x5e3d2d(0x15b)](_0x9971c6=>_0x9971c6[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0x128)](_0x30fea4=>_0x39fb8b[_0x5e3d2d(0x126)](_0x30fea4['toLowerCase']())));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x142)+_0x2e039f));const _0x4c9f7a=new Set();return _0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0xfc)](_0x3430ca=>_0x3430ca[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfc)](_0xf68287=>_0x4c9f7a[_0x5e3d2d(0x117)](_0xf68287))),_0x4c9f7a[_0x5e3d2d(0x139)]>0x0?console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tags:\x20'+[..._0x4c9f7a]['join'](',\x20'))):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2894c6)return this[_0x5e3d2d(0x12a)](_0xbcd5c9,{'definition':{'tests':_0x1a368c},'agentInfo':_0x1d7abd,'outputFormat':_0x535b4f,'outputFile':_0x3c2901,'testNames':_0x59f3b4});if(_0x420fd1){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0x127))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x153)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x138)+a5_0x565188['white'](_0x1d7abd['projectName'])),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x110)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd[_0x5e3d2d(0x160)])),console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x175)+a5_0x565188['white'](_0x1a368c[_0x5e3d2d(0xfd)]));for(let _0x14d5f1=0x0;_0x14d5f1<_0x1a368c[_0x5e3d2d(0xfd)];_0x14d5f1++){const _0x5c44c5=_0x1a368c[_0x14d5f1],_0xe1608f=_0x5c44c5['rounds'][_0x5e3d2d(0xfd)]===0x1?'round':'rounds',_0xc7a9f=_0x5c44c5[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfd)]?'\x20['+_0x5c44c5[_0x5e3d2d(0x174)][_0x5e3d2d(0xf8)](',\x20')+']':'';console[_0x5e3d2d(0x120)]('\x20\x20'+(_0x14d5f1+0x1)+'.\x20'+a5_0x565188[_0x5e3d2d(0x16d)](_0x5c44c5[_0x5e3d2d(0x101)])+'\x20('+_0x5c44c5[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+'\x20'+_0xe1608f+')'+a5_0x565188['dim'](_0xc7a9f));}return 0x0;}let _0x190ae1,_0x5df5d8;try{_0x190ae1=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x16e)](_0x1d7abd['projectName']);}catch(_0x4e98c0){const _0x1b2808=_0x4e98c0 instanceof Error?_0x4e98c0[_0x5e3d2d(0x177)]:String(_0x4e98c0);return _0x1b2808[_0x5e3d2d(0x126)](_0x5e3d2d(0x11b))||_0x1b2808[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x129)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x1d7abd[_0x5e3d2d(0x129)]+_0x5e3d2d(0x132)+_0x1b2808)),0x1;}try{_0x5df5d8=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x123)](_0x1d7abd[_0x5e3d2d(0x160)],_0x190ae1);}catch(_0x33e78a){const _0xce51ff=_0x33e78a instanceof Error?_0x33e78a[_0x5e3d2d(0x177)]:String(_0x33e78a);return _0xce51ff['includes'](_0x5e3d2d(0x11b))||_0xce51ff[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x160)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x16a)+_0x1d7abd[_0x5e3d2d(0x160)]+_0x5e3d2d(0x132)+_0xce51ff)),0x1;}let _0x114c63;if(!_0x329d4d)try{_0x114c63=await setupEvaluatorAgent(_0x41a4f5[_0x5e3d2d(0x121)],_0xcd4e8f['verbose']);}catch(_0x1c6c41){const _0x5078c6=_0x1c6c41 instanceof Error?_0x1c6c41[_0x5e3d2d(0x177)]:String(_0x1c6c41);return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x161)+_0x5078c6)),0x1;}console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0xee))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x173)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x125)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd['projectName']+'/'+_0x1d7abd['agentName'])),console[_0x5e3d2d(0x120)]();const _0x43dc5e=[],_0x2ff229=[],_0x27e0f0=Date[_0x5e3d2d(0x12c)]();for(let _0x3c2d9a=0x0;_0x3c2d9a<_0x1a368c[_0x5e3d2d(0xfd)];_0x3c2d9a++){const _0xbbc9fb=_0x1a368c[_0x3c2d9a];_0x1a368c['length']>0x1?console[_0x5e3d2d(0x120)](_0x5e3d2d(0x109)+(_0x3c2d9a+0x1)+'/'+_0x1a368c['length']+':\x20'+a5_0x565188['white'](_0xbbc9fb[_0x5e3d2d(0x101)])):console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10e)+a5_0x565188[_0x5e3d2d(0x16d)](_0xbbc9fb[_0x5e3d2d(0x101)]));const _0x42a25f=createCommandSpinner('Round\x201/'+_0xbbc9fb[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+_0x5e3d2d(0xec));_0x42a25f[_0x5e3d2d(0x15f)]();try{const {result:_0x50aade,conversation:_0x57889f}=await runTest(_0x41a4f5[_0x5e3d2d(0x121)],_0xbbc9fb,{'agentId':_0x5df5d8,'projectId':_0x190ae1,'site':_0x248220,'noEval':_0x329d4d,'evaluatorId':_0x114c63,'onRoundStart':(_0x5c6eae,_0x3b4173)=>{const _0x17aa85=_0x5e3d2d;_0x42a25f[_0x17aa85(0x15a)]=_0x17aa85(0x15e)+(_0x5c6eae+0x1)+'/'+_0x3b4173+_0x17aa85(0xec);},'onRoundComplete':(_0x38cc37,_0x479bb9,_0x3a1e1e)=>{const _0x26ca62=_0x5e3d2d,_0x1be16b=formatElapsed(_0x479bb9);_0x3a1e1e?console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb['rounds'][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188['green']('✓')+'\x20('+_0x1be16b+')'):console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb[_0x26ca62(0x11c)][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188[_0x26ca62(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x386a6c=_0x5e3d2d;_0x42a25f[_0x386a6c(0x15a)]=_0x386a6c(0x171);},'onEvaluationComplete':_0x4203ff=>{const _0x5c5087=_0x5e3d2d,_0x8128e9=formatElapsed(_0x4203ff);console[_0x5c5087(0x120)](_0x5c5087(0xfb)+a5_0x565188[_0x5c5087(0x149)]('✓')+'\x20('+_0x8128e9+')');}});_0x42a25f[_0x5e3d2d(0x107)](),_0x43dc5e['push'](_0x50aade),_0x2ff229[_0x5e3d2d(0x11d)](_0x57889f);if(_0x50aade['status']===_0x5e3d2d(0x17a))console['log'](a5_0x565188[_0x5e3d2d(0x149)](_0x5e3d2d(0x156)+_0x50aade[_0x5e3d2d(0x106)]));else _0x50aade[_0x5e3d2d(0x154)]==='FAIL'?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20FAIL:\x20'+_0x50aade[_0x5e3d2d(0x106)])):console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x13a)+_0x50aade[_0x5e3d2d(0x106)]));_0x50aade[_0x5e3d2d(0x13d)]&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x124)+_0x50aade[_0x5e3d2d(0x13d)])),console[_0x5e3d2d(0x120)]();}catch(_0x2a2c95){_0x42a25f['stop']();const _0x128f39=_0x2a2c95 instanceof Error?_0x2a2c95['message']:String(_0x2a2c95);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20'+_0x128f39)),console['log'](),_0x43dc5e[_0x5e3d2d(0x11d)]({'name':_0xbbc9fb[_0x5e3d2d(0x101)],'status':_0x5e3d2d(0x176),'reason':_0x128f39,'timestamp':new Date()[_0x5e3d2d(0x12e)](),'duration_ms':0x0});}}const _0xf7c64c=Date[_0x5e3d2d(0x12c)]()-_0x27e0f0,_0x371e52=_0x43dc5e[_0x5e3d2d(0x15b)](_0xd5f38f=>_0xd5f38f['status']===_0x5e3d2d(0x17a))[_0x5e3d2d(0xfd)],_0x10bb26=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5c2ba6=>_0x5c2ba6[_0x5e3d2d(0x154)]==='FAIL')[_0x5e3d2d(0xfd)],_0x13a50e=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5b4fc0=>_0x5b4fc0[_0x5e3d2d(0x154)]===_0x5e3d2d(0x176))[_0x5e3d2d(0xfd)];console[_0x5e3d2d(0x120)]('━'['repeat'](0x3c)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x16b)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c)),console[_0x5e3d2d(0x120)]('Total:\x20\x20\x20\x20'+_0x43dc5e[_0x5e3d2d(0xfd)]),console[_0x5e3d2d(0x120)](_0x5e3d2d(0xf7)+a5_0x565188[_0x5e3d2d(0x149)](_0x371e52)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x144)+a5_0x565188[_0x5e3d2d(0x104)](_0x10bb26));_0x13a50e>0x0&&console['log'](_0x5e3d2d(0x113)+a5_0x565188[_0x5e3d2d(0x104)](_0x13a50e));console['log']('Duration:\x20'+formatElapsed(_0xf7c64c)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c));const _0x5b73be=_0x43dc5e[_0x5e3d2d(0x15b)](_0x3d5a2c=>_0x3d5a2c['status']!=='PASS');if(_0x5b73be[_0x5e3d2d(0xfd)]>0x0){console[_0x5e3d2d(0x120)](),console['log']('Failed\x20Tests:');for(const _0x4a1736 of _0x5b73be){const _0x43006a=a5_0x565188[_0x5e3d2d(0x104)]('✗'),_0x55132b=_0x4a1736['reason']['length']>0x32?_0x4a1736[_0x5e3d2d(0x106)][_0x5e3d2d(0xfa)](0x0,0x32)+_0x5e3d2d(0x155):_0x4a1736[_0x5e3d2d(0x106)];console[_0x5e3d2d(0x120)]('\x20\x20'+_0x43006a+'\x20'+_0x4a1736[_0x5e3d2d(0x101)]+':\x20'+_0x55132b);}}const _0x11d9ef={'summary':{'total':_0x43dc5e[_0x5e3d2d(0xfd)],'passed':_0x371e52,'failed':_0x10bb26,'errors':_0x13a50e>0x0?_0x13a50e:undefined,'duration_ms':_0xf7c64c},'tests':_0x43dc5e,'agent':{'project':_0x1d7abd[_0x5e3d2d(0x129)],'name':_0x1d7abd[_0x5e3d2d(0x160)],'site':_0x248220},'timestamp':new Date(_0x27e0f0)['toISOString']()};try{const _0x37ce7b=buildCachedTestRun(_0x2ff229,{'site':_0x248220,'projectId':_0x190ae1,'projectName':_0x1d7abd[_0x5e3d2d(0x129)],'agentId':_0x5df5d8,'agentName':_0x1d7abd['agentName'],'testYmlPath':a5_0x418b8b[_0x5e3d2d(0x111)](_0x1d7abd[_0x5e3d2d(0x136)])});saveLastTestRun(_0x37ce7b);}catch{}if(_0x535b4f!==_0x5e3d2d(0x170)||_0x3c2901){const _0x131a1f=formatResults(_0x11d9ef,_0x535b4f);if(_0x3c2901)try{a5_0x5ec645['writeFileSync'](_0x3c2901,_0x131a1f,_0x5e3d2d(0x135)),console['log'](),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0xed)+_0x3c2901));}catch(_0x1ac994){return console[_0x5e3d2d(0x120)](),console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x157)+_0x1ac994)),0x1;}else console['log'](),console[_0x5e3d2d(0x120)](_0x131a1f);}return _0x5b73be[_0x5e3d2d(0xfd)]>0x0?0x1:0x0;}async['executeReeval'](_0x1970b9,_0x504ad1){const _0x3982f5=a5_0x523791,{options:_0x2db70f,tdx:_0x5a1cfa}=_0x1970b9,{definition:_0x40b1dc,agentInfo:_0x190099,outputFormat:_0x11cc7b,outputFile:_0x4433e9}=_0x504ad1,_0x3796e4=_0x2db70f[_0x3982f5(0x13f)],_0x32b91e=loadLastTestRun();if(!_0x32b91e)return console[_0x3982f5(0x120)](a5_0x565188['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x32b91e['agent'][_0x3982f5(0x160)]!==_0x190099['agentName'])return console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x32b91e[_0x3982f5(0x10b)]['agentName']+_0x3982f5(0xf4)+_0x190099[_0x3982f5(0x160)]+'\x22.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x119))),0x1;const _0x2f242d=new Set(_0x32b91e[_0x3982f5(0x150)][_0x3982f5(0x141)](_0x541bfd=>_0x541bfd['testName'])),_0x4e3de2=_0x40b1dc[_0x3982f5(0xf1)][_0x3982f5(0x15b)](_0x152eea=>!_0x2f242d['has'](_0x152eea['name']));if(_0x4e3de2[_0x3982f5(0xfd)]>0x0&&_0x32b91e['site']!==_0x3796e4)return console['log'](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x32b91e['site']+_0x3982f5(0x10d)+_0x3796e4+'\x22.')),console['log'](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11e)+_0x32b91e[_0x3982f5(0x13f)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1109d6=_0x40b1dc['tests']['filter'](_0xfed0fc=>_0x2f242d[_0x3982f5(0x179)](_0xfed0fc[_0x3982f5(0x101)])),_0x4eb7c1=_0x4e3de2;let _0x3298bc;try{_0x3298bc=await setupEvaluatorAgent(_0x5a1cfa[_0x3982f5(0x121)],_0x2db70f[_0x3982f5(0x163)]);}catch(_0x4660b3){const _0x43b9d6=_0x4660b3 instanceof Error?_0x4660b3['message']:String(_0x4660b3);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x161)+_0x43b9d6)),0x1;}console[_0x3982f5(0x120)](a5_0x565188['cyan'](_0x3982f5(0x15c))),console[_0x3982f5(0x120)](_0x3982f5(0x10c)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x17c)])),console[_0x3982f5(0x120)](_0x3982f5(0x125)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x129)]+'/'+_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x160)]));_0x4eb7c1[_0x3982f5(0xfd)]>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x115)+a5_0x565188[_0x3982f5(0x105)](_0x4eb7c1[_0x3982f5(0xfd)]));console[_0x3982f5(0x120)]();const _0x282ca8=[],_0xfd1db6=Date[_0x3982f5(0x12c)](),_0x5c5c4d=createCommandSpinner('Re-evaluating...');if(_0x1109d6['length']>0x0)try{const _0x3cdf46=await reevaluateFromCache(_0x5a1cfa['llm'],_0x32b91e,{'tests':_0x1109d6},{'evaluatorId':_0x3298bc,'onTestStart':(_0x1dd863,_0x1528d6,_0x3108c0)=>{const _0x63ac71=_0x3982f5;_0x5c5c4d[_0x63ac71(0x15a)]='Re-evaluating\x20'+(_0x1528d6+0x1)+'/'+_0x3108c0+':\x20'+_0x1dd863+'...';if(!_0x5c5c4d[_0x63ac71(0x148)])_0x5c5c4d[_0x63ac71(0x15f)]();},'onTestComplete':(_0x5e49ce,_0x4ed3ce)=>{const _0x33a452=_0x3982f5;_0x5c5c4d[_0x33a452(0x107)]();if(_0x4ed3ce[_0x33a452(0x154)]===_0x33a452(0x17a))console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x149)](_0x33a452(0x156)+_0x5e49ce)+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143)));else _0x4ed3ce[_0x33a452(0x154)]==='FAIL'?console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x130)+_0x5e49ce+'\x20-\x20'+_0x4ed3ce[_0x33a452(0x106)])+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143))):console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x13a)+_0x5e49ce+_0x33a452(0x166)+_0x4ed3ce[_0x33a452(0x106)]));_0x4ed3ce['conversation_url']&&console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x100)](_0x33a452(0x147)+_0x4ed3ce['conversation_url'])),_0x282ca8[_0x33a452(0x11d)](_0x4ed3ce);},'onTestSkipped':(_0x13c3ab,_0x2cebac)=>{const _0x4dfe1d=_0x3982f5;_0x5c5c4d[_0x4dfe1d(0x107)](),console[_0x4dfe1d(0x120)](a5_0x565188[_0x4dfe1d(0x105)](_0x4dfe1d(0x11f)+_0x13c3ab+'\x20-\x20'+_0x2cebac));}});for(const _0x433844 of _0x3cdf46){!_0x282ca8['find'](_0x11369a=>_0x11369a[_0x3982f5(0x101)]===_0x433844[_0x3982f5(0x101)])&&_0x282ca8['push'](_0x433844);}}catch(_0xb7889b){_0x5c5c4d[_0x3982f5(0x107)]();const _0x42a35c=_0xb7889b instanceof Error?_0xb7889b[_0x3982f5(0x177)]:String(_0xb7889b);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x169)+_0x42a35c)),0x1;}_0x5c5c4d[_0x3982f5(0x107)]();if(_0x4eb7c1[_0x3982f5(0xfd)]>0x0){console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x2a93ae,agentId:_0x12466d}=_0x32b91e[_0x3982f5(0x10b)];for(const _0x2bd9a9 of _0x4eb7c1){console[_0x3982f5(0x120)](_0x3982f5(0x16c)+a5_0x565188[_0x3982f5(0x16d)](_0x2bd9a9[_0x3982f5(0x101)]));const _0x7eafb2=createCommandSpinner(_0x3982f5(0x17b)+_0x2bd9a9[_0x3982f5(0x11c)][_0x3982f5(0xfd)]+':\x20Sending\x20user\x20input...');_0x7eafb2[_0x3982f5(0x15f)]();try{const {result:_0x5eb39c}=await runTest(_0x5a1cfa[_0x3982f5(0x121)],_0x2bd9a9,{'agentId':_0x12466d,'projectId':_0x2a93ae,'site':_0x32b91e['site'],'noEval':![],'evaluatorId':_0x3298bc,'onRoundStart':(_0x21de15,_0x3e9225)=>{const _0x38735f=_0x3982f5;_0x7eafb2[_0x38735f(0x15a)]=_0x38735f(0x15e)+(_0x21de15+0x1)+'/'+_0x3e9225+_0x38735f(0xec);},'onRoundComplete':(_0x461ddc,_0x3bdc3b,_0xd22a32)=>{const _0x1874f0=_0x3982f5,_0x57ff50=formatElapsed(_0x3bdc3b);_0xd22a32?console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x149)]('✓')+'\x20('+_0x57ff50+')'):console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x215b36=_0x3982f5;_0x7eafb2[_0x215b36(0x15a)]=_0x215b36(0x171);},'onEvaluationComplete':_0x31a421=>{const _0x50d86f=_0x3982f5,_0x3ddbfa=formatElapsed(_0x31a421);console['log'](_0x50d86f(0xfb)+a5_0x565188[_0x50d86f(0x149)]('✓')+'\x20('+_0x3ddbfa+')');}});_0x7eafb2[_0x3982f5(0x107)](),_0x282ca8[_0x3982f5(0x11d)](_0x5eb39c);if(_0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x17a))console[_0x3982f5(0x120)](a5_0x565188['green'](_0x3982f5(0x156)+_0x5eb39c[_0x3982f5(0x106)])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a)));else _0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x164)?console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x130)+_0x5eb39c['reason'])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a))):console['log'](a5_0x565188[_0x3982f5(0x104)](_0x3982f5(0x13a)+_0x5eb39c[_0x3982f5(0x106)]));_0x5eb39c[_0x3982f5(0x13d)]&&console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x147)+_0x5eb39c[_0x3982f5(0x13d)]));}catch(_0x28b509){_0x7eafb2[_0x3982f5(0x107)]();const _0x545d31=_0x28b509 instanceof Error?_0x28b509[_0x3982f5(0x177)]:String(_0x28b509);console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('✗\x20ERROR:\x20'+_0x545d31)),_0x282ca8['push']({'name':_0x2bd9a9['name'],'status':_0x3982f5(0x176),'reason':_0x545d31,'timestamp':new Date()[_0x3982f5(0x12e)](),'duration_ms':0x0});}}}console[_0x3982f5(0x120)]();const _0x466971=Date[_0x3982f5(0x12c)]()-_0xfd1db6,_0x3ccc0c=_0x282ca8['filter'](_0x98808b=>_0x98808b[_0x3982f5(0x154)]===_0x3982f5(0x17a))[_0x3982f5(0xfd)],_0x5a4f89=_0x282ca8[_0x3982f5(0x15b)](_0x842a=>_0x842a['status']===_0x3982f5(0x164))[_0x3982f5(0xfd)],_0x1b38c1=_0x282ca8['filter'](_0xb7612d=>_0xb7612d[_0x3982f5(0x154)]===_0x3982f5(0x176))[_0x3982f5(0xfd)];console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)](_0x3982f5(0x12b)),console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)]('Total:\x20\x20\x20\x20'+_0x282ca8[_0x3982f5(0xfd)]),console[_0x3982f5(0x120)](_0x3982f5(0xf7)+a5_0x565188[_0x3982f5(0x149)](_0x3ccc0c)),console[_0x3982f5(0x120)](_0x3982f5(0x144)+a5_0x565188[_0x3982f5(0x104)](_0x5a4f89));_0x1b38c1>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x113)+a5_0x565188[_0x3982f5(0x104)](_0x1b38c1));console[_0x3982f5(0x120)](_0x3982f5(0x146)+formatElapsed(_0x466971)),console['log']('━'[_0x3982f5(0x159)](0x3c));const _0x46a370={'summary':{'total':_0x282ca8[_0x3982f5(0xfd)],'passed':_0x3ccc0c,'failed':_0x5a4f89,'errors':_0x1b38c1>0x0?_0x1b38c1:undefined,'duration_ms':_0x466971},'tests':_0x282ca8,'agent':{'project':_0x190099[_0x3982f5(0x129)],'name':_0x190099[_0x3982f5(0x160)],'site':_0x3796e4},'timestamp':new Date(_0xfd1db6)[_0x3982f5(0x12e)]()};if(_0x11cc7b!=='table'||_0x4433e9){const _0xc0dc35=formatResults(_0x46a370,_0x11cc7b);if(_0x4433e9)try{a5_0x5ec645[_0x3982f5(0x12d)](_0x4433e9,_0xc0dc35,'utf-8'),console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Output\x20written\x20to:\x20'+_0x4433e9));}catch(_0x1892d8){return console[_0x3982f5(0x120)](),console['log'](a5_0x565188['red'](_0x3982f5(0x157)+_0x1892d8)),0x1;}else console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](_0xc0dc35);}const _0x325423=_0x282ca8[_0x3982f5(0x15b)](_0x327177=>_0x327177[_0x3982f5(0x154)]!==_0x3982f5(0x17a));return _0x325423[_0x3982f5(0xfd)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0xb0df85=a5_0x1e4a;function a5_0x1e4a(_0x3a36b2,_0x2a904a){_0x3a36b2=_0x3a36b2-0x138;const _0x2fe819=a5_0x2fe8();let _0x1e4a4f=_0x2fe819[_0x3a36b2];return _0x1e4a4f;}(function(_0xbd2e7,_0x424a1d){const _0x209128=a5_0x1e4a,_0x5b6166=_0xbd2e7();while(!![]){try{const _0x36d920=parseInt(_0x209128(0x143))/0x1*(parseInt(_0x209128(0x1c5))/0x2)+-parseInt(_0x209128(0x14b))/0x3*(-parseInt(_0x209128(0x175))/0x4)+-parseInt(_0x209128(0x158))/0x5*(parseInt(_0x209128(0x1c6))/0x6)+-parseInt(_0x209128(0x194))/0x7+parseInt(_0x209128(0x18f))/0x8*(-parseInt(_0x209128(0x190))/0x9)+parseInt(_0x209128(0x1c3))/0xa+parseInt(_0x209128(0x183))/0xb*(parseInt(_0x209128(0x1b7))/0xc);if(_0x36d920===_0x424a1d)break;else _0x5b6166['push'](_0x5b6166['shift']());}catch(_0xb151b8){_0x5b6166['push'](_0x5b6166['shift']());}}}(a5_0x2fe8,0xe4783));import*as a5_0x1a911a from'node:fs';import*as a5_0x163c04 from'node:path';import a5_0x1f5500 from'chalk';import{BaseCommand}from'./command.js';function a5_0x2fe8(){const _0x204497=['no_local_folder','Passed:\x20\x20\x20','reeval','isSpinning','size','no_context','green','\x20\x20Round\x20','status','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','PASS','jsonl','\x20\x20Site:\x20','✗\x20ERROR:\x20','toLowerCase','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','resolve','tags','Using\x20agent:\x20','Evaluating\x20response...','agent:test','No\x20tests\x20have\x20tags\x20defined.','ERROR','table','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Test\x20','stop','600DoqziF','start','reason','Executing\x20new\x20tests...','test.yml','log','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Conversation:\x20','\x20\x20Project:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Test\x20Summary','filter','...','55AKyQDf','output','found','agentDirs','length','has','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Agent:\x20','agentName','yellow','cyan','dim','8304vGntVP','9711KWkUgv','map','...\x20','Failed:\x20\x20\x20','6749904GbZLab','multiple_agents','Available\x20tests:\x20','✓\x20PASS:\x20','context','eval','verbose','Test\x20Configuration:','tsv','Total:\x20\x20\x20\x20','json','No\x20tests\x20found\x20with\x20tags:\x20','site','writeFileSync','split','tests','404','FAIL','description','agent','red','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','not\x20found','\x27\x20to\x20create\x20the\x20folder\x20structure.','Cached\x20run\x20from:\x20','join','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20-\x20','✗\x20FAIL:\x20','\x20\x20Agent:\x20','timestamp','Usage:','Available\x20tags:\x20','Re-evaluating...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','3536868wPggqQ','toISOString','now','resolveProjectId','\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','Conversation\x20URL:\x20','text','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','No\x20tests\x20found\x20matching:\x20','Tests\x20found:\x20','add','utf-8','14886040bokSdd','\x22:\x20','1880514sQQuhF','102shbPsA','Site:\x20','push','Re-evaluation\x20Summary','Output\x20written\x20to:\x20','New\x20tests\x20to\x20execute:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Running:\x20','includes','repeat','white','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','\x20(new)','✗\x20ERROR:\x20Project\x20not\x20found:\x20','llm','projectName','rounds','find','1ihRaBM','Error\x20writing\x20output\x20file:\x20','Project\x20path:\x20','message','Run\x20tests\x20for\x20an\x20LLM\x20agent','Round\x201/','Round\x20','no_tests','7413WCyLwq','llmProject','Duration:\x20','projectDir','Error:\x20No\x20previous\x20test\x20run\x20found.','execute','forEach',':\x20Sending\x20user\x20input...','conversations','name','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','trim','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','368565UhwTRF','conversation_url'];a5_0x2fe8=function(){return _0x204497;};return a5_0x2fe8();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xb0df85(0x154)]=a5_0xb0df85(0x16e);[a5_0xb0df85(0x1a6)]=a5_0xb0df85(0x147);async[a5_0xb0df85(0x150)](_0x1c1ced){const _0x447390=a5_0xb0df85,{options:_0x3ca6e7,args:_0x3e8562,tdx:_0x362700}=_0x1c1ced,_0x65541c=_0x3e8562[0x0]||'.',_0x18ac5d=_0x3ca6e7['dryRun'],_0x1e8f72=_0x3ca6e7,_0x202e12=_0x1e8f72[_0x447390(0x199)]===![],_0x492ff8=_0x1e8f72[_0x447390(0x15c)],_0x3437a8=_0x1e8f72['name'],_0x51fd06=_0x1e8f72[_0x447390(0x16b)],_0x3972b2=_0x3ca6e7[_0x447390(0x1a0)],_0x249c90=_0x1e8f72[_0x447390(0x184)];if(_0x492ff8&&_0x202e12)return console[_0x447390(0x17a)](a5_0x1f5500['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2309b4=_0x447390(0x171);if(_0x1e8f72[_0x447390(0x19e)])_0x2309b4=_0x447390(0x19e);else{if(_0x1e8f72[_0x447390(0x165)])_0x2309b4=_0x447390(0x165);else{if(_0x1e8f72[_0x447390(0x19c)])_0x2309b4='tsv';else{if(_0x1e8f72[_0x447390(0x171)])_0x2309b4=_0x447390(0x171);}}}const _0x260b47=_0x1e8f72[_0x447390(0x14c)];let _0x2d8b35=_0x65541c;const _0x1c4296=a5_0x1a911a['existsSync'](_0x65541c),_0x57a89b=_0x65541c==='.';if(!_0x1c4296||_0x57a89b){const _0x1f57a7=resolveProjectFromContext(_0x65541c,_0x260b47,{'requireFile':_0x447390(0x179)});if(_0x1f57a7[_0x447390(0x185)])_0x2d8b35=_0x1f57a7['projectDir'],_0x1f57a7['source']===_0x447390(0x198)&&console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x16c)+_0x2d8b35));else switch(_0x1f57a7[_0x447390(0x177)]){case _0x447390(0x15f):console['log'](a5_0x1f5500[_0x447390(0x18c)](_0x1f57a7[_0x447390(0x146)])),console[_0x447390(0x17a)](),console['log'](_0x447390(0x1b3)),console[_0x447390(0x17a)](_0x447390(0x1bb)),console[_0x447390(0x17a)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x447390(0x17a)](),console['log'](_0x447390(0x163));return 0x1;case _0x447390(0x15a):console['log'](a5_0x1f5500[_0x447390(0x18c)](_0x1f57a7[_0x447390(0x146)])),console[_0x447390(0x17a)](),console['log'](_0x447390(0x1cc)+_0x1f57a7[_0x447390(0x14c)]+_0x447390(0x1ab));return 0x1;case _0x447390(0x195):{const _0x5c7fcb=a5_0x163c04['basename'](_0x1f57a7['projectDir']);console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18c)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x1f57a7[_0x447390(0x14c)]+'\x22:'));for(const _0x4e0556 of _0x1f57a7[_0x447390(0x186)]){console[_0x447390(0x17a)]('\x20\x20-\x20'+_0x4e0556);}return console[_0x447390(0x17a)](),console[_0x447390(0x17a)](_0x447390(0x169)+_0x5c7fcb+'/<agent-name>'),0x1;}case _0x447390(0x14a):console[_0x447390(0x17a)](a5_0x1f5500['yellow'](_0x447390(0x155)+_0x1f57a7[_0x447390(0x14c)]+'\x22.')),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x145)+_0x1f57a7[_0x447390(0x14e)])),console[_0x447390(0x17a)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1cf8eb,agentInfo:_0x255fd3}=parseTestFile(_0x2d8b35);let _0x1a378b=_0x1cf8eb[_0x447390(0x1a3)];if(_0x3437a8){const _0x1b1ee5=_0x3437a8[_0x447390(0x1a2)](',')[_0x447390(0x191)](_0x2663c2=>_0x2663c2[_0x447390(0x156)]());_0x1a378b=_0x1cf8eb[_0x447390(0x1a3)][_0x447390(0x181)](_0x4505a1=>_0x1b1ee5['includes'](_0x4505a1[_0x447390(0x154)]));if(_0x1a378b['length']===0x0)return console['log'](a5_0x1f5500['yellow'](_0x447390(0x1bf)+_0x3437a8)),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x196)+_0x1cf8eb['tests'][_0x447390(0x191)](_0x5c15f6=>_0x5c15f6[_0x447390(0x154)])[_0x447390(0x1ad)](',\x20'))),0x1;}if(_0x51fd06){const _0x103603=_0x51fd06['split'](',')[_0x447390(0x191)](_0x2c55a5=>_0x2c55a5[_0x447390(0x156)]()['toLowerCase']());_0x1a378b=_0x1a378b[_0x447390(0x181)](_0xebe82a=>_0xebe82a[_0x447390(0x16b)]?.['some'](_0xaa9417=>_0x103603['includes'](_0xaa9417[_0x447390(0x168)]())));if(_0x1a378b[_0x447390(0x187)]===0x0){console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18c)](_0x447390(0x19f)+_0x51fd06));const _0x1cafb6=new Set();return _0x1cf8eb['tests'][_0x447390(0x151)](_0x395436=>_0x395436['tags']?.['forEach'](_0x856bcb=>_0x1cafb6[_0x447390(0x1c1)](_0x856bcb))),_0x1cafb6[_0x447390(0x15e)]>0x0?console['log'](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x1b4)+[..._0x1cafb6]['join'](',\x20'))):console['log'](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x16f))),0x1;}}if(_0x492ff8)return this['executeReeval'](_0x1c1ced,{'definition':{'tests':_0x1a378b},'agentInfo':_0x255fd3,'outputFormat':_0x2309b4,'outputFile':_0x249c90,'testNames':_0x3437a8});if(_0x18ac5d){console['log'](a5_0x1f5500[_0x447390(0x18d)](_0x447390(0x19b))),console[_0x447390(0x17a)](_0x447390(0x166)+a5_0x1f5500[_0x447390(0x13a)](_0x3972b2)),console['log'](_0x447390(0x17d)+a5_0x1f5500[_0x447390(0x13a)](_0x255fd3[_0x447390(0x140)])),console[_0x447390(0x17a)](_0x447390(0x1b1)+a5_0x1f5500['white'](_0x255fd3[_0x447390(0x18b)])),console['log'](),console['log'](_0x447390(0x1c0)+a5_0x1f5500['white'](_0x1a378b[_0x447390(0x187)]));for(let _0x2a6d77=0x0;_0x2a6d77<_0x1a378b[_0x447390(0x187)];_0x2a6d77++){const _0x36ff35=_0x1a378b[_0x2a6d77],_0x271367=_0x36ff35[_0x447390(0x141)][_0x447390(0x187)]===0x1?'round':'rounds',_0x274fa5=_0x36ff35[_0x447390(0x16b)]?.['length']?'\x20['+_0x36ff35[_0x447390(0x16b)]['join'](',\x20')+']':'';console[_0x447390(0x17a)]('\x20\x20'+(_0x2a6d77+0x1)+'.\x20'+a5_0x1f5500[_0x447390(0x13a)](_0x36ff35[_0x447390(0x154)])+'\x20('+_0x36ff35[_0x447390(0x141)][_0x447390(0x187)]+'\x20'+_0x271367+')'+a5_0x1f5500[_0x447390(0x18e)](_0x274fa5));}return 0x0;}let _0x5aeaaa,_0x6273dc;try{_0x5aeaaa=await _0x362700[_0x447390(0x13f)][_0x447390(0x1ba)](_0x255fd3['projectName']);}catch(_0x4e7124){const _0x3236fc=_0x4e7124 instanceof Error?_0x4e7124[_0x447390(0x146)]:String(_0x4e7124);return _0x3236fc[_0x447390(0x138)](_0x447390(0x1a4))||_0x3236fc[_0x447390(0x168)]()[_0x447390(0x138)](_0x447390(0x1aa))?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x13e)+_0x255fd3[_0x447390(0x140)])):console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x1a9)+_0x255fd3[_0x447390(0x140)]+'\x22:\x20'+_0x3236fc)),0x1;}try{_0x6273dc=await _0x362700[_0x447390(0x13f)]['resolveAgentId'](_0x255fd3[_0x447390(0x18b)],_0x5aeaaa);}catch(_0x3d79a2){const _0x416284=_0x3d79a2 instanceof Error?_0x3d79a2[_0x447390(0x146)]:String(_0x3d79a2);return _0x416284['includes']('404')||_0x416284[_0x447390(0x168)]()[_0x447390(0x138)]('not\x20found')?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x1b6)+_0x255fd3[_0x447390(0x18b)])):console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x189)+_0x255fd3[_0x447390(0x18b)]+_0x447390(0x1c4)+_0x416284)),0x1;}let _0x4486a5;if(!_0x202e12)try{_0x4486a5=await setupEvaluatorAgent(_0x362700[_0x447390(0x13f)],_0x3ca6e7[_0x447390(0x19a)]);}catch(_0x1940c0){const _0x3fc0f3=_0x1940c0 instanceof Error?_0x1940c0['message']:String(_0x1940c0);return console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3fc0f3)),0x1;}console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18d)]('Running\x20agent\x20tests...')),console[_0x447390(0x17a)](_0x447390(0x1c7)+a5_0x1f5500['white'](_0x3972b2)),console['log'](_0x447390(0x18a)+a5_0x1f5500[_0x447390(0x13a)](_0x255fd3['projectName']+'/'+_0x255fd3[_0x447390(0x18b)])),console[_0x447390(0x17a)]();const _0x2ac577=[],_0x421542=[],_0x11032d=Date[_0x447390(0x1b9)]();for(let _0x2854f9=0x0;_0x2854f9<_0x1a378b['length'];_0x2854f9++){const _0x224892=_0x1a378b[_0x2854f9];_0x1a378b[_0x447390(0x187)]>0x1?console[_0x447390(0x17a)](_0x447390(0x173)+(_0x2854f9+0x1)+'/'+_0x1a378b[_0x447390(0x187)]+':\x20'+a5_0x1f5500['white'](_0x224892[_0x447390(0x154)])):console['log']('Running\x20test:\x20'+a5_0x1f5500[_0x447390(0x13a)](_0x224892[_0x447390(0x154)]));const _0x211ad8=createCommandSpinner(_0x447390(0x148)+_0x224892[_0x447390(0x141)]['length']+_0x447390(0x152));_0x211ad8[_0x447390(0x176)]();try{const {result:_0xce5cc5,conversation:_0x239e3c}=await runTest(_0x362700[_0x447390(0x13f)],_0x224892,{'agentId':_0x6273dc,'projectId':_0x5aeaaa,'site':_0x3972b2,'noEval':_0x202e12,'evaluatorId':_0x4486a5,'onRoundStart':(_0x7e8822,_0x4bc2b3)=>{const _0x3cf4f5=_0x447390;_0x211ad8[_0x3cf4f5(0x1bd)]=_0x3cf4f5(0x149)+(_0x7e8822+0x1)+'/'+_0x4bc2b3+_0x3cf4f5(0x152);},'onRoundComplete':(_0x3c0025,_0x1c45af,_0x36ea84)=>{const _0x375beb=_0x447390,_0x46bb09=formatElapsed(_0x1c45af);_0x36ea84?console[_0x375beb(0x17a)](_0x375beb(0x161)+(_0x3c0025+0x1)+'/'+_0x224892['rounds'][_0x375beb(0x187)]+_0x375beb(0x192)+a5_0x1f5500[_0x375beb(0x160)]('✓')+'\x20('+_0x46bb09+')'):console[_0x375beb(0x17a)](_0x375beb(0x161)+(_0x3c0025+0x1)+'/'+_0x224892['rounds'][_0x375beb(0x187)]+_0x375beb(0x192)+a5_0x1f5500[_0x375beb(0x1a8)]('✗'));},'onEvaluationStart':()=>{const _0x3bd89e=_0x447390;_0x211ad8[_0x3bd89e(0x1bd)]=_0x3bd89e(0x16d);},'onEvaluationComplete':_0x2dc74b=>{const _0x45605a=_0x447390,_0x27a4e8=formatElapsed(_0x2dc74b);console[_0x45605a(0x17a)]('\x20\x20Evaluating...\x20'+a5_0x1f5500[_0x45605a(0x160)]('✓')+'\x20('+_0x27a4e8+')');}});_0x211ad8[_0x447390(0x174)](),_0x2ac577[_0x447390(0x1c8)](_0xce5cc5),_0x421542[_0x447390(0x1c8)](_0x239e3c);if(_0xce5cc5[_0x447390(0x162)]===_0x447390(0x164))console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x160)](_0x447390(0x197)+_0xce5cc5[_0x447390(0x177)]));else _0xce5cc5[_0x447390(0x162)]===_0x447390(0x1a5)?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20FAIL:\x20'+_0xce5cc5[_0x447390(0x177)])):console['log'](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x167)+_0xce5cc5[_0x447390(0x177)]));_0xce5cc5[_0x447390(0x159)]&&console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x1bc)+_0xce5cc5['conversation_url'])),console[_0x447390(0x17a)]();}catch(_0x3c7493){_0x211ad8['stop']();const _0xf9f83c=_0x3c7493 instanceof Error?_0x3c7493[_0x447390(0x146)]:String(_0x3c7493);console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20ERROR:\x20'+_0xf9f83c)),console[_0x447390(0x17a)](),_0x2ac577['push']({'name':_0x224892[_0x447390(0x154)],'status':_0x447390(0x170),'reason':_0xf9f83c,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x25dfe5=Date[_0x447390(0x1b9)]()-_0x11032d,_0x38a8aa=_0x2ac577[_0x447390(0x181)](_0x24c8e2=>_0x24c8e2[_0x447390(0x162)]==='PASS')[_0x447390(0x187)],_0x59034a=_0x2ac577[_0x447390(0x181)](_0x5d31c2=>_0x5d31c2[_0x447390(0x162)]===_0x447390(0x1a5))['length'],_0x4ee738=_0x2ac577[_0x447390(0x181)](_0x27b199=>_0x27b199[_0x447390(0x162)]==='ERROR')[_0x447390(0x187)];console[_0x447390(0x17a)]('━'[_0x447390(0x139)](0x3c)),console['log'](_0x447390(0x180)),console[_0x447390(0x17a)]('━'[_0x447390(0x139)](0x3c)),console['log'](_0x447390(0x19d)+_0x2ac577[_0x447390(0x187)]),console[_0x447390(0x17a)](_0x447390(0x15b)+a5_0x1f5500[_0x447390(0x160)](_0x38a8aa)),console['log'](_0x447390(0x193)+a5_0x1f5500[_0x447390(0x1a8)](_0x59034a));_0x4ee738>0x0&&console[_0x447390(0x17a)]('Errors:\x20\x20\x20'+a5_0x1f5500['red'](_0x4ee738));console[_0x447390(0x17a)](_0x447390(0x14d)+formatElapsed(_0x25dfe5)),console['log']('━'['repeat'](0x3c));const _0x31e14a=_0x2ac577[_0x447390(0x181)](_0x4a7b32=>_0x4a7b32[_0x447390(0x162)]!=='PASS');if(_0x31e14a['length']>0x0){console[_0x447390(0x17a)](),console['log']('Failed\x20Tests:');for(const _0x545113 of _0x31e14a){const _0x40f749=a5_0x1f5500['red']('✗'),_0x3b8057=_0x545113[_0x447390(0x177)][_0x447390(0x187)]>0x32?_0x545113[_0x447390(0x177)]['substring'](0x0,0x32)+'...':_0x545113[_0x447390(0x177)];console[_0x447390(0x17a)]('\x20\x20'+_0x40f749+'\x20'+_0x545113[_0x447390(0x154)]+':\x20'+_0x3b8057);}}const _0x170a6c={'summary':{'total':_0x2ac577[_0x447390(0x187)],'passed':_0x38a8aa,'failed':_0x59034a,'errors':_0x4ee738>0x0?_0x4ee738:undefined,'duration_ms':_0x25dfe5},'tests':_0x2ac577,'agent':{'project':_0x255fd3[_0x447390(0x140)],'name':_0x255fd3['agentName'],'site':_0x3972b2},'timestamp':new Date(_0x11032d)[_0x447390(0x1b8)]()};try{const _0x20a7c0=buildCachedTestRun(_0x421542,{'site':_0x3972b2,'projectId':_0x5aeaaa,'projectName':_0x255fd3[_0x447390(0x140)],'agentId':_0x6273dc,'agentName':_0x255fd3[_0x447390(0x18b)],'testYmlPath':a5_0x163c04[_0x447390(0x16a)](_0x255fd3['testYmlPath'])});saveLastTestRun(_0x20a7c0);}catch{}if(_0x2309b4!=='table'||_0x249c90){const _0x472577=formatResults(_0x170a6c,_0x2309b4);if(_0x249c90)try{a5_0x1a911a[_0x447390(0x1a1)](_0x249c90,_0x472577,_0x447390(0x1c2)),console[_0x447390(0x17a)](),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x1ca)+_0x249c90));}catch(_0x3ad8e2){return console[_0x447390(0x17a)](),console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x144)+_0x3ad8e2)),0x1;}else console[_0x447390(0x17a)](),console[_0x447390(0x17a)](_0x472577);}return _0x31e14a[_0x447390(0x187)]>0x0?0x1:0x0;}async['executeReeval'](_0x4ce18d,_0x2c3211){const _0x34468b=a5_0xb0df85,{options:_0x3d1013,tdx:_0x38193d}=_0x4ce18d,{definition:_0x54e22a,agentInfo:_0x3975dc,outputFormat:_0x31e6ce,outputFile:_0x2b9fe2}=_0x2c3211,_0x3473a2=_0x3d1013['site'],_0x420908=loadLastTestRun();if(!_0x420908)return console['log'](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x14f))),console['log'](a5_0x1f5500['dim'](_0x34468b(0x17e))),0x1;if(_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]!==_0x3975dc[_0x34468b(0x18b)])return console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x17f)+_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]+_0x34468b(0x13b)+_0x3975dc[_0x34468b(0x18b)]+'\x22.')),console['log'](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1be))),0x1;const _0x46ab01=new Set(_0x420908[_0x34468b(0x153)]['map'](_0x530e10=>_0x530e10['testName'])),_0x2c24ba=_0x54e22a[_0x34468b(0x1a3)][_0x34468b(0x181)](_0x21ef67=>!_0x46ab01[_0x34468b(0x188)](_0x21ef67['name']));if(_0x2c24ba[_0x34468b(0x187)]>0x0&&_0x420908[_0x34468b(0x1a0)]!==_0x3473a2)return console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x172))),console['log'](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1ae)+_0x420908[_0x34468b(0x1a0)]+_0x34468b(0x17b)+_0x3473a2+'\x22.')),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x13c)+_0x420908['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4d75dc=_0x54e22a[_0x34468b(0x1a3)][_0x34468b(0x181)](_0x27d256=>_0x46ab01[_0x34468b(0x188)](_0x27d256['name'])),_0x1d09f7=_0x2c24ba;let _0x17536c;try{_0x17536c=await setupEvaluatorAgent(_0x38193d[_0x34468b(0x13f)],_0x3d1013['verbose']);}catch(_0x2e1d18){const _0x2bb8a4=_0x2e1d18 instanceof Error?_0x2e1d18[_0x34468b(0x146)]:String(_0x2e1d18);return console[_0x34468b(0x17a)](a5_0x1f5500['red'](_0x34468b(0x157)+_0x2bb8a4)),0x1;}console['log'](a5_0x1f5500[_0x34468b(0x18d)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x34468b(0x17a)](_0x34468b(0x1ac)+a5_0x1f5500[_0x34468b(0x13a)](_0x420908[_0x34468b(0x1b2)])),console[_0x34468b(0x17a)](_0x34468b(0x18a)+a5_0x1f5500[_0x34468b(0x13a)](_0x420908[_0x34468b(0x1a7)]['projectName']+'/'+_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]));_0x1d09f7[_0x34468b(0x187)]>0x0&&console[_0x34468b(0x17a)](_0x34468b(0x1cb)+a5_0x1f5500[_0x34468b(0x18c)](_0x1d09f7[_0x34468b(0x187)]));console[_0x34468b(0x17a)]();const _0x29328d=[],_0x12d404=Date[_0x34468b(0x1b9)](),_0x30cdc5=createCommandSpinner(_0x34468b(0x1b5));if(_0x4d75dc[_0x34468b(0x187)]>0x0)try{const _0x4a0646=await reevaluateFromCache(_0x38193d[_0x34468b(0x13f)],_0x420908,{'tests':_0x4d75dc},{'evaluatorId':_0x17536c,'onTestStart':(_0x2cb884,_0x540e43,_0x471d64)=>{const _0x4739c8=_0x34468b;_0x30cdc5[_0x4739c8(0x1bd)]='Re-evaluating\x20'+(_0x540e43+0x1)+'/'+_0x471d64+':\x20'+_0x2cb884+_0x4739c8(0x182);if(!_0x30cdc5[_0x4739c8(0x15d)])_0x30cdc5[_0x4739c8(0x176)]();},'onTestComplete':(_0x27d8bf,_0x289f53)=>{const _0x474c80=_0x34468b;_0x30cdc5[_0x474c80(0x174)]();if(_0x289f53[_0x474c80(0x162)]===_0x474c80(0x164))console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x160)](_0x474c80(0x197)+_0x27d8bf)+a5_0x1f5500[_0x474c80(0x18e)]('\x20(cached)'));else _0x289f53[_0x474c80(0x162)]===_0x474c80(0x1a5)?console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x1a8)]('✗\x20FAIL:\x20'+_0x27d8bf+_0x474c80(0x1af)+_0x289f53['reason'])+a5_0x1f5500[_0x474c80(0x18e)]('\x20(cached)')):console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x1a8)](_0x474c80(0x167)+_0x27d8bf+'\x20-\x20'+_0x289f53[_0x474c80(0x177)]));_0x289f53[_0x474c80(0x159)]&&console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x18e)](_0x474c80(0x17c)+_0x289f53[_0x474c80(0x159)])),_0x29328d['push'](_0x289f53);},'onTestSkipped':(_0x3b350b,_0xfe552c)=>{const _0x4b368d=_0x34468b;_0x30cdc5['stop'](),console[_0x4b368d(0x17a)](a5_0x1f5500[_0x4b368d(0x18c)]('⚠\x20SKIPPED:\x20'+_0x3b350b+_0x4b368d(0x1af)+_0xfe552c));}});for(const _0x4b4ac2 of _0x4a0646){!_0x29328d[_0x34468b(0x142)](_0x1adf60=>_0x1adf60[_0x34468b(0x154)]===_0x4b4ac2[_0x34468b(0x154)])&&_0x29328d[_0x34468b(0x1c8)](_0x4b4ac2);}}catch(_0x2b195a){_0x30cdc5[_0x34468b(0x174)]();const _0x219917=_0x2b195a instanceof Error?_0x2b195a[_0x34468b(0x146)]:String(_0x2b195a);return console[_0x34468b(0x17a)](a5_0x1f5500['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x219917)),0x1;}_0x30cdc5['stop']();if(_0x1d09f7[_0x34468b(0x187)]>0x0){console['log'](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18d)](_0x34468b(0x178)));const {projectId:_0x2ef814,agentId:_0x101469}=_0x420908[_0x34468b(0x1a7)];for(const _0x410dd4 of _0x1d09f7){console['log'](_0x34468b(0x1cd)+a5_0x1f5500[_0x34468b(0x13a)](_0x410dd4['name']));const _0x5153c3=createCommandSpinner(_0x34468b(0x148)+_0x410dd4[_0x34468b(0x141)][_0x34468b(0x187)]+_0x34468b(0x152));_0x5153c3[_0x34468b(0x176)]();try{const {result:_0x260c29}=await runTest(_0x38193d['llm'],_0x410dd4,{'agentId':_0x101469,'projectId':_0x2ef814,'site':_0x420908[_0x34468b(0x1a0)],'noEval':![],'evaluatorId':_0x17536c,'onRoundStart':(_0x2dd463,_0x3d688f)=>{const _0x345218=_0x34468b;_0x5153c3[_0x345218(0x1bd)]=_0x345218(0x149)+(_0x2dd463+0x1)+'/'+_0x3d688f+_0x345218(0x152);},'onRoundComplete':(_0x533624,_0x57416e,_0x51bb61)=>{const _0x407f8e=_0x34468b,_0x4963c7=formatElapsed(_0x57416e);_0x51bb61?console[_0x407f8e(0x17a)]('\x20\x20Round\x20'+(_0x533624+0x1)+'/'+_0x410dd4['rounds'][_0x407f8e(0x187)]+_0x407f8e(0x192)+a5_0x1f5500[_0x407f8e(0x160)]('✓')+'\x20('+_0x4963c7+')'):console[_0x407f8e(0x17a)]('\x20\x20Round\x20'+(_0x533624+0x1)+'/'+_0x410dd4[_0x407f8e(0x141)][_0x407f8e(0x187)]+_0x407f8e(0x192)+a5_0x1f5500[_0x407f8e(0x1a8)]('✗'));},'onEvaluationStart':()=>{const _0x2ba94d=_0x34468b;_0x5153c3[_0x2ba94d(0x1bd)]='Evaluating\x20response...';},'onEvaluationComplete':_0x7b6a07=>{const _0x166207=_0x34468b,_0x442c74=formatElapsed(_0x7b6a07);console[_0x166207(0x17a)]('\x20\x20Evaluating...\x20'+a5_0x1f5500[_0x166207(0x160)]('✓')+'\x20('+_0x442c74+')');}});_0x5153c3[_0x34468b(0x174)](),_0x29328d[_0x34468b(0x1c8)](_0x260c29);if(_0x260c29[_0x34468b(0x162)]===_0x34468b(0x164))console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x160)](_0x34468b(0x197)+_0x260c29[_0x34468b(0x177)])+a5_0x1f5500['dim']('\x20(new)'));else _0x260c29[_0x34468b(0x162)]===_0x34468b(0x1a5)?console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x1b0)+_0x260c29['reason'])+a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x13d))):console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x167)+_0x260c29[_0x34468b(0x177)]));_0x260c29[_0x34468b(0x159)]&&console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x17c)+_0x260c29[_0x34468b(0x159)]));}catch(_0x1f6382){_0x5153c3[_0x34468b(0x174)]();const _0x275365=_0x1f6382 instanceof Error?_0x1f6382[_0x34468b(0x146)]:String(_0x1f6382);console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x167)+_0x275365)),_0x29328d[_0x34468b(0x1c8)]({'name':_0x410dd4['name'],'status':_0x34468b(0x170),'reason':_0x275365,'timestamp':new Date()[_0x34468b(0x1b8)](),'duration_ms':0x0});}}}console[_0x34468b(0x17a)]();const _0x2f77b0=Date[_0x34468b(0x1b9)]()-_0x12d404,_0x5d0a7a=_0x29328d[_0x34468b(0x181)](_0x2fd522=>_0x2fd522[_0x34468b(0x162)]===_0x34468b(0x164))[_0x34468b(0x187)],_0x1add85=_0x29328d[_0x34468b(0x181)](_0x23cf31=>_0x23cf31['status']===_0x34468b(0x1a5))[_0x34468b(0x187)],_0x1ee92a=_0x29328d[_0x34468b(0x181)](_0x351b0c=>_0x351b0c[_0x34468b(0x162)]===_0x34468b(0x170))[_0x34468b(0x187)];console[_0x34468b(0x17a)]('━'['repeat'](0x3c)),console[_0x34468b(0x17a)](_0x34468b(0x1c9)),console[_0x34468b(0x17a)]('━'['repeat'](0x3c)),console[_0x34468b(0x17a)]('Total:\x20\x20\x20\x20'+_0x29328d[_0x34468b(0x187)]),console[_0x34468b(0x17a)](_0x34468b(0x15b)+a5_0x1f5500[_0x34468b(0x160)](_0x5d0a7a)),console[_0x34468b(0x17a)]('Failed:\x20\x20\x20'+a5_0x1f5500['red'](_0x1add85));_0x1ee92a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1f5500[_0x34468b(0x1a8)](_0x1ee92a));console[_0x34468b(0x17a)](_0x34468b(0x14d)+formatElapsed(_0x2f77b0)),console[_0x34468b(0x17a)]('━'['repeat'](0x3c));const _0x3875bf={'summary':{'total':_0x29328d[_0x34468b(0x187)],'passed':_0x5d0a7a,'failed':_0x1add85,'errors':_0x1ee92a>0x0?_0x1ee92a:undefined,'duration_ms':_0x2f77b0},'tests':_0x29328d,'agent':{'project':_0x3975dc[_0x34468b(0x140)],'name':_0x3975dc[_0x34468b(0x18b)],'site':_0x3473a2},'timestamp':new Date(_0x12d404)[_0x34468b(0x1b8)]()};if(_0x31e6ce!=='table'||_0x2b9fe2){const _0x3a220a=formatResults(_0x3875bf,_0x31e6ce);if(_0x2b9fe2)try{a5_0x1a911a[_0x34468b(0x1a1)](_0x2b9fe2,_0x3a220a,'utf-8'),console[_0x34468b(0x17a)](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1ca)+_0x2b9fe2));}catch(_0x5819cf){return console['log'](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x144)+_0x5819cf)),0x1;}else console['log'](),console[_0x34468b(0x17a)](_0x3a220a);}const _0x15e7c4=_0x29328d[_0x34468b(0x181)](_0x5011c1=>_0x5011c1[_0x34468b(0x162)]!=='PASS');return _0x15e7c4[_0x34468b(0x187)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a6_0x2b53a3=a6_0x2ab9;(function(_0x447d43,_0x55f267){const _0x20cc9a=a6_0x2ab9,_0xc5a553=_0x447d43();while(!![]){try{const _0x4462a1=parseInt(_0x20cc9a(0x1c0))/0x1+parseInt(_0x20cc9a(0x1bc))/0x2+parseInt(_0x20cc9a(0x1c7))/0x3+parseInt(_0x20cc9a(0x1bb))/0x4+parseInt(_0x20cc9a(0x1ee))/0x5+-parseInt(_0x20cc9a(0x1ea))/0x6+-parseInt(_0x20cc9a(0x1d6))/0x7;if(_0x4462a1===_0x55f267)break;else _0xc5a553['push'](_0xc5a553['shift']());}catch(_0x302657){_0xc5a553['push'](_0xc5a553['shift']());}}}(a6_0x1568,0x9b87e));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_0x2b53a3(0x1e5),a6_0x2b53a3(0x1dc),a6_0x2b53a3(0x1b5),a6_0x2b53a3(0x1de),a6_0x2b53a3(0x1c8),a6_0x2b53a3(0x1df),a6_0x2b53a3(0x1b6),a6_0x2b53a3(0x1bf)]);function isSensitiveHeader(_0x7811f9){const _0x14b7b1=a6_0x2b53a3;return SENSITIVE_HEADERS['has'](_0x7811f9[_0x14b7b1(0x1cb)]());}function parseHeader(_0x16851f){const _0xe492e6=a6_0x2b53a3,_0x48d029=_0x16851f[_0xe492e6(0x1e4)](':');if(_0x48d029===-0x1)throw new Error(_0xe492e6(0x1b0)+_0x16851f+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x412c8a=_0x16851f[_0xe492e6(0x1ec)](0x0,_0x48d029)[_0xe492e6(0x1c4)](),_0x53e903=_0x16851f[_0xe492e6(0x1ec)](_0x48d029+0x1)['trim']();if(!_0x412c8a)throw new Error(_0xe492e6(0x1eb)+_0x16851f+'\x22');return[_0x412c8a,_0x53e903];}function a6_0x2ab9(_0xa52ee5,_0x461cc9){_0xa52ee5=_0xa52ee5-0x1b0;const _0x1568cd=a6_0x1568();let _0x2ab96b=_0x1568cd[_0xa52ee5];return _0x2ab96b;}function a6_0x1568(){const _0x60c087=['join','cookie','x-auth-token','toUpperCase','includes','<\x20HTTP/1.1\x20','message','9592pcVnaZ','867212ZPLQbG','description','startsWith','x-trino-user','1140882ybQIXc','DELETE','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','trim','llm','GET','3318057NuBAbu','set-cookie2','entries','Error:\x20','toLowerCase','color','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','api','headers','Invalid\x20HTTP\x20method:\x20','execute','noColor','type','header','POST','15223334iOXGmp','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','site','log','trino','keys','proxy-authorization','length','set-cookie','x-xsrf-token','method','validate','\x0aStack\x20trace:\x0a','.\x20Valid\x20methods:\x20','indexOf','authorization','error','verbose','PUT','file','939000tPOolC','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','substring','cdp','1427055fazPLP','status','Invalid\x20header\x20format:\x20\x22','.\x20Valid\x20types:\x20','isArray','data'];a6_0x1568=function(){return _0x60c087;};return a6_0x1568();}export class ApiCommand extends BaseCommand{['name']=a6_0x2b53a3(0x1ce);[a6_0x2b53a3(0x1bd)]=a6_0x2b53a3(0x1c2);[a6_0x2b53a3(0x1e1)](_0x3da1f3){const _0x3b2747=a6_0x2b53a3,{args:_0xc17068,options:_0x1c65b3}=_0x3da1f3,_0x40c75b=_0x1c65b3;if(_0xc17068[_0x3b2747(0x1dd)]===0x0)return _0x3b2747(0x1d7);const _0x4bf330=_0xc17068[0x0];if(!_0x4bf330[_0x3b2747(0x1be)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x4bf330;const _0x1b9fe8=_0x40c75b[_0x3b2747(0x1b3)],_0x3f82a8=_0x40c75b[_0x3b2747(0x1e9)];if(_0x1b9fe8&&_0x3f82a8)return _0x3b2747(0x1cd);const _0x49e70c=_0x40c75b[_0x3b2747(0x1e0)]||_0x3b2747(0x1c6),_0x58e708=[_0x3b2747(0x1c6),_0x3b2747(0x1d5),_0x3b2747(0x1e8),_0x3b2747(0x1c1),'PATCH'];if(!_0x58e708[_0x3b2747(0x1b8)](_0x49e70c[_0x3b2747(0x1b7)]()))return _0x3b2747(0x1d0)+_0x49e70c+_0x3b2747(0x1e3)+_0x58e708['join'](',\x20');const _0x3a2e41=_0x40c75b[_0x3b2747(0x1d3)]||'td',_0x2f1f98=['td',_0x3b2747(0x1ed),'workflow',_0x3b2747(0x1da),_0x3b2747(0x1c5),'llm-proxy'];if(!_0x2f1f98[_0x3b2747(0x1b8)](_0x3a2e41))return'Invalid\x20API\x20type:\x20'+_0x3a2e41+_0x3b2747(0x1b1)+_0x2f1f98[_0x3b2747(0x1b4)](',\x20');return undefined;}async[a6_0x2b53a3(0x1d1)](_0x206e87){const _0x5a8521=a6_0x2b53a3,{options:_0x15ed8e,args:_0x3f4055,tdx:_0x264dec}=_0x206e87,_0x36bb75=_0x15ed8e,_0x2c8f72=_0x3f4055[0x0],_0x1c8a51=(_0x36bb75[_0x5a8521(0x1e0)]||_0x5a8521(0x1c6))['toUpperCase'](),_0x5b0cd2=_0x36bb75['data'],_0x3c22e5=_0x36bb75[_0x5a8521(0x1e9)],_0x528117=_0x36bb75[_0x5a8521(0x1d4)],_0x28d5a6=_0x36bb75[_0x5a8521(0x1d3)]||'td';try{const _0x34a255={};if(_0x528117){const _0x32cfe4=Array[_0x5a8521(0x1b2)](_0x528117)?_0x528117:[_0x528117];for(const _0x33a80b of _0x32cfe4){const [_0x4f8642,_0x3f375e]=parseHeader(_0x33a80b);_0x34a255[_0x4f8642]=_0x3f375e;}}let _0x3159b6;if(_0x5b0cd2)_0x3159b6=_0x5b0cd2;else{if(_0x3c22e5)try{_0x3159b6=RawAPI['readBodyFromFile'](_0x3c22e5);}catch(_0x1cfdcd){return console[_0x5a8521(0x1e6)](_0x5a8521(0x1ca)+(_0x1cfdcd instanceof Error?_0x1cfdcd[_0x5a8521(0x1ba)]:String(_0x1cfdcd))),0x1;}}const _0x60fc62={'method':_0x1c8a51,'apiType':_0x28d5a6,'includeHeaders':_0x15ed8e['verbose']};_0x3159b6&&(_0x60fc62['body']=_0x3159b6);Object[_0x5a8521(0x1db)](_0x34a255)['length']>0x0&&(_0x60fc62[_0x5a8521(0x1cf)]=_0x34a255);if(_0x15ed8e[_0x5a8521(0x1e7)]){const _0x4528fe=resolveSite(_0x15ed8e[_0x5a8521(0x1d8)]),_0x519765=getEndpoint(_0x4528fe,_0x28d5a6),_0x452ab9=''+_0x519765+_0x2c8f72;console[_0x5a8521(0x1e6)]('>\x20'+_0x1c8a51+'\x20'+_0x452ab9);const _0x54f61e=getAuthHeaders(_0x4528fe),_0x58a86a={..._0x54f61e,..._0x34a255};for(const [_0x242d76,_0x44d636]of Object[_0x5a8521(0x1c9)](_0x58a86a)){!isSensitiveHeader(_0x242d76)&&console[_0x5a8521(0x1e6)]('>\x20'+_0x242d76+':\x20'+_0x44d636);}_0x3159b6&&console[_0x5a8521(0x1e6)]('>'),console[_0x5a8521(0x1e6)]('');}const _0x54fbf1=await _0x264dec['api']['request'](_0x2c8f72,_0x60fc62);if(_0x15ed8e[_0x5a8521(0x1e7)]&&_0x54fbf1[_0x5a8521(0x1cf)]){console[_0x5a8521(0x1e6)](_0x5a8521(0x1b9)+_0x54fbf1[_0x5a8521(0x1ef)]);for(const [_0x1d03c4,_0x746cd4]of Object[_0x5a8521(0x1c9)](_0x54fbf1[_0x5a8521(0x1cf)])){!isSensitiveHeader(_0x1d03c4)&&console[_0x5a8521(0x1e6)]('<\x20'+_0x1d03c4+':\x20'+_0x746cd4);}console[_0x5a8521(0x1e6)]('');}const _0x2e91a5=Boolean(_0x15ed8e[_0x5a8521(0x1c3)]),_0x1b032f={'color':_0x15ed8e[_0x5a8521(0x1cc)],'noColor':_0x15ed8e[_0x5a8521(0x1d2)]||_0x2e91a5&&!_0x15ed8e['color']},_0x419e27=colorizeJSON(_0x54fbf1['data'],_0x1b032f);return _0x15ed8e[_0x5a8521(0x1c3)]?(writeFileSync(_0x15ed8e[_0x5a8521(0x1c3)],_0x419e27),console[_0x5a8521(0x1e6)]('Results\x20saved\x20to\x20'+_0x15ed8e[_0x5a8521(0x1c3)])):console[_0x5a8521(0x1d9)](_0x419e27),0x0;}catch(_0x240a7c){return _0x240a7c instanceof Error?(console[_0x5a8521(0x1e6)](_0x5a8521(0x1ca)+_0x240a7c[_0x5a8521(0x1ba)]),_0x15ed8e[_0x5a8521(0x1e7)]&&_0x240a7c['stack']&&console[_0x5a8521(0x1e6)](_0x5a8521(0x1e2)+_0x240a7c['stack'])):console['error']('Error:\x20'+String(_0x240a7c)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x11b603=a7_0x198d;(function(_0x31c7b3,_0x5d6a8b){const _0x4152d5=a7_0x198d,_0x1b2b80=_0x31c7b3();while(!![]){try{const _0x544e62=parseInt(_0x4152d5(0x1a3))/0x1*(-parseInt(_0x4152d5(0x19e))/0x2)+parseInt(_0x4152d5(0x1c0))/0x3+parseInt(_0x4152d5(0x1a9))/0x4+parseInt(_0x4152d5(0x1bc))/0x5*(-parseInt(_0x4152d5(0x197))/0x6)+parseInt(_0x4152d5(0x1bd))/0x7+parseInt(_0x4152d5(0x1aa))/0x8*(parseInt(_0x4152d5(0x192))/0x9)+-parseInt(_0x4152d5(0x18c))/0xa*(parseInt(_0x4152d5(0x19d))/0xb);if(_0x544e62===_0x5d6a8b)break;else _0x1b2b80['push'](_0x1b2b80['shift']());}catch(_0x618a90){_0x1b2b80['push'](_0x1b2b80['shift']());}}}(a7_0x1a32,0x35065));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';function a7_0x1a32(){const _0xaedcc5=['jobs','join','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','last_name','Read\x20credential\x20from\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Remove\x20API\x20key\x20from\x20system\x20keychain','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20(site:\x20','3130zKXQAD','us01','message','create','tdx:\x20auth\x20setup','/app/mp/ak','522gIWiJV','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','apiKey','select','oauth','30mrzPrw','auth:clear','\x27\x20registered','\x20removed\x20from\x20keychain','Validating\x20API\x20key...','password','7403dclhdi','2278lIVKEU','OAuth\x20(browser\x20login)','tdx:\x20auth\x20clear','auth','ERROR','34LvtIrw','bold','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20tdx','N/A','description','1516792SeXOHR','2224xqgHeZ','✗\x20Validation\x20failed:\x20','error','API\x20key\x20cannot\x20be\x20empty','\x20for\x20profile:\x20','\x20and\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','warn','\x20(profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','name','API\x20Key','Read\x20credential\x20from\x20keychain','✓\x20Authentication\x20successful\x0a','filter','Choose\x20authentication\x20method:','email','Setup\x20API\x20key\x20authentication\x20interactively','80035IfQyMe','115325LLPoby','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','first_name','404406vkCSbK','API\x20key','yellow','apikey','tdx\x20profile:\x20','log','Credential\x20type:\x20OAuth','No\x20credentials\x20found\x20in\x20keychain','method','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','logLevel','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','status','execute','all','User:\x20','trim','site','red','getUserInfo','green','profile'];a7_0x1a32=function(){return _0xaedcc5;};return a7_0x1a32();}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_0x3e9c11 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x198d(_0x2bae06,_0x3d5f46){_0x2bae06=_0x2bae06-0x18a;const _0x1a320e=a7_0x1a32();let _0x198d41=_0x1a320e[_0x2bae06];return _0x198d41;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1dac8f from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x11b603(0x1b4)]='auth:setup';[a7_0x11b603(0x1a8)]=a7_0x11b603(0x1bb);async[a7_0x11b603(0x1cd)](_0x3c64a9){const _0x14f07b=a7_0x11b603,{options:_0x3b5883}=_0x3c64a9,_0x57cf90=_0x3b5883[_0x14f07b(0x1d5)];console[_0x14f07b(0x1c5)](a7_0x1dac8f[_0x14f07b(0x1a4)](_0x14f07b(0x190)));const _0x92ec0d=_0x3b5883[_0x14f07b(0x1d1)]||_0x14f07b(0x18d),_0x403dcc=await promptSiteSelection(_0x92ec0d,_0x57cf90,'Setup\x20cancelled');if(!_0x403dcc)return 0x1;const _0xca56e7=resolveSite(_0x403dcc);if(isOAuthSupported(_0xca56e7)){const _0x1549a1=await a7_0x3e9c11({'type':_0x14f07b(0x195),'name':_0x14f07b(0x1c8),'message':_0x14f07b(0x1b9),'choices':[{'title':_0x14f07b(0x19f),'value':_0x14f07b(0x196)},{'title':_0x14f07b(0x1b5),'value':_0x14f07b(0x1c3)}]});if(!_0x1549a1['method'])return console[_0x14f07b(0x1c5)]('\x0aSetup\x20cancelled'),0x1;if(_0x1549a1['method']===_0x14f07b(0x196))return await runOAuthLoginFlow(_0xca56e7,_0x57cf90,_0x3b5883[_0x14f07b(0x1ca)]??LogLevel[_0x14f07b(0x1a2)]),0x0;}console[_0x14f07b(0x1c5)](_0x14f07b(0x18a)+_0xca56e7),console[_0x14f07b(0x1c5)](_0x14f07b(0x1b3)),console[_0x14f07b(0x1c5)]('\x20\x20'+getConsoleUrl(_0xca56e7,_0x14f07b(0x191)));const _0x3ff1dd=await a7_0x3e9c11({'type':_0x14f07b(0x19c),'name':_0x14f07b(0x194),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xd7d8bb=>{const _0x43220d=_0x14f07b;if(!_0xd7d8bb||!_0xd7d8bb[_0x43220d(0x1d0)]())return _0x43220d(0x1ad);return!![];}});if(!_0x3ff1dd[_0x14f07b(0x194)])return console[_0x14f07b(0x1c5)]('\x0aSetup\x20cancelled'),0x1;const _0x28d8ad=_0x3ff1dd['apiKey'];console[_0x14f07b(0x1c5)](_0x14f07b(0x19b));try{const _0x7da7c8=TDX[_0x14f07b(0x18f)]({'site':_0xca56e7,'apiKey':_0x28d8ad[_0x14f07b(0x1d0)](),'logLevel':_0x3b5883['logLevel']??LogLevel[_0x14f07b(0x1a2)]}),_0x59ea8c=await _0x7da7c8[_0x14f07b(0x1d6)][_0x14f07b(0x1d3)]();console[_0x14f07b(0x1c5)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x59ea8c[_0x14f07b(0x1ba)]+')');const _0x84b8b6=await isKeychainAvailable();_0x84b8b6?(await saveAPIKeyAsync(_0x28d8ad[_0x14f07b(0x1d0)](),_0xca56e7,_0x57cf90),console[_0x14f07b(0x1c5)](_0x14f07b(0x1b0)+(_0x57cf90?_0x14f07b(0x1b2)+_0x57cf90+')':''))):(console[_0x14f07b(0x1b1)](a7_0x1dac8f[_0x14f07b(0x1c2)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x14f07b(0x1b1)](a7_0x1dac8f[_0x14f07b(0x1c2)](_0x14f07b(0x1c9))));if(_0x57cf90){const _0x2cdb37={'site':_0xca56e7};saveProfileToUserConfig(_0x57cf90,_0x2cdb37),console['log']('✓\x20Profile\x20\x27'+_0x57cf90+_0x14f07b(0x199));}else saveDefaultSiteToUserConfig(_0xca56e7),console[_0x14f07b(0x1c5)](_0x14f07b(0x1a5)+_0xca56e7);const _0x1e5051=_0x57cf90?'\x20--profile\x20'+_0x57cf90:'';return console['log'](),console[_0x14f07b(0x1c5)](_0x14f07b(0x1cb)),console['log'](_0x14f07b(0x1a6)+_0x1e5051+_0x14f07b(0x1be)),console[_0x14f07b(0x1c5)](_0x14f07b(0x1a6)+_0x1e5051+_0x14f07b(0x193)),0x0;}catch(_0x2af4c1){if(_0x2af4c1 instanceof HTTPClientError&&_0x2af4c1[_0x14f07b(0x1cc)]===0x191)return printAuthError(_0x2af4c1),0x1;return console[_0x14f07b(0x1ac)](a7_0x1dac8f[_0x14f07b(0x1d2)](_0x14f07b(0x1ab)+(_0x2af4c1 instanceof Error?_0x2af4c1[_0x14f07b(0x18e)]:String(_0x2af4c1)))),console[_0x14f07b(0x1ac)](_0x14f07b(0x1db)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x11b603(0x1a1);[a7_0x11b603(0x1a8)]=a7_0x11b603(0x1d8);async[a7_0x11b603(0x1cd)](_0x346642){const _0x193cfb=a7_0x11b603,{options:_0x56351a,tdx:_0x52aa66}=_0x346642,_0x43f457=_0x56351a[_0x193cfb(0x1d1)],_0x4dc376=_0x56351a['profile'],_0xc43b79=_0x4dc376?_0x4dc376:_0x193cfb(0x1a7);console[_0x193cfb(0x1c5)](_0x193cfb(0x1c4)+_0xc43b79+_0x193cfb(0x18b)+_0x43f457+')');const _0x1a9a6b=await getOAuthTokens(_0x4dc376);if(_0x1a9a6b)console[_0x193cfb(0x1c5)](_0x193cfb(0x1c6)),console['log'](_0x193cfb(0x1b6)+(_0x4dc376?_0x193cfb(0x1b2)+_0x4dc376+')':''));else{const _0x2d2389=await resolveAPIKeyAsync(_0x43f457,_0x4dc376);if(_0x2d2389){const {source:_0x327937,isDeprecated:_0x3f320a}=_0x2d2389,_0x23e2d7=_0x193cfb(0x1da)+_0x327937;console[_0x193cfb(0x1c5)](_0x3f320a?a7_0x1dac8f['yellow'](_0x23e2d7):_0x23e2d7);}else console[_0x193cfb(0x1c5)](a7_0x1dac8f['yellow']('No\x20credential\x20found'));}try{const _0x10e781=await _0x52aa66[_0x193cfb(0x1d6)][_0x193cfb(0x1d3)]();return console[_0x193cfb(0x1c5)](a7_0x1dac8f[_0x193cfb(0x1d4)](_0x193cfb(0x1b7))),console[_0x193cfb(0x1c5)](_0x193cfb(0x1cf)+_0x10e781[_0x193cfb(0x1ba)]),(_0x10e781[_0x193cfb(0x1bf)]||_0x10e781[_0x193cfb(0x1d9)])&&console[_0x193cfb(0x1c5)]('Name:\x20'+[_0x10e781['first_name'],_0x10e781[_0x193cfb(0x1d9)]][_0x193cfb(0x1b8)](Boolean)[_0x193cfb(0x1d7)]('\x20')),0x0;}catch(_0x4da2ef){return _0x4da2ef instanceof HTTPClientError&&_0x4da2ef['status']===0x191?printAuthError(_0x4da2ef,!![],_0x4dc376):console[_0x193cfb(0x1ac)](a7_0x1dac8f['red'](_0x193cfb(0x1ab)+(_0x4da2ef instanceof Error?_0x4da2ef['message']:String(_0x4da2ef)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x11b603(0x198);['description']=a7_0x11b603(0x1dc);async[a7_0x11b603(0x1cd)](_0x1c43e5){const _0x4af6a7=a7_0x11b603,{options:_0x4a1c40}=_0x1c43e5,_0x882d1e=_0x4a1c40[_0x4af6a7(0x1d5)];console[_0x4af6a7(0x1c5)](a7_0x1dac8f['bold'](_0x4af6a7(0x1a0)));const _0x19fdf7=await isKeychainAvailable();if(!_0x19fdf7)return console['error'](a7_0x1dac8f[_0x4af6a7(0x1d2)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x5221af,_0x26a2b4]=await Promise[_0x4af6a7(0x1ce)]([deleteKeychainAPIKey(_0x882d1e),deleteOAuthTokens(_0x882d1e)]);if(_0x5221af||_0x26a2b4){clearCredentialCache();const _0x3716c3=[_0x5221af&&_0x4af6a7(0x1c1),_0x26a2b4&&'OAuth\x20tokens'][_0x4af6a7(0x1b8)](Boolean)[_0x4af6a7(0x1d7)](_0x4af6a7(0x1af));return console[_0x4af6a7(0x1c5)]('✓\x20'+_0x3716c3+_0x4af6a7(0x19a)+(_0x882d1e?_0x4af6a7(0x1b2)+_0x882d1e+')':'')),0x0;}else return console[_0x4af6a7(0x1c5)](_0x4af6a7(0x1c7)+(_0x882d1e?_0x4af6a7(0x1ae)+_0x882d1e:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x14b874=a8_0x54b9;(function(_0x3ecc5b,_0x3fa088){const _0x41c31e=a8_0x54b9,_0x10987e=_0x3ecc5b();while(!![]){try{const _0x552eab=-parseInt(_0x41c31e(0x1a5))/0x1+parseInt(_0x41c31e(0x1b4))/0x2+-parseInt(_0x41c31e(0x19a))/0x3*(parseInt(_0x41c31e(0x1a3))/0x4)+-parseInt(_0x41c31e(0x19f))/0x5*(-parseInt(_0x41c31e(0x1a6))/0x6)+-parseInt(_0x41c31e(0x18e))/0x7*(parseInt(_0x41c31e(0x1ae))/0x8)+parseInt(_0x41c31e(0x1a9))/0x9*(-parseInt(_0x41c31e(0x191))/0xa)+parseInt(_0x41c31e(0x1af))/0xb;if(_0x552eab===_0x3fa088)break;else _0x10987e['push'](_0x10987e['shift']());}catch(_0x5ea94b){_0x10987e['push'](_0x10987e['shift']());}}}(a8_0x1385,0x4bb52));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';function a8_0x54b9(_0x4c4d70,_0xa0d89d){_0x4c4d70=_0x4c4d70-0x18b;const _0x138559=a8_0x1385();let _0x54b95b=_0x138559[_0x4c4d70];return _0x54b95b;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x1385(){const _0x44d86f=['OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','845976EmnAZc','15084795LgGkCP','access_token','logLevel','name','create','563856qMJTkw','green','/oauth/authorize','log','35CrbLIl','ERROR','\x20--profile\x20','600Xzzhud','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','Opening\x20browser\x20for\x20authentication...','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','email','\x27\x20registered','✓\x20Authentication\x20successful\x20(User:\x20','3GZmaGr','bold','getUserInfo','Login\x20cancelled','Login\x20via\x20OAuth\x20(opens\x20browser)','5fUEfYX','auth:login','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','site','2108988jCadQx','description','393696WWiCsU','3417858dHAaXP','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','69471ePPwKM','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','execute','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'];a8_0x1385=function(){return _0x44d86f;};return a8_0x1385();}import a8_0x3e4482 from'chalk';export async function runOAuthLoginFlow(_0x589473,_0x576d14,_0x3463d9){const _0x580c4b=a8_0x54b9;if(!isOAuthSupported(_0x589473))throw new Error(_0x580c4b(0x1ad)+_0x589473+'.\x20'+_0x580c4b(0x194)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x29e789=await isKeychainAvailable();if(!_0x29e789)throw new Error(_0x580c4b(0x1a1)+_0x580c4b(0x1a7));const _0x5f1d97=getConsoleUrl(_0x589473);console[_0x580c4b(0x18d)](_0x580c4b(0x195)),console['log']('\x20\x20'+_0x5f1d97+_0x580c4b(0x18c)),console[_0x580c4b(0x18d)](_0x580c4b(0x196));const _0x18a323=await startOAuthFlow(_0x589473);console[_0x580c4b(0x18d)]('Validating\x20OAuth\x20tokens...');const _0x17cf56=TDX[_0x580c4b(0x1b3)]({'site':_0x589473,'accessToken':_0x18a323[_0x580c4b(0x1b0)],'logLevel':_0x3463d9??LogLevel['ERROR']}),_0x178126=await _0x17cf56['jobs'][_0x580c4b(0x19c)]();console[_0x580c4b(0x18d)](a8_0x3e4482[_0x580c4b(0x18b)](_0x580c4b(0x199)+_0x178126[_0x580c4b(0x197)]+')')),await saveOAuthTokens(_0x18a323,_0x576d14),console['log'](_0x580c4b(0x1a8)+(_0x576d14?'\x20(profile:\x20'+_0x576d14+')':''));if(_0x576d14){const _0x1a14f6={'site':_0x589473};saveProfileToUserConfig(_0x576d14,_0x1a14f6),console[_0x580c4b(0x18d)]('✓\x20Profile\x20\x27'+_0x576d14+_0x580c4b(0x198));}const _0x53b724=_0x576d14?_0x580c4b(0x190)+_0x576d14:'';console[_0x580c4b(0x18d)](),console[_0x580c4b(0x18d)](_0x580c4b(0x1ac)),console[_0x580c4b(0x18d)]('\x20\x20tdx'+_0x53b724+_0x580c4b(0x192)),console[_0x580c4b(0x18d)](_0x580c4b(0x193)+_0x53b724+_0x580c4b(0x1aa));}export class AuthLoginCommand extends BaseCommand{[a8_0x14b874(0x1b2)]=a8_0x14b874(0x1a0);[a8_0x14b874(0x1a4)]=a8_0x14b874(0x19e);async[a8_0x14b874(0x1ab)](_0xd9d240){const _0x14f327=a8_0x14b874,{options:_0x7d10be}=_0xd9d240,_0xb27c9f=_0x7d10be['profile'];console[_0x14f327(0x18d)](a8_0x3e4482[_0x14f327(0x19b)]('tdx:\x20auth\x20login'));const _0xe6bd1a=_0x7d10be[_0x14f327(0x1a2)]||'us01',_0xf27efb=await promptSiteSelection(_0xe6bd1a,_0xb27c9f,_0x14f327(0x19d));if(!_0xf27efb)return 0x1;const _0x58cf1c=resolveSite(_0xf27efb);return console[_0x14f327(0x18d)]('Authenticating\x20via\x20OAuth\x20for\x20site:\x20'+_0x58cf1c),await runOAuthLoginFlow(_0x58cf1c,_0xb27c9f,_0x7d10be[_0x14f327(0x1b1)]??LogLevel[_0x14f327(0x18f)]),0x0;}}
|