@treasuredata/tdx 2026.8.3 → 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.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +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_0x47f0cf=a4_0x5298;(function(_0x1c05af,_0x5a1eaf){const _0x4c2b15=a4_0x5298,_0x909c68=_0x1c05af();while(!![]){try{const _0x11cb98=-parseInt(_0x4c2b15(0x169))/0x1+-parseInt(_0x4c2b15(0x124))/0x2*(-parseInt(_0x4c2b15(0xff))/0x3)+-parseInt(_0x4c2b15(0x11b))/0x4*(-parseInt(_0x4c2b15(0x138))/0x5)+-parseInt(_0x4c2b15(0x13e))/0x6+-parseInt(_0x4c2b15(0xc4))/0x7*(-parseInt(_0x4c2b15(0x12d))/0x8)+-parseInt(_0x4c2b15(0x100))/0x9*(parseInt(_0x4c2b15(0xe9))/0xa)+parseInt(_0x4c2b15(0x123))/0xb*(-parseInt(_0x4c2b15(0x168))/0xc);if(_0x11cb98===_0x5a1eaf)break;else _0x909c68['push'](_0x909c68['shift']());}catch(_0x142281){_0x909c68['push'](_0x909c68['shift']());}}}(a4_0x2901,0x88557));import a4_0xc18c19 from'chalk';import a4_0x1ef39c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x2901(){const _0x4f7c58=['\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','session','Source:\x20','666105fsgOXO','2149426xaZyvm','MISSING_ARGUMENT','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','-\x20nothing\x20pushed','\x20unchanged','\x0aPush\x20summary\x20for\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20resources?','\x20\x20Integrations:\x20','2917496aIIuIv','Pulling\x20agent\x20\x22','New\x20project:\x20','Would\x20clone:','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','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)','projectId','integrations','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20\x22','336125GkEgqK','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Experimental\x20Artifact\x20\x22','newProjectId','\x0a✔\x20Pushed\x20','\x20errors','5131122qFcJZQ','\x20|\x20','no_context','\x22\x20to\x20a\x20different\x20profile','repeat','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Analyzing\x20changes\x20to\x20push...','\x20\x20Agent\x20\x22','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20files\x20to\x20','green','\x0aError:','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','reason','parse','Status:\x20','New\x20project\x20ID:\x20','Using\x20project:\x20','dryRun','agent','\x20\x20Prompts:\x20','join','\x20\x20Chat\x20Interface\x20\x22','chatInterfaces','force','Agent:\x20','gray','formInterfaces','\x0aPull\x20summary\x20for\x20\x27','llm','prompts','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','newProjectName','red','<new-name>','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','created','\x20changed','cwd-config','36asceet','690020xQpNOJ','\x0aChanges:','agentId','experimentalArtifacts','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pullProject','\x20\x20Experimental\x20Artifacts:\x20','agent:pull','pushProject','\x22\x20from\x20project\x20\x22','\x20total','Cancelled','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','pushAgent','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','projectDir','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20--profile\x20','log','Errors:','arg-dir','cloneProject','Output\x20path:\x20','Output:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Knowledge\x20Bases:\x20','errors','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','description','total','21feSytj','\x0a✔\x20Pulled\x20','outputPath','outputDir','output','projectName','\x20successfully','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20integration\x20\x27','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Form\x20Interfaces:\x20','unchanged','isNew','textKnowledgeBases','yellow','agents','Pushing\x20to\x20project...','\x20created','\x0aProject\x20pushed\x20with\x20errors','Using\x20local\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','site','\x20\x20Knowledge\x20Base\x20\x22','context','llm_project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Writing\x20files...','\x20resources\x20to\x20\x27','found','sourceProjectName','\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\x20Chat\x20Interfaces:\x20','\x20=\x20','20DMqUMf','\x22:\x20','agent:clone','\x20\x20Integration\x20\x22','Chat:\x20','diff','\x20\x20Source:\x20','cwd','action','knowledgeBases','\x22...','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','tdx.json','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','\x20updated','\x20\x20Agents:\x20','experimentalKnowledgeBases','Project\x20cloned\x20successfully','source','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','3LRGxmF','2198268xVVYHO','error','yes','cyan','Analyzing\x20project\x20\x22','✔\x20Context\x20set:\x20','Project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x0aErrors\x20found:','updated','Using\x20context\x20project:\x20','New\x20project\x20name\x20is\x20required','no_local_folder','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','utf-8','\x20--name\x20','name','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Agent\x20pulled\x20successfully','\x20\x20Form\x20Interface\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','counts','Using\x20project\x20from\x20context:\x20','llmProject','\x20\x20Prompt\x20\x22','new','\x0aChanges\x20to\x20agent\x20\x27','36yXlIgL','push','INVALID_ARGUMENT','\x20new','\x20\x20Target:\x20'];a4_0x2901=function(){return _0x4f7c58;};return a4_0x2901();}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';function a4_0x5298(_0x26305c,_0x5ca2f8){_0x26305c=_0x26305c-0xb5;const _0x290144=a4_0x2901();let _0x529857=_0x290144[_0x26305c];return _0x529857;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x310ac2){const _0xcd38bc=a4_0x5298,_0x47cbba=[];if(_0x310ac2['total']!==undefined)_0x47cbba[_0xcd38bc(0x11c)](_0x310ac2['total']+_0xcd38bc(0x173));if(_0x310ac2[_0xcd38bc(0x119)]!==undefined&&_0x310ac2['new']>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x148)](_0x310ac2['new']+_0xcd38bc(0x11e)));if(_0x310ac2[_0xcd38bc(0x165)]!==undefined&&_0x310ac2[_0xcd38bc(0x165)]>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x148)](_0x310ac2['created']+_0xcd38bc(0xd7)));if(_0x310ac2[_0xcd38bc(0x109)]!==undefined&&_0x310ac2['updated']>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0xd4)](_0x310ac2[_0xcd38bc(0x109)]+_0xcd38bc(0xf8)));if(_0x310ac2[_0xcd38bc(0xd1)]!==undefined&&_0x310ac2['unchanged']>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x158)](_0x310ac2[_0xcd38bc(0xd1)]+'\x20unchanged'));if(_0x310ac2[_0xcd38bc(0xc0)]!==undefined&&_0x310ac2[_0xcd38bc(0xc0)]>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x160)](_0x310ac2[_0xcd38bc(0xc0)]+_0xcd38bc(0x13d)));return _0x47cbba[_0xcd38bc(0x153)](',\x20');}function displayDiffs(_0x38ae7f,_0x407f65,_0xdda2,_0x1d8d98,_0x43e82b,_0x3bdda7,_0x1e1a3f,_0x594f93,_0x3b33a3){const _0xe122b1=a4_0x5298;for(const _0x3e0d5e of _0x38ae7f){if(_0x3e0d5e['diff']){const _0x50f801=_0x3e0d5e[_0xe122b1(0x15d)]||_0x3e0d5e[_0xe122b1(0x110)];console['log'](_0xe122b1(0x11a)+_0x50f801+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x3e0d5e[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c));}}for(const _0x47a605 of _0x407f65){_0x47a605[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0xb5)+_0x47a605[_0xe122b1(0x110)]+'\x27:'),console['log']('─'[_0xe122b1(0x142)](0x3c)),console['log'](_0x47a605[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x17de35 of _0xdda2){_0x17de35['diff']&&(console[_0xe122b1(0xb7)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x17de35[_0xe122b1(0x110)]+'\x27:'),console['log']('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x17de35['diff']),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x422883 of _0x1d8d98){_0x422883[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0x136)+_0x422883[_0xe122b1(0x110)]+'\x27:'),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x422883[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x19596a of _0x43e82b){_0x19596a[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0xce)+_0x19596a['name']+'\x27:'),console[_0xe122b1(0xb7)]('─'['repeat'](0x3c)),console[_0xe122b1(0xb7)](_0x19596a['diff']),console['log']('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x310ddc of _0x3bdda7){_0x310ddc[_0xe122b1(0xee)]&&(console['log'](_0xe122b1(0x175)+_0x310ddc[_0xe122b1(0x110)]+'\x27:'),console['log']('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x310ddc['diff']),console['log']('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x4c2299 of _0x1e1a3f){_0x4c2299[_0xe122b1(0xee)]&&(console['log'](_0xe122b1(0x179)+_0x4c2299[_0xe122b1(0x110)]+'\x27:'),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)),console['log'](_0x4c2299[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x5851c9 of _0x594f93){_0x5851c9['diff']&&(console[_0xe122b1(0xb7)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x5851c9[_0xe122b1(0x110)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0xe122b1(0xb7)](_0x5851c9[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x499f96 of _0x3b33a3){_0x499f96[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0x111)+_0x499f96[_0xe122b1(0x110)]+'\x27:'),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x499f96[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x47f0cf(0x110)]=a4_0x47f0cf(0x170);['description']=a4_0x47f0cf(0x131);async[a4_0x47f0cf(0xcb)](_0x2e55b5){const _0x1c1873=a4_0x47f0cf,{options:_0x18aec7,args:_0x3b479d,tdx:_0x36cced}=_0x2e55b5,_0x48c93f=_0x3b479d[0x0],_0x1fda20=_0x3b479d[0x1],_0x2f1ded=_0x18aec7[_0x1c1873(0xc8)],_0x1c5e79=_0x18aec7['dryRun'],_0x192ff6=_0x18aec7['force'],_0x47ff7c=_0x18aec7['yes'],_0xd451=_0x18aec7[_0x1c1873(0x117)],_0x4cfb57=_0x18aec7[_0x1c1873(0x151)];let _0x5199e4;if(_0x48c93f){const _0x57f090=a4_0x1ef39c[_0x1c1873(0x153)](_0x48c93f,'tdx.json');if(existsSync(_0x57f090))try{const _0x29004b=JSON[_0x1c1873(0x14c)](readFileSync(_0x57f090,_0x1c1873(0x10e)));_0x29004b[_0x1c1873(0xe0)]&&(_0x5199e4={'llm_project':_0x29004b['llm_project']});}catch{}}const _0x36cc9b=findAgentConfigPath(process[_0x1c1873(0xf0)]());let _0x3e6063;if(_0x36cc9b)try{const _0x1dd7a3=JSON[_0x1c1873(0x14c)](readFileSync(_0x36cc9b,_0x1c1873(0x10e)));_0x1dd7a3[_0x1c1873(0xe0)]&&(_0x3e6063={'llm_project':_0x1dd7a3[_0x1c1873(0xe0)]});}catch{}const _0x3250c9=resolveAgentPullArgs({'arg':_0x48c93f,'agentNameArg':_0x1fda20,'agentFlag':_0x4cfb57,'contextProject':_0xd451,'argDirConfig':_0x5199e4,'cwdConfigPath':_0x36cc9b||undefined,'cwdConfig':_0x3e6063}),{projectNameOrId:_0x427ab2,targetAgentName:_0x39dc9d,existingOutputDir:_0x53eb0f,source:_0x4b0af0}=_0x3250c9;if(_0x4b0af0===_0x1c1873(0xb9))console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xf7)]('Using\x20project\x20from\x20'+a4_0x1ef39c[_0x1c1873(0x153)](_0x48c93f,'tdx.json')+':\x20'+_0x427ab2));else{if(_0x4b0af0===_0x1c1873(0x167))console['log'](a4_0xc18c19[_0x1c1873(0xf7)](_0x1c1873(0x14f)+_0x427ab2));else _0x4b0af0===_0x1c1873(0xdf)&&console[_0x1c1873(0xb7)](a4_0xc18c19['dim'](_0x1c1873(0x116)+_0x427ab2));}if(!_0x427ab2)return _0x4cfb57?(console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x143))),console['log'](_0x1c1873(0xf4)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x14a))),console[_0x1c1873(0xb7)](_0x1c1873(0x132)),console[_0x1c1873(0xb7)](_0x1c1873(0xbd)),console['log'](_0x1c1873(0x107)),console[_0x1c1873(0xb7)](_0x1c1873(0x120)),console[_0x1c1873(0xb7)]('\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(_0x39dc9d){const {data:_0x189275}=await withSpinner(_0x1c1873(0x12e)+_0x39dc9d+_0x1c1873(0x172)+_0x427ab2+_0x1c1873(0xf3),()=>_0x36cced[_0x1c1873(0x15b)]['pullAgent'](_0x427ab2,_0x39dc9d,_0x2f1ded,{'dryRun':_0x1c5e79,'force':_0x192ff6}));if(_0x1c5e79)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x1c1873(0xb7)]('Would\x20pull\x20agent:\x20'+_0x189275['agentName']),console[_0x1c1873(0xb7)](_0x1c1873(0xbb)+_0x189275[_0x1c1873(0xc6)]),_0x189275[_0x1c1873(0xee)]&&(console['log'](_0x1c1873(0x16a)),console[_0x1c1873(0xb7)]('─'[_0x1c1873(0x142)](0x3c)),console[_0x1c1873(0xb7)](_0x189275[_0x1c1873(0xee)]),console[_0x1c1873(0xb7)]('─'[_0x1c1873(0x142)](0x3c))),0x0;return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0x112))),console[_0x1c1873(0xb7)](_0x1c1873(0x157)+_0x189275['agentName']),console[_0x1c1873(0xb7)](_0x1c1873(0xbc)+_0x189275['outputPath']),console[_0x1c1873(0xb7)](_0x1c1873(0x14d)+(_0x189275[_0x1c1873(0xd2)]?a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0x119)):_0x189275['hasChanges']?a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x109)):a4_0xc18c19[_0x1c1873(0x158)]('unchanged'))),0x0;}const _0x4915ad=_0x53eb0f||_0x2f1ded,{data:_0x354a58}=await withSpinner(_0x1c1873(0x104)+_0x427ab2+_0x1c1873(0xf3),()=>_0x36cced[_0x1c1873(0x15b)]['pullProject'](_0x427ab2,_0x4915ad,{'dryRun':!![]})),_0x183dfd=_0x354a58[_0x1c1873(0x115)]['agents'][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xf2)]['new']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd3)]['new']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x15c)]['new']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x134)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x159)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)]['chatInterfaces']['new'],_0x44ba11=_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd5)]['updated']+_0x354a58['counts'][_0x1c1873(0xf2)][_0x1c1873(0x109)]+_0x354a58['counts'][_0x1c1873(0xd3)][_0x1c1873(0x109)]+_0x354a58[_0x1c1873(0x115)]['prompts'][_0x1c1873(0x109)]+_0x354a58['counts']['integrations']['updated']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)][_0x1c1873(0x109)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0x109)]+_0x354a58['counts'][_0x1c1873(0x159)][_0x1c1873(0x109)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x155)][_0x1c1873(0x109)],_0xeaa755=_0x354a58[_0x1c1873(0x115)]['agents'][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xf2)][_0x1c1873(0xd1)]+_0x354a58['counts'][_0x1c1873(0xd3)][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x15c)][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x134)]['unchanged']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)]['unchanged']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0xd1)]+_0x354a58['counts'][_0x1c1873(0x159)][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x155)][_0x1c1873(0xd1)];console[_0x1c1873(0xb7)](_0x1c1873(0x15a)+_0x354a58[_0x1c1873(0xc9)]+'\x27:'),console[_0x1c1873(0xb7)]('\x20\x20'+a4_0xc18c19['green']('+\x20'+_0x183dfd+'\x20new')+'\x20|\x20'+a4_0xc18c19[_0x1c1873(0xd4)]('~\x20'+_0x44ba11+'\x20changed')+_0x1c1873(0x13f)+a4_0xc18c19[_0x1c1873(0xf7)]('=\x20'+_0xeaa755+_0x1c1873(0x128))),console[_0x1c1873(0xb7)]('\x20\x20Agents:\x20'+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd5)])),console[_0x1c1873(0xb7)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x354a58[_0x1c1873(0x115)]['knowledgeBases'])),console[_0x1c1873(0xb7)](_0x1c1873(0xdc)+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd3)])),console['log'](_0x1c1873(0x152)+formatCountSummary(_0x354a58['counts']['prompts'])),console[_0x1c1873(0xb7)](_0x1c1873(0x12c)+formatCountSummary(_0x354a58['counts'][_0x1c1873(0x134)])),console[_0x1c1873(0xb7)](_0x1c1873(0xd0)+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x159)])),console[_0x1c1873(0xb7)](_0x1c1873(0xe7)+formatCountSummary(_0x354a58[_0x1c1873(0x115)]['chatInterfaces']));const _0x583709=_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)][_0x1c1873(0xc3)]>0x0||_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0xc3)]>0x0;_0x583709&&(console['log'](_0x1c1873(0x126)+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)])),console[_0x1c1873(0xb7)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)])));console[_0x1c1873(0xb7)](_0x1c1873(0x11f)+a4_0xc18c19['cyan'](_0x354a58[_0x1c1873(0xc7)])),displayDiffs(_0x354a58['agents'],_0x354a58['knowledgeBases'],_0x354a58[_0x1c1873(0xd3)],_0x354a58[_0x1c1873(0x15c)],_0x354a58[_0x1c1873(0x134)],_0x354a58[_0x1c1873(0xfa)],_0x354a58[_0x1c1873(0x16c)],_0x354a58['formInterfaces'],_0x354a58[_0x1c1873(0x155)]);if(_0x1c5e79)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0xf6))),0x0;if(_0x183dfd===0x0&&_0x44ba11===0x0)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0xfd))),saveSessionContext({'llm_project':_0x354a58[_0x1c1873(0xc9)]},_0x18aec7[_0x1c1873(0x121)]),console[_0x1c1873(0xb7)](a4_0xc18c19['green']('✔\x20Context\x20set:\x20'+a4_0xc18c19[_0x1c1873(0xf7)](_0x1c1873(0xe0))+_0x1c1873(0xe8)+a4_0xc18c19['cyan'](_0x354a58['projectName']))),0x0;if(!_0x47ff7c&&!_0x192ff6){if(!isInteractive())return console[_0x1c1873(0x101)](a4_0xc18c19['red'](_0x1c1873(0x149)),_0x1c1873(0xcc)),console['error'](a4_0xc18c19['dim'](_0x1c1873(0x16d))),0x1;const _0x3457b4=await confirmKey('\x0aWrite\x20'+(_0x183dfd+_0x44ba11)+'\x20files?');if(!_0x3457b4)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x174)),'-\x20no\x20files\x20written'),0x1;}const {data:_0xf93f96}=await withSpinner(_0x1c1873(0xe2),()=>_0x36cced['llm'][_0x1c1873(0x16e)](_0x427ab2,_0x4915ad,{'force':_0x192ff6}));return console['log'](a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0xc5)+(_0x183dfd+_0x44ba11)+_0x1c1873(0x147)+_0xf93f96[_0x1c1873(0xc7)])),saveSessionContext({'llm_project':_0xf93f96[_0x1c1873(0xc9)]},_0x18aec7['session']),console[_0x1c1873(0xb7)](a4_0xc18c19['green'](_0x1c1873(0x105)+a4_0xc18c19[_0x1c1873(0xf7)](_0x1c1873(0xe0))+_0x1c1873(0xe8)+a4_0xc18c19[_0x1c1873(0x103)](_0xf93f96[_0x1c1873(0xc9)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x47f0cf(0x110)]=a4_0x47f0cf(0xeb);[a4_0x47f0cf(0xc2)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x5defab){const _0x19a4db=a4_0x47f0cf,{options:_0x3fab14,args:_0x677a37,tdx:_0x1eb98b}=_0x5defab,_0x43f3e2=_0x677a37[0x0],_0x24f2a5=_0x3fab14[_0x19a4db(0x110)],_0x609372=_0x3fab14[_0x19a4db(0x150)],_0x277e6e=_0x3fab14[_0x19a4db(0x102)],_0x50b9b1=_0x3fab14['site'],_0x459724=_0x3fab14[_0x19a4db(0x117)];let _0x4f9269;const _0x186256=findAgentConfigPath(process[_0x19a4db(0xf0)]());if(_0x43f3e2){const _0x2a4638=a4_0x1ef39c[_0x19a4db(0x153)](_0x43f3e2,'tdx.json');existsSync(_0x2a4638)?(_0x4f9269=_0x43f3e2,console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xf7)](_0x19a4db(0xd9)+_0x43f3e2))):_0x4f9269=_0x43f3e2;}else{if(_0x186256)_0x4f9269=a4_0x1ef39c[_0x19a4db(0xfe)](_0x186256),console['log'](a4_0xc18c19[_0x19a4db(0xf7)]('Using\x20current\x20project:\x20'+_0x4f9269));else{if(_0x459724){const _0x47f37d=sanitizeForFilesystem(_0x459724);let _0x5de936=_0x47f37d,_0x2d2178=a4_0x1ef39c[_0x19a4db(0x153)](process[_0x19a4db(0xf0)](),_0x19a4db(0xd5),_0x47f37d,'tdx.json');if(!existsSync(_0x2d2178)){const _0x22a7d9=normalizeName(_0x459724),_0x7ff336=a4_0x1ef39c['join'](process[_0x19a4db(0xf0)](),_0x19a4db(0xd5),_0x22a7d9,_0x19a4db(0xf5));existsSync(_0x7ff336)&&(_0x5de936=_0x22a7d9,_0x2d2178=_0x7ff336);}if(existsSync(_0x2d2178))_0x4f9269=a4_0x1ef39c[_0x19a4db(0xfe)](_0x2d2178),console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xf7)](_0x19a4db(0xd9)+_0x4f9269));else{const _0x4d9336=_0x3fab14['profile'];if(_0x4d9336)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x19a4db(0x15e)+_0x459724+_0x19a4db(0x141),undefined,{'helpText':_0x19a4db(0x177)+_0x19a4db(0x146)+(_0x19a4db(0x139)+_0x459724+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x5de936+_0x19a4db(0x10f)+(_0x24f2a5||_0x19a4db(0x161))+_0x19a4db(0xb6)+_0x4d9336)});_0x4f9269=_0x459724,console['log'](a4_0xc18c19[_0x19a4db(0xf7)](_0x19a4db(0x10a)+_0x459724));}}}}if(!_0x4f9269)return console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xd4)](_0x19a4db(0xc1))),console[_0x19a4db(0xb7)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x19a4db(0xbe)),console['log'](_0x19a4db(0xe6)),console['log'](_0x19a4db(0x114)),0x1;if(!_0x24f2a5)throw new SDKError(ErrorCode[_0x19a4db(0x125)],_0x19a4db(0x10b),undefined,{'helpText':_0x19a4db(0x135)});if(!_0x277e6e&&!_0x609372){if(!isInteractive())return console[_0x19a4db(0x101)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x149)),_0x19a4db(0xcc)),console[_0x19a4db(0x101)](a4_0xc18c19['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4419d3=await confirmKey('Clone\x20\x22'+_0x4f9269+_0x19a4db(0xcf)+_0x24f2a5+'\x22?');if(!_0x4419d3)return console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xd4)]('Cancelled')),0x1;}const {data:_0xb37af5}=await withSpinner('Cloning\x20\x22'+_0x4f9269+_0x19a4db(0x137)+_0x24f2a5+_0x19a4db(0xf3),()=>_0x1eb98b[_0x19a4db(0x15b)][_0x19a4db(0xba)](_0x4f9269,_0x24f2a5,{'dryRun':_0x609372}));if(_0x609372){console[_0x19a4db(0xb7)](a4_0xc18c19['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x19a4db(0xb7)](_0x19a4db(0x122)+_0xb37af5[_0x19a4db(0xe5)]),console[_0x19a4db(0xb7)](_0x19a4db(0x12f)+_0x24f2a5),console[_0x19a4db(0xb7)](_0x19a4db(0x130)),console[_0x19a4db(0xb7)](_0x19a4db(0xf9)+_0xb37af5[_0x19a4db(0x115)]['agents'][_0x19a4db(0x165)]),console[_0x19a4db(0xb7)](_0x19a4db(0xbf)+_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xf2)][_0x19a4db(0x165)]),console['log'](_0x19a4db(0x152)+_0xb37af5[_0x19a4db(0x115)]['prompts'][_0x19a4db(0x165)]),console[_0x19a4db(0xb7)](_0x19a4db(0xd0)+_0xb37af5['counts'][_0x19a4db(0x159)]['created']),console[_0x19a4db(0xb7)](_0x19a4db(0xe7)+_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x155)][_0x19a4db(0x165)]);const _0x5e6b95=_0xb37af5[_0x19a4db(0x115)]['experimentalKnowledgeBases'][_0x19a4db(0x165)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)]['created']>0x0;return _0x5e6b95&&(console[_0x19a4db(0xb7)](_0x19a4db(0x126)+_0xb37af5['counts'][_0x19a4db(0xfa)][_0x19a4db(0x165)]),console[_0x19a4db(0xb7)](_0x19a4db(0x16f)+_0xb37af5[_0x19a4db(0x115)]['experimentalArtifacts'][_0x19a4db(0x165)])),0x0;}const _0x40a715=_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xd5)][_0x19a4db(0xc0)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xf2)]['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x15c)][_0x19a4db(0xc0)]>0x0||_0xb37af5[_0x19a4db(0x115)]['formInterfaces']['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x155)]['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xfa)]['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)]['errors']>0x0;_0x40a715?console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xd4)]('Project\x20cloned\x20with\x20errors')):console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x148)](_0x19a4db(0xfb)));console[_0x19a4db(0xb7)]('Source:\x20'+_0xb37af5[_0x19a4db(0xe5)]),console['log']('New\x20project:\x20'+_0xb37af5[_0x19a4db(0x15f)]),console[_0x19a4db(0xb7)](_0x19a4db(0x14e)+_0xb37af5[_0x19a4db(0x13b)]),console[_0x19a4db(0xb7)](),console[_0x19a4db(0xb7)]('Summary:'),console[_0x19a4db(0xb7)](_0x19a4db(0xf9)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xd5)])),console[_0x19a4db(0xb7)](_0x19a4db(0xbf)+formatCountSummary(_0xb37af5['counts'][_0x19a4db(0xf2)])),console['log'](_0x19a4db(0x152)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x15c)])),console[_0x19a4db(0xb7)](_0x19a4db(0x12c)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x134)])),console[_0x19a4db(0xb7)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x159)])),console[_0x19a4db(0xb7)](_0x19a4db(0xe7)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x155)]));const _0x39a2d3=_0xb37af5['counts'][_0x19a4db(0xfa)][_0x19a4db(0x165)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xfa)][_0x19a4db(0x109)]>0x0||_0xb37af5['counts'][_0x19a4db(0xfa)]['unchanged']>0x0||_0xb37af5[_0x19a4db(0x115)]['experimentalArtifacts'][_0x19a4db(0x165)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)][_0x19a4db(0x109)]>0x0||_0xb37af5[_0x19a4db(0x115)]['experimentalArtifacts']['unchanged']>0x0;_0x39a2d3&&(console['log'](_0x19a4db(0x126)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xfa)])),console[_0x19a4db(0xb7)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)])));if(_0x40a715){console[_0x19a4db(0xb7)](),console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0xb8)));for(const _0x48612b of _0xb37af5[_0x19a4db(0xd5)]){_0x48612b['action']==='error'&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x145)+_0x48612b[_0x19a4db(0x15d)]+'\x22:\x20'+_0x48612b['error']));}for(const _0x41cb23 of _0xb37af5['knowledgeBases']){_0x41cb23[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0xde)+_0x41cb23['name']+_0x19a4db(0xea)+_0x41cb23[_0x19a4db(0x101)]));}for(const _0x276395 of _0xb37af5[_0x19a4db(0x15c)]){_0x276395[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19['red']('\x20\x20Prompt\x20\x22'+_0x276395[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x276395['error']));}for(const _0x218147 of _0xb37af5[_0x19a4db(0x134)]){_0x218147[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)]('\x20\x20Integration\x20\x22'+_0x218147[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x218147[_0x19a4db(0x101)]));}for(const _0x37441b of _0xb37af5[_0x19a4db(0x159)]){_0x37441b[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x113)+_0x37441b[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x37441b['error']));}for(const _0x462661 of _0xb37af5['chatInterfaces']){_0x462661[_0x19a4db(0xf1)]==='error'&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x154)+_0x462661['name']+'\x22:\x20'+_0x462661[_0x19a4db(0x101)]));}for(const _0x18ef8f of _0xb37af5[_0x19a4db(0xfa)]){_0x18ef8f[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0xdb)+_0x18ef8f[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x18ef8f[_0x19a4db(0x101)]));}for(const _0x27c181 of _0xb37af5[_0x19a4db(0x16c)]){_0x27c181[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19['red'](_0x19a4db(0x13a)+_0x27c181[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x27c181['error']));}return 0x1;}console[_0x19a4db(0xb7)]();const _0x1854bf=getLLMProjectUrl(_0x50b9b1,_0xb37af5[_0x19a4db(0x13b)]);return console[_0x19a4db(0xb7)](_0x19a4db(0x106)+a4_0xc18c19[_0x19a4db(0x103)](_0x1854bf)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x47f0cf(0xc2)]=a4_0x47f0cf(0x12a);async[a4_0x47f0cf(0xcb)](_0x41fb55){const _0x1a1223=a4_0x47f0cf,{options:_0xa11289,args:_0x255711,tdx:_0x320cdc}=_0x41fb55;let _0x51dce6=_0x255711[0x0]||process[_0x1a1223(0xf0)]();const _0x3fc590=_0xa11289[_0x1a1223(0x150)],_0x5af8de=_0xa11289[_0x1a1223(0x156)],_0x483120=_0xa11289[_0x1a1223(0x102)],_0x32f263=_0xa11289[_0x1a1223(0xdd)],_0x75f04b=a4_0x1ef39c[_0x1a1223(0x153)](_0x51dce6,'agent.yml'),_0x4e39a0=existsSync(_0x75f04b);if(_0x4e39a0){const {data:_0x464174}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x51dce6+'\x22...',()=>_0x320cdc[_0x1a1223(0x15b)][_0x1a1223(0x176)](_0x51dce6,{'dryRun':_0x3fc590,'force':_0x5af8de}));if(_0x3fc590)return console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0xd4)](_0x1a1223(0xcd))),console[_0x1a1223(0xb7)]('Would\x20push\x20agent:\x20'+_0x464174['agentName']),0x0;if(_0x464174['action']==='error')return console['log'](a4_0xc18c19[_0x1a1223(0x160)]('Failed\x20to\x20push\x20agent:\x20'+_0x464174[_0x1a1223(0x101)])),0x1;console['log'](a4_0xc18c19[_0x1a1223(0x148)]('Agent\x20'+_0x464174['action']+_0x1a1223(0xca))),console[_0x1a1223(0xb7)]('Agent:\x20'+_0x464174['agentName']);if(_0x464174[_0x1a1223(0x16b)]&&_0x464174[_0x1a1223(0x133)]){const _0x2214b4=getLLMAgentChatUrl(_0x32f263,_0x464174[_0x1a1223(0x133)],_0x464174[_0x1a1223(0x16b)]);console[_0x1a1223(0xb7)](_0x1a1223(0xed)+a4_0xc18c19[_0x1a1223(0x103)](_0x2214b4));}return 0x0;}const _0x2b5171=_0xa11289['llmProject'],_0x475172=resolveProjectFromContext(_0x51dce6,_0x2b5171);if(_0x475172[_0x1a1223(0xe4)])_0x51dce6=_0x475172[_0x1a1223(0x178)],_0x475172[_0x1a1223(0xfc)]==='context'&&console[_0x1a1223(0xb7)](a4_0xc18c19['dim'](_0x1a1223(0x14f)+_0x51dce6));else{let _0x2e906b=_0x1a1223(0xda);_0x475172[_0x1a1223(0x14b)]===_0x1a1223(0x10c)&&(_0x2e906b=_0x475172[_0x1a1223(0x164)]+_0x1a1223(0x10d)+_0x475172['llmProject']+_0x1a1223(0x163));throw new SDKError(ErrorCode[_0x1a1223(0x11d)],_0x475172[_0x1a1223(0x14b)]===_0x1a1223(0x140)?_0x475172[_0x1a1223(0x164)]:'No\x20tdx.json\x20found\x20in\x20'+_0x51dce6,undefined,{'helpText':_0x2e906b});}const {data:_0x1e8198}=await withSpinner(_0x1a1223(0x144),()=>_0x320cdc[_0x1a1223(0x15b)][_0x1a1223(0x171)](_0x51dce6,{'dryRun':!![]})),_0xbf8755=_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd5)][_0x1a1223(0xc0)]>0x0;if(_0xbf8755){console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x108)));for(const _0x5452a4 of _0x1e8198[_0x1a1223(0xd5)]){_0x5452a4['action']==='error'&&console['log'](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x145)+_0x5452a4[_0x1a1223(0x15d)]+_0x1a1223(0xea)+_0x5452a4[_0x1a1223(0x101)]));}return 0x1;}const _0x2beac7=_0x1e8198['counts'][_0x1a1223(0xd5)][_0x1a1223(0x165)]+_0x1e8198['counts']['knowledgeBases'][_0x1a1223(0x165)]+_0x1e8198['counts']['textKnowledgeBases'][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)]['prompts'][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x134)][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)]['created']+_0x1e8198['counts'][_0x1a1223(0x159)][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x155)][_0x1a1223(0x165)],_0xe2b906=_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd5)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xf2)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd3)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)]['prompts'][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x134)]['updated']+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)]['updated']+_0x1e8198['counts'][_0x1a1223(0x16c)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)]['formInterfaces'][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x155)]['updated'],_0x372897=_0x1e8198[_0x1a1223(0x115)]['agents'][_0x1a1223(0xd1)]+_0x1e8198['counts'][_0x1a1223(0xf2)][_0x1a1223(0xd1)]+_0x1e8198[_0x1a1223(0x115)]['textKnowledgeBases'][_0x1a1223(0xd1)]+_0x1e8198['counts'][_0x1a1223(0x15c)][_0x1a1223(0xd1)]+_0x1e8198['counts']['integrations']['unchanged']+_0x1e8198['counts']['experimentalKnowledgeBases']['unchanged']+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)]['unchanged']+_0x1e8198['counts'][_0x1a1223(0x159)][_0x1a1223(0xd1)]+_0x1e8198['counts'][_0x1a1223(0x155)]['unchanged'];console[_0x1a1223(0xb7)](_0x1a1223(0x129)+_0x1e8198[_0x1a1223(0xc9)]+'\x27:'),console[_0x1a1223(0xb7)]('\x20\x20'+a4_0xc18c19[_0x1a1223(0x148)]('+\x20'+_0x2beac7+_0x1a1223(0x11e))+_0x1a1223(0x13f)+a4_0xc18c19['yellow']('~\x20'+_0xe2b906+_0x1a1223(0x166))+_0x1a1223(0x13f)+a4_0xc18c19[_0x1a1223(0xf7)]('=\x20'+_0x372897+'\x20unchanged')),console[_0x1a1223(0xb7)](_0x1a1223(0xf9)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd5)])),console[_0x1a1223(0xb7)](_0x1a1223(0xbf)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xf2)])),console[_0x1a1223(0xb7)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)]['textKnowledgeBases'])),console[_0x1a1223(0xb7)](_0x1a1223(0x152)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x15c)])),console['log'](_0x1a1223(0x12c)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)]['integrations'])),console[_0x1a1223(0xb7)](_0x1a1223(0xd0)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x159)])),console[_0x1a1223(0xb7)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)]['chatInterfaces']));const _0x42f95b=_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)][_0x1a1223(0x165)]>0x0||_0x1e8198['counts'][_0x1a1223(0xfa)]['updated']>0x0||_0x1e8198['counts'][_0x1a1223(0xfa)][_0x1a1223(0xd1)]>0x0||_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)][_0x1a1223(0x165)]>0x0||_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)][_0x1a1223(0x109)]>0x0||_0x1e8198['counts'][_0x1a1223(0x16c)][_0x1a1223(0xd1)]>0x0;_0x42f95b&&(console[_0x1a1223(0xb7)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)])),console[_0x1a1223(0xb7)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)])));console[_0x1a1223(0xb7)](_0x1a1223(0xef)+a4_0xc18c19[_0x1a1223(0x103)](_0x51dce6)),displayDiffs(_0x1e8198[_0x1a1223(0xd5)],_0x1e8198[_0x1a1223(0xf2)],_0x1e8198[_0x1a1223(0xd3)],_0x1e8198['prompts'],_0x1e8198['integrations'],_0x1e8198[_0x1a1223(0xfa)],_0x1e8198[_0x1a1223(0x16c)],_0x1e8198[_0x1a1223(0x159)],_0x1e8198[_0x1a1223(0x155)]);if(_0x3fc590)return console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0xd4)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x2beac7===0x0&&_0xe2b906===0x0){console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x148)](_0x1a1223(0xe1)));const _0x5e27b9=getLLMProjectUrl(_0x32f263,_0x1e8198[_0x1a1223(0x133)]);return console[_0x1a1223(0xb7)](_0x1a1223(0x106)+a4_0xc18c19[_0x1a1223(0x103)](_0x5e27b9)),0x0;}if(!_0x483120&&!_0x5af8de){if(!isInteractive())return console['error'](a4_0xc18c19['red']('\x0aError:'),_0x1a1223(0xcc)),console[_0x1a1223(0x101)](a4_0xc18c19[_0x1a1223(0xf7)](_0x1a1223(0x16d))),0x1;const _0x4183b9=await confirmKey('\x0aPush\x20'+(_0x2beac7+_0xe2b906)+_0x1a1223(0x12b));if(!_0x4183b9)return console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0xd4)](_0x1a1223(0x174)),_0x1a1223(0x127)),0x1;}const {data:_0x2b1697}=await withSpinner(_0x1a1223(0xd6),()=>_0x320cdc[_0x1a1223(0x15b)][_0x1a1223(0x171)](_0x51dce6,{'force':_0x5af8de})),_0x84355a=_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0xd5)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)]['knowledgeBases'][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0xd3)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0x15c)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0x159)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0x155)]['errors']>0x0;if(_0x84355a){console['log'](a4_0xc18c19[_0x1a1223(0xd4)](_0x1a1223(0xd8))),console[_0x1a1223(0xb7)](),console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0xb8)));for(const _0x239157 of _0x2b1697[_0x1a1223(0xd5)]){_0x239157[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x145)+_0x239157[_0x1a1223(0x15d)]+_0x1a1223(0xea)+_0x239157[_0x1a1223(0x101)]));}for(const _0x3e9ac1 of _0x2b1697[_0x1a1223(0xf2)]){_0x3e9ac1['action']===_0x1a1223(0x101)&&console['log'](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0xde)+_0x3e9ac1[_0x1a1223(0x110)]+'\x22:\x20'+_0x3e9ac1[_0x1a1223(0x101)]));}for(const _0x866678 of _0x2b1697[_0x1a1223(0xd3)]){_0x866678[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x162)+_0x866678[_0x1a1223(0x110)]+'\x22:\x20'+_0x866678[_0x1a1223(0x101)]));}for(const _0x4c972a of _0x2b1697['prompts']){_0x4c972a[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19['red'](_0x1a1223(0x118)+_0x4c972a[_0x1a1223(0x110)]+'\x22:\x20'+_0x4c972a[_0x1a1223(0x101)]));}for(const _0x2b5262 of _0x2b1697['integrations']){_0x2b5262['action']===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0xec)+_0x2b5262['name']+'\x22:\x20'+_0x2b5262[_0x1a1223(0x101)]));}for(const _0x29945e of _0x2b1697[_0x1a1223(0x159)]){_0x29945e[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)]('\x20\x20Form\x20Interface\x20\x22'+_0x29945e[_0x1a1223(0x110)]+_0x1a1223(0xea)+_0x29945e[_0x1a1223(0x101)]));}for(const _0xeb4ad7 of _0x2b1697[_0x1a1223(0x155)]){_0xeb4ad7[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19['red']('\x20\x20Chat\x20Interface\x20\x22'+_0xeb4ad7[_0x1a1223(0x110)]+'\x22:\x20'+_0xeb4ad7[_0x1a1223(0x101)]));}return 0x1;}console['log'](a4_0xc18c19['green'](_0x1a1223(0x13c)+(_0x2beac7+_0xe2b906)+_0x1a1223(0xe3)+_0x2b1697[_0x1a1223(0xc9)]+'\x27'));const _0x348320=getLLMProjectUrl(_0x32f263,_0x2b1697[_0x1a1223(0x133)]);return console['log'](_0x1a1223(0x106)+a4_0xc18c19[_0x1a1223(0x103)](_0x348320)),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
|
-
function a5_0x7018(){const _0x37791a=['/<agent-name>','FAIL','302320asyVCC','execute','No\x20tests\x20have\x20tags\x20defined.','source','\x20(cached)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','includes','\x20\x20Evaluating...\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed\x20Tests:','size','1226694XacHYg','Re-evaluating...','yellow','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','toLowerCase','Passed:\x20\x20\x20','now','llm','\x20-\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','split','toISOString','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','tags','test.yml','no_context','Output\x20written\x20to:\x20','stop','context','Agent:\x20','Tests\x20found:\x20','\x20\x20Site:\x20','1830227tCAcTD','Available\x20tests:\x20','text','json','Error\x20writing\x20output\x20file:\x20','resolveAgentId','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Cached\x20run\x20is\x20from\x20site\x20\x22','push','\x20\x20Round\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Running:\x20','forEach','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Errors:\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','map','Usage:','multiple_agents','executeReeval','Test\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Run\x20\x27tdx\x20agent\x20pull\x20','agent:test','projectName','existsSync','found','\x22:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','No\x20tests\x20found\x20matching:\x20','...\x20','✗\x20ERROR:\x20','green','some','round','llmProject','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','404','reason','eval','Cached\x20run\x20from:\x20','Re-evaluating\x20','join','Running\x20test:\x20','conversation_url','cyan','Conversation\x20URL:\x20','Available\x20tags:\x20','⚠\x20SKIPPED:\x20','red','Executing\x20new\x20tests...','utf-8','Test\x20Configuration:','not\x20found','isSpinning','testYmlPath','34iiHRAt','no_local_folder','Total:\x20\x20\x20\x20','substring','jsonl','Round\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','repeat','output','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20FAIL:\x20','54ppFAds','457890ItPXVO','dim','description','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','agentName','Failed:\x20\x20\x20','testName','name','projectDir','New\x20tests\x20to\x20execute:\x20','trim','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Conversation:\x20','filter','length','...','rounds','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','Round\x201/','tests','\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)',':\x20Sending\x20user\x20input...','timestamp','table','PASS','Evaluating\x20response...','5104UzORyc','log','25eSGcUp','resolveProjectId','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','ERROR','149784IeXXLv','writeFileSync','site','✓\x20PASS:\x20','Re-evaluation\x20Summary','has','start','Duration:\x20','white','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','tsv','status','1157656EzdPLv','Test\x20Summary','agent'];a5_0x7018=function(){return _0x37791a;};return a5_0x7018();}const a5_0x5c9cf7=a5_0x8dbb;(function(_0x35a88c,_0x321ca5){const _0x25e464=a5_0x8dbb,_0x58940e=_0x35a88c();while(!![]){try{const _0x3b47a1=-parseInt(_0x25e464(0x11d))/0x1*(parseInt(_0x25e464(0x144))/0x2)+parseInt(_0x25e464(0x166))/0x3+parseInt(_0x25e464(0x156))/0x4+-parseInt(_0x25e464(0x146))/0x5*(-parseInt(_0x25e464(0x14a))/0x6)+-parseInt(_0x25e464(0x17d))/0x7+parseInt(_0x25e464(0x15b))/0x8+-parseInt(_0x25e464(0x128))/0x9*(parseInt(_0x25e464(0x129))/0xa);if(_0x3b47a1===_0x321ca5)break;else _0x58940e['push'](_0x58940e['shift']());}catch(_0x5be4ee){_0x58940e['push'](_0x58940e['shift']());}}}(a5_0x7018,0x3a187));import*as a5_0x738a1 from'node:fs';function a5_0x8dbb(_0x3e0be5,_0x4371ad){_0x3e0be5=_0x3e0be5-0xec;const _0x70189b=a5_0x7018();let _0x8dbb11=_0x70189b[_0x3e0be5];return _0x8dbb11;}import*as a5_0x47357e from'node:path';import a5_0x500c4d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5c9cf7(0x130)]=a5_0x5c9cf7(0xfb);[a5_0x5c9cf7(0x12b)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5c9cf7(0x15c)](_0x11d131){const _0x2c0c3d=a5_0x5c9cf7,{options:_0x5c0b69,args:_0x3d64d1,tdx:_0x106f1e}=_0x11d131,_0x551cb6=_0x3d64d1[0x0]||'.',_0x5af7f6=_0x5c0b69['dryRun'],_0x121f5e=_0x5c0b69,_0xeeb44f=_0x121f5e[_0x2c0c3d(0x10c)]===![],_0x1bda66=_0x121f5e['reeval'],_0x33743c=_0x121f5e['name'],_0x8669fb=_0x121f5e['tags'],_0x4e551d=_0x5c0b69[_0x2c0c3d(0x14c)],_0x531e4c=_0x121f5e[_0x2c0c3d(0x125)];if(_0x1bda66&&_0xeeb44f)return console['log'](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x183))),0x1;let _0x2816c3=_0x2c0c3d(0x141);if(_0x121f5e[_0x2c0c3d(0x180)])_0x2816c3=_0x2c0c3d(0x180);else{if(_0x121f5e[_0x2c0c3d(0x121)])_0x2816c3=_0x2c0c3d(0x121);else{if(_0x121f5e[_0x2c0c3d(0x154)])_0x2816c3='tsv';else{if(_0x121f5e[_0x2c0c3d(0x141)])_0x2816c3='table';}}}const _0x138ec0=_0x121f5e[_0x2c0c3d(0x108)];let _0x18bcde=_0x551cb6;const _0x27b669=a5_0x738a1[_0x2c0c3d(0xfd)](_0x551cb6),_0x5280f7=_0x551cb6==='.';if(!_0x27b669||_0x5280f7){const _0x24d36d=resolveProjectFromContext(_0x551cb6,_0x138ec0,{'requireFile':_0x2c0c3d(0x175)});if(_0x24d36d[_0x2c0c3d(0xfe)])_0x18bcde=_0x24d36d[_0x2c0c3d(0x131)],_0x24d36d[_0x2c0c3d(0x15e)]===_0x2c0c3d(0x179)&&console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)]('Using\x20agent:\x20'+_0x18bcde));else switch(_0x24d36d[_0x2c0c3d(0x10b)]){case _0x2c0c3d(0x176):console[_0x2c0c3d(0x145)](a5_0x500c4d['yellow'](_0x24d36d[_0x2c0c3d(0x13b)])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0xf5)),console[_0x2c0c3d(0x145)]('\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'),console['log'](_0x2c0c3d(0x13e)),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x101));return 0x1;case _0x2c0c3d(0x11e):console['log'](a5_0x500c4d[_0x2c0c3d(0x168)](_0x24d36d[_0x2c0c3d(0x13b)])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0xfa)+_0x24d36d[_0x2c0c3d(0x108)]+_0x2c0c3d(0x13a));return 0x1;case _0x2c0c3d(0xf6):{const _0x3b55f4=a5_0x47357e['basename'](_0x24d36d['projectDir']);console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x168)](_0x2c0c3d(0x170)+_0x24d36d[_0x2c0c3d(0x108)]+'\x22:'));for(const _0x3f9df4 of _0x24d36d['agentDirs']){console[_0x2c0c3d(0x145)]('\x20\x20-\x20'+_0x3f9df4);}return console['log'](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x153)+_0x3b55f4+_0x2c0c3d(0x159)),0x1;}case'no_tests':console[_0x2c0c3d(0x145)](a5_0x500c4d['yellow'](_0x2c0c3d(0x148)+_0x24d36d[_0x2c0c3d(0x108)]+'\x22.')),console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)]('Project\x20path:\x20'+_0x24d36d[_0x2c0c3d(0x131)])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x173));return 0x1;}}const {definition:_0x39f91e,agentInfo:_0x55392d}=parseTestFile(_0x18bcde);let _0x4d7481=_0x39f91e[_0x2c0c3d(0x13d)];if(_0x33743c){const _0x4743f9=_0x33743c[_0x2c0c3d(0x171)](',')[_0x2c0c3d(0xf4)](_0x414291=>_0x414291[_0x2c0c3d(0x133)]());_0x4d7481=_0x39f91e['tests']['filter'](_0x85ecc4=>_0x4743f9[_0x2c0c3d(0x161)](_0x85ecc4[_0x2c0c3d(0x130)]));if(_0x4d7481[_0x2c0c3d(0x137)]===0x0)return console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x168)](_0x2c0c3d(0x102)+_0x33743c)),console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x17e)+_0x39f91e[_0x2c0c3d(0x13d)][_0x2c0c3d(0xf4)](_0x109c74=>_0x109c74['name'])[_0x2c0c3d(0x10f)](',\x20'))),0x1;}if(_0x8669fb){const _0x387719=_0x8669fb[_0x2c0c3d(0x171)](',')[_0x2c0c3d(0xf4)](_0x13f910=>_0x13f910[_0x2c0c3d(0x133)]()[_0x2c0c3d(0x16b)]());_0x4d7481=_0x4d7481[_0x2c0c3d(0x136)](_0x522f68=>_0x522f68[_0x2c0c3d(0x174)]?.[_0x2c0c3d(0x106)](_0x18b4b3=>_0x387719[_0x2c0c3d(0x161)](_0x18b4b3[_0x2c0c3d(0x16b)]())));if(_0x4d7481[_0x2c0c3d(0x137)]===0x0){console[_0x2c0c3d(0x145)](a5_0x500c4d['yellow'](_0x2c0c3d(0x126)+_0x8669fb));const _0x2934bd=new Set();return _0x39f91e[_0x2c0c3d(0x13d)][_0x2c0c3d(0xf0)](_0x49ad84=>_0x49ad84[_0x2c0c3d(0x174)]?.[_0x2c0c3d(0xf0)](_0x874e54=>_0x2934bd['add'](_0x874e54))),_0x2934bd[_0x2c0c3d(0x165)]>0x0?console['log'](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x114)+[..._0x2934bd][_0x2c0c3d(0x10f)](',\x20'))):console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x15d))),0x1;}}if(_0x1bda66)return this[_0x2c0c3d(0xf7)](_0x11d131,{'definition':{'tests':_0x4d7481},'agentInfo':_0x55392d,'outputFormat':_0x2816c3,'outputFile':_0x531e4c,'testNames':_0x33743c});if(_0x5af7f6){console[_0x2c0c3d(0x145)](a5_0x500c4d['cyan'](_0x2c0c3d(0x119))),console['log'](_0x2c0c3d(0x17c)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x4e551d)),console[_0x2c0c3d(0x145)]('\x20\x20Project:\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x55392d[_0x2c0c3d(0xfc)])),console[_0x2c0c3d(0x145)]('\x20\x20Agent:\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x55392d['agentName'])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x17b)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x4d7481[_0x2c0c3d(0x137)]));for(let _0x1f6180=0x0;_0x1f6180<_0x4d7481[_0x2c0c3d(0x137)];_0x1f6180++){const _0x571995=_0x4d7481[_0x1f6180],_0x2256b4=_0x571995[_0x2c0c3d(0x139)][_0x2c0c3d(0x137)]===0x1?_0x2c0c3d(0x107):_0x2c0c3d(0x139),_0x3bf0fe=_0x571995['tags']?.[_0x2c0c3d(0x137)]?'\x20['+_0x571995[_0x2c0c3d(0x174)][_0x2c0c3d(0x10f)](',\x20')+']':'';console[_0x2c0c3d(0x145)]('\x20\x20'+(_0x1f6180+0x1)+'.\x20'+a5_0x500c4d['white'](_0x571995['name'])+'\x20('+_0x571995['rounds']['length']+'\x20'+_0x2256b4+')'+a5_0x500c4d[_0x2c0c3d(0x12a)](_0x3bf0fe));}return 0x0;}let _0x2e280e,_0x381d05;try{_0x2e280e=await _0x106f1e['llm'][_0x2c0c3d(0x147)](_0x55392d[_0x2c0c3d(0xfc)]);}catch(_0x46fdeb){const _0x284bae=_0x46fdeb instanceof Error?_0x46fdeb['message']:String(_0x46fdeb);return _0x284bae['includes']('404')||_0x284bae['toLowerCase']()['includes'](_0x2c0c3d(0x11a))?console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x134)+_0x55392d[_0x2c0c3d(0xfc)])):console[_0x2c0c3d(0x145)](a5_0x500c4d['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x55392d[_0x2c0c3d(0xfc)]+_0x2c0c3d(0xff)+_0x284bae)),0x1;}try{_0x381d05=await _0x106f1e[_0x2c0c3d(0x16e)][_0x2c0c3d(0x182)](_0x55392d[_0x2c0c3d(0x12d)],_0x2e280e);}catch(_0x3092d5){const _0x5e6d6c=_0x3092d5 instanceof Error?_0x3092d5[_0x2c0c3d(0x13b)]:String(_0x3092d5);return _0x5e6d6c['includes'](_0x2c0c3d(0x10a))||_0x5e6d6c['toLowerCase']()[_0x2c0c3d(0x161)](_0x2c0c3d(0x11a))?console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x160)+_0x55392d[_0x2c0c3d(0x12d)])):console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0xf1)+_0x55392d[_0x2c0c3d(0x12d)]+'\x22:\x20'+_0x5e6d6c)),0x1;}let _0x39297c;if(!_0xeeb44f)try{_0x39297c=await setupEvaluatorAgent(_0x106f1e['llm'],_0x5c0b69['verbose']);}catch(_0x385837){const _0x4b9a5d=_0x385837 instanceof Error?_0x385837[_0x2c0c3d(0x13b)]:String(_0x385837);return console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4b9a5d)),0x1;}console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x112)]('Running\x20agent\x20tests...')),console[_0x2c0c3d(0x145)]('Site:\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x4e551d)),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x17a)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x55392d['projectName']+'/'+_0x55392d[_0x2c0c3d(0x12d)])),console[_0x2c0c3d(0x145)]();const _0x404bf1=[],_0xe63552=[],_0x30dcfd=Date['now']();for(let _0x42a113=0x0;_0x42a113<_0x4d7481['length'];_0x42a113++){const _0x452df5=_0x4d7481[_0x42a113];_0x4d7481[_0x2c0c3d(0x137)]>0x1?console[_0x2c0c3d(0x145)](_0x2c0c3d(0xf8)+(_0x42a113+0x1)+'/'+_0x4d7481['length']+':\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x452df5[_0x2c0c3d(0x130)])):console[_0x2c0c3d(0x145)](_0x2c0c3d(0x110)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x452df5[_0x2c0c3d(0x130)]));const _0x50a6d1=createCommandSpinner(_0x2c0c3d(0x13c)+_0x452df5[_0x2c0c3d(0x139)][_0x2c0c3d(0x137)]+_0x2c0c3d(0x13f));_0x50a6d1[_0x2c0c3d(0x150)]();try{const {result:_0x4878f8,conversation:_0x10dacc}=await runTest(_0x106f1e[_0x2c0c3d(0x16e)],_0x452df5,{'agentId':_0x381d05,'projectId':_0x2e280e,'site':_0x4e551d,'noEval':_0xeeb44f,'evaluatorId':_0x39297c,'onRoundStart':(_0x5e5336,_0x8b13de)=>{const _0x515087=_0x2c0c3d;_0x50a6d1[_0x515087(0x17f)]=_0x515087(0x122)+(_0x5e5336+0x1)+'/'+_0x8b13de+_0x515087(0x13f);},'onRoundComplete':(_0x1246ad,_0x356152,_0x4e12aa)=>{const _0x1742d9=_0x2c0c3d,_0x387c39=formatElapsed(_0x356152);_0x4e12aa?console[_0x1742d9(0x145)](_0x1742d9(0xed)+(_0x1246ad+0x1)+'/'+_0x452df5[_0x1742d9(0x139)][_0x1742d9(0x137)]+_0x1742d9(0x103)+a5_0x500c4d['green']('✓')+'\x20('+_0x387c39+')'):console['log'](_0x1742d9(0xed)+(_0x1246ad+0x1)+'/'+_0x452df5[_0x1742d9(0x139)][_0x1742d9(0x137)]+_0x1742d9(0x103)+a5_0x500c4d['red']('✗'));},'onEvaluationStart':()=>{const _0xf852f8=_0x2c0c3d;_0x50a6d1['text']=_0xf852f8(0x143);},'onEvaluationComplete':_0x4704b8=>{const _0x29e7fd=_0x2c0c3d,_0x5590fe=formatElapsed(_0x4704b8);console[_0x29e7fd(0x145)](_0x29e7fd(0x162)+a5_0x500c4d['green']('✓')+'\x20('+_0x5590fe+')');}});_0x50a6d1['stop'](),_0x404bf1[_0x2c0c3d(0xec)](_0x4878f8),_0xe63552[_0x2c0c3d(0xec)](_0x10dacc);if(_0x4878f8['status']==='PASS')console[_0x2c0c3d(0x145)](a5_0x500c4d['green'](_0x2c0c3d(0x14d)+_0x4878f8['reason']));else _0x4878f8[_0x2c0c3d(0x155)]===_0x2c0c3d(0x15a)?console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)]('✗\x20FAIL:\x20'+_0x4878f8[_0x2c0c3d(0x10b)])):console['log'](a5_0x500c4d['red']('✗\x20ERROR:\x20'+_0x4878f8[_0x2c0c3d(0x10b)]));_0x4878f8['conversation_url']&&console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x113)+_0x4878f8[_0x2c0c3d(0x111)])),console['log']();}catch(_0x311829){_0x50a6d1['stop']();const _0x2c548e=_0x311829 instanceof Error?_0x311829[_0x2c0c3d(0x13b)]:String(_0x311829);console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x104)+_0x2c548e)),console['log'](),_0x404bf1[_0x2c0c3d(0xec)]({'name':_0x452df5[_0x2c0c3d(0x130)],'status':'ERROR','reason':_0x2c548e,'timestamp':new Date()[_0x2c0c3d(0x172)](),'duration_ms':0x0});}}const _0x56a60d=Date['now']()-_0x30dcfd,_0x335733=_0x404bf1[_0x2c0c3d(0x136)](_0x4904a1=>_0x4904a1[_0x2c0c3d(0x155)]===_0x2c0c3d(0x142))[_0x2c0c3d(0x137)],_0x3b3b88=_0x404bf1[_0x2c0c3d(0x136)](_0x3e32fa=>_0x3e32fa[_0x2c0c3d(0x155)]===_0x2c0c3d(0x15a))[_0x2c0c3d(0x137)],_0x26082a=_0x404bf1[_0x2c0c3d(0x136)](_0x462e5c=>_0x462e5c['status']===_0x2c0c3d(0x149))[_0x2c0c3d(0x137)];console[_0x2c0c3d(0x145)]('━'[_0x2c0c3d(0x124)](0x3c)),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x157)),console['log']('━'[_0x2c0c3d(0x124)](0x3c)),console['log'](_0x2c0c3d(0x11f)+_0x404bf1[_0x2c0c3d(0x137)]),console['log'](_0x2c0c3d(0x16c)+a5_0x500c4d[_0x2c0c3d(0x105)](_0x335733)),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x12e)+a5_0x500c4d[_0x2c0c3d(0x116)](_0x3b3b88));_0x26082a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x500c4d['red'](_0x26082a));console[_0x2c0c3d(0x145)](_0x2c0c3d(0x151)+formatElapsed(_0x56a60d)),console['log']('━'[_0x2c0c3d(0x124)](0x3c));const _0x289d2e=_0x404bf1[_0x2c0c3d(0x136)](_0x37ae2a=>_0x37ae2a[_0x2c0c3d(0x155)]!=='PASS');if(_0x289d2e[_0x2c0c3d(0x137)]>0x0){console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x164));for(const _0x4c54bc of _0x289d2e){const _0x2c418a=a5_0x500c4d[_0x2c0c3d(0x116)]('✗'),_0x108bd5=_0x4c54bc['reason'][_0x2c0c3d(0x137)]>0x32?_0x4c54bc[_0x2c0c3d(0x10b)][_0x2c0c3d(0x120)](0x0,0x32)+_0x2c0c3d(0x138):_0x4c54bc[_0x2c0c3d(0x10b)];console[_0x2c0c3d(0x145)]('\x20\x20'+_0x2c418a+'\x20'+_0x4c54bc[_0x2c0c3d(0x130)]+':\x20'+_0x108bd5);}}const _0x5059a6={'summary':{'total':_0x404bf1['length'],'passed':_0x335733,'failed':_0x3b3b88,'errors':_0x26082a>0x0?_0x26082a:undefined,'duration_ms':_0x56a60d},'tests':_0x404bf1,'agent':{'project':_0x55392d['projectName'],'name':_0x55392d[_0x2c0c3d(0x12d)],'site':_0x4e551d},'timestamp':new Date(_0x30dcfd)[_0x2c0c3d(0x172)]()};try{const _0x1bc171=buildCachedTestRun(_0xe63552,{'site':_0x4e551d,'projectId':_0x2e280e,'projectName':_0x55392d[_0x2c0c3d(0xfc)],'agentId':_0x381d05,'agentName':_0x55392d[_0x2c0c3d(0x12d)],'testYmlPath':a5_0x47357e['resolve'](_0x55392d[_0x2c0c3d(0x11c)])});saveLastTestRun(_0x1bc171);}catch{}if(_0x2816c3!==_0x2c0c3d(0x141)||_0x531e4c){const _0x468b2d=formatResults(_0x5059a6,_0x2816c3);if(_0x531e4c)try{a5_0x738a1['writeFileSync'](_0x531e4c,_0x468b2d,'utf-8'),console['log'](),console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x177)+_0x531e4c));}catch(_0x492a76){return console[_0x2c0c3d(0x145)](),console['log'](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x181)+_0x492a76)),0x1;}else console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x468b2d);}return _0x289d2e['length']>0x0?0x1:0x0;}async[a5_0x5c9cf7(0xf7)](_0x4eb9de,_0x5807df){const _0x295950=a5_0x5c9cf7,{options:_0x426d9b,tdx:_0x2fc7d5}=_0x4eb9de,{definition:_0x1eba13,agentInfo:_0x35f241,outputFormat:_0x2138b8,outputFile:_0x565e9b}=_0x5807df,_0x5aa30f=_0x426d9b[_0x295950(0x14c)],_0x5b806a=loadLastTestRun();if(!_0x5b806a)return console['log'](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x16a))),console[_0x295950(0x145)](a5_0x500c4d['dim'](_0x295950(0x100))),0x1;if(_0x5b806a[_0x295950(0x158)][_0x295950(0x12d)]!==_0x35f241[_0x295950(0x12d)])return console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x12c)+_0x5b806a[_0x295950(0x158)][_0x295950(0x12d)]+_0x295950(0x163)+_0x35f241[_0x295950(0x12d)]+'\x22.')),console['log'](a5_0x500c4d[_0x295950(0x12a)](_0x295950(0xee))),0x1;const _0x17def8=new Set(_0x5b806a['conversations'][_0x295950(0xf4)](_0x351983=>_0x351983[_0x295950(0x12f)])),_0x40bb3b=_0x1eba13[_0x295950(0x13d)][_0x295950(0x136)](_0x5005e5=>!_0x17def8['has'](_0x5005e5[_0x295950(0x130)]));if(_0x40bb3b['length']>0x0&&_0x5b806a[_0x295950(0x14c)]!==_0x5aa30f)return console['log'](a5_0x500c4d[_0x295950(0x116)](_0x295950(0xf9))),console[_0x295950(0x145)](a5_0x500c4d['dim'](_0x295950(0x184)+_0x5b806a[_0x295950(0x14c)]+_0x295950(0x123)+_0x5aa30f+'\x22.')),console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x12a)]('Either\x20switch\x20to\x20the\x20\x22'+_0x5b806a[_0x295950(0x14c)]+_0x295950(0x109))),0x1;const _0x302321=_0x1eba13[_0x295950(0x13d)][_0x295950(0x136)](_0x5ddb76=>_0x17def8[_0x295950(0x14f)](_0x5ddb76[_0x295950(0x130)])),_0x71070d=_0x40bb3b;let _0x10f166;try{_0x10f166=await setupEvaluatorAgent(_0x2fc7d5['llm'],_0x426d9b['verbose']);}catch(_0x5edee2){const _0x7a2455=_0x5edee2 instanceof Error?_0x5edee2[_0x295950(0x13b)]:String(_0x5edee2);return console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x7a2455)),0x1;}console[_0x295950(0x145)](a5_0x500c4d['cyan'](_0x295950(0xf3))),console['log'](_0x295950(0x10d)+a5_0x500c4d[_0x295950(0x152)](_0x5b806a[_0x295950(0x140)])),console[_0x295950(0x145)](_0x295950(0x17a)+a5_0x500c4d[_0x295950(0x152)](_0x5b806a[_0x295950(0x158)][_0x295950(0xfc)]+'/'+_0x5b806a['agent']['agentName']));_0x71070d[_0x295950(0x137)]>0x0&&console['log'](_0x295950(0x132)+a5_0x500c4d[_0x295950(0x168)](_0x71070d[_0x295950(0x137)]));console[_0x295950(0x145)]();const _0x291c58=[],_0x421fdd=Date[_0x295950(0x16d)](),_0x3b5897=createCommandSpinner(_0x295950(0x167));if(_0x302321[_0x295950(0x137)]>0x0)try{const _0xc261f7=await reevaluateFromCache(_0x2fc7d5['llm'],_0x5b806a,{'tests':_0x302321},{'evaluatorId':_0x10f166,'onTestStart':(_0x5bc4af,_0x24dfac,_0x4526fb)=>{const _0x32c129=_0x295950;_0x3b5897['text']=_0x32c129(0x10e)+(_0x24dfac+0x1)+'/'+_0x4526fb+':\x20'+_0x5bc4af+_0x32c129(0x138);if(!_0x3b5897[_0x32c129(0x11b)])_0x3b5897['start']();},'onTestComplete':(_0x35d15e,_0x4b76e1)=>{const _0x17ff7d=_0x295950;_0x3b5897['stop']();if(_0x4b76e1[_0x17ff7d(0x155)]===_0x17ff7d(0x142))console[_0x17ff7d(0x145)](a5_0x500c4d[_0x17ff7d(0x105)](_0x17ff7d(0x14d)+_0x35d15e)+a5_0x500c4d['dim']('\x20(cached)'));else _0x4b76e1[_0x17ff7d(0x155)]==='FAIL'?console[_0x17ff7d(0x145)](a5_0x500c4d[_0x17ff7d(0x116)](_0x17ff7d(0x127)+_0x35d15e+_0x17ff7d(0x16f)+_0x4b76e1[_0x17ff7d(0x10b)])+a5_0x500c4d[_0x17ff7d(0x12a)](_0x17ff7d(0x15f))):console[_0x17ff7d(0x145)](a5_0x500c4d[_0x17ff7d(0x116)]('✗\x20ERROR:\x20'+_0x35d15e+_0x17ff7d(0x16f)+_0x4b76e1['reason']));_0x4b76e1[_0x17ff7d(0x111)]&&console['log'](a5_0x500c4d['dim'](_0x17ff7d(0x135)+_0x4b76e1[_0x17ff7d(0x111)])),_0x291c58['push'](_0x4b76e1);},'onTestSkipped':(_0xecfff1,_0x1365f1)=>{const _0x48a9e8=_0x295950;_0x3b5897[_0x48a9e8(0x178)](),console[_0x48a9e8(0x145)](a5_0x500c4d[_0x48a9e8(0x168)](_0x48a9e8(0x115)+_0xecfff1+_0x48a9e8(0x16f)+_0x1365f1));}});for(const _0x1d2305 of _0xc261f7){!_0x291c58['find'](_0x36df43=>_0x36df43[_0x295950(0x130)]===_0x1d2305[_0x295950(0x130)])&&_0x291c58['push'](_0x1d2305);}}catch(_0x2ebcc4){_0x3b5897[_0x295950(0x178)]();const _0x2009c6=_0x2ebcc4 instanceof Error?_0x2ebcc4[_0x295950(0x13b)]:String(_0x2ebcc4);return console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x169)+_0x2009c6)),0x1;}_0x3b5897['stop']();if(_0x71070d[_0x295950(0x137)]>0x0){console[_0x295950(0x145)](),console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x112)](_0x295950(0x117)));const {projectId:_0x5a55eb,agentId:_0x3dc85e}=_0x5b806a[_0x295950(0x158)];for(const _0x154d4d of _0x71070d){console['log'](_0x295950(0xef)+a5_0x500c4d[_0x295950(0x152)](_0x154d4d[_0x295950(0x130)]));const _0x2abc0d=createCommandSpinner(_0x295950(0x13c)+_0x154d4d['rounds']['length']+_0x295950(0x13f));_0x2abc0d[_0x295950(0x150)]();try{const {result:_0x43fbd9}=await runTest(_0x2fc7d5[_0x295950(0x16e)],_0x154d4d,{'agentId':_0x3dc85e,'projectId':_0x5a55eb,'site':_0x5b806a[_0x295950(0x14c)],'noEval':![],'evaluatorId':_0x10f166,'onRoundStart':(_0x2254ec,_0x690d0b)=>{const _0x32d25f=_0x295950;_0x2abc0d[_0x32d25f(0x17f)]='Round\x20'+(_0x2254ec+0x1)+'/'+_0x690d0b+_0x32d25f(0x13f);},'onRoundComplete':(_0x2fb791,_0x1c3639,_0x346cdb)=>{const _0x23d893=_0x295950,_0x1950d8=formatElapsed(_0x1c3639);_0x346cdb?console[_0x23d893(0x145)](_0x23d893(0xed)+(_0x2fb791+0x1)+'/'+_0x154d4d[_0x23d893(0x139)][_0x23d893(0x137)]+_0x23d893(0x103)+a5_0x500c4d[_0x23d893(0x105)]('✓')+'\x20('+_0x1950d8+')'):console[_0x23d893(0x145)](_0x23d893(0xed)+(_0x2fb791+0x1)+'/'+_0x154d4d[_0x23d893(0x139)]['length']+_0x23d893(0x103)+a5_0x500c4d['red']('✗'));},'onEvaluationStart':()=>{const _0x406695=_0x295950;_0x2abc0d[_0x406695(0x17f)]='Evaluating\x20response...';},'onEvaluationComplete':_0xb395=>{const _0x26d9a4=_0x295950,_0x59fdcc=formatElapsed(_0xb395);console[_0x26d9a4(0x145)](_0x26d9a4(0x162)+a5_0x500c4d[_0x26d9a4(0x105)]('✓')+'\x20('+_0x59fdcc+')');}});_0x2abc0d[_0x295950(0x178)](),_0x291c58[_0x295950(0xec)](_0x43fbd9);if(_0x43fbd9['status']===_0x295950(0x142))console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x105)](_0x295950(0x14d)+_0x43fbd9[_0x295950(0x10b)])+a5_0x500c4d[_0x295950(0x12a)]('\x20(new)'));else _0x43fbd9[_0x295950(0x155)]===_0x295950(0x15a)?console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x127)+_0x43fbd9[_0x295950(0x10b)])+a5_0x500c4d[_0x295950(0x12a)]('\x20(new)')):console[_0x295950(0x145)](a5_0x500c4d['red'](_0x295950(0x104)+_0x43fbd9[_0x295950(0x10b)]));_0x43fbd9[_0x295950(0x111)]&&console['log'](a5_0x500c4d[_0x295950(0x12a)]('\x20\x20Conversation:\x20'+_0x43fbd9[_0x295950(0x111)]));}catch(_0x2ad961){_0x2abc0d[_0x295950(0x178)]();const _0x3a168d=_0x2ad961 instanceof Error?_0x2ad961[_0x295950(0x13b)]:String(_0x2ad961);console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x104)+_0x3a168d)),_0x291c58[_0x295950(0xec)]({'name':_0x154d4d[_0x295950(0x130)],'status':_0x295950(0x149),'reason':_0x3a168d,'timestamp':new Date()[_0x295950(0x172)](),'duration_ms':0x0});}}}console['log']();const _0x1ffc89=Date[_0x295950(0x16d)]()-_0x421fdd,_0x402b3f=_0x291c58[_0x295950(0x136)](_0x4ddb6a=>_0x4ddb6a[_0x295950(0x155)]===_0x295950(0x142))[_0x295950(0x137)],_0x492a36=_0x291c58[_0x295950(0x136)](_0x2324c0=>_0x2324c0[_0x295950(0x155)]==='FAIL')['length'],_0x20a927=_0x291c58[_0x295950(0x136)](_0x3ab940=>_0x3ab940[_0x295950(0x155)]===_0x295950(0x149))['length'];console[_0x295950(0x145)]('━'[_0x295950(0x124)](0x3c)),console[_0x295950(0x145)](_0x295950(0x14e)),console[_0x295950(0x145)]('━'[_0x295950(0x124)](0x3c)),console[_0x295950(0x145)](_0x295950(0x11f)+_0x291c58[_0x295950(0x137)]),console[_0x295950(0x145)](_0x295950(0x16c)+a5_0x500c4d[_0x295950(0x105)](_0x402b3f)),console[_0x295950(0x145)](_0x295950(0x12e)+a5_0x500c4d[_0x295950(0x116)](_0x492a36));_0x20a927>0x0&&console[_0x295950(0x145)](_0x295950(0xf2)+a5_0x500c4d[_0x295950(0x116)](_0x20a927));console[_0x295950(0x145)](_0x295950(0x151)+formatElapsed(_0x1ffc89)),console[_0x295950(0x145)]('━'[_0x295950(0x124)](0x3c));const _0x1d2f95={'summary':{'total':_0x291c58[_0x295950(0x137)],'passed':_0x402b3f,'failed':_0x492a36,'errors':_0x20a927>0x0?_0x20a927:undefined,'duration_ms':_0x1ffc89},'tests':_0x291c58,'agent':{'project':_0x35f241['projectName'],'name':_0x35f241[_0x295950(0x12d)],'site':_0x5aa30f},'timestamp':new Date(_0x421fdd)[_0x295950(0x172)]()};if(_0x2138b8!==_0x295950(0x141)||_0x565e9b){const _0x3dfbad=formatResults(_0x1d2f95,_0x2138b8);if(_0x565e9b)try{a5_0x738a1[_0x295950(0x14b)](_0x565e9b,_0x3dfbad,_0x295950(0x118)),console[_0x295950(0x145)](),console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x12a)](_0x295950(0x177)+_0x565e9b));}catch(_0x5b9bc0){return console[_0x295950(0x145)](),console['log'](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x181)+_0x5b9bc0)),0x1;}else console[_0x295950(0x145)](),console['log'](_0x3dfbad);}const _0x13943f=_0x291c58[_0x295950(0x136)](_0x15ed55=>_0x15ed55[_0x295950(0x155)]!==_0x295950(0x142));return _0x13943f[_0x295950(0x137)]>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
|
-
const a7_0x1d644f=a7_0x2646;(function(_0x37cf1e,_0x1619e1){const _0xb90657=a7_0x2646,_0x543f36=_0x37cf1e();while(!![]){try{const _0x4cb246=-parseInt(_0xb90657(0x146))/0x1*(-parseInt(_0xb90657(0x14a))/0x2)+parseInt(_0xb90657(0x159))/0x3+parseInt(_0xb90657(0x138))/0x4*(-parseInt(_0xb90657(0x122))/0x5)+parseInt(_0xb90657(0x13a))/0x6*(parseInt(_0xb90657(0x10c))/0x7)+parseInt(_0xb90657(0x14d))/0x8*(-parseInt(_0xb90657(0x131))/0x9)+-parseInt(_0xb90657(0xff))/0xa*(parseInt(_0xb90657(0x154))/0xb)+parseInt(_0xb90657(0x111))/0xc*(parseInt(_0xb90657(0x134))/0xd);if(_0x4cb246===_0x1619e1)break;else _0x543f36['push'](_0x543f36['shift']());}catch(_0x55a7c2){_0x543f36['push'](_0x543f36['shift']());}}}(a7_0x5283,0x558c5));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';function a7_0x2646(_0x8462ea,_0x4b8d43){_0x8462ea=_0x8462ea-0xf7;const _0x528397=a7_0x5283();let _0x2646ec=_0x528397[_0x8462ea];return _0x2646ec;}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_0x10216a 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_0x34a050 from'chalk';export async function runOAuthLoginFlow(_0x27dc01,_0x4640ad,_0xbfad41,_0x1931ae){const _0x4faf9b=a7_0x2646,_0x1c1014=await isKeychainAvailable();if(!_0x1c1014)throw new Error(_0x4faf9b(0x130)+_0x4faf9b(0x160));let _0x4aaf11=_0x1931ae?.[_0x4faf9b(0x149)];if(!_0x4aaf11){const _0xb42c5c=await a7_0x10216a({'type':_0x4faf9b(0x151),'name':_0x4faf9b(0x149),'message':_0x4faf9b(0x127)});if(_0xb42c5c[_0x4faf9b(0x149)]===undefined)throw new Error(_0x4faf9b(0x14c));_0x4aaf11=_0xb42c5c[_0x4faf9b(0x149)][_0x4faf9b(0x12e)]()||undefined;}const _0x4ba376=getConsoleUrl(_0x27dc01);console[_0x4faf9b(0x120)](_0x4faf9b(0x11c));_0x4aaf11?console[_0x4faf9b(0x120)]('\x20\x20'+_0x4ba376+_0x4faf9b(0x148)+_0x4aaf11+')'):console['log']('\x20\x20'+_0x4ba376+_0x4faf9b(0x115));console[_0x4faf9b(0x120)](_0x4faf9b(0x150));const _0x28f8b8=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x5181eb=await startOAuthFlow(_0x27dc01,{'accountName':_0x4aaf11,'proxy':_0x28f8b8});console[_0x4faf9b(0x120)](_0x4faf9b(0x158));const _0x25eac3=TDX[_0x4faf9b(0x136)]({'site':_0x27dc01,'accessToken':_0x5181eb[_0x4faf9b(0x13f)],'logLevel':_0xbfad41??LogLevel[_0x4faf9b(0x13e)]}),_0x4bc0c2=await _0x25eac3['jobs'][_0x4faf9b(0x106)]();console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x144)](_0x4faf9b(0x107))),console[_0x4faf9b(0x120)]('\x20\x20'+a7_0x34a050['cyan'](_0x27dc01+':'+_0x4bc0c2[_0x4faf9b(0x10b)])+_0x4faf9b(0x114)+_0x4bc0c2['id']+_0x4faf9b(0xfc)+_0x4bc0c2[_0x4faf9b(0x137)]+')');!_0x4aaf11&&(console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x153)](_0x4faf9b(0x141))),console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x153)](_0x4faf9b(0x132))),console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x153)](_0x4faf9b(0x152))));await saveOAuthTokens(_0x5181eb,_0x4640ad),console['log'](_0x4faf9b(0x128)+(_0x4640ad?_0x4faf9b(0x126)+_0x4640ad+')':''));if(_0x4640ad){const _0x27cf69={'site':_0x27dc01};saveProfileToUserConfig(_0x4640ad,_0x27cf69),console[_0x4faf9b(0x120)](_0x4faf9b(0x135)+_0x4640ad+_0x4faf9b(0x125));}else saveDefaultSiteToUserConfig(_0x27dc01),console['log'](_0x4faf9b(0x124)+_0x27dc01);const _0x3e9a0d=_0x4640ad?_0x4faf9b(0x163)+_0x4640ad:'';console[_0x4faf9b(0x120)](),console['log'](_0x4faf9b(0x11e)),console[_0x4faf9b(0x120)]('\x20\x20tdx'+_0x3e9a0d+_0x4faf9b(0x10d)),console[_0x4faf9b(0x120)](_0x4faf9b(0x145)+_0x3e9a0d+_0x4faf9b(0x12a));}export async function promptAuthMethod(){const _0x2d9933=a7_0x2646,_0x355406=await a7_0x10216a({'type':_0x2d9933(0x155),'name':'method','message':_0x2d9933(0x13b),'choices':[{'title':_0x2d9933(0x116),'description':_0x2d9933(0xfe),'value':_0x2d9933(0x156)},{'title':'Use\x20an\x20API\x20key','description':_0x2d9933(0x15a),'value':_0x2d9933(0x108)}]});return _0x355406[_0x2d9933(0x110)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1d644f(0x15c)]=a7_0x1d644f(0x117);[a7_0x1d644f(0x12d)]=a7_0x1d644f(0x143);async[a7_0x1d644f(0x11f)](_0x40b266){const _0x30fd9f=a7_0x1d644f,{options:_0x296b16}=_0x40b266,_0x313d11=_0x296b16[_0x30fd9f(0x140)];console[_0x30fd9f(0x120)](a7_0x34a050[_0x30fd9f(0x10a)](_0x30fd9f(0x112)));const _0x41a660=_0x296b16['site']||'us01',_0x26fe76=await promptSiteSelection(_0x41a660,_0x313d11,_0x30fd9f(0x14c));if(!_0x26fe76)return 0x1;const _0x6215dc=resolveSite(_0x26fe76),_0x1217ee=await promptAuthMethod();if(!_0x1217ee)return console[_0x30fd9f(0x120)]('\x0aSetup\x20cancelled'),0x1;if(_0x1217ee===_0x30fd9f(0x156)){const {accountName:_0x32af66}=_0x296b16;return await runOAuthLoginFlow(_0x6215dc,_0x313d11,_0x296b16[_0x30fd9f(0x109)]??LogLevel[_0x30fd9f(0x13e)],{'accountName':_0x32af66}),0x0;}console[_0x30fd9f(0x120)](_0x30fd9f(0x104)+_0x6215dc),console[_0x30fd9f(0x120)](_0x30fd9f(0x15b)),console[_0x30fd9f(0x120)]('\x20\x20'+getConsoleUrl(_0x6215dc,_0x30fd9f(0xfb)));const _0x42ddd5=await a7_0x10216a({'type':_0x30fd9f(0x123),'name':_0x30fd9f(0xfa),'message':_0x30fd9f(0xf7),'validate':_0x130bd3=>{if(!_0x130bd3||!_0x130bd3['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x42ddd5[_0x30fd9f(0xfa)])return console[_0x30fd9f(0x120)]('\x0aSetup\x20cancelled'),0x1;const _0x573f12=_0x42ddd5[_0x30fd9f(0xfa)];console['log'](_0x30fd9f(0x14f));try{const _0x5f5b5b=TDX[_0x30fd9f(0x136)]({'site':_0x6215dc,'apiKey':_0x573f12['trim'](),'logLevel':_0x296b16[_0x30fd9f(0x109)]??LogLevel[_0x30fd9f(0x13e)]}),_0x35efc0=await _0x5f5b5b[_0x30fd9f(0xf9)][_0x30fd9f(0x106)]();console[_0x30fd9f(0x120)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x35efc0[_0x30fd9f(0x137)]+')');const _0x296084=await isKeychainAvailable();_0x296084?(await saveAPIKeyAsync(_0x573f12[_0x30fd9f(0x12e)](),_0x6215dc,_0x313d11),console[_0x30fd9f(0x120)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x313d11?'\x20(profile:\x20'+_0x313d11+')':''))):(console['warn'](a7_0x34a050[_0x30fd9f(0x129)](_0x30fd9f(0x15d))),console[_0x30fd9f(0x161)](a7_0x34a050[_0x30fd9f(0x129)](_0x30fd9f(0x103))));if(_0x313d11){const _0x4de2ce={'site':_0x6215dc};saveProfileToUserConfig(_0x313d11,_0x4de2ce),console[_0x30fd9f(0x120)](_0x30fd9f(0x135)+_0x313d11+_0x30fd9f(0x125));}else saveDefaultSiteToUserConfig(_0x6215dc),console[_0x30fd9f(0x120)](_0x30fd9f(0x124)+_0x6215dc);const _0xb1ea0e=_0x313d11?_0x30fd9f(0x163)+_0x313d11:'';return console[_0x30fd9f(0x120)](),console[_0x30fd9f(0x120)](_0x30fd9f(0x11e)),console[_0x30fd9f(0x120)](_0x30fd9f(0x145)+_0xb1ea0e+_0x30fd9f(0x10d)),console[_0x30fd9f(0x120)](_0x30fd9f(0x145)+_0xb1ea0e+_0x30fd9f(0x12a)),0x0;}catch(_0x463de9){if(_0x463de9 instanceof HTTPClientError&&_0x463de9[_0x30fd9f(0x100)]===0x191)return printAuthError(_0x463de9),0x1;return console[_0x30fd9f(0x164)](a7_0x34a050[_0x30fd9f(0x11a)](_0x30fd9f(0x13d)+(_0x463de9 instanceof Error?_0x463de9['message']:String(_0x463de9)))),console['error'](_0x30fd9f(0x121)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x1d644f(0x12f);[a7_0x1d644f(0x12d)]=a7_0x1d644f(0x14e);async[a7_0x1d644f(0x11f)](_0x4af955){const _0x55da2a=a7_0x1d644f,{options:_0xe3369b,tdx:_0x4a1975}=_0x4af955,_0x3e859b=_0xe3369b[_0x55da2a(0x118)],_0x2fec97=_0xe3369b[_0x55da2a(0x140)],_0x4065b6=_0x2fec97?_0x2fec97:'N/A';console[_0x55da2a(0x120)](_0x55da2a(0x119)+_0x4065b6+_0x55da2a(0x142)+_0x3e859b+')');const _0x50210b=await getOAuthTokens(_0x2fec97);if(_0x50210b)console['log']('Credential\x20type:\x20OAuth'),console['log']('Read\x20credential\x20from\x20keychain'+(_0x2fec97?_0x55da2a(0x126)+_0x2fec97+')':''));else{const _0x2be4ed=await resolveAPIKeyAsync(_0x3e859b,_0x2fec97);if(_0x2be4ed){const {source:_0x5b564f,isDeprecated:_0x404394}=_0x2be4ed,_0x3e4c2b=_0x55da2a(0x13c)+_0x5b564f;console['log'](_0x404394?a7_0x34a050[_0x55da2a(0x129)](_0x3e4c2b):_0x3e4c2b);}else console[_0x55da2a(0x120)](a7_0x34a050['yellow'](_0x55da2a(0x12c)));}try{const _0x37546d=await _0x4a1975[_0x55da2a(0xf9)]['getUserInfo']();return console[_0x55da2a(0x120)](a7_0x34a050[_0x55da2a(0x144)](_0x55da2a(0x10e))),console[_0x55da2a(0x120)]('User:\x20'+_0x37546d['email']),(_0x37546d['first_name']||_0x37546d[_0x55da2a(0x157)])&&console[_0x55da2a(0x120)](_0x55da2a(0x14b)+[_0x37546d[_0x55da2a(0xf8)],_0x37546d[_0x55da2a(0x157)]]['filter'](Boolean)[_0x55da2a(0x11d)]('\x20')),0x0;}catch(_0x3425b2){return _0x3425b2 instanceof HTTPClientError&&_0x3425b2[_0x55da2a(0x100)]===0x191?printAuthError(_0x3425b2,!![],_0x2fec97):console[_0x55da2a(0x164)](a7_0x34a050[_0x55da2a(0x11a)](_0x55da2a(0x13d)+(_0x3425b2 instanceof Error?_0x3425b2[_0x55da2a(0x133)]:String(_0x3425b2)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x1d644f(0x15c)]='auth:token';[a7_0x1d644f(0x12d)]=a7_0x1d644f(0x12b);async[a7_0x1d644f(0x11f)](_0xb709ef){const _0x24c41e=a7_0x1d644f,{options:_0x4e308d}=_0xb709ef,_0x56b44e=await resolveOAuthAccessToken({'site':resolveSite(_0x4e308d[_0x24c41e(0x118)]||_0x24c41e(0x105)),'profile':_0x4e308d[_0x24c41e(0x140)],'proxy':loadGlobalProxy()});return console[_0x24c41e(0x120)](_0x56b44e),0x0;}}function a7_0x5283(){const _0x58bb38=['first_name','jobs','apiKey','/app/mp/ak','\x20\x20(','filter','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','3681790fSkLxI','status','auth:clear','\x20and\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Setting\x20up\x20authentication\x20for\x20site:\x20','us01','getUserInfo','✓\x20Signed\x20in\x20successfully','apikey','logLevel','bold','account_id','7VHAFXv','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✓\x20Authentication\x20successful\x0a','OAuth\x20tokens','method','8796lcQwCX','tdx:\x20auth\x20setup','tdx:\x20auth\x20clear','\x20\x20user_id:','/oauth/authorize','Sign\x20in\x20with\x20browser\x20(recommended)','auth:setup','site','tdx\x20profile:\x20','red','\x20removed\x20from\x20keychain','Opening\x20browser\x20for\x20authentication...','join','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','execute','log','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','15qafwtG','password','✓\x20Default\x20site\x20set\x20to\x20','\x27\x20registered','\x20(profile:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','yellow','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Print\x20the\x20current\x20OAuth\x20access\x20token','No\x20credential\x20found','description','trim','auth','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','242226KfsYDZ','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','message','4901VEuyJr','✓\x20Profile\x20\x27','create','email','356548gPsNVC','No\x20credentials\x20found\x20in\x20keychain','871530rjSHmb','Choose\x20how\x20to\x20sign\x20in:','Read\x20credential\x20from\x20','✗\x20Validation\x20failed:\x20','ERROR','access_token','profile','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x20(site:\x20','Setup\x20API\x20key\x20authentication\x20interactively','green','\x20\x20tdx','6374hbTGjb','all','/users/initiate_sso\x20(account:\x20','accountName','18HwVaHq','Name:\x20','Setup\x20cancelled','48derYrl','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Validating\x20API\x20key...','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','text','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','dim','11YjCGtx','select','oauth','last_name','Validating\x20OAuth\x20tokens...','2005551xUyWLQ','For\x20scripts\x20or\x20headless\x20servers','You\x20can\x20find\x20your\x20API\x20key\x20at:','name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20for\x20profile:\x20','System\x20keychain\x20is\x20not\x20available','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','warn','API\x20key','\x20--profile\x20','error','Enter\x20your\x20TD\x20API\x20key:'];a7_0x5283=function(){return _0x58bb38;};return a7_0x5283();}export class AuthClearCommand extends BaseCommand{[a7_0x1d644f(0x15c)]=a7_0x1d644f(0x101);[a7_0x1d644f(0x12d)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x1d644f(0x11f)](_0x34317c){const _0x129501=a7_0x1d644f,{options:_0xbf7f2c}=_0x34317c,_0x1f15e7=_0xbf7f2c[_0x129501(0x140)];console[_0x129501(0x120)](a7_0x34a050[_0x129501(0x10a)](_0x129501(0x113)));const _0x15226e=await isKeychainAvailable();if(!_0x15226e)return console[_0x129501(0x164)](a7_0x34a050[_0x129501(0x11a)](_0x129501(0x15f))),0x1;const [_0x405572,_0x4060f7]=await Promise[_0x129501(0x147)]([deleteKeychainAPIKey(_0x1f15e7),deleteOAuthTokens(_0x1f15e7)]);if(_0x405572||_0x4060f7){clearCredentialCache();const _0x1ea015=[_0x405572&&_0x129501(0x162),_0x4060f7&&_0x129501(0x10f)][_0x129501(0xfd)](Boolean)['join'](_0x129501(0x102));return console['log']('✓\x20'+_0x1ea015+_0x129501(0x11b)+(_0x1f15e7?_0x129501(0x126)+_0x1f15e7+')':'')),0x0;}else return console[_0x129501(0x120)](_0x129501(0x139)+(_0x1f15e7?_0x129501(0x15e)+_0x1f15e7:'')),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;}}
|