@treasuredata/tdx 2026.8.2 → 2026.8.4
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/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/p13n-command.d.ts +11 -0
- package/dist/commands/p13n-command.d.ts.map +1 -0
- package/dist/commands/p13n-command.js +1 -0
- package/dist/commands/p13n-command.js.map +1 -0
- 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.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts +9 -1
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/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.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.d.ts +42 -6
- package/dist/sdk/auth-token.d.ts.map +1 -1
- package/dist/sdk/auth-token.js +1 -1
- package/dist/sdk/auth-token.js.map +1 -1
- package/dist/sdk/cas/cas-api-client.d.ts +9 -3
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-api-client.js.map +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-yaml.js +1 -1
- package/dist/sdk/cas/index.d.ts +10 -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.d.ts +6 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.d.ts +11 -2
- package/dist/sdk/client/oauth-refresh.d.ts.map +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/oauth-refresh.js.map +1 -1
- package/dist/sdk/client/p13n-studio-api-client.d.ts +19 -0
- package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -0
- package/dist/sdk/client/p13n-studio-api-client.js +1 -0
- package/dist/sdk/client/p13n-studio-api-client.js.map +1 -0
- 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-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/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/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/p13n-studio.d.ts +13 -0
- package/dist/sdk/p13n-studio.d.ts.map +1 -0
- package/dist/sdk/p13n-studio.js +1 -0
- package/dist/sdk/p13n-studio.js.map +1 -0
- 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/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js.map +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.d.ts +2 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/p13n-studio.d.ts +18 -0
- package/dist/sdk/types/p13n-studio.d.ts.map +1 -0
- package/dist/sdk/types/p13n-studio.js +1 -0
- package/dist/sdk/types/p13n-studio.js.map +1 -0
- 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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x56eec5=a3_0x3e60;(function(_0x4b9344,_0x3a1e07){const _0x1c8385=a3_0x3e60,_0x233810=_0x4b9344();while(!![]){try{const _0x453451=parseInt(_0x1c8385(0xb8))/0x1+parseInt(_0x1c8385(0xc1))/0x2+-parseInt(_0x1c8385(0xd3))/0x3*(-parseInt(_0x1c8385(0xc5))/0x4)+parseInt(_0x1c8385(0xd4))/0x5+parseInt(_0x1c8385(0xc6))/0x6+-parseInt(_0x1c8385(0xc8))/0x7*(parseInt(_0x1c8385(0xd0))/0x8)+parseInt(_0x1c8385(0xc3))/0x9*(-parseInt(_0x1c8385(0xb4))/0xa);if(_0x453451===_0x3a1e07)break;else _0x233810['push'](_0x233810['shift']());}catch(_0x2cfc72){_0x233810['push'](_0x233810['shift']());}}}(a3_0x161d,0xc1568));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x3e60(_0x1cf573,_0x8fb0c8){_0x1cf573=_0x1cf573-0xb2;const _0x161d04=a3_0x161d();let _0x3e6025=_0x161d04[_0x1cf573];return _0x3e6025;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x56eec5(0xcd)]='activations';[a3_0x56eec5(0xb9)]=a3_0x56eec5(0xd2);async[a3_0x56eec5(0xd1)](_0x31a336){const _0x2562d5=a3_0x56eec5,{options:_0x15f834,args:_0x457a22,tdx:_0x482d0b}=_0x31a336;if(_0x457a22['length']===0x0)return console['error'](_0x2562d5(0xca)),console[_0x2562d5(0xbb)](_0x2562d5(0xbd)),0x1;try{const {parentId:_0x5846d6,childId:_0x3df74a}=parseSegmentRef(_0x457a22[0x0]);if(!_0x3df74a)return console['error'](_0x2562d5(0xbc)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x15f834['verbose']&&(console[_0x2562d5(0xbb)]('Site:\x20'+_0x15f834['site']),console[_0x2562d5(0xbb)](_0x2562d5(0xbf)+_0x5846d6),console['error'](_0x2562d5(0xce)+_0x3df74a));const _0x3d0d5e=await withSpinner(_0x2562d5(0xcb)+_0x5846d6+_0x2562d5(0xc2),()=>_0x482d0b[_0x2562d5(0xc7)]['resolveParentId'](_0x5846d6),{'verbose':_0x15f834[_0x2562d5(0xcf)]}),_0x293284=_0x3d0d5e[_0x2562d5(0xb2)];_0x15f834['verbose']&&console[_0x2562d5(0xbb)](_0x2562d5(0xbe)+_0x293284);const _0x435ba6=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x3df74a+_0x2562d5(0xc2),()=>_0x482d0b[_0x2562d5(0xc7)]['resolveSegmentId'](_0x293284,_0x3df74a),{'verbose':_0x15f834['verbose']}),_0x254e52=_0x435ba6[_0x2562d5(0xb2)];_0x15f834['verbose']&&console[_0x2562d5(0xbb)](_0x2562d5(0xc9)+_0x254e52);const _0x803efa=await withSpinner(_0x2562d5(0xb6)+_0x3df74a+'\x27...',()=>_0x482d0b[_0x2562d5(0xc7)][_0x2562d5(0xc4)](_0x293284,_0x254e52),{'verbose':_0x15f834[_0x2562d5(0xcf)]}),_0x3a3b85=_0x803efa[_0x2562d5(0xb2)];return console[_0x2562d5(0xbb)]('✔\x20Found\x20'+_0x3a3b85[_0x2562d5(0xb7)]+_0x2562d5(0xcc)+(_0x3a3b85[_0x2562d5(0xb7)]!==0x1?'s':'')),await handleSDKOutput(_0x3a3b85,_0x15f834),0x0;}catch(_0x55270a){if(_0x55270a instanceof SDKError)return console[_0x2562d5(0xbb)](_0x2562d5(0xb5)+_0x55270a[_0x2562d5(0xc0)]),_0x55270a[_0x2562d5(0xb3)]&&console[_0x2562d5(0xbb)](_0x2562d5(0xba)+_0x55270a[_0x2562d5(0xb3)]),0x1;throw _0x55270a;}}}function a3_0x161d(){const _0x8a19ca=['Resolving\x20parent\x20segment\x20\x27','\x20activation','name','Child\x20name:\x20','verbose','2288xqpgBM','execute','List\x20activations\x20for\x20a\x20segment','6rRfxva','5492500jagojC','data','cause','6842100uHuUGe','Error:\x20','Listing\x20activations\x20for\x20segment\x20\x27','length','787277QFaAZp','description','\x20\x20Cause:\x20','error','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolved\x20parent\x20ID:\x20','Parent\x20name:\x20','message','2330290mjbjyi','\x27...','27OunXPd','listActivations','231092qNejBP','6306960uYJiDO','segment','33607XPrLjN','Resolved\x20child\x20ID:\x20','Error:\x20Segment\x20name\x20is\x20required'];a3_0x161d=function(){return _0x8a19ca;};return a3_0x161d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x36eeb0=a4_0x571a;(function(_0x7d4b47,_0x201f95){const _0x58060e=a4_0x571a,_0x123801=_0x7d4b47();while(!![]){try{const _0x481aa0=-parseInt(_0x58060e(0x205))/0x1+parseInt(_0x58060e(0x261))/0x2+-parseInt(_0x58060e(0x21d))/0x3+-parseInt(_0x58060e(0x21b))/0x4+parseInt(_0x58060e(0x1f9))/0x5+parseInt(_0x58060e(0x1cd))/0x6*(-parseInt(_0x58060e(0x255))/0x7)+parseInt(_0x58060e(0x223))/0x8;if(_0x481aa0===_0x201f95)break;else _0x123801['push'](_0x123801['shift']());}catch(_0x376579){_0x123801['push'](_0x123801['shift']());}}}(a4_0x2003,0x518a7));import a4_0x1f75c6 from'chalk';import a4_0x2c93ff from'path';function a4_0x2003(){const _0x24de6f=['\x20errors','\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','force','yes','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llmProject','dirname','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Agent:\x20','\x20=\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent:clone','-\x20no\x20files\x20written','agent:pull','cwd-config','\x20total','Pulling\x20agent\x20\x22','Using\x20project\x20from\x20','Cloning\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','751499aeWBqN','action','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','site','formInterfaces','cloneProject','name','tdx.json','\x20\x20Source:\x20','\x20\x20Chat\x20Interfaces:\x20','push','234818oeskTg','llm','\x20\x20Integration\x20\x22','\x0aChanges:','cyan','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','join','found','llm_project','Using\x20current\x20project:\x20','Summary:','\x20updated','counts','\x0aPush\x20summary\x20for\x20\x27','projectName','session','Using\x20project\x20from\x20context:\x20','log','yellow','Pushing\x20to\x20project...','INVALID_ARGUMENT','dryRun','repeat','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Agents:\x20','Using\x20context\x20project:\x20','agentId','-\x20nothing\x20pushed','\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','total','red','cwd','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20changed','reason','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20|\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agents','textKnowledgeBases','Errors:','prompts','24FiJzPn','Failed\x20to\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','sourceProjectName','agent:push','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Integrations:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','New\x20project\x20ID:\x20','chatInterfaces','created','Analyzing\x20changes\x20to\x20push...','Would\x20clone:','error','Agent\x20pulled\x20successfully','projectDir','knowledgeBases','\x20--name\x20','✔\x20Context\x20set:\x20','\x0aWrite\x20','New\x20project\x20name\x20is\x20required','pushProject','Source:\x20','\x20files?','Dry\x20run\x20-\x20no\x20changes\x20made','\x20new','new','\x22\x20from\x20project\x20\x22','\x22:\x20','context','\x20resources?','\x20successfully','gray','newProjectName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','parse','\x0aChanges\x20to\x20agent\x20\x27','Agent\x20','experimentalKnowledgeBases','Cancelled','\x20unchanged','3012950oQIgAP','Pushing\x20agent\x20from\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20to\x20\x22','\x20\x20Form\x20Interfaces:\x20','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20Pushed\x20','Status:\x20','unchanged','New\x20project:\x20','628259OyObzg','execute','Output:\x20','\x20\x20Prompt\x20\x22','diff','dim','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','no_context','Dry\x20run\x20-\x20no\x20files\x20written','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','Using\x20project:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Knowledge\x20Bases:\x20','Project:\x20','Analyzing\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','updated','utf-8','projectId','\x20\x20Knowledge\x20Base\x20\x22','536772FksCWs','outputPath','1352034gUNSLn','integrations','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aChanges\x20to\x20chat\x20interface\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\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','10052400SFabSz','outputDir','message','\x20\x20Agent\x20\x22','Project\x20cloned\x20with\x20errors','MISSING_ARGUMENT','\x20files\x20to\x20','\x20\x20Target:\x20','Clone\x20\x22','\x0aError:','pushAgent','\x0aProject\x20pushed\x20with\x20errors','Output\x20path:\x20','\x22...','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','description','Writing\x20files...','agentName','agent.yml','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','green','no_local_folder','profile','experimentalArtifacts','errors','Chat:\x20','\x20\x20Form\x20Interface\x20\x22'];a4_0x2003=function(){return _0x24de6f;};return a4_0x2003();}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x3e27b6){const _0x31a8a4=a4_0x571a,_0x442319=[];if(_0x3e27b6[_0x31a8a4(0x1c0)]!==undefined)_0x442319[_0x31a8a4(0x260)](_0x3e27b6['total']+_0x31a8a4(0x250));if(_0x3e27b6['new']!==undefined&&_0x3e27b6[_0x31a8a4(0x1ea)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6[_0x31a8a4(0x1ea)]+_0x31a8a4(0x1e9)));if(_0x3e27b6[_0x31a8a4(0x1da)]!==undefined&&_0x3e27b6[_0x31a8a4(0x1da)]>0x0)_0x442319['push'](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6['created']+'\x20created'));if(_0x3e27b6[_0x31a8a4(0x217)]!==undefined&&_0x3e27b6[_0x31a8a4(0x217)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['yellow'](_0x3e27b6[_0x31a8a4(0x217)]+_0x31a8a4(0x26d)));if(_0x3e27b6[_0x31a8a4(0x203)]!==undefined&&_0x3e27b6[_0x31a8a4(0x203)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['gray'](_0x3e27b6['unchanged']+_0x31a8a4(0x1f8)));if(_0x3e27b6[_0x31a8a4(0x23b)]!==undefined&&_0x3e27b6[_0x31a8a4(0x23b)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['red'](_0x3e27b6[_0x31a8a4(0x23b)]+_0x31a8a4(0x23e)));return _0x442319[_0x31a8a4(0x268)](',\x20');}function displayDiffs(_0x2ffa4f,_0x9d833f,_0x4f4331,_0x276b1c,_0x5e58de,_0x4b72e1,_0x1d1914,_0x22bd58,_0x2cc75d){const _0x2742ba=a4_0x571a;for(const _0xc17d05 of _0x2ffa4f){if(_0xc17d05[_0x2742ba(0x209)]){const _0x4521fd=_0xc17d05[_0x2742ba(0x234)]||_0xc17d05['name'];console[_0x2742ba(0x1b4)](_0x2742ba(0x1f4)+_0x4521fd+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0xc17d05[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c));}}for(const _0x1e899d of _0x9d833f){_0x1e899d[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20b)+_0x1e899d[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1e899d[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x2a50b1 of _0x4f4331){_0x2a50b1['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x24b)+_0x2a50b1[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x2a50b1[_0x2742ba(0x209)]),console['log']('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x31e068 of _0x276b1c){_0x31e068[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x211)+_0x31e068['name']+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0x31e068[_0x2742ba(0x209)]),console['log']('─'['repeat'](0x3c)));}for(const _0x4362d5 of _0x5e58de){_0x4362d5[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20f)+_0x4362d5[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x4362d5[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x47e612 of _0x4b72e1){_0x47e612['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x254)+_0x47e612[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x47e612[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x3b9cea of _0x1d1914){_0x3b9cea[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x3b9cea[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x3b9cea[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x1f33a4 of _0x22bd58){_0x1f33a4[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x1d3)+_0x1f33a4[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1f33a4[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x4256c6 of _0x2cc75d){_0x4256c6['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x220)+_0x4256c6[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console['log'](_0x4256c6[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}}function a4_0x571a(_0x1c5970,_0x2394ca){_0x1c5970=_0x1c5970-0x1b3;const _0x200383=a4_0x2003();let _0x571a67=_0x200383[_0x1c5970];return _0x571a67;}export class AgentPullCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24e);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x266);async[a4_0x36eeb0(0x206)](_0x1912e5){const _0x4d2025=a4_0x36eeb0,{options:_0x17e537,args:_0x102bde,tdx:_0x241ce6}=_0x1912e5,_0xc525fe=_0x102bde[0x0],_0x2b2200=_0x102bde[0x1],_0x45a4a4=_0x17e537['output'],_0x4b7962=_0x17e537['dryRun'],_0x4f60de=_0x17e537[_0x4d2025(0x240)],_0x42bd8d=_0x17e537[_0x4d2025(0x241)],_0x4adb41=_0x17e537[_0x4d2025(0x243)],_0xb23fe0=_0x17e537[_0x4d2025(0x24a)];let _0x996e9d;if(_0xc525fe){const _0x37deb7=a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d));if(existsSync(_0x37deb7))try{const _0x16cf47=JSON[_0x4d2025(0x1f3)](readFileSync(_0x37deb7,'utf-8'));_0x16cf47['llm_project']&&(_0x996e9d={'llm_project':_0x16cf47[_0x4d2025(0x26a)]});}catch{}}const _0x5b0d25=findAgentConfigPath(process['cwd']());let _0x35361b;if(_0x5b0d25)try{const _0x49b6a9=JSON['parse'](readFileSync(_0x5b0d25,_0x4d2025(0x218)));_0x49b6a9[_0x4d2025(0x26a)]&&(_0x35361b={'llm_project':_0x49b6a9['llm_project']});}catch{}const _0x2f0b25=resolveAgentPullArgs({'arg':_0xc525fe,'agentNameArg':_0x2b2200,'agentFlag':_0xb23fe0,'contextProject':_0x4adb41,'argDirConfig':_0x996e9d,'cwdConfigPath':_0x5b0d25||undefined,'cwdConfig':_0x35361b}),{projectNameOrId:_0x3c2128,targetAgentName:_0x35d92d,existingOutputDir:_0x30c015,source:_0x49297c}=_0x2f0b25;if(_0x49297c==='arg-dir')console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x252)+a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d))+':\x20'+_0x3c2128));else{if(_0x49297c===_0x4d2025(0x24f))console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x210)+_0x3c2128));else _0x49297c===_0x4d2025(0x1ed)&&console['log'](a4_0x1f75c6['dim'](_0x4d2025(0x1b3)+_0x3c2128));}if(!_0x3c2128)return _0xb23fe0?(console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1ff))),console[_0x4d2025(0x1b4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x4d2025(0x1b4)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x1f75c6['yellow'](_0x4d2025(0x221))),console['log'](_0x4d2025(0x231)),console[_0x4d2025(0x1b4)](_0x4d2025(0x23f)),console['log'](_0x4d2025(0x1bf)),console[_0x4d2025(0x1b4)](_0x4d2025(0x222)),console[_0x4d2025(0x1b4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x35d92d){const {data:_0x522451}=await withSpinner(_0x4d2025(0x251)+_0x35d92d+_0x4d2025(0x1eb)+_0x3c2128+'\x22...',()=>_0x241ce6[_0x4d2025(0x262)]['pullAgent'](_0x3c2128,_0x35d92d,_0x45a4a4,{'dryRun':_0x4b7962,'force':_0x4f60de}));if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x20d))),console[_0x4d2025(0x1b4)](_0x4d2025(0x1cf)+_0x522451['agentName']),console[_0x4d2025(0x1b4)](_0x4d2025(0x22f)+_0x522451[_0x4d2025(0x21c)]),_0x522451['diff']&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x264)),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c)),console[_0x4d2025(0x1b4)](_0x522451[_0x4d2025(0x209)]),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c))),0x0;return console['log'](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1de))),console[_0x4d2025(0x1b4)](_0x4d2025(0x246)+_0x522451[_0x4d2025(0x234)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x207)+_0x522451[_0x4d2025(0x21c)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x202)+(_0x522451['isNew']?a4_0x1f75c6[_0x4d2025(0x237)]('new'):_0x522451['hasChanges']?a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x217)):a4_0x1f75c6[_0x4d2025(0x1f0)](_0x4d2025(0x203)))),0x0;}const _0x161b62=_0x30c015||_0x45a4a4,{data:_0x195aee}=await withSpinner(_0x4d2025(0x215)+_0x3c2128+_0x4d2025(0x230),()=>_0x241ce6['llm'][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'dryRun':!![]})),_0x237059=_0x195aee['counts'][_0x4d2025(0x1c9)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)][_0x4d2025(0x1ea)]+_0x195aee['counts'][_0x4d2025(0x1ca)]['new']+_0x195aee['counts'][_0x4d2025(0x1cc)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)]['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)]['formInterfaces']['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x1ea)],_0x3570e2=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)]['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)][_0x4d2025(0x217)]+_0x195aee['counts']['prompts'][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)]['integrations']['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x25a)][_0x4d2025(0x217)]+_0x195aee['counts'][_0x4d2025(0x1d9)][_0x4d2025(0x217)],_0x30bbde=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x1e0)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)]['experimentalKnowledgeBases'][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x25a)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x203)];console['log'](_0x4d2025(0x248)+_0x195aee[_0x4d2025(0x270)]+'\x27:'),console[_0x4d2025(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x4d2025(0x237)]('+\x20'+_0x237059+'\x20new')+_0x4d2025(0x1c7)+a4_0x1f75c6['yellow']('~\x20'+_0x3570e2+'\x20changed')+'\x20|\x20'+a4_0x1f75c6[_0x4d2025(0x20a)]('=\x20'+_0x30bbde+'\x20unchanged')),console['log'](_0x4d2025(0x1bb)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1c9)])),console[_0x4d2025(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)]['knowledgeBases'])),console[_0x4d2025(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1fe)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d6)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)])),console[_0x4d2025(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x195aee['counts']['formInterfaces'])),console[_0x4d2025(0x1b4)](_0x4d2025(0x25f)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)]));const _0x2f1eff=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1c0)]>0x0||_0x195aee['counts'][_0x4d2025(0x23a)]['total']>0x0;_0x2f1eff&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x267)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1f6)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d5)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x23a)])));console[_0x4d2025(0x1b4)](_0x4d2025(0x22a)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x224)])),displayDiffs(_0x195aee[_0x4d2025(0x1c9)],_0x195aee[_0x4d2025(0x1e0)],_0x195aee[_0x4d2025(0x1ca)],_0x195aee[_0x4d2025(0x1cc)],_0x195aee[_0x4d2025(0x21e)],_0x195aee[_0x4d2025(0x1f6)],_0x195aee[_0x4d2025(0x23a)],_0x195aee[_0x4d2025(0x25a)],_0x195aee[_0x4d2025(0x1d9)]);if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x237059===0x0&&_0x3570e2===0x0)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1c8))),saveSessionContext({'llm_project':_0x195aee['projectName']},_0x17e537['session']),console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+_0x4d2025(0x247)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x270)]))),0x0;if(!_0x42bd8d&&!_0x4f60de){if(!isInteractive())return console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x1c1)](_0x4d2025(0x22c)),_0x4d2025(0x1fb)),console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x200))),0x1;const _0x22799e=await confirmKey(_0x4d2025(0x1e3)+(_0x237059+_0x3570e2)+_0x4d2025(0x1e7));if(!_0x22799e)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1f7)),_0x4d2025(0x24d)),0x1;}const {data:_0x2c0eba}=await withSpinner(_0x4d2025(0x233),()=>_0x241ce6[_0x4d2025(0x262)][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'force':_0x4f60de}));return console['log'](a4_0x1f75c6[_0x4d2025(0x237)]('\x0a✔\x20Pulled\x20'+(_0x237059+_0x3570e2)+_0x4d2025(0x229)+_0x2c0eba[_0x4d2025(0x224)])),saveSessionContext({'llm_project':_0x2c0eba[_0x4d2025(0x270)]},_0x17e537[_0x4d2025(0x271)]),console['log'](a4_0x1f75c6['green'](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+'\x20=\x20'+a4_0x1f75c6['cyan'](_0x2c0eba[_0x4d2025(0x270)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24c);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x212);async['execute'](_0x13c57e){const _0x30a963=a4_0x36eeb0,{options:_0x2463bf,args:_0x279c0e,tdx:_0x4443aa}=_0x13c57e,_0x4a6d51=_0x279c0e[0x0],_0x386488=_0x2463bf[_0x30a963(0x25c)],_0x27038c=_0x2463bf[_0x30a963(0x1b8)],_0x33f833=_0x2463bf['yes'],_0x21636a=_0x2463bf['site'],_0x43ee3c=_0x2463bf['llmProject'];let _0x28f999;const _0x466f5b=findAgentConfigPath(process['cwd']());if(_0x4a6d51){const _0x35dbe1=a4_0x2c93ff['join'](_0x4a6d51,'tdx.json');existsSync(_0x35dbe1)?(_0x28f999=_0x4a6d51,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x20e)+_0x4a6d51))):_0x28f999=_0x4a6d51;}else{if(_0x466f5b)_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x466f5b),console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x26b)+_0x28f999));else{if(_0x43ee3c){const _0x10c8a4=sanitizeForFilesystem(_0x43ee3c);let _0x3b2ffe=_0x10c8a4,_0x149d78=a4_0x2c93ff['join'](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0x10c8a4,'tdx.json');if(!existsSync(_0x149d78)){const _0xf5f5c8=normalizeName(_0x43ee3c),_0x6b659=a4_0x2c93ff[_0x30a963(0x268)](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0xf5f5c8,'tdx.json');existsSync(_0x6b659)&&(_0x3b2ffe=_0xf5f5c8,_0x149d78=_0x6b659);}if(existsSync(_0x149d78))_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x149d78),console['log'](a4_0x1f75c6[_0x30a963(0x20a)]('Using\x20local\x20project:\x20'+_0x28f999));else{const _0x412223=_0x2463bf[_0x30a963(0x239)];if(_0x412223)throw new SDKError(ErrorCode[_0x30a963(0x1b7)],_0x30a963(0x1f2)+_0x43ee3c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x30a963(0x236)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x43ee3c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b2ffe+_0x30a963(0x1e1)+(_0x386488||'<new-name>')+'\x20--profile\x20'+_0x412223)});_0x28f999=_0x43ee3c,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x1bc)+_0x43ee3c));}}}}if(!_0x28f999)return console['log'](a4_0x1f75c6[_0x30a963(0x1b5)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x30a963(0x1b4)](_0x30a963(0x1c3)),console[_0x30a963(0x1b4)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x30a963(0x1b4)](_0x30a963(0x1c6)),console[_0x30a963(0x1b4)](_0x30a963(0x258)),0x1;if(!_0x386488)throw new SDKError(ErrorCode[_0x30a963(0x228)],_0x30a963(0x1e4),undefined,{'helpText':_0x30a963(0x242)});if(!_0x33f833&&!_0x27038c){if(!isInteractive())return console[_0x30a963(0x1dd)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x22c)),_0x30a963(0x1fb)),console['error'](a4_0x1f75c6['dim'](_0x30a963(0x200))),0x1;const _0x45d3d1=await confirmKey(_0x30a963(0x22b)+_0x28f999+'\x22\x20to\x20new\x20project\x20\x22'+_0x386488+'\x22?');if(!_0x45d3d1)return console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1f7))),0x1;}const {data:_0x1ac9c5}=await withSpinner(_0x30a963(0x253)+_0x28f999+_0x30a963(0x1fc)+_0x386488+_0x30a963(0x230),()=>_0x4443aa[_0x30a963(0x262)][_0x30a963(0x25b)](_0x28f999,_0x386488,{'dryRun':_0x27038c}));if(_0x27038c){console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1e8))),console['log']('Source:\x20'+_0x1ac9c5['sourceProjectName']),console['log'](_0x30a963(0x204)+_0x386488),console['log'](_0x30a963(0x1dc)),console[_0x30a963(0x1b4)]('\x20\x20Agents:\x20'+_0x1ac9c5['counts'][_0x30a963(0x1c9)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x213)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)][_0x30a963(0x1da)]),console['log'](_0x30a963(0x1fe)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x25a)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)][_0x30a963(0x1da)]);const _0x28e77f=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x1da)]>0x0;return _0x28e77f&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1d5)+_0x1ac9c5['counts']['experimentalArtifacts'][_0x30a963(0x1da)])),0x0;}const _0x50063c=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)]['errors']>0x0||_0x1ac9c5['counts'][_0x30a963(0x1cc)]['errors']>0x0||_0x1ac9c5['counts']['formInterfaces']['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['chatInterfaces'][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x23b)]>0x0;_0x50063c?console[_0x30a963(0x1b4)](a4_0x1f75c6['yellow'](_0x30a963(0x227))):console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x237)]('Project\x20cloned\x20successfully'));console[_0x30a963(0x1b4)](_0x30a963(0x1e6)+_0x1ac9c5[_0x30a963(0x1d0)]),console['log'](_0x30a963(0x204)+_0x1ac9c5[_0x30a963(0x1f1)]),console['log'](_0x30a963(0x1d8)+_0x1ac9c5['newProjectId']),console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](_0x30a963(0x26c)),console['log'](_0x30a963(0x1bb)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)])),console[_0x30a963(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)])),console[_0x30a963(0x1b4)](_0x30a963(0x1fe)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)])),console[_0x30a963(0x1b4)](_0x30a963(0x1d6)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)]['integrations'])),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x25a)])),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)]));const _0x584ccd=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['created']>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalKnowledgeBases'][_0x30a963(0x203)]>0x0||_0x1ac9c5['counts'][_0x30a963(0x23a)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x203)]>0x0;_0x584ccd&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x1f6)])),console[_0x30a963(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)])));if(_0x50063c){console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](a4_0x1f75c6['red'](_0x30a963(0x1cb)));for(const _0x1b0ba2 of _0x1ac9c5[_0x30a963(0x1c9)]){_0x1b0ba2['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6['red']('\x20\x20Agent\x20\x22'+_0x1b0ba2[_0x30a963(0x234)]+_0x30a963(0x1ec)+_0x1b0ba2[_0x30a963(0x1dd)]));}for(const _0x23d550 of _0x1ac9c5[_0x30a963(0x1e0)]){_0x23d550[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x21a)+_0x23d550[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x23d550['error']));}for(const _0x42834d of _0x1ac9c5[_0x30a963(0x1cc)]){_0x42834d['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Prompt\x20\x22'+_0x42834d[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x42834d[_0x30a963(0x1dd)]));}for(const _0x352944 of _0x1ac9c5[_0x30a963(0x21e)]){_0x352944[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x263)+_0x352944[_0x30a963(0x25c)]+'\x22:\x20'+_0x352944[_0x30a963(0x1dd)]));}for(const _0x168df6 of _0x1ac9c5[_0x30a963(0x25a)]){_0x168df6[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x23d)+_0x168df6[_0x30a963(0x25c)]+'\x22:\x20'+_0x168df6[_0x30a963(0x1dd)]));}for(const _0x31afc4 of _0x1ac9c5['chatInterfaces']){_0x31afc4[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Chat\x20Interface\x20\x22'+_0x31afc4['name']+_0x30a963(0x1ec)+_0x31afc4[_0x30a963(0x1dd)]));}for(const _0x30dae1 of _0x1ac9c5[_0x30a963(0x1f6)]){_0x30dae1[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x249)+_0x30dae1[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x30dae1[_0x30a963(0x1dd)]));}for(const _0x570b50 of _0x1ac9c5[_0x30a963(0x23a)]){_0x570b50[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x570b50[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x570b50['error']));}return 0x1;}console[_0x30a963(0x1b4)]();const _0x4dbb4d=getLLMProjectUrl(_0x21636a,_0x1ac9c5['newProjectId']);return console['log']('Project:\x20'+a4_0x1f75c6[_0x30a963(0x265)](_0x4dbb4d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x1d1);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x257);async[a4_0x36eeb0(0x206)](_0x56df93){const _0x31f9fe=a4_0x36eeb0,{options:_0x53655b,args:_0x500f33,tdx:_0x15cf94}=_0x56df93;let _0x1521b8=_0x500f33[0x0]||process[_0x31f9fe(0x1c2)]();const _0x222b1d=_0x53655b[_0x31f9fe(0x1b8)],_0x504701=_0x53655b[_0x31f9fe(0x240)],_0x3514f7=_0x53655b[_0x31f9fe(0x241)],_0x59bd9e=_0x53655b[_0x31f9fe(0x259)],_0x101197=a4_0x2c93ff[_0x31f9fe(0x268)](_0x1521b8,_0x31f9fe(0x235)),_0x52f1e5=existsSync(_0x101197);if(_0x52f1e5){const {data:_0x221a1e}=await withSpinner(_0x31f9fe(0x1fa)+_0x1521b8+_0x31f9fe(0x230),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x22d)](_0x1521b8,{'dryRun':_0x222b1d,'force':_0x504701}));if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x31f9fe(0x1b4)]('Would\x20push\x20agent:\x20'+_0x221a1e['agentName']),0x0;if(_0x221a1e[_0x31f9fe(0x256)]==='error')return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ce)+_0x221a1e['error'])),0x1;console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x1f5)+_0x221a1e[_0x31f9fe(0x256)]+_0x31f9fe(0x1ef))),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x246)+_0x221a1e['agentName']);if(_0x221a1e['agentId']&&_0x221a1e[_0x31f9fe(0x219)]){const _0x43bd0a=getLLMAgentChatUrl(_0x59bd9e,_0x221a1e[_0x31f9fe(0x219)],_0x221a1e[_0x31f9fe(0x1bd)]);console['log'](_0x31f9fe(0x23c)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x43bd0a));}return 0x0;}const _0x14c8a7=_0x53655b[_0x31f9fe(0x243)],_0x5904f5=resolveProjectFromContext(_0x1521b8,_0x14c8a7);if(_0x5904f5[_0x31f9fe(0x269)])_0x1521b8=_0x5904f5[_0x31f9fe(0x1df)],_0x5904f5['source']===_0x31f9fe(0x1ed)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['dim']('Using\x20project:\x20'+_0x1521b8));else{let _0x337af1='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x238)&&(_0x337af1=_0x5904f5[_0x31f9fe(0x225)]+_0x31f9fe(0x245)+_0x5904f5[_0x31f9fe(0x243)]+_0x31f9fe(0x21f));throw new SDKError(ErrorCode[_0x31f9fe(0x1b7)],_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x20c)?_0x5904f5[_0x31f9fe(0x225)]:_0x31f9fe(0x216)+_0x1521b8,undefined,{'helpText':_0x337af1});}const {data:_0x52bb31}=await withSpinner(_0x31f9fe(0x1db),()=>_0x15cf94[_0x31f9fe(0x262)]['pushProject'](_0x1521b8,{'dryRun':!![]})),_0x4d0448=_0x52bb31['counts'][_0x31f9fe(0x1c9)][_0x31f9fe(0x23b)]>0x0;if(_0x4d0448){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aErrors\x20found:'));for(const _0x53787 of _0x52bb31[_0x31f9fe(0x1c9)]){_0x53787[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x53787[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x53787[_0x31f9fe(0x1dd)]));}return 0x1;}const _0x1c9622=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x1da)]+_0x52bb31['counts']['knowledgeBases'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1ca)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)]['prompts'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x21e)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x25a)]['created']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]['created'],_0x1ae29a=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1e0)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x217)]+_0x52bb31['counts']['prompts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['updated']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)]['updated']+_0x52bb31['counts']['experimentalArtifacts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)]['formInterfaces'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)][_0x31f9fe(0x217)],_0x522a16=_0x52bb31[_0x31f9fe(0x26e)]['agents'][_0x31f9fe(0x203)]+_0x52bb31['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x25a)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)]['chatInterfaces']['unchanged'];console[_0x31f9fe(0x1b4)](_0x31f9fe(0x26f)+_0x52bb31[_0x31f9fe(0x270)]+'\x27:'),console[_0x31f9fe(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x31f9fe(0x237)]('+\x20'+_0x1c9622+_0x31f9fe(0x1e9))+_0x31f9fe(0x1c7)+a4_0x1f75c6[_0x31f9fe(0x1b5)]('~\x20'+_0x1ae29a+_0x31f9fe(0x1c4))+'\x20|\x20'+a4_0x1f75c6[_0x31f9fe(0x20a)]('=\x20'+_0x522a16+_0x31f9fe(0x1f8))),console[_0x31f9fe(0x1b4)]('\x20\x20Agents:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1e0)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d2)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['textKnowledgeBases'])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1fe)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1cc)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d6)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)])),console[_0x31f9fe(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x25a)])),console['log'](_0x31f9fe(0x25f)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]));const _0x562b2c=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]>0x0||_0x52bb31['counts'][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x203)]>0x0;_0x562b2c&&(console[_0x31f9fe(0x1b4)](_0x31f9fe(0x267)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1f6)])),console[_0x31f9fe(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'])));console[_0x31f9fe(0x1b4)](_0x31f9fe(0x25e)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x1521b8)),displayDiffs(_0x52bb31['agents'],_0x52bb31[_0x31f9fe(0x1e0)],_0x52bb31['textKnowledgeBases'],_0x52bb31[_0x31f9fe(0x1cc)],_0x52bb31[_0x31f9fe(0x21e)],_0x52bb31['experimentalKnowledgeBases'],_0x52bb31[_0x31f9fe(0x23a)],_0x52bb31[_0x31f9fe(0x25a)],_0x52bb31[_0x31f9fe(0x1d9)]);if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1c9622===0x0&&_0x1ae29a===0x0){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4384a0=getLLMProjectUrl(_0x59bd9e,_0x52bb31[_0x31f9fe(0x219)]);return console['log']('Project:\x20'+a4_0x1f75c6['cyan'](_0x4384a0)),0x0;}if(!_0x3514f7&&!_0x504701){if(!isInteractive())return console['error'](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x1f75c6['dim'](_0x31f9fe(0x200))),0x1;const _0x41da07=await confirmKey('\x0aPush\x20'+(_0x1c9622+_0x1ae29a)+_0x31f9fe(0x1ee));if(!_0x41da07)return console['log'](a4_0x1f75c6['yellow'](_0x31f9fe(0x1f7)),_0x31f9fe(0x1be)),0x1;}const {data:_0x51a762}=await withSpinner(_0x31f9fe(0x1b6),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x1e5)](_0x1521b8,{'force':_0x504701})),_0x4910cf=_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)]['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)]['formInterfaces']['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1d9)][_0x31f9fe(0x23b)]>0x0;if(_0x4910cf){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)](_0x31f9fe(0x22e))),console[_0x31f9fe(0x1b4)](),console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x1cb)));for(const _0x58a0c2 of _0x51a762[_0x31f9fe(0x1c9)]){_0x58a0c2[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x58a0c2[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x58a0c2[_0x31f9fe(0x1dd)]));}for(const _0x136b45 of _0x51a762[_0x31f9fe(0x1e0)]){_0x136b45[_0x31f9fe(0x256)]==='error'&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x136b45['name']+_0x31f9fe(0x1ec)+_0x136b45[_0x31f9fe(0x1dd)]));}for(const _0x256516 of _0x51a762['textKnowledgeBases']){_0x256516[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1d7)+_0x256516[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x256516[_0x31f9fe(0x1dd)]));}for(const _0x1dda2b of _0x51a762[_0x31f9fe(0x1cc)]){_0x1dda2b[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x208)+_0x1dda2b[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x1dda2b['error']));}for(const _0x12aa59 of _0x51a762[_0x31f9fe(0x21e)]){_0x12aa59[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x263)+_0x12aa59[_0x31f9fe(0x25c)]+'\x22:\x20'+_0x12aa59[_0x31f9fe(0x1dd)]));}for(const _0x2c6502 of _0x51a762[_0x31f9fe(0x25a)]){_0x2c6502['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x23d)+_0x2c6502['name']+_0x31f9fe(0x1ec)+_0x2c6502['error']));}for(const _0x2db326 of _0x51a762[_0x31f9fe(0x1d9)]){_0x2db326['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ba)+_0x2db326[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x2db326[_0x31f9fe(0x1dd)]));}return 0x1;}console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x201)+(_0x1c9622+_0x1ae29a)+'\x20resources\x20to\x20\x27'+_0x51a762[_0x31f9fe(0x270)]+'\x27'));const _0x2094a6=getLLMProjectUrl(_0x59bd9e,_0x51a762[_0x31f9fe(0x219)]);return console[_0x31f9fe(0x1b4)](_0x31f9fe(0x214)+a4_0x1f75c6['cyan'](_0x2094a6)),0x0;}}
|
|
1
|
+
const a4_0x4e336e=a4_0x6fd4;(function(_0x159ad9,_0x27d226){const _0x27bbf3=a4_0x6fd4,_0x22779b=_0x159ad9();while(!![]){try{const _0x40ce77=parseInt(_0x27bbf3(0x200))/0x1*(parseInt(_0x27bbf3(0x23a))/0x2)+-parseInt(_0x27bbf3(0x1f0))/0x3+-parseInt(_0x27bbf3(0x1e0))/0x4*(parseInt(_0x27bbf3(0x1a9))/0x5)+parseInt(_0x27bbf3(0x1ee))/0x6*(parseInt(_0x27bbf3(0x1aa))/0x7)+-parseInt(_0x27bbf3(0x1b7))/0x8+-parseInt(_0x27bbf3(0x1f4))/0x9*(parseInt(_0x27bbf3(0x1f1))/0xa)+parseInt(_0x27bbf3(0x1a3))/0xb;if(_0x40ce77===_0x27d226)break;else _0x22779b['push'](_0x22779b['shift']());}catch(_0x39ef02){_0x22779b['push'](_0x22779b['shift']());}}}(a4_0x5de7,0x8d6c7));import a4_0x201e29 from'chalk';import a4_0x5aae92 from'path';function a4_0x6fd4(_0x262231,_0x5cf455){_0x262231=_0x262231-0x188;const _0x5de7ab=a4_0x5de7();let _0x6fd476=_0x5de7ab[_0x262231];return _0x6fd476;}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_0x5de7(){const _0x5084c0=['projectDir','Agent\x20pulled\x20successfully','dryRun','chatInterfaces','\x0aProject\x20pushed\x20with\x20errors','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','parse','experimentalKnowledgeBases','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agent:clone','arg-dir','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','projectId','agent:push','-\x20nothing\x20pushed','\x22:\x20','\x22...','Dry\x20run\x20-\x20no\x20changes\x20made','924906pVxtYb','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Bases:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20new','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)','prompts','\x20resources\x20to\x20\x27','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20Prompts:\x20','created','agent.yml','\x22\x20to\x20a\x20different\x20profile','no_local_folder','\x20\x20Prompt\x20\x22','Analyzing\x20changes\x20to\x20push...','Writing\x20files...','\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','hasChanges','new','\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','dim','Failed\x20to\x20push\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','projectName','\x20\x20Source:\x20','Using\x20local\x20project:\x20','pushAgent','\x0a✔\x20Pulled\x20','\x0aErrors\x20found:','Agent:\x20','message','newProjectId','\x20\x20Agent\x20\x22','cyan','Chat:\x20','formInterfaces','source','Dry\x20run\x20-\x20no\x20files\x20written','\x20created','join','cloneProject','New\x20project\x20name\x20is\x20required','\x20\x20Text\x20Knowledge\x20Bases:\x20','4529041GZsgIt','green','agents','Project\x20cloned\x20successfully','\x20\x20Integration\x20\x22','action','1718810oJhdKZ','7lvlLyF','\x20files?','Would\x20pull\x20agent:\x20','Clone\x20\x22','pushProject','integrations','llm_project','\x20changed','log','agent:pull','Would\x20push\x20agent:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','reason','1927224xnBYvy','textKnowledgeBases','✔\x20Context\x20set:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Status:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','context','cwd','found','yes','counts','knowledgeBases','push','Would\x20clone:','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Chat\x20Interface\x20\x22','yellow','MISSING_ARGUMENT','gray','force','\x20=\x20','\x0aWrite\x20','Agent\x20','name','output','Cancelled','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','utf-8','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Using\x20current\x20project:\x20','site','<new-name>','cwd-config','\x20\x20Form\x20Interfaces:\x20','INVALID_ARGUMENT','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','4CPtjRl','\x20resources?','\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','\x0a✔\x20Pushed\x20','New\x20project:\x20','\x20\x20Agents:\x20','\x22\x20to\x20\x22','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Integrations:\x20','\x20successfully','updated','\x0aPull\x20summary\x20for\x20\x27','\x0aPush\x20summary\x20for\x20\x27','Output\x20path:\x20','1098540MRuuRN','\x20updated','841509POfDRR','125480xHiuBq','total','errors','54yhnLla','agentName','\x20\x20Experimental\x20Artifacts:\x20','tdx.json','repeat','\x0aChanges\x20to\x20integration\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Analyzing\x20project\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','no_context','Using\x20context\x20project:\x20','Project:\x20','2uLBcnG','description','Pulling\x20agent\x20\x22','isNew','pullProject','red','dirname','outputDir','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x0aError:','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','execute','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20unchanged','llm','No\x20tdx.json\x20found\x20in\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','experimentalArtifacts','\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)','Errors:','\x20\x20Target:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aPush\x20','\x20\x20Chat\x20Interfaces:\x20','\x20--profile\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20\x20tdx\x20agent\x20clone\x20agents/','error','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','session','unchanged','agentId','Using\x20project\x20from\x20context:\x20','\x20|\x20','llmProject','profile','diff'];a4_0x5de7=function(){return _0x5084c0;};return a4_0x5de7();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x563e76){const _0x4f2b23=a4_0x6fd4,_0x263c7a=[];if(_0x563e76['total']!==undefined)_0x263c7a[_0x4f2b23(0x1c4)](_0x563e76[_0x4f2b23(0x1f2)]+'\x20total');if(_0x563e76[_0x4f2b23(0x188)]!==undefined&&_0x563e76[_0x4f2b23(0x188)]>0x0)_0x263c7a[_0x4f2b23(0x1c4)](a4_0x201e29[_0x4f2b23(0x1a4)](_0x563e76['new']+'\x20new'));if(_0x563e76[_0x4f2b23(0x246)]!==undefined&&_0x563e76[_0x4f2b23(0x246)]>0x0)_0x263c7a[_0x4f2b23(0x1c4)](a4_0x201e29['green'](_0x563e76[_0x4f2b23(0x246)]+_0x4f2b23(0x19e)));if(_0x563e76['updated']!==undefined&&_0x563e76[_0x4f2b23(0x1ea)]>0x0)_0x263c7a[_0x4f2b23(0x1c4)](a4_0x201e29[_0x4f2b23(0x1c9)](_0x563e76[_0x4f2b23(0x1ea)]+_0x4f2b23(0x1ef)));if(_0x563e76[_0x4f2b23(0x221)]!==undefined&&_0x563e76[_0x4f2b23(0x221)]>0x0)_0x263c7a['push'](a4_0x201e29['gray'](_0x563e76['unchanged']+_0x4f2b23(0x20d)));if(_0x563e76['errors']!==undefined&&_0x563e76[_0x4f2b23(0x1f3)]>0x0)_0x263c7a['push'](a4_0x201e29['red'](_0x563e76['errors']+'\x20errors'));return _0x263c7a[_0x4f2b23(0x19f)](',\x20');}function displayDiffs(_0x4fb98b,_0x4722b7,_0x564bdd,_0x3003a0,_0x4afeb2,_0x1c5e39,_0x32455f,_0x2987cb,_0x3f556f){const _0x27331c=a4_0x6fd4;for(const _0x16d7f5 of _0x4fb98b){if(_0x16d7f5[_0x27331c(0x227)]){const _0x219b52=_0x16d7f5[_0x27331c(0x1f5)]||_0x16d7f5[_0x27331c(0x1d0)];console[_0x27331c(0x1b2)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x219b52+'\x27:'),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)),console[_0x27331c(0x1b2)](_0x16d7f5['diff']),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c));}}for(const _0x3b5895 of _0x4722b7){_0x3b5895['diff']&&(console[_0x27331c(0x1b2)](_0x27331c(0x1fc)+_0x3b5895[_0x27331c(0x1d0)]+'\x27:'),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)),console['log'](_0x3b5895[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)));}for(const _0x231c46 of _0x564bdd){_0x231c46[_0x27331c(0x227)]&&(console['log'](_0x27331c(0x211)+_0x231c46[_0x27331c(0x1d0)]+'\x27:'),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)),console[_0x27331c(0x1b2)](_0x231c46[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)));}for(const _0x259c1e of _0x3003a0){_0x259c1e[_0x27331c(0x227)]&&(console[_0x27331c(0x1b2)](_0x27331c(0x23c)+_0x259c1e[_0x27331c(0x1d0)]+'\x27:'),console[_0x27331c(0x1b2)]('─'['repeat'](0x3c)),console[_0x27331c(0x1b2)](_0x259c1e[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)));}for(const _0x412344 of _0x4afeb2){_0x412344[_0x27331c(0x227)]&&(console[_0x27331c(0x1b2)](_0x27331c(0x1f9)+_0x412344[_0x27331c(0x1d0)]+'\x27:'),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)),console[_0x27331c(0x1b2)](_0x412344[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)));}for(const _0x38bb9b of _0x1c5e39){_0x38bb9b[_0x27331c(0x227)]&&(console[_0x27331c(0x1b2)](_0x27331c(0x210)+_0x38bb9b[_0x27331c(0x1d0)]+'\x27:'),console[_0x27331c(0x1b2)]('─'['repeat'](0x3c)),console[_0x27331c(0x1b2)](_0x38bb9b[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)));}for(const _0xe42a7 of _0x32455f){_0xe42a7[_0x27331c(0x227)]&&(console['log'](_0x27331c(0x1d5)+_0xe42a7[_0x27331c(0x1d0)]+'\x27:'),console['log']('─'[_0x27331c(0x1f8)](0x3c)),console[_0x27331c(0x1b2)](_0xe42a7[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)));}for(const _0x576570 of _0x2987cb){_0x576570[_0x27331c(0x227)]&&(console[_0x27331c(0x1b2)](_0x27331c(0x21c)+_0x576570['name']+'\x27:'),console['log']('─'[_0x27331c(0x1f8)](0x3c)),console['log'](_0x576570[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'[_0x27331c(0x1f8)](0x3c)));}for(const _0x1543b0 of _0x3f556f){_0x1543b0['diff']&&(console[_0x27331c(0x1b2)](_0x27331c(0x23b)+_0x1543b0[_0x27331c(0x1d0)]+'\x27:'),console[_0x27331c(0x1b2)]('─'['repeat'](0x3c)),console[_0x27331c(0x1b2)](_0x1543b0[_0x27331c(0x227)]),console[_0x27331c(0x1b2)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x4e336e(0x1b3);[a4_0x4e336e(0x201)]=a4_0x4e336e(0x230);async[a4_0x4e336e(0x20b)](_0x396b70){const _0x683df4=a4_0x4e336e,{options:_0x5ab6dc,args:_0x3ce981,tdx:_0xd6633d}=_0x396b70,_0x502c6a=_0x3ce981[0x0],_0x3875bd=_0x3ce981[0x1],_0xf93878=_0x5ab6dc[_0x683df4(0x1d1)],_0x2eb7c9=_0x5ab6dc['dryRun'],_0x508eae=_0x5ab6dc['force'],_0x5c4062=_0x5ab6dc['yes'],_0x31dda0=_0x5ab6dc[_0x683df4(0x225)],_0x6ec17a=_0x5ab6dc[_0x683df4(0x217)];let _0x2d25bb;if(_0x502c6a){const _0x3ee9d0=a4_0x5aae92[_0x683df4(0x19f)](_0x502c6a,'tdx.json');if(existsSync(_0x3ee9d0))try{const _0x39e765=JSON['parse'](readFileSync(_0x3ee9d0,_0x683df4(0x1d6)));_0x39e765['llm_project']&&(_0x2d25bb={'llm_project':_0x39e765[_0x683df4(0x1b0)]});}catch{}}const _0x1b73e6=findAgentConfigPath(process[_0x683df4(0x1bf)]());let _0x45d106;if(_0x1b73e6)try{const _0xcc75bc=JSON[_0x683df4(0x22e)](readFileSync(_0x1b73e6,_0x683df4(0x1d6)));_0xcc75bc[_0x683df4(0x1b0)]&&(_0x45d106={'llm_project':_0xcc75bc[_0x683df4(0x1b0)]});}catch{}const _0x251190=resolveAgentPullArgs({'arg':_0x502c6a,'agentNameArg':_0x3875bd,'agentFlag':_0x6ec17a,'contextProject':_0x31dda0,'argDirConfig':_0x2d25bb,'cwdConfigPath':_0x1b73e6||undefined,'cwdConfig':_0x45d106}),{projectNameOrId:_0x72e0f1,targetAgentName:_0xc03a0f,existingOutputDir:_0x460c94,source:_0xb5ed53}=_0x251190;if(_0xb5ed53===_0x683df4(0x232))console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x18a)]('Using\x20project\x20from\x20'+a4_0x5aae92['join'](_0x502c6a,'tdx.json')+':\x20'+_0x72e0f1));else{if(_0xb5ed53===_0x683df4(0x1dc))console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x18a)]('Using\x20project:\x20'+_0x72e0f1));else _0xb5ed53===_0x683df4(0x1be)&&console[_0x683df4(0x1b2)](a4_0x201e29['dim'](_0x683df4(0x223)+_0x72e0f1));}if(!_0x72e0f1)return _0x6ec17a?(console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x1c9)](_0x683df4(0x1b5))),console[_0x683df4(0x1b2)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x683df4(0x1bb))):(console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x1c9)](_0x683df4(0x208))),console[_0x683df4(0x1b2)](_0x683df4(0x241)),console[_0x683df4(0x1b2)](_0x683df4(0x1e2)),console[_0x683df4(0x1b2)](_0x683df4(0x24d)),console[_0x683df4(0x1b2)](_0x683df4(0x189)),console[_0x683df4(0x1b2)](_0x683df4(0x1d3))),0x1;if(_0xc03a0f){const {data:_0x54e594}=await withSpinner(_0x683df4(0x202)+_0xc03a0f+'\x22\x20from\x20project\x20\x22'+_0x72e0f1+_0x683df4(0x238),()=>_0xd6633d['llm']['pullAgent'](_0x72e0f1,_0xc03a0f,_0xf93878,{'dryRun':_0x2eb7c9,'force':_0x508eae}));if(_0x2eb7c9)return console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x1c9)](_0x683df4(0x19d))),console['log'](_0x683df4(0x1ac)+_0x54e594['agentName']),console['log'](_0x683df4(0x1ed)+_0x54e594['outputPath']),_0x54e594[_0x683df4(0x227)]&&(console['log']('\x0aChanges:'),console[_0x683df4(0x1b2)]('─'[_0x683df4(0x1f8)](0x3c)),console[_0x683df4(0x1b2)](_0x54e594[_0x683df4(0x227)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x1a4)](_0x683df4(0x229))),console[_0x683df4(0x1b2)](_0x683df4(0x195)+_0x54e594[_0x683df4(0x1f5)]),console[_0x683df4(0x1b2)]('Output:\x20'+_0x54e594['outputPath']),console[_0x683df4(0x1b2)](_0x683df4(0x1bc)+(_0x54e594[_0x683df4(0x203)]?a4_0x201e29[_0x683df4(0x1a4)](_0x683df4(0x188)):_0x54e594[_0x683df4(0x24e)]?a4_0x201e29[_0x683df4(0x1c9)](_0x683df4(0x1ea)):a4_0x201e29[_0x683df4(0x1cb)](_0x683df4(0x221)))),0x0;}const _0x144b5e=_0x460c94||_0xf93878,{data:_0x1cff31}=await withSpinner(_0x683df4(0x1fb)+_0x72e0f1+_0x683df4(0x238),()=>_0xd6633d[_0x683df4(0x20e)][_0x683df4(0x204)](_0x72e0f1,_0x144b5e,{'dryRun':!![]})),_0x57f609=_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1a5)]['new']+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1c3)]['new']+_0x1cff31['counts'][_0x683df4(0x1b8)]['new']+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x242)]['new']+_0x1cff31['counts'][_0x683df4(0x1af)][_0x683df4(0x188)]+_0x1cff31['counts'][_0x683df4(0x22f)][_0x683df4(0x188)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x212)][_0x683df4(0x188)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x19b)][_0x683df4(0x188)]+_0x1cff31[_0x683df4(0x1c2)]['chatInterfaces'][_0x683df4(0x188)],_0x33992e=_0x1cff31['counts'][_0x683df4(0x1a5)][_0x683df4(0x1ea)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1c3)][_0x683df4(0x1ea)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1b8)][_0x683df4(0x1ea)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x242)][_0x683df4(0x1ea)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1af)][_0x683df4(0x1ea)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x22f)]['updated']+_0x1cff31[_0x683df4(0x1c2)]['experimentalArtifacts'][_0x683df4(0x1ea)]+_0x1cff31['counts']['formInterfaces'][_0x683df4(0x1ea)]+_0x1cff31[_0x683df4(0x1c2)]['chatInterfaces']['updated'],_0x1ec3ea=_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1a5)]['unchanged']+_0x1cff31[_0x683df4(0x1c2)]['knowledgeBases'][_0x683df4(0x221)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1b8)]['unchanged']+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x242)][_0x683df4(0x221)]+_0x1cff31['counts'][_0x683df4(0x1af)]['unchanged']+_0x1cff31['counts'][_0x683df4(0x22f)][_0x683df4(0x221)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x212)][_0x683df4(0x221)]+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x19b)]['unchanged']+_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x22b)]['unchanged'];console[_0x683df4(0x1b2)](_0x683df4(0x1eb)+_0x1cff31['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x201e29['green']('+\x20'+_0x57f609+'\x20new')+_0x683df4(0x224)+a4_0x201e29[_0x683df4(0x1c9)]('~\x20'+_0x33992e+_0x683df4(0x1b1))+_0x683df4(0x224)+a4_0x201e29['dim']('=\x20'+_0x1ec3ea+_0x683df4(0x20d))),console[_0x683df4(0x1b2)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1a5)])),console['log'](_0x683df4(0x23e)+formatCountSummary(_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1c3)])),console[_0x683df4(0x1b2)](_0x683df4(0x1a2)+formatCountSummary(_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x1b8)])),console[_0x683df4(0x1b2)](_0x683df4(0x245)+formatCountSummary(_0x1cff31[_0x683df4(0x1c2)]['prompts'])),console[_0x683df4(0x1b2)](_0x683df4(0x1e8)+formatCountSummary(_0x1cff31['counts'][_0x683df4(0x1af)])),console[_0x683df4(0x1b2)](_0x683df4(0x1dd)+formatCountSummary(_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x19b)])),console['log'](_0x683df4(0x21a)+formatCountSummary(_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x22b)]));const _0x3958b2=_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x22f)][_0x683df4(0x1f2)]>0x0||_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x212)]['total']>0x0;_0x3958b2&&(console[_0x683df4(0x1b2)](_0x683df4(0x23d)+formatCountSummary(_0x1cff31['counts'][_0x683df4(0x22f)])),console['log'](_0x683df4(0x1f6)+formatCountSummary(_0x1cff31[_0x683df4(0x1c2)][_0x683df4(0x212)])));console[_0x683df4(0x1b2)](_0x683df4(0x215)+a4_0x201e29[_0x683df4(0x199)](_0x1cff31[_0x683df4(0x207)])),displayDiffs(_0x1cff31[_0x683df4(0x1a5)],_0x1cff31['knowledgeBases'],_0x1cff31['textKnowledgeBases'],_0x1cff31[_0x683df4(0x242)],_0x1cff31[_0x683df4(0x1af)],_0x1cff31[_0x683df4(0x22f)],_0x1cff31['experimentalArtifacts'],_0x1cff31[_0x683df4(0x19b)],_0x1cff31[_0x683df4(0x22b)]);if(_0x2eb7c9)return console['log'](a4_0x201e29[_0x683df4(0x1c9)](_0x683df4(0x18c))),0x0;if(_0x57f609===0x0&&_0x33992e===0x0)return console[_0x683df4(0x1b2)](a4_0x201e29['green'](_0x683df4(0x1d8))),saveSessionContext({'llm_project':_0x1cff31['projectName']},_0x5ab6dc[_0x683df4(0x220)]),console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x1a4)](_0x683df4(0x1b9)+a4_0x201e29[_0x683df4(0x18a)](_0x683df4(0x1b0))+_0x683df4(0x1cd)+a4_0x201e29['cyan'](_0x1cff31['projectName']))),0x0;if(!_0x5c4062&&!_0x508eae){if(!isInteractive())return console[_0x683df4(0x21e)](a4_0x201e29['red'](_0x683df4(0x209)),_0x683df4(0x216)),console[_0x683df4(0x21e)](a4_0x201e29[_0x683df4(0x18a)](_0x683df4(0x1df))),0x1;const _0x448077=await confirmKey(_0x683df4(0x1ce)+(_0x57f609+_0x33992e)+_0x683df4(0x1ab));if(!_0x448077)return console[_0x683df4(0x1b2)](a4_0x201e29['yellow'](_0x683df4(0x1d2)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x5a2a21}=await withSpinner(_0x683df4(0x24c),()=>_0xd6633d[_0x683df4(0x20e)][_0x683df4(0x204)](_0x72e0f1,_0x144b5e,{'force':_0x508eae}));return console[_0x683df4(0x1b2)](a4_0x201e29['green'](_0x683df4(0x193)+(_0x57f609+_0x33992e)+'\x20files\x20to\x20'+_0x5a2a21[_0x683df4(0x207)])),saveSessionContext({'llm_project':_0x5a2a21[_0x683df4(0x18f)]},_0x5ab6dc[_0x683df4(0x220)]),console[_0x683df4(0x1b2)](a4_0x201e29[_0x683df4(0x1a4)](_0x683df4(0x1b9)+a4_0x201e29[_0x683df4(0x18a)](_0x683df4(0x1b0))+_0x683df4(0x1cd)+a4_0x201e29[_0x683df4(0x199)](_0x5a2a21['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4e336e(0x1d0)]=a4_0x4e336e(0x231);[a4_0x4e336e(0x201)]=a4_0x4e336e(0x218);async[a4_0x4e336e(0x20b)](_0x1c31e3){const _0x47382e=a4_0x4e336e,{options:_0x5869b1,args:_0x15f018,tdx:_0x3873be}=_0x1c31e3,_0x1f8a0e=_0x15f018[0x0],_0x5b6ef4=_0x5869b1['name'],_0x486c50=_0x5869b1[_0x47382e(0x22a)],_0x56973c=_0x5869b1['yes'],_0x50c544=_0x5869b1[_0x47382e(0x1da)],_0x225d93=_0x5869b1[_0x47382e(0x225)];let _0x149972;const _0x2e57c0=findAgentConfigPath(process[_0x47382e(0x1bf)]());if(_0x1f8a0e){const _0x47e371=a4_0x5aae92['join'](_0x1f8a0e,'tdx.json');existsSync(_0x47e371)?(_0x149972=_0x1f8a0e,console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x18a)](_0x47382e(0x191)+_0x1f8a0e))):_0x149972=_0x1f8a0e;}else{if(_0x2e57c0)_0x149972=a4_0x5aae92[_0x47382e(0x206)](_0x2e57c0),console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x18a)](_0x47382e(0x1d9)+_0x149972));else{if(_0x225d93){const _0x117a5a=sanitizeForFilesystem(_0x225d93);let _0x4cdddf=_0x117a5a,_0x33de57=a4_0x5aae92[_0x47382e(0x19f)](process[_0x47382e(0x1bf)](),'agents',_0x117a5a,_0x47382e(0x1f7));if(!existsSync(_0x33de57)){const _0x5d7bb9=normalizeName(_0x225d93),_0x160edc=a4_0x5aae92['join'](process[_0x47382e(0x1bf)](),'agents',_0x5d7bb9,_0x47382e(0x1f7));existsSync(_0x160edc)&&(_0x4cdddf=_0x5d7bb9,_0x33de57=_0x160edc);}if(existsSync(_0x33de57))_0x149972=a4_0x5aae92['dirname'](_0x33de57),console['log'](a4_0x201e29[_0x47382e(0x18a)]('Using\x20local\x20project:\x20'+_0x149972));else{const _0x3dc8d4=_0x5869b1[_0x47382e(0x226)];if(_0x3dc8d4)throw new SDKError(ErrorCode[_0x47382e(0x1de)],_0x47382e(0x1bd)+_0x225d93+_0x47382e(0x248),undefined,{'helpText':_0x47382e(0x18e)+_0x47382e(0x1e7)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x225d93+'\x0a')+(_0x47382e(0x21d)+_0x4cdddf+'\x20--name\x20'+(_0x5b6ef4||_0x47382e(0x1db))+_0x47382e(0x21b)+_0x3dc8d4)});_0x149972=_0x225d93,console['log'](a4_0x201e29['dim'](_0x47382e(0x1fe)+_0x225d93));}}}}if(!_0x149972)return console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x1c9)](_0x47382e(0x22d))),console[_0x47382e(0x1b2)](_0x47382e(0x20a)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x47382e(0x1b2)](_0x47382e(0x213)),console['log'](_0x47382e(0x18d)),0x1;if(!_0x5b6ef4)throw new SDKError(ErrorCode[_0x47382e(0x1ca)],_0x47382e(0x1a1),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x56973c&&!_0x486c50){if(!isInteractive())return console['error'](a4_0x201e29[_0x47382e(0x205)]('\x0aError:'),_0x47382e(0x216)),console['error'](a4_0x201e29[_0x47382e(0x18a)](_0x47382e(0x1df))),0x1;const _0x353025=await confirmKey(_0x47382e(0x1ad)+_0x149972+_0x47382e(0x1c6)+_0x5b6ef4+'\x22?');if(!_0x353025)return console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x1c9)](_0x47382e(0x1d2))),0x1;}const {data:_0x4e61da}=await withSpinner('Cloning\x20\x22'+_0x149972+_0x47382e(0x1e6)+_0x5b6ef4+_0x47382e(0x238),()=>_0x3873be[_0x47382e(0x20e)][_0x47382e(0x1a0)](_0x149972,_0x5b6ef4,{'dryRun':_0x486c50}));if(_0x486c50){console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x1c9)](_0x47382e(0x239))),console[_0x47382e(0x1b2)]('Source:\x20'+_0x4e61da['sourceProjectName']),console[_0x47382e(0x1b2)](_0x47382e(0x1e4)+_0x5b6ef4),console['log'](_0x47382e(0x1c5)),console[_0x47382e(0x1b2)](_0x47382e(0x1e5)+_0x4e61da[_0x47382e(0x1c2)]['agents'][_0x47382e(0x246)]),console[_0x47382e(0x1b2)](_0x47382e(0x23e)+_0x4e61da['counts'][_0x47382e(0x1c3)][_0x47382e(0x246)]),console[_0x47382e(0x1b2)](_0x47382e(0x245)+_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x242)][_0x47382e(0x246)]),console['log'](_0x47382e(0x1dd)+_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x19b)][_0x47382e(0x246)]),console[_0x47382e(0x1b2)](_0x47382e(0x21a)+_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x22b)][_0x47382e(0x246)]);const _0x5a44be=_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x22f)][_0x47382e(0x246)]>0x0||_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x212)][_0x47382e(0x246)]>0x0;return _0x5a44be&&(console['log'](_0x47382e(0x23d)+_0x4e61da[_0x47382e(0x1c2)]['experimentalKnowledgeBases'][_0x47382e(0x246)]),console[_0x47382e(0x1b2)](_0x47382e(0x1f6)+_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x212)][_0x47382e(0x246)])),0x0;}const _0x5e6ce5=_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x1a5)][_0x47382e(0x1f3)]>0x0||_0x4e61da[_0x47382e(0x1c2)]['knowledgeBases']['errors']>0x0||_0x4e61da['counts'][_0x47382e(0x242)][_0x47382e(0x1f3)]>0x0||_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x19b)][_0x47382e(0x1f3)]>0x0||_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x22b)][_0x47382e(0x1f3)]>0x0||_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x22f)][_0x47382e(0x1f3)]>0x0||_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x212)][_0x47382e(0x1f3)]>0x0;_0x5e6ce5?console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x1c9)]('Project\x20cloned\x20with\x20errors')):console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x1a4)](_0x47382e(0x1a6)));console[_0x47382e(0x1b2)]('Source:\x20'+_0x4e61da['sourceProjectName']),console['log'](_0x47382e(0x1e4)+_0x4e61da['newProjectName']),console[_0x47382e(0x1b2)]('New\x20project\x20ID:\x20'+_0x4e61da[_0x47382e(0x197)]),console['log'](),console[_0x47382e(0x1b2)]('Summary:'),console['log'](_0x47382e(0x1e5)+formatCountSummary(_0x4e61da['counts']['agents'])),console[_0x47382e(0x1b2)](_0x47382e(0x23e)+formatCountSummary(_0x4e61da['counts'][_0x47382e(0x1c3)])),console[_0x47382e(0x1b2)](_0x47382e(0x245)+formatCountSummary(_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x242)])),console[_0x47382e(0x1b2)](_0x47382e(0x1e8)+formatCountSummary(_0x4e61da['counts'][_0x47382e(0x1af)])),console['log'](_0x47382e(0x1dd)+formatCountSummary(_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x19b)])),console[_0x47382e(0x1b2)](_0x47382e(0x21a)+formatCountSummary(_0x4e61da['counts'][_0x47382e(0x22b)]));const _0x5144e1=_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x22f)]['created']>0x0||_0x4e61da[_0x47382e(0x1c2)]['experimentalKnowledgeBases'][_0x47382e(0x1ea)]>0x0||_0x4e61da[_0x47382e(0x1c2)]['experimentalKnowledgeBases'][_0x47382e(0x221)]>0x0||_0x4e61da[_0x47382e(0x1c2)]['experimentalArtifacts'][_0x47382e(0x246)]>0x0||_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x212)][_0x47382e(0x1ea)]>0x0||_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x212)]['unchanged']>0x0;_0x5144e1&&(console[_0x47382e(0x1b2)](_0x47382e(0x23d)+formatCountSummary(_0x4e61da['counts'][_0x47382e(0x22f)])),console[_0x47382e(0x1b2)](_0x47382e(0x1f6)+formatCountSummary(_0x4e61da[_0x47382e(0x1c2)][_0x47382e(0x212)])));if(_0x5e6ce5){console['log'](),console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x205)]('Errors:'));for(const _0x3764a3 of _0x4e61da[_0x47382e(0x1a5)]){_0x3764a3[_0x47382e(0x1a8)]==='error'&&console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x205)](_0x47382e(0x198)+_0x3764a3[_0x47382e(0x1f5)]+_0x47382e(0x237)+_0x3764a3[_0x47382e(0x21e)]));}for(const _0x9490fd of _0x4e61da['knowledgeBases']){_0x9490fd[_0x47382e(0x1a8)]===_0x47382e(0x21e)&&console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x205)](_0x47382e(0x244)+_0x9490fd[_0x47382e(0x1d0)]+_0x47382e(0x237)+_0x9490fd[_0x47382e(0x21e)]));}for(const _0x4122c8 of _0x4e61da['prompts']){_0x4122c8[_0x47382e(0x1a8)]==='error'&&console['log'](a4_0x201e29[_0x47382e(0x205)](_0x47382e(0x24a)+_0x4122c8[_0x47382e(0x1d0)]+_0x47382e(0x237)+_0x4122c8[_0x47382e(0x21e)]));}for(const _0x4c354f of _0x4e61da[_0x47382e(0x1af)]){_0x4c354f[_0x47382e(0x1a8)]==='error'&&console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x205)]('\x20\x20Integration\x20\x22'+_0x4c354f[_0x47382e(0x1d0)]+_0x47382e(0x237)+_0x4c354f[_0x47382e(0x21e)]));}for(const _0x1e3f0a of _0x4e61da['formInterfaces']){_0x1e3f0a['action']===_0x47382e(0x21e)&&console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x205)]('\x20\x20Form\x20Interface\x20\x22'+_0x1e3f0a['name']+_0x47382e(0x237)+_0x1e3f0a[_0x47382e(0x21e)]));}for(const _0x3df580 of _0x4e61da[_0x47382e(0x22b)]){_0x3df580[_0x47382e(0x1a8)]===_0x47382e(0x21e)&&console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x205)](_0x47382e(0x1c8)+_0x3df580[_0x47382e(0x1d0)]+_0x47382e(0x237)+_0x3df580[_0x47382e(0x21e)]));}for(const _0x1b691e of _0x4e61da[_0x47382e(0x22f)]){_0x1b691e[_0x47382e(0x1a8)]==='error'&&console[_0x47382e(0x1b2)](a4_0x201e29[_0x47382e(0x205)](_0x47382e(0x20c)+_0x1b691e['name']+_0x47382e(0x237)+_0x1b691e[_0x47382e(0x21e)]));}for(const _0x3016d7 of _0x4e61da[_0x47382e(0x212)]){_0x3016d7[_0x47382e(0x1a8)]===_0x47382e(0x21e)&&console['log'](a4_0x201e29[_0x47382e(0x205)](_0x47382e(0x1c7)+_0x3016d7['name']+_0x47382e(0x237)+_0x3016d7['error']));}return 0x1;}console['log']();const _0x16a852=getLLMProjectUrl(_0x50c544,_0x4e61da[_0x47382e(0x197)]);return console['log'](_0x47382e(0x1ff)+a4_0x201e29['cyan'](_0x16a852)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x4e336e(0x235);[a4_0x4e336e(0x201)]=a4_0x4e336e(0x1ba);async['execute'](_0x46a409){const _0x4725da=a4_0x4e336e,{options:_0x26d4fc,args:_0xf661a1,tdx:_0xd3d265}=_0x46a409;let _0x4b7b54=_0xf661a1[0x0]||process['cwd']();const _0x50e202=_0x26d4fc['dryRun'],_0x20b925=_0x26d4fc[_0x4725da(0x1cc)],_0x30a93d=_0x26d4fc[_0x4725da(0x1c1)],_0x13a173=_0x26d4fc['site'],_0x301ed3=a4_0x5aae92[_0x4725da(0x19f)](_0x4b7b54,_0x4725da(0x247)),_0x5b4321=existsSync(_0x301ed3);if(_0x5b4321){const {data:_0x2da04f}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x4b7b54+'\x22...',()=>_0xd3d265[_0x4725da(0x20e)][_0x4725da(0x192)](_0x4b7b54,{'dryRun':_0x50e202,'force':_0x20b925}));if(_0x50e202)return console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x1c9)](_0x4725da(0x239))),console['log'](_0x4725da(0x1b4)+_0x2da04f[_0x4725da(0x1f5)]),0x0;if(_0x2da04f[_0x4725da(0x1a8)]===_0x4725da(0x21e))return console['log'](a4_0x201e29[_0x4725da(0x205)](_0x4725da(0x18b)+_0x2da04f[_0x4725da(0x21e)])),0x1;console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x1a4)](_0x4725da(0x1cf)+_0x2da04f[_0x4725da(0x1a8)]+_0x4725da(0x1e9))),console[_0x4725da(0x1b2)](_0x4725da(0x195)+_0x2da04f[_0x4725da(0x1f5)]);if(_0x2da04f[_0x4725da(0x222)]&&_0x2da04f[_0x4725da(0x234)]){const _0x2626d9=getLLMAgentChatUrl(_0x13a173,_0x2da04f['projectId'],_0x2da04f[_0x4725da(0x222)]);console[_0x4725da(0x1b2)](_0x4725da(0x19a)+a4_0x201e29['cyan'](_0x2626d9));}return 0x0;}const _0x1e0aa4=_0x26d4fc['llmProject'],_0x5c394b=resolveProjectFromContext(_0x4b7b54,_0x1e0aa4);if(_0x5c394b[_0x4725da(0x1c0)])_0x4b7b54=_0x5c394b[_0x4725da(0x228)],_0x5c394b[_0x4725da(0x19c)]==='context'&&console['log'](a4_0x201e29[_0x4725da(0x18a)]('Using\x20project:\x20'+_0x4b7b54));else{let _0x5bdb33=_0x4725da(0x21f);_0x5c394b[_0x4725da(0x1b6)]===_0x4725da(0x249)&&(_0x5bdb33=_0x5c394b[_0x4725da(0x196)]+_0x4725da(0x1fa)+_0x5c394b[_0x4725da(0x225)]+_0x4725da(0x23f));throw new SDKError(ErrorCode[_0x4725da(0x1de)],_0x5c394b[_0x4725da(0x1b6)]===_0x4725da(0x1fd)?_0x5c394b[_0x4725da(0x196)]:_0x4725da(0x20f)+_0x4b7b54,undefined,{'helpText':_0x5bdb33});}const {data:_0x32ee71}=await withSpinner(_0x4725da(0x24b),()=>_0xd3d265[_0x4725da(0x20e)][_0x4725da(0x1ae)](_0x4b7b54,{'dryRun':!![]})),_0x58d701=_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1a5)][_0x4725da(0x1f3)]>0x0;if(_0x58d701){console[_0x4725da(0x1b2)](a4_0x201e29['red'](_0x4725da(0x194)));for(const _0x1e1e26 of _0x32ee71[_0x4725da(0x1a5)]){_0x1e1e26[_0x4725da(0x1a8)]==='error'&&console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x205)](_0x4725da(0x198)+_0x1e1e26['agentName']+'\x22:\x20'+_0x1e1e26[_0x4725da(0x21e)]));}return 0x1;}const _0x2db21a=_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1a5)][_0x4725da(0x246)]+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1c3)][_0x4725da(0x246)]+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1b8)][_0x4725da(0x246)]+_0x32ee71['counts'][_0x4725da(0x242)]['created']+_0x32ee71[_0x4725da(0x1c2)]['integrations']['created']+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x22f)][_0x4725da(0x246)]+_0x32ee71[_0x4725da(0x1c2)]['experimentalArtifacts'][_0x4725da(0x246)]+_0x32ee71['counts'][_0x4725da(0x19b)]['created']+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x22b)][_0x4725da(0x246)],_0x47f898=_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1a5)][_0x4725da(0x1ea)]+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1c3)][_0x4725da(0x1ea)]+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1b8)]['updated']+_0x32ee71['counts'][_0x4725da(0x242)]['updated']+_0x32ee71['counts'][_0x4725da(0x1af)][_0x4725da(0x1ea)]+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x22f)][_0x4725da(0x1ea)]+_0x32ee71['counts'][_0x4725da(0x212)][_0x4725da(0x1ea)]+_0x32ee71['counts'][_0x4725da(0x19b)][_0x4725da(0x1ea)]+_0x32ee71['counts'][_0x4725da(0x22b)]['updated'],_0x19d390=_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1a5)][_0x4725da(0x221)]+_0x32ee71['counts'][_0x4725da(0x1c3)]['unchanged']+_0x32ee71['counts'][_0x4725da(0x1b8)]['unchanged']+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x242)][_0x4725da(0x221)]+_0x32ee71['counts'][_0x4725da(0x1af)][_0x4725da(0x221)]+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x22f)]['unchanged']+_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x212)][_0x4725da(0x221)]+_0x32ee71[_0x4725da(0x1c2)]['formInterfaces']['unchanged']+_0x32ee71[_0x4725da(0x1c2)]['chatInterfaces'][_0x4725da(0x221)];console[_0x4725da(0x1b2)](_0x4725da(0x1ec)+_0x32ee71[_0x4725da(0x18f)]+'\x27:'),console[_0x4725da(0x1b2)]('\x20\x20'+a4_0x201e29['green']('+\x20'+_0x2db21a+_0x4725da(0x240))+_0x4725da(0x224)+a4_0x201e29[_0x4725da(0x1c9)]('~\x20'+_0x47f898+_0x4725da(0x1b1))+_0x4725da(0x224)+a4_0x201e29[_0x4725da(0x18a)]('=\x20'+_0x19d390+_0x4725da(0x20d))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1a5)])),console[_0x4725da(0x1b2)](_0x4725da(0x23e)+formatCountSummary(_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x1c3)])),console[_0x4725da(0x1b2)](_0x4725da(0x1a2)+formatCountSummary(_0x32ee71['counts'][_0x4725da(0x1b8)])),console[_0x4725da(0x1b2)](_0x4725da(0x245)+formatCountSummary(_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x242)])),console[_0x4725da(0x1b2)](_0x4725da(0x1e8)+formatCountSummary(_0x32ee71[_0x4725da(0x1c2)]['integrations'])),console[_0x4725da(0x1b2)](_0x4725da(0x1dd)+formatCountSummary(_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x19b)])),console[_0x4725da(0x1b2)](_0x4725da(0x21a)+formatCountSummary(_0x32ee71['counts'][_0x4725da(0x22b)]));const _0x307d77=_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x22f)]['created']>0x0||_0x32ee71['counts']['experimentalKnowledgeBases'][_0x4725da(0x1ea)]>0x0||_0x32ee71[_0x4725da(0x1c2)]['experimentalKnowledgeBases'][_0x4725da(0x221)]>0x0||_0x32ee71[_0x4725da(0x1c2)]['experimentalArtifacts']['created']>0x0||_0x32ee71['counts'][_0x4725da(0x212)][_0x4725da(0x1ea)]>0x0||_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x212)][_0x4725da(0x221)]>0x0;_0x307d77&&(console[_0x4725da(0x1b2)](_0x4725da(0x23d)+formatCountSummary(_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x22f)])),console[_0x4725da(0x1b2)](_0x4725da(0x1f6)+formatCountSummary(_0x32ee71[_0x4725da(0x1c2)][_0x4725da(0x212)])));console[_0x4725da(0x1b2)](_0x4725da(0x190)+a4_0x201e29[_0x4725da(0x199)](_0x4b7b54)),displayDiffs(_0x32ee71['agents'],_0x32ee71[_0x4725da(0x1c3)],_0x32ee71['textKnowledgeBases'],_0x32ee71[_0x4725da(0x242)],_0x32ee71[_0x4725da(0x1af)],_0x32ee71[_0x4725da(0x22f)],_0x32ee71[_0x4725da(0x212)],_0x32ee71[_0x4725da(0x19b)],_0x32ee71[_0x4725da(0x22b)]);if(_0x50e202)return console[_0x4725da(0x1b2)](a4_0x201e29['yellow'](_0x4725da(0x233))),0x0;if(_0x2db21a===0x0&&_0x47f898===0x0){console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x1a4)](_0x4725da(0x1d7)));const _0x4b04b8=getLLMProjectUrl(_0x13a173,_0x32ee71[_0x4725da(0x234)]);return console['log'](_0x4725da(0x1ff)+a4_0x201e29[_0x4725da(0x199)](_0x4b04b8)),0x0;}if(!_0x30a93d&&!_0x20b925){if(!isInteractive())return console[_0x4725da(0x21e)](a4_0x201e29[_0x4725da(0x205)]('\x0aError:'),_0x4725da(0x216)),console[_0x4725da(0x21e)](a4_0x201e29[_0x4725da(0x18a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xb5171e=await confirmKey(_0x4725da(0x219)+(_0x2db21a+_0x47f898)+_0x4725da(0x1e1));if(!_0xb5171e)return console['log'](a4_0x201e29[_0x4725da(0x1c9)]('Cancelled'),_0x4725da(0x236)),0x1;}const {data:_0x3b7dfd}=await withSpinner('Pushing\x20to\x20project...',()=>_0xd3d265[_0x4725da(0x20e)][_0x4725da(0x1ae)](_0x4b7b54,{'force':_0x20b925})),_0x838303=_0x3b7dfd['counts'][_0x4725da(0x1a5)][_0x4725da(0x1f3)]>0x0||_0x3b7dfd['counts'][_0x4725da(0x1c3)][_0x4725da(0x1f3)]>0x0||_0x3b7dfd[_0x4725da(0x1c2)][_0x4725da(0x1b8)][_0x4725da(0x1f3)]>0x0||_0x3b7dfd[_0x4725da(0x1c2)][_0x4725da(0x242)][_0x4725da(0x1f3)]>0x0||_0x3b7dfd['counts'][_0x4725da(0x19b)][_0x4725da(0x1f3)]>0x0||_0x3b7dfd[_0x4725da(0x1c2)][_0x4725da(0x22b)][_0x4725da(0x1f3)]>0x0;if(_0x838303){console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x1c9)](_0x4725da(0x22c))),console['log'](),console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x205)](_0x4725da(0x214)));for(const _0x2502ec of _0x3b7dfd['agents']){_0x2502ec['action']===_0x4725da(0x21e)&&console[_0x4725da(0x1b2)](a4_0x201e29['red'](_0x4725da(0x198)+_0x2502ec[_0x4725da(0x1f5)]+_0x4725da(0x237)+_0x2502ec[_0x4725da(0x21e)]));}for(const _0x38392f of _0x3b7dfd[_0x4725da(0x1c3)]){_0x38392f[_0x4725da(0x1a8)]===_0x4725da(0x21e)&&console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x205)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x38392f[_0x4725da(0x1d0)]+'\x22:\x20'+_0x38392f['error']));}for(const _0x1e29f7 of _0x3b7dfd[_0x4725da(0x1b8)]){_0x1e29f7[_0x4725da(0x1a8)]===_0x4725da(0x21e)&&console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x205)](_0x4725da(0x1d4)+_0x1e29f7[_0x4725da(0x1d0)]+_0x4725da(0x237)+_0x1e29f7[_0x4725da(0x21e)]));}for(const _0x1c2d94 of _0x3b7dfd['prompts']){_0x1c2d94[_0x4725da(0x1a8)]===_0x4725da(0x21e)&&console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x205)](_0x4725da(0x24a)+_0x1c2d94[_0x4725da(0x1d0)]+_0x4725da(0x237)+_0x1c2d94['error']));}for(const _0x3f98e5 of _0x3b7dfd[_0x4725da(0x1af)]){_0x3f98e5[_0x4725da(0x1a8)]===_0x4725da(0x21e)&&console['log'](a4_0x201e29['red'](_0x4725da(0x1a7)+_0x3f98e5['name']+_0x4725da(0x237)+_0x3f98e5[_0x4725da(0x21e)]));}for(const _0x524e81 of _0x3b7dfd['formInterfaces']){_0x524e81[_0x4725da(0x1a8)]===_0x4725da(0x21e)&&console[_0x4725da(0x1b2)](a4_0x201e29[_0x4725da(0x205)]('\x20\x20Form\x20Interface\x20\x22'+_0x524e81[_0x4725da(0x1d0)]+_0x4725da(0x237)+_0x524e81['error']));}for(const _0x47e3fd of _0x3b7dfd[_0x4725da(0x22b)]){_0x47e3fd[_0x4725da(0x1a8)]===_0x4725da(0x21e)&&console[_0x4725da(0x1b2)](a4_0x201e29['red'](_0x4725da(0x1c8)+_0x47e3fd[_0x4725da(0x1d0)]+'\x22:\x20'+_0x47e3fd[_0x4725da(0x21e)]));}return 0x1;}console[_0x4725da(0x1b2)](a4_0x201e29['green'](_0x4725da(0x1e3)+(_0x2db21a+_0x47f898)+_0x4725da(0x243)+_0x3b7dfd[_0x4725da(0x18f)]+'\x27'));const _0x9d7fd3=getLLMProjectUrl(_0x13a173,_0x3b7dfd[_0x4725da(0x234)]);return console[_0x4725da(0x1b2)](_0x4725da(0x1ff)+a4_0x201e29[_0x4725da(0x199)](_0x9d7fd3)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x1eeba6=a5_0x4f3a;(function(_0x19fc27,_0x1983ee){const _0x210449=a5_0x4f3a,_0x5e934f=_0x19fc27();while(!![]){try{const _0x3d5401=-parseInt(_0x210449(0x1de))/0x1+-parseInt(_0x210449(0x22e))/0x2+parseInt(_0x210449(0x218))/0x3+-parseInt(_0x210449(0x1bc))/0x4*(parseInt(_0x210449(0x20b))/0x5)+parseInt(_0x210449(0x20a))/0x6*(parseInt(_0x210449(0x1cb))/0x7)+parseInt(_0x210449(0x1bb))/0x8*(-parseInt(_0x210449(0x219))/0x9)+parseInt(_0x210449(0x24a))/0xa;if(_0x3d5401===_0x1983ee)break;else _0x5e934f['push'](_0x5e934f['shift']());}catch(_0x574884){_0x5e934f['push'](_0x5e934f['shift']());}}}(a5_0x5645,0xad794));import*as a5_0x11b47f from'node:fs';import*as a5_0x28d6f4 from'node:path';import a5_0x7e9951 from'chalk';import{BaseCommand}from'./command.js';function a5_0x5645(){const _0x2be640=['567721NmTekB','Conversation\x20URL:\x20','table','filter','conversation_url','Run\x20tests\x20for\x20an\x20LLM\x20agent','output','round','Output\x20written\x20to:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','jsonl','✗\x20ERROR:\x20','Test\x20Configuration:','agent:test','no_context','Project\x20path:\x20','agentDirs','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','New\x20tests\x20to\x20execute:\x20','has','\x20\x20-\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x201/','Executing\x20new\x20tests...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20(cached)','repeat','FAIL','\x20\x20Project:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','tags','Test\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Using\x20agent:\x20','✗\x20FAIL:\x20','map','Round\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)','timestamp','site','execute','rounds','1485948xlZMJZ','35QfvQHe','not\x20found','No\x20tests\x20found\x20with\x20tags:\x20','message','writeFileSync','\x27\x20to\x20create\x20the\x20folder\x20structure.','Re-evaluating...','multiple_agents','Running:\x20','projectDir','\x22:\x20','found','tests','256869LHgscP','288qjhSgo','forEach','log','join','Total:\x20\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','name','toLowerCase','red','Duration:\x20','isSpinning','executeReeval','includes','utf-8','testName','\x20-\x20','✓\x20PASS:\x20','size','\x20\x20Evaluating...\x20','...','404','1329940KPNmko','Either\x20switch\x20to\x20the\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_tests','some','Re-evaluation\x20Summary','llm','push','description','Failed\x20Tests:','ERROR','testYmlPath','dim','projectName','Errors:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','cyan','add',':\x20Sending\x20user\x20input...','text','resolveProjectId','...\x20','Tests\x20found:\x20','Agent:\x20','llmProject','toISOString','reason','green','35814560zRnfGj','agentName','eval','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Site:\x20','status','stop','270376sjRtuV','508568jXVOqt','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\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','context','start','source','resolveAgentId','dryRun','resolve','split','Passed:\x20\x20\x20','verbose','agent','Evaluating\x20response...','7GJicSH','length','substring','reeval','Error\x20writing\x20output\x20file:\x20','trim','basename','\x20\x20Conversation:\x20','⚠\x20SKIPPED:\x20','conversations','now','yellow','find','\x20\x20Agent:\x20','\x20\x20Round\x20','json','Available\x20tags:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','white'];a5_0x5645=function(){return _0x2be640;};return a5_0x5645();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x4f3a(_0x251af2,_0x200b02){_0x251af2=_0x251af2-0x1bb;const _0x56459f=a5_0x5645();let _0x4f3a26=_0x56459f[_0x251af2];return _0x4f3a26;}export class AgentTestCommand extends BaseCommand{[a5_0x1eeba6(0x21f)]=a5_0x1eeba6(0x1eb);[a5_0x1eeba6(0x236)]=a5_0x1eeba6(0x1e3);async[a5_0x1eeba6(0x208)](_0x4c842e){const _0x20b479=a5_0x1eeba6,{options:_0x235eeb,args:_0x4903c1,tdx:_0xfd7234}=_0x4c842e,_0x4a9771=_0x4903c1[0x0]||'.',_0x59078c=_0x235eeb[_0x20b479(0x1c4)],_0x3b1db6=_0x235eeb,_0x4f501b=_0x3b1db6[_0x20b479(0x24c)]===![],_0x1b57c6=_0x3b1db6[_0x20b479(0x1ce)],_0x1f6363=_0x3b1db6[_0x20b479(0x21f)],_0x5c81e3=_0x3b1db6[_0x20b479(0x1fe)],_0x1762d8=_0x235eeb[_0x20b479(0x207)],_0x373669=_0x3b1db6[_0x20b479(0x1e4)];if(_0x1b57c6&&_0x4f501b)return console['log'](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x23d))),0x1;let _0x1d5313='table';if(_0x3b1db6['json'])_0x1d5313=_0x20b479(0x1da);else{if(_0x3b1db6[_0x20b479(0x1e8)])_0x1d5313='jsonl';else{if(_0x3b1db6['tsv'])_0x1d5313='tsv';else{if(_0x3b1db6['table'])_0x1d5313=_0x20b479(0x1e0);}}}const _0x1eb7f=_0x3b1db6[_0x20b479(0x246)];let _0x561d8e=_0x4a9771;const _0x49dd35=a5_0x11b47f['existsSync'](_0x4a9771),_0x3347b2=_0x4a9771==='.';if(!_0x49dd35||_0x3347b2){const _0x53bcfe=resolveProjectFromContext(_0x4a9771,_0x1eb7f,{'requireFile':'test.yml'});if(_0x53bcfe[_0x20b479(0x216)])_0x561d8e=_0x53bcfe['projectDir'],_0x53bcfe[_0x20b479(0x1c2)]===_0x20b479(0x1c0)&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x201)+_0x561d8e));else switch(_0x53bcfe[_0x20b479(0x248)]){case _0x20b479(0x1ec):console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x53bcfe[_0x20b479(0x20e)])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x24e)),console['log'](_0x20b479(0x1bf)),console[_0x20b479(0x21b)](_0x20b479(0x205)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)](_0x53bcfe['message'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x1e7)+_0x53bcfe[_0x20b479(0x246)]+_0x20b479(0x210));return 0x1;case _0x20b479(0x212):{const _0xaf72fa=a5_0x28d6f4[_0x20b479(0x1d1)](_0x53bcfe[_0x20b479(0x214)]);console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x20b479(0x24d)+_0x53bcfe[_0x20b479(0x246)]+'\x22:'));for(const _0x3e4d35 of _0x53bcfe[_0x20b479(0x1ee)]){console[_0x20b479(0x21b)](_0x20b479(0x1f3)+_0x3e4d35);}return console['log'](),console[_0x20b479(0x21b)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0xaf72fa+'/<agent-name>'),0x1;}case _0x20b479(0x231):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x53bcfe[_0x20b479(0x246)]+'\x22.')),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1ed)+_0x53bcfe['projectDir'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x230));return 0x1;}}const {definition:_0x5b5439,agentInfo:_0x375398}=parseTestFile(_0x561d8e);let _0x6c2cc0=_0x5b5439[_0x20b479(0x217)];if(_0x1f6363){const _0x42a3a9=_0x1f6363[_0x20b479(0x1c6)](',')[_0x20b479(0x203)](_0x16bc93=>_0x16bc93[_0x20b479(0x1d0)]());_0x6c2cc0=_0x5b5439[_0x20b479(0x217)][_0x20b479(0x1e1)](_0x1ad3d2=>_0x42a3a9[_0x20b479(0x225)](_0x1ad3d2[_0x20b479(0x21f)]));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0)return console['log'](a5_0x7e9951['yellow'](_0x20b479(0x1ef)+_0x1f6363)),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)]('Available\x20tests:\x20'+_0x5b5439['tests'][_0x20b479(0x203)](_0x367c4b=>_0x367c4b[_0x20b479(0x21f)])[_0x20b479(0x21c)](',\x20'))),0x1;}if(_0x5c81e3){const _0x58dbf2=_0x5c81e3[_0x20b479(0x1c6)](',')['map'](_0x5fe8cc=>_0x5fe8cc['trim']()[_0x20b479(0x220)]());_0x6c2cc0=_0x6c2cc0[_0x20b479(0x1e1)](_0x7dab92=>_0x7dab92[_0x20b479(0x1fe)]?.[_0x20b479(0x232)](_0x501199=>_0x58dbf2[_0x20b479(0x225)](_0x501199[_0x20b479(0x220)]())));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0){console['log'](a5_0x7e9951[_0x20b479(0x1d6)](_0x20b479(0x20d)+_0x5c81e3));const _0x57fa00=new Set();return _0x5b5439[_0x20b479(0x217)][_0x20b479(0x21a)](_0x165a2a=>_0x165a2a[_0x20b479(0x1fe)]?.[_0x20b479(0x21a)](_0x2c541a=>_0x57fa00[_0x20b479(0x23f)](_0x2c541a))),_0x57fa00[_0x20b479(0x22a)]>0x0?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1db)+[..._0x57fa00][_0x20b479(0x21c)](',\x20'))):console[_0x20b479(0x21b)](a5_0x7e9951['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x1b57c6)return this[_0x20b479(0x224)](_0x4c842e,{'definition':{'tests':_0x6c2cc0},'agentInfo':_0x375398,'outputFormat':_0x1d5313,'outputFile':_0x373669,'testNames':_0x1f6363});if(_0x59078c){console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)](_0x20b479(0x1ea))),console[_0x20b479(0x21b)]('\x20\x20Site:\x20'+a5_0x7e9951['white'](_0x1762d8)),console['log'](_0x20b479(0x1fb)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)])),console[_0x20b479(0x21b)](_0x20b479(0x1d8)+a5_0x7e9951[_0x20b479(0x1dd)](_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x244)+a5_0x7e9951[_0x20b479(0x1dd)](_0x6c2cc0[_0x20b479(0x1cc)]));for(let _0x3bef6e=0x0;_0x3bef6e<_0x6c2cc0[_0x20b479(0x1cc)];_0x3bef6e++){const _0x1fa817=_0x6c2cc0[_0x3bef6e],_0x3a33cd=_0x1fa817['rounds'][_0x20b479(0x1cc)]===0x1?_0x20b479(0x1e5):_0x20b479(0x209),_0x474802=_0x1fa817['tags']?.[_0x20b479(0x1cc)]?'\x20['+_0x1fa817[_0x20b479(0x1fe)][_0x20b479(0x21c)](',\x20')+']':'';console[_0x20b479(0x21b)]('\x20\x20'+(_0x3bef6e+0x1)+'.\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x1fa817[_0x20b479(0x21f)])+'\x20('+_0x1fa817[_0x20b479(0x209)][_0x20b479(0x1cc)]+'\x20'+_0x3a33cd+')'+a5_0x7e9951[_0x20b479(0x23a)](_0x474802));}return 0x0;}let _0x25c749,_0x37c9c8;try{_0x25c749=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x242)](_0x375398[_0x20b479(0x23b)]);}catch(_0x55de34){const _0x2bdd44=_0x55de34 instanceof Error?_0x55de34[_0x20b479(0x20e)]:String(_0x55de34);return _0x2bdd44[_0x20b479(0x225)](_0x20b479(0x22d))||_0x2bdd44['toLowerCase']()[_0x20b479(0x225)](_0x20b479(0x20c))?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x375398[_0x20b479(0x23b)])):console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x1be)+_0x375398['projectName']+_0x20b479(0x215)+_0x2bdd44)),0x1;}try{_0x37c9c8=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x1c3)](_0x375398[_0x20b479(0x24b)],_0x25c749);}catch(_0x4a9979){const _0x51ceb2=_0x4a9979 instanceof Error?_0x4a9979['message']:String(_0x4a9979);return _0x51ceb2[_0x20b479(0x225)]('404')||_0x51ceb2[_0x20b479(0x220)]()[_0x20b479(0x225)]('not\x20found')?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1fc)+_0x375398[_0x20b479(0x24b)])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x375398['agentName']+_0x20b479(0x215)+_0x51ceb2)),0x1;}let _0x12fa7a;if(!_0x4f501b)try{_0x12fa7a=await setupEvaluatorAgent(_0xfd7234[_0x20b479(0x234)],_0x235eeb[_0x20b479(0x1c8)]);}catch(_0x133409){const _0x548037=_0x133409 instanceof Error?_0x133409[_0x20b479(0x20e)]:String(_0x133409);return console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1f0)+_0x548037)),0x1;}console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)]('Running\x20agent\x20tests...')),console[_0x20b479(0x21b)](_0x20b479(0x250)+a5_0x7e9951[_0x20b479(0x1dd)](_0x1762d8)),console[_0x20b479(0x21b)](_0x20b479(0x245)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)]+'/'+_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)]();const _0x4741b8=[],_0x143e71=[],_0x4d23b5=Date[_0x20b479(0x1d5)]();for(let _0xf7eb9c=0x0;_0xf7eb9c<_0x6c2cc0[_0x20b479(0x1cc)];_0xf7eb9c++){const _0x4055c2=_0x6c2cc0[_0xf7eb9c];_0x6c2cc0[_0x20b479(0x1cc)]>0x1?console[_0x20b479(0x21b)](_0x20b479(0x1ff)+(_0xf7eb9c+0x1)+'/'+_0x6c2cc0[_0x20b479(0x1cc)]+':\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)])):console[_0x20b479(0x21b)]('Running\x20test:\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)]));const _0x2666cf=createCommandSpinner(_0x20b479(0x1f5)+_0x4055c2[_0x20b479(0x209)][_0x20b479(0x1cc)]+_0x20b479(0x240));_0x2666cf[_0x20b479(0x1c1)]();try{const {result:_0x23d66d,conversation:_0x4dcf09}=await runTest(_0xfd7234[_0x20b479(0x234)],_0x4055c2,{'agentId':_0x37c9c8,'projectId':_0x25c749,'site':_0x1762d8,'noEval':_0x4f501b,'evaluatorId':_0x12fa7a,'onRoundStart':(_0x2141b9,_0x27da12)=>{const _0x4e7e7f=_0x20b479;_0x2666cf[_0x4e7e7f(0x241)]=_0x4e7e7f(0x204)+(_0x2141b9+0x1)+'/'+_0x27da12+_0x4e7e7f(0x240);},'onRoundComplete':(_0xd773e9,_0x4cecd4,_0x228b0f)=>{const _0x1763e9=_0x20b479,_0x1f01ef=formatElapsed(_0x4cecd4);_0x228b0f?console[_0x1763e9(0x21b)]('\x20\x20Round\x20'+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+'...\x20'+a5_0x7e9951['green']('✓')+'\x20('+_0x1f01ef+')'):console[_0x1763e9(0x21b)](_0x1763e9(0x1d9)+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+_0x1763e9(0x243)+a5_0x7e9951[_0x1763e9(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x11a60d=_0x20b479;_0x2666cf[_0x11a60d(0x241)]='Evaluating\x20response...';},'onEvaluationComplete':_0x530d79=>{const _0x2143ea=_0x20b479,_0x59fb31=formatElapsed(_0x530d79);console[_0x2143ea(0x21b)]('\x20\x20Evaluating...\x20'+a5_0x7e9951[_0x2143ea(0x249)]('✓')+'\x20('+_0x59fb31+')');}});_0x2666cf[_0x20b479(0x252)](),_0x4741b8[_0x20b479(0x235)](_0x23d66d),_0x143e71['push'](_0x4dcf09);if(_0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1bd))console[_0x20b479(0x21b)](a5_0x7e9951['green']('✓\x20PASS:\x20'+_0x23d66d[_0x20b479(0x248)]));else _0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1fa)?console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x202)+_0x23d66d['reason'])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1e9)+_0x23d66d['reason']));_0x23d66d[_0x20b479(0x1e2)]&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1df)+_0x23d66d[_0x20b479(0x1e2)])),console['log']();}catch(_0x3d09fb){_0x2666cf[_0x20b479(0x252)]();const _0x5cdc30=_0x3d09fb instanceof Error?_0x3d09fb[_0x20b479(0x20e)]:String(_0x3d09fb);console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20'+_0x5cdc30)),console[_0x20b479(0x21b)](),_0x4741b8['push']({'name':_0x4055c2['name'],'status':_0x20b479(0x238),'reason':_0x5cdc30,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x28776c=Date[_0x20b479(0x1d5)]()-_0x4d23b5,_0x379b21=_0x4741b8[_0x20b479(0x1e1)](_0x1fc965=>_0x1fc965[_0x20b479(0x251)]===_0x20b479(0x1bd))['length'],_0x34141b=_0x4741b8[_0x20b479(0x1e1)](_0x5edf62=>_0x5edf62[_0x20b479(0x251)]===_0x20b479(0x1fa))[_0x20b479(0x1cc)],_0x17ae92=_0x4741b8[_0x20b479(0x1e1)](_0x3a868f=>_0x3a868f[_0x20b479(0x251)]==='ERROR')[_0x20b479(0x1cc)];console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console['log']('Test\x20Summary'),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console[_0x20b479(0x21b)](_0x20b479(0x21d)+_0x4741b8[_0x20b479(0x1cc)]),console[_0x20b479(0x21b)](_0x20b479(0x1c7)+a5_0x7e9951[_0x20b479(0x249)](_0x379b21)),console[_0x20b479(0x21b)]('Failed:\x20\x20\x20'+a5_0x7e9951[_0x20b479(0x221)](_0x34141b));_0x17ae92>0x0&&console[_0x20b479(0x21b)]('Errors:\x20\x20\x20'+a5_0x7e9951['red'](_0x17ae92));console[_0x20b479(0x21b)](_0x20b479(0x222)+formatElapsed(_0x28776c)),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c));const _0x25dd57=_0x4741b8[_0x20b479(0x1e1)](_0x1cf4ba=>_0x1cf4ba[_0x20b479(0x251)]!==_0x20b479(0x1bd));if(_0x25dd57[_0x20b479(0x1cc)]>0x0){console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x237));for(const _0xab20ac of _0x25dd57){const _0x4abb02=a5_0x7e9951[_0x20b479(0x221)]('✗'),_0x2cb58d=_0xab20ac[_0x20b479(0x248)]['length']>0x32?_0xab20ac[_0x20b479(0x248)][_0x20b479(0x1cd)](0x0,0x32)+_0x20b479(0x22c):_0xab20ac[_0x20b479(0x248)];console[_0x20b479(0x21b)]('\x20\x20'+_0x4abb02+'\x20'+_0xab20ac['name']+':\x20'+_0x2cb58d);}}const _0x426451={'summary':{'total':_0x4741b8['length'],'passed':_0x379b21,'failed':_0x34141b,'errors':_0x17ae92>0x0?_0x17ae92:undefined,'duration_ms':_0x28776c},'tests':_0x4741b8,'agent':{'project':_0x375398[_0x20b479(0x23b)],'name':_0x375398[_0x20b479(0x24b)],'site':_0x1762d8},'timestamp':new Date(_0x4d23b5)['toISOString']()};try{const _0x14bd9b=buildCachedTestRun(_0x143e71,{'site':_0x1762d8,'projectId':_0x25c749,'projectName':_0x375398['projectName'],'agentId':_0x37c9c8,'agentName':_0x375398[_0x20b479(0x24b)],'testYmlPath':a5_0x28d6f4[_0x20b479(0x1c5)](_0x375398[_0x20b479(0x239)])});saveLastTestRun(_0x14bd9b);}catch{}if(_0x1d5313!==_0x20b479(0x1e0)||_0x373669){const _0x433b11=formatResults(_0x426451,_0x1d5313);if(_0x373669)try{a5_0x11b47f[_0x20b479(0x20f)](_0x373669,_0x433b11,_0x20b479(0x226)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1e6)+_0x373669));}catch(_0x4e6938){return console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('Error\x20writing\x20output\x20file:\x20'+_0x4e6938)),0x1;}else console['log'](),console['log'](_0x433b11);}return _0x25dd57[_0x20b479(0x1cc)]>0x0?0x1:0x0;}async[a5_0x1eeba6(0x224)](_0x5ec8ef,_0x147b40){const _0x4d1328=a5_0x1eeba6,{options:_0xdee4f4,tdx:_0x2634dc}=_0x5ec8ef,{definition:_0x37e42c,agentInfo:_0x2a6598,outputFormat:_0x4e711f,outputFile:_0x325a71}=_0x147b40,_0x1d42eb=_0xdee4f4[_0x4d1328(0x207)],_0x439fcd=loadLastTestRun();if(!_0x439fcd)return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1dc))),console[_0x4d1328(0x21b)](a5_0x7e9951['dim'](_0x4d1328(0x200))),0x1;if(_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]!==_0x2a6598['agentName'])return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]+_0x4d1328(0x1fd)+_0x2a6598[_0x4d1328(0x24b)]+'\x22.')),console['log'](a5_0x7e9951['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1c667d=new Set(_0x439fcd[_0x4d1328(0x1d4)][_0x4d1328(0x203)](_0x350825=>_0x350825[_0x4d1328(0x227)])),_0xd5ed56=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x4e21b5=>!_0x1c667d[_0x4d1328(0x1f2)](_0x4e21b5[_0x4d1328(0x21f)]));if(_0xd5ed56[_0x4d1328(0x1cc)]>0x0&&_0x439fcd['site']!==_0x1d42eb)return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x1f4)+_0x439fcd['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1d42eb+'\x22.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x22f)+_0x439fcd['site']+_0x4d1328(0x1f7))),0x1;const _0x2bf14e=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x1103c5=>_0x1c667d['has'](_0x1103c5[_0x4d1328(0x21f)])),_0x42b5e4=_0xd5ed56;let _0x350d4c;try{_0x350d4c=await setupEvaluatorAgent(_0x2634dc['llm'],_0xdee4f4[_0x4d1328(0x1c8)]);}catch(_0x3385db){const _0x37e3cf=_0x3385db instanceof Error?_0x3385db['message']:String(_0x3385db);return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1f0)+_0x37e3cf)),0x1;}console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x21e))),console['log']('Cached\x20run\x20from:\x20'+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x206)])),console[_0x4d1328(0x21b)](_0x4d1328(0x245)+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x23b)]+'/'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]));_0x42b5e4[_0x4d1328(0x1cc)]>0x0&&console[_0x4d1328(0x21b)](_0x4d1328(0x1f1)+a5_0x7e9951[_0x4d1328(0x1d6)](_0x42b5e4[_0x4d1328(0x1cc)]));console[_0x4d1328(0x21b)]();const _0x447816=[],_0x2f65b7=Date['now'](),_0x4a552f=createCommandSpinner(_0x4d1328(0x211));if(_0x2bf14e[_0x4d1328(0x1cc)]>0x0)try{const _0x59919f=await reevaluateFromCache(_0x2634dc[_0x4d1328(0x234)],_0x439fcd,{'tests':_0x2bf14e},{'evaluatorId':_0x350d4c,'onTestStart':(_0xec8c22,_0x289cba,_0x327488)=>{const _0x52cb01=_0x4d1328;_0x4a552f['text']='Re-evaluating\x20'+(_0x289cba+0x1)+'/'+_0x327488+':\x20'+_0xec8c22+'...';if(!_0x4a552f[_0x52cb01(0x223)])_0x4a552f['start']();},'onTestComplete':(_0x5e06be,_0x3575e7)=>{const _0x3b228d=_0x4d1328;_0x4a552f[_0x3b228d(0x252)]();if(_0x3575e7[_0x3b228d(0x251)]===_0x3b228d(0x1bd))console[_0x3b228d(0x21b)](a5_0x7e9951['green'](_0x3b228d(0x229)+_0x5e06be)+a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1f8)));else _0x3575e7[_0x3b228d(0x251)]==='FAIL'?console[_0x3b228d(0x21b)](a5_0x7e9951['red']('✗\x20FAIL:\x20'+_0x5e06be+_0x3b228d(0x228)+_0x3575e7['reason'])+a5_0x7e9951['dim'](_0x3b228d(0x1f8))):console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x221)](_0x3b228d(0x1e9)+_0x5e06be+_0x3b228d(0x228)+_0x3575e7[_0x3b228d(0x248)]));_0x3575e7[_0x3b228d(0x1e2)]&&console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1d2)+_0x3575e7[_0x3b228d(0x1e2)])),_0x447816['push'](_0x3575e7);},'onTestSkipped':(_0x2c20d8,_0x3c8895)=>{const _0x4f8625=_0x4d1328;_0x4a552f[_0x4f8625(0x252)](),console[_0x4f8625(0x21b)](a5_0x7e9951[_0x4f8625(0x1d6)](_0x4f8625(0x1d3)+_0x2c20d8+_0x4f8625(0x228)+_0x3c8895));}});for(const _0x272e9f of _0x59919f){!_0x447816[_0x4d1328(0x1d7)](_0x385c5c=>_0x385c5c[_0x4d1328(0x21f)]===_0x272e9f[_0x4d1328(0x21f)])&&_0x447816['push'](_0x272e9f);}}catch(_0x4856b1){_0x4a552f[_0x4d1328(0x252)]();const _0x13a177=_0x4856b1 instanceof Error?_0x4856b1[_0x4d1328(0x20e)]:String(_0x4856b1);return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x24f)+_0x13a177)),0x1;}_0x4a552f[_0x4d1328(0x252)]();if(_0x42b5e4['length']>0x0){console[_0x4d1328(0x21b)](),console['log'](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x1f6)));const {projectId:_0xca95c0,agentId:_0x56be0b}=_0x439fcd[_0x4d1328(0x1c9)];for(const _0x534016 of _0x42b5e4){console[_0x4d1328(0x21b)](_0x4d1328(0x213)+a5_0x7e9951['white'](_0x534016[_0x4d1328(0x21f)]));const _0xaff219=createCommandSpinner(_0x4d1328(0x1f5)+_0x534016[_0x4d1328(0x209)][_0x4d1328(0x1cc)]+_0x4d1328(0x240));_0xaff219[_0x4d1328(0x1c1)]();try{const {result:_0x346122}=await runTest(_0x2634dc['llm'],_0x534016,{'agentId':_0x56be0b,'projectId':_0xca95c0,'site':_0x439fcd[_0x4d1328(0x207)],'noEval':![],'evaluatorId':_0x350d4c,'onRoundStart':(_0xe20d2e,_0x314b5d)=>{const _0x363567=_0x4d1328;_0xaff219['text']=_0x363567(0x204)+(_0xe20d2e+0x1)+'/'+_0x314b5d+_0x363567(0x240);},'onRoundComplete':(_0x529a87,_0x1278c9,_0x4b0a8e)=>{const _0x27eca3=_0x4d1328,_0x3cddcd=formatElapsed(_0x1278c9);_0x4b0a8e?console[_0x27eca3(0x21b)](_0x27eca3(0x1d9)+(_0x529a87+0x1)+'/'+_0x534016[_0x27eca3(0x209)][_0x27eca3(0x1cc)]+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x249)]('✓')+'\x20('+_0x3cddcd+')'):console[_0x27eca3(0x21b)]('\x20\x20Round\x20'+(_0x529a87+0x1)+'/'+_0x534016['rounds']['length']+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x5870f8=_0x4d1328;_0xaff219[_0x5870f8(0x241)]=_0x5870f8(0x1ca);},'onEvaluationComplete':_0x3e2585=>{const _0x5f2f34=_0x4d1328,_0x3b3009=formatElapsed(_0x3e2585);console[_0x5f2f34(0x21b)](_0x5f2f34(0x22b)+a5_0x7e9951['green']('✓')+'\x20('+_0x3b3009+')');}});_0xaff219[_0x4d1328(0x252)](),_0x447816[_0x4d1328(0x235)](_0x346122);if(_0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1bd))console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x249)](_0x4d1328(0x229)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951[_0x4d1328(0x23a)]('\x20(new)'));else _0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1fa)?console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x202)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951['dim']('\x20(new)')):console['log'](a5_0x7e9951['red']('✗\x20ERROR:\x20'+_0x346122[_0x4d1328(0x248)]));_0x346122['conversation_url']&&console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('\x20\x20Conversation:\x20'+_0x346122[_0x4d1328(0x1e2)]));}catch(_0xcb19a7){_0xaff219[_0x4d1328(0x252)]();const _0x28c10d=_0xcb19a7 instanceof Error?_0xcb19a7[_0x4d1328(0x20e)]:String(_0xcb19a7);console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1e9)+_0x28c10d)),_0x447816[_0x4d1328(0x235)]({'name':_0x534016[_0x4d1328(0x21f)],'status':'ERROR','reason':_0x28c10d,'timestamp':new Date()[_0x4d1328(0x247)](),'duration_ms':0x0});}}}console['log']();const _0x89e063=Date[_0x4d1328(0x1d5)]()-_0x2f65b7,_0x55926b=_0x447816[_0x4d1328(0x1e1)](_0x4c6bc9=>_0x4c6bc9[_0x4d1328(0x251)]===_0x4d1328(0x1bd))['length'],_0x4cd68b=_0x447816[_0x4d1328(0x1e1)](_0xb53d3e=>_0xb53d3e[_0x4d1328(0x251)]===_0x4d1328(0x1fa))[_0x4d1328(0x1cc)],_0x557f24=_0x447816['filter'](_0x270645=>_0x270645['status']===_0x4d1328(0x238))[_0x4d1328(0x1cc)];console[_0x4d1328(0x21b)]('━'['repeat'](0x3c)),console[_0x4d1328(0x21b)](_0x4d1328(0x233)),console['log']('━'[_0x4d1328(0x1f9)](0x3c)),console[_0x4d1328(0x21b)]('Total:\x20\x20\x20\x20'+_0x447816[_0x4d1328(0x1cc)]),console['log'](_0x4d1328(0x1c7)+a5_0x7e9951['green'](_0x55926b)),console['log']('Failed:\x20\x20\x20'+a5_0x7e9951['red'](_0x4cd68b));_0x557f24>0x0&&console['log'](_0x4d1328(0x23c)+a5_0x7e9951[_0x4d1328(0x221)](_0x557f24));console['log'](_0x4d1328(0x222)+formatElapsed(_0x89e063)),console['log']('━'[_0x4d1328(0x1f9)](0x3c));const _0x4204c6={'summary':{'total':_0x447816[_0x4d1328(0x1cc)],'passed':_0x55926b,'failed':_0x4cd68b,'errors':_0x557f24>0x0?_0x557f24:undefined,'duration_ms':_0x89e063},'tests':_0x447816,'agent':{'project':_0x2a6598[_0x4d1328(0x23b)],'name':_0x2a6598[_0x4d1328(0x24b)],'site':_0x1d42eb},'timestamp':new Date(_0x2f65b7)[_0x4d1328(0x247)]()};if(_0x4e711f!==_0x4d1328(0x1e0)||_0x325a71){const _0x3facdb=formatResults(_0x4204c6,_0x4e711f);if(_0x325a71)try{a5_0x11b47f[_0x4d1328(0x20f)](_0x325a71,_0x3facdb,_0x4d1328(0x226)),console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('Output\x20written\x20to:\x20'+_0x325a71));}catch(_0x5841ab){return console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1cf)+_0x5841ab)),0x1;}else console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](_0x3facdb);}const _0x372df4=_0x447816[_0x4d1328(0x1e1)](_0x9f6cda=>_0x9f6cda[_0x4d1328(0x251)]!==_0x4d1328(0x1bd));return _0x372df4['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0xe04b1c=a5_0x1111;(function(_0x10f008,_0x17c9ac){const _0x3de53d=a5_0x1111,_0x569938=_0x10f008();while(!![]){try{const _0x5167b3=parseInt(_0x3de53d(0x1eb))/0x1*(-parseInt(_0x3de53d(0x1ee))/0x2)+-parseInt(_0x3de53d(0x225))/0x3+parseInt(_0x3de53d(0x20b))/0x4+-parseInt(_0x3de53d(0x227))/0x5+parseInt(_0x3de53d(0x23d))/0x6+-parseInt(_0x3de53d(0x1db))/0x7*(-parseInt(_0x3de53d(0x207))/0x8)+parseInt(_0x3de53d(0x262))/0x9;if(_0x5167b3===_0x17c9ac)break;else _0x569938['push'](_0x569938['shift']());}catch(_0x4c88b3){_0x569938['push'](_0x569938['shift']());}}}(a5_0x8755,0x39080));function a5_0x1111(_0x3bf184,_0x236d31){_0x3bf184=_0x3bf184-0x1d1;const _0x875599=a5_0x8755();let _0x1111f8=_0x875599[_0x3bf184];return _0x1111f8;}import*as a5_0x3ef0ac from'node:fs';import*as a5_0x5afa82 from'node:path';import a5_0x3ae5df from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x8755(){const _0x2ed46b=['reason','llm','PASS','log','\x20\x20Round\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20-\x20','No\x20tests\x20found\x20with\x20tags:\x20','executeReeval','Tests\x20found:\x20','agent','toISOString','rounds','cyan','ERROR','name','includes','Project\x20path:\x20','Passed:\x20\x20\x20','1304mRNtXm','✗\x20FAIL:\x20','Evaluating\x20response...','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','468648LqIMpR','Duration:\x20','stop','Conversation\x20URL:\x20','site','✗\x20ERROR:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','/<agent-name>','Re-evaluating\x20cached\x20test\x20run...','start','found','round','eval','not\x20found','description','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Using\x20agent:\x20','some','verbose','conversation_url','basename','yellow','\x22:\x20','Round\x20','push','45972BPVKbe','agentDirs','1429245MLXvFB','projectName','llmProject','Available\x20tests:\x20','trim','dryRun','New\x20tests\x20to\x20execute:\x20','FAIL','source','has','Available\x20tags:\x20','Re-evaluating\x20','white','timestamp','tags','add','agent:test','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20(cached)','execute','404','941652xLAsIk','length','text','Error\x20writing\x20output\x20file:\x20','repeat','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','No\x20tests\x20found\x20matching:\x20','\x20\x20Project:\x20','multiple_agents','forEach','Output\x20written\x20to:\x20','red','tests','Running\x20agent\x20tests...','join','Run\x20\x27tdx\x20agent\x20pull\x20','jsonl','message','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Agent:\x20','testName','\x20\x20Site:\x20','no_tests','agentName','\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)','status','resolveProjectId','substring','json','toLowerCase','...\x20','resolveAgentId','utf-8','...','find','split','isSpinning','3205530KNqzEq',':\x20Sending\x20user\x20input...','Total:\x20\x20\x20\x20','Cached\x20run\x20from:\x20','Re-evaluation\x20Summary','Failed:\x20\x20\x20','existsSync','size','green','\x20\x20-\x20','map','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','9457WGlUSu','no_context','\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','Running:\x20','writeFileSync','No\x20tests\x20have\x20tags\x20defined.','✓\x20PASS:\x20','table','Test\x20Summary','context','no_local_folder','\x20\x20Agent:\x20','Running\x20test:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','output','dim','315714oyjVWH','filter','now','2LxBASN','\x20\x20Conversation:\x20','Errors:\x20\x20\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22'];a5_0x8755=function(){return _0x2ed46b;};return a5_0x8755();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0xe04b1c(0x237);[a5_0xe04b1c(0x219)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0xe04b1c(0x23b)](_0x29911c){const _0x1a7f69=a5_0xe04b1c,{options:_0xeb9956,args:_0x5abf89,tdx:_0x487276}=_0x29911c,_0x368d91=_0x5abf89[0x0]||'.',_0x76a4a0=_0xeb9956[_0x1a7f69(0x22c)],_0xe11c5a=_0xeb9956,_0x547ac3=_0xe11c5a[_0x1a7f69(0x217)]===![],_0x528277=_0xe11c5a['reeval'],_0x546f18=_0xe11c5a[_0x1a7f69(0x203)],_0x18c120=_0xe11c5a[_0x1a7f69(0x235)],_0xc2395d=_0xeb9956[_0x1a7f69(0x20f)],_0x272c7b=_0xe11c5a[_0x1a7f69(0x1e9)];if(_0x528277&&_0x547ac3)return console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x248)](_0x1a7f69(0x242))),0x1;let _0x2f3226=_0x1a7f69(0x1e2);if(_0xe11c5a[_0x1a7f69(0x259)])_0x2f3226=_0x1a7f69(0x259);else{if(_0xe11c5a[_0x1a7f69(0x24d)])_0x2f3226='jsonl';else{if(_0xe11c5a['tsv'])_0x2f3226='tsv';else{if(_0xe11c5a[_0x1a7f69(0x1e2)])_0x2f3226=_0x1a7f69(0x1e2);}}}const _0x182d52=_0xe11c5a[_0x1a7f69(0x229)];let _0x2cb727=_0x368d91;const _0x3737c6=a5_0x3ef0ac[_0x1a7f69(0x1d5)](_0x368d91),_0x457592=_0x368d91==='.';if(!_0x3737c6||_0x457592){const _0x4386d0=resolveProjectFromContext(_0x368d91,_0x182d52,{'requireFile':'test.yml'});if(_0x4386d0[_0x1a7f69(0x215)])_0x2cb727=_0x4386d0['projectDir'],_0x4386d0[_0x1a7f69(0x22f)]===_0x1a7f69(0x1e4)&&console[_0x1a7f69(0x1f5)](a5_0x3ae5df['dim'](_0x1a7f69(0x21c)+_0x2cb727));else switch(_0x4386d0[_0x1a7f69(0x1f2)]){case _0x1a7f69(0x1dc):console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x221)](_0x4386d0[_0x1a7f69(0x24e)])),console[_0x1a7f69(0x1f5)](),console[_0x1a7f69(0x1f5)]('Usage:'),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1dd)),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x255)),console['log'](),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1f8));return 0x1;case _0x1a7f69(0x1e5):console[_0x1a7f69(0x1f5)](a5_0x3ae5df['yellow'](_0x4386d0['message'])),console['log'](),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x24c)+_0x4386d0[_0x1a7f69(0x229)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x1a7f69(0x245):{const _0x5615e6=a5_0x5afa82[_0x1a7f69(0x220)](_0x4386d0['projectDir']);console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x221)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x4386d0[_0x1a7f69(0x229)]+'\x22:'));for(const _0x2c5354 of _0x4386d0[_0x1a7f69(0x226)]){console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1d8)+_0x2c5354);}return console['log'](),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x238)+_0x5615e6+_0x1a7f69(0x212)),0x1;}case _0x1a7f69(0x253):console['log'](a5_0x3ae5df[_0x1a7f69(0x221)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4386d0[_0x1a7f69(0x229)]+'\x22.')),console['log'](a5_0x3ae5df[_0x1a7f69(0x1ea)](_0x1a7f69(0x205)+_0x4386d0['projectDir'])),console[_0x1a7f69(0x1f5)](),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1da));return 0x1;}}const {definition:_0x50842d,agentInfo:_0x255709}=parseTestFile(_0x2cb727);let _0x346b14=_0x50842d['tests'];if(_0x546f18){const _0x3c1592=_0x546f18[_0x1a7f69(0x260)](',')[_0x1a7f69(0x1d9)](_0x2bd224=>_0x2bd224[_0x1a7f69(0x22b)]());_0x346b14=_0x50842d[_0x1a7f69(0x249)][_0x1a7f69(0x1ec)](_0xe7751=>_0x3c1592[_0x1a7f69(0x204)](_0xe7751[_0x1a7f69(0x203)]));if(_0x346b14[_0x1a7f69(0x23e)]===0x0)return console['log'](a5_0x3ae5df[_0x1a7f69(0x221)](_0x1a7f69(0x243)+_0x546f18)),console[_0x1a7f69(0x1f5)](a5_0x3ae5df['dim'](_0x1a7f69(0x22a)+_0x50842d['tests'][_0x1a7f69(0x1d9)](_0x5cd812=>_0x5cd812[_0x1a7f69(0x203)])[_0x1a7f69(0x24b)](',\x20'))),0x1;}if(_0x18c120){const _0x404c0e=_0x18c120[_0x1a7f69(0x260)](',')[_0x1a7f69(0x1d9)](_0x46b949=>_0x46b949[_0x1a7f69(0x22b)]()[_0x1a7f69(0x25a)]());_0x346b14=_0x346b14[_0x1a7f69(0x1ec)](_0x276637=>_0x276637['tags']?.[_0x1a7f69(0x21d)](_0x5bbebb=>_0x404c0e[_0x1a7f69(0x204)](_0x5bbebb[_0x1a7f69(0x25a)]())));if(_0x346b14[_0x1a7f69(0x23e)]===0x0){console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x221)](_0x1a7f69(0x1fb)+_0x18c120));const _0xb68173=new Set();return _0x50842d[_0x1a7f69(0x249)][_0x1a7f69(0x246)](_0x1c8536=>_0x1c8536[_0x1a7f69(0x235)]?.['forEach'](_0x341bf2=>_0xb68173[_0x1a7f69(0x236)](_0x341bf2))),_0xb68173[_0x1a7f69(0x1d6)]>0x0?console['log'](a5_0x3ae5df['dim'](_0x1a7f69(0x231)+[..._0xb68173][_0x1a7f69(0x24b)](',\x20'))):console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x1ea)](_0x1a7f69(0x1e0))),0x1;}}if(_0x528277)return this['executeReeval'](_0x29911c,{'definition':{'tests':_0x346b14},'agentInfo':_0x255709,'outputFormat':_0x2f3226,'outputFile':_0x272c7b,'testNames':_0x546f18});if(_0x76a4a0){console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x201)]('Test\x20Configuration:')),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x252)+a5_0x3ae5df['white'](_0xc2395d)),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x244)+a5_0x3ae5df['white'](_0x255709[_0x1a7f69(0x228)])),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1e6)+a5_0x3ae5df[_0x1a7f69(0x233)](_0x255709['agentName'])),console[_0x1a7f69(0x1f5)](),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1fd)+a5_0x3ae5df[_0x1a7f69(0x233)](_0x346b14[_0x1a7f69(0x23e)]));for(let _0x235f5d=0x0;_0x235f5d<_0x346b14['length'];_0x235f5d++){const _0x987f54=_0x346b14[_0x235f5d],_0x1eec16=_0x987f54[_0x1a7f69(0x200)]['length']===0x1?_0x1a7f69(0x216):_0x1a7f69(0x200),_0x532632=_0x987f54[_0x1a7f69(0x235)]?.[_0x1a7f69(0x23e)]?'\x20['+_0x987f54[_0x1a7f69(0x235)][_0x1a7f69(0x24b)](',\x20')+']':'';console[_0x1a7f69(0x1f5)]('\x20\x20'+(_0x235f5d+0x1)+'.\x20'+a5_0x3ae5df[_0x1a7f69(0x233)](_0x987f54[_0x1a7f69(0x203)])+'\x20('+_0x987f54['rounds']['length']+'\x20'+_0x1eec16+')'+a5_0x3ae5df[_0x1a7f69(0x1ea)](_0x532632));}return 0x0;}let _0x151175,_0x21ea28;try{_0x151175=await _0x487276['llm'][_0x1a7f69(0x257)](_0x255709[_0x1a7f69(0x228)]);}catch(_0x5517d6){const _0x454d9d=_0x5517d6 instanceof Error?_0x5517d6[_0x1a7f69(0x24e)]:String(_0x5517d6);return _0x454d9d['includes']('404')||_0x454d9d[_0x1a7f69(0x25a)]()[_0x1a7f69(0x204)](_0x1a7f69(0x218))?console[_0x1a7f69(0x1f5)](a5_0x3ae5df['red'](_0x1a7f69(0x1f7)+_0x255709['projectName'])):console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x248)](_0x1a7f69(0x211)+_0x255709[_0x1a7f69(0x228)]+_0x1a7f69(0x222)+_0x454d9d)),0x1;}try{_0x21ea28=await _0x487276['llm'][_0x1a7f69(0x25c)](_0x255709['agentName'],_0x151175);}catch(_0x51db37){const _0x5df051=_0x51db37 instanceof Error?_0x51db37['message']:String(_0x51db37);return _0x5df051[_0x1a7f69(0x204)](_0x1a7f69(0x23c))||_0x5df051[_0x1a7f69(0x25a)]()['includes'](_0x1a7f69(0x218))?console[_0x1a7f69(0x1f5)](a5_0x3ae5df['red'](_0x1a7f69(0x21b)+_0x255709[_0x1a7f69(0x254)])):console[_0x1a7f69(0x1f5)](a5_0x3ae5df['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x255709['agentName']+_0x1a7f69(0x222)+_0x5df051)),0x1;}let _0x5d1e42;if(!_0x547ac3)try{_0x5d1e42=await setupEvaluatorAgent(_0x487276[_0x1a7f69(0x1f3)],_0xeb9956[_0x1a7f69(0x21e)]);}catch(_0x4e5ea7){const _0x290c62=_0x4e5ea7 instanceof Error?_0x4e5ea7['message']:String(_0x4e5ea7);return console['log'](a5_0x3ae5df[_0x1a7f69(0x248)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x290c62)),0x1;}console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x201)](_0x1a7f69(0x24a))),console['log']('Site:\x20'+a5_0x3ae5df[_0x1a7f69(0x233)](_0xc2395d)),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x250)+a5_0x3ae5df['white'](_0x255709[_0x1a7f69(0x228)]+'/'+_0x255709['agentName'])),console[_0x1a7f69(0x1f5)]();const _0x27371d=[],_0x504986=[],_0xbb8835=Date['now']();for(let _0x4c1174=0x0;_0x4c1174<_0x346b14[_0x1a7f69(0x23e)];_0x4c1174++){const _0x4b3dd9=_0x346b14[_0x4c1174];_0x346b14[_0x1a7f69(0x23e)]>0x1?console[_0x1a7f69(0x1f5)]('Test\x20'+(_0x4c1174+0x1)+'/'+_0x346b14[_0x1a7f69(0x23e)]+':\x20'+a5_0x3ae5df[_0x1a7f69(0x233)](_0x4b3dd9[_0x1a7f69(0x203)])):console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1e7)+a5_0x3ae5df['white'](_0x4b3dd9[_0x1a7f69(0x203)]));const _0x3e4c18=createCommandSpinner('Round\x201/'+_0x4b3dd9['rounds'][_0x1a7f69(0x23e)]+_0x1a7f69(0x263));_0x3e4c18['start']();try{const {result:_0xcc0ab5,conversation:_0x5b8a1b}=await runTest(_0x487276[_0x1a7f69(0x1f3)],_0x4b3dd9,{'agentId':_0x21ea28,'projectId':_0x151175,'site':_0xc2395d,'noEval':_0x547ac3,'evaluatorId':_0x5d1e42,'onRoundStart':(_0xc9c164,_0x15f73b)=>{const _0x56964e=_0x1a7f69;_0x3e4c18[_0x56964e(0x23f)]=_0x56964e(0x223)+(_0xc9c164+0x1)+'/'+_0x15f73b+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3d6f5c,_0x52f5f7,_0x4273f2)=>{const _0x222fe3=_0x1a7f69,_0x1fb1ea=formatElapsed(_0x52f5f7);_0x4273f2?console[_0x222fe3(0x1f5)](_0x222fe3(0x1f6)+(_0x3d6f5c+0x1)+'/'+_0x4b3dd9[_0x222fe3(0x200)]['length']+_0x222fe3(0x25b)+a5_0x3ae5df['green']('✓')+'\x20('+_0x1fb1ea+')'):console[_0x222fe3(0x1f5)](_0x222fe3(0x1f6)+(_0x3d6f5c+0x1)+'/'+_0x4b3dd9[_0x222fe3(0x200)]['length']+_0x222fe3(0x25b)+a5_0x3ae5df['red']('✗'));},'onEvaluationStart':()=>{const _0x133fcf=_0x1a7f69;_0x3e4c18['text']=_0x133fcf(0x209);},'onEvaluationComplete':_0x53c688=>{const _0x55d99b=_0x1a7f69,_0x4b3d17=formatElapsed(_0x53c688);console['log']('\x20\x20Evaluating...\x20'+a5_0x3ae5df[_0x55d99b(0x1d7)]('✓')+'\x20('+_0x4b3d17+')');}});_0x3e4c18['stop'](),_0x27371d[_0x1a7f69(0x224)](_0xcc0ab5),_0x504986[_0x1a7f69(0x224)](_0x5b8a1b);if(_0xcc0ab5[_0x1a7f69(0x256)]===_0x1a7f69(0x1f4))console[_0x1a7f69(0x1f5)](a5_0x3ae5df['green']('✓\x20PASS:\x20'+_0xcc0ab5[_0x1a7f69(0x1f2)]));else _0xcc0ab5[_0x1a7f69(0x256)]==='FAIL'?console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x248)](_0x1a7f69(0x208)+_0xcc0ab5['reason'])):console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x248)](_0x1a7f69(0x210)+_0xcc0ab5[_0x1a7f69(0x1f2)]));_0xcc0ab5[_0x1a7f69(0x21f)]&&console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x1ea)](_0x1a7f69(0x20e)+_0xcc0ab5[_0x1a7f69(0x21f)])),console['log']();}catch(_0x8159bf){_0x3e4c18['stop']();const _0x2a461e=_0x8159bf instanceof Error?_0x8159bf[_0x1a7f69(0x24e)]:String(_0x8159bf);console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x248)](_0x1a7f69(0x210)+_0x2a461e)),console[_0x1a7f69(0x1f5)](),_0x27371d[_0x1a7f69(0x224)]({'name':_0x4b3dd9[_0x1a7f69(0x203)],'status':_0x1a7f69(0x202),'reason':_0x2a461e,'timestamp':new Date()[_0x1a7f69(0x1ff)](),'duration_ms':0x0});}}const _0x3b9625=Date['now']()-_0xbb8835,_0x2a1c82=_0x27371d[_0x1a7f69(0x1ec)](_0x586465=>_0x586465[_0x1a7f69(0x256)]===_0x1a7f69(0x1f4))[_0x1a7f69(0x23e)],_0x1ab294=_0x27371d[_0x1a7f69(0x1ec)](_0x12f530=>_0x12f530[_0x1a7f69(0x256)]==='FAIL')[_0x1a7f69(0x23e)],_0x131499=_0x27371d['filter'](_0x3d0125=>_0x3d0125['status']==='ERROR')[_0x1a7f69(0x23e)];console['log']('━'[_0x1a7f69(0x241)](0x3c)),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1e3)),console[_0x1a7f69(0x1f5)]('━'[_0x1a7f69(0x241)](0x3c)),console[_0x1a7f69(0x1f5)]('Total:\x20\x20\x20\x20'+_0x27371d['length']),console['log']('Passed:\x20\x20\x20'+a5_0x3ae5df[_0x1a7f69(0x1d7)](_0x2a1c82)),console[_0x1a7f69(0x1f5)](_0x1a7f69(0x1d4)+a5_0x3ae5df[_0x1a7f69(0x248)](_0x1ab294));_0x131499>0x0&&console[_0x1a7f69(0x1f5)]('Errors:\x20\x20\x20'+a5_0x3ae5df['red'](_0x131499));console[_0x1a7f69(0x1f5)](_0x1a7f69(0x20c)+formatElapsed(_0x3b9625)),console[_0x1a7f69(0x1f5)]('━'[_0x1a7f69(0x241)](0x3c));const _0x29c3a6=_0x27371d[_0x1a7f69(0x1ec)](_0x265b5c=>_0x265b5c[_0x1a7f69(0x256)]!==_0x1a7f69(0x1f4));if(_0x29c3a6['length']>0x0){console[_0x1a7f69(0x1f5)](),console[_0x1a7f69(0x1f5)]('Failed\x20Tests:');for(const _0xc87f18 of _0x29c3a6){const _0x32f30a=a5_0x3ae5df[_0x1a7f69(0x248)]('✗'),_0x771743=_0xc87f18[_0x1a7f69(0x1f2)][_0x1a7f69(0x23e)]>0x32?_0xc87f18[_0x1a7f69(0x1f2)][_0x1a7f69(0x258)](0x0,0x32)+_0x1a7f69(0x25e):_0xc87f18[_0x1a7f69(0x1f2)];console['log']('\x20\x20'+_0x32f30a+'\x20'+_0xc87f18[_0x1a7f69(0x203)]+':\x20'+_0x771743);}}const _0x541e0d={'summary':{'total':_0x27371d['length'],'passed':_0x2a1c82,'failed':_0x1ab294,'errors':_0x131499>0x0?_0x131499:undefined,'duration_ms':_0x3b9625},'tests':_0x27371d,'agent':{'project':_0x255709['projectName'],'name':_0x255709['agentName'],'site':_0xc2395d},'timestamp':new Date(_0xbb8835)[_0x1a7f69(0x1ff)]()};try{const _0x328013=buildCachedTestRun(_0x504986,{'site':_0xc2395d,'projectId':_0x151175,'projectName':_0x255709[_0x1a7f69(0x228)],'agentId':_0x21ea28,'agentName':_0x255709[_0x1a7f69(0x254)],'testYmlPath':a5_0x5afa82['resolve'](_0x255709['testYmlPath'])});saveLastTestRun(_0x328013);}catch{}if(_0x2f3226!==_0x1a7f69(0x1e2)||_0x272c7b){const _0x46f9c9=formatResults(_0x541e0d,_0x2f3226);if(_0x272c7b)try{a5_0x3ef0ac[_0x1a7f69(0x1df)](_0x272c7b,_0x46f9c9,_0x1a7f69(0x25d)),console['log'](),console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x1ea)]('Output\x20written\x20to:\x20'+_0x272c7b));}catch(_0x126950){return console[_0x1a7f69(0x1f5)](),console[_0x1a7f69(0x1f5)](a5_0x3ae5df[_0x1a7f69(0x248)](_0x1a7f69(0x240)+_0x126950)),0x1;}else console[_0x1a7f69(0x1f5)](),console[_0x1a7f69(0x1f5)](_0x46f9c9);}return _0x29c3a6[_0x1a7f69(0x23e)]>0x0?0x1:0x0;}async[a5_0xe04b1c(0x1fc)](_0x3d2d39,_0x4dca9c){const _0x3bb67e=a5_0xe04b1c,{options:_0x28f41e,tdx:_0x1f3ce6}=_0x3d2d39,{definition:_0x2ccd17,agentInfo:_0x1f7e84,outputFormat:_0x4eee10,outputFile:_0x3753b5}=_0x4dca9c,_0x2a7a64=_0x28f41e['site'],_0x2ef4a1=loadLastTestRun();if(!_0x2ef4a1)return console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x248)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x3ae5df[_0x3bb67e(0x1ea)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x2ef4a1[_0x3bb67e(0x1fe)][_0x3bb67e(0x254)]!==_0x1f7e84['agentName'])return console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x248)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x2ef4a1[_0x3bb67e(0x1fe)][_0x3bb67e(0x254)]+_0x3bb67e(0x24f)+_0x1f7e84['agentName']+'\x22.')),console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x1ea)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1b1f82=new Set(_0x2ef4a1['conversations'][_0x3bb67e(0x1d9)](_0x382d89=>_0x382d89[_0x3bb67e(0x251)])),_0x5ef4d1=_0x2ccd17[_0x3bb67e(0x249)][_0x3bb67e(0x1ec)](_0x5c2dd8=>!_0x1b1f82[_0x3bb67e(0x230)](_0x5c2dd8[_0x3bb67e(0x203)]));if(_0x5ef4d1[_0x3bb67e(0x23e)]>0x0&&_0x2ef4a1[_0x3bb67e(0x20f)]!==_0x2a7a64)return console[_0x3bb67e(0x1f5)](a5_0x3ae5df['red'](_0x3bb67e(0x20a))),console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x1ea)](_0x3bb67e(0x1e8)+_0x2ef4a1[_0x3bb67e(0x20f)]+_0x3bb67e(0x1f1)+_0x2a7a64+'\x22.')),console['log'](a5_0x3ae5df[_0x3bb67e(0x1ea)]('Either\x20switch\x20to\x20the\x20\x22'+_0x2ef4a1[_0x3bb67e(0x20f)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x38518c=_0x2ccd17[_0x3bb67e(0x249)][_0x3bb67e(0x1ec)](_0x3a7fd1=>_0x1b1f82['has'](_0x3a7fd1['name'])),_0x42d679=_0x5ef4d1;let _0x306c10;try{_0x306c10=await setupEvaluatorAgent(_0x1f3ce6['llm'],_0x28f41e[_0x3bb67e(0x21e)]);}catch(_0x4d5774){const _0x128d37=_0x4d5774 instanceof Error?_0x4d5774[_0x3bb67e(0x24e)]:String(_0x4d5774);return console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x248)](_0x3bb67e(0x239)+_0x128d37)),0x1;}console[_0x3bb67e(0x1f5)](a5_0x3ae5df['cyan'](_0x3bb67e(0x213))),console[_0x3bb67e(0x1f5)](_0x3bb67e(0x1d2)+a5_0x3ae5df[_0x3bb67e(0x233)](_0x2ef4a1[_0x3bb67e(0x234)])),console[_0x3bb67e(0x1f5)](_0x3bb67e(0x250)+a5_0x3ae5df[_0x3bb67e(0x233)](_0x2ef4a1[_0x3bb67e(0x1fe)]['projectName']+'/'+_0x2ef4a1[_0x3bb67e(0x1fe)][_0x3bb67e(0x254)]));_0x42d679['length']>0x0&&console['log'](_0x3bb67e(0x22d)+a5_0x3ae5df[_0x3bb67e(0x221)](_0x42d679[_0x3bb67e(0x23e)]));console['log']();const _0x3fa831=[],_0x29d51b=Date[_0x3bb67e(0x1ed)](),_0x48d022=createCommandSpinner('Re-evaluating...');if(_0x38518c[_0x3bb67e(0x23e)]>0x0)try{const _0x118fb1=await reevaluateFromCache(_0x1f3ce6['llm'],_0x2ef4a1,{'tests':_0x38518c},{'evaluatorId':_0x306c10,'onTestStart':(_0x351308,_0x14872f,_0x430053)=>{const _0x4042d1=_0x3bb67e;_0x48d022[_0x4042d1(0x23f)]=_0x4042d1(0x232)+(_0x14872f+0x1)+'/'+_0x430053+':\x20'+_0x351308+_0x4042d1(0x25e);if(!_0x48d022[_0x4042d1(0x261)])_0x48d022[_0x4042d1(0x214)]();},'onTestComplete':(_0x4b4866,_0x2e3a8d)=>{const _0x3137fc=_0x3bb67e;_0x48d022[_0x3137fc(0x20d)]();if(_0x2e3a8d[_0x3137fc(0x256)]==='PASS')console[_0x3137fc(0x1f5)](a5_0x3ae5df[_0x3137fc(0x1d7)](_0x3137fc(0x1e1)+_0x4b4866)+a5_0x3ae5df[_0x3137fc(0x1ea)](_0x3137fc(0x23a)));else _0x2e3a8d['status']===_0x3137fc(0x22e)?console['log'](a5_0x3ae5df[_0x3137fc(0x248)](_0x3137fc(0x208)+_0x4b4866+'\x20-\x20'+_0x2e3a8d[_0x3137fc(0x1f2)])+a5_0x3ae5df[_0x3137fc(0x1ea)]('\x20(cached)')):console[_0x3137fc(0x1f5)](a5_0x3ae5df[_0x3137fc(0x248)](_0x3137fc(0x210)+_0x4b4866+'\x20-\x20'+_0x2e3a8d[_0x3137fc(0x1f2)]));_0x2e3a8d[_0x3137fc(0x21f)]&&console[_0x3137fc(0x1f5)](a5_0x3ae5df['dim'](_0x3137fc(0x1ef)+_0x2e3a8d[_0x3137fc(0x21f)])),_0x3fa831[_0x3137fc(0x224)](_0x2e3a8d);},'onTestSkipped':(_0x5c024d,_0x1803eb)=>{const _0x18e5f3=_0x3bb67e;_0x48d022[_0x18e5f3(0x20d)](),console['log'](a5_0x3ae5df[_0x18e5f3(0x221)]('⚠\x20SKIPPED:\x20'+_0x5c024d+_0x18e5f3(0x1fa)+_0x1803eb));}});for(const _0x4809de of _0x118fb1){!_0x3fa831[_0x3bb67e(0x25f)](_0x19892e=>_0x19892e[_0x3bb67e(0x203)]===_0x4809de['name'])&&_0x3fa831[_0x3bb67e(0x224)](_0x4809de);}}catch(_0x4aa1bf){_0x48d022['stop']();const _0x350211=_0x4aa1bf instanceof Error?_0x4aa1bf['message']:String(_0x4aa1bf);return console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x248)](_0x3bb67e(0x1f9)+_0x350211)),0x1;}_0x48d022[_0x3bb67e(0x20d)]();if(_0x42d679[_0x3bb67e(0x23e)]>0x0){console[_0x3bb67e(0x1f5)](),console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x201)]('Executing\x20new\x20tests...'));const {projectId:_0x1767d4,agentId:_0x2b2108}=_0x2ef4a1[_0x3bb67e(0x1fe)];for(const _0x88cbda of _0x42d679){console[_0x3bb67e(0x1f5)](_0x3bb67e(0x1de)+a5_0x3ae5df[_0x3bb67e(0x233)](_0x88cbda[_0x3bb67e(0x203)]));const _0xf44a25=createCommandSpinner('Round\x201/'+_0x88cbda[_0x3bb67e(0x200)]['length']+_0x3bb67e(0x263));_0xf44a25[_0x3bb67e(0x214)]();try{const {result:_0x452507}=await runTest(_0x1f3ce6[_0x3bb67e(0x1f3)],_0x88cbda,{'agentId':_0x2b2108,'projectId':_0x1767d4,'site':_0x2ef4a1[_0x3bb67e(0x20f)],'noEval':![],'evaluatorId':_0x306c10,'onRoundStart':(_0x5a6dc1,_0x1ff0d8)=>{const _0x56d5bd=_0x3bb67e;_0xf44a25[_0x56d5bd(0x23f)]=_0x56d5bd(0x223)+(_0x5a6dc1+0x1)+'/'+_0x1ff0d8+_0x56d5bd(0x263);},'onRoundComplete':(_0x47398b,_0x2e1eb6,_0x5001b4)=>{const _0x3e3c85=_0x3bb67e,_0x294a61=formatElapsed(_0x2e1eb6);_0x5001b4?console[_0x3e3c85(0x1f5)](_0x3e3c85(0x1f6)+(_0x47398b+0x1)+'/'+_0x88cbda['rounds']['length']+_0x3e3c85(0x25b)+a5_0x3ae5df[_0x3e3c85(0x1d7)]('✓')+'\x20('+_0x294a61+')'):console['log'](_0x3e3c85(0x1f6)+(_0x47398b+0x1)+'/'+_0x88cbda[_0x3e3c85(0x200)][_0x3e3c85(0x23e)]+_0x3e3c85(0x25b)+a5_0x3ae5df['red']('✗'));},'onEvaluationStart':()=>{const _0x2610ac=_0x3bb67e;_0xf44a25['text']=_0x2610ac(0x209);},'onEvaluationComplete':_0x2e5fdd=>{const _0x2e3382=_0x3bb67e,_0x20c743=formatElapsed(_0x2e5fdd);console[_0x2e3382(0x1f5)](_0x2e3382(0x21a)+a5_0x3ae5df[_0x2e3382(0x1d7)]('✓')+'\x20('+_0x20c743+')');}});_0xf44a25[_0x3bb67e(0x20d)](),_0x3fa831[_0x3bb67e(0x224)](_0x452507);if(_0x452507[_0x3bb67e(0x256)]===_0x3bb67e(0x1f4))console['log'](a5_0x3ae5df[_0x3bb67e(0x1d7)](_0x3bb67e(0x1e1)+_0x452507['reason'])+a5_0x3ae5df[_0x3bb67e(0x1ea)]('\x20(new)'));else _0x452507[_0x3bb67e(0x256)]===_0x3bb67e(0x22e)?console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x248)](_0x3bb67e(0x208)+_0x452507[_0x3bb67e(0x1f2)])+a5_0x3ae5df[_0x3bb67e(0x1ea)]('\x20(new)')):console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x248)](_0x3bb67e(0x210)+_0x452507['reason']));_0x452507['conversation_url']&&console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x1ea)](_0x3bb67e(0x1ef)+_0x452507[_0x3bb67e(0x21f)]));}catch(_0x49723e){_0xf44a25[_0x3bb67e(0x20d)]();const _0x393235=_0x49723e instanceof Error?_0x49723e['message']:String(_0x49723e);console['log'](a5_0x3ae5df['red'](_0x3bb67e(0x210)+_0x393235)),_0x3fa831[_0x3bb67e(0x224)]({'name':_0x88cbda[_0x3bb67e(0x203)],'status':_0x3bb67e(0x202),'reason':_0x393235,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x3bb67e(0x1f5)]();const _0x43097c=Date[_0x3bb67e(0x1ed)]()-_0x29d51b,_0x5dcb65=_0x3fa831[_0x3bb67e(0x1ec)](_0x506598=>_0x506598[_0x3bb67e(0x256)]==='PASS')[_0x3bb67e(0x23e)],_0x220230=_0x3fa831['filter'](_0x3afc6c=>_0x3afc6c[_0x3bb67e(0x256)]===_0x3bb67e(0x22e))[_0x3bb67e(0x23e)],_0x32e0af=_0x3fa831[_0x3bb67e(0x1ec)](_0x2aa4aa=>_0x2aa4aa[_0x3bb67e(0x256)]===_0x3bb67e(0x202))[_0x3bb67e(0x23e)];console[_0x3bb67e(0x1f5)]('━'[_0x3bb67e(0x241)](0x3c)),console[_0x3bb67e(0x1f5)](_0x3bb67e(0x1d3)),console[_0x3bb67e(0x1f5)]('━'[_0x3bb67e(0x241)](0x3c)),console[_0x3bb67e(0x1f5)](_0x3bb67e(0x1d1)+_0x3fa831[_0x3bb67e(0x23e)]),console[_0x3bb67e(0x1f5)](_0x3bb67e(0x206)+a5_0x3ae5df[_0x3bb67e(0x1d7)](_0x5dcb65)),console[_0x3bb67e(0x1f5)](_0x3bb67e(0x1d4)+a5_0x3ae5df[_0x3bb67e(0x248)](_0x220230));_0x32e0af>0x0&&console[_0x3bb67e(0x1f5)](_0x3bb67e(0x1f0)+a5_0x3ae5df[_0x3bb67e(0x248)](_0x32e0af));console['log']('Duration:\x20'+formatElapsed(_0x43097c)),console[_0x3bb67e(0x1f5)]('━'[_0x3bb67e(0x241)](0x3c));const _0x2bcea4={'summary':{'total':_0x3fa831[_0x3bb67e(0x23e)],'passed':_0x5dcb65,'failed':_0x220230,'errors':_0x32e0af>0x0?_0x32e0af:undefined,'duration_ms':_0x43097c},'tests':_0x3fa831,'agent':{'project':_0x1f7e84['projectName'],'name':_0x1f7e84[_0x3bb67e(0x254)],'site':_0x2a7a64},'timestamp':new Date(_0x29d51b)['toISOString']()};if(_0x4eee10!==_0x3bb67e(0x1e2)||_0x3753b5){const _0xe5a048=formatResults(_0x2bcea4,_0x4eee10);if(_0x3753b5)try{a5_0x3ef0ac['writeFileSync'](_0x3753b5,_0xe5a048,_0x3bb67e(0x25d)),console[_0x3bb67e(0x1f5)](),console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x1ea)](_0x3bb67e(0x247)+_0x3753b5));}catch(_0x3a1f09){return console[_0x3bb67e(0x1f5)](),console[_0x3bb67e(0x1f5)](a5_0x3ae5df[_0x3bb67e(0x248)]('Error\x20writing\x20output\x20file:\x20'+_0x3a1f09)),0x1;}else console['log'](),console[_0x3bb67e(0x1f5)](_0xe5a048);}const _0x3bc9ee=_0x3fa831['filter'](_0x5307c1=>_0x5307c1[_0x3bb67e(0x256)]!==_0x3bb67e(0x1f4));return _0x3bc9ee['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x24359a=a6_0x50f9;(function(_0x53791e,_0x5b0252){const _0x43fd21=a6_0x50f9,_0x3ded18=_0x53791e();while(!![]){try{const _0x4e2949=parseInt(_0x43fd21(0xdf))/0x1*(parseInt(_0x43fd21(0xf6))/0x2)+parseInt(_0x43fd21(0xdb))/0x3+-parseInt(_0x43fd21(0xe5))/0x4+parseInt(_0x43fd21(0xed))/0x5*(-parseInt(_0x43fd21(0xf3))/0x6)+parseInt(_0x43fd21(0x101))/0x7*(-parseInt(_0x43fd21(0xfe))/0x8)+parseInt(_0x43fd21(0x11c))/0x9*(parseInt(_0x43fd21(0xfc))/0xa)+parseInt(_0x43fd21(0x115))/0xb;if(_0x4e2949===_0x5b0252)break;else _0x3ded18['push'](_0x3ded18['shift']());}catch(_0x472f3d){_0x3ded18['push'](_0x3ded18['shift']());}}}(a6_0x5893,0x62d82));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x5893(){const _0x5b07de=['\x22.\x20','error','<\x20HTTP/1.1\x20','.\x20Valid\x20methods:\x20','GET','method','x-trino-user','5wKXsav','includes','output','llm-proxy','trim','indexOf','3607410DDzHQc','\x0aStack\x20trace:\x0a','Invalid\x20API\x20type:\x20','2UqPEJm','length','color','proxy-authorization','entries','cdp','10oerWlv','type','232RWcvcZ','has','message','97517TyfWEI','toUpperCase','x-auth-token','file','authorization','join','substring','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','startsWith','api','noColor','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','trino','.\x20Valid\x20types:\x20','stack','name','status','keys','validate','workflow','849629hnCDhh','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','log','verbose','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','headers','data','6242571vDbxqe','Error:\x20','2192736FSZFGR','DELETE','description','isArray','38876kuvZvB','set-cookie2','request','execute','site','cas','522184QXZbgz'];a6_0x5893=function(){return _0x5b07de;};return a6_0x5893();}function a6_0x50f9(_0x4bb3a8,_0x39a48d){_0x4bb3a8=_0x4bb3a8-0xdb;const _0x58933c=a6_0x5893();let _0x50f904=_0x58933c[_0x4bb3a8];return _0x50f904;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x24359a(0x105),a6_0x24359a(0xf9),'cookie','set-cookie',a6_0x24359a(0xe0),'x-xsrf-token',a6_0x24359a(0x103),a6_0x24359a(0xec)]);function isSensitiveHeader(_0x39cd43){const _0x6cadca=a6_0x24359a;return SENSITIVE_HEADERS[_0x6cadca(0xff)](_0x39cd43['toLowerCase']());}function parseHeader(_0x1348b7){const _0x4447e0=a6_0x24359a,_0x56f2f9=_0x1348b7[_0x4447e0(0xf2)](':');if(_0x56f2f9===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x1348b7+_0x4447e0(0xe6)+_0x4447e0(0x10c));const _0x4c20f2=_0x1348b7[_0x4447e0(0x107)](0x0,_0x56f2f9)[_0x4447e0(0xf1)](),_0xacfc32=_0x1348b7[_0x4447e0(0x107)](_0x56f2f9+0x1)[_0x4447e0(0xf1)]();if(!_0x4c20f2)throw new Error(_0x4447e0(0x116)+_0x1348b7+'\x22');return[_0x4c20f2,_0xacfc32];}export class ApiCommand extends BaseCommand{[a6_0x24359a(0x110)]='api';[a6_0x24359a(0xdd)]=a6_0x24359a(0x108);[a6_0x24359a(0x113)](_0x2e559d){const _0x26b327=a6_0x24359a,{args:_0x7b2b51,options:_0x2347d3}=_0x2e559d,_0x2c1e51=_0x2347d3;if(_0x7b2b51['length']===0x0)return _0x26b327(0x119);const _0x4c68b9=_0x7b2b51[0x0];if(!_0x4c68b9[_0x26b327(0x109)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x4c68b9;const _0x4f856c=_0x2c1e51[_0x26b327(0x11b)],_0x5a84a9=_0x2c1e51['file'];if(_0x4f856c&&_0x5a84a9)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x8c1a31=_0x2c1e51[_0x26b327(0xeb)]||_0x26b327(0xea),_0x3d59b0=[_0x26b327(0xea),'POST','PUT',_0x26b327(0xdc),'PATCH'];if(!_0x3d59b0['includes'](_0x8c1a31[_0x26b327(0x102)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x8c1a31+_0x26b327(0xe9)+_0x3d59b0[_0x26b327(0x106)](',\x20');const _0x37b01f=_0x2c1e51[_0x26b327(0xfd)]||'td',_0x35ccce=['td',_0x26b327(0xfb),_0x26b327(0x114),_0x26b327(0x10d),'llm',_0x26b327(0xf0),_0x26b327(0xe4)];if(!_0x35ccce[_0x26b327(0xee)](_0x37b01f))return _0x26b327(0xf5)+_0x37b01f+_0x26b327(0x10e)+_0x35ccce['join'](',\x20');return undefined;}async[a6_0x24359a(0xe2)](_0x4f25f4){const _0x23a3fb=a6_0x24359a,{options:_0x1b8a50,args:_0x2ed2bf,tdx:_0x3598e2}=_0x4f25f4,_0xbc0000=_0x1b8a50,_0x1f09e1=_0x2ed2bf[0x0],_0xfbb9d4=(_0xbc0000['method']||'GET')['toUpperCase'](),_0x224e7b=_0xbc0000['data'],_0x30645e=_0xbc0000[_0x23a3fb(0x104)],_0x2b53b2=_0xbc0000['header'],_0x2b7113=_0xbc0000[_0x23a3fb(0xfd)]||'td';try{const _0x2589a1={};if(_0x2b53b2){const _0x294c41=Array[_0x23a3fb(0xde)](_0x2b53b2)?_0x2b53b2:[_0x2b53b2];for(const _0x36bf52 of _0x294c41){const [_0xa951e1,_0x3c78fc]=parseHeader(_0x36bf52);_0x2589a1[_0xa951e1]=_0x3c78fc;}}let _0x4b81e6;if(_0x224e7b)_0x4b81e6=_0x224e7b;else{if(_0x30645e)try{_0x4b81e6=RawAPI['readBodyFromFile'](_0x30645e);}catch(_0x70fdfe){return console[_0x23a3fb(0xe7)](_0x23a3fb(0x11d)+(_0x70fdfe instanceof Error?_0x70fdfe[_0x23a3fb(0x100)]:String(_0x70fdfe))),0x1;}}const _0x173ed6={'method':_0xfbb9d4,'apiType':_0x2b7113,'includeHeaders':_0x1b8a50[_0x23a3fb(0x118)]};_0x4b81e6&&(_0x173ed6['body']=_0x4b81e6);Object[_0x23a3fb(0x112)](_0x2589a1)[_0x23a3fb(0xf7)]>0x0&&(_0x173ed6[_0x23a3fb(0x11a)]=_0x2589a1);if(_0x1b8a50['verbose']){const _0xeb9907=resolveSite(_0x1b8a50[_0x23a3fb(0xe3)]??'us01'),_0x300bc0=getEndpoint(_0xeb9907,_0x2b7113),_0x7fc70c=''+_0x300bc0+_0x1f09e1;console['error']('>\x20'+_0xfbb9d4+'\x20'+_0x7fc70c);const _0x5ced91=getAuthHeaders(_0xeb9907),_0x2e0581={..._0x5ced91,..._0x2589a1};for(const [_0x53f09e,_0x40e8e1]of Object[_0x23a3fb(0xfa)](_0x2e0581)){!isSensitiveHeader(_0x53f09e)&&console[_0x23a3fb(0xe7)]('>\x20'+_0x53f09e+':\x20'+_0x40e8e1);}_0x4b81e6&&console[_0x23a3fb(0xe7)]('>'),console[_0x23a3fb(0xe7)]('');}const _0x5c4560=await _0x3598e2[_0x23a3fb(0x10a)][_0x23a3fb(0xe1)](_0x1f09e1,_0x173ed6);if(_0x1b8a50[_0x23a3fb(0x118)]&&_0x5c4560[_0x23a3fb(0x11a)]){console[_0x23a3fb(0xe7)](_0x23a3fb(0xe8)+_0x5c4560[_0x23a3fb(0x111)]);for(const [_0x278b57,_0x1cdf07]of Object['entries'](_0x5c4560[_0x23a3fb(0x11a)])){!isSensitiveHeader(_0x278b57)&&console[_0x23a3fb(0xe7)]('<\x20'+_0x278b57+':\x20'+_0x1cdf07);}console['error']('');}const _0x3662bf=Boolean(_0x1b8a50[_0x23a3fb(0xef)]),_0x5d7b38={'color':_0x1b8a50[_0x23a3fb(0xf8)],'noColor':_0x1b8a50[_0x23a3fb(0x10b)]||_0x3662bf&&!_0x1b8a50[_0x23a3fb(0xf8)]},_0x3da2e0=colorizeJSON(_0x5c4560[_0x23a3fb(0x11b)],_0x5d7b38);return _0x1b8a50[_0x23a3fb(0xef)]?(writeFileSync(_0x1b8a50[_0x23a3fb(0xef)],_0x3da2e0),console[_0x23a3fb(0xe7)]('Results\x20saved\x20to\x20'+_0x1b8a50[_0x23a3fb(0xef)])):console[_0x23a3fb(0x117)](_0x3da2e0),0x0;}catch(_0x3fb786){return _0x3fb786 instanceof Error?(console[_0x23a3fb(0xe7)](_0x23a3fb(0x11d)+_0x3fb786[_0x23a3fb(0x100)]),_0x1b8a50[_0x23a3fb(0x118)]&&_0x3fb786[_0x23a3fb(0x10f)]&&console['error'](_0x23a3fb(0xf4)+_0x3fb786[_0x23a3fb(0x10f)])):console[_0x23a3fb(0xe7)]('Error:\x20'+String(_0x3fb786)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a7_0x1b6b(){const _0x11edb5=['\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x27\x20registered','profile','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','apiKey','message','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx:\x20auth\x20clear','2544230TvAkoP','logLevel','auth:setup','jobs','/app/mp/ak','\x20\x20tdx','us01','all','You\x20can\x20find\x20your\x20API\x20key\x20at:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','getUserInfo','Name:\x20','cyan','yellow','29577eimzGC','red','No\x20credential\x20found','/users/initiate_sso\x20(account:\x20','\x20and\x20','Opening\x20browser\x20for\x20authentication...','\x20(profile:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20user_id:','auth','✓\x20Profile\x20\x27','select','Use\x20an\x20API\x20key','bold','537345YGCAdj','Choose\x20how\x20to\x20sign\x20in:','auth:clear','error','For\x20scripts\x20or\x20headless\x20servers','Validating\x20API\x20key...','method','2996040Fazytf','Validating\x20OAuth\x20tokens...','User:\x20','Setup\x20cancelled','password','first_name','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','last_name','System\x20keychain\x20is\x20not\x20available','/oauth/authorize','Print\x20the\x20current\x20OAuth\x20access\x20token','No\x20credentials\x20found\x20in\x20keychain','email','Credential\x20type:\x20OAuth','API\x20key\x20cannot\x20be\x20empty','OAuth\x20tokens','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20--profile\x20','oauth','name','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','execute','tdx:\x20auth\x20setup','2556631RAdVsk','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','filter','\x20(site:\x20','✓\x20Authentication\x20successful\x0a','accountName','status','Remove\x20API\x20key\x20from\x20system\x20keychain','join','apikey','1130GgKWdh','green','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Read\x20credential\x20from\x20','\x0aSetup\x20cancelled','N/A','\x20for\x20profile:\x20','trim','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','ERROR','site','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Default\x20site\x20set\x20to\x20','1384524ETkisK','access_token','create','auth:token','API\x20key','✓\x20Signed\x20in\x20successfully','description','warn','\x20\x20(','log','1968VeRjKg','6cHkVNe'];a7_0x1b6b=function(){return _0x11edb5;};return a7_0x1b6b();}const a7_0x42bd4e=a7_0x4d33;(function(_0x12404f,_0x388b69){const _0x8620db=a7_0x4d33,_0xf8ff1b=_0x12404f();while(!![]){try{const _0x2227f9=-parseInt(_0x8620db(0x89))/0x1+parseInt(_0x8620db(0xc0))/0x2*(parseInt(_0x8620db(0x6c))/0x3)+-parseInt(_0x8620db(0xcd))/0x4+-parseInt(_0x8620db(0x79))/0x5*(parseInt(_0x8620db(0x6d))/0x6)+parseInt(_0x8620db(0xb6))/0x7+parseInt(_0x8620db(0x9e))/0x8+parseInt(_0x8620db(0x97))/0x9;if(_0x2227f9===_0x388b69)break;else _0xf8ff1b['push'](_0xf8ff1b['shift']());}catch(_0x192d96){_0xf8ff1b['push'](_0xf8ff1b['shift']());}}}(a7_0x1b6b,0x45b59));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x3d0940 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x9e0d82 from'chalk';export async function runOAuthLoginFlow(_0x41339c,_0x29f0da,_0x109c68,_0x2c9ba4){const _0x10bcfb=a7_0x4d33,_0x2cc274=await isKeychainAvailable();if(!_0x2cc274)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x10bcfb(0x70));let _0xfe6955=_0x2c9ba4?.[_0x10bcfb(0xbb)];if(!_0xfe6955){const _0x18b18e=await a7_0x3d0940({'type':'text','name':'accountName','message':_0x10bcfb(0x71)});if(_0x18b18e['accountName']===undefined)throw new Error(_0x10bcfb(0xa1));_0xfe6955=_0x18b18e[_0x10bcfb(0xbb)][_0x10bcfb(0xc7)]()||undefined;}const _0x5542f2=getConsoleUrl(_0x41339c);console[_0x10bcfb(0x6b)](_0x10bcfb(0x8e));_0xfe6955?console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0x8c)+_0xfe6955+')'):console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0xa8));console['log'](_0x10bcfb(0xc2));const _0x2f1a67=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x30ef48=await startOAuthFlow(_0x41339c,{'accountName':_0xfe6955,'proxy':_0x2f1a67});console[_0x10bcfb(0x6b)](_0x10bcfb(0x9f));const _0x4807bb=TDX[_0x10bcfb(0xcf)]({'site':_0x41339c,'accessToken':_0x30ef48[_0x10bcfb(0xce)],'logLevel':_0x109c68??LogLevel['ERROR']}),_0x6f4b94=await _0x4807bb[_0x10bcfb(0x7c)][_0x10bcfb(0x85)]();console[_0x10bcfb(0x6b)](a7_0x9e0d82[_0x10bcfb(0xc1)](_0x10bcfb(0x67))),console[_0x10bcfb(0x6b)]('\x20\x20'+a7_0x9e0d82[_0x10bcfb(0x87)](_0x41339c+':'+_0x6f4b94['account_id'])+_0x10bcfb(0x91)+_0x6f4b94['id']+_0x10bcfb(0x6a)+_0x6f4b94['email']+')');!_0xfe6955&&(console['log'](a7_0x9e0d82['dim'](_0x10bcfb(0x6e))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0x74))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0xaf))));await saveOAuthTokens(_0x30ef48,_0x29f0da),console[_0x10bcfb(0x6b)](_0x10bcfb(0xa5)+(_0x29f0da?_0x10bcfb(0x8f)+_0x29f0da+')':''));if(_0x29f0da){const _0x5c7266={'site':_0x41339c};saveProfileToUserConfig(_0x29f0da,_0x5c7266),console[_0x10bcfb(0x6b)](_0x10bcfb(0x93)+_0x29f0da+_0x10bcfb(0x72));}else saveDefaultSiteToUserConfig(_0x41339c),console['log'](_0x10bcfb(0xcc)+_0x41339c);const _0x5de05b=_0x29f0da?'\x20--profile\x20'+_0x29f0da:'';console[_0x10bcfb(0x6b)](),console[_0x10bcfb(0x6b)](_0x10bcfb(0x82)),console['log'](_0x10bcfb(0x7e)+_0x5de05b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x10bcfb(0x6b)](_0x10bcfb(0x7e)+_0x5de05b+_0x10bcfb(0x90));}function a7_0x4d33(_0xf18cd4,_0x3f9975){_0xf18cd4=_0xf18cd4-0x66;const _0x1b6b09=a7_0x1b6b();let _0x4d334e=_0x1b6b09[_0xf18cd4];return _0x4d334e;}export async function promptAuthMethod(){const _0x391a10=a7_0x4d33,_0xeb5a92=await a7_0x3d0940({'type':_0x391a10(0x94),'name':_0x391a10(0x9d),'message':_0x391a10(0x98),'choices':[{'title':_0x391a10(0x6f),'description':_0x391a10(0xb7),'value':'oauth'},{'title':_0x391a10(0x95),'description':_0x391a10(0x9b),'value':_0x391a10(0xbf)}]});return _0xeb5a92[_0x391a10(0x9d)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x7b);[a7_0x42bd4e(0x68)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x42bd4e(0xb4)](_0x494e8d){const _0x48f354=a7_0x42bd4e,{options:_0xbf79ab}=_0x494e8d,_0x119e1d=_0xbf79ab[_0x48f354(0x73)];console[_0x48f354(0x6b)](a7_0x9e0d82['bold'](_0x48f354(0xb5)));const _0xee8aaa=_0xbf79ab[_0x48f354(0xca)]||_0x48f354(0x7f),_0x505a2b=await promptSiteSelection(_0xee8aaa,_0x119e1d,_0x48f354(0xa1));if(!_0x505a2b)return 0x1;const _0x1263ef=resolveSite(_0x505a2b),_0x2b3942=await promptAuthMethod();if(!_0x2b3942)return console['log'](_0x48f354(0xc4)),0x1;if(_0x2b3942===_0x48f354(0xb1)){const {accountName:_0x1aa189}=_0xbf79ab;return await runOAuthLoginFlow(_0x1263ef,_0x119e1d,_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)],{'accountName':_0x1aa189}),0x0;}console[_0x48f354(0x6b)](_0x48f354(0x77)+_0x1263ef),console['log'](_0x48f354(0x81)),console[_0x48f354(0x6b)]('\x20\x20'+getConsoleUrl(_0x1263ef,_0x48f354(0x7d)));const _0x52b6e9=await a7_0x3d0940({'type':_0x48f354(0xa2),'name':_0x48f354(0x75),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x5f3f06=>{const _0x152108=_0x48f354;if(!_0x5f3f06||!_0x5f3f06[_0x152108(0xc7)]())return _0x152108(0xad);return!![];}});if(!_0x52b6e9[_0x48f354(0x75)])return console[_0x48f354(0x6b)](_0x48f354(0xc4)),0x1;const _0x2903ba=_0x52b6e9[_0x48f354(0x75)];console['log'](_0x48f354(0x9c));try{const _0x2f8343=TDX[_0x48f354(0xcf)]({'site':_0x1263ef,'apiKey':_0x2903ba[_0x48f354(0xc7)](),'logLevel':_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)]}),_0x153fc6=await _0x2f8343['jobs'][_0x48f354(0x85)]();console[_0x48f354(0x6b)](_0x48f354(0xcb)+_0x153fc6[_0x48f354(0xab)]+')');const _0x2c9456=await isKeychainAvailable();_0x2c9456?(await saveAPIKeyAsync(_0x2903ba[_0x48f354(0xc7)](),_0x1263ef,_0x119e1d),console[_0x48f354(0x6b)](_0x48f354(0xc8)+(_0x119e1d?_0x48f354(0x8f)+_0x119e1d+')':''))):(console[_0x48f354(0x69)](a7_0x9e0d82['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x9e0d82['yellow'](_0x48f354(0x84))));if(_0x119e1d){const _0xdd8811={'site':_0x1263ef};saveProfileToUserConfig(_0x119e1d,_0xdd8811),console[_0x48f354(0x6b)](_0x48f354(0x93)+_0x119e1d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1263ef),console['log'](_0x48f354(0xcc)+_0x1263ef);const _0x323ba8=_0x119e1d?_0x48f354(0xb0)+_0x119e1d:'';return console['log'](),console[_0x48f354(0x6b)](_0x48f354(0x82)),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+_0x48f354(0x90)),0x0;}catch(_0x5a5c01){if(_0x5a5c01 instanceof HTTPClientError&&_0x5a5c01[_0x48f354(0xbc)]===0x191)return printAuthError(_0x5a5c01),0x1;return console[_0x48f354(0x9a)](a7_0x9e0d82[_0x48f354(0x8a)](_0x48f354(0x83)+(_0x5a5c01 instanceof Error?_0x5a5c01[_0x48f354(0x76)]:String(_0x5a5c01)))),console[_0x48f354(0x9a)](_0x48f354(0xb3)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x92);['description']=a7_0x42bd4e(0xa4);async['execute'](_0x2bbc3f){const _0x887826=a7_0x42bd4e,{options:_0x313548,tdx:_0x1f42a7}=_0x2bbc3f,_0x1b75d0=_0x313548[_0x887826(0xca)],_0x4eb0c4=_0x313548['profile'],_0x3136c5=_0x4eb0c4?_0x4eb0c4:_0x887826(0xc5);console[_0x887826(0x6b)]('tdx\x20profile:\x20'+_0x3136c5+_0x887826(0xb9)+_0x1b75d0+')');const _0x48903c=await getOAuthTokens(_0x4eb0c4);if(_0x48903c)console[_0x887826(0x6b)](_0x887826(0xac)),console[_0x887826(0x6b)]('Read\x20credential\x20from\x20keychain'+(_0x4eb0c4?_0x887826(0x8f)+_0x4eb0c4+')':''));else{const _0x302f74=await resolveAPIKeyAsync(_0x1b75d0,_0x4eb0c4);if(_0x302f74){const {source:_0x64e039,isDeprecated:_0x1047fa}=_0x302f74,_0x4022d9=_0x887826(0xc3)+_0x64e039;console[_0x887826(0x6b)](_0x1047fa?a7_0x9e0d82['yellow'](_0x4022d9):_0x4022d9);}else console[_0x887826(0x6b)](a7_0x9e0d82[_0x887826(0x88)](_0x887826(0x8b)));}try{const _0x3366ae=await _0x1f42a7[_0x887826(0x7c)][_0x887826(0x85)]();return console[_0x887826(0x6b)](a7_0x9e0d82['green'](_0x887826(0xba))),console[_0x887826(0x6b)](_0x887826(0xa0)+_0x3366ae['email']),(_0x3366ae[_0x887826(0xa3)]||_0x3366ae[_0x887826(0xa6)])&&console[_0x887826(0x6b)](_0x887826(0x86)+[_0x3366ae[_0x887826(0xa3)],_0x3366ae[_0x887826(0xa6)]][_0x887826(0xb8)](Boolean)[_0x887826(0xbe)]('\x20')),0x0;}catch(_0x152637){return _0x152637 instanceof HTTPClientError&&_0x152637[_0x887826(0xbc)]===0x191?printAuthError(_0x152637,!![],_0x4eb0c4):console[_0x887826(0x9a)](a7_0x9e0d82[_0x887826(0x8a)](_0x887826(0x83)+(_0x152637 instanceof Error?_0x152637['message']:String(_0x152637)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0xd0);['description']=a7_0x42bd4e(0xa9);async['execute'](_0x22af48){const _0x5dce7a=a7_0x42bd4e,{options:_0x2bb805}=_0x22af48,_0x3f793f=await resolveOAuthAccessToken({'site':resolveSite(_0x2bb805['site']||_0x5dce7a(0x7f)),'profile':_0x2bb805[_0x5dce7a(0x73)],'proxy':loadGlobalProxy()});return console['log'](_0x3f793f),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x99);[a7_0x42bd4e(0x68)]=a7_0x42bd4e(0xbd);async[a7_0x42bd4e(0xb4)](_0x3f3900){const _0x36dd51=a7_0x42bd4e,{options:_0x53c158}=_0x3f3900,_0x35895a=_0x53c158[_0x36dd51(0x73)];console[_0x36dd51(0x6b)](a7_0x9e0d82[_0x36dd51(0x96)](_0x36dd51(0x78)));const _0x232d58=await isKeychainAvailable();if(!_0x232d58)return console[_0x36dd51(0x9a)](a7_0x9e0d82[_0x36dd51(0x8a)](_0x36dd51(0xa7))),0x1;const [_0xd4e1fc,_0x40271c]=await Promise[_0x36dd51(0x80)]([deleteKeychainAPIKey(_0x35895a),deleteOAuthTokens(_0x35895a)]);if(_0xd4e1fc||_0x40271c){clearCredentialCache();const _0x4b6b98=[_0xd4e1fc&&_0x36dd51(0x66),_0x40271c&&_0x36dd51(0xae)][_0x36dd51(0xb8)](Boolean)[_0x36dd51(0xbe)](_0x36dd51(0x8d));return console[_0x36dd51(0x6b)]('✓\x20'+_0x4b6b98+'\x20removed\x20from\x20keychain'+(_0x35895a?_0x36dd51(0x8f)+_0x35895a+')':'')),0x0;}else return console[_0x36dd51(0x6b)](_0x36dd51(0xaa)+(_0x35895a?_0x36dd51(0xc6)+_0x35895a:'')),0x1;}}
|
|
1
|
+
const a7_0x25d09b=a7_0x37ea;(function(_0x291f5b,_0x1b9c1b){const _0x4a0e48=a7_0x37ea,_0x305934=_0x291f5b();while(!![]){try{const _0x11c635=parseInt(_0x4a0e48(0x206))/0x1*(-parseInt(_0x4a0e48(0x220))/0x2)+parseInt(_0x4a0e48(0x227))/0x3+-parseInt(_0x4a0e48(0x1fc))/0x4+parseInt(_0x4a0e48(0x21b))/0x5+-parseInt(_0x4a0e48(0x236))/0x6*(-parseInt(_0x4a0e48(0x22f))/0x7)+-parseInt(_0x4a0e48(0x238))/0x8*(-parseInt(_0x4a0e48(0x242))/0x9)+-parseInt(_0x4a0e48(0x22a))/0xa;if(_0x11c635===_0x1b9c1b)break;else _0x305934['push'](_0x305934['shift']());}catch(_0x393d19){_0x305934['push'](_0x305934['shift']());}}}(a7_0xd48b,0xedcb9));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x37ea94 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x2b03c8 from'chalk';export async function runOAuthLoginFlow(_0x4a49a9,_0x4ac9ae,_0x27e19b,_0x358976){const _0x16e385=a7_0x37ea,_0x3ddc21=await isKeychainAvailable();if(!_0x3ddc21)throw new Error(_0x16e385(0x1eb)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x22b25b=_0x358976?.[_0x16e385(0x213)];if(!_0x22b25b){const _0x335efc=await a7_0x37ea94({'type':_0x16e385(0x21c),'name':_0x16e385(0x213),'message':_0x16e385(0x244)});if(_0x335efc['accountName']===undefined)throw new Error(_0x16e385(0x1e6));_0x22b25b=_0x335efc[_0x16e385(0x213)][_0x16e385(0x202)]()||undefined;}const _0x1780f9=getConsoleUrl(_0x4a49a9);console[_0x16e385(0x240)](_0x16e385(0x23d));_0x22b25b?console['log']('\x20\x20'+_0x1780f9+'/users/initiate_sso\x20(account:\x20'+_0x22b25b+')'):console['log']('\x20\x20'+_0x1780f9+_0x16e385(0x225));console[_0x16e385(0x240)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x5c3d8f=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x3e77dd=await startOAuthFlow(_0x4a49a9,{'accountName':_0x22b25b,'proxy':_0x5c3d8f});console['log']('Validating\x20OAuth\x20tokens...');const _0x1aedfb=TDX['create']({'site':_0x4a49a9,'accessToken':_0x3e77dd['access_token'],'logLevel':_0x27e19b??LogLevel[_0x16e385(0x21f)]}),_0x19376a=await _0x1aedfb['jobs'][_0x16e385(0x22b)]();console[_0x16e385(0x240)](a7_0x2b03c8[_0x16e385(0x234)]('✓\x20Signed\x20in\x20successfully')),console['log']('\x20\x20'+a7_0x2b03c8[_0x16e385(0x200)](_0x4a49a9+':'+_0x19376a[_0x16e385(0x1f5)])+_0x16e385(0x248)+_0x19376a['id']+'\x20\x20('+_0x19376a[_0x16e385(0x20f)]+')');!_0x22b25b&&(console[_0x16e385(0x240)](a7_0x2b03c8['dim'](_0x16e385(0x207))),console[_0x16e385(0x240)](a7_0x2b03c8[_0x16e385(0x1fe)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x16e385(0x240)](a7_0x2b03c8[_0x16e385(0x1fe)](_0x16e385(0x218))));await saveOAuthTokens(_0x3e77dd,_0x4ac9ae),console[_0x16e385(0x240)](_0x16e385(0x215)+(_0x4ac9ae?_0x16e385(0x203)+_0x4ac9ae+')':''));if(_0x4ac9ae){const _0x24a256={'site':_0x4a49a9};saveProfileToUserConfig(_0x4ac9ae,_0x24a256),console[_0x16e385(0x240)](_0x16e385(0x239)+_0x4ac9ae+_0x16e385(0x1fa));}else saveDefaultSiteToUserConfig(_0x4a49a9),console[_0x16e385(0x240)](_0x16e385(0x246)+_0x4a49a9);const _0x4cf7e1=_0x4ac9ae?_0x16e385(0x23f)+_0x4ac9ae:'';console[_0x16e385(0x240)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x16e385(0x240)](_0x16e385(0x23c)+_0x4cf7e1+_0x16e385(0x231)),console[_0x16e385(0x240)]('\x20\x20tdx'+_0x4cf7e1+_0x16e385(0x237));}export async function promptAuthMethod(){const _0x40202b=a7_0x37ea,_0x6ac970=await a7_0x37ea94({'type':_0x40202b(0x20e),'name':'method','message':_0x40202b(0x1ef),'choices':[{'title':_0x40202b(0x20b),'description':_0x40202b(0x20d),'value':_0x40202b(0x224)},{'title':'Use\x20an\x20API\x20key','description':_0x40202b(0x214),'value':_0x40202b(0x222)}]});return _0x6ac970[_0x40202b(0x205)]||null;}function a7_0x37ea(_0x4e95f5,_0x860e7){_0x4e95f5=_0x4e95f5-0x1e6;const _0xd48b46=a7_0xd48b();let _0x37ea46=_0xd48b46[_0x4e95f5];return _0x37ea46;}export class AuthSetupCommand extends BaseCommand{[a7_0x25d09b(0x1f2)]=a7_0x25d09b(0x1ec);[a7_0x25d09b(0x1e8)]=a7_0x25d09b(0x1fd);async[a7_0x25d09b(0x229)](_0x92b8fe){const _0x1e8447=a7_0x25d09b,{options:_0x2a709c}=_0x92b8fe,_0x1e6f2a=_0x2a709c[_0x1e8447(0x221)];console[_0x1e8447(0x240)](a7_0x2b03c8[_0x1e8447(0x216)](_0x1e8447(0x209)));const _0x3b004a=_0x2a709c['site']||_0x1e8447(0x1f8),_0x339bc9=await promptSiteSelection(_0x3b004a,_0x1e6f2a,'Setup\x20cancelled');if(!_0x339bc9)return 0x1;const _0x21c006=resolveSite(_0x339bc9),_0x3038f6=await promptAuthMethod();if(!_0x3038f6)return console[_0x1e8447(0x240)]('\x0aSetup\x20cancelled'),0x1;if(_0x3038f6===_0x1e8447(0x224)){const {accountName:_0xd958e6}=_0x2a709c;return await runOAuthLoginFlow(_0x21c006,_0x1e6f2a,_0x2a709c['logLevel']??LogLevel[_0x1e8447(0x21f)],{'accountName':_0xd958e6}),0x0;}console['log'](_0x1e8447(0x235)+_0x21c006),console[_0x1e8447(0x240)](_0x1e8447(0x20c)),console['log']('\x20\x20'+getConsoleUrl(_0x21c006,_0x1e8447(0x1f4)));const _0x398fc0=await a7_0x37ea94({'type':'password','name':_0x1e8447(0x228),'message':_0x1e8447(0x1fb),'validate':_0x1cae3b=>{const _0x7fa24b=_0x1e8447;if(!_0x1cae3b||!_0x1cae3b[_0x7fa24b(0x202)]())return _0x7fa24b(0x247);return!![];}});if(!_0x398fc0[_0x1e8447(0x228)])return console[_0x1e8447(0x240)]('\x0aSetup\x20cancelled'),0x1;const _0x206d8f=_0x398fc0[_0x1e8447(0x228)];console[_0x1e8447(0x240)](_0x1e8447(0x210));try{const _0x1a216f=TDX[_0x1e8447(0x243)]({'site':_0x21c006,'apiKey':_0x206d8f[_0x1e8447(0x202)](),'logLevel':_0x2a709c[_0x1e8447(0x21d)]??LogLevel[_0x1e8447(0x21f)]}),_0x25568c=await _0x1a216f[_0x1e8447(0x1ff)][_0x1e8447(0x22b)]();console[_0x1e8447(0x240)](_0x1e8447(0x204)+_0x25568c['email']+')');const _0x5ba8e4=await isKeychainAvailable();_0x5ba8e4?(await saveAPIKeyAsync(_0x206d8f[_0x1e8447(0x202)](),_0x21c006,_0x1e6f2a),console[_0x1e8447(0x240)](_0x1e8447(0x1f6)+(_0x1e6f2a?'\x20(profile:\x20'+_0x1e6f2a+')':''))):(console[_0x1e8447(0x211)](a7_0x2b03c8['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x1e8447(0x211)](a7_0x2b03c8[_0x1e8447(0x21a)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x1e6f2a){const _0x37b9a5={'site':_0x21c006};saveProfileToUserConfig(_0x1e6f2a,_0x37b9a5),console[_0x1e8447(0x240)](_0x1e8447(0x239)+_0x1e6f2a+_0x1e8447(0x1fa));}else saveDefaultSiteToUserConfig(_0x21c006),console[_0x1e8447(0x240)](_0x1e8447(0x246)+_0x21c006);const _0x3ff887=_0x1e6f2a?_0x1e8447(0x23f)+_0x1e6f2a:'';return console['log'](),console['log'](_0x1e8447(0x1e7)),console['log'](_0x1e8447(0x23c)+_0x3ff887+_0x1e8447(0x231)),console['log']('\x20\x20tdx'+_0x3ff887+_0x1e8447(0x237)),0x0;}catch(_0x3c9c2f){if(_0x3c9c2f instanceof HTTPClientError&&_0x3c9c2f[_0x1e8447(0x23a)]===0x191)return printAuthError(_0x3c9c2f),0x1;return console[_0x1e8447(0x241)](a7_0x2b03c8[_0x1e8447(0x219)]('✗\x20Validation\x20failed:\x20'+(_0x3c9c2f instanceof Error?_0x3c9c2f[_0x1e8447(0x1f3)]:String(_0x3c9c2f)))),console[_0x1e8447(0x241)](_0x1e8447(0x233)),0x1;}}}function a7_0xd48b(){const _0x7ccae5=['OAuth\x20tokens','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','auth:setup','System\x20keychain\x20is\x20not\x20available','Print\x20the\x20current\x20OAuth\x20access\x20token','Choose\x20how\x20to\x20sign\x20in:','No\x20credentials\x20found\x20in\x20keychain','all','name','message','/app/mp/ak','account_id','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Remove\x20API\x20key\x20from\x20system\x20keychain','us01','site','\x27\x20registered','Enter\x20your\x20TD\x20API\x20key:','6020520YVVsyd','Setup\x20API\x20key\x20authentication\x20interactively','dim','jobs','cyan','last_name','trim','\x20(profile:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','method','5113voXWUR','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x20and\x20','tdx:\x20auth\x20setup','User:\x20','Sign\x20in\x20with\x20browser\x20(recommended)','You\x20can\x20find\x20your\x20API\x20key\x20at:','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','select','email','Validating\x20API\x20key...','warn','No\x20credential\x20found','accountName','For\x20scripts\x20or\x20headless\x20servers','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','bold','join','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','red','yellow','2246395fNxJPl','text','logLevel','filter','ERROR','242dnqZle','profile','apikey','\x20for\x20profile:\x20','oauth','/oauth/authorize','API\x20key','4264878vAtTpB','apiKey','execute','13589210tMNPSv','getUserInfo','tdx\x20profile:\x20','N/A','\x20removed\x20from\x20keychain','14KHYWNk','auth:clear','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','first_name','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','green','Setting\x20up\x20authentication\x20for\x20site:\x20','2254740QipKoo','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','2445664YsIVmq','✓\x20Profile\x20\x27','status','Read\x20credential\x20from\x20','\x20\x20tdx','Opening\x20browser\x20for\x20authentication...','auth','\x20--profile\x20','log','error','54IgQOfs','create','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Default\x20site\x20set\x20to\x20','API\x20key\x20cannot\x20be\x20empty','\x20\x20user_id:','✗\x20Validation\x20failed:\x20','Setup\x20cancelled','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','description','Name:\x20'];a7_0xd48b=function(){return _0x7ccae5;};return a7_0xd48b();}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x25d09b(0x23e);[a7_0x25d09b(0x1e8)]=a7_0x25d09b(0x245);async[a7_0x25d09b(0x229)](_0x4cdf17){const _0x76f8d=a7_0x25d09b,{options:_0x3492de,tdx:_0x13b5c7}=_0x4cdf17,_0x1d48b6=_0x3492de['site'],_0x26d615=_0x3492de[_0x76f8d(0x221)],_0x5c64d1=_0x26d615?_0x26d615:_0x76f8d(0x22d);console[_0x76f8d(0x240)](_0x76f8d(0x22c)+_0x5c64d1+'\x20(site:\x20'+_0x1d48b6+')');const _0x236367=await getOAuthTokens(_0x26d615);if(_0x236367)console[_0x76f8d(0x240)]('Credential\x20type:\x20OAuth'),console[_0x76f8d(0x240)]('Read\x20credential\x20from\x20keychain'+(_0x26d615?_0x76f8d(0x203)+_0x26d615+')':''));else{const _0x105eb5=await resolveAPIKeyAsync(_0x1d48b6,_0x26d615);if(_0x105eb5){const {source:_0x28d3c1,isDeprecated:_0xb2c223}=_0x105eb5,_0x5d3899=_0x76f8d(0x23b)+_0x28d3c1;console[_0x76f8d(0x240)](_0xb2c223?a7_0x2b03c8[_0x76f8d(0x21a)](_0x5d3899):_0x5d3899);}else console['log'](a7_0x2b03c8[_0x76f8d(0x21a)](_0x76f8d(0x212)));}try{const _0x3d46f1=await _0x13b5c7[_0x76f8d(0x1ff)][_0x76f8d(0x22b)]();return console[_0x76f8d(0x240)](a7_0x2b03c8['green']('✓\x20Authentication\x20successful\x0a')),console[_0x76f8d(0x240)](_0x76f8d(0x20a)+_0x3d46f1[_0x76f8d(0x20f)]),(_0x3d46f1['first_name']||_0x3d46f1[_0x76f8d(0x201)])&&console[_0x76f8d(0x240)](_0x76f8d(0x1e9)+[_0x3d46f1[_0x76f8d(0x232)],_0x3d46f1[_0x76f8d(0x201)]][_0x76f8d(0x21e)](Boolean)[_0x76f8d(0x217)]('\x20')),0x0;}catch(_0x930594){return _0x930594 instanceof HTTPClientError&&_0x930594['status']===0x191?printAuthError(_0x930594,!![],_0x26d615):console['error'](a7_0x2b03c8[_0x76f8d(0x219)](_0x76f8d(0x249)+(_0x930594 instanceof Error?_0x930594[_0x76f8d(0x1f3)]:String(_0x930594)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{['name']='auth:token';['description']=a7_0x25d09b(0x1ee);async[a7_0x25d09b(0x229)](_0x598b1f){const _0x189d01=a7_0x25d09b,{options:_0x3e3a26}=_0x598b1f,_0x2c78d0=await resolveOAuthAccessToken({'site':resolveSite(_0x3e3a26[_0x189d01(0x1f9)]||'us01'),'profile':_0x3e3a26['profile'],'proxy':loadGlobalProxy()});return console['log'](_0x2c78d0),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x25d09b(0x1f2)]=a7_0x25d09b(0x230);[a7_0x25d09b(0x1e8)]=a7_0x25d09b(0x1f7);async[a7_0x25d09b(0x229)](_0x477d8a){const _0x3254c1=a7_0x25d09b,{options:_0x52bea9}=_0x477d8a,_0x37fd20=_0x52bea9['profile'];console['log'](a7_0x2b03c8[_0x3254c1(0x216)]('tdx:\x20auth\x20clear'));const _0x16dbc8=await isKeychainAvailable();if(!_0x16dbc8)return console[_0x3254c1(0x241)](a7_0x2b03c8[_0x3254c1(0x219)](_0x3254c1(0x1ed))),0x1;const [_0x559dd8,_0x5139e9]=await Promise[_0x3254c1(0x1f1)]([deleteKeychainAPIKey(_0x37fd20),deleteOAuthTokens(_0x37fd20)]);if(_0x559dd8||_0x5139e9){clearCredentialCache();const _0x255736=[_0x559dd8&&_0x3254c1(0x226),_0x5139e9&&_0x3254c1(0x1ea)][_0x3254c1(0x21e)](Boolean)['join'](_0x3254c1(0x208));return console['log']('✓\x20'+_0x255736+_0x3254c1(0x22e)+(_0x37fd20?_0x3254c1(0x203)+_0x37fd20+')':'')),0x0;}else return console[_0x3254c1(0x240)](_0x3254c1(0x1f0)+(_0x37fd20?_0x3254c1(0x223)+_0x37fd20:'')),0x1;}}
|