@treasuredata/tdx 2026.3.19 → 2026.3.20
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/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.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/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.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.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/llm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a122_0x13d8de=a122_0x5200;(function(_0x28dbfa,_0x4d8d55){const _0xf785c5=a122_0x5200,_0x291c0a=_0x28dbfa();while(!![]){try{const _0x38bb79=parseInt(_0xf785c5(0xb4))/0x1+parseInt(_0xf785c5(0x14f))/0x2*(parseInt(_0xf785c5(0xd0))/0x3)+parseInt(_0xf785c5(0xe1))/0x4*(-parseInt(_0xf785c5(0x139))/0x5)+parseInt(_0xf785c5(0x1b7))/0x6+-parseInt(_0xf785c5(0x125))/0x7*(parseInt(_0xf785c5(0xb2))/0x8)+parseInt(_0xf785c5(0xda))/0x9+-parseInt(_0xf785c5(0xfd))/0xa;if(_0x38bb79===_0x4d8d55)break;else _0x291c0a['push'](_0x291c0a['shift']());}catch(_0x4d4724){_0x291c0a['push'](_0x291c0a['shift']());}}}(a122_0x4313,0x45549));function a122_0x4313(){const _0xffae07=['createExperimentalKnowledgeBase','loadJsonFile','includes','utf-8','experimentalKnowledgeBases','knowledge_bases','length','availableModels','parse','imageGenerators','2003094EwrGpy','tdx.json','Invalid\x20agent\x20reference\x20format:\x20','high','endsWith','integrations.json','tdx_default_','updateKnowledgeBase','duplicate','image_gen','listTextKnowledgeBases','text','getChatInfo','updatePrompt','createExperimentalArtifact','toISOString','serviceType','Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20','chatInfo','info','NOT_FOUND','isFile','PERMISSION_DENIED','toLowerCase','project.json','listExperimentalKnowledgeBases','8oCRFmc','version','37841oTmIss','stringify','signal','unchanged','Removed\x20deleted\x20file:\x20','web_search','INTERNAL','projects','updated','Skipping\x20integration\x20\x27','\x27\x20(','conflict','currentProjectId','errors','startChat','.yml','prompts.json','experimentalArtifacts','agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat','resolveProjectId','\x20---\x0a','dir','(dry-run)','Multiple\x20agents\x20found\x20with\x20name\x20\x27','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','\x0a\x0a#\x20agent.yml\x0a','getChatLog','listAgentsFull','569211ylXzyU','message','\x27.\x20This\x20should\x20not\x20happen.','tdx_','history','createAgentResponse','agentId','AGENT_NOT_FOUND','add','listProjects','3174993PRdovb','getProject','json_schema.json','medium','sdk.llm','chatWelcomeMessage','template','4GnWiIf','variables','target','split','name','\x0a---\x20function:\x20','statSync','Unable\x20to\x20create\x20project\x20after\x20','pullProject','KnowledgeBase','getOrCreateDefaultProject','createPrompt','cloneProject','pushProject','models','attributes','clearDefaultAgent','def','listPrompts','textKnowledgeBases','reasoningEffort','filter','created','error','slackMessageMode','\x20→\x20','promptId','mkdirSync','3265630SqbVLg','path','listIntegrations','getAgent','displayName','knowledgebases.json','No\x20tdx.json\x20found\x20in\x20','claude-4.5-sonnet','agents','UNAUTHENTICATED','createTextKnowledgeBase','agent','files','map','\x20in\x20project\x20','new','readdirSync','counts','#\x20prompt.md\x0a','none','Renamed\x20KB\x20file:\x20','webSearchTools','Agent\x20reference\x20not\x20found','listWebSearchTools','tools','chat','restoreProject','metadata','starter_message','Agent\x20\x27','renamed','agents.json','low','warn','tdDatabaseName','file_name','service_type','prompt.md','event','functions','1714601xWPcEq','integrations','TextKnowledgeBase','\x0a---\x20code\x20---\x0a','Renamed\x20prompt\x20file:\x20','yaml','_reasoning_','createKnowledgeBase','pullAgent','listChats','experimental_knowledge_bases','getDefaultAgent','total','code.js','existsSync','getUserSettings','action','type','agentsFull','experimental_artifacts','1242290SUPuUw','push','sort','listExperimentalArtifacts','getCurrentProject','listAgents','dryRun','deleteProject','Project\x20\x22','Agent\x20not\x20found:\x20','Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.','chat_parent_segment','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','actions','isManaged','listKnowledgeBases','starter_message.md','join','nameToId','llm_project','dirname','keys','4zBXdAX','listToolTargets','temperature','Available\x20agents:\x20','set','knowledgeBases','tables','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.',')\x20can\x20be\x20cloned.','createWebSearchTool','createAgent','content','newProjectId','ALREADY_EXISTS','find','deleteAgent','.md','ExperimentalKnowledgeBase','continueChat','Unsupported\x20backup\x20version:\x20','writeFileSync','.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.','projectId','site','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','Unresolved\x20dependencies:\x20','basename','code','has','):\x20','LLM_PROJECT_NOT_FOUND','Use\x20\x22tdx\x20llm\x20use\x20<project>\x22\x20to\x20set\x20a\x20project\x20context\x20first,\x20or\x20use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20all\x20agents.','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','description','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','prompts','dry-run-','localeCompare','some','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','text_content','backupProject','INVALID_ARGUMENT','outputs','starterMessage','Output\x20directory\x20already\x20exists:\x20','json_schema',')\x20can\x20be\x20pushed.\x20','isDirectory','resolveAgentId','\x20attempts\x20due\x20to\x20name\x20conflicts.','jsonSchemaHint','minimal','Renamed\x20text\x20KB\x20file:\x20','Renamed\x20integration\x20file:\x20','readFileSync','---\x20file:\x20','getChatHistory','updateAgentResponse','setCurrentProject','isDir','pushAgent','\x0a---\x20schema:\x20','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','getDefaultProjectName','status','context','chatIgnoreManagedActions','Only\x20safe\x20types\x20(','chat_agent_console','systemPrompt','getOrCreateDefaultAgent','Renamed\x20folder:\x20','updateExperimentalArtifact','webhookCorsOrigins','\x22\x20already\x20exists','Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.','logger','Renamed\x20experimental\x20artifact\x20directory:\x20','rmSync','resolveProjectName','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','get','Multiple\x20projects\x20found\x20with\x20name\x20\x27','already\x20exists','client','chat_generic','oldPath','getBackupMetadata','createProject','exportedFrom','createIntegration','agent.yml'];a122_0x4313=function(){return _0xffae07;};return a122_0x4313();}import{LLMApiClient}from'../client/llm-api-client.js';import*as a122_0x1adbbf from'node:fs';import*as a122_0x5aebba from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{SDKError,ErrorCode,errorContains}from'../errors.js';import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir}from'../agent/agent-config.js';import{getSanitizedUsername,generateRandomHex}from'../../utils/string-utils.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a122_0x5200(_0x3a7d65,_0x4725e6){_0x3a7d65=_0x3a7d65-0xa4;const _0x43131c=a122_0x4313();let _0x520018=_0x43131c[_0x3a7d65];return _0x520018;}import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';export const SAFE_INTEGRATION_TYPES=[a122_0x13d8de(0x1a6),a122_0x13d8de(0x195),a122_0x13d8de(0x144)];async function safeListOrEmpty(_0x331e3d){const _0x124cd5=a122_0x13d8de;try{return await _0x331e3d();}catch(_0x5cef38){if(_0x5cef38 instanceof HTTPClientError&&_0x5cef38[_0x124cd5(0x191)]===0x194)return[];throw _0x5cef38;}}export class LLMSDK{[a122_0x13d8de(0xc0)];[a122_0x13d8de(0x1a5)];[a122_0x13d8de(0x192)];['logger']=Logger['of'](a122_0x13d8de(0xde));constructor(_0x3773a8){const _0x37f1c0=a122_0x13d8de;this[_0x37f1c0(0x1a5)]=new LLMApiClient(_0x3773a8),this[_0x37f1c0(0x192)]=_0x3773a8;}['getDefaultProjectName'](){const _0x56f1ae=a122_0x13d8de,_0x26203c=getSanitizedUsername();return _0x56f1ae(0x1bd)+_0x26203c;}async[a122_0x13d8de(0x18b)](_0x36ae78){const _0x45d168=a122_0x13d8de,{projectId:_0x3c50a1}=await this[_0x45d168(0x1a0)](_0x36ae78);this[_0x45d168(0xc0)]=_0x3c50a1;}[a122_0x13d8de(0x13d)](){const _0x4ea4e8=a122_0x13d8de;return this[_0x4ea4e8(0xc0)];}async['setDefaultAgent'](_0x41d60f){const _0x43cbd6=a122_0x13d8de,_0x3e66e4=this[_0x43cbd6(0x192)]['profile'];let _0x236074,_0x4a3273;if(_0x41d60f[_0x43cbd6(0x1af)]('/')){const _0x1a5bef=_0x41d60f[_0x43cbd6(0xe4)]('/');if(_0x1a5bef[_0x43cbd6(0x1b3)]!==0x2)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x43cbd6(0x1b9)+_0x41d60f,undefined,{'helpText':'Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22'});const [_0x3936f1,_0x164c08]=_0x1a5bef;_0x236074=await this['resolveProjectId'](_0x3936f1),_0x4a3273=_0x164c08;}else _0x236074=this[_0x43cbd6(0xc0)]||(await this[_0x43cbd6(0xeb)]())['id'],_0x4a3273=_0x41d60f;const _0x8f1c83=await this[_0x43cbd6(0x181)](_0x4a3273,_0x236074),_0x54ab8c=await this['client'][_0x43cbd6(0x100)](_0x8f1c83);writeCachedLLMAgent(_0x54ab8c[_0x43cbd6(0xf0)]['name'],_0x8f1c83,_0x236074,_0x3e66e4);}[a122_0x13d8de(0x130)](){const _0x412b99=a122_0x13d8de,_0x4133a2=this[_0x412b99(0x192)]['profile'];return readCachedLLMAgent(_0x4133a2)||undefined;}[a122_0x13d8de(0xf1)](){const _0x165a32=a122_0x13d8de,_0x440f5f=this[_0x165a32(0x192)]['profile'];clearCachedLLMAgent(_0x440f5f);}async[a122_0x13d8de(0xef)](){const _0x31a82c=a122_0x13d8de,_0x1101b5=await this['client'][_0x31a82c(0x134)](),_0x6295f8=[];for(const _0x25752b of _0x1101b5['availableModelNames']){const _0x4fd766=_0x1101b5[_0x31a82c(0x1b4)][_0x25752b];_0x4fd766&&_0x6295f8[_0x31a82c(0x13a)]({'name':_0x25752b,'displayName':_0x4fd766[_0x31a82c(0x101)]});}return _0x6295f8;}async['createProject'](_0x2dbf7c){const _0x5cb6d1=a122_0x13d8de;return await this[_0x5cb6d1(0x1a5)][_0x5cb6d1(0x1a9)](_0x2dbf7c);}async[a122_0x13d8de(0x140)](_0x307532){const _0x3e1599=a122_0x13d8de,{projectId:_0x30b971}=await this['resolveProjectName'](_0x307532);await this[_0x3e1599(0x1a5)][_0x3e1599(0x140)](_0x30b971);}async[a122_0x13d8de(0xbb)](_0x1b3c82=0x32){const _0x395d5e=a122_0x13d8de;return await this['client'][_0x395d5e(0xd9)](_0x1b3c82);}async[a122_0x13d8de(0xeb)](_0x304f77){const _0x1729b6=a122_0x13d8de,_0xadcc82=_0x304f77||this[_0x1729b6(0x190)](),_0x37ab0d=this['context']['profile'];if(!_0x304f77){const _0x880303=readCachedLLMProject(_0x37ab0d);if(_0x880303&&_0x880303['name']===_0xadcc82)try{const _0x48c43b=await this[_0x1729b6(0x1a5)][_0x1729b6(0xdb)](_0x880303['id']);if(_0x48c43b[_0x1729b6(0xf0)][_0x1729b6(0xe5)]===_0xadcc82)return _0x48c43b;}catch{}}const _0x2beeda=await this[_0x1729b6(0x1a5)][_0x1729b6(0xd9)](),_0xcff608=_0x2beeda[_0x1729b6(0x15d)](_0x3ab02c=>_0x3ab02c[_0x1729b6(0xf0)]['name']===_0xadcc82);if(_0xcff608)return!_0x304f77&&writeCachedLLMProject(_0xadcc82,_0xcff608['id'],_0x37ab0d),_0xcff608;const _0x2cc609=await this[_0x1729b6(0x1a5)][_0x1729b6(0x1a9)]({'name':_0xadcc82,'description':_0x1729b6(0x145)+getSanitizedUsername()+')'});return!_0x304f77&&writeCachedLLMProject(_0xadcc82,_0x2cc609['id'],_0x37ab0d),_0x2cc609;}async[a122_0x13d8de(0xc7)](_0xdd7821){const _0x5ce95e=a122_0x13d8de,_0x25fb80=await this[_0x5ce95e(0x1a5)][_0x5ce95e(0xd9)](),_0x302e38=_0x25fb80[_0x5ce95e(0xf6)](_0x490a02=>_0x490a02[_0x5ce95e(0xf0)][_0x5ce95e(0xe5)]===_0xdd7821);if(_0x302e38['length']===0x0)throw new SDKError(ErrorCode[_0x5ce95e(0x16e)],'Project\x20not\x20found:\x20'+_0xdd7821,undefined,{'helpText':_0x5ce95e(0x156)});if(_0x302e38[_0x5ce95e(0x1b3)]>0x1)throw new SDKError(ErrorCode[_0x5ce95e(0xba)],_0x5ce95e(0x1a3)+_0xdd7821+_0x5ce95e(0xd2));return _0x302e38[0x0]['id'];}async[a122_0x13d8de(0x1a0)](_0x5ae245){const _0x50e971=a122_0x13d8de,_0x4241a5=await this[_0x50e971(0x1a5)]['listProjects'](),_0x18a209=_0x4241a5['find'](_0x18e6e3=>_0x18e6e3['attributes']['name']===_0x5ae245);if(_0x18a209)return{'projectId':_0x18a209['id'],'project':_0x18a209};throw new SDKError(ErrorCode[_0x50e971(0x16e)],'Project\x20not\x20found:\x20'+_0x5ae245,undefined,{'helpText':_0x50e971(0x156)});}async[a122_0x13d8de(0x197)](_0x3d1623=a122_0x13d8de(0x104),_0x3964fd=0x0,_0x2daef9){const _0x45e77c=a122_0x13d8de,_0xc7493c=0xa;let _0x3da786=0x0,_0xd324c4;while(_0x3da786<_0xc7493c){try{const _0x3049b8=await this[_0x45e77c(0xeb)](_0xd324c4),_0x51e063=_0x3049b8['id'],_0x415383=[_0x45e77c(0x110),_0x45e77c(0x184),_0x45e77c(0x11d),_0x45e77c(0xdd),_0x45e77c(0x1ba)],_0x56a095=_0x3964fd===0x0?_0x45e77c(0xd3)+_0x3d1623:_0x45e77c(0xd3)+_0x3d1623+_0x45e77c(0x12b)+_0x415383[_0x3964fd],_0x2aaf07=await this[_0x45e77c(0x1a5)][_0x45e77c(0x13e)](_0x51e063),_0x46b767=_0x2aaf07[_0x45e77c(0x15d)](_0x5cb2d3=>_0x5cb2d3[_0x45e77c(0xf0)][_0x45e77c(0xe5)]===_0x56a095);if(_0x46b767)return _0x46b767;const _0x477a4d=_0x3964fd>0x0?0x1:_0x2daef9;return await this[_0x45e77c(0x1a5)][_0x45e77c(0x159)]({'name':_0x56a095,'projectId':_0x51e063,'modelType':_0x3d1623,'systemPrompt':'','temperature':_0x477a4d,'reasoningEffort':_0x3964fd>0x0?_0x3964fd:undefined});}catch(_0x53499d){if(_0x53499d instanceof HTTPClientError){const _0x2e4d84=_0x53499d[_0x45e77c(0x191)];if(_0x2e4d84>=0x190&&_0x2e4d84<0x1f4){if(_0x2e4d84===0x191)throw new SDKError(ErrorCode[_0x45e77c(0x106)],_0x45e77c(0x170),_0x53499d);else{if(_0x2e4d84===0x193)throw new SDKError(ErrorCode[_0x45e77c(0xae)],_0x45e77c(0x19c),_0x53499d);}throw _0x53499d;}}if(errorContains(_0x53499d,_0x45e77c(0x1a4),_0x45e77c(0x1bf),_0x45e77c(0xbf))){_0x3da786++;if(_0x3da786>=_0xc7493c)throw new SDKError(ErrorCode[_0x45e77c(0x15c)],_0x45e77c(0xe8)+_0xc7493c+_0x45e77c(0x182),_0x53499d);const _0x33d4c8=this[_0x45e77c(0x190)]();_0xd324c4=_0x33d4c8+'_'+generateRandomHex();continue;}throw _0x53499d;}}throw new SDKError(ErrorCode[_0x45e77c(0xba)],_0x45e77c(0x172));}async[a122_0x13d8de(0x181)](_0x2e020f,_0x35d920){const _0x3590c4=a122_0x13d8de,_0x45dd2e=_0x35d920||this[_0x3590c4(0xc0)],_0x43b917=await this[_0x3590c4(0x1a5)][_0x3590c4(0x13e)](_0x45dd2e),_0x44f97b=_0x43b917[_0x3590c4(0xf6)](_0x3899e7=>_0x3899e7[_0x3590c4(0xf0)][_0x3590c4(0xe5)]===_0x2e020f);if(_0x44f97b['length']===0x0){const _0x2e1e5d=_0x45dd2e?_0x3590c4(0x10b)+_0x45dd2e:'';throw new SDKError(ErrorCode[_0x3590c4(0xd7)],_0x3590c4(0x142)+_0x2e020f+_0x2e1e5d,undefined,{'helpText':_0x45dd2e?'Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.':_0x3590c4(0x16f)});}if(_0x44f97b[_0x3590c4(0x1b3)]>0x1)throw new SDKError(ErrorCode[_0x3590c4(0xba)],_0x3590c4(0xcb)+_0x2e020f+_0x3590c4(0xd2));return _0x44f97b[0x0]['id'];}async[a122_0x13d8de(0x105)](_0x3b593a){const _0x5078bf=a122_0x13d8de,_0x136495=_0x3b593a||this[_0x5078bf(0xc0)];return await this['client'][_0x5078bf(0x13e)](_0x136495);}async[a122_0x13d8de(0x137)](_0x2b4995){const _0x1ded5c=a122_0x13d8de;return await this[_0x1ded5c(0x1a5)][_0x1ded5c(0xcf)](_0x2b4995);}async[a122_0x13d8de(0x108)](_0x4405ec){const _0xcd9bc7=a122_0x13d8de;return await this[_0xcd9bc7(0x1a5)][_0xcd9bc7(0x100)](_0x4405ec);}async[a122_0x13d8de(0x159)](_0x301fc4){const _0x55367d=a122_0x13d8de;return await this[_0x55367d(0x1a5)][_0x55367d(0x159)](_0x301fc4);}async['updateAgent'](_0x129528,_0x10e3d7){const _0x331427=a122_0x13d8de;return await this[_0x331427(0x1a5)]['updateAgent'](_0x129528,_0x10e3d7);}async[a122_0x13d8de(0x15e)](_0x37db40){const _0x2965c1=a122_0x13d8de;await this[_0x2965c1(0x1a5)][_0x2965c1(0x15e)](_0x37db40);}async['startChat'](_0x4d6231){const _0x4d33fc=a122_0x13d8de;return await this['client'][_0x4d33fc(0xc2)]({'agentId':_0x4d6231});}async*[a122_0x13d8de(0x116)](_0x5b0717,_0x412fa0){const _0x419b47=a122_0x13d8de;let _0xc50b7a=_0x412fa0?.['chatId'];const _0x2a483c=_0x412fa0?.[_0x419b47(0xd6)];if(!_0xc50b7a){if(!_0x2a483c)throw new Error(_0x419b47(0xc6));const _0x635c53=await this[_0x419b47(0x1a5)][_0x419b47(0xc2)]({'agentId':_0x2a483c});_0xc50b7a=_0x635c53['id'],yield{'type':_0x419b47(0x118),'data':{'chatId':_0xc50b7a,'agentId':_0x2a483c,'projectId':_0x635c53[_0x419b47(0xf0)][_0x419b47(0x165)]}};}for await(const _0x10290c of this[_0x419b47(0x1a5)][_0x419b47(0x161)](_0xc50b7a,_0x5b0717,_0x412fa0?.[_0x419b47(0xb6)])){yield{'type':_0x419b47(0x123),'data':_0x10290c};}}async['chats'](_0x1c02f5=0x32){const _0x3651a7=a122_0x13d8de;return await this[_0x3651a7(0x1a5)][_0x3651a7(0x12e)](_0x1c02f5);}async[a122_0x13d8de(0xd4)](_0x13fc00){const _0x1c4439=a122_0x13d8de;return await this[_0x1c4439(0x1a5)][_0x1c4439(0x189)](_0x13fc00);}async['getChatLog'](_0x18467b){const _0x197612=a122_0x13d8de;return await this[_0x197612(0x1a5)][_0x197612(0xce)](_0x18467b);}async[a122_0x13d8de(0xaa)](_0x208e69){const _0x1b209a=a122_0x13d8de;return await this['client'][_0x1b209a(0xa4)](_0x208e69);}async[a122_0x13d8de(0x179)](_0x2e3405,_0x127d14,_0x575ec0){const _0x35d6ae=a122_0x13d8de,_0x34b895=_0x575ec0?.[_0x35d6ae(0x13f)]??![],{projectId:_0xdf42fc,project:_0x381c67}=await this['resolveProjectName'](_0x2e3405),_0x16286d=_0x381c67['attributes'][_0x35d6ae(0xe5)],_0x2b1948=_0x127d14||_0x16286d+'.llm';if(a122_0x1adbbf[_0x35d6ae(0x133)](_0x2b1948)&&!_0x34b895)throw new SDKError(ErrorCode[_0x35d6ae(0x15c)],_0x35d6ae(0x17d)+_0x2b1948,undefined,{'helpText':'Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.'});const _0x1e24ec=await this['client'][_0x35d6ae(0xcf)](_0xdf42fc),_0x5dbb37=await this[_0x35d6ae(0x1a5)][_0x35d6ae(0x148)](_0xdf42fc),_0x155e10=await this['client'][_0x35d6ae(0xf3)](_0xdf42fc),_0x439b54=await this[_0x35d6ae(0x1a5)]['listIntegrations'](_0xdf42fc);if(!_0x34b895){a122_0x1adbbf[_0x35d6ae(0xfc)](_0x2b1948,{'recursive':!![]});const _0x40a0a7={'version':'1.0','exportedAt':new Date()[_0x35d6ae(0xa7)](),'exportedFrom':{'site':this[_0x35d6ae(0x192)]['site'],'projectId':_0xdf42fc,'projectName':_0x16286d},'project':_0x381c67};a122_0x1adbbf[_0x35d6ae(0x163)](a122_0x5aebba[_0x35d6ae(0x14a)](_0x2b1948,_0x35d6ae(0xb0)),JSON['stringify'](_0x40a0a7,null,0x2)),a122_0x1adbbf[_0x35d6ae(0x163)](a122_0x5aebba['join'](_0x2b1948,'agents.json'),JSON['stringify'](_0x1e24ec,null,0x2)),a122_0x1adbbf[_0x35d6ae(0x163)](a122_0x5aebba['join'](_0x2b1948,_0x35d6ae(0x102)),JSON[_0x35d6ae(0xb5)](_0x5dbb37,null,0x2)),a122_0x1adbbf['writeFileSync'](a122_0x5aebba['join'](_0x2b1948,_0x35d6ae(0xc4)),JSON['stringify'](_0x155e10,null,0x2)),a122_0x1adbbf[_0x35d6ae(0x163)](a122_0x5aebba['join'](_0x2b1948,_0x35d6ae(0x1bc)),JSON[_0x35d6ae(0xb5)](_0x439b54,null,0x2));}return{'projectName':_0x16286d,'outputDir':_0x2b1948,'counts':{'agents':_0x1e24ec[_0x35d6ae(0x1b3)],'knowledgeBases':_0x5dbb37[_0x35d6ae(0x1b3)],'prompts':_0x155e10[_0x35d6ae(0x1b3)],'integrations':_0x439b54[_0x35d6ae(0x1b3)]}};}async[a122_0x13d8de(0x117)](_0x316e0c,_0x23d0d3){const _0x3d68c1=a122_0x13d8de,_0x47553a=_0x23d0d3?.[_0x3d68c1(0x13f)]??![],_0x17ed75=this[_0x3d68c1(0x1a8)](_0x316e0c),_0x3821e1=_0x17ed75['exportedFrom'][_0x3d68c1(0x166)],_0x1ec530=this[_0x3d68c1(0x192)][_0x3d68c1(0x166)],_0x526c21=_0x3821e1!==_0x1ec530?_0x3821e1:undefined,_0x32b913=this[_0x3d68c1(0x1ae)](a122_0x5aebba['join'](_0x316e0c,_0x3d68c1(0x11c)),[]),_0x3a37d2=this[_0x3d68c1(0x1ae)](a122_0x5aebba['join'](_0x316e0c,_0x3d68c1(0x102)),[]),_0x414fec=this['loadJsonFile'](a122_0x5aebba['join'](_0x316e0c,_0x3d68c1(0xc4)),[]),_0x26d020=this[_0x3d68c1(0x1ae)](a122_0x5aebba[_0x3d68c1(0x14a)](_0x316e0c,'integrations.json'),[]),_0x4252cf=_0x23d0d3?.['name']||_0x17ed75[_0x3d68c1(0x1aa)]['projectName'];if(_0x47553a){const _0xc53332=new Map(),_0x331f25=[..._0x32b913],_0x392197=_0x32b913['length']+0x1;let _0x4681ac=0x0;while(_0x331f25[_0x3d68c1(0x1b3)]>0x0&&_0x4681ac<_0x392197){_0x4681ac++;const _0x19b1cb=[];for(const _0x9e1243 of _0x331f25){canCreateAgent(_0x9e1243,_0xc53332)?_0xc53332['set'](_0x9e1243['id'],_0x3d68c1(0x174)+_0x9e1243['id']):_0x19b1cb[_0x3d68c1(0x13a)](_0x9e1243);}if(_0x19b1cb['length']===_0x331f25[_0x3d68c1(0x1b3)])throw new SDKError(ErrorCode[_0x3d68c1(0xba)],'Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.',undefined,{'helpText':_0x3d68c1(0x168)});_0x331f25[_0x3d68c1(0x1b3)]=0x0,_0x331f25[_0x3d68c1(0x13a)](..._0x19b1cb);}const _0x123f5e=_0x414fec[_0x3d68c1(0xf6)](_0x1d074b=>_0xc53332[_0x3d68c1(0x16c)](_0x1d074b['attributes'][_0x3d68c1(0xd6)]))[_0x3d68c1(0x1b3)];return{'projectName':_0x4252cf,'projectId':_0x3d68c1(0xca),'counts':{'agents':_0x32b913['length'],'knowledgeBases':_0x3a37d2[_0x3d68c1(0x1b3)],'prompts':_0x123f5e,'integrations':_0x26d020[_0x3d68c1(0x1b3)]},'sourceSite':_0x526c21};}const _0x181c77=await this[_0x3d68c1(0x1a5)][_0x3d68c1(0x1a9)]({'name':_0x4252cf,'description':_0x17ed75['project'][_0x3d68c1(0xf0)][_0x3d68c1(0x171)]}),_0x559abf=_0x181c77['id'],_0x8414ce=new Map(),_0x13ba20=new Map(),_0x3588c5=new Map();for(const _0x340ff6 of _0x3a37d2){const _0x2c3d78=await this['client']['createKnowledgeBase']({'projectId':_0x559abf,'name':_0x340ff6[_0x3d68c1(0xf0)]['name'],'tdDatabaseName':_0x340ff6[_0x3d68c1(0xf0)][_0x3d68c1(0x11f)],'tables':_0x340ff6['attributes'][_0x3d68c1(0x155)]});_0x8414ce[_0x3d68c1(0x153)](_0x340ff6['id'],_0x2c3d78['id']);}const _0x1de5fc=[..._0x32b913],_0x200c87=_0x32b913['length']+0x1;let _0x23e4e8=0x0;while(_0x1de5fc['length']>0x0&&_0x23e4e8<_0x200c87){_0x23e4e8++;const _0x1331a6=[];for(const _0xda0f2d of _0x1de5fc){if(canCreateAgent(_0xda0f2d,_0x13ba20)){const _0x1bd819=remapToolIds(_0xda0f2d['attributes'][_0x3d68c1(0x115)],_0x8414ce,_0x13ba20),_0x2ad47e=remapVariableIds(_0xda0f2d[_0x3d68c1(0xf0)][_0x3d68c1(0xe2)],_0x8414ce),_0x58292f=await this['client'][_0x3d68c1(0xd5)]({'name':_0xda0f2d[_0x3d68c1(0xf0)][_0x3d68c1(0xe5)],'projectId':_0x559abf,'systemPrompt':_0xda0f2d['attributes'][_0x3d68c1(0x196)],'starterMessage':_0xda0f2d['attributes'][_0x3d68c1(0x17c)],'modelType':migrateModelType(_0xda0f2d[_0x3d68c1(0xf0)]['modelType']),'maxToolIterations':_0xda0f2d['attributes']['maxToolIterations'],'temperature':_0xda0f2d[_0x3d68c1(0xf0)][_0x3d68c1(0x151)],'reasoningEffort':_0xda0f2d['attributes'][_0x3d68c1(0xf5)],'outputs':_0xda0f2d[_0x3d68c1(0xf0)][_0x3d68c1(0x17b)],'tools':_0x1bd819,'variables':_0x2ad47e});_0x13ba20[_0x3d68c1(0x153)](_0xda0f2d['id'],_0x58292f['id']);}else _0x1331a6['push'](_0xda0f2d);}if(_0x1331a6[_0x3d68c1(0x1b3)]===_0x1de5fc[_0x3d68c1(0x1b3)])throw new SDKError(ErrorCode[_0x3d68c1(0xba)],_0x3d68c1(0x18f),undefined,{'helpText':_0x3d68c1(0x168)});_0x1de5fc['length']=0x0,_0x1de5fc[_0x3d68c1(0x13a)](..._0x1331a6);}for(const _0x47e786 of _0x414fec){const _0x38583f=_0x13ba20[_0x3d68c1(0x1a2)](_0x47e786['attributes'][_0x3d68c1(0xd6)]);if(!_0x38583f)continue;const _0x460656=await this[_0x3d68c1(0x1a5)][_0x3d68c1(0xec)]({'projectId':_0x559abf,'agentId':_0x38583f,'name':_0x47e786[_0x3d68c1(0xf0)][_0x3d68c1(0xe5)],'systemPrompt':_0x47e786[_0x3d68c1(0xf0)][_0x3d68c1(0x196)],'template':_0x47e786[_0x3d68c1(0xf0)][_0x3d68c1(0xe0)],'jsonSchemaHint':_0x47e786[_0x3d68c1(0xf0)][_0x3d68c1(0x183)]});_0x3588c5[_0x3d68c1(0x153)](_0x47e786['id'],_0x460656['id']);}for(const _0x51fdbb of _0x26d020){const _0xf8f9ed=_0x51fdbb[_0x3d68c1(0xf0)][_0x3d68c1(0x146)]['map'](_0x84f418=>({..._0x84f418,'promptId':_0x3588c5[_0x3d68c1(0x1a2)](_0x84f418[_0x3d68c1(0xfb)])||_0x84f418[_0x3d68c1(0xfb)]}));await this[_0x3d68c1(0x1a5)][_0x3d68c1(0x1ab)]({'projectId':_0x559abf,'serviceType':_0x51fdbb[_0x3d68c1(0xf0)]['serviceType'],'actions':_0xf8f9ed,'slackMessageMode':_0x51fdbb[_0x3d68c1(0xf0)][_0x3d68c1(0xf9)],'chatIgnoreManagedActions':_0x51fdbb[_0x3d68c1(0xf0)][_0x3d68c1(0x193)],'chatWelcomeMessage':_0x51fdbb['attributes'][_0x3d68c1(0xdf)],'webhookCorsOrigins':_0x51fdbb[_0x3d68c1(0xf0)][_0x3d68c1(0x19a)]});}return{'projectName':_0x4252cf,'projectId':_0x559abf,'counts':{'agents':_0x13ba20['size'],'knowledgeBases':_0x8414ce['size'],'prompts':_0x3588c5['size'],'integrations':_0x26d020[_0x3d68c1(0x1b3)]},'sourceSite':_0x526c21};}[a122_0x13d8de(0x1ae)](_0x5c6108,_0x28058f){const _0x6f8b62=a122_0x13d8de;if(!a122_0x1adbbf[_0x6f8b62(0x133)](_0x5c6108))return _0x28058f;return JSON[_0x6f8b62(0x1b5)](a122_0x1adbbf[_0x6f8b62(0x187)](_0x5c6108,'utf-8'));}[a122_0x13d8de(0x1a8)](_0x262774){const _0x453c7f=a122_0x13d8de;if(!a122_0x1adbbf['existsSync'](_0x262774))throw new SDKError(ErrorCode[_0x453c7f(0xac)],'Backup\x20folder\x20not\x20found:\x20'+_0x262774,undefined,{'helpText':'Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.'});const _0x35270d=a122_0x5aebba[_0x453c7f(0x14a)](_0x262774,_0x453c7f(0xb0));if(!a122_0x1adbbf[_0x453c7f(0x133)](_0x35270d))throw new SDKError(ErrorCode[_0x453c7f(0x17a)],_0x453c7f(0xa9)+_0x262774,undefined,{'helpText':'Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.'});const _0x1a4464=JSON[_0x453c7f(0x1b5)](a122_0x1adbbf[_0x453c7f(0x187)](_0x35270d,'utf-8'));if(!isSupportedBackupVersion(_0x1a4464[_0x453c7f(0xb3)]))throw new SDKError(ErrorCode[_0x453c7f(0x17a)],_0x453c7f(0x162)+_0x1a4464['version'],undefined,{'helpText':_0x453c7f(0x167)});return _0x1a4464;}async[a122_0x13d8de(0xe9)](_0x39f2a0,_0x3e7820,_0x7bddc){const _0x82fce0=a122_0x13d8de,{projectId:_0x1f7ac4,project:_0x237fb5}=await this[_0x82fce0(0x1a0)](_0x39f2a0),_0x926c66=_0x237fb5[_0x82fce0(0xf0)][_0x82fce0(0xe5)];let _0x1dc926;if(_0x3e7820)_0x1dc926=_0x3e7820;else{const _0x308fdf=a122_0x5aebba['join'](process['cwd'](),'agents'),_0x899cb3=getSanitizedPathWithMigration(_0x308fdf,_0x926c66);_0x899cb3[_0x82fce0(0x11b)]&&this[_0x82fce0(0x19d)][_0x82fce0(0xab)](_0x82fce0(0x198)+a122_0x5aebba[_0x82fce0(0x16a)](_0x899cb3[_0x82fce0(0x1a7)])+_0x82fce0(0xfa)+a122_0x5aebba[_0x82fce0(0x16a)](_0x899cb3[_0x82fce0(0xfe)])),_0x1dc926=_0x899cb3[_0x82fce0(0xfe)];}const _0x52ddd5=await this[_0x82fce0(0x1a5)]['listAgentsFull'](_0x1f7ac4),_0x220b1b=await this['client'][_0x82fce0(0x148)](_0x1f7ac4),_0x6fe911=await this[_0x82fce0(0x1a5)][_0x82fce0(0x1c1)](_0x1f7ac4),_0x58b1f4=await safeListOrEmpty(()=>this[_0x82fce0(0x1a5)]['listImageGenerators'](_0x1f7ac4)),_0x4a81ff=await safeListOrEmpty(()=>this[_0x82fce0(0x1a5)][_0x82fce0(0x114)](_0x1f7ac4)),_0x1d218f=await this[_0x82fce0(0x1a5)][_0x82fce0(0xf3)](_0x1f7ac4),_0x19980b=await this['client'][_0x82fce0(0xff)](_0x1f7ac4),_0x36ac5c=await safeListOrEmpty(()=>this[_0x82fce0(0x1a5)][_0x82fce0(0xb1)](_0x1f7ac4)),_0xefd05b=await safeListOrEmpty(()=>this['client'][_0x82fce0(0x13c)](_0x1f7ac4)),_0x589dd7=_0x19980b['filter'](_0x257207=>!_0x257207[_0x82fce0(0xf0)]['isManaged']&&SAFE_INTEGRATION_TYPES['includes'](_0x257207[_0x82fce0(0xf0)][_0x82fce0(0xa8)][_0x82fce0(0xaf)]())),_0x1559c0=new Map(),_0x583b8a=new Map(),_0xd2548c=new Map(),_0x2748b9=new Map(),_0x44d57e=new Map(),_0x391317=new Map(),_0x336585=new Map();for(const _0x5a02a2 of _0x52ddd5){_0x1559c0[_0x82fce0(0x153)](_0x5a02a2['id'],_0x5a02a2[_0x82fce0(0xf0)][_0x82fce0(0xe5)]);}for(const _0xf7fcde of _0x220b1b){_0x583b8a['set'](_0xf7fcde['id'],_0xf7fcde[_0x82fce0(0xf0)][_0x82fce0(0xe5)]);}for(const _0x141848 of _0x6fe911){_0xd2548c[_0x82fce0(0x153)](_0x141848['id'],_0x141848[_0x82fce0(0xf0)][_0x82fce0(0xe5)]);}for(const _0x135d09 of _0x58b1f4){_0x2748b9[_0x82fce0(0x153)](_0x135d09['id'],_0x135d09[_0x82fce0(0xf0)][_0x82fce0(0xe5)]);}for(const _0x296879 of _0x4a81ff){_0x44d57e[_0x82fce0(0x153)](_0x296879['id'],_0x296879[_0x82fce0(0xf0)][_0x82fce0(0xe5)]);}for(const _0x1f3817 of _0x1d218f){_0x391317['set'](_0x1f3817['id'],_0x1f3817['attributes'][_0x82fce0(0xe5)]);}for(const _0x4c2483 of _0x36ac5c){_0x336585['set'](_0x4c2483['id'],_0x4c2483[_0x82fce0(0xf0)][_0x82fce0(0xe5)]);}const _0x2a5d1f={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x583b8a,'TextKnowledgeBase':_0xd2548c,'Agent':_0x1559c0,'WebSearchTool':_0x44d57e,'ImageGenerator':_0x2748b9,'ExperimentalKnowledgeBase':_0x336585}),'resolvePromptName':async _0x36cb70=>_0x391317[_0x82fce0(0x1a2)](_0x36cb70),'onWarning':_0x22ba8f=>this[_0x82fce0(0x19d)][_0x82fce0(0x11e)](_0x22ba8f)},_0x249731={'projectName':_0x926c66,'outputDir':_0x1dc926,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'knowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'textKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'prompts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'integrations':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalArtifacts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0}}},_0x3da39d=[],_0x4160fb=[];for(const _0x2b2d00 of _0x52ddd5){const _0x28bb6d=getSanitizedPathWithMigration(_0x1dc926,_0x2b2d00[_0x82fce0(0xf0)][_0x82fce0(0xe5)]);_0x28bb6d[_0x82fce0(0x11b)]&&this[_0x82fce0(0x19d)][_0x82fce0(0xab)]('Renamed\x20agent\x20folder:\x20'+a122_0x5aebba[_0x82fce0(0x16a)](_0x28bb6d['oldPath'])+_0x82fce0(0xfa)+a122_0x5aebba[_0x82fce0(0x16a)](_0x28bb6d[_0x82fce0(0xfe)]));const _0xd517ab=_0x28bb6d[_0x82fce0(0xfe)],_0x18265e=a122_0x5aebba['join'](_0xd517ab,'prompt.md'),_0x3a7be0=a122_0x5aebba[_0x82fce0(0x14a)](_0xd517ab,_0x82fce0(0x1ac)),_0x16dee8=a122_0x5aebba['join'](_0xd517ab,_0x82fce0(0x149)),{yaml:_0x1c0e6e,systemPrompt:_0x36c015,starterMessage:_0x3113e3}=await agentResponseToDef(_0x2b2d00,_0x2a5d1f),_0x48163c=toAgentYamlString(_0x1c0e6e),_0x3bff04=!a122_0x1adbbf['existsSync'](_0x3a7be0);let _0x594a9f=_0x3bff04,_0x19a631;if(!_0x3bff04){const _0x59492f=a122_0x1adbbf[_0x82fce0(0x133)](_0x18265e)?a122_0x1adbbf[_0x82fce0(0x187)](_0x18265e,_0x82fce0(0x1b0)):'',_0x34d7c2=a122_0x1adbbf[_0x82fce0(0x187)](_0x3a7be0,_0x82fce0(0x1b0)),_0x3d6e69='#\x20prompt.md\x0a'+_0x59492f+_0x82fce0(0xcd)+_0x34d7c2,_0xbb8074=_0x82fce0(0x10f)+_0x36c015+_0x82fce0(0xcd)+_0x48163c,_0x1d9733=generateDiff(_0x3d6e69,_0xbb8074);_0x594a9f=hasChanges(_0x1d9733),_0x594a9f&&(_0x19a631=formatDiffWithColors(_0x1d9733));}_0x3da39d[_0x82fce0(0x13a)]({'path':_0xd517ab,'content':'','isDir':!![]}),_0x3da39d['push']({'path':_0x18265e,'content':_0x36c015}),_0x3da39d[_0x82fce0(0x13a)]({'path':_0x3a7be0,'content':_0x48163c});_0x3113e3&&_0x3113e3[_0x82fce0(0x1af)]('\x0a')&&_0x3da39d[_0x82fce0(0x13a)]({'path':_0x16dee8,'content':_0x3113e3});_0x249731[_0x82fce0(0x105)][_0x82fce0(0x13a)]({'agentName':_0x2b2d00[_0x82fce0(0xf0)][_0x82fce0(0xe5)],'outputPath':_0xd517ab,'isNew':_0x3bff04,'hasChanges':_0x594a9f,'diff':_0x19a631}),_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x105)][_0x82fce0(0x131)]++;if(_0x3bff04)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x105)][_0x82fce0(0x10c)]++;else{if(_0x594a9f)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x105)][_0x82fce0(0xbc)]++;else _0x249731[_0x82fce0(0x10e)][_0x82fce0(0x105)][_0x82fce0(0xb7)]++;}}for(const _0x3e85cc of _0x220b1b){if(_0x3e85cc[_0x82fce0(0xf0)][_0x82fce0(0x147)])continue;const _0xdb3990=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x1dc926),_0x3e85cc[_0x82fce0(0xf0)]['name'],'.yml');_0xdb3990[_0x82fce0(0x11b)]&&this['logger'][_0x82fce0(0xab)](_0x82fce0(0x111)+a122_0x5aebba['basename'](_0xdb3990[_0x82fce0(0x1a7)])+_0x82fce0(0xfa)+a122_0x5aebba[_0x82fce0(0x16a)](_0xdb3990['path']));const _0x1fc4b6=_0xdb3990[_0x82fce0(0xfe)],_0x572712=apiKnowledgeBaseToYaml(_0x3e85cc),_0x45cf37=toKnowledgeBaseYamlString(_0x572712),_0x21fde0=!a122_0x1adbbf['existsSync'](_0x1fc4b6);let _0x1b2b18=_0x21fde0,_0x32ff1c;if(!_0x21fde0){const _0x120200=a122_0x1adbbf[_0x82fce0(0x187)](_0x1fc4b6,_0x82fce0(0x1b0)),_0x5854a7=generateDiff(_0x120200,_0x45cf37);_0x1b2b18=hasChanges(_0x5854a7),_0x1b2b18&&(_0x32ff1c=formatDiffWithColors(_0x5854a7));}_0x3da39d[_0x82fce0(0x13a)]({'path':_0x1fc4b6,'content':_0x45cf37}),_0x249731[_0x82fce0(0x154)]['push']({'name':_0x3e85cc[_0x82fce0(0xf0)][_0x82fce0(0xe5)],'outputPath':_0x1fc4b6,'isNew':_0x21fde0,'hasChanges':_0x1b2b18,'diff':_0x32ff1c}),_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x154)][_0x82fce0(0x131)]++;if(_0x21fde0)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x154)][_0x82fce0(0x10c)]++;else{if(_0x1b2b18)_0x249731['counts']['knowledgeBases'][_0x82fce0(0xbc)]++;else _0x249731[_0x82fce0(0x10e)][_0x82fce0(0x154)][_0x82fce0(0xb7)]++;}}for(const _0x360e54 of _0x6fe911){if(_0x360e54['attributes'][_0x82fce0(0x147)])continue;const _0x3fcfed=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x1dc926),_0x360e54[_0x82fce0(0xf0)][_0x82fce0(0xe5)],_0x82fce0(0x15f));_0x3fcfed['renamed']&&this['logger'][_0x82fce0(0xab)](_0x82fce0(0x185)+a122_0x5aebba[_0x82fce0(0x16a)](_0x3fcfed[_0x82fce0(0x1a7)])+'\x20→\x20'+a122_0x5aebba[_0x82fce0(0x16a)](_0x3fcfed[_0x82fce0(0xfe)]));const _0x51fb8d=_0x3fcfed[_0x82fce0(0xfe)],_0x465949=toTextKnowledgeBaseMd(_0x360e54[_0x82fce0(0xf0)][_0x82fce0(0xe5)],_0x360e54['attributes'][_0x82fce0(0x1c2)]),_0x3d2efb=!a122_0x1adbbf[_0x82fce0(0x133)](_0x51fb8d);let _0x4ba45e=_0x3d2efb,_0x55cd37;if(!_0x3d2efb){const _0x3b48be=a122_0x1adbbf[_0x82fce0(0x187)](_0x51fb8d,_0x82fce0(0x1b0)),_0x580a28=generateDiff(_0x3b48be,_0x465949);_0x4ba45e=hasChanges(_0x580a28),_0x4ba45e&&(_0x55cd37=formatDiffWithColors(_0x580a28));}_0x3da39d['push']({'path':_0x51fb8d,'content':_0x465949}),_0x249731[_0x82fce0(0xf4)][_0x82fce0(0x13a)]({'name':_0x360e54[_0x82fce0(0xf0)][_0x82fce0(0xe5)],'outputPath':_0x51fb8d,'isNew':_0x3d2efb,'hasChanges':_0x4ba45e,'diff':_0x55cd37}),_0x249731['counts'][_0x82fce0(0xf4)]['total']++;if(_0x3d2efb)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0xf4)][_0x82fce0(0x10c)]++;else{if(_0x4ba45e)_0x249731[_0x82fce0(0x10e)]['textKnowledgeBases'][_0x82fce0(0xbc)]++;else _0x249731[_0x82fce0(0x10e)]['textKnowledgeBases']['unchanged']++;}}for(const _0x28a48f of _0x1d218f){if(_0x28a48f[_0x82fce0(0xf0)][_0x82fce0(0x147)])continue;const _0x35e6ed=getSanitizedPathWithMigration(getPromptsDir(_0x1dc926),_0x28a48f[_0x82fce0(0xf0)][_0x82fce0(0xe5)],_0x82fce0(0xc3));_0x35e6ed[_0x82fce0(0x11b)]&&this[_0x82fce0(0x19d)]['info'](_0x82fce0(0x129)+a122_0x5aebba[_0x82fce0(0x16a)](_0x35e6ed[_0x82fce0(0x1a7)])+'\x20→\x20'+a122_0x5aebba['basename'](_0x35e6ed[_0x82fce0(0xfe)]));const _0x46e6df=_0x35e6ed[_0x82fce0(0xfe)],_0x2e2db4=await apiPromptToYaml(_0x28a48f,_0x2a5d1f);if(!_0x2e2db4)continue;const _0x4c450f=toPromptYamlString(_0x2e2db4),_0x275de1=!a122_0x1adbbf[_0x82fce0(0x133)](_0x46e6df);let _0x53b081=_0x275de1,_0x1574b7;if(!_0x275de1){const _0xcab880=a122_0x1adbbf[_0x82fce0(0x187)](_0x46e6df,_0x82fce0(0x1b0)),_0x4906c9=generateDiff(_0xcab880,_0x4c450f);_0x53b081=hasChanges(_0x4906c9),_0x53b081&&(_0x1574b7=formatDiffWithColors(_0x4906c9));}_0x3da39d[_0x82fce0(0x13a)]({'path':_0x46e6df,'content':_0x4c450f}),_0x249731['prompts'][_0x82fce0(0x13a)]({'name':_0x28a48f[_0x82fce0(0xf0)][_0x82fce0(0xe5)],'outputPath':_0x46e6df,'isNew':_0x275de1,'hasChanges':_0x53b081,'diff':_0x1574b7}),_0x249731['counts'][_0x82fce0(0x173)][_0x82fce0(0x131)]++;if(_0x275de1)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x173)][_0x82fce0(0x10c)]++;else{if(_0x53b081)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x173)][_0x82fce0(0xbc)]++;else _0x249731[_0x82fce0(0x10e)][_0x82fce0(0x173)][_0x82fce0(0xb7)]++;}}for(const _0x135ac1 of _0x589dd7){const _0x2df3d7=_0x135ac1[_0x82fce0(0xf0)][_0x82fce0(0xa8)][_0x82fce0(0xaf)](),_0x30f81f=getSanitizedPathWithMigration(getIntegrationsDir(_0x1dc926),_0x2df3d7,_0x82fce0(0xc3));_0x30f81f[_0x82fce0(0x11b)]&&this[_0x82fce0(0x19d)]['info'](_0x82fce0(0x186)+a122_0x5aebba['basename'](_0x30f81f[_0x82fce0(0x1a7)])+_0x82fce0(0xfa)+a122_0x5aebba['basename'](_0x30f81f[_0x82fce0(0xfe)]));const _0x2aa697=_0x30f81f[_0x82fce0(0xfe)],_0x5b0959=await apiIntegrationToYaml(_0x135ac1,_0x2a5d1f),_0x409a08=toIntegrationYamlString(_0x5b0959),_0x5f3067=!a122_0x1adbbf[_0x82fce0(0x133)](_0x2aa697);let _0x1de5da=_0x5f3067,_0x54b2e4;if(!_0x5f3067){const _0x27735e=a122_0x1adbbf[_0x82fce0(0x187)](_0x2aa697,_0x82fce0(0x1b0)),_0x20b470=generateDiff(_0x27735e,_0x409a08);_0x1de5da=hasChanges(_0x20b470),_0x1de5da&&(_0x54b2e4=formatDiffWithColors(_0x20b470));}_0x3da39d['push']({'path':_0x2aa697,'content':_0x409a08}),_0x249731[_0x82fce0(0x126)][_0x82fce0(0x13a)]({'name':_0x2df3d7,'outputPath':_0x2aa697,'isNew':_0x5f3067,'hasChanges':_0x1de5da,'diff':_0x54b2e4}),_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x126)][_0x82fce0(0x131)]++;if(_0x5f3067)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x126)]['new']++;else{if(_0x1de5da)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x126)]['updated']++;else _0x249731[_0x82fce0(0x10e)]['integrations'][_0x82fce0(0xb7)]++;}}for(const _0x354862 of _0x36ac5c){if(_0x354862['attributes']['isManaged'])continue;const _0x38bc7d=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x1dc926),_0x354862['attributes'][_0x82fce0(0xe5)]);_0x38bc7d[_0x82fce0(0x11b)]&&this[_0x82fce0(0x19d)][_0x82fce0(0xab)]('Renamed\x20experimental\x20KB\x20directory:\x20'+a122_0x5aebba[_0x82fce0(0x16a)](_0x38bc7d[_0x82fce0(0x1a7)])+_0x82fce0(0xfa)+a122_0x5aebba[_0x82fce0(0x16a)](_0x38bc7d[_0x82fce0(0xfe)]));const _0x442473=_0x38bc7d[_0x82fce0(0xfe)],_0xf66b39=a122_0x5aebba[_0x82fce0(0x14a)](_0x442473,sanitizeForFilesystem(_0x354862[_0x82fce0(0xf0)]['name'])+_0x82fce0(0xc3)),_0x56c7fe=a122_0x5aebba['join'](_0x442473,_0x82fce0(0x124)),_0x235326=apiExperimentalKnowledgeBaseToYaml(_0x354862),_0x3410ca=toExperimentalKnowledgeBaseYamlString(_0x235326),_0x5939ba=!a122_0x1adbbf[_0x82fce0(0x133)](_0x442473);let _0x355800=_0x5939ba,_0x8f3e2a,_0x180b5b=_0x3410ca;const _0x2393f8=[..._0x235326[_0x82fce0(0x124)]]['sort']((_0x341898,_0x593162)=>_0x341898[_0x82fce0(0xe5)][_0x82fce0(0x175)](_0x593162['name']));for(const _0x5ee937 of _0x2393f8){_0x180b5b+=_0x82fce0(0xe6)+_0x5ee937[_0x82fce0(0xe5)]+_0x82fce0(0xc8)+_0x5ee937[_0x82fce0(0x16b)]+'\x0a---\x20schema:\x20'+_0x5ee937['name']+_0x82fce0(0xc8)+_0x5ee937[_0x82fce0(0x17e)]+'\x0a';}if(!_0x5939ba){let _0x192752='';a122_0x1adbbf[_0x82fce0(0x133)](_0xf66b39)&&(_0x192752=a122_0x1adbbf['readFileSync'](_0xf66b39,_0x82fce0(0x1b0)));if(a122_0x1adbbf['existsSync'](_0x56c7fe)){const _0x36a333=a122_0x1adbbf[_0x82fce0(0x10d)](_0x56c7fe,{'withFileTypes':!![]}),_0x40a0f0=_0x36a333[_0x82fce0(0xf6)](_0x51e0ba=>_0x51e0ba['isDirectory']())['sort']((_0x3f0cf2,_0x193416)=>_0x3f0cf2[_0x82fce0(0xe5)][_0x82fce0(0x175)](_0x193416[_0x82fce0(0xe5)]));for(const _0x47454a of _0x40a0f0){const _0x3437c5=a122_0x5aebba[_0x82fce0(0x14a)](_0x56c7fe,_0x47454a[_0x82fce0(0xe5)],'code.js'),_0x31f478=a122_0x5aebba['join'](_0x56c7fe,_0x47454a['name'],_0x82fce0(0xdc));a122_0x1adbbf[_0x82fce0(0x133)](_0x3437c5)&&(_0x192752+=_0x82fce0(0xe6)+_0x47454a['name']+_0x82fce0(0xc8)+a122_0x1adbbf[_0x82fce0(0x187)](_0x3437c5,_0x82fce0(0x1b0))+'\x0a'),a122_0x1adbbf[_0x82fce0(0x133)](_0x31f478)&&(_0x192752+='---\x20schema:\x20'+_0x47454a[_0x82fce0(0xe5)]+_0x82fce0(0xc8)+a122_0x1adbbf[_0x82fce0(0x187)](_0x31f478,_0x82fce0(0x1b0))+'\x0a');}}const _0x5bfd41=generateDiff(_0x192752,_0x180b5b);_0x355800=hasChanges(_0x5bfd41),_0x355800&&(_0x8f3e2a=formatDiffWithColors(_0x5bfd41));}_0x3da39d[_0x82fce0(0x13a)]({'path':_0x442473,'content':'','isDir':!![]}),_0x3da39d[_0x82fce0(0x13a)]({'path':_0xf66b39,'content':_0x3410ca}),_0x3da39d[_0x82fce0(0x13a)]({'path':_0x56c7fe,'content':'','isDir':!![]});for(const _0x1bbccb of _0x235326[_0x82fce0(0x124)]){const _0xa5c56e=a122_0x5aebba[_0x82fce0(0x14a)](_0x56c7fe,sanitizeForFilesystem(_0x1bbccb[_0x82fce0(0xe5)])),_0x46c58d=a122_0x5aebba['join'](_0xa5c56e,_0x82fce0(0x132)),_0x232571=a122_0x5aebba[_0x82fce0(0x14a)](_0xa5c56e,_0x82fce0(0xdc));_0x3da39d[_0x82fce0(0x13a)]({'path':_0xa5c56e,'content':'','isDir':!![]}),_0x3da39d[_0x82fce0(0x13a)]({'path':_0x46c58d,'content':_0x1bbccb['code']}),_0x3da39d[_0x82fce0(0x13a)]({'path':_0x232571,'content':_0x1bbccb[_0x82fce0(0x17e)]});}if(a122_0x1adbbf[_0x82fce0(0x133)](_0x56c7fe)){const _0x45c0b9=a122_0x1adbbf[_0x82fce0(0x10d)](_0x56c7fe,{'withFileTypes':!![]}),_0x7c0c00=new Set(_0x235326[_0x82fce0(0x124)][_0x82fce0(0x10a)](_0x305e4b=>sanitizeForFilesystem(_0x305e4b[_0x82fce0(0xe5)])));for(const _0x122144 of _0x45c0b9){if(_0x122144[_0x82fce0(0x180)]()&&!_0x7c0c00['has'](_0x122144[_0x82fce0(0xe5)])){const _0x318cb6=a122_0x5aebba['join'](_0x56c7fe,_0x122144['name']);_0x4160fb['push']({'path':_0x318cb6,'isDir':!![]});}}}_0x249731[_0x82fce0(0x1b1)]['push']({'name':_0x354862[_0x82fce0(0xf0)]['name'],'outputPath':_0x442473,'isNew':_0x5939ba,'hasChanges':_0x355800,'diff':_0x8f3e2a}),_0x249731['counts'][_0x82fce0(0x1b1)][_0x82fce0(0x131)]++;if(_0x5939ba)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x1b1)][_0x82fce0(0x10c)]++;else{if(_0x355800)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0x1b1)]['updated']++;else _0x249731[_0x82fce0(0x10e)][_0x82fce0(0x1b1)][_0x82fce0(0xb7)]++;}}for(const _0x84e601 of _0xefd05b){if(_0x84e601['attributes'][_0x82fce0(0x147)])continue;const _0x448a68=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x1dc926),_0x84e601[_0x82fce0(0xf0)]['name']);_0x448a68[_0x82fce0(0x11b)]&&this[_0x82fce0(0x19d)]['info'](_0x82fce0(0x19e)+a122_0x5aebba['basename'](_0x448a68[_0x82fce0(0x1a7)])+_0x82fce0(0xfa)+a122_0x5aebba['basename'](_0x448a68['path']));const _0x5db6b2=_0x448a68[_0x82fce0(0xfe)],_0x1d3f45=a122_0x5aebba[_0x82fce0(0x14a)](_0x5db6b2,sanitizeForFilesystem(_0x84e601[_0x82fce0(0xf0)][_0x82fce0(0xe5)])+_0x82fce0(0xc3)),_0x3c75e8=a122_0x5aebba[_0x82fce0(0x14a)](_0x5db6b2,_0x82fce0(0x132)),_0x53ee62=a122_0x5aebba[_0x82fce0(0x14a)](_0x5db6b2,_0x82fce0(0x109)),_0x299cf9=apiExperimentalArtifactToYaml(_0x84e601),_0x2f0251=toExperimentalArtifactYamlString(_0x299cf9),_0x1769e2=!a122_0x1adbbf['existsSync'](_0x5db6b2);let _0x540a37=_0x1769e2,_0xa18e2d,_0x4f23ef=_0x2f0251+('\x0a---\x20code\x20---\x0a'+_0x299cf9[_0x82fce0(0x16b)]+'\x0a');const _0x7eb7a3=[..._0x299cf9[_0x82fce0(0x109)]]['sort']((_0x45affd,_0x34f6a9)=>_0x45affd[_0x82fce0(0x120)][_0x82fce0(0x175)](_0x34f6a9[_0x82fce0(0x120)]));for(const _0x199738 of _0x7eb7a3){_0x4f23ef+=_0x82fce0(0x188)+_0x199738[_0x82fce0(0x120)]+_0x82fce0(0xc8)+_0x199738[_0x82fce0(0x178)]+'\x0a';}if(!_0x1769e2){let _0x5f2545='';a122_0x1adbbf[_0x82fce0(0x133)](_0x1d3f45)&&(_0x5f2545=a122_0x1adbbf['readFileSync'](_0x1d3f45,'utf-8'));a122_0x1adbbf['existsSync'](_0x3c75e8)&&(_0x5f2545+=_0x82fce0(0x128)+a122_0x1adbbf[_0x82fce0(0x187)](_0x3c75e8,_0x82fce0(0x1b0))+'\x0a');if(a122_0x1adbbf['existsSync'](_0x53ee62)){const _0x44b145=a122_0x1adbbf[_0x82fce0(0x10d)](_0x53ee62),_0x55c00f=_0x44b145[_0x82fce0(0xf6)](_0x5a2118=>{const _0x1a70b8=_0x82fce0,_0x62189e=a122_0x5aebba[_0x1a70b8(0x14a)](_0x53ee62,_0x5a2118);return a122_0x1adbbf[_0x1a70b8(0xe7)](_0x62189e)[_0x1a70b8(0xad)]();})[_0x82fce0(0x13b)]((_0x4468a4,_0x2f1d11)=>_0x4468a4[_0x82fce0(0x175)](_0x2f1d11));for(const _0x120234 of _0x55c00f){const _0xa3eb21=a122_0x5aebba[_0x82fce0(0x14a)](_0x53ee62,_0x120234);_0x5f2545+=_0x82fce0(0x188)+_0x120234+_0x82fce0(0xc8)+a122_0x1adbbf[_0x82fce0(0x187)](_0xa3eb21,_0x82fce0(0x1b0))+'\x0a';}}const _0x510982=generateDiff(_0x5f2545,_0x4f23ef);_0x540a37=hasChanges(_0x510982),_0x540a37&&(_0xa18e2d=formatDiffWithColors(_0x510982));}_0x3da39d[_0x82fce0(0x13a)]({'path':_0x5db6b2,'content':'','isDir':!![]}),_0x3da39d[_0x82fce0(0x13a)]({'path':_0x1d3f45,'content':_0x2f0251}),_0x3da39d[_0x82fce0(0x13a)]({'path':_0x3c75e8,'content':_0x299cf9[_0x82fce0(0x16b)]});if(_0x299cf9[_0x82fce0(0x109)]['length']>0x0){_0x3da39d[_0x82fce0(0x13a)]({'path':_0x53ee62,'content':'','isDir':!![]});for(const _0x2c64b4 of _0x299cf9[_0x82fce0(0x109)]){const _0x42cee5=a122_0x5aebba[_0x82fce0(0x14a)](_0x53ee62,_0x2c64b4[_0x82fce0(0x120)]);_0x3da39d[_0x82fce0(0x13a)]({'path':_0x42cee5,'content':_0x2c64b4[_0x82fce0(0x178)]});}}if(a122_0x1adbbf[_0x82fce0(0x133)](_0x53ee62)){const _0x25794b=a122_0x1adbbf[_0x82fce0(0x10d)](_0x53ee62),_0x5d3e6e=new Set(_0x299cf9['files']['map'](_0xb91c0b=>_0xb91c0b['file_name']));for(const _0x2acc17 of _0x25794b){const _0x37fec2=a122_0x5aebba[_0x82fce0(0x14a)](_0x53ee62,_0x2acc17);a122_0x1adbbf[_0x82fce0(0xe7)](_0x37fec2)[_0x82fce0(0xad)]()&&!_0x5d3e6e['has'](_0x2acc17)&&_0x4160fb[_0x82fce0(0x13a)]({'path':_0x37fec2});}}_0x249731[_0x82fce0(0xc5)][_0x82fce0(0x13a)]({'name':_0x84e601[_0x82fce0(0xf0)][_0x82fce0(0xe5)],'outputPath':_0x5db6b2,'isNew':_0x1769e2,'hasChanges':_0x540a37,'diff':_0xa18e2d}),_0x249731['counts']['experimentalArtifacts'][_0x82fce0(0x131)]++;if(_0x1769e2)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0xc5)][_0x82fce0(0x10c)]++;else{if(_0x540a37)_0x249731[_0x82fce0(0x10e)][_0x82fce0(0xc5)][_0x82fce0(0xbc)]++;else _0x249731[_0x82fce0(0x10e)][_0x82fce0(0xc5)][_0x82fce0(0xb7)]++;}}if(_0x7bddc?.[_0x82fce0(0x13f)])return _0x249731;a122_0x1adbbf[_0x82fce0(0xfc)](_0x1dc926,{'recursive':!![]}),a122_0x1adbbf[_0x82fce0(0xfc)](getKnowledgeBasesDir(_0x1dc926),{'recursive':!![]}),a122_0x1adbbf['mkdirSync'](getPromptsDir(_0x1dc926),{'recursive':!![]}),a122_0x1adbbf[_0x82fce0(0xfc)](getIntegrationsDir(_0x1dc926),{'recursive':!![]}),a122_0x1adbbf['mkdirSync'](getExperimentalKnowledgeBasesDir(_0x1dc926),{'recursive':!![]}),a122_0x1adbbf[_0x82fce0(0xfc)](getExperimentalArtifactsDir(_0x1dc926),{'recursive':!![]});const _0x32f3ca=a122_0x5aebba[_0x82fce0(0x14a)](_0x1dc926,_0x82fce0(0x1b8));a122_0x1adbbf[_0x82fce0(0x163)](_0x32f3ca,createAgentConfigContent(_0x926c66));for(const _0x37fdd4 of _0x3da39d){if(_0x37fdd4[_0x82fce0(0x18c)])a122_0x1adbbf[_0x82fce0(0xfc)](_0x37fdd4[_0x82fce0(0xfe)],{'recursive':!![]});else{const _0x19e8c0=a122_0x5aebba['dirname'](_0x37fdd4[_0x82fce0(0xfe)]);!a122_0x1adbbf[_0x82fce0(0x133)](_0x19e8c0)&&a122_0x1adbbf[_0x82fce0(0xfc)](_0x19e8c0,{'recursive':!![]}),a122_0x1adbbf[_0x82fce0(0x163)](_0x37fdd4[_0x82fce0(0xfe)],_0x37fdd4[_0x82fce0(0x15a)]);}}for(const _0x2deeb6 of _0x4160fb){_0x2deeb6['isDir']?(a122_0x1adbbf['rmSync'](_0x2deeb6[_0x82fce0(0xfe)],{'recursive':!![],'force':!![]}),this[_0x82fce0(0x19d)][_0x82fce0(0xab)]('Removed\x20deleted\x20directory:\x20'+a122_0x5aebba[_0x82fce0(0x16a)](a122_0x5aebba[_0x82fce0(0x14d)](_0x2deeb6[_0x82fce0(0xfe)]))+'/'+a122_0x5aebba[_0x82fce0(0x16a)](_0x2deeb6[_0x82fce0(0xfe)]))):(a122_0x1adbbf[_0x82fce0(0x19f)](_0x2deeb6[_0x82fce0(0xfe)],{'force':!![]}),this[_0x82fce0(0x19d)][_0x82fce0(0xab)](_0x82fce0(0xb8)+a122_0x5aebba[_0x82fce0(0x16a)](a122_0x5aebba['dirname'](_0x2deeb6['path']))+'/'+a122_0x5aebba[_0x82fce0(0x16a)](_0x2deeb6['path'])));}return _0x249731;}async[a122_0x13d8de(0xee)](_0xbd7f84,_0x5aba4f){const _0x5e6129=a122_0x13d8de,_0x3d9089=a122_0x5aebba[_0x5e6129(0x14a)](_0xbd7f84,'tdx.json');if(!a122_0x1adbbf[_0x5e6129(0x133)](_0x3d9089))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5e6129(0x103)+_0xbd7f84,undefined,{'helpText':_0x5e6129(0x177)});const _0x453cf1=loadAgentConfig(_0x3d9089),_0x2e5d70=await this[_0x5e6129(0xc7)](_0x453cf1[_0x5e6129(0x14c)]),_0x507cf3=await this[_0x5e6129(0x1a5)][_0x5e6129(0xdb)](_0x2e5d70),_0x4baead=_0x507cf3[_0x5e6129(0xf0)][_0x5e6129(0xe5)],_0x15d234={'projectName':_0x4baead,'projectId':_0x2e5d70,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x3eba0f=[],_0x34c611=[],_0x58c741=[],_0x3f103c=[],_0x2611cd=[],_0x280f18=[],_0x31a257=a122_0x1adbbf['readdirSync'](_0xbd7f84,{'withFileTypes':!![]});for(const _0x5769a6 of _0x31a257){if(!_0x5769a6[_0x5e6129(0x180)]())continue;if(['knowledge_bases','prompts',_0x5e6129(0x126),_0x5e6129(0x12f),_0x5e6129(0x138)]['includes'](_0x5769a6[_0x5e6129(0xe5)]))continue;const _0x22f67d=a122_0x5aebba[_0x5e6129(0x14a)](_0xbd7f84,_0x5769a6['name']);if(isAgentDir(_0x22f67d)){const _0x58ec9e=a122_0x5aebba[_0x5e6129(0x14a)](_0x22f67d,_0x5e6129(0x1ac)),_0x476100=a122_0x5aebba[_0x5e6129(0x14a)](_0x22f67d,_0x5e6129(0x122)),_0x542ccd=a122_0x5aebba[_0x5e6129(0x14a)](_0x22f67d,_0x5e6129(0x149)),_0x2ca0a0=parseAgentYaml(a122_0x1adbbf[_0x5e6129(0x187)](_0x58ec9e,_0x5e6129(0x1b0)),_0x58ec9e),_0x2b3853=a122_0x1adbbf[_0x5e6129(0x133)](_0x476100)?a122_0x1adbbf['readFileSync'](_0x476100,_0x5e6129(0x1b0)):'',_0x185039=a122_0x1adbbf['existsSync'](_0x542ccd)?a122_0x1adbbf['readFileSync'](_0x542ccd,_0x5e6129(0x1b0)):_0x2ca0a0[_0x5e6129(0x119)];_0x3eba0f[_0x5e6129(0x13a)]({'name':_0x2ca0a0['name'],'dir':_0x22f67d,'yaml':_0x2ca0a0,'systemPrompt':_0x2b3853,'starterMessage':_0x185039});}}const _0x15ab40=getKnowledgeBasesDir(_0xbd7f84);if(a122_0x1adbbf[_0x5e6129(0x133)](_0x15ab40)){const _0x1896f5=a122_0x1adbbf[_0x5e6129(0x10d)](_0x15ab40);for(const _0x42d28d of _0x1896f5){const _0x1c7b6f=a122_0x5aebba['join'](_0x15ab40,_0x42d28d);if(_0x42d28d[_0x5e6129(0x1bb)]('.yml')){const _0x43452e=parseKnowledgeBaseYaml(a122_0x1adbbf[_0x5e6129(0x187)](_0x1c7b6f,_0x5e6129(0x1b0)),_0x1c7b6f);_0x34c611[_0x5e6129(0x13a)]({'name':_0x43452e[_0x5e6129(0xe5)],'path':_0x1c7b6f,'yaml':_0x43452e});}else{if(_0x42d28d[_0x5e6129(0x1bb)]('.md')){const _0x51b555=a122_0x1adbbf[_0x5e6129(0x187)](_0x1c7b6f,_0x5e6129(0x1b0)),{name:_0x3f3f00,text:_0x108d3d}=parseTextKnowledgeBaseMd(_0x51b555,_0x42d28d);_0x58c741[_0x5e6129(0x13a)]({'name':_0x3f3f00,'path':_0x1c7b6f,'text':_0x108d3d});}}}}const _0xcdac40=getPromptsDir(_0xbd7f84);if(a122_0x1adbbf['existsSync'](_0xcdac40)){const _0x3c875b=a122_0x1adbbf[_0x5e6129(0x10d)](_0xcdac40)['filter'](_0xf9089c=>_0xf9089c[_0x5e6129(0x1bb)]('.yml'));for(const _0x552c51 of _0x3c875b){const _0x254925=a122_0x5aebba[_0x5e6129(0x14a)](_0xcdac40,_0x552c51),_0x5de7d5=parsePromptYaml(a122_0x1adbbf[_0x5e6129(0x187)](_0x254925,_0x5e6129(0x1b0)),_0x254925);_0x3f103c[_0x5e6129(0x13a)]({'name':_0x5de7d5[_0x5e6129(0xe5)],'path':_0x254925,'yaml':_0x5de7d5});}}const _0x27e489=[],_0x4d6284=getIntegrationsDir(_0xbd7f84);if(a122_0x1adbbf['existsSync'](_0x4d6284)){const _0x4622f1=a122_0x1adbbf['readdirSync'](_0x4d6284)[_0x5e6129(0xf6)](_0x4e43ac=>_0x4e43ac['endsWith'](_0x5e6129(0xc3)));for(const _0x5b5c02 of _0x4622f1){const _0x11cede=a122_0x5aebba[_0x5e6129(0x14a)](_0x4d6284,_0x5b5c02),_0x57c9bd=parseIntegrationYaml(a122_0x1adbbf[_0x5e6129(0x187)](_0x11cede,_0x5e6129(0x1b0)),_0x11cede);if(!SAFE_INTEGRATION_TYPES[_0x5e6129(0x1af)](_0x57c9bd[_0x5e6129(0x121)][_0x5e6129(0xaf)]())){this['logger'][_0x5e6129(0x11e)](_0x5e6129(0xbd)+_0x57c9bd[_0x5e6129(0xe5)]+_0x5e6129(0xbe)+_0x57c9bd[_0x5e6129(0x121)]+'):\x20'+(_0x5e6129(0x194)+SAFE_INTEGRATION_TYPES['join'](',\x20')+_0x5e6129(0x17f))+'Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.');continue;}_0x27e489[_0x5e6129(0x13a)]({'name':_0x57c9bd[_0x5e6129(0xe5)],'path':_0x11cede,'yaml':_0x57c9bd});}}const _0x4c4c16=getExperimentalKnowledgeBasesDir(_0xbd7f84);if(a122_0x1adbbf['existsSync'](_0x4c4c16)){const _0x3fc882=a122_0x1adbbf[_0x5e6129(0x10d)](_0x4c4c16,{'withFileTypes':!![]});for(const _0x5a8564 of _0x3fc882){if(!_0x5a8564[_0x5e6129(0x180)]())continue;const _0x3d830f=a122_0x5aebba['join'](_0x4c4c16,_0x5a8564[_0x5e6129(0xe5)]),_0x10fdf6=a122_0x5aebba['join'](_0x3d830f,_0x5a8564[_0x5e6129(0xe5)]+_0x5e6129(0xc3)),_0x530cb7=a122_0x5aebba['join'](_0x3d830f,_0x5e6129(0x124));if(!a122_0x1adbbf['existsSync'](_0x10fdf6))continue;const _0x587ce0=parseExperimentalKnowledgeBaseYaml(a122_0x1adbbf['readFileSync'](_0x10fdf6,_0x5e6129(0x1b0)),_0x10fdf6),_0xdcb435=[];if(a122_0x1adbbf[_0x5e6129(0x133)](_0x530cb7)){const _0x52d486=a122_0x1adbbf[_0x5e6129(0x10d)](_0x530cb7,{'withFileTypes':!![]});for(const _0x2313f2 of _0x52d486){if(!_0x2313f2[_0x5e6129(0x180)]())continue;const _0x3bcd82=a122_0x5aebba['join'](_0x530cb7,_0x2313f2[_0x5e6129(0xe5)]),_0x303405=a122_0x5aebba['join'](_0x3bcd82,_0x5e6129(0x132)),_0x374fa3=a122_0x5aebba['join'](_0x3bcd82,_0x5e6129(0xdc));a122_0x1adbbf[_0x5e6129(0x133)](_0x303405)&&a122_0x1adbbf[_0x5e6129(0x133)](_0x374fa3)&&_0xdcb435[_0x5e6129(0x13a)]({'name':_0x2313f2[_0x5e6129(0xe5)],'code':a122_0x1adbbf[_0x5e6129(0x187)](_0x303405,_0x5e6129(0x1b0)),'json_schema':a122_0x1adbbf['readFileSync'](_0x374fa3,'utf-8')});}}const _0x29d37c={..._0x587ce0,'variables':_0x587ce0[_0x5e6129(0xe2)]||[],'functions':_0xdcb435};_0x2611cd[_0x5e6129(0x13a)]({'name':_0x587ce0[_0x5e6129(0xe5)],'dir':_0x3d830f,'def':_0x29d37c});}}const _0x50eff9=getExperimentalArtifactsDir(_0xbd7f84);if(a122_0x1adbbf[_0x5e6129(0x133)](_0x50eff9)){const _0x192380=a122_0x1adbbf['readdirSync'](_0x50eff9,{'withFileTypes':!![]});for(const _0x452190 of _0x192380){if(!_0x452190[_0x5e6129(0x180)]())continue;const _0x2de3b5=a122_0x5aebba[_0x5e6129(0x14a)](_0x50eff9,_0x452190[_0x5e6129(0xe5)]),_0x2c2ae7=a122_0x5aebba[_0x5e6129(0x14a)](_0x2de3b5,_0x452190[_0x5e6129(0xe5)]+'.yml'),_0x9a88e9=a122_0x5aebba[_0x5e6129(0x14a)](_0x2de3b5,_0x5e6129(0x132)),_0x4bdc1f=a122_0x5aebba[_0x5e6129(0x14a)](_0x2de3b5,_0x5e6129(0x109));if(!a122_0x1adbbf['existsSync'](_0x2c2ae7)||!a122_0x1adbbf[_0x5e6129(0x133)](_0x9a88e9))continue;const _0x3c09e9=parseExperimentalArtifactYaml(a122_0x1adbbf[_0x5e6129(0x187)](_0x2c2ae7,_0x5e6129(0x1b0)),_0x2c2ae7),_0x3db3bb=a122_0x1adbbf[_0x5e6129(0x187)](_0x9a88e9,_0x5e6129(0x1b0)),_0x38e704=[];if(a122_0x1adbbf[_0x5e6129(0x133)](_0x4bdc1f)){const _0x425669=a122_0x1adbbf[_0x5e6129(0x10d)](_0x4bdc1f);for(const _0x23e8b4 of _0x425669){const _0x5161dd=a122_0x5aebba[_0x5e6129(0x14a)](_0x4bdc1f,_0x23e8b4);a122_0x1adbbf[_0x5e6129(0xe7)](_0x5161dd)[_0x5e6129(0xad)]()&&_0x38e704[_0x5e6129(0x13a)]({'file_name':_0x23e8b4,'text_content':a122_0x1adbbf[_0x5e6129(0x187)](_0x5161dd,_0x5e6129(0x1b0))});}}const _0x3cab87={..._0x3c09e9,'code':_0x3db3bb,'files':_0x38e704};_0x280f18[_0x5e6129(0x13a)]({'name':_0x3c09e9[_0x5e6129(0xe5)],'dir':_0x2de3b5,'def':_0x3cab87});}}const _0x319005=await this[_0x5e6129(0x1a5)][_0x5e6129(0xcf)](_0x2e5d70),_0x3f6c39=await this[_0x5e6129(0x1a5)][_0x5e6129(0x148)](_0x2e5d70),_0x3efcfd=await this[_0x5e6129(0x1a5)][_0x5e6129(0x1c1)](_0x2e5d70),_0x484433=await this['client'][_0x5e6129(0xf3)](_0x2e5d70),_0x40bbb8=await this[_0x5e6129(0x1a5)]['listIntegrations'](_0x2e5d70),_0x2fcf47=await safeListOrEmpty(()=>this['client']['listExperimentalKnowledgeBases'](_0x2e5d70)),_0x5ee3f5=await safeListOrEmpty(()=>this['client']['listExperimentalArtifacts'](_0x2e5d70)),_0x5729e5=await fetchAllToolTargetMaps((_0x75fa77,_0x13c81)=>this[_0x5e6129(0x1a5)][_0x5e6129(0x150)](_0x75fa77,_0x13c81),_0x2e5d70),_0x3b0ec6=new Map(),_0x424f5b=new Map(),_0x52ee71=new Map(),_0x39a7a6=new Map(),_0x32d43f=new Map(),_0xc34f67=new Map(),_0x2f7f4d=new Map();for(const _0xa6906c of _0x319005){_0x3b0ec6[_0x5e6129(0x153)](_0xa6906c[_0x5e6129(0xf0)][_0x5e6129(0xe5)],_0xa6906c);}for(const _0x5c3242 of _0x3f6c39){_0x424f5b[_0x5e6129(0x153)](_0x5c3242[_0x5e6129(0xf0)][_0x5e6129(0xe5)],_0x5c3242);}for(const _0x2d4065 of _0x3efcfd){_0x52ee71[_0x5e6129(0x153)](_0x2d4065[_0x5e6129(0xf0)]['name'],_0x2d4065);}for(const _0x46ee3c of _0x484433){_0x39a7a6[_0x5e6129(0x153)](_0x46ee3c[_0x5e6129(0xf0)][_0x5e6129(0xe5)],_0x46ee3c);}for(const _0x3fe39c of _0x40bbb8){_0x32d43f[_0x5e6129(0x153)](_0x3fe39c[_0x5e6129(0xf0)][_0x5e6129(0xa8)][_0x5e6129(0xaf)](),_0x3fe39c);}for(const _0x28bf5b of _0x2fcf47){_0xc34f67[_0x5e6129(0x153)](_0x28bf5b['attributes'][_0x5e6129(0xe5)],_0x28bf5b);}for(const _0x4417ee of _0x5ee3f5){_0x2f7f4d[_0x5e6129(0x153)](_0x4417ee[_0x5e6129(0xf0)][_0x5e6129(0xe5)],_0x4417ee);}const _0x15916a=new Map(),_0x5c3eba=new Map();for(const _0x27c55a of _0x319005){_0x15916a[_0x5e6129(0x153)](_0x27c55a['attributes'][_0x5e6129(0xe5)],_0x27c55a['id']),_0x5c3eba[_0x5e6129(0x153)](_0x27c55a['id'],_0x27c55a[_0x5e6129(0xf0)]['name']);}const _0x3a8254=new Map(),_0x3b1676=new Map();for(const _0x2165a8 of _0x484433){_0x3a8254['set'](_0x2165a8[_0x5e6129(0xf0)][_0x5e6129(0xe5)],_0x2165a8['id']),_0x3b1676['set'](_0x2165a8['id'],_0x2165a8['attributes'][_0x5e6129(0xe5)]);}const _0x166fe5=_0x5729e5[_0x5e6129(0x14b)][_0x5e6129(0xea)]||new Map(),_0x54e3b5=_0x5729e5['nameToId'][_0x5e6129(0x127)]||new Map(),_0x5d594f=_0x5729e5['nameToId'][_0x5e6129(0x160)]||new Map(),_0xad4f3d=new Map(),_0x330b55={'resolveToolTargetName':buildNameResolver({..._0x5729e5['idToName'],'Agent':_0x5c3eba}),'resolvePromptName':async _0x328a19=>_0x3b1676['get'](_0x328a19),'onWarning':_0x275331=>this[_0x5e6129(0x19d)][_0x5e6129(0x11e)](_0x275331)};let _0x2922ef=[];const _0x14d784={'projectId':_0x2e5d70,'resolveToolTargetId':buildIdResolver({..._0x5729e5[_0x5e6129(0x14b)],'Agent':_0x15916a}),'resolvePromptId':async _0x1e51b9=>_0x3a8254[_0x5e6129(0x1a2)](_0x1e51b9),'onWarning':_0x50f202=>{const _0x479e39=_0x5e6129;this[_0x479e39(0x19d)]['warn'](_0x50f202),_0x2922ef[_0x479e39(0x13a)](_0x50f202);}},{resolved:_0xccc015,unresolved:_0x4920d5}=resolveAgentDependencies(_0x3eba0f,new Set(_0x3b0ec6[_0x5e6129(0x14e)]()));for(const {agent:_0x3fad4f,missingDeps:_0x1406d1}of _0x4920d5){_0x15d234[_0x5e6129(0x105)][_0x5e6129(0x13a)]({'agentName':_0x3fad4f['yaml'][_0x5e6129(0xe5)],'action':_0x5e6129(0xf8),'error':_0x5e6129(0x169)+_0x1406d1['join'](',\x20')+_0x5e6129(0x164)}),_0x15d234['counts'][_0x5e6129(0x105)][_0x5e6129(0xc1)]++;}for(const _0x51474f of _0x34c611){const _0x5c6cf6=_0x424f5b[_0x5e6129(0x1a2)](_0x51474f[_0x5e6129(0x12a)]['name']),_0x247733=a122_0x1adbbf[_0x5e6129(0x187)](_0x51474f[_0x5e6129(0xfe)],'utf-8');if(_0x5c6cf6){const _0x25331a=apiKnowledgeBaseToYaml(_0x5c6cf6),_0x1a2df9=toKnowledgeBaseYamlString(_0x25331a),_0x4b694a=generateDiff(_0x1a2df9,_0x247733),_0x57d324=hasChanges(_0x4b694a);_0x57d324?(_0x15d234['knowledgeBases'][_0x5e6129(0x13a)]({'name':_0x51474f[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x5c6cf6['id'],'diff':formatDiffWithColors(_0x4b694a)}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x154)]['updated']++):(_0x15d234[_0x5e6129(0x154)][_0x5e6129(0x13a)]({'name':_0x51474f['yaml'][_0x5e6129(0xe5)],'action':'unchanged','id':_0x5c6cf6['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x154)][_0x5e6129(0xb7)]++);}else _0x15d234[_0x5e6129(0x154)]['push']({'name':_0x51474f[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf7)}),_0x15d234['counts'][_0x5e6129(0x154)][_0x5e6129(0xf7)]++;}for(const _0x33aa0d of _0x58c741){const _0x26385e=_0x52ee71[_0x5e6129(0x1a2)](_0x33aa0d['name']),_0x53fe6c=a122_0x1adbbf['readFileSync'](_0x33aa0d[_0x5e6129(0xfe)],_0x5e6129(0x1b0));if(_0x26385e){const _0x389ebe=toTextKnowledgeBaseMd(_0x26385e[_0x5e6129(0xf0)][_0x5e6129(0xe5)],_0x26385e[_0x5e6129(0xf0)][_0x5e6129(0x1c2)]),_0x3e4b27=generateDiff(_0x389ebe,_0x53fe6c),_0x418c61=hasChanges(_0x3e4b27);_0x418c61?(_0x15d234[_0x5e6129(0xf4)]['push']({'name':_0x33aa0d['name'],'action':_0x5e6129(0xbc),'id':_0x26385e['id'],'diff':formatDiffWithColors(_0x3e4b27)}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0xf4)][_0x5e6129(0xbc)]++):(_0x15d234[_0x5e6129(0xf4)]['push']({'name':_0x33aa0d[_0x5e6129(0xe5)],'action':'unchanged','id':_0x26385e['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0xf4)][_0x5e6129(0xb7)]++);}else _0x15d234[_0x5e6129(0xf4)]['push']({'name':_0x33aa0d['name'],'action':'created'}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0xf4)][_0x5e6129(0xf7)]++;}for(const _0x46fd79 of _0xccc015){const _0x4b2caa=_0x3b0ec6[_0x5e6129(0x1a2)](_0x46fd79['yaml'][_0x5e6129(0xe5)]),_0x3c7499=a122_0x5aebba[_0x5e6129(0x14a)](_0x46fd79[_0x5e6129(0xc9)],'agent.yml'),_0x5b06cb=a122_0x1adbbf[_0x5e6129(0x187)](_0x3c7499,_0x5e6129(0x1b0)),_0x13a9ec=_0x46fd79['systemPrompt'],_0x295325=_0x5e6129(0x10f)+_0x13a9ec+_0x5e6129(0xcd)+_0x5b06cb;if(_0x4b2caa){const {yaml:_0x4a50fd,systemPrompt:_0x272b21}=await agentResponseToDef(_0x4b2caa,_0x330b55),_0x5b91d4=toAgentYamlString(_0x4a50fd),_0x482229=_0x5e6129(0x10f)+_0x272b21+_0x5e6129(0xcd)+_0x5b91d4,_0x1ac370=generateDiff(_0x482229,_0x295325),_0x5def9d=hasChanges(_0x1ac370);_0x5def9d?(_0x15d234['agents'][_0x5e6129(0x13a)]({'agentName':_0x46fd79['yaml'][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'agentId':_0x4b2caa['id'],'diff':formatDiffWithColors(_0x1ac370)}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x105)]['updated']++):(_0x15d234[_0x5e6129(0x105)]['push']({'agentName':_0x46fd79[_0x5e6129(0x12a)]['name'],'action':_0x5e6129(0xb7),'agentId':_0x4b2caa['id']}),_0x15d234['counts']['agents'][_0x5e6129(0xb7)]++);}else _0x15d234[_0x5e6129(0x105)][_0x5e6129(0x13a)]({'agentName':_0x46fd79[_0x5e6129(0x12a)]['name'],'action':'created'}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x105)][_0x5e6129(0xf7)]++;}for(const _0x351519 of _0x3f103c){const _0x49e93d=_0x39a7a6['get'](_0x351519['yaml'][_0x5e6129(0xe5)]),_0x380474=a122_0x1adbbf[_0x5e6129(0x187)](_0x351519[_0x5e6129(0xfe)],'utf-8');if(_0x49e93d){const _0xe2f166=await apiPromptToYaml(_0x49e93d,_0x330b55);if(!_0xe2f166){_0x15d234[_0x5e6129(0x173)][_0x5e6129(0x13a)]({'name':_0x351519[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x49e93d['id']}),_0x15d234[_0x5e6129(0x10e)]['prompts'][_0x5e6129(0xbc)]++;continue;}const _0x113f05=toPromptYamlString(_0xe2f166),_0x17515e=generateDiff(_0x113f05,_0x380474),_0x597e14=hasChanges(_0x17515e);_0x597e14?(_0x15d234[_0x5e6129(0x173)][_0x5e6129(0x13a)]({'name':_0x351519[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x49e93d['id'],'diff':formatDiffWithColors(_0x17515e)}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x173)][_0x5e6129(0xbc)]++):(_0x15d234[_0x5e6129(0x173)][_0x5e6129(0x13a)]({'name':_0x351519[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xb7),'id':_0x49e93d['id']}),_0x15d234[_0x5e6129(0x10e)]['prompts'][_0x5e6129(0xb7)]++);}else _0x15d234[_0x5e6129(0x173)][_0x5e6129(0x13a)]({'name':_0x351519[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf7)}),_0x15d234[_0x5e6129(0x10e)]['prompts'][_0x5e6129(0xf7)]++;}for(const _0x27ad1c of _0x27e489){const _0x2eedd7=_0x32d43f[_0x5e6129(0x1a2)](_0x27ad1c[_0x5e6129(0x12a)][_0x5e6129(0x121)]),_0x1e3ef5=a122_0x1adbbf[_0x5e6129(0x187)](_0x27ad1c[_0x5e6129(0xfe)],_0x5e6129(0x1b0));if(_0x2eedd7){const _0x34c3b5=await apiIntegrationToYaml(_0x2eedd7,_0x330b55),_0x15d7dd=toIntegrationYamlString(_0x34c3b5),_0x276f1e=generateDiff(_0x15d7dd,_0x1e3ef5),_0x44a230=hasChanges(_0x276f1e);_0x44a230?(_0x15d234['integrations']['push']({'name':_0x27ad1c['yaml'][_0x5e6129(0x121)],'action':_0x5e6129(0xbc),'id':_0x2eedd7['id'],'diff':formatDiffWithColors(_0x276f1e)}),_0x15d234['counts'][_0x5e6129(0x126)][_0x5e6129(0xbc)]++):(_0x15d234['integrations']['push']({'name':_0x27ad1c[_0x5e6129(0x12a)][_0x5e6129(0x121)],'action':_0x5e6129(0xb7),'id':_0x2eedd7['id']}),_0x15d234['counts'][_0x5e6129(0x126)][_0x5e6129(0xb7)]++);}else _0x15d234['integrations'][_0x5e6129(0x13a)]({'name':_0x27ad1c[_0x5e6129(0x12a)]['service_type'],'action':_0x5e6129(0xf7)}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x126)][_0x5e6129(0xf7)]++;}for(const _0x1f6553 of _0x2611cd){const _0x39318d=_0xc34f67[_0x5e6129(0x1a2)](_0x1f6553['def'][_0x5e6129(0xe5)]),_0x33bd22=toExperimentalKnowledgeBaseYamlString(_0x1f6553[_0x5e6129(0xf2)]);let _0x2d5212=_0x33bd22;for(const _0x56d03b of _0x1f6553[_0x5e6129(0xf2)][_0x5e6129(0x124)]){_0x2d5212+=_0x5e6129(0xe6)+_0x56d03b[_0x5e6129(0xe5)]+_0x5e6129(0xc8)+_0x56d03b[_0x5e6129(0x16b)]+_0x5e6129(0x18e)+_0x56d03b[_0x5e6129(0xe5)]+_0x5e6129(0xc8)+_0x56d03b['json_schema']+'\x0a';}if(_0x39318d){const _0x4faf07=apiExperimentalKnowledgeBaseToYaml(_0x39318d),_0x14dcd1=toExperimentalKnowledgeBaseYamlString(_0x4faf07);let _0x49bc7a=_0x14dcd1;for(const _0x36f6e3 of _0x4faf07[_0x5e6129(0x124)]){_0x49bc7a+=_0x5e6129(0xe6)+_0x36f6e3[_0x5e6129(0xe5)]+_0x5e6129(0xc8)+_0x36f6e3[_0x5e6129(0x16b)]+_0x5e6129(0x18e)+_0x36f6e3['name']+_0x5e6129(0xc8)+_0x36f6e3[_0x5e6129(0x17e)]+'\x0a';}const _0x32911c=generateDiff(_0x49bc7a,_0x2d5212),_0x580625=hasChanges(_0x32911c);_0x580625?(_0x15d234[_0x5e6129(0x1b1)]['push']({'name':_0x1f6553[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x39318d['id'],'diff':formatDiffWithColors(_0x32911c)}),_0x15d234['counts']['experimentalKnowledgeBases'][_0x5e6129(0xbc)]++):(_0x15d234[_0x5e6129(0x1b1)][_0x5e6129(0x13a)]({'name':_0x1f6553[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':_0x5e6129(0xb7),'id':_0x39318d['id']}),_0x15d234[_0x5e6129(0x10e)]['experimentalKnowledgeBases']['unchanged']++);}else _0x15d234[_0x5e6129(0x1b1)][_0x5e6129(0x13a)]({'name':_0x1f6553[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':'created'}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x1b1)][_0x5e6129(0xf7)]++;}for(const _0x1f620e of _0x280f18){const _0x74eed=_0x2f7f4d['get'](_0x1f620e[_0x5e6129(0xf2)]['name']),_0x33e1c2=toExperimentalArtifactYamlString(_0x1f620e[_0x5e6129(0xf2)]);let _0x11667f=_0x33e1c2+('\x0a---\x20code\x20---\x0a'+_0x1f620e['def']['code']+'\x0a');for(const _0x41c650 of _0x1f620e['def']['files']){_0x11667f+=_0x5e6129(0x188)+_0x41c650[_0x5e6129(0x120)]+_0x5e6129(0xc8)+_0x41c650[_0x5e6129(0x178)]+'\x0a';}if(_0x74eed){const _0x34ba38=apiExperimentalArtifactToYaml(_0x74eed),_0x17975b=toExperimentalArtifactYamlString(_0x34ba38);let _0x2272bc=_0x17975b+('\x0a---\x20code\x20---\x0a'+_0x34ba38[_0x5e6129(0x16b)]+'\x0a');for(const _0x416d3c of _0x34ba38[_0x5e6129(0x109)]){_0x2272bc+=_0x5e6129(0x188)+_0x416d3c[_0x5e6129(0x120)]+_0x5e6129(0xc8)+_0x416d3c[_0x5e6129(0x178)]+'\x0a';}const _0x26a184=generateDiff(_0x2272bc,_0x11667f),_0x2673d8=hasChanges(_0x26a184);_0x2673d8?(_0x15d234['experimentalArtifacts']['push']({'name':_0x1f620e['def'][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x74eed['id'],'diff':formatDiffWithColors(_0x26a184)}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0xc5)][_0x5e6129(0xbc)]++):(_0x15d234[_0x5e6129(0xc5)]['push']({'name':_0x1f620e['def'][_0x5e6129(0xe5)],'action':_0x5e6129(0xb7),'id':_0x74eed['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0xc5)][_0x5e6129(0xb7)]++);}else _0x15d234[_0x5e6129(0xc5)][_0x5e6129(0x13a)]({'name':_0x1f620e[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':'created'}),_0x15d234['counts'][_0x5e6129(0xc5)][_0x5e6129(0xf7)]++;}if(_0x5aba4f?.[_0x5e6129(0x13f)])return _0x15d234;_0x15d234[_0x5e6129(0x154)]=[],_0x15d234['textKnowledgeBases']=[],_0x15d234['prompts']=[],_0x15d234[_0x5e6129(0x126)]=[],_0x15d234['experimentalKnowledgeBases']=[],_0x15d234[_0x5e6129(0xc5)]=[];const _0x4a5240=_0x15d234[_0x5e6129(0x105)][_0x5e6129(0xf6)](_0x22f916=>_0x22f916[_0x5e6129(0x135)]==='error');_0x15d234[_0x5e6129(0x105)]=_0x4a5240,_0x15d234['counts']={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x4a5240[_0x5e6129(0x1b3)]},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}};for(const _0x20d504 of _0x34c611){try{const _0x30dd7e=_0x424f5b[_0x5e6129(0x1a2)](_0x20d504[_0x5e6129(0x12a)]['name']),_0x21d30e=yamlKnowledgeBaseToApi(_0x20d504['yaml'],_0x2e5d70);if(_0x30dd7e)await this[_0x5e6129(0x1a5)][_0x5e6129(0x1be)](_0x30dd7e['id'],_0x21d30e),_0x166fe5['set'](_0x20d504[_0x5e6129(0x12a)][_0x5e6129(0xe5)],_0x30dd7e['id']),_0x15d234['knowledgeBases']['push']({'name':_0x20d504[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x30dd7e['id']}),_0x15d234['counts'][_0x5e6129(0x154)][_0x5e6129(0xbc)]++;else{const _0x34fe93=await this[_0x5e6129(0x1a5)]['createKnowledgeBase'](_0x21d30e);_0x166fe5[_0x5e6129(0x153)](_0x20d504[_0x5e6129(0x12a)][_0x5e6129(0xe5)],_0x34fe93['id']),_0x15d234[_0x5e6129(0x154)][_0x5e6129(0x13a)]({'name':_0x20d504[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf7),'id':_0x34fe93['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x154)][_0x5e6129(0xf7)]++;}}catch(_0xe5c942){_0x15d234['knowledgeBases'][_0x5e6129(0x13a)]({'name':_0x20d504[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf8),'error':_0xe5c942[_0x5e6129(0xd1)]}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x154)][_0x5e6129(0xc1)]++;}}for(const _0x112725 of _0x58c741){try{const _0x5803fd=_0x52ee71[_0x5e6129(0x1a2)](_0x112725[_0x5e6129(0xe5)]),_0x33a40f=yamlTextKnowledgeBaseToApi({'name':_0x112725[_0x5e6129(0xe5)],'text':_0x112725[_0x5e6129(0x1c2)]},_0x2e5d70);if(_0x5803fd)await this[_0x5e6129(0x1a5)]['updateTextKnowledgeBase'](_0x5803fd['id'],_0x33a40f),_0x54e3b5[_0x5e6129(0x153)](_0x112725[_0x5e6129(0xe5)],_0x5803fd['id']),_0x15d234[_0x5e6129(0xf4)][_0x5e6129(0x13a)]({'name':_0x112725[_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x5803fd['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0xf4)][_0x5e6129(0xbc)]++;else{const _0x40e60e=await this[_0x5e6129(0x1a5)]['createTextKnowledgeBase'](_0x33a40f);_0x54e3b5[_0x5e6129(0x153)](_0x112725['name'],_0x40e60e['id']),_0x15d234[_0x5e6129(0xf4)][_0x5e6129(0x13a)]({'name':_0x112725['name'],'action':'created','id':_0x40e60e['id']}),_0x15d234['counts'][_0x5e6129(0xf4)][_0x5e6129(0xf7)]++;}}catch(_0x54a801){_0x15d234[_0x5e6129(0xf4)][_0x5e6129(0x13a)]({'name':_0x112725[_0x5e6129(0xe5)],'action':_0x5e6129(0xf8),'error':_0x54a801['message']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0xf4)][_0x5e6129(0xc1)]++;}}for(const _0x37e189 of _0x2611cd){try{const _0x558f9b=_0xc34f67[_0x5e6129(0x1a2)](_0x37e189['def'][_0x5e6129(0xe5)]),_0x5e6d08=yamlExperimentalKnowledgeBaseToApi(_0x37e189[_0x5e6129(0xf2)],_0x2e5d70);if(_0x558f9b)await this[_0x5e6129(0x1a5)]['updateExperimentalKnowledgeBase'](_0x558f9b['id'],_0x5e6d08),_0x5d594f[_0x5e6129(0x153)](_0x37e189[_0x5e6129(0xf2)][_0x5e6129(0xe5)],_0x558f9b['id']),_0x15d234['experimentalKnowledgeBases'][_0x5e6129(0x13a)]({'name':_0x37e189[_0x5e6129(0xf2)]['name'],'action':_0x5e6129(0xbc),'id':_0x558f9b['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x1b1)]['updated']++;else{const _0x53e508=await this[_0x5e6129(0x1a5)][_0x5e6129(0x1ad)](_0x5e6d08);_0x5d594f[_0x5e6129(0x153)](_0x37e189['def'][_0x5e6129(0xe5)],_0x53e508['id']),_0x15d234[_0x5e6129(0x1b1)][_0x5e6129(0x13a)]({'name':_0x37e189[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf7),'id':_0x53e508['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x1b1)][_0x5e6129(0xf7)]++;}}catch(_0x430f03){_0x15d234[_0x5e6129(0x1b1)][_0x5e6129(0x13a)]({'name':_0x37e189[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf8),'error':_0x430f03[_0x5e6129(0xd1)]}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x1b1)]['errors']++;}}for(const _0x55f50d of _0x280f18){try{const _0x25d789=_0x2f7f4d[_0x5e6129(0x1a2)](_0x55f50d['def']['name']),_0x3fe766=yamlExperimentalArtifactToApi(_0x55f50d[_0x5e6129(0xf2)],_0x2e5d70);if(_0x25d789)await this[_0x5e6129(0x1a5)][_0x5e6129(0x199)](_0x25d789['id'],_0x3fe766),_0xad4f3d[_0x5e6129(0x153)](_0x55f50d[_0x5e6129(0xf2)]['name'],_0x25d789['id']),_0x15d234[_0x5e6129(0xc5)][_0x5e6129(0x13a)]({'name':_0x55f50d[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x25d789['id']}),_0x15d234[_0x5e6129(0x10e)]['experimentalArtifacts'][_0x5e6129(0xbc)]++;else{const _0x151ac2=await this[_0x5e6129(0x1a5)][_0x5e6129(0xa6)](_0x3fe766);_0xad4f3d[_0x5e6129(0x153)](_0x55f50d[_0x5e6129(0xf2)][_0x5e6129(0xe5)],_0x151ac2['id']),_0x15d234[_0x5e6129(0xc5)]['push']({'name':_0x55f50d[_0x5e6129(0xf2)][_0x5e6129(0xe5)],'action':'created','id':_0x151ac2['id']}),_0x15d234[_0x5e6129(0x10e)]['experimentalArtifacts'][_0x5e6129(0xf7)]++;}}catch(_0x3bda3f){_0x15d234[_0x5e6129(0xc5)][_0x5e6129(0x13a)]({'name':_0x55f50d[_0x5e6129(0xf2)]['name'],'action':'error','error':_0x3bda3f[_0x5e6129(0xd1)]}),_0x15d234['counts'][_0x5e6129(0xc5)]['errors']++;}}for(const _0x479d3a of _0xccc015){_0x2922ef=[];try{const _0x45b072=_0x3b0ec6['get'](_0x479d3a['yaml'][_0x5e6129(0xe5)]),_0x3be895=await agentDefToRequest(_0x479d3a['yaml'],_0x479d3a[_0x5e6129(0x196)],_0x479d3a[_0x5e6129(0x17c)],_0x14d784);if(_0x45b072)await this[_0x5e6129(0x1a5)][_0x5e6129(0x18a)](_0x45b072['id'],_0x3be895),_0x15916a[_0x5e6129(0x153)](_0x479d3a[_0x5e6129(0x12a)][_0x5e6129(0xe5)],_0x45b072['id']),_0x15d234[_0x5e6129(0x105)][_0x5e6129(0x13a)]({'agentName':_0x479d3a[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':'updated','agentId':_0x45b072['id'],'warnings':_0x2922ef['length']>0x0?_0x2922ef:undefined}),_0x15d234[_0x5e6129(0x10e)]['agents'][_0x5e6129(0xbc)]++;else{const _0x5211ed=await this[_0x5e6129(0x1a5)]['createAgentResponse'](_0x3be895);_0x15916a['set'](_0x479d3a[_0x5e6129(0x12a)]['name'],_0x5211ed['id']),_0x15d234['agents']['push']({'agentName':_0x479d3a[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf7),'agentId':_0x5211ed['id'],'warnings':_0x2922ef['length']>0x0?_0x2922ef:undefined}),_0x15d234['counts'][_0x5e6129(0x105)]['created']++;}}catch(_0x535905){_0x15d234[_0x5e6129(0x105)][_0x5e6129(0x13a)]({'agentName':_0x479d3a[_0x5e6129(0x12a)]['name'],'action':'error','error':_0x535905[_0x5e6129(0xd1)],'warnings':_0x2922ef['length']>0x0?_0x2922ef:undefined}),_0x15d234['counts'][_0x5e6129(0x105)][_0x5e6129(0xc1)]++;}}for(const _0x22b666 of _0x3f103c){try{const _0x5565ed=_0x39a7a6['get'](_0x22b666['yaml'][_0x5e6129(0xe5)]),_0x4aba9f=await yamlPromptToApi(_0x22b666[_0x5e6129(0x12a)],_0x2e5d70,_0x14d784);if(!_0x4aba9f){_0x15d234[_0x5e6129(0x173)]['push']({'name':_0x22b666[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':'error','error':_0x5e6129(0x113)}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x173)]['errors']++;continue;}if(_0x5565ed)await this[_0x5e6129(0x1a5)][_0x5e6129(0xa5)](_0x5565ed['id'],_0x4aba9f),_0x3a8254[_0x5e6129(0x153)](_0x22b666['yaml'][_0x5e6129(0xe5)],_0x5565ed['id']),_0x15d234[_0x5e6129(0x173)][_0x5e6129(0x13a)]({'name':_0x22b666[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xbc),'id':_0x5565ed['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x173)][_0x5e6129(0xbc)]++;else{const _0xe2b290=await this[_0x5e6129(0x1a5)][_0x5e6129(0xec)](_0x4aba9f);_0x3a8254[_0x5e6129(0x153)](_0x22b666[_0x5e6129(0x12a)]['name'],_0xe2b290['id']),_0x15d234[_0x5e6129(0x173)]['push']({'name':_0x22b666[_0x5e6129(0x12a)]['name'],'action':'created','id':_0xe2b290['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x173)][_0x5e6129(0xf7)]++;}}catch(_0x576380){_0x15d234[_0x5e6129(0x173)]['push']({'name':_0x22b666[_0x5e6129(0x12a)][_0x5e6129(0xe5)],'action':_0x5e6129(0xf8),'error':_0x576380[_0x5e6129(0xd1)]}),_0x15d234[_0x5e6129(0x10e)]['prompts'][_0x5e6129(0xc1)]++;}}for(const _0x30adb4 of _0x27e489){try{const _0x3b222d=_0x32d43f[_0x5e6129(0x1a2)](_0x30adb4[_0x5e6129(0x12a)][_0x5e6129(0x121)]),_0x4d7959=await yamlIntegrationToApi(_0x30adb4['yaml'],_0x2e5d70,_0x14d784);if(_0x3b222d){await this['client']['deleteIntegration'](_0x3b222d['id']);const _0x17d152=await this[_0x5e6129(0x1a5)]['createIntegration'](_0x4d7959);_0x15d234[_0x5e6129(0x126)][_0x5e6129(0x13a)]({'name':_0x30adb4['yaml']['service_type'],'action':_0x5e6129(0xbc),'id':_0x17d152['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x126)]['updated']++;}else{const _0xf6d4d9=await this[_0x5e6129(0x1a5)][_0x5e6129(0x1ab)](_0x4d7959);_0x15d234['integrations']['push']({'name':_0x30adb4[_0x5e6129(0x12a)][_0x5e6129(0x121)],'action':_0x5e6129(0xf7),'id':_0xf6d4d9['id']}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x126)]['created']++;}}catch(_0xdd4329){_0x15d234[_0x5e6129(0x126)][_0x5e6129(0x13a)]({'name':_0x30adb4[_0x5e6129(0x12a)][_0x5e6129(0x121)],'action':'error','error':_0xdd4329[_0x5e6129(0xd1)]}),_0x15d234[_0x5e6129(0x10e)][_0x5e6129(0x126)][_0x5e6129(0xc1)]++;}}return _0x15d234;}async[a122_0x13d8de(0x12d)](_0x15cead,_0x2183c2,_0x47368f,_0xb14c49){const _0x41b9cf=a122_0x13d8de,{projectId:_0x3c9257,project:_0x2776d0}=await this[_0x41b9cf(0x1a0)](_0x15cead),_0x4397cd=_0x2776d0['attributes'][_0x41b9cf(0xe5)],_0x5b69ca=await this[_0x41b9cf(0x1a5)]['listAgentsFull'](_0x3c9257),_0x32ad2e=_0x5b69ca[_0x41b9cf(0x15d)](_0x2e963f=>_0x2e963f[_0x41b9cf(0xf0)]['name']===_0x2183c2);if(!_0x32ad2e)throw new SDKError(ErrorCode['AGENT_NOT_FOUND'],_0x41b9cf(0x142)+_0x2183c2,undefined,{'helpText':_0x41b9cf(0x152)+_0x5b69ca['map'](_0x1cb37d=>_0x1cb37d[_0x41b9cf(0xf0)][_0x41b9cf(0xe5)])[_0x41b9cf(0x14a)](',\x20')});let _0x2e7a0d;if(_0x47368f)_0x2e7a0d=_0x47368f;else{const _0x57d11d=a122_0x5aebba['join'](process['cwd'](),'agents'),_0x205b04=getSanitizedPathWithMigration(_0x57d11d,_0x4397cd);_0x205b04[_0x41b9cf(0x11b)]&&this[_0x41b9cf(0x19d)][_0x41b9cf(0xab)](_0x41b9cf(0x198)+a122_0x5aebba[_0x41b9cf(0x16a)](_0x205b04[_0x41b9cf(0x1a7)])+'\x20→\x20'+a122_0x5aebba[_0x41b9cf(0x16a)](_0x205b04[_0x41b9cf(0xfe)])),_0x2e7a0d=_0x205b04[_0x41b9cf(0xfe)];}const _0x67b27f=getSanitizedPathWithMigration(_0x2e7a0d,_0x2183c2);_0x67b27f[_0x41b9cf(0x11b)]&&this[_0x41b9cf(0x19d)][_0x41b9cf(0xab)]('Renamed\x20agent\x20folder:\x20'+a122_0x5aebba[_0x41b9cf(0x16a)](_0x67b27f['oldPath'])+'\x20→\x20'+a122_0x5aebba['basename'](_0x67b27f['path']));const _0x4bf663=_0x67b27f[_0x41b9cf(0xfe)],_0x374716=new Map(),_0x26ee9c=new Map(),_0x1b7adc=await this[_0x41b9cf(0x1a5)][_0x41b9cf(0x148)](_0x3c9257),_0xc9dc55=await this[_0x41b9cf(0x1a5)][_0x41b9cf(0x1c1)](_0x3c9257),_0x266a61=await safeListOrEmpty(()=>this[_0x41b9cf(0x1a5)][_0x41b9cf(0xb1)](_0x3c9257)),_0x44b640=new Map(),_0x5b1e6d=new Map();for(const _0x137980 of _0x1b7adc){_0x374716[_0x41b9cf(0x153)](_0x137980['id'],_0x137980[_0x41b9cf(0xf0)][_0x41b9cf(0xe5)]);}for(const _0x2cca8 of _0xc9dc55){_0x44b640['set'](_0x2cca8['id'],_0x2cca8[_0x41b9cf(0xf0)][_0x41b9cf(0xe5)]);}for(const _0x2c90c4 of _0x266a61){_0x5b1e6d[_0x41b9cf(0x153)](_0x2c90c4['id'],_0x2c90c4['attributes'][_0x41b9cf(0xe5)]);}for(const _0x1ab78b of _0x5b69ca){_0x26ee9c[_0x41b9cf(0x153)](_0x1ab78b['id'],_0x1ab78b[_0x41b9cf(0xf0)][_0x41b9cf(0xe5)]);}const _0x3a144d={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x374716,'TextKnowledgeBase':_0x44b640,'Agent':_0x26ee9c,'ExperimentalKnowledgeBase':_0x5b1e6d}),'resolvePromptName':async()=>undefined,'onWarning':_0x35f88f=>this[_0x41b9cf(0x19d)][_0x41b9cf(0x11e)](_0x35f88f)},_0x457c75=a122_0x5aebba[_0x41b9cf(0x14a)](_0x4bf663,_0x41b9cf(0x122)),_0x2e1821=a122_0x5aebba[_0x41b9cf(0x14a)](_0x4bf663,_0x41b9cf(0x1ac)),_0x2021e8=a122_0x5aebba[_0x41b9cf(0x14a)](_0x4bf663,_0x41b9cf(0x149)),_0x293da1=!a122_0x1adbbf[_0x41b9cf(0x133)](_0x2e1821);if(_0xb14c49?.['dryRun'])return{'agentName':_0x2183c2,'outputPath':_0x4bf663,'isNew':_0x293da1,'hasChanges':!![]};a122_0x1adbbf[_0x41b9cf(0xfc)](_0x2e7a0d,{'recursive':!![]}),a122_0x1adbbf[_0x41b9cf(0xfc)](_0x4bf663,{'recursive':!![]});const _0xd45c5d=a122_0x5aebba[_0x41b9cf(0x14a)](_0x2e7a0d,'tdx.json');!a122_0x1adbbf[_0x41b9cf(0x133)](_0xd45c5d)&&a122_0x1adbbf[_0x41b9cf(0x163)](_0xd45c5d,createAgentConfigContent(_0x15cead));const {yaml:_0x1f0aa4,systemPrompt:_0x42fdaa,starterMessage:_0x277dc2}=await agentResponseToDef(_0x32ad2e,_0x3a144d);let _0x4b97ae=_0x293da1;if(!_0x293da1){const _0x55418e=a122_0x1adbbf['existsSync'](_0x457c75)?a122_0x1adbbf[_0x41b9cf(0x187)](_0x457c75,_0x41b9cf(0x1b0)):'',_0x230c59=a122_0x1adbbf[_0x41b9cf(0x187)](_0x2e1821,'utf-8');_0x4b97ae=_0x55418e!==_0x42fdaa||_0x230c59!==toAgentYamlString(_0x1f0aa4);}a122_0x1adbbf[_0x41b9cf(0x163)](_0x457c75,_0x42fdaa),a122_0x1adbbf[_0x41b9cf(0x163)](_0x2e1821,toAgentYamlString(_0x1f0aa4));if(_0x277dc2&&_0x277dc2[_0x41b9cf(0x1af)]('\x0a'))a122_0x1adbbf[_0x41b9cf(0x163)](_0x2021e8,_0x277dc2);else a122_0x1adbbf['existsSync'](_0x2021e8)&&a122_0x1adbbf['unlinkSync'](_0x2021e8);return{'agentName':_0x2183c2,'outputPath':_0x4bf663,'isNew':_0x293da1,'hasChanges':_0x4b97ae};}async[a122_0x13d8de(0x18d)](_0x172e1b,_0x3c505c){const _0x2d302c=a122_0x13d8de;let _0xa8110;isAgentYamlPath(_0x172e1b)?_0xa8110=getAgentDirFromYamlPath(_0x172e1b):_0xa8110=_0x172e1b;const {config:_0x2114f4}=findAgentConfig(_0xa8110),_0x522633=await this[_0x2d302c(0xc7)](_0x2114f4[_0x2d302c(0x14c)]),_0x51b00f=a122_0x5aebba['join'](_0xa8110,_0x2d302c(0x1ac)),_0x10a1c9=a122_0x5aebba[_0x2d302c(0x14a)](_0xa8110,_0x2d302c(0x122)),_0x3daaee=a122_0x5aebba[_0x2d302c(0x14a)](_0xa8110,_0x2d302c(0x149));if(!a122_0x1adbbf[_0x2d302c(0x133)](_0x51b00f))throw new SDKError(ErrorCode[_0x2d302c(0xac)],'agent.yml\x20not\x20found\x20in\x20'+_0xa8110,undefined,{'helpText':_0x2d302c(0xcc)});const _0x49e6d6=parseAgentYaml(a122_0x1adbbf['readFileSync'](_0x51b00f,_0x2d302c(0x1b0)),_0x51b00f),_0x35f646=a122_0x1adbbf[_0x2d302c(0x133)](_0x10a1c9)?a122_0x1adbbf['readFileSync'](_0x10a1c9,_0x2d302c(0x1b0)):'',_0x2a610f=a122_0x1adbbf[_0x2d302c(0x133)](_0x3daaee)?a122_0x1adbbf['readFileSync'](_0x3daaee,_0x2d302c(0x1b0)):_0x49e6d6[_0x2d302c(0x119)];if(_0x3c505c?.[_0x2d302c(0x13f)])return{'agentName':_0x49e6d6[_0x2d302c(0xe5)],'action':_0x2d302c(0xf7),'projectId':_0x522633};const _0x5515d9=await this[_0x2d302c(0x1a5)][_0x2d302c(0xcf)](_0x522633),_0x29b48b=await fetchAllToolTargetMaps((_0x566f3f,_0x38ad82)=>this['client'][_0x2d302c(0x150)](_0x566f3f,_0x38ad82),_0x522633),_0x2b6931=new Map();for(const _0x571d1f of _0x5515d9){_0x2b6931[_0x2d302c(0x153)](_0x571d1f['attributes'][_0x2d302c(0xe5)],_0x571d1f['id']);}const _0x53e2c2=[],_0x2c2407={'projectId':_0x522633,'resolveToolTargetId':buildIdResolver({..._0x29b48b['nameToId'],'Agent':_0x2b6931}),'resolvePromptId':async()=>undefined,'onWarning':_0x4ed311=>{const _0x46e1b9=_0x2d302c;this[_0x46e1b9(0x19d)][_0x46e1b9(0x11e)](_0x4ed311),_0x53e2c2[_0x46e1b9(0x13a)](_0x4ed311);}};try{const _0x59f1e5=_0x5515d9[_0x2d302c(0x15d)](_0x1e2fcf=>_0x1e2fcf['attributes']['name']===_0x49e6d6[_0x2d302c(0xe5)]),_0x3a401d=await agentDefToRequest(_0x49e6d6,_0x35f646,_0x2a610f,_0x2c2407);if(_0x59f1e5)return await this[_0x2d302c(0x1a5)][_0x2d302c(0x18a)](_0x59f1e5['id'],_0x3a401d),{'agentName':_0x49e6d6[_0x2d302c(0xe5)],'action':_0x2d302c(0xbc),'projectId':_0x522633,'agentId':_0x59f1e5['id'],'warnings':_0x53e2c2[_0x2d302c(0x1b3)]>0x0?_0x53e2c2:undefined};else{const _0x55850b=await this[_0x2d302c(0x1a5)][_0x2d302c(0xd5)](_0x3a401d);return{'agentName':_0x49e6d6[_0x2d302c(0xe5)],'action':'created','projectId':_0x522633,'agentId':_0x55850b['id'],'warnings':_0x53e2c2[_0x2d302c(0x1b3)]>0x0?_0x53e2c2:undefined};}}catch(_0xbc028f){return{'agentName':_0x49e6d6[_0x2d302c(0xe5)],'action':_0x2d302c(0xf8),'projectId':_0x522633,'error':_0xbc028f[_0x2d302c(0xd1)],'warnings':_0x53e2c2[_0x2d302c(0x1b3)]>0x0?_0x53e2c2:undefined};}}async[a122_0x13d8de(0xed)](_0x759efa,_0x457fb3,_0x210988){const _0x1832df=a122_0x13d8de,_0xe6449f=a122_0x1adbbf[_0x1832df(0x133)](_0x759efa)&&a122_0x1adbbf['existsSync'](a122_0x5aebba['join'](_0x759efa,_0x1832df(0x1b8)));let _0x52efac;const _0x1f1425=[],_0x1f9ea5=[],_0x3cbdc3=[],_0x4e9395=[],_0x10cbeb=[],_0x382833=[],_0x5e1cdb=[];if(_0xe6449f){const _0x547911=loadAgentConfig(a122_0x5aebba[_0x1832df(0x14a)](_0x759efa,'tdx.json'));_0x52efac=_0x547911[_0x1832df(0x14c)];const _0x60c0=a122_0x1adbbf[_0x1832df(0x10d)](_0x759efa,{'withFileTypes':!![]});for(const _0x44b53e of _0x60c0){if(!_0x44b53e[_0x1832df(0x180)]())continue;if([_0x1832df(0x1b2),_0x1832df(0x12f),_0x1832df(0x138),_0x1832df(0x173),_0x1832df(0x126)][_0x1832df(0x1af)](_0x44b53e[_0x1832df(0xe5)]))continue;const _0xd00a1d=a122_0x5aebba[_0x1832df(0x14a)](_0x759efa,_0x44b53e[_0x1832df(0xe5)]);if(isAgentDir(_0xd00a1d)){const _0xa4ee80=a122_0x5aebba['join'](_0xd00a1d,_0x1832df(0x1ac)),_0x3ab55e=a122_0x5aebba[_0x1832df(0x14a)](_0xd00a1d,'prompt.md'),_0x10d5e0=a122_0x5aebba['join'](_0xd00a1d,_0x1832df(0x149)),_0x5a991e=parseAgentYaml(a122_0x1adbbf['readFileSync'](_0xa4ee80,_0x1832df(0x1b0)),_0xa4ee80),_0x290a23=a122_0x1adbbf[_0x1832df(0x133)](_0x3ab55e)?a122_0x1adbbf[_0x1832df(0x187)](_0x3ab55e,_0x1832df(0x1b0)):'',_0x109623=a122_0x1adbbf[_0x1832df(0x133)](_0x10d5e0)?a122_0x1adbbf[_0x1832df(0x187)](_0x10d5e0,_0x1832df(0x1b0)):_0x5a991e[_0x1832df(0x119)];_0x1f1425[_0x1832df(0x13a)]({'name':_0x5a991e[_0x1832df(0xe5)],'dir':_0xd00a1d,'yaml':_0x5a991e,'systemPrompt':_0x290a23,'starterMessage':_0x109623});}}const _0x278e42=getKnowledgeBasesDir(_0x759efa);if(a122_0x1adbbf[_0x1832df(0x133)](_0x278e42)){const _0x22eafc=a122_0x1adbbf['readdirSync'](_0x278e42);for(const _0x12a669 of _0x22eafc){const _0x576d7a=a122_0x5aebba[_0x1832df(0x14a)](_0x278e42,_0x12a669);if(_0x12a669[_0x1832df(0x1bb)](_0x1832df(0xc3))){const _0x326871=parseKnowledgeBaseYaml(a122_0x1adbbf[_0x1832df(0x187)](_0x576d7a,'utf-8'),_0x576d7a);_0x1f9ea5[_0x1832df(0x13a)]({'name':_0x326871[_0x1832df(0xe5)],'path':_0x576d7a,'yaml':_0x326871});}else{if(_0x12a669[_0x1832df(0x1bb)](_0x1832df(0x15f))){const _0x5ab72b=a122_0x1adbbf['readFileSync'](_0x576d7a,_0x1832df(0x1b0)),{name:_0x569dcf,text:_0x1a4699}=parseTextKnowledgeBaseMd(_0x5ab72b,_0x12a669);_0x3cbdc3[_0x1832df(0x13a)]({'name':_0x569dcf,'path':_0x576d7a,'text':_0x1a4699});}}}}const _0x5d9768=getPromptsDir(_0x759efa);if(a122_0x1adbbf['existsSync'](_0x5d9768)){const _0x536308=a122_0x1adbbf[_0x1832df(0x10d)](_0x5d9768)[_0x1832df(0xf6)](_0x2f8b2e=>_0x2f8b2e[_0x1832df(0x1bb)]('.yml'));for(const _0x2ff3dd of _0x536308){const _0x50e93a=a122_0x5aebba[_0x1832df(0x14a)](_0x5d9768,_0x2ff3dd),_0x334c5d=parsePromptYaml(a122_0x1adbbf[_0x1832df(0x187)](_0x50e93a,_0x1832df(0x1b0)),_0x50e93a);_0x4e9395[_0x1832df(0x13a)]({'name':_0x334c5d[_0x1832df(0xe5)],'path':_0x50e93a,'yaml':_0x334c5d});}}const _0x4c91d2=getIntegrationsDir(_0x759efa);if(a122_0x1adbbf['existsSync'](_0x4c91d2)){const _0x5ed247=a122_0x1adbbf[_0x1832df(0x10d)](_0x4c91d2)[_0x1832df(0xf6)](_0x17b606=>_0x17b606[_0x1832df(0x1bb)]('.yml'));for(const _0x2750fa of _0x5ed247){const _0x4df9ff=a122_0x5aebba['join'](_0x4c91d2,_0x2750fa),_0x6769cc=parseIntegrationYaml(a122_0x1adbbf['readFileSync'](_0x4df9ff,_0x1832df(0x1b0)),_0x4df9ff);SAFE_INTEGRATION_TYPES[_0x1832df(0x1af)](_0x6769cc[_0x1832df(0x121)][_0x1832df(0xaf)]())?_0x10cbeb[_0x1832df(0x13a)]({'name':_0x6769cc['name'],'path':_0x4df9ff,'yaml':_0x6769cc}):this[_0x1832df(0x19d)][_0x1832df(0x11e)](_0x1832df(0xbd)+_0x6769cc[_0x1832df(0xe5)]+_0x1832df(0xbe)+_0x6769cc[_0x1832df(0x121)]+_0x1832df(0x16d)+(_0x1832df(0x194)+SAFE_INTEGRATION_TYPES['join'](',\x20')+_0x1832df(0x157)));}}const _0x4403cd=getExperimentalKnowledgeBasesDir(_0x759efa);if(a122_0x1adbbf[_0x1832df(0x133)](_0x4403cd)){const _0x2993da=a122_0x1adbbf[_0x1832df(0x10d)](_0x4403cd,{'withFileTypes':!![]});for(const _0x19066e of _0x2993da){if(!_0x19066e['isDirectory']())continue;const _0x250f97=a122_0x5aebba['join'](_0x4403cd,_0x19066e[_0x1832df(0xe5)]),_0x494f22=a122_0x5aebba[_0x1832df(0x14a)](_0x250f97,_0x19066e[_0x1832df(0xe5)]+_0x1832df(0xc3));if(a122_0x1adbbf['existsSync'](_0x494f22)){const _0x4d6b6e=parseExperimentalKnowledgeBaseYaml(a122_0x1adbbf[_0x1832df(0x187)](_0x494f22,'utf-8'),_0x494f22),_0x157167=a122_0x5aebba['join'](_0x250f97,_0x1832df(0x124)),_0x300b7e=[];if(a122_0x1adbbf[_0x1832df(0x133)](_0x157167)){const _0x20cb19=a122_0x1adbbf[_0x1832df(0x10d)](_0x157167,{'withFileTypes':!![]});for(const _0x5d67f4 of _0x20cb19){if(!_0x5d67f4[_0x1832df(0x180)]())continue;const _0x1baa57=a122_0x5aebba[_0x1832df(0x14a)](_0x157167,_0x5d67f4[_0x1832df(0xe5)]),_0x1ae9f=a122_0x5aebba[_0x1832df(0x14a)](_0x1baa57,_0x1832df(0x132)),_0x289039=a122_0x5aebba[_0x1832df(0x14a)](_0x1baa57,_0x1832df(0xdc));if(a122_0x1adbbf[_0x1832df(0x133)](_0x1ae9f)&&a122_0x1adbbf[_0x1832df(0x133)](_0x289039)){const _0x5b8777=a122_0x1adbbf[_0x1832df(0x187)](_0x1ae9f,_0x1832df(0x1b0)),_0x2e2cc8=a122_0x1adbbf[_0x1832df(0x187)](_0x289039,_0x1832df(0x1b0));_0x300b7e[_0x1832df(0x13a)]({'name':_0x5d67f4['name'],'code':_0x5b8777,'json_schema':_0x2e2cc8});}}}const _0xb6e47e={..._0x4d6b6e,'functions':_0x300b7e};_0x382833[_0x1832df(0x13a)]({'name':_0x4d6b6e[_0x1832df(0xe5)],'path':_0x250f97,'def':_0xb6e47e});}}}const _0x3075cb=getExperimentalArtifactsDir(_0x759efa);if(a122_0x1adbbf[_0x1832df(0x133)](_0x3075cb)){const _0x4d3755=a122_0x1adbbf[_0x1832df(0x10d)](_0x3075cb,{'withFileTypes':!![]});for(const _0x1065c9 of _0x4d3755){if(!_0x1065c9['isDirectory']())continue;const _0x1ff513=a122_0x5aebba[_0x1832df(0x14a)](_0x3075cb,_0x1065c9[_0x1832df(0xe5)]),_0x283484=a122_0x5aebba[_0x1832df(0x14a)](_0x1ff513,_0x1065c9['name']+_0x1832df(0xc3));if(a122_0x1adbbf['existsSync'](_0x283484)){const _0x338a18=parseExperimentalArtifactYaml(a122_0x1adbbf[_0x1832df(0x187)](_0x283484,_0x1832df(0x1b0)),_0x283484),_0x3b08b3=a122_0x5aebba[_0x1832df(0x14a)](_0x1ff513,_0x1832df(0x132)),_0x452427=a122_0x1adbbf['existsSync'](_0x3b08b3)?a122_0x1adbbf['readFileSync'](_0x3b08b3,_0x1832df(0x1b0)):'',_0x8c4765=a122_0x5aebba[_0x1832df(0x14a)](_0x1ff513,_0x1832df(0x109)),_0x430244=[];if(a122_0x1adbbf[_0x1832df(0x133)](_0x8c4765)){const _0xec671e=a122_0x1adbbf['readdirSync'](_0x8c4765);for(const _0x3ff1de of _0xec671e){const _0x233251=a122_0x5aebba[_0x1832df(0x14a)](_0x8c4765,_0x3ff1de);if(a122_0x1adbbf[_0x1832df(0xe7)](_0x233251)['isFile']()){const _0x594015=a122_0x1adbbf[_0x1832df(0x187)](_0x233251,_0x1832df(0x1b0));_0x430244['push']({'file_name':_0x3ff1de,'text_content':_0x594015});}}}const _0x505a13={..._0x338a18,'code':_0x452427,'files':_0x430244};_0x5e1cdb[_0x1832df(0x13a)]({'name':_0x338a18[_0x1832df(0xe5)],'path':_0x1ff513,'def':_0x505a13});}}}}else{const _0x4cb738=await this['resolveProjectId'](_0x759efa),_0x1abb2c=await this[_0x1832df(0x1a5)][_0x1832df(0xdb)](_0x4cb738);_0x52efac=_0x1abb2c['attributes'][_0x1832df(0xe5)];const _0x52ef19=await this['client'][_0x1832df(0xcf)](_0x4cb738),_0x296488=await this['client'][_0x1832df(0x148)](_0x4cb738),_0x41cf5e=await this[_0x1832df(0x1a5)][_0x1832df(0x1c1)](_0x4cb738),_0x417243=await this[_0x1832df(0x1a5)][_0x1832df(0xf3)](_0x4cb738),_0x5de2e7=await this['client']['listIntegrations'](_0x4cb738),_0x225088=await safeListOrEmpty(()=>this[_0x1832df(0x1a5)][_0x1832df(0xb1)](_0x4cb738)),_0x54a74a=await safeListOrEmpty(()=>this[_0x1832df(0x1a5)][_0x1832df(0x13c)](_0x4cb738)),_0x283d57=new Map(),_0x3df050=new Map(),_0x1ed00c=new Map(),_0x2525e5=new Map(),_0x180055=new Map(),_0x2cec63=new Map();for(const _0x3791ba of _0x296488){_0x283d57[_0x1832df(0x153)](_0x3791ba['id'],_0x3791ba['attributes']['name']);}for(const _0x14b5f9 of _0x41cf5e){_0x3df050[_0x1832df(0x153)](_0x14b5f9['id'],_0x14b5f9[_0x1832df(0xf0)][_0x1832df(0xe5)]);}for(const _0x58ddf2 of _0x52ef19){_0x1ed00c['set'](_0x58ddf2['id'],_0x58ddf2[_0x1832df(0xf0)]['name']);}for(const _0x21a334 of _0x417243){_0x2525e5[_0x1832df(0x153)](_0x21a334['id'],_0x21a334['attributes'][_0x1832df(0xe5)]);}for(const _0x3da622 of _0x225088){_0x180055[_0x1832df(0x153)](_0x3da622['id'],_0x3da622[_0x1832df(0xf0)][_0x1832df(0xe5)]);}for(const _0x56dd54 of _0x54a74a){_0x2cec63[_0x1832df(0x153)](_0x56dd54['id'],_0x56dd54[_0x1832df(0xf0)]['name']);}const _0x3f63c5={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x283d57,'TextKnowledgeBase':_0x3df050,'Agent':_0x1ed00c,'ExperimentalKnowledgeBase':_0x180055}),'resolvePromptName':async _0x5f1203=>_0x2525e5[_0x1832df(0x1a2)](_0x5f1203),'onWarning':_0x21f4ea=>this[_0x1832df(0x19d)][_0x1832df(0x11e)](_0x21f4ea)};for(const _0x20bee1 of _0x52ef19){const _0x875906=await agentResponseToDef(_0x20bee1,_0x3f63c5),{yaml:_0x1bb100,systemPrompt:_0x276410,starterMessage:_0x4f71d7}=_0x875906;_0x1f1425[_0x1832df(0x13a)]({'name':_0x1bb100[_0x1832df(0xe5)],'dir':'','yaml':_0x1bb100,'systemPrompt':_0x276410,'starterMessage':_0x4f71d7});}for(const _0x103632 of _0x296488){const _0xd0ce33=apiKnowledgeBaseToYaml(_0x103632);_0x1f9ea5[_0x1832df(0x13a)]({'name':_0xd0ce33['name'],'path':'','yaml':_0xd0ce33});}for(const _0x3165a1 of _0x41cf5e){_0x3cbdc3[_0x1832df(0x13a)]({'name':_0x3165a1[_0x1832df(0xf0)][_0x1832df(0xe5)],'path':'','text':_0x3165a1[_0x1832df(0xf0)][_0x1832df(0x1c2)]});}for(const _0x4f3ec3 of _0x417243){const _0x19d8ab=await apiPromptToYaml(_0x4f3ec3,_0x3f63c5);_0x19d8ab&&_0x4e9395[_0x1832df(0x13a)]({'name':_0x19d8ab['name'],'path':'','yaml':_0x19d8ab});}for(const _0xfa5e8f of _0x5de2e7){if(!_0xfa5e8f[_0x1832df(0xf0)]['isManaged']&&SAFE_INTEGRATION_TYPES[_0x1832df(0x1af)](_0xfa5e8f['attributes'][_0x1832df(0xa8)][_0x1832df(0xaf)]())){const _0x39a255=await apiIntegrationToYaml(_0xfa5e8f,_0x3f63c5);_0x10cbeb[_0x1832df(0x13a)]({'name':_0xfa5e8f[_0x1832df(0xf0)][_0x1832df(0xa8)][_0x1832df(0xaf)](),'path':'','yaml':_0x39a255});}}for(const _0xf9fd8f of _0x225088){const _0x2fc68c=apiExperimentalKnowledgeBaseToYaml(_0xf9fd8f);_0x382833[_0x1832df(0x13a)]({'name':_0x2fc68c[_0x1832df(0xe5)],'path':'','def':_0x2fc68c});}for(const _0x5c69c6 of _0x54a74a){const _0x50d1bc=apiExperimentalArtifactToYaml(_0x5c69c6);_0x5e1cdb['push']({'name':_0x50d1bc['name'],'path':'','def':_0x50d1bc});}}const _0xdc9dd7={'sourceProjectName':_0x52efac,'newProjectName':_0x457fb3,'newProjectId':'','agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'imageGenerators':[],'webSearchTools':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'imageGenerators':{'created':0x0,'errors':0x0},'webSearchTools':{'created':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x58f1a9=await this[_0x1832df(0x1a5)][_0x1832df(0xd9)](),_0x5d8aa6=_0x58f1a9[_0x1832df(0x15d)](_0x33a18b=>_0x33a18b['attributes']['name']===_0x457fb3);if(_0x5d8aa6)throw new SDKError(ErrorCode[_0x1832df(0x15c)],_0x1832df(0x141)+_0x457fb3+_0x1832df(0x19b),undefined,{'helpText':_0x1832df(0x143)});if(_0x210988?.[_0x1832df(0x13f)])return _0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x105)][_0x1832df(0xf7)]=_0x1f1425[_0x1832df(0x1b3)],_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x154)][_0x1832df(0xf7)]=_0x1f9ea5['length'],_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0xf4)][_0x1832df(0xf7)]=_0x3cbdc3['length'],_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x1b1)]['created']=_0x382833[_0x1832df(0x1b3)],_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0xc5)][_0x1832df(0xf7)]=_0x5e1cdb[_0x1832df(0x1b3)],_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x173)][_0x1832df(0xf7)]=_0x4e9395['length'],_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x126)][_0x1832df(0xf7)]=_0x10cbeb[_0x1832df(0x1b3)],_0xdc9dd7;const _0x5ca8e2=await this['client'][_0x1832df(0x1a9)]({'name':_0x457fb3}),_0x567d1a=_0x5ca8e2['id'];_0xdc9dd7[_0x1832df(0x15b)]=_0x567d1a;const _0x47b6bc=new Map(),_0x14b5ee=new Map(),_0x43daf2=new Map(),_0x37008d=new Map(),_0x3e1aac=new Map(),_0x16bb14=new Map(),_0x52bd5c=new Map(),_0x236f9a=new Map(),_0x5987be=new Set(),_0x4c9b28=new Set();for(const _0x2be3a6 of _0x1f1425){for(const _0x2d2662 of _0x2be3a6[_0x1832df(0x12a)][_0x1832df(0x115)]||[]){if(_0x2d2662['type']===_0x1832df(0x1c0)&&_0x2d2662[_0x1832df(0xe3)]){const _0x4f2dbd=parseRef(_0x2d2662['target']);if(_0x4f2dbd)_0x5987be[_0x1832df(0xd8)](_0x4f2dbd['name']);}else{if(_0x2d2662[_0x1832df(0x136)]===_0x1832df(0xb9)&&_0x2d2662[_0x1832df(0xe3)]){const _0x4a7312=parseRef(_0x2d2662['target']);if(_0x4a7312)_0x4c9b28[_0x1832df(0xd8)](_0x4a7312[_0x1832df(0xe5)]);}}}}for(const _0x1a601c of _0x5987be){try{const _0x16c83b=await this['client']['createImageGenerator']({'projectId':_0x567d1a,'name':_0x1a601c});_0x3e1aac[_0x1832df(0x153)](_0x1a601c,_0x16c83b['id']),_0xdc9dd7[_0x1832df(0x1b6)]['push']({'name':_0x1a601c,'action':_0x1832df(0xf7),'id':_0x16c83b['id']}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x1b6)][_0x1832df(0xf7)]++;}catch(_0x261171){_0xdc9dd7['imageGenerators'][_0x1832df(0x13a)]({'name':_0x1a601c,'action':_0x1832df(0xf8),'error':_0x261171[_0x1832df(0xd1)]}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x1b6)][_0x1832df(0xc1)]++;}}for(const _0xbe4f08 of _0x4c9b28){try{const _0x184a08=await this[_0x1832df(0x1a5)][_0x1832df(0x158)]({'projectId':_0x567d1a,'name':_0xbe4f08});_0x16bb14[_0x1832df(0x153)](_0xbe4f08,_0x184a08['id']),_0xdc9dd7['webSearchTools'][_0x1832df(0x13a)]({'name':_0xbe4f08,'action':'created','id':_0x184a08['id']}),_0xdc9dd7['counts'][_0x1832df(0x112)][_0x1832df(0xf7)]++;}catch(_0x2ad11b){_0xdc9dd7[_0x1832df(0x112)][_0x1832df(0x13a)]({'name':_0xbe4f08,'action':_0x1832df(0xf8),'error':_0x2ad11b[_0x1832df(0xd1)]}),_0xdc9dd7['counts']['webSearchTools'][_0x1832df(0xc1)]++;}}const _0x178c98=await fetchAllToolTargetMaps((_0x5987d4,_0x2ff2a4)=>this[_0x1832df(0x1a5)]['listToolTargets'](_0x5987d4,_0x2ff2a4),_0x567d1a);let _0x5741d7=[];const _0x40f079={'projectId':_0x567d1a,'resolveToolTargetId':buildIdResolver({..._0x178c98[_0x1832df(0x14b)],'KnowledgeBase':_0x47b6bc,'TextKnowledgeBase':_0x14b5ee,'ExperimentalKnowledgeBase':_0x52bd5c,'Agent':_0x43daf2,'WebSearchTool':_0x16bb14,'ImageGenerator':_0x3e1aac}),'resolvePromptId':async _0x38763a=>_0x37008d[_0x1832df(0x1a2)](_0x38763a),'onWarning':_0x21f12c=>{const _0xea7568=_0x1832df;this[_0xea7568(0x19d)]['warn'](_0x21f12c),_0x5741d7[_0xea7568(0x13a)](_0x21f12c);}};for(const _0x5a21df of _0x1f9ea5){try{const _0x28a818=yamlKnowledgeBaseToApi(_0x5a21df['yaml'],_0x567d1a),_0x2697af=await this[_0x1832df(0x1a5)][_0x1832df(0x12c)](_0x28a818);_0x47b6bc[_0x1832df(0x153)](_0x5a21df[_0x1832df(0x12a)][_0x1832df(0xe5)],_0x2697af['id']),_0xdc9dd7['knowledgeBases'][_0x1832df(0x13a)]({'name':_0x5a21df[_0x1832df(0x12a)][_0x1832df(0xe5)],'action':_0x1832df(0xf7),'id':_0x2697af['id']}),_0xdc9dd7['counts'][_0x1832df(0x154)][_0x1832df(0xf7)]++;}catch(_0x29d022){_0xdc9dd7[_0x1832df(0x154)][_0x1832df(0x13a)]({'name':_0x5a21df['yaml'][_0x1832df(0xe5)],'action':_0x1832df(0xf8),'error':_0x29d022[_0x1832df(0xd1)]}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x154)][_0x1832df(0xc1)]++;}}for(const _0x4d65cf of _0x3cbdc3){try{const _0x581cf8=yamlTextKnowledgeBaseToApi({'name':_0x4d65cf[_0x1832df(0xe5)],'text':_0x4d65cf['text']},_0x567d1a),_0x252218=await this[_0x1832df(0x1a5)][_0x1832df(0x107)](_0x581cf8);_0x14b5ee[_0x1832df(0x153)](_0x4d65cf[_0x1832df(0xe5)],_0x252218['id']),_0xdc9dd7[_0x1832df(0xf4)][_0x1832df(0x13a)]({'name':_0x4d65cf['name'],'action':_0x1832df(0xf7),'id':_0x252218['id']}),_0xdc9dd7['counts'][_0x1832df(0xf4)]['created']++;}catch(_0x19498b){_0xdc9dd7[_0x1832df(0xf4)][_0x1832df(0x13a)]({'name':_0x4d65cf[_0x1832df(0xe5)],'action':_0x1832df(0xf8),'error':_0x19498b[_0x1832df(0xd1)]}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0xf4)][_0x1832df(0xc1)]++;}}for(const _0x33b6fd of _0x5e1cdb){try{const _0x45004b=yamlExperimentalArtifactToApi(_0x33b6fd[_0x1832df(0xf2)],_0x567d1a),_0x59fe18=await this['client'][_0x1832df(0xa6)](_0x45004b);_0x236f9a[_0x1832df(0x153)](_0x33b6fd[_0x1832df(0xf2)][_0x1832df(0xe5)],_0x59fe18['id']),_0xdc9dd7[_0x1832df(0xc5)][_0x1832df(0x13a)]({'name':_0x33b6fd['def'][_0x1832df(0xe5)],'action':_0x1832df(0xf7),'id':_0x59fe18['id']}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0xc5)][_0x1832df(0xf7)]++;}catch(_0x5d582e){_0xdc9dd7[_0x1832df(0xc5)]['push']({'name':_0x33b6fd[_0x1832df(0xf2)][_0x1832df(0xe5)],'action':_0x1832df(0xf8),'error':_0x5d582e[_0x1832df(0xd1)]}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0xc5)]['errors']++;}}for(const _0x1fda77 of _0x382833){try{const _0x57acb2=yamlExperimentalKnowledgeBaseToApi(_0x1fda77[_0x1832df(0xf2)],_0x567d1a),_0x1cae75=await this[_0x1832df(0x1a5)][_0x1832df(0x1ad)](_0x57acb2);_0x52bd5c[_0x1832df(0x153)](_0x1fda77[_0x1832df(0xf2)][_0x1832df(0xe5)],_0x1cae75['id']),_0xdc9dd7[_0x1832df(0x1b1)][_0x1832df(0x13a)]({'name':_0x1fda77[_0x1832df(0xf2)][_0x1832df(0xe5)],'action':_0x1832df(0xf7),'id':_0x1cae75['id']}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x1b1)][_0x1832df(0xf7)]++;}catch(_0x3dab7c){_0xdc9dd7[_0x1832df(0x1b1)]['push']({'name':_0x1fda77[_0x1832df(0xf2)][_0x1832df(0xe5)],'action':'error','error':_0x3dab7c[_0x1832df(0xd1)]}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x1b1)][_0x1832df(0xc1)]++;}}const _0x53a4a5=[..._0x1f1425][_0x1832df(0x13b)]((_0x2a316c,_0x4f4005)=>{const _0x35fb01=_0x1832df,_0xaf93b3=_0x2a316c[_0x35fb01(0x12a)][_0x35fb01(0x115)]?.[_0x35fb01(0x176)](_0x44ca58=>_0x44ca58[_0x35fb01(0x136)]===_0x35fb01(0x108))??![],_0x30c543=_0x4f4005['yaml'][_0x35fb01(0x115)]?.['some'](_0x71a989=>_0x71a989[_0x35fb01(0x136)]===_0x35fb01(0x108))??![];if(_0xaf93b3&&!_0x30c543)return 0x1;if(!_0xaf93b3&&_0x30c543)return-0x1;return 0x0;});for(const _0x2b50f8 of _0x53a4a5){_0x5741d7=[];try{const _0x3ec64c=_0x2b50f8[_0x1832df(0x12a)][_0x1832df(0x115)]?.[_0x1832df(0xf6)](_0x25c0e4=>{const _0xe9c1ac=_0x1832df;if(_0x25c0e4[_0xe9c1ac(0x136)]==='agent'&&_0x25c0e4[_0xe9c1ac(0xe3)]){const _0x505ad4=parseRef(_0x25c0e4['target']);return _0x505ad4?.['name']===_0x2b50f8[_0xe9c1ac(0x12a)][_0xe9c1ac(0xe5)];}return![];})??[];if(_0x3ec64c['length']>0x0){const _0x1aed8b=_0x1832df(0x11a)+_0x2b50f8[_0x1832df(0x12a)][_0x1832df(0xe5)]+'\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20'+_0x1832df(0x1a1);this[_0x1832df(0x19d)][_0x1832df(0x11e)](_0x1aed8b),_0x5741d7[_0x1832df(0x13a)](_0x1aed8b);}const _0x41a396=await agentDefToRequest(_0x2b50f8[_0x1832df(0x12a)],_0x2b50f8[_0x1832df(0x196)],_0x2b50f8['starterMessage'],_0x40f079),_0x23f8e4=await this[_0x1832df(0x1a5)][_0x1832df(0xd5)](_0x41a396);_0x43daf2[_0x1832df(0x153)](_0x2b50f8[_0x1832df(0x12a)][_0x1832df(0xe5)],_0x23f8e4['id']),_0xdc9dd7[_0x1832df(0x105)][_0x1832df(0x13a)]({'agentName':_0x2b50f8[_0x1832df(0x12a)][_0x1832df(0xe5)],'action':_0x1832df(0xf7),'agentId':_0x23f8e4['id'],'warnings':_0x5741d7[_0x1832df(0x1b3)]>0x0?_0x5741d7:undefined}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x105)][_0x1832df(0xf7)]++;}catch(_0x392fb6){_0xdc9dd7[_0x1832df(0x105)][_0x1832df(0x13a)]({'agentName':_0x2b50f8[_0x1832df(0x12a)]['name'],'action':_0x1832df(0xf8),'error':_0x392fb6['message'],'warnings':_0x5741d7['length']>0x0?_0x5741d7:undefined}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x105)][_0x1832df(0xc1)]++;}}for(const _0xec626f of _0x4e9395){try{const _0x5bc82e=await yamlPromptToApi(_0xec626f['yaml'],_0x567d1a,_0x40f079);if(!_0x5bc82e){_0xdc9dd7[_0x1832df(0x173)][_0x1832df(0x13a)]({'name':_0xec626f['yaml'][_0x1832df(0xe5)],'action':_0x1832df(0xf8),'error':_0x1832df(0x113)}),_0xdc9dd7['counts'][_0x1832df(0x173)][_0x1832df(0xc1)]++;continue;}const _0x4913dc=await this[_0x1832df(0x1a5)]['createPrompt'](_0x5bc82e);_0x37008d[_0x1832df(0x153)](_0xec626f[_0x1832df(0x12a)][_0x1832df(0xe5)],_0x4913dc['id']),_0xdc9dd7['prompts'][_0x1832df(0x13a)]({'name':_0xec626f['yaml']['name'],'action':'created','id':_0x4913dc['id']}),_0xdc9dd7['counts']['prompts'][_0x1832df(0xf7)]++;}catch(_0x5359d5){_0xdc9dd7[_0x1832df(0x173)][_0x1832df(0x13a)]({'name':_0xec626f[_0x1832df(0x12a)][_0x1832df(0xe5)],'action':_0x1832df(0xf8),'error':_0x5359d5[_0x1832df(0xd1)]}),_0xdc9dd7[_0x1832df(0x10e)]['prompts'][_0x1832df(0xc1)]++;}}for(const _0x1d3536 of _0x10cbeb){try{const _0xf2f32=await yamlIntegrationToApi(_0x1d3536[_0x1832df(0x12a)],_0x567d1a,_0x40f079),_0xf06f0e=await this[_0x1832df(0x1a5)][_0x1832df(0x1ab)](_0xf2f32);_0xdc9dd7[_0x1832df(0x126)]['push']({'name':_0x1d3536['yaml'][_0x1832df(0x121)],'action':_0x1832df(0xf7),'id':_0xf06f0e['id']}),_0xdc9dd7[_0x1832df(0x10e)][_0x1832df(0x126)][_0x1832df(0xf7)]++;}catch(_0x59ec36){_0xdc9dd7[_0x1832df(0x126)][_0x1832df(0x13a)]({'name':_0x1d3536[_0x1832df(0x12a)]['service_type'],'action':'error','error':_0x59ec36[_0x1832df(0xd1)]}),_0xdc9dd7['counts'][_0x1832df(0x126)]['errors']++;}}return _0xdc9dd7;}}
|
|
1
|
+
const a122_0x29cadd=a122_0xbc78;(function(_0x46b613,_0x1b1eab){const _0x58c959=a122_0xbc78,_0xde3f0e=_0x46b613();while(!![]){try{const _0x5e09fc=parseInt(_0x58c959(0x1ad))/0x1+parseInt(_0x58c959(0x183))/0x2+-parseInt(_0x58c959(0xdb))/0x3*(-parseInt(_0x58c959(0xe7))/0x4)+parseInt(_0x58c959(0x181))/0x5+parseInt(_0x58c959(0x1a1))/0x6*(parseInt(_0x58c959(0x1bc))/0x7)+-parseInt(_0x58c959(0x119))/0x8+parseInt(_0x58c959(0xdd))/0x9*(-parseInt(_0x58c959(0xcb))/0xa);if(_0x5e09fc===_0x1b1eab)break;else _0xde3f0e['push'](_0xde3f0e['shift']());}catch(_0x251260){_0xde3f0e['push'](_0xde3f0e['shift']());}}}(a122_0x535c,0xd40fa));import{LLMApiClient}from'../client/llm-api-client.js';import*as a122_0x1debea from'node:fs';function a122_0xbc78(_0x25cb77,_0x478d3b){_0x25cb77=_0x25cb77-0xbf;const _0x535c87=a122_0x535c();let _0xbc78aa=_0x535c87[_0x25cb77];return _0xbc78aa;}import*as a122_0x52c3ab from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{SDKError,ErrorCode,errorContains}from'../errors.js';import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir}from'../agent/agent-config.js';import{getSanitizedUsername,generateRandomHex}from'../../utils/string-utils.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a122_0x535c(){const _0x2bf0e8=['nameToId','chatId','medium','\x0a---\x20code\x20---\x0a','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','getBackupMetadata','mkdirSync','listKnowledgeBases','_reasoning_','profile','getChatLog','service_type','version','low','listImageGenerators','description','get','UNAUTHENTICATED','resolveAgentId','tables','continueChat','updateTextKnowledgeBase','isManaged','getDefaultProjectName','---\x20file:\x20','#\x20prompt.md\x0a','localeCompare','chat','deleteIntegration','displayName','Renamed\x20experimental\x20artifact\x20directory:\x20','includes','updateExperimentalKnowledgeBase','knowledgebases.json','prompts.json','outputs','high','LLM_PROJECT_NOT_FOUND','Renamed\x20experimental\x20KB\x20directory:\x20','Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.','\x20attempts\x20due\x20to\x20name\x20conflicts.','integrations.json','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Agent\x20not\x20found:\x20','.md','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','\x0a\x0a#\x20agent.yml\x0a','readFileSync','getUserSettings','\x22\x20already\x20exists','minimal','maxToolIterations','chats','tdx_default_','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','yaml','find','parse','resolveProjectId','project.json','tdx_','counts','Renamed\x20integration\x20file:\x20','(dry-run)','createAgent','serviceType','listWebSearchTools','1443665sCTGHX','listExperimentalKnowledgeBases','2473434PDnEsQ','join','cwd','projects','writeFileSync','experimental_artifacts','filter','getChatHistory','toISOString','functions','createAgentResponse','client','project','updatePrompt','endsWith','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','agents','.yml','split','pushAgent','already\x20exists','pullAgent','conflict','):\x20','loadJsonFile','promptId','chat_agent_console','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','pushProject','1016742qmpEju','code','dryRun','\x0a---\x20function:\x20','content','listExperimentalArtifacts','ALREADY_EXISTS','Unresolved\x20dependencies:\x20','agents.json','isDir','knowledge_bases','Project\x20not\x20found:\x20','681647hhJJqB','deleteAgent','experimentalKnowledgeBases',')\x20can\x20be\x20cloned.','\x20---\x0a','map','oldPath','keys','dirname','Multiple\x20projects\x20found\x20with\x20name\x20\x27','createPrompt','\x27.\x20This\x20should\x20not\x20happen.','utf-8','none','duplicate','7AsjrUh','target','chat_parent_segment','experimental_knowledge_bases','listTextKnowledgeBases','createProject','No\x20tdx.json\x20found\x20in\x20','json_schema.json','exportedFrom','tools','size','warn','starterMessage','web_search','Renamed\x20KB\x20file:\x20','status','startChat','clearDefaultAgent','\x20→\x20','existsSync','createIntegration','unchanged','reasoningEffort','availableModelNames','basename','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','---\x20schema:\x20','listChats','\x0a---\x20schema:\x20','prompt.md','Agent\x20\x27','updated','dry-run-','llm_project','NOT_FOUND','starter_message','imageGenerators','sdk.llm','knowledgeBases','updateAgent','text','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','webSearchTools','code.js','resolveProjectName','.llm','files','agent','push','chatIgnoreManagedActions','3079310xGtvSL','getOrCreateDefaultAgent','variables','listPrompts','tdx.json','listAgents','created','path','Removed\x20deleted\x20directory:\x20','errors','template','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','getProject','Renamed\x20folder:\x20','listIntegrations','\x27\x20(','24fSHeeR','starter_message.md','63TmJMHt','1.0','unlinkSync','agent.yml','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','backupProject','setDefaultAgent','rmSync','createKnowledgeBase','add','451556yndwkS','createExperimentalKnowledgeBase','Output\x20directory\x20already\x20exists:\x20','isDirectory','sort','getOrCreateDefaultProject','signal','readdirSync','AGENT_NOT_FOUND','updateAgentResponse','json_schema','length','getAgent','total','action','\x20in\x20project\x20','context','PERMISSION_DENIED','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','listToolTargets','systemPrompt','text_content','chat_generic','renamed','info','setCurrentProject','Invalid\x20agent\x20reference\x20format:\x20','toLowerCase','listAgentsFull','projectName','Available\x20agents:\x20','availableModels','set','experimentalArtifacts','Backup\x20folder\x20not\x20found:\x20','getCurrentProject','newProjectId','name','file_name','Use\x20\x22tdx\x20llm\x20use\x20<project>\x22\x20to\x20set\x20a\x20project\x20context\x20first,\x20or\x20use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20all\x20agents.','INTERNAL','createExperimentalArtifact','createTextKnowledgeBase','has','message','logger','agentsFull','def','modelType','error','2044376fFybAc','slackMessageMode','webhookCorsOrigins','Renamed\x20text\x20KB\x20file:\x20','attributes','Only\x20safe\x20types\x20(','statSync','Agent\x20reference\x20not\x20found','history','prompts','Renamed\x20agent\x20folder:\x20','Unsupported\x20backup\x20version:\x20','image_gen','type','metadata','textKnowledgeBases','INVALID_ARGUMENT','KnowledgeBase','tdDatabaseName','isFile','currentProjectId','Multiple\x20agents\x20found\x20with\x20name\x20\x27','some','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.',')\x20can\x20be\x20pushed.\x20','new','stringify','listProjects','pullProject','restoreProject','agentId','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','idToName','integrations','Project\x20\x22','dir','site'];a122_0x535c=function(){return _0x2bf0e8;};return a122_0x535c();}import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';export const SAFE_INTEGRATION_TYPES=[a122_0x29cadd(0xfd),a122_0x29cadd(0x19d),a122_0x29cadd(0x1be)];async function safeListOrEmpty(_0x1bbf5d){const _0x425cf6=a122_0x29cadd;try{return await _0x1bbf5d();}catch(_0x40a276){if(_0x40a276 instanceof HTTPClientError&&_0x40a276[_0x425cf6(0x1cb)]===0x194)return[];throw _0x40a276;}}export class LLMSDK{[a122_0x29cadd(0x12d)];[a122_0x29cadd(0x18e)];[a122_0x29cadd(0xf7)];[a122_0x29cadd(0x114)]=Logger['of'](a122_0x29cadd(0x1e1));constructor(_0x14c319){const _0x2fd0c3=a122_0x29cadd;this['client']=new LLMApiClient(_0x14c319),this[_0x2fd0c3(0xf7)]=_0x14c319;}[a122_0x29cadd(0x155)](){const _0x16e290=a122_0x29cadd,_0x362c18=getSanitizedUsername();return _0x16e290(0x173)+_0x362c18;}async[a122_0x29cadd(0x100)](_0x13d02d){const _0x14bdf8=a122_0x29cadd,{projectId:_0x3f60be}=await this[_0x14bdf8(0xc5)](_0x13d02d);this[_0x14bdf8(0x12d)]=_0x3f60be;}[a122_0x29cadd(0x10a)](){const _0x4cbb0e=a122_0x29cadd;return this[_0x4cbb0e(0x12d)];}async[a122_0x29cadd(0xe3)](_0x3a5c92){const _0x1b93f1=a122_0x29cadd,_0x1e93b9=this[_0x1b93f1(0xf7)][_0x1b93f1(0x147)];let _0xa41fa4,_0xe26b5b;if(_0x3a5c92[_0x1b93f1(0x15d)]('/')){const _0x1f4f06=_0x3a5c92[_0x1b93f1(0x195)]('/');if(_0x1f4f06[_0x1b93f1(0xf2)]!==0x2)throw new SDKError(ErrorCode[_0x1b93f1(0x129)],_0x1b93f1(0x101)+_0x3a5c92,undefined,{'helpText':_0x1b93f1(0x19e)});const [_0x1ba9b1,_0x21a111]=_0x1f4f06;_0xa41fa4=await this[_0x1b93f1(0x178)](_0x1ba9b1),_0xe26b5b=_0x21a111;}else _0xa41fa4=this[_0x1b93f1(0x12d)]||(await this[_0x1b93f1(0xec)]())['id'],_0xe26b5b=_0x3a5c92;const _0x1a321b=await this[_0x1b93f1(0x150)](_0xe26b5b,_0xa41fa4),_0x4a2a9c=await this['client']['getAgent'](_0x1a321b);writeCachedLLMAgent(_0x4a2a9c[_0x1b93f1(0x11d)][_0x1b93f1(0x10c)],_0x1a321b,_0xa41fa4,_0x1e93b9);}['getDefaultAgent'](){const _0x380970=a122_0x29cadd,_0x37529c=this['context'][_0x380970(0x147)];return readCachedLLMAgent(_0x37529c)||undefined;}[a122_0x29cadd(0x1cd)](){const _0x497242=a122_0x29cadd,_0x30ed9a=this[_0x497242(0xf7)]['profile'];clearCachedLLMAgent(_0x30ed9a);}async['models'](){const _0x4b4171=a122_0x29cadd,_0x52cdcc=await this[_0x4b4171(0x18e)][_0x4b4171(0x16e)](),_0x3e1f16=[];for(const _0x2d3cc4 of _0x52cdcc[_0x4b4171(0x1d3)]){const _0x4475da=_0x52cdcc[_0x4b4171(0x106)][_0x2d3cc4];_0x4475da&&_0x3e1f16[_0x4b4171(0xc9)]({'name':_0x2d3cc4,'displayName':_0x4475da[_0x4b4171(0x15b)]});}return _0x3e1f16;}async['createProject'](_0x1495b2){const _0x10fe98=a122_0x29cadd;return await this[_0x10fe98(0x18e)][_0x10fe98(0x1c1)](_0x1495b2);}async['deleteProject'](_0x4b6fa6){const _0x51ba3e=a122_0x29cadd,{projectId:_0x8432e7}=await this[_0x51ba3e(0xc5)](_0x4b6fa6);await this[_0x51ba3e(0x18e)]['deleteProject'](_0x8432e7);}async[a122_0x29cadd(0x186)](_0x24a061=0x32){const _0x14a00d=a122_0x29cadd;return await this['client'][_0x14a00d(0x134)](_0x24a061);}async[a122_0x29cadd(0xec)](_0x49962e){const _0x4e0968=a122_0x29cadd,_0x2526ef=_0x49962e||this[_0x4e0968(0x155)](),_0x28a813=this['context'][_0x4e0968(0x147)];if(!_0x49962e){const _0x52b00a=readCachedLLMProject(_0x28a813);if(_0x52b00a&&_0x52b00a['name']===_0x2526ef)try{const _0x35e969=await this[_0x4e0968(0x18e)][_0x4e0968(0xd7)](_0x52b00a['id']);if(_0x35e969[_0x4e0968(0x11d)][_0x4e0968(0x10c)]===_0x2526ef)return _0x35e969;}catch{}}const _0x15082e=await this['client']['listProjects'](),_0x48e196=_0x15082e[_0x4e0968(0x176)](_0x38eecc=>_0x38eecc['attributes'][_0x4e0968(0x10c)]===_0x2526ef);if(_0x48e196)return!_0x49962e&&writeCachedLLMProject(_0x2526ef,_0x48e196['id'],_0x28a813),_0x48e196;const _0x20bcd9=await this[_0x4e0968(0x18e)]['createProject']({'name':_0x2526ef,'description':_0x4e0968(0x19f)+getSanitizedUsername()+')'});return!_0x49962e&&writeCachedLLMProject(_0x2526ef,_0x20bcd9['id'],_0x28a813),_0x20bcd9;}async[a122_0x29cadd(0x178)](_0x241698){const _0x42e7ae=a122_0x29cadd,_0x1affaa=await this[_0x42e7ae(0x18e)]['listProjects'](),_0x197aaa=_0x1affaa[_0x42e7ae(0x189)](_0x49af18=>_0x49af18[_0x42e7ae(0x11d)][_0x42e7ae(0x10c)]===_0x241698);if(_0x197aaa[_0x42e7ae(0xf2)]===0x0)throw new SDKError(ErrorCode[_0x42e7ae(0x163)],'Project\x20not\x20found:\x20'+_0x241698,undefined,{'helpText':_0x42e7ae(0x174)});if(_0x197aaa[_0x42e7ae(0xf2)]>0x1)throw new SDKError(ErrorCode[_0x42e7ae(0x10f)],_0x42e7ae(0x1b6)+_0x241698+_0x42e7ae(0x1b8));return _0x197aaa[0x0]['id'];}async[a122_0x29cadd(0xc5)](_0x242ae3){const _0x1682e2=a122_0x29cadd,_0x383d0e=await this[_0x1682e2(0x18e)][_0x1682e2(0x134)](),_0x47cc44=_0x383d0e['find'](_0x2654e2=>_0x2654e2['attributes'][_0x1682e2(0x10c)]===_0x242ae3);if(_0x47cc44)return{'projectId':_0x47cc44['id'],'project':_0x47cc44};throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x1682e2(0x1ac)+_0x242ae3,undefined,{'helpText':_0x1682e2(0x174)});}async[a122_0x29cadd(0xcc)](_0x4f5be4='claude-4.5-sonnet',_0x555a86=0x0,_0x4ff71c){const _0x5de3d3=a122_0x29cadd,_0x326532=0xa;let _0x60403f=0x0,_0x16e9d8;while(_0x60403f<_0x326532){try{const _0x33278c=await this[_0x5de3d3(0xec)](_0x16e9d8),_0x111356=_0x33278c['id'],_0x46bd08=[_0x5de3d3(0x1ba),_0x5de3d3(0x170),_0x5de3d3(0x14b),_0x5de3d3(0x140),_0x5de3d3(0x162)],_0x497c9e=_0x555a86===0x0?_0x5de3d3(0x17a)+_0x4f5be4:'tdx_'+_0x4f5be4+_0x5de3d3(0x146)+_0x46bd08[_0x555a86],_0x5b656f=await this[_0x5de3d3(0x18e)][_0x5de3d3(0xd0)](_0x111356),_0x206bb4=_0x5b656f[_0x5de3d3(0x176)](_0x4c3128=>_0x4c3128[_0x5de3d3(0x11d)][_0x5de3d3(0x10c)]===_0x497c9e);if(_0x206bb4)return _0x206bb4;const _0xa9a8ad=_0x555a86>0x0?0x1:_0x4ff71c;return await this['client'][_0x5de3d3(0x17e)]({'name':_0x497c9e,'projectId':_0x111356,'modelType':_0x4f5be4,'systemPrompt':'','temperature':_0xa9a8ad,'reasoningEffort':_0x555a86>0x0?_0x555a86:undefined});}catch(_0x37f046){if(_0x37f046 instanceof HTTPClientError){const _0x1f931=_0x37f046[_0x5de3d3(0x1cb)];if(_0x1f931>=0x190&&_0x1f931<0x1f4){if(_0x1f931===0x191)throw new SDKError(ErrorCode[_0x5de3d3(0x14f)],_0x5de3d3(0x138),_0x37f046);else{if(_0x1f931===0x193)throw new SDKError(ErrorCode[_0x5de3d3(0xf8)],'Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.',_0x37f046);}throw _0x37f046;}}if(errorContains(_0x37f046,_0x5de3d3(0x197),_0x5de3d3(0x1bb),_0x5de3d3(0x199))){_0x60403f++;if(_0x60403f>=_0x326532)throw new SDKError(ErrorCode[_0x5de3d3(0x1a7)],'Unable\x20to\x20create\x20project\x20after\x20'+_0x326532+_0x5de3d3(0x166),_0x37f046);const _0x413335=this[_0x5de3d3(0x155)]();_0x16e9d8=_0x413335+'_'+generateRandomHex();continue;}throw _0x37f046;}}throw new SDKError(ErrorCode[_0x5de3d3(0x10f)],_0x5de3d3(0x142));}async['resolveAgentId'](_0x580099,_0x36359c){const _0x591908=a122_0x29cadd,_0x5b5ab3=_0x36359c||this[_0x591908(0x12d)],_0x45049a=await this[_0x591908(0x18e)][_0x591908(0xd0)](_0x5b5ab3),_0x58dc75=_0x45049a[_0x591908(0x189)](_0x4c8c4d=>_0x4c8c4d[_0x591908(0x11d)]['name']===_0x580099);if(_0x58dc75[_0x591908(0xf2)]===0x0){const _0x567d36=_0x5b5ab3?_0x591908(0xf6)+_0x5b5ab3:'';throw new SDKError(ErrorCode[_0x591908(0xef)],_0x591908(0x169)+_0x580099+_0x567d36,undefined,{'helpText':_0x5b5ab3?_0x591908(0xe1):_0x591908(0x10e)});}if(_0x58dc75['length']>0x1)throw new SDKError(ErrorCode['INTERNAL'],_0x591908(0x12e)+_0x580099+'\x27.\x20This\x20should\x20not\x20happen.');return _0x58dc75[0x0]['id'];}async['agents'](_0x20e802){const _0x225d80=a122_0x29cadd,_0x1a6ac3=_0x20e802||this['currentProjectId'];return await this['client'][_0x225d80(0xd0)](_0x1a6ac3);}async[a122_0x29cadd(0x115)](_0x594cc7){const _0x4adff9=a122_0x29cadd;return await this[_0x4adff9(0x18e)][_0x4adff9(0x103)](_0x594cc7);}async[a122_0x29cadd(0xc8)](_0x35af02){const _0x1d3f0d=a122_0x29cadd;return await this['client'][_0x1d3f0d(0xf3)](_0x35af02);}async[a122_0x29cadd(0x17e)](_0xd2a49b){const _0x3b9d96=a122_0x29cadd;return await this[_0x3b9d96(0x18e)]['createAgent'](_0xd2a49b);}async[a122_0x29cadd(0xc0)](_0x8524f2,_0x504ea3){const _0x59a58d=a122_0x29cadd;return await this[_0x59a58d(0x18e)][_0x59a58d(0xc0)](_0x8524f2,_0x504ea3);}async[a122_0x29cadd(0x1ae)](_0x4bc312){const _0x2688a8=a122_0x29cadd;await this[_0x2688a8(0x18e)][_0x2688a8(0x1ae)](_0x4bc312);}async[a122_0x29cadd(0x1cc)](_0x18fdee){const _0x4bb582=a122_0x29cadd;return await this[_0x4bb582(0x18e)][_0x4bb582(0x1cc)]({'agentId':_0x18fdee});}async*[a122_0x29cadd(0x159)](_0x4c3a51,_0x59c58b){const _0x18c522=a122_0x29cadd;let _0x2bd899=_0x59c58b?.[_0x18c522(0x13f)];const _0x4bd9c9=_0x59c58b?.[_0x18c522(0x137)];if(!_0x2bd899){if(!_0x4bd9c9)throw new Error('agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat');const _0x1e3af1=await this[_0x18c522(0x18e)]['startChat']({'agentId':_0x4bd9c9});_0x2bd899=_0x1e3af1['id'],yield{'type':_0x18c522(0x127),'data':{'chatId':_0x2bd899,'agentId':_0x4bd9c9,'projectId':_0x1e3af1['attributes']['projectId']}};}for await(const _0xcae422 of this[_0x18c522(0x18e)][_0x18c522(0x152)](_0x2bd899,_0x4c3a51,_0x59c58b?.[_0x18c522(0xed)])){yield{'type':'event','data':_0xcae422};}}async[a122_0x29cadd(0x172)](_0x362ad2=0x32){const _0x59fd05=a122_0x29cadd;return await this[_0x59fd05(0x18e)][_0x59fd05(0x1d7)](_0x362ad2);}async[a122_0x29cadd(0x121)](_0x17a6da){const _0x4deb59=a122_0x29cadd;return await this[_0x4deb59(0x18e)][_0x4deb59(0x18a)](_0x17a6da);}async[a122_0x29cadd(0x148)](_0x2ec91c){const _0x3c2715=a122_0x29cadd;return await this[_0x3c2715(0x18e)][_0x3c2715(0x148)](_0x2ec91c);}async['chatInfo'](_0x2d0d84){return await this['client']['getChatInfo'](_0x2d0d84);}async[a122_0x29cadd(0xe2)](_0x3c9b74,_0x4fdc0f,_0x272a34){const _0x54c777=a122_0x29cadd,_0x196533=_0x272a34?.[_0x54c777(0x1a3)]??![],{projectId:_0x5b14ee,project:_0x2ab8c7}=await this[_0x54c777(0xc5)](_0x3c9b74),_0x3b56b6=_0x2ab8c7[_0x54c777(0x11d)][_0x54c777(0x10c)],_0x1173d9=_0x4fdc0f||_0x3b56b6+_0x54c777(0xc6);if(a122_0x1debea[_0x54c777(0x1cf)](_0x1173d9)&&!_0x196533)throw new SDKError(ErrorCode[_0x54c777(0x1a7)],_0x54c777(0xe9)+_0x1173d9,undefined,{'helpText':_0x54c777(0x130)});const _0xec5652=await this[_0x54c777(0x18e)][_0x54c777(0x103)](_0x5b14ee),_0x5ac96d=await this[_0x54c777(0x18e)][_0x54c777(0x145)](_0x5b14ee),_0x37783b=await this[_0x54c777(0x18e)][_0x54c777(0xce)](_0x5b14ee),_0x2c4245=await this[_0x54c777(0x18e)]['listIntegrations'](_0x5b14ee);if(!_0x196533){a122_0x1debea[_0x54c777(0x144)](_0x1173d9,{'recursive':!![]});const _0x431ce1={'version':_0x54c777(0xde),'exportedAt':new Date()[_0x54c777(0x18b)](),'exportedFrom':{'site':this[_0x54c777(0xf7)]['site'],'projectId':_0x5b14ee,'projectName':_0x3b56b6},'project':_0x2ab8c7};a122_0x1debea['writeFileSync'](a122_0x52c3ab[_0x54c777(0x184)](_0x1173d9,_0x54c777(0x179)),JSON[_0x54c777(0x133)](_0x431ce1,null,0x2)),a122_0x1debea['writeFileSync'](a122_0x52c3ab[_0x54c777(0x184)](_0x1173d9,_0x54c777(0x1a9)),JSON[_0x54c777(0x133)](_0xec5652,null,0x2)),a122_0x1debea[_0x54c777(0x187)](a122_0x52c3ab['join'](_0x1173d9,'knowledgebases.json'),JSON[_0x54c777(0x133)](_0x5ac96d,null,0x2)),a122_0x1debea[_0x54c777(0x187)](a122_0x52c3ab[_0x54c777(0x184)](_0x1173d9,_0x54c777(0x160)),JSON['stringify'](_0x37783b,null,0x2)),a122_0x1debea[_0x54c777(0x187)](a122_0x52c3ab['join'](_0x1173d9,'integrations.json'),JSON['stringify'](_0x2c4245,null,0x2));}return{'projectName':_0x3b56b6,'outputDir':_0x1173d9,'counts':{'agents':_0xec5652[_0x54c777(0xf2)],'knowledgeBases':_0x5ac96d['length'],'prompts':_0x37783b[_0x54c777(0xf2)],'integrations':_0x2c4245[_0x54c777(0xf2)]}};}async[a122_0x29cadd(0x136)](_0x5b58d3,_0x225ce7){const _0x515da8=a122_0x29cadd,_0x18830e=_0x225ce7?.['dryRun']??![],_0x9fdcb=this[_0x515da8(0x143)](_0x5b58d3),_0x198ac4=_0x9fdcb[_0x515da8(0x1c4)][_0x515da8(0x13d)],_0x4d339d=this[_0x515da8(0xf7)]['site'],_0x4be891=_0x198ac4!==_0x4d339d?_0x198ac4:undefined,_0x34b7a6=this[_0x515da8(0x19b)](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x1a9)),[]),_0x307e17=this['loadJsonFile'](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x15f)),[]),_0x54f104=this[_0x515da8(0x19b)](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x160)),[]),_0x12571e=this[_0x515da8(0x19b)](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x167)),[]),_0x1b7c2f=_0x225ce7?.[_0x515da8(0x10c)]||_0x9fdcb[_0x515da8(0x1c4)][_0x515da8(0x104)];if(_0x18830e){const _0x4f33f8=new Map(),_0x549bff=[..._0x34b7a6],_0x16c67f=_0x34b7a6[_0x515da8(0xf2)]+0x1;let _0x2e9761=0x0;while(_0x549bff[_0x515da8(0xf2)]>0x0&&_0x2e9761<_0x16c67f){_0x2e9761++;const _0x3702a5=[];for(const _0x12d5fd of _0x549bff){canCreateAgent(_0x12d5fd,_0x4f33f8)?_0x4f33f8['set'](_0x12d5fd['id'],_0x515da8(0x1dc)+_0x12d5fd['id']):_0x3702a5[_0x515da8(0xc9)](_0x12d5fd);}if(_0x3702a5[_0x515da8(0xf2)]===_0x549bff[_0x515da8(0xf2)])throw new SDKError(ErrorCode[_0x515da8(0x10f)],_0x515da8(0x16b),undefined,{'helpText':'The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.'});_0x549bff[_0x515da8(0xf2)]=0x0,_0x549bff[_0x515da8(0xc9)](..._0x3702a5);}const _0x291d63=_0x54f104[_0x515da8(0x189)](_0x1bb80d=>_0x4f33f8[_0x515da8(0x112)](_0x1bb80d[_0x515da8(0x11d)][_0x515da8(0x137)]))['length'];return{'projectName':_0x1b7c2f,'projectId':_0x515da8(0x17d),'counts':{'agents':_0x34b7a6[_0x515da8(0xf2)],'knowledgeBases':_0x307e17[_0x515da8(0xf2)],'prompts':_0x291d63,'integrations':_0x12571e[_0x515da8(0xf2)]},'sourceSite':_0x4be891};}const _0x14085a=await this['client']['createProject']({'name':_0x1b7c2f,'description':_0x9fdcb[_0x515da8(0x18f)]['attributes'][_0x515da8(0x14d)]}),_0x3d5ea0=_0x14085a['id'],_0x2d2e44=new Map(),_0x227250=new Map(),_0x20b35f=new Map();for(const _0x2180f8 of _0x307e17){const _0x5da9e2=await this[_0x515da8(0x18e)][_0x515da8(0xe5)]({'projectId':_0x3d5ea0,'name':_0x2180f8[_0x515da8(0x11d)][_0x515da8(0x10c)],'tdDatabaseName':_0x2180f8['attributes'][_0x515da8(0x12b)],'tables':_0x2180f8[_0x515da8(0x11d)][_0x515da8(0x151)]});_0x2d2e44[_0x515da8(0x107)](_0x2180f8['id'],_0x5da9e2['id']);}const _0x349f57=[..._0x34b7a6],_0x3a60fd=_0x34b7a6['length']+0x1;let _0xfe7e89=0x0;while(_0x349f57[_0x515da8(0xf2)]>0x0&&_0xfe7e89<_0x3a60fd){_0xfe7e89++;const _0x2de92e=[];for(const _0x5c714c of _0x349f57){if(canCreateAgent(_0x5c714c,_0x227250)){const _0x27c94b=remapToolIds(_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x1c5)],_0x2d2e44,_0x227250),_0x16107c=remapVariableIds(_0x5c714c[_0x515da8(0x11d)][_0x515da8(0xcd)],_0x2d2e44),_0x411b19=await this[_0x515da8(0x18e)][_0x515da8(0x18d)]({'name':_0x5c714c['attributes'][_0x515da8(0x10c)],'projectId':_0x3d5ea0,'systemPrompt':_0x5c714c[_0x515da8(0x11d)][_0x515da8(0xfb)],'starterMessage':_0x5c714c['attributes'][_0x515da8(0x1c8)],'modelType':migrateModelType(_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x117)]),'maxToolIterations':_0x5c714c['attributes'][_0x515da8(0x171)],'temperature':_0x5c714c[_0x515da8(0x11d)]['temperature'],'reasoningEffort':_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x1d2)],'outputs':_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x161)],'tools':_0x27c94b,'variables':_0x16107c});_0x227250['set'](_0x5c714c['id'],_0x411b19['id']);}else _0x2de92e[_0x515da8(0xc9)](_0x5c714c);}if(_0x2de92e[_0x515da8(0xf2)]===_0x349f57[_0x515da8(0xf2)])throw new SDKError(ErrorCode[_0x515da8(0x10f)],_0x515da8(0x16b),undefined,{'helpText':_0x515da8(0xf9)});_0x349f57[_0x515da8(0xf2)]=0x0,_0x349f57['push'](..._0x2de92e);}for(const _0x496782 of _0x54f104){const _0xb68b47=_0x227250[_0x515da8(0x14e)](_0x496782[_0x515da8(0x11d)][_0x515da8(0x137)]);if(!_0xb68b47)continue;const _0x40e597=await this['client'][_0x515da8(0x1b7)]({'projectId':_0x3d5ea0,'agentId':_0xb68b47,'name':_0x496782['attributes'][_0x515da8(0x10c)],'systemPrompt':_0x496782['attributes']['systemPrompt'],'template':_0x496782[_0x515da8(0x11d)][_0x515da8(0xd5)],'jsonSchemaHint':_0x496782[_0x515da8(0x11d)]['jsonSchemaHint']});_0x20b35f[_0x515da8(0x107)](_0x496782['id'],_0x40e597['id']);}for(const _0x19aff3 of _0x12571e){const _0x36f805=_0x19aff3[_0x515da8(0x11d)]['actions'][_0x515da8(0x1b2)](_0x116184=>({..._0x116184,'promptId':_0x20b35f[_0x515da8(0x14e)](_0x116184[_0x515da8(0x19c)])||_0x116184[_0x515da8(0x19c)]}));await this[_0x515da8(0x18e)][_0x515da8(0x1d0)]({'projectId':_0x3d5ea0,'serviceType':_0x19aff3[_0x515da8(0x11d)][_0x515da8(0x17f)],'actions':_0x36f805,'slackMessageMode':_0x19aff3['attributes'][_0x515da8(0x11a)],'chatIgnoreManagedActions':_0x19aff3['attributes'][_0x515da8(0xca)],'chatWelcomeMessage':_0x19aff3[_0x515da8(0x11d)]['chatWelcomeMessage'],'webhookCorsOrigins':_0x19aff3[_0x515da8(0x11d)][_0x515da8(0x11b)]});}return{'projectName':_0x1b7c2f,'projectId':_0x3d5ea0,'counts':{'agents':_0x227250[_0x515da8(0x1c6)],'knowledgeBases':_0x2d2e44[_0x515da8(0x1c6)],'prompts':_0x20b35f[_0x515da8(0x1c6)],'integrations':_0x12571e['length']},'sourceSite':_0x4be891};}[a122_0x29cadd(0x19b)](_0x138d26,_0x3af32c){const _0x7141e3=a122_0x29cadd;if(!a122_0x1debea[_0x7141e3(0x1cf)](_0x138d26))return _0x3af32c;return JSON[_0x7141e3(0x177)](a122_0x1debea[_0x7141e3(0x16d)](_0x138d26,_0x7141e3(0x1b9)));}[a122_0x29cadd(0x143)](_0x1a37b7){const _0x27e0b2=a122_0x29cadd;if(!a122_0x1debea[_0x27e0b2(0x1cf)](_0x1a37b7))throw new SDKError(ErrorCode[_0x27e0b2(0x1de)],_0x27e0b2(0x109)+_0x1a37b7,undefined,{'helpText':_0x27e0b2(0x165)});const _0x4cdcfe=a122_0x52c3ab[_0x27e0b2(0x184)](_0x1a37b7,_0x27e0b2(0x179));if(!a122_0x1debea['existsSync'](_0x4cdcfe))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20'+_0x1a37b7,undefined,{'helpText':_0x27e0b2(0x192)});const _0x456936=JSON[_0x27e0b2(0x177)](a122_0x1debea[_0x27e0b2(0x16d)](_0x4cdcfe,_0x27e0b2(0x1b9)));if(!isSupportedBackupVersion(_0x456936[_0x27e0b2(0x14a)]))throw new SDKError(ErrorCode[_0x27e0b2(0x129)],_0x27e0b2(0x124)+_0x456936[_0x27e0b2(0x14a)],undefined,{'helpText':_0x27e0b2(0xc2)});return _0x456936;}async[a122_0x29cadd(0x135)](_0x1c62f1,_0x36e486,_0x5b5c89){const _0x18462b=a122_0x29cadd,{projectId:_0x90f37,project:_0x3a3f16}=await this[_0x18462b(0xc5)](_0x1c62f1),_0x4bd3d8=_0x3a3f16[_0x18462b(0x11d)][_0x18462b(0x10c)];let _0x39dcea;if(_0x36e486)_0x39dcea=_0x36e486;else{const _0x1faa53=a122_0x52c3ab[_0x18462b(0x184)](process[_0x18462b(0x185)](),_0x18462b(0x193)),_0x414238=getSanitizedPathWithMigration(_0x1faa53,_0x4bd3d8);_0x414238['renamed']&&this[_0x18462b(0x114)][_0x18462b(0xff)](_0x18462b(0xd8)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x414238[_0x18462b(0x1b3)])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x414238['path'])),_0x39dcea=_0x414238[_0x18462b(0xd2)];}const _0x3b96cd=await this[_0x18462b(0x18e)][_0x18462b(0x103)](_0x90f37),_0x45888d=await this['client'][_0x18462b(0x145)](_0x90f37),_0x109568=await this[_0x18462b(0x18e)][_0x18462b(0x1c0)](_0x90f37),_0x27629d=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x14c)](_0x90f37)),_0x1888d4=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x180)](_0x90f37)),_0x1f6275=await this[_0x18462b(0x18e)]['listPrompts'](_0x90f37),_0x595def=await this[_0x18462b(0x18e)][_0x18462b(0xd9)](_0x90f37),_0x383a3b=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x182)](_0x90f37)),_0x55469c=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x1a6)](_0x90f37)),_0x54211c=_0x595def[_0x18462b(0x189)](_0x997d3e=>!_0x997d3e['attributes'][_0x18462b(0x154)]&&SAFE_INTEGRATION_TYPES[_0x18462b(0x15d)](_0x997d3e[_0x18462b(0x11d)][_0x18462b(0x17f)][_0x18462b(0x102)]())),_0x54b272=new Map(),_0x2b3364=new Map(),_0x3f451c=new Map(),_0xe51842=new Map(),_0xb2ea=new Map(),_0x273536=new Map(),_0x37c39d=new Map();for(const _0x3e5a62 of _0x3b96cd){_0x54b272[_0x18462b(0x107)](_0x3e5a62['id'],_0x3e5a62[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0x429a45 of _0x45888d){_0x2b3364[_0x18462b(0x107)](_0x429a45['id'],_0x429a45[_0x18462b(0x11d)]['name']);}for(const _0x292a64 of _0x109568){_0x3f451c[_0x18462b(0x107)](_0x292a64['id'],_0x292a64[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0xde9ecc of _0x27629d){_0xe51842[_0x18462b(0x107)](_0xde9ecc['id'],_0xde9ecc[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0x8bf909 of _0x1888d4){_0xb2ea[_0x18462b(0x107)](_0x8bf909['id'],_0x8bf909[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0x3f471c of _0x1f6275){_0x273536['set'](_0x3f471c['id'],_0x3f471c[_0x18462b(0x11d)]['name']);}for(const _0x21baa3 of _0x383a3b){_0x37c39d[_0x18462b(0x107)](_0x21baa3['id'],_0x21baa3[_0x18462b(0x11d)][_0x18462b(0x10c)]);}const _0x1352fa={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2b3364,'TextKnowledgeBase':_0x3f451c,'Agent':_0x54b272,'WebSearchTool':_0xb2ea,'ImageGenerator':_0xe51842,'ExperimentalKnowledgeBase':_0x37c39d}),'resolvePromptName':async _0x9fd625=>_0x273536[_0x18462b(0x14e)](_0x9fd625),'onWarning':_0x347628=>this[_0x18462b(0x114)][_0x18462b(0x1c7)](_0x347628)},_0x3ec88d={'projectName':_0x4bd3d8,'outputDir':_0x39dcea,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'knowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'textKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'prompts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'integrations':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalArtifacts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0}}},_0x1ad9cc=[],_0x3a0cee=[];for(const _0x59c8c4 of _0x3b96cd){const _0x34ce15=getSanitizedPathWithMigration(_0x39dcea,_0x59c8c4['attributes'][_0x18462b(0x10c)]);_0x34ce15['renamed']&&this[_0x18462b(0x114)]['info'](_0x18462b(0x123)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x34ce15[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab['basename'](_0x34ce15['path']));const _0x4a1533=_0x34ce15[_0x18462b(0xd2)],_0x5c5466=a122_0x52c3ab['join'](_0x4a1533,_0x18462b(0x1d9)),_0x5c9a1d=a122_0x52c3ab[_0x18462b(0x184)](_0x4a1533,'agent.yml'),_0xd9cec2=a122_0x52c3ab['join'](_0x4a1533,_0x18462b(0xdc)),{yaml:_0x5d6d3a,systemPrompt:_0x218573,starterMessage:_0x483fbe}=await agentResponseToDef(_0x59c8c4,_0x1352fa),_0x43d4c8=toAgentYamlString(_0x5d6d3a),_0x52c203=!a122_0x1debea['existsSync'](_0x5c9a1d);let _0x460ea2=_0x52c203,_0x5c6e6a;if(!_0x52c203){const _0xfa32a2=a122_0x1debea[_0x18462b(0x1cf)](_0x5c5466)?a122_0x1debea[_0x18462b(0x16d)](_0x5c5466,_0x18462b(0x1b9)):'',_0x3747ad=a122_0x1debea[_0x18462b(0x16d)](_0x5c9a1d,_0x18462b(0x1b9)),_0x247c4d=_0x18462b(0x157)+_0xfa32a2+_0x18462b(0x16c)+_0x3747ad,_0x5538d0=_0x18462b(0x157)+_0x218573+_0x18462b(0x16c)+_0x43d4c8,_0x101a25=generateDiff(_0x247c4d,_0x5538d0);_0x460ea2=hasChanges(_0x101a25),_0x460ea2&&(_0x5c6e6a=formatDiffWithColors(_0x101a25));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x4a1533,'content':'','isDir':!![]}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x5c5466,'content':_0x218573}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x5c9a1d,'content':_0x43d4c8});_0x483fbe&&_0x483fbe['includes']('\x0a')&&_0x1ad9cc[_0x18462b(0xc9)]({'path':_0xd9cec2,'content':_0x483fbe});_0x3ec88d[_0x18462b(0x193)][_0x18462b(0xc9)]({'agentName':_0x59c8c4['attributes'][_0x18462b(0x10c)],'outputPath':_0x4a1533,'isNew':_0x52c203,'hasChanges':_0x460ea2,'diff':_0x5c6e6a}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0xf4)]++;if(_0x52c203)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0x132)]++;else{if(_0x460ea2)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0x1d1)]++;}}for(const _0x44c5d6 of _0x45888d){if(_0x44c5d6['attributes']['isManaged'])continue;const _0x92de28=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x39dcea),_0x44c5d6['attributes']['name'],_0x18462b(0x194));_0x92de28[_0x18462b(0xfe)]&&this[_0x18462b(0x114)]['info'](_0x18462b(0x1ca)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x92de28[_0x18462b(0x1b3)])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x92de28['path']));const _0x49d438=_0x92de28[_0x18462b(0xd2)],_0x46d6b8=apiKnowledgeBaseToYaml(_0x44c5d6),_0x3f428b=toKnowledgeBaseYamlString(_0x46d6b8),_0x2ec174=!a122_0x1debea[_0x18462b(0x1cf)](_0x49d438);let _0x596aa8=_0x2ec174,_0x56b1dc;if(!_0x2ec174){const _0x570d53=a122_0x1debea[_0x18462b(0x16d)](_0x49d438,_0x18462b(0x1b9)),_0x14c554=generateDiff(_0x570d53,_0x3f428b);_0x596aa8=hasChanges(_0x14c554),_0x596aa8&&(_0x56b1dc=formatDiffWithColors(_0x14c554));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x49d438,'content':_0x3f428b}),_0x3ec88d[_0x18462b(0xbf)][_0x18462b(0xc9)]({'name':_0x44c5d6[_0x18462b(0x11d)][_0x18462b(0x10c)],'outputPath':_0x49d438,'isNew':_0x2ec174,'hasChanges':_0x596aa8,'diff':_0x56b1dc}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0xbf)][_0x18462b(0xf4)]++;if(_0x2ec174)_0x3ec88d['counts']['knowledgeBases'][_0x18462b(0x132)]++;else{if(_0x596aa8)_0x3ec88d['counts'][_0x18462b(0xbf)]['updated']++;else _0x3ec88d['counts'][_0x18462b(0xbf)][_0x18462b(0x1d1)]++;}}for(const _0x520d70 of _0x109568){if(_0x520d70[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0x490243=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x39dcea),_0x520d70[_0x18462b(0x11d)][_0x18462b(0x10c)],_0x18462b(0x16a));_0x490243[_0x18462b(0xfe)]&&this[_0x18462b(0x114)][_0x18462b(0xff)](_0x18462b(0x11c)+a122_0x52c3ab['basename'](_0x490243['oldPath'])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x490243['path']));const _0x351895=_0x490243['path'],_0x3c6b88=toTextKnowledgeBaseMd(_0x520d70['attributes']['name'],_0x520d70[_0x18462b(0x11d)][_0x18462b(0xc1)]),_0x45dfa8=!a122_0x1debea[_0x18462b(0x1cf)](_0x351895);let _0x39bb08=_0x45dfa8,_0x5e1c9f;if(!_0x45dfa8){const _0x3c2c50=a122_0x1debea[_0x18462b(0x16d)](_0x351895,_0x18462b(0x1b9)),_0x4e8113=generateDiff(_0x3c2c50,_0x3c6b88);_0x39bb08=hasChanges(_0x4e8113),_0x39bb08&&(_0x5e1c9f=formatDiffWithColors(_0x4e8113));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x351895,'content':_0x3c6b88}),_0x3ec88d[_0x18462b(0x128)][_0x18462b(0xc9)]({'name':_0x520d70['attributes'][_0x18462b(0x10c)],'outputPath':_0x351895,'isNew':_0x45dfa8,'hasChanges':_0x39bb08,'diff':_0x5e1c9f}),_0x3ec88d['counts'][_0x18462b(0x128)][_0x18462b(0xf4)]++;if(_0x45dfa8)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x128)][_0x18462b(0x132)]++;else{if(_0x39bb08)_0x3ec88d[_0x18462b(0x17b)]['textKnowledgeBases'][_0x18462b(0x1db)]++;else _0x3ec88d['counts'][_0x18462b(0x128)][_0x18462b(0x1d1)]++;}}for(const _0x4d54e7 of _0x1f6275){if(_0x4d54e7[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0x26328d=getSanitizedPathWithMigration(getPromptsDir(_0x39dcea),_0x4d54e7['attributes'][_0x18462b(0x10c)],_0x18462b(0x194));_0x26328d['renamed']&&this[_0x18462b(0x114)][_0x18462b(0xff)]('Renamed\x20prompt\x20file:\x20'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x26328d[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x26328d[_0x18462b(0xd2)]));const _0x39b7a6=_0x26328d[_0x18462b(0xd2)],_0x4702e0=await apiPromptToYaml(_0x4d54e7,_0x1352fa);if(!_0x4702e0)continue;const _0x27bd5d=toPromptYamlString(_0x4702e0),_0x1dde3d=!a122_0x1debea['existsSync'](_0x39b7a6);let _0x13ec66=_0x1dde3d,_0x576540;if(!_0x1dde3d){const _0x8db65b=a122_0x1debea['readFileSync'](_0x39b7a6,'utf-8'),_0x378ccc=generateDiff(_0x8db65b,_0x27bd5d);_0x13ec66=hasChanges(_0x378ccc),_0x13ec66&&(_0x576540=formatDiffWithColors(_0x378ccc));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x39b7a6,'content':_0x27bd5d}),_0x3ec88d['prompts'][_0x18462b(0xc9)]({'name':_0x4d54e7[_0x18462b(0x11d)][_0x18462b(0x10c)],'outputPath':_0x39b7a6,'isNew':_0x1dde3d,'hasChanges':_0x13ec66,'diff':_0x576540}),_0x3ec88d[_0x18462b(0x17b)]['prompts'][_0x18462b(0xf4)]++;if(_0x1dde3d)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x122)]['new']++;else{if(_0x13ec66)_0x3ec88d[_0x18462b(0x17b)]['prompts'][_0x18462b(0x1db)]++;else _0x3ec88d['counts'][_0x18462b(0x122)]['unchanged']++;}}for(const _0xfb4ec9 of _0x54211c){const _0x7b9011=_0xfb4ec9[_0x18462b(0x11d)][_0x18462b(0x17f)][_0x18462b(0x102)](),_0x15e38c=getSanitizedPathWithMigration(getIntegrationsDir(_0x39dcea),_0x7b9011,_0x18462b(0x194));_0x15e38c[_0x18462b(0xfe)]&&this['logger']['info'](_0x18462b(0x17c)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x15e38c[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x15e38c['path']));const _0xec371b=_0x15e38c[_0x18462b(0xd2)],_0x3d037e=await apiIntegrationToYaml(_0xfb4ec9,_0x1352fa),_0x48761e=toIntegrationYamlString(_0x3d037e),_0x5de7d5=!a122_0x1debea['existsSync'](_0xec371b);let _0x5dd8fa=_0x5de7d5,_0x3e166f;if(!_0x5de7d5){const _0x572dcb=a122_0x1debea['readFileSync'](_0xec371b,_0x18462b(0x1b9)),_0x36cf9b=generateDiff(_0x572dcb,_0x48761e);_0x5dd8fa=hasChanges(_0x36cf9b),_0x5dd8fa&&(_0x3e166f=formatDiffWithColors(_0x36cf9b));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0xec371b,'content':_0x48761e}),_0x3ec88d[_0x18462b(0x13a)][_0x18462b(0xc9)]({'name':_0x7b9011,'outputPath':_0xec371b,'isNew':_0x5de7d5,'hasChanges':_0x5dd8fa,'diff':_0x3e166f}),_0x3ec88d['counts']['integrations'][_0x18462b(0xf4)]++;if(_0x5de7d5)_0x3ec88d['counts']['integrations'][_0x18462b(0x132)]++;else{if(_0x5dd8fa)_0x3ec88d['counts'][_0x18462b(0x13a)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x13a)][_0x18462b(0x1d1)]++;}}for(const _0x237e6a of _0x383a3b){if(_0x237e6a[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0x1b5b26=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x39dcea),_0x237e6a[_0x18462b(0x11d)][_0x18462b(0x10c)]);_0x1b5b26[_0x18462b(0xfe)]&&this['logger']['info'](_0x18462b(0x164)+a122_0x52c3ab['basename'](_0x1b5b26[_0x18462b(0x1b3)])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x1b5b26[_0x18462b(0xd2)]));const _0x1062a5=_0x1b5b26[_0x18462b(0xd2)],_0x13289b=a122_0x52c3ab[_0x18462b(0x184)](_0x1062a5,sanitizeForFilesystem(_0x237e6a['attributes']['name'])+_0x18462b(0x194)),_0x56b385=a122_0x52c3ab['join'](_0x1062a5,'functions'),_0x590a8f=apiExperimentalKnowledgeBaseToYaml(_0x237e6a),_0x257689=toExperimentalKnowledgeBaseYamlString(_0x590a8f),_0x50ed36=!a122_0x1debea['existsSync'](_0x1062a5);let _0x3256f2=_0x50ed36,_0x3573ef,_0x2f945c=_0x257689;const _0x1e898d=[..._0x590a8f['functions']]['sort']((_0x420bf4,_0x4f8379)=>_0x420bf4['name'][_0x18462b(0x158)](_0x4f8379[_0x18462b(0x10c)]));for(const _0x87672a of _0x1e898d){_0x2f945c+='\x0a---\x20function:\x20'+_0x87672a[_0x18462b(0x10c)]+_0x18462b(0x1b1)+_0x87672a[_0x18462b(0x1a2)]+_0x18462b(0x1d8)+_0x87672a[_0x18462b(0x10c)]+_0x18462b(0x1b1)+_0x87672a[_0x18462b(0xf1)]+'\x0a';}if(!_0x50ed36){let _0x56db57='';a122_0x1debea[_0x18462b(0x1cf)](_0x13289b)&&(_0x56db57=a122_0x1debea[_0x18462b(0x16d)](_0x13289b,'utf-8'));if(a122_0x1debea[_0x18462b(0x1cf)](_0x56b385)){const _0x44bd5a=a122_0x1debea[_0x18462b(0xee)](_0x56b385,{'withFileTypes':!![]}),_0x20cf11=_0x44bd5a[_0x18462b(0x189)](_0x111314=>_0x111314[_0x18462b(0xea)]())[_0x18462b(0xeb)]((_0x41ebbd,_0x5e79a9)=>_0x41ebbd['name'][_0x18462b(0x158)](_0x5e79a9['name']));for(const _0x29f7f6 of _0x20cf11){const _0x3453c6=a122_0x52c3ab[_0x18462b(0x184)](_0x56b385,_0x29f7f6[_0x18462b(0x10c)],'code.js'),_0x4d9492=a122_0x52c3ab[_0x18462b(0x184)](_0x56b385,_0x29f7f6[_0x18462b(0x10c)],_0x18462b(0x1c3));a122_0x1debea['existsSync'](_0x3453c6)&&(_0x56db57+=_0x18462b(0x1a4)+_0x29f7f6[_0x18462b(0x10c)]+_0x18462b(0x1b1)+a122_0x1debea['readFileSync'](_0x3453c6,_0x18462b(0x1b9))+'\x0a'),a122_0x1debea[_0x18462b(0x1cf)](_0x4d9492)&&(_0x56db57+=_0x18462b(0x1d6)+_0x29f7f6[_0x18462b(0x10c)]+_0x18462b(0x1b1)+a122_0x1debea[_0x18462b(0x16d)](_0x4d9492,_0x18462b(0x1b9))+'\x0a');}}const _0x4fe02c=generateDiff(_0x56db57,_0x2f945c);_0x3256f2=hasChanges(_0x4fe02c),_0x3256f2&&(_0x3573ef=formatDiffWithColors(_0x4fe02c));}_0x1ad9cc['push']({'path':_0x1062a5,'content':'','isDir':!![]}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x13289b,'content':_0x257689}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x56b385,'content':'','isDir':!![]});for(const _0x58adab of _0x590a8f[_0x18462b(0x18c)]){const _0x1ed453=a122_0x52c3ab['join'](_0x56b385,sanitizeForFilesystem(_0x58adab[_0x18462b(0x10c)])),_0x4bb00d=a122_0x52c3ab[_0x18462b(0x184)](_0x1ed453,_0x18462b(0xc4)),_0x2d3a26=a122_0x52c3ab[_0x18462b(0x184)](_0x1ed453,_0x18462b(0x1c3));_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x1ed453,'content':'','isDir':!![]}),_0x1ad9cc['push']({'path':_0x4bb00d,'content':_0x58adab[_0x18462b(0x1a2)]}),_0x1ad9cc['push']({'path':_0x2d3a26,'content':_0x58adab[_0x18462b(0xf1)]});}if(a122_0x1debea[_0x18462b(0x1cf)](_0x56b385)){const _0x14f05f=a122_0x1debea['readdirSync'](_0x56b385,{'withFileTypes':!![]}),_0x2a5acc=new Set(_0x590a8f[_0x18462b(0x18c)][_0x18462b(0x1b2)](_0x3d506f=>sanitizeForFilesystem(_0x3d506f[_0x18462b(0x10c)])));for(const _0x2d3f20 of _0x14f05f){if(_0x2d3f20['isDirectory']()&&!_0x2a5acc[_0x18462b(0x112)](_0x2d3f20[_0x18462b(0x10c)])){const _0xb0b338=a122_0x52c3ab[_0x18462b(0x184)](_0x56b385,_0x2d3f20[_0x18462b(0x10c)]);_0x3a0cee[_0x18462b(0xc9)]({'path':_0xb0b338,'isDir':!![]});}}}_0x3ec88d['experimentalKnowledgeBases']['push']({'name':_0x237e6a[_0x18462b(0x11d)][_0x18462b(0x10c)],'outputPath':_0x1062a5,'isNew':_0x50ed36,'hasChanges':_0x3256f2,'diff':_0x3573ef}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x1af)][_0x18462b(0xf4)]++;if(_0x50ed36)_0x3ec88d['counts']['experimentalKnowledgeBases']['new']++;else{if(_0x3256f2)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x1af)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)]['experimentalKnowledgeBases'][_0x18462b(0x1d1)]++;}}for(const _0x447581 of _0x55469c){if(_0x447581[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0xd36717=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x39dcea),_0x447581[_0x18462b(0x11d)][_0x18462b(0x10c)]);_0xd36717[_0x18462b(0xfe)]&&this['logger'][_0x18462b(0xff)](_0x18462b(0x15c)+a122_0x52c3ab[_0x18462b(0x1d4)](_0xd36717[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab['basename'](_0xd36717['path']));const _0x2bbe49=_0xd36717['path'],_0x35f617=a122_0x52c3ab[_0x18462b(0x184)](_0x2bbe49,sanitizeForFilesystem(_0x447581[_0x18462b(0x11d)][_0x18462b(0x10c)])+_0x18462b(0x194)),_0x6c7cf5=a122_0x52c3ab[_0x18462b(0x184)](_0x2bbe49,'code.js'),_0x14b1e4=a122_0x52c3ab[_0x18462b(0x184)](_0x2bbe49,'files'),_0xdfeddf=apiExperimentalArtifactToYaml(_0x447581),_0x23077d=toExperimentalArtifactYamlString(_0xdfeddf),_0x3de291=!a122_0x1debea['existsSync'](_0x2bbe49);let _0x4642a2=_0x3de291,_0x2fdadd,_0x4cf8ee=_0x23077d+(_0x18462b(0x141)+_0xdfeddf[_0x18462b(0x1a2)]+'\x0a');const _0x55c7dc=[..._0xdfeddf[_0x18462b(0xc7)]][_0x18462b(0xeb)]((_0x47e3e7,_0x1ddc4e)=>_0x47e3e7['file_name'][_0x18462b(0x158)](_0x1ddc4e[_0x18462b(0x10d)]));for(const _0x3d7755 of _0x55c7dc){_0x4cf8ee+=_0x18462b(0x156)+_0x3d7755[_0x18462b(0x10d)]+_0x18462b(0x1b1)+_0x3d7755[_0x18462b(0xfc)]+'\x0a';}if(!_0x3de291){let _0x18b914='';a122_0x1debea[_0x18462b(0x1cf)](_0x35f617)&&(_0x18b914=a122_0x1debea['readFileSync'](_0x35f617,_0x18462b(0x1b9)));a122_0x1debea[_0x18462b(0x1cf)](_0x6c7cf5)&&(_0x18b914+=_0x18462b(0x141)+a122_0x1debea[_0x18462b(0x16d)](_0x6c7cf5,_0x18462b(0x1b9))+'\x0a');if(a122_0x1debea['existsSync'](_0x14b1e4)){const _0x1bb316=a122_0x1debea[_0x18462b(0xee)](_0x14b1e4),_0x3bc059=_0x1bb316[_0x18462b(0x189)](_0x41900e=>{const _0x4db54e=_0x18462b,_0x5af232=a122_0x52c3ab[_0x4db54e(0x184)](_0x14b1e4,_0x41900e);return a122_0x1debea[_0x4db54e(0x11f)](_0x5af232)['isFile']();})['sort']((_0x1b8c7a,_0x221115)=>_0x1b8c7a[_0x18462b(0x158)](_0x221115));for(const _0x139e4 of _0x3bc059){const _0x178313=a122_0x52c3ab[_0x18462b(0x184)](_0x14b1e4,_0x139e4);_0x18b914+=_0x18462b(0x156)+_0x139e4+_0x18462b(0x1b1)+a122_0x1debea['readFileSync'](_0x178313,'utf-8')+'\x0a';}}const _0xb6f85c=generateDiff(_0x18b914,_0x4cf8ee);_0x4642a2=hasChanges(_0xb6f85c),_0x4642a2&&(_0x2fdadd=formatDiffWithColors(_0xb6f85c));}_0x1ad9cc['push']({'path':_0x2bbe49,'content':'','isDir':!![]}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x35f617,'content':_0x23077d}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x6c7cf5,'content':_0xdfeddf[_0x18462b(0x1a2)]});if(_0xdfeddf[_0x18462b(0xc7)][_0x18462b(0xf2)]>0x0){_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x14b1e4,'content':'','isDir':!![]});for(const _0x21ed5e of _0xdfeddf[_0x18462b(0xc7)]){const _0x512283=a122_0x52c3ab['join'](_0x14b1e4,_0x21ed5e['file_name']);_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x512283,'content':_0x21ed5e['text_content']});}}if(a122_0x1debea[_0x18462b(0x1cf)](_0x14b1e4)){const _0x4bbf6a=a122_0x1debea[_0x18462b(0xee)](_0x14b1e4),_0xa5c790=new Set(_0xdfeddf[_0x18462b(0xc7)][_0x18462b(0x1b2)](_0x3fbb06=>_0x3fbb06[_0x18462b(0x10d)]));for(const _0x573922 of _0x4bbf6a){const _0x2d3cae=a122_0x52c3ab['join'](_0x14b1e4,_0x573922);a122_0x1debea[_0x18462b(0x11f)](_0x2d3cae)[_0x18462b(0x12c)]()&&!_0xa5c790[_0x18462b(0x112)](_0x573922)&&_0x3a0cee[_0x18462b(0xc9)]({'path':_0x2d3cae});}}_0x3ec88d[_0x18462b(0x108)][_0x18462b(0xc9)]({'name':_0x447581['attributes'][_0x18462b(0x10c)],'outputPath':_0x2bbe49,'isNew':_0x3de291,'hasChanges':_0x4642a2,'diff':_0x2fdadd}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x108)][_0x18462b(0xf4)]++;if(_0x3de291)_0x3ec88d['counts'][_0x18462b(0x108)][_0x18462b(0x132)]++;else{if(_0x4642a2)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x108)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x108)][_0x18462b(0x1d1)]++;}}if(_0x5b5c89?.[_0x18462b(0x1a3)])return _0x3ec88d;a122_0x1debea[_0x18462b(0x144)](_0x39dcea,{'recursive':!![]}),a122_0x1debea[_0x18462b(0x144)](getKnowledgeBasesDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea[_0x18462b(0x144)](getPromptsDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea['mkdirSync'](getIntegrationsDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea[_0x18462b(0x144)](getExperimentalKnowledgeBasesDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea['mkdirSync'](getExperimentalArtifactsDir(_0x39dcea),{'recursive':!![]});const _0x127458=a122_0x52c3ab[_0x18462b(0x184)](_0x39dcea,'tdx.json');a122_0x1debea[_0x18462b(0x187)](_0x127458,createAgentConfigContent(_0x4bd3d8));for(const _0x4b11dd of _0x1ad9cc){if(_0x4b11dd[_0x18462b(0x1aa)])a122_0x1debea[_0x18462b(0x144)](_0x4b11dd[_0x18462b(0xd2)],{'recursive':!![]});else{const _0x4ba8d6=a122_0x52c3ab[_0x18462b(0x1b5)](_0x4b11dd[_0x18462b(0xd2)]);!a122_0x1debea[_0x18462b(0x1cf)](_0x4ba8d6)&&a122_0x1debea[_0x18462b(0x144)](_0x4ba8d6,{'recursive':!![]}),a122_0x1debea['writeFileSync'](_0x4b11dd[_0x18462b(0xd2)],_0x4b11dd[_0x18462b(0x1a5)]);}}for(const _0x5ef2f2 of _0x3a0cee){_0x5ef2f2['isDir']?(a122_0x1debea[_0x18462b(0xe4)](_0x5ef2f2['path'],{'recursive':!![],'force':!![]}),this[_0x18462b(0x114)][_0x18462b(0xff)](_0x18462b(0xd3)+a122_0x52c3ab[_0x18462b(0x1d4)](a122_0x52c3ab[_0x18462b(0x1b5)](_0x5ef2f2[_0x18462b(0xd2)]))+'/'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x5ef2f2[_0x18462b(0xd2)]))):(a122_0x1debea[_0x18462b(0xe4)](_0x5ef2f2['path'],{'force':!![]}),this[_0x18462b(0x114)][_0x18462b(0xff)]('Removed\x20deleted\x20file:\x20'+a122_0x52c3ab['basename'](a122_0x52c3ab[_0x18462b(0x1b5)](_0x5ef2f2[_0x18462b(0xd2)]))+'/'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x5ef2f2[_0x18462b(0xd2)])));}return _0x3ec88d;}async[a122_0x29cadd(0x1a0)](_0x2fbc26,_0x25cd44){const _0x19f69c=a122_0x29cadd,_0x556755=a122_0x52c3ab['join'](_0x2fbc26,_0x19f69c(0xcf));if(!a122_0x1debea['existsSync'](_0x556755))throw new SDKError(ErrorCode[_0x19f69c(0x129)],_0x19f69c(0x1c2)+_0x2fbc26,undefined,{'helpText':_0x19f69c(0x168)});const _0x5d62a9=loadAgentConfig(_0x556755),_0x10e6e9=await this[_0x19f69c(0x178)](_0x5d62a9['llm_project']),_0x2e8ca1=await this[_0x19f69c(0x18e)][_0x19f69c(0xd7)](_0x10e6e9),_0x1ed110=_0x2e8ca1[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x1a417c={'projectName':_0x1ed110,'projectId':_0x10e6e9,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x2e3a8f=[],_0x47aafa=[],_0xaac714=[],_0x199736=[],_0x496450=[],_0x5a20a8=[],_0x3434c3=a122_0x1debea[_0x19f69c(0xee)](_0x2fbc26,{'withFileTypes':!![]});for(const _0x2fc449 of _0x3434c3){if(!_0x2fc449[_0x19f69c(0xea)]())continue;if([_0x19f69c(0x1ab),'prompts',_0x19f69c(0x13a),_0x19f69c(0x1bf),_0x19f69c(0x188)][_0x19f69c(0x15d)](_0x2fc449['name']))continue;const _0xc75bea=a122_0x52c3ab[_0x19f69c(0x184)](_0x2fbc26,_0x2fc449[_0x19f69c(0x10c)]);if(isAgentDir(_0xc75bea)){const _0x4047ae=a122_0x52c3ab[_0x19f69c(0x184)](_0xc75bea,_0x19f69c(0xe0)),_0x2e0cf5=a122_0x52c3ab[_0x19f69c(0x184)](_0xc75bea,_0x19f69c(0x1d9)),_0x1269f7=a122_0x52c3ab['join'](_0xc75bea,'starter_message.md'),_0x2c2eb3=parseAgentYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x4047ae,_0x19f69c(0x1b9)),_0x4047ae),_0xbf16b7=a122_0x1debea['existsSync'](_0x2e0cf5)?a122_0x1debea[_0x19f69c(0x16d)](_0x2e0cf5,_0x19f69c(0x1b9)):'',_0x4188d7=a122_0x1debea[_0x19f69c(0x1cf)](_0x1269f7)?a122_0x1debea[_0x19f69c(0x16d)](_0x1269f7,_0x19f69c(0x1b9)):_0x2c2eb3[_0x19f69c(0x1df)];_0x2e3a8f['push']({'name':_0x2c2eb3['name'],'dir':_0xc75bea,'yaml':_0x2c2eb3,'systemPrompt':_0xbf16b7,'starterMessage':_0x4188d7});}}const _0x54d8b8=getKnowledgeBasesDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x54d8b8)){const _0x231748=a122_0x1debea[_0x19f69c(0xee)](_0x54d8b8);for(const _0x486571 of _0x231748){const _0x518197=a122_0x52c3ab[_0x19f69c(0x184)](_0x54d8b8,_0x486571);if(_0x486571[_0x19f69c(0x191)](_0x19f69c(0x194))){const _0x285854=parseKnowledgeBaseYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x518197,'utf-8'),_0x518197);_0x47aafa[_0x19f69c(0xc9)]({'name':_0x285854['name'],'path':_0x518197,'yaml':_0x285854});}else{if(_0x486571['endsWith'](_0x19f69c(0x16a))){const _0xc16ed4=a122_0x1debea['readFileSync'](_0x518197,_0x19f69c(0x1b9)),{name:_0x30573c,text:_0x46ab72}=parseTextKnowledgeBaseMd(_0xc16ed4,_0x486571);_0xaac714['push']({'name':_0x30573c,'path':_0x518197,'text':_0x46ab72});}}}}const _0x14a680=getPromptsDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x14a680)){const _0xfc4441=a122_0x1debea['readdirSync'](_0x14a680)['filter'](_0x5cb9a2=>_0x5cb9a2[_0x19f69c(0x191)](_0x19f69c(0x194)));for(const _0x3e535d of _0xfc4441){const _0x2c8b8f=a122_0x52c3ab[_0x19f69c(0x184)](_0x14a680,_0x3e535d),_0x5aaaa9=parsePromptYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x2c8b8f,'utf-8'),_0x2c8b8f);_0x199736[_0x19f69c(0xc9)]({'name':_0x5aaaa9['name'],'path':_0x2c8b8f,'yaml':_0x5aaaa9});}}const _0x43b1e6=[],_0x3e504e=getIntegrationsDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x3e504e)){const _0x59bfe0=a122_0x1debea[_0x19f69c(0xee)](_0x3e504e)[_0x19f69c(0x189)](_0x3baee3=>_0x3baee3[_0x19f69c(0x191)](_0x19f69c(0x194)));for(const _0x15712b of _0x59bfe0){const _0x15051a=a122_0x52c3ab[_0x19f69c(0x184)](_0x3e504e,_0x15712b),_0x247577=parseIntegrationYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x15051a,'utf-8'),_0x15051a);if(!SAFE_INTEGRATION_TYPES['includes'](_0x247577[_0x19f69c(0x149)][_0x19f69c(0x102)]())){this[_0x19f69c(0x114)][_0x19f69c(0x1c7)]('Skipping\x20integration\x20\x27'+_0x247577['name']+'\x27\x20('+_0x247577[_0x19f69c(0x149)]+_0x19f69c(0x19a)+(_0x19f69c(0x11e)+SAFE_INTEGRATION_TYPES[_0x19f69c(0x184)](',\x20')+_0x19f69c(0x131))+'Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.');continue;}_0x43b1e6[_0x19f69c(0xc9)]({'name':_0x247577[_0x19f69c(0x10c)],'path':_0x15051a,'yaml':_0x247577});}}const _0x58a89b=getExperimentalKnowledgeBasesDir(_0x2fbc26);if(a122_0x1debea['existsSync'](_0x58a89b)){const _0x2c871f=a122_0x1debea['readdirSync'](_0x58a89b,{'withFileTypes':!![]});for(const _0x49cc3e of _0x2c871f){if(!_0x49cc3e['isDirectory']())continue;const _0x11e083=a122_0x52c3ab[_0x19f69c(0x184)](_0x58a89b,_0x49cc3e[_0x19f69c(0x10c)]),_0x1620ac=a122_0x52c3ab[_0x19f69c(0x184)](_0x11e083,_0x49cc3e['name']+_0x19f69c(0x194)),_0x52b546=a122_0x52c3ab[_0x19f69c(0x184)](_0x11e083,_0x19f69c(0x18c));if(!a122_0x1debea[_0x19f69c(0x1cf)](_0x1620ac))continue;const _0x3cf672=parseExperimentalKnowledgeBaseYaml(a122_0x1debea['readFileSync'](_0x1620ac,_0x19f69c(0x1b9)),_0x1620ac),_0x20d72b=[];if(a122_0x1debea['existsSync'](_0x52b546)){const _0x196eb7=a122_0x1debea[_0x19f69c(0xee)](_0x52b546,{'withFileTypes':!![]});for(const _0x3555cf of _0x196eb7){if(!_0x3555cf[_0x19f69c(0xea)]())continue;const _0x4691df=a122_0x52c3ab[_0x19f69c(0x184)](_0x52b546,_0x3555cf[_0x19f69c(0x10c)]),_0x3d983f=a122_0x52c3ab['join'](_0x4691df,'code.js'),_0x161fe5=a122_0x52c3ab[_0x19f69c(0x184)](_0x4691df,_0x19f69c(0x1c3));a122_0x1debea[_0x19f69c(0x1cf)](_0x3d983f)&&a122_0x1debea[_0x19f69c(0x1cf)](_0x161fe5)&&_0x20d72b[_0x19f69c(0xc9)]({'name':_0x3555cf['name'],'code':a122_0x1debea[_0x19f69c(0x16d)](_0x3d983f,'utf-8'),'json_schema':a122_0x1debea['readFileSync'](_0x161fe5,_0x19f69c(0x1b9))});}}const _0x5dc187={..._0x3cf672,'variables':_0x3cf672[_0x19f69c(0xcd)]||[],'functions':_0x20d72b};_0x496450[_0x19f69c(0xc9)]({'name':_0x3cf672[_0x19f69c(0x10c)],'dir':_0x11e083,'def':_0x5dc187});}}const _0x31b035=getExperimentalArtifactsDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x31b035)){const _0x131705=a122_0x1debea['readdirSync'](_0x31b035,{'withFileTypes':!![]});for(const _0x266cb9 of _0x131705){if(!_0x266cb9[_0x19f69c(0xea)]())continue;const _0x4063b5=a122_0x52c3ab[_0x19f69c(0x184)](_0x31b035,_0x266cb9[_0x19f69c(0x10c)]),_0x1e31b4=a122_0x52c3ab[_0x19f69c(0x184)](_0x4063b5,_0x266cb9[_0x19f69c(0x10c)]+_0x19f69c(0x194)),_0x5d6f86=a122_0x52c3ab[_0x19f69c(0x184)](_0x4063b5,_0x19f69c(0xc4)),_0x1d1ae8=a122_0x52c3ab[_0x19f69c(0x184)](_0x4063b5,_0x19f69c(0xc7));if(!a122_0x1debea['existsSync'](_0x1e31b4)||!a122_0x1debea[_0x19f69c(0x1cf)](_0x5d6f86))continue;const _0x441646=parseExperimentalArtifactYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x1e31b4,'utf-8'),_0x1e31b4),_0x4a49ca=a122_0x1debea[_0x19f69c(0x16d)](_0x5d6f86,_0x19f69c(0x1b9)),_0x2dcb61=[];if(a122_0x1debea[_0x19f69c(0x1cf)](_0x1d1ae8)){const _0x12682a=a122_0x1debea['readdirSync'](_0x1d1ae8);for(const _0x1a3908 of _0x12682a){const _0x12c409=a122_0x52c3ab['join'](_0x1d1ae8,_0x1a3908);a122_0x1debea[_0x19f69c(0x11f)](_0x12c409)['isFile']()&&_0x2dcb61[_0x19f69c(0xc9)]({'file_name':_0x1a3908,'text_content':a122_0x1debea[_0x19f69c(0x16d)](_0x12c409,'utf-8')});}}const _0x1c15e2={..._0x441646,'code':_0x4a49ca,'files':_0x2dcb61};_0x5a20a8['push']({'name':_0x441646[_0x19f69c(0x10c)],'dir':_0x4063b5,'def':_0x1c15e2});}}const _0x467111=await this['client'][_0x19f69c(0x103)](_0x10e6e9),_0x64df13=await this[_0x19f69c(0x18e)][_0x19f69c(0x145)](_0x10e6e9),_0x1496a5=await this[_0x19f69c(0x18e)][_0x19f69c(0x1c0)](_0x10e6e9),_0x38b8ce=await this[_0x19f69c(0x18e)][_0x19f69c(0xce)](_0x10e6e9),_0x141a85=await this[_0x19f69c(0x18e)]['listIntegrations'](_0x10e6e9),_0x17b2ca=await safeListOrEmpty(()=>this['client'][_0x19f69c(0x182)](_0x10e6e9)),_0x164878=await safeListOrEmpty(()=>this[_0x19f69c(0x18e)][_0x19f69c(0x1a6)](_0x10e6e9)),_0x396fba=await fetchAllToolTargetMaps((_0x25adaa,_0x3edf81)=>this[_0x19f69c(0x18e)][_0x19f69c(0xfa)](_0x25adaa,_0x3edf81),_0x10e6e9),_0x45bc83=new Map(),_0x44c449=new Map(),_0x2e1511=new Map(),_0x3a9508=new Map(),_0x4c7cd4=new Map(),_0x27a1a7=new Map(),_0x3ecf2a=new Map();for(const _0x4f5a79 of _0x467111){_0x45bc83[_0x19f69c(0x107)](_0x4f5a79[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x4f5a79);}for(const _0x4e2b53 of _0x64df13){_0x44c449['set'](_0x4e2b53[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x4e2b53);}for(const _0x3a586d of _0x1496a5){_0x2e1511[_0x19f69c(0x107)](_0x3a586d[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x3a586d);}for(const _0x5038d3 of _0x38b8ce){_0x3a9508['set'](_0x5038d3[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x5038d3);}for(const _0x34e162 of _0x141a85){_0x4c7cd4[_0x19f69c(0x107)](_0x34e162[_0x19f69c(0x11d)]['serviceType'][_0x19f69c(0x102)](),_0x34e162);}for(const _0x10277d of _0x17b2ca){_0x27a1a7[_0x19f69c(0x107)](_0x10277d[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x10277d);}for(const _0x5a2953 of _0x164878){_0x3ecf2a[_0x19f69c(0x107)](_0x5a2953[_0x19f69c(0x11d)]['name'],_0x5a2953);}const _0xdce501=new Map(),_0x595c8d=new Map();for(const _0x5b0cb8 of _0x467111){_0xdce501[_0x19f69c(0x107)](_0x5b0cb8[_0x19f69c(0x11d)]['name'],_0x5b0cb8['id']),_0x595c8d[_0x19f69c(0x107)](_0x5b0cb8['id'],_0x5b0cb8['attributes'][_0x19f69c(0x10c)]);}const _0x1f8efe=new Map(),_0x55005f=new Map();for(const _0x319616 of _0x38b8ce){_0x1f8efe[_0x19f69c(0x107)](_0x319616[_0x19f69c(0x11d)]['name'],_0x319616['id']),_0x55005f['set'](_0x319616['id'],_0x319616['attributes'][_0x19f69c(0x10c)]);}const _0xc19d7a=_0x396fba[_0x19f69c(0x13e)][_0x19f69c(0x12a)]||new Map(),_0x1a9c8=_0x396fba[_0x19f69c(0x13e)]['TextKnowledgeBase']||new Map(),_0x2cfe31=_0x396fba[_0x19f69c(0x13e)]['ExperimentalKnowledgeBase']||new Map(),_0x3caa44=new Map(),_0x5ccf0c={'resolveToolTargetName':buildNameResolver({..._0x396fba[_0x19f69c(0x139)],'Agent':_0x595c8d}),'resolvePromptName':async _0x51c8f8=>_0x55005f[_0x19f69c(0x14e)](_0x51c8f8),'onWarning':_0x448823=>this[_0x19f69c(0x114)][_0x19f69c(0x1c7)](_0x448823)};let _0x369de0=[];const _0x40e4e5={'projectId':_0x10e6e9,'resolveToolTargetId':buildIdResolver({..._0x396fba['nameToId'],'Agent':_0xdce501}),'resolvePromptId':async _0x5743e7=>_0x1f8efe[_0x19f69c(0x14e)](_0x5743e7),'onWarning':_0x3a6e75=>{const _0x49fdcc=_0x19f69c;this[_0x49fdcc(0x114)][_0x49fdcc(0x1c7)](_0x3a6e75),_0x369de0[_0x49fdcc(0xc9)](_0x3a6e75);}},{resolved:_0x315789,unresolved:_0x3aeafc}=resolveAgentDependencies(_0x2e3a8f,new Set(_0x45bc83[_0x19f69c(0x1b4)]()));for(const {agent:_0x1860ac,missingDeps:_0x2b9203}of _0x3aeafc){_0x1a417c['agents'][_0x19f69c(0xc9)]({'agentName':_0x1860ac[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x19f69c(0x1a8)+_0x2b9203[_0x19f69c(0x184)](',\x20')+'.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.'}),_0x1a417c[_0x19f69c(0x17b)]['agents'][_0x19f69c(0xd4)]++;}for(const _0x36d89c of _0x47aafa){const _0x115a0e=_0x44c449[_0x19f69c(0x14e)](_0x36d89c['yaml'][_0x19f69c(0x10c)]),_0x9f4540=a122_0x1debea['readFileSync'](_0x36d89c['path'],_0x19f69c(0x1b9));if(_0x115a0e){const _0x3139dc=apiKnowledgeBaseToYaml(_0x115a0e),_0x1990f3=toKnowledgeBaseYamlString(_0x3139dc),_0x4c71dc=generateDiff(_0x1990f3,_0x9f4540),_0x4957f8=hasChanges(_0x4c71dc);_0x4957f8?(_0x1a417c[_0x19f69c(0xbf)]['push']({'name':_0x36d89c['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x115a0e['id'],'diff':formatDiffWithColors(_0x4c71dc)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0xbf)][_0x19f69c(0x1db)]++):(_0x1a417c[_0x19f69c(0xbf)]['push']({'name':_0x36d89c['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1d1),'id':_0x115a0e['id']}),_0x1a417c[_0x19f69c(0x17b)]['knowledgeBases']['unchanged']++);}else _0x1a417c[_0x19f69c(0xbf)][_0x19f69c(0xc9)]({'name':_0x36d89c[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1)}),_0x1a417c['counts'][_0x19f69c(0xbf)][_0x19f69c(0xd1)]++;}for(const _0x2d4a17 of _0xaac714){const _0x362ea8=_0x2e1511[_0x19f69c(0x14e)](_0x2d4a17['name']),_0x5bb600=a122_0x1debea[_0x19f69c(0x16d)](_0x2d4a17[_0x19f69c(0xd2)],'utf-8');if(_0x362ea8){const _0xf0c1d3=toTextKnowledgeBaseMd(_0x362ea8['attributes'][_0x19f69c(0x10c)],_0x362ea8[_0x19f69c(0x11d)][_0x19f69c(0xc1)]),_0x121af0=generateDiff(_0xf0c1d3,_0x5bb600),_0x373131=hasChanges(_0x121af0);_0x373131?(_0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x2d4a17[_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x362ea8['id'],'diff':formatDiffWithColors(_0x121af0)}),_0x1a417c[_0x19f69c(0x17b)]['textKnowledgeBases'][_0x19f69c(0x1db)]++):(_0x1a417c['textKnowledgeBases']['push']({'name':_0x2d4a17['name'],'action':'unchanged','id':_0x362ea8['id']}),_0x1a417c[_0x19f69c(0x17b)]['textKnowledgeBases'][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x2d4a17[_0x19f69c(0x10c)],'action':_0x19f69c(0xd1)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x128)][_0x19f69c(0xd1)]++;}for(const _0x52f09a of _0x315789){const _0x5449db=_0x45bc83[_0x19f69c(0x14e)](_0x52f09a['yaml']['name']),_0x4ae434=a122_0x52c3ab[_0x19f69c(0x184)](_0x52f09a[_0x19f69c(0x13c)],_0x19f69c(0xe0)),_0x136aa8=a122_0x1debea['readFileSync'](_0x4ae434,_0x19f69c(0x1b9)),_0x22b098=_0x52f09a['systemPrompt'],_0x7b7fc=_0x19f69c(0x157)+_0x22b098+_0x19f69c(0x16c)+_0x136aa8;if(_0x5449db){const {yaml:_0x17fdb3,systemPrompt:_0x157012}=await agentResponseToDef(_0x5449db,_0x5ccf0c),_0x2ada0c=toAgentYamlString(_0x17fdb3),_0x5c2cec='#\x20prompt.md\x0a'+_0x157012+_0x19f69c(0x16c)+_0x2ada0c,_0x40d4e8=generateDiff(_0x5c2cec,_0x7b7fc),_0xba8e46=hasChanges(_0x40d4e8);_0xba8e46?(_0x1a417c[_0x19f69c(0x193)]['push']({'agentName':_0x52f09a['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'agentId':_0x5449db['id'],'diff':formatDiffWithColors(_0x40d4e8)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)]['updated']++):(_0x1a417c['agents'][_0x19f69c(0xc9)]({'agentName':_0x52f09a[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1d1),'agentId':_0x5449db['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x52f09a[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)][_0x19f69c(0xd1)]++;}for(const _0x5ccdf3 of _0x199736){const _0x194bff=_0x3a9508[_0x19f69c(0x14e)](_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x34e9b4=a122_0x1debea[_0x19f69c(0x16d)](_0x5ccdf3['path'],_0x19f69c(0x1b9));if(_0x194bff){const _0x446ed2=await apiPromptToYaml(_0x194bff,_0x5ccf0c);if(!_0x446ed2){_0x1a417c[_0x19f69c(0x122)][_0x19f69c(0xc9)]({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':'updated','id':_0x194bff['id']}),_0x1a417c[_0x19f69c(0x17b)]['prompts'][_0x19f69c(0x1db)]++;continue;}const _0xbf7587=toPromptYamlString(_0x446ed2),_0x67d434=generateDiff(_0xbf7587,_0x34e9b4),_0x3ea82a=hasChanges(_0x67d434);_0x3ea82a?(_0x1a417c['prompts']['push']({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x194bff['id'],'diff':formatDiffWithColors(_0x67d434)}),_0x1a417c['counts'][_0x19f69c(0x122)][_0x19f69c(0x1db)]++):(_0x1a417c[_0x19f69c(0x122)][_0x19f69c(0xc9)]({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1d1),'id':_0x194bff['id']}),_0x1a417c[_0x19f69c(0x17b)]['prompts'][_0x19f69c(0x1d1)]++);}else _0x1a417c['prompts'][_0x19f69c(0xc9)]({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':'created'}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x122)]['created']++;}for(const _0x154c76 of _0x43b1e6){const _0x24e7de=_0x4c7cd4[_0x19f69c(0x14e)](_0x154c76['yaml'][_0x19f69c(0x149)]),_0x388ece=a122_0x1debea['readFileSync'](_0x154c76['path'],'utf-8');if(_0x24e7de){const _0x3e2bd4=await apiIntegrationToYaml(_0x24e7de,_0x5ccf0c),_0x34bf5f=toIntegrationYamlString(_0x3e2bd4),_0x43a6f2=generateDiff(_0x34bf5f,_0x388ece),_0x2e8cbe=hasChanges(_0x43a6f2);_0x2e8cbe?(_0x1a417c[_0x19f69c(0x13a)][_0x19f69c(0xc9)]({'name':_0x154c76['yaml'][_0x19f69c(0x149)],'action':_0x19f69c(0x1db),'id':_0x24e7de['id'],'diff':formatDiffWithColors(_0x43a6f2)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)]['updated']++):(_0x1a417c[_0x19f69c(0x13a)]['push']({'name':_0x154c76[_0x19f69c(0x175)][_0x19f69c(0x149)],'action':_0x19f69c(0x1d1),'id':_0x24e7de['id']}),_0x1a417c['counts']['integrations'][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x13a)][_0x19f69c(0xc9)]({'name':_0x154c76['yaml']['service_type'],'action':_0x19f69c(0xd1)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)][_0x19f69c(0xd1)]++;}for(const _0x2ab373 of _0x496450){const _0x15a223=_0x27a1a7['get'](_0x2ab373[_0x19f69c(0x116)][_0x19f69c(0x10c)]),_0x53c159=toExperimentalKnowledgeBaseYamlString(_0x2ab373['def']);let _0x14a29b=_0x53c159;for(const _0x3acddf of _0x2ab373['def']['functions']){_0x14a29b+='\x0a---\x20function:\x20'+_0x3acddf[_0x19f69c(0x10c)]+_0x19f69c(0x1b1)+_0x3acddf['code']+_0x19f69c(0x1d8)+_0x3acddf['name']+'\x20---\x0a'+_0x3acddf[_0x19f69c(0xf1)]+'\x0a';}if(_0x15a223){const _0x4bdaf1=apiExperimentalKnowledgeBaseToYaml(_0x15a223),_0x4a6295=toExperimentalKnowledgeBaseYamlString(_0x4bdaf1);let _0x4f80be=_0x4a6295;for(const _0x5ca12a of _0x4bdaf1['functions']){_0x4f80be+=_0x19f69c(0x1a4)+_0x5ca12a[_0x19f69c(0x10c)]+_0x19f69c(0x1b1)+_0x5ca12a[_0x19f69c(0x1a2)]+_0x19f69c(0x1d8)+_0x5ca12a['name']+_0x19f69c(0x1b1)+_0x5ca12a[_0x19f69c(0xf1)]+'\x0a';}const _0x507d45=generateDiff(_0x4f80be,_0x14a29b),_0x40bc88=hasChanges(_0x507d45);_0x40bc88?(_0x1a417c[_0x19f69c(0x1af)][_0x19f69c(0xc9)]({'name':_0x2ab373[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'updated','id':_0x15a223['id'],'diff':formatDiffWithColors(_0x507d45)}),_0x1a417c['counts'][_0x19f69c(0x1af)][_0x19f69c(0x1db)]++):(_0x1a417c['experimentalKnowledgeBases'][_0x19f69c(0xc9)]({'name':_0x2ab373[_0x19f69c(0x116)]['name'],'action':_0x19f69c(0x1d1),'id':_0x15a223['id']}),_0x1a417c['counts'][_0x19f69c(0x1af)]['unchanged']++);}else _0x1a417c[_0x19f69c(0x1af)]['push']({'name':_0x2ab373[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'created'}),_0x1a417c['counts'][_0x19f69c(0x1af)][_0x19f69c(0xd1)]++;}for(const _0x30fbf1 of _0x5a20a8){const _0x5451d9=_0x3ecf2a['get'](_0x30fbf1[_0x19f69c(0x116)]['name']),_0x32c66d=toExperimentalArtifactYamlString(_0x30fbf1['def']);let _0x2933b0=_0x32c66d+('\x0a---\x20code\x20---\x0a'+_0x30fbf1[_0x19f69c(0x116)][_0x19f69c(0x1a2)]+'\x0a');for(const _0x84ec83 of _0x30fbf1[_0x19f69c(0x116)]['files']){_0x2933b0+=_0x19f69c(0x156)+_0x84ec83[_0x19f69c(0x10d)]+'\x20---\x0a'+_0x84ec83[_0x19f69c(0xfc)]+'\x0a';}if(_0x5451d9){const _0x1391b9=apiExperimentalArtifactToYaml(_0x5451d9),_0x5828fb=toExperimentalArtifactYamlString(_0x1391b9);let _0x2ca6af=_0x5828fb+(_0x19f69c(0x141)+_0x1391b9[_0x19f69c(0x1a2)]+'\x0a');for(const _0x5ee243 of _0x1391b9[_0x19f69c(0xc7)]){_0x2ca6af+='---\x20file:\x20'+_0x5ee243[_0x19f69c(0x10d)]+_0x19f69c(0x1b1)+_0x5ee243[_0x19f69c(0xfc)]+'\x0a';}const _0x353669=generateDiff(_0x2ca6af,_0x2933b0),_0x2361d4=hasChanges(_0x353669);_0x2361d4?(_0x1a417c['experimentalArtifacts']['push']({'name':_0x30fbf1[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'updated','id':_0x5451d9['id'],'diff':formatDiffWithColors(_0x353669)}),_0x1a417c[_0x19f69c(0x17b)]['experimentalArtifacts'][_0x19f69c(0x1db)]++):(_0x1a417c[_0x19f69c(0x108)][_0x19f69c(0xc9)]({'name':_0x30fbf1['def']['name'],'action':_0x19f69c(0x1d1),'id':_0x5451d9['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x108)][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x108)][_0x19f69c(0xc9)]({'name':_0x30fbf1[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'created'}),_0x1a417c[_0x19f69c(0x17b)]['experimentalArtifacts']['created']++;}if(_0x25cd44?.[_0x19f69c(0x1a3)])return _0x1a417c;_0x1a417c['knowledgeBases']=[],_0x1a417c[_0x19f69c(0x128)]=[],_0x1a417c[_0x19f69c(0x122)]=[],_0x1a417c[_0x19f69c(0x13a)]=[],_0x1a417c[_0x19f69c(0x1af)]=[],_0x1a417c[_0x19f69c(0x108)]=[];const _0x57a1cf=_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0x189)](_0x1b7aeb=>_0x1b7aeb[_0x19f69c(0xf5)]===_0x19f69c(0x118));_0x1a417c[_0x19f69c(0x193)]=_0x57a1cf,_0x1a417c[_0x19f69c(0x17b)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x57a1cf['length']},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}};for(const _0x579709 of _0x47aafa){try{const _0x4a1ca6=_0x44c449[_0x19f69c(0x14e)](_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x55e1e4=yamlKnowledgeBaseToApi(_0x579709['yaml'],_0x10e6e9);if(_0x4a1ca6)await this[_0x19f69c(0x18e)]['updateKnowledgeBase'](_0x4a1ca6['id'],_0x55e1e4),_0xc19d7a['set'](_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0x4a1ca6['id']),_0x1a417c['knowledgeBases']['push']({'name':_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x4a1ca6['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0xbf)][_0x19f69c(0x1db)]++;else{const _0x5bac3f=await this['client'][_0x19f69c(0xe5)](_0x55e1e4);_0xc19d7a[_0x19f69c(0x107)](_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0x5bac3f['id']),_0x1a417c[_0x19f69c(0xbf)][_0x19f69c(0xc9)]({'name':_0x579709['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1),'id':_0x5bac3f['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0xbf)][_0x19f69c(0xd1)]++;}}catch(_0x2f54b7){_0x1a417c[_0x19f69c(0xbf)][_0x19f69c(0xc9)]({'name':_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x2f54b7['message']}),_0x1a417c['counts'][_0x19f69c(0xbf)][_0x19f69c(0xd4)]++;}}for(const _0x95d1f3 of _0xaac714){try{const _0x8e51f9=_0x2e1511[_0x19f69c(0x14e)](_0x95d1f3[_0x19f69c(0x10c)]),_0x333ac1=yamlTextKnowledgeBaseToApi({'name':_0x95d1f3['name'],'text':_0x95d1f3[_0x19f69c(0xc1)]},_0x10e6e9);if(_0x8e51f9)await this[_0x19f69c(0x18e)][_0x19f69c(0x153)](_0x8e51f9['id'],_0x333ac1),_0x1a9c8[_0x19f69c(0x107)](_0x95d1f3[_0x19f69c(0x10c)],_0x8e51f9['id']),_0x1a417c['textKnowledgeBases']['push']({'name':_0x95d1f3['name'],'action':_0x19f69c(0x1db),'id':_0x8e51f9['id']}),_0x1a417c['counts'][_0x19f69c(0x128)][_0x19f69c(0x1db)]++;else{const _0x2be46a=await this['client']['createTextKnowledgeBase'](_0x333ac1);_0x1a9c8[_0x19f69c(0x107)](_0x95d1f3[_0x19f69c(0x10c)],_0x2be46a['id']),_0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x95d1f3['name'],'action':_0x19f69c(0xd1),'id':_0x2be46a['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x128)][_0x19f69c(0xd1)]++;}}catch(_0x55ae9f){_0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x95d1f3[_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x55ae9f[_0x19f69c(0x113)]}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x128)][_0x19f69c(0xd4)]++;}}for(const _0x45cc8b of _0x496450){try{const _0x29134a=_0x27a1a7[_0x19f69c(0x14e)](_0x45cc8b[_0x19f69c(0x116)][_0x19f69c(0x10c)]),_0x1a7b77=yamlExperimentalKnowledgeBaseToApi(_0x45cc8b['def'],_0x10e6e9);if(_0x29134a)await this[_0x19f69c(0x18e)][_0x19f69c(0x15e)](_0x29134a['id'],_0x1a7b77),_0x2cfe31['set'](_0x45cc8b['def']['name'],_0x29134a['id']),_0x1a417c['experimentalKnowledgeBases']['push']({'name':_0x45cc8b['def'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x29134a['id']}),_0x1a417c['counts'][_0x19f69c(0x1af)][_0x19f69c(0x1db)]++;else{const _0xe9cd22=await this[_0x19f69c(0x18e)][_0x19f69c(0xe8)](_0x1a7b77);_0x2cfe31[_0x19f69c(0x107)](_0x45cc8b['def'][_0x19f69c(0x10c)],_0xe9cd22['id']),_0x1a417c[_0x19f69c(0x1af)][_0x19f69c(0xc9)]({'name':_0x45cc8b[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'created','id':_0xe9cd22['id']}),_0x1a417c[_0x19f69c(0x17b)]['experimentalKnowledgeBases'][_0x19f69c(0xd1)]++;}}catch(_0x438634){_0x1a417c[_0x19f69c(0x1af)]['push']({'name':_0x45cc8b[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'error','error':_0x438634['message']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x1af)]['errors']++;}}for(const _0x5711c3 of _0x5a20a8){try{const _0x14765f=_0x3ecf2a[_0x19f69c(0x14e)](_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)]),_0x182668=yamlExperimentalArtifactToApi(_0x5711c3['def'],_0x10e6e9);if(_0x14765f)await this[_0x19f69c(0x18e)]['updateExperimentalArtifact'](_0x14765f['id'],_0x182668),_0x3caa44['set'](_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)],_0x14765f['id']),_0x1a417c['experimentalArtifacts'][_0x19f69c(0xc9)]({'name':_0x5711c3[_0x19f69c(0x116)]['name'],'action':_0x19f69c(0x1db),'id':_0x14765f['id']}),_0x1a417c[_0x19f69c(0x17b)]['experimentalArtifacts'][_0x19f69c(0x1db)]++;else{const _0x148f37=await this['client'][_0x19f69c(0x110)](_0x182668);_0x3caa44['set'](_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)],_0x148f37['id']),_0x1a417c[_0x19f69c(0x108)]['push']({'name':_0x5711c3[_0x19f69c(0x116)]['name'],'action':_0x19f69c(0xd1),'id':_0x148f37['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x108)][_0x19f69c(0xd1)]++;}}catch(_0x2745a5){_0x1a417c['experimentalArtifacts'][_0x19f69c(0xc9)]({'name':_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x2745a5[_0x19f69c(0x113)]}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x108)]['errors']++;}}for(const _0x22b724 of _0x315789){_0x369de0=[];try{const _0x223b19=_0x45bc83[_0x19f69c(0x14e)](_0x22b724[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x1c1f8b=await agentDefToRequest(_0x22b724[_0x19f69c(0x175)],_0x22b724[_0x19f69c(0xfb)],_0x22b724[_0x19f69c(0x1c8)],_0x40e4e5);if(_0x223b19)await this[_0x19f69c(0x18e)][_0x19f69c(0xf0)](_0x223b19['id'],_0x1c1f8b),_0xdce501[_0x19f69c(0x107)](_0x22b724['yaml'][_0x19f69c(0x10c)],_0x223b19['id']),_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x22b724[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'agentId':_0x223b19['id'],'warnings':_0x369de0[_0x19f69c(0xf2)]>0x0?_0x369de0:undefined}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)]['updated']++;else{const _0x259dd6=await this[_0x19f69c(0x18e)][_0x19f69c(0x18d)](_0x1c1f8b);_0xdce501[_0x19f69c(0x107)](_0x22b724['yaml'][_0x19f69c(0x10c)],_0x259dd6['id']),_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x22b724['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1),'agentId':_0x259dd6['id'],'warnings':_0x369de0[_0x19f69c(0xf2)]>0x0?_0x369de0:undefined}),_0x1a417c['counts'][_0x19f69c(0x193)][_0x19f69c(0xd1)]++;}}catch(_0x4a929c){_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x22b724[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':'error','error':_0x4a929c['message'],'warnings':_0x369de0[_0x19f69c(0xf2)]>0x0?_0x369de0:undefined}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)]['errors']++;}}for(const _0x386265 of _0x199736){try{const _0x101a8f=_0x3a9508[_0x19f69c(0x14e)](_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x751af5=await yamlPromptToApi(_0x386265['yaml'],_0x10e6e9,_0x40e4e5);if(!_0x751af5){_0x1a417c[_0x19f69c(0x122)]['push']({'name':_0x386265[_0x19f69c(0x175)]['name'],'action':_0x19f69c(0x118),'error':_0x19f69c(0x120)}),_0x1a417c[_0x19f69c(0x17b)]['prompts'][_0x19f69c(0xd4)]++;continue;}if(_0x101a8f)await this[_0x19f69c(0x18e)][_0x19f69c(0x190)](_0x101a8f['id'],_0x751af5),_0x1f8efe[_0x19f69c(0x107)](_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0x101a8f['id']),_0x1a417c[_0x19f69c(0x122)][_0x19f69c(0xc9)]({'name':_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x101a8f['id']}),_0x1a417c['counts'][_0x19f69c(0x122)][_0x19f69c(0x1db)]++;else{const _0xfd092c=await this[_0x19f69c(0x18e)][_0x19f69c(0x1b7)](_0x751af5);_0x1f8efe[_0x19f69c(0x107)](_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0xfd092c['id']),_0x1a417c[_0x19f69c(0x122)]['push']({'name':_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1),'id':_0xfd092c['id']}),_0x1a417c[_0x19f69c(0x17b)]['prompts']['created']++;}}catch(_0x3c6b99){_0x1a417c[_0x19f69c(0x122)]['push']({'name':_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x3c6b99['message']}),_0x1a417c['counts'][_0x19f69c(0x122)]['errors']++;}}for(const _0x1239d5 of _0x43b1e6){try{const _0x49ae91=_0x4c7cd4[_0x19f69c(0x14e)](_0x1239d5[_0x19f69c(0x175)][_0x19f69c(0x149)]),_0x10f0fc=await yamlIntegrationToApi(_0x1239d5[_0x19f69c(0x175)],_0x10e6e9,_0x40e4e5);if(_0x49ae91){await this[_0x19f69c(0x18e)][_0x19f69c(0x15a)](_0x49ae91['id']);const _0x1f697b=await this['client']['createIntegration'](_0x10f0fc);_0x1a417c[_0x19f69c(0x13a)]['push']({'name':_0x1239d5[_0x19f69c(0x175)][_0x19f69c(0x149)],'action':_0x19f69c(0x1db),'id':_0x1f697b['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)]['updated']++;}else{const _0x1511db=await this[_0x19f69c(0x18e)][_0x19f69c(0x1d0)](_0x10f0fc);_0x1a417c[_0x19f69c(0x13a)][_0x19f69c(0xc9)]({'name':_0x1239d5['yaml'][_0x19f69c(0x149)],'action':_0x19f69c(0xd1),'id':_0x1511db['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)][_0x19f69c(0xd1)]++;}}catch(_0x389a5b){_0x1a417c['integrations']['push']({'name':_0x1239d5[_0x19f69c(0x175)]['service_type'],'action':'error','error':_0x389a5b[_0x19f69c(0x113)]}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)]['errors']++;}}return _0x1a417c;}async[a122_0x29cadd(0x198)](_0x3fb3ee,_0x238a29,_0x5c6656,_0x527496){const _0x1c6eb9=a122_0x29cadd,{projectId:_0x37ab4d,project:_0x311f40}=await this[_0x1c6eb9(0xc5)](_0x3fb3ee),_0x341a37=_0x311f40['attributes'][_0x1c6eb9(0x10c)],_0x1d6f1d=await this[_0x1c6eb9(0x18e)][_0x1c6eb9(0x103)](_0x37ab4d),_0x4e2a6a=_0x1d6f1d[_0x1c6eb9(0x176)](_0x2691be=>_0x2691be[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]===_0x238a29);if(!_0x4e2a6a)throw new SDKError(ErrorCode[_0x1c6eb9(0xef)],_0x1c6eb9(0x169)+_0x238a29,undefined,{'helpText':_0x1c6eb9(0x105)+_0x1d6f1d[_0x1c6eb9(0x1b2)](_0x2da930=>_0x2da930['attributes'][_0x1c6eb9(0x10c)])[_0x1c6eb9(0x184)](',\x20')});let _0x4057b4;if(_0x5c6656)_0x4057b4=_0x5c6656;else{const _0x23a91d=a122_0x52c3ab['join'](process['cwd'](),_0x1c6eb9(0x193)),_0x494c04=getSanitizedPathWithMigration(_0x23a91d,_0x341a37);_0x494c04[_0x1c6eb9(0xfe)]&&this[_0x1c6eb9(0x114)][_0x1c6eb9(0xff)]('Renamed\x20folder:\x20'+a122_0x52c3ab[_0x1c6eb9(0x1d4)](_0x494c04[_0x1c6eb9(0x1b3)])+_0x1c6eb9(0x1ce)+a122_0x52c3ab[_0x1c6eb9(0x1d4)](_0x494c04[_0x1c6eb9(0xd2)])),_0x4057b4=_0x494c04[_0x1c6eb9(0xd2)];}const _0x1afe63=getSanitizedPathWithMigration(_0x4057b4,_0x238a29);_0x1afe63['renamed']&&this[_0x1c6eb9(0x114)][_0x1c6eb9(0xff)](_0x1c6eb9(0x123)+a122_0x52c3ab[_0x1c6eb9(0x1d4)](_0x1afe63[_0x1c6eb9(0x1b3)])+_0x1c6eb9(0x1ce)+a122_0x52c3ab['basename'](_0x1afe63[_0x1c6eb9(0xd2)]));const _0x31dc02=_0x1afe63[_0x1c6eb9(0xd2)],_0x4cdcbf=new Map(),_0x584b9f=new Map(),_0x56c539=await this['client'][_0x1c6eb9(0x145)](_0x37ab4d),_0x356634=await this['client']['listTextKnowledgeBases'](_0x37ab4d),_0x1e45ca=await safeListOrEmpty(()=>this[_0x1c6eb9(0x18e)][_0x1c6eb9(0x182)](_0x37ab4d)),_0x1f2c69=new Map(),_0x2f02fc=new Map();for(const _0x421e35 of _0x56c539){_0x4cdcbf[_0x1c6eb9(0x107)](_0x421e35['id'],_0x421e35['attributes'][_0x1c6eb9(0x10c)]);}for(const _0xf6d8e7 of _0x356634){_0x1f2c69['set'](_0xf6d8e7['id'],_0xf6d8e7[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]);}for(const _0x3a1fa4 of _0x1e45ca){_0x2f02fc[_0x1c6eb9(0x107)](_0x3a1fa4['id'],_0x3a1fa4[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]);}for(const _0x2dc707 of _0x1d6f1d){_0x584b9f['set'](_0x2dc707['id'],_0x2dc707[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]);}const _0x3beda8={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x4cdcbf,'TextKnowledgeBase':_0x1f2c69,'Agent':_0x584b9f,'ExperimentalKnowledgeBase':_0x2f02fc}),'resolvePromptName':async()=>undefined,'onWarning':_0x46a867=>this[_0x1c6eb9(0x114)][_0x1c6eb9(0x1c7)](_0x46a867)},_0x1e55f2=a122_0x52c3ab[_0x1c6eb9(0x184)](_0x31dc02,_0x1c6eb9(0x1d9)),_0x14900f=a122_0x52c3ab[_0x1c6eb9(0x184)](_0x31dc02,_0x1c6eb9(0xe0)),_0x4b9f69=a122_0x52c3ab['join'](_0x31dc02,_0x1c6eb9(0xdc)),_0x21cf33=!a122_0x1debea[_0x1c6eb9(0x1cf)](_0x14900f);if(_0x527496?.[_0x1c6eb9(0x1a3)])return{'agentName':_0x238a29,'outputPath':_0x31dc02,'isNew':_0x21cf33,'hasChanges':!![]};a122_0x1debea['mkdirSync'](_0x4057b4,{'recursive':!![]}),a122_0x1debea[_0x1c6eb9(0x144)](_0x31dc02,{'recursive':!![]});const _0x1e1a34=a122_0x52c3ab['join'](_0x4057b4,_0x1c6eb9(0xcf));!a122_0x1debea[_0x1c6eb9(0x1cf)](_0x1e1a34)&&a122_0x1debea[_0x1c6eb9(0x187)](_0x1e1a34,createAgentConfigContent(_0x3fb3ee));const {yaml:_0x122fa3,systemPrompt:_0x37e020,starterMessage:_0x469c72}=await agentResponseToDef(_0x4e2a6a,_0x3beda8);let _0x1ac309=_0x21cf33;if(!_0x21cf33){const _0x2b0ee9=a122_0x1debea[_0x1c6eb9(0x1cf)](_0x1e55f2)?a122_0x1debea[_0x1c6eb9(0x16d)](_0x1e55f2,_0x1c6eb9(0x1b9)):'',_0x4ddffc=a122_0x1debea[_0x1c6eb9(0x16d)](_0x14900f,'utf-8');_0x1ac309=_0x2b0ee9!==_0x37e020||_0x4ddffc!==toAgentYamlString(_0x122fa3);}a122_0x1debea[_0x1c6eb9(0x187)](_0x1e55f2,_0x37e020),a122_0x1debea[_0x1c6eb9(0x187)](_0x14900f,toAgentYamlString(_0x122fa3));if(_0x469c72&&_0x469c72['includes']('\x0a'))a122_0x1debea[_0x1c6eb9(0x187)](_0x4b9f69,_0x469c72);else a122_0x1debea[_0x1c6eb9(0x1cf)](_0x4b9f69)&&a122_0x1debea[_0x1c6eb9(0xdf)](_0x4b9f69);return{'agentName':_0x238a29,'outputPath':_0x31dc02,'isNew':_0x21cf33,'hasChanges':_0x1ac309};}async[a122_0x29cadd(0x196)](_0xce24c1,_0x53351f){const _0x5b700a=a122_0x29cadd;let _0x5028c8;isAgentYamlPath(_0xce24c1)?_0x5028c8=getAgentDirFromYamlPath(_0xce24c1):_0x5028c8=_0xce24c1;const {config:_0x5e3106}=findAgentConfig(_0x5028c8),_0x1df88c=await this[_0x5b700a(0x178)](_0x5e3106[_0x5b700a(0x1dd)]),_0x52fdc0=a122_0x52c3ab[_0x5b700a(0x184)](_0x5028c8,_0x5b700a(0xe0)),_0x3ee79e=a122_0x52c3ab['join'](_0x5028c8,_0x5b700a(0x1d9)),_0x5e50ec=a122_0x52c3ab[_0x5b700a(0x184)](_0x5028c8,_0x5b700a(0xdc));if(!a122_0x1debea['existsSync'](_0x52fdc0))throw new SDKError(ErrorCode[_0x5b700a(0x1de)],'agent.yml\x20not\x20found\x20in\x20'+_0x5028c8,undefined,{'helpText':_0x5b700a(0x1d5)});const _0x26d241=parseAgentYaml(a122_0x1debea[_0x5b700a(0x16d)](_0x52fdc0,_0x5b700a(0x1b9)),_0x52fdc0),_0x2931c7=a122_0x1debea['existsSync'](_0x3ee79e)?a122_0x1debea[_0x5b700a(0x16d)](_0x3ee79e,_0x5b700a(0x1b9)):'',_0x4210cd=a122_0x1debea[_0x5b700a(0x1cf)](_0x5e50ec)?a122_0x1debea['readFileSync'](_0x5e50ec,'utf-8'):_0x26d241[_0x5b700a(0x1df)];if(_0x53351f?.[_0x5b700a(0x1a3)])return{'agentName':_0x26d241[_0x5b700a(0x10c)],'action':'created','projectId':_0x1df88c};const _0x355209=await this[_0x5b700a(0x18e)][_0x5b700a(0x103)](_0x1df88c),_0x445933=await fetchAllToolTargetMaps((_0xa993e3,_0x56971d)=>this[_0x5b700a(0x18e)][_0x5b700a(0xfa)](_0xa993e3,_0x56971d),_0x1df88c),_0x13c6d0=new Map();for(const _0x29833c of _0x355209){_0x13c6d0['set'](_0x29833c[_0x5b700a(0x11d)][_0x5b700a(0x10c)],_0x29833c['id']);}const _0x443c16=[],_0x3f757c={'projectId':_0x1df88c,'resolveToolTargetId':buildIdResolver({..._0x445933[_0x5b700a(0x13e)],'Agent':_0x13c6d0}),'resolvePromptId':async()=>undefined,'onWarning':_0x28b6be=>{const _0x21bc53=_0x5b700a;this[_0x21bc53(0x114)][_0x21bc53(0x1c7)](_0x28b6be),_0x443c16['push'](_0x28b6be);}};try{const _0x18eace=_0x355209[_0x5b700a(0x176)](_0x4e3377=>_0x4e3377['attributes']['name']===_0x26d241['name']),_0x46118e=await agentDefToRequest(_0x26d241,_0x2931c7,_0x4210cd,_0x3f757c);if(_0x18eace)return await this[_0x5b700a(0x18e)]['updateAgentResponse'](_0x18eace['id'],_0x46118e),{'agentName':_0x26d241[_0x5b700a(0x10c)],'action':_0x5b700a(0x1db),'projectId':_0x1df88c,'agentId':_0x18eace['id'],'warnings':_0x443c16[_0x5b700a(0xf2)]>0x0?_0x443c16:undefined};else{const _0x1c840c=await this[_0x5b700a(0x18e)][_0x5b700a(0x18d)](_0x46118e);return{'agentName':_0x26d241['name'],'action':'created','projectId':_0x1df88c,'agentId':_0x1c840c['id'],'warnings':_0x443c16[_0x5b700a(0xf2)]>0x0?_0x443c16:undefined};}}catch(_0x4a5f91){return{'agentName':_0x26d241[_0x5b700a(0x10c)],'action':'error','projectId':_0x1df88c,'error':_0x4a5f91['message'],'warnings':_0x443c16[_0x5b700a(0xf2)]>0x0?_0x443c16:undefined};}}async['cloneProject'](_0x308c97,_0x375c60,_0x262826){const _0x31d555=a122_0x29cadd,_0x4dfcf5=a122_0x1debea[_0x31d555(0x1cf)](_0x308c97)&&a122_0x1debea['existsSync'](a122_0x52c3ab[_0x31d555(0x184)](_0x308c97,'tdx.json'));let _0x3e1702;const _0x4d48b8=[],_0x59c0bd=[],_0xea8833=[],_0x14f92f=[],_0x2dfd6c=[],_0x411864=[],_0x2f7096=[];if(_0x4dfcf5){const _0x3851d5=loadAgentConfig(a122_0x52c3ab[_0x31d555(0x184)](_0x308c97,'tdx.json'));_0x3e1702=_0x3851d5[_0x31d555(0x1dd)];const _0x397397=a122_0x1debea[_0x31d555(0xee)](_0x308c97,{'withFileTypes':!![]});for(const _0x3b22e3 of _0x397397){if(!_0x3b22e3[_0x31d555(0xea)]())continue;if(['knowledge_bases',_0x31d555(0x1bf),'experimental_artifacts',_0x31d555(0x122),_0x31d555(0x13a)][_0x31d555(0x15d)](_0x3b22e3[_0x31d555(0x10c)]))continue;const _0x4fcec8=a122_0x52c3ab['join'](_0x308c97,_0x3b22e3[_0x31d555(0x10c)]);if(isAgentDir(_0x4fcec8)){const _0xb07bc8=a122_0x52c3ab[_0x31d555(0x184)](_0x4fcec8,'agent.yml'),_0x98135e=a122_0x52c3ab[_0x31d555(0x184)](_0x4fcec8,'prompt.md'),_0x2b0438=a122_0x52c3ab[_0x31d555(0x184)](_0x4fcec8,_0x31d555(0xdc)),_0x3cf36e=parseAgentYaml(a122_0x1debea[_0x31d555(0x16d)](_0xb07bc8,_0x31d555(0x1b9)),_0xb07bc8),_0x4a212a=a122_0x1debea[_0x31d555(0x1cf)](_0x98135e)?a122_0x1debea[_0x31d555(0x16d)](_0x98135e,_0x31d555(0x1b9)):'',_0x5afa2e=a122_0x1debea[_0x31d555(0x1cf)](_0x2b0438)?a122_0x1debea[_0x31d555(0x16d)](_0x2b0438,_0x31d555(0x1b9)):_0x3cf36e[_0x31d555(0x1df)];_0x4d48b8[_0x31d555(0xc9)]({'name':_0x3cf36e[_0x31d555(0x10c)],'dir':_0x4fcec8,'yaml':_0x3cf36e,'systemPrompt':_0x4a212a,'starterMessage':_0x5afa2e});}}const _0x465319=getKnowledgeBasesDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x465319)){const _0x3d992f=a122_0x1debea['readdirSync'](_0x465319);for(const _0x256160 of _0x3d992f){const _0x236861=a122_0x52c3ab[_0x31d555(0x184)](_0x465319,_0x256160);if(_0x256160[_0x31d555(0x191)](_0x31d555(0x194))){const _0x102547=parseKnowledgeBaseYaml(a122_0x1debea['readFileSync'](_0x236861,_0x31d555(0x1b9)),_0x236861);_0x59c0bd['push']({'name':_0x102547[_0x31d555(0x10c)],'path':_0x236861,'yaml':_0x102547});}else{if(_0x256160[_0x31d555(0x191)](_0x31d555(0x16a))){const _0x21c94f=a122_0x1debea[_0x31d555(0x16d)](_0x236861,_0x31d555(0x1b9)),{name:_0x10a75c,text:_0x74b7fc}=parseTextKnowledgeBaseMd(_0x21c94f,_0x256160);_0xea8833[_0x31d555(0xc9)]({'name':_0x10a75c,'path':_0x236861,'text':_0x74b7fc});}}}}const _0x4c096c=getPromptsDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x4c096c)){const _0x4e1773=a122_0x1debea[_0x31d555(0xee)](_0x4c096c)[_0x31d555(0x189)](_0x4c5968=>_0x4c5968[_0x31d555(0x191)]('.yml'));for(const _0x59acc2 of _0x4e1773){const _0x4ebab1=a122_0x52c3ab[_0x31d555(0x184)](_0x4c096c,_0x59acc2),_0x30d6f0=parsePromptYaml(a122_0x1debea[_0x31d555(0x16d)](_0x4ebab1,_0x31d555(0x1b9)),_0x4ebab1);_0x14f92f['push']({'name':_0x30d6f0[_0x31d555(0x10c)],'path':_0x4ebab1,'yaml':_0x30d6f0});}}const _0x641cf6=getIntegrationsDir(_0x308c97);if(a122_0x1debea['existsSync'](_0x641cf6)){const _0x3d8f46=a122_0x1debea[_0x31d555(0xee)](_0x641cf6)[_0x31d555(0x189)](_0x478ac6=>_0x478ac6[_0x31d555(0x191)](_0x31d555(0x194)));for(const _0x462bdb of _0x3d8f46){const _0x2b28e5=a122_0x52c3ab[_0x31d555(0x184)](_0x641cf6,_0x462bdb),_0x1edc23=parseIntegrationYaml(a122_0x1debea[_0x31d555(0x16d)](_0x2b28e5,'utf-8'),_0x2b28e5);SAFE_INTEGRATION_TYPES[_0x31d555(0x15d)](_0x1edc23[_0x31d555(0x149)][_0x31d555(0x102)]())?_0x2dfd6c[_0x31d555(0xc9)]({'name':_0x1edc23['name'],'path':_0x2b28e5,'yaml':_0x1edc23}):this[_0x31d555(0x114)][_0x31d555(0x1c7)]('Skipping\x20integration\x20\x27'+_0x1edc23[_0x31d555(0x10c)]+_0x31d555(0xda)+_0x1edc23[_0x31d555(0x149)]+_0x31d555(0x19a)+(_0x31d555(0x11e)+SAFE_INTEGRATION_TYPES[_0x31d555(0x184)](',\x20')+_0x31d555(0x1b0)));}}const _0x496515=getExperimentalKnowledgeBasesDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x496515)){const _0x1d8c7b=a122_0x1debea['readdirSync'](_0x496515,{'withFileTypes':!![]});for(const _0x12de49 of _0x1d8c7b){if(!_0x12de49[_0x31d555(0xea)]())continue;const _0x564d6b=a122_0x52c3ab[_0x31d555(0x184)](_0x496515,_0x12de49['name']),_0x270301=a122_0x52c3ab[_0x31d555(0x184)](_0x564d6b,_0x12de49[_0x31d555(0x10c)]+_0x31d555(0x194));if(a122_0x1debea[_0x31d555(0x1cf)](_0x270301)){const _0xa9d22e=parseExperimentalKnowledgeBaseYaml(a122_0x1debea['readFileSync'](_0x270301,_0x31d555(0x1b9)),_0x270301),_0x2cbb47=a122_0x52c3ab[_0x31d555(0x184)](_0x564d6b,_0x31d555(0x18c)),_0x354356=[];if(a122_0x1debea[_0x31d555(0x1cf)](_0x2cbb47)){const _0x2e3105=a122_0x1debea[_0x31d555(0xee)](_0x2cbb47,{'withFileTypes':!![]});for(const _0xa3a5ae of _0x2e3105){if(!_0xa3a5ae[_0x31d555(0xea)]())continue;const _0x485e66=a122_0x52c3ab[_0x31d555(0x184)](_0x2cbb47,_0xa3a5ae[_0x31d555(0x10c)]),_0x5e04e5=a122_0x52c3ab[_0x31d555(0x184)](_0x485e66,_0x31d555(0xc4)),_0x10fa6f=a122_0x52c3ab[_0x31d555(0x184)](_0x485e66,_0x31d555(0x1c3));if(a122_0x1debea[_0x31d555(0x1cf)](_0x5e04e5)&&a122_0x1debea['existsSync'](_0x10fa6f)){const _0x11d627=a122_0x1debea[_0x31d555(0x16d)](_0x5e04e5,_0x31d555(0x1b9)),_0x5d1761=a122_0x1debea[_0x31d555(0x16d)](_0x10fa6f,'utf-8');_0x354356[_0x31d555(0xc9)]({'name':_0xa3a5ae[_0x31d555(0x10c)],'code':_0x11d627,'json_schema':_0x5d1761});}}}const _0x5a6aa3={..._0xa9d22e,'functions':_0x354356};_0x411864['push']({'name':_0xa9d22e[_0x31d555(0x10c)],'path':_0x564d6b,'def':_0x5a6aa3});}}}const _0x3dad96=getExperimentalArtifactsDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x3dad96)){const _0x25a3d9=a122_0x1debea['readdirSync'](_0x3dad96,{'withFileTypes':!![]});for(const _0x2e1dcd of _0x25a3d9){if(!_0x2e1dcd['isDirectory']())continue;const _0x2b7cf2=a122_0x52c3ab[_0x31d555(0x184)](_0x3dad96,_0x2e1dcd[_0x31d555(0x10c)]),_0x1ad094=a122_0x52c3ab[_0x31d555(0x184)](_0x2b7cf2,_0x2e1dcd['name']+_0x31d555(0x194));if(a122_0x1debea[_0x31d555(0x1cf)](_0x1ad094)){const _0x18d7f8=parseExperimentalArtifactYaml(a122_0x1debea['readFileSync'](_0x1ad094,_0x31d555(0x1b9)),_0x1ad094),_0x3e0e43=a122_0x52c3ab[_0x31d555(0x184)](_0x2b7cf2,_0x31d555(0xc4)),_0x40a171=a122_0x1debea[_0x31d555(0x1cf)](_0x3e0e43)?a122_0x1debea[_0x31d555(0x16d)](_0x3e0e43,'utf-8'):'',_0x37ddfb=a122_0x52c3ab['join'](_0x2b7cf2,_0x31d555(0xc7)),_0x4f0195=[];if(a122_0x1debea[_0x31d555(0x1cf)](_0x37ddfb)){const _0x26af33=a122_0x1debea['readdirSync'](_0x37ddfb);for(const _0x5e5db2 of _0x26af33){const _0x39ac01=a122_0x52c3ab[_0x31d555(0x184)](_0x37ddfb,_0x5e5db2);if(a122_0x1debea['statSync'](_0x39ac01)['isFile']()){const _0x31c03a=a122_0x1debea['readFileSync'](_0x39ac01,'utf-8');_0x4f0195[_0x31d555(0xc9)]({'file_name':_0x5e5db2,'text_content':_0x31c03a});}}}const _0x4831f3={..._0x18d7f8,'code':_0x40a171,'files':_0x4f0195};_0x2f7096[_0x31d555(0xc9)]({'name':_0x18d7f8[_0x31d555(0x10c)],'path':_0x2b7cf2,'def':_0x4831f3});}}}}else{const _0x4eb88f=await this[_0x31d555(0x178)](_0x308c97),_0x256074=await this[_0x31d555(0x18e)][_0x31d555(0xd7)](_0x4eb88f);_0x3e1702=_0x256074[_0x31d555(0x11d)][_0x31d555(0x10c)];const _0x38031b=await this[_0x31d555(0x18e)][_0x31d555(0x103)](_0x4eb88f),_0x4b5d98=await this[_0x31d555(0x18e)][_0x31d555(0x145)](_0x4eb88f),_0x29c73b=await this[_0x31d555(0x18e)][_0x31d555(0x1c0)](_0x4eb88f),_0x70bcc9=await this[_0x31d555(0x18e)][_0x31d555(0xce)](_0x4eb88f),_0xf0a777=await this[_0x31d555(0x18e)]['listIntegrations'](_0x4eb88f),_0x2613e7=await safeListOrEmpty(()=>this[_0x31d555(0x18e)][_0x31d555(0x182)](_0x4eb88f)),_0x394850=await safeListOrEmpty(()=>this[_0x31d555(0x18e)]['listExperimentalArtifacts'](_0x4eb88f)),_0x19fbcf=new Map(),_0x494638=new Map(),_0x2aebcd=new Map(),_0x4a083c=new Map(),_0x389fb2=new Map(),_0x59e087=new Map();for(const _0x313a21 of _0x4b5d98){_0x19fbcf[_0x31d555(0x107)](_0x313a21['id'],_0x313a21[_0x31d555(0x11d)]['name']);}for(const _0x45fb8e of _0x29c73b){_0x494638['set'](_0x45fb8e['id'],_0x45fb8e[_0x31d555(0x11d)][_0x31d555(0x10c)]);}for(const _0x331c16 of _0x38031b){_0x2aebcd[_0x31d555(0x107)](_0x331c16['id'],_0x331c16[_0x31d555(0x11d)]['name']);}for(const _0x4f8e30 of _0x70bcc9){_0x4a083c[_0x31d555(0x107)](_0x4f8e30['id'],_0x4f8e30[_0x31d555(0x11d)][_0x31d555(0x10c)]);}for(const _0x1a4ff2 of _0x2613e7){_0x389fb2['set'](_0x1a4ff2['id'],_0x1a4ff2[_0x31d555(0x11d)]['name']);}for(const _0x12fe7b of _0x394850){_0x59e087['set'](_0x12fe7b['id'],_0x12fe7b['attributes'][_0x31d555(0x10c)]);}const _0x148ba0={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x19fbcf,'TextKnowledgeBase':_0x494638,'Agent':_0x2aebcd,'ExperimentalKnowledgeBase':_0x389fb2}),'resolvePromptName':async _0x49bacc=>_0x4a083c[_0x31d555(0x14e)](_0x49bacc),'onWarning':_0x41fa5f=>this[_0x31d555(0x114)][_0x31d555(0x1c7)](_0x41fa5f)};for(const _0x192308 of _0x38031b){const _0x25ed7b=await agentResponseToDef(_0x192308,_0x148ba0),{yaml:_0x12b428,systemPrompt:_0x4157f0,starterMessage:_0x31b7f1}=_0x25ed7b;_0x4d48b8['push']({'name':_0x12b428['name'],'dir':'','yaml':_0x12b428,'systemPrompt':_0x4157f0,'starterMessage':_0x31b7f1});}for(const _0x80d167 of _0x4b5d98){const _0x2eb0f7=apiKnowledgeBaseToYaml(_0x80d167);_0x59c0bd['push']({'name':_0x2eb0f7[_0x31d555(0x10c)],'path':'','yaml':_0x2eb0f7});}for(const _0xa2e9f6 of _0x29c73b){_0xea8833[_0x31d555(0xc9)]({'name':_0xa2e9f6[_0x31d555(0x11d)][_0x31d555(0x10c)],'path':'','text':_0xa2e9f6[_0x31d555(0x11d)][_0x31d555(0xc1)]});}for(const _0x4e442e of _0x70bcc9){const _0xc4dfa2=await apiPromptToYaml(_0x4e442e,_0x148ba0);_0xc4dfa2&&_0x14f92f[_0x31d555(0xc9)]({'name':_0xc4dfa2[_0x31d555(0x10c)],'path':'','yaml':_0xc4dfa2});}for(const _0x1e45a9 of _0xf0a777){if(!_0x1e45a9[_0x31d555(0x11d)][_0x31d555(0x154)]&&SAFE_INTEGRATION_TYPES[_0x31d555(0x15d)](_0x1e45a9['attributes'][_0x31d555(0x17f)][_0x31d555(0x102)]())){const _0x2f2c0f=await apiIntegrationToYaml(_0x1e45a9,_0x148ba0);_0x2dfd6c[_0x31d555(0xc9)]({'name':_0x1e45a9['attributes'][_0x31d555(0x17f)][_0x31d555(0x102)](),'path':'','yaml':_0x2f2c0f});}}for(const _0xaae233 of _0x2613e7){const _0xfb391d=apiExperimentalKnowledgeBaseToYaml(_0xaae233);_0x411864[_0x31d555(0xc9)]({'name':_0xfb391d[_0x31d555(0x10c)],'path':'','def':_0xfb391d});}for(const _0x308aa4 of _0x394850){const _0xfdd241=apiExperimentalArtifactToYaml(_0x308aa4);_0x2f7096['push']({'name':_0xfdd241['name'],'path':'','def':_0xfdd241});}}const _0x30598c={'sourceProjectName':_0x3e1702,'newProjectName':_0x375c60,'newProjectId':'','agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'imageGenerators':[],'webSearchTools':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'imageGenerators':{'created':0x0,'errors':0x0},'webSearchTools':{'created':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x19b16f=await this[_0x31d555(0x18e)][_0x31d555(0x134)](),_0x331599=_0x19b16f[_0x31d555(0x176)](_0x4c9071=>_0x4c9071[_0x31d555(0x11d)]['name']===_0x375c60);if(_0x331599)throw new SDKError(ErrorCode[_0x31d555(0x1a7)],_0x31d555(0x13b)+_0x375c60+_0x31d555(0x16f),undefined,{'helpText':'Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.'});if(_0x262826?.['dryRun'])return _0x30598c[_0x31d555(0x17b)][_0x31d555(0x193)][_0x31d555(0xd1)]=_0x4d48b8[_0x31d555(0xf2)],_0x30598c['counts'][_0x31d555(0xbf)][_0x31d555(0xd1)]=_0x59c0bd[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x128)][_0x31d555(0xd1)]=_0xea8833[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1af)][_0x31d555(0xd1)]=_0x411864['length'],_0x30598c['counts'][_0x31d555(0x108)][_0x31d555(0xd1)]=_0x2f7096[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd1)]=_0x14f92f[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x13a)][_0x31d555(0xd1)]=_0x2dfd6c[_0x31d555(0xf2)],_0x30598c;const _0x5a995d=await this[_0x31d555(0x18e)][_0x31d555(0x1c1)]({'name':_0x375c60}),_0x54bc97=_0x5a995d['id'];_0x30598c[_0x31d555(0x10b)]=_0x54bc97;const _0x376d5d=new Map(),_0x22c335=new Map(),_0x4f68bf=new Map(),_0x27df8e=new Map(),_0x45f098=new Map(),_0x2caaff=new Map(),_0xbbe5ae=new Map(),_0x3dffdd=new Map(),_0x5bab08=new Set(),_0x20546c=new Set();for(const _0x1f63df of _0x4d48b8){for(const _0x26bdd1 of _0x1f63df[_0x31d555(0x175)][_0x31d555(0x1c5)]||[]){if(_0x26bdd1['type']===_0x31d555(0x125)&&_0x26bdd1[_0x31d555(0x1bd)]){const _0x4d8820=parseRef(_0x26bdd1['target']);if(_0x4d8820)_0x5bab08[_0x31d555(0xe6)](_0x4d8820[_0x31d555(0x10c)]);}else{if(_0x26bdd1[_0x31d555(0x126)]===_0x31d555(0x1c9)&&_0x26bdd1[_0x31d555(0x1bd)]){const _0x5c2f32=parseRef(_0x26bdd1[_0x31d555(0x1bd)]);if(_0x5c2f32)_0x20546c[_0x31d555(0xe6)](_0x5c2f32[_0x31d555(0x10c)]);}}}}for(const _0x514c94 of _0x5bab08){try{const _0x50daff=await this[_0x31d555(0x18e)]['createImageGenerator']({'projectId':_0x54bc97,'name':_0x514c94});_0x45f098[_0x31d555(0x107)](_0x514c94,_0x50daff['id']),_0x30598c[_0x31d555(0x1e0)][_0x31d555(0xc9)]({'name':_0x514c94,'action':_0x31d555(0xd1),'id':_0x50daff['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1e0)][_0x31d555(0xd1)]++;}catch(_0x23c5b5){_0x30598c['imageGenerators'][_0x31d555(0xc9)]({'name':_0x514c94,'action':'error','error':_0x23c5b5[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1e0)][_0x31d555(0xd4)]++;}}for(const _0x4a1d3f of _0x20546c){try{const _0x720d4f=await this[_0x31d555(0x18e)]['createWebSearchTool']({'projectId':_0x54bc97,'name':_0x4a1d3f});_0x2caaff[_0x31d555(0x107)](_0x4a1d3f,_0x720d4f['id']),_0x30598c['webSearchTools']['push']({'name':_0x4a1d3f,'action':_0x31d555(0xd1),'id':_0x720d4f['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xc3)]['created']++;}catch(_0x11940f){_0x30598c['webSearchTools']['push']({'name':_0x4a1d3f,'action':_0x31d555(0x118),'error':_0x11940f[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xc3)]['errors']++;}}const _0x466984=await fetchAllToolTargetMaps((_0x5c3317,_0x3edb70)=>this[_0x31d555(0x18e)][_0x31d555(0xfa)](_0x5c3317,_0x3edb70),_0x54bc97);let _0x1fa648=[];const _0x3c738b={'projectId':_0x54bc97,'resolveToolTargetId':buildIdResolver({..._0x466984[_0x31d555(0x13e)],'KnowledgeBase':_0x376d5d,'TextKnowledgeBase':_0x22c335,'ExperimentalKnowledgeBase':_0xbbe5ae,'Agent':_0x4f68bf,'WebSearchTool':_0x2caaff,'ImageGenerator':_0x45f098}),'resolvePromptId':async _0x3aaef7=>_0x27df8e[_0x31d555(0x14e)](_0x3aaef7),'onWarning':_0x4602e3=>{const _0x11c125=_0x31d555;this[_0x11c125(0x114)][_0x11c125(0x1c7)](_0x4602e3),_0x1fa648[_0x11c125(0xc9)](_0x4602e3);}};for(const _0x206a1a of _0x59c0bd){try{const _0x3ba890=yamlKnowledgeBaseToApi(_0x206a1a[_0x31d555(0x175)],_0x54bc97),_0x5e1fed=await this[_0x31d555(0x18e)][_0x31d555(0xe5)](_0x3ba890);_0x376d5d[_0x31d555(0x107)](_0x206a1a['yaml'][_0x31d555(0x10c)],_0x5e1fed['id']),_0x30598c[_0x31d555(0xbf)][_0x31d555(0xc9)]({'name':_0x206a1a['yaml'][_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0x5e1fed['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xbf)][_0x31d555(0xd1)]++;}catch(_0x13dca6){_0x30598c['knowledgeBases'][_0x31d555(0xc9)]({'name':_0x206a1a[_0x31d555(0x175)]['name'],'action':_0x31d555(0x118),'error':_0x13dca6[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xbf)][_0x31d555(0xd4)]++;}}for(const _0x3f8d42 of _0xea8833){try{const _0x338a9d=yamlTextKnowledgeBaseToApi({'name':_0x3f8d42['name'],'text':_0x3f8d42[_0x31d555(0xc1)]},_0x54bc97),_0x3dc65b=await this[_0x31d555(0x18e)][_0x31d555(0x111)](_0x338a9d);_0x22c335[_0x31d555(0x107)](_0x3f8d42[_0x31d555(0x10c)],_0x3dc65b['id']),_0x30598c[_0x31d555(0x128)][_0x31d555(0xc9)]({'name':_0x3f8d42[_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0x3dc65b['id']}),_0x30598c[_0x31d555(0x17b)]['textKnowledgeBases'][_0x31d555(0xd1)]++;}catch(_0x470a5d){_0x30598c['textKnowledgeBases'][_0x31d555(0xc9)]({'name':_0x3f8d42['name'],'action':_0x31d555(0x118),'error':_0x470a5d[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x128)][_0x31d555(0xd4)]++;}}for(const _0x2ecc63 of _0x2f7096){try{const _0x5d1916=yamlExperimentalArtifactToApi(_0x2ecc63[_0x31d555(0x116)],_0x54bc97),_0x5bf9f0=await this[_0x31d555(0x18e)][_0x31d555(0x110)](_0x5d1916);_0x3dffdd[_0x31d555(0x107)](_0x2ecc63[_0x31d555(0x116)][_0x31d555(0x10c)],_0x5bf9f0['id']),_0x30598c[_0x31d555(0x108)]['push']({'name':_0x2ecc63[_0x31d555(0x116)][_0x31d555(0x10c)],'action':'created','id':_0x5bf9f0['id']}),_0x30598c['counts']['experimentalArtifacts'][_0x31d555(0xd1)]++;}catch(_0x3e3300){_0x30598c[_0x31d555(0x108)]['push']({'name':_0x2ecc63[_0x31d555(0x116)][_0x31d555(0x10c)],'action':'error','error':_0x3e3300[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x108)][_0x31d555(0xd4)]++;}}for(const _0x5ab1ba of _0x411864){try{const _0x1098bc=yamlExperimentalKnowledgeBaseToApi(_0x5ab1ba[_0x31d555(0x116)],_0x54bc97),_0x42db74=await this['client']['createExperimentalKnowledgeBase'](_0x1098bc);_0xbbe5ae['set'](_0x5ab1ba['def'][_0x31d555(0x10c)],_0x42db74['id']),_0x30598c[_0x31d555(0x1af)][_0x31d555(0xc9)]({'name':_0x5ab1ba[_0x31d555(0x116)][_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0x42db74['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1af)][_0x31d555(0xd1)]++;}catch(_0x2860bb){_0x30598c[_0x31d555(0x1af)]['push']({'name':_0x5ab1ba[_0x31d555(0x116)][_0x31d555(0x10c)],'action':'error','error':_0x2860bb[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)]['experimentalKnowledgeBases'][_0x31d555(0xd4)]++;}}const _0x274f88=[..._0x4d48b8][_0x31d555(0xeb)]((_0x1a1ff2,_0x112dbc)=>{const _0x1aac86=_0x31d555,_0xc7eab5=_0x1a1ff2[_0x1aac86(0x175)][_0x1aac86(0x1c5)]?.[_0x1aac86(0x12f)](_0x57471b=>_0x57471b['type']===_0x1aac86(0xc8))??![],_0x4bd0c2=_0x112dbc['yaml'][_0x1aac86(0x1c5)]?.[_0x1aac86(0x12f)](_0x1433cc=>_0x1433cc[_0x1aac86(0x126)]===_0x1aac86(0xc8))??![];if(_0xc7eab5&&!_0x4bd0c2)return 0x1;if(!_0xc7eab5&&_0x4bd0c2)return-0x1;return 0x0;});for(const _0x1354ee of _0x274f88){_0x1fa648=[];try{const _0x55d3b4=_0x1354ee[_0x31d555(0x175)][_0x31d555(0x1c5)]?.[_0x31d555(0x189)](_0x353986=>{const _0x156b18=_0x31d555;if(_0x353986[_0x156b18(0x126)]===_0x156b18(0xc8)&&_0x353986[_0x156b18(0x1bd)]){const _0x26e604=parseRef(_0x353986[_0x156b18(0x1bd)]);return _0x26e604?.[_0x156b18(0x10c)]===_0x1354ee['yaml'][_0x156b18(0x10c)];}return![];})??[];if(_0x55d3b4[_0x31d555(0xf2)]>0x0){const _0x499483=_0x31d555(0x1da)+_0x1354ee['yaml'][_0x31d555(0x10c)]+'\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20'+_0x31d555(0xd6);this[_0x31d555(0x114)][_0x31d555(0x1c7)](_0x499483),_0x1fa648['push'](_0x499483);}const _0x3f83c2=await agentDefToRequest(_0x1354ee[_0x31d555(0x175)],_0x1354ee[_0x31d555(0xfb)],_0x1354ee[_0x31d555(0x1c8)],_0x3c738b),_0x2e8f0e=await this[_0x31d555(0x18e)][_0x31d555(0x18d)](_0x3f83c2);_0x4f68bf[_0x31d555(0x107)](_0x1354ee[_0x31d555(0x175)][_0x31d555(0x10c)],_0x2e8f0e['id']),_0x30598c[_0x31d555(0x193)]['push']({'agentName':_0x1354ee[_0x31d555(0x175)][_0x31d555(0x10c)],'action':'created','agentId':_0x2e8f0e['id'],'warnings':_0x1fa648['length']>0x0?_0x1fa648:undefined}),_0x30598c['counts']['agents']['created']++;}catch(_0x5f176d){_0x30598c[_0x31d555(0x193)][_0x31d555(0xc9)]({'agentName':_0x1354ee[_0x31d555(0x175)]['name'],'action':_0x31d555(0x118),'error':_0x5f176d[_0x31d555(0x113)],'warnings':_0x1fa648[_0x31d555(0xf2)]>0x0?_0x1fa648:undefined}),_0x30598c['counts'][_0x31d555(0x193)][_0x31d555(0xd4)]++;}}for(const _0x3a1167 of _0x14f92f){try{const _0x1234eb=await yamlPromptToApi(_0x3a1167['yaml'],_0x54bc97,_0x3c738b);if(!_0x1234eb){_0x30598c[_0x31d555(0x122)]['push']({'name':_0x3a1167['yaml'][_0x31d555(0x10c)],'action':_0x31d555(0x118),'error':_0x31d555(0x120)}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd4)]++;continue;}const _0xfd92c7=await this[_0x31d555(0x18e)][_0x31d555(0x1b7)](_0x1234eb);_0x27df8e['set'](_0x3a1167[_0x31d555(0x175)]['name'],_0xfd92c7['id']),_0x30598c[_0x31d555(0x122)]['push']({'name':_0x3a1167[_0x31d555(0x175)][_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0xfd92c7['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd1)]++;}catch(_0x57c4b3){_0x30598c[_0x31d555(0x122)][_0x31d555(0xc9)]({'name':_0x3a1167[_0x31d555(0x175)][_0x31d555(0x10c)],'action':_0x31d555(0x118),'error':_0x57c4b3[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd4)]++;}}for(const _0x38c7b9 of _0x2dfd6c){try{const _0xd28793=await yamlIntegrationToApi(_0x38c7b9[_0x31d555(0x175)],_0x54bc97,_0x3c738b),_0x97b9d1=await this[_0x31d555(0x18e)][_0x31d555(0x1d0)](_0xd28793);_0x30598c[_0x31d555(0x13a)]['push']({'name':_0x38c7b9['yaml']['service_type'],'action':_0x31d555(0xd1),'id':_0x97b9d1['id']}),_0x30598c['counts'][_0x31d555(0x13a)][_0x31d555(0xd1)]++;}catch(_0x570f5f){_0x30598c[_0x31d555(0x13a)][_0x31d555(0xc9)]({'name':_0x38c7b9[_0x31d555(0x175)][_0x31d555(0x149)],'action':_0x31d555(0x118),'error':_0x570f5f[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x13a)][_0x31d555(0xd4)]++;}}return _0x30598c;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a123_0x2638(){const _0x5a70e5=['map','50zrirUp','targetKnowledgeBaseId','1892690uMmRhP','targetAgentId','100848zMtzHw','get','tools','attributes','860VbxpPJ','831339dmGZZK','33vlExva','has','6470djBFzH','944317DLBjzd','239344LAshme','11971260JubXHo','16wKcUnJ','138XKiSSm'];a123_0x2638=function(){return _0x5a70e5;};return a123_0x2638();}(function(_0x418bd5,_0x3cbb67){const _0x49cd77=a123_0x5883,_0x503131=_0x418bd5();while(!![]){try{const _0x49878f=-parseInt(_0x49cd77(0xbb))/0x1+-parseInt(_0x49cd77(0xc1))/0x2*(parseInt(_0x49cd77(0xc5))/0x3)+parseInt(_0x49cd77(0xb6))/0x4*(-parseInt(_0x49cd77(0xba))/0x5)+-parseInt(_0x49cd77(0xbf))/0x6*(-parseInt(_0x49cd77(0xbc))/0x7)+-parseInt(_0x49cd77(0xbe))/0x8*(-parseInt(_0x49cd77(0xb7))/0x9)+parseInt(_0x49cd77(0xc3))/0xa*(parseInt(_0x49cd77(0xb8))/0xb)+parseInt(_0x49cd77(0xbd))/0xc;if(_0x49878f===_0x3cbb67)break;else _0x503131['push'](_0x503131['shift']());}catch(_0x14ef2c){_0x503131['push'](_0x503131['shift']());}}}(a123_0x2638,0x73a2b));export function canCreateAgent(_0x5ad6f8,_0x28f162){const _0x10ec65=a123_0x5883;for(const _0x2b994b of _0x5ad6f8[_0x10ec65(0xc8)][_0x10ec65(0xc7)]){if(_0x2b994b[_0x10ec65(0xc4)]&&!_0x28f162[_0x10ec65(0xb9)](_0x2b994b[_0x10ec65(0xc4)]))return![];}return!![];}export function remapToolIds(_0x5bf069,_0x120002,_0x57615e){const _0x1e9aa0=a123_0x5883;return _0x5bf069[_0x1e9aa0(0xc0)](_0xb88aef=>({..._0xb88aef,'targetKnowledgeBaseId':_0xb88aef[_0x1e9aa0(0xc2)]?_0x120002[_0x1e9aa0(0xc6)](_0xb88aef[_0x1e9aa0(0xc2)])||_0xb88aef['targetKnowledgeBaseId']:undefined,'targetAgentId':_0xb88aef[_0x1e9aa0(0xc4)]?_0x57615e[_0x1e9aa0(0xc6)](_0xb88aef['targetAgentId'])||_0xb88aef['targetAgentId']:undefined}));}export function remapVariableIds(_0x2d75b8,_0x1db915){const _0x31ceab=a123_0x5883;return _0x2d75b8['map'](_0x29906d=>({..._0x29906d,'targetKnowledgeBaseId':_0x1db915[_0x31ceab(0xc6)](_0x29906d[_0x31ceab(0xc2)])||_0x29906d[_0x31ceab(0xc2)]}));}function a123_0x5883(_0x5fc230,_0x19b113){_0x5fc230=_0x5fc230-0xb6;const _0x26381c=a123_0x2638();let _0x5883d2=_0x26381c[_0x5fc230];return _0x5883d2;}export function isSupportedBackupVersion(_0xdc094c){return _0xdc094c==='1.0';}
|