@treasuredata/tdx 0.28.1 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/llm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a109_0x291832=a109_0x2939;(function(_0x1c5518,_0x574bc5){const _0x2d0206=a109_0x2939,_0x516d36=_0x1c5518();while(!![]){try{const _0x3a7f67=-parseInt(_0x2d0206(0x1e9))/0x1+parseInt(_0x2d0206(0x22d))/0x2*(parseInt(_0x2d0206(0x281))/0x3)+-parseInt(_0x2d0206(0x1bb))/0x4+-parseInt(_0x2d0206(0x249))/0x5*(-parseInt(_0x2d0206(0x225))/0x6)+parseInt(_0x2d0206(0x29c))/0x7+-parseInt(_0x2d0206(0x2a0))/0x8+parseInt(_0x2d0206(0x299))/0x9;if(_0x3a7f67===_0x574bc5)break;else _0x516d36['push'](_0x516d36['shift']());}catch(_0x5edca1){_0x516d36['push'](_0x516d36['shift']());}}}(a109_0x19f7,0xc96b8));import{LLMApiClient}from'../client/llm-api-client.js';import*as a109_0xd05ade from'node:fs';import*as a109_0x3b39de 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';function a109_0x19f7(){const _0x15a68a=['error','outputs','localeCompare','knowledgebases.json','maxToolIterations','Renamed\x20integration\x20file:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','agents','add','logger','listChats','listExperimentalKnowledgeBases','\x0a---\x20code\x20---\x0a','pullProject','4207252FblUoE','systemPrompt','medium','integrations.json','total','Unable\x20to\x20create\x20project\x20after\x20','Unresolved\x20dependencies:\x20','stringify','listKnowledgeBases','attributes','resolveAgentId','high','toISOString','pushAgent','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.','Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.','listAgents','idToName','json_schema','text_content','version','split','chatWelcomeMessage','readFileSync','metadata','getOrCreateDefaultProject','listTextKnowledgeBases','rmSync','some','length','json_schema.json','temperature','createExperimentalKnowledgeBase','get','resolveProjectId','serviceType','experimentalArtifacts','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','claude-4.5-sonnet','agent','code','yaml','createImageGenerator','backupProject','getOrCreateDefaultAgent','content','1448544CjMfhQ','has','startChat','history','Removed\x20deleted\x20file:\x20','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat','.llm','listWebSearchTools','getDefaultProjectName','minimal','createKnowledgeBase','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','ALREADY_EXISTS','createProject','listIntegrations','knowledgeBases','integrations','AGENT_NOT_FOUND','getChatInfo','jsonSchemaHint','chatIgnoreManagedActions','agent.yml\x20not\x20found\x20in\x20','Agent\x20not\x20found:\x20','---\x20file:\x20','reasoningEffort','PERMISSION_DENIED','\x20---\x0a','name','statSync','getBackupMetadata','dry-run-','experimentalKnowledgeBases','NOT_FOUND','existsSync','sdk.llm','KnowledgeBase','already\x20exists','availableModels','sort','unchanged','description','promptId','path','setCurrentProject','signal','\x22\x20already\x20exists','UNAUTHENTICATED','Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20','profile','experimental_knowledge_bases','deleteIntegration','Skipping\x20integration\x20\x27','getChatHistory','projectId','getUserSettings','type','loadJsonFile','setDefaultAgent','newProjectId','488640rFxTWH','deleteProject','\x0a---\x20schema:\x20','basename','listAgentsFull','\x20→\x20',')\x20can\x20be\x20cloned.','mkdirSync','2344xbPwxw','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','agentId','set','INTERNAL','prompts.json','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','Unsupported\x20backup\x20version:\x20','currentProjectId','createAgentResponse','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.','service_type','resolveProjectName','isDir','modelType','llm_project','models','INVALID_ARGUMENT','info','createPrompt','restoreProject','includes','created','deleteAgent','LLM_PROJECT_NOT_FOUND','message','chatId','exportedFrom','25BbVxuj','isManaged','createIntegration','isDirectory','Invalid\x20agent\x20reference\x20format:\x20','tdx_','join','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','displayName','tdx.json','Project\x20\x22','nameToId','prompt.md','actions','clearDefaultAgent','dirname','chat','Removed\x20deleted\x20directory:\x20','prompts','.md','endsWith','chat_parent_segment','none','dryRun','toLowerCase','code.js','listExperimentalArtifacts',')\x20can\x20be\x20pushed.\x20','files','new','Renamed\x20folder:\x20','No\x20tdx.json\x20found\x20in\x20','updatePrompt','.yml','1.0','writeFileSync','agents.json','chat_agent_console','tools','oldPath','getDefaultAgent','listProjects','tdDatabaseName','webSearchTools','starter_message','image_gen','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','text','\x27.\x20This\x20should\x20not\x20happen.','isFile','counts','.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.','pushProject','size','listToolTargets','):\x20','2949HPweWM','readdirSync','imageGenerators','updateAgent','site','\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20','duplicate','cloneProject','starter_message.md','variables','push','dir','createTextKnowledgeBase','\x0a\x0a#\x20agent.yml\x0a','Agent\x20reference\x20not\x20found','file_name','listPrompts','pullAgent','getChatLog','Backup\x20folder\x20not\x20found:\x20','starterMessage','map','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','---\x20schema:\x20','12497796KXAxhO','chats','conflict','9794918jUaZEd','utf-8','getCurrentProject','\x20in\x20project\x20','8174568wdxmrB','errors','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','low','unlinkSync','\x27\x20(','find','agent.yml','Project\x20not\x20found:\x20','textKnowledgeBases','updateExperimentalKnowledgeBase','functions','filter','updateExperimentalArtifact','updated','#\x20prompt.md\x0a','knowledge_bases','Renamed\x20KB\x20file:\x20','def','\x0a---\x20function:\x20','updateAgentResponse','Multiple\x20projects\x20found\x20with\x20name\x20\x27','Renamed\x20text\x20KB\x20file:\x20','(dry-run)','Renamed\x20agent\x20folder:\x20','webhookCorsOrigins','context','parse','client','Renamed\x20experimental\x20artifact\x20directory:\x20','target','warn','experimental_artifacts','project.json','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','getAgent','getProject','renamed'];a109_0x19f7=function(){return _0x15a68a;};return a109_0x19f7();}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';import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';export const SAFE_INTEGRATION_TYPES=['chat_generic',a109_0x291832(0x26e),a109_0x291832(0x25e)];async function safeListOrEmpty(_0x1fefa3){try{return await _0x1fefa3();}catch(_0x18d862){if(_0x18d862 instanceof HTTPClientError&&_0x18d862['status']===0x194)return[];throw _0x18d862;}}function a109_0x2939(_0x5a19a3,_0x3dc45d){_0x5a19a3=_0x5a19a3-0x1a7;const _0x19f76d=a109_0x19f7();let _0x293956=_0x19f76d[_0x5a19a3];return _0x293956;}export class LLMSDK{[a109_0x291832(0x235)];[a109_0x291832(0x2bc)];[a109_0x291832(0x2ba)];[a109_0x291832(0x1b6)]=Logger['of'](a109_0x291832(0x20c));constructor(_0x508d5d){const _0x41dbce=a109_0x291832;this[_0x41dbce(0x2bc)]=new LLMApiClient(_0x508d5d),this[_0x41dbce(0x2ba)]=_0x508d5d;}[a109_0x291832(0x1f2)](){const _0x5db0f1=getSanitizedUsername();return'tdx_default_'+_0x5db0f1;}async[a109_0x291832(0x215)](_0x45ddca){const _0x5a7cd1=a109_0x291832,{projectId:_0x5afc64}=await this['resolveProjectName'](_0x45ddca);this[_0x5a7cd1(0x235)]=_0x5afc64;}[a109_0x291832(0x29e)](){const _0x3f86ff=a109_0x291832;return this[_0x3f86ff(0x235)];}async[a109_0x291832(0x223)](_0x7b23ab){const _0x43fa73=a109_0x291832,_0x44f070=this[_0x43fa73(0x2ba)][_0x43fa73(0x21a)];let _0x2b6930,_0x468de6;if(_0x7b23ab[_0x43fa73(0x242)]('/')){const _0x3a6ed1=_0x7b23ab[_0x43fa73(0x1d0)]('/');if(_0x3a6ed1[_0x43fa73(0x1d8)]!==0x2)throw new SDKError(ErrorCode[_0x43fa73(0x23e)],_0x43fa73(0x24d)+_0x7b23ab,undefined,{'helpText':'Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22'});const [_0x2abb16,_0x2bee89]=_0x3a6ed1;_0x2b6930=await this[_0x43fa73(0x1dd)](_0x2abb16),_0x468de6=_0x2bee89;}else _0x2b6930=this[_0x43fa73(0x235)]||(await this[_0x43fa73(0x1d4)]())['id'],_0x468de6=_0x7b23ab;const _0x5a5c0e=await this[_0x43fa73(0x1c5)](_0x468de6,_0x2b6930),_0x13e0d4=await this[_0x43fa73(0x2bc)][_0x43fa73(0x1aa)](_0x5a5c0e);writeCachedLLMAgent(_0x13e0d4[_0x43fa73(0x1c4)]['name'],_0x5a5c0e,_0x2b6930,_0x44f070);}[a109_0x291832(0x271)](){const _0x301f31=a109_0x291832,_0x4363fa=this[_0x301f31(0x2ba)][_0x301f31(0x21a)];return readCachedLLMAgent(_0x4363fa)||undefined;}[a109_0x291832(0x257)](){const _0x2c288c=a109_0x291832,_0xb1ba04=this[_0x2c288c(0x2ba)][_0x2c288c(0x21a)];clearCachedLLMAgent(_0xb1ba04);}async[a109_0x291832(0x23d)](){const _0xdc56e3=a109_0x291832,_0x18eb07=await this[_0xdc56e3(0x2bc)][_0xdc56e3(0x220)](),_0x1ecce6=[];for(const _0x546a05 of _0x18eb07['availableModelNames']){const _0x5e3961=_0x18eb07[_0xdc56e3(0x20f)][_0x546a05];_0x5e3961&&_0x1ecce6[_0xdc56e3(0x28b)]({'name':_0x546a05,'displayName':_0x5e3961[_0xdc56e3(0x251)]});}return _0x1ecce6;}async[a109_0x291832(0x1f7)](_0x16c017){const _0x37e6ee=a109_0x291832;return await this[_0x37e6ee(0x2bc)][_0x37e6ee(0x1f7)](_0x16c017);}async['deleteProject'](_0x1f3494){const _0x55d35f=a109_0x291832,{projectId:_0x5c7189}=await this['resolveProjectName'](_0x1f3494);await this[_0x55d35f(0x2bc)][_0x55d35f(0x226)](_0x5c7189);}async['projects'](_0x4b7f1d=0x32){return await this['client']['listProjects'](_0x4b7f1d);}async['getOrCreateDefaultProject'](_0x2f4168){const _0x1528fd=a109_0x291832,_0x48eecf=_0x2f4168||this[_0x1528fd(0x1f2)](),_0x1f440f=this[_0x1528fd(0x2ba)]['profile'];if(!_0x2f4168){const _0x167186=readCachedLLMProject(_0x1f440f);if(_0x167186&&_0x167186[_0x1528fd(0x205)]===_0x48eecf)try{const _0x4f40ab=await this[_0x1528fd(0x2bc)][_0x1528fd(0x1ab)](_0x167186['id']);if(_0x4f40ab[_0x1528fd(0x1c4)][_0x1528fd(0x205)]===_0x48eecf)return _0x4f40ab;}catch{}}const _0x3fdaf0=await this[_0x1528fd(0x2bc)][_0x1528fd(0x272)](),_0x57a9ee=_0x3fdaf0['find'](_0x234f32=>_0x234f32[_0x1528fd(0x1c4)]['name']===_0x48eecf);if(_0x57a9ee)return!_0x2f4168&&writeCachedLLMProject(_0x48eecf,_0x57a9ee['id'],_0x1f440f),_0x57a9ee;const _0x15c35f=await this[_0x1528fd(0x2bc)][_0x1528fd(0x1f7)]({'name':_0x48eecf,'description':_0x1528fd(0x297)+getSanitizedUsername()+')'});return!_0x2f4168&&writeCachedLLMProject(_0x48eecf,_0x15c35f['id'],_0x1f440f),_0x15c35f;}async[a109_0x291832(0x1dd)](_0x250b24){const _0x268862=a109_0x291832,_0x1b89b2=await this['client'][_0x268862(0x272)](),_0x540f1f=_0x1b89b2[_0x268862(0x2ac)](_0x36d33a=>_0x36d33a[_0x268862(0x1c4)][_0x268862(0x205)]===_0x250b24);if(_0x540f1f['length']===0x0)throw new SDKError(ErrorCode[_0x268862(0x245)],_0x268862(0x2a8)+_0x250b24,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});if(_0x540f1f[_0x268862(0x1d8)]>0x1)throw new SDKError(ErrorCode[_0x268862(0x231)],_0x268862(0x2b5)+_0x250b24+_0x268862(0x279));return _0x540f1f[0x0]['id'];}async[a109_0x291832(0x239)](_0x3013cd){const _0x293deb=a109_0x291832,_0x1e911b=await this[_0x293deb(0x2bc)][_0x293deb(0x272)](),_0x1c026b=_0x1e911b[_0x293deb(0x2a6)](_0xf7e5da=>_0xf7e5da[_0x293deb(0x1c4)]['name']===_0x3013cd);if(_0x1c026b)return{'projectId':_0x1c026b['id'],'project':_0x1c026b};throw new SDKError(ErrorCode[_0x293deb(0x245)],_0x293deb(0x2a8)+_0x3013cd,undefined,{'helpText':_0x293deb(0x2a2)});}async[a109_0x291832(0x1e7)](_0x124073=a109_0x291832(0x1e1),_0x1004a4=0x0,_0x256a98){const _0x556f20=a109_0x291832,_0x53383a=0xa;let _0x659874=0x0,_0x359155;while(_0x659874<_0x53383a){try{const _0x171f00=await this['getOrCreateDefaultProject'](_0x359155),_0x3e2c5b=_0x171f00['id'],_0xc3308d=[_0x556f20(0x25f),_0x556f20(0x1f3),_0x556f20(0x2a3),_0x556f20(0x1bd),_0x556f20(0x1c6)],_0x3ebec7=_0x1004a4===0x0?_0x556f20(0x24e)+_0x124073:'tdx_'+_0x124073+'_reasoning_'+_0xc3308d[_0x1004a4],_0x4d4c4d=await this[_0x556f20(0x2bc)][_0x556f20(0x1cb)](_0x3e2c5b),_0x27c8f1=_0x4d4c4d[_0x556f20(0x2a6)](_0x85a859=>_0x85a859[_0x556f20(0x1c4)]['name']===_0x3ebec7);if(_0x27c8f1)return _0x27c8f1;const _0x212ff7=_0x1004a4>0x0?0x1:_0x256a98;return await this[_0x556f20(0x2bc)]['createAgent']({'name':_0x3ebec7,'projectId':_0x3e2c5b,'modelType':_0x124073,'systemPrompt':'','temperature':_0x212ff7,'reasoningEffort':_0x1004a4>0x0?_0x1004a4:undefined});}catch(_0x35922c){if(_0x35922c instanceof HTTPClientError){const _0x5d4310=_0x35922c['status'];if(_0x5d4310>=0x190&&_0x5d4310<0x1f4){if(_0x5d4310===0x191)throw new SDKError(ErrorCode[_0x556f20(0x218)],_0x556f20(0x1e0),_0x35922c);else{if(_0x5d4310===0x193)throw new SDKError(ErrorCode[_0x556f20(0x203)],'Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.',_0x35922c);}throw _0x35922c;}}if(errorContains(_0x35922c,_0x556f20(0x20e),_0x556f20(0x287),_0x556f20(0x29b))){_0x659874++;if(_0x659874>=_0x53383a)throw new SDKError(ErrorCode['ALREADY_EXISTS'],_0x556f20(0x1c0)+_0x53383a+'\x20attempts\x20due\x20to\x20name\x20conflicts.',_0x35922c);const _0x35bed0=this[_0x556f20(0x1f2)]();_0x359155=_0x35bed0+'_'+generateRandomHex();continue;}throw _0x35922c;}}throw new SDKError(ErrorCode[_0x556f20(0x231)],_0x556f20(0x233));}async[a109_0x291832(0x1c5)](_0x42ae30,_0x26e346){const _0x372e53=a109_0x291832,_0x5f3f87=_0x26e346||this[_0x372e53(0x235)],_0x2e2d0f=await this['client'][_0x372e53(0x1cb)](_0x5f3f87),_0x3c1b3c=_0x2e2d0f[_0x372e53(0x2ac)](_0x39ee4c=>_0x39ee4c[_0x372e53(0x1c4)][_0x372e53(0x205)]===_0x42ae30);if(_0x3c1b3c[_0x372e53(0x1d8)]===0x0){const _0x4f84f6=_0x5f3f87?_0x372e53(0x29f)+_0x5f3f87:'';throw new SDKError(ErrorCode[_0x372e53(0x1fb)],'Agent\x20not\x20found:\x20'+_0x42ae30+_0x4f84f6,undefined,{'helpText':_0x5f3f87?_0x372e53(0x250):_0x372e53(0x237)});}if(_0x3c1b3c[_0x372e53(0x1d8)]>0x1)throw new SDKError(ErrorCode['INTERNAL'],'Multiple\x20agents\x20found\x20with\x20name\x20\x27'+_0x42ae30+'\x27.\x20This\x20should\x20not\x20happen.');return _0x3c1b3c[0x0]['id'];}async[a109_0x291832(0x1b4)](_0x4b4b02){const _0x311a83=a109_0x291832,_0x4be49a=_0x4b4b02||this['currentProjectId'];return await this[_0x311a83(0x2bc)][_0x311a83(0x1cb)](_0x4be49a);}async['agentsFull'](_0x280210){const _0x5407aa=a109_0x291832;return await this[_0x5407aa(0x2bc)]['listAgentsFull'](_0x280210);}async[a109_0x291832(0x1e2)](_0x178931){const _0x56acd4=a109_0x291832;return await this[_0x56acd4(0x2bc)][_0x56acd4(0x1aa)](_0x178931);}async['createAgent'](_0x591cc9){return await this['client']['createAgent'](_0x591cc9);}async['updateAgent'](_0x5bd9bc,_0x538dff){const _0x1393a3=a109_0x291832;return await this[_0x1393a3(0x2bc)][_0x1393a3(0x284)](_0x5bd9bc,_0x538dff);}async[a109_0x291832(0x244)](_0x534295){const _0x17edea=a109_0x291832;await this['client'][_0x17edea(0x244)](_0x534295);}async['startChat'](_0x292f3f){const _0x23afc8=a109_0x291832;return await this[_0x23afc8(0x2bc)][_0x23afc8(0x1eb)]({'agentId':_0x292f3f});}async*[a109_0x291832(0x259)](_0x2adc61,_0x18ebd0){const _0x213e2e=a109_0x291832;let _0x4cfe65=_0x18ebd0?.[_0x213e2e(0x247)];const _0x569463=_0x18ebd0?.[_0x213e2e(0x22f)];if(!_0x4cfe65){if(!_0x569463)throw new Error(_0x213e2e(0x1ef));const _0x5e6468=await this[_0x213e2e(0x2bc)][_0x213e2e(0x1eb)]({'agentId':_0x569463});_0x4cfe65=_0x5e6468['id'],yield{'type':_0x213e2e(0x1d3),'data':{'chatId':_0x4cfe65,'agentId':_0x569463,'projectId':_0x5e6468[_0x213e2e(0x1c4)][_0x213e2e(0x21f)]}};}for await(const _0x4d7972 of this[_0x213e2e(0x2bc)]['continueChat'](_0x4cfe65,_0x2adc61,_0x18ebd0?.[_0x213e2e(0x216)])){yield{'type':'event','data':_0x4d7972};}}async[a109_0x291832(0x29a)](_0x515d93=0x32){const _0x35d269=a109_0x291832;return await this[_0x35d269(0x2bc)][_0x35d269(0x1b7)](_0x515d93);}async[a109_0x291832(0x1ec)](_0x13e07e){const _0x17980a=a109_0x291832;return await this[_0x17980a(0x2bc)][_0x17980a(0x21e)](_0x13e07e);}async[a109_0x291832(0x293)](_0x4605c3){const _0x19397b=a109_0x291832;return await this[_0x19397b(0x2bc)][_0x19397b(0x293)](_0x4605c3);}async['chatInfo'](_0x5a679e){const _0x554057=a109_0x291832;return await this[_0x554057(0x2bc)][_0x554057(0x1fc)](_0x5a679e);}async[a109_0x291832(0x1e6)](_0x463f6d,_0x3ab29c,_0xa19e2f){const _0x3cedd4=a109_0x291832,_0x54c13e=_0xa19e2f?.[_0x3cedd4(0x260)]??![],{projectId:_0x3de292,project:_0x3200a9}=await this[_0x3cedd4(0x239)](_0x463f6d),_0x1fe76a=_0x3200a9[_0x3cedd4(0x1c4)][_0x3cedd4(0x205)],_0x2b9e95=_0x3ab29c||_0x1fe76a+_0x3cedd4(0x1f0);if(a109_0xd05ade['existsSync'](_0x2b9e95)&&!_0x54c13e)throw new SDKError(ErrorCode[_0x3cedd4(0x1f6)],'Output\x20directory\x20already\x20exists:\x20'+_0x2b9e95,undefined,{'helpText':_0x3cedd4(0x1c9)});const _0xd186d0=await this[_0x3cedd4(0x2bc)][_0x3cedd4(0x229)](_0x3de292),_0x143d4c=await this[_0x3cedd4(0x2bc)][_0x3cedd4(0x1c3)](_0x3de292),_0x1d2451=await this['client'][_0x3cedd4(0x291)](_0x3de292),_0x1e8fc1=await this[_0x3cedd4(0x2bc)][_0x3cedd4(0x1f8)](_0x3de292);if(!_0x54c13e){a109_0xd05ade[_0x3cedd4(0x22c)](_0x2b9e95,{'recursive':!![]});const _0x20865f={'version':_0x3cedd4(0x26b),'exportedAt':new Date()[_0x3cedd4(0x1c7)](),'exportedFrom':{'site':this[_0x3cedd4(0x2ba)][_0x3cedd4(0x285)],'projectId':_0x3de292,'projectName':_0x1fe76a},'project':_0x3200a9};a109_0xd05ade[_0x3cedd4(0x26c)](a109_0x3b39de[_0x3cedd4(0x24f)](_0x2b9e95,_0x3cedd4(0x1a8)),JSON[_0x3cedd4(0x1c2)](_0x20865f,null,0x2)),a109_0xd05ade['writeFileSync'](a109_0x3b39de['join'](_0x2b9e95,_0x3cedd4(0x26d)),JSON[_0x3cedd4(0x1c2)](_0xd186d0,null,0x2)),a109_0xd05ade[_0x3cedd4(0x26c)](a109_0x3b39de['join'](_0x2b9e95,_0x3cedd4(0x1b0)),JSON['stringify'](_0x143d4c,null,0x2)),a109_0xd05ade['writeFileSync'](a109_0x3b39de['join'](_0x2b9e95,_0x3cedd4(0x232)),JSON[_0x3cedd4(0x1c2)](_0x1d2451,null,0x2)),a109_0xd05ade[_0x3cedd4(0x26c)](a109_0x3b39de[_0x3cedd4(0x24f)](_0x2b9e95,_0x3cedd4(0x1be)),JSON[_0x3cedd4(0x1c2)](_0x1e8fc1,null,0x2));}return{'projectName':_0x1fe76a,'outputDir':_0x2b9e95,'counts':{'agents':_0xd186d0[_0x3cedd4(0x1d8)],'knowledgeBases':_0x143d4c[_0x3cedd4(0x1d8)],'prompts':_0x1d2451['length'],'integrations':_0x1e8fc1['length']}};}async[a109_0x291832(0x241)](_0x560747,_0x4e85a6){const _0xc88a72=a109_0x291832,_0x5b4cbd=_0x4e85a6?.[_0xc88a72(0x260)]??![],_0x776446=this[_0xc88a72(0x207)](_0x560747),_0x4500e1=_0x776446[_0xc88a72(0x248)][_0xc88a72(0x285)],_0x2b27a7=this[_0xc88a72(0x2ba)][_0xc88a72(0x285)],_0x3d33a2=_0x4500e1!==_0x2b27a7?_0x4500e1:undefined,_0x2d7c75=this[_0xc88a72(0x222)](a109_0x3b39de[_0xc88a72(0x24f)](_0x560747,_0xc88a72(0x26d)),[]),_0x41fa0f=this[_0xc88a72(0x222)](a109_0x3b39de['join'](_0x560747,_0xc88a72(0x1b0)),[]),_0x808599=this['loadJsonFile'](a109_0x3b39de[_0xc88a72(0x24f)](_0x560747,_0xc88a72(0x232)),[]),_0x159dbe=this['loadJsonFile'](a109_0x3b39de['join'](_0x560747,_0xc88a72(0x1be)),[]),_0xfb39b5=_0x4e85a6?.[_0xc88a72(0x205)]||_0x776446[_0xc88a72(0x248)]['projectName'];if(_0x5b4cbd){const _0x13e3bc=new Map(),_0x4f6aea=[..._0x2d7c75],_0x3d7abb=_0x2d7c75[_0xc88a72(0x1d8)]+0x1;let _0x58a121=0x0;while(_0x4f6aea[_0xc88a72(0x1d8)]>0x0&&_0x58a121<_0x3d7abb){_0x58a121++;const _0x20ce89=[];for(const _0x4bb0d7 of _0x4f6aea){canCreateAgent(_0x4bb0d7,_0x13e3bc)?_0x13e3bc[_0xc88a72(0x230)](_0x4bb0d7['id'],_0xc88a72(0x208)+_0x4bb0d7['id']):_0x20ce89[_0xc88a72(0x28b)](_0x4bb0d7);}if(_0x20ce89[_0xc88a72(0x1d8)]===_0x4f6aea[_0xc88a72(0x1d8)])throw new SDKError(ErrorCode[_0xc88a72(0x231)],_0xc88a72(0x22e),undefined,{'helpText':_0xc88a72(0x1f5)});_0x4f6aea[_0xc88a72(0x1d8)]=0x0,_0x4f6aea[_0xc88a72(0x28b)](..._0x20ce89);}const _0x37597a=_0x808599[_0xc88a72(0x2ac)](_0x150025=>_0x13e3bc['has'](_0x150025[_0xc88a72(0x1c4)][_0xc88a72(0x22f)]))[_0xc88a72(0x1d8)];return{'projectName':_0xfb39b5,'projectId':_0xc88a72(0x2b7),'counts':{'agents':_0x2d7c75['length'],'knowledgeBases':_0x41fa0f[_0xc88a72(0x1d8)],'prompts':_0x37597a,'integrations':_0x159dbe['length']},'sourceSite':_0x3d33a2};}const _0x57117c=await this[_0xc88a72(0x2bc)][_0xc88a72(0x1f7)]({'name':_0xfb39b5,'description':_0x776446['project']['attributes'][_0xc88a72(0x212)]}),_0x4bc933=_0x57117c['id'],_0x4450a3=new Map(),_0x305992=new Map(),_0x1023c3=new Map();for(const _0x365a3f of _0x41fa0f){const _0x503b55=await this['client'][_0xc88a72(0x1f4)]({'projectId':_0x4bc933,'name':_0x365a3f[_0xc88a72(0x1c4)][_0xc88a72(0x205)],'tdDatabaseName':_0x365a3f[_0xc88a72(0x1c4)][_0xc88a72(0x273)],'tables':_0x365a3f[_0xc88a72(0x1c4)]['tables']});_0x4450a3['set'](_0x365a3f['id'],_0x503b55['id']);}const _0x1ed513=[..._0x2d7c75],_0x126725=_0x2d7c75['length']+0x1;let _0x989595=0x0;while(_0x1ed513[_0xc88a72(0x1d8)]>0x0&&_0x989595<_0x126725){_0x989595++;const _0x34df4e=[];for(const _0x240900 of _0x1ed513){if(canCreateAgent(_0x240900,_0x305992)){const _0x3cf4aa=remapToolIds(_0x240900['attributes'][_0xc88a72(0x26f)],_0x4450a3,_0x305992),_0x3ecbf4=remapVariableIds(_0x240900[_0xc88a72(0x1c4)][_0xc88a72(0x28a)],_0x4450a3),_0x566b11=await this[_0xc88a72(0x2bc)][_0xc88a72(0x236)]({'name':_0x240900[_0xc88a72(0x1c4)][_0xc88a72(0x205)],'projectId':_0x4bc933,'systemPrompt':_0x240900['attributes'][_0xc88a72(0x1bc)],'starterMessage':_0x240900['attributes'][_0xc88a72(0x295)],'modelType':migrateModelType(_0x240900[_0xc88a72(0x1c4)][_0xc88a72(0x23b)]),'maxToolIterations':_0x240900[_0xc88a72(0x1c4)][_0xc88a72(0x1b1)],'temperature':_0x240900[_0xc88a72(0x1c4)][_0xc88a72(0x1da)],'reasoningEffort':_0x240900['attributes'][_0xc88a72(0x202)],'outputs':_0x240900[_0xc88a72(0x1c4)][_0xc88a72(0x1ae)],'tools':_0x3cf4aa,'variables':_0x3ecbf4});_0x305992[_0xc88a72(0x230)](_0x240900['id'],_0x566b11['id']);}else _0x34df4e[_0xc88a72(0x28b)](_0x240900);}if(_0x34df4e[_0xc88a72(0x1d8)]===_0x1ed513[_0xc88a72(0x1d8)])throw new SDKError(ErrorCode[_0xc88a72(0x231)],_0xc88a72(0x22e),undefined,{'helpText':_0xc88a72(0x1f5)});_0x1ed513[_0xc88a72(0x1d8)]=0x0,_0x1ed513[_0xc88a72(0x28b)](..._0x34df4e);}for(const _0x5cd7bf of _0x808599){const _0x37792f=_0x305992[_0xc88a72(0x1dc)](_0x5cd7bf[_0xc88a72(0x1c4)][_0xc88a72(0x22f)]);if(!_0x37792f)continue;const _0x420bf0=await this['client'][_0xc88a72(0x240)]({'projectId':_0x4bc933,'agentId':_0x37792f,'name':_0x5cd7bf[_0xc88a72(0x1c4)][_0xc88a72(0x205)],'systemPrompt':_0x5cd7bf[_0xc88a72(0x1c4)][_0xc88a72(0x1bc)],'template':_0x5cd7bf[_0xc88a72(0x1c4)]['template'],'jsonSchemaHint':_0x5cd7bf[_0xc88a72(0x1c4)][_0xc88a72(0x1fd)]});_0x1023c3['set'](_0x5cd7bf['id'],_0x420bf0['id']);}for(const _0x47cc96 of _0x159dbe){const _0x1f9b20=_0x47cc96[_0xc88a72(0x1c4)][_0xc88a72(0x256)][_0xc88a72(0x296)](_0x2c878d=>({..._0x2c878d,'promptId':_0x1023c3[_0xc88a72(0x1dc)](_0x2c878d[_0xc88a72(0x213)])||_0x2c878d[_0xc88a72(0x213)]}));await this[_0xc88a72(0x2bc)][_0xc88a72(0x24b)]({'projectId':_0x4bc933,'serviceType':_0x47cc96[_0xc88a72(0x1c4)][_0xc88a72(0x1de)],'actions':_0x1f9b20,'slackMessageMode':_0x47cc96[_0xc88a72(0x1c4)]['slackMessageMode'],'chatIgnoreManagedActions':_0x47cc96[_0xc88a72(0x1c4)][_0xc88a72(0x1fe)],'chatWelcomeMessage':_0x47cc96['attributes'][_0xc88a72(0x1d1)],'webhookCorsOrigins':_0x47cc96['attributes'][_0xc88a72(0x2b9)]});}return{'projectName':_0xfb39b5,'projectId':_0x4bc933,'counts':{'agents':_0x305992['size'],'knowledgeBases':_0x4450a3[_0xc88a72(0x27e)],'prompts':_0x1023c3[_0xc88a72(0x27e)],'integrations':_0x159dbe[_0xc88a72(0x1d8)]},'sourceSite':_0x3d33a2};}['loadJsonFile'](_0x446745,_0x1bbe69){const _0x1a17d0=a109_0x291832;if(!a109_0xd05ade[_0x1a17d0(0x20b)](_0x446745))return _0x1bbe69;return JSON[_0x1a17d0(0x2bb)](a109_0xd05ade[_0x1a17d0(0x1d2)](_0x446745,_0x1a17d0(0x29d)));}['getBackupMetadata'](_0x5dd45e){const _0x5cf2d3=a109_0x291832;if(!a109_0xd05ade[_0x5cf2d3(0x20b)](_0x5dd45e))throw new SDKError(ErrorCode['NOT_FOUND'],_0x5cf2d3(0x294)+_0x5dd45e,undefined,{'helpText':_0x5cf2d3(0x1ca)});const _0x5f1e55=a109_0x3b39de[_0x5cf2d3(0x24f)](_0x5dd45e,_0x5cf2d3(0x1a8));if(!a109_0xd05ade[_0x5cf2d3(0x20b)](_0x5f1e55))throw new SDKError(ErrorCode[_0x5cf2d3(0x23e)],_0x5cf2d3(0x219)+_0x5dd45e,undefined,{'helpText':_0x5cf2d3(0x277)});const _0x21998d=JSON[_0x5cf2d3(0x2bb)](a109_0xd05ade['readFileSync'](_0x5f1e55,_0x5cf2d3(0x29d)));if(!isSupportedBackupVersion(_0x21998d[_0x5cf2d3(0x1cf)]))throw new SDKError(ErrorCode[_0x5cf2d3(0x23e)],_0x5cf2d3(0x234)+_0x21998d[_0x5cf2d3(0x1cf)],undefined,{'helpText':_0x5cf2d3(0x1a9)});return _0x21998d;}async[a109_0x291832(0x1ba)](_0x5b8f53,_0xe83c78,_0x15ba12){const _0xae028d=a109_0x291832,{projectId:_0x12a3d5,project:_0x50a37e}=await this[_0xae028d(0x239)](_0x5b8f53),_0x48775e=_0x50a37e['attributes'][_0xae028d(0x205)];let _0x118c53;if(_0xe83c78)_0x118c53=_0xe83c78;else{const _0x29b296=a109_0x3b39de[_0xae028d(0x24f)](process['cwd'](),_0xae028d(0x1b4)),_0x59064a=getSanitizedPathWithMigration(_0x29b296,_0x48775e);_0x59064a['renamed']&&this[_0xae028d(0x1b6)][_0xae028d(0x23f)](_0xae028d(0x267)+a109_0x3b39de[_0xae028d(0x228)](_0x59064a[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de['basename'](_0x59064a[_0xae028d(0x214)])),_0x118c53=_0x59064a[_0xae028d(0x214)];}const _0x5617c8=await this[_0xae028d(0x2bc)][_0xae028d(0x229)](_0x12a3d5),_0x46af80=await this[_0xae028d(0x2bc)]['listKnowledgeBases'](_0x12a3d5),_0x51c1e5=await this[_0xae028d(0x2bc)][_0xae028d(0x1d5)](_0x12a3d5),_0x157c17=await safeListOrEmpty(()=>this[_0xae028d(0x2bc)]['listImageGenerators'](_0x12a3d5)),_0x15d34b=await safeListOrEmpty(()=>this[_0xae028d(0x2bc)][_0xae028d(0x1f1)](_0x12a3d5)),_0x2e2338=await this[_0xae028d(0x2bc)][_0xae028d(0x291)](_0x12a3d5),_0x4a08bb=await this[_0xae028d(0x2bc)][_0xae028d(0x1f8)](_0x12a3d5),_0x1d4f20=await safeListOrEmpty(()=>this[_0xae028d(0x2bc)]['listExperimentalKnowledgeBases'](_0x12a3d5)),_0x1d36c0=await safeListOrEmpty(()=>this[_0xae028d(0x2bc)][_0xae028d(0x263)](_0x12a3d5)),_0xfbf48c=_0x4a08bb['filter'](_0x37df29=>!_0x37df29[_0xae028d(0x1c4)][_0xae028d(0x24a)]&&SAFE_INTEGRATION_TYPES[_0xae028d(0x242)](_0x37df29[_0xae028d(0x1c4)][_0xae028d(0x1de)]['toLowerCase']())),_0x3ef059=new Map(),_0x1186c6=new Map(),_0x83a6d=new Map(),_0x2673e2=new Map(),_0x5ab2f9=new Map(),_0x2f308d=new Map(),_0x5e0264=new Map();for(const _0x413539 of _0x5617c8){_0x3ef059[_0xae028d(0x230)](_0x413539['id'],_0x413539[_0xae028d(0x1c4)][_0xae028d(0x205)]);}for(const _0x5ac7e3 of _0x46af80){_0x1186c6['set'](_0x5ac7e3['id'],_0x5ac7e3[_0xae028d(0x1c4)][_0xae028d(0x205)]);}for(const _0x37de0f of _0x51c1e5){_0x83a6d[_0xae028d(0x230)](_0x37de0f['id'],_0x37de0f[_0xae028d(0x1c4)][_0xae028d(0x205)]);}for(const _0x5b0615 of _0x157c17){_0x2673e2['set'](_0x5b0615['id'],_0x5b0615[_0xae028d(0x1c4)][_0xae028d(0x205)]);}for(const _0xf4ac20 of _0x15d34b){_0x5ab2f9['set'](_0xf4ac20['id'],_0xf4ac20[_0xae028d(0x1c4)]['name']);}for(const _0x3f77e6 of _0x2e2338){_0x2f308d['set'](_0x3f77e6['id'],_0x3f77e6[_0xae028d(0x1c4)]['name']);}for(const _0x524d3e of _0x1d4f20){_0x5e0264[_0xae028d(0x230)](_0x524d3e['id'],_0x524d3e[_0xae028d(0x1c4)][_0xae028d(0x205)]);}const _0x4128bb={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x1186c6,'TextKnowledgeBase':_0x83a6d,'Agent':_0x3ef059,'WebSearchTool':_0x5ab2f9,'ImageGenerator':_0x2673e2,'ExperimentalKnowledgeBase':_0x5e0264}),'resolvePromptName':async _0x5ef8e9=>_0x2f308d[_0xae028d(0x1dc)](_0x5ef8e9),'onWarning':_0x4b1662=>this['logger'][_0xae028d(0x2bf)](_0x4b1662)},_0x4c7e9b={'projectName':_0x48775e,'outputDir':_0x118c53,'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}}},_0x4d621f=[],_0xbe4cdf=[];for(const _0xfa30cb of _0x5617c8){const _0xb3b96c=getSanitizedPathWithMigration(_0x118c53,_0xfa30cb[_0xae028d(0x1c4)][_0xae028d(0x205)]);_0xb3b96c['renamed']&&this[_0xae028d(0x1b6)]['info'](_0xae028d(0x2b8)+a109_0x3b39de[_0xae028d(0x228)](_0xb3b96c[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de[_0xae028d(0x228)](_0xb3b96c['path']));const _0x53e143=_0xb3b96c[_0xae028d(0x214)],_0x72a78b=a109_0x3b39de[_0xae028d(0x24f)](_0x53e143,'prompt.md'),_0x264f56=a109_0x3b39de['join'](_0x53e143,'agent.yml'),_0x281052=a109_0x3b39de[_0xae028d(0x24f)](_0x53e143,'starter_message.md'),{yaml:_0x46a039,systemPrompt:_0x1d28a4,starterMessage:_0x408cf9}=await agentResponseToDef(_0xfa30cb,_0x4128bb),_0x47b2ff=toAgentYamlString(_0x46a039),_0x5cc71e=!a109_0xd05ade[_0xae028d(0x20b)](_0x264f56);let _0x4f61d6=_0x5cc71e,_0x51f6e0;if(!_0x5cc71e){const _0x1a0793=a109_0xd05ade[_0xae028d(0x20b)](_0x72a78b)?a109_0xd05ade[_0xae028d(0x1d2)](_0x72a78b,_0xae028d(0x29d)):'',_0x541ea1=a109_0xd05ade[_0xae028d(0x1d2)](_0x264f56,_0xae028d(0x29d)),_0x29bdd5=_0xae028d(0x2af)+_0x1a0793+_0xae028d(0x28e)+_0x541ea1,_0x555141='#\x20prompt.md\x0a'+_0x1d28a4+'\x0a\x0a#\x20agent.yml\x0a'+_0x47b2ff,_0x3a2f8f=generateDiff(_0x29bdd5,_0x555141);_0x4f61d6=hasChanges(_0x3a2f8f),_0x4f61d6&&(_0x51f6e0=formatDiffWithColors(_0x3a2f8f));}_0x4d621f['push']({'path':_0x53e143,'content':'','isDir':!![]}),_0x4d621f[_0xae028d(0x28b)]({'path':_0x72a78b,'content':_0x1d28a4}),_0x4d621f[_0xae028d(0x28b)]({'path':_0x264f56,'content':_0x47b2ff});_0x408cf9&&_0x408cf9[_0xae028d(0x242)]('\x0a')&&_0x4d621f['push']({'path':_0x281052,'content':_0x408cf9});_0x4c7e9b[_0xae028d(0x1b4)][_0xae028d(0x28b)]({'agentName':_0xfa30cb['attributes']['name'],'outputPath':_0x53e143,'isNew':_0x5cc71e,'hasChanges':_0x4f61d6,'diff':_0x51f6e0}),_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x1b4)][_0xae028d(0x1bf)]++;if(_0x5cc71e)_0x4c7e9b[_0xae028d(0x27b)]['agents']['new']++;else{if(_0x4f61d6)_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x1b4)][_0xae028d(0x2ae)]++;else _0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x1b4)][_0xae028d(0x211)]++;}}for(const _0x51f871 of _0x46af80){if(_0x51f871[_0xae028d(0x1c4)]['isManaged'])continue;const _0x3fd93d=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x118c53),_0x51f871[_0xae028d(0x1c4)][_0xae028d(0x205)],_0xae028d(0x26a));_0x3fd93d[_0xae028d(0x1ac)]&&this[_0xae028d(0x1b6)][_0xae028d(0x23f)](_0xae028d(0x2b1)+a109_0x3b39de[_0xae028d(0x228)](_0x3fd93d[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de[_0xae028d(0x228)](_0x3fd93d[_0xae028d(0x214)]));const _0x3ad55a=_0x3fd93d['path'],_0x5b36ae=apiKnowledgeBaseToYaml(_0x51f871),_0x2c0e5f=toKnowledgeBaseYamlString(_0x5b36ae),_0x223b3b=!a109_0xd05ade['existsSync'](_0x3ad55a);let _0x47aed9=_0x223b3b,_0x4f4dc7;if(!_0x223b3b){const _0x3c8c5b=a109_0xd05ade[_0xae028d(0x1d2)](_0x3ad55a,'utf-8'),_0x46660c=generateDiff(_0x3c8c5b,_0x2c0e5f);_0x47aed9=hasChanges(_0x46660c),_0x47aed9&&(_0x4f4dc7=formatDiffWithColors(_0x46660c));}_0x4d621f[_0xae028d(0x28b)]({'path':_0x3ad55a,'content':_0x2c0e5f}),_0x4c7e9b[_0xae028d(0x1f9)]['push']({'name':_0x51f871['attributes']['name'],'outputPath':_0x3ad55a,'isNew':_0x223b3b,'hasChanges':_0x47aed9,'diff':_0x4f4dc7}),_0x4c7e9b[_0xae028d(0x27b)]['knowledgeBases'][_0xae028d(0x1bf)]++;if(_0x223b3b)_0x4c7e9b[_0xae028d(0x27b)]['knowledgeBases']['new']++;else{if(_0x47aed9)_0x4c7e9b[_0xae028d(0x27b)]['knowledgeBases'][_0xae028d(0x2ae)]++;else _0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x1f9)][_0xae028d(0x211)]++;}}for(const _0xa8576 of _0x51c1e5){if(_0xa8576[_0xae028d(0x1c4)][_0xae028d(0x24a)])continue;const _0x212037=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x118c53),_0xa8576[_0xae028d(0x1c4)][_0xae028d(0x205)],'.md');_0x212037[_0xae028d(0x1ac)]&&this['logger']['info'](_0xae028d(0x2b6)+a109_0x3b39de[_0xae028d(0x228)](_0x212037[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de[_0xae028d(0x228)](_0x212037[_0xae028d(0x214)]));const _0x28929d=_0x212037[_0xae028d(0x214)],_0x51e51d=toTextKnowledgeBaseMd(_0xa8576[_0xae028d(0x1c4)]['name'],_0xa8576['attributes'][_0xae028d(0x278)]),_0x3b5db2=!a109_0xd05ade[_0xae028d(0x20b)](_0x28929d);let _0x1c7501=_0x3b5db2,_0x2cd420;if(!_0x3b5db2){const _0x440f33=a109_0xd05ade[_0xae028d(0x1d2)](_0x28929d,_0xae028d(0x29d)),_0x960c75=generateDiff(_0x440f33,_0x51e51d);_0x1c7501=hasChanges(_0x960c75),_0x1c7501&&(_0x2cd420=formatDiffWithColors(_0x960c75));}_0x4d621f[_0xae028d(0x28b)]({'path':_0x28929d,'content':_0x51e51d}),_0x4c7e9b['textKnowledgeBases']['push']({'name':_0xa8576[_0xae028d(0x1c4)]['name'],'outputPath':_0x28929d,'isNew':_0x3b5db2,'hasChanges':_0x1c7501,'diff':_0x2cd420}),_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x2a9)][_0xae028d(0x1bf)]++;if(_0x3b5db2)_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x2a9)][_0xae028d(0x266)]++;else{if(_0x1c7501)_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x2a9)][_0xae028d(0x2ae)]++;else _0x4c7e9b[_0xae028d(0x27b)]['textKnowledgeBases']['unchanged']++;}}for(const _0x25ebbc of _0x2e2338){if(_0x25ebbc[_0xae028d(0x1c4)]['isManaged'])continue;const _0x46a064=getSanitizedPathWithMigration(getPromptsDir(_0x118c53),_0x25ebbc[_0xae028d(0x1c4)]['name'],_0xae028d(0x26a));_0x46a064[_0xae028d(0x1ac)]&&this['logger'][_0xae028d(0x23f)]('Renamed\x20prompt\x20file:\x20'+a109_0x3b39de[_0xae028d(0x228)](_0x46a064[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de[_0xae028d(0x228)](_0x46a064['path']));const _0x5bcc3c=_0x46a064['path'],_0x13d75e=await apiPromptToYaml(_0x25ebbc,_0x4128bb);if(!_0x13d75e)continue;const _0x20e2ae=toPromptYamlString(_0x13d75e),_0x5747b6=!a109_0xd05ade['existsSync'](_0x5bcc3c);let _0x50a642=_0x5747b6,_0x5ecb33;if(!_0x5747b6){const _0x4bc0c6=a109_0xd05ade[_0xae028d(0x1d2)](_0x5bcc3c,'utf-8'),_0x1ed8df=generateDiff(_0x4bc0c6,_0x20e2ae);_0x50a642=hasChanges(_0x1ed8df),_0x50a642&&(_0x5ecb33=formatDiffWithColors(_0x1ed8df));}_0x4d621f[_0xae028d(0x28b)]({'path':_0x5bcc3c,'content':_0x20e2ae}),_0x4c7e9b['prompts'][_0xae028d(0x28b)]({'name':_0x25ebbc['attributes'][_0xae028d(0x205)],'outputPath':_0x5bcc3c,'isNew':_0x5747b6,'hasChanges':_0x50a642,'diff':_0x5ecb33}),_0x4c7e9b['counts']['prompts'][_0xae028d(0x1bf)]++;if(_0x5747b6)_0x4c7e9b[_0xae028d(0x27b)]['prompts'][_0xae028d(0x266)]++;else{if(_0x50a642)_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x25b)]['updated']++;else _0x4c7e9b[_0xae028d(0x27b)]['prompts'][_0xae028d(0x211)]++;}}for(const _0xf482be of _0xfbf48c){const _0x16fd28=_0xf482be[_0xae028d(0x1c4)][_0xae028d(0x1de)]['toLowerCase'](),_0x23de8a=getSanitizedPathWithMigration(getIntegrationsDir(_0x118c53),_0x16fd28,_0xae028d(0x26a));_0x23de8a[_0xae028d(0x1ac)]&&this[_0xae028d(0x1b6)]['info'](_0xae028d(0x1b2)+a109_0x3b39de[_0xae028d(0x228)](_0x23de8a[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de[_0xae028d(0x228)](_0x23de8a['path']));const _0x2f8566=_0x23de8a[_0xae028d(0x214)],_0x25b35d=await apiIntegrationToYaml(_0xf482be,_0x4128bb),_0x3792be=toIntegrationYamlString(_0x25b35d),_0x13ed09=!a109_0xd05ade[_0xae028d(0x20b)](_0x2f8566);let _0x2c74d5=_0x13ed09,_0x20cd9c;if(!_0x13ed09){const _0x34293b=a109_0xd05ade[_0xae028d(0x1d2)](_0x2f8566,_0xae028d(0x29d)),_0x509818=generateDiff(_0x34293b,_0x3792be);_0x2c74d5=hasChanges(_0x509818),_0x2c74d5&&(_0x20cd9c=formatDiffWithColors(_0x509818));}_0x4d621f[_0xae028d(0x28b)]({'path':_0x2f8566,'content':_0x3792be}),_0x4c7e9b[_0xae028d(0x1fa)][_0xae028d(0x28b)]({'name':_0x16fd28,'outputPath':_0x2f8566,'isNew':_0x13ed09,'hasChanges':_0x2c74d5,'diff':_0x20cd9c}),_0x4c7e9b[_0xae028d(0x27b)]['integrations'][_0xae028d(0x1bf)]++;if(_0x13ed09)_0x4c7e9b['counts']['integrations'][_0xae028d(0x266)]++;else{if(_0x2c74d5)_0x4c7e9b[_0xae028d(0x27b)]['integrations'][_0xae028d(0x2ae)]++;else _0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x1fa)][_0xae028d(0x211)]++;}}for(const _0x1f3f55 of _0x1d4f20){if(_0x1f3f55[_0xae028d(0x1c4)][_0xae028d(0x24a)])continue;const _0x135989=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x118c53),_0x1f3f55['attributes'][_0xae028d(0x205)]);_0x135989[_0xae028d(0x1ac)]&&this[_0xae028d(0x1b6)][_0xae028d(0x23f)]('Renamed\x20experimental\x20KB\x20directory:\x20'+a109_0x3b39de[_0xae028d(0x228)](_0x135989[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de['basename'](_0x135989[_0xae028d(0x214)]));const _0x139524=_0x135989['path'],_0xaa0527=a109_0x3b39de['join'](_0x139524,sanitizeForFilesystem(_0x1f3f55['attributes'][_0xae028d(0x205)])+_0xae028d(0x26a)),_0x1d7ebe=a109_0x3b39de[_0xae028d(0x24f)](_0x139524,_0xae028d(0x2ab)),_0x53d000=apiExperimentalKnowledgeBaseToYaml(_0x1f3f55),_0x35cf71=toExperimentalKnowledgeBaseYamlString(_0x53d000),_0xc5da68=!a109_0xd05ade[_0xae028d(0x20b)](_0x139524);let _0x33ebe6=_0xc5da68,_0x4835eb,_0x5d0369=_0x35cf71;const _0x37435f=[..._0x53d000[_0xae028d(0x2ab)]][_0xae028d(0x210)]((_0x5cbc28,_0x205018)=>_0x5cbc28['name']['localeCompare'](_0x205018[_0xae028d(0x205)]));for(const _0x3f94bc of _0x37435f){_0x5d0369+=_0xae028d(0x2b3)+_0x3f94bc['name']+_0xae028d(0x204)+_0x3f94bc['code']+'\x0a---\x20schema:\x20'+_0x3f94bc['name']+_0xae028d(0x204)+_0x3f94bc[_0xae028d(0x1cd)]+'\x0a';}if(!_0xc5da68){let _0xb0ab47='';a109_0xd05ade[_0xae028d(0x20b)](_0xaa0527)&&(_0xb0ab47=a109_0xd05ade[_0xae028d(0x1d2)](_0xaa0527,_0xae028d(0x29d)));if(a109_0xd05ade[_0xae028d(0x20b)](_0x1d7ebe)){const _0x300fc1=a109_0xd05ade[_0xae028d(0x282)](_0x1d7ebe,{'withFileTypes':!![]}),_0x171948=_0x300fc1[_0xae028d(0x2ac)](_0x216fc3=>_0x216fc3['isDirectory']())[_0xae028d(0x210)]((_0x4f3c5b,_0x411063)=>_0x4f3c5b[_0xae028d(0x205)][_0xae028d(0x1af)](_0x411063[_0xae028d(0x205)]));for(const _0x2a469a of _0x171948){const _0x876f6d=a109_0x3b39de['join'](_0x1d7ebe,_0x2a469a[_0xae028d(0x205)],_0xae028d(0x262)),_0x9928f2=a109_0x3b39de[_0xae028d(0x24f)](_0x1d7ebe,_0x2a469a['name'],_0xae028d(0x1d9));a109_0xd05ade['existsSync'](_0x876f6d)&&(_0xb0ab47+=_0xae028d(0x2b3)+_0x2a469a[_0xae028d(0x205)]+_0xae028d(0x204)+a109_0xd05ade[_0xae028d(0x1d2)](_0x876f6d,_0xae028d(0x29d))+'\x0a'),a109_0xd05ade[_0xae028d(0x20b)](_0x9928f2)&&(_0xb0ab47+=_0xae028d(0x298)+_0x2a469a['name']+_0xae028d(0x204)+a109_0xd05ade[_0xae028d(0x1d2)](_0x9928f2,_0xae028d(0x29d))+'\x0a');}}const _0x423c0e=generateDiff(_0xb0ab47,_0x5d0369);_0x33ebe6=hasChanges(_0x423c0e),_0x33ebe6&&(_0x4835eb=formatDiffWithColors(_0x423c0e));}_0x4d621f[_0xae028d(0x28b)]({'path':_0x139524,'content':'','isDir':!![]}),_0x4d621f[_0xae028d(0x28b)]({'path':_0xaa0527,'content':_0x35cf71}),_0x4d621f[_0xae028d(0x28b)]({'path':_0x1d7ebe,'content':'','isDir':!![]});for(const _0x1d042b of _0x53d000[_0xae028d(0x2ab)]){const _0x17b0fb=a109_0x3b39de[_0xae028d(0x24f)](_0x1d7ebe,sanitizeForFilesystem(_0x1d042b[_0xae028d(0x205)])),_0x4b1138=a109_0x3b39de[_0xae028d(0x24f)](_0x17b0fb,'code.js'),_0xb2d25a=a109_0x3b39de['join'](_0x17b0fb,_0xae028d(0x1d9));_0x4d621f[_0xae028d(0x28b)]({'path':_0x17b0fb,'content':'','isDir':!![]}),_0x4d621f['push']({'path':_0x4b1138,'content':_0x1d042b[_0xae028d(0x1e3)]}),_0x4d621f[_0xae028d(0x28b)]({'path':_0xb2d25a,'content':_0x1d042b[_0xae028d(0x1cd)]});}if(a109_0xd05ade['existsSync'](_0x1d7ebe)){const _0x520767=a109_0xd05ade[_0xae028d(0x282)](_0x1d7ebe,{'withFileTypes':!![]}),_0x39156a=new Set(_0x53d000[_0xae028d(0x2ab)][_0xae028d(0x296)](_0x3fdacb=>sanitizeForFilesystem(_0x3fdacb[_0xae028d(0x205)])));for(const _0x20f8e8 of _0x520767){if(_0x20f8e8[_0xae028d(0x24c)]()&&!_0x39156a['has'](_0x20f8e8[_0xae028d(0x205)])){const _0x14bd60=a109_0x3b39de[_0xae028d(0x24f)](_0x1d7ebe,_0x20f8e8['name']);_0xbe4cdf['push']({'path':_0x14bd60,'isDir':!![]});}}}_0x4c7e9b[_0xae028d(0x209)][_0xae028d(0x28b)]({'name':_0x1f3f55[_0xae028d(0x1c4)][_0xae028d(0x205)],'outputPath':_0x139524,'isNew':_0xc5da68,'hasChanges':_0x33ebe6,'diff':_0x4835eb}),_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x209)][_0xae028d(0x1bf)]++;if(_0xc5da68)_0x4c7e9b['counts'][_0xae028d(0x209)][_0xae028d(0x266)]++;else{if(_0x33ebe6)_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x209)][_0xae028d(0x2ae)]++;else _0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x209)][_0xae028d(0x211)]++;}}for(const _0x31d529 of _0x1d36c0){if(_0x31d529[_0xae028d(0x1c4)]['isManaged'])continue;const _0x2f0e56=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x118c53),_0x31d529[_0xae028d(0x1c4)]['name']);_0x2f0e56[_0xae028d(0x1ac)]&&this[_0xae028d(0x1b6)][_0xae028d(0x23f)](_0xae028d(0x2bd)+a109_0x3b39de[_0xae028d(0x228)](_0x2f0e56[_0xae028d(0x270)])+_0xae028d(0x22a)+a109_0x3b39de[_0xae028d(0x228)](_0x2f0e56[_0xae028d(0x214)]));const _0x3b7be7=_0x2f0e56[_0xae028d(0x214)],_0x2bdca3=a109_0x3b39de[_0xae028d(0x24f)](_0x3b7be7,sanitizeForFilesystem(_0x31d529[_0xae028d(0x1c4)]['name'])+_0xae028d(0x26a)),_0x576c71=a109_0x3b39de['join'](_0x3b7be7,_0xae028d(0x262)),_0x58b525=a109_0x3b39de[_0xae028d(0x24f)](_0x3b7be7,_0xae028d(0x265)),_0x596c1e=apiExperimentalArtifactToYaml(_0x31d529),_0x5dc011=toExperimentalArtifactYamlString(_0x596c1e),_0x2fc71d=!a109_0xd05ade[_0xae028d(0x20b)](_0x3b7be7);let _0x272cfc=_0x2fc71d,_0x2504ae,_0x2c7c70=_0x5dc011+(_0xae028d(0x1b9)+_0x596c1e['code']+'\x0a');const _0x779909=[..._0x596c1e[_0xae028d(0x265)]][_0xae028d(0x210)]((_0x5fb25d,_0x31566d)=>_0x5fb25d[_0xae028d(0x290)]['localeCompare'](_0x31566d['file_name']));for(const _0x8aa4e1 of _0x779909){_0x2c7c70+=_0xae028d(0x201)+_0x8aa4e1[_0xae028d(0x290)]+_0xae028d(0x204)+_0x8aa4e1[_0xae028d(0x1ce)]+'\x0a';}if(!_0x2fc71d){let _0x3bcbfe='';a109_0xd05ade[_0xae028d(0x20b)](_0x2bdca3)&&(_0x3bcbfe=a109_0xd05ade['readFileSync'](_0x2bdca3,_0xae028d(0x29d)));a109_0xd05ade[_0xae028d(0x20b)](_0x576c71)&&(_0x3bcbfe+=_0xae028d(0x1b9)+a109_0xd05ade[_0xae028d(0x1d2)](_0x576c71,_0xae028d(0x29d))+'\x0a');if(a109_0xd05ade[_0xae028d(0x20b)](_0x58b525)){const _0x34324c=a109_0xd05ade['readdirSync'](_0x58b525),_0x5f3c74=_0x34324c[_0xae028d(0x2ac)](_0x5524d8=>{const _0xd86f0d=_0xae028d,_0x4b0779=a109_0x3b39de[_0xd86f0d(0x24f)](_0x58b525,_0x5524d8);return a109_0xd05ade[_0xd86f0d(0x206)](_0x4b0779)[_0xd86f0d(0x27a)]();})['sort']((_0x3d2745,_0x438511)=>_0x3d2745[_0xae028d(0x1af)](_0x438511));for(const _0x23ca43 of _0x5f3c74){const _0x131ec4=a109_0x3b39de[_0xae028d(0x24f)](_0x58b525,_0x23ca43);_0x3bcbfe+=_0xae028d(0x201)+_0x23ca43+_0xae028d(0x204)+a109_0xd05ade[_0xae028d(0x1d2)](_0x131ec4,_0xae028d(0x29d))+'\x0a';}}const _0x4d0275=generateDiff(_0x3bcbfe,_0x2c7c70);_0x272cfc=hasChanges(_0x4d0275),_0x272cfc&&(_0x2504ae=formatDiffWithColors(_0x4d0275));}_0x4d621f[_0xae028d(0x28b)]({'path':_0x3b7be7,'content':'','isDir':!![]}),_0x4d621f[_0xae028d(0x28b)]({'path':_0x2bdca3,'content':_0x5dc011}),_0x4d621f[_0xae028d(0x28b)]({'path':_0x576c71,'content':_0x596c1e[_0xae028d(0x1e3)]});if(_0x596c1e[_0xae028d(0x265)][_0xae028d(0x1d8)]>0x0){_0x4d621f[_0xae028d(0x28b)]({'path':_0x58b525,'content':'','isDir':!![]});for(const _0x163190 of _0x596c1e['files']){const _0x43ac07=a109_0x3b39de[_0xae028d(0x24f)](_0x58b525,_0x163190['file_name']);_0x4d621f[_0xae028d(0x28b)]({'path':_0x43ac07,'content':_0x163190[_0xae028d(0x1ce)]});}}if(a109_0xd05ade['existsSync'](_0x58b525)){const _0x31e661=a109_0xd05ade[_0xae028d(0x282)](_0x58b525),_0x4c0842=new Set(_0x596c1e[_0xae028d(0x265)]['map'](_0xe70d=>_0xe70d[_0xae028d(0x290)]));for(const _0x231997 of _0x31e661){const _0x50425c=a109_0x3b39de['join'](_0x58b525,_0x231997);a109_0xd05ade[_0xae028d(0x206)](_0x50425c)[_0xae028d(0x27a)]()&&!_0x4c0842[_0xae028d(0x1ea)](_0x231997)&&_0xbe4cdf['push']({'path':_0x50425c});}}_0x4c7e9b[_0xae028d(0x1df)][_0xae028d(0x28b)]({'name':_0x31d529['attributes'][_0xae028d(0x205)],'outputPath':_0x3b7be7,'isNew':_0x2fc71d,'hasChanges':_0x272cfc,'diff':_0x2504ae}),_0x4c7e9b['counts'][_0xae028d(0x1df)][_0xae028d(0x1bf)]++;if(_0x2fc71d)_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x1df)][_0xae028d(0x266)]++;else{if(_0x272cfc)_0x4c7e9b[_0xae028d(0x27b)][_0xae028d(0x1df)][_0xae028d(0x2ae)]++;else _0x4c7e9b[_0xae028d(0x27b)]['experimentalArtifacts'][_0xae028d(0x211)]++;}}if(_0x15ba12?.[_0xae028d(0x260)])return _0x4c7e9b;a109_0xd05ade['mkdirSync'](_0x118c53,{'recursive':!![]}),a109_0xd05ade[_0xae028d(0x22c)](getKnowledgeBasesDir(_0x118c53),{'recursive':!![]}),a109_0xd05ade[_0xae028d(0x22c)](getPromptsDir(_0x118c53),{'recursive':!![]}),a109_0xd05ade[_0xae028d(0x22c)](getIntegrationsDir(_0x118c53),{'recursive':!![]}),a109_0xd05ade[_0xae028d(0x22c)](getExperimentalKnowledgeBasesDir(_0x118c53),{'recursive':!![]}),a109_0xd05ade['mkdirSync'](getExperimentalArtifactsDir(_0x118c53),{'recursive':!![]});const _0xbbcbcf=a109_0x3b39de['join'](_0x118c53,_0xae028d(0x252));a109_0xd05ade['writeFileSync'](_0xbbcbcf,createAgentConfigContent(_0x48775e));for(const _0x3d9f0b of _0x4d621f){if(_0x3d9f0b[_0xae028d(0x23a)])a109_0xd05ade[_0xae028d(0x22c)](_0x3d9f0b[_0xae028d(0x214)],{'recursive':!![]});else{const _0x3570c3=a109_0x3b39de[_0xae028d(0x258)](_0x3d9f0b[_0xae028d(0x214)]);!a109_0xd05ade[_0xae028d(0x20b)](_0x3570c3)&&a109_0xd05ade[_0xae028d(0x22c)](_0x3570c3,{'recursive':!![]}),a109_0xd05ade['writeFileSync'](_0x3d9f0b[_0xae028d(0x214)],_0x3d9f0b[_0xae028d(0x1e8)]);}}for(const _0xf8acdf of _0xbe4cdf){_0xf8acdf[_0xae028d(0x23a)]?(a109_0xd05ade['rmSync'](_0xf8acdf[_0xae028d(0x214)],{'recursive':!![],'force':!![]}),this[_0xae028d(0x1b6)][_0xae028d(0x23f)](_0xae028d(0x25a)+a109_0x3b39de['basename'](a109_0x3b39de[_0xae028d(0x258)](_0xf8acdf['path']))+'/'+a109_0x3b39de[_0xae028d(0x228)](_0xf8acdf[_0xae028d(0x214)]))):(a109_0xd05ade[_0xae028d(0x1d6)](_0xf8acdf[_0xae028d(0x214)],{'force':!![]}),this[_0xae028d(0x1b6)][_0xae028d(0x23f)](_0xae028d(0x1ed)+a109_0x3b39de[_0xae028d(0x228)](a109_0x3b39de[_0xae028d(0x258)](_0xf8acdf[_0xae028d(0x214)]))+'/'+a109_0x3b39de['basename'](_0xf8acdf[_0xae028d(0x214)])));}return _0x4c7e9b;}async[a109_0x291832(0x27d)](_0x7944e3,_0xf6aa8c){const _0x59575c=a109_0x291832,_0x1e91d5=a109_0x3b39de[_0x59575c(0x24f)](_0x7944e3,_0x59575c(0x252));if(!a109_0xd05ade[_0x59575c(0x20b)](_0x1e91d5))throw new SDKError(ErrorCode[_0x59575c(0x23e)],_0x59575c(0x268)+_0x7944e3,undefined,{'helpText':_0x59575c(0x1b3)});const _0x2bc778=loadAgentConfig(_0x1e91d5),_0x1d8ffd=await this[_0x59575c(0x1dd)](_0x2bc778[_0x59575c(0x23c)]),_0x473973=await this['client']['getProject'](_0x1d8ffd),_0x3e9f7c=_0x473973['attributes'][_0x59575c(0x205)],_0xc22290={'projectName':_0x3e9f7c,'projectId':_0x1d8ffd,'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}}},_0x17c66c=[],_0x135266=[],_0x5cce86=[],_0x1f181e=[],_0x3b06bd=[],_0x2c9a3c=[],_0x516b95=a109_0xd05ade['readdirSync'](_0x7944e3,{'withFileTypes':!![]});for(const _0x5dd10c of _0x516b95){if(!_0x5dd10c[_0x59575c(0x24c)]())continue;if([_0x59575c(0x2b0),_0x59575c(0x25b),_0x59575c(0x1fa),_0x59575c(0x21b),_0x59575c(0x1a7)][_0x59575c(0x242)](_0x5dd10c['name']))continue;const _0x2fbb41=a109_0x3b39de[_0x59575c(0x24f)](_0x7944e3,_0x5dd10c[_0x59575c(0x205)]);if(isAgentDir(_0x2fbb41)){const _0x1d6b0c=a109_0x3b39de[_0x59575c(0x24f)](_0x2fbb41,'agent.yml'),_0x5dcfb8=a109_0x3b39de['join'](_0x2fbb41,_0x59575c(0x255)),_0x12fde7=a109_0x3b39de['join'](_0x2fbb41,'starter_message.md'),_0x232347=parseAgentYaml(a109_0xd05ade['readFileSync'](_0x1d6b0c,_0x59575c(0x29d)),_0x1d6b0c),_0x317353=a109_0xd05ade[_0x59575c(0x20b)](_0x5dcfb8)?a109_0xd05ade[_0x59575c(0x1d2)](_0x5dcfb8,_0x59575c(0x29d)):'',_0x3aa67e=a109_0xd05ade[_0x59575c(0x20b)](_0x12fde7)?a109_0xd05ade[_0x59575c(0x1d2)](_0x12fde7,_0x59575c(0x29d)):_0x232347['starter_message'];_0x17c66c['push']({'name':_0x232347[_0x59575c(0x205)],'dir':_0x2fbb41,'yaml':_0x232347,'systemPrompt':_0x317353,'starterMessage':_0x3aa67e});}}const _0x409843=getKnowledgeBasesDir(_0x7944e3);if(a109_0xd05ade[_0x59575c(0x20b)](_0x409843)){const _0xe8aa4a=a109_0xd05ade[_0x59575c(0x282)](_0x409843);for(const _0x1b1296 of _0xe8aa4a){const _0x309b76=a109_0x3b39de[_0x59575c(0x24f)](_0x409843,_0x1b1296);if(_0x1b1296[_0x59575c(0x25d)](_0x59575c(0x26a))){const _0x189319=parseKnowledgeBaseYaml(a109_0xd05ade[_0x59575c(0x1d2)](_0x309b76,_0x59575c(0x29d)),_0x309b76);_0x135266[_0x59575c(0x28b)]({'name':_0x189319['name'],'path':_0x309b76,'yaml':_0x189319});}else{if(_0x1b1296['endsWith'](_0x59575c(0x25c))){const _0x1639ab=a109_0xd05ade[_0x59575c(0x1d2)](_0x309b76,_0x59575c(0x29d)),{name:_0x25d285,text:_0x307c7c}=parseTextKnowledgeBaseMd(_0x1639ab,_0x1b1296);_0x5cce86[_0x59575c(0x28b)]({'name':_0x25d285,'path':_0x309b76,'text':_0x307c7c});}}}}const _0x59acd3=getPromptsDir(_0x7944e3);if(a109_0xd05ade['existsSync'](_0x59acd3)){const _0x2df725=a109_0xd05ade[_0x59575c(0x282)](_0x59acd3)[_0x59575c(0x2ac)](_0x481be2=>_0x481be2[_0x59575c(0x25d)](_0x59575c(0x26a)));for(const _0x44ce34 of _0x2df725){const _0x587221=a109_0x3b39de['join'](_0x59acd3,_0x44ce34),_0x1d9035=parsePromptYaml(a109_0xd05ade[_0x59575c(0x1d2)](_0x587221,_0x59575c(0x29d)),_0x587221);_0x1f181e['push']({'name':_0x1d9035['name'],'path':_0x587221,'yaml':_0x1d9035});}}const _0x3b602b=[],_0x17014b=getIntegrationsDir(_0x7944e3);if(a109_0xd05ade['existsSync'](_0x17014b)){const _0x3458a4=a109_0xd05ade[_0x59575c(0x282)](_0x17014b)[_0x59575c(0x2ac)](_0x28d855=>_0x28d855[_0x59575c(0x25d)](_0x59575c(0x26a)));for(const _0x400878 of _0x3458a4){const _0x482061=a109_0x3b39de[_0x59575c(0x24f)](_0x17014b,_0x400878),_0x23f118=parseIntegrationYaml(a109_0xd05ade['readFileSync'](_0x482061,_0x59575c(0x29d)),_0x482061);if(!SAFE_INTEGRATION_TYPES['includes'](_0x23f118[_0x59575c(0x238)][_0x59575c(0x261)]())){this['logger'][_0x59575c(0x2bf)](_0x59575c(0x21d)+_0x23f118[_0x59575c(0x205)]+_0x59575c(0x2a5)+_0x23f118['service_type']+'):\x20'+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES['join'](',\x20')+_0x59575c(0x264))+'Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.');continue;}_0x3b602b[_0x59575c(0x28b)]({'name':_0x23f118[_0x59575c(0x205)],'path':_0x482061,'yaml':_0x23f118});}}const _0x200fbe=getExperimentalKnowledgeBasesDir(_0x7944e3);if(a109_0xd05ade['existsSync'](_0x200fbe)){const _0x3ca7d6=a109_0xd05ade['readdirSync'](_0x200fbe,{'withFileTypes':!![]});for(const _0x5d6c97 of _0x3ca7d6){if(!_0x5d6c97[_0x59575c(0x24c)]())continue;const _0x538de2=a109_0x3b39de[_0x59575c(0x24f)](_0x200fbe,_0x5d6c97[_0x59575c(0x205)]),_0x743181=a109_0x3b39de[_0x59575c(0x24f)](_0x538de2,_0x5d6c97[_0x59575c(0x205)]+_0x59575c(0x26a)),_0x204ec7=a109_0x3b39de[_0x59575c(0x24f)](_0x538de2,_0x59575c(0x2ab));if(!a109_0xd05ade[_0x59575c(0x20b)](_0x743181))continue;const _0x2b495f=parseExperimentalKnowledgeBaseYaml(a109_0xd05ade[_0x59575c(0x1d2)](_0x743181,_0x59575c(0x29d)),_0x743181),_0x150279=[];if(a109_0xd05ade[_0x59575c(0x20b)](_0x204ec7)){const _0x12ecbf=a109_0xd05ade[_0x59575c(0x282)](_0x204ec7,{'withFileTypes':!![]});for(const _0x29da44 of _0x12ecbf){if(!_0x29da44[_0x59575c(0x24c)]())continue;const _0xe7358c=a109_0x3b39de[_0x59575c(0x24f)](_0x204ec7,_0x29da44[_0x59575c(0x205)]),_0x4bb520=a109_0x3b39de['join'](_0xe7358c,_0x59575c(0x262)),_0x908eaf=a109_0x3b39de[_0x59575c(0x24f)](_0xe7358c,_0x59575c(0x1d9));a109_0xd05ade[_0x59575c(0x20b)](_0x4bb520)&&a109_0xd05ade['existsSync'](_0x908eaf)&&_0x150279['push']({'name':_0x29da44[_0x59575c(0x205)],'code':a109_0xd05ade['readFileSync'](_0x4bb520,_0x59575c(0x29d)),'json_schema':a109_0xd05ade[_0x59575c(0x1d2)](_0x908eaf,_0x59575c(0x29d))});}}const _0x5aa98b={..._0x2b495f,'variables':_0x2b495f[_0x59575c(0x28a)]||[],'functions':_0x150279};_0x3b06bd[_0x59575c(0x28b)]({'name':_0x2b495f[_0x59575c(0x205)],'dir':_0x538de2,'def':_0x5aa98b});}}const _0x2162ca=getExperimentalArtifactsDir(_0x7944e3);if(a109_0xd05ade[_0x59575c(0x20b)](_0x2162ca)){const _0x50c7ea=a109_0xd05ade[_0x59575c(0x282)](_0x2162ca,{'withFileTypes':!![]});for(const _0x4681ff of _0x50c7ea){if(!_0x4681ff[_0x59575c(0x24c)]())continue;const _0x202dc1=a109_0x3b39de[_0x59575c(0x24f)](_0x2162ca,_0x4681ff[_0x59575c(0x205)]),_0x1f272b=a109_0x3b39de['join'](_0x202dc1,_0x4681ff[_0x59575c(0x205)]+'.yml'),_0x4747a9=a109_0x3b39de[_0x59575c(0x24f)](_0x202dc1,_0x59575c(0x262)),_0x48b0a8=a109_0x3b39de[_0x59575c(0x24f)](_0x202dc1,_0x59575c(0x265));if(!a109_0xd05ade[_0x59575c(0x20b)](_0x1f272b)||!a109_0xd05ade[_0x59575c(0x20b)](_0x4747a9))continue;const _0x4e9fcc=parseExperimentalArtifactYaml(a109_0xd05ade[_0x59575c(0x1d2)](_0x1f272b,_0x59575c(0x29d)),_0x1f272b),_0x1f6cf1=a109_0xd05ade[_0x59575c(0x1d2)](_0x4747a9,_0x59575c(0x29d)),_0x28ac5d=[];if(a109_0xd05ade[_0x59575c(0x20b)](_0x48b0a8)){const _0x3c62a6=a109_0xd05ade['readdirSync'](_0x48b0a8);for(const _0x1b1268 of _0x3c62a6){const _0x5077e9=a109_0x3b39de[_0x59575c(0x24f)](_0x48b0a8,_0x1b1268);a109_0xd05ade[_0x59575c(0x206)](_0x5077e9)['isFile']()&&_0x28ac5d['push']({'file_name':_0x1b1268,'text_content':a109_0xd05ade[_0x59575c(0x1d2)](_0x5077e9,_0x59575c(0x29d))});}}const _0x54a063={..._0x4e9fcc,'code':_0x1f6cf1,'files':_0x28ac5d};_0x2c9a3c[_0x59575c(0x28b)]({'name':_0x4e9fcc[_0x59575c(0x205)],'dir':_0x202dc1,'def':_0x54a063});}}const _0x3f43ae=await this['client'][_0x59575c(0x229)](_0x1d8ffd),_0x268b0d=await this[_0x59575c(0x2bc)][_0x59575c(0x1c3)](_0x1d8ffd),_0x3f1e69=await this[_0x59575c(0x2bc)][_0x59575c(0x1d5)](_0x1d8ffd),_0xdaf34e=await this[_0x59575c(0x2bc)]['listPrompts'](_0x1d8ffd),_0x43300c=await this[_0x59575c(0x2bc)][_0x59575c(0x1f8)](_0x1d8ffd),_0x4ac2e2=await safeListOrEmpty(()=>this[_0x59575c(0x2bc)][_0x59575c(0x1b8)](_0x1d8ffd)),_0x268bf4=await safeListOrEmpty(()=>this[_0x59575c(0x2bc)][_0x59575c(0x263)](_0x1d8ffd)),_0x48479e=await fetchAllToolTargetMaps((_0x1af812,_0x4c530e)=>this[_0x59575c(0x2bc)][_0x59575c(0x27f)](_0x1af812,_0x4c530e),_0x1d8ffd),_0x55e225=new Map(),_0x2ff3d0=new Map(),_0x4529e5=new Map(),_0x39fd7a=new Map(),_0x504042=new Map(),_0x93a687=new Map(),_0x294df6=new Map();for(const _0x4f5898 of _0x3f43ae){_0x55e225[_0x59575c(0x230)](_0x4f5898[_0x59575c(0x1c4)][_0x59575c(0x205)],_0x4f5898);}for(const _0x2669c8 of _0x268b0d){_0x2ff3d0['set'](_0x2669c8['attributes'][_0x59575c(0x205)],_0x2669c8);}for(const _0x136427 of _0x3f1e69){_0x4529e5[_0x59575c(0x230)](_0x136427['attributes'][_0x59575c(0x205)],_0x136427);}for(const _0x1682c3 of _0xdaf34e){_0x39fd7a[_0x59575c(0x230)](_0x1682c3[_0x59575c(0x1c4)][_0x59575c(0x205)],_0x1682c3);}for(const _0x47674d of _0x43300c){_0x504042[_0x59575c(0x230)](_0x47674d[_0x59575c(0x1c4)][_0x59575c(0x1de)]['toLowerCase'](),_0x47674d);}for(const _0x20e64f of _0x4ac2e2){_0x93a687[_0x59575c(0x230)](_0x20e64f[_0x59575c(0x1c4)]['name'],_0x20e64f);}for(const _0x51c532 of _0x268bf4){_0x294df6[_0x59575c(0x230)](_0x51c532[_0x59575c(0x1c4)]['name'],_0x51c532);}const _0x1772ef=new Map(),_0x31a6fc=new Map();for(const _0x3bc551 of _0x3f43ae){_0x1772ef['set'](_0x3bc551[_0x59575c(0x1c4)][_0x59575c(0x205)],_0x3bc551['id']),_0x31a6fc[_0x59575c(0x230)](_0x3bc551['id'],_0x3bc551['attributes']['name']);}const _0x2bf267=new Map(),_0x31009a=new Map();for(const _0x5e8941 of _0xdaf34e){_0x2bf267[_0x59575c(0x230)](_0x5e8941[_0x59575c(0x1c4)][_0x59575c(0x205)],_0x5e8941['id']),_0x31009a[_0x59575c(0x230)](_0x5e8941['id'],_0x5e8941['attributes']['name']);}const _0x5b5cae=_0x48479e[_0x59575c(0x254)][_0x59575c(0x20d)]||new Map(),_0x58121d=_0x48479e[_0x59575c(0x254)]['TextKnowledgeBase']||new Map(),_0x50af7a=_0x48479e[_0x59575c(0x254)]['ExperimentalKnowledgeBase']||new Map(),_0x17d652=new Map(),_0x2b4428={'resolveToolTargetName':buildNameResolver({..._0x48479e[_0x59575c(0x1cc)],'Agent':_0x31a6fc}),'resolvePromptName':async _0x15ddda=>_0x31009a[_0x59575c(0x1dc)](_0x15ddda),'onWarning':_0x36a05c=>this['logger'][_0x59575c(0x2bf)](_0x36a05c)};let _0x112a9e=[];const _0x545770={'projectId':_0x1d8ffd,'resolveToolTargetId':buildIdResolver({..._0x48479e[_0x59575c(0x254)],'Agent':_0x1772ef}),'resolvePromptId':async _0x5bfbea=>_0x2bf267[_0x59575c(0x1dc)](_0x5bfbea),'onWarning':_0x1efabe=>{const _0x5aca0d=_0x59575c;this['logger'][_0x5aca0d(0x2bf)](_0x1efabe),_0x112a9e[_0x5aca0d(0x28b)](_0x1efabe);}},{resolved:_0x9fca1c,unresolved:_0x4807ee}=resolveAgentDependencies(_0x17c66c,new Set(_0x55e225['keys']()));for(const {agent:_0x25c9d8,missingDeps:_0x2c1921}of _0x4807ee){_0xc22290[_0x59575c(0x1b4)]['push']({'agentName':_0x25c9d8[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x1ad),'error':_0x59575c(0x1c1)+_0x2c1921[_0x59575c(0x24f)](',\x20')+_0x59575c(0x27c)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1b4)]['errors']++;}for(const _0x4cc485 of _0x135266){const _0x4b9017=_0x2ff3d0[_0x59575c(0x1dc)](_0x4cc485[_0x59575c(0x1e4)][_0x59575c(0x205)]),_0x4bfe98=a109_0xd05ade[_0x59575c(0x1d2)](_0x4cc485['path'],'utf-8');if(_0x4b9017){const _0x30f2bb=apiKnowledgeBaseToYaml(_0x4b9017),_0x37be47=toKnowledgeBaseYamlString(_0x30f2bb),_0x4a0531=generateDiff(_0x37be47,_0x4bfe98),_0x3405e1=hasChanges(_0x4a0531);_0x3405e1?(_0xc22290[_0x59575c(0x1f9)][_0x59575c(0x28b)]({'name':_0x4cc485['yaml']['name'],'action':'updated','id':_0x4b9017['id'],'diff':formatDiffWithColors(_0x4a0531)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1f9)][_0x59575c(0x2ae)]++):(_0xc22290[_0x59575c(0x1f9)][_0x59575c(0x28b)]({'name':_0x4cc485[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x211),'id':_0x4b9017['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1f9)][_0x59575c(0x211)]++);}else _0xc22290['knowledgeBases'][_0x59575c(0x28b)]({'name':_0x4cc485['yaml'][_0x59575c(0x205)],'action':_0x59575c(0x243)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1f9)][_0x59575c(0x243)]++;}for(const _0x1f6f98 of _0x5cce86){const _0x799381=_0x4529e5[_0x59575c(0x1dc)](_0x1f6f98[_0x59575c(0x205)]),_0x4b366c=a109_0xd05ade[_0x59575c(0x1d2)](_0x1f6f98[_0x59575c(0x214)],_0x59575c(0x29d));if(_0x799381){const _0x302843=toTextKnowledgeBaseMd(_0x799381[_0x59575c(0x1c4)][_0x59575c(0x205)],_0x799381[_0x59575c(0x1c4)]['text']),_0x204ab7=generateDiff(_0x302843,_0x4b366c),_0x1cac69=hasChanges(_0x204ab7);_0x1cac69?(_0xc22290[_0x59575c(0x2a9)][_0x59575c(0x28b)]({'name':_0x1f6f98['name'],'action':'updated','id':_0x799381['id'],'diff':formatDiffWithColors(_0x204ab7)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x2a9)][_0x59575c(0x2ae)]++):(_0xc22290[_0x59575c(0x2a9)][_0x59575c(0x28b)]({'name':_0x1f6f98['name'],'action':'unchanged','id':_0x799381['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x2a9)][_0x59575c(0x211)]++);}else _0xc22290['textKnowledgeBases'][_0x59575c(0x28b)]({'name':_0x1f6f98['name'],'action':_0x59575c(0x243)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x2a9)][_0x59575c(0x243)]++;}for(const _0x31b7ae of _0x9fca1c){const _0x5e1ada=_0x55e225[_0x59575c(0x1dc)](_0x31b7ae['yaml'][_0x59575c(0x205)]),_0x49ef8d=a109_0x3b39de[_0x59575c(0x24f)](_0x31b7ae[_0x59575c(0x28c)],_0x59575c(0x2a7)),_0x3f699f=a109_0xd05ade[_0x59575c(0x1d2)](_0x49ef8d,_0x59575c(0x29d)),_0x22492c=_0x31b7ae['systemPrompt'],_0x196bda=_0x59575c(0x2af)+_0x22492c+_0x59575c(0x28e)+_0x3f699f;if(_0x5e1ada){const {yaml:_0x32e3da,systemPrompt:_0x91de5a}=await agentResponseToDef(_0x5e1ada,_0x2b4428),_0x517b7f=toAgentYamlString(_0x32e3da),_0x785828=_0x59575c(0x2af)+_0x91de5a+'\x0a\x0a#\x20agent.yml\x0a'+_0x517b7f,_0x473220=generateDiff(_0x785828,_0x196bda),_0x3aa70e=hasChanges(_0x473220);_0x3aa70e?(_0xc22290['agents'][_0x59575c(0x28b)]({'agentName':_0x31b7ae[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':'updated','agentId':_0x5e1ada['id'],'diff':formatDiffWithColors(_0x473220)}),_0xc22290['counts'][_0x59575c(0x1b4)][_0x59575c(0x2ae)]++):(_0xc22290[_0x59575c(0x1b4)][_0x59575c(0x28b)]({'agentName':_0x31b7ae[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':'unchanged','agentId':_0x5e1ada['id']}),_0xc22290[_0x59575c(0x27b)]['agents']['unchanged']++);}else _0xc22290[_0x59575c(0x1b4)][_0x59575c(0x28b)]({'agentName':_0x31b7ae[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x243)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1b4)]['created']++;}for(const _0x169cc6 of _0x1f181e){const _0x534d7e=_0x39fd7a['get'](_0x169cc6[_0x59575c(0x1e4)][_0x59575c(0x205)]),_0x5c5f57=a109_0xd05ade[_0x59575c(0x1d2)](_0x169cc6['path'],_0x59575c(0x29d));if(_0x534d7e){const _0x921a38=await apiPromptToYaml(_0x534d7e,_0x2b4428);if(!_0x921a38){_0xc22290[_0x59575c(0x25b)]['push']({'name':_0x169cc6[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x2ae),'id':_0x534d7e['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x25b)][_0x59575c(0x2ae)]++;continue;}const _0x5f520c=toPromptYamlString(_0x921a38),_0x46349d=generateDiff(_0x5f520c,_0x5c5f57),_0x22869e=hasChanges(_0x46349d);_0x22869e?(_0xc22290[_0x59575c(0x25b)][_0x59575c(0x28b)]({'name':_0x169cc6[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x2ae),'id':_0x534d7e['id'],'diff':formatDiffWithColors(_0x46349d)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x25b)]['updated']++):(_0xc22290['prompts'][_0x59575c(0x28b)]({'name':_0x169cc6[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':'unchanged','id':_0x534d7e['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x25b)][_0x59575c(0x211)]++);}else _0xc22290[_0x59575c(0x25b)][_0x59575c(0x28b)]({'name':_0x169cc6[_0x59575c(0x1e4)]['name'],'action':_0x59575c(0x243)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x25b)][_0x59575c(0x243)]++;}for(const _0x378ba6 of _0x3b602b){const _0x3e8766=_0x504042[_0x59575c(0x1dc)](_0x378ba6['yaml']['service_type']),_0x260202=a109_0xd05ade[_0x59575c(0x1d2)](_0x378ba6[_0x59575c(0x214)],_0x59575c(0x29d));if(_0x3e8766){const _0x1abefa=await apiIntegrationToYaml(_0x3e8766,_0x2b4428),_0x553a8b=toIntegrationYamlString(_0x1abefa),_0x14d2e5=generateDiff(_0x553a8b,_0x260202),_0x89af26=hasChanges(_0x14d2e5);_0x89af26?(_0xc22290['integrations']['push']({'name':_0x378ba6[_0x59575c(0x1e4)]['service_type'],'action':_0x59575c(0x2ae),'id':_0x3e8766['id'],'diff':formatDiffWithColors(_0x14d2e5)}),_0xc22290['counts'][_0x59575c(0x1fa)][_0x59575c(0x2ae)]++):(_0xc22290[_0x59575c(0x1fa)][_0x59575c(0x28b)]({'name':_0x378ba6[_0x59575c(0x1e4)][_0x59575c(0x238)],'action':_0x59575c(0x211),'id':_0x3e8766['id']}),_0xc22290[_0x59575c(0x27b)]['integrations'][_0x59575c(0x211)]++);}else _0xc22290[_0x59575c(0x1fa)][_0x59575c(0x28b)]({'name':_0x378ba6[_0x59575c(0x1e4)][_0x59575c(0x238)],'action':_0x59575c(0x243)}),_0xc22290['counts'][_0x59575c(0x1fa)][_0x59575c(0x243)]++;}for(const _0x4905f2 of _0x3b06bd){const _0x49a277=_0x93a687['get'](_0x4905f2['def'][_0x59575c(0x205)]),_0x1c5e2d=toExperimentalKnowledgeBaseYamlString(_0x4905f2[_0x59575c(0x2b2)]);let _0x3c706c=_0x1c5e2d;for(const _0x241d58 of _0x4905f2[_0x59575c(0x2b2)]['functions']){_0x3c706c+=_0x59575c(0x2b3)+_0x241d58[_0x59575c(0x205)]+_0x59575c(0x204)+_0x241d58[_0x59575c(0x1e3)]+_0x59575c(0x227)+_0x241d58[_0x59575c(0x205)]+'\x20---\x0a'+_0x241d58[_0x59575c(0x1cd)]+'\x0a';}if(_0x49a277){const _0x3a75d8=apiExperimentalKnowledgeBaseToYaml(_0x49a277),_0x13eef4=toExperimentalKnowledgeBaseYamlString(_0x3a75d8);let _0x1d7b70=_0x13eef4;for(const _0x36dffb of _0x3a75d8[_0x59575c(0x2ab)]){_0x1d7b70+=_0x59575c(0x2b3)+_0x36dffb[_0x59575c(0x205)]+_0x59575c(0x204)+_0x36dffb[_0x59575c(0x1e3)]+'\x0a---\x20schema:\x20'+_0x36dffb[_0x59575c(0x205)]+_0x59575c(0x204)+_0x36dffb[_0x59575c(0x1cd)]+'\x0a';}const _0x597385=generateDiff(_0x1d7b70,_0x3c706c),_0x1cbce0=hasChanges(_0x597385);_0x1cbce0?(_0xc22290[_0x59575c(0x209)][_0x59575c(0x28b)]({'name':_0x4905f2[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':_0x59575c(0x2ae),'id':_0x49a277['id'],'diff':formatDiffWithColors(_0x597385)}),_0xc22290[_0x59575c(0x27b)]['experimentalKnowledgeBases']['updated']++):(_0xc22290[_0x59575c(0x209)][_0x59575c(0x28b)]({'name':_0x4905f2[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':'unchanged','id':_0x49a277['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x209)][_0x59575c(0x211)]++);}else _0xc22290['experimentalKnowledgeBases'][_0x59575c(0x28b)]({'name':_0x4905f2[_0x59575c(0x2b2)]['name'],'action':_0x59575c(0x243)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x209)][_0x59575c(0x243)]++;}for(const _0x2dbff1 of _0x2c9a3c){const _0x3adbf2=_0x294df6[_0x59575c(0x1dc)](_0x2dbff1[_0x59575c(0x2b2)][_0x59575c(0x205)]),_0x553a61=toExperimentalArtifactYamlString(_0x2dbff1[_0x59575c(0x2b2)]);let _0x1d5f7f=_0x553a61+(_0x59575c(0x1b9)+_0x2dbff1[_0x59575c(0x2b2)][_0x59575c(0x1e3)]+'\x0a');for(const _0x148e3c of _0x2dbff1[_0x59575c(0x2b2)][_0x59575c(0x265)]){_0x1d5f7f+='---\x20file:\x20'+_0x148e3c[_0x59575c(0x290)]+_0x59575c(0x204)+_0x148e3c['text_content']+'\x0a';}if(_0x3adbf2){const _0x3314f7=apiExperimentalArtifactToYaml(_0x3adbf2),_0x5827b3=toExperimentalArtifactYamlString(_0x3314f7);let _0x4a1e4e=_0x5827b3+(_0x59575c(0x1b9)+_0x3314f7['code']+'\x0a');for(const _0x4cba58 of _0x3314f7[_0x59575c(0x265)]){_0x4a1e4e+=_0x59575c(0x201)+_0x4cba58['file_name']+_0x59575c(0x204)+_0x4cba58[_0x59575c(0x1ce)]+'\x0a';}const _0x3dc4b6=generateDiff(_0x4a1e4e,_0x1d5f7f),_0x50062a=hasChanges(_0x3dc4b6);_0x50062a?(_0xc22290[_0x59575c(0x1df)][_0x59575c(0x28b)]({'name':_0x2dbff1[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':_0x59575c(0x2ae),'id':_0x3adbf2['id'],'diff':formatDiffWithColors(_0x3dc4b6)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1df)][_0x59575c(0x2ae)]++):(_0xc22290[_0x59575c(0x1df)]['push']({'name':_0x2dbff1['def'][_0x59575c(0x205)],'action':'unchanged','id':_0x3adbf2['id']}),_0xc22290['counts'][_0x59575c(0x1df)][_0x59575c(0x211)]++);}else _0xc22290['experimentalArtifacts']['push']({'name':_0x2dbff1[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':_0x59575c(0x243)}),_0xc22290['counts'][_0x59575c(0x1df)][_0x59575c(0x243)]++;}if(_0xf6aa8c?.[_0x59575c(0x260)])return _0xc22290;_0xc22290['knowledgeBases']=[],_0xc22290[_0x59575c(0x2a9)]=[],_0xc22290['prompts']=[],_0xc22290[_0x59575c(0x1fa)]=[],_0xc22290[_0x59575c(0x209)]=[],_0xc22290[_0x59575c(0x1df)]=[];const _0x43479c=_0xc22290['agents'][_0x59575c(0x2ac)](_0x3976df=>_0x3976df['action']===_0x59575c(0x1ad));_0xc22290[_0x59575c(0x1b4)]=_0x43479c,_0xc22290['counts']={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x43479c[_0x59575c(0x1d8)]},'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 _0xa0ff90 of _0x135266){try{const _0x42f530=_0x2ff3d0[_0x59575c(0x1dc)](_0xa0ff90['yaml'][_0x59575c(0x205)]),_0x40cb8d=yamlKnowledgeBaseToApi(_0xa0ff90['yaml'],_0x1d8ffd);if(_0x42f530)await this['client']['updateKnowledgeBase'](_0x42f530['id'],_0x40cb8d),_0x5b5cae[_0x59575c(0x230)](_0xa0ff90[_0x59575c(0x1e4)][_0x59575c(0x205)],_0x42f530['id']),_0xc22290[_0x59575c(0x1f9)][_0x59575c(0x28b)]({'name':_0xa0ff90[_0x59575c(0x1e4)]['name'],'action':_0x59575c(0x2ae),'id':_0x42f530['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1f9)][_0x59575c(0x2ae)]++;else{const _0x11e430=await this[_0x59575c(0x2bc)][_0x59575c(0x1f4)](_0x40cb8d);_0x5b5cae[_0x59575c(0x230)](_0xa0ff90[_0x59575c(0x1e4)][_0x59575c(0x205)],_0x11e430['id']),_0xc22290['knowledgeBases'][_0x59575c(0x28b)]({'name':_0xa0ff90[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x243),'id':_0x11e430['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1f9)][_0x59575c(0x243)]++;}}catch(_0x492161){_0xc22290[_0x59575c(0x1f9)][_0x59575c(0x28b)]({'name':_0xa0ff90[_0x59575c(0x1e4)]['name'],'action':_0x59575c(0x1ad),'error':_0x492161[_0x59575c(0x246)]}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1f9)]['errors']++;}}for(const _0x4572ce of _0x5cce86){try{const _0x45f10a=_0x4529e5[_0x59575c(0x1dc)](_0x4572ce[_0x59575c(0x205)]),_0x3cad27=yamlTextKnowledgeBaseToApi({'name':_0x4572ce[_0x59575c(0x205)],'text':_0x4572ce[_0x59575c(0x278)]},_0x1d8ffd);if(_0x45f10a)await this[_0x59575c(0x2bc)]['updateTextKnowledgeBase'](_0x45f10a['id'],_0x3cad27),_0x58121d[_0x59575c(0x230)](_0x4572ce[_0x59575c(0x205)],_0x45f10a['id']),_0xc22290[_0x59575c(0x2a9)]['push']({'name':_0x4572ce[_0x59575c(0x205)],'action':_0x59575c(0x2ae),'id':_0x45f10a['id']}),_0xc22290[_0x59575c(0x27b)]['textKnowledgeBases'][_0x59575c(0x2ae)]++;else{const _0xd349b2=await this['client'][_0x59575c(0x28d)](_0x3cad27);_0x58121d[_0x59575c(0x230)](_0x4572ce[_0x59575c(0x205)],_0xd349b2['id']),_0xc22290[_0x59575c(0x2a9)][_0x59575c(0x28b)]({'name':_0x4572ce[_0x59575c(0x205)],'action':_0x59575c(0x243),'id':_0xd349b2['id']}),_0xc22290['counts'][_0x59575c(0x2a9)][_0x59575c(0x243)]++;}}catch(_0x5db8ac){_0xc22290[_0x59575c(0x2a9)][_0x59575c(0x28b)]({'name':_0x4572ce[_0x59575c(0x205)],'action':_0x59575c(0x1ad),'error':_0x5db8ac['message']}),_0xc22290['counts']['textKnowledgeBases'][_0x59575c(0x2a1)]++;}}for(const _0x57090d of _0x3b06bd){try{const _0x1b013b=_0x93a687['get'](_0x57090d[_0x59575c(0x2b2)]['name']),_0xab0add=yamlExperimentalKnowledgeBaseToApi(_0x57090d[_0x59575c(0x2b2)],_0x1d8ffd);if(_0x1b013b)await this[_0x59575c(0x2bc)][_0x59575c(0x2aa)](_0x1b013b['id'],_0xab0add),_0x50af7a[_0x59575c(0x230)](_0x57090d[_0x59575c(0x2b2)][_0x59575c(0x205)],_0x1b013b['id']),_0xc22290[_0x59575c(0x209)][_0x59575c(0x28b)]({'name':_0x57090d[_0x59575c(0x2b2)]['name'],'action':_0x59575c(0x2ae),'id':_0x1b013b['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x209)][_0x59575c(0x2ae)]++;else{const _0x5bba58=await this[_0x59575c(0x2bc)][_0x59575c(0x1db)](_0xab0add);_0x50af7a[_0x59575c(0x230)](_0x57090d[_0x59575c(0x2b2)][_0x59575c(0x205)],_0x5bba58['id']),_0xc22290['experimentalKnowledgeBases'][_0x59575c(0x28b)]({'name':_0x57090d[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':_0x59575c(0x243),'id':_0x5bba58['id']}),_0xc22290['counts'][_0x59575c(0x209)][_0x59575c(0x243)]++;}}catch(_0x545c9d){_0xc22290[_0x59575c(0x209)][_0x59575c(0x28b)]({'name':_0x57090d[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':_0x59575c(0x1ad),'error':_0x545c9d[_0x59575c(0x246)]}),_0xc22290[_0x59575c(0x27b)]['experimentalKnowledgeBases'][_0x59575c(0x2a1)]++;}}for(const _0x93d870 of _0x2c9a3c){try{const _0x5e2c70=_0x294df6[_0x59575c(0x1dc)](_0x93d870[_0x59575c(0x2b2)][_0x59575c(0x205)]),_0x40213b=yamlExperimentalArtifactToApi(_0x93d870[_0x59575c(0x2b2)],_0x1d8ffd);if(_0x5e2c70)await this[_0x59575c(0x2bc)][_0x59575c(0x2ad)](_0x5e2c70['id'],_0x40213b),_0x17d652[_0x59575c(0x230)](_0x93d870[_0x59575c(0x2b2)][_0x59575c(0x205)],_0x5e2c70['id']),_0xc22290[_0x59575c(0x1df)][_0x59575c(0x28b)]({'name':_0x93d870[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':_0x59575c(0x2ae),'id':_0x5e2c70['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1df)]['updated']++;else{const _0x233813=await this['client']['createExperimentalArtifact'](_0x40213b);_0x17d652[_0x59575c(0x230)](_0x93d870['def'][_0x59575c(0x205)],_0x233813['id']),_0xc22290[_0x59575c(0x1df)][_0x59575c(0x28b)]({'name':_0x93d870[_0x59575c(0x2b2)]['name'],'action':_0x59575c(0x243),'id':_0x233813['id']}),_0xc22290[_0x59575c(0x27b)]['experimentalArtifacts']['created']++;}}catch(_0xe4c1d4){_0xc22290[_0x59575c(0x1df)][_0x59575c(0x28b)]({'name':_0x93d870[_0x59575c(0x2b2)][_0x59575c(0x205)],'action':'error','error':_0xe4c1d4['message']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1df)][_0x59575c(0x2a1)]++;}}for(const _0xdde8aa of _0x9fca1c){_0x112a9e=[];try{const _0x1ce511=_0x55e225[_0x59575c(0x1dc)](_0xdde8aa[_0x59575c(0x1e4)][_0x59575c(0x205)]),_0xc2ad2d=await agentDefToRequest(_0xdde8aa[_0x59575c(0x1e4)],_0xdde8aa[_0x59575c(0x1bc)],_0xdde8aa['starterMessage'],_0x545770);if(_0x1ce511)await this[_0x59575c(0x2bc)][_0x59575c(0x2b4)](_0x1ce511['id'],_0xc2ad2d),_0x1772ef['set'](_0xdde8aa[_0x59575c(0x1e4)][_0x59575c(0x205)],_0x1ce511['id']),_0xc22290[_0x59575c(0x1b4)][_0x59575c(0x28b)]({'agentName':_0xdde8aa[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x2ae),'agentId':_0x1ce511['id'],'warnings':_0x112a9e[_0x59575c(0x1d8)]>0x0?_0x112a9e:undefined}),_0xc22290['counts'][_0x59575c(0x1b4)][_0x59575c(0x2ae)]++;else{const _0x1a2232=await this[_0x59575c(0x2bc)]['createAgentResponse'](_0xc2ad2d);_0x1772ef['set'](_0xdde8aa[_0x59575c(0x1e4)][_0x59575c(0x205)],_0x1a2232['id']),_0xc22290[_0x59575c(0x1b4)][_0x59575c(0x28b)]({'agentName':_0xdde8aa[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x243),'agentId':_0x1a2232['id'],'warnings':_0x112a9e[_0x59575c(0x1d8)]>0x0?_0x112a9e:undefined}),_0xc22290['counts'][_0x59575c(0x1b4)][_0x59575c(0x243)]++;}}catch(_0x52e746){_0xc22290[_0x59575c(0x1b4)]['push']({'agentName':_0xdde8aa['yaml'][_0x59575c(0x205)],'action':_0x59575c(0x1ad),'error':_0x52e746[_0x59575c(0x246)],'warnings':_0x112a9e[_0x59575c(0x1d8)]>0x0?_0x112a9e:undefined}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1b4)][_0x59575c(0x2a1)]++;}}for(const _0x402ade of _0x1f181e){try{const _0x50f5e2=_0x39fd7a[_0x59575c(0x1dc)](_0x402ade[_0x59575c(0x1e4)]['name']),_0x11a2f3=await yamlPromptToApi(_0x402ade[_0x59575c(0x1e4)],_0x1d8ffd,_0x545770);if(!_0x11a2f3){_0xc22290[_0x59575c(0x25b)][_0x59575c(0x28b)]({'name':_0x402ade[_0x59575c(0x1e4)]['name'],'action':_0x59575c(0x1ad),'error':_0x59575c(0x28f)}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x25b)][_0x59575c(0x2a1)]++;continue;}if(_0x50f5e2)await this[_0x59575c(0x2bc)][_0x59575c(0x269)](_0x50f5e2['id'],_0x11a2f3),_0x2bf267[_0x59575c(0x230)](_0x402ade[_0x59575c(0x1e4)][_0x59575c(0x205)],_0x50f5e2['id']),_0xc22290[_0x59575c(0x25b)][_0x59575c(0x28b)]({'name':_0x402ade[_0x59575c(0x1e4)]['name'],'action':_0x59575c(0x2ae),'id':_0x50f5e2['id']}),_0xc22290[_0x59575c(0x27b)]['prompts'][_0x59575c(0x2ae)]++;else{const _0x533a05=await this[_0x59575c(0x2bc)][_0x59575c(0x240)](_0x11a2f3);_0x2bf267['set'](_0x402ade[_0x59575c(0x1e4)][_0x59575c(0x205)],_0x533a05['id']),_0xc22290[_0x59575c(0x25b)][_0x59575c(0x28b)]({'name':_0x402ade[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':_0x59575c(0x243),'id':_0x533a05['id']}),_0xc22290['counts'][_0x59575c(0x25b)][_0x59575c(0x243)]++;}}catch(_0x5dd2c6){_0xc22290['prompts'][_0x59575c(0x28b)]({'name':_0x402ade[_0x59575c(0x1e4)][_0x59575c(0x205)],'action':'error','error':_0x5dd2c6['message']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x25b)][_0x59575c(0x2a1)]++;}}for(const _0x32afa7 of _0x3b602b){try{const _0x49f7fa=_0x504042[_0x59575c(0x1dc)](_0x32afa7['yaml'][_0x59575c(0x238)]),_0x1ef93f=await yamlIntegrationToApi(_0x32afa7[_0x59575c(0x1e4)],_0x1d8ffd,_0x545770);if(_0x49f7fa){await this[_0x59575c(0x2bc)][_0x59575c(0x21c)](_0x49f7fa['id']);const _0xa0f4b0=await this[_0x59575c(0x2bc)]['createIntegration'](_0x1ef93f);_0xc22290[_0x59575c(0x1fa)][_0x59575c(0x28b)]({'name':_0x32afa7[_0x59575c(0x1e4)][_0x59575c(0x238)],'action':_0x59575c(0x2ae),'id':_0xa0f4b0['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1fa)][_0x59575c(0x2ae)]++;}else{const _0x448a31=await this[_0x59575c(0x2bc)][_0x59575c(0x24b)](_0x1ef93f);_0xc22290[_0x59575c(0x1fa)][_0x59575c(0x28b)]({'name':_0x32afa7[_0x59575c(0x1e4)][_0x59575c(0x238)],'action':'created','id':_0x448a31['id']}),_0xc22290[_0x59575c(0x27b)][_0x59575c(0x1fa)][_0x59575c(0x243)]++;}}catch(_0x249c5b){_0xc22290[_0x59575c(0x1fa)][_0x59575c(0x28b)]({'name':_0x32afa7[_0x59575c(0x1e4)][_0x59575c(0x238)],'action':'error','error':_0x249c5b[_0x59575c(0x246)]}),_0xc22290[_0x59575c(0x27b)]['integrations'][_0x59575c(0x2a1)]++;}}return _0xc22290;}async[a109_0x291832(0x292)](_0x48d684,_0x167d24,_0xca4ae5,_0x4a6ab7){const _0x258cc7=a109_0x291832,{projectId:_0x3bade0,project:_0x1886af}=await this[_0x258cc7(0x239)](_0x48d684),_0x3df64d=_0x1886af[_0x258cc7(0x1c4)]['name'],_0x210792=await this[_0x258cc7(0x2bc)][_0x258cc7(0x229)](_0x3bade0),_0x588464=_0x210792[_0x258cc7(0x2a6)](_0x3a00af=>_0x3a00af['attributes']['name']===_0x167d24);if(!_0x588464)throw new SDKError(ErrorCode[_0x258cc7(0x1fb)],_0x258cc7(0x200)+_0x167d24,undefined,{'helpText':'Available\x20agents:\x20'+_0x210792['map'](_0x2c18f5=>_0x2c18f5[_0x258cc7(0x1c4)][_0x258cc7(0x205)])[_0x258cc7(0x24f)](',\x20')});let _0x481b4c;if(_0xca4ae5)_0x481b4c=_0xca4ae5;else{const _0x3877e0=a109_0x3b39de[_0x258cc7(0x24f)](process['cwd'](),'agents'),_0x6de310=getSanitizedPathWithMigration(_0x3877e0,_0x3df64d);_0x6de310['renamed']&&this[_0x258cc7(0x1b6)][_0x258cc7(0x23f)](_0x258cc7(0x267)+a109_0x3b39de[_0x258cc7(0x228)](_0x6de310[_0x258cc7(0x270)])+'\x20→\x20'+a109_0x3b39de[_0x258cc7(0x228)](_0x6de310[_0x258cc7(0x214)])),_0x481b4c=_0x6de310[_0x258cc7(0x214)];}const _0x2e12a8=getSanitizedPathWithMigration(_0x481b4c,_0x167d24);_0x2e12a8[_0x258cc7(0x1ac)]&&this[_0x258cc7(0x1b6)][_0x258cc7(0x23f)]('Renamed\x20agent\x20folder:\x20'+a109_0x3b39de[_0x258cc7(0x228)](_0x2e12a8['oldPath'])+_0x258cc7(0x22a)+a109_0x3b39de[_0x258cc7(0x228)](_0x2e12a8[_0x258cc7(0x214)]));const _0x44538b=_0x2e12a8['path'],_0x1fd7ee=new Map(),_0x4861a3=new Map(),_0x44be6e=await this[_0x258cc7(0x2bc)][_0x258cc7(0x1c3)](_0x3bade0),_0x3d164d=await this[_0x258cc7(0x2bc)]['listTextKnowledgeBases'](_0x3bade0),_0x27f450=await safeListOrEmpty(()=>this['client'][_0x258cc7(0x1b8)](_0x3bade0)),_0x36c8f8=new Map(),_0x3ee8fe=new Map();for(const _0x17d0f7 of _0x44be6e){_0x1fd7ee[_0x258cc7(0x230)](_0x17d0f7['id'],_0x17d0f7[_0x258cc7(0x1c4)][_0x258cc7(0x205)]);}for(const _0x4c42af of _0x3d164d){_0x36c8f8[_0x258cc7(0x230)](_0x4c42af['id'],_0x4c42af['attributes'][_0x258cc7(0x205)]);}for(const _0x43364b of _0x27f450){_0x3ee8fe[_0x258cc7(0x230)](_0x43364b['id'],_0x43364b[_0x258cc7(0x1c4)]['name']);}for(const _0x5cbe61 of _0x210792){_0x4861a3[_0x258cc7(0x230)](_0x5cbe61['id'],_0x5cbe61[_0x258cc7(0x1c4)][_0x258cc7(0x205)]);}const _0x3d7666={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x1fd7ee,'TextKnowledgeBase':_0x36c8f8,'Agent':_0x4861a3,'ExperimentalKnowledgeBase':_0x3ee8fe}),'resolvePromptName':async()=>undefined,'onWarning':_0x31ed60=>this['logger'][_0x258cc7(0x2bf)](_0x31ed60)},_0x5d4a3f=a109_0x3b39de[_0x258cc7(0x24f)](_0x44538b,_0x258cc7(0x255)),_0x265b7f=a109_0x3b39de['join'](_0x44538b,'agent.yml'),_0x2d07ed=a109_0x3b39de[_0x258cc7(0x24f)](_0x44538b,'starter_message.md'),_0x3a8e8e=!a109_0xd05ade['existsSync'](_0x265b7f);if(_0x4a6ab7?.[_0x258cc7(0x260)])return{'agentName':_0x167d24,'outputPath':_0x44538b,'isNew':_0x3a8e8e,'hasChanges':!![]};a109_0xd05ade['mkdirSync'](_0x481b4c,{'recursive':!![]}),a109_0xd05ade[_0x258cc7(0x22c)](_0x44538b,{'recursive':!![]});const _0x54e716=a109_0x3b39de['join'](_0x481b4c,'tdx.json');!a109_0xd05ade[_0x258cc7(0x20b)](_0x54e716)&&a109_0xd05ade[_0x258cc7(0x26c)](_0x54e716,createAgentConfigContent(_0x48d684));const {yaml:_0x2a4eb0,systemPrompt:_0x2e423b,starterMessage:_0x3633ac}=await agentResponseToDef(_0x588464,_0x3d7666);let _0x139a9b=_0x3a8e8e;if(!_0x3a8e8e){const _0x1d3789=a109_0xd05ade[_0x258cc7(0x20b)](_0x5d4a3f)?a109_0xd05ade['readFileSync'](_0x5d4a3f,_0x258cc7(0x29d)):'',_0x2c4fe6=a109_0xd05ade[_0x258cc7(0x1d2)](_0x265b7f,_0x258cc7(0x29d));_0x139a9b=_0x1d3789!==_0x2e423b||_0x2c4fe6!==toAgentYamlString(_0x2a4eb0);}a109_0xd05ade[_0x258cc7(0x26c)](_0x5d4a3f,_0x2e423b),a109_0xd05ade[_0x258cc7(0x26c)](_0x265b7f,toAgentYamlString(_0x2a4eb0));if(_0x3633ac&&_0x3633ac[_0x258cc7(0x242)]('\x0a'))a109_0xd05ade['writeFileSync'](_0x2d07ed,_0x3633ac);else a109_0xd05ade['existsSync'](_0x2d07ed)&&a109_0xd05ade[_0x258cc7(0x2a4)](_0x2d07ed);return{'agentName':_0x167d24,'outputPath':_0x44538b,'isNew':_0x3a8e8e,'hasChanges':_0x139a9b};}async[a109_0x291832(0x1c8)](_0x29e532,_0x141be4){const _0xa312c0=a109_0x291832;let _0x40a5e0;isAgentYamlPath(_0x29e532)?_0x40a5e0=getAgentDirFromYamlPath(_0x29e532):_0x40a5e0=_0x29e532;const {config:_0x1433da}=findAgentConfig(_0x40a5e0),_0x3dd9da=await this['resolveProjectId'](_0x1433da[_0xa312c0(0x23c)]),_0x8566bb=a109_0x3b39de[_0xa312c0(0x24f)](_0x40a5e0,_0xa312c0(0x2a7)),_0x19a19f=a109_0x3b39de[_0xa312c0(0x24f)](_0x40a5e0,_0xa312c0(0x255)),_0x54296f=a109_0x3b39de[_0xa312c0(0x24f)](_0x40a5e0,_0xa312c0(0x289));if(!a109_0xd05ade['existsSync'](_0x8566bb))throw new SDKError(ErrorCode[_0xa312c0(0x20a)],_0xa312c0(0x1ff)+_0x40a5e0,undefined,{'helpText':'Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.'});const _0x4b690e=parseAgentYaml(a109_0xd05ade[_0xa312c0(0x1d2)](_0x8566bb,_0xa312c0(0x29d)),_0x8566bb),_0x59c48f=a109_0xd05ade[_0xa312c0(0x20b)](_0x19a19f)?a109_0xd05ade['readFileSync'](_0x19a19f,_0xa312c0(0x29d)):'',_0x14c3ac=a109_0xd05ade[_0xa312c0(0x20b)](_0x54296f)?a109_0xd05ade[_0xa312c0(0x1d2)](_0x54296f,_0xa312c0(0x29d)):_0x4b690e[_0xa312c0(0x275)];if(_0x141be4?.[_0xa312c0(0x260)])return{'agentName':_0x4b690e[_0xa312c0(0x205)],'action':_0xa312c0(0x243),'projectId':_0x3dd9da};const _0x836a28=await this['client'][_0xa312c0(0x229)](_0x3dd9da),_0x4cef93=await fetchAllToolTargetMaps((_0x83a0ef,_0x1d0b98)=>this[_0xa312c0(0x2bc)]['listToolTargets'](_0x83a0ef,_0x1d0b98),_0x3dd9da),_0x43d448=new Map();for(const _0x50ff0a of _0x836a28){_0x43d448[_0xa312c0(0x230)](_0x50ff0a[_0xa312c0(0x1c4)][_0xa312c0(0x205)],_0x50ff0a['id']);}const _0x7fc498=[],_0x3b3921={'projectId':_0x3dd9da,'resolveToolTargetId':buildIdResolver({..._0x4cef93[_0xa312c0(0x254)],'Agent':_0x43d448}),'resolvePromptId':async()=>undefined,'onWarning':_0x1db0ab=>{const _0x37c1be=_0xa312c0;this['logger'][_0x37c1be(0x2bf)](_0x1db0ab),_0x7fc498[_0x37c1be(0x28b)](_0x1db0ab);}};try{const _0x204ad3=_0x836a28['find'](_0x5b7432=>_0x5b7432[_0xa312c0(0x1c4)]['name']===_0x4b690e[_0xa312c0(0x205)]),_0x553132=await agentDefToRequest(_0x4b690e,_0x59c48f,_0x14c3ac,_0x3b3921);if(_0x204ad3)return await this[_0xa312c0(0x2bc)][_0xa312c0(0x2b4)](_0x204ad3['id'],_0x553132),{'agentName':_0x4b690e['name'],'action':'updated','projectId':_0x3dd9da,'agentId':_0x204ad3['id'],'warnings':_0x7fc498[_0xa312c0(0x1d8)]>0x0?_0x7fc498:undefined};else{const _0x1910fd=await this['client'][_0xa312c0(0x236)](_0x553132);return{'agentName':_0x4b690e[_0xa312c0(0x205)],'action':_0xa312c0(0x243),'projectId':_0x3dd9da,'agentId':_0x1910fd['id'],'warnings':_0x7fc498[_0xa312c0(0x1d8)]>0x0?_0x7fc498:undefined};}}catch(_0x34f6c2){return{'agentName':_0x4b690e[_0xa312c0(0x205)],'action':_0xa312c0(0x1ad),'projectId':_0x3dd9da,'error':_0x34f6c2[_0xa312c0(0x246)],'warnings':_0x7fc498[_0xa312c0(0x1d8)]>0x0?_0x7fc498:undefined};}}async[a109_0x291832(0x288)](_0x2c550d,_0x230a27,_0x272f98){const _0x30bc8c=a109_0x291832,_0x67ca53=a109_0xd05ade[_0x30bc8c(0x20b)](_0x2c550d)&&a109_0xd05ade[_0x30bc8c(0x20b)](a109_0x3b39de['join'](_0x2c550d,_0x30bc8c(0x252)));let _0x1fa430;const _0x5a9d03=[],_0x38b52a=[],_0x594b7d=[],_0x80c586=[],_0x41e385=[],_0x1835df=[],_0x5e9893=[];if(_0x67ca53){const _0x287a96=loadAgentConfig(a109_0x3b39de['join'](_0x2c550d,_0x30bc8c(0x252)));_0x1fa430=_0x287a96['llm_project'];const _0x4b3668=a109_0xd05ade['readdirSync'](_0x2c550d,{'withFileTypes':!![]});for(const _0x5c994e of _0x4b3668){if(!_0x5c994e[_0x30bc8c(0x24c)]())continue;if([_0x30bc8c(0x2b0),'experimental_knowledge_bases',_0x30bc8c(0x1a7),_0x30bc8c(0x25b),_0x30bc8c(0x1fa)]['includes'](_0x5c994e[_0x30bc8c(0x205)]))continue;const _0x3b1bdf=a109_0x3b39de[_0x30bc8c(0x24f)](_0x2c550d,_0x5c994e[_0x30bc8c(0x205)]);if(isAgentDir(_0x3b1bdf)){const _0xa3bb96=a109_0x3b39de['join'](_0x3b1bdf,_0x30bc8c(0x2a7)),_0x2c7869=a109_0x3b39de[_0x30bc8c(0x24f)](_0x3b1bdf,'prompt.md'),_0x104e03=a109_0x3b39de[_0x30bc8c(0x24f)](_0x3b1bdf,_0x30bc8c(0x289)),_0x1accf8=parseAgentYaml(a109_0xd05ade[_0x30bc8c(0x1d2)](_0xa3bb96,'utf-8'),_0xa3bb96),_0x46793b=a109_0xd05ade[_0x30bc8c(0x20b)](_0x2c7869)?a109_0xd05ade['readFileSync'](_0x2c7869,_0x30bc8c(0x29d)):'',_0x43b0ac=a109_0xd05ade[_0x30bc8c(0x20b)](_0x104e03)?a109_0xd05ade['readFileSync'](_0x104e03,_0x30bc8c(0x29d)):_0x1accf8[_0x30bc8c(0x275)];_0x5a9d03[_0x30bc8c(0x28b)]({'name':_0x1accf8[_0x30bc8c(0x205)],'dir':_0x3b1bdf,'yaml':_0x1accf8,'systemPrompt':_0x46793b,'starterMessage':_0x43b0ac});}}const _0x1a5025=getKnowledgeBasesDir(_0x2c550d);if(a109_0xd05ade[_0x30bc8c(0x20b)](_0x1a5025)){const _0xfb460e=a109_0xd05ade[_0x30bc8c(0x282)](_0x1a5025);for(const _0x4324d5 of _0xfb460e){const _0xeb4ee1=a109_0x3b39de[_0x30bc8c(0x24f)](_0x1a5025,_0x4324d5);if(_0x4324d5[_0x30bc8c(0x25d)](_0x30bc8c(0x26a))){const _0x1313fd=parseKnowledgeBaseYaml(a109_0xd05ade['readFileSync'](_0xeb4ee1,_0x30bc8c(0x29d)),_0xeb4ee1);_0x38b52a['push']({'name':_0x1313fd['name'],'path':_0xeb4ee1,'yaml':_0x1313fd});}else{if(_0x4324d5[_0x30bc8c(0x25d)](_0x30bc8c(0x25c))){const _0x9834ac=a109_0xd05ade[_0x30bc8c(0x1d2)](_0xeb4ee1,'utf-8'),{name:_0x9cdf27,text:_0x32f6db}=parseTextKnowledgeBaseMd(_0x9834ac,_0x4324d5);_0x594b7d[_0x30bc8c(0x28b)]({'name':_0x9cdf27,'path':_0xeb4ee1,'text':_0x32f6db});}}}}const _0x47ff53=getPromptsDir(_0x2c550d);if(a109_0xd05ade['existsSync'](_0x47ff53)){const _0x278c67=a109_0xd05ade['readdirSync'](_0x47ff53)[_0x30bc8c(0x2ac)](_0xa420a7=>_0xa420a7['endsWith'](_0x30bc8c(0x26a)));for(const _0x15d8b9 of _0x278c67){const _0x527286=a109_0x3b39de[_0x30bc8c(0x24f)](_0x47ff53,_0x15d8b9),_0x182821=parsePromptYaml(a109_0xd05ade[_0x30bc8c(0x1d2)](_0x527286,'utf-8'),_0x527286);_0x80c586['push']({'name':_0x182821[_0x30bc8c(0x205)],'path':_0x527286,'yaml':_0x182821});}}const _0x3948c4=getIntegrationsDir(_0x2c550d);if(a109_0xd05ade[_0x30bc8c(0x20b)](_0x3948c4)){const _0x59f977=a109_0xd05ade[_0x30bc8c(0x282)](_0x3948c4)[_0x30bc8c(0x2ac)](_0x39753a=>_0x39753a[_0x30bc8c(0x25d)](_0x30bc8c(0x26a)));for(const _0x5e42a3 of _0x59f977){const _0x4458d8=a109_0x3b39de[_0x30bc8c(0x24f)](_0x3948c4,_0x5e42a3),_0x348a32=parseIntegrationYaml(a109_0xd05ade[_0x30bc8c(0x1d2)](_0x4458d8,'utf-8'),_0x4458d8);SAFE_INTEGRATION_TYPES['includes'](_0x348a32[_0x30bc8c(0x238)][_0x30bc8c(0x261)]())?_0x41e385[_0x30bc8c(0x28b)]({'name':_0x348a32[_0x30bc8c(0x205)],'path':_0x4458d8,'yaml':_0x348a32}):this[_0x30bc8c(0x1b6)][_0x30bc8c(0x2bf)](_0x30bc8c(0x21d)+_0x348a32[_0x30bc8c(0x205)]+_0x30bc8c(0x2a5)+_0x348a32[_0x30bc8c(0x238)]+_0x30bc8c(0x280)+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES[_0x30bc8c(0x24f)](',\x20')+_0x30bc8c(0x22b)));}}const _0x7319d6=getExperimentalKnowledgeBasesDir(_0x2c550d);if(a109_0xd05ade[_0x30bc8c(0x20b)](_0x7319d6)){const _0x4fb6ff=a109_0xd05ade[_0x30bc8c(0x282)](_0x7319d6,{'withFileTypes':!![]});for(const _0x2e6344 of _0x4fb6ff){if(!_0x2e6344['isDirectory']())continue;const _0x44a7e2=a109_0x3b39de[_0x30bc8c(0x24f)](_0x7319d6,_0x2e6344[_0x30bc8c(0x205)]),_0xf8d122=a109_0x3b39de[_0x30bc8c(0x24f)](_0x44a7e2,_0x2e6344['name']+'.yml');if(a109_0xd05ade[_0x30bc8c(0x20b)](_0xf8d122)){const _0x406eda=parseExperimentalKnowledgeBaseYaml(a109_0xd05ade[_0x30bc8c(0x1d2)](_0xf8d122,_0x30bc8c(0x29d)),_0xf8d122),_0x14ef4f=a109_0x3b39de['join'](_0x44a7e2,_0x30bc8c(0x2ab)),_0x4350ea=[];if(a109_0xd05ade['existsSync'](_0x14ef4f)){const _0x5948db=a109_0xd05ade[_0x30bc8c(0x282)](_0x14ef4f,{'withFileTypes':!![]});for(const _0x50de90 of _0x5948db){if(!_0x50de90[_0x30bc8c(0x24c)]())continue;const _0x2a6843=a109_0x3b39de[_0x30bc8c(0x24f)](_0x14ef4f,_0x50de90['name']),_0x2c026f=a109_0x3b39de[_0x30bc8c(0x24f)](_0x2a6843,_0x30bc8c(0x262)),_0x23fd1c=a109_0x3b39de[_0x30bc8c(0x24f)](_0x2a6843,'json_schema.json');if(a109_0xd05ade[_0x30bc8c(0x20b)](_0x2c026f)&&a109_0xd05ade[_0x30bc8c(0x20b)](_0x23fd1c)){const _0x43b79a=a109_0xd05ade[_0x30bc8c(0x1d2)](_0x2c026f,_0x30bc8c(0x29d)),_0x466ef=a109_0xd05ade[_0x30bc8c(0x1d2)](_0x23fd1c,_0x30bc8c(0x29d));_0x4350ea[_0x30bc8c(0x28b)]({'name':_0x50de90[_0x30bc8c(0x205)],'code':_0x43b79a,'json_schema':_0x466ef});}}}const _0x4af3a7={..._0x406eda,'functions':_0x4350ea};_0x1835df[_0x30bc8c(0x28b)]({'name':_0x406eda[_0x30bc8c(0x205)],'path':_0x44a7e2,'def':_0x4af3a7});}}}const _0x5b4f51=getExperimentalArtifactsDir(_0x2c550d);if(a109_0xd05ade[_0x30bc8c(0x20b)](_0x5b4f51)){const _0x1de004=a109_0xd05ade[_0x30bc8c(0x282)](_0x5b4f51,{'withFileTypes':!![]});for(const _0x2610be of _0x1de004){if(!_0x2610be[_0x30bc8c(0x24c)]())continue;const _0xe60273=a109_0x3b39de[_0x30bc8c(0x24f)](_0x5b4f51,_0x2610be[_0x30bc8c(0x205)]),_0x2f32cc=a109_0x3b39de['join'](_0xe60273,_0x2610be[_0x30bc8c(0x205)]+_0x30bc8c(0x26a));if(a109_0xd05ade[_0x30bc8c(0x20b)](_0x2f32cc)){const _0x128b41=parseExperimentalArtifactYaml(a109_0xd05ade[_0x30bc8c(0x1d2)](_0x2f32cc,_0x30bc8c(0x29d)),_0x2f32cc),_0x1459eb=a109_0x3b39de[_0x30bc8c(0x24f)](_0xe60273,_0x30bc8c(0x262)),_0x127d8a=a109_0xd05ade[_0x30bc8c(0x20b)](_0x1459eb)?a109_0xd05ade[_0x30bc8c(0x1d2)](_0x1459eb,_0x30bc8c(0x29d)):'',_0x1d50da=a109_0x3b39de[_0x30bc8c(0x24f)](_0xe60273,'files'),_0x3956b0=[];if(a109_0xd05ade['existsSync'](_0x1d50da)){const _0x965c39=a109_0xd05ade[_0x30bc8c(0x282)](_0x1d50da);for(const _0x141034 of _0x965c39){const _0xc1baf6=a109_0x3b39de[_0x30bc8c(0x24f)](_0x1d50da,_0x141034);if(a109_0xd05ade[_0x30bc8c(0x206)](_0xc1baf6)[_0x30bc8c(0x27a)]()){const _0x26bbf7=a109_0xd05ade[_0x30bc8c(0x1d2)](_0xc1baf6,_0x30bc8c(0x29d));_0x3956b0[_0x30bc8c(0x28b)]({'file_name':_0x141034,'text_content':_0x26bbf7});}}}const _0x2786f4={..._0x128b41,'code':_0x127d8a,'files':_0x3956b0};_0x5e9893['push']({'name':_0x128b41[_0x30bc8c(0x205)],'path':_0xe60273,'def':_0x2786f4});}}}}else{const _0x39e72c=await this['resolveProjectId'](_0x2c550d),_0x17a50b=await this[_0x30bc8c(0x2bc)][_0x30bc8c(0x1ab)](_0x39e72c);_0x1fa430=_0x17a50b[_0x30bc8c(0x1c4)][_0x30bc8c(0x205)];const _0x43ecd4=await this['client'][_0x30bc8c(0x229)](_0x39e72c),_0x333165=await this[_0x30bc8c(0x2bc)]['listKnowledgeBases'](_0x39e72c),_0x14176c=await this['client'][_0x30bc8c(0x1d5)](_0x39e72c),_0x25639d=await this['client'][_0x30bc8c(0x291)](_0x39e72c),_0x1b76f0=await this[_0x30bc8c(0x2bc)][_0x30bc8c(0x1f8)](_0x39e72c),_0x1aab75=await safeListOrEmpty(()=>this[_0x30bc8c(0x2bc)][_0x30bc8c(0x1b8)](_0x39e72c)),_0x4db1ef=await safeListOrEmpty(()=>this['client'][_0x30bc8c(0x263)](_0x39e72c)),_0x49f140=new Map(),_0x12abb7=new Map(),_0x36e901=new Map(),_0x3c9367=new Map(),_0x54205b=new Map(),_0x43a19b=new Map();for(const _0xfefe05 of _0x333165){_0x49f140[_0x30bc8c(0x230)](_0xfefe05['id'],_0xfefe05[_0x30bc8c(0x1c4)][_0x30bc8c(0x205)]);}for(const _0xea6ceb of _0x14176c){_0x12abb7[_0x30bc8c(0x230)](_0xea6ceb['id'],_0xea6ceb[_0x30bc8c(0x1c4)][_0x30bc8c(0x205)]);}for(const _0x19b39d of _0x43ecd4){_0x36e901[_0x30bc8c(0x230)](_0x19b39d['id'],_0x19b39d[_0x30bc8c(0x1c4)][_0x30bc8c(0x205)]);}for(const _0x4de7b7 of _0x25639d){_0x3c9367[_0x30bc8c(0x230)](_0x4de7b7['id'],_0x4de7b7['attributes'][_0x30bc8c(0x205)]);}for(const _0x17cf58 of _0x1aab75){_0x54205b[_0x30bc8c(0x230)](_0x17cf58['id'],_0x17cf58[_0x30bc8c(0x1c4)][_0x30bc8c(0x205)]);}for(const _0x4a70bc of _0x4db1ef){_0x43a19b[_0x30bc8c(0x230)](_0x4a70bc['id'],_0x4a70bc[_0x30bc8c(0x1c4)][_0x30bc8c(0x205)]);}const _0x5793e4={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x49f140,'TextKnowledgeBase':_0x12abb7,'Agent':_0x36e901,'ExperimentalKnowledgeBase':_0x54205b}),'resolvePromptName':async _0x45ff2f=>_0x3c9367[_0x30bc8c(0x1dc)](_0x45ff2f),'onWarning':_0x3f0096=>this[_0x30bc8c(0x1b6)][_0x30bc8c(0x2bf)](_0x3f0096)};for(const _0x47c4a1 of _0x43ecd4){const _0x4d6580=await agentResponseToDef(_0x47c4a1,_0x5793e4),{yaml:_0x37bf85,systemPrompt:_0x1291be,starterMessage:_0x47582d}=_0x4d6580;_0x5a9d03[_0x30bc8c(0x28b)]({'name':_0x37bf85[_0x30bc8c(0x205)],'dir':'','yaml':_0x37bf85,'systemPrompt':_0x1291be,'starterMessage':_0x47582d});}for(const _0x322d8a of _0x333165){const _0x2a9064=apiKnowledgeBaseToYaml(_0x322d8a);_0x38b52a['push']({'name':_0x2a9064[_0x30bc8c(0x205)],'path':'','yaml':_0x2a9064});}for(const _0x5aa360 of _0x14176c){_0x594b7d['push']({'name':_0x5aa360[_0x30bc8c(0x1c4)][_0x30bc8c(0x205)],'path':'','text':_0x5aa360['attributes'][_0x30bc8c(0x278)]});}for(const _0x2e0ff1 of _0x25639d){const _0x5c0a8e=await apiPromptToYaml(_0x2e0ff1,_0x5793e4);_0x5c0a8e&&_0x80c586[_0x30bc8c(0x28b)]({'name':_0x5c0a8e[_0x30bc8c(0x205)],'path':'','yaml':_0x5c0a8e});}for(const _0x3c64eb of _0x1b76f0){if(!_0x3c64eb[_0x30bc8c(0x1c4)][_0x30bc8c(0x24a)]&&SAFE_INTEGRATION_TYPES[_0x30bc8c(0x242)](_0x3c64eb['attributes'][_0x30bc8c(0x1de)][_0x30bc8c(0x261)]())){const _0x5b1e2c=await apiIntegrationToYaml(_0x3c64eb,_0x5793e4);_0x41e385[_0x30bc8c(0x28b)]({'name':_0x3c64eb[_0x30bc8c(0x1c4)][_0x30bc8c(0x1de)][_0x30bc8c(0x261)](),'path':'','yaml':_0x5b1e2c});}}for(const _0x3d5a9 of _0x1aab75){const _0x310d8d=apiExperimentalKnowledgeBaseToYaml(_0x3d5a9);_0x1835df[_0x30bc8c(0x28b)]({'name':_0x310d8d[_0x30bc8c(0x205)],'path':'','def':_0x310d8d});}for(const _0xcc8e4e of _0x4db1ef){const _0x24856f=apiExperimentalArtifactToYaml(_0xcc8e4e);_0x5e9893[_0x30bc8c(0x28b)]({'name':_0x24856f[_0x30bc8c(0x205)],'path':'','def':_0x24856f});}}const _0x559247={'sourceProjectName':_0x1fa430,'newProjectName':_0x230a27,'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}}},_0x486cef=await this[_0x30bc8c(0x2bc)][_0x30bc8c(0x272)](),_0x469d64=_0x486cef['find'](_0x4a6a9d=>_0x4a6a9d[_0x30bc8c(0x1c4)]['name']===_0x230a27);if(_0x469d64)throw new SDKError(ErrorCode[_0x30bc8c(0x1f6)],_0x30bc8c(0x253)+_0x230a27+_0x30bc8c(0x217),undefined,{'helpText':'Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.'});if(_0x272f98?.['dryRun'])return _0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1b4)][_0x30bc8c(0x243)]=_0x5a9d03[_0x30bc8c(0x1d8)],_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1f9)]['created']=_0x38b52a[_0x30bc8c(0x1d8)],_0x559247['counts'][_0x30bc8c(0x2a9)][_0x30bc8c(0x243)]=_0x594b7d['length'],_0x559247['counts'][_0x30bc8c(0x209)]['created']=_0x1835df[_0x30bc8c(0x1d8)],_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1df)][_0x30bc8c(0x243)]=_0x5e9893[_0x30bc8c(0x1d8)],_0x559247['counts'][_0x30bc8c(0x25b)]['created']=_0x80c586[_0x30bc8c(0x1d8)],_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1fa)][_0x30bc8c(0x243)]=_0x41e385[_0x30bc8c(0x1d8)],_0x559247;const _0xc8b53a=await this['client'][_0x30bc8c(0x1f7)]({'name':_0x230a27}),_0x527054=_0xc8b53a['id'];_0x559247[_0x30bc8c(0x224)]=_0x527054;const _0x59cc13=new Map(),_0x534d9f=new Map(),_0x374873=new Map(),_0x41b715=new Map(),_0xb765b0=new Map(),_0x3ac477=new Map(),_0x38cabc=new Map(),_0xce0be8=new Map(),_0x362eb5=new Set(),_0x57d39b=new Set();for(const _0x387d91 of _0x5a9d03){for(const _0x3a2066 of _0x387d91[_0x30bc8c(0x1e4)][_0x30bc8c(0x26f)]||[]){if(_0x3a2066[_0x30bc8c(0x221)]===_0x30bc8c(0x276)&&_0x3a2066[_0x30bc8c(0x2be)]){const _0x1a951a=parseRef(_0x3a2066[_0x30bc8c(0x2be)]);if(_0x1a951a)_0x362eb5[_0x30bc8c(0x1b5)](_0x1a951a[_0x30bc8c(0x205)]);}else{if(_0x3a2066['type']==='web_search'&&_0x3a2066[_0x30bc8c(0x2be)]){const _0xd3f5d8=parseRef(_0x3a2066['target']);if(_0xd3f5d8)_0x57d39b[_0x30bc8c(0x1b5)](_0xd3f5d8['name']);}}}}for(const _0x12e485 of _0x362eb5){try{const _0x2cf535=await this[_0x30bc8c(0x2bc)][_0x30bc8c(0x1e5)]({'projectId':_0x527054,'name':_0x12e485});_0xb765b0[_0x30bc8c(0x230)](_0x12e485,_0x2cf535['id']),_0x559247[_0x30bc8c(0x283)][_0x30bc8c(0x28b)]({'name':_0x12e485,'action':'created','id':_0x2cf535['id']}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x283)]['created']++;}catch(_0x4aef8c){_0x559247[_0x30bc8c(0x283)]['push']({'name':_0x12e485,'action':_0x30bc8c(0x1ad),'error':_0x4aef8c[_0x30bc8c(0x246)]}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x283)][_0x30bc8c(0x2a1)]++;}}for(const _0x4d23e1 of _0x57d39b){try{const _0x1d39ee=await this[_0x30bc8c(0x2bc)]['createWebSearchTool']({'projectId':_0x527054,'name':_0x4d23e1});_0x3ac477['set'](_0x4d23e1,_0x1d39ee['id']),_0x559247[_0x30bc8c(0x274)]['push']({'name':_0x4d23e1,'action':_0x30bc8c(0x243),'id':_0x1d39ee['id']}),_0x559247['counts']['webSearchTools'][_0x30bc8c(0x243)]++;}catch(_0xad69cd){_0x559247[_0x30bc8c(0x274)]['push']({'name':_0x4d23e1,'action':_0x30bc8c(0x1ad),'error':_0xad69cd['message']}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x274)][_0x30bc8c(0x2a1)]++;}}const _0x5411b5=await fetchAllToolTargetMaps((_0xdd39e3,_0x3bd9ea)=>this[_0x30bc8c(0x2bc)]['listToolTargets'](_0xdd39e3,_0x3bd9ea),_0x527054);let _0x580c0c=[];const _0x35104e={'projectId':_0x527054,'resolveToolTargetId':buildIdResolver({..._0x5411b5[_0x30bc8c(0x254)],'KnowledgeBase':_0x59cc13,'TextKnowledgeBase':_0x534d9f,'ExperimentalKnowledgeBase':_0x38cabc,'Agent':_0x374873,'WebSearchTool':_0x3ac477,'ImageGenerator':_0xb765b0}),'resolvePromptId':async _0xd518c2=>_0x41b715[_0x30bc8c(0x1dc)](_0xd518c2),'onWarning':_0xd6fb09=>{const _0x3848ef=_0x30bc8c;this[_0x3848ef(0x1b6)][_0x3848ef(0x2bf)](_0xd6fb09),_0x580c0c[_0x3848ef(0x28b)](_0xd6fb09);}};for(const _0x85b26f of _0x38b52a){try{const _0x3fe1d5=yamlKnowledgeBaseToApi(_0x85b26f[_0x30bc8c(0x1e4)],_0x527054),_0x905bdf=await this[_0x30bc8c(0x2bc)][_0x30bc8c(0x1f4)](_0x3fe1d5);_0x59cc13[_0x30bc8c(0x230)](_0x85b26f[_0x30bc8c(0x1e4)][_0x30bc8c(0x205)],_0x905bdf['id']),_0x559247[_0x30bc8c(0x1f9)]['push']({'name':_0x85b26f[_0x30bc8c(0x1e4)][_0x30bc8c(0x205)],'action':'created','id':_0x905bdf['id']}),_0x559247['counts'][_0x30bc8c(0x1f9)][_0x30bc8c(0x243)]++;}catch(_0x1cf4b1){_0x559247['knowledgeBases'][_0x30bc8c(0x28b)]({'name':_0x85b26f['yaml']['name'],'action':_0x30bc8c(0x1ad),'error':_0x1cf4b1[_0x30bc8c(0x246)]}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1f9)][_0x30bc8c(0x2a1)]++;}}for(const _0x30e0d0 of _0x594b7d){try{const _0x5cfd12=yamlTextKnowledgeBaseToApi({'name':_0x30e0d0[_0x30bc8c(0x205)],'text':_0x30e0d0[_0x30bc8c(0x278)]},_0x527054),_0x2209cd=await this['client'][_0x30bc8c(0x28d)](_0x5cfd12);_0x534d9f[_0x30bc8c(0x230)](_0x30e0d0[_0x30bc8c(0x205)],_0x2209cd['id']),_0x559247['textKnowledgeBases']['push']({'name':_0x30e0d0[_0x30bc8c(0x205)],'action':_0x30bc8c(0x243),'id':_0x2209cd['id']}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x2a9)]['created']++;}catch(_0x371a7a){_0x559247[_0x30bc8c(0x2a9)][_0x30bc8c(0x28b)]({'name':_0x30e0d0['name'],'action':_0x30bc8c(0x1ad),'error':_0x371a7a[_0x30bc8c(0x246)]}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x2a9)][_0x30bc8c(0x2a1)]++;}}for(const _0x33603f of _0x5e9893){try{const _0x1ef85b=yamlExperimentalArtifactToApi(_0x33603f[_0x30bc8c(0x2b2)],_0x527054),_0x21de16=await this[_0x30bc8c(0x2bc)]['createExperimentalArtifact'](_0x1ef85b);_0xce0be8[_0x30bc8c(0x230)](_0x33603f[_0x30bc8c(0x2b2)]['name'],_0x21de16['id']),_0x559247[_0x30bc8c(0x1df)][_0x30bc8c(0x28b)]({'name':_0x33603f[_0x30bc8c(0x2b2)][_0x30bc8c(0x205)],'action':_0x30bc8c(0x243),'id':_0x21de16['id']}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1df)][_0x30bc8c(0x243)]++;}catch(_0x3eff6a){_0x559247['experimentalArtifacts'][_0x30bc8c(0x28b)]({'name':_0x33603f[_0x30bc8c(0x2b2)][_0x30bc8c(0x205)],'action':'error','error':_0x3eff6a[_0x30bc8c(0x246)]}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1df)][_0x30bc8c(0x2a1)]++;}}for(const _0x59b240 of _0x1835df){try{const _0x405a30=yamlExperimentalKnowledgeBaseToApi(_0x59b240['def'],_0x527054),_0x4ab595=await this[_0x30bc8c(0x2bc)][_0x30bc8c(0x1db)](_0x405a30);_0x38cabc[_0x30bc8c(0x230)](_0x59b240[_0x30bc8c(0x2b2)][_0x30bc8c(0x205)],_0x4ab595['id']),_0x559247[_0x30bc8c(0x209)][_0x30bc8c(0x28b)]({'name':_0x59b240[_0x30bc8c(0x2b2)]['name'],'action':_0x30bc8c(0x243),'id':_0x4ab595['id']}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x209)]['created']++;}catch(_0x49efb9){_0x559247['experimentalKnowledgeBases'][_0x30bc8c(0x28b)]({'name':_0x59b240[_0x30bc8c(0x2b2)][_0x30bc8c(0x205)],'action':_0x30bc8c(0x1ad),'error':_0x49efb9['message']}),_0x559247['counts'][_0x30bc8c(0x209)][_0x30bc8c(0x2a1)]++;}}const _0xaaa8d5=[..._0x5a9d03][_0x30bc8c(0x210)]((_0x4842a5,_0x34425d)=>{const _0xfe556c=_0x30bc8c,_0x5a9a7e=_0x4842a5[_0xfe556c(0x1e4)][_0xfe556c(0x26f)]?.[_0xfe556c(0x1d7)](_0x207f93=>_0x207f93[_0xfe556c(0x221)]===_0xfe556c(0x1e2))??![],_0x3609de=_0x34425d[_0xfe556c(0x1e4)]['tools']?.[_0xfe556c(0x1d7)](_0x5ce24e=>_0x5ce24e[_0xfe556c(0x221)]===_0xfe556c(0x1e2))??![];if(_0x5a9a7e&&!_0x3609de)return 0x1;if(!_0x5a9a7e&&_0x3609de)return-0x1;return 0x0;});for(const _0x34a6c8 of _0xaaa8d5){_0x580c0c=[];try{const _0x2b4aaf=_0x34a6c8['yaml']['tools']?.['filter'](_0x4c8ce9=>{const _0x3abc5d=_0x30bc8c;if(_0x4c8ce9[_0x3abc5d(0x221)]==='agent'&&_0x4c8ce9[_0x3abc5d(0x2be)]){const _0x5a75f1=parseRef(_0x4c8ce9[_0x3abc5d(0x2be)]);return _0x5a75f1?.['name']===_0x34a6c8[_0x3abc5d(0x1e4)][_0x3abc5d(0x205)];}return![];})??[];if(_0x2b4aaf[_0x30bc8c(0x1d8)]>0x0){const _0x370d64='Agent\x20\x27'+_0x34a6c8[_0x30bc8c(0x1e4)][_0x30bc8c(0x205)]+_0x30bc8c(0x286)+_0x30bc8c(0x1ee);this[_0x30bc8c(0x1b6)][_0x30bc8c(0x2bf)](_0x370d64),_0x580c0c[_0x30bc8c(0x28b)](_0x370d64);}const _0x5ef4c6=await agentDefToRequest(_0x34a6c8[_0x30bc8c(0x1e4)],_0x34a6c8[_0x30bc8c(0x1bc)],_0x34a6c8['starterMessage'],_0x35104e),_0x114833=await this[_0x30bc8c(0x2bc)]['createAgentResponse'](_0x5ef4c6);_0x374873[_0x30bc8c(0x230)](_0x34a6c8[_0x30bc8c(0x1e4)][_0x30bc8c(0x205)],_0x114833['id']),_0x559247['agents'][_0x30bc8c(0x28b)]({'agentName':_0x34a6c8[_0x30bc8c(0x1e4)][_0x30bc8c(0x205)],'action':_0x30bc8c(0x243),'agentId':_0x114833['id'],'warnings':_0x580c0c['length']>0x0?_0x580c0c:undefined}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1b4)][_0x30bc8c(0x243)]++;}catch(_0x40674f){_0x559247['agents']['push']({'agentName':_0x34a6c8[_0x30bc8c(0x1e4)]['name'],'action':_0x30bc8c(0x1ad),'error':_0x40674f[_0x30bc8c(0x246)],'warnings':_0x580c0c[_0x30bc8c(0x1d8)]>0x0?_0x580c0c:undefined}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1b4)][_0x30bc8c(0x2a1)]++;}}for(const _0x57f73c of _0x80c586){try{const _0x467125=await yamlPromptToApi(_0x57f73c[_0x30bc8c(0x1e4)],_0x527054,_0x35104e);if(!_0x467125){_0x559247[_0x30bc8c(0x25b)][_0x30bc8c(0x28b)]({'name':_0x57f73c['yaml'][_0x30bc8c(0x205)],'action':'error','error':_0x30bc8c(0x28f)}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x25b)]['errors']++;continue;}const _0x5b7183=await this[_0x30bc8c(0x2bc)][_0x30bc8c(0x240)](_0x467125);_0x41b715[_0x30bc8c(0x230)](_0x57f73c[_0x30bc8c(0x1e4)][_0x30bc8c(0x205)],_0x5b7183['id']),_0x559247[_0x30bc8c(0x25b)]['push']({'name':_0x57f73c['yaml'][_0x30bc8c(0x205)],'action':'created','id':_0x5b7183['id']}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x25b)][_0x30bc8c(0x243)]++;}catch(_0x238442){_0x559247[_0x30bc8c(0x25b)][_0x30bc8c(0x28b)]({'name':_0x57f73c['yaml']['name'],'action':_0x30bc8c(0x1ad),'error':_0x238442[_0x30bc8c(0x246)]}),_0x559247['counts'][_0x30bc8c(0x25b)][_0x30bc8c(0x2a1)]++;}}for(const _0x54945f of _0x41e385){try{const _0x8f0bb1=await yamlIntegrationToApi(_0x54945f[_0x30bc8c(0x1e4)],_0x527054,_0x35104e),_0x3ef594=await this['client'][_0x30bc8c(0x24b)](_0x8f0bb1);_0x559247[_0x30bc8c(0x1fa)][_0x30bc8c(0x28b)]({'name':_0x54945f[_0x30bc8c(0x1e4)][_0x30bc8c(0x238)],'action':'created','id':_0x3ef594['id']}),_0x559247[_0x30bc8c(0x27b)][_0x30bc8c(0x1fa)][_0x30bc8c(0x243)]++;}catch(_0x554096){_0x559247[_0x30bc8c(0x1fa)][_0x30bc8c(0x28b)]({'name':_0x54945f['yaml'][_0x30bc8c(0x238)],'action':'error','error':_0x554096[_0x30bc8c(0x246)]}),_0x559247['counts'][_0x30bc8c(0x1fa)][_0x30bc8c(0x2a1)]++;}}return _0x559247;}}
|
|
1
|
+
const a109_0x4fde2b=a109_0x1c51;(function(_0xf01dd6,_0x4ccad1){const _0x385df6=a109_0x1c51,_0x2a1c52=_0xf01dd6();while(!![]){try{const _0xa8bfd1=-parseInt(_0x385df6(0x228))/0x1+parseInt(_0x385df6(0x1bf))/0x2*(-parseInt(_0x385df6(0x158))/0x3)+-parseInt(_0x385df6(0x179))/0x4+parseInt(_0x385df6(0x19b))/0x5*(parseInt(_0x385df6(0x218))/0x6)+parseInt(_0x385df6(0x1dc))/0x7*(-parseInt(_0x385df6(0x1dd))/0x8)+-parseInt(_0x385df6(0x162))/0x9+parseInt(_0x385df6(0x1a0))/0xa;if(_0xa8bfd1===_0x4ccad1)break;else _0x2a1c52['push'](_0x2a1c52['shift']());}catch(_0x5e3b1c){_0x2a1c52['push'](_0x2a1c52['shift']());}}}(a109_0x5267,0x1b3ba));import{LLMApiClient}from'../client/llm-api-client.js';import*as a109_0x5bd25e from'node:fs';import*as a109_0x4e6e83 from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';function a109_0x5267(){const _0x11743e=['context','readdirSync','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','basename','chatInfo','keys','ExperimentalKnowledgeBase','prompt.md','isDir','INVALID_ARGUMENT','push','\x20---\x0a','listExperimentalArtifacts','error','Agent\x20reference\x20not\x20found','experimentalArtifacts','systemPrompt','updateExperimentalArtifact','message','Renamed\x20integration\x20file:\x20','getDefaultProjectName','Removed\x20deleted\x20directory:\x20','startChat','listProjects','code.js','chat_parent_segment','total','4263TffKzV','248Doqvzi','createAgent','INTERNAL','---\x20schema:\x20','starter_message.md','name','imageGenerators','.llm','mkdirSync','Backup\x20folder\x20not\x20found:\x20','tdx.json','action','starterMessage','createExperimentalKnowledgeBase','logger','createWebSearchTool','text','createAgentResponse','utf-8','length','web_search',')\x20can\x20be\x20pushed.\x20','\x20→\x20','AGENT_NOT_FOUND','agentId','site','llm_project','Agent\x20\x27','image_gen','\x27\x20(','promptId','Available\x20agents:\x20','_reasoning_','size','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','starter_message','resolveProjectName','listAgents','existsSync','cwd','path','updated','(dry-run)','agent','tdx_','UNAUTHENTICATED','dry-run-','experimental_artifacts','service_type','experimental_knowledge_bases','tools','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','dirname','knowledgebases.json','map','Multiple\x20projects\x20found\x20with\x20name\x20\x27','created','prompts','60234vIChPi','Renamed\x20prompt\x20file:\x20','prompts.json','deleteProject','Multiple\x20agents\x20found\x20with\x20name\x20\x27','version','models','set','new','knowledge_bases','unchanged','yaml','Renamed\x20folder:\x20','Invalid\x20agent\x20reference\x20format:\x20','getAgent','duplicate','6378KUkBcU','experimentalKnowledgeBases','event','chat','integrations.json','textKnowledgeBases','listPrompts','toLowerCase','resolveAgentId','agent.yml\x20not\x20found\x20in\x20','#\x20prompt.md\x0a','Project\x20not\x20found:\x20','medium','rmSync','outputs','Removed\x20deleted\x20file:\x20','listExperimentalKnowledgeBases','Project\x20\x22','createExperimentalArtifact','content','Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.','pushAgent','listToolTargets','nameToId','Only\x20safe\x20types\x20(','chat_agent_console','Renamed\x20experimental\x20artifact\x20directory:\x20','statSync','updateAgentResponse','integrations','temperature','webhookCorsOrigins','parse','files','code','\x0a---\x20code\x20---\x0a','newProjectId','.md','---\x20file:\x20','some','profile','getOrCreateDefaultAgent','.yml','idToName','1.0','renamed','variables','endsWith','listKnowledgeBases','Agent\x20not\x20found:\x20','actions','\x0a\x0a#\x20agent.yml\x0a','chatWelcomeMessage','json_schema','find','pushProject','file_name','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','\x0a---\x20function:\x20','getProject','unlinkSync','No\x20tdx.json\x20found\x20in\x20','target','agents.json','displayName','availableModelNames','counts','listChats','resolveProjectId','sdk.llm','errors','low','2505uiAYyU','metadata','def','isDirectory','setDefaultAgent','knowledgeBases','updateTextKnowledgeBase','createProject','getCurrentProject','get','1359882hcNcPO','functions','split','\x27.\x20This\x20should\x20not\x20happen.','oldPath','listWebSearchTools','):\x20','LLM_PROJECT_NOT_FOUND','createPrompt','Renamed\x20text\x20KB\x20file:\x20','serviceType','Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.','add','already\x20exists','minimal','Renamed\x20experimental\x20KB\x20directory:\x20','Renamed\x20KB\x20file:\x20','updateKnowledgeBase','readFileSync','tables','cloneProject','getUserSettings','text_content','135160XKNKeZ','chat_generic','chatIgnoreManagedActions','sort','getChatLog','TextKnowledgeBase','clearDefaultAgent','KnowledgeBase','client','writeFileSync','currentProjectId','createTextKnowledgeBase','listIntegrations','json_schema.json','projectId','getOrCreateDefaultProject','includes','\x20in\x20project\x20','filter','agent.yml','signal','\x22\x20already\x20exists','maxToolIterations','getBackupMetadata','chatId','warn','dryRun','dir','\x0a---\x20schema:\x20','loadJsonFile','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','localeCompare','updateAgent','Unable\x20to\x20create\x20project\x20after\x20','95crfYZy','info','availableModels','pullAgent','agentsFull','1418050ffgGno','agents','attributes','listTextKnowledgeBases','stringify','status','webSearchTools','listAgentsFull','history','template','createIntegration','deleteAgent','continueChat','NOT_FOUND','has','getDefaultAgent','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','isManaged','slackMessageMode','getChatHistory','Skipping\x20integration\x20\x27','ALREADY_EXISTS',')\x20can\x20be\x20cloned.','createImageGenerator','exportedFrom','join','isFile','type','Output\x20directory\x20already\x20exists:\x20','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','tdDatabaseName','26HFLTTz'];a109_0x5267=function(){return _0x11743e;};return a109_0x5267();}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';import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';function a109_0x1c51(_0x2161b5,_0xd5ff45){_0x2161b5=_0x2161b5-0x13d;const _0x5267d8=a109_0x5267();let _0x1c5145=_0x5267d8[_0x2161b5];return _0x1c5145;}export const SAFE_INTEGRATION_TYPES=[a109_0x4fde2b(0x17a),a109_0x4fde2b(0x241),a109_0x4fde2b(0x1da)];async function safeListOrEmpty(_0x1e3f9a){const _0x2d4ea4=a109_0x4fde2b;try{return await _0x1e3f9a();}catch(_0x3fcb19){if(_0x3fcb19 instanceof HTTPClientError&&_0x3fcb19[_0x2d4ea4(0x1a5)]===0x194)return[];throw _0x3fcb19;}}export class LLMSDK{[a109_0x4fde2b(0x183)];[a109_0x4fde2b(0x181)];[a109_0x4fde2b(0x1c0)];['logger']=Logger['of'](a109_0x4fde2b(0x155));constructor(_0x4ed2d9){this['client']=new LLMApiClient(_0x4ed2d9),this['context']=_0x4ed2d9;}[a109_0x4fde2b(0x1d5)](){const _0x2f8c81=getSanitizedUsername();return'tdx_default_'+_0x2f8c81;}async['setCurrentProject'](_0x3947b7){const _0x540ec8=a109_0x4fde2b,{projectId:_0x4d6a3c}=await this[_0x540ec8(0x201)](_0x3947b7);this[_0x540ec8(0x183)]=_0x4d6a3c;}[a109_0x4fde2b(0x160)](){const _0x18a965=a109_0x4fde2b;return this[_0x18a965(0x183)];}async[a109_0x4fde2b(0x15c)](_0x429189){const _0x3228d5=a109_0x4fde2b,_0x5337d5=this[_0x3228d5(0x1c0)][_0x3228d5(0x250)];let _0xbb59b0,_0x52ebe3;if(_0x429189[_0x3228d5(0x189)]('/')){const _0x2bba25=_0x429189[_0x3228d5(0x164)]('/');if(_0x2bba25['length']!==0x2)throw new SDKError(ErrorCode[_0x3228d5(0x1ca)],_0x3228d5(0x225)+_0x429189,undefined,{'helpText':'Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22'});const [_0x2c6496,_0x96f4d8]=_0x2bba25;_0xbb59b0=await this['resolveProjectId'](_0x2c6496),_0x52ebe3=_0x96f4d8;}else _0xbb59b0=this[_0x3228d5(0x183)]||(await this[_0x3228d5(0x188)]())['id'],_0x52ebe3=_0x429189;const _0x443113=await this['resolveAgentId'](_0x52ebe3,_0xbb59b0),_0x3030d3=await this[_0x3228d5(0x181)][_0x3228d5(0x226)](_0x443113);writeCachedLLMAgent(_0x3030d3[_0x3228d5(0x1a2)]['name'],_0x443113,_0xbb59b0,_0x5337d5);}[a109_0x4fde2b(0x1af)](){const _0xff4e24=a109_0x4fde2b,_0x20fa98=this[_0xff4e24(0x1c0)]['profile'];return readCachedLLMAgent(_0x20fa98)||undefined;}[a109_0x4fde2b(0x17f)](){const _0x40e237=a109_0x4fde2b,_0x3b838a=this[_0x40e237(0x1c0)][_0x40e237(0x250)];clearCachedLLMAgent(_0x3b838a);}async[a109_0x4fde2b(0x21e)](){const _0x3aebbf=a109_0x4fde2b,_0xcea581=await this[_0x3aebbf(0x181)][_0x3aebbf(0x177)](),_0x4fbe97=[];for(const _0x42613f of _0xcea581[_0x3aebbf(0x151)]){const _0xeeba48=_0xcea581[_0x3aebbf(0x19d)][_0x42613f];_0xeeba48&&_0x4fbe97[_0x3aebbf(0x1cb)]({'name':_0x42613f,'displayName':_0xeeba48[_0x3aebbf(0x150)]});}return _0x4fbe97;}async[a109_0x4fde2b(0x15f)](_0x170da8){const _0xd15050=a109_0x4fde2b;return await this['client'][_0xd15050(0x15f)](_0x170da8);}async[a109_0x4fde2b(0x21b)](_0x3831d3){const _0xfebfcf=a109_0x4fde2b,{projectId:_0x25f843}=await this[_0xfebfcf(0x201)](_0x3831d3);await this[_0xfebfcf(0x181)]['deleteProject'](_0x25f843);}async['projects'](_0xff0e26=0x32){const _0x50f47b=a109_0x4fde2b;return await this[_0x50f47b(0x181)]['listProjects'](_0xff0e26);}async[a109_0x4fde2b(0x188)](_0x2bf3d3){const _0x1c8e13=a109_0x4fde2b,_0xbbf1f7=_0x2bf3d3||this[_0x1c8e13(0x1d5)](),_0x39809a=this[_0x1c8e13(0x1c0)][_0x1c8e13(0x250)];if(!_0x2bf3d3){const _0x25768a=readCachedLLMProject(_0x39809a);if(_0x25768a&&_0x25768a[_0x1c8e13(0x1e2)]===_0xbbf1f7)try{const _0x471981=await this[_0x1c8e13(0x181)][_0x1c8e13(0x14b)](_0x25768a['id']);if(_0x471981[_0x1c8e13(0x1a2)][_0x1c8e13(0x1e2)]===_0xbbf1f7)return _0x471981;}catch{}}const _0xa1fd50=await this[_0x1c8e13(0x181)][_0x1c8e13(0x1d8)](),_0x38d57e=_0xa1fd50[_0x1c8e13(0x145)](_0x44ada0=>_0x44ada0[_0x1c8e13(0x1a2)][_0x1c8e13(0x1e2)]===_0xbbf1f7);if(_0x38d57e)return!_0x2bf3d3&&writeCachedLLMProject(_0xbbf1f7,_0x38d57e['id'],_0x39809a),_0x38d57e;const _0x2d5bf5=await this['client'][_0x1c8e13(0x15f)]({'name':_0xbbf1f7,'description':_0x1c8e13(0x1c2)+getSanitizedUsername()+')'});return!_0x2bf3d3&&writeCachedLLMProject(_0xbbf1f7,_0x2d5bf5['id'],_0x39809a),_0x2d5bf5;}async[a109_0x4fde2b(0x154)](_0x55913d){const _0x14a8ca=a109_0x4fde2b,_0x1e7fe4=await this[_0x14a8ca(0x181)][_0x14a8ca(0x1d8)](),_0x5a75a3=_0x1e7fe4[_0x14a8ca(0x18b)](_0x49ed40=>_0x49ed40[_0x14a8ca(0x1a2)][_0x14a8ca(0x1e2)]===_0x55913d);if(_0x5a75a3[_0x14a8ca(0x1f0)]===0x0)throw new SDKError(ErrorCode[_0x14a8ca(0x169)],_0x14a8ca(0x233)+_0x55913d,undefined,{'helpText':_0x14a8ca(0x1ff)});if(_0x5a75a3[_0x14a8ca(0x1f0)]>0x1)throw new SDKError(ErrorCode['INTERNAL'],_0x14a8ca(0x215)+_0x55913d+_0x14a8ca(0x165));return _0x5a75a3[0x0]['id'];}async[a109_0x4fde2b(0x201)](_0x46997b){const _0x62ce28=a109_0x4fde2b,_0x837507=await this[_0x62ce28(0x181)][_0x62ce28(0x1d8)](),_0x33743b=_0x837507[_0x62ce28(0x145)](_0x4e037b=>_0x4e037b['attributes'][_0x62ce28(0x1e2)]===_0x46997b);if(_0x33743b)return{'projectId':_0x33743b['id'],'project':_0x33743b};throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x62ce28(0x233)+_0x46997b,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});}async[a109_0x4fde2b(0x251)](_0x5397da='claude-4.5-sonnet',_0x6b7d8b=0x0,_0x2cb9aa){const _0x14c79a=a109_0x4fde2b,_0x51bb97=0xa;let _0x5e8375=0x0,_0x1ed232;while(_0x5e8375<_0x51bb97){try{const _0x4e99f2=await this[_0x14c79a(0x188)](_0x1ed232),_0x5d032e=_0x4e99f2['id'],_0x3be385=['none',_0x14c79a(0x170),_0x14c79a(0x157),_0x14c79a(0x234),'high'],_0x1f0cea=_0x6b7d8b===0x0?_0x14c79a(0x209)+_0x5397da:'tdx_'+_0x5397da+_0x14c79a(0x1fd)+_0x3be385[_0x6b7d8b],_0x509e1a=await this['client'][_0x14c79a(0x202)](_0x5d032e),_0x41c13c=_0x509e1a[_0x14c79a(0x145)](_0x4533ee=>_0x4533ee[_0x14c79a(0x1a2)][_0x14c79a(0x1e2)]===_0x1f0cea);if(_0x41c13c)return _0x41c13c;const _0xa4a285=_0x6b7d8b>0x0?0x1:_0x2cb9aa;return await this[_0x14c79a(0x181)][_0x14c79a(0x1de)]({'name':_0x1f0cea,'projectId':_0x5d032e,'modelType':_0x5397da,'systemPrompt':'','temperature':_0xa4a285,'reasoningEffort':_0x6b7d8b>0x0?_0x6b7d8b:undefined});}catch(_0x54b617){if(_0x54b617 instanceof HTTPClientError){const _0x24dc4d=_0x54b617[_0x14c79a(0x1a5)];if(_0x24dc4d>=0x190&&_0x24dc4d<0x1f4){if(_0x24dc4d===0x191)throw new SDKError(ErrorCode[_0x14c79a(0x20a)],'Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.',_0x54b617);else{if(_0x24dc4d===0x193)throw new SDKError(ErrorCode['PERMISSION_DENIED'],_0x14c79a(0x16d),_0x54b617);}throw _0x54b617;}}if(errorContains(_0x54b617,_0x14c79a(0x16f),_0x14c79a(0x227),'conflict')){_0x5e8375++;if(_0x5e8375>=_0x51bb97)throw new SDKError(ErrorCode[_0x14c79a(0x1b5)],_0x14c79a(0x19a)+_0x51bb97+'\x20attempts\x20due\x20to\x20name\x20conflicts.',_0x54b617);const _0x4490f7=this[_0x14c79a(0x1d5)]();_0x1ed232=_0x4490f7+'_'+generateRandomHex();continue;}throw _0x54b617;}}throw new SDKError(ErrorCode[_0x14c79a(0x1df)],'Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts');}async[a109_0x4fde2b(0x230)](_0x46f162,_0x3bb0d6){const _0x2d5da7=a109_0x4fde2b,_0x2ff942=_0x3bb0d6||this[_0x2d5da7(0x183)],_0xc31e71=await this[_0x2d5da7(0x181)][_0x2d5da7(0x202)](_0x2ff942),_0x10a1dc=_0xc31e71['filter'](_0x2a73bc=>_0x2a73bc['attributes'][_0x2d5da7(0x1e2)]===_0x46f162);if(_0x10a1dc[_0x2d5da7(0x1f0)]===0x0){const _0x3eb868=_0x2ff942?_0x2d5da7(0x18a)+_0x2ff942:'';throw new SDKError(ErrorCode[_0x2d5da7(0x1f4)],_0x2d5da7(0x140)+_0x46f162+_0x3eb868,undefined,{'helpText':_0x2ff942?_0x2d5da7(0x197):'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.'});}if(_0x10a1dc[_0x2d5da7(0x1f0)]>0x1)throw new SDKError(ErrorCode[_0x2d5da7(0x1df)],_0x2d5da7(0x21c)+_0x46f162+'\x27.\x20This\x20should\x20not\x20happen.');return _0x10a1dc[0x0]['id'];}async[a109_0x4fde2b(0x1a1)](_0x1febdb){const _0xb9b699=a109_0x4fde2b,_0x4514b1=_0x1febdb||this[_0xb9b699(0x183)];return await this[_0xb9b699(0x181)][_0xb9b699(0x202)](_0x4514b1);}async[a109_0x4fde2b(0x19f)](_0x34f12a){const _0x502912=a109_0x4fde2b;return await this[_0x502912(0x181)][_0x502912(0x1a7)](_0x34f12a);}async[a109_0x4fde2b(0x208)](_0x32eab9){const _0x313eb1=a109_0x4fde2b;return await this['client'][_0x313eb1(0x226)](_0x32eab9);}async[a109_0x4fde2b(0x1de)](_0xa02511){const _0x715fed=a109_0x4fde2b;return await this[_0x715fed(0x181)][_0x715fed(0x1de)](_0xa02511);}async[a109_0x4fde2b(0x199)](_0x443c88,_0x5cef69){const _0x4d7071=a109_0x4fde2b;return await this[_0x4d7071(0x181)]['updateAgent'](_0x443c88,_0x5cef69);}async[a109_0x4fde2b(0x1ab)](_0x157b40){const _0x6c12a0=a109_0x4fde2b;await this['client'][_0x6c12a0(0x1ab)](_0x157b40);}async[a109_0x4fde2b(0x1d7)](_0x3e0e3c){const _0x5b7c1e=a109_0x4fde2b;return await this[_0x5b7c1e(0x181)]['startChat']({'agentId':_0x3e0e3c});}async*[a109_0x4fde2b(0x22b)](_0x547ea4,_0x1a7053){const _0x3a613b=a109_0x4fde2b;let _0x4c35c6=_0x1a7053?.[_0x3a613b(0x191)];const _0x4a6e91=_0x1a7053?.[_0x3a613b(0x1f5)];if(!_0x4c35c6){if(!_0x4a6e91)throw new Error('agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat');const _0xeb9070=await this[_0x3a613b(0x181)][_0x3a613b(0x1d7)]({'agentId':_0x4a6e91});_0x4c35c6=_0xeb9070['id'],yield{'type':_0x3a613b(0x159),'data':{'chatId':_0x4c35c6,'agentId':_0x4a6e91,'projectId':_0xeb9070[_0x3a613b(0x1a2)][_0x3a613b(0x187)]}};}for await(const _0xc065be of this[_0x3a613b(0x181)][_0x3a613b(0x1ac)](_0x4c35c6,_0x547ea4,_0x1a7053?.[_0x3a613b(0x18d)])){yield{'type':_0x3a613b(0x22a),'data':_0xc065be};}}async['chats'](_0x526875=0x32){const _0x433995=a109_0x4fde2b;return await this[_0x433995(0x181)][_0x433995(0x153)](_0x526875);}async[a109_0x4fde2b(0x1a8)](_0x5abdec){const _0x160618=a109_0x4fde2b;return await this[_0x160618(0x181)][_0x160618(0x1b3)](_0x5abdec);}async[a109_0x4fde2b(0x17d)](_0x3e7b60){const _0x363e90=a109_0x4fde2b;return await this['client'][_0x363e90(0x17d)](_0x3e7b60);}async[a109_0x4fde2b(0x1c5)](_0x57584a){const _0x30aae6=a109_0x4fde2b;return await this[_0x30aae6(0x181)]['getChatInfo'](_0x57584a);}async['backupProject'](_0x596c3b,_0x366d26,_0x3a1cc3){const _0x78eaf6=a109_0x4fde2b,_0x2b0cf9=_0x3a1cc3?.[_0x78eaf6(0x193)]??![],{projectId:_0x2532a1,project:_0x4d4b82}=await this[_0x78eaf6(0x201)](_0x596c3b),_0x3e59b9=_0x4d4b82[_0x78eaf6(0x1a2)][_0x78eaf6(0x1e2)],_0x261391=_0x366d26||_0x3e59b9+_0x78eaf6(0x1e4);if(a109_0x5bd25e[_0x78eaf6(0x203)](_0x261391)&&!_0x2b0cf9)throw new SDKError(ErrorCode['ALREADY_EXISTS'],_0x78eaf6(0x1bc)+_0x261391,undefined,{'helpText':_0x78eaf6(0x148)});const _0x84740a=await this[_0x78eaf6(0x181)]['listAgentsFull'](_0x2532a1),_0x2119a5=await this[_0x78eaf6(0x181)]['listKnowledgeBases'](_0x2532a1),_0x5e3436=await this[_0x78eaf6(0x181)][_0x78eaf6(0x22e)](_0x2532a1),_0xd97284=await this['client'][_0x78eaf6(0x185)](_0x2532a1);if(!_0x2b0cf9){a109_0x5bd25e['mkdirSync'](_0x261391,{'recursive':!![]});const _0x2a4b07={'version':_0x78eaf6(0x254),'exportedAt':new Date()['toISOString'](),'exportedFrom':{'site':this[_0x78eaf6(0x1c0)]['site'],'projectId':_0x2532a1,'projectName':_0x3e59b9},'project':_0x4d4b82};a109_0x5bd25e['writeFileSync'](a109_0x4e6e83['join'](_0x261391,'project.json'),JSON['stringify'](_0x2a4b07,null,0x2)),a109_0x5bd25e['writeFileSync'](a109_0x4e6e83[_0x78eaf6(0x1b9)](_0x261391,_0x78eaf6(0x14f)),JSON['stringify'](_0x84740a,null,0x2)),a109_0x5bd25e[_0x78eaf6(0x182)](a109_0x4e6e83['join'](_0x261391,_0x78eaf6(0x213)),JSON[_0x78eaf6(0x1a4)](_0x2119a5,null,0x2)),a109_0x5bd25e[_0x78eaf6(0x182)](a109_0x4e6e83[_0x78eaf6(0x1b9)](_0x261391,_0x78eaf6(0x21a)),JSON['stringify'](_0x5e3436,null,0x2)),a109_0x5bd25e[_0x78eaf6(0x182)](a109_0x4e6e83[_0x78eaf6(0x1b9)](_0x261391,_0x78eaf6(0x22c)),JSON[_0x78eaf6(0x1a4)](_0xd97284,null,0x2));}return{'projectName':_0x3e59b9,'outputDir':_0x261391,'counts':{'agents':_0x84740a[_0x78eaf6(0x1f0)],'knowledgeBases':_0x2119a5[_0x78eaf6(0x1f0)],'prompts':_0x5e3436['length'],'integrations':_0xd97284[_0x78eaf6(0x1f0)]}};}async['restoreProject'](_0x2c2480,_0x353d4b){const _0x247d19=a109_0x4fde2b,_0x410357=_0x353d4b?.[_0x247d19(0x193)]??![],_0xe67552=this[_0x247d19(0x190)](_0x2c2480),_0x2314aa=_0xe67552['exportedFrom'][_0x247d19(0x1f6)],_0x1ab46e=this[_0x247d19(0x1c0)]['site'],_0x616568=_0x2314aa!==_0x1ab46e?_0x2314aa:undefined,_0x42aca6=this[_0x247d19(0x196)](a109_0x4e6e83['join'](_0x2c2480,_0x247d19(0x14f)),[]),_0x51dd4a=this['loadJsonFile'](a109_0x4e6e83['join'](_0x2c2480,'knowledgebases.json'),[]),_0xbc6e64=this[_0x247d19(0x196)](a109_0x4e6e83['join'](_0x2c2480,_0x247d19(0x21a)),[]),_0x3b4510=this[_0x247d19(0x196)](a109_0x4e6e83[_0x247d19(0x1b9)](_0x2c2480,_0x247d19(0x22c)),[]),_0x3a90ea=_0x353d4b?.[_0x247d19(0x1e2)]||_0xe67552[_0x247d19(0x1b8)]['projectName'];if(_0x410357){const _0x19834a=new Map(),_0x2d116d=[..._0x42aca6],_0x28b8dc=_0x42aca6[_0x247d19(0x1f0)]+0x1;let _0x490160=0x0;while(_0x2d116d[_0x247d19(0x1f0)]>0x0&&_0x490160<_0x28b8dc){_0x490160++;const _0xc34fdb=[];for(const _0x1cf2a3 of _0x2d116d){canCreateAgent(_0x1cf2a3,_0x19834a)?_0x19834a[_0x247d19(0x21f)](_0x1cf2a3['id'],_0x247d19(0x20b)+_0x1cf2a3['id']):_0xc34fdb['push'](_0x1cf2a3);}if(_0xc34fdb['length']===_0x2d116d[_0x247d19(0x1f0)])throw new SDKError(ErrorCode[_0x247d19(0x1df)],_0x247d19(0x1c3),undefined,{'helpText':_0x247d19(0x210)});_0x2d116d[_0x247d19(0x1f0)]=0x0,_0x2d116d[_0x247d19(0x1cb)](..._0xc34fdb);}const _0x4a6213=_0xbc6e64['filter'](_0x109f50=>_0x19834a['has'](_0x109f50[_0x247d19(0x1a2)][_0x247d19(0x1f5)]))['length'];return{'projectName':_0x3a90ea,'projectId':_0x247d19(0x207),'counts':{'agents':_0x42aca6[_0x247d19(0x1f0)],'knowledgeBases':_0x51dd4a['length'],'prompts':_0x4a6213,'integrations':_0x3b4510[_0x247d19(0x1f0)]},'sourceSite':_0x616568};}const _0x25854a=await this[_0x247d19(0x181)][_0x247d19(0x15f)]({'name':_0x3a90ea,'description':_0xe67552['project']['attributes']['description']}),_0x1e3368=_0x25854a['id'],_0x16804b=new Map(),_0xf3837f=new Map(),_0x5bc3b8=new Map();for(const _0x367fd3 of _0x51dd4a){const _0x3ccb1c=await this[_0x247d19(0x181)]['createKnowledgeBase']({'projectId':_0x1e3368,'name':_0x367fd3[_0x247d19(0x1a2)][_0x247d19(0x1e2)],'tdDatabaseName':_0x367fd3['attributes'][_0x247d19(0x1be)],'tables':_0x367fd3['attributes'][_0x247d19(0x175)]});_0x16804b[_0x247d19(0x21f)](_0x367fd3['id'],_0x3ccb1c['id']);}const _0x1d3948=[..._0x42aca6],_0x1890db=_0x42aca6[_0x247d19(0x1f0)]+0x1;let _0x1b4cd8=0x0;while(_0x1d3948[_0x247d19(0x1f0)]>0x0&&_0x1b4cd8<_0x1890db){_0x1b4cd8++;const _0x131487=[];for(const _0x1c5ca6 of _0x1d3948){if(canCreateAgent(_0x1c5ca6,_0xf3837f)){const _0x268cee=remapToolIds(_0x1c5ca6[_0x247d19(0x1a2)]['tools'],_0x16804b,_0xf3837f),_0x4138e2=remapVariableIds(_0x1c5ca6[_0x247d19(0x1a2)][_0x247d19(0x13d)],_0x16804b),_0x52817c=await this[_0x247d19(0x181)][_0x247d19(0x1ee)]({'name':_0x1c5ca6[_0x247d19(0x1a2)]['name'],'projectId':_0x1e3368,'systemPrompt':_0x1c5ca6['attributes']['systemPrompt'],'starterMessage':_0x1c5ca6[_0x247d19(0x1a2)]['starterMessage'],'modelType':migrateModelType(_0x1c5ca6[_0x247d19(0x1a2)]['modelType']),'maxToolIterations':_0x1c5ca6[_0x247d19(0x1a2)][_0x247d19(0x18f)],'temperature':_0x1c5ca6[_0x247d19(0x1a2)][_0x247d19(0x246)],'reasoningEffort':_0x1c5ca6[_0x247d19(0x1a2)]['reasoningEffort'],'outputs':_0x1c5ca6[_0x247d19(0x1a2)][_0x247d19(0x236)],'tools':_0x268cee,'variables':_0x4138e2});_0xf3837f[_0x247d19(0x21f)](_0x1c5ca6['id'],_0x52817c['id']);}else _0x131487['push'](_0x1c5ca6);}if(_0x131487[_0x247d19(0x1f0)]===_0x1d3948['length'])throw new SDKError(ErrorCode[_0x247d19(0x1df)],_0x247d19(0x1c3),undefined,{'helpText':_0x247d19(0x210)});_0x1d3948[_0x247d19(0x1f0)]=0x0,_0x1d3948[_0x247d19(0x1cb)](..._0x131487);}for(const _0x1b015e of _0xbc6e64){const _0x5a9ab9=_0xf3837f[_0x247d19(0x161)](_0x1b015e['attributes']['agentId']);if(!_0x5a9ab9)continue;const _0x3cf2d9=await this[_0x247d19(0x181)][_0x247d19(0x16a)]({'projectId':_0x1e3368,'agentId':_0x5a9ab9,'name':_0x1b015e[_0x247d19(0x1a2)][_0x247d19(0x1e2)],'systemPrompt':_0x1b015e[_0x247d19(0x1a2)]['systemPrompt'],'template':_0x1b015e['attributes'][_0x247d19(0x1a9)],'jsonSchemaHint':_0x1b015e[_0x247d19(0x1a2)]['jsonSchemaHint']});_0x5bc3b8['set'](_0x1b015e['id'],_0x3cf2d9['id']);}for(const _0x293950 of _0x3b4510){const _0x4fa0a8=_0x293950[_0x247d19(0x1a2)][_0x247d19(0x141)][_0x247d19(0x214)](_0x3c5a0e=>({..._0x3c5a0e,'promptId':_0x5bc3b8[_0x247d19(0x161)](_0x3c5a0e[_0x247d19(0x1fb)])||_0x3c5a0e['promptId']}));await this[_0x247d19(0x181)][_0x247d19(0x1aa)]({'projectId':_0x1e3368,'serviceType':_0x293950['attributes'][_0x247d19(0x16c)],'actions':_0x4fa0a8,'slackMessageMode':_0x293950['attributes'][_0x247d19(0x1b2)],'chatIgnoreManagedActions':_0x293950[_0x247d19(0x1a2)][_0x247d19(0x17b)],'chatWelcomeMessage':_0x293950[_0x247d19(0x1a2)][_0x247d19(0x143)],'webhookCorsOrigins':_0x293950['attributes'][_0x247d19(0x247)]});}return{'projectName':_0x3a90ea,'projectId':_0x1e3368,'counts':{'agents':_0xf3837f[_0x247d19(0x1fe)],'knowledgeBases':_0x16804b[_0x247d19(0x1fe)],'prompts':_0x5bc3b8['size'],'integrations':_0x3b4510[_0x247d19(0x1f0)]},'sourceSite':_0x616568};}['loadJsonFile'](_0x280030,_0x6c4087){const _0x2a880a=a109_0x4fde2b;if(!a109_0x5bd25e[_0x2a880a(0x203)](_0x280030))return _0x6c4087;return JSON['parse'](a109_0x5bd25e[_0x2a880a(0x174)](_0x280030,_0x2a880a(0x1ef)));}['getBackupMetadata'](_0x40b82a){const _0x208946=a109_0x4fde2b;if(!a109_0x5bd25e['existsSync'](_0x40b82a))throw new SDKError(ErrorCode['NOT_FOUND'],_0x208946(0x1e6)+_0x40b82a,undefined,{'helpText':'Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.'});const _0x160082=a109_0x4e6e83[_0x208946(0x1b9)](_0x40b82a,'project.json');if(!a109_0x5bd25e['existsSync'](_0x160082))throw new SDKError(ErrorCode[_0x208946(0x1ca)],'Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20'+_0x40b82a,undefined,{'helpText':_0x208946(0x1bd)});const _0x760637=JSON[_0x208946(0x248)](a109_0x5bd25e['readFileSync'](_0x160082,_0x208946(0x1ef)));if(!isSupportedBackupVersion(_0x760637[_0x208946(0x21d)]))throw new SDKError(ErrorCode[_0x208946(0x1ca)],'Unsupported\x20backup\x20version:\x20'+_0x760637[_0x208946(0x21d)],undefined,{'helpText':_0x208946(0x149)});return _0x760637;}async['pullProject'](_0x460737,_0x5662b5,_0x367aef){const _0x4803b1=a109_0x4fde2b,{projectId:_0x527f8b,project:_0x3b9d50}=await this['resolveProjectName'](_0x460737),_0x194729=_0x3b9d50[_0x4803b1(0x1a2)]['name'];let _0x209fa6;if(_0x5662b5)_0x209fa6=_0x5662b5;else{const _0x38a4fb=a109_0x4e6e83[_0x4803b1(0x1b9)](process[_0x4803b1(0x204)](),_0x4803b1(0x1a1)),_0x26d8d0=getSanitizedPathWithMigration(_0x38a4fb,_0x194729);_0x26d8d0[_0x4803b1(0x255)]&&this['logger'][_0x4803b1(0x19c)]('Renamed\x20folder:\x20'+a109_0x4e6e83['basename'](_0x26d8d0[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x26d8d0[_0x4803b1(0x205)])),_0x209fa6=_0x26d8d0[_0x4803b1(0x205)];}const _0xf48508=await this[_0x4803b1(0x181)][_0x4803b1(0x1a7)](_0x527f8b),_0x1cd9dc=await this['client'][_0x4803b1(0x13f)](_0x527f8b),_0x198722=await this[_0x4803b1(0x181)][_0x4803b1(0x1a3)](_0x527f8b),_0x22d66b=await safeListOrEmpty(()=>this[_0x4803b1(0x181)]['listImageGenerators'](_0x527f8b)),_0x316d11=await safeListOrEmpty(()=>this[_0x4803b1(0x181)][_0x4803b1(0x167)](_0x527f8b)),_0x14c278=await this['client'][_0x4803b1(0x22e)](_0x527f8b),_0x5b9346=await this['client'][_0x4803b1(0x185)](_0x527f8b),_0x16ec12=await safeListOrEmpty(()=>this[_0x4803b1(0x181)][_0x4803b1(0x238)](_0x527f8b)),_0x2e7897=await safeListOrEmpty(()=>this[_0x4803b1(0x181)][_0x4803b1(0x1cd)](_0x527f8b)),_0x31c023=_0x5b9346[_0x4803b1(0x18b)](_0x426286=>!_0x426286[_0x4803b1(0x1a2)]['isManaged']&&SAFE_INTEGRATION_TYPES['includes'](_0x426286['attributes'][_0x4803b1(0x16c)][_0x4803b1(0x22f)]())),_0x3ee3bc=new Map(),_0x4d6564=new Map(),_0xd88263=new Map(),_0x2f5e6a=new Map(),_0x357039=new Map(),_0x8def0a=new Map(),_0x22c721=new Map();for(const _0x317b4e of _0xf48508){_0x3ee3bc[_0x4803b1(0x21f)](_0x317b4e['id'],_0x317b4e[_0x4803b1(0x1a2)]['name']);}for(const _0xbb49e2 of _0x1cd9dc){_0x4d6564[_0x4803b1(0x21f)](_0xbb49e2['id'],_0xbb49e2[_0x4803b1(0x1a2)]['name']);}for(const _0x1a6ba0 of _0x198722){_0xd88263[_0x4803b1(0x21f)](_0x1a6ba0['id'],_0x1a6ba0[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)]);}for(const _0x18f03c of _0x22d66b){_0x2f5e6a[_0x4803b1(0x21f)](_0x18f03c['id'],_0x18f03c['attributes'][_0x4803b1(0x1e2)]);}for(const _0x3c4ae6 of _0x316d11){_0x357039[_0x4803b1(0x21f)](_0x3c4ae6['id'],_0x3c4ae6[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)]);}for(const _0x501f07 of _0x14c278){_0x8def0a[_0x4803b1(0x21f)](_0x501f07['id'],_0x501f07[_0x4803b1(0x1a2)]['name']);}for(const _0x20c610 of _0x16ec12){_0x22c721[_0x4803b1(0x21f)](_0x20c610['id'],_0x20c610[_0x4803b1(0x1a2)]['name']);}const _0x21a45f={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x4d6564,'TextKnowledgeBase':_0xd88263,'Agent':_0x3ee3bc,'WebSearchTool':_0x357039,'ImageGenerator':_0x2f5e6a,'ExperimentalKnowledgeBase':_0x22c721}),'resolvePromptName':async _0x4526e3=>_0x8def0a['get'](_0x4526e3),'onWarning':_0x1bde4b=>this['logger'][_0x4803b1(0x192)](_0x1bde4b)},_0x2e0924={'projectName':_0x194729,'outputDir':_0x209fa6,'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}}},_0x16cb04=[],_0x4df7e1=[];for(const _0x2db869 of _0xf48508){const _0x285726=getSanitizedPathWithMigration(_0x209fa6,_0x2db869[_0x4803b1(0x1a2)]['name']);_0x285726[_0x4803b1(0x255)]&&this[_0x4803b1(0x1eb)][_0x4803b1(0x19c)]('Renamed\x20agent\x20folder:\x20'+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x285726[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83['basename'](_0x285726[_0x4803b1(0x205)]));const _0x343d09=_0x285726[_0x4803b1(0x205)],_0x3da623=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x343d09,_0x4803b1(0x1c8)),_0x3e49ba=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x343d09,'agent.yml'),_0x24e59d=a109_0x4e6e83['join'](_0x343d09,_0x4803b1(0x1e1)),{yaml:_0x46e027,systemPrompt:_0x546a1b,starterMessage:_0x5dbadd}=await agentResponseToDef(_0x2db869,_0x21a45f),_0x2a632a=toAgentYamlString(_0x46e027),_0x371518=!a109_0x5bd25e[_0x4803b1(0x203)](_0x3e49ba);let _0x5c7c1a=_0x371518,_0x49707a;if(!_0x371518){const _0x56118a=a109_0x5bd25e[_0x4803b1(0x203)](_0x3da623)?a109_0x5bd25e[_0x4803b1(0x174)](_0x3da623,'utf-8'):'',_0x574577=a109_0x5bd25e[_0x4803b1(0x174)](_0x3e49ba,_0x4803b1(0x1ef)),_0x597686='#\x20prompt.md\x0a'+_0x56118a+'\x0a\x0a#\x20agent.yml\x0a'+_0x574577,_0x192f6d=_0x4803b1(0x232)+_0x546a1b+_0x4803b1(0x142)+_0x2a632a,_0x2e70ac=generateDiff(_0x597686,_0x192f6d);_0x5c7c1a=hasChanges(_0x2e70ac),_0x5c7c1a&&(_0x49707a=formatDiffWithColors(_0x2e70ac));}_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x343d09,'content':'','isDir':!![]}),_0x16cb04['push']({'path':_0x3da623,'content':_0x546a1b}),_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x3e49ba,'content':_0x2a632a});_0x5dbadd&&_0x5dbadd['includes']('\x0a')&&_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x24e59d,'content':_0x5dbadd});_0x2e0924['agents'][_0x4803b1(0x1cb)]({'agentName':_0x2db869[_0x4803b1(0x1a2)]['name'],'outputPath':_0x343d09,'isNew':_0x371518,'hasChanges':_0x5c7c1a,'diff':_0x49707a}),_0x2e0924['counts']['agents'][_0x4803b1(0x1db)]++;if(_0x371518)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x1a1)]['new']++;else{if(_0x5c7c1a)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x1a1)]['updated']++;else _0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x1a1)][_0x4803b1(0x222)]++;}}for(const _0xde6767 of _0x1cd9dc){if(_0xde6767['attributes'][_0x4803b1(0x1b1)])continue;const _0x5bb145=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x209fa6),_0xde6767[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)],_0x4803b1(0x252));_0x5bb145['renamed']&&this[_0x4803b1(0x1eb)]['info'](_0x4803b1(0x172)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x5bb145[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x5bb145[_0x4803b1(0x205)]));const _0x5680a6=_0x5bb145['path'],_0x220ec9=apiKnowledgeBaseToYaml(_0xde6767),_0x29ef0f=toKnowledgeBaseYamlString(_0x220ec9),_0x4c8274=!a109_0x5bd25e['existsSync'](_0x5680a6);let _0x1d1cc9=_0x4c8274,_0x333df5;if(!_0x4c8274){const _0x5072b1=a109_0x5bd25e[_0x4803b1(0x174)](_0x5680a6,_0x4803b1(0x1ef)),_0x2ae58a=generateDiff(_0x5072b1,_0x29ef0f);_0x1d1cc9=hasChanges(_0x2ae58a),_0x1d1cc9&&(_0x333df5=formatDiffWithColors(_0x2ae58a));}_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x5680a6,'content':_0x29ef0f}),_0x2e0924[_0x4803b1(0x15d)][_0x4803b1(0x1cb)]({'name':_0xde6767[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)],'outputPath':_0x5680a6,'isNew':_0x4c8274,'hasChanges':_0x1d1cc9,'diff':_0x333df5}),_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x15d)][_0x4803b1(0x1db)]++;if(_0x4c8274)_0x2e0924[_0x4803b1(0x152)]['knowledgeBases']['new']++;else{if(_0x1d1cc9)_0x2e0924['counts']['knowledgeBases']['updated']++;else _0x2e0924[_0x4803b1(0x152)]['knowledgeBases']['unchanged']++;}}for(const _0x7968c of _0x198722){if(_0x7968c['attributes']['isManaged'])continue;const _0xee4909=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x209fa6),_0x7968c['attributes'][_0x4803b1(0x1e2)],'.md');_0xee4909['renamed']&&this[_0x4803b1(0x1eb)][_0x4803b1(0x19c)](_0x4803b1(0x16b)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0xee4909[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0xee4909['path']));const _0x2fb420=_0xee4909[_0x4803b1(0x205)],_0x19cbe0=toTextKnowledgeBaseMd(_0x7968c[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)],_0x7968c[_0x4803b1(0x1a2)]['text']),_0x37076d=!a109_0x5bd25e['existsSync'](_0x2fb420);let _0x48ade8=_0x37076d,_0x48f283;if(!_0x37076d){const _0x4298d1=a109_0x5bd25e[_0x4803b1(0x174)](_0x2fb420,_0x4803b1(0x1ef)),_0x4073a0=generateDiff(_0x4298d1,_0x19cbe0);_0x48ade8=hasChanges(_0x4073a0),_0x48ade8&&(_0x48f283=formatDiffWithColors(_0x4073a0));}_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x2fb420,'content':_0x19cbe0}),_0x2e0924[_0x4803b1(0x22d)]['push']({'name':_0x7968c[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)],'outputPath':_0x2fb420,'isNew':_0x37076d,'hasChanges':_0x48ade8,'diff':_0x48f283}),_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x22d)]['total']++;if(_0x37076d)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x22d)][_0x4803b1(0x220)]++;else{if(_0x48ade8)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x22d)]['updated']++;else _0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x22d)][_0x4803b1(0x222)]++;}}for(const _0xf9955e of _0x14c278){if(_0xf9955e['attributes']['isManaged'])continue;const _0x2ad74b=getSanitizedPathWithMigration(getPromptsDir(_0x209fa6),_0xf9955e[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)],_0x4803b1(0x252));_0x2ad74b[_0x4803b1(0x255)]&&this[_0x4803b1(0x1eb)]['info'](_0x4803b1(0x219)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x2ad74b[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x2ad74b[_0x4803b1(0x205)]));const _0x423e0c=_0x2ad74b[_0x4803b1(0x205)],_0x45bfb0=await apiPromptToYaml(_0xf9955e,_0x21a45f);if(!_0x45bfb0)continue;const _0xad5d17=toPromptYamlString(_0x45bfb0),_0x4922fd=!a109_0x5bd25e[_0x4803b1(0x203)](_0x423e0c);let _0x3c33f1=_0x4922fd,_0x246626;if(!_0x4922fd){const _0x5c3d09=a109_0x5bd25e[_0x4803b1(0x174)](_0x423e0c,_0x4803b1(0x1ef)),_0x1fe021=generateDiff(_0x5c3d09,_0xad5d17);_0x3c33f1=hasChanges(_0x1fe021),_0x3c33f1&&(_0x246626=formatDiffWithColors(_0x1fe021));}_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x423e0c,'content':_0xad5d17}),_0x2e0924['prompts'][_0x4803b1(0x1cb)]({'name':_0xf9955e[_0x4803b1(0x1a2)]['name'],'outputPath':_0x423e0c,'isNew':_0x4922fd,'hasChanges':_0x3c33f1,'diff':_0x246626}),_0x2e0924['counts'][_0x4803b1(0x217)]['total']++;if(_0x4922fd)_0x2e0924['counts'][_0x4803b1(0x217)][_0x4803b1(0x220)]++;else{if(_0x3c33f1)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x217)][_0x4803b1(0x206)]++;else _0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x217)][_0x4803b1(0x222)]++;}}for(const _0x5e6827 of _0x31c023){const _0x215283=_0x5e6827[_0x4803b1(0x1a2)][_0x4803b1(0x16c)][_0x4803b1(0x22f)](),_0x5d04f7=getSanitizedPathWithMigration(getIntegrationsDir(_0x209fa6),_0x215283,_0x4803b1(0x252));_0x5d04f7['renamed']&&this[_0x4803b1(0x1eb)]['info'](_0x4803b1(0x1d4)+a109_0x4e6e83['basename'](_0x5d04f7[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x5d04f7[_0x4803b1(0x205)]));const _0x1f9706=_0x5d04f7[_0x4803b1(0x205)],_0x111053=await apiIntegrationToYaml(_0x5e6827,_0x21a45f),_0x5ceb92=toIntegrationYamlString(_0x111053),_0x399646=!a109_0x5bd25e[_0x4803b1(0x203)](_0x1f9706);let _0x2b15e2=_0x399646,_0x245447;if(!_0x399646){const _0x4e4d42=a109_0x5bd25e[_0x4803b1(0x174)](_0x1f9706,_0x4803b1(0x1ef)),_0xb35e58=generateDiff(_0x4e4d42,_0x5ceb92);_0x2b15e2=hasChanges(_0xb35e58),_0x2b15e2&&(_0x245447=formatDiffWithColors(_0xb35e58));}_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x1f9706,'content':_0x5ceb92}),_0x2e0924[_0x4803b1(0x245)]['push']({'name':_0x215283,'outputPath':_0x1f9706,'isNew':_0x399646,'hasChanges':_0x2b15e2,'diff':_0x245447}),_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x245)]['total']++;if(_0x399646)_0x2e0924['counts'][_0x4803b1(0x245)][_0x4803b1(0x220)]++;else{if(_0x2b15e2)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x245)][_0x4803b1(0x206)]++;else _0x2e0924['counts'][_0x4803b1(0x245)][_0x4803b1(0x222)]++;}}for(const _0x478ac8 of _0x16ec12){if(_0x478ac8[_0x4803b1(0x1a2)][_0x4803b1(0x1b1)])continue;const _0x57de5b=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x209fa6),_0x478ac8['attributes'][_0x4803b1(0x1e2)]);_0x57de5b[_0x4803b1(0x255)]&&this[_0x4803b1(0x1eb)][_0x4803b1(0x19c)](_0x4803b1(0x171)+a109_0x4e6e83['basename'](_0x57de5b[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x57de5b[_0x4803b1(0x205)]));const _0x39b180=_0x57de5b[_0x4803b1(0x205)],_0x1fa394=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x39b180,sanitizeForFilesystem(_0x478ac8[_0x4803b1(0x1a2)]['name'])+_0x4803b1(0x252)),_0x5bef8e=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x39b180,_0x4803b1(0x163)),_0x3afc9c=apiExperimentalKnowledgeBaseToYaml(_0x478ac8),_0x3a68ca=toExperimentalKnowledgeBaseYamlString(_0x3afc9c),_0x3caea5=!a109_0x5bd25e[_0x4803b1(0x203)](_0x39b180);let _0x53781f=_0x3caea5,_0x3c27e2,_0x580439=_0x3a68ca;const _0x5ec7cc=[..._0x3afc9c['functions']][_0x4803b1(0x17c)]((_0x495ee7,_0x2e34b2)=>_0x495ee7[_0x4803b1(0x1e2)][_0x4803b1(0x198)](_0x2e34b2[_0x4803b1(0x1e2)]));for(const _0x2d262e of _0x5ec7cc){_0x580439+='\x0a---\x20function:\x20'+_0x2d262e[_0x4803b1(0x1e2)]+'\x20---\x0a'+_0x2d262e[_0x4803b1(0x24a)]+_0x4803b1(0x195)+_0x2d262e[_0x4803b1(0x1e2)]+_0x4803b1(0x1cc)+_0x2d262e['json_schema']+'\x0a';}if(!_0x3caea5){let _0x5dc226='';a109_0x5bd25e[_0x4803b1(0x203)](_0x1fa394)&&(_0x5dc226=a109_0x5bd25e[_0x4803b1(0x174)](_0x1fa394,'utf-8'));if(a109_0x5bd25e[_0x4803b1(0x203)](_0x5bef8e)){const _0xa6ce91=a109_0x5bd25e[_0x4803b1(0x1c1)](_0x5bef8e,{'withFileTypes':!![]}),_0x714b54=_0xa6ce91[_0x4803b1(0x18b)](_0x35e655=>_0x35e655['isDirectory']())[_0x4803b1(0x17c)]((_0x29c550,_0x27c223)=>_0x29c550[_0x4803b1(0x1e2)]['localeCompare'](_0x27c223[_0x4803b1(0x1e2)]));for(const _0x24c77d of _0x714b54){const _0x44cdd6=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x5bef8e,_0x24c77d[_0x4803b1(0x1e2)],_0x4803b1(0x1d9)),_0x5e75c9=a109_0x4e6e83['join'](_0x5bef8e,_0x24c77d[_0x4803b1(0x1e2)],_0x4803b1(0x186));a109_0x5bd25e[_0x4803b1(0x203)](_0x44cdd6)&&(_0x5dc226+=_0x4803b1(0x14a)+_0x24c77d[_0x4803b1(0x1e2)]+_0x4803b1(0x1cc)+a109_0x5bd25e['readFileSync'](_0x44cdd6,_0x4803b1(0x1ef))+'\x0a'),a109_0x5bd25e['existsSync'](_0x5e75c9)&&(_0x5dc226+=_0x4803b1(0x1e0)+_0x24c77d['name']+_0x4803b1(0x1cc)+a109_0x5bd25e[_0x4803b1(0x174)](_0x5e75c9,'utf-8')+'\x0a');}}const _0x39c681=generateDiff(_0x5dc226,_0x580439);_0x53781f=hasChanges(_0x39c681),_0x53781f&&(_0x3c27e2=formatDiffWithColors(_0x39c681));}_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x39b180,'content':'','isDir':!![]}),_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x1fa394,'content':_0x3a68ca}),_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x5bef8e,'content':'','isDir':!![]});for(const _0x2b662e of _0x3afc9c[_0x4803b1(0x163)]){const _0x11f8bb=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x5bef8e,sanitizeForFilesystem(_0x2b662e['name'])),_0x2540a5=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x11f8bb,_0x4803b1(0x1d9)),_0x1bcdbe=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x11f8bb,_0x4803b1(0x186));_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x11f8bb,'content':'','isDir':!![]}),_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x2540a5,'content':_0x2b662e['code']}),_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x1bcdbe,'content':_0x2b662e[_0x4803b1(0x144)]});}if(a109_0x5bd25e[_0x4803b1(0x203)](_0x5bef8e)){const _0x2781dd=a109_0x5bd25e[_0x4803b1(0x1c1)](_0x5bef8e,{'withFileTypes':!![]}),_0x572db6=new Set(_0x3afc9c[_0x4803b1(0x163)]['map'](_0x4d9808=>sanitizeForFilesystem(_0x4d9808[_0x4803b1(0x1e2)])));for(const _0x32c4c9 of _0x2781dd){if(_0x32c4c9[_0x4803b1(0x15b)]()&&!_0x572db6['has'](_0x32c4c9[_0x4803b1(0x1e2)])){const _0x14e6b2=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x5bef8e,_0x32c4c9[_0x4803b1(0x1e2)]);_0x4df7e1[_0x4803b1(0x1cb)]({'path':_0x14e6b2,'isDir':!![]});}}}_0x2e0924['experimentalKnowledgeBases'][_0x4803b1(0x1cb)]({'name':_0x478ac8[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)],'outputPath':_0x39b180,'isNew':_0x3caea5,'hasChanges':_0x53781f,'diff':_0x3c27e2}),_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x229)][_0x4803b1(0x1db)]++;if(_0x3caea5)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x229)][_0x4803b1(0x220)]++;else{if(_0x53781f)_0x2e0924[_0x4803b1(0x152)]['experimentalKnowledgeBases'][_0x4803b1(0x206)]++;else _0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x229)]['unchanged']++;}}for(const _0x474e5e of _0x2e7897){if(_0x474e5e[_0x4803b1(0x1a2)][_0x4803b1(0x1b1)])continue;const _0x2a695c=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x209fa6),_0x474e5e[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)]);_0x2a695c[_0x4803b1(0x255)]&&this[_0x4803b1(0x1eb)][_0x4803b1(0x19c)](_0x4803b1(0x242)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x2a695c[_0x4803b1(0x166)])+_0x4803b1(0x1f3)+a109_0x4e6e83[_0x4803b1(0x1c4)](_0x2a695c[_0x4803b1(0x205)]));const _0x4d5e0c=_0x2a695c[_0x4803b1(0x205)],_0x37bdd3=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x4d5e0c,sanitizeForFilesystem(_0x474e5e[_0x4803b1(0x1a2)]['name'])+_0x4803b1(0x252)),_0x254013=a109_0x4e6e83['join'](_0x4d5e0c,_0x4803b1(0x1d9)),_0x520004=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x4d5e0c,_0x4803b1(0x249)),_0x1104bc=apiExperimentalArtifactToYaml(_0x474e5e),_0x559ba6=toExperimentalArtifactYamlString(_0x1104bc),_0x3e6377=!a109_0x5bd25e[_0x4803b1(0x203)](_0x4d5e0c);let _0x44e4a6=_0x3e6377,_0x1bcb03,_0x39f39b=_0x559ba6+(_0x4803b1(0x24b)+_0x1104bc[_0x4803b1(0x24a)]+'\x0a');const _0x549734=[..._0x1104bc['files']][_0x4803b1(0x17c)]((_0x16dd99,_0x25736f)=>_0x16dd99[_0x4803b1(0x147)][_0x4803b1(0x198)](_0x25736f[_0x4803b1(0x147)]));for(const _0x5037ee of _0x549734){_0x39f39b+=_0x4803b1(0x24e)+_0x5037ee[_0x4803b1(0x147)]+_0x4803b1(0x1cc)+_0x5037ee[_0x4803b1(0x178)]+'\x0a';}if(!_0x3e6377){let _0x25d624='';a109_0x5bd25e[_0x4803b1(0x203)](_0x37bdd3)&&(_0x25d624=a109_0x5bd25e[_0x4803b1(0x174)](_0x37bdd3,'utf-8'));a109_0x5bd25e[_0x4803b1(0x203)](_0x254013)&&(_0x25d624+=_0x4803b1(0x24b)+a109_0x5bd25e[_0x4803b1(0x174)](_0x254013,'utf-8')+'\x0a');if(a109_0x5bd25e[_0x4803b1(0x203)](_0x520004)){const _0x11e0b0=a109_0x5bd25e[_0x4803b1(0x1c1)](_0x520004),_0x3b9e8a=_0x11e0b0[_0x4803b1(0x18b)](_0x5f0d05=>{const _0x410f8d=_0x4803b1,_0x98ed1=a109_0x4e6e83[_0x410f8d(0x1b9)](_0x520004,_0x5f0d05);return a109_0x5bd25e[_0x410f8d(0x243)](_0x98ed1)[_0x410f8d(0x1ba)]();})[_0x4803b1(0x17c)]((_0x45186d,_0x49a173)=>_0x45186d[_0x4803b1(0x198)](_0x49a173));for(const _0x343809 of _0x3b9e8a){const _0x2a31de=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x520004,_0x343809);_0x25d624+=_0x4803b1(0x24e)+_0x343809+_0x4803b1(0x1cc)+a109_0x5bd25e[_0x4803b1(0x174)](_0x2a31de,_0x4803b1(0x1ef))+'\x0a';}}const _0x16179f=generateDiff(_0x25d624,_0x39f39b);_0x44e4a6=hasChanges(_0x16179f),_0x44e4a6&&(_0x1bcb03=formatDiffWithColors(_0x16179f));}_0x16cb04['push']({'path':_0x4d5e0c,'content':'','isDir':!![]}),_0x16cb04['push']({'path':_0x37bdd3,'content':_0x559ba6}),_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x254013,'content':_0x1104bc[_0x4803b1(0x24a)]});if(_0x1104bc[_0x4803b1(0x249)]['length']>0x0){_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x520004,'content':'','isDir':!![]});for(const _0x2024d4 of _0x1104bc['files']){const _0x36cffb=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x520004,_0x2024d4[_0x4803b1(0x147)]);_0x16cb04[_0x4803b1(0x1cb)]({'path':_0x36cffb,'content':_0x2024d4[_0x4803b1(0x178)]});}}if(a109_0x5bd25e['existsSync'](_0x520004)){const _0x1acc2b=a109_0x5bd25e[_0x4803b1(0x1c1)](_0x520004),_0x38c620=new Set(_0x1104bc[_0x4803b1(0x249)]['map'](_0x5c0716=>_0x5c0716['file_name']));for(const _0x2097ae of _0x1acc2b){const _0x550dc7=a109_0x4e6e83[_0x4803b1(0x1b9)](_0x520004,_0x2097ae);a109_0x5bd25e[_0x4803b1(0x243)](_0x550dc7)[_0x4803b1(0x1ba)]()&&!_0x38c620[_0x4803b1(0x1ae)](_0x2097ae)&&_0x4df7e1[_0x4803b1(0x1cb)]({'path':_0x550dc7});}}_0x2e0924[_0x4803b1(0x1d0)][_0x4803b1(0x1cb)]({'name':_0x474e5e[_0x4803b1(0x1a2)][_0x4803b1(0x1e2)],'outputPath':_0x4d5e0c,'isNew':_0x3e6377,'hasChanges':_0x44e4a6,'diff':_0x1bcb03}),_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x1d0)][_0x4803b1(0x1db)]++;if(_0x3e6377)_0x2e0924[_0x4803b1(0x152)]['experimentalArtifacts'][_0x4803b1(0x220)]++;else{if(_0x44e4a6)_0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x1d0)][_0x4803b1(0x206)]++;else _0x2e0924[_0x4803b1(0x152)][_0x4803b1(0x1d0)][_0x4803b1(0x222)]++;}}if(_0x367aef?.[_0x4803b1(0x193)])return _0x2e0924;a109_0x5bd25e[_0x4803b1(0x1e5)](_0x209fa6,{'recursive':!![]}),a109_0x5bd25e[_0x4803b1(0x1e5)](getKnowledgeBasesDir(_0x209fa6),{'recursive':!![]}),a109_0x5bd25e[_0x4803b1(0x1e5)](getPromptsDir(_0x209fa6),{'recursive':!![]}),a109_0x5bd25e[_0x4803b1(0x1e5)](getIntegrationsDir(_0x209fa6),{'recursive':!![]}),a109_0x5bd25e[_0x4803b1(0x1e5)](getExperimentalKnowledgeBasesDir(_0x209fa6),{'recursive':!![]}),a109_0x5bd25e['mkdirSync'](getExperimentalArtifactsDir(_0x209fa6),{'recursive':!![]});const _0x3b690c=a109_0x4e6e83['join'](_0x209fa6,_0x4803b1(0x1e7));a109_0x5bd25e['writeFileSync'](_0x3b690c,createAgentConfigContent(_0x194729));for(const _0x2105de of _0x16cb04){if(_0x2105de[_0x4803b1(0x1c9)])a109_0x5bd25e[_0x4803b1(0x1e5)](_0x2105de[_0x4803b1(0x205)],{'recursive':!![]});else{const _0x438f6f=a109_0x4e6e83[_0x4803b1(0x212)](_0x2105de[_0x4803b1(0x205)]);!a109_0x5bd25e[_0x4803b1(0x203)](_0x438f6f)&&a109_0x5bd25e['mkdirSync'](_0x438f6f,{'recursive':!![]}),a109_0x5bd25e[_0x4803b1(0x182)](_0x2105de['path'],_0x2105de[_0x4803b1(0x23b)]);}}for(const _0xfcb95b of _0x4df7e1){_0xfcb95b[_0x4803b1(0x1c9)]?(a109_0x5bd25e[_0x4803b1(0x235)](_0xfcb95b[_0x4803b1(0x205)],{'recursive':!![],'force':!![]}),this[_0x4803b1(0x1eb)][_0x4803b1(0x19c)](_0x4803b1(0x1d6)+a109_0x4e6e83['basename'](a109_0x4e6e83[_0x4803b1(0x212)](_0xfcb95b['path']))+'/'+a109_0x4e6e83[_0x4803b1(0x1c4)](_0xfcb95b[_0x4803b1(0x205)]))):(a109_0x5bd25e[_0x4803b1(0x235)](_0xfcb95b[_0x4803b1(0x205)],{'force':!![]}),this[_0x4803b1(0x1eb)][_0x4803b1(0x19c)](_0x4803b1(0x237)+a109_0x4e6e83[_0x4803b1(0x1c4)](a109_0x4e6e83['dirname'](_0xfcb95b['path']))+'/'+a109_0x4e6e83[_0x4803b1(0x1c4)](_0xfcb95b[_0x4803b1(0x205)])));}return _0x2e0924;}async[a109_0x4fde2b(0x146)](_0xba00b9,_0xa2c3f0){const _0x1ff602=a109_0x4fde2b,_0x4a56c8=a109_0x4e6e83[_0x1ff602(0x1b9)](_0xba00b9,_0x1ff602(0x1e7));if(!a109_0x5bd25e[_0x1ff602(0x203)](_0x4a56c8))throw new SDKError(ErrorCode[_0x1ff602(0x1ca)],_0x1ff602(0x14d)+_0xba00b9,undefined,{'helpText':_0x1ff602(0x211)});const _0x65b439=loadAgentConfig(_0x4a56c8),_0x58dd58=await this[_0x1ff602(0x154)](_0x65b439[_0x1ff602(0x1f7)]),_0x25ac6a=await this['client'][_0x1ff602(0x14b)](_0x58dd58),_0x5f06fd=_0x25ac6a[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)],_0x3b22e2={'projectName':_0x5f06fd,'projectId':_0x58dd58,'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}}},_0xdd731b=[],_0x48ae68=[],_0x1cbce8=[],_0x4ca5bc=[],_0x198baa=[],_0x169f03=[],_0x2d1eb1=a109_0x5bd25e[_0x1ff602(0x1c1)](_0xba00b9,{'withFileTypes':!![]});for(const _0x36fd3b of _0x2d1eb1){if(!_0x36fd3b[_0x1ff602(0x15b)]())continue;if([_0x1ff602(0x221),_0x1ff602(0x217),_0x1ff602(0x245),_0x1ff602(0x20e),_0x1ff602(0x20c)][_0x1ff602(0x189)](_0x36fd3b[_0x1ff602(0x1e2)]))continue;const _0xe6d0be=a109_0x4e6e83['join'](_0xba00b9,_0x36fd3b[_0x1ff602(0x1e2)]);if(isAgentDir(_0xe6d0be)){const _0x5763d7=a109_0x4e6e83[_0x1ff602(0x1b9)](_0xe6d0be,_0x1ff602(0x18c)),_0x4a2236=a109_0x4e6e83['join'](_0xe6d0be,'prompt.md'),_0x5704e2=a109_0x4e6e83[_0x1ff602(0x1b9)](_0xe6d0be,_0x1ff602(0x1e1)),_0xecc688=parseAgentYaml(a109_0x5bd25e[_0x1ff602(0x174)](_0x5763d7,_0x1ff602(0x1ef)),_0x5763d7),_0x3a5cc5=a109_0x5bd25e[_0x1ff602(0x203)](_0x4a2236)?a109_0x5bd25e[_0x1ff602(0x174)](_0x4a2236,_0x1ff602(0x1ef)):'',_0x14f8cd=a109_0x5bd25e[_0x1ff602(0x203)](_0x5704e2)?a109_0x5bd25e['readFileSync'](_0x5704e2,_0x1ff602(0x1ef)):_0xecc688[_0x1ff602(0x200)];_0xdd731b['push']({'name':_0xecc688[_0x1ff602(0x1e2)],'dir':_0xe6d0be,'yaml':_0xecc688,'systemPrompt':_0x3a5cc5,'starterMessage':_0x14f8cd});}}const _0x4bb5ad=getKnowledgeBasesDir(_0xba00b9);if(a109_0x5bd25e[_0x1ff602(0x203)](_0x4bb5ad)){const _0x529617=a109_0x5bd25e['readdirSync'](_0x4bb5ad);for(const _0x5aec64 of _0x529617){const _0x47715e=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x4bb5ad,_0x5aec64);if(_0x5aec64[_0x1ff602(0x13e)](_0x1ff602(0x252))){const _0xa59efd=parseKnowledgeBaseYaml(a109_0x5bd25e['readFileSync'](_0x47715e,_0x1ff602(0x1ef)),_0x47715e);_0x48ae68[_0x1ff602(0x1cb)]({'name':_0xa59efd[_0x1ff602(0x1e2)],'path':_0x47715e,'yaml':_0xa59efd});}else{if(_0x5aec64[_0x1ff602(0x13e)](_0x1ff602(0x24d))){const _0x358cc1=a109_0x5bd25e['readFileSync'](_0x47715e,_0x1ff602(0x1ef)),{name:_0x275596,text:_0x12a24f}=parseTextKnowledgeBaseMd(_0x358cc1,_0x5aec64);_0x1cbce8[_0x1ff602(0x1cb)]({'name':_0x275596,'path':_0x47715e,'text':_0x12a24f});}}}}const _0xf2365=getPromptsDir(_0xba00b9);if(a109_0x5bd25e[_0x1ff602(0x203)](_0xf2365)){const _0x538587=a109_0x5bd25e[_0x1ff602(0x1c1)](_0xf2365)[_0x1ff602(0x18b)](_0x329c83=>_0x329c83[_0x1ff602(0x13e)]('.yml'));for(const _0x4ad627 of _0x538587){const _0x4374e5=a109_0x4e6e83[_0x1ff602(0x1b9)](_0xf2365,_0x4ad627),_0x5939e7=parsePromptYaml(a109_0x5bd25e[_0x1ff602(0x174)](_0x4374e5,_0x1ff602(0x1ef)),_0x4374e5);_0x4ca5bc['push']({'name':_0x5939e7[_0x1ff602(0x1e2)],'path':_0x4374e5,'yaml':_0x5939e7});}}const _0x175899=[],_0x1c4f42=getIntegrationsDir(_0xba00b9);if(a109_0x5bd25e['existsSync'](_0x1c4f42)){const _0x4be4ab=a109_0x5bd25e[_0x1ff602(0x1c1)](_0x1c4f42)[_0x1ff602(0x18b)](_0x136e73=>_0x136e73[_0x1ff602(0x13e)](_0x1ff602(0x252)));for(const _0x119692 of _0x4be4ab){const _0x4e1820=a109_0x4e6e83['join'](_0x1c4f42,_0x119692),_0x3f5623=parseIntegrationYaml(a109_0x5bd25e[_0x1ff602(0x174)](_0x4e1820,_0x1ff602(0x1ef)),_0x4e1820);if(!SAFE_INTEGRATION_TYPES['includes'](_0x3f5623['service_type'][_0x1ff602(0x22f)]())){this['logger'][_0x1ff602(0x192)]('Skipping\x20integration\x20\x27'+_0x3f5623[_0x1ff602(0x1e2)]+_0x1ff602(0x1fa)+_0x3f5623[_0x1ff602(0x20d)]+_0x1ff602(0x168)+(_0x1ff602(0x240)+SAFE_INTEGRATION_TYPES['join'](',\x20')+_0x1ff602(0x1f2))+'Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.');continue;}_0x175899['push']({'name':_0x3f5623[_0x1ff602(0x1e2)],'path':_0x4e1820,'yaml':_0x3f5623});}}const _0x35e18b=getExperimentalKnowledgeBasesDir(_0xba00b9);if(a109_0x5bd25e[_0x1ff602(0x203)](_0x35e18b)){const _0x3aa7e2=a109_0x5bd25e[_0x1ff602(0x1c1)](_0x35e18b,{'withFileTypes':!![]});for(const _0x504c01 of _0x3aa7e2){if(!_0x504c01[_0x1ff602(0x15b)]())continue;const _0x20d584=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x35e18b,_0x504c01[_0x1ff602(0x1e2)]),_0x8ad627=a109_0x4e6e83['join'](_0x20d584,_0x504c01['name']+'.yml'),_0x225197=a109_0x4e6e83['join'](_0x20d584,'functions');if(!a109_0x5bd25e[_0x1ff602(0x203)](_0x8ad627))continue;const _0x56cb14=parseExperimentalKnowledgeBaseYaml(a109_0x5bd25e[_0x1ff602(0x174)](_0x8ad627,_0x1ff602(0x1ef)),_0x8ad627),_0x26440a=[];if(a109_0x5bd25e[_0x1ff602(0x203)](_0x225197)){const _0xc98dd2=a109_0x5bd25e[_0x1ff602(0x1c1)](_0x225197,{'withFileTypes':!![]});for(const _0x226356 of _0xc98dd2){if(!_0x226356['isDirectory']())continue;const _0xb9f436=a109_0x4e6e83['join'](_0x225197,_0x226356[_0x1ff602(0x1e2)]),_0xf2c8a0=a109_0x4e6e83[_0x1ff602(0x1b9)](_0xb9f436,_0x1ff602(0x1d9)),_0x37f55=a109_0x4e6e83[_0x1ff602(0x1b9)](_0xb9f436,_0x1ff602(0x186));a109_0x5bd25e[_0x1ff602(0x203)](_0xf2c8a0)&&a109_0x5bd25e[_0x1ff602(0x203)](_0x37f55)&&_0x26440a['push']({'name':_0x226356[_0x1ff602(0x1e2)],'code':a109_0x5bd25e['readFileSync'](_0xf2c8a0,_0x1ff602(0x1ef)),'json_schema':a109_0x5bd25e[_0x1ff602(0x174)](_0x37f55,_0x1ff602(0x1ef))});}}const _0x4e20f7={..._0x56cb14,'variables':_0x56cb14['variables']||[],'functions':_0x26440a};_0x198baa['push']({'name':_0x56cb14[_0x1ff602(0x1e2)],'dir':_0x20d584,'def':_0x4e20f7});}}const _0x9d776a=getExperimentalArtifactsDir(_0xba00b9);if(a109_0x5bd25e[_0x1ff602(0x203)](_0x9d776a)){const _0x563a11=a109_0x5bd25e[_0x1ff602(0x1c1)](_0x9d776a,{'withFileTypes':!![]});for(const _0x5c72ec of _0x563a11){if(!_0x5c72ec[_0x1ff602(0x15b)]())continue;const _0x154258=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x9d776a,_0x5c72ec[_0x1ff602(0x1e2)]),_0x52e61f=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x154258,_0x5c72ec[_0x1ff602(0x1e2)]+_0x1ff602(0x252)),_0x359c15=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x154258,_0x1ff602(0x1d9)),_0x4d0c1e=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x154258,_0x1ff602(0x249));if(!a109_0x5bd25e[_0x1ff602(0x203)](_0x52e61f)||!a109_0x5bd25e['existsSync'](_0x359c15))continue;const _0x44404d=parseExperimentalArtifactYaml(a109_0x5bd25e[_0x1ff602(0x174)](_0x52e61f,_0x1ff602(0x1ef)),_0x52e61f),_0x33f45a=a109_0x5bd25e[_0x1ff602(0x174)](_0x359c15,_0x1ff602(0x1ef)),_0x1e68ca=[];if(a109_0x5bd25e[_0x1ff602(0x203)](_0x4d0c1e)){const _0x59ff15=a109_0x5bd25e[_0x1ff602(0x1c1)](_0x4d0c1e);for(const _0x4b8471 of _0x59ff15){const _0x2f017d=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x4d0c1e,_0x4b8471);a109_0x5bd25e[_0x1ff602(0x243)](_0x2f017d)[_0x1ff602(0x1ba)]()&&_0x1e68ca[_0x1ff602(0x1cb)]({'file_name':_0x4b8471,'text_content':a109_0x5bd25e[_0x1ff602(0x174)](_0x2f017d,'utf-8')});}}const _0x115373={..._0x44404d,'code':_0x33f45a,'files':_0x1e68ca};_0x169f03[_0x1ff602(0x1cb)]({'name':_0x44404d['name'],'dir':_0x154258,'def':_0x115373});}}const _0x31f577=await this[_0x1ff602(0x181)][_0x1ff602(0x1a7)](_0x58dd58),_0x321ab7=await this[_0x1ff602(0x181)]['listKnowledgeBases'](_0x58dd58),_0xbf4657=await this[_0x1ff602(0x181)][_0x1ff602(0x1a3)](_0x58dd58),_0x4544ff=await this[_0x1ff602(0x181)]['listPrompts'](_0x58dd58),_0x2d61d9=await this[_0x1ff602(0x181)]['listIntegrations'](_0x58dd58),_0x4da7f7=await safeListOrEmpty(()=>this[_0x1ff602(0x181)][_0x1ff602(0x238)](_0x58dd58)),_0x308d9d=await safeListOrEmpty(()=>this['client']['listExperimentalArtifacts'](_0x58dd58)),_0x1d1d08=await fetchAllToolTargetMaps((_0xfeff75,_0x9119)=>this['client'][_0x1ff602(0x23e)](_0xfeff75,_0x9119),_0x58dd58),_0x43a195=new Map(),_0x522dbc=new Map(),_0x186a0a=new Map(),_0x59ed39=new Map(),_0x5f5919=new Map(),_0x1e3720=new Map(),_0x1c1a5d=new Map();for(const _0x490e72 of _0x31f577){_0x43a195[_0x1ff602(0x21f)](_0x490e72['attributes'][_0x1ff602(0x1e2)],_0x490e72);}for(const _0x52ce99 of _0x321ab7){_0x522dbc[_0x1ff602(0x21f)](_0x52ce99[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)],_0x52ce99);}for(const _0x1c3423 of _0xbf4657){_0x186a0a[_0x1ff602(0x21f)](_0x1c3423[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)],_0x1c3423);}for(const _0x498d86 of _0x4544ff){_0x59ed39[_0x1ff602(0x21f)](_0x498d86[_0x1ff602(0x1a2)]['name'],_0x498d86);}for(const _0x13d008 of _0x2d61d9){_0x5f5919[_0x1ff602(0x21f)](_0x13d008[_0x1ff602(0x1a2)][_0x1ff602(0x16c)][_0x1ff602(0x22f)](),_0x13d008);}for(const _0x34910b of _0x4da7f7){_0x1e3720[_0x1ff602(0x21f)](_0x34910b['attributes'][_0x1ff602(0x1e2)],_0x34910b);}for(const _0x28cb94 of _0x308d9d){_0x1c1a5d[_0x1ff602(0x21f)](_0x28cb94[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)],_0x28cb94);}const _0x271a8b=new Map(),_0x5b5762=new Map();for(const _0x23ada6 of _0x31f577){_0x271a8b[_0x1ff602(0x21f)](_0x23ada6[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)],_0x23ada6['id']),_0x5b5762[_0x1ff602(0x21f)](_0x23ada6['id'],_0x23ada6[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)]);}const _0x5bb913=new Map(),_0xabc8e3=new Map();for(const _0x2bc941 of _0x4544ff){_0x5bb913[_0x1ff602(0x21f)](_0x2bc941[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)],_0x2bc941['id']),_0xabc8e3[_0x1ff602(0x21f)](_0x2bc941['id'],_0x2bc941[_0x1ff602(0x1a2)]['name']);}const _0x57e90b=_0x1d1d08[_0x1ff602(0x23f)][_0x1ff602(0x180)]||new Map(),_0x540ef6=_0x1d1d08[_0x1ff602(0x23f)][_0x1ff602(0x17e)]||new Map(),_0x15bd76=_0x1d1d08[_0x1ff602(0x23f)][_0x1ff602(0x1c7)]||new Map(),_0x512c7f=new Map(),_0x408fb2={'resolveToolTargetName':buildNameResolver({..._0x1d1d08[_0x1ff602(0x253)],'Agent':_0x5b5762}),'resolvePromptName':async _0x5e0794=>_0xabc8e3[_0x1ff602(0x161)](_0x5e0794),'onWarning':_0x4a6236=>this['logger'][_0x1ff602(0x192)](_0x4a6236)};let _0x429ec7=[];const _0x50c575={'projectId':_0x58dd58,'resolveToolTargetId':buildIdResolver({..._0x1d1d08[_0x1ff602(0x23f)],'Agent':_0x271a8b}),'resolvePromptId':async _0x3d1110=>_0x5bb913[_0x1ff602(0x161)](_0x3d1110),'onWarning':_0x1717a6=>{const _0x56a154=_0x1ff602;this[_0x56a154(0x1eb)]['warn'](_0x1717a6),_0x429ec7['push'](_0x1717a6);}},{resolved:_0x5d7bd7,unresolved:_0x58fc02}=resolveAgentDependencies(_0xdd731b,new Set(_0x43a195[_0x1ff602(0x1c6)]()));for(const {agent:_0x3a534b,missingDeps:_0x344c5c}of _0x58fc02){_0x3b22e2[_0x1ff602(0x1a1)]['push']({'agentName':_0x3a534b['yaml'][_0x1ff602(0x1e2)],'action':_0x1ff602(0x1ce),'error':'Unresolved\x20dependencies:\x20'+_0x344c5c['join'](',\x20')+'.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.'}),_0x3b22e2[_0x1ff602(0x152)]['agents']['errors']++;}for(const _0x1e1008 of _0x48ae68){const _0x3ca6c3=_0x522dbc[_0x1ff602(0x161)](_0x1e1008['yaml'][_0x1ff602(0x1e2)]),_0x48acce=a109_0x5bd25e[_0x1ff602(0x174)](_0x1e1008['path'],'utf-8');if(_0x3ca6c3){const _0x33b8ee=apiKnowledgeBaseToYaml(_0x3ca6c3),_0x3b0e35=toKnowledgeBaseYamlString(_0x33b8ee),_0x312b2b=generateDiff(_0x3b0e35,_0x48acce),_0x57e652=hasChanges(_0x312b2b);_0x57e652?(_0x3b22e2[_0x1ff602(0x15d)][_0x1ff602(0x1cb)]({'name':_0x1e1008[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x206),'id':_0x3ca6c3['id'],'diff':formatDiffWithColors(_0x312b2b)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x15d)][_0x1ff602(0x206)]++):(_0x3b22e2[_0x1ff602(0x15d)][_0x1ff602(0x1cb)]({'name':_0x1e1008[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x222),'id':_0x3ca6c3['id']}),_0x3b22e2['counts'][_0x1ff602(0x15d)]['unchanged']++);}else _0x3b22e2['knowledgeBases'][_0x1ff602(0x1cb)]({'name':_0x1e1008[_0x1ff602(0x223)]['name'],'action':'created'}),_0x3b22e2['counts'][_0x1ff602(0x15d)][_0x1ff602(0x216)]++;}for(const _0x2330a1 of _0x1cbce8){const _0x38a776=_0x186a0a[_0x1ff602(0x161)](_0x2330a1[_0x1ff602(0x1e2)]),_0x154c31=a109_0x5bd25e[_0x1ff602(0x174)](_0x2330a1[_0x1ff602(0x205)],_0x1ff602(0x1ef));if(_0x38a776){const _0x5a223e=toTextKnowledgeBaseMd(_0x38a776[_0x1ff602(0x1a2)][_0x1ff602(0x1e2)],_0x38a776['attributes']['text']),_0x58eeb8=generateDiff(_0x5a223e,_0x154c31),_0x2ebc15=hasChanges(_0x58eeb8);_0x2ebc15?(_0x3b22e2['textKnowledgeBases'][_0x1ff602(0x1cb)]({'name':_0x2330a1['name'],'action':_0x1ff602(0x206),'id':_0x38a776['id'],'diff':formatDiffWithColors(_0x58eeb8)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x22d)]['updated']++):(_0x3b22e2[_0x1ff602(0x22d)][_0x1ff602(0x1cb)]({'name':_0x2330a1[_0x1ff602(0x1e2)],'action':_0x1ff602(0x222),'id':_0x38a776['id']}),_0x3b22e2[_0x1ff602(0x152)]['textKnowledgeBases'][_0x1ff602(0x222)]++);}else _0x3b22e2['textKnowledgeBases'][_0x1ff602(0x1cb)]({'name':_0x2330a1[_0x1ff602(0x1e2)],'action':'created'}),_0x3b22e2['counts']['textKnowledgeBases'][_0x1ff602(0x216)]++;}for(const _0x2b6c63 of _0x5d7bd7){const _0x4f9402=_0x43a195[_0x1ff602(0x161)](_0x2b6c63['yaml']['name']),_0x3f4220=a109_0x4e6e83[_0x1ff602(0x1b9)](_0x2b6c63[_0x1ff602(0x194)],_0x1ff602(0x18c)),_0xdbda79=a109_0x5bd25e[_0x1ff602(0x174)](_0x3f4220,'utf-8'),_0x4abbec=_0x2b6c63[_0x1ff602(0x1d1)],_0x559c11=_0x1ff602(0x232)+_0x4abbec+'\x0a\x0a#\x20agent.yml\x0a'+_0xdbda79;if(_0x4f9402){const {yaml:_0x2f7f5d,systemPrompt:_0x1a0dae}=await agentResponseToDef(_0x4f9402,_0x408fb2),_0x3e78c5=toAgentYamlString(_0x2f7f5d),_0x28b74f='#\x20prompt.md\x0a'+_0x1a0dae+'\x0a\x0a#\x20agent.yml\x0a'+_0x3e78c5,_0x7388c=generateDiff(_0x28b74f,_0x559c11),_0x5412cf=hasChanges(_0x7388c);_0x5412cf?(_0x3b22e2[_0x1ff602(0x1a1)][_0x1ff602(0x1cb)]({'agentName':_0x2b6c63[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':'updated','agentId':_0x4f9402['id'],'diff':formatDiffWithColors(_0x7388c)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x1a1)][_0x1ff602(0x206)]++):(_0x3b22e2[_0x1ff602(0x1a1)][_0x1ff602(0x1cb)]({'agentName':_0x2b6c63[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':'unchanged','agentId':_0x4f9402['id']}),_0x3b22e2['counts']['agents']['unchanged']++);}else _0x3b22e2[_0x1ff602(0x1a1)][_0x1ff602(0x1cb)]({'agentName':_0x2b6c63[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':'created'}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x1a1)][_0x1ff602(0x216)]++;}for(const _0x443349 of _0x4ca5bc){const _0x5b9df4=_0x59ed39['get'](_0x443349[_0x1ff602(0x223)]['name']),_0x519bfa=a109_0x5bd25e[_0x1ff602(0x174)](_0x443349[_0x1ff602(0x205)],_0x1ff602(0x1ef));if(_0x5b9df4){const _0x492308=await apiPromptToYaml(_0x5b9df4,_0x408fb2);if(!_0x492308){_0x3b22e2[_0x1ff602(0x217)][_0x1ff602(0x1cb)]({'name':_0x443349[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':'updated','id':_0x5b9df4['id']}),_0x3b22e2['counts'][_0x1ff602(0x217)]['updated']++;continue;}const _0x2847e9=toPromptYamlString(_0x492308),_0x51cf00=generateDiff(_0x2847e9,_0x519bfa),_0x30ab97=hasChanges(_0x51cf00);_0x30ab97?(_0x3b22e2[_0x1ff602(0x217)][_0x1ff602(0x1cb)]({'name':_0x443349[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x206),'id':_0x5b9df4['id'],'diff':formatDiffWithColors(_0x51cf00)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x217)][_0x1ff602(0x206)]++):(_0x3b22e2['prompts'][_0x1ff602(0x1cb)]({'name':_0x443349[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x222),'id':_0x5b9df4['id']}),_0x3b22e2[_0x1ff602(0x152)]['prompts'][_0x1ff602(0x222)]++);}else _0x3b22e2[_0x1ff602(0x217)]['push']({'name':_0x443349[_0x1ff602(0x223)]['name'],'action':_0x1ff602(0x216)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x217)][_0x1ff602(0x216)]++;}for(const _0x44141d of _0x175899){const _0x483c2e=_0x5f5919[_0x1ff602(0x161)](_0x44141d['yaml'][_0x1ff602(0x20d)]),_0x41311f=a109_0x5bd25e[_0x1ff602(0x174)](_0x44141d[_0x1ff602(0x205)],_0x1ff602(0x1ef));if(_0x483c2e){const _0xb694bf=await apiIntegrationToYaml(_0x483c2e,_0x408fb2),_0x1bc1a9=toIntegrationYamlString(_0xb694bf),_0x10b584=generateDiff(_0x1bc1a9,_0x41311f),_0x49f31f=hasChanges(_0x10b584);_0x49f31f?(_0x3b22e2['integrations'][_0x1ff602(0x1cb)]({'name':_0x44141d[_0x1ff602(0x223)][_0x1ff602(0x20d)],'action':_0x1ff602(0x206),'id':_0x483c2e['id'],'diff':formatDiffWithColors(_0x10b584)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x245)][_0x1ff602(0x206)]++):(_0x3b22e2[_0x1ff602(0x245)][_0x1ff602(0x1cb)]({'name':_0x44141d[_0x1ff602(0x223)][_0x1ff602(0x20d)],'action':'unchanged','id':_0x483c2e['id']}),_0x3b22e2[_0x1ff602(0x152)]['integrations'][_0x1ff602(0x222)]++);}else _0x3b22e2[_0x1ff602(0x245)][_0x1ff602(0x1cb)]({'name':_0x44141d[_0x1ff602(0x223)]['service_type'],'action':_0x1ff602(0x216)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x245)][_0x1ff602(0x216)]++;}for(const _0x5655cb of _0x198baa){const _0x3ff70b=_0x1e3720[_0x1ff602(0x161)](_0x5655cb[_0x1ff602(0x15a)]['name']),_0x2d9adc=toExperimentalKnowledgeBaseYamlString(_0x5655cb['def']);let _0x45427e=_0x2d9adc;for(const _0x3a734c of _0x5655cb[_0x1ff602(0x15a)][_0x1ff602(0x163)]){_0x45427e+='\x0a---\x20function:\x20'+_0x3a734c[_0x1ff602(0x1e2)]+_0x1ff602(0x1cc)+_0x3a734c[_0x1ff602(0x24a)]+_0x1ff602(0x195)+_0x3a734c[_0x1ff602(0x1e2)]+'\x20---\x0a'+_0x3a734c[_0x1ff602(0x144)]+'\x0a';}if(_0x3ff70b){const _0x923b3a=apiExperimentalKnowledgeBaseToYaml(_0x3ff70b),_0x40d0e6=toExperimentalKnowledgeBaseYamlString(_0x923b3a);let _0x3f8a00=_0x40d0e6;for(const _0x548a75 of _0x923b3a[_0x1ff602(0x163)]){_0x3f8a00+=_0x1ff602(0x14a)+_0x548a75[_0x1ff602(0x1e2)]+_0x1ff602(0x1cc)+_0x548a75[_0x1ff602(0x24a)]+_0x1ff602(0x195)+_0x548a75[_0x1ff602(0x1e2)]+'\x20---\x0a'+_0x548a75[_0x1ff602(0x144)]+'\x0a';}const _0x140eb9=generateDiff(_0x3f8a00,_0x45427e),_0x14fb4d=hasChanges(_0x140eb9);_0x14fb4d?(_0x3b22e2[_0x1ff602(0x229)][_0x1ff602(0x1cb)]({'name':_0x5655cb[_0x1ff602(0x15a)]['name'],'action':_0x1ff602(0x206),'id':_0x3ff70b['id'],'diff':formatDiffWithColors(_0x140eb9)}),_0x3b22e2['counts'][_0x1ff602(0x229)][_0x1ff602(0x206)]++):(_0x3b22e2[_0x1ff602(0x229)][_0x1ff602(0x1cb)]({'name':_0x5655cb[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x222),'id':_0x3ff70b['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x229)][_0x1ff602(0x222)]++);}else _0x3b22e2[_0x1ff602(0x229)][_0x1ff602(0x1cb)]({'name':_0x5655cb[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x216)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x229)][_0x1ff602(0x216)]++;}for(const _0x1558e5 of _0x169f03){const _0x5276f9=_0x1c1a5d[_0x1ff602(0x161)](_0x1558e5[_0x1ff602(0x15a)]['name']),_0x16cb74=toExperimentalArtifactYamlString(_0x1558e5[_0x1ff602(0x15a)]);let _0x12442b=_0x16cb74+(_0x1ff602(0x24b)+_0x1558e5[_0x1ff602(0x15a)][_0x1ff602(0x24a)]+'\x0a');for(const _0x1cc30c of _0x1558e5[_0x1ff602(0x15a)][_0x1ff602(0x249)]){_0x12442b+=_0x1ff602(0x24e)+_0x1cc30c[_0x1ff602(0x147)]+_0x1ff602(0x1cc)+_0x1cc30c['text_content']+'\x0a';}if(_0x5276f9){const _0x417967=apiExperimentalArtifactToYaml(_0x5276f9),_0x35c018=toExperimentalArtifactYamlString(_0x417967);let _0x25d9a8=_0x35c018+(_0x1ff602(0x24b)+_0x417967[_0x1ff602(0x24a)]+'\x0a');for(const _0x24b15c of _0x417967[_0x1ff602(0x249)]){_0x25d9a8+=_0x1ff602(0x24e)+_0x24b15c[_0x1ff602(0x147)]+_0x1ff602(0x1cc)+_0x24b15c['text_content']+'\x0a';}const _0x457c68=generateDiff(_0x25d9a8,_0x12442b),_0x3aafba=hasChanges(_0x457c68);_0x3aafba?(_0x3b22e2[_0x1ff602(0x1d0)][_0x1ff602(0x1cb)]({'name':_0x1558e5[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],'action':'updated','id':_0x5276f9['id'],'diff':formatDiffWithColors(_0x457c68)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x1d0)][_0x1ff602(0x206)]++):(_0x3b22e2[_0x1ff602(0x1d0)]['push']({'name':_0x1558e5[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x222),'id':_0x5276f9['id']}),_0x3b22e2['counts'][_0x1ff602(0x1d0)][_0x1ff602(0x222)]++);}else _0x3b22e2['experimentalArtifacts'][_0x1ff602(0x1cb)]({'name':_0x1558e5[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x216)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x1d0)][_0x1ff602(0x216)]++;}if(_0xa2c3f0?.[_0x1ff602(0x193)])return _0x3b22e2;_0x3b22e2[_0x1ff602(0x15d)]=[],_0x3b22e2[_0x1ff602(0x22d)]=[],_0x3b22e2[_0x1ff602(0x217)]=[],_0x3b22e2[_0x1ff602(0x245)]=[],_0x3b22e2[_0x1ff602(0x229)]=[],_0x3b22e2[_0x1ff602(0x1d0)]=[];const _0x1609fd=_0x3b22e2[_0x1ff602(0x1a1)][_0x1ff602(0x18b)](_0x8b1a3f=>_0x8b1a3f[_0x1ff602(0x1e8)]===_0x1ff602(0x1ce));_0x3b22e2[_0x1ff602(0x1a1)]=_0x1609fd,_0x3b22e2[_0x1ff602(0x152)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x1609fd['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 _0xeddc6b of _0x48ae68){try{const _0x2c9d7b=_0x522dbc[_0x1ff602(0x161)](_0xeddc6b[_0x1ff602(0x223)][_0x1ff602(0x1e2)]),_0xb26c1=yamlKnowledgeBaseToApi(_0xeddc6b[_0x1ff602(0x223)],_0x58dd58);if(_0x2c9d7b)await this[_0x1ff602(0x181)][_0x1ff602(0x173)](_0x2c9d7b['id'],_0xb26c1),_0x57e90b['set'](_0xeddc6b[_0x1ff602(0x223)][_0x1ff602(0x1e2)],_0x2c9d7b['id']),_0x3b22e2[_0x1ff602(0x15d)][_0x1ff602(0x1cb)]({'name':_0xeddc6b[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x206),'id':_0x2c9d7b['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x15d)][_0x1ff602(0x206)]++;else{const _0x162eee=await this[_0x1ff602(0x181)]['createKnowledgeBase'](_0xb26c1);_0x57e90b[_0x1ff602(0x21f)](_0xeddc6b['yaml'][_0x1ff602(0x1e2)],_0x162eee['id']),_0x3b22e2[_0x1ff602(0x15d)][_0x1ff602(0x1cb)]({'name':_0xeddc6b[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x216),'id':_0x162eee['id']}),_0x3b22e2['counts'][_0x1ff602(0x15d)][_0x1ff602(0x216)]++;}}catch(_0x539225){_0x3b22e2['knowledgeBases'][_0x1ff602(0x1cb)]({'name':_0xeddc6b[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':'error','error':_0x539225[_0x1ff602(0x1d3)]}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x15d)]['errors']++;}}for(const _0x455748 of _0x1cbce8){try{const _0x385a5c=_0x186a0a[_0x1ff602(0x161)](_0x455748[_0x1ff602(0x1e2)]),_0x2c1d2d=yamlTextKnowledgeBaseToApi({'name':_0x455748[_0x1ff602(0x1e2)],'text':_0x455748[_0x1ff602(0x1ed)]},_0x58dd58);if(_0x385a5c)await this[_0x1ff602(0x181)][_0x1ff602(0x15e)](_0x385a5c['id'],_0x2c1d2d),_0x540ef6[_0x1ff602(0x21f)](_0x455748[_0x1ff602(0x1e2)],_0x385a5c['id']),_0x3b22e2[_0x1ff602(0x22d)]['push']({'name':_0x455748[_0x1ff602(0x1e2)],'action':'updated','id':_0x385a5c['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x22d)][_0x1ff602(0x206)]++;else{const _0x56aceb=await this[_0x1ff602(0x181)][_0x1ff602(0x184)](_0x2c1d2d);_0x540ef6[_0x1ff602(0x21f)](_0x455748[_0x1ff602(0x1e2)],_0x56aceb['id']),_0x3b22e2['textKnowledgeBases'][_0x1ff602(0x1cb)]({'name':_0x455748['name'],'action':_0x1ff602(0x216),'id':_0x56aceb['id']}),_0x3b22e2['counts'][_0x1ff602(0x22d)][_0x1ff602(0x216)]++;}}catch(_0x273f19){_0x3b22e2[_0x1ff602(0x22d)]['push']({'name':_0x455748[_0x1ff602(0x1e2)],'action':_0x1ff602(0x1ce),'error':_0x273f19['message']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x22d)][_0x1ff602(0x156)]++;}}for(const _0x35dd29 of _0x198baa){try{const _0x4ee201=_0x1e3720[_0x1ff602(0x161)](_0x35dd29['def'][_0x1ff602(0x1e2)]),_0x17ea93=yamlExperimentalKnowledgeBaseToApi(_0x35dd29[_0x1ff602(0x15a)],_0x58dd58);if(_0x4ee201)await this[_0x1ff602(0x181)]['updateExperimentalKnowledgeBase'](_0x4ee201['id'],_0x17ea93),_0x15bd76[_0x1ff602(0x21f)](_0x35dd29[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],_0x4ee201['id']),_0x3b22e2['experimentalKnowledgeBases'][_0x1ff602(0x1cb)]({'name':_0x35dd29['def'][_0x1ff602(0x1e2)],'action':'updated','id':_0x4ee201['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x229)][_0x1ff602(0x206)]++;else{const _0x45cac6=await this['client']['createExperimentalKnowledgeBase'](_0x17ea93);_0x15bd76['set'](_0x35dd29[_0x1ff602(0x15a)]['name'],_0x45cac6['id']),_0x3b22e2[_0x1ff602(0x229)][_0x1ff602(0x1cb)]({'name':_0x35dd29['def'][_0x1ff602(0x1e2)],'action':_0x1ff602(0x216),'id':_0x45cac6['id']}),_0x3b22e2[_0x1ff602(0x152)]['experimentalKnowledgeBases'][_0x1ff602(0x216)]++;}}catch(_0xe6f42d){_0x3b22e2[_0x1ff602(0x229)][_0x1ff602(0x1cb)]({'name':_0x35dd29[_0x1ff602(0x15a)]['name'],'action':_0x1ff602(0x1ce),'error':_0xe6f42d['message']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x229)][_0x1ff602(0x156)]++;}}for(const _0x167ab2 of _0x169f03){try{const _0x3c279f=_0x1c1a5d[_0x1ff602(0x161)](_0x167ab2[_0x1ff602(0x15a)][_0x1ff602(0x1e2)]),_0x33a2ef=yamlExperimentalArtifactToApi(_0x167ab2['def'],_0x58dd58);if(_0x3c279f)await this[_0x1ff602(0x181)][_0x1ff602(0x1d2)](_0x3c279f['id'],_0x33a2ef),_0x512c7f[_0x1ff602(0x21f)](_0x167ab2['def'][_0x1ff602(0x1e2)],_0x3c279f['id']),_0x3b22e2[_0x1ff602(0x1d0)][_0x1ff602(0x1cb)]({'name':_0x167ab2[_0x1ff602(0x15a)]['name'],'action':_0x1ff602(0x206),'id':_0x3c279f['id']}),_0x3b22e2[_0x1ff602(0x152)]['experimentalArtifacts']['updated']++;else{const _0x424163=await this[_0x1ff602(0x181)][_0x1ff602(0x23a)](_0x33a2ef);_0x512c7f[_0x1ff602(0x21f)](_0x167ab2[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],_0x424163['id']),_0x3b22e2['experimentalArtifacts'][_0x1ff602(0x1cb)]({'name':_0x167ab2[_0x1ff602(0x15a)]['name'],'action':_0x1ff602(0x216),'id':_0x424163['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x1d0)][_0x1ff602(0x216)]++;}}catch(_0x3492b5){_0x3b22e2[_0x1ff602(0x1d0)]['push']({'name':_0x167ab2[_0x1ff602(0x15a)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x1ce),'error':_0x3492b5[_0x1ff602(0x1d3)]}),_0x3b22e2[_0x1ff602(0x152)]['experimentalArtifacts'][_0x1ff602(0x156)]++;}}for(const _0x462cc4 of _0x5d7bd7){_0x429ec7=[];try{const _0x2ef823=_0x43a195['get'](_0x462cc4[_0x1ff602(0x223)][_0x1ff602(0x1e2)]),_0x3eee7b=await agentDefToRequest(_0x462cc4[_0x1ff602(0x223)],_0x462cc4[_0x1ff602(0x1d1)],_0x462cc4[_0x1ff602(0x1e9)],_0x50c575);if(_0x2ef823)await this[_0x1ff602(0x181)][_0x1ff602(0x244)](_0x2ef823['id'],_0x3eee7b),_0x271a8b['set'](_0x462cc4['yaml'][_0x1ff602(0x1e2)],_0x2ef823['id']),_0x3b22e2[_0x1ff602(0x1a1)][_0x1ff602(0x1cb)]({'agentName':_0x462cc4[_0x1ff602(0x223)]['name'],'action':'updated','agentId':_0x2ef823['id'],'warnings':_0x429ec7[_0x1ff602(0x1f0)]>0x0?_0x429ec7:undefined}),_0x3b22e2['counts'][_0x1ff602(0x1a1)][_0x1ff602(0x206)]++;else{const _0xa4620f=await this['client']['createAgentResponse'](_0x3eee7b);_0x271a8b[_0x1ff602(0x21f)](_0x462cc4[_0x1ff602(0x223)][_0x1ff602(0x1e2)],_0xa4620f['id']),_0x3b22e2[_0x1ff602(0x1a1)]['push']({'agentName':_0x462cc4[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':'created','agentId':_0xa4620f['id'],'warnings':_0x429ec7[_0x1ff602(0x1f0)]>0x0?_0x429ec7:undefined}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x1a1)][_0x1ff602(0x216)]++;}}catch(_0x117421){_0x3b22e2[_0x1ff602(0x1a1)][_0x1ff602(0x1cb)]({'agentName':_0x462cc4[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x1ce),'error':_0x117421[_0x1ff602(0x1d3)],'warnings':_0x429ec7['length']>0x0?_0x429ec7:undefined}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x1a1)][_0x1ff602(0x156)]++;}}for(const _0x768b47 of _0x4ca5bc){try{const _0x2a964f=_0x59ed39[_0x1ff602(0x161)](_0x768b47[_0x1ff602(0x223)][_0x1ff602(0x1e2)]),_0x44ade6=await yamlPromptToApi(_0x768b47[_0x1ff602(0x223)],_0x58dd58,_0x50c575);if(!_0x44ade6){_0x3b22e2[_0x1ff602(0x217)][_0x1ff602(0x1cb)]({'name':_0x768b47[_0x1ff602(0x223)]['name'],'action':_0x1ff602(0x1ce),'error':_0x1ff602(0x1cf)}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x217)][_0x1ff602(0x156)]++;continue;}if(_0x2a964f)await this[_0x1ff602(0x181)]['updatePrompt'](_0x2a964f['id'],_0x44ade6),_0x5bb913['set'](_0x768b47[_0x1ff602(0x223)][_0x1ff602(0x1e2)],_0x2a964f['id']),_0x3b22e2[_0x1ff602(0x217)][_0x1ff602(0x1cb)]({'name':_0x768b47[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x206),'id':_0x2a964f['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x217)][_0x1ff602(0x206)]++;else{const _0x3134ea=await this['client'][_0x1ff602(0x16a)](_0x44ade6);_0x5bb913[_0x1ff602(0x21f)](_0x768b47[_0x1ff602(0x223)][_0x1ff602(0x1e2)],_0x3134ea['id']),_0x3b22e2[_0x1ff602(0x217)][_0x1ff602(0x1cb)]({'name':_0x768b47[_0x1ff602(0x223)]['name'],'action':'created','id':_0x3134ea['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x217)]['created']++;}}catch(_0x26adcd){_0x3b22e2[_0x1ff602(0x217)][_0x1ff602(0x1cb)]({'name':_0x768b47[_0x1ff602(0x223)][_0x1ff602(0x1e2)],'action':_0x1ff602(0x1ce),'error':_0x26adcd[_0x1ff602(0x1d3)]}),_0x3b22e2[_0x1ff602(0x152)]['prompts'][_0x1ff602(0x156)]++;}}for(const _0x13f304 of _0x175899){try{const _0x5a8bf7=_0x5f5919[_0x1ff602(0x161)](_0x13f304[_0x1ff602(0x223)][_0x1ff602(0x20d)]),_0x2d1e0b=await yamlIntegrationToApi(_0x13f304['yaml'],_0x58dd58,_0x50c575);if(_0x5a8bf7){await this[_0x1ff602(0x181)]['deleteIntegration'](_0x5a8bf7['id']);const _0x4b8481=await this['client'][_0x1ff602(0x1aa)](_0x2d1e0b);_0x3b22e2[_0x1ff602(0x245)][_0x1ff602(0x1cb)]({'name':_0x13f304['yaml'][_0x1ff602(0x20d)],'action':_0x1ff602(0x206),'id':_0x4b8481['id']}),_0x3b22e2[_0x1ff602(0x152)][_0x1ff602(0x245)]['updated']++;}else{const _0xea1aea=await this['client']['createIntegration'](_0x2d1e0b);_0x3b22e2[_0x1ff602(0x245)][_0x1ff602(0x1cb)]({'name':_0x13f304[_0x1ff602(0x223)][_0x1ff602(0x20d)],'action':_0x1ff602(0x216),'id':_0xea1aea['id']}),_0x3b22e2[_0x1ff602(0x152)]['integrations'][_0x1ff602(0x216)]++;}}catch(_0x364ac1){_0x3b22e2['integrations'][_0x1ff602(0x1cb)]({'name':_0x13f304['yaml'][_0x1ff602(0x20d)],'action':_0x1ff602(0x1ce),'error':_0x364ac1[_0x1ff602(0x1d3)]}),_0x3b22e2['counts'][_0x1ff602(0x245)][_0x1ff602(0x156)]++;}}return _0x3b22e2;}async[a109_0x4fde2b(0x19e)](_0xecc7fe,_0x2f1a49,_0x356fa6,_0x28e1bc){const _0x18292d=a109_0x4fde2b,{projectId:_0x1a7c47,project:_0x2d393f}=await this[_0x18292d(0x201)](_0xecc7fe),_0x24ab59=_0x2d393f['attributes'][_0x18292d(0x1e2)],_0x130d5d=await this[_0x18292d(0x181)][_0x18292d(0x1a7)](_0x1a7c47),_0x31a60d=_0x130d5d['find'](_0x2ed3fa=>_0x2ed3fa['attributes'][_0x18292d(0x1e2)]===_0x2f1a49);if(!_0x31a60d)throw new SDKError(ErrorCode[_0x18292d(0x1f4)],_0x18292d(0x140)+_0x2f1a49,undefined,{'helpText':_0x18292d(0x1fc)+_0x130d5d[_0x18292d(0x214)](_0x4abf6f=>_0x4abf6f[_0x18292d(0x1a2)][_0x18292d(0x1e2)])['join'](',\x20')});let _0x1d5a3e;if(_0x356fa6)_0x1d5a3e=_0x356fa6;else{const _0x149bb4=a109_0x4e6e83[_0x18292d(0x1b9)](process[_0x18292d(0x204)](),'agents'),_0x2f15bf=getSanitizedPathWithMigration(_0x149bb4,_0x24ab59);_0x2f15bf[_0x18292d(0x255)]&&this[_0x18292d(0x1eb)][_0x18292d(0x19c)](_0x18292d(0x224)+a109_0x4e6e83['basename'](_0x2f15bf['oldPath'])+_0x18292d(0x1f3)+a109_0x4e6e83[_0x18292d(0x1c4)](_0x2f15bf['path'])),_0x1d5a3e=_0x2f15bf[_0x18292d(0x205)];}const _0x21fd7d=getSanitizedPathWithMigration(_0x1d5a3e,_0x2f1a49);_0x21fd7d[_0x18292d(0x255)]&&this[_0x18292d(0x1eb)]['info']('Renamed\x20agent\x20folder:\x20'+a109_0x4e6e83[_0x18292d(0x1c4)](_0x21fd7d['oldPath'])+_0x18292d(0x1f3)+a109_0x4e6e83['basename'](_0x21fd7d['path']));const _0x2a43ca=_0x21fd7d[_0x18292d(0x205)],_0x52e692=new Map(),_0xdf2867=new Map(),_0x756bc6=await this['client'][_0x18292d(0x13f)](_0x1a7c47),_0x268ea9=await this[_0x18292d(0x181)][_0x18292d(0x1a3)](_0x1a7c47),_0xab3e9=await safeListOrEmpty(()=>this['client'][_0x18292d(0x238)](_0x1a7c47)),_0x5814dd=new Map(),_0x5b5423=new Map();for(const _0x1c3bed of _0x756bc6){_0x52e692[_0x18292d(0x21f)](_0x1c3bed['id'],_0x1c3bed[_0x18292d(0x1a2)][_0x18292d(0x1e2)]);}for(const _0x38641f of _0x268ea9){_0x5814dd['set'](_0x38641f['id'],_0x38641f['attributes'][_0x18292d(0x1e2)]);}for(const _0x3673a8 of _0xab3e9){_0x5b5423[_0x18292d(0x21f)](_0x3673a8['id'],_0x3673a8[_0x18292d(0x1a2)]['name']);}for(const _0x573897 of _0x130d5d){_0xdf2867[_0x18292d(0x21f)](_0x573897['id'],_0x573897[_0x18292d(0x1a2)][_0x18292d(0x1e2)]);}const _0x1461ee={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x52e692,'TextKnowledgeBase':_0x5814dd,'Agent':_0xdf2867,'ExperimentalKnowledgeBase':_0x5b5423}),'resolvePromptName':async()=>undefined,'onWarning':_0x3be10c=>this[_0x18292d(0x1eb)][_0x18292d(0x192)](_0x3be10c)},_0x204777=a109_0x4e6e83[_0x18292d(0x1b9)](_0x2a43ca,'prompt.md'),_0x5d1e06=a109_0x4e6e83[_0x18292d(0x1b9)](_0x2a43ca,_0x18292d(0x18c)),_0x58666d=a109_0x4e6e83['join'](_0x2a43ca,_0x18292d(0x1e1)),_0x2d23c8=!a109_0x5bd25e[_0x18292d(0x203)](_0x5d1e06);if(_0x28e1bc?.[_0x18292d(0x193)])return{'agentName':_0x2f1a49,'outputPath':_0x2a43ca,'isNew':_0x2d23c8,'hasChanges':!![]};a109_0x5bd25e['mkdirSync'](_0x1d5a3e,{'recursive':!![]}),a109_0x5bd25e[_0x18292d(0x1e5)](_0x2a43ca,{'recursive':!![]});const _0x3571fc=a109_0x4e6e83[_0x18292d(0x1b9)](_0x1d5a3e,_0x18292d(0x1e7));!a109_0x5bd25e['existsSync'](_0x3571fc)&&a109_0x5bd25e[_0x18292d(0x182)](_0x3571fc,createAgentConfigContent(_0xecc7fe));const {yaml:_0x425835,systemPrompt:_0x4c2234,starterMessage:_0x3b0e1c}=await agentResponseToDef(_0x31a60d,_0x1461ee);let _0x45c427=_0x2d23c8;if(!_0x2d23c8){const _0x38b596=a109_0x5bd25e['existsSync'](_0x204777)?a109_0x5bd25e['readFileSync'](_0x204777,_0x18292d(0x1ef)):'',_0x5281af=a109_0x5bd25e['readFileSync'](_0x5d1e06,_0x18292d(0x1ef));_0x45c427=_0x38b596!==_0x4c2234||_0x5281af!==toAgentYamlString(_0x425835);}a109_0x5bd25e['writeFileSync'](_0x204777,_0x4c2234),a109_0x5bd25e[_0x18292d(0x182)](_0x5d1e06,toAgentYamlString(_0x425835));if(_0x3b0e1c&&_0x3b0e1c[_0x18292d(0x189)]('\x0a'))a109_0x5bd25e[_0x18292d(0x182)](_0x58666d,_0x3b0e1c);else a109_0x5bd25e['existsSync'](_0x58666d)&&a109_0x5bd25e[_0x18292d(0x14c)](_0x58666d);return{'agentName':_0x2f1a49,'outputPath':_0x2a43ca,'isNew':_0x2d23c8,'hasChanges':_0x45c427};}async[a109_0x4fde2b(0x23d)](_0x375f51,_0x11920d){const _0x2d52b6=a109_0x4fde2b;let _0x2643d9;isAgentYamlPath(_0x375f51)?_0x2643d9=getAgentDirFromYamlPath(_0x375f51):_0x2643d9=_0x375f51;const {config:_0x5ad584}=findAgentConfig(_0x2643d9),_0x21ceaf=await this['resolveProjectId'](_0x5ad584['llm_project']),_0x39d098=a109_0x4e6e83[_0x2d52b6(0x1b9)](_0x2643d9,_0x2d52b6(0x18c)),_0x4d6b41=a109_0x4e6e83[_0x2d52b6(0x1b9)](_0x2643d9,_0x2d52b6(0x1c8)),_0xfdab7=a109_0x4e6e83[_0x2d52b6(0x1b9)](_0x2643d9,_0x2d52b6(0x1e1));if(!a109_0x5bd25e['existsSync'](_0x39d098))throw new SDKError(ErrorCode[_0x2d52b6(0x1ad)],_0x2d52b6(0x231)+_0x2643d9,undefined,{'helpText':'Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.'});const _0x52a9ef=parseAgentYaml(a109_0x5bd25e['readFileSync'](_0x39d098,_0x2d52b6(0x1ef)),_0x39d098),_0x3e83c0=a109_0x5bd25e[_0x2d52b6(0x203)](_0x4d6b41)?a109_0x5bd25e[_0x2d52b6(0x174)](_0x4d6b41,_0x2d52b6(0x1ef)):'',_0x430a33=a109_0x5bd25e[_0x2d52b6(0x203)](_0xfdab7)?a109_0x5bd25e[_0x2d52b6(0x174)](_0xfdab7,_0x2d52b6(0x1ef)):_0x52a9ef['starter_message'];if(_0x11920d?.[_0x2d52b6(0x193)])return{'agentName':_0x52a9ef[_0x2d52b6(0x1e2)],'action':_0x2d52b6(0x216),'projectId':_0x21ceaf};const _0x1aea04=await this[_0x2d52b6(0x181)]['listAgentsFull'](_0x21ceaf),_0x3a9ee8=await fetchAllToolTargetMaps((_0xbda253,_0x2963a6)=>this[_0x2d52b6(0x181)][_0x2d52b6(0x23e)](_0xbda253,_0x2963a6),_0x21ceaf),_0x3859e0=new Map();for(const _0xa98999 of _0x1aea04){_0x3859e0[_0x2d52b6(0x21f)](_0xa98999[_0x2d52b6(0x1a2)][_0x2d52b6(0x1e2)],_0xa98999['id']);}const _0x13ee07=[],_0x19009f={'projectId':_0x21ceaf,'resolveToolTargetId':buildIdResolver({..._0x3a9ee8[_0x2d52b6(0x23f)],'Agent':_0x3859e0}),'resolvePromptId':async()=>undefined,'onWarning':_0x274b1a=>{const _0x55a4aa=_0x2d52b6;this[_0x55a4aa(0x1eb)][_0x55a4aa(0x192)](_0x274b1a),_0x13ee07[_0x55a4aa(0x1cb)](_0x274b1a);}};try{const _0xa9da3a=_0x1aea04['find'](_0x13042f=>_0x13042f[_0x2d52b6(0x1a2)][_0x2d52b6(0x1e2)]===_0x52a9ef['name']),_0x6ac0f2=await agentDefToRequest(_0x52a9ef,_0x3e83c0,_0x430a33,_0x19009f);if(_0xa9da3a)return await this[_0x2d52b6(0x181)]['updateAgentResponse'](_0xa9da3a['id'],_0x6ac0f2),{'agentName':_0x52a9ef[_0x2d52b6(0x1e2)],'action':_0x2d52b6(0x206),'projectId':_0x21ceaf,'agentId':_0xa9da3a['id'],'warnings':_0x13ee07['length']>0x0?_0x13ee07:undefined};else{const _0x3773de=await this[_0x2d52b6(0x181)][_0x2d52b6(0x1ee)](_0x6ac0f2);return{'agentName':_0x52a9ef[_0x2d52b6(0x1e2)],'action':_0x2d52b6(0x216),'projectId':_0x21ceaf,'agentId':_0x3773de['id'],'warnings':_0x13ee07[_0x2d52b6(0x1f0)]>0x0?_0x13ee07:undefined};}}catch(_0x47fa67){return{'agentName':_0x52a9ef[_0x2d52b6(0x1e2)],'action':'error','projectId':_0x21ceaf,'error':_0x47fa67[_0x2d52b6(0x1d3)],'warnings':_0x13ee07[_0x2d52b6(0x1f0)]>0x0?_0x13ee07:undefined};}}async[a109_0x4fde2b(0x176)](_0x5cf7e8,_0x3d1fde,_0x33184f){const _0x5ff6ed=a109_0x4fde2b,_0x5c486f=a109_0x5bd25e[_0x5ff6ed(0x203)](_0x5cf7e8)&&a109_0x5bd25e['existsSync'](a109_0x4e6e83['join'](_0x5cf7e8,_0x5ff6ed(0x1e7)));let _0x3cea35;const _0x125278=[],_0x2aeb80=[],_0x191ef7=[],_0x439afe=[],_0x2a0d98=[],_0x5615da=[],_0x5776e7=[];if(_0x5c486f){const _0xf2b3c6=loadAgentConfig(a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x5cf7e8,_0x5ff6ed(0x1e7)));_0x3cea35=_0xf2b3c6[_0x5ff6ed(0x1f7)];const _0x142c51=a109_0x5bd25e[_0x5ff6ed(0x1c1)](_0x5cf7e8,{'withFileTypes':!![]});for(const _0x1046dc of _0x142c51){if(!_0x1046dc[_0x5ff6ed(0x15b)]())continue;if(['knowledge_bases',_0x5ff6ed(0x20e),'experimental_artifacts',_0x5ff6ed(0x217),'integrations']['includes'](_0x1046dc[_0x5ff6ed(0x1e2)]))continue;const _0x10869a=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x5cf7e8,_0x1046dc[_0x5ff6ed(0x1e2)]);if(isAgentDir(_0x10869a)){const _0x5c85df=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x10869a,_0x5ff6ed(0x18c)),_0xfb28ce=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x10869a,_0x5ff6ed(0x1c8)),_0x31c74c=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x10869a,_0x5ff6ed(0x1e1)),_0x444f1c=parseAgentYaml(a109_0x5bd25e['readFileSync'](_0x5c85df,_0x5ff6ed(0x1ef)),_0x5c85df),_0x21b5ab=a109_0x5bd25e[_0x5ff6ed(0x203)](_0xfb28ce)?a109_0x5bd25e[_0x5ff6ed(0x174)](_0xfb28ce,_0x5ff6ed(0x1ef)):'',_0x17f17b=a109_0x5bd25e[_0x5ff6ed(0x203)](_0x31c74c)?a109_0x5bd25e[_0x5ff6ed(0x174)](_0x31c74c,'utf-8'):_0x444f1c[_0x5ff6ed(0x200)];_0x125278['push']({'name':_0x444f1c[_0x5ff6ed(0x1e2)],'dir':_0x10869a,'yaml':_0x444f1c,'systemPrompt':_0x21b5ab,'starterMessage':_0x17f17b});}}const _0x571060=getKnowledgeBasesDir(_0x5cf7e8);if(a109_0x5bd25e[_0x5ff6ed(0x203)](_0x571060)){const _0x1a3540=a109_0x5bd25e[_0x5ff6ed(0x1c1)](_0x571060);for(const _0x4deabe of _0x1a3540){const _0x47c007=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x571060,_0x4deabe);if(_0x4deabe[_0x5ff6ed(0x13e)](_0x5ff6ed(0x252))){const _0x4815db=parseKnowledgeBaseYaml(a109_0x5bd25e[_0x5ff6ed(0x174)](_0x47c007,_0x5ff6ed(0x1ef)),_0x47c007);_0x2aeb80[_0x5ff6ed(0x1cb)]({'name':_0x4815db['name'],'path':_0x47c007,'yaml':_0x4815db});}else{if(_0x4deabe[_0x5ff6ed(0x13e)](_0x5ff6ed(0x24d))){const _0x493aa4=a109_0x5bd25e[_0x5ff6ed(0x174)](_0x47c007,'utf-8'),{name:_0x26baed,text:_0x5a406e}=parseTextKnowledgeBaseMd(_0x493aa4,_0x4deabe);_0x191ef7[_0x5ff6ed(0x1cb)]({'name':_0x26baed,'path':_0x47c007,'text':_0x5a406e});}}}}const _0x2aee35=getPromptsDir(_0x5cf7e8);if(a109_0x5bd25e[_0x5ff6ed(0x203)](_0x2aee35)){const _0x2d6c97=a109_0x5bd25e[_0x5ff6ed(0x1c1)](_0x2aee35)[_0x5ff6ed(0x18b)](_0x3e0a9f=>_0x3e0a9f['endsWith']('.yml'));for(const _0x45159b of _0x2d6c97){const _0x447222=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x2aee35,_0x45159b),_0x3e43ac=parsePromptYaml(a109_0x5bd25e['readFileSync'](_0x447222,'utf-8'),_0x447222);_0x439afe['push']({'name':_0x3e43ac['name'],'path':_0x447222,'yaml':_0x3e43ac});}}const _0x33e0b1=getIntegrationsDir(_0x5cf7e8);if(a109_0x5bd25e[_0x5ff6ed(0x203)](_0x33e0b1)){const _0x3b95be=a109_0x5bd25e[_0x5ff6ed(0x1c1)](_0x33e0b1)[_0x5ff6ed(0x18b)](_0x33b76b=>_0x33b76b[_0x5ff6ed(0x13e)](_0x5ff6ed(0x252)));for(const _0x1edfd9 of _0x3b95be){const _0x3a862b=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x33e0b1,_0x1edfd9),_0x55b1cb=parseIntegrationYaml(a109_0x5bd25e[_0x5ff6ed(0x174)](_0x3a862b,_0x5ff6ed(0x1ef)),_0x3a862b);SAFE_INTEGRATION_TYPES[_0x5ff6ed(0x189)](_0x55b1cb[_0x5ff6ed(0x20d)][_0x5ff6ed(0x22f)]())?_0x2a0d98[_0x5ff6ed(0x1cb)]({'name':_0x55b1cb[_0x5ff6ed(0x1e2)],'path':_0x3a862b,'yaml':_0x55b1cb}):this[_0x5ff6ed(0x1eb)][_0x5ff6ed(0x192)](_0x5ff6ed(0x1b4)+_0x55b1cb[_0x5ff6ed(0x1e2)]+_0x5ff6ed(0x1fa)+_0x55b1cb[_0x5ff6ed(0x20d)]+_0x5ff6ed(0x168)+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES[_0x5ff6ed(0x1b9)](',\x20')+_0x5ff6ed(0x1b6)));}}const _0x1f67f7=getExperimentalKnowledgeBasesDir(_0x5cf7e8);if(a109_0x5bd25e['existsSync'](_0x1f67f7)){const _0x35eb5a=a109_0x5bd25e[_0x5ff6ed(0x1c1)](_0x1f67f7,{'withFileTypes':!![]});for(const _0x3fef8c of _0x35eb5a){if(!_0x3fef8c[_0x5ff6ed(0x15b)]())continue;const _0x7319f0=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x1f67f7,_0x3fef8c[_0x5ff6ed(0x1e2)]),_0x25149f=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x7319f0,_0x3fef8c[_0x5ff6ed(0x1e2)]+_0x5ff6ed(0x252));if(a109_0x5bd25e['existsSync'](_0x25149f)){const _0x2d6af5=parseExperimentalKnowledgeBaseYaml(a109_0x5bd25e[_0x5ff6ed(0x174)](_0x25149f,_0x5ff6ed(0x1ef)),_0x25149f),_0x126e7a=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x7319f0,_0x5ff6ed(0x163)),_0x45fd59=[];if(a109_0x5bd25e['existsSync'](_0x126e7a)){const _0x31cb79=a109_0x5bd25e[_0x5ff6ed(0x1c1)](_0x126e7a,{'withFileTypes':!![]});for(const _0x18c5ea of _0x31cb79){if(!_0x18c5ea[_0x5ff6ed(0x15b)]())continue;const _0x88fff0=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x126e7a,_0x18c5ea['name']),_0x54c5bb=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x88fff0,'code.js'),_0x58b2be=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x88fff0,'json_schema.json');if(a109_0x5bd25e['existsSync'](_0x54c5bb)&&a109_0x5bd25e['existsSync'](_0x58b2be)){const _0x459690=a109_0x5bd25e[_0x5ff6ed(0x174)](_0x54c5bb,_0x5ff6ed(0x1ef)),_0xc1414d=a109_0x5bd25e[_0x5ff6ed(0x174)](_0x58b2be,'utf-8');_0x45fd59['push']({'name':_0x18c5ea[_0x5ff6ed(0x1e2)],'code':_0x459690,'json_schema':_0xc1414d});}}}const _0x2dc776={..._0x2d6af5,'functions':_0x45fd59};_0x5615da[_0x5ff6ed(0x1cb)]({'name':_0x2d6af5['name'],'path':_0x7319f0,'def':_0x2dc776});}}}const _0x468aed=getExperimentalArtifactsDir(_0x5cf7e8);if(a109_0x5bd25e[_0x5ff6ed(0x203)](_0x468aed)){const _0x3c6e9f=a109_0x5bd25e[_0x5ff6ed(0x1c1)](_0x468aed,{'withFileTypes':!![]});for(const _0x4e2753 of _0x3c6e9f){if(!_0x4e2753[_0x5ff6ed(0x15b)]())continue;const _0x5f01fc=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x468aed,_0x4e2753[_0x5ff6ed(0x1e2)]),_0x24fd49=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x5f01fc,_0x4e2753[_0x5ff6ed(0x1e2)]+_0x5ff6ed(0x252));if(a109_0x5bd25e['existsSync'](_0x24fd49)){const _0x545719=parseExperimentalArtifactYaml(a109_0x5bd25e[_0x5ff6ed(0x174)](_0x24fd49,'utf-8'),_0x24fd49),_0x57c0ef=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x5f01fc,_0x5ff6ed(0x1d9)),_0x5aec17=a109_0x5bd25e[_0x5ff6ed(0x203)](_0x57c0ef)?a109_0x5bd25e[_0x5ff6ed(0x174)](_0x57c0ef,'utf-8'):'',_0x50d95b=a109_0x4e6e83['join'](_0x5f01fc,'files'),_0x486fcc=[];if(a109_0x5bd25e[_0x5ff6ed(0x203)](_0x50d95b)){const _0x4a9229=a109_0x5bd25e['readdirSync'](_0x50d95b);for(const _0x2556e8 of _0x4a9229){const _0x57848c=a109_0x4e6e83[_0x5ff6ed(0x1b9)](_0x50d95b,_0x2556e8);if(a109_0x5bd25e['statSync'](_0x57848c)[_0x5ff6ed(0x1ba)]()){const _0x1d7b68=a109_0x5bd25e['readFileSync'](_0x57848c,'utf-8');_0x486fcc['push']({'file_name':_0x2556e8,'text_content':_0x1d7b68});}}}const _0x13c218={..._0x545719,'code':_0x5aec17,'files':_0x486fcc};_0x5776e7[_0x5ff6ed(0x1cb)]({'name':_0x545719['name'],'path':_0x5f01fc,'def':_0x13c218});}}}}else{const _0xe9f56a=await this[_0x5ff6ed(0x154)](_0x5cf7e8),_0x24e1b6=await this['client'][_0x5ff6ed(0x14b)](_0xe9f56a);_0x3cea35=_0x24e1b6[_0x5ff6ed(0x1a2)][_0x5ff6ed(0x1e2)];const _0x42332a=await this['client'][_0x5ff6ed(0x1a7)](_0xe9f56a),_0x49a599=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x13f)](_0xe9f56a),_0x42bc87=await this[_0x5ff6ed(0x181)]['listTextKnowledgeBases'](_0xe9f56a),_0x2a3df4=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x22e)](_0xe9f56a),_0x5839bc=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x185)](_0xe9f56a),_0x53dfba=await safeListOrEmpty(()=>this['client']['listExperimentalKnowledgeBases'](_0xe9f56a)),_0x46a8b7=await safeListOrEmpty(()=>this[_0x5ff6ed(0x181)][_0x5ff6ed(0x1cd)](_0xe9f56a)),_0x2b0c64=new Map(),_0x4d7dab=new Map(),_0x7b3bd6=new Map(),_0x1c77ba=new Map(),_0x219e8d=new Map(),_0xe25e16=new Map();for(const _0x40a16b of _0x49a599){_0x2b0c64[_0x5ff6ed(0x21f)](_0x40a16b['id'],_0x40a16b[_0x5ff6ed(0x1a2)][_0x5ff6ed(0x1e2)]);}for(const _0xe2a8b6 of _0x42bc87){_0x4d7dab[_0x5ff6ed(0x21f)](_0xe2a8b6['id'],_0xe2a8b6[_0x5ff6ed(0x1a2)][_0x5ff6ed(0x1e2)]);}for(const _0x134447 of _0x42332a){_0x7b3bd6['set'](_0x134447['id'],_0x134447['attributes']['name']);}for(const _0x28a0d8 of _0x2a3df4){_0x1c77ba['set'](_0x28a0d8['id'],_0x28a0d8[_0x5ff6ed(0x1a2)]['name']);}for(const _0x2ca2e5 of _0x53dfba){_0x219e8d[_0x5ff6ed(0x21f)](_0x2ca2e5['id'],_0x2ca2e5['attributes'][_0x5ff6ed(0x1e2)]);}for(const _0xb8f654 of _0x46a8b7){_0xe25e16['set'](_0xb8f654['id'],_0xb8f654[_0x5ff6ed(0x1a2)][_0x5ff6ed(0x1e2)]);}const _0x191de2={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2b0c64,'TextKnowledgeBase':_0x4d7dab,'Agent':_0x7b3bd6,'ExperimentalKnowledgeBase':_0x219e8d}),'resolvePromptName':async _0x18784e=>_0x1c77ba[_0x5ff6ed(0x161)](_0x18784e),'onWarning':_0x147bde=>this[_0x5ff6ed(0x1eb)][_0x5ff6ed(0x192)](_0x147bde)};for(const _0x44a218 of _0x42332a){const _0x30679e=await agentResponseToDef(_0x44a218,_0x191de2),{yaml:_0x802956,systemPrompt:_0x5b821a,starterMessage:_0x330686}=_0x30679e;_0x125278['push']({'name':_0x802956[_0x5ff6ed(0x1e2)],'dir':'','yaml':_0x802956,'systemPrompt':_0x5b821a,'starterMessage':_0x330686});}for(const _0x2d13a1 of _0x49a599){const _0x41acf9=apiKnowledgeBaseToYaml(_0x2d13a1);_0x2aeb80[_0x5ff6ed(0x1cb)]({'name':_0x41acf9['name'],'path':'','yaml':_0x41acf9});}for(const _0x46367e of _0x42bc87){_0x191ef7[_0x5ff6ed(0x1cb)]({'name':_0x46367e[_0x5ff6ed(0x1a2)]['name'],'path':'','text':_0x46367e[_0x5ff6ed(0x1a2)][_0x5ff6ed(0x1ed)]});}for(const _0x2e1911 of _0x2a3df4){const _0x2fdcd9=await apiPromptToYaml(_0x2e1911,_0x191de2);_0x2fdcd9&&_0x439afe[_0x5ff6ed(0x1cb)]({'name':_0x2fdcd9[_0x5ff6ed(0x1e2)],'path':'','yaml':_0x2fdcd9});}for(const _0x103b5e of _0x5839bc){if(!_0x103b5e[_0x5ff6ed(0x1a2)]['isManaged']&&SAFE_INTEGRATION_TYPES['includes'](_0x103b5e[_0x5ff6ed(0x1a2)][_0x5ff6ed(0x16c)][_0x5ff6ed(0x22f)]())){const _0x21e824=await apiIntegrationToYaml(_0x103b5e,_0x191de2);_0x2a0d98[_0x5ff6ed(0x1cb)]({'name':_0x103b5e[_0x5ff6ed(0x1a2)]['serviceType']['toLowerCase'](),'path':'','yaml':_0x21e824});}}for(const _0x5b53c2 of _0x53dfba){const _0x16614f=apiExperimentalKnowledgeBaseToYaml(_0x5b53c2);_0x5615da['push']({'name':_0x16614f['name'],'path':'','def':_0x16614f});}for(const _0xb60673 of _0x46a8b7){const _0x17091a=apiExperimentalArtifactToYaml(_0xb60673);_0x5776e7[_0x5ff6ed(0x1cb)]({'name':_0x17091a[_0x5ff6ed(0x1e2)],'path':'','def':_0x17091a});}}const _0x33d925={'sourceProjectName':_0x3cea35,'newProjectName':_0x3d1fde,'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}}},_0xcd4972=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x1d8)](),_0x3ba192=_0xcd4972['find'](_0x2d850f=>_0x2d850f[_0x5ff6ed(0x1a2)]['name']===_0x3d1fde);if(_0x3ba192)throw new SDKError(ErrorCode[_0x5ff6ed(0x1b5)],_0x5ff6ed(0x239)+_0x3d1fde+_0x5ff6ed(0x18e),undefined,{'helpText':_0x5ff6ed(0x23c)});if(_0x33184f?.[_0x5ff6ed(0x193)])return _0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1a1)][_0x5ff6ed(0x216)]=_0x125278['length'],_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x15d)][_0x5ff6ed(0x216)]=_0x2aeb80[_0x5ff6ed(0x1f0)],_0x33d925['counts'][_0x5ff6ed(0x22d)][_0x5ff6ed(0x216)]=_0x191ef7[_0x5ff6ed(0x1f0)],_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x229)][_0x5ff6ed(0x216)]=_0x5615da[_0x5ff6ed(0x1f0)],_0x33d925[_0x5ff6ed(0x152)]['experimentalArtifacts'][_0x5ff6ed(0x216)]=_0x5776e7[_0x5ff6ed(0x1f0)],_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x217)][_0x5ff6ed(0x216)]=_0x439afe[_0x5ff6ed(0x1f0)],_0x33d925[_0x5ff6ed(0x152)]['integrations']['created']=_0x2a0d98[_0x5ff6ed(0x1f0)],_0x33d925;const _0x211b50=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x15f)]({'name':_0x3d1fde}),_0x4a5a68=_0x211b50['id'];_0x33d925[_0x5ff6ed(0x24c)]=_0x4a5a68;const _0x4c2cf7=new Map(),_0x4b7ffd=new Map(),_0x2bb502=new Map(),_0xdcde0c=new Map(),_0x31752d=new Map(),_0x44cf69=new Map(),_0x4fb809=new Map(),_0x2fc33d=new Map(),_0x4b5c01=new Set(),_0x3d284e=new Set();for(const _0x106e0c of _0x125278){for(const _0x55554e of _0x106e0c['yaml'][_0x5ff6ed(0x20f)]||[]){if(_0x55554e[_0x5ff6ed(0x1bb)]===_0x5ff6ed(0x1f9)&&_0x55554e['target']){const _0x18fbd2=parseRef(_0x55554e[_0x5ff6ed(0x14e)]);if(_0x18fbd2)_0x4b5c01['add'](_0x18fbd2[_0x5ff6ed(0x1e2)]);}else{if(_0x55554e[_0x5ff6ed(0x1bb)]===_0x5ff6ed(0x1f1)&&_0x55554e[_0x5ff6ed(0x14e)]){const _0x3a9880=parseRef(_0x55554e['target']);if(_0x3a9880)_0x3d284e[_0x5ff6ed(0x16e)](_0x3a9880[_0x5ff6ed(0x1e2)]);}}}}for(const _0x4a43a4 of _0x4b5c01){try{const _0x585912=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x1b7)]({'projectId':_0x4a5a68,'name':_0x4a43a4});_0x31752d['set'](_0x4a43a4,_0x585912['id']),_0x33d925[_0x5ff6ed(0x1e3)][_0x5ff6ed(0x1cb)]({'name':_0x4a43a4,'action':_0x5ff6ed(0x216),'id':_0x585912['id']}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1e3)]['created']++;}catch(_0x5962b0){_0x33d925[_0x5ff6ed(0x1e3)][_0x5ff6ed(0x1cb)]({'name':_0x4a43a4,'action':_0x5ff6ed(0x1ce),'error':_0x5962b0[_0x5ff6ed(0x1d3)]}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1e3)][_0x5ff6ed(0x156)]++;}}for(const _0x22e06a of _0x3d284e){try{const _0x13b0a2=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x1ec)]({'projectId':_0x4a5a68,'name':_0x22e06a});_0x44cf69['set'](_0x22e06a,_0x13b0a2['id']),_0x33d925['webSearchTools'][_0x5ff6ed(0x1cb)]({'name':_0x22e06a,'action':_0x5ff6ed(0x216),'id':_0x13b0a2['id']}),_0x33d925[_0x5ff6ed(0x152)]['webSearchTools'][_0x5ff6ed(0x216)]++;}catch(_0x828aec){_0x33d925[_0x5ff6ed(0x1a6)]['push']({'name':_0x22e06a,'action':_0x5ff6ed(0x1ce),'error':_0x828aec['message']}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1a6)][_0x5ff6ed(0x156)]++;}}const _0x451254=await fetchAllToolTargetMaps((_0x22453a,_0x4dcbf3)=>this[_0x5ff6ed(0x181)][_0x5ff6ed(0x23e)](_0x22453a,_0x4dcbf3),_0x4a5a68);let _0x50858c=[];const _0x50f386={'projectId':_0x4a5a68,'resolveToolTargetId':buildIdResolver({..._0x451254[_0x5ff6ed(0x23f)],'KnowledgeBase':_0x4c2cf7,'TextKnowledgeBase':_0x4b7ffd,'ExperimentalKnowledgeBase':_0x4fb809,'Agent':_0x2bb502,'WebSearchTool':_0x44cf69,'ImageGenerator':_0x31752d}),'resolvePromptId':async _0x16cf5b=>_0xdcde0c[_0x5ff6ed(0x161)](_0x16cf5b),'onWarning':_0x19fef0=>{const _0x104a11=_0x5ff6ed;this[_0x104a11(0x1eb)][_0x104a11(0x192)](_0x19fef0),_0x50858c['push'](_0x19fef0);}};for(const _0x48d0b8 of _0x2aeb80){try{const _0x488cb9=yamlKnowledgeBaseToApi(_0x48d0b8[_0x5ff6ed(0x223)],_0x4a5a68),_0x565d73=await this[_0x5ff6ed(0x181)]['createKnowledgeBase'](_0x488cb9);_0x4c2cf7['set'](_0x48d0b8['yaml'][_0x5ff6ed(0x1e2)],_0x565d73['id']),_0x33d925[_0x5ff6ed(0x15d)][_0x5ff6ed(0x1cb)]({'name':_0x48d0b8['yaml'][_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x216),'id':_0x565d73['id']}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x15d)][_0x5ff6ed(0x216)]++;}catch(_0x45fcc5){_0x33d925['knowledgeBases']['push']({'name':_0x48d0b8[_0x5ff6ed(0x223)]['name'],'action':_0x5ff6ed(0x1ce),'error':_0x45fcc5[_0x5ff6ed(0x1d3)]}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x15d)]['errors']++;}}for(const _0xbf788b of _0x191ef7){try{const _0x4528d7=yamlTextKnowledgeBaseToApi({'name':_0xbf788b['name'],'text':_0xbf788b['text']},_0x4a5a68),_0x4f3b28=await this['client']['createTextKnowledgeBase'](_0x4528d7);_0x4b7ffd[_0x5ff6ed(0x21f)](_0xbf788b['name'],_0x4f3b28['id']),_0x33d925[_0x5ff6ed(0x22d)][_0x5ff6ed(0x1cb)]({'name':_0xbf788b['name'],'action':_0x5ff6ed(0x216),'id':_0x4f3b28['id']}),_0x33d925[_0x5ff6ed(0x152)]['textKnowledgeBases']['created']++;}catch(_0x44022b){_0x33d925[_0x5ff6ed(0x22d)][_0x5ff6ed(0x1cb)]({'name':_0xbf788b[_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x1ce),'error':_0x44022b[_0x5ff6ed(0x1d3)]}),_0x33d925[_0x5ff6ed(0x152)]['textKnowledgeBases']['errors']++;}}for(const _0x301702 of _0x5776e7){try{const _0x9e63c6=yamlExperimentalArtifactToApi(_0x301702['def'],_0x4a5a68),_0x3a96f7=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x23a)](_0x9e63c6);_0x2fc33d[_0x5ff6ed(0x21f)](_0x301702[_0x5ff6ed(0x15a)][_0x5ff6ed(0x1e2)],_0x3a96f7['id']),_0x33d925[_0x5ff6ed(0x1d0)][_0x5ff6ed(0x1cb)]({'name':_0x301702['def'][_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x216),'id':_0x3a96f7['id']}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1d0)][_0x5ff6ed(0x216)]++;}catch(_0xa813d3){_0x33d925[_0x5ff6ed(0x1d0)][_0x5ff6ed(0x1cb)]({'name':_0x301702['def'][_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x1ce),'error':_0xa813d3[_0x5ff6ed(0x1d3)]}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1d0)][_0x5ff6ed(0x156)]++;}}for(const _0x454d18 of _0x5615da){try{const _0x84acb2=yamlExperimentalKnowledgeBaseToApi(_0x454d18[_0x5ff6ed(0x15a)],_0x4a5a68),_0x44267a=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x1ea)](_0x84acb2);_0x4fb809[_0x5ff6ed(0x21f)](_0x454d18['def'][_0x5ff6ed(0x1e2)],_0x44267a['id']),_0x33d925['experimentalKnowledgeBases'][_0x5ff6ed(0x1cb)]({'name':_0x454d18[_0x5ff6ed(0x15a)][_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x216),'id':_0x44267a['id']}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x229)][_0x5ff6ed(0x216)]++;}catch(_0x5ad0d9){_0x33d925['experimentalKnowledgeBases'][_0x5ff6ed(0x1cb)]({'name':_0x454d18[_0x5ff6ed(0x15a)][_0x5ff6ed(0x1e2)],'action':'error','error':_0x5ad0d9[_0x5ff6ed(0x1d3)]}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x229)][_0x5ff6ed(0x156)]++;}}const _0x37ef6e=[..._0x125278]['sort']((_0x19d51e,_0x4daea4)=>{const _0x476d9a=_0x5ff6ed,_0x1fb0fe=_0x19d51e[_0x476d9a(0x223)][_0x476d9a(0x20f)]?.[_0x476d9a(0x24f)](_0x27afb5=>_0x27afb5[_0x476d9a(0x1bb)]===_0x476d9a(0x208))??![],_0x157a32=_0x4daea4[_0x476d9a(0x223)]['tools']?.['some'](_0x58ff23=>_0x58ff23['type']===_0x476d9a(0x208))??![];if(_0x1fb0fe&&!_0x157a32)return 0x1;if(!_0x1fb0fe&&_0x157a32)return-0x1;return 0x0;});for(const _0x410d45 of _0x37ef6e){_0x50858c=[];try{const _0x33f691=_0x410d45['yaml'][_0x5ff6ed(0x20f)]?.[_0x5ff6ed(0x18b)](_0x212feb=>{const _0x4a2966=_0x5ff6ed;if(_0x212feb[_0x4a2966(0x1bb)]==='agent'&&_0x212feb['target']){const _0x218b09=parseRef(_0x212feb[_0x4a2966(0x14e)]);return _0x218b09?.[_0x4a2966(0x1e2)]===_0x410d45[_0x4a2966(0x223)]['name'];}return![];})??[];if(_0x33f691[_0x5ff6ed(0x1f0)]>0x0){const _0x1990b1=_0x5ff6ed(0x1f8)+_0x410d45[_0x5ff6ed(0x223)]['name']+'\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20'+_0x5ff6ed(0x1b0);this[_0x5ff6ed(0x1eb)][_0x5ff6ed(0x192)](_0x1990b1),_0x50858c[_0x5ff6ed(0x1cb)](_0x1990b1);}const _0x163908=await agentDefToRequest(_0x410d45[_0x5ff6ed(0x223)],_0x410d45['systemPrompt'],_0x410d45['starterMessage'],_0x50f386),_0x1d2e3e=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x1ee)](_0x163908);_0x2bb502[_0x5ff6ed(0x21f)](_0x410d45[_0x5ff6ed(0x223)][_0x5ff6ed(0x1e2)],_0x1d2e3e['id']),_0x33d925[_0x5ff6ed(0x1a1)][_0x5ff6ed(0x1cb)]({'agentName':_0x410d45['yaml'][_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x216),'agentId':_0x1d2e3e['id'],'warnings':_0x50858c['length']>0x0?_0x50858c:undefined}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1a1)][_0x5ff6ed(0x216)]++;}catch(_0x266a61){_0x33d925['agents'][_0x5ff6ed(0x1cb)]({'agentName':_0x410d45[_0x5ff6ed(0x223)]['name'],'action':'error','error':_0x266a61[_0x5ff6ed(0x1d3)],'warnings':_0x50858c['length']>0x0?_0x50858c:undefined}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x1a1)][_0x5ff6ed(0x156)]++;}}for(const _0x2925ae of _0x439afe){try{const _0x2bb9d7=await yamlPromptToApi(_0x2925ae['yaml'],_0x4a5a68,_0x50f386);if(!_0x2bb9d7){_0x33d925['prompts'][_0x5ff6ed(0x1cb)]({'name':_0x2925ae[_0x5ff6ed(0x223)][_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x1ce),'error':'Agent\x20reference\x20not\x20found'}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x217)][_0x5ff6ed(0x156)]++;continue;}const _0x543c19=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x16a)](_0x2bb9d7);_0xdcde0c[_0x5ff6ed(0x21f)](_0x2925ae[_0x5ff6ed(0x223)][_0x5ff6ed(0x1e2)],_0x543c19['id']),_0x33d925['prompts']['push']({'name':_0x2925ae[_0x5ff6ed(0x223)][_0x5ff6ed(0x1e2)],'action':'created','id':_0x543c19['id']}),_0x33d925[_0x5ff6ed(0x152)]['prompts'][_0x5ff6ed(0x216)]++;}catch(_0x120143){_0x33d925[_0x5ff6ed(0x217)][_0x5ff6ed(0x1cb)]({'name':_0x2925ae[_0x5ff6ed(0x223)][_0x5ff6ed(0x1e2)],'action':_0x5ff6ed(0x1ce),'error':_0x120143[_0x5ff6ed(0x1d3)]}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x217)][_0x5ff6ed(0x156)]++;}}for(const _0x1e0ee1 of _0x2a0d98){try{const _0x52c72f=await yamlIntegrationToApi(_0x1e0ee1[_0x5ff6ed(0x223)],_0x4a5a68,_0x50f386),_0x98550b=await this[_0x5ff6ed(0x181)][_0x5ff6ed(0x1aa)](_0x52c72f);_0x33d925[_0x5ff6ed(0x245)][_0x5ff6ed(0x1cb)]({'name':_0x1e0ee1[_0x5ff6ed(0x223)][_0x5ff6ed(0x20d)],'action':_0x5ff6ed(0x216),'id':_0x98550b['id']}),_0x33d925[_0x5ff6ed(0x152)]['integrations'][_0x5ff6ed(0x216)]++;}catch(_0x292067){_0x33d925[_0x5ff6ed(0x245)][_0x5ff6ed(0x1cb)]({'name':_0x1e0ee1[_0x5ff6ed(0x223)][_0x5ff6ed(0x20d)],'action':'error','error':_0x292067[_0x5ff6ed(0x1d3)]}),_0x33d925[_0x5ff6ed(0x152)][_0x5ff6ed(0x245)][_0x5ff6ed(0x156)]++;}}return _0x33d925;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a110_0x266c(){const _0x408348=['1850824FaTmgL','get','2aARIrM','6KIlPcX','295351ulPFYo','949880jjROYl','map','9MeciOQ','targetKnowledgeBaseId','has','1.0','1524805pkOhpk','7709910zCENgk','913896YIIrPP','targetAgentId','225852IgvCHv'];a110_0x266c=function(){return _0x408348;};return a110_0x266c();}(function(_0x14dc63,_0x3a173a){const _0x245a07=a110_0x41bc,_0x4404f3=_0x14dc63();while(!![]){try{const _0x51e316=parseInt(_0x245a07(0x185))/0x1*(-parseInt(_0x245a07(0x192))/0x2)+parseInt(_0x245a07(0x190))/0x3+-parseInt(_0x245a07(0x193))/0x4+-parseInt(_0x245a07(0x18e))/0x5+-parseInt(_0x245a07(0x186))/0x6*(-parseInt(_0x245a07(0x187))/0x7)+parseInt(_0x245a07(0x188))/0x8+parseInt(_0x245a07(0x18a))/0x9*(parseInt(_0x245a07(0x18f))/0xa);if(_0x51e316===_0x3a173a)break;else _0x4404f3['push'](_0x4404f3['shift']());}catch(_0x47db5d){_0x4404f3['push'](_0x4404f3['shift']());}}}(a110_0x266c,0x3b558));export function canCreateAgent(_0x1faa96,_0x16b515){const _0x2914a9=a110_0x41bc;for(const _0x2470ac of _0x1faa96['attributes']['tools']){if(_0x2470ac['targetAgentId']&&!_0x16b515[_0x2914a9(0x18c)](_0x2470ac[_0x2914a9(0x191)]))return![];}return!![];}export function remapToolIds(_0x47e543,_0x2bf323,_0x28d486){const _0x2724d7=a110_0x41bc;return _0x47e543[_0x2724d7(0x189)](_0x310ee5=>({..._0x310ee5,'targetKnowledgeBaseId':_0x310ee5['targetKnowledgeBaseId']?_0x2bf323['get'](_0x310ee5[_0x2724d7(0x18b)])||_0x310ee5['targetKnowledgeBaseId']:undefined,'targetAgentId':_0x310ee5[_0x2724d7(0x191)]?_0x28d486[_0x2724d7(0x184)](_0x310ee5['targetAgentId'])||_0x310ee5[_0x2724d7(0x191)]:undefined}));}export function remapVariableIds(_0xe7b58c,_0x16d40b){const _0x2c9537=a110_0x41bc;return _0xe7b58c[_0x2c9537(0x189)](_0x143305=>({..._0x143305,'targetKnowledgeBaseId':_0x16d40b['get'](_0x143305[_0x2c9537(0x18b)])||_0x143305['targetKnowledgeBaseId']}));}function a110_0x41bc(_0x5c73d9,_0x10ddfc){_0x5c73d9=_0x5c73d9-0x184;const _0x266c7d=a110_0x266c();let _0x41bcb3=_0x266c7d[_0x5c73d9];return _0x41bcb3;}export function isSupportedBackupVersion(_0xce73ea){const _0x29ca2e=a110_0x41bc;return _0xce73ea===_0x29ca2e(0x18d);}
|