@treasuredata/tdx 2026.9.3 → 2026.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/ai-usage-command-base.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-journey-command.d.ts +34 -0
- package/dist/commands/cas-journey-command.d.ts.map +1 -0
- package/dist/commands/cas-journey-command.js +1 -0
- package/dist/commands/cas-journey-command.js.map +1 -0
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/codex-command.d.ts.map +1 -1
- package/dist/commands/codex-command.js +1 -1
- package/dist/commands/codex-command.js.map +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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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-readiness-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-in-browser-message-command.js +1 -1
- package/dist/commands/engage-landing-page-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/engage-workspace-assignment-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts +46 -0
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +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/opencode-command.d.ts +25 -0
- package/dist/commands/opencode-command.d.ts.map +1 -1
- package/dist/commands/opencode-command.js +1 -1
- package/dist/commands/opencode-command.js.map +1 -1
- package/dist/commands/opencode-usage-command.js +1 -1
- package/dist/commands/p13n-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-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/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +10 -1
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +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/site-mismatch.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/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +2 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +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/auth-token.js +1 -1
- package/dist/sdk/cas/audience-context.d.ts +33 -0
- package/dist/sdk/cas/audience-context.d.ts.map +1 -0
- package/dist/sdk/cas/audience-context.js +1 -0
- package/dist/sdk/cas/audience-context.js.map +1 -0
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.d.ts +8 -0
- package/dist/sdk/cas/index.d.ts.map +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/index.js.map +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/validate-files.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/p13n-studio-api-client.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/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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-readiness-workflow.js +1 -1
- package/dist/sdk/engage/campaign-readiness.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/in-browser-message-pull.js +1 -1
- package/dist/sdk/engage/in-browser-message-push.js +1 -1
- package/dist/sdk/engage/in-browser-message-validator.js +1 -1
- package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
- package/dist/sdk/engage/landing-page-init.js +1 -1
- package/dist/sdk/engage/landing-page-public-asset.js +1 -1
- package/dist/sdk/engage/landing-page-pull.js +1 -1
- package/dist/sdk/engage/landing-page-push.js +1 -1
- package/dist/sdk/engage/landing-page-static-site.js +1 -1
- package/dist/sdk/engage/landing-page-validator.js +1 -1
- package/dist/sdk/engage/landing-page-workspace.js +1 -1
- package/dist/sdk/engage/landing-page-yaml.js +1 -1
- package/dist/sdk/engage/list-campaign-schema.js +1 -1
- package/dist/sdk/engage/list-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/always-on-campaign-schema.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/in-browser-message-schema.js +1 -1
- package/dist/sdk/engage/types/landing-page-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/workspace-assignments.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.d.ts +4 -1
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/p13n-studio-errors.js +1 -1
- package/dist/sdk/p13n-studio.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.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/audience-context.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/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.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/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.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/proxy-fetch.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 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x267ff3=a3_0x1d5a;(function(_0x1c69fc,_0x3b4591){const _0x3469b7=a3_0x1d5a,_0x4fa5a9=_0x1c69fc();while(!![]){try{const _0x589d8a=parseInt(_0x3469b7(0x78))/0x1+parseInt(_0x3469b7(0x89))/0x2*(parseInt(_0x3469b7(0x90))/0x3)+parseInt(_0x3469b7(0x7c))/0x4+parseInt(_0x3469b7(0x96))/0x5*(parseInt(_0x3469b7(0x91))/0x6)+parseInt(_0x3469b7(0x7f))/0x7*(parseInt(_0x3469b7(0x8b))/0x8)+parseInt(_0x3469b7(0x7e))/0x9+-parseInt(_0x3469b7(0x98))/0xa*(parseInt(_0x3469b7(0x7a))/0xb);if(_0x589d8a===_0x3b4591)break;else _0x4fa5a9['push'](_0x4fa5a9['shift']());}catch(_0x2df380){_0x4fa5a9['push'](_0x4fa5a9['shift']());}}}(a3_0x3d32,0x8e2ee));import{BaseCommand}from'./command.js';function a3_0x3d32(){const _0x398aec=['site','data','resolveSegmentId','name','Site:\x20','\x20\x20Cause:\x20','verbose','cause','1634462xsVINB','Parent\x20name:\x20','2777128tTSRFR','message','segment','length','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','3KIGkiM','60UbvGDQ','Resolved\x20parent\x20ID:\x20','error','Resolving\x20parent\x20segment\x20\x27','\x27...','53605sMvEGA','Resolved\x20child\x20ID:\x20','16400740XQZaVd','\x20activation','activations','Error:\x20','1158967zYhSmf','List\x20activations\x20for\x20a\x20segment','22LUTPbz','Resolving\x20child\x20segment\x20\x27','3334856YrOzdI','description','2260134mncXXQ','14Gobsec','listActivations'];a3_0x3d32=function(){return _0x398aec;};return a3_0x3d32();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x1d5a(_0x521df0,_0x3ae6b9){_0x521df0=_0x521df0-0x77;const _0x3d324c=a3_0x3d32();let _0x1d5a83=_0x3d324c[_0x521df0];return _0x1d5a83;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x267ff3(0x84)]=a3_0x267ff3(0x9a);[a3_0x267ff3(0x7d)]=a3_0x267ff3(0x79);async['execute'](_0x14cd48){const _0x5e4124=a3_0x267ff3,{options:_0x2737ca,args:_0x34f6ed,tdx:_0x4c7ebf}=_0x14cd48;if(_0x34f6ed[_0x5e4124(0x8e)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0x5e4124(0x93)](_0x5e4124(0x8f)),0x1;try{const {parentId:_0x12ca25,childId:_0x2f5a47}=parseSegmentRef(_0x34f6ed[0x0]);if(!_0x2f5a47)return console[_0x5e4124(0x93)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x5e4124(0x8f)),0x1;_0x2737ca[_0x5e4124(0x87)]&&(console[_0x5e4124(0x93)](_0x5e4124(0x85)+_0x2737ca[_0x5e4124(0x81)]),console['error'](_0x5e4124(0x8a)+_0x12ca25),console['error']('Child\x20name:\x20'+_0x2f5a47));const _0x17a002=await withSpinner(_0x5e4124(0x94)+_0x12ca25+'\x27...',()=>_0x4c7ebf['segment']['resolveParentId'](_0x12ca25),{'verbose':_0x2737ca[_0x5e4124(0x87)]}),_0x5d3c0e=_0x17a002[_0x5e4124(0x82)];_0x2737ca[_0x5e4124(0x87)]&&console['error'](_0x5e4124(0x92)+_0x5d3c0e);const _0x34865b=await withSpinner(_0x5e4124(0x7b)+_0x2f5a47+_0x5e4124(0x95),()=>_0x4c7ebf[_0x5e4124(0x8d)][_0x5e4124(0x83)](_0x5d3c0e,_0x2f5a47),{'verbose':_0x2737ca[_0x5e4124(0x87)]}),_0x26256e=_0x34865b['data'];_0x2737ca['verbose']&&console[_0x5e4124(0x93)](_0x5e4124(0x97)+_0x26256e);const _0x465bb5=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x2f5a47+_0x5e4124(0x95),()=>_0x4c7ebf['segment'][_0x5e4124(0x80)](_0x5d3c0e,_0x26256e),{'verbose':_0x2737ca[_0x5e4124(0x87)]}),_0x3fd946=_0x465bb5[_0x5e4124(0x82)];return console['error']('✔\x20Found\x20'+_0x3fd946['length']+_0x5e4124(0x99)+(_0x3fd946[_0x5e4124(0x8e)]!==0x1?'s':'')),await handleSDKOutput(_0x3fd946,_0x2737ca),0x0;}catch(_0x4fdffc){if(_0x4fdffc instanceof SDKError)return console['error'](_0x5e4124(0x77)+_0x4fdffc[_0x5e4124(0x8c)]),_0x4fdffc[_0x5e4124(0x88)]&&console[_0x5e4124(0x93)](_0x5e4124(0x86)+_0x4fdffc[_0x5e4124(0x88)]),0x1;throw _0x4fdffc;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x548581=a4_0x39d3;(function(_0x3de63c,_0x1878c3){const _0xab7ab7=a4_0x39d3,_0x405e3a=_0x3de63c();while(!![]){try{const _0x480692=parseInt(_0xab7ab7(0x217))/0x1+-parseInt(_0xab7ab7(0x18c))/0x2+parseInt(_0xab7ab7(0x171))/0x3+parseInt(_0xab7ab7(0x1fb))/0x4+-parseInt(_0xab7ab7(0x1b3))/0x5*(parseInt(_0xab7ab7(0x1e1))/0x6)+parseInt(_0xab7ab7(0x193))/0x7+-parseInt(_0xab7ab7(0x205))/0x8*(-parseInt(_0xab7ab7(0x1a8))/0x9);if(_0x480692===_0x1878c3)break;else _0x405e3a['push'](_0x405e3a['shift']());}catch(_0x3df993){_0x405e3a['push'](_0x405e3a['shift']());}}}(a4_0x335b,0xa86c5));function a4_0x335b(){const _0x3a4e17=['action','Cancelled','Writing\x20files...','message','Cloning\x20\x22','Using\x20local\x20project:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aError:','2106255mREbsO','counts','tdx.json','\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','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20resources?','red','\x0aWrite\x20','agent:clone','agent:pull','sourceProjectName','\x20|\x20','Would\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','profile','\x20\x20Form\x20Interfaces:\x20','\x0a✔\x20Pushed\x20','MISSING_ARGUMENT','textKnowledgeBases','dim','description','errors','unchanged','Analyzing\x20project\x20\x22','dryRun','692132aLyYXa','no_context','site','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20new','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Prompts:\x20','1062516tHQiMW','\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','integrations','\x0aPush\x20','new','\x20\x20Knowledge\x20Bases:\x20','log','cyan','yes','execute','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','projectName','No\x20tdx.json\x20found\x20in\x20','llmProject','diff','updated','outputDir','repeat','New\x20project\x20ID:\x20','context','\x20--profile\x20','370485BZJCOb','source','agentName','INVALID_ARGUMENT','\x20total','✔\x20Context\x20set:\x20','\x0aPull\x20summary\x20for\x20\x27','\x0aProject\x20pushed\x20with\x20errors','\x20\x20Chat\x20Interfaces:\x20','arg-dir','\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','5mRNTNf','utf-8','newProjectName','llm_project','Using\x20project\x20from\x20','Using\x20current\x20project:\x20','agentId','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22:\x20','\x20files\x20to\x20','created','\x20\x20Text\x20Knowledge\x20Base\x20\x22','reason','knowledgeBases','experimentalArtifacts','Agent:\x20','\x20\x20Chat\x20Interface\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Agent\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20resources\x20to\x20\x27','Using\x20project\x20from\x20context:\x20','Errors:','\x20unchanged','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','output','parse','pullAgent','cwd-config','Agent\x20pulled\x20successfully','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','push','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Using\x20project:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','total','yellow','gray','\x20\x20tdx\x20agent\x20pull\x20','chatInterfaces','\x22\x20to\x20a\x20different\x20profile','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Project:\x20','newProjectId','llm','4984020cgUDXP','\x20\x20Source:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','\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)','\x20\x20Target:\x20','Using\x20context\x20project:\x20','Pushing\x20agent\x20from\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','\x0a✔\x20Pulled\x20','Project\x20cloned\x20successfully','\x20\x20Form\x20Interface\x20\x22','outputPath','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','error','-\x20nothing\x20pushed','pushProject','experimentalKnowledgeBases','pushAgent','\x20=\x20','prompts','Would\x20clone:','\x20\x20Experimental\x20Artifacts:\x20','join','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','291188QrtWEp','no_local_folder','\x22...','\x0aChanges\x20to\x20agent\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Text\x20Knowledge\x20Bases:\x20','Clone\x20\x22','hasChanges','force','8MGDSWF','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dirname','session','\x20\x20Knowledge\x20Base\x20\x22','agent','Pushing\x20to\x20project...','cloneProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Prompt\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','formInterfaces','Failed\x20to\x20push\x20agent:\x20','Summary:','cwd','\x0aErrors\x20found:','New\x20project:\x20','898762ZLsuTR','pullProject','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','New\x20project\x20name\x20is\x20required','\x22\x20to\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','projectId','Pulling\x20agent\x20\x22','\x20changed','Agent\x20','agents','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Agents:\x20','isNew','-\x20no\x20files\x20written'];a4_0x335b=function(){return _0x3a4e17;};return a4_0x335b();}import a4_0x2eb76c from'chalk';import a4_0x2853a9 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x39d3(_0x4c1708,_0x4d069d){_0x4c1708=_0x4c1708-0x15e;const _0x335b89=a4_0x335b();let _0x39d3f6=_0x335b89[_0x4c1708];return _0x39d3f6;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x5486f4){const _0x8b1c9e=a4_0x39d3,_0x182a3d=[];if(_0x5486f4[_0x8b1c9e(0x1d7)]!==undefined)_0x182a3d['push'](_0x5486f4[_0x8b1c9e(0x1d7)]+_0x8b1c9e(0x1ac));if(_0x5486f4[_0x8b1c9e(0x197)]!==undefined&&_0x5486f4['new']>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c[_0x8b1c9e(0x1e5)](_0x5486f4['new']+_0x8b1c9e(0x190)));if(_0x5486f4[_0x8b1c9e(0x1bd)]!==undefined&&_0x5486f4[_0x8b1c9e(0x1bd)]>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c[_0x8b1c9e(0x1e5)](_0x5486f4[_0x8b1c9e(0x1bd)]+'\x20created'));if(_0x5486f4[_0x8b1c9e(0x1a2)]!==undefined&&_0x5486f4[_0x8b1c9e(0x1a2)]>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c['yellow'](_0x5486f4['updated']+'\x20updated'));if(_0x5486f4[_0x8b1c9e(0x189)]!==undefined&&_0x5486f4[_0x8b1c9e(0x189)]>0x0)_0x182a3d['push'](a4_0x2eb76c[_0x8b1c9e(0x1d9)](_0x5486f4[_0x8b1c9e(0x189)]+_0x8b1c9e(0x1cb)));if(_0x5486f4[_0x8b1c9e(0x188)]!==undefined&&_0x5486f4['errors']>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c['red'](_0x5486f4[_0x8b1c9e(0x188)]+'\x20errors'));return _0x182a3d[_0x8b1c9e(0x1f9)](',\x20');}function displayDiffs(_0x305aa0,_0x51f90d,_0x3ad12d,_0x39258b,_0x4016db,_0x51a477,_0x10661b,_0x4aa83c,_0x36b92d){const _0xb9600b=a4_0x39d3;for(const _0x2edcf5 of _0x305aa0){if(_0x2edcf5[_0xb9600b(0x1a1)]){const _0x306d26=_0x2edcf5[_0xb9600b(0x1aa)]||_0x2edcf5[_0xb9600b(0x210)];console['log'](_0xb9600b(0x1fe)+_0x306d26+'\x27:'),console[_0xb9600b(0x199)]('─'['repeat'](0x3c)),console[_0xb9600b(0x199)](_0x2edcf5[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'['repeat'](0x3c));}}for(const _0x1fba5f of _0x51f90d){_0x1fba5f['diff']&&(console[_0xb9600b(0x199)](_0xb9600b(0x1fa)+_0x1fba5f[_0xb9600b(0x210)]+'\x27:'),console['log']('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x1fba5f[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x37d92c of _0x3ad12d){_0x37d92c[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x37d92c[_0xb9600b(0x210)]+'\x27:'),console['log']('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x37d92c[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x4b700a of _0x39258b){_0x4b700a[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)](_0xb9600b(0x15f)+_0x4b700a[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'['repeat'](0x3c)),console[_0xb9600b(0x199)](_0x4b700a[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x29d1b7 of _0x4016db){_0x29d1b7['diff']&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x29d1b7[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x29d1b7[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x1a7a03 of _0x51a477){_0x1a7a03[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x1a7a03[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x1a7a03[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x2d0b9f of _0x10661b){_0x2d0b9f['diff']&&(console['log'](_0xb9600b(0x1d4)+_0x2d0b9f[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x2d0b9f[_0xb9600b(0x1a1)]),console['log']('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x4d293a of _0x4aa83c){_0x4d293a[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4d293a[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x4d293a[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x3cc575 of _0x36b92d){_0x3cc575['diff']&&(console[_0xb9600b(0x199)](_0xb9600b(0x177)+_0x3cc575[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x3cc575['diff']),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x548581(0x210)]=a4_0x548581(0x17c);[a4_0x548581(0x187)]=a4_0x548581(0x1e3);async[a4_0x548581(0x19c)](_0x3bd507){const _0x4db717=a4_0x548581,{options:_0x404418,args:_0x419587,tdx:_0x1bf585}=_0x3bd507,_0x33b6b5=_0x419587[0x0],_0x35d6e3=_0x419587[0x1],_0x497872=_0x404418[_0x4db717(0x1cd)],_0x4a0e8e=_0x404418[_0x4db717(0x18b)],_0x443b81=_0x404418[_0x4db717(0x204)],_0x16aba6=_0x404418[_0x4db717(0x19b)],_0x4c2628=_0x404418[_0x4db717(0x1a0)],_0x33ca8c=_0x404418[_0x4db717(0x20a)];let _0x4eb937;if(_0x33b6b5){const _0x4e5cd7=a4_0x2853a9[_0x4db717(0x1f9)](_0x33b6b5,_0x4db717(0x173));if(existsSync(_0x4e5cd7))try{const _0x54b777=JSON[_0x4db717(0x1ce)](readFileSync(_0x4e5cd7,_0x4db717(0x1b4)));_0x54b777[_0x4db717(0x1b6)]&&(_0x4eb937={'llm_project':_0x54b777[_0x4db717(0x1b6)]});}catch{}}const _0x1956ce=findAgentConfigPath(process[_0x4db717(0x214)]());let _0x314c22;if(_0x1956ce)try{const _0xdf7128=JSON[_0x4db717(0x1ce)](readFileSync(_0x1956ce,_0x4db717(0x1b4)));_0xdf7128['llm_project']&&(_0x314c22={'llm_project':_0xdf7128[_0x4db717(0x1b6)]});}catch{}const _0x3eea46=resolveAgentPullArgs({'arg':_0x33b6b5,'agentNameArg':_0x35d6e3,'agentFlag':_0x33ca8c,'contextProject':_0x4c2628,'argDirConfig':_0x4eb937,'cwdConfigPath':_0x1956ce||undefined,'cwdConfig':_0x314c22}),{projectNameOrId:_0xd0ba54,targetAgentName:_0x360369,existingOutputDir:_0x2f3860,source:_0x1df413}=_0x3eea46;if(_0x1df413===_0x4db717(0x1b1))console[_0x4db717(0x199)](a4_0x2eb76c['dim'](_0x4db717(0x1b7)+a4_0x2853a9[_0x4db717(0x1f9)](_0x33b6b5,_0x4db717(0x173))+':\x20'+_0xd0ba54));else{if(_0x1df413===_0x4db717(0x1d0))console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1d5)+_0xd0ba54));else _0x1df413==='context'&&console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1c9)+_0xd0ba54));}if(!_0xd0ba54)return _0x33ca8c?(console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x191))),console[_0x4db717(0x199)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log']('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4db717(0x199)](_0x4db717(0x1c4)),console[_0x4db717(0x199)](_0x4db717(0x174)),console[_0x4db717(0x199)](_0x4db717(0x1b2)),console[_0x4db717(0x199)](_0x4db717(0x194))),0x1;if(_0x360369){const {data:_0x43bdab}=await withSpinner(_0x4db717(0x161)+_0x360369+'\x22\x20from\x20project\x20\x22'+_0xd0ba54+_0x4db717(0x1fd),()=>_0x1bf585[_0x4db717(0x1e0)][_0x4db717(0x1cf)](_0xd0ba54,_0x360369,_0x497872,{'dryRun':_0x4a0e8e,'force':_0x443b81}));if(_0x4a0e8e)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x20d))),console[_0x4db717(0x199)](_0x4db717(0x180)+_0x43bdab['agentName']),console[_0x4db717(0x199)]('Output\x20path:\x20'+_0x43bdab[_0x4db717(0x1ee)]),_0x43bdab['diff']&&(console[_0x4db717(0x199)]('\x0aChanges:'),console[_0x4db717(0x199)]('─'[_0x4db717(0x1a4)](0x3c)),console[_0x4db717(0x199)](_0x43bdab[_0x4db717(0x1a1)]),console['log']('─'[_0x4db717(0x1a4)](0x3c))),0x0;return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x1d1))),console[_0x4db717(0x199)](_0x4db717(0x1c2)+_0x43bdab[_0x4db717(0x1aa)]),console[_0x4db717(0x199)]('Output:\x20'+_0x43bdab[_0x4db717(0x1ee)]),console['log']('Status:\x20'+(_0x43bdab[_0x4db717(0x167)]?a4_0x2eb76c['green'](_0x4db717(0x197)):_0x43bdab[_0x4db717(0x203)]?a4_0x2eb76c['yellow'](_0x4db717(0x1a2)):a4_0x2eb76c[_0x4db717(0x1d9)](_0x4db717(0x189)))),0x0;}const _0xb07bbb=_0x2f3860||_0x497872,{data:_0x43af13}=await withSpinner(_0x4db717(0x18a)+_0xd0ba54+_0x4db717(0x1fd),()=>_0x1bf585[_0x4db717(0x1e0)][_0x4db717(0x218)](_0xd0ba54,_0xb07bbb,{'dryRun':!![]})),_0x14d10b=_0x43af13[_0x4db717(0x172)][_0x4db717(0x164)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)]['knowledgeBases'][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)]['textKnowledgeBases'][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x197)]+_0x43af13['counts']['formInterfaces']['new']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)][_0x4db717(0x197)],_0x7bb37d=_0x43af13['counts']['agents'][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c0)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x185)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)]['formInterfaces'][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)]['updated'],_0x177e65=_0x43af13[_0x4db717(0x172)][_0x4db717(0x164)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c0)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x185)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x1f6)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x1f3)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x189)]+_0x43af13[_0x4db717(0x172)]['formInterfaces']['unchanged']+_0x43af13['counts'][_0x4db717(0x1db)]['unchanged'];console[_0x4db717(0x199)](_0x4db717(0x1ae)+_0x43af13[_0x4db717(0x19e)]+'\x27:'),console[_0x4db717(0x199)]('\x20\x20'+a4_0x2eb76c['green']('+\x20'+_0x14d10b+_0x4db717(0x190))+_0x4db717(0x17e)+a4_0x2eb76c['yellow']('~\x20'+_0x7bb37d+'\x20changed')+_0x4db717(0x17e)+a4_0x2eb76c[_0x4db717(0x186)]('=\x20'+_0x177e65+_0x4db717(0x1cb))),console[_0x4db717(0x199)](_0x4db717(0x166)+formatCountSummary(_0x43af13['counts'][_0x4db717(0x164)])),console[_0x4db717(0x199)](_0x4db717(0x198)+formatCountSummary(_0x43af13['counts']['knowledgeBases'])),console[_0x4db717(0x199)](_0x4db717(0x201)+formatCountSummary(_0x43af13['counts']['textKnowledgeBases'])),console[_0x4db717(0x199)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)])),console[_0x4db717(0x199)](_0x4db717(0x176)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)])),console[_0x4db717(0x199)](_0x4db717(0x182)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x211)])),console[_0x4db717(0x199)](_0x4db717(0x1b0)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)]));const _0x47a832=_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x1d7)]>0x0||_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x1d7)]>0x0;_0x47a832&&(console[_0x4db717(0x199)](_0x4db717(0x19d)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)])));console[_0x4db717(0x199)](_0x4db717(0x1e7)+a4_0x2eb76c[_0x4db717(0x19a)](_0x43af13[_0x4db717(0x1a3)])),displayDiffs(_0x43af13[_0x4db717(0x164)],_0x43af13[_0x4db717(0x1c0)],_0x43af13[_0x4db717(0x185)],_0x43af13[_0x4db717(0x1f6)],_0x43af13[_0x4db717(0x195)],_0x43af13['experimentalKnowledgeBases'],_0x43af13[_0x4db717(0x1c1)],_0x43af13[_0x4db717(0x211)],_0x43af13[_0x4db717(0x1db)]);if(_0x4a0e8e)return console['log'](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x1c7))),0x0;if(_0x14d10b===0x0&&_0x7bb37d===0x0)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x200))),saveSessionContext({'llm_project':_0x43af13[_0x4db717(0x19e)]},_0x404418[_0x4db717(0x208)]),console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x1ad)+a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1b6))+_0x4db717(0x1f5)+a4_0x2eb76c[_0x4db717(0x19a)](_0x43af13[_0x4db717(0x19e)]))),0x0;if(!_0x16aba6&&!_0x443b81){if(!isInteractive())return console['error'](a4_0x2eb76c[_0x4db717(0x179)](_0x4db717(0x170)),_0x4db717(0x206)),console['error'](a4_0x2eb76c['dim'](_0x4db717(0x20f))),0x1;const _0x1649bd=await confirmKey(_0x4db717(0x17a)+(_0x14d10b+_0x7bb37d)+'\x20files?');if(!_0x1649bd)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)]('Cancelled'),_0x4db717(0x168)),0x1;}const {data:_0x2ce20e}=await withSpinner(_0x4db717(0x16b),()=>_0x1bf585[_0x4db717(0x1e0)]['pullProject'](_0xd0ba54,_0xb07bbb,{'force':_0x443b81}));return console[_0x4db717(0x199)](a4_0x2eb76c['green'](_0x4db717(0x1eb)+(_0x14d10b+_0x7bb37d)+_0x4db717(0x1bc)+_0x2ce20e[_0x4db717(0x1a3)])),saveSessionContext({'llm_project':_0x2ce20e[_0x4db717(0x19e)]},_0x404418[_0x4db717(0x208)]),console['log'](a4_0x2eb76c[_0x4db717(0x1e5)]('✔\x20Context\x20set:\x20'+a4_0x2eb76c[_0x4db717(0x186)]('llm_project')+_0x4db717(0x1f5)+a4_0x2eb76c[_0x4db717(0x19a)](_0x2ce20e[_0x4db717(0x19e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x548581(0x210)]=a4_0x548581(0x17b);[a4_0x548581(0x187)]=a4_0x548581(0x219);async[a4_0x548581(0x19c)](_0x3907c4){const _0x14e8d9=a4_0x548581,{options:_0x477cff,args:_0xc13c6,tdx:_0x5f1b09}=_0x3907c4,_0x1f8ca7=_0xc13c6[0x0],_0x1fc857=_0x477cff[_0x14e8d9(0x210)],_0x2dceac=_0x477cff[_0x14e8d9(0x18b)],_0x22faab=_0x477cff[_0x14e8d9(0x19b)],_0x42e367=_0x477cff[_0x14e8d9(0x18e)],_0x541f89=_0x477cff[_0x14e8d9(0x1a0)];let _0x20b23b;const _0x2f3ce7=findAgentConfigPath(process[_0x14e8d9(0x214)]());if(_0x1f8ca7){const _0x434a71=a4_0x2853a9[_0x14e8d9(0x1f9)](_0x1f8ca7,_0x14e8d9(0x173));existsSync(_0x434a71)?(_0x20b23b=_0x1f8ca7,console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x16e)+_0x1f8ca7))):_0x20b23b=_0x1f8ca7;}else{if(_0x2f3ce7)_0x20b23b=a4_0x2853a9[_0x14e8d9(0x207)](_0x2f3ce7),console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x1b8)+_0x20b23b));else{if(_0x541f89){const _0x45423d=sanitizeForFilesystem(_0x541f89);let _0xa44c9=_0x45423d,_0x4541fa=a4_0x2853a9[_0x14e8d9(0x1f9)](process[_0x14e8d9(0x214)](),_0x14e8d9(0x164),_0x45423d,_0x14e8d9(0x173));if(!existsSync(_0x4541fa)){const _0x4fc36e=normalizeName(_0x541f89),_0x5d18d3=a4_0x2853a9[_0x14e8d9(0x1f9)](process[_0x14e8d9(0x214)](),_0x14e8d9(0x164),_0x4fc36e,_0x14e8d9(0x173));existsSync(_0x5d18d3)&&(_0xa44c9=_0x4fc36e,_0x4541fa=_0x5d18d3);}if(existsSync(_0x4541fa))_0x20b23b=a4_0x2853a9[_0x14e8d9(0x207)](_0x4541fa),console['log'](a4_0x2eb76c['dim'](_0x14e8d9(0x16e)+_0x20b23b));else{const _0x347efd=_0x477cff[_0x14e8d9(0x181)];if(_0x347efd)throw new SDKError(ErrorCode[_0x14e8d9(0x1ab)],_0x14e8d9(0x165)+_0x541f89+_0x14e8d9(0x1dc),undefined,{'helpText':_0x14e8d9(0x1ef)+_0x14e8d9(0x1d2)+(_0x14e8d9(0x1da)+_0x541f89+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0xa44c9+'\x20--name\x20'+(_0x1fc857||'<new-name>')+_0x14e8d9(0x1a7)+_0x347efd)});_0x20b23b=_0x541f89,console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x1e8)+_0x541f89));}}}}if(!_0x20b23b)return console[_0x14e8d9(0x199)](a4_0x2eb76c['yellow'](_0x14e8d9(0x1cc))),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x14e8d9(0x199)](_0x14e8d9(0x1e6)),console['log'](_0x14e8d9(0x1d6)),0x1;if(!_0x1fc857)throw new SDKError(ErrorCode[_0x14e8d9(0x184)],_0x14e8d9(0x21a),undefined,{'helpText':_0x14e8d9(0x1ba)});if(!_0x22faab&&!_0x2dceac){if(!isInteractive())return console[_0x14e8d9(0x1f0)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x170)),_0x14e8d9(0x206)),console[_0x14e8d9(0x1f0)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x20f))),0x1;const _0x3a7eac=await confirmKey(_0x14e8d9(0x202)+_0x20b23b+'\x22\x20to\x20new\x20project\x20\x22'+_0x1fc857+'\x22?');if(!_0x3a7eac)return console['log'](a4_0x2eb76c[_0x14e8d9(0x1d8)](_0x14e8d9(0x16a))),0x1;}const {data:_0x490c7d}=await withSpinner(_0x14e8d9(0x16d)+_0x20b23b+_0x14e8d9(0x15e)+_0x1fc857+_0x14e8d9(0x1fd),()=>_0x5f1b09['llm'][_0x14e8d9(0x20c)](_0x20b23b,_0x1fc857,{'dryRun':_0x2dceac}));if(_0x2dceac){console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x1d8)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x14e8d9(0x199)]('Source:\x20'+_0x490c7d[_0x14e8d9(0x17d)]),console['log'](_0x14e8d9(0x216)+_0x1fc857),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f7)),console[_0x14e8d9(0x199)](_0x14e8d9(0x166)+_0x490c7d['counts'][_0x14e8d9(0x164)][_0x14e8d9(0x1bd)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x198)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c0)]['created']),console[_0x14e8d9(0x199)](_0x14e8d9(0x192)+_0x490c7d[_0x14e8d9(0x172)]['prompts'][_0x14e8d9(0x1bd)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x182)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x211)]['created']),console[_0x14e8d9(0x199)]('\x20\x20Chat\x20Interfaces:\x20'+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1db)]['created']);const _0x411776=_0x490c7d['counts']['experimentalKnowledgeBases']['created']>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)]>0x0;return _0x411776&&(console[_0x14e8d9(0x199)](_0x14e8d9(0x19d)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)]['created']),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f8)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)])),0x0;}const _0x46d3e9=_0x490c7d['counts'][_0x14e8d9(0x164)]['errors']>0x0||_0x490c7d[_0x14e8d9(0x172)]['knowledgeBases'][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f6)][_0x14e8d9(0x188)]>0x0||_0x490c7d['counts'][_0x14e8d9(0x211)][_0x14e8d9(0x188)]>0x0||_0x490c7d['counts'][_0x14e8d9(0x1db)][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)]['errors']>0x0;_0x46d3e9?console['log'](a4_0x2eb76c[_0x14e8d9(0x1d8)]('Project\x20cloned\x20with\x20errors')):console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x1e5)](_0x14e8d9(0x1ec)));console[_0x14e8d9(0x199)]('Source:\x20'+_0x490c7d[_0x14e8d9(0x17d)]),console[_0x14e8d9(0x199)]('New\x20project:\x20'+_0x490c7d[_0x14e8d9(0x1b5)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x1a5)+_0x490c7d['newProjectId']),console[_0x14e8d9(0x199)](),console[_0x14e8d9(0x199)](_0x14e8d9(0x213)),console[_0x14e8d9(0x199)](_0x14e8d9(0x166)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x164)])),console['log'](_0x14e8d9(0x198)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x1c0)])),console[_0x14e8d9(0x199)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f6)])),console[_0x14e8d9(0x199)](_0x14e8d9(0x176)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['integrations'])),console['log'](_0x14e8d9(0x182)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x211)])),console[_0x14e8d9(0x199)](_0x14e8d9(0x1b0)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['chatInterfaces']));const _0x519e0d=_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)][_0x14e8d9(0x1bd)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)]['updated']>0x0||_0x490c7d['counts'][_0x14e8d9(0x1f3)][_0x14e8d9(0x189)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)]['updated']>0x0||_0x490c7d['counts'][_0x14e8d9(0x1c1)][_0x14e8d9(0x189)]>0x0;_0x519e0d&&(console[_0x14e8d9(0x199)](_0x14e8d9(0x19d)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['experimentalKnowledgeBases'])),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f8)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x1c1)])));if(_0x46d3e9){console['log'](),console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1ca)));for(const _0x1dc48c of _0x490c7d[_0x14e8d9(0x164)]){_0x1dc48c[_0x14e8d9(0x169)]==='error'&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1c5)+_0x1dc48c[_0x14e8d9(0x1aa)]+_0x14e8d9(0x1bb)+_0x1dc48c[_0x14e8d9(0x1f0)]));}for(const _0x4be18b of _0x490c7d['knowledgeBases']){_0x4be18b[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x209)+_0x4be18b['name']+_0x14e8d9(0x1bb)+_0x4be18b['error']));}for(const _0x339eba of _0x490c7d[_0x14e8d9(0x1f6)]){_0x339eba[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console['log'](a4_0x2eb76c[_0x14e8d9(0x179)]('\x20\x20Prompt\x20\x22'+_0x339eba[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x339eba[_0x14e8d9(0x1f0)]));}for(const _0xf77c79 of _0x490c7d['integrations']){_0xf77c79[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)]('\x20\x20Integration\x20\x22'+_0xf77c79[_0x14e8d9(0x210)]+'\x22:\x20'+_0xf77c79[_0x14e8d9(0x1f0)]));}for(const _0x37a53d of _0x490c7d['formInterfaces']){_0x37a53d[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c['red'](_0x14e8d9(0x1ed)+_0x37a53d[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x37a53d[_0x14e8d9(0x1f0)]));}for(const _0x2ebb90 of _0x490c7d['chatInterfaces']){_0x2ebb90[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1c3)+_0x2ebb90[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x2ebb90[_0x14e8d9(0x1f0)]));}for(const _0x5a94d7 of _0x490c7d['experimentalKnowledgeBases']){_0x5a94d7[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c['red'](_0x14e8d9(0x18f)+_0x5a94d7[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x5a94d7[_0x14e8d9(0x1f0)]));}for(const _0x581098 of _0x490c7d[_0x14e8d9(0x1c1)]){_0x581098[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console['log'](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1ea)+_0x581098['name']+'\x22:\x20'+_0x581098[_0x14e8d9(0x1f0)]));}return 0x1;}console[_0x14e8d9(0x199)]();const _0x3192dc=getLLMProjectUrl(_0x42e367,_0x490c7d[_0x14e8d9(0x1df)]);return console[_0x14e8d9(0x199)](_0x14e8d9(0x1de)+a4_0x2eb76c[_0x14e8d9(0x19a)](_0x3192dc)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x548581(0x210)]='agent:push';[a4_0x548581(0x187)]=a4_0x548581(0x1dd);async['execute'](_0x4870e0){const _0x295e53=a4_0x548581,{options:_0x5a50b1,args:_0x167776,tdx:_0x55f3c1}=_0x4870e0;let _0x33412b=_0x167776[0x0]||process[_0x295e53(0x214)]();const _0x1da88d=_0x5a50b1['dryRun'],_0x33fa42=_0x5a50b1['force'],_0x598892=_0x5a50b1['yes'],_0x1fd251=_0x5a50b1[_0x295e53(0x18e)],_0x31e7c1=a4_0x2853a9['join'](_0x33412b,'agent.yml'),_0x27abdd=existsSync(_0x31e7c1);if(_0x27abdd){const {data:_0x9f7f9b}=await withSpinner(_0x295e53(0x1e9)+_0x33412b+_0x295e53(0x1fd),()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f4)](_0x33412b,{'dryRun':_0x1da88d,'force':_0x33fa42}));if(_0x1da88d)return console[_0x295e53(0x199)](a4_0x2eb76c['yellow'](_0x295e53(0x1c6))),console[_0x295e53(0x199)](_0x295e53(0x17f)+_0x9f7f9b[_0x295e53(0x1aa)]),0x0;if(_0x9f7f9b['action']===_0x295e53(0x1f0))return console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x212)+_0x9f7f9b[_0x295e53(0x1f0)])),0x1;console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x163)+_0x9f7f9b[_0x295e53(0x169)]+'\x20successfully')),console[_0x295e53(0x199)]('Agent:\x20'+_0x9f7f9b[_0x295e53(0x1aa)]);if(_0x9f7f9b[_0x295e53(0x1b9)]&&_0x9f7f9b[_0x295e53(0x160)]){const _0x52c08b=getLLMAgentChatUrl(_0x1fd251,_0x9f7f9b[_0x295e53(0x160)],_0x9f7f9b[_0x295e53(0x1b9)]);console[_0x295e53(0x199)]('Chat:\x20'+a4_0x2eb76c['cyan'](_0x52c08b));}return 0x0;}const _0x4249bb=_0x5a50b1[_0x295e53(0x1a0)],_0xbbe47e=resolveProjectFromContext(_0x33412b,_0x4249bb);if(_0xbbe47e['found'])_0x33412b=_0xbbe47e['projectDir'],_0xbbe47e[_0x295e53(0x1a9)]===_0x295e53(0x1a6)&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x186)](_0x295e53(0x1d5)+_0x33412b));else{let _0xc60d79=_0x295e53(0x1ff);_0xbbe47e[_0x295e53(0x1bf)]===_0x295e53(0x1fc)&&(_0xc60d79=_0xbbe47e[_0x295e53(0x16c)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xbbe47e[_0x295e53(0x1a0)]+_0x295e53(0x1e4));throw new SDKError(ErrorCode[_0x295e53(0x1ab)],_0xbbe47e[_0x295e53(0x1bf)]===_0x295e53(0x18d)?_0xbbe47e[_0x295e53(0x16c)]:_0x295e53(0x19f)+_0x33412b,undefined,{'helpText':_0xc60d79});}const {data:_0xcfb7d3}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f2)](_0x33412b,{'dryRun':!![]})),_0x46de5d=_0xcfb7d3['counts']['agents'][_0x295e53(0x188)]>0x0;if(_0x46de5d){console['log'](a4_0x2eb76c['red'](_0x295e53(0x215)));for(const _0x535657 of _0xcfb7d3[_0x295e53(0x164)]){_0x535657['action']===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c['red']('\x20\x20Agent\x20\x22'+_0x535657['agentName']+_0x295e53(0x1bb)+_0x535657[_0x295e53(0x1f0)]));}return 0x1;}const _0x271cf7=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1c0)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)]['textKnowledgeBases'][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1f6)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1f3)]['created']+_0xcfb7d3['counts']['experimentalArtifacts'][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x211)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x1bd)],_0x2aaf81=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)]['updated']+_0xcfb7d3['counts'][_0x295e53(0x1c0)]['updated']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)][_0x295e53(0x1a2)]+_0xcfb7d3[_0x295e53(0x172)]['prompts']['updated']+_0xcfb7d3[_0x295e53(0x172)]['integrations'][_0x295e53(0x1a2)]+_0xcfb7d3['counts'][_0x295e53(0x1f3)]['updated']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)][_0x295e53(0x1a2)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)]['updated']+_0xcfb7d3['counts']['chatInterfaces'][_0x295e53(0x1a2)],_0x5d4268=_0xcfb7d3['counts'][_0x295e53(0x164)]['unchanged']+_0xcfb7d3['counts'][_0x295e53(0x1c0)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f6)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)]['unchanged']+_0xcfb7d3[_0x295e53(0x172)]['experimentalKnowledgeBases'][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)]['experimentalArtifacts'][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)]['unchanged']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x189)];console['log'](_0x295e53(0x175)+_0xcfb7d3[_0x295e53(0x19e)]+'\x27:'),console[_0x295e53(0x199)]('\x20\x20'+a4_0x2eb76c[_0x295e53(0x1e5)]('+\x20'+_0x271cf7+'\x20new')+_0x295e53(0x17e)+a4_0x2eb76c[_0x295e53(0x1d8)]('~\x20'+_0x2aaf81+_0x295e53(0x162))+_0x295e53(0x17e)+a4_0x2eb76c[_0x295e53(0x186)]('=\x20'+_0x5d4268+_0x295e53(0x1cb))),console[_0x295e53(0x199)](_0x295e53(0x166)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)])),console[_0x295e53(0x199)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c0)])),console[_0x295e53(0x199)](_0x295e53(0x201)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)])),console[_0x295e53(0x199)](_0x295e53(0x192)+formatCountSummary(_0xcfb7d3['counts'][_0x295e53(0x1f6)])),console['log'](_0x295e53(0x176)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)])),console[_0x295e53(0x199)](_0x295e53(0x182)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)])),console[_0x295e53(0x199)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0xcfb7d3['counts'][_0x295e53(0x1db)]));const _0x498de6=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f3)][_0x295e53(0x1bd)]>0x0||_0xcfb7d3[_0x295e53(0x172)]['experimentalKnowledgeBases']['updated']>0x0||_0xcfb7d3['counts'][_0x295e53(0x1f3)][_0x295e53(0x189)]>0x0||_0xcfb7d3['counts'][_0x295e53(0x1c1)][_0x295e53(0x1bd)]>0x0||_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)][_0x295e53(0x1a2)]>0x0||_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)]['unchanged']>0x0;_0x498de6&&(console[_0x295e53(0x199)](_0x295e53(0x19d)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f3)])),console[_0x295e53(0x199)](_0x295e53(0x1f8)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)]['experimentalArtifacts'])));console[_0x295e53(0x199)](_0x295e53(0x1e2)+a4_0x2eb76c['cyan'](_0x33412b)),displayDiffs(_0xcfb7d3[_0x295e53(0x164)],_0xcfb7d3[_0x295e53(0x1c0)],_0xcfb7d3[_0x295e53(0x185)],_0xcfb7d3[_0x295e53(0x1f6)],_0xcfb7d3[_0x295e53(0x195)],_0xcfb7d3[_0x295e53(0x1f3)],_0xcfb7d3['experimentalArtifacts'],_0xcfb7d3[_0x295e53(0x211)],_0xcfb7d3[_0x295e53(0x1db)]);if(_0x1da88d)return console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1d8)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x271cf7===0x0&&_0x2aaf81===0x0){console['log'](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x16f)));const _0x5b98b3=getLLMProjectUrl(_0x1fd251,_0xcfb7d3[_0x295e53(0x160)]);return console[_0x295e53(0x199)](_0x295e53(0x1de)+a4_0x2eb76c[_0x295e53(0x19a)](_0x5b98b3)),0x0;}if(!_0x598892&&!_0x33fa42){if(!isInteractive())return console['error'](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x170)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x295e53(0x1f0)](a4_0x2eb76c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x46b959=await confirmKey(_0x295e53(0x196)+(_0x271cf7+_0x2aaf81)+_0x295e53(0x178));if(!_0x46b959)return console[_0x295e53(0x199)](a4_0x2eb76c['yellow'](_0x295e53(0x16a)),_0x295e53(0x1f1)),0x1;}const {data:_0x4b3528}=await withSpinner(_0x295e53(0x20b),()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f2)](_0x33412b,{'force':_0x33fa42})),_0x505d49=_0x4b3528[_0x295e53(0x172)][_0x295e53(0x164)]['errors']>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x1c0)][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)]['textKnowledgeBases'][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)]['prompts']['errors']>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x211)][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x188)]>0x0;if(_0x505d49){console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1d8)](_0x295e53(0x1af))),console[_0x295e53(0x199)](),console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1ca)));for(const _0x13e171 of _0x4b3528[_0x295e53(0x164)]){_0x13e171['action']===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c['red'](_0x295e53(0x1c5)+_0x13e171[_0x295e53(0x1aa)]+_0x295e53(0x1bb)+_0x13e171['error']));}for(const _0x14ef0c of _0x4b3528[_0x295e53(0x1c0)]){_0x14ef0c[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c['red'](_0x295e53(0x209)+_0x14ef0c[_0x295e53(0x210)]+'\x22:\x20'+_0x14ef0c[_0x295e53(0x1f0)]));}for(const _0x34b265 of _0x4b3528[_0x295e53(0x185)]){_0x34b265['action']===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1be)+_0x34b265[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x34b265[_0x295e53(0x1f0)]));}for(const _0x5af133 of _0x4b3528[_0x295e53(0x1f6)]){_0x5af133[_0x295e53(0x169)]==='error'&&console['log'](a4_0x2eb76c['red'](_0x295e53(0x20e)+_0x5af133['name']+_0x295e53(0x1bb)+_0x5af133[_0x295e53(0x1f0)]));}for(const _0xf86436 of _0x4b3528[_0x295e53(0x195)]){_0xf86436[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)]('\x20\x20Integration\x20\x22'+_0xf86436[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0xf86436[_0x295e53(0x1f0)]));}for(const _0x3eae41 of _0x4b3528['formInterfaces']){_0x3eae41[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c['red']('\x20\x20Form\x20Interface\x20\x22'+_0x3eae41[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x3eae41[_0x295e53(0x1f0)]));}for(const _0x58441d of _0x4b3528[_0x295e53(0x1db)]){_0x58441d['action']==='error'&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1c3)+_0x58441d[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x58441d[_0x295e53(0x1f0)]));}return 0x1;}console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x183)+(_0x271cf7+_0x2aaf81)+_0x295e53(0x1c8)+_0x4b3528['projectName']+'\x27'));const _0x3505ba=getLLMProjectUrl(_0x1fd251,_0x4b3528[_0x295e53(0x160)]);return console[_0x295e53(0x199)](_0x295e53(0x1de)+a4_0x2eb76c[_0x295e53(0x19a)](_0x3505ba)),0x0;}}
|
|
1
|
+
function a4_0x16f2(_0x30832d,_0x380ce9){_0x30832d=_0x30832d-0x7b;const _0x13a8bf=a4_0x13a8();let _0x16f243=_0x13a8bf[_0x30832d];return _0x16f243;}const a4_0x3622c6=a4_0x16f2;(function(_0x49c9d6,_0x5a0e36){const _0x23db02=a4_0x16f2,_0x476db6=_0x49c9d6();while(!![]){try{const _0x58fd96=parseInt(_0x23db02(0xa7))/0x1*(-parseInt(_0x23db02(0xbe))/0x2)+-parseInt(_0x23db02(0x9c))/0x3+-parseInt(_0x23db02(0xdf))/0x4+-parseInt(_0x23db02(0xfe))/0x5*(parseInt(_0x23db02(0x7c))/0x6)+parseInt(_0x23db02(0xe7))/0x7+parseInt(_0x23db02(0xf8))/0x8+parseInt(_0x23db02(0xdd))/0x9*(parseInt(_0x23db02(0x92))/0xa);if(_0x58fd96===_0x5a0e36)break;else _0x476db6['push'](_0x476db6['shift']());}catch(_0x1c2029){_0x476db6['push'](_0x476db6['shift']());}}}(a4_0x13a8,0x7aaa8));import a4_0x2632f5 from'chalk';import a4_0x102520 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x13a8(){const _0x53e74e=['\x20\x20Source:\x20','agentName','Analyzing\x20project\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','push','yes','\x20errors','Would\x20push\x20agent:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','green','no_context','\x20|\x20','prompts','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','<new-name>','cwd-config','Dry\x20run\x20-\x20no\x20files\x20written','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Knowledge\x20Bases:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20resources?','pushAgent','gray','Using\x20project\x20from\x20','agents','Pulling\x20agent\x20\x22','log','projectDir','counts','\x0aWrite\x20','total','\x20\x20Chat\x20Interfaces:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Prompt\x20\x22','\x20\x20Form\x20Interfaces:\x20','formInterfaces','projectId','2342094qFTpZG','\x20--name\x20','\x20\x20Integration\x20\x22','tdx.json','\x20total','dirname','agent:pull','Pushing\x20to\x20project...','updated','Project:\x20','Using\x20local\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20files\x20to\x20','\x0aPull\x20summary\x20for\x20\x27','created','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)','sourceProjectName','llm','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20updated','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','16987970HoAFZT','isNew','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','knowledgeBases','Using\x20project:\x20','agent:clone','Dry\x20run\x20-\x20no\x20changes\x20made','Would\x20clone:','force','2285052lGTMUf','Agent\x20','\x20\x20Experimental\x20Artifacts:\x20','action','\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)','\x20\x20Agents:\x20','New\x20project\x20ID:\x20','context','-\x20no\x20files\x20written','\x20\x20Integrations:\x20','llmProject','198LrTLmk','\x0aPush\x20summary\x20for\x20\x27','no_local_folder','newProjectId','Cancelled','cwd','Output\x20path:\x20','Cloning\x20\x22','\x20changed','\x20\x20Prompts:\x20','projectName','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','description','Source:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Experimental\x20Artifact\x20\x22','yellow','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','new','unchanged','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','dim','Project\x20cloned\x20with\x20errors','5668VEpTzF','experimentalArtifacts','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','pullAgent','Using\x20context\x20project:\x20','cyan','session','Chat:\x20','\x20=\x20','\x20\x20Form\x20Interface\x20\x22','\x22...','\x22\x20from\x20project\x20\x22','chatInterfaces','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','join','error','\x20\x20Chat\x20Interface\x20\x22','found','Writing\x20files...','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','diff','output','textKnowledgeBases','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20successfully','reason','pullProject','\x20unchanged','errors','agent.yml','\x0aChanges\x20to\x20prompt\x20\x27','9pmZSFi','Using\x20project\x20from\x20context:\x20','2527644IGTeQO','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Using\x20current\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','Output:\x20','Clone\x20\x22','agentId','New\x20project:\x20','3855705tzsXtt','\x22:\x20','cloneProject','pushProject','red','-\x20nothing\x20pushed','\x22\x20to\x20a\x20different\x20profile','✔\x20Context\x20set:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','parse','llm_project','\x0aChanges\x20to\x20integration\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Text\x20Knowledge\x20Bases:\x20','integrations','\x20\x20Agent\x20\x22','7906024XHlAiB','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Summary:','\x0aErrors\x20found:','experimentalKnowledgeBases','10WsAwHU','\x0aProject\x20pushed\x20with\x20errors','\x0aPush\x20','execute','\x20new','outputPath','utf-8','source','hasChanges','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','name','\x20created','dryRun','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Agent\x20pulled\x20successfully','repeat','\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','site','INVALID_ARGUMENT','\x20resources\x20to\x20\x27'];a4_0x13a8=function(){return _0x53e74e;};return a4_0x13a8();}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(_0xb421e0){const _0x46483c=a4_0x16f2,_0x23a270=[];if(_0xb421e0['total']!==undefined)_0x23a270['push'](_0xb421e0['total']+_0x46483c(0x80));if(_0xb421e0[_0x46483c(0xb9)]!==undefined&&_0xb421e0[_0x46483c(0xb9)]>0x0)_0x23a270['push'](a4_0x2632f5[_0x46483c(0x11d)](_0xb421e0[_0x46483c(0xb9)]+'\x20new'));if(_0xb421e0['created']!==undefined&&_0xb421e0['created']>0x0)_0x23a270['push'](a4_0x2632f5['green'](_0xb421e0[_0x46483c(0x8b)]+_0x46483c(0x10b)));if(_0xb421e0['updated']!==undefined&&_0xb421e0[_0x46483c(0x84)]>0x0)_0x23a270[_0x46483c(0x118)](a4_0x2632f5[_0x46483c(0xb7)](_0xb421e0[_0x46483c(0x84)]+_0x46483c(0x90)));if(_0xb421e0[_0x46483c(0xba)]!==undefined&&_0xb421e0[_0x46483c(0xba)]>0x0)_0x23a270['push'](a4_0x2632f5[_0x46483c(0x12a)](_0xb421e0[_0x46483c(0xba)]+'\x20unchanged'));if(_0xb421e0[_0x46483c(0xda)]!==undefined&&_0xb421e0[_0x46483c(0xda)]>0x0)_0x23a270['push'](a4_0x2632f5[_0x46483c(0xeb)](_0xb421e0[_0x46483c(0xda)]+_0x46483c(0x11a)));return _0x23a270[_0x46483c(0xcc)](',\x20');}function displayDiffs(_0x5167c6,_0x33a730,_0x986fb7,_0x578887,_0x195978,_0x5dbae9,_0x48fc96,_0x239f00,_0x195720){const _0x218eab=a4_0x16f2;for(const _0xa310af of _0x5167c6){if(_0xa310af[_0x218eab(0xd2)]){const _0x3601ee=_0xa310af['agentName']||_0xa310af[_0x218eab(0x10a)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x3601ee+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0xa310af[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'['repeat'](0x3c));}}for(const _0x55b9bc of _0x33a730){_0x55b9bc[_0x218eab(0xd2)]&&(console['log'](_0x218eab(0x109)+_0x55b9bc['name']+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x55b9bc['diff']),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)));}for(const _0x1b9dab of _0x986fb7){_0x1b9dab[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x1b9dab[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console['log'](_0x1b9dab[_0x218eab(0xd2)]),console['log']('─'['repeat'](0x3c)));}for(const _0xd75a7f of _0x578887){_0xd75a7f['diff']&&(console['log'](_0x218eab(0xdc)+_0xd75a7f[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)),console['log'](_0xd75a7f[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}for(const _0x2dfa36 of _0x195978){_0x2dfa36['diff']&&(console['log'](_0x218eab(0xf2)+_0x2dfa36[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x2dfa36[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}for(const _0x375694 of _0x5dbae9){_0x375694[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)](_0x218eab(0x134)+_0x375694[_0x218eab(0x10a)]+'\x27:'),console['log']('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x375694[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)));}for(const _0x48d76a of _0x48fc96){_0x48d76a[_0x218eab(0xd2)]&&(console['log'](_0x218eab(0x121)+_0x48d76a[_0x218eab(0x10a)]+'\x27:'),console['log']('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x48d76a[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}for(const _0x35d4e8 of _0x239f00){_0x35d4e8[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x35d4e8[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x35d4e8['diff']),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)));}for(const _0x273b2a of _0x195720){_0x273b2a[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x273b2a[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x273b2a['diff']),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3622c6(0x10a)]=a4_0x3622c6(0x82);[a4_0x3622c6(0xb3)]=a4_0x3622c6(0xef);async[a4_0x3622c6(0x101)](_0x250714){const _0x3c36bb=a4_0x3622c6,{options:_0x272b00,args:_0x586616,tdx:_0x38a973}=_0x250714,_0x1b33fb=_0x586616[0x0],_0x266330=_0x586616[0x1],_0xc21a4b=_0x272b00[_0x3c36bb(0xd3)],_0x5be9b4=_0x272b00['dryRun'],_0x21a47c=_0x272b00['force'],_0x323aee=_0x272b00['yes'],_0x1a0c2f=_0x272b00[_0x3c36bb(0xa6)],_0x72426b=_0x272b00['agent'];let _0xa4cf2b;if(_0x1b33fb){const _0x271415=a4_0x102520[_0x3c36bb(0xcc)](_0x1b33fb,_0x3c36bb(0x7f));if(existsSync(_0x271415))try{const _0x1a74bc=JSON[_0x3c36bb(0xf0)](readFileSync(_0x271415,_0x3c36bb(0x104)));_0x1a74bc[_0x3c36bb(0xf1)]&&(_0xa4cf2b={'llm_project':_0x1a74bc[_0x3c36bb(0xf1)]});}catch{}}const _0x459440=findAgentConfigPath(process['cwd']());let _0x2e396a;if(_0x459440)try{const _0x2ea2cf=JSON[_0x3c36bb(0xf0)](readFileSync(_0x459440,_0x3c36bb(0x104)));_0x2ea2cf[_0x3c36bb(0xf1)]&&(_0x2e396a={'llm_project':_0x2ea2cf[_0x3c36bb(0xf1)]});}catch{}const _0x1ba540=resolveAgentPullArgs({'arg':_0x1b33fb,'agentNameArg':_0x266330,'agentFlag':_0x72426b,'contextProject':_0x1a0c2f,'argDirConfig':_0xa4cf2b,'cwdConfigPath':_0x459440||undefined,'cwdConfig':_0x2e396a}),{projectNameOrId:_0x4ff38f,targetAgentName:_0x1ba9e4,existingOutputDir:_0x26b75b,source:_0x19b25b}=_0x1ba540;if(_0x19b25b==='arg-dir')console['log'](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0x12b)+a4_0x102520['join'](_0x1b33fb,_0x3c36bb(0x7f))+':\x20'+_0x4ff38f));else{if(_0x19b25b===_0x3c36bb(0x123))console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0x97)+_0x4ff38f));else _0x19b25b===_0x3c36bb(0xa3)&&console['log'](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0xde)+_0x4ff38f));}if(!_0x4ff38f)return _0x72426b?(console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0xb7)](_0x3c36bb(0x8f))),console[_0x3c36bb(0x12e)](_0x3c36bb(0x87)),console[_0x3c36bb(0x12e)](_0x3c36bb(0xb2))):(console[_0x3c36bb(0x12e)](a4_0x2632f5['yellow'](_0x3c36bb(0xc0))),console[_0x3c36bb(0x12e)](_0x3c36bb(0x8c)),console['log'](_0x3c36bb(0xf9)),console['log'](_0x3c36bb(0xcb)),console[_0x3c36bb(0x12e)](_0x3c36bb(0x108)),console[_0x3c36bb(0x12e)](_0x3c36bb(0x110))),0x1;if(_0x1ba9e4){const {data:_0x2f5ca8}=await withSpinner(_0x3c36bb(0x12d)+_0x1ba9e4+_0x3c36bb(0xc9)+_0x4ff38f+_0x3c36bb(0xc8),()=>_0x38a973[_0x3c36bb(0x8e)][_0x3c36bb(0xc1)](_0x4ff38f,_0x1ba9e4,_0xc21a4b,{'dryRun':_0x5be9b4,'force':_0x21a47c}));if(_0x5be9b4)return console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0xb7)](_0x3c36bb(0x124))),console[_0x3c36bb(0x12e)]('Would\x20pull\x20agent:\x20'+_0x2f5ca8[_0x3c36bb(0x115)]),console['log'](_0x3c36bb(0xad)+_0x2f5ca8[_0x3c36bb(0x103)]),_0x2f5ca8[_0x3c36bb(0xd2)]&&(console[_0x3c36bb(0x12e)]('\x0aChanges:'),console[_0x3c36bb(0x12e)]('─'['repeat'](0x3c)),console[_0x3c36bb(0x12e)](_0x2f5ca8[_0x3c36bb(0xd2)]),console[_0x3c36bb(0x12e)]('─'[_0x3c36bb(0x10f)](0x3c))),0x0;return console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0x11d)](_0x3c36bb(0x10e))),console[_0x3c36bb(0x12e)]('Agent:\x20'+_0x2f5ca8['agentName']),console[_0x3c36bb(0x12e)](_0x3c36bb(0xe3)+_0x2f5ca8[_0x3c36bb(0x103)]),console['log']('Status:\x20'+(_0x2f5ca8[_0x3c36bb(0x93)]?a4_0x2632f5['green'](_0x3c36bb(0xb9)):_0x2f5ca8[_0x3c36bb(0x106)]?a4_0x2632f5[_0x3c36bb(0xb7)]('updated'):a4_0x2632f5[_0x3c36bb(0x12a)]('unchanged'))),0x0;}const _0x3736a2=_0x26b75b||_0xc21a4b,{data:_0x7b7d11}=await withSpinner(_0x3c36bb(0x116)+_0x4ff38f+'\x22...',()=>_0x38a973[_0x3c36bb(0x8e)][_0x3c36bb(0xd8)](_0x4ff38f,_0x3736a2,{'dryRun':!![]})),_0xfcbb29=_0x7b7d11['counts']['agents'][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)]['knowledgeBases'][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xd4)][_0x3c36bb(0xb9)]+_0x7b7d11['counts'][_0x3c36bb(0x120)][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)]['integrations'][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)]['new']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)][_0x3c36bb(0xb9)]+_0x7b7d11['counts'][_0x3c36bb(0x138)][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xca)][_0x3c36bb(0xb9)],_0x2760ff=_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x12c)]['updated']+_0x7b7d11['counts'][_0x3c36bb(0x96)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xd4)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x120)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xf6)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)]['experimentalKnowledgeBases'][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x138)][_0x3c36bb(0x84)]+_0x7b7d11['counts'][_0x3c36bb(0xca)][_0x3c36bb(0x84)],_0x44bac9=_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x12c)][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)]['knowledgeBases'][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)]['textKnowledgeBases'][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x120)]['unchanged']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xf6)]['unchanged']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)]['unchanged']+_0x7b7d11[_0x3c36bb(0x130)]['experimentalArtifacts']['unchanged']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x138)][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xca)][_0x3c36bb(0xba)];console[_0x3c36bb(0x12e)](_0x3c36bb(0x8a)+_0x7b7d11[_0x3c36bb(0xb1)]+'\x27:'),console['log']('\x20\x20'+a4_0x2632f5[_0x3c36bb(0x11d)]('+\x20'+_0xfcbb29+_0x3c36bb(0x102))+_0x3c36bb(0x11f)+a4_0x2632f5[_0x3c36bb(0xb7)]('~\x20'+_0x2760ff+_0x3c36bb(0xaf))+'\x20|\x20'+a4_0x2632f5[_0x3c36bb(0xbc)]('=\x20'+_0x44bac9+_0x3c36bb(0xd9))),console['log'](_0x3c36bb(0xa1)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x96)])),console[_0x3c36bb(0x12e)](_0x3c36bb(0xf5)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xd4)])),console['log'](_0x3c36bb(0xb0)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)]['prompts'])),console[_0x3c36bb(0x12e)](_0x3c36bb(0xa5)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xf6)])),console[_0x3c36bb(0x12e)](_0x3c36bb(0x137)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x138)])),console['log'](_0x3c36bb(0x133)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xca)]));const _0x4f09d9=_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)][_0x3c36bb(0x132)]>0x0||_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)][_0x3c36bb(0x132)]>0x0;_0x4f09d9&&(console[_0x3c36bb(0x12e)](_0x3c36bb(0x117)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)])),console[_0x3c36bb(0x12e)](_0x3c36bb(0x9e)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)])));console[_0x3c36bb(0x12e)]('\x20\x20Target:\x20'+a4_0x2632f5[_0x3c36bb(0xc3)](_0x7b7d11['outputDir'])),displayDiffs(_0x7b7d11[_0x3c36bb(0x12c)],_0x7b7d11[_0x3c36bb(0x96)],_0x7b7d11[_0x3c36bb(0xd4)],_0x7b7d11[_0x3c36bb(0x120)],_0x7b7d11[_0x3c36bb(0xf6)],_0x7b7d11['experimentalKnowledgeBases'],_0x7b7d11[_0x3c36bb(0xbf)],_0x7b7d11[_0x3c36bb(0x138)],_0x7b7d11[_0x3c36bb(0xca)]);if(_0x5be9b4)return console['log'](a4_0x2632f5['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xfcbb29===0x0&&_0x2760ff===0x0)return console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0x11d)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x7b7d11['projectName']},_0x272b00['session']),console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0x11d)]('✔\x20Context\x20set:\x20'+a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0xf1))+_0x3c36bb(0xc6)+a4_0x2632f5[_0x3c36bb(0xc3)](_0x7b7d11[_0x3c36bb(0xb1)]))),0x0;if(!_0x323aee&&!_0x21a47c){if(!isInteractive())return console[_0x3c36bb(0xcd)](a4_0x2632f5[_0x3c36bb(0xeb)]('\x0aError:'),_0x3c36bb(0x88)),console['error'](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0x10d))),0x1;const _0x54baef=await confirmKey(_0x3c36bb(0x131)+(_0xfcbb29+_0x2760ff)+'\x20files?');if(!_0x54baef)return console['log'](a4_0x2632f5[_0x3c36bb(0xb7)](_0x3c36bb(0xab)),_0x3c36bb(0xa4)),0x1;}const {data:_0xacd207}=await withSpinner(_0x3c36bb(0xd0),()=>_0x38a973[_0x3c36bb(0x8e)][_0x3c36bb(0xd8)](_0x4ff38f,_0x3736a2,{'force':_0x21a47c}));return console['log'](a4_0x2632f5[_0x3c36bb(0x11d)]('\x0a✔\x20Pulled\x20'+(_0xfcbb29+_0x2760ff)+_0x3c36bb(0x89)+_0xacd207['outputDir'])),saveSessionContext({'llm_project':_0xacd207[_0x3c36bb(0xb1)]},_0x272b00[_0x3c36bb(0xc4)]),console['log'](a4_0x2632f5['green'](_0x3c36bb(0xee)+a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0xf1))+_0x3c36bb(0xc6)+a4_0x2632f5[_0x3c36bb(0xc3)](_0xacd207[_0x3c36bb(0xb1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3622c6(0x10a)]=a4_0x3622c6(0x98);[a4_0x3622c6(0xb3)]=a4_0x3622c6(0xb5);async[a4_0x3622c6(0x101)](_0xb732d6){const _0x3d8262=a4_0x3622c6,{options:_0x491cae,args:_0x16e563,tdx:_0x793fd6}=_0xb732d6,_0x4f17e6=_0x16e563[0x0],_0x267f04=_0x491cae[_0x3d8262(0x10a)],_0x1215a1=_0x491cae['dryRun'],_0x5b159a=_0x491cae[_0x3d8262(0x119)],_0x494d4f=_0x491cae[_0x3d8262(0x111)],_0x3159b3=_0x491cae[_0x3d8262(0xa6)];let _0x3b4011;const _0x48ff68=findAgentConfigPath(process['cwd']());if(_0x4f17e6){const _0xcc3dda=a4_0x102520[_0x3d8262(0xcc)](_0x4f17e6,_0x3d8262(0x7f));existsSync(_0xcc3dda)?(_0x3b4011=_0x4f17e6,console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xbc)](_0x3d8262(0x86)+_0x4f17e6))):_0x3b4011=_0x4f17e6;}else{if(_0x48ff68)_0x3b4011=a4_0x102520[_0x3d8262(0x81)](_0x48ff68),console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xbc)](_0x3d8262(0xe1)+_0x3b4011));else{if(_0x3159b3){const _0x53db84=sanitizeForFilesystem(_0x3159b3);let _0x122f2f=_0x53db84,_0x2cef65=a4_0x102520[_0x3d8262(0xcc)](process[_0x3d8262(0xac)](),_0x3d8262(0x12c),_0x53db84,_0x3d8262(0x7f));if(!existsSync(_0x2cef65)){const _0x2ce745=normalizeName(_0x3159b3),_0x159399=a4_0x102520[_0x3d8262(0xcc)](process[_0x3d8262(0xac)](),_0x3d8262(0x12c),_0x2ce745,_0x3d8262(0x7f));existsSync(_0x159399)&&(_0x122f2f=_0x2ce745,_0x2cef65=_0x159399);}if(existsSync(_0x2cef65))_0x3b4011=a4_0x102520[_0x3d8262(0x81)](_0x2cef65),console[_0x3d8262(0x12e)](a4_0x2632f5['dim'](_0x3d8262(0x86)+_0x3b4011));else{const _0x59ca17=_0x491cae['profile'];if(_0x59ca17)throw new SDKError(ErrorCode[_0x3d8262(0x112)],_0x3d8262(0x125)+_0x3159b3+_0x3d8262(0xed),undefined,{'helpText':_0x3d8262(0xd1)+_0x3d8262(0x11c)+(_0x3d8262(0x95)+_0x3159b3+'\x0a')+(_0x3d8262(0xd5)+_0x122f2f+_0x3d8262(0x7d)+(_0x267f04||_0x3d8262(0x122))+'\x20--profile\x20'+_0x59ca17)});_0x3b4011=_0x3159b3,console[_0x3d8262(0x12e)](a4_0x2632f5['dim'](_0x3d8262(0xc2)+_0x3159b3));}}}}if(!_0x3b4011)return console[_0x3d8262(0x12e)](a4_0x2632f5['yellow'](_0x3d8262(0xe0))),console[_0x3d8262(0x12e)](_0x3d8262(0xfa)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x3d8262(0x12e)](_0x3d8262(0xa0)),console['log'](_0x3d8262(0xf4)),0x1;if(!_0x267f04)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x3d8262(0xbb)});if(!_0x5b159a&&!_0x1215a1){if(!isInteractive())return console['error'](a4_0x2632f5[_0x3d8262(0xeb)]('\x0aError:'),_0x3d8262(0x88)),console['error'](a4_0x2632f5['dim'](_0x3d8262(0x10d))),0x1;const _0x5a5ed8=await confirmKey(_0x3d8262(0xe4)+_0x3b4011+'\x22\x20to\x20new\x20project\x20\x22'+_0x267f04+'\x22?');if(!_0x5a5ed8)return console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xb7)](_0x3d8262(0xab))),0x1;}const {data:_0x1d490b}=await withSpinner(_0x3d8262(0xae)+_0x3b4011+'\x22\x20to\x20\x22'+_0x267f04+_0x3d8262(0xc8),()=>_0x793fd6[_0x3d8262(0x8e)][_0x3d8262(0xe9)](_0x3b4011,_0x267f04,{'dryRun':_0x1215a1}));if(_0x1215a1){console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xb7)](_0x3d8262(0x99))),console[_0x3d8262(0x12e)]('Source:\x20'+_0x1d490b['sourceProjectName']),console[_0x3d8262(0x12e)](_0x3d8262(0xe6)+_0x267f04),console[_0x3d8262(0x12e)](_0x3d8262(0x9a)),console[_0x3d8262(0x12e)](_0x3d8262(0xa1)+_0x1d490b['counts'][_0x3d8262(0x12c)][_0x3d8262(0x8b)]),console[_0x3d8262(0x12e)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x96)][_0x3d8262(0x8b)]),console[_0x3d8262(0x12e)](_0x3d8262(0xb0)+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x120)]['created']),console[_0x3d8262(0x12e)](_0x3d8262(0x137)+_0x1d490b['counts'][_0x3d8262(0x138)][_0x3d8262(0x8b)]),console['log'](_0x3d8262(0x133)+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xca)][_0x3d8262(0x8b)]);const _0x1a9605=_0x1d490b[_0x3d8262(0x130)]['experimentalKnowledgeBases']['created']>0x0||_0x1d490b['counts'][_0x3d8262(0xbf)][_0x3d8262(0x8b)]>0x0;return _0x1a9605&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)][_0x3d8262(0x8b)]),console['log'](_0x3d8262(0x9e)+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xbf)][_0x3d8262(0x8b)])),0x0;}const _0x1b2501=_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x12c)][_0x3d8262(0xda)]>0x0||_0x1d490b[_0x3d8262(0x130)]['knowledgeBases']['errors']>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x120)][_0x3d8262(0xda)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x138)][_0x3d8262(0xda)]>0x0||_0x1d490b[_0x3d8262(0x130)]['chatInterfaces']['errors']>0x0||_0x1d490b['counts'][_0x3d8262(0xfd)][_0x3d8262(0xda)]>0x0||_0x1d490b['counts'][_0x3d8262(0xbf)][_0x3d8262(0xda)]>0x0;_0x1b2501?console['log'](a4_0x2632f5['yellow'](_0x3d8262(0xbd))):console['log'](a4_0x2632f5[_0x3d8262(0x11d)]('Project\x20cloned\x20successfully'));console[_0x3d8262(0x12e)](_0x3d8262(0xb4)+_0x1d490b[_0x3d8262(0x8d)]),console[_0x3d8262(0x12e)]('New\x20project:\x20'+_0x1d490b['newProjectName']),console[_0x3d8262(0x12e)](_0x3d8262(0xa2)+_0x1d490b[_0x3d8262(0xaa)]),console[_0x3d8262(0x12e)](),console['log'](_0x3d8262(0xfb)),console[_0x3d8262(0x12e)](_0x3d8262(0xa1)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)]['agents'])),console[_0x3d8262(0x12e)](_0x3d8262(0x126)+formatCountSummary(_0x1d490b['counts'][_0x3d8262(0x96)])),console[_0x3d8262(0x12e)](_0x3d8262(0xb0)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x120)])),console[_0x3d8262(0x12e)](_0x3d8262(0xa5)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xf6)])),console[_0x3d8262(0x12e)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1d490b['counts'][_0x3d8262(0x138)])),console[_0x3d8262(0x12e)](_0x3d8262(0x133)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xca)]));const _0x5d9ccd=_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)][_0x3d8262(0x8b)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)][_0x3d8262(0x84)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)]['unchanged']>0x0||_0x1d490b['counts'][_0x3d8262(0xbf)][_0x3d8262(0x8b)]>0x0||_0x1d490b[_0x3d8262(0x130)]['experimentalArtifacts'][_0x3d8262(0x84)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xbf)][_0x3d8262(0xba)]>0x0;_0x5d9ccd&&(console['log'](_0x3d8262(0x117)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)])),console[_0x3d8262(0x12e)](_0x3d8262(0x9e)+formatCountSummary(_0x1d490b['counts'][_0x3d8262(0xbf)])));if(_0x1b2501){console['log'](),console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)]('Errors:'));for(const _0x276147 of _0x1d490b[_0x3d8262(0x12c)]){_0x276147[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5['red'](_0x3d8262(0xf7)+_0x276147[_0x3d8262(0x115)]+_0x3d8262(0xe8)+_0x276147[_0x3d8262(0xcd)]));}for(const _0x4f0e27 of _0x1d490b[_0x3d8262(0x96)]){_0x4f0e27[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4f0e27[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x4f0e27['error']));}for(const _0x13ed7f of _0x1d490b[_0x3d8262(0x120)]){_0x13ed7f[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0x136)+_0x13ed7f[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x13ed7f[_0x3d8262(0xcd)]));}for(const _0x51ca08 of _0x1d490b['integrations']){_0x51ca08[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)]('\x20\x20Integration\x20\x22'+_0x51ca08[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x51ca08['error']));}for(const _0x2971e0 of _0x1d490b['formInterfaces']){_0x2971e0[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0xc7)+_0x2971e0[_0x3d8262(0x10a)]+'\x22:\x20'+_0x2971e0['error']));}for(const _0x56089e of _0x1d490b[_0x3d8262(0xca)]){_0x56089e['action']===_0x3d8262(0xcd)&&console['log'](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0xce)+_0x56089e[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x56089e['error']));}for(const _0x3f02ae of _0x1d490b[_0x3d8262(0xfd)]){_0x3f02ae[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console['log'](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0x94)+_0x3f02ae[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x3f02ae['error']));}for(const _0x36b893 of _0x1d490b[_0x3d8262(0xbf)]){_0x36b893[_0x3d8262(0x9f)]==='error'&&console['log'](a4_0x2632f5['red'](_0x3d8262(0xb6)+_0x36b893[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x36b893[_0x3d8262(0xcd)]));}return 0x1;}console[_0x3d8262(0x12e)]();const _0x29add2=getLLMProjectUrl(_0x494d4f,_0x1d490b['newProjectId']);return console['log']('Project:\x20'+a4_0x2632f5[_0x3d8262(0xc3)](_0x29add2)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x3622c6(0xb3)]=a4_0x3622c6(0xb8);async['execute'](_0x32c95c){const _0x3f2c79=a4_0x3622c6,{options:_0x3a9c12,args:_0x28e090,tdx:_0xa2eef2}=_0x32c95c;let _0x18df78=_0x28e090[0x0]||process['cwd']();const _0x1feab5=_0x3a9c12[_0x3f2c79(0x10c)],_0x5dddd4=_0x3a9c12[_0x3f2c79(0x9b)],_0x2a47ac=_0x3a9c12['yes'],_0x4148a5=_0x3a9c12[_0x3f2c79(0x111)],_0x58682e=a4_0x102520[_0x3f2c79(0xcc)](_0x18df78,_0x3f2c79(0xdb)),_0x3501f1=existsSync(_0x58682e);if(_0x3501f1){const {data:_0x54bc1a}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x18df78+_0x3f2c79(0xc8),()=>_0xa2eef2[_0x3f2c79(0x8e)][_0x3f2c79(0x129)](_0x18df78,{'dryRun':_0x1feab5,'force':_0x5dddd4}));if(_0x1feab5)return console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0x99))),console[_0x3f2c79(0x12e)](_0x3f2c79(0x11b)+_0x54bc1a[_0x3f2c79(0x115)]),0x0;if(_0x54bc1a[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd))return console['log'](a4_0x2632f5[_0x3f2c79(0xeb)]('Failed\x20to\x20push\x20agent:\x20'+_0x54bc1a[_0x3f2c79(0xcd)])),0x1;console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0x11d)](_0x3f2c79(0x9d)+_0x54bc1a[_0x3f2c79(0x9f)]+_0x3f2c79(0xd6))),console[_0x3f2c79(0x12e)]('Agent:\x20'+_0x54bc1a[_0x3f2c79(0x115)]);if(_0x54bc1a[_0x3f2c79(0xe5)]&&_0x54bc1a[_0x3f2c79(0x7b)]){const _0x1ac72a=getLLMAgentChatUrl(_0x4148a5,_0x54bc1a[_0x3f2c79(0x7b)],_0x54bc1a[_0x3f2c79(0xe5)]);console[_0x3f2c79(0x12e)](_0x3f2c79(0xc5)+a4_0x2632f5['cyan'](_0x1ac72a));}return 0x0;}const _0x19ed12=_0x3a9c12[_0x3f2c79(0xa6)],_0x1ab3c4=resolveProjectFromContext(_0x18df78,_0x19ed12);if(_0x1ab3c4[_0x3f2c79(0xcf)])_0x18df78=_0x1ab3c4[_0x3f2c79(0x12f)],_0x1ab3c4[_0x3f2c79(0x105)]==='context'&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xbc)](_0x3f2c79(0x97)+_0x18df78));else{let _0x595b09='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x1ab3c4[_0x3f2c79(0xd7)]===_0x3f2c79(0xa9)&&(_0x595b09=_0x1ab3c4['message']+_0x3f2c79(0xf3)+_0x1ab3c4[_0x3f2c79(0xa6)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x3f2c79(0x112)],_0x1ab3c4[_0x3f2c79(0xd7)]===_0x3f2c79(0x11e)?_0x1ab3c4['message']:_0x3f2c79(0xe2)+_0x18df78,undefined,{'helpText':_0x595b09});}const {data:_0x1168f7}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xa2eef2['llm'][_0x3f2c79(0xea)](_0x18df78,{'dryRun':!![]})),_0x4e95f8=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x12c)][_0x3f2c79(0xda)]>0x0;if(_0x4e95f8){console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xfc)));for(const _0x59d281 of _0x1168f7[_0x3f2c79(0x12c)]){_0x59d281[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xf7)+_0x59d281['agentName']+'\x22:\x20'+_0x59d281[_0x3f2c79(0xcd)]));}return 0x1;}const _0x5d34df=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x12c)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x96)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xd4)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xf6)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x138)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xca)]['created'],_0x252d52=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x12c)]['updated']+_0x1168f7[_0x3f2c79(0x130)]['knowledgeBases'][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xd4)][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)]['updated']+_0x1168f7['counts'][_0x3f2c79(0xf6)]['updated']+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x138)]['updated']+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xca)][_0x3f2c79(0x84)],_0x1fff48=_0x1168f7['counts'][_0x3f2c79(0x12c)]['unchanged']+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x96)]['unchanged']+_0x1168f7['counts'][_0x3f2c79(0xd4)][_0x3f2c79(0xba)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)][_0x3f2c79(0xba)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xf6)][_0x3f2c79(0xba)]+_0x1168f7['counts'][_0x3f2c79(0xfd)][_0x3f2c79(0xba)]+_0x1168f7['counts'][_0x3f2c79(0xbf)][_0x3f2c79(0xba)]+_0x1168f7['counts'][_0x3f2c79(0x138)][_0x3f2c79(0xba)]+_0x1168f7[_0x3f2c79(0x130)]['chatInterfaces']['unchanged'];console[_0x3f2c79(0x12e)](_0x3f2c79(0xa8)+_0x1168f7['projectName']+'\x27:'),console[_0x3f2c79(0x12e)]('\x20\x20'+a4_0x2632f5['green']('+\x20'+_0x5d34df+_0x3f2c79(0x102))+'\x20|\x20'+a4_0x2632f5[_0x3f2c79(0xb7)]('~\x20'+_0x252d52+_0x3f2c79(0xaf))+_0x3f2c79(0x11f)+a4_0x2632f5[_0x3f2c79(0xbc)]('=\x20'+_0x1fff48+'\x20unchanged')),console[_0x3f2c79(0x12e)](_0x3f2c79(0xa1)+formatCountSummary(_0x1168f7['counts']['agents'])),console[_0x3f2c79(0x12e)](_0x3f2c79(0x126)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x96)])),console['log'](_0x3f2c79(0xf5)+formatCountSummary(_0x1168f7['counts']['textKnowledgeBases'])),console[_0x3f2c79(0x12e)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)])),console['log'](_0x3f2c79(0xa5)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)]['integrations'])),console[_0x3f2c79(0x12e)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1168f7['counts'][_0x3f2c79(0x138)])),console[_0x3f2c79(0x12e)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xca)]));const _0x17b9ed=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x8b)]>0x0||_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x84)]>0x0||_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0xba)]>0x0||_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)][_0x3f2c79(0x8b)]>0x0||_0x1168f7['counts'][_0x3f2c79(0xbf)][_0x3f2c79(0x84)]>0x0||_0x1168f7['counts'][_0x3f2c79(0xbf)][_0x3f2c79(0xba)]>0x0;_0x17b9ed&&(console[_0x3f2c79(0x12e)](_0x3f2c79(0x117)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)]['experimentalKnowledgeBases'])),console[_0x3f2c79(0x12e)](_0x3f2c79(0x9e)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)])));console[_0x3f2c79(0x12e)](_0x3f2c79(0x114)+a4_0x2632f5[_0x3f2c79(0xc3)](_0x18df78)),displayDiffs(_0x1168f7['agents'],_0x1168f7[_0x3f2c79(0x96)],_0x1168f7[_0x3f2c79(0xd4)],_0x1168f7['prompts'],_0x1168f7[_0x3f2c79(0xf6)],_0x1168f7[_0x3f2c79(0xfd)],_0x1168f7[_0x3f2c79(0xbf)],_0x1168f7[_0x3f2c79(0x138)],_0x1168f7[_0x3f2c79(0xca)]);if(_0x1feab5)return console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0x127))),0x0;if(_0x5d34df===0x0&&_0x252d52===0x0){console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0x11d)](_0x3f2c79(0x91)));const _0x1d431b=getLLMProjectUrl(_0x4148a5,_0x1168f7['projectId']);return console[_0x3f2c79(0x12e)](_0x3f2c79(0x85)+a4_0x2632f5[_0x3f2c79(0xc3)](_0x1d431b)),0x0;}if(!_0x2a47ac&&!_0x5dddd4){if(!isInteractive())return console[_0x3f2c79(0xcd)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0x107)),_0x3f2c79(0x88)),console[_0x3f2c79(0xcd)](a4_0x2632f5[_0x3f2c79(0xbc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15dc7d=await confirmKey(_0x3f2c79(0x100)+(_0x5d34df+_0x252d52)+_0x3f2c79(0x128));if(!_0x15dc7d)return console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0xab)),_0x3f2c79(0xec)),0x1;}const {data:_0x36c9bb}=await withSpinner(_0x3f2c79(0x83),()=>_0xa2eef2[_0x3f2c79(0x8e)][_0x3f2c79(0xea)](_0x18df78,{'force':_0x5dddd4})),_0x4165a6=_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0x12c)]['errors']>0x0||_0x36c9bb[_0x3f2c79(0x130)]['knowledgeBases']['errors']>0x0||_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0xd4)][_0x3f2c79(0xda)]>0x0||_0x36c9bb[_0x3f2c79(0x130)]['prompts'][_0x3f2c79(0xda)]>0x0||_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0x138)][_0x3f2c79(0xda)]>0x0||_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0xca)][_0x3f2c79(0xda)]>0x0;if(_0x4165a6){console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0xff))),console[_0x3f2c79(0x12e)](),console['log'](a4_0x2632f5[_0x3f2c79(0xeb)]('Errors:'));for(const _0x11abe6 of _0x36c9bb[_0x3f2c79(0x12c)]){_0x11abe6[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xf7)+_0x11abe6[_0x3f2c79(0x115)]+_0x3f2c79(0xe8)+_0x11abe6[_0x3f2c79(0xcd)]));}for(const _0x478f23 of _0x36c9bb['knowledgeBases']){_0x478f23[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x478f23[_0x3f2c79(0x10a)]+_0x3f2c79(0xe8)+_0x478f23[_0x3f2c79(0xcd)]));}for(const _0x55d057 of _0x36c9bb['textKnowledgeBases']){_0x55d057[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0x135)+_0x55d057[_0x3f2c79(0x10a)]+_0x3f2c79(0xe8)+_0x55d057[_0x3f2c79(0xcd)]));}for(const _0x13b287 of _0x36c9bb[_0x3f2c79(0x120)]){_0x13b287[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)]('\x20\x20Prompt\x20\x22'+_0x13b287['name']+_0x3f2c79(0xe8)+_0x13b287['error']));}for(const _0x4def40 of _0x36c9bb['integrations']){_0x4def40[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0x7e)+_0x4def40[_0x3f2c79(0x10a)]+'\x22:\x20'+_0x4def40[_0x3f2c79(0xcd)]));}for(const _0x4e59d0 of _0x36c9bb[_0x3f2c79(0x138)]){_0x4e59d0[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xc7)+_0x4e59d0['name']+'\x22:\x20'+_0x4e59d0['error']));}for(const _0xe8cbf9 of _0x36c9bb[_0x3f2c79(0xca)]){_0xe8cbf9['action']==='error'&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xce)+_0xe8cbf9['name']+_0x3f2c79(0xe8)+_0xe8cbf9[_0x3f2c79(0xcd)]));}return 0x1;}console['log'](a4_0x2632f5[_0x3f2c79(0x11d)]('\x0a✔\x20Pushed\x20'+(_0x5d34df+_0x252d52)+_0x3f2c79(0x113)+_0x36c9bb['projectName']+'\x27'));const _0x4d2717=getLLMProjectUrl(_0x4148a5,_0x36c9bb[_0x3f2c79(0x7b)]);return console[_0x3f2c79(0x12e)](_0x3f2c79(0x85)+a4_0x2632f5['cyan'](_0x4d2717)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x222562=a5_0x2373;(function(_0x194b83,_0x3eb3ee){const _0x1da68e=a5_0x2373,_0x4b29fc=_0x194b83();while(!![]){try{const _0x5b6080=-parseInt(_0x1da68e(0x172))/0x1*(parseInt(_0x1da68e(0x15e))/0x2)+-parseInt(_0x1da68e(0x12b))/0x3*(parseInt(_0x1da68e(0x18a))/0x4)+parseInt(_0x1da68e(0xf4))/0x5*(parseInt(_0x1da68e(0x139))/0x6)+parseInt(_0x1da68e(0x165))/0x7*(-parseInt(_0x1da68e(0x144))/0x8)+-parseInt(_0x1da68e(0x10e))/0x9+-parseInt(_0x1da68e(0x143))/0xa*(-parseInt(_0x1da68e(0x13a))/0xb)+parseInt(_0x1da68e(0x107))/0xc;if(_0x5b6080===_0x3eb3ee)break;else _0x4b29fc['push'](_0x4b29fc['shift']());}catch(_0x516284){_0x4b29fc['push'](_0x4b29fc['shift']());}}}(a5_0x2080,0xd78ca));import*as a5_0x15b21f from'node:fs';function a5_0x2080(){const _0x11fbdd=['\x20-\x20','jsonl','New\x20tests\x20to\x20execute:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Running\x20test:\x20','Running:\x20','\x20\x20-\x20','site','tags','context','✗\x20FAIL:\x20','resolve','verbose','join','\x20(cached)','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reeval','94026jNlMJI','size','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agentName','resolveAgentId','Test\x20Configuration:','repeat','add','tsv','PASS','includes','Duration:\x20','Conversation\x20URL:\x20','114gOUVKc','11IgHcQZ','message','✗\x20ERROR:\x20Project\x20not\x20found:\x20','llmProject','\x20\x20Conversation:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','found','/<agent-name>','source','3760810DfbDyD','325312zyNWjO','toISOString','Error:\x20No\x20previous\x20test\x20run\x20found.','writeFileSync','\x20\x20Project:\x20','executeReeval','no_tests','utf-8','red','description','status','Round\x20','rounds','agentDirs','ERROR','now','conversation_url','Usage:','isSpinning','conversations','Round\x201/','Agent:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Executing\x20new\x20tests...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','dim','1338094jiJsSc','name','projectDir','\x20\x20Evaluating...\x20','Project\x20path:\x20','timestamp','Re-evaluation\x20Summary','217SVqyVP','tests','Running\x20agent\x20tests...','...','some','execute','\x20\x20Site:\x20','green','stop','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','No\x20tests\x20found\x20with\x20tags:\x20','projectName','multiple_agents','1KVsinY','\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','\x22:\x20','split','...\x20','Either\x20switch\x20to\x20the\x20\x22','output','Re-evaluating\x20cached\x20test\x20run...','existsSync','table','agent:test','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','FAIL','has','Failed:\x20\x20\x20','Passed:\x20\x20\x20','reason','No\x20tests\x20have\x20tags\x20defined.','Test\x20','white','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','round','Failed\x20Tests:','Errors:\x20\x20\x20','164jqaYPn','Cached\x20run\x20from:\x20','forEach','Test\x20Summary','404','378470vAlcBk','log','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Total:\x20\x20\x20\x20','trim','json','✓\x20PASS:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20\x20Agent:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','no_context','\x20\x20Round\x20','cyan','start','push','toLowerCase','text','agent','35577180exMlPf','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','yellow','Error\x20writing\x20output\x20file:\x20','Re-evaluating...','✗\x20ERROR:\x20','map','6133401cQHIWa','Available\x20tests:\x20','length','no_local_folder','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','resolveProjectId',':\x20Sending\x20user\x20input...','llm','testName','filter','not\x20found'];a5_0x2080=function(){return _0x11fbdd;};return a5_0x2080();}import*as a5_0x3575f6 from'node:path';import a5_0x1bac87 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x2373(_0x456def,_0x13ce25){_0x456def=_0x456def-0xf4;const _0x208091=a5_0x2080();let _0x237381=_0x208091[_0x456def];return _0x237381;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x222562(0x15f)]=a5_0x222562(0x17c);[a5_0x222562(0x14d)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x222562(0x16a)](_0xfc7681){const _0x191717=a5_0x222562,{options:_0x2e1904,args:_0x2282fe,tdx:_0x338079}=_0xfc7681,_0x355578=_0x2282fe[0x0]||'.',_0x182584=_0x2e1904['dryRun'],_0x7006fc=_0x2e1904,_0x2351f1=_0x7006fc['eval']===![],_0x5b96fe=_0x7006fc[_0x191717(0x12a)],_0x12500a=_0x7006fc[_0x191717(0x15f)],_0x718b03=_0x7006fc[_0x191717(0x122)],_0x53ca69=_0x2e1904[_0x191717(0x121)],_0x946f4b=_0x7006fc[_0x191717(0x178)];if(_0x5b96fe&&_0x2351f1)return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2e0f27=_0x191717(0x17b);if(_0x7006fc[_0x191717(0xf9)])_0x2e0f27='json';else{if(_0x7006fc[_0x191717(0x11b)])_0x2e0f27=_0x191717(0x11b);else{if(_0x7006fc[_0x191717(0x134)])_0x2e0f27=_0x191717(0x134);else{if(_0x7006fc['table'])_0x2e0f27=_0x191717(0x17b);}}}const _0x49133c=_0x7006fc['llmProject'];let _0x10d656=_0x355578;const _0x537b07=a5_0x15b21f[_0x191717(0x17a)](_0x355578),_0x461b67=_0x355578==='.';if(!_0x537b07||_0x461b67){const _0x256792=resolveProjectFromContext(_0x355578,_0x49133c,{'requireFile':'test.yml'});if(_0x256792[_0x191717(0x140)])_0x10d656=_0x256792[_0x191717(0x160)],_0x256792[_0x191717(0x142)]===_0x191717(0x123)&&console['log'](a5_0x1bac87[_0x191717(0x15d)]('Using\x20agent:\x20'+_0x10d656));else switch(_0x256792['reason']){case _0x191717(0xff):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x256792['message'])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0x155)),console[_0x191717(0xf5)](_0x191717(0x173)),console[_0x191717(0xf5)](_0x191717(0x11d)),console['log'](),console['log']('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x191717(0x111):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x256792['message'])),console[_0x191717(0xf5)](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x256792[_0x191717(0x13d)]+_0x191717(0x15a));return 0x1;case _0x191717(0x171):{const _0xd9d497=a5_0x3575f6['basename'](_0x256792[_0x191717(0x160)]);console['log'](a5_0x1bac87[_0x191717(0x109)](_0x191717(0x17d)+_0x256792[_0x191717(0x13d)]+'\x22:'));for(const _0x19ec5c of _0x256792[_0x191717(0x151)]){console[_0x191717(0xf5)](_0x191717(0x120)+_0x19ec5c);}return console['log'](),console['log'](_0x191717(0x186)+_0xd9d497+_0x191717(0x141)),0x1;}case _0x191717(0x14a):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x191717(0xfe)+_0x256792[_0x191717(0x13d)]+'\x22.')),console[_0x191717(0xf5)](a5_0x1bac87['dim'](_0x191717(0x162)+_0x256792[_0x191717(0x160)])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0xf6));return 0x1;}}const {definition:_0x39719e,agentInfo:_0x5c94e1}=parseTestFile(_0x10d656);let _0x5e2016=_0x39719e[_0x191717(0x166)];if(_0x12500a){const _0x4a4aec=_0x12500a[_0x191717(0x175)](',')[_0x191717(0x10d)](_0x19a918=>_0x19a918[_0x191717(0xf8)]());_0x5e2016=_0x39719e[_0x191717(0x166)]['filter'](_0x817aa5=>_0x4a4aec['includes'](_0x817aa5['name']));if(_0x5e2016[_0x191717(0x110)]===0x0)return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)]('No\x20tests\x20found\x20matching:\x20'+_0x12500a)),console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x10f)+_0x39719e[_0x191717(0x166)][_0x191717(0x10d)](_0x1ddfe7=>_0x1ddfe7['name'])[_0x191717(0x127)](',\x20'))),0x1;}if(_0x718b03){const _0x5c2c6f=_0x718b03[_0x191717(0x175)](',')[_0x191717(0x10d)](_0x596a70=>_0x596a70['trim']()[_0x191717(0x104)]());_0x5e2016=_0x5e2016[_0x191717(0x118)](_0x509a01=>_0x509a01[_0x191717(0x122)]?.[_0x191717(0x169)](_0x3ba687=>_0x5c2c6f[_0x191717(0x136)](_0x3ba687[_0x191717(0x104)]())));if(_0x5e2016[_0x191717(0x110)]===0x0){console[_0x191717(0xf5)](a5_0x1bac87['yellow'](_0x191717(0x16f)+_0x718b03));const _0x2563c9=new Set();return _0x39719e['tests']['forEach'](_0x448c29=>_0x448c29[_0x191717(0x122)]?.[_0x191717(0x18c)](_0x24a1b7=>_0x2563c9[_0x191717(0x133)](_0x24a1b7))),_0x2563c9[_0x191717(0x12c)]>0x0?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)]('Available\x20tags:\x20'+[..._0x2563c9]['join'](',\x20'))):console['log'](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x183))),0x1;}}if(_0x5b96fe)return this[_0x191717(0x149)](_0xfc7681,{'definition':{'tests':_0x5e2016},'agentInfo':_0x5c94e1,'outputFormat':_0x2e0f27,'outputFile':_0x946f4b,'testNames':_0x12500a});if(_0x182584){console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x101)](_0x191717(0x131))),console[_0x191717(0xf5)](_0x191717(0x16b)+a5_0x1bac87[_0x191717(0x185)](_0x53ca69)),console['log'](_0x191717(0x148)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1[_0x191717(0x170)])),console[_0x191717(0xf5)](_0x191717(0xfc)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1['agentName'])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)]('Tests\x20found:\x20'+a5_0x1bac87[_0x191717(0x185)](_0x5e2016[_0x191717(0x110)]));for(let _0x28929e=0x0;_0x28929e<_0x5e2016[_0x191717(0x110)];_0x28929e++){const _0x3adfc4=_0x5e2016[_0x28929e],_0x5f3275=_0x3adfc4[_0x191717(0x150)][_0x191717(0x110)]===0x1?_0x191717(0x187):_0x191717(0x150),_0x362072=_0x3adfc4[_0x191717(0x122)]?.[_0x191717(0x110)]?'\x20['+_0x3adfc4[_0x191717(0x122)][_0x191717(0x127)](',\x20')+']':'';console[_0x191717(0xf5)]('\x20\x20'+(_0x28929e+0x1)+'.\x20'+a5_0x1bac87[_0x191717(0x185)](_0x3adfc4[_0x191717(0x15f)])+'\x20('+_0x3adfc4['rounds'][_0x191717(0x110)]+'\x20'+_0x5f3275+')'+a5_0x1bac87[_0x191717(0x15d)](_0x362072));}return 0x0;}let _0x19a720,_0xe31e65;try{_0x19a720=await _0x338079[_0x191717(0x116)][_0x191717(0x114)](_0x5c94e1[_0x191717(0x170)]);}catch(_0x2ad4d4){const _0x3531ae=_0x2ad4d4 instanceof Error?_0x2ad4d4['message']:String(_0x2ad4d4);return _0x3531ae['includes'](_0x191717(0x18e))||_0x3531ae['toLowerCase']()['includes'](_0x191717(0x119))?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x13c)+_0x5c94e1[_0x191717(0x170)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x15c)+_0x5c94e1[_0x191717(0x170)]+_0x191717(0x174)+_0x3531ae)),0x1;}try{_0xe31e65=await _0x338079[_0x191717(0x116)][_0x191717(0x130)](_0x5c94e1[_0x191717(0x12f)],_0x19a720);}catch(_0x5e90b6){const _0x33c00b=_0x5e90b6 instanceof Error?_0x5e90b6[_0x191717(0x13b)]:String(_0x5e90b6);return _0x33c00b[_0x191717(0x136)](_0x191717(0x18e))||_0x33c00b[_0x191717(0x104)]()[_0x191717(0x136)](_0x191717(0x119))?console[_0x191717(0xf5)](a5_0x1bac87['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x5c94e1[_0x191717(0x12f)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x113)+_0x5c94e1['agentName']+'\x22:\x20'+_0x33c00b)),0x1;}let _0x5da48f;if(!_0x2351f1)try{_0x5da48f=await setupEvaluatorAgent(_0x338079[_0x191717(0x116)],_0x2e1904[_0x191717(0x126)]);}catch(_0x8dba4d){const _0x334039=_0x8dba4d instanceof Error?_0x8dba4d[_0x191717(0x13b)]:String(_0x8dba4d);return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x129)+_0x334039)),0x1;}console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x101)](_0x191717(0x167))),console['log']('Site:\x20'+a5_0x1bac87[_0x191717(0x185)](_0x53ca69)),console[_0x191717(0xf5)](_0x191717(0x159)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1[_0x191717(0x170)]+'/'+_0x5c94e1['agentName'])),console[_0x191717(0xf5)]();const _0x3fbc3b=[],_0x281f5f=[],_0x3c8464=Date['now']();for(let _0x124f4e=0x0;_0x124f4e<_0x5e2016[_0x191717(0x110)];_0x124f4e++){const _0x2228e0=_0x5e2016[_0x124f4e];_0x5e2016['length']>0x1?console['log'](_0x191717(0x184)+(_0x124f4e+0x1)+'/'+_0x5e2016[_0x191717(0x110)]+':\x20'+a5_0x1bac87[_0x191717(0x185)](_0x2228e0['name'])):console[_0x191717(0xf5)](_0x191717(0x11e)+a5_0x1bac87[_0x191717(0x185)](_0x2228e0[_0x191717(0x15f)]));const _0x4b0756=createCommandSpinner(_0x191717(0x158)+_0x2228e0[_0x191717(0x150)][_0x191717(0x110)]+_0x191717(0x115));_0x4b0756[_0x191717(0x102)]();try{const {result:_0x9f945c,conversation:_0x4fc834}=await runTest(_0x338079['llm'],_0x2228e0,{'agentId':_0xe31e65,'projectId':_0x19a720,'site':_0x53ca69,'noEval':_0x2351f1,'evaluatorId':_0x5da48f,'onRoundStart':(_0x257f47,_0x341fab)=>{const _0x5720f9=_0x191717;_0x4b0756[_0x5720f9(0x105)]=_0x5720f9(0x14f)+(_0x257f47+0x1)+'/'+_0x341fab+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x568c26,_0x2a4e80,_0x36ec12)=>{const _0x83aaee=_0x191717,_0x27a11e=formatElapsed(_0x2a4e80);_0x36ec12?console[_0x83aaee(0xf5)](_0x83aaee(0x100)+(_0x568c26+0x1)+'/'+_0x2228e0['rounds'][_0x83aaee(0x110)]+_0x83aaee(0x176)+a5_0x1bac87[_0x83aaee(0x16c)]('✓')+'\x20('+_0x27a11e+')'):console[_0x83aaee(0xf5)]('\x20\x20Round\x20'+(_0x568c26+0x1)+'/'+_0x2228e0['rounds'][_0x83aaee(0x110)]+_0x83aaee(0x176)+a5_0x1bac87['red']('✗'));},'onEvaluationStart':()=>{const _0x5ad15e=_0x191717;_0x4b0756[_0x5ad15e(0x105)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2806ac=>{const _0x24c1a6=_0x191717,_0xf65c18=formatElapsed(_0x2806ac);console[_0x24c1a6(0xf5)](_0x24c1a6(0x161)+a5_0x1bac87[_0x24c1a6(0x16c)]('✓')+'\x20('+_0xf65c18+')');}});_0x4b0756[_0x191717(0x16d)](),_0x3fbc3b[_0x191717(0x103)](_0x9f945c),_0x281f5f[_0x191717(0x103)](_0x4fc834);if(_0x9f945c[_0x191717(0x14e)]==='PASS')console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x16c)](_0x191717(0xfa)+_0x9f945c[_0x191717(0x182)]));else _0x9f945c[_0x191717(0x14e)]===_0x191717(0x17e)?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x124)+_0x9f945c[_0x191717(0x182)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x10c)+_0x9f945c['reason']));_0x9f945c[_0x191717(0x154)]&&console['log'](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x138)+_0x9f945c[_0x191717(0x154)])),console['log']();}catch(_0x1b7bd9){_0x4b0756[_0x191717(0x16d)]();const _0x5794e6=_0x1b7bd9 instanceof Error?_0x1b7bd9[_0x191717(0x13b)]:String(_0x1b7bd9);console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x10c)+_0x5794e6)),console[_0x191717(0xf5)](),_0x3fbc3b[_0x191717(0x103)]({'name':_0x2228e0[_0x191717(0x15f)],'status':_0x191717(0x152),'reason':_0x5794e6,'timestamp':new Date()[_0x191717(0x145)](),'duration_ms':0x0});}}const _0xfa4fa0=Date[_0x191717(0x153)]()-_0x3c8464,_0x3d9dcd=_0x3fbc3b['filter'](_0x54851b=>_0x54851b[_0x191717(0x14e)]===_0x191717(0x135))[_0x191717(0x110)],_0x4718de=_0x3fbc3b[_0x191717(0x118)](_0x127727=>_0x127727[_0x191717(0x14e)]===_0x191717(0x17e))['length'],_0x4b1b23=_0x3fbc3b[_0x191717(0x118)](_0x55e4c0=>_0x55e4c0['status']==='ERROR')['length'];console[_0x191717(0xf5)]('━'['repeat'](0x3c)),console['log'](_0x191717(0x18d)),console[_0x191717(0xf5)]('━'[_0x191717(0x132)](0x3c)),console['log'](_0x191717(0xf7)+_0x3fbc3b['length']),console[_0x191717(0xf5)]('Passed:\x20\x20\x20'+a5_0x1bac87[_0x191717(0x16c)](_0x3d9dcd)),console[_0x191717(0xf5)](_0x191717(0x180)+a5_0x1bac87[_0x191717(0x14c)](_0x4718de));_0x4b1b23>0x0&&console['log'](_0x191717(0x189)+a5_0x1bac87[_0x191717(0x14c)](_0x4b1b23));console[_0x191717(0xf5)](_0x191717(0x137)+formatElapsed(_0xfa4fa0)),console[_0x191717(0xf5)]('━'[_0x191717(0x132)](0x3c));const _0x5e23d9=_0x3fbc3b[_0x191717(0x118)](_0x402f3f=>_0x402f3f[_0x191717(0x14e)]!==_0x191717(0x135));if(_0x5e23d9[_0x191717(0x110)]>0x0){console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0x188));for(const _0x391380 of _0x5e23d9){const _0x4f16df=a5_0x1bac87[_0x191717(0x14c)]('✗'),_0x4ed12d=_0x391380[_0x191717(0x182)][_0x191717(0x110)]>0x32?_0x391380['reason']['substring'](0x0,0x32)+_0x191717(0x168):_0x391380[_0x191717(0x182)];console['log']('\x20\x20'+_0x4f16df+'\x20'+_0x391380[_0x191717(0x15f)]+':\x20'+_0x4ed12d);}}const _0x457fd3={'summary':{'total':_0x3fbc3b[_0x191717(0x110)],'passed':_0x3d9dcd,'failed':_0x4718de,'errors':_0x4b1b23>0x0?_0x4b1b23:undefined,'duration_ms':_0xfa4fa0},'tests':_0x3fbc3b,'agent':{'project':_0x5c94e1['projectName'],'name':_0x5c94e1['agentName'],'site':_0x53ca69},'timestamp':new Date(_0x3c8464)[_0x191717(0x145)]()};try{const _0x455b34=buildCachedTestRun(_0x281f5f,{'site':_0x53ca69,'projectId':_0x19a720,'projectName':_0x5c94e1['projectName'],'agentId':_0xe31e65,'agentName':_0x5c94e1[_0x191717(0x12f)],'testYmlPath':a5_0x3575f6[_0x191717(0x125)](_0x5c94e1['testYmlPath'])});saveLastTestRun(_0x455b34);}catch{}if(_0x2e0f27!==_0x191717(0x17b)||_0x946f4b){const _0x441789=formatResults(_0x457fd3,_0x2e0f27);if(_0x946f4b)try{a5_0x15b21f[_0x191717(0x147)](_0x946f4b,_0x441789,_0x191717(0x14b)),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x112)+_0x946f4b));}catch(_0x2dedd9){return console[_0x191717(0xf5)](),console[_0x191717(0xf5)](a5_0x1bac87['red'](_0x191717(0x10a)+_0x2dedd9)),0x1;}else console['log'](),console[_0x191717(0xf5)](_0x441789);}return _0x5e23d9[_0x191717(0x110)]>0x0?0x1:0x0;}async[a5_0x222562(0x149)](_0x4d17d7,_0x159f50){const _0x430068=a5_0x222562,{options:_0x176d2b,tdx:_0x39f9f0}=_0x4d17d7,{definition:_0x1fac99,agentInfo:_0xd33f37,outputFormat:_0x13924f,outputFile:_0x4afe5b}=_0x159f50,_0x35bf15=_0x176d2b['site'],_0x460934=loadLastTestRun();if(!_0x460934)return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x146))),console[_0x430068(0xf5)](a5_0x1bac87['dim'](_0x430068(0x16e))),0x1;if(_0x460934[_0x430068(0x106)][_0x430068(0x12f)]!==_0xd33f37[_0x430068(0x12f)])return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x13f)+_0x460934['agent'][_0x430068(0x12f)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0xd33f37['agentName']+'\x22.')),console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x12e))),0x1;const _0x110ca1=new Set(_0x460934[_0x430068(0x157)][_0x430068(0x10d)](_0x4a14e6=>_0x4a14e6[_0x430068(0x117)])),_0x5d360a=_0x1fac99['tests']['filter'](_0x28a049=>!_0x110ca1[_0x430068(0x17f)](_0x28a049['name']));if(_0x5d360a[_0x430068(0x110)]>0x0&&_0x460934[_0x430068(0x121)]!==_0x35bf15)return console['log'](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x108))),console[_0x430068(0xf5)](a5_0x1bac87['dim'](_0x430068(0xfb)+_0x460934['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x35bf15+'\x22.')),console['log'](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x177)+_0x460934[_0x430068(0x121)]+_0x430068(0x12d))),0x1;const _0x144045=_0x1fac99[_0x430068(0x166)]['filter'](_0x229fa8=>_0x110ca1[_0x430068(0x17f)](_0x229fa8[_0x430068(0x15f)])),_0x9a4d48=_0x5d360a;let _0x404b5a;try{_0x404b5a=await setupEvaluatorAgent(_0x39f9f0[_0x430068(0x116)],_0x176d2b['verbose']);}catch(_0x13311b){const _0xd4aaa=_0x13311b instanceof Error?_0x13311b[_0x430068(0x13b)]:String(_0x13311b);return console[_0x430068(0xf5)](a5_0x1bac87['red'](_0x430068(0x129)+_0xd4aaa)),0x1;}console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x101)](_0x430068(0x179))),console[_0x430068(0xf5)](_0x430068(0x18b)+a5_0x1bac87[_0x430068(0x185)](_0x460934[_0x430068(0x163)])),console['log'](_0x430068(0x159)+a5_0x1bac87[_0x430068(0x185)](_0x460934[_0x430068(0x106)][_0x430068(0x170)]+'/'+_0x460934[_0x430068(0x106)][_0x430068(0x12f)]));_0x9a4d48[_0x430068(0x110)]>0x0&&console['log'](_0x430068(0x11c)+a5_0x1bac87[_0x430068(0x109)](_0x9a4d48[_0x430068(0x110)]));console[_0x430068(0xf5)]();const _0x3c4d09=[],_0x1bf0eb=Date['now'](),_0xaf8d15=createCommandSpinner(_0x430068(0x10b));if(_0x144045[_0x430068(0x110)]>0x0)try{const _0x4d8302=await reevaluateFromCache(_0x39f9f0['llm'],_0x460934,{'tests':_0x144045},{'evaluatorId':_0x404b5a,'onTestStart':(_0xa2abc1,_0x1633cb,_0x556308)=>{const _0x1ad402=_0x430068;_0xaf8d15[_0x1ad402(0x105)]='Re-evaluating\x20'+(_0x1633cb+0x1)+'/'+_0x556308+':\x20'+_0xa2abc1+_0x1ad402(0x168);if(!_0xaf8d15[_0x1ad402(0x156)])_0xaf8d15[_0x1ad402(0x102)]();},'onTestComplete':(_0x51768a,_0x4390aa)=>{const _0x2fc65c=_0x430068;_0xaf8d15[_0x2fc65c(0x16d)]();if(_0x4390aa[_0x2fc65c(0x14e)]==='PASS')console[_0x2fc65c(0xf5)](a5_0x1bac87[_0x2fc65c(0x16c)](_0x2fc65c(0xfa)+_0x51768a)+a5_0x1bac87[_0x2fc65c(0x15d)](_0x2fc65c(0x128)));else _0x4390aa[_0x2fc65c(0x14e)]===_0x2fc65c(0x17e)?console['log'](a5_0x1bac87[_0x2fc65c(0x14c)](_0x2fc65c(0x124)+_0x51768a+_0x2fc65c(0x11a)+_0x4390aa[_0x2fc65c(0x182)])+a5_0x1bac87[_0x2fc65c(0x15d)]('\x20(cached)')):console[_0x2fc65c(0xf5)](a5_0x1bac87[_0x2fc65c(0x14c)]('✗\x20ERROR:\x20'+_0x51768a+_0x2fc65c(0x11a)+_0x4390aa['reason']));_0x4390aa[_0x2fc65c(0x154)]&&console[_0x2fc65c(0xf5)](a5_0x1bac87['dim']('\x20\x20Conversation:\x20'+_0x4390aa['conversation_url'])),_0x3c4d09[_0x2fc65c(0x103)](_0x4390aa);},'onTestSkipped':(_0x578160,_0x6b8d5e)=>{const _0x2717d7=_0x430068;_0xaf8d15[_0x2717d7(0x16d)](),console[_0x2717d7(0xf5)](a5_0x1bac87[_0x2717d7(0x109)]('⚠\x20SKIPPED:\x20'+_0x578160+'\x20-\x20'+_0x6b8d5e));}});for(const _0x3399d1 of _0x4d8302){!_0x3c4d09['find'](_0x19d8c7=>_0x19d8c7[_0x430068(0x15f)]===_0x3399d1[_0x430068(0x15f)])&&_0x3c4d09[_0x430068(0x103)](_0x3399d1);}}catch(_0x1cba77){_0xaf8d15[_0x430068(0x16d)]();const _0x2f08a0=_0x1cba77 instanceof Error?_0x1cba77[_0x430068(0x13b)]:String(_0x1cba77);return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0xfd)+_0x2f08a0)),0x1;}_0xaf8d15[_0x430068(0x16d)]();if(_0x9a4d48[_0x430068(0x110)]>0x0){console[_0x430068(0xf5)](),console['log'](a5_0x1bac87[_0x430068(0x101)](_0x430068(0x15b)));const {projectId:_0x8ed771,agentId:_0x5e9fc1}=_0x460934[_0x430068(0x106)];for(const _0x6c32ff of _0x9a4d48){console[_0x430068(0xf5)](_0x430068(0x11f)+a5_0x1bac87[_0x430068(0x185)](_0x6c32ff['name']));const _0x1ba6ec=createCommandSpinner('Round\x201/'+_0x6c32ff[_0x430068(0x150)][_0x430068(0x110)]+':\x20Sending\x20user\x20input...');_0x1ba6ec['start']();try{const {result:_0xda30ac}=await runTest(_0x39f9f0[_0x430068(0x116)],_0x6c32ff,{'agentId':_0x5e9fc1,'projectId':_0x8ed771,'site':_0x460934[_0x430068(0x121)],'noEval':![],'evaluatorId':_0x404b5a,'onRoundStart':(_0x301a06,_0x2c620e)=>{const _0x213245=_0x430068;_0x1ba6ec[_0x213245(0x105)]=_0x213245(0x14f)+(_0x301a06+0x1)+'/'+_0x2c620e+_0x213245(0x115);},'onRoundComplete':(_0x4d0e6d,_0x2caca7,_0x7b38be)=>{const _0x6c5f94=_0x430068,_0x54d390=formatElapsed(_0x2caca7);_0x7b38be?console[_0x6c5f94(0xf5)](_0x6c5f94(0x100)+(_0x4d0e6d+0x1)+'/'+_0x6c32ff[_0x6c5f94(0x150)][_0x6c5f94(0x110)]+'...\x20'+a5_0x1bac87[_0x6c5f94(0x16c)]('✓')+'\x20('+_0x54d390+')'):console[_0x6c5f94(0xf5)]('\x20\x20Round\x20'+(_0x4d0e6d+0x1)+'/'+_0x6c32ff[_0x6c5f94(0x150)][_0x6c5f94(0x110)]+_0x6c5f94(0x176)+a5_0x1bac87[_0x6c5f94(0x14c)]('✗'));},'onEvaluationStart':()=>{const _0x2266f8=_0x430068;_0x1ba6ec[_0x2266f8(0x105)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5acc8c=>{const _0xee3371=_0x430068,_0x1e6455=formatElapsed(_0x5acc8c);console[_0xee3371(0xf5)]('\x20\x20Evaluating...\x20'+a5_0x1bac87[_0xee3371(0x16c)]('✓')+'\x20('+_0x1e6455+')');}});_0x1ba6ec[_0x430068(0x16d)](),_0x3c4d09[_0x430068(0x103)](_0xda30ac);if(_0xda30ac[_0x430068(0x14e)]==='PASS')console[_0x430068(0xf5)](a5_0x1bac87['green'](_0x430068(0xfa)+_0xda30ac['reason'])+a5_0x1bac87['dim']('\x20(new)'));else _0xda30ac['status']==='FAIL'?console[_0x430068(0xf5)](a5_0x1bac87['red'](_0x430068(0x124)+_0xda30ac[_0x430068(0x182)])+a5_0x1bac87[_0x430068(0x15d)]('\x20(new)')):console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10c)+_0xda30ac[_0x430068(0x182)]));_0xda30ac[_0x430068(0x154)]&&console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x13e)+_0xda30ac['conversation_url']));}catch(_0x3b948b){_0x1ba6ec['stop']();const _0x1cd3e9=_0x3b948b instanceof Error?_0x3b948b['message']:String(_0x3b948b);console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10c)+_0x1cd3e9)),_0x3c4d09['push']({'name':_0x6c32ff[_0x430068(0x15f)],'status':_0x430068(0x152),'reason':_0x1cd3e9,'timestamp':new Date()[_0x430068(0x145)](),'duration_ms':0x0});}}}console[_0x430068(0xf5)]();const _0xb9a542=Date['now']()-_0x1bf0eb,_0x2f8364=_0x3c4d09[_0x430068(0x118)](_0x4e5cd7=>_0x4e5cd7[_0x430068(0x14e)]==='PASS')[_0x430068(0x110)],_0x32e58c=_0x3c4d09[_0x430068(0x118)](_0x1ba691=>_0x1ba691['status']===_0x430068(0x17e))[_0x430068(0x110)],_0x58a971=_0x3c4d09['filter'](_0x219104=>_0x219104['status']==='ERROR')[_0x430068(0x110)];console[_0x430068(0xf5)]('━'['repeat'](0x3c)),console[_0x430068(0xf5)](_0x430068(0x164)),console[_0x430068(0xf5)]('━'[_0x430068(0x132)](0x3c)),console[_0x430068(0xf5)]('Total:\x20\x20\x20\x20'+_0x3c4d09[_0x430068(0x110)]),console[_0x430068(0xf5)](_0x430068(0x181)+a5_0x1bac87[_0x430068(0x16c)](_0x2f8364)),console['log'](_0x430068(0x180)+a5_0x1bac87[_0x430068(0x14c)](_0x32e58c));_0x58a971>0x0&&console[_0x430068(0xf5)]('Errors:\x20\x20\x20'+a5_0x1bac87[_0x430068(0x14c)](_0x58a971));console[_0x430068(0xf5)](_0x430068(0x137)+formatElapsed(_0xb9a542)),console[_0x430068(0xf5)]('━'[_0x430068(0x132)](0x3c));const _0x7db2be={'summary':{'total':_0x3c4d09[_0x430068(0x110)],'passed':_0x2f8364,'failed':_0x32e58c,'errors':_0x58a971>0x0?_0x58a971:undefined,'duration_ms':_0xb9a542},'tests':_0x3c4d09,'agent':{'project':_0xd33f37['projectName'],'name':_0xd33f37['agentName'],'site':_0x35bf15},'timestamp':new Date(_0x1bf0eb)[_0x430068(0x145)]()};if(_0x13924f!==_0x430068(0x17b)||_0x4afe5b){const _0x22f687=formatResults(_0x7db2be,_0x13924f);if(_0x4afe5b)try{a5_0x15b21f[_0x430068(0x147)](_0x4afe5b,_0x22f687,_0x430068(0x14b)),console[_0x430068(0xf5)](),console['log'](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x112)+_0x4afe5b));}catch(_0x203bb0){return console[_0x430068(0xf5)](),console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10a)+_0x203bb0)),0x1;}else console[_0x430068(0xf5)](),console[_0x430068(0xf5)](_0x22f687);}const _0x2fd87f=_0x3c4d09['filter'](_0x28ff18=>_0x28ff18['status']!==_0x430068(0x135));return _0x2fd87f['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x3af3c2=a5_0x5c7f;(function(_0x333229,_0x384949){const _0x36f947=a5_0x5c7f,_0x32a957=_0x333229();while(!![]){try{const _0x5f059b=parseInt(_0x36f947(0x1a0))/0x1*(-parseInt(_0x36f947(0x187))/0x2)+-parseInt(_0x36f947(0x1b6))/0x3+-parseInt(_0x36f947(0x1dd))/0x4+-parseInt(_0x36f947(0x17b))/0x5+parseInt(_0x36f947(0x1c5))/0x6+parseInt(_0x36f947(0x192))/0x7*(parseInt(_0x36f947(0x1c7))/0x8)+-parseInt(_0x36f947(0x1ed))/0x9*(-parseInt(_0x36f947(0x15b))/0xa);if(_0x5f059b===_0x384949)break;else _0x32a957['push'](_0x32a957['shift']());}catch(_0x21caa7){_0x32a957['push'](_0x32a957['shift']());}}}(a5_0x2a53,0x64c28));function a5_0x2a53(){const _0x53274c=['agentName','conversation_url','7joFNhu','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','projectDir','Error:\x20No\x20previous\x20test\x20run\x20found.','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','projectName','✗\x20ERROR:\x20','\x20\x20Project:\x20','PASS','FAIL','text','\x27\x20to\x20create\x20the\x20folder\x20structure.','Tests\x20found:\x20','tags','146578zbkMql','map','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20(cached)','jsonl','source','not\x20found','Duration:\x20','Test\x20Configuration:','\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)','dryRun','resolve','Round\x201/','\x22:\x20','Available\x20tags:\x20','Failed\x20Tests:','Output\x20written\x20to:\x20','green','Failed:\x20\x20\x20','404','reeval','Re-evaluating...','729531AooHRK','repeat','message','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','start','site','forEach','\x22,\x20but\x20current\x20site\x20is\x20\x22',':\x20Sending\x20user\x20input...','Evaluating\x20response...','find','timestamp','Executing\x20new\x20tests...','eval','table','4163658FwsTdT','split','4623848zKRHxZ','toLowerCase','status','Either\x20switch\x20to\x20the\x20\x22','log','Running\x20test:\x20','\x20\x20-\x20','red','\x20\x20Evaluating...\x20','Conversation\x20URL:\x20','join','now','Agent:\x20','✓\x20PASS:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','cyan','context','trim','Errors:\x20\x20\x20','no_local_folder','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Test\x20','1029540FUhdoL','Site:\x20','Running\x20agent\x20tests...','yellow','ERROR','writeFileSync','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','test.yml','rounds','Available\x20tests:\x20','multiple_agents','Passed:\x20\x20\x20','\x20-\x20','no_context','Re-evaluating\x20cached\x20test\x20run...','...\x20','444159OgEinH','dim','length','Re-evaluating\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20FAIL:\x20','tests','agent:test','reason','conversations','toISOString','70ozPPqi','filter','/<agent-name>','basename','...','⚠\x20SKIPPED:\x20','stop','includes','agent','\x20\x20Agent:\x20','New\x20tests\x20to\x20execute:\x20','has','description','llm','llmProject','white','name','Error\x20writing\x20output\x20file:\x20','resolveProjectId','Total:\x20\x20\x20\x20','testName','Run\x20\x27tdx\x20agent\x20pull\x20','add','push','Round\x20','json','verbose','size','\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','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Cached\x20run\x20from:\x20','agentDirs','2787645TwTcdK','executeReeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','No\x20tests\x20found\x20matching:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','utf-8','existsSync','\x20\x20Conversation:\x20','\x20\x20Round\x20','some','2TYrOhy','found','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','execute','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','no_tests','Using\x20agent:\x20'];a5_0x2a53=function(){return _0x53274c;};return a5_0x2a53();}import*as a5_0x4b70d2 from'node:fs';import*as a5_0x328980 from'node:path';import a5_0x1acfce from'chalk';import{BaseCommand}from'./command.js';function a5_0x5c7f(_0x9feecd,_0x1dab52){_0x9feecd=_0x9feecd-0x156;const _0x2a5326=a5_0x2a53();let _0x5c7fb7=_0x2a5326[_0x9feecd];return _0x5c7fb7;}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_0x3af3c2(0x16b)]=a5_0x3af3c2(0x157);[a5_0x3af3c2(0x167)]=a5_0x3af3c2(0x1f2);async[a5_0x3af3c2(0x18c)](_0x5a788e){const _0x33a6a0=a5_0x3af3c2,{options:_0x5d8784,args:_0x37764a,tdx:_0x499546}=_0x5a788e,_0x409e1e=_0x37764a[0x0]||'.',_0x5ea2cd=_0x5d8784[_0x33a6a0(0x1aa)],_0x2a3909=_0x5d8784,_0x16e749=_0x2a3909[_0x33a6a0(0x1c3)]===![],_0x2bcebc=_0x2a3909[_0x33a6a0(0x1b4)],_0x552e81=_0x2a3909[_0x33a6a0(0x16b)],_0x4fda8c=_0x2a3909['tags'],_0x5d55ae=_0x5d8784[_0x33a6a0(0x1bb)],_0x122e7f=_0x2a3909['output'];if(_0x2bcebc&&_0x16e749)return console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x17d))),0x1;let _0x519b32='table';if(_0x2a3909[_0x33a6a0(0x174)])_0x519b32=_0x33a6a0(0x174);else{if(_0x2a3909[_0x33a6a0(0x1a4)])_0x519b32=_0x33a6a0(0x1a4);else{if(_0x2a3909['tsv'])_0x519b32='tsv';else{if(_0x2a3909[_0x33a6a0(0x1c4)])_0x519b32=_0x33a6a0(0x1c4);}}}const _0x2addaf=_0x2a3909['llmProject'];let _0x86ce56=_0x409e1e;const _0x3ab527=a5_0x4b70d2[_0x33a6a0(0x183)](_0x409e1e),_0x499c7c=_0x409e1e==='.';if(!_0x3ab527||_0x499c7c){const _0x281420=resolveProjectFromContext(_0x409e1e,_0x2addaf,{'requireFile':_0x33a6a0(0x1e4)});if(_0x281420[_0x33a6a0(0x188)])_0x86ce56=_0x281420[_0x33a6a0(0x194)],_0x281420[_0x33a6a0(0x1a5)]===_0x33a6a0(0x1d7)&&console[_0x33a6a0(0x1cb)](a5_0x1acfce['dim'](_0x33a6a0(0x18f)+_0x86ce56));else switch(_0x281420[_0x33a6a0(0x158)]){case _0x33a6a0(0x1ea):console[_0x33a6a0(0x1cb)](a5_0x1acfce['yellow'](_0x281420[_0x33a6a0(0x1b8)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x181)),console['log'](_0x33a6a0(0x177)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1a9)),console['log'](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x17e));return 0x1;case _0x33a6a0(0x1da):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)](_0x281420[_0x33a6a0(0x1b8)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x170)+_0x281420['llmProject']+_0x33a6a0(0x19d));return 0x1;case _0x33a6a0(0x1e7):{const _0x4ac8de=a5_0x328980[_0x33a6a0(0x15e)](_0x281420['projectDir']);console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)](_0x33a6a0(0x180)+_0x281420[_0x33a6a0(0x169)]+'\x22:'));for(const _0x35fe87 of _0x281420[_0x33a6a0(0x17a)]){console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1cd)+_0x35fe87);}return console['log'](),console['log'](_0x33a6a0(0x193)+_0x4ac8de+_0x33a6a0(0x15d)),0x1;}case _0x33a6a0(0x18e):console[_0x33a6a0(0x1cb)](a5_0x1acfce['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x281420[_0x33a6a0(0x169)]+'\x22.')),console[_0x33a6a0(0x1cb)](a5_0x1acfce['dim']('Project\x20path:\x20'+_0x281420[_0x33a6a0(0x194)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1d5));return 0x1;}}const {definition:_0x3d33e6,agentInfo:_0x530be9}=parseTestFile(_0x86ce56);let _0x1b23e9=_0x3d33e6[_0x33a6a0(0x156)];if(_0x552e81){const _0x283fa0=_0x552e81[_0x33a6a0(0x1c6)](',')[_0x33a6a0(0x1a1)](_0x36f28a=>_0x36f28a[_0x33a6a0(0x1d8)]());_0x1b23e9=_0x3d33e6[_0x33a6a0(0x156)][_0x33a6a0(0x15c)](_0x1c5e10=>_0x283fa0[_0x33a6a0(0x162)](_0x1c5e10['name']));if(_0x1b23e9[_0x33a6a0(0x1ef)]===0x0)return console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)](_0x33a6a0(0x17f)+_0x552e81)),console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)](_0x33a6a0(0x1e6)+_0x3d33e6[_0x33a6a0(0x156)][_0x33a6a0(0x1a1)](_0x10c1d0=>_0x10c1d0[_0x33a6a0(0x16b)])[_0x33a6a0(0x1d1)](',\x20'))),0x1;}if(_0x4fda8c){const _0x43ed32=_0x4fda8c[_0x33a6a0(0x1c6)](',')[_0x33a6a0(0x1a1)](_0x3daf38=>_0x3daf38[_0x33a6a0(0x1d8)]()['toLowerCase']());_0x1b23e9=_0x1b23e9['filter'](_0x375e20=>_0x375e20[_0x33a6a0(0x19f)]?.[_0x33a6a0(0x186)](_0x14f749=>_0x43ed32[_0x33a6a0(0x162)](_0x14f749[_0x33a6a0(0x1c8)]())));if(_0x1b23e9[_0x33a6a0(0x1ef)]===0x0){console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4fda8c));const _0x140897=new Set();return _0x3d33e6[_0x33a6a0(0x156)][_0x33a6a0(0x1bc)](_0x2db13c=>_0x2db13c['tags']?.[_0x33a6a0(0x1bc)](_0x45b235=>_0x140897[_0x33a6a0(0x171)](_0x45b235))),_0x140897[_0x33a6a0(0x176)]>0x0?console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)](_0x33a6a0(0x1ae)+[..._0x140897][_0x33a6a0(0x1d1)](',\x20'))):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2bcebc)return this['executeReeval'](_0x5a788e,{'definition':{'tests':_0x1b23e9},'agentInfo':_0x530be9,'outputFormat':_0x519b32,'outputFile':_0x122e7f,'testNames':_0x552e81});if(_0x5ea2cd){console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1d6)](_0x33a6a0(0x1a8))),console[_0x33a6a0(0x1cb)]('\x20\x20Site:\x20'+a5_0x1acfce[_0x33a6a0(0x16a)](_0x5d55ae)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x199)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x530be9[_0x33a6a0(0x197)])),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x164)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x530be9[_0x33a6a0(0x190)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x19e)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x1b23e9[_0x33a6a0(0x1ef)]));for(let _0x2ddd6a=0x0;_0x2ddd6a<_0x1b23e9['length'];_0x2ddd6a++){const _0x6c9932=_0x1b23e9[_0x2ddd6a],_0x414e67=_0x6c9932[_0x33a6a0(0x1e5)]['length']===0x1?'round':_0x33a6a0(0x1e5),_0x28f43f=_0x6c9932[_0x33a6a0(0x19f)]?.[_0x33a6a0(0x1ef)]?'\x20['+_0x6c9932[_0x33a6a0(0x19f)][_0x33a6a0(0x1d1)](',\x20')+']':'';console[_0x33a6a0(0x1cb)]('\x20\x20'+(_0x2ddd6a+0x1)+'.\x20'+a5_0x1acfce[_0x33a6a0(0x16a)](_0x6c9932[_0x33a6a0(0x16b)])+'\x20('+_0x6c9932[_0x33a6a0(0x1e5)][_0x33a6a0(0x1ef)]+'\x20'+_0x414e67+')'+a5_0x1acfce['dim'](_0x28f43f));}return 0x0;}let _0x359e79,_0x2e3851;try{_0x359e79=await _0x499546['llm'][_0x33a6a0(0x16d)](_0x530be9[_0x33a6a0(0x197)]);}catch(_0x3b2e46){const _0x1c6313=_0x3b2e46 instanceof Error?_0x3b2e46[_0x33a6a0(0x1b8)]:String(_0x3b2e46);return _0x1c6313[_0x33a6a0(0x162)](_0x33a6a0(0x1b3))||_0x1c6313['toLowerCase']()[_0x33a6a0(0x162)](_0x33a6a0(0x1a6))?console[_0x33a6a0(0x1cb)](a5_0x1acfce['red'](_0x33a6a0(0x189)+_0x530be9[_0x33a6a0(0x197)])):console['log'](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x1db)+_0x530be9[_0x33a6a0(0x197)]+_0x33a6a0(0x1ad)+_0x1c6313)),0x1;}try{_0x2e3851=await _0x499546[_0x33a6a0(0x168)]['resolveAgentId'](_0x530be9[_0x33a6a0(0x190)],_0x359e79);}catch(_0xcb0d98){const _0x3c0192=_0xcb0d98 instanceof Error?_0xcb0d98[_0x33a6a0(0x1b8)]:String(_0xcb0d98);return _0x3c0192[_0x33a6a0(0x162)](_0x33a6a0(0x1b3))||_0x3c0192[_0x33a6a0(0x1c8)]()[_0x33a6a0(0x162)](_0x33a6a0(0x1a6))?console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x530be9['agentName'])):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x1f1)+_0x530be9[_0x33a6a0(0x190)]+_0x33a6a0(0x1ad)+_0x3c0192)),0x1;}let _0x5107fd;if(!_0x16e749)try{_0x5107fd=await setupEvaluatorAgent(_0x499546['llm'],_0x5d8784[_0x33a6a0(0x175)]);}catch(_0x5ba344){const _0x1445bc=_0x5ba344 instanceof Error?_0x5ba344['message']:String(_0x5ba344);return console['log'](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x18d)+_0x1445bc)),0x1;}console[_0x33a6a0(0x1cb)](a5_0x1acfce['cyan'](_0x33a6a0(0x1df))),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1de)+a5_0x1acfce['white'](_0x5d55ae)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1d3)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x530be9[_0x33a6a0(0x197)]+'/'+_0x530be9[_0x33a6a0(0x190)])),console['log']();const _0x4ef3dc=[],_0x48790a=[],_0x29331e=Date[_0x33a6a0(0x1d2)]();for(let _0x2130d2=0x0;_0x2130d2<_0x1b23e9['length'];_0x2130d2++){const _0x55922d=_0x1b23e9[_0x2130d2];_0x1b23e9[_0x33a6a0(0x1ef)]>0x1?console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1dc)+(_0x2130d2+0x1)+'/'+_0x1b23e9['length']+':\x20'+a5_0x1acfce[_0x33a6a0(0x16a)](_0x55922d[_0x33a6a0(0x16b)])):console['log'](_0x33a6a0(0x1cc)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x55922d[_0x33a6a0(0x16b)]));const _0x4bfd55=createCommandSpinner(_0x33a6a0(0x1ac)+_0x55922d[_0x33a6a0(0x1e5)][_0x33a6a0(0x1ef)]+':\x20Sending\x20user\x20input...');_0x4bfd55[_0x33a6a0(0x1ba)]();try{const {result:_0x54b1cc,conversation:_0x4f1e2e}=await runTest(_0x499546['llm'],_0x55922d,{'agentId':_0x2e3851,'projectId':_0x359e79,'site':_0x5d55ae,'noEval':_0x16e749,'evaluatorId':_0x5107fd,'onRoundStart':(_0x39d844,_0x27a9ba)=>{const _0x38d5e6=_0x33a6a0;_0x4bfd55['text']=_0x38d5e6(0x173)+(_0x39d844+0x1)+'/'+_0x27a9ba+_0x38d5e6(0x1be);},'onRoundComplete':(_0xa3496a,_0x381a87,_0x5f432e)=>{const _0x52f349=_0x33a6a0,_0x20a843=formatElapsed(_0x381a87);_0x5f432e?console[_0x52f349(0x1cb)]('\x20\x20Round\x20'+(_0xa3496a+0x1)+'/'+_0x55922d[_0x52f349(0x1e5)][_0x52f349(0x1ef)]+_0x52f349(0x1ec)+a5_0x1acfce['green']('✓')+'\x20('+_0x20a843+')'):console['log']('\x20\x20Round\x20'+(_0xa3496a+0x1)+'/'+_0x55922d['rounds'][_0x52f349(0x1ef)]+'...\x20'+a5_0x1acfce['red']('✗'));},'onEvaluationStart':()=>{const _0x3d52cd=_0x33a6a0;_0x4bfd55[_0x3d52cd(0x19c)]=_0x3d52cd(0x1bf);},'onEvaluationComplete':_0x4eee73=>{const _0x47aca2=_0x33a6a0,_0xe36a0b=formatElapsed(_0x4eee73);console[_0x47aca2(0x1cb)]('\x20\x20Evaluating...\x20'+a5_0x1acfce[_0x47aca2(0x1b1)]('✓')+'\x20('+_0xe36a0b+')');}});_0x4bfd55[_0x33a6a0(0x161)](),_0x4ef3dc[_0x33a6a0(0x172)](_0x54b1cc),_0x48790a[_0x33a6a0(0x172)](_0x4f1e2e);if(_0x54b1cc[_0x33a6a0(0x1c9)]===_0x33a6a0(0x19a))console[_0x33a6a0(0x1cb)](a5_0x1acfce['green'](_0x33a6a0(0x1d4)+_0x54b1cc[_0x33a6a0(0x158)]));else _0x54b1cc[_0x33a6a0(0x1c9)]===_0x33a6a0(0x19b)?console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x1f3)+_0x54b1cc[_0x33a6a0(0x158)])):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)]('✗\x20ERROR:\x20'+_0x54b1cc[_0x33a6a0(0x158)]));_0x54b1cc[_0x33a6a0(0x191)]&&console[_0x33a6a0(0x1cb)](a5_0x1acfce['dim'](_0x33a6a0(0x1d0)+_0x54b1cc[_0x33a6a0(0x191)])),console[_0x33a6a0(0x1cb)]();}catch(_0x2f97b3){_0x4bfd55[_0x33a6a0(0x161)]();const _0x130fa6=_0x2f97b3 instanceof Error?_0x2f97b3['message']:String(_0x2f97b3);console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)]('✗\x20ERROR:\x20'+_0x130fa6)),console[_0x33a6a0(0x1cb)](),_0x4ef3dc['push']({'name':_0x55922d[_0x33a6a0(0x16b)],'status':_0x33a6a0(0x1e1),'reason':_0x130fa6,'timestamp':new Date()[_0x33a6a0(0x15a)](),'duration_ms':0x0});}}const _0x536cf1=Date['now']()-_0x29331e,_0x19b60e=_0x4ef3dc[_0x33a6a0(0x15c)](_0x36fe04=>_0x36fe04['status']==='PASS')[_0x33a6a0(0x1ef)],_0x9e8042=_0x4ef3dc['filter'](_0x2a29c8=>_0x2a29c8[_0x33a6a0(0x1c9)]===_0x33a6a0(0x19b))[_0x33a6a0(0x1ef)],_0x36d332=_0x4ef3dc[_0x33a6a0(0x15c)](_0x1272ef=>_0x1272ef['status']===_0x33a6a0(0x1e1))[_0x33a6a0(0x1ef)];console[_0x33a6a0(0x1cb)]('━'[_0x33a6a0(0x1b7)](0x3c)),console['log']('Test\x20Summary'),console['log']('━'[_0x33a6a0(0x1b7)](0x3c)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x16e)+_0x4ef3dc['length']),console['log'](_0x33a6a0(0x1e8)+a5_0x1acfce[_0x33a6a0(0x1b1)](_0x19b60e)),console['log']('Failed:\x20\x20\x20'+a5_0x1acfce['red'](_0x9e8042));_0x36d332>0x0&&console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1d9)+a5_0x1acfce['red'](_0x36d332));console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1a7)+formatElapsed(_0x536cf1)),console[_0x33a6a0(0x1cb)]('━'['repeat'](0x3c));const _0x460825=_0x4ef3dc[_0x33a6a0(0x15c)](_0xdfbef7=>_0xdfbef7['status']!=='PASS');if(_0x460825[_0x33a6a0(0x1ef)]>0x0){console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1af));for(const _0x1ef427 of _0x460825){const _0x21e911=a5_0x1acfce[_0x33a6a0(0x1ce)]('✗'),_0x430085=_0x1ef427[_0x33a6a0(0x158)][_0x33a6a0(0x1ef)]>0x32?_0x1ef427[_0x33a6a0(0x158)]['substring'](0x0,0x32)+_0x33a6a0(0x15f):_0x1ef427[_0x33a6a0(0x158)];console[_0x33a6a0(0x1cb)]('\x20\x20'+_0x21e911+'\x20'+_0x1ef427[_0x33a6a0(0x16b)]+':\x20'+_0x430085);}}const _0x4ba06d={'summary':{'total':_0x4ef3dc[_0x33a6a0(0x1ef)],'passed':_0x19b60e,'failed':_0x9e8042,'errors':_0x36d332>0x0?_0x36d332:undefined,'duration_ms':_0x536cf1},'tests':_0x4ef3dc,'agent':{'project':_0x530be9[_0x33a6a0(0x197)],'name':_0x530be9[_0x33a6a0(0x190)],'site':_0x5d55ae},'timestamp':new Date(_0x29331e)['toISOString']()};try{const _0x297cbf=buildCachedTestRun(_0x48790a,{'site':_0x5d55ae,'projectId':_0x359e79,'projectName':_0x530be9[_0x33a6a0(0x197)],'agentId':_0x2e3851,'agentName':_0x530be9[_0x33a6a0(0x190)],'testYmlPath':a5_0x328980[_0x33a6a0(0x1ab)](_0x530be9['testYmlPath'])});saveLastTestRun(_0x297cbf);}catch{}if(_0x519b32!=='table'||_0x122e7f){const _0x58e79e=formatResults(_0x4ba06d,_0x519b32);if(_0x122e7f)try{a5_0x4b70d2['writeFileSync'](_0x122e7f,_0x58e79e,_0x33a6a0(0x182)),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)]('Output\x20written\x20to:\x20'+_0x122e7f));}catch(_0x294336){return console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x16c)+_0x294336)),0x1;}else console['log'](),console['log'](_0x58e79e);}return _0x460825[_0x33a6a0(0x1ef)]>0x0?0x1:0x0;}async[a5_0x3af3c2(0x17c)](_0x137edc,_0x5f1503){const _0x31dbf2=a5_0x3af3c2,{options:_0x57d96b,tdx:_0x582a7d}=_0x137edc,{definition:_0x37256f,agentInfo:_0x20614b,outputFormat:_0x385354,outputFile:_0x4d33a7}=_0x5f1503,_0x1c6e97=_0x57d96b['site'],_0x475728=loadLastTestRun();if(!_0x475728)return console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x195))),console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ee)](_0x31dbf2(0x196))),0x1;if(_0x475728[_0x31dbf2(0x163)][_0x31dbf2(0x190)]!==_0x20614b[_0x31dbf2(0x190)])return console[_0x31dbf2(0x1cb)](a5_0x1acfce['red'](_0x31dbf2(0x1a2)+_0x475728[_0x31dbf2(0x163)][_0x31dbf2(0x190)]+_0x31dbf2(0x1b9)+_0x20614b[_0x31dbf2(0x190)]+'\x22.')),console[_0x31dbf2(0x1cb)](a5_0x1acfce['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x45dcc7=new Set(_0x475728[_0x31dbf2(0x159)][_0x31dbf2(0x1a1)](_0x118209=>_0x118209[_0x31dbf2(0x16f)])),_0x4520d3=_0x37256f[_0x31dbf2(0x156)][_0x31dbf2(0x15c)](_0x23927b=>!_0x45dcc7[_0x31dbf2(0x166)](_0x23927b['name']));if(_0x4520d3[_0x31dbf2(0x1ef)]>0x0&&_0x475728[_0x31dbf2(0x1bb)]!==_0x1c6e97)return console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x178))),console['log'](a5_0x1acfce[_0x31dbf2(0x1ee)](_0x31dbf2(0x18b)+_0x475728[_0x31dbf2(0x1bb)]+_0x31dbf2(0x1bd)+_0x1c6e97+'\x22.')),console[_0x31dbf2(0x1cb)](a5_0x1acfce['dim'](_0x31dbf2(0x1ca)+_0x475728['site']+_0x31dbf2(0x1e3))),0x1;const _0x2a5e03=_0x37256f[_0x31dbf2(0x156)][_0x31dbf2(0x15c)](_0x2c2920=>_0x45dcc7['has'](_0x2c2920[_0x31dbf2(0x16b)])),_0x81fd68=_0x4520d3;let _0x4dd153;try{_0x4dd153=await setupEvaluatorAgent(_0x582a7d['llm'],_0x57d96b['verbose']);}catch(_0x6bfd6b){const _0x4883ac=_0x6bfd6b instanceof Error?_0x6bfd6b['message']:String(_0x6bfd6b);return console[_0x31dbf2(0x1cb)](a5_0x1acfce['red'](_0x31dbf2(0x18d)+_0x4883ac)),0x1;}console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1d6)](_0x31dbf2(0x1eb))),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x179)+a5_0x1acfce[_0x31dbf2(0x16a)](_0x475728[_0x31dbf2(0x1c1)])),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1d3)+a5_0x1acfce[_0x31dbf2(0x16a)](_0x475728[_0x31dbf2(0x163)]['projectName']+'/'+_0x475728[_0x31dbf2(0x163)][_0x31dbf2(0x190)]));_0x81fd68[_0x31dbf2(0x1ef)]>0x0&&console[_0x31dbf2(0x1cb)](_0x31dbf2(0x165)+a5_0x1acfce['yellow'](_0x81fd68['length']));console[_0x31dbf2(0x1cb)]();const _0x2dd544=[],_0x4902a7=Date['now'](),_0x3d58ea=createCommandSpinner(_0x31dbf2(0x1b5));if(_0x2a5e03[_0x31dbf2(0x1ef)]>0x0)try{const _0x5534fd=await reevaluateFromCache(_0x582a7d[_0x31dbf2(0x168)],_0x475728,{'tests':_0x2a5e03},{'evaluatorId':_0x4dd153,'onTestStart':(_0x31128f,_0x1d35da,_0x28bb9c)=>{const _0xae30b1=_0x31dbf2;_0x3d58ea[_0xae30b1(0x19c)]=_0xae30b1(0x1f0)+(_0x1d35da+0x1)+'/'+_0x28bb9c+':\x20'+_0x31128f+'...';if(!_0x3d58ea['isSpinning'])_0x3d58ea[_0xae30b1(0x1ba)]();},'onTestComplete':(_0x5a4953,_0x303713)=>{const _0x1654da=_0x31dbf2;_0x3d58ea[_0x1654da(0x161)]();if(_0x303713[_0x1654da(0x1c9)]===_0x1654da(0x19a))console['log'](a5_0x1acfce[_0x1654da(0x1b1)]('✓\x20PASS:\x20'+_0x5a4953)+a5_0x1acfce[_0x1654da(0x1ee)](_0x1654da(0x1a3)));else _0x303713['status']===_0x1654da(0x19b)?console[_0x1654da(0x1cb)](a5_0x1acfce[_0x1654da(0x1ce)]('✗\x20FAIL:\x20'+_0x5a4953+_0x1654da(0x1e9)+_0x303713[_0x1654da(0x158)])+a5_0x1acfce['dim'](_0x1654da(0x1a3))):console[_0x1654da(0x1cb)](a5_0x1acfce[_0x1654da(0x1ce)](_0x1654da(0x198)+_0x5a4953+_0x1654da(0x1e9)+_0x303713['reason']));_0x303713[_0x1654da(0x191)]&&console['log'](a5_0x1acfce[_0x1654da(0x1ee)](_0x1654da(0x184)+_0x303713[_0x1654da(0x191)])),_0x2dd544[_0x1654da(0x172)](_0x303713);},'onTestSkipped':(_0x204dea,_0x804663)=>{const _0x58dfb5=_0x31dbf2;_0x3d58ea[_0x58dfb5(0x161)](),console[_0x58dfb5(0x1cb)](a5_0x1acfce['yellow'](_0x58dfb5(0x160)+_0x204dea+'\x20-\x20'+_0x804663));}});for(const _0x593480 of _0x5534fd){!_0x2dd544[_0x31dbf2(0x1c0)](_0x1a6295=>_0x1a6295['name']===_0x593480[_0x31dbf2(0x16b)])&&_0x2dd544[_0x31dbf2(0x172)](_0x593480);}}catch(_0x151e26){_0x3d58ea[_0x31dbf2(0x161)]();const _0x2019c9=_0x151e26 instanceof Error?_0x151e26[_0x31dbf2(0x1b8)]:String(_0x151e26);return console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x18a)+_0x2019c9)),0x1;}_0x3d58ea['stop']();if(_0x81fd68[_0x31dbf2(0x1ef)]>0x0){console[_0x31dbf2(0x1cb)](),console[_0x31dbf2(0x1cb)](a5_0x1acfce['cyan'](_0x31dbf2(0x1c2)));const {projectId:_0x5e9eb6,agentId:_0x66ed63}=_0x475728['agent'];for(const _0x45a70f of _0x81fd68){console[_0x31dbf2(0x1cb)]('Running:\x20'+a5_0x1acfce[_0x31dbf2(0x16a)](_0x45a70f[_0x31dbf2(0x16b)]));const _0x247a87=createCommandSpinner(_0x31dbf2(0x1ac)+_0x45a70f[_0x31dbf2(0x1e5)][_0x31dbf2(0x1ef)]+':\x20Sending\x20user\x20input...');_0x247a87[_0x31dbf2(0x1ba)]();try{const {result:_0x20be5d}=await runTest(_0x582a7d[_0x31dbf2(0x168)],_0x45a70f,{'agentId':_0x66ed63,'projectId':_0x5e9eb6,'site':_0x475728[_0x31dbf2(0x1bb)],'noEval':![],'evaluatorId':_0x4dd153,'onRoundStart':(_0x132d9b,_0x596f7d)=>{const _0x4a419e=_0x31dbf2;_0x247a87['text']=_0x4a419e(0x173)+(_0x132d9b+0x1)+'/'+_0x596f7d+_0x4a419e(0x1be);},'onRoundComplete':(_0x146683,_0x3f5c45,_0x3627f4)=>{const _0x45c39f=_0x31dbf2,_0x306a57=formatElapsed(_0x3f5c45);_0x3627f4?console['log']('\x20\x20Round\x20'+(_0x146683+0x1)+'/'+_0x45a70f[_0x45c39f(0x1e5)][_0x45c39f(0x1ef)]+'...\x20'+a5_0x1acfce['green']('✓')+'\x20('+_0x306a57+')'):console[_0x45c39f(0x1cb)](_0x45c39f(0x185)+(_0x146683+0x1)+'/'+_0x45a70f[_0x45c39f(0x1e5)]['length']+'...\x20'+a5_0x1acfce['red']('✗'));},'onEvaluationStart':()=>{const _0x194747=_0x31dbf2;_0x247a87['text']=_0x194747(0x1bf);},'onEvaluationComplete':_0x8e2415=>{const _0x425903=_0x31dbf2,_0x15ca74=formatElapsed(_0x8e2415);console['log'](_0x425903(0x1cf)+a5_0x1acfce['green']('✓')+'\x20('+_0x15ca74+')');}});_0x247a87[_0x31dbf2(0x161)](),_0x2dd544[_0x31dbf2(0x172)](_0x20be5d);if(_0x20be5d[_0x31dbf2(0x1c9)]===_0x31dbf2(0x19a))console['log'](a5_0x1acfce[_0x31dbf2(0x1b1)](_0x31dbf2(0x1d4)+_0x20be5d[_0x31dbf2(0x158)])+a5_0x1acfce[_0x31dbf2(0x1ee)]('\x20(new)'));else _0x20be5d[_0x31dbf2(0x1c9)]===_0x31dbf2(0x19b)?console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x1f3)+_0x20be5d['reason'])+a5_0x1acfce[_0x31dbf2(0x1ee)]('\x20(new)')):console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x198)+_0x20be5d['reason']));_0x20be5d[_0x31dbf2(0x191)]&&console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ee)]('\x20\x20Conversation:\x20'+_0x20be5d['conversation_url']));}catch(_0x511872){_0x247a87[_0x31dbf2(0x161)]();const _0x584165=_0x511872 instanceof Error?_0x511872[_0x31dbf2(0x1b8)]:String(_0x511872);console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x198)+_0x584165)),_0x2dd544['push']({'name':_0x45a70f['name'],'status':_0x31dbf2(0x1e1),'reason':_0x584165,'timestamp':new Date()[_0x31dbf2(0x15a)](),'duration_ms':0x0});}}}console[_0x31dbf2(0x1cb)]();const _0x1a4cef=Date['now']()-_0x4902a7,_0x541d61=_0x2dd544['filter'](_0x1705db=>_0x1705db['status']===_0x31dbf2(0x19a))[_0x31dbf2(0x1ef)],_0x30d147=_0x2dd544[_0x31dbf2(0x15c)](_0x2526f0=>_0x2526f0[_0x31dbf2(0x1c9)]===_0x31dbf2(0x19b))['length'],_0x204728=_0x2dd544[_0x31dbf2(0x15c)](_0x4f1423=>_0x4f1423[_0x31dbf2(0x1c9)]===_0x31dbf2(0x1e1))[_0x31dbf2(0x1ef)];console[_0x31dbf2(0x1cb)]('━'[_0x31dbf2(0x1b7)](0x3c)),console[_0x31dbf2(0x1cb)]('Re-evaluation\x20Summary'),console[_0x31dbf2(0x1cb)]('━'['repeat'](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x2dd544[_0x31dbf2(0x1ef)]),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1e8)+a5_0x1acfce[_0x31dbf2(0x1b1)](_0x541d61)),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1b2)+a5_0x1acfce[_0x31dbf2(0x1ce)](_0x30d147));_0x204728>0x0&&console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1d9)+a5_0x1acfce[_0x31dbf2(0x1ce)](_0x204728));console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1a7)+formatElapsed(_0x1a4cef)),console[_0x31dbf2(0x1cb)]('━'[_0x31dbf2(0x1b7)](0x3c));const _0x3594d1={'summary':{'total':_0x2dd544[_0x31dbf2(0x1ef)],'passed':_0x541d61,'failed':_0x30d147,'errors':_0x204728>0x0?_0x204728:undefined,'duration_ms':_0x1a4cef},'tests':_0x2dd544,'agent':{'project':_0x20614b[_0x31dbf2(0x197)],'name':_0x20614b[_0x31dbf2(0x190)],'site':_0x1c6e97},'timestamp':new Date(_0x4902a7)[_0x31dbf2(0x15a)]()};if(_0x385354!==_0x31dbf2(0x1c4)||_0x4d33a7){const _0xab7c70=formatResults(_0x3594d1,_0x385354);if(_0x4d33a7)try{a5_0x4b70d2[_0x31dbf2(0x1e2)](_0x4d33a7,_0xab7c70,_0x31dbf2(0x182)),console[_0x31dbf2(0x1cb)](),console['log'](a5_0x1acfce[_0x31dbf2(0x1ee)](_0x31dbf2(0x1b0)+_0x4d33a7));}catch(_0x416cd2){return console[_0x31dbf2(0x1cb)](),console[_0x31dbf2(0x1cb)](a5_0x1acfce['red'](_0x31dbf2(0x16c)+_0x416cd2)),0x1;}else console[_0x31dbf2(0x1cb)](),console[_0x31dbf2(0x1cb)](_0xab7c70);}const _0x41f550=_0x2dd544[_0x31dbf2(0x15c)](_0x169533=>_0x169533[_0x31dbf2(0x1c9)]!==_0x31dbf2(0x19a));return _0x41f550[_0x31dbf2(0x1ef)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a6_0x8334(){const _0x39d4a9=['en-US','outputStructured','2366236azQkXH','message','length','(default)','\x20credits','padStart','Unknown\x20error','Last\x20Used','toFixed','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','json','shouldShowSources','credits','log','all','toLocaleTimeString','2246495hSeIqg','Requests','Credits','todayCredits','source','padEnd','bold','21364461ikFlBH','3971751nkgBbZ','round','profile','127921frNDmY','repeat','Usage\x20by\x20Source','description','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','execute','jsonl','short','Today','default','\x20\x20Total:\x20\x20\x20','2nwkNBx','monthCredits','4263488xSmbdX','\x20\x20Month:\x20\x20\x20','error','name','max','entryCount','\x20days\x20ago','outputTable','3twmiMg','\x20\x20Today:\x20\x20\x20','cyan','dim','resolve','getTime','en-CA','format','Source','totalCredits','map','toLocaleDateString','552174qrOdus','red','today\x20','profileCount','usage','never','lastUsedAt','\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','2-digit'];a6_0x8334=function(){return _0x39d4a9;};return a6_0x8334();}const a6_0x1d1502=a6_0x14c6;(function(_0x1a54bd,_0x844f1f){const _0x2ef982=a6_0x14c6,_0xbac0ac=_0x1a54bd();while(!![]){try{const _0x5c95b5=parseInt(_0x2ef982(0xc1))/0x1*(parseInt(_0x2ef982(0xcc))/0x2)+parseInt(_0x2ef982(0x8f))/0x3*(-parseInt(_0x2ef982(0xa6))/0x4)+-parseInt(_0x2ef982(0xb6))/0x5+parseInt(_0x2ef982(0x9b))/0x6+-parseInt(_0x2ef982(0xbe))/0x7+-parseInt(_0x2ef982(0xce))/0x8+parseInt(_0x2ef982(0xbd))/0x9;if(_0x5c95b5===_0x844f1f)break;else _0xbac0ac['push'](_0xbac0ac['shift']());}catch(_0x4b0227){_0xbac0ac['push'](_0xbac0ac['shift']());}}}(a6_0x8334,0x6e7f0));import a6_0x219101 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x271a0b){const _0x523bc1=a6_0x14c6;return _0x271a0b[_0x523bc1(0xae)](0x2);}function formatLastUsed(_0x1cc9b0){const _0x218bf9=a6_0x14c6;if(!_0x1cc9b0)return _0x218bf9(0xa0);const _0x545803=new Date(_0x1cc9b0),_0xf04336=new Date(),_0x54bdb9=_0x545803[_0x218bf9(0x9a)](_0x218bf9(0x95)),_0x47245a=_0xf04336[_0x218bf9(0x9a)](_0x218bf9(0x95));if(_0x54bdb9===_0x47245a)return _0x218bf9(0x9d)+_0x545803[_0x218bf9(0xb5)](_0x218bf9(0xa4),{'hour':_0x218bf9(0xa3),'minute':_0x218bf9(0xa3)});const _0x5146db=new Date(_0x54bdb9),_0x2a79f8=new Date(_0x47245a),_0x3d4097=Math[_0x218bf9(0xbf)]((_0x2a79f8[_0x218bf9(0x94)]()-_0x5146db['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x3d4097===0x1)return'yesterday';else return _0x3d4097>0x1&&_0x3d4097<0x7?_0x3d4097+_0x218bf9(0x8d):_0x545803['toLocaleDateString']('en-US',{'month':_0x218bf9(0xc8),'day':'numeric'});}function a6_0x14c6(_0x58600f,_0x4d0877){_0x58600f=_0x58600f-0x8a;const _0x833463=a6_0x8334();let _0x14c639=_0x833463[_0x58600f];return _0x14c639;}export class AIUsageCommandBase extends BaseCommand{[a6_0x1d1502(0x8a)]=a6_0x1d1502(0x9f);[a6_0x1d1502(0xc4)]='Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile';async[a6_0x1d1502(0xc6)](_0x4faaba){const _0x32652d=a6_0x1d1502,{options:_0x214a58}=_0x4faaba,_0x26adf8=_0x214a58[_0x32652d(0x96)]===_0x32652d(0xb0)||_0x214a58['format']===_0x32652d(0xc7)||_0x214a58['json'];try{const [_0x27a488,_0x58bf95,_0x3189a1]=await Promise[_0x32652d(0xb4)]([getAllProfileStats(),this[_0x32652d(0xb1)]()?getAllSourceStats():Promise[_0x32652d(0x93)]([]),getUsageSummary()]);return _0x26adf8?await this[_0x32652d(0xa5)](_0x27a488,_0x58bf95,_0x3189a1,_0x214a58):this['outputTable'](_0x27a488,_0x58bf95,_0x3189a1),0x0;}catch(_0x24cee3){const _0x37777d=_0x24cee3 instanceof Error?_0x24cee3[_0x32652d(0xa7)]:_0x32652d(0xac);return console[_0x32652d(0xd0)](a6_0x219101[_0x32652d(0x9c)]('Error:\x20'+_0x37777d)),0x1;}}async[a6_0x1d1502(0xa5)](_0x136325,_0x19e07c,_0x3034e5,_0x27e9d3){const _0x480450=a6_0x1d1502,_0x16d525={'summary':{'todayCredits':_0x3034e5[_0x480450(0xb9)],'monthCredits':_0x3034e5[_0x480450(0xcd)],'totalCredits':_0x3034e5['totalCredits'],'profileCount':_0x3034e5[_0x480450(0x9e)]},'profiles':_0x136325[_0x480450(0x99)](_0x5a91d8=>({'profile':_0x5a91d8[_0x480450(0xc0)],'credits':_0x5a91d8[_0x480450(0xb2)],'requests':_0x5a91d8[_0x480450(0x8c)],'lastUsedAt':_0x5a91d8['lastUsedAt']}))};this[_0x480450(0xb1)]()&&(_0x16d525['sources']=_0x19e07c[_0x480450(0x99)](_0x5bed00=>({'source':_0x5bed00[_0x480450(0xba)],'credits':_0x5bed00[_0x480450(0xb2)],'todayCredits':_0x5bed00[_0x480450(0xb9)],'monthCredits':_0x5bed00['monthCredits'],'requests':_0x5bed00[_0x480450(0x8c)]}))),await handleSDKOutput([_0x16d525],_0x27e9d3);}[a6_0x1d1502(0x8e)](_0x315dc2,_0x3565b6,_0x26c10b){const _0x5882d4=a6_0x1d1502;console[_0x5882d4(0xb3)](a6_0x219101['bold'](_0x5882d4(0xaf))),console[_0x5882d4(0xb3)](a6_0x219101['dim']('─'['repeat'](0x32))),console[_0x5882d4(0xb3)](_0x5882d4(0x90)+a6_0x219101[_0x5882d4(0x91)](formatCredits(_0x26c10b['todayCredits']))+_0x5882d4(0xaa)),console[_0x5882d4(0xb3)](_0x5882d4(0xcf)+a6_0x219101['cyan'](formatCredits(_0x26c10b[_0x5882d4(0xcd)]))+_0x5882d4(0xaa)),console[_0x5882d4(0xb3)](_0x5882d4(0xcb)+a6_0x219101[_0x5882d4(0x91)](formatCredits(_0x26c10b[_0x5882d4(0x98)]))+_0x5882d4(0xaa)),console[_0x5882d4(0xb3)]();if(this[_0x5882d4(0xb1)]()&&_0x3565b6[_0x5882d4(0xa8)]>0x0){console['log'](a6_0x219101['bold'](_0x5882d4(0xc3))),console['log'](a6_0x219101[_0x5882d4(0x92)]('─'[_0x5882d4(0xc2)](0x3c)));const _0x2fd9ce=0xc,_0x19cd63=0xa,_0x4500b1=0xa,_0x108a52=0xa;console[_0x5882d4(0xb3)]('\x20\x20'+_0x5882d4(0x97)[_0x5882d4(0xbb)](_0x2fd9ce)+'\x20\x20'+'Total'[_0x5882d4(0xab)](_0x19cd63)+'\x20\x20'+_0x5882d4(0xc9)[_0x5882d4(0xab)](_0x4500b1)+'\x20\x20'+'Month'['padStart'](_0x108a52));for(const _0x2eb41e of _0x3565b6){console[_0x5882d4(0xb3)]('\x20\x20'+_0x2eb41e[_0x5882d4(0xba)]['padEnd'](_0x2fd9ce)+'\x20\x20'+a6_0x219101[_0x5882d4(0x91)](formatCredits(_0x2eb41e[_0x5882d4(0xb2)])[_0x5882d4(0xab)](_0x19cd63))+'\x20\x20'+formatCredits(_0x2eb41e[_0x5882d4(0xb9)])['padStart'](_0x4500b1)+'\x20\x20'+formatCredits(_0x2eb41e['monthCredits'])[_0x5882d4(0xab)](_0x108a52));}console[_0x5882d4(0xb3)]();}if(_0x315dc2[_0x5882d4(0xa8)]===0x0){console[_0x5882d4(0xb3)](a6_0x219101['dim'](_0x5882d4(0xc5))),console[_0x5882d4(0xb3)](a6_0x219101[_0x5882d4(0x92)]('\x20\x20Run\x20\x22'+this['getCommandName']()+_0x5882d4(0xa2)));return;}console['log'](a6_0x219101[_0x5882d4(0xbc)]('Usage\x20by\x20Profile')),console['log'](a6_0x219101['dim']('─'[_0x5882d4(0xc2)](0x3c)));const _0x2f6225=Math[_0x5882d4(0x8b)](0xc,..._0x315dc2[_0x5882d4(0x99)](_0x2af341=>_0x2af341['profile']===_0x5882d4(0xca)?_0x5882d4(0xa9)[_0x5882d4(0xa8)]:_0x2af341[_0x5882d4(0xc0)][_0x5882d4(0xa8)])),_0x5d91c8=0xa,_0x407aec=0xa;console[_0x5882d4(0xb3)]('\x20\x20'+'Profile'[_0x5882d4(0xbb)](_0x2f6225)+'\x20\x20'+_0x5882d4(0xb8)['padStart'](_0x5d91c8)+'\x20\x20'+_0x5882d4(0xb7)['padStart'](_0x407aec)+'\x20\x20'+_0x5882d4(0xad));for(const _0x3670f6 of _0x315dc2){const _0x3204f9=_0x3670f6[_0x5882d4(0xc0)]===_0x5882d4(0xca)?_0x5882d4(0xa9):_0x3670f6['profile'],_0x316710=_0x3204f9[_0x5882d4(0xbb)](_0x2f6225),_0x5d3f8b=_0x3670f6[_0x5882d4(0xc0)]===_0x5882d4(0xca)?a6_0x219101[_0x5882d4(0x92)](_0x316710):_0x316710;console[_0x5882d4(0xb3)]('\x20\x20'+_0x5d3f8b+'\x20\x20'+a6_0x219101['cyan'](formatCredits(_0x3670f6['credits'])[_0x5882d4(0xab)](_0x5d91c8))+'\x20\x20'+String(_0x3670f6['entryCount'])[_0x5882d4(0xab)](_0x407aec)+'\x20\x20'+a6_0x219101[_0x5882d4(0x92)](formatLastUsed(_0x3670f6[_0x5882d4(0xa1)])));}console[_0x5882d4(0xb3)](),console[_0x5882d4(0xb3)](a6_0x219101['dim']('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x5882d4(0xb3)]();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a7_0x1e1254=a7_0x1c83;function a7_0x2f26(){const _0xdecd0b=['data','trim','toUpperCase','\x0aStack\x20trace:\x0a','length','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','2427956SWTalA','execute','Invalid\x20header\x20format:\x20\x22','1296756tlqGVm','8oGRtxf','has','headers','join','llm-proxy','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','43248aqfkCo','api','file','color','80ceBwFe','stack','GET','message','cdp','PATCH','workflow','101739CZbVIL','request','verbose','log','isArray','authorization','readBodyFromFile','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','keys','cookie','.\x20Valid\x20methods:\x20','indexOf','entries','2oSXJrz','output','Invalid\x20HTTP\x20method:\x20','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','DELETE','cas','PUT','noColor','name','trino','Error:\x20','substring','2520420gzwrXJ','description','includes','x-xsrf-token','941007EsalmV','\x22.\x20','6EhPUYk','Invalid\x20API\x20type:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','body','llm','startsWith','status','x-auth-token','error','set-cookie2','1587605MLDaRg','type','method'];a7_0x2f26=function(){return _0xdecd0b;};return a7_0x2f26();}(function(_0x1a3637,_0x177412){const _0x3eadb0=a7_0x1c83,_0x5a93aa=_0x1a3637();while(!![]){try{const _0x41c726=parseInt(_0x3eadb0(0xf0))/0x1+parseInt(_0x3eadb0(0x108))/0x2*(parseInt(_0x3eadb0(0xd1))/0x3)+parseInt(_0x3eadb0(0xe6))/0x4+parseInt(_0x3eadb0(0xdd))/0x5*(-parseInt(_0x3eadb0(0xd3))/0x6)+-parseInt(_0x3eadb0(0xcd))/0x7+parseInt(_0x3eadb0(0xea))/0x8*(parseInt(_0x3eadb0(0xe9))/0x9)+parseInt(_0x3eadb0(0xf4))/0xa*(-parseInt(_0x3eadb0(0xfb))/0xb);if(_0x41c726===_0x177412)break;else _0x5a93aa['push'](_0x5a93aa['shift']());}catch(_0x444600){_0x5a93aa['push'](_0x5a93aa['shift']());}}}(a7_0x2f26,0x57041));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a7_0x1c83(_0x37d376,_0x344889){_0x37d376=_0x37d376-0xc2;const _0x2f2601=a7_0x2f26();let _0x1c8340=_0x2f2601[_0x37d376];return _0x1c8340;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a7_0x1e1254(0x100),'proxy-authorization',a7_0x1e1254(0x104),'set-cookie',a7_0x1e1254(0xdc),a7_0x1e1254(0xd0),a7_0x1e1254(0xda),'x-trino-user']);function isSensitiveHeader(_0xed7f4d){const _0x709c2c=a7_0x1e1254;return SENSITIVE_HEADERS[_0x709c2c(0xeb)](_0xed7f4d['toLowerCase']());}function parseHeader(_0x260499){const _0x3f5f2d=a7_0x1e1254,_0x3d0d99=_0x260499[_0x3f5f2d(0x106)](':');if(_0x3d0d99===-0x1)throw new Error(_0x3f5f2d(0xe8)+_0x260499+_0x3f5f2d(0xd2)+_0x3f5f2d(0xc4));const _0x31f49f=_0x260499['substring'](0x0,_0x3d0d99)[_0x3f5f2d(0xe1)](),_0x19d84e=_0x260499[_0x3f5f2d(0xcc)](_0x3d0d99+0x1)['trim']();if(!_0x31f49f)throw new Error(_0x3f5f2d(0xe5)+_0x260499+'\x22');return[_0x31f49f,_0x19d84e];}export class ApiCommand extends BaseCommand{[a7_0x1e1254(0xc9)]=a7_0x1e1254(0xf1);[a7_0x1e1254(0xce)]=a7_0x1e1254(0xef);['validate'](_0x3fa4ed){const _0x498936=a7_0x1e1254,{args:_0x15a7b3,options:_0x3d17e2}=_0x3fa4ed,_0x4167f5=_0x3d17e2;if(_0x15a7b3[_0x498936(0xe4)]===0x0)return _0x498936(0xd5);const _0x21e0e9=_0x15a7b3[0x0];if(!_0x21e0e9[_0x498936(0xd8)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x21e0e9;const _0x1f7825=_0x4167f5[_0x498936(0xe0)],_0x4fb389=_0x4167f5[_0x498936(0xf2)];if(_0x1f7825&&_0x4fb389)return _0x498936(0x102);const _0x1b87f0=_0x4167f5[_0x498936(0xdf)]||_0x498936(0xf6),_0x370b75=['GET','POST',_0x498936(0xc7),_0x498936(0xc5),_0x498936(0xf9)];if(!_0x370b75[_0x498936(0xcf)](_0x1b87f0[_0x498936(0xe2)]()))return _0x498936(0xc2)+_0x1b87f0+_0x498936(0x105)+_0x370b75[_0x498936(0xed)](',\x20');const _0x2220ea=_0x4167f5[_0x498936(0xde)]||'td',_0xe4671c=['td',_0x498936(0xf8),_0x498936(0xfa),_0x498936(0xca),_0x498936(0xd7),_0x498936(0xee),_0x498936(0xc6)];if(!_0xe4671c[_0x498936(0xcf)](_0x2220ea))return _0x498936(0xd4)+_0x2220ea+'.\x20Valid\x20types:\x20'+_0xe4671c[_0x498936(0xed)](',\x20');return undefined;}async[a7_0x1e1254(0xe7)](_0x3b5e75){const _0x152ee6=a7_0x1e1254,{options:_0x172a27,args:_0x4d2991,tdx:_0x28ca58}=_0x3b5e75,_0x11057d=_0x172a27,_0x2c70ba=_0x4d2991[0x0],_0x4f3140=(_0x11057d[_0x152ee6(0xdf)]||_0x152ee6(0xf6))['toUpperCase'](),_0x341721=_0x11057d['data'],_0xde367b=_0x11057d['file'],_0x307aed=_0x11057d['header'],_0x389743=_0x11057d[_0x152ee6(0xde)]||'td';try{const _0x48b952={};if(_0x307aed){const _0x4d930c=Array[_0x152ee6(0xff)](_0x307aed)?_0x307aed:[_0x307aed];for(const _0x28caf7 of _0x4d930c){const [_0x5dda42,_0x554e42]=parseHeader(_0x28caf7);_0x48b952[_0x5dda42]=_0x554e42;}}let _0x38310d;if(_0x341721)_0x38310d=_0x341721;else{if(_0xde367b)try{_0x38310d=RawAPI[_0x152ee6(0x101)](_0xde367b);}catch(_0x4b0bbc){return console['error']('Error:\x20'+(_0x4b0bbc instanceof Error?_0x4b0bbc[_0x152ee6(0xf7)]:String(_0x4b0bbc))),0x1;}}const _0x4cd184={'method':_0x4f3140,'apiType':_0x389743,'includeHeaders':_0x172a27[_0x152ee6(0xfd)]};_0x38310d&&(_0x4cd184[_0x152ee6(0xd6)]=_0x38310d);Object[_0x152ee6(0x103)](_0x48b952)[_0x152ee6(0xe4)]>0x0&&(_0x4cd184[_0x152ee6(0xec)]=_0x48b952);if(_0x172a27[_0x152ee6(0xfd)]){const _0x201577=resolveSite(_0x172a27['site']??'us01'),_0x312fb3=getEndpoint(_0x201577,_0x389743),_0xd3ced2=''+_0x312fb3+_0x2c70ba;console[_0x152ee6(0xdb)]('>\x20'+_0x4f3140+'\x20'+_0xd3ced2);const _0x2b2dba=getAuthHeaders(_0x201577),_0x1c7b87={..._0x2b2dba,..._0x48b952};for(const [_0x13b9c1,_0x223c11]of Object['entries'](_0x1c7b87)){!isSensitiveHeader(_0x13b9c1)&&console['error']('>\x20'+_0x13b9c1+':\x20'+_0x223c11);}_0x38310d&&console[_0x152ee6(0xdb)]('>'),console[_0x152ee6(0xdb)]('');}const _0x2b08be=await _0x28ca58['api'][_0x152ee6(0xfc)](_0x2c70ba,_0x4cd184);if(_0x172a27[_0x152ee6(0xfd)]&&_0x2b08be[_0x152ee6(0xec)]){console[_0x152ee6(0xdb)]('<\x20HTTP/1.1\x20'+_0x2b08be[_0x152ee6(0xd9)]);for(const [_0x1c04ee,_0x2eaacf]of Object[_0x152ee6(0x107)](_0x2b08be['headers'])){!isSensitiveHeader(_0x1c04ee)&&console[_0x152ee6(0xdb)]('<\x20'+_0x1c04ee+':\x20'+_0x2eaacf);}console[_0x152ee6(0xdb)]('');}const _0x2249a3=Boolean(_0x172a27[_0x152ee6(0x109)]),_0x4844ea={'color':_0x172a27[_0x152ee6(0xf3)],'noColor':_0x172a27[_0x152ee6(0xc8)]||_0x2249a3&&!_0x172a27[_0x152ee6(0xf3)]},_0x2a03ca=colorizeJSON(_0x2b08be[_0x152ee6(0xe0)],_0x4844ea);return _0x172a27[_0x152ee6(0x109)]?(writeFileSync(_0x172a27[_0x152ee6(0x109)],_0x2a03ca),console['error'](_0x152ee6(0xc3)+_0x172a27[_0x152ee6(0x109)])):console[_0x152ee6(0xfe)](_0x2a03ca),0x0;}catch(_0x38768a){return _0x38768a instanceof Error?(console[_0x152ee6(0xdb)](_0x152ee6(0xcb)+_0x38768a[_0x152ee6(0xf7)]),_0x172a27[_0x152ee6(0xfd)]&&_0x38768a[_0x152ee6(0xf5)]&&console['error'](_0x152ee6(0xe3)+_0x38768a[_0x152ee6(0xf5)])):console['error']('Error:\x20'+String(_0x38768a)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-command.d.ts","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAShF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAenE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAiFf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,CAmB3E;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,gDAAgD;IAE9D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuHxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmDxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,0CAA0C;IAExD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-command.d.ts","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAShF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAenE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAiFf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,CAmB3E;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,gDAAgD;IAE9D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuHxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmDxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,0CAA0C;IAExD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAWxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,yCAAyC;IAEvD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgCxD"}
|