@treasuredata/tdx 2026.8.1 → 2026.8.3
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.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/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.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/auth-token.js +1 -1
- package/dist/sdk/cas/cas-api-client.d.ts +9 -3
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-api-client.js.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.d.ts +10 -0
- package/dist/sdk/cas/index.d.ts.map +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/index.js.map +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/types.d.ts +2 -0
- package/dist/sdk/cas/types.d.ts.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/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.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cas.d.ts +4 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x1d2fe4=a3_0x210d;(function(_0x523f00,_0x4fa615){const _0x57684d=a3_0x210d,_0x50d4ab=_0x523f00();while(!![]){try{const _0x3121a9=parseInt(_0x57684d(0xde))/0x1*(-parseInt(_0x57684d(0xe6))/0x2)+parseInt(_0x57684d(0xdf))/0x3+-parseInt(_0x57684d(0xf4))/0x4*(-parseInt(_0x57684d(0xe2))/0x5)+parseInt(_0x57684d(0xd8))/0x6+parseInt(_0x57684d(0xf0))/0x7*(parseInt(_0x57684d(0xe5))/0x8)+parseInt(_0x57684d(0xe7))/0x9+-parseInt(_0x57684d(0xd4))/0xa*(parseInt(_0x57684d(0xef))/0xb);if(_0x3121a9===_0x4fa615)break;else _0x50d4ab['push'](_0x50d4ab['shift']());}catch(_0x465308){_0x50d4ab['push'](_0x50d4ab['shift']());}}}(a3_0x45b5,0x8f894));function a3_0x45b5(){const _0xf7a49f=['Site:\x20','listActivations','segment','Error:\x20Segment\x20name\x20is\x20required','216077tjXkjT','3202989yToDtb','verbose','error','779865obEPuO','Resolved\x20parent\x20ID:\x20','name','8YcYUas','2MCxnGi','10343178eOZhPt','Parent\x20name:\x20','Child\x20name:\x20','\x27...','Resolved\x20child\x20ID:\x20','List\x20activations\x20for\x20a\x20segment','message','\x20activation','22nydLED','5073509MsPYmK','activations','Error:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','12RRUGOq','data','length','resolveParentId','resolveSegmentId','Resolving\x20parent\x20segment\x20\x27','site','17204520puhiWK','\x20\x20Cause:\x20','cause','Listing\x20activations\x20for\x20segment\x20\x27','5011764TMdhGx','Usage:\x20tdx\x20activations\x20<parent_name/child_name>'];a3_0x45b5=function(){return _0xf7a49f;};return a3_0x45b5();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x210d(_0x2fb7d4,_0x29c3c5){_0x2fb7d4=_0x2fb7d4-0xd4;const _0x45b51=a3_0x45b5();let _0x210d55=_0x45b51[_0x2fb7d4];return _0x210d55;}export class ActivationsCommand extends BaseCommand{[a3_0x1d2fe4(0xe4)]=a3_0x1d2fe4(0xf1);['description']=a3_0x1d2fe4(0xec);async['execute'](_0x444cff){const _0x3d35f8=a3_0x1d2fe4,{options:_0x1d2d12,args:_0x5ea824,tdx:_0xc6c95}=_0x444cff;if(_0x5ea824[_0x3d35f8(0xf6)]===0x0)return console[_0x3d35f8(0xe1)](_0x3d35f8(0xdd)),console[_0x3d35f8(0xe1)](_0x3d35f8(0xd9)),0x1;try{const {parentId:_0x136d08,childId:_0x15052e}=parseSegmentRef(_0x5ea824[0x0]);if(!_0x15052e)return console[_0x3d35f8(0xe1)](_0x3d35f8(0xf3)),console[_0x3d35f8(0xe1)](_0x3d35f8(0xd9)),0x1;_0x1d2d12[_0x3d35f8(0xe0)]&&(console[_0x3d35f8(0xe1)](_0x3d35f8(0xda)+_0x1d2d12[_0x3d35f8(0xfa)]),console[_0x3d35f8(0xe1)](_0x3d35f8(0xe8)+_0x136d08),console[_0x3d35f8(0xe1)](_0x3d35f8(0xe9)+_0x15052e));const _0xd7f06e=await withSpinner(_0x3d35f8(0xf9)+_0x136d08+_0x3d35f8(0xea),()=>_0xc6c95['segment'][_0x3d35f8(0xf7)](_0x136d08),{'verbose':_0x1d2d12['verbose']}),_0x4b3f19=_0xd7f06e[_0x3d35f8(0xf5)];_0x1d2d12[_0x3d35f8(0xe0)]&&console[_0x3d35f8(0xe1)](_0x3d35f8(0xe3)+_0x4b3f19);const _0xb9a82e=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x15052e+_0x3d35f8(0xea),()=>_0xc6c95['segment'][_0x3d35f8(0xf8)](_0x4b3f19,_0x15052e),{'verbose':_0x1d2d12[_0x3d35f8(0xe0)]}),_0x16cc17=_0xb9a82e[_0x3d35f8(0xf5)];_0x1d2d12[_0x3d35f8(0xe0)]&&console[_0x3d35f8(0xe1)](_0x3d35f8(0xeb)+_0x16cc17);const _0x169430=await withSpinner(_0x3d35f8(0xd7)+_0x15052e+_0x3d35f8(0xea),()=>_0xc6c95[_0x3d35f8(0xdc)][_0x3d35f8(0xdb)](_0x4b3f19,_0x16cc17),{'verbose':_0x1d2d12['verbose']}),_0x333657=_0x169430[_0x3d35f8(0xf5)];return console[_0x3d35f8(0xe1)]('✔\x20Found\x20'+_0x333657[_0x3d35f8(0xf6)]+_0x3d35f8(0xee)+(_0x333657['length']!==0x1?'s':'')),await handleSDKOutput(_0x333657,_0x1d2d12),0x0;}catch(_0x236bb2){if(_0x236bb2 instanceof SDKError)return console[_0x3d35f8(0xe1)](_0x3d35f8(0xf2)+_0x236bb2[_0x3d35f8(0xed)]),_0x236bb2[_0x3d35f8(0xd6)]&&console['error'](_0x3d35f8(0xd5)+_0x236bb2['cause']),0x1;throw _0x236bb2;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x290369=a4_0x2261;(function(_0x116d4a,_0x288ffb){const _0xf49e27=a4_0x2261,_0x384cdc=_0x116d4a();while(!![]){try{const _0x5733b8=-parseInt(_0xf49e27(0x1fb))/0x1*(-parseInt(_0xf49e27(0x16a))/0x2)+-parseInt(_0xf49e27(0x1cb))/0x3+-parseInt(_0xf49e27(0x171))/0x4*(-parseInt(_0xf49e27(0x161))/0x5)+-parseInt(_0xf49e27(0x1f2))/0x6+parseInt(_0xf49e27(0x1ad))/0x7*(parseInt(_0xf49e27(0x1d3))/0x8)+-parseInt(_0xf49e27(0x1bc))/0x9+parseInt(_0xf49e27(0x199))/0xa*(parseInt(_0xf49e27(0x1fa))/0xb);if(_0x5733b8===_0x288ffb)break;else _0x384cdc['push'](_0x384cdc['shift']());}catch(_0x3becbd){_0x384cdc['push'](_0x384cdc['shift']());}}}(a4_0x3cb7,0x93adf));import a4_0xd2a568 from'chalk';import a4_0x3abeb3 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';function a4_0x3cb7(){const _0x3aedf7=['6868971vSdwcZ','\x20errors','Analyzing\x20project\x20\x22','site','\x0aPush\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','no_local_folder','llmProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','cyan','tdx.json','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Status:\x20','error','Errors:','1472751OURmoZ','\x20successfully','Using\x20project\x20from\x20context:\x20','\x22...','\x22\x20to\x20new\x20project\x20\x22','-\x20no\x20files\x20written','projectId','\x20--profile\x20','2813208tLPciQ','Source:\x20','force','\x20\x20Source:\x20','\x0aChanges\x20to\x20integration\x20\x27','sourceProjectName','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','new','agentName','Cancelled','Failed\x20to\x20push\x20agent:\x20','llm_project','experimentalArtifacts','execute','\x0aErrors\x20found:','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','prompts','\x20--name\x20','green','diff','\x0aError:','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Target:\x20','✔\x20Context\x20set:\x20','Using\x20project:\x20','integrations','agent.yml','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)','Using\x20local\x20project:\x20','Analyzing\x20changes\x20to\x20push...','pullAgent','5410632TffbYE','repeat','dirname','Agent\x20pulled\x20successfully','\x0aProject\x20pushed\x20with\x20errors','No\x20tdx.json\x20found\x20in\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Pulling\x20agent\x20\x22','6551721QfgUbB','287268cMNDjk','agents','New\x20project:\x20','Agent:\x20','\x22\x20to\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','red','agent:pull','cwd','\x20\x20Form\x20Interface\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','chatInterfaces','projectName','llm','counts','Pushing\x20agent\x20from\x20\x22','Using\x20context\x20project:\x20','Agent\x20','\x20total','join','\x22\x20to\x20a\x20different\x20profile','updated','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Chat\x20Interfaces:\x20','\x22:\x20','projectDir','experimentalKnowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Integrations:\x20','New\x20project\x20name\x20is\x20required','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','1675255ZYnCZD','Chat:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\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','created','dim','log','\x20\x20Prompt\x20\x22','reason','2tGLaIR','\x20\x20Prompts:\x20','action','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Would\x20clone:','knowledgeBases','\x20\x20Chat\x20Interface\x20\x22','4xstdiz','\x20\x20Knowledge\x20Base\x20\x22','\x20|\x20','newProjectId','Using\x20project\x20from\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','total','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Bases:\x20','yes','<new-name>','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agentId','\x20unchanged','\x20files\x20to\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','output','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20created','\x0aChanges\x20to\x20agent\x20\x27','textKnowledgeBases','Cannot\x20clone\x20from\x20context\x20project\x20\x22','-\x20nothing\x20pushed','dryRun','\x20=\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','parse','Would\x20pull\x20agent:\x20','\x20\x20Integration\x20\x22','outputPath','\x20\x20Experimental\x20Artifact\x20\x22','Pushing\x20to\x20project...','pushProject','Would\x20push\x20agent:\x20','\x20new','30oKMDrM','pushAgent','cwd-config','errors','\x0aChanges\x20to\x20prompt\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Form\x20Interfaces:\x20','\x20\x20Experimental\x20Artifacts:\x20','context','push','Dry\x20run\x20-\x20no\x20files\x20written','\x20changed','INVALID_ARGUMENT','\x0aPull\x20summary\x20for\x20\x27','\x27\x20to\x20create\x20the\x20folder\x20structure.','formInterfaces','\x20\x20Agents:\x20','Project:\x20','Writing\x20files...','pullProject','7lIkXLU','Project\x20cloned\x20with\x20errors','\x20\x20Knowledge\x20Bases:\x20','found','no_context','\x0a✔\x20Pulled\x20','Using\x20current\x20project:\x20','yellow','description','agent','unchanged','\x20\x20Agent\x20\x22','arg-dir','name','profile'];a4_0x3cb7=function(){return _0x3aedf7;};return a4_0x3cb7();}function a4_0x2261(_0x29eeb0,_0x3b1e31){_0x29eeb0=_0x29eeb0-0x15a;const _0x3cb70f=a4_0x3cb7();let _0x2261f0=_0x3cb70f[_0x29eeb0];return _0x2261f0;}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(_0x34e12c){const _0x2729da=a4_0x2261,_0x7b691d=[];if(_0x34e12c[_0x2729da(0x177)]!==undefined)_0x7b691d['push'](_0x34e12c['total']+_0x2729da(0x20d));if(_0x34e12c['new']!==undefined&&_0x34e12c[_0x2729da(0x1da)]>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568[_0x2729da(0x1e5)](_0x34e12c[_0x2729da(0x1da)]+_0x2729da(0x198)));if(_0x34e12c[_0x2729da(0x165)]!==undefined&&_0x34e12c[_0x2729da(0x165)]>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568[_0x2729da(0x1e5)](_0x34e12c[_0x2729da(0x165)]+_0x2729da(0x185)));if(_0x34e12c[_0x2729da(0x210)]!==undefined&&_0x34e12c[_0x2729da(0x210)]>0x0)_0x7b691d['push'](a4_0xd2a568['yellow'](_0x34e12c['updated']+'\x20updated'));if(_0x34e12c[_0x2729da(0x1b7)]!==undefined&&_0x34e12c[_0x2729da(0x1b7)]>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568['gray'](_0x34e12c[_0x2729da(0x1b7)]+_0x2729da(0x17e)));if(_0x34e12c[_0x2729da(0x19c)]!==undefined&&_0x34e12c['errors']>0x0)_0x7b691d[_0x2729da(0x1a2)](a4_0xd2a568['red'](_0x34e12c[_0x2729da(0x19c)]+_0x2729da(0x1bd)));return _0x7b691d['join'](',\x20');}function displayDiffs(_0x46c092,_0x53afb9,_0x1004c3,_0x50dbfd,_0xee59c3,_0x57ec11,_0x2bb6cc,_0x5000c2,_0x514238){const _0x103f17=a4_0x2261;for(const _0x5b3901 of _0x46c092){if(_0x5b3901[_0x103f17(0x1e6)]){const _0x5c9b34=_0x5b3901[_0x103f17(0x1db)]||_0x5b3901[_0x103f17(0x1ba)];console[_0x103f17(0x167)](_0x103f17(0x186)+_0x5c9b34+'\x27:'),console[_0x103f17(0x167)]('─'['repeat'](0x3c)),console[_0x103f17(0x167)](_0x5b3901[_0x103f17(0x1e6)]),console['log']('─'[_0x103f17(0x1f3)](0x3c));}}for(const _0x205cbe of _0x53afb9){_0x205cbe['diff']&&(console[_0x103f17(0x167)](_0x103f17(0x1f8)+_0x205cbe['name']+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x205cbe[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0xc147ff of _0x1004c3){_0xc147ff['diff']&&(console[_0x103f17(0x167)](_0x103f17(0x1d9)+_0xc147ff[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'['repeat'](0x3c)),console[_0x103f17(0x167)](_0xc147ff[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0x499375 of _0x50dbfd){_0x499375[_0x103f17(0x1e6)]&&(console[_0x103f17(0x167)](_0x103f17(0x19d)+_0x499375[_0x103f17(0x1ba)]+'\x27:'),console['log']('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x499375['diff']),console[_0x103f17(0x167)]('─'['repeat'](0x3c)));}for(const _0x27efe7 of _0xee59c3){_0x27efe7[_0x103f17(0x1e6)]&&(console[_0x103f17(0x167)](_0x103f17(0x1d7)+_0x27efe7['name']+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x27efe7[_0x103f17(0x1e6)]),console['log']('─'['repeat'](0x3c)));}for(const _0x19f257 of _0x57ec11){_0x19f257[_0x103f17(0x1e6)]&&(console['log'](_0x103f17(0x1e8)+_0x19f257[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'['repeat'](0x3c)),console[_0x103f17(0x167)](_0x19f257[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'['repeat'](0x3c)));}for(const _0x51e5c4 of _0x2bb6cc){_0x51e5c4[_0x103f17(0x1e6)]&&(console[_0x103f17(0x167)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x51e5c4[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console['log'](_0x51e5c4['diff']),console['log']('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0x1070bd of _0x5000c2){_0x1070bd['diff']&&(console[_0x103f17(0x167)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x1070bd['name']+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x1070bd[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}for(const _0x538766 of _0x514238){_0x538766['diff']&&(console[_0x103f17(0x167)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x538766[_0x103f17(0x1ba)]+'\x27:'),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)),console[_0x103f17(0x167)](_0x538766[_0x103f17(0x1e6)]),console[_0x103f17(0x167)]('─'[_0x103f17(0x1f3)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x290369(0x202);[a4_0x290369(0x1b5)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x52908b){const _0x219d1c=a4_0x290369,{options:_0x113e71,args:_0x28aed9,tdx:_0x37e5f3}=_0x52908b,_0x513a90=_0x28aed9[0x0],_0x2c515b=_0x28aed9[0x1],_0x5b73ad=_0x113e71[_0x219d1c(0x183)],_0x3e797f=_0x113e71[_0x219d1c(0x18a)],_0xbf7753=_0x113e71[_0x219d1c(0x1d5)],_0x402bab=_0x113e71[_0x219d1c(0x17a)],_0x368f66=_0x113e71[_0x219d1c(0x1c3)],_0x271c69=_0x113e71[_0x219d1c(0x1b6)];let _0xd76d62;if(_0x513a90){const _0x3de1e0=a4_0x3abeb3['join'](_0x513a90,_0x219d1c(0x1c6));if(existsSync(_0x3de1e0))try{const _0x4edd9d=JSON['parse'](readFileSync(_0x3de1e0,'utf-8'));_0x4edd9d[_0x219d1c(0x1de)]&&(_0xd76d62={'llm_project':_0x4edd9d['llm_project']});}catch{}}const _0x1028fb=findAgentConfigPath(process[_0x219d1c(0x203)]());let _0x44708e;if(_0x1028fb)try{const _0x1664e7=JSON[_0x219d1c(0x190)](readFileSync(_0x1028fb,'utf-8'));_0x1664e7[_0x219d1c(0x1de)]&&(_0x44708e={'llm_project':_0x1664e7[_0x219d1c(0x1de)]});}catch{}const _0x14204c=resolveAgentPullArgs({'arg':_0x513a90,'agentNameArg':_0x2c515b,'agentFlag':_0x271c69,'contextProject':_0x368f66,'argDirConfig':_0xd76d62,'cwdConfigPath':_0x1028fb||undefined,'cwdConfig':_0x44708e}),{projectNameOrId:_0x2ba416,targetAgentName:_0x448c54,existingOutputDir:_0x43709c,source:_0x48c244}=_0x14204c;if(_0x48c244===_0x219d1c(0x1b9))console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x175)+a4_0x3abeb3[_0x219d1c(0x20e)](_0x513a90,_0x219d1c(0x1c6))+':\x20'+_0x2ba416));else{if(_0x48c244===_0x219d1c(0x19b))console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x166)]('Using\x20project:\x20'+_0x2ba416));else _0x48c244===_0x219d1c(0x1a1)&&console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x1cd)+_0x2ba416));}if(!_0x2ba416)return _0x271c69?(console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x18d))),console[_0x219d1c(0x167)](_0x219d1c(0x16d)),console[_0x219d1c(0x167)](_0x219d1c(0x211))):(console['log'](a4_0xd2a568['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x219d1c(0x167)](_0x219d1c(0x1ee)),console[_0x219d1c(0x167)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x219d1c(0x167)](_0x219d1c(0x182)),console[_0x219d1c(0x167)](_0x219d1c(0x164)),console[_0x219d1c(0x167)]('\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(_0x448c54){const {data:_0x358102}=await withSpinner(_0x219d1c(0x1f9)+_0x448c54+'\x22\x20from\x20project\x20\x22'+_0x2ba416+_0x219d1c(0x1ce),()=>_0x37e5f3[_0x219d1c(0x208)][_0x219d1c(0x1f1)](_0x2ba416,_0x448c54,_0x5b73ad,{'dryRun':_0x3e797f,'force':_0xbf7753}));if(_0x3e797f)return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x1a3))),console[_0x219d1c(0x167)](_0x219d1c(0x191)+_0x358102['agentName']),console[_0x219d1c(0x167)]('Output\x20path:\x20'+_0x358102[_0x219d1c(0x193)]),_0x358102['diff']&&(console[_0x219d1c(0x167)]('\x0aChanges:'),console['log']('─'[_0x219d1c(0x1f3)](0x3c)),console[_0x219d1c(0x167)](_0x358102[_0x219d1c(0x1e6)]),console[_0x219d1c(0x167)]('─'[_0x219d1c(0x1f3)](0x3c))),0x0;return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)](_0x219d1c(0x1f5))),console[_0x219d1c(0x167)]('Agent:\x20'+_0x358102[_0x219d1c(0x1db)]),console['log']('Output:\x20'+_0x358102['outputPath']),console[_0x219d1c(0x167)](_0x219d1c(0x1c8)+(_0x358102['isNew']?a4_0xd2a568['green'](_0x219d1c(0x1da)):_0x358102['hasChanges']?a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x210)):a4_0xd2a568['gray'](_0x219d1c(0x1b7)))),0x0;}const _0x48d009=_0x43709c||_0x5b73ad,{data:_0xfa3e19}=await withSpinner(_0x219d1c(0x1be)+_0x2ba416+_0x219d1c(0x1ce),()=>_0x37e5f3[_0x219d1c(0x208)][_0x219d1c(0x1ac)](_0x2ba416,_0x48d009,{'dryRun':!![]})),_0x46efd2=_0xfa3e19[_0x219d1c(0x209)]['agents']['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)]['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x187)][_0x219d1c(0x1da)]+_0xfa3e19['counts'][_0x219d1c(0x1e3)]['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1ec)][_0x219d1c(0x1da)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)]['new']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)][_0x219d1c(0x1da)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1a8)][_0x219d1c(0x1da)]+_0xfa3e19[_0x219d1c(0x209)]['chatInterfaces'][_0x219d1c(0x1da)],_0x2e6d1a=_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1fc)][_0x219d1c(0x210)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)]['updated']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x187)]['updated']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1e3)][_0x219d1c(0x210)]+_0xfa3e19['counts'][_0x219d1c(0x1ec)][_0x219d1c(0x210)]+_0xfa3e19['counts'][_0x219d1c(0x15c)][_0x219d1c(0x210)]+_0xfa3e19[_0x219d1c(0x209)]['experimentalArtifacts']['updated']+_0xfa3e19['counts'][_0x219d1c(0x1a8)][_0x219d1c(0x210)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x206)]['updated'],_0x1fa94d=_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1fc)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x187)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1e3)]['unchanged']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1ec)][_0x219d1c(0x1b7)]+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)]['unchanged']+_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)][_0x219d1c(0x1b7)]+_0xfa3e19['counts'][_0x219d1c(0x1a8)][_0x219d1c(0x1b7)]+_0xfa3e19['counts'][_0x219d1c(0x206)][_0x219d1c(0x1b7)];console['log'](_0x219d1c(0x1a6)+_0xfa3e19[_0x219d1c(0x207)]+'\x27:'),console[_0x219d1c(0x167)]('\x20\x20'+a4_0xd2a568['green']('+\x20'+_0x46efd2+'\x20new')+_0x219d1c(0x173)+a4_0xd2a568['yellow']('~\x20'+_0x2e6d1a+_0x219d1c(0x1a4))+_0x219d1c(0x173)+a4_0xd2a568[_0x219d1c(0x166)]('=\x20'+_0x1fa94d+'\x20unchanged')),console[_0x219d1c(0x167)](_0x219d1c(0x1a9)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x1fc)])),console[_0x219d1c(0x167)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x16f)])),console[_0x219d1c(0x167)](_0x219d1c(0x179)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x187)])),console[_0x219d1c(0x167)](_0x219d1c(0x16b)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x1e3)])),console[_0x219d1c(0x167)](_0x219d1c(0x15e)+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1ec)])),console[_0x219d1c(0x167)](_0x219d1c(0x19f)+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1a8)])),console[_0x219d1c(0x167)](_0x219d1c(0x212)+formatCountSummary(_0xfa3e19['counts'][_0x219d1c(0x206)]));const _0x364c63=_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)]['total']>0x0||_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)][_0x219d1c(0x177)]>0x0;_0x364c63&&(console[_0x219d1c(0x167)](_0x219d1c(0x163)+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x15c)])),console[_0x219d1c(0x167)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xfa3e19[_0x219d1c(0x209)][_0x219d1c(0x1df)])));console[_0x219d1c(0x167)](_0x219d1c(0x1e9)+a4_0xd2a568[_0x219d1c(0x1c5)](_0xfa3e19['outputDir'])),displayDiffs(_0xfa3e19[_0x219d1c(0x1fc)],_0xfa3e19['knowledgeBases'],_0xfa3e19['textKnowledgeBases'],_0xfa3e19['prompts'],_0xfa3e19[_0x219d1c(0x1ec)],_0xfa3e19[_0x219d1c(0x15c)],_0xfa3e19['experimentalArtifacts'],_0xfa3e19[_0x219d1c(0x1a8)],_0xfa3e19[_0x219d1c(0x206)]);if(_0x3e797f)return console['log'](a4_0xd2a568[_0x219d1c(0x1b4)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x46efd2===0x0&&_0x2e6d1a===0x0)return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0xfa3e19[_0x219d1c(0x207)]},_0x113e71['session']),console[_0x219d1c(0x167)](a4_0xd2a568['green'](_0x219d1c(0x1ea)+a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x1de))+_0x219d1c(0x18b)+a4_0xd2a568[_0x219d1c(0x1c5)](_0xfa3e19['projectName']))),0x0;if(!_0x402bab&&!_0xbf7753){if(!isInteractive())return console[_0x219d1c(0x1c9)](a4_0xd2a568[_0x219d1c(0x201)](_0x219d1c(0x1e7)),_0x219d1c(0x181)),console['error'](a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x200))),0x1;const _0x150946=await confirmKey('\x0aWrite\x20'+(_0x46efd2+_0x2e6d1a)+'\x20files?');if(!_0x150946)return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1b4)](_0x219d1c(0x1dc)),_0x219d1c(0x1d0)),0x1;}const {data:_0x54d67e}=await withSpinner(_0x219d1c(0x1ab),()=>_0x37e5f3[_0x219d1c(0x208)]['pullProject'](_0x2ba416,_0x48d009,{'force':_0xbf7753}));return console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)](_0x219d1c(0x1b2)+(_0x46efd2+_0x2e6d1a)+_0x219d1c(0x17f)+_0x54d67e['outputDir'])),saveSessionContext({'llm_project':_0x54d67e[_0x219d1c(0x207)]},_0x113e71['session']),console[_0x219d1c(0x167)](a4_0xd2a568[_0x219d1c(0x1e5)]('✔\x20Context\x20set:\x20'+a4_0xd2a568[_0x219d1c(0x166)](_0x219d1c(0x1de))+'\x20=\x20'+a4_0xd2a568[_0x219d1c(0x1c5)](_0x54d67e[_0x219d1c(0x207)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x290369(0x1b5)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x290369(0x1e0)](_0x5613a7){const _0x53810a=a4_0x290369,{options:_0x152ece,args:_0xd67464,tdx:_0x1d70cc}=_0x5613a7,_0x1b33b5=_0xd67464[0x0],_0x2f6ac3=_0x152ece[_0x53810a(0x1ba)],_0x1e3323=_0x152ece['dryRun'],_0x248b2c=_0x152ece[_0x53810a(0x17a)],_0x192b7f=_0x152ece[_0x53810a(0x1bf)],_0x2fa2f3=_0x152ece[_0x53810a(0x1c3)];let _0x6fdbc4;const _0x2a8ec2=findAgentConfigPath(process[_0x53810a(0x203)]());if(_0x1b33b5){const _0x5819c2=a4_0x3abeb3['join'](_0x1b33b5,'tdx.json');existsSync(_0x5819c2)?(_0x6fdbc4=_0x1b33b5,console[_0x53810a(0x167)](a4_0xd2a568['dim'](_0x53810a(0x1ef)+_0x1b33b5))):_0x6fdbc4=_0x1b33b5;}else{if(_0x2a8ec2)_0x6fdbc4=a4_0x3abeb3[_0x53810a(0x1f4)](_0x2a8ec2),console['log'](a4_0xd2a568['dim'](_0x53810a(0x1b3)+_0x6fdbc4));else{if(_0x2fa2f3){const _0x599484=sanitizeForFilesystem(_0x2fa2f3);let _0x3390ee=_0x599484,_0x1bbf74=a4_0x3abeb3[_0x53810a(0x20e)](process[_0x53810a(0x203)](),_0x53810a(0x1fc),_0x599484,_0x53810a(0x1c6));if(!existsSync(_0x1bbf74)){const _0x144046=normalizeName(_0x2fa2f3),_0x39444a=a4_0x3abeb3[_0x53810a(0x20e)](process['cwd'](),_0x53810a(0x1fc),_0x144046,'tdx.json');existsSync(_0x39444a)&&(_0x3390ee=_0x144046,_0x1bbf74=_0x39444a);}if(existsSync(_0x1bbf74))_0x6fdbc4=a4_0x3abeb3[_0x53810a(0x1f4)](_0x1bbf74),console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x166)]('Using\x20local\x20project:\x20'+_0x6fdbc4));else{const _0x3c33b2=_0x152ece[_0x53810a(0x1bb)];if(_0x3c33b2)throw new SDKError(ErrorCode[_0x53810a(0x1a5)],_0x53810a(0x188)+_0x2fa2f3+_0x53810a(0x20f),undefined,{'helpText':_0x53810a(0x1c7)+_0x53810a(0x180)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x2fa2f3+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3390ee+_0x53810a(0x1e4)+(_0x2f6ac3||_0x53810a(0x17b))+_0x53810a(0x1d2)+_0x3c33b2)});_0x6fdbc4=_0x2fa2f3,console['log'](a4_0xd2a568[_0x53810a(0x166)](_0x53810a(0x20b)+_0x2fa2f3));}}}}if(!_0x6fdbc4)return console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x1b4)](_0x53810a(0x160))),console[_0x53810a(0x167)](_0x53810a(0x18f)),console[_0x53810a(0x167)](_0x53810a(0x184)),console[_0x53810a(0x167)](_0x53810a(0x18c)),console[_0x53810a(0x167)](_0x53810a(0x19e)),0x1;if(!_0x2f6ac3)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x53810a(0x15f),undefined,{'helpText':_0x53810a(0x205)});if(!_0x248b2c&&!_0x1e3323){if(!isInteractive())return console['error'](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x1e7)),_0x53810a(0x181)),console[_0x53810a(0x1c9)](a4_0xd2a568['dim'](_0x53810a(0x200))),0x1;const _0x3ddfc3=await confirmKey('Clone\x20\x22'+_0x6fdbc4+_0x53810a(0x1cf)+_0x2f6ac3+'\x22?');if(!_0x3ddfc3)return console['log'](a4_0xd2a568[_0x53810a(0x1b4)](_0x53810a(0x1dc))),0x1;}const {data:_0x33935e}=await withSpinner('Cloning\x20\x22'+_0x6fdbc4+_0x53810a(0x1ff)+_0x2f6ac3+_0x53810a(0x1ce),()=>_0x1d70cc[_0x53810a(0x208)]['cloneProject'](_0x6fdbc4,_0x2f6ac3,{'dryRun':_0x1e3323}));if(_0x1e3323){console[_0x53810a(0x167)](a4_0xd2a568['yellow'](_0x53810a(0x15d))),console[_0x53810a(0x167)](_0x53810a(0x1d4)+_0x33935e['sourceProjectName']),console[_0x53810a(0x167)]('New\x20project:\x20'+_0x2f6ac3),console[_0x53810a(0x167)](_0x53810a(0x16e)),console[_0x53810a(0x167)](_0x53810a(0x1a9)+_0x33935e[_0x53810a(0x209)]['agents'][_0x53810a(0x165)]),console[_0x53810a(0x167)](_0x53810a(0x1af)+_0x33935e[_0x53810a(0x209)]['knowledgeBases']['created']),console['log'](_0x53810a(0x16b)+_0x33935e[_0x53810a(0x209)]['prompts'][_0x53810a(0x165)]),console[_0x53810a(0x167)]('\x20\x20Form\x20Interfaces:\x20'+_0x33935e[_0x53810a(0x209)][_0x53810a(0x1a8)][_0x53810a(0x165)]),console[_0x53810a(0x167)]('\x20\x20Chat\x20Interfaces:\x20'+_0x33935e[_0x53810a(0x209)][_0x53810a(0x206)][_0x53810a(0x165)]);const _0x1a0e68=_0x33935e['counts'][_0x53810a(0x15c)][_0x53810a(0x165)]>0x0||_0x33935e[_0x53810a(0x209)]['experimentalArtifacts']['created']>0x0;return _0x1a0e68&&(console['log'](_0x53810a(0x163)+_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)]['created']),console['log'](_0x53810a(0x1a0)+_0x33935e[_0x53810a(0x209)]['experimentalArtifacts'][_0x53810a(0x165)])),0x0;}const _0x233e58=_0x33935e['counts'][_0x53810a(0x1fc)][_0x53810a(0x19c)]>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x16f)][_0x53810a(0x19c)]>0x0||_0x33935e['counts'][_0x53810a(0x1e3)]['errors']>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x1a8)]['errors']>0x0||_0x33935e['counts'][_0x53810a(0x206)]['errors']>0x0||_0x33935e['counts'][_0x53810a(0x15c)][_0x53810a(0x19c)]>0x0||_0x33935e[_0x53810a(0x209)]['experimentalArtifacts'][_0x53810a(0x19c)]>0x0;_0x233e58?console[_0x53810a(0x167)](a4_0xd2a568['yellow'](_0x53810a(0x1ae))):console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x1e5)](_0x53810a(0x178)));console[_0x53810a(0x167)](_0x53810a(0x1d4)+_0x33935e[_0x53810a(0x1d8)]),console[_0x53810a(0x167)](_0x53810a(0x1fd)+_0x33935e['newProjectName']),console['log']('New\x20project\x20ID:\x20'+_0x33935e[_0x53810a(0x174)]),console[_0x53810a(0x167)](),console[_0x53810a(0x167)]('Summary:'),console[_0x53810a(0x167)](_0x53810a(0x1a9)+formatCountSummary(_0x33935e[_0x53810a(0x209)][_0x53810a(0x1fc)])),console[_0x53810a(0x167)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x33935e[_0x53810a(0x209)]['knowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x33935e['counts'][_0x53810a(0x1e3)])),console[_0x53810a(0x167)](_0x53810a(0x15e)+formatCountSummary(_0x33935e[_0x53810a(0x209)]['integrations'])),console['log'](_0x53810a(0x19f)+formatCountSummary(_0x33935e[_0x53810a(0x209)][_0x53810a(0x1a8)])),console['log'](_0x53810a(0x212)+formatCountSummary(_0x33935e[_0x53810a(0x209)][_0x53810a(0x206)]));const _0x581eb1=_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)][_0x53810a(0x165)]>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)]['updated']>0x0||_0x33935e[_0x53810a(0x209)][_0x53810a(0x15c)][_0x53810a(0x1b7)]>0x0||_0x33935e['counts']['experimentalArtifacts'][_0x53810a(0x165)]>0x0||_0x33935e['counts']['experimentalArtifacts']['updated']>0x0||_0x33935e['counts'][_0x53810a(0x1df)][_0x53810a(0x1b7)]>0x0;_0x581eb1&&(console['log'](_0x53810a(0x163)+formatCountSummary(_0x33935e['counts']['experimentalKnowledgeBases'])),console[_0x53810a(0x167)](_0x53810a(0x1a0)+formatCountSummary(_0x33935e[_0x53810a(0x209)]['experimentalArtifacts'])));if(_0x233e58){console[_0x53810a(0x167)](),console['log'](a4_0xd2a568['red'](_0x53810a(0x1ca)));for(const _0xf017dd of _0x33935e['agents']){_0xf017dd['action']===_0x53810a(0x1c9)&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x1b8)+_0xf017dd[_0x53810a(0x1db)]+_0x53810a(0x15a)+_0xf017dd['error']));}for(const _0x54cf66 of _0x33935e[_0x53810a(0x16f)]){_0x54cf66[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console['log'](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x172)+_0x54cf66[_0x53810a(0x1ba)]+'\x22:\x20'+_0x54cf66[_0x53810a(0x1c9)]));}for(const _0x553018 of _0x33935e['prompts']){_0x553018['action']==='error'&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x168)+_0x553018[_0x53810a(0x1ba)]+'\x22:\x20'+_0x553018[_0x53810a(0x1c9)]));}for(const _0x3d097d of _0x33935e[_0x53810a(0x1ec)]){_0x3d097d[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)]('\x20\x20Integration\x20\x22'+_0x3d097d[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0x3d097d[_0x53810a(0x1c9)]));}for(const _0x5e5d72 of _0x33935e['formInterfaces']){_0x5e5d72[_0x53810a(0x16c)]==='error'&&console[_0x53810a(0x167)](a4_0xd2a568['red'](_0x53810a(0x204)+_0x5e5d72[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0x5e5d72['error']));}for(const _0x292381 of _0x33935e[_0x53810a(0x206)]){_0x292381[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x170)+_0x292381[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0x292381['error']));}for(const _0xa2ce5c of _0x33935e[_0x53810a(0x15c)]){_0xa2ce5c[_0x53810a(0x16c)]==='error'&&console[_0x53810a(0x167)](a4_0xd2a568[_0x53810a(0x201)](_0x53810a(0x17c)+_0xa2ce5c[_0x53810a(0x1ba)]+_0x53810a(0x15a)+_0xa2ce5c[_0x53810a(0x1c9)]));}for(const _0x665ea0 of _0x33935e[_0x53810a(0x1df)]){_0x665ea0[_0x53810a(0x16c)]===_0x53810a(0x1c9)&&console['log'](a4_0xd2a568['red'](_0x53810a(0x194)+_0x665ea0[_0x53810a(0x1ba)]+'\x22:\x20'+_0x665ea0[_0x53810a(0x1c9)]));}return 0x1;}console[_0x53810a(0x167)]();const _0x1bffea=getLLMProjectUrl(_0x192b7f,_0x33935e['newProjectId']);return console[_0x53810a(0x167)]('Project:\x20'+a4_0xd2a568[_0x53810a(0x1c5)](_0x1bffea)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x290369(0x1b5)]=a4_0x290369(0x1e2);async['execute'](_0x710a5d){const _0x413d3b=a4_0x290369,{options:_0x1ab0ee,args:_0x4e1fe3,tdx:_0x2a6036}=_0x710a5d;let _0x1a9a84=_0x4e1fe3[0x0]||process[_0x413d3b(0x203)]();const _0x570ce2=_0x1ab0ee[_0x413d3b(0x18a)],_0x426d5b=_0x1ab0ee['force'],_0x275640=_0x1ab0ee[_0x413d3b(0x17a)],_0x5a7730=_0x1ab0ee[_0x413d3b(0x1bf)],_0x23ec15=a4_0x3abeb3['join'](_0x1a9a84,_0x413d3b(0x1ed)),_0x2d30a8=existsSync(_0x23ec15);if(_0x2d30a8){const {data:_0x3f0be6}=await withSpinner(_0x413d3b(0x20a)+_0x1a9a84+_0x413d3b(0x1ce),()=>_0x2a6036[_0x413d3b(0x208)][_0x413d3b(0x19a)](_0x1a9a84,{'dryRun':_0x570ce2,'force':_0x426d5b}));if(_0x570ce2)return console['log'](a4_0xd2a568[_0x413d3b(0x1b4)](_0x413d3b(0x15d))),console[_0x413d3b(0x167)](_0x413d3b(0x197)+_0x3f0be6[_0x413d3b(0x1db)]),0x0;if(_0x3f0be6[_0x413d3b(0x16c)]===_0x413d3b(0x1c9))return console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1dd)+_0x3f0be6[_0x413d3b(0x1c9)])),0x1;console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1e5)](_0x413d3b(0x20c)+_0x3f0be6[_0x413d3b(0x16c)]+_0x413d3b(0x1cc))),console['log'](_0x413d3b(0x1fe)+_0x3f0be6[_0x413d3b(0x1db)]);if(_0x3f0be6[_0x413d3b(0x17d)]&&_0x3f0be6[_0x413d3b(0x1d1)]){const _0x2557df=getLLMAgentChatUrl(_0x5a7730,_0x3f0be6[_0x413d3b(0x1d1)],_0x3f0be6['agentId']);console[_0x413d3b(0x167)](_0x413d3b(0x162)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x2557df));}return 0x0;}const _0x255d97=_0x1ab0ee['llmProject'],_0x383f07=resolveProjectFromContext(_0x1a9a84,_0x255d97);if(_0x383f07[_0x413d3b(0x1b0)])_0x1a9a84=_0x383f07[_0x413d3b(0x15b)],_0x383f07['source']==='context'&&console[_0x413d3b(0x167)](a4_0xd2a568['dim'](_0x413d3b(0x1eb)+_0x1a9a84));else{let _0x1f674d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x383f07['reason']===_0x413d3b(0x1c2)&&(_0x1f674d=_0x383f07['message']+_0x413d3b(0x1c1)+_0x383f07[_0x413d3b(0x1c3)]+_0x413d3b(0x1a7));throw new SDKError(ErrorCode[_0x413d3b(0x1a5)],_0x383f07[_0x413d3b(0x169)]===_0x413d3b(0x1b1)?_0x383f07['message']:_0x413d3b(0x1f7)+_0x1a9a84,undefined,{'helpText':_0x1f674d});}const {data:_0x304a7a}=await withSpinner(_0x413d3b(0x1f0),()=>_0x2a6036[_0x413d3b(0x208)][_0x413d3b(0x196)](_0x1a9a84,{'dryRun':!![]})),_0x2daff9=_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1fc)][_0x413d3b(0x19c)]>0x0;if(_0x2daff9){console['log'](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1e1)));for(const _0x427a5a of _0x304a7a[_0x413d3b(0x1fc)]){_0x427a5a[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1b8)+_0x427a5a[_0x413d3b(0x1db)]+_0x413d3b(0x15a)+_0x427a5a[_0x413d3b(0x1c9)]));}return 0x1;}const _0x4da1e2=_0x304a7a['counts'][_0x413d3b(0x1fc)][_0x413d3b(0x165)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)][_0x413d3b(0x165)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x165)]+_0x304a7a['counts'][_0x413d3b(0x1e3)][_0x413d3b(0x165)]+_0x304a7a['counts'][_0x413d3b(0x1ec)]['created']+_0x304a7a['counts']['experimentalKnowledgeBases']['created']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)][_0x413d3b(0x165)]+_0x304a7a['counts']['formInterfaces']['created']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x206)]['created'],_0x53c7d5=_0x304a7a[_0x413d3b(0x209)]['agents'][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)]['updated']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1e3)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1ec)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)]['experimentalKnowledgeBases'][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)]['formInterfaces'][_0x413d3b(0x210)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x206)][_0x413d3b(0x210)],_0x10ab6d=_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1fc)][_0x413d3b(0x1b7)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)]['unchanged']+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x1b7)]+_0x304a7a['counts'][_0x413d3b(0x1e3)][_0x413d3b(0x1b7)]+_0x304a7a['counts'][_0x413d3b(0x1ec)][_0x413d3b(0x1b7)]+_0x304a7a['counts'][_0x413d3b(0x15c)][_0x413d3b(0x1b7)]+_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['unchanged']+_0x304a7a[_0x413d3b(0x209)]['formInterfaces'][_0x413d3b(0x1b7)]+_0x304a7a[_0x413d3b(0x209)]['chatInterfaces'][_0x413d3b(0x1b7)];console[_0x413d3b(0x167)]('\x0aPush\x20summary\x20for\x20\x27'+_0x304a7a['projectName']+'\x27:'),console[_0x413d3b(0x167)]('\x20\x20'+a4_0xd2a568[_0x413d3b(0x1e5)]('+\x20'+_0x4da1e2+_0x413d3b(0x198))+_0x413d3b(0x173)+a4_0xd2a568[_0x413d3b(0x1b4)]('~\x20'+_0x53c7d5+_0x413d3b(0x1a4))+_0x413d3b(0x173)+a4_0xd2a568[_0x413d3b(0x166)]('=\x20'+_0x10ab6d+_0x413d3b(0x17e))),console[_0x413d3b(0x167)]('\x20\x20Agents:\x20'+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1fc)])),console['log'](_0x413d3b(0x1af)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x16f)])),console[_0x413d3b(0x167)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x304a7a['counts'][_0x413d3b(0x187)])),console[_0x413d3b(0x167)](_0x413d3b(0x16b)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1e3)])),console[_0x413d3b(0x167)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x304a7a['counts'][_0x413d3b(0x1ec)])),console[_0x413d3b(0x167)](_0x413d3b(0x19f)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1a8)])),console[_0x413d3b(0x167)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x304a7a['counts'][_0x413d3b(0x206)]));const _0xe14254=_0x304a7a['counts'][_0x413d3b(0x15c)][_0x413d3b(0x165)]>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x15c)][_0x413d3b(0x210)]>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x15c)]['unchanged']>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['created']>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['updated']>0x0||_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x1df)]['unchanged']>0x0;_0xe14254&&(console[_0x413d3b(0x167)](_0x413d3b(0x163)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)][_0x413d3b(0x15c)])),console[_0x413d3b(0x167)](_0x413d3b(0x1a0)+formatCountSummary(_0x304a7a[_0x413d3b(0x209)]['experimentalArtifacts'])));console[_0x413d3b(0x167)](_0x413d3b(0x1d6)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x1a9a84)),displayDiffs(_0x304a7a[_0x413d3b(0x1fc)],_0x304a7a[_0x413d3b(0x16f)],_0x304a7a[_0x413d3b(0x187)],_0x304a7a[_0x413d3b(0x1e3)],_0x304a7a['integrations'],_0x304a7a[_0x413d3b(0x15c)],_0x304a7a[_0x413d3b(0x1df)],_0x304a7a[_0x413d3b(0x1a8)],_0x304a7a[_0x413d3b(0x206)]);if(_0x570ce2)return console[_0x413d3b(0x167)](a4_0xd2a568['yellow'](_0x413d3b(0x1c4))),0x0;if(_0x4da1e2===0x0&&_0x53c7d5===0x0){console['log'](a4_0xd2a568[_0x413d3b(0x1e5)](_0x413d3b(0x176)));const _0x494df7=getLLMProjectUrl(_0x5a7730,_0x304a7a[_0x413d3b(0x1d1)]);return console['log'](_0x413d3b(0x1aa)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x494df7)),0x0;}if(!_0x275640&&!_0x426d5b){if(!isInteractive())return console[_0x413d3b(0x1c9)](a4_0xd2a568['red'](_0x413d3b(0x1e7)),_0x413d3b(0x181)),console[_0x413d3b(0x1c9)](a4_0xd2a568['dim'](_0x413d3b(0x200))),0x1;const _0xc48c3b=await confirmKey(_0x413d3b(0x1c0)+(_0x4da1e2+_0x53c7d5)+'\x20resources?');if(!_0xc48c3b)return console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1b4)]('Cancelled'),_0x413d3b(0x189)),0x1;}const {data:_0x29a75}=await withSpinner(_0x413d3b(0x195),()=>_0x2a6036[_0x413d3b(0x208)][_0x413d3b(0x196)](_0x1a9a84,{'force':_0x426d5b})),_0x50c055=_0x29a75['counts'][_0x413d3b(0x1fc)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x16f)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x187)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x1e3)]['errors']>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x1a8)][_0x413d3b(0x19c)]>0x0||_0x29a75[_0x413d3b(0x209)][_0x413d3b(0x206)]['errors']>0x0;if(_0x50c055){console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1b4)](_0x413d3b(0x1f6))),console[_0x413d3b(0x167)](),console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x1ca)));for(const _0x35e2d1 of _0x29a75[_0x413d3b(0x1fc)]){_0x35e2d1[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console['log'](a4_0xd2a568['red'](_0x413d3b(0x1b8)+_0x35e2d1[_0x413d3b(0x1db)]+_0x413d3b(0x15a)+_0x35e2d1['error']));}for(const _0x53dd2f of _0x29a75[_0x413d3b(0x16f)]){_0x53dd2f[_0x413d3b(0x16c)]==='error'&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x53dd2f['name']+'\x22:\x20'+_0x53dd2f[_0x413d3b(0x1c9)]));}for(const _0x248fef of _0x29a75['textKnowledgeBases']){_0x248fef[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x18e)+_0x248fef['name']+_0x413d3b(0x15a)+_0x248fef[_0x413d3b(0x1c9)]));}for(const _0x22fe06 of _0x29a75[_0x413d3b(0x1e3)]){_0x22fe06[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console['log'](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x168)+_0x22fe06[_0x413d3b(0x1ba)]+'\x22:\x20'+_0x22fe06[_0x413d3b(0x1c9)]));}for(const _0xe10447 of _0x29a75[_0x413d3b(0x1ec)]){_0xe10447[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568['red'](_0x413d3b(0x192)+_0xe10447[_0x413d3b(0x1ba)]+_0x413d3b(0x15a)+_0xe10447[_0x413d3b(0x1c9)]));}for(const _0x443f66 of _0x29a75[_0x413d3b(0x1a8)]){_0x443f66[_0x413d3b(0x16c)]===_0x413d3b(0x1c9)&&console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x201)](_0x413d3b(0x204)+_0x443f66[_0x413d3b(0x1ba)]+_0x413d3b(0x15a)+_0x443f66['error']));}for(const _0x4ab351 of _0x29a75[_0x413d3b(0x206)]){_0x4ab351['action']==='error'&&console[_0x413d3b(0x167)](a4_0xd2a568['red'](_0x413d3b(0x170)+_0x4ab351[_0x413d3b(0x1ba)]+_0x413d3b(0x15a)+_0x4ab351['error']));}return 0x1;}console[_0x413d3b(0x167)](a4_0xd2a568[_0x413d3b(0x1e5)]('\x0a✔\x20Pushed\x20'+(_0x4da1e2+_0x53c7d5)+'\x20resources\x20to\x20\x27'+_0x29a75[_0x413d3b(0x207)]+'\x27'));const _0x3ff485=getLLMProjectUrl(_0x5a7730,_0x29a75[_0x413d3b(0x1d1)]);return console[_0x413d3b(0x167)](_0x413d3b(0x1aa)+a4_0xd2a568[_0x413d3b(0x1c5)](_0x3ff485)),0x0;}}
|
|
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 +1 @@
|
|
|
1
|
-
const a5_0x36a7fd=a5_0x1792;(function(_0x20c6ea,_0x54ba70){const _0x4b1dcf=a5_0x1792,_0x2cda50=_0x20c6ea();while(!![]){try{const _0x1bca43=parseInt(_0x4b1dcf(0x184))/0x1*(-parseInt(_0x4b1dcf(0x13a))/0x2)+parseInt(_0x4b1dcf(0x194))/0x3+-parseInt(_0x4b1dcf(0x17f))/0x4*(-parseInt(_0x4b1dcf(0x105))/0x5)+-parseInt(_0x4b1dcf(0x114))/0x6*(parseInt(_0x4b1dcf(0x13f))/0x7)+parseInt(_0x4b1dcf(0x109))/0x8+-parseInt(_0x4b1dcf(0x138))/0x9+-parseInt(_0x4b1dcf(0x152))/0xa*(-parseInt(_0x4b1dcf(0x15c))/0xb);if(_0x1bca43===_0x54ba70)break;else _0x2cda50['push'](_0x2cda50['shift']());}catch(_0x4f097f){_0x2cda50['push'](_0x2cda50['shift']());}}}(a5_0x33cc,0xb4818));import*as a5_0x24e656 from'node:fs';function a5_0x1792(_0x1e7556,_0x15015d){_0x1e7556=_0x1e7556-0xfe;const _0x33cc23=a5_0x33cc();let _0x179223=_0x33cc23[_0x1e7556];return _0x179223;}import*as a5_0x5d8849 from'node:path';import a5_0x520e02 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{['name']='agent:test';[a5_0x36a7fd(0x14a)]=a5_0x36a7fd(0x15d);async[a5_0x36a7fd(0x10c)](_0x458b71){const _0x15baaa=a5_0x36a7fd,{options:_0x19eaf8,args:_0x25d73e,tdx:_0x5a9f98}=_0x458b71,_0x3e0b91=_0x25d73e[0x0]||'.',_0x2e71f3=_0x19eaf8[_0x15baaa(0x18b)],_0x3ae21e=_0x19eaf8,_0x48d092=_0x3ae21e[_0x15baaa(0x183)]===![],_0x5adfe0=_0x3ae21e['reeval'],_0x211384=_0x3ae21e[_0x15baaa(0x176)],_0x1f8a46=_0x3ae21e['tags'],_0x565add=_0x19eaf8[_0x15baaa(0x168)],_0xf6f1df=_0x3ae21e[_0x15baaa(0x103)];if(_0x5adfe0&&_0x48d092)return console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x153))),0x1;let _0x38a244=_0x15baaa(0x170);if(_0x3ae21e[_0x15baaa(0x12b)])_0x38a244='json';else{if(_0x3ae21e[_0x15baaa(0x166)])_0x38a244=_0x15baaa(0x166);else{if(_0x3ae21e[_0x15baaa(0x12d)])_0x38a244='tsv';else{if(_0x3ae21e[_0x15baaa(0x170)])_0x38a244=_0x15baaa(0x170);}}}const _0x2a0b21=_0x3ae21e[_0x15baaa(0x16d)];let _0x2e0245=_0x3e0b91;const _0x27765f=a5_0x24e656[_0x15baaa(0x15a)](_0x3e0b91),_0x31d6e9=_0x3e0b91==='.';if(!_0x27765f||_0x31d6e9){const _0x12a332=resolveProjectFromContext(_0x3e0b91,_0x2a0b21,{'requireFile':_0x15baaa(0x135)});if(_0x12a332['found'])_0x2e0245=_0x12a332[_0x15baaa(0x11e)],_0x12a332[_0x15baaa(0x125)]==='context'&&console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)]('Using\x20agent:\x20'+_0x2e0245));else switch(_0x12a332[_0x15baaa(0x10e)]){case _0x15baaa(0x145):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)](_0x12a332[_0x15baaa(0x180)])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)]('Usage:'),console[_0x15baaa(0x16f)](_0x15baaa(0x17e)),console['log'](_0x15baaa(0x16b)),console[_0x15baaa(0x16f)](),console['log'](_0x15baaa(0x15f));return 0x1;case'no_local_folder':console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)](_0x12a332[_0x15baaa(0x180)])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15baaa(0x131)+_0x12a332['llmProject']+_0x15baaa(0x106));return 0x1;case _0x15baaa(0x159):{const _0x1483f5=a5_0x5d8849[_0x15baaa(0x155)](_0x12a332[_0x15baaa(0x11e)]);console[_0x15baaa(0x16f)](a5_0x520e02['yellow'](_0x15baaa(0x190)+_0x12a332['llmProject']+'\x22:'));for(const _0xf18dc9 of _0x12a332['agentDirs']){console[_0x15baaa(0x16f)](_0x15baaa(0x124)+_0xf18dc9);}return console['log'](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1483f5+_0x15baaa(0x158)),0x1;}case _0x15baaa(0x11d):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)](_0x15baaa(0x11f)+_0x12a332['llmProject']+'\x22.')),console['log'](a5_0x520e02[_0x15baaa(0x142)]('Project\x20path:\x20'+_0x12a332['projectDir'])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15baaa(0x169));return 0x1;}}const {definition:_0x295f96,agentInfo:_0x335965}=parseTestFile(_0x2e0245);let _0x5f3a47=_0x295f96[_0x15baaa(0x10b)];if(_0x211384){const _0x50b4c4=_0x211384[_0x15baaa(0xff)](',')[_0x15baaa(0x17b)](_0x128c4d=>_0x128c4d[_0x15baaa(0x147)]());_0x5f3a47=_0x295f96[_0x15baaa(0x10b)][_0x15baaa(0x129)](_0x5c456e=>_0x50b4c4[_0x15baaa(0x18c)](_0x5c456e[_0x15baaa(0x176)]));if(_0x5f3a47[_0x15baaa(0x133)]===0x0)return console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x12f)]('No\x20tests\x20found\x20matching:\x20'+_0x211384)),console['log'](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x14c)+_0x295f96[_0x15baaa(0x10b)][_0x15baaa(0x17b)](_0x1f34a5=>_0x1f34a5[_0x15baaa(0x176)])[_0x15baaa(0x160)](',\x20'))),0x1;}if(_0x1f8a46){const _0x3858d7=_0x1f8a46['split'](',')[_0x15baaa(0x17b)](_0xe94109=>_0xe94109[_0x15baaa(0x147)]()['toLowerCase']());_0x5f3a47=_0x5f3a47['filter'](_0x24c8ec=>_0x24c8ec[_0x15baaa(0x13b)]?.[_0x15baaa(0x17a)](_0x20e55f=>_0x3858d7[_0x15baaa(0x18c)](_0x20e55f[_0x15baaa(0x11a)]())));if(_0x5f3a47[_0x15baaa(0x133)]===0x0){console[_0x15baaa(0x16f)](a5_0x520e02['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1f8a46));const _0x1eaac1=new Set();return _0x295f96['tests'][_0x15baaa(0x18d)](_0x4eef19=>_0x4eef19[_0x15baaa(0x13b)]?.['forEach'](_0x1a4f99=>_0x1eaac1[_0x15baaa(0x179)](_0x1a4f99))),_0x1eaac1[_0x15baaa(0x128)]>0x0?console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x113)+[..._0x1eaac1][_0x15baaa(0x160)](',\x20'))):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x104))),0x1;}}if(_0x5adfe0)return this[_0x15baaa(0x157)](_0x458b71,{'definition':{'tests':_0x5f3a47},'agentInfo':_0x335965,'outputFormat':_0x38a244,'outputFile':_0xf6f1df,'testNames':_0x211384});if(_0x2e71f3){console['log'](a5_0x520e02[_0x15baaa(0x13c)](_0x15baaa(0x117))),console[_0x15baaa(0x16f)]('\x20\x20Site:\x20'+a5_0x520e02[_0x15baaa(0x177)](_0x565add)),console[_0x15baaa(0x16f)](_0x15baaa(0x185)+a5_0x520e02[_0x15baaa(0x177)](_0x335965[_0x15baaa(0x112)])),console[_0x15baaa(0x16f)](_0x15baaa(0x188)+a5_0x520e02['white'](_0x335965[_0x15baaa(0x132)])),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15baaa(0x161)+a5_0x520e02[_0x15baaa(0x177)](_0x5f3a47[_0x15baaa(0x133)]));for(let _0x44fb3e=0x0;_0x44fb3e<_0x5f3a47[_0x15baaa(0x133)];_0x44fb3e++){const _0x391984=_0x5f3a47[_0x44fb3e],_0x1ea6cd=_0x391984[_0x15baaa(0x11b)][_0x15baaa(0x133)]===0x1?'round':'rounds',_0x5a45e5=_0x391984['tags']?.[_0x15baaa(0x133)]?'\x20['+_0x391984[_0x15baaa(0x13b)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x44fb3e+0x1)+'.\x20'+a5_0x520e02[_0x15baaa(0x177)](_0x391984[_0x15baaa(0x176)])+'\x20('+_0x391984['rounds'][_0x15baaa(0x133)]+'\x20'+_0x1ea6cd+')'+a5_0x520e02[_0x15baaa(0x142)](_0x5a45e5));}return 0x0;}let _0x189058,_0x5bcbd9;try{_0x189058=await _0x5a9f98[_0x15baaa(0x154)][_0x15baaa(0x12a)](_0x335965[_0x15baaa(0x112)]);}catch(_0x1baf2c){const _0x24e321=_0x1baf2c instanceof Error?_0x1baf2c[_0x15baaa(0x180)]:String(_0x1baf2c);return _0x24e321[_0x15baaa(0x18c)](_0x15baaa(0x118))||_0x24e321[_0x15baaa(0x11a)]()[_0x15baaa(0x18c)](_0x15baaa(0x14b))?console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x335965[_0x15baaa(0x112)])):console[_0x15baaa(0x16f)](a5_0x520e02['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x335965['projectName']+_0x15baaa(0x115)+_0x24e321)),0x1;}try{_0x5bcbd9=await _0x5a9f98[_0x15baaa(0x154)][_0x15baaa(0x175)](_0x335965[_0x15baaa(0x132)],_0x189058);}catch(_0x2f9c73){const _0xc8ef10=_0x2f9c73 instanceof Error?_0x2f9c73[_0x15baaa(0x180)]:String(_0x2f9c73);return _0xc8ef10[_0x15baaa(0x18c)](_0x15baaa(0x118))||_0xc8ef10['toLowerCase']()['includes'](_0x15baaa(0x14b))?console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x171)+_0x335965[_0x15baaa(0x132)])):console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x335965[_0x15baaa(0x132)]+_0x15baaa(0x115)+_0xc8ef10)),0x1;}let _0x5f3355;if(!_0x48d092)try{_0x5f3355=await setupEvaluatorAgent(_0x5a9f98[_0x15baaa(0x154)],_0x19eaf8[_0x15baaa(0x13e)]);}catch(_0x459991){const _0x84e9a3=_0x459991 instanceof Error?_0x459991['message']:String(_0x459991);return console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x173)+_0x84e9a3)),0x1;}console['log'](a5_0x520e02[_0x15baaa(0x13c)](_0x15baaa(0x14f))),console['log'](_0x15baaa(0x127)+a5_0x520e02['white'](_0x565add)),console[_0x15baaa(0x16f)]('Agent:\x20'+a5_0x520e02[_0x15baaa(0x177)](_0x335965[_0x15baaa(0x112)]+'/'+_0x335965[_0x15baaa(0x132)])),console[_0x15baaa(0x16f)]();const _0x3c7204=[],_0x320600=[],_0x42109e=Date['now']();for(let _0x4440a1=0x0;_0x4440a1<_0x5f3a47[_0x15baaa(0x133)];_0x4440a1++){const _0x1028b7=_0x5f3a47[_0x4440a1];_0x5f3a47['length']>0x1?console['log'](_0x15baaa(0x192)+(_0x4440a1+0x1)+'/'+_0x5f3a47[_0x15baaa(0x133)]+':\x20'+a5_0x520e02['white'](_0x1028b7['name'])):console['log'](_0x15baaa(0x172)+a5_0x520e02[_0x15baaa(0x177)](_0x1028b7[_0x15baaa(0x176)]));const _0x149518=createCommandSpinner(_0x15baaa(0x122)+_0x1028b7[_0x15baaa(0x11b)][_0x15baaa(0x133)]+_0x15baaa(0x162));_0x149518[_0x15baaa(0x146)]();try{const {result:_0x1220a9,conversation:_0x4c83ff}=await runTest(_0x5a9f98[_0x15baaa(0x154)],_0x1028b7,{'agentId':_0x5bcbd9,'projectId':_0x189058,'site':_0x565add,'noEval':_0x48d092,'evaluatorId':_0x5f3355,'onRoundStart':(_0x3af214,_0x4e2a70)=>{const _0x46d4a8=_0x15baaa;_0x149518['text']=_0x46d4a8(0x134)+(_0x3af214+0x1)+'/'+_0x4e2a70+_0x46d4a8(0x162);},'onRoundComplete':(_0x29b574,_0x270ad8,_0x78b2d5)=>{const _0x2205ff=_0x15baaa,_0x3b3961=formatElapsed(_0x270ad8);_0x78b2d5?console[_0x2205ff(0x16f)](_0x2205ff(0x150)+(_0x29b574+0x1)+'/'+_0x1028b7[_0x2205ff(0x11b)][_0x2205ff(0x133)]+_0x2205ff(0x165)+a5_0x520e02[_0x2205ff(0x18f)]('✓')+'\x20('+_0x3b3961+')'):console[_0x2205ff(0x16f)]('\x20\x20Round\x20'+(_0x29b574+0x1)+'/'+_0x1028b7[_0x2205ff(0x11b)][_0x2205ff(0x133)]+_0x2205ff(0x165)+a5_0x520e02[_0x2205ff(0xfe)]('✗'));},'onEvaluationStart':()=>{const _0x368d57=_0x15baaa;_0x149518[_0x368d57(0x137)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5d0da0=>{const _0x16b096=formatElapsed(_0x5d0da0);console['log']('\x20\x20Evaluating...\x20'+a5_0x520e02['green']('✓')+'\x20('+_0x16b096+')');}});_0x149518[_0x15baaa(0x189)](),_0x3c7204['push'](_0x1220a9),_0x320600[_0x15baaa(0x110)](_0x4c83ff);if(_0x1220a9['status']==='PASS')console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x18f)](_0x15baaa(0x187)+_0x1220a9['reason']));else _0x1220a9[_0x15baaa(0x164)]==='FAIL'?console[_0x15baaa(0x16f)](a5_0x520e02['red'](_0x15baaa(0x163)+_0x1220a9[_0x15baaa(0x10e)])):console['log'](a5_0x520e02['red']('✗\x20ERROR:\x20'+_0x1220a9[_0x15baaa(0x10e)]));_0x1220a9['conversation_url']&&console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)](_0x15baaa(0x156)+_0x1220a9[_0x15baaa(0x102)])),console[_0x15baaa(0x16f)]();}catch(_0x476e45){_0x149518[_0x15baaa(0x189)]();const _0x3fb406=_0x476e45 instanceof Error?_0x476e45[_0x15baaa(0x180)]:String(_0x476e45);console['log'](a5_0x520e02[_0x15baaa(0xfe)]('✗\x20ERROR:\x20'+_0x3fb406)),console[_0x15baaa(0x16f)](),_0x3c7204[_0x15baaa(0x110)]({'name':_0x1028b7['name'],'status':'ERROR','reason':_0x3fb406,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x573db7=Date[_0x15baaa(0x120)]()-_0x42109e,_0x2abbac=_0x3c7204[_0x15baaa(0x129)](_0x27cc1d=>_0x27cc1d[_0x15baaa(0x164)]===_0x15baaa(0x15b))[_0x15baaa(0x133)],_0x3f43aa=_0x3c7204[_0x15baaa(0x129)](_0x4baef3=>_0x4baef3[_0x15baaa(0x164)]===_0x15baaa(0x139))[_0x15baaa(0x133)],_0x25775e=_0x3c7204['filter'](_0x55e976=>_0x55e976[_0x15baaa(0x164)]===_0x15baaa(0x167))['length'];console['log']('━'[_0x15baaa(0x111)](0x3c)),console[_0x15baaa(0x16f)]('Test\x20Summary'),console[_0x15baaa(0x16f)]('━'[_0x15baaa(0x111)](0x3c)),console['log'](_0x15baaa(0x143)+_0x3c7204[_0x15baaa(0x133)]),console['log'](_0x15baaa(0x12c)+a5_0x520e02['green'](_0x2abbac)),console[_0x15baaa(0x16f)](_0x15baaa(0x149)+a5_0x520e02[_0x15baaa(0xfe)](_0x3f43aa));_0x25775e>0x0&&console[_0x15baaa(0x16f)](_0x15baaa(0x12e)+a5_0x520e02[_0x15baaa(0xfe)](_0x25775e));console[_0x15baaa(0x16f)](_0x15baaa(0x108)+formatElapsed(_0x573db7)),console[_0x15baaa(0x16f)]('━'['repeat'](0x3c));const _0x2dea29=_0x3c7204[_0x15baaa(0x129)](_0x3b5061=>_0x3b5061[_0x15baaa(0x164)]!==_0x15baaa(0x15b));if(_0x2dea29[_0x15baaa(0x133)]>0x0){console['log'](),console['log'](_0x15baaa(0x10a));for(const _0x279c41 of _0x2dea29){const _0x2db21c=a5_0x520e02[_0x15baaa(0xfe)]('✗'),_0x20c33e=_0x279c41[_0x15baaa(0x10e)][_0x15baaa(0x133)]>0x32?_0x279c41['reason'][_0x15baaa(0x178)](0x0,0x32)+_0x15baaa(0x16a):_0x279c41[_0x15baaa(0x10e)];console[_0x15baaa(0x16f)]('\x20\x20'+_0x2db21c+'\x20'+_0x279c41[_0x15baaa(0x176)]+':\x20'+_0x20c33e);}}const _0x1ae041={'summary':{'total':_0x3c7204[_0x15baaa(0x133)],'passed':_0x2abbac,'failed':_0x3f43aa,'errors':_0x25775e>0x0?_0x25775e:undefined,'duration_ms':_0x573db7},'tests':_0x3c7204,'agent':{'project':_0x335965['projectName'],'name':_0x335965[_0x15baaa(0x132)],'site':_0x565add},'timestamp':new Date(_0x42109e)[_0x15baaa(0x14e)]()};try{const _0xc595ef=buildCachedTestRun(_0x320600,{'site':_0x565add,'projectId':_0x189058,'projectName':_0x335965[_0x15baaa(0x112)],'agentId':_0x5bcbd9,'agentName':_0x335965[_0x15baaa(0x132)],'testYmlPath':a5_0x5d8849['resolve'](_0x335965[_0x15baaa(0x144)])});saveLastTestRun(_0xc595ef);}catch{}if(_0x38a244!==_0x15baaa(0x170)||_0xf6f1df){const _0x15d128=formatResults(_0x1ae041,_0x38a244);if(_0xf6f1df)try{a5_0x24e656[_0x15baaa(0x17d)](_0xf6f1df,_0x15d128,'utf-8'),console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](a5_0x520e02[_0x15baaa(0x142)]('Output\x20written\x20to:\x20'+_0xf6f1df));}catch(_0x568d26){return console[_0x15baaa(0x16f)](),console['log'](a5_0x520e02[_0x15baaa(0xfe)](_0x15baaa(0x16e)+_0x568d26)),0x1;}else console[_0x15baaa(0x16f)](),console[_0x15baaa(0x16f)](_0x15d128);}return _0x2dea29[_0x15baaa(0x133)]>0x0?0x1:0x0;}async[a5_0x36a7fd(0x157)](_0x232fb5,_0x472431){const _0x4ff223=a5_0x36a7fd,{options:_0x1ca388,tdx:_0x3e84dc}=_0x232fb5,{definition:_0x24001d,agentInfo:_0x39f687,outputFormat:_0x2978c3,outputFile:_0x583723}=_0x472431,_0x20e3cb=_0x1ca388[_0x4ff223(0x168)],_0x36a0c0=loadLastTestRun();if(!_0x36a0c0)return console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x116))),console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x100))),0x1;if(_0x36a0c0[_0x4ff223(0x10d)][_0x4ff223(0x132)]!==_0x39f687[_0x4ff223(0x132)])return console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x36a0c0[_0x4ff223(0x10d)][_0x4ff223(0x132)]+_0x4ff223(0x130)+_0x39f687[_0x4ff223(0x132)]+'\x22.')),console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x191))),0x1;const _0x2db344=new Set(_0x36a0c0[_0x4ff223(0x10f)][_0x4ff223(0x17b)](_0x4f2465=>_0x4f2465[_0x4ff223(0x148)])),_0x46d49f=_0x24001d[_0x4ff223(0x10b)]['filter'](_0x33a563=>!_0x2db344['has'](_0x33a563[_0x4ff223(0x176)]));if(_0x46d49f[_0x4ff223(0x133)]>0x0&&_0x36a0c0[_0x4ff223(0x168)]!==_0x20e3cb)return console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x18a))),console[_0x4ff223(0x16f)](a5_0x520e02['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x36a0c0['site']+_0x4ff223(0x107)+_0x20e3cb+'\x22.')),console['log'](a5_0x520e02[_0x4ff223(0x142)]('Either\x20switch\x20to\x20the\x20\x22'+_0x36a0c0['site']+_0x4ff223(0x182))),0x1;const _0x5a81a7=_0x24001d['tests'][_0x4ff223(0x129)](_0x3fc48f=>_0x2db344[_0x4ff223(0x136)](_0x3fc48f['name'])),_0x130725=_0x46d49f;let _0x2d218a;try{_0x2d218a=await setupEvaluatorAgent(_0x3e84dc[_0x4ff223(0x154)],_0x1ca388[_0x4ff223(0x13e)]);}catch(_0xc96b8d){const _0x18659c=_0xc96b8d instanceof Error?_0xc96b8d[_0x4ff223(0x180)]:String(_0xc96b8d);return console[_0x4ff223(0x16f)](a5_0x520e02['red'](_0x4ff223(0x173)+_0x18659c)),0x1;}console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x13c)](_0x4ff223(0x151))),console[_0x4ff223(0x16f)](_0x4ff223(0x119)+a5_0x520e02[_0x4ff223(0x177)](_0x36a0c0[_0x4ff223(0x101)])),console['log'](_0x4ff223(0x15e)+a5_0x520e02[_0x4ff223(0x177)](_0x36a0c0['agent'][_0x4ff223(0x112)]+'/'+_0x36a0c0[_0x4ff223(0x10d)][_0x4ff223(0x132)]));_0x130725[_0x4ff223(0x133)]>0x0&&console['log'](_0x4ff223(0x16c)+a5_0x520e02['yellow'](_0x130725[_0x4ff223(0x133)]));console['log']();const _0x350a87=[],_0x174b21=Date[_0x4ff223(0x120)](),_0x13f0f3=createCommandSpinner('Re-evaluating...');if(_0x5a81a7[_0x4ff223(0x133)]>0x0)try{const _0xe6b6d6=await reevaluateFromCache(_0x3e84dc[_0x4ff223(0x154)],_0x36a0c0,{'tests':_0x5a81a7},{'evaluatorId':_0x2d218a,'onTestStart':(_0x377130,_0x1230aa,_0x2abc11)=>{const _0x16dd56=_0x4ff223;_0x13f0f3[_0x16dd56(0x137)]=_0x16dd56(0x141)+(_0x1230aa+0x1)+'/'+_0x2abc11+':\x20'+_0x377130+'...';if(!_0x13f0f3['isSpinning'])_0x13f0f3[_0x16dd56(0x146)]();},'onTestComplete':(_0x1cbfbb,_0x445905)=>{const _0x2c8247=_0x4ff223;_0x13f0f3[_0x2c8247(0x189)]();if(_0x445905[_0x2c8247(0x164)]===_0x2c8247(0x15b))console[_0x2c8247(0x16f)](a5_0x520e02[_0x2c8247(0x18f)](_0x2c8247(0x187)+_0x1cbfbb)+a5_0x520e02['dim'](_0x2c8247(0x121)));else _0x445905[_0x2c8247(0x164)]==='FAIL'?console['log'](a5_0x520e02[_0x2c8247(0xfe)](_0x2c8247(0x163)+_0x1cbfbb+'\x20-\x20'+_0x445905['reason'])+a5_0x520e02[_0x2c8247(0x142)]('\x20(cached)')):console[_0x2c8247(0x16f)](a5_0x520e02['red']('✗\x20ERROR:\x20'+_0x1cbfbb+_0x2c8247(0x181)+_0x445905[_0x2c8247(0x10e)]));_0x445905[_0x2c8247(0x102)]&&console['log'](a5_0x520e02[_0x2c8247(0x142)]('\x20\x20Conversation:\x20'+_0x445905['conversation_url'])),_0x350a87[_0x2c8247(0x110)](_0x445905);},'onTestSkipped':(_0x2cd7b0,_0x35dae9)=>{const _0x5ae3bc=_0x4ff223;_0x13f0f3[_0x5ae3bc(0x189)](),console[_0x5ae3bc(0x16f)](a5_0x520e02[_0x5ae3bc(0x12f)](_0x5ae3bc(0x14d)+_0x2cd7b0+_0x5ae3bc(0x181)+_0x35dae9));}});for(const _0x2ba575 of _0xe6b6d6){!_0x350a87[_0x4ff223(0x123)](_0x1829ad=>_0x1829ad[_0x4ff223(0x176)]===_0x2ba575[_0x4ff223(0x176)])&&_0x350a87['push'](_0x2ba575);}}catch(_0x589451){_0x13f0f3[_0x4ff223(0x189)]();const _0x8f9dc1=_0x589451 instanceof Error?_0x589451['message']:String(_0x589451);return console['log'](a5_0x520e02['red'](_0x4ff223(0x140)+_0x8f9dc1)),0x1;}_0x13f0f3[_0x4ff223(0x189)]();if(_0x130725[_0x4ff223(0x133)]>0x0){console[_0x4ff223(0x16f)](),console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x13c)]('Executing\x20new\x20tests...'));const {projectId:_0x501447,agentId:_0x43a7ac}=_0x36a0c0['agent'];for(const _0x3263b0 of _0x130725){console[_0x4ff223(0x16f)](_0x4ff223(0x18e)+a5_0x520e02[_0x4ff223(0x177)](_0x3263b0[_0x4ff223(0x176)]));const _0x1cb763=createCommandSpinner(_0x4ff223(0x122)+_0x3263b0[_0x4ff223(0x11b)][_0x4ff223(0x133)]+_0x4ff223(0x162));_0x1cb763[_0x4ff223(0x146)]();try{const {result:_0x51455c}=await runTest(_0x3e84dc[_0x4ff223(0x154)],_0x3263b0,{'agentId':_0x43a7ac,'projectId':_0x501447,'site':_0x36a0c0['site'],'noEval':![],'evaluatorId':_0x2d218a,'onRoundStart':(_0x4daf3f,_0x2a26aa)=>{const _0x48007f=_0x4ff223;_0x1cb763[_0x48007f(0x137)]='Round\x20'+(_0x4daf3f+0x1)+'/'+_0x2a26aa+_0x48007f(0x162);},'onRoundComplete':(_0x3e932b,_0x589c73,_0x55e81c)=>{const _0x43f815=_0x4ff223,_0x40db8e=formatElapsed(_0x589c73);_0x55e81c?console[_0x43f815(0x16f)](_0x43f815(0x150)+(_0x3e932b+0x1)+'/'+_0x3263b0[_0x43f815(0x11b)][_0x43f815(0x133)]+_0x43f815(0x165)+a5_0x520e02[_0x43f815(0x18f)]('✓')+'\x20('+_0x40db8e+')'):console[_0x43f815(0x16f)]('\x20\x20Round\x20'+(_0x3e932b+0x1)+'/'+_0x3263b0['rounds'][_0x43f815(0x133)]+_0x43f815(0x165)+a5_0x520e02[_0x43f815(0xfe)]('✗'));},'onEvaluationStart':()=>{const _0x4ffda6=_0x4ff223;_0x1cb763[_0x4ffda6(0x137)]=_0x4ffda6(0x174);},'onEvaluationComplete':_0x48e6cc=>{const _0x5d091b=_0x4ff223,_0x4a7e64=formatElapsed(_0x48e6cc);console[_0x5d091b(0x16f)]('\x20\x20Evaluating...\x20'+a5_0x520e02['green']('✓')+'\x20('+_0x4a7e64+')');}});_0x1cb763[_0x4ff223(0x189)](),_0x350a87[_0x4ff223(0x110)](_0x51455c);if(_0x51455c[_0x4ff223(0x164)]===_0x4ff223(0x15b))console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0x18f)]('✓\x20PASS:\x20'+_0x51455c['reason'])+a5_0x520e02['dim'](_0x4ff223(0x193)));else _0x51455c[_0x4ff223(0x164)]==='FAIL'?console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x163)+_0x51455c[_0x4ff223(0x10e)])+a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x193))):console['log'](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x11c)+_0x51455c[_0x4ff223(0x10e)]));_0x51455c[_0x4ff223(0x102)]&&console['log'](a5_0x520e02[_0x4ff223(0x142)](_0x4ff223(0x17c)+_0x51455c[_0x4ff223(0x102)]));}catch(_0x596ac6){_0x1cb763[_0x4ff223(0x189)]();const _0x21f881=_0x596ac6 instanceof Error?_0x596ac6[_0x4ff223(0x180)]:String(_0x596ac6);console[_0x4ff223(0x16f)](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x11c)+_0x21f881)),_0x350a87[_0x4ff223(0x110)]({'name':_0x3263b0[_0x4ff223(0x176)],'status':'ERROR','reason':_0x21f881,'timestamp':new Date()[_0x4ff223(0x14e)](),'duration_ms':0x0});}}}console[_0x4ff223(0x16f)]();const _0x3692fc=Date[_0x4ff223(0x120)]()-_0x174b21,_0x417a89=_0x350a87[_0x4ff223(0x129)](_0x574bbe=>_0x574bbe[_0x4ff223(0x164)]===_0x4ff223(0x15b))['length'],_0xdaa0e9=_0x350a87[_0x4ff223(0x129)](_0x536baf=>_0x536baf[_0x4ff223(0x164)]===_0x4ff223(0x139))[_0x4ff223(0x133)],_0x3ebeee=_0x350a87['filter'](_0x365ab9=>_0x365ab9[_0x4ff223(0x164)]===_0x4ff223(0x167))[_0x4ff223(0x133)];console[_0x4ff223(0x16f)]('━'[_0x4ff223(0x111)](0x3c)),console[_0x4ff223(0x16f)](_0x4ff223(0x13d)),console[_0x4ff223(0x16f)]('━'['repeat'](0x3c)),console[_0x4ff223(0x16f)](_0x4ff223(0x143)+_0x350a87['length']),console['log'](_0x4ff223(0x12c)+a5_0x520e02[_0x4ff223(0x18f)](_0x417a89)),console[_0x4ff223(0x16f)]('Failed:\x20\x20\x20'+a5_0x520e02[_0x4ff223(0xfe)](_0xdaa0e9));_0x3ebeee>0x0&&console[_0x4ff223(0x16f)](_0x4ff223(0x12e)+a5_0x520e02[_0x4ff223(0xfe)](_0x3ebeee));console[_0x4ff223(0x16f)](_0x4ff223(0x108)+formatElapsed(_0x3692fc)),console[_0x4ff223(0x16f)]('━'['repeat'](0x3c));const _0x28790f={'summary':{'total':_0x350a87[_0x4ff223(0x133)],'passed':_0x417a89,'failed':_0xdaa0e9,'errors':_0x3ebeee>0x0?_0x3ebeee:undefined,'duration_ms':_0x3692fc},'tests':_0x350a87,'agent':{'project':_0x39f687['projectName'],'name':_0x39f687['agentName'],'site':_0x20e3cb},'timestamp':new Date(_0x174b21)[_0x4ff223(0x14e)]()};if(_0x2978c3!=='table'||_0x583723){const _0x349c62=formatResults(_0x28790f,_0x2978c3);if(_0x583723)try{a5_0x24e656[_0x4ff223(0x17d)](_0x583723,_0x349c62,_0x4ff223(0x186)),console[_0x4ff223(0x16f)](),console['log'](a5_0x520e02['dim'](_0x4ff223(0x126)+_0x583723));}catch(_0x9318d0){return console[_0x4ff223(0x16f)](),console['log'](a5_0x520e02[_0x4ff223(0xfe)](_0x4ff223(0x16e)+_0x9318d0)),0x1;}else console[_0x4ff223(0x16f)](),console[_0x4ff223(0x16f)](_0x349c62);}const _0x34176c=_0x350a87[_0x4ff223(0x129)](_0x583d4f=>_0x583d4f['status']!=='PASS');return _0x34176c[_0x4ff223(0x133)]>0x0?0x1:0x0;}}function a5_0x33cc(){const _0x20d607=['toISOString','Running\x20agent\x20tests...','\x20\x20Round\x20','Re-evaluating\x20cached\x20test\x20run...','2656610AMMZgh','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','llm','basename','Conversation\x20URL:\x20','executeReeval','/<agent-name>','multiple_agents','existsSync','PASS','77ITQrUo','Run\x20tests\x20for\x20an\x20LLM\x20agent','Agent:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','join','Tests\x20found:\x20',':\x20Sending\x20user\x20input...','✗\x20FAIL:\x20','status','...\x20','jsonl','ERROR','site','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','...','\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)','New\x20tests\x20to\x20execute:\x20','llmProject','Error\x20writing\x20output\x20file:\x20','log','table','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Running\x20test:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Evaluating\x20response...','resolveAgentId','name','white','substring','add','some','map','\x20\x20Conversation:\x20','writeFileSync','\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','2396msKCCp','message','\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','eval','131ucDujr','\x20\x20Project:\x20','utf-8','✓\x20PASS:\x20','\x20\x20Agent:\x20','stop','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','dryRun','includes','forEach','Running:\x20','green','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Test\x20','\x20(new)','3169122gvtSXj','red','split','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','timestamp','conversation_url','output','No\x20tests\x20have\x20tags\x20defined.','3415vqQLbV','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22,\x20but\x20current\x20site\x20is\x20\x22','Duration:\x20','5735272yqFcdf','Failed\x20Tests:','tests','execute','agent','reason','conversations','push','repeat','projectName','Available\x20tags:\x20','31938GlHdai','\x22:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Test\x20Configuration:','404','Cached\x20run\x20from:\x20','toLowerCase','rounds','✗\x20ERROR:\x20','no_tests','projectDir','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','now','\x20(cached)','Round\x201/','find','\x20\x20-\x20','source','Output\x20written\x20to:\x20','Site:\x20','size','filter','resolveProjectId','json','Passed:\x20\x20\x20','tsv','Errors:\x20\x20\x20','yellow','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20','agentName','length','Round\x20','test.yml','has','text','11070432YIGSzU','FAIL','16690auuqEF','tags','cyan','Re-evaluation\x20Summary','verbose','1288OwqynJ','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Re-evaluating\x20','dim','Total:\x20\x20\x20\x20','testYmlPath','no_context','start','trim','testName','Failed:\x20\x20\x20','description','not\x20found','Available\x20tests:\x20','⚠\x20SKIPPED:\x20'];a5_0x33cc=function(){return _0x20d607;};return a5_0x33cc();}
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x18eaad=a6_0x3cda;(function(_0x4dc255,_0x17eabe){const _0x2a71eb=a6_0x3cda,_0x221c14=_0x4dc255();while(!![]){try{const _0x30a671=parseInt(_0x2a71eb(0x1d3))/0x1+-parseInt(_0x2a71eb(0x1d4))/0x2+-parseInt(_0x2a71eb(0x1ca))/0x3*(parseInt(_0x2a71eb(0x1ee))/0x4)+-parseInt(_0x2a71eb(0x1de))/0x5+-parseInt(_0x2a71eb(0x1ef))/0x6*(-parseInt(_0x2a71eb(0x1f2))/0x7)+parseInt(_0x2a71eb(0x1eb))/0x8*(-parseInt(_0x2a71eb(0x1ea))/0x9)+-parseInt(_0x2a71eb(0x1c3))/0xa*(-parseInt(_0x2a71eb(0x1d1))/0xb);if(_0x30a671===_0x17eabe)break;else _0x221c14['push'](_0x221c14['shift']());}catch(_0x277165){_0x221c14['push'](_0x221c14['shift']());}}}(a6_0x42d6,0x7bd2f));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x3cda(_0x99dbfb,_0x287399){_0x99dbfb=_0x99dbfb-0x1c3;const _0x42d6d4=a6_0x42d6();let _0x3cdac2=_0x42d6d4[_0x99dbfb];return _0x3cdac2;}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_0x42d6(){const _0x47f26c=['message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','GET','cas','join','51KkarUv','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','has','x-trino-user','cookie','type','verbose','25487vBnwYX','<\x20HTTP/1.1\x20','115892lTtRqn','602674vQXoEu','\x22.\x20','status','substring','color','headers','PUT','Error:\x20','proxy-authorization','llm-proxy','3226955KKWQVP','body','toLowerCase','data','x-xsrf-token','error','Endpoint\x20must\x20start\x20with\x20/:\x20','.\x20Valid\x20methods:\x20','\x0aStack\x20trace:\x0a','us01','Invalid\x20API\x20type:\x20','isArray','9YfJHdT','6390568jnGnXU','log','DELETE','66964iexvbq','414EMxYzO','file','stack','59017BQQZXi','site','indexOf','length','noColor','name','Invalid\x20HTTP\x20method:\x20','authorization','includes','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','.\x20Valid\x20types:\x20','toUpperCase','api','header','execute','workflow','method','cdp','set-cookie','Results\x20saved\x20to\x20','trino','startsWith','trim','set-cookie2','output','7940jagfow','x-auth-token'];a6_0x42d6=function(){return _0x47f26c;};return a6_0x42d6();}const SENSITIVE_HEADERS=new Set([a6_0x18eaad(0x1f9),a6_0x18eaad(0x1dc),a6_0x18eaad(0x1ce),a6_0x18eaad(0x204),a6_0x18eaad(0x209),a6_0x18eaad(0x1e2),a6_0x18eaad(0x1c4),a6_0x18eaad(0x1cd)]);function isSensitiveHeader(_0x1a9be9){const _0x237ac4=a6_0x18eaad;return SENSITIVE_HEADERS[_0x237ac4(0x1cc)](_0x1a9be9[_0x237ac4(0x1e0)]());}function parseHeader(_0x12129c){const _0x416fb8=a6_0x18eaad,_0x37b457=_0x12129c[_0x416fb8(0x1f4)](':');if(_0x37b457===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x12129c+_0x416fb8(0x1d5)+_0x416fb8(0x1c6));const _0x3996d7=_0x12129c['substring'](0x0,_0x37b457)[_0x416fb8(0x208)](),_0x7c2376=_0x12129c[_0x416fb8(0x1d7)](_0x37b457+0x1)[_0x416fb8(0x208)]();if(!_0x3996d7)throw new Error(_0x416fb8(0x1fb)+_0x12129c+'\x22');return[_0x3996d7,_0x7c2376];}export class ApiCommand extends BaseCommand{[a6_0x18eaad(0x1f7)]=a6_0x18eaad(0x1fe);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x37803b){const _0x239d24=a6_0x18eaad,{args:_0x5ca335,options:_0xcbfb90}=_0x37803b,_0x32ed45=_0xcbfb90;if(_0x5ca335[_0x239d24(0x1f5)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x48d515=_0x5ca335[0x0];if(!_0x48d515[_0x239d24(0x207)]('/'))return _0x239d24(0x1e4)+_0x48d515;const _0x166098=_0x32ed45[_0x239d24(0x1e1)],_0x2e9280=_0x32ed45[_0x239d24(0x1f0)];if(_0x166098&&_0x2e9280)return _0x239d24(0x1cb);const _0x224a32=_0x32ed45[_0x239d24(0x202)]||_0x239d24(0x1c7),_0x56fa1b=['GET','POST',_0x239d24(0x1da),_0x239d24(0x1ed),'PATCH'];if(!_0x56fa1b[_0x239d24(0x1fa)](_0x224a32[_0x239d24(0x1fd)]()))return _0x239d24(0x1f8)+_0x224a32+_0x239d24(0x1e5)+_0x56fa1b['join'](',\x20');const _0x136535=_0x32ed45['type']||'td',_0x2b49a6=['td',_0x239d24(0x203),_0x239d24(0x201),_0x239d24(0x206),'llm',_0x239d24(0x1dd),_0x239d24(0x1c8)];if(!_0x2b49a6[_0x239d24(0x1fa)](_0x136535))return _0x239d24(0x1e8)+_0x136535+_0x239d24(0x1fc)+_0x2b49a6[_0x239d24(0x1c9)](',\x20');return undefined;}async[a6_0x18eaad(0x200)](_0x406a35){const _0x4d7070=a6_0x18eaad,{options:_0x501568,args:_0x3d5aa7,tdx:_0x1ec3c9}=_0x406a35,_0x5dd354=_0x501568,_0x124e30=_0x3d5aa7[0x0],_0x524bc9=(_0x5dd354['method']||_0x4d7070(0x1c7))['toUpperCase'](),_0x309889=_0x5dd354[_0x4d7070(0x1e1)],_0xdb38f2=_0x5dd354[_0x4d7070(0x1f0)],_0x5c23ac=_0x5dd354[_0x4d7070(0x1ff)],_0x20c4c1=_0x5dd354[_0x4d7070(0x1cf)]||'td';try{const _0x32cc7c={};if(_0x5c23ac){const _0x140d43=Array[_0x4d7070(0x1e9)](_0x5c23ac)?_0x5c23ac:[_0x5c23ac];for(const _0x1bf9f5 of _0x140d43){const [_0x597781,_0x20fbdb]=parseHeader(_0x1bf9f5);_0x32cc7c[_0x597781]=_0x20fbdb;}}let _0x57e04a;if(_0x309889)_0x57e04a=_0x309889;else{if(_0xdb38f2)try{_0x57e04a=RawAPI['readBodyFromFile'](_0xdb38f2);}catch(_0x575515){return console['error'](_0x4d7070(0x1db)+(_0x575515 instanceof Error?_0x575515['message']:String(_0x575515))),0x1;}}const _0x2330c1={'method':_0x524bc9,'apiType':_0x20c4c1,'includeHeaders':_0x501568[_0x4d7070(0x1d0)]};_0x57e04a&&(_0x2330c1[_0x4d7070(0x1df)]=_0x57e04a);Object['keys'](_0x32cc7c)[_0x4d7070(0x1f5)]>0x0&&(_0x2330c1[_0x4d7070(0x1d9)]=_0x32cc7c);if(_0x501568[_0x4d7070(0x1d0)]){const _0x416060=resolveSite(_0x501568[_0x4d7070(0x1f3)]??_0x4d7070(0x1e7)),_0xf69d49=getEndpoint(_0x416060,_0x20c4c1),_0x377134=''+_0xf69d49+_0x124e30;console[_0x4d7070(0x1e3)]('>\x20'+_0x524bc9+'\x20'+_0x377134);const _0x487efb=getAuthHeaders(_0x416060),_0x18f8a4={..._0x487efb,..._0x32cc7c};for(const [_0xa037fc,_0x25dd0e]of Object['entries'](_0x18f8a4)){!isSensitiveHeader(_0xa037fc)&&console['error']('>\x20'+_0xa037fc+':\x20'+_0x25dd0e);}_0x57e04a&&console['error']('>'),console[_0x4d7070(0x1e3)]('');}const _0x32cfec=await _0x1ec3c9['api']['request'](_0x124e30,_0x2330c1);if(_0x501568[_0x4d7070(0x1d0)]&&_0x32cfec[_0x4d7070(0x1d9)]){console['error'](_0x4d7070(0x1d2)+_0x32cfec[_0x4d7070(0x1d6)]);for(const [_0x215ba9,_0x127ab1]of Object['entries'](_0x32cfec[_0x4d7070(0x1d9)])){!isSensitiveHeader(_0x215ba9)&&console[_0x4d7070(0x1e3)]('<\x20'+_0x215ba9+':\x20'+_0x127ab1);}console['error']('');}const _0xc1b384=Boolean(_0x501568[_0x4d7070(0x20a)]),_0x5baa26={'color':_0x501568['color'],'noColor':_0x501568[_0x4d7070(0x1f6)]||_0xc1b384&&!_0x501568[_0x4d7070(0x1d8)]},_0x23b73c=colorizeJSON(_0x32cfec['data'],_0x5baa26);return _0x501568[_0x4d7070(0x20a)]?(writeFileSync(_0x501568[_0x4d7070(0x20a)],_0x23b73c),console[_0x4d7070(0x1e3)](_0x4d7070(0x205)+_0x501568[_0x4d7070(0x20a)])):console[_0x4d7070(0x1ec)](_0x23b73c),0x0;}catch(_0x320288){return _0x320288 instanceof Error?(console[_0x4d7070(0x1e3)](_0x4d7070(0x1db)+_0x320288[_0x4d7070(0x1c5)]),_0x501568[_0x4d7070(0x1d0)]&&_0x320288[_0x4d7070(0x1f1)]&&console[_0x4d7070(0x1e3)](_0x4d7070(0x1e6)+_0x320288[_0x4d7070(0x1f1)])):console['error'](_0x4d7070(0x1db)+String(_0x320288)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x2f4c21=a7_0x1a61;(function(_0x54a1fb,_0x3f5d39){const _0x183681=a7_0x1a61,_0x319669=_0x54a1fb();while(!![]){try{const _0x489be0=-parseInt(_0x183681(0x210))/0x1*(parseInt(_0x183681(0x200))/0x2)+parseInt(_0x183681(0x20d))/0x3+parseInt(_0x183681(0x22d))/0x4+parseInt(_0x183681(0x213))/0x5+parseInt(_0x183681(0x1eb))/0x6*(parseInt(_0x183681(0x20c))/0x7)+parseInt(_0x183681(0x1fa))/0x8+-parseInt(_0x183681(0x21a))/0x9*(parseInt(_0x183681(0x212))/0xa);if(_0x489be0===_0x3f5d39)break;else _0x319669['push'](_0x319669['shift']());}catch(_0x4d50d8){_0x319669['push'](_0x319669['shift']());}}}(a7_0x5a9b,0x1c3ec));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';function a7_0x5a9b(){const _0x1fb706=['Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','bold','trim','error','jobs','9WKQIHE','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','API\x20key\x20cannot\x20be\x20empty','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','✗\x20Validation\x20failed:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','yellow','\x0aSetup\x20cancelled','message','create','/app/mp/ak','OAuth\x20tokens','accountName','first_name','profile','Opening\x20browser\x20for\x20authentication...','Name:\x20','✓\x20Authentication\x20successful\x0a','827532atfqxu','text','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Remove\x20API\x20key\x20from\x20system\x20keychain','For\x20scripts\x20or\x20headless\x20servers','API\x20key','✓\x20Default\x20site\x20set\x20to\x20','\x20(site:\x20','logLevel','apiKey','\x20and\x20','\x20--profile\x20','join','\x27\x20registered','name','\x20(profile:\x20','Print\x20the\x20current\x20OAuth\x20access\x20token','tdx:\x20auth\x20clear','status','N/A','red','No\x20credential\x20found','Choose\x20how\x20to\x20sign\x20in:','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','✓\x20Profile\x20\x27','description','ERROR','tdx:\x20auth\x20setup','No\x20credentials\x20found\x20in\x20keychain','Use\x20an\x20API\x20key','Setup\x20cancelled','tdx\x20profile:\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','312084PoExRs','\x20\x20user_id:','\x20for\x20profile:\x20','Validating\x20API\x20key...','\x20\x20tdx','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','method','log','Credential\x20type:\x20OAuth','auth:token','Enter\x20your\x20TD\x20API\x20key:','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','getUserInfo','✓\x20Signed\x20in\x20successfully','1616936WNZOuJ','/oauth/authorize','auth:clear','filter','Validating\x20OAuth\x20tokens...','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','23062SltZnL','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','all','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','execute','last_name','site','dim','auth:setup','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','email','7zzxHlf','356421rVqBti','password','oauth','11nONDuH','account_id','4863400nPdHai','745260xUNmJq','warn'];a7_0x5a9b=function(){return _0x1fb706;};return a7_0x5a9b();}import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x1a61(_0x19fd1c,_0x51e06e){_0x19fd1c=_0x19fd1c-0x1db;const _0x5a9b0d=a7_0x5a9b();let _0x1a61d4=_0x5a9b0d[_0x19fd1c];return _0x1a61d4;}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x484d36 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_0x58010c from'chalk';export async function runOAuthLoginFlow(_0x5071b6,_0x4d497f,_0xa8a82c,_0x5c34db){const _0x2df7ec=a7_0x1a61,_0x4bf3da=await isKeychainAvailable();if(!_0x4bf3da)throw new Error(_0x2df7ec(0x22f)+_0x2df7ec(0x20a));let _0x413386=_0x5c34db?.[_0x2df7ec(0x227)];if(!_0x413386){const _0x4d72ab=await a7_0x484d36({'type':_0x2df7ec(0x22e),'name':_0x2df7ec(0x227),'message':_0x2df7ec(0x215)});if(_0x4d72ab[_0x2df7ec(0x227)]===undefined)throw new Error(_0x2df7ec(0x1e8));_0x413386=_0x4d72ab[_0x2df7ec(0x227)][_0x2df7ec(0x217)]()||undefined;}const _0x40da0b=getConsoleUrl(_0x5071b6);console[_0x2df7ec(0x1f2)](_0x2df7ec(0x22a));_0x413386?console[_0x2df7ec(0x1f2)]('\x20\x20'+_0x40da0b+'/users/initiate_sso\x20(account:\x20'+_0x413386+')'):console[_0x2df7ec(0x1f2)]('\x20\x20'+_0x40da0b+_0x2df7ec(0x1fb));console[_0x2df7ec(0x1f2)](_0x2df7ec(0x230));const _0x5bf498=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x447f09=await startOAuthFlow(_0x5071b6,{'accountName':_0x413386,'proxy':_0x5bf498});console[_0x2df7ec(0x1f2)](_0x2df7ec(0x1fe));const _0x5b27f6=TDX[_0x2df7ec(0x224)]({'site':_0x5071b6,'accessToken':_0x447f09['access_token'],'logLevel':_0xa8a82c??LogLevel[_0x2df7ec(0x1e4)]}),_0x20bd8b=await _0x5b27f6[_0x2df7ec(0x219)]['getUserInfo']();console[_0x2df7ec(0x1f2)](a7_0x58010c['green'](_0x2df7ec(0x1f9))),console[_0x2df7ec(0x1f2)]('\x20\x20'+a7_0x58010c['cyan'](_0x5071b6+':'+_0x20bd8b[_0x2df7ec(0x211)])+_0x2df7ec(0x1ec)+_0x20bd8b['id']+'\x20\x20('+_0x20bd8b[_0x2df7ec(0x20b)]+')');!_0x413386&&(console[_0x2df7ec(0x1f2)](a7_0x58010c[_0x2df7ec(0x207)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x2df7ec(0x1f2)](a7_0x58010c['dim'](_0x2df7ec(0x21c))),console[_0x2df7ec(0x1f2)](a7_0x58010c[_0x2df7ec(0x207)](_0x2df7ec(0x1ea))));await saveOAuthTokens(_0x447f09,_0x4d497f),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x1e1)+(_0x4d497f?_0x2df7ec(0x23d)+_0x4d497f+')':''));if(_0x4d497f){const _0x5a3174={'site':_0x5071b6};saveProfileToUserConfig(_0x4d497f,_0x5a3174),console[_0x2df7ec(0x1f2)]('✓\x20Profile\x20\x27'+_0x4d497f+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x5071b6),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x234)+_0x5071b6);const _0x29a225=_0x4d497f?_0x2df7ec(0x239)+_0x4d497f:'';console[_0x2df7ec(0x1f2)](),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x220)),console[_0x2df7ec(0x1f2)](_0x2df7ec(0x1ef)+_0x29a225+_0x2df7ec(0x203)),console['log'](_0x2df7ec(0x1ef)+_0x29a225+_0x2df7ec(0x201));}export async function promptAuthMethod(){const _0x3bc00d=a7_0x1a61,_0x213303=await a7_0x484d36({'type':'select','name':_0x3bc00d(0x1f1),'message':_0x3bc00d(0x1e0),'choices':[{'title':_0x3bc00d(0x209),'description':_0x3bc00d(0x21e),'value':_0x3bc00d(0x20f)},{'title':_0x3bc00d(0x1e7),'description':_0x3bc00d(0x232),'value':'apikey'}]});return _0x213303[_0x3bc00d(0x1f1)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x2f4c21(0x23c)]=a7_0x2f4c21(0x208);[a7_0x2f4c21(0x1e3)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x44ed12){const _0x1af374=a7_0x2f4c21,{options:_0x4eecf2}=_0x44ed12,_0x403317=_0x4eecf2[_0x1af374(0x229)];console[_0x1af374(0x1f2)](a7_0x58010c[_0x1af374(0x216)](_0x1af374(0x1e5)));const _0x52f828=_0x4eecf2[_0x1af374(0x206)]||'us01',_0x2c9234=await promptSiteSelection(_0x52f828,_0x403317,_0x1af374(0x1e8));if(!_0x2c9234)return 0x1;const _0x471b83=resolveSite(_0x2c9234),_0x2299ae=await promptAuthMethod();if(!_0x2299ae)return console[_0x1af374(0x1f2)](_0x1af374(0x222)),0x1;if(_0x2299ae===_0x1af374(0x20f)){const {accountName:_0x3dab90}=_0x4eecf2;return await runOAuthLoginFlow(_0x471b83,_0x403317,_0x4eecf2[_0x1af374(0x236)]??LogLevel[_0x1af374(0x1e4)],{'accountName':_0x3dab90}),0x0;}console[_0x1af374(0x1f2)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x471b83),console[_0x1af374(0x1f2)](_0x1af374(0x1f6)),console[_0x1af374(0x1f2)]('\x20\x20'+getConsoleUrl(_0x471b83,_0x1af374(0x225)));const _0x51587d=await a7_0x484d36({'type':_0x1af374(0x20e),'name':'apiKey','message':_0x1af374(0x1f5),'validate':_0x28776f=>{const _0x3f22f0=_0x1af374;if(!_0x28776f||!_0x28776f[_0x3f22f0(0x217)]())return _0x3f22f0(0x21d);return!![];}});if(!_0x51587d[_0x1af374(0x237)])return console['log'](_0x1af374(0x222)),0x1;const _0x3f94d1=_0x51587d[_0x1af374(0x237)];console[_0x1af374(0x1f2)](_0x1af374(0x1ee));try{const _0x26c3c9=TDX[_0x1af374(0x224)]({'site':_0x471b83,'apiKey':_0x3f94d1[_0x1af374(0x217)](),'logLevel':_0x4eecf2[_0x1af374(0x236)]??LogLevel['ERROR']}),_0x120fc3=await _0x26c3c9['jobs']['getUserInfo']();console[_0x1af374(0x1f2)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x120fc3[_0x1af374(0x20b)]+')');const _0x2be9a4=await isKeychainAvailable();_0x2be9a4?(await saveAPIKeyAsync(_0x3f94d1[_0x1af374(0x217)](),_0x471b83,_0x403317),console[_0x1af374(0x1f2)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x403317?'\x20(profile:\x20'+_0x403317+')':''))):(console['warn'](a7_0x58010c[_0x1af374(0x221)](_0x1af374(0x1f0))),console[_0x1af374(0x214)](a7_0x58010c['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x403317){const _0x54d996={'site':_0x471b83};saveProfileToUserConfig(_0x403317,_0x54d996),console[_0x1af374(0x1f2)](_0x1af374(0x1e2)+_0x403317+_0x1af374(0x23b));}else saveDefaultSiteToUserConfig(_0x471b83),console[_0x1af374(0x1f2)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x471b83);const _0x4cbd4b=_0x403317?'\x20--profile\x20'+_0x403317:'';return console[_0x1af374(0x1f2)](),console[_0x1af374(0x1f2)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x1af374(0x1ef)+_0x4cbd4b+_0x1af374(0x203)),console['log']('\x20\x20tdx'+_0x4cbd4b+_0x1af374(0x201)),0x0;}catch(_0x548073){if(_0x548073 instanceof HTTPClientError&&_0x548073[_0x1af374(0x1dc)]===0x191)return printAuthError(_0x548073),0x1;return console[_0x1af374(0x218)](a7_0x58010c[_0x1af374(0x1de)](_0x1af374(0x21f)+(_0x548073 instanceof Error?_0x548073[_0x1af374(0x223)]:String(_0x548073)))),console[_0x1af374(0x218)](_0x1af374(0x21b)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x2f4c21(0x1f7);[a7_0x2f4c21(0x1e3)]=a7_0x2f4c21(0x1ff);async[a7_0x2f4c21(0x204)](_0x11b45d){const _0xf253d3=a7_0x2f4c21,{options:_0x4103ae,tdx:_0x39019f}=_0x11b45d,_0x3ad28c=_0x4103ae[_0xf253d3(0x206)],_0x321640=_0x4103ae[_0xf253d3(0x229)],_0x3a707b=_0x321640?_0x321640:_0xf253d3(0x1dd);console[_0xf253d3(0x1f2)](_0xf253d3(0x1e9)+_0x3a707b+_0xf253d3(0x235)+_0x3ad28c+')');const _0x26ded3=await getOAuthTokens(_0x321640);if(_0x26ded3)console[_0xf253d3(0x1f2)](_0xf253d3(0x1f3)),console['log']('Read\x20credential\x20from\x20keychain'+(_0x321640?'\x20(profile:\x20'+_0x321640+')':''));else{const _0x2c1ce6=await resolveAPIKeyAsync(_0x3ad28c,_0x321640);if(_0x2c1ce6){const {source:_0x4f22ea,isDeprecated:_0x39717d}=_0x2c1ce6,_0x21d3d7='Read\x20credential\x20from\x20'+_0x4f22ea;console[_0xf253d3(0x1f2)](_0x39717d?a7_0x58010c[_0xf253d3(0x221)](_0x21d3d7):_0x21d3d7);}else console['log'](a7_0x58010c[_0xf253d3(0x221)](_0xf253d3(0x1df)));}try{const _0x14a0eb=await _0x39019f[_0xf253d3(0x219)][_0xf253d3(0x1f8)]();return console[_0xf253d3(0x1f2)](a7_0x58010c['green'](_0xf253d3(0x22c))),console[_0xf253d3(0x1f2)]('User:\x20'+_0x14a0eb['email']),(_0x14a0eb[_0xf253d3(0x228)]||_0x14a0eb[_0xf253d3(0x205)])&&console[_0xf253d3(0x1f2)](_0xf253d3(0x22b)+[_0x14a0eb['first_name'],_0x14a0eb[_0xf253d3(0x205)]][_0xf253d3(0x1fd)](Boolean)[_0xf253d3(0x23a)]('\x20')),0x0;}catch(_0x1b4907){return _0x1b4907 instanceof HTTPClientError&&_0x1b4907[_0xf253d3(0x1dc)]===0x191?printAuthError(_0x1b4907,!![],_0x321640):console[_0xf253d3(0x218)](a7_0x58010c[_0xf253d3(0x1de)](_0xf253d3(0x21f)+(_0x1b4907 instanceof Error?_0x1b4907[_0xf253d3(0x223)]:String(_0x1b4907)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x2f4c21(0x23c)]=a7_0x2f4c21(0x1f4);[a7_0x2f4c21(0x1e3)]=a7_0x2f4c21(0x23e);async[a7_0x2f4c21(0x204)](_0x71a947){const _0xcc864e=a7_0x2f4c21,{options:_0x1d7197}=_0x71a947,_0xa67c10=await resolveOAuthAccessToken({'site':resolveSite(_0x1d7197[_0xcc864e(0x206)]||'us01'),'profile':_0x1d7197[_0xcc864e(0x229)],'proxy':loadGlobalProxy()});return console[_0xcc864e(0x1f2)](_0xa67c10),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x2f4c21(0x23c)]=a7_0x2f4c21(0x1fc);[a7_0x2f4c21(0x1e3)]=a7_0x2f4c21(0x231);async['execute'](_0x4f83a1){const _0x48fcfe=a7_0x2f4c21,{options:_0x3b29e9}=_0x4f83a1,_0x4a2a1a=_0x3b29e9[_0x48fcfe(0x229)];console[_0x48fcfe(0x1f2)](a7_0x58010c[_0x48fcfe(0x216)](_0x48fcfe(0x1db)));const _0x58e960=await isKeychainAvailable();if(!_0x58e960)return console['error'](a7_0x58010c[_0x48fcfe(0x1de)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x2a0e0a,_0x145f99]=await Promise[_0x48fcfe(0x202)]([deleteKeychainAPIKey(_0x4a2a1a),deleteOAuthTokens(_0x4a2a1a)]);if(_0x2a0e0a||_0x145f99){clearCredentialCache();const _0xea648=[_0x2a0e0a&&_0x48fcfe(0x233),_0x145f99&&_0x48fcfe(0x226)]['filter'](Boolean)[_0x48fcfe(0x23a)](_0x48fcfe(0x238));return console[_0x48fcfe(0x1f2)]('✓\x20'+_0xea648+'\x20removed\x20from\x20keychain'+(_0x4a2a1a?'\x20(profile:\x20'+_0x4a2a1a+')':'')),0x0;}else return console[_0x48fcfe(0x1f2)](_0x48fcfe(0x1e6)+(_0x4a2a1a?_0x48fcfe(0x1ed)+_0x4a2a1a:'')),0x1;}}
|
|
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;}}
|