@treasuredata/tdx 2026.4.19 → 2026.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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.d.ts +1 -0
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +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.js +1 -1
- package/dist/commands/workflow-command.d.ts +1 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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.d.ts +7 -0
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/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.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +14 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.d.ts +65 -0
- package/dist/sdk/workflow/task-graph.d.ts.map +1 -0
- package/dist/sdk/workflow/task-graph.js +1 -0
- package/dist/sdk/workflow/task-graph.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/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
|
+
function a3_0x2dce(_0x515f1a,_0x17805e){_0x515f1a=_0x515f1a-0xdf;const _0x202d14=a3_0x202d();let _0x2dce10=_0x202d14[_0x515f1a];return _0x2dce10;}const a3_0x18deb2=a3_0x2dce;(function(_0x303b10,_0x29d3bf){const _0x44d341=a3_0x2dce,_0x3fb2c7=_0x303b10();while(!![]){try{const _0x2b44d6=parseInt(_0x44d341(0xed))/0x1*(parseInt(_0x44d341(0xe3))/0x2)+parseInt(_0x44d341(0xf3))/0x3+parseInt(_0x44d341(0xf9))/0x4*(parseInt(_0x44d341(0xe2))/0x5)+parseInt(_0x44d341(0xe4))/0x6+parseInt(_0x44d341(0xe7))/0x7+parseInt(_0x44d341(0xf8))/0x8*(parseInt(_0x44d341(0xec))/0x9)+parseInt(_0x44d341(0xe5))/0xa*(-parseInt(_0x44d341(0xea))/0xb);if(_0x2b44d6===_0x29d3bf)break;else _0x3fb2c7['push'](_0x3fb2c7['shift']());}catch(_0x1c3949){_0x3fb2c7['push'](_0x3fb2c7['shift']());}}}(a3_0x202d,0xec1a0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x202d(){const _0x2920a4=['Resolved\x20child\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','\x20activation','Resolved\x20parent\x20ID:\x20','activations','125rkmoKy','2yPILOX','10654950sOkYZX','66119780CgPejA','resolveSegmentId','13187951HwPWIA','segment','Resolving\x20parent\x20segment\x20\x27','11oytfXs','\x20\x20Cause:\x20','70407dOfdVt','1280987EvYzlu','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','List\x20activations\x20for\x20a\x20segment','Error:\x20','data','1550988ZeTxPu','length','execute','cause','Site:\x20','1504BNrceN','104084edYlAq','verbose','error','resolveParentId','Resolving\x20child\x20segment\x20\x27','\x27...','✔\x20Found\x20'];a3_0x202d=function(){return _0x2920a4;};return a3_0x202d();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x18deb2(0xe1);['description']=a3_0x18deb2(0xf0);async[a3_0x18deb2(0xf5)](_0x27bfa5){const _0x1c9def=a3_0x18deb2,{options:_0x2fd687,args:_0x37da02,tdx:_0x108a9c}=_0x27bfa5;if(_0x37da02[_0x1c9def(0xf4)]===0x0)return console[_0x1c9def(0xfb)]('Error:\x20Segment\x20name\x20is\x20required'),console['error'](_0x1c9def(0xee)),0x1;try{const {parentId:_0xc8322,childId:_0x4d0579}=parseSegmentRef(_0x37da02[0x0]);if(!_0x4d0579)return console[_0x1c9def(0xfb)](_0x1c9def(0xef)),console[_0x1c9def(0xfb)](_0x1c9def(0xee)),0x1;_0x2fd687['verbose']&&(console['error'](_0x1c9def(0xf7)+_0x2fd687['site']),console[_0x1c9def(0xfb)]('Parent\x20name:\x20'+_0xc8322),console[_0x1c9def(0xfb)]('Child\x20name:\x20'+_0x4d0579));const _0x2f2de9=await withSpinner(_0x1c9def(0xe9)+_0xc8322+_0x1c9def(0xfe),()=>_0x108a9c[_0x1c9def(0xe8)][_0x1c9def(0xfc)](_0xc8322),{'verbose':_0x2fd687[_0x1c9def(0xfa)]}),_0xe6228=_0x2f2de9['data'];_0x2fd687[_0x1c9def(0xfa)]&&console[_0x1c9def(0xfb)](_0x1c9def(0xe0)+_0xe6228);const _0x2c8d28=await withSpinner(_0x1c9def(0xfd)+_0x4d0579+'\x27...',()=>_0x108a9c['segment'][_0x1c9def(0xe6)](_0xe6228,_0x4d0579),{'verbose':_0x2fd687['verbose']}),_0x166e71=_0x2c8d28['data'];_0x2fd687[_0x1c9def(0xfa)]&&console['error'](_0x1c9def(0x100)+_0x166e71);const _0x165a82=await withSpinner(_0x1c9def(0x101)+_0x4d0579+_0x1c9def(0xfe),()=>_0x108a9c[_0x1c9def(0xe8)]['listActivations'](_0xe6228,_0x166e71),{'verbose':_0x2fd687[_0x1c9def(0xfa)]}),_0x1c2b5d=_0x165a82[_0x1c9def(0xf2)];return console[_0x1c9def(0xfb)](_0x1c9def(0xff)+_0x1c2b5d[_0x1c9def(0xf4)]+_0x1c9def(0xdf)+(_0x1c2b5d['length']!==0x1?'s':'')),await handleSDKOutput(_0x1c2b5d,_0x2fd687),0x0;}catch(_0x46c285){if(_0x46c285 instanceof SDKError)return console[_0x1c9def(0xfb)](_0x1c9def(0xf1)+_0x46c285['message']),_0x46c285[_0x1c9def(0xf6)]&&console[_0x1c9def(0xfb)](_0x1c9def(0xeb)+_0x46c285[_0x1c9def(0xf6)]),0x1;throw _0x46c285;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x9ae543=a4_0x182e;function a4_0x182e(_0x119025,_0x47a113){_0x119025=_0x119025-0x1b1;const _0x47c742=a4_0x47c7();let _0x182e8a=_0x47c742[_0x119025];return _0x182e8a;}(function(_0x49ee10,_0x5aee05){const _0x193543=a4_0x182e,_0x30d6a9=_0x49ee10();while(!![]){try{const _0x5660ce=parseInt(_0x193543(0x1c9))/0x1*(-parseInt(_0x193543(0x1ec))/0x2)+parseInt(_0x193543(0x21e))/0x3*(parseInt(_0x193543(0x1bd))/0x4)+parseInt(_0x193543(0x224))/0x5+parseInt(_0x193543(0x20b))/0x6+-parseInt(_0x193543(0x23e))/0x7+-parseInt(_0x193543(0x211))/0x8*(-parseInt(_0x193543(0x249))/0x9)+parseInt(_0x193543(0x1df))/0xa;if(_0x5660ce===_0x5aee05)break;else _0x30d6a9['push'](_0x30d6a9['shift']());}catch(_0x53a39a){_0x30d6a9['push'](_0x30d6a9['shift']());}}}(a4_0x47c7,0x5de9d));import a4_0x40b849 from'chalk';import a4_0x188f49 from'path';function a4_0x47c7(){const _0x58cc40=['\x20total','agentName','red','log','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','New\x20project\x20ID:\x20','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','-\x20no\x20files\x20written','dryRun','Using\x20current\x20project:\x20','textKnowledgeBases','chatInterfaces','\x22\x20to\x20a\x20different\x20profile','source','cloneProject','Analyzing\x20changes\x20to\x20push...','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20--profile\x20','\x20\x20Agent\x20\x22','Would\x20pull\x20agent:\x20','dim','\x20unchanged','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20successfully','1700iptBHZ','agent:pull','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aError:','Analyzing\x20project\x20\x22','\x20|\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','force','Writing\x20files...','\x20\x20tdx\x20agent\x20clone\x20agents/','reason','Cloning\x20\x22','2HaNbAy','yellow','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\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)','\x22\x20from\x20project\x20\x22','Chat:\x20','execute','Project:\x20','\x0aPush\x20','new','no_context','projectId','utf-8','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20tdx\x20agent\x20pull\x20','description','llm','MISSING_ARGUMENT','Would\x20push\x20agent:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','agent','701730XDRnbj','Clone\x20\x22','pushAgent','Summary:','Source:\x20','\x20new','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Text\x20Knowledge\x20Bases:\x20','action','pullProject','\x20\x20Form\x20Interface\x20\x22','\x20resources?','New\x20project\x20name\x20is\x20required','536474yQMrrR','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\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','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','newProjectId','arg-dir','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Pulling\x20agent\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','agents','\x20errors','repeat','\x22...','\x0aPull\x20summary\x20for\x20\x27','counts','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Experimental\x20Artifacts:\x20','knowledgeBases','prompts','Using\x20project\x20from\x20context:\x20','projectName','green','\x20\x20Integration\x20\x22','-\x20nothing\x20pushed','Output\x20path:\x20','\x20\x20Chat\x20Interface\x20\x22','cwd-config','\x20created','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','9966EGcYJm','push','\x20\x20Form\x20Interfaces:\x20','\x0aProject\x20pushed\x20with\x20errors','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20project\x20from\x20','23376pOfFlU','outputDir','<new-name>','found','parse','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x22:\x20','Errors:','llmProject','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)','profile','\x20updated','4449vUmmCf','error','outputPath','message','integrations','Project\x20cloned\x20successfully','3086285hjxlNY','no_local_folder','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','join','session','\x0aErrors\x20found:','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','llm_project','Cancelled','\x0a✔\x20Pushed\x20','\x0aWrite\x20','\x20\x20Target:\x20','\x20\x20Chat\x20Interfaces:\x20','dirname','\x0aChanges\x20to\x20integration\x20\x27','experimentalArtifacts','Agent:\x20','agent:push','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','No\x20tdx.json\x20found\x20in\x20','pushProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Output:\x20','Using\x20project:\x20','4464789OUrUvq','diff','Using\x20local\x20project:\x20','updated','context','cwd','Dry\x20run\x20-\x20no\x20changes\x20made','unchanged','Dry\x20run\x20-\x20no\x20files\x20written','sourceProjectName','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','738ezMiNJ','Pushing\x20agent\x20from\x20\x22','New\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','total','\x20resources\x20to\x20\x27','\x20\x20Source:\x20','INVALID_ARGUMENT','experimentalKnowledgeBases','formInterfaces','created','Would\x20clone:','\x20=\x20','agentId','tdx.json','\x20changed','agent:clone','Status:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errors','\x20\x20Agents:\x20','pullAgent','name','cyan','agent.yml','site'];a4_0x47c7=function(){return _0x58cc40;};return a4_0x47c7();}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4d5896){const _0x2520df=a4_0x182e,_0xa18c9e=[];if(_0x4d5896[_0x2520df(0x24d)]!==undefined)_0xa18c9e[_0x2520df(0x20c)](_0x4d5896['total']+_0x2520df(0x263));if(_0x4d5896['new']!==undefined&&_0x4d5896['new']>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849[_0x2520df(0x203)](_0x4d5896[_0x2520df(0x1d3)]+'\x20new'));if(_0x4d5896[_0x2520df(0x253)]!==undefined&&_0x4d5896[_0x2520df(0x253)]>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849[_0x2520df(0x203)](_0x4d5896['created']+_0x2520df(0x209)));if(_0x4d5896['updated']!==undefined&&_0x4d5896['updated']>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849['yellow'](_0x4d5896['updated']+_0x2520df(0x21d)));if(_0x4d5896[_0x2520df(0x245)]!==undefined&&_0x4d5896[_0x2520df(0x245)]>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849['gray'](_0x4d5896['unchanged']+_0x2520df(0x1b9)));if(_0x4d5896[_0x2520df(0x25c)]!==undefined&&_0x4d5896[_0x2520df(0x25c)]>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849['red'](_0x4d5896[_0x2520df(0x25c)]+_0x2520df(0x1f7)));return _0xa18c9e[_0x2520df(0x227)](',\x20');}function displayDiffs(_0x128284,_0x53e1f6,_0x15bc71,_0xe9cd33,_0x4d72c8,_0x538d75,_0x57cbdc,_0x51b2d2,_0x15bd8b){const _0x44f173=a4_0x182e;for(const _0x223b2e of _0x128284){if(_0x223b2e[_0x44f173(0x23f)]){const _0x468f8c=_0x223b2e['agentName']||_0x223b2e[_0x44f173(0x25f)];console[_0x44f173(0x266)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x468f8c+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x223b2e[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c));}}for(const _0x3d8ceb of _0x53e1f6){_0x3d8ceb[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1bf)+_0x3d8ceb[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x3d8ceb[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x3eb801 of _0x15bc71){_0x3eb801[_0x44f173(0x23f)]&&(console['log'](_0x44f173(0x22a)+_0x3eb801[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console['log'](_0x3eb801[_0x44f173(0x23f)]),console['log']('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x46bb98 of _0xe9cd33){_0x46bb98[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1f5)+_0x46bb98['name']+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x46bb98[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'['repeat'](0x3c)));}for(const _0x580c51 of _0x4d72c8){_0x580c51[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x232)+_0x580c51[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x580c51[_0x44f173(0x23f)]),console['log']('─'['repeat'](0x3c)));}for(const _0x21c833 of _0x538d75){_0x21c833[_0x44f173(0x23f)]&&(console['log'](_0x44f173(0x1cc)+_0x21c833[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console['log'](_0x21c833[_0x44f173(0x23f)]),console['log']('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x4ffef0 of _0x57cbdc){_0x4ffef0[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1f3)+_0x4ffef0[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x4ffef0[_0x44f173(0x23f)]),console['log']('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x164c3c of _0x51b2d2){_0x164c3c[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1bb)+_0x164c3c[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x164c3c[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'['repeat'](0x3c)));}for(const _0x134031 of _0x15bd8b){_0x134031[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x269)+_0x134031['name']+'\x27:'),console['log']('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x134031['diff']),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x9ae543(0x25f)]=a4_0x9ae543(0x1be);[a4_0x9ae543(0x1d9)]=a4_0x9ae543(0x239);async[a4_0x9ae543(0x1d0)](_0xd45bac){const _0x1e7b28=a4_0x9ae543,{options:_0x33d688,args:_0x2ec464,tdx:_0x393b2a}=_0xd45bac,_0x68cae1=_0x2ec464[0x0],_0x41c75d=_0x2ec464[0x1],_0x43129d=_0x33d688['output'],_0x560dec=_0x33d688['dryRun'],_0x5d41c1=_0x33d688[_0x1e7b28(0x1c4)],_0x1572b5=_0x33d688['yes'],_0x18b3c0=_0x33d688[_0x1e7b28(0x21a)],_0x13e558=_0x33d688[_0x1e7b28(0x1de)];let _0x58a234;if(_0x68cae1){const _0x3548e1=a4_0x188f49['join'](_0x68cae1,'tdx.json');if(existsSync(_0x3548e1))try{const _0x58b016=JSON[_0x1e7b28(0x215)](readFileSync(_0x3548e1,'utf-8'));_0x58b016[_0x1e7b28(0x22b)]&&(_0x58a234={'llm_project':_0x58b016['llm_project']});}catch{}}const _0x41dc91=findAgentConfigPath(process[_0x1e7b28(0x243)]());let _0xca9d6;if(_0x41dc91)try{const _0x5b767d=JSON[_0x1e7b28(0x215)](readFileSync(_0x41dc91,_0x1e7b28(0x1d6)));_0x5b767d['llm_project']&&(_0xca9d6={'llm_project':_0x5b767d['llm_project']});}catch{}const _0x5c15cf=resolveAgentPullArgs({'arg':_0x68cae1,'agentNameArg':_0x41c75d,'agentFlag':_0x13e558,'contextProject':_0x18b3c0,'argDirConfig':_0x58a234,'cwdConfigPath':_0x41dc91||undefined,'cwdConfig':_0xca9d6}),{projectNameOrId:_0x5aec7d,targetAgentName:_0x2b17f7,existingOutputDir:_0x10d464,source:_0x4299ef}=_0x5c15cf;if(_0x4299ef===_0x1e7b28(0x1f1))console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x1b8)](_0x1e7b28(0x210)+a4_0x188f49[_0x1e7b28(0x227)](_0x68cae1,_0x1e7b28(0x257))+':\x20'+_0x5aec7d));else{if(_0x4299ef===_0x1e7b28(0x208))console[_0x1e7b28(0x266)](a4_0x40b849['dim'](_0x1e7b28(0x23d)+_0x5aec7d));else _0x4299ef==='context'&&console['log'](a4_0x40b849[_0x1e7b28(0x1b8)](_0x1e7b28(0x201)+_0x5aec7d));}if(!_0x5aec7d)return _0x13e558?(console[_0x1e7b28(0x266)](a4_0x40b849['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1e7b28(0x266)](_0x1e7b28(0x20a)),console[_0x1e7b28(0x266)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x40b849[_0x1e7b28(0x1ca)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x1e7b28(0x21b)),console[_0x1e7b28(0x266)](_0x1e7b28(0x1ee)),console['log'](_0x1e7b28(0x26c)),console['log'](_0x1e7b28(0x23b)),console[_0x1e7b28(0x266)]('\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(_0x2b17f7){const {data:_0x3895e1}=await withSpinner(_0x1e7b28(0x1f4)+_0x2b17f7+_0x1e7b28(0x1ce)+_0x5aec7d+'\x22...',()=>_0x393b2a[_0x1e7b28(0x1da)][_0x1e7b28(0x25e)](_0x5aec7d,_0x2b17f7,_0x43129d,{'dryRun':_0x560dec,'force':_0x5d41c1}));if(_0x560dec)return console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x1ca)](_0x1e7b28(0x246))),console['log'](_0x1e7b28(0x1b7)+_0x3895e1[_0x1e7b28(0x264)]),console['log'](_0x1e7b28(0x206)+_0x3895e1[_0x1e7b28(0x220)]),_0x3895e1[_0x1e7b28(0x23f)]&&(console[_0x1e7b28(0x266)]('\x0aChanges:'),console[_0x1e7b28(0x266)]('─'[_0x1e7b28(0x1f8)](0x3c)),console[_0x1e7b28(0x266)](_0x3895e1[_0x1e7b28(0x23f)]),console[_0x1e7b28(0x266)]('─'[_0x1e7b28(0x1f8)](0x3c))),0x0;return console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)]('Agent\x20pulled\x20successfully')),console[_0x1e7b28(0x266)](_0x1e7b28(0x234)+_0x3895e1['agentName']),console[_0x1e7b28(0x266)](_0x1e7b28(0x23c)+_0x3895e1[_0x1e7b28(0x220)]),console[_0x1e7b28(0x266)](_0x1e7b28(0x25a)+(_0x3895e1['isNew']?a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x1d3)):_0x3895e1['hasChanges']?a4_0x40b849[_0x1e7b28(0x1ca)](_0x1e7b28(0x241)):a4_0x40b849['gray'](_0x1e7b28(0x245)))),0x0;}const _0xba80bc=_0x10d464||_0x43129d,{data:_0x3fac2c}=await withSpinner(_0x1e7b28(0x1c1)+_0x5aec7d+_0x1e7b28(0x1f9),()=>_0x393b2a[_0x1e7b28(0x1da)][_0x1e7b28(0x1e8)](_0x5aec7d,_0xba80bc,{'dryRun':!![]})),_0x475740=_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1f6)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1ff)][_0x1e7b28(0x1d3)]+_0x3fac2c['counts'][_0x1e7b28(0x271)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x200)]['new']+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x222)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x251)][_0x1e7b28(0x1d3)]+_0x3fac2c['counts'][_0x1e7b28(0x233)]['new']+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x252)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)]['chatInterfaces'][_0x1e7b28(0x1d3)],_0x5c59c7=_0x3fac2c[_0x1e7b28(0x1fb)]['agents'][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x1ff)][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x271)][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x200)][_0x1e7b28(0x241)]+_0x3fac2c['counts']['integrations'][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x251)]['updated']+_0x3fac2c['counts']['experimentalArtifacts']['updated']+_0x3fac2c[_0x1e7b28(0x1fb)]['formInterfaces'][_0x1e7b28(0x241)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x272)]['updated'],_0xd894dc=_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1f6)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1ff)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x271)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x200)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x222)]['unchanged']+_0x3fac2c[_0x1e7b28(0x1fb)]['experimentalKnowledgeBases']['unchanged']+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x233)][_0x1e7b28(0x245)]+_0x3fac2c['counts']['formInterfaces'][_0x1e7b28(0x245)]+_0x3fac2c['counts'][_0x1e7b28(0x272)][_0x1e7b28(0x245)];console[_0x1e7b28(0x266)](_0x1e7b28(0x1fa)+_0x3fac2c['projectName']+'\x27:'),console[_0x1e7b28(0x266)]('\x20\x20'+a4_0x40b849[_0x1e7b28(0x203)]('+\x20'+_0x475740+_0x1e7b28(0x1e4))+_0x1e7b28(0x1c2)+a4_0x40b849[_0x1e7b28(0x1ca)]('~\x20'+_0x5c59c7+_0x1e7b28(0x258))+_0x1e7b28(0x1c2)+a4_0x40b849['dim']('=\x20'+_0xd894dc+_0x1e7b28(0x1b9))),console[_0x1e7b28(0x266)](_0x1e7b28(0x25d)+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1f6)])),console[_0x1e7b28(0x266)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1ff)])),console[_0x1e7b28(0x266)](_0x1e7b28(0x1e6)+formatCountSummary(_0x3fac2c['counts'][_0x1e7b28(0x271)])),console['log'](_0x1e7b28(0x1ba)+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x200)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x222)])),console[_0x1e7b28(0x266)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3fac2c['counts'][_0x1e7b28(0x252)])),console[_0x1e7b28(0x266)](_0x1e7b28(0x230)+formatCountSummary(_0x3fac2c['counts']['chatInterfaces']));const _0x2de8a7=_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x251)][_0x1e7b28(0x24d)]>0x0||_0x3fac2c['counts']['experimentalArtifacts']['total']>0x0;_0x2de8a7&&(console['log'](_0x1e7b28(0x226)+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x251)])),console[_0x1e7b28(0x266)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x233)])));console[_0x1e7b28(0x266)](_0x1e7b28(0x22f)+a4_0x40b849[_0x1e7b28(0x260)](_0x3fac2c['outputDir'])),displayDiffs(_0x3fac2c[_0x1e7b28(0x1f6)],_0x3fac2c['knowledgeBases'],_0x3fac2c[_0x1e7b28(0x271)],_0x3fac2c[_0x1e7b28(0x200)],_0x3fac2c['integrations'],_0x3fac2c[_0x1e7b28(0x251)],_0x3fac2c[_0x1e7b28(0x233)],_0x3fac2c['formInterfaces'],_0x3fac2c['chatInterfaces']);if(_0x560dec)return console['log'](a4_0x40b849[_0x1e7b28(0x1ca)](_0x1e7b28(0x1ed))),0x0;if(_0x475740===0x0&&_0x5c59c7===0x0)return console['log'](a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x236))),saveSessionContext({'llm_project':_0x3fac2c['projectName']},_0x33d688['session']),console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x268)+a4_0x40b849[_0x1e7b28(0x1b8)]('llm_project')+'\x20=\x20'+a4_0x40b849[_0x1e7b28(0x260)](_0x3fac2c[_0x1e7b28(0x202)]))),0x0;if(!_0x1572b5&&!_0x5d41c1){if(!isInteractive())return console[_0x1e7b28(0x21f)](a4_0x40b849[_0x1e7b28(0x265)](_0x1e7b28(0x1c0)),_0x1e7b28(0x24c)),console[_0x1e7b28(0x21f)](a4_0x40b849['dim'](_0x1e7b28(0x25b))),0x1;const _0x1f173d=await confirmKey(_0x1e7b28(0x22e)+(_0x475740+_0x5c59c7)+_0x1e7b28(0x26b));if(!_0x1f173d)return console[_0x1e7b28(0x266)](a4_0x40b849['yellow'](_0x1e7b28(0x22c)),_0x1e7b28(0x26e)),0x1;}const {data:_0x3a162e}=await withSpinner(_0x1e7b28(0x1c5),()=>_0x393b2a[_0x1e7b28(0x1da)]['pullProject'](_0x5aec7d,_0xba80bc,{'force':_0x5d41c1}));return console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)]('\x0a✔\x20Pulled\x20'+(_0x475740+_0x5c59c7)+'\x20files\x20to\x20'+_0x3a162e[_0x1e7b28(0x212)])),saveSessionContext({'llm_project':_0x3a162e[_0x1e7b28(0x202)]},_0x33d688[_0x1e7b28(0x228)]),console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x268)+a4_0x40b849[_0x1e7b28(0x1b8)](_0x1e7b28(0x22b))+_0x1e7b28(0x255)+a4_0x40b849['cyan'](_0x3a162e['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x9ae543(0x259);[a4_0x9ae543(0x1d9)]=a4_0x9ae543(0x20f);async[a4_0x9ae543(0x1d0)](_0x1b9d7a){const _0x33e48c=a4_0x9ae543,{options:_0x59f03f,args:_0x23d0da,tdx:_0x5f0afa}=_0x1b9d7a,_0x408250=_0x23d0da[0x0],_0x5482ea=_0x59f03f[_0x33e48c(0x25f)],_0xfb86af=_0x59f03f[_0x33e48c(0x26f)],_0x55b003=_0x59f03f['yes'],_0xa6cd01=_0x59f03f[_0x33e48c(0x262)],_0x1cb7d1=_0x59f03f[_0x33e48c(0x21a)];let _0x2d533f;const _0x48236d=findAgentConfigPath(process[_0x33e48c(0x243)]());if(_0x408250){const _0x332ca8=a4_0x188f49[_0x33e48c(0x227)](_0x408250,_0x33e48c(0x257));existsSync(_0x332ca8)?(_0x2d533f=_0x408250,console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1b8)](_0x33e48c(0x240)+_0x408250))):_0x2d533f=_0x408250;}else{if(_0x48236d)_0x2d533f=a4_0x188f49[_0x33e48c(0x231)](_0x48236d),console[_0x33e48c(0x266)](a4_0x40b849['dim'](_0x33e48c(0x270)+_0x2d533f));else{if(_0x1cb7d1){const _0x154644=sanitizeForFilesystem(_0x1cb7d1);let _0x5180fc=_0x154644,_0x239f1f=a4_0x188f49['join'](process[_0x33e48c(0x243)](),_0x33e48c(0x1f6),_0x154644,_0x33e48c(0x257));if(!existsSync(_0x239f1f)){const _0x2f5850=normalizeName(_0x1cb7d1),_0x2cb774=a4_0x188f49[_0x33e48c(0x227)](process[_0x33e48c(0x243)](),_0x33e48c(0x1f6),_0x2f5850,'tdx.json');existsSync(_0x2cb774)&&(_0x5180fc=_0x2f5850,_0x239f1f=_0x2cb774);}if(existsSync(_0x239f1f))_0x2d533f=a4_0x188f49[_0x33e48c(0x231)](_0x239f1f),console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1b8)](_0x33e48c(0x240)+_0x2d533f));else{const _0x166cad=_0x59f03f[_0x33e48c(0x21c)];if(_0x166cad)throw new SDKError(ErrorCode[_0x33e48c(0x250)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x1cb7d1+_0x33e48c(0x273),undefined,{'helpText':_0x33e48c(0x1e5)+_0x33e48c(0x267)+(_0x33e48c(0x1d8)+_0x1cb7d1+'\x0a')+(_0x33e48c(0x1c6)+_0x5180fc+'\x20--name\x20'+(_0x5482ea||_0x33e48c(0x213))+_0x33e48c(0x1b5)+_0x166cad)});_0x2d533f=_0x1cb7d1,console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1b8)]('Using\x20context\x20project:\x20'+_0x1cb7d1));}}}}if(!_0x2d533f)return console['log'](a4_0x40b849['yellow'](_0x33e48c(0x23a))),console[_0x33e48c(0x266)](_0x33e48c(0x1fd)),console[_0x33e48c(0x266)](_0x33e48c(0x26d)),console['log'](_0x33e48c(0x1cd)),console['log'](_0x33e48c(0x1ef)),0x1;if(!_0x5482ea)throw new SDKError(ErrorCode[_0x33e48c(0x1db)],_0x33e48c(0x1eb),undefined,{'helpText':_0x33e48c(0x1b4)});if(!_0x55b003&&!_0xfb86af){if(!isInteractive())return console['error'](a4_0x40b849[_0x33e48c(0x265)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x40b849[_0x33e48c(0x1b8)](_0x33e48c(0x25b))),0x1;const _0x14be33=await confirmKey(_0x33e48c(0x1e0)+_0x2d533f+'\x22\x20to\x20new\x20project\x20\x22'+_0x5482ea+'\x22?');if(!_0x14be33)return console['log'](a4_0x40b849[_0x33e48c(0x1ca)](_0x33e48c(0x22c))),0x1;}const {data:_0x58d5a8}=await withSpinner(_0x33e48c(0x1c8)+_0x2d533f+'\x22\x20to\x20\x22'+_0x5482ea+_0x33e48c(0x1f9),()=>_0x5f0afa['llm'][_0x33e48c(0x1b2)](_0x2d533f,_0x5482ea,{'dryRun':_0xfb86af}));if(_0xfb86af){console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1ca)](_0x33e48c(0x244))),console['log'](_0x33e48c(0x1e3)+_0x58d5a8['sourceProjectName']),console[_0x33e48c(0x266)](_0x33e48c(0x24b)+_0x5482ea),console[_0x33e48c(0x266)](_0x33e48c(0x254)),console[_0x33e48c(0x266)](_0x33e48c(0x25d)+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1f6)][_0x33e48c(0x253)]),console[_0x33e48c(0x266)](_0x33e48c(0x216)+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1ff)][_0x33e48c(0x253)]),console[_0x33e48c(0x266)]('\x20\x20Prompts:\x20'+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x200)]['created']),console[_0x33e48c(0x266)]('\x20\x20Form\x20Interfaces:\x20'+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x252)][_0x33e48c(0x253)]),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x58d5a8['counts'][_0x33e48c(0x272)][_0x33e48c(0x253)]);const _0x52bcc7=_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x251)][_0x33e48c(0x253)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)]['experimentalArtifacts'][_0x33e48c(0x253)]>0x0;return _0x52bcc7&&(console['log'](_0x33e48c(0x226)+_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases']['created']),console['log'](_0x33e48c(0x1fe)+_0x58d5a8['counts'][_0x33e48c(0x233)][_0x33e48c(0x253)])),0x0;}const _0x39e35b=_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1f6)][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1ff)]['errors']>0x0||_0x58d5a8['counts']['prompts'][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x252)][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x272)][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x251)][_0x33e48c(0x25c)]>0x0||_0x58d5a8['counts']['experimentalArtifacts'][_0x33e48c(0x25c)]>0x0;_0x39e35b?console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1ca)]('Project\x20cloned\x20with\x20errors')):console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x203)](_0x33e48c(0x223)));console['log'](_0x33e48c(0x1e3)+_0x58d5a8[_0x33e48c(0x247)]),console[_0x33e48c(0x266)](_0x33e48c(0x24b)+_0x58d5a8['newProjectName']),console['log'](_0x33e48c(0x26a)+_0x58d5a8[_0x33e48c(0x1f0)]),console[_0x33e48c(0x266)](),console[_0x33e48c(0x266)](_0x33e48c(0x1e2)),console['log'](_0x33e48c(0x25d)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)]['agents'])),console[_0x33e48c(0x266)](_0x33e48c(0x216)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1ff)])),console[_0x33e48c(0x266)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x200)])),console[_0x33e48c(0x266)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x58d5a8['counts']['integrations'])),console[_0x33e48c(0x266)](_0x33e48c(0x20d)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)]['formInterfaces'])),console[_0x33e48c(0x266)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x58d5a8['counts'][_0x33e48c(0x272)]));const _0x412c85=_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases'][_0x33e48c(0x253)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases']['updated']>0x0||_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases'][_0x33e48c(0x245)]>0x0||_0x58d5a8['counts'][_0x33e48c(0x233)]['created']>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x233)][_0x33e48c(0x241)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x233)][_0x33e48c(0x245)]>0x0;_0x412c85&&(console['log'](_0x33e48c(0x226)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases'])),console[_0x33e48c(0x266)](_0x33e48c(0x1fe)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x233)])));if(_0x39e35b){console[_0x33e48c(0x266)](),console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)](_0x33e48c(0x219)));for(const _0x30a399 of _0x58d5a8[_0x33e48c(0x1f6)]){_0x30a399[_0x33e48c(0x1e7)]==='error'&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)](_0x33e48c(0x1b6)+_0x30a399[_0x33e48c(0x264)]+'\x22:\x20'+_0x30a399[_0x33e48c(0x21f)]));}for(const _0x264b96 of _0x58d5a8[_0x33e48c(0x1ff)]){_0x264b96[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console['log'](a4_0x40b849['red'](_0x33e48c(0x217)+_0x264b96[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x264b96[_0x33e48c(0x21f)]));}for(const _0x2aaf78 of _0x58d5a8['prompts']){_0x2aaf78[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Prompt\x20\x22'+_0x2aaf78['name']+_0x33e48c(0x218)+_0x2aaf78['error']));}for(const _0x3b140f of _0x58d5a8[_0x33e48c(0x222)]){_0x3b140f[_0x33e48c(0x1e7)]==='error'&&console['log'](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Integration\x20\x22'+_0x3b140f[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x3b140f[_0x33e48c(0x21f)]));}for(const _0x481181 of _0x58d5a8[_0x33e48c(0x252)]){_0x481181[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)](_0x33e48c(0x1e9)+_0x481181['name']+_0x33e48c(0x218)+_0x481181[_0x33e48c(0x21f)]));}for(const _0x4cf9f1 of _0x58d5a8[_0x33e48c(0x272)]){_0x4cf9f1[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console['log'](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Chat\x20Interface\x20\x22'+_0x4cf9f1[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x4cf9f1[_0x33e48c(0x21f)]));}for(const _0x4f2993 of _0x58d5a8[_0x33e48c(0x251)]){_0x4f2993[_0x33e48c(0x1e7)]==='error'&&console[_0x33e48c(0x266)](a4_0x40b849['red'](_0x33e48c(0x1c3)+_0x4f2993['name']+_0x33e48c(0x218)+_0x4f2993[_0x33e48c(0x21f)]));}for(const _0x1b9b83 of _0x58d5a8['experimentalArtifacts']){_0x1b9b83['action']===_0x33e48c(0x21f)&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x1b9b83[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x1b9b83['error']));}return 0x1;}console[_0x33e48c(0x266)]();const _0x1033ce=getLLMProjectUrl(_0xa6cd01,_0x58d5a8[_0x33e48c(0x1f0)]);return console[_0x33e48c(0x266)](_0x33e48c(0x1d1)+a4_0x40b849[_0x33e48c(0x260)](_0x1033ce)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x9ae543(0x25f)]=a4_0x9ae543(0x235);[a4_0x9ae543(0x1d9)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x9ae543(0x1d0)](_0x8b25f0){const _0x3238ca=a4_0x9ae543,{options:_0x5830e3,args:_0xb2f866,tdx:_0x5a99ff}=_0x8b25f0;let _0x168d67=_0xb2f866[0x0]||process['cwd']();const _0x4332a3=_0x5830e3[_0x3238ca(0x26f)],_0x36bbdb=_0x5830e3['force'],_0x597f22=_0x5830e3['yes'],_0x22b127=_0x5830e3[_0x3238ca(0x262)],_0x47d0f7=a4_0x188f49[_0x3238ca(0x227)](_0x168d67,_0x3238ca(0x261)),_0x166710=existsSync(_0x47d0f7);if(_0x166710){const {data:_0x1002d5}=await withSpinner(_0x3238ca(0x24a)+_0x168d67+_0x3238ca(0x1f9),()=>_0x5a99ff[_0x3238ca(0x1da)][_0x3238ca(0x1e1)](_0x168d67,{'dryRun':_0x4332a3,'force':_0x36bbdb}));if(_0x4332a3)return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x244))),console['log'](_0x3238ca(0x1dc)+_0x1002d5[_0x3238ca(0x264)]),0x0;if(_0x1002d5[_0x3238ca(0x1e7)]==='error')return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1fc)+_0x1002d5[_0x3238ca(0x21f)])),0x1;console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x203)]('Agent\x20'+_0x1002d5[_0x3238ca(0x1e7)]+_0x3238ca(0x1bc))),console[_0x3238ca(0x266)](_0x3238ca(0x234)+_0x1002d5[_0x3238ca(0x264)]);if(_0x1002d5[_0x3238ca(0x256)]&&_0x1002d5[_0x3238ca(0x1d5)]){const _0x316089=getLLMAgentChatUrl(_0x22b127,_0x1002d5['projectId'],_0x1002d5[_0x3238ca(0x256)]);console[_0x3238ca(0x266)](_0x3238ca(0x1cf)+a4_0x40b849[_0x3238ca(0x260)](_0x316089));}return 0x0;}const _0x2b9452=_0x5830e3[_0x3238ca(0x21a)],_0x41dd96=resolveProjectFromContext(_0x168d67,_0x2b9452);if(_0x41dd96[_0x3238ca(0x214)])_0x168d67=_0x41dd96['projectDir'],_0x41dd96[_0x3238ca(0x1b1)]===_0x3238ca(0x242)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1b8)](_0x3238ca(0x23d)+_0x168d67));else{let _0x3ede46=_0x3238ca(0x248);_0x41dd96[_0x3238ca(0x1c7)]===_0x3238ca(0x225)&&(_0x3ede46=_0x41dd96[_0x3238ca(0x221)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x41dd96['llmProject']+_0x3238ca(0x1dd));throw new SDKError(ErrorCode[_0x3238ca(0x250)],_0x41dd96[_0x3238ca(0x1c7)]===_0x3238ca(0x1d4)?_0x41dd96[_0x3238ca(0x221)]:_0x3238ca(0x237)+_0x168d67,undefined,{'helpText':_0x3ede46});}const {data:_0x3432e9}=await withSpinner(_0x3238ca(0x1b3),()=>_0x5a99ff['llm'][_0x3238ca(0x238)](_0x168d67,{'dryRun':!![]})),_0x307381=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)][_0x3238ca(0x25c)]>0x0;if(_0x307381){console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x229)));for(const _0x349cfc of _0x3432e9[_0x3238ca(0x1f6)]){_0x349cfc[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1b6)+_0x349cfc[_0x3238ca(0x264)]+'\x22:\x20'+_0x349cfc[_0x3238ca(0x21f)]));}return 0x1;}const _0x2595ea=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1ff)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x271)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)]['created']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x222)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)][_0x3238ca(0x253)]+_0x3432e9['counts']['experimentalArtifacts'][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)]['formInterfaces']['created']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)]['created'],_0x18c141=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1ff)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x271)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)]['integrations'][_0x3238ca(0x241)]+_0x3432e9['counts'][_0x3238ca(0x251)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)]['experimentalArtifacts'][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x252)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)][_0x3238ca(0x241)],_0x24fc57=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)]['unchanged']+_0x3432e9[_0x3238ca(0x1fb)]['knowledgeBases']['unchanged']+_0x3432e9['counts'][_0x3238ca(0x271)][_0x3238ca(0x245)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)]['unchanged']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x222)]['unchanged']+_0x3432e9['counts']['experimentalKnowledgeBases']['unchanged']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)][_0x3238ca(0x245)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x252)][_0x3238ca(0x245)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)]['unchanged'];console[_0x3238ca(0x266)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3432e9['projectName']+'\x27:'),console[_0x3238ca(0x266)]('\x20\x20'+a4_0x40b849['green']('+\x20'+_0x2595ea+'\x20new')+'\x20|\x20'+a4_0x40b849['yellow']('~\x20'+_0x18c141+_0x3238ca(0x258))+_0x3238ca(0x1c2)+a4_0x40b849[_0x3238ca(0x1b8)]('=\x20'+_0x24fc57+_0x3238ca(0x1b9))),console[_0x3238ca(0x266)](_0x3238ca(0x25d)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)])),console['log'](_0x3238ca(0x216)+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x1ff)])),console[_0x3238ca(0x266)](_0x3238ca(0x1e6)+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x271)])),console[_0x3238ca(0x266)](_0x3238ca(0x1ba)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)])),console[_0x3238ca(0x266)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x222)])),console[_0x3238ca(0x266)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x252)])),console[_0x3238ca(0x266)](_0x3238ca(0x230)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)]));const _0x384423=_0x3432e9[_0x3238ca(0x1fb)]['experimentalKnowledgeBases'][_0x3238ca(0x253)]>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)][_0x3238ca(0x241)]>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)]['unchanged']>0x0||_0x3432e9[_0x3238ca(0x1fb)]['experimentalArtifacts'][_0x3238ca(0x253)]>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)]['updated']>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)][_0x3238ca(0x245)]>0x0;_0x384423&&(console[_0x3238ca(0x266)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)])),console[_0x3238ca(0x266)](_0x3238ca(0x1fe)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)])));console[_0x3238ca(0x266)](_0x3238ca(0x24f)+a4_0x40b849[_0x3238ca(0x260)](_0x168d67)),displayDiffs(_0x3432e9['agents'],_0x3432e9[_0x3238ca(0x1ff)],_0x3432e9['textKnowledgeBases'],_0x3432e9[_0x3238ca(0x200)],_0x3432e9[_0x3238ca(0x222)],_0x3432e9[_0x3238ca(0x251)],_0x3432e9[_0x3238ca(0x233)],_0x3432e9[_0x3238ca(0x252)],_0x3432e9['chatInterfaces']);if(_0x4332a3)return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x1d7))),0x0;if(_0x2595ea===0x0&&_0x18c141===0x0){console[_0x3238ca(0x266)](a4_0x40b849['green'](_0x3238ca(0x1cb)));const _0x80b3aa=getLLMProjectUrl(_0x22b127,_0x3432e9[_0x3238ca(0x1d5)]);return console[_0x3238ca(0x266)](_0x3238ca(0x1d1)+a4_0x40b849[_0x3238ca(0x260)](_0x80b3aa)),0x0;}if(!_0x597f22&&!_0x36bbdb){if(!isInteractive())return console[_0x3238ca(0x21f)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1c0)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3238ca(0x21f)](a4_0x40b849['dim'](_0x3238ca(0x25b))),0x1;const _0x378112=await confirmKey(_0x3238ca(0x1d2)+(_0x2595ea+_0x18c141)+_0x3238ca(0x1ea));if(!_0x378112)return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x22c)),_0x3238ca(0x205)),0x1;}const {data:_0x5030a8}=await withSpinner('Pushing\x20to\x20project...',()=>_0x5a99ff['llm'][_0x3238ca(0x238)](_0x168d67,{'force':_0x36bbdb})),_0x250b1f=_0x5030a8['counts'][_0x3238ca(0x1f6)][_0x3238ca(0x25c)]>0x0||_0x5030a8['counts'][_0x3238ca(0x1ff)][_0x3238ca(0x25c)]>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x271)][_0x3238ca(0x25c)]>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x200)][_0x3238ca(0x25c)]>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x252)]['errors']>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x272)][_0x3238ca(0x25c)]>0x0;if(_0x250b1f){console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x20e))),console[_0x3238ca(0x266)](),console[_0x3238ca(0x266)](a4_0x40b849['red']('Errors:'));for(const _0x14961e of _0x5030a8['agents']){_0x14961e[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1b6)+_0x14961e[_0x3238ca(0x264)]+_0x3238ca(0x218)+_0x14961e[_0x3238ca(0x21f)]));}for(const _0x345729 of _0x5030a8[_0x3238ca(0x1ff)]){_0x345729[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x345729[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x345729[_0x3238ca(0x21f)]));}for(const _0x4f9513 of _0x5030a8[_0x3238ca(0x271)]){_0x4f9513[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x4f9513[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x4f9513[_0x3238ca(0x21f)]));}for(const _0x269a11 of _0x5030a8['prompts']){_0x269a11[_0x3238ca(0x1e7)]==='error'&&console['log'](a4_0x40b849['red'](_0x3238ca(0x1f2)+_0x269a11[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x269a11[_0x3238ca(0x21f)]));}for(const _0x423a24 of _0x5030a8[_0x3238ca(0x222)]){_0x423a24[_0x3238ca(0x1e7)]==='error'&&console[_0x3238ca(0x266)](a4_0x40b849['red'](_0x3238ca(0x204)+_0x423a24[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x423a24['error']));}for(const _0x5b5cd6 of _0x5030a8['formInterfaces']){_0x5b5cd6[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console['log'](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1e9)+_0x5b5cd6[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x5b5cd6[_0x3238ca(0x21f)]));}for(const _0x392c35 of _0x5030a8[_0x3238ca(0x272)]){_0x392c35[_0x3238ca(0x1e7)]==='error'&&console['log'](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x207)+_0x392c35['name']+_0x3238ca(0x218)+_0x392c35['error']));}return 0x1;}console[_0x3238ca(0x266)](a4_0x40b849['green'](_0x3238ca(0x22d)+(_0x2595ea+_0x18c141)+_0x3238ca(0x24e)+_0x5030a8[_0x3238ca(0x202)]+'\x27'));const _0x4f155c=getLLMProjectUrl(_0x22b127,_0x5030a8[_0x3238ca(0x1d5)]);return console[_0x3238ca(0x266)](_0x3238ca(0x1d1)+a4_0x40b849['cyan'](_0x4f155c)),0x0;}}
|
|
1
|
+
const a4_0x140733=a4_0x4ced;(function(_0x3b3181,_0x2d5747){const _0x5e7a9a=a4_0x4ced,_0x38ab6c=_0x3b3181();while(!![]){try{const _0x10d83a=parseInt(_0x5e7a9a(0x1f6))/0x1+parseInt(_0x5e7a9a(0x23d))/0x2*(-parseInt(_0x5e7a9a(0x1ff))/0x3)+parseInt(_0x5e7a9a(0x1db))/0x4+-parseInt(_0x5e7a9a(0x208))/0x5+parseInt(_0x5e7a9a(0x1d3))/0x6*(-parseInt(_0x5e7a9a(0x1e6))/0x7)+parseInt(_0x5e7a9a(0x216))/0x8+-parseInt(_0x5e7a9a(0x226))/0x9*(parseInt(_0x5e7a9a(0x1c1))/0xa);if(_0x10d83a===_0x2d5747)break;else _0x38ab6c['push'](_0x38ab6c['shift']());}catch(_0x700382){_0x38ab6c['push'](_0x38ab6c['shift']());}}}(a4_0xb21b,0x8b39a));import a4_0x178e25 from'chalk';import a4_0x4049c8 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_0x4ced(_0x27142a,_0x8ed37a){_0x27142a=_0x27142a-0x19c;const _0xb21baa=a4_0xb21b();let _0x4ced51=_0xb21baa[_0x27142a];return _0x4ced51;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0xb21b(){const _0x2e97c4=['MISSING_ARGUMENT','\x20\x20Prompt\x20\x22','\x0aError:','\x20\x20Text\x20Knowledge\x20Bases:\x20','Agent:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Would\x20push\x20agent:\x20','force','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','yes','34416DKnItC','error','log','Project\x20cloned\x20with\x20errors','unchanged','Using\x20current\x20project:\x20','new','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','knowledgeBases','New\x20project:\x20','dryRun','hasChanges','utf-8','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','Output:\x20','pullAgent','INVALID_ARGUMENT','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20agent\x20\x27','Cloning\x20\x22','integrations','\x20resources?','4qydWTK','outputDir','agentName','pushAgent','\x20errors','Dry\x20run\x20-\x20no\x20files\x20written','\x20=\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','formInterfaces','Errors:','pushProject','<new-name>','description','join','\x0aChanges\x20to\x20form\x20interface\x20\x27','experimentalKnowledgeBases','diff','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20\x22','profile','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','agent','cwd-config','yellow','\x22\x20to\x20new\x20project\x20\x22','sourceProjectName','\x20\x20Experimental\x20Artifact\x20\x22','Project\x20cloned\x20successfully','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','chatInterfaces','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','isNew','message','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Project:\x20','\x20|\x20','name','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','red','agent:push','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Agent\x20pulled\x20successfully','Using\x20project:\x20','Chat:\x20','\x20\x20Integration\x20\x22','Writing\x20files...','counts','textKnowledgeBases','prompts','\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','\x0aWrite\x20','Would\x20pull\x20agent:\x20','repeat','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20tdx.json\x20found\x20in\x20','Output\x20path:\x20','\x20created','New\x20project\x20ID:\x20','\x20changed','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','gray','\x20updated','\x0aErrors\x20found:','Using\x20project\x20from\x20context:\x20','\x0aChanges\x20to\x20integration\x20\x27','agents','Status:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aPull\x20summary\x20for\x20\x27','Analyzing\x20project\x20\x22','dim','\x22...','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20chat\x20interface\x20\x27','850XQeSRl','projectDir','experimentalArtifacts','\x20unchanged','llmProject','Analyzing\x20changes\x20to\x20push...','\x20new','\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)','\x0aPush\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20--name\x20','execute','\x22\x20to\x20\x22','✔\x20Context\x20set:\x20','outputPath','\x22:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','94020rcYzNT','Pulling\x20agent\x20\x22','cwd','context','\x20total','agent:pull','\x22\x20to\x20a\x20different\x20profile','Source:\x20','2359568maLvNB','cyan','agent:clone','projectName','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Pushing\x20to\x20project...','\x20\x20Form\x20Interfaces:\x20','\x20\x20Chat\x20Interface\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','newProjectId','projectId','301gYvfln','\x0aProject\x20pushed\x20with\x20errors','total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Prompts:\x20','Using\x20context\x20project:\x20','\x20\x20Agent\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Knowledge\x20Base\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','cloneProject','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\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','agent.yml','519671SObYJp','\x20\x20Chat\x20Interfaces:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','llm_project','push','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','updated','Using\x20local\x20project:\x20','297951gMvURu','action','pullProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','created','session','Failed\x20to\x20push\x20agent:\x20','Cancelled','llm','2393365oSpBGX','\x20\x20Target:\x20','dirname','\x20successfully','green','found','\x20\x20Integrations:\x20','Using\x20project\x20from\x20','\x20\x20Source:\x20','errors','site','\x20resources\x20to\x20\x27','tdx.json','parse','9094880qFKfpL','\x20\x20Form\x20Interface\x20\x22','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','New\x20project\x20name\x20is\x20required','agentId','no_context'];a4_0xb21b=function(){return _0x2e97c4;};return a4_0xb21b();}function formatCountSummary(_0x3cd49d){const _0x31a776=a4_0x4ced,_0x23f855=[];if(_0x3cd49d[_0x31a776(0x1e8)]!==undefined)_0x23f855[_0x31a776(0x1fa)](_0x3cd49d['total']+_0x31a776(0x1d7));if(_0x3cd49d[_0x31a776(0x22c)]!==undefined&&_0x3cd49d[_0x31a776(0x22c)]>0x0)_0x23f855[_0x31a776(0x1fa)](a4_0x178e25[_0x31a776(0x20c)](_0x3cd49d[_0x31a776(0x22c)]+_0x31a776(0x1c7)));if(_0x3cd49d['created']!==undefined&&_0x3cd49d['created']>0x0)_0x23f855['push'](a4_0x178e25['green'](_0x3cd49d[_0x31a776(0x203)]+_0x31a776(0x1af)));if(_0x3cd49d['updated']!==undefined&&_0x3cd49d['updated']>0x0)_0x23f855[_0x31a776(0x1fa)](a4_0x178e25[_0x31a776(0x254)](_0x3cd49d[_0x31a776(0x1fd)]+_0x31a776(0x1b4)));if(_0x3cd49d[_0x31a776(0x22a)]!==undefined&&_0x3cd49d[_0x31a776(0x22a)]>0x0)_0x23f855[_0x31a776(0x1fa)](a4_0x178e25[_0x31a776(0x1b3)](_0x3cd49d[_0x31a776(0x22a)]+_0x31a776(0x1c4)));if(_0x3cd49d[_0x31a776(0x211)]!==undefined&&_0x3cd49d['errors']>0x0)_0x23f855[_0x31a776(0x1fa)](a4_0x178e25[_0x31a776(0x19d)](_0x3cd49d[_0x31a776(0x211)]+_0x31a776(0x241)));return _0x23f855[_0x31a776(0x24a)](',\x20');}function displayDiffs(_0x1a88b7,_0xb291de,_0x5295d2,_0x39a2fd,_0x4fba55,_0x437e5d,_0xd52660,_0x2bbc4d,_0x196a10){const _0x151fc0=a4_0x4ced;for(const _0x5e0896 of _0x1a88b7){if(_0x5e0896['diff']){const _0x2c3c5a=_0x5e0896[_0x151fc0(0x23f)]||_0x5e0896[_0x151fc0(0x261)];console[_0x151fc0(0x228)](_0x151fc0(0x239)+_0x2c3c5a+'\x27:'),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)),console[_0x151fc0(0x228)](_0x5e0896[_0x151fc0(0x24d)]),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c));}}for(const _0x41d1fa of _0xb291de){_0x41d1fa[_0x151fc0(0x24d)]&&(console['log'](_0x151fc0(0x1b2)+_0x41d1fa[_0x151fc0(0x261)]+'\x27:'),console['log']('─'[_0x151fc0(0x1ab)](0x3c)),console[_0x151fc0(0x228)](_0x41d1fa[_0x151fc0(0x24d)]),console[_0x151fc0(0x228)]('─'['repeat'](0x3c)));}for(const _0x43d0b0 of _0x5295d2){_0x43d0b0[_0x151fc0(0x24d)]&&(console[_0x151fc0(0x228)](_0x151fc0(0x25e)+_0x43d0b0['name']+'\x27:'),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)),console[_0x151fc0(0x228)](_0x43d0b0['diff']),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)));}for(const _0x4d3156 of _0x39a2fd){_0x4d3156[_0x151fc0(0x24d)]&&(console[_0x151fc0(0x228)](_0x151fc0(0x24e)+_0x4d3156[_0x151fc0(0x261)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x151fc0(0x228)](_0x4d3156[_0x151fc0(0x24d)]),console['log']('─'[_0x151fc0(0x1ab)](0x3c)));}for(const _0x4845a6 of _0x4fba55){_0x4845a6['diff']&&(console[_0x151fc0(0x228)](_0x151fc0(0x1b7)+_0x4845a6['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x151fc0(0x228)](_0x4845a6[_0x151fc0(0x24d)]),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)));}for(const _0x33f71b of _0x437e5d){_0x33f71b[_0x151fc0(0x24d)]&&(console['log'](_0x151fc0(0x233)+_0x33f71b[_0x151fc0(0x261)]+'\x27:'),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)),console[_0x151fc0(0x228)](_0x33f71b[_0x151fc0(0x24d)]),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)));}for(const _0x3d4c2b of _0xd52660){_0x3d4c2b[_0x151fc0(0x24d)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x3d4c2b[_0x151fc0(0x261)]+'\x27:'),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)),console['log'](_0x3d4c2b['diff']),console['log']('─'[_0x151fc0(0x1ab)](0x3c)));}for(const _0x110ac5 of _0x2bbc4d){_0x110ac5[_0x151fc0(0x24d)]&&(console[_0x151fc0(0x228)](_0x151fc0(0x24b)+_0x110ac5[_0x151fc0(0x261)]+'\x27:'),console['log']('─'[_0x151fc0(0x1ab)](0x3c)),console[_0x151fc0(0x228)](_0x110ac5[_0x151fc0(0x24d)]),console[_0x151fc0(0x228)]('─'[_0x151fc0(0x1ab)](0x3c)));}for(const _0x5a1a04 of _0x196a10){_0x5a1a04[_0x151fc0(0x24d)]&&(console[_0x151fc0(0x228)](_0x151fc0(0x1c0)+_0x5a1a04[_0x151fc0(0x261)]+'\x27:'),console['log']('─'[_0x151fc0(0x1ab)](0x3c)),console[_0x151fc0(0x228)](_0x5a1a04[_0x151fc0(0x24d)]),console['log']('─'[_0x151fc0(0x1ab)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x140733(0x261)]=a4_0x140733(0x1d8);['description']=a4_0x140733(0x202);async['execute'](_0x5ba4ca){const _0x2571cd=a4_0x140733,{options:_0x47e28b,args:_0x1939af,tdx:_0x9d90e}=_0x5ba4ca,_0xb73132=_0x1939af[0x0],_0x98d4c5=_0x1939af[0x1],_0x4c983a=_0x47e28b['output'],_0x5073ae=_0x47e28b[_0x2571cd(0x230)],_0x2ed5a6=_0x47e28b[_0x2571cd(0x223)],_0x38840b=_0x47e28b[_0x2571cd(0x225)],_0x39e589=_0x47e28b[_0x2571cd(0x1c5)],_0x10c966=_0x47e28b[_0x2571cd(0x252)];let _0x5c1666;if(_0xb73132){const _0xab656c=a4_0x4049c8['join'](_0xb73132,_0x2571cd(0x214));if(existsSync(_0xab656c))try{const _0x355a80=JSON[_0x2571cd(0x215)](readFileSync(_0xab656c,_0x2571cd(0x232)));_0x355a80[_0x2571cd(0x1f9)]&&(_0x5c1666={'llm_project':_0x355a80[_0x2571cd(0x1f9)]});}catch{}}const _0xfbe96c=findAgentConfigPath(process[_0x2571cd(0x1d5)]());let _0x5a3ba;if(_0xfbe96c)try{const _0x581d76=JSON[_0x2571cd(0x215)](readFileSync(_0xfbe96c,_0x2571cd(0x232)));_0x581d76[_0x2571cd(0x1f9)]&&(_0x5a3ba={'llm_project':_0x581d76[_0x2571cd(0x1f9)]});}catch{}const _0x334dc6=resolveAgentPullArgs({'arg':_0xb73132,'agentNameArg':_0x98d4c5,'agentFlag':_0x10c966,'contextProject':_0x39e589,'argDirConfig':_0x5c1666,'cwdConfigPath':_0xfbe96c||undefined,'cwdConfig':_0x5a3ba}),{projectNameOrId:_0x37864d,targetAgentName:_0x9b16d9,existingOutputDir:_0x56d8e3,source:_0x4f1606}=_0x334dc6;if(_0x4f1606==='arg-dir')console['log'](a4_0x178e25[_0x2571cd(0x1bd)](_0x2571cd(0x20f)+a4_0x4049c8[_0x2571cd(0x24a)](_0xb73132,_0x2571cd(0x214))+':\x20'+_0x37864d));else{if(_0x4f1606===_0x2571cd(0x253))console['log'](a4_0x178e25[_0x2571cd(0x1bd)](_0x2571cd(0x1a1)+_0x37864d));else _0x4f1606===_0x2571cd(0x1d6)&&console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x1bd)](_0x2571cd(0x1b6)+_0x37864d));}if(!_0x37864d)return _0x10c966?(console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x254)](_0x2571cd(0x1cb))),console[_0x2571cd(0x228)](_0x2571cd(0x259)),console[_0x2571cd(0x228)](_0x2571cd(0x1ca))):(console['log'](a4_0x178e25[_0x2571cd(0x254)](_0x2571cd(0x1df))),console[_0x2571cd(0x228)]('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['log'](_0x2571cd(0x221)),console[_0x2571cd(0x228)](_0x2571cd(0x1f4)),console[_0x2571cd(0x228)]('\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'](_0x2571cd(0x1a8))),0x1;if(_0x9b16d9){const {data:_0xd2d8d0}=await withSpinner(_0x2571cd(0x1d4)+_0x9b16d9+'\x22\x20from\x20project\x20\x22'+_0x37864d+'\x22...',()=>_0x9d90e[_0x2571cd(0x207)][_0x2571cd(0x236)](_0x37864d,_0x9b16d9,_0x4c983a,{'dryRun':_0x5073ae,'force':_0x2ed5a6}));if(_0x5073ae)return console[_0x2571cd(0x228)](a4_0x178e25['yellow'](_0x2571cd(0x242))),console[_0x2571cd(0x228)](_0x2571cd(0x1aa)+_0xd2d8d0[_0x2571cd(0x23f)]),console['log'](_0x2571cd(0x1ae)+_0xd2d8d0[_0x2571cd(0x1d0)]),_0xd2d8d0['diff']&&(console[_0x2571cd(0x228)]('\x0aChanges:'),console[_0x2571cd(0x228)]('─'['repeat'](0x3c)),console[_0x2571cd(0x228)](_0xd2d8d0[_0x2571cd(0x24d)]),console['log']('─'[_0x2571cd(0x1ab)](0x3c))),0x0;return console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x20c)](_0x2571cd(0x1a0))),console[_0x2571cd(0x228)](_0x2571cd(0x220)+_0xd2d8d0['agentName']),console[_0x2571cd(0x228)](_0x2571cd(0x235)+_0xd2d8d0['outputPath']),console[_0x2571cd(0x228)](_0x2571cd(0x1b9)+(_0xd2d8d0[_0x2571cd(0x25c)]?a4_0x178e25[_0x2571cd(0x20c)]('new'):_0xd2d8d0[_0x2571cd(0x231)]?a4_0x178e25[_0x2571cd(0x254)](_0x2571cd(0x1fd)):a4_0x178e25[_0x2571cd(0x1b3)](_0x2571cd(0x22a)))),0x0;}const _0x3b4a86=_0x56d8e3||_0x4c983a,{data:_0x306bf8}=await withSpinner(_0x2571cd(0x1bc)+_0x37864d+_0x2571cd(0x1be),()=>_0x9d90e[_0x2571cd(0x207)][_0x2571cd(0x201)](_0x37864d,_0x3b4a86,{'dryRun':!![]})),_0x5632b1=_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x1b8)][_0x2571cd(0x22c)]+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x22e)][_0x2571cd(0x22c)]+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x1a6)][_0x2571cd(0x22c)]+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x1a7)]['new']+_0x306bf8['counts'][_0x2571cd(0x23b)][_0x2571cd(0x22c)]+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x24c)]['new']+_0x306bf8['counts'][_0x2571cd(0x1c3)][_0x2571cd(0x22c)]+_0x306bf8['counts'][_0x2571cd(0x245)][_0x2571cd(0x22c)]+_0x306bf8['counts'][_0x2571cd(0x25a)][_0x2571cd(0x22c)],_0x4e5de3=_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x1b8)]['updated']+_0x306bf8[_0x2571cd(0x1a5)]['knowledgeBases'][_0x2571cd(0x1fd)]+_0x306bf8['counts'][_0x2571cd(0x1a6)][_0x2571cd(0x1fd)]+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x1a7)][_0x2571cd(0x1fd)]+_0x306bf8['counts'][_0x2571cd(0x23b)][_0x2571cd(0x1fd)]+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x24c)][_0x2571cd(0x1fd)]+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x1c3)][_0x2571cd(0x1fd)]+_0x306bf8['counts'][_0x2571cd(0x245)][_0x2571cd(0x1fd)]+_0x306bf8['counts'][_0x2571cd(0x25a)]['updated'],_0x8e7fac=_0x306bf8['counts']['agents'][_0x2571cd(0x22a)]+_0x306bf8['counts'][_0x2571cd(0x22e)][_0x2571cd(0x22a)]+_0x306bf8[_0x2571cd(0x1a5)]['textKnowledgeBases'][_0x2571cd(0x22a)]+_0x306bf8[_0x2571cd(0x1a5)]['prompts']['unchanged']+_0x306bf8[_0x2571cd(0x1a5)]['integrations']['unchanged']+_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x24c)][_0x2571cd(0x22a)]+_0x306bf8[_0x2571cd(0x1a5)]['experimentalArtifacts'][_0x2571cd(0x22a)]+_0x306bf8['counts'][_0x2571cd(0x245)][_0x2571cd(0x22a)]+_0x306bf8['counts'][_0x2571cd(0x25a)][_0x2571cd(0x22a)];console[_0x2571cd(0x228)](_0x2571cd(0x1bb)+_0x306bf8[_0x2571cd(0x1de)]+'\x27:'),console[_0x2571cd(0x228)]('\x20\x20'+a4_0x178e25[_0x2571cd(0x20c)]('+\x20'+_0x5632b1+_0x2571cd(0x1c7))+_0x2571cd(0x260)+a4_0x178e25['yellow']('~\x20'+_0x4e5de3+_0x2571cd(0x1b1))+_0x2571cd(0x260)+a4_0x178e25['dim']('=\x20'+_0x8e7fac+_0x2571cd(0x1c4))),console['log'](_0x2571cd(0x1fb)+formatCountSummary(_0x306bf8[_0x2571cd(0x1a5)]['agents'])),console['log'](_0x2571cd(0x238)+formatCountSummary(_0x306bf8[_0x2571cd(0x1a5)]['knowledgeBases'])),console[_0x2571cd(0x228)](_0x2571cd(0x21f)+formatCountSummary(_0x306bf8['counts'][_0x2571cd(0x1a6)])),console[_0x2571cd(0x228)](_0x2571cd(0x1ea)+formatCountSummary(_0x306bf8['counts'][_0x2571cd(0x1a7)])),console[_0x2571cd(0x228)](_0x2571cd(0x20e)+formatCountSummary(_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x23b)])),console[_0x2571cd(0x228)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x245)])),console[_0x2571cd(0x228)](_0x2571cd(0x1f7)+formatCountSummary(_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x25a)]));const _0x173eb2=_0x306bf8[_0x2571cd(0x1a5)]['experimentalKnowledgeBases']['total']>0x0||_0x306bf8[_0x2571cd(0x1a5)][_0x2571cd(0x1c3)][_0x2571cd(0x1e8)]>0x0;_0x173eb2&&(console[_0x2571cd(0x228)](_0x2571cd(0x1ba)+formatCountSummary(_0x306bf8[_0x2571cd(0x1a5)]['experimentalKnowledgeBases'])),console[_0x2571cd(0x228)](_0x2571cd(0x234)+formatCountSummary(_0x306bf8['counts'][_0x2571cd(0x1c3)])));console[_0x2571cd(0x228)](_0x2571cd(0x209)+a4_0x178e25[_0x2571cd(0x1dc)](_0x306bf8[_0x2571cd(0x23e)])),displayDiffs(_0x306bf8[_0x2571cd(0x1b8)],_0x306bf8[_0x2571cd(0x22e)],_0x306bf8['textKnowledgeBases'],_0x306bf8[_0x2571cd(0x1a7)],_0x306bf8[_0x2571cd(0x23b)],_0x306bf8[_0x2571cd(0x24c)],_0x306bf8['experimentalArtifacts'],_0x306bf8[_0x2571cd(0x245)],_0x306bf8[_0x2571cd(0x25a)]);if(_0x5073ae)return console[_0x2571cd(0x228)](a4_0x178e25['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5632b1===0x0&&_0x4e5de3===0x0)return console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x20c)](_0x2571cd(0x22d))),saveSessionContext({'llm_project':_0x306bf8[_0x2571cd(0x1de)]},_0x47e28b[_0x2571cd(0x204)]),console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x20c)](_0x2571cd(0x1cf)+a4_0x178e25[_0x2571cd(0x1bd)](_0x2571cd(0x1f9))+_0x2571cd(0x243)+a4_0x178e25[_0x2571cd(0x1dc)](_0x306bf8[_0x2571cd(0x1de)]))),0x0;if(!_0x38840b&&!_0x2ed5a6){if(!isInteractive())return console[_0x2571cd(0x227)](a4_0x178e25[_0x2571cd(0x19d)]('\x0aError:'),_0x2571cd(0x1ac)),console['error'](a4_0x178e25[_0x2571cd(0x1bd)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4df103=await confirmKey(_0x2571cd(0x1a9)+(_0x5632b1+_0x4e5de3)+'\x20files?');if(!_0x4df103)return console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x254)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}const {data:_0x2a1fe9}=await withSpinner(_0x2571cd(0x1a4),()=>_0x9d90e[_0x2571cd(0x207)][_0x2571cd(0x201)](_0x37864d,_0x3b4a86,{'force':_0x2ed5a6}));return console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x20c)]('\x0a✔\x20Pulled\x20'+(_0x5632b1+_0x4e5de3)+'\x20files\x20to\x20'+_0x2a1fe9[_0x2571cd(0x23e)])),saveSessionContext({'llm_project':_0x2a1fe9[_0x2571cd(0x1de)]},_0x47e28b[_0x2571cd(0x204)]),console[_0x2571cd(0x228)](a4_0x178e25[_0x2571cd(0x20c)](_0x2571cd(0x1cf)+a4_0x178e25['dim'](_0x2571cd(0x1f9))+_0x2571cd(0x243)+a4_0x178e25[_0x2571cd(0x1dc)](_0x2a1fe9[_0x2571cd(0x1de)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x140733(0x1dd);[a4_0x140733(0x249)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x140733(0x1cd)](_0x1a0aed){const _0x18115b=a4_0x140733,{options:_0x81971e,args:_0xa7a1e2,tdx:_0x9644f5}=_0x1a0aed,_0xf0e4a2=_0xa7a1e2[0x0],_0x2b2ade=_0x81971e['name'],_0x3365be=_0x81971e[_0x18115b(0x230)],_0x58ad9e=_0x81971e[_0x18115b(0x225)],_0x3efbaa=_0x81971e[_0x18115b(0x212)],_0x74c069=_0x81971e['llmProject'];let _0x113626;const _0xaecfa6=findAgentConfigPath(process['cwd']());if(_0xf0e4a2){const _0x32f9ab=a4_0x4049c8[_0x18115b(0x24a)](_0xf0e4a2,'tdx.json');existsSync(_0x32f9ab)?(_0x113626=_0xf0e4a2,console[_0x18115b(0x228)](a4_0x178e25[_0x18115b(0x1bd)](_0x18115b(0x1fe)+_0xf0e4a2))):_0x113626=_0xf0e4a2;}else{if(_0xaecfa6)_0x113626=a4_0x4049c8[_0x18115b(0x20a)](_0xaecfa6),console[_0x18115b(0x228)](a4_0x178e25[_0x18115b(0x1bd)](_0x18115b(0x22b)+_0x113626));else{if(_0x74c069){const _0x10adcf=sanitizeForFilesystem(_0x74c069);let _0x48584e=_0x10adcf,_0x5341f4=a4_0x4049c8[_0x18115b(0x24a)](process[_0x18115b(0x1d5)](),_0x18115b(0x1b8),_0x10adcf,_0x18115b(0x214));if(!existsSync(_0x5341f4)){const _0x118ffc=normalizeName(_0x74c069),_0xb07ad6=a4_0x4049c8['join'](process[_0x18115b(0x1d5)](),_0x18115b(0x1b8),_0x118ffc,'tdx.json');existsSync(_0xb07ad6)&&(_0x48584e=_0x118ffc,_0x5341f4=_0xb07ad6);}if(existsSync(_0x5341f4))_0x113626=a4_0x4049c8[_0x18115b(0x20a)](_0x5341f4),console[_0x18115b(0x228)](a4_0x178e25['dim'](_0x18115b(0x1fe)+_0x113626));else{const _0xe7476b=_0x81971e[_0x18115b(0x250)];if(_0xe7476b)throw new SDKError(ErrorCode[_0x18115b(0x237)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x74c069+_0x18115b(0x1d9),undefined,{'helpText':_0x18115b(0x1d2)+_0x18115b(0x19c)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x74c069+'\x0a')+(_0x18115b(0x1fc)+_0x48584e+_0x18115b(0x1cc)+(_0x2b2ade||_0x18115b(0x248))+'\x20--profile\x20'+_0xe7476b)});_0x113626=_0x74c069,console[_0x18115b(0x228)](a4_0x178e25[_0x18115b(0x1bd)](_0x18115b(0x1eb)+_0x74c069));}}}}if(!_0x113626)return console['log'](a4_0x178e25[_0x18115b(0x254)](_0x18115b(0x1e9))),console[_0x18115b(0x228)](_0x18115b(0x244)),console[_0x18115b(0x228)](_0x18115b(0x1f2)),console[_0x18115b(0x228)](_0x18115b(0x1c8)),console[_0x18115b(0x228)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x2b2ade)throw new SDKError(ErrorCode[_0x18115b(0x21c)],_0x18115b(0x219),undefined,{'helpText':_0x18115b(0x25b)});if(!_0x58ad9e&&!_0x3365be){if(!isInteractive())return console[_0x18115b(0x227)](a4_0x178e25[_0x18115b(0x19d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x18115b(0x227)](a4_0x178e25[_0x18115b(0x1bd)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5354b0=await confirmKey(_0x18115b(0x24f)+_0x113626+_0x18115b(0x255)+_0x2b2ade+'\x22?');if(!_0x5354b0)return console['log'](a4_0x178e25[_0x18115b(0x254)](_0x18115b(0x206))),0x1;}const {data:_0x16b8f2}=await withSpinner(_0x18115b(0x23a)+_0x113626+_0x18115b(0x1ce)+_0x2b2ade+_0x18115b(0x1be),()=>_0x9644f5[_0x18115b(0x207)][_0x18115b(0x1f1)](_0x113626,_0x2b2ade,{'dryRun':_0x3365be}));if(_0x3365be){console[_0x18115b(0x228)](a4_0x178e25[_0x18115b(0x254)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x18115b(0x228)](_0x18115b(0x1da)+_0x16b8f2[_0x18115b(0x256)]),console['log'](_0x18115b(0x22f)+_0x2b2ade),console[_0x18115b(0x228)]('Would\x20clone:'),console['log'](_0x18115b(0x1fb)+_0x16b8f2[_0x18115b(0x1a5)]['agents'][_0x18115b(0x203)]),console[_0x18115b(0x228)](_0x18115b(0x238)+_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x22e)]['created']),console['log'](_0x18115b(0x1ea)+_0x16b8f2['counts'][_0x18115b(0x1a7)][_0x18115b(0x203)]),console['log']('\x20\x20Form\x20Interfaces:\x20'+_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x245)]['created']),console[_0x18115b(0x228)](_0x18115b(0x1f7)+_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x25a)][_0x18115b(0x203)]);const _0x570acd=_0x16b8f2[_0x18115b(0x1a5)]['experimentalKnowledgeBases'][_0x18115b(0x203)]>0x0||_0x16b8f2[_0x18115b(0x1a5)]['experimentalArtifacts']['created']>0x0;return _0x570acd&&(console[_0x18115b(0x228)](_0x18115b(0x1ba)+_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x24c)][_0x18115b(0x203)]),console[_0x18115b(0x228)](_0x18115b(0x234)+_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x1c3)][_0x18115b(0x203)])),0x0;}const _0x24929d=_0x16b8f2[_0x18115b(0x1a5)]['agents']['errors']>0x0||_0x16b8f2[_0x18115b(0x1a5)]['knowledgeBases'][_0x18115b(0x211)]>0x0||_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x1a7)][_0x18115b(0x211)]>0x0||_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x245)][_0x18115b(0x211)]>0x0||_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x25a)][_0x18115b(0x211)]>0x0||_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x24c)][_0x18115b(0x211)]>0x0||_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x1c3)]['errors']>0x0;_0x24929d?console['log'](a4_0x178e25[_0x18115b(0x254)](_0x18115b(0x229))):console['log'](a4_0x178e25['green'](_0x18115b(0x258)));console[_0x18115b(0x228)]('Source:\x20'+_0x16b8f2[_0x18115b(0x256)]),console[_0x18115b(0x228)](_0x18115b(0x22f)+_0x16b8f2['newProjectName']),console[_0x18115b(0x228)](_0x18115b(0x1b0)+_0x16b8f2[_0x18115b(0x1e4)]),console[_0x18115b(0x228)](),console[_0x18115b(0x228)]('Summary:'),console[_0x18115b(0x228)](_0x18115b(0x1fb)+formatCountSummary(_0x16b8f2['counts'][_0x18115b(0x1b8)])),console[_0x18115b(0x228)](_0x18115b(0x238)+formatCountSummary(_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x22e)])),console[_0x18115b(0x228)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x1a7)])),console[_0x18115b(0x228)](_0x18115b(0x20e)+formatCountSummary(_0x16b8f2['counts']['integrations'])),console[_0x18115b(0x228)](_0x18115b(0x1e1)+formatCountSummary(_0x16b8f2['counts'][_0x18115b(0x245)])),console['log'](_0x18115b(0x1f7)+formatCountSummary(_0x16b8f2['counts'][_0x18115b(0x25a)]));const _0x5b4994=_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x24c)][_0x18115b(0x203)]>0x0||_0x16b8f2[_0x18115b(0x1a5)]['experimentalKnowledgeBases'][_0x18115b(0x1fd)]>0x0||_0x16b8f2['counts'][_0x18115b(0x24c)][_0x18115b(0x22a)]>0x0||_0x16b8f2[_0x18115b(0x1a5)]['experimentalArtifacts'][_0x18115b(0x203)]>0x0||_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x1c3)][_0x18115b(0x1fd)]>0x0||_0x16b8f2['counts']['experimentalArtifacts']['unchanged']>0x0;_0x5b4994&&(console['log'](_0x18115b(0x1ba)+formatCountSummary(_0x16b8f2[_0x18115b(0x1a5)][_0x18115b(0x24c)])),console[_0x18115b(0x228)](_0x18115b(0x234)+formatCountSummary(_0x16b8f2[_0x18115b(0x1a5)]['experimentalArtifacts'])));if(_0x24929d){console[_0x18115b(0x228)](),console[_0x18115b(0x228)](a4_0x178e25['red'](_0x18115b(0x246)));for(const _0xaa5ef8 of _0x16b8f2[_0x18115b(0x1b8)]){_0xaa5ef8['action']===_0x18115b(0x227)&&console[_0x18115b(0x228)](a4_0x178e25['red']('\x20\x20Agent\x20\x22'+_0xaa5ef8['agentName']+_0x18115b(0x1d1)+_0xaa5ef8['error']));}for(const _0x51b820 of _0x16b8f2[_0x18115b(0x22e)]){_0x51b820[_0x18115b(0x200)]===_0x18115b(0x227)&&console[_0x18115b(0x228)](a4_0x178e25['red'](_0x18115b(0x1ef)+_0x51b820[_0x18115b(0x261)]+_0x18115b(0x1d1)+_0x51b820['error']));}for(const _0x374d6d of _0x16b8f2[_0x18115b(0x1a7)]){_0x374d6d[_0x18115b(0x200)]===_0x18115b(0x227)&&console[_0x18115b(0x228)](a4_0x178e25['red'](_0x18115b(0x21d)+_0x374d6d[_0x18115b(0x261)]+'\x22:\x20'+_0x374d6d[_0x18115b(0x227)]));}for(const _0x456895 of _0x16b8f2[_0x18115b(0x23b)]){_0x456895[_0x18115b(0x200)]===_0x18115b(0x227)&&console['log'](a4_0x178e25[_0x18115b(0x19d)]('\x20\x20Integration\x20\x22'+_0x456895[_0x18115b(0x261)]+_0x18115b(0x1d1)+_0x456895['error']));}for(const _0x21d15e of _0x16b8f2[_0x18115b(0x245)]){_0x21d15e[_0x18115b(0x200)]===_0x18115b(0x227)&&console[_0x18115b(0x228)](a4_0x178e25[_0x18115b(0x19d)](_0x18115b(0x217)+_0x21d15e['name']+'\x22:\x20'+_0x21d15e[_0x18115b(0x227)]));}for(const _0x32c0d5 of _0x16b8f2[_0x18115b(0x25a)]){_0x32c0d5[_0x18115b(0x200)]===_0x18115b(0x227)&&console['log'](a4_0x178e25[_0x18115b(0x19d)](_0x18115b(0x1e2)+_0x32c0d5['name']+_0x18115b(0x1d1)+_0x32c0d5[_0x18115b(0x227)]));}for(const _0x215f1f of _0x16b8f2[_0x18115b(0x24c)]){_0x215f1f['action']==='error'&&console[_0x18115b(0x228)](a4_0x178e25[_0x18115b(0x19d)](_0x18115b(0x218)+_0x215f1f[_0x18115b(0x261)]+_0x18115b(0x1d1)+_0x215f1f[_0x18115b(0x227)]));}for(const _0x10030d of _0x16b8f2[_0x18115b(0x1c3)]){_0x10030d[_0x18115b(0x200)]==='error'&&console[_0x18115b(0x228)](a4_0x178e25[_0x18115b(0x19d)](_0x18115b(0x257)+_0x10030d['name']+_0x18115b(0x1d1)+_0x10030d['error']));}return 0x1;}console[_0x18115b(0x228)]();const _0xab8f8d=getLLMProjectUrl(_0x3efbaa,_0x16b8f2[_0x18115b(0x1e4)]);return console[_0x18115b(0x228)](_0x18115b(0x25f)+a4_0x178e25['cyan'](_0xab8f8d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x140733(0x261)]=a4_0x140733(0x19e);[a4_0x140733(0x249)]=a4_0x140733(0x1f0);async['execute'](_0x34b177){const _0x48c0bc=a4_0x140733,{options:_0x5f22a3,args:_0x240e9e,tdx:_0x290531}=_0x34b177;let _0x4b1668=_0x240e9e[0x0]||process[_0x48c0bc(0x1d5)]();const _0x383cdd=_0x5f22a3[_0x48c0bc(0x230)],_0x44d24a=_0x5f22a3[_0x48c0bc(0x223)],_0x12f171=_0x5f22a3['yes'],_0x997fda=_0x5f22a3[_0x48c0bc(0x212)],_0x50fab0=a4_0x4049c8[_0x48c0bc(0x24a)](_0x4b1668,_0x48c0bc(0x1f5)),_0x415a8d=existsSync(_0x50fab0);if(_0x415a8d){const {data:_0x518c42}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x4b1668+_0x48c0bc(0x1be),()=>_0x290531[_0x48c0bc(0x207)][_0x48c0bc(0x240)](_0x4b1668,{'dryRun':_0x383cdd,'force':_0x44d24a}));if(_0x383cdd)return console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x254)](_0x48c0bc(0x1e3))),console[_0x48c0bc(0x228)](_0x48c0bc(0x222)+_0x518c42[_0x48c0bc(0x23f)]),0x0;if(_0x518c42[_0x48c0bc(0x200)]===_0x48c0bc(0x227))return console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x205)+_0x518c42[_0x48c0bc(0x227)])),0x1;console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x20c)]('Agent\x20'+_0x518c42[_0x48c0bc(0x200)]+_0x48c0bc(0x20b))),console[_0x48c0bc(0x228)]('Agent:\x20'+_0x518c42[_0x48c0bc(0x23f)]);if(_0x518c42[_0x48c0bc(0x21a)]&&_0x518c42[_0x48c0bc(0x1e5)]){const _0x215a1d=getLLMAgentChatUrl(_0x997fda,_0x518c42[_0x48c0bc(0x1e5)],_0x518c42[_0x48c0bc(0x21a)]);console[_0x48c0bc(0x228)](_0x48c0bc(0x1a2)+a4_0x178e25[_0x48c0bc(0x1dc)](_0x215a1d));}return 0x0;}const _0x5d42c7=_0x5f22a3[_0x48c0bc(0x1c5)],_0x59e17a=resolveProjectFromContext(_0x4b1668,_0x5d42c7);if(_0x59e17a[_0x48c0bc(0x20d)])_0x4b1668=_0x59e17a[_0x48c0bc(0x1c2)],_0x59e17a['source']===_0x48c0bc(0x1d6)&&console['log'](a4_0x178e25[_0x48c0bc(0x1bd)](_0x48c0bc(0x1a1)+_0x4b1668));else{let _0x38b74c=_0x48c0bc(0x1ee);_0x59e17a['reason']==='no_local_folder'&&(_0x38b74c=_0x59e17a[_0x48c0bc(0x25d)]+_0x48c0bc(0x1ed)+_0x59e17a[_0x48c0bc(0x1c5)]+_0x48c0bc(0x1f8));throw new SDKError(ErrorCode[_0x48c0bc(0x237)],_0x59e17a['reason']===_0x48c0bc(0x21b)?_0x59e17a[_0x48c0bc(0x25d)]:_0x48c0bc(0x1ad)+_0x4b1668,undefined,{'helpText':_0x38b74c});}const {data:_0x106d74}=await withSpinner(_0x48c0bc(0x1c6),()=>_0x290531['llm'][_0x48c0bc(0x247)](_0x4b1668,{'dryRun':!![]})),_0x3885b8=_0x106d74[_0x48c0bc(0x1a5)]['agents']['errors']>0x0;if(_0x3885b8){console[_0x48c0bc(0x228)](a4_0x178e25['red'](_0x48c0bc(0x1b5)));for(const _0x18f93e of _0x106d74['agents']){_0x18f93e[_0x48c0bc(0x200)]==='error'&&console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x1ec)+_0x18f93e['agentName']+'\x22:\x20'+_0x18f93e['error']));}return 0x1;}const _0x48295a=_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1b8)][_0x48c0bc(0x203)]+_0x106d74['counts']['knowledgeBases'][_0x48c0bc(0x203)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1a6)][_0x48c0bc(0x203)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1a7)][_0x48c0bc(0x203)]+_0x106d74['counts'][_0x48c0bc(0x23b)][_0x48c0bc(0x203)]+_0x106d74[_0x48c0bc(0x1a5)]['experimentalKnowledgeBases']['created']+_0x106d74[_0x48c0bc(0x1a5)]['experimentalArtifacts'][_0x48c0bc(0x203)]+_0x106d74[_0x48c0bc(0x1a5)]['formInterfaces'][_0x48c0bc(0x203)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x25a)][_0x48c0bc(0x203)],_0x42fbb8=_0x106d74[_0x48c0bc(0x1a5)]['agents']['updated']+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x22e)][_0x48c0bc(0x1fd)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1a6)][_0x48c0bc(0x1fd)]+_0x106d74['counts'][_0x48c0bc(0x1a7)]['updated']+_0x106d74[_0x48c0bc(0x1a5)]['integrations'][_0x48c0bc(0x1fd)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x24c)][_0x48c0bc(0x1fd)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1c3)][_0x48c0bc(0x1fd)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x245)][_0x48c0bc(0x1fd)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x25a)][_0x48c0bc(0x1fd)],_0x271486=_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1b8)][_0x48c0bc(0x22a)]+_0x106d74['counts']['knowledgeBases'][_0x48c0bc(0x22a)]+_0x106d74[_0x48c0bc(0x1a5)]['textKnowledgeBases'][_0x48c0bc(0x22a)]+_0x106d74['counts'][_0x48c0bc(0x1a7)][_0x48c0bc(0x22a)]+_0x106d74[_0x48c0bc(0x1a5)]['integrations'][_0x48c0bc(0x22a)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x24c)][_0x48c0bc(0x22a)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1c3)][_0x48c0bc(0x22a)]+_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x245)][_0x48c0bc(0x22a)]+_0x106d74[_0x48c0bc(0x1a5)]['chatInterfaces'][_0x48c0bc(0x22a)];console['log'](_0x48c0bc(0x1bf)+_0x106d74['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x178e25[_0x48c0bc(0x20c)]('+\x20'+_0x48295a+_0x48c0bc(0x1c7))+_0x48c0bc(0x260)+a4_0x178e25['yellow']('~\x20'+_0x42fbb8+_0x48c0bc(0x1b1))+_0x48c0bc(0x260)+a4_0x178e25[_0x48c0bc(0x1bd)]('=\x20'+_0x271486+_0x48c0bc(0x1c4))),console[_0x48c0bc(0x228)]('\x20\x20Agents:\x20'+formatCountSummary(_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1b8)])),console[_0x48c0bc(0x228)](_0x48c0bc(0x238)+formatCountSummary(_0x106d74['counts'][_0x48c0bc(0x22e)])),console['log'](_0x48c0bc(0x21f)+formatCountSummary(_0x106d74['counts'][_0x48c0bc(0x1a6)])),console[_0x48c0bc(0x228)](_0x48c0bc(0x1ea)+formatCountSummary(_0x106d74[_0x48c0bc(0x1a5)]['prompts'])),console[_0x48c0bc(0x228)](_0x48c0bc(0x20e)+formatCountSummary(_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x23b)])),console['log'](_0x48c0bc(0x1e1)+formatCountSummary(_0x106d74['counts'][_0x48c0bc(0x245)])),console[_0x48c0bc(0x228)](_0x48c0bc(0x1f7)+formatCountSummary(_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x25a)]));const _0x119d5b=_0x106d74['counts'][_0x48c0bc(0x24c)]['created']>0x0||_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x24c)]['updated']>0x0||_0x106d74[_0x48c0bc(0x1a5)]['experimentalKnowledgeBases'][_0x48c0bc(0x22a)]>0x0||_0x106d74[_0x48c0bc(0x1a5)]['experimentalArtifacts'][_0x48c0bc(0x203)]>0x0||_0x106d74['counts'][_0x48c0bc(0x1c3)][_0x48c0bc(0x1fd)]>0x0||_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1c3)][_0x48c0bc(0x22a)]>0x0;_0x119d5b&&(console[_0x48c0bc(0x228)](_0x48c0bc(0x1ba)+formatCountSummary(_0x106d74[_0x48c0bc(0x1a5)]['experimentalKnowledgeBases'])),console[_0x48c0bc(0x228)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x106d74[_0x48c0bc(0x1a5)][_0x48c0bc(0x1c3)])));console[_0x48c0bc(0x228)](_0x48c0bc(0x210)+a4_0x178e25[_0x48c0bc(0x1dc)](_0x4b1668)),displayDiffs(_0x106d74[_0x48c0bc(0x1b8)],_0x106d74[_0x48c0bc(0x22e)],_0x106d74[_0x48c0bc(0x1a6)],_0x106d74[_0x48c0bc(0x1a7)],_0x106d74[_0x48c0bc(0x23b)],_0x106d74[_0x48c0bc(0x24c)],_0x106d74[_0x48c0bc(0x1c3)],_0x106d74[_0x48c0bc(0x245)],_0x106d74[_0x48c0bc(0x25a)]);if(_0x383cdd)return console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x254)](_0x48c0bc(0x251))),0x0;if(_0x48295a===0x0&&_0x42fbb8===0x0){console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x20c)](_0x48c0bc(0x224)));const _0x25c64b=getLLMProjectUrl(_0x997fda,_0x106d74['projectId']);return console[_0x48c0bc(0x228)](_0x48c0bc(0x25f)+a4_0x178e25[_0x48c0bc(0x1dc)](_0x25c64b)),0x0;}if(!_0x12f171&&!_0x44d24a){if(!isInteractive())return console[_0x48c0bc(0x227)](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x21e)),_0x48c0bc(0x1ac)),console[_0x48c0bc(0x227)](a4_0x178e25[_0x48c0bc(0x1bd)](_0x48c0bc(0x19f))),0x1;const _0x524c01=await confirmKey(_0x48c0bc(0x1c9)+(_0x48295a+_0x42fbb8)+_0x48c0bc(0x23c));if(!_0x524c01)return console['log'](a4_0x178e25[_0x48c0bc(0x254)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x1e3032}=await withSpinner(_0x48c0bc(0x1e0),()=>_0x290531[_0x48c0bc(0x207)][_0x48c0bc(0x247)](_0x4b1668,{'force':_0x44d24a})),_0x267836=_0x1e3032[_0x48c0bc(0x1a5)][_0x48c0bc(0x1b8)][_0x48c0bc(0x211)]>0x0||_0x1e3032[_0x48c0bc(0x1a5)][_0x48c0bc(0x22e)][_0x48c0bc(0x211)]>0x0||_0x1e3032[_0x48c0bc(0x1a5)][_0x48c0bc(0x1a6)][_0x48c0bc(0x211)]>0x0||_0x1e3032[_0x48c0bc(0x1a5)][_0x48c0bc(0x1a7)][_0x48c0bc(0x211)]>0x0||_0x1e3032[_0x48c0bc(0x1a5)][_0x48c0bc(0x245)][_0x48c0bc(0x211)]>0x0||_0x1e3032[_0x48c0bc(0x1a5)][_0x48c0bc(0x25a)][_0x48c0bc(0x211)]>0x0;if(_0x267836){console['log'](a4_0x178e25[_0x48c0bc(0x254)](_0x48c0bc(0x1e7))),console[_0x48c0bc(0x228)](),console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x19d)]('Errors:'));for(const _0x23f363 of _0x1e3032[_0x48c0bc(0x1b8)]){_0x23f363['action']===_0x48c0bc(0x227)&&console['log'](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x1ec)+_0x23f363[_0x48c0bc(0x23f)]+_0x48c0bc(0x1d1)+_0x23f363[_0x48c0bc(0x227)]));}for(const _0x5e47d3 of _0x1e3032[_0x48c0bc(0x22e)]){_0x5e47d3[_0x48c0bc(0x200)]===_0x48c0bc(0x227)&&console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x1ef)+_0x5e47d3[_0x48c0bc(0x261)]+_0x48c0bc(0x1d1)+_0x5e47d3['error']));}for(const _0x5cf065 of _0x1e3032[_0x48c0bc(0x1a6)]){_0x5cf065[_0x48c0bc(0x200)]===_0x48c0bc(0x227)&&console['log'](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x1f3)+_0x5cf065[_0x48c0bc(0x261)]+_0x48c0bc(0x1d1)+_0x5cf065[_0x48c0bc(0x227)]));}for(const _0x4caa64 of _0x1e3032[_0x48c0bc(0x1a7)]){_0x4caa64[_0x48c0bc(0x200)]===_0x48c0bc(0x227)&&console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x21d)+_0x4caa64[_0x48c0bc(0x261)]+'\x22:\x20'+_0x4caa64[_0x48c0bc(0x227)]));}for(const _0x40937a of _0x1e3032[_0x48c0bc(0x23b)]){_0x40937a[_0x48c0bc(0x200)]===_0x48c0bc(0x227)&&console['log'](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x1a3)+_0x40937a['name']+'\x22:\x20'+_0x40937a['error']));}for(const _0x52538d of _0x1e3032['formInterfaces']){_0x52538d['action']===_0x48c0bc(0x227)&&console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x217)+_0x52538d[_0x48c0bc(0x261)]+_0x48c0bc(0x1d1)+_0x52538d[_0x48c0bc(0x227)]));}for(const _0x29b22e of _0x1e3032[_0x48c0bc(0x25a)]){_0x29b22e[_0x48c0bc(0x200)]===_0x48c0bc(0x227)&&console['log'](a4_0x178e25[_0x48c0bc(0x19d)](_0x48c0bc(0x1e2)+_0x29b22e[_0x48c0bc(0x261)]+_0x48c0bc(0x1d1)+_0x29b22e[_0x48c0bc(0x227)]));}return 0x1;}console[_0x48c0bc(0x228)](a4_0x178e25[_0x48c0bc(0x20c)]('\x0a✔\x20Pushed\x20'+(_0x48295a+_0x42fbb8)+_0x48c0bc(0x213)+_0x1e3032[_0x48c0bc(0x1de)]+'\x27'));const _0x1af78c=getLLMProjectUrl(_0x997fda,_0x1e3032[_0x48c0bc(0x1e5)]);return console[_0x48c0bc(0x228)](_0x48c0bc(0x25f)+a4_0x178e25['cyan'](_0x1af78c)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x5f4907=a5_0x5029;(function(_0x5ca72b,_0x159e84){const _0x50048f=a5_0x5029,_0x2835b0=_0x5ca72b();while(!![]){try{const _0x2a4789=-parseInt(_0x50048f(0x24a))/0x1+parseInt(_0x50048f(0x22e))/0x2+parseInt(_0x50048f(0x1d3))/0x3+-parseInt(_0x50048f(0x1d9))/0x4+-parseInt(_0x50048f(0x229))/0x5+-parseInt(_0x50048f(0x254))/0x6+parseInt(_0x50048f(0x1ea))/0x7*(parseInt(_0x50048f(0x1bd))/0x8);if(_0x2a4789===_0x159e84)break;else _0x2835b0['push'](_0x2835b0['shift']());}catch(_0x1720b4){_0x2835b0['push'](_0x2835b0['shift']());}}}(a5_0x50ad,0xe6778));import*as a5_0x445aa7 from'node:fs';function a5_0x5029(_0x5219a9,_0x494e4a){_0x5219a9=_0x5219a9-0x1bd;const _0x50ad1b=a5_0x50ad();let _0x502909=_0x50ad1b[_0x5219a9];return _0x502909;}import*as a5_0x2bbde6 from'node:path';import a5_0x31c1c7 from'chalk';import{BaseCommand}from'./command.js';function a5_0x50ad(){const _0x1b41aa=['test.yml','New\x20tests\x20to\x20execute:\x20','start','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20\x20Conversation:\x20','name','\x22,\x20but\x20current\x20site\x20is\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20(new)','tests','table','Round\x201/','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Output\x20written\x20to:\x20','✗\x20ERROR:\x20','green','no_local_folder','no_tests','basename','⚠\x20SKIPPED:\x20','map','\x20\x20Project:\x20','yellow','utf-8','tags','\x20\x20Evaluating...\x20','263849pAIEhG','jsonl','substring','repeat','\x20\x20-\x20','has','cyan','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','2547324fXVkTZ','\x20(cached)','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','source','llmProject','22664WIzoeq','agent:test','Run\x20\x27tdx\x20agent\x20pull\x20','FAIL','status','existsSync','log','reason','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','round','conversation_url','Re-evaluating\x20','json','Executing\x20new\x20tests...','timestamp','length','push','Test\x20Summary','message','now','no_context','✓\x20PASS:\x20','3088299zbvaCy','multiple_agents','\x20\x20Agent:\x20','\x22:\x20','Duration:\x20','Available\x20tests:\x20','3860380ewYZuP','dim','Either\x20switch\x20to\x20the\x20\x22','execute','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Failed:\x20\x20\x20','resolveAgentId','Using\x20agent:\x20','resolveProjectId','...','Re-evaluating...','toISOString','Agent:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x27\x20to\x20create\x20the\x20folder\x20structure.','agentName','/<agent-name>','3206rKuLkp','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','trim','\x20-\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Errors:\x20\x20\x20','...\x20','llm','✗\x20FAIL:\x20','executeReeval','toLowerCase','Usage:','Project\x20path:\x20','Evaluating\x20response...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','split','text','includes','site','isSpinning','Passed:\x20\x20\x20','Conversation\x20URL:\x20','stop','projectDir','writeFileSync','404','projectName','reeval','agentDirs','Re-evaluating\x20cached\x20test\x20run...','description','Round\x20','No\x20tests\x20found\x20with\x20tags:\x20','\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','red','Test\x20','some','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','white','Error:\x20No\x20previous\x20test\x20run\x20found.','PASS','testYmlPath','Error\x20writing\x20output\x20file:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20Round\x20','resolve','Tests\x20found:\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)','ERROR','No\x20tests\x20have\x20tags\x20defined.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','filter','dryRun','Total:\x20\x20\x20\x20','join','Run\x20tests\x20for\x20an\x20LLM\x20agent','find','Failed\x20Tests:','Cached\x20run\x20is\x20from\x20site\x20\x22',':\x20Sending\x20user\x20input...','rounds','agent','conversations','4388075uIzZXe','context','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Running\x20test:\x20','verbose','2296316SOINWq','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'];a5_0x50ad=function(){return _0x1b41aa;};return a5_0x50ad();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5f4907(0x235)]=a5_0x5f4907(0x1be);[a5_0x5f4907(0x208)]=a5_0x5f4907(0x221);async[a5_0x5f4907(0x1dc)](_0x464b2a){const _0x5b7e07=a5_0x5f4907,{options:_0x29cb1a,args:_0x3cc2bb,tdx:_0x41c063}=_0x464b2a,_0x386fb0=_0x3cc2bb[0x0]||'.',_0x56b48a=_0x29cb1a[_0x5b7e07(0x21e)],_0x1e0990=_0x29cb1a,_0x25203a=_0x1e0990['eval']===![],_0xec66ae=_0x1e0990[_0x5b7e07(0x205)],_0x25406b=_0x1e0990[_0x5b7e07(0x235)],_0x6f992c=_0x1e0990['tags'],_0x2fb334=_0x29cb1a[_0x5b7e07(0x1fc)],_0x3c1527=_0x1e0990['output'];if(_0xec66ae&&_0x25203a)return console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x1f8))),0x1;let _0x2407b2=_0x5b7e07(0x23a);if(_0x1e0990[_0x5b7e07(0x1c9)])_0x2407b2='json';else{if(_0x1e0990['jsonl'])_0x2407b2=_0x5b7e07(0x24b);else{if(_0x1e0990['tsv'])_0x2407b2='tsv';else{if(_0x1e0990['table'])_0x2407b2=_0x5b7e07(0x23a);}}}const _0x1a953f=_0x1e0990[_0x5b7e07(0x258)];let _0xc30319=_0x386fb0;const _0x558beb=a5_0x445aa7[_0x5b7e07(0x1c2)](_0x386fb0),_0x5ab435=_0x386fb0==='.';if(!_0x558beb||_0x5ab435){const _0x4e0e74=resolveProjectFromContext(_0x386fb0,_0x1a953f,{'requireFile':_0x5b7e07(0x230)});if(_0x4e0e74['found'])_0xc30319=_0x4e0e74[_0x5b7e07(0x201)],_0x4e0e74[_0x5b7e07(0x257)]===_0x5b7e07(0x22a)&&console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x1e0)+_0xc30319));else switch(_0x4e0e74['reason']){case _0x5b7e07(0x1d1):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x4e0e74['message'])),console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1f5)),console['log'](_0x5b7e07(0x20b)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x219)),console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x237));return 0x1;case _0x5b7e07(0x240):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x4e0e74[_0x5b7e07(0x1cf)])),console[_0x5b7e07(0x1c3)](),console['log'](_0x5b7e07(0x1bf)+_0x4e0e74['llmProject']+_0x5b7e07(0x1e7));return 0x1;case _0x5b7e07(0x1d4):{const _0x265fb5=a5_0x2bbde6[_0x5b7e07(0x242)](_0x4e0e74[_0x5b7e07(0x201)]);console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x5b7e07(0x256)+_0x4e0e74[_0x5b7e07(0x258)]+'\x22:'));for(const _0x48c9c5 of _0x4e0e74[_0x5b7e07(0x206)]){console[_0x5b7e07(0x1c3)](_0x5b7e07(0x24e)+_0x48c9c5);}return console['log'](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x233)+_0x265fb5+_0x5b7e07(0x1e9)),0x1;}case _0x5b7e07(0x241):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x5b7e07(0x1eb)+_0x4e0e74[_0x5b7e07(0x258)]+'\x22.')),console['log'](a5_0x31c1c7['dim'](_0x5b7e07(0x1f6)+_0x4e0e74[_0x5b7e07(0x201)])),console[_0x5b7e07(0x1c3)](),console['log'](_0x5b7e07(0x1c5));return 0x1;}}const {definition:_0x5ef8f8,agentInfo:_0x5ca859}=parseTestFile(_0xc30319);let _0xfada1e=_0x5ef8f8[_0x5b7e07(0x239)];if(_0x25406b){const _0xba2b84=_0x25406b['split'](',')[_0x5b7e07(0x244)](_0x5bbfed=>_0x5bbfed[_0x5b7e07(0x1ec)]());_0xfada1e=_0x5ef8f8[_0x5b7e07(0x239)][_0x5b7e07(0x21d)](_0xf2b4e9=>_0xba2b84['includes'](_0xf2b4e9[_0x5b7e07(0x235)]));if(_0xfada1e[_0x5b7e07(0x1cc)]===0x0)return console['log'](a5_0x31c1c7[_0x5b7e07(0x246)](_0x5b7e07(0x251)+_0x25406b)),console['log'](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x1d8)+_0x5ef8f8[_0x5b7e07(0x239)][_0x5b7e07(0x244)](_0x175faf=>_0x175faf['name'])[_0x5b7e07(0x220)](',\x20'))),0x1;}if(_0x6f992c){const _0x4dcae7=_0x6f992c[_0x5b7e07(0x1f9)](',')['map'](_0x4927ff=>_0x4927ff['trim']()[_0x5b7e07(0x1f4)]());_0xfada1e=_0xfada1e[_0x5b7e07(0x21d)](_0x127ca9=>_0x127ca9[_0x5b7e07(0x248)]?.[_0x5b7e07(0x20e)](_0x39e299=>_0x4dcae7[_0x5b7e07(0x1fb)](_0x39e299[_0x5b7e07(0x1f4)]())));if(_0xfada1e[_0x5b7e07(0x1cc)]===0x0){console[_0x5b7e07(0x1c3)](a5_0x31c1c7['yellow'](_0x5b7e07(0x20a)+_0x6f992c));const _0x4402e1=new Set();return _0x5ef8f8[_0x5b7e07(0x239)]['forEach'](_0x43da07=>_0x43da07[_0x5b7e07(0x248)]?.['forEach'](_0x24d222=>_0x4402e1['add'](_0x24d222))),_0x4402e1['size']>0x0?console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)]('Available\x20tags:\x20'+[..._0x4402e1][_0x5b7e07(0x220)](',\x20'))):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x21b))),0x1;}}if(_0xec66ae)return this['executeReeval'](_0x464b2a,{'definition':{'tests':_0xfada1e},'agentInfo':_0x5ca859,'outputFormat':_0x2407b2,'outputFile':_0x3c1527,'testNames':_0x25406b});if(_0x56b48a){console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x250)]('Test\x20Configuration:')),console['log']('\x20\x20Site:\x20'+a5_0x31c1c7['white'](_0x2fb334)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x245)+a5_0x31c1c7[_0x5b7e07(0x210)](_0x5ca859[_0x5b7e07(0x204)])),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1d5)+a5_0x31c1c7['white'](_0x5ca859[_0x5b7e07(0x1e8)])),console['log'](),console['log'](_0x5b7e07(0x218)+a5_0x31c1c7[_0x5b7e07(0x210)](_0xfada1e[_0x5b7e07(0x1cc)]));for(let _0x389949=0x0;_0x389949<_0xfada1e['length'];_0x389949++){const _0x4c3916=_0xfada1e[_0x389949],_0x41b944=_0x4c3916[_0x5b7e07(0x226)]['length']===0x1?_0x5b7e07(0x1c6):_0x5b7e07(0x226),_0x26b38c=_0x4c3916['tags']?.['length']?'\x20['+_0x4c3916[_0x5b7e07(0x248)]['join'](',\x20')+']':'';console[_0x5b7e07(0x1c3)]('\x20\x20'+(_0x389949+0x1)+'.\x20'+a5_0x31c1c7[_0x5b7e07(0x210)](_0x4c3916[_0x5b7e07(0x235)])+'\x20('+_0x4c3916[_0x5b7e07(0x226)][_0x5b7e07(0x1cc)]+'\x20'+_0x41b944+')'+a5_0x31c1c7['dim'](_0x26b38c));}return 0x0;}let _0x26144d,_0x2d48ab;try{_0x26144d=await _0x41c063[_0x5b7e07(0x1f1)][_0x5b7e07(0x1e1)](_0x5ca859['projectName']);}catch(_0xffc007){const _0x21a2ab=_0xffc007 instanceof Error?_0xffc007[_0x5b7e07(0x1cf)]:String(_0xffc007);return _0x21a2ab[_0x5b7e07(0x1fb)](_0x5b7e07(0x203))||_0x21a2ab[_0x5b7e07(0x1f4)]()[_0x5b7e07(0x1fb)]('not\x20found')?console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x1dd)+_0x5ca859['projectName'])):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x23c)+_0x5ca859['projectName']+_0x5b7e07(0x1d6)+_0x21a2ab)),0x1;}try{_0x2d48ab=await _0x41c063[_0x5b7e07(0x1f1)][_0x5b7e07(0x1df)](_0x5ca859[_0x5b7e07(0x1e8)],_0x26144d);}catch(_0x11c903){const _0x3cec41=_0x11c903 instanceof Error?_0x11c903[_0x5b7e07(0x1cf)]:String(_0x11c903);return _0x3cec41[_0x5b7e07(0x1fb)]('404')||_0x3cec41['toLowerCase']()['includes']('not\x20found')?console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x20f)+_0x5ca859['agentName'])):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x252)+_0x5ca859[_0x5b7e07(0x1e8)]+'\x22:\x20'+_0x3cec41)),0x1;}let _0x3ba560;if(!_0x25203a)try{_0x3ba560=await setupEvaluatorAgent(_0x41c063[_0x5b7e07(0x1f1)],_0x29cb1a[_0x5b7e07(0x22d)]);}catch(_0xc94dc3){const _0x2f5531=_0xc94dc3 instanceof Error?_0xc94dc3[_0x5b7e07(0x1cf)]:String(_0xc94dc3);return console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x22f)+_0x2f5531)),0x1;}console['log'](a5_0x31c1c7[_0x5b7e07(0x250)]('Running\x20agent\x20tests...')),console[_0x5b7e07(0x1c3)]('Site:\x20'+a5_0x31c1c7[_0x5b7e07(0x210)](_0x2fb334)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1e5)+a5_0x31c1c7[_0x5b7e07(0x210)](_0x5ca859[_0x5b7e07(0x204)]+'/'+_0x5ca859[_0x5b7e07(0x1e8)])),console[_0x5b7e07(0x1c3)]();const _0x354473=[],_0x2b6efe=[],_0x4737a9=Date[_0x5b7e07(0x1d0)]();for(let _0x2d99f4=0x0;_0x2d99f4<_0xfada1e['length'];_0x2d99f4++){const _0x3246ef=_0xfada1e[_0x2d99f4];_0xfada1e[_0x5b7e07(0x1cc)]>0x1?console[_0x5b7e07(0x1c3)](_0x5b7e07(0x20d)+(_0x2d99f4+0x1)+'/'+_0xfada1e['length']+':\x20'+a5_0x31c1c7[_0x5b7e07(0x210)](_0x3246ef[_0x5b7e07(0x235)])):console[_0x5b7e07(0x1c3)](_0x5b7e07(0x22c)+a5_0x31c1c7[_0x5b7e07(0x210)](_0x3246ef['name']));const _0x440a84=createCommandSpinner(_0x5b7e07(0x23b)+_0x3246ef[_0x5b7e07(0x226)][_0x5b7e07(0x1cc)]+':\x20Sending\x20user\x20input...');_0x440a84[_0x5b7e07(0x232)]();try{const {result:_0x299f3b,conversation:_0x37192a}=await runTest(_0x41c063[_0x5b7e07(0x1f1)],_0x3246ef,{'agentId':_0x2d48ab,'projectId':_0x26144d,'site':_0x2fb334,'noEval':_0x25203a,'evaluatorId':_0x3ba560,'onRoundStart':(_0x56f0f3,_0xcf687f)=>{const _0x224bde=_0x5b7e07;_0x440a84[_0x224bde(0x1fa)]=_0x224bde(0x209)+(_0x56f0f3+0x1)+'/'+_0xcf687f+_0x224bde(0x225);},'onRoundComplete':(_0xe1435d,_0xedd327,_0x59fdb0)=>{const _0x1340b4=_0x5b7e07,_0x1397dc=formatElapsed(_0xedd327);_0x59fdb0?console['log'](_0x1340b4(0x216)+(_0xe1435d+0x1)+'/'+_0x3246ef['rounds'][_0x1340b4(0x1cc)]+_0x1340b4(0x1f0)+a5_0x31c1c7[_0x1340b4(0x23f)]('✓')+'\x20('+_0x1397dc+')'):console[_0x1340b4(0x1c3)](_0x1340b4(0x216)+(_0xe1435d+0x1)+'/'+_0x3246ef[_0x1340b4(0x226)][_0x1340b4(0x1cc)]+_0x1340b4(0x1f0)+a5_0x31c1c7[_0x1340b4(0x20c)]('✗'));},'onEvaluationStart':()=>{const _0x45133c=_0x5b7e07;_0x440a84['text']=_0x45133c(0x1f7);},'onEvaluationComplete':_0x57c1f8=>{const _0x3d94b5=_0x5b7e07,_0x4f6a2a=formatElapsed(_0x57c1f8);console[_0x3d94b5(0x1c3)](_0x3d94b5(0x249)+a5_0x31c1c7[_0x3d94b5(0x23f)]('✓')+'\x20('+_0x4f6a2a+')');}});_0x440a84['stop'](),_0x354473[_0x5b7e07(0x1cd)](_0x299f3b),_0x2b6efe[_0x5b7e07(0x1cd)](_0x37192a);if(_0x299f3b[_0x5b7e07(0x1c1)]===_0x5b7e07(0x212))console['log'](a5_0x31c1c7['green'](_0x5b7e07(0x1d2)+_0x299f3b[_0x5b7e07(0x1c4)]));else _0x299f3b[_0x5b7e07(0x1c1)]===_0x5b7e07(0x1c0)?console[_0x5b7e07(0x1c3)](a5_0x31c1c7['red'](_0x5b7e07(0x1f2)+_0x299f3b[_0x5b7e07(0x1c4)])):console['log'](a5_0x31c1c7[_0x5b7e07(0x20c)]('✗\x20ERROR:\x20'+_0x299f3b[_0x5b7e07(0x1c4)]));_0x299f3b[_0x5b7e07(0x1c7)]&&console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x1ff)+_0x299f3b['conversation_url'])),console[_0x5b7e07(0x1c3)]();}catch(_0x5a6c3c){_0x440a84['stop']();const _0x42846f=_0x5a6c3c instanceof Error?_0x5a6c3c[_0x5b7e07(0x1cf)]:String(_0x5a6c3c);console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x23e)+_0x42846f)),console['log'](),_0x354473[_0x5b7e07(0x1cd)]({'name':_0x3246ef['name'],'status':_0x5b7e07(0x21a),'reason':_0x42846f,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0xbc9cda=Date[_0x5b7e07(0x1d0)]()-_0x4737a9,_0x470919=_0x354473[_0x5b7e07(0x21d)](_0x23335f=>_0x23335f['status']==='PASS')[_0x5b7e07(0x1cc)],_0x185493=_0x354473[_0x5b7e07(0x21d)](_0x1b7a0e=>_0x1b7a0e[_0x5b7e07(0x1c1)]===_0x5b7e07(0x1c0))[_0x5b7e07(0x1cc)],_0x2b89c1=_0x354473['filter'](_0xa5014c=>_0xa5014c[_0x5b7e07(0x1c1)]===_0x5b7e07(0x21a))[_0x5b7e07(0x1cc)];console[_0x5b7e07(0x1c3)]('━'[_0x5b7e07(0x24d)](0x3c)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1ce)),console[_0x5b7e07(0x1c3)]('━'[_0x5b7e07(0x24d)](0x3c)),console['log'](_0x5b7e07(0x21f)+_0x354473[_0x5b7e07(0x1cc)]),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1fe)+a5_0x31c1c7[_0x5b7e07(0x23f)](_0x470919)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1de)+a5_0x31c1c7[_0x5b7e07(0x20c)](_0x185493));_0x2b89c1>0x0&&console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1ef)+a5_0x31c1c7[_0x5b7e07(0x20c)](_0x2b89c1));console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1d7)+formatElapsed(_0xbc9cda)),console[_0x5b7e07(0x1c3)]('━'[_0x5b7e07(0x24d)](0x3c));const _0x23f2a0=_0x354473['filter'](_0x5611d0=>_0x5611d0[_0x5b7e07(0x1c1)]!==_0x5b7e07(0x212));if(_0x23f2a0[_0x5b7e07(0x1cc)]>0x0){console['log'](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x223));for(const _0x33262a of _0x23f2a0){const _0x57787b=a5_0x31c1c7[_0x5b7e07(0x20c)]('✗'),_0x5a8928=_0x33262a[_0x5b7e07(0x1c4)][_0x5b7e07(0x1cc)]>0x32?_0x33262a['reason'][_0x5b7e07(0x24c)](0x0,0x32)+'...':_0x33262a[_0x5b7e07(0x1c4)];console[_0x5b7e07(0x1c3)]('\x20\x20'+_0x57787b+'\x20'+_0x33262a[_0x5b7e07(0x235)]+':\x20'+_0x5a8928);}}const _0x549be0={'summary':{'total':_0x354473[_0x5b7e07(0x1cc)],'passed':_0x470919,'failed':_0x185493,'errors':_0x2b89c1>0x0?_0x2b89c1:undefined,'duration_ms':_0xbc9cda},'tests':_0x354473,'agent':{'project':_0x5ca859[_0x5b7e07(0x204)],'name':_0x5ca859[_0x5b7e07(0x1e8)],'site':_0x2fb334},'timestamp':new Date(_0x4737a9)['toISOString']()};try{const _0x40d211=buildCachedTestRun(_0x2b6efe,{'site':_0x2fb334,'projectId':_0x26144d,'projectName':_0x5ca859[_0x5b7e07(0x204)],'agentId':_0x2d48ab,'agentName':_0x5ca859['agentName'],'testYmlPath':a5_0x2bbde6[_0x5b7e07(0x217)](_0x5ca859[_0x5b7e07(0x213)])});saveLastTestRun(_0x40d211);}catch{}if(_0x2407b2!==_0x5b7e07(0x23a)||_0x3c1527){const _0x20d30e=formatResults(_0x549be0,_0x2407b2);if(_0x3c1527)try{a5_0x445aa7[_0x5b7e07(0x202)](_0x3c1527,_0x20d30e,_0x5b7e07(0x247)),console['log'](),console[_0x5b7e07(0x1c3)](a5_0x31c1c7['dim'](_0x5b7e07(0x23d)+_0x3c1527));}catch(_0xa307e7){return console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x214)+_0xa307e7)),0x1;}else console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](_0x20d30e);}return _0x23f2a0[_0x5b7e07(0x1cc)]>0x0?0x1:0x0;}async[a5_0x5f4907(0x1f3)](_0x1599f0,_0x8250a){const _0x3e9f74=a5_0x5f4907,{options:_0xb3c613,tdx:_0xf7b838}=_0x1599f0,{definition:_0x23419f,agentInfo:_0x443905,outputFormat:_0x12516f,outputFile:_0x5ed043}=_0x8250a,_0x2d5cc6=_0xb3c613['site'],_0x29a450=loadLastTestRun();if(!_0x29a450)return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x211))),console['log'](a5_0x31c1c7['dim'](_0x3e9f74(0x253))),0x1;if(_0x29a450[_0x3e9f74(0x227)][_0x3e9f74(0x1e8)]!==_0x443905[_0x3e9f74(0x1e8)])return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x215)+_0x29a450['agent']['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x443905[_0x3e9f74(0x1e8)]+'\x22.')),console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x21c))),0x1;const _0x562f9b=new Set(_0x29a450[_0x3e9f74(0x228)]['map'](_0x1f5a04=>_0x1f5a04['testName'])),_0x40ca8d=_0x23419f[_0x3e9f74(0x239)]['filter'](_0x25fcd1=>!_0x562f9b[_0x3e9f74(0x24f)](_0x25fcd1[_0x3e9f74(0x235)]));if(_0x40ca8d['length']>0x0&&_0x29a450['site']!==_0x2d5cc6)return console['log'](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x22b))),console['log'](a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x224)+_0x29a450['site']+_0x3e9f74(0x236)+_0x2d5cc6+'\x22.')),console['log'](a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x1db)+_0x29a450[_0x3e9f74(0x1fc)]+_0x3e9f74(0x1e6))),0x1;const _0x33e3c1=_0x23419f[_0x3e9f74(0x239)][_0x3e9f74(0x21d)](_0x429119=>_0x562f9b[_0x3e9f74(0x24f)](_0x429119[_0x3e9f74(0x235)])),_0x4350b8=_0x40ca8d;let _0x5670e3;try{_0x5670e3=await setupEvaluatorAgent(_0xf7b838[_0x3e9f74(0x1f1)],_0xb3c613['verbose']);}catch(_0x11f756){const _0x2b1d99=_0x11f756 instanceof Error?_0x11f756['message']:String(_0x11f756);return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2b1d99)),0x1;}console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x250)](_0x3e9f74(0x207))),console[_0x3e9f74(0x1c3)]('Cached\x20run\x20from:\x20'+a5_0x31c1c7[_0x3e9f74(0x210)](_0x29a450[_0x3e9f74(0x1cb)])),console[_0x3e9f74(0x1c3)](_0x3e9f74(0x1e5)+a5_0x31c1c7['white'](_0x29a450['agent'][_0x3e9f74(0x204)]+'/'+_0x29a450[_0x3e9f74(0x227)][_0x3e9f74(0x1e8)]));_0x4350b8[_0x3e9f74(0x1cc)]>0x0&&console[_0x3e9f74(0x1c3)](_0x3e9f74(0x231)+a5_0x31c1c7[_0x3e9f74(0x246)](_0x4350b8[_0x3e9f74(0x1cc)]));console[_0x3e9f74(0x1c3)]();const _0x255e0a=[],_0x574873=Date[_0x3e9f74(0x1d0)](),_0x196617=createCommandSpinner(_0x3e9f74(0x1e3));if(_0x33e3c1[_0x3e9f74(0x1cc)]>0x0)try{const _0x2a1e69=await reevaluateFromCache(_0xf7b838['llm'],_0x29a450,{'tests':_0x33e3c1},{'evaluatorId':_0x5670e3,'onTestStart':(_0x554892,_0x285eb5,_0x52c20c)=>{const _0xd649b8=_0x3e9f74;_0x196617['text']=_0xd649b8(0x1c8)+(_0x285eb5+0x1)+'/'+_0x52c20c+':\x20'+_0x554892+_0xd649b8(0x1e2);if(!_0x196617[_0xd649b8(0x1fd)])_0x196617['start']();},'onTestComplete':(_0x53641d,_0x332057)=>{const _0x85b8ed=_0x3e9f74;_0x196617['stop']();if(_0x332057[_0x85b8ed(0x1c1)]===_0x85b8ed(0x212))console['log'](a5_0x31c1c7[_0x85b8ed(0x23f)](_0x85b8ed(0x1d2)+_0x53641d)+a5_0x31c1c7[_0x85b8ed(0x1da)](_0x85b8ed(0x255)));else _0x332057['status']===_0x85b8ed(0x1c0)?console['log'](a5_0x31c1c7['red'](_0x85b8ed(0x1f2)+_0x53641d+_0x85b8ed(0x1ed)+_0x332057[_0x85b8ed(0x1c4)])+a5_0x31c1c7[_0x85b8ed(0x1da)](_0x85b8ed(0x255))):console[_0x85b8ed(0x1c3)](a5_0x31c1c7[_0x85b8ed(0x20c)](_0x85b8ed(0x23e)+_0x53641d+_0x85b8ed(0x1ed)+_0x332057[_0x85b8ed(0x1c4)]));_0x332057['conversation_url']&&console[_0x85b8ed(0x1c3)](a5_0x31c1c7[_0x85b8ed(0x1da)](_0x85b8ed(0x234)+_0x332057[_0x85b8ed(0x1c7)])),_0x255e0a['push'](_0x332057);},'onTestSkipped':(_0x3aaf5f,_0x55f054)=>{const _0x271e80=_0x3e9f74;_0x196617['stop'](),console[_0x271e80(0x1c3)](a5_0x31c1c7[_0x271e80(0x246)](_0x271e80(0x243)+_0x3aaf5f+_0x271e80(0x1ed)+_0x55f054));}});for(const _0x54b32e of _0x2a1e69){!_0x255e0a[_0x3e9f74(0x222)](_0x40a507=>_0x40a507[_0x3e9f74(0x235)]===_0x54b32e[_0x3e9f74(0x235)])&&_0x255e0a[_0x3e9f74(0x1cd)](_0x54b32e);}}catch(_0x4a7475){_0x196617[_0x3e9f74(0x200)]();const _0x2b7b18=_0x4a7475 instanceof Error?_0x4a7475[_0x3e9f74(0x1cf)]:String(_0x4a7475);return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x1ee)+_0x2b7b18)),0x1;}_0x196617[_0x3e9f74(0x200)]();if(_0x4350b8[_0x3e9f74(0x1cc)]>0x0){console[_0x3e9f74(0x1c3)](),console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x250)](_0x3e9f74(0x1ca)));const {projectId:_0x2d02ac,agentId:_0x33a7ef}=_0x29a450[_0x3e9f74(0x227)];for(const _0x4b98fc of _0x4350b8){console[_0x3e9f74(0x1c3)]('Running:\x20'+a5_0x31c1c7['white'](_0x4b98fc[_0x3e9f74(0x235)]));const _0x4d9228=createCommandSpinner(_0x3e9f74(0x23b)+_0x4b98fc[_0x3e9f74(0x226)][_0x3e9f74(0x1cc)]+_0x3e9f74(0x225));_0x4d9228[_0x3e9f74(0x232)]();try{const {result:_0x4344e0}=await runTest(_0xf7b838[_0x3e9f74(0x1f1)],_0x4b98fc,{'agentId':_0x33a7ef,'projectId':_0x2d02ac,'site':_0x29a450[_0x3e9f74(0x1fc)],'noEval':![],'evaluatorId':_0x5670e3,'onRoundStart':(_0x3344e8,_0x3a0a05)=>{const _0x9475a8=_0x3e9f74;_0x4d9228[_0x9475a8(0x1fa)]=_0x9475a8(0x209)+(_0x3344e8+0x1)+'/'+_0x3a0a05+_0x9475a8(0x225);},'onRoundComplete':(_0x6f959e,_0x4a954a,_0x4bc99b)=>{const _0xb01664=_0x3e9f74,_0x19090e=formatElapsed(_0x4a954a);_0x4bc99b?console['log'](_0xb01664(0x216)+(_0x6f959e+0x1)+'/'+_0x4b98fc[_0xb01664(0x226)][_0xb01664(0x1cc)]+_0xb01664(0x1f0)+a5_0x31c1c7[_0xb01664(0x23f)]('✓')+'\x20('+_0x19090e+')'):console[_0xb01664(0x1c3)](_0xb01664(0x216)+(_0x6f959e+0x1)+'/'+_0x4b98fc['rounds']['length']+'...\x20'+a5_0x31c1c7[_0xb01664(0x20c)]('✗'));},'onEvaluationStart':()=>{const _0x657138=_0x3e9f74;_0x4d9228[_0x657138(0x1fa)]=_0x657138(0x1f7);},'onEvaluationComplete':_0xf96fe5=>{const _0x18ae4e=_0x3e9f74,_0x3bbc78=formatElapsed(_0xf96fe5);console['log']('\x20\x20Evaluating...\x20'+a5_0x31c1c7[_0x18ae4e(0x23f)]('✓')+'\x20('+_0x3bbc78+')');}});_0x4d9228['stop'](),_0x255e0a[_0x3e9f74(0x1cd)](_0x4344e0);if(_0x4344e0[_0x3e9f74(0x1c1)]===_0x3e9f74(0x212))console['log'](a5_0x31c1c7[_0x3e9f74(0x23f)]('✓\x20PASS:\x20'+_0x4344e0[_0x3e9f74(0x1c4)])+a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x238)));else _0x4344e0[_0x3e9f74(0x1c1)]===_0x3e9f74(0x1c0)?console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x1f2)+_0x4344e0['reason'])+a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x238))):console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x23e)+_0x4344e0['reason']));_0x4344e0[_0x3e9f74(0x1c7)]&&console['log'](a5_0x31c1c7['dim'](_0x3e9f74(0x234)+_0x4344e0[_0x3e9f74(0x1c7)]));}catch(_0x3d8e7e){_0x4d9228[_0x3e9f74(0x200)]();const _0x49e887=_0x3d8e7e instanceof Error?_0x3d8e7e[_0x3e9f74(0x1cf)]:String(_0x3d8e7e);console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)]('✗\x20ERROR:\x20'+_0x49e887)),_0x255e0a['push']({'name':_0x4b98fc[_0x3e9f74(0x235)],'status':_0x3e9f74(0x21a),'reason':_0x49e887,'timestamp':new Date()[_0x3e9f74(0x1e4)](),'duration_ms':0x0});}}}console['log']();const _0x22dd81=Date[_0x3e9f74(0x1d0)]()-_0x574873,_0x487d32=_0x255e0a[_0x3e9f74(0x21d)](_0x145b31=>_0x145b31['status']==='PASS')[_0x3e9f74(0x1cc)],_0x4dd5ea=_0x255e0a['filter'](_0x2b5a9a=>_0x2b5a9a[_0x3e9f74(0x1c1)]===_0x3e9f74(0x1c0))[_0x3e9f74(0x1cc)],_0x7cfc47=_0x255e0a[_0x3e9f74(0x21d)](_0x341059=>_0x341059[_0x3e9f74(0x1c1)]===_0x3e9f74(0x21a))['length'];console[_0x3e9f74(0x1c3)]('━'[_0x3e9f74(0x24d)](0x3c)),console[_0x3e9f74(0x1c3)]('Re-evaluation\x20Summary'),console[_0x3e9f74(0x1c3)]('━'[_0x3e9f74(0x24d)](0x3c)),console[_0x3e9f74(0x1c3)]('Total:\x20\x20\x20\x20'+_0x255e0a[_0x3e9f74(0x1cc)]),console['log']('Passed:\x20\x20\x20'+a5_0x31c1c7[_0x3e9f74(0x23f)](_0x487d32)),console[_0x3e9f74(0x1c3)](_0x3e9f74(0x1de)+a5_0x31c1c7[_0x3e9f74(0x20c)](_0x4dd5ea));_0x7cfc47>0x0&&console[_0x3e9f74(0x1c3)](_0x3e9f74(0x1ef)+a5_0x31c1c7['red'](_0x7cfc47));console[_0x3e9f74(0x1c3)]('Duration:\x20'+formatElapsed(_0x22dd81)),console['log']('━'[_0x3e9f74(0x24d)](0x3c));const _0x3e466a={'summary':{'total':_0x255e0a[_0x3e9f74(0x1cc)],'passed':_0x487d32,'failed':_0x4dd5ea,'errors':_0x7cfc47>0x0?_0x7cfc47:undefined,'duration_ms':_0x22dd81},'tests':_0x255e0a,'agent':{'project':_0x443905[_0x3e9f74(0x204)],'name':_0x443905[_0x3e9f74(0x1e8)],'site':_0x2d5cc6},'timestamp':new Date(_0x574873)['toISOString']()};if(_0x12516f!==_0x3e9f74(0x23a)||_0x5ed043){const _0x5bae3f=formatResults(_0x3e466a,_0x12516f);if(_0x5ed043)try{a5_0x445aa7[_0x3e9f74(0x202)](_0x5ed043,_0x5bae3f,_0x3e9f74(0x247)),console['log'](),console['log'](a5_0x31c1c7[_0x3e9f74(0x1da)]('Output\x20written\x20to:\x20'+_0x5ed043));}catch(_0xea654b){return console[_0x3e9f74(0x1c3)](),console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x214)+_0xea654b)),0x1;}else console[_0x3e9f74(0x1c3)](),console[_0x3e9f74(0x1c3)](_0x5bae3f);}const _0x11c285=_0x255e0a[_0x3e9f74(0x21d)](_0x2da800=>_0x2da800[_0x3e9f74(0x1c1)]!=='PASS');return _0x11c285[_0x3e9f74(0x1cc)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2e9e5a=a5_0x54f9;(function(_0x2911f1,_0x1ebd50){const _0x1a669e=a5_0x54f9,_0x101ee0=_0x2911f1();while(!![]){try{const _0x4d36e6=parseInt(_0x1a669e(0xdf))/0x1*(parseInt(_0x1a669e(0xcf))/0x2)+-parseInt(_0x1a669e(0x114))/0x3*(parseInt(_0x1a669e(0xda))/0x4)+-parseInt(_0x1a669e(0xbd))/0x5*(-parseInt(_0x1a669e(0xca))/0x6)+-parseInt(_0x1a669e(0xf7))/0x7+parseInt(_0x1a669e(0xee))/0x8*(parseInt(_0x1a669e(0xa3))/0x9)+-parseInt(_0x1a669e(0xe8))/0xa+parseInt(_0x1a669e(0xec))/0xb;if(_0x4d36e6===_0x1ebd50)break;else _0x101ee0['push'](_0x101ee0['shift']());}catch(_0x2c19fe){_0x101ee0['push'](_0x101ee0['shift']());}}}(a5_0x267e,0xdf386));import*as a5_0x565c3c from'node:fs';import*as a5_0xad5d93 from'node:path';import a5_0x8390b9 from'chalk';import{BaseCommand}from'./command.js';function a5_0x54f9(_0x1c3f8b,_0x5b5813){_0x1c3f8b=_0x1c3f8b-0xa3;const _0x267e10=a5_0x267e();let _0x54f9b9=_0x267e10[_0x1c3f8b];return _0x54f9b9;}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_0x267e(){const _0x50ce07=['forEach','reason','ERROR','Either\x20switch\x20to\x20the\x20\x22','site','\x20\x20Round\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','log','test.yml','green','no_context','...\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Total:\x20\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Running\x20test:\x20','Re-evaluation\x20Summary','...','Site:\x20','map','status','agent:test','\x20(new)','\x20(cached)','Passed:\x20\x20\x20','Project\x20path:\x20','3eqTmUq','writeFileSync','tests','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x20-\x20','start','Duration:\x20','Agent:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Output\x20written\x20to:\x20','join','\x20\x20Conversation:\x20','text','includes','Round\x20','verbose','Running\x20agent\x20tests...','Re-evaluating\x20','output','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','dim','FAIL','conversation_url','\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)','Re-evaluating...','\x22:\x20','table','404','message','description','agentName','Available\x20tests:\x20','PASS','Test\x20Summary','Tests\x20found:\x20','Available\x20tags:\x20','Re-evaluating\x20cached\x20test\x20run...','add','testYmlPath','some','executeReeval','toLowerCase','white','llmProject','jsonl','red','63UeGsSG','found','toISOString','name','split','context','Cached\x20run\x20from:\x20','find','existsSync','no_tests','\x27\x20to\x20create\x20the\x20folder\x20structure.','✗\x20ERROR:\x20','repeat','utf-8','llm','stop','filter','agentDirs','rounds','testName','✗\x20FAIL:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','resolve','dryRun','Using\x20agent:\x20','10GDiCCO','\x20\x20Agent:\x20','Failed:\x20\x20\x20','agent','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Test\x20Configuration:','\x20\x20Site:\x20','projectName','New\x20tests\x20to\x20execute:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','multiple_agents','2501988WVQyOW','not\x20found','now','resolveProjectId','Evaluating\x20response...','146990IvtLBd','cyan','⚠\x20SKIPPED:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','execute','Run\x20tests\x20for\x20an\x20LLM\x20agent','No\x20tests\x20have\x20tags\x20defined.','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','has','isSpinning','Errors:\x20\x20\x20','3996864BZATyK','trim','Failed\x20Tests:','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','push','14pyoUzz','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Test\x20','yellow','Round\x201/','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.',':\x20Sending\x20user\x20input...','Running:\x20','16076560MEmNhi','\x20\x20-\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','json','23928685CYRpBG','length','429592JlSPpm','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','source','no_local_folder','projectDir','Executing\x20new\x20tests...','reeval','tags','6250804nomQZr','Usage:'];a5_0x267e=function(){return _0x50ce07;};return a5_0x267e();}export class AgentTestCommand extends BaseCommand{[a5_0x2e9e5a(0xa6)]=a5_0x2e9e5a(0x10f);[a5_0x2e9e5a(0x131)]=a5_0x2e9e5a(0xd4);async[a5_0x2e9e5a(0xd3)](_0x44ea7f){const _0x40a614=a5_0x2e9e5a,{options:_0xc99901,args:_0x112c68,tdx:_0x373eec}=_0x44ea7f,_0x57474f=_0x112c68[0x0]||'.',_0x32216e=_0xc99901[_0x40a614(0xbb)],_0x1d3df1=_0xc99901,_0x2c6e0c=_0x1d3df1['eval']===![],_0xb2d586=_0x1d3df1[_0x40a614(0xf5)],_0x29c7fb=_0x1d3df1[_0x40a614(0xa6)],_0x1a611f=_0x1d3df1[_0x40a614(0xf6)],_0x3230fd=_0xc99901['site'],_0x4d8256=_0x1d3df1[_0x40a614(0x126)];if(_0xb2d586&&_0x2c6e0c)return console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x141)](_0x40a614(0x117))),0x1;let _0x50776e='table';if(_0x1d3df1[_0x40a614(0xeb)])_0x50776e=_0x40a614(0xeb);else{if(_0x1d3df1[_0x40a614(0x140)])_0x50776e='jsonl';else{if(_0x1d3df1['tsv'])_0x50776e='tsv';else{if(_0x1d3df1[_0x40a614(0x12e)])_0x50776e='table';}}}const _0x529101=_0x1d3df1[_0x40a614(0x13f)];let _0x5a4caf=_0x57474f;const _0x238b45=a5_0x565c3c[_0x40a614(0xab)](_0x57474f),_0x2ebeb8=_0x57474f==='.';if(!_0x238b45||_0x2ebeb8){const _0x4a5c8c=resolveProjectFromContext(_0x57474f,_0x529101,{'requireFile':_0x40a614(0x101)});if(_0x4a5c8c[_0x40a614(0xa4)])_0x5a4caf=_0x4a5c8c['projectDir'],_0x4a5c8c[_0x40a614(0xf1)]===_0x40a614(0xa8)&&console[_0x40a614(0x100)](a5_0x8390b9['dim'](_0x40a614(0xbc)+_0x5a4caf));else switch(_0x4a5c8c[_0x40a614(0xfa)]){case _0x40a614(0x103):console['log'](a5_0x8390b9['yellow'](_0x4a5c8c[_0x40a614(0x130)])),console['log'](),console[_0x40a614(0x100)](_0x40a614(0xf8)),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x40a614(0x100)](_0x40a614(0x12b)),console[_0x40a614(0x100)](),console[_0x40a614(0x100)](_0x40a614(0xff));return 0x1;case _0x40a614(0xf2):console[_0x40a614(0x100)](a5_0x8390b9['yellow'](_0x4a5c8c['message'])),console[_0x40a614(0x100)](),console[_0x40a614(0x100)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4a5c8c['llmProject']+_0x40a614(0xad));return 0x1;case _0x40a614(0xc9):{const _0x2aa5c6=a5_0xad5d93['basename'](_0x4a5c8c[_0x40a614(0xf3)]);console['log'](a5_0x8390b9[_0x40a614(0xe2)](_0x40a614(0x105)+_0x4a5c8c[_0x40a614(0x13f)]+'\x22:'));for(const _0x4a8c67 of _0x4a5c8c[_0x40a614(0xb4)]){console[_0x40a614(0x100)](_0x40a614(0xe9)+_0x4a8c67);}return console[_0x40a614(0x100)](),console['log'](_0x40a614(0xc6)+_0x2aa5c6+'/<agent-name>'),0x1;}case _0x40a614(0xac):console['log'](a5_0x8390b9['yellow'](_0x40a614(0xb8)+_0x4a5c8c[_0x40a614(0x13f)]+'\x22.')),console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x128)](_0x40a614(0x113)+_0x4a5c8c[_0x40a614(0xf3)])),console[_0x40a614(0x100)](),console[_0x40a614(0x100)](_0x40a614(0x108));return 0x1;}}const {definition:_0x337997,agentInfo:_0x205193}=parseTestFile(_0x5a4caf);let _0x233a74=_0x337997[_0x40a614(0x116)];if(_0x29c7fb){const _0x25efa8=_0x29c7fb[_0x40a614(0xa7)](',')[_0x40a614(0x10d)](_0x138ac1=>_0x138ac1[_0x40a614(0xdb)]());_0x233a74=_0x337997[_0x40a614(0x116)]['filter'](_0x485a9d=>_0x25efa8[_0x40a614(0x121)](_0x485a9d[_0x40a614(0xa6)]));if(_0x233a74[_0x40a614(0xed)]===0x0)return console[_0x40a614(0x100)](a5_0x8390b9['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x29c7fb)),console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x128)](_0x40a614(0x133)+_0x337997['tests']['map'](_0x16e490=>_0x16e490[_0x40a614(0xa6)])['join'](',\x20'))),0x1;}if(_0x1a611f){const _0x2614ab=_0x1a611f['split'](',')['map'](_0x4f43e5=>_0x4f43e5[_0x40a614(0xdb)]()[_0x40a614(0x13d)]());_0x233a74=_0x233a74[_0x40a614(0xb3)](_0x577972=>_0x577972['tags']?.[_0x40a614(0x13b)](_0x1f6cd5=>_0x2614ab['includes'](_0x1f6cd5[_0x40a614(0x13d)]())));if(_0x233a74[_0x40a614(0xed)]===0x0){console[_0x40a614(0x100)](a5_0x8390b9['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1a611f));const _0x30018b=new Set();return _0x337997[_0x40a614(0x116)][_0x40a614(0xf9)](_0x17efea=>_0x17efea[_0x40a614(0xf6)]?.['forEach'](_0x4380c4=>_0x30018b[_0x40a614(0x139)](_0x4380c4))),_0x30018b['size']>0x0?console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x128)](_0x40a614(0x137)+[..._0x30018b][_0x40a614(0x11e)](',\x20'))):console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x128)](_0x40a614(0xd5))),0x1;}}if(_0xb2d586)return this[_0x40a614(0x13c)](_0x44ea7f,{'definition':{'tests':_0x233a74},'agentInfo':_0x205193,'outputFormat':_0x50776e,'outputFile':_0x4d8256,'testNames':_0x29c7fb});if(_0x32216e){console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0xd0)](_0x40a614(0xc2))),console[_0x40a614(0x100)](_0x40a614(0xc3)+a5_0x8390b9['white'](_0x3230fd)),console[_0x40a614(0x100)]('\x20\x20Project:\x20'+a5_0x8390b9[_0x40a614(0x13e)](_0x205193[_0x40a614(0xc4)])),console['log'](_0x40a614(0xbe)+a5_0x8390b9[_0x40a614(0x13e)](_0x205193[_0x40a614(0x132)])),console['log'](),console[_0x40a614(0x100)](_0x40a614(0x136)+a5_0x8390b9[_0x40a614(0x13e)](_0x233a74['length']));for(let _0x44df91=0x0;_0x44df91<_0x233a74[_0x40a614(0xed)];_0x44df91++){const _0x435352=_0x233a74[_0x44df91],_0x4e61d1=_0x435352[_0x40a614(0xb5)][_0x40a614(0xed)]===0x1?'round':_0x40a614(0xb5),_0x319173=_0x435352[_0x40a614(0xf6)]?.[_0x40a614(0xed)]?'\x20['+_0x435352[_0x40a614(0xf6)][_0x40a614(0x11e)](',\x20')+']':'';console['log']('\x20\x20'+(_0x44df91+0x1)+'.\x20'+a5_0x8390b9['white'](_0x435352[_0x40a614(0xa6)])+'\x20('+_0x435352[_0x40a614(0xb5)][_0x40a614(0xed)]+'\x20'+_0x4e61d1+')'+a5_0x8390b9[_0x40a614(0x128)](_0x319173));}return 0x0;}let _0x590b5d,_0x40f49e;try{_0x590b5d=await _0x373eec[_0x40a614(0xb1)][_0x40a614(0xcd)](_0x205193['projectName']);}catch(_0x20acb1){const _0x2ae0ea=_0x20acb1 instanceof Error?_0x20acb1[_0x40a614(0x130)]:String(_0x20acb1);return _0x2ae0ea[_0x40a614(0x121)](_0x40a614(0x12f))||_0x2ae0ea[_0x40a614(0x13d)]()[_0x40a614(0x121)](_0x40a614(0xcb))?console[_0x40a614(0x100)](a5_0x8390b9['red'](_0x40a614(0xea)+_0x205193['projectName'])):console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x141)](_0x40a614(0xdd)+_0x205193[_0x40a614(0xc4)]+_0x40a614(0x12d)+_0x2ae0ea)),0x1;}try{_0x40f49e=await _0x373eec[_0x40a614(0xb1)]['resolveAgentId'](_0x205193[_0x40a614(0x132)],_0x590b5d);}catch(_0x640dec){const _0x50c654=_0x640dec instanceof Error?_0x640dec[_0x40a614(0x130)]:String(_0x640dec);return _0x50c654[_0x40a614(0x121)](_0x40a614(0x12f))||_0x50c654[_0x40a614(0x13d)]()[_0x40a614(0x121)](_0x40a614(0xcb))?console[_0x40a614(0x100)](a5_0x8390b9['red'](_0x40a614(0xc8)+_0x205193['agentName'])):console[_0x40a614(0x100)](a5_0x8390b9['red'](_0x40a614(0xb9)+_0x205193[_0x40a614(0x132)]+'\x22:\x20'+_0x50c654)),0x1;}let _0x3377ea;if(!_0x2c6e0c)try{_0x3377ea=await setupEvaluatorAgent(_0x373eec[_0x40a614(0xb1)],_0xc99901[_0x40a614(0x123)]);}catch(_0x5bacea){const _0x172856=_0x5bacea instanceof Error?_0x5bacea[_0x40a614(0x130)]:String(_0x5bacea);return console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x141)](_0x40a614(0xd2)+_0x172856)),0x1;}console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0xd0)](_0x40a614(0x124))),console[_0x40a614(0x100)](_0x40a614(0x10c)+a5_0x8390b9['white'](_0x3230fd)),console[_0x40a614(0x100)](_0x40a614(0x11b)+a5_0x8390b9[_0x40a614(0x13e)](_0x205193['projectName']+'/'+_0x205193['agentName'])),console[_0x40a614(0x100)]();const _0xc76220=[],_0x1f4172=[],_0x4353d7=Date[_0x40a614(0xcc)]();for(let _0x16d802=0x0;_0x16d802<_0x233a74[_0x40a614(0xed)];_0x16d802++){const _0x44006d=_0x233a74[_0x16d802];_0x233a74[_0x40a614(0xed)]>0x1?console['log'](_0x40a614(0xe1)+(_0x16d802+0x1)+'/'+_0x233a74[_0x40a614(0xed)]+':\x20'+a5_0x8390b9[_0x40a614(0x13e)](_0x44006d[_0x40a614(0xa6)])):console['log'](_0x40a614(0x109)+a5_0x8390b9[_0x40a614(0x13e)](_0x44006d[_0x40a614(0xa6)]));const _0x4c4571=createCommandSpinner('Round\x201/'+_0x44006d['rounds'][_0x40a614(0xed)]+_0x40a614(0xe6));_0x4c4571[_0x40a614(0x119)]();try{const {result:_0x3135f5,conversation:_0x16ec3b}=await runTest(_0x373eec[_0x40a614(0xb1)],_0x44006d,{'agentId':_0x40f49e,'projectId':_0x590b5d,'site':_0x3230fd,'noEval':_0x2c6e0c,'evaluatorId':_0x3377ea,'onRoundStart':(_0x534f9d,_0x325df4)=>{const _0xea8bc2=_0x40a614;_0x4c4571[_0xea8bc2(0x120)]=_0xea8bc2(0x122)+(_0x534f9d+0x1)+'/'+_0x325df4+_0xea8bc2(0xe6);},'onRoundComplete':(_0xc22165,_0xad2bc8,_0x3225c0)=>{const _0x9f3c31=_0x40a614,_0xd0d423=formatElapsed(_0xad2bc8);_0x3225c0?console['log'](_0x9f3c31(0xfe)+(_0xc22165+0x1)+'/'+_0x44006d[_0x9f3c31(0xb5)][_0x9f3c31(0xed)]+_0x9f3c31(0x104)+a5_0x8390b9[_0x9f3c31(0x102)]('✓')+'\x20('+_0xd0d423+')'):console[_0x9f3c31(0x100)](_0x9f3c31(0xfe)+(_0xc22165+0x1)+'/'+_0x44006d[_0x9f3c31(0xb5)][_0x9f3c31(0xed)]+_0x9f3c31(0x104)+a5_0x8390b9[_0x9f3c31(0x141)]('✗'));},'onEvaluationStart':()=>{const _0x2f205d=_0x40a614;_0x4c4571[_0x2f205d(0x120)]=_0x2f205d(0xce);},'onEvaluationComplete':_0xdaaec8=>{const _0x451fd4=_0x40a614,_0x41494c=formatElapsed(_0xdaaec8);console[_0x451fd4(0x100)](_0x451fd4(0xe4)+a5_0x8390b9[_0x451fd4(0x102)]('✓')+'\x20('+_0x41494c+')');}});_0x4c4571[_0x40a614(0xb2)](),_0xc76220[_0x40a614(0xde)](_0x3135f5),_0x1f4172[_0x40a614(0xde)](_0x16ec3b);if(_0x3135f5[_0x40a614(0x10e)]===_0x40a614(0x134))console[_0x40a614(0x100)](a5_0x8390b9['green'](_0x40a614(0xef)+_0x3135f5[_0x40a614(0xfa)]));else _0x3135f5[_0x40a614(0x10e)]===_0x40a614(0x129)?console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x141)](_0x40a614(0xb7)+_0x3135f5['reason'])):console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x141)]('✗\x20ERROR:\x20'+_0x3135f5[_0x40a614(0xfa)]));_0x3135f5[_0x40a614(0x12a)]&&console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x128)]('Conversation\x20URL:\x20'+_0x3135f5[_0x40a614(0x12a)])),console[_0x40a614(0x100)]();}catch(_0x313cde){_0x4c4571[_0x40a614(0xb2)]();const _0x3fef2e=_0x313cde instanceof Error?_0x313cde['message']:String(_0x313cde);console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x141)](_0x40a614(0xae)+_0x3fef2e)),console[_0x40a614(0x100)](),_0xc76220[_0x40a614(0xde)]({'name':_0x44006d[_0x40a614(0xa6)],'status':'ERROR','reason':_0x3fef2e,'timestamp':new Date()[_0x40a614(0xa5)](),'duration_ms':0x0});}}const _0x20c793=Date[_0x40a614(0xcc)]()-_0x4353d7,_0x3c59cf=_0xc76220[_0x40a614(0xb3)](_0x3f9ed9=>_0x3f9ed9['status']===_0x40a614(0x134))[_0x40a614(0xed)],_0x4580b6=_0xc76220[_0x40a614(0xb3)](_0x1cbdbb=>_0x1cbdbb[_0x40a614(0x10e)]==='FAIL')['length'],_0x1bba38=_0xc76220[_0x40a614(0xb3)](_0x34bb53=>_0x34bb53[_0x40a614(0x10e)]==='ERROR')['length'];console[_0x40a614(0x100)]('━'['repeat'](0x3c)),console['log'](_0x40a614(0x135)),console['log']('━'[_0x40a614(0xaf)](0x3c)),console[_0x40a614(0x100)](_0x40a614(0x107)+_0xc76220[_0x40a614(0xed)]),console[_0x40a614(0x100)](_0x40a614(0x112)+a5_0x8390b9[_0x40a614(0x102)](_0x3c59cf)),console[_0x40a614(0x100)](_0x40a614(0xbf)+a5_0x8390b9[_0x40a614(0x141)](_0x4580b6));_0x1bba38>0x0&&console[_0x40a614(0x100)](_0x40a614(0xd9)+a5_0x8390b9[_0x40a614(0x141)](_0x1bba38));console[_0x40a614(0x100)](_0x40a614(0x11a)+formatElapsed(_0x20c793)),console[_0x40a614(0x100)]('━'['repeat'](0x3c));const _0x538cd3=_0xc76220[_0x40a614(0xb3)](_0x1bec72=>_0x1bec72[_0x40a614(0x10e)]!==_0x40a614(0x134));if(_0x538cd3['length']>0x0){console[_0x40a614(0x100)](),console[_0x40a614(0x100)](_0x40a614(0xdc));for(const _0x8feb15 of _0x538cd3){const _0x4f17ca=a5_0x8390b9['red']('✗'),_0x33a158=_0x8feb15[_0x40a614(0xfa)][_0x40a614(0xed)]>0x32?_0x8feb15[_0x40a614(0xfa)]['substring'](0x0,0x32)+_0x40a614(0x10b):_0x8feb15[_0x40a614(0xfa)];console[_0x40a614(0x100)]('\x20\x20'+_0x4f17ca+'\x20'+_0x8feb15[_0x40a614(0xa6)]+':\x20'+_0x33a158);}}const _0xdaeeeb={'summary':{'total':_0xc76220[_0x40a614(0xed)],'passed':_0x3c59cf,'failed':_0x4580b6,'errors':_0x1bba38>0x0?_0x1bba38:undefined,'duration_ms':_0x20c793},'tests':_0xc76220,'agent':{'project':_0x205193[_0x40a614(0xc4)],'name':_0x205193[_0x40a614(0x132)],'site':_0x3230fd},'timestamp':new Date(_0x4353d7)[_0x40a614(0xa5)]()};try{const _0x38dfb6=buildCachedTestRun(_0x1f4172,{'site':_0x3230fd,'projectId':_0x590b5d,'projectName':_0x205193[_0x40a614(0xc4)],'agentId':_0x40f49e,'agentName':_0x205193['agentName'],'testYmlPath':a5_0xad5d93[_0x40a614(0xba)](_0x205193[_0x40a614(0x13a)])});saveLastTestRun(_0x38dfb6);}catch{}if(_0x50776e!==_0x40a614(0x12e)||_0x4d8256){const _0x1ee456=formatResults(_0xdaeeeb,_0x50776e);if(_0x4d8256)try{a5_0x565c3c[_0x40a614(0x115)](_0x4d8256,_0x1ee456,_0x40a614(0xb0)),console[_0x40a614(0x100)](),console[_0x40a614(0x100)](a5_0x8390b9[_0x40a614(0x128)](_0x40a614(0x11d)+_0x4d8256));}catch(_0xe4af31){return console[_0x40a614(0x100)](),console[_0x40a614(0x100)](a5_0x8390b9['red'](_0x40a614(0xf0)+_0xe4af31)),0x1;}else console[_0x40a614(0x100)](),console[_0x40a614(0x100)](_0x1ee456);}return _0x538cd3[_0x40a614(0xed)]>0x0?0x1:0x0;}async['executeReeval'](_0x1044e6,_0x2cc0f8){const _0x5a0939=a5_0x2e9e5a,{options:_0x471205,tdx:_0x1852e5}=_0x1044e6,{definition:_0x247b70,agentInfo:_0x53cbe6,outputFormat:_0x20983a,outputFile:_0x41037c}=_0x2cc0f8,_0x111524=_0x471205['site'],_0x1d97d6=loadLastTestRun();if(!_0x1d97d6)return console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x141)](_0x5a0939(0x11c))),console[_0x5a0939(0x100)](a5_0x8390b9['dim'](_0x5a0939(0x106))),0x1;if(_0x1d97d6['agent'][_0x5a0939(0x132)]!==_0x53cbe6[_0x5a0939(0x132)])return console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x141)](_0x5a0939(0xe0)+_0x1d97d6['agent'][_0x5a0939(0x132)]+_0x5a0939(0xc7)+_0x53cbe6['agentName']+'\x22.')),console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x128)](_0x5a0939(0xe5))),0x1;const _0x24b3f9=new Set(_0x1d97d6['conversations'][_0x5a0939(0x10d)](_0x40c2a7=>_0x40c2a7[_0x5a0939(0xb6)])),_0x225583=_0x247b70[_0x5a0939(0x116)][_0x5a0939(0xb3)](_0x2adae0=>!_0x24b3f9['has'](_0x2adae0[_0x5a0939(0xa6)]));if(_0x225583[_0x5a0939(0xed)]>0x0&&_0x1d97d6[_0x5a0939(0xfd)]!==_0x111524)return console['log'](a5_0x8390b9[_0x5a0939(0x141)](_0x5a0939(0xd6))),console['log'](a5_0x8390b9[_0x5a0939(0x128)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x1d97d6[_0x5a0939(0xfd)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x111524+'\x22.')),console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x128)](_0x5a0939(0xfc)+_0x1d97d6[_0x5a0939(0xfd)]+_0x5a0939(0x127))),0x1;const _0x295ee0=_0x247b70[_0x5a0939(0x116)][_0x5a0939(0xb3)](_0x21b755=>_0x24b3f9[_0x5a0939(0xd7)](_0x21b755['name'])),_0x195696=_0x225583;let _0x53dd14;try{_0x53dd14=await setupEvaluatorAgent(_0x1852e5[_0x5a0939(0xb1)],_0x471205[_0x5a0939(0x123)]);}catch(_0x268d5c){const _0xca4a2a=_0x268d5c instanceof Error?_0x268d5c['message']:String(_0x268d5c);return console[_0x5a0939(0x100)](a5_0x8390b9['red'](_0x5a0939(0xd2)+_0xca4a2a)),0x1;}console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0xd0)](_0x5a0939(0x138))),console[_0x5a0939(0x100)](_0x5a0939(0xa9)+a5_0x8390b9[_0x5a0939(0x13e)](_0x1d97d6['timestamp'])),console[_0x5a0939(0x100)](_0x5a0939(0x11b)+a5_0x8390b9[_0x5a0939(0x13e)](_0x1d97d6[_0x5a0939(0xc0)][_0x5a0939(0xc4)]+'/'+_0x1d97d6['agent'][_0x5a0939(0x132)]));_0x195696[_0x5a0939(0xed)]>0x0&&console[_0x5a0939(0x100)](_0x5a0939(0xc5)+a5_0x8390b9[_0x5a0939(0xe2)](_0x195696[_0x5a0939(0xed)]));console['log']();const _0x4bfdf9=[],_0x5c9ec9=Date[_0x5a0939(0xcc)](),_0x1371e2=createCommandSpinner(_0x5a0939(0x12c));if(_0x295ee0[_0x5a0939(0xed)]>0x0)try{const _0x1a45b7=await reevaluateFromCache(_0x1852e5[_0x5a0939(0xb1)],_0x1d97d6,{'tests':_0x295ee0},{'evaluatorId':_0x53dd14,'onTestStart':(_0x157b6b,_0x121851,_0x4c3356)=>{const _0x9c24a2=_0x5a0939;_0x1371e2[_0x9c24a2(0x120)]=_0x9c24a2(0x125)+(_0x121851+0x1)+'/'+_0x4c3356+':\x20'+_0x157b6b+_0x9c24a2(0x10b);if(!_0x1371e2[_0x9c24a2(0xd8)])_0x1371e2[_0x9c24a2(0x119)]();},'onTestComplete':(_0x8c4c0e,_0x4a5982)=>{const _0xbd0f3=_0x5a0939;_0x1371e2[_0xbd0f3(0xb2)]();if(_0x4a5982[_0xbd0f3(0x10e)]==='PASS')console['log'](a5_0x8390b9[_0xbd0f3(0x102)](_0xbd0f3(0xef)+_0x8c4c0e)+a5_0x8390b9[_0xbd0f3(0x128)](_0xbd0f3(0x111)));else _0x4a5982[_0xbd0f3(0x10e)]===_0xbd0f3(0x129)?console['log'](a5_0x8390b9[_0xbd0f3(0x141)]('✗\x20FAIL:\x20'+_0x8c4c0e+_0xbd0f3(0x118)+_0x4a5982[_0xbd0f3(0xfa)])+a5_0x8390b9['dim'](_0xbd0f3(0x111))):console[_0xbd0f3(0x100)](a5_0x8390b9[_0xbd0f3(0x141)](_0xbd0f3(0xae)+_0x8c4c0e+_0xbd0f3(0x118)+_0x4a5982[_0xbd0f3(0xfa)]));_0x4a5982['conversation_url']&&console['log'](a5_0x8390b9[_0xbd0f3(0x128)](_0xbd0f3(0x11f)+_0x4a5982[_0xbd0f3(0x12a)])),_0x4bfdf9[_0xbd0f3(0xde)](_0x4a5982);},'onTestSkipped':(_0x1c47e9,_0x145af6)=>{const _0x2cea9d=_0x5a0939;_0x1371e2[_0x2cea9d(0xb2)](),console['log'](a5_0x8390b9[_0x2cea9d(0xe2)](_0x2cea9d(0xd1)+_0x1c47e9+'\x20-\x20'+_0x145af6));}});for(const _0x148cf4 of _0x1a45b7){!_0x4bfdf9[_0x5a0939(0xaa)](_0x4dabd8=>_0x4dabd8['name']===_0x148cf4['name'])&&_0x4bfdf9[_0x5a0939(0xde)](_0x148cf4);}}catch(_0xe12b13){_0x1371e2[_0x5a0939(0xb2)]();const _0x51d49c=_0xe12b13 instanceof Error?_0xe12b13[_0x5a0939(0x130)]:String(_0xe12b13);return console['log'](a5_0x8390b9[_0x5a0939(0x141)](_0x5a0939(0xc1)+_0x51d49c)),0x1;}_0x1371e2[_0x5a0939(0xb2)]();if(_0x195696[_0x5a0939(0xed)]>0x0){console[_0x5a0939(0x100)](),console['log'](a5_0x8390b9[_0x5a0939(0xd0)](_0x5a0939(0xf4)));const {projectId:_0x3ef876,agentId:_0x3c0cbc}=_0x1d97d6[_0x5a0939(0xc0)];for(const _0x264a2e of _0x195696){console[_0x5a0939(0x100)](_0x5a0939(0xe7)+a5_0x8390b9['white'](_0x264a2e[_0x5a0939(0xa6)]));const _0x170810=createCommandSpinner(_0x5a0939(0xe3)+_0x264a2e['rounds']['length']+':\x20Sending\x20user\x20input...');_0x170810['start']();try{const {result:_0x4235e1}=await runTest(_0x1852e5[_0x5a0939(0xb1)],_0x264a2e,{'agentId':_0x3c0cbc,'projectId':_0x3ef876,'site':_0x1d97d6[_0x5a0939(0xfd)],'noEval':![],'evaluatorId':_0x53dd14,'onRoundStart':(_0x2fc2c4,_0x26314a)=>{const _0x1efba0=_0x5a0939;_0x170810[_0x1efba0(0x120)]=_0x1efba0(0x122)+(_0x2fc2c4+0x1)+'/'+_0x26314a+_0x1efba0(0xe6);},'onRoundComplete':(_0x12c7a3,_0xfae676,_0x17018f)=>{const _0x17253b=_0x5a0939,_0x72698b=formatElapsed(_0xfae676);_0x17018f?console['log'](_0x17253b(0xfe)+(_0x12c7a3+0x1)+'/'+_0x264a2e[_0x17253b(0xb5)][_0x17253b(0xed)]+'...\x20'+a5_0x8390b9[_0x17253b(0x102)]('✓')+'\x20('+_0x72698b+')'):console[_0x17253b(0x100)](_0x17253b(0xfe)+(_0x12c7a3+0x1)+'/'+_0x264a2e[_0x17253b(0xb5)][_0x17253b(0xed)]+_0x17253b(0x104)+a5_0x8390b9['red']('✗'));},'onEvaluationStart':()=>{const _0x107fc9=_0x5a0939;_0x170810[_0x107fc9(0x120)]='Evaluating\x20response...';},'onEvaluationComplete':_0x177183=>{const _0x22caee=_0x5a0939,_0x1c41cf=formatElapsed(_0x177183);console['log'](_0x22caee(0xe4)+a5_0x8390b9[_0x22caee(0x102)]('✓')+'\x20('+_0x1c41cf+')');}});_0x170810['stop'](),_0x4bfdf9[_0x5a0939(0xde)](_0x4235e1);if(_0x4235e1[_0x5a0939(0x10e)]===_0x5a0939(0x134))console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x102)](_0x5a0939(0xef)+_0x4235e1['reason'])+a5_0x8390b9['dim'](_0x5a0939(0x110)));else _0x4235e1[_0x5a0939(0x10e)]===_0x5a0939(0x129)?console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x141)](_0x5a0939(0xb7)+_0x4235e1[_0x5a0939(0xfa)])+a5_0x8390b9['dim'](_0x5a0939(0x110))):console[_0x5a0939(0x100)](a5_0x8390b9['red'](_0x5a0939(0xae)+_0x4235e1['reason']));_0x4235e1['conversation_url']&&console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x128)](_0x5a0939(0x11f)+_0x4235e1['conversation_url']));}catch(_0xf6f903){_0x170810[_0x5a0939(0xb2)]();const _0x4c3514=_0xf6f903 instanceof Error?_0xf6f903[_0x5a0939(0x130)]:String(_0xf6f903);console[_0x5a0939(0x100)](a5_0x8390b9['red'](_0x5a0939(0xae)+_0x4c3514)),_0x4bfdf9[_0x5a0939(0xde)]({'name':_0x264a2e[_0x5a0939(0xa6)],'status':'ERROR','reason':_0x4c3514,'timestamp':new Date()[_0x5a0939(0xa5)](),'duration_ms':0x0});}}}console['log']();const _0x153979=Date[_0x5a0939(0xcc)]()-_0x5c9ec9,_0x4cc585=_0x4bfdf9[_0x5a0939(0xb3)](_0x255647=>_0x255647['status']==='PASS')[_0x5a0939(0xed)],_0x4bd35e=_0x4bfdf9[_0x5a0939(0xb3)](_0x3a44ca=>_0x3a44ca[_0x5a0939(0x10e)]==='FAIL')[_0x5a0939(0xed)],_0xb8f35b=_0x4bfdf9['filter'](_0x1f0115=>_0x1f0115['status']===_0x5a0939(0xfb))['length'];console[_0x5a0939(0x100)]('━'[_0x5a0939(0xaf)](0x3c)),console[_0x5a0939(0x100)](_0x5a0939(0x10a)),console[_0x5a0939(0x100)]('━'[_0x5a0939(0xaf)](0x3c)),console[_0x5a0939(0x100)](_0x5a0939(0x107)+_0x4bfdf9['length']),console[_0x5a0939(0x100)](_0x5a0939(0x112)+a5_0x8390b9['green'](_0x4cc585)),console[_0x5a0939(0x100)](_0x5a0939(0xbf)+a5_0x8390b9[_0x5a0939(0x141)](_0x4bd35e));_0xb8f35b>0x0&&console[_0x5a0939(0x100)]('Errors:\x20\x20\x20'+a5_0x8390b9[_0x5a0939(0x141)](_0xb8f35b));console['log']('Duration:\x20'+formatElapsed(_0x153979)),console[_0x5a0939(0x100)]('━'['repeat'](0x3c));const _0x1c7bbc={'summary':{'total':_0x4bfdf9[_0x5a0939(0xed)],'passed':_0x4cc585,'failed':_0x4bd35e,'errors':_0xb8f35b>0x0?_0xb8f35b:undefined,'duration_ms':_0x153979},'tests':_0x4bfdf9,'agent':{'project':_0x53cbe6[_0x5a0939(0xc4)],'name':_0x53cbe6['agentName'],'site':_0x111524},'timestamp':new Date(_0x5c9ec9)[_0x5a0939(0xa5)]()};if(_0x20983a!=='table'||_0x41037c){const _0x324cc7=formatResults(_0x1c7bbc,_0x20983a);if(_0x41037c)try{a5_0x565c3c[_0x5a0939(0x115)](_0x41037c,_0x324cc7,_0x5a0939(0xb0)),console['log'](),console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x128)](_0x5a0939(0x11d)+_0x41037c));}catch(_0x6def5b){return console[_0x5a0939(0x100)](),console[_0x5a0939(0x100)](a5_0x8390b9[_0x5a0939(0x141)]('Error\x20writing\x20output\x20file:\x20'+_0x6def5b)),0x1;}else console[_0x5a0939(0x100)](),console['log'](_0x324cc7);}const _0x53eac8=_0x4bfdf9[_0x5a0939(0xb3)](_0x1162c3=>_0x1162c3[_0x5a0939(0x10e)]!==_0x5a0939(0x134));return _0x53eac8[_0x5a0939(0xed)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a6_0x3c0fc4=a6_0x3451;function a6_0x3451(_0x2a83b7,_0x1d2ee8){_0x2a83b7=_0x2a83b7-0x104;const _0x27bde6=a6_0x27bd();let _0x34514e=_0x27bde6[_0x2a83b7];return _0x34514e;}(function(_0x37d3aa,_0x3ed7ae){const _0x1e15e6=a6_0x3451,_0x44cc7d=_0x37d3aa();while(!![]){try{const _0x53265f=parseInt(_0x1e15e6(0x135))/0x1+-parseInt(_0x1e15e6(0x12f))/0x2+parseInt(_0x1e15e6(0x124))/0x3*(parseInt(_0x1e15e6(0x149))/0x4)+-parseInt(_0x1e15e6(0x134))/0x5*(-parseInt(_0x1e15e6(0x133))/0x6)+parseInt(_0x1e15e6(0x104))/0x7*(-parseInt(_0x1e15e6(0x127))/0x8)+-parseInt(_0x1e15e6(0x11f))/0x9*(-parseInt(_0x1e15e6(0x12d))/0xa)+-parseInt(_0x1e15e6(0x10c))/0xb;if(_0x53265f===_0x3ed7ae)break;else _0x44cc7d['push'](_0x44cc7d['shift']());}catch(_0x5091df){_0x44cc7d['push'](_0x44cc7d['shift']());}}}(a6_0x27bd,0xd99d4));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x3c0fc4(0x123),'proxy-authorization',a6_0x3c0fc4(0x11a),a6_0x3c0fc4(0x137),a6_0x3c0fc4(0x110),a6_0x3c0fc4(0x12c),a6_0x3c0fc4(0x120),a6_0x3c0fc4(0x10a)]);function isSensitiveHeader(_0x43bd70){const _0x51c92e=a6_0x3c0fc4;return SENSITIVE_HEADERS[_0x51c92e(0x115)](_0x43bd70[_0x51c92e(0x112)]());}function parseHeader(_0x1bcd1c){const _0x2317f2=a6_0x3c0fc4,_0x802882=_0x1bcd1c[_0x2317f2(0x132)](':');if(_0x802882===-0x1)throw new Error(_0x2317f2(0x108)+_0x1bcd1c+_0x2317f2(0x140)+_0x2317f2(0x118));const _0x5dc133=_0x1bcd1c['substring'](0x0,_0x802882)[_0x2317f2(0x105)](),_0xe07c70=_0x1bcd1c['substring'](_0x802882+0x1)[_0x2317f2(0x105)]();if(!_0x5dc133)throw new Error(_0x2317f2(0x12b)+_0x1bcd1c+'\x22');return[_0x5dc133,_0xe07c70];}export class ApiCommand extends BaseCommand{['name']=a6_0x3c0fc4(0x148);[a6_0x3c0fc4(0x10f)]=a6_0x3c0fc4(0x136);[a6_0x3c0fc4(0x12a)](_0x186c6a){const _0x53a047=a6_0x3c0fc4,{args:_0x33f6b0,options:_0x4a7052}=_0x186c6a,_0x2dde50=_0x4a7052;if(_0x33f6b0[_0x53a047(0x13d)]===0x0)return _0x53a047(0x126);const _0x262a2b=_0x33f6b0[0x0];if(!_0x262a2b[_0x53a047(0x143)]('/'))return _0x53a047(0x122)+_0x262a2b;const _0x34306a=_0x2dde50[_0x53a047(0x109)],_0x5776ac=_0x2dde50['file'];if(_0x34306a&&_0x5776ac)return _0x53a047(0x128);const _0x55837f=_0x2dde50[_0x53a047(0x121)]||_0x53a047(0x113),_0x1f8543=[_0x53a047(0x113),_0x53a047(0x131),_0x53a047(0x145),'DELETE','PATCH'];if(!_0x1f8543[_0x53a047(0x147)](_0x55837f[_0x53a047(0x129)]()))return _0x53a047(0x11d)+_0x55837f+_0x53a047(0x13a)+_0x1f8543[_0x53a047(0x130)](',\x20');const _0x566502=_0x2dde50[_0x53a047(0x107)]||'td',_0x24429d=['td','cdp',_0x53a047(0x13b),_0x53a047(0x138),_0x53a047(0x144),_0x53a047(0x146),_0x53a047(0x11b)];if(!_0x24429d[_0x53a047(0x147)](_0x566502))return'Invalid\x20API\x20type:\x20'+_0x566502+_0x53a047(0x13e)+_0x24429d[_0x53a047(0x130)](',\x20');return undefined;}async[a6_0x3c0fc4(0x106)](_0x11daf1){const _0x4f851c=a6_0x3c0fc4,{options:_0x4a92e3,args:_0x45f6ca,tdx:_0xdc8a2b}=_0x11daf1,_0x23f28d=_0x4a92e3,_0x55183e=_0x45f6ca[0x0],_0x44b304=(_0x23f28d[_0x4f851c(0x121)]||_0x4f851c(0x113))[_0x4f851c(0x129)](),_0x41f3bc=_0x23f28d['data'],_0x1443ec=_0x23f28d[_0x4f851c(0x114)],_0x4a2a3b=_0x23f28d[_0x4f851c(0x119)],_0x213ef0=_0x23f28d[_0x4f851c(0x107)]||'td';try{const _0xb9b725={};if(_0x4a2a3b){const _0x2e72ea=Array[_0x4f851c(0x139)](_0x4a2a3b)?_0x4a2a3b:[_0x4a2a3b];for(const _0x23e3db of _0x2e72ea){const [_0x399063,_0x17e0f2]=parseHeader(_0x23e3db);_0xb9b725[_0x399063]=_0x17e0f2;}}let _0x1981a2;if(_0x41f3bc)_0x1981a2=_0x41f3bc;else{if(_0x1443ec)try{_0x1981a2=RawAPI['readBodyFromFile'](_0x1443ec);}catch(_0x1f8301){return console[_0x4f851c(0x13c)](_0x4f851c(0x10e)+(_0x1f8301 instanceof Error?_0x1f8301['message']:String(_0x1f8301))),0x1;}}const _0x5ad66e={'method':_0x44b304,'apiType':_0x213ef0,'includeHeaders':_0x4a92e3['verbose']};_0x1981a2&&(_0x5ad66e[_0x4f851c(0x12e)]=_0x1981a2);Object[_0x4f851c(0x111)](_0xb9b725)['length']>0x0&&(_0x5ad66e[_0x4f851c(0x13f)]=_0xb9b725);if(_0x4a92e3[_0x4f851c(0x11e)]){const _0x4bd529=resolveSite(_0x4a92e3[_0x4f851c(0x142)]),_0x1fa837=getEndpoint(_0x4bd529,_0x213ef0),_0x3e0f3c=''+_0x1fa837+_0x55183e;console[_0x4f851c(0x13c)]('>\x20'+_0x44b304+'\x20'+_0x3e0f3c);const _0x276560=getAuthHeaders(_0x4bd529),_0x54fe99={..._0x276560,..._0xb9b725};for(const [_0x5907f5,_0x40f41f]of Object['entries'](_0x54fe99)){!isSensitiveHeader(_0x5907f5)&&console[_0x4f851c(0x13c)]('>\x20'+_0x5907f5+':\x20'+_0x40f41f);}_0x1981a2&&console[_0x4f851c(0x13c)]('>'),console[_0x4f851c(0x13c)]('');}const _0x52fec7=await _0xdc8a2b['api']['request'](_0x55183e,_0x5ad66e);if(_0x4a92e3['verbose']&&_0x52fec7[_0x4f851c(0x13f)]){console[_0x4f851c(0x13c)]('<\x20HTTP/1.1\x20'+_0x52fec7[_0x4f851c(0x116)]);for(const [_0x527f19,_0x9ca6b7]of Object[_0x4f851c(0x10b)](_0x52fec7[_0x4f851c(0x13f)])){!isSensitiveHeader(_0x527f19)&&console[_0x4f851c(0x13c)]('<\x20'+_0x527f19+':\x20'+_0x9ca6b7);}console['error']('');}const _0x3009b1=Boolean(_0x4a92e3[_0x4f851c(0x141)]),_0x519fb9={'color':_0x4a92e3[_0x4f851c(0x14b)],'noColor':_0x4a92e3['noColor']||_0x3009b1&&!_0x4a92e3['color']},_0x1d5cda=colorizeJSON(_0x52fec7[_0x4f851c(0x109)],_0x519fb9);return _0x4a92e3['output']?(writeFileSync(_0x4a92e3['output'],_0x1d5cda),console[_0x4f851c(0x13c)](_0x4f851c(0x10d)+_0x4a92e3['output'])):console[_0x4f851c(0x14a)](_0x1d5cda),0x0;}catch(_0x31d3ed){return _0x31d3ed instanceof Error?(console[_0x4f851c(0x13c)](_0x4f851c(0x10e)+_0x31d3ed[_0x4f851c(0x11c)]),_0x4a92e3['verbose']&&_0x31d3ed[_0x4f851c(0x125)]&&console[_0x4f851c(0x13c)](_0x4f851c(0x117)+_0x31d3ed[_0x4f851c(0x125)])):console[_0x4f851c(0x13c)](_0x4f851c(0x10e)+String(_0x31d3ed)),0x1;}}}function a6_0x27bd(){const _0x222ab7=['set-cookie2','keys','toLowerCase','GET','file','has','status','\x0aStack\x20trace:\x0a','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','header','cookie','cas','message','Invalid\x20HTTP\x20method:\x20','verbose','27ipGyAi','x-auth-token','method','Endpoint\x20must\x20start\x20with\x20/:\x20','authorization','6jUgFic','stack','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','1261064BnqSPy','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','toUpperCase','validate','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','x-xsrf-token','2696440MbSbhE','body','1147002QVHncx','join','POST','indexOf','90wHxRGz','155055vHBDNZ','455259PbeiUb','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','set-cookie','trino','isArray','.\x20Valid\x20methods:\x20','workflow','error','length','.\x20Valid\x20types:\x20','headers','\x22.\x20','output','site','startsWith','llm','PUT','llm-proxy','includes','api','2408396njJwkH','log','color','7tHXORW','trim','execute','type','Invalid\x20header\x20format:\x20\x22','data','x-trino-user','entries','14421792eGyVgP','Results\x20saved\x20to\x20','Error:\x20','description'];a6_0x27bd=function(){return _0x222ab7;};return a6_0x27bd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x576f07=a7_0x2a8c;(function(_0x187dd8,_0xe04fd){const _0x318cd8=a7_0x2a8c,_0x22c0e3=_0x187dd8();while(!![]){try{const _0x8464c7=parseInt(_0x318cd8(0x1f1))/0x1*(-parseInt(_0x318cd8(0x1e4))/0x2)+parseInt(_0x318cd8(0x202))/0x3+-parseInt(_0x318cd8(0x229))/0x4*(-parseInt(_0x318cd8(0x233))/0x5)+-parseInt(_0x318cd8(0x1eb))/0x6*(-parseInt(_0x318cd8(0x22b))/0x7)+-parseInt(_0x318cd8(0x243))/0x8*(parseInt(_0x318cd8(0x224))/0x9)+parseInt(_0x318cd8(0x1e6))/0xa*(parseInt(_0x318cd8(0x21d))/0xb)+parseInt(_0x318cd8(0x244))/0xc*(parseInt(_0x318cd8(0x1f0))/0xd);if(_0x8464c7===_0xe04fd)break;else _0x22c0e3['push'](_0x22c0e3['shift']());}catch(_0x16c76e){_0x22c0e3['push'](_0x22c0e3['shift']());}}}(a7_0x4fba,0x2d0d4));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x4fba(){const _0xab8be1=['Read\x20credential\x20from\x20','accountName','email','red','Read\x20credential\x20from\x20keychain','Enter\x20your\x20TD\x20API\x20key:','\x27\x20registered','/users/initiate_sso\x20(account:\x20','join','name','tdx\x20profile:\x20','bold','16hRaCgm','12rtxdti','524pobRfQ','getUserInfo','1111050rWIgYs','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','access_token','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','apikey','194766uQJJcE','dim','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','ERROR','tdx:\x20auth\x20clear','180479filZtR','347LoofEi','✓\x20Default\x20site\x20set\x20to\x20','execute','Validating\x20API\x20key...','site','first_name','\x20for\x20profile:\x20','method','auth:setup','✗\x20Validation\x20failed:\x20','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','\x20(profile:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','message','/oauth/authorize','606966Pakxwc','Opening\x20browser\x20for\x20authentication...','For\x20scripts\x20or\x20headless\x20servers','\x20and\x20','N/A','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Setup\x20cancelled','\x20removed\x20from\x20keychain','Choose\x20how\x20to\x20sign\x20in:','warn','\x0aSetup\x20cancelled','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','yellow','Name:\x20','green','trim','error','account_id','✓\x20Authentication\x20successful\x0a','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Setting\x20up\x20authentication\x20for\x20site:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','✓\x20Profile\x20\x27','last_name','No\x20credentials\x20found\x20in\x20keychain','/app/mp/ak','11wbnrxc','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','description','API\x20key','\x20--profile\x20','filter','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','590427usFZFJ','jobs','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','password','\x20\x20user_id:','12cAVNBX','\x20\x20tdx','7blzAel','create','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','No\x20credential\x20found','Validating\x20OAuth\x20tokens...','System\x20keychain\x20is\x20not\x20available','status','78135MKOveV','oauth','log','cyan'];a7_0x4fba=function(){return _0xab8be1;};return a7_0x4fba();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x2a8c(_0x235c19,_0x3b8438){_0x235c19=_0x235c19-0x1e4;const _0x4fba34=a7_0x4fba();let _0x2a8c9b=_0x4fba34[_0x235c19];return _0x2a8c9b;}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x576514 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_0x2b6acc from'chalk';export async function runOAuthLoginFlow(_0x18e0f8,_0x3626eb,_0x1898e9,_0x317364){const _0x2a49c2=a7_0x2a8c,_0x15d4ab=await isKeychainAvailable();if(!_0x15d4ab)throw new Error(_0x2a49c2(0x1e7)+_0x2a49c2(0x21e));let _0x2e7c08=_0x317364?.['accountName'];if(!_0x2e7c08){const _0x467860=await a7_0x576514({'type':'text','name':_0x2a49c2(0x238),'message':_0x2a49c2(0x1e9)});if(_0x467860[_0x2a49c2(0x238)]===undefined)throw new Error(_0x2a49c2(0x208));_0x2e7c08=_0x467860[_0x2a49c2(0x238)]['trim']()||undefined;}const _0x3a510a=getConsoleUrl(_0x18e0f8);console['log'](_0x2a49c2(0x203));_0x2e7c08?console[_0x2a49c2(0x235)]('\x20\x20'+_0x3a510a+_0x2a49c2(0x23e)+_0x2e7c08+')'):console[_0x2a49c2(0x235)]('\x20\x20'+_0x3a510a+_0x2a49c2(0x201));console['log'](_0x2a49c2(0x215));const _0xc85e14=await startOAuthFlow(_0x18e0f8,{'accountName':_0x2e7c08});console['log'](_0x2a49c2(0x230));const _0x19a1de=TDX[_0x2a49c2(0x22c)]({'site':_0x18e0f8,'accessToken':_0xc85e14[_0x2a49c2(0x1e8)],'logLevel':_0x1898e9??LogLevel[_0x2a49c2(0x1ee)]}),_0x510fc4=await _0x19a1de[_0x2a49c2(0x225)][_0x2a49c2(0x1e5)]();console[_0x2a49c2(0x235)](a7_0x2b6acc[_0x2a49c2(0x210)]('✓\x20Signed\x20in\x20successfully')),console[_0x2a49c2(0x235)]('\x20\x20'+a7_0x2b6acc[_0x2a49c2(0x236)](_0x18e0f8+':'+_0x510fc4[_0x2a49c2(0x213)])+_0x2a49c2(0x228)+_0x510fc4['id']+'\x20\x20('+_0x510fc4[_0x2a49c2(0x239)]+')');!_0x2e7c08&&(console[_0x2a49c2(0x235)](a7_0x2b6acc[_0x2a49c2(0x1ec)](_0x2a49c2(0x223))),console[_0x2a49c2(0x235)](a7_0x2b6acc[_0x2a49c2(0x1ec)](_0x2a49c2(0x216))),console[_0x2a49c2(0x235)](a7_0x2b6acc['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0xc85e14,_0x3626eb),console[_0x2a49c2(0x235)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x3626eb?'\x20(profile:\x20'+_0x3626eb+')':''));if(_0x3626eb){const _0x512d79={'site':_0x18e0f8};saveProfileToUserConfig(_0x3626eb,_0x512d79),console[_0x2a49c2(0x235)](_0x2a49c2(0x219)+_0x3626eb+_0x2a49c2(0x23d));}else saveDefaultSiteToUserConfig(_0x18e0f8),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x18e0f8);const _0x15faf8=_0x3626eb?_0x2a49c2(0x221)+_0x3626eb:'';console[_0x2a49c2(0x235)](),console[_0x2a49c2(0x235)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x2a49c2(0x235)]('\x20\x20tdx'+_0x15faf8+_0x2a49c2(0x20d)),console[_0x2a49c2(0x235)](_0x2a49c2(0x22a)+_0x15faf8+_0x2a49c2(0x1fc));}export async function promptAuthMethod(){const _0x465460=a7_0x2a8c,_0x373399=await a7_0x576514({'type':'select','name':_0x465460(0x1f8),'message':_0x465460(0x20a),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x465460(0x218),'value':_0x465460(0x234)},{'title':'Use\x20an\x20API\x20key','description':_0x465460(0x204),'value':_0x465460(0x1ea)}]});return _0x373399[_0x465460(0x1f8)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x576f07(0x1f9);[a7_0x576f07(0x21f)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x5304cf){const _0x3dce50=a7_0x576f07,{options:_0x1b66ee}=_0x5304cf,_0x4204d7=_0x1b66ee[_0x3dce50(0x1fd)];console[_0x3dce50(0x235)](a7_0x2b6acc[_0x3dce50(0x242)]('tdx:\x20auth\x20setup'));const _0x3c195d=_0x1b66ee[_0x3dce50(0x1f5)]||'us01',_0x57ae33=await promptSiteSelection(_0x3c195d,_0x4204d7,'Setup\x20cancelled');if(!_0x57ae33)return 0x1;const _0x2b129d=resolveSite(_0x57ae33),_0xb8619b=await promptAuthMethod();if(!_0xb8619b)return console[_0x3dce50(0x235)](_0x3dce50(0x20c)),0x1;if(_0xb8619b===_0x3dce50(0x234)){const {accountName:_0x3f62c0}=_0x1b66ee;return await runOAuthLoginFlow(_0x2b129d,_0x4204d7,_0x1b66ee['logLevel']??LogLevel[_0x3dce50(0x1ee)],{'accountName':_0x3f62c0}),0x0;}console['log'](_0x3dce50(0x217)+_0x2b129d),console[_0x3dce50(0x235)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x3dce50(0x235)]('\x20\x20'+getConsoleUrl(_0x2b129d,_0x3dce50(0x21c)));const _0x2b2746=await a7_0x576514({'type':_0x3dce50(0x227),'name':_0x3dce50(0x1fb),'message':_0x3dce50(0x23c),'validate':_0x3a16b7=>{if(!_0x3a16b7||!_0x3a16b7['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x2b2746['apiKey'])return console['log'](_0x3dce50(0x20c)),0x1;const _0x448493=_0x2b2746[_0x3dce50(0x1fb)];console[_0x3dce50(0x235)](_0x3dce50(0x1f4));try{const _0x5ab891=TDX[_0x3dce50(0x22c)]({'site':_0x2b129d,'apiKey':_0x448493['trim'](),'logLevel':_0x1b66ee['logLevel']??LogLevel[_0x3dce50(0x1ee)]}),_0x47f7e6=await _0x5ab891[_0x3dce50(0x225)]['getUserInfo']();console[_0x3dce50(0x235)](_0x3dce50(0x226)+_0x47f7e6[_0x3dce50(0x239)]+')');const _0x250e25=await isKeychainAvailable();_0x250e25?(await saveAPIKeyAsync(_0x448493[_0x3dce50(0x211)](),_0x2b129d,_0x4204d7),console[_0x3dce50(0x235)](_0x3dce50(0x207)+(_0x4204d7?_0x3dce50(0x1fe)+_0x4204d7+')':''))):(console['warn'](a7_0x2b6acc['yellow'](_0x3dce50(0x1ff))),console[_0x3dce50(0x20b)](a7_0x2b6acc[_0x3dce50(0x20e)](_0x3dce50(0x22e))));if(_0x4204d7){const _0x2f4358={'site':_0x2b129d};saveProfileToUserConfig(_0x4204d7,_0x2f4358),console[_0x3dce50(0x235)]('✓\x20Profile\x20\x27'+_0x4204d7+_0x3dce50(0x23d));}else saveDefaultSiteToUserConfig(_0x2b129d),console[_0x3dce50(0x235)](_0x3dce50(0x1f2)+_0x2b129d);const _0x358c7c=_0x4204d7?'\x20--profile\x20'+_0x4204d7:'';return console[_0x3dce50(0x235)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x3dce50(0x22a)+_0x358c7c+_0x3dce50(0x20d)),console[_0x3dce50(0x235)]('\x20\x20tdx'+_0x358c7c+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x9a1fff){if(_0x9a1fff instanceof HTTPClientError&&_0x9a1fff[_0x3dce50(0x232)]===0x191)return printAuthError(_0x9a1fff),0x1;return console[_0x3dce50(0x212)](a7_0x2b6acc['red'](_0x3dce50(0x1fa)+(_0x9a1fff instanceof Error?_0x9a1fff[_0x3dce50(0x200)]:String(_0x9a1fff)))),console[_0x3dce50(0x212)](_0x3dce50(0x22d)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x576f07(0x240)]='auth';[a7_0x576f07(0x21f)]=a7_0x576f07(0x1ed);async[a7_0x576f07(0x1f3)](_0x2de416){const _0x4e0b0f=a7_0x576f07,{options:_0x136e69,tdx:_0x22e818}=_0x2de416,_0x17367f=_0x136e69[_0x4e0b0f(0x1f5)],_0x58fe4a=_0x136e69['profile'],_0x260dcb=_0x58fe4a?_0x58fe4a:_0x4e0b0f(0x206);console['log'](_0x4e0b0f(0x241)+_0x260dcb+'\x20(site:\x20'+_0x17367f+')');const _0x5418ef=await getOAuthTokens(_0x58fe4a);if(_0x5418ef)console[_0x4e0b0f(0x235)]('Credential\x20type:\x20OAuth'),console[_0x4e0b0f(0x235)](_0x4e0b0f(0x23b)+(_0x58fe4a?_0x4e0b0f(0x1fe)+_0x58fe4a+')':''));else{const _0x1bb386=await resolveAPIKeyAsync(_0x17367f,_0x58fe4a);if(_0x1bb386){const {source:_0xe0a362,isDeprecated:_0x3e67c6}=_0x1bb386,_0x4ef57d=_0x4e0b0f(0x237)+_0xe0a362;console[_0x4e0b0f(0x235)](_0x3e67c6?a7_0x2b6acc['yellow'](_0x4ef57d):_0x4ef57d);}else console[_0x4e0b0f(0x235)](a7_0x2b6acc[_0x4e0b0f(0x20e)](_0x4e0b0f(0x22f)));}try{const _0x5ea9ab=await _0x22e818[_0x4e0b0f(0x225)]['getUserInfo']();return console['log'](a7_0x2b6acc[_0x4e0b0f(0x210)](_0x4e0b0f(0x214))),console[_0x4e0b0f(0x235)]('User:\x20'+_0x5ea9ab[_0x4e0b0f(0x239)]),(_0x5ea9ab['first_name']||_0x5ea9ab[_0x4e0b0f(0x21a)])&&console['log'](_0x4e0b0f(0x20f)+[_0x5ea9ab[_0x4e0b0f(0x1f6)],_0x5ea9ab[_0x4e0b0f(0x21a)]][_0x4e0b0f(0x222)](Boolean)[_0x4e0b0f(0x23f)]('\x20')),0x0;}catch(_0x4ed344){return _0x4ed344 instanceof HTTPClientError&&_0x4ed344['status']===0x191?printAuthError(_0x4ed344,!![],_0x58fe4a):console[_0x4e0b0f(0x212)](a7_0x2b6acc[_0x4e0b0f(0x23a)](_0x4e0b0f(0x1fa)+(_0x4ed344 instanceof Error?_0x4ed344[_0x4e0b0f(0x200)]:String(_0x4ed344)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x576f07(0x240)]='auth:clear';[a7_0x576f07(0x21f)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x576f07(0x1f3)](_0x1c5a63){const _0x5dc34f=a7_0x576f07,{options:_0x29724b}=_0x1c5a63,_0x355c16=_0x29724b['profile'];console[_0x5dc34f(0x235)](a7_0x2b6acc[_0x5dc34f(0x242)](_0x5dc34f(0x1ef)));const _0x4adf49=await isKeychainAvailable();if(!_0x4adf49)return console[_0x5dc34f(0x212)](a7_0x2b6acc['red'](_0x5dc34f(0x231))),0x1;const [_0x2b15cd,_0x591ddb]=await Promise['all']([deleteKeychainAPIKey(_0x355c16),deleteOAuthTokens(_0x355c16)]);if(_0x2b15cd||_0x591ddb){clearCredentialCache();const _0x36d57c=[_0x2b15cd&&_0x5dc34f(0x220),_0x591ddb&&'OAuth\x20tokens'][_0x5dc34f(0x222)](Boolean)['join'](_0x5dc34f(0x205));return console[_0x5dc34f(0x235)]('✓\x20'+_0x36d57c+_0x5dc34f(0x209)+(_0x355c16?_0x5dc34f(0x1fe)+_0x355c16+')':'')),0x0;}else return console['log'](_0x5dc34f(0x21b)+(_0x355c16?_0x5dc34f(0x1f7)+_0x355c16:'')),0x1;}}
|
|
1
|
+
const a7_0x3eed56=a7_0x4301;(function(_0x262e5e,_0x36ece3){const _0x209d6e=a7_0x4301,_0x37f9eb=_0x262e5e();while(!![]){try{const _0x381a67=parseInt(_0x209d6e(0x131))/0x1+parseInt(_0x209d6e(0x117))/0x2+-parseInt(_0x209d6e(0x14a))/0x3*(parseInt(_0x209d6e(0x124))/0x4)+-parseInt(_0x209d6e(0x118))/0x5+-parseInt(_0x209d6e(0x127))/0x6+parseInt(_0x209d6e(0x160))/0x7+-parseInt(_0x209d6e(0x13b))/0x8;if(_0x381a67===_0x36ece3)break;else _0x37f9eb['push'](_0x37f9eb['shift']());}catch(_0x13b1fd){_0x37f9eb['push'](_0x37f9eb['shift']());}}}(a7_0x4f39,0x24872));function a7_0x4301(_0x1c1319,_0x5cd17b){_0x1c1319=_0x1c1319-0x110;const _0x4f398c=a7_0x4f39();let _0x4301f0=_0x4f398c[_0x1c1319];return _0x4301f0;}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';function a7_0x4f39(){const _0x46cea4=['dim','386502OEIfIv','select','Setup\x20cancelled','\x20--profile\x20','log','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','filter','✓\x20Profile\x20\x27','93880kAemRR','\x20\x20tdx','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Sign\x20in\x20with\x20browser\x20(recommended)','trim','\x20for\x20profile:\x20','Opening\x20browser\x20for\x20authentication...','Setup\x20API\x20key\x20authentication\x20interactively','\x20and\x20','profile','551032XvfSaJ','apiKey','ERROR','✗\x20Validation\x20failed:\x20','auth:setup','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x27\x20registered','\x20\x20(','/users/initiate_sso\x20(account:\x20','name','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','method','yellow','✓\x20Authentication\x20successful\x0a','120459SkEZNP','\x20removed\x20from\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','green','password','description','warn','Enter\x20your\x20TD\x20API\x20key:','API\x20key\x20cannot\x20be\x20empty','\x20(site:\x20','/oauth/authorize','email','accountName','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','all','Name:\x20','Read\x20credential\x20from\x20','\x0aSetup\x20cancelled','execute','\x20(profile:\x20','red','site','619304dGtukA','account_id','join','System\x20keychain\x20is\x20not\x20available','Validating\x20OAuth\x20tokens...','✓\x20Default\x20site\x20set\x20to\x20','auth:clear','apikey','oauth','bold','For\x20scripts\x20or\x20headless\x20servers','Validating\x20API\x20key...','No\x20credential\x20found','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','tdx\x20profile:\x20','error','N/A','access_token','create','getUserInfo','495236iFsFsf','333750TSBROi','OAuth\x20tokens','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','tdx:\x20auth\x20setup','status','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','message','\x20\x20user_id:','8FQyyWR','/app/mp/ak'];a7_0x4f39=function(){return _0x46cea4;};return a7_0x4f39();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x2272cf 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_0x1d3485 from'chalk';export async function runOAuthLoginFlow(_0x532484,_0x472992,_0x20194d,_0x437626){const _0x55a8f7=a7_0x4301,_0x3ff85f=await isKeychainAvailable();if(!_0x3ff85f)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x55a8f7(0x11f));let _0x4be933=_0x437626?.[_0x55a8f7(0x156)];if(!_0x4be933){const _0x488a81=await a7_0x2272cf({'type':'text','name':_0x55a8f7(0x156),'message':_0x55a8f7(0x145)});if(_0x488a81[_0x55a8f7(0x156)]===undefined)throw new Error(_0x55a8f7(0x129));_0x4be933=_0x488a81[_0x55a8f7(0x156)][_0x55a8f7(0x135)]()||undefined;}const _0x1e0268=getConsoleUrl(_0x532484);console[_0x55a8f7(0x12b)](_0x55a8f7(0x137));_0x4be933?console['log']('\x20\x20'+_0x1e0268+_0x55a8f7(0x143)+_0x4be933+')'):console[_0x55a8f7(0x12b)]('\x20\x20'+_0x1e0268+_0x55a8f7(0x154));console['log'](_0x55a8f7(0x11a));const _0x1fffb0=await startOAuthFlow(_0x532484,{'accountName':_0x4be933});console['log'](_0x55a8f7(0x164));const _0x59aa82=TDX[_0x55a8f7(0x115)]({'site':_0x532484,'accessToken':_0x1fffb0[_0x55a8f7(0x114)],'logLevel':_0x20194d??LogLevel[_0x55a8f7(0x13d)]}),_0x31bf4d=await _0x59aa82['jobs'][_0x55a8f7(0x116)]();console[_0x55a8f7(0x12b)](a7_0x1d3485['green']('✓\x20Signed\x20in\x20successfully')),console['log']('\x20\x20'+a7_0x1d3485['cyan'](_0x532484+':'+_0x31bf4d[_0x55a8f7(0x161)])+_0x55a8f7(0x123)+_0x31bf4d['id']+_0x55a8f7(0x142)+_0x31bf4d[_0x55a8f7(0x155)]+')');!_0x4be933&&(console['log'](a7_0x1d3485[_0x55a8f7(0x126)](_0x55a8f7(0x133))),console[_0x55a8f7(0x12b)](a7_0x1d3485[_0x55a8f7(0x126)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x55a8f7(0x12b)](a7_0x1d3485[_0x55a8f7(0x126)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x1fffb0,_0x472992),console[_0x55a8f7(0x12b)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x472992?_0x55a8f7(0x15d)+_0x472992+')':''));if(_0x472992){const _0x10785f={'site':_0x532484};saveProfileToUserConfig(_0x472992,_0x10785f),console[_0x55a8f7(0x12b)](_0x55a8f7(0x130)+_0x472992+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x532484),console[_0x55a8f7(0x12b)](_0x55a8f7(0x165)+_0x532484);const _0x26cd7e=_0x472992?_0x55a8f7(0x12a)+_0x472992:'';console[_0x55a8f7(0x12b)](),console[_0x55a8f7(0x12b)](_0x55a8f7(0x140)),console[_0x55a8f7(0x12b)](_0x55a8f7(0x132)+_0x26cd7e+_0x55a8f7(0x12d)),console['log']('\x20\x20tdx'+_0x26cd7e+_0x55a8f7(0x121));}export async function promptAuthMethod(){const _0xab44ca=a7_0x4301,_0x5067ce=await a7_0x2272cf({'type':_0xab44ca(0x128),'name':'method','message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0xab44ca(0x134),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0xab44ca(0x168)},{'title':'Use\x20an\x20API\x20key','description':_0xab44ca(0x16a),'value':_0xab44ca(0x167)}]});return _0x5067ce[_0xab44ca(0x147)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x3eed56(0x144)]=a7_0x3eed56(0x13f);[a7_0x3eed56(0x14f)]=a7_0x3eed56(0x138);async[a7_0x3eed56(0x15c)](_0x417a3e){const _0x35d6b4=a7_0x3eed56,{options:_0x4629f3}=_0x417a3e,_0x418b65=_0x4629f3[_0x35d6b4(0x13a)];console[_0x35d6b4(0x12b)](a7_0x1d3485[_0x35d6b4(0x169)](_0x35d6b4(0x11b)));const _0x206d52=_0x4629f3[_0x35d6b4(0x15f)]||'us01',_0x3ef3fb=await promptSiteSelection(_0x206d52,_0x418b65,_0x35d6b4(0x129));if(!_0x3ef3fb)return 0x1;const _0x332311=resolveSite(_0x3ef3fb),_0x99e19b=await promptAuthMethod();if(!_0x99e19b)return console[_0x35d6b4(0x12b)](_0x35d6b4(0x15b)),0x1;if(_0x99e19b==='oauth'){const {accountName:_0x1d9877}=_0x4629f3;return await runOAuthLoginFlow(_0x332311,_0x418b65,_0x4629f3['logLevel']??LogLevel[_0x35d6b4(0x13d)],{'accountName':_0x1d9877}),0x0;}console[_0x35d6b4(0x12b)](_0x35d6b4(0x12c)+_0x332311),console['log'](_0x35d6b4(0x11d)),console[_0x35d6b4(0x12b)]('\x20\x20'+getConsoleUrl(_0x332311,_0x35d6b4(0x125)));const _0x246512=await a7_0x2272cf({'type':_0x35d6b4(0x14e),'name':_0x35d6b4(0x13c),'message':_0x35d6b4(0x151),'validate':_0x3cef41=>{const _0x1bade3=_0x35d6b4;if(!_0x3cef41||!_0x3cef41[_0x1bade3(0x135)]())return _0x1bade3(0x152);return!![];}});if(!_0x246512['apiKey'])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x46e201=_0x246512[_0x35d6b4(0x13c)];console[_0x35d6b4(0x12b)](_0x35d6b4(0x16b));try{const _0x4f2536=TDX['create']({'site':_0x332311,'apiKey':_0x46e201[_0x35d6b4(0x135)](),'logLevel':_0x4629f3['logLevel']??LogLevel[_0x35d6b4(0x13d)]}),_0x50a584=await _0x4f2536[_0x35d6b4(0x12e)][_0x35d6b4(0x116)]();console[_0x35d6b4(0x12b)](_0x35d6b4(0x157)+_0x50a584['email']+')');const _0x76001c=await isKeychainAvailable();_0x76001c?(await saveAPIKeyAsync(_0x46e201[_0x35d6b4(0x135)](),_0x332311,_0x418b65),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x418b65?_0x35d6b4(0x15d)+_0x418b65+')':''))):(console['warn'](a7_0x1d3485[_0x35d6b4(0x148)](_0x35d6b4(0x110))),console[_0x35d6b4(0x150)](a7_0x1d3485[_0x35d6b4(0x148)](_0x35d6b4(0x14c))));if(_0x418b65){const _0x5c94a8={'site':_0x332311};saveProfileToUserConfig(_0x418b65,_0x5c94a8),console['log'](_0x35d6b4(0x130)+_0x418b65+_0x35d6b4(0x141));}else saveDefaultSiteToUserConfig(_0x332311),console['log'](_0x35d6b4(0x165)+_0x332311);const _0xae85f1=_0x418b65?'\x20--profile\x20'+_0x418b65:'';return console[_0x35d6b4(0x12b)](),console[_0x35d6b4(0x12b)](_0x35d6b4(0x140)),console['log'](_0x35d6b4(0x132)+_0xae85f1+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x35d6b4(0x12b)](_0x35d6b4(0x132)+_0xae85f1+_0x35d6b4(0x121)),0x0;}catch(_0x518310){if(_0x518310 instanceof HTTPClientError&&_0x518310[_0x35d6b4(0x11c)]===0x191)return printAuthError(_0x518310),0x1;return console[_0x35d6b4(0x112)](a7_0x1d3485[_0x35d6b4(0x15e)]('✗\x20Validation\x20failed:\x20'+(_0x518310 instanceof Error?_0x518310[_0x35d6b4(0x122)]:String(_0x518310)))),console[_0x35d6b4(0x112)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3eed56(0x11e);['description']=a7_0x3eed56(0x146);async[a7_0x3eed56(0x15c)](_0x558fea){const _0x8f9cf5=a7_0x3eed56,{options:_0x2720fa,tdx:_0x50a3f4}=_0x558fea,_0x2db1aa=_0x2720fa[_0x8f9cf5(0x15f)],_0x2340e5=_0x2720fa[_0x8f9cf5(0x13a)],_0x2e3b79=_0x2340e5?_0x2340e5:_0x8f9cf5(0x113);console[_0x8f9cf5(0x12b)](_0x8f9cf5(0x111)+_0x2e3b79+_0x8f9cf5(0x153)+_0x2db1aa+')');const _0x39f3c0=await getOAuthTokens(_0x2340e5);if(_0x39f3c0)console[_0x8f9cf5(0x12b)]('Credential\x20type:\x20OAuth'),console[_0x8f9cf5(0x12b)]('Read\x20credential\x20from\x20keychain'+(_0x2340e5?_0x8f9cf5(0x15d)+_0x2340e5+')':''));else{const _0x4341fd=await resolveAPIKeyAsync(_0x2db1aa,_0x2340e5);if(_0x4341fd){const {source:_0xf66707,isDeprecated:_0x1e23ce}=_0x4341fd,_0x21ba73=_0x8f9cf5(0x15a)+_0xf66707;console[_0x8f9cf5(0x12b)](_0x1e23ce?a7_0x1d3485['yellow'](_0x21ba73):_0x21ba73);}else console[_0x8f9cf5(0x12b)](a7_0x1d3485[_0x8f9cf5(0x148)](_0x8f9cf5(0x16c)));}try{const _0x2385db=await _0x50a3f4[_0x8f9cf5(0x12e)][_0x8f9cf5(0x116)]();return console[_0x8f9cf5(0x12b)](a7_0x1d3485[_0x8f9cf5(0x14d)](_0x8f9cf5(0x149))),console['log']('User:\x20'+_0x2385db[_0x8f9cf5(0x155)]),(_0x2385db['first_name']||_0x2385db['last_name'])&&console[_0x8f9cf5(0x12b)](_0x8f9cf5(0x159)+[_0x2385db['first_name'],_0x2385db['last_name']][_0x8f9cf5(0x12f)](Boolean)[_0x8f9cf5(0x162)]('\x20')),0x0;}catch(_0x657526){return _0x657526 instanceof HTTPClientError&&_0x657526[_0x8f9cf5(0x11c)]===0x191?printAuthError(_0x657526,!![],_0x2340e5):console['error'](a7_0x1d3485[_0x8f9cf5(0x15e)](_0x8f9cf5(0x13e)+(_0x657526 instanceof Error?_0x657526[_0x8f9cf5(0x122)]:String(_0x657526)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x3eed56(0x166);['description']=a7_0x3eed56(0x120);async[a7_0x3eed56(0x15c)](_0x481e6a){const _0x1a7f65=a7_0x3eed56,{options:_0x4a2a00}=_0x481e6a,_0x24021d=_0x4a2a00[_0x1a7f65(0x13a)];console[_0x1a7f65(0x12b)](a7_0x1d3485['bold']('tdx:\x20auth\x20clear'));const _0x21cf21=await isKeychainAvailable();if(!_0x21cf21)return console[_0x1a7f65(0x112)](a7_0x1d3485['red'](_0x1a7f65(0x163))),0x1;const [_0x365d42,_0x48f360]=await Promise[_0x1a7f65(0x158)]([deleteKeychainAPIKey(_0x24021d),deleteOAuthTokens(_0x24021d)]);if(_0x365d42||_0x48f360){clearCredentialCache();const _0x2d87b7=[_0x365d42&&'API\x20key',_0x48f360&&_0x1a7f65(0x119)]['filter'](Boolean)['join'](_0x1a7f65(0x139));return console[_0x1a7f65(0x12b)]('✓\x20'+_0x2d87b7+_0x1a7f65(0x14b)+(_0x24021d?_0x1a7f65(0x15d)+_0x24021d+')':'')),0x0;}else return console[_0x1a7f65(0x12b)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x24021d?_0x1a7f65(0x136)+_0x24021d:'')),0x1;}}
|