@treasuredata/tdx 2026.8.3 → 2026.8.5
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.d.ts.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/cas-segment-command.js.map +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-schema.d.ts +63 -0
- package/dist/sdk/cas/cas-segment-schema.d.ts.map +1 -0
- package/dist/sdk/cas/cas-segment-schema.js +1 -0
- package/dist/sdk/cas/cas-segment-schema.js.map +1 -0
- package/dist/sdk/cas/cas-segment-validator.d.ts +76 -0
- package/dist/sdk/cas/cas-segment-validator.d.ts.map +1 -0
- package/dist/sdk/cas/cas-segment-validator.js +1 -0
- package/dist/sdk/cas/cas-segment-validator.js.map +1 -0
- 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.d.ts +23 -6
- package/dist/sdk/cas/validate-files.d.ts.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/cas/validate-files.js.map +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.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +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
|
+
function a3_0x11a3(){const _0x4f7787=['error','12kEOeoT','execute','resolveSegmentId','Resolved\x20parent\x20ID:\x20','9NrLoNn','cause','\x27...','✔\x20Found\x20','Site:\x20','listActivations','List\x20activations\x20for\x20a\x20segment','name','resolveParentId','4158832wbXTFK','44LrfyAH','Parent\x20name:\x20','1004420tMWCuI','Error:\x20','444666vEuhMC','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Child\x20name:\x20','length','411729oySuuE','1548480FzHtjr','segment','3204140YcxhGH','message','verbose','1066062AxVHoB','data','119ombhAR','site'];a3_0x11a3=function(){return _0x4f7787;};return a3_0x11a3();}const a3_0x3102e3=a3_0xed31;(function(_0x46f78f,_0x2e2005){const _0xd6ba8c=a3_0xed31,_0x46b2e2=_0x46f78f();while(!![]){try{const _0x24861e=-parseInt(_0xd6ba8c(0x121))/0x1+parseInt(_0xd6ba8c(0x12d))/0x2+-parseInt(_0xd6ba8c(0x127))/0x3*(parseInt(_0xd6ba8c(0x132))/0x4)+-parseInt(_0xd6ba8c(0x12a))/0x5+-parseInt(_0xd6ba8c(0x123))/0x6*(-parseInt(_0xd6ba8c(0x12f))/0x7)+-parseInt(_0xd6ba8c(0x11e))/0x8*(-parseInt(_0xd6ba8c(0x136))/0x9)+-parseInt(_0xd6ba8c(0x128))/0xa*(-parseInt(_0xd6ba8c(0x11f))/0xb);if(_0x24861e===_0x2e2005)break;else _0x46b2e2['push'](_0x46b2e2['shift']());}catch(_0xd21947){_0x46b2e2['push'](_0x46b2e2['shift']());}}}(a3_0x11a3,0xd5ab3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0xed31(_0x412c1c,_0x1b87f9){_0x412c1c=_0x412c1c-0x11c;const _0x11a35d=a3_0x11a3();let _0xed31e3=_0x11a35d[_0x412c1c];return _0xed31e3;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x3102e3(0x11c)]='activations';['description']=a3_0x3102e3(0x13c);async[a3_0x3102e3(0x133)](_0x1365c9){const _0x5ab45e=a3_0x3102e3,{options:_0x120a70,args:_0x851af2,tdx:_0x3417da}=_0x1365c9;if(_0x851af2[_0x5ab45e(0x126)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0x5ab45e(0x131)](_0x5ab45e(0x124)),0x1;try{const {parentId:_0x53514d,childId:_0x1e63ab}=parseSegmentRef(_0x851af2[0x0]);if(!_0x1e63ab)return console[_0x5ab45e(0x131)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x5ab45e(0x124)),0x1;_0x120a70['verbose']&&(console[_0x5ab45e(0x131)](_0x5ab45e(0x13a)+_0x120a70[_0x5ab45e(0x130)]),console[_0x5ab45e(0x131)](_0x5ab45e(0x120)+_0x53514d),console[_0x5ab45e(0x131)](_0x5ab45e(0x125)+_0x1e63ab));const _0x1d0fec=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x53514d+_0x5ab45e(0x138),()=>_0x3417da[_0x5ab45e(0x129)][_0x5ab45e(0x11d)](_0x53514d),{'verbose':_0x120a70['verbose']}),_0x3afcd1=_0x1d0fec['data'];_0x120a70[_0x5ab45e(0x12c)]&&console[_0x5ab45e(0x131)](_0x5ab45e(0x135)+_0x3afcd1);const _0x502304=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x1e63ab+_0x5ab45e(0x138),()=>_0x3417da[_0x5ab45e(0x129)][_0x5ab45e(0x134)](_0x3afcd1,_0x1e63ab),{'verbose':_0x120a70['verbose']}),_0x5450c1=_0x502304[_0x5ab45e(0x12e)];_0x120a70[_0x5ab45e(0x12c)]&&console[_0x5ab45e(0x131)]('Resolved\x20child\x20ID:\x20'+_0x5450c1);const _0x40cac5=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x1e63ab+'\x27...',()=>_0x3417da[_0x5ab45e(0x129)][_0x5ab45e(0x13b)](_0x3afcd1,_0x5450c1),{'verbose':_0x120a70[_0x5ab45e(0x12c)]}),_0x13dd46=_0x40cac5[_0x5ab45e(0x12e)];return console[_0x5ab45e(0x131)](_0x5ab45e(0x139)+_0x13dd46['length']+'\x20activation'+(_0x13dd46[_0x5ab45e(0x126)]!==0x1?'s':'')),await handleSDKOutput(_0x13dd46,_0x120a70),0x0;}catch(_0x1410ea){if(_0x1410ea instanceof SDKError)return console[_0x5ab45e(0x131)](_0x5ab45e(0x122)+_0x1410ea[_0x5ab45e(0x12b)]),_0x1410ea[_0x5ab45e(0x137)]&&console[_0x5ab45e(0x131)]('\x20\x20Cause:\x20'+_0x1410ea[_0x5ab45e(0x137)]),0x1;throw _0x1410ea;}}}
|
|
@@ -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_0x557cb5=a4_0x4f4c;(function(_0x27e2c2,_0x4d623c){const _0x56b80b=a4_0x4f4c,_0x445dd9=_0x27e2c2();while(!![]){try{const _0x593888=parseInt(_0x56b80b(0x226))/0x1+parseInt(_0x56b80b(0x1b5))/0x2+parseInt(_0x56b80b(0x1d2))/0x3*(parseInt(_0x56b80b(0x219))/0x4)+-parseInt(_0x56b80b(0x1e3))/0x5*(-parseInt(_0x56b80b(0x1a5))/0x6)+parseInt(_0x56b80b(0x185))/0x7+parseInt(_0x56b80b(0x183))/0x8+-parseInt(_0x56b80b(0x1f1))/0x9*(parseInt(_0x56b80b(0x236))/0xa);if(_0x593888===_0x4d623c)break;else _0x445dd9['push'](_0x445dd9['shift']());}catch(_0x5e9dda){_0x445dd9['push'](_0x445dd9['shift']());}}}(a4_0x35cc,0x6439a));import a4_0x4b495a from'chalk';import a4_0xfd957b from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x34686a){const _0x15b051=a4_0x4f4c,_0x1123ad=[];if(_0x34686a['total']!==undefined)_0x1123ad['push'](_0x34686a['total']+'\x20total');if(_0x34686a[_0x15b051(0x1dd)]!==undefined&&_0x34686a[_0x15b051(0x1dd)]>0x0)_0x1123ad[_0x15b051(0x1e1)](a4_0x4b495a[_0x15b051(0x188)](_0x34686a[_0x15b051(0x1dd)]+'\x20new'));if(_0x34686a[_0x15b051(0x18f)]!==undefined&&_0x34686a[_0x15b051(0x18f)]>0x0)_0x1123ad[_0x15b051(0x1e1)](a4_0x4b495a['green'](_0x34686a['created']+_0x15b051(0x1b6)));if(_0x34686a['updated']!==undefined&&_0x34686a[_0x15b051(0x1ce)]>0x0)_0x1123ad[_0x15b051(0x1e1)](a4_0x4b495a[_0x15b051(0x220)](_0x34686a[_0x15b051(0x1ce)]+_0x15b051(0x234)));if(_0x34686a[_0x15b051(0x23c)]!==undefined&&_0x34686a[_0x15b051(0x23c)]>0x0)_0x1123ad[_0x15b051(0x1e1)](a4_0x4b495a[_0x15b051(0x1c5)](_0x34686a[_0x15b051(0x23c)]+'\x20unchanged'));if(_0x34686a['errors']!==undefined&&_0x34686a['errors']>0x0)_0x1123ad[_0x15b051(0x1e1)](a4_0x4b495a['red'](_0x34686a[_0x15b051(0x1c4)]+_0x15b051(0x1d7)));return _0x1123ad[_0x15b051(0x203)](',\x20');}function displayDiffs(_0x3aceb6,_0x28de99,_0x9e62c4,_0x15d01e,_0x571c87,_0x4a63c6,_0x44d11c,_0x336e7b,_0x24f19d){const _0x11630e=a4_0x4f4c;for(const _0x3d7a7f of _0x3aceb6){if(_0x3d7a7f[_0x11630e(0x1f7)]){const _0x2fd52e=_0x3d7a7f[_0x11630e(0x1f8)]||_0x3d7a7f[_0x11630e(0x1eb)];console[_0x11630e(0x18b)](_0x11630e(0x229)+_0x2fd52e+'\x27:'),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)),console[_0x11630e(0x18b)](_0x3d7a7f['diff']),console['log']('─'[_0x11630e(0x1af)](0x3c));}}for(const _0x43ff40 of _0x28de99){_0x43ff40[_0x11630e(0x1f7)]&&(console['log'](_0x11630e(0x1d9)+_0x43ff40[_0x11630e(0x1eb)]+'\x27:'),console['log']('─'[_0x11630e(0x1af)](0x3c)),console['log'](_0x43ff40['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x12a4cf of _0x9e62c4){_0x12a4cf[_0x11630e(0x1f7)]&&(console[_0x11630e(0x18b)](_0x11630e(0x1c3)+_0x12a4cf['name']+'\x27:'),console[_0x11630e(0x18b)]('─'['repeat'](0x3c)),console[_0x11630e(0x18b)](_0x12a4cf[_0x11630e(0x1f7)]),console['log']('─'['repeat'](0x3c)));}for(const _0x35e4b8 of _0x15d01e){_0x35e4b8[_0x11630e(0x1f7)]&&(console[_0x11630e(0x18b)](_0x11630e(0x209)+_0x35e4b8['name']+'\x27:'),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)),console['log'](_0x35e4b8['diff']),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)));}for(const _0x2ca7d5 of _0x571c87){_0x2ca7d5[_0x11630e(0x1f7)]&&(console['log'](_0x11630e(0x1bc)+_0x2ca7d5['name']+'\x27:'),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)),console['log'](_0x2ca7d5['diff']),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)));}for(const _0x5e2b79 of _0x4a63c6){_0x5e2b79[_0x11630e(0x1f7)]&&(console[_0x11630e(0x18b)](_0x11630e(0x1be)+_0x5e2b79[_0x11630e(0x1eb)]+'\x27:'),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)),console[_0x11630e(0x18b)](_0x5e2b79[_0x11630e(0x1f7)]),console[_0x11630e(0x18b)]('─'['repeat'](0x3c)));}for(const _0x72f113 of _0x44d11c){_0x72f113[_0x11630e(0x1f7)]&&(console[_0x11630e(0x18b)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x72f113[_0x11630e(0x1eb)]+'\x27:'),console[_0x11630e(0x18b)]('─'['repeat'](0x3c)),console[_0x11630e(0x18b)](_0x72f113['diff']),console['log']('─'[_0x11630e(0x1af)](0x3c)));}for(const _0x217365 of _0x336e7b){_0x217365[_0x11630e(0x1f7)]&&(console[_0x11630e(0x18b)](_0x11630e(0x218)+_0x217365[_0x11630e(0x1eb)]+'\x27:'),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)),console[_0x11630e(0x18b)](_0x217365[_0x11630e(0x1f7)]),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)));}for(const _0x58b29a of _0x24f19d){_0x58b29a[_0x11630e(0x1f7)]&&(console[_0x11630e(0x18b)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x58b29a['name']+'\x27:'),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)),console[_0x11630e(0x18b)](_0x58b29a[_0x11630e(0x1f7)]),console[_0x11630e(0x18b)]('─'[_0x11630e(0x1af)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x557cb5(0x1eb)]='agent:pull';[a4_0x557cb5(0x213)]=a4_0x557cb5(0x1df);async[a4_0x557cb5(0x1ab)](_0x5556a4){const _0x356ff6=a4_0x557cb5,{options:_0x5640d4,args:_0x4e2a88,tdx:_0x3da89a}=_0x5556a4,_0x55edcd=_0x4e2a88[0x0],_0x17fd00=_0x4e2a88[0x1],_0x1bac55=_0x5640d4[_0x356ff6(0x214)],_0xda8b49=_0x5640d4['dryRun'],_0x165df0=_0x5640d4[_0x356ff6(0x20a)],_0xb00340=_0x5640d4[_0x356ff6(0x1a6)],_0x18fe33=_0x5640d4[_0x356ff6(0x19e)],_0x38592a=_0x5640d4[_0x356ff6(0x1fe)];let _0x1fc4f7;if(_0x55edcd){const _0x44d617=a4_0xfd957b[_0x356ff6(0x203)](_0x55edcd,_0x356ff6(0x221));if(existsSync(_0x44d617))try{const _0x41b913=JSON[_0x356ff6(0x207)](readFileSync(_0x44d617,_0x356ff6(0x1f2)));_0x41b913[_0x356ff6(0x19b)]&&(_0x1fc4f7={'llm_project':_0x41b913['llm_project']});}catch{}}const _0x17213f=findAgentConfigPath(process[_0x356ff6(0x21a)]());let _0x451cdd;if(_0x17213f)try{const _0x208ec0=JSON[_0x356ff6(0x207)](readFileSync(_0x17213f,_0x356ff6(0x1f2)));_0x208ec0[_0x356ff6(0x19b)]&&(_0x451cdd={'llm_project':_0x208ec0['llm_project']});}catch{}const _0x2fb4b4=resolveAgentPullArgs({'arg':_0x55edcd,'agentNameArg':_0x17fd00,'agentFlag':_0x38592a,'contextProject':_0x18fe33,'argDirConfig':_0x1fc4f7,'cwdConfigPath':_0x17213f||undefined,'cwdConfig':_0x451cdd}),{projectNameOrId:_0x1fc03f,targetAgentName:_0x1efea6,existingOutputDir:_0x1f3604,source:_0x3544f1}=_0x2fb4b4;if(_0x3544f1==='arg-dir')console['log'](a4_0x4b495a[_0x356ff6(0x201)](_0x356ff6(0x1c0)+a4_0xfd957b[_0x356ff6(0x203)](_0x55edcd,'tdx.json')+':\x20'+_0x1fc03f));else{if(_0x3544f1==='cwd-config')console[_0x356ff6(0x18b)](a4_0x4b495a[_0x356ff6(0x201)](_0x356ff6(0x1c6)+_0x1fc03f));else _0x3544f1===_0x356ff6(0x1e4)&&console[_0x356ff6(0x18b)](a4_0x4b495a['dim'](_0x356ff6(0x1e8)+_0x1fc03f));}if(!_0x1fc03f)return _0x38592a?(console['log'](a4_0x4b495a['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x356ff6(0x18b)](_0x356ff6(0x1ae))):(console[_0x356ff6(0x18b)](a4_0x4b495a[_0x356ff6(0x220)](_0x356ff6(0x21c))),console['log'](_0x356ff6(0x232)),console[_0x356ff6(0x18b)](_0x356ff6(0x196)),console['log'](_0x356ff6(0x22d)),console[_0x356ff6(0x18b)](_0x356ff6(0x1bb)),console[_0x356ff6(0x18b)](_0x356ff6(0x20f))),0x1;if(_0x1efea6){const {data:_0x499352}=await withSpinner('Pulling\x20agent\x20\x22'+_0x1efea6+_0x356ff6(0x1fa)+_0x1fc03f+_0x356ff6(0x194),()=>_0x3da89a[_0x356ff6(0x1a1)][_0x356ff6(0x22c)](_0x1fc03f,_0x1efea6,_0x1bac55,{'dryRun':_0xda8b49,'force':_0x165df0}));if(_0xda8b49)return console[_0x356ff6(0x18b)](a4_0x4b495a[_0x356ff6(0x220)](_0x356ff6(0x222))),console[_0x356ff6(0x18b)](_0x356ff6(0x239)+_0x499352['agentName']),console['log'](_0x356ff6(0x1ec)+_0x499352[_0x356ff6(0x1d1)]),_0x499352['diff']&&(console[_0x356ff6(0x18b)](_0x356ff6(0x1aa)),console[_0x356ff6(0x18b)]('─'[_0x356ff6(0x1af)](0x3c)),console[_0x356ff6(0x18b)](_0x499352['diff']),console[_0x356ff6(0x18b)]('─'[_0x356ff6(0x1af)](0x3c))),0x0;return console[_0x356ff6(0x18b)](a4_0x4b495a[_0x356ff6(0x188)](_0x356ff6(0x21d))),console['log']('Agent:\x20'+_0x499352[_0x356ff6(0x1f8)]),console[_0x356ff6(0x18b)](_0x356ff6(0x20e)+_0x499352[_0x356ff6(0x1d1)]),console[_0x356ff6(0x18b)]('Status:\x20'+(_0x499352[_0x356ff6(0x182)]?a4_0x4b495a[_0x356ff6(0x188)](_0x356ff6(0x1dd)):_0x499352[_0x356ff6(0x1b0)]?a4_0x4b495a[_0x356ff6(0x220)](_0x356ff6(0x1ce)):a4_0x4b495a[_0x356ff6(0x1c5)](_0x356ff6(0x23c)))),0x0;}const _0x4f75b0=_0x1f3604||_0x1bac55,{data:_0x3f84f3}=await withSpinner(_0x356ff6(0x1d0)+_0x1fc03f+_0x356ff6(0x194),()=>_0x3da89a[_0x356ff6(0x1a1)][_0x356ff6(0x1e7)](_0x1fc03f,_0x4f75b0,{'dryRun':!![]})),_0x1b99b6=_0x3f84f3['counts'][_0x356ff6(0x19c)][_0x356ff6(0x1dd)]+_0x3f84f3[_0x356ff6(0x1ad)]['knowledgeBases'][_0x356ff6(0x1dd)]+_0x3f84f3[_0x356ff6(0x1ad)]['textKnowledgeBases'][_0x356ff6(0x1dd)]+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x19d)][_0x356ff6(0x1dd)]+_0x3f84f3['counts'][_0x356ff6(0x1ca)]['new']+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1ff)][_0x356ff6(0x1dd)]+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1a0)]['new']+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1a8)]['new']+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x20c)]['new'],_0x3c230d=_0x3f84f3[_0x356ff6(0x1ad)]['agents'][_0x356ff6(0x1ce)]+_0x3f84f3['counts'][_0x356ff6(0x18d)][_0x356ff6(0x1ce)]+_0x3f84f3['counts'][_0x356ff6(0x1cd)][_0x356ff6(0x1ce)]+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x19d)]['updated']+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1ca)][_0x356ff6(0x1ce)]+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1ff)][_0x356ff6(0x1ce)]+_0x3f84f3[_0x356ff6(0x1ad)]['experimentalArtifacts'][_0x356ff6(0x1ce)]+_0x3f84f3[_0x356ff6(0x1ad)]['formInterfaces'][_0x356ff6(0x1ce)]+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x20c)]['updated'],_0x4e09b0=_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x19c)][_0x356ff6(0x23c)]+_0x3f84f3['counts']['knowledgeBases'][_0x356ff6(0x23c)]+_0x3f84f3['counts'][_0x356ff6(0x1cd)][_0x356ff6(0x23c)]+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x19d)][_0x356ff6(0x23c)]+_0x3f84f3['counts'][_0x356ff6(0x1ca)][_0x356ff6(0x23c)]+_0x3f84f3[_0x356ff6(0x1ad)]['experimentalKnowledgeBases'][_0x356ff6(0x23c)]+_0x3f84f3['counts'][_0x356ff6(0x1a0)]['unchanged']+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1a8)][_0x356ff6(0x23c)]+_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x20c)][_0x356ff6(0x23c)];console[_0x356ff6(0x18b)]('\x0aPull\x20summary\x20for\x20\x27'+_0x3f84f3[_0x356ff6(0x225)]+'\x27:'),console[_0x356ff6(0x18b)]('\x20\x20'+a4_0x4b495a[_0x356ff6(0x188)]('+\x20'+_0x1b99b6+_0x356ff6(0x18a))+_0x356ff6(0x1b4)+a4_0x4b495a['yellow']('~\x20'+_0x3c230d+'\x20changed')+_0x356ff6(0x1b4)+a4_0x4b495a[_0x356ff6(0x201)]('=\x20'+_0x4e09b0+_0x356ff6(0x1a2))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x19c)])),console[_0x356ff6(0x18b)](_0x356ff6(0x184)+formatCountSummary(_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x18d)])),console[_0x356ff6(0x18b)](_0x356ff6(0x23b)+formatCountSummary(_0x3f84f3[_0x356ff6(0x1ad)]['textKnowledgeBases'])),console[_0x356ff6(0x18b)](_0x356ff6(0x204)+formatCountSummary(_0x3f84f3['counts'][_0x356ff6(0x19d)])),console[_0x356ff6(0x18b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1ca)])),console[_0x356ff6(0x18b)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3f84f3[_0x356ff6(0x1ad)]['formInterfaces'])),console['log'](_0x356ff6(0x202)+formatCountSummary(_0x3f84f3[_0x356ff6(0x1ad)]['chatInterfaces']));const _0x198c96=_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1ff)][_0x356ff6(0x235)]>0x0||_0x3f84f3['counts']['experimentalArtifacts'][_0x356ff6(0x235)]>0x0;_0x198c96&&(console[_0x356ff6(0x18b)](_0x356ff6(0x206)+formatCountSummary(_0x3f84f3[_0x356ff6(0x1ad)][_0x356ff6(0x1ff)])),console[_0x356ff6(0x18b)](_0x356ff6(0x233)+formatCountSummary(_0x3f84f3['counts']['experimentalArtifacts'])));console[_0x356ff6(0x18b)]('\x20\x20Target:\x20'+a4_0x4b495a['cyan'](_0x3f84f3['outputDir'])),displayDiffs(_0x3f84f3['agents'],_0x3f84f3[_0x356ff6(0x18d)],_0x3f84f3[_0x356ff6(0x1cd)],_0x3f84f3[_0x356ff6(0x19d)],_0x3f84f3[_0x356ff6(0x1ca)],_0x3f84f3[_0x356ff6(0x1ff)],_0x3f84f3[_0x356ff6(0x1a0)],_0x3f84f3[_0x356ff6(0x1a8)],_0x3f84f3[_0x356ff6(0x20c)]);if(_0xda8b49)return console[_0x356ff6(0x18b)](a4_0x4b495a[_0x356ff6(0x220)](_0x356ff6(0x1a9))),0x0;if(_0x1b99b6===0x0&&_0x3c230d===0x0)return console[_0x356ff6(0x18b)](a4_0x4b495a[_0x356ff6(0x188)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x3f84f3[_0x356ff6(0x225)]},_0x5640d4[_0x356ff6(0x1b3)]),console['log'](a4_0x4b495a[_0x356ff6(0x188)](_0x356ff6(0x189)+a4_0x4b495a[_0x356ff6(0x201)]('llm_project')+_0x356ff6(0x21f)+a4_0x4b495a[_0x356ff6(0x1d8)](_0x3f84f3[_0x356ff6(0x225)]))),0x0;if(!_0xb00340&&!_0x165df0){if(!isInteractive())return console[_0x356ff6(0x237)](a4_0x4b495a['red'](_0x356ff6(0x1ac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x356ff6(0x237)](a4_0x4b495a[_0x356ff6(0x201)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2da563=await confirmKey(_0x356ff6(0x228)+(_0x1b99b6+_0x3c230d)+_0x356ff6(0x216));if(!_0x2da563)return console['log'](a4_0x4b495a[_0x356ff6(0x220)](_0x356ff6(0x1ee)),_0x356ff6(0x22e)),0x1;}const {data:_0x2ffbcb}=await withSpinner(_0x356ff6(0x20b),()=>_0x3da89a[_0x356ff6(0x1a1)][_0x356ff6(0x1e7)](_0x1fc03f,_0x4f75b0,{'force':_0x165df0}));return console['log'](a4_0x4b495a['green']('\x0a✔\x20Pulled\x20'+(_0x1b99b6+_0x3c230d)+_0x356ff6(0x199)+_0x2ffbcb[_0x356ff6(0x1a3)])),saveSessionContext({'llm_project':_0x2ffbcb[_0x356ff6(0x225)]},_0x5640d4[_0x356ff6(0x1b3)]),console['log'](a4_0x4b495a[_0x356ff6(0x188)](_0x356ff6(0x189)+a4_0x4b495a[_0x356ff6(0x201)](_0x356ff6(0x19b))+_0x356ff6(0x21f)+a4_0x4b495a[_0x356ff6(0x1d8)](_0x2ffbcb[_0x356ff6(0x225)]))),0x0;}}function a4_0x4f4c(_0x22fb5d,_0x4cbe86){_0x22fb5d=_0x22fb5d-0x181;const _0x35cc2a=a4_0x35cc();let _0x4f4c96=_0x35cc2a[_0x22fb5d];return _0x4f4c96;}function a4_0x35cc(){const _0x1a1060=['Errors:','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','green','✔\x20Context\x20set:\x20','\x20new','log','no_context','knowledgeBases','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','created','found','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Agent\x20\x22','\x22...','\x22\x20to\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','cloneProject','Pushing\x20agent\x20from\x20\x22','\x20files\x20to\x20','Using\x20current\x20project:\x20','llm_project','agents','prompts','llmProject','pushProject','experimentalArtifacts','llm','\x20unchanged','outputDir','\x22\x20to\x20a\x20different\x20profile','12NmSPJT','yes','Cloning\x20\x22','formInterfaces','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges:','execute','\x0aError:','counts','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','repeat','hasChanges','Project\x20cloned\x20successfully','\x20\x20tdx\x20agent\x20pull\x20','session','\x20|\x20','1504258UKMtKY','\x20created','\x20\x20Knowledge\x20Base\x20\x22','\x20--profile\x20','dryRun','Analyzing\x20changes\x20to\x20push...','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x0aChanges\x20to\x20integration\x20\x27','Agent\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Agent:\x20','Using\x20project\x20from\x20','\x20\x20Source:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','errors','gray','Using\x20project:\x20','\x20\x20Form\x20Interface\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','Source:\x20','integrations','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agentId','textKnowledgeBases','updated','\x0aErrors\x20found:','Analyzing\x20project\x20\x22','outputPath','89370xATKpo','sourceProjectName','agent:push','\x20\x20Chat\x20Interface\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20errors','cyan','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','projectId','pushAgent','MISSING_ARGUMENT','new','\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)','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20resources?','push','agent:clone','116995WYHmkQ','context','dirname','New\x20project:\x20','pullProject','Using\x20project\x20from\x20context:\x20','\x20\x20Agents:\x20','<new-name>','name','Output\x20path:\x20','no_local_folder','Cancelled','INVALID_ARGUMENT','-\x20nothing\x20pushed','9mctqUu','utf-8','message','projectDir','Project:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','diff','agentName','Clone\x20\x22','\x22\x20from\x20project\x20\x22','\x0aPush\x20','action','\x20\x20Form\x20Interfaces:\x20','agent','experimentalKnowledgeBases','Failed\x20to\x20push\x20agent:\x20','dim','\x20\x20Chat\x20Interfaces:\x20','join','\x20\x20Prompts:\x20','profile','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','parse','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aChanges\x20to\x20prompt\x20\x27','force','Writing\x20files...','chatInterfaces','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Output:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','No\x20tdx.json\x20found\x20in\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Integration\x20\x22','description','output','\x20--name\x20','\x20files?','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20form\x20interface\x20\x27','76RFroxO','cwd','agent.yml','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Agent\x20pulled\x20successfully','\x20successfully','\x20=\x20','yellow','tdx.json','Dry\x20run\x20-\x20no\x20files\x20written','Pushing\x20to\x20project...','\x20\x20Experimental\x20Artifact\x20\x22','projectName','193102eRRcdg','\x22:\x20','\x0aWrite\x20','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Integrations:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','pullAgent','\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','-\x20no\x20files\x20written','\x20\x20Prompt\x20\x22','newProjectId','site','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)','\x20\x20Experimental\x20Artifacts:\x20','\x20updated','total','19876490SKDfuZ','error','reason','Would\x20pull\x20agent:\x20','red','\x20\x20Text\x20Knowledge\x20Bases:\x20','unchanged','Using\x20local\x20project:\x20','isNew','6007696tUtTcb','\x20\x20Knowledge\x20Bases:\x20','624190xTyTXX'];a4_0x35cc=function(){return _0x1a1060;};return a4_0x35cc();}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x557cb5(0x1e2);[a4_0x557cb5(0x213)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x557cb5(0x1ab)](_0x3b613c){const _0x5e450c=a4_0x557cb5,{options:_0x110d6e,args:_0x146351,tdx:_0x5b13e0}=_0x3b613c,_0x2c50c2=_0x146351[0x0],_0x190a42=_0x110d6e[_0x5e450c(0x1eb)],_0x406d18=_0x110d6e[_0x5e450c(0x1b9)],_0x55fcb8=_0x110d6e[_0x5e450c(0x1a6)],_0x830976=_0x110d6e[_0x5e450c(0x231)],_0x101a33=_0x110d6e[_0x5e450c(0x19e)];let _0x96e8fe;const _0x359c51=findAgentConfigPath(process[_0x5e450c(0x21a)]());if(_0x2c50c2){const _0x1b5a8a=a4_0xfd957b['join'](_0x2c50c2,_0x5e450c(0x221));existsSync(_0x1b5a8a)?(_0x96e8fe=_0x2c50c2,console['log'](a4_0x4b495a[_0x5e450c(0x201)](_0x5e450c(0x181)+_0x2c50c2))):_0x96e8fe=_0x2c50c2;}else{if(_0x359c51)_0x96e8fe=a4_0xfd957b[_0x5e450c(0x1e5)](_0x359c51),console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x201)](_0x5e450c(0x19a)+_0x96e8fe));else{if(_0x101a33){const _0x88af49=sanitizeForFilesystem(_0x101a33);let _0x54ab97=_0x88af49,_0x303df9=a4_0xfd957b['join'](process[_0x5e450c(0x21a)](),_0x5e450c(0x19c),_0x88af49,'tdx.json');if(!existsSync(_0x303df9)){const _0x4c10df=normalizeName(_0x101a33),_0xd25987=a4_0xfd957b[_0x5e450c(0x203)](process['cwd'](),_0x5e450c(0x19c),_0x4c10df,_0x5e450c(0x221));existsSync(_0xd25987)&&(_0x54ab97=_0x4c10df,_0x303df9=_0xd25987);}if(existsSync(_0x303df9))_0x96e8fe=a4_0xfd957b[_0x5e450c(0x1e5)](_0x303df9),console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x201)]('Using\x20local\x20project:\x20'+_0x96e8fe));else{const _0x33d00a=_0x110d6e[_0x5e450c(0x205)];if(_0x33d00a)throw new SDKError(ErrorCode[_0x5e450c(0x1ef)],_0x5e450c(0x22b)+_0x101a33+_0x5e450c(0x1a4),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x5e450c(0x191)+(_0x5e450c(0x1b2)+_0x101a33+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x54ab97+_0x5e450c(0x215)+(_0x190a42||_0x5e450c(0x1ea))+_0x5e450c(0x1b8)+_0x33d00a)});_0x96e8fe=_0x101a33,console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x201)]('Using\x20context\x20project:\x20'+_0x101a33));}}}}if(!_0x96e8fe)return console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x220)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x5e450c(0x192)),console[_0x5e450c(0x18b)](_0x5e450c(0x20d)),console['log'](_0x5e450c(0x1de)),console[_0x5e450c(0x18b)](_0x5e450c(0x18e)),0x1;if(!_0x190a42)throw new SDKError(ErrorCode[_0x5e450c(0x1dc)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x55fcb8&&!_0x406d18){if(!isInteractive())return console[_0x5e450c(0x237)](a4_0x4b495a[_0x5e450c(0x23a)]('\x0aError:'),_0x5e450c(0x1d6)),console['error'](a4_0x4b495a[_0x5e450c(0x201)](_0x5e450c(0x208))),0x1;const _0x308079=await confirmKey(_0x5e450c(0x1f9)+_0x96e8fe+'\x22\x20to\x20new\x20project\x20\x22'+_0x190a42+'\x22?');if(!_0x308079)return console['log'](a4_0x4b495a[_0x5e450c(0x220)](_0x5e450c(0x1ee))),0x1;}const {data:_0x4dfc0f}=await withSpinner(_0x5e450c(0x1a7)+_0x96e8fe+_0x5e450c(0x195)+_0x190a42+_0x5e450c(0x194),()=>_0x5b13e0['llm'][_0x5e450c(0x197)](_0x96e8fe,_0x190a42,{'dryRun':_0x406d18}));if(_0x406d18){console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x220)](_0x5e450c(0x1c2))),console['log']('Source:\x20'+_0x4dfc0f[_0x5e450c(0x1d3)]),console[_0x5e450c(0x18b)]('New\x20project:\x20'+_0x190a42),console[_0x5e450c(0x18b)]('Would\x20clone:'),console[_0x5e450c(0x18b)]('\x20\x20Agents:\x20'+_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x19c)]['created']),console[_0x5e450c(0x18b)](_0x5e450c(0x184)+_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x18d)][_0x5e450c(0x18f)]),console[_0x5e450c(0x18b)](_0x5e450c(0x204)+_0x4dfc0f['counts'][_0x5e450c(0x19d)][_0x5e450c(0x18f)]),console[_0x5e450c(0x18b)](_0x5e450c(0x1fd)+_0x4dfc0f['counts']['formInterfaces'][_0x5e450c(0x18f)]),console[_0x5e450c(0x18b)]('\x20\x20Chat\x20Interfaces:\x20'+_0x4dfc0f['counts']['chatInterfaces'][_0x5e450c(0x18f)]);const _0x690806=_0x4dfc0f['counts'][_0x5e450c(0x1ff)][_0x5e450c(0x18f)]>0x0||_0x4dfc0f['counts'][_0x5e450c(0x1a0)]['created']>0x0;return _0x690806&&(console[_0x5e450c(0x18b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x1ff)][_0x5e450c(0x18f)]),console[_0x5e450c(0x18b)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x1a0)][_0x5e450c(0x18f)])),0x0;}const _0x38b7f6=_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x19c)]['errors']>0x0||_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x18d)][_0x5e450c(0x1c4)]>0x0||_0x4dfc0f[_0x5e450c(0x1ad)]['prompts'][_0x5e450c(0x1c4)]>0x0||_0x4dfc0f['counts'][_0x5e450c(0x1a8)][_0x5e450c(0x1c4)]>0x0||_0x4dfc0f[_0x5e450c(0x1ad)]['chatInterfaces']['errors']>0x0||_0x4dfc0f['counts']['experimentalKnowledgeBases']['errors']>0x0||_0x4dfc0f[_0x5e450c(0x1ad)]['experimentalArtifacts'][_0x5e450c(0x1c4)]>0x0;_0x38b7f6?console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x220)]('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x4b495a['green'](_0x5e450c(0x1b1)));console[_0x5e450c(0x18b)](_0x5e450c(0x1c9)+_0x4dfc0f['sourceProjectName']),console[_0x5e450c(0x18b)](_0x5e450c(0x1e6)+_0x4dfc0f['newProjectName']),console[_0x5e450c(0x18b)]('New\x20project\x20ID:\x20'+_0x4dfc0f['newProjectId']),console[_0x5e450c(0x18b)](),console['log']('Summary:'),console['log'](_0x5e450c(0x1e9)+formatCountSummary(_0x4dfc0f['counts']['agents'])),console[_0x5e450c(0x18b)](_0x5e450c(0x184)+formatCountSummary(_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x18d)])),console[_0x5e450c(0x18b)](_0x5e450c(0x204)+formatCountSummary(_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x19d)])),console['log'](_0x5e450c(0x22a)+formatCountSummary(_0x4dfc0f[_0x5e450c(0x1ad)]['integrations'])),console['log'](_0x5e450c(0x1fd)+formatCountSummary(_0x4dfc0f['counts'][_0x5e450c(0x1a8)])),console[_0x5e450c(0x18b)](_0x5e450c(0x202)+formatCountSummary(_0x4dfc0f['counts'][_0x5e450c(0x20c)]));const _0x7b04fb=_0x4dfc0f[_0x5e450c(0x1ad)]['experimentalKnowledgeBases'][_0x5e450c(0x18f)]>0x0||_0x4dfc0f['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x1ff)][_0x5e450c(0x23c)]>0x0||_0x4dfc0f['counts']['experimentalArtifacts'][_0x5e450c(0x18f)]>0x0||_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x1a0)][_0x5e450c(0x1ce)]>0x0||_0x4dfc0f[_0x5e450c(0x1ad)][_0x5e450c(0x1a0)][_0x5e450c(0x23c)]>0x0;_0x7b04fb&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4dfc0f['counts'][_0x5e450c(0x1ff)])),console[_0x5e450c(0x18b)](_0x5e450c(0x233)+formatCountSummary(_0x4dfc0f['counts']['experimentalArtifacts'])));if(_0x38b7f6){console[_0x5e450c(0x18b)](),console[_0x5e450c(0x18b)](a4_0x4b495a['red'](_0x5e450c(0x186)));for(const _0x3928b8 of _0x4dfc0f[_0x5e450c(0x19c)]){_0x3928b8[_0x5e450c(0x1fc)]===_0x5e450c(0x237)&&console['log'](a4_0x4b495a['red']('\x20\x20Agent\x20\x22'+_0x3928b8[_0x5e450c(0x1f8)]+_0x5e450c(0x227)+_0x3928b8[_0x5e450c(0x237)]));}for(const _0x431dd0 of _0x4dfc0f[_0x5e450c(0x18d)]){_0x431dd0[_0x5e450c(0x1fc)]===_0x5e450c(0x237)&&console['log'](a4_0x4b495a[_0x5e450c(0x23a)](_0x5e450c(0x1b7)+_0x431dd0[_0x5e450c(0x1eb)]+_0x5e450c(0x227)+_0x431dd0[_0x5e450c(0x237)]));}for(const _0x1c626a of _0x4dfc0f[_0x5e450c(0x19d)]){_0x1c626a[_0x5e450c(0x1fc)]===_0x5e450c(0x237)&&console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x23a)]('\x20\x20Prompt\x20\x22'+_0x1c626a['name']+_0x5e450c(0x227)+_0x1c626a[_0x5e450c(0x237)]));}for(const _0x165557 of _0x4dfc0f[_0x5e450c(0x1ca)]){_0x165557[_0x5e450c(0x1fc)]===_0x5e450c(0x237)&&console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x23a)](_0x5e450c(0x212)+_0x165557[_0x5e450c(0x1eb)]+'\x22:\x20'+_0x165557[_0x5e450c(0x237)]));}for(const _0x4ed72b of _0x4dfc0f[_0x5e450c(0x1a8)]){_0x4ed72b[_0x5e450c(0x1fc)]==='error'&&console[_0x5e450c(0x18b)](a4_0x4b495a['red'](_0x5e450c(0x1c7)+_0x4ed72b[_0x5e450c(0x1eb)]+_0x5e450c(0x227)+_0x4ed72b[_0x5e450c(0x237)]));}for(const _0x41e4cc of _0x4dfc0f['chatInterfaces']){_0x41e4cc[_0x5e450c(0x1fc)]===_0x5e450c(0x237)&&console[_0x5e450c(0x18b)](a4_0x4b495a['red']('\x20\x20Chat\x20Interface\x20\x22'+_0x41e4cc[_0x5e450c(0x1eb)]+_0x5e450c(0x227)+_0x41e4cc[_0x5e450c(0x237)]));}for(const _0x22c285 of _0x4dfc0f['experimentalKnowledgeBases']){_0x22c285[_0x5e450c(0x1fc)]===_0x5e450c(0x237)&&console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x23a)](_0x5e450c(0x1f6)+_0x22c285[_0x5e450c(0x1eb)]+'\x22:\x20'+_0x22c285['error']));}for(const _0x55644b of _0x4dfc0f['experimentalArtifacts']){_0x55644b['action']===_0x5e450c(0x237)&&console[_0x5e450c(0x18b)](a4_0x4b495a[_0x5e450c(0x23a)](_0x5e450c(0x224)+_0x55644b[_0x5e450c(0x1eb)]+_0x5e450c(0x227)+_0x55644b[_0x5e450c(0x237)]));}return 0x1;}console[_0x5e450c(0x18b)]();const _0xc7554b=getLLMProjectUrl(_0x830976,_0x4dfc0f[_0x5e450c(0x230)]);return console['log']('Project:\x20'+a4_0x4b495a[_0x5e450c(0x1d8)](_0xc7554b)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x557cb5(0x1d4);[a4_0x557cb5(0x213)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x557cb5(0x1ab)](_0x59b26d){const _0x3d943f=a4_0x557cb5,{options:_0x48871c,args:_0x23632a,tdx:_0x4e5855}=_0x59b26d;let _0x41ca47=_0x23632a[0x0]||process[_0x3d943f(0x21a)]();const _0x4fc3a8=_0x48871c[_0x3d943f(0x1b9)],_0xdad6f1=_0x48871c[_0x3d943f(0x20a)],_0x4478c2=_0x48871c[_0x3d943f(0x1a6)],_0x1178d3=_0x48871c[_0x3d943f(0x231)],_0xb6e62f=a4_0xfd957b[_0x3d943f(0x203)](_0x41ca47,_0x3d943f(0x21b)),_0x27af17=existsSync(_0xb6e62f);if(_0x27af17){const {data:_0x1f02ce}=await withSpinner(_0x3d943f(0x198)+_0x41ca47+_0x3d943f(0x194),()=>_0x4e5855[_0x3d943f(0x1a1)][_0x3d943f(0x1db)](_0x41ca47,{'dryRun':_0x4fc3a8,'force':_0xdad6f1}));if(_0x4fc3a8)return console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x220)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log']('Would\x20push\x20agent:\x20'+_0x1f02ce[_0x3d943f(0x1f8)]),0x0;if(_0x1f02ce[_0x3d943f(0x1fc)]===_0x3d943f(0x237))return console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x200)+_0x1f02ce[_0x3d943f(0x237)])),0x1;console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x188)](_0x3d943f(0x1bd)+_0x1f02ce[_0x3d943f(0x1fc)]+_0x3d943f(0x21e))),console[_0x3d943f(0x18b)](_0x3d943f(0x1bf)+_0x1f02ce[_0x3d943f(0x1f8)]);if(_0x1f02ce[_0x3d943f(0x1cc)]&&_0x1f02ce[_0x3d943f(0x1da)]){const _0x1c726c=getLLMAgentChatUrl(_0x1178d3,_0x1f02ce[_0x3d943f(0x1da)],_0x1f02ce[_0x3d943f(0x1cc)]);console['log']('Chat:\x20'+a4_0x4b495a[_0x3d943f(0x1d8)](_0x1c726c));}return 0x0;}const _0x154825=_0x48871c[_0x3d943f(0x19e)],_0x5ea31d=resolveProjectFromContext(_0x41ca47,_0x154825);if(_0x5ea31d[_0x3d943f(0x190)])_0x41ca47=_0x5ea31d[_0x3d943f(0x1f4)],_0x5ea31d['source']===_0x3d943f(0x1e4)&&console[_0x3d943f(0x18b)](a4_0x4b495a['dim'](_0x3d943f(0x1c6)+_0x41ca47));else{let _0x7de1e1=_0x3d943f(0x1cb);_0x5ea31d['reason']===_0x3d943f(0x1ed)&&(_0x7de1e1=_0x5ea31d[_0x3d943f(0x1f3)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x5ea31d['llmProject']+_0x3d943f(0x1c8));throw new SDKError(ErrorCode[_0x3d943f(0x1ef)],_0x5ea31d[_0x3d943f(0x238)]===_0x3d943f(0x18c)?_0x5ea31d[_0x3d943f(0x1f3)]:_0x3d943f(0x210)+_0x41ca47,undefined,{'helpText':_0x7de1e1});}const {data:_0x1a547b}=await withSpinner(_0x3d943f(0x1ba),()=>_0x4e5855['llm'][_0x3d943f(0x19f)](_0x41ca47,{'dryRun':!![]})),_0x1c51fc=_0x1a547b[_0x3d943f(0x1ad)]['agents'][_0x3d943f(0x1c4)]>0x0;if(_0x1c51fc){console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x1cf)));for(const _0x17a7cb of _0x1a547b[_0x3d943f(0x19c)]){_0x17a7cb['action']===_0x3d943f(0x237)&&console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x193)+_0x17a7cb[_0x3d943f(0x1f8)]+_0x3d943f(0x227)+_0x17a7cb[_0x3d943f(0x237)]));}return 0x1;}const _0x1a4b64=_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x19c)][_0x3d943f(0x18f)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x18d)][_0x3d943f(0x18f)]+_0x1a547b[_0x3d943f(0x1ad)]['textKnowledgeBases'][_0x3d943f(0x18f)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x19d)][_0x3d943f(0x18f)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1ca)][_0x3d943f(0x18f)]+_0x1a547b['counts'][_0x3d943f(0x1ff)]['created']+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1a0)]['created']+_0x1a547b['counts']['formInterfaces'][_0x3d943f(0x18f)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x20c)]['created'],_0x1ce2ba=_0x1a547b[_0x3d943f(0x1ad)]['agents'][_0x3d943f(0x1ce)]+_0x1a547b['counts']['knowledgeBases'][_0x3d943f(0x1ce)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1cd)][_0x3d943f(0x1ce)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x19d)]['updated']+_0x1a547b['counts']['integrations'][_0x3d943f(0x1ce)]+_0x1a547b['counts'][_0x3d943f(0x1ff)][_0x3d943f(0x1ce)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1a0)]['updated']+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1a8)][_0x3d943f(0x1ce)]+_0x1a547b[_0x3d943f(0x1ad)]['chatInterfaces']['updated'],_0x149654=_0x1a547b['counts'][_0x3d943f(0x19c)]['unchanged']+_0x1a547b[_0x3d943f(0x1ad)]['knowledgeBases'][_0x3d943f(0x23c)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1cd)][_0x3d943f(0x23c)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x19d)]['unchanged']+_0x1a547b[_0x3d943f(0x1ad)]['integrations'][_0x3d943f(0x23c)]+_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1ff)]['unchanged']+_0x1a547b[_0x3d943f(0x1ad)]['experimentalArtifacts'][_0x3d943f(0x23c)]+_0x1a547b['counts'][_0x3d943f(0x1a8)][_0x3d943f(0x23c)]+_0x1a547b['counts'][_0x3d943f(0x20c)][_0x3d943f(0x23c)];console[_0x3d943f(0x18b)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1a547b[_0x3d943f(0x225)]+'\x27:'),console[_0x3d943f(0x18b)]('\x20\x20'+a4_0x4b495a['green']('+\x20'+_0x1a4b64+_0x3d943f(0x18a))+'\x20|\x20'+a4_0x4b495a['yellow']('~\x20'+_0x1ce2ba+'\x20changed')+_0x3d943f(0x1b4)+a4_0x4b495a['dim']('=\x20'+_0x149654+_0x3d943f(0x1a2))),console[_0x3d943f(0x18b)](_0x3d943f(0x1e9)+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)]['agents'])),console[_0x3d943f(0x18b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x18d)])),console[_0x3d943f(0x18b)](_0x3d943f(0x23b)+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1cd)])),console[_0x3d943f(0x18b)](_0x3d943f(0x204)+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x19d)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x1a547b['counts'][_0x3d943f(0x1ca)])),console[_0x3d943f(0x18b)](_0x3d943f(0x1fd)+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)]['formInterfaces'])),console[_0x3d943f(0x18b)](_0x3d943f(0x202)+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)]['chatInterfaces']));const _0x3544a6=_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1ff)][_0x3d943f(0x18f)]>0x0||_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1ff)][_0x3d943f(0x1ce)]>0x0||_0x1a547b[_0x3d943f(0x1ad)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1a0)]['created']>0x0||_0x1a547b[_0x3d943f(0x1ad)]['experimentalArtifacts'][_0x3d943f(0x1ce)]>0x0||_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1a0)]['unchanged']>0x0;_0x3544a6&&(console[_0x3d943f(0x18b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1ff)])),console[_0x3d943f(0x18b)](_0x3d943f(0x233)+formatCountSummary(_0x1a547b[_0x3d943f(0x1ad)][_0x3d943f(0x1a0)])));console[_0x3d943f(0x18b)](_0x3d943f(0x1c1)+a4_0x4b495a[_0x3d943f(0x1d8)](_0x41ca47)),displayDiffs(_0x1a547b['agents'],_0x1a547b[_0x3d943f(0x18d)],_0x1a547b[_0x3d943f(0x1cd)],_0x1a547b[_0x3d943f(0x19d)],_0x1a547b[_0x3d943f(0x1ca)],_0x1a547b['experimentalKnowledgeBases'],_0x1a547b['experimentalArtifacts'],_0x1a547b[_0x3d943f(0x1a8)],_0x1a547b[_0x3d943f(0x20c)]);if(_0x4fc3a8)return console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x220)](_0x3d943f(0x211))),0x0;if(_0x1a4b64===0x0&&_0x1ce2ba===0x0){console[_0x3d943f(0x18b)](a4_0x4b495a['green'](_0x3d943f(0x187)));const _0x365210=getLLMProjectUrl(_0x1178d3,_0x1a547b[_0x3d943f(0x1da)]);return console['log']('Project:\x20'+a4_0x4b495a[_0x3d943f(0x1d8)](_0x365210)),0x0;}if(!_0x4478c2&&!_0xdad6f1){if(!isInteractive())return console[_0x3d943f(0x237)](a4_0x4b495a['red'](_0x3d943f(0x1ac)),_0x3d943f(0x1d6)),console[_0x3d943f(0x237)](a4_0x4b495a['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x12b4ae=await confirmKey(_0x3d943f(0x1fb)+(_0x1a4b64+_0x1ce2ba)+_0x3d943f(0x1e0));if(!_0x12b4ae)return console[_0x3d943f(0x18b)](a4_0x4b495a['yellow'](_0x3d943f(0x1ee)),_0x3d943f(0x1f0)),0x1;}const {data:_0x5bac4c}=await withSpinner(_0x3d943f(0x223),()=>_0x4e5855[_0x3d943f(0x1a1)]['pushProject'](_0x41ca47,{'force':_0xdad6f1})),_0xd457ba=_0x5bac4c['counts'][_0x3d943f(0x19c)][_0x3d943f(0x1c4)]>0x0||_0x5bac4c[_0x3d943f(0x1ad)][_0x3d943f(0x18d)][_0x3d943f(0x1c4)]>0x0||_0x5bac4c[_0x3d943f(0x1ad)]['textKnowledgeBases']['errors']>0x0||_0x5bac4c[_0x3d943f(0x1ad)][_0x3d943f(0x19d)][_0x3d943f(0x1c4)]>0x0||_0x5bac4c[_0x3d943f(0x1ad)][_0x3d943f(0x1a8)][_0x3d943f(0x1c4)]>0x0||_0x5bac4c['counts']['chatInterfaces']['errors']>0x0;if(_0xd457ba){console[_0x3d943f(0x18b)](a4_0x4b495a['yellow']('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x186)));for(const _0x415f5a of _0x5bac4c[_0x3d943f(0x19c)]){_0x415f5a[_0x3d943f(0x1fc)]===_0x3d943f(0x237)&&console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x193)+_0x415f5a[_0x3d943f(0x1f8)]+_0x3d943f(0x227)+_0x415f5a[_0x3d943f(0x237)]));}for(const _0x191142 of _0x5bac4c[_0x3d943f(0x18d)]){_0x191142['action']===_0x3d943f(0x237)&&console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x191142[_0x3d943f(0x1eb)]+_0x3d943f(0x227)+_0x191142[_0x3d943f(0x237)]));}for(const _0x253424 of _0x5bac4c[_0x3d943f(0x1cd)]){_0x253424['action']===_0x3d943f(0x237)&&console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x217)+_0x253424['name']+_0x3d943f(0x227)+_0x253424[_0x3d943f(0x237)]));}for(const _0x44c143 of _0x5bac4c[_0x3d943f(0x19d)]){_0x44c143[_0x3d943f(0x1fc)]===_0x3d943f(0x237)&&console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x22f)+_0x44c143[_0x3d943f(0x1eb)]+'\x22:\x20'+_0x44c143[_0x3d943f(0x237)]));}for(const _0x101d56 of _0x5bac4c[_0x3d943f(0x1ca)]){_0x101d56['action']===_0x3d943f(0x237)&&console[_0x3d943f(0x18b)](a4_0x4b495a[_0x3d943f(0x23a)](_0x3d943f(0x212)+_0x101d56[_0x3d943f(0x1eb)]+_0x3d943f(0x227)+_0x101d56[_0x3d943f(0x237)]));}for(const _0x48fc05 of _0x5bac4c[_0x3d943f(0x1a8)]){_0x48fc05[_0x3d943f(0x1fc)]===_0x3d943f(0x237)&&console['log'](a4_0x4b495a['red'](_0x3d943f(0x1c7)+_0x48fc05[_0x3d943f(0x1eb)]+_0x3d943f(0x227)+_0x48fc05['error']));}for(const _0x364205 of _0x5bac4c['chatInterfaces']){_0x364205[_0x3d943f(0x1fc)]===_0x3d943f(0x237)&&console[_0x3d943f(0x18b)](a4_0x4b495a['red'](_0x3d943f(0x1d5)+_0x364205[_0x3d943f(0x1eb)]+'\x22:\x20'+_0x364205['error']));}return 0x1;}console['log'](a4_0x4b495a[_0x3d943f(0x188)]('\x0a✔\x20Pushed\x20'+(_0x1a4b64+_0x1ce2ba)+'\x20resources\x20to\x20\x27'+_0x5bac4c[_0x3d943f(0x225)]+'\x27'));const _0x10a013=getLLMProjectUrl(_0x1178d3,_0x5bac4c[_0x3d943f(0x1da)]);return console[_0x3d943f(0x18b)](_0x3d943f(0x1f5)+a4_0x4b495a[_0x3d943f(0x1d8)](_0x10a013)),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
|
+
function a5_0x5664(_0xfa869a,_0x2c2839){_0xfa869a=_0xfa869a-0x180;const _0x5de30b=a5_0x5de3();let _0x5664d3=_0x5de30b[_0xfa869a];return _0x5664d3;}const a5_0x50fbf1=a5_0x5664;(function(_0x25971e,_0x14fbcb){const _0x24f7b1=a5_0x5664,_0x5fe8f1=_0x25971e();while(!![]){try{const _0x366f75=parseInt(_0x24f7b1(0x1c8))/0x1+-parseInt(_0x24f7b1(0x1dd))/0x2+parseInt(_0x24f7b1(0x1c2))/0x3+-parseInt(_0x24f7b1(0x194))/0x4+parseInt(_0x24f7b1(0x180))/0x5+parseInt(_0x24f7b1(0x203))/0x6*(-parseInt(_0x24f7b1(0x1e4))/0x7)+parseInt(_0x24f7b1(0x20c))/0x8;if(_0x366f75===_0x14fbcb)break;else _0x5fe8f1['push'](_0x5fe8f1['shift']());}catch(_0x1d1334){_0x5fe8f1['push'](_0x5fe8f1['shift']());}}}(a5_0x5de3,0xa7125));import*as a5_0x5c2c1c from'node:fs';import*as a5_0x5f2df2 from'node:path';import a5_0xc3de63 from'chalk';import{BaseCommand}from'./command.js';function a5_0x5de3(){const _0x3adcb7=['ERROR','start','703322LfQGLw','table','substring','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20\x20Conversation:\x20','Test\x20Summary','red','dim','Errors:\x20\x20\x20','status','Total:\x20\x20\x20\x20','Run\x20\x27tdx\x20agent\x20pull\x20','output','agent:test','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Round\x201/','resolve','Failed\x20Tests:','log','no_context','multiple_agents','2545926owLkMP','testYmlPath','Test\x20Configuration:','source','not\x20found','Test\x20','found','13027AesDJb','agent',':\x20Sending\x20user\x20input...','testName','some','Error:\x20No\x20previous\x20test\x20run\x20found.','add','⚠\x20SKIPPED:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Executing\x20new\x20tests...','✗\x20ERROR:\x20','executeReeval','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','/<agent-name>','jsonl','test.yml','reeval','\x20(new)','conversations','Agent:\x20','map','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','Re-evaluating...','tags','basename','Error\x20writing\x20output\x20file:\x20','Duration:\x20','execute','Either\x20switch\x20to\x20the\x20\x22','includes','1638yIvntf','Failed:\x20\x20\x20','No\x20tests\x20have\x20tags\x20defined.','projectDir','agentDirs','green','length','split','join','13207912RYebNL','agentName','\x20(cached)','\x20-\x20','text','✓\x20PASS:\x20','4494975veIpHX','Passed:\x20\x20\x20','existsSync','conversation_url','Available\x20tests:\x20','isSpinning','\x27\x20to\x20create\x20the\x20folder\x20structure.','name','\x20\x20Agent:\x20','Re-evaluation\x20Summary','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','repeat','...','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Round\x20','Running:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Site:\x20','4381776VpcEPN','toISOString','rounds','json','\x20\x20Evaluating...\x20','Available\x20tags:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','trim','toLowerCase','Running\x20test:\x20','tests','tsv','filter','stop','Running\x20agent\x20tests...','push','Output\x20written\x20to:\x20','dryRun','\x22:\x20','Tests\x20found:\x20','timestamp','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','site','Project\x20path:\x20','FAIL','404','verbose','reason','✗\x20FAIL:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','white','PASS','Round\x20','message','find','cyan','\x20\x20Site:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','...\x20','llm','no_local_folder','llmProject','round','has','projectName','yellow','922437YppPSe','writeFileSync','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','now'];a5_0x5de3=function(){return _0x3adcb7;};return a5_0x5de3();}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{['name']=a5_0x50fbf1(0x1d5);['description']=a5_0x50fbf1(0x190);async[a5_0x50fbf1(0x200)](_0x269e89){const _0x1b1631=a5_0x50fbf1,{options:_0x24ee78,args:_0x421737,tdx:_0xa1b0aa}=_0x269e89,_0x59fcca=_0x421737[0x0]||'.',_0x3d432b=_0x24ee78[_0x1b1631(0x1a5)],_0x3bcebe=_0x24ee78,_0x341d92=_0x3bcebe['eval']===![],_0x4119ec=_0x3bcebe[_0x1b1631(0x1f4)],_0x3df8f9=_0x3bcebe[_0x1b1631(0x187)],_0x28339d=_0x3bcebe[_0x1b1631(0x1fc)],_0x1fb747=_0x24ee78[_0x1b1631(0x1aa)],_0x2cdf55=_0x3bcebe[_0x1b1631(0x1d4)];if(_0x4119ec&&_0x341d92)return console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1ce)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x509953='table';if(_0x3bcebe[_0x1b1631(0x197)])_0x509953=_0x1b1631(0x197);else{if(_0x3bcebe[_0x1b1631(0x1f2)])_0x509953=_0x1b1631(0x1f2);else{if(_0x3bcebe[_0x1b1631(0x19f)])_0x509953=_0x1b1631(0x19f);else{if(_0x3bcebe[_0x1b1631(0x1c9)])_0x509953=_0x1b1631(0x1c9);}}}const _0x550ab7=_0x3bcebe[_0x1b1631(0x1bd)];let _0x46f6ce=_0x59fcca;const _0x58e4b0=a5_0x5c2c1c[_0x1b1631(0x182)](_0x59fcca),_0x1345f6=_0x59fcca==='.';if(!_0x58e4b0||_0x1345f6){const _0x37513f=resolveProjectFromContext(_0x59fcca,_0x550ab7,{'requireFile':_0x1b1631(0x1f3)});if(_0x37513f[_0x1b1631(0x1e3)])_0x46f6ce=_0x37513f[_0x1b1631(0x206)],_0x37513f[_0x1b1631(0x1e0)]==='context'&&console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1cf)]('Using\x20agent:\x20'+_0x46f6ce));else switch(_0x37513f[_0x1b1631(0x1af)]){case _0x1b1631(0x1db):console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1c1)](_0x37513f[_0x1b1631(0x1b5)])),console['log'](),console[_0x1b1631(0x1da)]('Usage:'),console['log']('\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'](_0x1b1631(0x19a)),console[_0x1b1631(0x1da)](),console[_0x1b1631(0x1da)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x1b1631(0x1bc):console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1c1)](_0x37513f[_0x1b1631(0x1b5)])),console[_0x1b1631(0x1da)](),console[_0x1b1631(0x1da)](_0x1b1631(0x1d3)+_0x37513f[_0x1b1631(0x1bd)]+_0x1b1631(0x186));return 0x1;case _0x1b1631(0x1dc):{const _0x2d03fa=a5_0x5f2df2[_0x1b1631(0x1fd)](_0x37513f[_0x1b1631(0x206)]);console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1c1)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x37513f[_0x1b1631(0x1bd)]+'\x22:'));for(const _0x20af04 of _0x37513f[_0x1b1631(0x207)]){console[_0x1b1631(0x1da)]('\x20\x20-\x20'+_0x20af04);}return console[_0x1b1631(0x1da)](),console[_0x1b1631(0x1da)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x2d03fa+_0x1b1631(0x1f1)),0x1;}case'no_tests':console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1c1)](_0x1b1631(0x1c4)+_0x37513f[_0x1b1631(0x1bd)]+'\x22.')),console['log'](a5_0xc3de63[_0x1b1631(0x1cf)](_0x1b1631(0x1ab)+_0x37513f[_0x1b1631(0x206)])),console[_0x1b1631(0x1da)](),console[_0x1b1631(0x1da)](_0x1b1631(0x191));return 0x1;}}const {definition:_0x1e4a81,agentInfo:_0x1c7738}=parseTestFile(_0x46f6ce);let _0x527c0a=_0x1e4a81[_0x1b1631(0x19e)];if(_0x3df8f9){const _0x141d27=_0x3df8f9[_0x1b1631(0x20a)](',')['map'](_0x3a61e5=>_0x3a61e5[_0x1b1631(0x19b)]());_0x527c0a=_0x1e4a81[_0x1b1631(0x19e)]['filter'](_0xc44668=>_0x141d27[_0x1b1631(0x202)](_0xc44668[_0x1b1631(0x187)]));if(_0x527c0a[_0x1b1631(0x209)]===0x0)return console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1c1)]('No\x20tests\x20found\x20matching:\x20'+_0x3df8f9)),console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1cf)](_0x1b1631(0x184)+_0x1e4a81['tests'][_0x1b1631(0x1f8)](_0xd5ff55=>_0xd5ff55[_0x1b1631(0x187)])[_0x1b1631(0x20b)](',\x20'))),0x1;}if(_0x28339d){const _0x3bed0=_0x28339d[_0x1b1631(0x20a)](',')[_0x1b1631(0x1f8)](_0x3d52ad=>_0x3d52ad[_0x1b1631(0x19b)]()[_0x1b1631(0x19c)]());_0x527c0a=_0x527c0a[_0x1b1631(0x1a0)](_0x12861d=>_0x12861d[_0x1b1631(0x1fc)]?.[_0x1b1631(0x1e8)](_0x1de1f1=>_0x3bed0['includes'](_0x1de1f1[_0x1b1631(0x19c)]())));if(_0x527c0a[_0x1b1631(0x209)]===0x0){console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1c1)](_0x1b1631(0x1fa)+_0x28339d));const _0x5b12bb=new Set();return _0x1e4a81[_0x1b1631(0x19e)]['forEach'](_0x1c34b4=>_0x1c34b4[_0x1b1631(0x1fc)]?.['forEach'](_0x20b060=>_0x5b12bb[_0x1b1631(0x1ea)](_0x20b060))),_0x5b12bb['size']>0x0?console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1cf)](_0x1b1631(0x199)+[..._0x5b12bb]['join'](',\x20'))):console['log'](a5_0xc3de63[_0x1b1631(0x1cf)](_0x1b1631(0x205))),0x1;}}if(_0x4119ec)return this[_0x1b1631(0x1ef)](_0x269e89,{'definition':{'tests':_0x527c0a},'agentInfo':_0x1c7738,'outputFormat':_0x509953,'outputFile':_0x2cdf55,'testNames':_0x3df8f9});if(_0x3d432b){console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1b7)](_0x1b1631(0x1df))),console[_0x1b1631(0x1da)](_0x1b1631(0x1b8)+a5_0xc3de63['white'](_0x1fb747)),console[_0x1b1631(0x1da)]('\x20\x20Project:\x20'+a5_0xc3de63[_0x1b1631(0x1b2)](_0x1c7738[_0x1b1631(0x1c0)])),console[_0x1b1631(0x1da)](_0x1b1631(0x188)+a5_0xc3de63[_0x1b1631(0x1b2)](_0x1c7738[_0x1b1631(0x20d)])),console[_0x1b1631(0x1da)](),console[_0x1b1631(0x1da)](_0x1b1631(0x1a7)+a5_0xc3de63[_0x1b1631(0x1b2)](_0x527c0a['length']));for(let _0x4b7327=0x0;_0x4b7327<_0x527c0a[_0x1b1631(0x209)];_0x4b7327++){const _0x4ebdc8=_0x527c0a[_0x4b7327],_0x3547d1=_0x4ebdc8[_0x1b1631(0x196)][_0x1b1631(0x209)]===0x1?_0x1b1631(0x1be):'rounds',_0x1f4c1b=_0x4ebdc8[_0x1b1631(0x1fc)]?.[_0x1b1631(0x209)]?'\x20['+_0x4ebdc8[_0x1b1631(0x1fc)]['join'](',\x20')+']':'';console[_0x1b1631(0x1da)]('\x20\x20'+(_0x4b7327+0x1)+'.\x20'+a5_0xc3de63[_0x1b1631(0x1b2)](_0x4ebdc8[_0x1b1631(0x187)])+'\x20('+_0x4ebdc8[_0x1b1631(0x196)][_0x1b1631(0x209)]+'\x20'+_0x3547d1+')'+a5_0xc3de63['dim'](_0x1f4c1b));}return 0x0;}let _0x11ed14,_0x2f0392;try{_0x11ed14=await _0xa1b0aa[_0x1b1631(0x1bb)]['resolveProjectId'](_0x1c7738[_0x1b1631(0x1c0)]);}catch(_0x5178a3){const _0x2e01c6=_0x5178a3 instanceof Error?_0x5178a3[_0x1b1631(0x1b5)]:String(_0x5178a3);return _0x2e01c6[_0x1b1631(0x202)](_0x1b1631(0x1ad))||_0x2e01c6[_0x1b1631(0x19c)]()[_0x1b1631(0x202)](_0x1b1631(0x1e1))?console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1ce)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1c7738[_0x1b1631(0x1c0)])):console['log'](a5_0xc3de63[_0x1b1631(0x1ce)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x1c7738[_0x1b1631(0x1c0)]+_0x1b1631(0x1a6)+_0x2e01c6)),0x1;}try{_0x2f0392=await _0xa1b0aa['llm']['resolveAgentId'](_0x1c7738['agentName'],_0x11ed14);}catch(_0x124ff1){const _0x5318d0=_0x124ff1 instanceof Error?_0x124ff1[_0x1b1631(0x1b5)]:String(_0x124ff1);return _0x5318d0[_0x1b1631(0x202)]('404')||_0x5318d0[_0x1b1631(0x19c)]()[_0x1b1631(0x202)](_0x1b1631(0x1e1))?console['log'](a5_0xc3de63[_0x1b1631(0x1ce)](_0x1b1631(0x1f0)+_0x1c7738['agentName'])):console['log'](a5_0xc3de63[_0x1b1631(0x1ce)](_0x1b1631(0x1f9)+_0x1c7738[_0x1b1631(0x20d)]+_0x1b1631(0x1a6)+_0x5318d0)),0x1;}let _0x2516ab;if(!_0x341d92)try{_0x2516ab=await setupEvaluatorAgent(_0xa1b0aa[_0x1b1631(0x1bb)],_0x24ee78[_0x1b1631(0x1ae)]);}catch(_0x4980a8){const _0x2a6e25=_0x4980a8 instanceof Error?_0x4980a8['message']:String(_0x4980a8);return console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1ce)](_0x1b1631(0x1d6)+_0x2a6e25)),0x1;}console['log'](a5_0xc3de63[_0x1b1631(0x1b7)](_0x1b1631(0x1a2))),console['log'](_0x1b1631(0x193)+a5_0xc3de63['white'](_0x1fb747)),console[_0x1b1631(0x1da)](_0x1b1631(0x1f7)+a5_0xc3de63['white'](_0x1c7738[_0x1b1631(0x1c0)]+'/'+_0x1c7738[_0x1b1631(0x20d)])),console[_0x1b1631(0x1da)]();const _0xf4fadd=[],_0x490b1d=[],_0x84e7fa=Date['now']();for(let _0x4694fc=0x0;_0x4694fc<_0x527c0a[_0x1b1631(0x209)];_0x4694fc++){const _0x281f7f=_0x527c0a[_0x4694fc];_0x527c0a[_0x1b1631(0x209)]>0x1?console[_0x1b1631(0x1da)](_0x1b1631(0x1e2)+(_0x4694fc+0x1)+'/'+_0x527c0a[_0x1b1631(0x209)]+':\x20'+a5_0xc3de63[_0x1b1631(0x1b2)](_0x281f7f[_0x1b1631(0x187)])):console[_0x1b1631(0x1da)](_0x1b1631(0x19d)+a5_0xc3de63[_0x1b1631(0x1b2)](_0x281f7f[_0x1b1631(0x187)]));const _0x3d13a4=createCommandSpinner(_0x1b1631(0x1d7)+_0x281f7f['rounds'][_0x1b1631(0x209)]+_0x1b1631(0x1e6));_0x3d13a4[_0x1b1631(0x1c7)]();try{const {result:_0x3d9972,conversation:_0x2dbf99}=await runTest(_0xa1b0aa['llm'],_0x281f7f,{'agentId':_0x2f0392,'projectId':_0x11ed14,'site':_0x1fb747,'noEval':_0x341d92,'evaluatorId':_0x2516ab,'onRoundStart':(_0xb1ae96,_0x278b7a)=>{const _0x3efbed=_0x1b1631;_0x3d13a4['text']=_0x3efbed(0x1b4)+(_0xb1ae96+0x1)+'/'+_0x278b7a+_0x3efbed(0x1e6);},'onRoundComplete':(_0x471ce6,_0x3fd348,_0x10241f)=>{const _0x7c3d29=_0x1b1631,_0x4c33b2=formatElapsed(_0x3fd348);_0x10241f?console['log'](_0x7c3d29(0x18e)+(_0x471ce6+0x1)+'/'+_0x281f7f[_0x7c3d29(0x196)][_0x7c3d29(0x209)]+_0x7c3d29(0x1ba)+a5_0xc3de63[_0x7c3d29(0x208)]('✓')+'\x20('+_0x4c33b2+')'):console[_0x7c3d29(0x1da)](_0x7c3d29(0x18e)+(_0x471ce6+0x1)+'/'+_0x281f7f[_0x7c3d29(0x196)][_0x7c3d29(0x209)]+_0x7c3d29(0x1ba)+a5_0xc3de63[_0x7c3d29(0x1ce)]('✗'));},'onEvaluationStart':()=>{const _0x2e9039=_0x1b1631;_0x3d13a4[_0x2e9039(0x210)]='Evaluating\x20response...';},'onEvaluationComplete':_0x16e75c=>{const _0x2d50a3=_0x1b1631,_0x285ea9=formatElapsed(_0x16e75c);console['log'](_0x2d50a3(0x198)+a5_0xc3de63[_0x2d50a3(0x208)]('✓')+'\x20('+_0x285ea9+')');}});_0x3d13a4[_0x1b1631(0x1a1)](),_0xf4fadd[_0x1b1631(0x1a3)](_0x3d9972),_0x490b1d[_0x1b1631(0x1a3)](_0x2dbf99);if(_0x3d9972['status']===_0x1b1631(0x1b3))console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x208)]('✓\x20PASS:\x20'+_0x3d9972[_0x1b1631(0x1af)]));else _0x3d9972[_0x1b1631(0x1d1)]==='FAIL'?console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1ce)](_0x1b1631(0x1b0)+_0x3d9972['reason'])):console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1ce)](_0x1b1631(0x1ee)+_0x3d9972[_0x1b1631(0x1af)]));_0x3d9972[_0x1b1631(0x183)]&&console['log'](a5_0xc3de63[_0x1b1631(0x1cf)]('Conversation\x20URL:\x20'+_0x3d9972['conversation_url'])),console[_0x1b1631(0x1da)]();}catch(_0x508be4){_0x3d13a4[_0x1b1631(0x1a1)]();const _0x486012=_0x508be4 instanceof Error?_0x508be4[_0x1b1631(0x1b5)]:String(_0x508be4);console[_0x1b1631(0x1da)](a5_0xc3de63[_0x1b1631(0x1ce)]('✗\x20ERROR:\x20'+_0x486012)),console[_0x1b1631(0x1da)](),_0xf4fadd[_0x1b1631(0x1a3)]({'name':_0x281f7f['name'],'status':_0x1b1631(0x1c6),'reason':_0x486012,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x2929af=Date[_0x1b1631(0x1c5)]()-_0x84e7fa,_0x2a11c9=_0xf4fadd['filter'](_0x404d6d=>_0x404d6d[_0x1b1631(0x1d1)]===_0x1b1631(0x1b3))[_0x1b1631(0x209)],_0x225b8f=_0xf4fadd[_0x1b1631(0x1a0)](_0x2030cf=>_0x2030cf[_0x1b1631(0x1d1)]==='FAIL')['length'],_0x4b0ed3=_0xf4fadd[_0x1b1631(0x1a0)](_0x42976f=>_0x42976f[_0x1b1631(0x1d1)]===_0x1b1631(0x1c6))[_0x1b1631(0x209)];console['log']('━'['repeat'](0x3c)),console[_0x1b1631(0x1da)](_0x1b1631(0x1cd)),console['log']('━'[_0x1b1631(0x18b)](0x3c)),console[_0x1b1631(0x1da)]('Total:\x20\x20\x20\x20'+_0xf4fadd['length']),console[_0x1b1631(0x1da)]('Passed:\x20\x20\x20'+a5_0xc3de63[_0x1b1631(0x208)](_0x2a11c9)),console[_0x1b1631(0x1da)](_0x1b1631(0x204)+a5_0xc3de63[_0x1b1631(0x1ce)](_0x225b8f));_0x4b0ed3>0x0&&console[_0x1b1631(0x1da)](_0x1b1631(0x1d0)+a5_0xc3de63['red'](_0x4b0ed3));console[_0x1b1631(0x1da)](_0x1b1631(0x1ff)+formatElapsed(_0x2929af)),console['log']('━'[_0x1b1631(0x18b)](0x3c));const _0x1e60f4=_0xf4fadd['filter'](_0x392498=>_0x392498[_0x1b1631(0x1d1)]!=='PASS');if(_0x1e60f4['length']>0x0){console[_0x1b1631(0x1da)](),console['log'](_0x1b1631(0x1d9));for(const _0x5b51b7 of _0x1e60f4){const _0x15a3e8=a5_0xc3de63[_0x1b1631(0x1ce)]('✗'),_0x234a14=_0x5b51b7[_0x1b1631(0x1af)]['length']>0x32?_0x5b51b7[_0x1b1631(0x1af)][_0x1b1631(0x1ca)](0x0,0x32)+_0x1b1631(0x18c):_0x5b51b7[_0x1b1631(0x1af)];console['log']('\x20\x20'+_0x15a3e8+'\x20'+_0x5b51b7['name']+':\x20'+_0x234a14);}}const _0x5bcfd2={'summary':{'total':_0xf4fadd['length'],'passed':_0x2a11c9,'failed':_0x225b8f,'errors':_0x4b0ed3>0x0?_0x4b0ed3:undefined,'duration_ms':_0x2929af},'tests':_0xf4fadd,'agent':{'project':_0x1c7738[_0x1b1631(0x1c0)],'name':_0x1c7738['agentName'],'site':_0x1fb747},'timestamp':new Date(_0x84e7fa)[_0x1b1631(0x195)]()};try{const _0x2061d4=buildCachedTestRun(_0x490b1d,{'site':_0x1fb747,'projectId':_0x11ed14,'projectName':_0x1c7738[_0x1b1631(0x1c0)],'agentId':_0x2f0392,'agentName':_0x1c7738[_0x1b1631(0x20d)],'testYmlPath':a5_0x5f2df2[_0x1b1631(0x1d8)](_0x1c7738[_0x1b1631(0x1de)])});saveLastTestRun(_0x2061d4);}catch{}if(_0x509953!=='table'||_0x2cdf55){const _0x1a1601=formatResults(_0x5bcfd2,_0x509953);if(_0x2cdf55)try{a5_0x5c2c1c['writeFileSync'](_0x2cdf55,_0x1a1601,'utf-8'),console[_0x1b1631(0x1da)](),console['log'](a5_0xc3de63[_0x1b1631(0x1cf)](_0x1b1631(0x1a4)+_0x2cdf55));}catch(_0xfcfc44){return console[_0x1b1631(0x1da)](),console[_0x1b1631(0x1da)](a5_0xc3de63['red']('Error\x20writing\x20output\x20file:\x20'+_0xfcfc44)),0x1;}else console[_0x1b1631(0x1da)](),console['log'](_0x1a1601);}return _0x1e60f4['length']>0x0?0x1:0x0;}async[a5_0x50fbf1(0x1ef)](_0x188082,_0x1c7e10){const _0x30019e=a5_0x50fbf1,{options:_0x21b94b,tdx:_0x138d7a}=_0x188082,{definition:_0x1d340b,agentInfo:_0x2f723f,outputFormat:_0x758099,outputFile:_0x22804a}=_0x1c7e10,_0x4c9bb2=_0x21b94b[_0x30019e(0x1aa)],_0x454046=loadLastTestRun();if(!_0x454046)return console[_0x30019e(0x1da)](a5_0xc3de63['red'](_0x30019e(0x1e9))),console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1cf)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x454046[_0x30019e(0x1e5)][_0x30019e(0x20d)]!==_0x2f723f[_0x30019e(0x20d)])return console['log'](a5_0xc3de63[_0x30019e(0x1ce)](_0x30019e(0x1ec)+_0x454046[_0x30019e(0x1e5)]['agentName']+_0x30019e(0x1b1)+_0x2f723f['agentName']+'\x22.')),console['log'](a5_0xc3de63[_0x30019e(0x1cf)](_0x30019e(0x1a9))),0x1;const _0x5c8313=new Set(_0x454046[_0x30019e(0x1f6)]['map'](_0x1c8458=>_0x1c8458[_0x30019e(0x1e7)])),_0x3f3946=_0x1d340b[_0x30019e(0x19e)]['filter'](_0x22062e=>!_0x5c8313[_0x30019e(0x1bf)](_0x22062e[_0x30019e(0x187)]));if(_0x3f3946[_0x30019e(0x209)]>0x0&&_0x454046[_0x30019e(0x1aa)]!==_0x4c9bb2)return console['log'](a5_0xc3de63[_0x30019e(0x1ce)](_0x30019e(0x1b9))),console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1cf)](_0x30019e(0x1cb)+_0x454046[_0x30019e(0x1aa)]+_0x30019e(0x18d)+_0x4c9bb2+'\x22.')),console['log'](a5_0xc3de63[_0x30019e(0x1cf)](_0x30019e(0x201)+_0x454046[_0x30019e(0x1aa)]+_0x30019e(0x18a))),0x1;const _0x14fc0d=_0x1d340b['tests'][_0x30019e(0x1a0)](_0xf5449a=>_0x5c8313[_0x30019e(0x1bf)](_0xf5449a[_0x30019e(0x187)])),_0xf4077c=_0x3f3946;let _0x1ff169;try{_0x1ff169=await setupEvaluatorAgent(_0x138d7a['llm'],_0x21b94b[_0x30019e(0x1ae)]);}catch(_0x5422d5){const _0x4f30d7=_0x5422d5 instanceof Error?_0x5422d5[_0x30019e(0x1b5)]:String(_0x5422d5);return console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1ce)](_0x30019e(0x1d6)+_0x4f30d7)),0x1;}console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1b7)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x30019e(0x1da)]('Cached\x20run\x20from:\x20'+a5_0xc3de63[_0x30019e(0x1b2)](_0x454046[_0x30019e(0x1a8)])),console[_0x30019e(0x1da)](_0x30019e(0x1f7)+a5_0xc3de63[_0x30019e(0x1b2)](_0x454046[_0x30019e(0x1e5)][_0x30019e(0x1c0)]+'/'+_0x454046['agent'][_0x30019e(0x20d)]));_0xf4077c['length']>0x0&&console[_0x30019e(0x1da)]('New\x20tests\x20to\x20execute:\x20'+a5_0xc3de63[_0x30019e(0x1c1)](_0xf4077c[_0x30019e(0x209)]));console[_0x30019e(0x1da)]();const _0x26ce5d=[],_0x21b7fd=Date[_0x30019e(0x1c5)](),_0x45e5c1=createCommandSpinner(_0x30019e(0x1fb));if(_0x14fc0d[_0x30019e(0x209)]>0x0)try{const _0x572b04=await reevaluateFromCache(_0x138d7a[_0x30019e(0x1bb)],_0x454046,{'tests':_0x14fc0d},{'evaluatorId':_0x1ff169,'onTestStart':(_0x347ef8,_0xf731f,_0x2c05e8)=>{const _0x3f1826=_0x30019e;_0x45e5c1['text']='Re-evaluating\x20'+(_0xf731f+0x1)+'/'+_0x2c05e8+':\x20'+_0x347ef8+'...';if(!_0x45e5c1[_0x3f1826(0x185)])_0x45e5c1[_0x3f1826(0x1c7)]();},'onTestComplete':(_0x24eacd,_0xc18126)=>{const _0x24d83b=_0x30019e;_0x45e5c1[_0x24d83b(0x1a1)]();if(_0xc18126['status']===_0x24d83b(0x1b3))console[_0x24d83b(0x1da)](a5_0xc3de63['green']('✓\x20PASS:\x20'+_0x24eacd)+a5_0xc3de63['dim'](_0x24d83b(0x20e)));else _0xc18126[_0x24d83b(0x1d1)]===_0x24d83b(0x1ac)?console[_0x24d83b(0x1da)](a5_0xc3de63[_0x24d83b(0x1ce)](_0x24d83b(0x1b0)+_0x24eacd+'\x20-\x20'+_0xc18126['reason'])+a5_0xc3de63['dim'](_0x24d83b(0x20e))):console[_0x24d83b(0x1da)](a5_0xc3de63[_0x24d83b(0x1ce)](_0x24d83b(0x1ee)+_0x24eacd+'\x20-\x20'+_0xc18126[_0x24d83b(0x1af)]));_0xc18126['conversation_url']&&console[_0x24d83b(0x1da)](a5_0xc3de63[_0x24d83b(0x1cf)]('\x20\x20Conversation:\x20'+_0xc18126[_0x24d83b(0x183)])),_0x26ce5d['push'](_0xc18126);},'onTestSkipped':(_0x1c8100,_0x134cbd)=>{const _0x37c43e=_0x30019e;_0x45e5c1['stop'](),console[_0x37c43e(0x1da)](a5_0xc3de63[_0x37c43e(0x1c1)](_0x37c43e(0x1eb)+_0x1c8100+_0x37c43e(0x20f)+_0x134cbd));}});for(const _0xd09b20 of _0x572b04){!_0x26ce5d[_0x30019e(0x1b6)](_0x3d46ac=>_0x3d46ac[_0x30019e(0x187)]===_0xd09b20[_0x30019e(0x187)])&&_0x26ce5d[_0x30019e(0x1a3)](_0xd09b20);}}catch(_0x19475a){_0x45e5c1[_0x30019e(0x1a1)]();const _0xf51e7b=_0x19475a instanceof Error?_0x19475a['message']:String(_0x19475a);return console['log'](a5_0xc3de63['red'](_0x30019e(0x192)+_0xf51e7b)),0x1;}_0x45e5c1[_0x30019e(0x1a1)]();if(_0xf4077c['length']>0x0){console[_0x30019e(0x1da)](),console['log'](a5_0xc3de63[_0x30019e(0x1b7)](_0x30019e(0x1ed)));const {projectId:_0x28144d,agentId:_0x276b4d}=_0x454046['agent'];for(const _0x10f247 of _0xf4077c){console['log'](_0x30019e(0x18f)+a5_0xc3de63[_0x30019e(0x1b2)](_0x10f247[_0x30019e(0x187)]));const _0x5d5868=createCommandSpinner(_0x30019e(0x1d7)+_0x10f247[_0x30019e(0x196)]['length']+_0x30019e(0x1e6));_0x5d5868[_0x30019e(0x1c7)]();try{const {result:_0x352946}=await runTest(_0x138d7a[_0x30019e(0x1bb)],_0x10f247,{'agentId':_0x276b4d,'projectId':_0x28144d,'site':_0x454046[_0x30019e(0x1aa)],'noEval':![],'evaluatorId':_0x1ff169,'onRoundStart':(_0x512f0f,_0x2984c6)=>{_0x5d5868['text']='Round\x20'+(_0x512f0f+0x1)+'/'+_0x2984c6+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x442039,_0x1886f7,_0x58ec40)=>{const _0x483cd4=_0x30019e,_0x2c2629=formatElapsed(_0x1886f7);_0x58ec40?console['log'](_0x483cd4(0x18e)+(_0x442039+0x1)+'/'+_0x10f247[_0x483cd4(0x196)][_0x483cd4(0x209)]+'...\x20'+a5_0xc3de63[_0x483cd4(0x208)]('✓')+'\x20('+_0x2c2629+')'):console['log'](_0x483cd4(0x18e)+(_0x442039+0x1)+'/'+_0x10f247[_0x483cd4(0x196)]['length']+_0x483cd4(0x1ba)+a5_0xc3de63[_0x483cd4(0x1ce)]('✗'));},'onEvaluationStart':()=>{const _0x426c36=_0x30019e;_0x5d5868[_0x426c36(0x210)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3eaf63=>{const _0x4634e8=_0x30019e,_0x12e230=formatElapsed(_0x3eaf63);console[_0x4634e8(0x1da)](_0x4634e8(0x198)+a5_0xc3de63[_0x4634e8(0x208)]('✓')+'\x20('+_0x12e230+')');}});_0x5d5868['stop'](),_0x26ce5d['push'](_0x352946);if(_0x352946[_0x30019e(0x1d1)]===_0x30019e(0x1b3))console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x208)](_0x30019e(0x211)+_0x352946[_0x30019e(0x1af)])+a5_0xc3de63[_0x30019e(0x1cf)](_0x30019e(0x1f5)));else _0x352946[_0x30019e(0x1d1)]===_0x30019e(0x1ac)?console['log'](a5_0xc3de63[_0x30019e(0x1ce)]('✗\x20FAIL:\x20'+_0x352946[_0x30019e(0x1af)])+a5_0xc3de63['dim'](_0x30019e(0x1f5))):console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1ce)](_0x30019e(0x1ee)+_0x352946[_0x30019e(0x1af)]));_0x352946[_0x30019e(0x183)]&&console[_0x30019e(0x1da)](a5_0xc3de63['dim'](_0x30019e(0x1cc)+_0x352946[_0x30019e(0x183)]));}catch(_0x125b8f){_0x5d5868[_0x30019e(0x1a1)]();const _0x1280f6=_0x125b8f instanceof Error?_0x125b8f[_0x30019e(0x1b5)]:String(_0x125b8f);console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1ce)](_0x30019e(0x1ee)+_0x1280f6)),_0x26ce5d[_0x30019e(0x1a3)]({'name':_0x10f247[_0x30019e(0x187)],'status':_0x30019e(0x1c6),'reason':_0x1280f6,'timestamp':new Date()[_0x30019e(0x195)](),'duration_ms':0x0});}}}console[_0x30019e(0x1da)]();const _0x6d25b6=Date[_0x30019e(0x1c5)]()-_0x21b7fd,_0x4e00f7=_0x26ce5d[_0x30019e(0x1a0)](_0x1cfd0b=>_0x1cfd0b[_0x30019e(0x1d1)]===_0x30019e(0x1b3))['length'],_0x34105a=_0x26ce5d[_0x30019e(0x1a0)](_0x2283fa=>_0x2283fa[_0x30019e(0x1d1)]===_0x30019e(0x1ac))['length'],_0x33718b=_0x26ce5d[_0x30019e(0x1a0)](_0x4dd875=>_0x4dd875['status']===_0x30019e(0x1c6))[_0x30019e(0x209)];console[_0x30019e(0x1da)]('━'['repeat'](0x3c)),console[_0x30019e(0x1da)](_0x30019e(0x189)),console[_0x30019e(0x1da)]('━'[_0x30019e(0x18b)](0x3c)),console[_0x30019e(0x1da)](_0x30019e(0x1d2)+_0x26ce5d[_0x30019e(0x209)]),console[_0x30019e(0x1da)](_0x30019e(0x181)+a5_0xc3de63[_0x30019e(0x208)](_0x4e00f7)),console[_0x30019e(0x1da)](_0x30019e(0x204)+a5_0xc3de63[_0x30019e(0x1ce)](_0x34105a));_0x33718b>0x0&&console[_0x30019e(0x1da)](_0x30019e(0x1d0)+a5_0xc3de63[_0x30019e(0x1ce)](_0x33718b));console[_0x30019e(0x1da)](_0x30019e(0x1ff)+formatElapsed(_0x6d25b6)),console[_0x30019e(0x1da)]('━'['repeat'](0x3c));const _0x4a5cba={'summary':{'total':_0x26ce5d[_0x30019e(0x209)],'passed':_0x4e00f7,'failed':_0x34105a,'errors':_0x33718b>0x0?_0x33718b:undefined,'duration_ms':_0x6d25b6},'tests':_0x26ce5d,'agent':{'project':_0x2f723f[_0x30019e(0x1c0)],'name':_0x2f723f['agentName'],'site':_0x4c9bb2},'timestamp':new Date(_0x21b7fd)[_0x30019e(0x195)]()};if(_0x758099!==_0x30019e(0x1c9)||_0x22804a){const _0x10558a=formatResults(_0x4a5cba,_0x758099);if(_0x22804a)try{a5_0x5c2c1c[_0x30019e(0x1c3)](_0x22804a,_0x10558a,'utf-8'),console[_0x30019e(0x1da)](),console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1cf)](_0x30019e(0x1a4)+_0x22804a));}catch(_0x3b1561){return console['log'](),console[_0x30019e(0x1da)](a5_0xc3de63[_0x30019e(0x1ce)](_0x30019e(0x1fe)+_0x3b1561)),0x1;}else console[_0x30019e(0x1da)](),console[_0x30019e(0x1da)](_0x10558a);}const _0x17cd5d=_0x26ce5d['filter'](_0x36acda=>_0x36acda[_0x30019e(0x1d1)]!==_0x30019e(0x1b3));return _0x17cd5d[_0x30019e(0x209)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x5d90ed=a6_0x1050;(function(_0x4b3788,_0x4ca4f6){const _0x3d39ab=a6_0x1050,_0xcece6b=_0x4b3788();while(!![]){try{const _0x11f2ee=parseInt(_0x3d39ab(0x153))/0x1*(-parseInt(_0x3d39ab(0x156))/0x2)+-parseInt(_0x3d39ab(0x14f))/0x3+-parseInt(_0x3d39ab(0x146))/0x4*(parseInt(_0x3d39ab(0x161))/0x5)+parseInt(_0x3d39ab(0x144))/0x6+parseInt(_0x3d39ab(0x15f))/0x7+-parseInt(_0x3d39ab(0x158))/0x8+parseInt(_0x3d39ab(0x12f))/0x9;if(_0x11f2ee===_0x4ca4f6)break;else _0xcece6b['push'](_0xcece6b['shift']());}catch(_0x58f649){_0xcece6b['push'](_0xcece6b['shift']());}}}(a6_0xee15,0xe6d4d));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x1050(_0x3a38d1,_0x4fac1d){_0x3a38d1=_0x3a38d1-0x12c;const _0xee159c=a6_0xee15();let _0x1050d1=_0xee159c[_0x3a38d1];return _0x1050d1;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0xee15(){const _0x11bba2=['proxy-authorization','x-auth-token','error','GET','data','substring','Error:\x20','keys','.\x20Valid\x20methods:\x20','39096324PVdOYh','trino','toLowerCase','indexOf','site','entries','api','headers','execute','x-trino-user','set-cookie','cdp','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PATCH','log','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','type','validate','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','stack','7253892JxtAcy','cookie','104bbRRgB','llm','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','toUpperCase','name','POST','request','startsWith','trim','2446770HtWoEC','PUT','file','Results\x20saved\x20to\x20','741683taLIBv','us01','Invalid\x20HTTP\x20method:\x20','4JEKIFH','DELETE','8921968TZzLQt','header','color','llm-proxy','join','status','verbose','4039609OWmwVN','body','340465QxbThi','x-xsrf-token','isArray','\x22.\x20','cas','length','method','includes','Invalid\x20header\x20format:\x20\x22','message'];a6_0xee15=function(){return _0x11bba2;};return a6_0xee15();}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x5d90ed(0x16b),a6_0x5d90ed(0x145),a6_0x5d90ed(0x139),'set-cookie2',a6_0x5d90ed(0x162),a6_0x5d90ed(0x16c),a6_0x5d90ed(0x138)]);function isSensitiveHeader(_0x7cffee){const _0x3ccf87=a6_0x5d90ed;return SENSITIVE_HEADERS['has'](_0x7cffee[_0x3ccf87(0x131)]());}function parseHeader(_0x236200){const _0x17be8d=a6_0x5d90ed,_0x181447=_0x236200[_0x17be8d(0x132)](':');if(_0x181447===-0x1)throw new Error(_0x17be8d(0x169)+_0x236200+_0x17be8d(0x164)+_0x17be8d(0x13b));const _0x4f9ee4=_0x236200[_0x17be8d(0x170)](0x0,_0x181447)[_0x17be8d(0x14e)](),_0x31cd68=_0x236200[_0x17be8d(0x170)](_0x181447+0x1)[_0x17be8d(0x14e)]();if(!_0x4f9ee4)throw new Error(_0x17be8d(0x13e)+_0x236200+'\x22');return[_0x4f9ee4,_0x31cd68];}export class ApiCommand extends BaseCommand{[a6_0x5d90ed(0x14a)]=a6_0x5d90ed(0x135);['description']=a6_0x5d90ed(0x141);[a6_0x5d90ed(0x140)](_0xb907c9){const _0x4f3fec=a6_0x5d90ed,{args:_0x389528,options:_0x2e7251}=_0xb907c9,_0x480aa1=_0x2e7251;if(_0x389528[_0x4f3fec(0x166)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x21c5f5=_0x389528[0x0];if(!_0x21c5f5[_0x4f3fec(0x14d)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x21c5f5;const _0x35b2ca=_0x480aa1[_0x4f3fec(0x16f)],_0x40dede=_0x480aa1['file'];if(_0x35b2ca&&_0x40dede)return _0x4f3fec(0x148);const _0x100bbe=_0x480aa1[_0x4f3fec(0x167)]||_0x4f3fec(0x16e),_0x1eb394=['GET',_0x4f3fec(0x14b),_0x4f3fec(0x150),_0x4f3fec(0x157),_0x4f3fec(0x13c)];if(!_0x1eb394[_0x4f3fec(0x168)](_0x100bbe['toUpperCase']()))return _0x4f3fec(0x155)+_0x100bbe+_0x4f3fec(0x12e)+_0x1eb394['join'](',\x20');const _0xf5e2aa=_0x480aa1['type']||'td',_0x2b7dd1=['td',_0x4f3fec(0x13a),'workflow',_0x4f3fec(0x130),_0x4f3fec(0x147),_0x4f3fec(0x15b),_0x4f3fec(0x165)];if(!_0x2b7dd1[_0x4f3fec(0x168)](_0xf5e2aa))return'Invalid\x20API\x20type:\x20'+_0xf5e2aa+'.\x20Valid\x20types:\x20'+_0x2b7dd1[_0x4f3fec(0x15c)](',\x20');return undefined;}async[a6_0x5d90ed(0x137)](_0x497923){const _0x51be6d=a6_0x5d90ed,{options:_0x405cfa,args:_0x5cd7b0,tdx:_0x21666b}=_0x497923,_0x532f34=_0x405cfa,_0x35c280=_0x5cd7b0[0x0],_0x311480=(_0x532f34[_0x51be6d(0x167)]||_0x51be6d(0x16e))[_0x51be6d(0x149)](),_0x4a20e5=_0x532f34['data'],_0x53dbd6=_0x532f34[_0x51be6d(0x151)],_0x3692b1=_0x532f34[_0x51be6d(0x159)],_0xb44089=_0x532f34[_0x51be6d(0x13f)]||'td';try{const _0x4d1c03={};if(_0x3692b1){const _0x1c7938=Array[_0x51be6d(0x163)](_0x3692b1)?_0x3692b1:[_0x3692b1];for(const _0x309a6c of _0x1c7938){const [_0x36e8cf,_0x2403e9]=parseHeader(_0x309a6c);_0x4d1c03[_0x36e8cf]=_0x2403e9;}}let _0x3a5b7f;if(_0x4a20e5)_0x3a5b7f=_0x4a20e5;else{if(_0x53dbd6)try{_0x3a5b7f=RawAPI['readBodyFromFile'](_0x53dbd6);}catch(_0x5dc1e9){return console['error'](_0x51be6d(0x12c)+(_0x5dc1e9 instanceof Error?_0x5dc1e9[_0x51be6d(0x16a)]:String(_0x5dc1e9))),0x1;}}const _0x34cf89={'method':_0x311480,'apiType':_0xb44089,'includeHeaders':_0x405cfa['verbose']};_0x3a5b7f&&(_0x34cf89[_0x51be6d(0x160)]=_0x3a5b7f);Object[_0x51be6d(0x12d)](_0x4d1c03)[_0x51be6d(0x166)]>0x0&&(_0x34cf89[_0x51be6d(0x136)]=_0x4d1c03);if(_0x405cfa[_0x51be6d(0x15e)]){const _0x559f61=resolveSite(_0x405cfa[_0x51be6d(0x133)]??_0x51be6d(0x154)),_0x331bd3=getEndpoint(_0x559f61,_0xb44089),_0x4a992e=''+_0x331bd3+_0x35c280;console[_0x51be6d(0x16d)]('>\x20'+_0x311480+'\x20'+_0x4a992e);const _0x1a7b88=getAuthHeaders(_0x559f61),_0x203a37={..._0x1a7b88,..._0x4d1c03};for(const [_0x13504a,_0x105633]of Object[_0x51be6d(0x134)](_0x203a37)){!isSensitiveHeader(_0x13504a)&&console[_0x51be6d(0x16d)]('>\x20'+_0x13504a+':\x20'+_0x105633);}_0x3a5b7f&&console[_0x51be6d(0x16d)]('>'),console[_0x51be6d(0x16d)]('');}const _0x41e92c=await _0x21666b[_0x51be6d(0x135)][_0x51be6d(0x14c)](_0x35c280,_0x34cf89);if(_0x405cfa[_0x51be6d(0x15e)]&&_0x41e92c[_0x51be6d(0x136)]){console['error']('<\x20HTTP/1.1\x20'+_0x41e92c[_0x51be6d(0x15d)]);for(const [_0x9892ad,_0x221aeb]of Object[_0x51be6d(0x134)](_0x41e92c[_0x51be6d(0x136)])){!isSensitiveHeader(_0x9892ad)&&console[_0x51be6d(0x16d)]('<\x20'+_0x9892ad+':\x20'+_0x221aeb);}console[_0x51be6d(0x16d)]('');}const _0x2a4765=Boolean(_0x405cfa[_0x51be6d(0x142)]),_0x4785fb={'color':_0x405cfa['color'],'noColor':_0x405cfa['noColor']||_0x2a4765&&!_0x405cfa[_0x51be6d(0x15a)]},_0x3613b3=colorizeJSON(_0x41e92c['data'],_0x4785fb);return _0x405cfa['output']?(writeFileSync(_0x405cfa[_0x51be6d(0x142)],_0x3613b3),console[_0x51be6d(0x16d)](_0x51be6d(0x152)+_0x405cfa[_0x51be6d(0x142)])):console[_0x51be6d(0x13d)](_0x3613b3),0x0;}catch(_0x1e9db7){return _0x1e9db7 instanceof Error?(console[_0x51be6d(0x16d)]('Error:\x20'+_0x1e9db7[_0x51be6d(0x16a)]),_0x405cfa[_0x51be6d(0x15e)]&&_0x1e9db7['stack']&&console[_0x51be6d(0x16d)]('\x0aStack\x20trace:\x0a'+_0x1e9db7[_0x51be6d(0x143)])):console['error'](_0x51be6d(0x12c)+String(_0x1e9db7)),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_0x36d531=a7_0x5d8c;function a7_0x5d8c(_0x59ca78,_0x2ac4a2){_0x59ca78=_0x59ca78-0xf1;const _0x120694=a7_0x1206();let _0x5d8c61=_0x120694[_0x59ca78];return _0x5d8c61;}(function(_0x478902,_0x1d5c4e){const _0x55e0bb=a7_0x5d8c,_0x396100=_0x478902();while(!![]){try{const _0x21a468=parseInt(_0x55e0bb(0x14a))/0x1*(-parseInt(_0x55e0bb(0x119))/0x2)+-parseInt(_0x55e0bb(0x13b))/0x3*(-parseInt(_0x55e0bb(0x138))/0x4)+-parseInt(_0x55e0bb(0x151))/0x5*(parseInt(_0x55e0bb(0x14e))/0x6)+-parseInt(_0x55e0bb(0xf6))/0x7*(parseInt(_0x55e0bb(0x102))/0x8)+-parseInt(_0x55e0bb(0x104))/0x9*(-parseInt(_0x55e0bb(0x113))/0xa)+parseInt(_0x55e0bb(0x101))/0xb*(-parseInt(_0x55e0bb(0x107))/0xc)+parseInt(_0x55e0bb(0x110))/0xd*(parseInt(_0x55e0bb(0x150))/0xe);if(_0x21a468===_0x1d5c4e)break;else _0x396100['push'](_0x396100['shift']());}catch(_0x1fcce5){_0x396100['push'](_0x396100['shift']());}}}(a7_0x1206,0x6dd1e));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';function a7_0x1206(){const _0x44b1e8=['Validating\x20OAuth\x20tokens...','auth:token','method','Sign\x20in\x20with\x20browser\x20(recommended)','User:\x20','password','/users/initiate_sso\x20(account:\x20','Read\x20credential\x20from\x20','Validating\x20API\x20key...','account_id','You\x20can\x20find\x20your\x20API\x20key\x20at:','status','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20user_id:','join','message','first_name','description','OAuth\x20tokens','jobs','ERROR','select','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x0aSetup\x20cancelled','auth:clear','site','\x20for\x20profile:\x20','3912LdeeCh','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20(profile:\x20','507yafsCU','accountName','No\x20credentials\x20found\x20in\x20keychain','warn','✓\x20Profile\x20\x27','Remove\x20API\x20key\x20from\x20system\x20keychain','logLevel','API\x20key','Enter\x20your\x20TD\x20API\x20key:','email','getUserInfo','\x20\x20tdx','create','✗\x20Validation\x20failed:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','869xOslfd','\x20and\x20','log','Choose\x20how\x20to\x20sign\x20in:','1074ilCFKw','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','12362616lLMSlh','8425PqmQvV','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','last_name','profile','Opening\x20browser\x20for\x20authentication...','access_token','all','red','Print\x20the\x20current\x20OAuth\x20access\x20token','tdx:\x20auth\x20clear','yellow','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','\x20\x20(','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','1708mWreku','/app/mp/ak','filter','\x20(site:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Read\x20credential\x20from\x20keychain','us01','N/A','green','apikey','execute','4961hrHiPq','21632wnffUt','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','99FRmUZD','auth','Setup\x20cancelled','21324xLcpXq','\x20--profile\x20','\x27\x20registered','bold','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','System\x20keychain\x20is\x20not\x20available','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','name','26UDbmYd','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Setting\x20up\x20authentication\x20for\x20site:\x20','344970ZEEkla','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','error','oauth','dim','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','226FzMzKn','trim','✓\x20Authentication\x20successful\x0a','Credential\x20type:\x20OAuth'];a7_0x1206=function(){return _0x44b1e8;};return a7_0x1206();}import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4a1d3b 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_0x47fe8f from'chalk';export async function runOAuthLoginFlow(_0x152777,_0x47fef7,_0x3231bc,_0xf07a81){const _0x28a4ad=a7_0x5d8c,_0x5ed5a7=await isKeychainAvailable();if(!_0x5ed5a7)throw new Error(_0x28a4ad(0x14f)+_0x28a4ad(0x118));let _0x382955=_0xf07a81?.[_0x28a4ad(0x13c)];if(!_0x382955){const _0x13f39c=await a7_0x4a1d3b({'type':'text','name':_0x28a4ad(0x13c),'message':_0x28a4ad(0x111)});if(_0x13f39c[_0x28a4ad(0x13c)]===undefined)throw new Error(_0x28a4ad(0x106));_0x382955=_0x13f39c[_0x28a4ad(0x13c)][_0x28a4ad(0x11a)]()||undefined;}const _0x3be35c=getConsoleUrl(_0x152777);console[_0x28a4ad(0x14c)](_0x28a4ad(0x155));_0x382955?console[_0x28a4ad(0x14c)]('\x20\x20'+_0x3be35c+_0x28a4ad(0x123)+_0x382955+')'):console[_0x28a4ad(0x14c)]('\x20\x20'+_0x3be35c+'/oauth/authorize');console[_0x28a4ad(0x14c)](_0x28a4ad(0x10e));const _0x48c57f=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x3db5d8=await startOAuthFlow(_0x152777,{'accountName':_0x382955,'proxy':_0x48c57f});console[_0x28a4ad(0x14c)](_0x28a4ad(0x11d));const _0x34b9f7=TDX[_0x28a4ad(0x147)]({'site':_0x152777,'accessToken':_0x3db5d8[_0x28a4ad(0x156)],'logLevel':_0x3231bc??LogLevel[_0x28a4ad(0x131)]}),_0x823e84=await _0x34b9f7[_0x28a4ad(0x130)][_0x28a4ad(0x145)]();console[_0x28a4ad(0x14c)](a7_0x47fe8f[_0x28a4ad(0xfe)]('✓\x20Signed\x20in\x20successfully')),console[_0x28a4ad(0x14c)]('\x20\x20'+a7_0x47fe8f['cyan'](_0x152777+':'+_0x823e84[_0x28a4ad(0x126)])+_0x28a4ad(0x12a)+_0x823e84['id']+_0x28a4ad(0xf4)+_0x823e84['email']+')');!_0x382955&&(console[_0x28a4ad(0x14c)](a7_0x47fe8f[_0x28a4ad(0x117)](_0x28a4ad(0x133))),console[_0x28a4ad(0x14c)](a7_0x47fe8f[_0x28a4ad(0x117)](_0x28a4ad(0xf3))),console[_0x28a4ad(0x14c)](a7_0x47fe8f['dim'](_0x28a4ad(0x114))));await saveOAuthTokens(_0x3db5d8,_0x47fef7),console[_0x28a4ad(0x14c)](_0x28a4ad(0x10b)+(_0x47fef7?'\x20(profile:\x20'+_0x47fef7+')':''));if(_0x47fef7){const _0xf13538={'site':_0x152777};saveProfileToUserConfig(_0x47fef7,_0xf13538),console[_0x28a4ad(0x14c)](_0x28a4ad(0x13f)+_0x47fef7+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x152777),console[_0x28a4ad(0x14c)](_0x28a4ad(0x129)+_0x152777);const _0x45c8a8=_0x47fef7?_0x28a4ad(0x108)+_0x47fef7:'';console[_0x28a4ad(0x14c)](),console[_0x28a4ad(0x14c)](_0x28a4ad(0xf5)),console[_0x28a4ad(0x14c)](_0x28a4ad(0x146)+_0x45c8a8+_0x28a4ad(0x149)),console[_0x28a4ad(0x14c)](_0x28a4ad(0x146)+_0x45c8a8+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x385d84=a7_0x5d8c,_0x14ab5d=await a7_0x4a1d3b({'type':_0x385d84(0x132),'name':_0x385d84(0x11f),'message':_0x385d84(0x14d),'choices':[{'title':_0x385d84(0x120),'description':_0x385d84(0x103),'value':_0x385d84(0x116)},{'title':'Use\x20an\x20API\x20key','description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x385d84(0xff)}]});return _0x14ab5d[_0x385d84(0x11f)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x36d531(0x10f)]='auth:setup';['description']='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x1c1c5d){const _0x57aeb8=a7_0x36d531,{options:_0x1ae444}=_0x1c1c5d,_0x37b361=_0x1ae444['profile'];console[_0x57aeb8(0x14c)](a7_0x47fe8f['bold']('tdx:\x20auth\x20setup'));const _0x41955d=_0x1ae444[_0x57aeb8(0x136)]||_0x57aeb8(0xfc),_0x219f75=await promptSiteSelection(_0x41955d,_0x37b361,_0x57aeb8(0x106));if(!_0x219f75)return 0x1;const _0x5b8c99=resolveSite(_0x219f75),_0x325aa8=await promptAuthMethod();if(!_0x325aa8)return console[_0x57aeb8(0x14c)](_0x57aeb8(0x134)),0x1;if(_0x325aa8===_0x57aeb8(0x116)){const {accountName:_0x22e932}=_0x1ae444;return await runOAuthLoginFlow(_0x5b8c99,_0x37b361,_0x1ae444[_0x57aeb8(0x141)]??LogLevel['ERROR'],{'accountName':_0x22e932}),0x0;}console[_0x57aeb8(0x14c)](_0x57aeb8(0x112)+_0x5b8c99),console[_0x57aeb8(0x14c)](_0x57aeb8(0x127)),console[_0x57aeb8(0x14c)]('\x20\x20'+getConsoleUrl(_0x5b8c99,_0x57aeb8(0xf7)));const _0x9700c=await a7_0x4a1d3b({'type':_0x57aeb8(0x122),'name':'apiKey','message':_0x57aeb8(0x143),'validate':_0x3f6ee6=>{if(!_0x3f6ee6||!_0x3f6ee6['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x9700c['apiKey'])return console['log'](_0x57aeb8(0x134)),0x1;const _0x236a5a=_0x9700c['apiKey'];console['log'](_0x57aeb8(0x125));try{const _0x4cbb57=TDX[_0x57aeb8(0x147)]({'site':_0x5b8c99,'apiKey':_0x236a5a[_0x57aeb8(0x11a)](),'logLevel':_0x1ae444[_0x57aeb8(0x141)]??LogLevel['ERROR']}),_0x2655b4=await _0x4cbb57[_0x57aeb8(0x130)][_0x57aeb8(0x145)]();console[_0x57aeb8(0x14c)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x2655b4[_0x57aeb8(0x144)]+')');const _0x29ac89=await isKeychainAvailable();_0x29ac89?(await saveAPIKeyAsync(_0x236a5a[_0x57aeb8(0x11a)](),_0x5b8c99,_0x37b361),console[_0x57aeb8(0x14c)](_0x57aeb8(0xfa)+(_0x37b361?'\x20(profile:\x20'+_0x37b361+')':''))):(console[_0x57aeb8(0x13e)](a7_0x47fe8f[_0x57aeb8(0xf2)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x57aeb8(0x13e)](a7_0x47fe8f[_0x57aeb8(0xf2)](_0x57aeb8(0x10c))));if(_0x37b361){const _0xf41ed5={'site':_0x5b8c99};saveProfileToUserConfig(_0x37b361,_0xf41ed5),console[_0x57aeb8(0x14c)](_0x57aeb8(0x13f)+_0x37b361+_0x57aeb8(0x109));}else saveDefaultSiteToUserConfig(_0x5b8c99),console['log'](_0x57aeb8(0x129)+_0x5b8c99);const _0x3ac1f3=_0x37b361?_0x57aeb8(0x108)+_0x37b361:'';return console['log'](),console['log'](_0x57aeb8(0xf5)),console[_0x57aeb8(0x14c)](_0x57aeb8(0x146)+_0x3ac1f3+_0x57aeb8(0x149)),console['log'](_0x57aeb8(0x146)+_0x3ac1f3+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x394879){if(_0x394879 instanceof HTTPClientError&&_0x394879[_0x57aeb8(0x128)]===0x191)return printAuthError(_0x394879),0x1;return console[_0x57aeb8(0x115)](a7_0x47fe8f['red'](_0x57aeb8(0x148)+(_0x394879 instanceof Error?_0x394879[_0x57aeb8(0x12c)]:String(_0x394879)))),console[_0x57aeb8(0x115)](_0x57aeb8(0x152)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x36d531(0x10f)]=a7_0x36d531(0x105);['description']=a7_0x36d531(0x139);async['execute'](_0x1dd438){const _0x5c1e6a=a7_0x36d531,{options:_0x4ca009,tdx:_0x431243}=_0x1dd438,_0x74df72=_0x4ca009[_0x5c1e6a(0x136)],_0x72360f=_0x4ca009[_0x5c1e6a(0x154)],_0x5df7bf=_0x72360f?_0x72360f:_0x5c1e6a(0xfd);console['log']('tdx\x20profile:\x20'+_0x5df7bf+_0x5c1e6a(0xf9)+_0x74df72+')');const _0x457b7b=await getOAuthTokens(_0x72360f);if(_0x457b7b)console[_0x5c1e6a(0x14c)](_0x5c1e6a(0x11c)),console[_0x5c1e6a(0x14c)](_0x5c1e6a(0xfb)+(_0x72360f?_0x5c1e6a(0x13a)+_0x72360f+')':''));else{const _0x2edc5e=await resolveAPIKeyAsync(_0x74df72,_0x72360f);if(_0x2edc5e){const {source:_0x376267,isDeprecated:_0x2c03a0}=_0x2edc5e,_0x22020e=_0x5c1e6a(0x124)+_0x376267;console[_0x5c1e6a(0x14c)](_0x2c03a0?a7_0x47fe8f[_0x5c1e6a(0xf2)](_0x22020e):_0x22020e);}else console[_0x5c1e6a(0x14c)](a7_0x47fe8f[_0x5c1e6a(0xf2)]('No\x20credential\x20found'));}try{const _0x27c8b4=await _0x431243[_0x5c1e6a(0x130)][_0x5c1e6a(0x145)]();return console[_0x5c1e6a(0x14c)](a7_0x47fe8f[_0x5c1e6a(0xfe)](_0x5c1e6a(0x11b))),console['log'](_0x5c1e6a(0x121)+_0x27c8b4[_0x5c1e6a(0x144)]),(_0x27c8b4[_0x5c1e6a(0x12d)]||_0x27c8b4[_0x5c1e6a(0x153)])&&console['log']('Name:\x20'+[_0x27c8b4[_0x5c1e6a(0x12d)],_0x27c8b4['last_name']][_0x5c1e6a(0xf8)](Boolean)[_0x5c1e6a(0x12b)]('\x20')),0x0;}catch(_0x3d67bf){return _0x3d67bf instanceof HTTPClientError&&_0x3d67bf[_0x5c1e6a(0x128)]===0x191?printAuthError(_0x3d67bf,!![],_0x72360f):console[_0x5c1e6a(0x115)](a7_0x47fe8f['red'](_0x5c1e6a(0x148)+(_0x3d67bf instanceof Error?_0x3d67bf[_0x5c1e6a(0x12c)]:String(_0x3d67bf)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x36d531(0x10f)]=a7_0x36d531(0x11e);[a7_0x36d531(0x12e)]=a7_0x36d531(0x159);async['execute'](_0x2233dc){const _0x6065f4=a7_0x36d531,{options:_0x2380bd}=_0x2233dc,_0x11140b=await resolveOAuthAccessToken({'site':resolveSite(_0x2380bd[_0x6065f4(0x136)]||'us01'),'profile':_0x2380bd[_0x6065f4(0x154)],'proxy':loadGlobalProxy()});return console[_0x6065f4(0x14c)](_0x11140b),0x0;}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x36d531(0x135);['description']=a7_0x36d531(0x140);async[a7_0x36d531(0x100)](_0x2e8a12){const _0x5982ea=a7_0x36d531,{options:_0x1e686e}=_0x2e8a12,_0x1c52e2=_0x1e686e[_0x5982ea(0x154)];console[_0x5982ea(0x14c)](a7_0x47fe8f[_0x5982ea(0x10a)](_0x5982ea(0xf1)));const _0x3c0120=await isKeychainAvailable();if(!_0x3c0120)return console[_0x5982ea(0x115)](a7_0x47fe8f[_0x5982ea(0x158)](_0x5982ea(0x10d))),0x1;const [_0x2e547a,_0x40e6cc]=await Promise[_0x5982ea(0x157)]([deleteKeychainAPIKey(_0x1c52e2),deleteOAuthTokens(_0x1c52e2)]);if(_0x2e547a||_0x40e6cc){clearCredentialCache();const _0x135808=[_0x2e547a&&_0x5982ea(0x142),_0x40e6cc&&_0x5982ea(0x12f)][_0x5982ea(0xf8)](Boolean)[_0x5982ea(0x12b)](_0x5982ea(0x14b));return console[_0x5982ea(0x14c)]('✓\x20'+_0x135808+'\x20removed\x20from\x20keychain'+(_0x1c52e2?_0x5982ea(0x13a)+_0x1c52e2+')':'')),0x0;}else return console[_0x5982ea(0x14c)](_0x5982ea(0x13d)+(_0x1c52e2?_0x5982ea(0x137)+_0x1c52e2:'')),0x1;}}
|