@treasuredata/tdx 2026.3.31 → 2026.3.32
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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-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-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/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.d.ts +36 -0
- package/dist/commands/work-command.d.ts.map +1 -0
- package/dist/commands/work-command.js +1 -0
- package/dist/commands/work-command.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/session.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/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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/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/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/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.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/index.d.ts +2 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +146 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -0
- package/dist/sdk/types/workspace.js +1 -0
- package/dist/sdk/types/workspace.js.map +1 -0
- 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/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/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.d.ts +28 -0
- package/dist/sdk/workspace/frontmatter.d.ts.map +1 -0
- package/dist/sdk/workspace/frontmatter.js +1 -0
- package/dist/sdk/workspace/frontmatter.js.map +1 -0
- package/dist/sdk/workspace/git.d.ts +55 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -0
- package/dist/sdk/workspace/git.js +1 -0
- package/dist/sdk/workspace/git.js.map +1 -0
- package/dist/sdk/workspace/index.d.ts +149 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -0
- package/dist/sdk/workspace/index.js +1 -0
- package/dist/sdk/workspace/index.js.map +1 -0
- package/dist/sdk/workspace/skills.d.ts +34 -0
- package/dist/sdk/workspace/skills.d.ts.map +1 -0
- package/dist/sdk/workspace/skills.js +1 -0
- package/dist/sdk/workspace/skills.js.map +1 -0
- package/dist/sdk/workspace/templates.d.ts +17 -0
- package/dist/sdk/workspace/templates.d.ts.map +1 -0
- package/dist/sdk/workspace/templates.js +1 -0
- package/dist/sdk/workspace/templates.js.map +1 -0
- package/dist/sdk/workspace/wikilinks.d.ts +44 -0
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -0
- package/dist/sdk/workspace/wikilinks.js +1 -0
- package/dist/sdk/workspace/wikilinks.js.map +1 -0
- 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/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/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_0x4fdd96=a3_0x2f70;(function(_0x499b59,_0x15d9f5){const _0x3c9170=a3_0x2f70,_0x5e9886=_0x499b59();while(!![]){try{const _0x40fcf9=parseInt(_0x3c9170(0x206))/0x1*(parseInt(_0x3c9170(0x1f0))/0x2)+-parseInt(_0x3c9170(0x200))/0x3*(parseInt(_0x3c9170(0x204))/0x4)+-parseInt(_0x3c9170(0x1e5))/0x5*(-parseInt(_0x3c9170(0x201))/0x6)+-parseInt(_0x3c9170(0x1fe))/0x7+parseInt(_0x3c9170(0x1ff))/0x8+parseInt(_0x3c9170(0x207))/0x9+parseInt(_0x3c9170(0x202))/0xa*(-parseInt(_0x3c9170(0x1e6))/0xb);if(_0x40fcf9===_0x15d9f5)break;else _0x5e9886['push'](_0x5e9886['shift']());}catch(_0x50d3bd){_0x5e9886['push'](_0x5e9886['shift']());}}}(a3_0x5bd4,0x6e702));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x5bd4(){const _0x47e28e=['5173462dFoqvi','2706912MdnSKC','9858lPkERD','951726aEoQmE','20LQPTfh','Site:\x20','544vemTZF','Resolving\x20parent\x20segment\x20\x27','1TGkUsf','7949799OQWOmY','activations','25blTPIW','3744554wkQFCu','segment','listActivations','execute','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','error','Resolving\x20child\x20segment\x20\x27','verbose','resolveSegmentId','608728RdRtDC','Error:\x20','Parent\x20name:\x20','Resolved\x20child\x20ID:\x20','cause','List\x20activations\x20for\x20a\x20segment','Listing\x20activations\x20for\x20segment\x20\x27','message','data','name','Child\x20name:\x20','Resolved\x20parent\x20ID:\x20','length','description'];a3_0x5bd4=function(){return _0x47e28e;};return a3_0x5bd4();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x2f70(_0xc60825,_0x5c3125){_0xc60825=_0xc60825-0x1e5;const _0x5bd462=a3_0x5bd4();let _0x2f70be=_0x5bd462[_0xc60825];return _0x2f70be;}export class ActivationsCommand extends BaseCommand{[a3_0x4fdd96(0x1f9)]=a3_0x4fdd96(0x208);[a3_0x4fdd96(0x1fd)]=a3_0x4fdd96(0x1f5);async[a3_0x4fdd96(0x1e9)](_0x42df4e){const _0x4fddbb=a3_0x4fdd96,{options:_0x53bd1f,args:_0x447162,tdx:_0x49876b}=_0x42df4e;if(_0x447162[_0x4fddbb(0x1fc)]===0x0)return console[_0x4fddbb(0x1ec)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x4fddbb(0x1ec)](_0x4fddbb(0x1ea)),0x1;try{const {parentId:_0x3c5d22,childId:_0x43e0c7}=parseSegmentRef(_0x447162[0x0]);if(!_0x43e0c7)return console['error'](_0x4fddbb(0x1eb)),console[_0x4fddbb(0x1ec)](_0x4fddbb(0x1ea)),0x1;_0x53bd1f['verbose']&&(console['error'](_0x4fddbb(0x203)+_0x53bd1f['site']),console[_0x4fddbb(0x1ec)](_0x4fddbb(0x1f2)+_0x3c5d22),console[_0x4fddbb(0x1ec)](_0x4fddbb(0x1fa)+_0x43e0c7));const _0x28e60d=await withSpinner(_0x4fddbb(0x205)+_0x3c5d22+'\x27...',()=>_0x49876b[_0x4fddbb(0x1e7)]['resolveParentId'](_0x3c5d22),{'verbose':_0x53bd1f[_0x4fddbb(0x1ee)]}),_0x1e8321=_0x28e60d[_0x4fddbb(0x1f8)];_0x53bd1f[_0x4fddbb(0x1ee)]&&console[_0x4fddbb(0x1ec)](_0x4fddbb(0x1fb)+_0x1e8321);const _0x250488=await withSpinner(_0x4fddbb(0x1ed)+_0x43e0c7+'\x27...',()=>_0x49876b[_0x4fddbb(0x1e7)][_0x4fddbb(0x1ef)](_0x1e8321,_0x43e0c7),{'verbose':_0x53bd1f[_0x4fddbb(0x1ee)]}),_0x172476=_0x250488['data'];_0x53bd1f[_0x4fddbb(0x1ee)]&&console['error'](_0x4fddbb(0x1f3)+_0x172476);const _0x437565=await withSpinner(_0x4fddbb(0x1f6)+_0x43e0c7+'\x27...',()=>_0x49876b[_0x4fddbb(0x1e7)][_0x4fddbb(0x1e8)](_0x1e8321,_0x172476),{'verbose':_0x53bd1f['verbose']}),_0x127444=_0x437565[_0x4fddbb(0x1f8)];return console['error']('✔\x20Found\x20'+_0x127444[_0x4fddbb(0x1fc)]+'\x20activation'+(_0x127444[_0x4fddbb(0x1fc)]!==0x1?'s':'')),await handleSDKOutput(_0x127444,_0x53bd1f),0x0;}catch(_0x3c4032){if(_0x3c4032 instanceof SDKError)return console[_0x4fddbb(0x1ec)](_0x4fddbb(0x1f1)+_0x3c4032[_0x4fddbb(0x1f7)]),_0x3c4032[_0x4fddbb(0x1f4)]&&console['error']('\x20\x20Cause:\x20'+_0x3c4032[_0x4fddbb(0x1f4)]),0x1;throw _0x3c4032;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x515c36=a4_0x58c7;(function(_0x4eca64,_0x31ff08){const _0x54e95c=a4_0x58c7,_0x2f2276=_0x4eca64();while(!![]){try{const _0x3875bf=-parseInt(_0x54e95c(0x14b))/0x1*(-parseInt(_0x54e95c(0x171))/0x2)+-parseInt(_0x54e95c(0xc2))/0x3*(-parseInt(_0x54e95c(0xc6))/0x4)+-parseInt(_0x54e95c(0x13c))/0x5*(-parseInt(_0x54e95c(0xe3))/0x6)+-parseInt(_0x54e95c(0xc3))/0x7+-parseInt(_0x54e95c(0xe7))/0x8+-parseInt(_0x54e95c(0x121))/0x9+parseInt(_0x54e95c(0x166))/0xa*(parseInt(_0x54e95c(0x11d))/0xb);if(_0x3875bf===_0x31ff08)break;else _0x2f2276['push'](_0x2f2276['shift']());}catch(_0x4aee71){_0x2f2276['push'](_0x2f2276['shift']());}}}(a4_0x1f60,0x3a894));import a4_0x4c76cc from'chalk';import a4_0x5362d8 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_0x1f60(){const _0x5dd8cd=['Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','error','yellow','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Target:\x20','\x22\x20to\x20a\x20different\x20profile','\x0aChanges\x20to\x20prompt\x20\x27','description','no_local_folder','11aXMBPC','\x20--name\x20','dryRun','\x20resources\x20to\x20\x27','3380796nWzVUa','green','\x22:\x20','source','\x20\x20Text\x20Knowledge\x20Bases:\x20','Source:\x20','llm','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Pushing\x20agent\x20from\x20\x22','experimentalArtifacts','\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','prompts','arg-dir','Project\x20cloned\x20successfully','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\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','\x27\x20to\x20create\x20the\x20folder\x20structure.','Using\x20project\x20from\x20context:\x20','cyan','join','Cannot\x20clone\x20from\x20context\x20project\x20\x22','reason','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20|\x20','counts','updated','log','572095kgLejG','Agent\x20pulled\x20successfully','Using\x20current\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Pushing\x20to\x20project...','agentId','message','Output\x20path:\x20','outputDir','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent.yml','projectDir','created','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','29ssIIlB','\x20\x20Knowledge\x20Base\x20\x22','outputPath','\x20new','execute','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Integrations:\x20','\x0aPull\x20summary\x20for\x20\x27','llmProject','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Analyzing\x20project\x20\x22','push','context','new','errors','\x22\x20from\x20project\x20\x22','✔\x20Context\x20set:\x20','Summary:','gray','\x20unchanged','yes','\x20total','\x20\x20Integration\x20\x22','Using\x20project\x20from\x20','\x0a✔\x20Pushed\x20','Agent:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','3618570aYrzVM','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','<new-name>','MISSING_ARGUMENT','\x20\x20Knowledge\x20Bases:\x20','site','projectName','hasChanges','Errors:','integrations','Dry\x20run\x20-\x20no\x20files\x20written','3032LsVLCx','cwd-config','\x20\x20Agents:\x20','Analyzing\x20changes\x20to\x20push...','session','\x20changed','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','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)','name','\x20\x20Prompts:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','tdx.json','\x20resources?','969954Ctunfv','3133228wkqprb','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Would\x20push\x20agent:\x20','4ckWrNi','dim','Cloning\x20\x22','\x20updated','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Prompt\x20\x22','Pulling\x20agent\x20\x22','Project\x20cloned\x20with\x20errors','\x0aError:','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20=\x20','\x0aProject\x20pushed\x20with\x20errors','projectId','Chat:\x20','action','diff','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','New\x20project:\x20','INVALID_ARGUMENT','\x0aPush\x20summary\x20for\x20\x27','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','force','Project:\x20','red','Output:\x20','llm_project','\x20\x20Source:\x20','knowledgeBases','agent','24yywyJB','Writing\x20files...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','output','990424KkBBOl','New\x20project\x20name\x20is\x20required','Would\x20clone:','sourceProjectName','Using\x20context\x20project:\x20','Using\x20project:\x20','total','pullAgent','\x20\x20Agent\x20\x22','parse','newProjectId','dirname','\x20\x20Experimental\x20Artifacts:\x20','pushProject','\x20\x20tdx\x20agent\x20pull\x20','agents','Agent\x20','\x20files?','Clone\x20\x22','pullProject','\x0aWrite\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agent:clone','-\x20no\x20files\x20written','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','repeat','unchanged','agent:push','agentName','experimentalKnowledgeBases','textKnowledgeBases','\x20--profile\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x22...','Status:\x20','\x22\x20to\x20\x22','no_context','Cancelled','\x20\x20Experimental\x20Artifact\x20\x22','\x20files\x20to\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agent:pull'];a4_0x1f60=function(){return _0x5dd8cd;};return a4_0x1f60();}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(_0x54feb9){const _0x5427aa=a4_0x58c7,_0x32b14f=[];if(_0x54feb9[_0x5427aa(0xed)]!==undefined)_0x32b14f[_0x5427aa(0x156)](_0x54feb9['total']+_0x5427aa(0x160));if(_0x54feb9[_0x5427aa(0x158)]!==undefined&&_0x54feb9['new']>0x0)_0x32b14f[_0x5427aa(0x156)](a4_0x4c76cc[_0x5427aa(0x122)](_0x54feb9['new']+_0x5427aa(0x14e)));if(_0x54feb9[_0x5427aa(0x148)]!==undefined&&_0x54feb9['created']>0x0)_0x32b14f['push'](a4_0x4c76cc['green'](_0x54feb9['created']+'\x20created'));if(_0x54feb9[_0x5427aa(0x13a)]!==undefined&&_0x54feb9[_0x5427aa(0x13a)]>0x0)_0x32b14f['push'](a4_0x4c76cc[_0x5427aa(0x116)](_0x54feb9['updated']+_0x5427aa(0xc9)));if(_0x54feb9['unchanged']!==undefined&&_0x54feb9[_0x5427aa(0x101)]>0x0)_0x32b14f[_0x5427aa(0x156)](a4_0x4c76cc[_0x5427aa(0x15d)](_0x54feb9['unchanged']+_0x5427aa(0x15e)));if(_0x54feb9['errors']!==undefined&&_0x54feb9[_0x5427aa(0x159)]>0x0)_0x32b14f[_0x5427aa(0x156)](a4_0x4c76cc[_0x5427aa(0xdd)](_0x54feb9[_0x5427aa(0x159)]+'\x20errors'));return _0x32b14f[_0x5427aa(0x134)](',\x20');}function a4_0x58c7(_0x4519be,_0x2699d6){_0x4519be=_0x4519be-0xb8;const _0x1f60dc=a4_0x1f60();let _0x58c7d8=_0x1f60dc[_0x4519be];return _0x58c7d8;}function displayDiffs(_0x1207b4,_0x23caea,_0x24412a,_0x2b10ea,_0x187a80,_0xd05dd2,_0x10dc0f){const _0x44aec9=a4_0x58c7;for(const _0x3d37e5 of _0x1207b4){if(_0x3d37e5['diff']){const _0x2b450=_0x3d37e5[_0x44aec9(0x103)]||_0x3d37e5['name'];console[_0x44aec9(0x13b)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2b450+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x3d37e5[_0x44aec9(0xd5)]),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c));}}for(const _0x22c755 of _0x23caea){_0x22c755[_0x44aec9(0xd5)]&&(console[_0x44aec9(0x13b)](_0x44aec9(0x165)+_0x22c755['name']+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x22c755[_0x44aec9(0xd5)]),console['log']('─'[_0x44aec9(0x100)](0x3c)));}for(const _0x12267f of _0x24412a){_0x12267f['diff']&&(console[_0x44aec9(0x13b)](_0x44aec9(0x145)+_0x12267f[_0x44aec9(0xb9)]+'\x27:'),console[_0x44aec9(0x13b)]('─'['repeat'](0x3c)),console[_0x44aec9(0x13b)](_0x12267f[_0x44aec9(0xd5)]),console[_0x44aec9(0x13b)]('─'['repeat'](0x3c)));}for(const _0x4e0fef of _0x2b10ea){_0x4e0fef['diff']&&(console['log'](_0x44aec9(0x11a)+_0x4e0fef[_0x44aec9(0xb9)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x44aec9(0x13b)](_0x4e0fef[_0x44aec9(0xd5)]),console['log']('─'['repeat'](0x3c)));}for(const _0x54adc4 of _0x187a80){_0x54adc4[_0x44aec9(0xd5)]&&(console['log'](_0x44aec9(0x14a)+_0x54adc4['name']+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x54adc4['diff']),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)));}for(const _0x37ffef of _0xd05dd2){_0x37ffef[_0x44aec9(0xd5)]&&(console[_0x44aec9(0x13b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x37ffef[_0x44aec9(0xb9)]+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x37ffef['diff']),console[_0x44aec9(0x13b)]('─'['repeat'](0x3c)));}for(const _0x1d7370 of _0x10dc0f){_0x1d7370[_0x44aec9(0xd5)]&&(console['log'](_0x44aec9(0xbf)+_0x1d7370[_0x44aec9(0xb9)]+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x1d7370[_0x44aec9(0xd5)]),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x515c36(0xb9)]=a4_0x515c36(0x113);['description']=a4_0x515c36(0x112);async[a4_0x515c36(0x14f)](_0x1b5d3d){const _0x6410fe=a4_0x515c36,{options:_0x541f91,args:_0x19773a,tdx:_0x32d8b9}=_0x1b5d3d,_0xd35e8b=_0x19773a[0x0],_0x106ec6=_0x19773a[0x1],_0x13fa8d=_0x541f91[_0x6410fe(0xe6)],_0x4853f1=_0x541f91[_0x6410fe(0x11f)],_0x258ba0=_0x541f91[_0x6410fe(0xdb)],_0x29a729=_0x541f91[_0x6410fe(0x15f)],_0x3024ce=_0x541f91[_0x6410fe(0x153)],_0x58e08b=_0x541f91[_0x6410fe(0xe2)];let _0x39ba67;if(_0xd35e8b){const _0x37a07d=a4_0x5362d8[_0x6410fe(0x134)](_0xd35e8b,_0x6410fe(0xc0));if(existsSync(_0x37a07d))try{const _0x4b16df=JSON['parse'](readFileSync(_0x37a07d,'utf-8'));_0x4b16df['llm_project']&&(_0x39ba67={'llm_project':_0x4b16df[_0x6410fe(0xdf)]});}catch{}}const _0x106412=findAgentConfigPath(process[_0x6410fe(0xbd)]());let _0x1517c7;if(_0x106412)try{const _0x4d8a1a=JSON[_0x6410fe(0xf0)](readFileSync(_0x106412,'utf-8'));_0x4d8a1a[_0x6410fe(0xdf)]&&(_0x1517c7={'llm_project':_0x4d8a1a[_0x6410fe(0xdf)]});}catch{}const _0x193a4d=resolveAgentPullArgs({'arg':_0xd35e8b,'agentNameArg':_0x106ec6,'agentFlag':_0x58e08b,'contextProject':_0x3024ce,'argDirConfig':_0x39ba67,'cwdConfigPath':_0x106412||undefined,'cwdConfig':_0x1517c7}),{projectNameOrId:_0x3a1c07,targetAgentName:_0x147c67,existingOutputDir:_0x5bccf4,source:_0x40de5e}=_0x193a4d;if(_0x40de5e===_0x6410fe(0x12d))console['log'](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0x162)+a4_0x5362d8[_0x6410fe(0x134)](_0xd35e8b,_0x6410fe(0xc0))+':\x20'+_0x3a1c07));else{if(_0x40de5e===_0x6410fe(0x172))console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0xec)+_0x3a1c07));else _0x40de5e===_0x6410fe(0x157)&&console['log'](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0x132)+_0x3a1c07));}if(!_0x3a1c07)return _0x58e08b?(console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x6410fe(0xda)),console['log'](_0x6410fe(0x12f))):(console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x111))),console[_0x6410fe(0x13b)](_0x6410fe(0xb8)),console[_0x6410fe(0x13b)](_0x6410fe(0x130)),console[_0x6410fe(0x13b)](_0x6410fe(0x12b)),console[_0x6410fe(0x13b)]('\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'),console['log']('\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(_0x147c67){const {data:_0x331f98}=await withSpinner(_0x6410fe(0xcc)+_0x147c67+_0x6410fe(0x15a)+_0x3a1c07+_0x6410fe(0x109),()=>_0x32d8b9[_0x6410fe(0x127)][_0x6410fe(0xee)](_0x3a1c07,_0x147c67,_0x13fa8d,{'dryRun':_0x4853f1,'force':_0x258ba0}));if(_0x4853f1)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x170))),console['log']('Would\x20pull\x20agent:\x20'+_0x331f98[_0x6410fe(0x103)]),console[_0x6410fe(0x13b)](_0x6410fe(0x143)+_0x331f98[_0x6410fe(0x14d)]),_0x331f98[_0x6410fe(0xd5)]&&(console[_0x6410fe(0x13b)]('\x0aChanges:'),console[_0x6410fe(0x13b)]('─'['repeat'](0x3c)),console[_0x6410fe(0x13b)](_0x331f98[_0x6410fe(0xd5)]),console[_0x6410fe(0x13b)]('─'['repeat'](0x3c))),0x0;return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x13d))),console['log'](_0x6410fe(0x164)+_0x331f98[_0x6410fe(0x103)]),console['log'](_0x6410fe(0xde)+_0x331f98[_0x6410fe(0x14d)]),console['log'](_0x6410fe(0x10a)+(_0x331f98['isNew']?a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x158)):_0x331f98[_0x6410fe(0x16d)]?a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x13a)):a4_0x4c76cc[_0x6410fe(0x15d)]('unchanged'))),0x0;}const _0x3358f4=_0x5bccf4||_0x13fa8d,{data:_0x18508f}=await withSpinner(_0x6410fe(0x155)+_0x3a1c07+_0x6410fe(0x109),()=>_0x32d8b9[_0x6410fe(0x127)][_0x6410fe(0xfa)](_0x3a1c07,_0x3358f4,{'dryRun':!![]})),_0x2959d2=_0x18508f['counts'][_0x6410fe(0xf6)][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)]['knowledgeBases'][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)]['textKnowledgeBases']['new']+_0x18508f[_0x6410fe(0x139)]['prompts'][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)]['integrations'][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12a)][_0x6410fe(0x158)],_0x4d7a68=_0x18508f['counts']['agents'][_0x6410fe(0x13a)]+_0x18508f['counts']['knowledgeBases'][_0x6410fe(0x13a)]+_0x18508f[_0x6410fe(0x139)]['textKnowledgeBases'][_0x6410fe(0x13a)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12c)]['updated']+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x16f)][_0x6410fe(0x13a)]+_0x18508f['counts'][_0x6410fe(0x104)][_0x6410fe(0x13a)]+_0x18508f['counts'][_0x6410fe(0x12a)][_0x6410fe(0x13a)],_0x3b5d01=_0x18508f[_0x6410fe(0x139)]['agents']['unchanged']+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0xe1)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x105)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12c)][_0x6410fe(0x101)]+_0x18508f['counts'][_0x6410fe(0x16f)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)]['experimentalArtifacts'][_0x6410fe(0x101)];console[_0x6410fe(0x13b)](_0x6410fe(0x152)+_0x18508f['projectName']+'\x27:'),console[_0x6410fe(0x13b)]('\x20\x20'+a4_0x4c76cc['green']('+\x20'+_0x2959d2+_0x6410fe(0x14e))+_0x6410fe(0x138)+a4_0x4c76cc[_0x6410fe(0x116)]('~\x20'+_0x4d7a68+_0x6410fe(0x176))+_0x6410fe(0x138)+a4_0x4c76cc[_0x6410fe(0xc7)]('=\x20'+_0x3b5d01+_0x6410fe(0x15e))),console[_0x6410fe(0x13b)](_0x6410fe(0x173)+formatCountSummary(_0x18508f['counts']['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0xe1)])),console[_0x6410fe(0x13b)](_0x6410fe(0x125)+formatCountSummary(_0x18508f[_0x6410fe(0x139)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12c)])),console['log'](_0x6410fe(0x151)+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x16f)]));const _0x536b5b=_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)][_0x6410fe(0xed)]>0x0||_0x18508f['counts'][_0x6410fe(0x12a)][_0x6410fe(0xed)]>0x0;_0x536b5b&&(console[_0x6410fe(0x13b)](_0x6410fe(0xd6)+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)])),console[_0x6410fe(0x13b)](_0x6410fe(0xf3)+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12a)])));console[_0x6410fe(0x13b)](_0x6410fe(0x118)+a4_0x4c76cc[_0x6410fe(0x133)](_0x18508f[_0x6410fe(0x144)])),displayDiffs(_0x18508f[_0x6410fe(0xf6)],_0x18508f[_0x6410fe(0xe1)],_0x18508f[_0x6410fe(0x105)],_0x18508f['prompts'],_0x18508f[_0x6410fe(0x16f)],_0x18508f[_0x6410fe(0x104)],_0x18508f[_0x6410fe(0x12a)]);if(_0x4853f1)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0xe5))),0x0;if(_0x2959d2===0x0&&_0x4d7a68===0x0)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x167))),saveSessionContext({'llm_project':_0x18508f[_0x6410fe(0x16c)]},_0x541f91[_0x6410fe(0x175)]),console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x15b)+a4_0x4c76cc[_0x6410fe(0xc7)]('llm_project')+_0x6410fe(0xd0)+a4_0x4c76cc[_0x6410fe(0x133)](_0x18508f['projectName']))),0x0;if(!_0x29a729&&!_0x258ba0){if(!isInteractive())return console[_0x6410fe(0x115)](a4_0x4c76cc[_0x6410fe(0xdd)]('\x0aError:'),_0x6410fe(0x177)),console[_0x6410fe(0x115)](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0xbc))),0x1;const _0x4c7cb2=await confirmKey(_0x6410fe(0xfb)+(_0x2959d2+_0x4d7a68)+_0x6410fe(0xf8));if(!_0x4c7cb2)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x10d)),_0x6410fe(0xfe)),0x1;}const {data:_0x18eb0c}=await withSpinner(_0x6410fe(0xe4),()=>_0x32d8b9['llm']['pullProject'](_0x3a1c07,_0x3358f4,{'force':_0x258ba0}));return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)]('\x0a✔\x20Pulled\x20'+(_0x2959d2+_0x4d7a68)+_0x6410fe(0x10f)+_0x18eb0c['outputDir'])),saveSessionContext({'llm_project':_0x18eb0c['projectName']},_0x541f91['session']),console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x15b)+a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0xdf))+_0x6410fe(0xd0)+a4_0x4c76cc[_0x6410fe(0x133)](_0x18eb0c[_0x6410fe(0x16c)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x515c36(0xfd);[a4_0x515c36(0x11b)]=a4_0x515c36(0xca);async['execute'](_0x48625d){const _0x3dd45c=a4_0x515c36,{options:_0x5d8aaa,args:_0x5380dc,tdx:_0x511d59}=_0x48625d,_0x58373b=_0x5380dc[0x0],_0x46e66a=_0x5d8aaa[_0x3dd45c(0xb9)],_0x5b85d1=_0x5d8aaa[_0x3dd45c(0x11f)],_0x1e7bcd=_0x5d8aaa[_0x3dd45c(0x15f)],_0x13e6ce=_0x5d8aaa[_0x3dd45c(0x16b)],_0x2d5a24=_0x5d8aaa[_0x3dd45c(0x153)];let _0x75a5f9;const _0x568685=findAgentConfigPath(process[_0x3dd45c(0xbd)]());if(_0x58373b){const _0x310789=a4_0x5362d8[_0x3dd45c(0x134)](_0x58373b,_0x3dd45c(0xc0));existsSync(_0x310789)?(_0x75a5f9=_0x58373b,console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xc7)](_0x3dd45c(0x149)+_0x58373b))):_0x75a5f9=_0x58373b;}else{if(_0x568685)_0x75a5f9=a4_0x5362d8[_0x3dd45c(0xf2)](_0x568685),console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xc7)](_0x3dd45c(0x13e)+_0x75a5f9));else{if(_0x2d5a24){const _0x53f76a=sanitizeForFilesystem(_0x2d5a24);let _0x7587fb=_0x53f76a,_0x187932=a4_0x5362d8[_0x3dd45c(0x134)](process['cwd'](),_0x3dd45c(0xf6),_0x53f76a,'tdx.json');if(!existsSync(_0x187932)){const _0x1b9d64=normalizeName(_0x2d5a24),_0x196185=a4_0x5362d8[_0x3dd45c(0x134)](process['cwd'](),_0x3dd45c(0xf6),_0x1b9d64,_0x3dd45c(0xc0));existsSync(_0x196185)&&(_0x7587fb=_0x1b9d64,_0x187932=_0x196185);}if(existsSync(_0x187932))_0x75a5f9=a4_0x5362d8[_0x3dd45c(0xf2)](_0x187932),console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xc7)]('Using\x20local\x20project:\x20'+_0x75a5f9));else{const _0x296824=_0x5d8aaa['profile'];if(_0x296824)throw new SDKError(ErrorCode[_0x3dd45c(0xd8)],_0x3dd45c(0x135)+_0x2d5a24+_0x3dd45c(0x119),undefined,{'helpText':_0x3dd45c(0xcf)+_0x3dd45c(0xbb)+(_0x3dd45c(0xf5)+_0x2d5a24+'\x0a')+(_0x3dd45c(0x13f)+_0x7587fb+_0x3dd45c(0x11e)+(_0x46e66a||_0x3dd45c(0x168))+_0x3dd45c(0x106)+_0x296824)});_0x75a5f9=_0x2d5a24,console['log'](a4_0x4c76cc['dim'](_0x3dd45c(0xeb)+_0x2d5a24));}}}}if(!_0x75a5f9)return console['log'](a4_0x4c76cc[_0x3dd45c(0x116)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x3dd45c(0x154)),console[_0x3dd45c(0x13b)](_0x3dd45c(0x110)),console[_0x3dd45c(0x13b)]('\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)'),console[_0x3dd45c(0x13b)](_0x3dd45c(0xfc)),0x1;if(!_0x46e66a)throw new SDKError(ErrorCode[_0x3dd45c(0x169)],_0x3dd45c(0xe8),undefined,{'helpText':_0x3dd45c(0x114)});if(!_0x1e7bcd&&!_0x5b85d1){if(!isInteractive())return console[_0x3dd45c(0x115)](a4_0x4c76cc['red'](_0x3dd45c(0xce)),_0x3dd45c(0x177)),console[_0x3dd45c(0x115)](a4_0x4c76cc[_0x3dd45c(0xc7)](_0x3dd45c(0xbc))),0x1;const _0x1b745b=await confirmKey(_0x3dd45c(0xf9)+_0x75a5f9+_0x3dd45c(0x150)+_0x46e66a+'\x22?');if(!_0x1b745b)return console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0x116)](_0x3dd45c(0x10d))),0x1;}const {data:_0x19a921}=await withSpinner(_0x3dd45c(0xc8)+_0x75a5f9+_0x3dd45c(0x10b)+_0x46e66a+_0x3dd45c(0x109),()=>_0x511d59[_0x3dd45c(0x127)]['cloneProject'](_0x75a5f9,_0x46e66a,{'dryRun':_0x5b85d1}));if(_0x5b85d1){console['log'](a4_0x4c76cc[_0x3dd45c(0x116)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x3dd45c(0x13b)](_0x3dd45c(0x126)+_0x19a921[_0x3dd45c(0xea)]),console[_0x3dd45c(0x13b)](_0x3dd45c(0xd7)+_0x46e66a),console[_0x3dd45c(0x13b)](_0x3dd45c(0xe9)),console[_0x3dd45c(0x13b)](_0x3dd45c(0x173)+_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0xf6)]['created']),console['log'](_0x3dd45c(0x16a)+_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0xe1)]['created']),console['log'](_0x3dd45c(0xba)+_0x19a921[_0x3dd45c(0x139)]['prompts']['created']);const _0x35e0a0=_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x148)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)][_0x3dd45c(0x148)]>0x0;return _0x35e0a0&&(console[_0x3dd45c(0x13b)](_0x3dd45c(0xd6)+_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x148)]),console[_0x3dd45c(0x13b)](_0x3dd45c(0xf3)+_0x19a921['counts'][_0x3dd45c(0x12a)][_0x3dd45c(0x148)])),0x0;}const _0x8b789e=_0x19a921['counts'][_0x3dd45c(0xf6)][_0x3dd45c(0x159)]>0x0||_0x19a921['counts'][_0x3dd45c(0xe1)][_0x3dd45c(0x159)]>0x0||_0x19a921[_0x3dd45c(0x139)]['prompts'][_0x3dd45c(0x159)]>0x0||_0x19a921['counts'][_0x3dd45c(0x104)][_0x3dd45c(0x159)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)]['errors']>0x0;_0x8b789e?console[_0x3dd45c(0x13b)](a4_0x4c76cc['yellow'](_0x3dd45c(0xcd))):console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0x122)](_0x3dd45c(0x12e)));console['log'](_0x3dd45c(0x126)+_0x19a921[_0x3dd45c(0xea)]),console['log'](_0x3dd45c(0xd7)+_0x19a921['newProjectName']),console[_0x3dd45c(0x13b)]('New\x20project\x20ID:\x20'+_0x19a921[_0x3dd45c(0xf1)]),console[_0x3dd45c(0x13b)](),console[_0x3dd45c(0x13b)](_0x3dd45c(0x15c)),console['log'](_0x3dd45c(0x173)+formatCountSummary(_0x19a921['counts']['agents'])),console[_0x3dd45c(0x13b)](_0x3dd45c(0x16a)+formatCountSummary(_0x19a921[_0x3dd45c(0x139)]['knowledgeBases'])),console['log'](_0x3dd45c(0xba)+formatCountSummary(_0x19a921['counts']['prompts'])),console['log'](_0x3dd45c(0x151)+formatCountSummary(_0x19a921[_0x3dd45c(0x139)]['integrations']));const _0x11a84a=_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)]['created']>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x13a)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x101)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)][_0x3dd45c(0x148)]>0x0||_0x19a921[_0x3dd45c(0x139)]['experimentalArtifacts']['updated']>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)][_0x3dd45c(0x101)]>0x0;_0x11a84a&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)])),console[_0x3dd45c(0x13b)](_0x3dd45c(0xf3)+formatCountSummary(_0x19a921['counts'][_0x3dd45c(0x12a)])));if(_0x8b789e){console['log'](),console['log'](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0x16e)));for(const _0x3cdd6f of _0x19a921[_0x3dd45c(0xf6)]){_0x3cdd6f[_0x3dd45c(0xd4)]===_0x3dd45c(0x115)&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)]('\x20\x20Agent\x20\x22'+_0x3cdd6f[_0x3dd45c(0x103)]+_0x3dd45c(0x123)+_0x3cdd6f[_0x3dd45c(0x115)]));}for(const _0x584403 of _0x19a921[_0x3dd45c(0xe1)]){_0x584403[_0x3dd45c(0xd4)]===_0x3dd45c(0x115)&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0x14c)+_0x584403[_0x3dd45c(0xb9)]+_0x3dd45c(0x123)+_0x584403[_0x3dd45c(0x115)]));}for(const _0x1562b7 of _0x19a921[_0x3dd45c(0x12c)]){_0x1562b7['action']===_0x3dd45c(0x115)&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0xcb)+_0x1562b7['name']+_0x3dd45c(0x123)+_0x1562b7[_0x3dd45c(0x115)]));}for(const _0x2149c2 of _0x19a921[_0x3dd45c(0x16f)]){_0x2149c2[_0x3dd45c(0xd4)]==='error'&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)]('\x20\x20Integration\x20\x22'+_0x2149c2[_0x3dd45c(0xb9)]+'\x22:\x20'+_0x2149c2[_0x3dd45c(0x115)]));}for(const _0x3a6abc of _0x19a921[_0x3dd45c(0x104)]){_0x3a6abc[_0x3dd45c(0xd4)]==='error'&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x3a6abc['name']+'\x22:\x20'+_0x3a6abc['error']));}for(const _0x2bac51 of _0x19a921[_0x3dd45c(0x12a)]){_0x2bac51[_0x3dd45c(0xd4)]==='error'&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0x10e)+_0x2bac51[_0x3dd45c(0xb9)]+'\x22:\x20'+_0x2bac51[_0x3dd45c(0x115)]));}return 0x1;}console['log']();const _0x346227=getLLMProjectUrl(_0x13e6ce,_0x19a921[_0x3dd45c(0xf1)]);return console['log']('Project:\x20'+a4_0x4c76cc[_0x3dd45c(0x133)](_0x346227)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x515c36(0xb9)]=a4_0x515c36(0x102);[a4_0x515c36(0x11b)]=a4_0x515c36(0x128);async[a4_0x515c36(0x14f)](_0x4e0547){const _0x49999b=a4_0x515c36,{options:_0x203e60,args:_0x23340e,tdx:_0x3cd22a}=_0x4e0547;let _0x49644e=_0x23340e[0x0]||process[_0x49999b(0xbd)]();const _0x308576=_0x203e60['dryRun'],_0x186c98=_0x203e60[_0x49999b(0xdb)],_0x4d00cb=_0x203e60[_0x49999b(0x15f)],_0x75335d=_0x203e60[_0x49999b(0x16b)],_0x5f140e=a4_0x5362d8[_0x49999b(0x134)](_0x49644e,_0x49999b(0x146)),_0x3088cd=existsSync(_0x5f140e);if(_0x3088cd){const {data:_0x4d6c9e}=await withSpinner(_0x49999b(0x129)+_0x49644e+_0x49999b(0x109),()=>_0x3cd22a[_0x49999b(0x127)]['pushAgent'](_0x49644e,{'dryRun':_0x308576,'force':_0x186c98}));if(_0x308576)return console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0x116)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x49999b(0x13b)](_0x49999b(0xc5)+_0x4d6c9e[_0x49999b(0x103)]),0x0;if(_0x4d6c9e[_0x49999b(0xd4)]===_0x49999b(0x115))return console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xbe)+_0x4d6c9e[_0x49999b(0x115)])),0x1;console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0x122)](_0x49999b(0xf7)+_0x4d6c9e[_0x49999b(0xd4)]+'\x20successfully')),console[_0x49999b(0x13b)](_0x49999b(0x164)+_0x4d6c9e['agentName']);if(_0x4d6c9e[_0x49999b(0x141)]&&_0x4d6c9e[_0x49999b(0xd2)]){const _0x55d5a5=getLLMAgentChatUrl(_0x75335d,_0x4d6c9e['projectId'],_0x4d6c9e[_0x49999b(0x141)]);console[_0x49999b(0x13b)](_0x49999b(0xd3)+a4_0x4c76cc[_0x49999b(0x133)](_0x55d5a5));}return 0x0;}const _0x15a401=_0x203e60[_0x49999b(0x153)],_0x4ce582=resolveProjectFromContext(_0x49644e,_0x15a401);if(_0x4ce582['found'])_0x49644e=_0x4ce582[_0x49999b(0x147)],_0x4ce582[_0x49999b(0x124)]==='context'&&console[_0x49999b(0x13b)](a4_0x4c76cc['dim'](_0x49999b(0xec)+_0x49644e));else{let _0x47b285=_0x49999b(0xff);_0x4ce582[_0x49999b(0x136)]===_0x49999b(0x11c)&&(_0x47b285=_0x4ce582['message']+_0x49999b(0xc4)+_0x4ce582[_0x49999b(0x153)]+_0x49999b(0x131));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4ce582['reason']===_0x49999b(0x10c)?_0x4ce582[_0x49999b(0x142)]:_0x49999b(0x107)+_0x49644e,undefined,{'helpText':_0x47b285});}const {data:_0x267772}=await withSpinner(_0x49999b(0x174),()=>_0x3cd22a[_0x49999b(0x127)]['pushProject'](_0x49644e,{'dryRun':!![]})),_0x45fd0e=_0x267772['counts'][_0x49999b(0xf6)]['errors']>0x0;if(_0x45fd0e){console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)]('\x0aErrors\x20found:'));for(const _0x4de905 of _0x267772[_0x49999b(0xf6)]){_0x4de905[_0x49999b(0xd4)]==='error'&&console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)]('\x20\x20Agent\x20\x22'+_0x4de905['agentName']+_0x49999b(0x123)+_0x4de905['error']));}return 0x1;}const _0x5b012d=_0x267772[_0x49999b(0x139)][_0x49999b(0xf6)]['created']+_0x267772['counts']['knowledgeBases']['created']+_0x267772[_0x49999b(0x139)][_0x49999b(0x105)][_0x49999b(0x148)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x12c)][_0x49999b(0x148)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x16f)][_0x49999b(0x148)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x104)]['created']+_0x267772['counts'][_0x49999b(0x12a)][_0x49999b(0x148)],_0x3e743d=_0x267772[_0x49999b(0x139)][_0x49999b(0xf6)]['updated']+_0x267772[_0x49999b(0x139)][_0x49999b(0xe1)][_0x49999b(0x13a)]+_0x267772['counts'][_0x49999b(0x105)][_0x49999b(0x13a)]+_0x267772['counts'][_0x49999b(0x12c)][_0x49999b(0x13a)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x16f)][_0x49999b(0x13a)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x104)][_0x49999b(0x13a)]+_0x267772['counts'][_0x49999b(0x12a)][_0x49999b(0x13a)],_0x4f0235=_0x267772['counts'][_0x49999b(0xf6)][_0x49999b(0x101)]+_0x267772['counts']['knowledgeBases'][_0x49999b(0x101)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x105)][_0x49999b(0x101)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x12c)]['unchanged']+_0x267772[_0x49999b(0x139)][_0x49999b(0x16f)][_0x49999b(0x101)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x104)][_0x49999b(0x101)]+_0x267772['counts']['experimentalArtifacts'][_0x49999b(0x101)];console[_0x49999b(0x13b)](_0x49999b(0xd9)+_0x267772['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x4c76cc[_0x49999b(0x122)]('+\x20'+_0x5b012d+_0x49999b(0x14e))+'\x20|\x20'+a4_0x4c76cc['yellow']('~\x20'+_0x3e743d+_0x49999b(0x176))+_0x49999b(0x138)+a4_0x4c76cc[_0x49999b(0xc7)]('=\x20'+_0x4f0235+'\x20unchanged')),console[_0x49999b(0x13b)](_0x49999b(0x173)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0xf6)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x267772[_0x49999b(0x139)]['knowledgeBases'])),console[_0x49999b(0x13b)](_0x49999b(0x125)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0x105)])),console[_0x49999b(0x13b)](_0x49999b(0xba)+formatCountSummary(_0x267772['counts'][_0x49999b(0x12c)])),console[_0x49999b(0x13b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x267772['counts']['integrations']));const _0x40d900=_0x267772[_0x49999b(0x139)][_0x49999b(0x104)]['created']>0x0||_0x267772['counts'][_0x49999b(0x104)][_0x49999b(0x13a)]>0x0||_0x267772[_0x49999b(0x139)][_0x49999b(0x104)][_0x49999b(0x101)]>0x0||_0x267772[_0x49999b(0x139)][_0x49999b(0x12a)]['created']>0x0||_0x267772['counts'][_0x49999b(0x12a)][_0x49999b(0x13a)]>0x0||_0x267772[_0x49999b(0x139)][_0x49999b(0x12a)][_0x49999b(0x101)]>0x0;_0x40d900&&(console[_0x49999b(0x13b)](_0x49999b(0xd6)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0x104)])),console[_0x49999b(0x13b)](_0x49999b(0xf3)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0x12a)])));console[_0x49999b(0x13b)](_0x49999b(0xe0)+a4_0x4c76cc[_0x49999b(0x133)](_0x49644e)),displayDiffs(_0x267772[_0x49999b(0xf6)],_0x267772['knowledgeBases'],_0x267772['textKnowledgeBases'],_0x267772['prompts'],_0x267772[_0x49999b(0x16f)],_0x267772[_0x49999b(0x104)],_0x267772[_0x49999b(0x12a)]);if(_0x308576)return console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0x116)](_0x49999b(0x137))),0x0;if(_0x5b012d===0x0&&_0x3e743d===0x0){console['log'](a4_0x4c76cc[_0x49999b(0x122)](_0x49999b(0x117)));const _0x1f7a95=getLLMProjectUrl(_0x75335d,_0x267772[_0x49999b(0xd2)]);return console['log'](_0x49999b(0xdc)+a4_0x4c76cc['cyan'](_0x1f7a95)),0x0;}if(!_0x4d00cb&&!_0x186c98){if(!isInteractive())return console['error'](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xce)),_0x49999b(0x177)),console['error'](a4_0x4c76cc['dim'](_0x49999b(0xbc))),0x1;const _0x5b59ff=await confirmKey('\x0aPush\x20'+(_0x5b012d+_0x3e743d)+_0x49999b(0xc1));if(!_0x5b59ff)return console[_0x49999b(0x13b)](a4_0x4c76cc['yellow'](_0x49999b(0x10d)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x308c92}=await withSpinner(_0x49999b(0x140),()=>_0x3cd22a[_0x49999b(0x127)][_0x49999b(0xf4)](_0x49644e,{'force':_0x186c98})),_0xfaef92=_0x308c92[_0x49999b(0x139)][_0x49999b(0xf6)][_0x49999b(0x159)]>0x0||_0x308c92[_0x49999b(0x139)][_0x49999b(0xe1)][_0x49999b(0x159)]>0x0||_0x308c92['counts']['textKnowledgeBases'][_0x49999b(0x159)]>0x0||_0x308c92[_0x49999b(0x139)][_0x49999b(0x12c)][_0x49999b(0x159)]>0x0;if(_0xfaef92){console[_0x49999b(0x13b)](a4_0x4c76cc['yellow'](_0x49999b(0xd1))),console['log'](),console['log'](a4_0x4c76cc[_0x49999b(0xdd)]('Errors:'));for(const _0x2b8221 of _0x308c92['agents']){_0x2b8221[_0x49999b(0xd4)]===_0x49999b(0x115)&&console['log'](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xef)+_0x2b8221[_0x49999b(0x103)]+_0x49999b(0x123)+_0x2b8221['error']));}for(const _0x4e6fdd of _0x308c92['knowledgeBases']){_0x4e6fdd[_0x49999b(0xd4)]==='error'&&console['log'](a4_0x4c76cc['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4e6fdd[_0x49999b(0xb9)]+'\x22:\x20'+_0x4e6fdd[_0x49999b(0x115)]));}for(const _0x24103e of _0x308c92[_0x49999b(0x105)]){_0x24103e['action']===_0x49999b(0x115)&&console['log'](a4_0x4c76cc['red'](_0x49999b(0x108)+_0x24103e[_0x49999b(0xb9)]+_0x49999b(0x123)+_0x24103e[_0x49999b(0x115)]));}for(const _0xeaec45 of _0x308c92[_0x49999b(0x12c)]){_0xeaec45[_0x49999b(0xd4)]===_0x49999b(0x115)&&console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xcb)+_0xeaec45[_0x49999b(0xb9)]+'\x22:\x20'+_0xeaec45['error']));}for(const _0x105c78 of _0x308c92['integrations']){_0x105c78[_0x49999b(0xd4)]===_0x49999b(0x115)&&console['log'](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0x161)+_0x105c78[_0x49999b(0xb9)]+_0x49999b(0x123)+_0x105c78[_0x49999b(0x115)]));}return 0x1;}console['log'](a4_0x4c76cc[_0x49999b(0x122)](_0x49999b(0x163)+(_0x5b012d+_0x3e743d)+_0x49999b(0x120)+_0x308c92[_0x49999b(0x16c)]+'\x27'));const _0x33d6c9=getLLMProjectUrl(_0x75335d,_0x308c92[_0x49999b(0xd2)]);return console[_0x49999b(0x13b)](_0x49999b(0xdc)+a4_0x4c76cc[_0x49999b(0x133)](_0x33d6c9)),0x0;}}
|
|
1
|
+
const a4_0x17808e=a4_0x3c57;(function(_0x4f29e9,_0x385736){const _0x5215de=a4_0x3c57,_0x743109=_0x4f29e9();while(!![]){try{const _0x4f2a77=-parseInt(_0x5215de(0x191))/0x1*(-parseInt(_0x5215de(0x19a))/0x2)+-parseInt(_0x5215de(0x19d))/0x3+-parseInt(_0x5215de(0x185))/0x4*(parseInt(_0x5215de(0x15f))/0x5)+-parseInt(_0x5215de(0x180))/0x6*(parseInt(_0x5215de(0x17c))/0x7)+-parseInt(_0x5215de(0x208))/0x8*(-parseInt(_0x5215de(0x1f2))/0x9)+-parseInt(_0x5215de(0x1db))/0xa+-parseInt(_0x5215de(0x201))/0xb*(-parseInt(_0x5215de(0x19e))/0xc);if(_0x4f2a77===_0x385736)break;else _0x743109['push'](_0x743109['shift']());}catch(_0x32d4c7){_0x743109['push'](_0x743109['shift']());}}}(a4_0x5656,0xb6245));import a4_0x5e1f1c from'chalk';import a4_0x3949d5 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x3c57(_0x2661dd,_0x5b6329){_0x2661dd=_0x2661dd-0x155;const _0x56564f=a4_0x5656();let _0x3c57b9=_0x56564f[_0x2661dd];return _0x3c57b9;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x416b35){const _0x2716fd=a4_0x3c57,_0xa6b54f=[];if(_0x416b35['total']!==undefined)_0xa6b54f[_0x2716fd(0x1b8)](_0x416b35[_0x2716fd(0x1f6)]+_0x2716fd(0x1c7));if(_0x416b35[_0x2716fd(0x15e)]!==undefined&&_0x416b35['new']>0x0)_0xa6b54f['push'](a4_0x5e1f1c['green'](_0x416b35[_0x2716fd(0x15e)]+_0x2716fd(0x1ec)));if(_0x416b35[_0x2716fd(0x1d5)]!==undefined&&_0x416b35[_0x2716fd(0x1d5)]>0x0)_0xa6b54f[_0x2716fd(0x1b8)](a4_0x5e1f1c['green'](_0x416b35['created']+_0x2716fd(0x1a4)));if(_0x416b35[_0x2716fd(0x1fd)]!==undefined&&_0x416b35[_0x2716fd(0x1fd)]>0x0)_0xa6b54f[_0x2716fd(0x1b8)](a4_0x5e1f1c[_0x2716fd(0x178)](_0x416b35['updated']+'\x20updated'));if(_0x416b35[_0x2716fd(0x20a)]!==undefined&&_0x416b35[_0x2716fd(0x20a)]>0x0)_0xa6b54f['push'](a4_0x5e1f1c[_0x2716fd(0x1b9)](_0x416b35[_0x2716fd(0x20a)]+_0x2716fd(0x200)));if(_0x416b35[_0x2716fd(0x169)]!==undefined&&_0x416b35[_0x2716fd(0x169)]>0x0)_0xa6b54f['push'](a4_0x5e1f1c[_0x2716fd(0x207)](_0x416b35[_0x2716fd(0x169)]+'\x20errors'));return _0xa6b54f[_0x2716fd(0x1d4)](',\x20');}function displayDiffs(_0x2c8ea1,_0x557200,_0x315586,_0x70e5dc,_0x499352,_0x403609,_0x2f5191){const _0x2ffbf6=a4_0x3c57;for(const _0x54c703 of _0x2c8ea1){if(_0x54c703[_0x2ffbf6(0x1aa)]){const _0x4acceb=_0x54c703[_0x2ffbf6(0x1d9)]||_0x54c703['name'];console['log'](_0x2ffbf6(0x1f0)+_0x4acceb+'\x27:'),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)),console[_0x2ffbf6(0x175)](_0x54c703[_0x2ffbf6(0x1aa)]),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c));}}for(const _0xa8b658 of _0x557200){_0xa8b658[_0x2ffbf6(0x1aa)]&&(console[_0x2ffbf6(0x175)](_0x2ffbf6(0x164)+_0xa8b658[_0x2ffbf6(0x1cb)]+'\x27:'),console['log']('─'[_0x2ffbf6(0x165)](0x3c)),console['log'](_0xa8b658[_0x2ffbf6(0x1aa)]),console['log']('─'['repeat'](0x3c)));}for(const _0x344a6e of _0x315586){_0x344a6e['diff']&&(console[_0x2ffbf6(0x175)](_0x2ffbf6(0x1bb)+_0x344a6e[_0x2ffbf6(0x1cb)]+'\x27:'),console['log']('─'[_0x2ffbf6(0x165)](0x3c)),console[_0x2ffbf6(0x175)](_0x344a6e[_0x2ffbf6(0x1aa)]),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)));}for(const _0x10d145 of _0x70e5dc){_0x10d145[_0x2ffbf6(0x1aa)]&&(console[_0x2ffbf6(0x175)](_0x2ffbf6(0x1f3)+_0x10d145[_0x2ffbf6(0x1cb)]+'\x27:'),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)),console[_0x2ffbf6(0x175)](_0x10d145[_0x2ffbf6(0x1aa)]),console['log']('─'['repeat'](0x3c)));}for(const _0x17b4e5 of _0x499352){_0x17b4e5[_0x2ffbf6(0x1aa)]&&(console[_0x2ffbf6(0x175)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x17b4e5[_0x2ffbf6(0x1cb)]+'\x27:'),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)),console['log'](_0x17b4e5['diff']),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)));}for(const _0x250747 of _0x403609){_0x250747[_0x2ffbf6(0x1aa)]&&(console[_0x2ffbf6(0x175)](_0x2ffbf6(0x17b)+_0x250747['name']+'\x27:'),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)),console['log'](_0x250747['diff']),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)));}for(const _0x323286 of _0x2f5191){_0x323286[_0x2ffbf6(0x1aa)]&&(console['log'](_0x2ffbf6(0x1d7)+_0x323286[_0x2ffbf6(0x1cb)]+'\x27:'),console['log']('─'[_0x2ffbf6(0x165)](0x3c)),console['log'](_0x323286[_0x2ffbf6(0x1aa)]),console[_0x2ffbf6(0x175)]('─'[_0x2ffbf6(0x165)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x17808e(0x199);[a4_0x17808e(0x1a1)]=a4_0x17808e(0x17f);async[a4_0x17808e(0x1e3)](_0x1edae0){const _0x32d921=a4_0x17808e,{options:_0x5eb28b,args:_0x325a1b,tdx:_0xf78d43}=_0x1edae0,_0x4de231=_0x325a1b[0x0],_0x3cd7e0=_0x325a1b[0x1],_0x4b599f=_0x5eb28b[_0x32d921(0x184)],_0x2c41df=_0x5eb28b[_0x32d921(0x173)],_0xb3a643=_0x5eb28b['force'],_0x521ed4=_0x5eb28b[_0x32d921(0x1e4)],_0x4aa821=_0x5eb28b[_0x32d921(0x16b)],_0x270c64=_0x5eb28b[_0x32d921(0x161)];let _0x29d449;if(_0x4de231){const _0x5ae510=a4_0x3949d5[_0x32d921(0x1d4)](_0x4de231,_0x32d921(0x20d));if(existsSync(_0x5ae510))try{const _0xee9d99=JSON[_0x32d921(0x1a9)](readFileSync(_0x5ae510,_0x32d921(0x182)));_0xee9d99[_0x32d921(0x1ae)]&&(_0x29d449={'llm_project':_0xee9d99[_0x32d921(0x1ae)]});}catch{}}const _0x11e17c=findAgentConfigPath(process[_0x32d921(0x198)]());let _0x5f3d67;if(_0x11e17c)try{const _0x3af3b6=JSON[_0x32d921(0x1a9)](readFileSync(_0x11e17c,_0x32d921(0x182)));_0x3af3b6[_0x32d921(0x1ae)]&&(_0x5f3d67={'llm_project':_0x3af3b6[_0x32d921(0x1ae)]});}catch{}const _0xbf8c49=resolveAgentPullArgs({'arg':_0x4de231,'agentNameArg':_0x3cd7e0,'agentFlag':_0x270c64,'contextProject':_0x4aa821,'argDirConfig':_0x29d449,'cwdConfigPath':_0x11e17c||undefined,'cwdConfig':_0x5f3d67}),{projectNameOrId:_0x3ec2d3,targetAgentName:_0x541abb,existingOutputDir:_0x121951,source:_0x4d8148}=_0xbf8c49;if(_0x4d8148===_0x32d921(0x1e2))console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x196)]('Using\x20project\x20from\x20'+a4_0x3949d5['join'](_0x4de231,'tdx.json')+':\x20'+_0x3ec2d3));else{if(_0x4d8148==='cwd-config')console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x196)]('Using\x20project:\x20'+_0x3ec2d3));else _0x4d8148===_0x32d921(0x1e5)&&console['log'](a4_0x5e1f1c[_0x32d921(0x196)]('Using\x20project\x20from\x20context:\x20'+_0x3ec2d3));}if(!_0x3ec2d3)return _0x270c64?(console['log'](a4_0x5e1f1c[_0x32d921(0x178)](_0x32d921(0x1ea))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x32d921(0x1a7))):(console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x178)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x32d921(0x175)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x32d921(0x175)](_0x32d921(0x203)),console[_0x32d921(0x175)](_0x32d921(0x19b)),console[_0x32d921(0x175)](_0x32d921(0x1d2)),console['log'](_0x32d921(0x1bf))),0x1;if(_0x541abb){const {data:_0x42afd3}=await withSpinner(_0x32d921(0x1d3)+_0x541abb+_0x32d921(0x189)+_0x3ec2d3+_0x32d921(0x17d),()=>_0xf78d43[_0x32d921(0x1cd)][_0x32d921(0x1cf)](_0x3ec2d3,_0x541abb,_0x4b599f,{'dryRun':_0x2c41df,'force':_0xb3a643}));if(_0x2c41df)return console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x178)](_0x32d921(0x187))),console[_0x32d921(0x175)](_0x32d921(0x18c)+_0x42afd3[_0x32d921(0x1d9)]),console[_0x32d921(0x175)](_0x32d921(0x1b0)+_0x42afd3[_0x32d921(0x1fe)]),_0x42afd3[_0x32d921(0x1aa)]&&(console[_0x32d921(0x175)](_0x32d921(0x17a)),console[_0x32d921(0x175)]('─'['repeat'](0x3c)),console[_0x32d921(0x175)](_0x42afd3[_0x32d921(0x1aa)]),console[_0x32d921(0x175)]('─'[_0x32d921(0x165)](0x3c))),0x0;return console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x1d1)](_0x32d921(0x1c8))),console[_0x32d921(0x175)]('Agent:\x20'+_0x42afd3['agentName']),console[_0x32d921(0x175)](_0x32d921(0x1b3)+_0x42afd3[_0x32d921(0x1fe)]),console[_0x32d921(0x175)](_0x32d921(0x204)+(_0x42afd3['isNew']?a4_0x5e1f1c['green'](_0x32d921(0x15e)):_0x42afd3[_0x32d921(0x20b)]?a4_0x5e1f1c['yellow'](_0x32d921(0x1fd)):a4_0x5e1f1c[_0x32d921(0x1b9)](_0x32d921(0x20a)))),0x0;}const _0x32d354=_0x121951||_0x4b599f,{data:_0xff5173}=await withSpinner(_0x32d921(0x16f)+_0x3ec2d3+_0x32d921(0x17d),()=>_0xf78d43[_0x32d921(0x1cd)]['pullProject'](_0x3ec2d3,_0x32d354,{'dryRun':!![]})),_0x2ae589=_0xff5173[_0x32d921(0x167)][_0x32d921(0x1e9)][_0x32d921(0x15e)]+_0xff5173[_0x32d921(0x167)][_0x32d921(0x163)][_0x32d921(0x15e)]+_0xff5173[_0x32d921(0x167)][_0x32d921(0x1af)][_0x32d921(0x15e)]+_0xff5173[_0x32d921(0x167)]['prompts']['new']+_0xff5173[_0x32d921(0x167)]['integrations'][_0x32d921(0x15e)]+_0xff5173[_0x32d921(0x167)][_0x32d921(0x192)]['new']+_0xff5173[_0x32d921(0x167)][_0x32d921(0x1a3)][_0x32d921(0x15e)],_0x4c814b=_0xff5173[_0x32d921(0x167)][_0x32d921(0x1e9)][_0x32d921(0x1fd)]+_0xff5173[_0x32d921(0x167)]['knowledgeBases']['updated']+_0xff5173[_0x32d921(0x167)][_0x32d921(0x1af)]['updated']+_0xff5173['counts'][_0x32d921(0x1e0)][_0x32d921(0x1fd)]+_0xff5173['counts'][_0x32d921(0x194)]['updated']+_0xff5173[_0x32d921(0x167)][_0x32d921(0x192)][_0x32d921(0x1fd)]+_0xff5173[_0x32d921(0x167)][_0x32d921(0x1a3)][_0x32d921(0x1fd)],_0x4c2628=_0xff5173[_0x32d921(0x167)][_0x32d921(0x1e9)][_0x32d921(0x20a)]+_0xff5173['counts'][_0x32d921(0x163)]['unchanged']+_0xff5173[_0x32d921(0x167)][_0x32d921(0x1af)][_0x32d921(0x20a)]+_0xff5173[_0x32d921(0x167)]['prompts']['unchanged']+_0xff5173[_0x32d921(0x167)]['integrations'][_0x32d921(0x20a)]+_0xff5173['counts'][_0x32d921(0x192)][_0x32d921(0x20a)]+_0xff5173[_0x32d921(0x167)][_0x32d921(0x1a3)][_0x32d921(0x20a)];console['log'](_0x32d921(0x16c)+_0xff5173[_0x32d921(0x1cc)]+'\x27:'),console['log']('\x20\x20'+a4_0x5e1f1c['green']('+\x20'+_0x2ae589+_0x32d921(0x1ec))+_0x32d921(0x1ad)+a4_0x5e1f1c[_0x32d921(0x178)]('~\x20'+_0x4c814b+'\x20changed')+_0x32d921(0x1ad)+a4_0x5e1f1c[_0x32d921(0x196)]('=\x20'+_0x4c2628+_0x32d921(0x200))),console[_0x32d921(0x175)](_0x32d921(0x18e)+formatCountSummary(_0xff5173[_0x32d921(0x167)]['agents'])),console['log'](_0x32d921(0x166)+formatCountSummary(_0xff5173[_0x32d921(0x167)][_0x32d921(0x163)])),console[_0x32d921(0x175)](_0x32d921(0x15d)+formatCountSummary(_0xff5173[_0x32d921(0x167)][_0x32d921(0x1af)])),console[_0x32d921(0x175)]('\x20\x20Prompts:\x20'+formatCountSummary(_0xff5173[_0x32d921(0x167)][_0x32d921(0x1e0)])),console['log'](_0x32d921(0x1bc)+formatCountSummary(_0xff5173[_0x32d921(0x167)][_0x32d921(0x194)]));const _0x32e792=_0xff5173['counts'][_0x32d921(0x192)]['total']>0x0||_0xff5173[_0x32d921(0x167)][_0x32d921(0x1a3)][_0x32d921(0x1f6)]>0x0;_0x32e792&&(console[_0x32d921(0x175)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xff5173[_0x32d921(0x167)][_0x32d921(0x192)])),console['log'](_0x32d921(0x15b)+formatCountSummary(_0xff5173[_0x32d921(0x167)][_0x32d921(0x1a3)])));console['log']('\x20\x20Target:\x20'+a4_0x5e1f1c[_0x32d921(0x157)](_0xff5173[_0x32d921(0x1b4)])),displayDiffs(_0xff5173[_0x32d921(0x1e9)],_0xff5173[_0x32d921(0x163)],_0xff5173[_0x32d921(0x1af)],_0xff5173[_0x32d921(0x1e0)],_0xff5173['integrations'],_0xff5173['experimentalKnowledgeBases'],_0xff5173[_0x32d921(0x1a3)]);if(_0x2c41df)return console[_0x32d921(0x175)](a4_0x5e1f1c['yellow'](_0x32d921(0x1a6))),0x0;if(_0x2ae589===0x0&&_0x4c814b===0x0)return console[_0x32d921(0x175)](a4_0x5e1f1c['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0xff5173['projectName']},_0x5eb28b['session']),console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x1d1)](_0x32d921(0x209)+a4_0x5e1f1c[_0x32d921(0x196)](_0x32d921(0x1ae))+_0x32d921(0x171)+a4_0x5e1f1c['cyan'](_0xff5173[_0x32d921(0x1cc)]))),0x0;if(!_0x521ed4&&!_0xb3a643){if(!isInteractive())return console[_0x32d921(0x179)](a4_0x5e1f1c[_0x32d921(0x207)](_0x32d921(0x1ee)),_0x32d921(0x183)),console['error'](a4_0x5e1f1c[_0x32d921(0x196)](_0x32d921(0x188))),0x1;const _0x5c0057=await confirmKey(_0x32d921(0x181)+(_0x2ae589+_0x4c814b)+_0x32d921(0x20c));if(!_0x5c0057)return console[_0x32d921(0x175)](a4_0x5e1f1c['yellow'](_0x32d921(0x1c5)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1be8c7}=await withSpinner('Writing\x20files...',()=>_0xf78d43[_0x32d921(0x1cd)][_0x32d921(0x1c1)](_0x3ec2d3,_0x32d354,{'force':_0xb3a643}));return console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x1d1)](_0x32d921(0x1c0)+(_0x2ae589+_0x4c814b)+_0x32d921(0x1b6)+_0x1be8c7[_0x32d921(0x1b4)])),saveSessionContext({'llm_project':_0x1be8c7[_0x32d921(0x1cc)]},_0x5eb28b[_0x32d921(0x1da)]),console[_0x32d921(0x175)](a4_0x5e1f1c[_0x32d921(0x1d1)]('✔\x20Context\x20set:\x20'+a4_0x5e1f1c['dim'](_0x32d921(0x1ae))+'\x20=\x20'+a4_0x5e1f1c[_0x32d921(0x157)](_0x1be8c7[_0x32d921(0x1cc)]))),0x0;}}function a4_0x5656(){const _0x17eefd=['created','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agentName','session','980850XUZklG','no_local_folder','\x0aProject\x20pushed\x20with\x20errors','Using\x20local\x20project:\x20','Clone\x20\x22','prompts','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','arg-dir','execute','yes','context','Agent:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','MISSING_ARGUMENT','agents','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','dirname','\x20new','Using\x20context\x20project:\x20','\x0aError:','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20agent\x20\x27','profile','9prkVdm','\x0aChanges\x20to\x20prompt\x20\x27','\x20changed','\x20resources\x20to\x20\x27','total','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','agent:push','no_context','agentId','\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)','updated','outputPath','Analyzing\x20changes\x20to\x20push...','\x20unchanged','5055160KijHdD','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\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','Status:\x20','projectId','Pushing\x20agent\x20from\x20\x22','red','4037368QOaVOS','✔\x20Context\x20set:\x20','unchanged','hasChanges','\x20files?','tdx.json','\x22\x20to\x20new\x20project\x20\x22','\x0a✔\x20Pushed\x20','cyan','Agent\x20','\x0aErrors\x20found:','\x20\x20Agent\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','source','\x20\x20Text\x20Knowledge\x20Bases:\x20','new','5229040xsMbXw','Source:\x20','agent','reason','knowledgeBases','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','repeat','\x20\x20Knowledge\x20Bases:\x20','counts','\x20\x20Prompts:\x20','errors','Project:\x20','llmProject','\x0aPull\x20summary\x20for\x20\x27','newProjectName','newProjectId','Analyzing\x20project\x20\x22','Failed\x20to\x20push\x20agent:\x20','\x20=\x20','\x20\x20tdx\x20agent\x20pull\x20','dryRun','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','log','Pushing\x20to\x20project...','pushProject','yellow','error','\x0aChanges:','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','189707bzxsKr','\x22...','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','294ulFGgc','\x0aWrite\x20','utf-8','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','output','4YMUeap','message','Dry\x20run\x20-\x20no\x20files\x20written','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x22\x20from\x20project\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','sourceProjectName','Would\x20pull\x20agent:\x20','action','\x20\x20Agents:\x20','Using\x20current\x20project:\x20','Cloning\x20\x22','7zyWEpc','experimentalKnowledgeBases','found','integrations','\x20resources?','dim','New\x20project:\x20','cwd','agent:pull','393634FSbvwW','\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','force','129525selSjq','36ssrquf','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20--profile\x20','description','-\x20nothing\x20pushed','experimentalArtifacts','\x20created','\x22\x20to\x20a\x20different\x20profile','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','parse','diff','New\x20project\x20ID:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20|\x20','llm_project','textKnowledgeBases','Output\x20path:\x20','Errors:','projectDir','Output:\x20','outputDir','New\x20project\x20name\x20is\x20required','\x20files\x20to\x20','INVALID_ARGUMENT','push','gray','Chat:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Integrations:\x20','\x20\x20Knowledge\x20Base\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\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','\x0a✔\x20Pulled\x20','pullProject','\x20successfully','\x22:\x20','\x22\x20to\x20\x22','Cancelled','Would\x20push\x20agent:\x20','\x20total','Agent\x20pulled\x20successfully','site','\x20\x20Source:\x20','name','projectName','llm','Project\x20cloned\x20successfully','pullAgent','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','green','\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','Pulling\x20agent\x20\x22','join'];a4_0x5656=function(){return _0x17eefd;};return a4_0x5656();}export class AgentCloneCommand extends BaseCommand{[a4_0x17808e(0x1cb)]='agent:clone';['description']=a4_0x17808e(0x1a8);async['execute'](_0x31c7fc){const _0x4d420a=a4_0x17808e,{options:_0x1f8868,args:_0x42fb18,tdx:_0x113752}=_0x31c7fc,_0x2a5f7d=_0x42fb18[0x0],_0x5c9e45=_0x1f8868[_0x4d420a(0x1cb)],_0x571dd4=_0x1f8868[_0x4d420a(0x173)],_0x20aecd=_0x1f8868[_0x4d420a(0x1e4)],_0x56d7cf=_0x1f8868[_0x4d420a(0x1c9)],_0x3bc44b=_0x1f8868[_0x4d420a(0x16b)];let _0x277c0e;const _0x3a5bef=findAgentConfigPath(process[_0x4d420a(0x198)]());if(_0x2a5f7d){const _0x55363a=a4_0x3949d5[_0x4d420a(0x1d4)](_0x2a5f7d,_0x4d420a(0x20d));existsSync(_0x55363a)?(_0x277c0e=_0x2a5f7d,console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x196)]('Using\x20local\x20project:\x20'+_0x2a5f7d))):_0x277c0e=_0x2a5f7d;}else{if(_0x3a5bef)_0x277c0e=a4_0x3949d5[_0x4d420a(0x1eb)](_0x3a5bef),console['log'](a4_0x5e1f1c[_0x4d420a(0x196)](_0x4d420a(0x18f)+_0x277c0e));else{if(_0x3bc44b){const _0x4969ae=sanitizeForFilesystem(_0x3bc44b);let _0x39bad6=_0x4969ae,_0x7c6023=a4_0x3949d5[_0x4d420a(0x1d4)](process['cwd'](),_0x4d420a(0x1e9),_0x4969ae,_0x4d420a(0x20d));if(!existsSync(_0x7c6023)){const _0x385bac=normalizeName(_0x3bc44b),_0xdc733d=a4_0x3949d5['join'](process[_0x4d420a(0x198)](),_0x4d420a(0x1e9),_0x385bac,'tdx.json');existsSync(_0xdc733d)&&(_0x39bad6=_0x385bac,_0x7c6023=_0xdc733d);}if(existsSync(_0x7c6023))_0x277c0e=a4_0x3949d5[_0x4d420a(0x1eb)](_0x7c6023),console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x196)](_0x4d420a(0x1de)+_0x277c0e));else{const _0x1f35e6=_0x1f8868[_0x4d420a(0x1f1)];if(_0x1f35e6)throw new SDKError(ErrorCode[_0x4d420a(0x1b7)],_0x4d420a(0x1be)+_0x3bc44b+_0x4d420a(0x1a5),undefined,{'helpText':_0x4d420a(0x174)+_0x4d420a(0x1d0)+(_0x4d420a(0x172)+_0x3bc44b+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x39bad6+'\x20--name\x20'+(_0x5c9e45||'<new-name>')+_0x4d420a(0x1a0)+_0x1f35e6)});_0x277c0e=_0x3bc44b,console[_0x4d420a(0x175)](a4_0x5e1f1c['dim'](_0x4d420a(0x1ed)+_0x3bc44b));}}}}if(!_0x277c0e)return console[_0x4d420a(0x175)](a4_0x5e1f1c['yellow'](_0x4d420a(0x202))),console[_0x4d420a(0x175)](_0x4d420a(0x1ef)),console['log'](_0x4d420a(0x1ac)),console[_0x4d420a(0x175)](_0x4d420a(0x1fc)),console['log'](_0x4d420a(0x1d8)),0x1;if(!_0x5c9e45)throw new SDKError(ErrorCode[_0x4d420a(0x1e8)],_0x4d420a(0x1b5),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x20aecd&&!_0x571dd4){if(!isInteractive())return console[_0x4d420a(0x179)](a4_0x5e1f1c[_0x4d420a(0x207)]('\x0aError:'),_0x4d420a(0x183)),console[_0x4d420a(0x179)](a4_0x5e1f1c[_0x4d420a(0x196)](_0x4d420a(0x188))),0x1;const _0x506f6c=await confirmKey(_0x4d420a(0x1df)+_0x277c0e+_0x4d420a(0x155)+_0x5c9e45+'\x22?');if(!_0x506f6c)return console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x178)](_0x4d420a(0x1c5))),0x1;}const {data:_0x5cd3a5}=await withSpinner(_0x4d420a(0x190)+_0x277c0e+_0x4d420a(0x1c4)+_0x5c9e45+_0x4d420a(0x17d),()=>_0x113752[_0x4d420a(0x1cd)]['cloneProject'](_0x277c0e,_0x5c9e45,{'dryRun':_0x571dd4}));if(_0x571dd4){console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x178)](_0x4d420a(0x1f8))),console[_0x4d420a(0x175)](_0x4d420a(0x160)+_0x5cd3a5[_0x4d420a(0x18b)]),console[_0x4d420a(0x175)](_0x4d420a(0x197)+_0x5c9e45),console[_0x4d420a(0x175)]('Would\x20clone:'),console['log'](_0x4d420a(0x18e)+_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1e9)][_0x4d420a(0x1d5)]),console[_0x4d420a(0x175)]('\x20\x20Knowledge\x20Bases:\x20'+_0x5cd3a5[_0x4d420a(0x167)]['knowledgeBases'][_0x4d420a(0x1d5)]),console[_0x4d420a(0x175)]('\x20\x20Prompts:\x20'+_0x5cd3a5['counts']['prompts']['created']);const _0x2010a2=_0x5cd3a5[_0x4d420a(0x167)]['experimentalKnowledgeBases'][_0x4d420a(0x1d5)]>0x0||_0x5cd3a5[_0x4d420a(0x167)]['experimentalArtifacts'][_0x4d420a(0x1d5)]>0x0;return _0x2010a2&&(console[_0x4d420a(0x175)](_0x4d420a(0x1d6)+_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x192)]['created']),console[_0x4d420a(0x175)](_0x4d420a(0x15b)+_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1a3)][_0x4d420a(0x1d5)])),0x0;}const _0x40ae28=_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1e9)][_0x4d420a(0x169)]>0x0||_0x5cd3a5[_0x4d420a(0x167)]['knowledgeBases'][_0x4d420a(0x169)]>0x0||_0x5cd3a5[_0x4d420a(0x167)]['prompts'][_0x4d420a(0x169)]>0x0||_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x192)][_0x4d420a(0x169)]>0x0||_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1a3)][_0x4d420a(0x169)]>0x0;_0x40ae28?console['log'](a4_0x5e1f1c[_0x4d420a(0x178)]('Project\x20cloned\x20with\x20errors')):console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x1d1)](_0x4d420a(0x1ce)));console[_0x4d420a(0x175)](_0x4d420a(0x160)+_0x5cd3a5[_0x4d420a(0x18b)]),console[_0x4d420a(0x175)](_0x4d420a(0x197)+_0x5cd3a5[_0x4d420a(0x16d)]),console['log'](_0x4d420a(0x1ab)+_0x5cd3a5[_0x4d420a(0x16e)]),console[_0x4d420a(0x175)](),console[_0x4d420a(0x175)]('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x5cd3a5[_0x4d420a(0x167)]['agents'])),console[_0x4d420a(0x175)](_0x4d420a(0x166)+formatCountSummary(_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x163)])),console[_0x4d420a(0x175)](_0x4d420a(0x168)+formatCountSummary(_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1e0)])),console['log'](_0x4d420a(0x1bc)+formatCountSummary(_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x194)]));const _0x1558c0=_0x5cd3a5[_0x4d420a(0x167)]['experimentalKnowledgeBases'][_0x4d420a(0x1d5)]>0x0||_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x192)]['updated']>0x0||_0x5cd3a5['counts'][_0x4d420a(0x192)][_0x4d420a(0x20a)]>0x0||_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1a3)][_0x4d420a(0x1d5)]>0x0||_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1a3)][_0x4d420a(0x1fd)]>0x0||_0x5cd3a5['counts'][_0x4d420a(0x1a3)][_0x4d420a(0x20a)]>0x0;_0x1558c0&&(console[_0x4d420a(0x175)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x192)])),console['log'](_0x4d420a(0x15b)+formatCountSummary(_0x5cd3a5[_0x4d420a(0x167)][_0x4d420a(0x1a3)])));if(_0x40ae28){console[_0x4d420a(0x175)](),console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x207)](_0x4d420a(0x1b1)));for(const _0x1b96ee of _0x5cd3a5[_0x4d420a(0x1e9)]){_0x1b96ee[_0x4d420a(0x18d)]==='error'&&console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x207)](_0x4d420a(0x15a)+_0x1b96ee[_0x4d420a(0x1d9)]+_0x4d420a(0x1c3)+_0x1b96ee[_0x4d420a(0x179)]));}for(const _0x1081ad of _0x5cd3a5[_0x4d420a(0x163)]){_0x1081ad[_0x4d420a(0x18d)]==='error'&&console[_0x4d420a(0x175)](a4_0x5e1f1c['red'](_0x4d420a(0x1bd)+_0x1081ad[_0x4d420a(0x1cb)]+_0x4d420a(0x1c3)+_0x1081ad[_0x4d420a(0x179)]));}for(const _0x1a2d5c of _0x5cd3a5['prompts']){_0x1a2d5c[_0x4d420a(0x18d)]===_0x4d420a(0x179)&&console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x207)]('\x20\x20Prompt\x20\x22'+_0x1a2d5c[_0x4d420a(0x1cb)]+_0x4d420a(0x1c3)+_0x1a2d5c[_0x4d420a(0x179)]));}for(const _0x435bb8 of _0x5cd3a5[_0x4d420a(0x194)]){_0x435bb8['action']===_0x4d420a(0x179)&&console[_0x4d420a(0x175)](a4_0x5e1f1c['red']('\x20\x20Integration\x20\x22'+_0x435bb8[_0x4d420a(0x1cb)]+'\x22:\x20'+_0x435bb8[_0x4d420a(0x179)]));}for(const _0x207bff of _0x5cd3a5[_0x4d420a(0x192)]){_0x207bff[_0x4d420a(0x18d)]===_0x4d420a(0x179)&&console['log'](a4_0x5e1f1c[_0x4d420a(0x207)](_0x4d420a(0x1e7)+_0x207bff['name']+_0x4d420a(0x1c3)+_0x207bff[_0x4d420a(0x179)]));}for(const _0x4c7799 of _0x5cd3a5[_0x4d420a(0x1a3)]){_0x4c7799[_0x4d420a(0x18d)]===_0x4d420a(0x179)&&console[_0x4d420a(0x175)](a4_0x5e1f1c[_0x4d420a(0x207)](_0x4d420a(0x18a)+_0x4c7799[_0x4d420a(0x1cb)]+_0x4d420a(0x1c3)+_0x4c7799['error']));}return 0x1;}console[_0x4d420a(0x175)]();const _0x15f8a5=getLLMProjectUrl(_0x56d7cf,_0x5cd3a5[_0x4d420a(0x16e)]);return console[_0x4d420a(0x175)]('Project:\x20'+a4_0x5e1f1c[_0x4d420a(0x157)](_0x15f8a5)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x17808e(0x1cb)]=a4_0x17808e(0x1f9);['description']=a4_0x17808e(0x1e1);async[a4_0x17808e(0x1e3)](_0x2ed78e){const _0x86fa46=a4_0x17808e,{options:_0x25733e,args:_0x10d67d,tdx:_0xe3ce97}=_0x2ed78e;let _0x373f53=_0x10d67d[0x0]||process[_0x86fa46(0x198)]();const _0x168259=_0x25733e[_0x86fa46(0x173)],_0x426ad8=_0x25733e[_0x86fa46(0x19c)],_0x2ee30e=_0x25733e[_0x86fa46(0x1e4)],_0x5b9f73=_0x25733e[_0x86fa46(0x1c9)],_0x2969fe=a4_0x3949d5[_0x86fa46(0x1d4)](_0x373f53,'agent.yml'),_0x47cef1=existsSync(_0x2969fe);if(_0x47cef1){const {data:_0x17a89e}=await withSpinner(_0x86fa46(0x206)+_0x373f53+_0x86fa46(0x17d),()=>_0xe3ce97['llm']['pushAgent'](_0x373f53,{'dryRun':_0x168259,'force':_0x426ad8}));if(_0x168259)return console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x178)](_0x86fa46(0x1f8))),console[_0x86fa46(0x175)](_0x86fa46(0x1c6)+_0x17a89e[_0x86fa46(0x1d9)]),0x0;if(_0x17a89e['action']===_0x86fa46(0x179))return console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x207)](_0x86fa46(0x170)+_0x17a89e['error'])),0x1;console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x1d1)](_0x86fa46(0x158)+_0x17a89e[_0x86fa46(0x18d)]+_0x86fa46(0x1c2))),console[_0x86fa46(0x175)](_0x86fa46(0x1e6)+_0x17a89e[_0x86fa46(0x1d9)]);if(_0x17a89e['agentId']&&_0x17a89e[_0x86fa46(0x205)]){const _0x27132b=getLLMAgentChatUrl(_0x5b9f73,_0x17a89e[_0x86fa46(0x205)],_0x17a89e[_0x86fa46(0x1fb)]);console[_0x86fa46(0x175)](_0x86fa46(0x1ba)+a4_0x5e1f1c[_0x86fa46(0x157)](_0x27132b));}return 0x0;}const _0x554425=_0x25733e[_0x86fa46(0x16b)],_0x133d34=resolveProjectFromContext(_0x373f53,_0x554425);if(_0x133d34[_0x86fa46(0x193)])_0x373f53=_0x133d34[_0x86fa46(0x1b2)],_0x133d34[_0x86fa46(0x15c)]===_0x86fa46(0x1e5)&&console['log'](a4_0x5e1f1c['dim']('Using\x20project:\x20'+_0x373f53));else{let _0x1b910e='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x133d34[_0x86fa46(0x162)]===_0x86fa46(0x1dc)&&(_0x1b910e=_0x133d34[_0x86fa46(0x186)]+_0x86fa46(0x17e)+_0x133d34[_0x86fa46(0x16b)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x133d34['reason']===_0x86fa46(0x1fa)?_0x133d34[_0x86fa46(0x186)]:'No\x20tdx.json\x20found\x20in\x20'+_0x373f53,undefined,{'helpText':_0x1b910e});}const {data:_0x5af89f}=await withSpinner(_0x86fa46(0x1ff),()=>_0xe3ce97[_0x86fa46(0x1cd)][_0x86fa46(0x177)](_0x373f53,{'dryRun':!![]})),_0x3fa02a=_0x5af89f[_0x86fa46(0x167)]['agents'][_0x86fa46(0x169)]>0x0;if(_0x3fa02a){console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x207)](_0x86fa46(0x159)));for(const _0xf6b84f of _0x5af89f[_0x86fa46(0x1e9)]){_0xf6b84f[_0x86fa46(0x18d)]==='error'&&console[_0x86fa46(0x175)](a4_0x5e1f1c['red'](_0x86fa46(0x15a)+_0xf6b84f['agentName']+_0x86fa46(0x1c3)+_0xf6b84f[_0x86fa46(0x179)]));}return 0x1;}const _0x28afc9=_0x5af89f['counts'][_0x86fa46(0x1e9)]['created']+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x163)][_0x86fa46(0x1d5)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1af)][_0x86fa46(0x1d5)]+_0x5af89f[_0x86fa46(0x167)]['prompts'][_0x86fa46(0x1d5)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x194)][_0x86fa46(0x1d5)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x192)]['created']+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1a3)]['created'],_0x3ea868=_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1e9)][_0x86fa46(0x1fd)]+_0x5af89f[_0x86fa46(0x167)]['knowledgeBases'][_0x86fa46(0x1fd)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1af)][_0x86fa46(0x1fd)]+_0x5af89f[_0x86fa46(0x167)]['prompts'][_0x86fa46(0x1fd)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x194)][_0x86fa46(0x1fd)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x192)][_0x86fa46(0x1fd)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1a3)]['updated'],_0x5e6489=_0x5af89f['counts'][_0x86fa46(0x1e9)][_0x86fa46(0x20a)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x163)][_0x86fa46(0x20a)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1af)][_0x86fa46(0x20a)]+_0x5af89f[_0x86fa46(0x167)]['prompts'][_0x86fa46(0x20a)]+_0x5af89f['counts'][_0x86fa46(0x194)][_0x86fa46(0x20a)]+_0x5af89f[_0x86fa46(0x167)]['experimentalKnowledgeBases'][_0x86fa46(0x20a)]+_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1a3)][_0x86fa46(0x20a)];console[_0x86fa46(0x175)]('\x0aPush\x20summary\x20for\x20\x27'+_0x5af89f[_0x86fa46(0x1cc)]+'\x27:'),console['log']('\x20\x20'+a4_0x5e1f1c[_0x86fa46(0x1d1)]('+\x20'+_0x28afc9+_0x86fa46(0x1ec))+_0x86fa46(0x1ad)+a4_0x5e1f1c['yellow']('~\x20'+_0x3ea868+_0x86fa46(0x1f4))+_0x86fa46(0x1ad)+a4_0x5e1f1c[_0x86fa46(0x196)]('=\x20'+_0x5e6489+_0x86fa46(0x200))),console[_0x86fa46(0x175)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1e9)])),console[_0x86fa46(0x175)](_0x86fa46(0x166)+formatCountSummary(_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x163)])),console[_0x86fa46(0x175)](_0x86fa46(0x15d)+formatCountSummary(_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1af)])),console['log'](_0x86fa46(0x168)+formatCountSummary(_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1e0)])),console[_0x86fa46(0x175)](_0x86fa46(0x1bc)+formatCountSummary(_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x194)]));const _0x5c9bc8=_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x192)][_0x86fa46(0x1d5)]>0x0||_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x192)]['updated']>0x0||_0x5af89f['counts'][_0x86fa46(0x192)][_0x86fa46(0x20a)]>0x0||_0x5af89f['counts'][_0x86fa46(0x1a3)][_0x86fa46(0x1d5)]>0x0||_0x5af89f['counts'][_0x86fa46(0x1a3)][_0x86fa46(0x1fd)]>0x0||_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x1a3)][_0x86fa46(0x20a)]>0x0;_0x5c9bc8&&(console[_0x86fa46(0x175)](_0x86fa46(0x1d6)+formatCountSummary(_0x5af89f[_0x86fa46(0x167)][_0x86fa46(0x192)])),console[_0x86fa46(0x175)](_0x86fa46(0x15b)+formatCountSummary(_0x5af89f[_0x86fa46(0x167)]['experimentalArtifacts'])));console[_0x86fa46(0x175)](_0x86fa46(0x1ca)+a4_0x5e1f1c[_0x86fa46(0x157)](_0x373f53)),displayDiffs(_0x5af89f[_0x86fa46(0x1e9)],_0x5af89f[_0x86fa46(0x163)],_0x5af89f[_0x86fa46(0x1af)],_0x5af89f['prompts'],_0x5af89f['integrations'],_0x5af89f[_0x86fa46(0x192)],_0x5af89f[_0x86fa46(0x1a3)]);if(_0x168259)return console['log'](a4_0x5e1f1c['yellow'](_0x86fa46(0x19f))),0x0;if(_0x28afc9===0x0&&_0x3ea868===0x0){console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x1d1)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x12e007=getLLMProjectUrl(_0x5b9f73,_0x5af89f[_0x86fa46(0x205)]);return console[_0x86fa46(0x175)](_0x86fa46(0x16a)+a4_0x5e1f1c[_0x86fa46(0x157)](_0x12e007)),0x0;}if(!_0x2ee30e&&!_0x426ad8){if(!isInteractive())return console[_0x86fa46(0x179)](a4_0x5e1f1c[_0x86fa46(0x207)](_0x86fa46(0x1ee)),_0x86fa46(0x183)),console['error'](a4_0x5e1f1c[_0x86fa46(0x196)](_0x86fa46(0x188))),0x1;const _0x5ee25e=await confirmKey('\x0aPush\x20'+(_0x28afc9+_0x3ea868)+_0x86fa46(0x195));if(!_0x5ee25e)return console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x178)](_0x86fa46(0x1c5)),_0x86fa46(0x1a2)),0x1;}const {data:_0xc81546}=await withSpinner(_0x86fa46(0x176),()=>_0xe3ce97[_0x86fa46(0x1cd)]['pushProject'](_0x373f53,{'force':_0x426ad8})),_0xfe83a1=_0xc81546[_0x86fa46(0x167)][_0x86fa46(0x1e9)]['errors']>0x0||_0xc81546[_0x86fa46(0x167)][_0x86fa46(0x163)]['errors']>0x0||_0xc81546[_0x86fa46(0x167)][_0x86fa46(0x1af)][_0x86fa46(0x169)]>0x0||_0xc81546['counts']['prompts']['errors']>0x0;if(_0xfe83a1){console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x178)](_0x86fa46(0x1dd))),console[_0x86fa46(0x175)](),console['log'](a4_0x5e1f1c[_0x86fa46(0x207)]('Errors:'));for(const _0x10349d of _0xc81546[_0x86fa46(0x1e9)]){_0x10349d[_0x86fa46(0x18d)]==='error'&&console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x207)](_0x86fa46(0x15a)+_0x10349d[_0x86fa46(0x1d9)]+_0x86fa46(0x1c3)+_0x10349d[_0x86fa46(0x179)]));}for(const _0xb2fe4e of _0xc81546[_0x86fa46(0x163)]){_0xb2fe4e[_0x86fa46(0x18d)]===_0x86fa46(0x179)&&console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x207)](_0x86fa46(0x1bd)+_0xb2fe4e[_0x86fa46(0x1cb)]+_0x86fa46(0x1c3)+_0xb2fe4e[_0x86fa46(0x179)]));}for(const _0x587c76 of _0xc81546[_0x86fa46(0x1af)]){_0x587c76['action']===_0x86fa46(0x179)&&console['log'](a4_0x5e1f1c[_0x86fa46(0x207)](_0x86fa46(0x1f7)+_0x587c76['name']+_0x86fa46(0x1c3)+_0x587c76[_0x86fa46(0x179)]));}for(const _0x36aa77 of _0xc81546[_0x86fa46(0x1e0)]){_0x36aa77[_0x86fa46(0x18d)]===_0x86fa46(0x179)&&console['log'](a4_0x5e1f1c['red']('\x20\x20Prompt\x20\x22'+_0x36aa77[_0x86fa46(0x1cb)]+'\x22:\x20'+_0x36aa77[_0x86fa46(0x179)]));}for(const _0x48a02b of _0xc81546['integrations']){_0x48a02b['action']==='error'&&console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x207)]('\x20\x20Integration\x20\x22'+_0x48a02b['name']+_0x86fa46(0x1c3)+_0x48a02b[_0x86fa46(0x179)]));}return 0x1;}console[_0x86fa46(0x175)](a4_0x5e1f1c[_0x86fa46(0x1d1)](_0x86fa46(0x156)+(_0x28afc9+_0x3ea868)+_0x86fa46(0x1f5)+_0xc81546['projectName']+'\x27'));const _0x5ee9c2=getLLMProjectUrl(_0x5b9f73,_0xc81546[_0x86fa46(0x205)]);return console[_0x86fa46(0x175)](_0x86fa46(0x16a)+a4_0x5e1f1c[_0x86fa46(0x157)](_0x5ee9c2)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x479a(){const _0x547462=['Site:\x20','Failed:\x20\x20\x20','Executing\x20new\x20tests...','eval','tags','Running\x20test:\x20','dryRun','red','execute','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Re-evaluation\x20Summary','basename','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Site:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agent','verbose','Agent:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x22:\x20','no_tests','3136QDZppy','round','push','Cached\x20run\x20is\x20from\x20site\x20\x22','output','Re-evaluating...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','1422WUUaEu','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20Conversation:\x20','not\x20found','test.yml','Error\x20writing\x20output\x20file:\x20','has','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','description','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20-\x20','writeFileSync','map','utf-8','toISOString','404','now','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','site','find','Using\x20agent:\x20','4638bFmjTq','agent:test','forEach','size','Running\x20agent\x20tests...','split','845702rBtALH','9418770EFsMdB','\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','yellow','2023xFsjFf','no_local_folder','✗\x20FAIL:\x20','cyan','FAIL','989110ncibqQ','rounds','\x20\x20Evaluating...\x20','jsonl','log','...\x20','Either\x20switch\x20to\x20the\x20\x22','Available\x20tags:\x20','\x20\x20Round\x20','5885vUJpFR','includes','timestamp','filter','492BhQcpu','Total:\x20\x20\x20\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','toLowerCase','/<agent-name>','\x20\x20Agent:\x20','\x20-\x20','testName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','tsv','Run\x20tests\x20for\x20an\x20LLM\x20agent','reason','Test\x20Summary','length','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','projectName','substring','Round\x201/','31904NNthnl','stop','executeReeval','dim','resolve','No\x20tests\x20have\x20tags\x20defined.','Passed:\x20\x20\x20','name','Round\x20','Test\x20Configuration:','context','\x20(cached)','PASS','add','message','agentDirs','green','white','projectDir','llm','Re-evaluating\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','isSpinning','llmProject','Run\x20\x27tdx\x20agent\x20pull\x20','start','Failed\x20Tests:','resolveAgentId','...','status','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','31IkNCIn','source','✗\x20ERROR:\x20Project\x20not\x20found:\x20','text','✓\x20PASS:\x20',':\x20Sending\x20user\x20input...','repeat','table','22qcwoeO','some','json','✗\x20ERROR:\x20','tests','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20(new)','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Errors:\x20\x20\x20','Tests\x20found:\x20','conversation_url','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20found\x20with\x20tags:\x20','trim','ERROR','join','agentName','16138WfGJwH','Conversation\x20URL:\x20'];a5_0x479a=function(){return _0x547462;};return a5_0x479a();}const a5_0x34ce8d=a5_0x4a29;(function(_0x5568dd,_0x3c18bd){const _0x2ab620=a5_0x4a29,_0x33e82f=_0x5568dd();while(!![]){try{const _0x4bee22=parseInt(_0x2ab620(0x241))/0x1*(-parseInt(_0x2ab620(0x25a))/0x2)+-parseInt(_0x2ab620(0x1f3))/0x3*(parseInt(_0x2ab620(0x271))/0x4)+parseInt(_0x2ab620(0x20b))/0x5*(-parseInt(_0x2ab620(0x278))/0x6)+parseInt(_0x2ab620(0x1fd))/0x7*(-parseInt(_0x2ab620(0x222))/0x8)+parseInt(_0x2ab620(0x1fa))/0x9+-parseInt(_0x2ab620(0x202))/0xa*(parseInt(_0x2ab620(0x249))/0xb)+-parseInt(_0x2ab620(0x20f))/0xc*(-parseInt(_0x2ab620(0x1f9))/0xd);if(_0x4bee22===_0x3c18bd)break;else _0x33e82f['push'](_0x33e82f['shift']());}catch(_0xcf71a5){_0x33e82f['push'](_0x33e82f['shift']());}}}(a5_0x479a,0x97e9e));import*as a5_0x2424ec from'node:fs';import*as a5_0x8edcf9 from'node:path';import a5_0x3f085d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x4a29(_0x2c8a57,_0x473a0b){_0x2c8a57=_0x2c8a57-0x1e6;const _0x479ab6=a5_0x479a();let _0x4a2996=_0x479ab6[_0x2c8a57];return _0x4a2996;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x34ce8d(0x229)]=a5_0x34ce8d(0x1f4);[a5_0x34ce8d(0x1e6)]=a5_0x34ce8d(0x21a);async[a5_0x34ce8d(0x264)](_0x3d19de){const _0x51fb47=a5_0x34ce8d,{options:_0x2e0451,args:_0x1344ad,tdx:_0x339337}=_0x3d19de,_0x3ec1c0=_0x1344ad[0x0]||'.',_0x3f96a2=_0x2e0451[_0x51fb47(0x262)],_0x3ecbbe=_0x2e0451,_0x1167ec=_0x3ecbbe[_0x51fb47(0x25f)]===![],_0x3555c4=_0x3ecbbe['reeval'],_0x4e1f44=_0x3ecbbe[_0x51fb47(0x229)],_0x1fc391=_0x3ecbbe[_0x51fb47(0x260)],_0x3b88fb=_0x2e0451['site'],_0x50da0f=_0x3ecbbe[_0x51fb47(0x275)];if(_0x3555c4&&_0x1167ec)return console['log'](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x26a))),0x1;let _0x4fe691=_0x51fb47(0x248);if(_0x3ecbbe[_0x51fb47(0x24b)])_0x4fe691='json';else{if(_0x3ecbbe[_0x51fb47(0x205)])_0x4fe691=_0x51fb47(0x205);else{if(_0x3ecbbe[_0x51fb47(0x219)])_0x4fe691=_0x51fb47(0x219);else{if(_0x3ecbbe[_0x51fb47(0x248)])_0x4fe691=_0x51fb47(0x248);}}}const _0x3d898d=_0x3ecbbe[_0x51fb47(0x239)];let _0x23c783=_0x3ec1c0;const _0x425d48=a5_0x2424ec['existsSync'](_0x3ec1c0),_0x9f918f=_0x3ec1c0==='.';if(!_0x425d48||_0x9f918f){const _0x26a8ed=resolveProjectFromContext(_0x3ec1c0,_0x3d898d,{'requireFile':_0x51fb47(0x27c)});if(_0x26a8ed['found'])_0x23c783=_0x26a8ed[_0x51fb47(0x234)],_0x26a8ed[_0x51fb47(0x242)]===_0x51fb47(0x22c)&&console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)](_0x51fb47(0x1f2)+_0x23c783));else switch(_0x26a8ed[_0x51fb47(0x21b)]){case'no_context':console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)](_0x26a8ed[_0x51fb47(0x230)])),console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)]('Usage:'),console['log'](_0x51fb47(0x1fb)),console[_0x51fb47(0x206)](_0x51fb47(0x237)),console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](_0x51fb47(0x212));return 0x1;case _0x51fb47(0x1fe):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)](_0x26a8ed[_0x51fb47(0x230)])),console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](_0x51fb47(0x23a)+_0x26a8ed['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x5b5d14=a5_0x8edcf9[_0x51fb47(0x267)](_0x26a8ed[_0x51fb47(0x234)]);console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)](_0x51fb47(0x218)+_0x26a8ed[_0x51fb47(0x239)]+'\x22:'));for(const _0x13f84f of _0x26a8ed[_0x51fb47(0x231)]){console[_0x51fb47(0x206)](_0x51fb47(0x1e8)+_0x13f84f);}return console[_0x51fb47(0x206)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x5b5d14+_0x51fb47(0x214)),0x1;}case _0x51fb47(0x270):console[_0x51fb47(0x206)](a5_0x3f085d['yellow'](_0x51fb47(0x21e)+_0x26a8ed[_0x51fb47(0x239)]+'\x22.')),console['log'](a5_0x3f085d[_0x51fb47(0x225)]('Project\x20path:\x20'+_0x26a8ed[_0x51fb47(0x234)])),console['log'](),console[_0x51fb47(0x206)](_0x51fb47(0x277));return 0x1;}}const {definition:_0x405533,agentInfo:_0x1949d1}=parseTestFile(_0x23c783);let _0xf331ad=_0x405533[_0x51fb47(0x24d)];if(_0x4e1f44){const _0x9cc017=_0x4e1f44[_0x51fb47(0x1f8)](',')[_0x51fb47(0x1ea)](_0x39f8df=>_0x39f8df[_0x51fb47(0x256)]());_0xf331ad=_0x405533['tests']['filter'](_0x5a3b3f=>_0x9cc017[_0x51fb47(0x20c)](_0x5a3b3f[_0x51fb47(0x229)]));if(_0xf331ad[_0x51fb47(0x21d)]===0x0)return console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)]('No\x20tests\x20found\x20matching:\x20'+_0x4e1f44)),console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)]('Available\x20tests:\x20'+_0x405533['tests'][_0x51fb47(0x1ea)](_0x40a40c=>_0x40a40c[_0x51fb47(0x229)])[_0x51fb47(0x258)](',\x20'))),0x1;}if(_0x1fc391){const _0x31e34a=_0x1fc391[_0x51fb47(0x1f8)](',')[_0x51fb47(0x1ea)](_0x1dced8=>_0x1dced8[_0x51fb47(0x256)]()[_0x51fb47(0x213)]());_0xf331ad=_0xf331ad[_0x51fb47(0x20e)](_0x5c922c=>_0x5c922c['tags']?.[_0x51fb47(0x24a)](_0x33b9ec=>_0x31e34a[_0x51fb47(0x20c)](_0x33b9ec[_0x51fb47(0x213)]())));if(_0xf331ad[_0x51fb47(0x21d)]===0x0){console['log'](a5_0x3f085d[_0x51fb47(0x1fc)](_0x51fb47(0x255)+_0x1fc391));const _0x11e2a3=new Set();return _0x405533[_0x51fb47(0x24d)][_0x51fb47(0x1f5)](_0x44985b=>_0x44985b[_0x51fb47(0x260)]?.[_0x51fb47(0x1f5)](_0x4a31f3=>_0x11e2a3[_0x51fb47(0x22f)](_0x4a31f3))),_0x11e2a3[_0x51fb47(0x1f6)]>0x0?console['log'](a5_0x3f085d['dim'](_0x51fb47(0x209)+[..._0x11e2a3][_0x51fb47(0x258)](',\x20'))):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)](_0x51fb47(0x227))),0x1;}}if(_0x3555c4)return this[_0x51fb47(0x224)](_0x3d19de,{'definition':{'tests':_0xf331ad},'agentInfo':_0x1949d1,'outputFormat':_0x4fe691,'outputFile':_0x50da0f,'testNames':_0x4e1f44});if(_0x3f96a2){console[_0x51fb47(0x206)](a5_0x3f085d['cyan'](_0x51fb47(0x22b))),console[_0x51fb47(0x206)](_0x51fb47(0x269)+a5_0x3f085d[_0x51fb47(0x233)](_0x3b88fb)),console[_0x51fb47(0x206)]('\x20\x20Project:\x20'+a5_0x3f085d[_0x51fb47(0x233)](_0x1949d1['projectName'])),console[_0x51fb47(0x206)](_0x51fb47(0x215)+a5_0x3f085d[_0x51fb47(0x233)](_0x1949d1[_0x51fb47(0x259)])),console['log'](),console[_0x51fb47(0x206)](_0x51fb47(0x252)+a5_0x3f085d[_0x51fb47(0x233)](_0xf331ad[_0x51fb47(0x21d)]));for(let _0x4d956d=0x0;_0x4d956d<_0xf331ad[_0x51fb47(0x21d)];_0x4d956d++){const _0x2ec82d=_0xf331ad[_0x4d956d],_0x8ff889=_0x2ec82d['rounds']['length']===0x1?_0x51fb47(0x272):_0x51fb47(0x203),_0x7edef1=_0x2ec82d[_0x51fb47(0x260)]?.[_0x51fb47(0x21d)]?'\x20['+_0x2ec82d[_0x51fb47(0x260)][_0x51fb47(0x258)](',\x20')+']':'';console[_0x51fb47(0x206)]('\x20\x20'+(_0x4d956d+0x1)+'.\x20'+a5_0x3f085d[_0x51fb47(0x233)](_0x2ec82d[_0x51fb47(0x229)])+'\x20('+_0x2ec82d[_0x51fb47(0x203)][_0x51fb47(0x21d)]+'\x20'+_0x8ff889+')'+a5_0x3f085d[_0x51fb47(0x225)](_0x7edef1));}return 0x0;}let _0x2dccc3,_0x52fcdf;try{_0x2dccc3=await _0x339337[_0x51fb47(0x235)]['resolveProjectId'](_0x1949d1[_0x51fb47(0x21f)]);}catch(_0x1a6a10){const _0x570222=_0x1a6a10 instanceof Error?_0x1a6a10[_0x51fb47(0x230)]:String(_0x1a6a10);return _0x570222[_0x51fb47(0x20c)](_0x51fb47(0x1ed))||_0x570222[_0x51fb47(0x213)]()[_0x51fb47(0x20c)]('not\x20found')?console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x243)+_0x1949d1[_0x51fb47(0x21f)])):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x1ef)+_0x1949d1['projectName']+_0x51fb47(0x26f)+_0x570222)),0x1;}try{_0x52fcdf=await _0x339337[_0x51fb47(0x235)][_0x51fb47(0x23d)](_0x1949d1[_0x51fb47(0x259)],_0x2dccc3);}catch(_0x1c4b72){const _0xa8afe8=_0x1c4b72 instanceof Error?_0x1c4b72[_0x51fb47(0x230)]:String(_0x1c4b72);return _0xa8afe8[_0x51fb47(0x20c)](_0x51fb47(0x1ed))||_0xa8afe8['toLowerCase']()[_0x51fb47(0x20c)](_0x51fb47(0x27b))?console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1949d1[_0x51fb47(0x259)])):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x27f)+_0x1949d1[_0x51fb47(0x259)]+'\x22:\x20'+_0xa8afe8)),0x1;}let _0x197204;if(!_0x1167ec)try{_0x197204=await setupEvaluatorAgent(_0x339337[_0x51fb47(0x235)],_0x2e0451[_0x51fb47(0x26c)]);}catch(_0x179760){const _0x1623fd=_0x179760 instanceof Error?_0x179760[_0x51fb47(0x230)]:String(_0x179760);return console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x1e7)+_0x1623fd)),0x1;}console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x200)](_0x51fb47(0x1f7))),console['log'](_0x51fb47(0x25c)+a5_0x3f085d[_0x51fb47(0x233)](_0x3b88fb)),console[_0x51fb47(0x206)](_0x51fb47(0x26d)+a5_0x3f085d[_0x51fb47(0x233)](_0x1949d1[_0x51fb47(0x21f)]+'/'+_0x1949d1[_0x51fb47(0x259)])),console[_0x51fb47(0x206)]();const _0x2f6afe=[],_0x39febf=[],_0x3ddda5=Date[_0x51fb47(0x1ee)]();for(let _0x3465be=0x0;_0x3465be<_0xf331ad['length'];_0x3465be++){const _0x38e407=_0xf331ad[_0x3465be];_0xf331ad['length']>0x1?console[_0x51fb47(0x206)]('Test\x20'+(_0x3465be+0x1)+'/'+_0xf331ad[_0x51fb47(0x21d)]+':\x20'+a5_0x3f085d['white'](_0x38e407['name'])):console[_0x51fb47(0x206)](_0x51fb47(0x261)+a5_0x3f085d['white'](_0x38e407[_0x51fb47(0x229)]));const _0x22f267=createCommandSpinner(_0x51fb47(0x221)+_0x38e407[_0x51fb47(0x203)][_0x51fb47(0x21d)]+_0x51fb47(0x246));_0x22f267[_0x51fb47(0x23b)]();try{const {result:_0x44cf6a,conversation:_0x546494}=await runTest(_0x339337[_0x51fb47(0x235)],_0x38e407,{'agentId':_0x52fcdf,'projectId':_0x2dccc3,'site':_0x3b88fb,'noEval':_0x1167ec,'evaluatorId':_0x197204,'onRoundStart':(_0x46c0cf,_0x373804)=>{const _0x143111=_0x51fb47;_0x22f267[_0x143111(0x244)]='Round\x20'+(_0x46c0cf+0x1)+'/'+_0x373804+_0x143111(0x246);},'onRoundComplete':(_0x4afde2,_0x1c1213,_0xa7083b)=>{const _0x1e73ad=_0x51fb47,_0x81e9b0=formatElapsed(_0x1c1213);_0xa7083b?console[_0x1e73ad(0x206)](_0x1e73ad(0x20a)+(_0x4afde2+0x1)+'/'+_0x38e407['rounds']['length']+_0x1e73ad(0x207)+a5_0x3f085d[_0x1e73ad(0x232)]('✓')+'\x20('+_0x81e9b0+')'):console['log']('\x20\x20Round\x20'+(_0x4afde2+0x1)+'/'+_0x38e407['rounds'][_0x1e73ad(0x21d)]+'...\x20'+a5_0x3f085d['red']('✗'));},'onEvaluationStart':()=>{const _0x1e8d4e=_0x51fb47;_0x22f267[_0x1e8d4e(0x244)]='Evaluating\x20response...';},'onEvaluationComplete':_0x509867=>{const _0x41635e=_0x51fb47,_0x2c1e43=formatElapsed(_0x509867);console[_0x41635e(0x206)](_0x41635e(0x204)+a5_0x3f085d['green']('✓')+'\x20('+_0x2c1e43+')');}});_0x22f267['stop'](),_0x2f6afe['push'](_0x44cf6a),_0x39febf[_0x51fb47(0x273)](_0x546494);if(_0x44cf6a[_0x51fb47(0x23f)]===_0x51fb47(0x22e))console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x232)](_0x51fb47(0x245)+_0x44cf6a[_0x51fb47(0x21b)]));else _0x44cf6a['status']===_0x51fb47(0x201)?console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x1ff)+_0x44cf6a[_0x51fb47(0x21b)])):console[_0x51fb47(0x206)](a5_0x3f085d['red']('✗\x20ERROR:\x20'+_0x44cf6a[_0x51fb47(0x21b)]));_0x44cf6a[_0x51fb47(0x253)]&&console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)](_0x51fb47(0x25b)+_0x44cf6a['conversation_url'])),console['log']();}catch(_0x4dac49){_0x22f267['stop']();const _0x4a41d9=_0x4dac49 instanceof Error?_0x4dac49[_0x51fb47(0x230)]:String(_0x4dac49);console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x24c)+_0x4a41d9)),console['log'](),_0x2f6afe[_0x51fb47(0x273)]({'name':_0x38e407[_0x51fb47(0x229)],'status':'ERROR','reason':_0x4a41d9,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0xdb96ed=Date[_0x51fb47(0x1ee)]()-_0x3ddda5,_0x11610f=_0x2f6afe[_0x51fb47(0x20e)](_0xd80314=>_0xd80314[_0x51fb47(0x23f)]===_0x51fb47(0x22e))[_0x51fb47(0x21d)],_0x52f354=_0x2f6afe[_0x51fb47(0x20e)](_0x449da0=>_0x449da0[_0x51fb47(0x23f)]===_0x51fb47(0x201))[_0x51fb47(0x21d)],_0x11de50=_0x2f6afe[_0x51fb47(0x20e)](_0x15c1c1=>_0x15c1c1['status']===_0x51fb47(0x257))[_0x51fb47(0x21d)];console[_0x51fb47(0x206)]('━'['repeat'](0x3c)),console[_0x51fb47(0x206)](_0x51fb47(0x21c)),console[_0x51fb47(0x206)]('━'[_0x51fb47(0x247)](0x3c)),console['log'](_0x51fb47(0x210)+_0x2f6afe[_0x51fb47(0x21d)]),console['log'](_0x51fb47(0x228)+a5_0x3f085d['green'](_0x11610f)),console[_0x51fb47(0x206)]('Failed:\x20\x20\x20'+a5_0x3f085d[_0x51fb47(0x263)](_0x52f354));_0x11de50>0x0&&console[_0x51fb47(0x206)](_0x51fb47(0x251)+a5_0x3f085d[_0x51fb47(0x263)](_0x11de50));console[_0x51fb47(0x206)]('Duration:\x20'+formatElapsed(_0xdb96ed)),console['log']('━'[_0x51fb47(0x247)](0x3c));const _0x3ed721=_0x2f6afe['filter'](_0x4ddd52=>_0x4ddd52[_0x51fb47(0x23f)]!==_0x51fb47(0x22e));if(_0x3ed721[_0x51fb47(0x21d)]>0x0){console['log'](),console[_0x51fb47(0x206)](_0x51fb47(0x23c));for(const _0x184757 of _0x3ed721){const _0xa6dd41=a5_0x3f085d[_0x51fb47(0x263)]('✗'),_0x567bec=_0x184757[_0x51fb47(0x21b)][_0x51fb47(0x21d)]>0x32?_0x184757['reason'][_0x51fb47(0x220)](0x0,0x32)+_0x51fb47(0x23e):_0x184757['reason'];console[_0x51fb47(0x206)]('\x20\x20'+_0xa6dd41+'\x20'+_0x184757[_0x51fb47(0x229)]+':\x20'+_0x567bec);}}const _0x50f520={'summary':{'total':_0x2f6afe['length'],'passed':_0x11610f,'failed':_0x52f354,'errors':_0x11de50>0x0?_0x11de50:undefined,'duration_ms':_0xdb96ed},'tests':_0x2f6afe,'agent':{'project':_0x1949d1[_0x51fb47(0x21f)],'name':_0x1949d1[_0x51fb47(0x259)],'site':_0x3b88fb},'timestamp':new Date(_0x3ddda5)[_0x51fb47(0x1ec)]()};try{const _0x2badcd=buildCachedTestRun(_0x39febf,{'site':_0x3b88fb,'projectId':_0x2dccc3,'projectName':_0x1949d1['projectName'],'agentId':_0x52fcdf,'agentName':_0x1949d1['agentName'],'testYmlPath':a5_0x8edcf9[_0x51fb47(0x226)](_0x1949d1['testYmlPath'])});saveLastTestRun(_0x2badcd);}catch{}if(_0x4fe691!=='table'||_0x50da0f){const _0x57a996=formatResults(_0x50f520,_0x4fe691);if(_0x50da0f)try{a5_0x2424ec['writeFileSync'](_0x50da0f,_0x57a996,'utf-8'),console['log'](),console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)]('Output\x20written\x20to:\x20'+_0x50da0f));}catch(_0x1aee51){return console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)]('Error\x20writing\x20output\x20file:\x20'+_0x1aee51)),0x1;}else console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](_0x57a996);}return _0x3ed721[_0x51fb47(0x21d)]>0x0?0x1:0x0;}async[a5_0x34ce8d(0x224)](_0x4bb85e,_0x2fa416){const _0x45ec12=a5_0x34ce8d,{options:_0x375bad,tdx:_0x350f02}=_0x4bb85e,{definition:_0x2d6c2b,agentInfo:_0x3a51f1,outputFormat:_0x53447b,outputFile:_0x5d9efa}=_0x2fa416,_0x8130ae=_0x375bad[_0x45ec12(0x1f0)],_0x20c104=loadLastTestRun();if(!_0x20c104)return console['log'](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x254))),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)](_0x45ec12(0x268))),0x1;if(_0x20c104['agent'][_0x45ec12(0x259)]!==_0x3a51f1[_0x45ec12(0x259)])return console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x240)+_0x20c104[_0x45ec12(0x26b)][_0x45ec12(0x259)]+_0x45ec12(0x211)+_0x3a51f1[_0x45ec12(0x259)]+'\x22.')),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)](_0x45ec12(0x265))),0x1;const _0x17a5b3=new Set(_0x20c104['conversations'][_0x45ec12(0x1ea)](_0xdfd952=>_0xdfd952[_0x45ec12(0x217)])),_0xaacf9d=_0x2d6c2b[_0x45ec12(0x24d)]['filter'](_0x22b300=>!_0x17a5b3[_0x45ec12(0x27e)](_0x22b300[_0x45ec12(0x229)]));if(_0xaacf9d[_0x45ec12(0x21d)]>0x0&&_0x20c104[_0x45ec12(0x1f0)]!==_0x8130ae)return console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x26e))),console[_0x45ec12(0x206)](a5_0x3f085d['dim'](_0x45ec12(0x274)+_0x20c104[_0x45ec12(0x1f0)]+_0x45ec12(0x24e)+_0x8130ae+'\x22.')),console[_0x45ec12(0x206)](a5_0x3f085d['dim'](_0x45ec12(0x208)+_0x20c104[_0x45ec12(0x1f0)]+_0x45ec12(0x250))),0x1;const _0x188d8d=_0x2d6c2b[_0x45ec12(0x24d)][_0x45ec12(0x20e)](_0x3aa2c6=>_0x17a5b3[_0x45ec12(0x27e)](_0x3aa2c6[_0x45ec12(0x229)])),_0x4514ab=_0xaacf9d;let _0x4195a0;try{_0x4195a0=await setupEvaluatorAgent(_0x350f02[_0x45ec12(0x235)],_0x375bad['verbose']);}catch(_0x542d49){const _0x6e37c4=_0x542d49 instanceof Error?_0x542d49[_0x45ec12(0x230)]:String(_0x542d49);return console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x1e7)+_0x6e37c4)),0x1;}console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x200)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x3f085d['white'](_0x20c104[_0x45ec12(0x20d)])),console['log'](_0x45ec12(0x26d)+a5_0x3f085d[_0x45ec12(0x233)](_0x20c104[_0x45ec12(0x26b)][_0x45ec12(0x21f)]+'/'+_0x20c104[_0x45ec12(0x26b)][_0x45ec12(0x259)]));_0x4514ab[_0x45ec12(0x21d)]>0x0&&console[_0x45ec12(0x206)]('New\x20tests\x20to\x20execute:\x20'+a5_0x3f085d['yellow'](_0x4514ab[_0x45ec12(0x21d)]));console[_0x45ec12(0x206)]();const _0x732246=[],_0x29ca44=Date[_0x45ec12(0x1ee)](),_0x5d0321=createCommandSpinner(_0x45ec12(0x276));if(_0x188d8d[_0x45ec12(0x21d)]>0x0)try{const _0x53b9a2=await reevaluateFromCache(_0x350f02[_0x45ec12(0x235)],_0x20c104,{'tests':_0x188d8d},{'evaluatorId':_0x4195a0,'onTestStart':(_0x140c6f,_0x515c5f,_0x105d25)=>{const _0x1c47cc=_0x45ec12;_0x5d0321['text']=_0x1c47cc(0x236)+(_0x515c5f+0x1)+'/'+_0x105d25+':\x20'+_0x140c6f+_0x1c47cc(0x23e);if(!_0x5d0321[_0x1c47cc(0x238)])_0x5d0321['start']();},'onTestComplete':(_0x86a05a,_0xd6595c)=>{const _0x3eaf13=_0x45ec12;_0x5d0321[_0x3eaf13(0x223)]();if(_0xd6595c[_0x3eaf13(0x23f)]===_0x3eaf13(0x22e))console[_0x3eaf13(0x206)](a5_0x3f085d[_0x3eaf13(0x232)](_0x3eaf13(0x245)+_0x86a05a)+a5_0x3f085d[_0x3eaf13(0x225)](_0x3eaf13(0x22d)));else _0xd6595c['status']===_0x3eaf13(0x201)?console[_0x3eaf13(0x206)](a5_0x3f085d[_0x3eaf13(0x263)]('✗\x20FAIL:\x20'+_0x86a05a+_0x3eaf13(0x216)+_0xd6595c['reason'])+a5_0x3f085d['dim'](_0x3eaf13(0x22d))):console[_0x3eaf13(0x206)](a5_0x3f085d[_0x3eaf13(0x263)]('✗\x20ERROR:\x20'+_0x86a05a+_0x3eaf13(0x216)+_0xd6595c[_0x3eaf13(0x21b)]));_0xd6595c['conversation_url']&&console['log'](a5_0x3f085d[_0x3eaf13(0x225)](_0x3eaf13(0x27a)+_0xd6595c['conversation_url'])),_0x732246['push'](_0xd6595c);},'onTestSkipped':(_0x14a0e1,_0x128ad6)=>{const _0x323350=_0x45ec12;_0x5d0321[_0x323350(0x223)](),console['log'](a5_0x3f085d[_0x323350(0x1fc)]('⚠\x20SKIPPED:\x20'+_0x14a0e1+_0x323350(0x216)+_0x128ad6));}});for(const _0x320a9b of _0x53b9a2){!_0x732246[_0x45ec12(0x1f1)](_0x3f1140=>_0x3f1140['name']===_0x320a9b[_0x45ec12(0x229)])&&_0x732246[_0x45ec12(0x273)](_0x320a9b);}}catch(_0x309619){_0x5d0321['stop']();const _0x2bfaab=_0x309619 instanceof Error?_0x309619[_0x45ec12(0x230)]:String(_0x309619);return console['log'](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x279)+_0x2bfaab)),0x1;}_0x5d0321[_0x45ec12(0x223)]();if(_0x4514ab['length']>0x0){console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x200)](_0x45ec12(0x25e)));const {projectId:_0x3db99a,agentId:_0x29f51f}=_0x20c104[_0x45ec12(0x26b)];for(const _0x49c6da of _0x4514ab){console[_0x45ec12(0x206)]('Running:\x20'+a5_0x3f085d[_0x45ec12(0x233)](_0x49c6da[_0x45ec12(0x229)]));const _0xb9dd0=createCommandSpinner(_0x45ec12(0x221)+_0x49c6da[_0x45ec12(0x203)]['length']+_0x45ec12(0x246));_0xb9dd0[_0x45ec12(0x23b)]();try{const {result:_0x4b2fda}=await runTest(_0x350f02[_0x45ec12(0x235)],_0x49c6da,{'agentId':_0x29f51f,'projectId':_0x3db99a,'site':_0x20c104[_0x45ec12(0x1f0)],'noEval':![],'evaluatorId':_0x4195a0,'onRoundStart':(_0x5a8ea1,_0x584160)=>{const _0x27cfb8=_0x45ec12;_0xb9dd0[_0x27cfb8(0x244)]=_0x27cfb8(0x22a)+(_0x5a8ea1+0x1)+'/'+_0x584160+_0x27cfb8(0x246);},'onRoundComplete':(_0x57745e,_0x5cb1fd,_0x457913)=>{const _0x53879e=_0x45ec12,_0x16e683=formatElapsed(_0x5cb1fd);_0x457913?console[_0x53879e(0x206)](_0x53879e(0x20a)+(_0x57745e+0x1)+'/'+_0x49c6da[_0x53879e(0x203)][_0x53879e(0x21d)]+_0x53879e(0x207)+a5_0x3f085d[_0x53879e(0x232)]('✓')+'\x20('+_0x16e683+')'):console[_0x53879e(0x206)](_0x53879e(0x20a)+(_0x57745e+0x1)+'/'+_0x49c6da[_0x53879e(0x203)][_0x53879e(0x21d)]+_0x53879e(0x207)+a5_0x3f085d[_0x53879e(0x263)]('✗'));},'onEvaluationStart':()=>{const _0x917815=_0x45ec12;_0xb9dd0[_0x917815(0x244)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3be3ec=>{const _0xebec3e=_0x45ec12,_0x1df616=formatElapsed(_0x3be3ec);console[_0xebec3e(0x206)](_0xebec3e(0x204)+a5_0x3f085d[_0xebec3e(0x232)]('✓')+'\x20('+_0x1df616+')');}});_0xb9dd0['stop'](),_0x732246[_0x45ec12(0x273)](_0x4b2fda);if(_0x4b2fda[_0x45ec12(0x23f)]==='PASS')console[_0x45ec12(0x206)](a5_0x3f085d['green']('✓\x20PASS:\x20'+_0x4b2fda[_0x45ec12(0x21b)])+a5_0x3f085d['dim'](_0x45ec12(0x24f)));else _0x4b2fda[_0x45ec12(0x23f)]==='FAIL'?console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)]('✗\x20FAIL:\x20'+_0x4b2fda[_0x45ec12(0x21b)])+a5_0x3f085d['dim'](_0x45ec12(0x24f))):console[_0x45ec12(0x206)](a5_0x3f085d['red'](_0x45ec12(0x24c)+_0x4b2fda[_0x45ec12(0x21b)]));_0x4b2fda[_0x45ec12(0x253)]&&console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)](_0x45ec12(0x27a)+_0x4b2fda[_0x45ec12(0x253)]));}catch(_0x4ae4fa){_0xb9dd0['stop']();const _0xd3a12e=_0x4ae4fa instanceof Error?_0x4ae4fa['message']:String(_0x4ae4fa);console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x24c)+_0xd3a12e)),_0x732246[_0x45ec12(0x273)]({'name':_0x49c6da['name'],'status':_0x45ec12(0x257),'reason':_0xd3a12e,'timestamp':new Date()[_0x45ec12(0x1ec)](),'duration_ms':0x0});}}}console['log']();const _0x20735c=Date[_0x45ec12(0x1ee)]()-_0x29ca44,_0x16bfb5=_0x732246[_0x45ec12(0x20e)](_0x35c360=>_0x35c360[_0x45ec12(0x23f)]==='PASS')[_0x45ec12(0x21d)],_0x643415=_0x732246['filter'](_0x2ba48c=>_0x2ba48c[_0x45ec12(0x23f)]==='FAIL')[_0x45ec12(0x21d)],_0x3b8aee=_0x732246[_0x45ec12(0x20e)](_0x58f41c=>_0x58f41c[_0x45ec12(0x23f)]===_0x45ec12(0x257))[_0x45ec12(0x21d)];console[_0x45ec12(0x206)]('━'[_0x45ec12(0x247)](0x3c)),console[_0x45ec12(0x206)](_0x45ec12(0x266)),console[_0x45ec12(0x206)]('━'['repeat'](0x3c)),console[_0x45ec12(0x206)](_0x45ec12(0x210)+_0x732246[_0x45ec12(0x21d)]),console[_0x45ec12(0x206)](_0x45ec12(0x228)+a5_0x3f085d[_0x45ec12(0x232)](_0x16bfb5)),console[_0x45ec12(0x206)](_0x45ec12(0x25d)+a5_0x3f085d['red'](_0x643415));_0x3b8aee>0x0&&console[_0x45ec12(0x206)](_0x45ec12(0x251)+a5_0x3f085d[_0x45ec12(0x263)](_0x3b8aee));console[_0x45ec12(0x206)]('Duration:\x20'+formatElapsed(_0x20735c)),console[_0x45ec12(0x206)]('━'['repeat'](0x3c));const _0x2f319a={'summary':{'total':_0x732246[_0x45ec12(0x21d)],'passed':_0x16bfb5,'failed':_0x643415,'errors':_0x3b8aee>0x0?_0x3b8aee:undefined,'duration_ms':_0x20735c},'tests':_0x732246,'agent':{'project':_0x3a51f1[_0x45ec12(0x21f)],'name':_0x3a51f1[_0x45ec12(0x259)],'site':_0x8130ae},'timestamp':new Date(_0x29ca44)[_0x45ec12(0x1ec)]()};if(_0x53447b!==_0x45ec12(0x248)||_0x5d9efa){const _0xf83dbd=formatResults(_0x2f319a,_0x53447b);if(_0x5d9efa)try{a5_0x2424ec[_0x45ec12(0x1e9)](_0x5d9efa,_0xf83dbd,_0x45ec12(0x1eb)),console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)]('Output\x20written\x20to:\x20'+_0x5d9efa));}catch(_0x593fbb){return console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x27d)+_0x593fbb)),0x1;}else console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](_0xf83dbd);}const _0xadb0bd=_0x732246[_0x45ec12(0x20e)](_0x1cedd8=>_0x1cedd8['status']!=='PASS');return _0xadb0bd[_0x45ec12(0x21d)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x1cbee9=a5_0x2f71;(function(_0x5a1750,_0x591e43){const _0x9a584b=a5_0x2f71,_0x2108f7=_0x5a1750();while(!![]){try{const _0x535af0=parseInt(_0x9a584b(0x273))/0x1+parseInt(_0x9a584b(0x24e))/0x2+parseInt(_0x9a584b(0x20c))/0x3*(parseInt(_0x9a584b(0x1f7))/0x4)+parseInt(_0x9a584b(0x1ee))/0x5+parseInt(_0x9a584b(0x255))/0x6+parseInt(_0x9a584b(0x233))/0x7+-parseInt(_0x9a584b(0x230))/0x8;if(_0x535af0===_0x591e43)break;else _0x2108f7['push'](_0x2108f7['shift']());}catch(_0x2f909a){_0x2108f7['push'](_0x2108f7['shift']());}}}(a5_0x3cda,0xf0845));function a5_0x3cda(){const _0x1c215a=['Test\x20Configuration:','\x27\x20to\x20create\x20the\x20folder\x20structure.','start','Round\x20','execute','map','multiple_agents','\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','No\x20tests\x20have\x20tags\x20defined.','green','log','json','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','no_tests','Duration:\x20','404','has','17427bVedLy','Output\x20written\x20to:\x20','resolve','\x20-\x20','agentName','executeReeval','Project\x20path:\x20','table','dryRun','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','repeat','isSpinning','No\x20tests\x20found\x20matching:\x20','Failed:\x20\x20\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Agent:\x20','push','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Cached\x20run\x20is\x20from\x20site\x20\x22','\x22:\x20','no_local_folder','toLowerCase','llmProject','\x20\x20Agent:\x20','Re-evaluation\x20Summary','verbose','Using\x20agent:\x20','includes','message','text','round','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Available\x20tags:\x20','yellow','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','...\x20','22567080PTKjrX','FAIL','split','9204433Qkqkqn','/<agent-name>','not\x20found','Test\x20','join','tests','substring','trim','PASS','conversation_url','Re-evaluating...','\x20\x20Round\x20','filter','Passed:\x20\x20\x20','length','Cached\x20run\x20from:\x20','cyan','testName','tsv','\x20\x20Conversation:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Either\x20switch\x20to\x20the\x20\x22','✓\x20PASS:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','Conversation\x20URL:\x20','name','2475032HWXbGx','\x20\x20Evaluating...\x20','projectDir','Round\x201/','writeFileSync','\x20\x20Site:\x20','size','2141460DgKYYV','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','find','agentDirs','llm','forEach','existsSync','\x20\x20Project:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','stop','Running:\x20','conversations','now','✗\x20FAIL:\x20','projectName','Re-evaluating\x20','✗\x20ERROR:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','utf-8','Failed\x20Tests:','Executing\x20new\x20tests...','jsonl','Available\x20tests:\x20','toISOString','rounds','Error\x20writing\x20output\x20file:\x20','ERROR','resolveAgentId','Evaluating\x20response...','Re-evaluating\x20cached\x20test\x20run...','406398CEShzz','\x20(cached)','site','red','add','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','tags','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Test\x20Summary','testYmlPath','New\x20tests\x20to\x20execute:\x20','\x20(new)','reason','status','Total:\x20\x20\x20\x20','test.yml','\x20\x20-\x20','agent','1318740AQITZu','description','Site:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Project\x20not\x20found:\x20','white','eval','⚠\x20SKIPPED:\x20','dim','156mVvPzE','Usage:',':\x20Sending\x20user\x20input...','Errors:\x20\x20\x20'];a5_0x3cda=function(){return _0x1c215a;};return a5_0x3cda();}import*as a5_0x30561a from'node:fs';import*as a5_0x1820bf from'node:path';import a5_0x216014 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';function a5_0x2f71(_0x134c31,_0x2f5cd1){_0x134c31=_0x134c31-0x1e3;const _0x3cda99=a5_0x3cda();let _0x2f71cc=_0x3cda99[_0x134c31];return _0x2f71cc;}export class AgentTestCommand extends BaseCommand{[a5_0x1cbee9(0x24d)]='agent:test';[a5_0x1cbee9(0x1ef)]=a5_0x1cbee9(0x266);async[a5_0x1cbee9(0x1ff)](_0x5994b4){const _0x59bc20=a5_0x1cbee9,{options:_0x126750,args:_0x1d4488,tdx:_0x4ba975}=_0x5994b4,_0x20adc2=_0x1d4488[0x0]||'.',_0x5ed21b=_0x126750[_0x59bc20(0x214)],_0x1111ea=_0x126750,_0x1a4d0d=_0x1111ea[_0x59bc20(0x1f4)]===![],_0x1501f7=_0x1111ea['reeval'],_0x1dcc69=_0x1111ea[_0x59bc20(0x24d)],_0x10da94=_0x1111ea[_0x59bc20(0x279)],_0x31d53d=_0x126750['site'],_0x12b7f1=_0x1111ea['output'];if(_0x1501f7&&_0x1a4d0d)return console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x276)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x597681=_0x59bc20(0x213);if(_0x1111ea[_0x59bc20(0x206)])_0x597681=_0x59bc20(0x206);else{if(_0x1111ea[_0x59bc20(0x26a)])_0x597681=_0x59bc20(0x26a);else{if(_0x1111ea[_0x59bc20(0x245)])_0x597681=_0x59bc20(0x245);else{if(_0x1111ea[_0x59bc20(0x213)])_0x597681='table';}}}const _0x393e2a=_0x1111ea['llmProject'];let _0x1617d2=_0x20adc2;const _0x337e0b=a5_0x30561a[_0x59bc20(0x25b)](_0x20adc2),_0x53f06=_0x20adc2==='.';if(!_0x337e0b||_0x53f06){const _0x3dded6=resolveProjectFromContext(_0x20adc2,_0x393e2a,{'requireFile':_0x59bc20(0x1eb)});if(_0x3dded6['found'])_0x1617d2=_0x3dded6[_0x59bc20(0x250)],_0x3dded6['source']==='context'&&console[_0x59bc20(0x205)](a5_0x216014['dim'](_0x59bc20(0x226)+_0x1617d2));else switch(_0x3dded6[_0x59bc20(0x1e8)]){case'no_context':console[_0x59bc20(0x205)](a5_0x216014['yellow'](_0x3dded6[_0x59bc20(0x228)])),console[_0x59bc20(0x205)](),console['log'](_0x59bc20(0x1f8)),console[_0x59bc20(0x205)](_0x59bc20(0x202)),console[_0x59bc20(0x205)](_0x59bc20(0x25d)),console[_0x59bc20(0x205)](),console[_0x59bc20(0x205)](_0x59bc20(0x1e3));return 0x1;case _0x59bc20(0x220):console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x22d)](_0x3dded6[_0x59bc20(0x228)])),console[_0x59bc20(0x205)](),console[_0x59bc20(0x205)](_0x59bc20(0x247)+_0x3dded6[_0x59bc20(0x222)]+_0x59bc20(0x1fc));return 0x1;case _0x59bc20(0x201):{const _0x310b7a=a5_0x1820bf['basename'](_0x3dded6[_0x59bc20(0x250)]);console[_0x59bc20(0x205)](a5_0x216014['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x3dded6['llmProject']+'\x22:'));for(const _0x562541 of _0x3dded6[_0x59bc20(0x258)]){console['log'](_0x59bc20(0x1ec)+_0x562541);}return console['log'](),console[_0x59bc20(0x205)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x310b7a+_0x59bc20(0x234)),0x1;}case _0x59bc20(0x208):console[_0x59bc20(0x205)](a5_0x216014['yellow'](_0x59bc20(0x248)+_0x3dded6['llmProject']+'\x22.')),console['log'](a5_0x216014[_0x59bc20(0x1f6)](_0x59bc20(0x212)+_0x3dded6[_0x59bc20(0x250)])),console[_0x59bc20(0x205)](),console[_0x59bc20(0x205)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x5f3e76,agentInfo:_0x17b4d7}=parseTestFile(_0x1617d2);let _0x1c19c4=_0x5f3e76['tests'];if(_0x1dcc69){const _0x114059=_0x1dcc69['split'](',')[_0x59bc20(0x200)](_0x143765=>_0x143765[_0x59bc20(0x23a)]());_0x1c19c4=_0x5f3e76[_0x59bc20(0x238)][_0x59bc20(0x23f)](_0x1185d8=>_0x114059['includes'](_0x1185d8['name']));if(_0x1c19c4[_0x59bc20(0x241)]===0x0)return console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x22d)](_0x59bc20(0x218)+_0x1dcc69)),console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x1f6)](_0x59bc20(0x26b)+_0x5f3e76['tests'][_0x59bc20(0x200)](_0x5204a7=>_0x5204a7['name'])[_0x59bc20(0x237)](',\x20'))),0x1;}if(_0x10da94){const _0x45361a=_0x10da94[_0x59bc20(0x232)](',')['map'](_0x1d90f7=>_0x1d90f7[_0x59bc20(0x23a)]()[_0x59bc20(0x221)]());_0x1c19c4=_0x1c19c4['filter'](_0x50f262=>_0x50f262[_0x59bc20(0x279)]?.['some'](_0x1d1f57=>_0x45361a[_0x59bc20(0x227)](_0x1d1f57[_0x59bc20(0x221)]())));if(_0x1c19c4[_0x59bc20(0x241)]===0x0){console['log'](a5_0x216014[_0x59bc20(0x22d)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x10da94));const _0x5de6d5=new Set();return _0x5f3e76[_0x59bc20(0x238)][_0x59bc20(0x25a)](_0x463442=>_0x463442[_0x59bc20(0x279)]?.[_0x59bc20(0x25a)](_0x3c921b=>_0x5de6d5[_0x59bc20(0x277)](_0x3c921b))),_0x5de6d5[_0x59bc20(0x254)]>0x0?console['log'](a5_0x216014[_0x59bc20(0x1f6)](_0x59bc20(0x22c)+[..._0x5de6d5]['join'](',\x20'))):console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x1f6)](_0x59bc20(0x203))),0x1;}}if(_0x1501f7)return this[_0x59bc20(0x211)](_0x5994b4,{'definition':{'tests':_0x1c19c4},'agentInfo':_0x17b4d7,'outputFormat':_0x597681,'outputFile':_0x12b7f1,'testNames':_0x1dcc69});if(_0x5ed21b){console['log'](a5_0x216014[_0x59bc20(0x243)](_0x59bc20(0x1fb))),console[_0x59bc20(0x205)](_0x59bc20(0x253)+a5_0x216014[_0x59bc20(0x1f3)](_0x31d53d)),console['log'](_0x59bc20(0x25c)+a5_0x216014[_0x59bc20(0x1f3)](_0x17b4d7['projectName'])),console[_0x59bc20(0x205)](_0x59bc20(0x223)+a5_0x216014['white'](_0x17b4d7['agentName'])),console['log'](),console[_0x59bc20(0x205)]('Tests\x20found:\x20'+a5_0x216014[_0x59bc20(0x1f3)](_0x1c19c4[_0x59bc20(0x241)]));for(let _0x4f3003=0x0;_0x4f3003<_0x1c19c4[_0x59bc20(0x241)];_0x4f3003++){const _0x416863=_0x1c19c4[_0x4f3003],_0x1cfcc8=_0x416863[_0x59bc20(0x26d)][_0x59bc20(0x241)]===0x1?_0x59bc20(0x22a):_0x59bc20(0x26d),_0x4fb3f3=_0x416863[_0x59bc20(0x279)]?.[_0x59bc20(0x241)]?'\x20['+_0x416863['tags'][_0x59bc20(0x237)](',\x20')+']':'';console[_0x59bc20(0x205)]('\x20\x20'+(_0x4f3003+0x1)+'.\x20'+a5_0x216014[_0x59bc20(0x1f3)](_0x416863['name'])+'\x20('+_0x416863['rounds'][_0x59bc20(0x241)]+'\x20'+_0x1cfcc8+')'+a5_0x216014[_0x59bc20(0x1f6)](_0x4fb3f3));}return 0x0;}let _0x4e32cd,_0xd358ef;try{_0x4e32cd=await _0x4ba975['llm']['resolveProjectId'](_0x17b4d7[_0x59bc20(0x263)]);}catch(_0x3bb49e){const _0x24c681=_0x3bb49e instanceof Error?_0x3bb49e[_0x59bc20(0x228)]:String(_0x3bb49e);return _0x24c681[_0x59bc20(0x227)](_0x59bc20(0x20a))||_0x24c681[_0x59bc20(0x221)]()[_0x59bc20(0x227)](_0x59bc20(0x235))?console['log'](a5_0x216014[_0x59bc20(0x276)](_0x59bc20(0x1f2)+_0x17b4d7[_0x59bc20(0x263)])):console['log'](a5_0x216014[_0x59bc20(0x276)](_0x59bc20(0x278)+_0x17b4d7['projectName']+'\x22:\x20'+_0x24c681)),0x1;}try{_0xd358ef=await _0x4ba975[_0x59bc20(0x259)][_0x59bc20(0x270)](_0x17b4d7[_0x59bc20(0x210)],_0x4e32cd);}catch(_0xa421bc){const _0x51291a=_0xa421bc instanceof Error?_0xa421bc[_0x59bc20(0x228)]:String(_0xa421bc);return _0x51291a[_0x59bc20(0x227)](_0x59bc20(0x20a))||_0x51291a['toLowerCase']()[_0x59bc20(0x227)]('not\x20found')?console['log'](a5_0x216014[_0x59bc20(0x276)](_0x59bc20(0x207)+_0x17b4d7[_0x59bc20(0x210)])):console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x276)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x17b4d7[_0x59bc20(0x210)]+_0x59bc20(0x21f)+_0x51291a)),0x1;}let _0x1ca7e6;if(!_0x1a4d0d)try{_0x1ca7e6=await setupEvaluatorAgent(_0x4ba975[_0x59bc20(0x259)],_0x126750[_0x59bc20(0x225)]);}catch(_0x1a040b){const _0x5676b6=_0x1a040b instanceof Error?_0x1a040b[_0x59bc20(0x228)]:String(_0x1a040b);return console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x276)](_0x59bc20(0x256)+_0x5676b6)),0x1;}console['log'](a5_0x216014[_0x59bc20(0x243)]('Running\x20agent\x20tests...')),console['log'](_0x59bc20(0x1f0)+a5_0x216014['white'](_0x31d53d)),console[_0x59bc20(0x205)]('Agent:\x20'+a5_0x216014[_0x59bc20(0x1f3)](_0x17b4d7['projectName']+'/'+_0x17b4d7['agentName'])),console['log']();const _0x5ed75c=[],_0x274d0e=[],_0x3a8db4=Date['now']();for(let _0x4caf62=0x0;_0x4caf62<_0x1c19c4[_0x59bc20(0x241)];_0x4caf62++){const _0x1d6108=_0x1c19c4[_0x4caf62];_0x1c19c4[_0x59bc20(0x241)]>0x1?console[_0x59bc20(0x205)](_0x59bc20(0x236)+(_0x4caf62+0x1)+'/'+_0x1c19c4[_0x59bc20(0x241)]+':\x20'+a5_0x216014[_0x59bc20(0x1f3)](_0x1d6108[_0x59bc20(0x24d)])):console[_0x59bc20(0x205)]('Running\x20test:\x20'+a5_0x216014[_0x59bc20(0x1f3)](_0x1d6108['name']));const _0x42ed66=createCommandSpinner(_0x59bc20(0x251)+_0x1d6108['rounds']['length']+_0x59bc20(0x1f9));_0x42ed66['start']();try{const {result:_0x334cbd,conversation:_0x38042b}=await runTest(_0x4ba975['llm'],_0x1d6108,{'agentId':_0xd358ef,'projectId':_0x4e32cd,'site':_0x31d53d,'noEval':_0x1a4d0d,'evaluatorId':_0x1ca7e6,'onRoundStart':(_0xc1300c,_0x26fc67)=>{const _0x367c38=_0x59bc20;_0x42ed66['text']='Round\x20'+(_0xc1300c+0x1)+'/'+_0x26fc67+_0x367c38(0x1f9);},'onRoundComplete':(_0xcf05f2,_0x71bb88,_0x57bca6)=>{const _0x5ac260=_0x59bc20,_0x555b14=formatElapsed(_0x71bb88);_0x57bca6?console['log'](_0x5ac260(0x23e)+(_0xcf05f2+0x1)+'/'+_0x1d6108['rounds'][_0x5ac260(0x241)]+'...\x20'+a5_0x216014['green']('✓')+'\x20('+_0x555b14+')'):console[_0x5ac260(0x205)](_0x5ac260(0x23e)+(_0xcf05f2+0x1)+'/'+_0x1d6108[_0x5ac260(0x26d)][_0x5ac260(0x241)]+_0x5ac260(0x22f)+a5_0x216014[_0x5ac260(0x276)]('✗'));},'onEvaluationStart':()=>{const _0x10b6a4=_0x59bc20;_0x42ed66[_0x10b6a4(0x229)]=_0x10b6a4(0x271);},'onEvaluationComplete':_0x5c1107=>{const _0x41f6ea=_0x59bc20,_0x4adb67=formatElapsed(_0x5c1107);console['log'](_0x41f6ea(0x24f)+a5_0x216014[_0x41f6ea(0x204)]('✓')+'\x20('+_0x4adb67+')');}});_0x42ed66[_0x59bc20(0x25e)](),_0x5ed75c['push'](_0x334cbd),_0x274d0e[_0x59bc20(0x21c)](_0x38042b);if(_0x334cbd[_0x59bc20(0x1e9)]===_0x59bc20(0x23b))console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x204)]('✓\x20PASS:\x20'+_0x334cbd[_0x59bc20(0x1e8)]));else _0x334cbd[_0x59bc20(0x1e9)]===_0x59bc20(0x231)?console[_0x59bc20(0x205)](a5_0x216014['red']('✗\x20FAIL:\x20'+_0x334cbd['reason'])):console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x276)](_0x59bc20(0x265)+_0x334cbd[_0x59bc20(0x1e8)]));_0x334cbd[_0x59bc20(0x23c)]&&console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x1f6)](_0x59bc20(0x24c)+_0x334cbd[_0x59bc20(0x23c)])),console[_0x59bc20(0x205)]();}catch(_0x5bdd1d){_0x42ed66[_0x59bc20(0x25e)]();const _0x46d731=_0x5bdd1d instanceof Error?_0x5bdd1d[_0x59bc20(0x228)]:String(_0x5bdd1d);console['log'](a5_0x216014[_0x59bc20(0x276)](_0x59bc20(0x265)+_0x46d731)),console[_0x59bc20(0x205)](),_0x5ed75c[_0x59bc20(0x21c)]({'name':_0x1d6108[_0x59bc20(0x24d)],'status':'ERROR','reason':_0x46d731,'timestamp':new Date()[_0x59bc20(0x26c)](),'duration_ms':0x0});}}const _0x16a08c=Date[_0x59bc20(0x261)]()-_0x3a8db4,_0x1214b8=_0x5ed75c['filter'](_0x3e60f5=>_0x3e60f5['status']==='PASS')['length'],_0x1c5d16=_0x5ed75c[_0x59bc20(0x23f)](_0x49f8ca=>_0x49f8ca[_0x59bc20(0x1e9)]===_0x59bc20(0x231))['length'],_0x2c4384=_0x5ed75c[_0x59bc20(0x23f)](_0xd1b9de=>_0xd1b9de['status']===_0x59bc20(0x26f))[_0x59bc20(0x241)];console['log']('━'[_0x59bc20(0x216)](0x3c)),console[_0x59bc20(0x205)](_0x59bc20(0x1e4)),console['log']('━'[_0x59bc20(0x216)](0x3c)),console[_0x59bc20(0x205)]('Total:\x20\x20\x20\x20'+_0x5ed75c[_0x59bc20(0x241)]),console[_0x59bc20(0x205)]('Passed:\x20\x20\x20'+a5_0x216014[_0x59bc20(0x204)](_0x1214b8)),console[_0x59bc20(0x205)](_0x59bc20(0x219)+a5_0x216014[_0x59bc20(0x276)](_0x1c5d16));_0x2c4384>0x0&&console[_0x59bc20(0x205)](_0x59bc20(0x1fa)+a5_0x216014['red'](_0x2c4384));console[_0x59bc20(0x205)]('Duration:\x20'+formatElapsed(_0x16a08c)),console[_0x59bc20(0x205)]('━'['repeat'](0x3c));const _0x5c3697=_0x5ed75c['filter'](_0x314dea=>_0x314dea[_0x59bc20(0x1e9)]!=='PASS');if(_0x5c3697[_0x59bc20(0x241)]>0x0){console[_0x59bc20(0x205)](),console['log'](_0x59bc20(0x268));for(const _0x385dbe of _0x5c3697){const _0x517e06=a5_0x216014[_0x59bc20(0x276)]('✗'),_0x53f74f=_0x385dbe['reason']['length']>0x32?_0x385dbe[_0x59bc20(0x1e8)][_0x59bc20(0x239)](0x0,0x32)+'...':_0x385dbe[_0x59bc20(0x1e8)];console[_0x59bc20(0x205)]('\x20\x20'+_0x517e06+'\x20'+_0x385dbe[_0x59bc20(0x24d)]+':\x20'+_0x53f74f);}}const _0xd91515={'summary':{'total':_0x5ed75c[_0x59bc20(0x241)],'passed':_0x1214b8,'failed':_0x1c5d16,'errors':_0x2c4384>0x0?_0x2c4384:undefined,'duration_ms':_0x16a08c},'tests':_0x5ed75c,'agent':{'project':_0x17b4d7['projectName'],'name':_0x17b4d7[_0x59bc20(0x210)],'site':_0x31d53d},'timestamp':new Date(_0x3a8db4)[_0x59bc20(0x26c)]()};try{const _0x4bd563=buildCachedTestRun(_0x274d0e,{'site':_0x31d53d,'projectId':_0x4e32cd,'projectName':_0x17b4d7['projectName'],'agentId':_0xd358ef,'agentName':_0x17b4d7[_0x59bc20(0x210)],'testYmlPath':a5_0x1820bf[_0x59bc20(0x20e)](_0x17b4d7[_0x59bc20(0x1e5)])});saveLastTestRun(_0x4bd563);}catch{}if(_0x597681!==_0x59bc20(0x213)||_0x12b7f1){const _0x58f411=formatResults(_0xd91515,_0x597681);if(_0x12b7f1)try{a5_0x30561a[_0x59bc20(0x252)](_0x12b7f1,_0x58f411,_0x59bc20(0x267)),console[_0x59bc20(0x205)](),console[_0x59bc20(0x205)](a5_0x216014[_0x59bc20(0x1f6)](_0x59bc20(0x20d)+_0x12b7f1));}catch(_0x5e1b2c){return console[_0x59bc20(0x205)](),console['log'](a5_0x216014[_0x59bc20(0x276)](_0x59bc20(0x26e)+_0x5e1b2c)),0x1;}else console[_0x59bc20(0x205)](),console['log'](_0x58f411);}return _0x5c3697[_0x59bc20(0x241)]>0x0?0x1:0x0;}async[a5_0x1cbee9(0x211)](_0x626ab4,_0x2c7a51){const _0x220df2=a5_0x1cbee9,{options:_0x31253f,tdx:_0x5356bd}=_0x626ab4,{definition:_0x5a13dc,agentInfo:_0x98c98e,outputFormat:_0x25931b,outputFile:_0x293acc}=_0x2c7a51,_0x3d33b2=_0x31253f['site'],_0x96aecc=loadLastTestRun();if(!_0x96aecc)return console['log'](a5_0x216014[_0x220df2(0x276)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x1f6)](_0x220df2(0x22b))),0x1;if(_0x96aecc[_0x220df2(0x1ed)][_0x220df2(0x210)]!==_0x98c98e['agentName'])return console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x276)](_0x220df2(0x21a)+_0x96aecc[_0x220df2(0x1ed)]['agentName']+_0x220df2(0x22e)+_0x98c98e[_0x220df2(0x210)]+'\x22.')),console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x1f6)](_0x220df2(0x21d))),0x1;const _0x2976cf=new Set(_0x96aecc[_0x220df2(0x260)][_0x220df2(0x200)](_0x3cfa51=>_0x3cfa51[_0x220df2(0x244)])),_0x2333c4=_0x5a13dc[_0x220df2(0x238)][_0x220df2(0x23f)](_0x178351=>!_0x2976cf['has'](_0x178351['name']));if(_0x2333c4[_0x220df2(0x241)]>0x0&&_0x96aecc[_0x220df2(0x275)]!==_0x3d33b2)return console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x276)](_0x220df2(0x1f1))),console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x1f6)](_0x220df2(0x21e)+_0x96aecc['site']+_0x220df2(0x24b)+_0x3d33b2+'\x22.')),console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x1f6)](_0x220df2(0x249)+_0x96aecc[_0x220df2(0x275)]+_0x220df2(0x215))),0x1;const _0x36cb90=_0x5a13dc['tests'][_0x220df2(0x23f)](_0x46ae81=>_0x2976cf[_0x220df2(0x20b)](_0x46ae81[_0x220df2(0x24d)])),_0x35004e=_0x2333c4;let _0x40209f;try{_0x40209f=await setupEvaluatorAgent(_0x5356bd['llm'],_0x31253f[_0x220df2(0x225)]);}catch(_0x1830ef){const _0x564b6d=_0x1830ef instanceof Error?_0x1830ef[_0x220df2(0x228)]:String(_0x1830ef);return console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x276)](_0x220df2(0x256)+_0x564b6d)),0x1;}console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x243)](_0x220df2(0x272))),console[_0x220df2(0x205)](_0x220df2(0x242)+a5_0x216014[_0x220df2(0x1f3)](_0x96aecc['timestamp'])),console[_0x220df2(0x205)](_0x220df2(0x21b)+a5_0x216014[_0x220df2(0x1f3)](_0x96aecc[_0x220df2(0x1ed)][_0x220df2(0x263)]+'/'+_0x96aecc[_0x220df2(0x1ed)][_0x220df2(0x210)]));_0x35004e['length']>0x0&&console[_0x220df2(0x205)](_0x220df2(0x1e6)+a5_0x216014[_0x220df2(0x22d)](_0x35004e['length']));console[_0x220df2(0x205)]();const _0x2c67f4=[],_0x5c3247=Date[_0x220df2(0x261)](),_0x13f8df=createCommandSpinner(_0x220df2(0x23d));if(_0x36cb90[_0x220df2(0x241)]>0x0)try{const _0x3c8207=await reevaluateFromCache(_0x5356bd[_0x220df2(0x259)],_0x96aecc,{'tests':_0x36cb90},{'evaluatorId':_0x40209f,'onTestStart':(_0xc2b720,_0x5091f2,_0x5d0574)=>{const _0x510310=_0x220df2;_0x13f8df[_0x510310(0x229)]=_0x510310(0x264)+(_0x5091f2+0x1)+'/'+_0x5d0574+':\x20'+_0xc2b720+'...';if(!_0x13f8df[_0x510310(0x217)])_0x13f8df[_0x510310(0x1fd)]();},'onTestComplete':(_0x1f101b,_0x47a248)=>{const _0x109865=_0x220df2;_0x13f8df[_0x109865(0x25e)]();if(_0x47a248['status']===_0x109865(0x23b))console[_0x109865(0x205)](a5_0x216014['green'](_0x109865(0x24a)+_0x1f101b)+a5_0x216014[_0x109865(0x1f6)](_0x109865(0x274)));else _0x47a248[_0x109865(0x1e9)]===_0x109865(0x231)?console[_0x109865(0x205)](a5_0x216014[_0x109865(0x276)](_0x109865(0x262)+_0x1f101b+_0x109865(0x20f)+_0x47a248[_0x109865(0x1e8)])+a5_0x216014['dim'](_0x109865(0x274))):console[_0x109865(0x205)](a5_0x216014[_0x109865(0x276)](_0x109865(0x265)+_0x1f101b+'\x20-\x20'+_0x47a248[_0x109865(0x1e8)]));_0x47a248[_0x109865(0x23c)]&&console['log'](a5_0x216014[_0x109865(0x1f6)]('\x20\x20Conversation:\x20'+_0x47a248[_0x109865(0x23c)])),_0x2c67f4['push'](_0x47a248);},'onTestSkipped':(_0xb33fe4,_0x40489b)=>{const _0x3f5f6f=_0x220df2;_0x13f8df[_0x3f5f6f(0x25e)](),console[_0x3f5f6f(0x205)](a5_0x216014['yellow'](_0x3f5f6f(0x1f5)+_0xb33fe4+_0x3f5f6f(0x20f)+_0x40489b));}});for(const _0x37410c of _0x3c8207){!_0x2c67f4[_0x220df2(0x257)](_0x5e0da9=>_0x5e0da9['name']===_0x37410c['name'])&&_0x2c67f4[_0x220df2(0x21c)](_0x37410c);}}catch(_0x2b9757){_0x13f8df[_0x220df2(0x25e)]();const _0x3353b0=_0x2b9757 instanceof Error?_0x2b9757[_0x220df2(0x228)]:String(_0x2b9757);return console[_0x220df2(0x205)](a5_0x216014['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x3353b0)),0x1;}_0x13f8df[_0x220df2(0x25e)]();if(_0x35004e['length']>0x0){console['log'](),console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x243)](_0x220df2(0x269)));const {projectId:_0x1bcd78,agentId:_0x11680d}=_0x96aecc[_0x220df2(0x1ed)];for(const _0x4d58d9 of _0x35004e){console[_0x220df2(0x205)](_0x220df2(0x25f)+a5_0x216014[_0x220df2(0x1f3)](_0x4d58d9[_0x220df2(0x24d)]));const _0xde6864=createCommandSpinner('Round\x201/'+_0x4d58d9[_0x220df2(0x26d)][_0x220df2(0x241)]+_0x220df2(0x1f9));_0xde6864[_0x220df2(0x1fd)]();try{const {result:_0x5369fd}=await runTest(_0x5356bd[_0x220df2(0x259)],_0x4d58d9,{'agentId':_0x11680d,'projectId':_0x1bcd78,'site':_0x96aecc[_0x220df2(0x275)],'noEval':![],'evaluatorId':_0x40209f,'onRoundStart':(_0x4bae18,_0x441788)=>{const _0x733c39=_0x220df2;_0xde6864[_0x733c39(0x229)]=_0x733c39(0x1fe)+(_0x4bae18+0x1)+'/'+_0x441788+_0x733c39(0x1f9);},'onRoundComplete':(_0x174e7d,_0x572808,_0x48541f)=>{const _0x433654=_0x220df2,_0xdbe0ff=formatElapsed(_0x572808);_0x48541f?console[_0x433654(0x205)]('\x20\x20Round\x20'+(_0x174e7d+0x1)+'/'+_0x4d58d9[_0x433654(0x26d)][_0x433654(0x241)]+_0x433654(0x22f)+a5_0x216014[_0x433654(0x204)]('✓')+'\x20('+_0xdbe0ff+')'):console[_0x433654(0x205)]('\x20\x20Round\x20'+(_0x174e7d+0x1)+'/'+_0x4d58d9[_0x433654(0x26d)][_0x433654(0x241)]+_0x433654(0x22f)+a5_0x216014[_0x433654(0x276)]('✗'));},'onEvaluationStart':()=>{const _0x32fdaf=_0x220df2;_0xde6864[_0x32fdaf(0x229)]=_0x32fdaf(0x271);},'onEvaluationComplete':_0x1b1923=>{const _0x31a789=_0x220df2,_0x5ce027=formatElapsed(_0x1b1923);console[_0x31a789(0x205)]('\x20\x20Evaluating...\x20'+a5_0x216014[_0x31a789(0x204)]('✓')+'\x20('+_0x5ce027+')');}});_0xde6864['stop'](),_0x2c67f4[_0x220df2(0x21c)](_0x5369fd);if(_0x5369fd[_0x220df2(0x1e9)]==='PASS')console[_0x220df2(0x205)](a5_0x216014['green'](_0x220df2(0x24a)+_0x5369fd[_0x220df2(0x1e8)])+a5_0x216014['dim'](_0x220df2(0x1e7)));else _0x5369fd[_0x220df2(0x1e9)]===_0x220df2(0x231)?console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x276)]('✗\x20FAIL:\x20'+_0x5369fd[_0x220df2(0x1e8)])+a5_0x216014['dim']('\x20(new)')):console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x276)]('✗\x20ERROR:\x20'+_0x5369fd['reason']));_0x5369fd['conversation_url']&&console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x1f6)](_0x220df2(0x246)+_0x5369fd[_0x220df2(0x23c)]));}catch(_0x4b2ad8){_0xde6864[_0x220df2(0x25e)]();const _0xfa9731=_0x4b2ad8 instanceof Error?_0x4b2ad8[_0x220df2(0x228)]:String(_0x4b2ad8);console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x276)]('✗\x20ERROR:\x20'+_0xfa9731)),_0x2c67f4[_0x220df2(0x21c)]({'name':_0x4d58d9[_0x220df2(0x24d)],'status':_0x220df2(0x26f),'reason':_0xfa9731,'timestamp':new Date()[_0x220df2(0x26c)](),'duration_ms':0x0});}}}console['log']();const _0x23a04d=Date['now']()-_0x5c3247,_0x2b6a75=_0x2c67f4[_0x220df2(0x23f)](_0x41358e=>_0x41358e[_0x220df2(0x1e9)]===_0x220df2(0x23b))[_0x220df2(0x241)],_0x1c6eab=_0x2c67f4[_0x220df2(0x23f)](_0xb8dd9f=>_0xb8dd9f[_0x220df2(0x1e9)]==='FAIL')[_0x220df2(0x241)],_0x553516=_0x2c67f4[_0x220df2(0x23f)](_0x17cb4e=>_0x17cb4e['status']===_0x220df2(0x26f))[_0x220df2(0x241)];console[_0x220df2(0x205)]('━'['repeat'](0x3c)),console['log'](_0x220df2(0x224)),console[_0x220df2(0x205)]('━'['repeat'](0x3c)),console[_0x220df2(0x205)](_0x220df2(0x1ea)+_0x2c67f4[_0x220df2(0x241)]),console[_0x220df2(0x205)](_0x220df2(0x240)+a5_0x216014['green'](_0x2b6a75)),console[_0x220df2(0x205)](_0x220df2(0x219)+a5_0x216014[_0x220df2(0x276)](_0x1c6eab));_0x553516>0x0&&console[_0x220df2(0x205)](_0x220df2(0x1fa)+a5_0x216014[_0x220df2(0x276)](_0x553516));console['log'](_0x220df2(0x209)+formatElapsed(_0x23a04d)),console[_0x220df2(0x205)]('━'['repeat'](0x3c));const _0x5a2c3c={'summary':{'total':_0x2c67f4[_0x220df2(0x241)],'passed':_0x2b6a75,'failed':_0x1c6eab,'errors':_0x553516>0x0?_0x553516:undefined,'duration_ms':_0x23a04d},'tests':_0x2c67f4,'agent':{'project':_0x98c98e[_0x220df2(0x263)],'name':_0x98c98e[_0x220df2(0x210)],'site':_0x3d33b2},'timestamp':new Date(_0x5c3247)[_0x220df2(0x26c)]()};if(_0x25931b!==_0x220df2(0x213)||_0x293acc){const _0xf08252=formatResults(_0x5a2c3c,_0x25931b);if(_0x293acc)try{a5_0x30561a[_0x220df2(0x252)](_0x293acc,_0xf08252,_0x220df2(0x267)),console[_0x220df2(0x205)](),console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x1f6)](_0x220df2(0x20d)+_0x293acc));}catch(_0x3e5184){return console[_0x220df2(0x205)](),console[_0x220df2(0x205)](a5_0x216014[_0x220df2(0x276)](_0x220df2(0x26e)+_0x3e5184)),0x1;}else console[_0x220df2(0x205)](),console['log'](_0xf08252);}const _0x10b3c1=_0x2c67f4[_0x220df2(0x23f)](_0x1274c9=>_0x1274c9[_0x220df2(0x1e9)]!==_0x220df2(0x23b));return _0x10b3c1[_0x220df2(0x241)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a6_0x2a21(){const _0x14295d=['Header\x20key\x20cannot\x20be\x20empty:\x20\x22','has','cas','PATCH','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','2858920QeLcsr','output','trim','\x0aStack\x20trace:\x0a','set-cookie2','1332824PVCjyG','includes','authorization','\x22.\x20','description','6HCAaXI','llm','GET','11408193dzjSmk','601mRGlvM','314379ouVytD','2695090BgAVhE','request','stack','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','POST','proxy-authorization','Invalid\x20header\x20format:\x20\x22','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','toUpperCase','keys','color','10mzvPAH','isArray','status','Error:\x20','4840871aILcoM','DELETE','file','execute','api','entries','indexOf','llm-proxy','length','noColor','site','substring','method','type','Invalid\x20HTTP\x20method:\x20','headers','verbose','error','startsWith','validate','join','Endpoint\x20must\x20start\x20with\x20/:\x20','790kRJOJY','workflow','name','data','cdp','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','cookie'];a6_0x2a21=function(){return _0x14295d;};return a6_0x2a21();}const a6_0x3fa5da=a6_0x29d6;(function(_0x3d464c,_0x41c968){const _0x51f9cb=a6_0x29d6,_0xceda6d=_0x3d464c();while(!![]){try{const _0x444f7f=parseInt(_0x51f9cb(0xad))/0x1*(-parseInt(_0x51f9cb(0x93))/0x2)+-parseInt(_0x51f9cb(0xae))/0x3+parseInt(_0x51f9cb(0xa4))/0x4+-parseInt(_0x51f9cb(0xaf))/0x5+parseInt(_0x51f9cb(0xa9))/0x6*(-parseInt(_0x51f9cb(0xbe))/0x7)+parseInt(_0x51f9cb(0x9f))/0x8+-parseInt(_0x51f9cb(0xac))/0x9*(-parseInt(_0x51f9cb(0xba))/0xa);if(_0x444f7f===_0x41c968)break;else _0xceda6d['push'](_0xceda6d['shift']());}catch(_0xcb81ee){_0xceda6d['push'](_0xceda6d['shift']());}}}(a6_0x2a21,0x5e16d));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x29d6(_0x945e6a,_0x577091){_0x945e6a=_0x945e6a-0x86;const _0x2a21ec=a6_0x2a21();let _0x29d6d6=_0x2a21ec[_0x945e6a];return _0x29d6d6;}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x3fa5da(0xa6),a6_0x3fa5da(0xb4),a6_0x3fa5da(0x99),'set-cookie',a6_0x3fa5da(0xa3),'x-xsrf-token','x-auth-token','x-trino-user']);function isSensitiveHeader(_0x835576){const _0x43884f=a6_0x3fa5da;return SENSITIVE_HEADERS[_0x43884f(0x9b)](_0x835576['toLowerCase']());}function parseHeader(_0x28537b){const _0x18ebcf=a6_0x3fa5da,_0x513dd8=_0x28537b[_0x18ebcf(0xc4)](':');if(_0x513dd8===-0x1)throw new Error(_0x18ebcf(0xb5)+_0x28537b+_0x18ebcf(0xa7)+_0x18ebcf(0x98));const _0x4b5244=_0x28537b[_0x18ebcf(0x88)](0x0,_0x513dd8)[_0x18ebcf(0xa1)](),_0x37e506=_0x28537b[_0x18ebcf(0x88)](_0x513dd8+0x1)['trim']();if(!_0x4b5244)throw new Error(_0x18ebcf(0x9a)+_0x28537b+'\x22');return[_0x4b5244,_0x37e506];}export class ApiCommand extends BaseCommand{[a6_0x3fa5da(0x95)]=a6_0x3fa5da(0xc2);[a6_0x3fa5da(0xa8)]=a6_0x3fa5da(0xb6);[a6_0x3fa5da(0x90)](_0xd8d225){const _0x813cd9=a6_0x3fa5da,{args:_0x106e3e,options:_0x146c91}=_0xd8d225,_0x285ee7=_0x146c91;if(_0x106e3e[_0x813cd9(0xc6)]===0x0)return _0x813cd9(0xb2);const _0x152a73=_0x106e3e[0x0];if(!_0x152a73[_0x813cd9(0x8f)]('/'))return _0x813cd9(0x92)+_0x152a73;const _0x54526d=_0x285ee7[_0x813cd9(0x96)],_0x344970=_0x285ee7[_0x813cd9(0xc0)];if(_0x54526d&&_0x344970)return _0x813cd9(0x9e);const _0x3977fc=_0x285ee7['method']||'GET',_0x2e36bb=[_0x813cd9(0xab),_0x813cd9(0xb3),'PUT',_0x813cd9(0xbf),_0x813cd9(0x9d)];if(!_0x2e36bb[_0x813cd9(0xa5)](_0x3977fc[_0x813cd9(0xb7)]()))return _0x813cd9(0x8b)+_0x3977fc+'.\x20Valid\x20methods:\x20'+_0x2e36bb[_0x813cd9(0x91)](',\x20');const _0x37d110=_0x285ee7[_0x813cd9(0x8a)]||'td',_0x44fd91=['td',_0x813cd9(0x97),_0x813cd9(0x94),'trino',_0x813cd9(0xaa),_0x813cd9(0xc5),_0x813cd9(0x9c)];if(!_0x44fd91[_0x813cd9(0xa5)](_0x37d110))return'Invalid\x20API\x20type:\x20'+_0x37d110+'.\x20Valid\x20types:\x20'+_0x44fd91[_0x813cd9(0x91)](',\x20');return undefined;}async[a6_0x3fa5da(0xc1)](_0x4adf87){const _0x1c3507=a6_0x3fa5da,{options:_0x4abe46,args:_0x3db103,tdx:_0x170358}=_0x4adf87,_0x12b021=_0x4abe46,_0x51063a=_0x3db103[0x0],_0x19b6b5=(_0x12b021[_0x1c3507(0x89)]||_0x1c3507(0xab))[_0x1c3507(0xb7)](),_0x5a6a83=_0x12b021[_0x1c3507(0x96)],_0x32e337=_0x12b021['file'],_0x13bdc5=_0x12b021['header'],_0x55b271=_0x12b021['type']||'td';try{const _0x47a263={};if(_0x13bdc5){const _0x1c80e8=Array[_0x1c3507(0xbb)](_0x13bdc5)?_0x13bdc5:[_0x13bdc5];for(const _0x396403 of _0x1c80e8){const [_0x29fa36,_0x15d1eb]=parseHeader(_0x396403);_0x47a263[_0x29fa36]=_0x15d1eb;}}let _0x4ed35a;if(_0x5a6a83)_0x4ed35a=_0x5a6a83;else{if(_0x32e337)try{_0x4ed35a=RawAPI['readBodyFromFile'](_0x32e337);}catch(_0x37d721){return console[_0x1c3507(0x8e)](_0x1c3507(0xbd)+(_0x37d721 instanceof Error?_0x37d721['message']:String(_0x37d721))),0x1;}}const _0x433cb4={'method':_0x19b6b5,'apiType':_0x55b271,'includeHeaders':_0x4abe46['verbose']};_0x4ed35a&&(_0x433cb4['body']=_0x4ed35a);Object[_0x1c3507(0xb8)](_0x47a263)['length']>0x0&&(_0x433cb4[_0x1c3507(0x8c)]=_0x47a263);if(_0x4abe46[_0x1c3507(0x8d)]){const _0x184364=resolveSite(_0x4abe46[_0x1c3507(0x87)]),_0x407c7b=getEndpoint(_0x184364,_0x55b271),_0x3762fc=''+_0x407c7b+_0x51063a;console[_0x1c3507(0x8e)]('>\x20'+_0x19b6b5+'\x20'+_0x3762fc);const _0x284855=getAuthHeaders(_0x184364),_0x33a58b={..._0x284855,..._0x47a263};for(const [_0x4457fb,_0x545b9a]of Object['entries'](_0x33a58b)){!isSensitiveHeader(_0x4457fb)&&console[_0x1c3507(0x8e)]('>\x20'+_0x4457fb+':\x20'+_0x545b9a);}_0x4ed35a&&console[_0x1c3507(0x8e)]('>'),console[_0x1c3507(0x8e)]('');}const _0x53afa4=await _0x170358[_0x1c3507(0xc2)][_0x1c3507(0xb0)](_0x51063a,_0x433cb4);if(_0x4abe46[_0x1c3507(0x8d)]&&_0x53afa4[_0x1c3507(0x8c)]){console[_0x1c3507(0x8e)]('<\x20HTTP/1.1\x20'+_0x53afa4[_0x1c3507(0xbc)]);for(const [_0x1f7eac,_0x4f5682]of Object[_0x1c3507(0xc3)](_0x53afa4['headers'])){!isSensitiveHeader(_0x1f7eac)&&console[_0x1c3507(0x8e)]('<\x20'+_0x1f7eac+':\x20'+_0x4f5682);}console[_0x1c3507(0x8e)]('');}const _0x1282bd=Boolean(_0x4abe46[_0x1c3507(0xa0)]),_0x105842={'color':_0x4abe46[_0x1c3507(0xb9)],'noColor':_0x4abe46[_0x1c3507(0x86)]||_0x1282bd&&!_0x4abe46[_0x1c3507(0xb9)]},_0x26f110=colorizeJSON(_0x53afa4[_0x1c3507(0x96)],_0x105842);return _0x4abe46[_0x1c3507(0xa0)]?(writeFileSync(_0x4abe46[_0x1c3507(0xa0)],_0x26f110),console['error']('Results\x20saved\x20to\x20'+_0x4abe46['output'])):console['log'](_0x26f110),0x0;}catch(_0x581ea8){return _0x581ea8 instanceof Error?(console[_0x1c3507(0x8e)](_0x1c3507(0xbd)+_0x581ea8['message']),_0x4abe46[_0x1c3507(0x8d)]&&_0x581ea8[_0x1c3507(0xb1)]&&console[_0x1c3507(0x8e)](_0x1c3507(0xa2)+_0x581ea8[_0x1c3507(0xb1)])):console['error'](_0x1c3507(0xbd)+String(_0x581ea8)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a7_0x50f9(_0x421ca2,_0x3a8603){_0x421ca2=_0x421ca2-0x99;const _0x4ea2b0=a7_0x4ea2();let _0x50f910=_0x4ea2b0[_0x421ca2];return _0x50f910;}const a7_0xfc7611=a7_0x50f9;(function(_0x22de0c,_0x5ea023){const _0x51e224=a7_0x50f9,_0x250865=_0x22de0c();while(!![]){try{const _0x354f1a=parseInt(_0x51e224(0xca))/0x1*(parseInt(_0x51e224(0x9a))/0x2)+parseInt(_0x51e224(0xc3))/0x3+-parseInt(_0x51e224(0xc6))/0x4+-parseInt(_0x51e224(0xae))/0x5+parseInt(_0x51e224(0xb0))/0x6*(parseInt(_0x51e224(0xb1))/0x7)+parseInt(_0x51e224(0xc8))/0x8*(parseInt(_0x51e224(0xe4))/0x9)+-parseInt(_0x51e224(0xdb))/0xa;if(_0x354f1a===_0x5ea023)break;else _0x250865['push'](_0x250865['shift']());}catch(_0x4fd838){_0x250865['push'](_0x250865['shift']());}}}(a7_0x4ea2,0xd6c90));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}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_0x4ea2(){const _0x14ea14=['ERROR','oauth','tdx\x20profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','password','logLevel','Choose\x20authentication\x20method:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','warn','API\x20key','method','API\x20key\x20cannot\x20be\x20empty','red','tdx:\x20auth\x20clear','4983055iqUKmV','\x20(profile:\x20','233952efxnKx','56aeGzKC','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20for\x20profile:\x20','✗\x20Validation\x20failed:\x20','getUserInfo','apikey','\x20and\x20','auth:setup','trim','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','green','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x0aSetup\x20cancelled','\x20(site:\x20','No\x20credentials\x20found\x20in\x20keychain','select','Validating\x20API\x20key...','first_name','1048701wuqdfS','Setup\x20cancelled','Setup\x20API\x20key\x20authentication\x20interactively','2097812CeAXfH','filter','5992AmLQXt','log','1DcsckB','name','error','You\x20can\x20find\x20your\x20API\x20key\x20at:','bold','site','status','Credential\x20type:\x20OAuth','message','us01','Name:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Read\x20credential\x20from\x20','No\x20credential\x20found','Enter\x20your\x20TD\x20API\x20key:','\x20\x20tdx','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','4335130yPxSKO','OAuth\x20(browser\x20login)','API\x20Key','\x20--profile\x20','yellow','profile','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','last_name','description','15777yejlhR','email','auth','/app/mp/ak','N/A','1719674EwFRXC','apiKey','✓\x20Profile\x20\x27','execute','tdx:\x20auth\x20setup','join'];a7_0x4ea2=function(){return _0x14ea14;};return a7_0x4ea2();}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x7cc1fe 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_0x2312c7 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0xfc7611(0xcb)]=a7_0xfc7611(0xb8);['description']=a7_0xfc7611(0xc5);async[a7_0xfc7611(0x9d)](_0x5acfd5){const _0x4904cd=a7_0xfc7611,{options:_0x1459f5}=_0x5acfd5,_0x1025be=_0x1459f5['profile'];console[_0x4904cd(0xc9)](a7_0x2312c7[_0x4904cd(0xce)](_0x4904cd(0x9e)));const _0x54ab93=_0x1459f5[_0x4904cd(0xcf)]||_0x4904cd(0xd3),_0x10a62e=await promptSiteSelection(_0x54ab93,_0x1025be,_0x4904cd(0xc4));if(!_0x10a62e)return 0x1;const _0x151840=resolveSite(_0x10a62e);if(isOAuthSupported(_0x151840)){const _0x4677db=await a7_0x7cc1fe({'type':_0x4904cd(0xc0),'name':'method','message':_0x4904cd(0xa6),'choices':[{'title':_0x4904cd(0xdc),'value':_0x4904cd(0xa1)},{'title':_0x4904cd(0xdd),'value':_0x4904cd(0xb6)}]});if(!_0x4677db[_0x4904cd(0xaa)])return console[_0x4904cd(0xc9)](_0x4904cd(0xbd)),0x1;if(_0x4677db[_0x4904cd(0xaa)]==='oauth')return await runOAuthLoginFlow(_0x151840,_0x1025be,_0x1459f5[_0x4904cd(0xa5)]??LogLevel[_0x4904cd(0xa0)]),0x0;}console[_0x4904cd(0xc9)](_0x4904cd(0xa3)+_0x151840),console[_0x4904cd(0xc9)](_0x4904cd(0xcd)),console[_0x4904cd(0xc9)]('\x20\x20'+getConsoleUrl(_0x151840,_0x4904cd(0xe7)));const _0x2b67bc=await a7_0x7cc1fe({'type':_0x4904cd(0xa4),'name':_0x4904cd(0x9b),'message':_0x4904cd(0xd8),'validate':_0x1bc728=>{const _0xec9ea7=_0x4904cd;if(!_0x1bc728||!_0x1bc728['trim']())return _0xec9ea7(0xab);return!![];}});if(!_0x2b67bc[_0x4904cd(0x9b)])return console[_0x4904cd(0xc9)](_0x4904cd(0xbd)),0x1;const _0x1f8450=_0x2b67bc[_0x4904cd(0x9b)];console['log'](_0x4904cd(0xc1));try{const _0x3a4b50=TDX['create']({'site':_0x151840,'apiKey':_0x1f8450[_0x4904cd(0xb9)](),'logLevel':_0x1459f5[_0x4904cd(0xa5)]??LogLevel[_0x4904cd(0xa0)]}),_0x2ec424=await _0x3a4b50['jobs'][_0x4904cd(0xb5)]();console[_0x4904cd(0xc9)](_0x4904cd(0xd5)+_0x2ec424[_0x4904cd(0xe5)]+')');const _0x1287e7=await isKeychainAvailable();_0x1287e7?(await saveAPIKeyAsync(_0x1f8450[_0x4904cd(0xb9)](),_0x151840,_0x1025be),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x1025be?'\x20(profile:\x20'+_0x1025be+')':''))):(console[_0x4904cd(0xa8)](a7_0x2312c7[_0x4904cd(0xdf)](_0x4904cd(0xda))),console['warn'](a7_0x2312c7[_0x4904cd(0xdf)](_0x4904cd(0xba))));if(_0x1025be){const _0x1f72c0={'site':_0x151840};saveProfileToUserConfig(_0x1025be,_0x1f72c0),console[_0x4904cd(0xc9)](_0x4904cd(0x9c)+_0x1025be+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x151840),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x151840);const _0x3ab27b=_0x1025be?_0x4904cd(0xde)+_0x1025be:'';return console[_0x4904cd(0xc9)](),console['log'](_0x4904cd(0xa7)),console['log'](_0x4904cd(0xd9)+_0x3ab27b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x4904cd(0xc9)]('\x20\x20tdx'+_0x3ab27b+_0x4904cd(0xbc)),0x0;}catch(_0xbf22a6){if(_0xbf22a6 instanceof HTTPClientError&&_0xbf22a6[_0x4904cd(0xd0)]===0x191)return printAuthError(_0xbf22a6),0x1;return console[_0x4904cd(0xcc)](a7_0x2312c7[_0x4904cd(0xac)](_0x4904cd(0xb4)+(_0xbf22a6 instanceof Error?_0xbf22a6[_0x4904cd(0xd2)]:String(_0xbf22a6)))),console[_0x4904cd(0xcc)](_0x4904cd(0xb2)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xfc7611(0xcb)]=a7_0xfc7611(0xe6);[a7_0xfc7611(0xe3)]=a7_0xfc7611(0xe1);async[a7_0xfc7611(0x9d)](_0x4a5b05){const _0x1effc3=a7_0xfc7611,{options:_0x425241,tdx:_0x191c03}=_0x4a5b05,_0x4ea387=_0x425241[_0x1effc3(0xcf)],_0x39d2b3=_0x425241[_0x1effc3(0xe0)],_0x37ed1b=_0x39d2b3?_0x39d2b3:_0x1effc3(0x99);console[_0x1effc3(0xc9)](_0x1effc3(0xa2)+_0x37ed1b+_0x1effc3(0xbe)+_0x4ea387+')');const _0x584a66=await getOAuthTokens(_0x39d2b3);if(_0x584a66)console[_0x1effc3(0xc9)](_0x1effc3(0xd1)),console[_0x1effc3(0xc9)]('Read\x20credential\x20from\x20keychain'+(_0x39d2b3?'\x20(profile:\x20'+_0x39d2b3+')':''));else{const _0x259a3a=await resolveAPIKeyAsync(_0x4ea387,_0x39d2b3);if(_0x259a3a){const {source:_0x117eac,isDeprecated:_0x3629fe}=_0x259a3a,_0x456b71=_0x1effc3(0xd6)+_0x117eac;console[_0x1effc3(0xc9)](_0x3629fe?a7_0x2312c7[_0x1effc3(0xdf)](_0x456b71):_0x456b71);}else console[_0x1effc3(0xc9)](a7_0x2312c7[_0x1effc3(0xdf)](_0x1effc3(0xd7)));}try{const _0x475a65=await _0x191c03['jobs'][_0x1effc3(0xb5)]();return console['log'](a7_0x2312c7[_0x1effc3(0xbb)]('✓\x20Authentication\x20successful\x0a')),console[_0x1effc3(0xc9)]('User:\x20'+_0x475a65[_0x1effc3(0xe5)]),(_0x475a65[_0x1effc3(0xc2)]||_0x475a65['last_name'])&&console[_0x1effc3(0xc9)](_0x1effc3(0xd4)+[_0x475a65[_0x1effc3(0xc2)],_0x475a65[_0x1effc3(0xe2)]][_0x1effc3(0xc7)](Boolean)[_0x1effc3(0x9f)]('\x20')),0x0;}catch(_0x1b6e08){return _0x1b6e08 instanceof HTTPClientError&&_0x1b6e08[_0x1effc3(0xd0)]===0x191?printAuthError(_0x1b6e08,!![],_0x39d2b3):console[_0x1effc3(0xcc)](a7_0x2312c7[_0x1effc3(0xac)](_0x1effc3(0xb4)+(_0x1b6e08 instanceof Error?_0x1b6e08[_0x1effc3(0xd2)]:String(_0x1b6e08)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xfc7611(0xcb)]='auth:clear';['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0xfc7611(0x9d)](_0x45d382){const _0x25d10a=a7_0xfc7611,{options:_0x32b513}=_0x45d382,_0x4db370=_0x32b513[_0x25d10a(0xe0)];console[_0x25d10a(0xc9)](a7_0x2312c7[_0x25d10a(0xce)](_0x25d10a(0xad)));const _0x442f7a=await isKeychainAvailable();if(!_0x442f7a)return console[_0x25d10a(0xcc)](a7_0x2312c7['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x3ce142,_0x14e666]=await Promise['all']([deleteKeychainAPIKey(_0x4db370),deleteOAuthTokens(_0x4db370)]);if(_0x3ce142||_0x14e666){clearCredentialCache();const _0x26f8a5=[_0x3ce142&&_0x25d10a(0xa9),_0x14e666&&'OAuth\x20tokens'][_0x25d10a(0xc7)](Boolean)[_0x25d10a(0x9f)](_0x25d10a(0xb7));return console[_0x25d10a(0xc9)]('✓\x20'+_0x26f8a5+'\x20removed\x20from\x20keychain'+(_0x4db370?_0x25d10a(0xaf)+_0x4db370+')':'')),0x0;}else return console['log'](_0x25d10a(0xbf)+(_0x4db370?_0x25d10a(0xb3)+_0x4db370:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x2d3e2b=a8_0x9844;function a8_0x9844(_0x2134a4,_0x55ff8f){_0x2134a4=_0x2134a4-0x6f;const _0x472c8d=a8_0x472c();let _0x9844ba=_0x472c8d[_0x2134a4];return _0x9844ba;}(function(_0x45608,_0x44f309){const _0x37b6a6=a8_0x9844,_0x214742=_0x45608();while(!![]){try{const _0x4ddd75=-parseInt(_0x37b6a6(0x7c))/0x1+-parseInt(_0x37b6a6(0x96))/0x2+-parseInt(_0x37b6a6(0x8c))/0x3+parseInt(_0x37b6a6(0x75))/0x4+-parseInt(_0x37b6a6(0x92))/0x5*(-parseInt(_0x37b6a6(0x73))/0x6)+-parseInt(_0x37b6a6(0x72))/0x7*(-parseInt(_0x37b6a6(0x95))/0x8)+parseInt(_0x37b6a6(0x7d))/0x9;if(_0x4ddd75===_0x44f309)break;else _0x214742['push'](_0x214742['shift']());}catch(_0x457ec9){_0x214742['push'](_0x214742['shift']());}}}(a8_0x472c,0x5c782));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x472c(){const _0x405560=['\x20\x20tdx','1410213clUrbO','\x20(profile:\x20','description','access_token','\x27\x20registered','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','70UrgfqY','logLevel','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','3352doNZAp','880970fVmWCz','✓\x20Authentication\x20successful\x20(User:\x20','site','log','5425DDKjct','177378QwZiqC','✓\x20Profile\x20\x27','2600380WrFkgZ','jobs','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','green','us01','email','690320iYuvCC','5318352znldqD','Login\x20via\x20OAuth\x20(opens\x20browser)','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','bold','ERROR','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Opening\x20browser\x20for\x20authentication...','execute','getUserInfo','profile','/oauth/authorize','Validating\x20OAuth\x20tokens...'];a8_0x472c=function(){return _0x405560;};return a8_0x472c();}import a8_0x148d95 from'chalk';export async function runOAuthLoginFlow(_0x2f35d3,_0x2544c8,_0x22c7cb){const _0x2449a1=a8_0x9844;if(!isOAuthSupported(_0x2f35d3))throw new Error(_0x2449a1(0x78)+_0x2f35d3+'.\x20'+_0x2449a1(0x83)+_0x2449a1(0x94));const _0x47b099=await isKeychainAvailable();if(!_0x47b099)throw new Error(_0x2449a1(0x82)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x457a90=getConsoleUrl(_0x2f35d3);console['log'](_0x2449a1(0x85)),console[_0x2449a1(0x71)]('\x20\x20'+_0x457a90+_0x2449a1(0x89)),console[_0x2449a1(0x71)](_0x2449a1(0x7f));const _0x3b18ff=await startOAuthFlow(_0x2f35d3);console[_0x2449a1(0x71)](_0x2449a1(0x8a));const _0x201b58=TDX['create']({'site':_0x2f35d3,'accessToken':_0x3b18ff[_0x2449a1(0x8f)],'logLevel':_0x22c7cb??LogLevel[_0x2449a1(0x81)]}),_0x337d1d=await _0x201b58[_0x2449a1(0x76)][_0x2449a1(0x87)]();console['log'](a8_0x148d95[_0x2449a1(0x79)](_0x2449a1(0x6f)+_0x337d1d[_0x2449a1(0x7b)]+')')),await saveOAuthTokens(_0x3b18ff,_0x2544c8),console[_0x2449a1(0x71)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x2544c8?_0x2449a1(0x8d)+_0x2544c8+')':''));if(_0x2544c8){const _0x2d592e={'site':_0x2f35d3};saveProfileToUserConfig(_0x2544c8,_0x2d592e),console[_0x2449a1(0x71)](_0x2449a1(0x74)+_0x2544c8+_0x2449a1(0x90));}const _0x6e2c89=_0x2544c8?'\x20--profile\x20'+_0x2544c8:'';console[_0x2449a1(0x71)](),console[_0x2449a1(0x71)](_0x2449a1(0x91)),console[_0x2449a1(0x71)](_0x2449a1(0x8b)+_0x6e2c89+_0x2449a1(0x84)),console[_0x2449a1(0x71)](_0x2449a1(0x8b)+_0x6e2c89+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{['name']='auth:login';[a8_0x2d3e2b(0x8e)]=a8_0x2d3e2b(0x7e);async[a8_0x2d3e2b(0x86)](_0x2fc6ab){const _0x3d078f=a8_0x2d3e2b,{options:_0x3b4e90}=_0x2fc6ab,_0x36497e=_0x3b4e90[_0x3d078f(0x88)];console['log'](a8_0x148d95[_0x3d078f(0x80)]('tdx:\x20auth\x20login'));const _0x5bd973=_0x3b4e90[_0x3d078f(0x70)]||_0x3d078f(0x7a),_0x43fc26=await promptSiteSelection(_0x5bd973,_0x36497e,'Login\x20cancelled');if(!_0x43fc26)return 0x1;const _0x354e5e=resolveSite(_0x43fc26);return console[_0x3d078f(0x71)](_0x3d078f(0x77)+_0x354e5e),await runOAuthLoginFlow(_0x354e5e,_0x36497e,_0x3b4e90[_0x3d078f(0x93)]??LogLevel['ERROR']),0x0;}}
|