@treasuredata/tdx 2026.3.7 → 2026.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.d.ts.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/user-command.js.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts +2 -2
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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/endpoints.js.map +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.d.ts +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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x5b3826=a3_0x144c;(function(_0xc90f13,_0x351f59){const _0x35b79c=a3_0x144c,_0x7a6110=_0xc90f13();while(!![]){try{const _0x650c8e=-parseInt(_0x35b79c(0x18a))/0x1*(-parseInt(_0x35b79c(0x19d))/0x2)+parseInt(_0x35b79c(0x1a4))/0x3+parseInt(_0x35b79c(0x1a9))/0x4*(parseInt(_0x35b79c(0x1a6))/0x5)+parseInt(_0x35b79c(0x193))/0x6+parseInt(_0x35b79c(0x197))/0x7+parseInt(_0x35b79c(0x1a8))/0x8+-parseInt(_0x35b79c(0x19a))/0x9;if(_0x650c8e===_0x351f59)break;else _0x7a6110['push'](_0x7a6110['shift']());}catch(_0xa6b7c2){_0x7a6110['push'](_0x7a6110['shift']());}}}(a3_0x3ced,0xa3b31));function a3_0x3ced(){const _0x97479d=['activations','Resolving\x20parent\x20segment\x20\x27','cause','message','listActivations','description','error','3582486LtwIxu','Site:\x20','Resolved\x20parent\x20ID:\x20','site','8566796ZigKGy','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x27...','24547707NkjqmT','execute','Parent\x20name:\x20','2JqGacD','\x20\x20Cause:\x20','data','Resolved\x20child\x20ID:\x20','length','resolveParentId','segment','1216221VJefBQ','name','835XZxarp','List\x20activations\x20for\x20a\x20segment','1535840bdrciF','11356eiNRjk','\x20activation','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Segment\x20name\x20is\x20required','505627lFaLDE','verbose'];a3_0x3ced=function(){return _0x97479d;};return a3_0x3ced();}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_0x144c(_0x1bf19e,_0x9950d){_0x1bf19e=_0x1bf19e-0x189;const _0x3cedc1=a3_0x3ced();let _0x144c5b=_0x3cedc1[_0x1bf19e];return _0x144c5b;}export class ActivationsCommand extends BaseCommand{[a3_0x5b3826(0x1a5)]=a3_0x5b3826(0x18c);[a3_0x5b3826(0x191)]=a3_0x5b3826(0x1a7);async[a3_0x5b3826(0x19b)](_0x4a2a35){const _0x6bf178=a3_0x5b3826,{options:_0x56948f,args:_0x174e9d,tdx:_0x48b5}=_0x4a2a35;if(_0x174e9d[_0x6bf178(0x1a1)]===0x0)return console[_0x6bf178(0x192)](_0x6bf178(0x189)),console['error'](_0x6bf178(0x1ab)),0x1;try{const {parentId:_0x40d963,childId:_0x124eab}=parseSegmentRef(_0x174e9d[0x0]);if(!_0x124eab)return console[_0x6bf178(0x192)](_0x6bf178(0x198)),console['error'](_0x6bf178(0x1ab)),0x1;_0x56948f[_0x6bf178(0x18b)]&&(console[_0x6bf178(0x192)](_0x6bf178(0x194)+_0x56948f[_0x6bf178(0x196)]),console[_0x6bf178(0x192)](_0x6bf178(0x19c)+_0x40d963),console['error']('Child\x20name:\x20'+_0x124eab));const _0x2b8e12=await withSpinner(_0x6bf178(0x18d)+_0x40d963+_0x6bf178(0x199),()=>_0x48b5[_0x6bf178(0x1a3)][_0x6bf178(0x1a2)](_0x40d963),{'verbose':_0x56948f[_0x6bf178(0x18b)]}),_0x296bc0=_0x2b8e12[_0x6bf178(0x19f)];_0x56948f[_0x6bf178(0x18b)]&&console[_0x6bf178(0x192)](_0x6bf178(0x195)+_0x296bc0);const _0x76ae4d=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x124eab+_0x6bf178(0x199),()=>_0x48b5[_0x6bf178(0x1a3)]['resolveSegmentId'](_0x296bc0,_0x124eab),{'verbose':_0x56948f[_0x6bf178(0x18b)]}),_0x7e8ae8=_0x76ae4d[_0x6bf178(0x19f)];_0x56948f[_0x6bf178(0x18b)]&&console['error'](_0x6bf178(0x1a0)+_0x7e8ae8);const _0x2ddd03=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x124eab+_0x6bf178(0x199),()=>_0x48b5[_0x6bf178(0x1a3)][_0x6bf178(0x190)](_0x296bc0,_0x7e8ae8),{'verbose':_0x56948f[_0x6bf178(0x18b)]}),_0x2e1bc9=_0x2ddd03['data'];return console[_0x6bf178(0x192)]('✔\x20Found\x20'+_0x2e1bc9[_0x6bf178(0x1a1)]+_0x6bf178(0x1aa)+(_0x2e1bc9[_0x6bf178(0x1a1)]!==0x1?'s':'')),await handleSDKOutput(_0x2e1bc9,_0x56948f),0x0;}catch(_0x553dac){if(_0x553dac instanceof SDKError)return console[_0x6bf178(0x192)]('Error:\x20'+_0x553dac[_0x6bf178(0x18f)]),_0x553dac['cause']&&console[_0x6bf178(0x192)](_0x6bf178(0x19e)+_0x553dac[_0x6bf178(0x18e)]),0x1;throw _0x553dac;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x2a9554=a4_0x3164;(function(_0x2ed969,_0x39f3f5){const _0x5d2989=a4_0x3164,_0x67c71f=_0x2ed969();while(!![]){try{const _0x128d34=parseInt(_0x5d2989(0x1b3))/0x1+parseInt(_0x5d2989(0x1ca))/0x2+-parseInt(_0x5d2989(0x14c))/0x3*(-parseInt(_0x5d2989(0x18a))/0x4)+parseInt(_0x5d2989(0x17e))/0x5+parseInt(_0x5d2989(0x1ac))/0x6*(-parseInt(_0x5d2989(0x16d))/0x7)+-parseInt(_0x5d2989(0x15e))/0x8+-parseInt(_0x5d2989(0x1e7))/0x9;if(_0x128d34===_0x39f3f5)break;else _0x67c71f['push'](_0x67c71f['shift']());}catch(_0x458607){_0x67c71f['push'](_0x67c71f['shift']());}}}(a4_0x4aa9,0xd55d0));import a4_0x4bdfdb from'chalk';import a4_0x4eefd6 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x4aa9(){const _0x53e221=['\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','dirname','new','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Experimental\x20Artifacts:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errors','knowledgeBases','MISSING_ARGUMENT','\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Agent:\x20','tdx.json','textKnowledgeBases','newProjectName','\x20total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','llm_project','18HUActr','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)','yes','agent:push','Status:\x20','\x20\x20Target:\x20','\x0aWrite\x20','log','isNew','Using\x20project\x20from\x20context:\x20','action','\x20changed','Chat:\x20','push','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cloneProject','no_local_folder','Dry\x20run\x20-\x20no\x20files\x20written','7530320qNkaZa','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Project\x20cloned\x20with\x20errors','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','red','pullProject','sourceProjectName','Using\x20project\x20from\x20','\x20new','Analyzing\x20changes\x20to\x20push...','integrations','\x20updated','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','-\x20nothing\x20pushed','5810bIEYwg','\x20\x20Prompts:\x20','output','agentName','newProjectId','\x20\x20Integration\x20\x22','no_context','\x20\x20Agent\x20\x22','✔\x20Context\x20set:\x20','green','projectName','\x20\x20Agents:\x20','session','Project\x20cloned\x20successfully','New\x20project:\x20','\x20--profile\x20','error','4566180fCpAiJ','\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','projectDir','source','agentId','\x22:\x20','pushProject','cyan','Errors:','hasChanges','Dry\x20run\x20-\x20no\x20changes\x20made','Analyzing\x20project\x20\x22','743144bXRNRX','\x22\x20to\x20new\x20project\x20\x22','\x20--name\x20','\x20\x20Integrations:\x20','\x20\x20Source:\x20','diff','Using\x20context\x20project:\x20','updated','New\x20project\x20name\x20is\x20required','force','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','cwd-config','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','prompts','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Prompt\x20\x22','experimentalKnowledgeBases','dryRun','cwd','Output:\x20','\x0aChanges\x20to\x20prompt\x20\x27','name','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','No\x20tdx.json\x20found\x20in\x20','agent:pull','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','join','\x20|\x20','utf-8','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20files?','site','agent','594iNCvAz','agents','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x22\x20from\x20project\x20\x22','Using\x20current\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','agent:clone','619012fSaCGw','\x0a✔\x20Pulled\x20','Cloning\x20\x22','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','gray','Would\x20pull\x20agent:\x20','Agent\x20','unchanged','llmProject','\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','message','\x22\x20to\x20a\x20different\x20profile','<new-name>','arg-dir','\x20\x20tdx\x20agent\x20pull\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parse','projectId','counts','Project:\x20','dim','\x20unchanged','llm','3213446BNdywo','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','\x0aErrors\x20found:','Writing\x20files...','agent.yml','experimentalArtifacts','yellow','reason','\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)','outputPath','Cannot\x20clone\x20from\x20context\x20project\x20\x22','description','Summary:','repeat','\x27\x20to\x20create\x20the\x20folder\x20structure.','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Text\x20Knowledge\x20Bases:\x20','found','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Source:\x20','\x0aChanges:','Pulling\x20agent\x20\x22','context','\x20\x20tdx\x20agent\x20clone\x20agents/','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22\x20to\x20\x22','\x22...','execute','21206619jigivx','Failed\x20to\x20push\x20agent:\x20','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20agent\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','created','\x20created','total','-\x20no\x20files\x20written','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','New\x20project\x20ID:\x20','\x20\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','Pushing\x20to\x20project...','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'];a4_0x4aa9=function(){return _0x53e221;};return a4_0x4aa9();}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x3164(_0xbc422f,_0x3fee01){_0xbc422f=_0xbc422f-0x147;const _0x4aa93=a4_0x4aa9();let _0x3164b4=_0x4aa93[_0xbc422f];return _0x3164b4;}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(_0x51f84c){const _0x480b5c=a4_0x3164,_0x5c5b4a=[];if(_0x51f84c[_0x480b5c(0x1ee)]!==undefined)_0x5c5b4a[_0x480b5c(0x159)](_0x51f84c[_0x480b5c(0x1ee)]+_0x480b5c(0x149));if(_0x51f84c[_0x480b5c(0x1f8)]!==undefined&&_0x51f84c[_0x480b5c(0x1f8)]>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb['green'](_0x51f84c['new']+'\x20new'));if(_0x51f84c[_0x480b5c(0x1ec)]!==undefined&&_0x51f84c[_0x480b5c(0x1ec)]>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb[_0x480b5c(0x176)](_0x51f84c['created']+_0x480b5c(0x1ed)));if(_0x51f84c[_0x480b5c(0x191)]!==undefined&&_0x51f84c[_0x480b5c(0x191)]>0x0)_0x5c5b4a['push'](a4_0x4bdfdb[_0x480b5c(0x1d1)](_0x51f84c[_0x480b5c(0x191)]+_0x480b5c(0x16a)));if(_0x51f84c[_0x480b5c(0x1ba)]!==undefined&&_0x51f84c['unchanged']>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb[_0x480b5c(0x1b7)](_0x51f84c['unchanged']+_0x480b5c(0x1c8)));if(_0x51f84c[_0x480b5c(0x1fc)]!==undefined&&_0x51f84c[_0x480b5c(0x1fc)]>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb[_0x480b5c(0x163)](_0x51f84c[_0x480b5c(0x1fc)]+_0x480b5c(0x1ff)));return _0x5c5b4a[_0x480b5c(0x1a5)](',\x20');}function displayDiffs(_0x191956,_0x2fc36a,_0x4e5016,_0x198246,_0xe02995,_0x965952,_0x10591b){const _0x42a0d6=a4_0x3164;for(const _0x595063 of _0x191956){if(_0x595063[_0x42a0d6(0x18f)]){const _0x264b9b=_0x595063[_0x42a0d6(0x170)]||_0x595063['name'];console[_0x42a0d6(0x153)](_0x42a0d6(0x1ea)+_0x264b9b+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x595063[_0x42a0d6(0x18f)]),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c));}}for(const _0x4c0d50 of _0x2fc36a){_0x4c0d50[_0x42a0d6(0x18f)]&&(console[_0x42a0d6(0x153)](_0x42a0d6(0x1dd)+_0x4c0d50[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x4c0d50['diff']),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)));}for(const _0x5351e7 of _0x4e5016){_0x5351e7[_0x42a0d6(0x18f)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x5351e7[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x5351e7[_0x42a0d6(0x18f)]),console[_0x42a0d6(0x153)]('─'['repeat'](0x3c)));}for(const _0x152deb of _0x198246){_0x152deb[_0x42a0d6(0x18f)]&&(console[_0x42a0d6(0x153)](_0x42a0d6(0x19e)+_0x152deb[_0x42a0d6(0x19f)]+'\x27:'),console['log']('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x152deb['diff']),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)));}for(const _0x5af568 of _0xe02995){_0x5af568['diff']&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x5af568['name']+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x5af568['diff']),console[_0x42a0d6(0x153)]('─'['repeat'](0x3c)));}for(const _0x3f53e0 of _0x965952){_0x3f53e0[_0x42a0d6(0x18f)]&&(console['log'](_0x42a0d6(0x198)+_0x3f53e0[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x3f53e0[_0x42a0d6(0x18f)]),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)));}for(const _0x348187 of _0x10591b){_0x348187[_0x42a0d6(0x18f)]&&(console[_0x42a0d6(0x153)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x348187[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x348187[_0x42a0d6(0x18f)]),console['log']('─'[_0x42a0d6(0x1d8)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2a9554(0x19f)]=a4_0x2a9554(0x1a3);[a4_0x2a9554(0x1d6)]=a4_0x2a9554(0x196);async['execute'](_0x447eb7){const _0xce33d1=a4_0x2a9554,{options:_0x9f532d,args:_0x4cdbb2,tdx:_0x1fecad}=_0x447eb7,_0x55564c=_0x4cdbb2[0x0],_0xdba2fd=_0x4cdbb2[0x1],_0x524bd1=_0x9f532d[_0xce33d1(0x16f)],_0x2b6828=_0x9f532d[_0xce33d1(0x19b)],_0x5e61d9=_0x9f532d[_0xce33d1(0x193)],_0x19fc2c=_0x9f532d[_0xce33d1(0x14e)],_0x5cf537=_0x9f532d['llmProject'],_0x583ca3=_0x9f532d[_0xce33d1(0x1ab)];let _0x2fca9f;if(_0x55564c){const _0x443503=a4_0x4eefd6[_0xce33d1(0x1a5)](_0x55564c,_0xce33d1(0x202));if(existsSync(_0x443503))try{const _0x41386e=JSON[_0xce33d1(0x1c3)](readFileSync(_0x443503,_0xce33d1(0x1a7)));_0x41386e[_0xce33d1(0x14b)]&&(_0x2fca9f={'llm_project':_0x41386e[_0xce33d1(0x14b)]});}catch{}}const _0x2c5b28=findAgentConfigPath(process[_0xce33d1(0x19c)]());let _0x431df9;if(_0x2c5b28)try{const _0x36471e=JSON['parse'](readFileSync(_0x2c5b28,'utf-8'));_0x36471e[_0xce33d1(0x14b)]&&(_0x431df9={'llm_project':_0x36471e[_0xce33d1(0x14b)]});}catch{}const _0x5cb515=resolveAgentPullArgs({'arg':_0x55564c,'agentNameArg':_0xdba2fd,'agentFlag':_0x583ca3,'contextProject':_0x5cf537,'argDirConfig':_0x2fca9f,'cwdConfigPath':_0x2c5b28||undefined,'cwdConfig':_0x431df9}),{projectNameOrId:_0x36abd0,targetAgentName:_0x54ede0,existingOutputDir:_0x24e2a3,source:_0x4e2447}=_0x5cb515;if(_0x4e2447===_0xce33d1(0x1c0))console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1c7)](_0xce33d1(0x166)+a4_0x4eefd6[_0xce33d1(0x1a5)](_0x55564c,_0xce33d1(0x202))+':\x20'+_0x36abd0));else{if(_0x4e2447===_0xce33d1(0x195))console['log'](a4_0x4bdfdb[_0xce33d1(0x1c7)]('Using\x20project:\x20'+_0x36abd0));else _0x4e2447===_0xce33d1(0x1e1)&&console[_0xce33d1(0x153)](a4_0x4bdfdb['dim'](_0xce33d1(0x155)+_0x36abd0));}if(!_0x36abd0)return _0x583ca3?(console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x15f))),console[_0xce33d1(0x153)](_0xce33d1(0x1a4)),console['log'](_0xce33d1(0x161))):(console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x162))),console[_0xce33d1(0x153)](_0xce33d1(0x14d)),console[_0xce33d1(0x153)](_0xce33d1(0x17f)),console[_0xce33d1(0x153)]('\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[_0xce33d1(0x153)](_0xce33d1(0x1f6)),console[_0xce33d1(0x153)](_0xce33d1(0x1bc))),0x1;if(_0x54ede0){const {data:_0x420dbf}=await withSpinner(_0xce33d1(0x1e0)+_0x54ede0+_0xce33d1(0x1af)+_0x36abd0+_0xce33d1(0x1e5),()=>_0x1fecad['llm']['pullAgent'](_0x36abd0,_0x54ede0,_0x524bd1,{'dryRun':_0x2b6828,'force':_0x5e61d9}));if(_0x2b6828)return console[_0xce33d1(0x153)](a4_0x4bdfdb['yellow'](_0xce33d1(0x15d))),console['log'](_0xce33d1(0x1b8)+_0x420dbf[_0xce33d1(0x170)]),console[_0xce33d1(0x153)]('Output\x20path:\x20'+_0x420dbf['outputPath']),_0x420dbf['diff']&&(console[_0xce33d1(0x153)](_0xce33d1(0x1df)),console['log']('─'['repeat'](0x3c)),console[_0xce33d1(0x153)](_0x420dbf['diff']),console[_0xce33d1(0x153)]('─'[_0xce33d1(0x1d8)](0x3c))),0x0;return console['log'](a4_0x4bdfdb[_0xce33d1(0x176)]('Agent\x20pulled\x20successfully')),console[_0xce33d1(0x153)](_0xce33d1(0x201)+_0x420dbf[_0xce33d1(0x170)]),console['log'](_0xce33d1(0x19d)+_0x420dbf[_0xce33d1(0x1d4)]),console['log'](_0xce33d1(0x150)+(_0x420dbf[_0xce33d1(0x154)]?a4_0x4bdfdb[_0xce33d1(0x176)]('new'):_0x420dbf[_0xce33d1(0x187)]?a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x191)):a4_0x4bdfdb[_0xce33d1(0x1b7)](_0xce33d1(0x1ba)))),0x0;}const _0x193932=_0x24e2a3||_0x524bd1,{data:_0x2a318a}=await withSpinner(_0xce33d1(0x189)+_0x36abd0+_0xce33d1(0x1e5),()=>_0x1fecad[_0xce33d1(0x1c9)]['pullProject'](_0x36abd0,_0x193932,{'dryRun':!![]})),_0x48f0b3=_0x2a318a['counts'][_0xce33d1(0x1ad)][_0xce33d1(0x1f8)]+_0x2a318a['counts']['knowledgeBases'][_0xce33d1(0x1f8)]+_0x2a318a['counts'][_0xce33d1(0x147)][_0xce33d1(0x1f8)]+_0x2a318a['counts'][_0xce33d1(0x197)]['new']+_0x2a318a['counts'][_0xce33d1(0x169)][_0xce33d1(0x1f8)]+_0x2a318a[_0xce33d1(0x1c5)]['experimentalKnowledgeBases'][_0xce33d1(0x1f8)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)][_0xce33d1(0x1f8)],_0xe7a83=_0x2a318a['counts'][_0xce33d1(0x1ad)][_0xce33d1(0x191)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1fd)][_0xce33d1(0x191)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x147)]['updated']+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x197)]['updated']+_0x2a318a['counts'][_0xce33d1(0x169)][_0xce33d1(0x191)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x19a)][_0xce33d1(0x191)]+_0x2a318a['counts'][_0xce33d1(0x1d0)][_0xce33d1(0x191)],_0x399e54=_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1ad)][_0xce33d1(0x1ba)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1fd)][_0xce33d1(0x1ba)]+_0x2a318a[_0xce33d1(0x1c5)]['textKnowledgeBases'][_0xce33d1(0x1ba)]+_0x2a318a['counts']['prompts'][_0xce33d1(0x1ba)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x169)]['unchanged']+_0x2a318a[_0xce33d1(0x1c5)]['experimentalKnowledgeBases']['unchanged']+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)]['unchanged'];console[_0xce33d1(0x153)]('\x0aPull\x20summary\x20for\x20\x27'+_0x2a318a[_0xce33d1(0x177)]+'\x27:'),console[_0xce33d1(0x153)]('\x20\x20'+a4_0x4bdfdb[_0xce33d1(0x176)]('+\x20'+_0x48f0b3+_0xce33d1(0x167))+_0xce33d1(0x1a6)+a4_0x4bdfdb[_0xce33d1(0x1d1)]('~\x20'+_0xe7a83+_0xce33d1(0x157))+_0xce33d1(0x1a6)+a4_0x4bdfdb[_0xce33d1(0x1c7)]('=\x20'+_0x399e54+'\x20unchanged')),console[_0xce33d1(0x153)]('\x20\x20Agents:\x20'+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1ad)])),console[_0xce33d1(0x153)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1fd)])),console[_0xce33d1(0x153)](_0xce33d1(0x1db)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x147)])),console[_0xce33d1(0x153)](_0xce33d1(0x16e)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)]['prompts'])),console['log'](_0xce33d1(0x18d)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x169)]));const _0x1d8bea=_0x2a318a['counts'][_0xce33d1(0x19a)][_0xce33d1(0x1ee)]>0x0||_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)][_0xce33d1(0x1ee)]>0x0;_0x1d8bea&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2a318a['counts']['experimentalKnowledgeBases'])),console[_0xce33d1(0x153)](_0xce33d1(0x1fa)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)])));console['log'](_0xce33d1(0x151)+a4_0x4bdfdb['cyan'](_0x2a318a['outputDir'])),displayDiffs(_0x2a318a[_0xce33d1(0x1ad)],_0x2a318a[_0xce33d1(0x1fd)],_0x2a318a['textKnowledgeBases'],_0x2a318a[_0xce33d1(0x197)],_0x2a318a['integrations'],_0x2a318a[_0xce33d1(0x19a)],_0x2a318a[_0xce33d1(0x1d0)]);if(_0x2b6828)return console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x1f0))),0x0;if(_0x48f0b3===0x0&&_0xe7a83===0x0)return console['log'](a4_0x4bdfdb[_0xce33d1(0x176)](_0xce33d1(0x1ae))),saveSessionContext({'llm_project':_0x2a318a['projectName']},_0x9f532d[_0xce33d1(0x179)]),console['log'](a4_0x4bdfdb['green'](_0xce33d1(0x175)+a4_0x4bdfdb['dim'](_0xce33d1(0x14b))+'\x20=\x20'+a4_0x4bdfdb[_0xce33d1(0x185)](_0x2a318a[_0xce33d1(0x177)]))),0x0;if(!_0x19fc2c&&!_0x5e61d9){if(!isInteractive())return console[_0xce33d1(0x17d)](a4_0x4bdfdb[_0xce33d1(0x163)]('\x0aError:'),_0xce33d1(0x1c2)),console[_0xce33d1(0x17d)](a4_0x4bdfdb[_0xce33d1(0x1c7)](_0xce33d1(0x1fb))),0x1;const _0x48ee63=await confirmKey(_0xce33d1(0x152)+(_0x48f0b3+_0xe7a83)+_0xce33d1(0x1a9));if(!_0x48ee63)return console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)]('Cancelled'),_0xce33d1(0x1ef)),0x1;}const {data:_0x481b63}=await withSpinner(_0xce33d1(0x1ce),()=>_0x1fecad[_0xce33d1(0x1c9)][_0xce33d1(0x164)](_0x36abd0,_0x193932,{'force':_0x5e61d9}));return console['log'](a4_0x4bdfdb[_0xce33d1(0x176)](_0xce33d1(0x1b4)+(_0x48f0b3+_0xe7a83)+'\x20files\x20to\x20'+_0x481b63['outputDir'])),saveSessionContext({'llm_project':_0x481b63[_0xce33d1(0x177)]},_0x9f532d[_0xce33d1(0x179)]),console[_0xce33d1(0x153)](a4_0x4bdfdb['green'](_0xce33d1(0x175)+a4_0x4bdfdb[_0xce33d1(0x1c7)](_0xce33d1(0x14b))+'\x20=\x20'+a4_0x4bdfdb['cyan'](_0x481b63[_0xce33d1(0x177)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2a9554(0x19f)]=a4_0x2a9554(0x1b2);[a4_0x2a9554(0x1d6)]=a4_0x2a9554(0x1da);async[a4_0x2a9554(0x1e6)](_0x1d277c){const _0x1b4d63=a4_0x2a9554,{options:_0x1ca64f,args:_0x244b00,tdx:_0x3fd57c}=_0x1d277c,_0x3ddf99=_0x244b00[0x0],_0xea6279=_0x1ca64f[_0x1b4d63(0x19f)],_0x2b06c2=_0x1ca64f['dryRun'],_0x443d70=_0x1ca64f['yes'],_0x2418cb=_0x1ca64f['site'],_0x5287a8=_0x1ca64f[_0x1b4d63(0x1bb)];let _0x32780b;const _0x17031f=findAgentConfigPath(process[_0x1b4d63(0x19c)]());if(_0x3ddf99){const _0x4d870e=a4_0x4eefd6[_0x1b4d63(0x1a5)](_0x3ddf99,_0x1b4d63(0x202));existsSync(_0x4d870e)?(_0x32780b=_0x3ddf99,console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1c7)]('Using\x20local\x20project:\x20'+_0x3ddf99))):_0x32780b=_0x3ddf99;}else{if(_0x17031f)_0x32780b=a4_0x4eefd6['dirname'](_0x17031f),console['log'](a4_0x4bdfdb['dim'](_0x1b4d63(0x1b0)+_0x32780b));else{if(_0x5287a8){const _0x5367be=sanitizeForFilesystem(_0x5287a8);let _0x633a64=_0x5367be,_0x5dd461=a4_0x4eefd6[_0x1b4d63(0x1a5)](process[_0x1b4d63(0x19c)](),_0x1b4d63(0x1ad),_0x5367be,'tdx.json');if(!existsSync(_0x5dd461)){const _0x52575c=normalizeName(_0x5287a8),_0xf47bf=a4_0x4eefd6[_0x1b4d63(0x1a5)](process['cwd'](),_0x1b4d63(0x1ad),_0x52575c,_0x1b4d63(0x202));existsSync(_0xf47bf)&&(_0x633a64=_0x52575c,_0x5dd461=_0xf47bf);}if(existsSync(_0x5dd461))_0x32780b=a4_0x4eefd6[_0x1b4d63(0x1f7)](_0x5dd461),console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1c7)]('Using\x20local\x20project:\x20'+_0x32780b));else{const _0x505e4a=_0x1ca64f['profile'];if(_0x505e4a)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b4d63(0x1d5)+_0x5287a8+_0x1b4d63(0x1be),undefined,{'helpText':_0x1b4d63(0x1cb)+_0x1b4d63(0x1a0)+(_0x1b4d63(0x1c1)+_0x5287a8+'\x0a')+(_0x1b4d63(0x1e2)+_0x633a64+_0x1b4d63(0x18c)+(_0xea6279||_0x1b4d63(0x1bf))+_0x1b4d63(0x17c)+_0x505e4a)});_0x32780b=_0x5287a8,console['log'](a4_0x4bdfdb[_0x1b4d63(0x1c7)](_0x1b4d63(0x190)+_0x5287a8));}}}}if(!_0x32780b)return console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1d1)](_0x1b4d63(0x14a))),console[_0x1b4d63(0x153)](_0x1b4d63(0x194)),console[_0x1b4d63(0x153)](_0x1b4d63(0x15a)),console[_0x1b4d63(0x153)](_0x1b4d63(0x1d3)),console[_0x1b4d63(0x153)](_0x1b4d63(0x1f5)),0x1;if(!_0xea6279)throw new SDKError(ErrorCode[_0x1b4d63(0x1fe)],_0x1b4d63(0x192),undefined,{'helpText':_0x1b4d63(0x1eb)});if(!_0x443d70&&!_0x2b06c2){if(!isInteractive())return console[_0x1b4d63(0x17d)](a4_0x4bdfdb[_0x1b4d63(0x163)]('\x0aError:'),_0x1b4d63(0x1c2)),console[_0x1b4d63(0x17d)](a4_0x4bdfdb[_0x1b4d63(0x1c7)](_0x1b4d63(0x1fb))),0x1;const _0x57fc51=await confirmKey('Clone\x20\x22'+_0x32780b+_0x1b4d63(0x18b)+_0xea6279+'\x22?');if(!_0x57fc51)return console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1d1)]('Cancelled')),0x1;}const {data:_0x45b31c}=await withSpinner(_0x1b4d63(0x1b5)+_0x32780b+_0x1b4d63(0x1e4)+_0xea6279+_0x1b4d63(0x1e5),()=>_0x3fd57c[_0x1b4d63(0x1c9)][_0x1b4d63(0x15b)](_0x32780b,_0xea6279,{'dryRun':_0x2b06c2}));if(_0x2b06c2){console[_0x1b4d63(0x153)](a4_0x4bdfdb['yellow'](_0x1b4d63(0x188))),console[_0x1b4d63(0x153)](_0x1b4d63(0x1de)+_0x45b31c[_0x1b4d63(0x165)]),console[_0x1b4d63(0x153)](_0x1b4d63(0x17b)+_0xea6279),console[_0x1b4d63(0x153)]('Would\x20clone:'),console['log'](_0x1b4d63(0x178)+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1ad)]['created']),console[_0x1b4d63(0x153)]('\x20\x20Knowledge\x20Bases:\x20'+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1fd)][_0x1b4d63(0x1ec)]),console[_0x1b4d63(0x153)]('\x20\x20Prompts:\x20'+_0x45b31c[_0x1b4d63(0x1c5)]['prompts'][_0x1b4d63(0x1ec)]);const _0x10e158=_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)][_0x1b4d63(0x1ec)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalArtifacts'][_0x1b4d63(0x1ec)]>0x0;return _0x10e158&&(console[_0x1b4d63(0x153)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)][_0x1b4d63(0x1ec)]),console[_0x1b4d63(0x153)](_0x1b4d63(0x1fa)+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1d0)][_0x1b4d63(0x1ec)])),0x0;}const _0x9db53d=_0x45b31c['counts'][_0x1b4d63(0x1ad)][_0x1b4d63(0x1fc)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1fd)]['errors']>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x197)][_0x1b4d63(0x1fc)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)]['errors']>0x0||_0x45b31c['counts']['experimentalArtifacts'][_0x1b4d63(0x1fc)]>0x0;_0x9db53d?console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1d1)](_0x1b4d63(0x160))):console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x176)](_0x1b4d63(0x17a)));console[_0x1b4d63(0x153)](_0x1b4d63(0x1de)+_0x45b31c['sourceProjectName']),console[_0x1b4d63(0x153)](_0x1b4d63(0x17b)+_0x45b31c[_0x1b4d63(0x148)]),console['log'](_0x1b4d63(0x1f1)+_0x45b31c['newProjectId']),console['log'](),console['log'](_0x1b4d63(0x1d7)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1ad)])),console[_0x1b4d63(0x153)](_0x1b4d63(0x1f2)+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1fd)])),console[_0x1b4d63(0x153)](_0x1b4d63(0x16e)+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x197)])),console[_0x1b4d63(0x153)](_0x1b4d63(0x18d)+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x169)]));const _0x51426a=_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)][_0x1b4d63(0x1ec)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalKnowledgeBases'][_0x1b4d63(0x191)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x45b31c['counts'][_0x1b4d63(0x1d0)][_0x1b4d63(0x1ec)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1d0)]['updated']>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalArtifacts'][_0x1b4d63(0x1ba)]>0x0;_0x51426a&&(console[_0x1b4d63(0x153)](_0x1b4d63(0x1a1)+formatCountSummary(_0x45b31c['counts'][_0x1b4d63(0x19a)])),console['log'](_0x1b4d63(0x1fa)+formatCountSummary(_0x45b31c['counts']['experimentalArtifacts'])));if(_0x9db53d){console[_0x1b4d63(0x153)](),console['log'](a4_0x4bdfdb[_0x1b4d63(0x163)]('Errors:'));for(const _0x5cf569 of _0x45b31c[_0x1b4d63(0x1ad)]){_0x5cf569[_0x1b4d63(0x156)]==='error'&&console[_0x1b4d63(0x153)](a4_0x4bdfdb['red'](_0x1b4d63(0x174)+_0x5cf569[_0x1b4d63(0x170)]+_0x1b4d63(0x183)+_0x5cf569[_0x1b4d63(0x17d)]));}for(const _0x30f77b of _0x45b31c[_0x1b4d63(0x1fd)]){_0x30f77b[_0x1b4d63(0x156)]===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x1cc)+_0x30f77b[_0x1b4d63(0x19f)]+_0x1b4d63(0x183)+_0x30f77b[_0x1b4d63(0x17d)]));}for(const _0x3c8e60 of _0x45b31c[_0x1b4d63(0x197)]){_0x3c8e60[_0x1b4d63(0x156)]===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x199)+_0x3c8e60['name']+_0x1b4d63(0x183)+_0x3c8e60[_0x1b4d63(0x17d)]));}for(const _0x299283 of _0x45b31c['integrations']){_0x299283['action']==='error'&&console[_0x1b4d63(0x153)](a4_0x4bdfdb['red'](_0x1b4d63(0x172)+_0x299283[_0x1b4d63(0x19f)]+'\x22:\x20'+_0x299283[_0x1b4d63(0x17d)]));}for(const _0x41c7eb of _0x45b31c['experimentalKnowledgeBases']){_0x41c7eb[_0x1b4d63(0x156)]===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x16b)+_0x41c7eb[_0x1b4d63(0x19f)]+'\x22:\x20'+_0x41c7eb[_0x1b4d63(0x17d)]));}for(const _0x38f3d1 of _0x45b31c['experimentalArtifacts']){_0x38f3d1['action']===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x1b1)+_0x38f3d1[_0x1b4d63(0x19f)]+_0x1b4d63(0x183)+_0x38f3d1[_0x1b4d63(0x17d)]));}return 0x1;}console[_0x1b4d63(0x153)]();const _0x35fb2d=getLLMProjectUrl(_0x2418cb,_0x45b31c[_0x1b4d63(0x171)]);return console[_0x1b4d63(0x153)](_0x1b4d63(0x1c6)+a4_0x4bdfdb[_0x1b4d63(0x185)](_0x35fb2d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2a9554(0x19f)]=a4_0x2a9554(0x14f);[a4_0x2a9554(0x1d6)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2a9554(0x1e6)](_0x38957b){const _0x134f66=a4_0x2a9554,{options:_0x3d0213,args:_0xaabd73,tdx:_0xfb119f}=_0x38957b;let _0x40d9b7=_0xaabd73[0x0]||process[_0x134f66(0x19c)]();const _0x3fec86=_0x3d0213[_0x134f66(0x19b)],_0x47bfed=_0x3d0213[_0x134f66(0x193)],_0x2b183d=_0x3d0213[_0x134f66(0x14e)],_0x5e185e=_0x3d0213[_0x134f66(0x1aa)],_0x1a9506=a4_0x4eefd6[_0x134f66(0x1a5)](_0x40d9b7,_0x134f66(0x1cf)),_0x1b9f88=existsSync(_0x1a9506);if(_0x1b9f88){const {data:_0x43ce19}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x40d9b7+_0x134f66(0x1e5),()=>_0xfb119f[_0x134f66(0x1c9)]['pushAgent'](_0x40d9b7,{'dryRun':_0x3fec86,'force':_0x47bfed}));if(_0x3fec86)return console[_0x134f66(0x153)](a4_0x4bdfdb['yellow'](_0x134f66(0x188))),console[_0x134f66(0x153)]('Would\x20push\x20agent:\x20'+_0x43ce19[_0x134f66(0x170)]),0x0;if(_0x43ce19[_0x134f66(0x156)]==='error')return console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x1e8)+_0x43ce19['error'])),0x1;console['log'](a4_0x4bdfdb[_0x134f66(0x176)](_0x134f66(0x1b9)+_0x43ce19[_0x134f66(0x156)]+'\x20successfully')),console[_0x134f66(0x153)](_0x134f66(0x201)+_0x43ce19[_0x134f66(0x170)]);if(_0x43ce19[_0x134f66(0x182)]&&_0x43ce19[_0x134f66(0x1c4)]){const _0x35c17c=getLLMAgentChatUrl(_0x5e185e,_0x43ce19['projectId'],_0x43ce19[_0x134f66(0x182)]);console['log'](_0x134f66(0x158)+a4_0x4bdfdb[_0x134f66(0x185)](_0x35c17c));}return 0x0;}const _0x37acf0=_0x3d0213[_0x134f66(0x1bb)],_0x519721=resolveProjectFromContext(_0x40d9b7,_0x37acf0);if(_0x519721[_0x134f66(0x1dc)])_0x40d9b7=_0x519721[_0x134f66(0x180)],_0x519721[_0x134f66(0x181)]===_0x134f66(0x1e1)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1c7)]('Using\x20project:\x20'+_0x40d9b7));else{let _0x3ac448=_0x134f66(0x1e3);_0x519721[_0x134f66(0x1d2)]===_0x134f66(0x15c)&&(_0x3ac448=_0x519721[_0x134f66(0x1bd)]+_0x134f66(0x1f9)+_0x519721['llmProject']+_0x134f66(0x1d9));throw new SDKError(ErrorCode[_0x134f66(0x1f3)],_0x519721[_0x134f66(0x1d2)]===_0x134f66(0x173)?_0x519721[_0x134f66(0x1bd)]:_0x134f66(0x1a2)+_0x40d9b7,undefined,{'helpText':_0x3ac448});}const {data:_0x5ac5df}=await withSpinner(_0x134f66(0x168),()=>_0xfb119f[_0x134f66(0x1c9)][_0x134f66(0x184)](_0x40d9b7,{'dryRun':!![]})),_0x377d48=_0x5ac5df[_0x134f66(0x1c5)]['agents'][_0x134f66(0x1fc)]>0x0;if(_0x377d48){console[_0x134f66(0x153)](a4_0x4bdfdb['red'](_0x134f66(0x1cd)));for(const _0x5525d7 of _0x5ac5df[_0x134f66(0x1ad)]){_0x5525d7[_0x134f66(0x156)]===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)]('\x20\x20Agent\x20\x22'+_0x5525d7[_0x134f66(0x170)]+'\x22:\x20'+_0x5525d7[_0x134f66(0x17d)]));}return 0x1;}const _0x1aa230=_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1ad)][_0x134f66(0x1ec)]+_0x5ac5df['counts']['knowledgeBases'][_0x134f66(0x1ec)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)][_0x134f66(0x1ec)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)]['created']+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x169)][_0x134f66(0x1ec)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x1ec)]+_0x5ac5df['counts']['experimentalArtifacts'][_0x134f66(0x1ec)],_0x3d1435=_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1ad)][_0x134f66(0x191)]+_0x5ac5df['counts'][_0x134f66(0x1fd)][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)]['integrations'][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x191)]+_0x5ac5df['counts'][_0x134f66(0x1d0)][_0x134f66(0x191)],_0x3b8d87=_0x5ac5df[_0x134f66(0x1c5)]['agents'][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1fd)][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)]['unchanged']+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x169)][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)]['unchanged']+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1d0)][_0x134f66(0x1ba)];console['log'](_0x134f66(0x1e9)+_0x5ac5df['projectName']+'\x27:'),console[_0x134f66(0x153)]('\x20\x20'+a4_0x4bdfdb[_0x134f66(0x176)]('+\x20'+_0x1aa230+_0x134f66(0x167))+_0x134f66(0x1a6)+a4_0x4bdfdb[_0x134f66(0x1d1)]('~\x20'+_0x3d1435+_0x134f66(0x157))+_0x134f66(0x1a6)+a4_0x4bdfdb[_0x134f66(0x1c7)]('=\x20'+_0x3b8d87+_0x134f66(0x1c8))),console['log'](_0x134f66(0x178)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1ad)])),console[_0x134f66(0x153)](_0x134f66(0x1f2)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1fd)])),console[_0x134f66(0x153)](_0x134f66(0x1db)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)])),console[_0x134f66(0x153)](_0x134f66(0x16e)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)]['integrations']));const _0x52039b=_0x5ac5df['counts']['experimentalKnowledgeBases'][_0x134f66(0x1ec)]>0x0||_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x191)]>0x0||_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x1ba)]>0x0||_0x5ac5df['counts'][_0x134f66(0x1d0)][_0x134f66(0x1ec)]>0x0||_0x5ac5df['counts'][_0x134f66(0x1d0)][_0x134f66(0x191)]>0x0||_0x5ac5df[_0x134f66(0x1c5)]['experimentalArtifacts'][_0x134f66(0x1ba)]>0x0;_0x52039b&&(console[_0x134f66(0x153)](_0x134f66(0x1a1)+formatCountSummary(_0x5ac5df['counts']['experimentalKnowledgeBases'])),console[_0x134f66(0x153)](_0x134f66(0x1fa)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1d0)])));console['log'](_0x134f66(0x18e)+a4_0x4bdfdb[_0x134f66(0x185)](_0x40d9b7)),displayDiffs(_0x5ac5df[_0x134f66(0x1ad)],_0x5ac5df[_0x134f66(0x1fd)],_0x5ac5df[_0x134f66(0x147)],_0x5ac5df[_0x134f66(0x197)],_0x5ac5df['integrations'],_0x5ac5df[_0x134f66(0x19a)],_0x5ac5df['experimentalArtifacts']);if(_0x3fec86)return console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1d1)](_0x134f66(0x1b6))),0x0;if(_0x1aa230===0x0&&_0x3d1435===0x0){console[_0x134f66(0x153)](a4_0x4bdfdb['green'](_0x134f66(0x200)));const _0x513d5b=getLLMProjectUrl(_0x5e185e,_0x5ac5df[_0x134f66(0x1c4)]);return console['log'](_0x134f66(0x1c6)+a4_0x4bdfdb[_0x134f66(0x185)](_0x513d5b)),0x0;}if(!_0x2b183d&&!_0x47bfed){if(!isInteractive())return console[_0x134f66(0x17d)](a4_0x4bdfdb[_0x134f66(0x163)]('\x0aError:'),_0x134f66(0x1c2)),console['error'](a4_0x4bdfdb[_0x134f66(0x1c7)](_0x134f66(0x1fb))),0x1;const _0x572680=await confirmKey('\x0aPush\x20'+(_0x1aa230+_0x3d1435)+'\x20resources?');if(!_0x572680)return console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1d1)]('Cancelled'),_0x134f66(0x16c)),0x1;}const {data:_0x505b56}=await withSpinner(_0x134f66(0x1f4),()=>_0xfb119f[_0x134f66(0x1c9)][_0x134f66(0x184)](_0x40d9b7,{'force':_0x47bfed})),_0x29e305=_0x505b56['counts'][_0x134f66(0x1ad)][_0x134f66(0x1fc)]>0x0||_0x505b56[_0x134f66(0x1c5)][_0x134f66(0x1fd)][_0x134f66(0x1fc)]>0x0||_0x505b56[_0x134f66(0x1c5)][_0x134f66(0x147)]['errors']>0x0||_0x505b56['counts'][_0x134f66(0x197)]['errors']>0x0;if(_0x29e305){console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1d1)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x134f66(0x153)](),console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x186)));for(const _0x23e97c of _0x505b56[_0x134f66(0x1ad)]){_0x23e97c[_0x134f66(0x156)]===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x174)+_0x23e97c[_0x134f66(0x170)]+_0x134f66(0x183)+_0x23e97c[_0x134f66(0x17d)]));}for(const _0x16a90d of _0x505b56[_0x134f66(0x1fd)]){_0x16a90d['action']===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x16a90d[_0x134f66(0x19f)]+_0x134f66(0x183)+_0x16a90d[_0x134f66(0x17d)]));}for(const _0x91c72 of _0x505b56[_0x134f66(0x147)]){_0x91c72[_0x134f66(0x156)]==='error'&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x1a8)+_0x91c72['name']+'\x22:\x20'+_0x91c72['error']));}for(const _0x2abb4d of _0x505b56['prompts']){_0x2abb4d['action']===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb['red'](_0x134f66(0x199)+_0x2abb4d[_0x134f66(0x19f)]+_0x134f66(0x183)+_0x2abb4d[_0x134f66(0x17d)]));}for(const _0x283699 of _0x505b56[_0x134f66(0x169)]){_0x283699[_0x134f66(0x156)]===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)]('\x20\x20Integration\x20\x22'+_0x283699[_0x134f66(0x19f)]+_0x134f66(0x183)+_0x283699[_0x134f66(0x17d)]));}return 0x1;}console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x176)]('\x0a✔\x20Pushed\x20'+(_0x1aa230+_0x3d1435)+'\x20resources\x20to\x20\x27'+_0x505b56[_0x134f66(0x177)]+'\x27'));const _0x334ce7=getLLMProjectUrl(_0x5e185e,_0x505b56[_0x134f66(0x1c4)]);return console[_0x134f66(0x153)](_0x134f66(0x1c6)+a4_0x4bdfdb[_0x134f66(0x185)](_0x334ce7)),0x0;}}
|
|
1
|
+
const a4_0x40b9c1=a4_0x51a1;(function(_0x597529,_0x2b9a49){const _0x320714=a4_0x51a1,_0x4e5824=_0x597529();while(!![]){try{const _0x54ddee=parseInt(_0x320714(0x10e))/0x1*(parseInt(_0x320714(0x147))/0x2)+parseInt(_0x320714(0xb3))/0x3*(-parseInt(_0x320714(0x158))/0x4)+-parseInt(_0x320714(0x14e))/0x5*(-parseInt(_0x320714(0xb1))/0x6)+parseInt(_0x320714(0xa6))/0x7*(-parseInt(_0x320714(0xa9))/0x8)+-parseInt(_0x320714(0xdb))/0x9*(-parseInt(_0x320714(0x116))/0xa)+-parseInt(_0x320714(0x135))/0xb*(-parseInt(_0x320714(0x11d))/0xc)+-parseInt(_0x320714(0xf5))/0xd*(parseInt(_0x320714(0x152))/0xe);if(_0x54ddee===_0x2b9a49)break;else _0x4e5824['push'](_0x4e5824['shift']());}catch(_0x1c1ce6){_0x4e5824['push'](_0x4e5824['shift']());}}}(a4_0x5b32,0x6c579));import a4_0x3397c1 from'chalk';import a4_0x2d596d 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(_0x205ae6){const _0x29890f=a4_0x51a1,_0x54481d=[];if(_0x205ae6[_0x29890f(0x13c)]!==undefined)_0x54481d[_0x29890f(0xbc)](_0x205ae6[_0x29890f(0x13c)]+_0x29890f(0xb5));if(_0x205ae6[_0x29890f(0x157)]!==undefined&&_0x205ae6[_0x29890f(0x157)]>0x0)_0x54481d['push'](a4_0x3397c1[_0x29890f(0xb9)](_0x205ae6[_0x29890f(0x157)]+_0x29890f(0xf9)));if(_0x205ae6[_0x29890f(0x102)]!==undefined&&_0x205ae6[_0x29890f(0x102)]>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1[_0x29890f(0xb9)](_0x205ae6[_0x29890f(0x102)]+_0x29890f(0xd6)));if(_0x205ae6[_0x29890f(0x112)]!==undefined&&_0x205ae6['updated']>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1[_0x29890f(0x137)](_0x205ae6['updated']+_0x29890f(0x140)));if(_0x205ae6['unchanged']!==undefined&&_0x205ae6[_0x29890f(0x13d)]>0x0)_0x54481d['push'](a4_0x3397c1[_0x29890f(0x150)](_0x205ae6[_0x29890f(0x13d)]+_0x29890f(0x11c)));if(_0x205ae6[_0x29890f(0xb4)]!==undefined&&_0x205ae6[_0x29890f(0xb4)]>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1['red'](_0x205ae6[_0x29890f(0xb4)]+'\x20errors'));return _0x54481d[_0x29890f(0xcd)](',\x20');}function a4_0x5b32(){const _0x142ad0=['description','-\x20no\x20files\x20written','llmProject','\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','isNew','session','agent:pull','join','cwd-config','red','profile','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Using\x20current\x20project:\x20','reason','llm','execute','\x20created','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Cloning\x20\x22','no_context','9LpbytD','\x20\x20Text\x20Knowledge\x20Bases:\x20','No\x20tdx.json\x20found\x20in\x20','\x0aWrite\x20','action','log','\x0aPush\x20summary\x20for\x20\x27','\x0a✔\x20Pulled\x20','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','force','prompts','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Prompt\x20\x22','hasChanges','<new-name>','cyan','Using\x20project\x20from\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aError:','\x22\x20to\x20\x22','Writing\x20files...','Output\x20path:\x20','parse','experimentalArtifacts','diff','143Kgwvaq','textKnowledgeBases','Source:\x20','\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','\x20new','dim','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Pushing\x20to\x20project...','sourceProjectName','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','knowledgeBases','agent:push','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','created','utf-8','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)','\x22\x20to\x20a\x20different\x20profile','cwd','name','output','Agent:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','newProjectId','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x22...','189194EqaDfc','Output:\x20','Dry\x20run\x20-\x20no\x20files\x20written','pushAgent','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Would\x20clone:','llm_project','2025130yoXWNG','\x20\x20tdx\x20agent\x20pull\x20','\x0aPull\x20summary\x20for\x20\x27','agentId','outputPath','\x0aPush\x20','\x20unchanged','804qmeqKV','\x20\x20Integration\x20\x22','Project\x20cloned\x20successfully','Status:\x20','\x20--name\x20','\x20--profile\x20','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Prompts:\x20','Would\x20pull\x20agent:\x20','\x20=\x20','\x0aErrors\x20found:','outputDir','✔\x20Context\x20set:\x20','New\x20project\x20ID:\x20','dirname','agentName','Using\x20project\x20from\x20context:\x20','Agent\x20pulled\x20successfully','Clone\x20\x22','\x20resources?','\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)','yes','Project\x20cloned\x20with\x20errors','50017SJykXT','\x20changed','yellow','experimentalKnowledgeBases','\x0a✔\x20Pushed\x20','error','\x20\x20Experimental\x20Artifact\x20\x22','total','unchanged','\x20successfully','found','\x20updated','\x20\x20Knowledge\x20Bases:\x20','context','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','newProjectName','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','arg-dir','8OLUDyT','agents','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20tdx\x20agent\x20clone\x20agents/','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','projectName','message','4835vwtciw','pushProject','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','632352rjtRoj','pullAgent','dryRun','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Source:\x20','new','2100516RLmnfq','Analyzing\x20changes\x20to\x20push...','Using\x20context\x20project:\x20','Would\x20push\x20agent:\x20','INVALID_ARGUMENT','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aChanges:','tdx.json','source','integrations','projectId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','184079puwwvt','agent.yml','\x20|\x20','136EUMsrm','counts','agent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','New\x20project:\x20','\x20\x20Agents:\x20','Errors:','Using\x20project:\x20','4026bMDAzh','\x20\x20Knowledge\x20Base\x20\x22','3ZYmoMx','errors','\x20total','Pushing\x20agent\x20from\x20\x22','cloneProject','site','green','Summary:','Project:\x20','push','Dry\x20run\x20-\x20no\x20changes\x20made','Cancelled','Failed\x20to\x20push\x20agent:\x20','\x20\x20Agent\x20\x22','repeat','agent:clone','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date'];a4_0x5b32=function(){return _0x142ad0;};return a4_0x5b32();}function displayDiffs(_0x51daf5,_0x5ba373,_0x3740a0,_0x43e946,_0x1b79ca,_0x22c353,_0x25c097){const _0x3292ac=a4_0x51a1;for(const _0x45e269 of _0x51daf5){if(_0x45e269['diff']){const _0x2bec3d=_0x45e269[_0x3292ac(0x12d)]||_0x45e269[_0x3292ac(0x107)];console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2bec3d+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console['log'](_0x45e269['diff']),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c));}}for(const _0x547ca7 of _0x5ba373){_0x547ca7[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xd7)+_0x547ca7[_0x3292ac(0x107)]+'\x27:'),console['log']('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x547ca7[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)));}for(const _0x11f5f8 of _0x3740a0){_0x11f5f8[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xc3)+_0x11f5f8['name']+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x11f5f8[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)));}for(const _0x3383a6 of _0x43e946){_0x3383a6[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xe4)+_0x3383a6[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console['log'](_0x3383a6[_0x3292ac(0xf4)]),console['log']('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0xd8008a of _0x1b79ca){_0xd8008a['diff']&&(console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20integration\x20\x27'+_0xd8008a[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)),console['log'](_0xd8008a[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0x34b091 of _0x22c353){_0x34b091[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xd1)+_0x34b091[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x34b091[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0x297521 of _0x25c097){_0x297521[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x297521[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x297521[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}}function a4_0x51a1(_0x32f2a9,_0x37e0f0){_0x32f2a9=_0x32f2a9-0xa4;const _0x5b3209=a4_0x5b32();let _0x51a12e=_0x5b3209[_0x32f2a9];return _0x51a12e;}export class AgentPullCommand extends BaseCommand{[a4_0x40b9c1(0x107)]=a4_0x40b9c1(0xcc);[a4_0x40b9c1(0xc6)]=a4_0x40b9c1(0x14b);async['execute'](_0x2cd33f){const _0x313275=a4_0x40b9c1,{options:_0x428604,args:_0x5ec7f3,tdx:_0x5e6eb5}=_0x2cd33f,_0x113e9b=_0x5ec7f3[0x0],_0x331915=_0x5ec7f3[0x1],_0x45b1bd=_0x428604[_0x313275(0x108)],_0x1d1d20=_0x428604['dryRun'],_0xf0fa09=_0x428604['force'],_0x4e22a7=_0x428604[_0x313275(0x133)],_0x4888f8=_0x428604[_0x313275(0xc8)],_0x298f93=_0x428604[_0x313275(0xab)];let _0x1c57a7;if(_0x113e9b){const _0x512a3b=a4_0x2d596d[_0x313275(0xcd)](_0x113e9b,_0x313275(0x15f));if(existsSync(_0x512a3b))try{const _0x313189=JSON[_0x313275(0xf2)](readFileSync(_0x512a3b,_0x313275(0x103)));_0x313189[_0x313275(0x115)]&&(_0x1c57a7={'llm_project':_0x313189[_0x313275(0x115)]});}catch{}}const _0x49a52b=findAgentConfigPath(process[_0x313275(0x106)]());let _0x4253aa;if(_0x49a52b)try{const _0x5085f2=JSON[_0x313275(0xf2)](readFileSync(_0x49a52b,_0x313275(0x103)));_0x5085f2[_0x313275(0x115)]&&(_0x4253aa={'llm_project':_0x5085f2['llm_project']});}catch{}const _0x3b7a2f=resolveAgentPullArgs({'arg':_0x113e9b,'agentNameArg':_0x331915,'agentFlag':_0x298f93,'contextProject':_0x4888f8,'argDirConfig':_0x1c57a7,'cwdConfigPath':_0x49a52b||undefined,'cwdConfig':_0x4253aa}),{projectNameOrId:_0xe30c68,targetAgentName:_0x29bd90,existingOutputDir:_0x2febe9,source:_0x5d5f65}=_0x3b7a2f;if(_0x5d5f65===_0x313275(0x146))console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0xec)+a4_0x2d596d['join'](_0x113e9b,'tdx.json')+':\x20'+_0xe30c68));else{if(_0x5d5f65===_0x313275(0xce))console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0xb0)+_0xe30c68));else _0x5d5f65===_0x313275(0x142)&&console['log'](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0x12e)+_0xe30c68));}if(!_0xe30c68)return _0x298f93?(console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x313275(0xe0)](_0x313275(0x10c)),console[_0x313275(0xe0)](_0x313275(0xac))):(console[_0x313275(0xe0)](a4_0x3397c1['yellow'](_0x313275(0x101))),console[_0x313275(0xe0)](_0x313275(0x104)),console[_0x313275(0xe0)](_0x313275(0xe7)),console[_0x313275(0xe0)](_0x313275(0xc9)),console[_0x313275(0xe0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x313275(0xe0)](_0x313275(0xf8))),0x1;if(_0x29bd90){const {data:_0x3e41c2}=await withSpinner('Pulling\x20agent\x20\x22'+_0x29bd90+'\x22\x20from\x20project\x20\x22'+_0xe30c68+_0x313275(0x10d),()=>_0x5e6eb5['llm'][_0x313275(0x153)](_0xe30c68,_0x29bd90,_0x45b1bd,{'dryRun':_0x1d1d20,'force':_0xf0fa09}));if(_0x1d1d20)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)](_0x313275(0x110))),console[_0x313275(0xe0)](_0x313275(0x126)+_0x3e41c2[_0x313275(0x12d)]),console[_0x313275(0xe0)](_0x313275(0xf1)+_0x3e41c2[_0x313275(0x11a)]),_0x3e41c2[_0x313275(0xf4)]&&(console[_0x313275(0xe0)](_0x313275(0x15e)),console[_0x313275(0xe0)]('─'[_0x313275(0xc1)](0x3c)),console['log'](_0x3e41c2[_0x313275(0xf4)]),console[_0x313275(0xe0)]('─'[_0x313275(0xc1)](0x3c))),0x0;return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12f))),console[_0x313275(0xe0)](_0x313275(0x109)+_0x3e41c2[_0x313275(0x12d)]),console[_0x313275(0xe0)](_0x313275(0x10f)+_0x3e41c2[_0x313275(0x11a)]),console[_0x313275(0xe0)](_0x313275(0x120)+(_0x3e41c2[_0x313275(0xca)]?a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x157)):_0x3e41c2[_0x313275(0xe9)]?a4_0x3397c1['yellow'](_0x313275(0x112)):a4_0x3397c1['gray']('unchanged'))),0x0;}const _0x574a07=_0x2febe9||_0x45b1bd,{data:_0x4b55f4}=await withSpinner('Analyzing\x20project\x20\x22'+_0xe30c68+_0x313275(0x10d),()=>_0x5e6eb5[_0x313275(0xd4)][_0x313275(0x123)](_0xe30c68,_0x574a07,{'dryRun':!![]})),_0x5cb9a1=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x157)]+_0x4b55f4[_0x313275(0xaa)]['knowledgeBases']['new']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)][_0x313275(0x157)]+_0x4b55f4['counts']['prompts']['new']+_0x4b55f4['counts']['integrations']['new']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x157)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf3)][_0x313275(0x157)],_0x2196b7=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x112)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xff)]['updated']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)]['updated']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xe6)][_0x313275(0x112)]+_0x4b55f4['counts'][_0x313275(0x161)][_0x313275(0x112)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x112)]+_0x4b55f4['counts'][_0x313275(0xf3)][_0x313275(0x112)],_0x15d389=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xff)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)]['textKnowledgeBases']['unchanged']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xe6)]['unchanged']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x161)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)]['experimentalArtifacts'][_0x313275(0x13d)];console[_0x313275(0xe0)](_0x313275(0x118)+_0x4b55f4[_0x313275(0x14c)]+'\x27:'),console[_0x313275(0xe0)]('\x20\x20'+a4_0x3397c1['green']('+\x20'+_0x5cb9a1+_0x313275(0xf9))+'\x20|\x20'+a4_0x3397c1[_0x313275(0x137)]('~\x20'+_0x2196b7+_0x313275(0x136))+'\x20|\x20'+a4_0x3397c1['dim']('=\x20'+_0x15d389+_0x313275(0x11c))),console[_0x313275(0xe0)](_0x313275(0xae)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['agents'])),console['log'](_0x313275(0x141)+formatCountSummary(_0x4b55f4['counts'][_0x313275(0xff)])),console[_0x313275(0xe0)](_0x313275(0xdc)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)])),console[_0x313275(0xe0)](_0x313275(0x125)+formatCountSummary(_0x4b55f4['counts'][_0x313275(0xe6)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['integrations']));const _0x368704=_0x4b55f4[_0x313275(0xaa)]['experimentalKnowledgeBases']['total']>0x0||_0x4b55f4['counts']['experimentalArtifacts'][_0x313275(0x13c)]>0x0;_0x368704&&(console['log'](_0x313275(0x143)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['experimentalKnowledgeBases'])),console[_0x313275(0xe0)](_0x313275(0x124)+formatCountSummary(_0x4b55f4['counts']['experimentalArtifacts'])));console['log']('\x20\x20Target:\x20'+a4_0x3397c1[_0x313275(0xeb)](_0x4b55f4['outputDir'])),displayDiffs(_0x4b55f4['agents'],_0x4b55f4[_0x313275(0xff)],_0x4b55f4['textKnowledgeBases'],_0x4b55f4['prompts'],_0x4b55f4[_0x313275(0x161)],_0x4b55f4[_0x313275(0x138)],_0x4b55f4[_0x313275(0xf3)]);if(_0x1d1d20)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5cb9a1===0x0&&_0x2196b7===0x0)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0xc5))),saveSessionContext({'llm_project':_0x4b55f4[_0x313275(0x14c)]},_0x428604['session']),console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12a)+a4_0x3397c1['dim'](_0x313275(0x115))+_0x313275(0x127)+a4_0x3397c1[_0x313275(0xeb)](_0x4b55f4[_0x313275(0x14c)]))),0x0;if(!_0x4e22a7&&!_0xf0fa09){if(!isInteractive())return console[_0x313275(0x13a)](a4_0x3397c1['red'](_0x313275(0xee)),_0x313275(0x113)),console[_0x313275(0x13a)](a4_0x3397c1['dim'](_0x313275(0x149))),0x1;const _0x2d3b3b=await confirmKey(_0x313275(0xde)+(_0x5cb9a1+_0x2196b7)+'\x20files?');if(!_0x2d3b3b)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('Cancelled'),_0x313275(0xc7)),0x1;}const {data:_0x131d3e}=await withSpinner(_0x313275(0xf0),()=>_0x5e6eb5[_0x313275(0xd4)][_0x313275(0x123)](_0xe30c68,_0x574a07,{'force':_0xf0fa09}));return console[_0x313275(0xe0)](a4_0x3397c1['green'](_0x313275(0xe2)+(_0x5cb9a1+_0x2196b7)+'\x20files\x20to\x20'+_0x131d3e[_0x313275(0x129)])),saveSessionContext({'llm_project':_0x131d3e[_0x313275(0x14c)]},_0x428604[_0x313275(0xcb)]),console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12a)+a4_0x3397c1[_0x313275(0xfa)](_0x313275(0x115))+'\x20=\x20'+a4_0x3397c1[_0x313275(0xeb)](_0x131d3e[_0x313275(0x14c)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x40b9c1(0x107)]=a4_0x40b9c1(0xc2);[a4_0x40b9c1(0xc6)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x40b9c1(0xd5)](_0x4e7028){const _0x148871=a4_0x40b9c1,{options:_0x276328,args:_0x50f395,tdx:_0x32af8b}=_0x4e7028,_0xff8d65=_0x50f395[0x0],_0x3eecca=_0x276328[_0x148871(0x107)],_0x1028e3=_0x276328['dryRun'],_0x40cfed=_0x276328[_0x148871(0x133)],_0x377350=_0x276328['site'],_0x3b3d73=_0x276328[_0x148871(0xc8)];let _0x453d4d;const _0x91a4=findAgentConfigPath(process[_0x148871(0x106)]());if(_0xff8d65){const _0x1b8dc3=a4_0x2d596d['join'](_0xff8d65,_0x148871(0x15f));existsSync(_0x1b8dc3)?(_0x453d4d=_0xff8d65,console['log'](a4_0x3397c1['dim']('Using\x20local\x20project:\x20'+_0xff8d65))):_0x453d4d=_0xff8d65;}else{if(_0x91a4)_0x453d4d=a4_0x2d596d[_0x148871(0x12c)](_0x91a4),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xfa)](_0x148871(0xd2)+_0x453d4d));else{if(_0x3b3d73){const _0x5918dc=sanitizeForFilesystem(_0x3b3d73);let _0x3fcf15=_0x5918dc,_0x27269f=a4_0x2d596d['join'](process[_0x148871(0x106)](),_0x148871(0x148),_0x5918dc,_0x148871(0x15f));if(!existsSync(_0x27269f)){const _0x3e0d61=normalizeName(_0x3b3d73),_0x480228=a4_0x2d596d[_0x148871(0xcd)](process[_0x148871(0x106)](),_0x148871(0x148),_0x3e0d61,_0x148871(0x15f));existsSync(_0x480228)&&(_0x3fcf15=_0x3e0d61,_0x27269f=_0x480228);}if(existsSync(_0x27269f))_0x453d4d=a4_0x2d596d[_0x148871(0x12c)](_0x27269f),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xfa)]('Using\x20local\x20project:\x20'+_0x453d4d));else{const _0x418be9=_0x276328[_0x148871(0xd0)];if(_0x418be9)throw new SDKError(ErrorCode[_0x148871(0x15c)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3b3d73+_0x148871(0x105),undefined,{'helpText':_0x148871(0xed)+_0x148871(0x10a)+(_0x148871(0x117)+_0x3b3d73+'\x0a')+(_0x148871(0x14a)+_0x3fcf15+_0x148871(0x121)+(_0x3eecca||_0x148871(0xea))+_0x148871(0x122)+_0x418be9)});_0x453d4d=_0x3b3d73,console[_0x148871(0xe0)](a4_0x3397c1['dim'](_0x148871(0x15a)+_0x3b3d73));}}}}if(!_0x453d4d)return console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0x137)](_0x148871(0xa5))),console[_0x148871(0xe0)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x148871(0xe0)](_0x148871(0x155)),console[_0x148871(0xe0)](_0x148871(0x132)),console[_0x148871(0xe0)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3eecca)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x148871(0xfe)});if(!_0x40cfed&&!_0x1028e3){if(!isInteractive())return console['error'](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xee)),_0x148871(0x113)),console['error'](a4_0x3397c1['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x27bf4b=await confirmKey(_0x148871(0x130)+_0x453d4d+_0x148871(0xe3)+_0x3eecca+'\x22?');if(!_0x27bf4b)return console['log'](a4_0x3397c1[_0x148871(0x137)](_0x148871(0xbe))),0x1;}const {data:_0x246c8f}=await withSpinner(_0x148871(0xd9)+_0x453d4d+_0x148871(0xef)+_0x3eecca+'\x22...',()=>_0x32af8b[_0x148871(0xd4)][_0x148871(0xb7)](_0x453d4d,_0x3eecca,{'dryRun':_0x1028e3}));if(_0x1028e3){console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0x137)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log']('Source:\x20'+_0x246c8f[_0x148871(0xfd)]),console['log'](_0x148871(0xad)+_0x3eecca),console['log'](_0x148871(0x114)),console[_0x148871(0xe0)](_0x148871(0xae)+_0x246c8f[_0x148871(0xaa)]['agents'][_0x148871(0x102)]),console['log'](_0x148871(0x141)+_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)][_0x148871(0x102)]),console[_0x148871(0xe0)](_0x148871(0x125)+_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)]['created']);const _0x1368ef=_0x246c8f['counts'][_0x148871(0x138)]['created']>0x0||_0x246c8f['counts'][_0x148871(0xf3)][_0x148871(0x102)]>0x0;return _0x1368ef&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x246c8f['counts']['experimentalKnowledgeBases'][_0x148871(0x102)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x102)])),0x0;}const _0x546fd4=_0x246c8f[_0x148871(0xaa)][_0x148871(0x148)][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)]['errors']>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)]['experimentalKnowledgeBases'][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)]['experimentalArtifacts'][_0x148871(0xb4)]>0x0;_0x546fd4?console['log'](a4_0x3397c1[_0x148871(0x137)](_0x148871(0x134))):console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xb9)](_0x148871(0x11f)));console[_0x148871(0xe0)](_0x148871(0xf7)+_0x246c8f['sourceProjectName']),console[_0x148871(0xe0)](_0x148871(0xad)+_0x246c8f[_0x148871(0x144)]),console[_0x148871(0xe0)](_0x148871(0x12b)+_0x246c8f[_0x148871(0x10b)]),console[_0x148871(0xe0)](),console[_0x148871(0xe0)](_0x148871(0xba)),console[_0x148871(0xe0)](_0x148871(0xae)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x148)])),console[_0x148871(0xe0)](_0x148871(0x141)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)])),console[_0x148871(0xe0)](_0x148871(0x125)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)])),console[_0x148871(0xe0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x161)]));const _0x434f79=_0x246c8f[_0x148871(0xaa)]['experimentalKnowledgeBases'][_0x148871(0x102)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)][_0x148871(0x112)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)][_0x148871(0x13d)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x102)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x112)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x13d)]>0x0;_0x434f79&&(console[_0x148871(0xe0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)])),console[_0x148871(0xe0)](_0x148871(0x124)+formatCountSummary(_0x246c8f[_0x148871(0xaa)]['experimentalArtifacts'])));if(_0x546fd4){console[_0x148871(0xe0)](),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xaf)));for(const _0x10d02c of _0x246c8f[_0x148871(0x148)]){_0x10d02c['action']==='error'&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xc0)+_0x10d02c[_0x148871(0x12d)]+_0x148871(0xc4)+_0x10d02c[_0x148871(0x13a)]));}for(const _0x5e6567 of _0x246c8f[_0x148871(0xff)]){_0x5e6567[_0x148871(0xdf)]==='error'&&console['log'](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xb2)+_0x5e6567[_0x148871(0x107)]+_0x148871(0xc4)+_0x5e6567[_0x148871(0x13a)]));}for(const _0x4af607 of _0x246c8f['prompts']){_0x4af607[_0x148871(0xdf)]==='error'&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)]('\x20\x20Prompt\x20\x22'+_0x4af607[_0x148871(0x107)]+'\x22:\x20'+_0x4af607[_0x148871(0x13a)]));}for(const _0x5e9dde of _0x246c8f[_0x148871(0x161)]){_0x5e9dde[_0x148871(0xdf)]===_0x148871(0x13a)&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0x11e)+_0x5e9dde[_0x148871(0x107)]+_0x148871(0xc4)+_0x5e9dde[_0x148871(0x13a)]));}for(const _0xe7879d of _0x246c8f[_0x148871(0x138)]){_0xe7879d[_0x148871(0xdf)]===_0x148871(0x13a)&&console[_0x148871(0xe0)](a4_0x3397c1['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0xe7879d['name']+'\x22:\x20'+_0xe7879d['error']));}for(const _0x49ad2e of _0x246c8f[_0x148871(0xf3)]){_0x49ad2e[_0x148871(0xdf)]==='error'&&console[_0x148871(0xe0)](a4_0x3397c1['red'](_0x148871(0x13b)+_0x49ad2e[_0x148871(0x107)]+_0x148871(0xc4)+_0x49ad2e[_0x148871(0x13a)]));}return 0x1;}console['log']();const _0x652d15=getLLMProjectUrl(_0x377350,_0x246c8f['newProjectId']);return console['log'](_0x148871(0xbb)+a4_0x3397c1[_0x148871(0xeb)](_0x652d15)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x40b9c1(0x100);[a4_0x40b9c1(0xc6)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0x5a7a9){const _0x587577=a4_0x40b9c1,{options:_0x22377f,args:_0x27ed13,tdx:_0x47c3d5}=_0x5a7a9;let _0x549d1e=_0x27ed13[0x0]||process[_0x587577(0x106)]();const _0x34d4fa=_0x22377f[_0x587577(0x154)],_0x468dc3=_0x22377f[_0x587577(0xe5)],_0x46a4de=_0x22377f[_0x587577(0x133)],_0x30f4ce=_0x22377f[_0x587577(0xb8)],_0x1e930d=a4_0x2d596d[_0x587577(0xcd)](_0x549d1e,_0x587577(0xa7)),_0x25642a=existsSync(_0x1e930d);if(_0x25642a){const {data:_0x5035a1}=await withSpinner(_0x587577(0xb6)+_0x549d1e+_0x587577(0x10d),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x111)](_0x549d1e,{'dryRun':_0x34d4fa,'force':_0x468dc3}));if(_0x34d4fa)return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0x137)](_0x587577(0xbd))),console['log'](_0x587577(0x15b)+_0x5035a1[_0x587577(0x12d)]),0x0;if(_0x5035a1[_0x587577(0xdf)]==='error')return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xbf)+_0x5035a1[_0x587577(0x13a)])),0x1;console['log'](a4_0x3397c1[_0x587577(0xb9)]('Agent\x20'+_0x5035a1[_0x587577(0xdf)]+_0x587577(0x13e))),console['log'](_0x587577(0x109)+_0x5035a1[_0x587577(0x12d)]);if(_0x5035a1['agentId']&&_0x5035a1[_0x587577(0xa4)]){const _0x48190d=getLLMAgentChatUrl(_0x30f4ce,_0x5035a1['projectId'],_0x5035a1[_0x587577(0x119)]);console[_0x587577(0xe0)]('Chat:\x20'+a4_0x3397c1[_0x587577(0xeb)](_0x48190d));}return 0x0;}const _0x8187c1=_0x22377f['llmProject'],_0x126b81=resolveProjectFromContext(_0x549d1e,_0x8187c1);if(_0x126b81[_0x587577(0x13f)])_0x549d1e=_0x126b81['projectDir'],_0x126b81[_0x587577(0x160)]===_0x587577(0x142)&&console['log'](a4_0x3397c1[_0x587577(0xfa)](_0x587577(0xb0)+_0x549d1e));else{let _0xda14b0=_0x587577(0x145);_0x126b81[_0x587577(0xd3)]==='no_local_folder'&&(_0xda14b0=_0x126b81[_0x587577(0x14d)]+_0x587577(0xd8)+_0x126b81[_0x587577(0xc8)]+_0x587577(0x151));throw new SDKError(ErrorCode[_0x587577(0x15c)],_0x126b81['reason']===_0x587577(0xda)?_0x126b81[_0x587577(0x14d)]:_0x587577(0xdd)+_0x549d1e,undefined,{'helpText':_0xda14b0});}const {data:_0x4a4d86}=await withSpinner(_0x587577(0x159),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x14f)](_0x549d1e,{'dryRun':!![]})),_0xd20d07=_0x4a4d86['counts'][_0x587577(0x148)]['errors']>0x0;if(_0xd20d07){console['log'](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0x128)));for(const _0x43be70 of _0x4a4d86['agents']){_0x43be70[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1['red'](_0x587577(0xc0)+_0x43be70[_0x587577(0x12d)]+_0x587577(0xc4)+_0x43be70[_0x587577(0x13a)]));}return 0x1;}const _0x499033=_0x4a4d86['counts']['agents'][_0x587577(0x102)]+_0x4a4d86['counts'][_0x587577(0xff)]['created']+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0x161)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x102)],_0x57f4c4=_0x4a4d86['counts'][_0x587577(0x148)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)][_0x587577(0x112)]+_0x4a4d86['counts'][_0x587577(0x161)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)]['experimentalKnowledgeBases'][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)][_0x587577(0x112)],_0x249252=_0x4a4d86[_0x587577(0xaa)][_0x587577(0x148)][_0x587577(0x13d)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)]['unchanged']+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)]['unchanged']+_0x4a4d86[_0x587577(0xaa)]['prompts'][_0x587577(0x13d)]+_0x4a4d86['counts']['integrations']['unchanged']+_0x4a4d86[_0x587577(0xaa)]['experimentalKnowledgeBases'][_0x587577(0x13d)]+_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x13d)];console[_0x587577(0xe0)](_0x587577(0xe1)+_0x4a4d86[_0x587577(0x14c)]+'\x27:'),console[_0x587577(0xe0)]('\x20\x20'+a4_0x3397c1[_0x587577(0xb9)]('+\x20'+_0x499033+_0x587577(0xf9))+'\x20|\x20'+a4_0x3397c1[_0x587577(0x137)]('~\x20'+_0x57f4c4+_0x587577(0x136))+_0x587577(0xa8)+a4_0x3397c1['dim']('=\x20'+_0x249252+_0x587577(0x11c))),console[_0x587577(0xe0)](_0x587577(0xae)+formatCountSummary(_0x4a4d86['counts'][_0x587577(0x148)])),console[_0x587577(0xe0)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)])),console['log'](_0x587577(0xdc)+formatCountSummary(_0x4a4d86['counts'][_0x587577(0xf6)])),console[_0x587577(0xe0)](_0x587577(0x125)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)])),console[_0x587577(0xe0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4a4d86[_0x587577(0xaa)]['integrations']));const _0x4620a4=_0x4a4d86['counts'][_0x587577(0x138)]['created']>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)]['updated']>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)][_0x587577(0x13d)]>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)]['created']>0x0||_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x112)]>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)][_0x587577(0x13d)]>0x0;_0x4620a4&&(console['log'](_0x587577(0x143)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)])),console['log'](_0x587577(0x124)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)])));console[_0x587577(0xe0)](_0x587577(0x156)+a4_0x3397c1[_0x587577(0xeb)](_0x549d1e)),displayDiffs(_0x4a4d86['agents'],_0x4a4d86['knowledgeBases'],_0x4a4d86[_0x587577(0xf6)],_0x4a4d86['prompts'],_0x4a4d86[_0x587577(0x161)],_0x4a4d86[_0x587577(0x138)],_0x4a4d86[_0x587577(0xf3)]);if(_0x34d4fa)return console['log'](a4_0x3397c1[_0x587577(0x137)](_0x587577(0xfb))),0x0;if(_0x499033===0x0&&_0x57f4c4===0x0){console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xb9)](_0x587577(0x15d)));const _0xe2a728=getLLMProjectUrl(_0x30f4ce,_0x4a4d86[_0x587577(0xa4)]);return console[_0x587577(0xe0)](_0x587577(0xbb)+a4_0x3397c1[_0x587577(0xeb)](_0xe2a728)),0x0;}if(!_0x46a4de&&!_0x468dc3){if(!isInteractive())return console[_0x587577(0x13a)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xee)),_0x587577(0x113)),console[_0x587577(0x13a)](a4_0x3397c1[_0x587577(0xfa)](_0x587577(0x149))),0x1;const _0x342eb6=await confirmKey(_0x587577(0x11b)+(_0x499033+_0x57f4c4)+_0x587577(0x131));if(!_0x342eb6)return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0x137)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x17345f}=await withSpinner(_0x587577(0xfc),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x14f)](_0x549d1e,{'force':_0x468dc3})),_0x3d8242=_0x17345f[_0x587577(0xaa)][_0x587577(0x148)][_0x587577(0xb4)]>0x0||_0x17345f[_0x587577(0xaa)]['knowledgeBases'][_0x587577(0xb4)]>0x0||_0x17345f['counts']['textKnowledgeBases'][_0x587577(0xb4)]>0x0||_0x17345f[_0x587577(0xaa)][_0x587577(0xe6)]['errors']>0x0;if(_0x3d8242){console['log'](a4_0x3397c1[_0x587577(0x137)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x587577(0xe0)](a4_0x3397c1['red'](_0x587577(0xaf)));for(const _0x2fe4f1 of _0x17345f[_0x587577(0x148)]){_0x2fe4f1[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)]('\x20\x20Agent\x20\x22'+_0x2fe4f1[_0x587577(0x12d)]+_0x587577(0xc4)+_0x2fe4f1[_0x587577(0x13a)]));}for(const _0x3d7dc8 of _0x17345f['knowledgeBases']){_0x3d7dc8['action']===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xb2)+_0x3d7dc8[_0x587577(0x107)]+'\x22:\x20'+_0x3d7dc8['error']));}for(const _0x3fdcfb of _0x17345f[_0x587577(0xf6)]){_0x3fdcfb[_0x587577(0xdf)]==='error'&&console['log'](a4_0x3397c1[_0x587577(0xcf)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x3fdcfb[_0x587577(0x107)]+_0x587577(0xc4)+_0x3fdcfb[_0x587577(0x13a)]));}for(const _0x492798 of _0x17345f['prompts']){_0x492798[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xe8)+_0x492798[_0x587577(0x107)]+_0x587577(0xc4)+_0x492798[_0x587577(0x13a)]));}for(const _0x55903b of _0x17345f['integrations']){_0x55903b[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0x11e)+_0x55903b[_0x587577(0x107)]+_0x587577(0xc4)+_0x55903b[_0x587577(0x13a)]));}return 0x1;}console[_0x587577(0xe0)](a4_0x3397c1['green'](_0x587577(0x139)+(_0x499033+_0x57f4c4)+'\x20resources\x20to\x20\x27'+_0x17345f[_0x587577(0x14c)]+'\x27'));const _0x122637=getLLMProjectUrl(_0x30f4ce,_0x17345f[_0x587577(0xa4)]);return console[_0x587577(0xe0)](_0x587577(0xbb)+a4_0x3397c1['cyan'](_0x122637)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x2d676e=a5_0x12ec;(function(_0x5f14dd,_0x337747){const _0x363ed6=a5_0x12ec,_0x1c832f=_0x5f14dd();while(!![]){try{const _0x4a6b80=parseInt(_0x363ed6(0x226))/0x1*(-parseInt(_0x363ed6(0x23f))/0x2)+parseInt(_0x363ed6(0x216))/0x3*(-parseInt(_0x363ed6(0x249))/0x4)+parseInt(_0x363ed6(0x24e))/0x5+parseInt(_0x363ed6(0x224))/0x6*(parseInt(_0x363ed6(0x21b))/0x7)+parseInt(_0x363ed6(0x1dd))/0x8*(-parseInt(_0x363ed6(0x1d7))/0x9)+-parseInt(_0x363ed6(0x205))/0xa+parseInt(_0x363ed6(0x1d8))/0xb;if(_0x4a6b80===_0x337747)break;else _0x1c832f['push'](_0x1c832f['shift']());}catch(_0x370eb0){_0x1c832f['push'](_0x1c832f['shift']());}}}(a5_0x3bc8,0xa811b));import*as a5_0x2a8738 from'node:fs';import*as a5_0x5ebcc7 from'node:path';import a5_0x1bff63 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x3bc8(){const _0x25bd9e=['Test\x20','testName','Test\x20Configuration:','\x20\x20Site:\x20','dryRun','repeat','Site:\x20','projectName','Round\x20','\x20\x20Agent:\x20','Agent:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','reeval','agent','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','some','Cached\x20run\x20is\x20from\x20site\x20\x22','start','Project\x20path:\x20','testYmlPath','2360277deADrK','34361899QwDfrA','basename','FAIL','length','Run\x20tests\x20for\x20an\x20LLM\x20agent','40oufKnN','Either\x20switch\x20to\x20the\x20\x22','\x20-\x20','✗\x20ERROR:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','status','verbose','Conversation\x20URL:\x20','stop','ERROR','context','PASS','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','conversation_url','Passed:\x20\x20\x20','name','agentDirs','\x20\x20Round\x20','join','Running:\x20','utf-8','toLowerCase','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','round','red','push','Usage:','json','rounds','✗\x20FAIL:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','reason','description','Round\x201/','yellow','has','Errors:\x20\x20\x20','resolveAgentId','12764890iIZfFH','\x22:\x20','Output\x20written\x20to:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','dim','...\x20','isSpinning','\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','\x20(new)','tsv','log','forEach','Test\x20Summary','\x20(cached)',':\x20Sending\x20user\x20input...','text','/<agent-name>','3jtefDC','Error\x20writing\x20output\x20file:\x20','not\x20found','Available\x20tests:\x20','table','7PLtfTR','site','conversations','execute','\x20\x20Evaluating...\x20','Tests\x20found:\x20','Duration:\x20','Executing\x20new\x20tests...','tags','2372082jqLlxC','no_tests','417592CqmsNT','No\x20tests\x20found\x20matching:\x20','Failed:\x20\x20\x20','Run\x20\x27tdx\x20agent\x20pull\x20','resolve','Available\x20tags:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','executeReeval','message','substring','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\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)','add','\x20\x20Conversation:\x20','Evaluating\x20response...','llm','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_local_folder','projectDir','Total:\x20\x20\x20\x20','404','existsSync','find','test.yml','map','4iKCWOb','tests','llmProject','agentName','⚠\x20SKIPPED:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20Project:\x20','no_context','jsonl','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','1208780WFUMrg','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','now','white','4471940elRkqn','Re-evaluating\x20cached\x20test\x20run...','resolveProjectId','✓\x20PASS:\x20','split','includes','size','timestamp','agent:test','New\x20tests\x20to\x20execute:\x20','toISOString','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','trim','Re-evaluating\x20','writeFileSync','Running\x20test:\x20','...','Failed\x20Tests:','green','filter','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','source'];a5_0x3bc8=function(){return _0x25bd9e;};return a5_0x3bc8();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x12ec(_0x211d61,_0x420380){_0x211d61=_0x211d61-0x1b1;const _0x3bc89c=a5_0x3bc8();let _0x12ecaa=_0x3bc89c[_0x211d61];return _0x12ecaa;}export class AgentTestCommand extends BaseCommand{['name']=a5_0x2d676e(0x1b5);[a5_0x2d676e(0x1ff)]=a5_0x2d676e(0x1dc);async[a5_0x2d676e(0x21e)](_0x32232e){const _0xd2424e=a5_0x2d676e,{options:_0xa00e2b,args:_0x25feb2,tdx:_0x22ac6f}=_0x32232e,_0x243d74=_0x25feb2[0x0]||'.',_0x3f3965=_0xa00e2b[_0xd2424e(0x1c7)],_0x177ce5=_0xa00e2b,_0xefddd7=_0x177ce5['eval']===![],_0x2092e1=_0x177ce5[_0xd2424e(0x1cf)],_0x57fe7d=_0x177ce5[_0xd2424e(0x1ec)],_0x17342b=_0x177ce5[_0xd2424e(0x223)],_0x505a34=_0xa00e2b[_0xd2424e(0x21c)],_0x1f2261=_0x177ce5['output'];if(_0x2092e1&&_0xefddd7)return console[_0xd2424e(0x20f)](a5_0x1bff63['red'](_0xd2424e(0x1ce))),0x1;let _0x137824='table';if(_0x177ce5[_0xd2424e(0x1f8)])_0x137824=_0xd2424e(0x1f8);else{if(_0x177ce5['jsonl'])_0x137824=_0xd2424e(0x247);else{if(_0x177ce5[_0xd2424e(0x20e)])_0x137824='tsv';else{if(_0x177ce5[_0xd2424e(0x21a)])_0x137824='table';}}}const _0xfeeda8=_0x177ce5[_0xd2424e(0x241)];let _0x3396e8=_0x243d74;const _0x4bbd0a=a5_0x2a8738[_0xd2424e(0x23b)](_0x243d74),_0x9a0739=_0x243d74==='.';if(!_0x4bbd0a||_0x9a0739){const _0x13fe02=resolveProjectFromContext(_0x243d74,_0xfeeda8,{'requireFile':_0xd2424e(0x23d)});if(_0x13fe02['found'])_0x3396e8=_0x13fe02['projectDir'],_0x13fe02[_0xd2424e(0x1c2)]===_0xd2424e(0x1e7)&&console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)]('Using\x20agent:\x20'+_0x3396e8));else switch(_0x13fe02['reason']){case _0xd2424e(0x246):console[_0xd2424e(0x20f)](a5_0x1bff63['yellow'](_0x13fe02[_0xd2424e(0x22e)])),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1f7)),console[_0xd2424e(0x20f)](_0xd2424e(0x20c)),console[_0xd2424e(0x20f)](_0xd2424e(0x231)),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1c1));return 0x1;case _0xd2424e(0x237):console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0x13fe02[_0xd2424e(0x22e)])),console['log'](),console[_0xd2424e(0x20f)](_0xd2424e(0x229)+_0x13fe02['llmProject']+_0xd2424e(0x208));return 0x1;case'multiple_agents':{const _0x1dcae2=a5_0x5ebcc7[_0xd2424e(0x1d9)](_0x13fe02[_0xd2424e(0x238)]);console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0xd2424e(0x24a)+_0x13fe02[_0xd2424e(0x241)]+'\x22:'));for(const _0x49a682 of _0x13fe02[_0xd2424e(0x1ed)]){console[_0xd2424e(0x20f)]('\x20\x20-\x20'+_0x49a682);}return console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1dcae2+_0xd2424e(0x215)),0x1;}case _0xd2424e(0x225):console['log'](a5_0x1bff63['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x13fe02[_0xd2424e(0x241)]+'\x22.')),console[_0xd2424e(0x20f)](a5_0x1bff63['dim'](_0xd2424e(0x1d5)+_0x13fe02[_0xd2424e(0x238)])),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1fb));return 0x1;}}const {definition:_0x134cfe,agentInfo:_0x3c4d87}=parseTestFile(_0x3396e8);let _0x16b761=_0x134cfe[_0xd2424e(0x240)];if(_0x57fe7d){const _0xc4eade=_0x57fe7d[_0xd2424e(0x1b1)](',')['map'](_0x1d3b86=>_0x1d3b86[_0xd2424e(0x1b9)]());_0x16b761=_0x134cfe[_0xd2424e(0x240)][_0xd2424e(0x1c0)](_0x5b8629=>_0xc4eade[_0xd2424e(0x1b2)](_0x5b8629['name']));if(_0x16b761[_0xd2424e(0x1db)]===0x0)return console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0xd2424e(0x227)+_0x57fe7d)),console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x219)+_0x134cfe[_0xd2424e(0x240)]['map'](_0x466a59=>_0x466a59[_0xd2424e(0x1ec)])[_0xd2424e(0x1ef)](',\x20'))),0x1;}if(_0x17342b){const _0x5e04ba=_0x17342b[_0xd2424e(0x1b1)](',')['map'](_0x373d84=>_0x373d84[_0xd2424e(0x1b9)]()[_0xd2424e(0x1f2)]());_0x16b761=_0x16b761['filter'](_0xe434e=>_0xe434e[_0xd2424e(0x223)]?.[_0xd2424e(0x1d2)](_0x39acf3=>_0x5e04ba['includes'](_0x39acf3[_0xd2424e(0x1f2)]())));if(_0x16b761[_0xd2424e(0x1db)]===0x0){console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0xd2424e(0x1fd)+_0x17342b));const _0x1c9eb3=new Set();return _0x134cfe['tests'][_0xd2424e(0x210)](_0x2e4cc1=>_0x2e4cc1[_0xd2424e(0x223)]?.[_0xd2424e(0x210)](_0x427d0c=>_0x1c9eb3[_0xd2424e(0x232)](_0x427d0c))),_0x1c9eb3[_0xd2424e(0x1b3)]>0x0?console['log'](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x22b)+[..._0x1c9eb3]['join'](',\x20'))):console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2092e1)return this[_0xd2424e(0x22d)](_0x32232e,{'definition':{'tests':_0x16b761},'agentInfo':_0x3c4d87,'outputFormat':_0x137824,'outputFile':_0x1f2261,'testNames':_0x57fe7d});if(_0x3f3965){console[_0xd2424e(0x20f)](a5_0x1bff63['cyan'](_0xd2424e(0x1c5))),console[_0xd2424e(0x20f)](_0xd2424e(0x1c6)+a5_0x1bff63['white'](_0x505a34)),console[_0xd2424e(0x20f)](_0xd2424e(0x245)+a5_0x1bff63[_0xd2424e(0x24d)](_0x3c4d87[_0xd2424e(0x1ca)])),console[_0xd2424e(0x20f)](_0xd2424e(0x1cc)+a5_0x1bff63['white'](_0x3c4d87[_0xd2424e(0x242)])),console['log'](),console[_0xd2424e(0x20f)](_0xd2424e(0x220)+a5_0x1bff63[_0xd2424e(0x24d)](_0x16b761[_0xd2424e(0x1db)]));for(let _0x3983c1=0x0;_0x3983c1<_0x16b761[_0xd2424e(0x1db)];_0x3983c1++){const _0x252419=_0x16b761[_0x3983c1],_0x40d534=_0x252419[_0xd2424e(0x1f9)][_0xd2424e(0x1db)]===0x1?_0xd2424e(0x1f4):'rounds',_0x4078aa=_0x252419['tags']?.[_0xd2424e(0x1db)]?'\x20['+_0x252419['tags']['join'](',\x20')+']':'';console[_0xd2424e(0x20f)]('\x20\x20'+(_0x3983c1+0x1)+'.\x20'+a5_0x1bff63['white'](_0x252419[_0xd2424e(0x1ec)])+'\x20('+_0x252419[_0xd2424e(0x1f9)][_0xd2424e(0x1db)]+'\x20'+_0x40d534+')'+a5_0x1bff63[_0xd2424e(0x209)](_0x4078aa));}return 0x0;}let _0x3abf91,_0x3efcea;try{_0x3abf91=await _0x22ac6f[_0xd2424e(0x235)][_0xd2424e(0x250)](_0x3c4d87[_0xd2424e(0x1ca)]);}catch(_0x3f1470){const _0x1bde5b=_0x3f1470 instanceof Error?_0x3f1470[_0xd2424e(0x22e)]:String(_0x3f1470);return _0x1bde5b['includes'](_0xd2424e(0x23a))||_0x1bde5b['toLowerCase']()[_0xd2424e(0x1b2)](_0xd2424e(0x218))?console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x22c)+_0x3c4d87['projectName'])):console['log'](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1f3)+_0x3c4d87[_0xd2424e(0x1ca)]+'\x22:\x20'+_0x1bde5b)),0x1;}try{_0x3efcea=await _0x22ac6f[_0xd2424e(0x235)][_0xd2424e(0x204)](_0x3c4d87[_0xd2424e(0x242)],_0x3abf91);}catch(_0x39dbb0){const _0x573bf8=_0x39dbb0 instanceof Error?_0x39dbb0['message']:String(_0x39dbb0);return _0x573bf8[_0xd2424e(0x1b2)]('404')||_0x573bf8['toLowerCase']()[_0xd2424e(0x1b2)]('not\x20found')?console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x244)+_0x3c4d87[_0xd2424e(0x242)])):console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x24b)+_0x3c4d87['agentName']+_0xd2424e(0x206)+_0x573bf8)),0x1;}let _0x50983a;if(!_0xefddd7)try{_0x50983a=await setupEvaluatorAgent(_0x22ac6f[_0xd2424e(0x235)],_0xa00e2b['verbose']);}catch(_0x461d49){const _0x511e26=_0x461d49 instanceof Error?_0x461d49[_0xd2424e(0x22e)]:String(_0x461d49);return console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1e9)+_0x511e26)),0x1;}console[_0xd2424e(0x20f)](a5_0x1bff63['cyan']('Running\x20agent\x20tests...')),console[_0xd2424e(0x20f)](_0xd2424e(0x1c9)+a5_0x1bff63[_0xd2424e(0x24d)](_0x505a34)),console[_0xd2424e(0x20f)](_0xd2424e(0x1cd)+a5_0x1bff63[_0xd2424e(0x24d)](_0x3c4d87[_0xd2424e(0x1ca)]+'/'+_0x3c4d87[_0xd2424e(0x242)])),console[_0xd2424e(0x20f)]();const _0x1da029=[],_0x2aae20=[],_0x2027fd=Date['now']();for(let _0x5d71ed=0x0;_0x5d71ed<_0x16b761[_0xd2424e(0x1db)];_0x5d71ed++){const _0x18ca05=_0x16b761[_0x5d71ed];_0x16b761[_0xd2424e(0x1db)]>0x1?console[_0xd2424e(0x20f)](_0xd2424e(0x1c3)+(_0x5d71ed+0x1)+'/'+_0x16b761[_0xd2424e(0x1db)]+':\x20'+a5_0x1bff63['white'](_0x18ca05['name'])):console[_0xd2424e(0x20f)](_0xd2424e(0x1bc)+a5_0x1bff63[_0xd2424e(0x24d)](_0x18ca05['name']));const _0x51ec1d=createCommandSpinner(_0xd2424e(0x200)+_0x18ca05[_0xd2424e(0x1f9)][_0xd2424e(0x1db)]+_0xd2424e(0x213));_0x51ec1d[_0xd2424e(0x1d4)]();try{const {result:_0x3e877a,conversation:_0x1e77c8}=await runTest(_0x22ac6f[_0xd2424e(0x235)],_0x18ca05,{'agentId':_0x3efcea,'projectId':_0x3abf91,'site':_0x505a34,'noEval':_0xefddd7,'evaluatorId':_0x50983a,'onRoundStart':(_0x3f2190,_0x4461d2)=>{const _0x5df85d=_0xd2424e;_0x51ec1d[_0x5df85d(0x214)]=_0x5df85d(0x1cb)+(_0x3f2190+0x1)+'/'+_0x4461d2+_0x5df85d(0x213);},'onRoundComplete':(_0x448ca3,_0x4d84bd,_0x23ee59)=>{const _0x4e6cd7=_0xd2424e,_0x51c0c4=formatElapsed(_0x4d84bd);_0x23ee59?console[_0x4e6cd7(0x20f)](_0x4e6cd7(0x1ee)+(_0x448ca3+0x1)+'/'+_0x18ca05[_0x4e6cd7(0x1f9)][_0x4e6cd7(0x1db)]+'...\x20'+a5_0x1bff63['green']('✓')+'\x20('+_0x51c0c4+')'):console[_0x4e6cd7(0x20f)](_0x4e6cd7(0x1ee)+(_0x448ca3+0x1)+'/'+_0x18ca05[_0x4e6cd7(0x1f9)]['length']+_0x4e6cd7(0x20a)+a5_0x1bff63['red']('✗'));},'onEvaluationStart':()=>{const _0x37dddc=_0xd2424e;_0x51ec1d['text']=_0x37dddc(0x234);},'onEvaluationComplete':_0x17eeee=>{const _0x8dee7b=_0xd2424e,_0x20a388=formatElapsed(_0x17eeee);console[_0x8dee7b(0x20f)]('\x20\x20Evaluating...\x20'+a5_0x1bff63['green']('✓')+'\x20('+_0x20a388+')');}});_0x51ec1d['stop'](),_0x1da029[_0xd2424e(0x1f6)](_0x3e877a),_0x2aae20['push'](_0x1e77c8);if(_0x3e877a['status']==='PASS')console['log'](a5_0x1bff63[_0xd2424e(0x1bf)](_0xd2424e(0x251)+_0x3e877a[_0xd2424e(0x1fe)]));else _0x3e877a[_0xd2424e(0x1e2)]===_0xd2424e(0x1da)?console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1fa)+_0x3e877a['reason'])):console[_0xd2424e(0x20f)](a5_0x1bff63['red'](_0xd2424e(0x1e0)+_0x3e877a['reason']));_0x3e877a[_0xd2424e(0x1ea)]&&console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x1e4)+_0x3e877a['conversation_url'])),console['log']();}catch(_0x760b0d){_0x51ec1d[_0xd2424e(0x1e5)]();const _0xfe01fc=_0x760b0d instanceof Error?_0x760b0d[_0xd2424e(0x22e)]:String(_0x760b0d);console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1e0)+_0xfe01fc)),console['log'](),_0x1da029[_0xd2424e(0x1f6)]({'name':_0x18ca05[_0xd2424e(0x1ec)],'status':_0xd2424e(0x1e6),'reason':_0xfe01fc,'timestamp':new Date()[_0xd2424e(0x1b7)](),'duration_ms':0x0});}}const _0x1be991=Date[_0xd2424e(0x24c)]()-_0x2027fd,_0x50f28f=_0x1da029[_0xd2424e(0x1c0)](_0x1a48ed=>_0x1a48ed[_0xd2424e(0x1e2)]===_0xd2424e(0x1e8))[_0xd2424e(0x1db)],_0x27e902=_0x1da029['filter'](_0x385c88=>_0x385c88[_0xd2424e(0x1e2)]===_0xd2424e(0x1da))[_0xd2424e(0x1db)],_0x21e492=_0x1da029[_0xd2424e(0x1c0)](_0x453591=>_0x453591[_0xd2424e(0x1e2)]===_0xd2424e(0x1e6))['length'];console[_0xd2424e(0x20f)]('━'[_0xd2424e(0x1c8)](0x3c)),console[_0xd2424e(0x20f)](_0xd2424e(0x211)),console[_0xd2424e(0x20f)]('━'['repeat'](0x3c)),console['log'](_0xd2424e(0x239)+_0x1da029[_0xd2424e(0x1db)]),console['log'](_0xd2424e(0x1eb)+a5_0x1bff63[_0xd2424e(0x1bf)](_0x50f28f)),console[_0xd2424e(0x20f)](_0xd2424e(0x228)+a5_0x1bff63[_0xd2424e(0x1f5)](_0x27e902));_0x21e492>0x0&&console[_0xd2424e(0x20f)](_0xd2424e(0x203)+a5_0x1bff63[_0xd2424e(0x1f5)](_0x21e492));console[_0xd2424e(0x20f)](_0xd2424e(0x221)+formatElapsed(_0x1be991)),console[_0xd2424e(0x20f)]('━'['repeat'](0x3c));const _0x2f06dd=_0x1da029['filter'](_0x1ff3d2=>_0x1ff3d2[_0xd2424e(0x1e2)]!==_0xd2424e(0x1e8));if(_0x2f06dd[_0xd2424e(0x1db)]>0x0){console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1be));for(const _0x4fca3c of _0x2f06dd){const _0x22d8a4=a5_0x1bff63[_0xd2424e(0x1f5)]('✗'),_0x11cbc0=_0x4fca3c[_0xd2424e(0x1fe)][_0xd2424e(0x1db)]>0x32?_0x4fca3c['reason'][_0xd2424e(0x22f)](0x0,0x32)+'...':_0x4fca3c[_0xd2424e(0x1fe)];console[_0xd2424e(0x20f)]('\x20\x20'+_0x22d8a4+'\x20'+_0x4fca3c['name']+':\x20'+_0x11cbc0);}}const _0x1045b2={'summary':{'total':_0x1da029['length'],'passed':_0x50f28f,'failed':_0x27e902,'errors':_0x21e492>0x0?_0x21e492:undefined,'duration_ms':_0x1be991},'tests':_0x1da029,'agent':{'project':_0x3c4d87['projectName'],'name':_0x3c4d87['agentName'],'site':_0x505a34},'timestamp':new Date(_0x2027fd)[_0xd2424e(0x1b7)]()};try{const _0x3761fa=buildCachedTestRun(_0x2aae20,{'site':_0x505a34,'projectId':_0x3abf91,'projectName':_0x3c4d87[_0xd2424e(0x1ca)],'agentId':_0x3efcea,'agentName':_0x3c4d87[_0xd2424e(0x242)],'testYmlPath':a5_0x5ebcc7[_0xd2424e(0x22a)](_0x3c4d87[_0xd2424e(0x1d6)])});saveLastTestRun(_0x3761fa);}catch{}if(_0x137824!=='table'||_0x1f2261){const _0xce8a3=formatResults(_0x1045b2,_0x137824);if(_0x1f2261)try{a5_0x2a8738[_0xd2424e(0x1bb)](_0x1f2261,_0xce8a3,_0xd2424e(0x1f1)),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x207)+_0x1f2261));}catch(_0xc70b66){return console[_0xd2424e(0x20f)](),console['log'](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x217)+_0xc70b66)),0x1;}else console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xce8a3);}return _0x2f06dd[_0xd2424e(0x1db)]>0x0?0x1:0x0;}async[a5_0x2d676e(0x22d)](_0xe6c1f4,_0x4bf0ed){const _0x46d02b=a5_0x2d676e,{options:_0x5f3ab1,tdx:_0x2e3366}=_0xe6c1f4,{definition:_0x452e7c,agentInfo:_0x240d71,outputFormat:_0x4eb935,outputFile:_0x24be2d}=_0x4bf0ed,_0x188633=_0x5f3ab1[_0x46d02b(0x21c)],_0x4001c7=loadLastTestRun();if(!_0x4001c7)return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1e1))),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x4001c7[_0x46d02b(0x1d0)][_0x46d02b(0x242)]!==_0x240d71[_0x46d02b(0x242)])return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x230)+_0x4001c7[_0x46d02b(0x1d0)]['agentName']+_0x46d02b(0x1fc)+_0x240d71[_0x46d02b(0x242)]+'\x22.')),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x1d1))),0x1;const _0x57ec3c=new Set(_0x4001c7[_0x46d02b(0x21d)][_0x46d02b(0x23e)](_0x3e17a7=>_0x3e17a7[_0x46d02b(0x1c4)])),_0x26faa8=_0x452e7c['tests'][_0x46d02b(0x1c0)](_0xac86a5=>!_0x57ec3c[_0x46d02b(0x202)](_0xac86a5[_0x46d02b(0x1ec)]));if(_0x26faa8[_0x46d02b(0x1db)]>0x0&&_0x4001c7[_0x46d02b(0x21c)]!==_0x188633)return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x236))),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x1d3)+_0x4001c7[_0x46d02b(0x21c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x188633+'\x22.')),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x1de)+_0x4001c7['site']+_0x46d02b(0x248))),0x1;const _0x5d902f=_0x452e7c['tests'][_0x46d02b(0x1c0)](_0x1ab8f4=>_0x57ec3c[_0x46d02b(0x202)](_0x1ab8f4['name'])),_0x723a95=_0x26faa8;let _0x11ce06;try{_0x11ce06=await setupEvaluatorAgent(_0x2e3366[_0x46d02b(0x235)],_0x5f3ab1[_0x46d02b(0x1e3)]);}catch(_0x47bda1){const _0x460f71=_0x47bda1 instanceof Error?_0x47bda1[_0x46d02b(0x22e)]:String(_0x47bda1);return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1e9)+_0x460f71)),0x1;}console[_0x46d02b(0x20f)](a5_0x1bff63['cyan'](_0x46d02b(0x24f))),console['log']('Cached\x20run\x20from:\x20'+a5_0x1bff63[_0x46d02b(0x24d)](_0x4001c7[_0x46d02b(0x1b4)])),console[_0x46d02b(0x20f)](_0x46d02b(0x1cd)+a5_0x1bff63[_0x46d02b(0x24d)](_0x4001c7[_0x46d02b(0x1d0)][_0x46d02b(0x1ca)]+'/'+_0x4001c7[_0x46d02b(0x1d0)][_0x46d02b(0x242)]));_0x723a95[_0x46d02b(0x1db)]>0x0&&console[_0x46d02b(0x20f)](_0x46d02b(0x1b6)+a5_0x1bff63['yellow'](_0x723a95[_0x46d02b(0x1db)]));console[_0x46d02b(0x20f)]();const _0x19aa83=[],_0x369d6a=Date[_0x46d02b(0x24c)](),_0x273633=createCommandSpinner('Re-evaluating...');if(_0x5d902f[_0x46d02b(0x1db)]>0x0)try{const _0x129de4=await reevaluateFromCache(_0x2e3366[_0x46d02b(0x235)],_0x4001c7,{'tests':_0x5d902f},{'evaluatorId':_0x11ce06,'onTestStart':(_0x223d0c,_0xf44550,_0x2f5886)=>{const _0x29239f=_0x46d02b;_0x273633[_0x29239f(0x214)]=_0x29239f(0x1ba)+(_0xf44550+0x1)+'/'+_0x2f5886+':\x20'+_0x223d0c+_0x29239f(0x1bd);if(!_0x273633[_0x29239f(0x20b)])_0x273633[_0x29239f(0x1d4)]();},'onTestComplete':(_0x4380f1,_0x4f8c8f)=>{const _0x187def=_0x46d02b;_0x273633[_0x187def(0x1e5)]();if(_0x4f8c8f[_0x187def(0x1e2)]===_0x187def(0x1e8))console['log'](a5_0x1bff63[_0x187def(0x1bf)](_0x187def(0x251)+_0x4380f1)+a5_0x1bff63[_0x187def(0x209)](_0x187def(0x212)));else _0x4f8c8f[_0x187def(0x1e2)]===_0x187def(0x1da)?console[_0x187def(0x20f)](a5_0x1bff63[_0x187def(0x1f5)]('✗\x20FAIL:\x20'+_0x4380f1+_0x187def(0x1df)+_0x4f8c8f['reason'])+a5_0x1bff63[_0x187def(0x209)](_0x187def(0x212))):console[_0x187def(0x20f)](a5_0x1bff63[_0x187def(0x1f5)](_0x187def(0x1e0)+_0x4380f1+_0x187def(0x1df)+_0x4f8c8f['reason']));_0x4f8c8f[_0x187def(0x1ea)]&&console['log'](a5_0x1bff63['dim'](_0x187def(0x233)+_0x4f8c8f[_0x187def(0x1ea)])),_0x19aa83['push'](_0x4f8c8f);},'onTestSkipped':(_0x3e4d10,_0x4015fe)=>{const _0x23ed19=_0x46d02b;_0x273633['stop'](),console['log'](a5_0x1bff63[_0x23ed19(0x201)](_0x23ed19(0x243)+_0x3e4d10+_0x23ed19(0x1df)+_0x4015fe));}});for(const _0x546605 of _0x129de4){!_0x19aa83[_0x46d02b(0x23c)](_0x35fc48=>_0x35fc48['name']===_0x546605[_0x46d02b(0x1ec)])&&_0x19aa83[_0x46d02b(0x1f6)](_0x546605);}}catch(_0x2e376e){_0x273633[_0x46d02b(0x1e5)]();const _0x42acac=_0x2e376e instanceof Error?_0x2e376e['message']:String(_0x2e376e);return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1b8)+_0x42acac)),0x1;}_0x273633[_0x46d02b(0x1e5)]();if(_0x723a95[_0x46d02b(0x1db)]>0x0){console['log'](),console[_0x46d02b(0x20f)](a5_0x1bff63['cyan'](_0x46d02b(0x222)));const {projectId:_0x7a96d4,agentId:_0x2da480}=_0x4001c7[_0x46d02b(0x1d0)];for(const _0x1d1288 of _0x723a95){console[_0x46d02b(0x20f)](_0x46d02b(0x1f0)+a5_0x1bff63[_0x46d02b(0x24d)](_0x1d1288[_0x46d02b(0x1ec)]));const _0x4a5a41=createCommandSpinner(_0x46d02b(0x200)+_0x1d1288[_0x46d02b(0x1f9)][_0x46d02b(0x1db)]+_0x46d02b(0x213));_0x4a5a41[_0x46d02b(0x1d4)]();try{const {result:_0x59ba1f}=await runTest(_0x2e3366['llm'],_0x1d1288,{'agentId':_0x2da480,'projectId':_0x7a96d4,'site':_0x4001c7['site'],'noEval':![],'evaluatorId':_0x11ce06,'onRoundStart':(_0x572420,_0x38d067)=>{const _0x2bafe3=_0x46d02b;_0x4a5a41[_0x2bafe3(0x214)]=_0x2bafe3(0x1cb)+(_0x572420+0x1)+'/'+_0x38d067+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x50e9be,_0xcf4168,_0x2c6957)=>{const _0x46ee96=_0x46d02b,_0x2b9f32=formatElapsed(_0xcf4168);_0x2c6957?console['log'](_0x46ee96(0x1ee)+(_0x50e9be+0x1)+'/'+_0x1d1288[_0x46ee96(0x1f9)][_0x46ee96(0x1db)]+_0x46ee96(0x20a)+a5_0x1bff63[_0x46ee96(0x1bf)]('✓')+'\x20('+_0x2b9f32+')'):console[_0x46ee96(0x20f)](_0x46ee96(0x1ee)+(_0x50e9be+0x1)+'/'+_0x1d1288[_0x46ee96(0x1f9)][_0x46ee96(0x1db)]+_0x46ee96(0x20a)+a5_0x1bff63[_0x46ee96(0x1f5)]('✗'));},'onEvaluationStart':()=>{const _0x38f326=_0x46d02b;_0x4a5a41['text']=_0x38f326(0x234);},'onEvaluationComplete':_0x3bb071=>{const _0x33eace=_0x46d02b,_0x4537fb=formatElapsed(_0x3bb071);console['log'](_0x33eace(0x21f)+a5_0x1bff63[_0x33eace(0x1bf)]('✓')+'\x20('+_0x4537fb+')');}});_0x4a5a41['stop'](),_0x19aa83[_0x46d02b(0x1f6)](_0x59ba1f);if(_0x59ba1f[_0x46d02b(0x1e2)]===_0x46d02b(0x1e8))console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1bf)](_0x46d02b(0x251)+_0x59ba1f['reason'])+a5_0x1bff63[_0x46d02b(0x209)]('\x20(new)'));else _0x59ba1f['status']===_0x46d02b(0x1da)?console[_0x46d02b(0x20f)](a5_0x1bff63['red']('✗\x20FAIL:\x20'+_0x59ba1f['reason'])+a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x20d))):console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1e0)+_0x59ba1f[_0x46d02b(0x1fe)]));_0x59ba1f[_0x46d02b(0x1ea)]&&console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)]('\x20\x20Conversation:\x20'+_0x59ba1f[_0x46d02b(0x1ea)]));}catch(_0x289d1f){_0x4a5a41['stop']();const _0x32f586=_0x289d1f instanceof Error?_0x289d1f['message']:String(_0x289d1f);console[_0x46d02b(0x20f)](a5_0x1bff63['red'](_0x46d02b(0x1e0)+_0x32f586)),_0x19aa83['push']({'name':_0x1d1288[_0x46d02b(0x1ec)],'status':_0x46d02b(0x1e6),'reason':_0x32f586,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x46d02b(0x20f)]();const _0x5f84ad=Date[_0x46d02b(0x24c)]()-_0x369d6a,_0x80e433=_0x19aa83[_0x46d02b(0x1c0)](_0x523aec=>_0x523aec[_0x46d02b(0x1e2)]==='PASS')['length'],_0x5eb104=_0x19aa83[_0x46d02b(0x1c0)](_0x286f18=>_0x286f18[_0x46d02b(0x1e2)]===_0x46d02b(0x1da))[_0x46d02b(0x1db)],_0x3926dd=_0x19aa83[_0x46d02b(0x1c0)](_0x41968d=>_0x41968d[_0x46d02b(0x1e2)]===_0x46d02b(0x1e6))['length'];console[_0x46d02b(0x20f)]('━'[_0x46d02b(0x1c8)](0x3c)),console[_0x46d02b(0x20f)]('Re-evaluation\x20Summary'),console[_0x46d02b(0x20f)]('━'['repeat'](0x3c)),console[_0x46d02b(0x20f)](_0x46d02b(0x239)+_0x19aa83[_0x46d02b(0x1db)]),console[_0x46d02b(0x20f)](_0x46d02b(0x1eb)+a5_0x1bff63[_0x46d02b(0x1bf)](_0x80e433)),console[_0x46d02b(0x20f)](_0x46d02b(0x228)+a5_0x1bff63[_0x46d02b(0x1f5)](_0x5eb104));_0x3926dd>0x0&&console[_0x46d02b(0x20f)]('Errors:\x20\x20\x20'+a5_0x1bff63[_0x46d02b(0x1f5)](_0x3926dd));console[_0x46d02b(0x20f)](_0x46d02b(0x221)+formatElapsed(_0x5f84ad)),console['log']('━'[_0x46d02b(0x1c8)](0x3c));const _0x254edb={'summary':{'total':_0x19aa83['length'],'passed':_0x80e433,'failed':_0x5eb104,'errors':_0x3926dd>0x0?_0x3926dd:undefined,'duration_ms':_0x5f84ad},'tests':_0x19aa83,'agent':{'project':_0x240d71[_0x46d02b(0x1ca)],'name':_0x240d71[_0x46d02b(0x242)],'site':_0x188633},'timestamp':new Date(_0x369d6a)[_0x46d02b(0x1b7)]()};if(_0x4eb935!==_0x46d02b(0x21a)||_0x24be2d){const _0x201a4e=formatResults(_0x254edb,_0x4eb935);if(_0x24be2d)try{a5_0x2a8738['writeFileSync'](_0x24be2d,_0x201a4e,_0x46d02b(0x1f1)),console[_0x46d02b(0x20f)](),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)]('Output\x20written\x20to:\x20'+_0x24be2d));}catch(_0x11bdaf){return console[_0x46d02b(0x20f)](),console[_0x46d02b(0x20f)](a5_0x1bff63['red'](_0x46d02b(0x217)+_0x11bdaf)),0x1;}else console['log'](),console[_0x46d02b(0x20f)](_0x201a4e);}const _0x2ab6f6=_0x19aa83[_0x46d02b(0x1c0)](_0x4ef5e9=>_0x4ef5e9['status']!=='PASS');return _0x2ab6f6[_0x46d02b(0x1db)]>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x202f(_0x212be9,_0x457099){_0x212be9=_0x212be9-0x12e;const _0x5d095b=a5_0x5d09();let _0x202fab=_0x5d095b[_0x212be9];return _0x202fab;}const a5_0xdd547f=a5_0x202f;(function(_0x4f8332,_0x4475fa){const _0x203bb3=a5_0x202f,_0x54dcc2=_0x4f8332();while(!![]){try{const _0xae107a=-parseInt(_0x203bb3(0x19f))/0x1*(-parseInt(_0x203bb3(0x180))/0x2)+-parseInt(_0x203bb3(0x1c4))/0x3+-parseInt(_0x203bb3(0x18f))/0x4+parseInt(_0x203bb3(0x16c))/0x5*(-parseInt(_0x203bb3(0x1a5))/0x6)+-parseInt(_0x203bb3(0x13e))/0x7*(-parseInt(_0x203bb3(0x130))/0x8)+-parseInt(_0x203bb3(0x1bb))/0x9+parseInt(_0x203bb3(0x1c3))/0xa*(parseInt(_0x203bb3(0x1b0))/0xb);if(_0xae107a===_0x4475fa)break;else _0x54dcc2['push'](_0x54dcc2['shift']());}catch(_0x329e73){_0x54dcc2['push'](_0x54dcc2['shift']());}}}(a5_0x5d09,0xde827));import*as a5_0x543ebe from'node:fs';import*as a5_0x12bfc0 from'node:path';import a5_0x52832e 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';function a5_0x5d09(){const _0x432149=['Running\x20test:\x20','now','green','Test\x20Summary','PASS','projectDir',':\x20Sending\x20user\x20input...','resolve','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','yellow','...\x20','basename','6239366VHpSPh','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20\x20Site:\x20','✗\x20FAIL:\x20','ERROR','Conversation\x20URL:\x20','Usage:','multiple_agents','Total:\x20\x20\x20\x20','Running:\x20','verbose','add','Re-evaluating...','FAIL','reason','no_context','utf-8','Re-evaluating\x20','round','\x27\x20to\x20create\x20the\x20folder\x20structure.','llmProject','test.yml','dim','Run\x20tests\x20for\x20an\x20LLM\x20agent','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','no_tests','agent','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20-\x20','text','not\x20found','conversation_url','Cached\x20run\x20is\x20from\x20site\x20\x22','tsv','substring','\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','Test\x20Configuration:','\x20\x20Project:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','push','Tests\x20found:\x20','description','message','Failed:\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','4041185ZwHGnA','toISOString','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','resolveAgentId','Errors:\x20\x20\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Duration:\x20','Failed\x20Tests:','agent:test','writeFileSync','red','forEach','Run\x20\x27tdx\x20agent\x20pull\x20','map','timestamp','reeval','no_local_folder','length','404','source','10DsYkpf','site','Running\x20agent\x20tests...','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','✓\x20PASS:\x20','rounds','agentName','\x20\x20Conversation:\x20','Cached\x20run\x20from:\x20','status','\x20-\x20','start','trim','toLowerCase','3510956bkxTjC','resolveProjectId','\x20(new)','log','executeReeval','tests','...','join','split','some','\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)','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','white','New\x20tests\x20to\x20execute:\x20','repeat','json','131523WDJqXl','filter','Test\x20','Evaluating\x20response...','cyan','✗\x20ERROR:\x20','12fISrtP','\x22:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','table','testYmlPath','Using\x20agent:\x20','Site:\x20','Error\x20writing\x20output\x20file:\x20','stop','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','115445zTrwwT','Available\x20tests:\x20','find','/<agent-name>','name','tags','Agent:\x20','Round\x201/','found','llm','\x20\x20Round\x20','6698763sgVVJm','Available\x20tags:\x20','context','projectName','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Passed:\x20\x20\x20','output','1930fJcfZS','947721QVOpRD','jsonl','includes','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agentDirs','16jQkKjX','Executing\x20new\x20tests...'];a5_0x5d09=function(){return _0x432149;};return a5_0x5d09();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xdd547f(0x1b4)]=a5_0xdd547f(0x174);[a5_0xdd547f(0x167)]=a5_0xdd547f(0x155);async['execute'](_0x27c79c){const _0x36b9c5=a5_0xdd547f,{options:_0x5bbdff,args:_0x15dda7,tdx:_0x56782a}=_0x27c79c,_0x56aebf=_0x15dda7[0x0]||'.',_0x5828f8=_0x5bbdff['dryRun'],_0x1bc3f2=_0x5bbdff,_0x4dc2e7=_0x1bc3f2['eval']===![],_0x2a3b8b=_0x1bc3f2[_0x36b9c5(0x17b)],_0x56e277=_0x1bc3f2[_0x36b9c5(0x1b4)],_0x268662=_0x1bc3f2[_0x36b9c5(0x1b5)],_0x414c84=_0x5bbdff[_0x36b9c5(0x181)],_0x3a60ca=_0x1bc3f2[_0x36b9c5(0x1c2)];if(_0x2a3b8b&&_0x4dc2e7)return console[_0x36b9c5(0x192)](a5_0x52832e['red'](_0x36b9c5(0x16e))),0x1;let _0x797dd4=_0x36b9c5(0x1a8);if(_0x1bc3f2[_0x36b9c5(0x19e)])_0x797dd4=_0x36b9c5(0x19e);else{if(_0x1bc3f2[_0x36b9c5(0x1c5)])_0x797dd4='jsonl';else{if(_0x1bc3f2[_0x36b9c5(0x15f)])_0x797dd4=_0x36b9c5(0x15f);else{if(_0x1bc3f2[_0x36b9c5(0x1a8)])_0x797dd4=_0x36b9c5(0x1a8);}}}const _0x3169cb=_0x1bc3f2['llmProject'];let _0x55adcb=_0x56aebf;const _0x2a8105=a5_0x543ebe['existsSync'](_0x56aebf),_0x4b28cc=_0x56aebf==='.';if(!_0x2a8105||_0x4b28cc){const _0x4ed351=resolveProjectFromContext(_0x56aebf,_0x3169cb,{'requireFile':_0x36b9c5(0x153)});if(_0x4ed351[_0x36b9c5(0x1b8)])_0x55adcb=_0x4ed351[_0x36b9c5(0x137)],_0x4ed351[_0x36b9c5(0x17f)]===_0x36b9c5(0x1bd)&&console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1aa)+_0x55adcb));else switch(_0x4ed351[_0x36b9c5(0x14c)]){case _0x36b9c5(0x14d):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x4ed351[_0x36b9c5(0x168)])),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x144)),console[_0x36b9c5(0x192)](_0x36b9c5(0x161)),console[_0x36b9c5(0x192)](_0x36b9c5(0x199)),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x19a));return 0x1;case _0x36b9c5(0x17c):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x4ed351[_0x36b9c5(0x168)])),console['log'](),console[_0x36b9c5(0x192)](_0x36b9c5(0x178)+_0x4ed351[_0x36b9c5(0x152)]+_0x36b9c5(0x151));return 0x1;case _0x36b9c5(0x145):{const _0x3cb9d9=a5_0x12bfc0[_0x36b9c5(0x13d)](_0x4ed351[_0x36b9c5(0x137)]);console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x36b9c5(0x1a7)+_0x4ed351[_0x36b9c5(0x152)]+'\x22:'));for(const _0x252992 of _0x4ed351[_0x36b9c5(0x12f)]){console[_0x36b9c5(0x192)](_0x36b9c5(0x15a)+_0x252992);}return console[_0x36b9c5(0x192)](),console['log'](_0x36b9c5(0x1c0)+_0x3cb9d9+_0x36b9c5(0x1b3)),0x1;}case _0x36b9c5(0x157):console['log'](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4ed351['llmProject']+'\x22.')),console[_0x36b9c5(0x192)](a5_0x52832e['dim']('Project\x20path:\x20'+_0x4ed351['projectDir'])),console[_0x36b9c5(0x192)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3f462b,agentInfo:_0x466651}=parseTestFile(_0x55adcb);let _0x40d950=_0x3f462b[_0x36b9c5(0x194)];if(_0x56e277){const _0x1510f8=_0x56e277['split'](',')[_0x36b9c5(0x179)](_0x37cf9b=>_0x37cf9b[_0x36b9c5(0x18d)]());_0x40d950=_0x3f462b[_0x36b9c5(0x194)][_0x36b9c5(0x1a0)](_0x2809dc=>_0x1510f8[_0x36b9c5(0x1c6)](_0x2809dc[_0x36b9c5(0x1b4)]));if(_0x40d950[_0x36b9c5(0x17d)]===0x0)return console['log'](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20tests\x20found\x20matching:\x20'+_0x56e277)),console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1b1)+_0x3f462b[_0x36b9c5(0x194)]['map'](_0x3740fc=>_0x3740fc['name'])['join'](',\x20'))),0x1;}if(_0x268662){const _0x16ddcb=_0x268662[_0x36b9c5(0x197)](',')[_0x36b9c5(0x179)](_0x924c46=>_0x924c46[_0x36b9c5(0x18d)]()[_0x36b9c5(0x18e)]());_0x40d950=_0x40d950[_0x36b9c5(0x1a0)](_0x2f33c6=>_0x2f33c6[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x198)](_0x68d91f=>_0x16ddcb[_0x36b9c5(0x1c6)](_0x68d91f[_0x36b9c5(0x18e)]())));if(_0x40d950['length']===0x0){console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x268662));const _0x27ddea=new Set();return _0x3f462b['tests'][_0x36b9c5(0x177)](_0x4a1ab8=>_0x4a1ab8[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x177)](_0x299981=>_0x27ddea[_0x36b9c5(0x149)](_0x299981))),_0x27ddea['size']>0x0?console['log'](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1bc)+[..._0x27ddea][_0x36b9c5(0x196)](',\x20'))):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2a3b8b)return this[_0x36b9c5(0x193)](_0x27c79c,{'definition':{'tests':_0x40d950},'agentInfo':_0x466651,'outputFormat':_0x797dd4,'outputFile':_0x3a60ca,'testNames':_0x56e277});if(_0x5828f8){console['log'](a5_0x52832e['cyan'](_0x36b9c5(0x162))),console[_0x36b9c5(0x192)](_0x36b9c5(0x140)+a5_0x52832e[_0x36b9c5(0x19b)](_0x414c84)),console[_0x36b9c5(0x192)](_0x36b9c5(0x163)+a5_0x52832e[_0x36b9c5(0x19b)](_0x466651['projectName'])),console['log']('\x20\x20Agent:\x20'+a5_0x52832e[_0x36b9c5(0x19b)](_0x466651[_0x36b9c5(0x187)])),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x166)+a5_0x52832e['white'](_0x40d950[_0x36b9c5(0x17d)]));for(let _0xd694b5=0x0;_0xd694b5<_0x40d950[_0x36b9c5(0x17d)];_0xd694b5++){const _0x5e77f7=_0x40d950[_0xd694b5],_0x2db93e=_0x5e77f7['rounds']['length']===0x1?_0x36b9c5(0x150):_0x36b9c5(0x186),_0x2ff7d4=_0x5e77f7[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x17d)]?'\x20['+_0x5e77f7['tags'][_0x36b9c5(0x196)](',\x20')+']':'';console['log']('\x20\x20'+(_0xd694b5+0x1)+'.\x20'+a5_0x52832e['white'](_0x5e77f7[_0x36b9c5(0x1b4)])+'\x20('+_0x5e77f7[_0x36b9c5(0x186)][_0x36b9c5(0x17d)]+'\x20'+_0x2db93e+')'+a5_0x52832e[_0x36b9c5(0x154)](_0x2ff7d4));}return 0x0;}let _0x4f2cef,_0x4ec616;try{_0x4f2cef=await _0x56782a[_0x36b9c5(0x1b9)][_0x36b9c5(0x190)](_0x466651['projectName']);}catch(_0xaa3658){const _0x297385=_0xaa3658 instanceof Error?_0xaa3658['message']:String(_0xaa3658);return _0x297385['includes'](_0x36b9c5(0x17e))||_0x297385['toLowerCase']()['includes'](_0x36b9c5(0x15c))?console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x159)+_0x466651[_0x36b9c5(0x1be)])):console['log'](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x13a)+_0x466651['projectName']+_0x36b9c5(0x1a6)+_0x297385)),0x1;}try{_0x4ec616=await _0x56782a[_0x36b9c5(0x1b9)][_0x36b9c5(0x16f)](_0x466651[_0x36b9c5(0x187)],_0x4f2cef);}catch(_0x5f49ee){const _0x343e7c=_0x5f49ee instanceof Error?_0x5f49ee[_0x36b9c5(0x168)]:String(_0x5f49ee);return _0x343e7c[_0x36b9c5(0x1c6)](_0x36b9c5(0x17e))||_0x343e7c[_0x36b9c5(0x18e)]()[_0x36b9c5(0x1c6)](_0x36b9c5(0x15c))?console['log'](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x466651['agentName'])):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x164)+_0x466651['agentName']+'\x22:\x20'+_0x343e7c)),0x1;}let _0x2d66fe;if(!_0x4dc2e7)try{_0x2d66fe=await setupEvaluatorAgent(_0x56782a[_0x36b9c5(0x1b9)],_0x5bbdff[_0x36b9c5(0x148)]);}catch(_0x261a35){const _0x5864af=_0x261a35 instanceof Error?_0x261a35['message']:String(_0x261a35);return console['log'](a5_0x52832e['red'](_0x36b9c5(0x12e)+_0x5864af)),0x1;}console['log'](a5_0x52832e['cyan'](_0x36b9c5(0x182))),console[_0x36b9c5(0x192)](_0x36b9c5(0x1ab)+a5_0x52832e[_0x36b9c5(0x19b)](_0x414c84)),console[_0x36b9c5(0x192)](_0x36b9c5(0x1b6)+a5_0x52832e['white'](_0x466651['projectName']+'/'+_0x466651[_0x36b9c5(0x187)])),console[_0x36b9c5(0x192)]();const _0x4d0bd2=[],_0x125290=[],_0x1ba706=Date[_0x36b9c5(0x133)]();for(let _0x372488=0x0;_0x372488<_0x40d950[_0x36b9c5(0x17d)];_0x372488++){const _0xfdead2=_0x40d950[_0x372488];_0x40d950['length']>0x1?console[_0x36b9c5(0x192)](_0x36b9c5(0x1a1)+(_0x372488+0x1)+'/'+_0x40d950[_0x36b9c5(0x17d)]+':\x20'+a5_0x52832e[_0x36b9c5(0x19b)](_0xfdead2[_0x36b9c5(0x1b4)])):console[_0x36b9c5(0x192)](_0x36b9c5(0x132)+a5_0x52832e[_0x36b9c5(0x19b)](_0xfdead2[_0x36b9c5(0x1b4)]));const _0x564200=createCommandSpinner(_0x36b9c5(0x1b7)+_0xfdead2['rounds'][_0x36b9c5(0x17d)]+_0x36b9c5(0x138));_0x564200[_0x36b9c5(0x18c)]();try{const {result:_0x3803b7,conversation:_0x28b793}=await runTest(_0x56782a[_0x36b9c5(0x1b9)],_0xfdead2,{'agentId':_0x4ec616,'projectId':_0x4f2cef,'site':_0x414c84,'noEval':_0x4dc2e7,'evaluatorId':_0x2d66fe,'onRoundStart':(_0x92200a,_0x3ee8dd)=>{const _0x4a6e8b=_0x36b9c5;_0x564200[_0x4a6e8b(0x15b)]='Round\x20'+(_0x92200a+0x1)+'/'+_0x3ee8dd+_0x4a6e8b(0x138);},'onRoundComplete':(_0x5a1e8e,_0x243052,_0x514d8a)=>{const _0x390d61=_0x36b9c5,_0x372cc3=formatElapsed(_0x243052);_0x514d8a?console[_0x390d61(0x192)]('\x20\x20Round\x20'+(_0x5a1e8e+0x1)+'/'+_0xfdead2['rounds'][_0x390d61(0x17d)]+_0x390d61(0x13c)+a5_0x52832e[_0x390d61(0x134)]('✓')+'\x20('+_0x372cc3+')'):console['log'](_0x390d61(0x1ba)+(_0x5a1e8e+0x1)+'/'+_0xfdead2['rounds'][_0x390d61(0x17d)]+_0x390d61(0x13c)+a5_0x52832e[_0x390d61(0x176)]('✗'));},'onEvaluationStart':()=>{const _0x29a7db=_0x36b9c5;_0x564200[_0x29a7db(0x15b)]=_0x29a7db(0x1a2);},'onEvaluationComplete':_0x3a1b96=>{const _0x35ffc5=_0x36b9c5,_0x1b87c7=formatElapsed(_0x3a1b96);console[_0x35ffc5(0x192)](_0x35ffc5(0x1ae)+a5_0x52832e['green']('✓')+'\x20('+_0x1b87c7+')');}});_0x564200[_0x36b9c5(0x1ad)](),_0x4d0bd2[_0x36b9c5(0x165)](_0x3803b7),_0x125290[_0x36b9c5(0x165)](_0x28b793);if(_0x3803b7[_0x36b9c5(0x18a)]===_0x36b9c5(0x136))console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x134)](_0x36b9c5(0x185)+_0x3803b7[_0x36b9c5(0x14c)]));else _0x3803b7[_0x36b9c5(0x18a)]===_0x36b9c5(0x14b)?console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20FAIL:\x20'+_0x3803b7[_0x36b9c5(0x14c)])):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20'+_0x3803b7[_0x36b9c5(0x14c)]));_0x3803b7[_0x36b9c5(0x15d)]&&console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x143)+_0x3803b7[_0x36b9c5(0x15d)])),console['log']();}catch(_0x1f29a7){_0x564200[_0x36b9c5(0x1ad)]();const _0x5aa9e8=_0x1f29a7 instanceof Error?_0x1f29a7[_0x36b9c5(0x168)]:String(_0x1f29a7);console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20'+_0x5aa9e8)),console['log'](),_0x4d0bd2[_0x36b9c5(0x165)]({'name':_0xfdead2[_0x36b9c5(0x1b4)],'status':'ERROR','reason':_0x5aa9e8,'timestamp':new Date()[_0x36b9c5(0x16d)](),'duration_ms':0x0});}}const _0xf2176b=Date['now']()-_0x1ba706,_0x4f8dfc=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x3573da=>_0x3573da[_0x36b9c5(0x18a)]===_0x36b9c5(0x136))['length'],_0x4b30d6=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x2a8237=>_0x2a8237['status']==='FAIL')['length'],_0x1737ac=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x682621=>_0x682621[_0x36b9c5(0x18a)]===_0x36b9c5(0x142))[_0x36b9c5(0x17d)];console['log']('━'['repeat'](0x3c)),console[_0x36b9c5(0x192)](_0x36b9c5(0x135)),console[_0x36b9c5(0x192)]('━'[_0x36b9c5(0x19d)](0x3c)),console[_0x36b9c5(0x192)](_0x36b9c5(0x146)+_0x4d0bd2[_0x36b9c5(0x17d)]),console[_0x36b9c5(0x192)]('Passed:\x20\x20\x20'+a5_0x52832e[_0x36b9c5(0x134)](_0x4f8dfc)),console[_0x36b9c5(0x192)]('Failed:\x20\x20\x20'+a5_0x52832e['red'](_0x4b30d6));_0x1737ac>0x0&&console['log'](_0x36b9c5(0x170)+a5_0x52832e['red'](_0x1737ac));console[_0x36b9c5(0x192)](_0x36b9c5(0x172)+formatElapsed(_0xf2176b)),console['log']('━'[_0x36b9c5(0x19d)](0x3c));const _0x3319cd=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x195c2a=>_0x195c2a[_0x36b9c5(0x18a)]!==_0x36b9c5(0x136));if(_0x3319cd[_0x36b9c5(0x17d)]>0x0){console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x173));for(const _0x506d4e of _0x3319cd){const _0x280584=a5_0x52832e[_0x36b9c5(0x176)]('✗'),_0x58321d=_0x506d4e['reason'][_0x36b9c5(0x17d)]>0x32?_0x506d4e[_0x36b9c5(0x14c)][_0x36b9c5(0x160)](0x0,0x32)+_0x36b9c5(0x195):_0x506d4e[_0x36b9c5(0x14c)];console['log']('\x20\x20'+_0x280584+'\x20'+_0x506d4e[_0x36b9c5(0x1b4)]+':\x20'+_0x58321d);}}const _0x1ed1fc={'summary':{'total':_0x4d0bd2[_0x36b9c5(0x17d)],'passed':_0x4f8dfc,'failed':_0x4b30d6,'errors':_0x1737ac>0x0?_0x1737ac:undefined,'duration_ms':_0xf2176b},'tests':_0x4d0bd2,'agent':{'project':_0x466651[_0x36b9c5(0x1be)],'name':_0x466651[_0x36b9c5(0x187)],'site':_0x414c84},'timestamp':new Date(_0x1ba706)[_0x36b9c5(0x16d)]()};try{const _0x5e3c3a=buildCachedTestRun(_0x125290,{'site':_0x414c84,'projectId':_0x4f2cef,'projectName':_0x466651[_0x36b9c5(0x1be)],'agentId':_0x4ec616,'agentName':_0x466651[_0x36b9c5(0x187)],'testYmlPath':a5_0x12bfc0[_0x36b9c5(0x139)](_0x466651[_0x36b9c5(0x1a9)])});saveLastTestRun(_0x5e3c3a);}catch{}if(_0x797dd4!=='table'||_0x3a60ca){const _0x443ab7=formatResults(_0x1ed1fc,_0x797dd4);if(_0x3a60ca)try{a5_0x543ebe[_0x36b9c5(0x175)](_0x3a60ca,_0x443ab7,_0x36b9c5(0x14e)),console[_0x36b9c5(0x192)](),console['log'](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1c7)+_0x3a60ca));}catch(_0x45ac7b){return console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x1ac)+_0x45ac7b)),0x1;}else console['log'](),console[_0x36b9c5(0x192)](_0x443ab7);}return _0x3319cd[_0x36b9c5(0x17d)]>0x0?0x1:0x0;}async[a5_0xdd547f(0x193)](_0x1461b3,_0x20e82d){const _0x106724=a5_0xdd547f,{options:_0x504c46,tdx:_0x1356bf}=_0x1461b3,{definition:_0x4272ae,agentInfo:_0x25cd42,outputFormat:_0xf2be00,outputFile:_0x53e8fc}=_0x20e82d,_0x2cb16a=_0x504c46[_0x106724(0x181)],_0x58c18a=loadLastTestRun();if(!_0x58c18a)return console[_0x106724(0x192)](a5_0x52832e['red'](_0x106724(0x184))),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x156))),0x1;if(_0x58c18a[_0x106724(0x158)][_0x106724(0x187)]!==_0x25cd42[_0x106724(0x187)])return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x171)+_0x58c18a[_0x106724(0x158)][_0x106724(0x187)]+_0x106724(0x13f)+_0x25cd42[_0x106724(0x187)]+'\x22.')),console['log'](a5_0x52832e[_0x106724(0x154)](_0x106724(0x16b))),0x1;const _0x9666e9=new Set(_0x58c18a['conversations'][_0x106724(0x179)](_0x3d91d9=>_0x3d91d9['testName'])),_0x9ab314=_0x4272ae[_0x106724(0x194)][_0x106724(0x1a0)](_0x73910a=>!_0x9666e9['has'](_0x73910a[_0x106724(0x1b4)]));if(_0x9ab314['length']>0x0&&_0x58c18a[_0x106724(0x181)]!==_0x2cb16a)return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1bf))),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x15e)+_0x58c18a[_0x106724(0x181)]+_0x106724(0x183)+_0x2cb16a+'\x22.')),console['log'](a5_0x52832e['dim'](_0x106724(0x16a)+_0x58c18a['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x403195=_0x4272ae[_0x106724(0x194)][_0x106724(0x1a0)](_0x186c2c=>_0x9666e9['has'](_0x186c2c[_0x106724(0x1b4)])),_0x1b5ed4=_0x9ab314;let _0x5c3683;try{_0x5c3683=await setupEvaluatorAgent(_0x1356bf[_0x106724(0x1b9)],_0x504c46['verbose']);}catch(_0x88b693){const _0x58984b=_0x88b693 instanceof Error?_0x88b693[_0x106724(0x168)]:String(_0x88b693);return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x12e)+_0x58984b)),0x1;}console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x1a3)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x106724(0x189)+a5_0x52832e[_0x106724(0x19b)](_0x58c18a[_0x106724(0x17a)])),console[_0x106724(0x192)](_0x106724(0x1b6)+a5_0x52832e[_0x106724(0x19b)](_0x58c18a[_0x106724(0x158)][_0x106724(0x1be)]+'/'+_0x58c18a['agent']['agentName']));_0x1b5ed4[_0x106724(0x17d)]>0x0&&console[_0x106724(0x192)](_0x106724(0x19c)+a5_0x52832e[_0x106724(0x13b)](_0x1b5ed4[_0x106724(0x17d)]));console['log']();const _0x5e134e=[],_0x2f4f21=Date[_0x106724(0x133)](),_0xcddfad=createCommandSpinner(_0x106724(0x14a));if(_0x403195[_0x106724(0x17d)]>0x0)try{const _0x2a9856=await reevaluateFromCache(_0x1356bf[_0x106724(0x1b9)],_0x58c18a,{'tests':_0x403195},{'evaluatorId':_0x5c3683,'onTestStart':(_0x51d177,_0x3ffed6,_0x3ab273)=>{const _0x458e5b=_0x106724;_0xcddfad[_0x458e5b(0x15b)]=_0x458e5b(0x14f)+(_0x3ffed6+0x1)+'/'+_0x3ab273+':\x20'+_0x51d177+_0x458e5b(0x195);if(!_0xcddfad['isSpinning'])_0xcddfad[_0x458e5b(0x18c)]();},'onTestComplete':(_0x2fae1c,_0x133ad3)=>{const _0x249780=_0x106724;_0xcddfad[_0x249780(0x1ad)]();if(_0x133ad3[_0x249780(0x18a)]===_0x249780(0x136))console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x134)](_0x249780(0x185)+_0x2fae1c)+a5_0x52832e[_0x249780(0x154)]('\x20(cached)'));else _0x133ad3[_0x249780(0x18a)]===_0x249780(0x14b)?console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x176)](_0x249780(0x141)+_0x2fae1c+'\x20-\x20'+_0x133ad3[_0x249780(0x14c)])+a5_0x52832e[_0x249780(0x154)]('\x20(cached)')):console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x176)](_0x249780(0x1a4)+_0x2fae1c+_0x249780(0x18b)+_0x133ad3[_0x249780(0x14c)]));_0x133ad3[_0x249780(0x15d)]&&console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x154)]('\x20\x20Conversation:\x20'+_0x133ad3[_0x249780(0x15d)])),_0x5e134e[_0x249780(0x165)](_0x133ad3);},'onTestSkipped':(_0x449a96,_0x255676)=>{const _0x415242=_0x106724;_0xcddfad[_0x415242(0x1ad)](),console[_0x415242(0x192)](a5_0x52832e['yellow']('⚠\x20SKIPPED:\x20'+_0x449a96+_0x415242(0x18b)+_0x255676));}});for(const _0x556e4c of _0x2a9856){!_0x5e134e[_0x106724(0x1b2)](_0x38d6dc=>_0x38d6dc['name']===_0x556e4c[_0x106724(0x1b4)])&&_0x5e134e[_0x106724(0x165)](_0x556e4c);}}catch(_0x45dce8){_0xcddfad[_0x106724(0x1ad)]();const _0x4d801e=_0x45dce8 instanceof Error?_0x45dce8[_0x106724(0x168)]:String(_0x45dce8);return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1af)+_0x4d801e)),0x1;}_0xcddfad['stop']();if(_0x1b5ed4[_0x106724(0x17d)]>0x0){console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x1a3)](_0x106724(0x131)));const {projectId:_0xdda4fb,agentId:_0x1ec552}=_0x58c18a[_0x106724(0x158)];for(const _0x1ce2da of _0x1b5ed4){console['log'](_0x106724(0x147)+a5_0x52832e['white'](_0x1ce2da[_0x106724(0x1b4)]));const _0x2bf2d2=createCommandSpinner('Round\x201/'+_0x1ce2da['rounds']['length']+':\x20Sending\x20user\x20input...');_0x2bf2d2[_0x106724(0x18c)]();try{const {result:_0x16c705}=await runTest(_0x1356bf[_0x106724(0x1b9)],_0x1ce2da,{'agentId':_0x1ec552,'projectId':_0xdda4fb,'site':_0x58c18a[_0x106724(0x181)],'noEval':![],'evaluatorId':_0x5c3683,'onRoundStart':(_0x1d4bb6,_0x1c261e)=>{const _0x4f60aa=_0x106724;_0x2bf2d2[_0x4f60aa(0x15b)]='Round\x20'+(_0x1d4bb6+0x1)+'/'+_0x1c261e+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2a0de1,_0x305af0,_0x42bebe)=>{const _0x5e3963=_0x106724,_0x1b6540=formatElapsed(_0x305af0);_0x42bebe?console['log'](_0x5e3963(0x1ba)+(_0x2a0de1+0x1)+'/'+_0x1ce2da['rounds'][_0x5e3963(0x17d)]+_0x5e3963(0x13c)+a5_0x52832e['green']('✓')+'\x20('+_0x1b6540+')'):console[_0x5e3963(0x192)](_0x5e3963(0x1ba)+(_0x2a0de1+0x1)+'/'+_0x1ce2da[_0x5e3963(0x186)]['length']+'...\x20'+a5_0x52832e[_0x5e3963(0x176)]('✗'));},'onEvaluationStart':()=>{const _0x299488=_0x106724;_0x2bf2d2[_0x299488(0x15b)]=_0x299488(0x1a2);},'onEvaluationComplete':_0x11c3d5=>{const _0x49342f=_0x106724,_0x1c26e9=formatElapsed(_0x11c3d5);console[_0x49342f(0x192)]('\x20\x20Evaluating...\x20'+a5_0x52832e[_0x49342f(0x134)]('✓')+'\x20('+_0x1c26e9+')');}});_0x2bf2d2[_0x106724(0x1ad)](),_0x5e134e[_0x106724(0x165)](_0x16c705);if(_0x16c705[_0x106724(0x18a)]===_0x106724(0x136))console['log'](a5_0x52832e[_0x106724(0x134)](_0x106724(0x185)+_0x16c705[_0x106724(0x14c)])+a5_0x52832e[_0x106724(0x154)](_0x106724(0x191)));else _0x16c705[_0x106724(0x18a)]===_0x106724(0x14b)?console['log'](a5_0x52832e[_0x106724(0x176)](_0x106724(0x141)+_0x16c705[_0x106724(0x14c)])+a5_0x52832e['dim']('\x20(new)')):console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1a4)+_0x16c705[_0x106724(0x14c)]));_0x16c705[_0x106724(0x15d)]&&console[_0x106724(0x192)](a5_0x52832e['dim'](_0x106724(0x188)+_0x16c705[_0x106724(0x15d)]));}catch(_0xcbbd8c){_0x2bf2d2['stop']();const _0x270431=_0xcbbd8c instanceof Error?_0xcbbd8c['message']:String(_0xcbbd8c);console[_0x106724(0x192)](a5_0x52832e['red'](_0x106724(0x1a4)+_0x270431)),_0x5e134e['push']({'name':_0x1ce2da[_0x106724(0x1b4)],'status':_0x106724(0x142),'reason':_0x270431,'timestamp':new Date()[_0x106724(0x16d)](),'duration_ms':0x0});}}}console['log']();const _0x5109f6=Date[_0x106724(0x133)]()-_0x2f4f21,_0x17b44d=_0x5e134e[_0x106724(0x1a0)](_0x1841e1=>_0x1841e1[_0x106724(0x18a)]==='PASS')[_0x106724(0x17d)],_0x4d1d2d=_0x5e134e[_0x106724(0x1a0)](_0x4ec784=>_0x4ec784[_0x106724(0x18a)]===_0x106724(0x14b))['length'],_0x21bf75=_0x5e134e['filter'](_0x117eba=>_0x117eba[_0x106724(0x18a)]===_0x106724(0x142))['length'];console[_0x106724(0x192)]('━'[_0x106724(0x19d)](0x3c)),console['log']('Re-evaluation\x20Summary'),console['log']('━'[_0x106724(0x19d)](0x3c)),console[_0x106724(0x192)](_0x106724(0x146)+_0x5e134e['length']),console[_0x106724(0x192)](_0x106724(0x1c1)+a5_0x52832e[_0x106724(0x134)](_0x17b44d)),console[_0x106724(0x192)](_0x106724(0x169)+a5_0x52832e[_0x106724(0x176)](_0x4d1d2d));_0x21bf75>0x0&&console[_0x106724(0x192)](_0x106724(0x170)+a5_0x52832e[_0x106724(0x176)](_0x21bf75));console[_0x106724(0x192)](_0x106724(0x172)+formatElapsed(_0x5109f6)),console[_0x106724(0x192)]('━'[_0x106724(0x19d)](0x3c));const _0x10d7f3={'summary':{'total':_0x5e134e[_0x106724(0x17d)],'passed':_0x17b44d,'failed':_0x4d1d2d,'errors':_0x21bf75>0x0?_0x21bf75:undefined,'duration_ms':_0x5109f6},'tests':_0x5e134e,'agent':{'project':_0x25cd42[_0x106724(0x1be)],'name':_0x25cd42[_0x106724(0x187)],'site':_0x2cb16a},'timestamp':new Date(_0x2f4f21)['toISOString']()};if(_0xf2be00!==_0x106724(0x1a8)||_0x53e8fc){const _0x4f9b81=formatResults(_0x10d7f3,_0xf2be00);if(_0x53e8fc)try{a5_0x543ebe['writeFileSync'](_0x53e8fc,_0x4f9b81,_0x106724(0x14e)),console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x1c7)+_0x53e8fc));}catch(_0x323d59){return console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e['red']('Error\x20writing\x20output\x20file:\x20'+_0x323d59)),0x1;}else console['log'](),console['log'](_0x4f9b81);}const _0x483268=_0x5e134e['filter'](_0xca958d=>_0xca958d['status']!==_0x106724(0x136));return _0x483268[_0x106724(0x17d)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a6_0x4553(_0x38f78e,_0x3ec555){_0x38f78e=_0x38f78e-0x174;const _0x2e6943=a6_0x2e69();let _0x455370=_0x2e6943[_0x38f78e];return _0x455370;}function a6_0x2e69(){const _0x55416d=['stack','\x0aStack\x20trace:\x0a','x-trino-user','427508cjHXiY','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','noColor','2044748HlTurD','set-cookie','workflow','header','body','includes','Error:\x20','x-auth-token','llm','site','error','message','startsWith','POST','isArray','color','status','type','api','authorization','cdp','headers','\x22.\x20','substring','64792QatFlG','Invalid\x20header\x20format:\x20\x22','trino','GET','x-xsrf-token','46801500OeRNyL','Results\x20saved\x20to\x20','output','137430mLPggy','verbose','set-cookie2','log','<\x20HTTP/1.1\x20','data','trim','PATCH','method','length','file','request','PUT','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','207HUOXfD','join','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','readBodyFromFile','validate','567eXVZZd','DELETE','entries','toLowerCase','4kfHqUv','1839006VoqbZI','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','8245870BfVLDI','toUpperCase','Invalid\x20HTTP\x20method:\x20','execute','llm-proxy'];a6_0x2e69=function(){return _0x55416d;};return a6_0x2e69();}const a6_0x2c8340=a6_0x4553;(function(_0x4b4525,_0x176d74){const _0x327c52=a6_0x4553,_0x49c195=_0x4b4525();while(!![]){try{const _0x19fd9a=-parseInt(_0x327c52(0x1a7))/0x1*(-parseInt(_0x327c52(0x1b2))/0x2)+parseInt(_0x327c52(0x1a8))/0x3+parseInt(_0x327c52(0x1b5))/0x4+parseInt(_0x327c52(0x1aa))/0x5+parseInt(_0x327c52(0x18f))/0x6*(parseInt(_0x327c52(0x1a3))/0x7)+parseInt(_0x327c52(0x187))/0x8*(parseInt(_0x327c52(0x19d))/0x9)+-parseInt(_0x327c52(0x18c))/0xa;if(_0x19fd9a===_0x176d74)break;else _0x49c195['push'](_0x49c195['shift']());}catch(_0x3ea7f9){_0x49c195['push'](_0x49c195['shift']());}}}(a6_0x2e69,0xf1a73));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2c8340(0x182),'proxy-authorization','cookie',a6_0x2c8340(0x1b6),a6_0x2c8340(0x191),a6_0x2c8340(0x18b),a6_0x2c8340(0x176),a6_0x2c8340(0x1b1)]);function isSensitiveHeader(_0x44cc7b){const _0x1de6c3=a6_0x2c8340;return SENSITIVE_HEADERS['has'](_0x44cc7b[_0x1de6c3(0x1a6)]());}function parseHeader(_0x5bf3d2){const _0x464d93=a6_0x2c8340,_0x284d80=_0x5bf3d2['indexOf'](':');if(_0x284d80===-0x1)throw new Error(_0x464d93(0x188)+_0x5bf3d2+_0x464d93(0x185)+_0x464d93(0x19c));const _0x1dfe77=_0x5bf3d2[_0x464d93(0x186)](0x0,_0x284d80)[_0x464d93(0x195)](),_0x50e591=_0x5bf3d2['substring'](_0x284d80+0x1)[_0x464d93(0x195)]();if(!_0x1dfe77)throw new Error(_0x464d93(0x1b3)+_0x5bf3d2+'\x22');return[_0x1dfe77,_0x50e591];}export class ApiCommand extends BaseCommand{['name']=a6_0x2c8340(0x181);['description']=a6_0x2c8340(0x1a0);[a6_0x2c8340(0x1a2)](_0x22184c){const _0x43547d=a6_0x2c8340,{args:_0x2d7600,options:_0xef7d1}=_0x22184c,_0x1dc783=_0xef7d1;if(_0x2d7600['length']===0x0)return _0x43547d(0x1a9);const _0x17a3d5=_0x2d7600[0x0];if(!_0x17a3d5[_0x43547d(0x17b)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x17a3d5;const _0x51d53c=_0x1dc783['data'],_0x12d98d=_0x1dc783[_0x43547d(0x199)];if(_0x51d53c&&_0x12d98d)return _0x43547d(0x19f);const _0x340984=_0x1dc783['method']||_0x43547d(0x18a),_0x193e6e=[_0x43547d(0x18a),_0x43547d(0x17c),_0x43547d(0x19b),_0x43547d(0x1a4),_0x43547d(0x196)];if(!_0x193e6e['includes'](_0x340984[_0x43547d(0x1ab)]()))return _0x43547d(0x1ac)+_0x340984+'.\x20Valid\x20methods:\x20'+_0x193e6e[_0x43547d(0x19e)](',\x20');const _0x53c83b=_0x1dc783['type']||'td',_0xf49542=['td',_0x43547d(0x183),_0x43547d(0x1b7),_0x43547d(0x189),_0x43547d(0x177),_0x43547d(0x1ae)];if(!_0xf49542[_0x43547d(0x174)](_0x53c83b))return'Invalid\x20API\x20type:\x20'+_0x53c83b+'.\x20Valid\x20types:\x20'+_0xf49542[_0x43547d(0x19e)](',\x20');return undefined;}async[a6_0x2c8340(0x1ad)](_0x368201){const _0x4b65b1=a6_0x2c8340,{options:_0x57d4ee,args:_0x30a769,tdx:_0x3433fb}=_0x368201,_0x2c137f=_0x57d4ee,_0x5109d5=_0x30a769[0x0],_0x45f938=(_0x2c137f[_0x4b65b1(0x197)]||'GET')[_0x4b65b1(0x1ab)](),_0x3e6422=_0x2c137f[_0x4b65b1(0x194)],_0x38a68b=_0x2c137f[_0x4b65b1(0x199)],_0x41bd5e=_0x2c137f[_0x4b65b1(0x1b8)],_0x50761f=_0x2c137f[_0x4b65b1(0x180)]||'td';try{const _0x48ceda={};if(_0x41bd5e){const _0x3a3127=Array[_0x4b65b1(0x17d)](_0x41bd5e)?_0x41bd5e:[_0x41bd5e];for(const _0x13c722 of _0x3a3127){const [_0x210bc1,_0x2f147d]=parseHeader(_0x13c722);_0x48ceda[_0x210bc1]=_0x2f147d;}}let _0x2a9224;if(_0x3e6422)_0x2a9224=_0x3e6422;else{if(_0x38a68b)try{_0x2a9224=RawAPI[_0x4b65b1(0x1a1)](_0x38a68b);}catch(_0x436eb7){return console[_0x4b65b1(0x179)](_0x4b65b1(0x175)+(_0x436eb7 instanceof Error?_0x436eb7[_0x4b65b1(0x17a)]:String(_0x436eb7))),0x1;}}const _0x3de8a8={'method':_0x45f938,'apiType':_0x50761f,'includeHeaders':_0x57d4ee['verbose']};_0x2a9224&&(_0x3de8a8[_0x4b65b1(0x1b9)]=_0x2a9224);Object['keys'](_0x48ceda)[_0x4b65b1(0x198)]>0x0&&(_0x3de8a8['headers']=_0x48ceda);if(_0x57d4ee[_0x4b65b1(0x190)]){const _0x45e688=resolveSite(_0x57d4ee[_0x4b65b1(0x178)]),_0x3fd4df=getEndpoint(_0x45e688,_0x50761f),_0x183579=''+_0x3fd4df+_0x5109d5;console[_0x4b65b1(0x179)]('>\x20'+_0x45f938+'\x20'+_0x183579);const _0x3f2e00=getAuthHeaders(_0x45e688),_0x2e5edc={..._0x3f2e00,..._0x48ceda};for(const [_0x39f142,_0x53a03f]of Object[_0x4b65b1(0x1a5)](_0x2e5edc)){!isSensitiveHeader(_0x39f142)&&console[_0x4b65b1(0x179)]('>\x20'+_0x39f142+':\x20'+_0x53a03f);}_0x2a9224&&console['error']('>'),console['error']('');}const _0x5c7461=await _0x3433fb['api'][_0x4b65b1(0x19a)](_0x5109d5,_0x3de8a8);if(_0x57d4ee[_0x4b65b1(0x190)]&&_0x5c7461['headers']){console[_0x4b65b1(0x179)](_0x4b65b1(0x193)+_0x5c7461[_0x4b65b1(0x17f)]);for(const [_0x2faa0d,_0x290d97]of Object[_0x4b65b1(0x1a5)](_0x5c7461[_0x4b65b1(0x184)])){!isSensitiveHeader(_0x2faa0d)&&console[_0x4b65b1(0x179)]('<\x20'+_0x2faa0d+':\x20'+_0x290d97);}console[_0x4b65b1(0x179)]('');}const _0x1256b7=Boolean(_0x57d4ee[_0x4b65b1(0x18e)]),_0x412a69={'color':_0x57d4ee[_0x4b65b1(0x17e)],'noColor':_0x57d4ee[_0x4b65b1(0x1b4)]||_0x1256b7&&!_0x57d4ee[_0x4b65b1(0x17e)]},_0x478e76=colorizeJSON(_0x5c7461['data'],_0x412a69);return _0x57d4ee[_0x4b65b1(0x18e)]?(writeFileSync(_0x57d4ee[_0x4b65b1(0x18e)],_0x478e76),console[_0x4b65b1(0x179)](_0x4b65b1(0x18d)+_0x57d4ee[_0x4b65b1(0x18e)])):console[_0x4b65b1(0x192)](_0x478e76),0x0;}catch(_0x415a35){return _0x415a35 instanceof Error?(console['error'](_0x4b65b1(0x175)+_0x415a35[_0x4b65b1(0x17a)]),_0x57d4ee[_0x4b65b1(0x190)]&&_0x415a35[_0x4b65b1(0x1af)]&&console[_0x4b65b1(0x179)](_0x4b65b1(0x1b0)+_0x415a35[_0x4b65b1(0x1af)])):console['error']('Error:\x20'+String(_0x415a35)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x1e1706=a7_0x4da9;(function(_0x16ac86,_0x51b7d7){const _0x52b71d=a7_0x4da9,_0x1c5fb2=_0x16ac86();while(!![]){try{const _0x34042d=parseInt(_0x52b71d(0x17b))/0x1+-parseInt(_0x52b71d(0x16f))/0x2+parseInt(_0x52b71d(0x16e))/0x3+-parseInt(_0x52b71d(0x146))/0x4*(-parseInt(_0x52b71d(0x15d))/0x5)+parseInt(_0x52b71d(0x152))/0x6+-parseInt(_0x52b71d(0x186))/0x7+-parseInt(_0x52b71d(0x17f))/0x8;if(_0x34042d===_0x51b7d7)break;else _0x1c5fb2['push'](_0x1c5fb2['shift']());}catch(_0x4710be){_0x1c5fb2['push'](_0x1c5fb2['shift']());}}}(a7_0x1172,0x9091f));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';function a7_0x4da9(_0x139f60,_0x11310f){_0x139f60=_0x139f60-0x145;const _0x117249=a7_0x1172();let _0x4da93a=_0x117249[_0x139f60];return _0x4da93a;}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_0x1adc16 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x1172(){const _0xb76170=['logLevel','name','all','warn','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','error','execute','N/A','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','OAuth\x20(browser\x20login)','description','3688tWYWiU','profile','us01','auth:clear','Read\x20credential\x20from\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','green','Read\x20credential\x20from\x20keychain','jobs','/app/mp/ak','✗\x20Validation\x20failed:\x20','site','2925684ermtFx','red','create','password','\x20(profile:\x20','Name:\x20','\x20for\x20profile:\x20','bold','\x20removed\x20from\x20keychain','log','OAuth\x20tokens','950AuKSJf','method','tdx:\x20auth\x20clear','System\x20keychain\x20is\x20not\x20available','last_name','getUserInfo','email','API\x20key\x20cannot\x20be\x20empty','Choose\x20authentication\x20method:','\x0aSetup\x20cancelled','trim','API\x20Key','\x27\x20registered','Setting\x20up\x20authentication\x20for\x20site:\x20','join','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Setup\x20API\x20key\x20authentication\x20interactively','22836vhtzLi','548272ZLdMPB','first_name','message','\x20and\x20','\x20--profile\x20','Credential\x20type:\x20OAuth','yellow','User:\x20','tdx\x20profile:\x20','oauth','apiKey','✓\x20Authentication\x20successful\x0a','944445QCCJrd','No\x20credential\x20found','No\x20credentials\x20found\x20in\x20keychain','status','1122936DwdLra','ERROR','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Enter\x20your\x20TD\x20API\x20key:','filter','API\x20key','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','4257323rnwEKJ','auth:setup','Remove\x20API\x20key\x20from\x20system\x20keychain','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20tdx','\x20(site:\x20','✓\x20Default\x20site\x20set\x20to\x20'];a7_0x1172=function(){return _0xb76170;};return a7_0x1172();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3592a6 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x1e1706(0x18e)]=a7_0x1e1706(0x187);['description']=a7_0x1e1706(0x16d);async['execute'](_0x5b0178){const _0x891da7=a7_0x1e1706,{options:_0x46bc15}=_0x5b0178,_0x14f5ec=_0x46bc15['profile'];console[_0x891da7(0x15b)](a7_0x3592a6[_0x891da7(0x159)]('tdx:\x20auth\x20setup'));const _0x24e5ab=_0x46bc15['site']||_0x891da7(0x148),_0x50f0c7=await promptSiteSelection(_0x24e5ab,_0x14f5ec,'Setup\x20cancelled');if(!_0x50f0c7)return 0x1;const _0x52e8c0=resolveSite(_0x50f0c7);if(isOAuthSupported(_0x52e8c0)){const _0x19d6e0=await a7_0x1adc16({'type':'select','name':_0x891da7(0x15e),'message':_0x891da7(0x165),'choices':[{'title':_0x891da7(0x196),'value':_0x891da7(0x178)},{'title':_0x891da7(0x168),'value':'apikey'}]});if(!_0x19d6e0['method'])return console[_0x891da7(0x15b)](_0x891da7(0x166)),0x1;if(_0x19d6e0['method']==='oauth')return await runOAuthLoginFlow(_0x52e8c0,_0x14f5ec,_0x46bc15[_0x891da7(0x18d)]??LogLevel[_0x891da7(0x180)]),0x0;}console[_0x891da7(0x15b)](_0x891da7(0x16a)+_0x52e8c0),console[_0x891da7(0x15b)](_0x891da7(0x189)),console[_0x891da7(0x15b)]('\x20\x20'+getConsoleUrl(_0x52e8c0,_0x891da7(0x14f)));const _0x5ca8f8=await a7_0x1adc16({'type':_0x891da7(0x155),'name':_0x891da7(0x179),'message':_0x891da7(0x182),'validate':_0x536341=>{const _0x4575d4=_0x891da7;if(!_0x536341||!_0x536341['trim']())return _0x4575d4(0x164);return!![];}});if(!_0x5ca8f8[_0x891da7(0x179)])return console[_0x891da7(0x15b)](_0x891da7(0x166)),0x1;const _0xa63590=_0x5ca8f8[_0x891da7(0x179)];console['log']('Validating\x20API\x20key...');try{const _0xe141e9=TDX[_0x891da7(0x154)]({'site':_0x52e8c0,'apiKey':_0xa63590[_0x891da7(0x167)](),'logLevel':_0x46bc15[_0x891da7(0x18d)]??LogLevel[_0x891da7(0x180)]}),_0x3f1168=await _0xe141e9['jobs'][_0x891da7(0x162)]();console[_0x891da7(0x15b)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3f1168[_0x891da7(0x163)]+')');const _0x4ea088=await isKeychainAvailable();_0x4ea088?(await saveAPIKeyAsync(_0xa63590[_0x891da7(0x167)](),_0x52e8c0,_0x14f5ec),console[_0x891da7(0x15b)](_0x891da7(0x185)+(_0x14f5ec?_0x891da7(0x156)+_0x14f5ec+')':''))):(console[_0x891da7(0x190)](a7_0x3592a6[_0x891da7(0x175)](_0x891da7(0x16c))),console[_0x891da7(0x190)](a7_0x3592a6[_0x891da7(0x175)](_0x891da7(0x191))));if(_0x14f5ec){const _0xe0afae={'site':_0x52e8c0};saveProfileToUserConfig(_0x14f5ec,_0xe0afae),console[_0x891da7(0x15b)]('✓\x20Profile\x20\x27'+_0x14f5ec+_0x891da7(0x169));}else saveDefaultSiteToUserConfig(_0x52e8c0),console[_0x891da7(0x15b)](_0x891da7(0x18c)+_0x52e8c0);const _0x4c7f45=_0x14f5ec?_0x891da7(0x173)+_0x14f5ec:'';return console[_0x891da7(0x15b)](),console[_0x891da7(0x15b)](_0x891da7(0x14b)),console['log'](_0x891da7(0x18a)+_0x4c7f45+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x891da7(0x15b)](_0x891da7(0x18a)+_0x4c7f45+_0x891da7(0x195)),0x0;}catch(_0x5a4b20){if(_0x5a4b20 instanceof HTTPClientError&&_0x5a4b20[_0x891da7(0x17e)]===0x191)return printAuthError(_0x5a4b20),0x1;return console[_0x891da7(0x192)](a7_0x3592a6['red'](_0x891da7(0x150)+(_0x5a4b20 instanceof Error?_0x5a4b20[_0x891da7(0x171)]:String(_0x5a4b20)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1e1706(0x18e)]='auth';[a7_0x1e1706(0x145)]=a7_0x1e1706(0x181);async[a7_0x1e1706(0x193)](_0x1f2aa8){const _0xf50f8c=a7_0x1e1706,{options:_0x35ac01,tdx:_0x346314}=_0x1f2aa8,_0x532a2a=_0x35ac01[_0xf50f8c(0x151)],_0x3ecba0=_0x35ac01['profile'],_0x583297=_0x3ecba0?_0x3ecba0:_0xf50f8c(0x194);console[_0xf50f8c(0x15b)](_0xf50f8c(0x177)+_0x583297+_0xf50f8c(0x18b)+_0x532a2a+')');const _0x1c8d2a=await getOAuthTokens(_0x3ecba0);if(_0x1c8d2a)console[_0xf50f8c(0x15b)](_0xf50f8c(0x174)),console['log'](_0xf50f8c(0x14d)+(_0x3ecba0?_0xf50f8c(0x156)+_0x3ecba0+')':''));else{const _0x434220=await resolveAPIKeyAsync(_0x532a2a,_0x3ecba0);if(_0x434220){const {source:_0x5b6bd6,isDeprecated:_0x29ac0a}=_0x434220,_0x393eb7=_0xf50f8c(0x14a)+_0x5b6bd6;console[_0xf50f8c(0x15b)](_0x29ac0a?a7_0x3592a6[_0xf50f8c(0x175)](_0x393eb7):_0x393eb7);}else console[_0xf50f8c(0x15b)](a7_0x3592a6[_0xf50f8c(0x175)](_0xf50f8c(0x17c)));}try{const _0x153339=await _0x346314[_0xf50f8c(0x14e)][_0xf50f8c(0x162)]();return console[_0xf50f8c(0x15b)](a7_0x3592a6[_0xf50f8c(0x14c)](_0xf50f8c(0x17a))),console['log'](_0xf50f8c(0x176)+_0x153339[_0xf50f8c(0x163)]),(_0x153339[_0xf50f8c(0x170)]||_0x153339['last_name'])&&console[_0xf50f8c(0x15b)](_0xf50f8c(0x157)+[_0x153339[_0xf50f8c(0x170)],_0x153339[_0xf50f8c(0x161)]][_0xf50f8c(0x183)](Boolean)[_0xf50f8c(0x16b)]('\x20')),0x0;}catch(_0x2083e){return _0x2083e instanceof HTTPClientError&&_0x2083e['status']===0x191?printAuthError(_0x2083e,!![],_0x3ecba0):console['error'](a7_0x3592a6[_0xf50f8c(0x153)](_0xf50f8c(0x150)+(_0x2083e instanceof Error?_0x2083e[_0xf50f8c(0x171)]:String(_0x2083e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1e1706(0x18e)]=a7_0x1e1706(0x149);['description']=a7_0x1e1706(0x188);async[a7_0x1e1706(0x193)](_0x180fd3){const _0x4b352f=a7_0x1e1706,{options:_0x3330b8}=_0x180fd3,_0x47ff69=_0x3330b8[_0x4b352f(0x147)];console[_0x4b352f(0x15b)](a7_0x3592a6['bold'](_0x4b352f(0x15f)));const _0x4ba704=await isKeychainAvailable();if(!_0x4ba704)return console[_0x4b352f(0x192)](a7_0x3592a6[_0x4b352f(0x153)](_0x4b352f(0x160))),0x1;const [_0x3e314b,_0x10a4c8]=await Promise[_0x4b352f(0x18f)]([deleteKeychainAPIKey(_0x47ff69),deleteOAuthTokens(_0x47ff69)]);if(_0x3e314b||_0x10a4c8){clearCredentialCache();const _0x24e8b3=[_0x3e314b&&_0x4b352f(0x184),_0x10a4c8&&_0x4b352f(0x15c)][_0x4b352f(0x183)](Boolean)['join'](_0x4b352f(0x172));return console[_0x4b352f(0x15b)]('✓\x20'+_0x24e8b3+_0x4b352f(0x15a)+(_0x47ff69?_0x4b352f(0x156)+_0x47ff69+')':'')),0x0;}else return console[_0x4b352f(0x15b)](_0x4b352f(0x17d)+(_0x47ff69?_0x4b352f(0x158)+_0x47ff69:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-command.js","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IACtC,IAAI,GAAG,YAAY,CAAC;IACpB,WAAW,GAAG,4CAA4C,CAAC;IAEpE,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,OAA6B,CAAC;QAEtD,8BAA8B;QAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAE3C,sBAAsB;QACtB,MAAM,WAAW,GAAI,OAAO,CAAC,IAAe,IAAI,MAAM,CAAC;QACvD,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAChF,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC;QAEpB,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAEvC,
|
|
1
|
+
{"version":3,"file":"auth-command.js","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"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"}
|