@treasuredata/tdx 2026.3.14 → 2026.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0x5dc0e7=a3_0x1376;(function(_0x1b6250,_0xd6d939){const _0x22fe8b=a3_0x1376,_0x5f2117=_0x1b6250();while(!![]){try{const _0x2e2d71=-parseInt(_0x22fe8b(0xfe))/0x1*(parseInt(_0x22fe8b(0xed))/0x2)+-parseInt(_0x22fe8b(0xf1))/0x3*(-parseInt(_0x22fe8b(0xfd))/0x4)+-parseInt(_0x22fe8b(0xf7))/0x5*(parseInt(_0x22fe8b(0xfa))/0x6)+parseInt(_0x22fe8b(0xe4))/0x7+parseInt(_0x22fe8b(0xf0))/0x8+parseInt(_0x22fe8b(0xea))/0x9*(parseInt(_0x22fe8b(0xe5))/0xa)+parseInt(_0x22fe8b(0xec))/0xb;if(_0x2e2d71===_0xd6d939)break;else _0x5f2117['push'](_0x5f2117['shift']());}catch(_0xe9d429){_0x5f2117['push'](_0x5f2117['shift']());}}}(a3_0xf7d8,0x76416));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x1376(_0x5faeee,_0x2a993b){_0x5faeee=_0x5faeee-0xe0;const _0xf7d877=a3_0xf7d8();let _0x1376b9=_0xf7d877[_0x5faeee];return _0x1376b9;}function a3_0xf7d8(){const _0x263cd1=['1566411JMdVhk','1730XozAfl','verbose','Error:\x20','length','description','42111NCkxwo','message','3656378Emtjuq','1456774kbngIu','error','segment','5816392LxDmHp','33LaUlVa','site','resolveParentId','Child\x20name:\x20','Resolving\x20child\x20segment\x20\x27','List\x20activations\x20for\x20a\x20segment','1557605wVHJiq','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','✔\x20Found\x20','18IYLSYj','Site:\x20','Resolved\x20parent\x20ID:\x20','19868SNeEsQ','1SxdDvE','\x20activation','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','data','\x27...','Parent\x20name:\x20','activations','\x20\x20Cause:\x20'];a3_0xf7d8=function(){return _0x263cd1;};return a3_0xf7d8();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x5dc0e7(0xe2);[a3_0x5dc0e7(0xe9)]=a3_0x5dc0e7(0xf6);async['execute'](_0x2ac9f8){const _0x11d14a=a3_0x5dc0e7,{options:_0x4dce2b,args:_0x39cb32,tdx:_0x2f2a7a}=_0x2ac9f8;if(_0x39cb32[_0x11d14a(0xe8)]===0x0)return console[_0x11d14a(0xee)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x11d14a(0xee)](_0x11d14a(0x100)),0x1;try{const {parentId:_0x290c4d,childId:_0x5e6d98}=parseSegmentRef(_0x39cb32[0x0]);if(!_0x5e6d98)return console[_0x11d14a(0xee)](_0x11d14a(0xf8)),console[_0x11d14a(0xee)](_0x11d14a(0x100)),0x1;_0x4dce2b[_0x11d14a(0xe6)]&&(console[_0x11d14a(0xee)](_0x11d14a(0xfb)+_0x4dce2b[_0x11d14a(0xf2)]),console[_0x11d14a(0xee)](_0x11d14a(0xe1)+_0x290c4d),console[_0x11d14a(0xee)](_0x11d14a(0xf4)+_0x5e6d98));const _0xc97e7c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x290c4d+_0x11d14a(0xe0),()=>_0x2f2a7a['segment'][_0x11d14a(0xf3)](_0x290c4d),{'verbose':_0x4dce2b['verbose']}),_0x4c4ce6=_0xc97e7c[_0x11d14a(0x101)];_0x4dce2b['verbose']&&console['error'](_0x11d14a(0xfc)+_0x4c4ce6);const _0x11f82f=await withSpinner(_0x11d14a(0xf5)+_0x5e6d98+'\x27...',()=>_0x2f2a7a[_0x11d14a(0xef)]['resolveSegmentId'](_0x4c4ce6,_0x5e6d98),{'verbose':_0x4dce2b['verbose']}),_0x255b5b=_0x11f82f['data'];_0x4dce2b[_0x11d14a(0xe6)]&&console[_0x11d14a(0xee)]('Resolved\x20child\x20ID:\x20'+_0x255b5b);const _0x4a1060=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x5e6d98+'\x27...',()=>_0x2f2a7a['segment']['listActivations'](_0x4c4ce6,_0x255b5b),{'verbose':_0x4dce2b[_0x11d14a(0xe6)]}),_0x38e801=_0x4a1060[_0x11d14a(0x101)];return console[_0x11d14a(0xee)](_0x11d14a(0xf9)+_0x38e801['length']+_0x11d14a(0xff)+(_0x38e801['length']!==0x1?'s':'')),await handleSDKOutput(_0x38e801,_0x4dce2b),0x0;}catch(_0x17fec4){if(_0x17fec4 instanceof SDKError)return console['error'](_0x11d14a(0xe7)+_0x17fec4[_0x11d14a(0xeb)]),_0x17fec4['cause']&&console[_0x11d14a(0xee)](_0x11d14a(0xe3)+_0x17fec4['cause']),0x1;throw _0x17fec4;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x2ab4e6=a4_0x41fe;(function(_0x35b745,_0x5d7af1){const _0x3926c5=a4_0x41fe,_0xa112a7=_0x35b745();while(!![]){try{const _0x5cfc3f=-parseInt(_0x3926c5(0x19f))/0x1*(-parseInt(_0x3926c5(0x22b))/0x2)+-parseInt(_0x3926c5(0x242))/0x3*(-parseInt(_0x3926c5(0x1e7))/0x4)+parseInt(_0x3926c5(0x1ea))/0x5*(-parseInt(_0x3926c5(0x22d))/0x6)+parseInt(_0x3926c5(0x1af))/0x7+parseInt(_0x3926c5(0x230))/0x8*(-parseInt(_0x3926c5(0x22e))/0x9)+parseInt(_0x3926c5(0x1b7))/0xa*(parseInt(_0x3926c5(0x1bd))/0xb)+-parseInt(_0x3926c5(0x23a))/0xc;if(_0x5cfc3f===_0x5d7af1)break;else _0xa112a7['push'](_0xa112a7['shift']());}catch(_0xf702a8){_0xa112a7['push'](_0xa112a7['shift']());}}}(a4_0x346b,0x9603d));import a4_0x56c742 from'chalk';import a4_0x1af98c 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';function a4_0x346b(){const _0xeda3c5=['created','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aErrors\x20found:','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20created','outputDir','\x20updated','push','\x22...','Using\x20local\x20project:\x20','errors','yes','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Agent\x20\x22','agentName','\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)','prompts','\x0aChanges\x20to\x20agent\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','reason','Cancelled','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Pulling\x20agent\x20\x22','Would\x20pull\x20agent:\x20','newProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','projectName','total','Clone\x20\x22','pushProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','counts','New\x20project:\x20','MISSING_ARGUMENT','\x20\x20Knowledge\x20Base\x20\x22','experimentalArtifacts','repeat','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','projectDir','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Prompts:\x20','agentId','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Project:\x20','Project\x20cloned\x20with\x20errors','parse','\x20\x20Knowledge\x20Bases:\x20','-\x20no\x20files\x20written','\x0aWrite\x20','dim','experimentalKnowledgeBases','580WGpukR','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','308634hrPxtr','24237rrTaqc','✔\x20Context\x20set:\x20','488FNQRSh','yellow','\x20\x20Target:\x20','action','error','hasChanges','no_context','tdx.json','Using\x20project:\x20','\x20\x20Experimental\x20Artifacts:\x20','14027460GBXHlw','llm_project','\x20total','agent:clone','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','red','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','3ksalXG','integrations','execute','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20current\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','agent','source','Project\x20cloned\x20successfully','site','\x20\x20Source:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','pushAgent','green','Source:\x20','llmProject','message','projectId','\x0aChanges:','utf-8','457eAudnv','\x20unchanged','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Agent:\x20','gray','llm','\x22\x20from\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20successfully','\x22\x20to\x20\x22','\x0aPull\x20summary\x20for\x20\x27','description','Pushing\x20agent\x20from\x20\x22','6572475hwsRUW','agents','\x20resources\x20to\x20\x27','New\x20project\x20name\x20is\x20required','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','log','context','\x20changed','70wZAMSO','\x0aPush\x20','\x0a✔\x20Pushed\x20','INVALID_ARGUMENT','\x22:\x20','\x20=\x20','1415898BSkgnk','\x0aChanges\x20to\x20prompt\x20\x27','unchanged','cyan','\x20new','pullAgent','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aPush\x20summary\x20for\x20\x27','Using\x20context\x20project:\x20','-\x20nothing\x20pushed','\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','agent:pull','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Analyzing\x20project\x20\x22','new','textKnowledgeBases','newProjectId','session','\x20\x20Experimental\x20Artifact\x20\x22','\x20|\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','profile','\x20\x20Prompt\x20\x22','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)','diff','\x20\x20Integration\x20\x22','Agent\x20pulled\x20successfully','sourceProjectName','dirname','dryRun','\x0aChanges\x20to\x20integration\x20\x27','force','name','Output\x20path:\x20','Would\x20clone:','updated','join','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','No\x20tdx.json\x20found\x20in\x20','<new-name>','Agent\x20','1341124KuiIMT','\x20\x20Integrations:\x20','\x20errors','35OnFkju','Status:\x20','Cloning\x20\x22','cwd','knowledgeBases','pullProject','\x20resources?','\x27\x20to\x20create\x20the\x20folder\x20structure.','Output:\x20','cwd-config','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Errors:'];a4_0x346b=function(){return _0xeda3c5;};return a4_0x346b();}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';function a4_0x41fe(_0x4b037b,_0xaeace8){_0x4b037b=_0x4b037b-0x194;const _0x346bff=a4_0x346b();let _0x41fea4=_0x346bff[_0x4b037b];return _0x41fea4;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1cfe98){const _0x238a43=a4_0x41fe,_0x2676c2=[];if(_0x1cfe98[_0x238a43(0x212)]!==undefined)_0x2676c2[_0x238a43(0x1fd)](_0x1cfe98[_0x238a43(0x212)]+_0x238a43(0x23c));if(_0x1cfe98[_0x238a43(0x1cc)]!==undefined&&_0x1cfe98[_0x238a43(0x1cc)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x198)](_0x1cfe98[_0x238a43(0x1cc)]+_0x238a43(0x1c1)));if(_0x1cfe98[_0x238a43(0x1f6)]!==undefined&&_0x1cfe98[_0x238a43(0x1f6)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x198)](_0x1cfe98[_0x238a43(0x1f6)]+_0x238a43(0x1fa)));if(_0x1cfe98['updated']!==undefined&&_0x1cfe98['updated']>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x231)](_0x1cfe98[_0x238a43(0x1e1)]+_0x238a43(0x1fc)));if(_0x1cfe98[_0x238a43(0x1bf)]!==undefined&&_0x1cfe98[_0x238a43(0x1bf)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x1a4)](_0x1cfe98[_0x238a43(0x1bf)]+_0x238a43(0x1a0)));if(_0x1cfe98[_0x238a43(0x200)]!==undefined&&_0x1cfe98[_0x238a43(0x200)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x23f)](_0x1cfe98['errors']+_0x238a43(0x1e9)));return _0x2676c2['join'](',\x20');}function displayDiffs(_0x596569,_0x59ed71,_0x36acbc,_0x2ebb3a,_0x5f2926,_0x3f6bf2,_0x3c31bc){const _0x249fc8=a4_0x41fe;for(const _0x491c17 of _0x596569){if(_0x491c17[_0x249fc8(0x1d6)]){const _0x4cdece=_0x491c17[_0x249fc8(0x204)]||_0x491c17['name'];console[_0x249fc8(0x1b4)](_0x249fc8(0x207)+_0x4cdece+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console['log'](_0x491c17[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c));}}for(const _0x43d518 of _0x59ed71){_0x43d518['diff']&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x43d518[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)),console[_0x249fc8(0x1b4)](_0x43d518[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x55b04b of _0x36acbc){_0x55b04b['diff']&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x240)+_0x55b04b['name']+'\x27:'),console['log']('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x55b04b[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x2b9917 of _0x2ebb3a){_0x2b9917[_0x249fc8(0x1d6)]&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x1be)+_0x2b9917['name']+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x2b9917[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x35760a of _0x5f2926){_0x35760a[_0x249fc8(0x1d6)]&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x1dc)+_0x35760a[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x35760a[_0x249fc8(0x1d6)]),console['log']('─'[_0x249fc8(0x21b)](0x3c)));}for(const _0x155302 of _0x3f6bf2){_0x155302[_0x249fc8(0x1d6)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x155302[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x155302['diff']),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x10ff04 of _0x3c31bc){_0x10ff04[_0x249fc8(0x1d6)]&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x1a2)+_0x10ff04[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)),console[_0x249fc8(0x1b4)](_0x10ff04[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2ab4e6(0x1de)]=a4_0x2ab4e6(0x1c9);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x15879a){const _0x337f06=a4_0x2ab4e6,{options:_0x3c54d5,args:_0x34d96b,tdx:_0x4bcb37}=_0x15879a,_0x557b52=_0x34d96b[0x0],_0x3cb794=_0x34d96b[0x1],_0x3fe671=_0x3c54d5['output'],_0x17cf90=_0x3c54d5[_0x337f06(0x1db)],_0x30b045=_0x3c54d5['force'],_0x3f7761=_0x3c54d5[_0x337f06(0x201)],_0x23d9aa=_0x3c54d5[_0x337f06(0x19a)],_0x500ba2=_0x3c54d5[_0x337f06(0x248)];let _0x31cef4;if(_0x557b52){const _0x21637f=a4_0x1af98c[_0x337f06(0x1e2)](_0x557b52,_0x337f06(0x237));if(existsSync(_0x21637f))try{const _0x527eb6=JSON[_0x337f06(0x225)](readFileSync(_0x21637f,_0x337f06(0x19e)));_0x527eb6[_0x337f06(0x23b)]&&(_0x31cef4={'llm_project':_0x527eb6[_0x337f06(0x23b)]});}catch{}}const _0x10cc5e=findAgentConfigPath(process[_0x337f06(0x1ed)]());let _0x5d6fb;if(_0x10cc5e)try{const _0x112fbf=JSON[_0x337f06(0x225)](readFileSync(_0x10cc5e,_0x337f06(0x19e)));_0x112fbf[_0x337f06(0x23b)]&&(_0x5d6fb={'llm_project':_0x112fbf[_0x337f06(0x23b)]});}catch{}const _0x3b1ba0=resolveAgentPullArgs({'arg':_0x557b52,'agentNameArg':_0x3cb794,'agentFlag':_0x500ba2,'contextProject':_0x23d9aa,'argDirConfig':_0x31cef4,'cwdConfigPath':_0x10cc5e||undefined,'cwdConfig':_0x5d6fb}),{projectNameOrId:_0x3c80ef,targetAgentName:_0xb2b658,existingOutputDir:_0x48f5a1,source:_0x4bd8e9}=_0x3b1ba0;if(_0x4bd8e9==='arg-dir')console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x229)]('Using\x20project\x20from\x20'+a4_0x1af98c[_0x337f06(0x1e2)](_0x557b52,_0x337f06(0x237))+':\x20'+_0x3c80ef));else{if(_0x4bd8e9===_0x337f06(0x1f3))console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x229)](_0x337f06(0x238)+_0x3c80ef));else _0x4bd8e9===_0x337f06(0x1b5)&&console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x229)]('Using\x20project\x20from\x20context:\x20'+_0x3c80ef));}if(!_0x3c80ef)return _0x500ba2?(console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x1c3))),console[_0x337f06(0x1b4)](_0x337f06(0x21e)),console[_0x337f06(0x1b4)](_0x337f06(0x1c4))):(console[_0x337f06(0x1b4)](a4_0x56c742['yellow'](_0x337f06(0x1b3))),console[_0x337f06(0x1b4)](_0x337f06(0x1d5)),console[_0x337f06(0x1b4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x337f06(0x1b4)](_0x337f06(0x1d2)),console[_0x337f06(0x1b4)](_0x337f06(0x1c8)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0xb2b658){const {data:_0x29bd4e}=await withSpinner(_0x337f06(0x20d)+_0xb2b658+_0x337f06(0x1a6)+_0x3c80ef+_0x337f06(0x1fe),()=>_0x4bcb37[_0x337f06(0x1a5)][_0x337f06(0x1c2)](_0x3c80ef,_0xb2b658,_0x3fe671,{'dryRun':_0x17cf90,'force':_0x30b045}));if(_0x17cf90)return console[_0x337f06(0x1b4)](a4_0x56c742['yellow'](_0x337f06(0x202))),console['log'](_0x337f06(0x20e)+_0x29bd4e[_0x337f06(0x204)]),console['log'](_0x337f06(0x1df)+_0x29bd4e['outputPath']),_0x29bd4e[_0x337f06(0x1d6)]&&(console[_0x337f06(0x1b4)](_0x337f06(0x19d)),console['log']('─'[_0x337f06(0x21b)](0x3c)),console['log'](_0x29bd4e['diff']),console['log']('─'[_0x337f06(0x21b)](0x3c))),0x0;return console['log'](a4_0x56c742[_0x337f06(0x198)](_0x337f06(0x1d8))),console[_0x337f06(0x1b4)]('Agent:\x20'+_0x29bd4e[_0x337f06(0x204)]),console[_0x337f06(0x1b4)](_0x337f06(0x1f2)+_0x29bd4e['outputPath']),console['log'](_0x337f06(0x1eb)+(_0x29bd4e['isNew']?a4_0x56c742['green'](_0x337f06(0x1cc)):_0x29bd4e[_0x337f06(0x235)]?a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x1e1)):a4_0x56c742['gray'](_0x337f06(0x1bf)))),0x0;}const _0x32ff6f=_0x48f5a1||_0x3fe671,{data:_0x92d3a0}=await withSpinner(_0x337f06(0x1cb)+_0x3c80ef+'\x22...',()=>_0x4bcb37['llm'][_0x337f06(0x1ef)](_0x3c80ef,_0x32ff6f,{'dryRun':!![]})),_0x532742=_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1b0)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1ee)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)]['textKnowledgeBases'][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x206)][_0x337f06(0x1cc)]+_0x92d3a0['counts'][_0x337f06(0x243)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x22a)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x21a)][_0x337f06(0x1cc)],_0x1de07c=_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1b0)][_0x337f06(0x1e1)]+_0x92d3a0['counts']['knowledgeBases']['updated']+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1cd)][_0x337f06(0x1e1)]+_0x92d3a0[_0x337f06(0x216)]['prompts'][_0x337f06(0x1e1)]+_0x92d3a0[_0x337f06(0x216)]['integrations'][_0x337f06(0x1e1)]+_0x92d3a0['counts'][_0x337f06(0x22a)]['updated']+_0x92d3a0[_0x337f06(0x216)]['experimentalArtifacts'][_0x337f06(0x1e1)],_0x111c27=_0x92d3a0[_0x337f06(0x216)]['agents'][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)]['knowledgeBases'][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1cd)][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x206)]['unchanged']+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x243)][_0x337f06(0x1bf)]+_0x92d3a0['counts'][_0x337f06(0x22a)][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x21a)]['unchanged'];console[_0x337f06(0x1b4)](_0x337f06(0x1ac)+_0x92d3a0['projectName']+'\x27:'),console[_0x337f06(0x1b4)]('\x20\x20'+a4_0x56c742['green']('+\x20'+_0x532742+_0x337f06(0x1c1))+_0x337f06(0x1d1)+a4_0x56c742['yellow']('~\x20'+_0x1de07c+_0x337f06(0x1b6))+'\x20|\x20'+a4_0x56c742[_0x337f06(0x229)]('=\x20'+_0x111c27+_0x337f06(0x1a0))),console['log'](_0x337f06(0x20b)+formatCountSummary(_0x92d3a0['counts'][_0x337f06(0x1b0)])),console['log'](_0x337f06(0x226)+formatCountSummary(_0x92d3a0['counts'][_0x337f06(0x1ee)])),console[_0x337f06(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1cd)])),console[_0x337f06(0x1b4)](_0x337f06(0x21f)+formatCountSummary(_0x92d3a0[_0x337f06(0x216)]['prompts'])),console['log'](_0x337f06(0x1e8)+formatCountSummary(_0x92d3a0[_0x337f06(0x216)]['integrations']));const _0x412bfa=_0x92d3a0[_0x337f06(0x216)]['experimentalKnowledgeBases'][_0x337f06(0x212)]>0x0||_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x21a)]['total']>0x0;_0x412bfa&&(console[_0x337f06(0x1b4)](_0x337f06(0x241)+formatCountSummary(_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x22a)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x92d3a0[_0x337f06(0x216)]['experimentalArtifacts'])));console[_0x337f06(0x1b4)](_0x337f06(0x232)+a4_0x56c742[_0x337f06(0x1c0)](_0x92d3a0[_0x337f06(0x1fb)])),displayDiffs(_0x92d3a0[_0x337f06(0x1b0)],_0x92d3a0[_0x337f06(0x1ee)],_0x92d3a0[_0x337f06(0x1cd)],_0x92d3a0['prompts'],_0x92d3a0['integrations'],_0x92d3a0[_0x337f06(0x22a)],_0x92d3a0['experimentalArtifacts']);if(_0x17cf90)return console['log'](a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x1a8))),0x0;if(_0x532742===0x0&&_0x1de07c===0x0)return console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x198)](_0x337f06(0x210))),saveSessionContext({'llm_project':_0x92d3a0['projectName']},_0x3c54d5[_0x337f06(0x1cf)]),console['log'](a4_0x56c742[_0x337f06(0x198)](_0x337f06(0x22f)+a4_0x56c742[_0x337f06(0x229)]('llm_project')+_0x337f06(0x1bc)+a4_0x56c742[_0x337f06(0x1c0)](_0x92d3a0['projectName']))),0x0;if(!_0x3f7761&&!_0x30b045){if(!isInteractive())return console['error'](a4_0x56c742['red']('\x0aError:'),_0x337f06(0x1f4)),console[_0x337f06(0x234)](a4_0x56c742['dim'](_0x337f06(0x215))),0x1;const _0x3c4b41=await confirmKey(_0x337f06(0x228)+(_0x532742+_0x1de07c)+'\x20files?');if(!_0x3c4b41)return console['log'](a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x20a)),_0x337f06(0x227)),0x1;}const {data:_0x5d973a}=await withSpinner('Writing\x20files...',()=>_0x4bcb37[_0x337f06(0x1a5)][_0x337f06(0x1ef)](_0x3c80ef,_0x32ff6f,{'force':_0x30b045}));return console[_0x337f06(0x1b4)](a4_0x56c742['green']('\x0a✔\x20Pulled\x20'+(_0x532742+_0x1de07c)+'\x20files\x20to\x20'+_0x5d973a[_0x337f06(0x1fb)])),saveSessionContext({'llm_project':_0x5d973a[_0x337f06(0x211)]},_0x3c54d5[_0x337f06(0x1cf)]),console['log'](a4_0x56c742['green']('✔\x20Context\x20set:\x20'+a4_0x56c742[_0x337f06(0x229)](_0x337f06(0x23b))+'\x20=\x20'+a4_0x56c742[_0x337f06(0x1c0)](_0x5d973a[_0x337f06(0x211)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x2ab4e6(0x23d);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x2ab4e6(0x244)](_0x281670){const _0x17b04a=a4_0x2ab4e6,{options:_0x1d16d3,args:_0x5330a3,tdx:_0x4f94cd}=_0x281670,_0x41e8dd=_0x5330a3[0x0],_0x4966aa=_0x1d16d3[_0x17b04a(0x1de)],_0xab7299=_0x1d16d3[_0x17b04a(0x1db)],_0x5540c6=_0x1d16d3[_0x17b04a(0x201)],_0x14c2a3=_0x1d16d3[_0x17b04a(0x194)],_0x2b4a07=_0x1d16d3[_0x17b04a(0x19a)];let _0x1cfe2c;const _0x5b996f=findAgentConfigPath(process[_0x17b04a(0x1ed)]());if(_0x41e8dd){const _0x173d52=a4_0x1af98c[_0x17b04a(0x1e2)](_0x41e8dd,'tdx.json');existsSync(_0x173d52)?(_0x1cfe2c=_0x41e8dd,console[_0x17b04a(0x1b4)](a4_0x56c742['dim'](_0x17b04a(0x1ff)+_0x41e8dd))):_0x1cfe2c=_0x41e8dd;}else{if(_0x5b996f)_0x1cfe2c=a4_0x1af98c['dirname'](_0x5b996f),console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x246)+_0x1cfe2c));else{if(_0x2b4a07){const _0x1db3cd=sanitizeForFilesystem(_0x2b4a07);let _0x5b1a0c=_0x1db3cd,_0x56adb5=a4_0x1af98c['join'](process['cwd'](),_0x17b04a(0x1b0),_0x1db3cd,_0x17b04a(0x237));if(!existsSync(_0x56adb5)){const _0x4bdaa3=normalizeName(_0x2b4a07),_0x43bb09=a4_0x1af98c[_0x17b04a(0x1e2)](process[_0x17b04a(0x1ed)](),_0x17b04a(0x1b0),_0x4bdaa3,_0x17b04a(0x237));existsSync(_0x43bb09)&&(_0x5b1a0c=_0x4bdaa3,_0x56adb5=_0x43bb09);}if(existsSync(_0x56adb5))_0x1cfe2c=a4_0x1af98c[_0x17b04a(0x1da)](_0x56adb5),console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x1ff)+_0x1cfe2c));else{const _0x3f5066=_0x1d16d3[_0x17b04a(0x1d3)];if(_0x3f5066)throw new SDKError(ErrorCode[_0x17b04a(0x1ba)],_0x17b04a(0x1a9)+_0x2b4a07+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x17b04a(0x208)+_0x17b04a(0x245)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x2b4a07+'\x0a')+(_0x17b04a(0x20c)+_0x5b1a0c+'\x20--name\x20'+(_0x4966aa||_0x17b04a(0x1e5))+'\x20--profile\x20'+_0x3f5066)});_0x1cfe2c=_0x2b4a07,console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x1c6)+_0x2b4a07));}}}}if(!_0x1cfe2c)return console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x1ca))),console[_0x17b04a(0x1b4)](_0x17b04a(0x1a7)),console[_0x17b04a(0x1b4)](_0x17b04a(0x21c)),console[_0x17b04a(0x1b4)](_0x17b04a(0x205)),console[_0x17b04a(0x1b4)](_0x17b04a(0x196)),0x1;if(!_0x4966aa)throw new SDKError(ErrorCode[_0x17b04a(0x218)],_0x17b04a(0x1b2),undefined,{'helpText':_0x17b04a(0x1e3)});if(!_0x5540c6&&!_0xab7299){if(!isInteractive())return console[_0x17b04a(0x234)](a4_0x56c742[_0x17b04a(0x23f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x17b04a(0x234)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x215))),0x1;const _0x3f3b7f=await confirmKey(_0x17b04a(0x213)+_0x1cfe2c+'\x22\x20to\x20new\x20project\x20\x22'+_0x4966aa+'\x22?');if(!_0x3f3b7f)return console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x20a))),0x1;}const {data:_0x4fcafc}=await withSpinner(_0x17b04a(0x1ec)+_0x1cfe2c+_0x17b04a(0x1ab)+_0x4966aa+_0x17b04a(0x1fe),()=>_0x4f94cd['llm']['cloneProject'](_0x1cfe2c,_0x4966aa,{'dryRun':_0xab7299}));if(_0xab7299){console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x221))),console[_0x17b04a(0x1b4)](_0x17b04a(0x199)+_0x4fcafc[_0x17b04a(0x1d9)]),console[_0x17b04a(0x1b4)](_0x17b04a(0x217)+_0x4966aa),console[_0x17b04a(0x1b4)](_0x17b04a(0x1e0)),console[_0x17b04a(0x1b4)]('\x20\x20Agents:\x20'+_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x1b0)][_0x17b04a(0x1f6)]),console[_0x17b04a(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+_0x4fcafc['counts'][_0x17b04a(0x1ee)]['created']),console[_0x17b04a(0x1b4)](_0x17b04a(0x21f)+_0x4fcafc[_0x17b04a(0x216)]['prompts'][_0x17b04a(0x1f6)]);const _0xb3fdbe=_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)]['created']>0x0||_0x4fcafc[_0x17b04a(0x216)]['experimentalArtifacts'][_0x17b04a(0x1f6)]>0x0;return _0xb3fdbe&&(console[_0x17b04a(0x1b4)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1f6)]),console['log'](_0x17b04a(0x239)+_0x4fcafc['counts']['experimentalArtifacts'][_0x17b04a(0x1f6)])),0x0;}const _0x3353e6=_0x4fcafc['counts'][_0x17b04a(0x1b0)][_0x17b04a(0x200)]>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x1ee)][_0x17b04a(0x200)]>0x0||_0x4fcafc[_0x17b04a(0x216)]['prompts']['errors']>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)]['errors']>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x21a)][_0x17b04a(0x200)]>0x0;_0x3353e6?console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x224))):console['log'](a4_0x56c742[_0x17b04a(0x198)](_0x17b04a(0x24a)));console[_0x17b04a(0x1b4)](_0x17b04a(0x199)+_0x4fcafc[_0x17b04a(0x1d9)]),console['log'](_0x17b04a(0x217)+_0x4fcafc[_0x17b04a(0x20f)]),console[_0x17b04a(0x1b4)]('New\x20project\x20ID:\x20'+_0x4fcafc['newProjectId']),console[_0x17b04a(0x1b4)](),console[_0x17b04a(0x1b4)]('Summary:'),console[_0x17b04a(0x1b4)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x1b0)])),console[_0x17b04a(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)]['knowledgeBases'])),console[_0x17b04a(0x1b4)](_0x17b04a(0x21f)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x206)])),console[_0x17b04a(0x1b4)](_0x17b04a(0x1e8)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x243)]));const _0x1822db=_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1f6)]>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1e1)]>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1bf)]>0x0||_0x4fcafc['counts'][_0x17b04a(0x21a)][_0x17b04a(0x1f6)]>0x0||_0x4fcafc[_0x17b04a(0x216)]['experimentalArtifacts']['updated']>0x0||_0x4fcafc['counts'][_0x17b04a(0x21a)][_0x17b04a(0x1bf)]>0x0;_0x1822db&&(console[_0x17b04a(0x1b4)](_0x17b04a(0x241)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)]['experimentalKnowledgeBases'])),console[_0x17b04a(0x1b4)](_0x17b04a(0x239)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x21a)])));if(_0x3353e6){console[_0x17b04a(0x1b4)](),console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)]('Errors:'));for(const _0x218923 of _0x4fcafc[_0x17b04a(0x1b0)]){_0x218923[_0x17b04a(0x233)]===_0x17b04a(0x234)&&console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)]('\x20\x20Agent\x20\x22'+_0x218923['agentName']+'\x22:\x20'+_0x218923[_0x17b04a(0x234)]));}for(const _0x619ff9 of _0x4fcafc[_0x17b04a(0x1ee)]){_0x619ff9[_0x17b04a(0x233)]==='error'&&console['log'](a4_0x56c742[_0x17b04a(0x23f)](_0x17b04a(0x219)+_0x619ff9['name']+_0x17b04a(0x1bb)+_0x619ff9[_0x17b04a(0x234)]));}for(const _0x511673 of _0x4fcafc[_0x17b04a(0x206)]){_0x511673[_0x17b04a(0x233)]===_0x17b04a(0x234)&&console[_0x17b04a(0x1b4)](a4_0x56c742['red'](_0x17b04a(0x1d4)+_0x511673['name']+_0x17b04a(0x1bb)+_0x511673['error']));}for(const _0x48a8af of _0x4fcafc[_0x17b04a(0x243)]){_0x48a8af[_0x17b04a(0x233)]===_0x17b04a(0x234)&&console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)](_0x17b04a(0x1d7)+_0x48a8af['name']+_0x17b04a(0x1bb)+_0x48a8af[_0x17b04a(0x234)]));}for(const _0x14d459 of _0x4fcafc[_0x17b04a(0x22a)]){_0x14d459[_0x17b04a(0x233)]==='error'&&console[_0x17b04a(0x1b4)](a4_0x56c742['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x14d459[_0x17b04a(0x1de)]+_0x17b04a(0x1bb)+_0x14d459['error']));}for(const _0x2f2bad of _0x4fcafc[_0x17b04a(0x21a)]){_0x2f2bad[_0x17b04a(0x233)]==='error'&&console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)](_0x17b04a(0x1d0)+_0x2f2bad[_0x17b04a(0x1de)]+_0x17b04a(0x1bb)+_0x2f2bad[_0x17b04a(0x234)]));}return 0x1;}console[_0x17b04a(0x1b4)]();const _0x34178d=getLLMProjectUrl(_0x14c2a3,_0x4fcafc[_0x17b04a(0x1ce)]);return console[_0x17b04a(0x1b4)](_0x17b04a(0x223)+a4_0x56c742[_0x17b04a(0x1c0)](_0x34178d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2ab4e6(0x1de)]='agent:push';[a4_0x2ab4e6(0x1ad)]=a4_0x2ab4e6(0x22c);async['execute'](_0x57ca53){const _0x20908f=a4_0x2ab4e6,{options:_0x18ca9a,args:_0x536db2,tdx:_0xc277e9}=_0x57ca53;let _0x7f95f3=_0x536db2[0x0]||process['cwd']();const _0x4d9c07=_0x18ca9a['dryRun'],_0x1037e7=_0x18ca9a[_0x20908f(0x1dd)],_0x4487d9=_0x18ca9a[_0x20908f(0x201)],_0x550731=_0x18ca9a[_0x20908f(0x194)],_0x1eb8ed=a4_0x1af98c[_0x20908f(0x1e2)](_0x7f95f3,'agent.yml'),_0x1dea10=existsSync(_0x1eb8ed);if(_0x1dea10){const {data:_0x5168ff}=await withSpinner(_0x20908f(0x1ae)+_0x7f95f3+_0x20908f(0x1fe),()=>_0xc277e9[_0x20908f(0x1a5)][_0x20908f(0x197)](_0x7f95f3,{'dryRun':_0x4d9c07,'force':_0x1037e7}));if(_0x4d9c07)return console['log'](a4_0x56c742[_0x20908f(0x231)](_0x20908f(0x221))),console[_0x20908f(0x1b4)](_0x20908f(0x1a1)+_0x5168ff['agentName']),0x0;if(_0x5168ff[_0x20908f(0x233)]===_0x20908f(0x234))return console['log'](a4_0x56c742[_0x20908f(0x23f)]('Failed\x20to\x20push\x20agent:\x20'+_0x5168ff['error'])),0x1;console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x198)](_0x20908f(0x1e6)+_0x5168ff[_0x20908f(0x233)]+_0x20908f(0x1aa))),console[_0x20908f(0x1b4)](_0x20908f(0x1a3)+_0x5168ff[_0x20908f(0x204)]);if(_0x5168ff[_0x20908f(0x220)]&&_0x5168ff[_0x20908f(0x19c)]){const _0xe9a0cc=getLLMAgentChatUrl(_0x550731,_0x5168ff['projectId'],_0x5168ff[_0x20908f(0x220)]);console[_0x20908f(0x1b4)]('Chat:\x20'+a4_0x56c742['cyan'](_0xe9a0cc));}return 0x0;}const _0x5a084f=_0x18ca9a[_0x20908f(0x19a)],_0x11a657=resolveProjectFromContext(_0x7f95f3,_0x5a084f);if(_0x11a657['found'])_0x7f95f3=_0x11a657[_0x20908f(0x21d)],_0x11a657[_0x20908f(0x249)]==='context'&&console[_0x20908f(0x1b4)](a4_0x56c742['dim']('Using\x20project:\x20'+_0x7f95f3));else{let _0x2588f3=_0x20908f(0x23e);_0x11a657[_0x20908f(0x209)]==='no_local_folder'&&(_0x2588f3=_0x11a657[_0x20908f(0x19b)]+_0x20908f(0x247)+_0x11a657[_0x20908f(0x19a)]+_0x20908f(0x1f1));throw new SDKError(ErrorCode[_0x20908f(0x1ba)],_0x11a657['reason']===_0x20908f(0x236)?_0x11a657[_0x20908f(0x19b)]:_0x20908f(0x1e4)+_0x7f95f3,undefined,{'helpText':_0x2588f3});}const {data:_0x4eb584}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xc277e9[_0x20908f(0x1a5)][_0x20908f(0x214)](_0x7f95f3,{'dryRun':!![]})),_0x1226c0=_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1b0)][_0x20908f(0x200)]>0x0;if(_0x1226c0){console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1f8)));for(const _0xfd04f5 of _0x4eb584['agents']){_0xfd04f5[_0x20908f(0x233)]===_0x20908f(0x234)&&console['log'](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x203)+_0xfd04f5['agentName']+_0x20908f(0x1bb)+_0xfd04f5[_0x20908f(0x234)]));}return 0x1;}const _0x18eae7=_0x4eb584[_0x20908f(0x216)]['agents'][_0x20908f(0x1f6)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1ee)][_0x20908f(0x1f6)]+_0x4eb584['counts'][_0x20908f(0x1cd)][_0x20908f(0x1f6)]+_0x4eb584['counts']['prompts'][_0x20908f(0x1f6)]+_0x4eb584[_0x20908f(0x216)]['integrations']['created']+_0x4eb584['counts'][_0x20908f(0x22a)]['created']+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)][_0x20908f(0x1f6)],_0x2e6e9d=_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1b0)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1ee)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1cd)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x206)]['updated']+_0x4eb584['counts'][_0x20908f(0x243)]['updated']+_0x4eb584['counts'][_0x20908f(0x22a)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)]['updated'],_0x27be13=_0x4eb584['counts']['agents'][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)]['knowledgeBases'][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1cd)][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)]['prompts'][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x243)][_0x20908f(0x1bf)]+_0x4eb584['counts'][_0x20908f(0x22a)][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)]['unchanged'];console['log'](_0x20908f(0x1c5)+_0x4eb584[_0x20908f(0x211)]+'\x27:'),console[_0x20908f(0x1b4)]('\x20\x20'+a4_0x56c742['green']('+\x20'+_0x18eae7+_0x20908f(0x1c1))+_0x20908f(0x1d1)+a4_0x56c742[_0x20908f(0x231)]('~\x20'+_0x2e6e9d+_0x20908f(0x1b6))+_0x20908f(0x1d1)+a4_0x56c742[_0x20908f(0x229)]('=\x20'+_0x27be13+_0x20908f(0x1a0))),console[_0x20908f(0x1b4)](_0x20908f(0x20b)+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1b0)])),console[_0x20908f(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1ee)])),console[_0x20908f(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1cd)])),console[_0x20908f(0x1b4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4eb584['counts']['prompts'])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4eb584['counts'][_0x20908f(0x243)]));const _0x291f4f=_0x4eb584[_0x20908f(0x216)][_0x20908f(0x22a)]['created']>0x0||_0x4eb584[_0x20908f(0x216)][_0x20908f(0x22a)]['updated']>0x0||_0x4eb584['counts']['experimentalKnowledgeBases'][_0x20908f(0x1bf)]>0x0||_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)][_0x20908f(0x1f6)]>0x0||_0x4eb584[_0x20908f(0x216)]['experimentalArtifacts'][_0x20908f(0x1e1)]>0x0||_0x4eb584['counts']['experimentalArtifacts'][_0x20908f(0x1bf)]>0x0;_0x291f4f&&(console[_0x20908f(0x1b4)](_0x20908f(0x241)+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x22a)])),console[_0x20908f(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4eb584['counts'][_0x20908f(0x21a)])));console['log'](_0x20908f(0x195)+a4_0x56c742[_0x20908f(0x1c0)](_0x7f95f3)),displayDiffs(_0x4eb584[_0x20908f(0x1b0)],_0x4eb584['knowledgeBases'],_0x4eb584[_0x20908f(0x1cd)],_0x4eb584[_0x20908f(0x206)],_0x4eb584[_0x20908f(0x243)],_0x4eb584['experimentalKnowledgeBases'],_0x4eb584[_0x20908f(0x21a)]);if(_0x4d9c07)return console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x231)](_0x20908f(0x222))),0x0;if(_0x18eae7===0x0&&_0x2e6e9d===0x0){console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x198)](_0x20908f(0x1f9)));const _0x53237d=getLLMProjectUrl(_0x550731,_0x4eb584[_0x20908f(0x19c)]);return console[_0x20908f(0x1b4)](_0x20908f(0x223)+a4_0x56c742[_0x20908f(0x1c0)](_0x53237d)),0x0;}if(!_0x4487d9&&!_0x1037e7){if(!isInteractive())return console[_0x20908f(0x234)](a4_0x56c742[_0x20908f(0x23f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20908f(0x234)](a4_0x56c742[_0x20908f(0x229)](_0x20908f(0x215))),0x1;const _0x5b2d4c=await confirmKey(_0x20908f(0x1b8)+(_0x18eae7+_0x2e6e9d)+_0x20908f(0x1f0));if(!_0x5b2d4c)return console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x231)](_0x20908f(0x20a)),_0x20908f(0x1c7)),0x1;}const {data:_0x24f270}=await withSpinner('Pushing\x20to\x20project...',()=>_0xc277e9['llm'][_0x20908f(0x214)](_0x7f95f3,{'force':_0x1037e7})),_0x12f951=_0x24f270['counts'][_0x20908f(0x1b0)][_0x20908f(0x200)]>0x0||_0x24f270[_0x20908f(0x216)]['knowledgeBases'][_0x20908f(0x200)]>0x0||_0x24f270[_0x20908f(0x216)][_0x20908f(0x1cd)]['errors']>0x0||_0x24f270[_0x20908f(0x216)][_0x20908f(0x206)][_0x20908f(0x200)]>0x0;if(_0x12f951){console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x231)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x20908f(0x1b4)](),console['log'](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1f5)));for(const _0x2c0362 of _0x24f270[_0x20908f(0x1b0)]){_0x2c0362['action']===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742['red'](_0x20908f(0x203)+_0x2c0362[_0x20908f(0x204)]+_0x20908f(0x1bb)+_0x2c0362['error']));}for(const _0x4b7e75 of _0x24f270[_0x20908f(0x1ee)]){_0x4b7e75['action']===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4b7e75[_0x20908f(0x1de)]+'\x22:\x20'+_0x4b7e75[_0x20908f(0x234)]));}for(const _0x2e902d of _0x24f270['textKnowledgeBases']){_0x2e902d[_0x20908f(0x233)]===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1f7)+_0x2e902d['name']+'\x22:\x20'+_0x2e902d[_0x20908f(0x234)]));}for(const _0xabc859 of _0x24f270['prompts']){_0xabc859['action']===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1d4)+_0xabc859[_0x20908f(0x1de)]+_0x20908f(0x1bb)+_0xabc859[_0x20908f(0x234)]));}for(const _0x502f0f of _0x24f270[_0x20908f(0x243)]){_0x502f0f[_0x20908f(0x233)]===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1d7)+_0x502f0f[_0x20908f(0x1de)]+_0x20908f(0x1bb)+_0x502f0f['error']));}return 0x1;}console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x198)](_0x20908f(0x1b9)+(_0x18eae7+_0x2e6e9d)+_0x20908f(0x1b1)+_0x24f270['projectName']+'\x27'));const _0x465cba=getLLMProjectUrl(_0x550731,_0x24f270[_0x20908f(0x19c)]);return console[_0x20908f(0x1b4)](_0x20908f(0x223)+a4_0x56c742[_0x20908f(0x1c0)](_0x465cba)),0x0;}}
|
|
1
|
+
function a4_0x1bae(_0x313b93,_0x4265ad){_0x313b93=_0x313b93-0xe3;const _0x20a3b0=a4_0x20a3();let _0x1bae41=_0x20a3b0[_0x313b93];return _0x1bae41;}const a4_0x48f969=a4_0x1bae;(function(_0x16abdc,_0x3230ee){const _0x296771=a4_0x1bae,_0x4f0612=_0x16abdc();while(!![]){try{const _0xf7878d=-parseInt(_0x296771(0x16b))/0x1*(-parseInt(_0x296771(0xf1))/0x2)+parseInt(_0x296771(0x11b))/0x3*(-parseInt(_0x296771(0x15b))/0x4)+-parseInt(_0x296771(0x127))/0x5+parseInt(_0x296771(0xee))/0x6+-parseInt(_0x296771(0xe6))/0x7+parseInt(_0x296771(0x148))/0x8*(parseInt(_0x296771(0x10c))/0x9)+parseInt(_0x296771(0x185))/0xa*(-parseInt(_0x296771(0x14e))/0xb);if(_0xf7878d===_0x3230ee)break;else _0x4f0612['push'](_0x4f0612['shift']());}catch(_0x22c5e4){_0x4f0612['push'](_0x4f0612['shift']());}}}(a4_0x20a3,0xad7b9));import a4_0x997563 from'chalk';import a4_0x46d5d3 from'path';function a4_0x20a3(){const _0x48e8f9=['Agent:\x20','Using\x20project\x20from\x20context:\x20','\x22\x20to\x20new\x20project\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Analyzing\x20changes\x20to\x20push...','Summary:','Using\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20errors','\x20\x20Experimental\x20Artifact\x20\x22','yellow','\x20resources?','Chat:\x20','Agent\x20','unchanged','source','Clone\x20\x22','execute','green','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pulled\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Knowledge\x20Base\x20\x22','pullAgent','16450lcZnUN','yes','Pushing\x20to\x20project...','Pulling\x20agent\x20\x22','Analyzing\x20project\x20\x22','agent.yml','\x20\x20Source:\x20','\x22...','log','errors','\x20resources\x20to\x20\x27','llmProject','total','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','message','description','red','512666joWUwb','gray','site','profile','Source:\x20','\x0aWrite\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20--name\x20','5911248ANHMOF','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','27826PgiUIY','\x20\x20Prompt\x20\x22','tdx.json','llm_project','new','MISSING_ARGUMENT','\x20unchanged','Agent\x20pulled\x20successfully','Cannot\x20clone\x20from\x20context\x20project\x20\x22','no_context','diff','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Project\x20cloned\x20successfully','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aChanges:','Project:\x20','<new-name>','no_local_folder','cyan','\x0aError:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20new','updated','projectId','name','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','18eGsNeW','action','dryRun','error','dim','projectDir','\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','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','pullProject','outputDir','\x20\x20Integration\x20\x22','INVALID_ARGUMENT','Using\x20current\x20project:\x20','agentId','\x20\x20Text\x20Knowledge\x20Base\x20\x22','3HHSwix','Output\x20path:\x20','\x20\x20Prompts:\x20','experimentalArtifacts','\x20\x20Experimental\x20Artifacts:\x20','session','\x0aPush\x20','Dry\x20run\x20-\x20no\x20files\x20written','prompts','created','experimentalKnowledgeBases','integrations','2155835AGpcbM','\x20\x20Knowledge\x20Bases:\x20','\x0a✔\x20Pushed\x20','hasChanges','Using\x20local\x20project:\x20','llm','repeat','✔\x20Context\x20set:\x20','agentName','join','\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','\x0aErrors\x20found:','\x20\x20tdx\x20agent\x20pull\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Would\x20pull\x20agent:\x20','reason','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Would\x20clone:','\x20=\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','agent','\x22:\x20','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent:push','\x22\x20to\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','counts','-\x20no\x20files\x20written','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','push','projectName','pushAgent','1216720qbmxcE','\x20changed','dirname','sourceProjectName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20created','8272jKjQtr','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Agents:\x20','cwd','cwd-config','Cancelled','Errors:','agents','\x20|\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Target:\x20','newProjectId','context','525068eVNLcy','No\x20tdx.json\x20found\x20in\x20','\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)','\x0aChanges\x20to\x20agent\x20\x27','\x20files?','New\x20project:\x20','utf-8','force','knowledgeBases','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20Agent\x20\x22','outputPath','textKnowledgeBases','pushProject','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Failed\x20to\x20push\x20agent:\x20','93xVgalJ'];a4_0x20a3=function(){return _0x48e8f9;};return a4_0x20a3();}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(_0x3f3de9){const _0x3fbc08=a4_0x1bae,_0x3337f7=[];if(_0x3f3de9[_0x3fbc08(0x191)]!==undefined)_0x3337f7[_0x3fbc08(0x145)](_0x3f3de9[_0x3fbc08(0x191)]+'\x20total');if(_0x3f3de9[_0x3fbc08(0xf5)]!==undefined&&_0x3f3de9[_0x3fbc08(0xf5)]>0x0)_0x3337f7[_0x3fbc08(0x145)](a4_0x997563[_0x3fbc08(0x17e)](_0x3f3de9['new']+'\x20new'));if(_0x3f3de9[_0x3fbc08(0x124)]!==undefined&&_0x3f3de9[_0x3fbc08(0x124)]>0x0)_0x3337f7['push'](a4_0x997563[_0x3fbc08(0x17e)](_0x3f3de9['created']+_0x3fbc08(0x14d)));if(_0x3f3de9[_0x3fbc08(0x108)]!==undefined&&_0x3f3de9['updated']>0x0)_0x3337f7[_0x3fbc08(0x145)](a4_0x997563[_0x3fbc08(0x176)](_0x3f3de9[_0x3fbc08(0x108)]+'\x20updated'));if(_0x3f3de9[_0x3fbc08(0x17a)]!==undefined&&_0x3f3de9[_0x3fbc08(0x17a)]>0x0)_0x3337f7[_0x3fbc08(0x145)](a4_0x997563[_0x3fbc08(0xe7)](_0x3f3de9['unchanged']+_0x3fbc08(0xf7)));if(_0x3f3de9['errors']!==undefined&&_0x3f3de9[_0x3fbc08(0x18e)]>0x0)_0x3337f7[_0x3fbc08(0x145)](a4_0x997563[_0x3fbc08(0xe5)](_0x3f3de9['errors']+_0x3fbc08(0x174)));return _0x3337f7[_0x3fbc08(0x130)](',\x20');}function displayDiffs(_0x4fc58c,_0x22b7bd,_0x451186,_0xc3df5b,_0x1afdb9,_0x299ede,_0x13de30){const _0x302efa=a4_0x1bae;for(const _0x28947c of _0x4fc58c){if(_0x28947c['diff']){const _0x382eff=_0x28947c[_0x302efa(0x12f)]||_0x28947c[_0x302efa(0x10a)];console['log'](_0x302efa(0x15e)+_0x382eff+'\x27:'),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c)),console[_0x302efa(0x18d)](_0x28947c[_0x302efa(0xfb)]),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c));}}for(const _0x57c343 of _0x22b7bd){_0x57c343['diff']&&(console[_0x302efa(0x18d)](_0x302efa(0x106)+_0x57c343['name']+'\x27:'),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c)),console[_0x302efa(0x18d)](_0x57c343[_0x302efa(0xfb)]),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c)));}for(const _0x28b56b of _0x451186){_0x28b56b[_0x302efa(0xfb)]&&(console[_0x302efa(0x18d)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x28b56b[_0x302efa(0x10a)]+'\x27:'),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c)),console['log'](_0x28b56b[_0x302efa(0xfb)]),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c)));}for(const _0x2cec44 of _0xc3df5b){_0x2cec44[_0x302efa(0xfb)]&&(console[_0x302efa(0x18d)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2cec44[_0x302efa(0x10a)]+'\x27:'),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c)),console[_0x302efa(0x18d)](_0x2cec44['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x140721 of _0x1afdb9){_0x140721['diff']&&(console[_0x302efa(0x18d)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x140721[_0x302efa(0x10a)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x302efa(0x18d)](_0x140721[_0x302efa(0xfb)]),console[_0x302efa(0x18d)]('─'['repeat'](0x3c)));}for(const _0x185798 of _0x299ede){_0x185798[_0x302efa(0xfb)]&&(console[_0x302efa(0x18d)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x185798[_0x302efa(0x10a)]+'\x27:'),console[_0x302efa(0x18d)]('─'['repeat'](0x3c)),console['log'](_0x185798[_0x302efa(0xfb)]),console['log']('─'[_0x302efa(0x12d)](0x3c)));}for(const _0x3aece2 of _0x13de30){_0x3aece2[_0x302efa(0xfb)]&&(console[_0x302efa(0x18d)](_0x302efa(0xf0)+_0x3aece2[_0x302efa(0x10a)]+'\x27:'),console[_0x302efa(0x18d)]('─'['repeat'](0x3c)),console[_0x302efa(0x18d)](_0x3aece2['diff']),console[_0x302efa(0x18d)]('─'[_0x302efa(0x12d)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x48f969(0xe4)]=a4_0x48f969(0x16f);async[a4_0x48f969(0x17d)](_0x5dfbf0){const _0x55d229=a4_0x48f969,{options:_0x413c31,args:_0x15ef12,tdx:_0x34f544}=_0x5dfbf0,_0x1c7b3f=_0x15ef12[0x0],_0x151117=_0x15ef12[0x1],_0x444415=_0x413c31['output'],_0x5d302d=_0x413c31[_0x55d229(0x10e)],_0x3cd8e2=_0x413c31[_0x55d229(0x162)],_0x5b2cd7=_0x413c31[_0x55d229(0x186)],_0x4a4592=_0x413c31[_0x55d229(0x190)],_0x3e50d3=_0x413c31[_0x55d229(0x13b)];let _0x456734;if(_0x1c7b3f){const _0x455527=a4_0x46d5d3['join'](_0x1c7b3f,_0x55d229(0xf3));if(existsSync(_0x455527))try{const _0x40416f=JSON['parse'](readFileSync(_0x455527,_0x55d229(0x161)));_0x40416f['llm_project']&&(_0x456734={'llm_project':_0x40416f['llm_project']});}catch{}}const _0x8041a4=findAgentConfigPath(process['cwd']());let _0x1641ab;if(_0x8041a4)try{const _0x4935b4=JSON['parse'](readFileSync(_0x8041a4,_0x55d229(0x161)));_0x4935b4[_0x55d229(0xf4)]&&(_0x1641ab={'llm_project':_0x4935b4[_0x55d229(0xf4)]});}catch{}const _0x3d2ff1=resolveAgentPullArgs({'arg':_0x1c7b3f,'agentNameArg':_0x151117,'agentFlag':_0x3e50d3,'contextProject':_0x4a4592,'argDirConfig':_0x456734,'cwdConfigPath':_0x8041a4||undefined,'cwdConfig':_0x1641ab}),{projectNameOrId:_0x37bab5,targetAgentName:_0x5236f0,existingOutputDir:_0x19bb6f,source:_0x4c2bbf}=_0x3d2ff1;if(_0x4c2bbf==='arg-dir')console[_0x55d229(0x18d)](a4_0x997563[_0x55d229(0x110)]('Using\x20project\x20from\x20'+a4_0x46d5d3[_0x55d229(0x130)](_0x1c7b3f,_0x55d229(0xf3))+':\x20'+_0x37bab5));else{if(_0x4c2bbf===_0x55d229(0x152))console[_0x55d229(0x18d)](a4_0x997563['dim'](_0x55d229(0x172)+_0x37bab5));else _0x4c2bbf===_0x55d229(0x15a)&&console[_0x55d229(0x18d)](a4_0x997563['dim'](_0x55d229(0x16d)+_0x37bab5));}if(!_0x37bab5)return _0x3e50d3?(console[_0x55d229(0x18d)](a4_0x997563['yellow'](_0x55d229(0xef))),console['log'](_0x55d229(0x14f)),console[_0x55d229(0x18d)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x997563[_0x55d229(0x176)](_0x55d229(0x169))),console[_0x55d229(0x18d)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x55d229(0x18d)](_0x55d229(0x112)),console[_0x55d229(0x18d)](_0x55d229(0x164)),console['log'](_0x55d229(0x131)),console[_0x55d229(0x18d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x5236f0){const {data:_0x14fd64}=await withSpinner(_0x55d229(0x188)+_0x5236f0+'\x22\x20from\x20project\x20\x22'+_0x37bab5+_0x55d229(0x18c),()=>_0x34f544[_0x55d229(0x12c)][_0x55d229(0x184)](_0x37bab5,_0x5236f0,_0x444415,{'dryRun':_0x5d302d,'force':_0x3cd8e2}));if(_0x5d302d)return console[_0x55d229(0x18d)](a4_0x997563[_0x55d229(0x176)](_0x55d229(0x122))),console[_0x55d229(0x18d)](_0x55d229(0x135)+_0x14fd64[_0x55d229(0x12f)]),console[_0x55d229(0x18d)](_0x55d229(0x11c)+_0x14fd64[_0x55d229(0x166)]),_0x14fd64[_0x55d229(0xfb)]&&(console[_0x55d229(0x18d)](_0x55d229(0x100)),console[_0x55d229(0x18d)]('─'[_0x55d229(0x12d)](0x3c)),console['log'](_0x14fd64[_0x55d229(0xfb)]),console[_0x55d229(0x18d)]('─'[_0x55d229(0x12d)](0x3c))),0x0;return console[_0x55d229(0x18d)](a4_0x997563['green'](_0x55d229(0xf8))),console[_0x55d229(0x18d)](_0x55d229(0x16c)+_0x14fd64[_0x55d229(0x12f)]),console[_0x55d229(0x18d)]('Output:\x20'+_0x14fd64[_0x55d229(0x166)]),console[_0x55d229(0x18d)]('Status:\x20'+(_0x14fd64['isNew']?a4_0x997563[_0x55d229(0x17e)]('new'):_0x14fd64[_0x55d229(0x12a)]?a4_0x997563[_0x55d229(0x176)](_0x55d229(0x108)):a4_0x997563[_0x55d229(0xe7)]('unchanged'))),0x0;}const _0x3dcd2f=_0x19bb6f||_0x444415,{data:_0x396f69}=await withSpinner(_0x55d229(0x189)+_0x37bab5+_0x55d229(0x18c),()=>_0x34f544[_0x55d229(0x12c)][_0x55d229(0x114)](_0x37bab5,_0x3dcd2f,{'dryRun':!![]})),_0x4cffc5=_0x396f69[_0x55d229(0x142)]['agents'][_0x55d229(0xf5)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x163)]['new']+_0x396f69[_0x55d229(0x142)][_0x55d229(0x167)][_0x55d229(0xf5)]+_0x396f69['counts'][_0x55d229(0x123)][_0x55d229(0xf5)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x126)][_0x55d229(0xf5)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x125)][_0x55d229(0xf5)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x11e)]['new'],_0x8846fd=_0x396f69[_0x55d229(0x142)]['agents'][_0x55d229(0x108)]+_0x396f69[_0x55d229(0x142)]['knowledgeBases'][_0x55d229(0x108)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x167)][_0x55d229(0x108)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x123)][_0x55d229(0x108)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x126)][_0x55d229(0x108)]+_0x396f69['counts']['experimentalKnowledgeBases'][_0x55d229(0x108)]+_0x396f69[_0x55d229(0x142)]['experimentalArtifacts'][_0x55d229(0x108)],_0x163849=_0x396f69[_0x55d229(0x142)][_0x55d229(0x155)][_0x55d229(0x17a)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x163)][_0x55d229(0x17a)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x167)]['unchanged']+_0x396f69[_0x55d229(0x142)][_0x55d229(0x123)][_0x55d229(0x17a)]+_0x396f69['counts'][_0x55d229(0x126)][_0x55d229(0x17a)]+_0x396f69['counts']['experimentalKnowledgeBases'][_0x55d229(0x17a)]+_0x396f69[_0x55d229(0x142)][_0x55d229(0x11e)][_0x55d229(0x17a)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x396f69['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x997563[_0x55d229(0x17e)]('+\x20'+_0x4cffc5+_0x55d229(0x107))+_0x55d229(0x156)+a4_0x997563[_0x55d229(0x176)]('~\x20'+_0x8846fd+_0x55d229(0x149))+_0x55d229(0x156)+a4_0x997563['dim']('=\x20'+_0x163849+_0x55d229(0xf7))),console[_0x55d229(0x18d)]('\x20\x20Agents:\x20'+formatCountSummary(_0x396f69[_0x55d229(0x142)]['agents'])),console[_0x55d229(0x18d)](_0x55d229(0x128)+formatCountSummary(_0x396f69[_0x55d229(0x142)]['knowledgeBases'])),console[_0x55d229(0x18d)](_0x55d229(0x141)+formatCountSummary(_0x396f69[_0x55d229(0x142)][_0x55d229(0x167)])),console['log'](_0x55d229(0x11d)+formatCountSummary(_0x396f69[_0x55d229(0x142)][_0x55d229(0x123)])),console[_0x55d229(0x18d)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x396f69[_0x55d229(0x142)][_0x55d229(0x126)]));const _0x171b2a=_0x396f69['counts']['experimentalKnowledgeBases'][_0x55d229(0x191)]>0x0||_0x396f69[_0x55d229(0x142)][_0x55d229(0x11e)][_0x55d229(0x191)]>0x0;_0x171b2a&&(console[_0x55d229(0x18d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x396f69[_0x55d229(0x142)]['experimentalKnowledgeBases'])),console[_0x55d229(0x18d)](_0x55d229(0x11f)+formatCountSummary(_0x396f69[_0x55d229(0x142)][_0x55d229(0x11e)])));console['log'](_0x55d229(0x158)+a4_0x997563['cyan'](_0x396f69[_0x55d229(0x115)])),displayDiffs(_0x396f69[_0x55d229(0x155)],_0x396f69[_0x55d229(0x163)],_0x396f69['textKnowledgeBases'],_0x396f69['prompts'],_0x396f69[_0x55d229(0x126)],_0x396f69[_0x55d229(0x125)],_0x396f69[_0x55d229(0x11e)]);if(_0x5d302d)return console[_0x55d229(0x18d)](a4_0x997563[_0x55d229(0x176)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4cffc5===0x0&&_0x8846fd===0x0)return console[_0x55d229(0x18d)](a4_0x997563[_0x55d229(0x17e)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x396f69[_0x55d229(0x146)]},_0x413c31['session']),console[_0x55d229(0x18d)](a4_0x997563[_0x55d229(0x17e)]('✔\x20Context\x20set:\x20'+a4_0x997563['dim'](_0x55d229(0xf4))+'\x20=\x20'+a4_0x997563[_0x55d229(0x104)](_0x396f69[_0x55d229(0x146)]))),0x0;if(!_0x5b2cd7&&!_0x3cd8e2){if(!isInteractive())return console[_0x55d229(0x10f)](a4_0x997563['red'](_0x55d229(0x105)),_0x55d229(0x14c)),console['error'](a4_0x997563[_0x55d229(0x110)](_0x55d229(0xec))),0x1;const _0x8ad070=await confirmKey(_0x55d229(0xeb)+(_0x4cffc5+_0x8846fd)+_0x55d229(0x15f));if(!_0x8ad070)return console[_0x55d229(0x18d)](a4_0x997563[_0x55d229(0x176)](_0x55d229(0x153)),_0x55d229(0x143)),0x1;}const {data:_0x51c9b0}=await withSpinner('Writing\x20files...',()=>_0x34f544[_0x55d229(0x12c)]['pullProject'](_0x37bab5,_0x3dcd2f,{'force':_0x3cd8e2}));return console[_0x55d229(0x18d)](a4_0x997563['green'](_0x55d229(0x180)+(_0x4cffc5+_0x8846fd)+'\x20files\x20to\x20'+_0x51c9b0[_0x55d229(0x115)])),saveSessionContext({'llm_project':_0x51c9b0[_0x55d229(0x146)]},_0x413c31[_0x55d229(0x120)]),console['log'](a4_0x997563[_0x55d229(0x17e)](_0x55d229(0x12e)+a4_0x997563[_0x55d229(0x110)]('llm_project')+_0x55d229(0x139)+a4_0x997563[_0x55d229(0x104)](_0x51c9b0[_0x55d229(0x146)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x48f969(0x10a)]='agent:clone';['description']=a4_0x48f969(0x134);async[a4_0x48f969(0x17d)](_0x3fc445){const _0x1aa6be=a4_0x48f969,{options:_0x53d8ee,args:_0x4bb072,tdx:_0x208f3b}=_0x3fc445,_0x220d36=_0x4bb072[0x0],_0xe49eed=_0x53d8ee[_0x1aa6be(0x10a)],_0x307020=_0x53d8ee['dryRun'],_0x320fcb=_0x53d8ee['yes'],_0x13e950=_0x53d8ee[_0x1aa6be(0xe8)],_0x44785a=_0x53d8ee[_0x1aa6be(0x190)];let _0x133073;const _0x3fb774=findAgentConfigPath(process[_0x1aa6be(0x151)]());if(_0x220d36){const _0x406a50=a4_0x46d5d3['join'](_0x220d36,_0x1aa6be(0xf3));existsSync(_0x406a50)?(_0x133073=_0x220d36,console[_0x1aa6be(0x18d)](a4_0x997563[_0x1aa6be(0x110)](_0x1aa6be(0x12b)+_0x220d36))):_0x133073=_0x220d36;}else{if(_0x3fb774)_0x133073=a4_0x46d5d3[_0x1aa6be(0x14a)](_0x3fb774),console['log'](a4_0x997563[_0x1aa6be(0x110)](_0x1aa6be(0x118)+_0x133073));else{if(_0x44785a){const _0x110bb8=sanitizeForFilesystem(_0x44785a);let _0x2860f7=_0x110bb8,_0x3cb72b=a4_0x46d5d3[_0x1aa6be(0x130)](process[_0x1aa6be(0x151)](),_0x1aa6be(0x155),_0x110bb8,_0x1aa6be(0xf3));if(!existsSync(_0x3cb72b)){const _0x343806=normalizeName(_0x44785a),_0x571314=a4_0x46d5d3['join'](process[_0x1aa6be(0x151)](),_0x1aa6be(0x155),_0x343806,_0x1aa6be(0xf3));existsSync(_0x571314)&&(_0x2860f7=_0x343806,_0x3cb72b=_0x571314);}if(existsSync(_0x3cb72b))_0x133073=a4_0x46d5d3['dirname'](_0x3cb72b),console['log'](a4_0x997563[_0x1aa6be(0x110)](_0x1aa6be(0x12b)+_0x133073));else{const _0x5dae59=_0x53d8ee[_0x1aa6be(0xe9)];if(_0x5dae59)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1aa6be(0xf9)+_0x44785a+_0x1aa6be(0x13d),undefined,{'helpText':_0x1aa6be(0x113)+_0x1aa6be(0x10b)+(_0x1aa6be(0x133)+_0x44785a+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2860f7+_0x1aa6be(0xed)+(_0xe49eed||_0x1aa6be(0x102))+'\x20--profile\x20'+_0x5dae59)});_0x133073=_0x44785a,console['log'](a4_0x997563[_0x1aa6be(0x110)]('Using\x20context\x20project:\x20'+_0x44785a));}}}}if(!_0x133073)return console['log'](a4_0x997563['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x1aa6be(0x18d)](_0x1aa6be(0x181)),console[_0x1aa6be(0x18d)](_0x1aa6be(0xfc)),console[_0x1aa6be(0x18d)](_0x1aa6be(0x15d)),console[_0x1aa6be(0x18d)](_0x1aa6be(0x17f)),0x1;if(!_0xe49eed)throw new SDKError(ErrorCode[_0x1aa6be(0xf6)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x1aa6be(0x144)});if(!_0x320fcb&&!_0x307020){if(!isInteractive())return console['error'](a4_0x997563['red']('\x0aError:'),_0x1aa6be(0x14c)),console[_0x1aa6be(0x10f)](a4_0x997563[_0x1aa6be(0x110)](_0x1aa6be(0xec))),0x1;const _0x4e19f5=await confirmKey(_0x1aa6be(0x17c)+_0x133073+_0x1aa6be(0x16e)+_0xe49eed+'\x22?');if(!_0x4e19f5)return console[_0x1aa6be(0x18d)](a4_0x997563[_0x1aa6be(0x176)](_0x1aa6be(0x153))),0x1;}const {data:_0x30cf48}=await withSpinner('Cloning\x20\x22'+_0x133073+_0x1aa6be(0x140)+_0xe49eed+'\x22...',()=>_0x208f3b[_0x1aa6be(0x12c)]['cloneProject'](_0x133073,_0xe49eed,{'dryRun':_0x307020}));if(_0x307020){console[_0x1aa6be(0x18d)](a4_0x997563[_0x1aa6be(0x176)](_0x1aa6be(0xfe))),console[_0x1aa6be(0x18d)](_0x1aa6be(0xea)+_0x30cf48[_0x1aa6be(0x14b)]),console[_0x1aa6be(0x18d)](_0x1aa6be(0x160)+_0xe49eed),console[_0x1aa6be(0x18d)](_0x1aa6be(0x138)),console[_0x1aa6be(0x18d)](_0x1aa6be(0x150)+_0x30cf48['counts'][_0x1aa6be(0x155)]['created']),console[_0x1aa6be(0x18d)]('\x20\x20Knowledge\x20Bases:\x20'+_0x30cf48['counts']['knowledgeBases']['created']),console[_0x1aa6be(0x18d)](_0x1aa6be(0x11d)+_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x123)][_0x1aa6be(0x124)]);const _0x3f331b=_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x125)]['created']>0x0||_0x30cf48['counts'][_0x1aa6be(0x11e)][_0x1aa6be(0x124)]>0x0;return _0x3f331b&&(console['log'](_0x1aa6be(0x13e)+_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x125)][_0x1aa6be(0x124)]),console[_0x1aa6be(0x18d)](_0x1aa6be(0x11f)+_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x11e)][_0x1aa6be(0x124)])),0x0;}const _0x5bdb98=_0x30cf48['counts'][_0x1aa6be(0x155)][_0x1aa6be(0x18e)]>0x0||_0x30cf48['counts'][_0x1aa6be(0x163)]['errors']>0x0||_0x30cf48[_0x1aa6be(0x142)]['prompts'][_0x1aa6be(0x18e)]>0x0||_0x30cf48['counts'][_0x1aa6be(0x125)][_0x1aa6be(0x18e)]>0x0||_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x11e)][_0x1aa6be(0x18e)]>0x0;_0x5bdb98?console[_0x1aa6be(0x18d)](a4_0x997563[_0x1aa6be(0x176)]('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x997563[_0x1aa6be(0x17e)](_0x1aa6be(0xfd)));console[_0x1aa6be(0x18d)](_0x1aa6be(0xea)+_0x30cf48['sourceProjectName']),console[_0x1aa6be(0x18d)](_0x1aa6be(0x160)+_0x30cf48['newProjectName']),console[_0x1aa6be(0x18d)]('New\x20project\x20ID:\x20'+_0x30cf48[_0x1aa6be(0x159)]),console[_0x1aa6be(0x18d)](),console[_0x1aa6be(0x18d)](_0x1aa6be(0x171)),console[_0x1aa6be(0x18d)](_0x1aa6be(0x150)+formatCountSummary(_0x30cf48[_0x1aa6be(0x142)]['agents'])),console[_0x1aa6be(0x18d)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x163)])),console[_0x1aa6be(0x18d)](_0x1aa6be(0x11d)+formatCountSummary(_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x123)])),console[_0x1aa6be(0x18d)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x30cf48['counts'][_0x1aa6be(0x126)]));const _0x5ec85a=_0x30cf48['counts']['experimentalKnowledgeBases'][_0x1aa6be(0x124)]>0x0||_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x125)][_0x1aa6be(0x108)]>0x0||_0x30cf48[_0x1aa6be(0x142)]['experimentalKnowledgeBases'][_0x1aa6be(0x17a)]>0x0||_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x11e)][_0x1aa6be(0x124)]>0x0||_0x30cf48[_0x1aa6be(0x142)][_0x1aa6be(0x11e)]['updated']>0x0||_0x30cf48['counts'][_0x1aa6be(0x11e)]['unchanged']>0x0;_0x5ec85a&&(console['log'](_0x1aa6be(0x13e)+formatCountSummary(_0x30cf48['counts'][_0x1aa6be(0x125)])),console[_0x1aa6be(0x18d)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x30cf48[_0x1aa6be(0x142)]['experimentalArtifacts'])));if(_0x5bdb98){console['log'](),console[_0x1aa6be(0x18d)](a4_0x997563[_0x1aa6be(0xe5)](_0x1aa6be(0x154)));for(const _0x4f6594 of _0x30cf48[_0x1aa6be(0x155)]){_0x4f6594[_0x1aa6be(0x10d)]==='error'&&console['log'](a4_0x997563['red'](_0x1aa6be(0x165)+_0x4f6594['agentName']+_0x1aa6be(0x13c)+_0x4f6594[_0x1aa6be(0x10f)]));}for(const _0x40c931 of _0x30cf48[_0x1aa6be(0x163)]){_0x40c931[_0x1aa6be(0x10d)]==='error'&&console[_0x1aa6be(0x18d)](a4_0x997563[_0x1aa6be(0xe5)](_0x1aa6be(0x183)+_0x40c931[_0x1aa6be(0x10a)]+_0x1aa6be(0x13c)+_0x40c931[_0x1aa6be(0x10f)]));}for(const _0x97dc91 of _0x30cf48[_0x1aa6be(0x123)]){_0x97dc91[_0x1aa6be(0x10d)]==='error'&&console[_0x1aa6be(0x18d)](a4_0x997563[_0x1aa6be(0xe5)](_0x1aa6be(0xf2)+_0x97dc91[_0x1aa6be(0x10a)]+_0x1aa6be(0x13c)+_0x97dc91['error']));}for(const _0x1a2b4f of _0x30cf48[_0x1aa6be(0x126)]){_0x1a2b4f['action']==='error'&&console['log'](a4_0x997563['red'](_0x1aa6be(0x116)+_0x1a2b4f['name']+_0x1aa6be(0x13c)+_0x1a2b4f[_0x1aa6be(0x10f)]));}for(const _0x4e4b19 of _0x30cf48[_0x1aa6be(0x125)]){_0x4e4b19[_0x1aa6be(0x10d)]==='error'&&console['log'](a4_0x997563[_0x1aa6be(0xe5)](_0x1aa6be(0xff)+_0x4e4b19['name']+_0x1aa6be(0x13c)+_0x4e4b19[_0x1aa6be(0x10f)]));}for(const _0x2e2387 of _0x30cf48[_0x1aa6be(0x11e)]){_0x2e2387[_0x1aa6be(0x10d)]===_0x1aa6be(0x10f)&&console[_0x1aa6be(0x18d)](a4_0x997563['red'](_0x1aa6be(0x175)+_0x2e2387[_0x1aa6be(0x10a)]+_0x1aa6be(0x13c)+_0x2e2387[_0x1aa6be(0x10f)]));}return 0x1;}console[_0x1aa6be(0x18d)]();const _0x491124=getLLMProjectUrl(_0x13e950,_0x30cf48[_0x1aa6be(0x159)]);return console['log']('Project:\x20'+a4_0x997563[_0x1aa6be(0x104)](_0x491124)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x48f969(0x13f);[a4_0x48f969(0xe4)]=a4_0x48f969(0x192);async['execute'](_0x13cc4e){const _0x191b62=a4_0x48f969,{options:_0x114d5f,args:_0xdd8592,tdx:_0x8e5f17}=_0x13cc4e;let _0x8c0403=_0xdd8592[0x0]||process[_0x191b62(0x151)]();const _0x11fc0c=_0x114d5f[_0x191b62(0x10e)],_0x4b1ac2=_0x114d5f[_0x191b62(0x162)],_0x1fd244=_0x114d5f['yes'],_0x3406bb=_0x114d5f[_0x191b62(0xe8)],_0x48975d=a4_0x46d5d3[_0x191b62(0x130)](_0x8c0403,_0x191b62(0x18a)),_0x1c3025=existsSync(_0x48975d);if(_0x1c3025){const {data:_0x44d5ba}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x8c0403+'\x22...',()=>_0x8e5f17[_0x191b62(0x12c)][_0x191b62(0x147)](_0x8c0403,{'dryRun':_0x11fc0c,'force':_0x4b1ac2}));if(_0x11fc0c)return console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0x176)](_0x191b62(0xfe))),console[_0x191b62(0x18d)]('Would\x20push\x20agent:\x20'+_0x44d5ba['agentName']),0x0;if(_0x44d5ba[_0x191b62(0x10d)]==='error')return console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0xe5)](_0x191b62(0x16a)+_0x44d5ba[_0x191b62(0x10f)])),0x1;console['log'](a4_0x997563[_0x191b62(0x17e)](_0x191b62(0x179)+_0x44d5ba[_0x191b62(0x10d)]+'\x20successfully')),console['log']('Agent:\x20'+_0x44d5ba[_0x191b62(0x12f)]);if(_0x44d5ba[_0x191b62(0x119)]&&_0x44d5ba[_0x191b62(0x109)]){const _0x56d368=getLLMAgentChatUrl(_0x3406bb,_0x44d5ba[_0x191b62(0x109)],_0x44d5ba[_0x191b62(0x119)]);console[_0x191b62(0x18d)](_0x191b62(0x178)+a4_0x997563[_0x191b62(0x104)](_0x56d368));}return 0x0;}const _0x301323=_0x114d5f['llmProject'],_0x5eb034=resolveProjectFromContext(_0x8c0403,_0x301323);if(_0x5eb034['found'])_0x8c0403=_0x5eb034[_0x191b62(0x111)],_0x5eb034[_0x191b62(0x17b)]===_0x191b62(0x15a)&&console['log'](a4_0x997563[_0x191b62(0x110)](_0x191b62(0x172)+_0x8c0403));else{let _0x1692e7=_0x191b62(0x137);_0x5eb034[_0x191b62(0x136)]===_0x191b62(0x103)&&(_0x1692e7=_0x5eb034[_0x191b62(0xe3)]+_0x191b62(0x173)+_0x5eb034['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x191b62(0x117)],_0x5eb034[_0x191b62(0x136)]===_0x191b62(0xfa)?_0x5eb034['message']:_0x191b62(0x15c)+_0x8c0403,undefined,{'helpText':_0x1692e7});}const {data:_0x5535e2}=await withSpinner(_0x191b62(0x170),()=>_0x8e5f17[_0x191b62(0x12c)][_0x191b62(0x168)](_0x8c0403,{'dryRun':!![]})),_0x327570=_0x5535e2[_0x191b62(0x142)][_0x191b62(0x155)][_0x191b62(0x18e)]>0x0;if(_0x327570){console['log'](a4_0x997563['red'](_0x191b62(0x132)));for(const _0x50bbaa of _0x5535e2[_0x191b62(0x155)]){_0x50bbaa[_0x191b62(0x10d)]===_0x191b62(0x10f)&&console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0xe5)](_0x191b62(0x165)+_0x50bbaa[_0x191b62(0x12f)]+_0x191b62(0x13c)+_0x50bbaa[_0x191b62(0x10f)]));}return 0x1;}const _0x41acc3=_0x5535e2[_0x191b62(0x142)][_0x191b62(0x155)]['created']+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x163)][_0x191b62(0x124)]+_0x5535e2['counts'][_0x191b62(0x167)]['created']+_0x5535e2['counts'][_0x191b62(0x123)][_0x191b62(0x124)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x126)][_0x191b62(0x124)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x125)][_0x191b62(0x124)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x11e)]['created'],_0x8cf066=_0x5535e2[_0x191b62(0x142)]['agents']['updated']+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x163)][_0x191b62(0x108)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x167)][_0x191b62(0x108)]+_0x5535e2[_0x191b62(0x142)]['prompts']['updated']+_0x5535e2['counts'][_0x191b62(0x126)][_0x191b62(0x108)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x125)][_0x191b62(0x108)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x11e)][_0x191b62(0x108)],_0x3ad2a3=_0x5535e2[_0x191b62(0x142)][_0x191b62(0x155)]['unchanged']+_0x5535e2['counts']['knowledgeBases'][_0x191b62(0x17a)]+_0x5535e2['counts'][_0x191b62(0x167)]['unchanged']+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x123)][_0x191b62(0x17a)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x126)][_0x191b62(0x17a)]+_0x5535e2[_0x191b62(0x142)][_0x191b62(0x125)][_0x191b62(0x17a)]+_0x5535e2['counts'][_0x191b62(0x11e)][_0x191b62(0x17a)];console[_0x191b62(0x18d)](_0x191b62(0x182)+_0x5535e2['projectName']+'\x27:'),console[_0x191b62(0x18d)]('\x20\x20'+a4_0x997563[_0x191b62(0x17e)]('+\x20'+_0x41acc3+_0x191b62(0x107))+_0x191b62(0x156)+a4_0x997563[_0x191b62(0x176)]('~\x20'+_0x8cf066+'\x20changed')+_0x191b62(0x156)+a4_0x997563[_0x191b62(0x110)]('=\x20'+_0x3ad2a3+_0x191b62(0xf7))),console[_0x191b62(0x18d)](_0x191b62(0x150)+formatCountSummary(_0x5535e2[_0x191b62(0x142)][_0x191b62(0x155)])),console[_0x191b62(0x18d)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5535e2['counts']['knowledgeBases'])),console[_0x191b62(0x18d)](_0x191b62(0x141)+formatCountSummary(_0x5535e2[_0x191b62(0x142)][_0x191b62(0x167)])),console[_0x191b62(0x18d)](_0x191b62(0x11d)+formatCountSummary(_0x5535e2['counts'][_0x191b62(0x123)])),console[_0x191b62(0x18d)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5535e2[_0x191b62(0x142)][_0x191b62(0x126)]));const _0x1c444b=_0x5535e2[_0x191b62(0x142)][_0x191b62(0x125)][_0x191b62(0x124)]>0x0||_0x5535e2[_0x191b62(0x142)][_0x191b62(0x125)][_0x191b62(0x108)]>0x0||_0x5535e2[_0x191b62(0x142)][_0x191b62(0x125)][_0x191b62(0x17a)]>0x0||_0x5535e2['counts'][_0x191b62(0x11e)][_0x191b62(0x124)]>0x0||_0x5535e2[_0x191b62(0x142)][_0x191b62(0x11e)][_0x191b62(0x108)]>0x0||_0x5535e2['counts'][_0x191b62(0x11e)][_0x191b62(0x17a)]>0x0;_0x1c444b&&(console[_0x191b62(0x18d)](_0x191b62(0x13e)+formatCountSummary(_0x5535e2[_0x191b62(0x142)][_0x191b62(0x125)])),console['log'](_0x191b62(0x11f)+formatCountSummary(_0x5535e2['counts'][_0x191b62(0x11e)])));console[_0x191b62(0x18d)](_0x191b62(0x18b)+a4_0x997563['cyan'](_0x8c0403)),displayDiffs(_0x5535e2[_0x191b62(0x155)],_0x5535e2['knowledgeBases'],_0x5535e2[_0x191b62(0x167)],_0x5535e2[_0x191b62(0x123)],_0x5535e2[_0x191b62(0x126)],_0x5535e2[_0x191b62(0x125)],_0x5535e2[_0x191b62(0x11e)]);if(_0x11fc0c)return console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0x176)](_0x191b62(0x157))),0x0;if(_0x41acc3===0x0&&_0x8cf066===0x0){console[_0x191b62(0x18d)](a4_0x997563['green'](_0x191b62(0x13a)));const _0x3305cb=getLLMProjectUrl(_0x3406bb,_0x5535e2['projectId']);return console[_0x191b62(0x18d)](_0x191b62(0x101)+a4_0x997563['cyan'](_0x3305cb)),0x0;}if(!_0x1fd244&&!_0x4b1ac2){if(!isInteractive())return console[_0x191b62(0x10f)](a4_0x997563[_0x191b62(0xe5)](_0x191b62(0x105)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x191b62(0x10f)](a4_0x997563[_0x191b62(0x110)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x45eb2a=await confirmKey(_0x191b62(0x121)+(_0x41acc3+_0x8cf066)+_0x191b62(0x177));if(!_0x45eb2a)return console['log'](a4_0x997563['yellow']('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x2d15ad}=await withSpinner(_0x191b62(0x187),()=>_0x8e5f17['llm'][_0x191b62(0x168)](_0x8c0403,{'force':_0x4b1ac2})),_0x68660e=_0x2d15ad['counts'][_0x191b62(0x155)][_0x191b62(0x18e)]>0x0||_0x2d15ad['counts'][_0x191b62(0x163)][_0x191b62(0x18e)]>0x0||_0x2d15ad['counts']['textKnowledgeBases'][_0x191b62(0x18e)]>0x0||_0x2d15ad[_0x191b62(0x142)]['prompts'][_0x191b62(0x18e)]>0x0;if(_0x68660e){console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0x176)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x191b62(0x18d)](),console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0xe5)](_0x191b62(0x154)));for(const _0xc6687a of _0x2d15ad[_0x191b62(0x155)]){_0xc6687a[_0x191b62(0x10d)]===_0x191b62(0x10f)&&console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0xe5)](_0x191b62(0x165)+_0xc6687a[_0x191b62(0x12f)]+_0x191b62(0x13c)+_0xc6687a[_0x191b62(0x10f)]));}for(const _0x301448 of _0x2d15ad['knowledgeBases']){_0x301448[_0x191b62(0x10d)]===_0x191b62(0x10f)&&console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0xe5)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x301448['name']+_0x191b62(0x13c)+_0x301448[_0x191b62(0x10f)]));}for(const _0x13f958 of _0x2d15ad[_0x191b62(0x167)]){_0x13f958[_0x191b62(0x10d)]==='error'&&console[_0x191b62(0x18d)](a4_0x997563['red'](_0x191b62(0x11a)+_0x13f958[_0x191b62(0x10a)]+_0x191b62(0x13c)+_0x13f958['error']));}for(const _0x233dd2 of _0x2d15ad[_0x191b62(0x123)]){_0x233dd2[_0x191b62(0x10d)]==='error'&&console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0xe5)](_0x191b62(0xf2)+_0x233dd2[_0x191b62(0x10a)]+_0x191b62(0x13c)+_0x233dd2[_0x191b62(0x10f)]));}for(const _0xd092d3 of _0x2d15ad[_0x191b62(0x126)]){_0xd092d3[_0x191b62(0x10d)]==='error'&&console['log'](a4_0x997563['red'](_0x191b62(0x116)+_0xd092d3[_0x191b62(0x10a)]+_0x191b62(0x13c)+_0xd092d3[_0x191b62(0x10f)]));}return 0x1;}console[_0x191b62(0x18d)](a4_0x997563[_0x191b62(0x17e)](_0x191b62(0x129)+(_0x41acc3+_0x8cf066)+_0x191b62(0x18f)+_0x2d15ad[_0x191b62(0x146)]+'\x27'));const _0x5ad9f1=getLLMProjectUrl(_0x3406bb,_0x2d15ad[_0x191b62(0x109)]);return console[_0x191b62(0x18d)](_0x191b62(0x101)+a4_0x997563['cyan'](_0x5ad9f1)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x1f62(_0x356485,_0x308b74){_0x356485=_0x356485-0xce;const _0x2850f7=a5_0x2850();let _0x1f6228=_0x2850f7[_0x356485];return _0x1f6228;}const a5_0x4c3f92=a5_0x1f62;(function(_0x210390,_0x42e423){const _0x224f4d=a5_0x1f62,_0x2f8bf5=_0x210390();while(!![]){try{const _0xf0e0ba=-parseInt(_0x224f4d(0xef))/0x1*(-parseInt(_0x224f4d(0xfd))/0x2)+parseInt(_0x224f4d(0x10b))/0x3*(-parseInt(_0x224f4d(0x11d))/0x4)+parseInt(_0x224f4d(0x11b))/0x5+-parseInt(_0x224f4d(0x11e))/0x6*(-parseInt(_0x224f4d(0x151))/0x7)+parseInt(_0x224f4d(0x140))/0x8+-parseInt(_0x224f4d(0x11f))/0x9+-parseInt(_0x224f4d(0x13f))/0xa;if(_0xf0e0ba===_0x42e423)break;else _0x2f8bf5['push'](_0x2f8bf5['shift']());}catch(_0x144c8d){_0x2f8bf5['push'](_0x2f8bf5['shift']());}}}(a5_0x2850,0x43622));import*as a5_0x2409c8 from'node:fs';function a5_0x2850(){const _0x3ea0ab=['\x27\x20to\x20create\x20the\x20folder\x20structure.','timestamp','Executing\x20new\x20tests...','Output\x20written\x20to:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Failed:\x20\x20\x20','not\x20found','Re-evaluating\x20cached\x20test\x20run...','/<agent-name>','404','resolveAgentId','48tKdBZQ','No\x20tests\x20found\x20with\x20tags:\x20','has','site','\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)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Available\x20tags:\x20','Cached\x20run\x20from:\x20','Passed:\x20\x20\x20','multiple_agents','⚠\x20SKIPPED:\x20','repeat','green','Conversation\x20URL:\x20','toISOString','Test\x20Summary','1862980WCvxgz','llmProject','100536ixNzgb','66dWMJAH','2585052YmuJrb','dim','Re-evaluation\x20Summary','Available\x20tests:\x20','Running\x20test:\x20','executeReeval','ERROR','\x22,\x20but\x20current\x20site\x20is\x20\x22','tests','...\x20','yellow','Using\x20agent:\x20','Agent:\x20','Total:\x20\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','found','filter','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','projectName','utf-8','size','llm','Round\x20','✗\x20FAIL:\x20','Tests\x20found:\x20','Running:\x20','✗\x20ERROR:\x20','projectDir','Evaluating\x20response...','isSpinning','test.yml','basename','5037780cOjWcq','3184624HHssfQ','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','now','message','agent:test','\x20\x20Evaluating...\x20','red','Test\x20','includes','\x20-\x20','\x20\x20Round\x20','join','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','...','Round\x201/','✓\x20PASS:\x20','308987ZHwzrE','Duration:\x20','testYmlPath','trim','push','no_context','PASS','agent','stop','reason','cyan','forEach','tags','\x20\x20Agent:\x20','FAIL','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','resolveProjectId','length','agentName','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\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:','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Error\x20writing\x20output\x20file:\x20','No\x20tests\x20have\x20tags\x20defined.','Error:\x20No\x20previous\x20test\x20run\x20found.','resolve','some','Failed\x20Tests:','no_local_folder','name','existsSync','toLowerCase','white','json','rounds','Usage:','status','\x20\x20Conversation:\x20','no_tests','round','Re-evaluating...','execute','writeFileSync','conversation_url','verbose','conversations','split','map',':\x20Sending\x20user\x20input...','143BmClzR','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','text','table','dryRun','log','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Site:\x20','find','\x20(cached)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x22:\x20','Errors:\x20\x20\x20','tsv','2978SawqZh','Run\x20tests\x20for\x20an\x20LLM\x20agent','add'];a5_0x2850=function(){return _0x3ea0ab;};return a5_0x2850();}import*as a5_0x33fba1 from'node:path';import a5_0x32dbc7 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4c3f92(0xdb)]=a5_0x4c3f92(0x145);['description']=a5_0x4c3f92(0xfe);async[a5_0x4c3f92(0xe7)](_0x20d885){const _0x4d3273=a5_0x4c3f92,{options:_0x17fcf1,args:_0x5180e8,tdx:_0x1c2fb2}=_0x20d885,_0x353759=_0x5180e8[0x0]||'.',_0x5c7238=_0x17fcf1[_0x4d3273(0xf3)],_0x24cd39=_0x17fcf1,_0x51af2d=_0x24cd39['eval']===![],_0x254e80=_0x24cd39['reeval'],_0x27e16d=_0x24cd39['name'],_0x135227=_0x24cd39[_0x4d3273(0x15d)],_0x33e7a6=_0x17fcf1[_0x4d3273(0x10e)],_0x5bf1e0=_0x24cd39['output'];if(_0x254e80&&_0x51af2d)return console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0xd2))),0x1;let _0x2d1b4c=_0x4d3273(0xf2);if(_0x24cd39[_0x4d3273(0xdf)])_0x2d1b4c=_0x4d3273(0xdf);else{if(_0x24cd39['jsonl'])_0x2d1b4c='jsonl';else{if(_0x24cd39[_0x4d3273(0xfc)])_0x2d1b4c='tsv';else{if(_0x24cd39[_0x4d3273(0xf2)])_0x2d1b4c=_0x4d3273(0xf2);}}}const _0x42fecf=_0x24cd39[_0x4d3273(0x11c)];let _0x583050=_0x353759;const _0x219635=a5_0x2409c8[_0x4d3273(0xdc)](_0x353759),_0x53357e=_0x353759==='.';if(!_0x219635||_0x53357e){const _0x439862=resolveProjectFromContext(_0x353759,_0x42fecf,{'requireFile':_0x4d3273(0x13d)});if(_0x439862[_0x4d3273(0x12e)])_0x583050=_0x439862['projectDir'],_0x439862['source']==='context'&&console[_0x4d3273(0xf4)](a5_0x32dbc7['dim'](_0x4d3273(0x12a)+_0x583050));else switch(_0x439862[_0x4d3273(0x15a)]){case _0x4d3273(0x156):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)](_0x439862[_0x4d3273(0x144)])),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](_0x4d3273(0xe1)),console[_0x4d3273(0xf4)](_0x4d3273(0xd0)),console['log'](_0x4d3273(0x10f)),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](_0x4d3273(0x14d));return 0x1;case _0x4d3273(0xda):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)](_0x439862['message'])),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x439862[_0x4d3273(0x11c)]+_0x4d3273(0x100));return 0x1;case _0x4d3273(0x114):{const _0x400440=a5_0x33fba1[_0x4d3273(0x13e)](_0x439862[_0x4d3273(0x13a)]);console[_0x4d3273(0xf4)](a5_0x32dbc7['yellow'](_0x4d3273(0xf0)+_0x439862[_0x4d3273(0x11c)]+'\x22:'));for(const _0x39250d of _0x439862['agentDirs']){console[_0x4d3273(0xf4)]('\x20\x20-\x20'+_0x39250d);}return console[_0x4d3273(0xf4)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x400440+_0x4d3273(0x108)),0x1;}case _0x4d3273(0xe4):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x439862['llmProject']+'\x22.')),console['log'](a5_0x32dbc7['dim']('Project\x20path:\x20'+_0x439862['projectDir'])),console['log'](),console[_0x4d3273(0xf4)](_0x4d3273(0x104));return 0x1;}}const {definition:_0x2a0952,agentInfo:_0x5c646e}=parseTestFile(_0x583050);let _0x39b4a3=_0x2a0952[_0x4d3273(0x127)];if(_0x27e16d){const _0x43c098=_0x27e16d['split'](',')[_0x4d3273(0xed)](_0x1e4456=>_0x1e4456[_0x4d3273(0x154)]());_0x39b4a3=_0x2a0952[_0x4d3273(0x127)][_0x4d3273(0x12f)](_0x563404=>_0x43c098[_0x4d3273(0x149)](_0x563404[_0x4d3273(0xdb)]));if(_0x39b4a3[_0x4d3273(0x163)]===0x0)return console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)]('No\x20tests\x20found\x20matching:\x20'+_0x27e16d)),console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x122)+_0x2a0952[_0x4d3273(0x127)][_0x4d3273(0xed)](_0x275c13=>_0x275c13[_0x4d3273(0xdb)])[_0x4d3273(0x14c)](',\x20'))),0x1;}if(_0x135227){const _0x656d1b=_0x135227[_0x4d3273(0xec)](',')[_0x4d3273(0xed)](_0x38c2da=>_0x38c2da[_0x4d3273(0x154)]()[_0x4d3273(0xdd)]());_0x39b4a3=_0x39b4a3['filter'](_0x1f220d=>_0x1f220d[_0x4d3273(0x15d)]?.[_0x4d3273(0xd8)](_0x1308f4=>_0x656d1b[_0x4d3273(0x149)](_0x1308f4[_0x4d3273(0xdd)]())));if(_0x39b4a3[_0x4d3273(0x163)]===0x0){console['log'](a5_0x32dbc7['yellow'](_0x4d3273(0x10c)+_0x135227));const _0x15e6ee=new Set();return _0x2a0952[_0x4d3273(0x127)][_0x4d3273(0x15c)](_0x5867f6=>_0x5867f6['tags']?.[_0x4d3273(0x15c)](_0x224818=>_0x15e6ee[_0x4d3273(0xff)](_0x224818))),_0x15e6ee[_0x4d3273(0x133)]>0x0?console['log'](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x111)+[..._0x15e6ee][_0x4d3273(0x14c)](',\x20'))):console[_0x4d3273(0xf4)](a5_0x32dbc7['dim'](_0x4d3273(0xd5))),0x1;}}if(_0x254e80)return this['executeReeval'](_0x20d885,{'definition':{'tests':_0x39b4a3},'agentInfo':_0x5c646e,'outputFormat':_0x2d1b4c,'outputFile':_0x5bf1e0,'testNames':_0x27e16d});if(_0x5c7238){console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x15b)](_0x4d3273(0xd1))),console[_0x4d3273(0xf4)](_0x4d3273(0xf6)+a5_0x32dbc7[_0x4d3273(0xde)](_0x33e7a6)),console[_0x4d3273(0xf4)]('\x20\x20Project:\x20'+a5_0x32dbc7[_0x4d3273(0xde)](_0x5c646e[_0x4d3273(0x131)])),console[_0x4d3273(0xf4)](_0x4d3273(0x15e)+a5_0x32dbc7['white'](_0x5c646e[_0x4d3273(0xce)])),console['log'](),console[_0x4d3273(0xf4)](_0x4d3273(0x137)+a5_0x32dbc7[_0x4d3273(0xde)](_0x39b4a3[_0x4d3273(0x163)]));for(let _0x2e6d83=0x0;_0x2e6d83<_0x39b4a3['length'];_0x2e6d83++){const _0xd60e3a=_0x39b4a3[_0x2e6d83],_0x52f9a6=_0xd60e3a[_0x4d3273(0xe0)]['length']===0x1?_0x4d3273(0xe5):_0x4d3273(0xe0),_0x44cc8f=_0xd60e3a[_0x4d3273(0x15d)]?.['length']?'\x20['+_0xd60e3a[_0x4d3273(0x15d)][_0x4d3273(0x14c)](',\x20')+']':'';console[_0x4d3273(0xf4)]('\x20\x20'+(_0x2e6d83+0x1)+'.\x20'+a5_0x32dbc7['white'](_0xd60e3a[_0x4d3273(0xdb)])+'\x20('+_0xd60e3a[_0x4d3273(0xe0)][_0x4d3273(0x163)]+'\x20'+_0x52f9a6+')'+a5_0x32dbc7['dim'](_0x44cc8f));}return 0x0;}let _0x4de48e,_0x1ad11c;try{_0x4de48e=await _0x1c2fb2[_0x4d3273(0x134)][_0x4d3273(0x162)](_0x5c646e[_0x4d3273(0x131)]);}catch(_0x1a3099){const _0x13d9d8=_0x1a3099 instanceof Error?_0x1a3099[_0x4d3273(0x144)]:String(_0x1a3099);return _0x13d9d8[_0x4d3273(0x149)](_0x4d3273(0x109))||_0x13d9d8[_0x4d3273(0xdd)]()['includes'](_0x4d3273(0x106))?console['log'](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0xf5)+_0x5c646e[_0x4d3273(0x131)])):console['log'](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0x110)+_0x5c646e[_0x4d3273(0x131)]+'\x22:\x20'+_0x13d9d8)),0x1;}try{_0x1ad11c=await _0x1c2fb2[_0x4d3273(0x134)][_0x4d3273(0x10a)](_0x5c646e[_0x4d3273(0xce)],_0x4de48e);}catch(_0x214ab4){const _0x1e0df0=_0x214ab4 instanceof Error?_0x214ab4[_0x4d3273(0x144)]:String(_0x214ab4);return _0x1e0df0[_0x4d3273(0x149)](_0x4d3273(0x109))||_0x1e0df0[_0x4d3273(0xdd)]()[_0x4d3273(0x149)](_0x4d3273(0x106))?console['log'](a5_0x32dbc7['red'](_0x4d3273(0xf9)+_0x5c646e['agentName'])):console['log'](a5_0x32dbc7[_0x4d3273(0x147)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x5c646e[_0x4d3273(0xce)]+_0x4d3273(0xfa)+_0x1e0df0)),0x1;}let _0x48615b;if(!_0x51af2d)try{_0x48615b=await setupEvaluatorAgent(_0x1c2fb2[_0x4d3273(0x134)],_0x17fcf1['verbose']);}catch(_0x1fe0d8){const _0x1e1c1d=_0x1fe0d8 instanceof Error?_0x1fe0d8['message']:String(_0x1fe0d8);return console['log'](a5_0x32dbc7[_0x4d3273(0x147)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1e1c1d)),0x1;}console[_0x4d3273(0xf4)](a5_0x32dbc7['cyan']('Running\x20agent\x20tests...')),console[_0x4d3273(0xf4)]('Site:\x20'+a5_0x32dbc7['white'](_0x33e7a6)),console['log'](_0x4d3273(0x12b)+a5_0x32dbc7[_0x4d3273(0xde)](_0x5c646e[_0x4d3273(0x131)]+'/'+_0x5c646e['agentName'])),console[_0x4d3273(0xf4)]();const _0x24c6ca=[],_0x32c501=[],_0xfae68d=Date[_0x4d3273(0x143)]();for(let _0x338f5a=0x0;_0x338f5a<_0x39b4a3[_0x4d3273(0x163)];_0x338f5a++){const _0x1f959c=_0x39b4a3[_0x338f5a];_0x39b4a3[_0x4d3273(0x163)]>0x1?console['log'](_0x4d3273(0x148)+(_0x338f5a+0x1)+'/'+_0x39b4a3[_0x4d3273(0x163)]+':\x20'+a5_0x32dbc7[_0x4d3273(0xde)](_0x1f959c['name'])):console[_0x4d3273(0xf4)](_0x4d3273(0x123)+a5_0x32dbc7[_0x4d3273(0xde)](_0x1f959c[_0x4d3273(0xdb)]));const _0x14d97a=createCommandSpinner('Round\x201/'+_0x1f959c['rounds']['length']+':\x20Sending\x20user\x20input...');_0x14d97a['start']();try{const {result:_0x4e1455,conversation:_0x7a945a}=await runTest(_0x1c2fb2['llm'],_0x1f959c,{'agentId':_0x1ad11c,'projectId':_0x4de48e,'site':_0x33e7a6,'noEval':_0x51af2d,'evaluatorId':_0x48615b,'onRoundStart':(_0x9e1aca,_0x176fab)=>{const _0x53e833=_0x4d3273;_0x14d97a['text']=_0x53e833(0x135)+(_0x9e1aca+0x1)+'/'+_0x176fab+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3f4922,_0x5623db,_0x17740c)=>{const _0xc00c2d=_0x4d3273,_0x2da8be=formatElapsed(_0x5623db);_0x17740c?console[_0xc00c2d(0xf4)](_0xc00c2d(0x14b)+(_0x3f4922+0x1)+'/'+_0x1f959c[_0xc00c2d(0xe0)]['length']+'...\x20'+a5_0x32dbc7[_0xc00c2d(0x117)]('✓')+'\x20('+_0x2da8be+')'):console[_0xc00c2d(0xf4)](_0xc00c2d(0x14b)+(_0x3f4922+0x1)+'/'+_0x1f959c['rounds'][_0xc00c2d(0x163)]+'...\x20'+a5_0x32dbc7[_0xc00c2d(0x147)]('✗'));},'onEvaluationStart':()=>{const _0x5dadbc=_0x4d3273;_0x14d97a[_0x5dadbc(0xf1)]=_0x5dadbc(0x13b);},'onEvaluationComplete':_0x1a4a06=>{const _0x3da8b4=_0x4d3273,_0x557afc=formatElapsed(_0x1a4a06);console[_0x3da8b4(0xf4)]('\x20\x20Evaluating...\x20'+a5_0x32dbc7['green']('✓')+'\x20('+_0x557afc+')');}});_0x14d97a['stop'](),_0x24c6ca[_0x4d3273(0x155)](_0x4e1455),_0x32c501['push'](_0x7a945a);if(_0x4e1455[_0x4d3273(0xe2)]==='PASS')console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x117)]('✓\x20PASS:\x20'+_0x4e1455[_0x4d3273(0x15a)]));else _0x4e1455[_0x4d3273(0xe2)]===_0x4d3273(0x15f)?console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0x136)+_0x4e1455['reason'])):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x147)]('✗\x20ERROR:\x20'+_0x4e1455[_0x4d3273(0x15a)]));_0x4e1455[_0x4d3273(0xe9)]&&console['log'](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x118)+_0x4e1455[_0x4d3273(0xe9)])),console[_0x4d3273(0xf4)]();}catch(_0x54d8c9){_0x14d97a['stop']();const _0x17a6e4=_0x54d8c9 instanceof Error?_0x54d8c9[_0x4d3273(0x144)]:String(_0x54d8c9);console['log'](a5_0x32dbc7['red'](_0x4d3273(0x139)+_0x17a6e4)),console['log'](),_0x24c6ca[_0x4d3273(0x155)]({'name':_0x1f959c[_0x4d3273(0xdb)],'status':_0x4d3273(0x125),'reason':_0x17a6e4,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x2cc9eb=Date[_0x4d3273(0x143)]()-_0xfae68d,_0x528457=_0x24c6ca[_0x4d3273(0x12f)](_0x340fba=>_0x340fba[_0x4d3273(0xe2)]==='PASS')[_0x4d3273(0x163)],_0x27c9ee=_0x24c6ca['filter'](_0x3af547=>_0x3af547[_0x4d3273(0xe2)]===_0x4d3273(0x15f))[_0x4d3273(0x163)],_0x2e7fd2=_0x24c6ca[_0x4d3273(0x12f)](_0x1a353e=>_0x1a353e['status']===_0x4d3273(0x125))[_0x4d3273(0x163)];console[_0x4d3273(0xf4)]('━'[_0x4d3273(0x116)](0x3c)),console['log'](_0x4d3273(0x11a)),console[_0x4d3273(0xf4)]('━'[_0x4d3273(0x116)](0x3c)),console[_0x4d3273(0xf4)](_0x4d3273(0x12c)+_0x24c6ca[_0x4d3273(0x163)]),console[_0x4d3273(0xf4)](_0x4d3273(0x113)+a5_0x32dbc7[_0x4d3273(0x117)](_0x528457)),console[_0x4d3273(0xf4)]('Failed:\x20\x20\x20'+a5_0x32dbc7[_0x4d3273(0x147)](_0x27c9ee));_0x2e7fd2>0x0&&console['log'](_0x4d3273(0xfb)+a5_0x32dbc7[_0x4d3273(0x147)](_0x2e7fd2));console[_0x4d3273(0xf4)]('Duration:\x20'+formatElapsed(_0x2cc9eb)),console[_0x4d3273(0xf4)]('━'[_0x4d3273(0x116)](0x3c));const _0x350ed2=_0x24c6ca[_0x4d3273(0x12f)](_0x11b988=>_0x11b988[_0x4d3273(0xe2)]!=='PASS');if(_0x350ed2[_0x4d3273(0x163)]>0x0){console['log'](),console['log'](_0x4d3273(0xd9));for(const _0x3e337f of _0x350ed2){const _0x504c0c=a5_0x32dbc7['red']('✗'),_0x5831fa=_0x3e337f[_0x4d3273(0x15a)][_0x4d3273(0x163)]>0x32?_0x3e337f[_0x4d3273(0x15a)]['substring'](0x0,0x32)+_0x4d3273(0x14e):_0x3e337f[_0x4d3273(0x15a)];console['log']('\x20\x20'+_0x504c0c+'\x20'+_0x3e337f[_0x4d3273(0xdb)]+':\x20'+_0x5831fa);}}const _0x53d6f2={'summary':{'total':_0x24c6ca[_0x4d3273(0x163)],'passed':_0x528457,'failed':_0x27c9ee,'errors':_0x2e7fd2>0x0?_0x2e7fd2:undefined,'duration_ms':_0x2cc9eb},'tests':_0x24c6ca,'agent':{'project':_0x5c646e[_0x4d3273(0x131)],'name':_0x5c646e[_0x4d3273(0xce)],'site':_0x33e7a6},'timestamp':new Date(_0xfae68d)[_0x4d3273(0x119)]()};try{const _0x1ee2d3=buildCachedTestRun(_0x32c501,{'site':_0x33e7a6,'projectId':_0x4de48e,'projectName':_0x5c646e[_0x4d3273(0x131)],'agentId':_0x1ad11c,'agentName':_0x5c646e[_0x4d3273(0xce)],'testYmlPath':a5_0x33fba1[_0x4d3273(0xd7)](_0x5c646e[_0x4d3273(0x153)])});saveLastTestRun(_0x1ee2d3);}catch{}if(_0x2d1b4c!==_0x4d3273(0xf2)||_0x5bf1e0){const _0x59b50d=formatResults(_0x53d6f2,_0x2d1b4c);if(_0x5bf1e0)try{a5_0x2409c8[_0x4d3273(0xe8)](_0x5bf1e0,_0x59b50d,_0x4d3273(0x132)),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x103)+_0x5bf1e0));}catch(_0x30fac9){return console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](a5_0x32dbc7['red'](_0x4d3273(0xd4)+_0x30fac9)),0x1;}else console[_0x4d3273(0xf4)](),console['log'](_0x59b50d);}return _0x350ed2[_0x4d3273(0x163)]>0x0?0x1:0x0;}async[a5_0x4c3f92(0x124)](_0x5d54e9,_0x5bebf1){const _0x122f0b=a5_0x4c3f92,{options:_0x47a628,tdx:_0x463749}=_0x5d54e9,{definition:_0x4c8a57,agentInfo:_0x2f8f49,outputFormat:_0xd3002b,outputFile:_0x4d9f9a}=_0x5bebf1,_0x168af8=_0x47a628[_0x122f0b(0x10e)],_0x155f9b=loadLastTestRun();if(!_0x155f9b)return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0xd6))),console['log'](a5_0x32dbc7['dim'](_0x122f0b(0x12d))),0x1;if(_0x155f9b[_0x122f0b(0x158)][_0x122f0b(0xce)]!==_0x2f8f49[_0x122f0b(0xce)])return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x155f9b['agent']['agentName']+_0x122f0b(0x161)+_0x2f8f49[_0x122f0b(0xce)]+'\x22.')),console[_0x122f0b(0xf4)](a5_0x32dbc7['dim'](_0x122f0b(0x130))),0x1;const _0x2e4738=new Set(_0x155f9b[_0x122f0b(0xeb)][_0x122f0b(0xed)](_0x4124bc=>_0x4124bc['testName'])),_0x4f0feb=_0x4c8a57[_0x122f0b(0x127)][_0x122f0b(0x12f)](_0x4c5f27=>!_0x2e4738[_0x122f0b(0x10d)](_0x4c5f27[_0x122f0b(0xdb)]));if(_0x4f0feb[_0x122f0b(0x163)]>0x0&&_0x155f9b['site']!==_0x168af8)return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0xcf))),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x120)](_0x122f0b(0x142)+_0x155f9b['site']+_0x122f0b(0x126)+_0x168af8+'\x22.')),console['log'](a5_0x32dbc7[_0x122f0b(0x120)]('Either\x20switch\x20to\x20the\x20\x22'+_0x155f9b['site']+_0x122f0b(0xd3))),0x1;const _0x1f37b3=_0x4c8a57['tests'][_0x122f0b(0x12f)](_0x674928=>_0x2e4738['has'](_0x674928[_0x122f0b(0xdb)])),_0x1201fc=_0x4f0feb;let _0x18af52;try{_0x18af52=await setupEvaluatorAgent(_0x463749['llm'],_0x47a628[_0x122f0b(0xea)]);}catch(_0x1ea328){const _0x4e86de=_0x1ea328 instanceof Error?_0x1ea328['message']:String(_0x1ea328);return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0x160)+_0x4e86de)),0x1;}console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x15b)](_0x122f0b(0x107))),console[_0x122f0b(0xf4)](_0x122f0b(0x112)+a5_0x32dbc7[_0x122f0b(0xde)](_0x155f9b[_0x122f0b(0x101)])),console['log'](_0x122f0b(0x12b)+a5_0x32dbc7['white'](_0x155f9b[_0x122f0b(0x158)][_0x122f0b(0x131)]+'/'+_0x155f9b[_0x122f0b(0x158)][_0x122f0b(0xce)]));_0x1201fc['length']>0x0&&console[_0x122f0b(0xf4)]('New\x20tests\x20to\x20execute:\x20'+a5_0x32dbc7[_0x122f0b(0x129)](_0x1201fc[_0x122f0b(0x163)]));console['log']();const _0x17b289=[],_0x20af69=Date['now'](),_0x4af60b=createCommandSpinner(_0x122f0b(0xe6));if(_0x1f37b3[_0x122f0b(0x163)]>0x0)try{const _0x19f898=await reevaluateFromCache(_0x463749[_0x122f0b(0x134)],_0x155f9b,{'tests':_0x1f37b3},{'evaluatorId':_0x18af52,'onTestStart':(_0x498a2a,_0x525095,_0x339545)=>{const _0x57d0b7=_0x122f0b;_0x4af60b[_0x57d0b7(0xf1)]='Re-evaluating\x20'+(_0x525095+0x1)+'/'+_0x339545+':\x20'+_0x498a2a+_0x57d0b7(0x14e);if(!_0x4af60b[_0x57d0b7(0x13c)])_0x4af60b['start']();},'onTestComplete':(_0x262958,_0x117b9d)=>{const _0x59ba9d=_0x122f0b;_0x4af60b['stop']();if(_0x117b9d['status']===_0x59ba9d(0x157))console[_0x59ba9d(0xf4)](a5_0x32dbc7[_0x59ba9d(0x117)]('✓\x20PASS:\x20'+_0x262958)+a5_0x32dbc7['dim'](_0x59ba9d(0xf8)));else _0x117b9d['status']===_0x59ba9d(0x15f)?console[_0x59ba9d(0xf4)](a5_0x32dbc7['red'](_0x59ba9d(0x136)+_0x262958+_0x59ba9d(0x14a)+_0x117b9d[_0x59ba9d(0x15a)])+a5_0x32dbc7['dim'](_0x59ba9d(0xf8))):console[_0x59ba9d(0xf4)](a5_0x32dbc7['red']('✗\x20ERROR:\x20'+_0x262958+'\x20-\x20'+_0x117b9d[_0x59ba9d(0x15a)]));_0x117b9d['conversation_url']&&console[_0x59ba9d(0xf4)](a5_0x32dbc7['dim'](_0x59ba9d(0xe3)+_0x117b9d[_0x59ba9d(0xe9)])),_0x17b289[_0x59ba9d(0x155)](_0x117b9d);},'onTestSkipped':(_0x13491d,_0x4a06c5)=>{const _0x138db7=_0x122f0b;_0x4af60b['stop'](),console['log'](a5_0x32dbc7['yellow'](_0x138db7(0x115)+_0x13491d+_0x138db7(0x14a)+_0x4a06c5));}});for(const _0x1eaf9a of _0x19f898){!_0x17b289[_0x122f0b(0xf7)](_0x21c94f=>_0x21c94f['name']===_0x1eaf9a[_0x122f0b(0xdb)])&&_0x17b289[_0x122f0b(0x155)](_0x1eaf9a);}}catch(_0x5b5af0){_0x4af60b['stop']();const _0x4c4149=_0x5b5af0 instanceof Error?_0x5b5af0[_0x122f0b(0x144)]:String(_0x5b5af0);return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0x141)+_0x4c4149)),0x1;}_0x4af60b[_0x122f0b(0x159)]();if(_0x1201fc['length']>0x0){console['log'](),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x15b)](_0x122f0b(0x102)));const {projectId:_0x387f37,agentId:_0x3f26af}=_0x155f9b['agent'];for(const _0x410137 of _0x1201fc){console[_0x122f0b(0xf4)](_0x122f0b(0x138)+a5_0x32dbc7[_0x122f0b(0xde)](_0x410137['name']));const _0x5a2b56=createCommandSpinner(_0x122f0b(0x14f)+_0x410137[_0x122f0b(0xe0)]['length']+':\x20Sending\x20user\x20input...');_0x5a2b56['start']();try{const {result:_0x5e7aab}=await runTest(_0x463749['llm'],_0x410137,{'agentId':_0x3f26af,'projectId':_0x387f37,'site':_0x155f9b[_0x122f0b(0x10e)],'noEval':![],'evaluatorId':_0x18af52,'onRoundStart':(_0xaaef2f,_0x1dfc24)=>{const _0x4ae78a=_0x122f0b;_0x5a2b56['text']=_0x4ae78a(0x135)+(_0xaaef2f+0x1)+'/'+_0x1dfc24+_0x4ae78a(0xee);},'onRoundComplete':(_0x2047c8,_0xa05eb4,_0x3af40b)=>{const _0x5b341a=_0x122f0b,_0x2d669b=formatElapsed(_0xa05eb4);_0x3af40b?console[_0x5b341a(0xf4)]('\x20\x20Round\x20'+(_0x2047c8+0x1)+'/'+_0x410137[_0x5b341a(0xe0)]['length']+'...\x20'+a5_0x32dbc7[_0x5b341a(0x117)]('✓')+'\x20('+_0x2d669b+')'):console[_0x5b341a(0xf4)](_0x5b341a(0x14b)+(_0x2047c8+0x1)+'/'+_0x410137[_0x5b341a(0xe0)][_0x5b341a(0x163)]+_0x5b341a(0x128)+a5_0x32dbc7[_0x5b341a(0x147)]('✗'));},'onEvaluationStart':()=>{const _0x44257c=_0x122f0b;_0x5a2b56[_0x44257c(0xf1)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4083a7=>{const _0x1bffb1=_0x122f0b,_0x464cff=formatElapsed(_0x4083a7);console[_0x1bffb1(0xf4)](_0x1bffb1(0x146)+a5_0x32dbc7[_0x1bffb1(0x117)]('✓')+'\x20('+_0x464cff+')');}});_0x5a2b56[_0x122f0b(0x159)](),_0x17b289[_0x122f0b(0x155)](_0x5e7aab);if(_0x5e7aab['status']===_0x122f0b(0x157))console['log'](a5_0x32dbc7[_0x122f0b(0x117)](_0x122f0b(0x150)+_0x5e7aab[_0x122f0b(0x15a)])+a5_0x32dbc7[_0x122f0b(0x120)]('\x20(new)'));else _0x5e7aab[_0x122f0b(0xe2)]===_0x122f0b(0x15f)?console[_0x122f0b(0xf4)](a5_0x32dbc7['red'](_0x122f0b(0x136)+_0x5e7aab['reason'])+a5_0x32dbc7[_0x122f0b(0x120)]('\x20(new)')):console[_0x122f0b(0xf4)](a5_0x32dbc7['red']('✗\x20ERROR:\x20'+_0x5e7aab[_0x122f0b(0x15a)]));_0x5e7aab[_0x122f0b(0xe9)]&&console['log'](a5_0x32dbc7[_0x122f0b(0x120)](_0x122f0b(0xe3)+_0x5e7aab[_0x122f0b(0xe9)]));}catch(_0x289a45){_0x5a2b56['stop']();const _0x27b772=_0x289a45 instanceof Error?_0x289a45[_0x122f0b(0x144)]:String(_0x289a45);console['log'](a5_0x32dbc7[_0x122f0b(0x147)]('✗\x20ERROR:\x20'+_0x27b772)),_0x17b289[_0x122f0b(0x155)]({'name':_0x410137[_0x122f0b(0xdb)],'status':'ERROR','reason':_0x27b772,'timestamp':new Date()[_0x122f0b(0x119)](),'duration_ms':0x0});}}}console[_0x122f0b(0xf4)]();const _0x864804=Date['now']()-_0x20af69,_0x4c6f52=_0x17b289[_0x122f0b(0x12f)](_0x5d5ab4=>_0x5d5ab4['status']==='PASS')[_0x122f0b(0x163)],_0x5035ec=_0x17b289['filter'](_0x122442=>_0x122442['status']==='FAIL')['length'],_0xfa3165=_0x17b289['filter'](_0x43c14b=>_0x43c14b[_0x122f0b(0xe2)]==='ERROR')['length'];console[_0x122f0b(0xf4)]('━'[_0x122f0b(0x116)](0x3c)),console[_0x122f0b(0xf4)](_0x122f0b(0x121)),console[_0x122f0b(0xf4)]('━'['repeat'](0x3c)),console['log'](_0x122f0b(0x12c)+_0x17b289[_0x122f0b(0x163)]),console[_0x122f0b(0xf4)]('Passed:\x20\x20\x20'+a5_0x32dbc7['green'](_0x4c6f52)),console[_0x122f0b(0xf4)](_0x122f0b(0x105)+a5_0x32dbc7[_0x122f0b(0x147)](_0x5035ec));_0xfa3165>0x0&&console[_0x122f0b(0xf4)](_0x122f0b(0xfb)+a5_0x32dbc7[_0x122f0b(0x147)](_0xfa3165));console[_0x122f0b(0xf4)](_0x122f0b(0x152)+formatElapsed(_0x864804)),console[_0x122f0b(0xf4)]('━'[_0x122f0b(0x116)](0x3c));const _0x16fbe5={'summary':{'total':_0x17b289[_0x122f0b(0x163)],'passed':_0x4c6f52,'failed':_0x5035ec,'errors':_0xfa3165>0x0?_0xfa3165:undefined,'duration_ms':_0x864804},'tests':_0x17b289,'agent':{'project':_0x2f8f49[_0x122f0b(0x131)],'name':_0x2f8f49[_0x122f0b(0xce)],'site':_0x168af8},'timestamp':new Date(_0x20af69)[_0x122f0b(0x119)]()};if(_0xd3002b!==_0x122f0b(0xf2)||_0x4d9f9a){const _0x126fc6=formatResults(_0x16fbe5,_0xd3002b);if(_0x4d9f9a)try{a5_0x2409c8[_0x122f0b(0xe8)](_0x4d9f9a,_0x126fc6,_0x122f0b(0x132)),console[_0x122f0b(0xf4)](),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x120)](_0x122f0b(0x103)+_0x4d9f9a));}catch(_0x67c098){return console[_0x122f0b(0xf4)](),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0xd4)+_0x67c098)),0x1;}else console[_0x122f0b(0xf4)](),console[_0x122f0b(0xf4)](_0x126fc6);}const _0x32a6d7=_0x17b289[_0x122f0b(0x12f)](_0x3a30c7=>_0x3a30c7['status']!==_0x122f0b(0x157));return _0x32a6d7['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x21c4c6=a5_0x3c7b;(function(_0x17b656,_0x34c396){const _0x27ca0d=a5_0x3c7b,_0x655b3=_0x17b656();while(!![]){try{const _0x26a7d7=parseInt(_0x27ca0d(0x105))/0x1*(-parseInt(_0x27ca0d(0x13f))/0x2)+parseInt(_0x27ca0d(0x10a))/0x3*(parseInt(_0x27ca0d(0xbb))/0x4)+parseInt(_0x27ca0d(0x10f))/0x5+-parseInt(_0x27ca0d(0xc0))/0x6+parseInt(_0x27ca0d(0x13a))/0x7*(-parseInt(_0x27ca0d(0xc5))/0x8)+-parseInt(_0x27ca0d(0xe7))/0x9+-parseInt(_0x27ca0d(0x144))/0xa*(-parseInt(_0x27ca0d(0x10d))/0xb);if(_0x26a7d7===_0x34c396)break;else _0x655b3['push'](_0x655b3['shift']());}catch(_0x27ae74){_0x655b3['push'](_0x655b3['shift']());}}}(a5_0x4282,0xb1e33));import*as a5_0x26f03b from'node:fs';import*as a5_0x3f0b16 from'node:path';import a5_0x500cc0 from'chalk';function a5_0x4282(){const _0x5ed328=['Test\x20Summary','179333iTterw','FAIL','1476125DSXcGQ','Duration:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Re-evaluating...','has','Test\x20Configuration:','Round\x20','Errors:\x20\x20\x20','resolve','\x27\x20to\x20create\x20the\x20folder\x20structure.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Cached\x20run\x20from:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','No\x20tests\x20found\x20with\x20tags:\x20','message','table','Run\x20\x27tdx\x20agent\x20pull\x20','no_tests','test.yml','conversations','utf-8','Usage:','\x20\x20Evaluating...\x20','includes','join','agent:test','forEach','dryRun','toLowerCase','agentName','Running\x20agent\x20tests...','toISOString','source','testYmlPath','not\x20found','404','Test\x20','substring','name','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','/<agent-name>','3067547ACFjpg','Output\x20written\x20to:\x20','\x22:\x20','Re-evaluating\x20cached\x20test\x20run...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','4LKjyiN','stop','Total:\x20\x20\x20\x20','agent','dim','1660vEmOxI','Run\x20tests\x20for\x20an\x20LLM\x20agent','rounds','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','push','\x20\x20Site:\x20','cyan','tsv','conversation_url','\x20\x20Agent:\x20',':\x20Sending\x20user\x20input...','find','status','no_local_folder','some','size','json','Failed:\x20\x20\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x22,\x20but\x20current\x20site\x20is\x20\x22','green','51844xNgEng','timestamp','text','verbose','Passed:\x20\x20\x20','2039916XZTZRt','ERROR','red','description','length','24sSYTrW','...\x20','\x20\x20Conversation:\x20','✗\x20FAIL:\x20','Agent:\x20','\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','Re-evaluation\x20Summary','eval','split','log','site','trim','\x20\x20Project:\x20','Available\x20tests:\x20','existsSync','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','no_context','llmProject','New\x20tests\x20to\x20execute:\x20','output','add','✓\x20PASS:\x20','Round\x201/','round','tests','yellow','start','executeReeval','jsonl','tags','Failed\x20Tests:','Cached\x20run\x20is\x20from\x20site\x20\x22','filter','writeFileSync','7499988wwWHhz','\x20\x20Round\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','resolveProjectId','projectName','\x20(new)','Either\x20switch\x20to\x20the\x20\x22','\x20-\x20','now','✗\x20ERROR:\x20','Running:\x20','\x20\x20-\x20','Evaluating\x20response...','PASS','Available\x20tags:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','repeat','projectDir','Executing\x20new\x20tests...','Error\x20writing\x20output\x20file:\x20','...','\x20(cached)','testName','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','context','Using\x20agent:\x20','reason','basename','map','352573AeLyjS','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','white','isSpinning','reeval','213PtcSDG','llm'];a5_0x4282=function(){return _0x5ed328;};return a5_0x4282();}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x3c7b(_0x1167d0,_0x44a2f9){_0x1167d0=_0x1167d0-0xb3;const _0x428247=a5_0x4282();let _0x3c7b14=_0x428247[_0x1167d0];return _0x3c7b14;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x21c4c6(0x137)]=a5_0x21c4c6(0x12a);[a5_0x21c4c6(0xc3)]=a5_0x21c4c6(0x145);async['execute'](_0x50afb5){const _0x4fb757=a5_0x21c4c6,{options:_0x17ac31,args:_0x5d46f8,tdx:_0x3cf628}=_0x50afb5,_0x25f472=_0x5d46f8[0x0]||'.',_0x1e3e37=_0x17ac31[_0x4fb757(0x12c)],_0x496f4f=_0x17ac31,_0x25f725=_0x496f4f[_0x4fb757(0xcc)]===![],_0x2c1991=_0x496f4f[_0x4fb757(0x109)],_0x1c3d6f=_0x496f4f['name'],_0x3b3b85=_0x496f4f[_0x4fb757(0xe2)],_0x64bff0=_0x17ac31['site'],_0xd27dad=_0x496f4f[_0x4fb757(0xd8)];if(_0x2c1991&&_0x25f725)return console['log'](a5_0x500cc0[_0x4fb757(0xc2)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x36614b=_0x4fb757(0x120);if(_0x496f4f[_0x4fb757(0xb6)])_0x36614b=_0x4fb757(0xb6);else{if(_0x496f4f[_0x4fb757(0xe1)])_0x36614b=_0x4fb757(0xe1);else{if(_0x496f4f[_0x4fb757(0x14b)])_0x36614b='tsv';else{if(_0x496f4f[_0x4fb757(0x120)])_0x36614b=_0x4fb757(0x120);}}}const _0x2069f8=_0x496f4f[_0x4fb757(0xd6)];let _0x51b957=_0x25f472;const _0x4eb4c3=a5_0x26f03b[_0x4fb757(0xd3)](_0x25f472),_0xed9df0=_0x25f472==='.';if(!_0x4eb4c3||_0xed9df0){const _0x284be5=resolveProjectFromContext(_0x25f472,_0x2069f8,{'requireFile':_0x4fb757(0x123)});if(_0x284be5['found'])_0x51b957=_0x284be5[_0x4fb757(0xf9)],_0x284be5[_0x4fb757(0x131)]===_0x4fb757(0x100)&&console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0x143)](_0x4fb757(0x101)+_0x51b957));else switch(_0x284be5[_0x4fb757(0x102)]){case _0x4fb757(0xd5):console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xde)](_0x284be5['message'])),console[_0x4fb757(0xce)](),console[_0x4fb757(0xce)](_0x4fb757(0x126)),console[_0x4fb757(0xce)](_0x4fb757(0xca)),console[_0x4fb757(0xce)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4fb757(0xce)](),console['log'](_0x4fb757(0x138));return 0x1;case _0x4fb757(0xb3):console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xde)](_0x284be5[_0x4fb757(0x11f)])),console['log'](),console[_0x4fb757(0xce)](_0x4fb757(0x121)+_0x284be5['llmProject']+_0x4fb757(0x118));return 0x1;case'multiple_agents':{const _0x1439ce=a5_0x3f0b16[_0x4fb757(0x103)](_0x284be5[_0x4fb757(0xf9)]);console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xde)](_0x4fb757(0x106)+_0x284be5[_0x4fb757(0xd6)]+'\x22:'));for(const _0x1356d5 of _0x284be5['agentDirs']){console['log'](_0x4fb757(0xf3)+_0x1356d5);}return console[_0x4fb757(0xce)](),console[_0x4fb757(0xce)](_0x4fb757(0x11a)+_0x1439ce+_0x4fb757(0x139)),0x1;}case _0x4fb757(0x122):console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xde)](_0x4fb757(0xff)+_0x284be5['llmProject']+'\x22.')),console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0x143)]('Project\x20path:\x20'+_0x284be5[_0x4fb757(0xf9)])),console[_0x4fb757(0xce)](),console[_0x4fb757(0xce)](_0x4fb757(0x13e));return 0x1;}}const {definition:_0x5899fc,agentInfo:_0x4d3f47}=parseTestFile(_0x51b957);let _0x2068ae=_0x5899fc[_0x4fb757(0xdd)];if(_0x1c3d6f){const _0x1f618a=_0x1c3d6f['split'](',')[_0x4fb757(0x104)](_0x555b4f=>_0x555b4f['trim']());_0x2068ae=_0x5899fc['tests'][_0x4fb757(0xe5)](_0x149e3e=>_0x1f618a[_0x4fb757(0x128)](_0x149e3e[_0x4fb757(0x137)]));if(_0x2068ae['length']===0x0)return console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xde)]('No\x20tests\x20found\x20matching:\x20'+_0x1c3d6f)),console[_0x4fb757(0xce)](a5_0x500cc0['dim'](_0x4fb757(0xd2)+_0x5899fc['tests'][_0x4fb757(0x104)](_0x1d8889=>_0x1d8889[_0x4fb757(0x137)])[_0x4fb757(0x129)](',\x20'))),0x1;}if(_0x3b3b85){const _0x2443ab=_0x3b3b85[_0x4fb757(0xcd)](',')[_0x4fb757(0x104)](_0x11ce03=>_0x11ce03[_0x4fb757(0xd0)]()[_0x4fb757(0x12d)]());_0x2068ae=_0x2068ae['filter'](_0x53dc72=>_0x53dc72[_0x4fb757(0xe2)]?.[_0x4fb757(0xb4)](_0x41f9d5=>_0x2443ab[_0x4fb757(0x128)](_0x41f9d5[_0x4fb757(0x12d)]())));if(_0x2068ae[_0x4fb757(0xc4)]===0x0){console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xde)](_0x4fb757(0x11e)+_0x3b3b85));const _0x477249=new Set();return _0x5899fc[_0x4fb757(0xdd)][_0x4fb757(0x12b)](_0x38729c=>_0x38729c[_0x4fb757(0xe2)]?.[_0x4fb757(0x12b)](_0x256ab9=>_0x477249[_0x4fb757(0xd9)](_0x256ab9))),_0x477249[_0x4fb757(0xb5)]>0x0?console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0x143)](_0x4fb757(0xf6)+[..._0x477249][_0x4fb757(0x129)](',\x20'))):console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0x143)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2c1991)return this[_0x4fb757(0xe0)](_0x50afb5,{'definition':{'tests':_0x2068ae},'agentInfo':_0x4d3f47,'outputFormat':_0x36614b,'outputFile':_0xd27dad,'testNames':_0x1c3d6f});if(_0x1e3e37){console[_0x4fb757(0xce)](a5_0x500cc0['cyan'](_0x4fb757(0x114))),console[_0x4fb757(0xce)](_0x4fb757(0x149)+a5_0x500cc0[_0x4fb757(0x107)](_0x64bff0)),console[_0x4fb757(0xce)](_0x4fb757(0xd1)+a5_0x500cc0[_0x4fb757(0x107)](_0x4d3f47[_0x4fb757(0xec)])),console[_0x4fb757(0xce)](_0x4fb757(0x14d)+a5_0x500cc0['white'](_0x4d3f47[_0x4fb757(0x12e)])),console[_0x4fb757(0xce)](),console['log']('Tests\x20found:\x20'+a5_0x500cc0[_0x4fb757(0x107)](_0x2068ae[_0x4fb757(0xc4)]));for(let _0x2224cd=0x0;_0x2224cd<_0x2068ae[_0x4fb757(0xc4)];_0x2224cd++){const _0x45760c=_0x2068ae[_0x2224cd],_0x42bb91=_0x45760c[_0x4fb757(0x146)]['length']===0x1?_0x4fb757(0xdc):_0x4fb757(0x146),_0x3deb55=_0x45760c[_0x4fb757(0xe2)]?.['length']?'\x20['+_0x45760c[_0x4fb757(0xe2)]['join'](',\x20')+']':'';console[_0x4fb757(0xce)]('\x20\x20'+(_0x2224cd+0x1)+'.\x20'+a5_0x500cc0['white'](_0x45760c[_0x4fb757(0x137)])+'\x20('+_0x45760c[_0x4fb757(0x146)]['length']+'\x20'+_0x42bb91+')'+a5_0x500cc0['dim'](_0x3deb55));}return 0x0;}let _0x10f171,_0x17b5f8;try{_0x10f171=await _0x3cf628[_0x4fb757(0x10b)][_0x4fb757(0xeb)](_0x4d3f47[_0x4fb757(0xec)]);}catch(_0x4eb8e6){const _0x2ce2c0=_0x4eb8e6 instanceof Error?_0x4eb8e6[_0x4fb757(0x11f)]:String(_0x4eb8e6);return _0x2ce2c0['includes'](_0x4fb757(0x134))||_0x2ce2c0['toLowerCase']()[_0x4fb757(0x128)]('not\x20found')?console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xc2)](_0x4fb757(0xe9)+_0x4d3f47['projectName'])):console['log'](a5_0x500cc0['red'](_0x4fb757(0xd4)+_0x4d3f47[_0x4fb757(0xec)]+_0x4fb757(0x13c)+_0x2ce2c0)),0x1;}try{_0x17b5f8=await _0x3cf628['llm']['resolveAgentId'](_0x4d3f47[_0x4fb757(0x12e)],_0x10f171);}catch(_0x3dc316){const _0x2ea9d6=_0x3dc316 instanceof Error?_0x3dc316[_0x4fb757(0x11f)]:String(_0x3dc316);return _0x2ea9d6[_0x4fb757(0x128)](_0x4fb757(0x134))||_0x2ea9d6['toLowerCase']()['includes'](_0x4fb757(0x133))?console['log'](a5_0x500cc0[_0x4fb757(0xc2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4d3f47[_0x4fb757(0x12e)])):console[_0x4fb757(0xce)](a5_0x500cc0['red'](_0x4fb757(0x119)+_0x4d3f47[_0x4fb757(0x12e)]+'\x22:\x20'+_0x2ea9d6)),0x1;}let _0x2d0fc3;if(!_0x25f725)try{_0x2d0fc3=await setupEvaluatorAgent(_0x3cf628[_0x4fb757(0x10b)],_0x17ac31['verbose']);}catch(_0x25bbca){const _0x309e45=_0x25bbca instanceof Error?_0x25bbca['message']:String(_0x25bbca);return console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xc2)](_0x4fb757(0xea)+_0x309e45)),0x1;}console['log'](a5_0x500cc0[_0x4fb757(0x14a)](_0x4fb757(0x12f))),console['log']('Site:\x20'+a5_0x500cc0[_0x4fb757(0x107)](_0x64bff0)),console[_0x4fb757(0xce)]('Agent:\x20'+a5_0x500cc0[_0x4fb757(0x107)](_0x4d3f47[_0x4fb757(0xec)]+'/'+_0x4d3f47[_0x4fb757(0x12e)])),console[_0x4fb757(0xce)]();const _0x3d10c1=[],_0x5ec322=[],_0x4c4510=Date['now']();for(let _0x3b95ba=0x0;_0x3b95ba<_0x2068ae[_0x4fb757(0xc4)];_0x3b95ba++){const _0x4f2a5=_0x2068ae[_0x3b95ba];_0x2068ae['length']>0x1?console[_0x4fb757(0xce)](_0x4fb757(0x135)+(_0x3b95ba+0x1)+'/'+_0x2068ae[_0x4fb757(0xc4)]+':\x20'+a5_0x500cc0[_0x4fb757(0x107)](_0x4f2a5[_0x4fb757(0x137)])):console[_0x4fb757(0xce)]('Running\x20test:\x20'+a5_0x500cc0['white'](_0x4f2a5[_0x4fb757(0x137)]));const _0x3b24d3=createCommandSpinner(_0x4fb757(0xdb)+_0x4f2a5['rounds'][_0x4fb757(0xc4)]+_0x4fb757(0x14e));_0x3b24d3[_0x4fb757(0xdf)]();try{const {result:_0x55435e,conversation:_0x259e8d}=await runTest(_0x3cf628[_0x4fb757(0x10b)],_0x4f2a5,{'agentId':_0x17b5f8,'projectId':_0x10f171,'site':_0x64bff0,'noEval':_0x25f725,'evaluatorId':_0x2d0fc3,'onRoundStart':(_0x2ae702,_0x52d3e8)=>{const _0x53e911=_0x4fb757;_0x3b24d3[_0x53e911(0xbd)]=_0x53e911(0x115)+(_0x2ae702+0x1)+'/'+_0x52d3e8+_0x53e911(0x14e);},'onRoundComplete':(_0x4b3c60,_0x112a71,_0x28a902)=>{const _0x3d64a7=_0x4fb757,_0x2936a9=formatElapsed(_0x112a71);_0x28a902?console['log']('\x20\x20Round\x20'+(_0x4b3c60+0x1)+'/'+_0x4f2a5[_0x3d64a7(0x146)][_0x3d64a7(0xc4)]+'...\x20'+a5_0x500cc0[_0x3d64a7(0xba)]('✓')+'\x20('+_0x2936a9+')'):console[_0x3d64a7(0xce)](_0x3d64a7(0xe8)+(_0x4b3c60+0x1)+'/'+_0x4f2a5[_0x3d64a7(0x146)][_0x3d64a7(0xc4)]+_0x3d64a7(0xc6)+a5_0x500cc0['red']('✗'));},'onEvaluationStart':()=>{const _0x1b4e04=_0x4fb757;_0x3b24d3[_0x1b4e04(0xbd)]=_0x1b4e04(0xf4);},'onEvaluationComplete':_0x32714d=>{const _0x204ba=_0x4fb757,_0xb7db64=formatElapsed(_0x32714d);console[_0x204ba(0xce)](_0x204ba(0x127)+a5_0x500cc0[_0x204ba(0xba)]('✓')+'\x20('+_0xb7db64+')');}});_0x3b24d3[_0x4fb757(0x140)](),_0x3d10c1[_0x4fb757(0x148)](_0x55435e),_0x5ec322[_0x4fb757(0x148)](_0x259e8d);if(_0x55435e['status']==='PASS')console['log'](a5_0x500cc0[_0x4fb757(0xba)](_0x4fb757(0xda)+_0x55435e[_0x4fb757(0x102)]));else _0x55435e[_0x4fb757(0x150)]===_0x4fb757(0x10e)?console['log'](a5_0x500cc0[_0x4fb757(0xc2)](_0x4fb757(0xc8)+_0x55435e[_0x4fb757(0x102)])):console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xc2)](_0x4fb757(0xf1)+_0x55435e[_0x4fb757(0x102)]));_0x55435e['conversation_url']&&console['log'](a5_0x500cc0['dim']('Conversation\x20URL:\x20'+_0x55435e[_0x4fb757(0x14c)])),console[_0x4fb757(0xce)]();}catch(_0x3e9bed){_0x3b24d3[_0x4fb757(0x140)]();const _0x45d0d0=_0x3e9bed instanceof Error?_0x3e9bed[_0x4fb757(0x11f)]:String(_0x3e9bed);console['log'](a5_0x500cc0[_0x4fb757(0xc2)](_0x4fb757(0xf1)+_0x45d0d0)),console[_0x4fb757(0xce)](),_0x3d10c1[_0x4fb757(0x148)]({'name':_0x4f2a5[_0x4fb757(0x137)],'status':_0x4fb757(0xc1),'reason':_0x45d0d0,'timestamp':new Date()[_0x4fb757(0x130)](),'duration_ms':0x0});}}const _0x219aca=Date['now']()-_0x4c4510,_0x214485=_0x3d10c1[_0x4fb757(0xe5)](_0x5d7f5b=>_0x5d7f5b['status']===_0x4fb757(0xf5))[_0x4fb757(0xc4)],_0x48846d=_0x3d10c1[_0x4fb757(0xe5)](_0x415fb=>_0x415fb[_0x4fb757(0x150)]===_0x4fb757(0x10e))[_0x4fb757(0xc4)],_0x1e32d3=_0x3d10c1[_0x4fb757(0xe5)](_0x204867=>_0x204867[_0x4fb757(0x150)]==='ERROR')[_0x4fb757(0xc4)];console['log']('━'[_0x4fb757(0xf8)](0x3c)),console['log'](_0x4fb757(0x10c)),console[_0x4fb757(0xce)]('━'['repeat'](0x3c)),console[_0x4fb757(0xce)](_0x4fb757(0x141)+_0x3d10c1[_0x4fb757(0xc4)]),console[_0x4fb757(0xce)](_0x4fb757(0xbf)+a5_0x500cc0[_0x4fb757(0xba)](_0x214485)),console[_0x4fb757(0xce)](_0x4fb757(0xb7)+a5_0x500cc0[_0x4fb757(0xc2)](_0x48846d));_0x1e32d3>0x0&&console[_0x4fb757(0xce)](_0x4fb757(0x116)+a5_0x500cc0[_0x4fb757(0xc2)](_0x1e32d3));console[_0x4fb757(0xce)](_0x4fb757(0x110)+formatElapsed(_0x219aca)),console['log']('━'[_0x4fb757(0xf8)](0x3c));const _0x3c7d49=_0x3d10c1[_0x4fb757(0xe5)](_0x6618f=>_0x6618f[_0x4fb757(0x150)]!=='PASS');if(_0x3c7d49[_0x4fb757(0xc4)]>0x0){console[_0x4fb757(0xce)](),console[_0x4fb757(0xce)](_0x4fb757(0xe3));for(const _0x27bf81 of _0x3c7d49){const _0x305364=a5_0x500cc0['red']('✗'),_0x37b805=_0x27bf81[_0x4fb757(0x102)][_0x4fb757(0xc4)]>0x32?_0x27bf81['reason'][_0x4fb757(0x136)](0x0,0x32)+_0x4fb757(0xfc):_0x27bf81[_0x4fb757(0x102)];console[_0x4fb757(0xce)]('\x20\x20'+_0x305364+'\x20'+_0x27bf81[_0x4fb757(0x137)]+':\x20'+_0x37b805);}}const _0xd78d96={'summary':{'total':_0x3d10c1[_0x4fb757(0xc4)],'passed':_0x214485,'failed':_0x48846d,'errors':_0x1e32d3>0x0?_0x1e32d3:undefined,'duration_ms':_0x219aca},'tests':_0x3d10c1,'agent':{'project':_0x4d3f47[_0x4fb757(0xec)],'name':_0x4d3f47[_0x4fb757(0x12e)],'site':_0x64bff0},'timestamp':new Date(_0x4c4510)[_0x4fb757(0x130)]()};try{const _0x565710=buildCachedTestRun(_0x5ec322,{'site':_0x64bff0,'projectId':_0x10f171,'projectName':_0x4d3f47[_0x4fb757(0xec)],'agentId':_0x17b5f8,'agentName':_0x4d3f47[_0x4fb757(0x12e)],'testYmlPath':a5_0x3f0b16[_0x4fb757(0x117)](_0x4d3f47[_0x4fb757(0x132)])});saveLastTestRun(_0x565710);}catch{}if(_0x36614b!==_0x4fb757(0x120)||_0xd27dad){const _0x366429=formatResults(_0xd78d96,_0x36614b);if(_0xd27dad)try{a5_0x26f03b[_0x4fb757(0xe6)](_0xd27dad,_0x366429,'utf-8'),console['log'](),console[_0x4fb757(0xce)](a5_0x500cc0['dim'](_0x4fb757(0x13b)+_0xd27dad));}catch(_0x3d94ad){return console[_0x4fb757(0xce)](),console[_0x4fb757(0xce)](a5_0x500cc0[_0x4fb757(0xc2)](_0x4fb757(0xfb)+_0x3d94ad)),0x1;}else console[_0x4fb757(0xce)](),console[_0x4fb757(0xce)](_0x366429);}return _0x3c7d49[_0x4fb757(0xc4)]>0x0?0x1:0x0;}async[a5_0x21c4c6(0xe0)](_0x19441b,_0x393715){const _0x17bde1=a5_0x21c4c6,{options:_0x397618,tdx:_0x112cb1}=_0x19441b,{definition:_0x348e58,agentInfo:_0x62a328,outputFormat:_0x5a9f65,outputFile:_0x27f4ea}=_0x393715,_0x2840aa=_0x397618['site'],_0x5795cf=loadLastTestRun();if(!_0x5795cf)return console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)](_0x17bde1(0x11c))),console['log'](a5_0x500cc0[_0x17bde1(0x143)](_0x17bde1(0x147))),0x1;if(_0x5795cf[_0x17bde1(0x142)][_0x17bde1(0x12e)]!==_0x62a328[_0x17bde1(0x12e)])return console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)](_0x17bde1(0xf7)+_0x5795cf[_0x17bde1(0x142)][_0x17bde1(0x12e)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x62a328[_0x17bde1(0x12e)]+'\x22.')),console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0x143)](_0x17bde1(0x11d))),0x1;const _0x135a90=new Set(_0x5795cf[_0x17bde1(0x124)][_0x17bde1(0x104)](_0x47bcbd=>_0x47bcbd[_0x17bde1(0xfe)])),_0x4f6ca7=_0x348e58[_0x17bde1(0xdd)][_0x17bde1(0xe5)](_0x2037f9=>!_0x135a90[_0x17bde1(0x113)](_0x2037f9[_0x17bde1(0x137)]));if(_0x4f6ca7[_0x17bde1(0xc4)]>0x0&&_0x5795cf[_0x17bde1(0xcf)]!==_0x2840aa)return console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)](_0x17bde1(0xb8))),console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0x143)](_0x17bde1(0xe4)+_0x5795cf[_0x17bde1(0xcf)]+_0x17bde1(0xb9)+_0x2840aa+'\x22.')),console['log'](a5_0x500cc0[_0x17bde1(0x143)](_0x17bde1(0xee)+_0x5795cf[_0x17bde1(0xcf)]+_0x17bde1(0x111))),0x1;const _0x1d44c6=_0x348e58[_0x17bde1(0xdd)][_0x17bde1(0xe5)](_0x3da2f9=>_0x135a90[_0x17bde1(0x113)](_0x3da2f9[_0x17bde1(0x137)])),_0x49611b=_0x4f6ca7;let _0x106e52;try{_0x106e52=await setupEvaluatorAgent(_0x112cb1[_0x17bde1(0x10b)],_0x397618[_0x17bde1(0xbe)]);}catch(_0x4e46c5){const _0x473caf=_0x4e46c5 instanceof Error?_0x4e46c5[_0x17bde1(0x11f)]:String(_0x4e46c5);return console['log'](a5_0x500cc0[_0x17bde1(0xc2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x473caf)),0x1;}console[_0x17bde1(0xce)](a5_0x500cc0['cyan'](_0x17bde1(0x13d))),console[_0x17bde1(0xce)](_0x17bde1(0x11b)+a5_0x500cc0['white'](_0x5795cf[_0x17bde1(0xbc)])),console['log'](_0x17bde1(0xc9)+a5_0x500cc0['white'](_0x5795cf[_0x17bde1(0x142)][_0x17bde1(0xec)]+'/'+_0x5795cf[_0x17bde1(0x142)]['agentName']));_0x49611b['length']>0x0&&console[_0x17bde1(0xce)](_0x17bde1(0xd7)+a5_0x500cc0[_0x17bde1(0xde)](_0x49611b[_0x17bde1(0xc4)]));console[_0x17bde1(0xce)]();const _0x4f9d35=[],_0x58e0a7=Date[_0x17bde1(0xf0)](),_0x5bfda5=createCommandSpinner(_0x17bde1(0x112));if(_0x1d44c6['length']>0x0)try{const _0x5377ee=await reevaluateFromCache(_0x112cb1['llm'],_0x5795cf,{'tests':_0x1d44c6},{'evaluatorId':_0x106e52,'onTestStart':(_0x242a34,_0x557a8d,_0x39ffcd)=>{const _0x10eea2=_0x17bde1;_0x5bfda5['text']='Re-evaluating\x20'+(_0x557a8d+0x1)+'/'+_0x39ffcd+':\x20'+_0x242a34+_0x10eea2(0xfc);if(!_0x5bfda5[_0x10eea2(0x108)])_0x5bfda5[_0x10eea2(0xdf)]();},'onTestComplete':(_0x5a1067,_0x48de7a)=>{const _0x14459d=_0x17bde1;_0x5bfda5['stop']();if(_0x48de7a[_0x14459d(0x150)]===_0x14459d(0xf5))console['log'](a5_0x500cc0[_0x14459d(0xba)](_0x14459d(0xda)+_0x5a1067)+a5_0x500cc0[_0x14459d(0x143)](_0x14459d(0xfd)));else _0x48de7a[_0x14459d(0x150)]==='FAIL'?console['log'](a5_0x500cc0[_0x14459d(0xc2)](_0x14459d(0xc8)+_0x5a1067+_0x14459d(0xef)+_0x48de7a['reason'])+a5_0x500cc0[_0x14459d(0x143)](_0x14459d(0xfd))):console[_0x14459d(0xce)](a5_0x500cc0[_0x14459d(0xc2)](_0x14459d(0xf1)+_0x5a1067+_0x14459d(0xef)+_0x48de7a['reason']));_0x48de7a[_0x14459d(0x14c)]&&console[_0x14459d(0xce)](a5_0x500cc0[_0x14459d(0x143)](_0x14459d(0xc7)+_0x48de7a[_0x14459d(0x14c)])),_0x4f9d35[_0x14459d(0x148)](_0x48de7a);},'onTestSkipped':(_0x33320a,_0x5a5963)=>{const _0x44c4d1=_0x17bde1;_0x5bfda5[_0x44c4d1(0x140)](),console[_0x44c4d1(0xce)](a5_0x500cc0[_0x44c4d1(0xde)]('⚠\x20SKIPPED:\x20'+_0x33320a+_0x44c4d1(0xef)+_0x5a5963));}});for(const _0x1062ce of _0x5377ee){!_0x4f9d35[_0x17bde1(0x14f)](_0x47f12c=>_0x47f12c[_0x17bde1(0x137)]===_0x1062ce[_0x17bde1(0x137)])&&_0x4f9d35['push'](_0x1062ce);}}catch(_0x2950af){_0x5bfda5['stop']();const _0xc271f8=_0x2950af instanceof Error?_0x2950af[_0x17bde1(0x11f)]:String(_0x2950af);return console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0xc271f8)),0x1;}_0x5bfda5[_0x17bde1(0x140)]();if(_0x49611b[_0x17bde1(0xc4)]>0x0){console[_0x17bde1(0xce)](),console[_0x17bde1(0xce)](a5_0x500cc0['cyan'](_0x17bde1(0xfa)));const {projectId:_0x555e69,agentId:_0x46888f}=_0x5795cf[_0x17bde1(0x142)];for(const _0x99db0c of _0x49611b){console[_0x17bde1(0xce)](_0x17bde1(0xf2)+a5_0x500cc0[_0x17bde1(0x107)](_0x99db0c['name']));const _0x5779ad=createCommandSpinner(_0x17bde1(0xdb)+_0x99db0c[_0x17bde1(0x146)]['length']+_0x17bde1(0x14e));_0x5779ad[_0x17bde1(0xdf)]();try{const {result:_0x22dcf4}=await runTest(_0x112cb1[_0x17bde1(0x10b)],_0x99db0c,{'agentId':_0x46888f,'projectId':_0x555e69,'site':_0x5795cf[_0x17bde1(0xcf)],'noEval':![],'evaluatorId':_0x106e52,'onRoundStart':(_0xadde03,_0x1d79fe)=>{const _0x40a609=_0x17bde1;_0x5779ad['text']=_0x40a609(0x115)+(_0xadde03+0x1)+'/'+_0x1d79fe+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3b33f2,_0x3a53e9,_0x404b9b)=>{const _0x28da15=_0x17bde1,_0x500b39=formatElapsed(_0x3a53e9);_0x404b9b?console[_0x28da15(0xce)](_0x28da15(0xe8)+(_0x3b33f2+0x1)+'/'+_0x99db0c[_0x28da15(0x146)][_0x28da15(0xc4)]+_0x28da15(0xc6)+a5_0x500cc0[_0x28da15(0xba)]('✓')+'\x20('+_0x500b39+')'):console[_0x28da15(0xce)](_0x28da15(0xe8)+(_0x3b33f2+0x1)+'/'+_0x99db0c[_0x28da15(0x146)]['length']+_0x28da15(0xc6)+a5_0x500cc0['red']('✗'));},'onEvaluationStart':()=>{const _0x476759=_0x17bde1;_0x5779ad['text']=_0x476759(0xf4);},'onEvaluationComplete':_0x19e858=>{const _0x30a5d3=_0x17bde1,_0x5022a8=formatElapsed(_0x19e858);console[_0x30a5d3(0xce)](_0x30a5d3(0x127)+a5_0x500cc0[_0x30a5d3(0xba)]('✓')+'\x20('+_0x5022a8+')');}});_0x5779ad[_0x17bde1(0x140)](),_0x4f9d35[_0x17bde1(0x148)](_0x22dcf4);if(_0x22dcf4[_0x17bde1(0x150)]===_0x17bde1(0xf5))console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xba)](_0x17bde1(0xda)+_0x22dcf4[_0x17bde1(0x102)])+a5_0x500cc0[_0x17bde1(0x143)](_0x17bde1(0xed)));else _0x22dcf4['status']===_0x17bde1(0x10e)?console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)](_0x17bde1(0xc8)+_0x22dcf4[_0x17bde1(0x102)])+a5_0x500cc0[_0x17bde1(0x143)]('\x20(new)')):console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)](_0x17bde1(0xf1)+_0x22dcf4[_0x17bde1(0x102)]));_0x22dcf4[_0x17bde1(0x14c)]&&console[_0x17bde1(0xce)](a5_0x500cc0['dim'](_0x17bde1(0xc7)+_0x22dcf4['conversation_url']));}catch(_0x3d2b8b){_0x5779ad[_0x17bde1(0x140)]();const _0x1cd116=_0x3d2b8b instanceof Error?_0x3d2b8b[_0x17bde1(0x11f)]:String(_0x3d2b8b);console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)](_0x17bde1(0xf1)+_0x1cd116)),_0x4f9d35[_0x17bde1(0x148)]({'name':_0x99db0c[_0x17bde1(0x137)],'status':_0x17bde1(0xc1),'reason':_0x1cd116,'timestamp':new Date()[_0x17bde1(0x130)](),'duration_ms':0x0});}}}console[_0x17bde1(0xce)]();const _0x28597c=Date['now']()-_0x58e0a7,_0x27aa79=_0x4f9d35['filter'](_0x154458=>_0x154458['status']===_0x17bde1(0xf5))['length'],_0x17db14=_0x4f9d35[_0x17bde1(0xe5)](_0x1414c7=>_0x1414c7[_0x17bde1(0x150)]===_0x17bde1(0x10e))[_0x17bde1(0xc4)],_0x48b87a=_0x4f9d35[_0x17bde1(0xe5)](_0x2837ca=>_0x2837ca['status']===_0x17bde1(0xc1))[_0x17bde1(0xc4)];console['log']('━'[_0x17bde1(0xf8)](0x3c)),console['log'](_0x17bde1(0xcb)),console[_0x17bde1(0xce)]('━'[_0x17bde1(0xf8)](0x3c)),console['log'](_0x17bde1(0x141)+_0x4f9d35[_0x17bde1(0xc4)]),console[_0x17bde1(0xce)](_0x17bde1(0xbf)+a5_0x500cc0[_0x17bde1(0xba)](_0x27aa79)),console[_0x17bde1(0xce)](_0x17bde1(0xb7)+a5_0x500cc0[_0x17bde1(0xc2)](_0x17db14));_0x48b87a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x500cc0[_0x17bde1(0xc2)](_0x48b87a));console[_0x17bde1(0xce)](_0x17bde1(0x110)+formatElapsed(_0x28597c)),console[_0x17bde1(0xce)]('━'[_0x17bde1(0xf8)](0x3c));const _0x473548={'summary':{'total':_0x4f9d35[_0x17bde1(0xc4)],'passed':_0x27aa79,'failed':_0x17db14,'errors':_0x48b87a>0x0?_0x48b87a:undefined,'duration_ms':_0x28597c},'tests':_0x4f9d35,'agent':{'project':_0x62a328[_0x17bde1(0xec)],'name':_0x62a328[_0x17bde1(0x12e)],'site':_0x2840aa},'timestamp':new Date(_0x58e0a7)['toISOString']()};if(_0x5a9f65!=='table'||_0x27f4ea){const _0xe45cbd=formatResults(_0x473548,_0x5a9f65);if(_0x27f4ea)try{a5_0x26f03b[_0x17bde1(0xe6)](_0x27f4ea,_0xe45cbd,_0x17bde1(0x125)),console[_0x17bde1(0xce)](),console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0x143)]('Output\x20written\x20to:\x20'+_0x27f4ea));}catch(_0x460f7d){return console[_0x17bde1(0xce)](),console[_0x17bde1(0xce)](a5_0x500cc0[_0x17bde1(0xc2)]('Error\x20writing\x20output\x20file:\x20'+_0x460f7d)),0x1;}else console[_0x17bde1(0xce)](),console['log'](_0xe45cbd);}const _0x47d1cf=_0x4f9d35[_0x17bde1(0xe5)](_0x19f331=>_0x19f331[_0x17bde1(0x150)]!==_0x17bde1(0xf5));return _0x47d1cf[_0x17bde1(0xc4)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x415d88=a6_0x5e5f;(function(_0x39ecc9,_0x50b79d){const _0x3e7137=a6_0x5e5f,_0x34506c=_0x39ecc9();while(!![]){try{const _0x5baeca=parseInt(_0x3e7137(0xf4))/0x1*(-parseInt(_0x3e7137(0x111))/0x2)+parseInt(_0x3e7137(0x122))/0x3*(-parseInt(_0x3e7137(0x130))/0x4)+-parseInt(_0x3e7137(0x124))/0x5*(-parseInt(_0x3e7137(0xfb))/0x6)+parseInt(_0x3e7137(0x135))/0x7*(-parseInt(_0x3e7137(0x133))/0x8)+parseInt(_0x3e7137(0x119))/0x9+-parseInt(_0x3e7137(0x134))/0xa*(parseInt(_0x3e7137(0x132))/0xb)+parseInt(_0x3e7137(0x103))/0xc*(parseInt(_0x3e7137(0x138))/0xd);if(_0x5baeca===_0x50b79d)break;else _0x34506c['push'](_0x34506c['shift']());}catch(_0x411e9a){_0x34506c['push'](_0x34506c['shift']());}}}(a6_0x2423,0x65425));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x2423(){const _0x4195cf=['cdp','Invalid\x20HTTP\x20method:\x20','error','4iNjJgS','headers','file','color','x-trino-user','toUpperCase','.\x20Valid\x20methods:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','3292236GFmfwa','PUT','execute','PATCH','validate','length','trino','GET','Endpoint\x20must\x20start\x20with\x20/:\x20','243cndsvX','indexOf','150XtaVcQ','set-cookie','keys','x-auth-token','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x22.\x20','substring','has','llm','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Results\x20saved\x20to\x20','DELETE','35704AzVPlZ','method','97141NomoKZ','320aYKZYD','10JRfGfB','95837YfdMiC','x-xsrf-token','type','259142PPXrqZ','header','data','authorization','site','375662uMkHjD','join','log','set-cookie2','message','output','startsWith','13284VFFYyV','request','trim','verbose','stack','api','.\x20Valid\x20types:\x20','body','1212RrTAHx','isArray','readBodyFromFile','Error:\x20','llm-proxy','workflow','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','<\x20HTTP/1.1\x20','status','POST','includes'];a6_0x2423=function(){return _0x4195cf;};return a6_0x2423();}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_0x415d88(0xf2),'proxy-authorization','cookie',a6_0x415d88(0x125),a6_0x415d88(0xf7),a6_0x415d88(0x136),a6_0x415d88(0x127),a6_0x415d88(0x115)]);function isSensitiveHeader(_0x542146){const _0x190421=a6_0x415d88;return SENSITIVE_HEADERS[_0x190421(0x12b)](_0x542146['toLowerCase']());}function parseHeader(_0x22b308){const _0x208e8c=a6_0x415d88,_0x4d2ae1=_0x22b308[_0x208e8c(0x123)](':');if(_0x4d2ae1===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x22b308+_0x208e8c(0x129)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x27bda3=_0x22b308[_0x208e8c(0x12a)](0x0,_0x4d2ae1)['trim'](),_0x418f6a=_0x22b308[_0x208e8c(0x12a)](_0x4d2ae1+0x1)[_0x208e8c(0xfd)]();if(!_0x27bda3)throw new Error(_0x208e8c(0x128)+_0x22b308+'\x22');return[_0x27bda3,_0x418f6a];}function a6_0x5e5f(_0x10eaf2,_0xf64537){_0x10eaf2=_0x10eaf2-0xf1;const _0x2423ca=a6_0x2423();let _0x5e5f3e=_0x2423ca[_0x10eaf2];return _0x5e5f3e;}export class ApiCommand extends BaseCommand{['name']='api';['description']=a6_0x415d88(0x12d);[a6_0x415d88(0x11d)](_0x18d77d){const _0x41d1ed=a6_0x415d88,{args:_0x40ee54,options:_0x4d3092}=_0x18d77d,_0x89f0db=_0x4d3092;if(_0x40ee54[_0x41d1ed(0x11e)]===0x0)return _0x41d1ed(0x118);const _0x20e7ce=_0x40ee54[0x0];if(!_0x20e7ce[_0x41d1ed(0xfa)]('/'))return _0x41d1ed(0x121)+_0x20e7ce;const _0x18305d=_0x89f0db[_0x41d1ed(0xf1)],_0x22ed42=_0x89f0db[_0x41d1ed(0x113)];if(_0x18305d&&_0x22ed42)return _0x41d1ed(0x109);const _0x5ca645=_0x89f0db[_0x41d1ed(0x131)]||_0x41d1ed(0x120),_0x3263f4=['GET',_0x41d1ed(0x10c),_0x41d1ed(0x11a),_0x41d1ed(0x12f),_0x41d1ed(0x11c)];if(!_0x3263f4[_0x41d1ed(0x10d)](_0x5ca645[_0x41d1ed(0x116)]()))return _0x41d1ed(0x10f)+_0x5ca645+_0x41d1ed(0x117)+_0x3263f4['join'](',\x20');const _0x21e4b4=_0x89f0db[_0x41d1ed(0x137)]||'td',_0x43acdd=['td',_0x41d1ed(0x10e),_0x41d1ed(0x108),_0x41d1ed(0x11f),_0x41d1ed(0x12c),_0x41d1ed(0x107)];if(!_0x43acdd[_0x41d1ed(0x10d)](_0x21e4b4))return'Invalid\x20API\x20type:\x20'+_0x21e4b4+_0x41d1ed(0x101)+_0x43acdd[_0x41d1ed(0xf5)](',\x20');return undefined;}async[a6_0x415d88(0x11b)](_0x328b4f){const _0x2abc09=a6_0x415d88,{options:_0x2b3c9d,args:_0x9145fb,tdx:_0x4e4bda}=_0x328b4f,_0x15f467=_0x2b3c9d,_0x38760f=_0x9145fb[0x0],_0x21bc16=(_0x15f467[_0x2abc09(0x131)]||'GET')['toUpperCase'](),_0x4c4644=_0x15f467['data'],_0x456624=_0x15f467[_0x2abc09(0x113)],_0x4839b8=_0x15f467[_0x2abc09(0x139)],_0x5a157b=_0x15f467[_0x2abc09(0x137)]||'td';try{const _0x3671e1={};if(_0x4839b8){const _0x1fc6b8=Array[_0x2abc09(0x104)](_0x4839b8)?_0x4839b8:[_0x4839b8];for(const _0x348431 of _0x1fc6b8){const [_0x38eabd,_0x5efce1]=parseHeader(_0x348431);_0x3671e1[_0x38eabd]=_0x5efce1;}}let _0x3a1fd5;if(_0x4c4644)_0x3a1fd5=_0x4c4644;else{if(_0x456624)try{_0x3a1fd5=RawAPI[_0x2abc09(0x105)](_0x456624);}catch(_0x1ba9d5){return console[_0x2abc09(0x110)](_0x2abc09(0x106)+(_0x1ba9d5 instanceof Error?_0x1ba9d5[_0x2abc09(0xf8)]:String(_0x1ba9d5))),0x1;}}const _0x120a9c={'method':_0x21bc16,'apiType':_0x5a157b,'includeHeaders':_0x2b3c9d[_0x2abc09(0xfe)]};_0x3a1fd5&&(_0x120a9c[_0x2abc09(0x102)]=_0x3a1fd5);Object[_0x2abc09(0x126)](_0x3671e1)['length']>0x0&&(_0x120a9c[_0x2abc09(0x112)]=_0x3671e1);if(_0x2b3c9d[_0x2abc09(0xfe)]){const _0x13ab48=resolveSite(_0x2b3c9d[_0x2abc09(0xf3)]),_0x1d5956=getEndpoint(_0x13ab48,_0x5a157b),_0x575328=''+_0x1d5956+_0x38760f;console[_0x2abc09(0x110)]('>\x20'+_0x21bc16+'\x20'+_0x575328);const _0x3d228c=getAuthHeaders(_0x13ab48),_0x3d6d1a={..._0x3d228c,..._0x3671e1};for(const [_0x4cfdb5,_0x88e5e3]of Object['entries'](_0x3d6d1a)){!isSensitiveHeader(_0x4cfdb5)&&console[_0x2abc09(0x110)]('>\x20'+_0x4cfdb5+':\x20'+_0x88e5e3);}_0x3a1fd5&&console[_0x2abc09(0x110)]('>'),console[_0x2abc09(0x110)]('');}const _0x1a768d=await _0x4e4bda[_0x2abc09(0x100)][_0x2abc09(0xfc)](_0x38760f,_0x120a9c);if(_0x2b3c9d['verbose']&&_0x1a768d[_0x2abc09(0x112)]){console[_0x2abc09(0x110)](_0x2abc09(0x10a)+_0x1a768d[_0x2abc09(0x10b)]);for(const [_0x2414ef,_0x27f3db]of Object['entries'](_0x1a768d[_0x2abc09(0x112)])){!isSensitiveHeader(_0x2414ef)&&console[_0x2abc09(0x110)]('<\x20'+_0x2414ef+':\x20'+_0x27f3db);}console[_0x2abc09(0x110)]('');}const _0x13853b=Boolean(_0x2b3c9d[_0x2abc09(0xf9)]),_0x51c875={'color':_0x2b3c9d[_0x2abc09(0x114)],'noColor':_0x2b3c9d['noColor']||_0x13853b&&!_0x2b3c9d[_0x2abc09(0x114)]},_0x37f1da=colorizeJSON(_0x1a768d[_0x2abc09(0xf1)],_0x51c875);return _0x2b3c9d[_0x2abc09(0xf9)]?(writeFileSync(_0x2b3c9d[_0x2abc09(0xf9)],_0x37f1da),console[_0x2abc09(0x110)](_0x2abc09(0x12e)+_0x2b3c9d['output'])):console[_0x2abc09(0xf6)](_0x37f1da),0x0;}catch(_0x52acf3){return _0x52acf3 instanceof Error?(console[_0x2abc09(0x110)]('Error:\x20'+_0x52acf3['message']),_0x2b3c9d[_0x2abc09(0xfe)]&&_0x52acf3['stack']&&console['error']('\x0aStack\x20trace:\x0a'+_0x52acf3[_0x2abc09(0xff)])):console[_0x2abc09(0x110)](_0x2abc09(0x106)+String(_0x52acf3)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x3dd6c0=a7_0x193f;(function(_0x4f4ff5,_0x3d0dc9){const _0x3ff6f2=a7_0x193f,_0x1e484c=_0x4f4ff5();while(!![]){try{const _0x313fd4=parseInt(_0x3ff6f2(0x13d))/0x1*(parseInt(_0x3ff6f2(0x137))/0x2)+-parseInt(_0x3ff6f2(0x162))/0x3*(-parseInt(_0x3ff6f2(0x14d))/0x4)+-parseInt(_0x3ff6f2(0x16b))/0x5*(parseInt(_0x3ff6f2(0x152))/0x6)+-parseInt(_0x3ff6f2(0x129))/0x7+parseInt(_0x3ff6f2(0x12e))/0x8+parseInt(_0x3ff6f2(0x140))/0x9*(-parseInt(_0x3ff6f2(0x126))/0xa)+-parseInt(_0x3ff6f2(0x13a))/0xb*(-parseInt(_0x3ff6f2(0x15b))/0xc);if(_0x313fd4===_0x3d0dc9)break;else _0x1e484c['push'](_0x1e484c['shift']());}catch(_0x6b5bcc){_0x1e484c['push'](_0x1e484c['shift']());}}}(a7_0x6e48,0x7044a));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x6e48(){const _0x4065c3=['method','Read\x20credential\x20from\x20keychain','53197uxmOlM','logLevel','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','27OnSJRh','System\x20keychain\x20is\x20not\x20available','API\x20key\x20cannot\x20be\x20empty','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20(site:\x20','email','yellow','filter','warn','tdx:\x20auth\x20setup','No\x20credentials\x20found\x20in\x20keychain','✗\x20Validation\x20failed:\x20','oauth','172kMDVej','Validating\x20API\x20key...','site','message','tdx\x20profile:\x20','6828vFFtVq','apikey','Setting\x20up\x20authentication\x20for\x20site:\x20','create','✓\x20Authentication\x20successful\x0a','red','select','status','all','60KunVZm','join','OAuth\x20(browser\x20login)','\x20for\x20profile:\x20','green','\x0aSetup\x20cancelled','Read\x20credential\x20from\x20','46953IPuCCG','log','error','\x20--profile\x20','\x27\x20registered','tdx:\x20auth\x20clear','User:\x20','OAuth\x20tokens','✓\x20Profile\x20\x27','710AgRtHK','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','getUserInfo','\x20\x20tdx','/app/mp/ak','description','execute','Remove\x20API\x20key\x20from\x20system\x20keychain','bold','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','apiKey','API\x20Key','1649930cynIHy','No\x20credential\x20found','trim','4916177wMaisL','auth:clear','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20and\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','4871024XOUskD','Enter\x20your\x20TD\x20API\x20key:','\x20removed\x20from\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','name','us01','Setup\x20cancelled','password','\x20(profile:\x20','20hthvoU','✓\x20Default\x20site\x20set\x20to\x20','first_name','10769NbEJGl'];a7_0x6e48=function(){return _0x4065c3;};return a7_0x6e48();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';function a7_0x193f(_0x2d7917,_0x3aa996){_0x2d7917=_0x2d7917-0x120;const _0x6e48a7=a7_0x6e48();let _0x193f22=_0x6e48a7[_0x2d7917];return _0x193f22;}import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x1b93e1 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4d3fbc from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x3dd6c0(0x132)]='auth:setup';[a7_0x3dd6c0(0x170)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x91b8f1){const _0x144c0e=a7_0x3dd6c0,{options:_0x2ffee4}=_0x91b8f1,_0x48545f=_0x2ffee4[_0x144c0e(0x123)];console[_0x144c0e(0x163)](a7_0x4d3fbc[_0x144c0e(0x121)](_0x144c0e(0x149)));const _0x166b5f=_0x2ffee4[_0x144c0e(0x14f)]||_0x144c0e(0x133),_0xee4164=await promptSiteSelection(_0x166b5f,_0x48545f,_0x144c0e(0x134));if(!_0xee4164)return 0x1;const _0x12a2ff=resolveSite(_0xee4164);if(isOAuthSupported(_0x12a2ff)){const _0xeff4be=await a7_0x1b93e1({'type':_0x144c0e(0x158),'name':_0x144c0e(0x13b),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x144c0e(0x15d),'value':_0x144c0e(0x14c)},{'title':_0x144c0e(0x125),'value':_0x144c0e(0x153)}]});if(!_0xeff4be[_0x144c0e(0x13b)])return console[_0x144c0e(0x163)](_0x144c0e(0x160)),0x1;if(_0xeff4be[_0x144c0e(0x13b)]===_0x144c0e(0x14c))return await runOAuthLoginFlow(_0x12a2ff,_0x48545f,_0x2ffee4[_0x144c0e(0x13e)]??LogLevel['ERROR']),0x0;}console[_0x144c0e(0x163)](_0x144c0e(0x154)+_0x12a2ff),console[_0x144c0e(0x163)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x12a2ff,_0x144c0e(0x16f)));const _0x4ce16c=await a7_0x1b93e1({'type':_0x144c0e(0x135),'name':_0x144c0e(0x124),'message':_0x144c0e(0x12f),'validate':_0x5d9c87=>{const _0xd60e3d=_0x144c0e;if(!_0x5d9c87||!_0x5d9c87[_0xd60e3d(0x128)]())return _0xd60e3d(0x142);return!![];}});if(!_0x4ce16c[_0x144c0e(0x124)])return console[_0x144c0e(0x163)](_0x144c0e(0x160)),0x1;const _0x512a21=_0x4ce16c[_0x144c0e(0x124)];console[_0x144c0e(0x163)](_0x144c0e(0x14e));try{const _0x3408a6=TDX[_0x144c0e(0x155)]({'site':_0x12a2ff,'apiKey':_0x512a21[_0x144c0e(0x128)](),'logLevel':_0x2ffee4[_0x144c0e(0x13e)]??LogLevel['ERROR']}),_0x49de0e=await _0x3408a6['jobs'][_0x144c0e(0x16d)]();console[_0x144c0e(0x163)](_0x144c0e(0x131)+_0x49de0e[_0x144c0e(0x145)]+')');const _0x1657d7=await isKeychainAvailable();_0x1657d7?(await saveAPIKeyAsync(_0x512a21['trim'](),_0x12a2ff,_0x48545f),console[_0x144c0e(0x163)](_0x144c0e(0x12b)+(_0x48545f?'\x20(profile:\x20'+_0x48545f+')':''))):(console[_0x144c0e(0x148)](a7_0x4d3fbc[_0x144c0e(0x146)](_0x144c0e(0x16c))),console[_0x144c0e(0x148)](a7_0x4d3fbc[_0x144c0e(0x146)](_0x144c0e(0x13f))));if(_0x48545f){const _0x56f5db={'site':_0x12a2ff};saveProfileToUserConfig(_0x48545f,_0x56f5db),console[_0x144c0e(0x163)](_0x144c0e(0x16a)+_0x48545f+_0x144c0e(0x166));}else saveDefaultSiteToUserConfig(_0x12a2ff),console['log'](_0x144c0e(0x138)+_0x12a2ff);const _0xe18493=_0x48545f?_0x144c0e(0x165)+_0x48545f:'';return console[_0x144c0e(0x163)](),console[_0x144c0e(0x163)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x144c0e(0x16e)+_0xe18493+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x144c0e(0x16e)+_0xe18493+_0x144c0e(0x122)),0x0;}catch(_0x158b39){if(_0x158b39 instanceof HTTPClientError&&_0x158b39[_0x144c0e(0x159)]===0x191)return printAuthError(_0x158b39),0x1;return console['error'](a7_0x4d3fbc[_0x144c0e(0x157)](_0x144c0e(0x14b)+(_0x158b39 instanceof Error?_0x158b39[_0x144c0e(0x150)]:String(_0x158b39)))),console['error'](_0x144c0e(0x12d)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x3dd6c0(0x170)]=a7_0x3dd6c0(0x143);async[a7_0x3dd6c0(0x171)](_0x6f7632){const _0x166fba=a7_0x3dd6c0,{options:_0xdf9609,tdx:_0x2091ce}=_0x6f7632,_0x2de469=_0xdf9609[_0x166fba(0x14f)],_0x4516d6=_0xdf9609[_0x166fba(0x123)],_0x4bc6cc=_0x4516d6?_0x4516d6:'N/A';console[_0x166fba(0x163)](_0x166fba(0x151)+_0x4bc6cc+_0x166fba(0x144)+_0x2de469+')');const _0x260079=await getOAuthTokens(_0x4516d6);if(_0x260079)console[_0x166fba(0x163)]('Credential\x20type:\x20OAuth'),console['log'](_0x166fba(0x13c)+(_0x4516d6?_0x166fba(0x136)+_0x4516d6+')':''));else{const _0x57752a=await resolveAPIKeyAsync(_0x2de469,_0x4516d6);if(_0x57752a){const {source:_0xea3095,isDeprecated:_0xfc3447}=_0x57752a,_0x33e9ed=_0x166fba(0x161)+_0xea3095;console[_0x166fba(0x163)](_0xfc3447?a7_0x4d3fbc['yellow'](_0x33e9ed):_0x33e9ed);}else console['log'](a7_0x4d3fbc[_0x166fba(0x146)](_0x166fba(0x127)));}try{const _0x4e07c4=await _0x2091ce['jobs'][_0x166fba(0x16d)]();return console[_0x166fba(0x163)](a7_0x4d3fbc[_0x166fba(0x15f)](_0x166fba(0x156))),console[_0x166fba(0x163)](_0x166fba(0x168)+_0x4e07c4['email']),(_0x4e07c4['first_name']||_0x4e07c4['last_name'])&&console[_0x166fba(0x163)]('Name:\x20'+[_0x4e07c4[_0x166fba(0x139)],_0x4e07c4['last_name']][_0x166fba(0x147)](Boolean)[_0x166fba(0x15c)]('\x20')),0x0;}catch(_0x35c79b){return _0x35c79b instanceof HTTPClientError&&_0x35c79b[_0x166fba(0x159)]===0x191?printAuthError(_0x35c79b,!![],_0x4516d6):console[_0x166fba(0x164)](a7_0x4d3fbc['red'](_0x166fba(0x14b)+(_0x35c79b instanceof Error?_0x35c79b[_0x166fba(0x150)]:String(_0x35c79b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3dd6c0(0x132)]=a7_0x3dd6c0(0x12a);[a7_0x3dd6c0(0x170)]=a7_0x3dd6c0(0x120);async['execute'](_0x5d4c87){const _0x1cc50a=a7_0x3dd6c0,{options:_0x187f7b}=_0x5d4c87,_0xeb31ae=_0x187f7b[_0x1cc50a(0x123)];console[_0x1cc50a(0x163)](a7_0x4d3fbc[_0x1cc50a(0x121)](_0x1cc50a(0x167)));const _0xeb219c=await isKeychainAvailable();if(!_0xeb219c)return console[_0x1cc50a(0x164)](a7_0x4d3fbc['red'](_0x1cc50a(0x141))),0x1;const [_0xd3eb37,_0x220f9a]=await Promise[_0x1cc50a(0x15a)]([deleteKeychainAPIKey(_0xeb31ae),deleteOAuthTokens(_0xeb31ae)]);if(_0xd3eb37||_0x220f9a){clearCredentialCache();const _0x583dd3=[_0xd3eb37&&'API\x20key',_0x220f9a&&_0x1cc50a(0x169)][_0x1cc50a(0x147)](Boolean)[_0x1cc50a(0x15c)](_0x1cc50a(0x12c));return console[_0x1cc50a(0x163)]('✓\x20'+_0x583dd3+_0x1cc50a(0x130)+(_0xeb31ae?'\x20(profile:\x20'+_0xeb31ae+')':'')),0x0;}else return console[_0x1cc50a(0x163)](_0x1cc50a(0x14a)+(_0xeb31ae?_0x1cc50a(0x15e)+_0xeb31ae:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x4fcbd9=a8_0x1ba4;(function(_0x4c7964,_0x2816dc){const _0x4f3068=a8_0x1ba4,_0x28285d=_0x4c7964();while(!![]){try{const _0x4f2350=-parseInt(_0x4f3068(0x1cb))/0x1*(parseInt(_0x4f3068(0x1cf))/0x2)+-parseInt(_0x4f3068(0x1c7))/0x3*(parseInt(_0x4f3068(0x1c8))/0x4)+-parseInt(_0x4f3068(0x1d0))/0x5+parseInt(_0x4f3068(0x1d4))/0x6+parseInt(_0x4f3068(0x1dc))/0x7*(parseInt(_0x4f3068(0x1c3))/0x8)+parseInt(_0x4f3068(0x1d7))/0x9*(parseInt(_0x4f3068(0x1de))/0xa)+parseInt(_0x4f3068(0x1c0))/0xb*(-parseInt(_0x4f3068(0x1c6))/0xc);if(_0x4f2350===_0x2816dc)break;else _0x28285d['push'](_0x28285d['shift']());}catch(_0x571151){_0x28285d['push'](_0x28285d['shift']());}}}(a8_0x388d,0x74f8b));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';function a8_0x388d(){const _0x2984a6=['✓\x20Authentication\x20successful\x20(User:\x20','name','5125304zhhPix','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','bold','204hPaMXp','15whZZJh','406936zSudJk','/oauth/authorize','ERROR','1DApnog','auth:login','\x20\x20tdx','access_token','695518WtSreu','826540MQNGht','getUserInfo','site','green','1212114iGoSdw','\x20(profile:\x20','log','8452467LNlVes','create','tdx:\x20auth\x20login','Validating\x20OAuth\x20tokens...','us01','7gcZcRK','Login\x20via\x20OAuth\x20(opens\x20browser)','10AFbRXO','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Profile\x20\x27','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','\x27\x20registered','Login\x20cancelled','profile','181819nmVsrK'];a8_0x388d=function(){return _0x2984a6;};return a8_0x388d();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x8ec63a from'chalk';function a8_0x1ba4(_0x1e331d,_0x1e02c1){_0x1e331d=_0x1e331d-0x1b9;const _0x388d2d=a8_0x388d();let _0x1ba443=_0x388d2d[_0x1e331d];return _0x1ba443;}export async function runOAuthLoginFlow(_0x409b68,_0x539553,_0x31e119){const _0x2c891f=a8_0x1ba4;if(!isOAuthSupported(_0x409b68))throw new Error(_0x2c891f(0x1b9)+_0x409b68+'.\x20'+_0x2c891f(0x1bc)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x42e7bf=await isKeychainAvailable();if(!_0x42e7bf)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x1ffb0c=getConsoleUrl(_0x409b68);console[_0x2c891f(0x1d6)]('Opening\x20browser\x20for\x20authentication...'),console['log']('\x20\x20'+_0x1ffb0c+_0x2c891f(0x1c9)),console[_0x2c891f(0x1d6)](_0x2c891f(0x1c4));const _0x4a85e4=await startOAuthFlow(_0x409b68);console[_0x2c891f(0x1d6)](_0x2c891f(0x1da));const _0x35ec53=TDX[_0x2c891f(0x1d8)]({'site':_0x409b68,'accessToken':_0x4a85e4[_0x2c891f(0x1ce)],'logLevel':_0x31e119??LogLevel[_0x2c891f(0x1ca)]}),_0x1532d4=await _0x35ec53['jobs'][_0x2c891f(0x1d1)]();console['log'](a8_0x8ec63a[_0x2c891f(0x1d3)](_0x2c891f(0x1c1)+_0x1532d4['email']+')')),await saveOAuthTokens(_0x4a85e4,_0x539553),console[_0x2c891f(0x1d6)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x539553?_0x2c891f(0x1d5)+_0x539553+')':''));if(_0x539553){const _0x44476f={'site':_0x409b68};saveProfileToUserConfig(_0x539553,_0x44476f),console[_0x2c891f(0x1d6)](_0x2c891f(0x1bb)+_0x539553+_0x2c891f(0x1bd));}const _0x290280=_0x539553?'\x20--profile\x20'+_0x539553:'';console[_0x2c891f(0x1d6)](),console[_0x2c891f(0x1d6)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x2c891f(0x1d6)](_0x2c891f(0x1cd)+_0x290280+_0x2c891f(0x1df)),console[_0x2c891f(0x1d6)](_0x2c891f(0x1cd)+_0x290280+_0x2c891f(0x1ba));}export class AuthLoginCommand extends BaseCommand{[a8_0x4fcbd9(0x1c2)]=a8_0x4fcbd9(0x1cc);['description']=a8_0x4fcbd9(0x1dd);async['execute'](_0xfd27b9){const _0x20c4a8=a8_0x4fcbd9,{options:_0xf5de71}=_0xfd27b9,_0x2c2cbf=_0xf5de71[_0x20c4a8(0x1bf)];console[_0x20c4a8(0x1d6)](a8_0x8ec63a[_0x20c4a8(0x1c5)](_0x20c4a8(0x1d9)));const _0x51cead=_0xf5de71[_0x20c4a8(0x1d2)]||_0x20c4a8(0x1db),_0x3a0e5a=await promptSiteSelection(_0x51cead,_0x2c2cbf,_0x20c4a8(0x1be));if(!_0x3a0e5a)return 0x1;const _0x3aefaf=resolveSite(_0x3a0e5a);return console['log']('Authenticating\x20via\x20OAuth\x20for\x20site:\x20'+_0x3aefaf),await runOAuthLoginFlow(_0x3aefaf,_0x2c2cbf,_0xf5de71['logLevel']??LogLevel[_0x20c4a8(0x1ca)]),0x0;}}
|