@treasuredata/tdx 2026.3.15 → 2026.3.17
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/README.md +9 -0
- 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 +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0x1687d4=a3_0x2ce5;(function(_0x358e7b,_0x226e6a){const _0x35f4bf=a3_0x2ce5,_0x4f9927=_0x358e7b();while(!![]){try{const _0x5f5146=-parseInt(_0x35f4bf(0x158))/0x1+parseInt(_0x35f4bf(0x147))/0x2+parseInt(_0x35f4bf(0x144))/0x3+-parseInt(_0x35f4bf(0x150))/0x4+-parseInt(_0x35f4bf(0x15c))/0x5+-parseInt(_0x35f4bf(0x14c))/0x6*(parseInt(_0x35f4bf(0x14f))/0x7)+parseInt(_0x35f4bf(0x166))/0x8;if(_0x5f5146===_0x226e6a)break;else _0x4f9927['push'](_0x4f9927['shift']());}catch(_0x570c31){_0x4f9927['push'](_0x4f9927['shift']());}}}(a3_0x51f1,0xe5d37));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x2ce5(_0x912607,_0x16ec23){_0x912607=_0x912607-0x144;const _0x51f128=a3_0x51f1();let _0x2ce574=_0x51f128[_0x912607];return _0x2ce574;}export class ActivationsCommand extends BaseCommand{[a3_0x1687d4(0x165)]=a3_0x1687d4(0x157);[a3_0x1687d4(0x149)]=a3_0x1687d4(0x148);async[a3_0x1687d4(0x156)](_0x56354f){const _0x566452=a3_0x1687d4,{options:_0x576cfa,args:_0x3e9178,tdx:_0x596ae1}=_0x56354f;if(_0x3e9178['length']===0x0)return console[_0x566452(0x146)](_0x566452(0x15b)),console['error'](_0x566452(0x164)),0x1;try{const {parentId:_0x5e5d81,childId:_0x6843a2}=parseSegmentRef(_0x3e9178[0x0]);if(!_0x6843a2)return console[_0x566452(0x146)](_0x566452(0x161)),console[_0x566452(0x146)](_0x566452(0x164)),0x1;_0x576cfa[_0x566452(0x14b)]&&(console[_0x566452(0x146)](_0x566452(0x15f)+_0x576cfa[_0x566452(0x155)]),console[_0x566452(0x146)](_0x566452(0x152)+_0x5e5d81),console['error'](_0x566452(0x14a)+_0x6843a2));const _0x451772=await withSpinner(_0x566452(0x159)+_0x5e5d81+_0x566452(0x15a),()=>_0x596ae1[_0x566452(0x14e)][_0x566452(0x151)](_0x5e5d81),{'verbose':_0x576cfa['verbose']}),_0x524524=_0x451772[_0x566452(0x145)];_0x576cfa[_0x566452(0x14b)]&&console[_0x566452(0x146)](_0x566452(0x15e)+_0x524524);const _0x19fa20=await withSpinner(_0x566452(0x154)+_0x6843a2+_0x566452(0x15a),()=>_0x596ae1['segment']['resolveSegmentId'](_0x524524,_0x6843a2),{'verbose':_0x576cfa[_0x566452(0x14b)]}),_0x30e723=_0x19fa20[_0x566452(0x145)];_0x576cfa[_0x566452(0x14b)]&&console[_0x566452(0x146)]('Resolved\x20child\x20ID:\x20'+_0x30e723);const _0x543c2c=await withSpinner(_0x566452(0x162)+_0x6843a2+_0x566452(0x15a),()=>_0x596ae1[_0x566452(0x14e)]['listActivations'](_0x524524,_0x30e723),{'verbose':_0x576cfa[_0x566452(0x14b)]}),_0x27fc6f=_0x543c2c['data'];return console['error'](_0x566452(0x15d)+_0x27fc6f[_0x566452(0x163)]+_0x566452(0x160)+(_0x27fc6f[_0x566452(0x163)]!==0x1?'s':'')),await handleSDKOutput(_0x27fc6f,_0x576cfa),0x0;}catch(_0x1f22fb){if(_0x1f22fb instanceof SDKError)return console[_0x566452(0x146)](_0x566452(0x167)+_0x1f22fb[_0x566452(0x153)]),_0x1f22fb[_0x566452(0x14d)]&&console[_0x566452(0x146)]('\x20\x20Cause:\x20'+_0x1f22fb['cause']),0x1;throw _0x1f22fb;}}}function a3_0x51f1(){const _0xa462bc=['7ptMxBY','1811892OuHkZQ','resolveParentId','Parent\x20name:\x20','message','Resolving\x20child\x20segment\x20\x27','site','execute','activations','1358602eqfwQR','Resolving\x20parent\x20segment\x20\x27','\x27...','Error:\x20Segment\x20name\x20is\x20required','6238880oSPoyG','✔\x20Found\x20','Resolved\x20parent\x20ID:\x20','Site:\x20','\x20activation','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Listing\x20activations\x20for\x20segment\x20\x27','length','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','name','25453168VGYYtU','Error:\x20','262083OoSuLz','data','error','3355220JlVSOA','List\x20activations\x20for\x20a\x20segment','description','Child\x20name:\x20','verbose','5675394UZJiVM','cause','segment'];a3_0x51f1=function(){return _0xa462bc;};return a3_0x51f1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a4_0x2a95(_0x12f1a9,_0x44378b){_0x12f1a9=_0x12f1a9-0x199;const _0x495556=a4_0x4955();let _0x2a9553=_0x495556[_0x12f1a9];return _0x2a9553;}const a4_0x4f8b7d=a4_0x2a95;(function(_0x4a5998,_0x5a11ff){const _0x1089b9=a4_0x2a95,_0x186744=_0x4a5998();while(!![]){try{const _0x1aa6ba=-parseInt(_0x1089b9(0x1d1))/0x1+-parseInt(_0x1089b9(0x213))/0x2+-parseInt(_0x1089b9(0x24a))/0x3*(parseInt(_0x1089b9(0x1c0))/0x4)+parseInt(_0x1089b9(0x1f8))/0x5+-parseInt(_0x1089b9(0x1e1))/0x6*(parseInt(_0x1089b9(0x1c7))/0x7)+-parseInt(_0x1089b9(0x1c1))/0x8*(parseInt(_0x1089b9(0x21a))/0x9)+parseInt(_0x1089b9(0x234))/0xa*(parseInt(_0x1089b9(0x1a8))/0xb);if(_0x1aa6ba===_0x5a11ff)break;else _0x186744['push'](_0x186744['shift']());}catch(_0x23ebc5){_0x186744['push'](_0x186744['shift']());}}}(a4_0x4955,0x5d8de));function a4_0x4955(){const _0x1adc11=['context','\x0aChanges:','New\x20project:\x20','outputDir','196rMBsJS','40hyuUuI','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agentId','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Prompt\x20\x22','47691vlttnR','Output:\x20','total','\x20=\x20','error','\x20successfully','experimentalArtifacts','\x20changed','Cancelled','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','73405JDZwZs','Project:\x20','errors','red','Status:\x20','\x20\x20Integration\x20\x22','\x20updated','reason','log','\x20files?','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agent:clone','description','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','MISSING_ARGUMENT','<new-name>','246pXDRTa','\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','\x20resources\x20to\x20\x27','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','parse','\x22\x20to\x20a\x20different\x20profile','\x20\x20Text\x20Knowledge\x20Base\x20\x22','profile','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)','output','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20files\x20to\x20','yes','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aChanges\x20to\x20prompt\x20\x27','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Agent:\x20','✔\x20Context\x20set:\x20','dim','\x0aChanges\x20to\x20integration\x20\x27','\x20--name\x20','Using\x20local\x20project:\x20','568020fbIxUM','source','Clone\x20\x22','\x20new','\x0aProject\x20pushed\x20with\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','created','tdx.json','\x20--profile\x20','green','Output\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','prompts','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','outputPath','\x0a✔\x20Pulled\x20','Using\x20project\x20from\x20context:\x20','\x0aWrite\x20','action','arg-dir','agent:pull','\x0aChanges\x20to\x20agent\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','force','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','new','1362134QrNZRx','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','llmProject','Writing\x20files...','Using\x20context\x20project:\x20','\x20resources?','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','80181apAfwy','\x20\x20Knowledge\x20Bases:\x20','gray','pushProject','counts','\x0aPush\x20','agents','newProjectName','Would\x20push\x20agent:\x20','dryRun','\x0aError:','\x20\x20Experimental\x20Artifacts:\x20','-\x20nothing\x20pushed','hasChanges','llm_project','join','message','repeat','dirname','isNew','cloneProject','execute','\x0aPull\x20summary\x20for\x20\x27','unchanged','\x22:\x20','Errors:','89550WdpiBg','found','Using\x20project:\x20','textKnowledgeBases','pullProject','\x22\x20to\x20\x22','llm','cyan','New\x20project\x20name\x20is\x20required','\x22\x20from\x20project\x20\x22','Pushing\x20agent\x20from\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Cloning\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Target:\x20','Analyzing\x20project\x20\x22','experimentalKnowledgeBases','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agentName','Using\x20current\x20project:\x20','4647rvMdYo','Pushing\x20to\x20project...','name','Agent\x20','Source:\x20','\x20\x20tdx\x20agent\x20pull\x20','projectName','knowledgeBases','-\x20no\x20files\x20written','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20unchanged','\x20\x20Agents:\x20','sourceProjectName','cwd-config','\x20\x20Knowledge\x20Base\x20\x22','\x20errors','newProjectId','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','pullAgent','updated','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','yellow','cwd','site','\x20\x20Integrations:\x20','\x22...','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aPush\x20summary\x20for\x20\x27','Pulling\x20agent\x20\x22','agent:push','1749AIGKdg','\x20total','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','push','Chat:\x20','\x20\x20Prompts:\x20','integrations','INVALID_ARGUMENT','projectId','Project\x20cloned\x20successfully','utf-8','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20|\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent','session','projectDir','diff'];a4_0x4955=function(){return _0x1adc11;};return a4_0x4955();}import a4_0x566038 from'chalk';import a4_0x4e99f2 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(_0x215a61){const _0x4cafbe=a4_0x2a95,_0x2f4ff5=[];if(_0x215a61[_0x4cafbe(0x1c9)]!==undefined)_0x2f4ff5[_0x4cafbe(0x1ad)](_0x215a61[_0x4cafbe(0x1c9)]+_0x4cafbe(0x1a9));if(_0x215a61['new']!==undefined&&_0x215a61[_0x4cafbe(0x212)]>0x0)_0x2f4ff5[_0x4cafbe(0x1ad)](a4_0x566038[_0x4cafbe(0x201)](_0x215a61['new']+_0x4cafbe(0x1fb)));if(_0x215a61[_0x4cafbe(0x1fe)]!==undefined&&_0x215a61[_0x4cafbe(0x1fe)]>0x0)_0x2f4ff5['push'](a4_0x566038[_0x4cafbe(0x201)](_0x215a61[_0x4cafbe(0x1fe)]+'\x20created'));if(_0x215a61[_0x4cafbe(0x19d)]!==undefined&&_0x215a61[_0x4cafbe(0x19d)]>0x0)_0x2f4ff5['push'](a4_0x566038[_0x4cafbe(0x19f)](_0x215a61[_0x4cafbe(0x19d)]+_0x4cafbe(0x1d7)));if(_0x215a61[_0x4cafbe(0x231)]!==undefined&&_0x215a61[_0x4cafbe(0x231)]>0x0)_0x2f4ff5[_0x4cafbe(0x1ad)](a4_0x566038['gray'](_0x215a61[_0x4cafbe(0x231)]+_0x4cafbe(0x254)));if(_0x215a61[_0x4cafbe(0x1d3)]!==undefined&&_0x215a61[_0x4cafbe(0x1d3)]>0x0)_0x2f4ff5['push'](a4_0x566038[_0x4cafbe(0x1d4)](_0x215a61[_0x4cafbe(0x1d3)]+_0x4cafbe(0x199)));return _0x2f4ff5[_0x4cafbe(0x229)](',\x20');}function displayDiffs(_0x16e7be,_0x10ac5a,_0x4a508a,_0x3fe99c,_0x4049a5,_0x3d9133,_0x17f1d3){const _0x43f810=a4_0x2a95;for(const _0x5d08a9 of _0x16e7be){if(_0x5d08a9[_0x43f810(0x1bb)]){const _0x4c03c8=_0x5d08a9[_0x43f810(0x248)]||_0x5d08a9[_0x43f810(0x24c)];console[_0x43f810(0x1d9)](_0x43f810(0x20d)+_0x4c03c8+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console['log'](_0x5d08a9['diff']),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c));}}for(const _0x173fbd of _0x10ac5a){_0x173fbd['diff']&&(console['log'](_0x43f810(0x214)+_0x173fbd[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console[_0x43f810(0x1d9)](_0x173fbd[_0x43f810(0x1bb)]),console['log']('─'['repeat'](0x3c)));}for(const _0x1dcc0d of _0x4a508a){_0x1dcc0d[_0x43f810(0x1bb)]&&(console[_0x43f810(0x1d9)](_0x43f810(0x246)+_0x1dcc0d[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'['repeat'](0x3c)),console['log'](_0x1dcc0d[_0x43f810(0x1bb)]),console['log']('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x389f30 of _0x3fe99c){_0x389f30['diff']&&(console[_0x43f810(0x1d9)](_0x43f810(0x1f0)+_0x389f30[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console[_0x43f810(0x1d9)](_0x389f30[_0x43f810(0x1bb)]),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x414634 of _0x4049a5){_0x414634[_0x43f810(0x1bb)]&&(console[_0x43f810(0x1d9)](_0x43f810(0x1f5)+_0x414634[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console[_0x43f810(0x1d9)](_0x414634['diff']),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x3368ad of _0x3d9133){_0x3368ad['diff']&&(console['log'](_0x43f810(0x253)+_0x3368ad['name']+'\x27:'),console[_0x43f810(0x1d9)]('─'['repeat'](0x3c)),console[_0x43f810(0x1d9)](_0x3368ad[_0x43f810(0x1bb)]),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x281001 of _0x17f1d3){_0x281001[_0x43f810(0x1bb)]&&(console['log'](_0x43f810(0x19b)+_0x281001[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console['log'](_0x281001[_0x43f810(0x1bb)]),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x4f8b7d(0x24c)]=a4_0x4f8b7d(0x20c);['description']=a4_0x4f8b7d(0x247);async[a4_0x4f8b7d(0x22f)](_0x4dc246){const _0xfb25c6=a4_0x4f8b7d,{options:_0x1d1b9b,args:_0x20e6ce,tdx:_0x79061b}=_0x4dc246,_0x232320=_0x20e6ce[0x0],_0x1b2206=_0x20e6ce[0x1],_0x6d46d=_0x1d1b9b[_0xfb25c6(0x1eb)],_0xe2b36e=_0x1d1b9b[_0xfb25c6(0x223)],_0x37def3=_0x1d1b9b['force'],_0x4b6d32=_0x1d1b9b[_0xfb25c6(0x1ee)],_0x5ea8c3=_0x1d1b9b[_0xfb25c6(0x215)],_0xf5be9=_0x1d1b9b[_0xfb25c6(0x1b8)];let _0x10bb82;if(_0x232320){const _0x3ffa78=a4_0x4e99f2['join'](_0x232320,_0xfb25c6(0x1ff));if(existsSync(_0x3ffa78))try{const _0x3d2e7e=JSON[_0xfb25c6(0x1e6)](readFileSync(_0x3ffa78,'utf-8'));_0x3d2e7e['llm_project']&&(_0x10bb82={'llm_project':_0x3d2e7e[_0xfb25c6(0x228)]});}catch{}}const _0x1eec07=findAgentConfigPath(process[_0xfb25c6(0x1a0)]());let _0x41c13f;if(_0x1eec07)try{const _0x4f373f=JSON[_0xfb25c6(0x1e6)](readFileSync(_0x1eec07,_0xfb25c6(0x1b4)));_0x4f373f[_0xfb25c6(0x228)]&&(_0x41c13f={'llm_project':_0x4f373f[_0xfb25c6(0x228)]});}catch{}const _0x2364e6=resolveAgentPullArgs({'arg':_0x232320,'agentNameArg':_0x1b2206,'agentFlag':_0xf5be9,'contextProject':_0x5ea8c3,'argDirConfig':_0x10bb82,'cwdConfigPath':_0x1eec07||undefined,'cwdConfig':_0x41c13f}),{projectNameOrId:_0x567e3a,targetAgentName:_0xee308e,existingOutputDir:_0x57bb95,source:_0x5d821e}=_0x2364e6;if(_0x5d821e===_0xfb25c6(0x20b))console[_0xfb25c6(0x1d9)](a4_0x566038['dim']('Using\x20project\x20from\x20'+a4_0x4e99f2['join'](_0x232320,'tdx.json')+':\x20'+_0x567e3a));else{if(_0x5d821e===_0xfb25c6(0x257))console['log'](a4_0x566038[_0xfb25c6(0x1f4)](_0xfb25c6(0x236)+_0x567e3a));else _0x5d821e===_0xfb25c6(0x1bc)&&console[_0xfb25c6(0x1d9)](a4_0x566038['dim'](_0xfb25c6(0x208)+_0x567e3a));}if(!_0x567e3a)return _0xf5be9?(console[_0xfb25c6(0x1d9)](a4_0x566038['yellow'](_0xfb25c6(0x1ac))),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x240)),console['log'](_0xfb25c6(0x1f1))):(console[_0xfb25c6(0x1d9)](a4_0x566038['yellow'](_0xfb25c6(0x1ec))),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1ea)),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1e2)),console[_0xfb25c6(0x1d9)]('\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'),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x203)),console[_0xfb25c6(0x1d9)]('\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(_0xee308e){const {data:_0x20c08b}=await withSpinner(_0xfb25c6(0x1a6)+_0xee308e+_0xfb25c6(0x23d)+_0x567e3a+'\x22...',()=>_0x79061b[_0xfb25c6(0x23a)][_0xfb25c6(0x19c)](_0x567e3a,_0xee308e,_0x6d46d,{'dryRun':_0xe2b36e,'force':_0x37def3}));if(_0xe2b36e)return console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x19f)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0x20c08b[_0xfb25c6(0x248)]),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x202)+_0x20c08b['outputPath']),_0x20c08b['diff']&&(console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1bd)),console[_0xfb25c6(0x1d9)]('─'[_0xfb25c6(0x22b)](0x3c)),console[_0xfb25c6(0x1d9)](_0x20c08b[_0xfb25c6(0x1bb)]),console[_0xfb25c6(0x1d9)]('─'['repeat'](0x3c))),0x0;return console[_0xfb25c6(0x1d9)](a4_0x566038['green']('Agent\x20pulled\x20successfully')),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1f2)+_0x20c08b[_0xfb25c6(0x248)]),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1c8)+_0x20c08b[_0xfb25c6(0x206)]),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1d5)+(_0x20c08b[_0xfb25c6(0x22d)]?a4_0x566038[_0xfb25c6(0x201)](_0xfb25c6(0x212)):_0x20c08b[_0xfb25c6(0x227)]?a4_0x566038[_0xfb25c6(0x19f)](_0xfb25c6(0x19d)):a4_0x566038[_0xfb25c6(0x21c)](_0xfb25c6(0x231)))),0x0;}const _0x5eb1a3=_0x57bb95||_0x6d46d,{data:_0x2d21cc}=await withSpinner(_0xfb25c6(0x244)+_0x567e3a+_0xfb25c6(0x1a3),()=>_0x79061b['llm'][_0xfb25c6(0x238)](_0x567e3a,_0x5eb1a3,{'dryRun':!![]})),_0x33dcc7=_0x2d21cc['counts']['agents']['new']+_0x2d21cc[_0xfb25c6(0x21e)]['knowledgeBases'][_0xfb25c6(0x212)]+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x237)][_0xfb25c6(0x212)]+_0x2d21cc['counts']['prompts'][_0xfb25c6(0x212)]+_0x2d21cc['counts']['integrations'][_0xfb25c6(0x212)]+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x245)][_0xfb25c6(0x212)]+_0x2d21cc['counts']['experimentalArtifacts'][_0xfb25c6(0x212)],_0x25ab75=_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x220)]['updated']+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x251)][_0xfb25c6(0x19d)]+_0x2d21cc[_0xfb25c6(0x21e)]['textKnowledgeBases'][_0xfb25c6(0x19d)]+_0x2d21cc['counts'][_0xfb25c6(0x204)]['updated']+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x1b0)]['updated']+_0x2d21cc[_0xfb25c6(0x21e)]['experimentalKnowledgeBases'][_0xfb25c6(0x19d)]+_0x2d21cc['counts'][_0xfb25c6(0x1cd)][_0xfb25c6(0x19d)],_0x1a22a9=_0x2d21cc['counts'][_0xfb25c6(0x220)][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['knowledgeBases'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['textKnowledgeBases'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['prompts'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['integrations'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x245)][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['experimentalArtifacts'][_0xfb25c6(0x231)];console[_0xfb25c6(0x1d9)](_0xfb25c6(0x230)+_0x2d21cc['projectName']+'\x27:'),console[_0xfb25c6(0x1d9)]('\x20\x20'+a4_0x566038['green']('+\x20'+_0x33dcc7+_0xfb25c6(0x1fb))+'\x20|\x20'+a4_0x566038[_0xfb25c6(0x19f)]('~\x20'+_0x25ab75+'\x20changed')+_0xfb25c6(0x1b6)+a4_0x566038['dim']('=\x20'+_0x1a22a9+_0xfb25c6(0x254))),console['log'](_0xfb25c6(0x255)+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)]['agents'])),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x21b)+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)]['knowledgeBases'])),console['log'](_0xfb25c6(0x1b5)+formatCountSummary(_0x2d21cc['counts'][_0xfb25c6(0x237)])),console['log'](_0xfb25c6(0x1af)+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x204)])),console[_0xfb25c6(0x1d9)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x1b0)]));const _0x349da0=_0x2d21cc['counts'][_0xfb25c6(0x245)][_0xfb25c6(0x1c9)]>0x0||_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x1cd)][_0xfb25c6(0x1c9)]>0x0;_0x349da0&&(console[_0xfb25c6(0x1d9)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x245)])),console['log'](_0xfb25c6(0x225)+formatCountSummary(_0x2d21cc['counts'][_0xfb25c6(0x1cd)])));console['log'](_0xfb25c6(0x243)+a4_0x566038[_0xfb25c6(0x23b)](_0x2d21cc['outputDir'])),displayDiffs(_0x2d21cc[_0xfb25c6(0x220)],_0x2d21cc[_0xfb25c6(0x251)],_0x2d21cc[_0xfb25c6(0x237)],_0x2d21cc['prompts'],_0x2d21cc['integrations'],_0x2d21cc[_0xfb25c6(0x245)],_0x2d21cc[_0xfb25c6(0x1cd)]);if(_0xe2b36e)return console[_0xfb25c6(0x1d9)](a4_0x566038['yellow'](_0xfb25c6(0x1db))),0x0;if(_0x33dcc7===0x0&&_0x25ab75===0x0)return console[_0xfb25c6(0x1d9)](a4_0x566038['green'](_0xfb25c6(0x1c2))),saveSessionContext({'llm_project':_0x2d21cc['projectName']},_0x1d1b9b[_0xfb25c6(0x1b9)]),console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x201)]('✔\x20Context\x20set:\x20'+a4_0x566038['dim'](_0xfb25c6(0x228))+_0xfb25c6(0x1ca)+a4_0x566038[_0xfb25c6(0x23b)](_0x2d21cc['projectName']))),0x0;if(!_0x4b6d32&&!_0x37def3){if(!isInteractive())return console['error'](a4_0x566038['red'](_0xfb25c6(0x224)),_0xfb25c6(0x20e)),console[_0xfb25c6(0x1cb)](a4_0x566038[_0xfb25c6(0x1f4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2918e1=await confirmKey(_0xfb25c6(0x209)+(_0x33dcc7+_0x25ab75)+_0xfb25c6(0x1da));if(!_0x2918e1)return console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x19f)](_0xfb25c6(0x1cf)),_0xfb25c6(0x252)),0x1;}const {data:_0x145901}=await withSpinner(_0xfb25c6(0x216),()=>_0x79061b['llm'][_0xfb25c6(0x238)](_0x567e3a,_0x5eb1a3,{'force':_0x37def3}));return console['log'](a4_0x566038[_0xfb25c6(0x201)](_0xfb25c6(0x207)+(_0x33dcc7+_0x25ab75)+_0xfb25c6(0x1ed)+_0x145901[_0xfb25c6(0x1bf)])),saveSessionContext({'llm_project':_0x145901[_0xfb25c6(0x250)]},_0x1d1b9b['session']),console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x201)](_0xfb25c6(0x1f3)+a4_0x566038['dim'](_0xfb25c6(0x228))+_0xfb25c6(0x1ca)+a4_0x566038['cyan'](_0x145901[_0xfb25c6(0x250)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x4f8b7d(0x1dc);[a4_0x4f8b7d(0x1dd)]=a4_0x4f8b7d(0x1de);async[a4_0x4f8b7d(0x22f)](_0x198209){const _0x28ad2d=a4_0x4f8b7d,{options:_0x43a4e9,args:_0x520dc1,tdx:_0x65f791}=_0x198209,_0x55bf82=_0x520dc1[0x0],_0xfe6891=_0x43a4e9[_0x28ad2d(0x24c)],_0x4c3982=_0x43a4e9[_0x28ad2d(0x223)],_0x4fb1a=_0x43a4e9['yes'],_0x4e8868=_0x43a4e9[_0x28ad2d(0x1a1)],_0x418396=_0x43a4e9[_0x28ad2d(0x215)];let _0x571a68;const _0x39b9ba=findAgentConfigPath(process[_0x28ad2d(0x1a0)]());if(_0x55bf82){const _0x828fc3=a4_0x4e99f2['join'](_0x55bf82,_0x28ad2d(0x1ff));existsSync(_0x828fc3)?(_0x571a68=_0x55bf82,console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x1f4)](_0x28ad2d(0x1f7)+_0x55bf82))):_0x571a68=_0x55bf82;}else{if(_0x39b9ba)_0x571a68=a4_0x4e99f2['dirname'](_0x39b9ba),console[_0x28ad2d(0x1d9)](a4_0x566038['dim'](_0x28ad2d(0x249)+_0x571a68));else{if(_0x418396){const _0x408cd2=sanitizeForFilesystem(_0x418396);let _0x12ee8a=_0x408cd2,_0xdbed5e=a4_0x4e99f2['join'](process['cwd'](),_0x28ad2d(0x220),_0x408cd2,_0x28ad2d(0x1ff));if(!existsSync(_0xdbed5e)){const _0x5dd38f=normalizeName(_0x418396),_0x132074=a4_0x4e99f2[_0x28ad2d(0x229)](process['cwd'](),_0x28ad2d(0x220),_0x5dd38f,_0x28ad2d(0x1ff));existsSync(_0x132074)&&(_0x12ee8a=_0x5dd38f,_0xdbed5e=_0x132074);}if(existsSync(_0xdbed5e))_0x571a68=a4_0x4e99f2[_0x28ad2d(0x22c)](_0xdbed5e),console[_0x28ad2d(0x1d9)](a4_0x566038['dim'](_0x28ad2d(0x1f7)+_0x571a68));else{const _0x17cdd1=_0x43a4e9[_0x28ad2d(0x1e9)];if(_0x17cdd1)throw new SDKError(ErrorCode[_0x28ad2d(0x1b1)],_0x28ad2d(0x210)+_0x418396+_0x28ad2d(0x1e7),undefined,{'helpText':_0x28ad2d(0x1d0)+_0x28ad2d(0x205)+(_0x28ad2d(0x24f)+_0x418396+'\x0a')+(_0x28ad2d(0x1fd)+_0x12ee8a+_0x28ad2d(0x1f6)+(_0xfe6891||_0x28ad2d(0x1e0))+_0x28ad2d(0x200)+_0x17cdd1)});_0x571a68=_0x418396,console[_0x28ad2d(0x1d9)](a4_0x566038['dim'](_0x28ad2d(0x217)+_0x418396));}}}}if(!_0x571a68)return console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)](_0x28ad2d(0x242))),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1a4)),console[_0x28ad2d(0x1d9)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1e5)),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x219)),0x1;if(!_0xfe6891)throw new SDKError(ErrorCode[_0x28ad2d(0x1df)],_0x28ad2d(0x23c),undefined,{'helpText':_0x28ad2d(0x211)});if(!_0x4fb1a&&!_0x4c3982){if(!isInteractive())return console[_0x28ad2d(0x1cb)](a4_0x566038['red']('\x0aError:'),_0x28ad2d(0x20e)),console[_0x28ad2d(0x1cb)](a4_0x566038['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57d121=await confirmKey(_0x28ad2d(0x1fa)+_0x571a68+_0x28ad2d(0x1e4)+_0xfe6891+'\x22?');if(!_0x57d121)return console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)](_0x28ad2d(0x1cf))),0x1;}const {data:_0x58137a}=await withSpinner(_0x28ad2d(0x241)+_0x571a68+_0x28ad2d(0x239)+_0xfe6891+_0x28ad2d(0x1a3),()=>_0x65f791[_0x28ad2d(0x23a)][_0x28ad2d(0x22e)](_0x571a68,_0xfe6891,{'dryRun':_0x4c3982}));if(_0x4c3982){console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)](_0x28ad2d(0x23f))),console['log'](_0x28ad2d(0x24e)+_0x58137a[_0x28ad2d(0x256)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1be)+_0xfe6891),console[_0x28ad2d(0x1d9)]('Would\x20clone:'),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x255)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x220)][_0x28ad2d(0x1fe)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x21b)+_0x58137a[_0x28ad2d(0x21e)]['knowledgeBases'][_0x28ad2d(0x1fe)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1af)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x204)]['created']);const _0x38068a=_0x58137a['counts'][_0x28ad2d(0x245)][_0x28ad2d(0x1fe)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['experimentalArtifacts']['created']>0x0;return _0x38068a&&(console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1ab)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x245)][_0x28ad2d(0x1fe)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x225)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x1cd)]['created'])),0x0;}const _0x2d910b=_0x58137a[_0x28ad2d(0x21e)]['agents'][_0x28ad2d(0x1d3)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['knowledgeBases'][_0x28ad2d(0x1d3)]>0x0||_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x204)][_0x28ad2d(0x1d3)]>0x0||_0x58137a['counts']['experimentalKnowledgeBases'][_0x28ad2d(0x1d3)]>0x0||_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x1cd)][_0x28ad2d(0x1d3)]>0x0;_0x2d910b?console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)]('Project\x20cloned\x20with\x20errors')):console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x201)](_0x28ad2d(0x1b3)));console[_0x28ad2d(0x1d9)]('Source:\x20'+_0x58137a['sourceProjectName']),console['log']('New\x20project:\x20'+_0x58137a[_0x28ad2d(0x221)]),console[_0x28ad2d(0x1d9)]('New\x20project\x20ID:\x20'+_0x58137a['newProjectId']),console['log'](),console[_0x28ad2d(0x1d9)]('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)]['agents'])),console[_0x28ad2d(0x1d9)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x58137a['counts'][_0x28ad2d(0x251)])),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1af)+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x204)])),console['log'](_0x28ad2d(0x1a2)+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x1b0)]));const _0x36b5bd=_0x58137a['counts']['experimentalKnowledgeBases'][_0x28ad2d(0x1fe)]>0x0||_0x58137a['counts'][_0x28ad2d(0x245)][_0x28ad2d(0x19d)]>0x0||_0x58137a['counts'][_0x28ad2d(0x245)][_0x28ad2d(0x231)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['experimentalArtifacts'][_0x28ad2d(0x1fe)]>0x0||_0x58137a['counts'][_0x28ad2d(0x1cd)][_0x28ad2d(0x19d)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['experimentalArtifacts'][_0x28ad2d(0x231)]>0x0;_0x36b5bd&&(console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1ab)+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)]['experimentalKnowledgeBases'])),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x225)+formatCountSummary(_0x58137a['counts'][_0x28ad2d(0x1cd)])));if(_0x2d910b){console[_0x28ad2d(0x1d9)](),console[_0x28ad2d(0x1d9)](a4_0x566038['red']('Errors:'));for(const _0x182c72 of _0x58137a[_0x28ad2d(0x220)]){_0x182c72[_0x28ad2d(0x20a)]==='error'&&console['log'](a4_0x566038[_0x28ad2d(0x1d4)]('\x20\x20Agent\x20\x22'+_0x182c72['agentName']+'\x22:\x20'+_0x182c72[_0x28ad2d(0x1cb)]));}for(const _0x6197dc of _0x58137a[_0x28ad2d(0x251)]){_0x6197dc[_0x28ad2d(0x20a)]==='error'&&console['log'](a4_0x566038['red'](_0x28ad2d(0x258)+_0x6197dc[_0x28ad2d(0x24c)]+_0x28ad2d(0x232)+_0x6197dc[_0x28ad2d(0x1cb)]));}for(const _0x1abfa6 of _0x58137a[_0x28ad2d(0x204)]){_0x1abfa6[_0x28ad2d(0x20a)]===_0x28ad2d(0x1cb)&&console[_0x28ad2d(0x1d9)](a4_0x566038['red'](_0x28ad2d(0x1c6)+_0x1abfa6['name']+'\x22:\x20'+_0x1abfa6[_0x28ad2d(0x1cb)]));}for(const _0x92cac3 of _0x58137a['integrations']){_0x92cac3[_0x28ad2d(0x20a)]===_0x28ad2d(0x1cb)&&console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x1d4)](_0x28ad2d(0x1d6)+_0x92cac3['name']+_0x28ad2d(0x232)+_0x92cac3['error']));}for(const _0x455a6d of _0x58137a[_0x28ad2d(0x245)]){_0x455a6d['action']===_0x28ad2d(0x1cb)&&console['log'](a4_0x566038[_0x28ad2d(0x1d4)](_0x28ad2d(0x1b7)+_0x455a6d['name']+_0x28ad2d(0x232)+_0x455a6d['error']));}for(const _0x5770f6 of _0x58137a[_0x28ad2d(0x1cd)]){_0x5770f6[_0x28ad2d(0x20a)]===_0x28ad2d(0x1cb)&&console[_0x28ad2d(0x1d9)](a4_0x566038['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5770f6[_0x28ad2d(0x24c)]+_0x28ad2d(0x232)+_0x5770f6['error']));}return 0x1;}console['log']();const _0x2c4456=getLLMProjectUrl(_0x4e8868,_0x58137a[_0x28ad2d(0x19a)]);return console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1d2)+a4_0x566038[_0x28ad2d(0x23b)](_0x2c4456)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4f8b7d(0x24c)]=a4_0x4f8b7d(0x1a7);['description']=a4_0x4f8b7d(0x1ef);async[a4_0x4f8b7d(0x22f)](_0x57f399){const _0x41d354=a4_0x4f8b7d,{options:_0x15750c,args:_0x3c6b4b,tdx:_0x562ae1}=_0x57f399;let _0x3c3222=_0x3c6b4b[0x0]||process[_0x41d354(0x1a0)]();const _0x21ecf5=_0x15750c[_0x41d354(0x223)],_0x3a98c7=_0x15750c[_0x41d354(0x20f)],_0x354509=_0x15750c[_0x41d354(0x1ee)],_0x52f021=_0x15750c[_0x41d354(0x1a1)],_0x4ab8be=a4_0x4e99f2[_0x41d354(0x229)](_0x3c3222,'agent.yml'),_0x261d61=existsSync(_0x4ab8be);if(_0x261d61){const {data:_0x31ef91}=await withSpinner(_0x41d354(0x23e)+_0x3c3222+_0x41d354(0x1a3),()=>_0x562ae1[_0x41d354(0x23a)]['pushAgent'](_0x3c3222,{'dryRun':_0x21ecf5,'force':_0x3a98c7}));if(_0x21ecf5)return console['log'](a4_0x566038[_0x41d354(0x19f)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x41d354(0x1d9)](_0x41d354(0x222)+_0x31ef91[_0x41d354(0x248)]),0x0;if(_0x31ef91[_0x41d354(0x20a)]===_0x41d354(0x1cb))return console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)]('Failed\x20to\x20push\x20agent:\x20'+_0x31ef91[_0x41d354(0x1cb)])),0x1;console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x201)](_0x41d354(0x24d)+_0x31ef91[_0x41d354(0x20a)]+_0x41d354(0x1cc))),console['log'](_0x41d354(0x1f2)+_0x31ef91['agentName']);if(_0x31ef91[_0x41d354(0x1c4)]&&_0x31ef91[_0x41d354(0x1b2)]){const _0x26ffca=getLLMAgentChatUrl(_0x52f021,_0x31ef91[_0x41d354(0x1b2)],_0x31ef91[_0x41d354(0x1c4)]);console[_0x41d354(0x1d9)](_0x41d354(0x1ae)+a4_0x566038[_0x41d354(0x23b)](_0x26ffca));}return 0x0;}const _0x51d3c2=_0x15750c[_0x41d354(0x215)],_0x44ec42=resolveProjectFromContext(_0x3c3222,_0x51d3c2);if(_0x44ec42[_0x41d354(0x235)])_0x3c3222=_0x44ec42[_0x41d354(0x1ba)],_0x44ec42[_0x41d354(0x1f9)]===_0x41d354(0x1bc)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1f4)](_0x41d354(0x236)+_0x3c3222));else{let _0xa6a0cb=_0x41d354(0x1c5);_0x44ec42[_0x41d354(0x1d8)]==='no_local_folder'&&(_0xa6a0cb=_0x44ec42[_0x41d354(0x22a)]+_0x41d354(0x19e)+_0x44ec42[_0x41d354(0x215)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x41d354(0x1b1)],_0x44ec42[_0x41d354(0x1d8)]==='no_context'?_0x44ec42['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x3c3222,undefined,{'helpText':_0xa6a0cb});}const {data:_0x5f3e40}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x562ae1[_0x41d354(0x23a)][_0x41d354(0x21d)](_0x3c3222,{'dryRun':!![]})),_0x163fde=_0x5f3e40['counts'][_0x41d354(0x220)][_0x41d354(0x1d3)]>0x0;if(_0x163fde){console[_0x41d354(0x1d9)](a4_0x566038['red']('\x0aErrors\x20found:'));for(const _0x13b8a0 of _0x5f3e40['agents']){_0x13b8a0['action']==='error'&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)]('\x20\x20Agent\x20\x22'+_0x13b8a0[_0x41d354(0x248)]+'\x22:\x20'+_0x13b8a0['error']));}return 0x1;}const _0x4876bb=_0x5f3e40['counts'][_0x41d354(0x220)][_0x41d354(0x1fe)]+_0x5f3e40['counts'][_0x41d354(0x251)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x237)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x204)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x245)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)]['created'],_0x371ae6=_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x220)][_0x41d354(0x19d)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x251)][_0x41d354(0x19d)]+_0x5f3e40['counts']['textKnowledgeBases']['updated']+_0x5f3e40[_0x41d354(0x21e)]['prompts'][_0x41d354(0x19d)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)][_0x41d354(0x19d)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x245)]['updated']+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)][_0x41d354(0x19d)],_0x3f1848=_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x220)][_0x41d354(0x231)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x251)]['unchanged']+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x237)][_0x41d354(0x231)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x204)]['unchanged']+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)][_0x41d354(0x231)]+_0x5f3e40['counts'][_0x41d354(0x245)][_0x41d354(0x231)]+_0x5f3e40['counts']['experimentalArtifacts'][_0x41d354(0x231)];console[_0x41d354(0x1d9)](_0x41d354(0x1a5)+_0x5f3e40[_0x41d354(0x250)]+'\x27:'),console['log']('\x20\x20'+a4_0x566038['green']('+\x20'+_0x4876bb+_0x41d354(0x1fb))+_0x41d354(0x1b6)+a4_0x566038[_0x41d354(0x19f)]('~\x20'+_0x371ae6+_0x41d354(0x1ce))+_0x41d354(0x1b6)+a4_0x566038[_0x41d354(0x1f4)]('=\x20'+_0x3f1848+_0x41d354(0x254))),console[_0x41d354(0x1d9)](_0x41d354(0x255)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x220)])),console[_0x41d354(0x1d9)](_0x41d354(0x21b)+formatCountSummary(_0x5f3e40['counts']['knowledgeBases'])),console[_0x41d354(0x1d9)](_0x41d354(0x1b5)+formatCountSummary(_0x5f3e40['counts']['textKnowledgeBases'])),console['log'](_0x41d354(0x1af)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x204)])),console['log'](_0x41d354(0x1a2)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)]));const _0x291e0e=_0x5f3e40['counts'][_0x41d354(0x245)]['created']>0x0||_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x245)][_0x41d354(0x19d)]>0x0||_0x5f3e40['counts']['experimentalKnowledgeBases'][_0x41d354(0x231)]>0x0||_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)][_0x41d354(0x1fe)]>0x0||_0x5f3e40[_0x41d354(0x21e)]['experimentalArtifacts'][_0x41d354(0x19d)]>0x0||_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)][_0x41d354(0x231)]>0x0;_0x291e0e&&(console[_0x41d354(0x1d9)](_0x41d354(0x1ab)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)]['experimentalKnowledgeBases'])),console[_0x41d354(0x1d9)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)])));console[_0x41d354(0x1d9)]('\x20\x20Source:\x20'+a4_0x566038['cyan'](_0x3c3222)),displayDiffs(_0x5f3e40[_0x41d354(0x220)],_0x5f3e40[_0x41d354(0x251)],_0x5f3e40[_0x41d354(0x237)],_0x5f3e40[_0x41d354(0x204)],_0x5f3e40[_0x41d354(0x1b0)],_0x5f3e40[_0x41d354(0x245)],_0x5f3e40[_0x41d354(0x1cd)]);if(_0x21ecf5)return console['log'](a4_0x566038[_0x41d354(0x19f)](_0x41d354(0x1aa))),0x0;if(_0x4876bb===0x0&&_0x371ae6===0x0){console[_0x41d354(0x1d9)](a4_0x566038['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4ab541=getLLMProjectUrl(_0x52f021,_0x5f3e40['projectId']);return console[_0x41d354(0x1d9)](_0x41d354(0x1d2)+a4_0x566038['cyan'](_0x4ab541)),0x0;}if(!_0x354509&&!_0x3a98c7){if(!isInteractive())return console[_0x41d354(0x1cb)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x224)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41d354(0x1cb)](a4_0x566038[_0x41d354(0x1f4)](_0x41d354(0x1c3))),0x1;const _0x5b838a=await confirmKey(_0x41d354(0x21f)+(_0x4876bb+_0x371ae6)+_0x41d354(0x218));if(!_0x5b838a)return console[_0x41d354(0x1d9)](a4_0x566038['yellow'](_0x41d354(0x1cf)),_0x41d354(0x226)),0x1;}const {data:_0x314929}=await withSpinner(_0x41d354(0x24b),()=>_0x562ae1[_0x41d354(0x23a)][_0x41d354(0x21d)](_0x3c3222,{'force':_0x3a98c7})),_0x3364cc=_0x314929[_0x41d354(0x21e)][_0x41d354(0x220)][_0x41d354(0x1d3)]>0x0||_0x314929[_0x41d354(0x21e)][_0x41d354(0x251)][_0x41d354(0x1d3)]>0x0||_0x314929[_0x41d354(0x21e)][_0x41d354(0x237)][_0x41d354(0x1d3)]>0x0||_0x314929[_0x41d354(0x21e)][_0x41d354(0x204)][_0x41d354(0x1d3)]>0x0;if(_0x3364cc){console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x19f)](_0x41d354(0x1fc))),console[_0x41d354(0x1d9)](),console['log'](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x233)));for(const _0x3772d2 of _0x314929['agents']){_0x3772d2[_0x41d354(0x20a)]===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)]('\x20\x20Agent\x20\x22'+_0x3772d2[_0x41d354(0x248)]+'\x22:\x20'+_0x3772d2[_0x41d354(0x1cb)]));}for(const _0x4b2f80 of _0x314929['knowledgeBases']){_0x4b2f80['action']===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x258)+_0x4b2f80['name']+_0x41d354(0x232)+_0x4b2f80[_0x41d354(0x1cb)]));}for(const _0x158052 of _0x314929[_0x41d354(0x237)]){_0x158052['action']==='error'&&console['log'](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x1e8)+_0x158052[_0x41d354(0x24c)]+_0x41d354(0x232)+_0x158052[_0x41d354(0x1cb)]));}for(const _0x31f41c of _0x314929[_0x41d354(0x204)]){_0x31f41c[_0x41d354(0x20a)]===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x1c6)+_0x31f41c['name']+_0x41d354(0x232)+_0x31f41c[_0x41d354(0x1cb)]));}for(const _0x52b677 of _0x314929[_0x41d354(0x1b0)]){_0x52b677[_0x41d354(0x20a)]===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x1d6)+_0x52b677['name']+_0x41d354(0x232)+_0x52b677[_0x41d354(0x1cb)]));}return 0x1;}console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x201)]('\x0a✔\x20Pushed\x20'+(_0x4876bb+_0x371ae6)+_0x41d354(0x1e3)+_0x314929[_0x41d354(0x250)]+'\x27'));const _0x2f3b26=getLLMProjectUrl(_0x52f021,_0x314929[_0x41d354(0x1b2)]);return console[_0x41d354(0x1d9)]('Project:\x20'+a4_0x566038['cyan'](_0x2f3b26)),0x0;}}
|
|
1
|
+
const a4_0x374e44=a4_0x4f38;(function(_0x54b189,_0x83ef23){const _0xf963e9=a4_0x4f38,_0x317979=_0x54b189();while(!![]){try{const _0x352327=-parseInt(_0xf963e9(0x18d))/0x1+parseInt(_0xf963e9(0x1ef))/0x2+parseInt(_0xf963e9(0x1ae))/0x3*(parseInt(_0xf963e9(0x1bd))/0x4)+parseInt(_0xf963e9(0x198))/0x5*(parseInt(_0xf963e9(0x1d8))/0x6)+-parseInt(_0xf963e9(0x1e7))/0x7*(-parseInt(_0xf963e9(0x171))/0x8)+-parseInt(_0xf963e9(0x1cc))/0x9*(-parseInt(_0xf963e9(0x173))/0xa)+parseInt(_0xf963e9(0x1f3))/0xb*(-parseInt(_0xf963e9(0x21b))/0xc);if(_0x352327===_0x83ef23)break;else _0x317979['push'](_0x317979['shift']());}catch(_0xf7c562){_0x317979['push'](_0x317979['shift']());}}}(a4_0x271d,0x38c85));function a4_0x4f38(_0x38c5cc,_0xba20d9){_0x38c5cc=_0x38c5cc-0x164;const _0x271d37=a4_0x271d();let _0x4f384f=_0x271d37[_0x38c5cc];return _0x4f384f;}import a4_0x456cf5 from'chalk';import a4_0x2b1dd1 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 a4_0x271d(){const _0xbdde9c=['Using\x20project\x20from\x20context:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aPush\x20summary\x20for\x20\x27','parse','\x20\x20Experimental\x20Artifact\x20\x22','session','24723OqLDfc','Writing\x20files...','\x20files?','\x20successfully','\x20|\x20','knowledgeBases','red','cwd','force','Would\x20push\x20agent:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x27\x20to\x20create\x20the\x20folder\x20structure.','2244kTpIJM','total','\x20changed','\x0a✔\x20Pulled\x20','Pushing\x20agent\x20from\x20\x22','prompts','updated','\x0aChanges:','New\x20project\x20name\x20is\x20required','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)','\x0aWrite\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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','agents','arg-dir','985327kVAyfQ','message','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Bases:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','new','\x20\x20Knowledge\x20Base\x20\x22','<new-name>','826488RpHogs','reason','join','textKnowledgeBases','36707Dxopqi','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','projectName','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agent.yml','\x20resources?','hasChanges','no_local_folder','action','Using\x20context\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Clone\x20\x22','Would\x20pull\x20agent:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputPath','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Project\x20cloned\x20successfully','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Would\x20clone:','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Agent\x20','\x20\x20tdx\x20agent\x20pull\x20','\x0aPush\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent:push','Project:\x20','\x22\x20from\x20project\x20\x22','experimentalKnowledgeBases','\x20total','\x22\x20to\x20\x22','\x20unchanged','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','agentId','context','\x20created','cwd-config','\x0aErrors\x20found:','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','New\x20project:\x20','3228uGzcSi','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','MISSING_ARGUMENT','\x20=\x20','counts','pushProject','sourceProjectName','log','Dry\x20run\x20-\x20no\x20changes\x20made','-\x20nothing\x20pushed','source','dim','-\x20no\x20files\x20written','Cloning\x20\x22','agent:pull','execute','agent','newProjectId','\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Prompt\x20\x22','site','Using\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','24MQCojU','\x22...','130rZjgmj','llmProject','\x22\x20to\x20a\x20different\x20profile','name','pullProject','projectId','\x0aProject\x20pushed\x20with\x20errors','integrations','Pulling\x20agent\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','yes','tdx.json','\x22\x20to\x20new\x20project\x20\x22','\x20new','outputDir','errors','Failed\x20to\x20push\x20agent:\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','Cancelled','isNew','newProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','diff','Output:\x20','162626PHqCwM','Agent:\x20','cloneProject','experimentalArtifacts','Status:\x20','Using\x20local\x20project:\x20','cyan','utf-8','Pushing\x20to\x20project...','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','4385XhmVTY','dryRun','INVALID_ARGUMENT','\x20errors','llm','\x20\x20Integration\x20\x22','Agent\x20pulled\x20successfully','\x0a✔\x20Pushed\x20','\x22:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Agent\x20\x22','\x20\x20Prompts:\x20','no_context','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Source:\x20','✔\x20Context\x20set:\x20','error','\x20resources\x20to\x20\x27','green','repeat','unchanged','projectDir','3uwCSfL','pushAgent','dirname','\x20\x20tdx\x20agent\x20clone\x20agents/','agentName','created','\x20\x20Agents:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','found','\x20updated','gray','llm_project','description','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','374496ERmjXG','push','yellow','\x20--name\x20','\x0aChanges\x20to\x20agent\x20\x27','Output\x20path:\x20','Source:\x20','\x20\x20Target:\x20','Using\x20project\x20from\x20'];a4_0x271d=function(){return _0xbdde9c;};return a4_0x271d();}function formatCountSummary(_0x485691){const _0x530fe0=a4_0x4f38,_0xf96b78=[];if(_0x485691[_0x530fe0(0x1d9)]!==undefined)_0xf96b78[_0x530fe0(0x1be)](_0x485691[_0x530fe0(0x1d9)]+_0x530fe0(0x210));if(_0x485691[_0x530fe0(0x1ec)]!==undefined&&_0x485691[_0x530fe0(0x1ec)]>0x0)_0xf96b78['push'](a4_0x456cf5[_0x530fe0(0x1aa)](_0x485691['new']+_0x530fe0(0x181)));if(_0x485691['created']!==undefined&&_0x485691['created']>0x0)_0xf96b78[_0x530fe0(0x1be)](a4_0x456cf5['green'](_0x485691['created']+_0x530fe0(0x216)));if(_0x485691['updated']!==undefined&&_0x485691['updated']>0x0)_0xf96b78[_0x530fe0(0x1be)](a4_0x456cf5['yellow'](_0x485691[_0x530fe0(0x1de)]+_0x530fe0(0x1b8)));if(_0x485691[_0x530fe0(0x1ac)]!==undefined&&_0x485691[_0x530fe0(0x1ac)]>0x0)_0xf96b78['push'](a4_0x456cf5[_0x530fe0(0x1b9)](_0x485691[_0x530fe0(0x1ac)]+'\x20unchanged'));if(_0x485691[_0x530fe0(0x183)]!==undefined&&_0x485691['errors']>0x0)_0xf96b78[_0x530fe0(0x1be)](a4_0x456cf5[_0x530fe0(0x1d2)](_0x485691[_0x530fe0(0x183)]+_0x530fe0(0x19b)));return _0xf96b78[_0x530fe0(0x1f1)](',\x20');}function displayDiffs(_0x193b27,_0x20b613,_0x34b39e,_0x14fa01,_0x42cb8c,_0x57c208,_0x487fec){const _0x2d56cf=a4_0x4f38;for(const _0x446396 of _0x193b27){if(_0x446396['diff']){const _0x5b5122=_0x446396[_0x2d56cf(0x1b2)]||_0x446396[_0x2d56cf(0x176)];console[_0x2d56cf(0x223)](_0x2d56cf(0x1c1)+_0x5b5122+'\x27:'),console['log']('─'[_0x2d56cf(0x1ab)](0x3c)),console[_0x2d56cf(0x223)](_0x446396['diff']),console[_0x2d56cf(0x223)]('─'['repeat'](0x3c));}}for(const _0x18c5e2 of _0x20b613){_0x18c5e2[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x18c5e2[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console['log'](_0x18c5e2[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'['repeat'](0x3c)));}for(const _0x36b4b0 of _0x34b39e){_0x36b4b0[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x36b4b0[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console['log'](_0x36b4b0[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x3a94ff of _0x14fa01){_0x3a94ff[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x3a94ff[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console['log'](_0x3a94ff[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x5d3c58 of _0x42cb8c){_0x5d3c58[_0x2d56cf(0x18b)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x5d3c58[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)),console[_0x2d56cf(0x223)](_0x5d3c58[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x55234d of _0x57c208){_0x55234d[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)](_0x2d56cf(0x203)+_0x55234d[_0x2d56cf(0x176)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x2d56cf(0x223)](_0x55234d[_0x2d56cf(0x18b)]),console[_0x2d56cf(0x223)]('─'[_0x2d56cf(0x1ab)](0x3c)));}for(const _0x29febd of _0x487fec){_0x29febd[_0x2d56cf(0x18b)]&&(console[_0x2d56cf(0x223)](_0x2d56cf(0x196)+_0x29febd[_0x2d56cf(0x176)]+'\x27:'),console[_0x2d56cf(0x223)]('─'['repeat'](0x3c)),console[_0x2d56cf(0x223)](_0x29febd[_0x2d56cf(0x18b)]),console['log']('─'[_0x2d56cf(0x1ab)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x374e44(0x176)]=a4_0x374e44(0x167);[a4_0x374e44(0x1bb)]=a4_0x374e44(0x1fd);async[a4_0x374e44(0x168)](_0x27fb08){const _0x1e5c38=a4_0x374e44,{options:_0x46fc78,args:_0x48030b,tdx:_0x33e641}=_0x27fb08,_0x453527=_0x48030b[0x0],_0x16c9ad=_0x48030b[0x1],_0x1a8380=_0x46fc78['output'],_0x4864af=_0x46fc78[_0x1e5c38(0x199)],_0x13cc3f=_0x46fc78[_0x1e5c38(0x1d4)],_0x598a49=_0x46fc78['yes'],_0xee8d27=_0x46fc78[_0x1e5c38(0x174)],_0x5927a3=_0x46fc78[_0x1e5c38(0x169)];let _0x1bea90;if(_0x453527){const _0xe1bcc5=a4_0x2b1dd1['join'](_0x453527,_0x1e5c38(0x17f));if(existsSync(_0xe1bcc5))try{const _0x210aa9=JSON[_0x1e5c38(0x1c9)](readFileSync(_0xe1bcc5,'utf-8'));_0x210aa9[_0x1e5c38(0x1ba)]&&(_0x1bea90={'llm_project':_0x210aa9[_0x1e5c38(0x1ba)]});}catch{}}const _0x4bae8f=findAgentConfigPath(process[_0x1e5c38(0x1d3)]());let _0x199982;if(_0x4bae8f)try{const _0xb930ae=JSON[_0x1e5c38(0x1c9)](readFileSync(_0x4bae8f,_0x1e5c38(0x194)));_0xb930ae[_0x1e5c38(0x1ba)]&&(_0x199982={'llm_project':_0xb930ae[_0x1e5c38(0x1ba)]});}catch{}const _0x2eee9b=resolveAgentPullArgs({'arg':_0x453527,'agentNameArg':_0x16c9ad,'agentFlag':_0x5927a3,'contextProject':_0xee8d27,'argDirConfig':_0x1bea90,'cwdConfigPath':_0x4bae8f||undefined,'cwdConfig':_0x199982}),{projectNameOrId:_0x2a78c8,targetAgentName:_0x6ccb0c,existingOutputDir:_0x4232b6,source:_0x3a5a2d}=_0x2eee9b;if(_0x3a5a2d===_0x1e5c38(0x1e6))console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x164)](_0x1e5c38(0x1c5)+a4_0x2b1dd1['join'](_0x453527,'tdx.json')+':\x20'+_0x2a78c8));else{if(_0x3a5a2d===_0x1e5c38(0x217))console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x164)]('Using\x20project:\x20'+_0x2a78c8));else _0x3a5a2d===_0x1e5c38(0x215)&&console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x164)](_0x1e5c38(0x1c6)+_0x2a78c8));}if(!_0x2a78c8)return _0x5927a3?(console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x17d))),console[_0x1e5c38(0x223)](_0x1e5c38(0x1a1)),console['log'](_0x1e5c38(0x21d))):(console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x1b6))),console[_0x1e5c38(0x223)](_0x1e5c38(0x1e1)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x1e5c38(0x223)](_0x1e5c38(0x1e4)),console[_0x1e5c38(0x223)](_0x1e5c38(0x1d6)),console[_0x1e5c38(0x223)]('\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(_0x6ccb0c){const {data:_0x28d2a8}=await withSpinner(_0x1e5c38(0x17b)+_0x6ccb0c+_0x1e5c38(0x20e)+_0x2a78c8+_0x1e5c38(0x172),()=>_0x33e641[_0x1e5c38(0x19c)]['pullAgent'](_0x2a78c8,_0x6ccb0c,_0x1a8380,{'dryRun':_0x4864af,'force':_0x13cc3f}));if(_0x4864af)return console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x1a5))),console[_0x1e5c38(0x223)](_0x1e5c38(0x200)+_0x28d2a8['agentName']),console[_0x1e5c38(0x223)](_0x1e5c38(0x1c2)+_0x28d2a8[_0x1e5c38(0x202)]),_0x28d2a8[_0x1e5c38(0x18b)]&&(console['log'](_0x1e5c38(0x1df)),console[_0x1e5c38(0x223)]('─'[_0x1e5c38(0x1ab)](0x3c)),console[_0x1e5c38(0x223)](_0x28d2a8[_0x1e5c38(0x18b)]),console['log']('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x456cf5[_0x1e5c38(0x1aa)](_0x1e5c38(0x19e))),console[_0x1e5c38(0x223)](_0x1e5c38(0x18e)+_0x28d2a8[_0x1e5c38(0x1b2)]),console[_0x1e5c38(0x223)](_0x1e5c38(0x18c)+_0x28d2a8[_0x1e5c38(0x202)]),console[_0x1e5c38(0x223)](_0x1e5c38(0x191)+(_0x28d2a8[_0x1e5c38(0x188)]?a4_0x456cf5[_0x1e5c38(0x1aa)]('new'):_0x28d2a8[_0x1e5c38(0x1f9)]?a4_0x456cf5['yellow']('updated'):a4_0x456cf5[_0x1e5c38(0x1b9)](_0x1e5c38(0x1ac)))),0x0;}const _0x31a284=_0x4232b6||_0x1a8380,{data:_0x8e931b}=await withSpinner('Analyzing\x20project\x20\x22'+_0x2a78c8+_0x1e5c38(0x172),()=>_0x33e641[_0x1e5c38(0x19c)][_0x1e5c38(0x177)](_0x2a78c8,_0x31a284,{'dryRun':!![]})),_0x39b819=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)]['new']+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1d1)][_0x1e5c38(0x1ec)]+_0x8e931b['counts'][_0x1e5c38(0x1f2)]['new']+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1dd)]['new']+_0x8e931b['counts'][_0x1e5c38(0x17a)]['new']+_0x8e931b[_0x1e5c38(0x220)]['experimentalKnowledgeBases']['new']+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)][_0x1e5c38(0x1ec)],_0x9195a6=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)]['updated']+_0x8e931b[_0x1e5c38(0x220)]['knowledgeBases'][_0x1e5c38(0x1de)]+_0x8e931b['counts'][_0x1e5c38(0x1f2)]['updated']+_0x8e931b['counts'][_0x1e5c38(0x1dd)]['updated']+_0x8e931b[_0x1e5c38(0x220)]['integrations'][_0x1e5c38(0x1de)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x20f)][_0x1e5c38(0x1de)]+_0x8e931b['counts'][_0x1e5c38(0x190)][_0x1e5c38(0x1de)],_0x423b04=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)][_0x1e5c38(0x1ac)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1d1)]['unchanged']+_0x8e931b['counts']['textKnowledgeBases'][_0x1e5c38(0x1ac)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1dd)][_0x1e5c38(0x1ac)]+_0x8e931b['counts'][_0x1e5c38(0x17a)][_0x1e5c38(0x1ac)]+_0x8e931b['counts'][_0x1e5c38(0x20f)][_0x1e5c38(0x1ac)]+_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)]['unchanged'];console[_0x1e5c38(0x223)](_0x1e5c38(0x185)+_0x8e931b[_0x1e5c38(0x1f5)]+'\x27:'),console[_0x1e5c38(0x223)]('\x20\x20'+a4_0x456cf5[_0x1e5c38(0x1aa)]('+\x20'+_0x39b819+_0x1e5c38(0x181))+_0x1e5c38(0x1d0)+a4_0x456cf5[_0x1e5c38(0x1bf)]('~\x20'+_0x9195a6+_0x1e5c38(0x1da))+_0x1e5c38(0x1d0)+a4_0x456cf5[_0x1e5c38(0x164)]('=\x20'+_0x423b04+'\x20unchanged')),console[_0x1e5c38(0x223)](_0x1e5c38(0x1b4)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1e5)])),console['log'](_0x1e5c38(0x1ea)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1d1)])),console[_0x1e5c38(0x223)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x8e931b['counts']['textKnowledgeBases'])),console[_0x1e5c38(0x223)](_0x1e5c38(0x1a3)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x1dd)])),console[_0x1e5c38(0x223)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x17a)]));const _0x1417a6=_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x20f)]['total']>0x0||_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)][_0x1e5c38(0x1d9)]>0x0;_0x1417a6&&(console[_0x1e5c38(0x223)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)]['experimentalKnowledgeBases'])),console[_0x1e5c38(0x223)](_0x1e5c38(0x1e9)+formatCountSummary(_0x8e931b[_0x1e5c38(0x220)][_0x1e5c38(0x190)])));console['log'](_0x1e5c38(0x1c4)+a4_0x456cf5['cyan'](_0x8e931b[_0x1e5c38(0x182)])),displayDiffs(_0x8e931b[_0x1e5c38(0x1e5)],_0x8e931b['knowledgeBases'],_0x8e931b['textKnowledgeBases'],_0x8e931b['prompts'],_0x8e931b[_0x1e5c38(0x17a)],_0x8e931b['experimentalKnowledgeBases'],_0x8e931b['experimentalArtifacts']);if(_0x4864af)return console['log'](a4_0x456cf5['yellow'](_0x1e5c38(0x16c))),0x0;if(_0x39b819===0x0&&_0x9195a6===0x0)return console[_0x1e5c38(0x223)](a4_0x456cf5['green'](_0x1e5c38(0x18a))),saveSessionContext({'llm_project':_0x8e931b[_0x1e5c38(0x1f5)]},_0x46fc78[_0x1e5c38(0x1cb)]),console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1aa)](_0x1e5c38(0x1a7)+a4_0x456cf5[_0x1e5c38(0x164)]('llm_project')+_0x1e5c38(0x21f)+a4_0x456cf5['cyan'](_0x8e931b[_0x1e5c38(0x1f5)]))),0x0;if(!_0x598a49&&!_0x13cc3f){if(!isInteractive())return console[_0x1e5c38(0x1a8)](a4_0x456cf5[_0x1e5c38(0x1d2)]('\x0aError:'),_0x1e5c38(0x17c)),console[_0x1e5c38(0x1a8)](a4_0x456cf5['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3a390c=await confirmKey(_0x1e5c38(0x1e2)+(_0x39b819+_0x9195a6)+_0x1e5c38(0x1ce));if(!_0x3a390c)return console['log'](a4_0x456cf5[_0x1e5c38(0x1bf)](_0x1e5c38(0x187)),_0x1e5c38(0x165)),0x1;}const {data:_0xdd4cfd}=await withSpinner(_0x1e5c38(0x1cd),()=>_0x33e641[_0x1e5c38(0x19c)][_0x1e5c38(0x177)](_0x2a78c8,_0x31a284,{'force':_0x13cc3f}));return console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1aa)](_0x1e5c38(0x1db)+(_0x39b819+_0x9195a6)+_0x1e5c38(0x16b)+_0xdd4cfd['outputDir'])),saveSessionContext({'llm_project':_0xdd4cfd[_0x1e5c38(0x1f5)]},_0x46fc78[_0x1e5c38(0x1cb)]),console[_0x1e5c38(0x223)](a4_0x456cf5[_0x1e5c38(0x1aa)]('✔\x20Context\x20set:\x20'+a4_0x456cf5[_0x1e5c38(0x164)](_0x1e5c38(0x1ba))+'\x20=\x20'+a4_0x456cf5[_0x1e5c38(0x193)](_0xdd4cfd['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x374e44(0x176)]='agent:clone';['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x374e44(0x168)](_0x2febad){const _0x4663f5=a4_0x374e44,{options:_0x429d35,args:_0x2a3a48,tdx:_0x52ad80}=_0x2febad,_0x1fd426=_0x2a3a48[0x0],_0x464dc3=_0x429d35[_0x4663f5(0x176)],_0x281ac8=_0x429d35[_0x4663f5(0x199)],_0xf65e54=_0x429d35[_0x4663f5(0x17e)],_0x536cd2=_0x429d35[_0x4663f5(0x16e)],_0x41d017=_0x429d35[_0x4663f5(0x174)];let _0x4db4c2;const _0x30a485=findAgentConfigPath(process['cwd']());if(_0x1fd426){const _0x257c3f=a4_0x2b1dd1['join'](_0x1fd426,_0x4663f5(0x17f));existsSync(_0x257c3f)?(_0x4db4c2=_0x1fd426,console['log'](a4_0x456cf5[_0x4663f5(0x164)](_0x4663f5(0x192)+_0x1fd426))):_0x4db4c2=_0x1fd426;}else{if(_0x30a485)_0x4db4c2=a4_0x2b1dd1[_0x4663f5(0x1b0)](_0x30a485),console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x164)]('Using\x20current\x20project:\x20'+_0x4db4c2));else{if(_0x41d017){const _0x3db6e3=sanitizeForFilesystem(_0x41d017);let _0x1a63a4=_0x3db6e3,_0x3dad68=a4_0x2b1dd1['join'](process[_0x4663f5(0x1d3)](),'agents',_0x3db6e3,_0x4663f5(0x17f));if(!existsSync(_0x3dad68)){const _0x27d63d=normalizeName(_0x41d017),_0x14c845=a4_0x2b1dd1[_0x4663f5(0x1f1)](process[_0x4663f5(0x1d3)](),'agents',_0x27d63d,'tdx.json');existsSync(_0x14c845)&&(_0x1a63a4=_0x27d63d,_0x3dad68=_0x14c845);}if(existsSync(_0x3dad68))_0x4db4c2=a4_0x2b1dd1[_0x4663f5(0x1b0)](_0x3dad68),console['log'](a4_0x456cf5[_0x4663f5(0x164)](_0x4663f5(0x192)+_0x4db4c2));else{const _0x588c74=_0x429d35['profile'];if(_0x588c74)throw new SDKError(ErrorCode[_0x4663f5(0x19a)],_0x4663f5(0x1b5)+_0x41d017+_0x4663f5(0x175),undefined,{'helpText':_0x4663f5(0x1bc)+_0x4663f5(0x1f6)+(_0x4663f5(0x209)+_0x41d017+'\x0a')+(_0x4663f5(0x1b1)+_0x1a63a4+_0x4663f5(0x1c0)+(_0x464dc3||_0x4663f5(0x1ee))+'\x20--profile\x20'+_0x588c74)});_0x4db4c2=_0x41d017,console['log'](a4_0x456cf5[_0x4663f5(0x164)](_0x4663f5(0x1fc)+_0x41d017));}}}}if(!_0x4db4c2)return console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1bf)](_0x4663f5(0x1fe))),console[_0x4663f5(0x223)](_0x4663f5(0x170)),console[_0x4663f5(0x223)](_0x4663f5(0x21c)),console[_0x4663f5(0x223)]('\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[_0x4663f5(0x223)](_0x4663f5(0x1f4)),0x1;if(!_0x464dc3)throw new SDKError(ErrorCode[_0x4663f5(0x21e)],_0x4663f5(0x1e0),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0xf65e54&&!_0x281ac8){if(!isInteractive())return console[_0x4663f5(0x1a8)](a4_0x456cf5['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4663f5(0x1a8)](a4_0x456cf5[_0x4663f5(0x164)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x26759f=await confirmKey(_0x4663f5(0x1ff)+_0x4db4c2+_0x4663f5(0x180)+_0x464dc3+'\x22?');if(!_0x26759f)return console[_0x4663f5(0x223)](a4_0x456cf5['yellow']('Cancelled')),0x1;}const {data:_0x1e5182}=await withSpinner(_0x4663f5(0x166)+_0x4db4c2+_0x4663f5(0x211)+_0x464dc3+'\x22...',()=>_0x52ad80[_0x4663f5(0x19c)][_0x4663f5(0x18f)](_0x4db4c2,_0x464dc3,{'dryRun':_0x281ac8}));if(_0x281ac8){console[_0x4663f5(0x223)](a4_0x456cf5['yellow'](_0x4663f5(0x224))),console[_0x4663f5(0x223)](_0x4663f5(0x1c3)+_0x1e5182[_0x4663f5(0x222)]),console[_0x4663f5(0x223)]('New\x20project:\x20'+_0x464dc3),console[_0x4663f5(0x223)](_0x4663f5(0x206)),console[_0x4663f5(0x223)]('\x20\x20Agents:\x20'+_0x1e5182['counts'][_0x4663f5(0x1e5)][_0x4663f5(0x1b3)]),console['log'](_0x4663f5(0x1ea)+_0x1e5182['counts'][_0x4663f5(0x1d1)]['created']),console['log'](_0x4663f5(0x1a3)+_0x1e5182['counts'][_0x4663f5(0x1dd)][_0x4663f5(0x1b3)]);const _0x2e9ccf=_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x20f)][_0x4663f5(0x1b3)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x190)][_0x4663f5(0x1b3)]>0x0;return _0x2e9ccf&&(console[_0x4663f5(0x223)](_0x4663f5(0x201)+_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x20f)][_0x4663f5(0x1b3)]),console[_0x4663f5(0x223)](_0x4663f5(0x1e9)+_0x1e5182[_0x4663f5(0x220)]['experimentalArtifacts']['created'])),0x0;}const _0x276688=_0x1e5182['counts']['agents'][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1d1)][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1dd)][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x183)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalArtifacts'][_0x4663f5(0x183)]>0x0;_0x276688?console['log'](a4_0x456cf5[_0x4663f5(0x1bf)]('Project\x20cloned\x20with\x20errors')):console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1aa)](_0x4663f5(0x204)));console[_0x4663f5(0x223)](_0x4663f5(0x1c3)+_0x1e5182['sourceProjectName']),console['log'](_0x4663f5(0x21a)+_0x1e5182[_0x4663f5(0x189)]),console[_0x4663f5(0x223)]('New\x20project\x20ID:\x20'+_0x1e5182[_0x4663f5(0x16a)]),console[_0x4663f5(0x223)](),console[_0x4663f5(0x223)]('Summary:'),console['log'](_0x4663f5(0x1b4)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1e5)])),console[_0x4663f5(0x223)](_0x4663f5(0x1ea)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1d1)])),console[_0x4663f5(0x223)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x1dd)])),console['log'](_0x4663f5(0x186)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)]['integrations']));const _0x4d7cce=_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x1b3)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x1de)]>0x0||_0x1e5182[_0x4663f5(0x220)]['experimentalKnowledgeBases'][_0x4663f5(0x1ac)]>0x0||_0x1e5182['counts']['experimentalArtifacts'][_0x4663f5(0x1b3)]>0x0||_0x1e5182['counts'][_0x4663f5(0x190)][_0x4663f5(0x1de)]>0x0||_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x190)][_0x4663f5(0x1ac)]>0x0;_0x4d7cce&&(console[_0x4663f5(0x223)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x20f)])),console['log'](_0x4663f5(0x1e9)+formatCountSummary(_0x1e5182[_0x4663f5(0x220)][_0x4663f5(0x190)])));if(_0x276688){console['log'](),console['log'](a4_0x456cf5['red']('Errors:'));for(const _0x2db973 of _0x1e5182['agents']){_0x2db973[_0x4663f5(0x1fb)]===_0x4663f5(0x1a8)&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x1a2)+_0x2db973[_0x4663f5(0x1b2)]+'\x22:\x20'+_0x2db973['error']));}for(const _0x477ef5 of _0x1e5182['knowledgeBases']){_0x477ef5['action']===_0x4663f5(0x1a8)&&console['log'](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x1ed)+_0x477ef5[_0x4663f5(0x176)]+_0x4663f5(0x1a0)+_0x477ef5[_0x4663f5(0x1a8)]));}for(const _0x3d7ddf of _0x1e5182['prompts']){_0x3d7ddf[_0x4663f5(0x1fb)]===_0x4663f5(0x1a8)&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)]('\x20\x20Prompt\x20\x22'+_0x3d7ddf[_0x4663f5(0x176)]+'\x22:\x20'+_0x3d7ddf[_0x4663f5(0x1a8)]));}for(const _0x137f3e of _0x1e5182[_0x4663f5(0x17a)]){_0x137f3e['action']==='error'&&console[_0x4663f5(0x223)](a4_0x456cf5['red']('\x20\x20Integration\x20\x22'+_0x137f3e[_0x4663f5(0x176)]+_0x4663f5(0x1a0)+_0x137f3e[_0x4663f5(0x1a8)]));}for(const _0x4af12d of _0x1e5182[_0x4663f5(0x20f)]){_0x4af12d[_0x4663f5(0x1fb)]==='error'&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x20b)+_0x4af12d[_0x4663f5(0x176)]+'\x22:\x20'+_0x4af12d[_0x4663f5(0x1a8)]));}for(const _0x1ea18c of _0x1e5182[_0x4663f5(0x190)]){_0x1ea18c[_0x4663f5(0x1fb)]==='error'&&console[_0x4663f5(0x223)](a4_0x456cf5[_0x4663f5(0x1d2)](_0x4663f5(0x1ca)+_0x1ea18c[_0x4663f5(0x176)]+_0x4663f5(0x1a0)+_0x1ea18c[_0x4663f5(0x1a8)]));}return 0x1;}console['log']();const _0x3fce66=getLLMProjectUrl(_0x536cd2,_0x1e5182['newProjectId']);return console[_0x4663f5(0x223)](_0x4663f5(0x20d)+a4_0x456cf5[_0x4663f5(0x193)](_0x3fce66)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x374e44(0x176)]=a4_0x374e44(0x20c);[a4_0x374e44(0x1bb)]=a4_0x374e44(0x213);async[a4_0x374e44(0x168)](_0x2dee3e){const _0x4a0430=a4_0x374e44,{options:_0x15b5b6,args:_0x25e40a,tdx:_0x4e7c68}=_0x2dee3e;let _0x386cb7=_0x25e40a[0x0]||process[_0x4a0430(0x1d3)]();const _0x488e4f=_0x15b5b6[_0x4a0430(0x199)],_0x420b0e=_0x15b5b6[_0x4a0430(0x1d4)],_0x566b10=_0x15b5b6[_0x4a0430(0x17e)],_0x533cee=_0x15b5b6[_0x4a0430(0x16e)],_0x207014=a4_0x2b1dd1[_0x4a0430(0x1f1)](_0x386cb7,_0x4a0430(0x1f7)),_0x4c69fd=existsSync(_0x207014);if(_0x4c69fd){const {data:_0x17e45a}=await withSpinner(_0x4a0430(0x1dc)+_0x386cb7+_0x4a0430(0x172),()=>_0x4e7c68[_0x4a0430(0x19c)][_0x4a0430(0x1af)](_0x386cb7,{'dryRun':_0x488e4f,'force':_0x420b0e}));if(_0x488e4f)return console['log'](a4_0x456cf5[_0x4a0430(0x1bf)](_0x4a0430(0x224))),console[_0x4a0430(0x223)](_0x4a0430(0x1d5)+_0x17e45a[_0x4a0430(0x1b2)]),0x0;if(_0x17e45a[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8))return console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x184)+_0x17e45a[_0x4a0430(0x1a8)])),0x1;console[_0x4a0430(0x223)](a4_0x456cf5['green'](_0x4a0430(0x208)+_0x17e45a[_0x4a0430(0x1fb)]+_0x4a0430(0x1cf))),console[_0x4a0430(0x223)]('Agent:\x20'+_0x17e45a[_0x4a0430(0x1b2)]);if(_0x17e45a[_0x4a0430(0x214)]&&_0x17e45a['projectId']){const _0x1449f9=getLLMAgentChatUrl(_0x533cee,_0x17e45a[_0x4a0430(0x178)],_0x17e45a[_0x4a0430(0x214)]);console['log']('Chat:\x20'+a4_0x456cf5['cyan'](_0x1449f9));}return 0x0;}const _0x5002e9=_0x15b5b6[_0x4a0430(0x174)],_0x455a3e=resolveProjectFromContext(_0x386cb7,_0x5002e9);if(_0x455a3e[_0x4a0430(0x1b7)])_0x386cb7=_0x455a3e[_0x4a0430(0x1ad)],_0x455a3e[_0x4a0430(0x226)]===_0x4a0430(0x215)&&console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x164)](_0x4a0430(0x16f)+_0x386cb7));else{let _0x17cbef=_0x4a0430(0x205);_0x455a3e['reason']===_0x4a0430(0x1fa)&&(_0x17cbef=_0x455a3e[_0x4a0430(0x1e8)]+_0x4a0430(0x219)+_0x455a3e['llmProject']+_0x4a0430(0x1d7));throw new SDKError(ErrorCode[_0x4a0430(0x19a)],_0x455a3e[_0x4a0430(0x1f0)]===_0x4a0430(0x1a4)?_0x455a3e[_0x4a0430(0x1e8)]:'No\x20tdx.json\x20found\x20in\x20'+_0x386cb7,undefined,{'helpText':_0x17cbef});}const {data:_0x563e82}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x4e7c68[_0x4a0430(0x19c)][_0x4a0430(0x221)](_0x386cb7,{'dryRun':!![]})),_0x66930b=_0x563e82[_0x4a0430(0x220)]['agents'][_0x4a0430(0x183)]>0x0;if(_0x66930b){console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x218)));for(const _0x2ef61d of _0x563e82[_0x4a0430(0x1e5)]){_0x2ef61d[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x1a2)+_0x2ef61d['agentName']+_0x4a0430(0x1a0)+_0x2ef61d[_0x4a0430(0x1a8)]));}return 0x1;}const _0x8bd6a8=_0x563e82['counts'][_0x4a0430(0x1e5)][_0x4a0430(0x1b3)]+_0x563e82[_0x4a0430(0x220)]['knowledgeBases'][_0x4a0430(0x1b3)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1f2)]['created']+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1dd)]['created']+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x17a)][_0x4a0430(0x1b3)]+_0x563e82['counts'][_0x4a0430(0x20f)]['created']+_0x563e82['counts']['experimentalArtifacts'][_0x4a0430(0x1b3)],_0x4fbee9=_0x563e82['counts'][_0x4a0430(0x1e5)][_0x4a0430(0x1de)]+_0x563e82['counts']['knowledgeBases'][_0x4a0430(0x1de)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1f2)]['updated']+_0x563e82['counts']['prompts'][_0x4a0430(0x1de)]+_0x563e82['counts'][_0x4a0430(0x17a)]['updated']+_0x563e82['counts']['experimentalKnowledgeBases'][_0x4a0430(0x1de)]+_0x563e82['counts']['experimentalArtifacts'][_0x4a0430(0x1de)],_0x656128=_0x563e82[_0x4a0430(0x220)]['agents'][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1d1)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1f2)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1dd)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)]['integrations'][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x20f)][_0x4a0430(0x1ac)]+_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x190)][_0x4a0430(0x1ac)];console[_0x4a0430(0x223)](_0x4a0430(0x1c8)+_0x563e82[_0x4a0430(0x1f5)]+'\x27:'),console[_0x4a0430(0x223)]('\x20\x20'+a4_0x456cf5[_0x4a0430(0x1aa)]('+\x20'+_0x8bd6a8+_0x4a0430(0x181))+_0x4a0430(0x1d0)+a4_0x456cf5[_0x4a0430(0x1bf)]('~\x20'+_0x4fbee9+_0x4a0430(0x1da))+_0x4a0430(0x1d0)+a4_0x456cf5[_0x4a0430(0x164)]('=\x20'+_0x656128+_0x4a0430(0x212))),console['log'](_0x4a0430(0x1b4)+formatCountSummary(_0x563e82[_0x4a0430(0x220)]['agents'])),console['log'](_0x4a0430(0x1ea)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1d1)])),console['log'](_0x4a0430(0x197)+formatCountSummary(_0x563e82['counts']['textKnowledgeBases'])),console[_0x4a0430(0x223)](_0x4a0430(0x1a3)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x1dd)])),console[_0x4a0430(0x223)](_0x4a0430(0x186)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x17a)]));const _0x25faea=_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x20f)]['created']>0x0||_0x563e82[_0x4a0430(0x220)]['experimentalKnowledgeBases'][_0x4a0430(0x1de)]>0x0||_0x563e82['counts']['experimentalKnowledgeBases'][_0x4a0430(0x1ac)]>0x0||_0x563e82[_0x4a0430(0x220)]['experimentalArtifacts'][_0x4a0430(0x1b3)]>0x0||_0x563e82[_0x4a0430(0x220)]['experimentalArtifacts']['updated']>0x0||_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x190)][_0x4a0430(0x1ac)]>0x0;_0x25faea&&(console[_0x4a0430(0x223)](_0x4a0430(0x201)+formatCountSummary(_0x563e82['counts'][_0x4a0430(0x20f)])),console[_0x4a0430(0x223)](_0x4a0430(0x1e9)+formatCountSummary(_0x563e82[_0x4a0430(0x220)][_0x4a0430(0x190)])));console[_0x4a0430(0x223)](_0x4a0430(0x1a6)+a4_0x456cf5[_0x4a0430(0x193)](_0x386cb7)),displayDiffs(_0x563e82[_0x4a0430(0x1e5)],_0x563e82['knowledgeBases'],_0x563e82['textKnowledgeBases'],_0x563e82[_0x4a0430(0x1dd)],_0x563e82[_0x4a0430(0x17a)],_0x563e82[_0x4a0430(0x20f)],_0x563e82[_0x4a0430(0x190)]);if(_0x488e4f)return console[_0x4a0430(0x223)](a4_0x456cf5['yellow'](_0x4a0430(0x1eb))),0x0;if(_0x8bd6a8===0x0&&_0x4fbee9===0x0){console['log'](a4_0x456cf5['green'](_0x4a0430(0x207)));const _0x4ffe07=getLLMProjectUrl(_0x533cee,_0x563e82[_0x4a0430(0x178)]);return console['log']('Project:\x20'+a4_0x456cf5[_0x4a0430(0x193)](_0x4ffe07)),0x0;}if(!_0x566b10&&!_0x420b0e){if(!isInteractive())return console[_0x4a0430(0x1a8)](a4_0x456cf5[_0x4a0430(0x1d2)]('\x0aError:'),_0x4a0430(0x17c)),console[_0x4a0430(0x1a8)](a4_0x456cf5[_0x4a0430(0x164)](_0x4a0430(0x1e3))),0x1;const _0x5108c2=await confirmKey(_0x4a0430(0x20a)+(_0x8bd6a8+_0x4fbee9)+_0x4a0430(0x1f8));if(!_0x5108c2)return console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1bf)](_0x4a0430(0x187)),_0x4a0430(0x225)),0x1;}const {data:_0x5ceb26}=await withSpinner(_0x4a0430(0x195),()=>_0x4e7c68[_0x4a0430(0x19c)][_0x4a0430(0x221)](_0x386cb7,{'force':_0x420b0e})),_0xbf4863=_0x5ceb26['counts'][_0x4a0430(0x1e5)][_0x4a0430(0x183)]>0x0||_0x5ceb26[_0x4a0430(0x220)][_0x4a0430(0x1d1)]['errors']>0x0||_0x5ceb26[_0x4a0430(0x220)][_0x4a0430(0x1f2)][_0x4a0430(0x183)]>0x0||_0x5ceb26['counts']['prompts'][_0x4a0430(0x183)]>0x0;if(_0xbf4863){console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1bf)](_0x4a0430(0x179))),console['log'](),console['log'](a4_0x456cf5[_0x4a0430(0x1d2)]('Errors:'));for(const _0x3e8bce of _0x5ceb26[_0x4a0430(0x1e5)]){_0x3e8bce[_0x4a0430(0x1fb)]==='error'&&console[_0x4a0430(0x223)](a4_0x456cf5['red'](_0x4a0430(0x1a2)+_0x3e8bce['agentName']+_0x4a0430(0x1a0)+_0x3e8bce['error']));}for(const _0x50f50c of _0x5ceb26[_0x4a0430(0x1d1)]){_0x50f50c[_0x4a0430(0x1fb)]==='error'&&console['log'](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x1ed)+_0x50f50c[_0x4a0430(0x176)]+_0x4a0430(0x1a0)+_0x50f50c[_0x4a0430(0x1a8)]));}for(const _0x1f0269 of _0x5ceb26[_0x4a0430(0x1f2)]){_0x1f0269[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5['red'](_0x4a0430(0x1c7)+_0x1f0269['name']+_0x4a0430(0x1a0)+_0x1f0269[_0x4a0430(0x1a8)]));}for(const _0x1c189e of _0x5ceb26[_0x4a0430(0x1dd)]){_0x1c189e[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1d2)](_0x4a0430(0x16d)+_0x1c189e['name']+'\x22:\x20'+_0x1c189e['error']));}for(const _0x5db0e9 of _0x5ceb26[_0x4a0430(0x17a)]){_0x5db0e9[_0x4a0430(0x1fb)]===_0x4a0430(0x1a8)&&console[_0x4a0430(0x223)](a4_0x456cf5['red'](_0x4a0430(0x19d)+_0x5db0e9[_0x4a0430(0x176)]+_0x4a0430(0x1a0)+_0x5db0e9[_0x4a0430(0x1a8)]));}return 0x1;}console[_0x4a0430(0x223)](a4_0x456cf5[_0x4a0430(0x1aa)](_0x4a0430(0x19f)+(_0x8bd6a8+_0x4fbee9)+_0x4a0430(0x1a9)+_0x5ceb26[_0x4a0430(0x1f5)]+'\x27'));const _0x111129=getLLMProjectUrl(_0x533cee,_0x5ceb26['projectId']);return console[_0x4a0430(0x223)](_0x4a0430(0x20d)+a4_0x456cf5['cyan'](_0x111129)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x426be0=a5_0x4d11;function a5_0x4d11(_0x2f59f2,_0x34ae5b){_0x2f59f2=_0x2f59f2-0x82;const _0x335093=a5_0x3350();let _0x4d1199=_0x335093[_0x2f59f2];return _0x4d1199;}(function(_0x2dddfb,_0x31de0a){const _0x1035d4=a5_0x4d11,_0x38d2f4=_0x2dddfb();while(!![]){try{const _0x2758bb=parseInt(_0x1035d4(0xf0))/0x1*(parseInt(_0x1035d4(0x93))/0x2)+parseInt(_0x1035d4(0xf7))/0x3*(parseInt(_0x1035d4(0xdc))/0x4)+parseInt(_0x1035d4(0xdd))/0x5*(parseInt(_0x1035d4(0xab))/0x6)+parseInt(_0x1035d4(0xd6))/0x7+parseInt(_0x1035d4(0xc3))/0x8*(-parseInt(_0x1035d4(0xb2))/0x9)+parseInt(_0x1035d4(0xc7))/0xa+-parseInt(_0x1035d4(0xe5))/0xb;if(_0x2758bb===_0x31de0a)break;else _0x38d2f4['push'](_0x38d2f4['shift']());}catch(_0x4ec4db){_0x38d2f4['push'](_0x38d2f4['shift']());}}}(a5_0x3350,0x40a39));import*as a5_0x1fc096 from'node:fs';import*as a5_0x546db6 from'node:path';import a5_0x9bed33 from'chalk';function a5_0x3350(){const _0x563422=['FAIL','white','No\x20tests\x20found\x20with\x20tags:\x20','PASS','no_tests','510344jWLAKb','red','Errors:\x20\x20\x20','resolve','4111540JaRmqm','round','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','toLowerCase','conversations','Tests\x20found:\x20','test.yml','has','...','Error\x20writing\x20output\x20file:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20Configuration:','\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','3445911sCvdEb','\x20\x20Site:\x20','existsSync','not\x20found','tests','tags','970804sjXgta','205235WVLFHx','executeReeval','/<agent-name>','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x20','✓\x20PASS:\x20','projectName','conversation_url','15410065AbhKhV','\x20\x20-\x20','Output\x20written\x20to:\x20','basename','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','size','\x20(cached)','Running\x20agent\x20tests...','green','status','194xRqBms','ERROR','writeFileSync','Available\x20tests:\x20','multiple_agents','dryRun','map','3AlUMyX','toISOString','reason','found','Round\x201/','find','...\x20','join','Evaluating\x20response...','Failed\x20Tests:','push','\x20(new)','start','Test\x20Summary','agentName','Cached\x20run\x20from:\x20',':\x20Sending\x20user\x20input...','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','⚠\x20SKIPPED:\x20','tsv','projectDir','✗\x20ERROR:\x20Project\x20not\x20found:\x20','text','Re-evaluation\x20Summary','trim','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','includes','Project\x20path:\x20','No\x20tests\x20have\x20tags\x20defined.','Run\x20tests\x20for\x20an\x20LLM\x20agent','yellow','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','site','Agent:\x20','Usage:','\x20\x20Round\x20','source','\x20\x20Conversation:\x20','repeat','rounds','Duration:\x20','reeval','\x20\x20Project:\x20','context','table','agentDirs','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','execute','json','✗\x20FAIL:\x20','agent','\x20\x20Evaluating...\x20','verbose','testName','Running\x20test:\x20','3898eMDsTX','Failed:\x20\x20\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','filter','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','jsonl','No\x20tests\x20found\x20matching:\x20','llmProject','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','llm','Error:\x20No\x20previous\x20test\x20run\x20found.','stop','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Re-evaluating\x20','substring','Either\x20switch\x20to\x20the\x20\x22','eval','Run\x20\x27tdx\x20agent\x20pull\x20','Total:\x20\x20\x20\x20','Using\x20agent:\x20','log','Re-evaluating\x20cached\x20test\x20run...','dim','\x22:\x20','30jUxYBD','add','resolveAgentId','✗\x20ERROR:\x20','Passed:\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','cyan','9fWOrvE','utf-8','name','message','length','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Test\x20','now','resolveProjectId','split','description','forEach'];a5_0x3350=function(){return _0x563422;};return a5_0x3350();}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x426be0(0xb4)]='agent:test';[a5_0x426be0(0xbc)]=a5_0x426be0(0x114);async[a5_0x426be0(0x8b)](_0x2fe4cb){const _0x3557b9=a5_0x426be0,{options:_0x3ba134,args:_0x40712c,tdx:_0x2564bb}=_0x2fe4cb,_0x202bb3=_0x40712c[0x0]||'.',_0x4faa9c=_0x3ba134[_0x3557b9(0xf5)],_0x2a54e=_0x3ba134,_0x4700b6=_0x2a54e[_0x3557b9(0xa3)]===![],_0x301a2f=_0x2a54e[_0x3557b9(0x85)],_0x517062=_0x2a54e[_0x3557b9(0xb4)],_0x512515=_0x2a54e[_0x3557b9(0xdb)],_0x2f1f18=_0x3ba134['site'],_0x181cd8=_0x2a54e['output'];if(_0x301a2f&&_0x4700b6)return console['log'](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xb7))),0x1;let _0xbcbffe=_0x3557b9(0x88);if(_0x2a54e[_0x3557b9(0x8c)])_0xbcbffe='json';else{if(_0x2a54e[_0x3557b9(0x98)])_0xbcbffe=_0x3557b9(0x98);else{if(_0x2a54e[_0x3557b9(0x10a)])_0xbcbffe=_0x3557b9(0x10a);else{if(_0x2a54e['table'])_0xbcbffe=_0x3557b9(0x88);}}}const _0x334ec8=_0x2a54e['llmProject'];let _0xb8f5cd=_0x202bb3;const _0x4a9ccc=a5_0x1fc096[_0x3557b9(0xd8)](_0x202bb3),_0x5b9c53=_0x202bb3==='.';if(!_0x4a9ccc||_0x5b9c53){const _0x26db46=resolveProjectFromContext(_0x202bb3,_0x334ec8,{'requireFile':_0x3557b9(0xcd)});if(_0x26db46[_0x3557b9(0xfa)])_0xb8f5cd=_0x26db46[_0x3557b9(0x10b)],_0x26db46[_0x3557b9(0x11b)]===_0x3557b9(0x87)&&console[_0x3557b9(0xa7)](a5_0x9bed33['dim'](_0x3557b9(0xa6)+_0xb8f5cd));else switch(_0x26db46[_0x3557b9(0xf9)]){case'no_context':console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0x115)](_0x26db46['message'])),console[_0x3557b9(0xa7)](),console['log'](_0x3557b9(0x119)),console['log'](_0x3557b9(0xd5)),console[_0x3557b9(0xa7)]('\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[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0x115)](_0x26db46[_0x3557b9(0xb5)])),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0xa4)+_0x26db46[_0x3557b9(0x9a)]+_0x3557b9(0x95));return 0x1;case _0x3557b9(0xf4):{const _0x57531b=a5_0x546db6[_0x3557b9(0xe8)](_0x26db46[_0x3557b9(0x10b)]);console[_0x3557b9(0xa7)](a5_0x9bed33['yellow'](_0x3557b9(0x97)+_0x26db46[_0x3557b9(0x9a)]+'\x22:'));for(const _0x782a99 of _0x26db46[_0x3557b9(0x89)]){console['log'](_0x3557b9(0xe6)+_0x782a99);}return console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0x8a)+_0x57531b+_0x3557b9(0xdf)),0x1;}case _0x3557b9(0xc2):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0x115)](_0x3557b9(0x116)+_0x26db46['llmProject']+'\x22.')),console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xa9)](_0x3557b9(0x112)+_0x26db46[_0x3557b9(0x10b)])),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0xe9));return 0x1;}}const {definition:_0x3b56f4,agentInfo:_0x24c3ee}=parseTestFile(_0xb8f5cd);let _0x5e5626=_0x3b56f4[_0x3557b9(0xda)];if(_0x517062){const _0x346c01=_0x517062['split'](',')[_0x3557b9(0xf6)](_0x1c805e=>_0x1c805e[_0x3557b9(0x10f)]());_0x5e5626=_0x3b56f4['tests'][_0x3557b9(0x96)](_0x513d21=>_0x346c01[_0x3557b9(0x111)](_0x513d21[_0x3557b9(0xb4)]));if(_0x5e5626['length']===0x0)return console[_0x3557b9(0xa7)](a5_0x9bed33['yellow'](_0x3557b9(0x99)+_0x517062)),console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xa9)](_0x3557b9(0xf3)+_0x3b56f4[_0x3557b9(0xda)][_0x3557b9(0xf6)](_0x3737d8=>_0x3737d8['name'])[_0x3557b9(0xfe)](',\x20'))),0x1;}if(_0x512515){const _0x2a4a46=_0x512515[_0x3557b9(0xbb)](',')[_0x3557b9(0xf6)](_0x1b9363=>_0x1b9363['trim']()[_0x3557b9(0xca)]());_0x5e5626=_0x5e5626[_0x3557b9(0x96)](_0x23840a=>_0x23840a[_0x3557b9(0xdb)]?.['some'](_0x159f57=>_0x2a4a46[_0x3557b9(0x111)](_0x159f57[_0x3557b9(0xca)]())));if(_0x5e5626[_0x3557b9(0xb6)]===0x0){console[_0x3557b9(0xa7)](a5_0x9bed33['yellow'](_0x3557b9(0xc0)+_0x512515));const _0x57cc1b=new Set();return _0x3b56f4[_0x3557b9(0xda)][_0x3557b9(0xbd)](_0x42df19=>_0x42df19['tags']?.[_0x3557b9(0xbd)](_0x538763=>_0x57cc1b[_0x3557b9(0xac)](_0x538763))),_0x57cc1b[_0x3557b9(0xeb)]>0x0?console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xa9)]('Available\x20tags:\x20'+[..._0x57cc1b][_0x3557b9(0xfe)](',\x20'))):console['log'](a5_0x9bed33[_0x3557b9(0xa9)](_0x3557b9(0x113))),0x1;}}if(_0x301a2f)return this[_0x3557b9(0xde)](_0x2fe4cb,{'definition':{'tests':_0x5e5626},'agentInfo':_0x24c3ee,'outputFormat':_0xbcbffe,'outputFile':_0x181cd8,'testNames':_0x517062});if(_0x4faa9c){console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xb1)](_0x3557b9(0xd4))),console['log'](_0x3557b9(0xd7)+a5_0x9bed33[_0x3557b9(0xbf)](_0x2f1f18)),console[_0x3557b9(0xa7)](_0x3557b9(0x86)+a5_0x9bed33[_0x3557b9(0xbf)](_0x24c3ee['projectName'])),console[_0x3557b9(0xa7)]('\x20\x20Agent:\x20'+a5_0x9bed33[_0x3557b9(0xbf)](_0x24c3ee[_0x3557b9(0x105)])),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0xcc)+a5_0x9bed33['white'](_0x5e5626[_0x3557b9(0xb6)]));for(let _0x307d2d=0x0;_0x307d2d<_0x5e5626['length'];_0x307d2d++){const _0x108c67=_0x5e5626[_0x307d2d],_0x291a01=_0x108c67[_0x3557b9(0x83)][_0x3557b9(0xb6)]===0x1?_0x3557b9(0xc8):_0x3557b9(0x83),_0xdae57a=_0x108c67[_0x3557b9(0xdb)]?.['length']?'\x20['+_0x108c67[_0x3557b9(0xdb)][_0x3557b9(0xfe)](',\x20')+']':'';console[_0x3557b9(0xa7)]('\x20\x20'+(_0x307d2d+0x1)+'.\x20'+a5_0x9bed33[_0x3557b9(0xbf)](_0x108c67['name'])+'\x20('+_0x108c67['rounds']['length']+'\x20'+_0x291a01+')'+a5_0x9bed33['dim'](_0xdae57a));}return 0x0;}let _0x402a6,_0x366b50;try{_0x402a6=await _0x2564bb['llm'][_0x3557b9(0xba)](_0x24c3ee['projectName']);}catch(_0xc71ef7){const _0xababa6=_0xc71ef7 instanceof Error?_0xc71ef7[_0x3557b9(0xb5)]:String(_0xc71ef7);return _0xababa6['includes']('404')||_0xababa6['toLowerCase']()[_0x3557b9(0x111)]('not\x20found')?console['log'](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0x10c)+_0x24c3ee[_0x3557b9(0xe3)])):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xea)+_0x24c3ee[_0x3557b9(0xe3)]+'\x22:\x20'+_0xababa6)),0x1;}try{_0x366b50=await _0x2564bb[_0x3557b9(0x9c)][_0x3557b9(0xad)](_0x24c3ee[_0x3557b9(0x105)],_0x402a6);}catch(_0x53f35f){const _0x26c4b5=_0x53f35f instanceof Error?_0x53f35f['message']:String(_0x53f35f);return _0x26c4b5[_0x3557b9(0x111)]('404')||_0x26c4b5[_0x3557b9(0xca)]()['includes'](_0x3557b9(0xd9))?console[_0x3557b9(0xa7)](a5_0x9bed33['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x24c3ee['agentName'])):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0x9f)+_0x24c3ee['agentName']+_0x3557b9(0xaa)+_0x26c4b5)),0x1;}let _0x2f979a;if(!_0x4700b6)try{_0x2f979a=await setupEvaluatorAgent(_0x2564bb[_0x3557b9(0x9c)],_0x3ba134['verbose']);}catch(_0x207b58){const _0x5af426=_0x207b58 instanceof Error?_0x207b58[_0x3557b9(0xb5)]:String(_0x207b58);return console[_0x3557b9(0xa7)](a5_0x9bed33['red'](_0x3557b9(0xc9)+_0x5af426)),0x1;}console[_0x3557b9(0xa7)](a5_0x9bed33['cyan'](_0x3557b9(0xed))),console[_0x3557b9(0xa7)]('Site:\x20'+a5_0x9bed33['white'](_0x2f1f18)),console[_0x3557b9(0xa7)](_0x3557b9(0x118)+a5_0x9bed33[_0x3557b9(0xbf)](_0x24c3ee[_0x3557b9(0xe3)]+'/'+_0x24c3ee[_0x3557b9(0x105)])),console[_0x3557b9(0xa7)]();const _0x5f01c3=[],_0x32c74e=[],_0x1ffe2a=Date[_0x3557b9(0xb9)]();for(let _0x2b80d5=0x0;_0x2b80d5<_0x5e5626[_0x3557b9(0xb6)];_0x2b80d5++){const _0x19e967=_0x5e5626[_0x2b80d5];_0x5e5626[_0x3557b9(0xb6)]>0x1?console['log'](_0x3557b9(0xb8)+(_0x2b80d5+0x1)+'/'+_0x5e5626['length']+':\x20'+a5_0x9bed33['white'](_0x19e967[_0x3557b9(0xb4)])):console['log'](_0x3557b9(0x92)+a5_0x9bed33[_0x3557b9(0xbf)](_0x19e967['name']));const _0x5950b3=createCommandSpinner(_0x3557b9(0xfb)+_0x19e967['rounds'][_0x3557b9(0xb6)]+':\x20Sending\x20user\x20input...');_0x5950b3[_0x3557b9(0x103)]();try{const {result:_0x1dc88a,conversation:_0x2a89c3}=await runTest(_0x2564bb['llm'],_0x19e967,{'agentId':_0x366b50,'projectId':_0x402a6,'site':_0x2f1f18,'noEval':_0x4700b6,'evaluatorId':_0x2f979a,'onRoundStart':(_0xac0814,_0x2a7137)=>{const _0x302d44=_0x3557b9;_0x5950b3[_0x302d44(0x10d)]=_0x302d44(0xe1)+(_0xac0814+0x1)+'/'+_0x2a7137+_0x302d44(0x107);},'onRoundComplete':(_0x9ebb87,_0x40f850,_0x52f20e)=>{const _0x16bea2=_0x3557b9,_0x2bf496=formatElapsed(_0x40f850);_0x52f20e?console[_0x16bea2(0xa7)](_0x16bea2(0x11a)+(_0x9ebb87+0x1)+'/'+_0x19e967[_0x16bea2(0x83)][_0x16bea2(0xb6)]+_0x16bea2(0xfd)+a5_0x9bed33['green']('✓')+'\x20('+_0x2bf496+')'):console[_0x16bea2(0xa7)](_0x16bea2(0x11a)+(_0x9ebb87+0x1)+'/'+_0x19e967[_0x16bea2(0x83)][_0x16bea2(0xb6)]+_0x16bea2(0xfd)+a5_0x9bed33[_0x16bea2(0xc4)]('✗'));},'onEvaluationStart':()=>{const _0x1ca75e=_0x3557b9;_0x5950b3[_0x1ca75e(0x10d)]='Evaluating\x20response...';},'onEvaluationComplete':_0x779e4d=>{const _0x6f2840=_0x3557b9,_0x1d2bee=formatElapsed(_0x779e4d);console[_0x6f2840(0xa7)](_0x6f2840(0x8f)+a5_0x9bed33[_0x6f2840(0xee)]('✓')+'\x20('+_0x1d2bee+')');}});_0x5950b3['stop'](),_0x5f01c3[_0x3557b9(0x101)](_0x1dc88a),_0x32c74e['push'](_0x2a89c3);if(_0x1dc88a['status']==='PASS')console['log'](a5_0x9bed33[_0x3557b9(0xee)](_0x3557b9(0xe2)+_0x1dc88a['reason']));else _0x1dc88a['status']===_0x3557b9(0xbe)?console['log'](a5_0x9bed33['red']('✗\x20FAIL:\x20'+_0x1dc88a['reason'])):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xae)+_0x1dc88a['reason']));_0x1dc88a[_0x3557b9(0xe4)]&&console[_0x3557b9(0xa7)](a5_0x9bed33['dim']('Conversation\x20URL:\x20'+_0x1dc88a[_0x3557b9(0xe4)])),console[_0x3557b9(0xa7)]();}catch(_0x4ceb08){_0x5950b3['stop']();const _0x13c9e6=_0x4ceb08 instanceof Error?_0x4ceb08[_0x3557b9(0xb5)]:String(_0x4ceb08);console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xae)+_0x13c9e6)),console[_0x3557b9(0xa7)](),_0x5f01c3[_0x3557b9(0x101)]({'name':_0x19e967[_0x3557b9(0xb4)],'status':_0x3557b9(0xf1),'reason':_0x13c9e6,'timestamp':new Date()[_0x3557b9(0xf8)](),'duration_ms':0x0});}}const _0x4a5074=Date[_0x3557b9(0xb9)]()-_0x1ffe2a,_0x5e3fab=_0x5f01c3[_0x3557b9(0x96)](_0x4f8470=>_0x4f8470['status']==='PASS')[_0x3557b9(0xb6)],_0x1bcba0=_0x5f01c3[_0x3557b9(0x96)](_0x3d2369=>_0x3d2369[_0x3557b9(0xef)]==='FAIL')[_0x3557b9(0xb6)],_0xbde6f5=_0x5f01c3[_0x3557b9(0x96)](_0x5c65f1=>_0x5c65f1[_0x3557b9(0xef)]==='ERROR')[_0x3557b9(0xb6)];console[_0x3557b9(0xa7)]('━'[_0x3557b9(0x82)](0x3c)),console[_0x3557b9(0xa7)](_0x3557b9(0x104)),console[_0x3557b9(0xa7)]('━'['repeat'](0x3c)),console[_0x3557b9(0xa7)](_0x3557b9(0xa5)+_0x5f01c3[_0x3557b9(0xb6)]),console[_0x3557b9(0xa7)]('Passed:\x20\x20\x20'+a5_0x9bed33[_0x3557b9(0xee)](_0x5e3fab)),console['log'](_0x3557b9(0x94)+a5_0x9bed33[_0x3557b9(0xc4)](_0x1bcba0));_0xbde6f5>0x0&&console[_0x3557b9(0xa7)](_0x3557b9(0xc5)+a5_0x9bed33[_0x3557b9(0xc4)](_0xbde6f5));console[_0x3557b9(0xa7)](_0x3557b9(0x84)+formatElapsed(_0x4a5074)),console[_0x3557b9(0xa7)]('━'[_0x3557b9(0x82)](0x3c));const _0x44efb8=_0x5f01c3[_0x3557b9(0x96)](_0x2b5d4c=>_0x2b5d4c[_0x3557b9(0xef)]!==_0x3557b9(0xc1));if(_0x44efb8[_0x3557b9(0xb6)]>0x0){console['log'](),console[_0x3557b9(0xa7)](_0x3557b9(0x100));for(const _0x4acf10 of _0x44efb8){const _0xc527be=a5_0x9bed33['red']('✗'),_0xe7a85e=_0x4acf10[_0x3557b9(0xf9)][_0x3557b9(0xb6)]>0x32?_0x4acf10[_0x3557b9(0xf9)][_0x3557b9(0xa1)](0x0,0x32)+'...':_0x4acf10[_0x3557b9(0xf9)];console['log']('\x20\x20'+_0xc527be+'\x20'+_0x4acf10[_0x3557b9(0xb4)]+':\x20'+_0xe7a85e);}}const _0x41df2a={'summary':{'total':_0x5f01c3[_0x3557b9(0xb6)],'passed':_0x5e3fab,'failed':_0x1bcba0,'errors':_0xbde6f5>0x0?_0xbde6f5:undefined,'duration_ms':_0x4a5074},'tests':_0x5f01c3,'agent':{'project':_0x24c3ee['projectName'],'name':_0x24c3ee['agentName'],'site':_0x2f1f18},'timestamp':new Date(_0x1ffe2a)[_0x3557b9(0xf8)]()};try{const _0x49534b=buildCachedTestRun(_0x32c74e,{'site':_0x2f1f18,'projectId':_0x402a6,'projectName':_0x24c3ee[_0x3557b9(0xe3)],'agentId':_0x366b50,'agentName':_0x24c3ee['agentName'],'testYmlPath':a5_0x546db6[_0x3557b9(0xc6)](_0x24c3ee['testYmlPath'])});saveLastTestRun(_0x49534b);}catch{}if(_0xbcbffe!==_0x3557b9(0x88)||_0x181cd8){const _0x17486d=formatResults(_0x41df2a,_0xbcbffe);if(_0x181cd8)try{a5_0x1fc096[_0x3557b9(0xf2)](_0x181cd8,_0x17486d,'utf-8'),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](a5_0x9bed33['dim'](_0x3557b9(0xe7)+_0x181cd8));}catch(_0x47aaad){return console[_0x3557b9(0xa7)](),console['log'](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xd0)+_0x47aaad)),0x1;}else console['log'](),console['log'](_0x17486d);}return _0x44efb8[_0x3557b9(0xb6)]>0x0?0x1:0x0;}async[a5_0x426be0(0xde)](_0xf9dc6f,_0xdb5bb5){const _0x338fa9=a5_0x426be0,{options:_0x71fb99,tdx:_0x3a78cf}=_0xf9dc6f,{definition:_0x2930ef,agentInfo:_0x4ff427,outputFormat:_0x19bccb,outputFile:_0x1dc783}=_0xdb5bb5,_0x33a61b=_0x71fb99[_0x338fa9(0x117)],_0x200735=loadLastTestRun();if(!_0x200735)return console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0x9d))),console['log'](a5_0x9bed33[_0x338fa9(0xa9)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x200735['agent'][_0x338fa9(0x105)]!==_0x4ff427[_0x338fa9(0x105)])return console[_0x338fa9(0xa7)](a5_0x9bed33['red'](_0x338fa9(0x108)+_0x200735[_0x338fa9(0x8e)][_0x338fa9(0x105)]+_0x338fa9(0x110)+_0x4ff427[_0x338fa9(0x105)]+'\x22.')),console[_0x338fa9(0xa7)](a5_0x9bed33['dim'](_0x338fa9(0xb0))),0x1;const _0x364fb6=new Set(_0x200735[_0x338fa9(0xcb)][_0x338fa9(0xf6)](_0xce546b=>_0xce546b[_0x338fa9(0x91)])),_0x2e09d3=_0x2930ef[_0x338fa9(0xda)][_0x338fa9(0x96)](_0xbab928=>!_0x364fb6[_0x338fa9(0xce)](_0xbab928[_0x338fa9(0xb4)]));if(_0x2e09d3[_0x338fa9(0xb6)]>0x0&&_0x200735[_0x338fa9(0x117)]!==_0x33a61b)return console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0xe0)+_0x200735[_0x338fa9(0x117)]+_0x338fa9(0xd1)+_0x33a61b+'\x22.')),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0xa2)+_0x200735[_0x338fa9(0x117)]+_0x338fa9(0xd3))),0x1;const _0x5a6d17=_0x2930ef[_0x338fa9(0xda)]['filter'](_0x48eaf3=>_0x364fb6['has'](_0x48eaf3[_0x338fa9(0xb4)])),_0x11de3b=_0x2e09d3;let _0x972592;try{_0x972592=await setupEvaluatorAgent(_0x3a78cf[_0x338fa9(0x9c)],_0x71fb99[_0x338fa9(0x90)]);}catch(_0x6d028c){const _0x56251c=_0x6d028c instanceof Error?_0x6d028c[_0x338fa9(0xb5)]:String(_0x6d028c);return console['log'](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0xc9)+_0x56251c)),0x1;}console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xb1)](_0x338fa9(0xa8))),console[_0x338fa9(0xa7)](_0x338fa9(0x106)+a5_0x9bed33[_0x338fa9(0xbf)](_0x200735['timestamp'])),console[_0x338fa9(0xa7)](_0x338fa9(0x118)+a5_0x9bed33[_0x338fa9(0xbf)](_0x200735[_0x338fa9(0x8e)][_0x338fa9(0xe3)]+'/'+_0x200735[_0x338fa9(0x8e)][_0x338fa9(0x105)]));_0x11de3b['length']>0x0&&console[_0x338fa9(0xa7)]('New\x20tests\x20to\x20execute:\x20'+a5_0x9bed33[_0x338fa9(0x115)](_0x11de3b[_0x338fa9(0xb6)]));console['log']();const _0x82773e=[],_0x6d8ff9=Date[_0x338fa9(0xb9)](),_0x166612=createCommandSpinner('Re-evaluating...');if(_0x5a6d17[_0x338fa9(0xb6)]>0x0)try{const _0x405711=await reevaluateFromCache(_0x3a78cf[_0x338fa9(0x9c)],_0x200735,{'tests':_0x5a6d17},{'evaluatorId':_0x972592,'onTestStart':(_0x1e0a0b,_0x52f6dc,_0x123d58)=>{const _0x120fcf=_0x338fa9;_0x166612[_0x120fcf(0x10d)]=_0x120fcf(0xa0)+(_0x52f6dc+0x1)+'/'+_0x123d58+':\x20'+_0x1e0a0b+_0x120fcf(0xcf);if(!_0x166612['isSpinning'])_0x166612['start']();},'onTestComplete':(_0xd0ad18,_0x336ea4)=>{const _0x1bb4a6=_0x338fa9;_0x166612[_0x1bb4a6(0x9e)]();if(_0x336ea4[_0x1bb4a6(0xef)]===_0x1bb4a6(0xc1))console[_0x1bb4a6(0xa7)](a5_0x9bed33[_0x1bb4a6(0xee)]('✓\x20PASS:\x20'+_0xd0ad18)+a5_0x9bed33[_0x1bb4a6(0xa9)](_0x1bb4a6(0xec)));else _0x336ea4[_0x1bb4a6(0xef)]===_0x1bb4a6(0xbe)?console[_0x1bb4a6(0xa7)](a5_0x9bed33[_0x1bb4a6(0xc4)](_0x1bb4a6(0x8d)+_0xd0ad18+_0x1bb4a6(0xd2)+_0x336ea4['reason'])+a5_0x9bed33[_0x1bb4a6(0xa9)]('\x20(cached)')):console['log'](a5_0x9bed33['red']('✗\x20ERROR:\x20'+_0xd0ad18+_0x1bb4a6(0xd2)+_0x336ea4[_0x1bb4a6(0xf9)]));_0x336ea4['conversation_url']&&console[_0x1bb4a6(0xa7)](a5_0x9bed33[_0x1bb4a6(0xa9)](_0x1bb4a6(0x11c)+_0x336ea4[_0x1bb4a6(0xe4)])),_0x82773e[_0x1bb4a6(0x101)](_0x336ea4);},'onTestSkipped':(_0x3016bd,_0x116246)=>{const _0xf0f485=_0x338fa9;_0x166612[_0xf0f485(0x9e)](),console[_0xf0f485(0xa7)](a5_0x9bed33[_0xf0f485(0x115)](_0xf0f485(0x109)+_0x3016bd+_0xf0f485(0xd2)+_0x116246));}});for(const _0x55bf36 of _0x405711){!_0x82773e[_0x338fa9(0xfc)](_0x404bac=>_0x404bac[_0x338fa9(0xb4)]===_0x55bf36[_0x338fa9(0xb4)])&&_0x82773e[_0x338fa9(0x101)](_0x55bf36);}}catch(_0x57fabb){_0x166612[_0x338fa9(0x9e)]();const _0x1b1c6f=_0x57fabb instanceof Error?_0x57fabb[_0x338fa9(0xb5)]:String(_0x57fabb);return console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0x9b)+_0x1b1c6f)),0x1;}_0x166612[_0x338fa9(0x9e)]();if(_0x11de3b['length']>0x0){console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xb1)]('Executing\x20new\x20tests...'));const {projectId:_0x41fc13,agentId:_0x3332ab}=_0x200735['agent'];for(const _0x414f8e of _0x11de3b){console[_0x338fa9(0xa7)]('Running:\x20'+a5_0x9bed33[_0x338fa9(0xbf)](_0x414f8e[_0x338fa9(0xb4)]));const _0x1ae1d6=createCommandSpinner(_0x338fa9(0xfb)+_0x414f8e[_0x338fa9(0x83)][_0x338fa9(0xb6)]+_0x338fa9(0x107));_0x1ae1d6[_0x338fa9(0x103)]();try{const {result:_0x590e28}=await runTest(_0x3a78cf['llm'],_0x414f8e,{'agentId':_0x3332ab,'projectId':_0x41fc13,'site':_0x200735['site'],'noEval':![],'evaluatorId':_0x972592,'onRoundStart':(_0x1d50b8,_0x1343fc)=>{const _0x313c97=_0x338fa9;_0x1ae1d6[_0x313c97(0x10d)]=_0x313c97(0xe1)+(_0x1d50b8+0x1)+'/'+_0x1343fc+_0x313c97(0x107);},'onRoundComplete':(_0x1e8e3a,_0x51dff6,_0x2cfc87)=>{const _0x2feac5=_0x338fa9,_0x5d4896=formatElapsed(_0x51dff6);_0x2cfc87?console['log']('\x20\x20Round\x20'+(_0x1e8e3a+0x1)+'/'+_0x414f8e[_0x2feac5(0x83)]['length']+_0x2feac5(0xfd)+a5_0x9bed33[_0x2feac5(0xee)]('✓')+'\x20('+_0x5d4896+')'):console[_0x2feac5(0xa7)](_0x2feac5(0x11a)+(_0x1e8e3a+0x1)+'/'+_0x414f8e[_0x2feac5(0x83)]['length']+_0x2feac5(0xfd)+a5_0x9bed33['red']('✗'));},'onEvaluationStart':()=>{const _0x169c07=_0x338fa9;_0x1ae1d6[_0x169c07(0x10d)]=_0x169c07(0xff);},'onEvaluationComplete':_0x2b325a=>{const _0x293a00=_0x338fa9,_0x5eeb49=formatElapsed(_0x2b325a);console[_0x293a00(0xa7)]('\x20\x20Evaluating...\x20'+a5_0x9bed33[_0x293a00(0xee)]('✓')+'\x20('+_0x5eeb49+')');}});_0x1ae1d6[_0x338fa9(0x9e)](),_0x82773e[_0x338fa9(0x101)](_0x590e28);if(_0x590e28[_0x338fa9(0xef)]===_0x338fa9(0xc1))console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xee)](_0x338fa9(0xe2)+_0x590e28['reason'])+a5_0x9bed33['dim']('\x20(new)'));else _0x590e28[_0x338fa9(0xef)]===_0x338fa9(0xbe)?console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)]('✗\x20FAIL:\x20'+_0x590e28[_0x338fa9(0xf9)])+a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0x102))):console[_0x338fa9(0xa7)](a5_0x9bed33['red'](_0x338fa9(0xae)+_0x590e28[_0x338fa9(0xf9)]));_0x590e28['conversation_url']&&console['log'](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0x11c)+_0x590e28[_0x338fa9(0xe4)]));}catch(_0x423932){_0x1ae1d6[_0x338fa9(0x9e)]();const _0x5a16b3=_0x423932 instanceof Error?_0x423932[_0x338fa9(0xb5)]:String(_0x423932);console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0xae)+_0x5a16b3)),_0x82773e[_0x338fa9(0x101)]({'name':_0x414f8e['name'],'status':_0x338fa9(0xf1),'reason':_0x5a16b3,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x338fa9(0xa7)]();const _0x34c004=Date[_0x338fa9(0xb9)]()-_0x6d8ff9,_0x122469=_0x82773e[_0x338fa9(0x96)](_0x558a31=>_0x558a31[_0x338fa9(0xef)]==='PASS')[_0x338fa9(0xb6)],_0x302d60=_0x82773e[_0x338fa9(0x96)](_0x3430ad=>_0x3430ad[_0x338fa9(0xef)]===_0x338fa9(0xbe))[_0x338fa9(0xb6)],_0x292c3e=_0x82773e[_0x338fa9(0x96)](_0x35ae57=>_0x35ae57['status']===_0x338fa9(0xf1))[_0x338fa9(0xb6)];console[_0x338fa9(0xa7)]('━'[_0x338fa9(0x82)](0x3c)),console['log'](_0x338fa9(0x10e)),console[_0x338fa9(0xa7)]('━'[_0x338fa9(0x82)](0x3c)),console[_0x338fa9(0xa7)]('Total:\x20\x20\x20\x20'+_0x82773e[_0x338fa9(0xb6)]),console[_0x338fa9(0xa7)](_0x338fa9(0xaf)+a5_0x9bed33[_0x338fa9(0xee)](_0x122469)),console['log'](_0x338fa9(0x94)+a5_0x9bed33['red'](_0x302d60));_0x292c3e>0x0&&console['log'](_0x338fa9(0xc5)+a5_0x9bed33[_0x338fa9(0xc4)](_0x292c3e));console[_0x338fa9(0xa7)](_0x338fa9(0x84)+formatElapsed(_0x34c004)),console[_0x338fa9(0xa7)]('━'[_0x338fa9(0x82)](0x3c));const _0x20d45e={'summary':{'total':_0x82773e[_0x338fa9(0xb6)],'passed':_0x122469,'failed':_0x302d60,'errors':_0x292c3e>0x0?_0x292c3e:undefined,'duration_ms':_0x34c004},'tests':_0x82773e,'agent':{'project':_0x4ff427[_0x338fa9(0xe3)],'name':_0x4ff427[_0x338fa9(0x105)],'site':_0x33a61b},'timestamp':new Date(_0x6d8ff9)[_0x338fa9(0xf8)]()};if(_0x19bccb!=='table'||_0x1dc783){const _0x51f155=formatResults(_0x20d45e,_0x19bccb);if(_0x1dc783)try{a5_0x1fc096[_0x338fa9(0xf2)](_0x1dc783,_0x51f155,_0x338fa9(0xb3)),console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0xe7)+_0x1dc783));}catch(_0x461c01){return console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0xd0)+_0x461c01)),0x1;}else console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](_0x51f155);}const _0x1da72e=_0x82773e['filter'](_0x919c2=>_0x919c2[_0x338fa9(0xef)]!==_0x338fa9(0xc1));return _0x1da72e[_0x338fa9(0xb6)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2f4431=a5_0x3ea0;function a5_0x3ea0(_0x413718,_0x9c2152){_0x413718=_0x413718-0x142;const _0x45a2b1=a5_0x45a2();let _0x3ea0f0=_0x45a2b1[_0x413718];return _0x3ea0f0;}(function(_0x195cb2,_0x22cf48){const _0x1a7f93=a5_0x3ea0,_0x1fce63=_0x195cb2();while(!![]){try{const _0x3f73ae=-parseInt(_0x1a7f93(0x158))/0x1+parseInt(_0x1a7f93(0x171))/0x2+-parseInt(_0x1a7f93(0x18a))/0x3*(parseInt(_0x1a7f93(0x1a0))/0x4)+parseInt(_0x1a7f93(0x1a3))/0x5+-parseInt(_0x1a7f93(0x178))/0x6*(parseInt(_0x1a7f93(0x18f))/0x7)+parseInt(_0x1a7f93(0x1d1))/0x8+-parseInt(_0x1a7f93(0x17f))/0x9;if(_0x3f73ae===_0x22cf48)break;else _0x1fce63['push'](_0x1fce63['shift']());}catch(_0x47df24){_0x1fce63['push'](_0x1fce63['shift']());}}}(a5_0x45a2,0xed2c0));function a5_0x45a2(){const _0xa29820=['1719125jrgwTv','llmProject','dim','Project\x20path:\x20','timestamp','\x22:\x20','Evaluating\x20response...','source','no_tests','conversation_url','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','No\x20tests\x20have\x20tags\x20defined.','includes','Running:\x20','Agent:\x20','Errors:\x20\x20\x20',':\x20Sending\x20user\x20input...','testName','llm','...','projectName','Running\x20agent\x20tests...','Cached\x20run\x20from:\x20','status','tags','3859468KOFFYP','Executing\x20new\x20tests...','reeval','agent','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','test.yml','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','57984OMsKFW','rounds','Using\x20agent:\x20','now','Round\x201/','Re-evaluating\x20','agentDirs','13557753FJXYyK','Re-evaluation\x20Summary','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Running\x20test:\x20','log','cyan','jsonl','\x20(new)','push','\x20\x20Evaluating...\x20','not\x20found','6DhXnGj','existsSync','Test\x20Summary','red','Either\x20switch\x20to\x20the\x20\x22','280YgumSI','Re-evaluating\x20cached\x20test\x20run...','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','stop','projectDir','agentName','filter','find','Error:\x20No\x20previous\x20test\x20run\x20found.','Failed\x20Tests:','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','ERROR','add','✓\x20PASS:\x20','utf-8','Run\x20\x27tdx\x20agent\x20pull\x20','tsv','1265032nMxHkX','Round\x20','✗\x20ERROR:\x20','8473535USPmwy','writeFileSync','basename','Available\x20tests:\x20','\x20-\x20','\x20\x20Conversation:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','text','toLowerCase','no_local_folder','\x20\x20Round\x20','tests','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Re-evaluating...','testYmlPath','length','resolveProjectId','repeat','split','⚠\x20SKIPPED:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\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','FAIL','Run\x20tests\x20for\x20an\x20LLM\x20agent','No\x20tests\x20found\x20with\x20tags:\x20','agent:test','executeReeval','no_context','404','\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)','\x22,\x20but\x20current\x20site\x20is\x20\x22','dryRun','\x20\x20Agent:\x20','Usage:','Passed:\x20\x20\x20','\x20\x20Site:\x20','json','✗\x20FAIL:\x20','site','\x20(cached)','conversations','reason','context','eval','No\x20tests\x20found\x20matching:\x20','Total:\x20\x20\x20\x20','12733064xqkXhx','start','trim','message','Test\x20','verbose','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','map','\x20\x20-\x20','has','found','PASS','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','...\x20','multiple_agents','Output\x20written\x20to:\x20','Test\x20Configuration:','Duration:\x20','substring','output','yellow','description','some','isSpinning','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20Project:\x20','green','Site:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','white','Tests\x20found:\x20','toISOString','join','name','table'];a5_0x45a2=function(){return _0xa29820;};return a5_0x45a2();}import*as a5_0x3912be from'node:fs';import*as a5_0x18641e from'node:path';import a5_0x490e8c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x2f4431(0x1bc);[a5_0x2f4431(0x14a)]=a5_0x2f4431(0x1ba);async['execute'](_0x143bb8){const _0x230b61=a5_0x2f4431,{options:_0xa564e8,args:_0xbdeb58,tdx:_0x1420a9}=_0x143bb8,_0x15a18a=_0xbdeb58[0x0]||'.',_0x1efcc1=_0xa564e8[_0x230b61(0x1c2)],_0x1842d6=_0xa564e8,_0x1f0049=_0x1842d6[_0x230b61(0x1ce)]===![],_0x176409=_0x1842d6[_0x230b61(0x173)],_0xca1452=_0x1842d6[_0x230b61(0x156)],_0x573194=_0x1842d6[_0x230b61(0x170)],_0x5226da=_0xa564e8['site'],_0x232978=_0x1842d6[_0x230b61(0x148)];if(_0x176409&&_0x1f0049)return console[_0x230b61(0x183)](a5_0x490e8c['red'](_0x230b61(0x1dd))),0x1;let _0x3a48fc=_0x230b61(0x157);if(_0x1842d6['json'])_0x3a48fc=_0x230b61(0x1c7);else{if(_0x1842d6[_0x230b61(0x185)])_0x3a48fc='jsonl';else{if(_0x1842d6[_0x230b61(0x19f)])_0x3a48fc=_0x230b61(0x19f);else{if(_0x1842d6[_0x230b61(0x157)])_0x3a48fc=_0x230b61(0x157);}}}const _0x555805=_0x1842d6['llmProject'];let _0x21334a=_0x15a18a;const _0x5168e1=a5_0x3912be[_0x230b61(0x18b)](_0x15a18a),_0x2ce4a2=_0x15a18a==='.';if(!_0x5168e1||_0x2ce4a2){const _0x21a4cc=resolveProjectFromContext(_0x15a18a,_0x555805,{'requireFile':_0x230b61(0x176)});if(_0x21a4cc[_0x230b61(0x1db)])_0x21334a=_0x21a4cc['projectDir'],_0x21a4cc[_0x230b61(0x15f)]===_0x230b61(0x1cd)&&console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x17a)+_0x21334a));else switch(_0x21a4cc[_0x230b61(0x1cc)]){case _0x230b61(0x1be):console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x21a4cc[_0x230b61(0x1d4)])),console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x230b61(0x1c4)),console[_0x230b61(0x183)](_0x230b61(0x1b8)),console[_0x230b61(0x183)](_0x230b61(0x1c0)),console['log'](),console[_0x230b61(0x183)](_0x230b61(0x162));return 0x1;case _0x230b61(0x1ac):console['log'](a5_0x490e8c['yellow'](_0x21a4cc[_0x230b61(0x1d4)])),console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x230b61(0x19e)+_0x21a4cc[_0x230b61(0x159)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x230b61(0x143):{const _0x1791d1=a5_0x18641e[_0x230b61(0x1a5)](_0x21a4cc[_0x230b61(0x193)]);console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x1af)+_0x21a4cc[_0x230b61(0x159)]+'\x22:'));for(const _0x1a62e8 of _0x21a4cc[_0x230b61(0x17e)]){console[_0x230b61(0x183)](_0x230b61(0x1d9)+_0x1a62e8);}return console['log'](),console['log'](_0x230b61(0x1b7)+_0x1791d1+'/<agent-name>'),0x1;}case _0x230b61(0x160):console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x181)+_0x21a4cc['llmProject']+'\x22.')),console['log'](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x15b)+_0x21a4cc[_0x230b61(0x193)])),console[_0x230b61(0x183)](),console['log'](_0x230b61(0x177));return 0x1;}}const {definition:_0x2b250b,agentInfo:_0x1bee6a}=parseTestFile(_0x21334a);let _0x1dbe7c=_0x2b250b[_0x230b61(0x1ae)];if(_0xca1452){const _0x4ba862=_0xca1452[_0x230b61(0x1b5)](',')[_0x230b61(0x1d8)](_0x5ef65c=>_0x5ef65c[_0x230b61(0x1d3)]());_0x1dbe7c=_0x2b250b[_0x230b61(0x1ae)]['filter'](_0x2159b2=>_0x4ba862[_0x230b61(0x164)](_0x2159b2[_0x230b61(0x156)]));if(_0x1dbe7c[_0x230b61(0x1b2)]===0x0)return console['log'](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x1cf)+_0xca1452)),console['log'](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x1a6)+_0x2b250b[_0x230b61(0x1ae)][_0x230b61(0x1d8)](_0x550fb8=>_0x550fb8[_0x230b61(0x156)])[_0x230b61(0x155)](',\x20'))),0x1;}if(_0x573194){const _0x5828bd=_0x573194[_0x230b61(0x1b5)](',')[_0x230b61(0x1d8)](_0x3e4142=>_0x3e4142[_0x230b61(0x1d3)]()[_0x230b61(0x1ab)]());_0x1dbe7c=_0x1dbe7c[_0x230b61(0x195)](_0x11dce7=>_0x11dce7['tags']?.[_0x230b61(0x14b)](_0x390a83=>_0x5828bd[_0x230b61(0x164)](_0x390a83[_0x230b61(0x1ab)]())));if(_0x1dbe7c[_0x230b61(0x1b2)]===0x0){console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x149)](_0x230b61(0x1bb)+_0x573194));const _0xd4c7ef=new Set();return _0x2b250b[_0x230b61(0x1ae)]['forEach'](_0x38ef76=>_0x38ef76[_0x230b61(0x170)]?.['forEach'](_0x122fbc=>_0xd4c7ef[_0x230b61(0x19b)](_0x122fbc))),_0xd4c7ef['size']>0x0?console['log'](a5_0x490e8c['dim']('Available\x20tags:\x20'+[..._0xd4c7ef][_0x230b61(0x155)](',\x20'))):console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x15a)](_0x230b61(0x163))),0x1;}}if(_0x176409)return this[_0x230b61(0x1bd)](_0x143bb8,{'definition':{'tests':_0x1dbe7c},'agentInfo':_0x1bee6a,'outputFormat':_0x3a48fc,'outputFile':_0x232978,'testNames':_0xca1452});if(_0x1efcc1){console[_0x230b61(0x183)](a5_0x490e8c['cyan'](_0x230b61(0x145))),console[_0x230b61(0x183)](_0x230b61(0x1c6)+a5_0x490e8c[_0x230b61(0x152)](_0x5226da)),console[_0x230b61(0x183)](_0x230b61(0x14e)+a5_0x490e8c[_0x230b61(0x152)](_0x1bee6a[_0x230b61(0x16c)])),console[_0x230b61(0x183)](_0x230b61(0x1c3)+a5_0x490e8c[_0x230b61(0x152)](_0x1bee6a[_0x230b61(0x194)])),console['log'](),console[_0x230b61(0x183)](_0x230b61(0x153)+a5_0x490e8c[_0x230b61(0x152)](_0x1dbe7c[_0x230b61(0x1b2)]));for(let _0x19f649=0x0;_0x19f649<_0x1dbe7c[_0x230b61(0x1b2)];_0x19f649++){const _0x10524a=_0x1dbe7c[_0x19f649],_0x23c0cb=_0x10524a['rounds']['length']===0x1?'round':'rounds',_0x276bed=_0x10524a[_0x230b61(0x170)]?.['length']?'\x20['+_0x10524a['tags'][_0x230b61(0x155)](',\x20')+']':'';console[_0x230b61(0x183)]('\x20\x20'+(_0x19f649+0x1)+'.\x20'+a5_0x490e8c['white'](_0x10524a[_0x230b61(0x156)])+'\x20('+_0x10524a[_0x230b61(0x179)]['length']+'\x20'+_0x23c0cb+')'+a5_0x490e8c[_0x230b61(0x15a)](_0x276bed));}return 0x0;}let _0x40416e,_0x456a9f;try{_0x40416e=await _0x1420a9[_0x230b61(0x16a)][_0x230b61(0x1b3)](_0x1bee6a[_0x230b61(0x16c)]);}catch(_0x100c1c){const _0x51dfd2=_0x100c1c instanceof Error?_0x100c1c[_0x230b61(0x1d4)]:String(_0x100c1c);return _0x51dfd2[_0x230b61(0x164)](_0x230b61(0x1bf))||_0x51dfd2[_0x230b61(0x1ab)]()[_0x230b61(0x164)](_0x230b61(0x189))?console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1bee6a['projectName'])):console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)](_0x230b61(0x14d)+_0x1bee6a[_0x230b61(0x16c)]+_0x230b61(0x15d)+_0x51dfd2)),0x1;}try{_0x456a9f=await _0x1420a9[_0x230b61(0x16a)]['resolveAgentId'](_0x1bee6a[_0x230b61(0x194)],_0x40416e);}catch(_0x1ffe69){const _0x7f9424=_0x1ffe69 instanceof Error?_0x1ffe69[_0x230b61(0x1d4)]:String(_0x1ffe69);return _0x7f9424['includes'](_0x230b61(0x1bf))||_0x7f9424['toLowerCase']()[_0x230b61(0x164)](_0x230b61(0x189))?console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1bee6a[_0x230b61(0x194)])):console['log'](a5_0x490e8c[_0x230b61(0x18d)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x1bee6a[_0x230b61(0x194)]+_0x230b61(0x15d)+_0x7f9424)),0x1;}let _0x1ada9c;if(!_0x1f0049)try{_0x1ada9c=await setupEvaluatorAgent(_0x1420a9[_0x230b61(0x16a)],_0xa564e8[_0x230b61(0x1d6)]);}catch(_0x58b2b7){const _0x33dec1=_0x58b2b7 instanceof Error?_0x58b2b7[_0x230b61(0x1d4)]:String(_0x58b2b7);return console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)](_0x230b61(0x175)+_0x33dec1)),0x1;}console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x184)](_0x230b61(0x16d))),console[_0x230b61(0x183)](_0x230b61(0x150)+a5_0x490e8c[_0x230b61(0x152)](_0x5226da)),console['log'](_0x230b61(0x166)+a5_0x490e8c[_0x230b61(0x152)](_0x1bee6a[_0x230b61(0x16c)]+'/'+_0x1bee6a[_0x230b61(0x194)])),console[_0x230b61(0x183)]();const _0x3e64e6=[],_0x36f1fa=[],_0x3fb754=Date[_0x230b61(0x17b)]();for(let _0x43ceb5=0x0;_0x43ceb5<_0x1dbe7c[_0x230b61(0x1b2)];_0x43ceb5++){const _0x476000=_0x1dbe7c[_0x43ceb5];_0x1dbe7c['length']>0x1?console[_0x230b61(0x183)](_0x230b61(0x1d5)+(_0x43ceb5+0x1)+'/'+_0x1dbe7c['length']+':\x20'+a5_0x490e8c[_0x230b61(0x152)](_0x476000['name'])):console[_0x230b61(0x183)](_0x230b61(0x182)+a5_0x490e8c['white'](_0x476000[_0x230b61(0x156)]));const _0x614df8=createCommandSpinner('Round\x201/'+_0x476000[_0x230b61(0x179)][_0x230b61(0x1b2)]+_0x230b61(0x168));_0x614df8['start']();try{const {result:_0x190e83,conversation:_0xe37527}=await runTest(_0x1420a9['llm'],_0x476000,{'agentId':_0x456a9f,'projectId':_0x40416e,'site':_0x5226da,'noEval':_0x1f0049,'evaluatorId':_0x1ada9c,'onRoundStart':(_0x5158ab,_0x5e7bad)=>{const _0x34e778=_0x230b61;_0x614df8[_0x34e778(0x1aa)]=_0x34e778(0x1a1)+(_0x5158ab+0x1)+'/'+_0x5e7bad+_0x34e778(0x168);},'onRoundComplete':(_0x11a35c,_0x3204aa,_0x578a96)=>{const _0x33442b=_0x230b61,_0x34633e=formatElapsed(_0x3204aa);_0x578a96?console[_0x33442b(0x183)](_0x33442b(0x1ad)+(_0x11a35c+0x1)+'/'+_0x476000[_0x33442b(0x179)][_0x33442b(0x1b2)]+'...\x20'+a5_0x490e8c[_0x33442b(0x14f)]('✓')+'\x20('+_0x34633e+')'):console['log'](_0x33442b(0x1ad)+(_0x11a35c+0x1)+'/'+_0x476000[_0x33442b(0x179)]['length']+_0x33442b(0x142)+a5_0x490e8c[_0x33442b(0x18d)]('✗'));},'onEvaluationStart':()=>{const _0x321a14=_0x230b61;_0x614df8['text']=_0x321a14(0x15e);},'onEvaluationComplete':_0x4359c0=>{const _0x4e68aa=_0x230b61,_0x9d7f47=formatElapsed(_0x4359c0);console[_0x4e68aa(0x183)](_0x4e68aa(0x188)+a5_0x490e8c[_0x4e68aa(0x14f)]('✓')+'\x20('+_0x9d7f47+')');}});_0x614df8[_0x230b61(0x192)](),_0x3e64e6[_0x230b61(0x187)](_0x190e83),_0x36f1fa[_0x230b61(0x187)](_0xe37527);if(_0x190e83[_0x230b61(0x16f)]===_0x230b61(0x1dc))console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x14f)](_0x230b61(0x19c)+_0x190e83[_0x230b61(0x1cc)]));else _0x190e83[_0x230b61(0x16f)]===_0x230b61(0x1b9)?console[_0x230b61(0x183)](a5_0x490e8c['red'](_0x230b61(0x1c8)+_0x190e83[_0x230b61(0x1cc)])):console[_0x230b61(0x183)](a5_0x490e8c['red'](_0x230b61(0x1a2)+_0x190e83[_0x230b61(0x1cc)]));_0x190e83[_0x230b61(0x161)]&&console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x15a)]('Conversation\x20URL:\x20'+_0x190e83[_0x230b61(0x161)])),console['log']();}catch(_0x508eaf){_0x614df8[_0x230b61(0x192)]();const _0x5e4bd0=_0x508eaf instanceof Error?_0x508eaf[_0x230b61(0x1d4)]:String(_0x508eaf);console[_0x230b61(0x183)](a5_0x490e8c[_0x230b61(0x18d)](_0x230b61(0x1a2)+_0x5e4bd0)),console[_0x230b61(0x183)](),_0x3e64e6[_0x230b61(0x187)]({'name':_0x476000[_0x230b61(0x156)],'status':_0x230b61(0x19a),'reason':_0x5e4bd0,'timestamp':new Date()[_0x230b61(0x154)](),'duration_ms':0x0});}}const _0x2697b1=Date['now']()-_0x3fb754,_0x21028c=_0x3e64e6[_0x230b61(0x195)](_0x213a0e=>_0x213a0e['status']===_0x230b61(0x1dc))[_0x230b61(0x1b2)],_0x2c3294=_0x3e64e6['filter'](_0x5156ae=>_0x5156ae[_0x230b61(0x16f)]===_0x230b61(0x1b9))[_0x230b61(0x1b2)],_0x207920=_0x3e64e6[_0x230b61(0x195)](_0x58bd9b=>_0x58bd9b[_0x230b61(0x16f)]===_0x230b61(0x19a))[_0x230b61(0x1b2)];console[_0x230b61(0x183)]('━'[_0x230b61(0x1b4)](0x3c)),console[_0x230b61(0x183)](_0x230b61(0x18c)),console[_0x230b61(0x183)]('━'['repeat'](0x3c)),console[_0x230b61(0x183)](_0x230b61(0x1d0)+_0x3e64e6['length']),console['log'](_0x230b61(0x1c5)+a5_0x490e8c['green'](_0x21028c)),console[_0x230b61(0x183)]('Failed:\x20\x20\x20'+a5_0x490e8c[_0x230b61(0x18d)](_0x2c3294));_0x207920>0x0&&console[_0x230b61(0x183)](_0x230b61(0x167)+a5_0x490e8c[_0x230b61(0x18d)](_0x207920));console[_0x230b61(0x183)](_0x230b61(0x146)+formatElapsed(_0x2697b1)),console[_0x230b61(0x183)]('━'[_0x230b61(0x1b4)](0x3c));const _0x20a58f=_0x3e64e6[_0x230b61(0x195)](_0x36272e=>_0x36272e[_0x230b61(0x16f)]!==_0x230b61(0x1dc));if(_0x20a58f['length']>0x0){console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x230b61(0x198));for(const _0x3b2ba3 of _0x20a58f){const _0x51d8f1=a5_0x490e8c['red']('✗'),_0x19f8e2=_0x3b2ba3[_0x230b61(0x1cc)][_0x230b61(0x1b2)]>0x32?_0x3b2ba3['reason'][_0x230b61(0x147)](0x0,0x32)+'...':_0x3b2ba3[_0x230b61(0x1cc)];console[_0x230b61(0x183)]('\x20\x20'+_0x51d8f1+'\x20'+_0x3b2ba3[_0x230b61(0x156)]+':\x20'+_0x19f8e2);}}const _0x14cf58={'summary':{'total':_0x3e64e6[_0x230b61(0x1b2)],'passed':_0x21028c,'failed':_0x2c3294,'errors':_0x207920>0x0?_0x207920:undefined,'duration_ms':_0x2697b1},'tests':_0x3e64e6,'agent':{'project':_0x1bee6a[_0x230b61(0x16c)],'name':_0x1bee6a[_0x230b61(0x194)],'site':_0x5226da},'timestamp':new Date(_0x3fb754)[_0x230b61(0x154)]()};try{const _0x221287=buildCachedTestRun(_0x36f1fa,{'site':_0x5226da,'projectId':_0x40416e,'projectName':_0x1bee6a[_0x230b61(0x16c)],'agentId':_0x456a9f,'agentName':_0x1bee6a['agentName'],'testYmlPath':a5_0x18641e['resolve'](_0x1bee6a[_0x230b61(0x1b1)])});saveLastTestRun(_0x221287);}catch{}if(_0x3a48fc!==_0x230b61(0x157)||_0x232978){const _0x18dd43=formatResults(_0x14cf58,_0x3a48fc);if(_0x232978)try{a5_0x3912be['writeFileSync'](_0x232978,_0x18dd43,_0x230b61(0x19d)),console['log'](),console[_0x230b61(0x183)](a5_0x490e8c['dim'](_0x230b61(0x144)+_0x232978));}catch(_0x44c806){return console[_0x230b61(0x183)](),console['log'](a5_0x490e8c[_0x230b61(0x18d)]('Error\x20writing\x20output\x20file:\x20'+_0x44c806)),0x1;}else console[_0x230b61(0x183)](),console[_0x230b61(0x183)](_0x18dd43);}return _0x20a58f[_0x230b61(0x1b2)]>0x0?0x1:0x0;}async[a5_0x2f4431(0x1bd)](_0x49f8af,_0x533967){const _0x183c07=a5_0x2f4431,{options:_0x56380e,tdx:_0x2b3478}=_0x49f8af,{definition:_0x3adfd4,agentInfo:_0x1d4d90,outputFormat:_0x1c595a,outputFile:_0x40e842}=_0x533967,_0x17a7c0=_0x56380e['site'],_0x425322=loadLastTestRun();if(!_0x425322)return console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x197))),console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x199))),0x1;if(_0x425322[_0x183c07(0x174)][_0x183c07(0x194)]!==_0x1d4d90['agentName'])return console['log'](a5_0x490e8c[_0x183c07(0x18d)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x425322[_0x183c07(0x174)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x1d4d90[_0x183c07(0x194)]+'\x22.')),console['log'](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x1d7))),0x1;const _0x145dfb=new Set(_0x425322[_0x183c07(0x1cb)]['map'](_0x161bbb=>_0x161bbb[_0x183c07(0x169)])),_0x33f972=_0x3adfd4['tests'][_0x183c07(0x195)](_0xedd029=>!_0x145dfb['has'](_0xedd029[_0x183c07(0x156)]));if(_0x33f972[_0x183c07(0x1b2)]>0x0&&_0x425322[_0x183c07(0x1c9)]!==_0x17a7c0)return console['log'](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x1a9))),console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x151)+_0x425322['site']+_0x183c07(0x1c1)+_0x17a7c0+'\x22.')),console['log'](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x18e)+_0x425322[_0x183c07(0x1c9)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4f978c=_0x3adfd4[_0x183c07(0x1ae)]['filter'](_0x780426=>_0x145dfb[_0x183c07(0x1da)](_0x780426[_0x183c07(0x156)])),_0x1afb6e=_0x33f972;let _0x46e3bf;try{_0x46e3bf=await setupEvaluatorAgent(_0x2b3478['llm'],_0x56380e[_0x183c07(0x1d6)]);}catch(_0x16964f){const _0x4e52b3=_0x16964f instanceof Error?_0x16964f[_0x183c07(0x1d4)]:String(_0x16964f);return console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x175)+_0x4e52b3)),0x1;}console[_0x183c07(0x183)](a5_0x490e8c['cyan'](_0x183c07(0x190))),console[_0x183c07(0x183)](_0x183c07(0x16e)+a5_0x490e8c[_0x183c07(0x152)](_0x425322[_0x183c07(0x15c)])),console['log'](_0x183c07(0x166)+a5_0x490e8c[_0x183c07(0x152)](_0x425322[_0x183c07(0x174)][_0x183c07(0x16c)]+'/'+_0x425322[_0x183c07(0x174)][_0x183c07(0x194)]));_0x1afb6e['length']>0x0&&console[_0x183c07(0x183)]('New\x20tests\x20to\x20execute:\x20'+a5_0x490e8c[_0x183c07(0x149)](_0x1afb6e[_0x183c07(0x1b2)]));console[_0x183c07(0x183)]();const _0x2532ab=[],_0x24f0b9=Date[_0x183c07(0x17b)](),_0x5c6e3b=createCommandSpinner(_0x183c07(0x1b0));if(_0x4f978c[_0x183c07(0x1b2)]>0x0)try{const _0x5e4c4f=await reevaluateFromCache(_0x2b3478[_0x183c07(0x16a)],_0x425322,{'tests':_0x4f978c},{'evaluatorId':_0x46e3bf,'onTestStart':(_0x19ade9,_0xe699bd,_0x5d6542)=>{const _0x4e326a=_0x183c07;_0x5c6e3b[_0x4e326a(0x1aa)]=_0x4e326a(0x17d)+(_0xe699bd+0x1)+'/'+_0x5d6542+':\x20'+_0x19ade9+_0x4e326a(0x16b);if(!_0x5c6e3b[_0x4e326a(0x14c)])_0x5c6e3b[_0x4e326a(0x1d2)]();},'onTestComplete':(_0x6c3110,_0x49a63f)=>{const _0x6f5e1=_0x183c07;_0x5c6e3b[_0x6f5e1(0x192)]();if(_0x49a63f[_0x6f5e1(0x16f)]===_0x6f5e1(0x1dc))console['log'](a5_0x490e8c[_0x6f5e1(0x14f)](_0x6f5e1(0x19c)+_0x6c3110)+a5_0x490e8c[_0x6f5e1(0x15a)](_0x6f5e1(0x1ca)));else _0x49a63f['status']===_0x6f5e1(0x1b9)?console[_0x6f5e1(0x183)](a5_0x490e8c[_0x6f5e1(0x18d)](_0x6f5e1(0x1c8)+_0x6c3110+_0x6f5e1(0x1a7)+_0x49a63f[_0x6f5e1(0x1cc)])+a5_0x490e8c[_0x6f5e1(0x15a)](_0x6f5e1(0x1ca))):console[_0x6f5e1(0x183)](a5_0x490e8c[_0x6f5e1(0x18d)](_0x6f5e1(0x1a2)+_0x6c3110+_0x6f5e1(0x1a7)+_0x49a63f['reason']));_0x49a63f[_0x6f5e1(0x161)]&&console[_0x6f5e1(0x183)](a5_0x490e8c['dim'](_0x6f5e1(0x1a8)+_0x49a63f[_0x6f5e1(0x161)])),_0x2532ab['push'](_0x49a63f);},'onTestSkipped':(_0x1cc864,_0x38b7ca)=>{const _0x38cdcc=_0x183c07;_0x5c6e3b[_0x38cdcc(0x192)](),console[_0x38cdcc(0x183)](a5_0x490e8c[_0x38cdcc(0x149)](_0x38cdcc(0x1b6)+_0x1cc864+_0x38cdcc(0x1a7)+_0x38b7ca));}});for(const _0x1d7f0c of _0x5e4c4f){!_0x2532ab[_0x183c07(0x196)](_0x2b1514=>_0x2b1514['name']===_0x1d7f0c[_0x183c07(0x156)])&&_0x2532ab['push'](_0x1d7f0c);}}catch(_0x3a5a62){_0x5c6e3b[_0x183c07(0x192)]();const _0x5da138=_0x3a5a62 instanceof Error?_0x3a5a62[_0x183c07(0x1d4)]:String(_0x3a5a62);return console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x191)+_0x5da138)),0x1;}_0x5c6e3b[_0x183c07(0x192)]();if(_0x1afb6e[_0x183c07(0x1b2)]>0x0){console[_0x183c07(0x183)](),console[_0x183c07(0x183)](a5_0x490e8c['cyan'](_0x183c07(0x172)));const {projectId:_0x50f2fb,agentId:_0x6329a6}=_0x425322[_0x183c07(0x174)];for(const _0x5055ef of _0x1afb6e){console[_0x183c07(0x183)](_0x183c07(0x165)+a5_0x490e8c['white'](_0x5055ef[_0x183c07(0x156)]));const _0x10971d=createCommandSpinner(_0x183c07(0x17c)+_0x5055ef['rounds'][_0x183c07(0x1b2)]+':\x20Sending\x20user\x20input...');_0x10971d[_0x183c07(0x1d2)]();try{const {result:_0x13b586}=await runTest(_0x2b3478[_0x183c07(0x16a)],_0x5055ef,{'agentId':_0x6329a6,'projectId':_0x50f2fb,'site':_0x425322[_0x183c07(0x1c9)],'noEval':![],'evaluatorId':_0x46e3bf,'onRoundStart':(_0x5c6335,_0x13b28f)=>{const _0x29f819=_0x183c07;_0x10971d[_0x29f819(0x1aa)]=_0x29f819(0x1a1)+(_0x5c6335+0x1)+'/'+_0x13b28f+_0x29f819(0x168);},'onRoundComplete':(_0x119339,_0x317437,_0x39d7a4)=>{const _0x15ac44=_0x183c07,_0x30671b=formatElapsed(_0x317437);_0x39d7a4?console[_0x15ac44(0x183)](_0x15ac44(0x1ad)+(_0x119339+0x1)+'/'+_0x5055ef[_0x15ac44(0x179)][_0x15ac44(0x1b2)]+_0x15ac44(0x142)+a5_0x490e8c[_0x15ac44(0x14f)]('✓')+'\x20('+_0x30671b+')'):console[_0x15ac44(0x183)](_0x15ac44(0x1ad)+(_0x119339+0x1)+'/'+_0x5055ef[_0x15ac44(0x179)][_0x15ac44(0x1b2)]+'...\x20'+a5_0x490e8c[_0x15ac44(0x18d)]('✗'));},'onEvaluationStart':()=>{const _0x124dc0=_0x183c07;_0x10971d[_0x124dc0(0x1aa)]=_0x124dc0(0x15e);},'onEvaluationComplete':_0x1cd709=>{const _0x1e54af=_0x183c07,_0x2b4c97=formatElapsed(_0x1cd709);console[_0x1e54af(0x183)]('\x20\x20Evaluating...\x20'+a5_0x490e8c[_0x1e54af(0x14f)]('✓')+'\x20('+_0x2b4c97+')');}});_0x10971d[_0x183c07(0x192)](),_0x2532ab[_0x183c07(0x187)](_0x13b586);if(_0x13b586['status']===_0x183c07(0x1dc))console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x14f)](_0x183c07(0x19c)+_0x13b586[_0x183c07(0x1cc)])+a5_0x490e8c['dim'](_0x183c07(0x186)));else _0x13b586[_0x183c07(0x16f)]===_0x183c07(0x1b9)?console['log'](a5_0x490e8c['red'](_0x183c07(0x1c8)+_0x13b586[_0x183c07(0x1cc)])+a5_0x490e8c['dim'](_0x183c07(0x186))):console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x1a2)+_0x13b586[_0x183c07(0x1cc)]));_0x13b586['conversation_url']&&console[_0x183c07(0x183)](a5_0x490e8c[_0x183c07(0x15a)](_0x183c07(0x1a8)+_0x13b586['conversation_url']));}catch(_0x46cb98){_0x10971d[_0x183c07(0x192)]();const _0x30f53a=_0x46cb98 instanceof Error?_0x46cb98[_0x183c07(0x1d4)]:String(_0x46cb98);console['log'](a5_0x490e8c[_0x183c07(0x18d)](_0x183c07(0x1a2)+_0x30f53a)),_0x2532ab[_0x183c07(0x187)]({'name':_0x5055ef[_0x183c07(0x156)],'status':'ERROR','reason':_0x30f53a,'timestamp':new Date()[_0x183c07(0x154)](),'duration_ms':0x0});}}}console[_0x183c07(0x183)]();const _0x49cdc8=Date['now']()-_0x24f0b9,_0x207816=_0x2532ab[_0x183c07(0x195)](_0x10b1cc=>_0x10b1cc[_0x183c07(0x16f)]===_0x183c07(0x1dc))[_0x183c07(0x1b2)],_0x56faaf=_0x2532ab['filter'](_0x2ca7ee=>_0x2ca7ee[_0x183c07(0x16f)]===_0x183c07(0x1b9))['length'],_0x2a292e=_0x2532ab[_0x183c07(0x195)](_0x15485d=>_0x15485d[_0x183c07(0x16f)]===_0x183c07(0x19a))[_0x183c07(0x1b2)];console['log']('━'[_0x183c07(0x1b4)](0x3c)),console['log'](_0x183c07(0x180)),console[_0x183c07(0x183)]('━'[_0x183c07(0x1b4)](0x3c)),console[_0x183c07(0x183)](_0x183c07(0x1d0)+_0x2532ab[_0x183c07(0x1b2)]),console['log']('Passed:\x20\x20\x20'+a5_0x490e8c[_0x183c07(0x14f)](_0x207816)),console[_0x183c07(0x183)]('Failed:\x20\x20\x20'+a5_0x490e8c[_0x183c07(0x18d)](_0x56faaf));_0x2a292e>0x0&&console[_0x183c07(0x183)](_0x183c07(0x167)+a5_0x490e8c[_0x183c07(0x18d)](_0x2a292e));console['log'](_0x183c07(0x146)+formatElapsed(_0x49cdc8)),console[_0x183c07(0x183)]('━'[_0x183c07(0x1b4)](0x3c));const _0xde1c4e={'summary':{'total':_0x2532ab[_0x183c07(0x1b2)],'passed':_0x207816,'failed':_0x56faaf,'errors':_0x2a292e>0x0?_0x2a292e:undefined,'duration_ms':_0x49cdc8},'tests':_0x2532ab,'agent':{'project':_0x1d4d90['projectName'],'name':_0x1d4d90[_0x183c07(0x194)],'site':_0x17a7c0},'timestamp':new Date(_0x24f0b9)[_0x183c07(0x154)]()};if(_0x1c595a!==_0x183c07(0x157)||_0x40e842){const _0x5be3c8=formatResults(_0xde1c4e,_0x1c595a);if(_0x40e842)try{a5_0x3912be[_0x183c07(0x1a4)](_0x40e842,_0x5be3c8,_0x183c07(0x19d)),console[_0x183c07(0x183)](),console['log'](a5_0x490e8c['dim'](_0x183c07(0x144)+_0x40e842));}catch(_0x28439b){return console[_0x183c07(0x183)](),console['log'](a5_0x490e8c[_0x183c07(0x18d)]('Error\x20writing\x20output\x20file:\x20'+_0x28439b)),0x1;}else console[_0x183c07(0x183)](),console[_0x183c07(0x183)](_0x5be3c8);}const _0x1ce7db=_0x2532ab['filter'](_0x14978c=>_0x14978c['status']!==_0x183c07(0x1dc));return _0x1ce7db[_0x183c07(0x1b2)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x87fc60=a6_0x2d46;(function(_0x1471fc,_0x971eb1){const _0x25a7fe=a6_0x2d46,_0xab805b=_0x1471fc();while(!![]){try{const _0x804fba=parseInt(_0x25a7fe(0x195))/0x1+parseInt(_0x25a7fe(0x18b))/0x2*(-parseInt(_0x25a7fe(0x1a5))/0x3)+-parseInt(_0x25a7fe(0x171))/0x4*(parseInt(_0x25a7fe(0x179))/0x5)+-parseInt(_0x25a7fe(0x178))/0x6+parseInt(_0x25a7fe(0x185))/0x7+parseInt(_0x25a7fe(0x191))/0x8+-parseInt(_0x25a7fe(0x199))/0x9*(-parseInt(_0x25a7fe(0x18e))/0xa);if(_0x804fba===_0x971eb1)break;else _0xab805b['push'](_0xab805b['shift']());}catch(_0x17de37){_0xab805b['push'](_0xab805b['shift']());}}}(a6_0x1a22,0x86762));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x2d46(_0x27f6f3,_0x7cb6f){_0x27f6f3=_0x27f6f3-0x171;const _0x1a22eb=a6_0x1a22();let _0x2d4646=_0x1a22eb[_0x27f6f3];return _0x2d4646;}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_0x87fc60(0x17a),a6_0x87fc60(0x17b),a6_0x87fc60(0x183),'set-cookie',a6_0x87fc60(0x19c),a6_0x87fc60(0x197),a6_0x87fc60(0x1ad),a6_0x87fc60(0x182)]);function isSensitiveHeader(_0x4a3f19){const _0x3dfca7=a6_0x87fc60;return SENSITIVE_HEADERS['has'](_0x4a3f19[_0x3dfca7(0x175)]());}function parseHeader(_0xfd60e1){const _0x2a5f04=a6_0x87fc60,_0x57a5cd=_0xfd60e1[_0x2a5f04(0x1a4)](':');if(_0x57a5cd===-0x1)throw new Error(_0x2a5f04(0x1ae)+_0xfd60e1+_0x2a5f04(0x188)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x379043=_0xfd60e1[_0x2a5f04(0x181)](0x0,_0x57a5cd)[_0x2a5f04(0x1a1)](),_0x2cdcad=_0xfd60e1[_0x2a5f04(0x181)](_0x57a5cd+0x1)[_0x2a5f04(0x1a1)]();if(!_0x379043)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0xfd60e1+'\x22');return[_0x379043,_0x2cdcad];}export class ApiCommand extends BaseCommand{[a6_0x87fc60(0x19d)]='api';[a6_0x87fc60(0x17c)]=a6_0x87fc60(0x172);[a6_0x87fc60(0x196)](_0x44e0cb){const _0x41fcae=a6_0x87fc60,{args:_0x100e18,options:_0x53804a}=_0x44e0cb,_0x5b19e0=_0x53804a;if(_0x100e18[_0x41fcae(0x1a2)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x58cee7=_0x100e18[0x0];if(!_0x58cee7['startsWith']('/'))return _0x41fcae(0x1a0)+_0x58cee7;const _0x3b69e0=_0x5b19e0[_0x41fcae(0x1af)],_0x136969=_0x5b19e0['file'];if(_0x3b69e0&&_0x136969)return _0x41fcae(0x184);const _0x46183d=_0x5b19e0[_0x41fcae(0x19b)]||'GET',_0x42bea8=[_0x41fcae(0x17d),'POST',_0x41fcae(0x193),'DELETE',_0x41fcae(0x1a9)];if(!_0x42bea8[_0x41fcae(0x1a3)](_0x46183d[_0x41fcae(0x176)]()))return _0x41fcae(0x189)+_0x46183d+'.\x20Valid\x20methods:\x20'+_0x42bea8[_0x41fcae(0x186)](',\x20');const _0x363cad=_0x5b19e0['type']||'td',_0x4978c1=['td',_0x41fcae(0x1ac),_0x41fcae(0x17e),_0x41fcae(0x190),'llm','llm-proxy'];if(!_0x4978c1['includes'](_0x363cad))return _0x41fcae(0x1aa)+_0x363cad+_0x41fcae(0x192)+_0x4978c1[_0x41fcae(0x186)](',\x20');return undefined;}async[a6_0x87fc60(0x18c)](_0x55283a){const _0x1afa56=a6_0x87fc60,{options:_0x1f8f47,args:_0x142652,tdx:_0x405395}=_0x55283a,_0x1b3d8c=_0x1f8f47,_0x198bf2=_0x142652[0x0],_0x39257c=(_0x1b3d8c[_0x1afa56(0x19b)]||_0x1afa56(0x17d))['toUpperCase'](),_0x5c6cbb=_0x1b3d8c[_0x1afa56(0x1af)],_0x15f371=_0x1b3d8c[_0x1afa56(0x19a)],_0x515199=_0x1b3d8c['header'],_0x3251bf=_0x1b3d8c['type']||'td';try{const _0x8f4812={};if(_0x515199){const _0x5ae81a=Array[_0x1afa56(0x17f)](_0x515199)?_0x515199:[_0x515199];for(const _0x2e26eb of _0x5ae81a){const [_0x509fb8,_0x285416]=parseHeader(_0x2e26eb);_0x8f4812[_0x509fb8]=_0x285416;}}let _0x38af0b;if(_0x5c6cbb)_0x38af0b=_0x5c6cbb;else{if(_0x15f371)try{_0x38af0b=RawAPI[_0x1afa56(0x194)](_0x15f371);}catch(_0x44d8f0){return console[_0x1afa56(0x198)]('Error:\x20'+(_0x44d8f0 instanceof Error?_0x44d8f0[_0x1afa56(0x177)]:String(_0x44d8f0))),0x1;}}const _0x365c28={'method':_0x39257c,'apiType':_0x3251bf,'includeHeaders':_0x1f8f47[_0x1afa56(0x187)]};_0x38af0b&&(_0x365c28['body']=_0x38af0b);Object[_0x1afa56(0x18f)](_0x8f4812)['length']>0x0&&(_0x365c28[_0x1afa56(0x1a8)]=_0x8f4812);if(_0x1f8f47[_0x1afa56(0x187)]){const _0x28e64e=resolveSite(_0x1f8f47[_0x1afa56(0x173)]),_0x423bb7=getEndpoint(_0x28e64e,_0x3251bf),_0x92b82b=''+_0x423bb7+_0x198bf2;console[_0x1afa56(0x198)]('>\x20'+_0x39257c+'\x20'+_0x92b82b);const _0x59d24f=getAuthHeaders(_0x28e64e),_0x63d865={..._0x59d24f,..._0x8f4812};for(const [_0x36f26e,_0x9e0517]of Object[_0x1afa56(0x1b0)](_0x63d865)){!isSensitiveHeader(_0x36f26e)&&console[_0x1afa56(0x198)]('>\x20'+_0x36f26e+':\x20'+_0x9e0517);}_0x38af0b&&console[_0x1afa56(0x198)]('>'),console[_0x1afa56(0x198)]('');}const _0x40dc1c=await _0x405395[_0x1afa56(0x180)]['request'](_0x198bf2,_0x365c28);if(_0x1f8f47['verbose']&&_0x40dc1c['headers']){console['error'](_0x1afa56(0x1ab)+_0x40dc1c[_0x1afa56(0x19e)]);for(const [_0x58dafc,_0x493a62]of Object[_0x1afa56(0x1b0)](_0x40dc1c[_0x1afa56(0x1a8)])){!isSensitiveHeader(_0x58dafc)&&console[_0x1afa56(0x198)]('<\x20'+_0x58dafc+':\x20'+_0x493a62);}console['error']('');}const _0x4cd79c=Boolean(_0x1f8f47[_0x1afa56(0x1a6)]),_0x1037a4={'color':_0x1f8f47[_0x1afa56(0x18a)],'noColor':_0x1f8f47[_0x1afa56(0x174)]||_0x4cd79c&&!_0x1f8f47[_0x1afa56(0x18a)]},_0x2fe432=colorizeJSON(_0x40dc1c[_0x1afa56(0x1af)],_0x1037a4);return _0x1f8f47[_0x1afa56(0x1a6)]?(writeFileSync(_0x1f8f47['output'],_0x2fe432),console[_0x1afa56(0x198)](_0x1afa56(0x18d)+_0x1f8f47['output'])):console[_0x1afa56(0x1a7)](_0x2fe432),0x0;}catch(_0x2ee7c6){return _0x2ee7c6 instanceof Error?(console[_0x1afa56(0x198)](_0x1afa56(0x19f)+_0x2ee7c6['message']),_0x1f8f47[_0x1afa56(0x187)]&&_0x2ee7c6['stack']&&console[_0x1afa56(0x198)]('\x0aStack\x20trace:\x0a'+_0x2ee7c6['stack'])):console['error'](_0x1afa56(0x19f)+String(_0x2ee7c6)),0x1;}}}function a6_0x1a22(){const _0x57d103=['site','noColor','toLowerCase','toUpperCase','message','203382gzMqrN','2732845AZEvOo','authorization','proxy-authorization','description','GET','workflow','isArray','api','substring','x-trino-user','cookie','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','250509NFlGec','join','verbose','\x22.\x20','Invalid\x20HTTP\x20method:\x20','color','1080314yAvcHB','execute','Results\x20saved\x20to\x20','420710rzuvwm','keys','trino','5025200YrccHY','.\x20Valid\x20types:\x20','PUT','readBodyFromFile','285113zKeckk','validate','x-xsrf-token','error','387jjqZpq','file','method','set-cookie2','name','status','Error:\x20','Endpoint\x20must\x20start\x20with\x20/:\x20','trim','length','includes','indexOf','6oAUCmY','output','log','headers','PATCH','Invalid\x20API\x20type:\x20','<\x20HTTP/1.1\x20','cdp','x-auth-token','Invalid\x20header\x20format:\x20\x22','data','entries','8bLCBpf','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs'];a6_0x1a22=function(){return _0x57d103;};return a6_0x1a22();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x4805e5=a7_0x10a4;(function(_0x45969c,_0x47b642){const _0xa8128e=a7_0x10a4,_0x2808d0=_0x45969c();while(!![]){try{const _0x3fad21=parseInt(_0xa8128e(0x200))/0x1+parseInt(_0xa8128e(0x20d))/0x2+-parseInt(_0xa8128e(0x217))/0x3*(parseInt(_0xa8128e(0x206))/0x4)+-parseInt(_0xa8128e(0x1f9))/0x5*(-parseInt(_0xa8128e(0x22b))/0x6)+-parseInt(_0xa8128e(0x218))/0x7+parseInt(_0xa8128e(0x216))/0x8+-parseInt(_0xa8128e(0x1f8))/0x9;if(_0x3fad21===_0x47b642)break;else _0x2808d0['push'](_0x2808d0['shift']());}catch(_0x352fb6){_0x2808d0['push'](_0x2808d0['shift']());}}}(a7_0x4eff,0x5cea7));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x2d392e from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a7_0x10a4(_0x3c3908,_0x341403){_0x3c3908=_0x3c3908-0x1ec;const _0x4effd0=a7_0x4eff();let _0x10a458=_0x4effd0[_0x3c3908];return _0x10a458;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1181c9 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4805e5(0x202)]=a7_0x4805e5(0x236);[a7_0x4805e5(0x1f4)]=a7_0x4805e5(0x220);async[a7_0x4805e5(0x227)](_0xa80b7d){const _0x51b4b5=a7_0x4805e5,{options:_0x1c24ac}=_0xa80b7d,_0x5b126f=_0x1c24ac['profile'];console[_0x51b4b5(0x1ec)](a7_0x1181c9[_0x51b4b5(0x215)](_0x51b4b5(0x229)));const _0x5c3f93=_0x1c24ac[_0x51b4b5(0x1f2)]||'us01',_0xbf18f2=await promptSiteSelection(_0x5c3f93,_0x5b126f,_0x51b4b5(0x214));if(!_0xbf18f2)return 0x1;const _0x14bb46=resolveSite(_0xbf18f2);if(isOAuthSupported(_0x14bb46)){const _0x4018d3=await a7_0x2d392e({'type':_0x51b4b5(0x1fe),'name':_0x51b4b5(0x212),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x51b4b5(0x204),'value':_0x51b4b5(0x1f1)},{'title':_0x51b4b5(0x1f5),'value':'apikey'}]});if(!_0x4018d3[_0x51b4b5(0x212)])return console[_0x51b4b5(0x1ec)](_0x51b4b5(0x1ef)),0x1;if(_0x4018d3['method']==='oauth')return await runOAuthLoginFlow(_0x14bb46,_0x5b126f,_0x1c24ac['logLevel']??LogLevel['ERROR']),0x0;}console[_0x51b4b5(0x1ec)](_0x51b4b5(0x20b)+_0x14bb46),console[_0x51b4b5(0x1ec)](_0x51b4b5(0x1ed)),console['log']('\x20\x20'+getConsoleUrl(_0x14bb46,_0x51b4b5(0x231)));const _0x45b91a=await a7_0x2d392e({'type':_0x51b4b5(0x221),'name':_0x51b4b5(0x205),'message':_0x51b4b5(0x210),'validate':_0x95893b=>{if(!_0x95893b||!_0x95893b['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x45b91a['apiKey'])return console['log'](_0x51b4b5(0x1ef)),0x1;const _0x78514d=_0x45b91a[_0x51b4b5(0x205)];console[_0x51b4b5(0x1ec)](_0x51b4b5(0x224));try{const _0x40f4a3=TDX[_0x51b4b5(0x21b)]({'site':_0x14bb46,'apiKey':_0x78514d[_0x51b4b5(0x219)](),'logLevel':_0x1c24ac[_0x51b4b5(0x209)]??LogLevel[_0x51b4b5(0x234)]}),_0x5993be=await _0x40f4a3[_0x51b4b5(0x1fd)][_0x51b4b5(0x20f)]();console[_0x51b4b5(0x1ec)](_0x51b4b5(0x233)+_0x5993be['email']+')');const _0x24f005=await isKeychainAvailable();_0x24f005?(await saveAPIKeyAsync(_0x78514d['trim'](),_0x14bb46,_0x5b126f),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5b126f?_0x51b4b5(0x20a)+_0x5b126f+')':''))):(console[_0x51b4b5(0x1f0)](a7_0x1181c9[_0x51b4b5(0x21a)](_0x51b4b5(0x21c))),console[_0x51b4b5(0x1f0)](a7_0x1181c9[_0x51b4b5(0x21a)](_0x51b4b5(0x22d))));if(_0x5b126f){const _0x593436={'site':_0x14bb46};saveProfileToUserConfig(_0x5b126f,_0x593436),console[_0x51b4b5(0x1ec)]('✓\x20Profile\x20\x27'+_0x5b126f+_0x51b4b5(0x1ee));}else saveDefaultSiteToUserConfig(_0x14bb46),console[_0x51b4b5(0x1ec)](_0x51b4b5(0x21e)+_0x14bb46);const _0x55444e=_0x5b126f?_0x51b4b5(0x1f7)+_0x5b126f:'';return console[_0x51b4b5(0x1ec)](),console[_0x51b4b5(0x1ec)](_0x51b4b5(0x203)),console[_0x51b4b5(0x1ec)](_0x51b4b5(0x22f)+_0x55444e+_0x51b4b5(0x226)),console['log']('\x20\x20tdx'+_0x55444e+_0x51b4b5(0x1fa)),0x0;}catch(_0x12890f){if(_0x12890f instanceof HTTPClientError&&_0x12890f['status']===0x191)return printAuthError(_0x12890f),0x1;return console['error'](a7_0x1181c9[_0x51b4b5(0x223)](_0x51b4b5(0x22a)+(_0x12890f instanceof Error?_0x12890f['message']:String(_0x12890f)))),console['error'](_0x51b4b5(0x20c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x4805e5(0x1f4)]=a7_0x4805e5(0x201);async[a7_0x4805e5(0x227)](_0x13b532){const _0x8bbfa5=a7_0x4805e5,{options:_0x3b7a96,tdx:_0x26dd64}=_0x13b532,_0x4657b1=_0x3b7a96[_0x8bbfa5(0x1f2)],_0x4fb284=_0x3b7a96[_0x8bbfa5(0x1ff)],_0x293630=_0x4fb284?_0x4fb284:'N/A';console['log'](_0x8bbfa5(0x230)+_0x293630+_0x8bbfa5(0x228)+_0x4657b1+')');const _0x133fca=await getOAuthTokens(_0x4fb284);if(_0x133fca)console[_0x8bbfa5(0x1ec)](_0x8bbfa5(0x222)),console[_0x8bbfa5(0x1ec)](_0x8bbfa5(0x235)+(_0x4fb284?_0x8bbfa5(0x20a)+_0x4fb284+')':''));else{const _0x5a3b8a=await resolveAPIKeyAsync(_0x4657b1,_0x4fb284);if(_0x5a3b8a){const {source:_0x31760e,isDeprecated:_0x5a035d}=_0x5a3b8a,_0x3f8ef3=_0x8bbfa5(0x1fc)+_0x31760e;console[_0x8bbfa5(0x1ec)](_0x5a035d?a7_0x1181c9['yellow'](_0x3f8ef3):_0x3f8ef3);}else console[_0x8bbfa5(0x1ec)](a7_0x1181c9[_0x8bbfa5(0x21a)](_0x8bbfa5(0x21f)));}try{const _0x52259e=await _0x26dd64[_0x8bbfa5(0x1fd)]['getUserInfo']();return console[_0x8bbfa5(0x1ec)](a7_0x1181c9[_0x8bbfa5(0x1f3)]('✓\x20Authentication\x20successful\x0a')),console[_0x8bbfa5(0x1ec)](_0x8bbfa5(0x208)+_0x52259e[_0x8bbfa5(0x22c)]),(_0x52259e[_0x8bbfa5(0x1fb)]||_0x52259e['last_name'])&&console['log'](_0x8bbfa5(0x237)+[_0x52259e[_0x8bbfa5(0x1fb)],_0x52259e[_0x8bbfa5(0x20e)]][_0x8bbfa5(0x1f6)](Boolean)[_0x8bbfa5(0x213)]('\x20')),0x0;}catch(_0x17abf5){return _0x17abf5 instanceof HTTPClientError&&_0x17abf5['status']===0x191?printAuthError(_0x17abf5,!![],_0x4fb284):console[_0x8bbfa5(0x225)](a7_0x1181c9[_0x8bbfa5(0x223)](_0x8bbfa5(0x22a)+(_0x17abf5 instanceof Error?_0x17abf5['message']:String(_0x17abf5)))),0x1;}}}function a7_0x4eff(){const _0x317062=['Read\x20credential\x20from\x20','jobs','select','profile','120867rDynkK','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','OAuth\x20(browser\x20login)','apiKey','52PQIaOF','System\x20keychain\x20is\x20not\x20available','User:\x20','logLevel','\x20(profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','429126IDGiqg','last_name','getUserInfo','Enter\x20your\x20TD\x20API\x20key:','No\x20credentials\x20found\x20in\x20keychain','method','join','Setup\x20cancelled','bold','2407720MyWqEC','3498jaafiY','28343xESysb','trim','yellow','create','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','auth:clear','✓\x20Default\x20site\x20set\x20to\x20','No\x20credential\x20found','Setup\x20API\x20key\x20authentication\x20interactively','password','Credential\x20type:\x20OAuth','red','Validating\x20API\x20key...','error','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','execute','\x20(site:\x20','tdx:\x20auth\x20setup','✗\x20Validation\x20failed:\x20','3966906AScEwu','email','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','all','\x20\x20tdx','tdx\x20profile:\x20','/app/mp/ak','\x20removed\x20from\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','ERROR','Read\x20credential\x20from\x20keychain','auth:setup','Name:\x20','log','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x27\x20registered','\x0aSetup\x20cancelled','warn','oauth','site','green','description','API\x20Key','filter','\x20--profile\x20','8079804ZekqkH','5YnqOHf','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','first_name'];a7_0x4eff=function(){return _0x317062;};return a7_0x4eff();}export class AuthClearCommand extends BaseCommand{[a7_0x4805e5(0x202)]=a7_0x4805e5(0x21d);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x4805e5(0x227)](_0x3ad2d6){const _0x42f0a3=a7_0x4805e5,{options:_0x4e2578}=_0x3ad2d6,_0x9b4725=_0x4e2578[_0x42f0a3(0x1ff)];console[_0x42f0a3(0x1ec)](a7_0x1181c9[_0x42f0a3(0x215)]('tdx:\x20auth\x20clear'));const _0x529bcc=await isKeychainAvailable();if(!_0x529bcc)return console[_0x42f0a3(0x225)](a7_0x1181c9[_0x42f0a3(0x223)](_0x42f0a3(0x207))),0x1;const [_0x1a57f4,_0x2751e4]=await Promise[_0x42f0a3(0x22e)]([deleteKeychainAPIKey(_0x9b4725),deleteOAuthTokens(_0x9b4725)]);if(_0x1a57f4||_0x2751e4){clearCredentialCache();const _0x1454d2=[_0x1a57f4&&'API\x20key',_0x2751e4&&'OAuth\x20tokens'][_0x42f0a3(0x1f6)](Boolean)[_0x42f0a3(0x213)]('\x20and\x20');return console['log']('✓\x20'+_0x1454d2+_0x42f0a3(0x232)+(_0x9b4725?_0x42f0a3(0x20a)+_0x9b4725+')':'')),0x0;}else return console['log'](_0x42f0a3(0x211)+(_0x9b4725?'\x20for\x20profile:\x20'+_0x9b4725:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x43972b=a8_0x42f2;function a8_0x42f2(_0x4f7edb,_0x1dc8a3){_0x4f7edb=_0x4f7edb-0x12a;const _0x142b49=a8_0x142b();let _0x42f225=_0x142b49[_0x4f7edb];return _0x42f225;}(function(_0x417521,_0x59dcc4){const _0x3dd3e5=a8_0x42f2,_0x263382=_0x417521();while(!![]){try{const _0x2807b6=-parseInt(_0x3dd3e5(0x12e))/0x1*(parseInt(_0x3dd3e5(0x14e))/0x2)+-parseInt(_0x3dd3e5(0x147))/0x3+-parseInt(_0x3dd3e5(0x14d))/0x4+parseInt(_0x3dd3e5(0x14b))/0x5+parseInt(_0x3dd3e5(0x146))/0x6*(-parseInt(_0x3dd3e5(0x12b))/0x7)+-parseInt(_0x3dd3e5(0x139))/0x8*(parseInt(_0x3dd3e5(0x149))/0x9)+parseInt(_0x3dd3e5(0x12a))/0xa*(parseInt(_0x3dd3e5(0x140))/0xb);if(_0x2807b6===_0x59dcc4)break;else _0x263382['push'](_0x263382['shift']());}catch(_0x21c668){_0x263382['push'](_0x263382['shift']());}}}(a8_0x142b,0x2943d));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x142b(){const _0x1b2e14=['Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','8cXaSmc','name','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Authentication\x20successful\x20(User:\x20','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x27\x20registered','11kvkceY','\x20--profile\x20','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','us01','execute','green','108798fJpAQb','372006HzdJcX','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','898227SYmaCC','\x20(profile:\x20','1586375kCENlk','email','51004vTrvBs','28878lsseyh','site','4533080cpdFqg','35ByJUlu','\x20\x20tdx','tdx:\x20auth\x20login','19FFJKXO','description','ERROR','✓\x20Profile\x20\x27','Validating\x20OAuth\x20tokens...','log','access_token','/oauth/authorize','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'];a8_0x142b=function(){return _0x1b2e14;};return a8_0x142b();}import a8_0x5dd847 from'chalk';export async function runOAuthLoginFlow(_0x5546ef,_0x1854dd,_0x484b1f){const _0x589c13=a8_0x42f2;if(!isOAuthSupported(_0x5546ef))throw new Error(_0x589c13(0x148)+_0x5546ef+'.\x20'+_0x589c13(0x142)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x3cae46=await isKeychainAvailable();if(!_0x3cae46)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x589c13(0x137));const _0x2ea938=getConsoleUrl(_0x5546ef);console[_0x589c13(0x133)]('Opening\x20browser\x20for\x20authentication...'),console[_0x589c13(0x133)]('\x20\x20'+_0x2ea938+_0x589c13(0x135)),console['log'](_0x589c13(0x138));const _0x16f3d9=await startOAuthFlow(_0x5546ef);console['log'](_0x589c13(0x132));const _0x5f558a=TDX['create']({'site':_0x5546ef,'accessToken':_0x16f3d9[_0x589c13(0x134)],'logLevel':_0x484b1f??LogLevel[_0x589c13(0x130)]}),_0x2b6179=await _0x5f558a['jobs']['getUserInfo']();console[_0x589c13(0x133)](a8_0x5dd847[_0x589c13(0x145)](_0x589c13(0x13c)+_0x2b6179[_0x589c13(0x14c)]+')')),await saveOAuthTokens(_0x16f3d9,_0x1854dd),console[_0x589c13(0x133)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x1854dd?_0x589c13(0x14a)+_0x1854dd+')':''));if(_0x1854dd){const _0x57178b={'site':_0x5546ef};saveProfileToUserConfig(_0x1854dd,_0x57178b),console['log'](_0x589c13(0x131)+_0x1854dd+_0x589c13(0x13f));}const _0x601041=_0x1854dd?_0x589c13(0x141)+_0x1854dd:'';console[_0x589c13(0x133)](),console[_0x589c13(0x133)](_0x589c13(0x13e)),console[_0x589c13(0x133)](_0x589c13(0x12c)+_0x601041+_0x589c13(0x136)),console[_0x589c13(0x133)](_0x589c13(0x12c)+_0x601041+_0x589c13(0x13b));}export class AuthLoginCommand extends BaseCommand{[a8_0x43972b(0x13a)]='auth:login';[a8_0x43972b(0x12f)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async[a8_0x43972b(0x144)](_0x3b9384){const _0x412876=a8_0x43972b,{options:_0x41a968}=_0x3b9384,_0x3a289d=_0x41a968['profile'];console[_0x412876(0x133)](a8_0x5dd847['bold'](_0x412876(0x12d)));const _0x3b1ff4=_0x41a968[_0x412876(0x14f)]||_0x412876(0x143),_0x4368a4=await promptSiteSelection(_0x3b1ff4,_0x3a289d,'Login\x20cancelled');if(!_0x4368a4)return 0x1;const _0x7990c9=resolveSite(_0x4368a4);return console[_0x412876(0x133)](_0x412876(0x13d)+_0x7990c9),await runOAuthLoginFlow(_0x7990c9,_0x3a289d,_0x41a968['logLevel']??LogLevel[_0x412876(0x130)]),0x0;}}
|