@treasuredata/tdx 2026.7.0 → 2026.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/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.d.ts +1 -0
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x3e3e25=a3_0x1419;(function(_0x54c818,_0x4ef6de){const _0x39e069=a3_0x1419,_0xa51cdb=_0x54c818();while(!![]){try{const _0x1b96db=-parseInt(_0x39e069(0x134))/0x1*(parseInt(_0x39e069(0x13a))/0x2)+-parseInt(_0x39e069(0x137))/0x3+parseInt(_0x39e069(0x12a))/0x4*(-parseInt(_0x39e069(0x13f))/0x5)+parseInt(_0x39e069(0x139))/0x6*(parseInt(_0x39e069(0x123))/0x7)+parseInt(_0x39e069(0x13c))/0x8*(-parseInt(_0x39e069(0x129))/0x9)+parseInt(_0x39e069(0x135))/0xa+parseInt(_0x39e069(0x136))/0xb*(parseInt(_0x39e069(0x12f))/0xc);if(_0x1b96db===_0x4ef6de)break;else _0xa51cdb['push'](_0xa51cdb['shift']());}catch(_0x5cebab){_0xa51cdb['push'](_0xa51cdb['shift']());}}}(a3_0x1cb5,0x50119));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x1cb5(){const _0x3a876a=['activations','236215ZoejQf','\x27...','error','Resolving\x20parent\x20segment\x20\x27','\x20\x20Cause:\x20','Error:\x20','verbose','segment','message','listActivations','data','1404823RTgLen','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolving\x20child\x20segment\x20\x27','site','Child\x20name:\x20','Parent\x20name:\x20','102663pHjIcf','48BABVFK','cause','resolveSegmentId','Site:\x20','name','29820AXDMfK','Resolved\x20parent\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','\x20activation','8430TrYdlj','6277760jIxLog','3773HUxgUB','1040775jJQvwX','length','12nSMZsa','122BNQFCT','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','88vkivnr','Resolved\x20child\x20ID:\x20'];a3_0x1cb5=function(){return _0x3a876a;};return a3_0x1cb5();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x1419(_0x242a58,_0x1e472d){_0x242a58=_0x242a58-0x123;const _0x1cb537=a3_0x1cb5();let _0x14190a=_0x1cb537[_0x242a58];return _0x14190a;}export class ActivationsCommand extends BaseCommand{[a3_0x3e3e25(0x12e)]=a3_0x3e3e25(0x13e);['description']='List\x20activations\x20for\x20a\x20segment';async['execute'](_0x5e45a1){const _0x3e521f=a3_0x3e3e25,{options:_0x695f28,args:_0x423b9d,tdx:_0x3900ba}=_0x5e45a1;if(_0x423b9d[_0x3e521f(0x138)]===0x0)return console['error'](_0x3e521f(0x132)),console[_0x3e521f(0x141)](_0x3e521f(0x124)),0x1;try{const {parentId:_0x19077b,childId:_0x37bd3c}=parseSegmentRef(_0x423b9d[0x0]);if(!_0x37bd3c)return console[_0x3e521f(0x141)](_0x3e521f(0x13b)),console[_0x3e521f(0x141)](_0x3e521f(0x124)),0x1;_0x695f28[_0x3e521f(0x145)]&&(console['error'](_0x3e521f(0x12d)+_0x695f28[_0x3e521f(0x126)]),console[_0x3e521f(0x141)](_0x3e521f(0x128)+_0x19077b),console[_0x3e521f(0x141)](_0x3e521f(0x127)+_0x37bd3c));const _0x31e4e2=await withSpinner(_0x3e521f(0x142)+_0x19077b+_0x3e521f(0x140),()=>_0x3900ba[_0x3e521f(0x146)]['resolveParentId'](_0x19077b),{'verbose':_0x695f28[_0x3e521f(0x145)]}),_0x423b8f=_0x31e4e2['data'];_0x695f28[_0x3e521f(0x145)]&&console[_0x3e521f(0x141)](_0x3e521f(0x130)+_0x423b8f);const _0x323395=await withSpinner(_0x3e521f(0x125)+_0x37bd3c+_0x3e521f(0x140),()=>_0x3900ba[_0x3e521f(0x146)][_0x3e521f(0x12c)](_0x423b8f,_0x37bd3c),{'verbose':_0x695f28[_0x3e521f(0x145)]}),_0x654736=_0x323395[_0x3e521f(0x149)];_0x695f28[_0x3e521f(0x145)]&&console[_0x3e521f(0x141)](_0x3e521f(0x13d)+_0x654736);const _0x125b3f=await withSpinner(_0x3e521f(0x131)+_0x37bd3c+'\x27...',()=>_0x3900ba[_0x3e521f(0x146)][_0x3e521f(0x148)](_0x423b8f,_0x654736),{'verbose':_0x695f28[_0x3e521f(0x145)]}),_0x4427da=_0x125b3f[_0x3e521f(0x149)];return console['error']('✔\x20Found\x20'+_0x4427da[_0x3e521f(0x138)]+_0x3e521f(0x133)+(_0x4427da[_0x3e521f(0x138)]!==0x1?'s':'')),await handleSDKOutput(_0x4427da,_0x695f28),0x0;}catch(_0x222d3d){if(_0x222d3d instanceof SDKError)return console[_0x3e521f(0x141)](_0x3e521f(0x144)+_0x222d3d[_0x3e521f(0x147)]),_0x222d3d[_0x3e521f(0x12b)]&&console['error'](_0x3e521f(0x143)+_0x222d3d[_0x3e521f(0x12b)]),0x1;throw _0x222d3d;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x4c125e=a4_0x2cd7;(function(_0x904995,_0x550a62){const _0x574409=a4_0x2cd7,_0x10a9b6=_0x904995();while(!![]){try{const _0x2bd82d=parseInt(_0x574409(0x1fa))/0x1+-parseInt(_0x574409(0x1a1))/0x2+parseInt(_0x574409(0x1b9))/0x3+parseInt(_0x574409(0x19b))/0x4*(-parseInt(_0x574409(0x1b4))/0x5)+parseInt(_0x574409(0x1d0))/0x6*(-parseInt(_0x574409(0x23f))/0x7)+-parseInt(_0x574409(0x1c6))/0x8+-parseInt(_0x574409(0x1bc))/0x9*(-parseInt(_0x574409(0x24d))/0xa);if(_0x2bd82d===_0x550a62)break;else _0x10a9b6['push'](_0x10a9b6['shift']());}catch(_0x1f339a){_0x10a9b6['push'](_0x10a9b6['shift']());}}}(a4_0x2f3d,0x3202b));function a4_0x2f3d(){const _0x1e0294=['\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','llm_project','created','action','New\x20project\x20ID:\x20','60zaBahN','<new-name>','llmProject','\x20\x20Chat\x20Interface\x20\x22','\x20unchanged','profile','559612rXzOWh','Would\x20clone:','\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','\x0aPush\x20','isNew','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)','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','cyan','source','agent.yml','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20\x20Agents:\x20','yellow','unchanged','\x0aPull\x20summary\x20for\x20\x27','Cancelled','parse','84135vkUUpb','\x0aChanges\x20to\x20agent\x20\x27','MISSING_ARGUMENT','\x20successfully','Chat:\x20','1064325HGcJQi','\x20\x20Form\x20Interface\x20\x22','agentName','99ytFiIz','newProjectId','experimentalKnowledgeBases','agent:push','formInterfaces','cwd','\x0a✔\x20Pushed\x20','Project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Pushing\x20to\x20project...','3202664vMjjMs','-\x20no\x20files\x20written','\x20\x20Integration\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Agent:\x20','repeat','no_context','log','llm','Analyzing\x20project\x20\x22','1577802UNMxrA','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','push','\x20\x20tdx\x20agent\x20clone\x20agents/','green','\x0aError:','output','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aWrite\x20','Errors:','\x22\x20to\x20a\x20different\x20profile','utf-8','Using\x20project\x20from\x20','Using\x20context\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullProject','\x20\x20Knowledge\x20Base\x20\x22','\x20updated','agentId','tdx.json','Agent\x20pulled\x20successfully','gray','cwd-config','Would\x20pull\x20agent:\x20','knowledgeBases','Writing\x20files...','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','outputPath','experimentalArtifacts','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','agent','Clone\x20\x22','\x20resources\x20to\x20\x27','Agent\x20','Pulling\x20agent\x20\x22','\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','\x20errors','New\x20project:\x20','reason','244746RFeTrW','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','agent:clone','\x20\x20Text\x20Knowledge\x20Bases:\x20','newProjectName','\x20changed','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Would\x20push\x20agent:\x20','INVALID_ARGUMENT','pushAgent','cloneProject','arg-dir','Cloning\x20\x22','projectId','\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','dirname','join','\x0aProject\x20pushed\x20with\x20errors','updated','\x20|\x20','total','\x20\x20Experimental\x20Artifacts:\x20','\x22\x20from\x20project\x20\x22','error','\x22...','no_local_folder','\x22\x20to\x20\x22','agent:pull','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','No\x20tdx.json\x20found\x20in\x20','Analyzing\x20changes\x20to\x20push...','projectName','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','diff','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20files?','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x22:\x20','force','\x0aErrors\x20found:','\x20\x20Form\x20Interfaces:\x20','prompts','Dry\x20run\x20-\x20no\x20files\x20written','outputDir','textKnowledgeBases','chatInterfaces','Source:\x20','agents','dim','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20Integrations:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20files\x20to\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','site','integrations','Using\x20local\x20project:\x20','\x20created','Using\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','session','\x20\x20Experimental\x20Artifact\x20\x22','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20new','7nXiZAy','found','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','dryRun','description','\x20\x20Knowledge\x20Bases:\x20','Using\x20current\x20project:\x20','\x20--profile\x20','-\x20nothing\x20pushed','Using\x20project\x20from\x20context:\x20','context','pullAgent','\x0aChanges\x20to\x20integration\x20\x27','execute','728030SYFAnG','\x20\x20Chat\x20Interfaces:\x20','\x20--name\x20','errors','name','yes','Status:\x20','\x20\x20Prompts:\x20','Failed\x20to\x20push\x20agent:\x20','projectDir','sourceProjectName','New\x20project\x20name\x20is\x20required','\x20=\x20','red','Output:\x20','new','counts','\x0a✔\x20Pulled\x20','pushProject'];a4_0x2f3d=function(){return _0x1e0294;};return a4_0x2f3d();}import a4_0x33fb22 from'chalk';import a4_0x4d86e7 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x458aac){const _0x15d70c=a4_0x2cd7,_0x1606fb=[];if(_0x458aac[_0x15d70c(0x20f)]!==undefined)_0x1606fb[_0x15d70c(0x1d3)](_0x458aac[_0x15d70c(0x20f)]+'\x20total');if(_0x458aac[_0x15d70c(0x25c)]!==undefined&&_0x458aac['new']>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22[_0x15d70c(0x1d5)](_0x458aac[_0x15d70c(0x25c)]+'\x20new'));if(_0x458aac['created']!==undefined&&_0x458aac[_0x15d70c(0x198)]>0x0)_0x1606fb['push'](a4_0x33fb22['green'](_0x458aac[_0x15d70c(0x198)]+_0x15d70c(0x238)));if(_0x458aac[_0x15d70c(0x20d)]!==undefined&&_0x458aac['updated']>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22['yellow'](_0x458aac[_0x15d70c(0x20d)]+_0x15d70c(0x1e2)));if(_0x458aac[_0x15d70c(0x1b0)]!==undefined&&_0x458aac[_0x15d70c(0x1b0)]>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22[_0x15d70c(0x1e6)](_0x458aac[_0x15d70c(0x1b0)]+'\x20unchanged'));if(_0x458aac[_0x15d70c(0x250)]!==undefined&&_0x458aac[_0x15d70c(0x250)]>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22[_0x15d70c(0x25a)](_0x458aac['errors']+_0x15d70c(0x1f7)));return _0x1606fb[_0x15d70c(0x20b)](',\x20');}function displayDiffs(_0x57580e,_0x283f5c,_0x571d17,_0x3f1fb5,_0x18a7fc,_0x50cd5a,_0x1e818c,_0xec6c24,_0x158554){const _0x453bc7=a4_0x2cd7;for(const _0x411d4b of _0x57580e){if(_0x411d4b[_0x453bc7(0x21c)]){const _0x54d699=_0x411d4b['agentName']||_0x411d4b['name'];console[_0x453bc7(0x1cd)](_0x453bc7(0x1b5)+_0x54d699+'\x27:'),console['log']('─'[_0x453bc7(0x1cb)](0x3c)),console['log'](_0x411d4b[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c));}}for(const _0x324b4f of _0x283f5c){_0x324b4f['diff']&&(console['log'](_0x453bc7(0x217)+_0x324b4f[_0x453bc7(0x251)]+'\x27:'),console['log']('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x324b4f[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)));}for(const _0x3887a7 of _0x571d17){_0x3887a7[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3887a7[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)),console[_0x453bc7(0x1cd)](_0x3887a7['diff']),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x275ff9 of _0x3f1fb5){_0x275ff9['diff']&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x275ff9[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x275ff9[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x578948 of _0x18a7fc){_0x578948[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x24b)+_0x578948[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x578948[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x20f3fd of _0x50cd5a){_0x20f3fd[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x21e)+_0x20f3fd['name']+'\x27:'),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x20f3fd['diff']),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x2a35f3 of _0x1e818c){_0x2a35f3[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x1f0)+_0x2a35f3[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)),console[_0x453bc7(0x1cd)](_0x2a35f3[_0x453bc7(0x21c)]),console['log']('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x2d38e7 of _0xec6c24){_0x2d38e7['diff']&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x23d)+_0x2d38e7[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)),console['log'](_0x2d38e7[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x473518 of _0x158554){_0x473518[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x1ad)+_0x473518[_0x453bc7(0x251)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x453bc7(0x1cd)](_0x473518[_0x453bc7(0x21c)]),console['log']('─'[_0x453bc7(0x1cb)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x4c125e(0x251)]=a4_0x4c125e(0x216);[a4_0x4c125e(0x243)]=a4_0x4c125e(0x222);async[a4_0x4c125e(0x24c)](_0x310ee1){const _0x15daf5=a4_0x4c125e,{options:_0x304cbf,args:_0x2817b7,tdx:_0x514160}=_0x310ee1,_0x4490f4=_0x2817b7[0x0],_0x1d3232=_0x2817b7[0x1],_0xd416f8=_0x304cbf[_0x15daf5(0x1d7)],_0x2e702f=_0x304cbf[_0x15daf5(0x242)],_0x549fbd=_0x304cbf[_0x15daf5(0x225)],_0x3ed8bb=_0x304cbf[_0x15daf5(0x252)],_0xb6f952=_0x304cbf[_0x15daf5(0x19d)],_0x5b2b71=_0x304cbf[_0x15daf5(0x1f1)];let _0x3f8c6f;if(_0x4490f4){const _0xa5f3f6=a4_0x4d86e7['join'](_0x4490f4,'tdx.json');if(existsSync(_0xa5f3f6))try{const _0x48d650=JSON['parse'](readFileSync(_0xa5f3f6,_0x15daf5(0x1dc)));_0x48d650['llm_project']&&(_0x3f8c6f={'llm_project':_0x48d650[_0x15daf5(0x197)]});}catch{}}const _0x55be06=findAgentConfigPath(process[_0x15daf5(0x1c1)]());let _0x19812b;if(_0x55be06)try{const _0x56afa2=JSON[_0x15daf5(0x1b3)](readFileSync(_0x55be06,'utf-8'));_0x56afa2['llm_project']&&(_0x19812b={'llm_project':_0x56afa2['llm_project']});}catch{}const _0x513cf8=resolveAgentPullArgs({'arg':_0x4490f4,'agentNameArg':_0x1d3232,'agentFlag':_0x5b2b71,'contextProject':_0xb6f952,'argDirConfig':_0x3f8c6f,'cwdConfigPath':_0x55be06||undefined,'cwdConfig':_0x19812b}),{projectNameOrId:_0x8b0410,targetAgentName:_0x182fee,existingOutputDir:_0x46266a,source:_0x35278b}=_0x513cf8;if(_0x35278b===_0x15daf5(0x206))console['log'](a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x1dd)+a4_0x4d86e7[_0x15daf5(0x20b)](_0x4490f4,_0x15daf5(0x1e4))+':\x20'+_0x8b0410));else{if(_0x35278b===_0x15daf5(0x1e7))console['log'](a4_0x33fb22[_0x15daf5(0x22f)]('Using\x20project:\x20'+_0x8b0410));else _0x35278b===_0x15daf5(0x249)&&console['log'](a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x248)+_0x8b0410));}if(!_0x8b0410)return _0x5b2b71?(console['log'](a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x201))),console[_0x15daf5(0x1cd)](_0x15daf5(0x1d2)),console[_0x15daf5(0x1cd)](_0x15daf5(0x1fb))):(console[_0x15daf5(0x1cd)](a4_0x33fb22['yellow'](_0x15daf5(0x1c9))),console['log'](_0x15daf5(0x1a6)),console[_0x15daf5(0x1cd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x15daf5(0x1cd)](_0x15daf5(0x209)),console[_0x15daf5(0x1cd)](_0x15daf5(0x1f6)),console[_0x15daf5(0x1cd)](_0x15daf5(0x1a3))),0x1;if(_0x182fee){const {data:_0x3301a2}=await withSpinner(_0x15daf5(0x1f5)+_0x182fee+_0x15daf5(0x211)+_0x8b0410+_0x15daf5(0x213),()=>_0x514160[_0x15daf5(0x1ce)][_0x15daf5(0x24a)](_0x8b0410,_0x182fee,_0xd416f8,{'dryRun':_0x2e702f,'force':_0x549fbd}));if(_0x2e702f)return console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x229))),console[_0x15daf5(0x1cd)](_0x15daf5(0x1e8)+_0x3301a2[_0x15daf5(0x1bb)]),console[_0x15daf5(0x1cd)]('Output\x20path:\x20'+_0x3301a2['outputPath']),_0x3301a2[_0x15daf5(0x21c)]&&(console[_0x15daf5(0x1cd)]('\x0aChanges:'),console['log']('─'[_0x15daf5(0x1cb)](0x3c)),console[_0x15daf5(0x1cd)](_0x3301a2[_0x15daf5(0x21c)]),console[_0x15daf5(0x1cd)]('─'[_0x15daf5(0x1cb)](0x3c))),0x0;return console[_0x15daf5(0x1cd)](a4_0x33fb22['green'](_0x15daf5(0x1e5))),console[_0x15daf5(0x1cd)](_0x15daf5(0x1ca)+_0x3301a2[_0x15daf5(0x1bb)]),console[_0x15daf5(0x1cd)](_0x15daf5(0x25b)+_0x3301a2[_0x15daf5(0x1ed)]),console[_0x15daf5(0x1cd)](_0x15daf5(0x253)+(_0x3301a2[_0x15daf5(0x1a5)]?a4_0x33fb22[_0x15daf5(0x1d5)]('new'):_0x3301a2['hasChanges']?a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x20d)):a4_0x33fb22[_0x15daf5(0x1e6)](_0x15daf5(0x1b0)))),0x0;}const _0x4c5b71=_0x46266a||_0xd416f8,{data:_0x240957}=await withSpinner(_0x15daf5(0x1cf)+_0x8b0410+_0x15daf5(0x213),()=>_0x514160[_0x15daf5(0x1ce)][_0x15daf5(0x1e0)](_0x8b0410,_0x4c5b71,{'dryRun':!![]})),_0x25f69d=_0x240957['counts']['agents'][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)]['knowledgeBases'][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)]['textKnowledgeBases']['new']+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x228)][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x25c)]+_0x240957['counts'][_0x15daf5(0x1ee)]['new']+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1c0)][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22c)]['new'],_0xb66799=_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22e)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1e9)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22b)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x228)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)]['experimentalArtifacts']['updated']+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1c0)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22c)]['updated'],_0x3ae8cf=_0x240957['counts'][_0x15daf5(0x22e)][_0x15daf5(0x1b0)]+_0x240957['counts']['knowledgeBases'][_0x15daf5(0x1b0)]+_0x240957['counts']['textKnowledgeBases'][_0x15daf5(0x1b0)]+_0x240957['counts'][_0x15daf5(0x228)][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x1b0)]+_0x240957['counts'][_0x15daf5(0x1ee)][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)]['formInterfaces'][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22c)]['unchanged'];console[_0x15daf5(0x1cd)](_0x15daf5(0x1b1)+_0x240957[_0x15daf5(0x21a)]+'\x27:'),console['log']('\x20\x20'+a4_0x33fb22[_0x15daf5(0x1d5)]('+\x20'+_0x25f69d+_0x15daf5(0x23e))+_0x15daf5(0x20e)+a4_0x33fb22[_0x15daf5(0x1af)]('~\x20'+_0xb66799+'\x20changed')+_0x15daf5(0x20e)+a4_0x33fb22[_0x15daf5(0x22f)]('=\x20'+_0x3ae8cf+_0x15daf5(0x19f))),console['log'](_0x15daf5(0x1ae)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22e)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x244)+formatCountSummary(_0x240957['counts'][_0x15daf5(0x1e9)])),console[_0x15daf5(0x1cd)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22b)])),console[_0x15daf5(0x1cd)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x228)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x231)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x227)+formatCountSummary(_0x240957[_0x15daf5(0x25d)]['formInterfaces'])),console['log'](_0x15daf5(0x24e)+formatCountSummary(_0x240957['counts'][_0x15daf5(0x22c)]));const _0x35c596=_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x20f)]>0x0||_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1ee)]['total']>0x0;_0x35c596&&(console[_0x15daf5(0x1cd)](_0x15daf5(0x23a)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x210)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1ee)])));console[_0x15daf5(0x1cd)]('\x20\x20Target:\x20'+a4_0x33fb22[_0x15daf5(0x1a8)](_0x240957['outputDir'])),displayDiffs(_0x240957[_0x15daf5(0x22e)],_0x240957[_0x15daf5(0x1e9)],_0x240957['textKnowledgeBases'],_0x240957[_0x15daf5(0x228)],_0x240957[_0x15daf5(0x236)],_0x240957[_0x15daf5(0x1be)],_0x240957['experimentalArtifacts'],_0x240957[_0x15daf5(0x1c0)],_0x240957['chatInterfaces']);if(_0x2e702f)return console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x1d1))),0x0;if(_0x25f69d===0x0&&_0xb66799===0x0)return console[_0x15daf5(0x1cd)](a4_0x33fb22['green'](_0x15daf5(0x1eb))),saveSessionContext({'llm_project':_0x240957[_0x15daf5(0x21a)]},_0x304cbf[_0x15daf5(0x23b)]),console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1d5)](_0x15daf5(0x1ec)+a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x197))+'\x20=\x20'+a4_0x33fb22['cyan'](_0x240957[_0x15daf5(0x21a)]))),0x0;if(!_0x3ed8bb&&!_0x549fbd){if(!isInteractive())return console[_0x15daf5(0x212)](a4_0x33fb22[_0x15daf5(0x25a)](_0x15daf5(0x1d6)),_0x15daf5(0x1df)),console[_0x15daf5(0x212)](a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x1c4))),0x1;const _0x38cdd7=await confirmKey(_0x15daf5(0x1d9)+(_0x25f69d+_0xb66799)+_0x15daf5(0x220));if(!_0x38cdd7)return console[_0x15daf5(0x1cd)](a4_0x33fb22['yellow'](_0x15daf5(0x1b2)),_0x15daf5(0x1c7)),0x1;}const {data:_0x2e1965}=await withSpinner(_0x15daf5(0x1ea),()=>_0x514160['llm'][_0x15daf5(0x1e0)](_0x8b0410,_0x4c5b71,{'force':_0x549fbd}));return console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1d5)](_0x15daf5(0x25e)+(_0x25f69d+_0xb66799)+_0x15daf5(0x233)+_0x2e1965[_0x15daf5(0x22a)])),saveSessionContext({'llm_project':_0x2e1965['projectName']},_0x304cbf[_0x15daf5(0x23b)]),console['log'](a4_0x33fb22['green'](_0x15daf5(0x1ec)+a4_0x33fb22[_0x15daf5(0x22f)]('llm_project')+_0x15daf5(0x259)+a4_0x33fb22[_0x15daf5(0x1a8)](_0x2e1965['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4c125e(0x251)]=a4_0x4c125e(0x1fd);[a4_0x4c125e(0x243)]=a4_0x4c125e(0x21b);async['execute'](_0xeaf8e9){const _0x341cac=a4_0x4c125e,{options:_0x3465a3,args:_0xbca9a1,tdx:_0xe8b7a9}=_0xeaf8e9,_0x3cad6f=_0xbca9a1[0x0],_0xf3c0d3=_0x3465a3['name'],_0x2cd610=_0x3465a3[_0x341cac(0x242)],_0x379e7f=_0x3465a3[_0x341cac(0x252)],_0x5c443c=_0x3465a3[_0x341cac(0x235)],_0x4b932b=_0x3465a3['llmProject'];let _0x7034b5;const _0x42d67c=findAgentConfigPath(process[_0x341cac(0x1c1)]());if(_0x3cad6f){const _0x390c43=a4_0x4d86e7[_0x341cac(0x20b)](_0x3cad6f,_0x341cac(0x1e4));existsSync(_0x390c43)?(_0x7034b5=_0x3cad6f,console['log'](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x237)+_0x3cad6f))):_0x7034b5=_0x3cad6f;}else{if(_0x42d67c)_0x7034b5=a4_0x4d86e7['dirname'](_0x42d67c),console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x245)+_0x7034b5));else{if(_0x4b932b){const _0x42cc18=sanitizeForFilesystem(_0x4b932b);let _0x321871=_0x42cc18,_0x31319a=a4_0x4d86e7['join'](process[_0x341cac(0x1c1)](),_0x341cac(0x22e),_0x42cc18,_0x341cac(0x1e4));if(!existsSync(_0x31319a)){const _0x5a2d68=normalizeName(_0x4b932b),_0x4625bd=a4_0x4d86e7['join'](process['cwd'](),'agents',_0x5a2d68,'tdx.json');existsSync(_0x4625bd)&&(_0x321871=_0x5a2d68,_0x31319a=_0x4625bd);}if(existsSync(_0x31319a))_0x7034b5=a4_0x4d86e7[_0x341cac(0x20a)](_0x31319a),console['log'](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x237)+_0x7034b5));else{const _0x596f43=_0x3465a3[_0x341cac(0x1a0)];if(_0x596f43)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4b932b+_0x341cac(0x1db),undefined,{'helpText':_0x341cac(0x1fc)+_0x341cac(0x1d8)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x4b932b+'\x0a')+(_0x341cac(0x1d4)+_0x321871+_0x341cac(0x24f)+(_0xf3c0d3||_0x341cac(0x19c))+_0x341cac(0x246)+_0x596f43)});_0x7034b5=_0x4b932b,console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x1de)+_0x4b932b));}}}}if(!_0x7034b5)return console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x1af)](_0x341cac(0x223))),console[_0x341cac(0x1cd)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x341cac(0x1cd)](_0x341cac(0x230)),console[_0x341cac(0x1cd)](_0x341cac(0x260)),0x1;if(!_0xf3c0d3)throw new SDKError(ErrorCode[_0x341cac(0x1b6)],_0x341cac(0x258),undefined,{'helpText':_0x341cac(0x21f)});if(!_0x379e7f&&!_0x2cd610){if(!isInteractive())return console[_0x341cac(0x212)](a4_0x33fb22['red'](_0x341cac(0x1d6)),_0x341cac(0x1df)),console[_0x341cac(0x212)](a4_0x33fb22[_0x341cac(0x22f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4aa6d0=await confirmKey(_0x341cac(0x1f2)+_0x7034b5+'\x22\x20to\x20new\x20project\x20\x22'+_0xf3c0d3+'\x22?');if(!_0x4aa6d0)return console['log'](a4_0x33fb22['yellow']('Cancelled')),0x1;}const {data:_0x348264}=await withSpinner(_0x341cac(0x207)+_0x7034b5+_0x341cac(0x215)+_0xf3c0d3+_0x341cac(0x213),()=>_0xe8b7a9['llm'][_0x341cac(0x205)](_0x7034b5,_0xf3c0d3,{'dryRun':_0x2cd610}));if(_0x2cd610){console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x1af)](_0x341cac(0x232))),console[_0x341cac(0x1cd)](_0x341cac(0x22d)+_0x348264[_0x341cac(0x257)]),console[_0x341cac(0x1cd)](_0x341cac(0x1f8)+_0xf3c0d3),console[_0x341cac(0x1cd)](_0x341cac(0x1a2)),console['log'](_0x341cac(0x1ae)+_0x348264[_0x341cac(0x25d)][_0x341cac(0x22e)][_0x341cac(0x198)]),console[_0x341cac(0x1cd)](_0x341cac(0x244)+_0x348264[_0x341cac(0x25d)]['knowledgeBases'][_0x341cac(0x198)]),console[_0x341cac(0x1cd)]('\x20\x20Prompts:\x20'+_0x348264[_0x341cac(0x25d)][_0x341cac(0x228)][_0x341cac(0x198)]),console[_0x341cac(0x1cd)](_0x341cac(0x227)+_0x348264[_0x341cac(0x25d)][_0x341cac(0x1c0)][_0x341cac(0x198)]),console[_0x341cac(0x1cd)](_0x341cac(0x24e)+_0x348264[_0x341cac(0x25d)][_0x341cac(0x22c)][_0x341cac(0x198)]);const _0x5d72f5=_0x348264['counts'][_0x341cac(0x1be)]['created']>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['created']>0x0;return _0x5d72f5&&(console['log'](_0x341cac(0x23a)+_0x348264['counts'][_0x341cac(0x1be)][_0x341cac(0x198)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['created'])),0x0;}const _0x5ab19d=_0x348264['counts'][_0x341cac(0x22e)][_0x341cac(0x250)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1e9)][_0x341cac(0x250)]>0x0||_0x348264['counts'][_0x341cac(0x228)][_0x341cac(0x250)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1c0)][_0x341cac(0x250)]>0x0||_0x348264[_0x341cac(0x25d)]['chatInterfaces']['errors']>0x0||_0x348264['counts'][_0x341cac(0x1be)]['errors']>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['errors']>0x0;_0x5ab19d?console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x1af)](_0x341cac(0x1ef))):console['log'](a4_0x33fb22[_0x341cac(0x1d5)]('Project\x20cloned\x20successfully'));console[_0x341cac(0x1cd)]('Source:\x20'+_0x348264['sourceProjectName']),console[_0x341cac(0x1cd)]('New\x20project:\x20'+_0x348264[_0x341cac(0x1ff)]),console[_0x341cac(0x1cd)](_0x341cac(0x19a)+_0x348264[_0x341cac(0x1bd)]),console[_0x341cac(0x1cd)](),console[_0x341cac(0x1cd)]('Summary:'),console[_0x341cac(0x1cd)](_0x341cac(0x1ae)+formatCountSummary(_0x348264['counts'][_0x341cac(0x22e)])),console[_0x341cac(0x1cd)](_0x341cac(0x244)+formatCountSummary(_0x348264[_0x341cac(0x25d)]['knowledgeBases'])),console[_0x341cac(0x1cd)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x348264['counts'][_0x341cac(0x228)])),console[_0x341cac(0x1cd)](_0x341cac(0x231)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x236)])),console[_0x341cac(0x1cd)](_0x341cac(0x227)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x1c0)])),console[_0x341cac(0x1cd)](_0x341cac(0x24e)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x22c)]));const _0x182464=_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)][_0x341cac(0x198)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)][_0x341cac(0x20d)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)][_0x341cac(0x1b0)]>0x0||_0x348264[_0x341cac(0x25d)]['experimentalArtifacts'][_0x341cac(0x198)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['updated']>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)][_0x341cac(0x1b0)]>0x0;_0x182464&&(console[_0x341cac(0x1cd)](_0x341cac(0x23a)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)])),console[_0x341cac(0x1cd)](_0x341cac(0x210)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)])));if(_0x5ab19d){console[_0x341cac(0x1cd)](),console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)]('Errors:'));for(const _0x2a747b of _0x348264['agents']){_0x2a747b[_0x341cac(0x199)]===_0x341cac(0x212)&&console['log'](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x21d)+_0x2a747b[_0x341cac(0x1bb)]+_0x341cac(0x224)+_0x2a747b['error']));}for(const _0x125245 of _0x348264['knowledgeBases']){_0x125245[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x1e1)+_0x125245[_0x341cac(0x251)]+_0x341cac(0x224)+_0x125245[_0x341cac(0x212)]));}for(const _0x384d15 of _0x348264[_0x341cac(0x228)]){_0x384d15[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x1ac)+_0x384d15[_0x341cac(0x251)]+_0x341cac(0x224)+_0x384d15['error']));}for(const _0x1f9ff2 of _0x348264[_0x341cac(0x236)]){_0x1f9ff2[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22['red'](_0x341cac(0x1c8)+_0x1f9ff2[_0x341cac(0x251)]+_0x341cac(0x224)+_0x1f9ff2[_0x341cac(0x212)]));}for(const _0x4eabe1 of _0x348264[_0x341cac(0x1c0)]){_0x4eabe1[_0x341cac(0x199)]===_0x341cac(0x212)&&console['log'](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x1ba)+_0x4eabe1[_0x341cac(0x251)]+_0x341cac(0x224)+_0x4eabe1['error']));}for(const _0x3a22e8 of _0x348264[_0x341cac(0x22c)]){_0x3a22e8['action']===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)]('\x20\x20Chat\x20Interface\x20\x22'+_0x3a22e8[_0x341cac(0x251)]+_0x341cac(0x224)+_0x3a22e8[_0x341cac(0x212)]));}for(const _0x468015 of _0x348264[_0x341cac(0x1be)]){_0x468015[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x468015[_0x341cac(0x251)]+_0x341cac(0x224)+_0x468015['error']));}for(const _0x5c8ee0 of _0x348264[_0x341cac(0x1ee)]){_0x5c8ee0['action']==='error'&&console[_0x341cac(0x1cd)](a4_0x33fb22['red'](_0x341cac(0x23c)+_0x5c8ee0['name']+_0x341cac(0x224)+_0x5c8ee0[_0x341cac(0x212)]));}return 0x1;}console[_0x341cac(0x1cd)]();const _0x4b6cbf=getLLMProjectUrl(_0x5c443c,_0x348264[_0x341cac(0x1bd)]);return console[_0x341cac(0x1cd)](_0x341cac(0x1c3)+a4_0x33fb22['cyan'](_0x4b6cbf)),0x0;}}function a4_0x2cd7(_0x46c460,_0x2a21a3){_0x46c460=_0x46c460-0x197;const _0x2f3da4=a4_0x2f3d();let _0x2cd70d=_0x2f3da4[_0x46c460];return _0x2cd70d;}export class AgentPushCommand extends BaseCommand{[a4_0x4c125e(0x251)]=a4_0x4c125e(0x1bf);['description']=a4_0x4c125e(0x241);async[a4_0x4c125e(0x24c)](_0x5e794e){const _0x129dc8=a4_0x4c125e,{options:_0x30f429,args:_0x4de8bb,tdx:_0xcb1243}=_0x5e794e;let _0x1ad73d=_0x4de8bb[0x0]||process['cwd']();const _0x3d8fa2=_0x30f429['dryRun'],_0xb96e92=_0x30f429[_0x129dc8(0x225)],_0x1b68e7=_0x30f429['yes'],_0x5c9106=_0x30f429[_0x129dc8(0x235)],_0x4f72ad=a4_0x4d86e7[_0x129dc8(0x20b)](_0x1ad73d,_0x129dc8(0x1aa)),_0x1a71ba=existsSync(_0x4f72ad);if(_0x1a71ba){const {data:_0xb8f1b0}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x1ad73d+_0x129dc8(0x213),()=>_0xcb1243[_0x129dc8(0x1ce)][_0x129dc8(0x204)](_0x1ad73d,{'dryRun':_0x3d8fa2,'force':_0xb96e92}));if(_0x3d8fa2)return console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1af)](_0x129dc8(0x232))),console[_0x129dc8(0x1cd)](_0x129dc8(0x202)+_0xb8f1b0[_0x129dc8(0x1bb)]),0x0;if(_0xb8f1b0[_0x129dc8(0x199)]===_0x129dc8(0x212))return console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x255)+_0xb8f1b0[_0x129dc8(0x212)])),0x1;console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1d5)](_0x129dc8(0x1f4)+_0xb8f1b0[_0x129dc8(0x199)]+_0x129dc8(0x1b7))),console[_0x129dc8(0x1cd)](_0x129dc8(0x1ca)+_0xb8f1b0['agentName']);if(_0xb8f1b0[_0x129dc8(0x1e3)]&&_0xb8f1b0[_0x129dc8(0x208)]){const _0x9df479=getLLMAgentChatUrl(_0x5c9106,_0xb8f1b0[_0x129dc8(0x208)],_0xb8f1b0[_0x129dc8(0x1e3)]);console[_0x129dc8(0x1cd)](_0x129dc8(0x1b8)+a4_0x33fb22[_0x129dc8(0x1a8)](_0x9df479));}return 0x0;}const _0x33307f=_0x30f429[_0x129dc8(0x19d)],_0x2143e7=resolveProjectFromContext(_0x1ad73d,_0x33307f);if(_0x2143e7[_0x129dc8(0x240)])_0x1ad73d=_0x2143e7[_0x129dc8(0x256)],_0x2143e7[_0x129dc8(0x1a9)]===_0x129dc8(0x249)&&console[_0x129dc8(0x1cd)](a4_0x33fb22['dim'](_0x129dc8(0x239)+_0x1ad73d));else{let _0x4709c1=_0x129dc8(0x1a7);_0x2143e7[_0x129dc8(0x1f9)]===_0x129dc8(0x214)&&(_0x4709c1=_0x2143e7['message']+_0x129dc8(0x221)+_0x2143e7[_0x129dc8(0x19d)]+_0x129dc8(0x234));throw new SDKError(ErrorCode[_0x129dc8(0x203)],_0x2143e7[_0x129dc8(0x1f9)]===_0x129dc8(0x1cc)?_0x2143e7['message']:_0x129dc8(0x218)+_0x1ad73d,undefined,{'helpText':_0x4709c1});}const {data:_0x3c217b}=await withSpinner(_0x129dc8(0x219),()=>_0xcb1243[_0x129dc8(0x1ce)]['pushProject'](_0x1ad73d,{'dryRun':!![]})),_0x10d080=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x250)]>0x0;if(_0x10d080){console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x226)));for(const _0x113424 of _0x3c217b['agents']){_0x113424[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console['log'](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x21d)+_0x113424[_0x129dc8(0x1bb)]+_0x129dc8(0x224)+_0x113424[_0x129dc8(0x212)]));}return 0x1;}const _0x5a04ba=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)][_0x129dc8(0x198)]+_0x3c217b['counts']['prompts'][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)]['integrations'][_0x129dc8(0x198)]+_0x3c217b['counts']['experimentalKnowledgeBases'][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)]['created']+_0x3c217b[_0x129dc8(0x25d)]['formInterfaces']['created']+_0x3c217b[_0x129dc8(0x25d)]['chatInterfaces']['created'],_0x5c3e7d=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)]['updated']+_0x3c217b[_0x129dc8(0x25d)]['prompts']['updated']+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x236)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)]['updated']+_0x3c217b[_0x129dc8(0x25d)]['experimentalArtifacts'][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1c0)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22c)][_0x129dc8(0x20d)],_0x3f7164=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)][_0x129dc8(0x1b0)]+_0x3c217b['counts'][_0x129dc8(0x228)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x236)]['unchanged']+_0x3c217b[_0x129dc8(0x25d)]['experimentalKnowledgeBases'][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1c0)]['unchanged']+_0x3c217b['counts']['chatInterfaces'][_0x129dc8(0x1b0)];console[_0x129dc8(0x1cd)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3c217b['projectName']+'\x27:'),console[_0x129dc8(0x1cd)]('\x20\x20'+a4_0x33fb22[_0x129dc8(0x1d5)]('+\x20'+_0x5a04ba+_0x129dc8(0x23e))+_0x129dc8(0x20e)+a4_0x33fb22['yellow']('~\x20'+_0x5c3e7d+_0x129dc8(0x200))+_0x129dc8(0x20e)+a4_0x33fb22[_0x129dc8(0x22f)]('=\x20'+_0x3f7164+_0x129dc8(0x19f))),console[_0x129dc8(0x1cd)](_0x129dc8(0x1ae)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)])),console['log'](_0x129dc8(0x244)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)])),console[_0x129dc8(0x1cd)](_0x129dc8(0x1fe)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)])),console['log'](_0x129dc8(0x254)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x228)])),console[_0x129dc8(0x1cd)](_0x129dc8(0x231)+formatCountSummary(_0x3c217b['counts'][_0x129dc8(0x236)])),console[_0x129dc8(0x1cd)](_0x129dc8(0x227)+formatCountSummary(_0x3c217b['counts'][_0x129dc8(0x1c0)])),console['log'](_0x129dc8(0x24e)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22c)]));const _0x48cf31=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)][_0x129dc8(0x198)]>0x0||_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)][_0x129dc8(0x20d)]>0x0||_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)][_0x129dc8(0x1b0)]>0x0||_0x3c217b[_0x129dc8(0x25d)]['experimentalArtifacts'][_0x129dc8(0x198)]>0x0||_0x3c217b['counts'][_0x129dc8(0x1ee)][_0x129dc8(0x20d)]>0x0||_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)][_0x129dc8(0x1b0)]>0x0;_0x48cf31&&(console['log'](_0x129dc8(0x23a)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)])),console[_0x129dc8(0x1cd)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)])));console[_0x129dc8(0x1cd)]('\x20\x20Source:\x20'+a4_0x33fb22['cyan'](_0x1ad73d)),displayDiffs(_0x3c217b[_0x129dc8(0x22e)],_0x3c217b['knowledgeBases'],_0x3c217b['textKnowledgeBases'],_0x3c217b[_0x129dc8(0x228)],_0x3c217b[_0x129dc8(0x236)],_0x3c217b[_0x129dc8(0x1be)],_0x3c217b[_0x129dc8(0x1ee)],_0x3c217b[_0x129dc8(0x1c0)],_0x3c217b['chatInterfaces']);if(_0x3d8fa2)return console['log'](a4_0x33fb22['yellow'](_0x129dc8(0x1ab))),0x0;if(_0x5a04ba===0x0&&_0x5c3e7d===0x0){console[_0x129dc8(0x1cd)](a4_0x33fb22['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2de877=getLLMProjectUrl(_0x5c9106,_0x3c217b[_0x129dc8(0x208)]);return console[_0x129dc8(0x1cd)](_0x129dc8(0x1c3)+a4_0x33fb22[_0x129dc8(0x1a8)](_0x2de877)),0x0;}if(!_0x1b68e7&&!_0xb96e92){if(!isInteractive())return console[_0x129dc8(0x212)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1d6)),_0x129dc8(0x1df)),console['error'](a4_0x33fb22[_0x129dc8(0x22f)](_0x129dc8(0x1c4))),0x1;const _0x21d5a0=await confirmKey(_0x129dc8(0x1a4)+(_0x5a04ba+_0x5c3e7d)+'\x20resources?');if(!_0x21d5a0)return console[_0x129dc8(0x1cd)](a4_0x33fb22['yellow']('Cancelled'),_0x129dc8(0x247)),0x1;}const {data:_0x3631ec}=await withSpinner(_0x129dc8(0x1c5),()=>_0xcb1243[_0x129dc8(0x1ce)][_0x129dc8(0x25f)](_0x1ad73d,{'force':_0xb96e92})),_0x461485=_0x3631ec[_0x129dc8(0x25d)]['agents']['errors']>0x0||_0x3631ec[_0x129dc8(0x25d)][_0x129dc8(0x1e9)]['errors']>0x0||_0x3631ec['counts']['textKnowledgeBases']['errors']>0x0||_0x3631ec[_0x129dc8(0x25d)][_0x129dc8(0x228)][_0x129dc8(0x250)]>0x0||_0x3631ec[_0x129dc8(0x25d)][_0x129dc8(0x1c0)][_0x129dc8(0x250)]>0x0||_0x3631ec['counts'][_0x129dc8(0x22c)][_0x129dc8(0x250)]>0x0;if(_0x461485){console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1af)](_0x129dc8(0x20c))),console[_0x129dc8(0x1cd)](),console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1da)));for(const _0x315e9c of _0x3631ec[_0x129dc8(0x22e)]){_0x315e9c['action']===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22['red']('\x20\x20Agent\x20\x22'+_0x315e9c['agentName']+'\x22:\x20'+_0x315e9c['error']));}for(const _0x50ab99 of _0x3631ec[_0x129dc8(0x1e9)]){_0x50ab99[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1e1)+_0x50ab99[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x50ab99[_0x129dc8(0x212)]));}for(const _0x2f09e0 of _0x3631ec[_0x129dc8(0x22b)]){_0x2f09e0[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2f09e0[_0x129dc8(0x251)]+'\x22:\x20'+_0x2f09e0[_0x129dc8(0x212)]));}for(const _0x5e4bb6 of _0x3631ec[_0x129dc8(0x228)]){_0x5e4bb6[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1ac)+_0x5e4bb6[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x5e4bb6[_0x129dc8(0x212)]));}for(const _0x5a9e8f of _0x3631ec['integrations']){_0x5a9e8f[_0x129dc8(0x199)]==='error'&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1c8)+_0x5a9e8f['name']+'\x22:\x20'+_0x5a9e8f['error']));}for(const _0x2eb24d of _0x3631ec[_0x129dc8(0x1c0)]){_0x2eb24d[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1ba)+_0x2eb24d[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x2eb24d[_0x129dc8(0x212)]));}for(const _0x39532a of _0x3631ec['chatInterfaces']){_0x39532a['action']===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x19e)+_0x39532a[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x39532a['error']));}return 0x1;}console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1d5)](_0x129dc8(0x1c2)+(_0x5a04ba+_0x5c3e7d)+_0x129dc8(0x1f3)+_0x3631ec[_0x129dc8(0x21a)]+'\x27'));const _0x5e2c58=getLLMProjectUrl(_0x5c9106,_0x3631ec[_0x129dc8(0x208)]);return console[_0x129dc8(0x1cd)](_0x129dc8(0x1c3)+a4_0x33fb22[_0x129dc8(0x1a8)](_0x5e2c58)),0x0;}}
|
|
1
|
+
const a4_0x38599c=a4_0x58a1;(function(_0x5c43ec,_0x30ba80){const _0x149a72=a4_0x58a1,_0x992ea=_0x5c43ec();while(!![]){try{const _0x23fc71=-parseInt(_0x149a72(0x1f2))/0x1*(-parseInt(_0x149a72(0x1f7))/0x2)+-parseInt(_0x149a72(0x19a))/0x3*(-parseInt(_0x149a72(0x1ae))/0x4)+-parseInt(_0x149a72(0x150))/0x5+-parseInt(_0x149a72(0x1d7))/0x6+parseInt(_0x149a72(0x1bf))/0x7+-parseInt(_0x149a72(0x160))/0x8+-parseInt(_0x149a72(0x199))/0x9*(-parseInt(_0x149a72(0x193))/0xa);if(_0x23fc71===_0x30ba80)break;else _0x992ea['push'](_0x992ea['shift']());}catch(_0x12be3c){_0x992ea['push'](_0x992ea['shift']());}}}(a4_0x35b3,0xcd32d));import a4_0x334449 from'chalk';import a4_0x20202e from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x35b3(){const _0x30e061=['pullProject','no_local_folder','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20new','No\x20tdx.json\x20found\x20in\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Would\x20clone:','Would\x20push\x20agent:\x20','agent','prompts','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','description','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','new','no_context','\x20\x20tdx\x20agent\x20clone\x20agents/','Pushing\x20to\x20project...','\x22\x20to\x20\x22','190eXOtpS','\x0aError:','outputDir','isNew','Clone\x20\x22','cyan','324144XNCxVD','120009RCsbVy','\x20|\x20','\x0aChanges\x20to\x20integration\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','<new-name>','\x20\x20Prompts:\x20','source','agent:push','\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','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Pulling\x20agent\x20\x22','New\x20project:\x20','\x20\x20Form\x20Interface\x20\x22','cwd-config','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','repeat','\x0aPush\x20','\x20\x20Experimental\x20Artifacts:\x20','\x20files?','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','116AJGqRL','\x20\x20Experimental\x20Artifact\x20\x22','agentId','Cloning\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Agent:\x20','MISSING_ARGUMENT','newProjectName','projectId','Chat:\x20','tdx.json','Using\x20context\x20project:\x20','\x20\x20Agent\x20\x22','\x0aWrite\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','integrations','cwd','643090ZHBJRf','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','-\x20nothing\x20pushed','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Analyzing\x20project\x20\x22','Would\x20pull\x20agent:\x20','Errors:','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20total','llm_project','\x0a✔\x20Pulled\x20','\x20--name\x20','\x22\x20from\x20project\x20\x22','chatInterfaces','\x20\x20Knowledge\x20Bases:\x20','\x20updated','error','dirname','\x20resources\x20to\x20\x27','\x20\x20Integrations:\x20','red','\x20=\x20','dryRun','3939594JKldJP','force','sourceProjectName','dim','\x20\x20Agents:\x20','Status:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','experimentalKnowledgeBases','agents','Output\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','push','session','Cancelled','site','✔\x20Context\x20set:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Target:\x20','\x0aErrors\x20found:','\x20errors','Agent\x20','textKnowledgeBases','INVALID_ARGUMENT','Pushing\x20agent\x20from\x20\x22','pushProject','hasChanges','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','2tSFheG','Project\x20cloned\x20successfully','Source:\x20','join','reason','1228408RqSvZN','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Using\x20project\x20from\x20context:\x20','\x20unchanged','Using\x20project\x20from\x20','execute','\x20\x20Chat\x20Interface\x20\x22','action','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)','newProjectId','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','knowledgeBases','Output:\x20','pullAgent','outputPath','agent:pull','errors','\x0aProject\x20pushed\x20with\x20errors','Failed\x20to\x20push\x20agent:\x20','Dry\x20run\x20-\x20no\x20files\x20written','created','yellow','\x0aChanges:','\x20\x20Prompt\x20\x22','5455730WNHMNh','utf-8','total','experimentalArtifacts','log','\x20changed','\x20\x20Form\x20Interfaces:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Text\x20Knowledge\x20Bases:\x20','arg-dir','context','Analyzing\x20changes\x20to\x20push...','\x20\x20Chat\x20Interfaces:\x20','Using\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','4611448BIyHFi','agent.yml','unchanged','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','diff','message','pushAgent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updated','green','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aPull\x20summary\x20for\x20\x27','yes','formInterfaces','\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','\x20successfully','counts','Agent\x20pulled\x20successfully','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','found','\x0aChanges\x20to\x20agent\x20\x27','projectName','name','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','gray','profile','\x20\x20Knowledge\x20Base\x20\x22','projectDir','Project\x20cloned\x20with\x20errors','\x22...','agentName','llm'];a4_0x35b3=function(){return _0x30e061;};return a4_0x35b3();}function formatCountSummary(_0x41a009){const _0xfc47d8=a4_0x58a1,_0x8a0b01=[];if(_0x41a009['total']!==undefined)_0x8a0b01[_0xfc47d8(0x1e2)](_0x41a009['total']+_0xfc47d8(0x1c8));if(_0x41a009[_0xfc47d8(0x18e)]!==undefined&&_0x41a009[_0xfc47d8(0x18e)]>0x0)_0x8a0b01[_0xfc47d8(0x1e2)](a4_0x334449[_0xfc47d8(0x169)](_0x41a009['new']+'\x20new'));if(_0x41a009[_0xfc47d8(0x14c)]!==undefined&&_0x41a009[_0xfc47d8(0x14c)]>0x0)_0x8a0b01[_0xfc47d8(0x1e2)](a4_0x334449['green'](_0x41a009['created']+'\x20created'));if(_0x41a009[_0xfc47d8(0x168)]!==undefined&&_0x41a009[_0xfc47d8(0x168)]>0x0)_0x8a0b01['push'](a4_0x334449[_0xfc47d8(0x14d)](_0x41a009[_0xfc47d8(0x168)]+_0xfc47d8(0x1cf)));if(_0x41a009[_0xfc47d8(0x162)]!==undefined&&_0x41a009[_0xfc47d8(0x162)]>0x0)_0x8a0b01['push'](a4_0x334449[_0xfc47d8(0x179)](_0x41a009['unchanged']+_0xfc47d8(0x1fb)));if(_0x41a009[_0xfc47d8(0x208)]!==undefined&&_0x41a009[_0xfc47d8(0x208)]>0x0)_0x8a0b01[_0xfc47d8(0x1e2)](a4_0x334449[_0xfc47d8(0x1d4)](_0x41a009[_0xfc47d8(0x208)]+_0xfc47d8(0x1ea)));return _0x8a0b01[_0xfc47d8(0x1f5)](',\x20');}function displayDiffs(_0x3ebb26,_0x8b82da,_0x5624fe,_0x50632e,_0x16c737,_0x38e52c,_0x2b1bb0,_0x266319,_0xa16196){const _0x14925d=a4_0x58a1;for(const _0x4483e5 of _0x3ebb26){if(_0x4483e5[_0x14925d(0x164)]){const _0x4247ca=_0x4483e5[_0x14925d(0x17f)]||_0x4483e5[_0x14925d(0x176)];console[_0x14925d(0x154)](_0x14925d(0x174)+_0x4247ca+'\x27:'),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)),console['log'](_0x4483e5['diff']),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c));}}for(const _0x5a0305 of _0x8b82da){_0x5a0305[_0x14925d(0x164)]&&(console[_0x14925d(0x154)](_0x14925d(0x172)+_0x5a0305[_0x14925d(0x176)]+'\x27:'),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)),console[_0x14925d(0x154)](_0x5a0305['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x5f40c4 of _0x5624fe){_0x5f40c4[_0x14925d(0x164)]&&(console['log'](_0x14925d(0x1a3)+_0x5f40c4[_0x14925d(0x176)]+'\x27:'),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)),console[_0x14925d(0x154)](_0x5f40c4['diff']),console['log']('─'[_0x14925d(0x1a9)](0x3c)));}for(const _0x149b9a of _0x50632e){_0x149b9a[_0x14925d(0x164)]&&(console[_0x14925d(0x154)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x149b9a[_0x14925d(0x176)]+'\x27:'),console[_0x14925d(0x154)]('─'['repeat'](0x3c)),console[_0x14925d(0x154)](_0x149b9a['diff']),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)));}for(const _0x3fbb2a of _0x16c737){_0x3fbb2a[_0x14925d(0x164)]&&(console[_0x14925d(0x154)](_0x14925d(0x19c)+_0x3fbb2a[_0x14925d(0x176)]+'\x27:'),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)),console[_0x14925d(0x154)](_0x3fbb2a[_0x14925d(0x164)]),console['log']('─'[_0x14925d(0x1a9)](0x3c)));}for(const _0x48bb1a of _0x38e52c){_0x48bb1a[_0x14925d(0x164)]&&(console[_0x14925d(0x154)](_0x14925d(0x163)+_0x48bb1a[_0x14925d(0x176)]+'\x27:'),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)),console[_0x14925d(0x154)](_0x48bb1a[_0x14925d(0x164)]),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)));}for(const _0x56dcfd of _0x2b1bb0){_0x56dcfd[_0x14925d(0x164)]&&(console[_0x14925d(0x154)](_0x14925d(0x1f9)+_0x56dcfd[_0x14925d(0x176)]+'\x27:'),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)),console['log'](_0x56dcfd[_0x14925d(0x164)]),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)));}for(const _0x46a54f of _0x266319){_0x46a54f[_0x14925d(0x164)]&&(console['log']('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x46a54f[_0x14925d(0x176)]+'\x27:'),console[_0x14925d(0x154)]('─'[_0x14925d(0x1a9)](0x3c)),console[_0x14925d(0x154)](_0x46a54f[_0x14925d(0x164)]),console['log']('─'[_0x14925d(0x1a9)](0x3c)));}for(const _0x2bded5 of _0xa16196){_0x2bded5['diff']&&(console['log'](_0x14925d(0x1c7)+_0x2bded5[_0x14925d(0x176)]+'\x27:'),console['log']('─'[_0x14925d(0x1a9)](0x3c)),console[_0x14925d(0x154)](_0x2bded5[_0x14925d(0x164)]),console['log']('─'[_0x14925d(0x1a9)](0x3c)));}}function a4_0x58a1(_0x368600,_0x48193c){_0x368600=_0x368600-0x14b;const _0x35b35f=a4_0x35b3();let _0x58a1b9=_0x35b35f[_0x368600];return _0x58a1b9;}export class AgentPullCommand extends BaseCommand{[a4_0x38599c(0x176)]=a4_0x38599c(0x207);[a4_0x38599c(0x18c)]=a4_0x38599c(0x18d);async['execute'](_0x32dc00){const _0x4c2781=a4_0x38599c,{options:_0x3c2c6e,args:_0x4f232a,tdx:_0x23d063}=_0x32dc00,_0x2f3e3e=_0x4f232a[0x0],_0x4ac275=_0x4f232a[0x1],_0x47082a=_0x3c2c6e['output'],_0x82b990=_0x3c2c6e['dryRun'],_0x54b137=_0x3c2c6e[_0x4c2781(0x1d8)],_0x3f14f6=_0x3c2c6e['yes'],_0x4b1bf4=_0x3c2c6e['llmProject'],_0x22faad=_0x3c2c6e[_0x4c2781(0x189)];let _0x1f45ce;if(_0x2f3e3e){const _0x1152b8=a4_0x20202e['join'](_0x2f3e3e,_0x4c2781(0x1b8));if(existsSync(_0x1152b8))try{const _0x1b54bd=JSON['parse'](readFileSync(_0x1152b8,_0x4c2781(0x151)));_0x1b54bd['llm_project']&&(_0x1f45ce={'llm_project':_0x1b54bd['llm_project']});}catch{}}const _0x403984=findAgentConfigPath(process[_0x4c2781(0x1be)]());let _0x4e0bad;if(_0x403984)try{const _0xba9f4f=JSON['parse'](readFileSync(_0x403984,_0x4c2781(0x151)));_0xba9f4f[_0x4c2781(0x1c9)]&&(_0x4e0bad={'llm_project':_0xba9f4f['llm_project']});}catch{}const _0x4eba00=resolveAgentPullArgs({'arg':_0x2f3e3e,'agentNameArg':_0x4ac275,'agentFlag':_0x22faad,'contextProject':_0x4b1bf4,'argDirConfig':_0x1f45ce,'cwdConfigPath':_0x403984||undefined,'cwdConfig':_0x4e0bad}),{projectNameOrId:_0x1360cb,targetAgentName:_0x48a73f,existingOutputDir:_0x58aa6f,source:_0x32918f}=_0x4eba00;if(_0x32918f===_0x4c2781(0x159))console['log'](a4_0x334449[_0x4c2781(0x1da)](_0x4c2781(0x1fc)+a4_0x20202e[_0x4c2781(0x1f5)](_0x2f3e3e,'tdx.json')+':\x20'+_0x1360cb));else{if(_0x32918f===_0x4c2781(0x1a7))console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x1da)]('Using\x20project:\x20'+_0x1360cb));else _0x32918f===_0x4c2781(0x15a)&&console['log'](a4_0x334449[_0x4c2781(0x1da)](_0x4c2781(0x1fa)+_0x1360cb));}if(!_0x1360cb)return _0x22faad?(console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x14d)](_0x4c2781(0x1a8))),console[_0x4c2781(0x154)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x4c2781(0x154)](_0x4c2781(0x1c0))):(console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x14d)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x4c2781(0x154)](_0x4c2781(0x200)),console[_0x4c2781(0x154)](_0x4c2781(0x1a2)),console['log'](_0x4c2781(0x1e1)),console['log']('\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[_0x4c2781(0x154)](_0x4c2781(0x16e))),0x1;if(_0x48a73f){const {data:_0x3ec266}=await withSpinner(_0x4c2781(0x1a4)+_0x48a73f+_0x4c2781(0x1cc)+_0x1360cb+_0x4c2781(0x17e),()=>_0x23d063[_0x4c2781(0x180)][_0x4c2781(0x205)](_0x1360cb,_0x48a73f,_0x47082a,{'dryRun':_0x82b990,'force':_0x54b137}));if(_0x82b990)return console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x14d)](_0x4c2781(0x14b))),console[_0x4c2781(0x154)](_0x4c2781(0x1c5)+_0x3ec266['agentName']),console[_0x4c2781(0x154)](_0x4c2781(0x1e0)+_0x3ec266[_0x4c2781(0x206)]),_0x3ec266[_0x4c2781(0x164)]&&(console['log'](_0x4c2781(0x14e)),console[_0x4c2781(0x154)]('─'[_0x4c2781(0x1a9)](0x3c)),console[_0x4c2781(0x154)](_0x3ec266[_0x4c2781(0x164)]),console[_0x4c2781(0x154)]('─'[_0x4c2781(0x1a9)](0x3c))),0x0;return console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x169)](_0x4c2781(0x171))),console[_0x4c2781(0x154)](_0x4c2781(0x1b3)+_0x3ec266[_0x4c2781(0x17f)]),console[_0x4c2781(0x154)](_0x4c2781(0x204)+_0x3ec266[_0x4c2781(0x206)]),console[_0x4c2781(0x154)](_0x4c2781(0x1dc)+(_0x3ec266[_0x4c2781(0x196)]?a4_0x334449[_0x4c2781(0x169)](_0x4c2781(0x18e)):_0x3ec266[_0x4c2781(0x1f0)]?a4_0x334449['yellow'](_0x4c2781(0x168)):a4_0x334449[_0x4c2781(0x179)](_0x4c2781(0x162)))),0x0;}const _0x5b19f9=_0x58aa6f||_0x47082a,{data:_0x113c93}=await withSpinner(_0x4c2781(0x1c4)+_0x1360cb+_0x4c2781(0x17e),()=>_0x23d063[_0x4c2781(0x180)][_0x4c2781(0x181)](_0x1360cb,_0x5b19f9,{'dryRun':!![]})),_0xdb2033=_0x113c93[_0x4c2781(0x170)]['agents'][_0x4c2781(0x18e)]+_0x113c93[_0x4c2781(0x170)]['knowledgeBases'][_0x4c2781(0x18e)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1ec)]['new']+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x18a)][_0x4c2781(0x18e)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1bd)][_0x4c2781(0x18e)]+_0x113c93['counts'][_0x4c2781(0x1de)]['new']+_0x113c93[_0x4c2781(0x170)]['experimentalArtifacts'][_0x4c2781(0x18e)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x16d)][_0x4c2781(0x18e)]+_0x113c93[_0x4c2781(0x170)]['chatInterfaces'][_0x4c2781(0x18e)],_0x92fa15=_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1df)]['updated']+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x203)][_0x4c2781(0x168)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1ec)]['updated']+_0x113c93['counts'][_0x4c2781(0x18a)][_0x4c2781(0x168)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1bd)][_0x4c2781(0x168)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1de)][_0x4c2781(0x168)]+_0x113c93['counts'][_0x4c2781(0x153)][_0x4c2781(0x168)]+_0x113c93[_0x4c2781(0x170)]['formInterfaces'][_0x4c2781(0x168)]+_0x113c93['counts'][_0x4c2781(0x1cd)][_0x4c2781(0x168)],_0x53445f=_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1df)]['unchanged']+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x203)][_0x4c2781(0x162)]+_0x113c93[_0x4c2781(0x170)]['textKnowledgeBases'][_0x4c2781(0x162)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x18a)][_0x4c2781(0x162)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1bd)]['unchanged']+_0x113c93['counts']['experimentalKnowledgeBases'][_0x4c2781(0x162)]+_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x153)][_0x4c2781(0x162)]+_0x113c93['counts'][_0x4c2781(0x16d)][_0x4c2781(0x162)]+_0x113c93['counts']['chatInterfaces'][_0x4c2781(0x162)];console[_0x4c2781(0x154)](_0x4c2781(0x16b)+_0x113c93[_0x4c2781(0x175)]+'\x27:'),console[_0x4c2781(0x154)]('\x20\x20'+a4_0x334449[_0x4c2781(0x169)]('+\x20'+_0xdb2033+_0x4c2781(0x184))+_0x4c2781(0x19b)+a4_0x334449['yellow']('~\x20'+_0x92fa15+_0x4c2781(0x155))+'\x20|\x20'+a4_0x334449[_0x4c2781(0x1da)]('=\x20'+_0x53445f+_0x4c2781(0x1fb))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1df)])),console[_0x4c2781(0x154)](_0x4c2781(0x1ce)+formatCountSummary(_0x113c93['counts']['knowledgeBases'])),console['log'](_0x4c2781(0x158)+formatCountSummary(_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1ec)])),console[_0x4c2781(0x154)](_0x4c2781(0x19f)+formatCountSummary(_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x18a)])),console[_0x4c2781(0x154)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1bd)])),console[_0x4c2781(0x154)](_0x4c2781(0x156)+formatCountSummary(_0x113c93['counts']['formInterfaces'])),console['log'](_0x4c2781(0x15c)+formatCountSummary(_0x113c93[_0x4c2781(0x170)][_0x4c2781(0x1cd)]));const _0x4cee21=_0x113c93['counts'][_0x4c2781(0x1de)][_0x4c2781(0x152)]>0x0||_0x113c93['counts'][_0x4c2781(0x153)][_0x4c2781(0x152)]>0x0;_0x4cee21&&(console[_0x4c2781(0x154)](_0x4c2781(0x1e7)+formatCountSummary(_0x113c93[_0x4c2781(0x170)]['experimentalKnowledgeBases'])),console['log'](_0x4c2781(0x1ab)+formatCountSummary(_0x113c93[_0x4c2781(0x170)]['experimentalArtifacts'])));console['log'](_0x4c2781(0x1e8)+a4_0x334449[_0x4c2781(0x198)](_0x113c93[_0x4c2781(0x195)])),displayDiffs(_0x113c93[_0x4c2781(0x1df)],_0x113c93['knowledgeBases'],_0x113c93['textKnowledgeBases'],_0x113c93[_0x4c2781(0x18a)],_0x113c93[_0x4c2781(0x1bd)],_0x113c93[_0x4c2781(0x1de)],_0x113c93[_0x4c2781(0x153)],_0x113c93[_0x4c2781(0x16d)],_0x113c93[_0x4c2781(0x1cd)]);if(_0x82b990)return console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x14d)](_0x4c2781(0x19d))),0x0;if(_0xdb2033===0x0&&_0x92fa15===0x0)return console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x169)](_0x4c2781(0x1ad))),saveSessionContext({'llm_project':_0x113c93[_0x4c2781(0x175)]},_0x3c2c6e[_0x4c2781(0x1e3)]),console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x169)](_0x4c2781(0x1e6)+a4_0x334449[_0x4c2781(0x1da)](_0x4c2781(0x1c9))+_0x4c2781(0x1d5)+a4_0x334449[_0x4c2781(0x198)](_0x113c93[_0x4c2781(0x175)]))),0x0;if(!_0x3f14f6&&!_0x54b137){if(!isInteractive())return console[_0x4c2781(0x1d0)](a4_0x334449[_0x4c2781(0x1d4)](_0x4c2781(0x194)),_0x4c2781(0x15e)),console['error'](a4_0x334449[_0x4c2781(0x1da)](_0x4c2781(0x167))),0x1;const _0x4f0d73=await confirmKey(_0x4c2781(0x1bb)+(_0xdb2033+_0x92fa15)+_0x4c2781(0x1ac));if(!_0x4f0d73)return console[_0x4c2781(0x154)](a4_0x334449[_0x4c2781(0x14d)](_0x4c2781(0x1e4)),'-\x20no\x20files\x20written'),0x1;}const {data:_0xffb66f}=await withSpinner('Writing\x20files...',()=>_0x23d063[_0x4c2781(0x180)][_0x4c2781(0x181)](_0x1360cb,_0x5b19f9,{'force':_0x54b137}));return console[_0x4c2781(0x154)](a4_0x334449['green'](_0x4c2781(0x1ca)+(_0xdb2033+_0x92fa15)+'\x20files\x20to\x20'+_0xffb66f[_0x4c2781(0x195)])),saveSessionContext({'llm_project':_0xffb66f['projectName']},_0x3c2c6e[_0x4c2781(0x1e3)]),console[_0x4c2781(0x154)](a4_0x334449['green'](_0x4c2781(0x1e6)+a4_0x334449['dim'](_0x4c2781(0x1c9))+_0x4c2781(0x1d5)+a4_0x334449[_0x4c2781(0x198)](_0xffb66f[_0x4c2781(0x175)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x38599c(0x176)]='agent:clone';[a4_0x38599c(0x18c)]=a4_0x38599c(0x183);async['execute'](_0xcbf46d){const _0x4ae52e=a4_0x38599c,{options:_0x3f34bf,args:_0x32d4cc,tdx:_0x3d9ccd}=_0xcbf46d,_0x5d1597=_0x32d4cc[0x0],_0x1a56d1=_0x3f34bf[_0x4ae52e(0x176)],_0x46c39f=_0x3f34bf[_0x4ae52e(0x1d6)],_0x5d266f=_0x3f34bf['yes'],_0x5c5c30=_0x3f34bf['site'],_0x586919=_0x3f34bf['llmProject'];let _0x5520f2;const _0x3c2e80=findAgentConfigPath(process[_0x4ae52e(0x1be)]());if(_0x5d1597){const _0x19927c=a4_0x20202e[_0x4ae52e(0x1f5)](_0x5d1597,_0x4ae52e(0x1b8));existsSync(_0x19927c)?(_0x5520f2=_0x5d1597,console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1da)](_0x4ae52e(0x1f8)+_0x5d1597))):_0x5520f2=_0x5d1597;}else{if(_0x3c2e80)_0x5520f2=a4_0x20202e[_0x4ae52e(0x1d1)](_0x3c2e80),console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1da)]('Using\x20current\x20project:\x20'+_0x5520f2));else{if(_0x586919){const _0x23d6d4=sanitizeForFilesystem(_0x586919);let _0x2737a1=_0x23d6d4,_0x2d7d25=a4_0x20202e['join'](process['cwd'](),_0x4ae52e(0x1df),_0x23d6d4,'tdx.json');if(!existsSync(_0x2d7d25)){const _0x23c3a1=normalizeName(_0x586919),_0xfe4afe=a4_0x20202e[_0x4ae52e(0x1f5)](process[_0x4ae52e(0x1be)](),_0x4ae52e(0x1df),_0x23c3a1,_0x4ae52e(0x1b8));existsSync(_0xfe4afe)&&(_0x2737a1=_0x23c3a1,_0x2d7d25=_0xfe4afe);}if(existsSync(_0x2d7d25))_0x5520f2=a4_0x20202e[_0x4ae52e(0x1d1)](_0x2d7d25),console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1da)](_0x4ae52e(0x1f8)+_0x5520f2));else{const _0x3dcfb5=_0x3f34bf[_0x4ae52e(0x17a)];if(_0x3dcfb5)throw new SDKError(ErrorCode[_0x4ae52e(0x1ed)],_0x4ae52e(0x1bc)+_0x586919+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x4ae52e(0x177)+_0x4ae52e(0x15f)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x586919+'\x0a')+(_0x4ae52e(0x190)+_0x2737a1+_0x4ae52e(0x1cb)+(_0x1a56d1||_0x4ae52e(0x19e))+'\x20--profile\x20'+_0x3dcfb5)});_0x5520f2=_0x586919,console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1da)](_0x4ae52e(0x1b9)+_0x586919));}}}}if(!_0x5520f2)return console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x14d)](_0x4ae52e(0x18b))),console[_0x4ae52e(0x154)](_0x4ae52e(0x1c3)),console[_0x4ae52e(0x154)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x4ae52e(0x154)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x4ae52e(0x154)](_0x4ae52e(0x157)),0x1;if(!_0x1a56d1)throw new SDKError(ErrorCode[_0x4ae52e(0x1b4)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x4ae52e(0x1dd)});if(!_0x5d266f&&!_0x46c39f){if(!isInteractive())return console[_0x4ae52e(0x1d0)](a4_0x334449['red'](_0x4ae52e(0x194)),_0x4ae52e(0x15e)),console[_0x4ae52e(0x1d0)](a4_0x334449[_0x4ae52e(0x1da)](_0x4ae52e(0x167))),0x1;const _0x2a25c4=await confirmKey(_0x4ae52e(0x197)+_0x5520f2+'\x22\x20to\x20new\x20project\x20\x22'+_0x1a56d1+'\x22?');if(!_0x2a25c4)return console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x14d)](_0x4ae52e(0x1e4))),0x1;}const {data:_0x22e562}=await withSpinner(_0x4ae52e(0x1b1)+_0x5520f2+_0x4ae52e(0x192)+_0x1a56d1+_0x4ae52e(0x17e),()=>_0x3d9ccd[_0x4ae52e(0x180)]['cloneProject'](_0x5520f2,_0x1a56d1,{'dryRun':_0x46c39f}));if(_0x46c39f){console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x14d)](_0x4ae52e(0x178))),console[_0x4ae52e(0x154)](_0x4ae52e(0x1f4)+_0x22e562[_0x4ae52e(0x1d9)]),console[_0x4ae52e(0x154)]('New\x20project:\x20'+_0x1a56d1),console[_0x4ae52e(0x154)](_0x4ae52e(0x187)),console[_0x4ae52e(0x154)](_0x4ae52e(0x1db)+_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1df)][_0x4ae52e(0x14c)]),console[_0x4ae52e(0x154)](_0x4ae52e(0x1ce)+_0x22e562['counts'][_0x4ae52e(0x203)][_0x4ae52e(0x14c)]),console[_0x4ae52e(0x154)](_0x4ae52e(0x19f)+_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x18a)]['created']),console[_0x4ae52e(0x154)](_0x4ae52e(0x156)+_0x22e562[_0x4ae52e(0x170)]['formInterfaces'][_0x4ae52e(0x14c)]),console[_0x4ae52e(0x154)](_0x4ae52e(0x15c)+_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1cd)]['created']);const _0x649c35=_0x22e562[_0x4ae52e(0x170)]['experimentalKnowledgeBases'][_0x4ae52e(0x14c)]>0x0||_0x22e562['counts'][_0x4ae52e(0x153)][_0x4ae52e(0x14c)]>0x0;return _0x649c35&&(console[_0x4ae52e(0x154)](_0x4ae52e(0x1e7)+_0x22e562['counts'][_0x4ae52e(0x1de)]['created']),console[_0x4ae52e(0x154)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x153)]['created'])),0x0;}const _0x4cce61=_0x22e562[_0x4ae52e(0x170)]['agents'][_0x4ae52e(0x208)]>0x0||_0x22e562[_0x4ae52e(0x170)]['knowledgeBases']['errors']>0x0||_0x22e562['counts'][_0x4ae52e(0x18a)][_0x4ae52e(0x208)]>0x0||_0x22e562[_0x4ae52e(0x170)]['formInterfaces']['errors']>0x0||_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1cd)][_0x4ae52e(0x208)]>0x0||_0x22e562['counts'][_0x4ae52e(0x1de)][_0x4ae52e(0x208)]>0x0||_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x153)][_0x4ae52e(0x208)]>0x0;_0x4cce61?console['log'](a4_0x334449['yellow'](_0x4ae52e(0x17d))):console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x169)](_0x4ae52e(0x1f3)));console[_0x4ae52e(0x154)](_0x4ae52e(0x1f4)+_0x22e562['sourceProjectName']),console[_0x4ae52e(0x154)](_0x4ae52e(0x1a5)+_0x22e562[_0x4ae52e(0x1b5)]),console['log']('New\x20project\x20ID:\x20'+_0x22e562[_0x4ae52e(0x201)]),console[_0x4ae52e(0x154)](),console['log']('Summary:'),console[_0x4ae52e(0x154)](_0x4ae52e(0x1db)+formatCountSummary(_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1df)])),console[_0x4ae52e(0x154)](_0x4ae52e(0x1ce)+formatCountSummary(_0x22e562['counts'][_0x4ae52e(0x203)])),console[_0x4ae52e(0x154)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x22e562['counts'][_0x4ae52e(0x18a)])),console[_0x4ae52e(0x154)](_0x4ae52e(0x1d3)+formatCountSummary(_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1bd)])),console['log']('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x16d)])),console[_0x4ae52e(0x154)](_0x4ae52e(0x15c)+formatCountSummary(_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1cd)]));const _0x8ab6d4=_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1de)][_0x4ae52e(0x14c)]>0x0||_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x1de)][_0x4ae52e(0x168)]>0x0||_0x22e562[_0x4ae52e(0x170)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x22e562['counts'][_0x4ae52e(0x153)]['created']>0x0||_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x153)][_0x4ae52e(0x168)]>0x0||_0x22e562[_0x4ae52e(0x170)]['experimentalArtifacts']['unchanged']>0x0;_0x8ab6d4&&(console[_0x4ae52e(0x154)](_0x4ae52e(0x1e7)+formatCountSummary(_0x22e562['counts'][_0x4ae52e(0x1de)])),console[_0x4ae52e(0x154)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x22e562[_0x4ae52e(0x170)][_0x4ae52e(0x153)])));if(_0x4cce61){console[_0x4ae52e(0x154)](),console['log'](a4_0x334449[_0x4ae52e(0x1d4)](_0x4ae52e(0x1c6)));for(const _0x4df3b9 of _0x22e562[_0x4ae52e(0x1df)]){_0x4df3b9[_0x4ae52e(0x1ff)]==='error'&&console[_0x4ae52e(0x154)](a4_0x334449['red'](_0x4ae52e(0x1ba)+_0x4df3b9[_0x4ae52e(0x17f)]+_0x4ae52e(0x1c1)+_0x4df3b9[_0x4ae52e(0x1d0)]));}for(const _0x34ea69 of _0x22e562[_0x4ae52e(0x203)]){_0x34ea69[_0x4ae52e(0x1ff)]===_0x4ae52e(0x1d0)&&console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1d4)](_0x4ae52e(0x17b)+_0x34ea69['name']+_0x4ae52e(0x1c1)+_0x34ea69[_0x4ae52e(0x1d0)]));}for(const _0x3a0b1c of _0x22e562['prompts']){_0x3a0b1c['action']===_0x4ae52e(0x1d0)&&console[_0x4ae52e(0x154)](a4_0x334449['red'](_0x4ae52e(0x14f)+_0x3a0b1c[_0x4ae52e(0x176)]+'\x22:\x20'+_0x3a0b1c[_0x4ae52e(0x1d0)]));}for(const _0x2fc4cb of _0x22e562[_0x4ae52e(0x1bd)]){_0x2fc4cb[_0x4ae52e(0x1ff)]==='error'&&console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1d4)]('\x20\x20Integration\x20\x22'+_0x2fc4cb['name']+_0x4ae52e(0x1c1)+_0x2fc4cb['error']));}for(const _0x38ebdd of _0x22e562[_0x4ae52e(0x16d)]){_0x38ebdd['action']==='error'&&console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1d4)](_0x4ae52e(0x1a6)+_0x38ebdd[_0x4ae52e(0x176)]+'\x22:\x20'+_0x38ebdd['error']));}for(const _0x116f17 of _0x22e562[_0x4ae52e(0x1cd)]){_0x116f17[_0x4ae52e(0x1ff)]==='error'&&console['log'](a4_0x334449['red'](_0x4ae52e(0x1fe)+_0x116f17[_0x4ae52e(0x176)]+_0x4ae52e(0x1c1)+_0x116f17['error']));}for(const _0x2eea2e of _0x22e562[_0x4ae52e(0x1de)]){_0x2eea2e['action']===_0x4ae52e(0x1d0)&&console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1d4)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x2eea2e['name']+_0x4ae52e(0x1c1)+_0x2eea2e[_0x4ae52e(0x1d0)]));}for(const _0x3e05e6 of _0x22e562[_0x4ae52e(0x153)]){_0x3e05e6[_0x4ae52e(0x1ff)]===_0x4ae52e(0x1d0)&&console[_0x4ae52e(0x154)](a4_0x334449[_0x4ae52e(0x1d4)](_0x4ae52e(0x1af)+_0x3e05e6[_0x4ae52e(0x176)]+_0x4ae52e(0x1c1)+_0x3e05e6[_0x4ae52e(0x1d0)]));}return 0x1;}console[_0x4ae52e(0x154)]();const _0x5770f6=getLLMProjectUrl(_0x5c5c30,_0x22e562[_0x4ae52e(0x201)]);return console[_0x4ae52e(0x154)]('Project:\x20'+a4_0x334449[_0x4ae52e(0x198)](_0x5770f6)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x38599c(0x176)]=a4_0x38599c(0x1a1);[a4_0x38599c(0x18c)]=a4_0x38599c(0x1f1);async[a4_0x38599c(0x1fd)](_0x2a339a){const _0x487e8d=a4_0x38599c,{options:_0x3b1974,args:_0x55310c,tdx:_0x284cb0}=_0x2a339a;let _0x505e60=_0x55310c[0x0]||process['cwd']();const _0x24bfdd=_0x3b1974[_0x487e8d(0x1d6)],_0x472553=_0x3b1974[_0x487e8d(0x1d8)],_0x5ed91d=_0x3b1974[_0x487e8d(0x16c)],_0x298811=_0x3b1974[_0x487e8d(0x1e5)],_0x230518=a4_0x20202e[_0x487e8d(0x1f5)](_0x505e60,_0x487e8d(0x161)),_0x324f77=existsSync(_0x230518);if(_0x324f77){const {data:_0x3c8c21}=await withSpinner(_0x487e8d(0x1ee)+_0x505e60+_0x487e8d(0x17e),()=>_0x284cb0[_0x487e8d(0x180)][_0x487e8d(0x166)](_0x505e60,{'dryRun':_0x24bfdd,'force':_0x472553}));if(_0x24bfdd)return console['log'](a4_0x334449[_0x487e8d(0x14d)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x487e8d(0x154)](_0x487e8d(0x188)+_0x3c8c21[_0x487e8d(0x17f)]),0x0;if(_0x3c8c21[_0x487e8d(0x1ff)]==='error')return console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)](_0x487e8d(0x20a)+_0x3c8c21[_0x487e8d(0x1d0)])),0x1;console['log'](a4_0x334449['green'](_0x487e8d(0x1eb)+_0x3c8c21[_0x487e8d(0x1ff)]+_0x487e8d(0x16f))),console[_0x487e8d(0x154)](_0x487e8d(0x1b3)+_0x3c8c21[_0x487e8d(0x17f)]);if(_0x3c8c21[_0x487e8d(0x1b0)]&&_0x3c8c21[_0x487e8d(0x1b6)]){const _0x30a67d=getLLMAgentChatUrl(_0x298811,_0x3c8c21['projectId'],_0x3c8c21[_0x487e8d(0x1b0)]);console[_0x487e8d(0x154)](_0x487e8d(0x1b7)+a4_0x334449[_0x487e8d(0x198)](_0x30a67d));}return 0x0;}const _0x52a934=_0x3b1974['llmProject'],_0x4bbbbb=resolveProjectFromContext(_0x505e60,_0x52a934);if(_0x4bbbbb[_0x487e8d(0x173)])_0x505e60=_0x4bbbbb[_0x487e8d(0x17c)],_0x4bbbbb[_0x487e8d(0x1a0)]===_0x487e8d(0x15a)&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1da)](_0x487e8d(0x15d)+_0x505e60));else{let _0x29a68b=_0x487e8d(0x1b2);_0x4bbbbb['reason']===_0x487e8d(0x182)&&(_0x29a68b=_0x4bbbbb[_0x487e8d(0x165)]+_0x487e8d(0x202)+_0x4bbbbb['llmProject']+_0x487e8d(0x186));throw new SDKError(ErrorCode[_0x487e8d(0x1ed)],_0x4bbbbb[_0x487e8d(0x1f6)]===_0x487e8d(0x18f)?_0x4bbbbb['message']:_0x487e8d(0x185)+_0x505e60,undefined,{'helpText':_0x29a68b});}const {data:_0x4ab168}=await withSpinner(_0x487e8d(0x15b),()=>_0x284cb0[_0x487e8d(0x180)]['pushProject'](_0x505e60,{'dryRun':!![]})),_0x465cf5=_0x4ab168[_0x487e8d(0x170)]['agents'][_0x487e8d(0x208)]>0x0;if(_0x465cf5){console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)](_0x487e8d(0x1e9)));for(const _0x55374c of _0x4ab168[_0x487e8d(0x1df)]){_0x55374c[_0x487e8d(0x1ff)]===_0x487e8d(0x1d0)&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)]('\x20\x20Agent\x20\x22'+_0x55374c[_0x487e8d(0x17f)]+_0x487e8d(0x1c1)+_0x55374c[_0x487e8d(0x1d0)]));}return 0x1;}const _0x1bb3d1=_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1df)][_0x487e8d(0x14c)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x203)][_0x487e8d(0x14c)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1ec)]['created']+_0x4ab168['counts'][_0x487e8d(0x18a)][_0x487e8d(0x14c)]+_0x4ab168[_0x487e8d(0x170)]['integrations']['created']+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1de)][_0x487e8d(0x14c)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x153)][_0x487e8d(0x14c)]+_0x4ab168[_0x487e8d(0x170)]['formInterfaces'][_0x487e8d(0x14c)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1cd)]['created'],_0x193432=_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1df)]['updated']+_0x4ab168['counts'][_0x487e8d(0x203)][_0x487e8d(0x168)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1ec)][_0x487e8d(0x168)]+_0x4ab168['counts']['prompts'][_0x487e8d(0x168)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1bd)][_0x487e8d(0x168)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1de)][_0x487e8d(0x168)]+_0x4ab168['counts'][_0x487e8d(0x153)][_0x487e8d(0x168)]+_0x4ab168[_0x487e8d(0x170)]['formInterfaces']['updated']+_0x4ab168[_0x487e8d(0x170)]['chatInterfaces'][_0x487e8d(0x168)],_0x5976dc=_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1df)][_0x487e8d(0x162)]+_0x4ab168[_0x487e8d(0x170)]['knowledgeBases'][_0x487e8d(0x162)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1ec)]['unchanged']+_0x4ab168[_0x487e8d(0x170)]['prompts'][_0x487e8d(0x162)]+_0x4ab168['counts'][_0x487e8d(0x1bd)][_0x487e8d(0x162)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1de)][_0x487e8d(0x162)]+_0x4ab168['counts']['experimentalArtifacts'][_0x487e8d(0x162)]+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x16d)]['unchanged']+_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1cd)][_0x487e8d(0x162)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x4ab168[_0x487e8d(0x175)]+'\x27:'),console[_0x487e8d(0x154)]('\x20\x20'+a4_0x334449['green']('+\x20'+_0x1bb3d1+_0x487e8d(0x184))+_0x487e8d(0x19b)+a4_0x334449[_0x487e8d(0x14d)]('~\x20'+_0x193432+_0x487e8d(0x155))+'\x20|\x20'+a4_0x334449[_0x487e8d(0x1da)]('=\x20'+_0x5976dc+'\x20unchanged')),console['log'](_0x487e8d(0x1db)+formatCountSummary(_0x4ab168['counts']['agents'])),console[_0x487e8d(0x154)](_0x487e8d(0x1ce)+formatCountSummary(_0x4ab168['counts'][_0x487e8d(0x203)])),console['log'](_0x487e8d(0x158)+formatCountSummary(_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1ec)])),console[_0x487e8d(0x154)](_0x487e8d(0x19f)+formatCountSummary(_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x18a)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1bd)])),console[_0x487e8d(0x154)](_0x487e8d(0x156)+formatCountSummary(_0x4ab168['counts'][_0x487e8d(0x16d)])),console[_0x487e8d(0x154)](_0x487e8d(0x15c)+formatCountSummary(_0x4ab168[_0x487e8d(0x170)]['chatInterfaces']));const _0x413d67=_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1de)][_0x487e8d(0x14c)]>0x0||_0x4ab168[_0x487e8d(0x170)]['experimentalKnowledgeBases']['updated']>0x0||_0x4ab168[_0x487e8d(0x170)]['experimentalKnowledgeBases'][_0x487e8d(0x162)]>0x0||_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x153)][_0x487e8d(0x14c)]>0x0||_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x153)][_0x487e8d(0x168)]>0x0||_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x153)][_0x487e8d(0x162)]>0x0;_0x413d67&&(console['log'](_0x487e8d(0x1e7)+formatCountSummary(_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x1de)])),console['log'](_0x487e8d(0x1ab)+formatCountSummary(_0x4ab168[_0x487e8d(0x170)][_0x487e8d(0x153)])));console[_0x487e8d(0x154)]('\x20\x20Source:\x20'+a4_0x334449[_0x487e8d(0x198)](_0x505e60)),displayDiffs(_0x4ab168[_0x487e8d(0x1df)],_0x4ab168[_0x487e8d(0x203)],_0x4ab168['textKnowledgeBases'],_0x4ab168[_0x487e8d(0x18a)],_0x4ab168[_0x487e8d(0x1bd)],_0x4ab168[_0x487e8d(0x1de)],_0x4ab168[_0x487e8d(0x153)],_0x4ab168[_0x487e8d(0x16d)],_0x4ab168['chatInterfaces']);if(_0x24bfdd)return console[_0x487e8d(0x154)](a4_0x334449['yellow'](_0x487e8d(0x16a))),0x0;if(_0x1bb3d1===0x0&&_0x193432===0x0){console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x169)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x113355=getLLMProjectUrl(_0x298811,_0x4ab168[_0x487e8d(0x1b6)]);return console[_0x487e8d(0x154)]('Project:\x20'+a4_0x334449['cyan'](_0x113355)),0x0;}if(!_0x5ed91d&&!_0x472553){if(!isInteractive())return console[_0x487e8d(0x1d0)](a4_0x334449[_0x487e8d(0x1d4)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x487e8d(0x1d0)](a4_0x334449[_0x487e8d(0x1da)](_0x487e8d(0x167))),0x1;const _0x7a2cb1=await confirmKey(_0x487e8d(0x1aa)+(_0x1bb3d1+_0x193432)+'\x20resources?');if(!_0x7a2cb1)return console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x14d)]('Cancelled'),_0x487e8d(0x1c2)),0x1;}const {data:_0x221ae5}=await withSpinner(_0x487e8d(0x191),()=>_0x284cb0[_0x487e8d(0x180)][_0x487e8d(0x1ef)](_0x505e60,{'force':_0x472553})),_0x13e3fe=_0x221ae5[_0x487e8d(0x170)][_0x487e8d(0x1df)]['errors']>0x0||_0x221ae5[_0x487e8d(0x170)][_0x487e8d(0x203)][_0x487e8d(0x208)]>0x0||_0x221ae5[_0x487e8d(0x170)]['textKnowledgeBases'][_0x487e8d(0x208)]>0x0||_0x221ae5[_0x487e8d(0x170)][_0x487e8d(0x18a)]['errors']>0x0||_0x221ae5[_0x487e8d(0x170)][_0x487e8d(0x16d)][_0x487e8d(0x208)]>0x0||_0x221ae5[_0x487e8d(0x170)]['chatInterfaces'][_0x487e8d(0x208)]>0x0;if(_0x13e3fe){console[_0x487e8d(0x154)](a4_0x334449['yellow'](_0x487e8d(0x209))),console[_0x487e8d(0x154)](),console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)](_0x487e8d(0x1c6)));for(const _0x271063 of _0x221ae5[_0x487e8d(0x1df)]){_0x271063['action']===_0x487e8d(0x1d0)&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)](_0x487e8d(0x1ba)+_0x271063[_0x487e8d(0x17f)]+_0x487e8d(0x1c1)+_0x271063[_0x487e8d(0x1d0)]));}for(const _0x31dc19 of _0x221ae5[_0x487e8d(0x203)]){_0x31dc19[_0x487e8d(0x1ff)]===_0x487e8d(0x1d0)&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x31dc19[_0x487e8d(0x176)]+'\x22:\x20'+_0x31dc19['error']));}for(const _0x54300c of _0x221ae5[_0x487e8d(0x1ec)]){_0x54300c[_0x487e8d(0x1ff)]==='error'&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x54300c[_0x487e8d(0x176)]+_0x487e8d(0x1c1)+_0x54300c[_0x487e8d(0x1d0)]));}for(const _0x3c28c9 of _0x221ae5['prompts']){_0x3c28c9[_0x487e8d(0x1ff)]==='error'&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)](_0x487e8d(0x14f)+_0x3c28c9[_0x487e8d(0x176)]+_0x487e8d(0x1c1)+_0x3c28c9[_0x487e8d(0x1d0)]));}for(const _0x257715 of _0x221ae5['integrations']){_0x257715[_0x487e8d(0x1ff)]==='error'&&console[_0x487e8d(0x154)](a4_0x334449['red']('\x20\x20Integration\x20\x22'+_0x257715[_0x487e8d(0x176)]+_0x487e8d(0x1c1)+_0x257715[_0x487e8d(0x1d0)]));}for(const _0x4bc236 of _0x221ae5[_0x487e8d(0x16d)]){_0x4bc236['action']==='error'&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)](_0x487e8d(0x1a6)+_0x4bc236[_0x487e8d(0x176)]+_0x487e8d(0x1c1)+_0x4bc236['error']));}for(const _0x2655d3 of _0x221ae5['chatInterfaces']){_0x2655d3['action']===_0x487e8d(0x1d0)&&console[_0x487e8d(0x154)](a4_0x334449[_0x487e8d(0x1d4)](_0x487e8d(0x1fe)+_0x2655d3[_0x487e8d(0x176)]+_0x487e8d(0x1c1)+_0x2655d3[_0x487e8d(0x1d0)]));}return 0x1;}console[_0x487e8d(0x154)](a4_0x334449['green']('\x0a✔\x20Pushed\x20'+(_0x1bb3d1+_0x193432)+_0x487e8d(0x1d2)+_0x221ae5['projectName']+'\x27'));const _0x54deb3=getLLMProjectUrl(_0x298811,_0x221ae5[_0x487e8d(0x1b6)]);return console[_0x487e8d(0x154)]('Project:\x20'+a4_0x334449[_0x487e8d(0x198)](_0x54deb3)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x57d988=a5_0xbe34;(function(_0x421457,_0x2d290f){const _0x54625c=a5_0xbe34,_0x43d4a3=_0x421457();while(!![]){try{const _0x3bd55b=-parseInt(_0x54625c(0x226))/0x1*(-parseInt(_0x54625c(0x1ee))/0x2)+parseInt(_0x54625c(0x224))/0x3*(parseInt(_0x54625c(0x1cf))/0x4)+-parseInt(_0x54625c(0x1a5))/0x5+-parseInt(_0x54625c(0x1ab))/0x6+-parseInt(_0x54625c(0x1a1))/0x7+-parseInt(_0x54625c(0x228))/0x8*(-parseInt(_0x54625c(0x215))/0x9)+parseInt(_0x54625c(0x20d))/0xa;if(_0x3bd55b===_0x2d290f)break;else _0x43d4a3['push'](_0x43d4a3['shift']());}catch(_0x3e7904){_0x43d4a3['push'](_0x43d4a3['shift']());}}}(a5_0x7285,0x8d9a6));function a5_0xbe34(_0x4652a2,_0x194a5c){_0x4652a2=_0x4652a2-0x1a0;const _0x728559=a5_0x7285();let _0xbe341f=_0x728559[_0x4652a2];return _0xbe341f;}import*as a5_0x92ec42 from'node:fs';import*as a5_0x4cec4 from'node:path';import a5_0x45049c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x7285(){const _0xbcc4ba=['multiple_agents','agent:test','some','round','✗\x20FAIL:\x20','tags','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','ERROR','No\x20tests\x20found\x20matching:\x20','verbose','length','executeReeval','Passed:\x20\x20\x20','10552420BZWGFo','agentDirs','conversation_url','not\x20found','✗\x20ERROR:\x20','⚠\x20SKIPPED:\x20','white','Duration:\x20','9rwxDgG','agentName','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','includes','...','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','dryRun','filter','no_context','Total:\x20\x20\x20\x20','toLowerCase','Re-evaluating\x20','map','push','Either\x20switch\x20to\x20the\x20\x22','9zSLYkg','Available\x20tags:\x20','42XXwyhf','Cached\x20run\x20from:\x20','995128Gqmdwn','dim','Re-evaluating...','tests','size','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','PASS','Executing\x20new\x20tests...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✓\x20PASS:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','\x27\x20to\x20create\x20the\x20folder\x20structure.','Running:\x20','Available\x20tests:\x20','rounds','message','Usage:','1879612RyPwJV','Run\x20tests\x20for\x20an\x20LLM\x20agent','jsonl','agent','4323995zdUlJu','reeval','text','FAIL','stop','split','5319414jzZjrU','\x20\x20Evaluating...\x20','repeat','test.yml','Running\x20test:\x20','description','red','Round\x201/','No\x20tests\x20have\x20tags\x20defined.','isSpinning','/<agent-name>','add','Round\x20','Re-evaluation\x20Summary','conversations','forEach','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Evaluating\x20response...','trim','\x22:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','tsv','Error\x20writing\x20output\x20file:\x20','join','toISOString','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','testYmlPath','execute','writeFileSync','yellow','Test\x20Summary','now','resolveProjectId',':\x20Sending\x20user\x20input...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Conversation\x20URL:\x20','516692WsTPFj','\x20\x20Round\x20','site','green','existsSync','has','name','Agent:\x20','llmProject','source','Output\x20written\x20to:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','...\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','404','Cached\x20run\x20is\x20from\x20site\x20\x22','llm','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','table','\x20\x20Project:\x20','New\x20tests\x20to\x20execute:\x20','\x20-\x20','Errors:\x20\x20\x20','reason','Re-evaluating\x20cached\x20test\x20run...','\x20(new)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','start','\x20\x20Conversation:\x20','\x20\x20Agent:\x20','status','49178hIbUBt','Project\x20path:\x20','Running\x20agent\x20tests...','\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)','projectName','substring','\x20\x20-\x20','Using\x20agent:\x20','Failed:\x20\x20\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','json','log','Failed\x20Tests:','testName','\x22,\x20but\x20current\x20site\x20is\x20\x22','projectDir','no_local_folder','Tests\x20found:\x20'];a5_0x7285=function(){return _0xbcc4ba;};return a5_0x7285();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x57d988(0x1d5)]=a5_0x57d988(0x201);[a5_0x57d988(0x1b0)]=a5_0x57d988(0x1a2);async[a5_0x57d988(0x1c6)](_0x1099e9){const _0x3e899e=a5_0x57d988,{options:_0x13c360,args:_0x573045,tdx:_0x5e46fc}=_0x1099e9,_0x41f389=_0x573045[0x0]||'.',_0xa62562=_0x13c360[_0x3e899e(0x21b)],_0x1dad33=_0x13c360,_0x529cc4=_0x1dad33['eval']===![],_0x5affbb=_0x1dad33[_0x3e899e(0x1a6)],_0x46280d=_0x1dad33[_0x3e899e(0x1d5)],_0x5721e1=_0x1dad33[_0x3e899e(0x205)],_0x442b97=_0x13c360['site'],_0x566e86=_0x1dad33['output'];if(_0x5affbb&&_0x529cc4)return console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x1b0afa='table';if(_0x1dad33[_0x3e899e(0x1f8)])_0x1b0afa=_0x3e899e(0x1f8);else{if(_0x1dad33[_0x3e899e(0x1a3)])_0x1b0afa=_0x3e899e(0x1a3);else{if(_0x1dad33[_0x3e899e(0x1c0)])_0x1b0afa=_0x3e899e(0x1c0);else{if(_0x1dad33[_0x3e899e(0x1e1)])_0x1b0afa=_0x3e899e(0x1e1);}}}const _0x4732a0=_0x1dad33[_0x3e899e(0x1d7)];let _0x540d29=_0x41f389;const _0x553dca=a5_0x92ec42[_0x3e899e(0x1d3)](_0x41f389),_0x3cdc02=_0x41f389==='.';if(!_0x553dca||_0x3cdc02){const _0x496c08=resolveProjectFromContext(_0x41f389,_0x4732a0,{'requireFile':_0x3e899e(0x1ae)});if(_0x496c08['found'])_0x540d29=_0x496c08[_0x3e899e(0x1fd)],_0x496c08[_0x3e899e(0x1d8)]==='context'&&console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x1f5)+_0x540d29));else switch(_0x496c08[_0x3e899e(0x1e6)]){case _0x3e899e(0x21d):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x496c08['message'])),console[_0x3e899e(0x1f9)](),console['log'](_0x3e899e(0x1a0)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1f7)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1f1)),console[_0x3e899e(0x1f9)](),console['log'](_0x3e899e(0x1da));return 0x1;case _0x3e899e(0x1fe):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x496c08['message'])),console['log'](),console[_0x3e899e(0x1f9)](_0x3e899e(0x1bf)+_0x496c08['llmProject']+_0x3e899e(0x233));return 0x1;case _0x3e899e(0x200):{const _0x529b00=a5_0x4cec4['basename'](_0x496c08['projectDir']);console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x3e899e(0x21a)+_0x496c08[_0x3e899e(0x1d7)]+'\x22:'));for(const _0x1ca9be of _0x496c08[_0x3e899e(0x20e)]){console['log'](_0x3e899e(0x1f4)+_0x1ca9be);}return console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x3e899e(0x230)+_0x529b00+_0x3e899e(0x1b5)),0x1;}case'no_tests':console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x496c08[_0x3e899e(0x1d7)]+'\x22.')),console[_0x3e899e(0x1f9)](a5_0x45049c['dim'](_0x3e899e(0x1ef)+_0x496c08[_0x3e899e(0x1fd)])),console['log'](),console['log'](_0x3e899e(0x1c4));return 0x1;}}const {definition:_0x57959c,agentInfo:_0x101998}=parseTestFile(_0x540d29);let _0x5f00f3=_0x57959c[_0x3e899e(0x22b)];if(_0x46280d){const _0x5b5f80=_0x46280d['split'](',')[_0x3e899e(0x221)](_0x4c3e2f=>_0x4c3e2f[_0x3e899e(0x1bd)]());_0x5f00f3=_0x57959c[_0x3e899e(0x22b)][_0x3e899e(0x21c)](_0x2099c3=>_0x5b5f80[_0x3e899e(0x218)](_0x2099c3[_0x3e899e(0x1d5)]));if(_0x5f00f3[_0x3e899e(0x20a)]===0x0)return console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x3e899e(0x208)+_0x46280d)),console[_0x3e899e(0x1f9)](a5_0x45049c['dim'](_0x3e899e(0x235)+_0x57959c['tests'][_0x3e899e(0x221)](_0x54f011=>_0x54f011['name'])[_0x3e899e(0x1c2)](',\x20'))),0x1;}if(_0x5721e1){const _0x4ba23f=_0x5721e1[_0x3e899e(0x1aa)](',')[_0x3e899e(0x221)](_0x46b8bb=>_0x46b8bb['trim']()['toLowerCase']());_0x5f00f3=_0x5f00f3[_0x3e899e(0x21c)](_0x13e587=>_0x13e587[_0x3e899e(0x205)]?.[_0x3e899e(0x202)](_0x1b5c51=>_0x4ba23f['includes'](_0x1b5c51[_0x3e899e(0x21f)]())));if(_0x5f00f3['length']===0x0){console[_0x3e899e(0x1f9)](a5_0x45049c['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5721e1));const _0x258641=new Set();return _0x57959c[_0x3e899e(0x22b)][_0x3e899e(0x1ba)](_0x4731b6=>_0x4731b6[_0x3e899e(0x205)]?.[_0x3e899e(0x1ba)](_0x19b14e=>_0x258641[_0x3e899e(0x1b6)](_0x19b14e))),_0x258641[_0x3e899e(0x22c)]>0x0?console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x225)+[..._0x258641][_0x3e899e(0x1c2)](',\x20'))):console['log'](a5_0x45049c['dim'](_0x3e899e(0x1b3))),0x1;}}if(_0x5affbb)return this['executeReeval'](_0x1099e9,{'definition':{'tests':_0x5f00f3},'agentInfo':_0x101998,'outputFormat':_0x1b0afa,'outputFile':_0x566e86,'testNames':_0x46280d});if(_0xa62562){console[_0x3e899e(0x1f9)](a5_0x45049c['cyan']('Test\x20Configuration:')),console[_0x3e899e(0x1f9)]('\x20\x20Site:\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x442b97)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1e2)+a5_0x45049c['white'](_0x101998['projectName'])),console[_0x3e899e(0x1f9)](_0x3e899e(0x1ec)+a5_0x45049c[_0x3e899e(0x213)](_0x101998[_0x3e899e(0x216)])),console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x3e899e(0x1ff)+a5_0x45049c[_0x3e899e(0x213)](_0x5f00f3[_0x3e899e(0x20a)]));for(let _0x446af4=0x0;_0x446af4<_0x5f00f3[_0x3e899e(0x20a)];_0x446af4++){const _0xeda331=_0x5f00f3[_0x446af4],_0x145d96=_0xeda331['rounds'][_0x3e899e(0x20a)]===0x1?_0x3e899e(0x203):_0x3e899e(0x236),_0x1838f5=_0xeda331[_0x3e899e(0x205)]?.['length']?'\x20['+_0xeda331[_0x3e899e(0x205)][_0x3e899e(0x1c2)](',\x20')+']':'';console[_0x3e899e(0x1f9)]('\x20\x20'+(_0x446af4+0x1)+'.\x20'+a5_0x45049c['white'](_0xeda331['name'])+'\x20('+_0xeda331[_0x3e899e(0x236)]['length']+'\x20'+_0x145d96+')'+a5_0x45049c[_0x3e899e(0x229)](_0x1838f5));}return 0x0;}let _0x2e7ff1,_0x31aab7;try{_0x2e7ff1=await _0x5e46fc['llm'][_0x3e899e(0x1cb)](_0x101998['projectName']);}catch(_0x13a09d){const _0x438dae=_0x13a09d instanceof Error?_0x13a09d['message']:String(_0x13a09d);return _0x438dae[_0x3e899e(0x218)](_0x3e899e(0x1dd))||_0x438dae[_0x3e899e(0x21f)]()[_0x3e899e(0x218)](_0x3e899e(0x210))?console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x101998['projectName'])):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x217)+_0x101998[_0x3e899e(0x1f2)]+_0x3e899e(0x1be)+_0x438dae)),0x1;}try{_0x31aab7=await _0x5e46fc[_0x3e899e(0x1df)]['resolveAgentId'](_0x101998[_0x3e899e(0x216)],_0x2e7ff1);}catch(_0x43064a){const _0x42c496=_0x43064a instanceof Error?_0x43064a[_0x3e899e(0x237)]:String(_0x43064a);return _0x42c496[_0x3e899e(0x218)](_0x3e899e(0x1dd))||_0x42c496[_0x3e899e(0x21f)]()[_0x3e899e(0x218)](_0x3e899e(0x210))?console['log'](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x1e9)+_0x101998[_0x3e899e(0x216)])):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x1dc)+_0x101998[_0x3e899e(0x216)]+_0x3e899e(0x1be)+_0x42c496)),0x1;}let _0x20d5d2;if(!_0x529cc4)try{_0x20d5d2=await setupEvaluatorAgent(_0x5e46fc[_0x3e899e(0x1df)],_0x13c360[_0x3e899e(0x209)]);}catch(_0x183909){const _0x2ef45e=_0x183909 instanceof Error?_0x183909[_0x3e899e(0x237)]:String(_0x183909);return console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x1cd)+_0x2ef45e)),0x1;}console[_0x3e899e(0x1f9)](a5_0x45049c['cyan'](_0x3e899e(0x1f0))),console[_0x3e899e(0x1f9)]('Site:\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x442b97)),console[_0x3e899e(0x1f9)]('Agent:\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x101998['projectName']+'/'+_0x101998['agentName'])),console[_0x3e899e(0x1f9)]();const _0x5dc517=[],_0x936e57=[],_0x16a589=Date['now']();for(let _0xdb8dff=0x0;_0xdb8dff<_0x5f00f3[_0x3e899e(0x20a)];_0xdb8dff++){const _0x5953cb=_0x5f00f3[_0xdb8dff];_0x5f00f3[_0x3e899e(0x20a)]>0x1?console[_0x3e899e(0x1f9)]('Test\x20'+(_0xdb8dff+0x1)+'/'+_0x5f00f3[_0x3e899e(0x20a)]+':\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x5953cb[_0x3e899e(0x1d5)])):console[_0x3e899e(0x1f9)](_0x3e899e(0x1af)+a5_0x45049c['white'](_0x5953cb[_0x3e899e(0x1d5)]));const _0x2e570a=createCommandSpinner(_0x3e899e(0x1b2)+_0x5953cb[_0x3e899e(0x236)][_0x3e899e(0x20a)]+_0x3e899e(0x1cc));_0x2e570a['start']();try{const {result:_0x34ecdb,conversation:_0x33edc2}=await runTest(_0x5e46fc[_0x3e899e(0x1df)],_0x5953cb,{'agentId':_0x31aab7,'projectId':_0x2e7ff1,'site':_0x442b97,'noEval':_0x529cc4,'evaluatorId':_0x20d5d2,'onRoundStart':(_0x3b3519,_0x58b078)=>{const _0x3c3963=_0x3e899e;_0x2e570a['text']=_0x3c3963(0x1b7)+(_0x3b3519+0x1)+'/'+_0x58b078+_0x3c3963(0x1cc);},'onRoundComplete':(_0x31f68a,_0x400c25,_0x54c501)=>{const _0x41fdeb=_0x3e899e,_0x32d15b=formatElapsed(_0x400c25);_0x54c501?console[_0x41fdeb(0x1f9)](_0x41fdeb(0x1d0)+(_0x31f68a+0x1)+'/'+_0x5953cb['rounds'][_0x41fdeb(0x20a)]+_0x41fdeb(0x1db)+a5_0x45049c[_0x41fdeb(0x1d2)]('✓')+'\x20('+_0x32d15b+')'):console[_0x41fdeb(0x1f9)]('\x20\x20Round\x20'+(_0x31f68a+0x1)+'/'+_0x5953cb['rounds'][_0x41fdeb(0x20a)]+_0x41fdeb(0x1db)+a5_0x45049c[_0x41fdeb(0x1b1)]('✗'));},'onEvaluationStart':()=>{const _0x1f55a0=_0x3e899e;_0x2e570a[_0x1f55a0(0x1a7)]=_0x1f55a0(0x1bc);},'onEvaluationComplete':_0x3142fb=>{const _0x4ebfd0=_0x3e899e,_0x519e35=formatElapsed(_0x3142fb);console[_0x4ebfd0(0x1f9)](_0x4ebfd0(0x1ac)+a5_0x45049c[_0x4ebfd0(0x1d2)]('✓')+'\x20('+_0x519e35+')');}});_0x2e570a['stop'](),_0x5dc517[_0x3e899e(0x222)](_0x34ecdb),_0x936e57[_0x3e899e(0x222)](_0x33edc2);if(_0x34ecdb[_0x3e899e(0x1ed)]===_0x3e899e(0x22e))console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1d2)](_0x3e899e(0x231)+_0x34ecdb[_0x3e899e(0x1e6)]));else _0x34ecdb[_0x3e899e(0x1ed)]===_0x3e899e(0x1a8)?console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x204)+_0x34ecdb['reason'])):console['log'](a5_0x45049c['red'](_0x3e899e(0x211)+_0x34ecdb[_0x3e899e(0x1e6)]));_0x34ecdb[_0x3e899e(0x20f)]&&console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x1ce)+_0x34ecdb[_0x3e899e(0x20f)])),console[_0x3e899e(0x1f9)]();}catch(_0x2ae243){_0x2e570a[_0x3e899e(0x1a9)]();const _0x338b2d=_0x2ae243 instanceof Error?_0x2ae243[_0x3e899e(0x237)]:String(_0x2ae243);console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)]('✗\x20ERROR:\x20'+_0x338b2d)),console[_0x3e899e(0x1f9)](),_0x5dc517[_0x3e899e(0x222)]({'name':_0x5953cb[_0x3e899e(0x1d5)],'status':'ERROR','reason':_0x338b2d,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x5c9f61=Date[_0x3e899e(0x1ca)]()-_0x16a589,_0x49a35a=_0x5dc517[_0x3e899e(0x21c)](_0x18c195=>_0x18c195[_0x3e899e(0x1ed)]===_0x3e899e(0x22e))['length'],_0x5d3589=_0x5dc517[_0x3e899e(0x21c)](_0x16c88a=>_0x16c88a[_0x3e899e(0x1ed)]===_0x3e899e(0x1a8))['length'],_0xc72983=_0x5dc517[_0x3e899e(0x21c)](_0x4707b1=>_0x4707b1[_0x3e899e(0x1ed)]===_0x3e899e(0x207))['length'];console[_0x3e899e(0x1f9)]('━'[_0x3e899e(0x1ad)](0x3c)),console['log'](_0x3e899e(0x1c9)),console['log']('━'['repeat'](0x3c)),console[_0x3e899e(0x1f9)](_0x3e899e(0x21e)+_0x5dc517[_0x3e899e(0x20a)]),console[_0x3e899e(0x1f9)]('Passed:\x20\x20\x20'+a5_0x45049c[_0x3e899e(0x1d2)](_0x49a35a)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1f6)+a5_0x45049c['red'](_0x5d3589));_0xc72983>0x0&&console[_0x3e899e(0x1f9)](_0x3e899e(0x1e5)+a5_0x45049c[_0x3e899e(0x1b1)](_0xc72983));console[_0x3e899e(0x1f9)](_0x3e899e(0x214)+formatElapsed(_0x5c9f61)),console[_0x3e899e(0x1f9)]('━'['repeat'](0x3c));const _0x4056c8=_0x5dc517[_0x3e899e(0x21c)](_0x219d6c=>_0x219d6c[_0x3e899e(0x1ed)]!=='PASS');if(_0x4056c8[_0x3e899e(0x20a)]>0x0){console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x3e899e(0x1fa));for(const _0x280069 of _0x4056c8){const _0x13b6db=a5_0x45049c[_0x3e899e(0x1b1)]('✗'),_0x1ccea9=_0x280069[_0x3e899e(0x1e6)][_0x3e899e(0x20a)]>0x32?_0x280069[_0x3e899e(0x1e6)][_0x3e899e(0x1f3)](0x0,0x32)+_0x3e899e(0x219):_0x280069[_0x3e899e(0x1e6)];console[_0x3e899e(0x1f9)]('\x20\x20'+_0x13b6db+'\x20'+_0x280069[_0x3e899e(0x1d5)]+':\x20'+_0x1ccea9);}}const _0x4717a4={'summary':{'total':_0x5dc517[_0x3e899e(0x20a)],'passed':_0x49a35a,'failed':_0x5d3589,'errors':_0xc72983>0x0?_0xc72983:undefined,'duration_ms':_0x5c9f61},'tests':_0x5dc517,'agent':{'project':_0x101998[_0x3e899e(0x1f2)],'name':_0x101998[_0x3e899e(0x216)],'site':_0x442b97},'timestamp':new Date(_0x16a589)[_0x3e899e(0x1c3)]()};try{const _0x41e87f=buildCachedTestRun(_0x936e57,{'site':_0x442b97,'projectId':_0x2e7ff1,'projectName':_0x101998[_0x3e899e(0x1f2)],'agentId':_0x31aab7,'agentName':_0x101998[_0x3e899e(0x216)],'testYmlPath':a5_0x4cec4['resolve'](_0x101998[_0x3e899e(0x1c5)])});saveLastTestRun(_0x41e87f);}catch{}if(_0x1b0afa!=='table'||_0x566e86){const _0x440740=formatResults(_0x4717a4,_0x1b0afa);if(_0x566e86)try{a5_0x92ec42[_0x3e899e(0x1c7)](_0x566e86,_0x440740,'utf-8'),console['log'](),console['log'](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x1d9)+_0x566e86));}catch(_0x25bf4d){return console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](a5_0x45049c['red'](_0x3e899e(0x1c1)+_0x25bf4d)),0x1;}else console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x440740);}return _0x4056c8['length']>0x0?0x1:0x0;}async[a5_0x57d988(0x20b)](_0x45be3a,_0x5d89a7){const _0x5d7c46=a5_0x57d988,{options:_0x4efa2d,tdx:_0x1203a4}=_0x45be3a,{definition:_0x19c067,agentInfo:_0x946e4a,outputFormat:_0x15e3f9,outputFile:_0x3c2aae}=_0x5d89a7,_0x143d09=_0x4efa2d[_0x5d7c46(0x1d1)],_0xdfc70f=loadLastTestRun();if(!_0xdfc70f)return console['log'](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x232))),console['log'](a5_0x45049c['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0xdfc70f[_0x5d7c46(0x1a4)][_0x5d7c46(0x216)]!==_0x946e4a[_0x5d7c46(0x216)])return console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1b1)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0xdfc70f[_0x5d7c46(0x1a4)]['agentName']+_0x5d7c46(0x22d)+_0x946e4a['agentName']+'\x22.')),console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x206))),0x1;const _0x31efbd=new Set(_0xdfc70f[_0x5d7c46(0x1b9)][_0x5d7c46(0x221)](_0x1e34aa=>_0x1e34aa[_0x5d7c46(0x1fb)])),_0x3fab56=_0x19c067[_0x5d7c46(0x22b)][_0x5d7c46(0x21c)](_0x30bf81=>!_0x31efbd['has'](_0x30bf81[_0x5d7c46(0x1d5)]));if(_0x3fab56[_0x5d7c46(0x20a)]>0x0&&_0xdfc70f[_0x5d7c46(0x1d1)]!==_0x143d09)return console[_0x5d7c46(0x1f9)](a5_0x45049c['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x1de)+_0xdfc70f['site']+_0x5d7c46(0x1fc)+_0x143d09+'\x22.')),console[_0x5d7c46(0x1f9)](a5_0x45049c['dim'](_0x5d7c46(0x223)+_0xdfc70f[_0x5d7c46(0x1d1)]+_0x5d7c46(0x1bb))),0x1;const _0x41af17=_0x19c067['tests']['filter'](_0xeca62c=>_0x31efbd[_0x5d7c46(0x1d4)](_0xeca62c[_0x5d7c46(0x1d5)])),_0x1429c7=_0x3fab56;let _0xd292e7;try{_0xd292e7=await setupEvaluatorAgent(_0x1203a4['llm'],_0x4efa2d[_0x5d7c46(0x209)]);}catch(_0x4d33ad){const _0x3de088=_0x4d33ad instanceof Error?_0x4d33ad[_0x5d7c46(0x237)]:String(_0x4d33ad);return console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x1cd)+_0x3de088)),0x1;}console['log'](a5_0x45049c['cyan'](_0x5d7c46(0x1e7))),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x227)+a5_0x45049c[_0x5d7c46(0x213)](_0xdfc70f['timestamp'])),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x1d6)+a5_0x45049c['white'](_0xdfc70f[_0x5d7c46(0x1a4)][_0x5d7c46(0x1f2)]+'/'+_0xdfc70f[_0x5d7c46(0x1a4)][_0x5d7c46(0x216)]));_0x1429c7[_0x5d7c46(0x20a)]>0x0&&console[_0x5d7c46(0x1f9)](_0x5d7c46(0x1e3)+a5_0x45049c[_0x5d7c46(0x1c8)](_0x1429c7[_0x5d7c46(0x20a)]));console[_0x5d7c46(0x1f9)]();const _0x16f238=[],_0x5725af=Date['now'](),_0x4368f4=createCommandSpinner(_0x5d7c46(0x22a));if(_0x41af17['length']>0x0)try{const _0x1a51cb=await reevaluateFromCache(_0x1203a4[_0x5d7c46(0x1df)],_0xdfc70f,{'tests':_0x41af17},{'evaluatorId':_0xd292e7,'onTestStart':(_0x57a16b,_0x2293f7,_0x54de3d)=>{const _0x35c8e2=_0x5d7c46;_0x4368f4[_0x35c8e2(0x1a7)]=_0x35c8e2(0x220)+(_0x2293f7+0x1)+'/'+_0x54de3d+':\x20'+_0x57a16b+_0x35c8e2(0x219);if(!_0x4368f4[_0x35c8e2(0x1b4)])_0x4368f4['start']();},'onTestComplete':(_0x208dab,_0x1d6fca)=>{const _0x1e509f=_0x5d7c46;_0x4368f4[_0x1e509f(0x1a9)]();if(_0x1d6fca['status']==='PASS')console[_0x1e509f(0x1f9)](a5_0x45049c[_0x1e509f(0x1d2)](_0x1e509f(0x231)+_0x208dab)+a5_0x45049c[_0x1e509f(0x229)]('\x20(cached)'));else _0x1d6fca['status']===_0x1e509f(0x1a8)?console[_0x1e509f(0x1f9)](a5_0x45049c['red'](_0x1e509f(0x204)+_0x208dab+_0x1e509f(0x1e4)+_0x1d6fca[_0x1e509f(0x1e6)])+a5_0x45049c[_0x1e509f(0x229)]('\x20(cached)')):console[_0x1e509f(0x1f9)](a5_0x45049c[_0x1e509f(0x1b1)]('✗\x20ERROR:\x20'+_0x208dab+_0x1e509f(0x1e4)+_0x1d6fca['reason']));_0x1d6fca[_0x1e509f(0x20f)]&&console[_0x1e509f(0x1f9)](a5_0x45049c['dim'](_0x1e509f(0x1eb)+_0x1d6fca['conversation_url'])),_0x16f238[_0x1e509f(0x222)](_0x1d6fca);},'onTestSkipped':(_0x1ded10,_0x3c4359)=>{const _0x3f4819=_0x5d7c46;_0x4368f4['stop'](),console[_0x3f4819(0x1f9)](a5_0x45049c[_0x3f4819(0x1c8)](_0x3f4819(0x212)+_0x1ded10+'\x20-\x20'+_0x3c4359));}});for(const _0x598383 of _0x1a51cb){!_0x16f238['find'](_0x1c2484=>_0x1c2484[_0x5d7c46(0x1d5)]===_0x598383['name'])&&_0x16f238[_0x5d7c46(0x222)](_0x598383);}}catch(_0x4604d0){_0x4368f4['stop']();const _0x33e9e6=_0x4604d0 instanceof Error?_0x4604d0[_0x5d7c46(0x237)]:String(_0x4604d0);return console['log'](a5_0x45049c['red'](_0x5d7c46(0x1e0)+_0x33e9e6)),0x1;}_0x4368f4[_0x5d7c46(0x1a9)]();if(_0x1429c7[_0x5d7c46(0x20a)]>0x0){console['log'](),console[_0x5d7c46(0x1f9)](a5_0x45049c['cyan'](_0x5d7c46(0x22f)));const {projectId:_0x4f78aa,agentId:_0x3e37a5}=_0xdfc70f[_0x5d7c46(0x1a4)];for(const _0x4f4948 of _0x1429c7){console['log'](_0x5d7c46(0x234)+a5_0x45049c[_0x5d7c46(0x213)](_0x4f4948[_0x5d7c46(0x1d5)]));const _0x4b8718=createCommandSpinner('Round\x201/'+_0x4f4948[_0x5d7c46(0x236)][_0x5d7c46(0x20a)]+_0x5d7c46(0x1cc));_0x4b8718[_0x5d7c46(0x1ea)]();try{const {result:_0x53139d}=await runTest(_0x1203a4[_0x5d7c46(0x1df)],_0x4f4948,{'agentId':_0x3e37a5,'projectId':_0x4f78aa,'site':_0xdfc70f[_0x5d7c46(0x1d1)],'noEval':![],'evaluatorId':_0xd292e7,'onRoundStart':(_0x29435e,_0x3ab6e7)=>{const _0x2e7972=_0x5d7c46;_0x4b8718[_0x2e7972(0x1a7)]=_0x2e7972(0x1b7)+(_0x29435e+0x1)+'/'+_0x3ab6e7+_0x2e7972(0x1cc);},'onRoundComplete':(_0x9f5692,_0x10d3dd,_0x1861be)=>{const _0x4c70b3=_0x5d7c46,_0x14d6a1=formatElapsed(_0x10d3dd);_0x1861be?console['log'](_0x4c70b3(0x1d0)+(_0x9f5692+0x1)+'/'+_0x4f4948['rounds'][_0x4c70b3(0x20a)]+'...\x20'+a5_0x45049c[_0x4c70b3(0x1d2)]('✓')+'\x20('+_0x14d6a1+')'):console[_0x4c70b3(0x1f9)](_0x4c70b3(0x1d0)+(_0x9f5692+0x1)+'/'+_0x4f4948[_0x4c70b3(0x236)][_0x4c70b3(0x20a)]+_0x4c70b3(0x1db)+a5_0x45049c[_0x4c70b3(0x1b1)]('✗'));},'onEvaluationStart':()=>{const _0x42b138=_0x5d7c46;_0x4b8718[_0x42b138(0x1a7)]=_0x42b138(0x1bc);},'onEvaluationComplete':_0x7edd35=>{const _0xb8dada=_0x5d7c46,_0x1d3532=formatElapsed(_0x7edd35);console[_0xb8dada(0x1f9)](_0xb8dada(0x1ac)+a5_0x45049c['green']('✓')+'\x20('+_0x1d3532+')');}});_0x4b8718[_0x5d7c46(0x1a9)](),_0x16f238[_0x5d7c46(0x222)](_0x53139d);if(_0x53139d[_0x5d7c46(0x1ed)]===_0x5d7c46(0x22e))console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1d2)](_0x5d7c46(0x231)+_0x53139d[_0x5d7c46(0x1e6)])+a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x1e8)));else _0x53139d[_0x5d7c46(0x1ed)]===_0x5d7c46(0x1a8)?console['log'](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x204)+_0x53139d[_0x5d7c46(0x1e6)])+a5_0x45049c[_0x5d7c46(0x229)]('\x20(new)')):console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x211)+_0x53139d[_0x5d7c46(0x1e6)]));_0x53139d['conversation_url']&&console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x1eb)+_0x53139d['conversation_url']));}catch(_0x1d4636){_0x4b8718[_0x5d7c46(0x1a9)]();const _0xc4a727=_0x1d4636 instanceof Error?_0x1d4636['message']:String(_0x1d4636);console['log'](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x211)+_0xc4a727)),_0x16f238[_0x5d7c46(0x222)]({'name':_0x4f4948[_0x5d7c46(0x1d5)],'status':'ERROR','reason':_0xc4a727,'timestamp':new Date()[_0x5d7c46(0x1c3)](),'duration_ms':0x0});}}}console['log']();const _0x11cf94=Date[_0x5d7c46(0x1ca)]()-_0x5725af,_0x500bb7=_0x16f238['filter'](_0x56e493=>_0x56e493['status']===_0x5d7c46(0x22e))[_0x5d7c46(0x20a)],_0x1ed37c=_0x16f238['filter'](_0x5db452=>_0x5db452[_0x5d7c46(0x1ed)]===_0x5d7c46(0x1a8))['length'],_0x2d0055=_0x16f238[_0x5d7c46(0x21c)](_0x25b218=>_0x25b218[_0x5d7c46(0x1ed)]===_0x5d7c46(0x207))[_0x5d7c46(0x20a)];console['log']('━'['repeat'](0x3c)),console['log'](_0x5d7c46(0x1b8)),console[_0x5d7c46(0x1f9)]('━'['repeat'](0x3c)),console[_0x5d7c46(0x1f9)]('Total:\x20\x20\x20\x20'+_0x16f238[_0x5d7c46(0x20a)]),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x20c)+a5_0x45049c[_0x5d7c46(0x1d2)](_0x500bb7)),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x1f6)+a5_0x45049c[_0x5d7c46(0x1b1)](_0x1ed37c));_0x2d0055>0x0&&console['log'](_0x5d7c46(0x1e5)+a5_0x45049c['red'](_0x2d0055));console['log']('Duration:\x20'+formatElapsed(_0x11cf94)),console[_0x5d7c46(0x1f9)]('━'[_0x5d7c46(0x1ad)](0x3c));const _0x1c1513={'summary':{'total':_0x16f238[_0x5d7c46(0x20a)],'passed':_0x500bb7,'failed':_0x1ed37c,'errors':_0x2d0055>0x0?_0x2d0055:undefined,'duration_ms':_0x11cf94},'tests':_0x16f238,'agent':{'project':_0x946e4a[_0x5d7c46(0x1f2)],'name':_0x946e4a['agentName'],'site':_0x143d09},'timestamp':new Date(_0x5725af)[_0x5d7c46(0x1c3)]()};if(_0x15e3f9!==_0x5d7c46(0x1e1)||_0x3c2aae){const _0xe94d78=formatResults(_0x1c1513,_0x15e3f9);if(_0x3c2aae)try{a5_0x92ec42[_0x5d7c46(0x1c7)](_0x3c2aae,_0xe94d78,'utf-8'),console[_0x5d7c46(0x1f9)](),console[_0x5d7c46(0x1f9)](a5_0x45049c['dim'](_0x5d7c46(0x1d9)+_0x3c2aae));}catch(_0x3d8247){return console['log'](),console['log'](a5_0x45049c['red'](_0x5d7c46(0x1c1)+_0x3d8247)),0x1;}else console[_0x5d7c46(0x1f9)](),console[_0x5d7c46(0x1f9)](_0xe94d78);}const _0x508dbd=_0x16f238[_0x5d7c46(0x21c)](_0x41e18a=>_0x41e18a[_0x5d7c46(0x1ed)]!==_0x5d7c46(0x22e));return _0x508dbd[_0x5d7c46(0x20a)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x1f0590=a5_0x3e5e;(function(_0xb1f2d1,_0x2a1168){const _0x56b7c3=a5_0x3e5e,_0x178690=_0xb1f2d1();while(!![]){try{const _0x57970e=parseInt(_0x56b7c3(0xad))/0x1+-parseInt(_0x56b7c3(0x12b))/0x2*(parseInt(_0x56b7c3(0x11a))/0x3)+-parseInt(_0x56b7c3(0xe9))/0x4*(parseInt(_0x56b7c3(0x11d))/0x5)+-parseInt(_0x56b7c3(0xf6))/0x6+-parseInt(_0x56b7c3(0xfe))/0x7*(-parseInt(_0x56b7c3(0xa9))/0x8)+parseInt(_0x56b7c3(0xcd))/0x9*(-parseInt(_0x56b7c3(0xc4))/0xa)+-parseInt(_0x56b7c3(0xff))/0xb*(parseInt(_0x56b7c3(0xc8))/0xc);if(_0x57970e===_0x2a1168)break;else _0x178690['push'](_0x178690['shift']());}catch(_0x204479){_0x178690['push'](_0x178690['shift']());}}}(a5_0x31f0,0x4fcd1));import*as a5_0x34fa52 from'node:fs';import*as a5_0x3a14fd from'node:path';import a5_0x47420f from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x31f0(){const _0x2695f4=['✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Either\x20switch\x20to\x20the\x20\x22','\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','Re-evaluation\x20Summary','\x20\x20Project:\x20','some','text','conversation_url','Errors:\x20\x20\x20','Available\x20tests:\x20','projectDir','reeval','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','find','resolve','27032nCtWtt','PASS','add','reason','trim','tests','\x22:\x20','dim','no_tests','Project\x20path:\x20','Cached\x20run\x20from:\x20','stop','Agent:\x20','1734000QXMhSe','verbose','FAIL','size','\x20(new)','✗\x20ERROR:\x20Project\x20not\x20found:\x20','context','✗\x20FAIL:\x20','449575GowPtv','77sIjIKn','No\x20tests\x20found\x20with\x20tags:\x20','description','Using\x20agent:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','white','Tests\x20found:\x20','site','Usage:','\x20\x20Conversation:\x20','json','length','Output\x20written\x20to:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Evaluating\x20response...','round','conversations','map','llm','includes','tsv','Run\x20tests\x20for\x20an\x20LLM\x20agent','Test\x20Configuration:','ERROR','Test\x20Summary','agentDirs','has','53883ckZOsO','repeat','Error\x20writing\x20output\x20file:\x20','20nTXWVB','split','projectName','Running:\x20','\x20\x20Round\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','forEach','message','\x20-\x20','rounds','toLowerCase','red','...','Re-evaluating\x20cached\x20test\x20run...','14jzvmPt','green','⚠\x20SKIPPED:\x20','Duration:\x20','✗\x20ERROR:\x20','name','Failed\x20Tests:','testYmlPath','start','...\x20','now','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','resolveAgentId','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','llmProject','utf-8','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Failed:\x20\x20\x20','72LAeURi','agentName','execute','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','206307zOsQzu','Site:\x20','filter','Cached\x20run\x20is\x20from\x20site\x20\x22','No\x20tests\x20have\x20tags\x20defined.','404','Available\x20tags:\x20','no_local_folder','New\x20tests\x20to\x20execute:\x20','basename',':\x20Sending\x20user\x20input...','source','\x20\x20-\x20','toISOString','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\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)','Passed:\x20\x20\x20','\x20(cached)','output','log','executeReeval','join','agent','5410wJSNyO','testName','Round\x201/','\x20\x20Evaluating...\x20','20436TPZSZK','push','table','cyan','tags','63kmjYKJ','Re-evaluating\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','writeFileSync','agent:test','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','yellow','Running\x20agent\x20tests...','jsonl','Round\x20','existsSync','status'];a5_0x31f0=function(){return _0x2695f4;};return a5_0x31f0();}function a5_0x3e5e(_0x490bf1,_0xdd96bd){_0x490bf1=_0x490bf1-0xa4;const _0x31f04a=a5_0x31f0();let _0x3e5e8e=_0x31f04a[_0x490bf1];return _0x3e5e8e;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x1f0590(0xd1);[a5_0x1f0590(0x101)]=a5_0x1f0590(0x114);async[a5_0x1f0590(0xab)](_0x420c4e){const _0x7f9434=a5_0x1f0590,{options:_0x47f1cd,args:_0x39116b,tdx:_0x56f918}=_0x420c4e,_0x28f4b7=_0x39116b[0x0]||'.',_0x5aaae5=_0x47f1cd['dryRun'],_0x433858=_0x47f1cd,_0x14d7ad=_0x433858['eval']===![],_0x1eb814=_0x433858[_0x7f9434(0xe4)],_0x16015c=_0x433858[_0x7f9434(0x130)],_0x11e7cf=_0x433858['tags'],_0x28be0a=_0x47f1cd[_0x7f9434(0x106)],_0x4d9869=_0x433858[_0x7f9434(0xbf)];if(_0x1eb814&&_0x14d7ad)return console['log'](a5_0x47420f[_0x7f9434(0x128)](_0x7f9434(0x136))),0x1;let _0x4648f1=_0x7f9434(0xca);if(_0x433858[_0x7f9434(0x109)])_0x4648f1=_0x7f9434(0x109);else{if(_0x433858[_0x7f9434(0xd5)])_0x4648f1=_0x7f9434(0xd5);else{if(_0x433858[_0x7f9434(0x113)])_0x4648f1=_0x7f9434(0x113);else{if(_0x433858[_0x7f9434(0xca)])_0x4648f1=_0x7f9434(0xca);}}}const _0x137bf6=_0x433858[_0x7f9434(0xa5)];let _0x5de276=_0x28f4b7;const _0x13a4dd=a5_0x34fa52[_0x7f9434(0xd7)](_0x28f4b7),_0x8cd7ce=_0x28f4b7==='.';if(!_0x13a4dd||_0x8cd7ce){const _0x4d7c1c=resolveProjectFromContext(_0x28f4b7,_0x137bf6,{'requireFile':'test.yml'});if(_0x4d7c1c['found'])_0x5de276=_0x4d7c1c[_0x7f9434(0xe3)],_0x4d7c1c[_0x7f9434(0xb8)]===_0x7f9434(0xfc)&&console['log'](a5_0x47420f[_0x7f9434(0xf0)](_0x7f9434(0x102)+_0x5de276));else switch(_0x4d7c1c[_0x7f9434(0xec)]){case'no_context':console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xd3)](_0x4d7c1c[_0x7f9434(0x124)])),console[_0x7f9434(0xc0)](),console[_0x7f9434(0xc0)](_0x7f9434(0x107)),console[_0x7f9434(0xc0)](_0x7f9434(0xdb)),console[_0x7f9434(0xc0)](_0x7f9434(0xbc)),console[_0x7f9434(0xc0)](),console[_0x7f9434(0xc0)](_0x7f9434(0xbb));return 0x1;case _0x7f9434(0xb4):console[_0x7f9434(0xc0)](a5_0x47420f['yellow'](_0x4d7c1c[_0x7f9434(0x124)])),console[_0x7f9434(0xc0)](),console[_0x7f9434(0xc0)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4d7c1c['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x556898=a5_0x3a14fd[_0x7f9434(0xb6)](_0x4d7c1c['projectDir']);console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xd3)](_0x7f9434(0xd2)+_0x4d7c1c['llmProject']+'\x22:'));for(const _0x50ea96 of _0x4d7c1c[_0x7f9434(0x118)]){console[_0x7f9434(0xc0)](_0x7f9434(0xb9)+_0x50ea96);}return console[_0x7f9434(0xc0)](),console[_0x7f9434(0xc0)](_0x7f9434(0xa4)+_0x556898+'/<agent-name>'),0x1;}case _0x7f9434(0xf1):console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xd3)](_0x7f9434(0xe6)+_0x4d7c1c['llmProject']+'\x22.')),console[_0x7f9434(0xc0)](a5_0x47420f['dim'](_0x7f9434(0xf2)+_0x4d7c1c[_0x7f9434(0xe3)])),console['log'](),console[_0x7f9434(0xc0)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x506007,agentInfo:_0x1ddd03}=parseTestFile(_0x5de276);let _0x5537d5=_0x506007[_0x7f9434(0xee)];if(_0x16015c){const _0xcd0c=_0x16015c[_0x7f9434(0x11e)](',')['map'](_0xa69eed=>_0xa69eed[_0x7f9434(0xed)]());_0x5537d5=_0x506007[_0x7f9434(0xee)]['filter'](_0x207d7f=>_0xcd0c[_0x7f9434(0x112)](_0x207d7f[_0x7f9434(0x130)]));if(_0x5537d5[_0x7f9434(0x10a)]===0x0)return console['log'](a5_0x47420f[_0x7f9434(0xd3)]('No\x20tests\x20found\x20matching:\x20'+_0x16015c)),console['log'](a5_0x47420f[_0x7f9434(0xf0)](_0x7f9434(0xe2)+_0x506007['tests']['map'](_0x1b6f1=>_0x1b6f1['name'])[_0x7f9434(0xc2)](',\x20'))),0x1;}if(_0x11e7cf){const _0xb1e224=_0x11e7cf[_0x7f9434(0x11e)](',')[_0x7f9434(0x110)](_0x165674=>_0x165674[_0x7f9434(0xed)]()['toLowerCase']());_0x5537d5=_0x5537d5[_0x7f9434(0xaf)](_0x5d784b=>_0x5d784b[_0x7f9434(0xcc)]?.[_0x7f9434(0xde)](_0x2c5d4f=>_0xb1e224[_0x7f9434(0x112)](_0x2c5d4f['toLowerCase']())));if(_0x5537d5[_0x7f9434(0x10a)]===0x0){console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xd3)](_0x7f9434(0x100)+_0x11e7cf));const _0x56fa6e=new Set();return _0x506007[_0x7f9434(0xee)][_0x7f9434(0x123)](_0x11d41e=>_0x11d41e[_0x7f9434(0xcc)]?.[_0x7f9434(0x123)](_0x4a2c00=>_0x56fa6e[_0x7f9434(0xeb)](_0x4a2c00))),_0x56fa6e[_0x7f9434(0xf9)]>0x0?console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xf0)](_0x7f9434(0xb3)+[..._0x56fa6e][_0x7f9434(0xc2)](',\x20'))):console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xf0)](_0x7f9434(0xb1))),0x1;}}if(_0x1eb814)return this[_0x7f9434(0xc1)](_0x420c4e,{'definition':{'tests':_0x5537d5},'agentInfo':_0x1ddd03,'outputFormat':_0x4648f1,'outputFile':_0x4d9869,'testNames':_0x16015c});if(_0x5aaae5){console[_0x7f9434(0xc0)](a5_0x47420f['cyan'](_0x7f9434(0x115))),console[_0x7f9434(0xc0)]('\x20\x20Site:\x20'+a5_0x47420f[_0x7f9434(0x104)](_0x28be0a)),console['log'](_0x7f9434(0xdd)+a5_0x47420f[_0x7f9434(0x104)](_0x1ddd03['projectName'])),console[_0x7f9434(0xc0)]('\x20\x20Agent:\x20'+a5_0x47420f[_0x7f9434(0x104)](_0x1ddd03[_0x7f9434(0xaa)])),console[_0x7f9434(0xc0)](),console[_0x7f9434(0xc0)](_0x7f9434(0x105)+a5_0x47420f[_0x7f9434(0x104)](_0x5537d5[_0x7f9434(0x10a)]));for(let _0x32f836=0x0;_0x32f836<_0x5537d5[_0x7f9434(0x10a)];_0x32f836++){const _0x42d930=_0x5537d5[_0x32f836],_0xff314a=_0x42d930[_0x7f9434(0x126)][_0x7f9434(0x10a)]===0x1?_0x7f9434(0x10e):_0x7f9434(0x126),_0x5988c4=_0x42d930['tags']?.[_0x7f9434(0x10a)]?'\x20['+_0x42d930[_0x7f9434(0xcc)][_0x7f9434(0xc2)](',\x20')+']':'';console[_0x7f9434(0xc0)]('\x20\x20'+(_0x32f836+0x1)+'.\x20'+a5_0x47420f[_0x7f9434(0x104)](_0x42d930[_0x7f9434(0x130)])+'\x20('+_0x42d930[_0x7f9434(0x126)]['length']+'\x20'+_0xff314a+')'+a5_0x47420f['dim'](_0x5988c4));}return 0x0;}let _0x4e1c56,_0x5f5da2;try{_0x4e1c56=await _0x56f918[_0x7f9434(0x111)]['resolveProjectId'](_0x1ddd03[_0x7f9434(0x11f)]);}catch(_0x322424){const _0x1905a0=_0x322424 instanceof Error?_0x322424[_0x7f9434(0x124)]:String(_0x322424);return _0x1905a0['includes'](_0x7f9434(0xb2))||_0x1905a0['toLowerCase']()[_0x7f9434(0x112)]('not\x20found')?console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0x128)](_0x7f9434(0xfb)+_0x1ddd03[_0x7f9434(0x11f)])):console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0x128)](_0x7f9434(0xd9)+_0x1ddd03['projectName']+_0x7f9434(0xef)+_0x1905a0)),0x1;}try{_0x5f5da2=await _0x56f918[_0x7f9434(0x111)][_0x7f9434(0x137)](_0x1ddd03[_0x7f9434(0xaa)],_0x4e1c56);}catch(_0x4db6d2){const _0x465154=_0x4db6d2 instanceof Error?_0x4db6d2[_0x7f9434(0x124)]:String(_0x4db6d2);return _0x465154[_0x7f9434(0x112)](_0x7f9434(0xb2))||_0x465154[_0x7f9434(0x127)]()[_0x7f9434(0x112)]('not\x20found')?console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0x128)](_0x7f9434(0x122)+_0x1ddd03[_0x7f9434(0xaa)])):console[_0x7f9434(0xc0)](a5_0x47420f['red'](_0x7f9434(0xa7)+_0x1ddd03[_0x7f9434(0xaa)]+'\x22:\x20'+_0x465154)),0x1;}let _0x115e0a;if(!_0x14d7ad)try{_0x115e0a=await setupEvaluatorAgent(_0x56f918[_0x7f9434(0x111)],_0x47f1cd[_0x7f9434(0xf7)]);}catch(_0x5a6e8b){const _0x1b8846=_0x5a6e8b instanceof Error?_0x5a6e8b[_0x7f9434(0x124)]:String(_0x5a6e8b);return console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0x128)](_0x7f9434(0xe5)+_0x1b8846)),0x1;}console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xcb)](_0x7f9434(0xd4))),console[_0x7f9434(0xc0)](_0x7f9434(0xae)+a5_0x47420f['white'](_0x28be0a)),console[_0x7f9434(0xc0)](_0x7f9434(0xf5)+a5_0x47420f[_0x7f9434(0x104)](_0x1ddd03[_0x7f9434(0x11f)]+'/'+_0x1ddd03['agentName'])),console[_0x7f9434(0xc0)]();const _0xda5e2c=[],_0x2c3b28=[],_0x5476ef=Date[_0x7f9434(0x135)]();for(let _0x2186f1=0x0;_0x2186f1<_0x5537d5['length'];_0x2186f1++){const _0x2fafbb=_0x5537d5[_0x2186f1];_0x5537d5[_0x7f9434(0x10a)]>0x1?console[_0x7f9434(0xc0)]('Test\x20'+(_0x2186f1+0x1)+'/'+_0x5537d5[_0x7f9434(0x10a)]+':\x20'+a5_0x47420f[_0x7f9434(0x104)](_0x2fafbb[_0x7f9434(0x130)])):console[_0x7f9434(0xc0)]('Running\x20test:\x20'+a5_0x47420f[_0x7f9434(0x104)](_0x2fafbb[_0x7f9434(0x130)]));const _0xcfa8ed=createCommandSpinner(_0x7f9434(0xc6)+_0x2fafbb[_0x7f9434(0x126)][_0x7f9434(0x10a)]+':\x20Sending\x20user\x20input...');_0xcfa8ed[_0x7f9434(0x133)]();try{const {result:_0xc9ab3a,conversation:_0x2ea6fb}=await runTest(_0x56f918[_0x7f9434(0x111)],_0x2fafbb,{'agentId':_0x5f5da2,'projectId':_0x4e1c56,'site':_0x28be0a,'noEval':_0x14d7ad,'evaluatorId':_0x115e0a,'onRoundStart':(_0x113640,_0x342810)=>{const _0x25e3f6=_0x7f9434;_0xcfa8ed[_0x25e3f6(0xdf)]=_0x25e3f6(0xd6)+(_0x113640+0x1)+'/'+_0x342810+_0x25e3f6(0xb7);},'onRoundComplete':(_0xd43a46,_0x1b391a,_0x4c9b99)=>{const _0x1a307c=_0x7f9434,_0x579217=formatElapsed(_0x1b391a);_0x4c9b99?console[_0x1a307c(0xc0)](_0x1a307c(0x121)+(_0xd43a46+0x1)+'/'+_0x2fafbb[_0x1a307c(0x126)][_0x1a307c(0x10a)]+_0x1a307c(0x134)+a5_0x47420f[_0x1a307c(0x12c)]('✓')+'\x20('+_0x579217+')'):console[_0x1a307c(0xc0)](_0x1a307c(0x121)+(_0xd43a46+0x1)+'/'+_0x2fafbb['rounds'][_0x1a307c(0x10a)]+_0x1a307c(0x134)+a5_0x47420f[_0x1a307c(0x128)]('✗'));},'onEvaluationStart':()=>{const _0x2d90a5=_0x7f9434;_0xcfa8ed[_0x2d90a5(0xdf)]='Evaluating\x20response...';},'onEvaluationComplete':_0xd540ff=>{const _0x240000=_0x7f9434,_0x41b209=formatElapsed(_0xd540ff);console[_0x240000(0xc0)](_0x240000(0xc7)+a5_0x47420f[_0x240000(0x12c)]('✓')+'\x20('+_0x41b209+')');}});_0xcfa8ed[_0x7f9434(0xf4)](),_0xda5e2c[_0x7f9434(0xc9)](_0xc9ab3a),_0x2c3b28['push'](_0x2ea6fb);if(_0xc9ab3a[_0x7f9434(0xd8)]===_0x7f9434(0xea))console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0x12c)]('✓\x20PASS:\x20'+_0xc9ab3a[_0x7f9434(0xec)]));else _0xc9ab3a[_0x7f9434(0xd8)]===_0x7f9434(0xf8)?console['log'](a5_0x47420f['red']('✗\x20FAIL:\x20'+_0xc9ab3a[_0x7f9434(0xec)])):console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0x128)](_0x7f9434(0x12f)+_0xc9ab3a[_0x7f9434(0xec)]));_0xc9ab3a[_0x7f9434(0xe0)]&&console['log'](a5_0x47420f['dim']('Conversation\x20URL:\x20'+_0xc9ab3a['conversation_url'])),console['log']();}catch(_0xd5a82b){_0xcfa8ed[_0x7f9434(0xf4)]();const _0x384267=_0xd5a82b instanceof Error?_0xd5a82b[_0x7f9434(0x124)]:String(_0xd5a82b);console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0x128)]('✗\x20ERROR:\x20'+_0x384267)),console['log'](),_0xda5e2c[_0x7f9434(0xc9)]({'name':_0x2fafbb[_0x7f9434(0x130)],'status':_0x7f9434(0x116),'reason':_0x384267,'timestamp':new Date()[_0x7f9434(0xba)](),'duration_ms':0x0});}}const _0x5fd0f2=Date[_0x7f9434(0x135)]()-_0x5476ef,_0x458b55=_0xda5e2c[_0x7f9434(0xaf)](_0x351ab2=>_0x351ab2[_0x7f9434(0xd8)]===_0x7f9434(0xea))[_0x7f9434(0x10a)],_0xe456da=_0xda5e2c[_0x7f9434(0xaf)](_0x5b7e79=>_0x5b7e79[_0x7f9434(0xd8)]===_0x7f9434(0xf8))[_0x7f9434(0x10a)],_0x376c5b=_0xda5e2c[_0x7f9434(0xaf)](_0x5bc98d=>_0x5bc98d[_0x7f9434(0xd8)]==='ERROR')[_0x7f9434(0x10a)];console[_0x7f9434(0xc0)]('━'[_0x7f9434(0x11b)](0x3c)),console[_0x7f9434(0xc0)](_0x7f9434(0x117)),console[_0x7f9434(0xc0)]('━'[_0x7f9434(0x11b)](0x3c)),console[_0x7f9434(0xc0)]('Total:\x20\x20\x20\x20'+_0xda5e2c[_0x7f9434(0x10a)]),console[_0x7f9434(0xc0)]('Passed:\x20\x20\x20'+a5_0x47420f['green'](_0x458b55)),console[_0x7f9434(0xc0)](_0x7f9434(0xa8)+a5_0x47420f[_0x7f9434(0x128)](_0xe456da));_0x376c5b>0x0&&console[_0x7f9434(0xc0)](_0x7f9434(0xe1)+a5_0x47420f[_0x7f9434(0x128)](_0x376c5b));console[_0x7f9434(0xc0)]('Duration:\x20'+formatElapsed(_0x5fd0f2)),console['log']('━'[_0x7f9434(0x11b)](0x3c));const _0x519a38=_0xda5e2c['filter'](_0x21248f=>_0x21248f[_0x7f9434(0xd8)]!==_0x7f9434(0xea));if(_0x519a38[_0x7f9434(0x10a)]>0x0){console[_0x7f9434(0xc0)](),console[_0x7f9434(0xc0)](_0x7f9434(0x131));for(const _0xeeb96c of _0x519a38){const _0x2b803b=a5_0x47420f[_0x7f9434(0x128)]('✗'),_0x502fc5=_0xeeb96c[_0x7f9434(0xec)][_0x7f9434(0x10a)]>0x32?_0xeeb96c[_0x7f9434(0xec)]['substring'](0x0,0x32)+'...':_0xeeb96c[_0x7f9434(0xec)];console[_0x7f9434(0xc0)]('\x20\x20'+_0x2b803b+'\x20'+_0xeeb96c['name']+':\x20'+_0x502fc5);}}const _0x542520={'summary':{'total':_0xda5e2c[_0x7f9434(0x10a)],'passed':_0x458b55,'failed':_0xe456da,'errors':_0x376c5b>0x0?_0x376c5b:undefined,'duration_ms':_0x5fd0f2},'tests':_0xda5e2c,'agent':{'project':_0x1ddd03[_0x7f9434(0x11f)],'name':_0x1ddd03[_0x7f9434(0xaa)],'site':_0x28be0a},'timestamp':new Date(_0x5476ef)[_0x7f9434(0xba)]()};try{const _0x5a3ff0=buildCachedTestRun(_0x2c3b28,{'site':_0x28be0a,'projectId':_0x4e1c56,'projectName':_0x1ddd03['projectName'],'agentId':_0x5f5da2,'agentName':_0x1ddd03[_0x7f9434(0xaa)],'testYmlPath':a5_0x3a14fd[_0x7f9434(0xe8)](_0x1ddd03[_0x7f9434(0x132)])});saveLastTestRun(_0x5a3ff0);}catch{}if(_0x4648f1!=='table'||_0x4d9869){const _0x1b3186=formatResults(_0x542520,_0x4648f1);if(_0x4d9869)try{a5_0x34fa52[_0x7f9434(0xd0)](_0x4d9869,_0x1b3186,'utf-8'),console['log'](),console[_0x7f9434(0xc0)](a5_0x47420f[_0x7f9434(0xf0)](_0x7f9434(0x10b)+_0x4d9869));}catch(_0x2a410b){return console[_0x7f9434(0xc0)](),console['log'](a5_0x47420f[_0x7f9434(0x128)]('Error\x20writing\x20output\x20file:\x20'+_0x2a410b)),0x1;}else console[_0x7f9434(0xc0)](),console[_0x7f9434(0xc0)](_0x1b3186);}return _0x519a38[_0x7f9434(0x10a)]>0x0?0x1:0x0;}async[a5_0x1f0590(0xc1)](_0x512660,_0x488649){const _0x1df785=a5_0x1f0590,{options:_0x2241e0,tdx:_0x27cccd}=_0x512660,{definition:_0x278e0d,agentInfo:_0x35c604,outputFormat:_0x52ae62,outputFile:_0x17164b}=_0x488649,_0x1aeeac=_0x2241e0[_0x1df785(0x106)],_0x3a2ae5=loadLastTestRun();if(!_0x3a2ae5)return console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x128)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0xf0)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x3a2ae5[_0x1df785(0xc3)][_0x1df785(0xaa)]!==_0x35c604[_0x1df785(0xaa)])return console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x128)](_0x1df785(0xac)+_0x3a2ae5[_0x1df785(0xc3)][_0x1df785(0xaa)]+_0x1df785(0x103)+_0x35c604[_0x1df785(0xaa)]+'\x22.')),console['log'](a5_0x47420f[_0x1df785(0xf0)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x813bdc=new Set(_0x3a2ae5[_0x1df785(0x10f)][_0x1df785(0x110)](_0x541a6c=>_0x541a6c[_0x1df785(0xc5)])),_0x3d3986=_0x278e0d[_0x1df785(0xee)][_0x1df785(0xaf)](_0x18a607=>!_0x813bdc[_0x1df785(0x119)](_0x18a607[_0x1df785(0x130)]));if(_0x3d3986['length']>0x0&&_0x3a2ae5[_0x1df785(0x106)]!==_0x1aeeac)return console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x128)](_0x1df785(0x10c))),console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0xf0)](_0x1df785(0xb0)+_0x3a2ae5[_0x1df785(0x106)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1aeeac+'\x22.')),console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0xf0)](_0x1df785(0xda)+_0x3a2ae5[_0x1df785(0x106)]+_0x1df785(0xcf))),0x1;const _0x150678=_0x278e0d[_0x1df785(0xee)][_0x1df785(0xaf)](_0x56d2e8=>_0x813bdc['has'](_0x56d2e8[_0x1df785(0x130)])),_0xf41dbe=_0x3d3986;let _0x23dc2b;try{_0x23dc2b=await setupEvaluatorAgent(_0x27cccd[_0x1df785(0x111)],_0x2241e0[_0x1df785(0xf7)]);}catch(_0x5ccf0c){const _0x35fe15=_0x5ccf0c instanceof Error?_0x5ccf0c[_0x1df785(0x124)]:String(_0x5ccf0c);return console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x128)](_0x1df785(0xe5)+_0x35fe15)),0x1;}console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0xcb)](_0x1df785(0x12a))),console[_0x1df785(0xc0)](_0x1df785(0xf3)+a5_0x47420f[_0x1df785(0x104)](_0x3a2ae5['timestamp'])),console[_0x1df785(0xc0)](_0x1df785(0xf5)+a5_0x47420f[_0x1df785(0x104)](_0x3a2ae5[_0x1df785(0xc3)]['projectName']+'/'+_0x3a2ae5[_0x1df785(0xc3)][_0x1df785(0xaa)]));_0xf41dbe[_0x1df785(0x10a)]>0x0&&console[_0x1df785(0xc0)](_0x1df785(0xb5)+a5_0x47420f['yellow'](_0xf41dbe[_0x1df785(0x10a)]));console[_0x1df785(0xc0)]();const _0x2b8a4d=[],_0x2bd046=Date['now'](),_0x2fe312=createCommandSpinner('Re-evaluating...');if(_0x150678[_0x1df785(0x10a)]>0x0)try{const _0x224663=await reevaluateFromCache(_0x27cccd[_0x1df785(0x111)],_0x3a2ae5,{'tests':_0x150678},{'evaluatorId':_0x23dc2b,'onTestStart':(_0x490a82,_0x1de70c,_0x1be10c)=>{const _0x5430f5=_0x1df785;_0x2fe312['text']=_0x5430f5(0xce)+(_0x1de70c+0x1)+'/'+_0x1be10c+':\x20'+_0x490a82+_0x5430f5(0x129);if(!_0x2fe312['isSpinning'])_0x2fe312[_0x5430f5(0x133)]();},'onTestComplete':(_0x22597b,_0x34fc38)=>{const _0x47b2e8=_0x1df785;_0x2fe312[_0x47b2e8(0xf4)]();if(_0x34fc38['status']===_0x47b2e8(0xea))console['log'](a5_0x47420f[_0x47b2e8(0x12c)]('✓\x20PASS:\x20'+_0x22597b)+a5_0x47420f['dim'](_0x47b2e8(0xbe)));else _0x34fc38[_0x47b2e8(0xd8)]===_0x47b2e8(0xf8)?console[_0x47b2e8(0xc0)](a5_0x47420f['red']('✗\x20FAIL:\x20'+_0x22597b+_0x47b2e8(0x125)+_0x34fc38[_0x47b2e8(0xec)])+a5_0x47420f[_0x47b2e8(0xf0)]('\x20(cached)')):console[_0x47b2e8(0xc0)](a5_0x47420f[_0x47b2e8(0x128)](_0x47b2e8(0x12f)+_0x22597b+_0x47b2e8(0x125)+_0x34fc38['reason']));_0x34fc38[_0x47b2e8(0xe0)]&&console[_0x47b2e8(0xc0)](a5_0x47420f[_0x47b2e8(0xf0)](_0x47b2e8(0x108)+_0x34fc38[_0x47b2e8(0xe0)])),_0x2b8a4d[_0x47b2e8(0xc9)](_0x34fc38);},'onTestSkipped':(_0x8ac330,_0x278795)=>{const _0x510684=_0x1df785;_0x2fe312['stop'](),console['log'](a5_0x47420f[_0x510684(0xd3)](_0x510684(0x12d)+_0x8ac330+'\x20-\x20'+_0x278795));}});for(const _0x4a9db9 of _0x224663){!_0x2b8a4d[_0x1df785(0xe7)](_0x3993ff=>_0x3993ff['name']===_0x4a9db9[_0x1df785(0x130)])&&_0x2b8a4d[_0x1df785(0xc9)](_0x4a9db9);}}catch(_0x1f8d07){_0x2fe312[_0x1df785(0xf4)]();const _0x352e24=_0x1f8d07 instanceof Error?_0x1f8d07[_0x1df785(0x124)]:String(_0x1f8d07);return console[_0x1df785(0xc0)](a5_0x47420f['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x352e24)),0x1;}_0x2fe312[_0x1df785(0xf4)]();if(_0xf41dbe[_0x1df785(0x10a)]>0x0){console[_0x1df785(0xc0)](),console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0xcb)]('Executing\x20new\x20tests...'));const {projectId:_0xfa9dff,agentId:_0x2b6bed}=_0x3a2ae5[_0x1df785(0xc3)];for(const _0x558bb5 of _0xf41dbe){console[_0x1df785(0xc0)](_0x1df785(0x120)+a5_0x47420f[_0x1df785(0x104)](_0x558bb5[_0x1df785(0x130)]));const _0x582318=createCommandSpinner(_0x1df785(0xc6)+_0x558bb5[_0x1df785(0x126)][_0x1df785(0x10a)]+_0x1df785(0xb7));_0x582318[_0x1df785(0x133)]();try{const {result:_0x142710}=await runTest(_0x27cccd['llm'],_0x558bb5,{'agentId':_0x2b6bed,'projectId':_0xfa9dff,'site':_0x3a2ae5[_0x1df785(0x106)],'noEval':![],'evaluatorId':_0x23dc2b,'onRoundStart':(_0x433b7e,_0x248f0e)=>{const _0x3feeab=_0x1df785;_0x582318[_0x3feeab(0xdf)]=_0x3feeab(0xd6)+(_0x433b7e+0x1)+'/'+_0x248f0e+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0xa825c4,_0x4ded23,_0x28239c)=>{const _0x503e87=_0x1df785,_0x2b9e0d=formatElapsed(_0x4ded23);_0x28239c?console[_0x503e87(0xc0)](_0x503e87(0x121)+(_0xa825c4+0x1)+'/'+_0x558bb5[_0x503e87(0x126)]['length']+_0x503e87(0x134)+a5_0x47420f[_0x503e87(0x12c)]('✓')+'\x20('+_0x2b9e0d+')'):console['log']('\x20\x20Round\x20'+(_0xa825c4+0x1)+'/'+_0x558bb5[_0x503e87(0x126)][_0x503e87(0x10a)]+_0x503e87(0x134)+a5_0x47420f[_0x503e87(0x128)]('✗'));},'onEvaluationStart':()=>{const _0x4b2111=_0x1df785;_0x582318['text']=_0x4b2111(0x10d);},'onEvaluationComplete':_0x28a6f3=>{const _0x562d1e=_0x1df785,_0x159c59=formatElapsed(_0x28a6f3);console[_0x562d1e(0xc0)](_0x562d1e(0xc7)+a5_0x47420f[_0x562d1e(0x12c)]('✓')+'\x20('+_0x159c59+')');}});_0x582318[_0x1df785(0xf4)](),_0x2b8a4d[_0x1df785(0xc9)](_0x142710);if(_0x142710[_0x1df785(0xd8)]===_0x1df785(0xea))console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x12c)]('✓\x20PASS:\x20'+_0x142710[_0x1df785(0xec)])+a5_0x47420f[_0x1df785(0xf0)](_0x1df785(0xfa)));else _0x142710[_0x1df785(0xd8)]===_0x1df785(0xf8)?console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x128)](_0x1df785(0xfd)+_0x142710[_0x1df785(0xec)])+a5_0x47420f[_0x1df785(0xf0)](_0x1df785(0xfa))):console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x128)](_0x1df785(0x12f)+_0x142710[_0x1df785(0xec)]));_0x142710[_0x1df785(0xe0)]&&console[_0x1df785(0xc0)](a5_0x47420f['dim'](_0x1df785(0x108)+_0x142710[_0x1df785(0xe0)]));}catch(_0x1522c4){_0x582318['stop']();const _0xe817a7=_0x1522c4 instanceof Error?_0x1522c4[_0x1df785(0x124)]:String(_0x1522c4);console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0x128)]('✗\x20ERROR:\x20'+_0xe817a7)),_0x2b8a4d[_0x1df785(0xc9)]({'name':_0x558bb5[_0x1df785(0x130)],'status':_0x1df785(0x116),'reason':_0xe817a7,'timestamp':new Date()[_0x1df785(0xba)](),'duration_ms':0x0});}}}console[_0x1df785(0xc0)]();const _0x4eb4c7=Date[_0x1df785(0x135)]()-_0x2bd046,_0x17c8d4=_0x2b8a4d[_0x1df785(0xaf)](_0x2350d8=>_0x2350d8['status']===_0x1df785(0xea))['length'],_0x52a270=_0x2b8a4d[_0x1df785(0xaf)](_0x401db1=>_0x401db1[_0x1df785(0xd8)]===_0x1df785(0xf8))[_0x1df785(0x10a)],_0x3c4c46=_0x2b8a4d['filter'](_0x42cc39=>_0x42cc39[_0x1df785(0xd8)]===_0x1df785(0x116))['length'];console[_0x1df785(0xc0)]('━'[_0x1df785(0x11b)](0x3c)),console[_0x1df785(0xc0)](_0x1df785(0xdc)),console[_0x1df785(0xc0)]('━'[_0x1df785(0x11b)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x2b8a4d[_0x1df785(0x10a)]),console[_0x1df785(0xc0)](_0x1df785(0xbd)+a5_0x47420f[_0x1df785(0x12c)](_0x17c8d4)),console['log'](_0x1df785(0xa8)+a5_0x47420f['red'](_0x52a270));_0x3c4c46>0x0&&console['log'](_0x1df785(0xe1)+a5_0x47420f['red'](_0x3c4c46));console[_0x1df785(0xc0)](_0x1df785(0x12e)+formatElapsed(_0x4eb4c7)),console[_0x1df785(0xc0)]('━'['repeat'](0x3c));const _0x3c8b8c={'summary':{'total':_0x2b8a4d[_0x1df785(0x10a)],'passed':_0x17c8d4,'failed':_0x52a270,'errors':_0x3c4c46>0x0?_0x3c4c46:undefined,'duration_ms':_0x4eb4c7},'tests':_0x2b8a4d,'agent':{'project':_0x35c604['projectName'],'name':_0x35c604[_0x1df785(0xaa)],'site':_0x1aeeac},'timestamp':new Date(_0x2bd046)[_0x1df785(0xba)]()};if(_0x52ae62!=='table'||_0x17164b){const _0x1e0c39=formatResults(_0x3c8b8c,_0x52ae62);if(_0x17164b)try{a5_0x34fa52['writeFileSync'](_0x17164b,_0x1e0c39,_0x1df785(0xa6)),console[_0x1df785(0xc0)](),console[_0x1df785(0xc0)](a5_0x47420f[_0x1df785(0xf0)](_0x1df785(0x10b)+_0x17164b));}catch(_0x232403){return console[_0x1df785(0xc0)](),console[_0x1df785(0xc0)](a5_0x47420f['red'](_0x1df785(0x11c)+_0x232403)),0x1;}else console[_0x1df785(0xc0)](),console['log'](_0x1e0c39);}const _0x14bcc5=_0x2b8a4d[_0x1df785(0xaf)](_0x5732de=>_0x5732de[_0x1df785(0xd8)]!==_0x1df785(0xea));return _0x14bcc5[_0x1df785(0x10a)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x5584a2=a6_0x3744;(function(_0x47a017,_0x4d442f){const _0x564684=a6_0x3744,_0x1fa5ce=_0x47a017();while(!![]){try{const _0x310be4=parseInt(_0x564684(0x1d6))/0x1+-parseInt(_0x564684(0x1c9))/0x2+-parseInt(_0x564684(0x1a7))/0x3*(parseInt(_0x564684(0x1b2))/0x4)+parseInt(_0x564684(0x1c6))/0x5*(parseInt(_0x564684(0x1b4))/0x6)+parseInt(_0x564684(0x1a2))/0x7+parseInt(_0x564684(0x1c5))/0x8+-parseInt(_0x564684(0x1b9))/0x9;if(_0x310be4===_0x4d442f)break;else _0x1fa5ce['push'](_0x1fa5ce['shift']());}catch(_0x377816){_0x1fa5ce['push'](_0x1fa5ce['shift']());}}}(a6_0x3ff4,0x9d1a8));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x3744(_0x3ca805,_0x44eae4){_0x3ca805=_0x3ca805-0x198;const _0x3ff430=a6_0x3ff4();let _0x374413=_0x3ff430[_0x3ca805];return _0x374413;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x3ff4(){const _0x2859c8=['body','Invalid\x20API\x20type:\x20','name','llm-proxy','set-cookie2','workflow','includes','GET','2989819gUaELK','message','site','DELETE','method','39cBnFXP','description','startsWith','api','file','keys','execute','Results\x20saved\x20to\x20','substring','entries','isArray','41464OjvHfD','\x22.\x20','12KrlSUF','stack','cas','length','authorization','6068376XSCOvJ','proxy-authorization','color','log','.\x20Valid\x20types:\x20','PUT','Endpoint\x20must\x20start\x20with\x20/:\x20','join','toUpperCase','x-xsrf-token','POST','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','5170496otMpQB','627580kmgDju','request','verbose','1837822NkUZra','Invalid\x20HTTP\x20method:\x20','readBodyFromFile','cookie','<\x20HTTP/1.1\x20','error','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Error:\x20','type','data','headers','output','noColor','1046968QosAsR','trim','llm','validate'];a6_0x3ff4=function(){return _0x2859c8;};return a6_0x3ff4();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5584a2(0x1b8),a6_0x5584a2(0x1ba),a6_0x5584a2(0x1cc),'set-cookie',a6_0x5584a2(0x19e),a6_0x5584a2(0x1c2),'x-auth-token','x-trino-user']);function isSensitiveHeader(_0x4b30f1){return SENSITIVE_HEADERS['has'](_0x4b30f1['toLowerCase']());}function parseHeader(_0x5ed391){const _0x410d7a=a6_0x5584a2,_0x1c4042=_0x5ed391['indexOf'](':');if(_0x1c4042===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5ed391+_0x410d7a(0x1b3)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0xa6586f=_0x5ed391[_0x410d7a(0x1af)](0x0,_0x1c4042)[_0x410d7a(0x1d7)](),_0x2ce5a4=_0x5ed391[_0x410d7a(0x1af)](_0x1c4042+0x1)[_0x410d7a(0x1d7)]();if(!_0xa6586f)throw new Error(_0x410d7a(0x1c4)+_0x5ed391+'\x22');return[_0xa6586f,_0x2ce5a4];}export class ApiCommand extends BaseCommand{[a6_0x5584a2(0x19c)]=a6_0x5584a2(0x1aa);[a6_0x5584a2(0x1a8)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x5584a2(0x199)](_0x24e4d1){const _0x404fa5=a6_0x5584a2,{args:_0x21b27e,options:_0x115428}=_0x24e4d1,_0x1fafcc=_0x115428;if(_0x21b27e['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x4607da=_0x21b27e[0x0];if(!_0x4607da[_0x404fa5(0x1a9)]('/'))return _0x404fa5(0x1bf)+_0x4607da;const _0x5acd6b=_0x1fafcc['data'],_0x2f43e3=_0x1fafcc[_0x404fa5(0x1ab)];if(_0x5acd6b&&_0x2f43e3)return _0x404fa5(0x1cf);const _0x4554cc=_0x1fafcc[_0x404fa5(0x1a6)]||_0x404fa5(0x1a1),_0x363b21=[_0x404fa5(0x1a1),_0x404fa5(0x1c3),_0x404fa5(0x1be),_0x404fa5(0x1a5),'PATCH'];if(!_0x363b21[_0x404fa5(0x1a0)](_0x4554cc['toUpperCase']()))return _0x404fa5(0x1ca)+_0x4554cc+'.\x20Valid\x20methods:\x20'+_0x363b21[_0x404fa5(0x1c0)](',\x20');const _0xedb78e=_0x1fafcc[_0x404fa5(0x1d1)]||'td',_0x284758=['td','cdp',_0x404fa5(0x19f),'trino',_0x404fa5(0x198),_0x404fa5(0x19d),_0x404fa5(0x1b6)];if(!_0x284758[_0x404fa5(0x1a0)](_0xedb78e))return _0x404fa5(0x19b)+_0xedb78e+_0x404fa5(0x1bd)+_0x284758[_0x404fa5(0x1c0)](',\x20');return undefined;}async[a6_0x5584a2(0x1ad)](_0xcf6db3){const _0x240de9=a6_0x5584a2,{options:_0x5e153e,args:_0x755979,tdx:_0x379355}=_0xcf6db3,_0x4de566=_0x5e153e,_0x37915a=_0x755979[0x0],_0x29af05=(_0x4de566[_0x240de9(0x1a6)]||_0x240de9(0x1a1))[_0x240de9(0x1c1)](),_0x1f7ed3=_0x4de566[_0x240de9(0x1d2)],_0x5aeb4b=_0x4de566['file'],_0x5b071e=_0x4de566['header'],_0x5e7447=_0x4de566[_0x240de9(0x1d1)]||'td';try{const _0x643899={};if(_0x5b071e){const _0x3e9cf6=Array[_0x240de9(0x1b1)](_0x5b071e)?_0x5b071e:[_0x5b071e];for(const _0x3333d9 of _0x3e9cf6){const [_0x59c76a,_0x136fca]=parseHeader(_0x3333d9);_0x643899[_0x59c76a]=_0x136fca;}}let _0x57ac3e;if(_0x1f7ed3)_0x57ac3e=_0x1f7ed3;else{if(_0x5aeb4b)try{_0x57ac3e=RawAPI[_0x240de9(0x1cb)](_0x5aeb4b);}catch(_0x3e7a32){return console[_0x240de9(0x1ce)](_0x240de9(0x1d0)+(_0x3e7a32 instanceof Error?_0x3e7a32[_0x240de9(0x1a3)]:String(_0x3e7a32))),0x1;}}const _0x1c513b={'method':_0x29af05,'apiType':_0x5e7447,'includeHeaders':_0x5e153e[_0x240de9(0x1c8)]};_0x57ac3e&&(_0x1c513b[_0x240de9(0x19a)]=_0x57ac3e);Object[_0x240de9(0x1ac)](_0x643899)[_0x240de9(0x1b7)]>0x0&&(_0x1c513b[_0x240de9(0x1d3)]=_0x643899);if(_0x5e153e[_0x240de9(0x1c8)]){const _0x37c741=resolveSite(_0x5e153e[_0x240de9(0x1a4)]),_0x5be4e6=getEndpoint(_0x37c741,_0x5e7447),_0x498d8b=''+_0x5be4e6+_0x37915a;console[_0x240de9(0x1ce)]('>\x20'+_0x29af05+'\x20'+_0x498d8b);const _0x10f58e=getAuthHeaders(_0x37c741),_0x3ce588={..._0x10f58e,..._0x643899};for(const [_0x4a462f,_0x31f5b0]of Object['entries'](_0x3ce588)){!isSensitiveHeader(_0x4a462f)&&console['error']('>\x20'+_0x4a462f+':\x20'+_0x31f5b0);}_0x57ac3e&&console[_0x240de9(0x1ce)]('>'),console[_0x240de9(0x1ce)]('');}const _0x8efd0b=await _0x379355[_0x240de9(0x1aa)][_0x240de9(0x1c7)](_0x37915a,_0x1c513b);if(_0x5e153e['verbose']&&_0x8efd0b[_0x240de9(0x1d3)]){console['error'](_0x240de9(0x1cd)+_0x8efd0b['status']);for(const [_0x4fb4c7,_0x44b8c6]of Object[_0x240de9(0x1b0)](_0x8efd0b['headers'])){!isSensitiveHeader(_0x4fb4c7)&&console[_0x240de9(0x1ce)]('<\x20'+_0x4fb4c7+':\x20'+_0x44b8c6);}console[_0x240de9(0x1ce)]('');}const _0x4e1fdd=Boolean(_0x5e153e[_0x240de9(0x1d4)]),_0x107542={'color':_0x5e153e[_0x240de9(0x1bb)],'noColor':_0x5e153e[_0x240de9(0x1d5)]||_0x4e1fdd&&!_0x5e153e['color']},_0x1d2a58=colorizeJSON(_0x8efd0b[_0x240de9(0x1d2)],_0x107542);return _0x5e153e[_0x240de9(0x1d4)]?(writeFileSync(_0x5e153e[_0x240de9(0x1d4)],_0x1d2a58),console['error'](_0x240de9(0x1ae)+_0x5e153e['output'])):console[_0x240de9(0x1bc)](_0x1d2a58),0x0;}catch(_0x53c91f){return _0x53c91f instanceof Error?(console[_0x240de9(0x1ce)](_0x240de9(0x1d0)+_0x53c91f['message']),_0x5e153e[_0x240de9(0x1c8)]&&_0x53c91f[_0x240de9(0x1b5)]&&console[_0x240de9(0x1ce)]('\x0aStack\x20trace:\x0a'+_0x53c91f['stack'])):console[_0x240de9(0x1ce)](_0x240de9(0x1d0)+String(_0x53c91f)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x4b3b1d=a7_0xa0a9;(function(_0x51b351,_0x352b8e){const _0x5075f0=a7_0xa0a9,_0x5ad430=_0x51b351();while(!![]){try{const _0x2682b1=parseInt(_0x5075f0(0xcd))/0x1+parseInt(_0x5075f0(0x108))/0x2+parseInt(_0x5075f0(0x110))/0x3+-parseInt(_0x5075f0(0xc6))/0x4+-parseInt(_0x5075f0(0xde))/0x5+parseInt(_0x5075f0(0x116))/0x6*(parseInt(_0x5075f0(0xca))/0x7)+-parseInt(_0x5075f0(0xed))/0x8;if(_0x2682b1===_0x352b8e)break;else _0x5ad430['push'](_0x5ad430['shift']());}catch(_0x4d34de){_0x5ad430['push'](_0x5ad430['shift']());}}}(a7_0x35ad,0x8a900));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';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0xa0a9(_0x147ea9,_0x4b7e29){_0x147ea9=_0x147ea9-0xc2;const _0x35ad29=a7_0x35ad();let _0xa0a996=_0x35ad29[_0x147ea9];return _0xa0a996;}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';function a7_0x35ad(){const _0x4b49bc=['2598426JTkXYy','OAuth\x20tokens','Use\x20an\x20API\x20key','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Choose\x20how\x20to\x20sign\x20in:','Setup\x20cancelled','auth:setup','first_name','password','accountName','Remove\x20API\x20key\x20from\x20system\x20keychain','/users/initiate_sso\x20(account:\x20','User:\x20','filter','name','1968924qpmMtX','Credential\x20type:\x20OAuth','last_name','jobs','7zEEoxR','apikey','For\x20scripts\x20or\x20headless\x20servers','897231SyLnYf','API\x20key','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','trim','error','bold','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20(profile:\x20','/app/mp/ak','oauth','description','red','profile','warn','\x20\x20tdx','tdx:\x20auth\x20setup','N/A','5532580yQqYyv','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Read\x20credential\x20from\x20keychain','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','select','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','auth:clear','No\x20credentials\x20found\x20in\x20keychain','Setting\x20up\x20authentication\x20for\x20site:\x20','✓\x20Authentication\x20successful\x0a','tdx:\x20auth\x20clear','log','dim','status','1677160dIqHwG','\x0aSetup\x20cancelled','✓\x20Default\x20site\x20set\x20to\x20','auth','\x20and\x20','logLevel','You\x20can\x20find\x20your\x20API\x20key\x20at:','cyan','ERROR','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20(','Enter\x20your\x20TD\x20API\x20key:','Validating\x20API\x20key...','Setup\x20API\x20key\x20authentication\x20interactively','method','Validating\x20OAuth\x20tokens...','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Read\x20credential\x20from\x20','✓\x20Profile\x20\x27','yellow','join','execute','✓\x20Signed\x20in\x20successfully','access_token','email','site','apiKey','439792zgaJig','create','Sign\x20in\x20with\x20browser\x20(recommended)','tdx\x20profile:\x20','\x27\x20registered','getUserInfo','\x20--profile\x20','all','2477238xQIPYE','us01','\x20removed\x20from\x20keychain','message','✗\x20Validation\x20failed:\x20','green'];a7_0x35ad=function(){return _0x4b49bc;};return a7_0x35ad();}import{promptSiteSelection}from'../core/constants.js';import a7_0x537fae 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_0x8cfce1 from'chalk';export async function runOAuthLoginFlow(_0x2eec96,_0x1533cb,_0x470ef7,_0x3e2707){const _0x3453f4=a7_0xa0a9,_0x29e4bc=await isKeychainAvailable();if(!_0x29e4bc)throw new Error(_0x3453f4(0xfd)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x4451f2=_0x3e2707?.[_0x3453f4(0x11f)];if(!_0x4451f2){const _0x1f1def=await a7_0x537fae({'type':'text','name':_0x3453f4(0x11f),'message':_0x3453f4(0xd3)});if(_0x1f1def['accountName']===undefined)throw new Error(_0x3453f4(0x11b));_0x4451f2=_0x1f1def['accountName'][_0x3453f4(0xd0)]()||undefined;}const _0x78bde8=getConsoleUrl(_0x2eec96);console[_0x3453f4(0xea)]('Opening\x20browser\x20for\x20authentication...');_0x4451f2?console['log']('\x20\x20'+_0x78bde8+_0x3453f4(0xc2)+_0x4451f2+')'):console['log']('\x20\x20'+_0x78bde8+'/oauth/authorize');console[_0x3453f4(0xea)](_0x3453f4(0xe4));const _0x531477=await startOAuthFlow(_0x2eec96,{'accountName':_0x4451f2});console[_0x3453f4(0xea)](_0x3453f4(0xfc));const _0x1f382e=TDX[_0x3453f4(0x109)]({'site':_0x2eec96,'accessToken':_0x531477[_0x3453f4(0x104)],'logLevel':_0x470ef7??LogLevel[_0x3453f4(0xf5)]}),_0x1f45a3=await _0x1f382e['jobs'][_0x3453f4(0x10d)]();console[_0x3453f4(0xea)](a7_0x8cfce1[_0x3453f4(0x115)](_0x3453f4(0x103))),console[_0x3453f4(0xea)]('\x20\x20'+a7_0x8cfce1[_0x3453f4(0xf4)](_0x2eec96+':'+_0x1f45a3['account_id'])+'\x20\x20user_id:'+_0x1f45a3['id']+_0x3453f4(0xf7)+_0x1f45a3[_0x3453f4(0x105)]+')');!_0x4451f2&&(console[_0x3453f4(0xea)](a7_0x8cfce1['dim']('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x3453f4(0xea)](a7_0x8cfce1[_0x3453f4(0xeb)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console['log'](a7_0x8cfce1[_0x3453f4(0xeb)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x531477,_0x1533cb),console[_0x3453f4(0xea)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x1533cb?'\x20(profile:\x20'+_0x1533cb+')':''));if(_0x1533cb){const _0xf03fdf={'site':_0x2eec96};saveProfileToUserConfig(_0x1533cb,_0xf03fdf),console['log'](_0x3453f4(0xff)+_0x1533cb+_0x3453f4(0x10c));}else saveDefaultSiteToUserConfig(_0x2eec96),console[_0x3453f4(0xea)](_0x3453f4(0xef)+_0x2eec96);const _0xe57577=_0x1533cb?_0x3453f4(0x10e)+_0x1533cb:'';console[_0x3453f4(0xea)](),console[_0x3453f4(0xea)](_0x3453f4(0x119)),console[_0x3453f4(0xea)](_0x3453f4(0xdb)+_0xe57577+_0x3453f4(0xf6)),console[_0x3453f4(0xea)](_0x3453f4(0xdb)+_0xe57577+_0x3453f4(0xdf));}export async function promptAuthMethod(){const _0x54a540=a7_0xa0a9,_0xd2bd7f=await a7_0x537fae({'type':_0x54a540(0xe2),'name':_0x54a540(0xfb),'message':_0x54a540(0x11a),'choices':[{'title':_0x54a540(0x10a),'description':_0x54a540(0xe1),'value':_0x54a540(0xd6)},{'title':_0x54a540(0x118),'description':_0x54a540(0xcc),'value':_0x54a540(0xcb)}]});return _0xd2bd7f[_0x54a540(0xfb)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x4b3b1d(0xc5)]=a7_0x4b3b1d(0x11c);[a7_0x4b3b1d(0xd7)]=a7_0x4b3b1d(0xfa);async[a7_0x4b3b1d(0x102)](_0xbd49){const _0x5d39f9=a7_0x4b3b1d,{options:_0x1af209}=_0xbd49,_0x5752c4=_0x1af209[_0x5d39f9(0xd9)];console[_0x5d39f9(0xea)](a7_0x8cfce1[_0x5d39f9(0xd2)](_0x5d39f9(0xdc)));const _0x361930=_0x1af209[_0x5d39f9(0x106)]||_0x5d39f9(0x111),_0x2c8572=await promptSiteSelection(_0x361930,_0x5752c4,_0x5d39f9(0x11b));if(!_0x2c8572)return 0x1;const _0x1f8d94=resolveSite(_0x2c8572),_0x116630=await promptAuthMethod();if(!_0x116630)return console['log'](_0x5d39f9(0xee)),0x1;if(_0x116630===_0x5d39f9(0xd6)){const {accountName:_0x15f141}=_0x1af209;return await runOAuthLoginFlow(_0x1f8d94,_0x5752c4,_0x1af209[_0x5d39f9(0xf2)]??LogLevel['ERROR'],{'accountName':_0x15f141}),0x0;}console['log'](_0x5d39f9(0xe7)+_0x1f8d94),console[_0x5d39f9(0xea)](_0x5d39f9(0xf3)),console[_0x5d39f9(0xea)]('\x20\x20'+getConsoleUrl(_0x1f8d94,_0x5d39f9(0xd5)));const _0x3ae7d5=await a7_0x537fae({'type':_0x5d39f9(0x11e),'name':'apiKey','message':_0x5d39f9(0xf8),'validate':_0x5acdc2=>{const _0x265a63=_0x5d39f9;if(!_0x5acdc2||!_0x5acdc2[_0x265a63(0xd0)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3ae7d5[_0x5d39f9(0x107)])return console[_0x5d39f9(0xea)]('\x0aSetup\x20cancelled'),0x1;const _0x11ebe9=_0x3ae7d5[_0x5d39f9(0x107)];console[_0x5d39f9(0xea)](_0x5d39f9(0xf9));try{const _0x3b5285=TDX[_0x5d39f9(0x109)]({'site':_0x1f8d94,'apiKey':_0x11ebe9['trim'](),'logLevel':_0x1af209[_0x5d39f9(0xf2)]??LogLevel[_0x5d39f9(0xf5)]}),_0x37ea83=await _0x3b5285[_0x5d39f9(0xc9)]['getUserInfo']();console[_0x5d39f9(0xea)](_0x5d39f9(0xe3)+_0x37ea83[_0x5d39f9(0x105)]+')');const _0x868680=await isKeychainAvailable();_0x868680?(await saveAPIKeyAsync(_0x11ebe9['trim'](),_0x1f8d94,_0x5752c4),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5752c4?_0x5d39f9(0xd4)+_0x5752c4+')':''))):(console[_0x5d39f9(0xda)](a7_0x8cfce1['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5d39f9(0xda)](a7_0x8cfce1['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x5752c4){const _0x13a776={'site':_0x1f8d94};saveProfileToUserConfig(_0x5752c4,_0x13a776),console[_0x5d39f9(0xea)](_0x5d39f9(0xff)+_0x5752c4+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1f8d94),console[_0x5d39f9(0xea)](_0x5d39f9(0xef)+_0x1f8d94);const _0x309b91=_0x5752c4?'\x20--profile\x20'+_0x5752c4:'';return console[_0x5d39f9(0xea)](),console[_0x5d39f9(0xea)](_0x5d39f9(0x119)),console[_0x5d39f9(0xea)](_0x5d39f9(0xdb)+_0x309b91+_0x5d39f9(0xf6)),console['log']('\x20\x20tdx'+_0x309b91+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x493754){if(_0x493754 instanceof HTTPClientError&&_0x493754[_0x5d39f9(0xec)]===0x191)return printAuthError(_0x493754),0x1;return console[_0x5d39f9(0xd1)](a7_0x8cfce1[_0x5d39f9(0xd8)](_0x5d39f9(0x114)+(_0x493754 instanceof Error?_0x493754[_0x5d39f9(0x113)]:String(_0x493754)))),console[_0x5d39f9(0xd1)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x4b3b1d(0xc5)]=a7_0x4b3b1d(0xf0);[a7_0x4b3b1d(0xd7)]=a7_0x4b3b1d(0xcf);async[a7_0x4b3b1d(0x102)](_0x52caf1){const _0x581745=a7_0x4b3b1d,{options:_0x30399f,tdx:_0x2af592}=_0x52caf1,_0x5c19c3=_0x30399f[_0x581745(0x106)],_0x2c67c6=_0x30399f[_0x581745(0xd9)],_0x5866c4=_0x2c67c6?_0x2c67c6:_0x581745(0xdd);console[_0x581745(0xea)](_0x581745(0x10b)+_0x5866c4+'\x20(site:\x20'+_0x5c19c3+')');const _0x25663c=await getOAuthTokens(_0x2c67c6);if(_0x25663c)console['log'](_0x581745(0xc7)),console[_0x581745(0xea)](_0x581745(0xe0)+(_0x2c67c6?_0x581745(0xd4)+_0x2c67c6+')':''));else{const _0xd5b2f6=await resolveAPIKeyAsync(_0x5c19c3,_0x2c67c6);if(_0xd5b2f6){const {source:_0x5d5a25,isDeprecated:_0x321e8e}=_0xd5b2f6,_0x547d01=_0x581745(0xfe)+_0x5d5a25;console[_0x581745(0xea)](_0x321e8e?a7_0x8cfce1['yellow'](_0x547d01):_0x547d01);}else console['log'](a7_0x8cfce1[_0x581745(0x100)]('No\x20credential\x20found'));}try{const _0x4df442=await _0x2af592['jobs'][_0x581745(0x10d)]();return console[_0x581745(0xea)](a7_0x8cfce1[_0x581745(0x115)](_0x581745(0xe8))),console[_0x581745(0xea)](_0x581745(0xc3)+_0x4df442['email']),(_0x4df442[_0x581745(0x11d)]||_0x4df442['last_name'])&&console[_0x581745(0xea)]('Name:\x20'+[_0x4df442[_0x581745(0x11d)],_0x4df442[_0x581745(0xc8)]]['filter'](Boolean)[_0x581745(0x101)]('\x20')),0x0;}catch(_0x1f6281){return _0x1f6281 instanceof HTTPClientError&&_0x1f6281['status']===0x191?printAuthError(_0x1f6281,!![],_0x2c67c6):console['error'](a7_0x8cfce1[_0x581745(0xd8)](_0x581745(0x114)+(_0x1f6281 instanceof Error?_0x1f6281[_0x581745(0x113)]:String(_0x1f6281)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4b3b1d(0xc5)]=a7_0x4b3b1d(0xe5);['description']=a7_0x4b3b1d(0x120);async['execute'](_0x50371a){const _0x13820d=a7_0x4b3b1d,{options:_0x218948}=_0x50371a,_0x1561bd=_0x218948['profile'];console['log'](a7_0x8cfce1[_0x13820d(0xd2)](_0x13820d(0xe9)));const _0x2a6a98=await isKeychainAvailable();if(!_0x2a6a98)return console[_0x13820d(0xd1)](a7_0x8cfce1[_0x13820d(0xd8)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x709938,_0x256b54]=await Promise[_0x13820d(0x10f)]([deleteKeychainAPIKey(_0x1561bd),deleteOAuthTokens(_0x1561bd)]);if(_0x709938||_0x256b54){clearCredentialCache();const _0x373ef9=[_0x709938&&_0x13820d(0xce),_0x256b54&&_0x13820d(0x117)][_0x13820d(0xc4)](Boolean)[_0x13820d(0x101)](_0x13820d(0xf1));return console[_0x13820d(0xea)]('✓\x20'+_0x373ef9+_0x13820d(0x112)+(_0x1561bd?_0x13820d(0xd4)+_0x1561bd+')':'')),0x0;}else return console[_0x13820d(0xea)](_0x13820d(0xe6)+(_0x1561bd?'\x20for\x20profile:\x20'+_0x1561bd:'')),0x1;}}
|
|
1
|
+
const a7_0x4ebee9=a7_0xc09f;(function(_0x6954c1,_0x5c1b68){const _0x48cbb9=a7_0xc09f,_0x4375aa=_0x6954c1();while(!![]){try{const _0x24a0e7=parseInt(_0x48cbb9(0x140))/0x1+-parseInt(_0x48cbb9(0x10c))/0x2*(-parseInt(_0x48cbb9(0x10f))/0x3)+-parseInt(_0x48cbb9(0x143))/0x4+-parseInt(_0x48cbb9(0x10b))/0x5*(-parseInt(_0x48cbb9(0x138))/0x6)+parseInt(_0x48cbb9(0x116))/0x7+parseInt(_0x48cbb9(0x103))/0x8+-parseInt(_0x48cbb9(0x137))/0x9;if(_0x24a0e7===_0x5c1b68)break;else _0x4375aa['push'](_0x4375aa['shift']());}catch(_0xde5a49){_0x4375aa['push'](_0x4375aa['shift']());}}}(a7_0x43a8,0x689f4));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';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_0x405c83 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x43a8(){const _0x1f72d2=['red','warn','/oauth/authorize','oauth','\x20(site:\x20','message','✗\x20Validation\x20failed:\x20','Setup\x20API\x20key\x20authentication\x20interactively','11795562gWsvfA','6WrIDgm','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','method','bold','\x20for\x20profile:\x20','account_id','tdx:\x20auth\x20clear','dim','738039WtHQKQ','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','text','2154344JxGOzO','apiKey','\x27\x20registered','Setup\x20cancelled','\x20and\x20','ERROR','System\x20keychain\x20is\x20not\x20available','Validating\x20OAuth\x20tokens...','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','password','\x20removed\x20from\x20keychain','jobs','access_token','execute','✓\x20Default\x20site\x20set\x20to\x20','log','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','N/A','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Credential\x20type:\x20OAuth','logLevel','Use\x20an\x20API\x20key','Remove\x20API\x20key\x20from\x20system\x20keychain','getUserInfo','3005736htLLMa','/users/initiate_sso\x20(account:\x20','\x0aSetup\x20cancelled','tdx:\x20auth\x20setup','profile','trim','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setting\x20up\x20authentication\x20for\x20site:\x20','2307185chQhZj','26YGCDdD','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','/app/mp/ak','45768NrqKWz','us01','join','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','\x20--profile\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','cyan','3529505ZzJaDs','site','create','status','yellow','last_name','auth:clear','\x20(profile:\x20','name','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Sign\x20in\x20with\x20browser\x20(recommended)','\x20\x20tdx','green','accountName','email','OAuth\x20tokens','description','No\x20credential\x20found','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','✓\x20Profile\x20\x27','error','API\x20key','filter'];a7_0x43a8=function(){return _0x1f72d2;};return a7_0x43a8();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x342aa7 from'chalk';export async function runOAuthLoginFlow(_0x111db8,_0x578919,_0x442490,_0x200cc3){const _0x2fde8a=a7_0xc09f,_0x3634c4=await isKeychainAvailable();if(!_0x3634c4)throw new Error(_0x2fde8a(0x11f)+_0x2fde8a(0x128));let _0x40a175=_0x200cc3?.['accountName'];if(!_0x40a175){const _0x3a11dd=await a7_0x405c83({'type':_0x2fde8a(0x142),'name':_0x2fde8a(0x123),'message':_0x2fde8a(0x139)});if(_0x3a11dd[_0x2fde8a(0x123)]===undefined)throw new Error(_0x2fde8a(0x146));_0x40a175=_0x3a11dd[_0x2fde8a(0x123)][_0x2fde8a(0x108)]()||undefined;}const _0x579984=getConsoleUrl(_0x111db8);console[_0x2fde8a(0xfa)]('Opening\x20browser\x20for\x20authentication...');_0x40a175?console['log']('\x20\x20'+_0x579984+_0x2fde8a(0x104)+_0x40a175+')'):console['log']('\x20\x20'+_0x579984+_0x2fde8a(0x131));console[_0x2fde8a(0xfa)](_0x2fde8a(0xf3));const _0x30e732=await startOAuthFlow(_0x111db8,{'accountName':_0x40a175});console[_0x2fde8a(0xfa)](_0x2fde8a(0xf2));const _0x4f4129=TDX['create']({'site':_0x111db8,'accessToken':_0x30e732[_0x2fde8a(0xf7)],'logLevel':_0x442490??LogLevel[_0x2fde8a(0x148)]}),_0x3fa42c=await _0x4f4129[_0x2fde8a(0xf6)]['getUserInfo']();console[_0x2fde8a(0xfa)](a7_0x342aa7[_0x2fde8a(0x122)]('✓\x20Signed\x20in\x20successfully')),console[_0x2fde8a(0xfa)]('\x20\x20'+a7_0x342aa7[_0x2fde8a(0x115)](_0x111db8+':'+_0x3fa42c[_0x2fde8a(0x13d)])+'\x20\x20user_id:'+_0x3fa42c['id']+'\x20\x20('+_0x3fa42c[_0x2fde8a(0x124)]+')');!_0x40a175&&(console[_0x2fde8a(0xfa)](a7_0x342aa7[_0x2fde8a(0x13f)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x2fde8a(0xfa)](a7_0x342aa7[_0x2fde8a(0x13f)](_0x2fde8a(0x112))),console[_0x2fde8a(0xfa)](a7_0x342aa7[_0x2fde8a(0x13f)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x30e732,_0x578919),console[_0x2fde8a(0xfa)](_0x2fde8a(0x12a)+(_0x578919?_0x2fde8a(0x11d)+_0x578919+')':''));if(_0x578919){const _0x1d22ee={'site':_0x111db8};saveProfileToUserConfig(_0x578919,_0x1d22ee),console[_0x2fde8a(0xfa)](_0x2fde8a(0x12b)+_0x578919+_0x2fde8a(0x145));}else saveDefaultSiteToUserConfig(_0x111db8),console[_0x2fde8a(0xfa)](_0x2fde8a(0xf9)+_0x111db8);const _0x83d74e=_0x578919?'\x20--profile\x20'+_0x578919:'';console[_0x2fde8a(0xfa)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x2fde8a(0xfa)](_0x2fde8a(0x121)+_0x83d74e+_0x2fde8a(0x114)),console[_0x2fde8a(0xfa)](_0x2fde8a(0x121)+_0x83d74e+_0x2fde8a(0xfb));}export async function promptAuthMethod(){const _0x18989f=a7_0xc09f,_0x32ad6d=await a7_0x405c83({'type':'select','name':_0x18989f(0x13a),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x18989f(0x120),'description':_0x18989f(0x141),'value':_0x18989f(0x132)},{'title':_0x18989f(0x100),'description':'For\x20scripts\x20or\x20headless\x20servers','value':'apikey'}]});return _0x32ad6d['method']||null;}function a7_0xc09f(_0x5056d6,_0x42bd51){_0x5056d6=_0x5056d6-0xf1;const _0x43a8b8=a7_0x43a8();let _0xc09fb7=_0x43a8b8[_0x5056d6];return _0xc09fb7;}export class AuthSetupCommand extends BaseCommand{[a7_0x4ebee9(0x11e)]='auth:setup';[a7_0x4ebee9(0x126)]=a7_0x4ebee9(0x136);async[a7_0x4ebee9(0xf8)](_0x44e901){const _0x45a6a0=a7_0x4ebee9,{options:_0x15f265}=_0x44e901,_0x123311=_0x15f265[_0x45a6a0(0x107)];console['log'](a7_0x342aa7['bold'](_0x45a6a0(0x106)));const _0x3f9366=_0x15f265[_0x45a6a0(0x117)]||_0x45a6a0(0x110),_0x4a001d=await promptSiteSelection(_0x3f9366,_0x123311,_0x45a6a0(0x146));if(!_0x4a001d)return 0x1;const _0x266950=resolveSite(_0x4a001d),_0x1fcf1f=await promptAuthMethod();if(!_0x1fcf1f)return console['log'](_0x45a6a0(0x105)),0x1;if(_0x1fcf1f==='oauth'){const {accountName:_0x2b31ab}=_0x15f265;return await runOAuthLoginFlow(_0x266950,_0x123311,_0x15f265['logLevel']??LogLevel[_0x45a6a0(0x148)],{'accountName':_0x2b31ab}),0x0;}console[_0x45a6a0(0xfa)](_0x45a6a0(0x10a)+_0x266950),console[_0x45a6a0(0xfa)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x45a6a0(0xfa)]('\x20\x20'+getConsoleUrl(_0x266950,_0x45a6a0(0x10e)));const _0x4b5666=await a7_0x405c83({'type':_0x45a6a0(0xf4),'name':_0x45a6a0(0x144),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xa1da77=>{if(!_0xa1da77||!_0xa1da77['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x4b5666[_0x45a6a0(0x144)])return console['log'](_0x45a6a0(0x105)),0x1;const _0x16d1ad=_0x4b5666[_0x45a6a0(0x144)];console[_0x45a6a0(0xfa)]('Validating\x20API\x20key...');try{const _0x26e5b0=TDX[_0x45a6a0(0x118)]({'site':_0x266950,'apiKey':_0x16d1ad[_0x45a6a0(0x108)](),'logLevel':_0x15f265[_0x45a6a0(0xff)]??LogLevel[_0x45a6a0(0x148)]}),_0x19659e=await _0x26e5b0[_0x45a6a0(0xf6)]['getUserInfo']();console[_0x45a6a0(0xfa)](_0x45a6a0(0xfd)+_0x19659e[_0x45a6a0(0x124)]+')');const _0x5afcc3=await isKeychainAvailable();_0x5afcc3?(await saveAPIKeyAsync(_0x16d1ad[_0x45a6a0(0x108)](),_0x266950,_0x123311),console[_0x45a6a0(0xfa)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x123311?_0x45a6a0(0x11d)+_0x123311+')':''))):(console[_0x45a6a0(0x130)](a7_0x342aa7[_0x45a6a0(0x11a)](_0x45a6a0(0x129))),console['warn'](a7_0x342aa7[_0x45a6a0(0x11a)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x123311){const _0x1d8243={'site':_0x266950};saveProfileToUserConfig(_0x123311,_0x1d8243),console[_0x45a6a0(0xfa)](_0x45a6a0(0x12b)+_0x123311+_0x45a6a0(0x145));}else saveDefaultSiteToUserConfig(_0x266950),console[_0x45a6a0(0xfa)](_0x45a6a0(0xf9)+_0x266950);const _0x5e8c68=_0x123311?_0x45a6a0(0x113)+_0x123311:'';return console[_0x45a6a0(0xfa)](),console[_0x45a6a0(0xfa)](_0x45a6a0(0x10d)),console['log']('\x20\x20tdx'+_0x5e8c68+_0x45a6a0(0x114)),console[_0x45a6a0(0xfa)](_0x45a6a0(0x121)+_0x5e8c68+_0x45a6a0(0xfb)),0x0;}catch(_0x3432a5){if(_0x3432a5 instanceof HTTPClientError&&_0x3432a5[_0x45a6a0(0x119)]===0x191)return printAuthError(_0x3432a5),0x1;return console[_0x45a6a0(0x12c)](a7_0x342aa7['red'](_0x45a6a0(0x135)+(_0x3432a5 instanceof Error?_0x3432a5[_0x45a6a0(0x134)]:String(_0x3432a5)))),console['error'](_0x45a6a0(0x109)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x4ebee9(0x126)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x4ebee9(0xf8)](_0x458349){const _0x5d126d=a7_0x4ebee9,{options:_0x14898d,tdx:_0x5a9c2b}=_0x458349,_0x2eff0c=_0x14898d[_0x5d126d(0x117)],_0x5aae48=_0x14898d[_0x5d126d(0x107)],_0x56c66c=_0x5aae48?_0x5aae48:_0x5d126d(0xfc);console[_0x5d126d(0xfa)]('tdx\x20profile:\x20'+_0x56c66c+_0x5d126d(0x133)+_0x2eff0c+')');const _0x1e2b5e=await getOAuthTokens(_0x5aae48);if(_0x1e2b5e)console[_0x5d126d(0xfa)](_0x5d126d(0xfe)),console[_0x5d126d(0xfa)]('Read\x20credential\x20from\x20keychain'+(_0x5aae48?_0x5d126d(0x11d)+_0x5aae48+')':''));else{const _0x558a65=await resolveAPIKeyAsync(_0x2eff0c,_0x5aae48);if(_0x558a65){const {source:_0x3f7db9,isDeprecated:_0x2eef15}=_0x558a65,_0x442712='Read\x20credential\x20from\x20'+_0x3f7db9;console[_0x5d126d(0xfa)](_0x2eef15?a7_0x342aa7[_0x5d126d(0x11a)](_0x442712):_0x442712);}else console[_0x5d126d(0xfa)](a7_0x342aa7[_0x5d126d(0x11a)](_0x5d126d(0x127)));}try{const _0x9ecc07=await _0x5a9c2b['jobs'][_0x5d126d(0x102)]();return console[_0x5d126d(0xfa)](a7_0x342aa7['green']('✓\x20Authentication\x20successful\x0a')),console[_0x5d126d(0xfa)]('User:\x20'+_0x9ecc07[_0x5d126d(0x124)]),(_0x9ecc07['first_name']||_0x9ecc07[_0x5d126d(0x11b)])&&console['log']('Name:\x20'+[_0x9ecc07['first_name'],_0x9ecc07[_0x5d126d(0x11b)]][_0x5d126d(0x12e)](Boolean)['join']('\x20')),0x0;}catch(_0x294585){return _0x294585 instanceof HTTPClientError&&_0x294585[_0x5d126d(0x119)]===0x191?printAuthError(_0x294585,!![],_0x5aae48):console[_0x5d126d(0x12c)](a7_0x342aa7[_0x5d126d(0x12f)](_0x5d126d(0x135)+(_0x294585 instanceof Error?_0x294585[_0x5d126d(0x134)]:String(_0x294585)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4ebee9(0x11e)]=a7_0x4ebee9(0x11c);['description']=a7_0x4ebee9(0x101);async[a7_0x4ebee9(0xf8)](_0x136f1b){const _0x5c5c63=a7_0x4ebee9,{options:_0x3b7ce8}=_0x136f1b,_0x3b7c66=_0x3b7ce8[_0x5c5c63(0x107)];console['log'](a7_0x342aa7[_0x5c5c63(0x13b)](_0x5c5c63(0x13e)));const _0x5428fe=await isKeychainAvailable();if(!_0x5428fe)return console[_0x5c5c63(0x12c)](a7_0x342aa7[_0x5c5c63(0x12f)](_0x5c5c63(0xf1))),0x1;const [_0x213f3d,_0x2cc8a4]=await Promise['all']([deleteKeychainAPIKey(_0x3b7c66),deleteOAuthTokens(_0x3b7c66)]);if(_0x213f3d||_0x2cc8a4){clearCredentialCache();const _0x57e297=[_0x213f3d&&_0x5c5c63(0x12d),_0x2cc8a4&&_0x5c5c63(0x125)][_0x5c5c63(0x12e)](Boolean)[_0x5c5c63(0x111)](_0x5c5c63(0x147));return console['log']('✓\x20'+_0x57e297+_0x5c5c63(0xf5)+(_0x3b7c66?_0x5c5c63(0x11d)+_0x3b7c66+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x3b7c66?_0x5c5c63(0x13c)+_0x3b7c66:'')),0x1;}}
|