@treasuredata/tdx 2026.3.27 → 2026.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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.d.ts +141 -2
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/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/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/client/cdp-api-client.d.ts +29 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.d.ts +228 -0
- package/dist/sdk/personalization.d.ts.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/personalization.js.map +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.d.ts +57 -0
- package/dist/sdk/realtime.d.ts.map +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/realtime.js.map +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/cdp.d.ts +76 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/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
|
-
function a4_0x17ca(_0xa50518,_0x1e0b37){_0xa50518=_0xa50518-0x16c;const _0x274681=a4_0x2746();let _0x17ca38=_0x274681[_0xa50518];return _0x17ca38;}const a4_0x347051=a4_0x17ca;(function(_0x272bfd,_0x45b63a){const _0x2be592=a4_0x17ca,_0x4aa24b=_0x272bfd();while(!![]){try{const _0x2b8c5b=-parseInt(_0x2be592(0x1f9))/0x1*(parseInt(_0x2be592(0x18f))/0x2)+-parseInt(_0x2be592(0x18c))/0x3*(-parseInt(_0x2be592(0x20c))/0x4)+parseInt(_0x2be592(0x1ce))/0x5+-parseInt(_0x2be592(0x1ef))/0x6*(-parseInt(_0x2be592(0x1a3))/0x7)+-parseInt(_0x2be592(0x1c6))/0x8*(-parseInt(_0x2be592(0x1c0))/0x9)+parseInt(_0x2be592(0x1b1))/0xa+parseInt(_0x2be592(0x207))/0xb*(-parseInt(_0x2be592(0x1cc))/0xc);if(_0x2b8c5b===_0x45b63a)break;else _0x4aa24b['push'](_0x4aa24b['shift']());}catch(_0x1861b1){_0x4aa24b['push'](_0x4aa24b['shift']());}}}(a4_0x2746,0x23da8));import a4_0x53f3cc from'chalk';import a4_0x374f36 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(_0xbc142e){const _0x59d543=a4_0x17ca,_0x297701=[];if(_0xbc142e[_0x59d543(0x1b0)]!==undefined)_0x297701[_0x59d543(0x16d)](_0xbc142e[_0x59d543(0x1b0)]+_0x59d543(0x18e));if(_0xbc142e[_0x59d543(0x199)]!==undefined&&_0xbc142e['new']>0x0)_0x297701['push'](a4_0x53f3cc[_0x59d543(0x189)](_0xbc142e['new']+_0x59d543(0x1ac)));if(_0xbc142e[_0x59d543(0x204)]!==undefined&&_0xbc142e[_0x59d543(0x204)]>0x0)_0x297701[_0x59d543(0x16d)](a4_0x53f3cc[_0x59d543(0x189)](_0xbc142e['created']+_0x59d543(0x195)));if(_0xbc142e['updated']!==undefined&&_0xbc142e[_0x59d543(0x178)]>0x0)_0x297701['push'](a4_0x53f3cc[_0x59d543(0x1b7)](_0xbc142e[_0x59d543(0x178)]+_0x59d543(0x220)));if(_0xbc142e[_0x59d543(0x1e6)]!==undefined&&_0xbc142e[_0x59d543(0x1e6)]>0x0)_0x297701[_0x59d543(0x16d)](a4_0x53f3cc[_0x59d543(0x1ec)](_0xbc142e[_0x59d543(0x1e6)]+_0x59d543(0x176)));if(_0xbc142e[_0x59d543(0x1fc)]!==undefined&&_0xbc142e[_0x59d543(0x1fc)]>0x0)_0x297701['push'](a4_0x53f3cc[_0x59d543(0x187)](_0xbc142e[_0x59d543(0x1fc)]+'\x20errors'));return _0x297701['join'](',\x20');}function displayDiffs(_0x3cd27c,_0x36a229,_0xd192bc,_0x34a40c,_0x109ebd,_0x9f473c,_0x279b96){const _0x2e9282=a4_0x17ca;for(const _0xf8eb56 of _0x3cd27c){if(_0xf8eb56[_0x2e9282(0x1f4)]){const _0x3857d8=_0xf8eb56['agentName']||_0xf8eb56['name'];console[_0x2e9282(0x177)](_0x2e9282(0x1ba)+_0x3857d8+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console[_0x2e9282(0x177)](_0xf8eb56[_0x2e9282(0x1f4)]),console['log']('─'[_0x2e9282(0x1a7)](0x3c));}}for(const _0x1fbe4f of _0x36a229){_0x1fbe4f[_0x2e9282(0x1f4)]&&(console['log'](_0x2e9282(0x194)+_0x1fbe4f[_0x2e9282(0x1e7)]+'\x27:'),console[_0x2e9282(0x177)]('─'['repeat'](0x3c)),console[_0x2e9282(0x177)](_0x1fbe4f[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x435be5 of _0xd192bc){_0x435be5[_0x2e9282(0x1f4)]&&(console['log'](_0x2e9282(0x203)+_0x435be5['name']+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console['log'](_0x435be5[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x31afc9 of _0x34a40c){_0x31afc9[_0x2e9282(0x1f4)]&&(console[_0x2e9282(0x177)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x31afc9[_0x2e9282(0x1e7)]+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console['log'](_0x31afc9[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'['repeat'](0x3c)));}for(const _0x106a1a of _0x109ebd){_0x106a1a['diff']&&(console[_0x2e9282(0x177)](_0x2e9282(0x1a5)+_0x106a1a['name']+'\x27:'),console[_0x2e9282(0x177)]('─'['repeat'](0x3c)),console[_0x2e9282(0x177)](_0x106a1a[_0x2e9282(0x1f4)]),console['log']('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x2260f6 of _0x9f473c){_0x2260f6[_0x2e9282(0x1f4)]&&(console[_0x2e9282(0x177)](_0x2e9282(0x209)+_0x2260f6[_0x2e9282(0x1e7)]+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console[_0x2e9282(0x177)](_0x2260f6['diff']),console['log']('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x2c9c39 of _0x279b96){_0x2c9c39['diff']&&(console[_0x2e9282(0x177)](_0x2e9282(0x1c4)+_0x2c9c39[_0x2e9282(0x1e7)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x2e9282(0x177)](_0x2c9c39[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)));}}function a4_0x2746(){const _0x383b43=['agent:push','outputDir','Using\x20project\x20from\x20','\x20updated','message','push','INVALID_ARGUMENT','projectName','context','\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','agent','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Agent:\x20','dim','\x20unchanged','log','updated','experimentalKnowledgeBases','pushProject','cyan','\x22\x20to\x20a\x20different\x20profile','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','pullAgent','\x0aErrors\x20found:','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Dry\x20run\x20-\x20no\x20changes\x20made','\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','llm','Output\x20path:\x20','red','dirname','green','cwd-config','sourceProjectName','149943IQeuJh','yes','\x20total','53796NoeeAq','outputPath','counts','Output:\x20','Source:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20created','\x22:\x20','New\x20project\x20ID:\x20','\x0aPush\x20summary\x20for\x20\x27','new','Status:\x20','MISSING_ARGUMENT','join','\x20\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','\x0aPush\x20','Summary:','\x0aError:','\x20\x20Integrations:\x20','1531327IGNcAM','Analyzing\x20project\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','repeat','\x0aProject\x20pushed\x20with\x20errors','agentName','error','Pushing\x20agent\x20from\x20\x22','\x20new','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Integration\x20\x22','total','2160630TrbRbT','Project:\x20','\x0aChanges:','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','description','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','yellow','\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','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20--profile\x20','Errors:','\x20--name\x20','\x20\x20Knowledge\x20Bases:\x20','477nbNOyx','Would\x20push\x20agent:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parse','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','168UHSpAw','Chat:\x20','\x20|\x20','hasChanges','\x20resources?','agentId','12PPtQuW','experimentalArtifacts','1251800rbjcnM','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Pulling\x20agent\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','llmProject','output','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Source:\x20','agents','agent.yml','site','tdx.json','-\x20no\x20files\x20written','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20=\x20','\x0a✔\x20Pushed\x20','\x20\x20Prompts:\x20','utf-8','prompts','Using\x20local\x20project:\x20','unchanged','name','\x20changed','Pushing\x20to\x20project...','llm_project','\x22\x20to\x20new\x20project\x20\x22','gray','✔\x20Context\x20set:\x20','\x20files?','6yfQTTS','-\x20nothing\x20pushed','integrations','Cancelled','agent:pull','diff','knowledgeBases','found','newProjectId','\x20\x20Experimental\x20Artifact\x20\x22','10WeDwKA','\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','cloneProject','errors','source','isNew','Using\x20project:\x20','New\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','session','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','created','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','force','4074653XQxpAa','newProjectName','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x22...','cwd','8LCgIxZ','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20current\x20project:\x20','Would\x20clone:','No\x20tdx.json\x20found\x20in\x20','dryRun','\x0a✔\x20Pulled\x20','projectId','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Analyzing\x20changes\x20to\x20push...','execute','\x20\x20Experimental\x20Artifacts:\x20','reason','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','action','\x20resources\x20to\x20\x27','\x20\x20Agent\x20\x22'];a4_0x2746=function(){return _0x383b43;};return a4_0x2746();}export class AgentPullCommand extends BaseCommand{[a4_0x347051(0x1e7)]=a4_0x347051(0x1f3);[a4_0x347051(0x1b5)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x347051(0x216)](_0x3c8928){const _0x2bae98=a4_0x347051,{options:_0x5f0215,args:_0x37194e,tdx:_0x2b0c96}=_0x3c8928,_0x43ae0c=_0x37194e[0x0],_0x53685b=_0x37194e[0x1],_0x5158c3=_0x5f0215[_0x2bae98(0x1d3)],_0x2da4c9=_0x5f0215['dryRun'],_0x1a37b3=_0x5f0215[_0x2bae98(0x206)],_0x461123=_0x5f0215[_0x2bae98(0x18d)],_0x53cf2a=_0x5f0215['llmProject'],_0x4cfc15=_0x5f0215[_0x2bae98(0x172)];let _0x2c2e01;if(_0x43ae0c){const _0x5aa942=a4_0x374f36[_0x2bae98(0x19c)](_0x43ae0c,_0x2bae98(0x1db));if(existsSync(_0x5aa942))try{const _0x297be9=JSON['parse'](readFileSync(_0x5aa942,_0x2bae98(0x1e3)));_0x297be9['llm_project']&&(_0x2c2e01={'llm_project':_0x297be9[_0x2bae98(0x1ea)]});}catch{}}const _0x43a35d=findAgentConfigPath(process[_0x2bae98(0x20b)]());let _0x4e2fea;if(_0x43a35d)try{const _0x2906be=JSON[_0x2bae98(0x1c3)](readFileSync(_0x43a35d,_0x2bae98(0x1e3)));_0x2906be[_0x2bae98(0x1ea)]&&(_0x4e2fea={'llm_project':_0x2906be[_0x2bae98(0x1ea)]});}catch{}const _0x1bcaa1=resolveAgentPullArgs({'arg':_0x43ae0c,'agentNameArg':_0x53685b,'agentFlag':_0x4cfc15,'contextProject':_0x53cf2a,'argDirConfig':_0x2c2e01,'cwdConfigPath':_0x43a35d||undefined,'cwdConfig':_0x4e2fea}),{projectNameOrId:_0x252428,targetAgentName:_0x1afdfe,existingOutputDir:_0x1e0879,source:_0x4e50ee}=_0x1bcaa1;if(_0x4e50ee==='arg-dir')console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x175)](_0x2bae98(0x21f)+a4_0x374f36['join'](_0x43ae0c,_0x2bae98(0x1db))+':\x20'+_0x252428));else{if(_0x4e50ee===_0x2bae98(0x18a))console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x175)](_0x2bae98(0x1ff)+_0x252428));else _0x4e50ee==='context'&&console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x175)]('Using\x20project\x20from\x20context:\x20'+_0x252428));}if(!_0x252428)return _0x4cfc15?(console['log'](a4_0x53f3cc['yellow'](_0x2bae98(0x181))),console[_0x2bae98(0x177)](_0x2bae98(0x182)),console[_0x2bae98(0x177)](_0x2bae98(0x1cf))):(console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x1b7)](_0x2bae98(0x205))),console[_0x2bae98(0x177)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x2bae98(0x177)](_0x2bae98(0x184)),console[_0x2bae98(0x177)](_0x2bae98(0x1b8)),console[_0x2bae98(0x177)](_0x2bae98(0x1fa)),console['log'](_0x2bae98(0x171))),0x1;if(_0x1afdfe){const {data:_0xf2e226}=await withSpinner(_0x2bae98(0x1d0)+_0x1afdfe+'\x22\x20from\x20project\x20\x22'+_0x252428+_0x2bae98(0x20a),()=>_0x2b0c96[_0x2bae98(0x185)][_0x2bae98(0x17e)](_0x252428,_0x1afdfe,_0x5158c3,{'dryRun':_0x2da4c9,'force':_0x1a37b3}));if(_0x2da4c9)return console['log'](a4_0x53f3cc['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0xf2e226[_0x2bae98(0x1a9)]),console['log'](_0x2bae98(0x186)+_0xf2e226['outputPath']),_0xf2e226[_0x2bae98(0x1f4)]&&(console['log'](_0x2bae98(0x1b3)),console[_0x2bae98(0x177)]('─'[_0x2bae98(0x1a7)](0x3c)),console[_0x2bae98(0x177)](_0xf2e226[_0x2bae98(0x1f4)]),console[_0x2bae98(0x177)]('─'['repeat'](0x3c))),0x0;return console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x189)]('Agent\x20pulled\x20successfully')),console[_0x2bae98(0x177)]('Agent:\x20'+_0xf2e226['agentName']),console[_0x2bae98(0x177)](_0x2bae98(0x192)+_0xf2e226[_0x2bae98(0x190)]),console[_0x2bae98(0x177)](_0x2bae98(0x19a)+(_0xf2e226[_0x2bae98(0x1fe)]?a4_0x53f3cc[_0x2bae98(0x189)](_0x2bae98(0x199)):_0xf2e226[_0x2bae98(0x1c9)]?a4_0x53f3cc[_0x2bae98(0x1b7)](_0x2bae98(0x178)):a4_0x53f3cc['gray'](_0x2bae98(0x1e6)))),0x0;}const _0x1b0e48=_0x1e0879||_0x5158c3,{data:_0x469ab2}=await withSpinner(_0x2bae98(0x1a4)+_0x252428+'\x22...',()=>_0x2b0c96[_0x2bae98(0x185)]['pullProject'](_0x252428,_0x1b0e48,{'dryRun':!![]})),_0x32bab9=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)]['knowledgeBases']['new']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x19e)][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)]['prompts'][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1f1)][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)]['experimentalKnowledgeBases'][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)][_0x2bae98(0x199)],_0x3b6ef6=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)][_0x2bae98(0x178)]+_0x469ab2['counts'][_0x2bae98(0x1f5)][_0x2bae98(0x178)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x19e)]['updated']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1e4)][_0x2bae98(0x178)]+_0x469ab2[_0x2bae98(0x191)]['integrations'][_0x2bae98(0x178)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x179)]['updated']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)]['updated'],_0x57fc26=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)]['unchanged']+_0x469ab2[_0x2bae98(0x191)]['knowledgeBases'][_0x2bae98(0x1e6)]+_0x469ab2[_0x2bae98(0x191)]['textKnowledgeBases']['unchanged']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1e4)][_0x2bae98(0x1e6)]+_0x469ab2['counts'][_0x2bae98(0x1f1)]['unchanged']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x179)][_0x2bae98(0x1e6)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)]['unchanged'];console[_0x2bae98(0x177)]('\x0aPull\x20summary\x20for\x20\x27'+_0x469ab2[_0x2bae98(0x16f)]+'\x27:'),console['log']('\x20\x20'+a4_0x53f3cc[_0x2bae98(0x189)]('+\x20'+_0x32bab9+_0x2bae98(0x1ac))+'\x20|\x20'+a4_0x53f3cc[_0x2bae98(0x1b7)]('~\x20'+_0x3b6ef6+_0x2bae98(0x1e8))+_0x2bae98(0x1c8)+a4_0x53f3cc[_0x2bae98(0x175)]('=\x20'+_0x57fc26+_0x2bae98(0x176))),console[_0x2bae98(0x177)]('\x20\x20Agents:\x20'+formatCountSummary(_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)])),console[_0x2bae98(0x177)](_0x2bae98(0x1bf)+formatCountSummary(_0x469ab2['counts'][_0x2bae98(0x1f5)])),console[_0x2bae98(0x177)](_0x2bae98(0x1dd)+formatCountSummary(_0x469ab2['counts'][_0x2bae98(0x19e)])),console[_0x2bae98(0x177)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1e4)])),console[_0x2bae98(0x177)](_0x2bae98(0x1a2)+formatCountSummary(_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1f1)]));const _0x4371c1=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x179)]['total']>0x0||_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)]['total']>0x0;_0x4371c1&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x469ab2[_0x2bae98(0x191)]['experimentalKnowledgeBases'])),console[_0x2bae98(0x177)](_0x2bae98(0x217)+formatCountSummary(_0x469ab2['counts'][_0x2bae98(0x1cd)])));console[_0x2bae98(0x177)]('\x20\x20Target:\x20'+a4_0x53f3cc[_0x2bae98(0x17b)](_0x469ab2['outputDir'])),displayDiffs(_0x469ab2[_0x2bae98(0x1d8)],_0x469ab2[_0x2bae98(0x1f5)],_0x469ab2['textKnowledgeBases'],_0x469ab2[_0x2bae98(0x1e4)],_0x469ab2[_0x2bae98(0x1f1)],_0x469ab2[_0x2bae98(0x179)],_0x469ab2[_0x2bae98(0x1cd)]);if(_0x2da4c9)return console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x1b7)](_0x2bae98(0x1d4))),0x0;if(_0x32bab9===0x0&&_0x3b6ef6===0x0)return console[_0x2bae98(0x177)](a4_0x53f3cc['green'](_0x2bae98(0x1b6))),saveSessionContext({'llm_project':_0x469ab2[_0x2bae98(0x16f)]},_0x5f0215[_0x2bae98(0x202)]),console['log'](a4_0x53f3cc[_0x2bae98(0x189)]('✔\x20Context\x20set:\x20'+a4_0x53f3cc['dim'](_0x2bae98(0x1ea))+_0x2bae98(0x1e0)+a4_0x53f3cc[_0x2bae98(0x17b)](_0x469ab2[_0x2bae98(0x16f)]))),0x0;if(!_0x461123&&!_0x1a37b3){if(!isInteractive())return console[_0x2bae98(0x1aa)](a4_0x53f3cc[_0x2bae98(0x187)]('\x0aError:'),_0x2bae98(0x1d6)),console[_0x2bae98(0x1aa)](a4_0x53f3cc[_0x2bae98(0x175)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4e8b47=await confirmKey('\x0aWrite\x20'+(_0x32bab9+_0x3b6ef6)+_0x2bae98(0x1ee));if(!_0x4e8b47)return console[_0x2bae98(0x177)](a4_0x53f3cc['yellow'](_0x2bae98(0x1f2)),_0x2bae98(0x1dc)),0x1;}const {data:_0x97b896}=await withSpinner('Writing\x20files...',()=>_0x2b0c96[_0x2bae98(0x185)]['pullProject'](_0x252428,_0x1b0e48,{'force':_0x1a37b3}));return console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x189)](_0x2bae98(0x212)+(_0x32bab9+_0x3b6ef6)+'\x20files\x20to\x20'+_0x97b896[_0x2bae98(0x21e)])),saveSessionContext({'llm_project':_0x97b896[_0x2bae98(0x16f)]},_0x5f0215[_0x2bae98(0x202)]),console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x189)](_0x2bae98(0x1ed)+a4_0x53f3cc['dim']('llm_project')+_0x2bae98(0x1e0)+a4_0x53f3cc[_0x2bae98(0x17b)](_0x97b896[_0x2bae98(0x16f)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x347051(0x1b5)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x347051(0x216)](_0x342f81){const _0x4c9986=a4_0x347051,{options:_0x1d331c,args:_0x9b70c7,tdx:_0x38e009}=_0x342f81,_0x4b5f21=_0x9b70c7[0x0],_0x148505=_0x1d331c[_0x4c9986(0x1e7)],_0x2390be=_0x1d331c[_0x4c9986(0x211)],_0x538c90=_0x1d331c[_0x4c9986(0x18d)],_0x138468=_0x1d331c['site'],_0x50dd54=_0x1d331c['llmProject'];let _0x5aa164;const _0x3cdc67=findAgentConfigPath(process[_0x4c9986(0x20b)]());if(_0x4b5f21){const _0x4d9622=a4_0x374f36['join'](_0x4b5f21,_0x4c9986(0x1db));existsSync(_0x4d9622)?(_0x5aa164=_0x4b5f21,console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x175)](_0x4c9986(0x1e5)+_0x4b5f21))):_0x5aa164=_0x4b5f21;}else{if(_0x3cdc67)_0x5aa164=a4_0x374f36[_0x4c9986(0x188)](_0x3cdc67),console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x175)](_0x4c9986(0x20e)+_0x5aa164));else{if(_0x50dd54){const _0x163c36=sanitizeForFilesystem(_0x50dd54);let _0x29b959=_0x163c36,_0x441fb0=a4_0x374f36[_0x4c9986(0x19c)](process[_0x4c9986(0x20b)](),_0x4c9986(0x1d8),_0x163c36,_0x4c9986(0x1db));if(!existsSync(_0x441fb0)){const _0x44d5f3=normalizeName(_0x50dd54),_0x15e358=a4_0x374f36[_0x4c9986(0x19c)](process[_0x4c9986(0x20b)](),_0x4c9986(0x1d8),_0x44d5f3,_0x4c9986(0x1db));existsSync(_0x15e358)&&(_0x29b959=_0x44d5f3,_0x441fb0=_0x15e358);}if(existsSync(_0x441fb0))_0x5aa164=a4_0x374f36[_0x4c9986(0x188)](_0x441fb0),console['log'](a4_0x53f3cc[_0x4c9986(0x175)]('Using\x20local\x20project:\x20'+_0x5aa164));else{const _0x3483a9=_0x1d331c['profile'];if(_0x3483a9)throw new SDKError(ErrorCode[_0x4c9986(0x16e)],_0x4c9986(0x173)+_0x50dd54+_0x4c9986(0x17c),undefined,{'helpText':_0x4c9986(0x214)+_0x4c9986(0x20d)+(_0x4c9986(0x1ae)+_0x50dd54+'\x0a')+(_0x4c9986(0x1d1)+_0x29b959+_0x4c9986(0x1be)+(_0x148505||'<new-name>')+_0x4c9986(0x1bc)+_0x3483a9)});_0x5aa164=_0x50dd54,console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x175)]('Using\x20context\x20project:\x20'+_0x50dd54));}}}}if(!_0x5aa164)return console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x4c9986(0x177)](_0x4c9986(0x180)),console[_0x4c9986(0x177)](_0x4c9986(0x17d)),console['log'](_0x4c9986(0x1de)),console[_0x4c9986(0x177)](_0x4c9986(0x1b4)),0x1;if(!_0x148505)throw new SDKError(ErrorCode[_0x4c9986(0x19b)],_0x4c9986(0x1b9),undefined,{'helpText':_0x4c9986(0x219)});if(!_0x538c90&&!_0x2390be){if(!isInteractive())return console['error'](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1a1)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4c9986(0x1aa)](a4_0x53f3cc['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x404c80=await confirmKey('Clone\x20\x22'+_0x5aa164+_0x4c9986(0x1eb)+_0x148505+'\x22?');if(!_0x404c80)return console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)](_0x4c9986(0x1f2))),0x1;}const {data:_0x30ac16}=await withSpinner('Cloning\x20\x22'+_0x5aa164+'\x22\x20to\x20\x22'+_0x148505+_0x4c9986(0x20a),()=>_0x38e009[_0x4c9986(0x185)][_0x4c9986(0x1fb)](_0x5aa164,_0x148505,{'dryRun':_0x2390be}));if(_0x2390be){console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)](_0x4c9986(0x183))),console['log'](_0x4c9986(0x193)+_0x30ac16[_0x4c9986(0x18b)]),console[_0x4c9986(0x177)](_0x4c9986(0x200)+_0x148505),console[_0x4c9986(0x177)](_0x4c9986(0x20f)),console[_0x4c9986(0x177)](_0x4c9986(0x1ad)+_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1d8)]['created']),console[_0x4c9986(0x177)](_0x4c9986(0x1bf)+_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f5)][_0x4c9986(0x204)]),console[_0x4c9986(0x177)]('\x20\x20Prompts:\x20'+_0x30ac16['counts'][_0x4c9986(0x1e4)][_0x4c9986(0x204)]);const _0x4822fb=_0x30ac16['counts'][_0x4c9986(0x179)][_0x4c9986(0x204)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1cd)][_0x4c9986(0x204)]>0x0;return _0x4822fb&&(console[_0x4c9986(0x177)](_0x4c9986(0x1c5)+_0x30ac16['counts'][_0x4c9986(0x179)][_0x4c9986(0x204)]),console[_0x4c9986(0x177)](_0x4c9986(0x217)+_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts'][_0x4c9986(0x204)])),0x0;}const _0x5554af=_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1d8)][_0x4c9986(0x1fc)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f5)][_0x4c9986(0x1fc)]>0x0||_0x30ac16[_0x4c9986(0x191)]['prompts'][_0x4c9986(0x1fc)]>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalKnowledgeBases']['errors']>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts'][_0x4c9986(0x1fc)]>0x0;_0x5554af?console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)]('Project\x20cloned\x20with\x20errors')):console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x189)]('Project\x20cloned\x20successfully'));console[_0x4c9986(0x177)](_0x4c9986(0x193)+_0x30ac16[_0x4c9986(0x18b)]),console[_0x4c9986(0x177)](_0x4c9986(0x200)+_0x30ac16[_0x4c9986(0x208)]),console[_0x4c9986(0x177)](_0x4c9986(0x197)+_0x30ac16[_0x4c9986(0x1f7)]),console['log'](),console['log'](_0x4c9986(0x1a0)),console[_0x4c9986(0x177)](_0x4c9986(0x1ad)+formatCountSummary(_0x30ac16[_0x4c9986(0x191)]['agents'])),console[_0x4c9986(0x177)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f5)])),console[_0x4c9986(0x177)](_0x4c9986(0x1e2)+formatCountSummary(_0x30ac16[_0x4c9986(0x191)]['prompts'])),console[_0x4c9986(0x177)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f1)]));const _0x103b59=_0x30ac16[_0x4c9986(0x191)]['experimentalKnowledgeBases'][_0x4c9986(0x204)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x179)][_0x4c9986(0x178)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x179)]['unchanged']>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts'][_0x4c9986(0x204)]>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts']['updated']>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1cd)][_0x4c9986(0x1e6)]>0x0;_0x103b59&&(console[_0x4c9986(0x177)](_0x4c9986(0x1c5)+formatCountSummary(_0x30ac16['counts'][_0x4c9986(0x179)])),console[_0x4c9986(0x177)](_0x4c9986(0x217)+formatCountSummary(_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1cd)])));if(_0x5554af){console[_0x4c9986(0x177)](),console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1bd)));for(const _0x354803 of _0x30ac16[_0x4c9986(0x1d8)]){_0x354803['action']===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x21c)+_0x354803[_0x4c9986(0x1a9)]+_0x4c9986(0x196)+_0x354803[_0x4c9986(0x1aa)]));}for(const _0x3bc835 of _0x30ac16[_0x4c9986(0x1f5)]){_0x3bc835[_0x4c9986(0x21a)]===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x19d)+_0x3bc835[_0x4c9986(0x1e7)]+'\x22:\x20'+_0x3bc835[_0x4c9986(0x1aa)]));}for(const _0x2f5ef2 of _0x30ac16[_0x4c9986(0x1e4)]){_0x2f5ef2[_0x4c9986(0x21a)]==='error'&&console['log'](a4_0x53f3cc['red']('\x20\x20Prompt\x20\x22'+_0x2f5ef2[_0x4c9986(0x1e7)]+_0x4c9986(0x196)+_0x2f5ef2[_0x4c9986(0x1aa)]));}for(const _0x56d81c of _0x30ac16[_0x4c9986(0x1f1)]){_0x56d81c[_0x4c9986(0x21a)]===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1af)+_0x56d81c[_0x4c9986(0x1e7)]+'\x22:\x20'+_0x56d81c[_0x4c9986(0x1aa)]));}for(const _0x28182c of _0x30ac16[_0x4c9986(0x179)]){_0x28182c['action']===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1bb)+_0x28182c['name']+_0x4c9986(0x196)+_0x28182c[_0x4c9986(0x1aa)]));}for(const _0x44ab72 of _0x30ac16[_0x4c9986(0x1cd)]){_0x44ab72[_0x4c9986(0x21a)]==='error'&&console['log'](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1f8)+_0x44ab72['name']+_0x4c9986(0x196)+_0x44ab72[_0x4c9986(0x1aa)]));}return 0x1;}console[_0x4c9986(0x177)]();const _0xd31b21=getLLMProjectUrl(_0x138468,_0x30ac16[_0x4c9986(0x1f7)]);return console[_0x4c9986(0x177)](_0x4c9986(0x1b2)+a4_0x53f3cc[_0x4c9986(0x17b)](_0xd31b21)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x347051(0x1e7)]=a4_0x347051(0x21d);[a4_0x347051(0x1b5)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x347051(0x216)](_0x116c00){const _0x2918ee=a4_0x347051,{options:_0x4a962d,args:_0x1f2efe,tdx:_0x2c3867}=_0x116c00;let _0x4cd716=_0x1f2efe[0x0]||process['cwd']();const _0x20c188=_0x4a962d[_0x2918ee(0x211)],_0x21186e=_0x4a962d[_0x2918ee(0x206)],_0x21480f=_0x4a962d['yes'],_0x4b4350=_0x4a962d[_0x2918ee(0x1da)],_0x533ea6=a4_0x374f36[_0x2918ee(0x19c)](_0x4cd716,_0x2918ee(0x1d9)),_0x40733f=existsSync(_0x533ea6);if(_0x40733f){const {data:_0x212600}=await withSpinner(_0x2918ee(0x1ab)+_0x4cd716+'\x22...',()=>_0x2c3867['llm']['pushAgent'](_0x4cd716,{'dryRun':_0x20c188,'force':_0x21186e}));if(_0x20c188)return console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x1b7)](_0x2918ee(0x183))),console['log'](_0x2918ee(0x1c1)+_0x212600[_0x2918ee(0x1a9)]),0x0;if(_0x212600[_0x2918ee(0x21a)]===_0x2918ee(0x1aa))return console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)]('Failed\x20to\x20push\x20agent:\x20'+_0x212600[_0x2918ee(0x1aa)])),0x1;console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x189)]('Agent\x20'+_0x212600[_0x2918ee(0x21a)]+'\x20successfully')),console[_0x2918ee(0x177)](_0x2918ee(0x174)+_0x212600['agentName']);if(_0x212600[_0x2918ee(0x1cb)]&&_0x212600['projectId']){const _0x5a7322=getLLMAgentChatUrl(_0x4b4350,_0x212600[_0x2918ee(0x213)],_0x212600[_0x2918ee(0x1cb)]);console[_0x2918ee(0x177)](_0x2918ee(0x1c7)+a4_0x53f3cc[_0x2918ee(0x17b)](_0x5a7322));}return 0x0;}const _0x33088f=_0x4a962d['llmProject'],_0x247497=resolveProjectFromContext(_0x4cd716,_0x33088f);if(_0x247497[_0x2918ee(0x1f6)])_0x4cd716=_0x247497['projectDir'],_0x247497[_0x2918ee(0x1fd)]===_0x2918ee(0x170)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x175)](_0x2918ee(0x1ff)+_0x4cd716));else{let _0xb7cbe1=_0x2918ee(0x201);_0x247497[_0x2918ee(0x218)]==='no_local_folder'&&(_0xb7cbe1=_0x247497[_0x2918ee(0x16c)]+_0x2918ee(0x1a6)+_0x247497[_0x2918ee(0x1d2)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x2918ee(0x16e)],_0x247497[_0x2918ee(0x218)]==='no_context'?_0x247497['message']:_0x2918ee(0x210)+_0x4cd716,undefined,{'helpText':_0xb7cbe1});}const {data:_0x5e0f96}=await withSpinner(_0x2918ee(0x215),()=>_0x2c3867[_0x2918ee(0x185)][_0x2918ee(0x17a)](_0x4cd716,{'dryRun':!![]})),_0x464252=_0x5e0f96['counts'][_0x2918ee(0x1d8)]['errors']>0x0;if(_0x464252){console['log'](a4_0x53f3cc['red'](_0x2918ee(0x17f)));for(const _0x24a8ac of _0x5e0f96[_0x2918ee(0x1d8)]){_0x24a8ac[_0x2918ee(0x21a)]===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc['red'](_0x2918ee(0x21c)+_0x24a8ac[_0x2918ee(0x1a9)]+_0x2918ee(0x196)+_0x24a8ac[_0x2918ee(0x1aa)]));}return 0x1;}const _0x13c4ed=_0x5e0f96['counts'][_0x2918ee(0x1d8)][_0x2918ee(0x204)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f5)]['created']+_0x5e0f96['counts'][_0x2918ee(0x19e)][_0x2918ee(0x204)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1e4)]['created']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f1)][_0x2918ee(0x204)]+_0x5e0f96['counts'][_0x2918ee(0x179)][_0x2918ee(0x204)]+_0x5e0f96[_0x2918ee(0x191)]['experimentalArtifacts'][_0x2918ee(0x204)],_0x27ee41=_0x5e0f96['counts'][_0x2918ee(0x1d8)][_0x2918ee(0x178)]+_0x5e0f96[_0x2918ee(0x191)]['knowledgeBases']['updated']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x19e)][_0x2918ee(0x178)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1e4)]['updated']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f1)][_0x2918ee(0x178)]+_0x5e0f96[_0x2918ee(0x191)]['experimentalKnowledgeBases']['updated']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1cd)][_0x2918ee(0x178)],_0x2e838f=_0x5e0f96['counts'][_0x2918ee(0x1d8)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f5)][_0x2918ee(0x1e6)]+_0x5e0f96['counts'][_0x2918ee(0x19e)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)]['prompts'][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f1)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)]['experimentalArtifacts'][_0x2918ee(0x1e6)];console[_0x2918ee(0x177)](_0x2918ee(0x198)+_0x5e0f96[_0x2918ee(0x16f)]+'\x27:'),console[_0x2918ee(0x177)]('\x20\x20'+a4_0x53f3cc[_0x2918ee(0x189)]('+\x20'+_0x13c4ed+_0x2918ee(0x1ac))+'\x20|\x20'+a4_0x53f3cc[_0x2918ee(0x1b7)]('~\x20'+_0x27ee41+_0x2918ee(0x1e8))+_0x2918ee(0x1c8)+a4_0x53f3cc['dim']('=\x20'+_0x2e838f+_0x2918ee(0x176))),console[_0x2918ee(0x177)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1d8)])),console[_0x2918ee(0x177)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)]['knowledgeBases'])),console[_0x2918ee(0x177)](_0x2918ee(0x1dd)+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x19e)])),console[_0x2918ee(0x177)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1e4)])),console[_0x2918ee(0x177)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5e0f96['counts'][_0x2918ee(0x1f1)]));const _0x21d0b7=_0x5e0f96['counts'][_0x2918ee(0x179)]['created']>0x0||_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)][_0x2918ee(0x178)]>0x0||_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)]['unchanged']>0x0||_0x5e0f96['counts'][_0x2918ee(0x1cd)]['created']>0x0||_0x5e0f96['counts']['experimentalArtifacts']['updated']>0x0||_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1cd)][_0x2918ee(0x1e6)]>0x0;_0x21d0b7&&(console['log'](_0x2918ee(0x1c5)+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)])),console[_0x2918ee(0x177)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5e0f96['counts']['experimentalArtifacts'])));console['log'](_0x2918ee(0x1d7)+a4_0x53f3cc[_0x2918ee(0x17b)](_0x4cd716)),displayDiffs(_0x5e0f96[_0x2918ee(0x1d8)],_0x5e0f96['knowledgeBases'],_0x5e0f96[_0x2918ee(0x19e)],_0x5e0f96[_0x2918ee(0x1e4)],_0x5e0f96[_0x2918ee(0x1f1)],_0x5e0f96['experimentalKnowledgeBases'],_0x5e0f96['experimentalArtifacts']);if(_0x20c188)return console['log'](a4_0x53f3cc[_0x2918ee(0x1b7)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x13c4ed===0x0&&_0x27ee41===0x0){console['log'](a4_0x53f3cc['green'](_0x2918ee(0x1df)));const _0x4454d5=getLLMProjectUrl(_0x4b4350,_0x5e0f96[_0x2918ee(0x213)]);return console[_0x2918ee(0x177)](_0x2918ee(0x1b2)+a4_0x53f3cc[_0x2918ee(0x17b)](_0x4454d5)),0x0;}if(!_0x21480f&&!_0x21186e){if(!isInteractive())return console[_0x2918ee(0x1aa)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1a1)),_0x2918ee(0x1d6)),console[_0x2918ee(0x1aa)](a4_0x53f3cc[_0x2918ee(0x175)](_0x2918ee(0x1c2))),0x1;const _0x1a72de=await confirmKey(_0x2918ee(0x19f)+(_0x13c4ed+_0x27ee41)+_0x2918ee(0x1ca));if(!_0x1a72de)return console['log'](a4_0x53f3cc[_0x2918ee(0x1b7)](_0x2918ee(0x1f2)),_0x2918ee(0x1f0)),0x1;}const {data:_0x4f9ec5}=await withSpinner(_0x2918ee(0x1e9),()=>_0x2c3867[_0x2918ee(0x185)]['pushProject'](_0x4cd716,{'force':_0x21186e})),_0x21917a=_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x1d8)]['errors']>0x0||_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x1f5)][_0x2918ee(0x1fc)]>0x0||_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x19e)]['errors']>0x0||_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x1e4)][_0x2918ee(0x1fc)]>0x0;if(_0x21917a){console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x1b7)](_0x2918ee(0x1a8))),console[_0x2918ee(0x177)](),console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1bd)));for(const _0x646ce2 of _0x4f9ec5['agents']){_0x646ce2['action']===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x21c)+_0x646ce2[_0x2918ee(0x1a9)]+_0x2918ee(0x196)+_0x646ce2['error']));}for(const _0x5e61ae of _0x4f9ec5[_0x2918ee(0x1f5)]){_0x5e61ae[_0x2918ee(0x21a)]===_0x2918ee(0x1aa)&&console['log'](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x19d)+_0x5e61ae['name']+_0x2918ee(0x196)+_0x5e61ae[_0x2918ee(0x1aa)]));}for(const _0x42204c of _0x4f9ec5[_0x2918ee(0x19e)]){_0x42204c['action']===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1d5)+_0x42204c[_0x2918ee(0x1e7)]+_0x2918ee(0x196)+_0x42204c[_0x2918ee(0x1aa)]));}for(const _0x1ead43 of _0x4f9ec5[_0x2918ee(0x1e4)]){_0x1ead43[_0x2918ee(0x21a)]==='error'&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)]('\x20\x20Prompt\x20\x22'+_0x1ead43[_0x2918ee(0x1e7)]+_0x2918ee(0x196)+_0x1ead43[_0x2918ee(0x1aa)]));}for(const _0x12dc66 of _0x4f9ec5[_0x2918ee(0x1f1)]){_0x12dc66[_0x2918ee(0x21a)]===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1af)+_0x12dc66[_0x2918ee(0x1e7)]+_0x2918ee(0x196)+_0x12dc66['error']));}return 0x1;}console[_0x2918ee(0x177)](a4_0x53f3cc['green'](_0x2918ee(0x1e1)+(_0x13c4ed+_0x27ee41)+_0x2918ee(0x21b)+_0x4f9ec5['projectName']+'\x27'));const _0x2c9255=getLLMProjectUrl(_0x4b4350,_0x4f9ec5[_0x2918ee(0x213)]);return console[_0x2918ee(0x177)](_0x2918ee(0x1b2)+a4_0x53f3cc['cyan'](_0x2c9255)),0x0;}}
|
|
1
|
+
const a4_0x150f60=a4_0x2e06;(function(_0x3a1149,_0x15485e){const _0xd8c864=a4_0x2e06,_0x19ba71=_0x3a1149();while(!![]){try{const _0x9df016=parseInt(_0xd8c864(0x18b))/0x1*(-parseInt(_0xd8c864(0x16f))/0x2)+parseInt(_0xd8c864(0x159))/0x3+-parseInt(_0xd8c864(0x128))/0x4+parseInt(_0xd8c864(0x151))/0x5*(-parseInt(_0xd8c864(0x190))/0x6)+parseInt(_0xd8c864(0x1ce))/0x7+parseInt(_0xd8c864(0x1d5))/0x8+parseInt(_0xd8c864(0x15d))/0x9*(-parseInt(_0xd8c864(0x1dc))/0xa);if(_0x9df016===_0x15485e)break;else _0x19ba71['push'](_0x19ba71['shift']());}catch(_0x3bbb29){_0x19ba71['push'](_0x19ba71['shift']());}}}(a4_0xef3b,0x2c83c));import a4_0x5c10dc from'chalk';import a4_0x1df191 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0xef3b(){const _0x5800bc=['\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Agent\x20','yellow','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','push','\x0a✔\x20Pulled\x20','textKnowledgeBases','error','\x20\x20Integrations:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','No\x20tdx.json\x20found\x20in\x20','Using\x20context\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Target:\x20','updated','hasChanges','log','llmProject','-\x20no\x20files\x20written','Agent:\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','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20created','green','diff','Output\x20path:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','yes','MISSING_ARGUMENT','name','counts','Summary:','119980MrSfAG','\x22...','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','INVALID_ARGUMENT','\x20\x20Prompts:\x20','agent:clone','projectDir','582270EhdkOa','pushProject','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Source:\x20','737883sKyFRl','\x22\x20to\x20\x22','Using\x20local\x20project:\x20','outputPath','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agent.yml','projectName','\x20\x20Integration\x20\x22','utf-8','Pushing\x20agent\x20from\x20\x22','Using\x20current\x20project:\x20','agents','execute','\x20successfully','cyan','\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','created','<new-name>','599802fWjwuK','\x20updated','Pushing\x20to\x20project...','cwd','Would\x20pull\x20agent:\x20','Using\x20project:\x20','dim','knowledgeBases','parse','errors','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Dry\x20run\x20-\x20no\x20changes\x20made','Clone\x20\x22','\x20|\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','outputDir','agent:pull','session','pushAgent','experimentalArtifacts','\x20\x20tdx\x20agent\x20clone\x20agents/','Using\x20project\x20from\x20','\x20unchanged','Errors:','agentId','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','new','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','1jJRdDH','\x0aPush\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','60jWORdp','\x20\x20Agents:\x20','Project:\x20','arg-dir','\x20files\x20to\x20','dirname','\x20files?','\x20new','Project\x20cloned\x20with\x20errors','\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','sourceProjectName','newProjectId','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','force','action','Agent\x20pulled\x20successfully','dryRun','\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','\x20resources?','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','prompts','unchanged','join','\x0a✔\x20Pushed\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','✔\x20Context\x20set:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Cannot\x20clone\x20from\x20context\x20project\x20\x22','New\x20project:\x20','source','Cancelled','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)','experimentalKnowledgeBases','pullProject','\x20changed','message','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','integrations','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Agent\x20\x22','New\x20project\x20name\x20is\x20required','pullAgent','tdx.json','Analyzing\x20changes\x20to\x20push...','\x0aWrite\x20','output','\x20errors','cloneProject','\x0aChanges:','agent','\x0aChanges\x20to\x20prompt\x20\x27','repeat','red','newProjectName','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Experimental\x20Artifacts:\x20','llm_project','reason','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1778672XdWYnf','total','Status:\x20','context','New\x20project\x20ID:\x20','gray','llm','2872984PmjZRo','Would\x20push\x20agent:\x20','no_local_folder','description','Source:\x20','Output:\x20','\x20=\x20','10BfLeVF','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x22:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20--name\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Writing\x20files...','12516KPhvtx','\x22\x20to\x20a\x20different\x20profile','agentName','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','projectId','\x0aProject\x20pushed\x20with\x20errors','\x20total','site','\x0aError:'];a4_0xef3b=function(){return _0x5800bc;};return a4_0xef3b();}function a4_0x2e06(_0x5927d5,_0x8f2648){_0x5927d5=_0x5927d5-0x123;const _0xef3bcb=a4_0xef3b();let _0x2e063f=_0xef3bcb[_0x5927d5];return _0x2e063f;}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(_0x673161){const _0x20723d=a4_0x2e06,_0x4616c8=[];if(_0x673161[_0x20723d(0x1cf)]!==undefined)_0x4616c8[_0x20723d(0x135)](_0x673161[_0x20723d(0x1cf)]+_0x20723d(0x12e));if(_0x673161[_0x20723d(0x189)]!==undefined&&_0x673161[_0x20723d(0x189)]>0x0)_0x4616c8['push'](a4_0x5c10dc['green'](_0x673161[_0x20723d(0x189)]+_0x20723d(0x197)));if(_0x673161['created']!==undefined&&_0x673161[_0x20723d(0x16d)]>0x0)_0x4616c8['push'](a4_0x5c10dc[_0x20723d(0x148)](_0x673161['created']+_0x20723d(0x147)));if(_0x673161['updated']!==undefined&&_0x673161[_0x20723d(0x13f)]>0x0)_0x4616c8[_0x20723d(0x135)](a4_0x5c10dc['yellow'](_0x673161[_0x20723d(0x13f)]+_0x20723d(0x170)));if(_0x673161[_0x20723d(0x1a5)]!==undefined&&_0x673161[_0x20723d(0x1a5)]>0x0)_0x4616c8['push'](a4_0x5c10dc['gray'](_0x673161[_0x20723d(0x1a5)]+_0x20723d(0x185)));if(_0x673161['errors']!==undefined&&_0x673161[_0x20723d(0x178)]>0x0)_0x4616c8['push'](a4_0x5c10dc[_0x20723d(0x1c7)](_0x673161['errors']+_0x20723d(0x1c1)));return _0x4616c8[_0x20723d(0x1a6)](',\x20');}function displayDiffs(_0x523e50,_0x2e15a2,_0x1591d8,_0xb96966,_0x30f46b,_0x3a3875,_0x5cf586){const _0x3278f3=a4_0x2e06;for(const _0x26a70b of _0x523e50){if(_0x26a70b[_0x3278f3(0x149)]){const _0x22b8ac=_0x26a70b[_0x3278f3(0x12a)]||_0x26a70b[_0x3278f3(0x14e)];console[_0x3278f3(0x141)](_0x3278f3(0x154)+_0x22b8ac+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x26a70b[_0x3278f3(0x149)]),console['log']('─'[_0x3278f3(0x1c6)](0x3c));}}for(const _0x1dc7ba of _0x2e15a2){_0x1dc7ba['diff']&&(console[_0x3278f3(0x141)](_0x3278f3(0x134)+_0x1dc7ba[_0x3278f3(0x14e)]+'\x27:'),console['log']('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x1dc7ba[_0x3278f3(0x149)]),console['log']('─'[_0x3278f3(0x1c6)](0x3c)));}for(const _0x653b8b of _0x1591d8){_0x653b8b[_0x3278f3(0x149)]&&(console[_0x3278f3(0x141)](_0x3278f3(0x1a3)+_0x653b8b[_0x3278f3(0x14e)]+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x653b8b[_0x3278f3(0x149)]),console[_0x3278f3(0x141)]('─'['repeat'](0x3c)));}for(const _0x5f23a1 of _0xb96966){_0x5f23a1[_0x3278f3(0x149)]&&(console['log'](_0x3278f3(0x1c5)+_0x5f23a1[_0x3278f3(0x14e)]+'\x27:'),console['log']('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x5f23a1['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x2b5ea5 of _0x30f46b){_0x2b5ea5[_0x3278f3(0x149)]&&(console['log'](_0x3278f3(0x13d)+_0x2b5ea5[_0x3278f3(0x14e)]+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x2b5ea5[_0x3278f3(0x149)]),console[_0x3278f3(0x141)]('─'['repeat'](0x3c)));}for(const _0x4b57b0 of _0x3a3875){_0x4b57b0[_0x3278f3(0x149)]&&(console[_0x3278f3(0x141)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4b57b0[_0x3278f3(0x14e)]+'\x27:'),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)),console['log'](_0x4b57b0[_0x3278f3(0x149)]),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)));}for(const _0x45050a of _0x5cf586){_0x45050a[_0x3278f3(0x149)]&&(console[_0x3278f3(0x141)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x45050a['name']+'\x27:'),console['log']('─'[_0x3278f3(0x1c6)](0x3c)),console[_0x3278f3(0x141)](_0x45050a['diff']),console[_0x3278f3(0x141)]('─'[_0x3278f3(0x1c6)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x150f60(0x14e)]=a4_0x150f60(0x17f);['description']=a4_0x150f60(0x1b6);async[a4_0x150f60(0x169)](_0x55699a){const _0x5d61d5=a4_0x150f60,{options:_0x42ae5d,args:_0x4b29e8,tdx:_0x4cf83d}=_0x55699a,_0x57f5b1=_0x4b29e8[0x0],_0x4d9cdb=_0x4b29e8[0x1],_0x1bcc21=_0x42ae5d[_0x5d61d5(0x1c0)],_0x1fe289=_0x42ae5d['dryRun'],_0x558399=_0x42ae5d[_0x5d61d5(0x19d)],_0xc27a0a=_0x42ae5d[_0x5d61d5(0x14c)],_0x48a367=_0x42ae5d[_0x5d61d5(0x142)],_0x163f68=_0x42ae5d[_0x5d61d5(0x1c4)];let _0x1d8185;if(_0x57f5b1){const _0x12c117=a4_0x1df191['join'](_0x57f5b1,_0x5d61d5(0x1bd));if(existsSync(_0x12c117))try{const _0x311f3a=JSON['parse'](readFileSync(_0x12c117,_0x5d61d5(0x165)));_0x311f3a[_0x5d61d5(0x1cb)]&&(_0x1d8185={'llm_project':_0x311f3a[_0x5d61d5(0x1cb)]});}catch{}}const _0x2a59ef=findAgentConfigPath(process[_0x5d61d5(0x172)]());let _0x2db52c;if(_0x2a59ef)try{const _0x1bf02e=JSON[_0x5d61d5(0x177)](readFileSync(_0x2a59ef,_0x5d61d5(0x165)));_0x1bf02e[_0x5d61d5(0x1cb)]&&(_0x2db52c={'llm_project':_0x1bf02e[_0x5d61d5(0x1cb)]});}catch{}const _0x5030be=resolveAgentPullArgs({'arg':_0x57f5b1,'agentNameArg':_0x4d9cdb,'agentFlag':_0x163f68,'contextProject':_0x48a367,'argDirConfig':_0x1d8185,'cwdConfigPath':_0x2a59ef||undefined,'cwdConfig':_0x2db52c}),{projectNameOrId:_0x413faa,targetAgentName:_0x56d887,existingOutputDir:_0x5be13d,source:_0x29cec2}=_0x5030be;if(_0x29cec2===_0x5d61d5(0x193))console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x184)+a4_0x1df191[_0x5d61d5(0x1a6)](_0x57f5b1,'tdx.json')+':\x20'+_0x413faa));else{if(_0x29cec2==='cwd-config')console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x174)+_0x413faa));else _0x29cec2===_0x5d61d5(0x1d1)&&console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x175)]('Using\x20project\x20from\x20context:\x20'+_0x413faa));}if(!_0x413faa)return _0x163f68?(console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x12b))),console[_0x5d61d5(0x141)](_0x5d61d5(0x1a8)),console[_0x5d61d5(0x141)](_0x5d61d5(0x1aa))):(console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x188))),console[_0x5d61d5(0x141)](_0x5d61d5(0x1af)),console[_0x5d61d5(0x141)](_0x5d61d5(0x16c)),console[_0x5d61d5(0x141)](_0x5d61d5(0x145)),console['log'](_0x5d61d5(0x199)),console[_0x5d61d5(0x141)](_0x5d61d5(0x1a1))),0x1;if(_0x56d887){const {data:_0x42b335}=await withSpinner('Pulling\x20agent\x20\x22'+_0x56d887+'\x22\x20from\x20project\x20\x22'+_0x413faa+_0x5d61d5(0x152),()=>_0x4cf83d['llm'][_0x5d61d5(0x1bc)](_0x413faa,_0x56d887,_0x1bcc21,{'dryRun':_0x1fe289,'force':_0x558399}));if(_0x1fe289)return console['log'](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x18e))),console[_0x5d61d5(0x141)](_0x5d61d5(0x173)+_0x42b335[_0x5d61d5(0x12a)]),console[_0x5d61d5(0x141)](_0x5d61d5(0x14a)+_0x42b335[_0x5d61d5(0x160)]),_0x42b335[_0x5d61d5(0x149)]&&(console[_0x5d61d5(0x141)](_0x5d61d5(0x1c3)),console[_0x5d61d5(0x141)]('─'[_0x5d61d5(0x1c6)](0x3c)),console[_0x5d61d5(0x141)](_0x42b335[_0x5d61d5(0x149)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x19f))),console['log'](_0x5d61d5(0x144)+_0x42b335[_0x5d61d5(0x12a)]),console[_0x5d61d5(0x141)](_0x5d61d5(0x1da)+_0x42b335[_0x5d61d5(0x160)]),console[_0x5d61d5(0x141)](_0x5d61d5(0x1d0)+(_0x42b335['isNew']?a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x189)):_0x42b335[_0x5d61d5(0x140)]?a4_0x5c10dc['yellow'](_0x5d61d5(0x13f)):a4_0x5c10dc[_0x5d61d5(0x1d3)](_0x5d61d5(0x1a5)))),0x0;}const _0x56f155=_0x5be13d||_0x1bcc21,{data:_0x5ba55d}=await withSpinner('Analyzing\x20project\x20\x22'+_0x413faa+_0x5d61d5(0x152),()=>_0x4cf83d[_0x5d61d5(0x1d4)][_0x5d61d5(0x1b1)](_0x413faa,_0x56f155,{'dryRun':!![]})),_0x59c970=_0x5ba55d[_0x5d61d5(0x14f)]['agents']['new']+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x176)]['new']+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x137)]['new']+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1a4)][_0x5d61d5(0x189)]+_0x5ba55d['counts'][_0x5d61d5(0x1b5)][_0x5d61d5(0x189)]+_0x5ba55d['counts'][_0x5d61d5(0x1b0)][_0x5d61d5(0x189)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x182)]['new'],_0xccfa87=_0x5ba55d['counts'][_0x5d61d5(0x168)][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)]['knowledgeBases']['updated']+_0x5ba55d[_0x5d61d5(0x14f)]['textKnowledgeBases'][_0x5d61d5(0x13f)]+_0x5ba55d['counts'][_0x5d61d5(0x1a4)][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b5)][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)]['experimentalKnowledgeBases'][_0x5d61d5(0x13f)]+_0x5ba55d[_0x5d61d5(0x14f)]['experimentalArtifacts']['updated'],_0x48d6d0=_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x168)][_0x5d61d5(0x1a5)]+_0x5ba55d[_0x5d61d5(0x14f)]['knowledgeBases'][_0x5d61d5(0x1a5)]+_0x5ba55d['counts']['textKnowledgeBases'][_0x5d61d5(0x1a5)]+_0x5ba55d['counts'][_0x5d61d5(0x1a4)][_0x5d61d5(0x1a5)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b5)]['unchanged']+_0x5ba55d['counts'][_0x5d61d5(0x1b0)][_0x5d61d5(0x1a5)]+_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x182)][_0x5d61d5(0x1a5)];console[_0x5d61d5(0x141)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5ba55d[_0x5d61d5(0x163)]+'\x27:'),console['log']('\x20\x20'+a4_0x5c10dc['green']('+\x20'+_0x59c970+_0x5d61d5(0x197))+_0x5d61d5(0x17c)+a4_0x5c10dc[_0x5d61d5(0x133)]('~\x20'+_0xccfa87+_0x5d61d5(0x1b2))+_0x5d61d5(0x17c)+a4_0x5c10dc['dim']('=\x20'+_0x48d6d0+_0x5d61d5(0x185))),console[_0x5d61d5(0x141)](_0x5d61d5(0x191)+formatCountSummary(_0x5ba55d['counts']['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5ba55d['counts']['knowledgeBases'])),console['log'](_0x5d61d5(0x1b8)+formatCountSummary(_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x137)])),console[_0x5d61d5(0x141)](_0x5d61d5(0x156)+formatCountSummary(_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1a4)])),console['log'](_0x5d61d5(0x139)+formatCountSummary(_0x5ba55d['counts']['integrations']));const _0x5b8da5=_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b0)][_0x5d61d5(0x1cf)]>0x0||_0x5ba55d[_0x5d61d5(0x14f)]['experimentalArtifacts']['total']>0x0;_0x5b8da5&&(console['log'](_0x5d61d5(0x18f)+formatCountSummary(_0x5ba55d[_0x5d61d5(0x14f)][_0x5d61d5(0x1b0)])),console[_0x5d61d5(0x141)](_0x5d61d5(0x1ca)+formatCountSummary(_0x5ba55d['counts']['experimentalArtifacts'])));console[_0x5d61d5(0x141)](_0x5d61d5(0x13e)+a4_0x5c10dc[_0x5d61d5(0x16b)](_0x5ba55d[_0x5d61d5(0x17e)])),displayDiffs(_0x5ba55d[_0x5d61d5(0x168)],_0x5ba55d[_0x5d61d5(0x176)],_0x5ba55d[_0x5d61d5(0x137)],_0x5ba55d[_0x5d61d5(0x1a4)],_0x5ba55d['integrations'],_0x5ba55d['experimentalKnowledgeBases'],_0x5ba55d['experimentalArtifacts']);if(_0x1fe289)return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x131))),0x0;if(_0x59c970===0x0&&_0xccfa87===0x0)return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x14b))),saveSessionContext({'llm_project':_0x5ba55d['projectName']},_0x42ae5d[_0x5d61d5(0x180)]),console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x1a9)+a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x1cb))+_0x5d61d5(0x1db)+a4_0x5c10dc[_0x5d61d5(0x16b)](_0x5ba55d[_0x5d61d5(0x163)]))),0x0;if(!_0xc27a0a&&!_0x558399){if(!isInteractive())return console['error'](a4_0x5c10dc[_0x5d61d5(0x1c7)]('\x0aError:'),_0x5d61d5(0x179)),console[_0x5d61d5(0x138)](a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x1cd))),0x1;const _0xcdb5ee=await confirmKey(_0x5d61d5(0x1bf)+(_0x59c970+_0xccfa87)+_0x5d61d5(0x196));if(!_0xcdb5ee)return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x133)](_0x5d61d5(0x1ae)),_0x5d61d5(0x143)),0x1;}const {data:_0x4dcbc1}=await withSpinner(_0x5d61d5(0x127),()=>_0x4cf83d[_0x5d61d5(0x1d4)][_0x5d61d5(0x1b1)](_0x413faa,_0x56f155,{'force':_0x558399}));return console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x136)+(_0x59c970+_0xccfa87)+_0x5d61d5(0x194)+_0x4dcbc1[_0x5d61d5(0x17e)])),saveSessionContext({'llm_project':_0x4dcbc1[_0x5d61d5(0x163)]},_0x42ae5d[_0x5d61d5(0x180)]),console[_0x5d61d5(0x141)](a4_0x5c10dc[_0x5d61d5(0x148)](_0x5d61d5(0x1a9)+a4_0x5c10dc[_0x5d61d5(0x175)](_0x5d61d5(0x1cb))+_0x5d61d5(0x1db)+a4_0x5c10dc[_0x5d61d5(0x16b)](_0x4dcbc1[_0x5d61d5(0x163)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x150f60(0x14e)]=a4_0x150f60(0x157);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x150f60(0x169)](_0x86d43d){const _0x2a3405=a4_0x150f60,{options:_0x1fd14f,args:_0x4f6b19,tdx:_0x406cf9}=_0x86d43d,_0x58c239=_0x4f6b19[0x0],_0x3d41cf=_0x1fd14f[_0x2a3405(0x14e)],_0x461df7=_0x1fd14f[_0x2a3405(0x1a0)],_0x1656c1=_0x1fd14f[_0x2a3405(0x14c)],_0xe46107=_0x1fd14f[_0x2a3405(0x12f)],_0x5f1b57=_0x1fd14f['llmProject'];let _0x2add9d;const _0x1e4f30=findAgentConfigPath(process[_0x2a3405(0x172)]());if(_0x58c239){const _0x4999e3=a4_0x1df191[_0x2a3405(0x1a6)](_0x58c239,'tdx.json');existsSync(_0x4999e3)?(_0x2add9d=_0x58c239,console['log'](a4_0x5c10dc[_0x2a3405(0x175)](_0x2a3405(0x15f)+_0x58c239))):_0x2add9d=_0x58c239;}else{if(_0x1e4f30)_0x2add9d=a4_0x1df191['dirname'](_0x1e4f30),console['log'](a4_0x5c10dc['dim'](_0x2a3405(0x167)+_0x2add9d));else{if(_0x5f1b57){const _0x5bed2d=sanitizeForFilesystem(_0x5f1b57);let _0x555afd=_0x5bed2d,_0x502382=a4_0x1df191[_0x2a3405(0x1a6)](process[_0x2a3405(0x172)](),'agents',_0x5bed2d,'tdx.json');if(!existsSync(_0x502382)){const _0x14346d=normalizeName(_0x5f1b57),_0x44068d=a4_0x1df191[_0x2a3405(0x1a6)](process['cwd'](),'agents',_0x14346d,_0x2a3405(0x1bd));existsSync(_0x44068d)&&(_0x555afd=_0x14346d,_0x502382=_0x44068d);}if(existsSync(_0x502382))_0x2add9d=a4_0x1df191[_0x2a3405(0x195)](_0x502382),console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x175)]('Using\x20local\x20project:\x20'+_0x2add9d));else{const _0x3a6b20=_0x1fd14f['profile'];if(_0x3a6b20)throw new SDKError(ErrorCode[_0x2a3405(0x155)],_0x2a3405(0x1ab)+_0x5f1b57+_0x2a3405(0x129),undefined,{'helpText':_0x2a3405(0x126)+_0x2a3405(0x161)+(_0x2a3405(0x15b)+_0x5f1b57+'\x0a')+(_0x2a3405(0x183)+_0x555afd+_0x2a3405(0x125)+(_0x3d41cf||_0x2a3405(0x16e))+'\x20--profile\x20'+_0x3a6b20)});_0x2add9d=_0x5f1b57,console[_0x2a3405(0x141)](a4_0x5c10dc['dim'](_0x2a3405(0x13c)+_0x5f1b57));}}}}if(!_0x2add9d)return console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x133)](_0x2a3405(0x18d))),console[_0x2a3405(0x141)](_0x2a3405(0x146)),console[_0x2a3405(0x141)](_0x2a3405(0x1dd)),console[_0x2a3405(0x141)]('\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[_0x2a3405(0x141)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3d41cf)throw new SDKError(ErrorCode[_0x2a3405(0x14d)],_0x2a3405(0x1bb),undefined,{'helpText':_0x2a3405(0x13a)});if(!_0x1656c1&&!_0x461df7){if(!isInteractive())return console[_0x2a3405(0x138)](a4_0x5c10dc['red'](_0x2a3405(0x130)),_0x2a3405(0x179)),console[_0x2a3405(0x138)](a4_0x5c10dc['dim'](_0x2a3405(0x1cd))),0x1;const _0x54be16=await confirmKey(_0x2a3405(0x17b)+_0x2add9d+'\x22\x20to\x20new\x20project\x20\x22'+_0x3d41cf+'\x22?');if(!_0x54be16)return console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x133)](_0x2a3405(0x1ae))),0x1;}const {data:_0x3e55f1}=await withSpinner('Cloning\x20\x22'+_0x2add9d+_0x2a3405(0x15e)+_0x3d41cf+'\x22...',()=>_0x406cf9[_0x2a3405(0x1d4)][_0x2a3405(0x1c2)](_0x2add9d,_0x3d41cf,{'dryRun':_0x461df7}));if(_0x461df7){console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x133)](_0x2a3405(0x17a))),console[_0x2a3405(0x141)]('Source:\x20'+_0x3e55f1[_0x2a3405(0x19a)]),console['log'](_0x2a3405(0x1ac)+_0x3d41cf),console[_0x2a3405(0x141)]('Would\x20clone:'),console['log'](_0x2a3405(0x191)+_0x3e55f1[_0x2a3405(0x14f)]['agents']['created']),console[_0x2a3405(0x141)](_0x2a3405(0x1c9)+_0x3e55f1[_0x2a3405(0x14f)]['knowledgeBases'][_0x2a3405(0x16d)]),console['log']('\x20\x20Prompts:\x20'+_0x3e55f1[_0x2a3405(0x14f)]['prompts'][_0x2a3405(0x16d)]);const _0x5da87e=_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x1b0)][_0x2a3405(0x16d)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)]['created']>0x0;return _0x5da87e&&(console[_0x2a3405(0x141)](_0x2a3405(0x18f)+_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'][_0x2a3405(0x16d)]),console['log'](_0x2a3405(0x1ca)+_0x3e55f1['counts'][_0x2a3405(0x182)]['created'])),0x0;}const _0x5ae92a=_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x168)][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x176)][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)]['prompts'][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x1b0)][_0x2a3405(0x178)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)][_0x2a3405(0x178)]>0x0;_0x5ae92a?console['log'](a4_0x5c10dc['yellow'](_0x2a3405(0x198))):console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x148)](_0x2a3405(0x1b7)));console['log'](_0x2a3405(0x1d9)+_0x3e55f1[_0x2a3405(0x19a)]),console[_0x2a3405(0x141)](_0x2a3405(0x1ac)+_0x3e55f1[_0x2a3405(0x1c8)]),console[_0x2a3405(0x141)](_0x2a3405(0x1d2)+_0x3e55f1[_0x2a3405(0x19b)]),console[_0x2a3405(0x141)](),console['log'](_0x2a3405(0x150)),console['log'](_0x2a3405(0x191)+formatCountSummary(_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x168)])),console[_0x2a3405(0x141)](_0x2a3405(0x1c9)+formatCountSummary(_0x3e55f1['counts'][_0x2a3405(0x176)])),console[_0x2a3405(0x141)](_0x2a3405(0x156)+formatCountSummary(_0x3e55f1['counts'][_0x2a3405(0x1a4)])),console[_0x2a3405(0x141)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x1b5)]));const _0x5678c1=_0x3e55f1['counts'][_0x2a3405(0x1b0)][_0x2a3405(0x16d)]>0x0||_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'][_0x2a3405(0x13f)]>0x0||_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'][_0x2a3405(0x1a5)]>0x0||_0x3e55f1['counts'][_0x2a3405(0x182)][_0x2a3405(0x16d)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)][_0x2a3405(0x13f)]>0x0||_0x3e55f1[_0x2a3405(0x14f)][_0x2a3405(0x182)]['unchanged']>0x0;_0x5678c1&&(console[_0x2a3405(0x141)](_0x2a3405(0x18f)+formatCountSummary(_0x3e55f1[_0x2a3405(0x14f)]['experimentalKnowledgeBases'])),console['log'](_0x2a3405(0x1ca)+formatCountSummary(_0x3e55f1['counts'][_0x2a3405(0x182)])));if(_0x5ae92a){console[_0x2a3405(0x141)](),console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x186)));for(const _0x5ca45e of _0x3e55f1[_0x2a3405(0x168)]){_0x5ca45e['action']===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x1ba)+_0x5ca45e[_0x2a3405(0x12a)]+_0x2a3405(0x123)+_0x5ca45e[_0x2a3405(0x138)]));}for(const _0x2f92a7 of _0x3e55f1[_0x2a3405(0x176)]){_0x2f92a7[_0x2a3405(0x19e)]===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x124)+_0x2f92a7['name']+_0x2a3405(0x123)+_0x2f92a7['error']));}for(const _0x2a242b of _0x3e55f1[_0x2a3405(0x1a4)]){_0x2a242b[_0x2a3405(0x19e)]===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)]('\x20\x20Prompt\x20\x22'+_0x2a242b[_0x2a3405(0x14e)]+_0x2a3405(0x123)+_0x2a242b['error']));}for(const _0x44f2c3 of _0x3e55f1[_0x2a3405(0x1b5)]){_0x44f2c3['action']===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)](_0x2a3405(0x164)+_0x44f2c3['name']+'\x22:\x20'+_0x44f2c3[_0x2a3405(0x138)]));}for(const _0x483599 of _0x3e55f1[_0x2a3405(0x1b0)]){_0x483599[_0x2a3405(0x19e)]==='error'&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x483599[_0x2a3405(0x14e)]+_0x2a3405(0x123)+_0x483599[_0x2a3405(0x138)]));}for(const _0x5c8304 of _0x3e55f1[_0x2a3405(0x182)]){_0x5c8304[_0x2a3405(0x19e)]===_0x2a3405(0x138)&&console[_0x2a3405(0x141)](a4_0x5c10dc[_0x2a3405(0x1c7)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5c8304[_0x2a3405(0x14e)]+'\x22:\x20'+_0x5c8304['error']));}return 0x1;}console[_0x2a3405(0x141)]();const _0x5060f8=getLLMProjectUrl(_0xe46107,_0x3e55f1['newProjectId']);return console[_0x2a3405(0x141)](_0x2a3405(0x192)+a4_0x5c10dc[_0x2a3405(0x16b)](_0x5060f8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x150f60(0x14e)]='agent:push';[a4_0x150f60(0x1d8)]=a4_0x150f60(0x18a);async['execute'](_0x4494ba){const _0x424273=a4_0x150f60,{options:_0x126740,args:_0x3fdb45,tdx:_0x30af1d}=_0x4494ba;let _0x592686=_0x3fdb45[0x0]||process[_0x424273(0x172)]();const _0x595573=_0x126740[_0x424273(0x1a0)],_0x57e96c=_0x126740[_0x424273(0x19d)],_0x331a3e=_0x126740[_0x424273(0x14c)],_0x54ce39=_0x126740[_0x424273(0x12f)],_0x96a35a=a4_0x1df191[_0x424273(0x1a6)](_0x592686,_0x424273(0x162)),_0x385758=existsSync(_0x96a35a);if(_0x385758){const {data:_0xa1cd49}=await withSpinner(_0x424273(0x166)+_0x592686+_0x424273(0x152),()=>_0x30af1d[_0x424273(0x1d4)][_0x424273(0x181)](_0x592686,{'dryRun':_0x595573,'force':_0x57e96c}));if(_0x595573)return console['log'](a4_0x5c10dc[_0x424273(0x133)](_0x424273(0x17a))),console[_0x424273(0x141)](_0x424273(0x1d6)+_0xa1cd49[_0x424273(0x12a)]),0x0;if(_0xa1cd49[_0x424273(0x19e)]===_0x424273(0x138))return console['log'](a4_0x5c10dc[_0x424273(0x1c7)]('Failed\x20to\x20push\x20agent:\x20'+_0xa1cd49[_0x424273(0x138)])),0x1;console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x148)](_0x424273(0x132)+_0xa1cd49[_0x424273(0x19e)]+_0x424273(0x16a))),console['log'](_0x424273(0x144)+_0xa1cd49[_0x424273(0x12a)]);if(_0xa1cd49[_0x424273(0x187)]&&_0xa1cd49[_0x424273(0x12c)]){const _0x5577ff=getLLMAgentChatUrl(_0x54ce39,_0xa1cd49[_0x424273(0x12c)],_0xa1cd49[_0x424273(0x187)]);console[_0x424273(0x141)]('Chat:\x20'+a4_0x5c10dc[_0x424273(0x16b)](_0x5577ff));}return 0x0;}const _0x561e18=_0x126740[_0x424273(0x142)],_0x45853d=resolveProjectFromContext(_0x592686,_0x561e18);if(_0x45853d['found'])_0x592686=_0x45853d[_0x424273(0x158)],_0x45853d[_0x424273(0x1ad)]===_0x424273(0x1d1)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x175)](_0x424273(0x174)+_0x592686));else{let _0x4abeb0=_0x424273(0x17d);_0x45853d[_0x424273(0x1cc)]===_0x424273(0x1d7)&&(_0x4abeb0=_0x45853d['message']+_0x424273(0x19c)+_0x45853d[_0x424273(0x142)]+_0x424273(0x1b9));throw new SDKError(ErrorCode[_0x424273(0x155)],_0x45853d[_0x424273(0x1cc)]==='no_context'?_0x45853d[_0x424273(0x1b3)]:_0x424273(0x13b)+_0x592686,undefined,{'helpText':_0x4abeb0});}const {data:_0x14f269}=await withSpinner(_0x424273(0x1be),()=>_0x30af1d['llm'][_0x424273(0x15a)](_0x592686,{'dryRun':!![]})),_0x217edd=_0x14f269['counts'][_0x424273(0x168)][_0x424273(0x178)]>0x0;if(_0x217edd){console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('\x0aErrors\x20found:'));for(const _0x31ac2a of _0x14f269[_0x424273(0x168)]){_0x31ac2a[_0x424273(0x19e)]===_0x424273(0x138)&&console['log'](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x1ba)+_0x31ac2a[_0x424273(0x12a)]+'\x22:\x20'+_0x31ac2a['error']));}return 0x1;}const _0x1d864e=_0x14f269['counts'][_0x424273(0x168)]['created']+_0x14f269[_0x424273(0x14f)]['knowledgeBases'][_0x424273(0x16d)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x137)][_0x424273(0x16d)]+_0x14f269[_0x424273(0x14f)]['prompts']['created']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b5)]['created']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x16d)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x182)]['created'],_0x2fb15e=_0x14f269[_0x424273(0x14f)][_0x424273(0x168)][_0x424273(0x13f)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x176)][_0x424273(0x13f)]+_0x14f269[_0x424273(0x14f)]['textKnowledgeBases']['updated']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1a4)]['updated']+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b5)][_0x424273(0x13f)]+_0x14f269[_0x424273(0x14f)]['experimentalKnowledgeBases']['updated']+_0x14f269[_0x424273(0x14f)][_0x424273(0x182)]['updated'],_0x217908=_0x14f269['counts'][_0x424273(0x168)]['unchanged']+_0x14f269[_0x424273(0x14f)][_0x424273(0x176)]['unchanged']+_0x14f269[_0x424273(0x14f)][_0x424273(0x137)]['unchanged']+_0x14f269[_0x424273(0x14f)]['prompts'][_0x424273(0x1a5)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b5)][_0x424273(0x1a5)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x1a5)]+_0x14f269[_0x424273(0x14f)][_0x424273(0x182)][_0x424273(0x1a5)];console[_0x424273(0x141)]('\x0aPush\x20summary\x20for\x20\x27'+_0x14f269[_0x424273(0x163)]+'\x27:'),console[_0x424273(0x141)]('\x20\x20'+a4_0x5c10dc[_0x424273(0x148)]('+\x20'+_0x1d864e+_0x424273(0x197))+_0x424273(0x17c)+a4_0x5c10dc[_0x424273(0x133)]('~\x20'+_0x2fb15e+'\x20changed')+_0x424273(0x17c)+a4_0x5c10dc[_0x424273(0x175)]('=\x20'+_0x217908+_0x424273(0x185))),console[_0x424273(0x141)](_0x424273(0x191)+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x168)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x176)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x137)])),console[_0x424273(0x141)](_0x424273(0x156)+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x1a4)])),console['log'](_0x424273(0x139)+formatCountSummary(_0x14f269[_0x424273(0x14f)]['integrations']));const _0x24bdaa=_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x16d)]>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x13f)]>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x1b0)][_0x424273(0x1a5)]>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x182)][_0x424273(0x16d)]>0x0||_0x14f269['counts']['experimentalArtifacts']['updated']>0x0||_0x14f269[_0x424273(0x14f)][_0x424273(0x182)][_0x424273(0x1a5)]>0x0;_0x24bdaa&&(console[_0x424273(0x141)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14f269[_0x424273(0x14f)]['experimentalKnowledgeBases'])),console[_0x424273(0x141)](_0x424273(0x1ca)+formatCountSummary(_0x14f269[_0x424273(0x14f)][_0x424273(0x182)])));console['log'](_0x424273(0x15c)+a4_0x5c10dc[_0x424273(0x16b)](_0x592686)),displayDiffs(_0x14f269[_0x424273(0x168)],_0x14f269[_0x424273(0x176)],_0x14f269[_0x424273(0x137)],_0x14f269[_0x424273(0x1a4)],_0x14f269[_0x424273(0x1b5)],_0x14f269['experimentalKnowledgeBases'],_0x14f269['experimentalArtifacts']);if(_0x595573)return console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x133)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1d864e===0x0&&_0x2fb15e===0x0){console[_0x424273(0x141)](a4_0x5c10dc['green'](_0x424273(0x1b4)));const _0x3baf0a=getLLMProjectUrl(_0x54ce39,_0x14f269['projectId']);return console[_0x424273(0x141)](_0x424273(0x192)+a4_0x5c10dc[_0x424273(0x16b)](_0x3baf0a)),0x0;}if(!_0x331a3e&&!_0x57e96c){if(!isInteractive())return console['error'](a4_0x5c10dc[_0x424273(0x1c7)]('\x0aError:'),_0x424273(0x179)),console['error'](a4_0x5c10dc[_0x424273(0x175)](_0x424273(0x1cd))),0x1;const _0x5226d0=await confirmKey(_0x424273(0x18c)+(_0x1d864e+_0x2fb15e)+_0x424273(0x1a2));if(!_0x5226d0)return console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x133)](_0x424273(0x1ae)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x20cba4}=await withSpinner(_0x424273(0x171),()=>_0x30af1d['llm'][_0x424273(0x15a)](_0x592686,{'force':_0x57e96c})),_0x1dda06=_0x20cba4[_0x424273(0x14f)][_0x424273(0x168)][_0x424273(0x178)]>0x0||_0x20cba4[_0x424273(0x14f)][_0x424273(0x176)][_0x424273(0x178)]>0x0||_0x20cba4[_0x424273(0x14f)][_0x424273(0x137)][_0x424273(0x178)]>0x0||_0x20cba4[_0x424273(0x14f)]['prompts'][_0x424273(0x178)]>0x0;if(_0x1dda06){console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x133)](_0x424273(0x12d))),console[_0x424273(0x141)](),console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('Errors:'));for(const _0x311c5b of _0x20cba4[_0x424273(0x168)]){_0x311c5b[_0x424273(0x19e)]===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('\x20\x20Agent\x20\x22'+_0x311c5b[_0x424273(0x12a)]+_0x424273(0x123)+_0x311c5b[_0x424273(0x138)]));}for(const _0x8e39dd of _0x20cba4[_0x424273(0x176)]){_0x8e39dd[_0x424273(0x19e)]==='error'&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x124)+_0x8e39dd[_0x424273(0x14e)]+_0x424273(0x123)+_0x8e39dd[_0x424273(0x138)]));}for(const _0xac6764 of _0x20cba4[_0x424273(0x137)]){_0xac6764[_0x424273(0x19e)]===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x153)+_0xac6764['name']+_0x424273(0x123)+_0xac6764[_0x424273(0x138)]));}for(const _0x2dfde6 of _0x20cba4[_0x424273(0x1a4)]){_0x2dfde6[_0x424273(0x19e)]===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)]('\x20\x20Prompt\x20\x22'+_0x2dfde6[_0x424273(0x14e)]+_0x424273(0x123)+_0x2dfde6['error']));}for(const _0x1cbd65 of _0x20cba4[_0x424273(0x1b5)]){_0x1cbd65['action']===_0x424273(0x138)&&console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x1c7)](_0x424273(0x164)+_0x1cbd65[_0x424273(0x14e)]+_0x424273(0x123)+_0x1cbd65['error']));}return 0x1;}console[_0x424273(0x141)](a4_0x5c10dc[_0x424273(0x148)](_0x424273(0x1a7)+(_0x1d864e+_0x2fb15e)+'\x20resources\x20to\x20\x27'+_0x20cba4[_0x424273(0x163)]+'\x27'));const _0x488e02=getLLMProjectUrl(_0x54ce39,_0x20cba4[_0x424273(0x12c)]);return console['log'](_0x424273(0x192)+a4_0x5c10dc[_0x424273(0x16b)](_0x488e02)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x554e(_0x4029cb,_0x27f3b9){_0x4029cb=_0x4029cb-0x11f;const _0x438e34=a5_0x438e();let _0x554e38=_0x438e34[_0x4029cb];return _0x554e38;}const a5_0x5ec6a5=a5_0x554e;(function(_0x30594f,_0x2218e8){const _0x35100e=a5_0x554e,_0x23ff87=_0x30594f();while(!![]){try{const _0x2df584=parseInt(_0x35100e(0x155))/0x1*(-parseInt(_0x35100e(0x1b0))/0x2)+parseInt(_0x35100e(0x135))/0x3*(parseInt(_0x35100e(0x1ae))/0x4)+-parseInt(_0x35100e(0x197))/0x5+parseInt(_0x35100e(0x181))/0x6+-parseInt(_0x35100e(0x15b))/0x7+-parseInt(_0x35100e(0x185))/0x8+parseInt(_0x35100e(0x173))/0x9;if(_0x2df584===_0x2218e8)break;else _0x23ff87['push'](_0x23ff87['shift']());}catch(_0x59311e){_0x23ff87['push'](_0x23ff87['shift']());}}}(a5_0x438e,0x40186));import*as a5_0x8b428c from'node:fs';import*as a5_0x5d6cf2 from'node:path';import a5_0x10f466 from'chalk';function a5_0x438e(){const _0x34042d=['trim','output','Either\x20switch\x20to\x20the\x20\x22','Running\x20test:\x20','Using\x20agent:\x20','Evaluating\x20response...','found','126660AhIZuQ','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','green','llmProject','\x22,\x20but\x20current\x20site\x20is\x20\x22','projectName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','table','Re-evaluating\x20','conversation_url','writeFileSync','includes','testYmlPath','has',':\x20Sending\x20user\x20input...','substring','\x27\x20to\x20create\x20the\x20folder\x20structure.','Cached\x20run\x20is\x20from\x20site\x20\x22','Agent:\x20','map','\x20\x20Round\x20','isSpinning','now','✗\x20ERROR:\x20','\x20(new)','No\x20tests\x20found\x20matching:\x20','Available\x20tests:\x20','Total:\x20\x20\x20\x20','join','\x22:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','text','1087bKzKFm','...\x20','llm','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','reason','\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','2575720KuzJQM','✓\x20PASS:\x20','FAIL','agentDirs','name','executeReeval','Round\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','find','status','projectDir','\x20\x20Conversation:\x20','Error\x20writing\x20output\x20file:\x20','toISOString','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Output\x20written\x20to:\x20','Errors:\x20\x20\x20','length','split','site','Error:\x20No\x20previous\x20test\x20run\x20found.','resolveProjectId','\x20\x20Evaluating...\x20','Re-evaluating...','6680871NPIIwu','Failed:\x20\x20\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','round','no_local_folder','Test\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Agent:\x20','json','log','size','execute','forEach','2903736fFDzuy','Round\x201/','ERROR','Duration:\x20','1774112pfVEhN','testName','rounds','PASS','Test\x20Summary','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','start','resolve','reeval','message','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','cyan','tsv','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','⚠\x20SKIPPED:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Cached\x20run\x20from:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','1249010fnVIim','Site:\x20','utf-8','jsonl','...','\x20-\x20','eval','tests','stop','add','agent','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','test.yml','dryRun','white','push','\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)','agentName','404','\x20\x20-\x20','filter','Failed\x20Tests:','32foiUIN','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','850YCxnwR','multiple_agents','not\x20found','context','yellow','dim','New\x20tests\x20to\x20execute:\x20','timestamp','description','No\x20tests\x20have\x20tags\x20defined.','verbose','✗\x20FAIL:\x20','tags','repeat','Test\x20Configuration:','Conversation\x20URL:\x20','red','Running:\x20','toLowerCase'];a5_0x438e=function(){return _0x34042d;};return a5_0x438e();}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']='agent:test';[a5_0x5ec6a5(0x123)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5ec6a5(0x17f)](_0x5d9ec2){const _0x530df6=a5_0x5ec6a5,{options:_0x11fb7a,args:_0x286e6c,tdx:_0xbf98e}=_0x5d9ec2,_0x45f8b8=_0x286e6c[0x0]||'.',_0x1a028f=_0x11fb7a[_0x530df6(0x1a5)],_0x10bbb0=_0x11fb7a,_0x1a803e=_0x10bbb0[_0x530df6(0x19d)]===![],_0x3f4d2b=_0x10bbb0[_0x530df6(0x18d)],_0x409c3d=_0x10bbb0[_0x530df6(0x15f)],_0x2225f4=_0x10bbb0['tags'],_0x499cce=_0x11fb7a[_0x530df6(0x16e)],_0x4e420d=_0x10bbb0[_0x530df6(0x12f)];if(_0x3f4d2b&&_0x1a803e)return console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x18a))),0x1;let _0xd863f4=_0x530df6(0x13c);if(_0x10bbb0[_0x530df6(0x17c)])_0xd863f4='json';else{if(_0x10bbb0['jsonl'])_0xd863f4=_0x530df6(0x19a);else{if(_0x10bbb0[_0x530df6(0x191)])_0xd863f4='tsv';else{if(_0x10bbb0[_0x530df6(0x13c)])_0xd863f4=_0x530df6(0x13c);}}}const _0x1a6d06=_0x10bbb0[_0x530df6(0x138)];let _0x53534e=_0x45f8b8;const _0x586d54=a5_0x8b428c['existsSync'](_0x45f8b8),_0x264448=_0x45f8b8==='.';if(!_0x586d54||_0x264448){const _0x125385=resolveProjectFromContext(_0x45f8b8,_0x1a6d06,{'requireFile':_0x530df6(0x1a4)});if(_0x125385[_0x530df6(0x134)])_0x53534e=_0x125385[_0x530df6(0x165)],_0x125385['source']===_0x530df6(0x1b3)&&console['log'](a5_0x10f466['dim'](_0x530df6(0x132)+_0x53534e));else switch(_0x125385['reason']){case'no_context':console['log'](a5_0x10f466[_0x530df6(0x11f)](_0x125385[_0x530df6(0x18e)])),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)]('Usage:'),console[_0x530df6(0x17d)](_0x530df6(0x15a)),console[_0x530df6(0x17d)](_0x530df6(0x1a8)),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)](_0x530df6(0x196));return 0x1;case _0x530df6(0x178):console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x11f)](_0x125385[_0x530df6(0x18e)])),console['log'](),console[_0x530df6(0x17d)](_0x530df6(0x175)+_0x125385['llmProject']+_0x530df6(0x145));return 0x1;case _0x530df6(0x1b1):{const _0x3a5d42=a5_0x5d6cf2['basename'](_0x125385['projectDir']);console[_0x530df6(0x17d)](a5_0x10f466['yellow'](_0x530df6(0x192)+_0x125385[_0x530df6(0x138)]+'\x22:'));for(const _0x30a6fb of _0x125385[_0x530df6(0x15e)]){console[_0x530df6(0x17d)](_0x530df6(0x1ab)+_0x30a6fb);}return console['log'](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3a5d42+'/<agent-name>'),0x1;}case'no_tests':console['log'](a5_0x10f466[_0x530df6(0x11f)](_0x530df6(0x136)+_0x125385[_0x530df6(0x138)]+'\x22.')),console['log'](a5_0x10f466[_0x530df6(0x120)]('Project\x20path:\x20'+_0x125385[_0x530df6(0x165)])),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)](_0x530df6(0x18f));return 0x1;}}const {definition:_0x4d5caf,agentInfo:_0x3dabfb}=parseTestFile(_0x53534e);let _0x4e9391=_0x4d5caf[_0x530df6(0x19e)];if(_0x409c3d){const _0x43028c=_0x409c3d[_0x530df6(0x16d)](',')[_0x530df6(0x148)](_0x172fb3=>_0x172fb3[_0x530df6(0x12e)]());_0x4e9391=_0x4d5caf[_0x530df6(0x19e)]['filter'](_0x7b96c=>_0x43028c[_0x530df6(0x140)](_0x7b96c['name']));if(_0x4e9391[_0x530df6(0x16c)]===0x0)return console['log'](a5_0x10f466[_0x530df6(0x11f)](_0x530df6(0x14e)+_0x409c3d)),console['log'](a5_0x10f466['dim'](_0x530df6(0x14f)+_0x4d5caf['tests']['map'](_0x1ac888=>_0x1ac888[_0x530df6(0x15f)])[_0x530df6(0x151)](',\x20'))),0x1;}if(_0x2225f4){const _0x46940b=_0x2225f4[_0x530df6(0x16d)](',')['map'](_0x3dd75e=>_0x3dd75e[_0x530df6(0x12e)]()['toLowerCase']());_0x4e9391=_0x4e9391[_0x530df6(0x1ac)](_0x714d20=>_0x714d20['tags']?.['some'](_0x38c099=>_0x46940b['includes'](_0x38c099['toLowerCase']())));if(_0x4e9391[_0x530df6(0x16c)]===0x0){console[_0x530df6(0x17d)](a5_0x10f466['yellow'](_0x530df6(0x194)+_0x2225f4));const _0x5ae5da=new Set();return _0x4d5caf['tests'][_0x530df6(0x180)](_0x8f93c2=>_0x8f93c2['tags']?.[_0x530df6(0x180)](_0x44b86d=>_0x5ae5da[_0x530df6(0x1a0)](_0x44b86d))),_0x5ae5da[_0x530df6(0x17e)]>0x0?console[_0x530df6(0x17d)](a5_0x10f466['dim']('Available\x20tags:\x20'+[..._0x5ae5da][_0x530df6(0x151)](',\x20'))):console['log'](a5_0x10f466[_0x530df6(0x120)](_0x530df6(0x124))),0x1;}}if(_0x3f4d2b)return this['executeReeval'](_0x5d9ec2,{'definition':{'tests':_0x4e9391},'agentInfo':_0x3dabfb,'outputFormat':_0xd863f4,'outputFile':_0x4e420d,'testNames':_0x409c3d});if(_0x1a028f){console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x190)](_0x530df6(0x129))),console[_0x530df6(0x17d)]('\x20\x20Site:\x20'+a5_0x10f466['white'](_0x499cce)),console[_0x530df6(0x17d)]('\x20\x20Project:\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x3dabfb['projectName'])),console[_0x530df6(0x17d)](_0x530df6(0x17b)+a5_0x10f466[_0x530df6(0x1a6)](_0x3dabfb['agentName'])),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)]('Tests\x20found:\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x4e9391[_0x530df6(0x16c)]));for(let _0x3b4f60=0x0;_0x3b4f60<_0x4e9391[_0x530df6(0x16c)];_0x3b4f60++){const _0x580822=_0x4e9391[_0x3b4f60],_0x1f2df3=_0x580822[_0x530df6(0x187)][_0x530df6(0x16c)]===0x1?_0x530df6(0x177):'rounds',_0x1a7662=_0x580822[_0x530df6(0x127)]?.[_0x530df6(0x16c)]?'\x20['+_0x580822[_0x530df6(0x127)]['join'](',\x20')+']':'';console[_0x530df6(0x17d)]('\x20\x20'+(_0x3b4f60+0x1)+'.\x20'+a5_0x10f466['white'](_0x580822[_0x530df6(0x15f)])+'\x20('+_0x580822[_0x530df6(0x187)][_0x530df6(0x16c)]+'\x20'+_0x1f2df3+')'+a5_0x10f466[_0x530df6(0x120)](_0x1a7662));}return 0x0;}let _0x21d113,_0x15842d;try{_0x21d113=await _0xbf98e['llm'][_0x530df6(0x170)](_0x3dabfb[_0x530df6(0x13a)]);}catch(_0x25273c){const _0x3b68bd=_0x25273c instanceof Error?_0x25273c[_0x530df6(0x18e)]:String(_0x25273c);return _0x3b68bd[_0x530df6(0x140)](_0x530df6(0x1aa))||_0x3b68bd[_0x530df6(0x12d)]()[_0x530df6(0x140)]('not\x20found')?console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x17a)+_0x3dabfb[_0x530df6(0x13a)])):console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x153)+_0x3dabfb[_0x530df6(0x13a)]+_0x530df6(0x152)+_0x3b68bd)),0x1;}try{_0x15842d=await _0xbf98e['llm']['resolveAgentId'](_0x3dabfb[_0x530df6(0x1a9)],_0x21d113);}catch(_0x2fa916){const _0x19bad6=_0x2fa916 instanceof Error?_0x2fa916['message']:String(_0x2fa916);return _0x19bad6[_0x530df6(0x140)](_0x530df6(0x1aa))||_0x19bad6[_0x530df6(0x12d)]()[_0x530df6(0x140)](_0x530df6(0x1b2))?console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x158)+_0x3dabfb['agentName'])):console[_0x530df6(0x17d)](a5_0x10f466['red'](_0x530df6(0x169)+_0x3dabfb['agentName']+'\x22:\x20'+_0x19bad6)),0x1;}let _0x2fcba2;if(!_0x1a803e)try{_0x2fcba2=await setupEvaluatorAgent(_0xbf98e[_0x530df6(0x157)],_0x11fb7a[_0x530df6(0x125)]);}catch(_0x5c6e44){const _0x4fbfda=_0x5c6e44 instanceof Error?_0x5c6e44[_0x530df6(0x18e)]:String(_0x5c6e44);return console['log'](a5_0x10f466['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4fbfda)),0x1;}console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x190)]('Running\x20agent\x20tests...')),console['log'](_0x530df6(0x198)+a5_0x10f466['white'](_0x499cce)),console['log']('Agent:\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x3dabfb[_0x530df6(0x13a)]+'/'+_0x3dabfb[_0x530df6(0x1a9)])),console[_0x530df6(0x17d)]();const _0x5b993b=[],_0x54e09e=[],_0x500800=Date[_0x530df6(0x14b)]();for(let _0x455820=0x0;_0x455820<_0x4e9391[_0x530df6(0x16c)];_0x455820++){const _0x3e7fd5=_0x4e9391[_0x455820];_0x4e9391[_0x530df6(0x16c)]>0x1?console['log'](_0x530df6(0x179)+(_0x455820+0x1)+'/'+_0x4e9391[_0x530df6(0x16c)]+':\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x3e7fd5[_0x530df6(0x15f)])):console[_0x530df6(0x17d)](_0x530df6(0x131)+a5_0x10f466[_0x530df6(0x1a6)](_0x3e7fd5[_0x530df6(0x15f)]));const _0x2b068a=createCommandSpinner(_0x530df6(0x182)+_0x3e7fd5[_0x530df6(0x187)][_0x530df6(0x16c)]+_0x530df6(0x143));_0x2b068a[_0x530df6(0x18b)]();try{const {result:_0x594da7,conversation:_0x12dab5}=await runTest(_0xbf98e[_0x530df6(0x157)],_0x3e7fd5,{'agentId':_0x15842d,'projectId':_0x21d113,'site':_0x499cce,'noEval':_0x1a803e,'evaluatorId':_0x2fcba2,'onRoundStart':(_0x52a37c,_0x23ad2d)=>{const _0x32b000=_0x530df6;_0x2b068a[_0x32b000(0x154)]=_0x32b000(0x161)+(_0x52a37c+0x1)+'/'+_0x23ad2d+_0x32b000(0x143);},'onRoundComplete':(_0x12cce7,_0x3816e7,_0xb883d2)=>{const _0x4fde3e=_0x530df6,_0x9bb5e2=formatElapsed(_0x3816e7);_0xb883d2?console[_0x4fde3e(0x17d)](_0x4fde3e(0x149)+(_0x12cce7+0x1)+'/'+_0x3e7fd5[_0x4fde3e(0x187)][_0x4fde3e(0x16c)]+_0x4fde3e(0x156)+a5_0x10f466[_0x4fde3e(0x137)]('✓')+'\x20('+_0x9bb5e2+')'):console['log'](_0x4fde3e(0x149)+(_0x12cce7+0x1)+'/'+_0x3e7fd5[_0x4fde3e(0x187)][_0x4fde3e(0x16c)]+_0x4fde3e(0x156)+a5_0x10f466[_0x4fde3e(0x12b)]('✗'));},'onEvaluationStart':()=>{const _0x3245d1=_0x530df6;_0x2b068a['text']=_0x3245d1(0x133);},'onEvaluationComplete':_0x4a4a09=>{const _0x41777e=_0x530df6,_0x10dcdd=formatElapsed(_0x4a4a09);console[_0x41777e(0x17d)](_0x41777e(0x171)+a5_0x10f466[_0x41777e(0x137)]('✓')+'\x20('+_0x10dcdd+')');}});_0x2b068a[_0x530df6(0x19f)](),_0x5b993b['push'](_0x594da7),_0x54e09e[_0x530df6(0x1a7)](_0x12dab5);if(_0x594da7[_0x530df6(0x164)]===_0x530df6(0x188))console['log'](a5_0x10f466[_0x530df6(0x137)](_0x530df6(0x15c)+_0x594da7[_0x530df6(0x159)]));else _0x594da7['status']===_0x530df6(0x15d)?console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x126)+_0x594da7['reason'])):console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x14c)+_0x594da7['reason']));_0x594da7[_0x530df6(0x13e)]&&console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x120)](_0x530df6(0x12a)+_0x594da7[_0x530df6(0x13e)])),console['log']();}catch(_0x49d69b){_0x2b068a[_0x530df6(0x19f)]();const _0x3c0aa2=_0x49d69b instanceof Error?_0x49d69b['message']:String(_0x49d69b);console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x14c)+_0x3c0aa2)),console[_0x530df6(0x17d)](),_0x5b993b[_0x530df6(0x1a7)]({'name':_0x3e7fd5[_0x530df6(0x15f)],'status':'ERROR','reason':_0x3c0aa2,'timestamp':new Date()[_0x530df6(0x168)](),'duration_ms':0x0});}}const _0x5b8dc4=Date[_0x530df6(0x14b)]()-_0x500800,_0x2a9557=_0x5b993b['filter'](_0x44e974=>_0x44e974['status']===_0x530df6(0x188))[_0x530df6(0x16c)],_0x3b45af=_0x5b993b[_0x530df6(0x1ac)](_0x4364a2=>_0x4364a2[_0x530df6(0x164)]===_0x530df6(0x15d))[_0x530df6(0x16c)],_0x1814fb=_0x5b993b[_0x530df6(0x1ac)](_0x3a6675=>_0x3a6675[_0x530df6(0x164)]===_0x530df6(0x183))[_0x530df6(0x16c)];console[_0x530df6(0x17d)]('━'[_0x530df6(0x128)](0x3c)),console[_0x530df6(0x17d)](_0x530df6(0x189)),console[_0x530df6(0x17d)]('━'[_0x530df6(0x128)](0x3c)),console[_0x530df6(0x17d)](_0x530df6(0x150)+_0x5b993b[_0x530df6(0x16c)]),console[_0x530df6(0x17d)]('Passed:\x20\x20\x20'+a5_0x10f466[_0x530df6(0x137)](_0x2a9557)),console['log']('Failed:\x20\x20\x20'+a5_0x10f466[_0x530df6(0x12b)](_0x3b45af));_0x1814fb>0x0&&console[_0x530df6(0x17d)](_0x530df6(0x16b)+a5_0x10f466[_0x530df6(0x12b)](_0x1814fb));console['log'](_0x530df6(0x184)+formatElapsed(_0x5b8dc4)),console[_0x530df6(0x17d)]('━'[_0x530df6(0x128)](0x3c));const _0x19e116=_0x5b993b['filter'](_0x2496c0=>_0x2496c0[_0x530df6(0x164)]!==_0x530df6(0x188));if(_0x19e116[_0x530df6(0x16c)]>0x0){console[_0x530df6(0x17d)](),console['log'](_0x530df6(0x1ad));for(const _0x4b7d9a of _0x19e116){const _0x58e01d=a5_0x10f466[_0x530df6(0x12b)]('✗'),_0x32a41c=_0x4b7d9a[_0x530df6(0x159)][_0x530df6(0x16c)]>0x32?_0x4b7d9a[_0x530df6(0x159)][_0x530df6(0x144)](0x0,0x32)+_0x530df6(0x19b):_0x4b7d9a[_0x530df6(0x159)];console[_0x530df6(0x17d)]('\x20\x20'+_0x58e01d+'\x20'+_0x4b7d9a['name']+':\x20'+_0x32a41c);}}const _0x10be97={'summary':{'total':_0x5b993b[_0x530df6(0x16c)],'passed':_0x2a9557,'failed':_0x3b45af,'errors':_0x1814fb>0x0?_0x1814fb:undefined,'duration_ms':_0x5b8dc4},'tests':_0x5b993b,'agent':{'project':_0x3dabfb[_0x530df6(0x13a)],'name':_0x3dabfb[_0x530df6(0x1a9)],'site':_0x499cce},'timestamp':new Date(_0x500800)['toISOString']()};try{const _0x4c6808=buildCachedTestRun(_0x54e09e,{'site':_0x499cce,'projectId':_0x21d113,'projectName':_0x3dabfb[_0x530df6(0x13a)],'agentId':_0x15842d,'agentName':_0x3dabfb['agentName'],'testYmlPath':a5_0x5d6cf2[_0x530df6(0x18c)](_0x3dabfb[_0x530df6(0x141)])});saveLastTestRun(_0x4c6808);}catch{}if(_0xd863f4!=='table'||_0x4e420d){const _0x2282ce=formatResults(_0x10be97,_0xd863f4);if(_0x4e420d)try{a5_0x8b428c[_0x530df6(0x13f)](_0x4e420d,_0x2282ce,_0x530df6(0x199)),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x120)](_0x530df6(0x16a)+_0x4e420d));}catch(_0x47b658){return console['log'](),console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)]('Error\x20writing\x20output\x20file:\x20'+_0x47b658)),0x1;}else console[_0x530df6(0x17d)](),console['log'](_0x2282ce);}return _0x19e116['length']>0x0?0x1:0x0;}async[a5_0x5ec6a5(0x160)](_0x1335cc,_0x2524fa){const _0x1b82b0=a5_0x5ec6a5,{options:_0x40402e,tdx:_0x35ccb2}=_0x1335cc,{definition:_0xead0a2,agentInfo:_0x37bdaa,outputFormat:_0x556475,outputFile:_0x49d664}=_0x2524fa,_0x5172e7=_0x40402e[_0x1b82b0(0x16e)],_0x15155e=loadLastTestRun();if(!_0x15155e)return console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x16f))),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x162))),0x1;if(_0x15155e[_0x1b82b0(0x1a1)][_0x1b82b0(0x1a9)]!==_0x37bdaa[_0x1b82b0(0x1a9)])return console[_0x1b82b0(0x17d)](a5_0x10f466['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x15155e['agent'][_0x1b82b0(0x1a9)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x37bdaa[_0x1b82b0(0x1a9)]+'\x22.')),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x1a2))),0x1;const _0x5371b5=new Set(_0x15155e['conversations'][_0x1b82b0(0x148)](_0x4b1b4b=>_0x4b1b4b[_0x1b82b0(0x186)])),_0x2065f4=_0xead0a2[_0x1b82b0(0x19e)][_0x1b82b0(0x1ac)](_0x36242e=>!_0x5371b5[_0x1b82b0(0x142)](_0x36242e[_0x1b82b0(0x15f)]));if(_0x2065f4['length']>0x0&&_0x15155e[_0x1b82b0(0x16e)]!==_0x5172e7)return console['log'](a5_0x10f466['red'](_0x1b82b0(0x176))),console['log'](a5_0x10f466['dim'](_0x1b82b0(0x146)+_0x15155e[_0x1b82b0(0x16e)]+_0x1b82b0(0x139)+_0x5172e7+'\x22.')),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x130)+_0x15155e['site']+_0x1b82b0(0x1a3))),0x1;const _0x2f945c=_0xead0a2[_0x1b82b0(0x19e)][_0x1b82b0(0x1ac)](_0x14f37d=>_0x5371b5[_0x1b82b0(0x142)](_0x14f37d[_0x1b82b0(0x15f)])),_0x2c9a7d=_0x2065f4;let _0x3c0b13;try{_0x3c0b13=await setupEvaluatorAgent(_0x35ccb2[_0x1b82b0(0x157)],_0x40402e['verbose']);}catch(_0x3714ed){const _0x1bae9c=_0x3714ed instanceof Error?_0x3714ed[_0x1b82b0(0x18e)]:String(_0x3714ed);return console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x1af)+_0x1bae9c)),0x1;}console['log'](a5_0x10f466[_0x1b82b0(0x190)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1b82b0(0x17d)](_0x1b82b0(0x195)+a5_0x10f466[_0x1b82b0(0x1a6)](_0x15155e[_0x1b82b0(0x122)])),console[_0x1b82b0(0x17d)](_0x1b82b0(0x147)+a5_0x10f466['white'](_0x15155e['agent']['projectName']+'/'+_0x15155e[_0x1b82b0(0x1a1)]['agentName']));_0x2c9a7d['length']>0x0&&console[_0x1b82b0(0x17d)](_0x1b82b0(0x121)+a5_0x10f466['yellow'](_0x2c9a7d[_0x1b82b0(0x16c)]));console[_0x1b82b0(0x17d)]();const _0x3ddc4e=[],_0x8f283d=Date[_0x1b82b0(0x14b)](),_0x3d76f9=createCommandSpinner(_0x1b82b0(0x172));if(_0x2f945c[_0x1b82b0(0x16c)]>0x0)try{const _0x21f378=await reevaluateFromCache(_0x35ccb2[_0x1b82b0(0x157)],_0x15155e,{'tests':_0x2f945c},{'evaluatorId':_0x3c0b13,'onTestStart':(_0x365a1d,_0x1c7e4d,_0x30934f)=>{const _0x2676cb=_0x1b82b0;_0x3d76f9['text']=_0x2676cb(0x13d)+(_0x1c7e4d+0x1)+'/'+_0x30934f+':\x20'+_0x365a1d+_0x2676cb(0x19b);if(!_0x3d76f9[_0x2676cb(0x14a)])_0x3d76f9[_0x2676cb(0x18b)]();},'onTestComplete':(_0x35ab86,_0x4a56b7)=>{const _0x628b65=_0x1b82b0;_0x3d76f9[_0x628b65(0x19f)]();if(_0x4a56b7[_0x628b65(0x164)]==='PASS')console[_0x628b65(0x17d)](a5_0x10f466[_0x628b65(0x137)](_0x628b65(0x15c)+_0x35ab86)+a5_0x10f466[_0x628b65(0x120)]('\x20(cached)'));else _0x4a56b7['status']===_0x628b65(0x15d)?console['log'](a5_0x10f466['red']('✗\x20FAIL:\x20'+_0x35ab86+'\x20-\x20'+_0x4a56b7['reason'])+a5_0x10f466['dim']('\x20(cached)')):console[_0x628b65(0x17d)](a5_0x10f466[_0x628b65(0x12b)]('✗\x20ERROR:\x20'+_0x35ab86+_0x628b65(0x19c)+_0x4a56b7[_0x628b65(0x159)]));_0x4a56b7[_0x628b65(0x13e)]&&console[_0x628b65(0x17d)](a5_0x10f466[_0x628b65(0x120)](_0x628b65(0x166)+_0x4a56b7[_0x628b65(0x13e)])),_0x3ddc4e[_0x628b65(0x1a7)](_0x4a56b7);},'onTestSkipped':(_0xf786f7,_0x3b5003)=>{const _0x3543db=_0x1b82b0;_0x3d76f9[_0x3543db(0x19f)](),console[_0x3543db(0x17d)](a5_0x10f466['yellow'](_0x3543db(0x193)+_0xf786f7+'\x20-\x20'+_0x3b5003));}});for(const _0x32338f of _0x21f378){!_0x3ddc4e[_0x1b82b0(0x163)](_0x98a7c7=>_0x98a7c7[_0x1b82b0(0x15f)]===_0x32338f[_0x1b82b0(0x15f)])&&_0x3ddc4e[_0x1b82b0(0x1a7)](_0x32338f);}}catch(_0x160eda){_0x3d76f9[_0x1b82b0(0x19f)]();const _0x2154f0=_0x160eda instanceof Error?_0x160eda[_0x1b82b0(0x18e)]:String(_0x160eda);return console['log'](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x13b)+_0x2154f0)),0x1;}_0x3d76f9[_0x1b82b0(0x19f)]();if(_0x2c9a7d['length']>0x0){console['log'](),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x190)]('Executing\x20new\x20tests...'));const {projectId:_0x43e3b8,agentId:_0x44e7bb}=_0x15155e['agent'];for(const _0x337e3f of _0x2c9a7d){console['log'](_0x1b82b0(0x12c)+a5_0x10f466[_0x1b82b0(0x1a6)](_0x337e3f['name']));const _0x5dc10b=createCommandSpinner('Round\x201/'+_0x337e3f['rounds'][_0x1b82b0(0x16c)]+_0x1b82b0(0x143));_0x5dc10b['start']();try{const {result:_0x593d5e}=await runTest(_0x35ccb2['llm'],_0x337e3f,{'agentId':_0x44e7bb,'projectId':_0x43e3b8,'site':_0x15155e[_0x1b82b0(0x16e)],'noEval':![],'evaluatorId':_0x3c0b13,'onRoundStart':(_0x23e45d,_0x63aea0)=>{const _0x3de2c2=_0x1b82b0;_0x5dc10b[_0x3de2c2(0x154)]=_0x3de2c2(0x161)+(_0x23e45d+0x1)+'/'+_0x63aea0+_0x3de2c2(0x143);},'onRoundComplete':(_0x2f3c77,_0xbd4629,_0x2313a)=>{const _0x438999=_0x1b82b0,_0x3c5729=formatElapsed(_0xbd4629);_0x2313a?console[_0x438999(0x17d)]('\x20\x20Round\x20'+(_0x2f3c77+0x1)+'/'+_0x337e3f['rounds'][_0x438999(0x16c)]+_0x438999(0x156)+a5_0x10f466['green']('✓')+'\x20('+_0x3c5729+')'):console[_0x438999(0x17d)](_0x438999(0x149)+(_0x2f3c77+0x1)+'/'+_0x337e3f['rounds']['length']+_0x438999(0x156)+a5_0x10f466[_0x438999(0x12b)]('✗'));},'onEvaluationStart':()=>{const _0x56a4b7=_0x1b82b0;_0x5dc10b['text']=_0x56a4b7(0x133);},'onEvaluationComplete':_0x3f69d3=>{const _0x8b93ea=_0x1b82b0,_0x59f9ff=formatElapsed(_0x3f69d3);console[_0x8b93ea(0x17d)](_0x8b93ea(0x171)+a5_0x10f466[_0x8b93ea(0x137)]('✓')+'\x20('+_0x59f9ff+')');}});_0x5dc10b[_0x1b82b0(0x19f)](),_0x3ddc4e['push'](_0x593d5e);if(_0x593d5e[_0x1b82b0(0x164)]===_0x1b82b0(0x188))console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x137)](_0x1b82b0(0x15c)+_0x593d5e[_0x1b82b0(0x159)])+a5_0x10f466[_0x1b82b0(0x120)]('\x20(new)'));else _0x593d5e[_0x1b82b0(0x164)]===_0x1b82b0(0x15d)?console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x126)+_0x593d5e[_0x1b82b0(0x159)])+a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x14d))):console[_0x1b82b0(0x17d)](a5_0x10f466['red'](_0x1b82b0(0x14c)+_0x593d5e['reason']));_0x593d5e[_0x1b82b0(0x13e)]&&console[_0x1b82b0(0x17d)](a5_0x10f466['dim'](_0x1b82b0(0x166)+_0x593d5e['conversation_url']));}catch(_0x3203f3){_0x5dc10b['stop']();const _0x20600c=_0x3203f3 instanceof Error?_0x3203f3[_0x1b82b0(0x18e)]:String(_0x3203f3);console['log'](a5_0x10f466['red'](_0x1b82b0(0x14c)+_0x20600c)),_0x3ddc4e[_0x1b82b0(0x1a7)]({'name':_0x337e3f[_0x1b82b0(0x15f)],'status':_0x1b82b0(0x183),'reason':_0x20600c,'timestamp':new Date()[_0x1b82b0(0x168)](),'duration_ms':0x0});}}}console[_0x1b82b0(0x17d)]();const _0xd076e8=Date[_0x1b82b0(0x14b)]()-_0x8f283d,_0x5d4c00=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x8cc89c=>_0x8cc89c[_0x1b82b0(0x164)]===_0x1b82b0(0x188))[_0x1b82b0(0x16c)],_0x4f0788=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x2b0630=>_0x2b0630[_0x1b82b0(0x164)]===_0x1b82b0(0x15d))['length'],_0x2d72c6=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x9f7c3c=>_0x9f7c3c[_0x1b82b0(0x164)]===_0x1b82b0(0x183))[_0x1b82b0(0x16c)];console[_0x1b82b0(0x17d)]('━'[_0x1b82b0(0x128)](0x3c)),console[_0x1b82b0(0x17d)]('Re-evaluation\x20Summary'),console[_0x1b82b0(0x17d)]('━'[_0x1b82b0(0x128)](0x3c)),console[_0x1b82b0(0x17d)](_0x1b82b0(0x150)+_0x3ddc4e[_0x1b82b0(0x16c)]),console[_0x1b82b0(0x17d)]('Passed:\x20\x20\x20'+a5_0x10f466[_0x1b82b0(0x137)](_0x5d4c00)),console[_0x1b82b0(0x17d)](_0x1b82b0(0x174)+a5_0x10f466[_0x1b82b0(0x12b)](_0x4f0788));_0x2d72c6>0x0&&console[_0x1b82b0(0x17d)](_0x1b82b0(0x16b)+a5_0x10f466[_0x1b82b0(0x12b)](_0x2d72c6));console[_0x1b82b0(0x17d)]('Duration:\x20'+formatElapsed(_0xd076e8)),console[_0x1b82b0(0x17d)]('━'[_0x1b82b0(0x128)](0x3c));const _0x30b0cf={'summary':{'total':_0x3ddc4e[_0x1b82b0(0x16c)],'passed':_0x5d4c00,'failed':_0x4f0788,'errors':_0x2d72c6>0x0?_0x2d72c6:undefined,'duration_ms':_0xd076e8},'tests':_0x3ddc4e,'agent':{'project':_0x37bdaa['projectName'],'name':_0x37bdaa[_0x1b82b0(0x1a9)],'site':_0x5172e7},'timestamp':new Date(_0x8f283d)[_0x1b82b0(0x168)]()};if(_0x556475!=='table'||_0x49d664){const _0x4e873f=formatResults(_0x30b0cf,_0x556475);if(_0x49d664)try{a5_0x8b428c[_0x1b82b0(0x13f)](_0x49d664,_0x4e873f,'utf-8'),console['log'](),console[_0x1b82b0(0x17d)](a5_0x10f466['dim'](_0x1b82b0(0x16a)+_0x49d664));}catch(_0x1d69f6){return console[_0x1b82b0(0x17d)](),console[_0x1b82b0(0x17d)](a5_0x10f466['red'](_0x1b82b0(0x167)+_0x1d69f6)),0x1;}else console[_0x1b82b0(0x17d)](),console[_0x1b82b0(0x17d)](_0x4e873f);}const _0x5ebeb9=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x2d5f7e=>_0x2d5f7e[_0x1b82b0(0x164)]!==_0x1b82b0(0x188));return _0x5ebeb9['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2953bf=a5_0x3dd2;(function(_0x17ea45,_0x2ebb2b){const _0xf3d512=a5_0x3dd2,_0x1d200d=_0x17ea45();while(!![]){try{const _0xee40ad=parseInt(_0xf3d512(0x218))/0x1*(-parseInt(_0xf3d512(0x225))/0x2)+-parseInt(_0xf3d512(0x231))/0x3*(parseInt(_0xf3d512(0x1d7))/0x4)+-parseInt(_0xf3d512(0x1f4))/0x5*(-parseInt(_0xf3d512(0x1cf))/0x6)+parseInt(_0xf3d512(0x237))/0x7+parseInt(_0xf3d512(0x1d5))/0x8+-parseInt(_0xf3d512(0x1f2))/0x9+-parseInt(_0xf3d512(0x22c))/0xa*(parseInt(_0xf3d512(0x23a))/0xb);if(_0xee40ad===_0x2ebb2b)break;else _0x1d200d['push'](_0x1d200d['shift']());}catch(_0x1c02ba){_0x1d200d['push'](_0x1d200d['shift']());}}}(a5_0x57df,0x81e00));import*as a5_0x47fc09 from'node:fs';import*as a5_0x46291d from'node:path';function a5_0x57df(){const _0x1d8ae4=['status','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','name','resolve','context','basename','red','includes','✓\x20PASS:\x20','...\x20','conversation_url','llmProject','json','table','testYmlPath','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20(cached)','Error\x20writing\x20output\x20file:\x20','\x20\x20Evaluating...\x20','Passed:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Project\x20path:\x20','\x20-\x20','...','ERROR','resolveAgentId','existsSync','filter','cyan','FAIL','\x22:\x20','found','no_context','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','now','message','177534GrBeAK','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','tsv','conversations','\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)','✗\x20ERROR:\x20','5595832jDREsK','eval','68HBuCdG','Conversation\x20URL:\x20','toLowerCase','length','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','dim','execute','stop','no_tests','testName','Running\x20test:\x20','404','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','agentName','has','Evaluating\x20response...','Re-evaluating...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','llm','repeat','\x20\x20Agent:\x20',':\x20Sending\x20user\x20input...','/<agent-name>','size','tags','\x20\x20Round\x20','PASS','6090822WtAqZL','text','150zLkTFb','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Test\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','projectDir','✗\x20FAIL:\x20','Tests\x20found:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20(new)','reeval','Test\x20Configuration:','agent:test','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','rounds','agent','timestamp','round','Run\x20\x27tdx\x20agent\x20pull\x20','test.yml','Round\x20','writeFileSync','Cached\x20run\x20is\x20from\x20site\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','jsonl','Re-evaluation\x20Summary','Executing\x20new\x20tests...','\x20\x20Project:\x20','start','Running:\x20','output','Agent:\x20','push','\x20\x20Conversation:\x20','tests','\x20\x20Site:\x20','Site:\x20','1862xlPURU','forEach','Either\x20switch\x20to\x20the\x20\x22','map','Failed\x20Tests:','toISOString','Errors:\x20\x20\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Output\x20written\x20to:\x20','white','log','Running\x20agent\x20tests...','split','54tdfKkt','not\x20found','join','Duration:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x22,\x20but\x20current\x20site\x20is\x20\x22','verbose','3747510vokTGQ','No\x20tests\x20found\x20matching:\x20','New\x20tests\x20to\x20execute:\x20','⚠\x20SKIPPED:\x20','No\x20tests\x20have\x20tags\x20defined.','15612SefljF','yellow','Failed:\x20\x20\x20','add','\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','Round\x201/','945490EFilsp','site','utf-8','11wTCtPC','green','Re-evaluating\x20','Total:\x20\x20\x20\x20','executeReeval','projectName','Using\x20agent:\x20','reason'];a5_0x57df=function(){return _0x1d8ae4;};return a5_0x57df();}import a5_0xf9e0d5 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x3dd2(_0x2851e7,_0x23b723){_0x2851e7=_0x2851e7-0x1c3;const _0x57df41=a5_0x57df();let _0x3dd2cf=_0x57df41[_0x2851e7];return _0x3dd2cf;}export class AgentTestCommand extends BaseCommand{['name']=a5_0x2953bf(0x1ff);['description']=a5_0x2953bf(0x1f7);async[a5_0x2953bf(0x1dd)](_0x977772){const _0x3a62b0=a5_0x2953bf,{options:_0x1829ce,args:_0x1957ab,tdx:_0x2aa328}=_0x977772,_0x23d909=_0x1957ab[0x0]||'.',_0x3505ed=_0x1829ce['dryRun'],_0x13a50a=_0x1829ce,_0x95155a=_0x13a50a[_0x3a62b0(0x1d6)]===![],_0x191aa9=_0x13a50a[_0x3a62b0(0x1fd)],_0x2db77b=_0x13a50a[_0x3a62b0(0x244)],_0x1f95ca=_0x13a50a[_0x3a62b0(0x1ef)],_0xd8d34c=_0x1829ce[_0x3a62b0(0x238)],_0x444805=_0x13a50a[_0x3a62b0(0x211)];if(_0x191aa9&&_0x95155a)return console['log'](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1e8))),0x1;let _0x11df7d=_0x3a62b0(0x24f);if(_0x13a50a[_0x3a62b0(0x24e)])_0x11df7d=_0x3a62b0(0x24e);else{if(_0x13a50a['jsonl'])_0x11df7d=_0x3a62b0(0x20b);else{if(_0x13a50a[_0x3a62b0(0x1d1)])_0x11df7d=_0x3a62b0(0x1d1);else{if(_0x13a50a[_0x3a62b0(0x24f)])_0x11df7d=_0x3a62b0(0x24f);}}}const _0x76cbfd=_0x13a50a[_0x3a62b0(0x24d)];let _0x3dba63=_0x23d909;const _0x2ec65a=a5_0x47fc09[_0x3a62b0(0x1c5)](_0x23d909),_0x1305b8=_0x23d909==='.';if(!_0x2ec65a||_0x1305b8){const _0x4620fb=resolveProjectFromContext(_0x23d909,_0x76cbfd,{'requireFile':_0x3a62b0(0x206)});if(_0x4620fb[_0x3a62b0(0x1ca)])_0x3dba63=_0x4620fb[_0x3a62b0(0x1f8)],_0x4620fb['source']===_0x3a62b0(0x246)&&console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x3a62b0(0x240)+_0x3dba63));else switch(_0x4620fb['reason']){case _0x3a62b0(0x1cb):console[_0x3a62b0(0x222)](a5_0xf9e0d5['yellow'](_0x4620fb['message'])),console['log'](),console[_0x3a62b0(0x222)]('Usage:'),console['log'](_0x3a62b0(0x235)),console[_0x3a62b0(0x222)](_0x3a62b0(0x1d3)),console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x3a62b0(0x243));return 0x1;case'no_local_folder':console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x232)](_0x4620fb[_0x3a62b0(0x1ce)])),console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x3a62b0(0x205)+_0x4620fb[_0x3a62b0(0x24d)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x44e159=a5_0x46291d[_0x3a62b0(0x247)](_0x4620fb['projectDir']);console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x232)](_0x3a62b0(0x1f5)+_0x4620fb[_0x3a62b0(0x24d)]+'\x22:'));for(const _0x274c1b of _0x4620fb['agentDirs']){console[_0x3a62b0(0x222)]('\x20\x20-\x20'+_0x274c1b);}return console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x3a62b0(0x21f)+_0x44e159+_0x3a62b0(0x1ed)),0x1;}case _0x3a62b0(0x1df):console['log'](a5_0xf9e0d5[_0x3a62b0(0x232)](_0x3a62b0(0x20a)+_0x4620fb[_0x3a62b0(0x24d)]+'\x22.')),console[_0x3a62b0(0x222)](a5_0xf9e0d5['dim'](_0x3a62b0(0x259)+_0x4620fb[_0x3a62b0(0x1f8)])),console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x5eb08c,agentInfo:_0x904a01}=parseTestFile(_0x3dba63);let _0x55f6cd=_0x5eb08c[_0x3a62b0(0x215)];if(_0x2db77b){const _0x1aaf96=_0x2db77b[_0x3a62b0(0x224)](',')[_0x3a62b0(0x21b)](_0x5198fd=>_0x5198fd['trim']());_0x55f6cd=_0x5eb08c[_0x3a62b0(0x215)]['filter'](_0x21cf61=>_0x1aaf96['includes'](_0x21cf61[_0x3a62b0(0x244)]));if(_0x55f6cd['length']===0x0)return console[_0x3a62b0(0x222)](a5_0xf9e0d5['yellow'](_0x3a62b0(0x22d)+_0x2db77b)),console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)]('Available\x20tests:\x20'+_0x5eb08c['tests']['map'](_0x25cc60=>_0x25cc60['name'])[_0x3a62b0(0x227)](',\x20'))),0x1;}if(_0x1f95ca){const _0x59e41f=_0x1f95ca['split'](',')['map'](_0x4c044a=>_0x4c044a['trim']()[_0x3a62b0(0x1d9)]());_0x55f6cd=_0x55f6cd[_0x3a62b0(0x1c6)](_0x48847b=>_0x48847b[_0x3a62b0(0x1ef)]?.['some'](_0x5a7266=>_0x59e41f['includes'](_0x5a7266[_0x3a62b0(0x1d9)]())));if(_0x55f6cd[_0x3a62b0(0x1da)]===0x0){console['log'](a5_0xf9e0d5['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1f95ca));const _0x45a8b5=new Set();return _0x5eb08c[_0x3a62b0(0x215)][_0x3a62b0(0x219)](_0x596df8=>_0x596df8[_0x3a62b0(0x1ef)]?.['forEach'](_0x21f47e=>_0x45a8b5[_0x3a62b0(0x234)](_0x21f47e))),_0x45a8b5[_0x3a62b0(0x1ee)]>0x0?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)]('Available\x20tags:\x20'+[..._0x45a8b5][_0x3a62b0(0x227)](',\x20'))):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x3a62b0(0x230))),0x1;}}if(_0x191aa9)return this['executeReeval'](_0x977772,{'definition':{'tests':_0x55f6cd},'agentInfo':_0x904a01,'outputFormat':_0x11df7d,'outputFile':_0x444805,'testNames':_0x2db77b});if(_0x3505ed){console[_0x3a62b0(0x222)](a5_0xf9e0d5['cyan'](_0x3a62b0(0x1fe))),console[_0x3a62b0(0x222)](_0x3a62b0(0x216)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0xd8d34c)),console[_0x3a62b0(0x222)](_0x3a62b0(0x20e)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x904a01[_0x3a62b0(0x23f)])),console[_0x3a62b0(0x222)](_0x3a62b0(0x1eb)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x904a01[_0x3a62b0(0x1e4)])),console[_0x3a62b0(0x222)](),console['log'](_0x3a62b0(0x1fa)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x55f6cd[_0x3a62b0(0x1da)]));for(let _0x3ec889=0x0;_0x3ec889<_0x55f6cd[_0x3a62b0(0x1da)];_0x3ec889++){const _0x57f31c=_0x55f6cd[_0x3ec889],_0x33dc25=_0x57f31c[_0x3a62b0(0x201)]['length']===0x1?_0x3a62b0(0x204):_0x3a62b0(0x201),_0x43a152=_0x57f31c[_0x3a62b0(0x1ef)]?.[_0x3a62b0(0x1da)]?'\x20['+_0x57f31c[_0x3a62b0(0x1ef)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x3ec889+0x1)+'.\x20'+a5_0xf9e0d5['white'](_0x57f31c[_0x3a62b0(0x244)])+'\x20('+_0x57f31c[_0x3a62b0(0x201)]['length']+'\x20'+_0x33dc25+')'+a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x43a152));}return 0x0;}let _0x25aaec,_0x4bbdbc;try{_0x25aaec=await _0x2aa328[_0x3a62b0(0x1e9)]['resolveProjectId'](_0x904a01['projectName']);}catch(_0x2a4d26){const _0x493980=_0x2a4d26 instanceof Error?_0x2a4d26[_0x3a62b0(0x1ce)]:String(_0x2a4d26);return _0x493980[_0x3a62b0(0x249)](_0x3a62b0(0x1e2))||_0x493980[_0x3a62b0(0x1d9)]()['includes'](_0x3a62b0(0x226))?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x258)+_0x904a01[_0x3a62b0(0x23f)])):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x229)+_0x904a01['projectName']+'\x22:\x20'+_0x493980)),0x1;}try{_0x4bbdbc=await _0x2aa328[_0x3a62b0(0x1e9)][_0x3a62b0(0x1c4)](_0x904a01[_0x3a62b0(0x1e4)],_0x25aaec);}catch(_0x48f78b){const _0x132092=_0x48f78b instanceof Error?_0x48f78b[_0x3a62b0(0x1ce)]:String(_0x48f78b);return _0x132092[_0x3a62b0(0x249)](_0x3a62b0(0x1e2))||_0x132092[_0x3a62b0(0x1d9)]()[_0x3a62b0(0x249)](_0x3a62b0(0x226))?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1cc)+_0x904a01[_0x3a62b0(0x1e4)])):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x253)+_0x904a01[_0x3a62b0(0x1e4)]+_0x3a62b0(0x1c9)+_0x132092)),0x1;}let _0x586340;if(!_0x95155a)try{_0x586340=await setupEvaluatorAgent(_0x2aa328[_0x3a62b0(0x1e9)],_0x1829ce[_0x3a62b0(0x22b)]);}catch(_0x425556){const _0x1111e9=_0x425556 instanceof Error?_0x425556[_0x3a62b0(0x1ce)]:String(_0x425556);return console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x252)+_0x1111e9)),0x1;}console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1c7)](_0x3a62b0(0x223))),console[_0x3a62b0(0x222)](_0x3a62b0(0x217)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0xd8d34c)),console[_0x3a62b0(0x222)]('Agent:\x20'+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x904a01[_0x3a62b0(0x23f)]+'/'+_0x904a01['agentName'])),console[_0x3a62b0(0x222)]();const _0x20072f=[],_0x4fb6fd=[],_0x3b633a=Date['now']();for(let _0x508e3b=0x0;_0x508e3b<_0x55f6cd[_0x3a62b0(0x1da)];_0x508e3b++){const _0x3abd0b=_0x55f6cd[_0x508e3b];_0x55f6cd['length']>0x1?console[_0x3a62b0(0x222)](_0x3a62b0(0x1f6)+(_0x508e3b+0x1)+'/'+_0x55f6cd[_0x3a62b0(0x1da)]+':\x20'+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x3abd0b[_0x3a62b0(0x244)])):console[_0x3a62b0(0x222)](_0x3a62b0(0x1e1)+a5_0xf9e0d5[_0x3a62b0(0x221)](_0x3abd0b['name']));const _0x5854d3=createCommandSpinner(_0x3a62b0(0x236)+_0x3abd0b['rounds'][_0x3a62b0(0x1da)]+_0x3a62b0(0x1ec));_0x5854d3[_0x3a62b0(0x20f)]();try{const {result:_0x1ca414,conversation:_0x4552cd}=await runTest(_0x2aa328['llm'],_0x3abd0b,{'agentId':_0x4bbdbc,'projectId':_0x25aaec,'site':_0xd8d34c,'noEval':_0x95155a,'evaluatorId':_0x586340,'onRoundStart':(_0x37cf29,_0x1cee49)=>{const _0x33ef4a=_0x3a62b0;_0x5854d3['text']=_0x33ef4a(0x207)+(_0x37cf29+0x1)+'/'+_0x1cee49+_0x33ef4a(0x1ec);},'onRoundComplete':(_0x461046,_0x403351,_0x1a59eb)=>{const _0x45f562=_0x3a62b0,_0x23b6d7=formatElapsed(_0x403351);_0x1a59eb?console['log'](_0x45f562(0x1f0)+(_0x461046+0x1)+'/'+_0x3abd0b[_0x45f562(0x201)][_0x45f562(0x1da)]+_0x45f562(0x24b)+a5_0xf9e0d5['green']('✓')+'\x20('+_0x23b6d7+')'):console[_0x45f562(0x222)](_0x45f562(0x1f0)+(_0x461046+0x1)+'/'+_0x3abd0b[_0x45f562(0x201)]['length']+_0x45f562(0x24b)+a5_0xf9e0d5[_0x45f562(0x248)]('✗'));},'onEvaluationStart':()=>{const _0x23d033=_0x3a62b0;_0x5854d3[_0x23d033(0x1f3)]=_0x23d033(0x1e6);},'onEvaluationComplete':_0x4f209b=>{const _0x1a52ea=_0x3a62b0,_0x204a31=formatElapsed(_0x4f209b);console[_0x1a52ea(0x222)](_0x1a52ea(0x256)+a5_0xf9e0d5[_0x1a52ea(0x23b)]('✓')+'\x20('+_0x204a31+')');}});_0x5854d3[_0x3a62b0(0x1de)](),_0x20072f[_0x3a62b0(0x213)](_0x1ca414),_0x4fb6fd[_0x3a62b0(0x213)](_0x4552cd);if(_0x1ca414[_0x3a62b0(0x242)]===_0x3a62b0(0x1f1))console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x23b)](_0x3a62b0(0x24a)+_0x1ca414[_0x3a62b0(0x241)]));else _0x1ca414[_0x3a62b0(0x242)]===_0x3a62b0(0x1c8)?console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1f9)+_0x1ca414[_0x3a62b0(0x241)])):console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1d4)+_0x1ca414[_0x3a62b0(0x241)]));_0x1ca414[_0x3a62b0(0x24c)]&&console[_0x3a62b0(0x222)](a5_0xf9e0d5[_0x3a62b0(0x1dc)](_0x3a62b0(0x1d8)+_0x1ca414[_0x3a62b0(0x24c)])),console['log']();}catch(_0xe57db4){_0x5854d3[_0x3a62b0(0x1de)]();const _0x99d3cf=_0xe57db4 instanceof Error?_0xe57db4[_0x3a62b0(0x1ce)]:String(_0xe57db4);console['log'](a5_0xf9e0d5[_0x3a62b0(0x248)](_0x3a62b0(0x1d4)+_0x99d3cf)),console[_0x3a62b0(0x222)](),_0x20072f['push']({'name':_0x3abd0b['name'],'status':_0x3a62b0(0x1c3),'reason':_0x99d3cf,'timestamp':new Date()[_0x3a62b0(0x21d)](),'duration_ms':0x0});}}const _0x1992dd=Date[_0x3a62b0(0x1cd)]()-_0x3b633a,_0x2f0ff1=_0x20072f[_0x3a62b0(0x1c6)](_0x2acc5c=>_0x2acc5c[_0x3a62b0(0x242)]===_0x3a62b0(0x1f1))[_0x3a62b0(0x1da)],_0x59abda=_0x20072f['filter'](_0x2a6de3=>_0x2a6de3['status']==='FAIL')['length'],_0x416e83=_0x20072f[_0x3a62b0(0x1c6)](_0x47a589=>_0x47a589[_0x3a62b0(0x242)]===_0x3a62b0(0x1c3))['length'];console[_0x3a62b0(0x222)]('━'[_0x3a62b0(0x1ea)](0x3c)),console[_0x3a62b0(0x222)]('Test\x20Summary'),console[_0x3a62b0(0x222)]('━'[_0x3a62b0(0x1ea)](0x3c)),console[_0x3a62b0(0x222)](_0x3a62b0(0x23d)+_0x20072f[_0x3a62b0(0x1da)]),console['log'](_0x3a62b0(0x257)+a5_0xf9e0d5[_0x3a62b0(0x23b)](_0x2f0ff1)),console[_0x3a62b0(0x222)](_0x3a62b0(0x233)+a5_0xf9e0d5[_0x3a62b0(0x248)](_0x59abda));_0x416e83>0x0&&console[_0x3a62b0(0x222)](_0x3a62b0(0x21e)+a5_0xf9e0d5[_0x3a62b0(0x248)](_0x416e83));console['log'](_0x3a62b0(0x228)+formatElapsed(_0x1992dd)),console[_0x3a62b0(0x222)]('━'[_0x3a62b0(0x1ea)](0x3c));const _0x1d0d5e=_0x20072f['filter'](_0x3a2f15=>_0x3a2f15[_0x3a62b0(0x242)]!==_0x3a62b0(0x1f1));if(_0x1d0d5e[_0x3a62b0(0x1da)]>0x0){console['log'](),console['log'](_0x3a62b0(0x21c));for(const _0x5f519a of _0x1d0d5e){const _0x246101=a5_0xf9e0d5[_0x3a62b0(0x248)]('✗'),_0x51f124=_0x5f519a['reason'][_0x3a62b0(0x1da)]>0x32?_0x5f519a[_0x3a62b0(0x241)]['substring'](0x0,0x32)+_0x3a62b0(0x25b):_0x5f519a['reason'];console[_0x3a62b0(0x222)]('\x20\x20'+_0x246101+'\x20'+_0x5f519a[_0x3a62b0(0x244)]+':\x20'+_0x51f124);}}const _0x32f69={'summary':{'total':_0x20072f[_0x3a62b0(0x1da)],'passed':_0x2f0ff1,'failed':_0x59abda,'errors':_0x416e83>0x0?_0x416e83:undefined,'duration_ms':_0x1992dd},'tests':_0x20072f,'agent':{'project':_0x904a01['projectName'],'name':_0x904a01[_0x3a62b0(0x1e4)],'site':_0xd8d34c},'timestamp':new Date(_0x3b633a)[_0x3a62b0(0x21d)]()};try{const _0x2110da=buildCachedTestRun(_0x4fb6fd,{'site':_0xd8d34c,'projectId':_0x25aaec,'projectName':_0x904a01[_0x3a62b0(0x23f)],'agentId':_0x4bbdbc,'agentName':_0x904a01['agentName'],'testYmlPath':a5_0x46291d[_0x3a62b0(0x245)](_0x904a01[_0x3a62b0(0x250)])});saveLastTestRun(_0x2110da);}catch{}if(_0x11df7d!==_0x3a62b0(0x24f)||_0x444805){const _0x9a77eb=formatResults(_0x32f69,_0x11df7d);if(_0x444805)try{a5_0x47fc09[_0x3a62b0(0x208)](_0x444805,_0x9a77eb,_0x3a62b0(0x239)),console[_0x3a62b0(0x222)](),console['log'](a5_0xf9e0d5['dim'](_0x3a62b0(0x220)+_0x444805));}catch(_0x2b69cc){return console['log'](),console[_0x3a62b0(0x222)](a5_0xf9e0d5['red']('Error\x20writing\x20output\x20file:\x20'+_0x2b69cc)),0x1;}else console[_0x3a62b0(0x222)](),console[_0x3a62b0(0x222)](_0x9a77eb);}return _0x1d0d5e[_0x3a62b0(0x1da)]>0x0?0x1:0x0;}async[a5_0x2953bf(0x23e)](_0x5796c6,_0xb56818){const _0x553228=a5_0x2953bf,{options:_0x47f881,tdx:_0x2fc7f0}=_0x5796c6,{definition:_0x52acd9,agentInfo:_0x1a64d6,outputFormat:_0x235333,outputFile:_0x128d7a}=_0xb56818,_0x2ec1bc=_0x47f881[_0x553228(0x238)],_0x1a2fbf=loadLastTestRun();if(!_0x1a2fbf)return console['log'](a5_0xf9e0d5['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x1e3))),0x1;if(_0x1a2fbf['agent'][_0x553228(0x1e4)]!==_0x1a64d6[_0x553228(0x1e4)])return console['log'](a5_0xf9e0d5['red'](_0x553228(0x1db)+_0x1a2fbf['agent'][_0x553228(0x1e4)]+_0x553228(0x1fb)+_0x1a64d6[_0x553228(0x1e4)]+'\x22.')),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x200))),0x1;const _0x23915c=new Set(_0x1a2fbf[_0x553228(0x1d2)][_0x553228(0x21b)](_0x1901fd=>_0x1901fd[_0x553228(0x1e0)])),_0xfda62d=_0x52acd9[_0x553228(0x215)][_0x553228(0x1c6)](_0x38decd=>!_0x23915c[_0x553228(0x1e5)](_0x38decd[_0x553228(0x244)]));if(_0xfda62d[_0x553228(0x1da)]>0x0&&_0x1a2fbf[_0x553228(0x238)]!==_0x2ec1bc)return console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x248)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x209)+_0x1a2fbf[_0x553228(0x238)]+_0x553228(0x22a)+_0x2ec1bc+'\x22.')),console[_0x553228(0x222)](a5_0xf9e0d5['dim'](_0x553228(0x21a)+_0x1a2fbf[_0x553228(0x238)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x15e5d2=_0x52acd9[_0x553228(0x215)]['filter'](_0x334db1=>_0x23915c[_0x553228(0x1e5)](_0x334db1[_0x553228(0x244)])),_0x330697=_0xfda62d;let _0x3d186d;try{_0x3d186d=await setupEvaluatorAgent(_0x2fc7f0[_0x553228(0x1e9)],_0x47f881[_0x553228(0x22b)]);}catch(_0x33fa0f){const _0x219086=_0x33fa0f instanceof Error?_0x33fa0f['message']:String(_0x33fa0f);return console[_0x553228(0x222)](a5_0xf9e0d5['red'](_0x553228(0x252)+_0x219086)),0x1;}console['log'](a5_0xf9e0d5[_0x553228(0x1c7)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x553228(0x222)](_0x553228(0x251)+a5_0xf9e0d5[_0x553228(0x221)](_0x1a2fbf[_0x553228(0x203)])),console[_0x553228(0x222)](_0x553228(0x212)+a5_0xf9e0d5[_0x553228(0x221)](_0x1a2fbf[_0x553228(0x202)][_0x553228(0x23f)]+'/'+_0x1a2fbf[_0x553228(0x202)][_0x553228(0x1e4)]));_0x330697[_0x553228(0x1da)]>0x0&&console[_0x553228(0x222)](_0x553228(0x22e)+a5_0xf9e0d5[_0x553228(0x232)](_0x330697[_0x553228(0x1da)]));console[_0x553228(0x222)]();const _0x5ae37b=[],_0x148530=Date[_0x553228(0x1cd)](),_0x4e6508=createCommandSpinner(_0x553228(0x1e7));if(_0x15e5d2[_0x553228(0x1da)]>0x0)try{const _0x534174=await reevaluateFromCache(_0x2fc7f0['llm'],_0x1a2fbf,{'tests':_0x15e5d2},{'evaluatorId':_0x3d186d,'onTestStart':(_0x2d0d4c,_0x2dc60d,_0x31b420)=>{const _0x221a08=_0x553228;_0x4e6508['text']=_0x221a08(0x23c)+(_0x2dc60d+0x1)+'/'+_0x31b420+':\x20'+_0x2d0d4c+_0x221a08(0x25b);if(!_0x4e6508['isSpinning'])_0x4e6508[_0x221a08(0x20f)]();},'onTestComplete':(_0x38d5cc,_0x1cec43)=>{const _0x37fcb5=_0x553228;_0x4e6508['stop']();if(_0x1cec43[_0x37fcb5(0x242)]===_0x37fcb5(0x1f1))console[_0x37fcb5(0x222)](a5_0xf9e0d5['green'](_0x37fcb5(0x24a)+_0x38d5cc)+a5_0xf9e0d5[_0x37fcb5(0x1dc)](_0x37fcb5(0x254)));else _0x1cec43[_0x37fcb5(0x242)]===_0x37fcb5(0x1c8)?console[_0x37fcb5(0x222)](a5_0xf9e0d5[_0x37fcb5(0x248)](_0x37fcb5(0x1f9)+_0x38d5cc+_0x37fcb5(0x25a)+_0x1cec43[_0x37fcb5(0x241)])+a5_0xf9e0d5[_0x37fcb5(0x1dc)]('\x20(cached)')):console[_0x37fcb5(0x222)](a5_0xf9e0d5[_0x37fcb5(0x248)](_0x37fcb5(0x1d4)+_0x38d5cc+_0x37fcb5(0x25a)+_0x1cec43[_0x37fcb5(0x241)]));_0x1cec43['conversation_url']&&console[_0x37fcb5(0x222)](a5_0xf9e0d5[_0x37fcb5(0x1dc)](_0x37fcb5(0x214)+_0x1cec43[_0x37fcb5(0x24c)])),_0x5ae37b[_0x37fcb5(0x213)](_0x1cec43);},'onTestSkipped':(_0x2b5f4e,_0x4b32fe)=>{const _0x77d709=_0x553228;_0x4e6508['stop'](),console['log'](a5_0xf9e0d5[_0x77d709(0x232)](_0x77d709(0x22f)+_0x2b5f4e+_0x77d709(0x25a)+_0x4b32fe));}});for(const _0x17b9f5 of _0x534174){!_0x5ae37b['find'](_0x38215c=>_0x38215c['name']===_0x17b9f5[_0x553228(0x244)])&&_0x5ae37b[_0x553228(0x213)](_0x17b9f5);}}catch(_0x4546d1){_0x4e6508['stop']();const _0x541f54=_0x4546d1 instanceof Error?_0x4546d1[_0x553228(0x1ce)]:String(_0x4546d1);return console['log'](a5_0xf9e0d5[_0x553228(0x248)](_0x553228(0x1d0)+_0x541f54)),0x1;}_0x4e6508[_0x553228(0x1de)]();if(_0x330697[_0x553228(0x1da)]>0x0){console[_0x553228(0x222)](),console[_0x553228(0x222)](a5_0xf9e0d5['cyan'](_0x553228(0x20d)));const {projectId:_0x76dae8,agentId:_0x1cfba8}=_0x1a2fbf[_0x553228(0x202)];for(const _0x22f674 of _0x330697){console[_0x553228(0x222)](_0x553228(0x210)+a5_0xf9e0d5[_0x553228(0x221)](_0x22f674[_0x553228(0x244)]));const _0xc36ba4=createCommandSpinner(_0x553228(0x236)+_0x22f674[_0x553228(0x201)][_0x553228(0x1da)]+':\x20Sending\x20user\x20input...');_0xc36ba4['start']();try{const {result:_0x149a69}=await runTest(_0x2fc7f0[_0x553228(0x1e9)],_0x22f674,{'agentId':_0x1cfba8,'projectId':_0x76dae8,'site':_0x1a2fbf[_0x553228(0x238)],'noEval':![],'evaluatorId':_0x3d186d,'onRoundStart':(_0x4139a6,_0x12acbe)=>{const _0x22a189=_0x553228;_0xc36ba4[_0x22a189(0x1f3)]='Round\x20'+(_0x4139a6+0x1)+'/'+_0x12acbe+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x48933c,_0x5f43ea,_0x4890ed)=>{const _0x3becba=_0x553228,_0x5318ce=formatElapsed(_0x5f43ea);_0x4890ed?console[_0x3becba(0x222)](_0x3becba(0x1f0)+(_0x48933c+0x1)+'/'+_0x22f674[_0x3becba(0x201)][_0x3becba(0x1da)]+'...\x20'+a5_0xf9e0d5[_0x3becba(0x23b)]('✓')+'\x20('+_0x5318ce+')'):console[_0x3becba(0x222)](_0x3becba(0x1f0)+(_0x48933c+0x1)+'/'+_0x22f674[_0x3becba(0x201)][_0x3becba(0x1da)]+_0x3becba(0x24b)+a5_0xf9e0d5['red']('✗'));},'onEvaluationStart':()=>{const _0x1eec89=_0x553228;_0xc36ba4[_0x1eec89(0x1f3)]=_0x1eec89(0x1e6);},'onEvaluationComplete':_0x38569c=>{const _0x3bf347=_0x553228,_0x359802=formatElapsed(_0x38569c);console[_0x3bf347(0x222)](_0x3bf347(0x256)+a5_0xf9e0d5['green']('✓')+'\x20('+_0x359802+')');}});_0xc36ba4[_0x553228(0x1de)](),_0x5ae37b[_0x553228(0x213)](_0x149a69);if(_0x149a69[_0x553228(0x242)]===_0x553228(0x1f1))console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x23b)](_0x553228(0x24a)+_0x149a69['reason'])+a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x1fc)));else _0x149a69[_0x553228(0x242)]===_0x553228(0x1c8)?console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x248)]('✗\x20FAIL:\x20'+_0x149a69[_0x553228(0x241)])+a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x1fc))):console['log'](a5_0xf9e0d5[_0x553228(0x248)](_0x553228(0x1d4)+_0x149a69['reason']));_0x149a69[_0x553228(0x24c)]&&console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x214)+_0x149a69[_0x553228(0x24c)]));}catch(_0x4c3aea){_0xc36ba4[_0x553228(0x1de)]();const _0x503f04=_0x4c3aea instanceof Error?_0x4c3aea[_0x553228(0x1ce)]:String(_0x4c3aea);console[_0x553228(0x222)](a5_0xf9e0d5['red'](_0x553228(0x1d4)+_0x503f04)),_0x5ae37b[_0x553228(0x213)]({'name':_0x22f674[_0x553228(0x244)],'status':_0x553228(0x1c3),'reason':_0x503f04,'timestamp':new Date()[_0x553228(0x21d)](),'duration_ms':0x0});}}}console[_0x553228(0x222)]();const _0x33de0c=Date['now']()-_0x148530,_0x4434a8=_0x5ae37b[_0x553228(0x1c6)](_0x23ec93=>_0x23ec93[_0x553228(0x242)]===_0x553228(0x1f1))[_0x553228(0x1da)],_0x9e50b2=_0x5ae37b['filter'](_0x3233d9=>_0x3233d9[_0x553228(0x242)]===_0x553228(0x1c8))[_0x553228(0x1da)],_0x34e6c9=_0x5ae37b[_0x553228(0x1c6)](_0xc6feee=>_0xc6feee[_0x553228(0x242)]===_0x553228(0x1c3))[_0x553228(0x1da)];console['log']('━'[_0x553228(0x1ea)](0x3c)),console['log'](_0x553228(0x20c)),console[_0x553228(0x222)]('━'[_0x553228(0x1ea)](0x3c)),console['log'](_0x553228(0x23d)+_0x5ae37b[_0x553228(0x1da)]),console['log'](_0x553228(0x257)+a5_0xf9e0d5[_0x553228(0x23b)](_0x4434a8)),console[_0x553228(0x222)]('Failed:\x20\x20\x20'+a5_0xf9e0d5[_0x553228(0x248)](_0x9e50b2));_0x34e6c9>0x0&&console[_0x553228(0x222)]('Errors:\x20\x20\x20'+a5_0xf9e0d5[_0x553228(0x248)](_0x34e6c9));console['log'](_0x553228(0x228)+formatElapsed(_0x33de0c)),console['log']('━'[_0x553228(0x1ea)](0x3c));const _0x3c9469={'summary':{'total':_0x5ae37b[_0x553228(0x1da)],'passed':_0x4434a8,'failed':_0x9e50b2,'errors':_0x34e6c9>0x0?_0x34e6c9:undefined,'duration_ms':_0x33de0c},'tests':_0x5ae37b,'agent':{'project':_0x1a64d6[_0x553228(0x23f)],'name':_0x1a64d6[_0x553228(0x1e4)],'site':_0x2ec1bc},'timestamp':new Date(_0x148530)[_0x553228(0x21d)]()};if(_0x235333!=='table'||_0x128d7a){const _0x266e51=formatResults(_0x3c9469,_0x235333);if(_0x128d7a)try{a5_0x47fc09[_0x553228(0x208)](_0x128d7a,_0x266e51,'utf-8'),console[_0x553228(0x222)](),console['log'](a5_0xf9e0d5[_0x553228(0x1dc)](_0x553228(0x220)+_0x128d7a));}catch(_0x2383db){return console[_0x553228(0x222)](),console[_0x553228(0x222)](a5_0xf9e0d5[_0x553228(0x248)](_0x553228(0x255)+_0x2383db)),0x1;}else console['log'](),console[_0x553228(0x222)](_0x266e51);}const _0x4ce779=_0x5ae37b[_0x553228(0x1c6)](_0xa541f2=>_0xa541f2['status']!=='PASS');return _0x4ce779[_0x553228(0x1da)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x1ffbe7=a6_0x1fa7;function a6_0x1fa7(_0x23e32e,_0x58aba9){_0x23e32e=_0x23e32e-0x6c;const _0x50fd2e=a6_0x50fd();let _0x1fa710=_0x50fd2e[_0x23e32e];return _0x1fa710;}(function(_0x4f8a28,_0x1931bb){const _0x616ac1=a6_0x1fa7,_0x59ab80=_0x4f8a28();while(!![]){try{const _0x2cd27b=-parseInt(_0x616ac1(0x71))/0x1+parseInt(_0x616ac1(0x77))/0x2+-parseInt(_0x616ac1(0x7b))/0x3*(parseInt(_0x616ac1(0x86))/0x4)+parseInt(_0x616ac1(0x82))/0x5*(-parseInt(_0x616ac1(0x75))/0x6)+parseInt(_0x616ac1(0xaa))/0x7*(parseInt(_0x616ac1(0xa7))/0x8)+-parseInt(_0x616ac1(0x81))/0x9+parseInt(_0x616ac1(0x8c))/0xa;if(_0x2cd27b===_0x1931bb)break;else _0x59ab80['push'](_0x59ab80['shift']());}catch(_0x24f8f7){_0x59ab80['push'](_0x59ab80['shift']());}}}(a6_0x50fd,0x88a7c));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x1ffbe7(0x8f),'proxy-authorization',a6_0x1ffbe7(0x83),'set-cookie',a6_0x1ffbe7(0xa2),a6_0x1ffbe7(0x78),a6_0x1ffbe7(0x7a),a6_0x1ffbe7(0x79)]);function isSensitiveHeader(_0x348493){const _0x56550e=a6_0x1ffbe7;return SENSITIVE_HEADERS[_0x56550e(0xb0)](_0x348493[_0x56550e(0xae)]());}function parseHeader(_0x41d32b){const _0x526a22=a6_0x1ffbe7,_0x2edd4c=_0x41d32b[_0x526a22(0xa8)](':');if(_0x2edd4c===-0x1)throw new Error(_0x526a22(0x91)+_0x41d32b+_0x526a22(0xa3)+_0x526a22(0x96));const _0x5a7d27=_0x41d32b[_0x526a22(0xab)](0x0,_0x2edd4c)[_0x526a22(0xa5)](),_0x2baa70=_0x41d32b[_0x526a22(0xab)](_0x2edd4c+0x1)[_0x526a22(0xa5)]();if(!_0x5a7d27)throw new Error(_0x526a22(0x93)+_0x41d32b+'\x22');return[_0x5a7d27,_0x2baa70];}function a6_0x50fd(){const _0x36fa12=['x-xsrf-token','x-trino-user','x-auth-token','84663prkVAc','GET','readBodyFromFile','Invalid\x20API\x20type:\x20','headers','stack','3900600PQbGyZ','133220lIrZts','cookie','type','validate','28PmxhRS','status','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','includes','length','toUpperCase','18123120mPiLoP','output','.\x20Valid\x20methods:\x20','authorization','entries','Invalid\x20header\x20format:\x20\x22','Endpoint\x20must\x20start\x20with\x20/:\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','.\x20Valid\x20types:\x20','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','method','color','execute','llm','file','trino','error','data','PATCH','<\x20HTTP/1.1\x20','startsWith','set-cookie2','\x22.\x20','Invalid\x20HTTP\x20method:\x20','trim','workflow','992likYdD','indexOf','llm-proxy','10759mfQOsV','substring','keys','api','toLowerCase','log','has','cdp','Error:\x20','site','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','join','115397ABLFzq','request','PUT','verbose','174kGWrdc','header','151720tjYKqI'];a6_0x50fd=function(){return _0x36fa12;};return a6_0x50fd();}export class ApiCommand extends BaseCommand{['name']=a6_0x1ffbe7(0xad);['description']=a6_0x1ffbe7(0x6f);[a6_0x1ffbe7(0x85)](_0x1d0da4){const _0x50da2c=a6_0x1ffbe7,{args:_0x14596a,options:_0x4ec5aa}=_0x1d0da4,_0x50f5d4=_0x4ec5aa;if(_0x14596a[_0x50da2c(0x8a)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2bc73e=_0x14596a[0x0];if(!_0x2bc73e[_0x50da2c(0xa1)]('/'))return _0x50da2c(0x92)+_0x2bc73e;const _0x2d4f9a=_0x50f5d4[_0x50da2c(0x9e)],_0x23da54=_0x50f5d4[_0x50da2c(0x9b)];if(_0x2d4f9a&&_0x23da54)return _0x50da2c(0x88);const _0x5a3204=_0x50f5d4[_0x50da2c(0x97)]||_0x50da2c(0x7c),_0x18df07=[_0x50da2c(0x7c),'POST',_0x50da2c(0x73),'DELETE',_0x50da2c(0x9f)];if(!_0x18df07[_0x50da2c(0x89)](_0x5a3204[_0x50da2c(0x8b)]()))return _0x50da2c(0xa4)+_0x5a3204+_0x50da2c(0x8e)+_0x18df07[_0x50da2c(0x70)](',\x20');const _0x26b875=_0x50f5d4['type']||'td',_0x6fe775=['td',_0x50da2c(0x6c),_0x50da2c(0xa6),_0x50da2c(0x9c),_0x50da2c(0x9a),_0x50da2c(0xa9)];if(!_0x6fe775[_0x50da2c(0x89)](_0x26b875))return _0x50da2c(0x7e)+_0x26b875+_0x50da2c(0x94)+_0x6fe775['join'](',\x20');return undefined;}async[a6_0x1ffbe7(0x99)](_0x4c1e6f){const _0x54fe9=a6_0x1ffbe7,{options:_0x5fae8c,args:_0x53cd2d,tdx:_0x6693e2}=_0x4c1e6f,_0x82801e=_0x5fae8c,_0x5a3cc2=_0x53cd2d[0x0],_0x240257=(_0x82801e[_0x54fe9(0x97)]||_0x54fe9(0x7c))[_0x54fe9(0x8b)](),_0x174d4f=_0x82801e[_0x54fe9(0x9e)],_0x153782=_0x82801e[_0x54fe9(0x9b)],_0x31f62b=_0x82801e[_0x54fe9(0x76)],_0x529a01=_0x82801e[_0x54fe9(0x84)]||'td';try{const _0x5f2060={};if(_0x31f62b){const _0x44a56d=Array['isArray'](_0x31f62b)?_0x31f62b:[_0x31f62b];for(const _0x3205a0 of _0x44a56d){const [_0x3d033b,_0x5e4595]=parseHeader(_0x3205a0);_0x5f2060[_0x3d033b]=_0x5e4595;}}let _0xc9de15;if(_0x174d4f)_0xc9de15=_0x174d4f;else{if(_0x153782)try{_0xc9de15=RawAPI[_0x54fe9(0x7d)](_0x153782);}catch(_0x1dc19b){return console[_0x54fe9(0x9d)]('Error:\x20'+(_0x1dc19b instanceof Error?_0x1dc19b['message']:String(_0x1dc19b))),0x1;}}const _0x229da5={'method':_0x240257,'apiType':_0x529a01,'includeHeaders':_0x5fae8c[_0x54fe9(0x74)]};_0xc9de15&&(_0x229da5['body']=_0xc9de15);Object[_0x54fe9(0xac)](_0x5f2060)['length']>0x0&&(_0x229da5[_0x54fe9(0x7f)]=_0x5f2060);if(_0x5fae8c[_0x54fe9(0x74)]){const _0x4080e4=resolveSite(_0x5fae8c[_0x54fe9(0x6e)]),_0x6f215c=getEndpoint(_0x4080e4,_0x529a01),_0x512771=''+_0x6f215c+_0x5a3cc2;console[_0x54fe9(0x9d)]('>\x20'+_0x240257+'\x20'+_0x512771);const _0x4ae070=getAuthHeaders(_0x4080e4),_0x128bf3={..._0x4ae070,..._0x5f2060};for(const [_0x1a0bf1,_0x332b76]of Object[_0x54fe9(0x90)](_0x128bf3)){!isSensitiveHeader(_0x1a0bf1)&&console[_0x54fe9(0x9d)]('>\x20'+_0x1a0bf1+':\x20'+_0x332b76);}_0xc9de15&&console['error']('>'),console[_0x54fe9(0x9d)]('');}const _0x5e08b8=await _0x6693e2[_0x54fe9(0xad)][_0x54fe9(0x72)](_0x5a3cc2,_0x229da5);if(_0x5fae8c[_0x54fe9(0x74)]&&_0x5e08b8[_0x54fe9(0x7f)]){console[_0x54fe9(0x9d)](_0x54fe9(0xa0)+_0x5e08b8[_0x54fe9(0x87)]);for(const [_0x5be709,_0x5d6a2c]of Object[_0x54fe9(0x90)](_0x5e08b8[_0x54fe9(0x7f)])){!isSensitiveHeader(_0x5be709)&&console[_0x54fe9(0x9d)]('<\x20'+_0x5be709+':\x20'+_0x5d6a2c);}console[_0x54fe9(0x9d)]('');}const _0x20f6ae=Boolean(_0x5fae8c[_0x54fe9(0x8d)]),_0x444488={'color':_0x5fae8c[_0x54fe9(0x98)],'noColor':_0x5fae8c['noColor']||_0x20f6ae&&!_0x5fae8c[_0x54fe9(0x98)]},_0x108e57=colorizeJSON(_0x5e08b8[_0x54fe9(0x9e)],_0x444488);return _0x5fae8c[_0x54fe9(0x8d)]?(writeFileSync(_0x5fae8c['output'],_0x108e57),console[_0x54fe9(0x9d)](_0x54fe9(0x95)+_0x5fae8c[_0x54fe9(0x8d)])):console[_0x54fe9(0xaf)](_0x108e57),0x0;}catch(_0x40827f){return _0x40827f instanceof Error?(console[_0x54fe9(0x9d)](_0x54fe9(0x6d)+_0x40827f['message']),_0x5fae8c[_0x54fe9(0x74)]&&_0x40827f[_0x54fe9(0x80)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x40827f[_0x54fe9(0x80)])):console[_0x54fe9(0x9d)]('Error:\x20'+String(_0x40827f)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x331faf=a7_0x25b1;(function(_0x1e3d0e,_0x41c024){const _0x475806=a7_0x25b1,_0x43a8d5=_0x1e3d0e();while(!![]){try{const _0x5845e6=parseInt(_0x475806(0xbd))/0x1+parseInt(_0x475806(0xb5))/0x2*(-parseInt(_0x475806(0x9a))/0x3)+parseInt(_0x475806(0x94))/0x4+-parseInt(_0x475806(0xa3))/0x5*(parseInt(_0x475806(0xcf))/0x6)+parseInt(_0x475806(0xcb))/0x7*(-parseInt(_0x475806(0xad))/0x8)+-parseInt(_0x475806(0xc4))/0x9*(parseInt(_0x475806(0xa4))/0xa)+parseInt(_0x475806(0xc6))/0xb*(parseInt(_0x475806(0xd1))/0xc);if(_0x5845e6===_0x41c024)break;else _0x43a8d5['push'](_0x43a8d5['shift']());}catch(_0x40fbed){_0x43a8d5['push'](_0x43a8d5['shift']());}}}(a7_0x3c56,0x9702b));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x25b1(_0xc098b0,_0x4a7463){_0xc098b0=_0xc098b0-0x81;const _0x3c56f0=a7_0x3c56();let _0x25b178=_0x3c56f0[_0xc098b0];return _0x25b178;}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{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x43b301 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_0x334d3d from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x331faf(0xb4);[a7_0x331faf(0x9f)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x331faf(0xd0)](_0x5b86a5){const _0x4ec9a3=a7_0x331faf,{options:_0x184269}=_0x5b86a5,_0x31e6c7=_0x184269[_0x4ec9a3(0x98)];console[_0x4ec9a3(0xae)](a7_0x334d3d[_0x4ec9a3(0x93)](_0x4ec9a3(0xc7)));const _0x4a170c=_0x184269[_0x4ec9a3(0xb3)]||_0x4ec9a3(0xa1),_0x1ae82e=await promptSiteSelection(_0x4a170c,_0x31e6c7,_0x4ec9a3(0xb1));if(!_0x1ae82e)return 0x1;const _0xaff597=resolveSite(_0x1ae82e);if(isOAuthSupported(_0xaff597)){const _0xe77a6=await a7_0x43b301({'type':_0x4ec9a3(0x81),'name':_0x4ec9a3(0x91),'message':_0x4ec9a3(0xc8),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0x4ec9a3(0xbf)},{'title':'API\x20Key','value':_0x4ec9a3(0xa5)}]});if(!_0xe77a6[_0x4ec9a3(0x91)])return console[_0x4ec9a3(0xae)](_0x4ec9a3(0x86)),0x1;if(_0xe77a6[_0x4ec9a3(0x91)]===_0x4ec9a3(0xbf))return await runOAuthLoginFlow(_0xaff597,_0x31e6c7,_0x184269[_0x4ec9a3(0xaf)]??LogLevel[_0x4ec9a3(0xb0)]),0x0;}console['log'](_0x4ec9a3(0xa8)+_0xaff597),console[_0x4ec9a3(0xae)](_0x4ec9a3(0x83)),console[_0x4ec9a3(0xae)]('\x20\x20'+getConsoleUrl(_0xaff597,_0x4ec9a3(0xca)));const _0x1b11b4=await a7_0x43b301({'type':_0x4ec9a3(0xc5),'name':_0x4ec9a3(0xac),'message':_0x4ec9a3(0xa9),'validate':_0x4be146=>{const _0x13370b=_0x4ec9a3;if(!_0x4be146||!_0x4be146[_0x13370b(0xc1)]())return _0x13370b(0x89);return!![];}});if(!_0x1b11b4[_0x4ec9a3(0xac)])return console[_0x4ec9a3(0xae)]('\x0aSetup\x20cancelled'),0x1;const _0x101e39=_0x1b11b4[_0x4ec9a3(0xac)];console[_0x4ec9a3(0xae)]('Validating\x20API\x20key...');try{const _0x3d71e0=TDX[_0x4ec9a3(0x96)]({'site':_0xaff597,'apiKey':_0x101e39[_0x4ec9a3(0xc1)](),'logLevel':_0x184269['logLevel']??LogLevel[_0x4ec9a3(0xb0)]}),_0x2154d3=await _0x3d71e0[_0x4ec9a3(0x8b)][_0x4ec9a3(0x9c)]();console[_0x4ec9a3(0xae)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x2154d3[_0x4ec9a3(0xcd)]+')');const _0x58be9e=await isKeychainAvailable();_0x58be9e?(await saveAPIKeyAsync(_0x101e39[_0x4ec9a3(0xc1)](),_0xaff597,_0x31e6c7),console[_0x4ec9a3(0xae)](_0x4ec9a3(0xc9)+(_0x31e6c7?_0x4ec9a3(0x9d)+_0x31e6c7+')':''))):(console[_0x4ec9a3(0x8c)](a7_0x334d3d[_0x4ec9a3(0x8e)](_0x4ec9a3(0x99))),console[_0x4ec9a3(0x8c)](a7_0x334d3d['yellow'](_0x4ec9a3(0xc2))));if(_0x31e6c7){const _0x53345f={'site':_0xaff597};saveProfileToUserConfig(_0x31e6c7,_0x53345f),console[_0x4ec9a3(0xae)]('✓\x20Profile\x20\x27'+_0x31e6c7+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0xaff597),console[_0x4ec9a3(0xae)](_0x4ec9a3(0xba)+_0xaff597);const _0x2d23e8=_0x31e6c7?_0x4ec9a3(0xbe)+_0x31e6c7:'';return console[_0x4ec9a3(0xae)](),console[_0x4ec9a3(0xae)](_0x4ec9a3(0x85)),console[_0x4ec9a3(0xae)](_0x4ec9a3(0x8d)+_0x2d23e8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x4ec9a3(0xae)](_0x4ec9a3(0x8d)+_0x2d23e8+_0x4ec9a3(0x84)),0x0;}catch(_0x420ec0){if(_0x420ec0 instanceof HTTPClientError&&_0x420ec0['status']===0x191)return printAuthError(_0x420ec0),0x1;return console[_0x4ec9a3(0x92)](a7_0x334d3d[_0x4ec9a3(0xa0)](_0x4ec9a3(0x8f)+(_0x420ec0 instanceof Error?_0x420ec0[_0x4ec9a3(0xa6)]:String(_0x420ec0)))),console[_0x4ec9a3(0x92)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x331faf(0xa7)]=a7_0x331faf(0x90);[a7_0x331faf(0x9f)]=a7_0x331faf(0x9b);async['execute'](_0x3d1539){const _0x52e7e4=a7_0x331faf,{options:_0x25a316,tdx:_0xa0ae4f}=_0x3d1539,_0x14cdf3=_0x25a316[_0x52e7e4(0xb3)],_0x31b091=_0x25a316[_0x52e7e4(0x98)],_0x262467=_0x31b091?_0x31b091:'N/A';console[_0x52e7e4(0xae)](_0x52e7e4(0xaa)+_0x262467+_0x52e7e4(0xbb)+_0x14cdf3+')');const _0x506f5d=await getOAuthTokens(_0x31b091);if(_0x506f5d)console[_0x52e7e4(0xae)]('Credential\x20type:\x20OAuth'),console[_0x52e7e4(0xae)](_0x52e7e4(0xb2)+(_0x31b091?_0x52e7e4(0x9d)+_0x31b091+')':''));else{const _0x53e352=await resolveAPIKeyAsync(_0x14cdf3,_0x31b091);if(_0x53e352){const {source:_0x2da38a,isDeprecated:_0x298993}=_0x53e352,_0x41f32f=_0x52e7e4(0xb8)+_0x2da38a;console['log'](_0x298993?a7_0x334d3d[_0x52e7e4(0x8e)](_0x41f32f):_0x41f32f);}else console[_0x52e7e4(0xae)](a7_0x334d3d[_0x52e7e4(0x8e)]('No\x20credential\x20found'));}try{const _0x1afa4e=await _0xa0ae4f['jobs']['getUserInfo']();return console[_0x52e7e4(0xae)](a7_0x334d3d['green'](_0x52e7e4(0xa2))),console[_0x52e7e4(0xae)](_0x52e7e4(0x9e)+_0x1afa4e['email']),(_0x1afa4e['first_name']||_0x1afa4e[_0x52e7e4(0x87)])&&console['log']('Name:\x20'+[_0x1afa4e[_0x52e7e4(0xce)],_0x1afa4e[_0x52e7e4(0x87)]][_0x52e7e4(0xbc)](Boolean)[_0x52e7e4(0xb7)]('\x20')),0x0;}catch(_0x5736c8){return _0x5736c8 instanceof HTTPClientError&&_0x5736c8[_0x52e7e4(0x8a)]===0x191?printAuthError(_0x5736c8,!![],_0x31b091):console[_0x52e7e4(0x92)](a7_0x334d3d[_0x52e7e4(0xa0)](_0x52e7e4(0x8f)+(_0x5736c8 instanceof Error?_0x5736c8[_0x52e7e4(0xa6)]:String(_0x5736c8)))),0x1;}}}function a7_0x3c56(){const _0x33b77a=['status','jobs','warn','\x20\x20tdx','yellow','✗\x20Validation\x20failed:\x20','auth','method','error','bold','1668228srrhNy','tdx:\x20auth\x20clear','create','OAuth\x20tokens','profile','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','3PAZRMW','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','getUserInfo','\x20(profile:\x20','User:\x20','description','red','us01','✓\x20Authentication\x20successful\x0a','2330vwbhQD','10VAqtDt','apikey','message','name','Setting\x20up\x20authentication\x20for\x20site:\x20','Enter\x20your\x20TD\x20API\x20key:','tdx\x20profile:\x20','all','apiKey','2032FFLFCH','log','logLevel','ERROR','Setup\x20cancelled','Read\x20credential\x20from\x20keychain','site','auth:setup','814844ZmQNXl','API\x20key','join','Read\x20credential\x20from\x20','\x20for\x20profile:\x20','✓\x20Default\x20site\x20set\x20to\x20','\x20(site:\x20','filter','550848dfMMNX','\x20--profile\x20','oauth','\x20and\x20','trim','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','auth:clear','4680846vrcWeX','password','154KugAcd','tdx:\x20auth\x20setup','Choose\x20authentication\x20method:','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','/app/mp/ak','21651ArAKIV','System\x20keychain\x20is\x20not\x20available','email','first_name','5454DwKtyv','execute','1532028jDGdnZ','select','\x20removed\x20from\x20keychain','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x0aSetup\x20cancelled','last_name','No\x20credentials\x20found\x20in\x20keychain','API\x20key\x20cannot\x20be\x20empty'];a7_0x3c56=function(){return _0x33b77a;};return a7_0x3c56();}export class AuthClearCommand extends BaseCommand{[a7_0x331faf(0xa7)]=a7_0x331faf(0xc3);[a7_0x331faf(0x9f)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x331faf(0xd0)](_0x5f0831){const _0xc5d65e=a7_0x331faf,{options:_0x491d56}=_0x5f0831,_0x2115db=_0x491d56[_0xc5d65e(0x98)];console['log'](a7_0x334d3d[_0xc5d65e(0x93)](_0xc5d65e(0x95)));const _0x4d44f=await isKeychainAvailable();if(!_0x4d44f)return console['error'](a7_0x334d3d[_0xc5d65e(0xa0)](_0xc5d65e(0xcc))),0x1;const [_0x5ed12b,_0x5bf7a1]=await Promise[_0xc5d65e(0xab)]([deleteKeychainAPIKey(_0x2115db),deleteOAuthTokens(_0x2115db)]);if(_0x5ed12b||_0x5bf7a1){clearCredentialCache();const _0x45d115=[_0x5ed12b&&_0xc5d65e(0xb6),_0x5bf7a1&&_0xc5d65e(0x97)][_0xc5d65e(0xbc)](Boolean)[_0xc5d65e(0xb7)](_0xc5d65e(0xc0));return console[_0xc5d65e(0xae)]('✓\x20'+_0x45d115+_0xc5d65e(0x82)+(_0x2115db?_0xc5d65e(0x9d)+_0x2115db+')':'')),0x0;}else return console[_0xc5d65e(0xae)](_0xc5d65e(0x88)+(_0x2115db?_0xc5d65e(0xb9)+_0x2115db:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x1f3c3c=a8_0x2858;function a8_0x2858(_0x47448c,_0x169e8c){_0x47448c=_0x47448c-0xae;const _0x187f98=a8_0x187f();let _0x28581b=_0x187f98[_0x47448c];return _0x28581b;}(function(_0x5dbde3,_0x4c0bec){const _0x5fe41f=a8_0x2858,_0x5dcc39=_0x5dbde3();while(!![]){try{const _0x552c05=-parseInt(_0x5fe41f(0xcc))/0x1*(parseInt(_0x5fe41f(0xc9))/0x2)+-parseInt(_0x5fe41f(0xb8))/0x3+parseInt(_0x5fe41f(0xbb))/0x4*(-parseInt(_0x5fe41f(0xc0))/0x5)+parseInt(_0x5fe41f(0xd1))/0x6+parseInt(_0x5fe41f(0xc7))/0x7*(-parseInt(_0x5fe41f(0xd5))/0x8)+-parseInt(_0x5fe41f(0xc8))/0x9*(-parseInt(_0x5fe41f(0xb6))/0xa)+parseInt(_0x5fe41f(0xcd))/0xb*(parseInt(_0x5fe41f(0xc4))/0xc);if(_0x552c05===_0x4c0bec)break;else _0x5dcc39['push'](_0x5dcc39['shift']());}catch(_0x5c2c6d){_0x5dcc39['push'](_0x5dcc39['shift']());}}}(a8_0x187f,0xedce2));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';function a8_0x187f(){const _0x569aa2=['\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Opening\x20browser\x20for\x20authentication...','20wgOagK','\x27\x20registered','543696YMhEDi','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','ERROR','2859016bJkfMx','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','log','auth:login','name','5oZEmQw','Login\x20via\x20OAuth\x20(opens\x20browser)','logLevel','site','372WPOIWP','✓\x20Profile\x20\x27','Login\x20cancelled','1337DcCMst','2767518WNgLzE','1574YxPpzl','email','us01','671dNyKoW','892903FxwMod','✓\x20Authentication\x20successful\x20(User:\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','bold','1870242gVIwsT','\x20\x20tdx','green','getUserInfo','43768LpyVQs','jobs','execute','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Validating\x20OAuth\x20tokens...','description','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','profile'];a8_0x187f=function(){return _0x569aa2;};return a8_0x187f();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x555dcd from'chalk';export async function runOAuthLoginFlow(_0x24b386,_0x1c182e,_0x38c2a8){const _0x3d7c8a=a8_0x2858;if(!isOAuthSupported(_0x24b386))throw new Error(_0x3d7c8a(0xcf)+_0x24b386+'.\x20'+_0x3d7c8a(0xb2)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x1bd3c3=await isKeychainAvailable();if(!_0x1bd3c3)throw new Error(_0x3d7c8a(0xbc)+_0x3d7c8a(0xaf));const _0x5af53e=getConsoleUrl(_0x24b386);console[_0x3d7c8a(0xbd)](_0x3d7c8a(0xb5)),console[_0x3d7c8a(0xbd)]('\x20\x20'+_0x5af53e+'/oauth/authorize'),console[_0x3d7c8a(0xbd)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0xd395fa=await startOAuthFlow(_0x24b386);console[_0x3d7c8a(0xbd)](_0x3d7c8a(0xb0));const _0x419403=TDX['create']({'site':_0x24b386,'accessToken':_0xd395fa['access_token'],'logLevel':_0x38c2a8??LogLevel['ERROR']}),_0x53e490=await _0x419403[_0x3d7c8a(0xd6)][_0x3d7c8a(0xd4)]();console[_0x3d7c8a(0xbd)](a8_0x555dcd[_0x3d7c8a(0xd3)](_0x3d7c8a(0xce)+_0x53e490[_0x3d7c8a(0xca)]+')')),await saveOAuthTokens(_0xd395fa,_0x1c182e),console[_0x3d7c8a(0xbd)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x1c182e?'\x20(profile:\x20'+_0x1c182e+')':''));if(_0x1c182e){const _0x1edb63={'site':_0x24b386};saveProfileToUserConfig(_0x1c182e,_0x1edb63),console[_0x3d7c8a(0xbd)](_0x3d7c8a(0xc5)+_0x1c182e+_0x3d7c8a(0xb7));}const _0x4ae729=_0x1c182e?'\x20--profile\x20'+_0x1c182e:'';console['log'](),console[_0x3d7c8a(0xbd)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x3d7c8a(0xbd)](_0x3d7c8a(0xd2)+_0x4ae729+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x3d7c8a(0xd2)+_0x4ae729+_0x3d7c8a(0xb4));}export class AuthLoginCommand extends BaseCommand{[a8_0x1f3c3c(0xbf)]=a8_0x1f3c3c(0xbe);[a8_0x1f3c3c(0xb1)]=a8_0x1f3c3c(0xc1);async[a8_0x1f3c3c(0xae)](_0x24239d){const _0x567f09=a8_0x1f3c3c,{options:_0x3c86fd}=_0x24239d,_0x5d14c8=_0x3c86fd[_0x567f09(0xb3)];console['log'](a8_0x555dcd[_0x567f09(0xd0)]('tdx:\x20auth\x20login'));const _0x634efe=_0x3c86fd[_0x567f09(0xc3)]||_0x567f09(0xcb),_0x5bc40b=await promptSiteSelection(_0x634efe,_0x5d14c8,_0x567f09(0xc6));if(!_0x5bc40b)return 0x1;const _0xd3343a=resolveSite(_0x5bc40b);return console[_0x567f09(0xbd)](_0x567f09(0xb9)+_0xd3343a),await runOAuthLoginFlow(_0xd3343a,_0x5d14c8,_0x3c86fd[_0x567f09(0xc2)]??LogLevel[_0x567f09(0xba)]),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a9_0x5a827e=a9_0x5829;(function(_0x425735,_0x450670){const _0x4f06d6=a9_0x5829,_0x44e6d5=_0x425735();while(!![]){try{const _0x42a42c=parseInt(_0x4f06d6(0x1ea))/0x1*(-parseInt(_0x4f06d6(0x1e1))/0x2)+-parseInt(_0x4f06d6(0x1e3))/0x3*(-parseInt(_0x4f06d6(0x1c3))/0x4)+-parseInt(_0x4f06d6(0x1f2))/0x5*(-parseInt(_0x4f06d6(0x1f8))/0x6)+parseInt(_0x4f06d6(0x1d2))/0x7*(parseInt(_0x4f06d6(0x1df))/0x8)+parseInt(_0x4f06d6(0x1dd))/0x9*(parseInt(_0x4f06d6(0x1b1))/0xa)+parseInt(_0x4f06d6(0x1c2))/0xb+-parseInt(_0x4f06d6(0x1c7))/0xc;if(_0x42a42c===_0x450670)break;else _0x44e6d5['push'](_0x44e6d5['shift']());}catch(_0x4690d6){_0x44e6d5['push'](_0x44e6d5['shift']());}}}(a9_0x1cca,0x402dd));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x1d6a0a,_0x1f09c9){const _0x1180d6=a9_0x5829;if(_0x1d6a0a instanceof SDKError)console[_0x1180d6(0x1e5)]('Error:\x20'+_0x1d6a0a[_0x1180d6(0x1b5)]),_0x1f09c9['verbose']&&(_0x1d6a0a[_0x1180d6(0x1f6)]&&console[_0x1180d6(0x1e5)](_0x1180d6(0x1d3)+_0x1d6a0a[_0x1180d6(0x1f6)]),_0x1d6a0a[_0x1180d6(0x1c6)]&&(console[_0x1180d6(0x1e5)]('\x0aStack\x20trace:'),console[_0x1180d6(0x1e5)](_0x1d6a0a['stack'])));else throw _0x1d6a0a;}function a9_0x1cca(){const _0x258b07=['1521335mJulJI','projectId','getDefaultAgent','tool_call','cause','streamChatJsonl','6sruCXn','Resolving\x20agent\x20\x27','data','\x27...','Error:\x20Chat\x20session\x20\x27','llmAgent','26920doFsao','Continuing\x20chat:\x20','stream','\x27\x20not\x20found','message','404','write','llmProject','functionName','content','description','verbose','tool','join','stringify','done','getOrCreateDefaultAgent','3706351UaoMUe','165076NZHVio','args','options','stack','10559448SbFkFF','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Chat\x20session:\x20','includes','handleChatEvent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','claude-4.5-haiku','agentId','code','chat','resolveAgentId','20321BkHCsi','\x20\x20Cause:\x20','\x0aError:\x20','new','chatId','streamChat','llm','Create\x20a\x20new\x20chat\x20session','metadata','agent','resolveProjectId','882vPSiFQ','event','808vYLAtt','session\x20context','523482RojWkK','Getting\x20default\x20agent...','15gXNGHJ','type','error','slice','context','log','name','1fjWzfS','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','validate','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','execute','string','CHAT_NOT_FOUND','site'];a9_0x1cca=function(){return _0x258b07;};return a9_0x1cca();}function a9_0x5829(_0x5de84a,_0x30a25f){_0x5de84a=_0x5de84a-0x1af;const _0x1cca0e=a9_0x1cca();let _0x5829cf=_0x1cca0e[_0x5de84a];return _0x5829cf;}async function resolveAgentId(_0x34d766,_0x1c89a9,_0x21b0d5,_0x42c740,_0x5c598a){const _0xa87dc0=a9_0x5829,_0x225df3=_0x1c89a9||_0x21b0d5;if(_0x225df3){const {projectName:_0x17c3dc,agentName:_0x50e957}=parseAgentRef(_0x225df3),_0x28dcbc=_0x50e957||_0x225df3,_0x57aac0=_0x50e957?_0x17c3dc:_0x42c740;if(!_0x57aac0)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5c598a){const _0x45cd8a=_0x1c89a9?'--agent\x20flag':_0xa87dc0(0x1e0);console[_0xa87dc0(0x1e5)]('Using\x20agent\x20from\x20'+_0x45cd8a+':\x20'+_0x57aac0+'/'+_0x28dcbc);}const _0x148da6=await withSpinner('Resolving\x20project\x20\x27'+_0x57aac0+_0xa87dc0(0x1fb),()=>_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1dc)](_0x57aac0),{'verbose':_0x5c598a}),_0x325b68=await withSpinner(_0xa87dc0(0x1f9)+_0x28dcbc+'\x27...',()=>_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1d1)](_0x28dcbc,_0x148da6[_0xa87dc0(0x1fa)]),{'verbose':_0x5c598a});return _0x325b68[_0xa87dc0(0x1fa)];}else{const _0x3b9c91=_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1f4)]();if(_0x3b9c91)return _0x5c598a&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x3b9c91[_0xa87dc0(0x1e9)]),_0x3b9c91['id'];const _0xcc9bf1=await withSpinner(_0xa87dc0(0x1e2),()=>_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1c1)](_0xa87dc0(0x1cd),0x0),{'verbose':_0x5c598a});return _0xcc9bf1['data']['id'];}}export class ChatCommand extends BaseCommand{[a9_0x5a827e(0x1e9)]=a9_0x5a827e(0x1d0);[a9_0x5a827e(0x1bb)]=a9_0x5a827e(0x1eb);['validate'](_0x4bc50f){const _0x3f9071=a9_0x5a827e,_0x3b3e9c=_0x4bc50f[_0x3f9071(0x1c4)][_0x3f9071(0x1be)]('\x20');if(!_0x3b3e9c)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x270dea,_0x4c79ff,_0x3a7e10,_0x54b758,_0x335ac2){const _0x3202ff=a9_0x5a827e;for await(const _0x349966 of _0x270dea[_0x3202ff(0x1d8)][_0x3202ff(0x1d0)](_0x4c79ff,{'agentId':_0x3a7e10,'chatId':_0x54b758})){if(_0x349966[_0x3202ff(0x1e4)]===_0x3202ff(0x1da)){const _0x53ac17=_0x349966[_0x3202ff(0x1fa)][_0x3202ff(0x1d6)];saveLastChatId(_0x53ac17),_0x335ac2&&console['error'](_0x3202ff(0x1c9)+_0x53ac17);}else _0x349966[_0x3202ff(0x1e4)]===_0x3202ff(0x1de)&&this[_0x3202ff(0x1cb)](_0x349966[_0x3202ff(0x1fa)]);}}async[a9_0x5a827e(0x1f7)](_0x15b569,_0x3ae1bf,_0x434b6f,_0x31719d){const _0x4954a6=a9_0x5a827e,_0x2f87e4=_0x15b569[_0x4954a6(0x1e7)][_0x4954a6(0x1f1)];let _0x138027=![];for await(const _0x3b8625 of _0x15b569[_0x4954a6(0x1d8)][_0x4954a6(0x1d0)](_0x3ae1bf,{'agentId':_0x434b6f,'chatId':_0x31719d})){if(_0x3b8625[_0x4954a6(0x1e4)]===_0x4954a6(0x1da)){const _0x4e4d0b=_0x3b8625['data'];saveLastChatId(_0x4e4d0b[_0x4954a6(0x1d6)]);const _0xdc36d0=_0x4e4d0b['projectId']&&_0x4e4d0b['agentId']?getLLMConversationUrl(_0x2f87e4,_0x4e4d0b[_0x4954a6(0x1f3)],_0x4e4d0b[_0x4954a6(0x1ce)],_0x4e4d0b['chatId']):undefined;console[_0x4954a6(0x1e8)](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1da),'data':{'chatId':_0x4e4d0b[_0x4954a6(0x1d6)],'agentId':_0x4e4d0b[_0x4954a6(0x1ce)],'consoleUrl':_0xdc36d0}})),_0x138027=!![];}else{if(_0x3b8625[_0x4954a6(0x1e4)]===_0x4954a6(0x1de)){!_0x138027&&_0x31719d&&(console[_0x4954a6(0x1e8)](JSON['stringify']({'type':_0x4954a6(0x1da),'data':{'chatId':_0x31719d}})),_0x138027=!![]);const _0x1eb170=_0x3b8625['data'];if('content'in _0x1eb170)console[_0x4954a6(0x1e8)](JSON['stringify']({'type':_0x4954a6(0x1ba),'data':{'content':_0x1eb170[_0x4954a6(0x1ba)]}}));else{if('tool_call'in _0x1eb170){const _0x41d505=_0x1eb170['tool_call'];console[_0x4954a6(0x1e8)](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1f5),'data':{'id':_0x41d505['id'],'name':_0x41d505[_0x4954a6(0x1b9)],'target':_0x41d505['targetKnowledgeBase']?.[_0x4954a6(0x1e9)]||_0x41d505['targetAgent']?.[_0x4954a6(0x1e9)]||_0x41d505['targetWebSearchTool']?.[_0x4954a6(0x1e9)]||_0x41d505['targetFunction']}}));}else{if('tool'in _0x1eb170)console[_0x4954a6(0x1e8)](JSON['stringify']({'type':'tool_result','data':{'id':_0x1eb170[_0x4954a6(0x1bd)]['id'],'name':_0x1eb170[_0x4954a6(0x1bd)][_0x4954a6(0x1b9)],'result':typeof _0x1eb170['tool']['content']===_0x4954a6(0x1ef)?_0x1eb170['tool']['content'][_0x4954a6(0x1e6)](0x0,0x1f4):''}}));else _0x4954a6(0x1e5)in _0x1eb170&&console[_0x4954a6(0x1e8)](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1e5),'data':{'error':_0x1eb170[_0x4954a6(0x1e5)]}}));}}}}}console['log'](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1c0)}));}async['execute'](_0x13932a){const _0x469b13=a9_0x5a827e,{options:_0x3031fe,args:_0x354cc2,tdx:_0x18d1be}=_0x13932a,_0x3cabcd=_0x354cc2[_0x469b13(0x1be)]('\x20'),_0x51d4d5=_0x3031fe,_0x341066=_0x51d4d5[_0x469b13(0x1db)],_0x1a2b92=_0x51d4d5['llmAgent'],_0x4c9798=_0x51d4d5[_0x469b13(0x1b8)],_0x554737=_0x51d4d5[_0x469b13(0x1d5)],_0x219d39=_0x51d4d5['chatId'],_0x313ef6=_0x51d4d5[_0x469b13(0x1b3)];if(_0x554737&&_0x219d39)return console[_0x469b13(0x1e5)](_0x469b13(0x1ed)),0x1;try{let _0x1dd071,_0x240a90;if(_0x219d39)_0x240a90=_0x219d39;else!_0x554737&&(_0x240a90=loadLastChatId(),_0x240a90&&_0x3031fe[_0x469b13(0x1bc)]&&console[_0x469b13(0x1e5)](_0x469b13(0x1b2)+_0x240a90));!_0x219d39&&(_0x554737||!_0x240a90)&&(_0x1dd071=await resolveAgentId(_0x18d1be,_0x341066,_0x1a2b92,_0x4c9798,_0x3031fe[_0x469b13(0x1bc)]));const _0x35311a=_0x313ef6?(_0x1adcfb,_0x5352e1,_0xad44bf)=>this[_0x469b13(0x1f7)](_0x18d1be,_0x1adcfb,_0x5352e1,_0xad44bf):(_0x59794f,_0x16c62e,_0x384d12)=>this[_0x469b13(0x1d7)](_0x18d1be,_0x59794f,_0x16c62e,_0x384d12,_0x3031fe[_0x469b13(0x1bc)]);try{await _0x35311a(_0x3cabcd,_0x1dd071,_0x240a90);}catch(_0x53d21c){const _0x3e1146=_0x53d21c instanceof SDKError&&_0x53d21c[_0x469b13(0x1cf)]===ErrorCode[_0x469b13(0x1f0)]||_0x53d21c instanceof Error&&_0x53d21c['message'][_0x469b13(0x1ca)](_0x469b13(0x1b6));if(_0x3e1146&&_0x219d39)return console[_0x469b13(0x1e5)](_0x469b13(0x1af)+_0x219d39+_0x469b13(0x1b4)),0x1;if(_0x3e1146)_0x3031fe['verbose']&&console['error'](_0x469b13(0x1c8)),!_0x1dd071&&(_0x1dd071=await resolveAgentId(_0x18d1be,_0x341066,_0x1a2b92,_0x4c9798,_0x3031fe[_0x469b13(0x1bc)])),await _0x35311a(_0x3cabcd,_0x1dd071,undefined);else throw _0x53d21c;}return!_0x313ef6&&console['log'](),0x0;}catch(_0x57bfa5){return console[_0x469b13(0x1e5)](),handleSDKError(_0x57bfa5,_0x3031fe),0x1;}}[a9_0x5a827e(0x1cb)](_0x3173b2){const _0x4ce623=a9_0x5a827e;if(_0x4ce623(0x1ba)in _0x3173b2)process['stdout'][_0x4ce623(0x1b7)](_0x3173b2[_0x4ce623(0x1ba)]);else _0x4ce623(0x1e5)in _0x3173b2&&console['error'](_0x4ce623(0x1d4)+_0x3173b2[_0x4ce623(0x1e5)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x5a827e(0x1e9)]='chat-create';['description']=a9_0x5a827e(0x1d9);[a9_0x5a827e(0x1ec)](_0x3d10e4){const _0x1bb79a=a9_0x5a827e,_0x674121=_0x3d10e4[_0x1bb79a(0x1c5)],_0x42f310=_0x674121[_0x1bb79a(0x1db)],_0x39e59a=_0x674121['llmAgent'];if(!_0x42f310&&!_0x39e59a)return _0x1bb79a(0x1cc);return undefined;}async[a9_0x5a827e(0x1ee)](_0x3e3bb6){const _0x19d834=a9_0x5a827e,{options:_0x47f3a8,tdx:_0x464c5a}=_0x3e3bb6,_0xe61dc3=_0x47f3a8,_0x1112f0=_0xe61dc3[_0x19d834(0x1db)],_0x1ac902=_0xe61dc3[_0x19d834(0x1b0)],_0x33d386=_0xe61dc3['llmProject'];try{const _0x36e3bb=await resolveAgentId(_0x464c5a,_0x1112f0,_0x1ac902,_0x33d386,_0x47f3a8[_0x19d834(0x1bc)]),_0x339705=await _0x464c5a[_0x19d834(0x1d8)]['startChat'](_0x36e3bb);return saveLastChatId(_0x339705['id']),console['log'](JSON['stringify']({'chatId':_0x339705['id'],'agentId':_0x36e3bb})),0x0;}catch(_0x5f4daf){return handleSDKError(_0x5f4daf,_0x47f3a8),0x1;}}}
|
|
1
|
+
const a9_0x35be3d=a9_0x2303;(function(_0x4dd11c,_0x17be75){const _0x18fd56=a9_0x2303,_0x59b0a2=_0x4dd11c();while(!![]){try{const _0x4fd51b=parseInt(_0x18fd56(0x1a3))/0x1*(-parseInt(_0x18fd56(0x19f))/0x2)+parseInt(_0x18fd56(0x1e0))/0x3+parseInt(_0x18fd56(0x1a9))/0x4*(parseInt(_0x18fd56(0x1cd))/0x5)+-parseInt(_0x18fd56(0x19c))/0x6*(-parseInt(_0x18fd56(0x1d0))/0x7)+-parseInt(_0x18fd56(0x1bc))/0x8+-parseInt(_0x18fd56(0x1a1))/0x9+parseInt(_0x18fd56(0x1d7))/0xa;if(_0x4fd51b===_0x17be75)break;else _0x59b0a2['push'](_0x59b0a2['shift']());}catch(_0x59ae47){_0x59b0a2['push'](_0x59b0a2['shift']());}}}(a9_0x4b4c,0x91242));import{BaseCommand}from'./command.js';function a9_0x4b4c(){const _0x2ae6d9=['log','data','streamChatJsonl','chat-create','chat','6536536InqLrD','stack','resolveAgentId','metadata','event','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','startChat','chatId','options','write','tool_call','error','projectId','name','Error:\x20','Continuing\x20chat:\x20','verbose','128895eNuxxr','targetWebSearchTool','join','1921199OyPhPy','\x27\x20not\x20found','stringify','CHAT_NOT_FOUND','llm','validate','code','6751550oULKkM','session\x20context','execute','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','llmProject','tool_result','getDefaultAgent','Resolving\x20agent\x20\x27','\x0aError:\x20','2499381VEUniD','llmAgent','Getting\x20default\x20agent...','\x20\x20Cause:\x20','agentId','cause','streamChat','targetKnowledgeBase','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','args','12lKkrUw','agent','\x0aStack\x20trace:','488hSAFSt','\x27...','8726913MjzbQJ','tool','3532DWoQFe','new','slice','description','targetFunction','string','184ZvaZfC','--agent\x20flag','context','claude-4.5-haiku','Resolving\x20project\x20\x27','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','functionName','type','stdout','message','Using\x20cached\x20default\x20agent:\x20','targetAgent','content','Using\x20agent\x20from\x20'];a9_0x4b4c=function(){return _0x2ae6d9;};return a9_0x4b4c();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function a9_0x2303(_0x5a92de,_0x2bbe2d){_0x5a92de=_0x5a92de-0x19c;const _0x4b4ce7=a9_0x4b4c();let _0x23031a=_0x4b4ce7[_0x5a92de];return _0x23031a;}function handleSDKError(_0x349085,_0x4f93ab){const _0x760aae=a9_0x2303;if(_0x349085 instanceof SDKError)console[_0x760aae(0x1c7)](_0x760aae(0x1ca)+_0x349085[_0x760aae(0x1b2)]),_0x4f93ab[_0x760aae(0x1cc)]&&(_0x349085[_0x760aae(0x1e5)]&&console[_0x760aae(0x1c7)](_0x760aae(0x1e3)+_0x349085['cause']),_0x349085[_0x760aae(0x1bd)]&&(console[_0x760aae(0x1c7)](_0x760aae(0x19e)),console[_0x760aae(0x1c7)](_0x349085['stack'])));else throw _0x349085;}async function resolveAgentId(_0x34591e,_0x583836,_0x4c257a,_0x530960,_0x17e071){const _0x28e2c3=a9_0x2303,_0x10d440=_0x583836||_0x4c257a;if(_0x10d440){const {projectName:_0x136c17,agentName:_0x5b9b8e}=parseAgentRef(_0x10d440),_0xb814ff=_0x5b9b8e||_0x10d440,_0x29b542=_0x5b9b8e?_0x136c17:_0x530960;if(!_0x29b542)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x17e071){const _0x3ea222=_0x583836?_0x28e2c3(0x1aa):_0x28e2c3(0x1d8);console[_0x28e2c3(0x1c7)](_0x28e2c3(0x1b6)+_0x3ea222+':\x20'+_0x29b542+'/'+_0xb814ff);}const _0x997518=await withSpinner(_0x28e2c3(0x1ad)+_0x29b542+_0x28e2c3(0x1a0),()=>_0x34591e[_0x28e2c3(0x1d4)]['resolveProjectId'](_0x29b542),{'verbose':_0x17e071}),_0x1ede0b=await withSpinner(_0x28e2c3(0x1de)+_0xb814ff+_0x28e2c3(0x1a0),()=>_0x34591e[_0x28e2c3(0x1d4)][_0x28e2c3(0x1be)](_0xb814ff,_0x997518['data']),{'verbose':_0x17e071});return _0x1ede0b[_0x28e2c3(0x1b8)];}else{const _0x1dc313=_0x34591e[_0x28e2c3(0x1d4)][_0x28e2c3(0x1dd)]();if(_0x1dc313)return _0x17e071&&console[_0x28e2c3(0x1c7)](_0x28e2c3(0x1b3)+_0x1dc313[_0x28e2c3(0x1c9)]),_0x1dc313['id'];const _0xcdd0bf=await withSpinner(_0x28e2c3(0x1e2),()=>_0x34591e[_0x28e2c3(0x1d4)]['getOrCreateDefaultAgent'](_0x28e2c3(0x1ac),0x0),{'verbose':_0x17e071});return _0xcdd0bf[_0x28e2c3(0x1b8)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a9_0x35be3d(0x1bb);[a9_0x35be3d(0x1a6)]=a9_0x35be3d(0x1e8);['validate'](_0x4c7ecc){const _0x215c96=a9_0x35be3d,_0x4628ad=_0x4c7ecc[_0x215c96(0x1e9)][_0x215c96(0x1cf)]('\x20');if(!_0x4628ad)return _0x215c96(0x1da);return undefined;}async[a9_0x35be3d(0x1e6)](_0x4bf4b5,_0x94834d,_0x42f8c7,_0x209dc4,_0x172cda){const _0x1f5437=a9_0x35be3d;for await(const _0x279f38 of _0x4bf4b5[_0x1f5437(0x1d4)][_0x1f5437(0x1bb)](_0x94834d,{'agentId':_0x42f8c7,'chatId':_0x209dc4})){if(_0x279f38[_0x1f5437(0x1b0)]===_0x1f5437(0x1bf)){const _0x5285d9=_0x279f38[_0x1f5437(0x1b8)]['chatId'];saveLastChatId(_0x5285d9),_0x172cda&&console[_0x1f5437(0x1c7)]('Chat\x20session:\x20'+_0x5285d9);}else _0x279f38[_0x1f5437(0x1b0)]===_0x1f5437(0x1c0)&&this['handleChatEvent'](_0x279f38[_0x1f5437(0x1b8)]);}}async[a9_0x35be3d(0x1b9)](_0xa8192a,_0x19a716,_0x3cdefc,_0x2f9a5c){const _0x4c2e5d=a9_0x35be3d,_0x5ee5ee=_0xa8192a[_0x4c2e5d(0x1ab)]['site'];let _0x1e73a8=![];for await(const _0x277eda of _0xa8192a[_0x4c2e5d(0x1d4)][_0x4c2e5d(0x1bb)](_0x19a716,{'agentId':_0x3cdefc,'chatId':_0x2f9a5c})){if(_0x277eda[_0x4c2e5d(0x1b0)]===_0x4c2e5d(0x1bf)){const _0x45d1f2=_0x277eda[_0x4c2e5d(0x1b8)];saveLastChatId(_0x45d1f2[_0x4c2e5d(0x1c3)]);const _0x5a2c5a=_0x45d1f2[_0x4c2e5d(0x1c8)]&&_0x45d1f2['agentId']?getLLMConversationUrl(_0x5ee5ee,_0x45d1f2['projectId'],_0x45d1f2[_0x4c2e5d(0x1e4)],_0x45d1f2[_0x4c2e5d(0x1c3)]):undefined;console[_0x4c2e5d(0x1b7)](JSON[_0x4c2e5d(0x1d2)]({'type':_0x4c2e5d(0x1bf),'data':{'chatId':_0x45d1f2[_0x4c2e5d(0x1c3)],'agentId':_0x45d1f2[_0x4c2e5d(0x1e4)],'consoleUrl':_0x5a2c5a}})),_0x1e73a8=!![];}else{if(_0x277eda[_0x4c2e5d(0x1b0)]===_0x4c2e5d(0x1c0)){!_0x1e73a8&&_0x2f9a5c&&(console[_0x4c2e5d(0x1b7)](JSON['stringify']({'type':_0x4c2e5d(0x1bf),'data':{'chatId':_0x2f9a5c}})),_0x1e73a8=!![]);const _0x8a84f1=_0x277eda['data'];if(_0x4c2e5d(0x1b5)in _0x8a84f1)console[_0x4c2e5d(0x1b7)](JSON[_0x4c2e5d(0x1d2)]({'type':_0x4c2e5d(0x1b5),'data':{'content':_0x8a84f1[_0x4c2e5d(0x1b5)]}}));else{if('tool_call'in _0x8a84f1){const _0x236834=_0x8a84f1[_0x4c2e5d(0x1c6)];console[_0x4c2e5d(0x1b7)](JSON[_0x4c2e5d(0x1d2)]({'type':_0x4c2e5d(0x1c6),'data':{'id':_0x236834['id'],'name':_0x236834['functionName'],'target':_0x236834[_0x4c2e5d(0x1e7)]?.[_0x4c2e5d(0x1c9)]||_0x236834[_0x4c2e5d(0x1b4)]?.[_0x4c2e5d(0x1c9)]||_0x236834[_0x4c2e5d(0x1ce)]?.[_0x4c2e5d(0x1c9)]||_0x236834[_0x4c2e5d(0x1a7)]}}));}else{if(_0x4c2e5d(0x1a2)in _0x8a84f1)console['log'](JSON[_0x4c2e5d(0x1d2)]({'type':_0x4c2e5d(0x1dc),'data':{'id':_0x8a84f1[_0x4c2e5d(0x1a2)]['id'],'name':_0x8a84f1[_0x4c2e5d(0x1a2)][_0x4c2e5d(0x1af)],'result':typeof _0x8a84f1['tool'][_0x4c2e5d(0x1b5)]===_0x4c2e5d(0x1a8)?_0x8a84f1[_0x4c2e5d(0x1a2)]['content'][_0x4c2e5d(0x1a5)](0x0,0x1f4):''}}));else'error'in _0x8a84f1&&console[_0x4c2e5d(0x1b7)](JSON[_0x4c2e5d(0x1d2)]({'type':_0x4c2e5d(0x1c7),'data':{'error':_0x8a84f1[_0x4c2e5d(0x1c7)]}}));}}}}}console[_0x4c2e5d(0x1b7)](JSON[_0x4c2e5d(0x1d2)]({'type':'done'}));}async[a9_0x35be3d(0x1d9)](_0x1ff27d){const _0x53690d=a9_0x35be3d,{options:_0x570f93,args:_0x5711e2,tdx:_0x3d26f0}=_0x1ff27d,_0xb805f5=_0x5711e2[_0x53690d(0x1cf)]('\x20'),_0x5c31ec=_0x570f93,_0x1eaef5=_0x5c31ec[_0x53690d(0x19d)],_0x6be469=_0x5c31ec[_0x53690d(0x1e1)],_0x5a30b6=_0x5c31ec['llmProject'],_0x1eadc1=_0x5c31ec[_0x53690d(0x1a4)],_0x265f40=_0x5c31ec[_0x53690d(0x1c3)],_0x145237=_0x5c31ec['stream'];if(_0x1eadc1&&_0x265f40)return console[_0x53690d(0x1c7)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x51bbda,_0x498997;if(_0x265f40)_0x498997=_0x265f40;else!_0x1eadc1&&(_0x498997=loadLastChatId(),_0x498997&&_0x570f93[_0x53690d(0x1cc)]&&console[_0x53690d(0x1c7)](_0x53690d(0x1cb)+_0x498997));!_0x265f40&&(_0x1eadc1||!_0x498997)&&(_0x51bbda=await resolveAgentId(_0x3d26f0,_0x1eaef5,_0x6be469,_0x5a30b6,_0x570f93[_0x53690d(0x1cc)]));const _0x486bcb=_0x145237?(_0x49b535,_0x437d8f,_0x42b534)=>this[_0x53690d(0x1b9)](_0x3d26f0,_0x49b535,_0x437d8f,_0x42b534):(_0x1e4b55,_0x341c25,_0x495288)=>this['streamChat'](_0x3d26f0,_0x1e4b55,_0x341c25,_0x495288,_0x570f93['verbose']);try{await _0x486bcb(_0xb805f5,_0x51bbda,_0x498997);}catch(_0x5dcbd9){const _0x2993b3=_0x5dcbd9 instanceof SDKError&&_0x5dcbd9[_0x53690d(0x1d6)]===ErrorCode[_0x53690d(0x1d3)]||_0x5dcbd9 instanceof Error&&_0x5dcbd9['message']['includes']('404');if(_0x2993b3&&_0x265f40)return console['error']('Error:\x20Chat\x20session\x20\x27'+_0x265f40+_0x53690d(0x1d1)),0x1;if(_0x2993b3)_0x570f93[_0x53690d(0x1cc)]&&console[_0x53690d(0x1c7)](_0x53690d(0x1ae)),!_0x51bbda&&(_0x51bbda=await resolveAgentId(_0x3d26f0,_0x1eaef5,_0x6be469,_0x5a30b6,_0x570f93[_0x53690d(0x1cc)])),await _0x486bcb(_0xb805f5,_0x51bbda,undefined);else throw _0x5dcbd9;}return!_0x145237&&console['log'](),0x0;}catch(_0x3d3ec4){return console[_0x53690d(0x1c7)](),handleSDKError(_0x3d3ec4,_0x570f93),0x1;}}['handleChatEvent'](_0x3012dd){const _0xa5fc6e=a9_0x35be3d;if(_0xa5fc6e(0x1b5)in _0x3012dd)process[_0xa5fc6e(0x1b1)][_0xa5fc6e(0x1c5)](_0x3012dd[_0xa5fc6e(0x1b5)]);else _0xa5fc6e(0x1c7)in _0x3012dd&&console[_0xa5fc6e(0x1c7)](_0xa5fc6e(0x1df)+_0x3012dd[_0xa5fc6e(0x1c7)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x35be3d(0x1c9)]=a9_0x35be3d(0x1ba);[a9_0x35be3d(0x1a6)]='Create\x20a\x20new\x20chat\x20session';[a9_0x35be3d(0x1d5)](_0x3f0635){const _0xd570e1=a9_0x35be3d,_0x536abd=_0x3f0635[_0xd570e1(0x1c4)],_0x4edb9d=_0x536abd[_0xd570e1(0x19d)],_0x1988f2=_0x536abd[_0xd570e1(0x1e1)];if(!_0x4edb9d&&!_0x1988f2)return _0xd570e1(0x1c1);return undefined;}async['execute'](_0x7a66c0){const _0x193628=a9_0x35be3d,{options:_0x299623,tdx:_0x1f5da2}=_0x7a66c0,_0x2b9a95=_0x299623,_0x1d2d39=_0x2b9a95[_0x193628(0x19d)],_0x594589=_0x2b9a95['llmAgent'],_0x38ddaa=_0x2b9a95[_0x193628(0x1db)];try{const _0x2a1d87=await resolveAgentId(_0x1f5da2,_0x1d2d39,_0x594589,_0x38ddaa,_0x299623[_0x193628(0x1cc)]),_0x2e3a81=await _0x1f5da2[_0x193628(0x1d4)][_0x193628(0x1c2)](_0x2a1d87);return saveLastChatId(_0x2e3a81['id']),console['log'](JSON['stringify']({'chatId':_0x2e3a81['id'],'agentId':_0x2a1d87})),0x0;}catch(_0x49f9c3){return handleSDKError(_0x49f9c3,_0x299623),0x1;}}}
|