@treasuredata/tdx 0.27.1 → 0.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/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/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/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.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/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/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/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/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/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x48622b=a3_0x4f2c;(function(_0x5b43ad,_0x4ae5a7){const _0x5411ef=a3_0x4f2c,_0x32cd18=_0x5b43ad();while(!![]){try{const _0x5a8d4b=-parseInt(_0x5411ef(0xe0))/0x1+parseInt(_0x5411ef(0xf5))/0x2*(-parseInt(_0x5411ef(0xe8))/0x3)+-parseInt(_0x5411ef(0xe7))/0x4+parseInt(_0x5411ef(0xe1))/0x5*(parseInt(_0x5411ef(0xf3))/0x6)+-parseInt(_0x5411ef(0xdf))/0x7*(-parseInt(_0x5411ef(0xdb))/0x8)+parseInt(_0x5411ef(0xdd))/0x9+parseInt(_0x5411ef(0xee))/0xa;if(_0x5a8d4b===_0x4ae5a7)break;else _0x32cd18['push'](_0x32cd18['shift']());}catch(_0xb371af){_0x32cd18['push'](_0x32cd18['shift']());}}}(a3_0x54ac,0xf1019));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x54ac(){const _0x220a53=['Resolved\x20child\x20ID:\x20','Error:\x20Segment\x20name\x20is\x20required','Error:\x20','Parent\x20name:\x20','\x20\x20Cause:\x20','cause','1224YdTVKT','Child\x20name:\x20','5804298Jeiupm','Resolving\x20parent\x20segment\x20\x27','40201qvaqxa','1789432JJHsbQ','35WtRreg','resolveSegmentId','\x20activation','execute','\x27...','error','5985300CJKgju','3mTfhem','verbose','Listing\x20activations\x20for\x20segment\x20\x27','length','resolveParentId','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','22014990AxUNfq','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','segment','Resolving\x20child\x20segment\x20\x27','data','991182IMEtzS','listActivations','1217122bOmTbX','List\x20activations\x20for\x20a\x20segment'];a3_0x54ac=function(){return _0x220a53;};return a3_0x54ac();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x4f2c(_0x2784c3,_0x3efbb7){_0x2784c3=_0x2784c3-0xda;const _0x54ac61=a3_0x54ac();let _0x4f2c4f=_0x54ac61[_0x2784c3];return _0x4f2c4f;}export class ActivationsCommand extends BaseCommand{['name']='activations';['description']=a3_0x48622b(0xf6);async[a3_0x48622b(0xe4)](_0x19a281){const _0x2aee2b=a3_0x48622b,{options:_0x4fe2ae,args:_0x2072eb,tdx:_0x494962}=_0x19a281;if(_0x2072eb['length']===0x0)return console[_0x2aee2b(0xe6)](_0x2aee2b(0xf8)),console[_0x2aee2b(0xe6)](_0x2aee2b(0xef)),0x1;try{const {parentId:_0x711f9c,childId:_0xfa72a4}=parseSegmentRef(_0x2072eb[0x0]);if(!_0xfa72a4)return console['error'](_0x2aee2b(0xed)),console['error'](_0x2aee2b(0xef)),0x1;_0x4fe2ae[_0x2aee2b(0xe9)]&&(console[_0x2aee2b(0xe6)]('Site:\x20'+_0x4fe2ae['site']),console[_0x2aee2b(0xe6)](_0x2aee2b(0xfa)+_0x711f9c),console[_0x2aee2b(0xe6)](_0x2aee2b(0xdc)+_0xfa72a4));const _0x3aec09=await withSpinner(_0x2aee2b(0xde)+_0x711f9c+_0x2aee2b(0xe5),()=>_0x494962[_0x2aee2b(0xf0)][_0x2aee2b(0xec)](_0x711f9c),{'verbose':_0x4fe2ae[_0x2aee2b(0xe9)]}),_0x58f05c=_0x3aec09[_0x2aee2b(0xf2)];_0x4fe2ae[_0x2aee2b(0xe9)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x58f05c);const _0x43a5c3=await withSpinner(_0x2aee2b(0xf1)+_0xfa72a4+'\x27...',()=>_0x494962[_0x2aee2b(0xf0)][_0x2aee2b(0xe2)](_0x58f05c,_0xfa72a4),{'verbose':_0x4fe2ae['verbose']}),_0xfb28b3=_0x43a5c3[_0x2aee2b(0xf2)];_0x4fe2ae['verbose']&&console[_0x2aee2b(0xe6)](_0x2aee2b(0xf7)+_0xfb28b3);const _0x5ccffa=await withSpinner(_0x2aee2b(0xea)+_0xfa72a4+'\x27...',()=>_0x494962['segment'][_0x2aee2b(0xf4)](_0x58f05c,_0xfb28b3),{'verbose':_0x4fe2ae['verbose']}),_0x506dbd=_0x5ccffa[_0x2aee2b(0xf2)];return console[_0x2aee2b(0xe6)]('✔\x20Found\x20'+_0x506dbd[_0x2aee2b(0xeb)]+_0x2aee2b(0xe3)+(_0x506dbd[_0x2aee2b(0xeb)]!==0x1?'s':'')),await handleSDKOutput(_0x506dbd,_0x4fe2ae),0x0;}catch(_0xa9ac69){if(_0xa9ac69 instanceof SDKError)return console[_0x2aee2b(0xe6)](_0x2aee2b(0xf9)+_0xa9ac69['message']),_0xa9ac69['cause']&&console['error'](_0x2aee2b(0xfb)+_0xa9ac69[_0x2aee2b(0xda)]),0x1;throw _0xa9ac69;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x1bde89=a4_0x5dd1;(function(_0x1c1c86,_0x8c4e82){const _0x373ac9=a4_0x5dd1,_0xc2cb2b=_0x1c1c86();while(!![]){try{const _0x38b1bd=-parseInt(_0x373ac9(0x1b0))/0x1+-parseInt(_0x373ac9(0x148))/0x2+parseInt(_0x373ac9(0x127))/0x3*(parseInt(_0x373ac9(0x1ce))/0x4)+parseInt(_0x373ac9(0x166))/0x5*(-parseInt(_0x373ac9(0x1a6))/0x6)+-parseInt(_0x373ac9(0x134))/0x7+parseInt(_0x373ac9(0x170))/0x8*(-parseInt(_0x373ac9(0x11c))/0x9)+parseInt(_0x373ac9(0x19e))/0xa;if(_0x38b1bd===_0x8c4e82)break;else _0xc2cb2b['push'](_0xc2cb2b['shift']());}catch(_0x4a2bb8){_0xc2cb2b['push'](_0xc2cb2b['shift']());}}}(a4_0x1fa9,0xd77c2));import a4_0x47e7d2 from'chalk';import a4_0x170d36 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}from'../sdk/agent/agent-config.js';function a4_0x1fa9(){const _0x35a133=['reason','\x0a✔\x20Pushed\x20','profile','pullProject','agent:pull','\x20files\x20to\x20','llm_project','agent.yml','Agent\x20pulled\x20successfully','Agent\x20','cyan','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Output\x20path:\x20','2043410aMLCYO','no_local_folder','pushProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','execute','Status:\x20','experimentalKnowledgeBases','\x20\x20Integration\x20\x22','action','found','Would\x20pull\x20agent:\x20','pullAgent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent:push','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20resources\x20to\x20\x27','llm','agent:clone','New\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Analyzing\x20project\x20\x22','\x20=\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20Source:\x20','llmProject','new','experimentalArtifacts','Source:\x20','\x0aErrors\x20found:','70ghaHIQ','errors','\x0aChanges\x20to\x20agent\x20\x27','Errors:','cwd','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20tdx\x20agent\x20pull\x20','unchanged','source','agentId','878112WNacqB','\x20new','session','outputPath','Clone\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','error','cloneProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aProject\x20pushed\x20with\x20errors','Pulling\x20agent\x20\x22','dryRun','\x20resources?','site','dirname','\x0aError:','counts','\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)','dim','\x20updated','log','\x22\x20to\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','sourceProjectName','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pulled\x20','\x0aChanges\x20to\x20integration\x20\x27','Using\x20local\x20project:\x20','created','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','Using\x20context\x20project:\x20','tdx.json','agentName','\x20\x20Knowledge\x20Bases:\x20','textKnowledgeBases','Agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Failed\x20to\x20push\x20agent:\x20','\x20\x20Prompt\x20\x22','Summary:','red','\x20unchanged','42006070JVVjAa','<new-name>','yellow','integrations','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','context','gray','92820zHoIVB','\x20\x20Integrations:\x20','Using\x20project:\x20','updated','description','prompts','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','force','Pushing\x20agent\x20from\x20\x22','\x20\x20Target:\x20','1642194kAwVva','Pushing\x20to\x20project...','knowledgeBases','\x22...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','total','New\x20project\x20ID:\x20','message','Dry\x20run\x20-\x20no\x20files\x20written','\x20errors','\x20\x20Text\x20Knowledge\x20Base\x20\x22','name','\x20\x20Knowledge\x20Base\x20\x22','Cancelled','newProjectName','\x20\x20Prompts:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','pushAgent','Would\x20push\x20agent:\x20','\x20created','\x20--profile\x20','\x22\x20from\x20project\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Would\x20clone:','newProjectId','\x20|\x20','\x20\x20Agents:\x20','\x0aPush\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','6439612iLTOlH','Project:\x20','green','New\x20project\x20name\x20is\x20required','projectName','projectDir','Project\x20cloned\x20with\x20errors','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','yes','126VWsjut','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aChanges:','projectId','Chat:\x20','✔\x20Context\x20set:\x20','agents','Project\x20cloned\x20successfully','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','\x22:\x20','3FKbzCs','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20total','repeat','MISSING_ARGUMENT','parse','no_context','push','\x22\x20to\x20a\x20different\x20profile','outputDir','diff','Analyzing\x20changes\x20to\x20push...','Using\x20project\x20from\x20','3574963bBcWsp','Using\x20current\x20project:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20--name\x20','join','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Usage:\x20tdx\x20agent\x20pull\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)'];a4_0x1fa9=function(){return _0x35a133;};return a4_0x1fa9();}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(_0x4309d5){const _0x25690e=a4_0x5dd1,_0x57edd6=[];if(_0x4309d5['total']!==undefined)_0x57edd6[_0x25690e(0x12e)](_0x4309d5[_0x25690e(0x1b5)]+_0x25690e(0x129));if(_0x4309d5[_0x25690e(0x162)]!==undefined&&_0x4309d5[_0x25690e(0x162)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1d0)](_0x4309d5[_0x25690e(0x162)]+_0x25690e(0x171)));if(_0x4309d5[_0x25690e(0x18d)]!==undefined&&_0x4309d5[_0x25690e(0x18d)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1d0)](_0x4309d5[_0x25690e(0x18d)]+_0x25690e(0x1c3)));if(_0x4309d5[_0x25690e(0x1a9)]!==undefined&&_0x4309d5[_0x25690e(0x1a9)]>0x0)_0x57edd6['push'](a4_0x47e7d2[_0x25690e(0x1a0)](_0x4309d5[_0x25690e(0x1a9)]+_0x25690e(0x183)));if(_0x4309d5[_0x25690e(0x16d)]!==undefined&&_0x4309d5[_0x25690e(0x16d)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1a5)](_0x4309d5[_0x25690e(0x16d)]+_0x25690e(0x19d)));if(_0x4309d5[_0x25690e(0x167)]!==undefined&&_0x4309d5[_0x25690e(0x167)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x19c)](_0x4309d5[_0x25690e(0x167)]+_0x25690e(0x1b9)));return _0x57edd6[_0x25690e(0x138)](',\x20');}function displayDiffs(_0x50bf60,_0xafeb17,_0xcfd99f,_0x4fe973,_0x1206f1,_0x2e3cc9,_0x3db751){const _0x197628=a4_0x5dd1;for(const _0x17b567 of _0x50bf60){if(_0x17b567[_0x197628(0x131)]){const _0x3ba370=_0x17b567[_0x197628(0x192)]||_0x17b567[_0x197628(0x1bb)];console[_0x197628(0x184)](_0x197628(0x168)+_0x3ba370+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x17b567['diff']),console['log']('─'[_0x197628(0x12a)](0x3c));}}for(const _0x4b8943 of _0xafeb17){_0x4b8943[_0x197628(0x131)]&&(console[_0x197628(0x184)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x4b8943[_0x197628(0x1bb)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x197628(0x184)](_0x4b8943[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4e6f45 of _0xcfd99f){_0x4e6f45[_0x197628(0x131)]&&(console[_0x197628(0x184)](_0x197628(0x139)+_0x4e6f45[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x4e6f45['diff']),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x3ad577 of _0x4fe973){_0x3ad577[_0x197628(0x131)]&&(console['log'](_0x197628(0x1a3)+_0x3ad577[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x3ad577[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4041f4 of _0x1206f1){_0x4041f4[_0x197628(0x131)]&&(console['log'](_0x197628(0x18b)+_0x4041f4[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console['log'](_0x4041f4[_0x197628(0x131)]),console[_0x197628(0x184)]('─'['repeat'](0x3c)));}for(const _0x3ed833 of _0x2e3cc9){_0x3ed833[_0x197628(0x131)]&&(console['log'](_0x197628(0x186)+_0x3ed833['name']+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x3ed833[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4ca291 of _0x3db751){_0x4ca291['diff']&&(console[_0x197628(0x184)](_0x197628(0x136)+_0x4ca291[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'['repeat'](0x3c)),console[_0x197628(0x184)](_0x4ca291[_0x197628(0x131)]),console['log']('─'[_0x197628(0x12a)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x13f);['description']=a4_0x1bde89(0x1ac);async[a4_0x1bde89(0x14c)](_0x4a6d52){const _0x1cc6d2=a4_0x1bde89,{options:_0x84348f,args:_0x451b86,tdx:_0x193f3a}=_0x4a6d52,_0x26d678=_0x451b86[0x0],_0x583015=_0x451b86[0x1],_0x242d09=_0x84348f['output'],_0x455182=_0x84348f[_0x1cc6d2(0x17b)],_0x438977=_0x84348f[_0x1cc6d2(0x1ad)],_0x5da69b=_0x84348f['yes'],_0x247c91=_0x84348f['llmProject'];let _0x426fb8,_0x51cf64;const _0x3665ff=findAgentConfigPath(process['cwd']());if(_0x26d678){const _0x3b3cb0=a4_0x170d36[_0x1cc6d2(0x138)](_0x26d678,'tdx.json');if(existsSync(_0x3b3cb0))try{const _0x256c1f=JSON[_0x1cc6d2(0x12c)](readFileSync(_0x3b3cb0,'utf-8'));_0x426fb8=_0x256c1f[_0x1cc6d2(0x141)],_0x51cf64=_0x26d678,console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x133)+_0x3b3cb0+':\x20'+_0x426fb8));}catch{_0x426fb8=_0x26d678;}else _0x426fb8=_0x26d678;}else{if(_0x3665ff)try{const _0x2223ca=JSON[_0x1cc6d2(0x12c)](readFileSync(_0x3665ff,'utf-8'));_0x426fb8=_0x2223ca[_0x1cc6d2(0x141)],_0x51cf64=a4_0x170d36['dirname'](_0x3665ff),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x1a8)+_0x426fb8));}catch{_0x426fb8=_0x247c91;}else _0x426fb8=_0x247c91;}if(!_0x426fb8)return console['log'](a4_0x47e7d2['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x13a)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x1cc6d2(0x184)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x198)),0x1;if(_0x583015){const {data:_0x5e56b3}=await withSpinner(_0x1cc6d2(0x17a)+_0x583015+_0x1cc6d2(0x1c5)+_0x426fb8+_0x1cc6d2(0x1b3),()=>_0x193f3a[_0x1cc6d2(0x159)][_0x1cc6d2(0x153)](_0x426fb8,_0x583015,_0x242d09,{'dryRun':_0x455182,'force':_0x438977}));if(_0x455182)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)](_0x1cc6d2(0x1b8))),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x152)+_0x5e56b3[_0x1cc6d2(0x192)]),console['log'](_0x1cc6d2(0x147)+_0x5e56b3[_0x1cc6d2(0x173)]),_0x5e56b3['diff']&&(console[_0x1cc6d2(0x184)](_0x1cc6d2(0x11e)),console['log']('─'[_0x1cc6d2(0x12a)](0x3c)),console['log'](_0x5e56b3[_0x1cc6d2(0x131)]),console[_0x1cc6d2(0x184)]('─'[_0x1cc6d2(0x12a)](0x3c))),0x0;return console[_0x1cc6d2(0x184)](a4_0x47e7d2['green'](_0x1cc6d2(0x143))),console[_0x1cc6d2(0x184)]('Agent:\x20'+_0x5e56b3['agentName']),console[_0x1cc6d2(0x184)]('Output:\x20'+_0x5e56b3[_0x1cc6d2(0x173)]),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x14d)+(_0x5e56b3['isNew']?a4_0x47e7d2[_0x1cc6d2(0x1d0)]('new'):_0x5e56b3['hasChanges']?a4_0x47e7d2['yellow'](_0x1cc6d2(0x1a9)):a4_0x47e7d2[_0x1cc6d2(0x1a5)](_0x1cc6d2(0x16d)))),0x0;}const _0x4c2cfd=_0x51cf64||_0x242d09,{data:_0x232082}=await withSpinner(_0x1cc6d2(0x15d)+_0x426fb8+_0x1cc6d2(0x1b3),()=>_0x193f3a['llm'][_0x1cc6d2(0x13e)](_0x426fb8,_0x4c2cfd,{'dryRun':!![]})),_0x4417d0=_0x232082['counts']['agents']['new']+_0x232082[_0x1cc6d2(0x180)]['knowledgeBases'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)]['new']+_0x232082[_0x1cc6d2(0x180)]['prompts'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)]['integrations'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)]['experimentalKnowledgeBases'][_0x1cc6d2(0x162)]+_0x232082['counts'][_0x1cc6d2(0x163)][_0x1cc6d2(0x162)],_0x4b2def=_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)][_0x1cc6d2(0x1a9)]+_0x232082['counts'][_0x1cc6d2(0x1b2)]['updated']+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x1ab)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x1a1)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x163)][_0x1cc6d2(0x1a9)],_0x2005e5=_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)][_0x1cc6d2(0x16d)]+_0x232082['counts']['knowledgeBases'][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)]['textKnowledgeBases'][_0x1cc6d2(0x16d)]+_0x232082['counts'][_0x1cc6d2(0x1ab)][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)]['integrations']['unchanged']+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x163)]['unchanged'];console[_0x1cc6d2(0x184)]('\x0aPull\x20summary\x20for\x20\x27'+_0x232082[_0x1cc6d2(0x117)]+'\x27:'),console[_0x1cc6d2(0x184)]('\x20\x20'+a4_0x47e7d2[_0x1cc6d2(0x1d0)]('+\x20'+_0x4417d0+'\x20new')+_0x1cc6d2(0x1ca)+a4_0x47e7d2[_0x1cc6d2(0x1a0)]('~\x20'+_0x4b2def+'\x20changed')+_0x1cc6d2(0x1ca)+a4_0x47e7d2[_0x1cc6d2(0x182)]('=\x20'+_0x2005e5+_0x1cc6d2(0x19d))),console['log'](_0x1cc6d2(0x1cb)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x193)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x1b2)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x157)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x1bf)+formatCountSummary(_0x232082['counts']['prompts'])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x1a7)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x1a1)]));const _0x4b1b49=_0x232082['counts'][_0x1cc6d2(0x14e)]['total']>0x0||_0x232082['counts'][_0x1cc6d2(0x163)]['total']>0x0;_0x4b1b49&&(console[_0x1cc6d2(0x184)](_0x1cc6d2(0x124)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)])),console['log'](_0x1cc6d2(0x18f)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x163)])));console['log'](_0x1cc6d2(0x1af)+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x232082[_0x1cc6d2(0x130)])),displayDiffs(_0x232082[_0x1cc6d2(0x122)],_0x232082[_0x1cc6d2(0x1b2)],_0x232082['textKnowledgeBases'],_0x232082[_0x1cc6d2(0x1ab)],_0x232082[_0x1cc6d2(0x1a1)],_0x232082[_0x1cc6d2(0x14e)],_0x232082[_0x1cc6d2(0x163)]);if(_0x455182)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4417d0===0x0&&_0x4b2def===0x0)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x175))),saveSessionContext({'llm_project':_0x232082[_0x1cc6d2(0x117)]},_0x84348f[_0x1cc6d2(0x172)]),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)]('✔\x20Context\x20set:\x20'+a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x141))+_0x1cc6d2(0x15e)+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x232082['projectName']))),0x0;if(!_0x5da69b&&!_0x438977){if(!isInteractive())return console['error'](a4_0x47e7d2[_0x1cc6d2(0x19c)]('\x0aError:'),_0x1cc6d2(0x154)),console['error'](a4_0x47e7d2[_0x1cc6d2(0x182)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1407f2=await confirmKey('\x0aWrite\x20'+(_0x4417d0+_0x4b2def)+'\x20files?');if(!_0x1407f2)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1e5403}=await withSpinner('Writing\x20files...',()=>_0x193f3a['llm'][_0x1cc6d2(0x13e)](_0x426fb8,_0x4c2cfd,{'force':_0x438977}));return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x18a)+(_0x4417d0+_0x4b2def)+_0x1cc6d2(0x140)+_0x1e5403[_0x1cc6d2(0x130)])),saveSessionContext({'llm_project':_0x1e5403['projectName']},_0x84348f[_0x1cc6d2(0x172)]),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x121)+a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x141))+'\x20=\x20'+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x1e5403[_0x1cc6d2(0x117)]))),0x0;}}function a4_0x5dd1(_0x180759,_0x37b7b8){_0x180759=_0x180759-0x116;const _0x1fa9c0=a4_0x1fa9();let _0x5dd183=_0x1fa9c0[_0x180759];return _0x5dd183;}export class AgentCloneCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x15a);['description']=a4_0x1bde89(0x1cd);async['execute'](_0x4f2ca3){const _0x1da0f0=a4_0x1bde89,{options:_0x5f24fd,args:_0x7bcea6,tdx:_0x59dd50}=_0x4f2ca3,_0x4afeb9=_0x7bcea6[0x0],_0x269677=_0x5f24fd[_0x1da0f0(0x1bb)],_0x17f592=_0x5f24fd[_0x1da0f0(0x17b)],_0x3b01a6=_0x5f24fd[_0x1da0f0(0x11b)],_0x18bdbe=_0x5f24fd['site'],_0x36e05b=_0x5f24fd[_0x1da0f0(0x161)];let _0x17de53;const _0x27dab9=findAgentConfigPath(process[_0x1da0f0(0x16a)]());if(_0x4afeb9){const _0x3caf82=a4_0x170d36[_0x1da0f0(0x138)](_0x4afeb9,_0x1da0f0(0x191));existsSync(_0x3caf82)?(_0x17de53=_0x4afeb9,console['log'](a4_0x47e7d2[_0x1da0f0(0x182)]('Using\x20local\x20project:\x20'+_0x4afeb9))):_0x17de53=_0x4afeb9;}else{if(_0x27dab9)_0x17de53=a4_0x170d36['dirname'](_0x27dab9),console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x135)+_0x17de53));else{if(_0x36e05b){const _0x39e22f=sanitizeForFilesystem(_0x36e05b);let _0x13ca5d=_0x39e22f,_0x4989c4=a4_0x170d36[_0x1da0f0(0x138)](process[_0x1da0f0(0x16a)](),_0x1da0f0(0x122),_0x39e22f,'tdx.json');if(!existsSync(_0x4989c4)){const _0x2479e7=normalizeName(_0x36e05b),_0xd39aa5=a4_0x170d36[_0x1da0f0(0x138)](process[_0x1da0f0(0x16a)](),'agents',_0x2479e7,'tdx.json');existsSync(_0xd39aa5)&&(_0x13ca5d=_0x2479e7,_0x4989c4=_0xd39aa5);}if(existsSync(_0x4989c4))_0x17de53=a4_0x170d36[_0x1da0f0(0x17e)](_0x4989c4),console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x18c)+_0x17de53));else{const _0xfa4999=_0x5f24fd[_0x1da0f0(0x13d)];if(_0xfa4999)throw new SDKError(ErrorCode[_0x1da0f0(0x125)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x36e05b+_0x1da0f0(0x12f),undefined,{'helpText':_0x1da0f0(0x11d)+_0x1da0f0(0x197)+(_0x1da0f0(0x16c)+_0x36e05b+'\x0a')+(_0x1da0f0(0x1c0)+_0x13ca5d+_0x1da0f0(0x137)+(_0x269677||_0x1da0f0(0x19f))+_0x1da0f0(0x1c4)+_0xfa4999)});_0x17de53=_0x36e05b,console['log'](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x190)+_0x36e05b));}}}}if(!_0x17de53)return console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x11a))),console['log'](_0x1da0f0(0x196)),console[_0x1da0f0(0x184)](_0x1da0f0(0x146)),console[_0x1da0f0(0x184)](_0x1da0f0(0x181)),console[_0x1da0f0(0x184)](_0x1da0f0(0x189)),0x1;if(!_0x269677)throw new SDKError(ErrorCode[_0x1da0f0(0x12b)],_0x1da0f0(0x116),undefined,{'helpText':_0x1da0f0(0x16b)});if(!_0x3b01a6&&!_0x17f592){if(!isInteractive())return console['error'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x17f)),_0x1da0f0(0x154)),console[_0x1da0f0(0x176)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x128))),0x1;const _0x373725=await confirmKey(_0x1da0f0(0x174)+_0x17de53+_0x1da0f0(0x1a2)+_0x269677+'\x22?');if(!_0x373725)return console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x1bd))),0x1;}const {data:_0x1758c8}=await withSpinner('Cloning\x20\x22'+_0x17de53+_0x1da0f0(0x185)+_0x269677+_0x1da0f0(0x1b3),()=>_0x59dd50['llm'][_0x1da0f0(0x177)](_0x17de53,_0x269677,{'dryRun':_0x17f592}));if(_0x17f592){console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1da0f0(0x184)](_0x1da0f0(0x164)+_0x1758c8[_0x1da0f0(0x188)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x15b)+_0x269677),console[_0x1da0f0(0x184)](_0x1da0f0(0x1c8)),console[_0x1da0f0(0x184)](_0x1da0f0(0x1cb)+_0x1758c8['counts'][_0x1da0f0(0x122)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x193)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x1bf)+_0x1758c8['counts'][_0x1da0f0(0x1ab)][_0x1da0f0(0x18d)]);const _0x43bf63=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x18d)]>0x0;return _0x43bf63&&(console['log'](_0x1da0f0(0x124)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x18f)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x18d)])),0x0;}const _0x7fee8=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x122)][_0x1da0f0(0x167)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)][_0x1da0f0(0x167)]>0x0||_0x1758c8['counts'][_0x1da0f0(0x1ab)][_0x1da0f0(0x167)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)]['errors']>0x0||_0x1758c8[_0x1da0f0(0x180)]['experimentalArtifacts'][_0x1da0f0(0x167)]>0x0;_0x7fee8?console['log'](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x119))):console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1d0)](_0x1da0f0(0x123)));console[_0x1da0f0(0x184)](_0x1da0f0(0x164)+_0x1758c8['sourceProjectName']),console[_0x1da0f0(0x184)](_0x1da0f0(0x15b)+_0x1758c8[_0x1da0f0(0x1be)]),console['log'](_0x1da0f0(0x1b6)+_0x1758c8[_0x1da0f0(0x1c9)]),console[_0x1da0f0(0x184)](),console[_0x1da0f0(0x184)](_0x1da0f0(0x19b)),console[_0x1da0f0(0x184)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1758c8['counts'][_0x1da0f0(0x122)])),console[_0x1da0f0(0x184)](_0x1da0f0(0x193)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)])),console[_0x1da0f0(0x184)](_0x1da0f0(0x1bf)+formatCountSummary(_0x1758c8['counts']['prompts'])),console['log'](_0x1da0f0(0x1a7)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1a1)]));const _0x1624e4=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x1a9)]>0x0||_0x1758c8['counts']['experimentalKnowledgeBases'][_0x1da0f0(0x16d)]>0x0||_0x1758c8[_0x1da0f0(0x180)]['experimentalArtifacts'][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x1a9)]>0x0||_0x1758c8['counts'][_0x1da0f0(0x163)][_0x1da0f0(0x16d)]>0x0;_0x1624e4&&(console[_0x1da0f0(0x184)](_0x1da0f0(0x124)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)]['experimentalKnowledgeBases'])),console[_0x1da0f0(0x184)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1758c8['counts'][_0x1da0f0(0x163)])));if(_0x7fee8){console[_0x1da0f0(0x184)](),console[_0x1da0f0(0x184)](a4_0x47e7d2['red'](_0x1da0f0(0x169)));for(const _0x2c61a3 of _0x1758c8[_0x1da0f0(0x122)]){_0x2c61a3[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x156)+_0x2c61a3[_0x1da0f0(0x192)]+_0x1da0f0(0x126)+_0x2c61a3['error']));}for(const _0xdcd8cb of _0x1758c8[_0x1da0f0(0x1b2)]){_0xdcd8cb[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x1bc)+_0xdcd8cb['name']+_0x1da0f0(0x126)+_0xdcd8cb[_0x1da0f0(0x176)]));}for(const _0x336478 of _0x1758c8['prompts']){_0x336478['action']==='error'&&console['log'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x19a)+_0x336478[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x336478[_0x1da0f0(0x176)]));}for(const _0x44ae67 of _0x1758c8['integrations']){_0x44ae67[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x14f)+_0x44ae67[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x44ae67[_0x1da0f0(0x176)]));}for(const _0x2a630b of _0x1758c8[_0x1da0f0(0x14e)]){_0x2a630b['action']===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2['red'](_0x1da0f0(0x187)+_0x2a630b['name']+_0x1da0f0(0x126)+_0x2a630b['error']));}for(const _0x137490 of _0x1758c8[_0x1da0f0(0x163)]){_0x137490[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2['red'](_0x1da0f0(0x18e)+_0x137490[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x137490[_0x1da0f0(0x176)]));}return 0x1;}console['log']();const _0x5e2d99=getLLMProjectUrl(_0x18bdbe,_0x1758c8[_0x1da0f0(0x1c9)]);return console['log'](_0x1da0f0(0x1cf)+a4_0x47e7d2[_0x1da0f0(0x145)](_0x5e2d99)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x155);[a4_0x1bde89(0x1aa)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x1bde89(0x14c)](_0x59afb6){const _0x2f3d48=a4_0x1bde89,{options:_0x35de57,args:_0x2806ea,tdx:_0x117f54}=_0x59afb6;let _0x6ef5df=_0x2806ea[0x0]||process[_0x2f3d48(0x16a)]();const _0x4b66f1=_0x35de57[_0x2f3d48(0x17b)],_0x32a4d5=_0x35de57[_0x2f3d48(0x1ad)],_0x5a1056=_0x35de57['yes'],_0x65233d=_0x35de57[_0x2f3d48(0x17d)],_0x2718bf=a4_0x170d36['join'](_0x6ef5df,_0x2f3d48(0x142)),_0x257302=existsSync(_0x2718bf);if(_0x257302){const {data:_0x38e827}=await withSpinner(_0x2f3d48(0x1ae)+_0x6ef5df+_0x2f3d48(0x1b3),()=>_0x117f54[_0x2f3d48(0x159)][_0x2f3d48(0x1c1)](_0x6ef5df,{'dryRun':_0x4b66f1,'force':_0x32a4d5}));if(_0x4b66f1)return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x1c6))),console[_0x2f3d48(0x184)](_0x2f3d48(0x1c2)+_0x38e827[_0x2f3d48(0x192)]),0x0;if(_0x38e827[_0x2f3d48(0x150)]===_0x2f3d48(0x176))return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x199)+_0x38e827['error'])),0x1;console['log'](a4_0x47e7d2[_0x2f3d48(0x1d0)](_0x2f3d48(0x144)+_0x38e827['action']+'\x20successfully')),console[_0x2f3d48(0x184)](_0x2f3d48(0x195)+_0x38e827[_0x2f3d48(0x192)]);if(_0x38e827[_0x2f3d48(0x16f)]&&_0x38e827[_0x2f3d48(0x11f)]){const _0x5c6643=getLLMAgentChatUrl(_0x65233d,_0x38e827[_0x2f3d48(0x11f)],_0x38e827[_0x2f3d48(0x16f)]);console[_0x2f3d48(0x184)](_0x2f3d48(0x120)+a4_0x47e7d2['cyan'](_0x5c6643));}return 0x0;}const _0x1ad51c=_0x35de57['llmProject'],_0x403993=resolveProjectFromContext(_0x6ef5df,_0x1ad51c);if(_0x403993[_0x2f3d48(0x151)])_0x6ef5df=_0x403993[_0x2f3d48(0x118)],_0x403993[_0x2f3d48(0x16e)]===_0x2f3d48(0x1a4)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x182)](_0x2f3d48(0x1a8)+_0x6ef5df));else{let _0x25e581=_0x2f3d48(0x1b4);_0x403993[_0x2f3d48(0x13b)]===_0x2f3d48(0x149)&&(_0x25e581=_0x403993[_0x2f3d48(0x1b7)]+_0x2f3d48(0x15c)+_0x403993['llmProject']+_0x2f3d48(0x14b));throw new SDKError(ErrorCode[_0x2f3d48(0x125)],_0x403993[_0x2f3d48(0x13b)]===_0x2f3d48(0x12d)?_0x403993[_0x2f3d48(0x1b7)]:_0x2f3d48(0x15f)+_0x6ef5df,undefined,{'helpText':_0x25e581});}const {data:_0x553bd5}=await withSpinner(_0x2f3d48(0x132),()=>_0x117f54['llm'][_0x2f3d48(0x14a)](_0x6ef5df,{'dryRun':!![]})),_0x7b6661=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x167)]>0x0;if(_0x7b6661){console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x165)));for(const _0x54777f of _0x553bd5[_0x2f3d48(0x122)]){_0x54777f[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2['red'](_0x2f3d48(0x156)+_0x54777f['agentName']+_0x2f3d48(0x126)+_0x54777f[_0x2f3d48(0x176)]));}return 0x1;}const _0x488513=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)]['created']+_0x553bd5[_0x2f3d48(0x180)]['knowledgeBases'][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x194)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1a1)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)]['created'],_0x1d7e7f=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x194)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x1a9)]+_0x553bd5['counts'][_0x2f3d48(0x1a1)]['updated']+_0x553bd5['counts'][_0x2f3d48(0x14e)][_0x2f3d48(0x1a9)]+_0x553bd5['counts']['experimentalArtifacts'][_0x2f3d48(0x1a9)],_0x318fc2=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x16d)]+_0x553bd5['counts'][_0x2f3d48(0x1b2)][_0x2f3d48(0x16d)]+_0x553bd5['counts']['textKnowledgeBases'][_0x2f3d48(0x16d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)]['unchanged']+_0x553bd5[_0x2f3d48(0x180)]['integrations'][_0x2f3d48(0x16d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x16d)]+_0x553bd5['counts'][_0x2f3d48(0x163)][_0x2f3d48(0x16d)];console[_0x2f3d48(0x184)]('\x0aPush\x20summary\x20for\x20\x27'+_0x553bd5[_0x2f3d48(0x117)]+'\x27:'),console[_0x2f3d48(0x184)]('\x20\x20'+a4_0x47e7d2[_0x2f3d48(0x1d0)]('+\x20'+_0x488513+_0x2f3d48(0x171))+_0x2f3d48(0x1ca)+a4_0x47e7d2[_0x2f3d48(0x1a0)]('~\x20'+_0x1d7e7f+'\x20changed')+_0x2f3d48(0x1ca)+a4_0x47e7d2[_0x2f3d48(0x182)]('=\x20'+_0x318fc2+_0x2f3d48(0x19d))),console[_0x2f3d48(0x184)](_0x2f3d48(0x1cb)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)])),console[_0x2f3d48(0x184)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x157)+formatCountSummary(_0x553bd5['counts']['textKnowledgeBases'])),console[_0x2f3d48(0x184)](_0x2f3d48(0x1bf)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x1a7)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1a1)]));const _0x50018d=_0x553bd5['counts']['experimentalKnowledgeBases'][_0x2f3d48(0x18d)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x1a9)]>0x0||_0x553bd5[_0x2f3d48(0x180)]['experimentalKnowledgeBases'][_0x2f3d48(0x16d)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)][_0x2f3d48(0x18d)]>0x0||_0x553bd5['counts'][_0x2f3d48(0x163)][_0x2f3d48(0x1a9)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)][_0x2f3d48(0x16d)]>0x0;_0x50018d&&(console[_0x2f3d48(0x184)](_0x2f3d48(0x124)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x18f)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)])));console[_0x2f3d48(0x184)](_0x2f3d48(0x160)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x6ef5df)),displayDiffs(_0x553bd5[_0x2f3d48(0x122)],_0x553bd5['knowledgeBases'],_0x553bd5[_0x2f3d48(0x194)],_0x553bd5[_0x2f3d48(0x1ab)],_0x553bd5[_0x2f3d48(0x1a1)],_0x553bd5[_0x2f3d48(0x14e)],_0x553bd5[_0x2f3d48(0x163)]);if(_0x4b66f1)return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x178))),0x0;if(_0x488513===0x0&&_0x1d7e7f===0x0){console[_0x2f3d48(0x184)](a4_0x47e7d2['green'](_0x2f3d48(0x1c7)));const _0x51e1b9=getLLMProjectUrl(_0x65233d,_0x553bd5[_0x2f3d48(0x11f)]);return console[_0x2f3d48(0x184)](_0x2f3d48(0x1cf)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x51e1b9)),0x0;}if(!_0x5a1056&&!_0x32a4d5){if(!isInteractive())return console[_0x2f3d48(0x176)](a4_0x47e7d2[_0x2f3d48(0x19c)]('\x0aError:'),_0x2f3d48(0x154)),console[_0x2f3d48(0x176)](a4_0x47e7d2[_0x2f3d48(0x182)](_0x2f3d48(0x128))),0x1;const _0x566af6=await confirmKey(_0x2f3d48(0x1cc)+(_0x488513+_0x1d7e7f)+_0x2f3d48(0x17c));if(!_0x566af6)return console['log'](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x1bd)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5717a9}=await withSpinner(_0x2f3d48(0x1b1),()=>_0x117f54[_0x2f3d48(0x159)]['pushProject'](_0x6ef5df,{'force':_0x32a4d5})),_0x18b080=_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x167)]>0x0||_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)]['errors']>0x0||_0x5717a9[_0x2f3d48(0x180)]['textKnowledgeBases'][_0x2f3d48(0x167)]>0x0||_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x167)]>0x0;if(_0x18b080){console[_0x2f3d48(0x184)](a4_0x47e7d2['yellow'](_0x2f3d48(0x179))),console[_0x2f3d48(0x184)](),console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x169)));for(const _0x1a5e85 of _0x5717a9[_0x2f3d48(0x122)]){_0x1a5e85[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x156)+_0x1a5e85['agentName']+_0x2f3d48(0x126)+_0x1a5e85['error']));}for(const _0x34f477 of _0x5717a9['knowledgeBases']){_0x34f477[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x1bc)+_0x34f477['name']+'\x22:\x20'+_0x34f477[_0x2f3d48(0x176)]));}for(const _0x2e4c45 of _0x5717a9[_0x2f3d48(0x194)]){_0x2e4c45[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x1ba)+_0x2e4c45[_0x2f3d48(0x1bb)]+_0x2f3d48(0x126)+_0x2e4c45[_0x2f3d48(0x176)]));}for(const _0x2ce7c4 of _0x5717a9[_0x2f3d48(0x1ab)]){_0x2ce7c4[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2['red'](_0x2f3d48(0x19a)+_0x2ce7c4[_0x2f3d48(0x1bb)]+'\x22:\x20'+_0x2ce7c4['error']));}for(const _0xeca6a4 of _0x5717a9[_0x2f3d48(0x1a1)]){_0xeca6a4[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2['red'](_0x2f3d48(0x14f)+_0xeca6a4['name']+_0x2f3d48(0x126)+_0xeca6a4[_0x2f3d48(0x176)]));}return 0x1;}console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1d0)](_0x2f3d48(0x13c)+(_0x488513+_0x1d7e7f)+_0x2f3d48(0x158)+_0x5717a9[_0x2f3d48(0x117)]+'\x27'));const _0x23910c=getLLMProjectUrl(_0x65233d,_0x5717a9[_0x2f3d48(0x11f)]);return console[_0x2f3d48(0x184)](_0x2f3d48(0x1cf)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x23910c)),0x0;}}
|
|
1
|
+
const a4_0x19e74f=a4_0x557c;(function(_0x20e12e,_0x24213d){const _0x16cf61=a4_0x557c,_0xe83c7a=_0x20e12e();while(!![]){try{const _0x389125=-parseInt(_0x16cf61(0x160))/0x1*(parseInt(_0x16cf61(0x196))/0x2)+parseInt(_0x16cf61(0x15d))/0x3+parseInt(_0x16cf61(0x10c))/0x4*(parseInt(_0x16cf61(0x10f))/0x5)+parseInt(_0x16cf61(0xfa))/0x6+-parseInt(_0x16cf61(0x143))/0x7*(-parseInt(_0x16cf61(0x156))/0x8)+parseInt(_0x16cf61(0x137))/0x9*(-parseInt(_0x16cf61(0x1a1))/0xa)+-parseInt(_0x16cf61(0x11a))/0xb;if(_0x389125===_0x24213d)break;else _0xe83c7a['push'](_0xe83c7a['shift']());}catch(_0x156907){_0xe83c7a['push'](_0xe83c7a['shift']());}}}(a4_0x5ad9,0xc2d53));import a4_0x2ecb38 from'chalk';import a4_0x57cc7d 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}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x5ad9(){const _0x4de95d=['Using\x20project\x20from\x20','execute','Usage:\x20tdx\x20agent\x20pull\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)','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','pullProject','Dry\x20run\x20-\x20no\x20files\x20written','573417mwStYg','\x20\x20Knowledge\x20Bases:\x20','profile','Output\x20path:\x20','new','-\x20nothing\x20pushed','yes','\x0aError:','outputDir','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','repeat','\x20\x20Prompt\x20\x22','7SoHwKm','cwd','llm_project','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Agent\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20updated','\x20\x20Source:\x20','llm','outputPath','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','output','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cloneProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','reason','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','1913608RYIYhw','\x20successfully','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','total','llmProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','prompts','3670212bCxckh','\x22...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','3541jAmmrY','\x0aProject\x20pushed\x20with\x20errors','MISSING_ARGUMENT','\x20\x20Integrations:\x20','\x20total','error','pullAgent','site','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Project:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x20|\x20','sourceProjectName','\x20resources\x20to\x20\x27','log','\x0aChanges:','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','integrations','New\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','\x20changed','dim','yellow','newProjectId','cyan','\x20\x20Knowledge\x20Base\x20\x22','Pulling\x20agent\x20\x22','force','\x20unchanged','projectName','Project\x20cloned\x20with\x20errors','agents','Pushing\x20to\x20project...','\x20--profile\x20','\x20\x20Agents:\x20','\x0aErrors\x20found:','INVALID_ARGUMENT','tdx.json','New\x20project\x20ID:\x20','created','Clone\x20\x22','updated','Agent:\x20','Using\x20current\x20project:\x20','\x22:\x20','utf-8','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20context\x20project:\x20','experimentalKnowledgeBases','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Pushing\x20agent\x20from\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','466VwxXXm','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','found','agent:pull','\x22\x20to\x20a\x20different\x20profile','\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)','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20new','\x20created','agent:clone','pushAgent','230gexjBl','\x0aPull\x20summary\x20for\x20\x27','unchanged','join','Would\x20pull\x20agent:\x20','Cancelled','\x20files\x20to\x20','action','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','session','Using\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','textKnowledgeBases','counts','Summary:','\x0aChanges\x20to\x20prompt\x20\x27','\x0aPush\x20summary\x20for\x20\x27','Project\x20cloned\x20successfully','2366406zjzokW','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','source','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','green','isNew','projectId','agent.yml','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','diff','Source:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20files?','\x20=\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','knowledgeBases','6239356bgmZVt','Writing\x20files...','Failed\x20to\x20push\x20agent:\x20','5aOakRZ','push','experimentalArtifacts','\x20\x20Integration\x20\x22','\x0aWrite\x20','\x20\x20Prompts:\x20','Using\x20local\x20project:\x20','name','hasChanges','agentName','red','3611938uTQwGU','✔\x20Context\x20set:\x20','agentId','errors','<new-name>','context','gray','\x20--name\x20','\x22\x20to\x20new\x20project\x20\x22','pushProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20tdx\x20agent\x20pull\x20','description','dirname','message','no_context','Analyzing\x20project\x20\x22','Errors:','parse','Agent\x20','Status:\x20','\x0a✔\x20Pushed\x20','Would\x20push\x20agent:\x20'];a4_0x5ad9=function(){return _0x4de95d;};return a4_0x5ad9();}function formatCountSummary(_0x335f80){const _0x26c6e1=a4_0x557c,_0x2532d6=[];if(_0x335f80[_0x26c6e1(0x159)]!==undefined)_0x2532d6[_0x26c6e1(0x110)](_0x335f80['total']+_0x26c6e1(0x164));if(_0x335f80['new']!==undefined&&_0x335f80['new']>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38['green'](_0x335f80['new']+_0x26c6e1(0x19d)));if(_0x335f80[_0x26c6e1(0x188)]!==undefined&&_0x335f80['created']>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38['green'](_0x335f80[_0x26c6e1(0x188)]+_0x26c6e1(0x19e)));if(_0x335f80[_0x26c6e1(0x18a)]!==undefined&&_0x335f80['updated']>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38['yellow'](_0x335f80[_0x26c6e1(0x18a)]+_0x26c6e1(0x149)));if(_0x335f80[_0x26c6e1(0x1a3)]!==undefined&&_0x335f80[_0x26c6e1(0x1a3)]>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38[_0x26c6e1(0x120)](_0x335f80[_0x26c6e1(0x1a3)]+_0x26c6e1(0x17d)));if(_0x335f80[_0x26c6e1(0x11d)]!==undefined&&_0x335f80[_0x26c6e1(0x11d)]>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38[_0x26c6e1(0x119)](_0x335f80[_0x26c6e1(0x11d)]+'\x20errors'));return _0x2532d6[_0x26c6e1(0x1a4)](',\x20');}function displayDiffs(_0x45b5d2,_0x38f017,_0x4b8c74,_0x38afda,_0x47a299,_0x2a7e89,_0x31be38){const _0x201aa1=a4_0x557c;for(const _0x197ee4 of _0x45b5d2){if(_0x197ee4[_0x201aa1(0x105)]){const _0x18012a=_0x197ee4[_0x201aa1(0x118)]||_0x197ee4[_0x201aa1(0x116)];console[_0x201aa1(0x16e)](_0x201aa1(0x16a)+_0x18012a+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console['log'](_0x197ee4[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c));}}for(const _0x321437 of _0x38f017){_0x321437[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0x195)+_0x321437[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0x321437[_0x201aa1(0x105)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3d5924 of _0x4b8c74){_0x3d5924['diff']&&(console[_0x201aa1(0x16e)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3d5924[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0x3d5924[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)));}for(const _0x1754d5 of _0x38afda){_0x1754d5[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0xf7)+_0x1754d5[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console['log'](_0x1754d5[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)));}for(const _0xe985be of _0x47a299){_0xe985be[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0x170)+_0xe985be[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0xe985be[_0x201aa1(0x105)]),console['log']('─'[_0x201aa1(0x141)](0x3c)));}for(const _0x5876b6 of _0x2a7e89){_0x5876b6['diff']&&(console[_0x201aa1(0x16e)](_0x201aa1(0x104)+_0x5876b6[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console['log'](_0x5876b6[_0x201aa1(0x105)]),console['log']('─'[_0x201aa1(0x141)](0x3c)));}for(const _0x4abdf9 of _0x31be38){_0x4abdf9[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0xfd)+_0x4abdf9[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0x4abdf9[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x19e74f(0x116)]=a4_0x19e74f(0x199);[a4_0x19e74f(0x126)]=a4_0x19e74f(0x15b);async[a4_0x19e74f(0x132)](_0x1a32e2){const _0x588cd8=a4_0x19e74f,{options:_0x81048c,args:_0x576111,tdx:_0x28007c}=_0x1a32e2,_0x3b4b2c=_0x576111[0x0],_0x128bdc=_0x576111[0x1],_0x3217a7=_0x81048c[_0x588cd8(0x14e)],_0x44dd92=_0x81048c['dryRun'],_0x2c1358=_0x81048c['force'],_0xf7e9b0=_0x81048c[_0x588cd8(0x13d)],_0x4ee193=_0x81048c[_0x588cd8(0x15a)];let _0x531989,_0x411f23;const _0x8cf633=findAgentConfigPath(process[_0x588cd8(0x144)]());if(_0x3b4b2c){const _0x4d266a=a4_0x57cc7d[_0x588cd8(0x1a4)](_0x3b4b2c,_0x588cd8(0x186));if(existsSync(_0x4d266a))try{const _0x302bba=JSON['parse'](readFileSync(_0x4d266a,_0x588cd8(0x18e)));_0x531989=_0x302bba[_0x588cd8(0x145)],_0x411f23=_0x3b4b2c,console['log'](a4_0x2ecb38[_0x588cd8(0x176)](_0x588cd8(0x131)+_0x4d266a+':\x20'+_0x531989));}catch{_0x531989=_0x3b4b2c;}else _0x531989=_0x3b4b2c;}else{if(_0x8cf633)try{const _0x26fc3a=JSON[_0x588cd8(0x12c)](readFileSync(_0x8cf633,_0x588cd8(0x18e)));_0x531989=_0x26fc3a['llm_project'],_0x411f23=a4_0x57cc7d[_0x588cd8(0x127)](_0x8cf633),console[_0x588cd8(0x16e)](a4_0x2ecb38['dim'](_0x588cd8(0xf2)+_0x531989));}catch{_0x531989=_0x4ee193;}else _0x531989=_0x4ee193;}if(!_0x531989)return console['log'](a4_0x2ecb38['yellow'](_0x588cd8(0x10a))),console[_0x588cd8(0x16e)](_0x588cd8(0x133)),console[_0x588cd8(0x16e)](_0x588cd8(0x134)),console[_0x588cd8(0x16e)](_0x588cd8(0x124)),console[_0x588cd8(0x16e)](_0x588cd8(0x193)),0x1;if(_0x128bdc){const {data:_0x44bbea}=await withSpinner(_0x588cd8(0x17b)+_0x128bdc+'\x22\x20from\x20project\x20\x22'+_0x531989+_0x588cd8(0x15e),()=>_0x28007c[_0x588cd8(0x14b)][_0x588cd8(0x166)](_0x531989,_0x128bdc,_0x3217a7,{'dryRun':_0x44dd92,'force':_0x2c1358}));if(_0x44dd92)return console[_0x588cd8(0x16e)](a4_0x2ecb38['yellow'](_0x588cd8(0x136))),console[_0x588cd8(0x16e)](_0x588cd8(0x1a5)+_0x44bbea[_0x588cd8(0x118)]),console[_0x588cd8(0x16e)](_0x588cd8(0x13a)+_0x44bbea[_0x588cd8(0x14c)]),_0x44bbea[_0x588cd8(0x105)]&&(console[_0x588cd8(0x16e)](_0x588cd8(0x16f)),console[_0x588cd8(0x16e)]('─'[_0x588cd8(0x141)](0x3c)),console[_0x588cd8(0x16e)](_0x44bbea['diff']),console['log']('─'[_0x588cd8(0x141)](0x3c))),0x0;return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0xfe)]('Agent\x20pulled\x20successfully')),console['log'](_0x588cd8(0x18b)+_0x44bbea[_0x588cd8(0x118)]),console['log']('Output:\x20'+_0x44bbea[_0x588cd8(0x14c)]),console[_0x588cd8(0x16e)](_0x588cd8(0x12e)+(_0x44bbea[_0x588cd8(0xff)]?a4_0x2ecb38[_0x588cd8(0xfe)](_0x588cd8(0x13b)):_0x44bbea[_0x588cd8(0x117)]?a4_0x2ecb38[_0x588cd8(0x177)]('updated'):a4_0x2ecb38[_0x588cd8(0x120)](_0x588cd8(0x1a3)))),0x0;}const _0x18de3d=_0x411f23||_0x3217a7,{data:_0x54ca88}=await withSpinner(_0x588cd8(0x12a)+_0x531989+_0x588cd8(0x15e),()=>_0x28007c['llm'][_0x588cd8(0x135)](_0x531989,_0x18de3d,{'dryRun':!![]})),_0x48e503=_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x180)][_0x588cd8(0x13b)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x10b)][_0x588cd8(0x13b)]+_0x54ca88['counts']['textKnowledgeBases'][_0x588cd8(0x13b)]+_0x54ca88[_0x588cd8(0xf5)]['prompts'][_0x588cd8(0x13b)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x172)][_0x588cd8(0x13b)]+_0x54ca88['counts'][_0x588cd8(0x191)][_0x588cd8(0x13b)]+_0x54ca88['counts'][_0x588cd8(0x111)][_0x588cd8(0x13b)],_0x13ae90=_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x180)][_0x588cd8(0x18a)]+_0x54ca88['counts']['knowledgeBases'][_0x588cd8(0x18a)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0xf4)][_0x588cd8(0x18a)]+_0x54ca88[_0x588cd8(0xf5)]['prompts']['updated']+_0x54ca88['counts'][_0x588cd8(0x172)][_0x588cd8(0x18a)]+_0x54ca88[_0x588cd8(0xf5)]['experimentalKnowledgeBases']['updated']+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)]['updated'],_0x55572b=_0x54ca88['counts'][_0x588cd8(0x180)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x10b)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)]['textKnowledgeBases'][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x15c)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x172)][_0x588cd8(0x1a3)]+_0x54ca88['counts'][_0x588cd8(0x191)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)][_0x588cd8(0x1a3)];console[_0x588cd8(0x16e)](_0x588cd8(0x1a2)+_0x54ca88[_0x588cd8(0x17e)]+'\x27:'),console[_0x588cd8(0x16e)]('\x20\x20'+a4_0x2ecb38[_0x588cd8(0xfe)]('+\x20'+_0x48e503+'\x20new')+_0x588cd8(0x16b)+a4_0x2ecb38[_0x588cd8(0x177)]('~\x20'+_0x13ae90+'\x20changed')+_0x588cd8(0x16b)+a4_0x2ecb38[_0x588cd8(0x176)]('=\x20'+_0x55572b+_0x588cd8(0x17d))),console[_0x588cd8(0x16e)](_0x588cd8(0x183)+formatCountSummary(_0x54ca88['counts'][_0x588cd8(0x180)])),console[_0x588cd8(0x16e)](_0x588cd8(0x138)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x10b)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0xf4)])),console['log'](_0x588cd8(0x114)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)]['prompts'])),console[_0x588cd8(0x16e)](_0x588cd8(0x163)+formatCountSummary(_0x54ca88['counts']['integrations']));const _0x30664a=_0x54ca88[_0x588cd8(0xf5)]['experimentalKnowledgeBases'][_0x588cd8(0x159)]>0x0||_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)][_0x588cd8(0x159)]>0x0;_0x30664a&&(console[_0x588cd8(0x16e)](_0x588cd8(0x168)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x191)])),console[_0x588cd8(0x16e)](_0x588cd8(0x171)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)])));console[_0x588cd8(0x16e)]('\x20\x20Target:\x20'+a4_0x2ecb38[_0x588cd8(0x179)](_0x54ca88['outputDir'])),displayDiffs(_0x54ca88[_0x588cd8(0x180)],_0x54ca88[_0x588cd8(0x10b)],_0x54ca88[_0x588cd8(0xf4)],_0x54ca88['prompts'],_0x54ca88[_0x588cd8(0x172)],_0x54ca88[_0x588cd8(0x191)],_0x54ca88['experimentalArtifacts']);if(_0x44dd92)return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0x177)](_0x588cd8(0x14f))),0x0;if(_0x48e503===0x0&&_0x13ae90===0x0)return console[_0x588cd8(0x16e)](a4_0x2ecb38['green'](_0x588cd8(0xfb))),saveSessionContext({'llm_project':_0x54ca88[_0x588cd8(0x17e)]},_0x81048c['session']),console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0xfe)](_0x588cd8(0x11b)+a4_0x2ecb38['dim'](_0x588cd8(0x145))+_0x588cd8(0x109)+a4_0x2ecb38[_0x588cd8(0x179)](_0x54ca88[_0x588cd8(0x17e)]))),0x0;if(!_0xf7e9b0&&!_0x2c1358){if(!isInteractive())return console[_0x588cd8(0x165)](a4_0x2ecb38[_0x588cd8(0x119)](_0x588cd8(0x13e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x588cd8(0x165)](a4_0x2ecb38[_0x588cd8(0x176)](_0x588cd8(0x15f))),0x1;const _0x49cdbc=await confirmKey(_0x588cd8(0x113)+(_0x48e503+_0x13ae90)+_0x588cd8(0x108));if(!_0x49cdbc)return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0x177)](_0x588cd8(0x1a6)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x29d25a}=await withSpinner(_0x588cd8(0x10d),()=>_0x28007c['llm']['pullProject'](_0x531989,_0x18de3d,{'force':_0x2c1358}));return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0xfe)]('\x0a✔\x20Pulled\x20'+(_0x48e503+_0x13ae90)+_0x588cd8(0xee)+_0x29d25a[_0x588cd8(0x13f)])),saveSessionContext({'llm_project':_0x29d25a['projectName']},_0x81048c[_0x588cd8(0xf1)]),console['log'](a4_0x2ecb38[_0x588cd8(0xfe)](_0x588cd8(0x11b)+a4_0x2ecb38[_0x588cd8(0x176)](_0x588cd8(0x145))+_0x588cd8(0x109)+a4_0x2ecb38[_0x588cd8(0x179)](_0x29d25a[_0x588cd8(0x17e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x19e74f(0x19f);['description']=a4_0x19e74f(0x146);async[a4_0x19e74f(0x132)](_0x1ce253){const _0x432f39=a4_0x19e74f,{options:_0x52ba84,args:_0x4f16bb,tdx:_0x42edbe}=_0x1ce253,_0x539c0d=_0x4f16bb[0x0],_0x54319b=_0x52ba84[_0x432f39(0x116)],_0x360711=_0x52ba84['dryRun'],_0x3155eb=_0x52ba84[_0x432f39(0x13d)],_0x19b12c=_0x52ba84[_0x432f39(0x167)],_0x2eef1a=_0x52ba84['llmProject'];let _0xdbadee;const _0xf825db=findAgentConfigPath(process[_0x432f39(0x144)]());if(_0x539c0d){const _0x8739a3=a4_0x57cc7d[_0x432f39(0x1a4)](_0x539c0d,_0x432f39(0x186));existsSync(_0x8739a3)?(_0xdbadee=_0x539c0d,console[_0x432f39(0x16e)](a4_0x2ecb38['dim'](_0x432f39(0x115)+_0x539c0d))):_0xdbadee=_0x539c0d;}else{if(_0xf825db)_0xdbadee=a4_0x57cc7d[_0x432f39(0x127)](_0xf825db),console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x176)](_0x432f39(0x18c)+_0xdbadee));else{if(_0x2eef1a){const _0x50e348=sanitizeForFilesystem(_0x2eef1a);let _0x2216bb=_0x50e348,_0xb6437a=a4_0x57cc7d[_0x432f39(0x1a4)](process['cwd'](),_0x432f39(0x180),_0x50e348,_0x432f39(0x186));if(!existsSync(_0xb6437a)){const _0x1992ac=normalizeName(_0x2eef1a),_0x3d148b=a4_0x57cc7d[_0x432f39(0x1a4)](process[_0x432f39(0x144)](),'agents',_0x1992ac,_0x432f39(0x186));existsSync(_0x3d148b)&&(_0x2216bb=_0x1992ac,_0xb6437a=_0x3d148b);}if(existsSync(_0xb6437a))_0xdbadee=a4_0x57cc7d['dirname'](_0xb6437a),console['log'](a4_0x2ecb38[_0x432f39(0x176)](_0x432f39(0x115)+_0xdbadee));else{const _0x1d68c4=_0x52ba84[_0x432f39(0x139)];if(_0x1d68c4)throw new SDKError(ErrorCode[_0x432f39(0x185)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2eef1a+_0x432f39(0x19a),undefined,{'helpText':_0x432f39(0x148)+_0x432f39(0x103)+(_0x432f39(0x125)+_0x2eef1a+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2216bb+_0x432f39(0x121)+(_0x54319b||_0x432f39(0x11e))+_0x432f39(0x182)+_0x1d68c4)});_0xdbadee=_0x2eef1a,console[_0x432f39(0x16e)](a4_0x2ecb38['dim'](_0x432f39(0x190)+_0x2eef1a));}}}}if(!_0xdbadee)return console['log'](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x107))),console[_0x432f39(0x16e)](_0x432f39(0x14d)),console[_0x432f39(0x16e)](_0x432f39(0x140)),console['log'](_0x432f39(0x19b)),console[_0x432f39(0x16e)](_0x432f39(0x18f)),0x1;if(!_0x54319b)throw new SDKError(ErrorCode[_0x432f39(0x162)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x432f39(0x19c)});if(!_0x3155eb&&!_0x360711){if(!isInteractive())return console[_0x432f39(0x165)](a4_0x2ecb38['red']('\x0aError:'),_0x432f39(0x197)),console['error'](a4_0x2ecb38[_0x432f39(0x176)](_0x432f39(0x15f))),0x1;const _0x130d33=await confirmKey(_0x432f39(0x189)+_0xdbadee+_0x432f39(0x122)+_0x54319b+'\x22?');if(!_0x130d33)return console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x1a6))),0x1;}const {data:_0x42cf85}=await withSpinner('Cloning\x20\x22'+_0xdbadee+'\x22\x20to\x20\x22'+_0x54319b+_0x432f39(0x15e),()=>_0x42edbe[_0x432f39(0x14b)][_0x432f39(0x150)](_0xdbadee,_0x54319b,{'dryRun':_0x360711}));if(_0x360711){console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x152))),console[_0x432f39(0x16e)]('Source:\x20'+_0x42cf85[_0x432f39(0x16c)]),console['log'](_0x432f39(0x173)+_0x54319b),console[_0x432f39(0x16e)]('Would\x20clone:'),console[_0x432f39(0x16e)](_0x432f39(0x183)+_0x42cf85[_0x432f39(0xf5)]['agents'][_0x432f39(0x188)]),console[_0x432f39(0x16e)]('\x20\x20Knowledge\x20Bases:\x20'+_0x42cf85['counts']['knowledgeBases'][_0x432f39(0x188)]),console['log'](_0x432f39(0x114)+_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x15c)][_0x432f39(0x188)]);const _0x4b6e67=_0x42cf85['counts'][_0x432f39(0x191)][_0x432f39(0x188)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x111)][_0x432f39(0x188)]>0x0;return _0x4b6e67&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x42cf85['counts']['experimentalKnowledgeBases'][_0x432f39(0x188)]),console['log'](_0x432f39(0x171)+_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x188)])),0x0;}const _0x52af44=_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x180)][_0x432f39(0x11d)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x10b)][_0x432f39(0x11d)]>0x0||_0x42cf85['counts'][_0x432f39(0x15c)][_0x432f39(0x11d)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)][_0x432f39(0x11d)]>0x0||_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x11d)]>0x0;_0x52af44?console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x17f))):console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0xfe)](_0x432f39(0xf9)));console[_0x432f39(0x16e)](_0x432f39(0x106)+_0x42cf85[_0x432f39(0x16c)]),console['log']('New\x20project:\x20'+_0x42cf85['newProjectName']),console[_0x432f39(0x16e)](_0x432f39(0x187)+_0x42cf85[_0x432f39(0x178)]),console[_0x432f39(0x16e)](),console[_0x432f39(0x16e)](_0x432f39(0xf6)),console['log'](_0x432f39(0x183)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['agents'])),console[_0x432f39(0x16e)](_0x432f39(0x138)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['knowledgeBases'])),console['log'](_0x432f39(0x114)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['prompts'])),console[_0x432f39(0x16e)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['integrations']));const _0x351437=_0x42cf85['counts'][_0x432f39(0x191)][_0x432f39(0x188)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)]['updated']>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)][_0x432f39(0x1a3)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x111)][_0x432f39(0x188)]>0x0||_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x18a)]>0x0||_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x1a3)]>0x0;_0x351437&&(console[_0x432f39(0x16e)](_0x432f39(0x168)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)])),console[_0x432f39(0x16e)](_0x432f39(0x171)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['experimentalArtifacts'])));if(_0x52af44){console['log'](),console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)](_0x432f39(0x12b)));for(const _0xea7a0c of _0x42cf85['agents']){_0xea7a0c[_0x432f39(0xef)]===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38['red']('\x20\x20Agent\x20\x22'+_0xea7a0c[_0x432f39(0x118)]+_0x432f39(0x18d)+_0xea7a0c[_0x432f39(0x165)]));}for(const _0xe7b8aa of _0x42cf85[_0x432f39(0x10b)]){_0xe7b8aa[_0x432f39(0xef)]===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)]('\x20\x20Knowledge\x20Base\x20\x22'+_0xe7b8aa[_0x432f39(0x116)]+_0x432f39(0x18d)+_0xe7b8aa[_0x432f39(0x165)]));}for(const _0x365425 of _0x42cf85[_0x432f39(0x15c)]){_0x365425['action']===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)](_0x432f39(0x142)+_0x365425[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x365425[_0x432f39(0x165)]));}for(const _0x7668a0 of _0x42cf85['integrations']){_0x7668a0[_0x432f39(0xef)]===_0x432f39(0x165)&&console['log'](a4_0x2ecb38[_0x432f39(0x119)](_0x432f39(0x112)+_0x7668a0[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x7668a0[_0x432f39(0x165)]));}for(const _0x2c5fb6 of _0x42cf85['experimentalKnowledgeBases']){_0x2c5fb6[_0x432f39(0xef)]===_0x432f39(0x165)&&console['log'](a4_0x2ecb38['red'](_0x432f39(0x158)+_0x2c5fb6[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x2c5fb6['error']));}for(const _0x5d6752 of _0x42cf85[_0x432f39(0x111)]){_0x5d6752[_0x432f39(0xef)]===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5d6752[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x5d6752[_0x432f39(0x165)]));}return 0x1;}console[_0x432f39(0x16e)]();const _0x4e4955=getLLMProjectUrl(_0x19b12c,_0x42cf85[_0x432f39(0x178)]);return console[_0x432f39(0x16e)](_0x432f39(0x169)+a4_0x2ecb38[_0x432f39(0x179)](_0x4e4955)),0x0;}}function a4_0x557c(_0xe5e429,_0x371a0f){_0xe5e429=_0xe5e429-0xee;const _0x5ad9eb=a4_0x5ad9();let _0x557c7e=_0x5ad9eb[_0xe5e429];return _0x557c7e;}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x19e74f(0x126)]=a4_0x19e74f(0x102);async[a4_0x19e74f(0x132)](_0x19a00b){const _0x43e77c=a4_0x19e74f,{options:_0x17c377,args:_0x572933,tdx:_0x5d7419}=_0x19a00b;let _0x40d056=_0x572933[0x0]||process[_0x43e77c(0x144)]();const _0x34aa66=_0x17c377['dryRun'],_0x2bf2d3=_0x17c377[_0x43e77c(0x17c)],_0x2e4fb2=_0x17c377[_0x43e77c(0x13d)],_0x31792f=_0x17c377[_0x43e77c(0x167)],_0x228783=a4_0x57cc7d[_0x43e77c(0x1a4)](_0x40d056,_0x43e77c(0x101)),_0x455138=existsSync(_0x228783);if(_0x455138){const {data:_0x54156e}=await withSpinner(_0x43e77c(0x194)+_0x40d056+_0x43e77c(0x15e),()=>_0x5d7419[_0x43e77c(0x14b)][_0x43e77c(0x1a0)](_0x40d056,{'dryRun':_0x34aa66,'force':_0x2bf2d3}));if(_0x34aa66)return console['log'](a4_0x2ecb38[_0x43e77c(0x177)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x43e77c(0x16e)](_0x43e77c(0x130)+_0x54156e['agentName']),0x0;if(_0x54156e[_0x43e77c(0xef)]===_0x43e77c(0x165))return console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x10e)+_0x54156e[_0x43e77c(0x165)])),0x1;console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0xfe)](_0x43e77c(0x12d)+_0x54156e['action']+_0x43e77c(0x157))),console[_0x43e77c(0x16e)]('Agent:\x20'+_0x54156e['agentName']);if(_0x54156e[_0x43e77c(0x11c)]&&_0x54156e[_0x43e77c(0x100)]){const _0x4f7091=getLLMAgentChatUrl(_0x31792f,_0x54156e['projectId'],_0x54156e[_0x43e77c(0x11c)]);console['log']('Chat:\x20'+a4_0x2ecb38[_0x43e77c(0x179)](_0x4f7091));}return 0x0;}const _0x14b1e6=_0x17c377['llmProject'],_0x1136ee=resolveProjectFromContext(_0x40d056,_0x14b1e6);if(_0x1136ee[_0x43e77c(0x198)])_0x40d056=_0x1136ee['projectDir'],_0x1136ee[_0x43e77c(0xfc)]===_0x43e77c(0x11f)&&console['log'](a4_0x2ecb38[_0x43e77c(0x176)](_0x43e77c(0xf2)+_0x40d056));else{let _0x151ca2=_0x43e77c(0xf0);_0x1136ee[_0x43e77c(0x153)]==='no_local_folder'&&(_0x151ca2=_0x1136ee[_0x43e77c(0x128)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1136ee[_0x43e77c(0x15a)]+_0x43e77c(0x154));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1136ee['reason']===_0x43e77c(0x129)?_0x1136ee[_0x43e77c(0x128)]:_0x43e77c(0x174)+_0x40d056,undefined,{'helpText':_0x151ca2});}const {data:_0x3d49b4}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x5d7419[_0x43e77c(0x14b)]['pushProject'](_0x40d056,{'dryRun':!![]})),_0x33d12c=_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x180)]['errors']>0x0;if(_0x33d12c){console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x184)));for(const _0x57a326 of _0x3d49b4[_0x43e77c(0x180)]){_0x57a326[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console[_0x43e77c(0x16e)](a4_0x2ecb38['red'](_0x43e77c(0x147)+_0x57a326[_0x43e77c(0x118)]+_0x43e77c(0x18d)+_0x57a326['error']));}return 0x1;}const _0x350c6f=_0x3d49b4[_0x43e77c(0xf5)]['agents'][_0x43e77c(0x188)]+_0x3d49b4['counts'][_0x43e77c(0x10b)][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0xf4)][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)]['prompts'][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x172)][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)]['experimentalKnowledgeBases'][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)]['experimentalArtifacts'][_0x43e77c(0x188)],_0x201166=_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x180)]['updated']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x10b)]['updated']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0xf4)][_0x43e77c(0x18a)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x15c)][_0x43e77c(0x18a)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x172)][_0x43e77c(0x18a)]+_0x3d49b4['counts'][_0x43e77c(0x191)][_0x43e77c(0x18a)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x111)][_0x43e77c(0x18a)],_0x305801=_0x3d49b4[_0x43e77c(0xf5)]['agents'][_0x43e77c(0x1a3)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x10b)]['unchanged']+_0x3d49b4[_0x43e77c(0xf5)]['textKnowledgeBases'][_0x43e77c(0x1a3)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x15c)]['unchanged']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x172)]['unchanged']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x191)][_0x43e77c(0x1a3)]+_0x3d49b4[_0x43e77c(0xf5)]['experimentalArtifacts'][_0x43e77c(0x1a3)];console['log'](_0x43e77c(0xf8)+_0x3d49b4['projectName']+'\x27:'),console[_0x43e77c(0x16e)]('\x20\x20'+a4_0x2ecb38[_0x43e77c(0xfe)]('+\x20'+_0x350c6f+_0x43e77c(0x19d))+_0x43e77c(0x16b)+a4_0x2ecb38['yellow']('~\x20'+_0x201166+_0x43e77c(0x175))+'\x20|\x20'+a4_0x2ecb38['dim']('=\x20'+_0x305801+_0x43e77c(0x17d))),console[_0x43e77c(0x16e)](_0x43e77c(0x183)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x180)])),console[_0x43e77c(0x16e)](_0x43e77c(0x138)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x10b)])),console['log'](_0x43e77c(0x192)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0xf4)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x15c)])),console[_0x43e77c(0x16e)](_0x43e77c(0x163)+formatCountSummary(_0x3d49b4['counts'][_0x43e77c(0x172)]));const _0x1e6263=_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x191)][_0x43e77c(0x188)]>0x0||_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x191)]['updated']>0x0||_0x3d49b4[_0x43e77c(0xf5)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x3d49b4['counts'][_0x43e77c(0x111)]['created']>0x0||_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x111)][_0x43e77c(0x18a)]>0x0||_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x111)]['unchanged']>0x0;_0x1e6263&&(console[_0x43e77c(0x16e)](_0x43e77c(0x168)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)]['experimentalKnowledgeBases'])),console[_0x43e77c(0x16e)](_0x43e77c(0x171)+formatCountSummary(_0x3d49b4['counts'][_0x43e77c(0x111)])));console['log'](_0x43e77c(0x14a)+a4_0x2ecb38['cyan'](_0x40d056)),displayDiffs(_0x3d49b4[_0x43e77c(0x180)],_0x3d49b4[_0x43e77c(0x10b)],_0x3d49b4[_0x43e77c(0xf4)],_0x3d49b4['prompts'],_0x3d49b4['integrations'],_0x3d49b4['experimentalKnowledgeBases'],_0x3d49b4['experimentalArtifacts']);if(_0x34aa66)return console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x177)](_0x43e77c(0xf3))),0x0;if(_0x350c6f===0x0&&_0x201166===0x0){console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0xfe)](_0x43e77c(0x155)));const _0x6f2a5e=getLLMProjectUrl(_0x31792f,_0x3d49b4[_0x43e77c(0x100)]);return console[_0x43e77c(0x16e)]('Project:\x20'+a4_0x2ecb38[_0x43e77c(0x179)](_0x6f2a5e)),0x0;}if(!_0x2e4fb2&&!_0x2bf2d3){if(!isInteractive())return console[_0x43e77c(0x165)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x13e)),_0x43e77c(0x197)),console[_0x43e77c(0x165)](a4_0x2ecb38[_0x43e77c(0x176)](_0x43e77c(0x15f))),0x1;const _0x2f6176=await confirmKey('\x0aPush\x20'+(_0x350c6f+_0x201166)+'\x20resources?');if(!_0x2f6176)return console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x177)](_0x43e77c(0x1a6)),_0x43e77c(0x13c)),0x1;}const {data:_0x4752b3}=await withSpinner(_0x43e77c(0x181),()=>_0x5d7419[_0x43e77c(0x14b)][_0x43e77c(0x123)](_0x40d056,{'force':_0x2bf2d3})),_0x495142=_0x4752b3['counts']['agents']['errors']>0x0||_0x4752b3[_0x43e77c(0xf5)][_0x43e77c(0x10b)][_0x43e77c(0x11d)]>0x0||_0x4752b3[_0x43e77c(0xf5)]['textKnowledgeBases'][_0x43e77c(0x11d)]>0x0||_0x4752b3[_0x43e77c(0xf5)][_0x43e77c(0x15c)][_0x43e77c(0x11d)]>0x0;if(_0x495142){console['log'](a4_0x2ecb38[_0x43e77c(0x177)](_0x43e77c(0x161))),console[_0x43e77c(0x16e)](),console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x12b)));for(const _0x510154 of _0x4752b3[_0x43e77c(0x180)]){_0x510154[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x147)+_0x510154[_0x43e77c(0x118)]+_0x43e77c(0x18d)+_0x510154[_0x43e77c(0x165)]));}for(const _0x29d67d of _0x4752b3['knowledgeBases']){_0x29d67d[_0x43e77c(0xef)]==='error'&&console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x17a)+_0x29d67d[_0x43e77c(0x116)]+'\x22:\x20'+_0x29d67d[_0x43e77c(0x165)]));}for(const _0x1fb0ef of _0x4752b3['textKnowledgeBases']){_0x1fb0ef[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x151)+_0x1fb0ef[_0x43e77c(0x116)]+_0x43e77c(0x18d)+_0x1fb0ef['error']));}for(const _0x1ff9e of _0x4752b3['prompts']){_0x1ff9e[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x142)+_0x1ff9e['name']+'\x22:\x20'+_0x1ff9e['error']));}for(const _0x30e737 of _0x4752b3[_0x43e77c(0x172)]){_0x30e737[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x112)+_0x30e737[_0x43e77c(0x116)]+_0x43e77c(0x18d)+_0x30e737[_0x43e77c(0x165)]));}return 0x1;}console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0xfe)](_0x43e77c(0x12f)+(_0x350c6f+_0x201166)+_0x43e77c(0x16d)+_0x4752b3[_0x43e77c(0x17e)]+'\x27'));const _0x278fb1=getLLMProjectUrl(_0x31792f,_0x4752b3[_0x43e77c(0x100)]);return console[_0x43e77c(0x16e)](_0x43e77c(0x169)+a4_0x2ecb38[_0x43e77c(0x179)](_0x278fb1)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4fb7d6=a5_0x4d1d;(function(_0x313bf0,_0x2c46b7){const _0x5e0390=a5_0x4d1d,_0x576447=_0x313bf0();while(!![]){try{const _0x53ba5c=parseInt(_0x5e0390(0x188))/0x1+-parseInt(_0x5e0390(0x185))/0x2*(-parseInt(_0x5e0390(0x15f))/0x3)+parseInt(_0x5e0390(0x19b))/0x4+parseInt(_0x5e0390(0x180))/0x5+-parseInt(_0x5e0390(0x1ab))/0x6+parseInt(_0x5e0390(0x1e4))/0x7*(parseInt(_0x5e0390(0x1d0))/0x8)+-parseInt(_0x5e0390(0x19a))/0x9;if(_0x53ba5c===_0x2c46b7)break;else _0x576447['push'](_0x576447['shift']());}catch(_0x66aee5){_0x576447['push'](_0x576447['shift']());}}}(a5_0xb136,0x66f4d));import*as a5_0x572dac from'node:fs';import*as a5_0x234e02 from'node:path';import a5_0x14baf1 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x4d1d(_0x1fb384,_0x40a3a3){_0x1fb384=_0x1fb384-0x152;const _0xb13651=a5_0xb136();let _0x4d1d3f=_0xb13651[_0x1fb384];return _0x4d1d3f;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0xb136(){const _0x1f55c5=['Round\x201/','description','\x20\x20Evaluating...\x20','dim','\x20\x20-\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','trim','\x20(cached)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','3TYYpJf','New\x20tests\x20to\x20execute:\x20','agent','\x20-\x20','Using\x20agent:\x20','white','rounds','Failed:\x20\x20\x20','add','✗\x20FAIL:\x20','Error\x20writing\x20output\x20file:\x20','length','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','stop','no_tests','FAIL','\x20\x20Site:\x20','reason','isSpinning','no_local_folder','text','agentDirs','Project\x20path:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20Configuration:','Available\x20tests:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reeval','Site:\x20','json','repeat','log','site','1273640BagLyB','timestamp','yellow','Cached\x20run\x20is\x20from\x20site\x20\x22','Re-evaluation\x20Summary','1387654CrJmRa','agentName','\x27\x20to\x20create\x20the\x20folder\x20structure.','621169iwqUzU','executeReeval','llm','Running\x20agent\x20tests...','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Test\x20Summary','cyan','name','testYmlPath','writeFileSync','Running:\x20','Output\x20written\x20to:\x20',':\x20Sending\x20user\x20input...','Re-evaluating\x20','Round\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','verbose','conversation_url','13269681iDWqQr','1501708NCAdId','No\x20tests\x20found\x20matching:\x20','✓\x20PASS:\x20','green','includes','Duration:\x20','round','eval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agent:test','existsSync','Run\x20tests\x20for\x20an\x20LLM\x20agent','Running\x20test:\x20','Agent:\x20','projectName','tests','1604628OkYjYo','\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','...','\x20\x20Round\x20','some','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','join','found','split','No\x20tests\x20have\x20tags\x20defined.','ERROR','⚠\x20SKIPPED:\x20','source','push','start','forEach','toLowerCase','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','toISOString','\x20\x20Agent:\x20','Failed\x20Tests:','no_context','utf-8','filter','Re-evaluating...','llmProject','PASS','...\x20','Conversation\x20URL:\x20','dryRun','Passed:\x20\x20\x20','Available\x20tags:\x20','\x22:\x20','404','output','31768BaHPbF','now','red','message','\x22,\x20but\x20current\x20site\x20is\x20\x22','table','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20with\x20tags:\x20','\x20(new)','has','Error:\x20No\x20previous\x20test\x20run\x20found.','tags','Total:\x20\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','execute','basename','map','✗\x20ERROR:\x20','\x20\x20Project:\x20','Tests\x20found:\x20','385wZEuBf','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','tsv','status','multiple_agents','projectDir','Usage:','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','substring','size','/<agent-name>'];a5_0xb136=function(){return _0x1f55c5;};return a5_0xb136();}export class AgentTestCommand extends BaseCommand{[a5_0x4fb7d6(0x18f)]=a5_0x4fb7d6(0x1a4);[a5_0x4fb7d6(0x157)]=a5_0x4fb7d6(0x1a6);async[a5_0x4fb7d6(0x1de)](_0x208f11){const _0xa685ad=a5_0x4fb7d6,{options:_0x4a6608,args:_0x5a445c,tdx:_0x2181b9}=_0x208f11,_0x497726=_0x5a445c[0x0]||'.',_0x413829=_0x4a6608[_0xa685ad(0x1ca)],_0x214388=_0x4a6608,_0x113fbc=_0x214388[_0xa685ad(0x1a2)]===![],_0x31fa25=_0x214388[_0xa685ad(0x17a)],_0x406afb=_0x214388['name'],_0x277046=_0x214388[_0xa685ad(0x1db)],_0xcf1386=_0x4a6608['site'],_0x2e52f2=_0x214388[_0xa685ad(0x1cf)];if(_0x31fa25&&_0x113fbc)return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x1a3))),0x1;let _0x3b835c=_0xa685ad(0x1d5);if(_0x214388[_0xa685ad(0x17c)])_0x3b835c=_0xa685ad(0x17c);else{if(_0x214388['jsonl'])_0x3b835c='jsonl';else{if(_0x214388[_0xa685ad(0x1e6)])_0x3b835c=_0xa685ad(0x1e6);else{if(_0x214388['table'])_0x3b835c=_0xa685ad(0x1d5);}}}const _0x27bb77=_0x214388[_0xa685ad(0x1c6)];let _0x27e3e2=_0x497726;const _0x1d4ec0=a5_0x572dac[_0xa685ad(0x1a5)](_0x497726),_0x1933df=_0x497726==='.';if(!_0x1d4ec0||_0x1933df){const _0x5a7b8f=resolveProjectFromContext(_0x497726,_0x27bb77,{'requireFile':'test.yml'});if(_0x5a7b8f[_0xa685ad(0x1b2)])_0x27e3e2=_0x5a7b8f[_0xa685ad(0x1e9)],_0x5a7b8f[_0xa685ad(0x1b7)]===_0xa685ad(0x1bd)&&console[_0xa685ad(0x17e)](a5_0x14baf1['dim'](_0xa685ad(0x163)+_0x27e3e2));else switch(_0x5a7b8f[_0xa685ad(0x170)]){case _0xa685ad(0x1c2):console[_0xa685ad(0x17e)](a5_0x14baf1['yellow'](_0x5a7b8f[_0xa685ad(0x1d3)])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x1ea)),console[_0xa685ad(0x17e)](_0xa685ad(0x1ac)),console['log'](_0xa685ad(0x18c)),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0xa685ad(0x172):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0x5a7b8f[_0xa685ad(0x1d3)])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5a7b8f[_0xa685ad(0x1c6)]+_0xa685ad(0x187));return 0x1;case _0xa685ad(0x1e8):{const _0x1a8302=a5_0x234e02[_0xa685ad(0x1df)](_0x5a7b8f[_0xa685ad(0x1e9)]);console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0xa685ad(0x1be)+_0x5a7b8f[_0xa685ad(0x1c6)]+'\x22:'));for(const _0x238d2b of _0x5a7b8f[_0xa685ad(0x174)]){console[_0xa685ad(0x17e)](_0xa685ad(0x15a)+_0x238d2b);}return console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x152)+_0x1a8302+_0xa685ad(0x155)),0x1;}case _0xa685ad(0x16d):console['log'](a5_0x14baf1[_0xa685ad(0x182)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5a7b8f[_0xa685ad(0x1c6)]+'\x22.')),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x175)+_0x5a7b8f['projectDir'])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x1d6));return 0x1;}}const {definition:_0x224d3b,agentInfo:_0x1d95dc}=parseTestFile(_0x27e3e2);let _0x50d90a=_0x224d3b[_0xa685ad(0x1aa)];if(_0x406afb){const _0x3f2d82=_0x406afb[_0xa685ad(0x1b3)](',')[_0xa685ad(0x1e0)](_0x7c767b=>_0x7c767b['trim']());_0x50d90a=_0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1c4)](_0x461c7c=>_0x3f2d82[_0xa685ad(0x19f)](_0x461c7c['name']));if(_0x50d90a[_0xa685ad(0x16a)]===0x0)return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0xa685ad(0x19c)+_0x406afb)),console['log'](a5_0x14baf1['dim'](_0xa685ad(0x178)+_0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1e0)](_0x5a5bb5=>_0x5a5bb5[_0xa685ad(0x18f)])[_0xa685ad(0x1b1)](',\x20'))),0x1;}if(_0x277046){const _0x7ec15=_0x277046[_0xa685ad(0x1b3)](',')[_0xa685ad(0x1e0)](_0x264a0e=>_0x264a0e[_0xa685ad(0x15c)]()['toLowerCase']());_0x50d90a=_0x50d90a[_0xa685ad(0x1c4)](_0x4c8475=>_0x4c8475[_0xa685ad(0x1db)]?.[_0xa685ad(0x1af)](_0x1237ea=>_0x7ec15['includes'](_0x1237ea[_0xa685ad(0x1bb)]())));if(_0x50d90a[_0xa685ad(0x16a)]===0x0){console['log'](a5_0x14baf1['yellow'](_0xa685ad(0x1d7)+_0x277046));const _0x5dab45=new Set();return _0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1ba)](_0x3b6717=>_0x3b6717[_0xa685ad(0x1db)]?.[_0xa685ad(0x1ba)](_0x1b1832=>_0x5dab45[_0xa685ad(0x167)](_0x1b1832))),_0x5dab45[_0xa685ad(0x154)]>0x0?console[_0xa685ad(0x17e)](a5_0x14baf1['dim'](_0xa685ad(0x1cc)+[..._0x5dab45][_0xa685ad(0x1b1)](',\x20'))):console['log'](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x1b4))),0x1;}}if(_0x31fa25)return this[_0xa685ad(0x189)](_0x208f11,{'definition':{'tests':_0x50d90a},'agentInfo':_0x1d95dc,'outputFormat':_0x3b835c,'outputFile':_0x2e52f2,'testNames':_0x406afb});if(_0x413829){console[_0xa685ad(0x17e)](a5_0x14baf1['cyan'](_0xa685ad(0x177))),console['log'](_0xa685ad(0x16f)+a5_0x14baf1[_0xa685ad(0x164)](_0xcf1386)),console[_0xa685ad(0x17e)](_0xa685ad(0x1e2)+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc['projectName'])),console[_0xa685ad(0x17e)](_0xa685ad(0x1c0)+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc[_0xa685ad(0x186)])),console['log'](),console[_0xa685ad(0x17e)](_0xa685ad(0x1e3)+a5_0x14baf1[_0xa685ad(0x164)](_0x50d90a[_0xa685ad(0x16a)]));for(let _0x24c226=0x0;_0x24c226<_0x50d90a['length'];_0x24c226++){const _0x43cd82=_0x50d90a[_0x24c226],_0x21fbba=_0x43cd82[_0xa685ad(0x165)][_0xa685ad(0x16a)]===0x1?_0xa685ad(0x1a1):_0xa685ad(0x165),_0x1d8e21=_0x43cd82[_0xa685ad(0x1db)]?.[_0xa685ad(0x16a)]?'\x20['+_0x43cd82[_0xa685ad(0x1db)][_0xa685ad(0x1b1)](',\x20')+']':'';console['log']('\x20\x20'+(_0x24c226+0x1)+'.\x20'+a5_0x14baf1['white'](_0x43cd82[_0xa685ad(0x18f)])+'\x20('+_0x43cd82[_0xa685ad(0x165)][_0xa685ad(0x16a)]+'\x20'+_0x21fbba+')'+a5_0x14baf1['dim'](_0x1d8e21));}return 0x0;}let _0x36bb37,_0x5dec0b;try{_0x36bb37=await _0x2181b9[_0xa685ad(0x18a)]['resolveProjectId'](_0x1d95dc[_0xa685ad(0x1a9)]);}catch(_0x16437a){const _0x39e32c=_0x16437a instanceof Error?_0x16437a[_0xa685ad(0x1d3)]:String(_0x16437a);return _0x39e32c['includes'](_0xa685ad(0x1ce))||_0x39e32c[_0xa685ad(0x1bb)]()[_0xa685ad(0x19f)]('not\x20found')?console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x197)+_0x1d95dc[_0xa685ad(0x1a9)])):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x15e)+_0x1d95dc[_0xa685ad(0x1a9)]+_0xa685ad(0x1cd)+_0x39e32c)),0x1;}try{_0x5dec0b=await _0x2181b9[_0xa685ad(0x18a)]['resolveAgentId'](_0x1d95dc[_0xa685ad(0x186)],_0x36bb37);}catch(_0x55807d){const _0xd3b173=_0x55807d instanceof Error?_0x55807d[_0xa685ad(0x1d3)]:String(_0x55807d);return _0xd3b173['includes'](_0xa685ad(0x1ce))||_0xd3b173[_0xa685ad(0x1bb)]()[_0xa685ad(0x19f)]('not\x20found')?console['log'](a5_0x14baf1[_0xa685ad(0x1d2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1d95dc[_0xa685ad(0x186)])):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x15b)+_0x1d95dc[_0xa685ad(0x186)]+_0xa685ad(0x1cd)+_0xd3b173)),0x1;}let _0x52a00a;if(!_0x113fbc)try{_0x52a00a=await setupEvaluatorAgent(_0x2181b9[_0xa685ad(0x18a)],_0x4a6608['verbose']);}catch(_0x1e94b8){const _0x33ca4e=_0x1e94b8 instanceof Error?_0x1e94b8[_0xa685ad(0x1d3)]:String(_0x1e94b8);return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x179)+_0x33ca4e)),0x1;}console[_0xa685ad(0x17e)](a5_0x14baf1['cyan'](_0xa685ad(0x18b))),console[_0xa685ad(0x17e)](_0xa685ad(0x17b)+a5_0x14baf1[_0xa685ad(0x164)](_0xcf1386)),console[_0xa685ad(0x17e)]('Agent:\x20'+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc['projectName']+'/'+_0x1d95dc[_0xa685ad(0x186)])),console[_0xa685ad(0x17e)]();const _0x1840c6=[],_0x26fcc7=[],_0x5a9543=Date['now']();for(let _0xebe520=0x0;_0xebe520<_0x50d90a[_0xa685ad(0x16a)];_0xebe520++){const _0x3b8755=_0x50d90a[_0xebe520];_0x50d90a[_0xa685ad(0x16a)]>0x1?console[_0xa685ad(0x17e)]('Test\x20'+(_0xebe520+0x1)+'/'+_0x50d90a[_0xa685ad(0x16a)]+':\x20'+a5_0x14baf1[_0xa685ad(0x164)](_0x3b8755[_0xa685ad(0x18f)])):console[_0xa685ad(0x17e)](_0xa685ad(0x1a7)+a5_0x14baf1[_0xa685ad(0x164)](_0x3b8755[_0xa685ad(0x18f)]));const _0x49e5b3=createCommandSpinner(_0xa685ad(0x156)+_0x3b8755['rounds']['length']+_0xa685ad(0x194));_0x49e5b3[_0xa685ad(0x1b9)]();try{const {result:_0x4e6c66,conversation:_0xb2e525}=await runTest(_0x2181b9[_0xa685ad(0x18a)],_0x3b8755,{'agentId':_0x5dec0b,'projectId':_0x36bb37,'site':_0xcf1386,'noEval':_0x113fbc,'evaluatorId':_0x52a00a,'onRoundStart':(_0x374cac,_0xfd5aa)=>{const _0x5773cd=_0xa685ad;_0x49e5b3['text']=_0x5773cd(0x196)+(_0x374cac+0x1)+'/'+_0xfd5aa+_0x5773cd(0x194);},'onRoundComplete':(_0x1df05a,_0x4d857b,_0xda4cf1)=>{const _0xea3ea2=_0xa685ad,_0x23da77=formatElapsed(_0x4d857b);_0xda4cf1?console[_0xea3ea2(0x17e)]('\x20\x20Round\x20'+(_0x1df05a+0x1)+'/'+_0x3b8755[_0xea3ea2(0x165)][_0xea3ea2(0x16a)]+_0xea3ea2(0x1c8)+a5_0x14baf1[_0xea3ea2(0x19e)]('✓')+'\x20('+_0x23da77+')'):console['log'](_0xea3ea2(0x1ae)+(_0x1df05a+0x1)+'/'+_0x3b8755[_0xea3ea2(0x165)]['length']+_0xea3ea2(0x1c8)+a5_0x14baf1[_0xea3ea2(0x1d2)]('✗'));},'onEvaluationStart':()=>{_0x49e5b3['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x4ca5c6=>{const _0x3e3553=_0xa685ad,_0x4d73d4=formatElapsed(_0x4ca5c6);console['log'](_0x3e3553(0x158)+a5_0x14baf1[_0x3e3553(0x19e)]('✓')+'\x20('+_0x4d73d4+')');}});_0x49e5b3[_0xa685ad(0x16c)](),_0x1840c6['push'](_0x4e6c66),_0x26fcc7[_0xa685ad(0x1b8)](_0xb2e525);if(_0x4e6c66[_0xa685ad(0x1e7)]===_0xa685ad(0x1c7))console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x19e)]('✓\x20PASS:\x20'+_0x4e6c66[_0xa685ad(0x170)]));else _0x4e6c66[_0xa685ad(0x1e7)]===_0xa685ad(0x16e)?console['log'](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x168)+_0x4e6c66[_0xa685ad(0x170)])):console['log'](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x1e1)+_0x4e6c66[_0xa685ad(0x170)]));_0x4e6c66[_0xa685ad(0x199)]&&console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x1c9)+_0x4e6c66['conversation_url'])),console[_0xa685ad(0x17e)]();}catch(_0xbfce3d){_0x49e5b3[_0xa685ad(0x16c)]();const _0x15c51f=_0xbfce3d instanceof Error?_0xbfce3d[_0xa685ad(0x1d3)]:String(_0xbfce3d);console['log'](a5_0x14baf1['red'](_0xa685ad(0x1e1)+_0x15c51f)),console[_0xa685ad(0x17e)](),_0x1840c6[_0xa685ad(0x1b8)]({'name':_0x3b8755[_0xa685ad(0x18f)],'status':_0xa685ad(0x1b5),'reason':_0x15c51f,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x57d66b=Date[_0xa685ad(0x1d1)]()-_0x5a9543,_0x5ea404=_0x1840c6[_0xa685ad(0x1c4)](_0x22e381=>_0x22e381[_0xa685ad(0x1e7)]===_0xa685ad(0x1c7))[_0xa685ad(0x16a)],_0x35697c=_0x1840c6[_0xa685ad(0x1c4)](_0x1f0af2=>_0x1f0af2[_0xa685ad(0x1e7)]===_0xa685ad(0x16e))['length'],_0x7f7b5f=_0x1840c6['filter'](_0x3f1f6b=>_0x3f1f6b['status']===_0xa685ad(0x1b5))[_0xa685ad(0x16a)];console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c)),console['log'](_0xa685ad(0x18d)),console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c)),console['log'](_0xa685ad(0x1dc)+_0x1840c6[_0xa685ad(0x16a)]),console[_0xa685ad(0x17e)]('Passed:\x20\x20\x20'+a5_0x14baf1['green'](_0x5ea404)),console['log'](_0xa685ad(0x166)+a5_0x14baf1[_0xa685ad(0x1d2)](_0x35697c));_0x7f7b5f>0x0&&console[_0xa685ad(0x17e)]('Errors:\x20\x20\x20'+a5_0x14baf1[_0xa685ad(0x1d2)](_0x7f7b5f));console[_0xa685ad(0x17e)](_0xa685ad(0x1a0)+formatElapsed(_0x57d66b)),console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c));const _0x59a452=_0x1840c6['filter'](_0xe38124=>_0xe38124[_0xa685ad(0x1e7)]!==_0xa685ad(0x1c7));if(_0x59a452[_0xa685ad(0x16a)]>0x0){console[_0xa685ad(0x17e)](),console['log'](_0xa685ad(0x1c1));for(const _0x1657e1 of _0x59a452){const _0x4596fd=a5_0x14baf1['red']('✗'),_0x47244d=_0x1657e1[_0xa685ad(0x170)][_0xa685ad(0x16a)]>0x32?_0x1657e1[_0xa685ad(0x170)][_0xa685ad(0x153)](0x0,0x32)+'...':_0x1657e1[_0xa685ad(0x170)];console[_0xa685ad(0x17e)]('\x20\x20'+_0x4596fd+'\x20'+_0x1657e1[_0xa685ad(0x18f)]+':\x20'+_0x47244d);}}const _0xc03702={'summary':{'total':_0x1840c6[_0xa685ad(0x16a)],'passed':_0x5ea404,'failed':_0x35697c,'errors':_0x7f7b5f>0x0?_0x7f7b5f:undefined,'duration_ms':_0x57d66b},'tests':_0x1840c6,'agent':{'project':_0x1d95dc[_0xa685ad(0x1a9)],'name':_0x1d95dc['agentName'],'site':_0xcf1386},'timestamp':new Date(_0x5a9543)['toISOString']()};try{const _0x3e002d=buildCachedTestRun(_0x26fcc7,{'site':_0xcf1386,'projectId':_0x36bb37,'projectName':_0x1d95dc[_0xa685ad(0x1a9)],'agentId':_0x5dec0b,'agentName':_0x1d95dc['agentName'],'testYmlPath':a5_0x234e02['resolve'](_0x1d95dc[_0xa685ad(0x190)])});saveLastTestRun(_0x3e002d);}catch{}if(_0x3b835c!=='table'||_0x2e52f2){const _0x355c43=formatResults(_0xc03702,_0x3b835c);if(_0x2e52f2)try{a5_0x572dac[_0xa685ad(0x191)](_0x2e52f2,_0x355c43,_0xa685ad(0x1c3)),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x193)+_0x2e52f2));}catch(_0x25423e){return console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x169)+_0x25423e)),0x1;}else console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0x355c43);}return _0x59a452[_0xa685ad(0x16a)]>0x0?0x1:0x0;}async[a5_0x4fb7d6(0x189)](_0x45d2a4,_0x386c3d){const _0x4aecd0=a5_0x4fb7d6,{options:_0x410626,tdx:_0x5d214d}=_0x45d2a4,{definition:_0x901e4d,agentInfo:_0x5a1af9,outputFormat:_0x479067,outputFile:_0x500622}=_0x386c3d,_0x24cf08=_0x410626['site'],_0xdee21a=loadLastTestRun();if(!_0xdee21a)return console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1da))),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x1dd))),0x1;if(_0xdee21a[_0x4aecd0(0x161)]['agentName']!==_0x5a1af9['agentName'])return console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1e5)+_0xdee21a[_0x4aecd0(0x161)][_0x4aecd0(0x186)]+_0x4aecd0(0x1bc)+_0x5a1af9[_0x4aecd0(0x186)]+'\x22.')),console['log'](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x16b))),0x1;const _0x573310=new Set(_0xdee21a['conversations']['map'](_0x54b0ad=>_0x54b0ad['testName'])),_0x19c55a=_0x901e4d[_0x4aecd0(0x1aa)]['filter'](_0x54d1fb=>!_0x573310[_0x4aecd0(0x1d9)](_0x54d1fb[_0x4aecd0(0x18f)]));if(_0x19c55a[_0x4aecd0(0x16a)]>0x0&&_0xdee21a[_0x4aecd0(0x17f)]!==_0x24cf08)return console['log'](a5_0x14baf1['red'](_0x4aecd0(0x1b0))),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x183)+_0xdee21a['site']+_0x4aecd0(0x1d4)+_0x24cf08+'\x22.')),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)]('Either\x20switch\x20to\x20the\x20\x22'+_0xdee21a[_0x4aecd0(0x17f)]+_0x4aecd0(0x176))),0x1;const _0x292e33=_0x901e4d['tests']['filter'](_0xbe574d=>_0x573310[_0x4aecd0(0x1d9)](_0xbe574d[_0x4aecd0(0x18f)])),_0x4978d6=_0x19c55a;let _0x2afe4f;try{_0x2afe4f=await setupEvaluatorAgent(_0x5d214d[_0x4aecd0(0x18a)],_0x410626[_0x4aecd0(0x198)]);}catch(_0x1b38f5){const _0x11c19c=_0x1b38f5 instanceof Error?_0x1b38f5[_0x4aecd0(0x1d3)]:String(_0x1b38f5);return console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x179)+_0x11c19c)),0x1;}console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x18e)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x4aecd0(0x17e)]('Cached\x20run\x20from:\x20'+a5_0x14baf1[_0x4aecd0(0x164)](_0xdee21a[_0x4aecd0(0x181)])),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1a8)+a5_0x14baf1[_0x4aecd0(0x164)](_0xdee21a['agent'][_0x4aecd0(0x1a9)]+'/'+_0xdee21a[_0x4aecd0(0x161)][_0x4aecd0(0x186)]));_0x4978d6[_0x4aecd0(0x16a)]>0x0&&console[_0x4aecd0(0x17e)](_0x4aecd0(0x160)+a5_0x14baf1[_0x4aecd0(0x182)](_0x4978d6[_0x4aecd0(0x16a)]));console[_0x4aecd0(0x17e)]();const _0x6af31f=[],_0x30fe83=Date[_0x4aecd0(0x1d1)](),_0x37f995=createCommandSpinner(_0x4aecd0(0x1c5));if(_0x292e33[_0x4aecd0(0x16a)]>0x0)try{const _0x4c146f=await reevaluateFromCache(_0x5d214d[_0x4aecd0(0x18a)],_0xdee21a,{'tests':_0x292e33},{'evaluatorId':_0x2afe4f,'onTestStart':(_0x170259,_0x3433d7,_0x21d82d)=>{const _0x419f55=_0x4aecd0;_0x37f995[_0x419f55(0x173)]=_0x419f55(0x195)+(_0x3433d7+0x1)+'/'+_0x21d82d+':\x20'+_0x170259+_0x419f55(0x1ad);if(!_0x37f995[_0x419f55(0x171)])_0x37f995['start']();},'onTestComplete':(_0x10c9b0,_0xf528b4)=>{const _0x3b9b6e=_0x4aecd0;_0x37f995[_0x3b9b6e(0x16c)]();if(_0xf528b4[_0x3b9b6e(0x1e7)]===_0x3b9b6e(0x1c7))console['log'](a5_0x14baf1['green'](_0x3b9b6e(0x19d)+_0x10c9b0)+a5_0x14baf1[_0x3b9b6e(0x159)](_0x3b9b6e(0x15d)));else _0xf528b4[_0x3b9b6e(0x1e7)]===_0x3b9b6e(0x16e)?console[_0x3b9b6e(0x17e)](a5_0x14baf1[_0x3b9b6e(0x1d2)]('✗\x20FAIL:\x20'+_0x10c9b0+_0x3b9b6e(0x162)+_0xf528b4[_0x3b9b6e(0x170)])+a5_0x14baf1[_0x3b9b6e(0x159)](_0x3b9b6e(0x15d))):console[_0x3b9b6e(0x17e)](a5_0x14baf1['red']('✗\x20ERROR:\x20'+_0x10c9b0+_0x3b9b6e(0x162)+_0xf528b4['reason']));_0xf528b4[_0x3b9b6e(0x199)]&&console[_0x3b9b6e(0x17e)](a5_0x14baf1[_0x3b9b6e(0x159)]('\x20\x20Conversation:\x20'+_0xf528b4[_0x3b9b6e(0x199)])),_0x6af31f[_0x3b9b6e(0x1b8)](_0xf528b4);},'onTestSkipped':(_0xf82e9e,_0x2e1dfd)=>{const _0x36bd12=_0x4aecd0;_0x37f995[_0x36bd12(0x16c)](),console[_0x36bd12(0x17e)](a5_0x14baf1[_0x36bd12(0x182)](_0x36bd12(0x1b6)+_0xf82e9e+_0x36bd12(0x162)+_0x2e1dfd));}});for(const _0x36c679 of _0x4c146f){!_0x6af31f['find'](_0x10e7f7=>_0x10e7f7[_0x4aecd0(0x18f)]===_0x36c679['name'])&&_0x6af31f['push'](_0x36c679);}}catch(_0x21b604){_0x37f995[_0x4aecd0(0x16c)]();const _0x399c73=_0x21b604 instanceof Error?_0x21b604['message']:String(_0x21b604);return console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x399c73)),0x1;}_0x37f995[_0x4aecd0(0x16c)]();if(_0x4978d6[_0x4aecd0(0x16a)]>0x0){console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x18e)]('Executing\x20new\x20tests...'));const {projectId:_0x19b953,agentId:_0x1a144a}=_0xdee21a[_0x4aecd0(0x161)];for(const _0x51b7fa of _0x4978d6){console[_0x4aecd0(0x17e)](_0x4aecd0(0x192)+a5_0x14baf1[_0x4aecd0(0x164)](_0x51b7fa[_0x4aecd0(0x18f)]));const _0x30119d=createCommandSpinner(_0x4aecd0(0x156)+_0x51b7fa['rounds'][_0x4aecd0(0x16a)]+':\x20Sending\x20user\x20input...');_0x30119d['start']();try{const {result:_0x512f6e}=await runTest(_0x5d214d[_0x4aecd0(0x18a)],_0x51b7fa,{'agentId':_0x1a144a,'projectId':_0x19b953,'site':_0xdee21a[_0x4aecd0(0x17f)],'noEval':![],'evaluatorId':_0x2afe4f,'onRoundStart':(_0x5d2e39,_0x34376d)=>{const _0x135af7=_0x4aecd0;_0x30119d['text']='Round\x20'+(_0x5d2e39+0x1)+'/'+_0x34376d+_0x135af7(0x194);},'onRoundComplete':(_0x1fe215,_0x9b29e,_0x161e71)=>{const _0x3d3324=_0x4aecd0,_0x52f70a=formatElapsed(_0x9b29e);_0x161e71?console['log']('\x20\x20Round\x20'+(_0x1fe215+0x1)+'/'+_0x51b7fa['rounds'][_0x3d3324(0x16a)]+'...\x20'+a5_0x14baf1[_0x3d3324(0x19e)]('✓')+'\x20('+_0x52f70a+')'):console[_0x3d3324(0x17e)](_0x3d3324(0x1ae)+(_0x1fe215+0x1)+'/'+_0x51b7fa[_0x3d3324(0x165)][_0x3d3324(0x16a)]+_0x3d3324(0x1c8)+a5_0x14baf1[_0x3d3324(0x1d2)]('✗'));},'onEvaluationStart':()=>{_0x30119d['text']='Evaluating\x20response...';},'onEvaluationComplete':_0xa8b82b=>{const _0x187bcb=_0x4aecd0,_0x52b78c=formatElapsed(_0xa8b82b);console['log'](_0x187bcb(0x158)+a5_0x14baf1['green']('✓')+'\x20('+_0x52b78c+')');}});_0x30119d[_0x4aecd0(0x16c)](),_0x6af31f[_0x4aecd0(0x1b8)](_0x512f6e);if(_0x512f6e['status']===_0x4aecd0(0x1c7))console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x19e)](_0x4aecd0(0x19d)+_0x512f6e['reason'])+a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x1d8)));else _0x512f6e[_0x4aecd0(0x1e7)]===_0x4aecd0(0x16e)?console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20FAIL:\x20'+_0x512f6e[_0x4aecd0(0x170)])+a5_0x14baf1[_0x4aecd0(0x159)]('\x20(new)')):console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20ERROR:\x20'+_0x512f6e[_0x4aecd0(0x170)]));_0x512f6e['conversation_url']&&console[_0x4aecd0(0x17e)](a5_0x14baf1['dim']('\x20\x20Conversation:\x20'+_0x512f6e[_0x4aecd0(0x199)]));}catch(_0x13abf5){_0x30119d[_0x4aecd0(0x16c)]();const _0x132260=_0x13abf5 instanceof Error?_0x13abf5['message']:String(_0x13abf5);console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1e1)+_0x132260)),_0x6af31f[_0x4aecd0(0x1b8)]({'name':_0x51b7fa['name'],'status':'ERROR','reason':_0x132260,'timestamp':new Date()[_0x4aecd0(0x1bf)](),'duration_ms':0x0});}}}console[_0x4aecd0(0x17e)]();const _0x5c010f=Date[_0x4aecd0(0x1d1)]()-_0x30fe83,_0x3042fa=_0x6af31f[_0x4aecd0(0x1c4)](_0x144851=>_0x144851[_0x4aecd0(0x1e7)]===_0x4aecd0(0x1c7))[_0x4aecd0(0x16a)],_0x211bcb=_0x6af31f[_0x4aecd0(0x1c4)](_0x267177=>_0x267177[_0x4aecd0(0x1e7)]===_0x4aecd0(0x16e))[_0x4aecd0(0x16a)],_0x5bbfd0=_0x6af31f[_0x4aecd0(0x1c4)](_0x592423=>_0x592423[_0x4aecd0(0x1e7)]===_0x4aecd0(0x1b5))['length'];console['log']('━'[_0x4aecd0(0x17d)](0x3c)),console[_0x4aecd0(0x17e)](_0x4aecd0(0x184)),console[_0x4aecd0(0x17e)]('━'[_0x4aecd0(0x17d)](0x3c)),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1dc)+_0x6af31f[_0x4aecd0(0x16a)]),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1cb)+a5_0x14baf1[_0x4aecd0(0x19e)](_0x3042fa)),console['log'](_0x4aecd0(0x166)+a5_0x14baf1[_0x4aecd0(0x1d2)](_0x211bcb));_0x5bbfd0>0x0&&console[_0x4aecd0(0x17e)]('Errors:\x20\x20\x20'+a5_0x14baf1['red'](_0x5bbfd0));console[_0x4aecd0(0x17e)](_0x4aecd0(0x1a0)+formatElapsed(_0x5c010f)),console[_0x4aecd0(0x17e)]('━'['repeat'](0x3c));const _0x3ef326={'summary':{'total':_0x6af31f['length'],'passed':_0x3042fa,'failed':_0x211bcb,'errors':_0x5bbfd0>0x0?_0x5bbfd0:undefined,'duration_ms':_0x5c010f},'tests':_0x6af31f,'agent':{'project':_0x5a1af9['projectName'],'name':_0x5a1af9[_0x4aecd0(0x186)],'site':_0x24cf08},'timestamp':new Date(_0x30fe83)[_0x4aecd0(0x1bf)]()};if(_0x479067!==_0x4aecd0(0x1d5)||_0x500622){const _0x422709=formatResults(_0x3ef326,_0x479067);if(_0x500622)try{a5_0x572dac[_0x4aecd0(0x191)](_0x500622,_0x422709,_0x4aecd0(0x1c3)),console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x193)+_0x500622));}catch(_0x4a60c8){return console['log'](),console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x169)+_0x4a60c8)),0x1;}else console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](_0x422709);}const _0x2a1278=_0x6af31f['filter'](_0x4f3d37=>_0x4f3d37[_0x4aecd0(0x1e7)]!=='PASS');return _0x2a1278[_0x4aecd0(0x16a)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0xce3f60=a5_0x23be;(function(_0x5a29c7,_0x2e29aa){const _0x119a6a=a5_0x23be,_0x43a176=_0x5a29c7();while(!![]){try{const _0x5b0740=parseInt(_0x119a6a(0x26a))/0x1+-parseInt(_0x119a6a(0x25d))/0x2*(-parseInt(_0x119a6a(0x206))/0x3)+-parseInt(_0x119a6a(0x242))/0x4+-parseInt(_0x119a6a(0x26f))/0x5+-parseInt(_0x119a6a(0x283))/0x6+parseInt(_0x119a6a(0x227))/0x7*(parseInt(_0x119a6a(0x284))/0x8)+parseInt(_0x119a6a(0x1f2))/0x9;if(_0x5b0740===_0x2e29aa)break;else _0x43a176['push'](_0x43a176['shift']());}catch(_0x5140da){_0x43a176['push'](_0x43a176['shift']());}}}(a5_0x2334,0x29eb2));import*as a5_0x2f1d8d from'node:fs';import*as a5_0x458406 from'node:path';import a5_0x5e5441 from'chalk';function a5_0x2334(){const _0x409cbf=['Test\x20Configuration:','includes','stop','\x20-\x20','utf-8','description','writeFileSync','Duration:\x20','has','Cached\x20run\x20from:\x20','reeval','now','Project\x20path:\x20','toISOString','yellow','agent','FAIL','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Output\x20written\x20to:\x20','json','conversations','projectName','split','4nGcjcR','Tests\x20found:\x20','existsSync','push','Usage:','isSpinning','No\x20tests\x20have\x20tags\x20defined.','white','New\x20tests\x20to\x20execute:\x20','404','no_local_folder','tests','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','118954IGLLZi','✗\x20FAIL:\x20','Either\x20switch\x20to\x20the\x20\x22','Re-evaluating...','Site:\x20','663565khwGup','\x22,\x20but\x20current\x20site\x20is\x20\x22','log','toLowerCase','testName','Running:\x20','Failed:\x20\x20\x20','agent:test','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','no_context','multiple_agents','\x20(new)','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','start','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','projectDir','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Re-evaluation\x20Summary','Run\x20tests\x20for\x20an\x20LLM\x20agent','1852836aysRnT','133192qMOCRX','Conversation\x20URL:\x20','source','dryRun','table','Round\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','agentDirs','Test\x20Summary','\x20\x20-\x20','4603158BqKYkI','PASS','Run\x20\x27tdx\x20agent\x20pull\x20','llmProject','rounds','\x20\x20Agent:\x20','\x22:\x20','conversation_url','Using\x20agent:\x20','Test\x20','...','\x20\x20Conversation:\x20','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','repeat','message','Passed:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','dim','agentName','144429hazuMR','tsv','\x20(cached)','Evaluating\x20response...','Re-evaluating\x20','Executing\x20new\x20tests...','output','filter','status','resolve','trim','Failed\x20Tests:','Total:\x20\x20\x20\x20','\x20\x20Project:\x20',':\x20Sending\x20user\x20input...','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','red','\x20\x20Round\x20','name','✗\x20ERROR:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','ERROR','verbose','Round\x201/','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20\x20Site:\x20','Error\x20writing\x20output\x20file:\x20','/<agent-name>','Available\x20tests:\x20','Re-evaluating\x20cached\x20test\x20run...','Available\x20tags:\x20','⚠\x20SKIPPED:\x20','49vUTDsH','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','cyan','tags','join','resolveProjectId','map','resolveAgentId','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','timestamp','round','some','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Running\x20test:\x20','site','jsonl','length','...\x20','Agent:\x20','llm','executeReeval','\x27\x20to\x20create\x20the\x20folder\x20structure.','text','add','No\x20tests\x20found\x20matching:\x20','not\x20found','920112jMIZJd','forEach','✓\x20PASS:\x20','green'];a5_0x2334=function(){return _0x409cbf;};return a5_0x2334();}import{BaseCommand}from'./command.js';function a5_0x23be(_0x580039,_0x32915f){_0x580039=_0x580039-0x1e9;const _0x2334be=a5_0x2334();let _0x23befd=_0x2334be[_0x580039];return _0x23befd;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xce3f60(0x218)]=a5_0xce3f60(0x276);[a5_0xce3f60(0x24b)]=a5_0xce3f60(0x282);async['execute'](_0x358796){const _0x1fd36c=a5_0xce3f60,{options:_0x295407,args:_0x2eb9a5,tdx:_0x51f815}=_0x358796,_0x1dea72=_0x2eb9a5[0x0]||'.',_0x116606=_0x295407[_0x1fd36c(0x1eb)],_0x5dee77=_0x295407,_0x5dc7ec=_0x5dee77['eval']===![],_0x9720d5=_0x5dee77[_0x1fd36c(0x250)],_0x204f4f=_0x5dee77[_0x1fd36c(0x218)],_0x2e955f=_0x5dee77[_0x1fd36c(0x22a)],_0x55e405=_0x295407['site'],_0x2679a5=_0x5dee77[_0x1fd36c(0x20c)];if(_0x9720d5&&_0x5dc7ec)return console['log'](a5_0x5e5441[_0x1fd36c(0x216)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3384cf=_0x1fd36c(0x1ec);if(_0x5dee77[_0x1fd36c(0x259)])_0x3384cf='json';else{if(_0x5dee77[_0x1fd36c(0x237)])_0x3384cf='jsonl';else{if(_0x5dee77[_0x1fd36c(0x207)])_0x3384cf=_0x1fd36c(0x207);else{if(_0x5dee77[_0x1fd36c(0x1ec)])_0x3384cf=_0x1fd36c(0x1ec);}}}const _0x530139=_0x5dee77[_0x1fd36c(0x1f5)];let _0x340793=_0x1dea72;const _0x560172=a5_0x2f1d8d[_0x1fd36c(0x25f)](_0x1dea72),_0x331e8c=_0x1dea72==='.';if(!_0x560172||_0x331e8c){const _0xea88b8=resolveProjectFromContext(_0x1dea72,_0x530139,{'requireFile':'test.yml'});if(_0xea88b8['found'])_0x340793=_0xea88b8[_0x1fd36c(0x27e)],_0xea88b8[_0x1fd36c(0x1ea)]==='context'&&console['log'](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x1fa)+_0x340793));else switch(_0xea88b8[_0x1fd36c(0x22f)]){case _0x1fd36c(0x278):console['log'](a5_0x5e5441[_0x1fd36c(0x254)](_0xea88b8['message'])),console[_0x1fd36c(0x271)](),console[_0x1fd36c(0x271)](_0x1fd36c(0x261)),console[_0x1fd36c(0x271)](_0x1fd36c(0x230)),console['log'](_0x1fd36c(0x269)),console[_0x1fd36c(0x271)](),console['log'](_0x1fd36c(0x215));return 0x1;case _0x1fd36c(0x267):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x254)](_0xea88b8[_0x1fd36c(0x201)])),console['log'](),console[_0x1fd36c(0x271)](_0x1fd36c(0x1f4)+_0xea88b8[_0x1fd36c(0x1f5)]+_0x1fd36c(0x23d));return 0x1;case _0x1fd36c(0x279):{const _0x196270=a5_0x458406['basename'](_0xea88b8['projectDir']);console['log'](a5_0x5e5441[_0x1fd36c(0x254)](_0x1fd36c(0x277)+_0xea88b8[_0x1fd36c(0x1f5)]+'\x22:'));for(const _0x59c20e of _0xea88b8[_0x1fd36c(0x1ef)]){console[_0x1fd36c(0x271)](_0x1fd36c(0x1f1)+_0x59c20e);}return console[_0x1fd36c(0x271)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x196270+_0x1fd36c(0x222)),0x1;}case'no_tests':console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x254)](_0x1fd36c(0x228)+_0xea88b8[_0x1fd36c(0x1f5)]+'\x22.')),console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x252)+_0xea88b8[_0x1fd36c(0x27e)])),console['log'](),console[_0x1fd36c(0x271)](_0x1fd36c(0x257));return 0x1;}}const {definition:_0x418128,agentInfo:_0x3d2472}=parseTestFile(_0x340793);let _0x1a4eb5=_0x418128[_0x1fd36c(0x268)];if(_0x204f4f){const _0x26454a=_0x204f4f['split'](',')[_0x1fd36c(0x22d)](_0x15fe4b=>_0x15fe4b[_0x1fd36c(0x210)]());_0x1a4eb5=_0x418128[_0x1fd36c(0x268)][_0x1fd36c(0x20d)](_0x435843=>_0x26454a[_0x1fd36c(0x247)](_0x435843[_0x1fd36c(0x218)]));if(_0x1a4eb5[_0x1fd36c(0x238)]===0x0)return console[_0x1fd36c(0x271)](a5_0x5e5441['yellow'](_0x1fd36c(0x240)+_0x204f4f)),console['log'](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x223)+_0x418128[_0x1fd36c(0x268)][_0x1fd36c(0x22d)](_0x5ae43b=>_0x5ae43b[_0x1fd36c(0x218)])[_0x1fd36c(0x22b)](',\x20'))),0x1;}if(_0x2e955f){const _0x2c9a47=_0x2e955f[_0x1fd36c(0x25c)](',')[_0x1fd36c(0x22d)](_0x56e412=>_0x56e412['trim']()['toLowerCase']());_0x1a4eb5=_0x1a4eb5[_0x1fd36c(0x20d)](_0x2e61ca=>_0x2e61ca['tags']?.[_0x1fd36c(0x233)](_0x3f8082=>_0x2c9a47['includes'](_0x3f8082[_0x1fd36c(0x272)]())));if(_0x1a4eb5[_0x1fd36c(0x238)]===0x0){console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x254)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2e955f));const _0x46b835=new Set();return _0x418128[_0x1fd36c(0x268)]['forEach'](_0x506c15=>_0x506c15[_0x1fd36c(0x22a)]?.[_0x1fd36c(0x243)](_0x12d28b=>_0x46b835[_0x1fd36c(0x23f)](_0x12d28b))),_0x46b835['size']>0x0?console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x225)+[..._0x46b835][_0x1fd36c(0x22b)](',\x20'))):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x263))),0x1;}}if(_0x9720d5)return this[_0x1fd36c(0x23c)](_0x358796,{'definition':{'tests':_0x1a4eb5},'agentInfo':_0x3d2472,'outputFormat':_0x3384cf,'outputFile':_0x2679a5,'testNames':_0x204f4f});if(_0x116606){console['log'](a5_0x5e5441[_0x1fd36c(0x229)](_0x1fd36c(0x246))),console['log'](_0x1fd36c(0x220)+a5_0x5e5441['white'](_0x55e405)),console[_0x1fd36c(0x271)](_0x1fd36c(0x213)+a5_0x5e5441[_0x1fd36c(0x264)](_0x3d2472[_0x1fd36c(0x25b)])),console[_0x1fd36c(0x271)](_0x1fd36c(0x1f7)+a5_0x5e5441['white'](_0x3d2472['agentName'])),console[_0x1fd36c(0x271)](),console[_0x1fd36c(0x271)](_0x1fd36c(0x25e)+a5_0x5e5441[_0x1fd36c(0x264)](_0x1a4eb5[_0x1fd36c(0x238)]));for(let _0x512d4f=0x0;_0x512d4f<_0x1a4eb5[_0x1fd36c(0x238)];_0x512d4f++){const _0x4f2b6f=_0x1a4eb5[_0x512d4f],_0x4ec4f3=_0x4f2b6f['rounds'][_0x1fd36c(0x238)]===0x1?_0x1fd36c(0x232):_0x1fd36c(0x1f6),_0x2c1121=_0x4f2b6f[_0x1fd36c(0x22a)]?.[_0x1fd36c(0x238)]?'\x20['+_0x4f2b6f['tags'][_0x1fd36c(0x22b)](',\x20')+']':'';console['log']('\x20\x20'+(_0x512d4f+0x1)+'.\x20'+a5_0x5e5441[_0x1fd36c(0x264)](_0x4f2b6f['name'])+'\x20('+_0x4f2b6f[_0x1fd36c(0x1f6)][_0x1fd36c(0x238)]+'\x20'+_0x4ec4f3+')'+a5_0x5e5441[_0x1fd36c(0x204)](_0x2c1121));}return 0x0;}let _0x4d4c5f,_0x50ae1f;try{_0x4d4c5f=await _0x51f815[_0x1fd36c(0x23b)][_0x1fd36c(0x22c)](_0x3d2472[_0x1fd36c(0x25b)]);}catch(_0x4651c8){const _0x853201=_0x4651c8 instanceof Error?_0x4651c8[_0x1fd36c(0x201)]:String(_0x4651c8);return _0x853201[_0x1fd36c(0x247)](_0x1fd36c(0x266))||_0x853201['toLowerCase']()[_0x1fd36c(0x247)]('not\x20found')?console[_0x1fd36c(0x271)](a5_0x5e5441['red'](_0x1fd36c(0x203)+_0x3d2472['projectName'])):console[_0x1fd36c(0x271)](a5_0x5e5441['red'](_0x1fd36c(0x21b)+_0x3d2472[_0x1fd36c(0x25b)]+_0x1fd36c(0x1f8)+_0x853201)),0x1;}try{_0x50ae1f=await _0x51f815['llm'][_0x1fd36c(0x22e)](_0x3d2472[_0x1fd36c(0x205)],_0x4d4c5f);}catch(_0x73023){const _0x5d58c9=_0x73023 instanceof Error?_0x73023[_0x1fd36c(0x201)]:String(_0x73023);return _0x5d58c9[_0x1fd36c(0x247)](_0x1fd36c(0x266))||_0x5d58c9[_0x1fd36c(0x272)]()[_0x1fd36c(0x247)](_0x1fd36c(0x241))?console['log'](a5_0x5e5441['red'](_0x1fd36c(0x21a)+_0x3d2472[_0x1fd36c(0x205)])):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x27f)+_0x3d2472[_0x1fd36c(0x205)]+_0x1fd36c(0x1f8)+_0x5d58c9)),0x1;}let _0x4e9a02;if(!_0x5dc7ec)try{_0x4e9a02=await setupEvaluatorAgent(_0x51f815[_0x1fd36c(0x23b)],_0x295407['verbose']);}catch(_0x2760c2){const _0x5c0f5c=_0x2760c2 instanceof Error?_0x2760c2[_0x1fd36c(0x201)]:String(_0x2760c2);return console['log'](a5_0x5e5441['red'](_0x1fd36c(0x234)+_0x5c0f5c)),0x1;}console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x229)]('Running\x20agent\x20tests...')),console['log'](_0x1fd36c(0x26e)+a5_0x5e5441[_0x1fd36c(0x264)](_0x55e405)),console[_0x1fd36c(0x271)](_0x1fd36c(0x23a)+a5_0x5e5441[_0x1fd36c(0x264)](_0x3d2472[_0x1fd36c(0x25b)]+'/'+_0x3d2472['agentName'])),console[_0x1fd36c(0x271)]();const _0x26454e=[],_0x3213d5=[],_0x159e9f=Date['now']();for(let _0x3e6cad=0x0;_0x3e6cad<_0x1a4eb5[_0x1fd36c(0x238)];_0x3e6cad++){const _0xb3e39d=_0x1a4eb5[_0x3e6cad];_0x1a4eb5['length']>0x1?console['log'](_0x1fd36c(0x1fb)+(_0x3e6cad+0x1)+'/'+_0x1a4eb5[_0x1fd36c(0x238)]+':\x20'+a5_0x5e5441['white'](_0xb3e39d[_0x1fd36c(0x218)])):console['log'](_0x1fd36c(0x235)+a5_0x5e5441['white'](_0xb3e39d[_0x1fd36c(0x218)]));const _0x1bf737=createCommandSpinner(_0x1fd36c(0x21e)+_0xb3e39d['rounds'][_0x1fd36c(0x238)]+_0x1fd36c(0x214));_0x1bf737['start']();try{const {result:_0x83d9f2,conversation:_0x6a1ea8}=await runTest(_0x51f815['llm'],_0xb3e39d,{'agentId':_0x50ae1f,'projectId':_0x4d4c5f,'site':_0x55e405,'noEval':_0x5dc7ec,'evaluatorId':_0x4e9a02,'onRoundStart':(_0x338003,_0x56f4fe)=>{const _0xf02ef3=_0x1fd36c;_0x1bf737['text']=_0xf02ef3(0x1ed)+(_0x338003+0x1)+'/'+_0x56f4fe+_0xf02ef3(0x214);},'onRoundComplete':(_0x281c78,_0x272061,_0x272872)=>{const _0x23df67=_0x1fd36c,_0x4d6c91=formatElapsed(_0x272061);_0x272872?console[_0x23df67(0x271)](_0x23df67(0x217)+(_0x281c78+0x1)+'/'+_0xb3e39d[_0x23df67(0x1f6)][_0x23df67(0x238)]+_0x23df67(0x239)+a5_0x5e5441[_0x23df67(0x245)]('✓')+'\x20('+_0x4d6c91+')'):console[_0x23df67(0x271)]('\x20\x20Round\x20'+(_0x281c78+0x1)+'/'+_0xb3e39d[_0x23df67(0x1f6)][_0x23df67(0x238)]+'...\x20'+a5_0x5e5441[_0x23df67(0x216)]('✗'));},'onEvaluationStart':()=>{const _0x57d0f1=_0x1fd36c;_0x1bf737['text']=_0x57d0f1(0x209);},'onEvaluationComplete':_0x534456=>{const _0x4659b4=formatElapsed(_0x534456);console['log']('\x20\x20Evaluating...\x20'+a5_0x5e5441['green']('✓')+'\x20('+_0x4659b4+')');}});_0x1bf737[_0x1fd36c(0x248)](),_0x26454e[_0x1fd36c(0x260)](_0x83d9f2),_0x3213d5[_0x1fd36c(0x260)](_0x6a1ea8);if(_0x83d9f2[_0x1fd36c(0x20e)]===_0x1fd36c(0x1f3))console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x245)](_0x1fd36c(0x244)+_0x83d9f2[_0x1fd36c(0x22f)]));else _0x83d9f2['status']===_0x1fd36c(0x256)?console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x26b)+_0x83d9f2[_0x1fd36c(0x22f)])):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x219)+_0x83d9f2[_0x1fd36c(0x22f)]));_0x83d9f2['conversation_url']&&console[_0x1fd36c(0x271)](a5_0x5e5441['dim'](_0x1fd36c(0x1e9)+_0x83d9f2['conversation_url'])),console[_0x1fd36c(0x271)]();}catch(_0x2f1ef5){_0x1bf737['stop']();const _0x5cf1c1=_0x2f1ef5 instanceof Error?_0x2f1ef5[_0x1fd36c(0x201)]:String(_0x2f1ef5);console[_0x1fd36c(0x271)](a5_0x5e5441['red'](_0x1fd36c(0x219)+_0x5cf1c1)),console[_0x1fd36c(0x271)](),_0x26454e[_0x1fd36c(0x260)]({'name':_0xb3e39d[_0x1fd36c(0x218)],'status':_0x1fd36c(0x21c),'reason':_0x5cf1c1,'timestamp':new Date()[_0x1fd36c(0x253)](),'duration_ms':0x0});}}const _0xe301e2=Date[_0x1fd36c(0x251)]()-_0x159e9f,_0x505257=_0x26454e['filter'](_0x50ba94=>_0x50ba94[_0x1fd36c(0x20e)]===_0x1fd36c(0x1f3))[_0x1fd36c(0x238)],_0x39b170=_0x26454e[_0x1fd36c(0x20d)](_0x5bd7fa=>_0x5bd7fa[_0x1fd36c(0x20e)]==='FAIL')['length'],_0x196e06=_0x26454e[_0x1fd36c(0x20d)](_0x53106f=>_0x53106f['status']===_0x1fd36c(0x21c))[_0x1fd36c(0x238)];console[_0x1fd36c(0x271)]('━'[_0x1fd36c(0x200)](0x3c)),console[_0x1fd36c(0x271)](_0x1fd36c(0x1f0)),console['log']('━'['repeat'](0x3c)),console['log'](_0x1fd36c(0x212)+_0x26454e[_0x1fd36c(0x238)]),console['log'](_0x1fd36c(0x202)+a5_0x5e5441[_0x1fd36c(0x245)](_0x505257)),console[_0x1fd36c(0x271)](_0x1fd36c(0x275)+a5_0x5e5441[_0x1fd36c(0x216)](_0x39b170));_0x196e06>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x5e5441[_0x1fd36c(0x216)](_0x196e06));console[_0x1fd36c(0x271)](_0x1fd36c(0x24d)+formatElapsed(_0xe301e2)),console[_0x1fd36c(0x271)]('━'[_0x1fd36c(0x200)](0x3c));const _0x4e403e=_0x26454e[_0x1fd36c(0x20d)](_0x40bde9=>_0x40bde9[_0x1fd36c(0x20e)]!==_0x1fd36c(0x1f3));if(_0x4e403e[_0x1fd36c(0x238)]>0x0){console['log'](),console[_0x1fd36c(0x271)](_0x1fd36c(0x211));for(const _0x7b43e2 of _0x4e403e){const _0x18f50b=a5_0x5e5441[_0x1fd36c(0x216)]('✗'),_0x53ff2c=_0x7b43e2['reason'][_0x1fd36c(0x238)]>0x32?_0x7b43e2[_0x1fd36c(0x22f)]['substring'](0x0,0x32)+_0x1fd36c(0x1fc):_0x7b43e2[_0x1fd36c(0x22f)];console['log']('\x20\x20'+_0x18f50b+'\x20'+_0x7b43e2[_0x1fd36c(0x218)]+':\x20'+_0x53ff2c);}}const _0x1e122e={'summary':{'total':_0x26454e[_0x1fd36c(0x238)],'passed':_0x505257,'failed':_0x39b170,'errors':_0x196e06>0x0?_0x196e06:undefined,'duration_ms':_0xe301e2},'tests':_0x26454e,'agent':{'project':_0x3d2472['projectName'],'name':_0x3d2472[_0x1fd36c(0x205)],'site':_0x55e405},'timestamp':new Date(_0x159e9f)[_0x1fd36c(0x253)]()};try{const _0x2616fd=buildCachedTestRun(_0x3213d5,{'site':_0x55e405,'projectId':_0x4d4c5f,'projectName':_0x3d2472['projectName'],'agentId':_0x50ae1f,'agentName':_0x3d2472[_0x1fd36c(0x205)],'testYmlPath':a5_0x458406[_0x1fd36c(0x20f)](_0x3d2472['testYmlPath'])});saveLastTestRun(_0x2616fd);}catch{}if(_0x3384cf!==_0x1fd36c(0x1ec)||_0x2679a5){const _0x10279b=formatResults(_0x1e122e,_0x3384cf);if(_0x2679a5)try{a5_0x2f1d8d[_0x1fd36c(0x24c)](_0x2679a5,_0x10279b,_0x1fd36c(0x24a)),console[_0x1fd36c(0x271)](),console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x258)+_0x2679a5));}catch(_0x30fa77){return console['log'](),console['log'](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x221)+_0x30fa77)),0x1;}else console['log'](),console[_0x1fd36c(0x271)](_0x10279b);}return _0x4e403e[_0x1fd36c(0x238)]>0x0?0x1:0x0;}async[a5_0xce3f60(0x23c)](_0x198bf7,_0x5d0077){const _0x3bef7b=a5_0xce3f60,{options:_0x4017c0,tdx:_0x665ba}=_0x198bf7,{definition:_0x3429fd,agentInfo:_0x5bb7ac,outputFormat:_0x376d6a,outputFile:_0x19711f}=_0x5d0077,_0x3b4b25=_0x4017c0[_0x3bef7b(0x236)],_0x31d51a=loadLastTestRun();if(!_0x31d51a)return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3bef7b(0x271)](a5_0x5e5441['dim'](_0x3bef7b(0x1ff))),0x1;if(_0x31d51a[_0x3bef7b(0x255)][_0x3bef7b(0x205)]!==_0x5bb7ac[_0x3bef7b(0x205)])return console[_0x3bef7b(0x271)](a5_0x5e5441['red'](_0x3bef7b(0x280)+_0x31d51a[_0x3bef7b(0x255)]['agentName']+_0x3bef7b(0x1ee)+_0x5bb7ac[_0x3bef7b(0x205)]+'\x22.')),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x21f))),0x1;const _0xdacb8e=new Set(_0x31d51a[_0x3bef7b(0x25a)]['map'](_0x1aca76=>_0x1aca76[_0x3bef7b(0x273)])),_0x1efcd1=_0x3429fd['tests'][_0x3bef7b(0x20d)](_0x133ef2=>!_0xdacb8e[_0x3bef7b(0x24e)](_0x133ef2[_0x3bef7b(0x218)]));if(_0x1efcd1['length']>0x0&&_0x31d51a[_0x3bef7b(0x236)]!==_0x3b4b25)return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x27d))),console['log'](a5_0x5e5441['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x31d51a['site']+_0x3bef7b(0x270)+_0x3b4b25+'\x22.')),console['log'](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x26c)+_0x31d51a[_0x3bef7b(0x236)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xe81ee6=_0x3429fd['tests'][_0x3bef7b(0x20d)](_0x37bd89=>_0xdacb8e[_0x3bef7b(0x24e)](_0x37bd89['name'])),_0x590588=_0x1efcd1;let _0x47ae32;try{_0x47ae32=await setupEvaluatorAgent(_0x665ba[_0x3bef7b(0x23b)],_0x4017c0[_0x3bef7b(0x21d)]);}catch(_0x4c225f){const _0xd15db5=_0x4c225f instanceof Error?_0x4c225f['message']:String(_0x4c225f);return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x234)+_0xd15db5)),0x1;}console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x229)](_0x3bef7b(0x224))),console[_0x3bef7b(0x271)](_0x3bef7b(0x24f)+a5_0x5e5441[_0x3bef7b(0x264)](_0x31d51a[_0x3bef7b(0x231)])),console[_0x3bef7b(0x271)](_0x3bef7b(0x23a)+a5_0x5e5441['white'](_0x31d51a[_0x3bef7b(0x255)][_0x3bef7b(0x25b)]+'/'+_0x31d51a[_0x3bef7b(0x255)][_0x3bef7b(0x205)]));_0x590588[_0x3bef7b(0x238)]>0x0&&console[_0x3bef7b(0x271)](_0x3bef7b(0x265)+a5_0x5e5441[_0x3bef7b(0x254)](_0x590588['length']));console[_0x3bef7b(0x271)]();const _0x4bc4bf=[],_0x52ba9a=Date['now'](),_0x41acd7=createCommandSpinner(_0x3bef7b(0x26d));if(_0xe81ee6[_0x3bef7b(0x238)]>0x0)try{const _0x2b8c72=await reevaluateFromCache(_0x665ba['llm'],_0x31d51a,{'tests':_0xe81ee6},{'evaluatorId':_0x47ae32,'onTestStart':(_0x49937a,_0x387e73,_0x387662)=>{const _0x443981=_0x3bef7b;_0x41acd7[_0x443981(0x23e)]=_0x443981(0x20a)+(_0x387e73+0x1)+'/'+_0x387662+':\x20'+_0x49937a+_0x443981(0x1fc);if(!_0x41acd7[_0x443981(0x262)])_0x41acd7['start']();},'onTestComplete':(_0x5ce081,_0x1c2291)=>{const _0x4a9fd1=_0x3bef7b;_0x41acd7[_0x4a9fd1(0x248)]();if(_0x1c2291['status']===_0x4a9fd1(0x1f3))console[_0x4a9fd1(0x271)](a5_0x5e5441[_0x4a9fd1(0x245)](_0x4a9fd1(0x244)+_0x5ce081)+a5_0x5e5441[_0x4a9fd1(0x204)](_0x4a9fd1(0x208)));else _0x1c2291['status']==='FAIL'?console[_0x4a9fd1(0x271)](a5_0x5e5441[_0x4a9fd1(0x216)](_0x4a9fd1(0x26b)+_0x5ce081+_0x4a9fd1(0x249)+_0x1c2291[_0x4a9fd1(0x22f)])+a5_0x5e5441[_0x4a9fd1(0x204)]('\x20(cached)')):console[_0x4a9fd1(0x271)](a5_0x5e5441['red'](_0x4a9fd1(0x219)+_0x5ce081+_0x4a9fd1(0x249)+_0x1c2291[_0x4a9fd1(0x22f)]));_0x1c2291[_0x4a9fd1(0x1f9)]&&console[_0x4a9fd1(0x271)](a5_0x5e5441[_0x4a9fd1(0x204)](_0x4a9fd1(0x1fd)+_0x1c2291['conversation_url'])),_0x4bc4bf[_0x4a9fd1(0x260)](_0x1c2291);},'onTestSkipped':(_0x15604b,_0x5c0b11)=>{const _0x3ab381=_0x3bef7b;_0x41acd7['stop'](),console[_0x3ab381(0x271)](a5_0x5e5441[_0x3ab381(0x254)](_0x3ab381(0x226)+_0x15604b+_0x3ab381(0x249)+_0x5c0b11));}});for(const _0x4ebab3 of _0x2b8c72){!_0x4bc4bf['find'](_0x264162=>_0x264162[_0x3bef7b(0x218)]===_0x4ebab3['name'])&&_0x4bc4bf[_0x3bef7b(0x260)](_0x4ebab3);}}catch(_0x22d55c){_0x41acd7['stop']();const _0x5f2db8=_0x22d55c instanceof Error?_0x22d55c['message']:String(_0x22d55c);return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x27b)+_0x5f2db8)),0x1;}_0x41acd7[_0x3bef7b(0x248)]();if(_0x590588[_0x3bef7b(0x238)]>0x0){console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x229)](_0x3bef7b(0x20b)));const {projectId:_0x2e31a2,agentId:_0x1276bc}=_0x31d51a[_0x3bef7b(0x255)];for(const _0x724aa2 of _0x590588){console[_0x3bef7b(0x271)](_0x3bef7b(0x274)+a5_0x5e5441[_0x3bef7b(0x264)](_0x724aa2[_0x3bef7b(0x218)]));const _0x1ae745=createCommandSpinner(_0x3bef7b(0x21e)+_0x724aa2[_0x3bef7b(0x1f6)][_0x3bef7b(0x238)]+':\x20Sending\x20user\x20input...');_0x1ae745[_0x3bef7b(0x27c)]();try{const {result:_0xca8820}=await runTest(_0x665ba['llm'],_0x724aa2,{'agentId':_0x1276bc,'projectId':_0x2e31a2,'site':_0x31d51a[_0x3bef7b(0x236)],'noEval':![],'evaluatorId':_0x47ae32,'onRoundStart':(_0x3656b8,_0x231075)=>{const _0x121b38=_0x3bef7b;_0x1ae745['text']=_0x121b38(0x1ed)+(_0x3656b8+0x1)+'/'+_0x231075+_0x121b38(0x214);},'onRoundComplete':(_0x3d7227,_0x6e93b4,_0x8ca538)=>{const _0x2c11da=_0x3bef7b,_0xbebf52=formatElapsed(_0x6e93b4);_0x8ca538?console[_0x2c11da(0x271)](_0x2c11da(0x217)+(_0x3d7227+0x1)+'/'+_0x724aa2['rounds']['length']+'...\x20'+a5_0x5e5441['green']('✓')+'\x20('+_0xbebf52+')'):console[_0x2c11da(0x271)](_0x2c11da(0x217)+(_0x3d7227+0x1)+'/'+_0x724aa2[_0x2c11da(0x1f6)]['length']+_0x2c11da(0x239)+a5_0x5e5441[_0x2c11da(0x216)]('✗'));},'onEvaluationStart':()=>{const _0xe06ee6=_0x3bef7b;_0x1ae745[_0xe06ee6(0x23e)]='Evaluating\x20response...';},'onEvaluationComplete':_0x24a4a6=>{const _0x2e8d1e=_0x3bef7b,_0x3e415f=formatElapsed(_0x24a4a6);console[_0x2e8d1e(0x271)](_0x2e8d1e(0x1fe)+a5_0x5e5441['green']('✓')+'\x20('+_0x3e415f+')');}});_0x1ae745[_0x3bef7b(0x248)](),_0x4bc4bf[_0x3bef7b(0x260)](_0xca8820);if(_0xca8820[_0x3bef7b(0x20e)]===_0x3bef7b(0x1f3))console['log'](a5_0x5e5441['green'](_0x3bef7b(0x244)+_0xca8820[_0x3bef7b(0x22f)])+a5_0x5e5441['dim'](_0x3bef7b(0x27a)));else _0xca8820[_0x3bef7b(0x20e)]===_0x3bef7b(0x256)?console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x26b)+_0xca8820[_0x3bef7b(0x22f)])+a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x27a))):console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x219)+_0xca8820['reason']));_0xca8820[_0x3bef7b(0x1f9)]&&console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x1fd)+_0xca8820[_0x3bef7b(0x1f9)]));}catch(_0x48f7d2){_0x1ae745[_0x3bef7b(0x248)]();const _0x5265d7=_0x48f7d2 instanceof Error?_0x48f7d2[_0x3bef7b(0x201)]:String(_0x48f7d2);console[_0x3bef7b(0x271)](a5_0x5e5441['red']('✗\x20ERROR:\x20'+_0x5265d7)),_0x4bc4bf[_0x3bef7b(0x260)]({'name':_0x724aa2['name'],'status':'ERROR','reason':_0x5265d7,'timestamp':new Date()[_0x3bef7b(0x253)](),'duration_ms':0x0});}}}console['log']();const _0x42895f=Date[_0x3bef7b(0x251)]()-_0x52ba9a,_0xebe026=_0x4bc4bf[_0x3bef7b(0x20d)](_0x7e7f26=>_0x7e7f26[_0x3bef7b(0x20e)]===_0x3bef7b(0x1f3))[_0x3bef7b(0x238)],_0x55b4f8=_0x4bc4bf[_0x3bef7b(0x20d)](_0x2e1854=>_0x2e1854[_0x3bef7b(0x20e)]==='FAIL')[_0x3bef7b(0x238)],_0xee60da=_0x4bc4bf[_0x3bef7b(0x20d)](_0x3dbe69=>_0x3dbe69['status']===_0x3bef7b(0x21c))[_0x3bef7b(0x238)];console[_0x3bef7b(0x271)]('━'[_0x3bef7b(0x200)](0x3c)),console[_0x3bef7b(0x271)](_0x3bef7b(0x281)),console[_0x3bef7b(0x271)]('━'['repeat'](0x3c)),console[_0x3bef7b(0x271)](_0x3bef7b(0x212)+_0x4bc4bf[_0x3bef7b(0x238)]),console[_0x3bef7b(0x271)](_0x3bef7b(0x202)+a5_0x5e5441[_0x3bef7b(0x245)](_0xebe026)),console[_0x3bef7b(0x271)](_0x3bef7b(0x275)+a5_0x5e5441[_0x3bef7b(0x216)](_0x55b4f8));_0xee60da>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x5e5441[_0x3bef7b(0x216)](_0xee60da));console[_0x3bef7b(0x271)](_0x3bef7b(0x24d)+formatElapsed(_0x42895f)),console[_0x3bef7b(0x271)]('━'[_0x3bef7b(0x200)](0x3c));const _0x56ba47={'summary':{'total':_0x4bc4bf[_0x3bef7b(0x238)],'passed':_0xebe026,'failed':_0x55b4f8,'errors':_0xee60da>0x0?_0xee60da:undefined,'duration_ms':_0x42895f},'tests':_0x4bc4bf,'agent':{'project':_0x5bb7ac[_0x3bef7b(0x25b)],'name':_0x5bb7ac['agentName'],'site':_0x3b4b25},'timestamp':new Date(_0x52ba9a)[_0x3bef7b(0x253)]()};if(_0x376d6a!==_0x3bef7b(0x1ec)||_0x19711f){const _0x410f2e=formatResults(_0x56ba47,_0x376d6a);if(_0x19711f)try{a5_0x2f1d8d['writeFileSync'](_0x19711f,_0x410f2e,_0x3bef7b(0x24a)),console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x258)+_0x19711f));}catch(_0x2d660e){return console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)]('Error\x20writing\x20output\x20file:\x20'+_0x2d660e)),0x1;}else console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](_0x410f2e);}const _0x34979f=_0x4bc4bf[_0x3bef7b(0x20d)](_0x187509=>_0x187509[_0x3bef7b(0x20e)]!==_0x3bef7b(0x1f3));return _0x34979f[_0x3bef7b(0x238)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0xa78c65=a6_0x431f;(function(_0x5d98be,_0x2b37b2){const _0xc3fcee=a6_0x431f,_0xf25fb1=_0x5d98be();while(!![]){try{const _0x303604=parseInt(_0xc3fcee(0x119))/0x1+parseInt(_0xc3fcee(0x10c))/0x2*(-parseInt(_0xc3fcee(0x12a))/0x3)+-parseInt(_0xc3fcee(0xff))/0x4*(-parseInt(_0xc3fcee(0x12c))/0x5)+-parseInt(_0xc3fcee(0x129))/0x6+-parseInt(_0xc3fcee(0x110))/0x7+-parseInt(_0xc3fcee(0x128))/0x8+parseInt(_0xc3fcee(0xf0))/0x9*(parseInt(_0xc3fcee(0x125))/0xa);if(_0x303604===_0x2b37b2)break;else _0xf25fb1['push'](_0xf25fb1['shift']());}catch(_0x324d80){_0xf25fb1['push'](_0xf25fb1['shift']());}}}(a6_0x3af6,0xb6535));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_0xa78c65(0x105),a6_0xa78c65(0xf8),'cookie',a6_0xa78c65(0xfa),a6_0xa78c65(0x113),a6_0xa78c65(0x11d),'x-auth-token','x-trino-user']);function isSensitiveHeader(_0x100a32){const _0x102b65=a6_0xa78c65;return SENSITIVE_HEADERS['has'](_0x100a32[_0x102b65(0x117)]());}function parseHeader(_0x573594){const _0xf745ae=a6_0xa78c65,_0x36cf0e=_0x573594['indexOf'](':');if(_0x36cf0e===-0x1)throw new Error(_0xf745ae(0x114)+_0x573594+_0xf745ae(0x109)+_0xf745ae(0xf2));const _0x2faf49=_0x573594[_0xf745ae(0x11f)](0x0,_0x36cf0e)[_0xf745ae(0x118)](),_0x4d959d=_0x573594[_0xf745ae(0x11f)](_0x36cf0e+0x1)[_0xf745ae(0x118)]();if(!_0x2faf49)throw new Error(_0xf745ae(0xf6)+_0x573594+'\x22');return[_0x2faf49,_0x4d959d];}export class ApiCommand extends BaseCommand{['name']=a6_0xa78c65(0x12b);['description']=a6_0xa78c65(0x108);[a6_0xa78c65(0xf4)](_0x443dd3){const _0x5d3ba2=a6_0xa78c65,{args:_0x2c974b,options:_0xe0f0d4}=_0x443dd3,_0x128255=_0xe0f0d4;if(_0x2c974b[_0x5d3ba2(0x116)]===0x0)return _0x5d3ba2(0xfd);const _0x2485a9=_0x2c974b[0x0];if(!_0x2485a9[_0x5d3ba2(0x120)]('/'))return _0x5d3ba2(0xed)+_0x2485a9;const _0x1d2224=_0x128255[_0x5d3ba2(0xfc)],_0xc41d35=_0x128255[_0x5d3ba2(0x126)];if(_0x1d2224&&_0xc41d35)return _0x5d3ba2(0x122);const _0x574496=_0x128255['method']||'GET',_0x1df2d4=[_0x5d3ba2(0xf1),_0x5d3ba2(0x127),_0x5d3ba2(0x11e),_0x5d3ba2(0x115),_0x5d3ba2(0x104)];if(!_0x1df2d4['includes'](_0x574496[_0x5d3ba2(0x124)]()))return _0x5d3ba2(0x10a)+_0x574496+_0x5d3ba2(0x123)+_0x1df2d4[_0x5d3ba2(0x121)](',\x20');const _0x577613=_0x128255[_0x5d3ba2(0x10b)]||'td',_0x29e2ed=['td',_0x5d3ba2(0x102),'workflow','trino',_0x5d3ba2(0x112),_0x5d3ba2(0xf9)];if(!_0x29e2ed[_0x5d3ba2(0xf5)](_0x577613))return _0x5d3ba2(0xfb)+_0x577613+'.\x20Valid\x20types:\x20'+_0x29e2ed['join'](',\x20');return undefined;}async['execute'](_0x19aab2){const _0x19ad00=a6_0xa78c65,{options:_0x269b00,args:_0x4e3734,tdx:_0x1cb008}=_0x19aab2,_0x47ea8f=_0x269b00,_0x4b2f03=_0x4e3734[0x0],_0x162832=(_0x47ea8f[_0x19ad00(0xf3)]||_0x19ad00(0xf1))[_0x19ad00(0x124)](),_0xf3ffd6=_0x47ea8f[_0x19ad00(0xfc)],_0x4a8f53=_0x47ea8f[_0x19ad00(0x126)],_0x1ded7b=_0x47ea8f[_0x19ad00(0x103)],_0x27a443=_0x47ea8f['type']||'td';try{const _0x550d7c={};if(_0x1ded7b){const _0x46f231=Array[_0x19ad00(0xf7)](_0x1ded7b)?_0x1ded7b:[_0x1ded7b];for(const _0x260edd of _0x46f231){const [_0x2ac3d1,_0x429512]=parseHeader(_0x260edd);_0x550d7c[_0x2ac3d1]=_0x429512;}}let _0x43f8b0;if(_0xf3ffd6)_0x43f8b0=_0xf3ffd6;else{if(_0x4a8f53)try{_0x43f8b0=RawAPI[_0x19ad00(0xfe)](_0x4a8f53);}catch(_0x5881a7){return console[_0x19ad00(0x10e)]('Error:\x20'+(_0x5881a7 instanceof Error?_0x5881a7[_0x19ad00(0x107)]:String(_0x5881a7))),0x1;}}const _0x21e6fc={'method':_0x162832,'apiType':_0x27a443,'includeHeaders':_0x269b00['verbose']};_0x43f8b0&&(_0x21e6fc['body']=_0x43f8b0);Object[_0x19ad00(0x10f)](_0x550d7c)['length']>0x0&&(_0x21e6fc[_0x19ad00(0x106)]=_0x550d7c);if(_0x269b00['verbose']){const _0x5049e3=resolveSite(_0x269b00[_0x19ad00(0x100)]),_0xdd54c2=getEndpoint(_0x5049e3,_0x27a443),_0xa91bba=''+_0xdd54c2+_0x4b2f03;console[_0x19ad00(0x10e)]('>\x20'+_0x162832+'\x20'+_0xa91bba);const _0x21cb67=getAuthHeaders(_0x5049e3),_0x82d7df={..._0x21cb67,..._0x550d7c};for(const [_0x69342f,_0x1974b4]of Object[_0x19ad00(0x101)](_0x82d7df)){!isSensitiveHeader(_0x69342f)&&console[_0x19ad00(0x10e)]('>\x20'+_0x69342f+':\x20'+_0x1974b4);}_0x43f8b0&&console['error']('>'),console[_0x19ad00(0x10e)]('');}const _0x434508=await _0x1cb008[_0x19ad00(0x12b)][_0x19ad00(0xef)](_0x4b2f03,_0x21e6fc);if(_0x269b00[_0x19ad00(0x11b)]&&_0x434508[_0x19ad00(0x106)]){console['error']('<\x20HTTP/1.1\x20'+_0x434508[_0x19ad00(0x12d)]);for(const [_0x56ee90,_0x370128]of Object[_0x19ad00(0x101)](_0x434508[_0x19ad00(0x106)])){!isSensitiveHeader(_0x56ee90)&&console['error']('<\x20'+_0x56ee90+':\x20'+_0x370128);}console[_0x19ad00(0x10e)]('');}const _0x854c49=Boolean(_0x269b00[_0x19ad00(0x111)]),_0x3e0792={'color':_0x269b00['color'],'noColor':_0x269b00[_0x19ad00(0x10d)]||_0x854c49&&!_0x269b00['color']},_0x4d9a48=colorizeJSON(_0x434508[_0x19ad00(0xfc)],_0x3e0792);return _0x269b00[_0x19ad00(0x111)]?(writeFileSync(_0x269b00[_0x19ad00(0x111)],_0x4d9a48),console[_0x19ad00(0x10e)]('Results\x20saved\x20to\x20'+_0x269b00[_0x19ad00(0x111)])):console[_0x19ad00(0xee)](_0x4d9a48),0x0;}catch(_0x46900c){return _0x46900c instanceof Error?(console['error'](_0x19ad00(0x11a)+_0x46900c['message']),_0x269b00[_0x19ad00(0x11b)]&&_0x46900c['stack']&&console[_0x19ad00(0x10e)]('\x0aStack\x20trace:\x0a'+_0x46900c[_0x19ad00(0x11c)])):console['error'](_0x19ad00(0x11a)+String(_0x46900c)),0x1;}}}function a6_0x431f(_0x6fed93,_0x29d948){_0x6fed93=_0x6fed93-0xed;const _0x3af64c=a6_0x3af6();let _0x431f77=_0x3af64c[_0x6fed93];return _0x431f77;}function a6_0x3af6(){const _0x48f5c4=['join','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','.\x20Valid\x20methods:\x20','toUpperCase','8340PYNZur','file','POST','9596448hJsIJG','7411896bxTYfu','12fYOQTQ','api','250VzQYEJ','status','Endpoint\x20must\x20start\x20with\x20/:\x20','log','request','46611CbCzOe','GET','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','method','validate','includes','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','isArray','proxy-authorization','llm-proxy','set-cookie','Invalid\x20API\x20type:\x20','data','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','readBodyFromFile','3448wljPXN','site','entries','cdp','header','PATCH','authorization','headers','message','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','\x22.\x20','Invalid\x20HTTP\x20method:\x20','type','175362yTgyQA','noColor','error','keys','9682631yoWBXp','output','llm','set-cookie2','Invalid\x20header\x20format:\x20\x22','DELETE','length','toLowerCase','trim','553248IshyfM','Error:\x20','verbose','stack','x-xsrf-token','PUT','substring','startsWith'];a6_0x3af6=function(){return _0x48f5c4;};return a6_0x3af6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x5e5280=a7_0x2f6c;(function(_0x4f4fa1,_0x17a003){const _0x16dd73=a7_0x2f6c,_0x39cb75=_0x4f4fa1();while(!![]){try{const _0x3abe94=parseInt(_0x16dd73(0x187))/0x1+-parseInt(_0x16dd73(0x19a))/0x2+-parseInt(_0x16dd73(0x1a1))/0x3*(-parseInt(_0x16dd73(0x194))/0x4)+-parseInt(_0x16dd73(0x168))/0x5*(parseInt(_0x16dd73(0x16c))/0x6)+-parseInt(_0x16dd73(0x17e))/0x7+parseInt(_0x16dd73(0x19e))/0x8*(-parseInt(_0x16dd73(0x172))/0x9)+parseInt(_0x16dd73(0x199))/0xa;if(_0x3abe94===_0x17a003)break;else _0x39cb75['push'](_0x39cb75['shift']());}catch(_0x4a3100){_0x39cb75['push'](_0x39cb75['shift']());}}}(a7_0x5c8b,0xd39bd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x2f6c(_0xf6b9ec,_0x1e563e){_0xf6b9ec=_0xf6b9ec-0x15f;const _0x5c8bd3=a7_0x5c8b();let _0x2f6c30=_0x5c8bd3[_0xf6b9ec];return _0x2f6c30;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x29609b from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x5c8b(){const _0x3ee0d4=['Site\x20name\x20cannot\x20be\x20empty','786739hSBayp','status','API\x20key\x20cannot\x20be\x20empty','description','site','Name:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','warn','log','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20Profile\x20\x27','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','28IiRPWD','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','customSite','apiKey','other','27115530PunNlu','495736WRjtSq','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','join','System\x20keychain\x20is\x20not\x20available','944otAmHN','text','tdx:\x20auth\x20setup','30450pOSRKf','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','message','Read\x20credential\x20from\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','tdx:\x20auth\x20clear','trim','Validating\x20API\x20key...','No\x20API\x20key\x20found\x20in\x20keychain','yellow','green','\x20\x20tdx','/app/mp/ak','\x20(site:\x20','first_name','name','User:\x20','\x20(profile:\x20','Select\x20your\x20Treasure\x20Data\x20site:','8325865kKNdUf','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','6hccXRL','select','\x20for\x20profile:\x20','\x27\x20registered','red','auth','32634TpWlWF','test','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','execute','N/A','us01','getUserInfo','create','Enter\x20site\x20name:','✓\x20Authentication\x20successful\x0a','bold','No\x20credential\x20found','2531788DXyBBk','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Setup\x20API\x20key\x20authentication\x20interactively','error','✓\x20API\x20key\x20removed\x20from\x20keychain','\x0aSetup\x20cancelled','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','ERROR'];a7_0x5c8b=function(){return _0x3ee0d4;};return a7_0x5c8b();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x562def from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x5e5280(0x164)]='auth:setup';[a7_0x5e5280(0x18a)]=a7_0x5e5280(0x180);async[a7_0x5e5280(0x175)](_0x452fd3){const _0x262af3=a7_0x5e5280,{options:_0x4c6cd9}=_0x452fd3,_0x281e7b=_0x4c6cd9['profile'];console[_0x262af3(0x18f)](a7_0x562def[_0x262af3(0x17c)](_0x262af3(0x1a0)));const _0x8146cb=_0x4c6cd9['site']||_0x262af3(0x177),{choices:_0x13b77c,initialIndex:_0x85cd78}=buildSiteChoices(_0x8146cb),_0x2d97d0=_0x281e7b?_0x262af3(0x195)+_0x281e7b+'):':_0x262af3(0x167),_0x2bdc3c=await a7_0x29609b({'type':_0x262af3(0x16d),'name':_0x262af3(0x18b),'message':_0x2d97d0,'choices':_0x13b77c,'initial':_0x85cd78});if(!_0x2bdc3c['site'])return console[_0x262af3(0x18f)](_0x262af3(0x183)),0x1;let _0x281a69;if(_0x2bdc3c[_0x262af3(0x18b)]===_0x262af3(0x198)){const _0x37a035=await a7_0x29609b({'type':_0x262af3(0x19f),'name':_0x262af3(0x196),'message':_0x262af3(0x17a),'initial':'us01','validate':_0x31d118=>{const _0x1d7e06=_0x262af3;if(!_0x31d118||!_0x31d118[_0x1d7e06(0x1a7)]())return _0x1d7e06(0x186);if(!/^[a-z0-9-]+$/[_0x1d7e06(0x173)](_0x31d118[_0x1d7e06(0x1a7)]()))return _0x1d7e06(0x17f);return!![];}});if(!_0x37a035[_0x262af3(0x196)])return console[_0x262af3(0x18f)](_0x262af3(0x183)),0x1;_0x281a69=_0x37a035[_0x262af3(0x196)];}else _0x281a69=_0x2bdc3c['site'];const _0x56e445=resolveSite(_0x281a69);console[_0x262af3(0x18f)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x56e445),console[_0x262af3(0x18f)](_0x262af3(0x190)),console[_0x262af3(0x18f)]('\x20\x20'+getConsoleUrl(_0x56e445,_0x262af3(0x161)));const _0x52a729=await a7_0x29609b({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x226696=>{const _0x1ff41d=_0x262af3;if(!_0x226696||!_0x226696[_0x1ff41d(0x1a7)]())return _0x1ff41d(0x189);return!![];}});if(!_0x52a729['apiKey'])return console[_0x262af3(0x18f)](_0x262af3(0x183)),0x1;const _0x314942=_0x52a729[_0x262af3(0x197)];console['log'](_0x262af3(0x1a8));try{const _0x3f4723=TDX[_0x262af3(0x179)]({'site':_0x56e445,'apiKey':_0x314942[_0x262af3(0x1a7)](),'logLevel':_0x4c6cd9['logLevel']??LogLevel[_0x262af3(0x185)]}),_0x13f63=await _0x3f4723['jobs'][_0x262af3(0x178)]();console[_0x262af3(0x18f)](_0x262af3(0x19b)+_0x13f63['email']+')');const _0x54e8d9=await isKeychainAvailable();_0x54e8d9?(await saveAPIKeyAsync(_0x314942['trim'](),_0x56e445,_0x281e7b),console['log'](_0x262af3(0x184)+(_0x281e7b?_0x262af3(0x166)+_0x281e7b+')':''))):(console[_0x262af3(0x18e)](a7_0x562def[_0x262af3(0x1aa)](_0x262af3(0x169))),console[_0x262af3(0x18e)](a7_0x562def['yellow'](_0x262af3(0x16a))));if(_0x281e7b){const _0x21b7b7={'site':_0x56e445};saveProfileToUserConfig(_0x281e7b,_0x21b7b7),console[_0x262af3(0x18f)](_0x262af3(0x191)+_0x281e7b+_0x262af3(0x16f));}else saveDefaultSiteToUserConfig(_0x56e445),console[_0x262af3(0x18f)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x56e445);const _0x20382a=_0x281e7b?'\x20--profile\x20'+_0x281e7b:'';return console[_0x262af3(0x18f)](),console['log'](_0x262af3(0x174)),console[_0x262af3(0x18f)](_0x262af3(0x160)+_0x20382a+_0x262af3(0x1a2)),console[_0x262af3(0x18f)](_0x262af3(0x160)+_0x20382a+_0x262af3(0x192)),0x0;}catch(_0x656960){if(_0x656960 instanceof HTTPClientError&&_0x656960[_0x262af3(0x188)]===0x191)return printAuthError(_0x656960),0x1;return console[_0x262af3(0x181)](a7_0x562def[_0x262af3(0x170)]('✗\x20Validation\x20failed:\x20'+(_0x656960 instanceof Error?_0x656960[_0x262af3(0x1a3)]:String(_0x656960)))),console[_0x262af3(0x181)](_0x262af3(0x1a5)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x5e5280(0x171);['description']=a7_0x5e5280(0x16b);async['execute'](_0x2bff9a){const _0x1b780c=a7_0x5e5280,{options:_0x55e2ab,tdx:_0xab21fa}=_0x2bff9a,_0x1ae9d6=_0x55e2ab[_0x1b780c(0x18b)],_0x1cc8a8=_0x55e2ab[_0x1b780c(0x193)],_0x24ba4b=_0x1cc8a8?_0x1cc8a8:_0x1b780c(0x176);console[_0x1b780c(0x18f)]('tdx\x20profile:\x20'+_0x24ba4b+_0x1b780c(0x162)+_0x1ae9d6+')');const _0x5dcf27=await resolveAPIKeyAsync(_0x1ae9d6,_0x1cc8a8);if(_0x5dcf27){const {source:_0x2c6465,isDeprecated:_0x43bd09}=_0x5dcf27,_0x350825=_0x1b780c(0x1a4)+_0x2c6465;console[_0x1b780c(0x18f)](_0x43bd09?a7_0x562def['yellow'](_0x350825):_0x350825);}else console[_0x1b780c(0x18f)](a7_0x562def[_0x1b780c(0x1aa)](_0x1b780c(0x17d)));try{const _0x148910=await _0xab21fa['jobs'][_0x1b780c(0x178)]();return console[_0x1b780c(0x18f)](a7_0x562def[_0x1b780c(0x15f)](_0x1b780c(0x17b))),console[_0x1b780c(0x18f)](_0x1b780c(0x165)+_0x148910['email']),(_0x148910[_0x1b780c(0x163)]||_0x148910['last_name'])&&console[_0x1b780c(0x18f)](_0x1b780c(0x18c)+[_0x148910[_0x1b780c(0x163)],_0x148910['last_name']]['filter'](Boolean)[_0x1b780c(0x19c)]('\x20')),0x0;}catch(_0x54e158){return _0x54e158 instanceof HTTPClientError&&_0x54e158[_0x1b780c(0x188)]===0x191?printAuthError(_0x54e158,!![],_0x1cc8a8):console[_0x1b780c(0x181)](a7_0x562def[_0x1b780c(0x170)]('✗\x20Validation\x20failed:\x20'+(_0x54e158 instanceof Error?_0x54e158[_0x1b780c(0x1a3)]:String(_0x54e158)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x5e5280(0x164)]='auth:clear';[a7_0x5e5280(0x18a)]=a7_0x5e5280(0x18d);async[a7_0x5e5280(0x175)](_0x193502){const _0x248d61=a7_0x5e5280,{options:_0x5610bf}=_0x193502,_0x4bdcd0=_0x5610bf[_0x248d61(0x193)];console['log'](a7_0x562def[_0x248d61(0x17c)](_0x248d61(0x1a6)));const _0x1867cd=await isKeychainAvailable();if(!_0x1867cd)return console[_0x248d61(0x181)](a7_0x562def[_0x248d61(0x170)](_0x248d61(0x19d))),0x1;const _0x2eb206=await deleteKeychainAPIKey(_0x4bdcd0);return _0x2eb206?(clearCredentialCache(),console[_0x248d61(0x18f)](_0x248d61(0x182)+(_0x4bdcd0?_0x248d61(0x166)+_0x4bdcd0+')':'')),0x0):(console[_0x248d61(0x18f)](_0x248d61(0x1a9)+(_0x4bdcd0?_0x248d61(0x16e)+_0x4bdcd0:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a8_0x468b(){const _0x1f866f=['3032802qyZmQB','name','Getting\x20default\x20agent...','event','171ZYDuFN','targetKnowledgeBase','done','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','session\x20context','type','6XNnico','new','streamChat','string','execute','Resolving\x20project\x20\x27','llmProject','resolveAgentId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','message','description','resolveProjectId','metadata','targetAgent','content','8222074vArJbQ','--agent\x20flag','cause','chat-create','Using\x20cached\x20default\x20agent:\x20','Continuing\x20chat:\x20','streamChatJsonl','688628oLOouc','\x27\x20not\x20found','targetWebSearchTool','Error:\x20','slice','887770ovAtKP','2851732JyyyMo','log','tool','handleChatEvent','verbose','\x0aStack\x20trace:','getOrCreateDefaultAgent','chatId','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Error:\x20Chat\x20session\x20\x27','claude-4.5-haiku','context','getDefaultAgent','chat','tool_call','stream','927208Scjjpz','\x27...','Chat\x20session:\x20','Create\x20a\x20new\x20chat\x20session','CHAT_NOT_FOUND','llmAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','validate','code','Resolving\x20agent\x20\x27','functionName','args','agent','includes','\x0aError:\x20','data','agentId','targetFunction','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','6224795dVSJIp','site','llm','write','stack','404','\x20\x20Cause:\x20','stringify','error','join'];a8_0x468b=function(){return _0x1f866f;};return a8_0x468b();}const a8_0x508861=a8_0x5dbc;(function(_0x3a5ae4,_0xe58807){const _0xacc719=a8_0x5dbc,_0x3ddea9=_0x3a5ae4();while(!![]){try{const _0x5eed78=parseInt(_0xacc719(0x10b))/0x1+parseInt(_0xacc719(0x110))/0x2*(parseInt(_0xacc719(0xf5))/0x3)+parseInt(_0xacc719(0x111))/0x4+parseInt(_0xacc719(0xe1))/0x5+parseInt(_0xacc719(0xeb))/0x6+-parseInt(_0xacc719(0x104))/0x7+-parseInt(_0xacc719(0x121))/0x8*(parseInt(_0xacc719(0xef))/0x9);if(_0x5eed78===_0xe58807)break;else _0x3ddea9['push'](_0x3ddea9['shift']());}catch(_0x24cdec){_0x3ddea9['push'](_0x3ddea9['shift']());}}}(a8_0x468b,0xa1e10));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(_0x2dbf51,_0x2701f0){const _0x2462fe=a8_0x5dbc;if(_0x2dbf51 instanceof SDKError)console['error'](_0x2462fe(0x10e)+_0x2dbf51[_0x2462fe(0xfe)]),_0x2701f0[_0x2462fe(0x115)]&&(_0x2dbf51[_0x2462fe(0x106)]&&console[_0x2462fe(0xe9)](_0x2462fe(0xe7)+_0x2dbf51[_0x2462fe(0x106)]),_0x2dbf51[_0x2462fe(0xe5)]&&(console[_0x2462fe(0xe9)](_0x2462fe(0x116)),console['error'](_0x2dbf51[_0x2462fe(0xe5)])));else throw _0x2dbf51;}async function resolveAgentId(_0x5af050,_0x62b44,_0x3595b9,_0x224cfc,_0x1c236a){const _0x357ae0=a8_0x5dbc,_0x176b98=_0x62b44||_0x3595b9;if(_0x176b98){const {projectName:_0x4d9397,agentName:_0x27de40}=parseAgentRef(_0x176b98),_0x38fbe5=_0x27de40||_0x176b98,_0x2c693b=_0x27de40?_0x4d9397:_0x224cfc;if(!_0x2c693b)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x1c236a){const _0x5d6d24=_0x62b44?_0x357ae0(0x105):_0x357ae0(0xf3);console[_0x357ae0(0xe9)]('Using\x20agent\x20from\x20'+_0x5d6d24+':\x20'+_0x2c693b+'/'+_0x38fbe5);}const _0x34ebb1=await withSpinner(_0x357ae0(0xfa)+_0x2c693b+_0x357ae0(0x122),()=>_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x100)](_0x2c693b),{'verbose':_0x1c236a}),_0x27cb63=await withSpinner(_0x357ae0(0x12a)+_0x38fbe5+_0x357ae0(0x122),()=>_0x5af050['llm'][_0x357ae0(0xfc)](_0x38fbe5,_0x34ebb1[_0x357ae0(0xdd)]),{'verbose':_0x1c236a});return _0x27cb63[_0x357ae0(0xdd)];}else{const _0x5082a5=_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x11d)]();if(_0x5082a5)return _0x1c236a&&console[_0x357ae0(0xe9)](_0x357ae0(0x108)+_0x5082a5[_0x357ae0(0xec)]),_0x5082a5['id'];const _0x4e8990=await withSpinner(_0x357ae0(0xed),()=>_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x117)](_0x357ae0(0x11b),0x0),{'verbose':_0x1c236a});return _0x4e8990[_0x357ae0(0xdd)]['id'];}}function a8_0x5dbc(_0xa61152,_0x374e87){_0xa61152=_0xa61152-0xd8;const _0x468b03=a8_0x468b();let _0x5dbc88=_0x468b03[_0xa61152];return _0x5dbc88;}export class ChatCommand extends BaseCommand{[a8_0x508861(0xec)]=a8_0x508861(0x11e);[a8_0x508861(0xff)]=a8_0x508861(0x127);[a8_0x508861(0x128)](_0x3679ba){const _0x509e13=a8_0x508861,_0x47b6b5=_0x3679ba[_0x509e13(0xd9)][_0x509e13(0xea)]('\x20');if(!_0x47b6b5)return _0x509e13(0xfd);return undefined;}async['streamChat'](_0x22f858,_0x4f183c,_0xda42c2,_0x1ae738,_0x34c6f9){const _0x291802=a8_0x508861;for await(const _0x1b7b2c of _0x22f858[_0x291802(0xe3)]['chat'](_0x4f183c,{'agentId':_0xda42c2,'chatId':_0x1ae738})){if(_0x1b7b2c[_0x291802(0xf4)]===_0x291802(0x101)){const _0x1c8b38=_0x1b7b2c[_0x291802(0xdd)][_0x291802(0x118)];saveLastChatId(_0x1c8b38),_0x34c6f9&&console[_0x291802(0xe9)](_0x291802(0x123)+_0x1c8b38);}else _0x1b7b2c['type']===_0x291802(0xee)&&this[_0x291802(0x114)](_0x1b7b2c[_0x291802(0xdd)]);}}async[a8_0x508861(0x10a)](_0x5df0cc,_0x497657,_0x1f034e,_0x38239b){const _0x3900fb=a8_0x508861,_0x426a52=_0x5df0cc[_0x3900fb(0x11c)][_0x3900fb(0xe2)];let _0x69529=![];for await(const _0x913404 of _0x5df0cc['llm']['chat'](_0x497657,{'agentId':_0x1f034e,'chatId':_0x38239b})){if(_0x913404[_0x3900fb(0xf4)]===_0x3900fb(0x101)){const _0x57748d=_0x913404[_0x3900fb(0xdd)];saveLastChatId(_0x57748d['chatId']);const _0x52086a=_0x57748d['projectId']&&_0x57748d[_0x3900fb(0xde)]?getLLMConversationUrl(_0x426a52,_0x57748d['projectId'],_0x57748d[_0x3900fb(0xde)],_0x57748d[_0x3900fb(0x118)]):undefined;console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0x101),'data':{'chatId':_0x57748d[_0x3900fb(0x118)],'agentId':_0x57748d[_0x3900fb(0xde)],'consoleUrl':_0x52086a}})),_0x69529=!![];}else{if(_0x913404[_0x3900fb(0xf4)]===_0x3900fb(0xee)){!_0x69529&&_0x38239b&&(console['log'](JSON['stringify']({'type':_0x3900fb(0x101),'data':{'chatId':_0x38239b}})),_0x69529=!![]);const _0x557cc9=_0x913404['data'];if(_0x3900fb(0x103)in _0x557cc9)console[_0x3900fb(0x112)](JSON['stringify']({'type':_0x3900fb(0x103),'data':{'content':_0x557cc9['content']}}));else{if(_0x3900fb(0x11f)in _0x557cc9){const _0x31acfd=_0x557cc9[_0x3900fb(0x11f)];console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0x11f),'data':{'id':_0x31acfd['id'],'name':_0x31acfd[_0x3900fb(0xd8)],'target':_0x31acfd[_0x3900fb(0xf0)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0x102)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0x10d)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0xdf)]}}));}else{if(_0x3900fb(0x113)in _0x557cc9)console['log'](JSON[_0x3900fb(0xe8)]({'type':'tool_result','data':{'id':_0x557cc9[_0x3900fb(0x113)]['id'],'name':_0x557cc9[_0x3900fb(0x113)][_0x3900fb(0xd8)],'result':typeof _0x557cc9[_0x3900fb(0x113)][_0x3900fb(0x103)]===_0x3900fb(0xf8)?_0x557cc9[_0x3900fb(0x113)][_0x3900fb(0x103)][_0x3900fb(0x10f)](0x0,0x1f4):''}}));else _0x3900fb(0xe9)in _0x557cc9&&console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0xe9),'data':{'error':_0x557cc9[_0x3900fb(0xe9)]}}));}}}}}console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0xf1)}));}async['execute'](_0x2f0309){const _0x25bfed=a8_0x508861,{options:_0x1aaebe,args:_0x486220,tdx:_0x4206ee}=_0x2f0309,_0x582392=_0x486220['join']('\x20'),_0x568fc2=_0x1aaebe,_0x2e613d=_0x568fc2[_0x25bfed(0xda)],_0x67baa8=_0x568fc2[_0x25bfed(0x126)],_0x57accb=_0x568fc2[_0x25bfed(0xfb)],_0x280dcd=_0x568fc2[_0x25bfed(0xf6)],_0xe182d5=_0x568fc2[_0x25bfed(0x118)],_0x1f01c7=_0x568fc2[_0x25bfed(0x120)];if(_0x280dcd&&_0xe182d5)return console[_0x25bfed(0xe9)](_0x25bfed(0xe0)),0x1;try{let _0x5e6caa,_0x309ff3;if(_0xe182d5)_0x309ff3=_0xe182d5;else!_0x280dcd&&(_0x309ff3=loadLastChatId(),_0x309ff3&&_0x1aaebe[_0x25bfed(0x115)]&&console[_0x25bfed(0xe9)](_0x25bfed(0x109)+_0x309ff3));!_0xe182d5&&(_0x280dcd||!_0x309ff3)&&(_0x5e6caa=await resolveAgentId(_0x4206ee,_0x2e613d,_0x67baa8,_0x57accb,_0x1aaebe[_0x25bfed(0x115)]));const _0x5005de=_0x1f01c7?(_0x24029d,_0x2a6e47,_0x220906)=>this[_0x25bfed(0x10a)](_0x4206ee,_0x24029d,_0x2a6e47,_0x220906):(_0xcc81cf,_0x5b917a,_0xbb349c)=>this[_0x25bfed(0xf7)](_0x4206ee,_0xcc81cf,_0x5b917a,_0xbb349c,_0x1aaebe[_0x25bfed(0x115)]);try{await _0x5005de(_0x582392,_0x5e6caa,_0x309ff3);}catch(_0xd0181b){const _0x3b5ff6=_0xd0181b instanceof SDKError&&_0xd0181b[_0x25bfed(0x129)]===ErrorCode[_0x25bfed(0x125)]||_0xd0181b instanceof Error&&_0xd0181b[_0x25bfed(0xfe)][_0x25bfed(0xdb)](_0x25bfed(0xe6));if(_0x3b5ff6&&_0xe182d5)return console[_0x25bfed(0xe9)](_0x25bfed(0x11a)+_0xe182d5+_0x25bfed(0x10c)),0x1;if(_0x3b5ff6)_0x1aaebe[_0x25bfed(0x115)]&&console['error'](_0x25bfed(0xf2)),!_0x5e6caa&&(_0x5e6caa=await resolveAgentId(_0x4206ee,_0x2e613d,_0x67baa8,_0x57accb,_0x1aaebe['verbose'])),await _0x5005de(_0x582392,_0x5e6caa,undefined);else throw _0xd0181b;}return!_0x1f01c7&&console['log'](),0x0;}catch(_0x517606){return console[_0x25bfed(0xe9)](),handleSDKError(_0x517606,_0x1aaebe),0x1;}}[a8_0x508861(0x114)](_0x5c935e){const _0x21dcfc=a8_0x508861;if(_0x21dcfc(0x103)in _0x5c935e)process['stdout'][_0x21dcfc(0xe4)](_0x5c935e[_0x21dcfc(0x103)]);else _0x21dcfc(0xe9)in _0x5c935e&&console[_0x21dcfc(0xe9)](_0x21dcfc(0xdc)+_0x5c935e[_0x21dcfc(0xe9)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x508861(0xec)]=a8_0x508861(0x107);['description']=a8_0x508861(0x124);[a8_0x508861(0x128)](_0x4f6da3){const _0x240688=a8_0x508861,_0x2d7c63=_0x4f6da3['options'],_0x3dc980=_0x2d7c63[_0x240688(0xda)],_0x49c6d5=_0x2d7c63[_0x240688(0x126)];if(!_0x3dc980&&!_0x49c6d5)return _0x240688(0x119);return undefined;}async[a8_0x508861(0xf9)](_0x6d16dd){const _0x55ab06=a8_0x508861,{options:_0x1ffeec,tdx:_0x597cf8}=_0x6d16dd,_0xc05c46=_0x1ffeec,_0x59d902=_0xc05c46[_0x55ab06(0xda)],_0x403dfc=_0xc05c46['llmAgent'],_0x545be9=_0xc05c46[_0x55ab06(0xfb)];try{const _0x35ed78=await resolveAgentId(_0x597cf8,_0x59d902,_0x403dfc,_0x545be9,_0x1ffeec['verbose']),_0x81588a=await _0x597cf8['llm']['startChat'](_0x35ed78);return saveLastChatId(_0x81588a['id']),console[_0x55ab06(0x112)](JSON[_0x55ab06(0xe8)]({'chatId':_0x81588a['id'],'agentId':_0x35ed78})),0x0;}catch(_0x57005f){return handleSDKError(_0x57005f,_0x1ffeec),0x1;}}}
|
|
1
|
+
const a8_0x2db0c1=a8_0x226f;function a8_0x32f9(){const _0xfc6ee=['Using\x20agent\x20from\x20','2824576WYxpEs','claude-4.5-haiku','\x0aStack\x20trace:','chat','CHAT_NOT_FOUND','llmAgent','content','getOrCreateDefaultAgent','targetKnowledgeBase','llm','Create\x20a\x20new\x20chat\x20session','context','verbose','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Getting\x20default\x20agent...','validate','code','write','tool_call','chatId','10422062isKOue','streamChat','11769NuUWhn','10ARkQIq','2547FYBikz','handleChatEvent','name','event','targetAgent','stack','new','\x27...','tool_result','Using\x20cached\x20default\x20agent:\x20','getDefaultAgent','agent','llmProject','slice','5TpaKGg','resolveProjectId','stdout','cause','tool','--agent\x20flag','metadata','streamChatJsonl','chat-create','250cIavuV','Error:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','error','functionName','stringify','5725806RCRxLL','options','log','join','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','1418043tOBwqb','type','404','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','stream','targetFunction','data','1150166RJxIum','string','message','396lebSFl','projectId','agentId','resolveAgentId','8OkZOEJ','includes','description'];a8_0x32f9=function(){return _0xfc6ee;};return a8_0x32f9();}(function(_0x5b7a80,_0x28eaf8){const _0x3bcdcc=a8_0x226f,_0x2122e8=_0x5b7a80();while(!![]){try{const _0x343202=-parseInt(_0x3bcdcc(0x122))/0x1+parseInt(_0x3bcdcc(0x110))/0x2*(-parseInt(_0x3bcdcc(0xf7))/0x3)+parseInt(_0x3bcdcc(0x12d))/0x4+-parseInt(_0x3bcdcc(0x107))/0x5*(parseInt(_0x3bcdcc(0x116))/0x6)+parseInt(_0x3bcdcc(0xf5))/0x7*(-parseInt(_0x3bcdcc(0x129))/0x8)+parseInt(_0x3bcdcc(0xf9))/0x9*(-parseInt(_0x3bcdcc(0xf8))/0xa)+-parseInt(_0x3bcdcc(0x11b))/0xb*(-parseInt(_0x3bcdcc(0x125))/0xc);if(_0x343202===_0x28eaf8)break;else _0x2122e8['push'](_0x2122e8['shift']());}catch(_0x2900bc){_0x2122e8['push'](_0x2122e8['shift']());}}}(a8_0x32f9,0xd5efa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x226f(_0x1beacc,_0x4a7734){_0x1beacc=_0x1beacc-0xef;const _0x32f918=a8_0x32f9();let _0x226fb5=_0x32f918[_0x1beacc];return _0x226fb5;}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(_0x94b929,_0x498f92){const _0x3e97d7=a8_0x226f;if(_0x94b929 instanceof SDKError)console[_0x3e97d7(0x113)](_0x3e97d7(0x111)+_0x94b929[_0x3e97d7(0x124)]),_0x498f92[_0x3e97d7(0x139)]&&(_0x94b929[_0x3e97d7(0x10a)]&&console[_0x3e97d7(0x113)]('\x20\x20Cause:\x20'+_0x94b929['cause']),_0x94b929[_0x3e97d7(0xfe)]&&(console[_0x3e97d7(0x113)](_0x3e97d7(0x12f)),console[_0x3e97d7(0x113)](_0x94b929[_0x3e97d7(0xfe)])));else throw _0x94b929;}async function resolveAgentId(_0x22c26f,_0x1127fd,_0x187673,_0x1f5ce5,_0x13d6bd){const _0x2a1195=a8_0x226f,_0x1d592e=_0x1127fd||_0x187673;if(_0x1d592e){const {projectName:_0x1b2abf,agentName:_0x297db7}=parseAgentRef(_0x1d592e),_0x34ab47=_0x297db7||_0x1d592e,_0xe97e04=_0x297db7?_0x1b2abf:_0x1f5ce5;if(!_0xe97e04)throw new Error(_0x2a1195(0x11a));if(_0x13d6bd){const _0x38847b=_0x1127fd?_0x2a1195(0x10c):'session\x20context';console[_0x2a1195(0x113)](_0x2a1195(0x12c)+_0x38847b+':\x20'+_0xe97e04+'/'+_0x34ab47);}const _0x317241=await withSpinner('Resolving\x20project\x20\x27'+_0xe97e04+_0x2a1195(0x100),()=>_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x108)](_0xe97e04),{'verbose':_0x13d6bd}),_0x57cb9f=await withSpinner('Resolving\x20agent\x20\x27'+_0x34ab47+'\x27...',()=>_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x128)](_0x34ab47,_0x317241[_0x2a1195(0x121)]),{'verbose':_0x13d6bd});return _0x57cb9f['data'];}else{const _0x1d429c=_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x103)]();if(_0x1d429c)return _0x13d6bd&&console[_0x2a1195(0x113)](_0x2a1195(0x102)+_0x1d429c[_0x2a1195(0xfb)]),_0x1d429c['id'];const _0x599a07=await withSpinner(_0x2a1195(0xef),()=>_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x134)](_0x2a1195(0x12e),0x0),{'verbose':_0x13d6bd});return _0x599a07[_0x2a1195(0x121)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x2db0c1(0xfb)]=a8_0x2db0c1(0x130);['description']=a8_0x2db0c1(0x11e);[a8_0x2db0c1(0xf0)](_0x271642){const _0x372763=a8_0x2db0c1,_0x3c21f6=_0x271642['args'][_0x372763(0x119)]('\x20');if(!_0x3c21f6)return _0x372763(0x112);return undefined;}async[a8_0x2db0c1(0xf6)](_0x210ee9,_0x200ce9,_0x1ea8b8,_0x14b587,_0xa725c3){const _0x574c47=a8_0x2db0c1;for await(const _0x281f2b of _0x210ee9[_0x574c47(0x136)][_0x574c47(0x130)](_0x200ce9,{'agentId':_0x1ea8b8,'chatId':_0x14b587})){if(_0x281f2b['type']==='metadata'){const _0x2ba234=_0x281f2b['data'][_0x574c47(0xf4)];saveLastChatId(_0x2ba234),_0xa725c3&&console[_0x574c47(0x113)]('Chat\x20session:\x20'+_0x2ba234);}else _0x281f2b[_0x574c47(0x11c)]===_0x574c47(0xfc)&&this[_0x574c47(0xfa)](_0x281f2b['data']);}}async['streamChatJsonl'](_0x3c0b19,_0x1508d3,_0x3f8afb,_0x48c33b){const _0x12ccb1=a8_0x2db0c1,_0x56f669=_0x3c0b19[_0x12ccb1(0x138)]['site'];let _0xb4b0cf=![];for await(const _0xb20a21 of _0x3c0b19[_0x12ccb1(0x136)][_0x12ccb1(0x130)](_0x1508d3,{'agentId':_0x3f8afb,'chatId':_0x48c33b})){if(_0xb20a21[_0x12ccb1(0x11c)]===_0x12ccb1(0x10d)){const _0x41570e=_0xb20a21['data'];saveLastChatId(_0x41570e[_0x12ccb1(0xf4)]);const _0x157cfb=_0x41570e[_0x12ccb1(0x126)]&&_0x41570e[_0x12ccb1(0x127)]?getLLMConversationUrl(_0x56f669,_0x41570e[_0x12ccb1(0x126)],_0x41570e[_0x12ccb1(0x127)],_0x41570e['chatId']):undefined;console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x10d),'data':{'chatId':_0x41570e[_0x12ccb1(0xf4)],'agentId':_0x41570e['agentId'],'consoleUrl':_0x157cfb}})),_0xb4b0cf=!![];}else{if(_0xb20a21[_0x12ccb1(0x11c)]===_0x12ccb1(0xfc)){!_0xb4b0cf&&_0x48c33b&&(console['log'](JSON[_0x12ccb1(0x115)]({'type':'metadata','data':{'chatId':_0x48c33b}})),_0xb4b0cf=!![]);const _0x8da4be=_0xb20a21[_0x12ccb1(0x121)];if('content'in _0x8da4be)console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x133),'data':{'content':_0x8da4be[_0x12ccb1(0x133)]}}));else{if(_0x12ccb1(0xf3)in _0x8da4be){const _0x578d0f=_0x8da4be[_0x12ccb1(0xf3)];console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0xf3),'data':{'id':_0x578d0f['id'],'name':_0x578d0f['functionName'],'target':_0x578d0f[_0x12ccb1(0x135)]?.[_0x12ccb1(0xfb)]||_0x578d0f[_0x12ccb1(0xfd)]?.[_0x12ccb1(0xfb)]||_0x578d0f['targetWebSearchTool']?.[_0x12ccb1(0xfb)]||_0x578d0f[_0x12ccb1(0x120)]}}));}else{if(_0x12ccb1(0x10b)in _0x8da4be)console['log'](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x101),'data':{'id':_0x8da4be[_0x12ccb1(0x10b)]['id'],'name':_0x8da4be[_0x12ccb1(0x10b)][_0x12ccb1(0x114)],'result':typeof _0x8da4be['tool'][_0x12ccb1(0x133)]===_0x12ccb1(0x123)?_0x8da4be[_0x12ccb1(0x10b)][_0x12ccb1(0x133)][_0x12ccb1(0x106)](0x0,0x1f4):''}}));else'error'in _0x8da4be&&console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x113),'data':{'error':_0x8da4be[_0x12ccb1(0x113)]}}));}}}}}console['log'](JSON[_0x12ccb1(0x115)]({'type':'done'}));}async['execute'](_0x1112f7){const _0x503021=a8_0x2db0c1,{options:_0x46df0b,args:_0xb7724d,tdx:_0x21ab73}=_0x1112f7,_0x1a566f=_0xb7724d[_0x503021(0x119)]('\x20'),_0x3ce664=_0x46df0b,_0x137df5=_0x3ce664[_0x503021(0x104)],_0x5d82d9=_0x3ce664[_0x503021(0x132)],_0xaad0fc=_0x3ce664[_0x503021(0x105)],_0x5e59ef=_0x3ce664[_0x503021(0xff)],_0x367a2b=_0x3ce664[_0x503021(0xf4)],_0x156ff5=_0x3ce664[_0x503021(0x11f)];if(_0x5e59ef&&_0x367a2b)return console[_0x503021(0x113)](_0x503021(0x13a)),0x1;try{let _0x534125,_0xc896f8;if(_0x367a2b)_0xc896f8=_0x367a2b;else!_0x5e59ef&&(_0xc896f8=loadLastChatId(),_0xc896f8&&_0x46df0b[_0x503021(0x139)]&&console[_0x503021(0x113)]('Continuing\x20chat:\x20'+_0xc896f8));!_0x367a2b&&(_0x5e59ef||!_0xc896f8)&&(_0x534125=await resolveAgentId(_0x21ab73,_0x137df5,_0x5d82d9,_0xaad0fc,_0x46df0b[_0x503021(0x139)]));const _0x143239=_0x156ff5?(_0x5dbe7e,_0x25834c,_0x3d2bca)=>this[_0x503021(0x10e)](_0x21ab73,_0x5dbe7e,_0x25834c,_0x3d2bca):(_0x1ff284,_0x931e9f,_0x1ddf3a)=>this['streamChat'](_0x21ab73,_0x1ff284,_0x931e9f,_0x1ddf3a,_0x46df0b['verbose']);try{await _0x143239(_0x1a566f,_0x534125,_0xc896f8);}catch(_0x2e0d63){const _0x1363aa=_0x2e0d63 instanceof SDKError&&_0x2e0d63[_0x503021(0xf1)]===ErrorCode[_0x503021(0x131)]||_0x2e0d63 instanceof Error&&_0x2e0d63['message'][_0x503021(0x12a)](_0x503021(0x11d));if(_0x1363aa&&_0x367a2b)return console['error']('Error:\x20Chat\x20session\x20\x27'+_0x367a2b+'\x27\x20not\x20found'),0x1;if(_0x1363aa)_0x46df0b[_0x503021(0x139)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x534125&&(_0x534125=await resolveAgentId(_0x21ab73,_0x137df5,_0x5d82d9,_0xaad0fc,_0x46df0b[_0x503021(0x139)])),await _0x143239(_0x1a566f,_0x534125,undefined);else throw _0x2e0d63;}return!_0x156ff5&&console[_0x503021(0x118)](),0x0;}catch(_0x35a3ee){return console[_0x503021(0x113)](),handleSDKError(_0x35a3ee,_0x46df0b),0x1;}}[a8_0x2db0c1(0xfa)](_0x317f36){const _0x179927=a8_0x2db0c1;if(_0x179927(0x133)in _0x317f36)process[_0x179927(0x109)][_0x179927(0xf2)](_0x317f36[_0x179927(0x133)]);else _0x179927(0x113)in _0x317f36&&console[_0x179927(0x113)]('\x0aError:\x20'+_0x317f36[_0x179927(0x113)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x2db0c1(0x10f);[a8_0x2db0c1(0x12b)]=a8_0x2db0c1(0x137);[a8_0x2db0c1(0xf0)](_0x8e03eb){const _0x10d683=a8_0x2db0c1,_0x11b31a=_0x8e03eb[_0x10d683(0x117)],_0x304b5c=_0x11b31a['agent'],_0x53d66c=_0x11b31a[_0x10d683(0x132)];if(!_0x304b5c&&!_0x53d66c)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async['execute'](_0x59e07e){const _0x5f4838=a8_0x2db0c1,{options:_0x5cd44f,tdx:_0x5408e6}=_0x59e07e,_0x98347d=_0x5cd44f,_0x428510=_0x98347d[_0x5f4838(0x104)],_0x32ffa1=_0x98347d['llmAgent'],_0x3b2ba4=_0x98347d[_0x5f4838(0x105)];try{const _0x5c6638=await resolveAgentId(_0x5408e6,_0x428510,_0x32ffa1,_0x3b2ba4,_0x5cd44f[_0x5f4838(0x139)]),_0xade4b1=await _0x5408e6[_0x5f4838(0x136)]['startChat'](_0x5c6638);return saveLastChatId(_0xade4b1['id']),console[_0x5f4838(0x118)](JSON[_0x5f4838(0x115)]({'chatId':_0xade4b1['id'],'agentId':_0x5c6638})),0x0;}catch(_0x9f44dc){return handleSDKError(_0x9f44dc,_0x5cd44f),0x1;}}}
|