@treasuredata/tdx 0.28.7 → 0.29.0
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.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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.d.ts +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.d.ts +33 -0
- package/dist/sdk/segment/segment-validator.d.ts.map +1 -0
- package/dist/sdk/segment/segment-validator.js +1 -0
- package/dist/sdk/segment/segment-validator.js.map +1 -0
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +5 -179
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +259 -0
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/segment-schema.js +1 -0
- package/dist/sdk/segment/types/segment-schema.js.map +1 -0
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +27 -10
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +11 -2
- package/dist/sdk/types/cdp.d.ts.map +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/file-reader.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_0xf54aad=a3_0xe185;(function(_0x22cb96,_0x3f9b76){const _0x6cfa14=a3_0xe185,_0x56e5e4=_0x22cb96();while(!![]){try{const _0x52b130=-parseInt(_0x6cfa14(0x1ac))/0x1*(-parseInt(_0x6cfa14(0x199))/0x2)+parseInt(_0x6cfa14(0x1ba))/0x3*(-parseInt(_0x6cfa14(0x1aa))/0x4)+-parseInt(_0x6cfa14(0x1a1))/0x5+-parseInt(_0x6cfa14(0x1b7))/0x6+-parseInt(_0x6cfa14(0x1a6))/0x7*(parseInt(_0x6cfa14(0x195))/0x8)+-parseInt(_0x6cfa14(0x1ae))/0x9*(parseInt(_0x6cfa14(0x19e))/0xa)+parseInt(_0x6cfa14(0x1ad))/0xb;if(_0x52b130===_0x3f9b76)break;else _0x56e5e4['push'](_0x56e5e4['shift']());}catch(_0x736005){_0x56e5e4['push'](_0x56e5e4['shift']());}}}(a3_0x3251,0xd260d));function a3_0x3251(){const _0x2c83b6=['Resolved\x20parent\x20ID:\x20','21BumOIx','Resolving\x20child\x20segment\x20\x27','✔\x20Found\x20','verbose','1908qomcwF','Resolving\x20parent\x20segment\x20\x27','1079asOgln','68937880FseCUE','747gYZuMO','Parent\x20name:\x20','site','Site:\x20','Listing\x20activations\x20for\x20segment\x20\x27','description','length','Resolved\x20child\x20ID:\x20','\x20activation','8959428wtvtck','\x20\x20Cause:\x20','Child\x20name:\x20','8433YeMqfg','1707824NEvqCz','activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x27...','1624YvwRAU','segment','data','listActivations','resolveSegmentId','151270QUrvqV','Error:\x20Segment\x20name\x20is\x20required','error','7757295cjwGQb','cause','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','List\x20activations\x20for\x20a\x20segment'];a3_0x3251=function(){return _0x2c83b6;};return a3_0x3251();}function a3_0xe185(_0x408f32,_0x5e05bd){_0x408f32=_0x408f32-0x195;const _0x32517b=a3_0x3251();let _0xe185d9=_0x32517b[_0x408f32];return _0xe185d9;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';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{['name']=a3_0xf54aad(0x196);[a3_0xf54aad(0x1b3)]=a3_0xf54aad(0x1a4);async['execute'](_0x2ff57c){const _0x26bb28=a3_0xf54aad,{options:_0x17c514,args:_0x5ad911,tdx:_0x2e051e}=_0x2ff57c;if(_0x5ad911[_0x26bb28(0x1b4)]===0x0)return console[_0x26bb28(0x1a0)](_0x26bb28(0x19f)),console[_0x26bb28(0x1a0)](_0x26bb28(0x197)),0x1;try{const {parentId:_0x9e9389,childId:_0x298178}=parseSegmentRef(_0x5ad911[0x0]);if(!_0x298178)return console['error'](_0x26bb28(0x1a3)),console[_0x26bb28(0x1a0)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x17c514[_0x26bb28(0x1a9)]&&(console[_0x26bb28(0x1a0)](_0x26bb28(0x1b1)+_0x17c514[_0x26bb28(0x1b0)]),console[_0x26bb28(0x1a0)](_0x26bb28(0x1af)+_0x9e9389),console[_0x26bb28(0x1a0)](_0x26bb28(0x1b9)+_0x298178));const _0x456b15=await withSpinner(_0x26bb28(0x1ab)+_0x9e9389+_0x26bb28(0x198),()=>_0x2e051e[_0x26bb28(0x19a)]['resolveParentId'](_0x9e9389),{'verbose':_0x17c514[_0x26bb28(0x1a9)]}),_0x3ead07=_0x456b15[_0x26bb28(0x19b)];_0x17c514['verbose']&&console[_0x26bb28(0x1a0)](_0x26bb28(0x1a5)+_0x3ead07);const _0x4c33e6=await withSpinner(_0x26bb28(0x1a7)+_0x298178+'\x27...',()=>_0x2e051e[_0x26bb28(0x19a)][_0x26bb28(0x19d)](_0x3ead07,_0x298178),{'verbose':_0x17c514[_0x26bb28(0x1a9)]}),_0x29743e=_0x4c33e6['data'];_0x17c514['verbose']&&console[_0x26bb28(0x1a0)](_0x26bb28(0x1b5)+_0x29743e);const _0x1a40ca=await withSpinner(_0x26bb28(0x1b2)+_0x298178+_0x26bb28(0x198),()=>_0x2e051e['segment'][_0x26bb28(0x19c)](_0x3ead07,_0x29743e),{'verbose':_0x17c514[_0x26bb28(0x1a9)]}),_0x1110d0=_0x1a40ca[_0x26bb28(0x19b)];return console[_0x26bb28(0x1a0)](_0x26bb28(0x1a8)+_0x1110d0[_0x26bb28(0x1b4)]+_0x26bb28(0x1b6)+(_0x1110d0['length']!==0x1?'s':'')),await handleSDKOutput(_0x1110d0,_0x17c514),0x0;}catch(_0x2b0b08){if(_0x2b0b08 instanceof SDKError)return console[_0x26bb28(0x1a0)]('Error:\x20'+_0x2b0b08['message']),_0x2b0b08[_0x26bb28(0x1a2)]&&console['error'](_0x26bb28(0x1b8)+_0x2b0b08[_0x26bb28(0x1a2)]),0x1;throw _0x2b0b08;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x6e1237=a4_0x5925;function a4_0x2cd7(){const _0x5a5d3a=['-\x20nothing\x20pushed','experimentalKnowledgeBases','newProjectId','<new-name>','2ecyYdH','experimentalArtifacts','projectName','New\x20project\x20ID:\x20','2236115CvVtly','total','MISSING_ARGUMENT','Using\x20context\x20project:\x20','no_local_folder','agent:clone','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20|\x20','agent','Using\x20project:\x20','session','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','red','output','\x0aError:','agentName','arg-dir','projectId','52884dBNEAU','\x22...','outputPath','knowledgeBases','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','message','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Would\x20push\x20agent:\x20','680527GhwoqJ','integrations','5YmxPJw','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20integration\x20\x27','\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','1384185inUkYI','\x20\x20Knowledge\x20Base\x20\x22','description','unchanged','Agent\x20pulled\x20successfully','outputDir','\x20\x20Source:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','force','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20unchanged','cwd-config','\x0aPush\x20','dirname','join','agent.yml','\x20--profile\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','New\x20project:\x20','llm_project','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','8rtKuLt','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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)','llmProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','updated','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20errors','\x20resources\x20to\x20\x27','projectDir','tdx.json','Writing\x20files...','source','cyan','\x20\x20Experimental\x20Artifacts:\x20','Cloning\x20\x22','Errors:','newProjectName','Dry\x20run\x20-\x20no\x20changes\x20made','yes','\x20new','\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','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Prompt\x20\x22','Using\x20local\x20project:\x20','\x20=\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','pullAgent','log','new','\x0aProject\x20pushed\x20with\x20errors','yellow','textKnowledgeBases','No\x20tdx.json\x20found\x20in\x20','dim','6104760GCfeQQ','isNew','\x0aErrors\x20found:','no_context','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','agents','diff','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Text\x20Knowledge\x20Bases:\x20','Chat:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','error','INVALID_ARGUMENT','agentId','site','execute','\x20\x20Text\x20Knowledge\x20Base\x20\x22','sourceProjectName','Using\x20project\x20from\x20context:\x20','\x20created','errors','\x20\x20Prompts:\x20','\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','✔\x20Context\x20set:\x20','\x20\x20Agents:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','context','action','Pulling\x20agent\x20\x22','gray','\x22\x20to\x20a\x20different\x20profile','agent:pull','utf-8','\x20\x20tdx\x20agent\x20pull\x20','35676dNcByg','parse','Summary:','1430FETYYA','green','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','reason','Clone\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Analyzing\x20changes\x20to\x20push...','New\x20project\x20name\x20is\x20required','\x20files?','Agent:\x20','prompts','Project:\x20','llm','name','counts','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Artifact\x20\x22','-\x20no\x20files\x20written','agent:push','Pushing\x20agent\x20from\x20\x22','\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','push','\x20changed','Dry\x20run\x20-\x20no\x20files\x20written','Would\x20pull\x20agent:\x20','1166964VztBMg','profile','pullProject','\x20\x20Knowledge\x20Bases:\x20','\x0a✔\x20Pushed\x20','\x22:\x20','\x22\x20to\x20\x22','\x20\x20Integrations:\x20','dryRun','\x20updated','\x20resources?','Project\x20cloned\x20with\x20errors','created','hasChanges','Status:\x20','Using\x20project\x20from\x20','\x0aChanges:','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)','\x0aPull\x20summary\x20for\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20total','Cancelled','4136bXkBfV','Source:\x20','\x20\x20Agent\x20\x22','pushProject','Agent\x20','repeat'];a4_0x2cd7=function(){return _0x5a5d3a;};return a4_0x2cd7();}(function(_0x559f56,_0x2eed65){const _0x1792a2=a4_0x5925,_0x4d743a=_0x559f56();while(!![]){try{const _0x24de5b=parseInt(_0x1792a2(0x111))/0x1*(parseInt(_0x1792a2(0xf3))/0x2)+parseInt(_0x1792a2(0x117))/0x3*(-parseInt(_0x1792a2(0x12c))/0x4)+-parseInt(_0x1792a2(0x113))/0x5*(-parseInt(_0x1792a2(0x191))/0x6)+-parseInt(_0x1792a2(0xf7))/0x7+parseInt(_0x1792a2(0x152))/0x8+parseInt(_0x1792a2(0x109))/0x9*(-parseInt(_0x1792a2(0x178))/0xa)+-parseInt(_0x1792a2(0x1a7))/0xb*(-parseInt(_0x1792a2(0x175))/0xc);if(_0x24de5b===_0x2eed65)break;else _0x4d743a['push'](_0x4d743a['shift']());}catch(_0x20bd22){_0x4d743a['push'](_0x4d743a['shift']());}}}(a4_0x2cd7,0xa46b5));import a4_0x252438 from'chalk';import a4_0x44cbc4 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x5925(_0x20f4e2,_0x873433){_0x20f4e2=_0x20f4e2-0xed;const _0x2cd79b=a4_0x2cd7();let _0x59253a=_0x2cd79b[_0x20f4e2];return _0x59253a;}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(_0x4c9a9d){const _0x5b6478=a4_0x5925,_0x285036=[];if(_0x4c9a9d['total']!==undefined)_0x285036[_0x5b6478(0x18d)](_0x4c9a9d[_0x5b6478(0xf8)]+_0x5b6478(0x1a5));if(_0x4c9a9d[_0x5b6478(0x14c)]!==undefined&&_0x4c9a9d[_0x5b6478(0x14c)]>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438['green'](_0x4c9a9d[_0x5b6478(0x14c)]+_0x5b6478(0x140)));if(_0x4c9a9d['created']!==undefined&&_0x4c9a9d['created']>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438[_0x5b6478(0x179)](_0x4c9a9d['created']+_0x5b6478(0x166)));if(_0x4c9a9d[_0x5b6478(0x131)]!==undefined&&_0x4c9a9d[_0x5b6478(0x131)]>0x0)_0x285036['push'](a4_0x252438[_0x5b6478(0x14e)](_0x4c9a9d[_0x5b6478(0x131)]+_0x5b6478(0x19a)));if(_0x4c9a9d['unchanged']!==undefined&&_0x4c9a9d[_0x5b6478(0x11a)]>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438[_0x5b6478(0x170)](_0x4c9a9d[_0x5b6478(0x11a)]+_0x5b6478(0x121)));if(_0x4c9a9d['errors']!==undefined&&_0x4c9a9d[_0x5b6478(0x167)]>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438['red'](_0x4c9a9d[_0x5b6478(0x167)]+_0x5b6478(0x133)));return _0x285036[_0x5b6478(0x125)](',\x20');}function displayDiffs(_0x504f22,_0x5e2328,_0x2fd899,_0x3bc038,_0x257c9a,_0x39e946,_0x61f3ab){const _0x486cb7=a4_0x5925;for(const _0x3cf381 of _0x504f22){if(_0x3cf381[_0x486cb7(0x159)]){const _0x1af8ca=_0x3cf381['agentName']||_0x3cf381['name'];console[_0x486cb7(0x14b)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x1af8ca+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console['log'](_0x3cf381[_0x486cb7(0x159)]),console['log']('─'[_0x486cb7(0xee)](0x3c));}}for(const _0x104519 of _0x5e2328){_0x104519[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)](_0x486cb7(0x10f)+_0x104519[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x104519[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x313453 of _0x2fd899){_0x313453[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)](_0x486cb7(0x11e)+_0x313453[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x313453[_0x486cb7(0x159)]),console['log']('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x446914 of _0x3bc038){_0x446914[_0x486cb7(0x159)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x446914[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x446914[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0xc26be1 of _0x257c9a){_0xc26be1['diff']&&(console[_0x486cb7(0x14b)](_0x486cb7(0x115)+_0xc26be1[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console['log'](_0xc26be1[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x76569e of _0x39e946){_0x76569e[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x76569e[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x76569e[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x1e9023 of _0x61f3ab){_0x1e9023[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)](_0x486cb7(0xfd)+_0x1e9023['name']+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x1e9023[_0x486cb7(0x159)]),console['log']('─'[_0x486cb7(0xee)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x6e1237(0x172);[a4_0x6e1237(0x119)]=a4_0x6e1237(0x1a4);async['execute'](_0x17d92d){const _0x1d1c27=a4_0x6e1237,{options:_0xb1de24,args:_0x19aa52,tdx:_0x110c8c}=_0x17d92d,_0x5f04dc=_0x19aa52[0x0],_0x597c63=_0x19aa52[0x1],_0x179010=_0xb1de24[_0x1d1c27(0x104)],_0xa517b5=_0xb1de24[_0x1d1c27(0x199)],_0xc32a58=_0xb1de24[_0x1d1c27(0x11f)],_0x4838f6=_0xb1de24[_0x1d1c27(0x13f)],_0x5882e2=_0xb1de24['llmProject'],_0x5f151b=_0xb1de24[_0x1d1c27(0xff)];let _0x5609ac;if(_0x5f04dc){const _0x48accd=a4_0x44cbc4['join'](_0x5f04dc,_0x1d1c27(0x136));if(existsSync(_0x48accd))try{const _0x4a9f6f=JSON[_0x1d1c27(0x176)](readFileSync(_0x48accd,_0x1d1c27(0x173)));_0x4a9f6f[_0x1d1c27(0x12a)]&&(_0x5609ac={'llm_project':_0x4a9f6f[_0x1d1c27(0x12a)]});}catch{}}const _0x3a105b=findAgentConfigPath(process['cwd']());let _0x3fe9b8;if(_0x3a105b)try{const _0x13fd4d=JSON[_0x1d1c27(0x176)](readFileSync(_0x3a105b,_0x1d1c27(0x173)));_0x13fd4d['llm_project']&&(_0x3fe9b8={'llm_project':_0x13fd4d[_0x1d1c27(0x12a)]});}catch{}const _0x580898=resolveAgentPullArgs({'arg':_0x5f04dc,'agentNameArg':_0x597c63,'agentFlag':_0x5f151b,'contextProject':_0x5882e2,'argDirConfig':_0x5609ac,'cwdConfigPath':_0x3a105b||undefined,'cwdConfig':_0x3fe9b8}),{projectNameOrId:_0x5cf4e1,targetAgentName:_0x35fbdf,existingOutputDir:_0x4acc27,source:_0x6069e0}=_0x580898;if(_0x6069e0===_0x1d1c27(0x107))console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x1a0)+a4_0x44cbc4[_0x1d1c27(0x125)](_0x5f04dc,_0x1d1c27(0x136))+':\x20'+_0x5cf4e1));else{if(_0x6069e0===_0x1d1c27(0x122))console[_0x1d1c27(0x14b)](a4_0x252438['dim'](_0x1d1c27(0x100)+_0x5cf4e1));else _0x6069e0==='context'&&console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x165)+_0x5cf4e1));}if(!_0x5cf4e1)return _0x5f151b?(console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1d1c27(0x14b)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x1d1c27(0x132))):(console['log'](a4_0x252438[_0x1d1c27(0x14e)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1d1c27(0x14b)](_0x1d1c27(0x1a2)),console['log'](_0x1d1c27(0x141)),console[_0x1d1c27(0x14b)](_0x1d1c27(0x116)),console[_0x1d1c27(0x14b)](_0x1d1c27(0x169)),console[_0x1d1c27(0x14b)](_0x1d1c27(0x18c))),0x1;if(_0x35fbdf){const {data:_0x1cd9dd}=await withSpinner(_0x1d1c27(0x16f)+_0x35fbdf+'\x22\x20from\x20project\x20\x22'+_0x5cf4e1+'\x22...',()=>_0x110c8c[_0x1d1c27(0x184)][_0x1d1c27(0x14a)](_0x5cf4e1,_0x35fbdf,_0x179010,{'dryRun':_0xa517b5,'force':_0xc32a58}));if(_0xa517b5)return console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x18f))),console[_0x1d1c27(0x14b)](_0x1d1c27(0x190)+_0x1cd9dd[_0x1d1c27(0x106)]),console['log']('Output\x20path:\x20'+_0x1cd9dd[_0x1d1c27(0x10b)]),_0x1cd9dd[_0x1d1c27(0x159)]&&(console[_0x1d1c27(0x14b)](_0x1d1c27(0x1a1)),console[_0x1d1c27(0x14b)]('─'[_0x1d1c27(0xee)](0x3c)),console[_0x1d1c27(0x14b)](_0x1cd9dd['diff']),console[_0x1d1c27(0x14b)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x252438['green'](_0x1d1c27(0x11b))),console[_0x1d1c27(0x14b)](_0x1d1c27(0x181)+_0x1cd9dd[_0x1d1c27(0x106)]),console[_0x1d1c27(0x14b)]('Output:\x20'+_0x1cd9dd[_0x1d1c27(0x10b)]),console['log'](_0x1d1c27(0x19f)+(_0x1cd9dd[_0x1d1c27(0x153)]?a4_0x252438[_0x1d1c27(0x179)]('new'):_0x1cd9dd[_0x1d1c27(0x19e)]?a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x131)):a4_0x252438[_0x1d1c27(0x170)](_0x1d1c27(0x11a)))),0x0;}const _0x1c0686=_0x4acc27||_0x179010,{data:_0x36794d}=await withSpinner('Analyzing\x20project\x20\x22'+_0x5cf4e1+_0x1d1c27(0x10a),()=>_0x110c8c[_0x1d1c27(0x184)][_0x1d1c27(0x193)](_0x5cf4e1,_0x1c0686,{'dryRun':!![]})),_0x4f2995=_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x158)]['new']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x10c)][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x14f)]['new']+_0x36794d[_0x1d1c27(0x186)]['prompts'][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)]['experimentalKnowledgeBases'][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)]['experimentalArtifacts'][_0x1d1c27(0x14c)],_0x20e7a4=_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x158)][_0x1d1c27(0x131)]+_0x36794d['counts'][_0x1d1c27(0x10c)]['updated']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x14f)]['updated']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x182)][_0x1d1c27(0x131)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)][_0x1d1c27(0x131)]+_0x36794d['counts'][_0x1d1c27(0xf0)][_0x1d1c27(0x131)]+_0x36794d['counts'][_0x1d1c27(0xf4)][_0x1d1c27(0x131)],_0x6fb25d=_0x36794d['counts'][_0x1d1c27(0x158)]['unchanged']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x10c)][_0x1d1c27(0x11a)]+_0x36794d[_0x1d1c27(0x186)]['textKnowledgeBases'][_0x1d1c27(0x11a)]+_0x36794d['counts'][_0x1d1c27(0x182)][_0x1d1c27(0x11a)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)][_0x1d1c27(0x11a)]+_0x36794d['counts']['experimentalKnowledgeBases'][_0x1d1c27(0x11a)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf4)][_0x1d1c27(0x11a)];console[_0x1d1c27(0x14b)](_0x1d1c27(0x1a3)+_0x36794d[_0x1d1c27(0xf5)]+'\x27:'),console['log']('\x20\x20'+a4_0x252438[_0x1d1c27(0x179)]('+\x20'+_0x4f2995+_0x1d1c27(0x140))+_0x1d1c27(0xfe)+a4_0x252438[_0x1d1c27(0x14e)]('~\x20'+_0x20e7a4+_0x1d1c27(0x18e))+_0x1d1c27(0xfe)+a4_0x252438[_0x1d1c27(0x151)]('=\x20'+_0x6fb25d+_0x1d1c27(0x121))),console[_0x1d1c27(0x14b)](_0x1d1c27(0x16b)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x158)])),console[_0x1d1c27(0x14b)](_0x1d1c27(0x194)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x10c)])),console[_0x1d1c27(0x14b)](_0x1d1c27(0x15b)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x14f)])),console[_0x1d1c27(0x14b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x36794d['counts']['prompts'])),console[_0x1d1c27(0x14b)](_0x1d1c27(0x198)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)]));const _0x41c52a=_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf0)][_0x1d1c27(0xf8)]>0x0||_0x36794d['counts'][_0x1d1c27(0xf4)]['total']>0x0;_0x41c52a&&(console[_0x1d1c27(0x14b)](_0x1d1c27(0x17a)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf0)])),console[_0x1d1c27(0x14b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf4)])));console[_0x1d1c27(0x14b)]('\x20\x20Target:\x20'+a4_0x252438[_0x1d1c27(0x139)](_0x36794d[_0x1d1c27(0x11c)])),displayDiffs(_0x36794d[_0x1d1c27(0x158)],_0x36794d['knowledgeBases'],_0x36794d[_0x1d1c27(0x14f)],_0x36794d[_0x1d1c27(0x182)],_0x36794d[_0x1d1c27(0x112)],_0x36794d[_0x1d1c27(0xf0)],_0x36794d[_0x1d1c27(0xf4)]);if(_0xa517b5)return console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x12b))),0x0;if(_0x4f2995===0x0&&_0x20e7a4===0x0)return console[_0x1d1c27(0x14b)](a4_0x252438['green'](_0x1d1c27(0x148))),saveSessionContext({'llm_project':_0x36794d[_0x1d1c27(0xf5)]},_0xb1de24[_0x1d1c27(0x101)]),console['log'](a4_0x252438[_0x1d1c27(0x179)](_0x1d1c27(0x16a)+a4_0x252438[_0x1d1c27(0x151)]('llm_project')+_0x1d1c27(0x146)+a4_0x252438[_0x1d1c27(0x139)](_0x36794d[_0x1d1c27(0xf5)]))),0x0;if(!_0x4838f6&&!_0xc32a58){if(!isInteractive())return console['error'](a4_0x252438[_0x1d1c27(0x103)](_0x1d1c27(0x105)),_0x1d1c27(0x130)),console['error'](a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x12d))),0x1;const _0xaeedf9=await confirmKey('\x0aWrite\x20'+(_0x4f2995+_0x20e7a4)+_0x1d1c27(0x180));if(!_0xaeedf9)return console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x1a6)),_0x1d1c27(0x189)),0x1;}const {data:_0x1e134a}=await withSpinner(_0x1d1c27(0x137),()=>_0x110c8c[_0x1d1c27(0x184)][_0x1d1c27(0x193)](_0x5cf4e1,_0x1c0686,{'force':_0xc32a58}));return console[_0x1d1c27(0x14b)](a4_0x252438['green']('\x0a✔\x20Pulled\x20'+(_0x4f2995+_0x20e7a4)+'\x20files\x20to\x20'+_0x1e134a[_0x1d1c27(0x11c)])),saveSessionContext({'llm_project':_0x1e134a[_0x1d1c27(0xf5)]},_0xb1de24[_0x1d1c27(0x101)]),console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x179)](_0x1d1c27(0x16a)+a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x12a))+_0x1d1c27(0x146)+a4_0x252438['cyan'](_0x1e134a[_0x1d1c27(0xf5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x6e1237(0x185)]=a4_0x6e1237(0xfc);[a4_0x6e1237(0x119)]=a4_0x6e1237(0x15d);async[a4_0x6e1237(0x162)](_0x16b4f1){const _0x41b9fb=a4_0x6e1237,{options:_0x3c6bef,args:_0xf46bb0,tdx:_0x5d7e30}=_0x16b4f1,_0x40fdbf=_0xf46bb0[0x0],_0x6f954b=_0x3c6bef[_0x41b9fb(0x185)],_0x4c91b7=_0x3c6bef[_0x41b9fb(0x199)],_0x3a7be7=_0x3c6bef['yes'],_0x5cbdfe=_0x3c6bef['site'],_0xbb6c14=_0x3c6bef[_0x41b9fb(0x12f)];let _0x24776b;const _0x410c97=findAgentConfigPath(process[_0x41b9fb(0x157)]());if(_0x40fdbf){const _0x4d88c1=a4_0x44cbc4['join'](_0x40fdbf,_0x41b9fb(0x136));existsSync(_0x4d88c1)?(_0x24776b=_0x40fdbf,console[_0x41b9fb(0x14b)](a4_0x252438['dim'](_0x41b9fb(0x145)+_0x40fdbf))):_0x24776b=_0x40fdbf;}else{if(_0x410c97)_0x24776b=a4_0x44cbc4['dirname'](_0x410c97),console['log'](a4_0x252438[_0x41b9fb(0x151)]('Using\x20current\x20project:\x20'+_0x24776b));else{if(_0xbb6c14){const _0x1ec6db=sanitizeForFilesystem(_0xbb6c14);let _0x530d10=_0x1ec6db,_0x46ba64=a4_0x44cbc4[_0x41b9fb(0x125)](process[_0x41b9fb(0x157)](),_0x41b9fb(0x158),_0x1ec6db,_0x41b9fb(0x136));if(!existsSync(_0x46ba64)){const _0x186079=normalizeName(_0xbb6c14),_0x3e8b5b=a4_0x44cbc4['join'](process['cwd'](),_0x41b9fb(0x158),_0x186079,_0x41b9fb(0x136));existsSync(_0x3e8b5b)&&(_0x530d10=_0x186079,_0x46ba64=_0x3e8b5b);}if(existsSync(_0x46ba64))_0x24776b=a4_0x44cbc4[_0x41b9fb(0x124)](_0x46ba64),console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x151)](_0x41b9fb(0x145)+_0x24776b));else{const _0x472eaa=_0x3c6bef[_0x41b9fb(0x192)];if(_0x472eaa)throw new SDKError(ErrorCode[_0x41b9fb(0x15f)],_0x41b9fb(0x142)+_0xbb6c14+_0x41b9fb(0x171),undefined,{'helpText':_0x41b9fb(0x147)+_0x41b9fb(0x102)+(_0x41b9fb(0x174)+_0xbb6c14+'\x0a')+(_0x41b9fb(0x156)+_0x530d10+'\x20--name\x20'+(_0x6f954b||_0x41b9fb(0xf2))+_0x41b9fb(0x127)+_0x472eaa)});_0x24776b=_0xbb6c14,console[_0x41b9fb(0x14b)](a4_0x252438['dim'](_0x41b9fb(0xfa)+_0xbb6c14));}}}}if(!_0x24776b)return console[_0x41b9fb(0x14b)](a4_0x252438['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x41b9fb(0x15a)),console[_0x41b9fb(0x14b)](_0x41b9fb(0x143)),console[_0x41b9fb(0x14b)](_0x41b9fb(0x12e)),console['log'](_0x41b9fb(0x17d)),0x1;if(!_0x6f954b)throw new SDKError(ErrorCode[_0x41b9fb(0xf9)],_0x41b9fb(0x17f),undefined,{'helpText':_0x41b9fb(0x128)});if(!_0x3a7be7&&!_0x4c91b7){if(!isInteractive())return console[_0x41b9fb(0x15e)](a4_0x252438['red'](_0x41b9fb(0x105)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41b9fb(0x15e)](a4_0x252438[_0x41b9fb(0x151)](_0x41b9fb(0x12d))),0x1;const _0xc17c97=await confirmKey(_0x41b9fb(0x17c)+_0x24776b+'\x22\x20to\x20new\x20project\x20\x22'+_0x6f954b+'\x22?');if(!_0xc17c97)return console['log'](a4_0x252438[_0x41b9fb(0x14e)](_0x41b9fb(0x1a6))),0x1;}const {data:_0x12950d}=await withSpinner(_0x41b9fb(0x13b)+_0x24776b+_0x41b9fb(0x197)+_0x6f954b+_0x41b9fb(0x10a),()=>_0x5d7e30[_0x41b9fb(0x184)]['cloneProject'](_0x24776b,_0x6f954b,{'dryRun':_0x4c91b7}));if(_0x4c91b7){console['log'](a4_0x252438[_0x41b9fb(0x14e)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x41b9fb(0x14b)](_0x41b9fb(0x1a8)+_0x12950d[_0x41b9fb(0x164)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0x129)+_0x6f954b),console[_0x41b9fb(0x14b)]('Would\x20clone:'),console[_0x41b9fb(0x14b)](_0x41b9fb(0x16b)+_0x12950d['counts'][_0x41b9fb(0x158)]['created']),console['log'](_0x41b9fb(0x194)+_0x12950d['counts'][_0x41b9fb(0x10c)]['created']),console[_0x41b9fb(0x14b)](_0x41b9fb(0x168)+_0x12950d[_0x41b9fb(0x186)]['prompts'][_0x41b9fb(0x19d)]);const _0x3a7848=_0x12950d[_0x41b9fb(0x186)]['experimentalKnowledgeBases'][_0x41b9fb(0x19d)]>0x0||_0x12950d['counts']['experimentalArtifacts'][_0x41b9fb(0x19d)]>0x0;return _0x3a7848&&(console[_0x41b9fb(0x14b)](_0x41b9fb(0x17a)+_0x12950d[_0x41b9fb(0x186)]['experimentalKnowledgeBases'][_0x41b9fb(0x19d)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0x13a)+_0x12950d['counts'][_0x41b9fb(0xf4)][_0x41b9fb(0x19d)])),0x0;}const _0x13c802=_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0x158)]['errors']>0x0||_0x12950d[_0x41b9fb(0x186)]['knowledgeBases'][_0x41b9fb(0x167)]>0x0||_0x12950d['counts']['prompts'][_0x41b9fb(0x167)]>0x0||_0x12950d['counts'][_0x41b9fb(0xf0)][_0x41b9fb(0x167)]>0x0||_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf4)][_0x41b9fb(0x167)]>0x0;_0x13c802?console['log'](a4_0x252438[_0x41b9fb(0x14e)](_0x41b9fb(0x19c))):console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x179)]('Project\x20cloned\x20successfully'));console[_0x41b9fb(0x14b)](_0x41b9fb(0x1a8)+_0x12950d[_0x41b9fb(0x164)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0x129)+_0x12950d[_0x41b9fb(0x13d)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0xf6)+_0x12950d[_0x41b9fb(0xf1)]),console[_0x41b9fb(0x14b)](),console[_0x41b9fb(0x14b)](_0x41b9fb(0x177)),console[_0x41b9fb(0x14b)](_0x41b9fb(0x16b)+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0x158)])),console[_0x41b9fb(0x14b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x12950d['counts'][_0x41b9fb(0x10c)])),console[_0x41b9fb(0x14b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x12950d['counts'][_0x41b9fb(0x182)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0x112)]));const _0x1cf43e=_0x12950d['counts'][_0x41b9fb(0xf0)][_0x41b9fb(0x19d)]>0x0||_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf0)]['updated']>0x0||_0x12950d[_0x41b9fb(0x186)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x12950d['counts']['experimentalArtifacts'][_0x41b9fb(0x19d)]>0x0||_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf4)][_0x41b9fb(0x131)]>0x0||_0x12950d['counts']['experimentalArtifacts'][_0x41b9fb(0x11a)]>0x0;_0x1cf43e&&(console[_0x41b9fb(0x14b)](_0x41b9fb(0x17a)+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf0)])),console[_0x41b9fb(0x14b)](_0x41b9fb(0x13a)+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf4)])));if(_0x13c802){console['log'](),console['log'](a4_0x252438['red'](_0x41b9fb(0x13c)));for(const _0x269e68 of _0x12950d['agents']){_0x269e68[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438['red'](_0x41b9fb(0x1a9)+_0x269e68['agentName']+_0x41b9fb(0x196)+_0x269e68[_0x41b9fb(0x15e)]));}for(const _0x1f38dd of _0x12950d[_0x41b9fb(0x10c)]){_0x1f38dd[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x118)+_0x1f38dd[_0x41b9fb(0x185)]+_0x41b9fb(0x196)+_0x1f38dd[_0x41b9fb(0x15e)]));}for(const _0x2c7be0 of _0x12950d[_0x41b9fb(0x182)]){_0x2c7be0[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x144)+_0x2c7be0[_0x41b9fb(0x185)]+_0x41b9fb(0x196)+_0x2c7be0[_0x41b9fb(0x15e)]));}for(const _0x50c7e5 of _0x12950d[_0x41b9fb(0x112)]){_0x50c7e5[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console['log'](a4_0x252438['red']('\x20\x20Integration\x20\x22'+_0x50c7e5[_0x41b9fb(0x185)]+_0x41b9fb(0x196)+_0x50c7e5[_0x41b9fb(0x15e)]));}for(const _0x4d7a5d of _0x12950d[_0x41b9fb(0xf0)]){_0x4d7a5d[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x16c)+_0x4d7a5d['name']+_0x41b9fb(0x196)+_0x4d7a5d[_0x41b9fb(0x15e)]));}for(const _0x4b02f1 of _0x12950d[_0x41b9fb(0xf4)]){_0x4b02f1[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x188)+_0x4b02f1[_0x41b9fb(0x185)]+'\x22:\x20'+_0x4b02f1[_0x41b9fb(0x15e)]));}return 0x1;}console['log']();const _0x347213=getLLMProjectUrl(_0x5cbdfe,_0x12950d[_0x41b9fb(0xf1)]);return console[_0x41b9fb(0x14b)](_0x41b9fb(0x183)+a4_0x252438['cyan'](_0x347213)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x6e1237(0x18a);['description']=a4_0x6e1237(0x149);async[a4_0x6e1237(0x162)](_0xaf849e){const _0xfee648=a4_0x6e1237,{options:_0x3c78cc,args:_0x573fb0,tdx:_0x4f5d8a}=_0xaf849e;let _0x1cc336=_0x573fb0[0x0]||process[_0xfee648(0x157)]();const _0x5e1f3e=_0x3c78cc[_0xfee648(0x199)],_0xa94ad0=_0x3c78cc[_0xfee648(0x11f)],_0xec2838=_0x3c78cc[_0xfee648(0x13f)],_0x54074e=_0x3c78cc[_0xfee648(0x161)],_0x1c2916=a4_0x44cbc4[_0xfee648(0x125)](_0x1cc336,_0xfee648(0x126)),_0x45d078=existsSync(_0x1c2916);if(_0x45d078){const {data:_0x357f67}=await withSpinner(_0xfee648(0x18b)+_0x1cc336+_0xfee648(0x10a),()=>_0x4f5d8a[_0xfee648(0x184)]['pushAgent'](_0x1cc336,{'dryRun':_0x5e1f3e,'force':_0xa94ad0}));if(_0x5e1f3e)return console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x14e)](_0xfee648(0x13e))),console[_0xfee648(0x14b)](_0xfee648(0x110)+_0x357f67[_0xfee648(0x106)]),0x0;if(_0x357f67[_0xfee648(0x16e)]===_0xfee648(0x15e))return console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x114)+_0x357f67[_0xfee648(0x15e)])),0x1;console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x179)](_0xfee648(0xed)+_0x357f67[_0xfee648(0x16e)]+'\x20successfully')),console[_0xfee648(0x14b)]('Agent:\x20'+_0x357f67[_0xfee648(0x106)]);if(_0x357f67[_0xfee648(0x160)]&&_0x357f67[_0xfee648(0x108)]){const _0x3577af=getLLMAgentChatUrl(_0x54074e,_0x357f67[_0xfee648(0x108)],_0x357f67[_0xfee648(0x160)]);console[_0xfee648(0x14b)](_0xfee648(0x15c)+a4_0x252438[_0xfee648(0x139)](_0x3577af));}return 0x0;}const _0x3bd729=_0x3c78cc[_0xfee648(0x12f)],_0x562a5c=resolveProjectFromContext(_0x1cc336,_0x3bd729);if(_0x562a5c['found'])_0x1cc336=_0x562a5c[_0xfee648(0x135)],_0x562a5c[_0xfee648(0x138)]===_0xfee648(0x16d)&&console['log'](a4_0x252438[_0xfee648(0x151)](_0xfee648(0x100)+_0x1cc336));else{let _0x1880e5='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x562a5c[_0xfee648(0x17b)]===_0xfee648(0xfb)&&(_0x1880e5=_0x562a5c['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x562a5c[_0xfee648(0x12f)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0xfee648(0x15f)],_0x562a5c[_0xfee648(0x17b)]===_0xfee648(0x155)?_0x562a5c[_0xfee648(0x10e)]:_0xfee648(0x150)+_0x1cc336,undefined,{'helpText':_0x1880e5});}const {data:_0x150aa3}=await withSpinner(_0xfee648(0x17e),()=>_0x4f5d8a[_0xfee648(0x184)][_0xfee648(0x1aa)](_0x1cc336,{'dryRun':!![]})),_0x79de5c=_0x150aa3[_0xfee648(0x186)][_0xfee648(0x158)][_0xfee648(0x167)]>0x0;if(_0x79de5c){console[_0xfee648(0x14b)](a4_0x252438['red'](_0xfee648(0x154)));for(const _0x295614 of _0x150aa3[_0xfee648(0x158)]){_0x295614[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console[_0xfee648(0x14b)](a4_0x252438['red'](_0xfee648(0x1a9)+_0x295614[_0xfee648(0x106)]+'\x22:\x20'+_0x295614['error']));}return 0x1;}const _0x22d3c7=_0x150aa3['counts'][_0xfee648(0x158)][_0xfee648(0x19d)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x10c)][_0xfee648(0x19d)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x14f)]['created']+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x182)][_0xfee648(0x19d)]+_0x150aa3['counts'][_0xfee648(0x112)][_0xfee648(0x19d)]+_0x150aa3['counts'][_0xfee648(0xf0)][_0xfee648(0x19d)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x19d)],_0x3b1843=_0x150aa3[_0xfee648(0x186)][_0xfee648(0x158)]['updated']+_0x150aa3['counts'][_0xfee648(0x10c)][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x14f)][_0xfee648(0x131)]+_0x150aa3['counts'][_0xfee648(0x182)][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)]['integrations'][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)]['experimentalKnowledgeBases'][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)]['updated'],_0x12279e=_0x150aa3[_0xfee648(0x186)]['agents'][_0xfee648(0x11a)]+_0x150aa3['counts'][_0xfee648(0x10c)][_0xfee648(0x11a)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x14f)]['unchanged']+_0x150aa3['counts']['prompts'][_0xfee648(0x11a)]+_0x150aa3['counts'][_0xfee648(0x112)][_0xfee648(0x11a)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x11a)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x11a)];console[_0xfee648(0x14b)](_0xfee648(0x187)+_0x150aa3['projectName']+'\x27:'),console[_0xfee648(0x14b)]('\x20\x20'+a4_0x252438[_0xfee648(0x179)]('+\x20'+_0x22d3c7+_0xfee648(0x140))+_0xfee648(0xfe)+a4_0x252438[_0xfee648(0x14e)]('~\x20'+_0x3b1843+_0xfee648(0x18e))+'\x20|\x20'+a4_0x252438['dim']('=\x20'+_0x12279e+'\x20unchanged')),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x150aa3[_0xfee648(0x186)]['agents'])),console['log'](_0xfee648(0x194)+formatCountSummary(_0x150aa3[_0xfee648(0x186)][_0xfee648(0x10c)])),console[_0xfee648(0x14b)](_0xfee648(0x15b)+formatCountSummary(_0x150aa3['counts'][_0xfee648(0x14f)])),console[_0xfee648(0x14b)](_0xfee648(0x168)+formatCountSummary(_0x150aa3['counts'][_0xfee648(0x182)])),console['log'](_0xfee648(0x198)+formatCountSummary(_0x150aa3[_0xfee648(0x186)][_0xfee648(0x112)]));const _0x2adec7=_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x19d)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x131)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x11a)]>0x0||_0x150aa3['counts'][_0xfee648(0xf4)][_0xfee648(0x19d)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x131)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x11a)]>0x0;_0x2adec7&&(console[_0xfee648(0x14b)](_0xfee648(0x17a)+formatCountSummary(_0x150aa3['counts']['experimentalKnowledgeBases'])),console[_0xfee648(0x14b)](_0xfee648(0x13a)+formatCountSummary(_0x150aa3[_0xfee648(0x186)]['experimentalArtifacts'])));console[_0xfee648(0x14b)](_0xfee648(0x11d)+a4_0x252438[_0xfee648(0x139)](_0x1cc336)),displayDiffs(_0x150aa3[_0xfee648(0x158)],_0x150aa3[_0xfee648(0x10c)],_0x150aa3[_0xfee648(0x14f)],_0x150aa3[_0xfee648(0x182)],_0x150aa3['integrations'],_0x150aa3[_0xfee648(0xf0)],_0x150aa3[_0xfee648(0xf4)]);if(_0x5e1f3e)return console['log'](a4_0x252438['yellow'](_0xfee648(0x10d))),0x0;if(_0x22d3c7===0x0&&_0x3b1843===0x0){console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x179)](_0xfee648(0x120)));const _0x4fe623=getLLMProjectUrl(_0x54074e,_0x150aa3[_0xfee648(0x108)]);return console[_0xfee648(0x14b)](_0xfee648(0x183)+a4_0x252438[_0xfee648(0x139)](_0x4fe623)),0x0;}if(!_0xec2838&&!_0xa94ad0){if(!isInteractive())return console[_0xfee648(0x15e)](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x105)),_0xfee648(0x130)),console['error'](a4_0x252438[_0xfee648(0x151)](_0xfee648(0x12d))),0x1;const _0x388184=await confirmKey(_0xfee648(0x123)+(_0x22d3c7+_0x3b1843)+_0xfee648(0x19b));if(!_0x388184)return console['log'](a4_0x252438[_0xfee648(0x14e)](_0xfee648(0x1a6)),_0xfee648(0xef)),0x1;}const {data:_0x314103}=await withSpinner('Pushing\x20to\x20project...',()=>_0x4f5d8a[_0xfee648(0x184)][_0xfee648(0x1aa)](_0x1cc336,{'force':_0xa94ad0})),_0x372e7c=_0x314103['counts']['agents'][_0xfee648(0x167)]>0x0||_0x314103[_0xfee648(0x186)][_0xfee648(0x10c)][_0xfee648(0x167)]>0x0||_0x314103[_0xfee648(0x186)]['textKnowledgeBases']['errors']>0x0||_0x314103[_0xfee648(0x186)][_0xfee648(0x182)][_0xfee648(0x167)]>0x0;if(_0x372e7c){console['log'](a4_0x252438[_0xfee648(0x14e)](_0xfee648(0x14d))),console[_0xfee648(0x14b)](),console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x13c)));for(const _0x5c5a1b of _0x314103[_0xfee648(0x158)]){_0x5c5a1b['action']===_0xfee648(0x15e)&&console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x1a9)+_0x5c5a1b[_0xfee648(0x106)]+_0xfee648(0x196)+_0x5c5a1b['error']));}for(const _0x2e05cc of _0x314103[_0xfee648(0x10c)]){_0x2e05cc[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x118)+_0x2e05cc[_0xfee648(0x185)]+_0xfee648(0x196)+_0x2e05cc[_0xfee648(0x15e)]));}for(const _0x12b322 of _0x314103[_0xfee648(0x14f)]){_0x12b322[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console[_0xfee648(0x14b)](a4_0x252438['red'](_0xfee648(0x163)+_0x12b322['name']+'\x22:\x20'+_0x12b322['error']));}for(const _0x5e502d of _0x314103['prompts']){_0x5e502d[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x144)+_0x5e502d[_0xfee648(0x185)]+'\x22:\x20'+_0x5e502d['error']));}for(const _0x99791a of _0x314103['integrations']){_0x99791a['action']==='error'&&console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x103)]('\x20\x20Integration\x20\x22'+_0x99791a['name']+_0xfee648(0x196)+_0x99791a[_0xfee648(0x15e)]));}return 0x1;}console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x179)](_0xfee648(0x195)+(_0x22d3c7+_0x3b1843)+_0xfee648(0x134)+_0x314103[_0xfee648(0xf5)]+'\x27'));const _0x27ee60=getLLMProjectUrl(_0x54074e,_0x314103[_0xfee648(0x108)]);return console[_0xfee648(0x14b)](_0xfee648(0x183)+a4_0x252438[_0xfee648(0x139)](_0x27ee60)),0x0;}}
|
|
1
|
+
const a4_0x80e2a5=a4_0x27f9;(function(_0x5992e3,_0x40fbce){const _0x584ae0=a4_0x27f9,_0x2006ef=_0x5992e3();while(!![]){try{const _0x4aa4ec=parseInt(_0x584ae0(0x9c))/0x1+-parseInt(_0x584ae0(0x98))/0x2+-parseInt(_0x584ae0(0xc0))/0x3+-parseInt(_0x584ae0(0x74))/0x4+-parseInt(_0x584ae0(0xda))/0x5+parseInt(_0x584ae0(0xcc))/0x6+parseInt(_0x584ae0(0xbe))/0x7;if(_0x4aa4ec===_0x40fbce)break;else _0x2006ef['push'](_0x2006ef['shift']());}catch(_0x29a9f5){_0x2006ef['push'](_0x2006ef['shift']());}}}(a4_0x50d2,0x83db1));import a4_0x2e9eea from'chalk';import a4_0x53f2df from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x27f9(_0x3468ed,_0x4b7a6d){_0x3468ed=_0x3468ed-0x72;const _0x50d2e7=a4_0x50d2();let _0x27f99d=_0x50d2e7[_0x3468ed];return _0x27f99d;}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(_0x550d35){const _0x1a250e=a4_0x27f9,_0x1e915e=[];if(_0x550d35['total']!==undefined)_0x1e915e['push'](_0x550d35['total']+'\x20total');if(_0x550d35[_0x1a250e(0xf0)]!==undefined&&_0x550d35[_0x1a250e(0xf0)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x109)](_0x550d35[_0x1a250e(0xf0)]+_0x1a250e(0xe4)));if(_0x550d35[_0x1a250e(0xc9)]!==undefined&&_0x550d35['created']>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x109)](_0x550d35[_0x1a250e(0xc9)]+'\x20created'));if(_0x550d35[_0x1a250e(0x106)]!==undefined&&_0x550d35[_0x1a250e(0x106)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x9d)](_0x550d35[_0x1a250e(0x106)]+_0x1a250e(0x100)));if(_0x550d35[_0x1a250e(0x119)]!==undefined&&_0x550d35[_0x1a250e(0x119)]>0x0)_0x1e915e['push'](a4_0x2e9eea['gray'](_0x550d35[_0x1a250e(0x119)]+'\x20unchanged'));if(_0x550d35[_0x1a250e(0x108)]!==undefined&&_0x550d35[_0x1a250e(0x108)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x11d)](_0x550d35['errors']+_0x1a250e(0x80)));return _0x1e915e[_0x1a250e(0xc2)](',\x20');}function displayDiffs(_0x1e64a7,_0x4e8bb9,_0xe5318a,_0x1f7e4d,_0x51d6b5,_0x40448,_0x10d85b){const _0x380cbd=a4_0x27f9;for(const _0x19a1af of _0x1e64a7){if(_0x19a1af[_0x380cbd(0x123)]){const _0x2391bd=_0x19a1af[_0x380cbd(0xb3)]||_0x19a1af[_0x380cbd(0xba)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x2391bd+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x19a1af['diff']),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c));}}for(const _0x47cdbe of _0x4e8bb9){_0x47cdbe[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0x94)+_0x47cdbe[_0x380cbd(0xba)]+'\x27:'),console['log']('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x47cdbe[_0x380cbd(0x123)]),console['log']('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x47af9b of _0xe5318a){_0x47af9b[_0x380cbd(0x123)]&&(console['log'](_0x380cbd(0x78)+_0x47af9b[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x47af9b[_0x380cbd(0x123)]),console['log']('─'['repeat'](0x3c)));}for(const _0xd673a8 of _0x1f7e4d){_0xd673a8['diff']&&(console[_0x380cbd(0x105)](_0x380cbd(0x8c)+_0xd673a8[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0xd673a8[_0x380cbd(0x123)]),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x1681bb of _0x51d6b5){_0x1681bb[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0x72)+_0x1681bb[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x1681bb['diff']),console['log']('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x47d0c6 of _0x40448){_0x47d0c6[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0xfa)+_0x47d0c6[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'['repeat'](0x3c)),console[_0x380cbd(0x105)](_0x47d0c6[_0x380cbd(0x123)]),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x15301c of _0x10d85b){_0x15301c[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0xf9)+_0x15301c[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'['repeat'](0x3c)),console[_0x380cbd(0x105)](_0x15301c['diff']),console['log']('─'['repeat'](0x3c)));}}function a4_0x50d2(){const _0x3239d0=['found','dirname','reason','yes','\x20errors','newProjectId','llmProject','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent:\x20','Using\x20project\x20from\x20context:\x20','sourceProjectName','outputDir','site','New\x20project\x20name\x20is\x20required','Using\x20local\x20project:\x20','\x20=\x20','\x0aChanges\x20to\x20prompt\x20\x27','\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','\x0aPush\x20summary\x20for\x20\x27','No\x20tdx.json\x20found\x20in\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','pullAgent','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x22...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','cwd','Using\x20project:\x20','integrations','1959492ZNibhA','\x0a✔\x20Pushed\x20','agent:clone','\x20--profile\x20','778352nAqOXJ','yellow','prompts','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','experimentalKnowledgeBases','agents','\x20\x20Experimental\x20Artifacts:\x20','\x22\x20to\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','projectDir','Errors:','-\x20nothing\x20pushed','no_local_folder','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20|\x20','\x0aError:','cyan','\x20changed','Dry\x20run\x20-\x20no\x20changes\x20made','execute','llm_project','\x0aPush\x20','agentName','✔\x20Context\x20set:\x20','llm','pullProject','\x20\x20Agents:\x20','projectName','Project\x20cloned\x20successfully','name','dryRun','Clone\x20\x22','Project\x20cloned\x20with\x20errors','18471810kSXBEa','\x20\x20tdx\x20agent\x20pull\x20','2244024bYwgoS','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','join','newProjectName','description','\x0a✔\x20Pulled\x20','no_context','dim','Using\x20context\x20project:\x20','created','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Pulling\x20agent\x20\x22','1371966ySAWTK','Cancelled','outputPath','New\x20project:\x20','\x20resources\x20to\x20\x27','output','\x20\x20Prompts:\x20','parse','cloneProject','Agent\x20pulled\x20successfully','knowledgeBases','Project:\x20','Would\x20clone:','error','2240135RTUiWm','total','isNew','agentId','Analyzing\x20project\x20\x22','\x0aWrite\x20','\x20successfully','tdx.json','textKnowledgeBases','agent:pull','\x20new','profile','repeat','Status:\x20','agent.yml','Chat:\x20','\x20files\x20to\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20Integrations:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','INVALID_ARGUMENT','new','agent','\x20\x20Agent\x20\x22','\x20unchanged','arg-dir','counts','\x22\x20from\x20project\x20\x22','\x20\x20Knowledge\x20Bases:\x20','<new-name>','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','experimentalArtifacts','Output:\x20','Using\x20project\x20from\x20','Pushing\x20to\x20project...','\x20updated','\x20\x20Target:\x20','push','action','\x20\x20Prompt\x20\x22','log','updated','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)','errors','green','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Would\x20pull\x20agent:\x20','Pushing\x20agent\x20from\x20\x22','pushProject','Summary:','pushAgent','session','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Agent\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22\x20to\x20a\x20different\x20profile','Using\x20current\x20project:\x20','projectId','Would\x20push\x20agent:\x20','message','unchanged','\x20resources?','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','red','Cloning\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20--name\x20','utf-8','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','diff','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aChanges\x20to\x20integration\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','3719924GgaQjS','\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','\x0aErrors\x20found:','\x22:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','hasChanges','Writing\x20files...','\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'];a4_0x50d2=function(){return _0x3239d0;};return a4_0x50d2();}export class AgentPullCommand extends BaseCommand{[a4_0x80e2a5(0xba)]=a4_0x80e2a5(0xe3);[a4_0x80e2a5(0xc4)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x80e2a5(0xb0)](_0x3b2e93){const _0xa33dcb=a4_0x80e2a5,{options:_0x39ee11,args:_0x9b17c,tdx:_0x3ed2c1}=_0x3b2e93,_0x158a63=_0x9b17c[0x0],_0x13e67f=_0x9b17c[0x1],_0xf9ab53=_0x39ee11[_0xa33dcb(0xd1)],_0x27a890=_0x39ee11[_0xa33dcb(0xbb)],_0x59a05c=_0x39ee11['force'],_0x247a14=_0x39ee11['yes'],_0x58f437=_0x39ee11[_0xa33dcb(0x82)],_0x1deea6=_0x39ee11[_0xa33dcb(0xf1)];let _0x4a6394;if(_0x158a63){const _0x1f0430=a4_0x53f2df[_0xa33dcb(0xc2)](_0x158a63,_0xa33dcb(0xe1));if(existsSync(_0x1f0430))try{const _0x467d39=JSON[_0xa33dcb(0xd3)](readFileSync(_0x1f0430,_0xa33dcb(0x121)));_0x467d39[_0xa33dcb(0xb1)]&&(_0x4a6394={'llm_project':_0x467d39[_0xa33dcb(0xb1)]});}catch{}}const _0x53e2c2=findAgentConfigPath(process['cwd']());let _0x5e293e;if(_0x53e2c2)try{const _0x4ef0e2=JSON['parse'](readFileSync(_0x53e2c2,_0xa33dcb(0x121)));_0x4ef0e2[_0xa33dcb(0xb1)]&&(_0x5e293e={'llm_project':_0x4ef0e2[_0xa33dcb(0xb1)]});}catch{}const _0x51c9bf=resolveAgentPullArgs({'arg':_0x158a63,'agentNameArg':_0x13e67f,'agentFlag':_0x1deea6,'contextProject':_0x58f437,'argDirConfig':_0x4a6394,'cwdConfigPath':_0x53e2c2||undefined,'cwdConfig':_0x5e293e}),{projectNameOrId:_0xaacbb8,targetAgentName:_0xed6402,existingOutputDir:_0x322795,source:_0x102c22}=_0x51c9bf;if(_0x102c22===_0xa33dcb(0xf4))console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0xfe)+a4_0x53f2df['join'](_0x158a63,_0xa33dcb(0xe1))+':\x20'+_0xaacbb8));else{if(_0x102c22==='cwd-config')console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x96)+_0xaacbb8));else _0x102c22==='context'&&console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x85)+_0xaacbb8));}if(!_0xaacbb8)return _0x1deea6?(console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0x111))),console[_0xa33dcb(0x105)](_0xa33dcb(0x10a)),console[_0xa33dcb(0x105)](_0xa33dcb(0x122))):(console['log'](a4_0x2e9eea['yellow'](_0xa33dcb(0xee))),console[_0xa33dcb(0x105)](_0xa33dcb(0x107)),console[_0xa33dcb(0x105)](_0xa33dcb(0x8d)),console[_0xa33dcb(0x105)](_0xa33dcb(0x90)),console[_0xa33dcb(0x105)](_0xa33dcb(0x75)),console[_0xa33dcb(0x105)](_0xa33dcb(0x7b))),0x1;if(_0xed6402){const {data:_0x531201}=await withSpinner(_0xa33dcb(0xcb)+_0xed6402+_0xa33dcb(0xf6)+_0xaacbb8+_0xa33dcb(0x93),()=>_0x3ed2c1['llm'][_0xa33dcb(0x91)](_0xaacbb8,_0xed6402,_0xf9ab53,{'dryRun':_0x27a890,'force':_0x59a05c}));if(_0x27a890)return console[_0xa33dcb(0x105)](a4_0x2e9eea['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0xa33dcb(0x10b)+_0x531201[_0xa33dcb(0xb3)]),console[_0xa33dcb(0x105)]('Output\x20path:\x20'+_0x531201[_0xa33dcb(0xce)]),_0x531201[_0xa33dcb(0x123)]&&(console['log']('\x0aChanges:'),console[_0xa33dcb(0x105)]('─'[_0xa33dcb(0xe6)](0x3c)),console[_0xa33dcb(0x105)](_0x531201[_0xa33dcb(0x123)]),console[_0xa33dcb(0x105)]('─'[_0xa33dcb(0xe6)](0x3c))),0x0;return console[_0xa33dcb(0x105)](a4_0x2e9eea['green'](_0xa33dcb(0xd5))),console['log']('Agent:\x20'+_0x531201[_0xa33dcb(0xb3)]),console[_0xa33dcb(0x105)](_0xa33dcb(0xfd)+_0x531201[_0xa33dcb(0xce)]),console[_0xa33dcb(0x105)](_0xa33dcb(0xe7)+(_0x531201[_0xa33dcb(0xdc)]?a4_0x2e9eea[_0xa33dcb(0x109)]('new'):_0x531201[_0xa33dcb(0x79)]?a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0x106)):a4_0x2e9eea['gray'](_0xa33dcb(0x119)))),0x0;}const _0x7df378=_0x322795||_0xf9ab53,{data:_0x1cd3d2}=await withSpinner(_0xa33dcb(0xde)+_0xaacbb8+_0xa33dcb(0x93),()=>_0x3ed2c1[_0xa33dcb(0xb5)]['pullProject'](_0xaacbb8,_0x7df378,{'dryRun':!![]})),_0x3889ec=_0x1cd3d2['counts'][_0xa33dcb(0xa1)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'][_0xa33dcb(0xf0)]+_0x1cd3d2[_0xa33dcb(0xf5)]['integrations'][_0xa33dcb(0xf0)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa0)][_0xa33dcb(0xf0)]+_0x1cd3d2['counts'][_0xa33dcb(0xfc)][_0xa33dcb(0xf0)],_0x32e9b0=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)][_0xa33dcb(0x106)]+_0x1cd3d2['counts']['knowledgeBases']['updated']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['updated']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x9e)][_0xa33dcb(0x106)]+_0x1cd3d2['counts']['integrations'][_0xa33dcb(0x106)]+_0x1cd3d2['counts'][_0xa33dcb(0xa0)][_0xa33dcb(0x106)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xfc)]['updated'],_0x59b51e=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['unchanged']+_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x97)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalKnowledgeBases']['unchanged']+_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalArtifacts']['unchanged'];console[_0xa33dcb(0x105)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1cd3d2['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x2e9eea[_0xa33dcb(0x109)]('+\x20'+_0x3889ec+_0xa33dcb(0xe4))+_0xa33dcb(0xab)+a4_0x2e9eea[_0xa33dcb(0x9d)]('~\x20'+_0x32e9b0+_0xa33dcb(0xae))+_0xa33dcb(0xab)+a4_0x2e9eea[_0xa33dcb(0xc7)]('=\x20'+_0x59b51e+_0xa33dcb(0xf3))),console[_0xa33dcb(0x105)](_0xa33dcb(0xb7)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)])),console['log'](_0xa33dcb(0xf7)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)])),console['log'](_0xa33dcb(0x92)+formatCountSummary(_0x1cd3d2['counts'][_0xa33dcb(0xe2)])),console[_0xa33dcb(0x105)](_0xa33dcb(0xd2)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'])),console[_0xa33dcb(0x105)](_0xa33dcb(0xec)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x97)]));const _0x4d16e9=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa0)]['total']>0x0||_0x1cd3d2['counts'][_0xa33dcb(0xfc)][_0xa33dcb(0xdb)]>0x0;_0x4d16e9&&(console[_0xa33dcb(0x105)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalKnowledgeBases'])),console[_0xa33dcb(0x105)](_0xa33dcb(0xa2)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xfc)])));console[_0xa33dcb(0x105)](_0xa33dcb(0x101)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x1cd3d2[_0xa33dcb(0x87)])),displayDiffs(_0x1cd3d2['agents'],_0x1cd3d2['knowledgeBases'],_0x1cd3d2['textKnowledgeBases'],_0x1cd3d2['prompts'],_0x1cd3d2[_0xa33dcb(0x97)],_0x1cd3d2[_0xa33dcb(0xa0)],_0x1cd3d2[_0xa33dcb(0xfc)]);if(_0x27a890)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0xa5))),0x0;if(_0x3889ec===0x0&&_0x32e9b0===0x0)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x109)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x1cd3d2[_0xa33dcb(0xb8)]},_0x39ee11['session']),console['log'](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xb4)+a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0xb1))+_0xa33dcb(0x8b)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x1cd3d2[_0xa33dcb(0xb8)]))),0x0;if(!_0x247a14&&!_0x59a05c){if(!isInteractive())return console[_0xa33dcb(0xd9)](a4_0x2e9eea[_0xa33dcb(0x11d)](_0xa33dcb(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xa33dcb(0xd9)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x73))),0x1;const _0x1b0860=await confirmKey(_0xa33dcb(0xdf)+(_0x3889ec+_0x32e9b0)+'\x20files?');if(!_0x1b0860)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0xcd)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x59982c}=await withSpinner(_0xa33dcb(0x7a),()=>_0x3ed2c1[_0xa33dcb(0xb5)][_0xa33dcb(0xb6)](_0xaacbb8,_0x7df378,{'force':_0x59a05c}));return console['log'](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xc5)+(_0x3889ec+_0x32e9b0)+_0xa33dcb(0xea)+_0x59982c[_0xa33dcb(0x87)])),saveSessionContext({'llm_project':_0x59982c[_0xa33dcb(0xb8)]},_0x39ee11[_0xa33dcb(0x110)]),console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xb4)+a4_0x2e9eea['dim']('llm_project')+_0xa33dcb(0x8b)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x59982c[_0xa33dcb(0xb8)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x80e2a5(0xba)]=a4_0x80e2a5(0x9a);[a4_0x80e2a5(0xc4)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x80e2a5(0xb0)](_0x485edc){const _0x5e94cd=a4_0x80e2a5,{options:_0x645c49,args:_0x42e772,tdx:_0x568143}=_0x485edc,_0x247008=_0x42e772[0x0],_0x3d18a9=_0x645c49['name'],_0x13af08=_0x645c49['dryRun'],_0x23ab33=_0x645c49[_0x5e94cd(0x7f)],_0x4adbe1=_0x645c49[_0x5e94cd(0x88)],_0x15182e=_0x645c49[_0x5e94cd(0x82)];let _0xa122f3;const _0x228d42=findAgentConfigPath(process[_0x5e94cd(0x95)]());if(_0x247008){const _0x2f86cc=a4_0x53f2df[_0x5e94cd(0xc2)](_0x247008,'tdx.json');existsSync(_0x2f86cc)?(_0xa122f3=_0x247008,console[_0x5e94cd(0x105)](a4_0x2e9eea['dim'](_0x5e94cd(0x8a)+_0x247008))):_0xa122f3=_0x247008;}else{if(_0x228d42)_0xa122f3=a4_0x53f2df[_0x5e94cd(0x7d)](_0x228d42),console[_0x5e94cd(0x105)](a4_0x2e9eea['dim'](_0x5e94cd(0x115)+_0xa122f3));else{if(_0x15182e){const _0x1d279f=sanitizeForFilesystem(_0x15182e);let _0x3b6224=_0x1d279f,_0x38011a=a4_0x53f2df['join'](process['cwd'](),_0x5e94cd(0xa1),_0x1d279f,_0x5e94cd(0xe1));if(!existsSync(_0x38011a)){const _0x4e723c=normalizeName(_0x15182e),_0xdbdad4=a4_0x53f2df[_0x5e94cd(0xc2)](process[_0x5e94cd(0x95)](),_0x5e94cd(0xa1),_0x4e723c,_0x5e94cd(0xe1));existsSync(_0xdbdad4)&&(_0x3b6224=_0x4e723c,_0x38011a=_0xdbdad4);}if(existsSync(_0x38011a))_0xa122f3=a4_0x53f2df['dirname'](_0x38011a),console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0x8a)+_0xa122f3));else{const _0x4b8d53=_0x645c49[_0x5e94cd(0xe5)];if(_0x4b8d53)throw new SDKError(ErrorCode[_0x5e94cd(0xef)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x15182e+_0x5e94cd(0x114),undefined,{'helpText':_0x5e94cd(0xca)+_0x5e94cd(0xc1)+(_0x5e94cd(0xbf)+_0x15182e+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b6224+_0x5e94cd(0x120)+(_0x3d18a9||_0x5e94cd(0xf8))+_0x5e94cd(0x9b)+_0x4b8d53)});_0xa122f3=_0x15182e,console['log'](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0xc8)+_0x15182e));}}}}if(!_0xa122f3)return console[_0x5e94cd(0x105)](a4_0x2e9eea['yellow'](_0x5e94cd(0x83))),console[_0x5e94cd(0x105)](_0x5e94cd(0x11c)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x5e94cd(0x105)](_0x5e94cd(0xeb)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3d18a9)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x5e94cd(0x89),undefined,{'helpText':_0x5e94cd(0x113)});if(!_0x23ab33&&!_0x13af08){if(!isInteractive())return console[_0x5e94cd(0xd9)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5e94cd(0xd9)](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0x73))),0x1;const _0xc22e53=await confirmKey(_0x5e94cd(0xbc)+_0xa122f3+'\x22\x20to\x20new\x20project\x20\x22'+_0x3d18a9+'\x22?');if(!_0xc22e53)return console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x9d)](_0x5e94cd(0xcd))),0x1;}const {data:_0xa16218}=await withSpinner(_0x5e94cd(0x11e)+_0xa122f3+_0x5e94cd(0xa3)+_0x3d18a9+'\x22...',()=>_0x568143[_0x5e94cd(0xb5)][_0x5e94cd(0xd4)](_0xa122f3,_0x3d18a9,{'dryRun':_0x13af08}));if(_0x13af08){console[_0x5e94cd(0x105)](a4_0x2e9eea['yellow'](_0x5e94cd(0xaf))),console[_0x5e94cd(0x105)]('Source:\x20'+_0xa16218[_0x5e94cd(0x86)]),console['log'](_0x5e94cd(0xcf)+_0x3d18a9),console[_0x5e94cd(0x105)](_0x5e94cd(0xd8)),console[_0x5e94cd(0x105)](_0x5e94cd(0xb7)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa1)][_0x5e94cd(0xc9)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xf7)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xd6)]['created']),console[_0x5e94cd(0x105)]('\x20\x20Prompts:\x20'+_0xa16218[_0x5e94cd(0xf5)]['prompts'][_0x5e94cd(0xc9)]);const _0x3bcde8=_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0xc9)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0xc9)]>0x0;return _0x3bcde8&&(console[_0x5e94cd(0x105)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0xa16218[_0x5e94cd(0xf5)]['experimentalKnowledgeBases'][_0x5e94cd(0xc9)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xa2)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xfc)][_0x5e94cd(0xc9)])),0x0;}const _0x310929=_0xa16218[_0x5e94cd(0xf5)]['agents'][_0x5e94cd(0x108)]>0x0||_0xa16218['counts']['knowledgeBases'][_0x5e94cd(0x108)]>0x0||_0xa16218[_0x5e94cd(0xf5)]['prompts'][_0x5e94cd(0x108)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x108)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0x108)]>0x0;_0x310929?console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x9d)](_0x5e94cd(0xbd))):console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x109)](_0x5e94cd(0xb9)));console[_0x5e94cd(0x105)]('Source:\x20'+_0xa16218[_0x5e94cd(0x86)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xcf)+_0xa16218[_0x5e94cd(0xc3)]),console['log']('New\x20project\x20ID:\x20'+_0xa16218[_0x5e94cd(0x81)]),console[_0x5e94cd(0x105)](),console[_0x5e94cd(0x105)](_0x5e94cd(0x10e)),console['log'](_0x5e94cd(0xb7)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xa1)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xf7)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xd6)])),console['log'](_0x5e94cd(0xd2)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0x9e)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xec)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0x97)]));const _0x5e13cc=_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)]['created']>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x106)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x119)]>0x0||_0xa16218[_0x5e94cd(0xf5)]['experimentalArtifacts'][_0x5e94cd(0xc9)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xfc)][_0x5e94cd(0x106)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0x119)]>0x0;_0x5e13cc&&(console['log'](_0x5e94cd(0xaa)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xa0)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xa2)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)]['experimentalArtifacts'])));if(_0x310929){console['log'](),console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xa7)));for(const _0x580d51 of _0xa16218[_0x5e94cd(0xa1)]){_0x580d51[_0x5e94cd(0x103)]==='error'&&console[_0x5e94cd(0x105)](a4_0x2e9eea['red'](_0x5e94cd(0xf2)+_0x580d51[_0x5e94cd(0xb3)]+_0x5e94cd(0x77)+_0x580d51[_0x5e94cd(0xd9)]));}for(const _0x495174 of _0xa16218[_0x5e94cd(0xd6)]){_0x495174['action']===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xa4)+_0x495174[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x495174[_0x5e94cd(0xd9)]));}for(const _0x29ad12 of _0xa16218[_0x5e94cd(0x9e)]){_0x29ad12[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0x104)+_0x29ad12[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x29ad12[_0x5e94cd(0xd9)]));}for(const _0x304dc1 of _0xa16218[_0x5e94cd(0x97)]){_0x304dc1[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xfb)+_0x304dc1[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x304dc1[_0x5e94cd(0xd9)]));}for(const _0x28fe5f of _0xa16218['experimentalKnowledgeBases']){_0x28fe5f[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x28fe5f[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x28fe5f['error']));}for(const _0x488e06 of _0xa16218[_0x5e94cd(0xfc)]){_0x488e06[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x488e06['name']+_0x5e94cd(0x77)+_0x488e06['error']));}return 0x1;}console['log']();const _0x5b27a2=getLLMProjectUrl(_0x4adbe1,_0xa16218[_0x5e94cd(0x81)]);return console[_0x5e94cd(0x105)](_0x5e94cd(0xd7)+a4_0x2e9eea[_0x5e94cd(0xad)](_0x5b27a2)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x80e2a5(0xba)]='agent:push';[a4_0x80e2a5(0xc4)]=a4_0x80e2a5(0x11f);async[a4_0x80e2a5(0xb0)](_0x3f0514){const _0xb8deb5=a4_0x80e2a5,{options:_0x408f8e,args:_0x2385e1,tdx:_0xcd068e}=_0x3f0514;let _0x41edcf=_0x2385e1[0x0]||process['cwd']();const _0x27d135=_0x408f8e['dryRun'],_0x392e50=_0x408f8e['force'],_0x45bc56=_0x408f8e[_0xb8deb5(0x7f)],_0x544fe4=_0x408f8e[_0xb8deb5(0x88)],_0x265259=a4_0x53f2df[_0xb8deb5(0xc2)](_0x41edcf,_0xb8deb5(0xe8)),_0x45bc13=existsSync(_0x265259);if(_0x45bc13){const {data:_0x3e03fb}=await withSpinner(_0xb8deb5(0x10c)+_0x41edcf+_0xb8deb5(0x93),()=>_0xcd068e['llm'][_0xb8deb5(0x10f)](_0x41edcf,{'dryRun':_0x27d135,'force':_0x392e50}));if(_0x27d135)return console[_0xb8deb5(0x105)](a4_0x2e9eea['yellow'](_0xb8deb5(0xaf))),console[_0xb8deb5(0x105)](_0xb8deb5(0x117)+_0x3e03fb['agentName']),0x0;if(_0x3e03fb[_0xb8deb5(0x103)]==='error')return console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)]('Failed\x20to\x20push\x20agent:\x20'+_0x3e03fb['error'])),0x1;console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0x112)+_0x3e03fb[_0xb8deb5(0x103)]+_0xb8deb5(0xe0))),console[_0xb8deb5(0x105)](_0xb8deb5(0x84)+_0x3e03fb[_0xb8deb5(0xb3)]);if(_0x3e03fb[_0xb8deb5(0xdd)]&&_0x3e03fb[_0xb8deb5(0x116)]){const _0x88c344=getLLMAgentChatUrl(_0x544fe4,_0x3e03fb[_0xb8deb5(0x116)],_0x3e03fb[_0xb8deb5(0xdd)]);console['log'](_0xb8deb5(0xe9)+a4_0x2e9eea[_0xb8deb5(0xad)](_0x88c344));}return 0x0;}const _0x22aadf=_0x408f8e['llmProject'],_0x2feb20=resolveProjectFromContext(_0x41edcf,_0x22aadf);if(_0x2feb20[_0xb8deb5(0x7c)])_0x41edcf=_0x2feb20[_0xb8deb5(0xa6)],_0x2feb20['source']==='context'&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0xc7)](_0xb8deb5(0x96)+_0x41edcf));else{let _0x3bbde3='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2feb20[_0xb8deb5(0x7e)]===_0xb8deb5(0xa9)&&(_0x3bbde3=_0x2feb20[_0xb8deb5(0x118)]+_0xb8deb5(0x9f)+_0x2feb20[_0xb8deb5(0x82)]+_0xb8deb5(0x124));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2feb20[_0xb8deb5(0x7e)]===_0xb8deb5(0xc6)?_0x2feb20['message']:_0xb8deb5(0x8f)+_0x41edcf,undefined,{'helpText':_0x3bbde3});}const {data:_0x169380}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xcd068e[_0xb8deb5(0xb5)][_0xb8deb5(0x10d)](_0x41edcf,{'dryRun':!![]})),_0x5a67ff=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)]['errors']>0x0;if(_0x5a67ff){console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0x76)));for(const _0x20a2d1 of _0x169380[_0xb8deb5(0xa1)]){_0x20a2d1[_0xb8deb5(0x103)]===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xf2)+_0x20a2d1[_0xb8deb5(0xb3)]+_0xb8deb5(0x77)+_0x20a2d1[_0xb8deb5(0xd9)]));}return 0x1;}const _0x482646=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)][_0xb8deb5(0xc9)]+_0x169380['counts'][_0xb8deb5(0xd6)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)]['prompts'][_0xb8deb5(0xc9)]+_0x169380['counts'][_0xb8deb5(0x97)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa0)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0xc9)],_0x4625d4=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)][_0xb8deb5(0x106)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)]['updated']+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)]['updated']+_0x169380[_0xb8deb5(0xf5)]['prompts'][_0xb8deb5(0x106)]+_0x169380['counts']['integrations']['updated']+_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0x106)]+_0x169380[_0xb8deb5(0xf5)]['experimentalArtifacts'][_0xb8deb5(0x106)],_0x308cd4=_0x169380[_0xb8deb5(0xf5)]['agents']['unchanged']+_0x169380['counts'][_0xb8deb5(0xd6)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0x9e)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0x97)]['unchanged']+_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0x119)];console['log'](_0xb8deb5(0x8e)+_0x169380[_0xb8deb5(0xb8)]+'\x27:'),console[_0xb8deb5(0x105)]('\x20\x20'+a4_0x2e9eea[_0xb8deb5(0x109)]('+\x20'+_0x482646+'\x20new')+'\x20|\x20'+a4_0x2e9eea[_0xb8deb5(0x9d)]('~\x20'+_0x4625d4+_0xb8deb5(0xae))+_0xb8deb5(0xab)+a4_0x2e9eea[_0xb8deb5(0xc7)]('=\x20'+_0x308cd4+_0xb8deb5(0xf3))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)])),console['log'](_0xb8deb5(0xf7)+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)])),console[_0xb8deb5(0x105)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)])),console[_0xb8deb5(0x105)](_0xb8deb5(0xd2)+formatCountSummary(_0x169380['counts'][_0xb8deb5(0x9e)])),console[_0xb8deb5(0x105)](_0xb8deb5(0xec)+formatCountSummary(_0x169380[_0xb8deb5(0xf5)]['integrations']));const _0x293d9c=_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0xc9)]>0x0||_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa0)][_0xb8deb5(0x106)]>0x0||_0x169380[_0xb8deb5(0xf5)]['experimentalKnowledgeBases'][_0xb8deb5(0x119)]>0x0||_0x169380['counts'][_0xb8deb5(0xfc)][_0xb8deb5(0xc9)]>0x0||_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0x106)]>0x0||_0x169380[_0xb8deb5(0xf5)]['experimentalArtifacts'][_0xb8deb5(0x119)]>0x0;_0x293d9c&&(console[_0xb8deb5(0x105)](_0xb8deb5(0xaa)+formatCountSummary(_0x169380['counts'][_0xb8deb5(0xa0)])),console[_0xb8deb5(0x105)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)])));console[_0xb8deb5(0x105)]('\x20\x20Source:\x20'+a4_0x2e9eea['cyan'](_0x41edcf)),displayDiffs(_0x169380[_0xb8deb5(0xa1)],_0x169380['knowledgeBases'],_0x169380[_0xb8deb5(0xe2)],_0x169380[_0xb8deb5(0x9e)],_0x169380[_0xb8deb5(0x97)],_0x169380[_0xb8deb5(0xa0)],_0x169380[_0xb8deb5(0xfc)]);if(_0x27d135)return console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x9d)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x482646===0x0&&_0x4625d4===0x0){console['log'](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0xed)));const _0x5dcebf=getLLMProjectUrl(_0x544fe4,_0x169380[_0xb8deb5(0x116)]);return console[_0xb8deb5(0x105)](_0xb8deb5(0xd7)+a4_0x2e9eea['cyan'](_0x5dcebf)),0x0;}if(!_0x45bc56&&!_0x392e50){if(!isInteractive())return console['error'](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xb8deb5(0xd9)](a4_0x2e9eea[_0xb8deb5(0xc7)](_0xb8deb5(0x73))),0x1;const _0x7cff3b=await confirmKey(_0xb8deb5(0xb2)+(_0x482646+_0x4625d4)+_0xb8deb5(0x11a));if(!_0x7cff3b)return console['log'](a4_0x2e9eea[_0xb8deb5(0x9d)]('Cancelled'),_0xb8deb5(0xa8)),0x1;}const {data:_0xbf55f9}=await withSpinner(_0xb8deb5(0xff),()=>_0xcd068e[_0xb8deb5(0xb5)][_0xb8deb5(0x10d)](_0x41edcf,{'force':_0x392e50})),_0x4a12e0=_0xbf55f9['counts'][_0xb8deb5(0xa1)][_0xb8deb5(0x108)]>0x0||_0xbf55f9[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)][_0xb8deb5(0x108)]>0x0||_0xbf55f9[_0xb8deb5(0xf5)]['textKnowledgeBases']['errors']>0x0||_0xbf55f9[_0xb8deb5(0xf5)][_0xb8deb5(0x9e)][_0xb8deb5(0x108)]>0x0;if(_0x4a12e0){console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x9d)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0xa7)));for(const _0xf6411c of _0xbf55f9[_0xb8deb5(0xa1)]){_0xf6411c['action']==='error'&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xf2)+_0xf6411c[_0xb8deb5(0xb3)]+_0xb8deb5(0x77)+_0xf6411c[_0xb8deb5(0xd9)]));}for(const _0x18e12f of _0xbf55f9['knowledgeBases']){_0x18e12f['action']===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x18e12f[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x18e12f[_0xb8deb5(0xd9)]));}for(const _0x5d481d of _0xbf55f9[_0xb8deb5(0xe2)]){_0x5d481d[_0xb8deb5(0x103)]==='error'&&console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0x11b)+_0x5d481d[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x5d481d[_0xb8deb5(0xd9)]));}for(const _0x292f7b of _0xbf55f9['prompts']){_0x292f7b[_0xb8deb5(0x103)]===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)]('\x20\x20Prompt\x20\x22'+_0x292f7b[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x292f7b[_0xb8deb5(0xd9)]));}for(const _0x41d621 of _0xbf55f9[_0xb8deb5(0x97)]){_0x41d621['action']===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xfb)+_0x41d621['name']+_0xb8deb5(0x77)+_0x41d621[_0xb8deb5(0xd9)]));}return 0x1;}console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0x99)+(_0x482646+_0x4625d4)+_0xb8deb5(0xd0)+_0xbf55f9[_0xb8deb5(0xb8)]+'\x27'));const _0x384ab4=getLLMProjectUrl(_0x544fe4,_0xbf55f9['projectId']);return console[_0xb8deb5(0x105)](_0xb8deb5(0xd7)+a4_0x2e9eea[_0xb8deb5(0xad)](_0x384ab4)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x48f77d=a5_0x5b3b;(function(_0x7236a0,_0x172093){const _0x2692a2=a5_0x5b3b,_0x195a0f=_0x7236a0();while(!![]){try{const _0x385c26=-parseInt(_0x2692a2(0x227))/0x1*(-parseInt(_0x2692a2(0x19b))/0x2)+parseInt(_0x2692a2(0x1a1))/0x3+-parseInt(_0x2692a2(0x1b1))/0x4+parseInt(_0x2692a2(0x220))/0x5+parseInt(_0x2692a2(0x21a))/0x6*(-parseInt(_0x2692a2(0x1e4))/0x7)+parseInt(_0x2692a2(0x1cc))/0x8*(parseInt(_0x2692a2(0x216))/0x9)+-parseInt(_0x2692a2(0x21f))/0xa*(parseInt(_0x2692a2(0x1bb))/0xb);if(_0x385c26===_0x172093)break;else _0x195a0f['push'](_0x195a0f['shift']());}catch(_0x4992c3){_0x195a0f['push'](_0x195a0f['shift']());}}}(a5_0x5c25,0x56f0c));import*as a5_0x450a1f from'node:fs';import*as a5_0x1973a9 from'node:path';import a5_0x5dc5a7 from'chalk';import{BaseCommand}from'./command.js';function a5_0x5c25(){const _0x4e58ba=['11shqZQU','testYmlPath','\x20\x20Project:\x20','writeFileSync','existsSync','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Agent:\x20','substring','Running\x20test:\x20','PASS','split','cyan','No\x20tests\x20found\x20matching:\x20','Executing\x20new\x20tests...','Available\x20tests:\x20','Test\x20Configuration:','\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','672vfYAUY','/<agent-name>','reason','Test\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.',':\x20Sending\x20user\x20input...','projectName','✗\x20ERROR:\x20','Failed:\x20\x20\x20','execute','No\x20tests\x20found\x20with\x20tags:\x20','No\x20tests\x20have\x20tags\x20defined.','Re-evaluating...','Duration:\x20','\x20\x20Evaluating...\x20','executeReeval','site','404','includes','\x20\x20-\x20','\x20\x20Conversation:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','llmProject','round','7mDnTGg','Re-evaluation\x20Summary','filter','description','utf-8','table','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20FAIL:\x20','Errors:\x20\x20\x20','green','testName','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','projectDir','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','⚠\x20SKIPPED:\x20','map','size','some','Evaluating\x20response...','json','dryRun','jsonl','yellow','Re-evaluating\x20','reeval','Run\x20tests\x20for\x20an\x20LLM\x20agent','ERROR','isSpinning','\x20(new)','Failed\x20Tests:','\x22,\x20but\x20current\x20site\x20is\x20\x22','agentName','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','now','\x27\x20to\x20create\x20the\x20folder\x20structure.','trim','log','\x20(cached)','message','agentDirs','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Available\x20tags:\x20','llm','✓\x20PASS:\x20','start','conversation_url','conversations','Usage:','44748KeBqwR','Error\x20writing\x20output\x20file:\x20','...\x20','name','3700068GmTwIa','toLowerCase','resolveProjectId','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Agent:\x20','1278130RtdtVR','1180555MjFXKp','rounds','source','push','tags','tsv','output','180029zszPPx','FAIL','...','dim','no_context','agent','Using\x20agent:\x20','forEach','Run\x20\x27tdx\x20agent\x20pull\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','has','\x22:\x20','red','Passed:\x20\x20\x20','text','6ZUtgKx','repeat','toISOString','Test\x20Summary','Cached\x20run\x20from:\x20','agent:test','1520523HMxIER','resolve','\x20-\x20','\x20\x20Round\x20','basename','multiple_agents','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Round\x201/','Tests\x20found:\x20','stop','found','Either\x20switch\x20to\x20the\x20\x22','Running:\x20','join','white','2400352DTcVfU','eval','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','status','timestamp','Site:\x20','tests','Round\x20','Running\x20agent\x20tests...','length'];a5_0x5c25=function(){return _0x4e58ba;};return a5_0x5c25();}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_0x5b3b(_0x4e803d,_0x4d0cfc){_0x4e803d=_0x4e803d-0x196;const _0x5c25b7=a5_0x5c25();let _0x5b3ba1=_0x5c25b7[_0x4e803d];return _0x5b3ba1;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x48f77d(0x1a0);[a5_0x48f77d(0x1e7)]=a5_0x48f77d(0x1fd);async[a5_0x48f77d(0x1d5)](_0x393b37){const _0x3ac21d=a5_0x48f77d,{options:_0x113a53,args:_0x125aaa,tdx:_0x2a76d3}=_0x393b37,_0x2e3c09=_0x125aaa[0x0]||'.',_0x29600d=_0x113a53[_0x3ac21d(0x1f8)],_0x27a9e0=_0x113a53,_0x320587=_0x27a9e0[_0x3ac21d(0x1b2)]===![],_0x162c12=_0x27a9e0[_0x3ac21d(0x1fc)],_0x2fb139=_0x27a9e0[_0x3ac21d(0x219)],_0x217d8c=_0x27a9e0[_0x3ac21d(0x224)],_0x19ee5d=_0x113a53['site'],_0x204ea8=_0x27a9e0[_0x3ac21d(0x226)];if(_0x162c12&&_0x320587)return console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1ef))),0x1;let _0x10c961=_0x3ac21d(0x1e9);if(_0x27a9e0['json'])_0x10c961=_0x3ac21d(0x1f7);else{if(_0x27a9e0[_0x3ac21d(0x1f9)])_0x10c961=_0x3ac21d(0x1f9);else{if(_0x27a9e0[_0x3ac21d(0x225)])_0x10c961=_0x3ac21d(0x225);else{if(_0x27a9e0[_0x3ac21d(0x1e9)])_0x10c961=_0x3ac21d(0x1e9);}}}const _0x17a8e3=_0x27a9e0[_0x3ac21d(0x1e2)];let _0x5ec89b=_0x2e3c09;const _0x45b810=a5_0x450a1f[_0x3ac21d(0x1bf)](_0x2e3c09),_0x1bc7fb=_0x2e3c09==='.';if(!_0x45b810||_0x1bc7fb){const _0x125495=resolveProjectFromContext(_0x2e3c09,_0x17a8e3,{'requireFile':'test.yml'});if(_0x125495[_0x3ac21d(0x1ac)])_0x5ec89b=_0x125495[_0x3ac21d(0x1f0)],_0x125495[_0x3ac21d(0x222)]==='context'&&console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x3ac21d(0x22d)+_0x5ec89b));else switch(_0x125495[_0x3ac21d(0x1ce)]){case _0x3ac21d(0x22b):console['log'](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x125495['message'])),console[_0x3ac21d(0x20a)](),console['log'](_0x3ac21d(0x215)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1cb)),console[_0x3ac21d(0x20a)]('\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)'),console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x20e));return 0x1;case'no_local_folder':console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x125495['message'])),console['log'](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x22f)+_0x125495['llmProject']+_0x3ac21d(0x208));return 0x1;case _0x3ac21d(0x1a6):{const _0x57764e=a5_0x1973a9[_0x3ac21d(0x1a5)](_0x125495[_0x3ac21d(0x1f0)]);console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x3ac21d(0x1a7)+_0x125495['llmProject']+'\x22:'));for(const _0x451a7b of _0x125495[_0x3ac21d(0x20d)]){console[_0x3ac21d(0x20a)](_0x3ac21d(0x1df)+_0x451a7b);}return console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x57764e+_0x3ac21d(0x1cd)),0x1;}case'no_tests':console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x125495[_0x3ac21d(0x1e2)]+'\x22.')),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)]('Project\x20path:\x20'+_0x125495['projectDir'])),console['log'](),console[_0x3ac21d(0x20a)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x23c9c4,agentInfo:_0x3ea0e0}=parseTestFile(_0x5ec89b);let _0x1bd531=_0x23c9c4[_0x3ac21d(0x1b7)];if(_0x2fb139){const _0x48676d=_0x2fb139['split'](',')['map'](_0x4126a5=>_0x4126a5['trim']());_0x1bd531=_0x23c9c4[_0x3ac21d(0x1b7)][_0x3ac21d(0x1e6)](_0x10ffb1=>_0x48676d[_0x3ac21d(0x1de)](_0x10ffb1[_0x3ac21d(0x219)]));if(_0x1bd531['length']===0x0)return console[_0x3ac21d(0x20a)](a5_0x5dc5a7['yellow'](_0x3ac21d(0x1c7)+_0x2fb139)),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x3ac21d(0x1c9)+_0x23c9c4[_0x3ac21d(0x1b7)][_0x3ac21d(0x1f3)](_0x1333a9=>_0x1333a9[_0x3ac21d(0x219)])[_0x3ac21d(0x1af)](',\x20'))),0x1;}if(_0x217d8c){const _0x418cd2=_0x217d8c[_0x3ac21d(0x1c5)](',')[_0x3ac21d(0x1f3)](_0x2ad220=>_0x2ad220[_0x3ac21d(0x209)]()[_0x3ac21d(0x21b)]());_0x1bd531=_0x1bd531[_0x3ac21d(0x1e6)](_0x3353ed=>_0x3353ed[_0x3ac21d(0x224)]?.[_0x3ac21d(0x1f5)](_0x17a1e4=>_0x418cd2[_0x3ac21d(0x1de)](_0x17a1e4[_0x3ac21d(0x21b)]())));if(_0x1bd531[_0x3ac21d(0x1ba)]===0x0){console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x3ac21d(0x1d6)+_0x217d8c));const _0xf4ec9f=new Set();return _0x23c9c4[_0x3ac21d(0x1b7)]['forEach'](_0x3c2361=>_0x3c2361['tags']?.[_0x3ac21d(0x22e)](_0x277ada=>_0xf4ec9f['add'](_0x277ada))),_0xf4ec9f[_0x3ac21d(0x1f4)]>0x0?console[_0x3ac21d(0x20a)](a5_0x5dc5a7['dim'](_0x3ac21d(0x20f)+[..._0xf4ec9f][_0x3ac21d(0x1af)](',\x20'))):console['log'](a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x3ac21d(0x1d7))),0x1;}}if(_0x162c12)return this['executeReeval'](_0x393b37,{'definition':{'tests':_0x1bd531},'agentInfo':_0x3ea0e0,'outputFormat':_0x10c961,'outputFile':_0x204ea8,'testNames':_0x2fb139});if(_0x29600d){console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1c6)](_0x3ac21d(0x1ca))),console[_0x3ac21d(0x20a)]('\x20\x20Site:\x20'+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x19ee5d)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1bd)+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x3ea0e0['projectName'])),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1c1)+a5_0x5dc5a7['white'](_0x3ea0e0[_0x3ac21d(0x203)])),console['log'](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1aa)+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x1bd531['length']));for(let _0x53f112=0x0;_0x53f112<_0x1bd531[_0x3ac21d(0x1ba)];_0x53f112++){const _0xddeb7b=_0x1bd531[_0x53f112],_0x225eef=_0xddeb7b[_0x3ac21d(0x221)][_0x3ac21d(0x1ba)]===0x1?_0x3ac21d(0x1e3):_0x3ac21d(0x221),_0x4254c7=_0xddeb7b[_0x3ac21d(0x224)]?.[_0x3ac21d(0x1ba)]?'\x20['+_0xddeb7b[_0x3ac21d(0x224)][_0x3ac21d(0x1af)](',\x20')+']':'';console[_0x3ac21d(0x20a)]('\x20\x20'+(_0x53f112+0x1)+'.\x20'+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0xddeb7b['name'])+'\x20('+_0xddeb7b[_0x3ac21d(0x221)][_0x3ac21d(0x1ba)]+'\x20'+_0x225eef+')'+a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x4254c7));}return 0x0;}let _0x32c942,_0x21a8ca;try{_0x32c942=await _0x2a76d3[_0x3ac21d(0x210)][_0x3ac21d(0x21c)](_0x3ea0e0['projectName']);}catch(_0x5300e){const _0x4e844a=_0x5300e instanceof Error?_0x5300e[_0x3ac21d(0x20c)]:String(_0x5300e);return _0x4e844a[_0x3ac21d(0x1de)](_0x3ac21d(0x1dd))||_0x4e844a[_0x3ac21d(0x21b)]()['includes']('not\x20found')?console[_0x3ac21d(0x20a)](a5_0x5dc5a7['red'](_0x3ac21d(0x205)+_0x3ea0e0['projectName'])):console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1a8)+_0x3ea0e0[_0x3ac21d(0x1d2)]+'\x22:\x20'+_0x4e844a)),0x1;}try{_0x21a8ca=await _0x2a76d3['llm']['resolveAgentId'](_0x3ea0e0[_0x3ac21d(0x203)],_0x32c942);}catch(_0x2cbd2c){const _0x4c11ae=_0x2cbd2c instanceof Error?_0x2cbd2c[_0x3ac21d(0x20c)]:String(_0x2cbd2c);return _0x4c11ae[_0x3ac21d(0x1de)](_0x3ac21d(0x1dd))||_0x4c11ae[_0x3ac21d(0x21b)]()[_0x3ac21d(0x1de)]('not\x20found')?console['log'](a5_0x5dc5a7['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x3ea0e0[_0x3ac21d(0x203)])):console['log'](a5_0x5dc5a7['red'](_0x3ac21d(0x21d)+_0x3ea0e0[_0x3ac21d(0x203)]+_0x3ac21d(0x197)+_0x4c11ae)),0x1;}let _0x2a6e3c;if(!_0x320587)try{_0x2a6e3c=await setupEvaluatorAgent(_0x2a76d3[_0x3ac21d(0x210)],_0x113a53['verbose']);}catch(_0x14ed54){const _0x3710d0=_0x14ed54 instanceof Error?_0x14ed54[_0x3ac21d(0x20c)]:String(_0x14ed54);return console[_0x3ac21d(0x20a)](a5_0x5dc5a7['red'](_0x3ac21d(0x230)+_0x3710d0)),0x1;}console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1c6)](_0x3ac21d(0x1b9))),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1b6)+a5_0x5dc5a7['white'](_0x19ee5d)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x21e)+a5_0x5dc5a7['white'](_0x3ea0e0[_0x3ac21d(0x1d2)]+'/'+_0x3ea0e0[_0x3ac21d(0x203)])),console[_0x3ac21d(0x20a)]();const _0x437cb6=[],_0x1cf54f=[],_0x58b364=Date[_0x3ac21d(0x207)]();for(let _0x5cd427=0x0;_0x5cd427<_0x1bd531[_0x3ac21d(0x1ba)];_0x5cd427++){const _0x1b0295=_0x1bd531[_0x5cd427];_0x1bd531[_0x3ac21d(0x1ba)]>0x1?console['log'](_0x3ac21d(0x1cf)+(_0x5cd427+0x1)+'/'+_0x1bd531['length']+':\x20'+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x1b0295[_0x3ac21d(0x219)])):console[_0x3ac21d(0x20a)](_0x3ac21d(0x1c3)+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x1b0295[_0x3ac21d(0x219)]));const _0x2d5914=createCommandSpinner(_0x3ac21d(0x1a9)+_0x1b0295[_0x3ac21d(0x221)][_0x3ac21d(0x1ba)]+_0x3ac21d(0x1d1));_0x2d5914[_0x3ac21d(0x212)]();try{const {result:_0x30f95d,conversation:_0x5d478d}=await runTest(_0x2a76d3[_0x3ac21d(0x210)],_0x1b0295,{'agentId':_0x21a8ca,'projectId':_0x32c942,'site':_0x19ee5d,'noEval':_0x320587,'evaluatorId':_0x2a6e3c,'onRoundStart':(_0x481c9a,_0x13946a)=>{const _0x5515fd=_0x3ac21d;_0x2d5914[_0x5515fd(0x19a)]=_0x5515fd(0x1b8)+(_0x481c9a+0x1)+'/'+_0x13946a+_0x5515fd(0x1d1);},'onRoundComplete':(_0x4b7e6f,_0x3a5a2e,_0xf73f1c)=>{const _0x1e0a40=_0x3ac21d,_0x3d9ef4=formatElapsed(_0x3a5a2e);_0xf73f1c?console[_0x1e0a40(0x20a)](_0x1e0a40(0x1a4)+(_0x4b7e6f+0x1)+'/'+_0x1b0295['rounds'][_0x1e0a40(0x1ba)]+_0x1e0a40(0x218)+a5_0x5dc5a7[_0x1e0a40(0x1ed)]('✓')+'\x20('+_0x3d9ef4+')'):console[_0x1e0a40(0x20a)](_0x1e0a40(0x1a4)+(_0x4b7e6f+0x1)+'/'+_0x1b0295[_0x1e0a40(0x221)][_0x1e0a40(0x1ba)]+'...\x20'+a5_0x5dc5a7['red']('✗'));},'onEvaluationStart':()=>{const _0x1ef914=_0x3ac21d;_0x2d5914['text']=_0x1ef914(0x1f6);},'onEvaluationComplete':_0x391c84=>{const _0x920e11=_0x3ac21d,_0x56b0a5=formatElapsed(_0x391c84);console[_0x920e11(0x20a)](_0x920e11(0x1da)+a5_0x5dc5a7['green']('✓')+'\x20('+_0x56b0a5+')');}});_0x2d5914[_0x3ac21d(0x1ab)](),_0x437cb6[_0x3ac21d(0x223)](_0x30f95d),_0x1cf54f[_0x3ac21d(0x223)](_0x5d478d);if(_0x30f95d['status']===_0x3ac21d(0x1c4))console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1ed)](_0x3ac21d(0x211)+_0x30f95d['reason']));else _0x30f95d['status']==='FAIL'?console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1eb)+_0x30f95d[_0x3ac21d(0x1ce)])):console[_0x3ac21d(0x20a)](a5_0x5dc5a7['red'](_0x3ac21d(0x1d3)+_0x30f95d[_0x3ac21d(0x1ce)]));_0x30f95d[_0x3ac21d(0x213)]&&console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)]('Conversation\x20URL:\x20'+_0x30f95d[_0x3ac21d(0x213)])),console[_0x3ac21d(0x20a)]();}catch(_0x2551f3){_0x2d5914[_0x3ac21d(0x1ab)]();const _0x15ceba=_0x2551f3 instanceof Error?_0x2551f3[_0x3ac21d(0x20c)]:String(_0x2551f3);console['log'](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1d3)+_0x15ceba)),console[_0x3ac21d(0x20a)](),_0x437cb6[_0x3ac21d(0x223)]({'name':_0x1b0295['name'],'status':'ERROR','reason':_0x15ceba,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x42e7f5=Date[_0x3ac21d(0x207)]()-_0x58b364,_0x45a3d7=_0x437cb6[_0x3ac21d(0x1e6)](_0x57fb4d=>_0x57fb4d[_0x3ac21d(0x1b4)]===_0x3ac21d(0x1c4))[_0x3ac21d(0x1ba)],_0x8cea23=_0x437cb6[_0x3ac21d(0x1e6)](_0x5c54af=>_0x5c54af[_0x3ac21d(0x1b4)]==='FAIL')[_0x3ac21d(0x1ba)],_0x30be24=_0x437cb6[_0x3ac21d(0x1e6)](_0x193e6b=>_0x193e6b['status']===_0x3ac21d(0x1fe))[_0x3ac21d(0x1ba)];console[_0x3ac21d(0x20a)]('━'[_0x3ac21d(0x19c)](0x3c)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x19e)),console[_0x3ac21d(0x20a)]('━'[_0x3ac21d(0x19c)](0x3c)),console['log'](_0x3ac21d(0x204)+_0x437cb6['length']),console['log'](_0x3ac21d(0x199)+a5_0x5dc5a7[_0x3ac21d(0x1ed)](_0x45a3d7)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1d4)+a5_0x5dc5a7[_0x3ac21d(0x198)](_0x8cea23));_0x30be24>0x0&&console['log'](_0x3ac21d(0x1ec)+a5_0x5dc5a7[_0x3ac21d(0x198)](_0x30be24));console[_0x3ac21d(0x20a)]('Duration:\x20'+formatElapsed(_0x42e7f5)),console['log']('━'['repeat'](0x3c));const _0x38ffe0=_0x437cb6['filter'](_0xbb6a78=>_0xbb6a78[_0x3ac21d(0x1b4)]!==_0x3ac21d(0x1c4));if(_0x38ffe0[_0x3ac21d(0x1ba)]>0x0){console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x201));for(const _0x1096da of _0x38ffe0){const _0x5e370b=a5_0x5dc5a7[_0x3ac21d(0x198)]('✗'),_0xb13e63=_0x1096da[_0x3ac21d(0x1ce)][_0x3ac21d(0x1ba)]>0x32?_0x1096da[_0x3ac21d(0x1ce)][_0x3ac21d(0x1c2)](0x0,0x32)+_0x3ac21d(0x229):_0x1096da['reason'];console[_0x3ac21d(0x20a)]('\x20\x20'+_0x5e370b+'\x20'+_0x1096da[_0x3ac21d(0x219)]+':\x20'+_0xb13e63);}}const _0x16e0e2={'summary':{'total':_0x437cb6[_0x3ac21d(0x1ba)],'passed':_0x45a3d7,'failed':_0x8cea23,'errors':_0x30be24>0x0?_0x30be24:undefined,'duration_ms':_0x42e7f5},'tests':_0x437cb6,'agent':{'project':_0x3ea0e0[_0x3ac21d(0x1d2)],'name':_0x3ea0e0['agentName'],'site':_0x19ee5d},'timestamp':new Date(_0x58b364)['toISOString']()};try{const _0xb591b3=buildCachedTestRun(_0x1cf54f,{'site':_0x19ee5d,'projectId':_0x32c942,'projectName':_0x3ea0e0[_0x3ac21d(0x1d2)],'agentId':_0x21a8ca,'agentName':_0x3ea0e0[_0x3ac21d(0x203)],'testYmlPath':a5_0x1973a9[_0x3ac21d(0x1a2)](_0x3ea0e0[_0x3ac21d(0x1bc)])});saveLastTestRun(_0xb591b3);}catch{}if(_0x10c961!==_0x3ac21d(0x1e9)||_0x204ea8){const _0x4dfe6f=formatResults(_0x16e0e2,_0x10c961);if(_0x204ea8)try{a5_0x450a1f[_0x3ac21d(0x1be)](_0x204ea8,_0x4dfe6f,'utf-8'),console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)]('Output\x20written\x20to:\x20'+_0x204ea8));}catch(_0x2e179a){return console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x217)+_0x2e179a)),0x1;}else console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](_0x4dfe6f);}return _0x38ffe0[_0x3ac21d(0x1ba)]>0x0?0x1:0x0;}async[a5_0x48f77d(0x1db)](_0x4ab9a8,_0x38b50b){const _0x5ed24a=a5_0x48f77d,{options:_0x3283fe,tdx:_0xe66f34}=_0x4ab9a8,{definition:_0x1e1928,agentInfo:_0x4b48c7,outputFormat:_0x2fc1e6,outputFile:_0x3766dc}=_0x38b50b,_0x4269da=_0x3283fe[_0x5ed24a(0x1dc)],_0x55eaf1=loadLastTestRun();if(!_0x55eaf1)return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x1ea))),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x1d0))),0x1;if(_0x55eaf1[_0x5ed24a(0x22c)][_0x5ed24a(0x203)]!==_0x4b48c7['agentName'])return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x55eaf1[_0x5ed24a(0x22c)][_0x5ed24a(0x203)]+_0x5ed24a(0x1b3)+_0x4b48c7[_0x5ed24a(0x203)]+'\x22.')),console[_0x5ed24a(0x20a)](a5_0x5dc5a7['dim'](_0x5ed24a(0x1f1))),0x1;const _0x2f4c9e=new Set(_0x55eaf1[_0x5ed24a(0x214)][_0x5ed24a(0x1f3)](_0x1083e4=>_0x1083e4[_0x5ed24a(0x1ee)])),_0x19240d=_0x1e1928[_0x5ed24a(0x1b7)][_0x5ed24a(0x1e6)](_0x5e5c0e=>!_0x2f4c9e[_0x5ed24a(0x196)](_0x5e5c0e[_0x5ed24a(0x219)]));if(_0x19240d[_0x5ed24a(0x1ba)]>0x0&&_0x55eaf1['site']!==_0x4269da)return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x1e1)+_0x55eaf1[_0x5ed24a(0x1dc)]+_0x5ed24a(0x202)+_0x4269da+'\x22.')),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x1ad)+_0x55eaf1['site']+_0x5ed24a(0x1c0))),0x1;const _0x3dad88=_0x1e1928[_0x5ed24a(0x1b7)][_0x5ed24a(0x1e6)](_0x19ca01=>_0x2f4c9e[_0x5ed24a(0x196)](_0x19ca01[_0x5ed24a(0x219)])),_0x163ab2=_0x19240d;let _0x55af4f;try{_0x55af4f=await setupEvaluatorAgent(_0xe66f34[_0x5ed24a(0x210)],_0x3283fe['verbose']);}catch(_0x415825){const _0x5420ca=_0x415825 instanceof Error?_0x415825[_0x5ed24a(0x20c)]:String(_0x415825);return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x230)+_0x5420ca)),0x1;}console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x1c6)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5ed24a(0x20a)](_0x5ed24a(0x19f)+a5_0x5dc5a7[_0x5ed24a(0x1b0)](_0x55eaf1[_0x5ed24a(0x1b5)])),console[_0x5ed24a(0x20a)](_0x5ed24a(0x21e)+a5_0x5dc5a7[_0x5ed24a(0x1b0)](_0x55eaf1[_0x5ed24a(0x22c)]['projectName']+'/'+_0x55eaf1['agent'][_0x5ed24a(0x203)]));_0x163ab2[_0x5ed24a(0x1ba)]>0x0&&console[_0x5ed24a(0x20a)]('New\x20tests\x20to\x20execute:\x20'+a5_0x5dc5a7[_0x5ed24a(0x1fa)](_0x163ab2[_0x5ed24a(0x1ba)]));console[_0x5ed24a(0x20a)]();const _0x1c98ff=[],_0x304c1c=Date[_0x5ed24a(0x207)](),_0x383109=createCommandSpinner(_0x5ed24a(0x1d8));if(_0x3dad88[_0x5ed24a(0x1ba)]>0x0)try{const _0x4a0919=await reevaluateFromCache(_0xe66f34[_0x5ed24a(0x210)],_0x55eaf1,{'tests':_0x3dad88},{'evaluatorId':_0x55af4f,'onTestStart':(_0x339a5d,_0x57a802,_0x2583e6)=>{const _0x428eed=_0x5ed24a;_0x383109[_0x428eed(0x19a)]=_0x428eed(0x1fb)+(_0x57a802+0x1)+'/'+_0x2583e6+':\x20'+_0x339a5d+_0x428eed(0x229);if(!_0x383109[_0x428eed(0x1ff)])_0x383109[_0x428eed(0x212)]();},'onTestComplete':(_0x437b21,_0x5f0061)=>{const _0x1d5442=_0x5ed24a;_0x383109['stop']();if(_0x5f0061['status']===_0x1d5442(0x1c4))console[_0x1d5442(0x20a)](a5_0x5dc5a7['green']('✓\x20PASS:\x20'+_0x437b21)+a5_0x5dc5a7['dim']('\x20(cached)'));else _0x5f0061[_0x1d5442(0x1b4)]===_0x1d5442(0x228)?console[_0x1d5442(0x20a)](a5_0x5dc5a7[_0x1d5442(0x198)](_0x1d5442(0x1eb)+_0x437b21+'\x20-\x20'+_0x5f0061[_0x1d5442(0x1ce)])+a5_0x5dc5a7[_0x1d5442(0x22a)](_0x1d5442(0x20b))):console['log'](a5_0x5dc5a7[_0x1d5442(0x198)](_0x1d5442(0x1d3)+_0x437b21+_0x1d5442(0x1a3)+_0x5f0061['reason']));_0x5f0061[_0x1d5442(0x213)]&&console[_0x1d5442(0x20a)](a5_0x5dc5a7[_0x1d5442(0x22a)](_0x1d5442(0x1e0)+_0x5f0061['conversation_url'])),_0x1c98ff[_0x1d5442(0x223)](_0x5f0061);},'onTestSkipped':(_0x5c29ca,_0x22f008)=>{const _0x514051=_0x5ed24a;_0x383109['stop'](),console[_0x514051(0x20a)](a5_0x5dc5a7[_0x514051(0x1fa)](_0x514051(0x1f2)+_0x5c29ca+_0x514051(0x1a3)+_0x22f008));}});for(const _0x49b732 of _0x4a0919){!_0x1c98ff['find'](_0x9d69cd=>_0x9d69cd['name']===_0x49b732[_0x5ed24a(0x219)])&&_0x1c98ff[_0x5ed24a(0x223)](_0x49b732);}}catch(_0xd8f8d6){_0x383109[_0x5ed24a(0x1ab)]();const _0x3c6d4d=_0xd8f8d6 instanceof Error?_0xd8f8d6[_0x5ed24a(0x20c)]:String(_0xd8f8d6);return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x206)+_0x3c6d4d)),0x1;}_0x383109['stop']();if(_0x163ab2[_0x5ed24a(0x1ba)]>0x0){console[_0x5ed24a(0x20a)](),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x1c6)](_0x5ed24a(0x1c8)));const {projectId:_0x1999f5,agentId:_0x54da8d}=_0x55eaf1[_0x5ed24a(0x22c)];for(const _0x1fd4e1 of _0x163ab2){console[_0x5ed24a(0x20a)](_0x5ed24a(0x1ae)+a5_0x5dc5a7[_0x5ed24a(0x1b0)](_0x1fd4e1[_0x5ed24a(0x219)]));const _0x4c74fa=createCommandSpinner('Round\x201/'+_0x1fd4e1[_0x5ed24a(0x221)][_0x5ed24a(0x1ba)]+_0x5ed24a(0x1d1));_0x4c74fa[_0x5ed24a(0x212)]();try{const {result:_0x50464c}=await runTest(_0xe66f34[_0x5ed24a(0x210)],_0x1fd4e1,{'agentId':_0x54da8d,'projectId':_0x1999f5,'site':_0x55eaf1[_0x5ed24a(0x1dc)],'noEval':![],'evaluatorId':_0x55af4f,'onRoundStart':(_0x3d07a1,_0x515b4d)=>{const _0xd55905=_0x5ed24a;_0x4c74fa[_0xd55905(0x19a)]=_0xd55905(0x1b8)+(_0x3d07a1+0x1)+'/'+_0x515b4d+_0xd55905(0x1d1);},'onRoundComplete':(_0x35faec,_0x13fdb0,_0x3c9142)=>{const _0x32ab6e=_0x5ed24a,_0x3ab0f5=formatElapsed(_0x13fdb0);_0x3c9142?console[_0x32ab6e(0x20a)](_0x32ab6e(0x1a4)+(_0x35faec+0x1)+'/'+_0x1fd4e1[_0x32ab6e(0x221)][_0x32ab6e(0x1ba)]+_0x32ab6e(0x218)+a5_0x5dc5a7['green']('✓')+'\x20('+_0x3ab0f5+')'):console[_0x32ab6e(0x20a)](_0x32ab6e(0x1a4)+(_0x35faec+0x1)+'/'+_0x1fd4e1[_0x32ab6e(0x221)][_0x32ab6e(0x1ba)]+_0x32ab6e(0x218)+a5_0x5dc5a7[_0x32ab6e(0x198)]('✗'));},'onEvaluationStart':()=>{const _0x4946bc=_0x5ed24a;_0x4c74fa[_0x4946bc(0x19a)]=_0x4946bc(0x1f6);},'onEvaluationComplete':_0x4d02ee=>{const _0x5d7398=_0x5ed24a,_0x3b4ad6=formatElapsed(_0x4d02ee);console[_0x5d7398(0x20a)](_0x5d7398(0x1da)+a5_0x5dc5a7['green']('✓')+'\x20('+_0x3b4ad6+')');}});_0x4c74fa[_0x5ed24a(0x1ab)](),_0x1c98ff['push'](_0x50464c);if(_0x50464c[_0x5ed24a(0x1b4)]===_0x5ed24a(0x1c4))console['log'](a5_0x5dc5a7[_0x5ed24a(0x1ed)](_0x5ed24a(0x211)+_0x50464c[_0x5ed24a(0x1ce)])+a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x200)));else _0x50464c[_0x5ed24a(0x1b4)]===_0x5ed24a(0x228)?console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x1eb)+_0x50464c[_0x5ed24a(0x1ce)])+a5_0x5dc5a7['dim'](_0x5ed24a(0x200))):console['log'](a5_0x5dc5a7['red'](_0x5ed24a(0x1d3)+_0x50464c['reason']));_0x50464c[_0x5ed24a(0x213)]&&console[_0x5ed24a(0x20a)](a5_0x5dc5a7['dim'](_0x5ed24a(0x1e0)+_0x50464c['conversation_url']));}catch(_0x46cb63){_0x4c74fa[_0x5ed24a(0x1ab)]();const _0x5cced1=_0x46cb63 instanceof Error?_0x46cb63[_0x5ed24a(0x20c)]:String(_0x46cb63);console[_0x5ed24a(0x20a)](a5_0x5dc5a7['red'](_0x5ed24a(0x1d3)+_0x5cced1)),_0x1c98ff[_0x5ed24a(0x223)]({'name':_0x1fd4e1[_0x5ed24a(0x219)],'status':_0x5ed24a(0x1fe),'reason':_0x5cced1,'timestamp':new Date()[_0x5ed24a(0x19d)](),'duration_ms':0x0});}}}console[_0x5ed24a(0x20a)]();const _0x4a6095=Date[_0x5ed24a(0x207)]()-_0x304c1c,_0x4371f3=_0x1c98ff[_0x5ed24a(0x1e6)](_0x3d974c=>_0x3d974c[_0x5ed24a(0x1b4)]===_0x5ed24a(0x1c4))[_0x5ed24a(0x1ba)],_0x3c9653=_0x1c98ff[_0x5ed24a(0x1e6)](_0x2de905=>_0x2de905[_0x5ed24a(0x1b4)]==='FAIL')['length'],_0x14d57f=_0x1c98ff['filter'](_0x353f91=>_0x353f91[_0x5ed24a(0x1b4)]===_0x5ed24a(0x1fe))[_0x5ed24a(0x1ba)];console['log']('━'[_0x5ed24a(0x19c)](0x3c)),console[_0x5ed24a(0x20a)](_0x5ed24a(0x1e5)),console[_0x5ed24a(0x20a)]('━'[_0x5ed24a(0x19c)](0x3c)),console[_0x5ed24a(0x20a)]('Total:\x20\x20\x20\x20'+_0x1c98ff[_0x5ed24a(0x1ba)]),console['log'](_0x5ed24a(0x199)+a5_0x5dc5a7['green'](_0x4371f3)),console['log'](_0x5ed24a(0x1d4)+a5_0x5dc5a7[_0x5ed24a(0x198)](_0x3c9653));_0x14d57f>0x0&&console['log'](_0x5ed24a(0x1ec)+a5_0x5dc5a7[_0x5ed24a(0x198)](_0x14d57f));console[_0x5ed24a(0x20a)](_0x5ed24a(0x1d9)+formatElapsed(_0x4a6095)),console[_0x5ed24a(0x20a)]('━'['repeat'](0x3c));const _0x3b3c0d={'summary':{'total':_0x1c98ff[_0x5ed24a(0x1ba)],'passed':_0x4371f3,'failed':_0x3c9653,'errors':_0x14d57f>0x0?_0x14d57f:undefined,'duration_ms':_0x4a6095},'tests':_0x1c98ff,'agent':{'project':_0x4b48c7[_0x5ed24a(0x1d2)],'name':_0x4b48c7['agentName'],'site':_0x4269da},'timestamp':new Date(_0x304c1c)[_0x5ed24a(0x19d)]()};if(_0x2fc1e6!==_0x5ed24a(0x1e9)||_0x3766dc){const _0xcfc306=formatResults(_0x3b3c0d,_0x2fc1e6);if(_0x3766dc)try{a5_0x450a1f['writeFileSync'](_0x3766dc,_0xcfc306,_0x5ed24a(0x1e8)),console['log'](),console['log'](a5_0x5dc5a7[_0x5ed24a(0x22a)]('Output\x20written\x20to:\x20'+_0x3766dc));}catch(_0x1443fd){return console[_0x5ed24a(0x20a)](),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x217)+_0x1443fd)),0x1;}else console[_0x5ed24a(0x20a)](),console[_0x5ed24a(0x20a)](_0xcfc306);}const _0x421ebe=_0x1c98ff[_0x5ed24a(0x1e6)](_0x12c7a9=>_0x12c7a9[_0x5ed24a(0x1b4)]!==_0x5ed24a(0x1c4));return _0x421ebe['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x4514ba=a5_0x3409;(function(_0x167e7a,_0xf7756c){const _0xd824a0=a5_0x3409,_0x1ef276=_0x167e7a();while(!![]){try{const _0x434738=parseInt(_0xd824a0(0x141))/0x1*(-parseInt(_0xd824a0(0x1a2))/0x2)+parseInt(_0xd824a0(0x162))/0x3*(parseInt(_0xd824a0(0x14e))/0x4)+-parseInt(_0xd824a0(0x169))/0x5+-parseInt(_0xd824a0(0x19a))/0x6*(parseInt(_0xd824a0(0x1b7))/0x7)+-parseInt(_0xd824a0(0x1a0))/0x8+parseInt(_0xd824a0(0x1c8))/0x9+parseInt(_0xd824a0(0x190))/0xa*(parseInt(_0xd824a0(0x1c5))/0xb);if(_0x434738===_0xf7756c)break;else _0x1ef276['push'](_0x1ef276['shift']());}catch(_0x4e41d2){_0x1ef276['push'](_0x1ef276['shift']());}}}(a5_0xfcd3,0x62b34));function a5_0xfcd3(){const _0x1aecbf=['Run\x20tests\x20for\x20an\x20LLM\x20agent','white','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20(cached)','jsonl','resolveProjectId','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Evaluating...\x20','\x20\x20Agent:\x20','Test\x20Summary','has','resolveAgentId','16217377eFCIdf','log','some','2763729MJnNBb','repeat','Available\x20tests:\x20','test.yml','Running\x20agent\x20tests...','executeReeval','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','Agent:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','ERROR','round','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','llmProject','No\x20tests\x20have\x20tags\x20defined.','231XIzXUq','find','/<agent-name>','writeFileSync','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','trim','FAIL','Errors:\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','tags','agentDirs','Failed\x20Tests:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','76432pQOuGo','dim','name','stop','Test\x20','conversation_url','reason','Error:\x20No\x20previous\x20test\x20run\x20found.','now','agent:test','message','table','tsv','timestamp','✗\x20FAIL:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20-\x20','\x22:\x20','tests','Output\x20written\x20to:\x20','111tRNcKs','found','includes','red','verbose','Round\x20','agentName','3961435BkmVLp','Site:\x20','text','push','Evaluating\x20response...','output','no_tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','llm','\x20\x20Project:\x20','New\x20tests\x20to\x20execute:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','start','Round\x201/','dryRun','execute','Total:\x20\x20\x20\x20','join','\x20\x20Site:\x20','toISOString','length','cyan',':\x20Sending\x20user\x20input...','description','Cached\x20run\x20is\x20from\x20site\x20\x22','agent','Duration:\x20','projectName','conversations','\x20\x20Round\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','testName','status','projectDir','add','resolve','Running\x20test:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Failed:\x20\x20\x20','10jCUDVH','split','Re-evaluating\x20','Passed:\x20\x20\x20','✗\x20ERROR:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','not\x20found','map','Tests\x20found:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','1103634mrjBNq','green','\x20\x20Conversation:\x20','Running:\x20','PASS','context','1239552faUxKz','404','6658FzjgqC','filter','⚠\x20SKIPPED:\x20','yellow','toLowerCase','reeval','site','forEach','substring','rounds','Available\x20tags:\x20','Re-evaluating...','\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','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Project\x20path:\x20','multiple_agents','Run\x20\x27tdx\x20agent\x20pull\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','basename','eval','...\x20','14rSlTVD'];a5_0xfcd3=function(){return _0x1aecbf;};return a5_0xfcd3();}import*as a5_0xa4fb5d from'node:fs';import*as a5_0x5dfda6 from'node:path';function a5_0x3409(_0x14ed45,_0x143523){_0x14ed45=_0x14ed45-0x137;const _0xfcd3d6=a5_0xfcd3();let _0x340926=_0xfcd3d6[_0x14ed45];return _0x340926;}import a5_0x1d553d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4514ba(0x150)]=a5_0x4514ba(0x157);[a5_0x4514ba(0x180)]=a5_0x4514ba(0x1b8);async[a5_0x4514ba(0x178)](_0x26d33d){const _0x417548=a5_0x4514ba,{options:_0x4387d6,args:_0x4e7e39,tdx:_0x43143c}=_0x26d33d,_0x45467d=_0x4e7e39[0x0]||'.',_0x543870=_0x4387d6[_0x417548(0x177)],_0x413956=_0x4387d6,_0x57f4ea=_0x413956[_0x417548(0x1b5)]===![],_0x5867bb=_0x413956[_0x417548(0x1a7)],_0x483fd0=_0x413956[_0x417548(0x150)],_0x4caab9=_0x413956[_0x417548(0x14a)],_0x56167a=_0x4387d6[_0x417548(0x1a8)],_0x5c25e4=_0x413956[_0x417548(0x16e)];if(_0x5867bb&&_0x57f4ea)return console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x195))),0x1;let _0x18455a='table';if(_0x413956['json'])_0x18455a='json';else{if(_0x413956['jsonl'])_0x18455a=_0x417548(0x1bd);else{if(_0x413956[_0x417548(0x15a)])_0x18455a='tsv';else{if(_0x413956['table'])_0x18455a=_0x417548(0x159);}}}const _0x2c9f6b=_0x413956[_0x417548(0x13f)];let _0x3ccbcf=_0x45467d;const _0x3b4313=a5_0xa4fb5d['existsSync'](_0x45467d),_0x307ebe=_0x45467d==='.';if(!_0x3b4313||_0x307ebe){const _0x2f8349=resolveProjectFromContext(_0x45467d,_0x2c9f6b,{'requireFile':_0x417548(0x1cb)});if(_0x2f8349[_0x417548(0x163)])_0x3ccbcf=_0x2f8349[_0x417548(0x18a)],_0x2f8349['source']===_0x417548(0x19f)&&console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)]('Using\x20agent:\x20'+_0x3ccbcf));else switch(_0x2f8349[_0x417548(0x154)]){case'no_context':console['log'](a5_0x1d553d[_0x417548(0x1a5)](_0x2f8349['message'])),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)]('Usage:'),console['log'](_0x417548(0x1ae)),console['log'](_0x417548(0x1ba)),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x1bf));return 0x1;case'no_local_folder':console['log'](a5_0x1d553d[_0x417548(0x1a5)](_0x2f8349[_0x417548(0x158)])),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x1b2)+_0x2f8349[_0x417548(0x13f)]+_0x417548(0x187));return 0x1;case _0x417548(0x1b1):{const _0x388c54=a5_0x5dfda6[_0x417548(0x1b4)](_0x2f8349[_0x417548(0x18a)]);console['log'](a5_0x1d553d['yellow'](_0x417548(0x13a)+_0x2f8349['llmProject']+'\x22:'));for(const _0xc202a7 of _0x2f8349[_0x417548(0x14b)]){console[_0x417548(0x1c6)]('\x20\x20-\x20'+_0xc202a7);}return console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x174)+_0x388c54+_0x417548(0x143)),0x1;}case _0x417548(0x16f):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x1a5)](_0x417548(0x199)+_0x2f8349['llmProject']+'\x22.')),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1b0)+_0x2f8349[_0x417548(0x18a)])),console['log'](),console[_0x417548(0x1c6)](_0x417548(0x15d));return 0x1;}}const {definition:_0x3cbd8b,agentInfo:_0x3720c5}=parseTestFile(_0x3ccbcf);let _0x58bc38=_0x3cbd8b[_0x417548(0x160)];if(_0x483fd0){const _0x252ba4=_0x483fd0[_0x417548(0x191)](',')[_0x417548(0x197)](_0x3ee16c=>_0x3ee16c[_0x417548(0x146)]());_0x58bc38=_0x3cbd8b[_0x417548(0x160)][_0x417548(0x1a3)](_0x441e19=>_0x252ba4[_0x417548(0x164)](_0x441e19[_0x417548(0x150)]));if(_0x58bc38['length']===0x0)return console[_0x417548(0x1c6)](a5_0x1d553d['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x483fd0)),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1ca)+_0x3cbd8b[_0x417548(0x160)][_0x417548(0x197)](_0x5e2daf=>_0x5e2daf[_0x417548(0x150)])[_0x417548(0x17a)](',\x20'))),0x1;}if(_0x4caab9){const _0x10b918=_0x4caab9[_0x417548(0x191)](',')['map'](_0x19fe7d=>_0x19fe7d[_0x417548(0x146)]()[_0x417548(0x1a6)]());_0x58bc38=_0x58bc38['filter'](_0x5b00bb=>_0x5b00bb[_0x417548(0x14a)]?.[_0x417548(0x1c7)](_0x5df7a1=>_0x10b918[_0x417548(0x164)](_0x5df7a1[_0x417548(0x1a6)]())));if(_0x58bc38[_0x417548(0x17d)]===0x0){console[_0x417548(0x1c6)](a5_0x1d553d['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4caab9));const _0x55197a=new Set();return _0x3cbd8b[_0x417548(0x160)][_0x417548(0x1a9)](_0x1cbd0e=>_0x1cbd0e[_0x417548(0x14a)]?.[_0x417548(0x1a9)](_0x10d695=>_0x55197a[_0x417548(0x18b)](_0x10d695))),_0x55197a['size']>0x0?console['log'](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1ac)+[..._0x55197a][_0x417548(0x17a)](',\x20'))):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x140))),0x1;}}if(_0x5867bb)return this['executeReeval'](_0x26d33d,{'definition':{'tests':_0x58bc38},'agentInfo':_0x3720c5,'outputFormat':_0x18455a,'outputFile':_0x5c25e4,'testNames':_0x483fd0});if(_0x543870){console['log'](a5_0x1d553d[_0x417548(0x17e)]('Test\x20Configuration:')),console[_0x417548(0x1c6)](_0x417548(0x17b)+a5_0x1d553d[_0x417548(0x1b9)](_0x56167a)),console['log'](_0x417548(0x172)+a5_0x1d553d[_0x417548(0x1b9)](_0x3720c5[_0x417548(0x184)])),console[_0x417548(0x1c6)](_0x417548(0x1c1)+a5_0x1d553d['white'](_0x3720c5[_0x417548(0x168)])),console['log'](),console['log'](_0x417548(0x198)+a5_0x1d553d[_0x417548(0x1b9)](_0x58bc38['length']));for(let _0x10a12e=0x0;_0x10a12e<_0x58bc38[_0x417548(0x17d)];_0x10a12e++){const _0x2b990d=_0x58bc38[_0x10a12e],_0x739ee4=_0x2b990d[_0x417548(0x1ab)][_0x417548(0x17d)]===0x1?_0x417548(0x13d):_0x417548(0x1ab),_0xa11a3c=_0x2b990d[_0x417548(0x14a)]?.[_0x417548(0x17d)]?'\x20['+_0x2b990d[_0x417548(0x14a)][_0x417548(0x17a)](',\x20')+']':'';console[_0x417548(0x1c6)]('\x20\x20'+(_0x10a12e+0x1)+'.\x20'+a5_0x1d553d['white'](_0x2b990d['name'])+'\x20('+_0x2b990d[_0x417548(0x1ab)][_0x417548(0x17d)]+'\x20'+_0x739ee4+')'+a5_0x1d553d[_0x417548(0x14f)](_0xa11a3c));}return 0x0;}let _0x5a48ab,_0x4fe523;try{_0x5a48ab=await _0x43143c[_0x417548(0x171)][_0x417548(0x1be)](_0x3720c5[_0x417548(0x184)]);}catch(_0x2811fc){const _0x5f5acf=_0x2811fc instanceof Error?_0x2811fc[_0x417548(0x158)]:String(_0x2811fc);return _0x5f5acf['includes'](_0x417548(0x1a1))||_0x5f5acf[_0x417548(0x1a6)]()['includes'](_0x417548(0x196))?console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x18e)+_0x3720c5[_0x417548(0x184)])):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x1b3)+_0x3720c5['projectName']+_0x417548(0x15f)+_0x5f5acf)),0x1;}try{_0x4fe523=await _0x43143c[_0x417548(0x171)][_0x417548(0x1c4)](_0x3720c5[_0x417548(0x168)],_0x5a48ab);}catch(_0x37aee3){const _0x5954f6=_0x37aee3 instanceof Error?_0x37aee3[_0x417548(0x158)]:String(_0x37aee3);return _0x5954f6[_0x417548(0x164)](_0x417548(0x1a1))||_0x5954f6[_0x417548(0x1a6)]()[_0x417548(0x164)]('not\x20found')?console['log'](a5_0x1d553d[_0x417548(0x165)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x3720c5['agentName'])):console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x1bb)+_0x3720c5[_0x417548(0x168)]+'\x22:\x20'+_0x5954f6)),0x1;}let _0x57c19c;if(!_0x57f4ea)try{_0x57c19c=await setupEvaluatorAgent(_0x43143c[_0x417548(0x171)],_0x4387d6['verbose']);}catch(_0x45db3a){const _0x14208a=_0x45db3a instanceof Error?_0x45db3a[_0x417548(0x158)]:String(_0x45db3a);return console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x14d)+_0x14208a)),0x1;}console[_0x417548(0x1c6)](a5_0x1d553d['cyan'](_0x417548(0x1cc))),console[_0x417548(0x1c6)](_0x417548(0x16a)+a5_0x1d553d[_0x417548(0x1b9)](_0x56167a)),console['log'](_0x417548(0x139)+a5_0x1d553d[_0x417548(0x1b9)](_0x3720c5['projectName']+'/'+_0x3720c5['agentName'])),console[_0x417548(0x1c6)]();const _0x3231c7=[],_0x46af1d=[],_0x3cadd4=Date['now']();for(let _0x2d69bd=0x0;_0x2d69bd<_0x58bc38[_0x417548(0x17d)];_0x2d69bd++){const _0x17548c=_0x58bc38[_0x2d69bd];_0x58bc38[_0x417548(0x17d)]>0x1?console['log'](_0x417548(0x152)+(_0x2d69bd+0x1)+'/'+_0x58bc38[_0x417548(0x17d)]+':\x20'+a5_0x1d553d[_0x417548(0x1b9)](_0x17548c['name'])):console['log'](_0x417548(0x18d)+a5_0x1d553d['white'](_0x17548c[_0x417548(0x150)]));const _0x24989b=createCommandSpinner(_0x417548(0x176)+_0x17548c['rounds'][_0x417548(0x17d)]+_0x417548(0x17f));_0x24989b[_0x417548(0x175)]();try{const {result:_0xd7cfc1,conversation:_0xe0c72f}=await runTest(_0x43143c[_0x417548(0x171)],_0x17548c,{'agentId':_0x4fe523,'projectId':_0x5a48ab,'site':_0x56167a,'noEval':_0x57f4ea,'evaluatorId':_0x57c19c,'onRoundStart':(_0x92d72c,_0x12a7db)=>{const _0x2fa90f=_0x417548;_0x24989b[_0x2fa90f(0x16b)]='Round\x20'+(_0x92d72c+0x1)+'/'+_0x12a7db+_0x2fa90f(0x17f);},'onRoundComplete':(_0x5e16f1,_0x14a562,_0x369a63)=>{const _0x1ba593=_0x417548,_0x56e97e=formatElapsed(_0x14a562);_0x369a63?console[_0x1ba593(0x1c6)]('\x20\x20Round\x20'+(_0x5e16f1+0x1)+'/'+_0x17548c[_0x1ba593(0x1ab)][_0x1ba593(0x17d)]+_0x1ba593(0x1b6)+a5_0x1d553d['green']('✓')+'\x20('+_0x56e97e+')'):console['log']('\x20\x20Round\x20'+(_0x5e16f1+0x1)+'/'+_0x17548c[_0x1ba593(0x1ab)][_0x1ba593(0x17d)]+_0x1ba593(0x1b6)+a5_0x1d553d[_0x1ba593(0x165)]('✗'));},'onEvaluationStart':()=>{const _0x35e515=_0x417548;_0x24989b[_0x35e515(0x16b)]=_0x35e515(0x16d);},'onEvaluationComplete':_0x28bcc5=>{const _0x277ea0=_0x417548,_0x2c6ada=formatElapsed(_0x28bcc5);console['log'](_0x277ea0(0x1c0)+a5_0x1d553d['green']('✓')+'\x20('+_0x2c6ada+')');}});_0x24989b[_0x417548(0x151)](),_0x3231c7[_0x417548(0x16c)](_0xd7cfc1),_0x46af1d['push'](_0xe0c72f);if(_0xd7cfc1['status']===_0x417548(0x19e))console['log'](a5_0x1d553d[_0x417548(0x19b)](_0x417548(0x137)+_0xd7cfc1[_0x417548(0x154)]));else _0xd7cfc1[_0x417548(0x189)]===_0x417548(0x147)?console['log'](a5_0x1d553d[_0x417548(0x165)]('✗\x20FAIL:\x20'+_0xd7cfc1['reason'])):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x194)+_0xd7cfc1[_0x417548(0x154)]));_0xd7cfc1['conversation_url']&&console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)]('Conversation\x20URL:\x20'+_0xd7cfc1[_0x417548(0x153)])),console['log']();}catch(_0xfbf53c){_0x24989b['stop']();const _0x3e16d0=_0xfbf53c instanceof Error?_0xfbf53c['message']:String(_0xfbf53c);console['log'](a5_0x1d553d['red'](_0x417548(0x194)+_0x3e16d0)),console[_0x417548(0x1c6)](),_0x3231c7['push']({'name':_0x17548c['name'],'status':_0x417548(0x13c),'reason':_0x3e16d0,'timestamp':new Date()[_0x417548(0x17c)](),'duration_ms':0x0});}}const _0x3f71e7=Date[_0x417548(0x156)]()-_0x3cadd4,_0x3434d6=_0x3231c7[_0x417548(0x1a3)](_0x4b14e4=>_0x4b14e4[_0x417548(0x189)]===_0x417548(0x19e))[_0x417548(0x17d)],_0x125fe5=_0x3231c7['filter'](_0x142af7=>_0x142af7[_0x417548(0x189)]===_0x417548(0x147))[_0x417548(0x17d)],_0x562067=_0x3231c7[_0x417548(0x1a3)](_0x322c87=>_0x322c87[_0x417548(0x189)]===_0x417548(0x13c))[_0x417548(0x17d)];console[_0x417548(0x1c6)]('━'[_0x417548(0x1c9)](0x3c)),console[_0x417548(0x1c6)](_0x417548(0x1c2)),console[_0x417548(0x1c6)]('━'[_0x417548(0x1c9)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x3231c7['length']),console['log'](_0x417548(0x193)+a5_0x1d553d[_0x417548(0x19b)](_0x3434d6)),console['log'](_0x417548(0x18f)+a5_0x1d553d[_0x417548(0x165)](_0x125fe5));_0x562067>0x0&&console[_0x417548(0x1c6)](_0x417548(0x148)+a5_0x1d553d[_0x417548(0x165)](_0x562067));console['log'](_0x417548(0x183)+formatElapsed(_0x3f71e7)),console['log']('━'[_0x417548(0x1c9)](0x3c));const _0x403e26=_0x3231c7['filter'](_0x3f72cd=>_0x3f72cd['status']!==_0x417548(0x19e));if(_0x403e26[_0x417548(0x17d)]>0x0){console['log'](),console[_0x417548(0x1c6)](_0x417548(0x14c));for(const _0x8f6cb9 of _0x403e26){const _0x608665=a5_0x1d553d['red']('✗'),_0x134129=_0x8f6cb9[_0x417548(0x154)][_0x417548(0x17d)]>0x32?_0x8f6cb9[_0x417548(0x154)][_0x417548(0x1aa)](0x0,0x32)+'...':_0x8f6cb9['reason'];console[_0x417548(0x1c6)]('\x20\x20'+_0x608665+'\x20'+_0x8f6cb9[_0x417548(0x150)]+':\x20'+_0x134129);}}const _0x4b213c={'summary':{'total':_0x3231c7[_0x417548(0x17d)],'passed':_0x3434d6,'failed':_0x125fe5,'errors':_0x562067>0x0?_0x562067:undefined,'duration_ms':_0x3f71e7},'tests':_0x3231c7,'agent':{'project':_0x3720c5[_0x417548(0x184)],'name':_0x3720c5[_0x417548(0x168)],'site':_0x56167a},'timestamp':new Date(_0x3cadd4)['toISOString']()};try{const _0x1d1691=buildCachedTestRun(_0x46af1d,{'site':_0x56167a,'projectId':_0x5a48ab,'projectName':_0x3720c5['projectName'],'agentId':_0x4fe523,'agentName':_0x3720c5[_0x417548(0x168)],'testYmlPath':a5_0x5dfda6[_0x417548(0x18c)](_0x3720c5['testYmlPath'])});saveLastTestRun(_0x1d1691);}catch{}if(_0x18455a!==_0x417548(0x159)||_0x5c25e4){const _0x1baaf0=formatResults(_0x4b213c,_0x18455a);if(_0x5c25e4)try{a5_0xa4fb5d[_0x417548(0x144)](_0x5c25e4,_0x1baaf0,_0x417548(0x13b)),console['log'](),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x161)+_0x5c25e4));}catch(_0x54191e){return console['log'](),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x138)+_0x54191e)),0x1;}else console['log'](),console[_0x417548(0x1c6)](_0x1baaf0);}return _0x403e26['length']>0x0?0x1:0x0;}async[a5_0x4514ba(0x1cd)](_0x57ede6,_0x168e54){const _0x40290a=a5_0x4514ba,{options:_0xf2d922,tdx:_0x7fdb1a}=_0x57ede6,{definition:_0x2b257d,agentInfo:_0x38ef12,outputFormat:_0x39a7a5,outputFile:_0x5135c8}=_0x168e54,_0x4da138=_0xf2d922[_0x40290a(0x1a8)],_0x157cbd=loadLastTestRun();if(!_0x157cbd)return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x155))),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x13e))),0x1;if(_0x157cbd[_0x40290a(0x182)][_0x40290a(0x168)]!==_0x38ef12[_0x40290a(0x168)])return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x157cbd[_0x40290a(0x182)]['agentName']+_0x40290a(0x170)+_0x38ef12['agentName']+'\x22.')),console[_0x40290a(0x1c6)](a5_0x1d553d['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0xa254ae=new Set(_0x157cbd[_0x40290a(0x185)][_0x40290a(0x197)](_0x4dbbeb=>_0x4dbbeb[_0x40290a(0x188)])),_0x55992f=_0x2b257d[_0x40290a(0x160)][_0x40290a(0x1a3)](_0x397b83=>!_0xa254ae[_0x40290a(0x1c3)](_0x397b83[_0x40290a(0x150)]));if(_0x55992f[_0x40290a(0x17d)]>0x0&&_0x157cbd[_0x40290a(0x1a8)]!==_0x4da138)return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x145))),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x181)+_0x157cbd[_0x40290a(0x1a8)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x4da138+'\x22.')),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x149)+_0x157cbd['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x224f14=_0x2b257d['tests'][_0x40290a(0x1a3)](_0x3d992b=>_0xa254ae['has'](_0x3d992b[_0x40290a(0x150)])),_0x36390b=_0x55992f;let _0x32a2c0;try{_0x32a2c0=await setupEvaluatorAgent(_0x7fdb1a[_0x40290a(0x171)],_0xf2d922[_0x40290a(0x166)]);}catch(_0x57e8fd){const _0xfe436f=_0x57e8fd instanceof Error?_0x57e8fd[_0x40290a(0x158)]:String(_0x57e8fd);return console['log'](a5_0x1d553d['red'](_0x40290a(0x14d)+_0xfe436f)),0x1;}console[_0x40290a(0x1c6)](a5_0x1d553d['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x40290a(0x1c6)]('Cached\x20run\x20from:\x20'+a5_0x1d553d['white'](_0x157cbd[_0x40290a(0x15b)])),console[_0x40290a(0x1c6)](_0x40290a(0x139)+a5_0x1d553d[_0x40290a(0x1b9)](_0x157cbd[_0x40290a(0x182)][_0x40290a(0x184)]+'/'+_0x157cbd[_0x40290a(0x182)][_0x40290a(0x168)]));_0x36390b[_0x40290a(0x17d)]>0x0&&console[_0x40290a(0x1c6)](_0x40290a(0x173)+a5_0x1d553d[_0x40290a(0x1a5)](_0x36390b[_0x40290a(0x17d)]));console['log']();const _0x3ffa58=[],_0x1669a8=Date['now'](),_0xa1fee1=createCommandSpinner(_0x40290a(0x1ad));if(_0x224f14[_0x40290a(0x17d)]>0x0)try{const _0x2622b3=await reevaluateFromCache(_0x7fdb1a[_0x40290a(0x171)],_0x157cbd,{'tests':_0x224f14},{'evaluatorId':_0x32a2c0,'onTestStart':(_0x2fb45b,_0x502a3a,_0x2e5b99)=>{const _0xf142dc=_0x40290a;_0xa1fee1[_0xf142dc(0x16b)]=_0xf142dc(0x192)+(_0x502a3a+0x1)+'/'+_0x2e5b99+':\x20'+_0x2fb45b+'...';if(!_0xa1fee1['isSpinning'])_0xa1fee1[_0xf142dc(0x175)]();},'onTestComplete':(_0x4a5f56,_0x266f6d)=>{const _0x2c3477=_0x40290a;_0xa1fee1[_0x2c3477(0x151)]();if(_0x266f6d[_0x2c3477(0x189)]===_0x2c3477(0x19e))console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x19b)](_0x2c3477(0x137)+_0x4a5f56)+a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x1bc)));else _0x266f6d[_0x2c3477(0x189)]===_0x2c3477(0x147)?console['log'](a5_0x1d553d[_0x2c3477(0x165)](_0x2c3477(0x15c)+_0x4a5f56+_0x2c3477(0x15e)+_0x266f6d[_0x2c3477(0x154)])+a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x1bc))):console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x165)](_0x2c3477(0x194)+_0x4a5f56+_0x2c3477(0x15e)+_0x266f6d[_0x2c3477(0x154)]));_0x266f6d[_0x2c3477(0x153)]&&console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x19c)+_0x266f6d['conversation_url'])),_0x3ffa58['push'](_0x266f6d);},'onTestSkipped':(_0x3b62dc,_0x4f7b78)=>{const _0x338cf9=_0x40290a;_0xa1fee1['stop'](),console[_0x338cf9(0x1c6)](a5_0x1d553d[_0x338cf9(0x1a5)](_0x338cf9(0x1a4)+_0x3b62dc+_0x338cf9(0x15e)+_0x4f7b78));}});for(const _0x3f8b8f of _0x2622b3){!_0x3ffa58[_0x40290a(0x142)](_0x4b6ae5=>_0x4b6ae5[_0x40290a(0x150)]===_0x3f8b8f['name'])&&_0x3ffa58[_0x40290a(0x16c)](_0x3f8b8f);}}catch(_0x7032b){_0xa1fee1['stop']();const _0xc20c37=_0x7032b instanceof Error?_0x7032b[_0x40290a(0x158)]:String(_0x7032b);return console['log'](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x1af)+_0xc20c37)),0x1;}_0xa1fee1[_0x40290a(0x151)]();if(_0x36390b[_0x40290a(0x17d)]>0x0){console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x24a81b,agentId:_0x2f8c7a}=_0x157cbd[_0x40290a(0x182)];for(const _0x3812c2 of _0x36390b){console[_0x40290a(0x1c6)](_0x40290a(0x19d)+a5_0x1d553d[_0x40290a(0x1b9)](_0x3812c2[_0x40290a(0x150)]));const _0x4168ad=createCommandSpinner('Round\x201/'+_0x3812c2[_0x40290a(0x1ab)][_0x40290a(0x17d)]+':\x20Sending\x20user\x20input...');_0x4168ad[_0x40290a(0x175)]();try{const {result:_0x59506e}=await runTest(_0x7fdb1a[_0x40290a(0x171)],_0x3812c2,{'agentId':_0x2f8c7a,'projectId':_0x24a81b,'site':_0x157cbd[_0x40290a(0x1a8)],'noEval':![],'evaluatorId':_0x32a2c0,'onRoundStart':(_0x2dbfd6,_0x4538bb)=>{const _0x123d03=_0x40290a;_0x4168ad[_0x123d03(0x16b)]=_0x123d03(0x167)+(_0x2dbfd6+0x1)+'/'+_0x4538bb+_0x123d03(0x17f);},'onRoundComplete':(_0x10274a,_0x569dd9,_0x4f61c4)=>{const _0x4f1df8=_0x40290a,_0x598566=formatElapsed(_0x569dd9);_0x4f61c4?console[_0x4f1df8(0x1c6)]('\x20\x20Round\x20'+(_0x10274a+0x1)+'/'+_0x3812c2[_0x4f1df8(0x1ab)][_0x4f1df8(0x17d)]+'...\x20'+a5_0x1d553d[_0x4f1df8(0x19b)]('✓')+'\x20('+_0x598566+')'):console[_0x4f1df8(0x1c6)](_0x4f1df8(0x186)+(_0x10274a+0x1)+'/'+_0x3812c2[_0x4f1df8(0x1ab)][_0x4f1df8(0x17d)]+_0x4f1df8(0x1b6)+a5_0x1d553d[_0x4f1df8(0x165)]('✗'));},'onEvaluationStart':()=>{const _0x593ec8=_0x40290a;_0x4168ad[_0x593ec8(0x16b)]=_0x593ec8(0x16d);},'onEvaluationComplete':_0x3d4172=>{const _0x1b856a=_0x40290a,_0xbc6560=formatElapsed(_0x3d4172);console[_0x1b856a(0x1c6)](_0x1b856a(0x1c0)+a5_0x1d553d[_0x1b856a(0x19b)]('✓')+'\x20('+_0xbc6560+')');}});_0x4168ad['stop'](),_0x3ffa58[_0x40290a(0x16c)](_0x59506e);if(_0x59506e[_0x40290a(0x189)]===_0x40290a(0x19e))console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x19b)](_0x40290a(0x137)+_0x59506e['reason'])+a5_0x1d553d['dim']('\x20(new)'));else _0x59506e[_0x40290a(0x189)]===_0x40290a(0x147)?console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('✗\x20FAIL:\x20'+_0x59506e[_0x40290a(0x154)])+a5_0x1d553d[_0x40290a(0x14f)]('\x20(new)')):console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x194)+_0x59506e[_0x40290a(0x154)]));_0x59506e[_0x40290a(0x153)]&&console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x19c)+_0x59506e[_0x40290a(0x153)]));}catch(_0x338d83){_0x4168ad[_0x40290a(0x151)]();const _0x40dc60=_0x338d83 instanceof Error?_0x338d83['message']:String(_0x338d83);console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('✗\x20ERROR:\x20'+_0x40dc60)),_0x3ffa58['push']({'name':_0x3812c2[_0x40290a(0x150)],'status':_0x40290a(0x13c),'reason':_0x40dc60,'timestamp':new Date()[_0x40290a(0x17c)](),'duration_ms':0x0});}}}console['log']();const _0x5cc7c0=Date[_0x40290a(0x156)]()-_0x1669a8,_0x17f2bc=_0x3ffa58[_0x40290a(0x1a3)](_0x2f8027=>_0x2f8027[_0x40290a(0x189)]===_0x40290a(0x19e))[_0x40290a(0x17d)],_0x23efb0=_0x3ffa58[_0x40290a(0x1a3)](_0x1375ae=>_0x1375ae[_0x40290a(0x189)]===_0x40290a(0x147))[_0x40290a(0x17d)],_0x219288=_0x3ffa58['filter'](_0x5791fc=>_0x5791fc['status']===_0x40290a(0x13c))[_0x40290a(0x17d)];console[_0x40290a(0x1c6)]('━'['repeat'](0x3c)),console[_0x40290a(0x1c6)]('Re-evaluation\x20Summary'),console[_0x40290a(0x1c6)]('━'[_0x40290a(0x1c9)](0x3c)),console[_0x40290a(0x1c6)](_0x40290a(0x179)+_0x3ffa58[_0x40290a(0x17d)]),console['log']('Passed:\x20\x20\x20'+a5_0x1d553d[_0x40290a(0x19b)](_0x17f2bc)),console[_0x40290a(0x1c6)]('Failed:\x20\x20\x20'+a5_0x1d553d[_0x40290a(0x165)](_0x23efb0));_0x219288>0x0&&console[_0x40290a(0x1c6)](_0x40290a(0x148)+a5_0x1d553d[_0x40290a(0x165)](_0x219288));console['log'](_0x40290a(0x183)+formatElapsed(_0x5cc7c0)),console[_0x40290a(0x1c6)]('━'[_0x40290a(0x1c9)](0x3c));const _0x3583a9={'summary':{'total':_0x3ffa58[_0x40290a(0x17d)],'passed':_0x17f2bc,'failed':_0x23efb0,'errors':_0x219288>0x0?_0x219288:undefined,'duration_ms':_0x5cc7c0},'tests':_0x3ffa58,'agent':{'project':_0x38ef12['projectName'],'name':_0x38ef12[_0x40290a(0x168)],'site':_0x4da138},'timestamp':new Date(_0x1669a8)[_0x40290a(0x17c)]()};if(_0x39a7a5!==_0x40290a(0x159)||_0x5135c8){const _0xabb19e=formatResults(_0x3583a9,_0x39a7a5);if(_0x5135c8)try{a5_0xa4fb5d[_0x40290a(0x144)](_0x5135c8,_0xabb19e,_0x40290a(0x13b)),console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x161)+_0x5135c8));}catch(_0x28d409){return console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x138)+_0x28d409)),0x1;}else console[_0x40290a(0x1c6)](),console['log'](_0xabb19e);}const _0x57c762=_0x3ffa58[_0x40290a(0x1a3)](_0xe9327e=>_0xe9327e['status']!==_0x40290a(0x19e));return _0x57c762[_0x40290a(0x17d)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x5b6fb0=a6_0x4f19;(function(_0x72c7bb,_0x3bb951){const _0x3a7b38=a6_0x4f19,_0x3abba7=_0x72c7bb();while(!![]){try{const _0x17c87c=-parseInt(_0x3a7b38(0x1bf))/0x1*(parseInt(_0x3a7b38(0x1ab))/0x2)+parseInt(_0x3a7b38(0x1bb))/0x3*(-parseInt(_0x3a7b38(0x1df))/0x4)+-parseInt(_0x3a7b38(0x1bc))/0x5+parseInt(_0x3a7b38(0x1af))/0x6*(-parseInt(_0x3a7b38(0x1bd))/0x7)+-parseInt(_0x3a7b38(0x1b8))/0x8*(-parseInt(_0x3a7b38(0x1a8))/0x9)+-parseInt(_0x3a7b38(0x1c3))/0xa+parseInt(_0x3a7b38(0x1cc))/0xb;if(_0x17c87c===_0x3bb951)break;else _0x3abba7['push'](_0x3abba7['shift']());}catch(_0x1c8c29){_0x3abba7['push'](_0x3abba7['shift']());}}}(a6_0x3adc,0x46875));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x4f19(_0x4da496,_0x531497){_0x4da496=_0x4da496-0x19e;const _0x3adc60=a6_0x3adc();let _0x4f19e2=_0x3adc60[_0x4da496];return _0x4f19e2;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x3adc(){const _0x495ba8=['PATCH','PUT','request','x-trino-user','color','message','10277410iCnBua','\x22.\x20','GET','length','headers','.\x20Valid\x20methods:\x20','validate','log','Invalid\x20API\x20type:\x20','api','method','isArray','join','name','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','substring','startsWith','workflow','file','1121156GGXIvf','description','x-xsrf-token','proxy-authorization','entries','type','toUpperCase','\x0aStack\x20trace:\x0a','site','keys','DELETE','cookie','1634445ctBsbP','execute','Error:\x20','17764qWvXaH','body','<\x20HTTP/1.1\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','60zEycgw','verbose','trim','indexOf','x-auth-token','noColor','data','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','readBodyFromFile','24fiOFDd','.\x20Valid\x20types:\x20','Results\x20saved\x20to\x20','3mDUsyK','797825JpGRcw','14028myJwtH','includes','61hJJCLI','header','authorization','output','1885440lzkPUW','llm-proxy','error'];a6_0x3adc=function(){return _0x495ba8;};return a6_0x3adc();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5b6fb0(0x1c1),a6_0x5b6fb0(0x19f),a6_0x5b6fb0(0x1a7),'set-cookie','set-cookie2',a6_0x5b6fb0(0x19e),a6_0x5b6fb0(0x1b3),a6_0x5b6fb0(0x1c9)]);function isSensitiveHeader(_0x4986be){return SENSITIVE_HEADERS['has'](_0x4986be['toLowerCase']());}function parseHeader(_0x58019c){const _0x18f8b1=a6_0x5b6fb0,_0x1ac3e8=_0x58019c[_0x18f8b1(0x1b2)](':');if(_0x1ac3e8===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x58019c+_0x18f8b1(0x1cd)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0xb60125=_0x58019c[_0x18f8b1(0x1db)](0x0,_0x1ac3e8)[_0x18f8b1(0x1b1)](),_0x510567=_0x58019c[_0x18f8b1(0x1db)](_0x1ac3e8+0x1)[_0x18f8b1(0x1b1)]();if(!_0xb60125)throw new Error(_0x18f8b1(0x1b6)+_0x58019c+'\x22');return[_0xb60125,_0x510567];}export class ApiCommand extends BaseCommand{[a6_0x5b6fb0(0x1d9)]=a6_0x5b6fb0(0x1d5);[a6_0x5b6fb0(0x1e0)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x5b6fb0(0x1d2)](_0x5e03ea){const _0xb7e878=a6_0x5b6fb0,{args:_0x3c4187,options:_0x1064a8}=_0x5e03ea,_0x5767da=_0x1064a8;if(_0x3c4187[_0xb7e878(0x1cf)]===0x0)return _0xb7e878(0x1da);const _0x49d7a0=_0x3c4187[0x0];if(!_0x49d7a0[_0xb7e878(0x1dc)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x49d7a0;const _0xe11793=_0x5767da['data'],_0x30a7c3=_0x5767da[_0xb7e878(0x1de)];if(_0xe11793&&_0x30a7c3)return _0xb7e878(0x1ae);const _0x868d2e=_0x5767da['method']||_0xb7e878(0x1ce),_0x10afdc=[_0xb7e878(0x1ce),'POST',_0xb7e878(0x1c7),_0xb7e878(0x1a6),_0xb7e878(0x1c6)];if(!_0x10afdc[_0xb7e878(0x1be)](_0x868d2e['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x868d2e+_0xb7e878(0x1d1)+_0x10afdc[_0xb7e878(0x1d8)](',\x20');const _0x48dd8c=_0x5767da['type']||'td',_0x2ebce0=['td','cdp',_0xb7e878(0x1dd),'trino','llm',_0xb7e878(0x1c4)];if(!_0x2ebce0[_0xb7e878(0x1be)](_0x48dd8c))return _0xb7e878(0x1d4)+_0x48dd8c+_0xb7e878(0x1b9)+_0x2ebce0[_0xb7e878(0x1d8)](',\x20');return undefined;}async[a6_0x5b6fb0(0x1a9)](_0x124374){const _0x3fd139=a6_0x5b6fb0,{options:_0x11dd9d,args:_0xe7d6d1,tdx:_0x58b81d}=_0x124374,_0x1fe891=_0x11dd9d,_0x3a2271=_0xe7d6d1[0x0],_0x159c9b=(_0x1fe891[_0x3fd139(0x1d6)]||'GET')[_0x3fd139(0x1a2)](),_0x5c0d69=_0x1fe891[_0x3fd139(0x1b5)],_0x428126=_0x1fe891[_0x3fd139(0x1de)],_0x2a3c7b=_0x1fe891[_0x3fd139(0x1c0)],_0x15cdb8=_0x1fe891[_0x3fd139(0x1a1)]||'td';try{const _0x3f52d5={};if(_0x2a3c7b){const _0x1d0591=Array[_0x3fd139(0x1d7)](_0x2a3c7b)?_0x2a3c7b:[_0x2a3c7b];for(const _0x36d87b of _0x1d0591){const [_0x198d40,_0x1d26d3]=parseHeader(_0x36d87b);_0x3f52d5[_0x198d40]=_0x1d26d3;}}let _0xd933cd;if(_0x5c0d69)_0xd933cd=_0x5c0d69;else{if(_0x428126)try{_0xd933cd=RawAPI[_0x3fd139(0x1b7)](_0x428126);}catch(_0x240793){return console[_0x3fd139(0x1c5)](_0x3fd139(0x1aa)+(_0x240793 instanceof Error?_0x240793[_0x3fd139(0x1cb)]:String(_0x240793))),0x1;}}const _0x576ef0={'method':_0x159c9b,'apiType':_0x15cdb8,'includeHeaders':_0x11dd9d[_0x3fd139(0x1b0)]};_0xd933cd&&(_0x576ef0[_0x3fd139(0x1ac)]=_0xd933cd);Object[_0x3fd139(0x1a5)](_0x3f52d5)['length']>0x0&&(_0x576ef0['headers']=_0x3f52d5);if(_0x11dd9d[_0x3fd139(0x1b0)]){const _0x376f23=resolveSite(_0x11dd9d[_0x3fd139(0x1a4)]),_0x250b91=getEndpoint(_0x376f23,_0x15cdb8),_0x1a6c42=''+_0x250b91+_0x3a2271;console[_0x3fd139(0x1c5)]('>\x20'+_0x159c9b+'\x20'+_0x1a6c42);const _0x11fcb8=getAuthHeaders(_0x376f23),_0x9ec28a={..._0x11fcb8,..._0x3f52d5};for(const [_0x335484,_0x2424e5]of Object[_0x3fd139(0x1a0)](_0x9ec28a)){!isSensitiveHeader(_0x335484)&&console[_0x3fd139(0x1c5)]('>\x20'+_0x335484+':\x20'+_0x2424e5);}_0xd933cd&&console[_0x3fd139(0x1c5)]('>'),console['error']('');}const _0x4e809a=await _0x58b81d[_0x3fd139(0x1d5)][_0x3fd139(0x1c8)](_0x3a2271,_0x576ef0);if(_0x11dd9d[_0x3fd139(0x1b0)]&&_0x4e809a[_0x3fd139(0x1d0)]){console[_0x3fd139(0x1c5)](_0x3fd139(0x1ad)+_0x4e809a['status']);for(const [_0x3c9c05,_0x5ed11e]of Object[_0x3fd139(0x1a0)](_0x4e809a[_0x3fd139(0x1d0)])){!isSensitiveHeader(_0x3c9c05)&&console[_0x3fd139(0x1c5)]('<\x20'+_0x3c9c05+':\x20'+_0x5ed11e);}console[_0x3fd139(0x1c5)]('');}const _0x3ab828=Boolean(_0x11dd9d[_0x3fd139(0x1c2)]),_0x3969c1={'color':_0x11dd9d['color'],'noColor':_0x11dd9d[_0x3fd139(0x1b4)]||_0x3ab828&&!_0x11dd9d[_0x3fd139(0x1ca)]},_0x5ac4ee=colorizeJSON(_0x4e809a['data'],_0x3969c1);return _0x11dd9d[_0x3fd139(0x1c2)]?(writeFileSync(_0x11dd9d['output'],_0x5ac4ee),console[_0x3fd139(0x1c5)](_0x3fd139(0x1ba)+_0x11dd9d[_0x3fd139(0x1c2)])):console[_0x3fd139(0x1d3)](_0x5ac4ee),0x0;}catch(_0x3b87de){return _0x3b87de instanceof Error?(console[_0x3fd139(0x1c5)](_0x3fd139(0x1aa)+_0x3b87de[_0x3fd139(0x1cb)]),_0x11dd9d[_0x3fd139(0x1b0)]&&_0x3b87de['stack']&&console['error'](_0x3fd139(0x1a3)+_0x3b87de['stack'])):console['error'](_0x3fd139(0x1aa)+String(_0x3b87de)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x5e6974=a7_0x6009;(function(_0x53535d,_0x4989e5){const _0x38ac7b=a7_0x6009,_0x57b328=_0x53535d();while(!![]){try{const _0x5bb190=parseInt(_0x38ac7b(0x134))/0x1*(parseInt(_0x38ac7b(0x155))/0x2)+-parseInt(_0x38ac7b(0x14d))/0x3+parseInt(_0x38ac7b(0x15f))/0x4*(parseInt(_0x38ac7b(0x140))/0x5)+parseInt(_0x38ac7b(0x172))/0x6+parseInt(_0x38ac7b(0x146))/0x7+-parseInt(_0x38ac7b(0x13f))/0x8*(parseInt(_0x38ac7b(0x165))/0x9)+-parseInt(_0x38ac7b(0x15b))/0xa*(parseInt(_0x38ac7b(0x16d))/0xb);if(_0x5bb190===_0x4989e5)break;else _0x57b328['push'](_0x57b328['shift']());}catch(_0x579e78){_0x57b328['push'](_0x57b328['shift']());}}}(a7_0x1d6f,0x60ac0));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x1d6f(){const _0x2200de=['\x20--profile\x20','password','198FlcmOh','Name:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','profile','Site\x20name\x20cannot\x20be\x20empty','701958ROintb','name','Read\x20credential\x20from\x20','warn','/app/mp/ak','error','message','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','customSite','description','Setup\x20API\x20key\x20authentication\x20interactively','email','\x20(profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','tdx:\x20auth\x20setup','create','API\x20key\x20cannot\x20be\x20empty','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','site','277SrUnZc','\x20for\x20profile:\x20','\x0aSetup\x20cancelled','tdx\x20profile:\x20','green','No\x20credential\x20found','\x27\x20registered','N/A','apiKey','red','last_name','9592GHMOeh','30435RutktQ','other','Enter\x20your\x20TD\x20API\x20key:','trim','auth:clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','4145190xaacYc','status','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','log','User:\x20','✓\x20Default\x20site\x20set\x20to\x20','first_name','1487514PVgRNi','tdx:\x20auth\x20clear','bold','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✗\x20Validation\x20failed:\x20','Select\x20your\x20Treasure\x20Data\x20site:','No\x20API\x20key\x20found\x20in\x20keychain','yellow','1832alFSph','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','getUserInfo','auth','✓\x20Authentication\x20successful\x0a','Enter\x20site\x20name:','198320YlKOls','test','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','492iPklSK','✓\x20Profile\x20\x27','Setting\x20up\x20authentication\x20for\x20site:\x20','join','execute','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','3474QXoYGU','text','logLevel','\x20(site:\x20','select','us01'];a7_0x1d6f=function(){return _0x2200de;};return a7_0x1d6f();}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_0x36091f 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_0xf81f00 from'chalk';function a7_0x6009(_0x4b8089,_0x15b02b){_0x4b8089=_0x4b8089-0x125;const _0x1d6f73=a7_0x1d6f();let _0x600986=_0x1d6f73[_0x4b8089];return _0x600986;}export class AuthSetupCommand extends BaseCommand{[a7_0x5e6974(0x173)]='auth:setup';[a7_0x5e6974(0x12a)]=a7_0x5e6974(0x12b);async[a7_0x5e6974(0x163)](_0xc89252){const _0x1dbd6f=a7_0x5e6974,{options:_0x303fbe}=_0xc89252,_0x5a5d37=_0x303fbe['profile'];console[_0x1dbd6f(0x149)](a7_0xf81f00[_0x1dbd6f(0x14f)](_0x1dbd6f(0x12f)));const _0x5a514a=_0x303fbe[_0x1dbd6f(0x133)]||_0x1dbd6f(0x16a),{choices:_0x370de7,initialIndex:_0x5af016}=buildSiteChoices(_0x5a514a),_0x1bcb99=_0x5a5d37?_0x1dbd6f(0x148)+_0x5a5d37+'):':_0x1dbd6f(0x152),_0xb559e6=await a7_0x36091f({'type':_0x1dbd6f(0x169),'name':_0x1dbd6f(0x133),'message':_0x1bcb99,'choices':_0x370de7,'initial':_0x5af016});if(!_0xb559e6[_0x1dbd6f(0x133)])return console[_0x1dbd6f(0x149)](_0x1dbd6f(0x136)),0x1;let _0x140006;if(_0xb559e6[_0x1dbd6f(0x133)]===_0x1dbd6f(0x141)){const _0x17c6c3=await a7_0x36091f({'type':_0x1dbd6f(0x166),'name':'customSite','message':_0x1dbd6f(0x15a),'initial':_0x1dbd6f(0x16a),'validate':_0x1d9fe2=>{const _0x444114=_0x1dbd6f;if(!_0x1d9fe2||!_0x1d9fe2[_0x444114(0x143)]())return _0x444114(0x171);if(!/^[a-z0-9-]+$/[_0x444114(0x15c)](_0x1d9fe2['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x17c6c3[_0x1dbd6f(0x129)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x140006=_0x17c6c3[_0x1dbd6f(0x129)];}else _0x140006=_0xb559e6[_0x1dbd6f(0x133)];const _0x2153dd=resolveSite(_0x140006);console[_0x1dbd6f(0x149)](_0x1dbd6f(0x161)+_0x2153dd),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x12e)),console[_0x1dbd6f(0x149)]('\x20\x20'+getConsoleUrl(_0x2153dd,_0x1dbd6f(0x176)));const _0x36953a=await a7_0x36091f({'type':_0x1dbd6f(0x16c),'name':'apiKey','message':_0x1dbd6f(0x142),'validate':_0x7e41e3=>{const _0x346d4c=_0x1dbd6f;if(!_0x7e41e3||!_0x7e41e3[_0x346d4c(0x143)]())return _0x346d4c(0x131);return!![];}});if(!_0x36953a[_0x1dbd6f(0x13c)])return console['log'](_0x1dbd6f(0x136)),0x1;const _0x255799=_0x36953a[_0x1dbd6f(0x13c)];console[_0x1dbd6f(0x149)]('Validating\x20API\x20key...');try{const _0x44235d=TDX[_0x1dbd6f(0x130)]({'site':_0x2153dd,'apiKey':_0x255799[_0x1dbd6f(0x143)](),'logLevel':_0x303fbe[_0x1dbd6f(0x167)]??LogLevel['ERROR']}),_0x5dba9a=await _0x44235d['jobs'][_0x1dbd6f(0x157)]();console[_0x1dbd6f(0x149)](_0x1dbd6f(0x15e)+_0x5dba9a[_0x1dbd6f(0x12c)]+')');const _0x252a7f=await isKeychainAvailable();_0x252a7f?(await saveAPIKeyAsync(_0x255799[_0x1dbd6f(0x143)](),_0x2153dd,_0x5a5d37),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x164)+(_0x5a5d37?_0x1dbd6f(0x12d)+_0x5a5d37+')':''))):(console[_0x1dbd6f(0x175)](a7_0xf81f00[_0x1dbd6f(0x154)](_0x1dbd6f(0x15d))),console[_0x1dbd6f(0x175)](a7_0xf81f00['yellow'](_0x1dbd6f(0x156))));if(_0x5a5d37){const _0x4f7e6e={'site':_0x2153dd};saveProfileToUserConfig(_0x5a5d37,_0x4f7e6e),console['log'](_0x1dbd6f(0x160)+_0x5a5d37+_0x1dbd6f(0x13a));}else saveDefaultSiteToUserConfig(_0x2153dd),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x14b)+_0x2153dd);const _0x371377=_0x5a5d37?_0x1dbd6f(0x16b)+_0x5a5d37:'';return console[_0x1dbd6f(0x149)](),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x16f)),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x128)+_0x371377+_0x1dbd6f(0x127)),console[_0x1dbd6f(0x149)]('\x20\x20tdx'+_0x371377+_0x1dbd6f(0x132)),0x0;}catch(_0x22ff21){if(_0x22ff21 instanceof HTTPClientError&&_0x22ff21[_0x1dbd6f(0x147)]===0x191)return printAuthError(_0x22ff21),0x1;return console[_0x1dbd6f(0x125)](a7_0xf81f00[_0x1dbd6f(0x13d)](_0x1dbd6f(0x151)+(_0x22ff21 instanceof Error?_0x22ff21[_0x1dbd6f(0x126)]:String(_0x22ff21)))),console[_0x1dbd6f(0x125)](_0x1dbd6f(0x150)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x5e6974(0x158);[a7_0x5e6974(0x12a)]=a7_0x5e6974(0x145);async['execute'](_0x103f83){const _0x507da6=a7_0x5e6974,{options:_0x328593,tdx:_0x417718}=_0x103f83,_0x4d4af8=_0x328593[_0x507da6(0x133)],_0x46a537=_0x328593[_0x507da6(0x170)],_0x3d84d4=_0x46a537?_0x46a537:_0x507da6(0x13b);console['log'](_0x507da6(0x137)+_0x3d84d4+_0x507da6(0x168)+_0x4d4af8+')');const _0x38b0df=await resolveAPIKeyAsync(_0x4d4af8,_0x46a537);if(_0x38b0df){const {source:_0xbb8f45,isDeprecated:_0x1e589}=_0x38b0df,_0xe5e171=_0x507da6(0x174)+_0xbb8f45;console[_0x507da6(0x149)](_0x1e589?a7_0xf81f00[_0x507da6(0x154)](_0xe5e171):_0xe5e171);}else console[_0x507da6(0x149)](a7_0xf81f00[_0x507da6(0x154)](_0x507da6(0x139)));try{const _0xbf9d76=await _0x417718['jobs']['getUserInfo']();return console[_0x507da6(0x149)](a7_0xf81f00[_0x507da6(0x138)](_0x507da6(0x159))),console[_0x507da6(0x149)](_0x507da6(0x14a)+_0xbf9d76['email']),(_0xbf9d76[_0x507da6(0x14c)]||_0xbf9d76[_0x507da6(0x13e)])&&console['log'](_0x507da6(0x16e)+[_0xbf9d76[_0x507da6(0x14c)],_0xbf9d76['last_name']]['filter'](Boolean)[_0x507da6(0x162)]('\x20')),0x0;}catch(_0x5fca6e){return _0x5fca6e instanceof HTTPClientError&&_0x5fca6e[_0x507da6(0x147)]===0x191?printAuthError(_0x5fca6e,!![],_0x46a537):console[_0x507da6(0x125)](a7_0xf81f00['red'](_0x507da6(0x151)+(_0x5fca6e instanceof Error?_0x5fca6e[_0x507da6(0x126)]:String(_0x5fca6e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x5e6974(0x173)]=a7_0x5e6974(0x144);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x1213a4){const _0x39a932=a7_0x5e6974,{options:_0x14159b}=_0x1213a4,_0x4f8908=_0x14159b[_0x39a932(0x170)];console['log'](a7_0xf81f00[_0x39a932(0x14f)](_0x39a932(0x14e)));const _0x3ebfbe=await isKeychainAvailable();if(!_0x3ebfbe)return console[_0x39a932(0x125)](a7_0xf81f00[_0x39a932(0x13d)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x5ebcc7=await deleteKeychainAPIKey(_0x4f8908);return _0x5ebcc7?(clearCredentialCache(),console[_0x39a932(0x149)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x4f8908?_0x39a932(0x12d)+_0x4f8908+')':'')),0x0):(console['log'](_0x39a932(0x153)+(_0x4f8908?_0x39a932(0x135)+_0x4f8908:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x4b577a=a8_0x3aa3;function a8_0x38ab(){const _0x482491=['type','options','claude-4.5-haiku','chatId','targetKnowledgeBase','15327TbJbfl','stream','write','\x27\x20not\x20found','includes','Resolving\x20project\x20\x27','agent','tool_call','Using\x20agent\x20from\x20','Getting\x20default\x20agent...','metadata','site','llmProject','Resolving\x20agent\x20\x27','\x27...','session\x20context','cause','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','verbose','llm','functionName','tool','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','getDefaultAgent','execute','args','2014592TKIeQY','streamChat','chat-create','content','handleChatEvent','4324416ItsIcT','stringify','chat','targetAgent','\x0aStack\x20trace:','712WpWLtT','name','validate','resolveProjectId','error','getOrCreateDefaultAgent','message','tool_result','event','description','streamChatJsonl','stack','startChat','stdout','3135774baIoSU','5186235kPNTSK','slice','404','join','code','agentId','1LrZueu','4183683YKdJNj','new','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','log','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','CHAT_NOT_FOUND','Continuing\x20chat:\x20','--agent\x20flag','Using\x20cached\x20default\x20agent:\x20','241426BbLzOs','context','targetWebSearchTool','data'];a8_0x38ab=function(){return _0x482491;};return a8_0x38ab();}(function(_0xca8a0d,_0x203661){const _0x4ebef1=a8_0x3aa3,_0x1fdda7=_0xca8a0d();while(!![]){try{const _0x290862=parseInt(_0x4ebef1(0xfc))/0x1*(parseInt(_0x4ebef1(0x106))/0x2)+-parseInt(_0x4ebef1(0xf5))/0x3+parseInt(_0x4ebef1(0x129))/0x4+parseInt(_0x4ebef1(0xf6))/0x5+-parseInt(_0x4ebef1(0x12e))/0x6+parseInt(_0x4ebef1(0xfd))/0x7+-parseInt(_0x4ebef1(0x133))/0x8*(-parseInt(_0x4ebef1(0x10f))/0x9);if(_0x290862===_0x203661)break;else _0x1fdda7['push'](_0x1fdda7['shift']());}catch(_0x29b567){_0x1fdda7['push'](_0x1fdda7['shift']());}}}(a8_0x38ab,0x9d6f2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x456b96,_0x475816){const _0x424fe2=a8_0x3aa3;if(_0x456b96 instanceof SDKError)console[_0x424fe2(0x137)]('Error:\x20'+_0x456b96['message']),_0x475816[_0x424fe2(0x121)]&&(_0x456b96[_0x424fe2(0x11f)]&&console[_0x424fe2(0x137)]('\x20\x20Cause:\x20'+_0x456b96[_0x424fe2(0x11f)]),_0x456b96[_0x424fe2(0x13e)]&&(console['error'](_0x424fe2(0x132)),console['error'](_0x456b96[_0x424fe2(0x13e)])));else throw _0x456b96;}async function resolveAgentId(_0x2b9bb1,_0x79d054,_0x3036a6,_0x788e97,_0x2bf201){const _0x5901e4=a8_0x3aa3,_0x3c8460=_0x79d054||_0x3036a6;if(_0x3c8460){const {projectName:_0x1179aa,agentName:_0x1ac67b}=parseAgentRef(_0x3c8460),_0x464c14=_0x1ac67b||_0x3c8460,_0x4e15bd=_0x1ac67b?_0x1179aa:_0x788e97;if(!_0x4e15bd)throw new Error(_0x5901e4(0x125));if(_0x2bf201){const _0x521067=_0x79d054?_0x5901e4(0x104):_0x5901e4(0x11e);console[_0x5901e4(0x137)](_0x5901e4(0x117)+_0x521067+':\x20'+_0x4e15bd+'/'+_0x464c14);}const _0x1b9e68=await withSpinner(_0x5901e4(0x114)+_0x4e15bd+'\x27...',()=>_0x2b9bb1['llm'][_0x5901e4(0x136)](_0x4e15bd),{'verbose':_0x2bf201}),_0x22bd3f=await withSpinner(_0x5901e4(0x11c)+_0x464c14+_0x5901e4(0x11d),()=>_0x2b9bb1[_0x5901e4(0x122)]['resolveAgentId'](_0x464c14,_0x1b9e68[_0x5901e4(0x109)]),{'verbose':_0x2bf201});return _0x22bd3f[_0x5901e4(0x109)];}else{const _0x276d45=_0x2b9bb1[_0x5901e4(0x122)][_0x5901e4(0x126)]();if(_0x276d45)return _0x2bf201&&console['error'](_0x5901e4(0x105)+_0x276d45[_0x5901e4(0x134)]),_0x276d45['id'];const _0x1648d4=await withSpinner(_0x5901e4(0x118),()=>_0x2b9bb1[_0x5901e4(0x122)][_0x5901e4(0x138)](_0x5901e4(0x10c),0x0),{'verbose':_0x2bf201});return _0x1648d4[_0x5901e4(0x109)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x4b577a(0x130);[a8_0x4b577a(0x13c)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x4b577a(0x135)](_0x4ad91){const _0x3b043a=a8_0x4b577a,_0x5e648e=_0x4ad91[_0x3b043a(0x128)][_0x3b043a(0xf9)]('\x20');if(!_0x5e648e)return _0x3b043a(0x120);return undefined;}async['streamChat'](_0x30d8fe,_0xcd60e5,_0x5a5d93,_0x467d43,_0x380ccb){const _0x322f72=a8_0x4b577a;for await(const _0x374adf of _0x30d8fe[_0x322f72(0x122)][_0x322f72(0x130)](_0xcd60e5,{'agentId':_0x5a5d93,'chatId':_0x467d43})){if(_0x374adf[_0x322f72(0x10a)]===_0x322f72(0x119)){const _0x151659=_0x374adf['data'][_0x322f72(0x10d)];saveLastChatId(_0x151659),_0x380ccb&&console['error']('Chat\x20session:\x20'+_0x151659);}else _0x374adf[_0x322f72(0x10a)]===_0x322f72(0x13b)&&this[_0x322f72(0x12d)](_0x374adf[_0x322f72(0x109)]);}}async[a8_0x4b577a(0x13d)](_0x44d02f,_0xb5d70f,_0x574cc9,_0x2c50d7){const _0x1ffd44=a8_0x4b577a,_0x1a7bb8=_0x44d02f[_0x1ffd44(0x107)][_0x1ffd44(0x11a)];let _0x124d00=![];for await(const _0x329c18 of _0x44d02f[_0x1ffd44(0x122)][_0x1ffd44(0x130)](_0xb5d70f,{'agentId':_0x574cc9,'chatId':_0x2c50d7})){if(_0x329c18[_0x1ffd44(0x10a)]==='metadata'){const _0x54f670=_0x329c18[_0x1ffd44(0x109)];saveLastChatId(_0x54f670[_0x1ffd44(0x10d)]);const _0x195bff=_0x54f670['projectId']&&_0x54f670[_0x1ffd44(0xfb)]?getLLMConversationUrl(_0x1a7bb8,_0x54f670['projectId'],_0x54f670[_0x1ffd44(0xfb)],_0x54f670[_0x1ffd44(0x10d)]):undefined;console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x119),'data':{'chatId':_0x54f670[_0x1ffd44(0x10d)],'agentId':_0x54f670[_0x1ffd44(0xfb)],'consoleUrl':_0x195bff}})),_0x124d00=!![];}else{if(_0x329c18[_0x1ffd44(0x10a)]===_0x1ffd44(0x13b)){!_0x124d00&&_0x2c50d7&&(console['log'](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x119),'data':{'chatId':_0x2c50d7}})),_0x124d00=!![]);const _0x5aaf2b=_0x329c18[_0x1ffd44(0x109)];if('content'in _0x5aaf2b)console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x12c),'data':{'content':_0x5aaf2b['content']}}));else{if('tool_call'in _0x5aaf2b){const _0x524549=_0x5aaf2b['tool_call'];console['log'](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x116),'data':{'id':_0x524549['id'],'name':_0x524549['functionName'],'target':_0x524549[_0x1ffd44(0x10e)]?.[_0x1ffd44(0x134)]||_0x524549[_0x1ffd44(0x131)]?.[_0x1ffd44(0x134)]||_0x524549[_0x1ffd44(0x108)]?.[_0x1ffd44(0x134)]||_0x524549['targetFunction']}}));}else{if(_0x1ffd44(0x124)in _0x5aaf2b)console[_0x1ffd44(0x100)](JSON['stringify']({'type':_0x1ffd44(0x13a),'data':{'id':_0x5aaf2b[_0x1ffd44(0x124)]['id'],'name':_0x5aaf2b['tool'][_0x1ffd44(0x123)],'result':typeof _0x5aaf2b[_0x1ffd44(0x124)][_0x1ffd44(0x12c)]==='string'?_0x5aaf2b[_0x1ffd44(0x124)]['content'][_0x1ffd44(0xf7)](0x0,0x1f4):''}}));else _0x1ffd44(0x137)in _0x5aaf2b&&console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x137),'data':{'error':_0x5aaf2b[_0x1ffd44(0x137)]}}));}}}}}console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':'done'}));}async[a8_0x4b577a(0x127)](_0x44334d){const _0xcb5722=a8_0x4b577a,{options:_0x4ec68c,args:_0x211e1e,tdx:_0x18cda0}=_0x44334d,_0x3b6cab=_0x211e1e[_0xcb5722(0xf9)]('\x20'),_0x44d502=_0x4ec68c,_0x4869f2=_0x44d502[_0xcb5722(0x115)],_0x434e11=_0x44d502['llmAgent'],_0x10c425=_0x44d502['llmProject'],_0x376302=_0x44d502[_0xcb5722(0xfe)],_0x410267=_0x44d502['chatId'],_0xf3b19c=_0x44d502[_0xcb5722(0x110)];if(_0x376302&&_0x410267)return console[_0xcb5722(0x137)](_0xcb5722(0x101)),0x1;try{let _0x4d15cb,_0x174459;if(_0x410267)_0x174459=_0x410267;else!_0x376302&&(_0x174459=loadLastChatId(),_0x174459&&_0x4ec68c[_0xcb5722(0x121)]&&console[_0xcb5722(0x137)](_0xcb5722(0x103)+_0x174459));!_0x410267&&(_0x376302||!_0x174459)&&(_0x4d15cb=await resolveAgentId(_0x18cda0,_0x4869f2,_0x434e11,_0x10c425,_0x4ec68c['verbose']));const _0x1a91bd=_0xf3b19c?(_0x4a7d39,_0x4f77b8,_0x1a536c)=>this[_0xcb5722(0x13d)](_0x18cda0,_0x4a7d39,_0x4f77b8,_0x1a536c):(_0x5c3818,_0x4321a6,_0x5d2244)=>this[_0xcb5722(0x12a)](_0x18cda0,_0x5c3818,_0x4321a6,_0x5d2244,_0x4ec68c[_0xcb5722(0x121)]);try{await _0x1a91bd(_0x3b6cab,_0x4d15cb,_0x174459);}catch(_0x139101){const _0x5841c0=_0x139101 instanceof SDKError&&_0x139101[_0xcb5722(0xfa)]===ErrorCode[_0xcb5722(0x102)]||_0x139101 instanceof Error&&_0x139101[_0xcb5722(0x139)][_0xcb5722(0x113)](_0xcb5722(0xf8));if(_0x5841c0&&_0x410267)return console[_0xcb5722(0x137)]('Error:\x20Chat\x20session\x20\x27'+_0x410267+_0xcb5722(0x112)),0x1;if(_0x5841c0)_0x4ec68c[_0xcb5722(0x121)]&&console['error'](_0xcb5722(0xff)),!_0x4d15cb&&(_0x4d15cb=await resolveAgentId(_0x18cda0,_0x4869f2,_0x434e11,_0x10c425,_0x4ec68c['verbose'])),await _0x1a91bd(_0x3b6cab,_0x4d15cb,undefined);else throw _0x139101;}return!_0xf3b19c&&console[_0xcb5722(0x100)](),0x0;}catch(_0x2609ea){return console[_0xcb5722(0x137)](),handleSDKError(_0x2609ea,_0x4ec68c),0x1;}}[a8_0x4b577a(0x12d)](_0x49d07f){const _0x36cde4=a8_0x4b577a;if('content'in _0x49d07f)process[_0x36cde4(0xf4)][_0x36cde4(0x111)](_0x49d07f[_0x36cde4(0x12c)]);else _0x36cde4(0x137)in _0x49d07f&&console[_0x36cde4(0x137)]('\x0aError:\x20'+_0x49d07f[_0x36cde4(0x137)]);}}function a8_0x3aa3(_0xa2d555,_0x14306f){_0xa2d555=_0xa2d555-0xf3;const _0x38ab12=a8_0x38ab();let _0x3aa319=_0x38ab12[_0xa2d555];return _0x3aa319;}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x4b577a(0x12b);['description']='Create\x20a\x20new\x20chat\x20session';['validate'](_0x1f20ed){const _0xd271b3=a8_0x4b577a,_0x5bfd8a=_0x1f20ed[_0xd271b3(0x10b)],_0x3495e7=_0x5bfd8a[_0xd271b3(0x115)],_0x4ac7a0=_0x5bfd8a['llmAgent'];if(!_0x3495e7&&!_0x4ac7a0)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x4b577a(0x127)](_0x292ea8){const _0x439910=a8_0x4b577a,{options:_0xdf1d1d,tdx:_0x38edbd}=_0x292ea8,_0x120261=_0xdf1d1d,_0x11d472=_0x120261[_0x439910(0x115)],_0xfb74b9=_0x120261['llmAgent'],_0x1c497f=_0x120261[_0x439910(0x11b)];try{const _0x29fd04=await resolveAgentId(_0x38edbd,_0x11d472,_0xfb74b9,_0x1c497f,_0xdf1d1d['verbose']),_0x2b7fa6=await _0x38edbd[_0x439910(0x122)][_0x439910(0xf3)](_0x29fd04);return saveLastChatId(_0x2b7fa6['id']),console[_0x439910(0x100)](JSON[_0x439910(0x12f)]({'chatId':_0x2b7fa6['id'],'agentId':_0x29fd04})),0x0;}catch(_0x162d6a){return handleSDKError(_0x162d6a,_0xdf1d1d),0x1;}}}
|
|
1
|
+
function a8_0x4d56(){const _0xd0c25b=['session\x20context','1796uUaPAH','args','metadata','916792UwLJCc','verbose','llm','projectId','\x20\x20Cause:\x20','targetAgent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Getting\x20default\x20agent...','cause','stringify','description','site','2787955rPuDog','error','handleChatEvent','tool_result','\x27\x20not\x20found','options','Resolving\x20project\x20\x27','404','tool_call','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Error:\x20','Error:\x20Chat\x20session\x20\x27','chat','event','context','6096231abGulR','getOrCreateDefaultAgent','startChat','Continuing\x20chat:\x20','8522502uVZQeB','6236ZVgrAh','agent','targetKnowledgeBase','targetWebSearchTool','llmAgent','20rLsYks','stream','511TPDyoW','slice','join','Chat\x20session:\x20','stack','Resolving\x20agent\x20\x27','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','stdout','10618580PgzxVb','code','message','3336UtULGn','content','log','tool','name','chatId','llmProject','functionName','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','claude-4.5-haiku','string','type','resolveAgentId','\x0aError:\x20','getDefaultAgent','new','includes','chat-create','\x27...','agentId','CHAT_NOT_FOUND','streamChat','data','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','resolveProjectId','\x0aStack\x20trace:'];a8_0x4d56=function(){return _0xd0c25b;};return a8_0x4d56();}const a8_0x4d893e=a8_0x187f;(function(_0xb0261,_0xc5d543){const _0xe38adc=a8_0x187f,_0x519e72=_0xb0261();while(!![]){try{const _0x56233a=parseInt(_0xe38adc(0xd9))/0x1*(-parseInt(_0xe38adc(0xd2))/0x2)+-parseInt(_0xe38adc(0x94))/0x3*(-parseInt(_0xe38adc(0xaf))/0x4)+parseInt(_0xe38adc(0xbe))/0x5+-parseInt(_0xe38adc(0xd1))/0x6+parseInt(_0xe38adc(0x91))/0x7+-parseInt(_0xe38adc(0xb2))/0x8+-parseInt(_0xe38adc(0xcd))/0x9*(-parseInt(_0xe38adc(0xd7))/0xa);if(_0x56233a===_0xc5d543)break;else _0x519e72['push'](_0x519e72['shift']());}catch(_0x37e8c5){_0x519e72['push'](_0x519e72['shift']());}}}(a8_0x4d56,0xc35df));function a8_0x187f(_0x3863d0,_0x4bbd51){_0x3863d0=_0x3863d0-0x8c;const _0x4d5657=a8_0x4d56();let _0x187fe9=_0x4d5657[_0x3863d0];return _0x187fe9;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x58e23e,_0x22d427){const _0x8fd1a1=a8_0x187f;if(_0x58e23e instanceof SDKError)console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xc8)+_0x58e23e[_0x8fd1a1(0x93)]),_0x22d427[_0x8fd1a1(0xb3)]&&(_0x58e23e['cause']&&console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xb6)+_0x58e23e[_0x8fd1a1(0xba)]),_0x58e23e[_0x8fd1a1(0x8d)]&&(console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xad)),console[_0x8fd1a1(0xbf)](_0x58e23e[_0x8fd1a1(0x8d)])));else throw _0x58e23e;}async function resolveAgentId(_0x50a952,_0x43ffd2,_0x4cdaf7,_0x3977f4,_0x5bc794){const _0x5b2dcf=a8_0x187f,_0x49a881=_0x43ffd2||_0x4cdaf7;if(_0x49a881){const {projectName:_0x34855a,agentName:_0x98a7}=parseAgentRef(_0x49a881),_0x51bd9a=_0x98a7||_0x49a881,_0x280fc3=_0x98a7?_0x34855a:_0x3977f4;if(!_0x280fc3)throw new Error(_0x5b2dcf(0xab));if(_0x5bc794){const _0x2f6e1c=_0x43ffd2?'--agent\x20flag':_0x5b2dcf(0xae);console['error']('Using\x20agent\x20from\x20'+_0x2f6e1c+':\x20'+_0x280fc3+'/'+_0x51bd9a);}const _0x53090e=await withSpinner(_0x5b2dcf(0xc4)+_0x280fc3+_0x5b2dcf(0xa6),()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xac)](_0x280fc3),{'verbose':_0x5bc794}),_0x1a2741=await withSpinner(_0x5b2dcf(0x8e)+_0x51bd9a+'\x27...',()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xa0)](_0x51bd9a,_0x53090e['data']),{'verbose':_0x5bc794});return _0x1a2741[_0x5b2dcf(0xaa)];}else{const _0xb7e128=_0x50a952['llm'][_0x5b2dcf(0xa2)]();if(_0xb7e128)return _0x5bc794&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0xb7e128[_0x5b2dcf(0x98)]),_0xb7e128['id'];const _0xa292b1=await withSpinner(_0x5b2dcf(0xb9),()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xce)](_0x5b2dcf(0x9d),0x0),{'verbose':_0x5bc794});return _0xa292b1[_0x5b2dcf(0xaa)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4d893e(0x98)]=a8_0x4d893e(0xca);[a8_0x4d893e(0xbc)]=a8_0x4d893e(0x9c);['validate'](_0x2d0624){const _0x4d7a49=a8_0x4d893e,_0x18075a=_0x2d0624[_0x4d7a49(0xb0)][_0x4d7a49(0xdb)]('\x20');if(!_0x18075a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x4d55e3,_0x3bfd12,_0x43618b,_0x18d0d8,_0x1045a8){const _0x2f09f8=a8_0x4d893e;for await(const _0x1af17b of _0x4d55e3[_0x2f09f8(0xb4)]['chat'](_0x3bfd12,{'agentId':_0x43618b,'chatId':_0x18d0d8})){if(_0x1af17b[_0x2f09f8(0x9f)]===_0x2f09f8(0xb1)){const _0x2e0bdf=_0x1af17b[_0x2f09f8(0xaa)][_0x2f09f8(0x99)];saveLastChatId(_0x2e0bdf),_0x1045a8&&console[_0x2f09f8(0xbf)](_0x2f09f8(0x8c)+_0x2e0bdf);}else _0x1af17b[_0x2f09f8(0x9f)]===_0x2f09f8(0xcb)&&this['handleChatEvent'](_0x1af17b[_0x2f09f8(0xaa)]);}}async['streamChatJsonl'](_0x244ab2,_0x147baf,_0x14fc87,_0xf8a36d){const _0xb5b196=a8_0x4d893e,_0x1807a6=_0x244ab2[_0xb5b196(0xcc)][_0xb5b196(0xbd)];let _0x4d48a1=![];for await(const _0x4067d5 of _0x244ab2[_0xb5b196(0xb4)][_0xb5b196(0xca)](_0x147baf,{'agentId':_0x14fc87,'chatId':_0xf8a36d})){if(_0x4067d5[_0xb5b196(0x9f)]===_0xb5b196(0xb1)){const _0x29bec7=_0x4067d5[_0xb5b196(0xaa)];saveLastChatId(_0x29bec7[_0xb5b196(0x99)]);const _0x3f45b8=_0x29bec7[_0xb5b196(0xb5)]&&_0x29bec7[_0xb5b196(0xa7)]?getLLMConversationUrl(_0x1807a6,_0x29bec7['projectId'],_0x29bec7[_0xb5b196(0xa7)],_0x29bec7[_0xb5b196(0x99)]):undefined;console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xb1),'data':{'chatId':_0x29bec7['chatId'],'agentId':_0x29bec7[_0xb5b196(0xa7)],'consoleUrl':_0x3f45b8}})),_0x4d48a1=!![];}else{if(_0x4067d5['type']===_0xb5b196(0xcb)){!_0x4d48a1&&_0xf8a36d&&(console[_0xb5b196(0x96)](JSON['stringify']({'type':_0xb5b196(0xb1),'data':{'chatId':_0xf8a36d}})),_0x4d48a1=!![]);const _0xb35869=_0x4067d5['data'];if('content'in _0xb35869)console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0x95),'data':{'content':_0xb35869[_0xb5b196(0x95)]}}));else{if(_0xb5b196(0xc6)in _0xb35869){const _0x5d878d=_0xb35869['tool_call'];console['log'](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xc6),'data':{'id':_0x5d878d['id'],'name':_0x5d878d[_0xb5b196(0x9b)],'target':_0x5d878d[_0xb5b196(0xd4)]?.['name']||_0x5d878d[_0xb5b196(0xb7)]?.[_0xb5b196(0x98)]||_0x5d878d[_0xb5b196(0xd5)]?.[_0xb5b196(0x98)]||_0x5d878d['targetFunction']}}));}else{if(_0xb5b196(0x97)in _0xb35869)console['log'](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xc1),'data':{'id':_0xb35869[_0xb5b196(0x97)]['id'],'name':_0xb35869[_0xb5b196(0x97)]['functionName'],'result':typeof _0xb35869[_0xb5b196(0x97)][_0xb5b196(0x95)]===_0xb5b196(0x9e)?_0xb35869[_0xb5b196(0x97)][_0xb5b196(0x95)][_0xb5b196(0xda)](0x0,0x1f4):''}}));else'error'in _0xb35869&&console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xbf),'data':{'error':_0xb35869[_0xb5b196(0xbf)]}}));}}}}}console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':'done'}));}async['execute'](_0x366d73){const _0x5552e7=a8_0x4d893e,{options:_0x2b7114,args:_0x1656f2,tdx:_0x5cd40f}=_0x366d73,_0x1f7a07=_0x1656f2[_0x5552e7(0xdb)]('\x20'),_0x5524f6=_0x2b7114,_0x2f21f1=_0x5524f6[_0x5552e7(0xd3)],_0x17088f=_0x5524f6[_0x5552e7(0xd6)],_0xc31988=_0x5524f6['llmProject'],_0x4cd2f7=_0x5524f6[_0x5552e7(0xa3)],_0xc64141=_0x5524f6[_0x5552e7(0x99)],_0x98f28e=_0x5524f6[_0x5552e7(0xd8)];if(_0x4cd2f7&&_0xc64141)return console['error'](_0x5552e7(0xc7)),0x1;try{let _0x4c8683,_0xf002e4;if(_0xc64141)_0xf002e4=_0xc64141;else!_0x4cd2f7&&(_0xf002e4=loadLastChatId(),_0xf002e4&&_0x2b7114[_0x5552e7(0xb3)]&&console[_0x5552e7(0xbf)](_0x5552e7(0xd0)+_0xf002e4));!_0xc64141&&(_0x4cd2f7||!_0xf002e4)&&(_0x4c8683=await resolveAgentId(_0x5cd40f,_0x2f21f1,_0x17088f,_0xc31988,_0x2b7114[_0x5552e7(0xb3)]));const _0x299c84=_0x98f28e?(_0x24e2a1,_0x191478,_0x2e2c84)=>this['streamChatJsonl'](_0x5cd40f,_0x24e2a1,_0x191478,_0x2e2c84):(_0x36c96a,_0x2c00e0,_0x2175fd)=>this[_0x5552e7(0xa9)](_0x5cd40f,_0x36c96a,_0x2c00e0,_0x2175fd,_0x2b7114[_0x5552e7(0xb3)]);try{await _0x299c84(_0x1f7a07,_0x4c8683,_0xf002e4);}catch(_0x19e993){const _0x3ffb75=_0x19e993 instanceof SDKError&&_0x19e993[_0x5552e7(0x92)]===ErrorCode[_0x5552e7(0xa8)]||_0x19e993 instanceof Error&&_0x19e993[_0x5552e7(0x93)][_0x5552e7(0xa4)](_0x5552e7(0xc5));if(_0x3ffb75&&_0xc64141)return console['error'](_0x5552e7(0xc9)+_0xc64141+_0x5552e7(0xc2)),0x1;if(_0x3ffb75)_0x2b7114[_0x5552e7(0xb3)]&&console[_0x5552e7(0xbf)](_0x5552e7(0x8f)),!_0x4c8683&&(_0x4c8683=await resolveAgentId(_0x5cd40f,_0x2f21f1,_0x17088f,_0xc31988,_0x2b7114[_0x5552e7(0xb3)])),await _0x299c84(_0x1f7a07,_0x4c8683,undefined);else throw _0x19e993;}return!_0x98f28e&&console[_0x5552e7(0x96)](),0x0;}catch(_0x211602){return console['error'](),handleSDKError(_0x211602,_0x2b7114),0x1;}}[a8_0x4d893e(0xc0)](_0x57104e){const _0x4a13b4=a8_0x4d893e;if(_0x4a13b4(0x95)in _0x57104e)process[_0x4a13b4(0x90)]['write'](_0x57104e[_0x4a13b4(0x95)]);else _0x4a13b4(0xbf)in _0x57104e&&console['error'](_0x4a13b4(0xa1)+_0x57104e[_0x4a13b4(0xbf)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x4d893e(0x98)]=a8_0x4d893e(0xa5);['description']='Create\x20a\x20new\x20chat\x20session';['validate'](_0x32f423){const _0x54f72e=a8_0x4d893e,_0x613107=_0x32f423[_0x54f72e(0xc3)],_0x1decd9=_0x613107[_0x54f72e(0xd3)],_0x2f0f45=_0x613107[_0x54f72e(0xd6)];if(!_0x1decd9&&!_0x2f0f45)return _0x54f72e(0xb8);return undefined;}async['execute'](_0x57ce8b){const _0xfd4869=a8_0x4d893e,{options:_0x342ceb,tdx:_0x16acf1}=_0x57ce8b,_0x1e60c4=_0x342ceb,_0x36a91c=_0x1e60c4[_0xfd4869(0xd3)],_0x569627=_0x1e60c4[_0xfd4869(0xd6)],_0x57c0f5=_0x1e60c4[_0xfd4869(0x9a)];try{const _0x305236=await resolveAgentId(_0x16acf1,_0x36a91c,_0x569627,_0x57c0f5,_0x342ceb[_0xfd4869(0xb3)]),_0x131064=await _0x16acf1[_0xfd4869(0xb4)][_0xfd4869(0xcf)](_0x305236);return saveLastChatId(_0x131064['id']),console[_0xfd4869(0x96)](JSON['stringify']({'chatId':_0x131064['id'],'agentId':_0x305236})),0x0;}catch(_0x4d1e24){return handleSDKError(_0x4d1e24,_0x342ceb),0x1;}}}
|