@treasuredata/tdx 0.28.2 → 0.28.3
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/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/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/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/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_0x9ea54=a3_0x5e9d;(function(_0x1eb1bb,_0x2d94e3){const _0x55e8fb=a3_0x5e9d,_0x5eab7d=_0x1eb1bb();while(!![]){try{const _0x4553a6=-parseInt(_0x55e8fb(0x71))/0x1*(-parseInt(_0x55e8fb(0x84))/0x2)+-parseInt(_0x55e8fb(0x75))/0x3+parseInt(_0x55e8fb(0x70))/0x4+-parseInt(_0x55e8fb(0x78))/0x5+parseInt(_0x55e8fb(0x79))/0x6*(-parseInt(_0x55e8fb(0x87))/0x7)+parseInt(_0x55e8fb(0x88))/0x8+parseInt(_0x55e8fb(0x7c))/0x9;if(_0x4553a6===_0x2d94e3)break;else _0x5eab7d['push'](_0x5eab7d['shift']());}catch(_0x1b0ed7){_0x5eab7d['push'](_0x5eab7d['shift']());}}}(a3_0x2246,0x1d7f5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x2246(){const _0x1bc303=['Error:\x20','List\x20activations\x20for\x20a\x20segment','data','listActivations','segment','Listing\x20activations\x20for\x20segment\x20\x27','Parent\x20name:\x20','4tfutLn','cause','\x27...','7muwnkN','1200680ThIEkG','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','resolveParentId','Child\x20name:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','name','verbose','message','\x20\x20Cause:\x20','description','Site:\x20','546860mgXdCX','87251lnDTXZ','activations','error','Error:\x20Segment\x20name\x20is\x20required','683181ReHKcH','resolveSegmentId','site','1021225JgkDlh','1096770qStgiS','length','✔\x20Found\x20','2468574vcYyEj'];a3_0x2246=function(){return _0x1bc303;};return a3_0x2246();}function a3_0x5e9d(_0x6ea208,_0x33afa2){_0x6ea208=_0x6ea208-0x6d;const _0x22464c=a3_0x2246();let _0x5e9dc6=_0x22464c[_0x6ea208];return _0x5e9dc6;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x9ea54(0x8d)]=a3_0x9ea54(0x72);[a3_0x9ea54(0x6e)]=a3_0x9ea54(0x7e);async['execute'](_0x5aa5d5){const _0x232691=a3_0x9ea54,{options:_0x4d439a,args:_0x5379e5,tdx:_0x4f65fa}=_0x5aa5d5;if(_0x5379e5['length']===0x0)return console[_0x232691(0x73)](_0x232691(0x74)),console[_0x232691(0x73)](_0x232691(0x8c)),0x1;try{const {parentId:_0xb8d76f,childId:_0x19cd58}=parseSegmentRef(_0x5379e5[0x0]);if(!_0x19cd58)return console[_0x232691(0x73)](_0x232691(0x89)),console[_0x232691(0x73)](_0x232691(0x8c)),0x1;_0x4d439a[_0x232691(0x8e)]&&(console[_0x232691(0x73)](_0x232691(0x6f)+_0x4d439a[_0x232691(0x77)]),console[_0x232691(0x73)](_0x232691(0x83)+_0xb8d76f),console[_0x232691(0x73)](_0x232691(0x8b)+_0x19cd58));const _0x35aa0a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xb8d76f+_0x232691(0x86),()=>_0x4f65fa[_0x232691(0x81)][_0x232691(0x8a)](_0xb8d76f),{'verbose':_0x4d439a[_0x232691(0x8e)]}),_0xb7f8f8=_0x35aa0a[_0x232691(0x7f)];_0x4d439a[_0x232691(0x8e)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0xb7f8f8);const _0x13b6c8=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x19cd58+_0x232691(0x86),()=>_0x4f65fa[_0x232691(0x81)][_0x232691(0x76)](_0xb7f8f8,_0x19cd58),{'verbose':_0x4d439a[_0x232691(0x8e)]}),_0x9fc9be=_0x13b6c8[_0x232691(0x7f)];_0x4d439a['verbose']&&console[_0x232691(0x73)]('Resolved\x20child\x20ID:\x20'+_0x9fc9be);const _0x1ee4da=await withSpinner(_0x232691(0x82)+_0x19cd58+'\x27...',()=>_0x4f65fa[_0x232691(0x81)][_0x232691(0x80)](_0xb7f8f8,_0x9fc9be),{'verbose':_0x4d439a[_0x232691(0x8e)]}),_0x1261c6=_0x1ee4da['data'];return console['error'](_0x232691(0x7b)+_0x1261c6[_0x232691(0x7a)]+'\x20activation'+(_0x1261c6[_0x232691(0x7a)]!==0x1?'s':'')),await handleSDKOutput(_0x1261c6,_0x4d439a),0x0;}catch(_0x4e5a64){if(_0x4e5a64 instanceof SDKError)return console[_0x232691(0x73)](_0x232691(0x7d)+_0x4e5a64[_0x232691(0x8f)]),_0x4e5a64[_0x232691(0x85)]&&console[_0x232691(0x73)](_0x232691(0x6d)+_0x4e5a64[_0x232691(0x85)]),0x1;throw _0x4e5a64;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x5e331e=a4_0x4ea7;(function(_0x17fab6,_0x45f891){const _0x35a218=a4_0x4ea7,_0x33c602=_0x17fab6();while(!![]){try{const _0x1a4069=parseInt(_0x35a218(0x172))/0x1*(-parseInt(_0x35a218(0x13e))/0x2)+-parseInt(_0x35a218(0x18b))/0x3*(parseInt(_0x35a218(0x1a2))/0x4)+parseInt(_0x35a218(0x194))/0x5*(-parseInt(_0x35a218(0x133))/0x6)+-parseInt(_0x35a218(0x171))/0x7*(parseInt(_0x35a218(0x199))/0x8)+-parseInt(_0x35a218(0x112))/0x9+parseInt(_0x35a218(0x1ab))/0xa+-parseInt(_0x35a218(0x1a7))/0xb*(-parseInt(_0x35a218(0x16a))/0xc);if(_0x1a4069===_0x45f891)break;else _0x33c602['push'](_0x33c602['shift']());}catch(_0x1b3ce5){_0x33c602['push'](_0x33c602['shift']());}}}(a4_0x24d1,0xcbfc1));import a4_0x1aedd1 from'chalk';import a4_0x2fba22 from'path';import{existsSync,readFileSync}from'fs';function a4_0x24d1(){const _0x132479=['\x20--name\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','agentId','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Cancelled','site','103070MtoiHo','Status:\x20','total','New\x20project:\x20','isNew','654232vuqifn','\x22...','\x0aProject\x20pushed\x20with\x20errors','Source:\x20','textKnowledgeBases','agent','Using\x20current\x20project:\x20','red','\x20\x20Knowledge\x20Bases:\x20','92uPphQm','Agent:\x20','cyan','agent:clone','Project:\x20','8195uNQwEj','profile','Summary:','outputPath','5161210RkGWlA','pullAgent','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','projectName','\x22\x20to\x20\x22','yellow','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','repeat','new','parse','prompts','\x20resources\x20to\x20\x27','source','dryRun','green','push','Pushing\x20to\x20project...','Pulling\x20agent\x20\x22','\x0aErrors\x20found:','cwd','output','found','session','agentName','\x20\x20tdx\x20agent\x20clone\x20agents/','force','log','Errors:','\x0aWrite\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20new','2150271JygmNe','\x22:\x20','no_context','\x20\x20Integration\x20\x22','\x20created','\x20|\x20','Project\x20cloned\x20successfully','agents','llmProject','Would\x20push\x20agent:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','-\x20nothing\x20pushed','Dry\x20run\x20-\x20no\x20files\x20written','\x20files\x20to\x20','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Agents:\x20','context','Agent\x20','\x20\x20Target:\x20','INVALID_ARGUMENT','unchanged','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Failed\x20to\x20push\x20agent:\x20','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Analyzing\x20changes\x20to\x20push...','\x20successfully','\x20\x20Text\x20Knowledge\x20Base\x20\x22','dim','\x20changed','arg-dir','66ZRqPYj','\x20\x20tdx\x20agent\x20pull\x20','experimentalArtifacts','integrations','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Using\x20project\x20from\x20context:\x20','\x20=\x20','\x20total','projectDir','\x22\x20to\x20new\x20project\x20\x22','✔\x20Context\x20set:\x20','10nJDKvV','name','no_local_folder','\x22\x20from\x20project\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20agent\x20\x27','action','\x0aError:','Dry\x20run\x20-\x20no\x20changes\x20made','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','error','\x20\x20Agent\x20\x22','Writing\x20files...','execute','newProjectName','diff','\x0aChanges\x20to\x20integration\x20\x27','\x20resources?','llm','errors','Using\x20context\x20project:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','pushAgent','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Chat:\x20','cwd-config','\x0aChanges:','description','Output:\x20','Using\x20project:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','pullProject','cloneProject','\x20unchanged','join','Agent\x20pulled\x20successfully','knowledgeBases','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','newProjectId','hasChanges','\x0aPush\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\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)','75300BJDLtV','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Prompt\x20\x22','Output\x20path:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aChanges\x20to\x20prompt\x20\x27','tdx.json','133vlXMEB','234178ldzUFr','Pushing\x20agent\x20from\x20\x22','yes','experimentalKnowledgeBases','reason','utf-8','Analyzing\x20project\x20\x22','llm_project','\x20\x20Prompts:\x20','pushProject','projectId','<new-name>','dirname','\x20\x20Integrations:\x20','message','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','counts','No\x20tdx.json\x20found\x20in\x20','-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputDir','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Base\x20\x22','151971lIpxYZ','sourceProjectName'];a4_0x24d1=function(){return _0x132479;};return a4_0x24d1();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x4ea7(_0x13c9ed,_0x29c767){_0x13c9ed=_0x13c9ed-0x109;const _0x24d1ca=a4_0x24d1();let _0x4ea73a=_0x24d1ca[_0x13c9ed];return _0x4ea73a;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x42c839){const _0xf7201=a4_0x4ea7,_0x4c6dc1=[];if(_0x42c839[_0xf7201(0x196)]!==undefined)_0x4c6dc1[_0xf7201(0x1bc)](_0x42c839[_0xf7201(0x196)]+_0xf7201(0x13a));if(_0x42c839['new']!==undefined&&_0x42c839['new']>0x0)_0x4c6dc1['push'](a4_0x1aedd1['green'](_0x42c839[_0xf7201(0x1b5)]+_0xf7201(0x111)));if(_0x42c839['created']!==undefined&&_0x42c839[_0xf7201(0x12b)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1['green'](_0x42c839['created']+_0xf7201(0x116)));if(_0x42c839['updated']!==undefined&&_0x42c839[_0xf7201(0x120)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1[_0xf7201(0x1b0)](_0x42c839[_0xf7201(0x120)]+'\x20updated'));if(_0x42c839[_0xf7201(0x127)]!==undefined&&_0x42c839[_0xf7201(0x127)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1['gray'](_0x42c839[_0xf7201(0x127)]+'\x20unchanged'));if(_0x42c839[_0xf7201(0x152)]!==undefined&&_0x42c839['errors']>0x0)_0x4c6dc1['push'](a4_0x1aedd1['red'](_0x42c839[_0xf7201(0x152)]+'\x20errors'));return _0x4c6dc1[_0xf7201(0x161)](',\x20');}function displayDiffs(_0x25d2e6,_0x4e483c,_0x3b8502,_0x56e8ea,_0x5b012f,_0x45dfff,_0x208a65){const _0x29dc06=a4_0x4ea7;for(const _0x5ea96b of _0x25d2e6){if(_0x5ea96b[_0x29dc06(0x14e)]){const _0x29bf1a=_0x5ea96b['agentName']||_0x5ea96b[_0x29dc06(0x13f)];console['log'](_0x29dc06(0x143)+_0x29bf1a+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x5ea96b['diff']),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c));}}for(const _0x52cc86 of _0x4e483c){_0x52cc86[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x188)+_0x52cc86['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x52cc86[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)));}for(const _0x2e38b8 of _0x3b8502){_0x2e38b8['diff']&&(console[_0x29dc06(0x10d)](_0x29dc06(0x154)+_0x2e38b8['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x2e38b8[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x27cefa of _0x56e8ea){_0x27cefa[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x16f)+_0x27cefa[_0x29dc06(0x13f)]+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x27cefa[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x8537f7 of _0x5b012f){_0x8537f7[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x14f)+_0x8537f7['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x8537f7['diff']),console['log']('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x57cf97 of _0x45dfff){_0x57cf97['diff']&&(console[_0x29dc06(0x10d)](_0x29dc06(0x15d)+_0x57cf97[_0x29dc06(0x13f)]+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x57cf97[_0x29dc06(0x14e)]),console['log']('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x37e6b8 of _0x208a65){_0x37e6b8[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x37e6b8['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x37e6b8[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x5e331e(0x15a)]=a4_0x5e331e(0x16e);async[a4_0x5e331e(0x14c)](_0x379eec){const _0x3b39b8=a4_0x5e331e,{options:_0x4c732f,args:_0x3e93ce,tdx:_0x361e69}=_0x379eec,_0x299b96=_0x3e93ce[0x0],_0x143815=_0x3e93ce[0x1],_0x23f3fd=_0x4c732f[_0x3b39b8(0x1c1)],_0x4c989d=_0x4c732f['dryRun'],_0xe37ca6=_0x4c732f[_0x3b39b8(0x10c)],_0x4567e4=_0x4c732f['yes'],_0x14313d=_0x4c732f['llmProject'],_0x23d825=_0x4c732f[_0x3b39b8(0x19e)];let _0x2274fd;if(_0x299b96){const _0x43e48c=a4_0x2fba22[_0x3b39b8(0x161)](_0x299b96,'tdx.json');if(existsSync(_0x43e48c))try{const _0x299081=JSON[_0x3b39b8(0x1b6)](readFileSync(_0x43e48c,_0x3b39b8(0x177)));_0x299081[_0x3b39b8(0x179)]&&(_0x2274fd={'llm_project':_0x299081[_0x3b39b8(0x179)]});}catch{}}const _0x2c7bd8=findAgentConfigPath(process['cwd']());let _0x30fadd;if(_0x2c7bd8)try{const _0x1385f1=JSON['parse'](readFileSync(_0x2c7bd8,_0x3b39b8(0x177)));_0x1385f1[_0x3b39b8(0x179)]&&(_0x30fadd={'llm_project':_0x1385f1['llm_project']});}catch{}const _0x2668bc=resolveAgentPullArgs({'arg':_0x299b96,'agentNameArg':_0x143815,'agentFlag':_0x23d825,'contextProject':_0x14313d,'argDirConfig':_0x2274fd,'cwdConfigPath':_0x2c7bd8||undefined,'cwdConfig':_0x30fadd}),{projectNameOrId:_0x487e67,targetAgentName:_0x2a4d4c,existingOutputDir:_0x207665,source:_0xbdf84b}=_0x2668bc;if(_0xbdf84b===_0x3b39b8(0x132))console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)]('Using\x20project\x20from\x20'+a4_0x2fba22[_0x3b39b8(0x161)](_0x299b96,_0x3b39b8(0x170))+':\x20'+_0x487e67));else{if(_0xbdf84b===_0x3b39b8(0x158))console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)]('Using\x20project:\x20'+_0x487e67));else _0xbdf84b===_0x3b39b8(0x123)&&console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x138)+_0x487e67));}if(!_0x487e67)return _0x23d825?(console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x3b39b8(0x10d)](_0x3b39b8(0x16b)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x11c))):(console['log'](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x137))),console[_0x3b39b8(0x10d)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1ad)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x18e)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x164)),console[_0x3b39b8(0x10d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x2a4d4c){const {data:_0x282b04}=await withSpinner(_0x3b39b8(0x1be)+_0x2a4d4c+_0x3b39b8(0x141)+_0x487e67+_0x3b39b8(0x19a),()=>_0x361e69[_0x3b39b8(0x151)][_0x3b39b8(0x1ac)](_0x487e67,_0x2a4d4c,_0x23f3fd,{'dryRun':_0x4c989d,'force':_0xe37ca6}));if(_0x4c989d)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x11e))),console['log'](_0x3b39b8(0x187)+_0x282b04['agentName']),console[_0x3b39b8(0x10d)](_0x3b39b8(0x16d)+_0x282b04[_0x3b39b8(0x1aa)]),_0x282b04[_0x3b39b8(0x14e)]&&(console[_0x3b39b8(0x10d)](_0x3b39b8(0x159)),console['log']('─'[_0x3b39b8(0x1b4)](0x3c)),console['log'](_0x282b04[_0x3b39b8(0x14e)]),console[_0x3b39b8(0x10d)]('─'[_0x3b39b8(0x1b4)](0x3c))),0x0;return console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x162))),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1a3)+_0x282b04[_0x3b39b8(0x10a)]),console[_0x3b39b8(0x10d)](_0x3b39b8(0x15b)+_0x282b04[_0x3b39b8(0x1aa)]),console[_0x3b39b8(0x10d)](_0x3b39b8(0x195)+(_0x282b04[_0x3b39b8(0x198)]?a4_0x1aedd1['green'](_0x3b39b8(0x1b5)):_0x282b04[_0x3b39b8(0x166)]?a4_0x1aedd1['yellow'](_0x3b39b8(0x120)):a4_0x1aedd1[_0x3b39b8(0x147)](_0x3b39b8(0x127)))),0x0;}const _0x16f5ca=_0x207665||_0x23f3fd,{data:_0x5aceb8}=await withSpinner(_0x3b39b8(0x178)+_0x487e67+_0x3b39b8(0x19a),()=>_0x361e69['llm'][_0x3b39b8(0x15e)](_0x487e67,_0x16f5ca,{'dryRun':!![]})),_0x5545ff=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)]['textKnowledgeBases'][_0x3b39b8(0x1b5)]+_0x5aceb8['counts'][_0x3b39b8(0x1b7)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)]['integrations'][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)]['new']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x1b5)],_0x826ee8=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)]['updated']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)][_0x3b39b8(0x120)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)]['updated']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x1b7)][_0x3b39b8(0x120)]+_0x5aceb8['counts'][_0x3b39b8(0x136)][_0x3b39b8(0x120)]+_0x5aceb8['counts'][_0x3b39b8(0x175)][_0x3b39b8(0x120)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x120)],_0x408c2f=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x1b7)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x136)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x127)];console[_0x3b39b8(0x10d)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5aceb8[_0x3b39b8(0x1ae)]+'\x27:'),console[_0x3b39b8(0x10d)]('\x20\x20'+a4_0x1aedd1['green']('+\x20'+_0x5545ff+'\x20new')+_0x3b39b8(0x117)+a4_0x1aedd1['yellow']('~\x20'+_0x826ee8+_0x3b39b8(0x131))+_0x3b39b8(0x117)+a4_0x1aedd1[_0x3b39b8(0x130)]('=\x20'+_0x408c2f+_0x3b39b8(0x160))),console[_0x3b39b8(0x10d)](_0x3b39b8(0x122)+formatCountSummary(_0x5aceb8['counts'][_0x3b39b8(0x119)])),console['log'](_0x3b39b8(0x1a1)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1b3)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x17a)+formatCountSummary(_0x5aceb8['counts'][_0x3b39b8(0x1b7)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x17f)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x136)]));const _0x395c77=_0x5aceb8['counts'][_0x3b39b8(0x175)]['total']>0x0||_0x5aceb8['counts'][_0x3b39b8(0x135)]['total']>0x0;_0x395c77&&(console[_0x3b39b8(0x10d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x189)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)])));console[_0x3b39b8(0x10d)](_0x3b39b8(0x125)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x5aceb8[_0x3b39b8(0x186)])),displayDiffs(_0x5aceb8[_0x3b39b8(0x119)],_0x5aceb8[_0x3b39b8(0x163)],_0x5aceb8['textKnowledgeBases'],_0x5aceb8[_0x3b39b8(0x1b7)],_0x5aceb8[_0x3b39b8(0x136)],_0x5aceb8[_0x3b39b8(0x175)],_0x5aceb8[_0x3b39b8(0x135)]);if(_0x4c989d)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x12c))),0x0;if(_0x5545ff===0x0&&_0x826ee8===0x0)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1bb)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x5aceb8[_0x3b39b8(0x1ae)]},_0x4c732f[_0x3b39b8(0x109)]),console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x13d)+a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x179))+_0x3b39b8(0x139)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x5aceb8[_0x3b39b8(0x1ae)]))),0x0;if(!_0x4567e4&&!_0xe37ca6){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x3b39b8(0x1a0)](_0x3b39b8(0x145)),_0x3b39b8(0x121)),console[_0x3b39b8(0x149)](a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x129))),0x1;const _0x379c1b=await confirmKey(_0x3b39b8(0x10f)+(_0x5545ff+_0x826ee8)+'\x20files?');if(!_0x379c1b)return console[_0x3b39b8(0x10d)](a4_0x1aedd1['yellow'](_0x3b39b8(0x192)),_0x3b39b8(0x184)),0x1;}const {data:_0x39eb83}=await withSpinner(_0x3b39b8(0x14b),()=>_0x361e69[_0x3b39b8(0x151)][_0x3b39b8(0x15e)](_0x487e67,_0x16f5ca,{'force':_0xe37ca6}));return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1bb)]('\x0a✔\x20Pulled\x20'+(_0x5545ff+_0x826ee8)+_0x3b39b8(0x11f)+_0x39eb83[_0x3b39b8(0x186)])),saveSessionContext({'llm_project':_0x39eb83[_0x3b39b8(0x1ae)]},_0x4c732f['session']),console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x13d)+a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x179))+_0x3b39b8(0x139)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x39eb83[_0x3b39b8(0x1ae)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5e331e(0x13f)]=a4_0x5e331e(0x1a5);[a4_0x5e331e(0x15a)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x5e331e(0x14c)](_0x5062c3){const _0x4b8cd4=a4_0x5e331e,{options:_0x7467a6,args:_0x349c7f,tdx:_0x2e03b5}=_0x5062c3,_0xde1a5a=_0x349c7f[0x0],_0xe0262a=_0x7467a6[_0x4b8cd4(0x13f)],_0xf80e30=_0x7467a6[_0x4b8cd4(0x1ba)],_0x3f8853=_0x7467a6['yes'],_0x449e66=_0x7467a6['site'],_0x1ad36f=_0x7467a6[_0x4b8cd4(0x11a)];let _0x3a9310;const _0x5d44c7=findAgentConfigPath(process[_0x4b8cd4(0x1c0)]());if(_0xde1a5a){const _0x18cc38=a4_0x2fba22[_0x4b8cd4(0x161)](_0xde1a5a,_0x4b8cd4(0x170));existsSync(_0x18cc38)?(_0x3a9310=_0xde1a5a,console['log'](a4_0x1aedd1['dim']('Using\x20local\x20project:\x20'+_0xde1a5a))):_0x3a9310=_0xde1a5a;}else{if(_0x5d44c7)_0x3a9310=a4_0x2fba22['dirname'](_0x5d44c7),console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim'](_0x4b8cd4(0x19f)+_0x3a9310));else{if(_0x1ad36f){const _0xca969d=sanitizeForFilesystem(_0x1ad36f);let _0x949de2=_0xca969d,_0x42c427=a4_0x2fba22[_0x4b8cd4(0x161)](process[_0x4b8cd4(0x1c0)](),_0x4b8cd4(0x119),_0xca969d,_0x4b8cd4(0x170));if(!existsSync(_0x42c427)){const _0x4d1cac=normalizeName(_0x1ad36f),_0x31e1bf=a4_0x2fba22['join'](process[_0x4b8cd4(0x1c0)](),_0x4b8cd4(0x119),_0x4d1cac,_0x4b8cd4(0x170));existsSync(_0x31e1bf)&&(_0x949de2=_0x4d1cac,_0x42c427=_0x31e1bf);}if(existsSync(_0x42c427))_0x3a9310=a4_0x2fba22[_0x4b8cd4(0x17e)](_0x42c427),console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim']('Using\x20local\x20project:\x20'+_0x3a9310));else{const _0x5df09d=_0x7467a6[_0x4b8cd4(0x1a8)];if(_0x5df09d)throw new SDKError(ErrorCode[_0x4b8cd4(0x126)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x1ad36f+_0x4b8cd4(0x1b1),undefined,{'helpText':_0x4b8cd4(0x110)+_0x4b8cd4(0x128)+(_0x4b8cd4(0x134)+_0x1ad36f+'\x0a')+(_0x4b8cd4(0x10b)+_0x949de2+_0x4b8cd4(0x18d)+(_0xe0262a||_0x4b8cd4(0x17d))+'\x20--profile\x20'+_0x5df09d)});_0x3a9310=_0x1ad36f,console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim'](_0x4b8cd4(0x153)+_0x1ad36f));}}}}if(!_0x3a9310)return console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1b0)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x4b8cd4(0x191)),console[_0x4b8cd4(0x10d)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x4b8cd4(0x169)),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x190)),0x1;if(!_0xe0262a)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x3f8853&&!_0xf80e30){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x0aError:'),_0x4b8cd4(0x121)),console['error'](a4_0x1aedd1[_0x4b8cd4(0x130)](_0x4b8cd4(0x129))),0x1;const _0x510ba5=await confirmKey('Clone\x20\x22'+_0x3a9310+_0x4b8cd4(0x13c)+_0xe0262a+'\x22?');if(!_0x510ba5)return console['log'](a4_0x1aedd1['yellow'](_0x4b8cd4(0x192))),0x1;}const {data:_0x278aad}=await withSpinner('Cloning\x20\x22'+_0x3a9310+_0x4b8cd4(0x1af)+_0xe0262a+_0x4b8cd4(0x19a),()=>_0x2e03b5[_0x4b8cd4(0x151)][_0x4b8cd4(0x15f)](_0x3a9310,_0xe0262a,{'dryRun':_0xf80e30}));if(_0xf80e30){console['log'](a4_0x1aedd1['yellow'](_0x4b8cd4(0x146))),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x19c)+_0x278aad[_0x4b8cd4(0x18c)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x197)+_0xe0262a),console[_0x4b8cd4(0x10d)]('Would\x20clone:'),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x122)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)]('\x20\x20Knowledge\x20Bases:\x20'+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x163)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x17a)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)][_0x4b8cd4(0x12b)]);const _0x2f257a=_0x278aad['counts']['experimentalKnowledgeBases'][_0x4b8cd4(0x12b)]>0x0||_0x278aad[_0x4b8cd4(0x182)]['experimentalArtifacts']['created']>0x0;return _0x2f257a&&(console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x185)+_0x278aad['counts'][_0x4b8cd4(0x175)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x189)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)][_0x4b8cd4(0x12b)])),0x0;}const _0x488e73=_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x163)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)]['errors']>0x0;_0x488e73?console[_0x4b8cd4(0x10d)](a4_0x1aedd1['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1bb)](_0x4b8cd4(0x118)));console[_0x4b8cd4(0x10d)]('Source:\x20'+_0x278aad[_0x4b8cd4(0x18c)]),console['log'](_0x4b8cd4(0x197)+_0x278aad[_0x4b8cd4(0x14d)]),console[_0x4b8cd4(0x10d)]('New\x20project\x20ID:\x20'+_0x278aad['newProjectId']),console[_0x4b8cd4(0x10d)](),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x1a9)),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x122)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)])),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x1a1)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x163)])),console['log'](_0x4b8cd4(0x17a)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)])),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x17f)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x136)]));const _0xe54f1c=_0x278aad['counts'][_0x4b8cd4(0x175)][_0x4b8cd4(0x12b)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x120)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x127)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)]['created']>0x0||_0x278aad['counts'][_0x4b8cd4(0x135)]['updated']>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)][_0x4b8cd4(0x127)]>0x0;_0xe54f1c&&(console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x185)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x175)])),console['log'](_0x4b8cd4(0x189)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)]['experimentalArtifacts'])));if(_0x488e73){console[_0x4b8cd4(0x10d)](),console['log'](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('Errors:'));for(const _0x3b50e4 of _0x278aad['agents']){_0x3b50e4[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x14a)+_0x3b50e4[_0x4b8cd4(0x10a)]+_0x4b8cd4(0x113)+_0x3b50e4[_0x4b8cd4(0x149)]));}for(const _0x36b563 of _0x278aad[_0x4b8cd4(0x163)]){_0x36b563[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x18a)+_0x36b563[_0x4b8cd4(0x13f)]+_0x4b8cd4(0x113)+_0x36b563['error']));}for(const _0x1fdb4d of _0x278aad[_0x4b8cd4(0x1b7)]){_0x1fdb4d[_0x4b8cd4(0x144)]==='error'&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x16c)+_0x1fdb4d['name']+'\x22:\x20'+_0x1fdb4d[_0x4b8cd4(0x149)]));}for(const _0x4c2227 of _0x278aad[_0x4b8cd4(0x136)]){_0x4c2227['action']==='error'&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x20\x20Integration\x20\x22'+_0x4c2227[_0x4b8cd4(0x13f)]+'\x22:\x20'+_0x4c2227[_0x4b8cd4(0x149)]));}for(const _0x4b70a4 of _0x278aad[_0x4b8cd4(0x175)]){_0x4b70a4[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1['red'](_0x4b8cd4(0x1b2)+_0x4b70a4['name']+_0x4b8cd4(0x113)+_0x4b70a4[_0x4b8cd4(0x149)]));}for(const _0x3e565f of _0x278aad[_0x4b8cd4(0x135)]){_0x3e565f[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3e565f[_0x4b8cd4(0x13f)]+_0x4b8cd4(0x113)+_0x3e565f[_0x4b8cd4(0x149)]));}return 0x1;}console['log']();const _0x548a42=getLLMProjectUrl(_0x449e66,_0x278aad[_0x4b8cd4(0x165)]);return console['log'](_0x4b8cd4(0x1a6)+a4_0x1aedd1[_0x4b8cd4(0x1a4)](_0x548a42)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5e331e(0x13f)]='agent:push';[a4_0x5e331e(0x15a)]=a4_0x5e331e(0x156);async[a4_0x5e331e(0x14c)](_0x5083d8){const _0x4f1c26=a4_0x5e331e,{options:_0x493b0c,args:_0x203ada,tdx:_0x3ee319}=_0x5083d8;let _0x8949db=_0x203ada[0x0]||process[_0x4f1c26(0x1c0)]();const _0x48027d=_0x493b0c[_0x4f1c26(0x1ba)],_0x1ac105=_0x493b0c[_0x4f1c26(0x10c)],_0x4bc10d=_0x493b0c[_0x4f1c26(0x174)],_0x2d98f2=_0x493b0c[_0x4f1c26(0x193)],_0x36dbc2=a4_0x2fba22['join'](_0x8949db,'agent.yml'),_0x3dde9c=existsSync(_0x36dbc2);if(_0x3dde9c){const {data:_0x40ea65}=await withSpinner(_0x4f1c26(0x173)+_0x8949db+_0x4f1c26(0x19a),()=>_0x3ee319[_0x4f1c26(0x151)][_0x4f1c26(0x155)](_0x8949db,{'dryRun':_0x48027d,'force':_0x1ac105}));if(_0x48027d)return console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1b0)](_0x4f1c26(0x146))),console[_0x4f1c26(0x10d)](_0x4f1c26(0x11b)+_0x40ea65[_0x4f1c26(0x10a)]),0x0;if(_0x40ea65[_0x4f1c26(0x144)]===_0x4f1c26(0x149))return console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x12a)+_0x40ea65[_0x4f1c26(0x149)])),0x1;console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1bb)](_0x4f1c26(0x124)+_0x40ea65[_0x4f1c26(0x144)]+_0x4f1c26(0x12e))),console[_0x4f1c26(0x10d)]('Agent:\x20'+_0x40ea65[_0x4f1c26(0x10a)]);if(_0x40ea65[_0x4f1c26(0x18f)]&&_0x40ea65[_0x4f1c26(0x17c)]){const _0x251773=getLLMAgentChatUrl(_0x2d98f2,_0x40ea65[_0x4f1c26(0x17c)],_0x40ea65['agentId']);console[_0x4f1c26(0x10d)](_0x4f1c26(0x157)+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x251773));}return 0x0;}const _0x5e012d=_0x493b0c[_0x4f1c26(0x11a)],_0x58f0b0=resolveProjectFromContext(_0x8949db,_0x5e012d);if(_0x58f0b0[_0x4f1c26(0x1c2)])_0x8949db=_0x58f0b0[_0x4f1c26(0x13b)],_0x58f0b0[_0x4f1c26(0x1b9)]===_0x4f1c26(0x123)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x130)](_0x4f1c26(0x15c)+_0x8949db));else{let _0x58f515=_0x4f1c26(0x168);_0x58f0b0['reason']===_0x4f1c26(0x140)&&(_0x58f515=_0x58f0b0[_0x4f1c26(0x180)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x58f0b0['llmProject']+_0x4f1c26(0x148));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x58f0b0[_0x4f1c26(0x176)]===_0x4f1c26(0x114)?_0x58f0b0[_0x4f1c26(0x180)]:_0x4f1c26(0x183)+_0x8949db,undefined,{'helpText':_0x58f515});}const {data:_0x53d400}=await withSpinner(_0x4f1c26(0x12d),()=>_0x3ee319[_0x4f1c26(0x151)][_0x4f1c26(0x17b)](_0x8949db,{'dryRun':!![]})),_0x4f2123=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)][_0x4f1c26(0x152)]>0x0;if(_0x4f2123){console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x1bf)));for(const _0x4ef222 of _0x53d400[_0x4f1c26(0x119)]){_0x4ef222[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x14a)+_0x4ef222[_0x4f1c26(0x10a)]+_0x4f1c26(0x113)+_0x4ef222[_0x4f1c26(0x149)]));}return 0x1;}const _0x5c7b6d=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)][_0x4f1c26(0x12b)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x19d)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x136)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)]['created']+_0x53d400[_0x4f1c26(0x182)]['experimentalArtifacts'][_0x4f1c26(0x12b)],_0x2ac15c=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)]['updated']+_0x53d400[_0x4f1c26(0x182)]['textKnowledgeBases'][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)][_0x4f1c26(0x120)]+_0x53d400['counts']['integrations'][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)]['experimentalKnowledgeBases']['updated']+_0x53d400['counts']['experimentalArtifacts'][_0x4f1c26(0x120)],_0x88d0f1=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)]['unchanged']+_0x53d400[_0x4f1c26(0x182)]['knowledgeBases'][_0x4f1c26(0x127)]+_0x53d400['counts']['textKnowledgeBases'][_0x4f1c26(0x127)]+_0x53d400[_0x4f1c26(0x182)]['prompts'][_0x4f1c26(0x127)]+_0x53d400[_0x4f1c26(0x182)]['integrations']['unchanged']+_0x53d400['counts'][_0x4f1c26(0x175)][_0x4f1c26(0x127)]+_0x53d400['counts']['experimentalArtifacts'][_0x4f1c26(0x127)];console['log'](_0x4f1c26(0x142)+_0x53d400[_0x4f1c26(0x1ae)]+'\x27:'),console['log']('\x20\x20'+a4_0x1aedd1['green']('+\x20'+_0x5c7b6d+_0x4f1c26(0x111))+_0x4f1c26(0x117)+a4_0x1aedd1[_0x4f1c26(0x1b0)]('~\x20'+_0x2ac15c+'\x20changed')+_0x4f1c26(0x117)+a4_0x1aedd1['dim']('=\x20'+_0x88d0f1+_0x4f1c26(0x160))),console[_0x4f1c26(0x10d)](_0x4f1c26(0x122)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)]['agents'])),console[_0x4f1c26(0x10d)](_0x4f1c26(0x1a1)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)])),console[_0x4f1c26(0x10d)](_0x4f1c26(0x1b3)+formatCountSummary(_0x53d400['counts'][_0x4f1c26(0x19d)])),console[_0x4f1c26(0x10d)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x136)]));const _0x391ef0=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)][_0x4f1c26(0x12b)]>0x0||_0x53d400['counts'][_0x4f1c26(0x175)][_0x4f1c26(0x120)]>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)]['unchanged']>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)][_0x4f1c26(0x12b)]>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)]['updated']>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)][_0x4f1c26(0x127)]>0x0;_0x391ef0&&(console[_0x4f1c26(0x10d)](_0x4f1c26(0x185)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)]['experimentalKnowledgeBases'])),console['log'](_0x4f1c26(0x189)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)])));console[_0x4f1c26(0x10d)]('\x20\x20Source:\x20'+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x8949db)),displayDiffs(_0x53d400[_0x4f1c26(0x119)],_0x53d400[_0x4f1c26(0x163)],_0x53d400[_0x4f1c26(0x19d)],_0x53d400['prompts'],_0x53d400[_0x4f1c26(0x136)],_0x53d400[_0x4f1c26(0x175)],_0x53d400[_0x4f1c26(0x135)]);if(_0x48027d)return console['log'](a4_0x1aedd1[_0x4f1c26(0x1b0)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x5c7b6d===0x0&&_0x2ac15c===0x0){console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1bb)](_0x4f1c26(0x181)));const _0x29dc5c=getLLMProjectUrl(_0x2d98f2,_0x53d400['projectId']);return console['log']('Project:\x20'+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x29dc5c)),0x0;}if(!_0x4bc10d&&!_0x1ac105){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x145)),_0x4f1c26(0x121)),console[_0x4f1c26(0x149)](a4_0x1aedd1[_0x4f1c26(0x130)](_0x4f1c26(0x129))),0x1;const _0x17b4b2=await confirmKey(_0x4f1c26(0x167)+(_0x5c7b6d+_0x2ac15c)+_0x4f1c26(0x150));if(!_0x17b4b2)return console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1b0)]('Cancelled'),_0x4f1c26(0x11d)),0x1;}const {data:_0x3d5c4f}=await withSpinner(_0x4f1c26(0x1bd),()=>_0x3ee319['llm'][_0x4f1c26(0x17b)](_0x8949db,{'force':_0x1ac105})),_0x4129e8=_0x3d5c4f['counts'][_0x4f1c26(0x119)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f[_0x4f1c26(0x182)][_0x4f1c26(0x163)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f['counts'][_0x4f1c26(0x19d)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f[_0x4f1c26(0x182)]['prompts'][_0x4f1c26(0x152)]>0x0;if(_0x4129e8){console['log'](a4_0x1aedd1['yellow'](_0x4f1c26(0x19b))),console[_0x4f1c26(0x10d)](),console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x10e)));for(const _0x385e47 of _0x3d5c4f['agents']){_0x385e47[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x14a)+_0x385e47[_0x4f1c26(0x10a)]+_0x4f1c26(0x113)+_0x385e47[_0x4f1c26(0x149)]));}for(const _0x572f3a of _0x3d5c4f['knowledgeBases']){_0x572f3a['action']==='error'&&console['log'](a4_0x1aedd1['red'](_0x4f1c26(0x18a)+_0x572f3a['name']+'\x22:\x20'+_0x572f3a[_0x4f1c26(0x149)]));}for(const _0x41343b of _0x3d5c4f['textKnowledgeBases']){_0x41343b[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x12f)+_0x41343b[_0x4f1c26(0x13f)]+_0x4f1c26(0x113)+_0x41343b['error']));}for(const _0x28c3eb of _0x3d5c4f[_0x4f1c26(0x1b7)]){_0x28c3eb[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console['log'](a4_0x1aedd1['red']('\x20\x20Prompt\x20\x22'+_0x28c3eb[_0x4f1c26(0x13f)]+'\x22:\x20'+_0x28c3eb[_0x4f1c26(0x149)]));}for(const _0x2b0b58 of _0x3d5c4f['integrations']){_0x2b0b58[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1['red'](_0x4f1c26(0x115)+_0x2b0b58[_0x4f1c26(0x13f)]+_0x4f1c26(0x113)+_0x2b0b58['error']));}return 0x1;}console['log'](a4_0x1aedd1[_0x4f1c26(0x1bb)]('\x0a✔\x20Pushed\x20'+(_0x5c7b6d+_0x2ac15c)+_0x4f1c26(0x1b8)+_0x3d5c4f['projectName']+'\x27'));const _0x53aaaa=getLLMProjectUrl(_0x2d98f2,_0x3d5c4f[_0x4f1c26(0x17c)]);return console[_0x4f1c26(0x10d)](_0x4f1c26(0x1a6)+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x53aaaa)),0x0;}}
|
|
1
|
+
const a4_0x4ce58a=a4_0x5ca6;(function(_0x3a7d8a,_0xf50d09){const _0x7ae177=a4_0x5ca6,_0x3566fa=_0x3a7d8a();while(!![]){try{const _0x4c22e8=-parseInt(_0x7ae177(0x217))/0x1*(-parseInt(_0x7ae177(0x23b))/0x2)+-parseInt(_0x7ae177(0x214))/0x3*(-parseInt(_0x7ae177(0x25d))/0x4)+parseInt(_0x7ae177(0x246))/0x5+parseInt(_0x7ae177(0x21b))/0x6*(parseInt(_0x7ae177(0x235))/0x7)+parseInt(_0x7ae177(0x286))/0x8+-parseInt(_0x7ae177(0x21e))/0x9+-parseInt(_0x7ae177(0x20c))/0xa*(parseInt(_0x7ae177(0x270))/0xb);if(_0x4c22e8===_0xf50d09)break;else _0x3566fa['push'](_0x3566fa['shift']());}catch(_0x154910){_0x3566fa['push'](_0x3566fa['shift']());}}}(a4_0x223f,0x78cc3));import a4_0x4fd2b2 from'chalk';import a4_0x133c9b from'path';function a4_0x5ca6(_0x24aeab,_0x47f60a){_0x24aeab=_0x24aeab-0x1d8;const _0x223fc8=a4_0x223f();let _0x5ca697=_0x223fc8[_0x24aeab];return _0x5ca697;}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2e4d63){const _0x3eacad=a4_0x5ca6,_0x5ed6fa=[];if(_0x2e4d63['total']!==undefined)_0x5ed6fa['push'](_0x2e4d63[_0x3eacad(0x1db)]+_0x3eacad(0x274));if(_0x2e4d63[_0x3eacad(0x251)]!==undefined&&_0x2e4d63[_0x3eacad(0x251)]>0x0)_0x5ed6fa[_0x3eacad(0x24f)](a4_0x4fd2b2[_0x3eacad(0x261)](_0x2e4d63['new']+_0x3eacad(0x203)));if(_0x2e4d63['created']!==undefined&&_0x2e4d63[_0x3eacad(0x227)]>0x0)_0x5ed6fa[_0x3eacad(0x24f)](a4_0x4fd2b2[_0x3eacad(0x261)](_0x2e4d63[_0x3eacad(0x227)]+_0x3eacad(0x1f8)));if(_0x2e4d63[_0x3eacad(0x1de)]!==undefined&&_0x2e4d63[_0x3eacad(0x1de)]>0x0)_0x5ed6fa[_0x3eacad(0x24f)](a4_0x4fd2b2[_0x3eacad(0x27a)](_0x2e4d63['updated']+'\x20updated'));if(_0x2e4d63['unchanged']!==undefined&&_0x2e4d63[_0x3eacad(0x283)]>0x0)_0x5ed6fa[_0x3eacad(0x24f)](a4_0x4fd2b2['gray'](_0x2e4d63[_0x3eacad(0x283)]+_0x3eacad(0x226)));if(_0x2e4d63[_0x3eacad(0x229)]!==undefined&&_0x2e4d63['errors']>0x0)_0x5ed6fa[_0x3eacad(0x24f)](a4_0x4fd2b2[_0x3eacad(0x267)](_0x2e4d63['errors']+'\x20errors'));return _0x5ed6fa[_0x3eacad(0x211)](',\x20');}function displayDiffs(_0x19cdd8,_0x41e888,_0x5a6aa8,_0x540fb4,_0x94f160,_0x439020,_0x53bd63){const _0xa90bac=a4_0x5ca6;for(const _0x2f3632 of _0x19cdd8){if(_0x2f3632[_0xa90bac(0x237)]){const _0x188d25=_0x2f3632['agentName']||_0x2f3632[_0xa90bac(0x208)];console[_0xa90bac(0x1f6)](_0xa90bac(0x284)+_0x188d25+'\x27:'),console[_0xa90bac(0x1f6)]('─'[_0xa90bac(0x1fd)](0x3c)),console[_0xa90bac(0x1f6)](_0x2f3632[_0xa90bac(0x237)]),console[_0xa90bac(0x1f6)]('─'['repeat'](0x3c));}}for(const _0x32a565 of _0x41e888){_0x32a565['diff']&&(console[_0xa90bac(0x1f6)](_0xa90bac(0x1df)+_0x32a565[_0xa90bac(0x208)]+'\x27:'),console[_0xa90bac(0x1f6)]('─'['repeat'](0x3c)),console[_0xa90bac(0x1f6)](_0x32a565['diff']),console[_0xa90bac(0x1f6)]('─'[_0xa90bac(0x1fd)](0x3c)));}for(const _0x4a2101 of _0x5a6aa8){_0x4a2101[_0xa90bac(0x237)]&&(console[_0xa90bac(0x1f6)](_0xa90bac(0x288)+_0x4a2101[_0xa90bac(0x208)]+'\x27:'),console[_0xa90bac(0x1f6)]('─'[_0xa90bac(0x1fd)](0x3c)),console[_0xa90bac(0x1f6)](_0x4a2101['diff']),console[_0xa90bac(0x1f6)]('─'[_0xa90bac(0x1fd)](0x3c)));}for(const _0x1cb433 of _0x540fb4){_0x1cb433[_0xa90bac(0x237)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1cb433[_0xa90bac(0x208)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x1cb433[_0xa90bac(0x237)]),console[_0xa90bac(0x1f6)]('─'[_0xa90bac(0x1fd)](0x3c)));}for(const _0x3275c3 of _0x94f160){_0x3275c3[_0xa90bac(0x237)]&&(console[_0xa90bac(0x1f6)](_0xa90bac(0x218)+_0x3275c3[_0xa90bac(0x208)]+'\x27:'),console[_0xa90bac(0x1f6)]('─'[_0xa90bac(0x1fd)](0x3c)),console['log'](_0x3275c3['diff']),console[_0xa90bac(0x1f6)]('─'['repeat'](0x3c)));}for(const _0x4512d7 of _0x439020){_0x4512d7['diff']&&(console[_0xa90bac(0x1f6)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4512d7[_0xa90bac(0x208)]+'\x27:'),console[_0xa90bac(0x1f6)]('─'[_0xa90bac(0x1fd)](0x3c)),console[_0xa90bac(0x1f6)](_0x4512d7[_0xa90bac(0x237)]),console['log']('─'['repeat'](0x3c)));}for(const _0x1549bc of _0x53bd63){_0x1549bc['diff']&&(console[_0xa90bac(0x1f6)](_0xa90bac(0x234)+_0x1549bc['name']+'\x27:'),console['log']('─'[_0xa90bac(0x1fd)](0x3c)),console[_0xa90bac(0x1f6)](_0x1549bc[_0xa90bac(0x237)]),console['log']('─'[_0xa90bac(0x1fd)](0x3c)));}}function a4_0x223f(){const _0x58e467=['11005510FZMgju','\x20\x20Text\x20Knowledge\x20Bases:\x20','counts','integrations','Cloning\x20\x22','join','Using\x20context\x20project:\x20','outputPath','1013106qzHxTs','\x20=\x20','parse','92tXzzMZ','\x0aChanges\x20to\x20integration\x20\x27','prompts','cwd','121794tYAbEN','\x20--name\x20','dryRun','5530491USFEXK','\x20\x20Prompts:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agent:pull','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','found','Agent\x20pulled\x20successfully','error','\x20unchanged','created','gray','errors','Pushing\x20to\x20project...','Source:\x20','Agent:\x20','-\x20no\x20files\x20written','\x22\x20to\x20\x22','agent','\x20files?','llm_project','\x0aError:','textKnowledgeBases','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','147mReLTT','\x20\x20Agents:\x20','diff','New\x20project\x20name\x20is\x20required','No\x20tdx.json\x20found\x20in\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','6412NCyBcG','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aWrite\x20','\x22\x20from\x20project\x20\x22','\x0aPush\x20','MISSING_ARGUMENT','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','description','projectName','reason','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','4777330LqATGz','\x20changed','Pushing\x20agent\x20from\x20\x22','agent:push','\x0aProject\x20pushed\x20with\x20errors','\x22...','-\x20nothing\x20pushed','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','cloneProject','push','profile','new','agent:clone','Dry\x20run\x20-\x20no\x20changes\x20made','session','cwd-config','knowledgeBases','\x22\x20to\x20a\x20different\x20profile','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','sourceProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Output\x20path:\x20','Chat:\x20','4KYXXzg','Analyzing\x20changes\x20to\x20push...','\x0a✔\x20Pulled\x20','context','green','Cannot\x20clone\x20from\x20context\x20project\x20\x22','dirname','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Summary:','\x22\x20to\x20new\x20project\x20\x22','red','\x20\x20Integrations:\x20','\x20\x20Source:\x20','Agent\x20','\x20resources?','Analyzing\x20project\x20\x22','\x0aChanges:','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20Experimental\x20Artifacts:\x20','11yCRAGQ','\x20\x20Target:\x20','agentName','Failed\x20to\x20push\x20agent:\x20','\x20total','dim','projectId','isNew','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','yellow','\x0a✔\x20Pushed\x20','Cancelled','newProjectName','\x20resources\x20to\x20\x27','experimentalKnowledgeBases','yes','action','llm','unchanged','\x0aChanges\x20to\x20agent\x20\x27','pushProject','1563504LhvAGE','Using\x20project\x20from\x20context:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','pullProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','force','Project\x20cloned\x20with\x20errors','Would\x20push\x20agent:\x20','\x20\x20Knowledge\x20Bases:\x20','tdx.json','\x22:\x20','message','arg-dir','\x20\x20Knowledge\x20Base\x20\x22','New\x20project:\x20','Project\x20cloned\x20successfully','Output:\x20','\x20\x20Integration\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','total','Errors:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','updated','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','cyan','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20successfully','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','llmProject','\x20|\x20','<new-name>','newProjectId','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','New\x20project\x20ID:\x20','pushAgent','INVALID_ARGUMENT','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','output','agents','\x20--profile\x20','Using\x20project:\x20','execute','\x20\x20Agent\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','Using\x20project\x20from\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20created','\x0aPull\x20summary\x20for\x20\x27','Clone\x20\x22','✔\x20Context\x20set:\x20','source','repeat','\x20\x20Prompt\x20\x22','agentId','no_context','Using\x20local\x20project:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20new','agent.yml','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','experimentalArtifacts','outputDir','name','\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)','Project:\x20','projectDir'];a4_0x223f=function(){return _0x58e467;};return a4_0x223f();}export class AgentPullCommand extends BaseCommand{[a4_0x4ce58a(0x208)]=a4_0x4ce58a(0x221);['description']=a4_0x4ce58a(0x1e1);async['execute'](_0x420e0d){const _0x9491b1=a4_0x4ce58a,{options:_0x22cc76,args:_0xa86c09,tdx:_0x56143e}=_0x420e0d,_0x31e8d6=_0xa86c09[0x0],_0x41d860=_0xa86c09[0x1],_0x53480e=_0x22cc76[_0x9491b1(0x1ed)],_0x3a3baa=_0x22cc76['dryRun'],_0x3442d2=_0x22cc76['force'],_0x4c667e=_0x22cc76[_0x9491b1(0x280)],_0x538528=_0x22cc76['llmProject'],_0x932bbf=_0x22cc76[_0x9491b1(0x22f)];let _0x1d1b69;if(_0x31e8d6){const _0x350842=a4_0x133c9b[_0x9491b1(0x211)](_0x31e8d6,'tdx.json');if(existsSync(_0x350842))try{const _0x203f53=JSON[_0x9491b1(0x216)](readFileSync(_0x350842,'utf-8'));_0x203f53[_0x9491b1(0x231)]&&(_0x1d1b69={'llm_project':_0x203f53[_0x9491b1(0x231)]});}catch{}}const _0x24236b=findAgentConfigPath(process[_0x9491b1(0x21a)]());let _0x4f98ea;if(_0x24236b)try{const _0x2ea98c=JSON[_0x9491b1(0x216)](readFileSync(_0x24236b,'utf-8'));_0x2ea98c[_0x9491b1(0x231)]&&(_0x4f98ea={'llm_project':_0x2ea98c[_0x9491b1(0x231)]});}catch{}const _0x39675c=resolveAgentPullArgs({'arg':_0x31e8d6,'agentNameArg':_0x41d860,'agentFlag':_0x932bbf,'contextProject':_0x538528,'argDirConfig':_0x1d1b69,'cwdConfigPath':_0x24236b||undefined,'cwdConfig':_0x4f98ea}),{projectNameOrId:_0x31dcf9,targetAgentName:_0x382e59,existingOutputDir:_0x4cc469,source:_0x7154d9}=_0x39675c;if(_0x7154d9===_0x9491b1(0x292))console['log'](a4_0x4fd2b2[_0x9491b1(0x275)](_0x9491b1(0x1f4)+a4_0x133c9b[_0x9491b1(0x211)](_0x31e8d6,_0x9491b1(0x28f))+':\x20'+_0x31dcf9));else{if(_0x7154d9===_0x9491b1(0x255))console[_0x9491b1(0x1f6)](a4_0x4fd2b2['dim'](_0x9491b1(0x1f0)+_0x31dcf9));else _0x7154d9===_0x9491b1(0x260)&&console[_0x9491b1(0x1f6)](a4_0x4fd2b2[_0x9491b1(0x275)](_0x9491b1(0x287)+_0x31dcf9));}if(!_0x31dcf9)return _0x932bbf?(console[_0x9491b1(0x1f6)](a4_0x4fd2b2['yellow'](_0x9491b1(0x1e8))),console[_0x9491b1(0x1f6)](_0x9491b1(0x205)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x9491b1(0x1f6)](a4_0x4fd2b2['yellow'](_0x9491b1(0x245))),console[_0x9491b1(0x1f6)](_0x9491b1(0x23a)),console['log'](_0x9491b1(0x258)),console[_0x9491b1(0x1f6)](_0x9491b1(0x1f7)),console[_0x9491b1(0x1f6)](_0x9491b1(0x278)),console[_0x9491b1(0x1f6)](_0x9491b1(0x279))),0x1;if(_0x382e59){const {data:_0x54a5aa}=await withSpinner('Pulling\x20agent\x20\x22'+_0x382e59+_0x9491b1(0x23e)+_0x31dcf9+_0x9491b1(0x24b),()=>_0x56143e['llm']['pullAgent'](_0x31dcf9,_0x382e59,_0x53480e,{'dryRun':_0x3a3baa,'force':_0x3442d2}));if(_0x3a3baa)return console['log'](a4_0x4fd2b2[_0x9491b1(0x27a)](_0x9491b1(0x1f3))),console[_0x9491b1(0x1f6)]('Would\x20pull\x20agent:\x20'+_0x54a5aa['agentName']),console[_0x9491b1(0x1f6)](_0x9491b1(0x25b)+_0x54a5aa[_0x9491b1(0x213)]),_0x54a5aa[_0x9491b1(0x237)]&&(console[_0x9491b1(0x1f6)](_0x9491b1(0x26d)),console['log']('─'[_0x9491b1(0x1fd)](0x3c)),console['log'](_0x54a5aa[_0x9491b1(0x237)]),console[_0x9491b1(0x1f6)]('─'[_0x9491b1(0x1fd)](0x3c))),0x0;return console[_0x9491b1(0x1f6)](a4_0x4fd2b2['green'](_0x9491b1(0x224))),console[_0x9491b1(0x1f6)](_0x9491b1(0x22c)+_0x54a5aa['agentName']),console['log'](_0x9491b1(0x1d8)+_0x54a5aa[_0x9491b1(0x213)]),console[_0x9491b1(0x1f6)]('Status:\x20'+(_0x54a5aa[_0x9491b1(0x277)]?a4_0x4fd2b2[_0x9491b1(0x261)](_0x9491b1(0x251)):_0x54a5aa['hasChanges']?a4_0x4fd2b2['yellow']('updated'):a4_0x4fd2b2[_0x9491b1(0x228)](_0x9491b1(0x283)))),0x0;}const _0x12c99a=_0x4cc469||_0x53480e,{data:_0x4bf827}=await withSpinner(_0x9491b1(0x26c)+_0x31dcf9+'\x22...',()=>_0x56143e['llm'][_0x9491b1(0x289)](_0x31dcf9,_0x12c99a,{'dryRun':!![]})),_0x44456c=_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x1ee)][_0x9491b1(0x251)]+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x256)][_0x9491b1(0x251)]+_0x4bf827['counts'][_0x9491b1(0x233)][_0x9491b1(0x251)]+_0x4bf827['counts']['prompts'][_0x9491b1(0x251)]+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x20f)][_0x9491b1(0x251)]+_0x4bf827[_0x9491b1(0x20e)]['experimentalKnowledgeBases'][_0x9491b1(0x251)]+_0x4bf827['counts'][_0x9491b1(0x206)][_0x9491b1(0x251)],_0x12e074=_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x1ee)][_0x9491b1(0x1de)]+_0x4bf827['counts']['knowledgeBases'][_0x9491b1(0x1de)]+_0x4bf827[_0x9491b1(0x20e)]['textKnowledgeBases'][_0x9491b1(0x1de)]+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x219)][_0x9491b1(0x1de)]+_0x4bf827[_0x9491b1(0x20e)]['integrations'][_0x9491b1(0x1de)]+_0x4bf827[_0x9491b1(0x20e)]['experimentalKnowledgeBases'][_0x9491b1(0x1de)]+_0x4bf827['counts'][_0x9491b1(0x206)]['updated'],_0x4f6e74=_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x1ee)][_0x9491b1(0x283)]+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x256)]['unchanged']+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x233)][_0x9491b1(0x283)]+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x219)][_0x9491b1(0x283)]+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x20f)][_0x9491b1(0x283)]+_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x27f)][_0x9491b1(0x283)]+_0x4bf827[_0x9491b1(0x20e)]['experimentalArtifacts']['unchanged'];console['log'](_0x9491b1(0x1f9)+_0x4bf827[_0x9491b1(0x243)]+'\x27:'),console['log']('\x20\x20'+a4_0x4fd2b2[_0x9491b1(0x261)]('+\x20'+_0x44456c+_0x9491b1(0x203))+_0x9491b1(0x1e5)+a4_0x4fd2b2[_0x9491b1(0x27a)]('~\x20'+_0x12e074+'\x20changed')+'\x20|\x20'+a4_0x4fd2b2[_0x9491b1(0x275)]('=\x20'+_0x4f6e74+_0x9491b1(0x226))),console[_0x9491b1(0x1f6)](_0x9491b1(0x236)+formatCountSummary(_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x1ee)])),console[_0x9491b1(0x1f6)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4bf827['counts']['knowledgeBases'])),console['log'](_0x9491b1(0x20d)+formatCountSummary(_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x233)])),console[_0x9491b1(0x1f6)](_0x9491b1(0x21f)+formatCountSummary(_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x219)])),console[_0x9491b1(0x1f6)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4bf827[_0x9491b1(0x20e)]['integrations']));const _0x3d0e4f=_0x4bf827[_0x9491b1(0x20e)]['experimentalKnowledgeBases'][_0x9491b1(0x1db)]>0x0||_0x4bf827[_0x9491b1(0x20e)][_0x9491b1(0x206)][_0x9491b1(0x1db)]>0x0;_0x3d0e4f&&(console[_0x9491b1(0x1f6)](_0x9491b1(0x1dd)+formatCountSummary(_0x4bf827[_0x9491b1(0x20e)]['experimentalKnowledgeBases'])),console[_0x9491b1(0x1f6)](_0x9491b1(0x26f)+formatCountSummary(_0x4bf827['counts'][_0x9491b1(0x206)])));console[_0x9491b1(0x1f6)](_0x9491b1(0x271)+a4_0x4fd2b2[_0x9491b1(0x1e0)](_0x4bf827['outputDir'])),displayDiffs(_0x4bf827['agents'],_0x4bf827[_0x9491b1(0x256)],_0x4bf827[_0x9491b1(0x233)],_0x4bf827[_0x9491b1(0x219)],_0x4bf827['integrations'],_0x4bf827[_0x9491b1(0x27f)],_0x4bf827[_0x9491b1(0x206)]);if(_0x3a3baa)return console[_0x9491b1(0x1f6)](a4_0x4fd2b2[_0x9491b1(0x27a)](_0x9491b1(0x1e3))),0x0;if(_0x44456c===0x0&&_0x12e074===0x0)return console['log'](a4_0x4fd2b2['green'](_0x9491b1(0x25a))),saveSessionContext({'llm_project':_0x4bf827['projectName']},_0x22cc76[_0x9491b1(0x254)]),console['log'](a4_0x4fd2b2[_0x9491b1(0x261)](_0x9491b1(0x1fb)+a4_0x4fd2b2[_0x9491b1(0x275)](_0x9491b1(0x231))+_0x9491b1(0x215)+a4_0x4fd2b2[_0x9491b1(0x1e0)](_0x4bf827[_0x9491b1(0x243)]))),0x0;if(!_0x4c667e&&!_0x3442d2){if(!isInteractive())return console[_0x9491b1(0x225)](a4_0x4fd2b2[_0x9491b1(0x267)]('\x0aError:'),_0x9491b1(0x28a)),console['error'](a4_0x4fd2b2[_0x9491b1(0x275)](_0x9491b1(0x222))),0x1;const _0xb5ba56=await confirmKey(_0x9491b1(0x23d)+(_0x44456c+_0x12e074)+_0x9491b1(0x230));if(!_0xb5ba56)return console[_0x9491b1(0x1f6)](a4_0x4fd2b2[_0x9491b1(0x27a)]('Cancelled'),_0x9491b1(0x22d)),0x1;}const {data:_0x4f894a}=await withSpinner('Writing\x20files...',()=>_0x56143e[_0x9491b1(0x282)]['pullProject'](_0x31dcf9,_0x12c99a,{'force':_0x3442d2}));return console[_0x9491b1(0x1f6)](a4_0x4fd2b2[_0x9491b1(0x261)](_0x9491b1(0x25f)+(_0x44456c+_0x12e074)+'\x20files\x20to\x20'+_0x4f894a[_0x9491b1(0x207)])),saveSessionContext({'llm_project':_0x4f894a[_0x9491b1(0x243)]},_0x22cc76[_0x9491b1(0x254)]),console[_0x9491b1(0x1f6)](a4_0x4fd2b2[_0x9491b1(0x261)]('✔\x20Context\x20set:\x20'+a4_0x4fd2b2[_0x9491b1(0x275)](_0x9491b1(0x231))+'\x20=\x20'+a4_0x4fd2b2[_0x9491b1(0x1e0)](_0x4f894a['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4ce58a(0x208)]=a4_0x4ce58a(0x252);['description']=a4_0x4ce58a(0x202);async['execute'](_0x309cf0){const _0x16dbbf=a4_0x4ce58a,{options:_0x168a62,args:_0x1b78e3,tdx:_0x368747}=_0x309cf0,_0xab1008=_0x1b78e3[0x0],_0x2e92c6=_0x168a62[_0x16dbbf(0x208)],_0x59e7cc=_0x168a62[_0x16dbbf(0x21d)],_0x38cf4f=_0x168a62[_0x16dbbf(0x280)],_0x37c07a=_0x168a62['site'],_0x581b61=_0x168a62[_0x16dbbf(0x1e4)];let _0x2470e5;const _0x13c78c=findAgentConfigPath(process['cwd']());if(_0xab1008){const _0x35db72=a4_0x133c9b[_0x16dbbf(0x211)](_0xab1008,'tdx.json');existsSync(_0x35db72)?(_0x2470e5=_0xab1008,console['log'](a4_0x4fd2b2['dim'](_0x16dbbf(0x201)+_0xab1008))):_0x2470e5=_0xab1008;}else{if(_0x13c78c)_0x2470e5=a4_0x133c9b['dirname'](_0x13c78c),console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x275)]('Using\x20current\x20project:\x20'+_0x2470e5));else{if(_0x581b61){const _0x1d468a=sanitizeForFilesystem(_0x581b61);let _0xc4c220=_0x1d468a,_0x59ca6a=a4_0x133c9b['join'](process['cwd'](),_0x16dbbf(0x1ee),_0x1d468a,_0x16dbbf(0x28f));if(!existsSync(_0x59ca6a)){const _0x19e99c=normalizeName(_0x581b61),_0x490350=a4_0x133c9b[_0x16dbbf(0x211)](process[_0x16dbbf(0x21a)](),_0x16dbbf(0x1ee),_0x19e99c,'tdx.json');existsSync(_0x490350)&&(_0xc4c220=_0x19e99c,_0x59ca6a=_0x490350);}if(existsSync(_0x59ca6a))_0x2470e5=a4_0x133c9b[_0x16dbbf(0x263)](_0x59ca6a),console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x275)](_0x16dbbf(0x201)+_0x2470e5));else{const _0x54703e=_0x168a62[_0x16dbbf(0x250)];if(_0x54703e)throw new SDKError(ErrorCode[_0x16dbbf(0x1eb)],_0x16dbbf(0x262)+_0x581b61+_0x16dbbf(0x257),undefined,{'helpText':_0x16dbbf(0x1da)+_0x16dbbf(0x24d)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x581b61+'\x0a')+(_0x16dbbf(0x26e)+_0xc4c220+_0x16dbbf(0x21c)+(_0x2e92c6||_0x16dbbf(0x1e6))+_0x16dbbf(0x1ef)+_0x54703e)});_0x2470e5=_0x581b61,console['log'](a4_0x4fd2b2[_0x16dbbf(0x275)](_0x16dbbf(0x212)+_0x581b61));}}}}if(!_0x2470e5)return console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x27a)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x16dbbf(0x1f6)](_0x16dbbf(0x220)),console[_0x16dbbf(0x1f6)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x16dbbf(0x1f6)](_0x16dbbf(0x209)),console['log'](_0x16dbbf(0x241)),0x1;if(!_0x2e92c6)throw new SDKError(ErrorCode[_0x16dbbf(0x240)],_0x16dbbf(0x238),undefined,{'helpText':_0x16dbbf(0x264)});if(!_0x38cf4f&&!_0x59e7cc){if(!isInteractive())return console[_0x16dbbf(0x225)](a4_0x4fd2b2[_0x16dbbf(0x267)](_0x16dbbf(0x232)),_0x16dbbf(0x28a)),console[_0x16dbbf(0x225)](a4_0x4fd2b2[_0x16dbbf(0x275)](_0x16dbbf(0x222))),0x1;const _0x2e6e97=await confirmKey(_0x16dbbf(0x1fa)+_0x2470e5+_0x16dbbf(0x266)+_0x2e92c6+'\x22?');if(!_0x2e6e97)return console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x27a)]('Cancelled')),0x1;}const {data:_0x4fb576}=await withSpinner(_0x16dbbf(0x210)+_0x2470e5+_0x16dbbf(0x22e)+_0x2e92c6+_0x16dbbf(0x24b),()=>_0x368747[_0x16dbbf(0x282)][_0x16dbbf(0x24e)](_0x2470e5,_0x2e92c6,{'dryRun':_0x59e7cc}));if(_0x59e7cc){console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x27a)](_0x16dbbf(0x253))),console[_0x16dbbf(0x1f6)]('Source:\x20'+_0x4fb576[_0x16dbbf(0x259)]),console['log'](_0x16dbbf(0x294)+_0x2e92c6),console[_0x16dbbf(0x1f6)]('Would\x20clone:'),console[_0x16dbbf(0x1f6)]('\x20\x20Agents:\x20'+_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x1ee)][_0x16dbbf(0x227)]),console[_0x16dbbf(0x1f6)](_0x16dbbf(0x28e)+_0x4fb576[_0x16dbbf(0x20e)]['knowledgeBases'][_0x16dbbf(0x227)]),console['log']('\x20\x20Prompts:\x20'+_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x219)][_0x16dbbf(0x227)]);const _0x7c7c5d=_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x27f)]['created']>0x0||_0x4fb576[_0x16dbbf(0x20e)]['experimentalArtifacts'][_0x16dbbf(0x227)]>0x0;return _0x7c7c5d&&(console[_0x16dbbf(0x1f6)](_0x16dbbf(0x1dd)+_0x4fb576['counts'][_0x16dbbf(0x27f)][_0x16dbbf(0x227)]),console[_0x16dbbf(0x1f6)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x206)][_0x16dbbf(0x227)])),0x0;}const _0x293d8d=_0x4fb576['counts']['agents'][_0x16dbbf(0x229)]>0x0||_0x4fb576[_0x16dbbf(0x20e)]['knowledgeBases'][_0x16dbbf(0x229)]>0x0||_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x219)][_0x16dbbf(0x229)]>0x0||_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x27f)][_0x16dbbf(0x229)]>0x0||_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x206)]['errors']>0x0;_0x293d8d?console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x27a)](_0x16dbbf(0x28c))):console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x261)](_0x16dbbf(0x295)));console[_0x16dbbf(0x1f6)](_0x16dbbf(0x22b)+_0x4fb576[_0x16dbbf(0x259)]),console[_0x16dbbf(0x1f6)](_0x16dbbf(0x294)+_0x4fb576[_0x16dbbf(0x27d)]),console[_0x16dbbf(0x1f6)](_0x16dbbf(0x1e9)+_0x4fb576[_0x16dbbf(0x1e7)]),console[_0x16dbbf(0x1f6)](),console['log'](_0x16dbbf(0x265)),console[_0x16dbbf(0x1f6)](_0x16dbbf(0x236)+formatCountSummary(_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x1ee)])),console[_0x16dbbf(0x1f6)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x256)])),console['log'](_0x16dbbf(0x21f)+formatCountSummary(_0x4fb576['counts'][_0x16dbbf(0x219)])),console[_0x16dbbf(0x1f6)](_0x16dbbf(0x268)+formatCountSummary(_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x20f)]));const _0x33df17=_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x27f)]['created']>0x0||_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x27f)][_0x16dbbf(0x1de)]>0x0||_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x27f)][_0x16dbbf(0x283)]>0x0||_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x206)][_0x16dbbf(0x227)]>0x0||_0x4fb576[_0x16dbbf(0x20e)]['experimentalArtifacts'][_0x16dbbf(0x1de)]>0x0||_0x4fb576['counts'][_0x16dbbf(0x206)]['unchanged']>0x0;_0x33df17&&(console[_0x16dbbf(0x1f6)](_0x16dbbf(0x1dd)+formatCountSummary(_0x4fb576['counts']['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4fb576[_0x16dbbf(0x20e)][_0x16dbbf(0x206)])));if(_0x293d8d){console[_0x16dbbf(0x1f6)](),console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x267)](_0x16dbbf(0x1dc)));for(const _0x18945d of _0x4fb576[_0x16dbbf(0x1ee)]){_0x18945d[_0x16dbbf(0x281)]===_0x16dbbf(0x225)&&console[_0x16dbbf(0x1f6)](a4_0x4fd2b2['red'](_0x16dbbf(0x1f2)+_0x18945d[_0x16dbbf(0x272)]+_0x16dbbf(0x290)+_0x18945d[_0x16dbbf(0x225)]));}for(const _0x17b6b0 of _0x4fb576[_0x16dbbf(0x256)]){_0x17b6b0[_0x16dbbf(0x281)]===_0x16dbbf(0x225)&&console[_0x16dbbf(0x1f6)](a4_0x4fd2b2['red'](_0x16dbbf(0x293)+_0x17b6b0[_0x16dbbf(0x208)]+_0x16dbbf(0x290)+_0x17b6b0[_0x16dbbf(0x225)]));}for(const _0x50c87c of _0x4fb576[_0x16dbbf(0x219)]){_0x50c87c[_0x16dbbf(0x281)]===_0x16dbbf(0x225)&&console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x267)]('\x20\x20Prompt\x20\x22'+_0x50c87c[_0x16dbbf(0x208)]+_0x16dbbf(0x290)+_0x50c87c['error']));}for(const _0x2154a5 of _0x4fb576[_0x16dbbf(0x20f)]){_0x2154a5[_0x16dbbf(0x281)]===_0x16dbbf(0x225)&&console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x267)]('\x20\x20Integration\x20\x22'+_0x2154a5[_0x16dbbf(0x208)]+_0x16dbbf(0x290)+_0x2154a5[_0x16dbbf(0x225)]));}for(const _0x25794a of _0x4fb576['experimentalKnowledgeBases']){_0x25794a[_0x16dbbf(0x281)]===_0x16dbbf(0x225)&&console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x267)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x25794a[_0x16dbbf(0x208)]+_0x16dbbf(0x290)+_0x25794a[_0x16dbbf(0x225)]));}for(const _0x4e5f38 of _0x4fb576[_0x16dbbf(0x206)]){_0x4e5f38['action']===_0x16dbbf(0x225)&&console[_0x16dbbf(0x1f6)](a4_0x4fd2b2[_0x16dbbf(0x267)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x4e5f38[_0x16dbbf(0x208)]+'\x22:\x20'+_0x4e5f38[_0x16dbbf(0x225)]));}return 0x1;}console[_0x16dbbf(0x1f6)]();const _0x424861=getLLMProjectUrl(_0x37c07a,_0x4fb576['newProjectId']);return console[_0x16dbbf(0x1f6)]('Project:\x20'+a4_0x4fd2b2[_0x16dbbf(0x1e0)](_0x424861)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4ce58a(0x208)]=a4_0x4ce58a(0x249);[a4_0x4ce58a(0x242)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x4ce58a(0x1f1)](_0x14a812){const _0x32f71c=a4_0x4ce58a,{options:_0x11e9f9,args:_0x1c7dff,tdx:_0x42e702}=_0x14a812;let _0x466554=_0x1c7dff[0x0]||process[_0x32f71c(0x21a)]();const _0x5791f6=_0x11e9f9[_0x32f71c(0x21d)],_0x16d504=_0x11e9f9[_0x32f71c(0x28b)],_0x4e29de=_0x11e9f9[_0x32f71c(0x280)],_0x567d3e=_0x11e9f9['site'],_0x14b1ca=a4_0x133c9b[_0x32f71c(0x211)](_0x466554,_0x32f71c(0x204)),_0x2d4d83=existsSync(_0x14b1ca);if(_0x2d4d83){const {data:_0x5938b7}=await withSpinner(_0x32f71c(0x248)+_0x466554+_0x32f71c(0x24b),()=>_0x42e702[_0x32f71c(0x282)][_0x32f71c(0x1ea)](_0x466554,{'dryRun':_0x5791f6,'force':_0x16d504}));if(_0x5791f6)return console['log'](a4_0x4fd2b2[_0x32f71c(0x27a)](_0x32f71c(0x253))),console[_0x32f71c(0x1f6)](_0x32f71c(0x28d)+_0x5938b7[_0x32f71c(0x272)]),0x0;if(_0x5938b7[_0x32f71c(0x281)]==='error')return console[_0x32f71c(0x1f6)](a4_0x4fd2b2['red'](_0x32f71c(0x273)+_0x5938b7[_0x32f71c(0x225)])),0x1;console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x261)](_0x32f71c(0x26a)+_0x5938b7[_0x32f71c(0x281)]+_0x32f71c(0x1e2))),console[_0x32f71c(0x1f6)]('Agent:\x20'+_0x5938b7[_0x32f71c(0x272)]);if(_0x5938b7[_0x32f71c(0x1ff)]&&_0x5938b7['projectId']){const _0xea0cde=getLLMAgentChatUrl(_0x567d3e,_0x5938b7['projectId'],_0x5938b7[_0x32f71c(0x1ff)]);console[_0x32f71c(0x1f6)](_0x32f71c(0x25c)+a4_0x4fd2b2[_0x32f71c(0x1e0)](_0xea0cde));}return 0x0;}const _0x439e30=_0x11e9f9['llmProject'],_0x43b52b=resolveProjectFromContext(_0x466554,_0x439e30);if(_0x43b52b[_0x32f71c(0x223)])_0x466554=_0x43b52b[_0x32f71c(0x20b)],_0x43b52b[_0x32f71c(0x1fc)]===_0x32f71c(0x260)&&console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x275)](_0x32f71c(0x1f0)+_0x466554));else{let _0x5d5a20='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x43b52b['reason']==='no_local_folder'&&(_0x5d5a20=_0x43b52b[_0x32f71c(0x291)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x43b52b[_0x32f71c(0x1e4)]+_0x32f71c(0x1f5));throw new SDKError(ErrorCode[_0x32f71c(0x1eb)],_0x43b52b[_0x32f71c(0x244)]===_0x32f71c(0x200)?_0x43b52b[_0x32f71c(0x291)]:_0x32f71c(0x239)+_0x466554,undefined,{'helpText':_0x5d5a20});}const {data:_0x766200}=await withSpinner(_0x32f71c(0x25e),()=>_0x42e702['llm'][_0x32f71c(0x285)](_0x466554,{'dryRun':!![]})),_0x3f6efd=_0x766200['counts'][_0x32f71c(0x1ee)][_0x32f71c(0x229)]>0x0;if(_0x3f6efd){console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x267)]('\x0aErrors\x20found:'));for(const _0x1eade4 of _0x766200['agents']){_0x1eade4['action']===_0x32f71c(0x225)&&console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x267)]('\x20\x20Agent\x20\x22'+_0x1eade4[_0x32f71c(0x272)]+_0x32f71c(0x290)+_0x1eade4[_0x32f71c(0x225)]));}return 0x1;}const _0x17d907=_0x766200['counts'][_0x32f71c(0x1ee)][_0x32f71c(0x227)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x256)][_0x32f71c(0x227)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x233)][_0x32f71c(0x227)]+_0x766200['counts']['prompts'][_0x32f71c(0x227)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x20f)][_0x32f71c(0x227)]+_0x766200['counts'][_0x32f71c(0x27f)][_0x32f71c(0x227)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x206)][_0x32f71c(0x227)],_0x30dc26=_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x1ee)][_0x32f71c(0x1de)]+_0x766200['counts'][_0x32f71c(0x256)][_0x32f71c(0x1de)]+_0x766200[_0x32f71c(0x20e)]['textKnowledgeBases'][_0x32f71c(0x1de)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x219)][_0x32f71c(0x1de)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x20f)][_0x32f71c(0x1de)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x27f)][_0x32f71c(0x1de)]+_0x766200['counts'][_0x32f71c(0x206)]['updated'],_0x4229e4=_0x766200['counts'][_0x32f71c(0x1ee)][_0x32f71c(0x283)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x256)][_0x32f71c(0x283)]+_0x766200[_0x32f71c(0x20e)]['textKnowledgeBases']['unchanged']+_0x766200['counts'][_0x32f71c(0x219)][_0x32f71c(0x283)]+_0x766200[_0x32f71c(0x20e)]['integrations'][_0x32f71c(0x283)]+_0x766200['counts'][_0x32f71c(0x27f)][_0x32f71c(0x283)]+_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x206)][_0x32f71c(0x283)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x766200[_0x32f71c(0x243)]+'\x27:'),console[_0x32f71c(0x1f6)]('\x20\x20'+a4_0x4fd2b2[_0x32f71c(0x261)]('+\x20'+_0x17d907+'\x20new')+_0x32f71c(0x1e5)+a4_0x4fd2b2['yellow']('~\x20'+_0x30dc26+_0x32f71c(0x247))+_0x32f71c(0x1e5)+a4_0x4fd2b2['dim']('=\x20'+_0x4229e4+_0x32f71c(0x226))),console[_0x32f71c(0x1f6)]('\x20\x20Agents:\x20'+formatCountSummary(_0x766200[_0x32f71c(0x20e)]['agents'])),console[_0x32f71c(0x1f6)](_0x32f71c(0x28e)+formatCountSummary(_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x256)])),console['log'](_0x32f71c(0x20d)+formatCountSummary(_0x766200[_0x32f71c(0x20e)]['textKnowledgeBases'])),console[_0x32f71c(0x1f6)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x766200['counts'][_0x32f71c(0x219)])),console[_0x32f71c(0x1f6)](_0x32f71c(0x268)+formatCountSummary(_0x766200['counts']['integrations']));const _0x150bb2=_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x27f)]['created']>0x0||_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x27f)][_0x32f71c(0x1de)]>0x0||_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x27f)][_0x32f71c(0x283)]>0x0||_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x206)][_0x32f71c(0x227)]>0x0||_0x766200['counts'][_0x32f71c(0x206)]['updated']>0x0||_0x766200[_0x32f71c(0x20e)][_0x32f71c(0x206)][_0x32f71c(0x283)]>0x0;_0x150bb2&&(console['log'](_0x32f71c(0x1dd)+formatCountSummary(_0x766200['counts'][_0x32f71c(0x27f)])),console[_0x32f71c(0x1f6)](_0x32f71c(0x26f)+formatCountSummary(_0x766200[_0x32f71c(0x20e)]['experimentalArtifacts'])));console[_0x32f71c(0x1f6)](_0x32f71c(0x269)+a4_0x4fd2b2[_0x32f71c(0x1e0)](_0x466554)),displayDiffs(_0x766200[_0x32f71c(0x1ee)],_0x766200[_0x32f71c(0x256)],_0x766200[_0x32f71c(0x233)],_0x766200[_0x32f71c(0x219)],_0x766200[_0x32f71c(0x20f)],_0x766200[_0x32f71c(0x27f)],_0x766200[_0x32f71c(0x206)]);if(_0x5791f6)return console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x27a)](_0x32f71c(0x1ec))),0x0;if(_0x17d907===0x0&&_0x30dc26===0x0){console[_0x32f71c(0x1f6)](a4_0x4fd2b2['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x1039d8=getLLMProjectUrl(_0x567d3e,_0x766200[_0x32f71c(0x276)]);return console[_0x32f71c(0x1f6)](_0x32f71c(0x20a)+a4_0x4fd2b2[_0x32f71c(0x1e0)](_0x1039d8)),0x0;}if(!_0x4e29de&&!_0x16d504){if(!isInteractive())return console[_0x32f71c(0x225)](a4_0x4fd2b2[_0x32f71c(0x267)](_0x32f71c(0x232)),_0x32f71c(0x28a)),console['error'](a4_0x4fd2b2['dim'](_0x32f71c(0x222))),0x1;const _0x47c5e0=await confirmKey(_0x32f71c(0x23f)+(_0x17d907+_0x30dc26)+_0x32f71c(0x26b));if(!_0x47c5e0)return console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x27a)](_0x32f71c(0x27c)),_0x32f71c(0x24c)),0x1;}const {data:_0x2dff1c}=await withSpinner(_0x32f71c(0x22a),()=>_0x42e702[_0x32f71c(0x282)][_0x32f71c(0x285)](_0x466554,{'force':_0x16d504})),_0x562ed4=_0x2dff1c['counts'][_0x32f71c(0x1ee)][_0x32f71c(0x229)]>0x0||_0x2dff1c[_0x32f71c(0x20e)][_0x32f71c(0x256)]['errors']>0x0||_0x2dff1c[_0x32f71c(0x20e)]['textKnowledgeBases'][_0x32f71c(0x229)]>0x0||_0x2dff1c[_0x32f71c(0x20e)][_0x32f71c(0x219)][_0x32f71c(0x229)]>0x0;if(_0x562ed4){console['log'](a4_0x4fd2b2[_0x32f71c(0x27a)](_0x32f71c(0x24a))),console[_0x32f71c(0x1f6)](),console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x267)](_0x32f71c(0x1dc)));for(const _0x49feed of _0x2dff1c[_0x32f71c(0x1ee)]){_0x49feed[_0x32f71c(0x281)]==='error'&&console['log'](a4_0x4fd2b2[_0x32f71c(0x267)]('\x20\x20Agent\x20\x22'+_0x49feed['agentName']+_0x32f71c(0x290)+_0x49feed['error']));}for(const _0x2b383f of _0x2dff1c[_0x32f71c(0x256)]){_0x2b383f[_0x32f71c(0x281)]===_0x32f71c(0x225)&&console[_0x32f71c(0x1f6)](a4_0x4fd2b2['red'](_0x32f71c(0x293)+_0x2b383f[_0x32f71c(0x208)]+_0x32f71c(0x290)+_0x2b383f[_0x32f71c(0x225)]));}for(const _0x588fc7 of _0x2dff1c[_0x32f71c(0x233)]){_0x588fc7['action']===_0x32f71c(0x225)&&console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x267)](_0x32f71c(0x23c)+_0x588fc7[_0x32f71c(0x208)]+_0x32f71c(0x290)+_0x588fc7[_0x32f71c(0x225)]));}for(const _0x226257 of _0x2dff1c[_0x32f71c(0x219)]){_0x226257['action']===_0x32f71c(0x225)&&console[_0x32f71c(0x1f6)](a4_0x4fd2b2[_0x32f71c(0x267)](_0x32f71c(0x1fe)+_0x226257[_0x32f71c(0x208)]+_0x32f71c(0x290)+_0x226257[_0x32f71c(0x225)]));}for(const _0x55e5f5 of _0x2dff1c[_0x32f71c(0x20f)]){_0x55e5f5[_0x32f71c(0x281)]===_0x32f71c(0x225)&&console[_0x32f71c(0x1f6)](a4_0x4fd2b2['red'](_0x32f71c(0x1d9)+_0x55e5f5[_0x32f71c(0x208)]+_0x32f71c(0x290)+_0x55e5f5['error']));}return 0x1;}console['log'](a4_0x4fd2b2[_0x32f71c(0x261)](_0x32f71c(0x27b)+(_0x17d907+_0x30dc26)+_0x32f71c(0x27e)+_0x2dff1c[_0x32f71c(0x243)]+'\x27'));const _0x47d228=getLLMProjectUrl(_0x567d3e,_0x2dff1c['projectId']);return console[_0x32f71c(0x1f6)]('Project:\x20'+a4_0x4fd2b2[_0x32f71c(0x1e0)](_0x47d228)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0xcf51(_0x1ea3ec,_0x5875a4){_0x1ea3ec=_0x1ea3ec-0xd0;const _0x52c49c=a5_0x52c4();let _0xcf51=_0x52c49c[_0x1ea3ec];return _0xcf51;}const a5_0x1ddf43=a5_0xcf51;(function(_0x254742,_0x1bdb98){const _0x132a37=a5_0xcf51,_0x122435=_0x254742();while(!![]){try{const _0x12d838=-parseInt(_0x132a37(0xe2))/0x1*(parseInt(_0x132a37(0x14b))/0x2)+parseInt(_0x132a37(0x13e))/0x3+parseInt(_0x132a37(0x15b))/0x4*(-parseInt(_0x132a37(0x105))/0x5)+parseInt(_0x132a37(0x122))/0x6+parseInt(_0x132a37(0xed))/0x7*(-parseInt(_0x132a37(0x15d))/0x8)+parseInt(_0x132a37(0xe4))/0x9+-parseInt(_0x132a37(0x10d))/0xa;if(_0x12d838===_0x1bdb98)break;else _0x122435['push'](_0x122435['shift']());}catch(_0x5127d5){_0x122435['push'](_0x122435['shift']());}}}(a5_0x52c4,0x931ce));import*as a5_0x5187c7 from'node:fs';import*as a5_0x71a21a from'node:path';import a5_0x57ac79 from'chalk';import{BaseCommand}from'./command.js';function a5_0x52c4(){const _0x584a08=['ERROR','Error\x20writing\x20output\x20file:\x20','FAIL','resolve','Failed:\x20\x20\x20','1511562jjaTSF','No\x20tests\x20have\x20tags\x20defined.','resolveProjectId','site','tags','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','llmProject','cyan','split','projectDir','Cached\x20run\x20is\x20from\x20site\x20\x22','Errors:\x20\x20\x20','Re-evaluating...','306yxlJNZ','trim','Executing\x20new\x20tests...','no_local_folder','filter','found','log','length','✓\x20PASS:\x20','substring','not\x20found','Evaluating\x20response...','Usage:','add','⚠\x20SKIPPED:\x20','join','3340904phhxMI','has','278456KouxJo','conversation_url','Running:\x20','dryRun','status','rounds','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','reason','\x20\x20Evaluating...\x20','Round\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','timestamp','Test\x20','...\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Round\x201/','Re-evaluation\x20Summary','stop','conversations','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','no_tests','\x22:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','white','Duration:\x20','tests','3823zieDQj','\x20\x20Round\x20','7819659eFNTaV','test.yml','✗\x20ERROR:\x20','Agent:\x20','testYmlPath','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','projectName','Either\x20switch\x20to\x20the\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','63QNyHZR','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','executeReeval','\x20\x20-\x20','✗\x20FAIL:\x20','description','Test\x20Configuration:','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed\x20Tests:','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Site:\x20','agent','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','start','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','utf-8','Test\x20Summary','Total:\x20\x20\x20\x20','json','toISOString','round','Conversation\x20URL:\x20','green','5SYzIrS','Output\x20written\x20to:\x20','repeat','includes','\x20\x20Agent:\x20','message','\x20(new)','dim','190100XyoPzn','isSpinning','Error:\x20No\x20previous\x20test\x20run\x20found.','\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)',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','/<agent-name>','Cached\x20run\x20from:\x20','Tests\x20found:\x20','execute','push','map','name','Re-evaluating\x20','some','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','existsSync','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20agent:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Running\x20agent\x20tests...','5893722gaTsZG','now','output','Project\x20path:\x20','toLowerCase','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20-\x20','PASS','jsonl','reeval','text','yellow','agentName','\x20(cached)','Re-evaluating\x20cached\x20test\x20run...','red','eval','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','...','llm','tsv','writeFileSync','Passed:\x20\x20\x20'];a5_0x52c4=function(){return _0x584a08;};return a5_0x52c4();}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_0x1ddf43(0x119)]='agent:test';[a5_0x1ddf43(0xf2)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x1ddf43(0x116)](_0x436a7d){const _0x244010=a5_0x1ddf43,{options:_0x5f1f06,args:_0x555d7b,tdx:_0x3d4b86}=_0x436a7d,_0x22f1cb=_0x555d7b[0x0]||'.',_0x11faa5=_0x5f1f06[_0x244010(0x160)],_0x4b4443=_0x5f1f06,_0x2f078b=_0x4b4443[_0x244010(0x132)]===![],_0x4c3fbe=_0x4b4443[_0x244010(0x12b)],_0x4e2662=_0x4b4443[_0x244010(0x119)],_0x59c1e9=_0x4b4443[_0x244010(0x142)],_0x38de0d=_0x5f1f06[_0x244010(0x141)],_0x251c33=_0x4b4443[_0x244010(0x124)];if(_0x4c3fbe&&_0x2f078b)return console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x143))),0x1;let _0x397542='table';if(_0x4b4443['json'])_0x397542=_0x244010(0x100);else{if(_0x4b4443[_0x244010(0x12a)])_0x397542=_0x244010(0x12a);else{if(_0x4b4443[_0x244010(0x136)])_0x397542=_0x244010(0x136);else{if(_0x4b4443[_0x244010(0xfa)])_0x397542=_0x244010(0xfa);}}}const _0x93612c=_0x4b4443[_0x244010(0x144)];let _0x31c4da=_0x22f1cb;const _0x418f1e=a5_0x5187c7[_0x244010(0x11d)](_0x22f1cb),_0x278d52=_0x22f1cb==='.';if(!_0x418f1e||_0x278d52){const _0x147706=resolveProjectFromContext(_0x22f1cb,_0x93612c,{'requireFile':_0x244010(0xe5)});if(_0x147706[_0x244010(0x150)])_0x31c4da=_0x147706[_0x244010(0x147)],_0x147706['source']==='context'&&console[_0x244010(0x151)](a5_0x57ac79['dim'](_0x244010(0x11f)+_0x31c4da));else switch(_0x147706[_0x244010(0x164)]){case'no_context':console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x147706[_0x244010(0x10a)])),console[_0x244010(0x151)](),console['log'](_0x244010(0x157)),console[_0x244010(0x151)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x244010(0x151)](_0x244010(0x110)),console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0x11e));return 0x1;case _0x244010(0x14e):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x147706[_0x244010(0x10a)])),console['log'](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x147706[_0x244010(0x144)]+_0x244010(0xec));return 0x1;case'multiple_agents':{const _0x1fc11c=a5_0x71a21a['basename'](_0x147706[_0x244010(0x147)]);console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x244010(0x127)+_0x147706['llmProject']+'\x22:'));for(const _0x19253a of _0x147706['agentDirs']){console['log'](_0x244010(0xf0)+_0x19253a);}return console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0xd6)+_0x1fc11c+_0x244010(0x113)),0x1;}case _0x244010(0xdc):console[_0x244010(0x151)](a5_0x57ac79['yellow'](_0x244010(0xf6)+_0x147706[_0x244010(0x144)]+'\x22.')),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x125)+_0x147706[_0x244010(0x147)])),console[_0x244010(0x151)](),console['log'](_0x244010(0xfc));return 0x1;}}const {definition:_0x5d64c7,agentInfo:_0x90876c}=parseTestFile(_0x31c4da);let _0x278cb6=_0x5d64c7[_0x244010(0xe1)];if(_0x4e2662){const _0x49b8ce=_0x4e2662[_0x244010(0x146)](',')[_0x244010(0x118)](_0x1d2267=>_0x1d2267[_0x244010(0x14c)]());_0x278cb6=_0x5d64c7[_0x244010(0xe1)][_0x244010(0x14f)](_0x4ce465=>_0x49b8ce[_0x244010(0x108)](_0x4ce465['name']));if(_0x278cb6[_0x244010(0x152)]===0x0)return console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)]('No\x20tests\x20found\x20matching:\x20'+_0x4e2662)),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)]('Available\x20tests:\x20'+_0x5d64c7[_0x244010(0xe1)]['map'](_0xc59f11=>_0xc59f11[_0x244010(0x119)])[_0x244010(0x15a)](',\x20'))),0x1;}if(_0x59c1e9){const _0x361187=_0x59c1e9['split'](',')['map'](_0x6176c=>_0x6176c[_0x244010(0x14c)]()[_0x244010(0x126)]());_0x278cb6=_0x278cb6[_0x244010(0x14f)](_0xa37319=>_0xa37319['tags']?.[_0x244010(0x11b)](_0x35970a=>_0x361187[_0x244010(0x108)](_0x35970a[_0x244010(0x126)]())));if(_0x278cb6[_0x244010(0x152)]===0x0){console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x59c1e9));const _0x395867=new Set();return _0x5d64c7[_0x244010(0xe1)]['forEach'](_0x45a58d=>_0x45a58d[_0x244010(0x142)]?.['forEach'](_0x5bdf5a=>_0x395867[_0x244010(0x158)](_0x5bdf5a))),_0x395867['size']>0x0?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)]('Available\x20tags:\x20'+[..._0x395867][_0x244010(0x15a)](',\x20'))):console['log'](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x13f))),0x1;}}if(_0x4c3fbe)return this[_0x244010(0xef)](_0x436a7d,{'definition':{'tests':_0x278cb6},'agentInfo':_0x90876c,'outputFormat':_0x397542,'outputFile':_0x251c33,'testNames':_0x4e2662});if(_0x11faa5){console['log'](a5_0x57ac79[_0x244010(0x145)](_0x244010(0xf3))),console[_0x244010(0x151)](_0x244010(0xf7)+a5_0x57ac79[_0x244010(0xdf)](_0x38de0d)),console[_0x244010(0x151)]('\x20\x20Project:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x90876c['projectName'])),console[_0x244010(0x151)](_0x244010(0x109)+a5_0x57ac79[_0x244010(0xdf)](_0x90876c[_0x244010(0x12e)])),console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0x115)+a5_0x57ac79[_0x244010(0xdf)](_0x278cb6[_0x244010(0x152)]));for(let _0x45e9df=0x0;_0x45e9df<_0x278cb6[_0x244010(0x152)];_0x45e9df++){const _0x53fbd3=_0x278cb6[_0x45e9df],_0x2c3df1=_0x53fbd3['rounds'][_0x244010(0x152)]===0x1?_0x244010(0x102):_0x244010(0x162),_0x2e0184=_0x53fbd3[_0x244010(0x142)]?.[_0x244010(0x152)]?'\x20['+_0x53fbd3[_0x244010(0x142)][_0x244010(0x15a)](',\x20')+']':'';console[_0x244010(0x151)]('\x20\x20'+(_0x45e9df+0x1)+'.\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x53fbd3[_0x244010(0x119)])+'\x20('+_0x53fbd3['rounds'][_0x244010(0x152)]+'\x20'+_0x2c3df1+')'+a5_0x57ac79[_0x244010(0x10c)](_0x2e0184));}return 0x0;}let _0x2a7fe9,_0x22656f;try{_0x2a7fe9=await _0x3d4b86[_0x244010(0x135)][_0x244010(0x140)](_0x90876c[_0x244010(0xea)]);}catch(_0x4a83cb){const _0x54cf33=_0x4a83cb instanceof Error?_0x4a83cb[_0x244010(0x10a)]:String(_0x4a83cb);return _0x54cf33[_0x244010(0x108)]('404')||_0x54cf33[_0x244010(0x126)]()[_0x244010(0x108)](_0x244010(0x155))?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x120)+_0x90876c[_0x244010(0xea)])):console[_0x244010(0x151)](a5_0x57ac79['red'](_0x244010(0xf9)+_0x90876c[_0x244010(0xea)]+'\x22:\x20'+_0x54cf33)),0x1;}try{_0x22656f=await _0x3d4b86['llm']['resolveAgentId'](_0x90876c['agentName'],_0x2a7fe9);}catch(_0x60680b){const _0x52af50=_0x60680b instanceof Error?_0x60680b['message']:String(_0x60680b);return _0x52af50['includes']('404')||_0x52af50[_0x244010(0x126)]()[_0x244010(0x108)]('not\x20found')?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x90876c[_0x244010(0x12e)])):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x90876c[_0x244010(0x12e)]+_0x244010(0xdd)+_0x52af50)),0x1;}let _0x14fcba;if(!_0x2f078b)try{_0x14fcba=await setupEvaluatorAgent(_0x3d4b86[_0x244010(0x135)],_0x5f1f06['verbose']);}catch(_0x20cd43){const _0xd6dda0=_0x20cd43 instanceof Error?_0x20cd43[_0x244010(0x10a)]:String(_0x20cd43);return console['log'](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x11c)+_0xd6dda0)),0x1;}console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x145)](_0x244010(0x121))),console[_0x244010(0x151)]('Site:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x38de0d)),console[_0x244010(0x151)](_0x244010(0xe7)+a5_0x57ac79['white'](_0x90876c[_0x244010(0xea)]+'/'+_0x90876c[_0x244010(0x12e)])),console[_0x244010(0x151)]();const _0x14f855=[],_0x340a5e=[],_0x506291=Date[_0x244010(0x123)]();for(let _0x3c3e29=0x0;_0x3c3e29<_0x278cb6[_0x244010(0x152)];_0x3c3e29++){const _0x5c5e56=_0x278cb6[_0x3c3e29];_0x278cb6[_0x244010(0x152)]>0x1?console[_0x244010(0x151)](_0x244010(0xd4)+(_0x3c3e29+0x1)+'/'+_0x278cb6['length']+':\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x5c5e56['name'])):console[_0x244010(0x151)]('Running\x20test:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x5c5e56[_0x244010(0x119)]));const _0x274895=createCommandSpinner('Round\x201/'+_0x5c5e56['rounds'][_0x244010(0x152)]+_0x244010(0x111));_0x274895[_0x244010(0xfb)]();try{const {result:_0x409913,conversation:_0x2c1135}=await runTest(_0x3d4b86[_0x244010(0x135)],_0x5c5e56,{'agentId':_0x22656f,'projectId':_0x2a7fe9,'site':_0x38de0d,'noEval':_0x2f078b,'evaluatorId':_0x14fcba,'onRoundStart':(_0x25144e,_0x4c039f)=>{const _0x17df44=_0x244010;_0x274895[_0x17df44(0x12c)]=_0x17df44(0xd1)+(_0x25144e+0x1)+'/'+_0x4c039f+_0x17df44(0x111);},'onRoundComplete':(_0x583d6f,_0x2cac35,_0x379bda)=>{const _0x46520b=_0x244010,_0x30e7d4=formatElapsed(_0x2cac35);_0x379bda?console[_0x46520b(0x151)](_0x46520b(0xe3)+(_0x583d6f+0x1)+'/'+_0x5c5e56[_0x46520b(0x162)][_0x46520b(0x152)]+_0x46520b(0xd5)+a5_0x57ac79[_0x46520b(0x104)]('✓')+'\x20('+_0x30e7d4+')'):console[_0x46520b(0x151)](_0x46520b(0xe3)+(_0x583d6f+0x1)+'/'+_0x5c5e56['rounds'][_0x46520b(0x152)]+'...\x20'+a5_0x57ac79[_0x46520b(0x131)]('✗'));},'onEvaluationStart':()=>{const _0xa76980=_0x244010;_0x274895['text']=_0xa76980(0x156);},'onEvaluationComplete':_0x5e9d43=>{const _0x1448d0=_0x244010,_0x1c9a23=formatElapsed(_0x5e9d43);console['log'](_0x1448d0(0xd0)+a5_0x57ac79[_0x1448d0(0x104)]('✓')+'\x20('+_0x1c9a23+')');}});_0x274895[_0x244010(0xd9)](),_0x14f855['push'](_0x409913),_0x340a5e[_0x244010(0x117)](_0x2c1135);if(_0x409913['status']===_0x244010(0x129))console['log'](a5_0x57ac79[_0x244010(0x104)](_0x244010(0x153)+_0x409913[_0x244010(0x164)]));else _0x409913[_0x244010(0x161)]==='FAIL'?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20FAIL:\x20'+_0x409913[_0x244010(0x164)])):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0xe6)+_0x409913[_0x244010(0x164)]));_0x409913[_0x244010(0x15e)]&&console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x103)+_0x409913[_0x244010(0x15e)])),console['log']();}catch(_0x53002d){_0x274895[_0x244010(0xd9)]();const _0x29ecb6=_0x53002d instanceof Error?_0x53002d['message']:String(_0x53002d);console[_0x244010(0x151)](a5_0x57ac79['red'](_0x244010(0xe6)+_0x29ecb6)),console['log'](),_0x14f855['push']({'name':_0x5c5e56[_0x244010(0x119)],'status':'ERROR','reason':_0x29ecb6,'timestamp':new Date()[_0x244010(0x101)](),'duration_ms':0x0});}}const _0x5886f1=Date[_0x244010(0x123)]()-_0x506291,_0x1cdbb3=_0x14f855[_0x244010(0x14f)](_0x48723d=>_0x48723d[_0x244010(0x161)]===_0x244010(0x129))[_0x244010(0x152)],_0x4cb43c=_0x14f855[_0x244010(0x14f)](_0x244ba7=>_0x244ba7[_0x244010(0x161)]===_0x244010(0x13b))[_0x244010(0x152)],_0x226882=_0x14f855[_0x244010(0x14f)](_0x1419f7=>_0x1419f7[_0x244010(0x161)]===_0x244010(0x139))['length'];console[_0x244010(0x151)]('━'[_0x244010(0x107)](0x3c)),console['log'](_0x244010(0xfe)),console[_0x244010(0x151)]('━'['repeat'](0x3c)),console[_0x244010(0x151)](_0x244010(0xff)+_0x14f855['length']),console[_0x244010(0x151)](_0x244010(0x138)+a5_0x57ac79['green'](_0x1cdbb3)),console[_0x244010(0x151)]('Failed:\x20\x20\x20'+a5_0x57ac79['red'](_0x4cb43c));_0x226882>0x0&&console[_0x244010(0x151)]('Errors:\x20\x20\x20'+a5_0x57ac79['red'](_0x226882));console[_0x244010(0x151)](_0x244010(0xe0)+formatElapsed(_0x5886f1)),console[_0x244010(0x151)]('━'[_0x244010(0x107)](0x3c));const _0x207b30=_0x14f855[_0x244010(0x14f)](_0xc2ac2b=>_0xc2ac2b[_0x244010(0x161)]!==_0x244010(0x129));if(_0x207b30[_0x244010(0x152)]>0x0){console['log'](),console['log'](_0x244010(0xf5));for(const _0x45eab7 of _0x207b30){const _0x599303=a5_0x57ac79[_0x244010(0x131)]('✗'),_0x5e2694=_0x45eab7['reason'][_0x244010(0x152)]>0x32?_0x45eab7[_0x244010(0x164)][_0x244010(0x154)](0x0,0x32)+_0x244010(0x134):_0x45eab7[_0x244010(0x164)];console[_0x244010(0x151)]('\x20\x20'+_0x599303+'\x20'+_0x45eab7[_0x244010(0x119)]+':\x20'+_0x5e2694);}}const _0x1fbace={'summary':{'total':_0x14f855[_0x244010(0x152)],'passed':_0x1cdbb3,'failed':_0x4cb43c,'errors':_0x226882>0x0?_0x226882:undefined,'duration_ms':_0x5886f1},'tests':_0x14f855,'agent':{'project':_0x90876c[_0x244010(0xea)],'name':_0x90876c[_0x244010(0x12e)],'site':_0x38de0d},'timestamp':new Date(_0x506291)[_0x244010(0x101)]()};try{const _0x25d040=buildCachedTestRun(_0x340a5e,{'site':_0x38de0d,'projectId':_0x2a7fe9,'projectName':_0x90876c[_0x244010(0xea)],'agentId':_0x22656f,'agentName':_0x90876c[_0x244010(0x12e)],'testYmlPath':a5_0x71a21a[_0x244010(0x13c)](_0x90876c[_0x244010(0xe8)])});saveLastTestRun(_0x25d040);}catch{}if(_0x397542!==_0x244010(0xfa)||_0x251c33){const _0x4c617f=formatResults(_0x1fbace,_0x397542);if(_0x251c33)try{a5_0x5187c7[_0x244010(0x137)](_0x251c33,_0x4c617f,_0x244010(0xfd)),console[_0x244010(0x151)](),console['log'](a5_0x57ac79['dim']('Output\x20written\x20to:\x20'+_0x251c33));}catch(_0x3aebc9){return console[_0x244010(0x151)](),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x13a)+_0x3aebc9)),0x1;}else console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x4c617f);}return _0x207b30[_0x244010(0x152)]>0x0?0x1:0x0;}async[a5_0x1ddf43(0xef)](_0x241587,_0x411730){const _0x15f408=a5_0x1ddf43,{options:_0x453ced,tdx:_0x42abb7}=_0x241587,{definition:_0x1e6233,agentInfo:_0x584b4c,outputFormat:_0x3f3460,outputFile:_0xd6200a}=_0x411730,_0x2b4dad=_0x453ced[_0x15f408(0x141)],_0x32f5e3=loadLastTestRun();if(!_0x32f5e3)return console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x10f))),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x133))),0x1;if(_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0x12e)]!==_0x584b4c[_0x15f408(0x12e)])return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xdb)+_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0x12e)]+_0x15f408(0xf4)+_0x584b4c[_0x15f408(0x12e)]+'\x22.')),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x163))),0x1;const _0xbde1d1=new Set(_0x32f5e3[_0x15f408(0xda)][_0x15f408(0x118)](_0xc14fe7=>_0xc14fe7['testName'])),_0x353cf8=_0x1e6233[_0x15f408(0xe1)][_0x15f408(0x14f)](_0x1b274f=>!_0xbde1d1[_0x15f408(0x15c)](_0x1b274f[_0x15f408(0x119)]));if(_0x353cf8[_0x15f408(0x152)]>0x0&&_0x32f5e3[_0x15f408(0x141)]!==_0x2b4dad)return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xe9))),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x148)+_0x32f5e3[_0x15f408(0x141)]+_0x15f408(0xde)+_0x2b4dad+'\x22.')),console['log'](a5_0x57ac79['dim'](_0x15f408(0xeb)+_0x32f5e3[_0x15f408(0x141)]+_0x15f408(0xd2))),0x1;const _0xb04c4a=_0x1e6233[_0x15f408(0xe1)][_0x15f408(0x14f)](_0x3d68da=>_0xbde1d1[_0x15f408(0x15c)](_0x3d68da[_0x15f408(0x119)])),_0xd20de6=_0x353cf8;let _0x11cf96;try{_0x11cf96=await setupEvaluatorAgent(_0x42abb7[_0x15f408(0x135)],_0x453ced['verbose']);}catch(_0x284719){const _0x17221c=_0x284719 instanceof Error?_0x284719[_0x15f408(0x10a)]:String(_0x284719);return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x11c)+_0x17221c)),0x1;}console['log'](a5_0x57ac79['cyan'](_0x15f408(0x130))),console[_0x15f408(0x151)](_0x15f408(0x114)+a5_0x57ac79[_0x15f408(0xdf)](_0x32f5e3[_0x15f408(0xd3)])),console[_0x15f408(0x151)](_0x15f408(0xe7)+a5_0x57ac79[_0x15f408(0xdf)](_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0xea)]+'/'+_0x32f5e3['agent'][_0x15f408(0x12e)]));_0xd20de6[_0x15f408(0x152)]>0x0&&console[_0x15f408(0x151)]('New\x20tests\x20to\x20execute:\x20'+a5_0x57ac79[_0x15f408(0x12d)](_0xd20de6['length']));console['log']();const _0x14643d=[],_0x46e46d=Date[_0x15f408(0x123)](),_0x52a02b=createCommandSpinner(_0x15f408(0x14a));if(_0xb04c4a[_0x15f408(0x152)]>0x0)try{const _0x3d41d7=await reevaluateFromCache(_0x42abb7[_0x15f408(0x135)],_0x32f5e3,{'tests':_0xb04c4a},{'evaluatorId':_0x11cf96,'onTestStart':(_0x30c47b,_0x44c11,_0x5a3748)=>{const _0x3030f9=_0x15f408;_0x52a02b['text']=_0x3030f9(0x11a)+(_0x44c11+0x1)+'/'+_0x5a3748+':\x20'+_0x30c47b+_0x3030f9(0x134);if(!_0x52a02b[_0x3030f9(0x10e)])_0x52a02b[_0x3030f9(0xfb)]();},'onTestComplete':(_0x1f8307,_0x279373)=>{const _0x396da4=_0x15f408;_0x52a02b['stop']();if(_0x279373[_0x396da4(0x161)]===_0x396da4(0x129))console[_0x396da4(0x151)](a5_0x57ac79[_0x396da4(0x104)]('✓\x20PASS:\x20'+_0x1f8307)+a5_0x57ac79['dim'](_0x396da4(0x12f)));else _0x279373['status']===_0x396da4(0x13b)?console['log'](a5_0x57ac79[_0x396da4(0x131)](_0x396da4(0xf1)+_0x1f8307+_0x396da4(0x128)+_0x279373[_0x396da4(0x164)])+a5_0x57ac79[_0x396da4(0x10c)](_0x396da4(0x12f))):console[_0x396da4(0x151)](a5_0x57ac79['red']('✗\x20ERROR:\x20'+_0x1f8307+_0x396da4(0x128)+_0x279373[_0x396da4(0x164)]));_0x279373[_0x396da4(0x15e)]&&console[_0x396da4(0x151)](a5_0x57ac79[_0x396da4(0x10c)](_0x396da4(0x112)+_0x279373[_0x396da4(0x15e)])),_0x14643d[_0x396da4(0x117)](_0x279373);},'onTestSkipped':(_0x17cc35,_0x46231a)=>{const _0x3d65fd=_0x15f408;_0x52a02b[_0x3d65fd(0xd9)](),console[_0x3d65fd(0x151)](a5_0x57ac79[_0x3d65fd(0x12d)](_0x3d65fd(0x159)+_0x17cc35+_0x3d65fd(0x128)+_0x46231a));}});for(const _0x2bd7ad of _0x3d41d7){!_0x14643d['find'](_0x3b2546=>_0x3b2546['name']===_0x2bd7ad[_0x15f408(0x119)])&&_0x14643d[_0x15f408(0x117)](_0x2bd7ad);}}catch(_0x308e5b){_0x52a02b['stop']();const _0x2c398e=_0x308e5b instanceof Error?_0x308e5b[_0x15f408(0x10a)]:String(_0x308e5b);return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xee)+_0x2c398e)),0x1;}_0x52a02b['stop']();if(_0xd20de6[_0x15f408(0x152)]>0x0){console[_0x15f408(0x151)](),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x145)](_0x15f408(0x14d)));const {projectId:_0x527c39,agentId:_0x4f439c}=_0x32f5e3[_0x15f408(0xf8)];for(const _0x4a3583 of _0xd20de6){console[_0x15f408(0x151)](_0x15f408(0x15f)+a5_0x57ac79['white'](_0x4a3583['name']));const _0x1fba74=createCommandSpinner(_0x15f408(0xd7)+_0x4a3583[_0x15f408(0x162)][_0x15f408(0x152)]+_0x15f408(0x111));_0x1fba74['start']();try{const {result:_0x49fb99}=await runTest(_0x42abb7[_0x15f408(0x135)],_0x4a3583,{'agentId':_0x4f439c,'projectId':_0x527c39,'site':_0x32f5e3['site'],'noEval':![],'evaluatorId':_0x11cf96,'onRoundStart':(_0x4e5412,_0x2b6acd)=>{const _0x3594d2=_0x15f408;_0x1fba74[_0x3594d2(0x12c)]=_0x3594d2(0xd1)+(_0x4e5412+0x1)+'/'+_0x2b6acd+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4b2996,_0x3fbe15,_0x4d0ba1)=>{const _0x527d31=_0x15f408,_0x20283d=formatElapsed(_0x3fbe15);_0x4d0ba1?console[_0x527d31(0x151)](_0x527d31(0xe3)+(_0x4b2996+0x1)+'/'+_0x4a3583[_0x527d31(0x162)][_0x527d31(0x152)]+_0x527d31(0xd5)+a5_0x57ac79[_0x527d31(0x104)]('✓')+'\x20('+_0x20283d+')'):console[_0x527d31(0x151)]('\x20\x20Round\x20'+(_0x4b2996+0x1)+'/'+_0x4a3583['rounds'][_0x527d31(0x152)]+'...\x20'+a5_0x57ac79['red']('✗'));},'onEvaluationStart':()=>{const _0x13f9e6=_0x15f408;_0x1fba74[_0x13f9e6(0x12c)]=_0x13f9e6(0x156);},'onEvaluationComplete':_0x36ff56=>{const _0x24ac42=_0x15f408,_0x268e6c=formatElapsed(_0x36ff56);console['log'](_0x24ac42(0xd0)+a5_0x57ac79['green']('✓')+'\x20('+_0x268e6c+')');}});_0x1fba74[_0x15f408(0xd9)](),_0x14643d[_0x15f408(0x117)](_0x49fb99);if(_0x49fb99[_0x15f408(0x161)]===_0x15f408(0x129))console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x104)](_0x15f408(0x153)+_0x49fb99[_0x15f408(0x164)])+a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x10b)));else _0x49fb99['status']===_0x15f408(0x13b)?console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xf1)+_0x49fb99[_0x15f408(0x164)])+a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x10b))):console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xe6)+_0x49fb99[_0x15f408(0x164)]));_0x49fb99[_0x15f408(0x15e)]&&console[_0x15f408(0x151)](a5_0x57ac79['dim'](_0x15f408(0x112)+_0x49fb99[_0x15f408(0x15e)]));}catch(_0x3c9f05){_0x1fba74[_0x15f408(0xd9)]();const _0x54ab9b=_0x3c9f05 instanceof Error?_0x3c9f05[_0x15f408(0x10a)]:String(_0x3c9f05);console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)]('✗\x20ERROR:\x20'+_0x54ab9b)),_0x14643d['push']({'name':_0x4a3583[_0x15f408(0x119)],'status':_0x15f408(0x139),'reason':_0x54ab9b,'timestamp':new Date()[_0x15f408(0x101)](),'duration_ms':0x0});}}}console[_0x15f408(0x151)]();const _0x9ffa0f=Date['now']()-_0x46e46d,_0x5d41e5=_0x14643d[_0x15f408(0x14f)](_0x28cccb=>_0x28cccb[_0x15f408(0x161)]==='PASS')[_0x15f408(0x152)],_0xb37796=_0x14643d[_0x15f408(0x14f)](_0x307ee6=>_0x307ee6[_0x15f408(0x161)]===_0x15f408(0x13b))[_0x15f408(0x152)],_0x29adfc=_0x14643d[_0x15f408(0x14f)](_0x16abc2=>_0x16abc2['status']==='ERROR')[_0x15f408(0x152)];console[_0x15f408(0x151)]('━'[_0x15f408(0x107)](0x3c)),console[_0x15f408(0x151)](_0x15f408(0xd8)),console['log']('━'[_0x15f408(0x107)](0x3c)),console[_0x15f408(0x151)]('Total:\x20\x20\x20\x20'+_0x14643d[_0x15f408(0x152)]),console[_0x15f408(0x151)](_0x15f408(0x138)+a5_0x57ac79[_0x15f408(0x104)](_0x5d41e5)),console['log'](_0x15f408(0x13d)+a5_0x57ac79[_0x15f408(0x131)](_0xb37796));_0x29adfc>0x0&&console['log'](_0x15f408(0x149)+a5_0x57ac79[_0x15f408(0x131)](_0x29adfc));console[_0x15f408(0x151)](_0x15f408(0xe0)+formatElapsed(_0x9ffa0f)),console[_0x15f408(0x151)]('━'[_0x15f408(0x107)](0x3c));const _0x55169f={'summary':{'total':_0x14643d[_0x15f408(0x152)],'passed':_0x5d41e5,'failed':_0xb37796,'errors':_0x29adfc>0x0?_0x29adfc:undefined,'duration_ms':_0x9ffa0f},'tests':_0x14643d,'agent':{'project':_0x584b4c[_0x15f408(0xea)],'name':_0x584b4c['agentName'],'site':_0x2b4dad},'timestamp':new Date(_0x46e46d)['toISOString']()};if(_0x3f3460!==_0x15f408(0xfa)||_0xd6200a){const _0x4389df=formatResults(_0x55169f,_0x3f3460);if(_0xd6200a)try{a5_0x5187c7[_0x15f408(0x137)](_0xd6200a,_0x4389df,_0x15f408(0xfd)),console['log'](),console['log'](a5_0x57ac79['dim'](_0x15f408(0x106)+_0xd6200a));}catch(_0x542f52){return console['log'](),console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x13a)+_0x542f52)),0x1;}else console[_0x15f408(0x151)](),console[_0x15f408(0x151)](_0x4389df);}const _0x4d3806=_0x14643d[_0x15f408(0x14f)](_0x58fbed=>_0x58fbed[_0x15f408(0x161)]!==_0x15f408(0x129));return _0x4d3806['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x47f9d3=a5_0x49ad;(function(_0x1c9f49,_0x39c767){const _0x5e3c3e=a5_0x49ad,_0x1b54e4=_0x1c9f49();while(!![]){try{const _0x10439c=-parseInt(_0x5e3c3e(0x21f))/0x1*(parseInt(_0x5e3c3e(0x1ce))/0x2)+parseInt(_0x5e3c3e(0x213))/0x3+parseInt(_0x5e3c3e(0x1a7))/0x4+parseInt(_0x5e3c3e(0x19a))/0x5+parseInt(_0x5e3c3e(0x205))/0x6+-parseInt(_0x5e3c3e(0x1d8))/0x7*(parseInt(_0x5e3c3e(0x201))/0x8)+-parseInt(_0x5e3c3e(0x190))/0x9;if(_0x10439c===_0x39c767)break;else _0x1b54e4['push'](_0x1b54e4['shift']());}catch(_0x290d27){_0x1b54e4['push'](_0x1b54e4['shift']());}}}(a5_0x281e,0xc0d08));import*as a5_0x167cab from'node:fs';import*as a5_0x390382 from'node:path';function a5_0x281e(){const _0x48a620=['red','Cached\x20run\x20is\x20from\x20site\x20\x22','\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)','\x20(cached)','Error\x20writing\x20output\x20file:\x20','yellow','3362256tTLTyU','start','trim','Evaluating\x20response...','Project\x20path:\x20','dryRun','has','size','/<agent-name>','description','3618585HcYXDX','repeat','reeval','Executing\x20new\x20tests...','timestamp','Passed:\x20\x20\x20','add','executeReeval','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20-\x20','New\x20tests\x20to\x20execute:\x20','agentName','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','4839964ZNSfpe','Running\x20agent\x20tests...','filter','Failed\x20Tests:','includes','Cached\x20run\x20from:\x20','Errors:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Available\x20tests:\x20','Duration:\x20','multiple_agents','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','verbose','no_tests','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','white','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','output','\x22:\x20','Failed:\x20\x20\x20','\x20\x20Site:\x20','status','llmProject','found','\x27\x20to\x20create\x20the\x20folder\x20structure.','find','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','✗\x20FAIL:\x20','\x20\x20Agent:\x20','⚠\x20SKIPPED:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Usage:','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','execute','map','\x20(new)','writeFileSync','text','dim','2NoQpEt','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','isSpinning','agent:test','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','PASS','agentDirs','testName','✓\x20PASS:\x20','resolveAgentId','8607011hftRge','ERROR','not\x20found','no_context','FAIL','agent','Round\x20','testYmlPath','Re-evaluation\x20Summary',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','name','forEach','now','projectDir','rounds','round','...\x20','Either\x20switch\x20to\x20the\x20\x22','context','Tests\x20found:\x20','utf-8','Using\x20agent:\x20','Available\x20tags:\x20','site','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20','Re-evaluating...','\x20\x20Project:\x20','No\x20tests\x20found\x20with\x20tags:\x20','resolveProjectId','conversations','\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','404','tsv','log','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','jsonl','projectName','tests','No\x20tests\x20found\x20matching:\x20','8rCNdsA','resolve','toISOString','Run\x20\x27tdx\x20agent\x20pull\x20','7653816hDPJZs','push','message','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Round\x201/','...','\x22,\x20but\x20current\x20site\x20is\x20\x22','Running:\x20','stop','Conversation\x20URL:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Run\x20tests\x20for\x20an\x20LLM\x20agent','Agent:\x20','759411cRuAZq','tags','cyan','Output\x20written\x20to:\x20','conversation_url','\x20\x20Evaluating...\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','toLowerCase','length','reason','\x20\x20Round\x20','Re-evaluating\x20','1069556PatAFX','table','llm','green','split','source'];a5_0x281e=function(){return _0x48a620;};return a5_0x281e();}import a5_0x28a5ef 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_0x49ad(_0x510f2,_0x5a8229){_0x510f2=_0x510f2-0x18c;const _0x281e64=a5_0x281e();let _0x49ad17=_0x281e64[_0x510f2];return _0x49ad17;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x47f9d3(0x1e3)]=a5_0x47f9d3(0x1d1);[a5_0x47f9d3(0x199)]=a5_0x47f9d3(0x211);async[a5_0x47f9d3(0x1c8)](_0x1be806){const _0x24a035=a5_0x47f9d3,{options:_0x1534b5,args:_0x39fa35,tdx:_0x4331c8}=_0x1be806,_0x406182=_0x39fa35[0x0]||'.',_0x5285b4=_0x1534b5[_0x24a035(0x195)],_0x2a761c=_0x1534b5,_0x146035=_0x2a761c['eval']===![],_0x52e8fa=_0x2a761c[_0x24a035(0x19c)],_0xef6be7=_0x2a761c['name'],_0x495acb=_0x2a761c[_0x24a035(0x214)],_0x5f0856=_0x1534b5[_0x24a035(0x1f0)],_0x9a92f2=_0x2a761c[_0x24a035(0x1b8)];if(_0x52e8fa&&_0x146035)return console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x1ae))),0x1;let _0x1ea2ae=_0x24a035(0x220);if(_0x2a761c['json'])_0x1ea2ae='json';else{if(_0x2a761c[_0x24a035(0x1fd)])_0x1ea2ae='jsonl';else{if(_0x2a761c[_0x24a035(0x1fa)])_0x1ea2ae=_0x24a035(0x1fa);else{if(_0x2a761c['table'])_0x1ea2ae=_0x24a035(0x220);}}}const _0xc7fd9d=_0x2a761c[_0x24a035(0x1bd)];let _0x17bb7d=_0x406182;const _0x3f99ad=a5_0x167cab['existsSync'](_0x406182),_0x29c631=_0x406182==='.';if(!_0x3f99ad||_0x29c631){const _0x537f42=resolveProjectFromContext(_0x406182,_0xc7fd9d,{'requireFile':'test.yml'});if(_0x537f42[_0x24a035(0x1be)])_0x17bb7d=_0x537f42[_0x24a035(0x1e6)],_0x537f42[_0x24a035(0x224)]===_0x24a035(0x1eb)&&console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x1cd)](_0x24a035(0x1ee)+_0x17bb7d));else switch(_0x537f42['reason']){case _0x24a035(0x1db):console['log'](a5_0x28a5ef[_0x24a035(0x18f)](_0x537f42[_0x24a035(0x207)])),console[_0x24a035(0x1fb)](),console['log'](_0x24a035(0x1c6)),console[_0x24a035(0x1fb)](_0x24a035(0x1f8)),console['log'](_0x24a035(0x18c)),console['log'](),console[_0x24a035(0x1fb)](_0x24a035(0x210));return 0x1;case'no_local_folder':console['log'](a5_0x28a5ef['yellow'](_0x537f42[_0x24a035(0x207)])),console[_0x24a035(0x1fb)](),console[_0x24a035(0x1fb)](_0x24a035(0x204)+_0x537f42[_0x24a035(0x1bd)]+_0x24a035(0x1bf));return 0x1;case _0x24a035(0x1b1):{const _0x29e677=a5_0x390382['basename'](_0x537f42[_0x24a035(0x1e6)]);console['log'](a5_0x28a5ef['yellow'](_0x24a035(0x219)+_0x537f42[_0x24a035(0x1bd)]+'\x22:'));for(const _0x557708 of _0x537f42[_0x24a035(0x1d4)]){console['log']('\x20\x20-\x20'+_0x557708);}return console[_0x24a035(0x1fb)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x29e677+_0x24a035(0x198)),0x1;}case _0x24a035(0x1b4):console['log'](a5_0x28a5ef[_0x24a035(0x18f)](_0x24a035(0x1cf)+_0x537f42['llmProject']+'\x22.')),console[_0x24a035(0x1fb)](a5_0x28a5ef['dim'](_0x24a035(0x194)+_0x537f42['projectDir'])),console[_0x24a035(0x1fb)](),console[_0x24a035(0x1fb)](_0x24a035(0x1b2));return 0x1;}}const {definition:_0x106678,agentInfo:_0x129700}=parseTestFile(_0x17bb7d);let _0x52a2f9=_0x106678[_0x24a035(0x1ff)];if(_0xef6be7){const _0x30b2e3=_0xef6be7['split'](',')[_0x24a035(0x1c9)](_0x4cc86c=>_0x4cc86c[_0x24a035(0x192)]());_0x52a2f9=_0x106678[_0x24a035(0x1ff)][_0x24a035(0x1a9)](_0x1d0531=>_0x30b2e3['includes'](_0x1d0531[_0x24a035(0x1e3)]));if(_0x52a2f9[_0x24a035(0x21b)]===0x0)return console['log'](a5_0x28a5ef[_0x24a035(0x18f)](_0x24a035(0x200)+_0xef6be7)),console['log'](a5_0x28a5ef[_0x24a035(0x1cd)](_0x24a035(0x1af)+_0x106678[_0x24a035(0x1ff)][_0x24a035(0x1c9)](_0x40ed9f=>_0x40ed9f[_0x24a035(0x1e3)])['join'](',\x20'))),0x1;}if(_0x495acb){const _0x5128a1=_0x495acb[_0x24a035(0x223)](',')[_0x24a035(0x1c9)](_0x17b5bb=>_0x17b5bb['trim']()[_0x24a035(0x21a)]());_0x52a2f9=_0x52a2f9['filter'](_0x1c5b54=>_0x1c5b54['tags']?.['some'](_0x3daaaf=>_0x5128a1[_0x24a035(0x1ab)](_0x3daaaf[_0x24a035(0x21a)]())));if(_0x52a2f9[_0x24a035(0x21b)]===0x0){console['log'](a5_0x28a5ef['yellow'](_0x24a035(0x1f5)+_0x495acb));const _0x1ea98a=new Set();return _0x106678['tests'][_0x24a035(0x1e4)](_0x10bc15=>_0x10bc15['tags']?.[_0x24a035(0x1e4)](_0x3989ad=>_0x1ea98a[_0x24a035(0x1a0)](_0x3989ad))),_0x1ea98a[_0x24a035(0x197)]>0x0?console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x1cd)](_0x24a035(0x1ef)+[..._0x1ea98a]['join'](',\x20'))):console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x1cd)](_0x24a035(0x1f1))),0x1;}}if(_0x52e8fa)return this[_0x24a035(0x1a1)](_0x1be806,{'definition':{'tests':_0x52a2f9},'agentInfo':_0x129700,'outputFormat':_0x1ea2ae,'outputFile':_0x9a92f2,'testNames':_0xef6be7});if(_0x5285b4){console['log'](a5_0x28a5ef[_0x24a035(0x215)]('Test\x20Configuration:')),console['log'](_0x24a035(0x1bb)+a5_0x28a5ef[_0x24a035(0x1b6)](_0x5f0856)),console['log'](_0x24a035(0x1f4)+a5_0x28a5ef[_0x24a035(0x1b6)](_0x129700[_0x24a035(0x1fe)])),console[_0x24a035(0x1fb)](_0x24a035(0x1c3)+a5_0x28a5ef['white'](_0x129700[_0x24a035(0x1a5)])),console[_0x24a035(0x1fb)](),console[_0x24a035(0x1fb)](_0x24a035(0x1ec)+a5_0x28a5ef['white'](_0x52a2f9[_0x24a035(0x21b)]));for(let _0x1ec49b=0x0;_0x1ec49b<_0x52a2f9[_0x24a035(0x21b)];_0x1ec49b++){const _0x155f38=_0x52a2f9[_0x1ec49b],_0x3b2096=_0x155f38[_0x24a035(0x1e7)][_0x24a035(0x21b)]===0x1?_0x24a035(0x1e8):_0x24a035(0x1e7),_0x36e116=_0x155f38[_0x24a035(0x214)]?.['length']?'\x20['+_0x155f38[_0x24a035(0x214)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x1ec49b+0x1)+'.\x20'+a5_0x28a5ef[_0x24a035(0x1b6)](_0x155f38[_0x24a035(0x1e3)])+'\x20('+_0x155f38['rounds'][_0x24a035(0x21b)]+'\x20'+_0x3b2096+')'+a5_0x28a5ef[_0x24a035(0x1cd)](_0x36e116));}return 0x0;}let _0x3508aa,_0x49bc4d;try{_0x3508aa=await _0x4331c8[_0x24a035(0x221)][_0x24a035(0x1f6)](_0x129700[_0x24a035(0x1fe)]);}catch(_0x2b0f36){const _0x4ea53e=_0x2b0f36 instanceof Error?_0x2b0f36[_0x24a035(0x207)]:String(_0x2b0f36);return _0x4ea53e[_0x24a035(0x1ab)](_0x24a035(0x1f9))||_0x4ea53e[_0x24a035(0x21a)]()['includes']('not\x20found')?console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x20f)+_0x129700['projectName'])):console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x1c1)+_0x129700['projectName']+'\x22:\x20'+_0x4ea53e)),0x1;}try{_0x49bc4d=await _0x4331c8['llm'][_0x24a035(0x1d7)](_0x129700['agentName'],_0x3508aa);}catch(_0x635109){const _0x3d0d0d=_0x635109 instanceof Error?_0x635109[_0x24a035(0x207)]:String(_0x635109);return _0x3d0d0d['includes'](_0x24a035(0x1f9))||_0x3d0d0d[_0x24a035(0x21a)]()[_0x24a035(0x1ab)](_0x24a035(0x1da))?console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x1fc)+_0x129700[_0x24a035(0x1a5)])):console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x1b7)+_0x129700[_0x24a035(0x1a5)]+_0x24a035(0x1b9)+_0x3d0d0d)),0x1;}let _0x23183d;if(!_0x146035)try{_0x23183d=await setupEvaluatorAgent(_0x4331c8[_0x24a035(0x221)],_0x1534b5[_0x24a035(0x1b3)]);}catch(_0x51107f){const _0x386b32=_0x51107f instanceof Error?_0x51107f['message']:String(_0x51107f);return console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x1b5)+_0x386b32)),0x1;}console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x215)](_0x24a035(0x1a8))),console[_0x24a035(0x1fb)]('Site:\x20'+a5_0x28a5ef[_0x24a035(0x1b6)](_0x5f0856)),console[_0x24a035(0x1fb)](_0x24a035(0x212)+a5_0x28a5ef[_0x24a035(0x1b6)](_0x129700['projectName']+'/'+_0x129700['agentName'])),console[_0x24a035(0x1fb)]();const _0x16ac3c=[],_0x1b288e=[],_0x54ade0=Date['now']();for(let _0x24eb85=0x0;_0x24eb85<_0x52a2f9['length'];_0x24eb85++){const _0x3f3205=_0x52a2f9[_0x24eb85];_0x52a2f9[_0x24a035(0x21b)]>0x1?console[_0x24a035(0x1fb)]('Test\x20'+(_0x24eb85+0x1)+'/'+_0x52a2f9[_0x24a035(0x21b)]+':\x20'+a5_0x28a5ef[_0x24a035(0x1b6)](_0x3f3205['name'])):console[_0x24a035(0x1fb)]('Running\x20test:\x20'+a5_0x28a5ef[_0x24a035(0x1b6)](_0x3f3205[_0x24a035(0x1e3)]));const _0x24e6d2=createCommandSpinner('Round\x201/'+_0x3f3205[_0x24a035(0x1e7)][_0x24a035(0x21b)]+_0x24a035(0x1e1));_0x24e6d2[_0x24a035(0x191)]();try{const {result:_0x15b029,conversation:_0x2ce439}=await runTest(_0x4331c8['llm'],_0x3f3205,{'agentId':_0x49bc4d,'projectId':_0x3508aa,'site':_0x5f0856,'noEval':_0x146035,'evaluatorId':_0x23183d,'onRoundStart':(_0x10b874,_0x14b2af)=>{const _0x307cfb=_0x24a035;_0x24e6d2['text']=_0x307cfb(0x1de)+(_0x10b874+0x1)+'/'+_0x14b2af+_0x307cfb(0x1e1);},'onRoundComplete':(_0x4d0a28,_0x6d165d,_0x3775a2)=>{const _0xa877a0=_0x24a035,_0x510aa7=formatElapsed(_0x6d165d);_0x3775a2?console[_0xa877a0(0x1fb)](_0xa877a0(0x21d)+(_0x4d0a28+0x1)+'/'+_0x3f3205[_0xa877a0(0x1e7)][_0xa877a0(0x21b)]+_0xa877a0(0x1e9)+a5_0x28a5ef[_0xa877a0(0x222)]('✓')+'\x20('+_0x510aa7+')'):console['log']('\x20\x20Round\x20'+(_0x4d0a28+0x1)+'/'+_0x3f3205[_0xa877a0(0x1e7)]['length']+_0xa877a0(0x1e9)+a5_0x28a5ef['red']('✗'));},'onEvaluationStart':()=>{const _0x223620=_0x24a035;_0x24e6d2[_0x223620(0x1cc)]='Evaluating\x20response...';},'onEvaluationComplete':_0x324e1d=>{const _0x427312=_0x24a035,_0x17b4f0=formatElapsed(_0x324e1d);console['log'](_0x427312(0x218)+a5_0x28a5ef[_0x427312(0x222)]('✓')+'\x20('+_0x17b4f0+')');}});_0x24e6d2[_0x24a035(0x20d)](),_0x16ac3c['push'](_0x15b029),_0x1b288e[_0x24a035(0x206)](_0x2ce439);if(_0x15b029[_0x24a035(0x1bc)]==='PASS')console['log'](a5_0x28a5ef[_0x24a035(0x222)](_0x24a035(0x1d6)+_0x15b029['reason']));else _0x15b029[_0x24a035(0x1bc)]===_0x24a035(0x1dc)?console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x1c2)+_0x15b029['reason'])):console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)](_0x24a035(0x1f2)+_0x15b029[_0x24a035(0x21c)]));_0x15b029[_0x24a035(0x217)]&&console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x1cd)](_0x24a035(0x20e)+_0x15b029[_0x24a035(0x217)])),console[_0x24a035(0x1fb)]();}catch(_0x5571e5){_0x24e6d2[_0x24a035(0x20d)]();const _0x3e6fd1=_0x5571e5 instanceof Error?_0x5571e5['message']:String(_0x5571e5);console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x225)]('✗\x20ERROR:\x20'+_0x3e6fd1)),console['log'](),_0x16ac3c[_0x24a035(0x206)]({'name':_0x3f3205[_0x24a035(0x1e3)],'status':_0x24a035(0x1d9),'reason':_0x3e6fd1,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x4892f4=Date[_0x24a035(0x1e5)]()-_0x54ade0,_0x2cf1ec=_0x16ac3c[_0x24a035(0x1a9)](_0x3c9908=>_0x3c9908[_0x24a035(0x1bc)]===_0x24a035(0x1d3))[_0x24a035(0x21b)],_0x4c9486=_0x16ac3c['filter'](_0xd27904=>_0xd27904[_0x24a035(0x1bc)]===_0x24a035(0x1dc))[_0x24a035(0x21b)],_0x5ee2c9=_0x16ac3c[_0x24a035(0x1a9)](_0x5eaf29=>_0x5eaf29[_0x24a035(0x1bc)]===_0x24a035(0x1d9))[_0x24a035(0x21b)];console[_0x24a035(0x1fb)]('━'[_0x24a035(0x19b)](0x3c)),console[_0x24a035(0x1fb)]('Test\x20Summary'),console[_0x24a035(0x1fb)]('━'[_0x24a035(0x19b)](0x3c)),console[_0x24a035(0x1fb)]('Total:\x20\x20\x20\x20'+_0x16ac3c['length']),console['log'](_0x24a035(0x19f)+a5_0x28a5ef[_0x24a035(0x222)](_0x2cf1ec)),console[_0x24a035(0x1fb)](_0x24a035(0x1ba)+a5_0x28a5ef[_0x24a035(0x225)](_0x4c9486));_0x5ee2c9>0x0&&console[_0x24a035(0x1fb)]('Errors:\x20\x20\x20'+a5_0x28a5ef['red'](_0x5ee2c9));console[_0x24a035(0x1fb)]('Duration:\x20'+formatElapsed(_0x4892f4)),console[_0x24a035(0x1fb)]('━'[_0x24a035(0x19b)](0x3c));const _0x135aa2=_0x16ac3c[_0x24a035(0x1a9)](_0x2fa054=>_0x2fa054[_0x24a035(0x1bc)]!==_0x24a035(0x1d3));if(_0x135aa2[_0x24a035(0x21b)]>0x0){console[_0x24a035(0x1fb)](),console['log'](_0x24a035(0x1aa));for(const _0x147222 of _0x135aa2){const _0x5eef91=a5_0x28a5ef[_0x24a035(0x225)]('✗'),_0x1b5580=_0x147222['reason'][_0x24a035(0x21b)]>0x32?_0x147222[_0x24a035(0x21c)]['substring'](0x0,0x32)+_0x24a035(0x20a):_0x147222[_0x24a035(0x21c)];console['log']('\x20\x20'+_0x5eef91+'\x20'+_0x147222[_0x24a035(0x1e3)]+':\x20'+_0x1b5580);}}const _0x2705f4={'summary':{'total':_0x16ac3c[_0x24a035(0x21b)],'passed':_0x2cf1ec,'failed':_0x4c9486,'errors':_0x5ee2c9>0x0?_0x5ee2c9:undefined,'duration_ms':_0x4892f4},'tests':_0x16ac3c,'agent':{'project':_0x129700[_0x24a035(0x1fe)],'name':_0x129700['agentName'],'site':_0x5f0856},'timestamp':new Date(_0x54ade0)['toISOString']()};try{const _0x5ce5c0=buildCachedTestRun(_0x1b288e,{'site':_0x5f0856,'projectId':_0x3508aa,'projectName':_0x129700[_0x24a035(0x1fe)],'agentId':_0x49bc4d,'agentName':_0x129700[_0x24a035(0x1a5)],'testYmlPath':a5_0x390382[_0x24a035(0x202)](_0x129700[_0x24a035(0x1df)])});saveLastTestRun(_0x5ce5c0);}catch{}if(_0x1ea2ae!==_0x24a035(0x220)||_0x9a92f2){const _0x4b6679=formatResults(_0x2705f4,_0x1ea2ae);if(_0x9a92f2)try{a5_0x167cab[_0x24a035(0x1cb)](_0x9a92f2,_0x4b6679,_0x24a035(0x1ed)),console[_0x24a035(0x1fb)](),console[_0x24a035(0x1fb)](a5_0x28a5ef[_0x24a035(0x1cd)]('Output\x20written\x20to:\x20'+_0x9a92f2));}catch(_0x5e301b){return console[_0x24a035(0x1fb)](),console['log'](a5_0x28a5ef[_0x24a035(0x225)]('Error\x20writing\x20output\x20file:\x20'+_0x5e301b)),0x1;}else console['log'](),console[_0x24a035(0x1fb)](_0x4b6679);}return _0x135aa2[_0x24a035(0x21b)]>0x0?0x1:0x0;}async[a5_0x47f9d3(0x1a1)](_0x11b6cb,_0x16c8a5){const _0x1fbbe0=a5_0x47f9d3,{options:_0x9261d8,tdx:_0x3beddc}=_0x11b6cb,{definition:_0x2c50d5,agentInfo:_0x2fcb58,outputFormat:_0x222146,outputFile:_0x13bd7f}=_0x16c8a5,_0x413995=_0x9261d8[_0x1fbbe0(0x1f0)],_0x11ea6f=loadLastTestRun();if(!_0x11ea6f)return console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x225)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x1cd)](_0x1fbbe0(0x1a2))),0x1;if(_0x11ea6f[_0x1fbbe0(0x1dd)][_0x1fbbe0(0x1a5)]!==_0x2fcb58['agentName'])return console['log'](a5_0x28a5ef[_0x1fbbe0(0x225)](_0x1fbbe0(0x1a6)+_0x11ea6f['agent'][_0x1fbbe0(0x1a5)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x2fcb58[_0x1fbbe0(0x1a5)]+'\x22.')),console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x1cd)](_0x1fbbe0(0x208))),0x1;const _0x206b39=new Set(_0x11ea6f[_0x1fbbe0(0x1f7)][_0x1fbbe0(0x1c9)](_0x5a7e5a=>_0x5a7e5a[_0x1fbbe0(0x1d5)])),_0x85179b=_0x2c50d5[_0x1fbbe0(0x1ff)]['filter'](_0x20200c=>!_0x206b39[_0x1fbbe0(0x196)](_0x20200c[_0x1fbbe0(0x1e3)]));if(_0x85179b[_0x1fbbe0(0x21b)]>0x0&&_0x11ea6f[_0x1fbbe0(0x1f0)]!==_0x413995)return console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x225)](_0x1fbbe0(0x1c5))),console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x1cd)](_0x1fbbe0(0x226)+_0x11ea6f['site']+_0x1fbbe0(0x20b)+_0x413995+'\x22.')),console[_0x1fbbe0(0x1fb)](a5_0x28a5ef['dim'](_0x1fbbe0(0x1ea)+_0x11ea6f['site']+_0x1fbbe0(0x1c7))),0x1;const _0x21972a=_0x2c50d5[_0x1fbbe0(0x1ff)][_0x1fbbe0(0x1a9)](_0x4d5ae9=>_0x206b39['has'](_0x4d5ae9['name'])),_0x417aa9=_0x85179b;let _0x2b75ba;try{_0x2b75ba=await setupEvaluatorAgent(_0x3beddc['llm'],_0x9261d8[_0x1fbbe0(0x1b3)]);}catch(_0x5e2d28){const _0x4eb424=_0x5e2d28 instanceof Error?_0x5e2d28['message']:String(_0x5e2d28);return console['log'](a5_0x28a5ef[_0x1fbbe0(0x225)](_0x1fbbe0(0x1b5)+_0x4eb424)),0x1;}console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x215)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1fbbe0(0x1fb)](_0x1fbbe0(0x1ac)+a5_0x28a5ef[_0x1fbbe0(0x1b6)](_0x11ea6f[_0x1fbbe0(0x19e)])),console[_0x1fbbe0(0x1fb)](_0x1fbbe0(0x212)+a5_0x28a5ef[_0x1fbbe0(0x1b6)](_0x11ea6f[_0x1fbbe0(0x1dd)][_0x1fbbe0(0x1fe)]+'/'+_0x11ea6f[_0x1fbbe0(0x1dd)][_0x1fbbe0(0x1a5)]));_0x417aa9['length']>0x0&&console['log'](_0x1fbbe0(0x1a4)+a5_0x28a5ef['yellow'](_0x417aa9[_0x1fbbe0(0x21b)]));console['log']();const _0x2a45d1=[],_0x49aced=Date['now'](),_0x184002=createCommandSpinner(_0x1fbbe0(0x1f3));if(_0x21972a[_0x1fbbe0(0x21b)]>0x0)try{const _0x5a38fc=await reevaluateFromCache(_0x3beddc[_0x1fbbe0(0x221)],_0x11ea6f,{'tests':_0x21972a},{'evaluatorId':_0x2b75ba,'onTestStart':(_0xa5e27c,_0xdbb9b5,_0x35830f)=>{const _0x13426a=_0x1fbbe0;_0x184002[_0x13426a(0x1cc)]=_0x13426a(0x21e)+(_0xdbb9b5+0x1)+'/'+_0x35830f+':\x20'+_0xa5e27c+_0x13426a(0x20a);if(!_0x184002[_0x13426a(0x1d0)])_0x184002[_0x13426a(0x191)]();},'onTestComplete':(_0x526fde,_0x52e9e8)=>{const _0x441a7b=_0x1fbbe0;_0x184002[_0x441a7b(0x20d)]();if(_0x52e9e8[_0x441a7b(0x1bc)]==='PASS')console['log'](a5_0x28a5ef[_0x441a7b(0x222)](_0x441a7b(0x1d6)+_0x526fde)+a5_0x28a5ef[_0x441a7b(0x1cd)]('\x20(cached)'));else _0x52e9e8[_0x441a7b(0x1bc)]===_0x441a7b(0x1dc)?console['log'](a5_0x28a5ef['red'](_0x441a7b(0x1c2)+_0x526fde+_0x441a7b(0x1a3)+_0x52e9e8[_0x441a7b(0x21c)])+a5_0x28a5ef[_0x441a7b(0x1cd)](_0x441a7b(0x18d))):console['log'](a5_0x28a5ef['red']('✗\x20ERROR:\x20'+_0x526fde+_0x441a7b(0x1a3)+_0x52e9e8[_0x441a7b(0x21c)]));_0x52e9e8[_0x441a7b(0x217)]&&console[_0x441a7b(0x1fb)](a5_0x28a5ef['dim'](_0x441a7b(0x1e2)+_0x52e9e8[_0x441a7b(0x217)])),_0x2a45d1[_0x441a7b(0x206)](_0x52e9e8);},'onTestSkipped':(_0x44a038,_0x1a4203)=>{const _0x3677a9=_0x1fbbe0;_0x184002[_0x3677a9(0x20d)](),console[_0x3677a9(0x1fb)](a5_0x28a5ef[_0x3677a9(0x18f)](_0x3677a9(0x1c4)+_0x44a038+_0x3677a9(0x1a3)+_0x1a4203));}});for(const _0x302f5e of _0x5a38fc){!_0x2a45d1[_0x1fbbe0(0x1c0)](_0x1afa0a=>_0x1afa0a[_0x1fbbe0(0x1e3)]===_0x302f5e[_0x1fbbe0(0x1e3)])&&_0x2a45d1[_0x1fbbe0(0x206)](_0x302f5e);}}catch(_0x5a1cd5){_0x184002[_0x1fbbe0(0x20d)]();const _0x325259=_0x5a1cd5 instanceof Error?_0x5a1cd5['message']:String(_0x5a1cd5);return console['log'](a5_0x28a5ef['red'](_0x1fbbe0(0x1d2)+_0x325259)),0x1;}_0x184002[_0x1fbbe0(0x20d)]();if(_0x417aa9['length']>0x0){console[_0x1fbbe0(0x1fb)](),console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x215)](_0x1fbbe0(0x19d)));const {projectId:_0xc89d35,agentId:_0x260d37}=_0x11ea6f[_0x1fbbe0(0x1dd)];for(const _0x145321 of _0x417aa9){console['log'](_0x1fbbe0(0x20c)+a5_0x28a5ef['white'](_0x145321[_0x1fbbe0(0x1e3)]));const _0x57616a=createCommandSpinner(_0x1fbbe0(0x209)+_0x145321[_0x1fbbe0(0x1e7)][_0x1fbbe0(0x21b)]+_0x1fbbe0(0x1e1));_0x57616a[_0x1fbbe0(0x191)]();try{const {result:_0x1438fb}=await runTest(_0x3beddc['llm'],_0x145321,{'agentId':_0x260d37,'projectId':_0xc89d35,'site':_0x11ea6f['site'],'noEval':![],'evaluatorId':_0x2b75ba,'onRoundStart':(_0x5c3101,_0x37c229)=>{const _0x10ed30=_0x1fbbe0;_0x57616a[_0x10ed30(0x1cc)]=_0x10ed30(0x1de)+(_0x5c3101+0x1)+'/'+_0x37c229+_0x10ed30(0x1e1);},'onRoundComplete':(_0x4c2685,_0x118d81,_0x558fa5)=>{const _0x8cf214=_0x1fbbe0,_0x103ac2=formatElapsed(_0x118d81);_0x558fa5?console[_0x8cf214(0x1fb)](_0x8cf214(0x21d)+(_0x4c2685+0x1)+'/'+_0x145321[_0x8cf214(0x1e7)]['length']+_0x8cf214(0x1e9)+a5_0x28a5ef[_0x8cf214(0x222)]('✓')+'\x20('+_0x103ac2+')'):console[_0x8cf214(0x1fb)](_0x8cf214(0x21d)+(_0x4c2685+0x1)+'/'+_0x145321[_0x8cf214(0x1e7)][_0x8cf214(0x21b)]+_0x8cf214(0x1e9)+a5_0x28a5ef[_0x8cf214(0x225)]('✗'));},'onEvaluationStart':()=>{const _0x47a844=_0x1fbbe0;_0x57616a[_0x47a844(0x1cc)]=_0x47a844(0x193);},'onEvaluationComplete':_0xe06c27=>{const _0x28d98e=_0x1fbbe0,_0x555462=formatElapsed(_0xe06c27);console[_0x28d98e(0x1fb)](_0x28d98e(0x218)+a5_0x28a5ef[_0x28d98e(0x222)]('✓')+'\x20('+_0x555462+')');}});_0x57616a[_0x1fbbe0(0x20d)](),_0x2a45d1['push'](_0x1438fb);if(_0x1438fb[_0x1fbbe0(0x1bc)]===_0x1fbbe0(0x1d3))console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x222)](_0x1fbbe0(0x1d6)+_0x1438fb['reason'])+a5_0x28a5ef[_0x1fbbe0(0x1cd)]('\x20(new)'));else _0x1438fb[_0x1fbbe0(0x1bc)]===_0x1fbbe0(0x1dc)?console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x225)]('✗\x20FAIL:\x20'+_0x1438fb[_0x1fbbe0(0x21c)])+a5_0x28a5ef[_0x1fbbe0(0x1cd)](_0x1fbbe0(0x1ca))):console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x225)](_0x1fbbe0(0x1f2)+_0x1438fb[_0x1fbbe0(0x21c)]));_0x1438fb[_0x1fbbe0(0x217)]&&console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x1cd)]('\x20\x20Conversation:\x20'+_0x1438fb[_0x1fbbe0(0x217)]));}catch(_0x19ca22){_0x57616a['stop']();const _0x19a6a6=_0x19ca22 instanceof Error?_0x19ca22[_0x1fbbe0(0x207)]:String(_0x19ca22);console[_0x1fbbe0(0x1fb)](a5_0x28a5ef[_0x1fbbe0(0x225)](_0x1fbbe0(0x1f2)+_0x19a6a6)),_0x2a45d1[_0x1fbbe0(0x206)]({'name':_0x145321[_0x1fbbe0(0x1e3)],'status':_0x1fbbe0(0x1d9),'reason':_0x19a6a6,'timestamp':new Date()[_0x1fbbe0(0x203)](),'duration_ms':0x0});}}}console[_0x1fbbe0(0x1fb)]();const _0x5fb0d7=Date[_0x1fbbe0(0x1e5)]()-_0x49aced,_0x149f5b=_0x2a45d1[_0x1fbbe0(0x1a9)](_0x40a5bd=>_0x40a5bd['status']===_0x1fbbe0(0x1d3))[_0x1fbbe0(0x21b)],_0x67d1a9=_0x2a45d1[_0x1fbbe0(0x1a9)](_0x48a1c5=>_0x48a1c5[_0x1fbbe0(0x1bc)]===_0x1fbbe0(0x1dc))[_0x1fbbe0(0x21b)],_0x963a9a=_0x2a45d1[_0x1fbbe0(0x1a9)](_0x4c4061=>_0x4c4061[_0x1fbbe0(0x1bc)]===_0x1fbbe0(0x1d9))['length'];console[_0x1fbbe0(0x1fb)]('━'[_0x1fbbe0(0x19b)](0x3c)),console[_0x1fbbe0(0x1fb)](_0x1fbbe0(0x1e0)),console[_0x1fbbe0(0x1fb)]('━'[_0x1fbbe0(0x19b)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x2a45d1['length']),console[_0x1fbbe0(0x1fb)](_0x1fbbe0(0x19f)+a5_0x28a5ef[_0x1fbbe0(0x222)](_0x149f5b)),console[_0x1fbbe0(0x1fb)]('Failed:\x20\x20\x20'+a5_0x28a5ef[_0x1fbbe0(0x225)](_0x67d1a9));_0x963a9a>0x0&&console[_0x1fbbe0(0x1fb)](_0x1fbbe0(0x1ad)+a5_0x28a5ef['red'](_0x963a9a));console[_0x1fbbe0(0x1fb)](_0x1fbbe0(0x1b0)+formatElapsed(_0x5fb0d7)),console[_0x1fbbe0(0x1fb)]('━'[_0x1fbbe0(0x19b)](0x3c));const _0x5d4092={'summary':{'total':_0x2a45d1[_0x1fbbe0(0x21b)],'passed':_0x149f5b,'failed':_0x67d1a9,'errors':_0x963a9a>0x0?_0x963a9a:undefined,'duration_ms':_0x5fb0d7},'tests':_0x2a45d1,'agent':{'project':_0x2fcb58['projectName'],'name':_0x2fcb58['agentName'],'site':_0x413995},'timestamp':new Date(_0x49aced)[_0x1fbbe0(0x203)]()};if(_0x222146!==_0x1fbbe0(0x220)||_0x13bd7f){const _0x357b49=formatResults(_0x5d4092,_0x222146);if(_0x13bd7f)try{a5_0x167cab[_0x1fbbe0(0x1cb)](_0x13bd7f,_0x357b49,'utf-8'),console[_0x1fbbe0(0x1fb)](),console['log'](a5_0x28a5ef[_0x1fbbe0(0x1cd)](_0x1fbbe0(0x216)+_0x13bd7f));}catch(_0x1100f8){return console[_0x1fbbe0(0x1fb)](),console[_0x1fbbe0(0x1fb)](a5_0x28a5ef['red'](_0x1fbbe0(0x18e)+_0x1100f8)),0x1;}else console['log'](),console[_0x1fbbe0(0x1fb)](_0x357b49);}const _0x59c867=_0x2a45d1[_0x1fbbe0(0x1a9)](_0x1c6171=>_0x1c6171[_0x1fbbe0(0x1bc)]!==_0x1fbbe0(0x1d3));return _0x59c867[_0x1fbbe0(0x21b)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x188665=a6_0x46b9;(function(_0x1e2450,_0x491cb0){const _0x428288=a6_0x46b9,_0x30f517=_0x1e2450();while(!![]){try{const _0x1c7198=parseInt(_0x428288(0x1f9))/0x1+parseInt(_0x428288(0x1e0))/0x2*(-parseInt(_0x428288(0x1e3))/0x3)+-parseInt(_0x428288(0x204))/0x4+-parseInt(_0x428288(0x206))/0x5+-parseInt(_0x428288(0x1ff))/0x6*(-parseInt(_0x428288(0x1ed))/0x7)+parseInt(_0x428288(0x1c9))/0x8+-parseInt(_0x428288(0x1db))/0x9;if(_0x1c7198===_0x491cb0)break;else _0x30f517['push'](_0x30f517['shift']());}catch(_0x427cb6){_0x30f517['push'](_0x30f517['shift']());}}}(a6_0x149f,0xe70b5));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_0x188665(0x1e7),a6_0x188665(0x1fc),'cookie',a6_0x188665(0x207),a6_0x188665(0x1cb),'x-xsrf-token',a6_0x188665(0x1f5),a6_0x188665(0x205)]);function a6_0x46b9(_0x17d591,_0xaea2d5){_0x17d591=_0x17d591-0x1c8;const _0x149f48=a6_0x149f();let _0x46b951=_0x149f48[_0x17d591];return _0x46b951;}function a6_0x149f(){const _0x422280=['authorization','verbose','join','output','message','method','189mJEdcI','Error:\x20','status','Results\x20saved\x20to\x20','description','llm-proxy','validate','keys','x-auth-token','Invalid\x20HTTP\x20method:\x20','log','stack','1008530DNVzng','api','PUT','proxy-authorization','body','toUpperCase','274692acSSOa','GET','includes','data','isArray','2282344TZBake','x-trino-user','5505660nQOiJw','set-cookie','substring','Invalid\x20header\x20format:\x20\x22','headers','.\x20Valid\x20methods:\x20','workflow','11788840qLUevD','POST','set-cookie2','error','request','header','PATCH','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','llm','indexOf','cdp','type','file','trim','name','noColor','execute','DELETE','8737668DBgzvH','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','readBodyFromFile','color','Endpoint\x20must\x20start\x20with\x20/:\x20','2udBlak','has','\x0aStack\x20trace:\x0a','387966SaFJag','length','entries','Invalid\x20API\x20type:\x20'];a6_0x149f=function(){return _0x422280;};return a6_0x149f();}function isSensitiveHeader(_0x1c09b0){const _0x2a9f0a=a6_0x188665;return SENSITIVE_HEADERS[_0x2a9f0a(0x1e1)](_0x1c09b0['toLowerCase']());}function parseHeader(_0x33cb16){const _0x4901fb=a6_0x188665,_0x7bd0ae=_0x33cb16[_0x4901fb(0x1d2)](':');if(_0x7bd0ae===-0x1)throw new Error(_0x4901fb(0x209)+_0x33cb16+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x5d2f67=_0x33cb16[_0x4901fb(0x208)](0x0,_0x7bd0ae)['trim'](),_0x34652e=_0x33cb16['substring'](_0x7bd0ae+0x1)[_0x4901fb(0x1d6)]();if(!_0x5d2f67)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x33cb16+'\x22');return[_0x5d2f67,_0x34652e];}export class ApiCommand extends BaseCommand{[a6_0x188665(0x1d7)]=a6_0x188665(0x1fa);[a6_0x188665(0x1f1)]=a6_0x188665(0x1d0);[a6_0x188665(0x1f3)](_0x56eb72){const _0xce0947=a6_0x188665,{args:_0x40d790,options:_0x9b0cf2}=_0x56eb72,_0x3f8543=_0x9b0cf2;if(_0x40d790[_0xce0947(0x1e4)]===0x0)return _0xce0947(0x1dc);const _0x2b0bdf=_0x40d790[0x0];if(!_0x2b0bdf['startsWith']('/'))return _0xce0947(0x1df)+_0x2b0bdf;const _0xe7144b=_0x3f8543[_0xce0947(0x202)],_0x1829d0=_0x3f8543[_0xce0947(0x1d5)];if(_0xe7144b&&_0x1829d0)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x2889ce=_0x3f8543[_0xce0947(0x1ec)]||'GET',_0x5e1076=[_0xce0947(0x200),_0xce0947(0x1ca),_0xce0947(0x1fb),_0xce0947(0x1da),_0xce0947(0x1cf)];if(!_0x5e1076[_0xce0947(0x201)](_0x2889ce[_0xce0947(0x1fe)]()))return _0xce0947(0x1f6)+_0x2889ce+_0xce0947(0x20b)+_0x5e1076[_0xce0947(0x1e9)](',\x20');const _0x20eab2=_0x3f8543[_0xce0947(0x1d4)]||'td',_0x3d2644=['td',_0xce0947(0x1d3),_0xce0947(0x1c8),'trino',_0xce0947(0x1d1),_0xce0947(0x1f2)];if(!_0x3d2644[_0xce0947(0x201)](_0x20eab2))return _0xce0947(0x1e6)+_0x20eab2+'.\x20Valid\x20types:\x20'+_0x3d2644[_0xce0947(0x1e9)](',\x20');return undefined;}async[a6_0x188665(0x1d9)](_0x56653f){const _0x2ec3ec=a6_0x188665,{options:_0x2be689,args:_0x51c707,tdx:_0x3c8624}=_0x56653f,_0x4574b8=_0x2be689,_0x5872bd=_0x51c707[0x0],_0x1fed8e=(_0x4574b8[_0x2ec3ec(0x1ec)]||_0x2ec3ec(0x200))[_0x2ec3ec(0x1fe)](),_0x4c932e=_0x4574b8['data'],_0x3aeb0e=_0x4574b8[_0x2ec3ec(0x1d5)],_0x30e834=_0x4574b8[_0x2ec3ec(0x1ce)],_0x3fa7e6=_0x4574b8[_0x2ec3ec(0x1d4)]||'td';try{const _0x26a69d={};if(_0x30e834){const _0x1d5cfe=Array[_0x2ec3ec(0x203)](_0x30e834)?_0x30e834:[_0x30e834];for(const _0x120ebb of _0x1d5cfe){const [_0x972a1d,_0x54d1f4]=parseHeader(_0x120ebb);_0x26a69d[_0x972a1d]=_0x54d1f4;}}let _0xe93266;if(_0x4c932e)_0xe93266=_0x4c932e;else{if(_0x3aeb0e)try{_0xe93266=RawAPI[_0x2ec3ec(0x1dd)](_0x3aeb0e);}catch(_0x14cd12){return console['error'](_0x2ec3ec(0x1ee)+(_0x14cd12 instanceof Error?_0x14cd12[_0x2ec3ec(0x1eb)]:String(_0x14cd12))),0x1;}}const _0x13b273={'method':_0x1fed8e,'apiType':_0x3fa7e6,'includeHeaders':_0x2be689['verbose']};_0xe93266&&(_0x13b273[_0x2ec3ec(0x1fd)]=_0xe93266);Object[_0x2ec3ec(0x1f4)](_0x26a69d)[_0x2ec3ec(0x1e4)]>0x0&&(_0x13b273[_0x2ec3ec(0x20a)]=_0x26a69d);if(_0x2be689[_0x2ec3ec(0x1e8)]){const _0x4c789d=resolveSite(_0x2be689['site']),_0x200140=getEndpoint(_0x4c789d,_0x3fa7e6),_0x2e719e=''+_0x200140+_0x5872bd;console[_0x2ec3ec(0x1cc)]('>\x20'+_0x1fed8e+'\x20'+_0x2e719e);const _0x2e72fd=getAuthHeaders(_0x4c789d),_0x2b61fe={..._0x2e72fd,..._0x26a69d};for(const [_0x304bbf,_0x54c827]of Object['entries'](_0x2b61fe)){!isSensitiveHeader(_0x304bbf)&&console[_0x2ec3ec(0x1cc)]('>\x20'+_0x304bbf+':\x20'+_0x54c827);}_0xe93266&&console[_0x2ec3ec(0x1cc)]('>'),console[_0x2ec3ec(0x1cc)]('');}const _0x445e31=await _0x3c8624['api'][_0x2ec3ec(0x1cd)](_0x5872bd,_0x13b273);if(_0x2be689[_0x2ec3ec(0x1e8)]&&_0x445e31['headers']){console['error']('<\x20HTTP/1.1\x20'+_0x445e31[_0x2ec3ec(0x1ef)]);for(const [_0x1b308a,_0x166cff]of Object[_0x2ec3ec(0x1e5)](_0x445e31['headers'])){!isSensitiveHeader(_0x1b308a)&&console[_0x2ec3ec(0x1cc)]('<\x20'+_0x1b308a+':\x20'+_0x166cff);}console[_0x2ec3ec(0x1cc)]('');}const _0x304836=Boolean(_0x2be689[_0x2ec3ec(0x1ea)]),_0x130212={'color':_0x2be689['color'],'noColor':_0x2be689[_0x2ec3ec(0x1d8)]||_0x304836&&!_0x2be689[_0x2ec3ec(0x1de)]},_0x16cb27=colorizeJSON(_0x445e31[_0x2ec3ec(0x202)],_0x130212);return _0x2be689[_0x2ec3ec(0x1ea)]?(writeFileSync(_0x2be689['output'],_0x16cb27),console[_0x2ec3ec(0x1cc)](_0x2ec3ec(0x1f0)+_0x2be689[_0x2ec3ec(0x1ea)])):console[_0x2ec3ec(0x1f7)](_0x16cb27),0x0;}catch(_0x3ce57f){return _0x3ce57f instanceof Error?(console[_0x2ec3ec(0x1cc)]('Error:\x20'+_0x3ce57f[_0x2ec3ec(0x1eb)]),_0x2be689['verbose']&&_0x3ce57f[_0x2ec3ec(0x1f8)]&&console[_0x2ec3ec(0x1cc)](_0x2ec3ec(0x1e2)+_0x3ce57f[_0x2ec3ec(0x1f8)])):console[_0x2ec3ec(0x1cc)](_0x2ec3ec(0x1ee)+String(_0x3ce57f)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a7_0x10c0(_0x5cf224,_0x4b166d){_0x5cf224=_0x5cf224-0xe6;const _0x54138f=a7_0x5413();let _0x10c024=_0x54138f[_0x5cf224];return _0x10c024;}const a7_0x19350e=a7_0x10c0;(function(_0xf02a10,_0x31721a){const _0x5af23c=a7_0x10c0,_0x5a9ab7=_0xf02a10();while(!![]){try{const _0x1d5db0=parseInt(_0x5af23c(0x100))/0x1+parseInt(_0x5af23c(0x123))/0x2*(-parseInt(_0x5af23c(0xfe))/0x3)+parseInt(_0x5af23c(0x118))/0x4+-parseInt(_0x5af23c(0xfd))/0x5*(parseInt(_0x5af23c(0x107))/0x6)+parseInt(_0x5af23c(0x120))/0x7*(parseInt(_0x5af23c(0xe7))/0x8)+-parseInt(_0x5af23c(0xf7))/0x9*(-parseInt(_0x5af23c(0xf1))/0xa)+parseInt(_0x5af23c(0x128))/0xb*(parseInt(_0x5af23c(0x127))/0xc);if(_0x1d5db0===_0x31721a)break;else _0x5a9ab7['push'](_0x5a9ab7['shift']());}catch(_0x23938d){_0x5a9ab7['push'](_0x5a9ab7['shift']());}}}(a7_0x5413,0x6d5d6));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';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x477ae8 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x5d5f52 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x19350e(0xff)]='auth:setup';[a7_0x19350e(0x11a)]=a7_0x19350e(0x11c);async[a7_0x19350e(0xfa)](_0x146d47){const _0x1a6030=a7_0x19350e,{options:_0x5bc819}=_0x146d47,_0x397b9c=_0x5bc819['profile'];console[_0x1a6030(0x115)](a7_0x5d5f52[_0x1a6030(0x110)]('tdx:\x20auth\x20setup'));const _0xccd73b=_0x5bc819[_0x1a6030(0x10e)]||_0x1a6030(0xe9),{choices:_0x177ce6,initialIndex:_0x4b1f8a}=buildSiteChoices(_0xccd73b),_0x1e9f3e=_0x397b9c?_0x1a6030(0xec)+_0x397b9c+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x10e6d4=await a7_0x477ae8({'type':'select','name':_0x1a6030(0x10e),'message':_0x1e9f3e,'choices':_0x177ce6,'initial':_0x4b1f8a});if(!_0x10e6d4[_0x1a6030(0x10e)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x2a5808;if(_0x10e6d4['site']==='other'){const _0x1925df=await a7_0x477ae8({'type':_0x1a6030(0x108),'name':_0x1a6030(0x104),'message':_0x1a6030(0xfb),'initial':_0x1a6030(0xe9),'validate':_0x1c9dee=>{const _0x22eb91=_0x1a6030;if(!_0x1c9dee||!_0x1c9dee[_0x22eb91(0xef)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x22eb91(0xfc)](_0x1c9dee[_0x22eb91(0xef)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x1925df['customSite'])return console[_0x1a6030(0x115)]('\x0aSetup\x20cancelled'),0x1;_0x2a5808=_0x1925df[_0x1a6030(0x104)];}else _0x2a5808=_0x10e6d4[_0x1a6030(0x10e)];const _0x3b43af=resolveSite(_0x2a5808);console['log'](_0x1a6030(0x11e)+_0x3b43af),console[_0x1a6030(0x115)](_0x1a6030(0x109)),console[_0x1a6030(0x115)]('\x20\x20'+getConsoleUrl(_0x3b43af,_0x1a6030(0xea)));const _0x637d88=await a7_0x477ae8({'type':'password','name':_0x1a6030(0x11b),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x3b6466=>{const _0x1fe3da=_0x1a6030;if(!_0x3b6466||!_0x3b6466[_0x1fe3da(0xef)]())return _0x1fe3da(0x105);return!![];}});if(!_0x637d88[_0x1a6030(0x11b)])return console[_0x1a6030(0x115)](_0x1a6030(0x126)),0x1;const _0x4d6e8b=_0x637d88['apiKey'];console[_0x1a6030(0x115)](_0x1a6030(0xf4));try{const _0x52f67f=TDX[_0x1a6030(0xf8)]({'site':_0x3b43af,'apiKey':_0x4d6e8b[_0x1a6030(0xef)](),'logLevel':_0x5bc819['logLevel']??LogLevel['ERROR']}),_0x5a2cd=await _0x52f67f[_0x1a6030(0x122)][_0x1a6030(0xe6)]();console['log'](_0x1a6030(0x11f)+_0x5a2cd[_0x1a6030(0x111)]+')');const _0x20f48d=await isKeychainAvailable();_0x20f48d?(await saveAPIKeyAsync(_0x4d6e8b['trim'](),_0x3b43af,_0x397b9c),console[_0x1a6030(0x115)](_0x1a6030(0x10b)+(_0x397b9c?_0x1a6030(0x116)+_0x397b9c+')':''))):(console['warn'](a7_0x5d5f52[_0x1a6030(0x129)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x1a6030(0xf2)](a7_0x5d5f52[_0x1a6030(0x129)](_0x1a6030(0x124))));if(_0x397b9c){const _0x1f853a={'site':_0x3b43af};saveProfileToUserConfig(_0x397b9c,_0x1f853a),console[_0x1a6030(0x115)](_0x1a6030(0x101)+_0x397b9c+_0x1a6030(0xf0));}else saveDefaultSiteToUserConfig(_0x3b43af),console[_0x1a6030(0x115)](_0x1a6030(0x112)+_0x3b43af);const _0x2b8d1a=_0x397b9c?'\x20--profile\x20'+_0x397b9c:'';return console[_0x1a6030(0x115)](),console['log'](_0x1a6030(0x114)),console[_0x1a6030(0x115)](_0x1a6030(0x10a)+_0x2b8d1a+_0x1a6030(0x10f)),console['log'](_0x1a6030(0x10a)+_0x2b8d1a+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x1247cb){if(_0x1247cb instanceof HTTPClientError&&_0x1247cb[_0x1a6030(0xed)]===0x191)return printAuthError(_0x1247cb),0x1;return console['error'](a7_0x5d5f52[_0x1a6030(0x119)](_0x1a6030(0x117)+(_0x1247cb instanceof Error?_0x1247cb[_0x1a6030(0x10c)]:String(_0x1247cb)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x19350e(0xff)]=a7_0x19350e(0xf9);[a7_0x19350e(0x11a)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x19350e(0xfa)](_0x5154b9){const _0x5556a6=a7_0x19350e,{options:_0x2c4280,tdx:_0x179d61}=_0x5154b9,_0x16dcb8=_0x2c4280[_0x5556a6(0x10e)],_0x31ddfa=_0x2c4280[_0x5556a6(0x103)],_0x59f265=_0x31ddfa?_0x31ddfa:_0x5556a6(0x113);console[_0x5556a6(0x115)](_0x5556a6(0x106)+_0x59f265+_0x5556a6(0xeb)+_0x16dcb8+')');const _0x4fa5b7=await resolveAPIKeyAsync(_0x16dcb8,_0x31ddfa);if(_0x4fa5b7){const {source:_0xe9b35b,isDeprecated:_0x5296e3}=_0x4fa5b7,_0x454966='Read\x20credential\x20from\x20'+_0xe9b35b;console['log'](_0x5296e3?a7_0x5d5f52['yellow'](_0x454966):_0x454966);}else console[_0x5556a6(0x115)](a7_0x5d5f52[_0x5556a6(0x129)](_0x5556a6(0x102)));try{const _0x253fcb=await _0x179d61[_0x5556a6(0x122)]['getUserInfo']();return console['log'](a7_0x5d5f52['green']('✓\x20Authentication\x20successful\x0a')),console[_0x5556a6(0x115)]('User:\x20'+_0x253fcb['email']),(_0x253fcb['first_name']||_0x253fcb[_0x5556a6(0x10d)])&&console[_0x5556a6(0x115)](_0x5556a6(0xf5)+[_0x253fcb[_0x5556a6(0xe8)],_0x253fcb['last_name']][_0x5556a6(0xee)](Boolean)['join']('\x20')),0x0;}catch(_0x5300e5){return _0x5300e5 instanceof HTTPClientError&&_0x5300e5['status']===0x191?printAuthError(_0x5300e5,!![],_0x31ddfa):console[_0x5556a6(0x11d)](a7_0x5d5f52[_0x5556a6(0x119)](_0x5556a6(0x117)+(_0x5300e5 instanceof Error?_0x5300e5['message']:String(_0x5300e5)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x19350e(0xff)]='auth:clear';[a7_0x19350e(0x11a)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x47cfeb){const _0x1d6abc=a7_0x19350e,{options:_0x10b857}=_0x47cfeb,_0x998dd5=_0x10b857[_0x1d6abc(0x103)];console[_0x1d6abc(0x115)](a7_0x5d5f52[_0x1d6abc(0x110)](_0x1d6abc(0x125)));const _0x17bf36=await isKeychainAvailable();if(!_0x17bf36)return console[_0x1d6abc(0x11d)](a7_0x5d5f52['red'](_0x1d6abc(0xf6))),0x1;const _0x125e54=await deleteKeychainAPIKey(_0x998dd5);return _0x125e54?(clearCredentialCache(),console['log'](_0x1d6abc(0x121)+(_0x998dd5?_0x1d6abc(0x116)+_0x998dd5+')':'')),0x0):(console[_0x1d6abc(0x115)](_0x1d6abc(0xf3)+(_0x998dd5?'\x20for\x20profile:\x20'+_0x998dd5:'')),0x1);}}function a7_0x5413(){const _0x443053=['red','description','apiKey','Setup\x20API\x20key\x20authentication\x20interactively','error','Setting\x20up\x20authentication\x20for\x20site:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','54124EVVEqU','✓\x20API\x20key\x20removed\x20from\x20keychain','jobs','250606LxkEji','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','tdx:\x20auth\x20clear','\x0aSetup\x20cancelled','48wQUZCJ','1083082pTRqJF','yellow','getUserInfo','256GWFiNm','first_name','us01','/app/mp/ak','\x20(site:\x20','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','status','filter','trim','\x27\x20registered','37190UaGvqI','warn','No\x20API\x20key\x20found\x20in\x20keychain','Validating\x20API\x20key...','Name:\x20','System\x20keychain\x20is\x20not\x20available','1026gQZLQO','create','auth','execute','Enter\x20site\x20name:','test','212160dBCZno','15ymHxKG','name','533137lTPtqb','✓\x20Profile\x20\x27','No\x20credential\x20found','profile','customSite','API\x20key\x20cannot\x20be\x20empty','tdx\x20profile:\x20','102sdgHds','text','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20tdx','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','message','last_name','site','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','bold','email','✓\x20Default\x20site\x20set\x20to\x20','N/A','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','log','\x20(profile:\x20','✗\x20Validation\x20failed:\x20','789768cSigBf'];a7_0x5413=function(){return _0x443053;};return a7_0x5413();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x3df821=a8_0x1d09;(function(_0x31ff49,_0x53ba19){const _0xdac20f=a8_0x1d09,_0x1e69c8=_0x31ff49();while(!![]){try{const _0x586534=-parseInt(_0xdac20f(0x1b1))/0x1+parseInt(_0xdac20f(0x1a2))/0x2*(parseInt(_0xdac20f(0x1b8))/0x3)+parseInt(_0xdac20f(0x197))/0x4+-parseInt(_0xdac20f(0x1c5))/0x5+parseInt(_0xdac20f(0x1b9))/0x6*(parseInt(_0xdac20f(0x1a3))/0x7)+parseInt(_0xdac20f(0x1a5))/0x8*(parseInt(_0xdac20f(0x1d2))/0x9)+-parseInt(_0xdac20f(0x1d6))/0xa;if(_0x586534===_0x53ba19)break;else _0x1e69c8['push'](_0x1e69c8['shift']());}catch(_0x277360){_0x1e69c8['push'](_0x1e69c8['shift']());}}}(a8_0x4885,0xc800f));function a8_0x1d09(_0x1e6748,_0x255b9e){_0x1e6748=_0x1e6748-0x18c;const _0x4885f6=a8_0x4885();let _0x1d0928=_0x4885f6[_0x1e6748];return _0x1d0928;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x4885(){const _0x26bfdb=['write','chat','projectId','tool','targetFunction','Chat\x20session:\x20','cause','event','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','name','134humJfH','3256862XqVTPc','message','8FgZVLX','claude-4.5-haiku','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','new','Getting\x20default\x20agent...','agentId','targetAgent','startChat','string','\x0aStack\x20trace:','error','context','684356aRtkjc','type','stream','includes','log','llmAgent','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','61839KKEVbx','12PgWwjb','targetWebSearchTool','handleChatEvent','Continuing\x20chat:\x20','metadata','description','stack','\x20\x20Cause:\x20','llm','llmProject','--agent\x20flag','agent','7176900mUNxIj','\x27...','slice','join','data','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','CHAT_NOT_FOUND','tool_call','Create\x20a\x20new\x20chat\x20session','streamChatJsonl','Resolving\x20project\x20\x27','chat-create','getDefaultAgent','12984858bbUAnv','validate','execute','Error:\x20','21969050nXogTq','streamChat','getOrCreateDefaultAgent','content','verbose','done','functionName','stringify','chatId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Resolving\x20agent\x20\x27','args','resolveAgentId','\x0aError:\x20','Using\x20cached\x20default\x20agent:\x20','5525964ZVrglF'];a8_0x4885=function(){return _0x26bfdb;};return a8_0x4885();}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(_0x59c0f1,_0x34b434){const _0x33a8ed=a8_0x1d09;if(_0x59c0f1 instanceof SDKError)console[_0x33a8ed(0x1af)](_0x33a8ed(0x1d5)+_0x59c0f1[_0x33a8ed(0x1a4)]),_0x34b434[_0x33a8ed(0x18c)]&&(_0x59c0f1[_0x33a8ed(0x19e)]&&console[_0x33a8ed(0x1af)](_0x33a8ed(0x1c0)+_0x59c0f1[_0x33a8ed(0x19e)]),_0x59c0f1[_0x33a8ed(0x1bf)]&&(console[_0x33a8ed(0x1af)](_0x33a8ed(0x1ae)),console[_0x33a8ed(0x1af)](_0x59c0f1[_0x33a8ed(0x1bf)])));else throw _0x59c0f1;}async function resolveAgentId(_0x9c4614,_0x370212,_0x95ce2,_0x5022c9,_0x50e40f){const _0x48448b=a8_0x1d09,_0x46693d=_0x370212||_0x95ce2;if(_0x46693d){const {projectName:_0x156b70,agentName:_0x498eaf}=parseAgentRef(_0x46693d),_0x57f7f2=_0x498eaf||_0x46693d,_0x2067c4=_0x498eaf?_0x156b70:_0x5022c9;if(!_0x2067c4)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x50e40f){const _0x54681c=_0x370212?_0x48448b(0x1c3):'session\x20context';console[_0x48448b(0x1af)]('Using\x20agent\x20from\x20'+_0x54681c+':\x20'+_0x2067c4+'/'+_0x57f7f2);}const _0x557094=await withSpinner(_0x48448b(0x1cf)+_0x2067c4+_0x48448b(0x1c6),()=>_0x9c4614['llm']['resolveProjectId'](_0x2067c4),{'verbose':_0x50e40f}),_0x307f6e=await withSpinner(_0x48448b(0x192)+_0x57f7f2+'\x27...',()=>_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x194)](_0x57f7f2,_0x557094[_0x48448b(0x1c9)]),{'verbose':_0x50e40f});return _0x307f6e[_0x48448b(0x1c9)];}else{const _0x2b1ca8=_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x1d1)]();if(_0x2b1ca8)return _0x50e40f&&console[_0x48448b(0x1af)](_0x48448b(0x196)+_0x2b1ca8[_0x48448b(0x1a1)]),_0x2b1ca8['id'];const _0x47925e=await withSpinner(_0x48448b(0x1a9),()=>_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x1d8)](_0x48448b(0x1a6),0x0),{'verbose':_0x50e40f});return _0x47925e[_0x48448b(0x1c9)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x3df821(0x1a1)]=a8_0x3df821(0x199);[a8_0x3df821(0x1be)]=a8_0x3df821(0x1ca);[a8_0x3df821(0x1d3)](_0x4bff54){const _0x4d40ce=a8_0x3df821,_0x292cf1=_0x4bff54[_0x4d40ce(0x193)][_0x4d40ce(0x1c8)]('\x20');if(!_0x292cf1)return _0x4d40ce(0x1a7);return undefined;}async[a8_0x3df821(0x1d7)](_0x5545e4,_0x5476b2,_0x562e3b,_0x2fc7c9,_0x3ed4cc){const _0xda48d9=a8_0x3df821;for await(const _0x164428 of _0x5545e4['llm'][_0xda48d9(0x199)](_0x5476b2,{'agentId':_0x562e3b,'chatId':_0x2fc7c9})){if(_0x164428[_0xda48d9(0x1b2)]===_0xda48d9(0x1bd)){const _0x5c09b7=_0x164428[_0xda48d9(0x1c9)]['chatId'];saveLastChatId(_0x5c09b7),_0x3ed4cc&&console[_0xda48d9(0x1af)](_0xda48d9(0x19d)+_0x5c09b7);}else _0x164428[_0xda48d9(0x1b2)]===_0xda48d9(0x19f)&&this[_0xda48d9(0x1bb)](_0x164428[_0xda48d9(0x1c9)]);}}async[a8_0x3df821(0x1ce)](_0x26ca59,_0x2265d5,_0x344586,_0x4a8b75){const _0x9dab71=a8_0x3df821,_0x2675cf=_0x26ca59[_0x9dab71(0x1b0)]['site'];let _0x4e68f3=![];for await(const _0x4dd990 of _0x26ca59[_0x9dab71(0x1c1)][_0x9dab71(0x199)](_0x2265d5,{'agentId':_0x344586,'chatId':_0x4a8b75})){if(_0x4dd990[_0x9dab71(0x1b2)]==='metadata'){const _0x3deeee=_0x4dd990[_0x9dab71(0x1c9)];saveLastChatId(_0x3deeee['chatId']);const _0x558570=_0x3deeee[_0x9dab71(0x19a)]&&_0x3deeee['agentId']?getLLMConversationUrl(_0x2675cf,_0x3deeee[_0x9dab71(0x19a)],_0x3deeee[_0x9dab71(0x1aa)],_0x3deeee[_0x9dab71(0x190)]):undefined;console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1bd),'data':{'chatId':_0x3deeee[_0x9dab71(0x190)],'agentId':_0x3deeee[_0x9dab71(0x1aa)],'consoleUrl':_0x558570}})),_0x4e68f3=!![];}else{if(_0x4dd990[_0x9dab71(0x1b2)]===_0x9dab71(0x19f)){!_0x4e68f3&&_0x4a8b75&&(console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1bd),'data':{'chatId':_0x4a8b75}})),_0x4e68f3=!![]);const _0x17c0fc=_0x4dd990[_0x9dab71(0x1c9)];if(_0x9dab71(0x1d9)in _0x17c0fc)console['log'](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1d9),'data':{'content':_0x17c0fc[_0x9dab71(0x1d9)]}}));else{if(_0x9dab71(0x1cc)in _0x17c0fc){const _0x3c9a49=_0x17c0fc[_0x9dab71(0x1cc)];console[_0x9dab71(0x1b5)](JSON['stringify']({'type':_0x9dab71(0x1cc),'data':{'id':_0x3c9a49['id'],'name':_0x3c9a49['functionName'],'target':_0x3c9a49['targetKnowledgeBase']?.['name']||_0x3c9a49[_0x9dab71(0x1ab)]?.[_0x9dab71(0x1a1)]||_0x3c9a49[_0x9dab71(0x1ba)]?.[_0x9dab71(0x1a1)]||_0x3c9a49[_0x9dab71(0x19c)]}}));}else{if(_0x9dab71(0x19b)in _0x17c0fc)console[_0x9dab71(0x1b5)](JSON['stringify']({'type':'tool_result','data':{'id':_0x17c0fc[_0x9dab71(0x19b)]['id'],'name':_0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x18e)],'result':typeof _0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x1d9)]===_0x9dab71(0x1ad)?_0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x1d9)][_0x9dab71(0x1c7)](0x0,0x1f4):''}}));else _0x9dab71(0x1af)in _0x17c0fc&&console['log'](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1af),'data':{'error':_0x17c0fc['error']}}));}}}}}console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x18d)}));}async['execute'](_0x5c2564){const _0x3b6f96=a8_0x3df821,{options:_0x542061,args:_0x15b944,tdx:_0x4b6f94}=_0x5c2564,_0x4ad207=_0x15b944[_0x3b6f96(0x1c8)]('\x20'),_0x1661b0=_0x542061,_0x20ecca=_0x1661b0[_0x3b6f96(0x1c4)],_0xb78ff7=_0x1661b0[_0x3b6f96(0x1b6)],_0x52047c=_0x1661b0[_0x3b6f96(0x1c2)],_0x593871=_0x1661b0[_0x3b6f96(0x1a8)],_0x4e892a=_0x1661b0[_0x3b6f96(0x190)],_0xd4d2b=_0x1661b0[_0x3b6f96(0x1b3)];if(_0x593871&&_0x4e892a)return console['error'](_0x3b6f96(0x1b7)),0x1;try{let _0x8cb137,_0x3db936;if(_0x4e892a)_0x3db936=_0x4e892a;else!_0x593871&&(_0x3db936=loadLastChatId(),_0x3db936&&_0x542061['verbose']&&console[_0x3b6f96(0x1af)](_0x3b6f96(0x1bc)+_0x3db936));!_0x4e892a&&(_0x593871||!_0x3db936)&&(_0x8cb137=await resolveAgentId(_0x4b6f94,_0x20ecca,_0xb78ff7,_0x52047c,_0x542061['verbose']));const _0x416ac5=_0xd4d2b?(_0x20eee0,_0xc32365,_0x293d3c)=>this[_0x3b6f96(0x1ce)](_0x4b6f94,_0x20eee0,_0xc32365,_0x293d3c):(_0x2fddb8,_0x5a1478,_0x578318)=>this[_0x3b6f96(0x1d7)](_0x4b6f94,_0x2fddb8,_0x5a1478,_0x578318,_0x542061['verbose']);try{await _0x416ac5(_0x4ad207,_0x8cb137,_0x3db936);}catch(_0x594a69){const _0xa63c43=_0x594a69 instanceof SDKError&&_0x594a69['code']===ErrorCode[_0x3b6f96(0x1cb)]||_0x594a69 instanceof Error&&_0x594a69[_0x3b6f96(0x1a4)][_0x3b6f96(0x1b4)]('404');if(_0xa63c43&&_0x4e892a)return console[_0x3b6f96(0x1af)]('Error:\x20Chat\x20session\x20\x27'+_0x4e892a+'\x27\x20not\x20found'),0x1;if(_0xa63c43)_0x542061[_0x3b6f96(0x18c)]&&console[_0x3b6f96(0x1af)](_0x3b6f96(0x191)),!_0x8cb137&&(_0x8cb137=await resolveAgentId(_0x4b6f94,_0x20ecca,_0xb78ff7,_0x52047c,_0x542061['verbose'])),await _0x416ac5(_0x4ad207,_0x8cb137,undefined);else throw _0x594a69;}return!_0xd4d2b&&console['log'](),0x0;}catch(_0x4caa99){return console[_0x3b6f96(0x1af)](),handleSDKError(_0x4caa99,_0x542061),0x1;}}['handleChatEvent'](_0x19f936){const _0x427c04=a8_0x3df821;if('content'in _0x19f936)process['stdout'][_0x427c04(0x198)](_0x19f936['content']);else _0x427c04(0x1af)in _0x19f936&&console[_0x427c04(0x1af)](_0x427c04(0x195)+_0x19f936['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x3df821(0x1a1)]=a8_0x3df821(0x1d0);[a8_0x3df821(0x1be)]=a8_0x3df821(0x1cd);[a8_0x3df821(0x1d3)](_0x3d341a){const _0x5549b4=a8_0x3df821,_0x515e9a=_0x3d341a['options'],_0x4e0940=_0x515e9a['agent'],_0x597d2e=_0x515e9a['llmAgent'];if(!_0x4e0940&&!_0x597d2e)return _0x5549b4(0x1a0);return undefined;}async[a8_0x3df821(0x1d4)](_0x591213){const _0x3dffb0=a8_0x3df821,{options:_0x4a28a3,tdx:_0x174adb}=_0x591213,_0x14d955=_0x4a28a3,_0x4f3052=_0x14d955['agent'],_0x4146e8=_0x14d955[_0x3dffb0(0x1b6)],_0x59c940=_0x14d955[_0x3dffb0(0x1c2)];try{const _0x591626=await resolveAgentId(_0x174adb,_0x4f3052,_0x4146e8,_0x59c940,_0x4a28a3['verbose']),_0x420138=await _0x174adb['llm'][_0x3dffb0(0x1ac)](_0x591626);return saveLastChatId(_0x420138['id']),console[_0x3dffb0(0x1b5)](JSON[_0x3dffb0(0x18f)]({'chatId':_0x420138['id'],'agentId':_0x591626})),0x0;}catch(_0x2f2b83){return handleSDKError(_0x2f2b83,_0x4a28a3),0x1;}}}
|
|
1
|
+
function a8_0x56a7(_0x393153,_0x4d01a0){_0x393153=_0x393153-0xea;const _0x35f80e=a8_0x35f8();let _0x56a74f=_0x35f80e[_0x393153];return _0x56a74f;}const a8_0x364756=a8_0x56a7;(function(_0x4fbe04,_0x444136){const _0x3c17ad=a8_0x56a7,_0x129edc=_0x4fbe04();while(!![]){try{const _0xdbd4fc=parseInt(_0x3c17ad(0x113))/0x1+-parseInt(_0x3c17ad(0x104))/0x2*(parseInt(_0x3c17ad(0xfe))/0x3)+-parseInt(_0x3c17ad(0x12c))/0x4+-parseInt(_0x3c17ad(0xed))/0x5+parseInt(_0x3c17ad(0x128))/0x6*(parseInt(_0x3c17ad(0x105))/0x7)+-parseInt(_0x3c17ad(0x118))/0x8*(-parseInt(_0x3c17ad(0x10f))/0x9)+-parseInt(_0x3c17ad(0x102))/0xa;if(_0xdbd4fc===_0x444136)break;else _0x129edc['push'](_0x129edc['shift']());}catch(_0x2ebf6a){_0x129edc['push'](_0x129edc['shift']());}}}(a8_0x35f8,0x6312f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x35f8(){const _0x19a7d4=['--agent\x20flag','216mDprWq','Resolving\x20agent\x20\x27','message','targetWebSearchTool','targetAgent','validate','args','Continuing\x20chat:\x20','execute','log','streamChat','Create\x20a\x20new\x20chat\x20session','\x27...','agentId','claude-4.5-haiku','stream','2712NNUpAw','done','Using\x20cached\x20default\x20agent:\x20','chatId','1482492NLUTyb','name','Chat\x20session:\x20','metadata','chat','code','\x20\x20Cause:\x20','slice','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','tool_call','write','options','session\x20context','433685XjOYjc','event','Error:\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','string','context','\x0aError:\x20','stack','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','getDefaultAgent','agent','tool','targetKnowledgeBase','CHAT_NOT_FOUND','resolveProjectId','handleChatEvent','stringify','68181AfOdPa','\x0aStack\x20trace:','startChat','getOrCreateDefaultAgent','4881110ZKzmTb','llmAgent','18enfTVE','11116ktMmsK','verbose','type','content','data','error','cause','llm','stdout','join','51174jeHHpp','projectId','new','llmProject','684523CTswUM','functionName','resolveAgentId','streamChatJsonl'];a8_0x35f8=function(){return _0x19a7d4;};return a8_0x35f8();}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(_0x3fe09b,_0x17f02a){const _0x1d1a4a=a8_0x56a7;if(_0x3fe09b instanceof SDKError)console[_0x1d1a4a(0x10a)](_0x1d1a4a(0xef)+_0x3fe09b[_0x1d1a4a(0x11a)]),_0x17f02a[_0x1d1a4a(0x106)]&&(_0x3fe09b[_0x1d1a4a(0x10b)]&&console[_0x1d1a4a(0x10a)](_0x1d1a4a(0x132)+_0x3fe09b[_0x1d1a4a(0x10b)]),_0x3fe09b[_0x1d1a4a(0xf4)]&&(console[_0x1d1a4a(0x10a)](_0x1d1a4a(0xff)),console[_0x1d1a4a(0x10a)](_0x3fe09b[_0x1d1a4a(0xf4)])));else throw _0x3fe09b;}async function resolveAgentId(_0x30bc5f,_0x30e2b9,_0x545127,_0x431ad7,_0x5e31b2){const _0x161cb7=a8_0x56a7,_0x26c6db=_0x30e2b9||_0x545127;if(_0x26c6db){const {projectName:_0x3bb36d,agentName:_0x1bb962}=parseAgentRef(_0x26c6db),_0x35b7ba=_0x1bb962||_0x26c6db,_0x54b750=_0x1bb962?_0x3bb36d:_0x431ad7;if(!_0x54b750)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5e31b2){const _0x162143=_0x30e2b9?_0x161cb7(0x117):_0x161cb7(0xec);console['error']('Using\x20agent\x20from\x20'+_0x162143+':\x20'+_0x54b750+'/'+_0x35b7ba);}const _0x527a2f=await withSpinner('Resolving\x20project\x20\x27'+_0x54b750+_0x161cb7(0x124),()=>_0x30bc5f[_0x161cb7(0x10c)][_0x161cb7(0xfb)](_0x54b750),{'verbose':_0x5e31b2}),_0x4ea02c=await withSpinner(_0x161cb7(0x119)+_0x35b7ba+_0x161cb7(0x124),()=>_0x30bc5f[_0x161cb7(0x10c)][_0x161cb7(0x115)](_0x35b7ba,_0x527a2f[_0x161cb7(0x109)]),{'verbose':_0x5e31b2});return _0x4ea02c['data'];}else{const _0x44f0ab=_0x30bc5f[_0x161cb7(0x10c)][_0x161cb7(0xf6)]();if(_0x44f0ab)return _0x5e31b2&&console[_0x161cb7(0x10a)](_0x161cb7(0x12a)+_0x44f0ab[_0x161cb7(0x12d)]),_0x44f0ab['id'];const _0x200c39=await withSpinner('Getting\x20default\x20agent...',()=>_0x30bc5f['llm'][_0x161cb7(0x101)](_0x161cb7(0x126),0x0),{'verbose':_0x5e31b2});return _0x200c39[_0x161cb7(0x109)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x364756(0x12d)]=a8_0x364756(0x130);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x364756(0x11d)](_0x4ad357){const _0x533d6f=a8_0x364756,_0x5e02d7=_0x4ad357[_0x533d6f(0x11e)][_0x533d6f(0x10e)]('\x20');if(!_0x5e02d7)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x364756(0x122)](_0x4f98c9,_0x5ded15,_0x2c81ab,_0x254a5e,_0x602deb){const _0x142cac=a8_0x364756;for await(const _0xe4b04c of _0x4f98c9[_0x142cac(0x10c)][_0x142cac(0x130)](_0x5ded15,{'agentId':_0x2c81ab,'chatId':_0x254a5e})){if(_0xe4b04c[_0x142cac(0x107)]===_0x142cac(0x12f)){const _0x39ba44=_0xe4b04c['data'][_0x142cac(0x12b)];saveLastChatId(_0x39ba44),_0x602deb&&console[_0x142cac(0x10a)](_0x142cac(0x12e)+_0x39ba44);}else _0xe4b04c[_0x142cac(0x107)]===_0x142cac(0xee)&&this[_0x142cac(0xfc)](_0xe4b04c[_0x142cac(0x109)]);}}async[a8_0x364756(0x116)](_0x243856,_0x43b7c0,_0xd97eeb,_0x3021a7){const _0x1299b8=a8_0x364756,_0x1f0eb7=_0x243856[_0x1299b8(0xf2)]['site'];let _0x114a55=![];for await(const _0x3ab671 of _0x243856[_0x1299b8(0x10c)][_0x1299b8(0x130)](_0x43b7c0,{'agentId':_0xd97eeb,'chatId':_0x3021a7})){if(_0x3ab671[_0x1299b8(0x107)]===_0x1299b8(0x12f)){const _0x378997=_0x3ab671[_0x1299b8(0x109)];saveLastChatId(_0x378997['chatId']);const _0x4bb0b6=_0x378997[_0x1299b8(0x110)]&&_0x378997[_0x1299b8(0x125)]?getLLMConversationUrl(_0x1f0eb7,_0x378997[_0x1299b8(0x110)],_0x378997['agentId'],_0x378997[_0x1299b8(0x12b)]):undefined;console[_0x1299b8(0x121)](JSON[_0x1299b8(0xfd)]({'type':_0x1299b8(0x12f),'data':{'chatId':_0x378997['chatId'],'agentId':_0x378997[_0x1299b8(0x125)],'consoleUrl':_0x4bb0b6}})),_0x114a55=!![];}else{if(_0x3ab671[_0x1299b8(0x107)]===_0x1299b8(0xee)){!_0x114a55&&_0x3021a7&&(console[_0x1299b8(0x121)](JSON[_0x1299b8(0xfd)]({'type':_0x1299b8(0x12f),'data':{'chatId':_0x3021a7}})),_0x114a55=!![]);const _0x9f309b=_0x3ab671[_0x1299b8(0x109)];if(_0x1299b8(0x108)in _0x9f309b)console[_0x1299b8(0x121)](JSON[_0x1299b8(0xfd)]({'type':_0x1299b8(0x108),'data':{'content':_0x9f309b[_0x1299b8(0x108)]}}));else{if(_0x1299b8(0x135)in _0x9f309b){const _0x52ae93=_0x9f309b[_0x1299b8(0x135)];console[_0x1299b8(0x121)](JSON[_0x1299b8(0xfd)]({'type':'tool_call','data':{'id':_0x52ae93['id'],'name':_0x52ae93[_0x1299b8(0x114)],'target':_0x52ae93[_0x1299b8(0xf9)]?.[_0x1299b8(0x12d)]||_0x52ae93[_0x1299b8(0x11c)]?.[_0x1299b8(0x12d)]||_0x52ae93[_0x1299b8(0x11b)]?.[_0x1299b8(0x12d)]||_0x52ae93['targetFunction']}}));}else{if(_0x1299b8(0xf8)in _0x9f309b)console[_0x1299b8(0x121)](JSON[_0x1299b8(0xfd)]({'type':'tool_result','data':{'id':_0x9f309b['tool']['id'],'name':_0x9f309b[_0x1299b8(0xf8)][_0x1299b8(0x114)],'result':typeof _0x9f309b[_0x1299b8(0xf8)][_0x1299b8(0x108)]===_0x1299b8(0xf1)?_0x9f309b[_0x1299b8(0xf8)]['content'][_0x1299b8(0x133)](0x0,0x1f4):''}}));else _0x1299b8(0x10a)in _0x9f309b&&console[_0x1299b8(0x121)](JSON[_0x1299b8(0xfd)]({'type':_0x1299b8(0x10a),'data':{'error':_0x9f309b['error']}}));}}}}}console[_0x1299b8(0x121)](JSON[_0x1299b8(0xfd)]({'type':_0x1299b8(0x129)}));}async[a8_0x364756(0x120)](_0x417ff9){const _0x283aa0=a8_0x364756,{options:_0x2b62f9,args:_0x2c6c73,tdx:_0x16d62d}=_0x417ff9,_0x7e80ba=_0x2c6c73[_0x283aa0(0x10e)]('\x20'),_0x2d1b96=_0x2b62f9,_0x203035=_0x2d1b96['agent'],_0x3f299c=_0x2d1b96[_0x283aa0(0x103)],_0x40f006=_0x2d1b96[_0x283aa0(0x112)],_0x20805d=_0x2d1b96[_0x283aa0(0x111)],_0x2505ad=_0x2d1b96[_0x283aa0(0x12b)],_0x15f557=_0x2d1b96[_0x283aa0(0x127)];if(_0x20805d&&_0x2505ad)return console[_0x283aa0(0x10a)](_0x283aa0(0x134)),0x1;try{let _0x31ec62,_0x7dd9ad;if(_0x2505ad)_0x7dd9ad=_0x2505ad;else!_0x20805d&&(_0x7dd9ad=loadLastChatId(),_0x7dd9ad&&_0x2b62f9[_0x283aa0(0x106)]&&console[_0x283aa0(0x10a)](_0x283aa0(0x11f)+_0x7dd9ad));!_0x2505ad&&(_0x20805d||!_0x7dd9ad)&&(_0x31ec62=await resolveAgentId(_0x16d62d,_0x203035,_0x3f299c,_0x40f006,_0x2b62f9['verbose']));const _0x2fb1ce=_0x15f557?(_0x155dc8,_0x2465c7,_0x51ae11)=>this[_0x283aa0(0x116)](_0x16d62d,_0x155dc8,_0x2465c7,_0x51ae11):(_0x49c3cd,_0x1a4466,_0xd82a22)=>this[_0x283aa0(0x122)](_0x16d62d,_0x49c3cd,_0x1a4466,_0xd82a22,_0x2b62f9['verbose']);try{await _0x2fb1ce(_0x7e80ba,_0x31ec62,_0x7dd9ad);}catch(_0x45b6be){const _0x25adc7=_0x45b6be instanceof SDKError&&_0x45b6be[_0x283aa0(0x131)]===ErrorCode[_0x283aa0(0xfa)]||_0x45b6be instanceof Error&&_0x45b6be[_0x283aa0(0x11a)]['includes']('404');if(_0x25adc7&&_0x2505ad)return console[_0x283aa0(0x10a)]('Error:\x20Chat\x20session\x20\x27'+_0x2505ad+'\x27\x20not\x20found'),0x1;if(_0x25adc7)_0x2b62f9[_0x283aa0(0x106)]&&console['error'](_0x283aa0(0xf0)),!_0x31ec62&&(_0x31ec62=await resolveAgentId(_0x16d62d,_0x203035,_0x3f299c,_0x40f006,_0x2b62f9['verbose'])),await _0x2fb1ce(_0x7e80ba,_0x31ec62,undefined);else throw _0x45b6be;}return!_0x15f557&&console[_0x283aa0(0x121)](),0x0;}catch(_0x1f09e6){return console[_0x283aa0(0x10a)](),handleSDKError(_0x1f09e6,_0x2b62f9),0x1;}}[a8_0x364756(0xfc)](_0x551359){const _0x14801f=a8_0x364756;if('content'in _0x551359)process[_0x14801f(0x10d)][_0x14801f(0xea)](_0x551359['content']);else _0x14801f(0x10a)in _0x551359&&console[_0x14801f(0x10a)](_0x14801f(0xf3)+_0x551359[_0x14801f(0x10a)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x364756(0x12d)]='chat-create';['description']=a8_0x364756(0x123);[a8_0x364756(0x11d)](_0x58cabd){const _0x1acc75=a8_0x364756,_0x12adcc=_0x58cabd[_0x1acc75(0xeb)],_0xb4594f=_0x12adcc[_0x1acc75(0xf7)],_0x5cb3a0=_0x12adcc[_0x1acc75(0x103)];if(!_0xb4594f&&!_0x5cb3a0)return _0x1acc75(0xf5);return undefined;}async[a8_0x364756(0x120)](_0x439acd){const _0x3e658d=a8_0x364756,{options:_0x4108bc,tdx:_0x215cda}=_0x439acd,_0x503217=_0x4108bc,_0x130e3d=_0x503217[_0x3e658d(0xf7)],_0x244075=_0x503217[_0x3e658d(0x103)],_0x19efda=_0x503217[_0x3e658d(0x112)];try{const _0x2a2f33=await resolveAgentId(_0x215cda,_0x130e3d,_0x244075,_0x19efda,_0x4108bc[_0x3e658d(0x106)]),_0x4468bd=await _0x215cda[_0x3e658d(0x10c)][_0x3e658d(0x100)](_0x2a2f33);return saveLastChatId(_0x4468bd['id']),console[_0x3e658d(0x121)](JSON[_0x3e658d(0xfd)]({'chatId':_0x4468bd['id'],'agentId':_0x2a2f33})),0x0;}catch(_0x45dc85){return handleSDKError(_0x45dc85,_0x4108bc),0x1;}}}
|