@treasuredata/tdx 0.28.3 → 0.28.4
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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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_0x3e47fb=a109_0x1d93;(function(_0x317951,_0xbf415){const _0x5a5fc8=a109_0x1d93,_0x451bc4=_0x317951();while(!![]){try{const _0x37943a=-parseInt(_0x5a5fc8(0x22f))/0x1+parseInt(_0x5a5fc8(0x1ae))/0x2*(-parseInt(_0x5a5fc8(0x1d9))/0x3)+-parseInt(_0x5a5fc8(0x1b9))/0x4+parseInt(_0x5a5fc8(0x11e))/0x5+-parseInt(_0x5a5fc8(0x1da))/0x6+parseInt(_0x5a5fc8(0x193))/0x7*(-parseInt(_0x5a5fc8(0x1a7))/0x8)+-parseInt(_0x5a5fc8(0x12a))/0x9*(-parseInt(_0x5a5fc8(0x21f))/0xa);if(_0x37943a===_0xbf415)break;else _0x451bc4['push'](_0x451bc4['shift']());}catch(_0x165456){_0x451bc4['push'](_0x451bc4['shift']());}}}(a109_0x4709,0x74ce5));import{LLMApiClient}from'../client/llm-api-client.js';function a109_0x1d93(_0x4469e8,_0x5e75b2){_0x4469e8=_0x4469e8-0x11e;const _0x4709ee=a109_0x4709();let _0x1d931b=_0x4709ee[_0x4469e8];return _0x1d931b;}function a109_0x4709(){const _0x1a8dae=['\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20','ALREADY_EXISTS','agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','Renamed\x20experimental\x20artifact\x20directory:\x20','Multiple\x20projects\x20found\x20with\x20name\x20\x27','LLM_PROJECT_NOT_FOUND','currentProjectId','chat_parent_segment','stringify','error','chatInfo','oldPath','basename','textKnowledgeBases','createAgent','listTextKnowledgeBases','agent.yml','slackMessageMode','isFile','content','sort','functions','createIntegration','3234ItdGof','starter_message.md','imageGenerators','listExperimentalKnowledgeBases','#\x20prompt.md\x0a','temperature','experimental_artifacts','action','project','Renamed\x20integration\x20file:\x20','minimal','tables','webSearchTools','\x0a---\x20function:\x20','(dry-run)','Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.','isManaged','history','24cDZYCe','AGENT_NOT_FOUND','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','tdx.json','1.0','unlinkSync','find','90918BsVzfL','getCurrentProject','code','agents','TextKnowledgeBase','createImageGenerator','writeFileSync','listToolTargets','deleteProject','tdx_default_','getChatHistory','771528iyHuvi','resolveProjectName','Removed\x20deleted\x20directory:\x20','knowledgebases.json','signal','claude-4.5-sonnet','prompts.json','createKnowledgeBase','Unresolved\x20dependencies:\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','updateTextKnowledgeBase','backupProject','integrations','Output\x20directory\x20already\x20exists:\x20','Removed\x20deleted\x20file:\x20','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','Multiple\x20agents\x20found\x20with\x20name\x20\x27','Backup\x20folder\x20not\x20found:\x20','text_content','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','message','add','experimentalKnowledgeBases','knowledge_bases','Skipping\x20integration\x20\x27','rmSync','endsWith','updatePrompt','modelType','projects','mkdirSync','39lMpbKu','1391406RWMSYw','push','get','info','Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.','setDefaultAgent','site','localeCompare','displayName','Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.','conflict','createExperimentalArtifact','tdDatabaseName','webhookCorsOrigins','getProject','service_type','getOrCreateDefaultAgent','dryRun','isDirectory','Renamed\x20experimental\x20KB\x20directory:\x20','\x22\x20already\x20exists','Available\x20agents:\x20','getAgent','errors','keys','outputs','nameToId','systemPrompt','resolveAgentId','.llm','json_schema','name','\x20→\x20','files','INTERNAL','already\x20exists','createExperimentalKnowledgeBase','unchanged','has','getUserSettings','Invalid\x20agent\x20reference\x20format:\x20','Renamed\x20KB\x20file:\x20','Renamed\x20prompt\x20file:\x20','sdk.llm','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','status','path','):\x20','target','attributes','maxToolIterations','includes','promptId','listKnowledgeBases','renamed','\x0a---\x20code\x20---\x0a','logger','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','dir','map','Project\x20\x22','actions','isDir','clearDefaultAgent','listWebSearchTools','\x20attempts\x20due\x20to\x20name\x20conflicts.','No\x20tdx.json\x20found\x20in\x20','420bQaodV','web_search','agent.yml\x20not\x20found\x20in\x20','agentId','projectId','dirname','agentsFull','restoreProject','updateAgentResponse','serviceType','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','agent','continueChat','profile','experimentalArtifacts','readFileSync','358613HfbhoI','toLowerCase','\x0a---\x20schema:\x20','new','low','cwd','pushAgent','total','starterMessage','knowledgeBases','chatWelcomeMessage','type','metadata','readdirSync','client','prompt.md','json_schema.json','event','getOrCreateDefaultProject','toISOString','duplicate','\x27\x20(','2580120olBWPn','chats','deleteIntegration','listImageGenerators','Renamed\x20folder:\x20','loadJsonFile','tools','UNAUTHENTICATED','medium','createAgentResponse','Unsupported\x20backup\x20version:\x20','\x20in\x20project\x20','286749MEfqvD','yaml','---\x20file:\x20','listAgentsFull','createProject','warn','pullProject','Only\x20safe\x20types\x20(','reasoningEffort','high','listPrompts','chat','integrations.json','set','listChats','getBackupMetadata','listAgents','getChatInfo','listProjects','listIntegrations','Agent\x20reference\x20not\x20found','setCurrentProject','experimental_knowledge_bases','context','def','cloneProject','code.js','\x0a\x0a#\x20agent.yml\x0a','jsonSchemaHint','\x27.\x20This\x20should\x20not\x20happen.','INVALID_ARGUMENT','Agent\x20not\x20found:\x20','project.json','startChat','variables','listExperimentalArtifacts',')\x20can\x20be\x20pushed.\x20','text','availableModels','join','\x20---\x0a','filter','length','newProjectId','statSync','updated','Renamed\x20agent\x20folder:\x20','created','exportedFrom','starter_message','pullAgent','some','image_gen','chat_generic','.yml','createWebSearchTool','Agent\x20\x27','file_name','prompts','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Unable\x20to\x20create\x20project\x20after\x20','NOT_FOUND','none','parse','Project\x20not\x20found:\x20','PERMISSION_DENIED','resolveProjectId','getChatLog','.md','getDefaultProjectName','createTextKnowledgeBase','tdx_','.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.','createPrompt','Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.','counts','updateExperimentalArtifact','utf-8','version','size','existsSync'];a109_0x4709=function(){return _0x1a8dae;};return a109_0x4709();}import*as a109_0x46e9cb from'node:fs';import*as a109_0x51353b from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{SDKError,ErrorCode,errorContains}from'../errors.js';import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir}from'../agent/agent-config.js';import{getSanitizedUsername,generateRandomHex}from'../../utils/string-utils.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';export const SAFE_INTEGRATION_TYPES=[a109_0x3e47fb(0x15f),'chat_agent_console',a109_0x3e47fb(0x183)];async function safeListOrEmpty(_0xc5f851){const _0x2121a0=a109_0x3e47fb;try{return await _0xc5f851();}catch(_0x2f121a){if(_0x2f121a instanceof HTTPClientError&&_0x2f121a[_0x2121a0(0x209)]===0x194)return[];throw _0x2f121a;}}export class LLMSDK{[a109_0x3e47fb(0x182)];[a109_0x3e47fb(0x23d)];[a109_0x3e47fb(0x141)];[a109_0x3e47fb(0x214)]=Logger['of'](a109_0x3e47fb(0x206));constructor(_0x1093de){const _0x48b946=a109_0x3e47fb;this['client']=new LLMApiClient(_0x1093de),this[_0x48b946(0x141)]=_0x1093de;}[a109_0x3e47fb(0x16f)](){const _0x2d6b95=a109_0x3e47fb,_0x2c95a6=getSanitizedUsername();return _0x2d6b95(0x1b7)+_0x2c95a6;}async[a109_0x3e47fb(0x13f)](_0x1ea9b0){const _0x70388c=a109_0x3e47fb,{projectId:_0x3aa51f}=await this['resolveProjectName'](_0x1ea9b0);this[_0x70388c(0x182)]=_0x3aa51f;}[a109_0x3e47fb(0x1af)](){return this['currentProjectId'];}async[a109_0x3e47fb(0x1e0)](_0x148cde){const _0x4215a3=a109_0x3e47fb,_0x358317=this[_0x4215a3(0x141)]['profile'];let _0x42d4be,_0x57d3b8;if(_0x148cde[_0x4215a3(0x20f)]('/')){const _0x14d033=_0x148cde['split']('/');if(_0x14d033[_0x4215a3(0x154)]!==0x2)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4215a3(0x203)+_0x148cde,undefined,{'helpText':_0x4215a3(0x1cd)});const [_0x5c82af,_0x56f5b4]=_0x14d033;_0x42d4be=await this[_0x4215a3(0x16c)](_0x5c82af),_0x57d3b8=_0x56f5b4;}else _0x42d4be=this[_0x4215a3(0x182)]||(await this[_0x4215a3(0x241)]())['id'],_0x57d3b8=_0x148cde;const _0x4f96b3=await this[_0x4215a3(0x1f7)](_0x57d3b8,_0x42d4be),_0x1b79a3=await this[_0x4215a3(0x23d)][_0x4215a3(0x1f1)](_0x4f96b3);writeCachedLLMAgent(_0x1b79a3[_0x4215a3(0x20d)]['name'],_0x4f96b3,_0x42d4be,_0x358317);}['getDefaultAgent'](){const _0x2bb7ce=a109_0x3e47fb,_0x2d270c=this[_0x2bb7ce(0x141)][_0x2bb7ce(0x22c)];return readCachedLLMAgent(_0x2d270c)||undefined;}[a109_0x3e47fb(0x21b)](){const _0x2e0e4d=a109_0x3e47fb,_0x7e7985=this[_0x2e0e4d(0x141)][_0x2e0e4d(0x22c)];clearCachedLLMAgent(_0x7e7985);}async['models'](){const _0x2179c7=a109_0x3e47fb,_0x4eb90a=await this[_0x2179c7(0x23d)][_0x2179c7(0x202)](),_0x4088aa=[];for(const _0x20c09c of _0x4eb90a['availableModelNames']){const _0x20ee1a=_0x4eb90a[_0x2179c7(0x150)][_0x20c09c];_0x20ee1a&&_0x4088aa[_0x2179c7(0x1db)]({'name':_0x20c09c,'displayName':_0x20ee1a[_0x2179c7(0x1e3)]});}return _0x4088aa;}async[a109_0x3e47fb(0x12e)](_0x327272){const _0x1c7241=a109_0x3e47fb;return await this[_0x1c7241(0x23d)][_0x1c7241(0x12e)](_0x327272);}async[a109_0x3e47fb(0x1b6)](_0x27fe4b){const _0x1ca39e=a109_0x3e47fb,{projectId:_0x566b41}=await this[_0x1ca39e(0x1ba)](_0x27fe4b);await this[_0x1ca39e(0x23d)][_0x1ca39e(0x1b6)](_0x566b41);}async[a109_0x3e47fb(0x1d7)](_0x43165c=0x32){const _0x45bd8c=a109_0x3e47fb;return await this[_0x45bd8c(0x23d)][_0x45bd8c(0x13c)](_0x43165c);}async['getOrCreateDefaultProject'](_0x16c75b){const _0x392f2a=a109_0x3e47fb,_0x34c1d5=_0x16c75b||this['getDefaultProjectName'](),_0x15ec2b=this['context'][_0x392f2a(0x22c)];if(!_0x16c75b){const _0x1268bf=readCachedLLMProject(_0x15ec2b);if(_0x1268bf&&_0x1268bf[_0x392f2a(0x1fa)]===_0x34c1d5)try{const _0x1058dd=await this[_0x392f2a(0x23d)][_0x392f2a(0x1e9)](_0x1268bf['id']);if(_0x1058dd[_0x392f2a(0x20d)][_0x392f2a(0x1fa)]===_0x34c1d5)return _0x1058dd;}catch{}}const _0x36cbdb=await this[_0x392f2a(0x23d)][_0x392f2a(0x13c)](),_0x246335=_0x36cbdb[_0x392f2a(0x1ad)](_0x5e844d=>_0x5e844d['attributes'][_0x392f2a(0x1fa)]===_0x34c1d5);if(_0x246335)return!_0x16c75b&&writeCachedLLMProject(_0x34c1d5,_0x246335['id'],_0x15ec2b),_0x246335;const _0x379d03=await this[_0x392f2a(0x23d)][_0x392f2a(0x12e)]({'name':_0x34c1d5,'description':'Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20'+getSanitizedUsername()+')'});return!_0x16c75b&&writeCachedLLMProject(_0x34c1d5,_0x379d03['id'],_0x15ec2b),_0x379d03;}async[a109_0x3e47fb(0x16c)](_0x1304a7){const _0x4065de=a109_0x3e47fb,_0x1f2653=await this[_0x4065de(0x23d)][_0x4065de(0x13c)](),_0x23a34c=_0x1f2653['filter'](_0x34090d=>_0x34090d[_0x4065de(0x20d)][_0x4065de(0x1fa)]===_0x1304a7);if(_0x23a34c[_0x4065de(0x154)]===0x0)throw new SDKError(ErrorCode[_0x4065de(0x181)],'Project\x20not\x20found:\x20'+_0x1304a7,undefined,{'helpText':_0x4065de(0x1c2)});if(_0x23a34c[_0x4065de(0x154)]>0x1)throw new SDKError(ErrorCode['INTERNAL'],_0x4065de(0x180)+_0x1304a7+_0x4065de(0x147));return _0x23a34c[0x0]['id'];}async[a109_0x3e47fb(0x1ba)](_0x1503f4){const _0x29b9b7=a109_0x3e47fb,_0x2d27cb=await this[_0x29b9b7(0x23d)][_0x29b9b7(0x13c)](),_0x450ed5=_0x2d27cb[_0x29b9b7(0x1ad)](_0x3c5421=>_0x3c5421[_0x29b9b7(0x20d)]['name']===_0x1503f4);if(_0x450ed5)return{'projectId':_0x450ed5['id'],'project':_0x450ed5};throw new SDKError(ErrorCode[_0x29b9b7(0x181)],_0x29b9b7(0x16a)+_0x1503f4,undefined,{'helpText':_0x29b9b7(0x1c2)});}async[a109_0x3e47fb(0x1eb)](_0x5b2583=a109_0x3e47fb(0x1be),_0x13495d=0x0,_0x48006a){const _0x2cc13b=a109_0x3e47fb,_0x2149a1=0xa;let _0x42ba24=0x0,_0x5b048d;while(_0x42ba24<_0x2149a1){try{const _0x3fe4e4=await this[_0x2cc13b(0x241)](_0x5b048d),_0x26e3d8=_0x3fe4e4['id'],_0xed4041=[_0x2cc13b(0x168),_0x2cc13b(0x19d),_0x2cc13b(0x233),_0x2cc13b(0x126),_0x2cc13b(0x133)],_0x25bf51=_0x13495d===0x0?_0x2cc13b(0x171)+_0x5b2583:'tdx_'+_0x5b2583+'_reasoning_'+_0xed4041[_0x13495d],_0x54f27a=await this[_0x2cc13b(0x23d)][_0x2cc13b(0x13a)](_0x26e3d8),_0x11c6ad=_0x54f27a[_0x2cc13b(0x1ad)](_0x5e1bb1=>_0x5e1bb1[_0x2cc13b(0x20d)][_0x2cc13b(0x1fa)]===_0x25bf51);if(_0x11c6ad)return _0x11c6ad;const _0x2eaa54=_0x13495d>0x0?0x1:_0x48006a;return await this[_0x2cc13b(0x23d)][_0x2cc13b(0x18a)]({'name':_0x25bf51,'projectId':_0x26e3d8,'modelType':_0x5b2583,'systemPrompt':'','temperature':_0x2eaa54,'reasoningEffort':_0x13495d>0x0?_0x13495d:undefined});}catch(_0x168ff0){if(_0x168ff0 instanceof HTTPClientError){const _0x56c52d=_0x168ff0[_0x2cc13b(0x209)];if(_0x56c52d>=0x190&&_0x56c52d<0x1f4){if(_0x56c52d===0x191)throw new SDKError(ErrorCode[_0x2cc13b(0x125)],_0x2cc13b(0x208),_0x168ff0);else{if(_0x56c52d===0x193)throw new SDKError(ErrorCode[_0x2cc13b(0x16b)],_0x2cc13b(0x1e4),_0x168ff0);}throw _0x168ff0;}}if(errorContains(_0x168ff0,_0x2cc13b(0x1fe),_0x2cc13b(0x243),_0x2cc13b(0x1e5))){_0x42ba24++;if(_0x42ba24>=_0x2149a1)throw new SDKError(ErrorCode[_0x2cc13b(0x17c)],_0x2cc13b(0x166)+_0x2149a1+_0x2cc13b(0x21d),_0x168ff0);const _0x57b8b7=this[_0x2cc13b(0x16f)]();_0x5b048d=_0x57b8b7+'_'+generateRandomHex();continue;}throw _0x168ff0;}}throw new SDKError(ErrorCode['INTERNAL'],_0x2cc13b(0x215));}async[a109_0x3e47fb(0x1f7)](_0x3ad615,_0x4ecda1){const _0x26ff7d=a109_0x3e47fb,_0x2184f9=_0x4ecda1||this[_0x26ff7d(0x182)],_0xfde241=await this[_0x26ff7d(0x23d)][_0x26ff7d(0x13a)](_0x2184f9),_0x198860=_0xfde241[_0x26ff7d(0x153)](_0x2c3b49=>_0x2c3b49['attributes']['name']===_0x3ad615);if(_0x198860[_0x26ff7d(0x154)]===0x0){const _0x39a6ac=_0x2184f9?_0x26ff7d(0x129)+_0x2184f9:'';throw new SDKError(ErrorCode[_0x26ff7d(0x1a8)],_0x26ff7d(0x149)+_0x3ad615+_0x39a6ac,undefined,{'helpText':_0x2184f9?_0x26ff7d(0x207):'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(_0x198860[_0x26ff7d(0x154)]>0x1)throw new SDKError(ErrorCode['INTERNAL'],_0x26ff7d(0x1ca)+_0x3ad615+'\x27.\x20This\x20should\x20not\x20happen.');return _0x198860[0x0]['id'];}async[a109_0x3e47fb(0x1b1)](_0x5a3851){const _0x21854e=a109_0x3e47fb,_0x3b48e5=_0x5a3851||this[_0x21854e(0x182)];return await this['client'][_0x21854e(0x13a)](_0x3b48e5);}async[a109_0x3e47fb(0x225)](_0x14be0d){const _0x278ad6=a109_0x3e47fb;return await this[_0x278ad6(0x23d)][_0x278ad6(0x12d)](_0x14be0d);}async[a109_0x3e47fb(0x22a)](_0x46faa6){const _0x38deed=a109_0x3e47fb;return await this[_0x38deed(0x23d)][_0x38deed(0x1f1)](_0x46faa6);}async['createAgent'](_0x2c4e12){const _0x599f7d=a109_0x3e47fb;return await this[_0x599f7d(0x23d)][_0x599f7d(0x18a)](_0x2c4e12);}async['updateAgent'](_0x593f6e,_0x398373){const _0x3bac48=a109_0x3e47fb;return await this[_0x3bac48(0x23d)]['updateAgent'](_0x593f6e,_0x398373);}async['deleteAgent'](_0x129d36){const _0x236a2d=a109_0x3e47fb;await this[_0x236a2d(0x23d)]['deleteAgent'](_0x129d36);}async[a109_0x3e47fb(0x14b)](_0xb0fcc4){const _0x445cf8=a109_0x3e47fb;return await this[_0x445cf8(0x23d)][_0x445cf8(0x14b)]({'agentId':_0xb0fcc4});}async*[a109_0x3e47fb(0x135)](_0x3b22cb,_0x5847e7){const _0x1196fc=a109_0x3e47fb;let _0x3e2450=_0x5847e7?.['chatId'];const _0x1c38eb=_0x5847e7?.[_0x1196fc(0x222)];if(!_0x3e2450){if(!_0x1c38eb)throw new Error(_0x1196fc(0x17d));const _0x421c8a=await this['client'][_0x1196fc(0x14b)]({'agentId':_0x1c38eb});_0x3e2450=_0x421c8a['id'],yield{'type':_0x1196fc(0x23b),'data':{'chatId':_0x3e2450,'agentId':_0x1c38eb,'projectId':_0x421c8a['attributes'][_0x1196fc(0x223)]}};}for await(const _0x4a4806 of this[_0x1196fc(0x23d)][_0x1196fc(0x22b)](_0x3e2450,_0x3b22cb,_0x5847e7?.[_0x1196fc(0x1bd)])){yield{'type':_0x1196fc(0x240),'data':_0x4a4806};}}async[a109_0x3e47fb(0x11f)](_0x46aedd=0x32){const _0x4ba504=a109_0x3e47fb;return await this['client'][_0x4ba504(0x138)](_0x46aedd);}async[a109_0x3e47fb(0x1a6)](_0x37b11f){const _0x143474=a109_0x3e47fb;return await this[_0x143474(0x23d)][_0x143474(0x1b8)](_0x37b11f);}async[a109_0x3e47fb(0x16d)](_0x5f40a3){const _0x24294b=a109_0x3e47fb;return await this[_0x24294b(0x23d)][_0x24294b(0x16d)](_0x5f40a3);}async[a109_0x3e47fb(0x186)](_0x5b7447){const _0x26df60=a109_0x3e47fb;return await this[_0x26df60(0x23d)][_0x26df60(0x13b)](_0x5b7447);}async[a109_0x3e47fb(0x1c5)](_0x5255dc,_0x4751a5,_0x3971db){const _0x2a3b6d=a109_0x3e47fb,_0x16d3da=_0x3971db?.[_0x2a3b6d(0x1ec)]??![],{projectId:_0x199701,project:_0x540bfc}=await this[_0x2a3b6d(0x1ba)](_0x5255dc),_0x569e96=_0x540bfc[_0x2a3b6d(0x20d)]['name'],_0xa4acb9=_0x4751a5||_0x569e96+_0x2a3b6d(0x1f8);if(a109_0x46e9cb[_0x2a3b6d(0x17a)](_0xa4acb9)&&!_0x16d3da)throw new SDKError(ErrorCode[_0x2a3b6d(0x17c)],_0x2a3b6d(0x1c7)+_0xa4acb9,undefined,{'helpText':_0x2a3b6d(0x1df)});const _0x29f969=await this['client'][_0x2a3b6d(0x12d)](_0x199701),_0x3351a2=await this[_0x2a3b6d(0x23d)][_0x2a3b6d(0x211)](_0x199701),_0x5d8a89=await this[_0x2a3b6d(0x23d)][_0x2a3b6d(0x134)](_0x199701),_0x196f8c=await this['client'][_0x2a3b6d(0x13d)](_0x199701);if(!_0x16d3da){a109_0x46e9cb[_0x2a3b6d(0x1d8)](_0xa4acb9,{'recursive':!![]});const _0x147123={'version':_0x2a3b6d(0x1ab),'exportedAt':new Date()[_0x2a3b6d(0x242)](),'exportedFrom':{'site':this[_0x2a3b6d(0x141)]['site'],'projectId':_0x199701,'projectName':_0x569e96},'project':_0x540bfc};a109_0x46e9cb[_0x2a3b6d(0x1b4)](a109_0x51353b['join'](_0xa4acb9,_0x2a3b6d(0x14a)),JSON[_0x2a3b6d(0x184)](_0x147123,null,0x2)),a109_0x46e9cb[_0x2a3b6d(0x1b4)](a109_0x51353b[_0x2a3b6d(0x151)](_0xa4acb9,'agents.json'),JSON[_0x2a3b6d(0x184)](_0x29f969,null,0x2)),a109_0x46e9cb['writeFileSync'](a109_0x51353b[_0x2a3b6d(0x151)](_0xa4acb9,_0x2a3b6d(0x1bc)),JSON['stringify'](_0x3351a2,null,0x2)),a109_0x46e9cb[_0x2a3b6d(0x1b4)](a109_0x51353b[_0x2a3b6d(0x151)](_0xa4acb9,'prompts.json'),JSON[_0x2a3b6d(0x184)](_0x5d8a89,null,0x2)),a109_0x46e9cb['writeFileSync'](a109_0x51353b[_0x2a3b6d(0x151)](_0xa4acb9,'integrations.json'),JSON[_0x2a3b6d(0x184)](_0x196f8c,null,0x2));}return{'projectName':_0x569e96,'outputDir':_0xa4acb9,'counts':{'agents':_0x29f969[_0x2a3b6d(0x154)],'knowledgeBases':_0x3351a2[_0x2a3b6d(0x154)],'prompts':_0x5d8a89['length'],'integrations':_0x196f8c[_0x2a3b6d(0x154)]}};}async[a109_0x3e47fb(0x226)](_0x33dfb2,_0x3bad1e){const _0x59da1a=a109_0x3e47fb,_0x1c2193=_0x3bad1e?.[_0x59da1a(0x1ec)]??![],_0x41a375=this[_0x59da1a(0x139)](_0x33dfb2),_0x437a89=_0x41a375[_0x59da1a(0x15a)][_0x59da1a(0x1e1)],_0x4a37c6=this[_0x59da1a(0x141)][_0x59da1a(0x1e1)],_0x1c966c=_0x437a89!==_0x4a37c6?_0x437a89:undefined,_0xae4ab8=this[_0x59da1a(0x123)](a109_0x51353b[_0x59da1a(0x151)](_0x33dfb2,'agents.json'),[]),_0x279742=this[_0x59da1a(0x123)](a109_0x51353b[_0x59da1a(0x151)](_0x33dfb2,_0x59da1a(0x1bc)),[]),_0x33d6ca=this[_0x59da1a(0x123)](a109_0x51353b[_0x59da1a(0x151)](_0x33dfb2,_0x59da1a(0x1bf)),[]),_0x1251f6=this[_0x59da1a(0x123)](a109_0x51353b[_0x59da1a(0x151)](_0x33dfb2,_0x59da1a(0x136)),[]),_0x3f81e4=_0x3bad1e?.[_0x59da1a(0x1fa)]||_0x41a375['exportedFrom']['projectName'];if(_0x1c2193){const _0x1993bd=new Map(),_0x514b08=[..._0xae4ab8],_0x7657d7=_0xae4ab8[_0x59da1a(0x154)]+0x1;let _0x5be842=0x0;while(_0x514b08['length']>0x0&&_0x5be842<_0x7657d7){_0x5be842++;const _0x56b5b6=[];for(const _0x5cc1a4 of _0x514b08){canCreateAgent(_0x5cc1a4,_0x1993bd)?_0x1993bd[_0x59da1a(0x137)](_0x5cc1a4['id'],'dry-run-'+_0x5cc1a4['id']):_0x56b5b6[_0x59da1a(0x1db)](_0x5cc1a4);}if(_0x56b5b6[_0x59da1a(0x154)]===_0x514b08[_0x59da1a(0x154)])throw new SDKError(ErrorCode[_0x59da1a(0x1fd)],_0x59da1a(0x1a3),undefined,{'helpText':_0x59da1a(0x17e)});_0x514b08[_0x59da1a(0x154)]=0x0,_0x514b08['push'](..._0x56b5b6);}const _0x3dfb02=_0x33d6ca[_0x59da1a(0x153)](_0x53ce57=>_0x1993bd['has'](_0x53ce57['attributes'][_0x59da1a(0x222)]))[_0x59da1a(0x154)];return{'projectName':_0x3f81e4,'projectId':_0x59da1a(0x1a1),'counts':{'agents':_0xae4ab8[_0x59da1a(0x154)],'knowledgeBases':_0x279742[_0x59da1a(0x154)],'prompts':_0x3dfb02,'integrations':_0x1251f6['length']},'sourceSite':_0x1c966c};}const _0x1db9cd=await this[_0x59da1a(0x23d)][_0x59da1a(0x12e)]({'name':_0x3f81e4,'description':_0x41a375[_0x59da1a(0x19b)]['attributes']['description']}),_0x1c0514=_0x1db9cd['id'],_0x4f86c6=new Map(),_0x28e905=new Map(),_0x4224ea=new Map();for(const _0x508489 of _0x279742){const _0x1760b6=await this[_0x59da1a(0x23d)]['createKnowledgeBase']({'projectId':_0x1c0514,'name':_0x508489['attributes'][_0x59da1a(0x1fa)],'tdDatabaseName':_0x508489[_0x59da1a(0x20d)][_0x59da1a(0x1e7)],'tables':_0x508489[_0x59da1a(0x20d)][_0x59da1a(0x19e)]});_0x4f86c6['set'](_0x508489['id'],_0x1760b6['id']);}const _0x49332d=[..._0xae4ab8],_0x19ab41=_0xae4ab8['length']+0x1;let _0x5beb97=0x0;while(_0x49332d['length']>0x0&&_0x5beb97<_0x19ab41){_0x5beb97++;const _0x3cd1e0=[];for(const _0xb30013 of _0x49332d){if(canCreateAgent(_0xb30013,_0x28e905)){const _0x591566=remapToolIds(_0xb30013['attributes'][_0x59da1a(0x124)],_0x4f86c6,_0x28e905),_0x56ea99=remapVariableIds(_0xb30013['attributes']['variables'],_0x4f86c6),_0x395cb4=await this[_0x59da1a(0x23d)][_0x59da1a(0x127)]({'name':_0xb30013[_0x59da1a(0x20d)][_0x59da1a(0x1fa)],'projectId':_0x1c0514,'systemPrompt':_0xb30013[_0x59da1a(0x20d)][_0x59da1a(0x1f6)],'starterMessage':_0xb30013[_0x59da1a(0x20d)][_0x59da1a(0x237)],'modelType':migrateModelType(_0xb30013[_0x59da1a(0x20d)][_0x59da1a(0x1d6)]),'maxToolIterations':_0xb30013['attributes'][_0x59da1a(0x20e)],'temperature':_0xb30013[_0x59da1a(0x20d)][_0x59da1a(0x198)],'reasoningEffort':_0xb30013[_0x59da1a(0x20d)][_0x59da1a(0x132)],'outputs':_0xb30013[_0x59da1a(0x20d)][_0x59da1a(0x1f4)],'tools':_0x591566,'variables':_0x56ea99});_0x28e905['set'](_0xb30013['id'],_0x395cb4['id']);}else _0x3cd1e0['push'](_0xb30013);}if(_0x3cd1e0[_0x59da1a(0x154)]===_0x49332d[_0x59da1a(0x154)])throw new SDKError(ErrorCode[_0x59da1a(0x1fd)],_0x59da1a(0x1a3),undefined,{'helpText':'The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.'});_0x49332d[_0x59da1a(0x154)]=0x0,_0x49332d[_0x59da1a(0x1db)](..._0x3cd1e0);}for(const _0x466a3b of _0x33d6ca){const _0x1a5b9a=_0x28e905[_0x59da1a(0x1dc)](_0x466a3b['attributes']['agentId']);if(!_0x1a5b9a)continue;const _0x3296a5=await this[_0x59da1a(0x23d)][_0x59da1a(0x173)]({'projectId':_0x1c0514,'agentId':_0x1a5b9a,'name':_0x466a3b[_0x59da1a(0x20d)][_0x59da1a(0x1fa)],'systemPrompt':_0x466a3b[_0x59da1a(0x20d)][_0x59da1a(0x1f6)],'template':_0x466a3b[_0x59da1a(0x20d)]['template'],'jsonSchemaHint':_0x466a3b[_0x59da1a(0x20d)][_0x59da1a(0x146)]});_0x4224ea[_0x59da1a(0x137)](_0x466a3b['id'],_0x3296a5['id']);}for(const _0x53ec83 of _0x1251f6){const _0x31abf8=_0x53ec83[_0x59da1a(0x20d)][_0x59da1a(0x219)][_0x59da1a(0x217)](_0x5a4936=>({..._0x5a4936,'promptId':_0x4224ea['get'](_0x5a4936[_0x59da1a(0x210)])||_0x5a4936['promptId']}));await this[_0x59da1a(0x23d)][_0x59da1a(0x192)]({'projectId':_0x1c0514,'serviceType':_0x53ec83[_0x59da1a(0x20d)][_0x59da1a(0x228)],'actions':_0x31abf8,'slackMessageMode':_0x53ec83['attributes'][_0x59da1a(0x18d)],'chatIgnoreManagedActions':_0x53ec83[_0x59da1a(0x20d)]['chatIgnoreManagedActions'],'chatWelcomeMessage':_0x53ec83[_0x59da1a(0x20d)][_0x59da1a(0x239)],'webhookCorsOrigins':_0x53ec83[_0x59da1a(0x20d)][_0x59da1a(0x1e8)]});}return{'projectName':_0x3f81e4,'projectId':_0x1c0514,'counts':{'agents':_0x28e905[_0x59da1a(0x179)],'knowledgeBases':_0x4f86c6[_0x59da1a(0x179)],'prompts':_0x4224ea['size'],'integrations':_0x1251f6[_0x59da1a(0x154)]},'sourceSite':_0x1c966c};}['loadJsonFile'](_0x310596,_0x4191f7){const _0x45b646=a109_0x3e47fb;if(!a109_0x46e9cb['existsSync'](_0x310596))return _0x4191f7;return JSON[_0x45b646(0x169)](a109_0x46e9cb[_0x45b646(0x22e)](_0x310596,_0x45b646(0x177)));}[a109_0x3e47fb(0x139)](_0x42b2db){const _0x33d5cd=a109_0x3e47fb;if(!a109_0x46e9cb[_0x33d5cd(0x17a)](_0x42b2db))throw new SDKError(ErrorCode[_0x33d5cd(0x167)],_0x33d5cd(0x1cb)+_0x42b2db,undefined,{'helpText':_0x33d5cd(0x1a4)});const _0x26a4e3=a109_0x51353b[_0x33d5cd(0x151)](_0x42b2db,_0x33d5cd(0x14a));if(!a109_0x46e9cb[_0x33d5cd(0x17a)](_0x26a4e3))throw new SDKError(ErrorCode[_0x33d5cd(0x148)],_0x33d5cd(0x1a2)+_0x42b2db,undefined,{'helpText':_0x33d5cd(0x1c3)});const _0x40bc86=JSON[_0x33d5cd(0x169)](a109_0x46e9cb[_0x33d5cd(0x22e)](_0x26a4e3,_0x33d5cd(0x177)));if(!isSupportedBackupVersion(_0x40bc86['version']))throw new SDKError(ErrorCode[_0x33d5cd(0x148)],_0x33d5cd(0x128)+_0x40bc86[_0x33d5cd(0x178)],undefined,{'helpText':_0x33d5cd(0x229)});return _0x40bc86;}async[a109_0x3e47fb(0x130)](_0x1a3e47,_0xb36e1a,_0x28f4ad){const _0x4e0cc4=a109_0x3e47fb,{projectId:_0x252522,project:_0x37676a}=await this['resolveProjectName'](_0x1a3e47),_0x24493e=_0x37676a['attributes']['name'];let _0x27b854;if(_0xb36e1a)_0x27b854=_0xb36e1a;else{const _0x26643d=a109_0x51353b[_0x4e0cc4(0x151)](process[_0x4e0cc4(0x234)](),_0x4e0cc4(0x1b1)),_0xbd2632=getSanitizedPathWithMigration(_0x26643d,_0x24493e);_0xbd2632['renamed']&&this[_0x4e0cc4(0x214)][_0x4e0cc4(0x1dd)](_0x4e0cc4(0x122)+a109_0x51353b[_0x4e0cc4(0x188)](_0xbd2632[_0x4e0cc4(0x187)])+_0x4e0cc4(0x1fb)+a109_0x51353b[_0x4e0cc4(0x188)](_0xbd2632[_0x4e0cc4(0x20a)])),_0x27b854=_0xbd2632['path'];}const _0x3e544d=await this[_0x4e0cc4(0x23d)][_0x4e0cc4(0x12d)](_0x252522),_0x48fff4=await this[_0x4e0cc4(0x23d)][_0x4e0cc4(0x211)](_0x252522),_0x47ba77=await this[_0x4e0cc4(0x23d)][_0x4e0cc4(0x18b)](_0x252522),_0x3d6a76=await safeListOrEmpty(()=>this[_0x4e0cc4(0x23d)][_0x4e0cc4(0x121)](_0x252522)),_0x236778=await safeListOrEmpty(()=>this['client'][_0x4e0cc4(0x21c)](_0x252522)),_0x250223=await this['client'][_0x4e0cc4(0x134)](_0x252522),_0xcbc604=await this[_0x4e0cc4(0x23d)]['listIntegrations'](_0x252522),_0x4efee4=await safeListOrEmpty(()=>this[_0x4e0cc4(0x23d)][_0x4e0cc4(0x196)](_0x252522)),_0x3131c5=await safeListOrEmpty(()=>this[_0x4e0cc4(0x23d)][_0x4e0cc4(0x14d)](_0x252522)),_0xe48ece=_0xcbc604[_0x4e0cc4(0x153)](_0x21d57f=>!_0x21d57f[_0x4e0cc4(0x20d)]['isManaged']&&SAFE_INTEGRATION_TYPES[_0x4e0cc4(0x20f)](_0x21d57f[_0x4e0cc4(0x20d)][_0x4e0cc4(0x228)]['toLowerCase']())),_0x2dca46=new Map(),_0xf75a68=new Map(),_0x1294b5=new Map(),_0x377a8a=new Map(),_0x9b9319=new Map(),_0x4b77f3=new Map(),_0x2f5032=new Map();for(const _0x565619 of _0x3e544d){_0x2dca46[_0x4e0cc4(0x137)](_0x565619['id'],_0x565619[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)]);}for(const _0x13416b of _0x48fff4){_0xf75a68['set'](_0x13416b['id'],_0x13416b['attributes']['name']);}for(const _0x220a82 of _0x47ba77){_0x1294b5[_0x4e0cc4(0x137)](_0x220a82['id'],_0x220a82[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)]);}for(const _0x47d82b of _0x3d6a76){_0x377a8a[_0x4e0cc4(0x137)](_0x47d82b['id'],_0x47d82b['attributes'][_0x4e0cc4(0x1fa)]);}for(const _0x517487 of _0x236778){_0x9b9319[_0x4e0cc4(0x137)](_0x517487['id'],_0x517487['attributes'][_0x4e0cc4(0x1fa)]);}for(const _0x294dcc of _0x250223){_0x4b77f3['set'](_0x294dcc['id'],_0x294dcc[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)]);}for(const _0xf952b3 of _0x4efee4){_0x2f5032[_0x4e0cc4(0x137)](_0xf952b3['id'],_0xf952b3[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)]);}const _0x4c24ad={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0xf75a68,'TextKnowledgeBase':_0x1294b5,'Agent':_0x2dca46,'WebSearchTool':_0x9b9319,'ImageGenerator':_0x377a8a,'ExperimentalKnowledgeBase':_0x2f5032}),'resolvePromptName':async _0x424ed7=>_0x4b77f3[_0x4e0cc4(0x1dc)](_0x424ed7),'onWarning':_0xde415f=>this[_0x4e0cc4(0x214)][_0x4e0cc4(0x12f)](_0xde415f)},_0x4b4043={'projectName':_0x24493e,'outputDir':_0x27b854,'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}}},_0x275813=[],_0x1bb350=[];for(const _0x142c2e of _0x3e544d){const _0x4c3120=getSanitizedPathWithMigration(_0x27b854,_0x142c2e[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)]);_0x4c3120[_0x4e0cc4(0x212)]&&this['logger'][_0x4e0cc4(0x1dd)](_0x4e0cc4(0x158)+a109_0x51353b[_0x4e0cc4(0x188)](_0x4c3120[_0x4e0cc4(0x187)])+_0x4e0cc4(0x1fb)+a109_0x51353b[_0x4e0cc4(0x188)](_0x4c3120[_0x4e0cc4(0x20a)]));const _0xac3cac=_0x4c3120[_0x4e0cc4(0x20a)],_0xafd2fa=a109_0x51353b['join'](_0xac3cac,_0x4e0cc4(0x23e)),_0x1d6c8e=a109_0x51353b[_0x4e0cc4(0x151)](_0xac3cac,_0x4e0cc4(0x18c)),_0x5e545e=a109_0x51353b[_0x4e0cc4(0x151)](_0xac3cac,_0x4e0cc4(0x194)),{yaml:_0x471d22,systemPrompt:_0x137590,starterMessage:_0xf3682e}=await agentResponseToDef(_0x142c2e,_0x4c24ad),_0xc88901=toAgentYamlString(_0x471d22),_0x42425c=!a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x1d6c8e);let _0x2d15f8=_0x42425c,_0x58c8d1;if(!_0x42425c){const _0x200188=a109_0x46e9cb[_0x4e0cc4(0x17a)](_0xafd2fa)?a109_0x46e9cb[_0x4e0cc4(0x22e)](_0xafd2fa,_0x4e0cc4(0x177)):'',_0x1f3df3=a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x1d6c8e,_0x4e0cc4(0x177)),_0x282a13='#\x20prompt.md\x0a'+_0x200188+_0x4e0cc4(0x145)+_0x1f3df3,_0x129894=_0x4e0cc4(0x197)+_0x137590+_0x4e0cc4(0x145)+_0xc88901,_0x1dce27=generateDiff(_0x282a13,_0x129894);_0x2d15f8=hasChanges(_0x1dce27),_0x2d15f8&&(_0x58c8d1=formatDiffWithColors(_0x1dce27));}_0x275813['push']({'path':_0xac3cac,'content':'','isDir':!![]}),_0x275813[_0x4e0cc4(0x1db)]({'path':_0xafd2fa,'content':_0x137590}),_0x275813[_0x4e0cc4(0x1db)]({'path':_0x1d6c8e,'content':_0xc88901});_0xf3682e&&_0xf3682e[_0x4e0cc4(0x20f)]('\x0a')&&_0x275813['push']({'path':_0x5e545e,'content':_0xf3682e});_0x4b4043[_0x4e0cc4(0x1b1)][_0x4e0cc4(0x1db)]({'agentName':_0x142c2e[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)],'outputPath':_0xac3cac,'isNew':_0x42425c,'hasChanges':_0x2d15f8,'diff':_0x58c8d1}),_0x4b4043[_0x4e0cc4(0x175)]['agents'][_0x4e0cc4(0x236)]++;if(_0x42425c)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1b1)][_0x4e0cc4(0x232)]++;else{if(_0x2d15f8)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1b1)][_0x4e0cc4(0x157)]++;else _0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1b1)][_0x4e0cc4(0x200)]++;}}for(const _0x9638f of _0x48fff4){if(_0x9638f[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1a5)])continue;const _0x2aa0d1=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x27b854),_0x9638f['attributes'][_0x4e0cc4(0x1fa)],_0x4e0cc4(0x160));_0x2aa0d1['renamed']&&this['logger'][_0x4e0cc4(0x1dd)](_0x4e0cc4(0x204)+a109_0x51353b[_0x4e0cc4(0x188)](_0x2aa0d1[_0x4e0cc4(0x187)])+_0x4e0cc4(0x1fb)+a109_0x51353b[_0x4e0cc4(0x188)](_0x2aa0d1['path']));const _0x2f5d20=_0x2aa0d1[_0x4e0cc4(0x20a)],_0x402f03=apiKnowledgeBaseToYaml(_0x9638f),_0x1ab0f9=toKnowledgeBaseYamlString(_0x402f03),_0x49ff8e=!a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x2f5d20);let _0x5b36ca=_0x49ff8e,_0x241aec;if(!_0x49ff8e){const _0x37ce29=a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x2f5d20,_0x4e0cc4(0x177)),_0x5aeaa8=generateDiff(_0x37ce29,_0x1ab0f9);_0x5b36ca=hasChanges(_0x5aeaa8),_0x5b36ca&&(_0x241aec=formatDiffWithColors(_0x5aeaa8));}_0x275813[_0x4e0cc4(0x1db)]({'path':_0x2f5d20,'content':_0x1ab0f9}),_0x4b4043[_0x4e0cc4(0x238)][_0x4e0cc4(0x1db)]({'name':_0x9638f[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)],'outputPath':_0x2f5d20,'isNew':_0x49ff8e,'hasChanges':_0x5b36ca,'diff':_0x241aec}),_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x238)]['total']++;if(_0x49ff8e)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x238)][_0x4e0cc4(0x232)]++;else{if(_0x5b36ca)_0x4b4043[_0x4e0cc4(0x175)]['knowledgeBases'][_0x4e0cc4(0x157)]++;else _0x4b4043[_0x4e0cc4(0x175)]['knowledgeBases']['unchanged']++;}}for(const _0x167a7e of _0x47ba77){if(_0x167a7e[_0x4e0cc4(0x20d)]['isManaged'])continue;const _0xee769f=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x27b854),_0x167a7e[_0x4e0cc4(0x20d)]['name'],_0x4e0cc4(0x16e));_0xee769f[_0x4e0cc4(0x212)]&&this[_0x4e0cc4(0x214)][_0x4e0cc4(0x1dd)]('Renamed\x20text\x20KB\x20file:\x20'+a109_0x51353b[_0x4e0cc4(0x188)](_0xee769f[_0x4e0cc4(0x187)])+'\x20→\x20'+a109_0x51353b[_0x4e0cc4(0x188)](_0xee769f[_0x4e0cc4(0x20a)]));const _0x134630=_0xee769f[_0x4e0cc4(0x20a)],_0x47fb33=toTextKnowledgeBaseMd(_0x167a7e[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)],_0x167a7e[_0x4e0cc4(0x20d)][_0x4e0cc4(0x14f)]),_0x18b980=!a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x134630);let _0x32783f=_0x18b980,_0x5eda27;if(!_0x18b980){const _0x4624ed=a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x134630,_0x4e0cc4(0x177)),_0x3c6d83=generateDiff(_0x4624ed,_0x47fb33);_0x32783f=hasChanges(_0x3c6d83),_0x32783f&&(_0x5eda27=formatDiffWithColors(_0x3c6d83));}_0x275813[_0x4e0cc4(0x1db)]({'path':_0x134630,'content':_0x47fb33}),_0x4b4043[_0x4e0cc4(0x189)][_0x4e0cc4(0x1db)]({'name':_0x167a7e['attributes']['name'],'outputPath':_0x134630,'isNew':_0x18b980,'hasChanges':_0x32783f,'diff':_0x5eda27}),_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x189)]['total']++;if(_0x18b980)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x189)][_0x4e0cc4(0x232)]++;else{if(_0x32783f)_0x4b4043[_0x4e0cc4(0x175)]['textKnowledgeBases'][_0x4e0cc4(0x157)]++;else _0x4b4043[_0x4e0cc4(0x175)]['textKnowledgeBases'][_0x4e0cc4(0x200)]++;}}for(const _0x528619 of _0x250223){if(_0x528619[_0x4e0cc4(0x20d)]['isManaged'])continue;const _0x22c221=getSanitizedPathWithMigration(getPromptsDir(_0x27b854),_0x528619[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)],_0x4e0cc4(0x160));_0x22c221[_0x4e0cc4(0x212)]&&this[_0x4e0cc4(0x214)][_0x4e0cc4(0x1dd)](_0x4e0cc4(0x205)+a109_0x51353b['basename'](_0x22c221[_0x4e0cc4(0x187)])+'\x20→\x20'+a109_0x51353b[_0x4e0cc4(0x188)](_0x22c221[_0x4e0cc4(0x20a)]));const _0xf5c365=_0x22c221[_0x4e0cc4(0x20a)],_0x480e4f=await apiPromptToYaml(_0x528619,_0x4c24ad);if(!_0x480e4f)continue;const _0x47503d=toPromptYamlString(_0x480e4f),_0xe2776f=!a109_0x46e9cb[_0x4e0cc4(0x17a)](_0xf5c365);let _0x44b048=_0xe2776f,_0x48e50a;if(!_0xe2776f){const _0x52a778=a109_0x46e9cb[_0x4e0cc4(0x22e)](_0xf5c365,_0x4e0cc4(0x177)),_0x21e5df=generateDiff(_0x52a778,_0x47503d);_0x44b048=hasChanges(_0x21e5df),_0x44b048&&(_0x48e50a=formatDiffWithColors(_0x21e5df));}_0x275813[_0x4e0cc4(0x1db)]({'path':_0xf5c365,'content':_0x47503d}),_0x4b4043[_0x4e0cc4(0x164)][_0x4e0cc4(0x1db)]({'name':_0x528619['attributes'][_0x4e0cc4(0x1fa)],'outputPath':_0xf5c365,'isNew':_0xe2776f,'hasChanges':_0x44b048,'diff':_0x48e50a}),_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x164)][_0x4e0cc4(0x236)]++;if(_0xe2776f)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x164)][_0x4e0cc4(0x232)]++;else{if(_0x44b048)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x164)]['updated']++;else _0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x164)][_0x4e0cc4(0x200)]++;}}for(const _0x45c950 of _0xe48ece){const _0x438219=_0x45c950[_0x4e0cc4(0x20d)]['serviceType']['toLowerCase'](),_0x30f234=getSanitizedPathWithMigration(getIntegrationsDir(_0x27b854),_0x438219,_0x4e0cc4(0x160));_0x30f234[_0x4e0cc4(0x212)]&&this['logger'][_0x4e0cc4(0x1dd)](_0x4e0cc4(0x19c)+a109_0x51353b['basename'](_0x30f234[_0x4e0cc4(0x187)])+_0x4e0cc4(0x1fb)+a109_0x51353b[_0x4e0cc4(0x188)](_0x30f234[_0x4e0cc4(0x20a)]));const _0x2a5ebd=_0x30f234[_0x4e0cc4(0x20a)],_0x24833d=await apiIntegrationToYaml(_0x45c950,_0x4c24ad),_0x3ce320=toIntegrationYamlString(_0x24833d),_0x1d8461=!a109_0x46e9cb['existsSync'](_0x2a5ebd);let _0x309152=_0x1d8461,_0x3620ef;if(!_0x1d8461){const _0x58b97b=a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x2a5ebd,'utf-8'),_0x38add3=generateDiff(_0x58b97b,_0x3ce320);_0x309152=hasChanges(_0x38add3),_0x309152&&(_0x3620ef=formatDiffWithColors(_0x38add3));}_0x275813[_0x4e0cc4(0x1db)]({'path':_0x2a5ebd,'content':_0x3ce320}),_0x4b4043['integrations'][_0x4e0cc4(0x1db)]({'name':_0x438219,'outputPath':_0x2a5ebd,'isNew':_0x1d8461,'hasChanges':_0x309152,'diff':_0x3620ef}),_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1c6)][_0x4e0cc4(0x236)]++;if(_0x1d8461)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1c6)][_0x4e0cc4(0x232)]++;else{if(_0x309152)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1c6)][_0x4e0cc4(0x157)]++;else _0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1c6)][_0x4e0cc4(0x200)]++;}}for(const _0x51b608 of _0x4efee4){if(_0x51b608['attributes']['isManaged'])continue;const _0x3f9fb6=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x27b854),_0x51b608[_0x4e0cc4(0x20d)][_0x4e0cc4(0x1fa)]);_0x3f9fb6[_0x4e0cc4(0x212)]&&this[_0x4e0cc4(0x214)]['info'](_0x4e0cc4(0x1ee)+a109_0x51353b[_0x4e0cc4(0x188)](_0x3f9fb6[_0x4e0cc4(0x187)])+_0x4e0cc4(0x1fb)+a109_0x51353b[_0x4e0cc4(0x188)](_0x3f9fb6[_0x4e0cc4(0x20a)]));const _0x2a3de3=_0x3f9fb6[_0x4e0cc4(0x20a)],_0x22a738=a109_0x51353b[_0x4e0cc4(0x151)](_0x2a3de3,sanitizeForFilesystem(_0x51b608[_0x4e0cc4(0x20d)]['name'])+_0x4e0cc4(0x160)),_0x94ffd7=a109_0x51353b['join'](_0x2a3de3,_0x4e0cc4(0x191)),_0x97fdc=apiExperimentalKnowledgeBaseToYaml(_0x51b608),_0x1f47ea=toExperimentalKnowledgeBaseYamlString(_0x97fdc),_0xd66fcd=!a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x2a3de3);let _0x56c5f8=_0xd66fcd,_0x366888,_0x28dcfc=_0x1f47ea;const _0x111ae2=[..._0x97fdc['functions']][_0x4e0cc4(0x190)]((_0x537ce7,_0x55e572)=>_0x537ce7[_0x4e0cc4(0x1fa)][_0x4e0cc4(0x1e2)](_0x55e572[_0x4e0cc4(0x1fa)]));for(const _0x154180 of _0x111ae2){_0x28dcfc+=_0x4e0cc4(0x1a0)+_0x154180[_0x4e0cc4(0x1fa)]+_0x4e0cc4(0x152)+_0x154180[_0x4e0cc4(0x1b0)]+_0x4e0cc4(0x231)+_0x154180[_0x4e0cc4(0x1fa)]+_0x4e0cc4(0x152)+_0x154180[_0x4e0cc4(0x1f9)]+'\x0a';}if(!_0xd66fcd){let _0x5a3b8b='';a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x22a738)&&(_0x5a3b8b=a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x22a738,_0x4e0cc4(0x177)));if(a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x94ffd7)){const _0x19221a=a109_0x46e9cb[_0x4e0cc4(0x23c)](_0x94ffd7,{'withFileTypes':!![]}),_0x1fa2dc=_0x19221a['filter'](_0x3a2aad=>_0x3a2aad[_0x4e0cc4(0x1ed)]())[_0x4e0cc4(0x190)]((_0x94091c,_0x309cfa)=>_0x94091c[_0x4e0cc4(0x1fa)][_0x4e0cc4(0x1e2)](_0x309cfa[_0x4e0cc4(0x1fa)]));for(const _0x25f628 of _0x1fa2dc){const _0x5a0f87=a109_0x51353b[_0x4e0cc4(0x151)](_0x94ffd7,_0x25f628[_0x4e0cc4(0x1fa)],'code.js'),_0x9a6d4d=a109_0x51353b[_0x4e0cc4(0x151)](_0x94ffd7,_0x25f628[_0x4e0cc4(0x1fa)],_0x4e0cc4(0x23f));a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x5a0f87)&&(_0x5a3b8b+=_0x4e0cc4(0x1a0)+_0x25f628[_0x4e0cc4(0x1fa)]+_0x4e0cc4(0x152)+a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x5a0f87,_0x4e0cc4(0x177))+'\x0a'),a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x9a6d4d)&&(_0x5a3b8b+='---\x20schema:\x20'+_0x25f628['name']+'\x20---\x0a'+a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x9a6d4d,_0x4e0cc4(0x177))+'\x0a');}}const _0x333532=generateDiff(_0x5a3b8b,_0x28dcfc);_0x56c5f8=hasChanges(_0x333532),_0x56c5f8&&(_0x366888=formatDiffWithColors(_0x333532));}_0x275813[_0x4e0cc4(0x1db)]({'path':_0x2a3de3,'content':'','isDir':!![]}),_0x275813['push']({'path':_0x22a738,'content':_0x1f47ea}),_0x275813[_0x4e0cc4(0x1db)]({'path':_0x94ffd7,'content':'','isDir':!![]});for(const _0x5c8c1b of _0x97fdc[_0x4e0cc4(0x191)]){const _0x2d2011=a109_0x51353b[_0x4e0cc4(0x151)](_0x94ffd7,sanitizeForFilesystem(_0x5c8c1b[_0x4e0cc4(0x1fa)])),_0x1f3c1e=a109_0x51353b[_0x4e0cc4(0x151)](_0x2d2011,'code.js'),_0x36d3e2=a109_0x51353b[_0x4e0cc4(0x151)](_0x2d2011,_0x4e0cc4(0x23f));_0x275813[_0x4e0cc4(0x1db)]({'path':_0x2d2011,'content':'','isDir':!![]}),_0x275813[_0x4e0cc4(0x1db)]({'path':_0x1f3c1e,'content':_0x5c8c1b['code']}),_0x275813[_0x4e0cc4(0x1db)]({'path':_0x36d3e2,'content':_0x5c8c1b[_0x4e0cc4(0x1f9)]});}if(a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x94ffd7)){const _0x254a29=a109_0x46e9cb['readdirSync'](_0x94ffd7,{'withFileTypes':!![]}),_0x25e247=new Set(_0x97fdc[_0x4e0cc4(0x191)][_0x4e0cc4(0x217)](_0x5d74dd=>sanitizeForFilesystem(_0x5d74dd['name'])));for(const _0x2aa88d of _0x254a29){if(_0x2aa88d[_0x4e0cc4(0x1ed)]()&&!_0x25e247[_0x4e0cc4(0x201)](_0x2aa88d[_0x4e0cc4(0x1fa)])){const _0x4ec3fd=a109_0x51353b[_0x4e0cc4(0x151)](_0x94ffd7,_0x2aa88d[_0x4e0cc4(0x1fa)]);_0x1bb350[_0x4e0cc4(0x1db)]({'path':_0x4ec3fd,'isDir':!![]});}}}_0x4b4043[_0x4e0cc4(0x1d0)]['push']({'name':_0x51b608[_0x4e0cc4(0x20d)]['name'],'outputPath':_0x2a3de3,'isNew':_0xd66fcd,'hasChanges':_0x56c5f8,'diff':_0x366888}),_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1d0)][_0x4e0cc4(0x236)]++;if(_0xd66fcd)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1d0)][_0x4e0cc4(0x232)]++;else{if(_0x56c5f8)_0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x1d0)][_0x4e0cc4(0x157)]++;else _0x4b4043[_0x4e0cc4(0x175)]['experimentalKnowledgeBases'][_0x4e0cc4(0x200)]++;}}for(const _0x1add5f of _0x3131c5){if(_0x1add5f['attributes']['isManaged'])continue;const _0x1428d5=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x27b854),_0x1add5f['attributes'][_0x4e0cc4(0x1fa)]);_0x1428d5[_0x4e0cc4(0x212)]&&this[_0x4e0cc4(0x214)][_0x4e0cc4(0x1dd)](_0x4e0cc4(0x17f)+a109_0x51353b[_0x4e0cc4(0x188)](_0x1428d5[_0x4e0cc4(0x187)])+'\x20→\x20'+a109_0x51353b[_0x4e0cc4(0x188)](_0x1428d5['path']));const _0x3cc572=_0x1428d5[_0x4e0cc4(0x20a)],_0x288353=a109_0x51353b[_0x4e0cc4(0x151)](_0x3cc572,sanitizeForFilesystem(_0x1add5f['attributes'][_0x4e0cc4(0x1fa)])+_0x4e0cc4(0x160)),_0x42cdb7=a109_0x51353b['join'](_0x3cc572,_0x4e0cc4(0x144)),_0x263c39=a109_0x51353b['join'](_0x3cc572,_0x4e0cc4(0x1fc)),_0x27be77=apiExperimentalArtifactToYaml(_0x1add5f),_0x2c6ff9=toExperimentalArtifactYamlString(_0x27be77),_0x29232d=!a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x3cc572);let _0x4d7dd7=_0x29232d,_0x501c84,_0x36f9ab=_0x2c6ff9+(_0x4e0cc4(0x213)+_0x27be77[_0x4e0cc4(0x1b0)]+'\x0a');const _0xecc3e9=[..._0x27be77[_0x4e0cc4(0x1fc)]][_0x4e0cc4(0x190)]((_0x1ec44a,_0x318399)=>_0x1ec44a[_0x4e0cc4(0x163)]['localeCompare'](_0x318399['file_name']));for(const _0x4971b0 of _0xecc3e9){_0x36f9ab+=_0x4e0cc4(0x12c)+_0x4971b0[_0x4e0cc4(0x163)]+_0x4e0cc4(0x152)+_0x4971b0['text_content']+'\x0a';}if(!_0x29232d){let _0x162357='';a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x288353)&&(_0x162357=a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x288353,_0x4e0cc4(0x177)));a109_0x46e9cb['existsSync'](_0x42cdb7)&&(_0x162357+=_0x4e0cc4(0x213)+a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x42cdb7,_0x4e0cc4(0x177))+'\x0a');if(a109_0x46e9cb['existsSync'](_0x263c39)){const _0x175ed8=a109_0x46e9cb[_0x4e0cc4(0x23c)](_0x263c39),_0xfe5c61=_0x175ed8[_0x4e0cc4(0x153)](_0x916fe9=>{const _0x98fb68=_0x4e0cc4,_0x383ddd=a109_0x51353b['join'](_0x263c39,_0x916fe9);return a109_0x46e9cb[_0x98fb68(0x156)](_0x383ddd)[_0x98fb68(0x18e)]();})['sort']((_0x44e967,_0x17b580)=>_0x44e967['localeCompare'](_0x17b580));for(const _0x5b42e2 of _0xfe5c61){const _0x15f044=a109_0x51353b[_0x4e0cc4(0x151)](_0x263c39,_0x5b42e2);_0x162357+=_0x4e0cc4(0x12c)+_0x5b42e2+_0x4e0cc4(0x152)+a109_0x46e9cb[_0x4e0cc4(0x22e)](_0x15f044,'utf-8')+'\x0a';}}const _0x4a82f8=generateDiff(_0x162357,_0x36f9ab);_0x4d7dd7=hasChanges(_0x4a82f8),_0x4d7dd7&&(_0x501c84=formatDiffWithColors(_0x4a82f8));}_0x275813['push']({'path':_0x3cc572,'content':'','isDir':!![]}),_0x275813['push']({'path':_0x288353,'content':_0x2c6ff9}),_0x275813[_0x4e0cc4(0x1db)]({'path':_0x42cdb7,'content':_0x27be77[_0x4e0cc4(0x1b0)]});if(_0x27be77['files'][_0x4e0cc4(0x154)]>0x0){_0x275813[_0x4e0cc4(0x1db)]({'path':_0x263c39,'content':'','isDir':!![]});for(const _0x482c0f of _0x27be77[_0x4e0cc4(0x1fc)]){const _0x3901c0=a109_0x51353b[_0x4e0cc4(0x151)](_0x263c39,_0x482c0f[_0x4e0cc4(0x163)]);_0x275813[_0x4e0cc4(0x1db)]({'path':_0x3901c0,'content':_0x482c0f[_0x4e0cc4(0x1cc)]});}}if(a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x263c39)){const _0x4bc695=a109_0x46e9cb[_0x4e0cc4(0x23c)](_0x263c39),_0x96b60c=new Set(_0x27be77['files'][_0x4e0cc4(0x217)](_0x495cab=>_0x495cab['file_name']));for(const _0x10fbd8 of _0x4bc695){const _0x3fdceb=a109_0x51353b['join'](_0x263c39,_0x10fbd8);a109_0x46e9cb[_0x4e0cc4(0x156)](_0x3fdceb)[_0x4e0cc4(0x18e)]()&&!_0x96b60c[_0x4e0cc4(0x201)](_0x10fbd8)&&_0x1bb350['push']({'path':_0x3fdceb});}}_0x4b4043[_0x4e0cc4(0x22d)]['push']({'name':_0x1add5f['attributes'][_0x4e0cc4(0x1fa)],'outputPath':_0x3cc572,'isNew':_0x29232d,'hasChanges':_0x4d7dd7,'diff':_0x501c84}),_0x4b4043[_0x4e0cc4(0x175)]['experimentalArtifacts']['total']++;if(_0x29232d)_0x4b4043['counts'][_0x4e0cc4(0x22d)][_0x4e0cc4(0x232)]++;else{if(_0x4d7dd7)_0x4b4043['counts'][_0x4e0cc4(0x22d)][_0x4e0cc4(0x157)]++;else _0x4b4043[_0x4e0cc4(0x175)][_0x4e0cc4(0x22d)][_0x4e0cc4(0x200)]++;}}if(_0x28f4ad?.[_0x4e0cc4(0x1ec)])return _0x4b4043;a109_0x46e9cb[_0x4e0cc4(0x1d8)](_0x27b854,{'recursive':!![]}),a109_0x46e9cb[_0x4e0cc4(0x1d8)](getKnowledgeBasesDir(_0x27b854),{'recursive':!![]}),a109_0x46e9cb[_0x4e0cc4(0x1d8)](getPromptsDir(_0x27b854),{'recursive':!![]}),a109_0x46e9cb[_0x4e0cc4(0x1d8)](getIntegrationsDir(_0x27b854),{'recursive':!![]}),a109_0x46e9cb[_0x4e0cc4(0x1d8)](getExperimentalKnowledgeBasesDir(_0x27b854),{'recursive':!![]}),a109_0x46e9cb[_0x4e0cc4(0x1d8)](getExperimentalArtifactsDir(_0x27b854),{'recursive':!![]});const _0x43d2eb=a109_0x51353b[_0x4e0cc4(0x151)](_0x27b854,'tdx.json');a109_0x46e9cb['writeFileSync'](_0x43d2eb,createAgentConfigContent(_0x24493e));for(const _0x364592 of _0x275813){if(_0x364592[_0x4e0cc4(0x21a)])a109_0x46e9cb['mkdirSync'](_0x364592[_0x4e0cc4(0x20a)],{'recursive':!![]});else{const _0x26ce3c=a109_0x51353b[_0x4e0cc4(0x224)](_0x364592[_0x4e0cc4(0x20a)]);!a109_0x46e9cb[_0x4e0cc4(0x17a)](_0x26ce3c)&&a109_0x46e9cb[_0x4e0cc4(0x1d8)](_0x26ce3c,{'recursive':!![]}),a109_0x46e9cb[_0x4e0cc4(0x1b4)](_0x364592['path'],_0x364592[_0x4e0cc4(0x18f)]);}}for(const _0x4bda75 of _0x1bb350){_0x4bda75[_0x4e0cc4(0x21a)]?(a109_0x46e9cb[_0x4e0cc4(0x1d3)](_0x4bda75[_0x4e0cc4(0x20a)],{'recursive':!![],'force':!![]}),this[_0x4e0cc4(0x214)]['info'](_0x4e0cc4(0x1bb)+a109_0x51353b[_0x4e0cc4(0x188)](a109_0x51353b[_0x4e0cc4(0x224)](_0x4bda75[_0x4e0cc4(0x20a)]))+'/'+a109_0x51353b[_0x4e0cc4(0x188)](_0x4bda75[_0x4e0cc4(0x20a)]))):(a109_0x46e9cb[_0x4e0cc4(0x1d3)](_0x4bda75['path'],{'force':!![]}),this[_0x4e0cc4(0x214)][_0x4e0cc4(0x1dd)](_0x4e0cc4(0x1c8)+a109_0x51353b[_0x4e0cc4(0x188)](a109_0x51353b['dirname'](_0x4bda75[_0x4e0cc4(0x20a)]))+'/'+a109_0x51353b[_0x4e0cc4(0x188)](_0x4bda75['path'])));}return _0x4b4043;}async['pushProject'](_0x144528,_0x5642cc){const _0x3e93ab=a109_0x3e47fb,_0x11ea6c=a109_0x51353b[_0x3e93ab(0x151)](_0x144528,_0x3e93ab(0x1aa));if(!a109_0x46e9cb[_0x3e93ab(0x17a)](_0x11ea6c))throw new SDKError(ErrorCode[_0x3e93ab(0x148)],_0x3e93ab(0x21e)+_0x144528,undefined,{'helpText':_0x3e93ab(0x165)});const _0x8073c=loadAgentConfig(_0x11ea6c),_0x48616e=await this[_0x3e93ab(0x16c)](_0x8073c['llm_project']),_0x35c206=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x1e9)](_0x48616e),_0x45209e=_0x35c206[_0x3e93ab(0x20d)][_0x3e93ab(0x1fa)],_0x812381={'projectName':_0x45209e,'projectId':_0x48616e,'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}}},_0x51f26b=[],_0x5dbf7e=[],_0x4b47dd=[],_0x5ee1f5=[],_0xaf7f80=[],_0x55667e=[],_0x35b1da=a109_0x46e9cb[_0x3e93ab(0x23c)](_0x144528,{'withFileTypes':!![]});for(const _0x49a95f of _0x35b1da){if(!_0x49a95f['isDirectory']())continue;if(['knowledge_bases',_0x3e93ab(0x164),'integrations',_0x3e93ab(0x140),_0x3e93ab(0x199)]['includes'](_0x49a95f[_0x3e93ab(0x1fa)]))continue;const _0x2f8c31=a109_0x51353b[_0x3e93ab(0x151)](_0x144528,_0x49a95f[_0x3e93ab(0x1fa)]);if(isAgentDir(_0x2f8c31)){const _0x191c8c=a109_0x51353b['join'](_0x2f8c31,_0x3e93ab(0x18c)),_0x17e9ef=a109_0x51353b[_0x3e93ab(0x151)](_0x2f8c31,_0x3e93ab(0x23e)),_0xd30548=a109_0x51353b[_0x3e93ab(0x151)](_0x2f8c31,'starter_message.md'),_0x54f68b=parseAgentYaml(a109_0x46e9cb[_0x3e93ab(0x22e)](_0x191c8c,'utf-8'),_0x191c8c),_0x364854=a109_0x46e9cb[_0x3e93ab(0x17a)](_0x17e9ef)?a109_0x46e9cb[_0x3e93ab(0x22e)](_0x17e9ef,_0x3e93ab(0x177)):'',_0x2aa17f=a109_0x46e9cb[_0x3e93ab(0x17a)](_0xd30548)?a109_0x46e9cb[_0x3e93ab(0x22e)](_0xd30548,_0x3e93ab(0x177)):_0x54f68b[_0x3e93ab(0x15b)];_0x51f26b[_0x3e93ab(0x1db)]({'name':_0x54f68b[_0x3e93ab(0x1fa)],'dir':_0x2f8c31,'yaml':_0x54f68b,'systemPrompt':_0x364854,'starterMessage':_0x2aa17f});}}const _0x5b7c44=getKnowledgeBasesDir(_0x144528);if(a109_0x46e9cb[_0x3e93ab(0x17a)](_0x5b7c44)){const _0xd0253b=a109_0x46e9cb['readdirSync'](_0x5b7c44);for(const _0x17df56 of _0xd0253b){const _0x417a94=a109_0x51353b[_0x3e93ab(0x151)](_0x5b7c44,_0x17df56);if(_0x17df56[_0x3e93ab(0x1d4)](_0x3e93ab(0x160))){const _0x1ab760=parseKnowledgeBaseYaml(a109_0x46e9cb['readFileSync'](_0x417a94,_0x3e93ab(0x177)),_0x417a94);_0x5dbf7e[_0x3e93ab(0x1db)]({'name':_0x1ab760[_0x3e93ab(0x1fa)],'path':_0x417a94,'yaml':_0x1ab760});}else{if(_0x17df56[_0x3e93ab(0x1d4)](_0x3e93ab(0x16e))){const _0x194fe0=a109_0x46e9cb[_0x3e93ab(0x22e)](_0x417a94,'utf-8'),{name:_0x38aac3,text:_0x1123ee}=parseTextKnowledgeBaseMd(_0x194fe0,_0x17df56);_0x4b47dd[_0x3e93ab(0x1db)]({'name':_0x38aac3,'path':_0x417a94,'text':_0x1123ee});}}}}const _0xaf5674=getPromptsDir(_0x144528);if(a109_0x46e9cb['existsSync'](_0xaf5674)){const _0x321ac4=a109_0x46e9cb[_0x3e93ab(0x23c)](_0xaf5674)[_0x3e93ab(0x153)](_0x379367=>_0x379367[_0x3e93ab(0x1d4)](_0x3e93ab(0x160)));for(const _0x507d1f of _0x321ac4){const _0x1334c4=a109_0x51353b['join'](_0xaf5674,_0x507d1f),_0x18da39=parsePromptYaml(a109_0x46e9cb[_0x3e93ab(0x22e)](_0x1334c4,_0x3e93ab(0x177)),_0x1334c4);_0x5ee1f5['push']({'name':_0x18da39[_0x3e93ab(0x1fa)],'path':_0x1334c4,'yaml':_0x18da39});}}const _0x81c0a3=[],_0x512ba2=getIntegrationsDir(_0x144528);if(a109_0x46e9cb[_0x3e93ab(0x17a)](_0x512ba2)){const _0x99bde4=a109_0x46e9cb[_0x3e93ab(0x23c)](_0x512ba2)[_0x3e93ab(0x153)](_0x38a37e=>_0x38a37e[_0x3e93ab(0x1d4)](_0x3e93ab(0x160)));for(const _0xe59441 of _0x99bde4){const _0x5b5027=a109_0x51353b['join'](_0x512ba2,_0xe59441),_0x288ed7=parseIntegrationYaml(a109_0x46e9cb[_0x3e93ab(0x22e)](_0x5b5027,_0x3e93ab(0x177)),_0x5b5027);if(!SAFE_INTEGRATION_TYPES[_0x3e93ab(0x20f)](_0x288ed7[_0x3e93ab(0x1ea)][_0x3e93ab(0x230)]())){this[_0x3e93ab(0x214)][_0x3e93ab(0x12f)](_0x3e93ab(0x1d2)+_0x288ed7[_0x3e93ab(0x1fa)]+_0x3e93ab(0x244)+_0x288ed7[_0x3e93ab(0x1ea)]+_0x3e93ab(0x20b)+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES['join'](',\x20')+_0x3e93ab(0x14e))+_0x3e93ab(0x1de));continue;}_0x81c0a3[_0x3e93ab(0x1db)]({'name':_0x288ed7[_0x3e93ab(0x1fa)],'path':_0x5b5027,'yaml':_0x288ed7});}}const _0x4d36be=getExperimentalKnowledgeBasesDir(_0x144528);if(a109_0x46e9cb[_0x3e93ab(0x17a)](_0x4d36be)){const _0x264e08=a109_0x46e9cb[_0x3e93ab(0x23c)](_0x4d36be,{'withFileTypes':!![]});for(const _0x4fcca6 of _0x264e08){if(!_0x4fcca6[_0x3e93ab(0x1ed)]())continue;const _0x272c31=a109_0x51353b['join'](_0x4d36be,_0x4fcca6[_0x3e93ab(0x1fa)]),_0x5e8e98=a109_0x51353b['join'](_0x272c31,_0x4fcca6[_0x3e93ab(0x1fa)]+_0x3e93ab(0x160)),_0x1029cc=a109_0x51353b[_0x3e93ab(0x151)](_0x272c31,_0x3e93ab(0x191));if(!a109_0x46e9cb[_0x3e93ab(0x17a)](_0x5e8e98))continue;const _0x58856d=parseExperimentalKnowledgeBaseYaml(a109_0x46e9cb['readFileSync'](_0x5e8e98,_0x3e93ab(0x177)),_0x5e8e98),_0x531550=[];if(a109_0x46e9cb['existsSync'](_0x1029cc)){const _0x48febb=a109_0x46e9cb[_0x3e93ab(0x23c)](_0x1029cc,{'withFileTypes':!![]});for(const _0x2a024c of _0x48febb){if(!_0x2a024c[_0x3e93ab(0x1ed)]())continue;const _0x1e1141=a109_0x51353b['join'](_0x1029cc,_0x2a024c[_0x3e93ab(0x1fa)]),_0xfd143f=a109_0x51353b[_0x3e93ab(0x151)](_0x1e1141,_0x3e93ab(0x144)),_0x9979c9=a109_0x51353b[_0x3e93ab(0x151)](_0x1e1141,'json_schema.json');a109_0x46e9cb['existsSync'](_0xfd143f)&&a109_0x46e9cb[_0x3e93ab(0x17a)](_0x9979c9)&&_0x531550[_0x3e93ab(0x1db)]({'name':_0x2a024c['name'],'code':a109_0x46e9cb[_0x3e93ab(0x22e)](_0xfd143f,_0x3e93ab(0x177)),'json_schema':a109_0x46e9cb[_0x3e93ab(0x22e)](_0x9979c9,_0x3e93ab(0x177))});}}const _0x2cb305={..._0x58856d,'variables':_0x58856d[_0x3e93ab(0x14c)]||[],'functions':_0x531550};_0xaf7f80['push']({'name':_0x58856d[_0x3e93ab(0x1fa)],'dir':_0x272c31,'def':_0x2cb305});}}const _0x58c1ee=getExperimentalArtifactsDir(_0x144528);if(a109_0x46e9cb['existsSync'](_0x58c1ee)){const _0xc25182=a109_0x46e9cb[_0x3e93ab(0x23c)](_0x58c1ee,{'withFileTypes':!![]});for(const _0x226956 of _0xc25182){if(!_0x226956[_0x3e93ab(0x1ed)]())continue;const _0x3ebcd4=a109_0x51353b['join'](_0x58c1ee,_0x226956['name']),_0x101c06=a109_0x51353b[_0x3e93ab(0x151)](_0x3ebcd4,_0x226956[_0x3e93ab(0x1fa)]+_0x3e93ab(0x160)),_0x4e1272=a109_0x51353b[_0x3e93ab(0x151)](_0x3ebcd4,'code.js'),_0x3c40f9=a109_0x51353b[_0x3e93ab(0x151)](_0x3ebcd4,'files');if(!a109_0x46e9cb[_0x3e93ab(0x17a)](_0x101c06)||!a109_0x46e9cb[_0x3e93ab(0x17a)](_0x4e1272))continue;const _0x308aee=parseExperimentalArtifactYaml(a109_0x46e9cb[_0x3e93ab(0x22e)](_0x101c06,'utf-8'),_0x101c06),_0x1c2988=a109_0x46e9cb['readFileSync'](_0x4e1272,'utf-8'),_0x513318=[];if(a109_0x46e9cb[_0x3e93ab(0x17a)](_0x3c40f9)){const _0x4e1205=a109_0x46e9cb[_0x3e93ab(0x23c)](_0x3c40f9);for(const _0x27e55f of _0x4e1205){const _0xc71a1b=a109_0x51353b[_0x3e93ab(0x151)](_0x3c40f9,_0x27e55f);a109_0x46e9cb['statSync'](_0xc71a1b)[_0x3e93ab(0x18e)]()&&_0x513318[_0x3e93ab(0x1db)]({'file_name':_0x27e55f,'text_content':a109_0x46e9cb[_0x3e93ab(0x22e)](_0xc71a1b,_0x3e93ab(0x177))});}}const _0x9116c8={..._0x308aee,'code':_0x1c2988,'files':_0x513318};_0x55667e[_0x3e93ab(0x1db)]({'name':_0x308aee[_0x3e93ab(0x1fa)],'dir':_0x3ebcd4,'def':_0x9116c8});}}const _0x1e1d72=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x12d)](_0x48616e),_0x5b12e4=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x211)](_0x48616e),_0x302624=await this['client'][_0x3e93ab(0x18b)](_0x48616e),_0x1f959f=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x134)](_0x48616e),_0x3faeef=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x13d)](_0x48616e),_0x40f85a=await safeListOrEmpty(()=>this[_0x3e93ab(0x23d)][_0x3e93ab(0x196)](_0x48616e)),_0x53f8de=await safeListOrEmpty(()=>this[_0x3e93ab(0x23d)][_0x3e93ab(0x14d)](_0x48616e)),_0xa9ee08=await fetchAllToolTargetMaps((_0x30cb06,_0x206dd9)=>this['client'][_0x3e93ab(0x1b5)](_0x30cb06,_0x206dd9),_0x48616e),_0x8d4bd=new Map(),_0x2b2976=new Map(),_0x57484b=new Map(),_0x5a8fcc=new Map(),_0x382bb5=new Map(),_0x335a32=new Map(),_0x2626a3=new Map();for(const _0x4a3f53 of _0x1e1d72){_0x8d4bd[_0x3e93ab(0x137)](_0x4a3f53['attributes'][_0x3e93ab(0x1fa)],_0x4a3f53);}for(const _0x2a18f9 of _0x5b12e4){_0x2b2976[_0x3e93ab(0x137)](_0x2a18f9[_0x3e93ab(0x20d)][_0x3e93ab(0x1fa)],_0x2a18f9);}for(const _0x5ebff4 of _0x302624){_0x57484b[_0x3e93ab(0x137)](_0x5ebff4[_0x3e93ab(0x20d)]['name'],_0x5ebff4);}for(const _0x3f6473 of _0x1f959f){_0x5a8fcc[_0x3e93ab(0x137)](_0x3f6473[_0x3e93ab(0x20d)][_0x3e93ab(0x1fa)],_0x3f6473);}for(const _0x2961e1 of _0x3faeef){_0x382bb5[_0x3e93ab(0x137)](_0x2961e1[_0x3e93ab(0x20d)][_0x3e93ab(0x228)]['toLowerCase'](),_0x2961e1);}for(const _0x111e2b of _0x40f85a){_0x335a32['set'](_0x111e2b['attributes'][_0x3e93ab(0x1fa)],_0x111e2b);}for(const _0xa2515e of _0x53f8de){_0x2626a3[_0x3e93ab(0x137)](_0xa2515e[_0x3e93ab(0x20d)][_0x3e93ab(0x1fa)],_0xa2515e);}const _0x55bdf7=new Map(),_0x41d9a4=new Map();for(const _0x169eab of _0x1e1d72){_0x55bdf7['set'](_0x169eab[_0x3e93ab(0x20d)]['name'],_0x169eab['id']),_0x41d9a4[_0x3e93ab(0x137)](_0x169eab['id'],_0x169eab[_0x3e93ab(0x20d)][_0x3e93ab(0x1fa)]);}const _0x554ad4=new Map(),_0x427353=new Map();for(const _0x578efa of _0x1f959f){_0x554ad4['set'](_0x578efa[_0x3e93ab(0x20d)][_0x3e93ab(0x1fa)],_0x578efa['id']),_0x427353[_0x3e93ab(0x137)](_0x578efa['id'],_0x578efa[_0x3e93ab(0x20d)]['name']);}const _0x5937db=_0xa9ee08[_0x3e93ab(0x1f5)]['KnowledgeBase']||new Map(),_0x1e3257=_0xa9ee08[_0x3e93ab(0x1f5)][_0x3e93ab(0x1b2)]||new Map(),_0x5d092d=_0xa9ee08[_0x3e93ab(0x1f5)]['ExperimentalKnowledgeBase']||new Map(),_0x9521b8=new Map(),_0x46c390={'resolveToolTargetName':buildNameResolver({..._0xa9ee08['idToName'],'Agent':_0x41d9a4}),'resolvePromptName':async _0xdc01b1=>_0x427353[_0x3e93ab(0x1dc)](_0xdc01b1),'onWarning':_0x9fdfd7=>this[_0x3e93ab(0x214)][_0x3e93ab(0x12f)](_0x9fdfd7)};let _0xfb8976=[];const _0xdb4f70={'projectId':_0x48616e,'resolveToolTargetId':buildIdResolver({..._0xa9ee08['nameToId'],'Agent':_0x55bdf7}),'resolvePromptId':async _0x33ac8b=>_0x554ad4[_0x3e93ab(0x1dc)](_0x33ac8b),'onWarning':_0x534e10=>{const _0x555a5c=_0x3e93ab;this['logger'][_0x555a5c(0x12f)](_0x534e10),_0xfb8976[_0x555a5c(0x1db)](_0x534e10);}},{resolved:_0x1e70e4,unresolved:_0x39ad2d}=resolveAgentDependencies(_0x51f26b,new Set(_0x8d4bd[_0x3e93ab(0x1f3)]()));for(const {agent:_0x31ed0c,missingDeps:_0x1a3e0a}of _0x39ad2d){_0x812381[_0x3e93ab(0x1b1)][_0x3e93ab(0x1db)]({'agentName':_0x31ed0c[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x185),'error':_0x3e93ab(0x1c1)+_0x1a3e0a[_0x3e93ab(0x151)](',\x20')+_0x3e93ab(0x172)}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1b1)]['errors']++;}for(const _0x118ee8 of _0x5dbf7e){const _0x84585f=_0x2b2976['get'](_0x118ee8['yaml']['name']),_0x3157e0=a109_0x46e9cb['readFileSync'](_0x118ee8[_0x3e93ab(0x20a)],_0x3e93ab(0x177));if(_0x84585f){const _0x53fe43=apiKnowledgeBaseToYaml(_0x84585f),_0x253469=toKnowledgeBaseYamlString(_0x53fe43),_0x23a4f5=generateDiff(_0x253469,_0x3157e0),_0x49d50c=hasChanges(_0x23a4f5);_0x49d50c?(_0x812381['knowledgeBases']['push']({'name':_0x118ee8[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'id':_0x84585f['id'],'diff':formatDiffWithColors(_0x23a4f5)}),_0x812381[_0x3e93ab(0x175)]['knowledgeBases']['updated']++):(_0x812381[_0x3e93ab(0x238)][_0x3e93ab(0x1db)]({'name':_0x118ee8[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x200),'id':_0x84585f['id']}),_0x812381['counts']['knowledgeBases']['unchanged']++);}else _0x812381[_0x3e93ab(0x238)][_0x3e93ab(0x1db)]({'name':_0x118ee8[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159)}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x238)][_0x3e93ab(0x159)]++;}for(const _0x546a75 of _0x4b47dd){const _0x21486c=_0x57484b[_0x3e93ab(0x1dc)](_0x546a75[_0x3e93ab(0x1fa)]),_0x136075=a109_0x46e9cb[_0x3e93ab(0x22e)](_0x546a75[_0x3e93ab(0x20a)],_0x3e93ab(0x177));if(_0x21486c){const _0xfe6bca=toTextKnowledgeBaseMd(_0x21486c[_0x3e93ab(0x20d)]['name'],_0x21486c[_0x3e93ab(0x20d)][_0x3e93ab(0x14f)]),_0x427ce5=generateDiff(_0xfe6bca,_0x136075),_0x4c4a32=hasChanges(_0x427ce5);_0x4c4a32?(_0x812381[_0x3e93ab(0x189)][_0x3e93ab(0x1db)]({'name':_0x546a75[_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'id':_0x21486c['id'],'diff':formatDiffWithColors(_0x427ce5)}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x189)]['updated']++):(_0x812381[_0x3e93ab(0x189)]['push']({'name':_0x546a75[_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x200),'id':_0x21486c['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x189)][_0x3e93ab(0x200)]++);}else _0x812381[_0x3e93ab(0x189)]['push']({'name':_0x546a75[_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159)}),_0x812381[_0x3e93ab(0x175)]['textKnowledgeBases'][_0x3e93ab(0x159)]++;}for(const _0x4db54e of _0x1e70e4){const _0x4fa6bc=_0x8d4bd['get'](_0x4db54e[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)]),_0x305235=a109_0x51353b['join'](_0x4db54e[_0x3e93ab(0x216)],_0x3e93ab(0x18c)),_0x2837d7=a109_0x46e9cb[_0x3e93ab(0x22e)](_0x305235,'utf-8'),_0x524df9=_0x4db54e[_0x3e93ab(0x1f6)],_0x51a22f=_0x3e93ab(0x197)+_0x524df9+_0x3e93ab(0x145)+_0x2837d7;if(_0x4fa6bc){const {yaml:_0x35d421,systemPrompt:_0x5ec335}=await agentResponseToDef(_0x4fa6bc,_0x46c390),_0x11733e=toAgentYamlString(_0x35d421),_0x8c9c49=_0x3e93ab(0x197)+_0x5ec335+'\x0a\x0a#\x20agent.yml\x0a'+_0x11733e,_0x2ec29f=generateDiff(_0x8c9c49,_0x51a22f),_0x44484e=hasChanges(_0x2ec29f);_0x44484e?(_0x812381[_0x3e93ab(0x1b1)][_0x3e93ab(0x1db)]({'agentName':_0x4db54e['yaml'][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'agentId':_0x4fa6bc['id'],'diff':formatDiffWithColors(_0x2ec29f)}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1b1)]['updated']++):(_0x812381[_0x3e93ab(0x1b1)][_0x3e93ab(0x1db)]({'agentName':_0x4db54e[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x200),'agentId':_0x4fa6bc['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1b1)][_0x3e93ab(0x200)]++);}else _0x812381[_0x3e93ab(0x1b1)]['push']({'agentName':_0x4db54e['yaml'][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159)}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1b1)][_0x3e93ab(0x159)]++;}for(const _0xf6953 of _0x5ee1f5){const _0x58aaf1=_0x5a8fcc[_0x3e93ab(0x1dc)](_0xf6953['yaml'][_0x3e93ab(0x1fa)]),_0x4681b1=a109_0x46e9cb[_0x3e93ab(0x22e)](_0xf6953['path'],_0x3e93ab(0x177));if(_0x58aaf1){const _0x55fbc3=await apiPromptToYaml(_0x58aaf1,_0x46c390);if(!_0x55fbc3){_0x812381['prompts']['push']({'name':_0xf6953[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':'updated','id':_0x58aaf1['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x164)][_0x3e93ab(0x157)]++;continue;}const _0x2d22cb=toPromptYamlString(_0x55fbc3),_0x547603=generateDiff(_0x2d22cb,_0x4681b1),_0x210cb7=hasChanges(_0x547603);_0x210cb7?(_0x812381[_0x3e93ab(0x164)][_0x3e93ab(0x1db)]({'name':_0xf6953[_0x3e93ab(0x12b)]['name'],'action':_0x3e93ab(0x157),'id':_0x58aaf1['id'],'diff':formatDiffWithColors(_0x547603)}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x164)][_0x3e93ab(0x157)]++):(_0x812381[_0x3e93ab(0x164)][_0x3e93ab(0x1db)]({'name':_0xf6953[_0x3e93ab(0x12b)]['name'],'action':'unchanged','id':_0x58aaf1['id']}),_0x812381['counts'][_0x3e93ab(0x164)][_0x3e93ab(0x200)]++);}else _0x812381['prompts'][_0x3e93ab(0x1db)]({'name':_0xf6953[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159)}),_0x812381[_0x3e93ab(0x175)]['prompts'][_0x3e93ab(0x159)]++;}for(const _0x4b1f05 of _0x81c0a3){const _0x2118de=_0x382bb5[_0x3e93ab(0x1dc)](_0x4b1f05[_0x3e93ab(0x12b)][_0x3e93ab(0x1ea)]),_0x56a801=a109_0x46e9cb[_0x3e93ab(0x22e)](_0x4b1f05[_0x3e93ab(0x20a)],_0x3e93ab(0x177));if(_0x2118de){const _0x1e3508=await apiIntegrationToYaml(_0x2118de,_0x46c390),_0x56143e=toIntegrationYamlString(_0x1e3508),_0x3649b3=generateDiff(_0x56143e,_0x56a801),_0x1c978d=hasChanges(_0x3649b3);_0x1c978d?(_0x812381[_0x3e93ab(0x1c6)][_0x3e93ab(0x1db)]({'name':_0x4b1f05[_0x3e93ab(0x12b)]['service_type'],'action':_0x3e93ab(0x157),'id':_0x2118de['id'],'diff':formatDiffWithColors(_0x3649b3)}),_0x812381['counts'][_0x3e93ab(0x1c6)]['updated']++):(_0x812381['integrations'][_0x3e93ab(0x1db)]({'name':_0x4b1f05[_0x3e93ab(0x12b)][_0x3e93ab(0x1ea)],'action':'unchanged','id':_0x2118de['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1c6)][_0x3e93ab(0x200)]++);}else _0x812381['integrations'][_0x3e93ab(0x1db)]({'name':_0x4b1f05['yaml'][_0x3e93ab(0x1ea)],'action':'created'}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1c6)][_0x3e93ab(0x159)]++;}for(const _0x4c286a of _0xaf7f80){const _0x1ff680=_0x335a32[_0x3e93ab(0x1dc)](_0x4c286a['def'][_0x3e93ab(0x1fa)]),_0x2e6b5a=toExperimentalKnowledgeBaseYamlString(_0x4c286a[_0x3e93ab(0x142)]);let _0x11a7aa=_0x2e6b5a;for(const _0x18db6b of _0x4c286a[_0x3e93ab(0x142)][_0x3e93ab(0x191)]){_0x11a7aa+=_0x3e93ab(0x1a0)+_0x18db6b['name']+'\x20---\x0a'+_0x18db6b[_0x3e93ab(0x1b0)]+_0x3e93ab(0x231)+_0x18db6b[_0x3e93ab(0x1fa)]+_0x3e93ab(0x152)+_0x18db6b[_0x3e93ab(0x1f9)]+'\x0a';}if(_0x1ff680){const _0x4df318=apiExperimentalKnowledgeBaseToYaml(_0x1ff680),_0x5308c9=toExperimentalKnowledgeBaseYamlString(_0x4df318);let _0xbccb7d=_0x5308c9;for(const _0x5b4956 of _0x4df318[_0x3e93ab(0x191)]){_0xbccb7d+=_0x3e93ab(0x1a0)+_0x5b4956[_0x3e93ab(0x1fa)]+'\x20---\x0a'+_0x5b4956[_0x3e93ab(0x1b0)]+_0x3e93ab(0x231)+_0x5b4956[_0x3e93ab(0x1fa)]+'\x20---\x0a'+_0x5b4956['json_schema']+'\x0a';}const _0x14168c=generateDiff(_0xbccb7d,_0x11a7aa),_0x37e86c=hasChanges(_0x14168c);_0x37e86c?(_0x812381['experimentalKnowledgeBases'][_0x3e93ab(0x1db)]({'name':_0x4c286a[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'id':_0x1ff680['id'],'diff':formatDiffWithColors(_0x14168c)}),_0x812381[_0x3e93ab(0x175)]['experimentalKnowledgeBases'][_0x3e93ab(0x157)]++):(_0x812381[_0x3e93ab(0x1d0)]['push']({'name':_0x4c286a[_0x3e93ab(0x142)]['name'],'action':_0x3e93ab(0x200),'id':_0x1ff680['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1d0)][_0x3e93ab(0x200)]++);}else _0x812381[_0x3e93ab(0x1d0)][_0x3e93ab(0x1db)]({'name':_0x4c286a['def'][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159)}),_0x812381['counts'][_0x3e93ab(0x1d0)][_0x3e93ab(0x159)]++;}for(const _0x46c2d6 of _0x55667e){const _0x2ffc9d=_0x2626a3[_0x3e93ab(0x1dc)](_0x46c2d6['def'][_0x3e93ab(0x1fa)]),_0x1ba0c3=toExperimentalArtifactYamlString(_0x46c2d6[_0x3e93ab(0x142)]);let _0x1107d1=_0x1ba0c3+(_0x3e93ab(0x213)+_0x46c2d6[_0x3e93ab(0x142)][_0x3e93ab(0x1b0)]+'\x0a');for(const _0x266b7e of _0x46c2d6['def']['files']){_0x1107d1+=_0x3e93ab(0x12c)+_0x266b7e[_0x3e93ab(0x163)]+_0x3e93ab(0x152)+_0x266b7e[_0x3e93ab(0x1cc)]+'\x0a';}if(_0x2ffc9d){const _0x14683a=apiExperimentalArtifactToYaml(_0x2ffc9d),_0x4e6419=toExperimentalArtifactYamlString(_0x14683a);let _0x29328c=_0x4e6419+(_0x3e93ab(0x213)+_0x14683a[_0x3e93ab(0x1b0)]+'\x0a');for(const _0x59605c of _0x14683a['files']){_0x29328c+=_0x3e93ab(0x12c)+_0x59605c[_0x3e93ab(0x163)]+_0x3e93ab(0x152)+_0x59605c['text_content']+'\x0a';}const _0x9732ec=generateDiff(_0x29328c,_0x1107d1),_0x5c3c86=hasChanges(_0x9732ec);_0x5c3c86?(_0x812381['experimentalArtifacts'][_0x3e93ab(0x1db)]({'name':_0x46c2d6[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],'action':'updated','id':_0x2ffc9d['id'],'diff':formatDiffWithColors(_0x9732ec)}),_0x812381['counts'][_0x3e93ab(0x22d)][_0x3e93ab(0x157)]++):(_0x812381['experimentalArtifacts'][_0x3e93ab(0x1db)]({'name':_0x46c2d6[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x200),'id':_0x2ffc9d['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x22d)][_0x3e93ab(0x200)]++);}else _0x812381[_0x3e93ab(0x22d)][_0x3e93ab(0x1db)]({'name':_0x46c2d6[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159)}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x22d)][_0x3e93ab(0x159)]++;}if(_0x5642cc?.[_0x3e93ab(0x1ec)])return _0x812381;_0x812381[_0x3e93ab(0x238)]=[],_0x812381[_0x3e93ab(0x189)]=[],_0x812381[_0x3e93ab(0x164)]=[],_0x812381['integrations']=[],_0x812381[_0x3e93ab(0x1d0)]=[],_0x812381[_0x3e93ab(0x22d)]=[];const _0x183f69=_0x812381['agents']['filter'](_0x384dab=>_0x384dab[_0x3e93ab(0x19a)]==='error');_0x812381[_0x3e93ab(0x1b1)]=_0x183f69,_0x812381['counts']={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x183f69[_0x3e93ab(0x154)]},'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 _0x122703 of _0x5dbf7e){try{const _0x7a805f=_0x2b2976['get'](_0x122703[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)]),_0x1f5a85=yamlKnowledgeBaseToApi(_0x122703[_0x3e93ab(0x12b)],_0x48616e);if(_0x7a805f)await this[_0x3e93ab(0x23d)]['updateKnowledgeBase'](_0x7a805f['id'],_0x1f5a85),_0x5937db[_0x3e93ab(0x137)](_0x122703['yaml'][_0x3e93ab(0x1fa)],_0x7a805f['id']),_0x812381[_0x3e93ab(0x238)]['push']({'name':_0x122703[_0x3e93ab(0x12b)]['name'],'action':_0x3e93ab(0x157),'id':_0x7a805f['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x238)]['updated']++;else{const _0x241653=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x1c0)](_0x1f5a85);_0x5937db[_0x3e93ab(0x137)](_0x122703[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],_0x241653['id']),_0x812381['knowledgeBases'][_0x3e93ab(0x1db)]({'name':_0x122703[_0x3e93ab(0x12b)]['name'],'action':_0x3e93ab(0x159),'id':_0x241653['id']}),_0x812381['counts']['knowledgeBases'][_0x3e93ab(0x159)]++;}}catch(_0x4644d6){_0x812381[_0x3e93ab(0x238)]['push']({'name':_0x122703[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x185),'error':_0x4644d6['message']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x238)][_0x3e93ab(0x1f2)]++;}}for(const _0x49cfcd of _0x4b47dd){try{const _0x17ab7b=_0x57484b[_0x3e93ab(0x1dc)](_0x49cfcd[_0x3e93ab(0x1fa)]),_0x51197c=yamlTextKnowledgeBaseToApi({'name':_0x49cfcd[_0x3e93ab(0x1fa)],'text':_0x49cfcd['text']},_0x48616e);if(_0x17ab7b)await this[_0x3e93ab(0x23d)][_0x3e93ab(0x1c4)](_0x17ab7b['id'],_0x51197c),_0x1e3257[_0x3e93ab(0x137)](_0x49cfcd['name'],_0x17ab7b['id']),_0x812381[_0x3e93ab(0x189)][_0x3e93ab(0x1db)]({'name':_0x49cfcd[_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'id':_0x17ab7b['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x189)]['updated']++;else{const _0x489c1c=await this[_0x3e93ab(0x23d)]['createTextKnowledgeBase'](_0x51197c);_0x1e3257[_0x3e93ab(0x137)](_0x49cfcd[_0x3e93ab(0x1fa)],_0x489c1c['id']),_0x812381[_0x3e93ab(0x189)]['push']({'name':_0x49cfcd[_0x3e93ab(0x1fa)],'action':'created','id':_0x489c1c['id']}),_0x812381['counts'][_0x3e93ab(0x189)][_0x3e93ab(0x159)]++;}}catch(_0x4d3c3a){_0x812381[_0x3e93ab(0x189)]['push']({'name':_0x49cfcd[_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x185),'error':_0x4d3c3a[_0x3e93ab(0x1ce)]}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x189)][_0x3e93ab(0x1f2)]++;}}for(const _0x30ee4d of _0xaf7f80){try{const _0x3a1516=_0x335a32[_0x3e93ab(0x1dc)](_0x30ee4d['def'][_0x3e93ab(0x1fa)]),_0x5867cb=yamlExperimentalKnowledgeBaseToApi(_0x30ee4d[_0x3e93ab(0x142)],_0x48616e);if(_0x3a1516)await this['client']['updateExperimentalKnowledgeBase'](_0x3a1516['id'],_0x5867cb),_0x5d092d[_0x3e93ab(0x137)](_0x30ee4d[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],_0x3a1516['id']),_0x812381[_0x3e93ab(0x1d0)]['push']({'name':_0x30ee4d[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'id':_0x3a1516['id']}),_0x812381['counts'][_0x3e93ab(0x1d0)][_0x3e93ab(0x157)]++;else{const _0xd34aae=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x1ff)](_0x5867cb);_0x5d092d[_0x3e93ab(0x137)](_0x30ee4d[_0x3e93ab(0x142)]['name'],_0xd34aae['id']),_0x812381[_0x3e93ab(0x1d0)][_0x3e93ab(0x1db)]({'name':_0x30ee4d['def'][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159),'id':_0xd34aae['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1d0)][_0x3e93ab(0x159)]++;}}catch(_0xc7fd98){_0x812381[_0x3e93ab(0x1d0)][_0x3e93ab(0x1db)]({'name':_0x30ee4d[_0x3e93ab(0x142)]['name'],'action':_0x3e93ab(0x185),'error':_0xc7fd98[_0x3e93ab(0x1ce)]}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1d0)][_0x3e93ab(0x1f2)]++;}}for(const _0xd7d266 of _0x55667e){try{const _0x16f65e=_0x2626a3[_0x3e93ab(0x1dc)](_0xd7d266[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)]),_0x40da13=yamlExperimentalArtifactToApi(_0xd7d266[_0x3e93ab(0x142)],_0x48616e);if(_0x16f65e)await this[_0x3e93ab(0x23d)][_0x3e93ab(0x176)](_0x16f65e['id'],_0x40da13),_0x9521b8['set'](_0xd7d266[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],_0x16f65e['id']),_0x812381[_0x3e93ab(0x22d)][_0x3e93ab(0x1db)]({'name':_0xd7d266['def']['name'],'action':_0x3e93ab(0x157),'id':_0x16f65e['id']}),_0x812381['counts'][_0x3e93ab(0x22d)][_0x3e93ab(0x157)]++;else{const _0x2d0049=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x1e6)](_0x40da13);_0x9521b8[_0x3e93ab(0x137)](_0xd7d266[_0x3e93ab(0x142)][_0x3e93ab(0x1fa)],_0x2d0049['id']),_0x812381[_0x3e93ab(0x22d)][_0x3e93ab(0x1db)]({'name':_0xd7d266['def'][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x159),'id':_0x2d0049['id']}),_0x812381[_0x3e93ab(0x175)]['experimentalArtifacts']['created']++;}}catch(_0x3de71f){_0x812381[_0x3e93ab(0x22d)][_0x3e93ab(0x1db)]({'name':_0xd7d266[_0x3e93ab(0x142)]['name'],'action':_0x3e93ab(0x185),'error':_0x3de71f['message']}),_0x812381[_0x3e93ab(0x175)]['experimentalArtifacts'][_0x3e93ab(0x1f2)]++;}}for(const _0x5d4887 of _0x1e70e4){_0xfb8976=[];try{const _0x588841=_0x8d4bd[_0x3e93ab(0x1dc)](_0x5d4887[_0x3e93ab(0x12b)]['name']),_0x4472af=await agentDefToRequest(_0x5d4887[_0x3e93ab(0x12b)],_0x5d4887['systemPrompt'],_0x5d4887['starterMessage'],_0xdb4f70);if(_0x588841)await this[_0x3e93ab(0x23d)]['updateAgentResponse'](_0x588841['id'],_0x4472af),_0x55bdf7[_0x3e93ab(0x137)](_0x5d4887['yaml'][_0x3e93ab(0x1fa)],_0x588841['id']),_0x812381['agents'][_0x3e93ab(0x1db)]({'agentName':_0x5d4887[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'agentId':_0x588841['id'],'warnings':_0xfb8976[_0x3e93ab(0x154)]>0x0?_0xfb8976:undefined}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1b1)]['updated']++;else{const _0x2edf80=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x127)](_0x4472af);_0x55bdf7['set'](_0x5d4887['yaml']['name'],_0x2edf80['id']),_0x812381[_0x3e93ab(0x1b1)]['push']({'agentName':_0x5d4887[_0x3e93ab(0x12b)]['name'],'action':_0x3e93ab(0x159),'agentId':_0x2edf80['id'],'warnings':_0xfb8976[_0x3e93ab(0x154)]>0x0?_0xfb8976:undefined}),_0x812381[_0x3e93ab(0x175)]['agents'][_0x3e93ab(0x159)]++;}}catch(_0xfc6b21){_0x812381[_0x3e93ab(0x1b1)][_0x3e93ab(0x1db)]({'agentName':_0x5d4887[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x185),'error':_0xfc6b21[_0x3e93ab(0x1ce)],'warnings':_0xfb8976[_0x3e93ab(0x154)]>0x0?_0xfb8976:undefined}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1b1)][_0x3e93ab(0x1f2)]++;}}for(const _0x4dcbd0 of _0x5ee1f5){try{const _0x22cc4d=_0x5a8fcc[_0x3e93ab(0x1dc)](_0x4dcbd0['yaml'][_0x3e93ab(0x1fa)]),_0x207bfa=await yamlPromptToApi(_0x4dcbd0[_0x3e93ab(0x12b)],_0x48616e,_0xdb4f70);if(!_0x207bfa){_0x812381[_0x3e93ab(0x164)][_0x3e93ab(0x1db)]({'name':_0x4dcbd0['yaml'][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x185),'error':_0x3e93ab(0x13e)}),_0x812381[_0x3e93ab(0x175)]['prompts'][_0x3e93ab(0x1f2)]++;continue;}if(_0x22cc4d)await this[_0x3e93ab(0x23d)][_0x3e93ab(0x1d5)](_0x22cc4d['id'],_0x207bfa),_0x554ad4[_0x3e93ab(0x137)](_0x4dcbd0[_0x3e93ab(0x12b)]['name'],_0x22cc4d['id']),_0x812381['prompts'][_0x3e93ab(0x1db)]({'name':_0x4dcbd0[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],'action':_0x3e93ab(0x157),'id':_0x22cc4d['id']}),_0x812381[_0x3e93ab(0x175)]['prompts'][_0x3e93ab(0x157)]++;else{const _0x365c07=await this['client'][_0x3e93ab(0x173)](_0x207bfa);_0x554ad4[_0x3e93ab(0x137)](_0x4dcbd0[_0x3e93ab(0x12b)][_0x3e93ab(0x1fa)],_0x365c07['id']),_0x812381[_0x3e93ab(0x164)][_0x3e93ab(0x1db)]({'name':_0x4dcbd0[_0x3e93ab(0x12b)]['name'],'action':_0x3e93ab(0x159),'id':_0x365c07['id']}),_0x812381['counts'][_0x3e93ab(0x164)][_0x3e93ab(0x159)]++;}}catch(_0x1712af){_0x812381[_0x3e93ab(0x164)]['push']({'name':_0x4dcbd0[_0x3e93ab(0x12b)]['name'],'action':_0x3e93ab(0x185),'error':_0x1712af[_0x3e93ab(0x1ce)]}),_0x812381[_0x3e93ab(0x175)]['prompts']['errors']++;}}for(const _0x2c5ab3 of _0x81c0a3){try{const _0x7fe36f=_0x382bb5[_0x3e93ab(0x1dc)](_0x2c5ab3['yaml'][_0x3e93ab(0x1ea)]),_0x41dcc4=await yamlIntegrationToApi(_0x2c5ab3[_0x3e93ab(0x12b)],_0x48616e,_0xdb4f70);if(_0x7fe36f){await this['client'][_0x3e93ab(0x120)](_0x7fe36f['id']);const _0x2ab26b=await this[_0x3e93ab(0x23d)]['createIntegration'](_0x41dcc4);_0x812381[_0x3e93ab(0x1c6)][_0x3e93ab(0x1db)]({'name':_0x2c5ab3[_0x3e93ab(0x12b)][_0x3e93ab(0x1ea)],'action':_0x3e93ab(0x157),'id':_0x2ab26b['id']}),_0x812381['counts'][_0x3e93ab(0x1c6)][_0x3e93ab(0x157)]++;}else{const _0x1bd724=await this[_0x3e93ab(0x23d)][_0x3e93ab(0x192)](_0x41dcc4);_0x812381[_0x3e93ab(0x1c6)][_0x3e93ab(0x1db)]({'name':_0x2c5ab3['yaml'][_0x3e93ab(0x1ea)],'action':'created','id':_0x1bd724['id']}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1c6)]['created']++;}}catch(_0x209bf0){_0x812381[_0x3e93ab(0x1c6)]['push']({'name':_0x2c5ab3[_0x3e93ab(0x12b)][_0x3e93ab(0x1ea)],'action':_0x3e93ab(0x185),'error':_0x209bf0[_0x3e93ab(0x1ce)]}),_0x812381[_0x3e93ab(0x175)][_0x3e93ab(0x1c6)][_0x3e93ab(0x1f2)]++;}}return _0x812381;}async[a109_0x3e47fb(0x15c)](_0x32ca33,_0x1b07df,_0x171ef7,_0x35fe9b){const _0x4e45d7=a109_0x3e47fb,{projectId:_0xedf80,project:_0x59a4c}=await this[_0x4e45d7(0x1ba)](_0x32ca33),_0x306b4f=_0x59a4c[_0x4e45d7(0x20d)][_0x4e45d7(0x1fa)],_0x1923c5=await this[_0x4e45d7(0x23d)][_0x4e45d7(0x12d)](_0xedf80),_0x300305=_0x1923c5[_0x4e45d7(0x1ad)](_0x263739=>_0x263739[_0x4e45d7(0x20d)]['name']===_0x1b07df);if(!_0x300305)throw new SDKError(ErrorCode['AGENT_NOT_FOUND'],_0x4e45d7(0x149)+_0x1b07df,undefined,{'helpText':_0x4e45d7(0x1f0)+_0x1923c5[_0x4e45d7(0x217)](_0x2a1d14=>_0x2a1d14[_0x4e45d7(0x20d)][_0x4e45d7(0x1fa)])[_0x4e45d7(0x151)](',\x20')});let _0x2e8d43;if(_0x171ef7)_0x2e8d43=_0x171ef7;else{const _0x2a1529=a109_0x51353b[_0x4e45d7(0x151)](process[_0x4e45d7(0x234)](),_0x4e45d7(0x1b1)),_0x3c4b6b=getSanitizedPathWithMigration(_0x2a1529,_0x306b4f);_0x3c4b6b['renamed']&&this[_0x4e45d7(0x214)][_0x4e45d7(0x1dd)]('Renamed\x20folder:\x20'+a109_0x51353b[_0x4e45d7(0x188)](_0x3c4b6b['oldPath'])+_0x4e45d7(0x1fb)+a109_0x51353b[_0x4e45d7(0x188)](_0x3c4b6b[_0x4e45d7(0x20a)])),_0x2e8d43=_0x3c4b6b[_0x4e45d7(0x20a)];}const _0x96a194=getSanitizedPathWithMigration(_0x2e8d43,_0x1b07df);_0x96a194['renamed']&&this[_0x4e45d7(0x214)]['info'](_0x4e45d7(0x158)+a109_0x51353b[_0x4e45d7(0x188)](_0x96a194[_0x4e45d7(0x187)])+'\x20→\x20'+a109_0x51353b[_0x4e45d7(0x188)](_0x96a194['path']));const _0x2166c=_0x96a194[_0x4e45d7(0x20a)],_0x2ab012=new Map(),_0x34966b=new Map(),_0x17fc87=await this[_0x4e45d7(0x23d)][_0x4e45d7(0x211)](_0xedf80),_0x24949e=await this[_0x4e45d7(0x23d)][_0x4e45d7(0x18b)](_0xedf80),_0x206662=await safeListOrEmpty(()=>this[_0x4e45d7(0x23d)][_0x4e45d7(0x196)](_0xedf80)),_0x4878fe=new Map(),_0x4eadbf=new Map();for(const _0x1dbd18 of _0x17fc87){_0x2ab012[_0x4e45d7(0x137)](_0x1dbd18['id'],_0x1dbd18[_0x4e45d7(0x20d)]['name']);}for(const _0x1e31f8 of _0x24949e){_0x4878fe['set'](_0x1e31f8['id'],_0x1e31f8[_0x4e45d7(0x20d)][_0x4e45d7(0x1fa)]);}for(const _0x5c1087 of _0x206662){_0x4eadbf[_0x4e45d7(0x137)](_0x5c1087['id'],_0x5c1087['attributes'][_0x4e45d7(0x1fa)]);}for(const _0xd29472 of _0x1923c5){_0x34966b[_0x4e45d7(0x137)](_0xd29472['id'],_0xd29472[_0x4e45d7(0x20d)][_0x4e45d7(0x1fa)]);}const _0x5ebda7={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2ab012,'TextKnowledgeBase':_0x4878fe,'Agent':_0x34966b,'ExperimentalKnowledgeBase':_0x4eadbf}),'resolvePromptName':async()=>undefined,'onWarning':_0x30da80=>this[_0x4e45d7(0x214)]['warn'](_0x30da80)},_0x3d5ca0=a109_0x51353b['join'](_0x2166c,'prompt.md'),_0x172b63=a109_0x51353b[_0x4e45d7(0x151)](_0x2166c,_0x4e45d7(0x18c)),_0x495309=a109_0x51353b[_0x4e45d7(0x151)](_0x2166c,_0x4e45d7(0x194)),_0x360034=!a109_0x46e9cb[_0x4e45d7(0x17a)](_0x172b63);if(_0x35fe9b?.['dryRun'])return{'agentName':_0x1b07df,'outputPath':_0x2166c,'isNew':_0x360034,'hasChanges':!![]};a109_0x46e9cb[_0x4e45d7(0x1d8)](_0x2e8d43,{'recursive':!![]}),a109_0x46e9cb[_0x4e45d7(0x1d8)](_0x2166c,{'recursive':!![]});const _0x332b33=a109_0x51353b[_0x4e45d7(0x151)](_0x2e8d43,_0x4e45d7(0x1aa));!a109_0x46e9cb[_0x4e45d7(0x17a)](_0x332b33)&&a109_0x46e9cb[_0x4e45d7(0x1b4)](_0x332b33,createAgentConfigContent(_0x32ca33));const {yaml:_0x312896,systemPrompt:_0x3069c0,starterMessage:_0x2ea038}=await agentResponseToDef(_0x300305,_0x5ebda7);let _0x99868=_0x360034;if(!_0x360034){const _0x2545c0=a109_0x46e9cb[_0x4e45d7(0x17a)](_0x3d5ca0)?a109_0x46e9cb['readFileSync'](_0x3d5ca0,'utf-8'):'',_0x3f8168=a109_0x46e9cb['readFileSync'](_0x172b63,'utf-8');_0x99868=_0x2545c0!==_0x3069c0||_0x3f8168!==toAgentYamlString(_0x312896);}a109_0x46e9cb[_0x4e45d7(0x1b4)](_0x3d5ca0,_0x3069c0),a109_0x46e9cb['writeFileSync'](_0x172b63,toAgentYamlString(_0x312896));if(_0x2ea038&&_0x2ea038['includes']('\x0a'))a109_0x46e9cb[_0x4e45d7(0x1b4)](_0x495309,_0x2ea038);else a109_0x46e9cb[_0x4e45d7(0x17a)](_0x495309)&&a109_0x46e9cb[_0x4e45d7(0x1ac)](_0x495309);return{'agentName':_0x1b07df,'outputPath':_0x2166c,'isNew':_0x360034,'hasChanges':_0x99868};}async[a109_0x3e47fb(0x235)](_0x2e0a0f,_0x27fa59){const _0x1d51eb=a109_0x3e47fb;let _0x3a8be9;isAgentYamlPath(_0x2e0a0f)?_0x3a8be9=getAgentDirFromYamlPath(_0x2e0a0f):_0x3a8be9=_0x2e0a0f;const {config:_0x4a1837}=findAgentConfig(_0x3a8be9),_0xc855c2=await this[_0x1d51eb(0x16c)](_0x4a1837['llm_project']),_0x44e87d=a109_0x51353b[_0x1d51eb(0x151)](_0x3a8be9,_0x1d51eb(0x18c)),_0x591a28=a109_0x51353b[_0x1d51eb(0x151)](_0x3a8be9,_0x1d51eb(0x23e)),_0x275e87=a109_0x51353b[_0x1d51eb(0x151)](_0x3a8be9,'starter_message.md');if(!a109_0x46e9cb[_0x1d51eb(0x17a)](_0x44e87d))throw new SDKError(ErrorCode['NOT_FOUND'],_0x1d51eb(0x221)+_0x3a8be9,undefined,{'helpText':_0x1d51eb(0x1c9)});const _0x3e24ef=parseAgentYaml(a109_0x46e9cb['readFileSync'](_0x44e87d,_0x1d51eb(0x177)),_0x44e87d),_0x521cbf=a109_0x46e9cb[_0x1d51eb(0x17a)](_0x591a28)?a109_0x46e9cb['readFileSync'](_0x591a28,'utf-8'):'',_0x415d49=a109_0x46e9cb[_0x1d51eb(0x17a)](_0x275e87)?a109_0x46e9cb[_0x1d51eb(0x22e)](_0x275e87,_0x1d51eb(0x177)):_0x3e24ef[_0x1d51eb(0x15b)];if(_0x27fa59?.[_0x1d51eb(0x1ec)])return{'agentName':_0x3e24ef['name'],'action':'created','projectId':_0xc855c2};const _0x115953=await this[_0x1d51eb(0x23d)]['listAgentsFull'](_0xc855c2),_0x13a4d1=await fetchAllToolTargetMaps((_0x21bf37,_0x53a85f)=>this[_0x1d51eb(0x23d)][_0x1d51eb(0x1b5)](_0x21bf37,_0x53a85f),_0xc855c2),_0x3bc910=new Map();for(const _0x1a213c of _0x115953){_0x3bc910['set'](_0x1a213c[_0x1d51eb(0x20d)][_0x1d51eb(0x1fa)],_0x1a213c['id']);}const _0x83af33=[],_0x28bd21={'projectId':_0xc855c2,'resolveToolTargetId':buildIdResolver({..._0x13a4d1[_0x1d51eb(0x1f5)],'Agent':_0x3bc910}),'resolvePromptId':async()=>undefined,'onWarning':_0x15cc7c=>{const _0x1f115f=_0x1d51eb;this['logger']['warn'](_0x15cc7c),_0x83af33[_0x1f115f(0x1db)](_0x15cc7c);}};try{const _0x3af0d6=_0x115953[_0x1d51eb(0x1ad)](_0x1fa3a3=>_0x1fa3a3['attributes']['name']===_0x3e24ef[_0x1d51eb(0x1fa)]),_0x18c039=await agentDefToRequest(_0x3e24ef,_0x521cbf,_0x415d49,_0x28bd21);if(_0x3af0d6)return await this['client'][_0x1d51eb(0x227)](_0x3af0d6['id'],_0x18c039),{'agentName':_0x3e24ef[_0x1d51eb(0x1fa)],'action':_0x1d51eb(0x157),'projectId':_0xc855c2,'agentId':_0x3af0d6['id'],'warnings':_0x83af33['length']>0x0?_0x83af33:undefined};else{const _0x545d7d=await this[_0x1d51eb(0x23d)][_0x1d51eb(0x127)](_0x18c039);return{'agentName':_0x3e24ef[_0x1d51eb(0x1fa)],'action':_0x1d51eb(0x159),'projectId':_0xc855c2,'agentId':_0x545d7d['id'],'warnings':_0x83af33['length']>0x0?_0x83af33:undefined};}}catch(_0x46bf05){return{'agentName':_0x3e24ef[_0x1d51eb(0x1fa)],'action':_0x1d51eb(0x185),'projectId':_0xc855c2,'error':_0x46bf05[_0x1d51eb(0x1ce)],'warnings':_0x83af33[_0x1d51eb(0x154)]>0x0?_0x83af33:undefined};}}async[a109_0x3e47fb(0x143)](_0x309950,_0x1f57dd,_0x475a4d){const _0x332a57=a109_0x3e47fb,_0x525ea9=a109_0x46e9cb[_0x332a57(0x17a)](_0x309950)&&a109_0x46e9cb[_0x332a57(0x17a)](a109_0x51353b[_0x332a57(0x151)](_0x309950,'tdx.json'));let _0x4f1d2f;const _0xac22f=[],_0x33910e=[],_0x1a6fa2=[],_0xe434d=[],_0x27ebdb=[],_0x554584=[],_0x465204=[];if(_0x525ea9){const _0x3ff04a=loadAgentConfig(a109_0x51353b[_0x332a57(0x151)](_0x309950,_0x332a57(0x1aa)));_0x4f1d2f=_0x3ff04a['llm_project'];const _0x1bd8f0=a109_0x46e9cb['readdirSync'](_0x309950,{'withFileTypes':!![]});for(const _0x28f39c of _0x1bd8f0){if(!_0x28f39c[_0x332a57(0x1ed)]())continue;if([_0x332a57(0x1d1),_0x332a57(0x140),'experimental_artifacts',_0x332a57(0x164),_0x332a57(0x1c6)][_0x332a57(0x20f)](_0x28f39c[_0x332a57(0x1fa)]))continue;const _0x5d58b5=a109_0x51353b[_0x332a57(0x151)](_0x309950,_0x28f39c['name']);if(isAgentDir(_0x5d58b5)){const _0x3c8c69=a109_0x51353b['join'](_0x5d58b5,_0x332a57(0x18c)),_0x788cb7=a109_0x51353b['join'](_0x5d58b5,_0x332a57(0x23e)),_0x839a52=a109_0x51353b[_0x332a57(0x151)](_0x5d58b5,'starter_message.md'),_0x3ad05e=parseAgentYaml(a109_0x46e9cb[_0x332a57(0x22e)](_0x3c8c69,_0x332a57(0x177)),_0x3c8c69),_0x30eeed=a109_0x46e9cb[_0x332a57(0x17a)](_0x788cb7)?a109_0x46e9cb[_0x332a57(0x22e)](_0x788cb7,_0x332a57(0x177)):'',_0x647c07=a109_0x46e9cb[_0x332a57(0x17a)](_0x839a52)?a109_0x46e9cb[_0x332a57(0x22e)](_0x839a52,'utf-8'):_0x3ad05e[_0x332a57(0x15b)];_0xac22f[_0x332a57(0x1db)]({'name':_0x3ad05e[_0x332a57(0x1fa)],'dir':_0x5d58b5,'yaml':_0x3ad05e,'systemPrompt':_0x30eeed,'starterMessage':_0x647c07});}}const _0x484c8c=getKnowledgeBasesDir(_0x309950);if(a109_0x46e9cb[_0x332a57(0x17a)](_0x484c8c)){const _0x5cd0b9=a109_0x46e9cb[_0x332a57(0x23c)](_0x484c8c);for(const _0x3256c2 of _0x5cd0b9){const _0x392214=a109_0x51353b['join'](_0x484c8c,_0x3256c2);if(_0x3256c2[_0x332a57(0x1d4)](_0x332a57(0x160))){const _0x849f67=parseKnowledgeBaseYaml(a109_0x46e9cb[_0x332a57(0x22e)](_0x392214,_0x332a57(0x177)),_0x392214);_0x33910e['push']({'name':_0x849f67[_0x332a57(0x1fa)],'path':_0x392214,'yaml':_0x849f67});}else{if(_0x3256c2[_0x332a57(0x1d4)]('.md')){const _0x52639a=a109_0x46e9cb[_0x332a57(0x22e)](_0x392214,_0x332a57(0x177)),{name:_0x58cbc8,text:_0x40d780}=parseTextKnowledgeBaseMd(_0x52639a,_0x3256c2);_0x1a6fa2[_0x332a57(0x1db)]({'name':_0x58cbc8,'path':_0x392214,'text':_0x40d780});}}}}const _0x26ae30=getPromptsDir(_0x309950);if(a109_0x46e9cb[_0x332a57(0x17a)](_0x26ae30)){const _0x2146e3=a109_0x46e9cb['readdirSync'](_0x26ae30)['filter'](_0x3908fc=>_0x3908fc['endsWith'](_0x332a57(0x160)));for(const _0x31c428 of _0x2146e3){const _0x3a593b=a109_0x51353b[_0x332a57(0x151)](_0x26ae30,_0x31c428),_0x325f5c=parsePromptYaml(a109_0x46e9cb[_0x332a57(0x22e)](_0x3a593b,_0x332a57(0x177)),_0x3a593b);_0xe434d[_0x332a57(0x1db)]({'name':_0x325f5c[_0x332a57(0x1fa)],'path':_0x3a593b,'yaml':_0x325f5c});}}const _0x2b6888=getIntegrationsDir(_0x309950);if(a109_0x46e9cb[_0x332a57(0x17a)](_0x2b6888)){const _0x34049c=a109_0x46e9cb[_0x332a57(0x23c)](_0x2b6888)['filter'](_0x56a18d=>_0x56a18d[_0x332a57(0x1d4)](_0x332a57(0x160)));for(const _0x40a002 of _0x34049c){const _0x5806ad=a109_0x51353b[_0x332a57(0x151)](_0x2b6888,_0x40a002),_0x4ae7dc=parseIntegrationYaml(a109_0x46e9cb[_0x332a57(0x22e)](_0x5806ad,_0x332a57(0x177)),_0x5806ad);SAFE_INTEGRATION_TYPES[_0x332a57(0x20f)](_0x4ae7dc[_0x332a57(0x1ea)][_0x332a57(0x230)]())?_0x27ebdb['push']({'name':_0x4ae7dc[_0x332a57(0x1fa)],'path':_0x5806ad,'yaml':_0x4ae7dc}):this[_0x332a57(0x214)][_0x332a57(0x12f)](_0x332a57(0x1d2)+_0x4ae7dc[_0x332a57(0x1fa)]+_0x332a57(0x244)+_0x4ae7dc[_0x332a57(0x1ea)]+_0x332a57(0x20b)+(_0x332a57(0x131)+SAFE_INTEGRATION_TYPES[_0x332a57(0x151)](',\x20')+')\x20can\x20be\x20cloned.'));}}const _0x1ed8c9=getExperimentalKnowledgeBasesDir(_0x309950);if(a109_0x46e9cb[_0x332a57(0x17a)](_0x1ed8c9)){const _0x5bdea0=a109_0x46e9cb[_0x332a57(0x23c)](_0x1ed8c9,{'withFileTypes':!![]});for(const _0x51053d of _0x5bdea0){if(!_0x51053d['isDirectory']())continue;const _0x148f28=a109_0x51353b[_0x332a57(0x151)](_0x1ed8c9,_0x51053d['name']),_0x100391=a109_0x51353b[_0x332a57(0x151)](_0x148f28,_0x51053d[_0x332a57(0x1fa)]+'.yml');if(a109_0x46e9cb['existsSync'](_0x100391)){const _0x220aa0=parseExperimentalKnowledgeBaseYaml(a109_0x46e9cb[_0x332a57(0x22e)](_0x100391,_0x332a57(0x177)),_0x100391),_0xb8f7=a109_0x51353b[_0x332a57(0x151)](_0x148f28,'functions'),_0x3bb11a=[];if(a109_0x46e9cb[_0x332a57(0x17a)](_0xb8f7)){const _0xe052ea=a109_0x46e9cb[_0x332a57(0x23c)](_0xb8f7,{'withFileTypes':!![]});for(const _0x60e137 of _0xe052ea){if(!_0x60e137[_0x332a57(0x1ed)]())continue;const _0x1f8616=a109_0x51353b[_0x332a57(0x151)](_0xb8f7,_0x60e137['name']),_0x28f26e=a109_0x51353b[_0x332a57(0x151)](_0x1f8616,_0x332a57(0x144)),_0x34fcb1=a109_0x51353b[_0x332a57(0x151)](_0x1f8616,_0x332a57(0x23f));if(a109_0x46e9cb['existsSync'](_0x28f26e)&&a109_0x46e9cb[_0x332a57(0x17a)](_0x34fcb1)){const _0x384fe7=a109_0x46e9cb[_0x332a57(0x22e)](_0x28f26e,_0x332a57(0x177)),_0x5c8511=a109_0x46e9cb[_0x332a57(0x22e)](_0x34fcb1,_0x332a57(0x177));_0x3bb11a[_0x332a57(0x1db)]({'name':_0x60e137[_0x332a57(0x1fa)],'code':_0x384fe7,'json_schema':_0x5c8511});}}}const _0x1b3404={..._0x220aa0,'functions':_0x3bb11a};_0x554584[_0x332a57(0x1db)]({'name':_0x220aa0[_0x332a57(0x1fa)],'path':_0x148f28,'def':_0x1b3404});}}}const _0x52060d=getExperimentalArtifactsDir(_0x309950);if(a109_0x46e9cb[_0x332a57(0x17a)](_0x52060d)){const _0x10915b=a109_0x46e9cb[_0x332a57(0x23c)](_0x52060d,{'withFileTypes':!![]});for(const _0x16b4a3 of _0x10915b){if(!_0x16b4a3['isDirectory']())continue;const _0x2d1f78=a109_0x51353b[_0x332a57(0x151)](_0x52060d,_0x16b4a3['name']),_0x37a9a7=a109_0x51353b['join'](_0x2d1f78,_0x16b4a3[_0x332a57(0x1fa)]+_0x332a57(0x160));if(a109_0x46e9cb[_0x332a57(0x17a)](_0x37a9a7)){const _0x117cba=parseExperimentalArtifactYaml(a109_0x46e9cb[_0x332a57(0x22e)](_0x37a9a7,'utf-8'),_0x37a9a7),_0x25447b=a109_0x51353b['join'](_0x2d1f78,_0x332a57(0x144)),_0x46bd5c=a109_0x46e9cb[_0x332a57(0x17a)](_0x25447b)?a109_0x46e9cb[_0x332a57(0x22e)](_0x25447b,_0x332a57(0x177)):'',_0x2dc505=a109_0x51353b[_0x332a57(0x151)](_0x2d1f78,'files'),_0x4ef7d0=[];if(a109_0x46e9cb['existsSync'](_0x2dc505)){const _0x6c15c7=a109_0x46e9cb[_0x332a57(0x23c)](_0x2dc505);for(const _0x50caa6 of _0x6c15c7){const _0xd73e45=a109_0x51353b['join'](_0x2dc505,_0x50caa6);if(a109_0x46e9cb[_0x332a57(0x156)](_0xd73e45)[_0x332a57(0x18e)]()){const _0x29bb95=a109_0x46e9cb['readFileSync'](_0xd73e45,'utf-8');_0x4ef7d0[_0x332a57(0x1db)]({'file_name':_0x50caa6,'text_content':_0x29bb95});}}}const _0x4ceea7={..._0x117cba,'code':_0x46bd5c,'files':_0x4ef7d0};_0x465204[_0x332a57(0x1db)]({'name':_0x117cba[_0x332a57(0x1fa)],'path':_0x2d1f78,'def':_0x4ceea7});}}}}else{const _0x47d29a=await this[_0x332a57(0x16c)](_0x309950),_0x581aaf=await this[_0x332a57(0x23d)][_0x332a57(0x1e9)](_0x47d29a);_0x4f1d2f=_0x581aaf['attributes'][_0x332a57(0x1fa)];const _0x21dd2b=await this[_0x332a57(0x23d)][_0x332a57(0x12d)](_0x47d29a),_0x58f0c0=await this[_0x332a57(0x23d)][_0x332a57(0x211)](_0x47d29a),_0x42fe36=await this['client'][_0x332a57(0x18b)](_0x47d29a),_0x578a8c=await this[_0x332a57(0x23d)][_0x332a57(0x134)](_0x47d29a),_0x1d5816=await this[_0x332a57(0x23d)]['listIntegrations'](_0x47d29a),_0x3e8d32=await safeListOrEmpty(()=>this[_0x332a57(0x23d)]['listExperimentalKnowledgeBases'](_0x47d29a)),_0x400317=await safeListOrEmpty(()=>this[_0x332a57(0x23d)]['listExperimentalArtifacts'](_0x47d29a)),_0x295587=new Map(),_0x5e9a7a=new Map(),_0x5031c0=new Map(),_0x372fac=new Map(),_0x2f64eb=new Map(),_0xaf803c=new Map();for(const _0x275957 of _0x58f0c0){_0x295587[_0x332a57(0x137)](_0x275957['id'],_0x275957[_0x332a57(0x20d)]['name']);}for(const _0x54b5df of _0x42fe36){_0x5e9a7a[_0x332a57(0x137)](_0x54b5df['id'],_0x54b5df[_0x332a57(0x20d)][_0x332a57(0x1fa)]);}for(const _0x377ec8 of _0x21dd2b){_0x5031c0[_0x332a57(0x137)](_0x377ec8['id'],_0x377ec8['attributes'][_0x332a57(0x1fa)]);}for(const _0x111283 of _0x578a8c){_0x372fac[_0x332a57(0x137)](_0x111283['id'],_0x111283[_0x332a57(0x20d)][_0x332a57(0x1fa)]);}for(const _0x2d5a94 of _0x3e8d32){_0x2f64eb[_0x332a57(0x137)](_0x2d5a94['id'],_0x2d5a94[_0x332a57(0x20d)][_0x332a57(0x1fa)]);}for(const _0x571b02 of _0x400317){_0xaf803c[_0x332a57(0x137)](_0x571b02['id'],_0x571b02[_0x332a57(0x20d)]['name']);}const _0x58844b={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x295587,'TextKnowledgeBase':_0x5e9a7a,'Agent':_0x5031c0,'ExperimentalKnowledgeBase':_0x2f64eb}),'resolvePromptName':async _0x3384e6=>_0x372fac[_0x332a57(0x1dc)](_0x3384e6),'onWarning':_0x413a00=>this[_0x332a57(0x214)]['warn'](_0x413a00)};for(const _0x4c8a3f of _0x21dd2b){const _0x2aa36c=await agentResponseToDef(_0x4c8a3f,_0x58844b),{yaml:_0x1e86f3,systemPrompt:_0x7347d,starterMessage:_0x43e08c}=_0x2aa36c;_0xac22f[_0x332a57(0x1db)]({'name':_0x1e86f3[_0x332a57(0x1fa)],'dir':'','yaml':_0x1e86f3,'systemPrompt':_0x7347d,'starterMessage':_0x43e08c});}for(const _0x4af241 of _0x58f0c0){const _0x47dfa6=apiKnowledgeBaseToYaml(_0x4af241);_0x33910e[_0x332a57(0x1db)]({'name':_0x47dfa6['name'],'path':'','yaml':_0x47dfa6});}for(const _0x53f38c of _0x42fe36){_0x1a6fa2[_0x332a57(0x1db)]({'name':_0x53f38c[_0x332a57(0x20d)]['name'],'path':'','text':_0x53f38c[_0x332a57(0x20d)]['text']});}for(const _0xbc756b of _0x578a8c){const _0x1b5479=await apiPromptToYaml(_0xbc756b,_0x58844b);_0x1b5479&&_0xe434d[_0x332a57(0x1db)]({'name':_0x1b5479[_0x332a57(0x1fa)],'path':'','yaml':_0x1b5479});}for(const _0x5f335c of _0x1d5816){if(!_0x5f335c['attributes'][_0x332a57(0x1a5)]&&SAFE_INTEGRATION_TYPES[_0x332a57(0x20f)](_0x5f335c[_0x332a57(0x20d)][_0x332a57(0x228)][_0x332a57(0x230)]())){const _0x5b594a=await apiIntegrationToYaml(_0x5f335c,_0x58844b);_0x27ebdb[_0x332a57(0x1db)]({'name':_0x5f335c[_0x332a57(0x20d)][_0x332a57(0x228)][_0x332a57(0x230)](),'path':'','yaml':_0x5b594a});}}for(const _0x71dd43 of _0x3e8d32){const _0x3330e2=apiExperimentalKnowledgeBaseToYaml(_0x71dd43);_0x554584['push']({'name':_0x3330e2[_0x332a57(0x1fa)],'path':'','def':_0x3330e2});}for(const _0xe460f3 of _0x400317){const _0x351abc=apiExperimentalArtifactToYaml(_0xe460f3);_0x465204[_0x332a57(0x1db)]({'name':_0x351abc[_0x332a57(0x1fa)],'path':'','def':_0x351abc});}}const _0x1100bc={'sourceProjectName':_0x4f1d2f,'newProjectName':_0x1f57dd,'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}}},_0x521226=await this[_0x332a57(0x23d)][_0x332a57(0x13c)](),_0xa6c6c9=_0x521226[_0x332a57(0x1ad)](_0x37585a=>_0x37585a[_0x332a57(0x20d)][_0x332a57(0x1fa)]===_0x1f57dd);if(_0xa6c6c9)throw new SDKError(ErrorCode[_0x332a57(0x17c)],_0x332a57(0x218)+_0x1f57dd+_0x332a57(0x1ef),undefined,{'helpText':_0x332a57(0x174)});if(_0x475a4d?.['dryRun'])return _0x1100bc[_0x332a57(0x175)]['agents'][_0x332a57(0x159)]=_0xac22f[_0x332a57(0x154)],_0x1100bc[_0x332a57(0x175)][_0x332a57(0x238)]['created']=_0x33910e[_0x332a57(0x154)],_0x1100bc[_0x332a57(0x175)][_0x332a57(0x189)][_0x332a57(0x159)]=_0x1a6fa2[_0x332a57(0x154)],_0x1100bc['counts'][_0x332a57(0x1d0)]['created']=_0x554584['length'],_0x1100bc[_0x332a57(0x175)][_0x332a57(0x22d)][_0x332a57(0x159)]=_0x465204[_0x332a57(0x154)],_0x1100bc[_0x332a57(0x175)][_0x332a57(0x164)][_0x332a57(0x159)]=_0xe434d[_0x332a57(0x154)],_0x1100bc['counts'][_0x332a57(0x1c6)][_0x332a57(0x159)]=_0x27ebdb['length'],_0x1100bc;const _0x1c2fa9=await this[_0x332a57(0x23d)][_0x332a57(0x12e)]({'name':_0x1f57dd}),_0xcfe5c3=_0x1c2fa9['id'];_0x1100bc[_0x332a57(0x155)]=_0xcfe5c3;const _0x3c6ebf=new Map(),_0x28e912=new Map(),_0x321df8=new Map(),_0x315f98=new Map(),_0x2c5b29=new Map(),_0x2e9b47=new Map(),_0x3ccf36=new Map(),_0x19c919=new Map(),_0x2aa840=new Set(),_0x566e5a=new Set();for(const _0x272666 of _0xac22f){for(const _0x210254 of _0x272666[_0x332a57(0x12b)][_0x332a57(0x124)]||[]){if(_0x210254['type']===_0x332a57(0x15e)&&_0x210254[_0x332a57(0x20c)]){const _0x5cefd4=parseRef(_0x210254[_0x332a57(0x20c)]);if(_0x5cefd4)_0x2aa840[_0x332a57(0x1cf)](_0x5cefd4[_0x332a57(0x1fa)]);}else{if(_0x210254['type']===_0x332a57(0x220)&&_0x210254[_0x332a57(0x20c)]){const _0x4980ae=parseRef(_0x210254[_0x332a57(0x20c)]);if(_0x4980ae)_0x566e5a[_0x332a57(0x1cf)](_0x4980ae[_0x332a57(0x1fa)]);}}}}for(const _0x52f8cc of _0x2aa840){try{const _0x44c175=await this[_0x332a57(0x23d)][_0x332a57(0x1b3)]({'projectId':_0xcfe5c3,'name':_0x52f8cc});_0x2c5b29[_0x332a57(0x137)](_0x52f8cc,_0x44c175['id']),_0x1100bc[_0x332a57(0x195)][_0x332a57(0x1db)]({'name':_0x52f8cc,'action':_0x332a57(0x159),'id':_0x44c175['id']}),_0x1100bc[_0x332a57(0x175)]['imageGenerators']['created']++;}catch(_0x612a24){_0x1100bc[_0x332a57(0x195)][_0x332a57(0x1db)]({'name':_0x52f8cc,'action':_0x332a57(0x185),'error':_0x612a24[_0x332a57(0x1ce)]}),_0x1100bc[_0x332a57(0x175)]['imageGenerators'][_0x332a57(0x1f2)]++;}}for(const _0x59ee7f of _0x566e5a){try{const _0x46fd5e=await this[_0x332a57(0x23d)][_0x332a57(0x161)]({'projectId':_0xcfe5c3,'name':_0x59ee7f});_0x2e9b47['set'](_0x59ee7f,_0x46fd5e['id']),_0x1100bc['webSearchTools'][_0x332a57(0x1db)]({'name':_0x59ee7f,'action':'created','id':_0x46fd5e['id']}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x19f)][_0x332a57(0x159)]++;}catch(_0x14a0bc){_0x1100bc[_0x332a57(0x19f)][_0x332a57(0x1db)]({'name':_0x59ee7f,'action':_0x332a57(0x185),'error':_0x14a0bc[_0x332a57(0x1ce)]}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x19f)][_0x332a57(0x1f2)]++;}}const _0x1159ca=await fetchAllToolTargetMaps((_0x30fc9d,_0x41c6a1)=>this[_0x332a57(0x23d)]['listToolTargets'](_0x30fc9d,_0x41c6a1),_0xcfe5c3);let _0x50724a=[];const _0x176642={'projectId':_0xcfe5c3,'resolveToolTargetId':buildIdResolver({..._0x1159ca[_0x332a57(0x1f5)],'KnowledgeBase':_0x3c6ebf,'TextKnowledgeBase':_0x28e912,'ExperimentalKnowledgeBase':_0x3ccf36,'Agent':_0x321df8,'WebSearchTool':_0x2e9b47,'ImageGenerator':_0x2c5b29}),'resolvePromptId':async _0x5689f4=>_0x315f98['get'](_0x5689f4),'onWarning':_0x4695ca=>{const _0x48ce12=_0x332a57;this['logger']['warn'](_0x4695ca),_0x50724a[_0x48ce12(0x1db)](_0x4695ca);}};for(const _0x529e5b of _0x33910e){try{const _0xdd6142=yamlKnowledgeBaseToApi(_0x529e5b['yaml'],_0xcfe5c3),_0x5e3017=await this[_0x332a57(0x23d)][_0x332a57(0x1c0)](_0xdd6142);_0x3c6ebf[_0x332a57(0x137)](_0x529e5b[_0x332a57(0x12b)][_0x332a57(0x1fa)],_0x5e3017['id']),_0x1100bc[_0x332a57(0x238)][_0x332a57(0x1db)]({'name':_0x529e5b[_0x332a57(0x12b)][_0x332a57(0x1fa)],'action':'created','id':_0x5e3017['id']}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x238)]['created']++;}catch(_0xc8223b){_0x1100bc[_0x332a57(0x238)][_0x332a57(0x1db)]({'name':_0x529e5b['yaml'][_0x332a57(0x1fa)],'action':_0x332a57(0x185),'error':_0xc8223b['message']}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x238)][_0x332a57(0x1f2)]++;}}for(const _0x521110 of _0x1a6fa2){try{const _0x493de7=yamlTextKnowledgeBaseToApi({'name':_0x521110[_0x332a57(0x1fa)],'text':_0x521110['text']},_0xcfe5c3),_0x2977fd=await this[_0x332a57(0x23d)][_0x332a57(0x170)](_0x493de7);_0x28e912[_0x332a57(0x137)](_0x521110['name'],_0x2977fd['id']),_0x1100bc[_0x332a57(0x189)][_0x332a57(0x1db)]({'name':_0x521110['name'],'action':_0x332a57(0x159),'id':_0x2977fd['id']}),_0x1100bc[_0x332a57(0x175)]['textKnowledgeBases'][_0x332a57(0x159)]++;}catch(_0x1bae7a){_0x1100bc['textKnowledgeBases']['push']({'name':_0x521110['name'],'action':_0x332a57(0x185),'error':_0x1bae7a['message']}),_0x1100bc[_0x332a57(0x175)]['textKnowledgeBases']['errors']++;}}for(const _0x365c21 of _0x465204){try{const _0x4fc542=yamlExperimentalArtifactToApi(_0x365c21[_0x332a57(0x142)],_0xcfe5c3),_0x36c94a=await this[_0x332a57(0x23d)][_0x332a57(0x1e6)](_0x4fc542);_0x19c919[_0x332a57(0x137)](_0x365c21[_0x332a57(0x142)][_0x332a57(0x1fa)],_0x36c94a['id']),_0x1100bc[_0x332a57(0x22d)]['push']({'name':_0x365c21[_0x332a57(0x142)][_0x332a57(0x1fa)],'action':_0x332a57(0x159),'id':_0x36c94a['id']}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x22d)][_0x332a57(0x159)]++;}catch(_0x472751){_0x1100bc[_0x332a57(0x22d)][_0x332a57(0x1db)]({'name':_0x365c21['def']['name'],'action':_0x332a57(0x185),'error':_0x472751[_0x332a57(0x1ce)]}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x22d)][_0x332a57(0x1f2)]++;}}for(const _0x4ffbd8 of _0x554584){try{const _0x262d68=yamlExperimentalKnowledgeBaseToApi(_0x4ffbd8['def'],_0xcfe5c3),_0x3a1cd5=await this['client'][_0x332a57(0x1ff)](_0x262d68);_0x3ccf36[_0x332a57(0x137)](_0x4ffbd8[_0x332a57(0x142)][_0x332a57(0x1fa)],_0x3a1cd5['id']),_0x1100bc['experimentalKnowledgeBases'][_0x332a57(0x1db)]({'name':_0x4ffbd8[_0x332a57(0x142)][_0x332a57(0x1fa)],'action':'created','id':_0x3a1cd5['id']}),_0x1100bc[_0x332a57(0x175)]['experimentalKnowledgeBases']['created']++;}catch(_0x1d241d){_0x1100bc['experimentalKnowledgeBases']['push']({'name':_0x4ffbd8[_0x332a57(0x142)][_0x332a57(0x1fa)],'action':'error','error':_0x1d241d[_0x332a57(0x1ce)]}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x1d0)][_0x332a57(0x1f2)]++;}}const _0x4a9190=[..._0xac22f]['sort']((_0x4609bb,_0x140860)=>{const _0x4ade2d=_0x332a57,_0x317e84=_0x4609bb[_0x4ade2d(0x12b)][_0x4ade2d(0x124)]?.[_0x4ade2d(0x15d)](_0x50307e=>_0x50307e[_0x4ade2d(0x23a)]===_0x4ade2d(0x22a))??![],_0x515a31=_0x140860['yaml'][_0x4ade2d(0x124)]?.['some'](_0x505199=>_0x505199['type']===_0x4ade2d(0x22a))??![];if(_0x317e84&&!_0x515a31)return 0x1;if(!_0x317e84&&_0x515a31)return-0x1;return 0x0;});for(const _0x35187b of _0x4a9190){_0x50724a=[];try{const _0x4a3999=_0x35187b[_0x332a57(0x12b)][_0x332a57(0x124)]?.[_0x332a57(0x153)](_0x5da189=>{const _0x5bfd22=_0x332a57;if(_0x5da189[_0x5bfd22(0x23a)]===_0x5bfd22(0x22a)&&_0x5da189[_0x5bfd22(0x20c)]){const _0x31da38=parseRef(_0x5da189['target']);return _0x31da38?.[_0x5bfd22(0x1fa)]===_0x35187b[_0x5bfd22(0x12b)]['name'];}return![];})??[];if(_0x4a3999[_0x332a57(0x154)]>0x0){const _0x21ef3e=_0x332a57(0x162)+_0x35187b[_0x332a57(0x12b)][_0x332a57(0x1fa)]+_0x332a57(0x17b)+_0x332a57(0x1a9);this[_0x332a57(0x214)][_0x332a57(0x12f)](_0x21ef3e),_0x50724a['push'](_0x21ef3e);}const _0x69ec52=await agentDefToRequest(_0x35187b[_0x332a57(0x12b)],_0x35187b['systemPrompt'],_0x35187b[_0x332a57(0x237)],_0x176642),_0x56a3ce=await this[_0x332a57(0x23d)]['createAgentResponse'](_0x69ec52);_0x321df8[_0x332a57(0x137)](_0x35187b['yaml'][_0x332a57(0x1fa)],_0x56a3ce['id']),_0x1100bc[_0x332a57(0x1b1)][_0x332a57(0x1db)]({'agentName':_0x35187b['yaml']['name'],'action':_0x332a57(0x159),'agentId':_0x56a3ce['id'],'warnings':_0x50724a['length']>0x0?_0x50724a:undefined}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x1b1)]['created']++;}catch(_0x22b4f9){_0x1100bc[_0x332a57(0x1b1)][_0x332a57(0x1db)]({'agentName':_0x35187b[_0x332a57(0x12b)][_0x332a57(0x1fa)],'action':'error','error':_0x22b4f9[_0x332a57(0x1ce)],'warnings':_0x50724a[_0x332a57(0x154)]>0x0?_0x50724a:undefined}),_0x1100bc['counts'][_0x332a57(0x1b1)][_0x332a57(0x1f2)]++;}}for(const _0x41825f of _0xe434d){try{const _0x34bd34=await yamlPromptToApi(_0x41825f['yaml'],_0xcfe5c3,_0x176642);if(!_0x34bd34){_0x1100bc['prompts'][_0x332a57(0x1db)]({'name':_0x41825f[_0x332a57(0x12b)][_0x332a57(0x1fa)],'action':_0x332a57(0x185),'error':_0x332a57(0x13e)}),_0x1100bc[_0x332a57(0x175)]['prompts']['errors']++;continue;}const _0x56f07f=await this[_0x332a57(0x23d)][_0x332a57(0x173)](_0x34bd34);_0x315f98[_0x332a57(0x137)](_0x41825f['yaml'][_0x332a57(0x1fa)],_0x56f07f['id']),_0x1100bc[_0x332a57(0x164)][_0x332a57(0x1db)]({'name':_0x41825f[_0x332a57(0x12b)]['name'],'action':_0x332a57(0x159),'id':_0x56f07f['id']}),_0x1100bc['counts']['prompts'][_0x332a57(0x159)]++;}catch(_0x110e09){_0x1100bc[_0x332a57(0x164)][_0x332a57(0x1db)]({'name':_0x41825f['yaml'][_0x332a57(0x1fa)],'action':_0x332a57(0x185),'error':_0x110e09['message']}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x164)][_0x332a57(0x1f2)]++;}}for(const _0x748ed0 of _0x27ebdb){try{const _0x1826cb=await yamlIntegrationToApi(_0x748ed0[_0x332a57(0x12b)],_0xcfe5c3,_0x176642),_0xa1bfd2=await this[_0x332a57(0x23d)][_0x332a57(0x192)](_0x1826cb);_0x1100bc[_0x332a57(0x1c6)][_0x332a57(0x1db)]({'name':_0x748ed0[_0x332a57(0x12b)][_0x332a57(0x1ea)],'action':'created','id':_0xa1bfd2['id']}),_0x1100bc[_0x332a57(0x175)][_0x332a57(0x1c6)]['created']++;}catch(_0xf927b4){_0x1100bc[_0x332a57(0x1c6)][_0x332a57(0x1db)]({'name':_0x748ed0['yaml']['service_type'],'action':_0x332a57(0x185),'error':_0xf927b4[_0x332a57(0x1ce)]}),_0x1100bc[_0x332a57(0x175)]['integrations'][_0x332a57(0x1f2)]++;}}return _0x1100bc;}}
|
|
1
|
+
const a109_0x4c7d5f=a109_0x2456;(function(_0x217bd3,_0x597b59){const _0x28806d=a109_0x2456,_0x4d30a8=_0x217bd3();while(!![]){try{const _0xa2e388=parseInt(_0x28806d(0x173))/0x1*(-parseInt(_0x28806d(0x22e))/0x2)+parseInt(_0x28806d(0x222))/0x3*(-parseInt(_0x28806d(0x250))/0x4)+parseInt(_0x28806d(0x247))/0x5+parseInt(_0x28806d(0x196))/0x6+-parseInt(_0x28806d(0x1a7))/0x7*(parseInt(_0x28806d(0x188))/0x8)+parseInt(_0x28806d(0x228))/0x9+-parseInt(_0x28806d(0x1a6))/0xa*(parseInt(_0x28806d(0x1e9))/0xb);if(_0xa2e388===_0x597b59)break;else _0x4d30a8['push'](_0x4d30a8['shift']());}catch(_0x1fa665){_0x4d30a8['push'](_0x4d30a8['shift']());}}}(a109_0x5776,0xd4803));import{LLMApiClient}from'../client/llm-api-client.js';import*as a109_0x59bb7c from'node:fs';import*as a109_0x461681 from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{SDKError,ErrorCode,errorContains}from'../errors.js';import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir}from'../agent/agent-config.js';import{getSanitizedUsername,generateRandomHex}from'../../utils/string-utils.js';function a109_0x5776(){const _0x5e222a=['createProject','project.json','Available\x20agents:\x20','Invalid\x20agent\x20reference\x20format:\x20','Renamed\x20folder:\x20','cloneProject','prompt.md','temperature','action','keys','listExperimentalArtifacts','updateTextKnowledgeBase','project','service_type','resolveProjectId','tools','createAgent','serviceType','newProjectId','pullAgent','toISOString','updateAgentResponse','path','files','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','\x27\x20(','listAgentsFull','Skipping\x20integration\x20\x27','createIntegration','integrations.json','1284514tzbjaD','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','none','\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20','dir','getAgent','createExperimentalArtifact','Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20','Unresolved\x20dependencies:\x20','agentId','template','listProjects','code','listChats','resolveProjectName','experimentalKnowledgeBases','set','getDefaultAgent','startChat','maxToolIterations','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','Agent\x20\x27','):\x20','message','\x0a---\x20schema:\x20','dryRun','llm_project','listTextKnowledgeBases','.md','status','variables','add','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.','imageGenerators','Unsupported\x20backup\x20version:\x20','getChatHistory','models','agent','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','INVALID_ARGUMENT','Multiple\x20agents\x20found\x20with\x20name\x20\x27','signal','knowledgeBases','ExperimentalKnowledgeBase','duplicate','Renamed\x20prompt\x20file:\x20','projectName','\x27.\x20This\x20should\x20not\x20happen.','listExperimentalKnowledgeBases','writeFileSync','---\x20schema:\x20','createImageGenerator','NOT_FOUND','updateExperimentalKnowledgeBase','createAgentResponse','client','Removed\x20deleted\x20file:\x20','1104MBEknR','unlinkSync','some','attributes','basename','currentProjectId','5634720uBMsuj','experimentalArtifacts','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','1.0','Backup\x20folder\x20not\x20found:\x20','agents','1216252fIFgPP','find','counts','tdx_default_','site','dirname','getOrCreateDefaultProject','agents.json','claude-4.5-sonnet','Renamed\x20agent\x20folder:\x20','includes','utf-8','getDefaultProjectName','existsSync','chatInfo','\x22\x20already\x20exists','cwd','getProject','createExperimentalKnowledgeBase','updated','webhookCorsOrigins','resolveAgentId','listAgents','low','history','8011810xLCTBb','tdx_','description','chatWelcomeMessage','info','getBackupMetadata','agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat','systemPrompt','rmSync','2120jnjCro','\x0a---\x20function:\x20','isDirectory','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.','createTextKnowledgeBase','promptId','length','warn','starter_message','updatePrompt',')\x20can\x20be\x20cloned.','TextKnowledgeBase','listPrompts','profile','Output\x20directory\x20already\x20exists:\x20','name','errors','_reasoning_','total','filter','tdx.json','createPrompt','\x0a\x0a#\x20agent.yml\x0a','isDir','createKnowledgeBase','get','json_schema','parse','chats','high','INTERNAL','Agent\x20reference\x20not\x20found','webSearchTools','knowledgebases.json','experimental_knowledge_bases','Project\x20not\x20found:\x20','tables','LLM_PROJECT_NOT_FOUND','.yml','prompts','text','text_content','Unable\x20to\x20create\x20project\x20after\x20','Renamed\x20KB\x20file:\x20','agent.yml','listToolTargets','UNAUTHENTICATED','context','agent.yml\x20not\x20found\x20in\x20','---\x20file:\x20','Agent\x20not\x20found:\x20','ALREADY_EXISTS','endsWith','#\x20prompt.md\x0a','json_schema.json','isManaged','logger','readFileSync','error','clearDefaultAgent','2ABCeRj','prompts.json','chatIgnoreManagedActions','Renamed\x20experimental\x20KB\x20directory:\x20','.llm','created','toLowerCase','listKnowledgeBases','version','Removed\x20deleted\x20directory:\x20','isFile','has','knowledge_bases','listWebSearchTools','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','textKnowledgeBases','map','sort','code.js','getUserSettings','integrations','11357416YZQCWO','def','Only\x20safe\x20types\x20(','event','\x0a---\x20code\x20---\x0a','mkdirSync','file_name','setDefaultAgent','AGENT_NOT_FOUND','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','listIntegrations','dry-run-','medium','localeCompare','10238868MqqLCb','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','nameToId','\x20in\x20project\x20','loadJsonFile','join','Multiple\x20projects\x20found\x20with\x20name\x20\x27','deleteProject','Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.','updateAgent','availableModels','backupProject','readdirSync','\x20---\x0a','size','new','20eVRYOX','7YmiYXm','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','pushAgent','starterMessage','setCurrentProject','push','stringify','starter_message.md','Renamed\x20integration\x20file:\x20','conflict','\x20→\x20','target','functions','statSync','deleteAgent','projectId','type','outputs','updateExperimentalArtifact','chat_generic','modelType','tdDatabaseName','slackMessageMode','yaml','Renamed\x20text\x20KB\x20file:\x20','getChatLog','PERMISSION_DENIED','deleteIntegration','createWebSearchTool','oldPath','renamed','image_gen','unchanged','Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.','.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.','split'];a109_0x5776=function(){return _0x5e222a;};return a109_0x5776();}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=[a109_0x4c7d5f(0x1ba),'chat_agent_console','chat_parent_segment'];function a109_0x2456(_0x462b57,_0x3065cc){_0x462b57=_0x462b57-0x157;const _0x577650=a109_0x5776();let _0x24561b=_0x577650[_0x462b57];return _0x24561b;}async function safeListOrEmpty(_0x14bc8d){const _0xc8ed48=a109_0x4c7d5f;try{return await _0x14bc8d();}catch(_0x453f63){if(_0x453f63 instanceof HTTPClientError&&_0x453f63[_0xc8ed48(0x206)]===0x194)return[];throw _0x453f63;}}export class LLMSDK{[a109_0x4c7d5f(0x227)];[a109_0x4c7d5f(0x220)];[a109_0x4c7d5f(0x166)];['logger']=Logger['of']('sdk.llm');constructor(_0x48370f){const _0x5e6059=a109_0x4c7d5f;this[_0x5e6059(0x220)]=new LLMApiClient(_0x48370f),this['context']=_0x48370f;}[a109_0x4c7d5f(0x23a)](){const _0x508ccd=a109_0x4c7d5f,_0x9f6c35=getSanitizedUsername();return _0x508ccd(0x231)+_0x9f6c35;}async[a109_0x4c7d5f(0x1ab)](_0x368ef1){const _0x5c7de4=a109_0x4c7d5f,{projectId:_0x4612d6}=await this[_0x5c7de4(0x1f7)](_0x368ef1);this[_0x5c7de4(0x227)]=_0x4612d6;}['getCurrentProject'](){const _0x4b9306=a109_0x4c7d5f;return this[_0x4b9306(0x227)];}async[a109_0x4c7d5f(0x18f)](_0x17aac0){const _0x1e5fe2=a109_0x4c7d5f,_0x35f00c=this[_0x1e5fe2(0x166)][_0x1e5fe2(0x25e)];let _0x582943,_0x1d4bdc;if(_0x17aac0['includes']('/')){const _0x4bb661=_0x17aac0[_0x1e5fe2(0x1ca)]('/');if(_0x4bb661[_0x1e5fe2(0x257)]!==0x2)throw new SDKError(ErrorCode[_0x1e5fe2(0x210)],_0x1e5fe2(0x1ce)+_0x17aac0,undefined,{'helpText':_0x1e5fe2(0x1fd)});const [_0x5909bb,_0x1762f5]=_0x4bb661;_0x582943=await this[_0x1e5fe2(0x1d9)](_0x5909bb),_0x1d4bdc=_0x1762f5;}else _0x582943=this['currentProjectId']||(await this[_0x1e5fe2(0x234)]())['id'],_0x1d4bdc=_0x17aac0;const _0xa660e=await this[_0x1e5fe2(0x243)](_0x1d4bdc,_0x582943),_0x4a3291=await this[_0x1e5fe2(0x220)][_0x1e5fe2(0x1ee)](_0xa660e);writeCachedLLMAgent(_0x4a3291[_0x1e5fe2(0x225)][_0x1e5fe2(0x260)],_0xa660e,_0x582943,_0x35f00c);}[a109_0x4c7d5f(0x1fa)](){const _0x16dc55=a109_0x4c7d5f,_0x53f002=this[_0x16dc55(0x166)][_0x16dc55(0x25e)];return readCachedLLMAgent(_0x53f002)||undefined;}[a109_0x4c7d5f(0x172)](){const _0x122223=a109_0x4c7d5f,_0x4e8e44=this['context'][_0x122223(0x25e)];clearCachedLLMAgent(_0x4e8e44);}async[a109_0x4c7d5f(0x20d)](){const _0x115790=a109_0x4c7d5f,_0x2f3165=await this[_0x115790(0x220)][_0x115790(0x186)](),_0x24d928=[];for(const _0x1a1aac of _0x2f3165['availableModelNames']){const _0x58901f=_0x2f3165[_0x115790(0x1a0)][_0x1a1aac];_0x58901f&&_0x24d928[_0x115790(0x1ac)]({'name':_0x1a1aac,'displayName':_0x58901f['displayName']});}return _0x24d928;}async[a109_0x4c7d5f(0x1cb)](_0x14a80d){const _0x42d059=a109_0x4c7d5f;return await this[_0x42d059(0x220)]['createProject'](_0x14a80d);}async[a109_0x4c7d5f(0x19d)](_0x49acb2){const _0x6638b1=a109_0x4c7d5f,{projectId:_0x4f2d04}=await this[_0x6638b1(0x1f7)](_0x49acb2);await this['client'][_0x6638b1(0x19d)](_0x4f2d04);}async['projects'](_0x4206de=0x32){const _0x1e68c4=a109_0x4c7d5f;return await this['client'][_0x1e68c4(0x1f4)](_0x4206de);}async[a109_0x4c7d5f(0x234)](_0xd64519){const _0x4cff3a=a109_0x4c7d5f,_0x288fbe=_0xd64519||this['getDefaultProjectName'](),_0x2bc257=this['context'][_0x4cff3a(0x25e)];if(!_0xd64519){const _0x50148b=readCachedLLMProject(_0x2bc257);if(_0x50148b&&_0x50148b[_0x4cff3a(0x260)]===_0x288fbe)try{const _0x4b75a9=await this[_0x4cff3a(0x220)][_0x4cff3a(0x23f)](_0x50148b['id']);if(_0x4b75a9[_0x4cff3a(0x225)]['name']===_0x288fbe)return _0x4b75a9;}catch{}}const _0x3301f0=await this[_0x4cff3a(0x220)]['listProjects'](),_0x23f7f7=_0x3301f0[_0x4cff3a(0x22f)](_0x4fc5bf=>_0x4fc5bf[_0x4cff3a(0x225)][_0x4cff3a(0x260)]===_0x288fbe);if(_0x23f7f7)return!_0xd64519&&writeCachedLLMProject(_0x288fbe,_0x23f7f7['id'],_0x2bc257),_0x23f7f7;const _0x37aae0=await this[_0x4cff3a(0x220)]['createProject']({'name':_0x288fbe,'description':_0x4cff3a(0x1a8)+getSanitizedUsername()+')'});return!_0xd64519&&writeCachedLLMProject(_0x288fbe,_0x37aae0['id'],_0x2bc257),_0x37aae0;}async[a109_0x4c7d5f(0x1d9)](_0x54634b){const _0x1051c2=a109_0x4c7d5f,_0xd26c5f=await this['client'][_0x1051c2(0x1f4)](),_0x1a836b=_0xd26c5f['filter'](_0x2ff1a4=>_0x2ff1a4['attributes']['name']===_0x54634b);if(_0x1a836b[_0x1051c2(0x257)]===0x0)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x1051c2(0x15a)+_0x54634b,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});if(_0x1a836b[_0x1051c2(0x257)]>0x1)throw new SDKError(ErrorCode[_0x1051c2(0x26f)],_0x1051c2(0x19c)+_0x54634b+_0x1051c2(0x218));return _0x1a836b[0x0]['id'];}async[a109_0x4c7d5f(0x1f7)](_0x36e5d9){const _0x4f908f=a109_0x4c7d5f,_0xee8627=await this[_0x4f908f(0x220)][_0x4f908f(0x1f4)](),_0x3a2c79=_0xee8627[_0x4f908f(0x22f)](_0x4384df=>_0x4384df[_0x4f908f(0x225)][_0x4f908f(0x260)]===_0x36e5d9);if(_0x3a2c79)return{'projectId':_0x3a2c79['id'],'project':_0x3a2c79};throw new SDKError(ErrorCode[_0x4f908f(0x15c)],_0x4f908f(0x15a)+_0x36e5d9,undefined,{'helpText':_0x4f908f(0x20f)});}async['getOrCreateDefaultAgent'](_0x11e64d=a109_0x4c7d5f(0x236),_0x52d2c5=0x0,_0x30c21a){const _0xd1c042=a109_0x4c7d5f,_0x2c2526=0xa;let _0x2b24c6=0x0,_0x37d795;while(_0x2b24c6<_0x2c2526){try{const _0x303176=await this[_0xd1c042(0x234)](_0x37d795),_0x1c8f74=_0x303176['id'],_0x58e3e2=[_0xd1c042(0x1eb),'minimal',_0xd1c042(0x245),_0xd1c042(0x194),_0xd1c042(0x26e)],_0x34b54b=_0x52d2c5===0x0?_0xd1c042(0x248)+_0x11e64d:_0xd1c042(0x248)+_0x11e64d+_0xd1c042(0x262)+_0x58e3e2[_0x52d2c5],_0x567523=await this[_0xd1c042(0x220)][_0xd1c042(0x244)](_0x1c8f74),_0x53e161=_0x567523[_0xd1c042(0x22f)](_0x2d1245=>_0x2d1245[_0xd1c042(0x225)]['name']===_0x34b54b);if(_0x53e161)return _0x53e161;const _0xe7a768=_0x52d2c5>0x0?0x1:_0x30c21a;return await this[_0xd1c042(0x220)][_0xd1c042(0x1db)]({'name':_0x34b54b,'projectId':_0x1c8f74,'modelType':_0x11e64d,'systemPrompt':'','temperature':_0xe7a768,'reasoningEffort':_0x52d2c5>0x0?_0x52d2c5:undefined});}catch(_0x290523){if(_0x290523 instanceof HTTPClientError){const _0x2345d1=_0x290523[_0xd1c042(0x206)];if(_0x2345d1>=0x190&&_0x2345d1<0x1f4){if(_0x2345d1===0x191)throw new SDKError(ErrorCode[_0xd1c042(0x165)],'Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.',_0x290523);else{if(_0x2345d1===0x193)throw new SDKError(ErrorCode[_0xd1c042(0x1c1)],'Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.',_0x290523);}throw _0x290523;}}if(errorContains(_0x290523,'already\x20exists',_0xd1c042(0x215),_0xd1c042(0x1b0))){_0x2b24c6++;if(_0x2b24c6>=_0x2c2526)throw new SDKError(ErrorCode[_0xd1c042(0x16a)],_0xd1c042(0x161)+_0x2c2526+'\x20attempts\x20due\x20to\x20name\x20conflicts.',_0x290523);const _0x18d3c4=this[_0xd1c042(0x23a)]();_0x37d795=_0x18d3c4+'_'+generateRandomHex();continue;}throw _0x290523;}}throw new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts');}async[a109_0x4c7d5f(0x243)](_0x5b5f34,_0x34f3f1){const _0x206d77=a109_0x4c7d5f,_0x3f341c=_0x34f3f1||this[_0x206d77(0x227)],_0x2ed828=await this[_0x206d77(0x220)][_0x206d77(0x244)](_0x3f341c),_0x215ed9=_0x2ed828[_0x206d77(0x264)](_0x537914=>_0x537914[_0x206d77(0x225)][_0x206d77(0x260)]===_0x5b5f34);if(_0x215ed9[_0x206d77(0x257)]===0x0){const _0x519171=_0x3f341c?_0x206d77(0x199)+_0x3f341c:'';throw new SDKError(ErrorCode[_0x206d77(0x190)],_0x206d77(0x169)+_0x5b5f34+_0x519171,undefined,{'helpText':_0x3f341c?_0x206d77(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(_0x215ed9[_0x206d77(0x257)]>0x1)throw new SDKError(ErrorCode[_0x206d77(0x26f)],_0x206d77(0x211)+_0x5b5f34+'\x27.\x20This\x20should\x20not\x20happen.');return _0x215ed9[0x0]['id'];}async['agents'](_0x3f7c7e){const _0x422b2d=a109_0x4c7d5f,_0x41bcfa=_0x3f7c7e||this[_0x422b2d(0x227)];return await this['client'][_0x422b2d(0x244)](_0x41bcfa);}async['agentsFull'](_0x33fa72){const _0x3eebf8=a109_0x4c7d5f;return await this[_0x3eebf8(0x220)][_0x3eebf8(0x1e5)](_0x33fa72);}async['agent'](_0x577fce){const _0x19ac31=a109_0x4c7d5f;return await this[_0x19ac31(0x220)][_0x19ac31(0x1ee)](_0x577fce);}async[a109_0x4c7d5f(0x1db)](_0x4adddc){const _0x560fd8=a109_0x4c7d5f;return await this[_0x560fd8(0x220)]['createAgent'](_0x4adddc);}async[a109_0x4c7d5f(0x19f)](_0x4e0908,_0x580d2a){const _0xf74151=a109_0x4c7d5f;return await this[_0xf74151(0x220)][_0xf74151(0x19f)](_0x4e0908,_0x580d2a);}async[a109_0x4c7d5f(0x1b5)](_0x1badfb){const _0x1311fc=a109_0x4c7d5f;await this[_0x1311fc(0x220)][_0x1311fc(0x1b5)](_0x1badfb);}async[a109_0x4c7d5f(0x1fb)](_0x2d3f1e){const _0x4d7c98=a109_0x4c7d5f;return await this[_0x4d7c98(0x220)][_0x4d7c98(0x1fb)]({'agentId':_0x2d3f1e});}async*['chat'](_0x5358ac,_0x8092f3){const _0x384811=a109_0x4c7d5f;let _0x103316=_0x8092f3?.['chatId'];const _0x3a518f=_0x8092f3?.[_0x384811(0x1f2)];if(!_0x103316){if(!_0x3a518f)throw new Error(_0x384811(0x24d));const _0x5f3582=await this[_0x384811(0x220)]['startChat']({'agentId':_0x3a518f});_0x103316=_0x5f3582['id'],yield{'type':'metadata','data':{'chatId':_0x103316,'agentId':_0x3a518f,'projectId':_0x5f3582['attributes'][_0x384811(0x1b6)]}};}for await(const _0x3ee05c of this['client']['continueChat'](_0x103316,_0x5358ac,_0x8092f3?.[_0x384811(0x212)])){yield{'type':_0x384811(0x18b),'data':_0x3ee05c};}}async[a109_0x4c7d5f(0x26d)](_0xdfa67b=0x32){const _0x5818f3=a109_0x4c7d5f;return await this[_0x5818f3(0x220)][_0x5818f3(0x1f6)](_0xdfa67b);}async[a109_0x4c7d5f(0x246)](_0x420213){const _0x4b97f8=a109_0x4c7d5f;return await this[_0x4b97f8(0x220)][_0x4b97f8(0x20c)](_0x420213);}async[a109_0x4c7d5f(0x1c0)](_0x2e5ae8){const _0x4003e7=a109_0x4c7d5f;return await this['client'][_0x4003e7(0x1c0)](_0x2e5ae8);}async[a109_0x4c7d5f(0x23c)](_0x540472){const _0x40db3c=a109_0x4c7d5f;return await this[_0x40db3c(0x220)]['getChatInfo'](_0x540472);}async[a109_0x4c7d5f(0x1a1)](_0x430a37,_0x1b3ad1,_0x229ece){const _0x4f2338=a109_0x4c7d5f,_0x47856c=_0x229ece?.[_0x4f2338(0x202)]??![],{projectId:_0x104bea,project:_0x2bbcf1}=await this[_0x4f2338(0x1f7)](_0x430a37),_0x39d29d=_0x2bbcf1['attributes'][_0x4f2338(0x260)],_0x56ba60=_0x1b3ad1||_0x39d29d+_0x4f2338(0x177);if(a109_0x59bb7c[_0x4f2338(0x23b)](_0x56ba60)&&!_0x47856c)throw new SDKError(ErrorCode[_0x4f2338(0x16a)],_0x4f2338(0x25f)+_0x56ba60,undefined,{'helpText':_0x4f2338(0x209)});const _0x1ea36d=await this[_0x4f2338(0x220)][_0x4f2338(0x1e5)](_0x104bea),_0x5d774e=await this[_0x4f2338(0x220)]['listKnowledgeBases'](_0x104bea),_0x3fadc8=await this['client'][_0x4f2338(0x25d)](_0x104bea),_0xd84c01=await this[_0x4f2338(0x220)]['listIntegrations'](_0x104bea);if(!_0x47856c){a109_0x59bb7c['mkdirSync'](_0x56ba60,{'recursive':!![]});const _0x59b963={'version':_0x4f2338(0x22b),'exportedAt':new Date()[_0x4f2338(0x1df)](),'exportedFrom':{'site':this[_0x4f2338(0x166)][_0x4f2338(0x232)],'projectId':_0x104bea,'projectName':_0x39d29d},'project':_0x2bbcf1};a109_0x59bb7c['writeFileSync'](a109_0x461681[_0x4f2338(0x19b)](_0x56ba60,'project.json'),JSON[_0x4f2338(0x1ad)](_0x59b963,null,0x2)),a109_0x59bb7c[_0x4f2338(0x21a)](a109_0x461681['join'](_0x56ba60,_0x4f2338(0x235)),JSON[_0x4f2338(0x1ad)](_0x1ea36d,null,0x2)),a109_0x59bb7c[_0x4f2338(0x21a)](a109_0x461681[_0x4f2338(0x19b)](_0x56ba60,_0x4f2338(0x158)),JSON[_0x4f2338(0x1ad)](_0x5d774e,null,0x2)),a109_0x59bb7c[_0x4f2338(0x21a)](a109_0x461681[_0x4f2338(0x19b)](_0x56ba60,_0x4f2338(0x174)),JSON['stringify'](_0x3fadc8,null,0x2)),a109_0x59bb7c[_0x4f2338(0x21a)](a109_0x461681['join'](_0x56ba60,'integrations.json'),JSON[_0x4f2338(0x1ad)](_0xd84c01,null,0x2));}return{'projectName':_0x39d29d,'outputDir':_0x56ba60,'counts':{'agents':_0x1ea36d['length'],'knowledgeBases':_0x5d774e[_0x4f2338(0x257)],'prompts':_0x3fadc8[_0x4f2338(0x257)],'integrations':_0xd84c01[_0x4f2338(0x257)]}};}async['restoreProject'](_0x5ac608,_0x49ca02){const _0x2fc318=a109_0x4c7d5f,_0x11ffbe=_0x49ca02?.['dryRun']??![],_0x3bc09e=this[_0x2fc318(0x24c)](_0x5ac608),_0x9f822c=_0x3bc09e['exportedFrom'][_0x2fc318(0x232)],_0x1ef9ff=this[_0x2fc318(0x166)]['site'],_0x1f313f=_0x9f822c!==_0x1ef9ff?_0x9f822c:undefined,_0x1499dc=this[_0x2fc318(0x19a)](a109_0x461681[_0x2fc318(0x19b)](_0x5ac608,_0x2fc318(0x235)),[]),_0x288a68=this[_0x2fc318(0x19a)](a109_0x461681[_0x2fc318(0x19b)](_0x5ac608,_0x2fc318(0x158)),[]),_0x58fc8b=this[_0x2fc318(0x19a)](a109_0x461681[_0x2fc318(0x19b)](_0x5ac608,_0x2fc318(0x174)),[]),_0x568915=this[_0x2fc318(0x19a)](a109_0x461681[_0x2fc318(0x19b)](_0x5ac608,_0x2fc318(0x1e8)),[]),_0x566193=_0x49ca02?.[_0x2fc318(0x260)]||_0x3bc09e['exportedFrom'][_0x2fc318(0x217)];if(_0x11ffbe){const _0x46bdc9=new Map(),_0xcccae=[..._0x1499dc],_0xa28dc9=_0x1499dc[_0x2fc318(0x257)]+0x1;let _0x295973=0x0;while(_0xcccae[_0x2fc318(0x257)]>0x0&&_0x295973<_0xa28dc9){_0x295973++;const _0xfc622b=[];for(const _0x5f8537 of _0xcccae){canCreateAgent(_0x5f8537,_0x46bdc9)?_0x46bdc9['set'](_0x5f8537['id'],_0x2fc318(0x193)+_0x5f8537['id']):_0xfc622b[_0x2fc318(0x1ac)](_0x5f8537);}if(_0xfc622b[_0x2fc318(0x257)]===_0xcccae['length'])throw new SDKError(ErrorCode[_0x2fc318(0x26f)],_0x2fc318(0x191),undefined,{'helpText':_0x2fc318(0x1ea)});_0xcccae[_0x2fc318(0x257)]=0x0,_0xcccae[_0x2fc318(0x1ac)](..._0xfc622b);}const _0x5fd032=_0x58fc8b[_0x2fc318(0x264)](_0x59c8ef=>_0x46bdc9[_0x2fc318(0x17e)](_0x59c8ef['attributes'][_0x2fc318(0x1f2)]))[_0x2fc318(0x257)];return{'projectName':_0x566193,'projectId':'(dry-run)','counts':{'agents':_0x1499dc[_0x2fc318(0x257)],'knowledgeBases':_0x288a68['length'],'prompts':_0x5fd032,'integrations':_0x568915[_0x2fc318(0x257)]},'sourceSite':_0x1f313f};}const _0x11fe0c=await this[_0x2fc318(0x220)][_0x2fc318(0x1cb)]({'name':_0x566193,'description':_0x3bc09e[_0x2fc318(0x1d7)][_0x2fc318(0x225)][_0x2fc318(0x249)]}),_0x175d02=_0x11fe0c['id'],_0x5c44b4=new Map(),_0x1dda28=new Map(),_0x52e42d=new Map();for(const _0x2d523d of _0x288a68){const _0x3b6fe1=await this['client'][_0x2fc318(0x269)]({'projectId':_0x175d02,'name':_0x2d523d[_0x2fc318(0x225)][_0x2fc318(0x260)],'tdDatabaseName':_0x2d523d[_0x2fc318(0x225)][_0x2fc318(0x1bc)],'tables':_0x2d523d[_0x2fc318(0x225)][_0x2fc318(0x15b)]});_0x5c44b4[_0x2fc318(0x1f9)](_0x2d523d['id'],_0x3b6fe1['id']);}const _0x3ea497=[..._0x1499dc],_0x1e7d21=_0x1499dc[_0x2fc318(0x257)]+0x1;let _0x153d6a=0x0;while(_0x3ea497[_0x2fc318(0x257)]>0x0&&_0x153d6a<_0x1e7d21){_0x153d6a++;const _0x430c6a=[];for(const _0x5b9bf6 of _0x3ea497){if(canCreateAgent(_0x5b9bf6,_0x1dda28)){const _0x2a5b3e=remapToolIds(_0x5b9bf6['attributes'][_0x2fc318(0x1da)],_0x5c44b4,_0x1dda28),_0x2b6b07=remapVariableIds(_0x5b9bf6[_0x2fc318(0x225)][_0x2fc318(0x207)],_0x5c44b4),_0x1fbfb2=await this[_0x2fc318(0x220)][_0x2fc318(0x21f)]({'name':_0x5b9bf6['attributes'][_0x2fc318(0x260)],'projectId':_0x175d02,'systemPrompt':_0x5b9bf6[_0x2fc318(0x225)]['systemPrompt'],'starterMessage':_0x5b9bf6[_0x2fc318(0x225)]['starterMessage'],'modelType':migrateModelType(_0x5b9bf6[_0x2fc318(0x225)][_0x2fc318(0x1bb)]),'maxToolIterations':_0x5b9bf6[_0x2fc318(0x225)][_0x2fc318(0x1fc)],'temperature':_0x5b9bf6[_0x2fc318(0x225)][_0x2fc318(0x1d2)],'reasoningEffort':_0x5b9bf6[_0x2fc318(0x225)]['reasoningEffort'],'outputs':_0x5b9bf6[_0x2fc318(0x225)][_0x2fc318(0x1b8)],'tools':_0x2a5b3e,'variables':_0x2b6b07});_0x1dda28[_0x2fc318(0x1f9)](_0x5b9bf6['id'],_0x1fbfb2['id']);}else _0x430c6a[_0x2fc318(0x1ac)](_0x5b9bf6);}if(_0x430c6a[_0x2fc318(0x257)]===_0x3ea497[_0x2fc318(0x257)])throw new SDKError(ErrorCode['INTERNAL'],_0x2fc318(0x191),undefined,{'helpText':_0x2fc318(0x1ea)});_0x3ea497[_0x2fc318(0x257)]=0x0,_0x3ea497['push'](..._0x430c6a);}for(const _0x1f6f24 of _0x58fc8b){const _0x1baa4e=_0x1dda28[_0x2fc318(0x26a)](_0x1f6f24['attributes']['agentId']);if(!_0x1baa4e)continue;const _0x42a14a=await this['client'][_0x2fc318(0x266)]({'projectId':_0x175d02,'agentId':_0x1baa4e,'name':_0x1f6f24['attributes'][_0x2fc318(0x260)],'systemPrompt':_0x1f6f24[_0x2fc318(0x225)]['systemPrompt'],'template':_0x1f6f24[_0x2fc318(0x225)][_0x2fc318(0x1f3)],'jsonSchemaHint':_0x1f6f24[_0x2fc318(0x225)]['jsonSchemaHint']});_0x52e42d[_0x2fc318(0x1f9)](_0x1f6f24['id'],_0x42a14a['id']);}for(const _0x4111fe of _0x568915){const _0x21184c=_0x4111fe[_0x2fc318(0x225)]['actions'][_0x2fc318(0x183)](_0x56778c=>({..._0x56778c,'promptId':_0x52e42d['get'](_0x56778c[_0x2fc318(0x256)])||_0x56778c[_0x2fc318(0x256)]}));await this[_0x2fc318(0x220)][_0x2fc318(0x1e7)]({'projectId':_0x175d02,'serviceType':_0x4111fe['attributes']['serviceType'],'actions':_0x21184c,'slackMessageMode':_0x4111fe[_0x2fc318(0x225)][_0x2fc318(0x1bd)],'chatIgnoreManagedActions':_0x4111fe['attributes'][_0x2fc318(0x175)],'chatWelcomeMessage':_0x4111fe[_0x2fc318(0x225)][_0x2fc318(0x24a)],'webhookCorsOrigins':_0x4111fe[_0x2fc318(0x225)][_0x2fc318(0x242)]});}return{'projectName':_0x566193,'projectId':_0x175d02,'counts':{'agents':_0x1dda28[_0x2fc318(0x1a4)],'knowledgeBases':_0x5c44b4[_0x2fc318(0x1a4)],'prompts':_0x52e42d[_0x2fc318(0x1a4)],'integrations':_0x568915[_0x2fc318(0x257)]},'sourceSite':_0x1f313f};}[a109_0x4c7d5f(0x19a)](_0x1e8f4f,_0x4dcaf4){const _0x47e0ac=a109_0x4c7d5f;if(!a109_0x59bb7c[_0x47e0ac(0x23b)](_0x1e8f4f))return _0x4dcaf4;return JSON[_0x47e0ac(0x26c)](a109_0x59bb7c[_0x47e0ac(0x170)](_0x1e8f4f,_0x47e0ac(0x239)));}[a109_0x4c7d5f(0x24c)](_0x34a2e6){const _0x39c415=a109_0x4c7d5f;if(!a109_0x59bb7c[_0x39c415(0x23b)](_0x34a2e6))throw new SDKError(ErrorCode[_0x39c415(0x21d)],_0x39c415(0x22c)+_0x34a2e6,undefined,{'helpText':_0x39c415(0x1c8)});const _0x1e0032=a109_0x461681[_0x39c415(0x19b)](_0x34a2e6,_0x39c415(0x1cc));if(!a109_0x59bb7c['existsSync'](_0x1e0032))throw new SDKError(ErrorCode[_0x39c415(0x210)],_0x39c415(0x1f0)+_0x34a2e6,undefined,{'helpText':_0x39c415(0x22a)});const _0x24e3a9=JSON[_0x39c415(0x26c)](a109_0x59bb7c['readFileSync'](_0x1e0032,_0x39c415(0x239)));if(!isSupportedBackupVersion(_0x24e3a9[_0x39c415(0x17b)]))throw new SDKError(ErrorCode[_0x39c415(0x210)],_0x39c415(0x20b)+_0x24e3a9[_0x39c415(0x17b)],undefined,{'helpText':'This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.'});return _0x24e3a9;}async['pullProject'](_0x39df10,_0x3c31d2,_0x5c864b){const _0x52e941=a109_0x4c7d5f,{projectId:_0x17aeb1,project:_0x117307}=await this[_0x52e941(0x1f7)](_0x39df10),_0x3990bc=_0x117307['attributes']['name'];let _0x13b3d8;if(_0x3c31d2)_0x13b3d8=_0x3c31d2;else{const _0x41659d=a109_0x461681[_0x52e941(0x19b)](process['cwd'](),_0x52e941(0x22d)),_0x4f64eb=getSanitizedPathWithMigration(_0x41659d,_0x3990bc);_0x4f64eb[_0x52e941(0x1c5)]&&this['logger'][_0x52e941(0x24b)](_0x52e941(0x1cf)+a109_0x461681[_0x52e941(0x226)](_0x4f64eb[_0x52e941(0x1c4)])+_0x52e941(0x1b1)+a109_0x461681['basename'](_0x4f64eb['path'])),_0x13b3d8=_0x4f64eb['path'];}const _0x42b793=await this[_0x52e941(0x220)][_0x52e941(0x1e5)](_0x17aeb1),_0x2fd65e=await this[_0x52e941(0x220)]['listKnowledgeBases'](_0x17aeb1),_0x5004d2=await this['client'][_0x52e941(0x204)](_0x17aeb1),_0x356ce2=await safeListOrEmpty(()=>this[_0x52e941(0x220)]['listImageGenerators'](_0x17aeb1)),_0x474d25=await safeListOrEmpty(()=>this[_0x52e941(0x220)][_0x52e941(0x180)](_0x17aeb1)),_0x541f56=await this['client'][_0x52e941(0x25d)](_0x17aeb1),_0xc58f9d=await this['client'][_0x52e941(0x192)](_0x17aeb1),_0x3c1b9f=await safeListOrEmpty(()=>this[_0x52e941(0x220)][_0x52e941(0x219)](_0x17aeb1)),_0x466948=await safeListOrEmpty(()=>this[_0x52e941(0x220)][_0x52e941(0x1d5)](_0x17aeb1)),_0x4419f9=_0xc58f9d[_0x52e941(0x264)](_0x42f519=>!_0x42f519[_0x52e941(0x225)][_0x52e941(0x16e)]&&SAFE_INTEGRATION_TYPES[_0x52e941(0x238)](_0x42f519[_0x52e941(0x225)]['serviceType'][_0x52e941(0x179)]())),_0x2fb817=new Map(),_0x2c4dd2=new Map(),_0x3fc11c=new Map(),_0x2e10e6=new Map(),_0x1df3a5=new Map(),_0x367750=new Map(),_0x367f22=new Map();for(const _0x474334 of _0x42b793){_0x2fb817[_0x52e941(0x1f9)](_0x474334['id'],_0x474334[_0x52e941(0x225)]['name']);}for(const _0x1cb140 of _0x2fd65e){_0x2c4dd2[_0x52e941(0x1f9)](_0x1cb140['id'],_0x1cb140[_0x52e941(0x225)][_0x52e941(0x260)]);}for(const _0x204622 of _0x5004d2){_0x3fc11c[_0x52e941(0x1f9)](_0x204622['id'],_0x204622[_0x52e941(0x225)][_0x52e941(0x260)]);}for(const _0x519497 of _0x356ce2){_0x2e10e6[_0x52e941(0x1f9)](_0x519497['id'],_0x519497['attributes']['name']);}for(const _0x428266 of _0x474d25){_0x1df3a5[_0x52e941(0x1f9)](_0x428266['id'],_0x428266[_0x52e941(0x225)]['name']);}for(const _0x23771b of _0x541f56){_0x367750['set'](_0x23771b['id'],_0x23771b[_0x52e941(0x225)][_0x52e941(0x260)]);}for(const _0x454f31 of _0x3c1b9f){_0x367f22[_0x52e941(0x1f9)](_0x454f31['id'],_0x454f31[_0x52e941(0x225)][_0x52e941(0x260)]);}const _0x27b85e={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2c4dd2,'TextKnowledgeBase':_0x3fc11c,'Agent':_0x2fb817,'WebSearchTool':_0x1df3a5,'ImageGenerator':_0x2e10e6,'ExperimentalKnowledgeBase':_0x367f22}),'resolvePromptName':async _0x5834df=>_0x367750[_0x52e941(0x26a)](_0x5834df),'onWarning':_0x382bcf=>this['logger']['warn'](_0x382bcf)},_0x155594={'projectName':_0x3990bc,'outputDir':_0x13b3d8,'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}}},_0x4e5532=[],_0x12adf=[];for(const _0x43af15 of _0x42b793){const _0x49eb35=getSanitizedPathWithMigration(_0x13b3d8,_0x43af15[_0x52e941(0x225)]['name']);_0x49eb35[_0x52e941(0x1c5)]&&this[_0x52e941(0x16f)][_0x52e941(0x24b)](_0x52e941(0x237)+a109_0x461681[_0x52e941(0x226)](_0x49eb35[_0x52e941(0x1c4)])+_0x52e941(0x1b1)+a109_0x461681['basename'](_0x49eb35[_0x52e941(0x1e1)]));const _0x4782a9=_0x49eb35[_0x52e941(0x1e1)],_0x14c5d4=a109_0x461681[_0x52e941(0x19b)](_0x4782a9,'prompt.md'),_0x1be811=a109_0x461681[_0x52e941(0x19b)](_0x4782a9,_0x52e941(0x163)),_0x13c580=a109_0x461681[_0x52e941(0x19b)](_0x4782a9,_0x52e941(0x1ae)),{yaml:_0x152cef,systemPrompt:_0x25714f,starterMessage:_0x446005}=await agentResponseToDef(_0x43af15,_0x27b85e),_0xb3ba8b=toAgentYamlString(_0x152cef),_0xef69cf=!a109_0x59bb7c[_0x52e941(0x23b)](_0x1be811);let _0x269921=_0xef69cf,_0x237cc9;if(!_0xef69cf){const _0xff6359=a109_0x59bb7c[_0x52e941(0x23b)](_0x14c5d4)?a109_0x59bb7c[_0x52e941(0x170)](_0x14c5d4,_0x52e941(0x239)):'',_0xc32de1=a109_0x59bb7c[_0x52e941(0x170)](_0x1be811,_0x52e941(0x239)),_0x5c716d=_0x52e941(0x16c)+_0xff6359+'\x0a\x0a#\x20agent.yml\x0a'+_0xc32de1,_0x2aaebb=_0x52e941(0x16c)+_0x25714f+_0x52e941(0x267)+_0xb3ba8b,_0x6bd3a7=generateDiff(_0x5c716d,_0x2aaebb);_0x269921=hasChanges(_0x6bd3a7),_0x269921&&(_0x237cc9=formatDiffWithColors(_0x6bd3a7));}_0x4e5532['push']({'path':_0x4782a9,'content':'','isDir':!![]}),_0x4e5532[_0x52e941(0x1ac)]({'path':_0x14c5d4,'content':_0x25714f}),_0x4e5532[_0x52e941(0x1ac)]({'path':_0x1be811,'content':_0xb3ba8b});_0x446005&&_0x446005[_0x52e941(0x238)]('\x0a')&&_0x4e5532[_0x52e941(0x1ac)]({'path':_0x13c580,'content':_0x446005});_0x155594[_0x52e941(0x22d)]['push']({'agentName':_0x43af15[_0x52e941(0x225)][_0x52e941(0x260)],'outputPath':_0x4782a9,'isNew':_0xef69cf,'hasChanges':_0x269921,'diff':_0x237cc9}),_0x155594[_0x52e941(0x230)][_0x52e941(0x22d)][_0x52e941(0x263)]++;if(_0xef69cf)_0x155594['counts'][_0x52e941(0x22d)][_0x52e941(0x1a5)]++;else{if(_0x269921)_0x155594[_0x52e941(0x230)]['agents'][_0x52e941(0x241)]++;else _0x155594[_0x52e941(0x230)][_0x52e941(0x22d)][_0x52e941(0x1c7)]++;}}for(const _0x18368e of _0x2fd65e){if(_0x18368e[_0x52e941(0x225)][_0x52e941(0x16e)])continue;const _0x1af2da=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x13b3d8),_0x18368e[_0x52e941(0x225)][_0x52e941(0x260)],'.yml');_0x1af2da['renamed']&&this['logger'][_0x52e941(0x24b)](_0x52e941(0x162)+a109_0x461681[_0x52e941(0x226)](_0x1af2da[_0x52e941(0x1c4)])+_0x52e941(0x1b1)+a109_0x461681[_0x52e941(0x226)](_0x1af2da['path']));const _0x1b9495=_0x1af2da['path'],_0x5972a1=apiKnowledgeBaseToYaml(_0x18368e),_0x51540a=toKnowledgeBaseYamlString(_0x5972a1),_0x2384ff=!a109_0x59bb7c[_0x52e941(0x23b)](_0x1b9495);let _0x350f7b=_0x2384ff,_0x17ee20;if(!_0x2384ff){const _0x34447c=a109_0x59bb7c[_0x52e941(0x170)](_0x1b9495,'utf-8'),_0x44f7f2=generateDiff(_0x34447c,_0x51540a);_0x350f7b=hasChanges(_0x44f7f2),_0x350f7b&&(_0x17ee20=formatDiffWithColors(_0x44f7f2));}_0x4e5532['push']({'path':_0x1b9495,'content':_0x51540a}),_0x155594['knowledgeBases'][_0x52e941(0x1ac)]({'name':_0x18368e['attributes']['name'],'outputPath':_0x1b9495,'isNew':_0x2384ff,'hasChanges':_0x350f7b,'diff':_0x17ee20}),_0x155594[_0x52e941(0x230)][_0x52e941(0x213)][_0x52e941(0x263)]++;if(_0x2384ff)_0x155594['counts'][_0x52e941(0x213)]['new']++;else{if(_0x350f7b)_0x155594[_0x52e941(0x230)]['knowledgeBases']['updated']++;else _0x155594[_0x52e941(0x230)][_0x52e941(0x213)][_0x52e941(0x1c7)]++;}}for(const _0x25aea7 of _0x5004d2){if(_0x25aea7[_0x52e941(0x225)][_0x52e941(0x16e)])continue;const _0x197a64=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x13b3d8),_0x25aea7[_0x52e941(0x225)][_0x52e941(0x260)],_0x52e941(0x205));_0x197a64[_0x52e941(0x1c5)]&&this[_0x52e941(0x16f)][_0x52e941(0x24b)](_0x52e941(0x1bf)+a109_0x461681[_0x52e941(0x226)](_0x197a64[_0x52e941(0x1c4)])+_0x52e941(0x1b1)+a109_0x461681[_0x52e941(0x226)](_0x197a64[_0x52e941(0x1e1)]));const _0x4e1011=_0x197a64[_0x52e941(0x1e1)],_0x236382=toTextKnowledgeBaseMd(_0x25aea7[_0x52e941(0x225)][_0x52e941(0x260)],_0x25aea7[_0x52e941(0x225)][_0x52e941(0x15f)]),_0x12ef04=!a109_0x59bb7c[_0x52e941(0x23b)](_0x4e1011);let _0x5f2e27=_0x12ef04,_0x13e241;if(!_0x12ef04){const _0x53de7c=a109_0x59bb7c[_0x52e941(0x170)](_0x4e1011,_0x52e941(0x239)),_0x315341=generateDiff(_0x53de7c,_0x236382);_0x5f2e27=hasChanges(_0x315341),_0x5f2e27&&(_0x13e241=formatDiffWithColors(_0x315341));}_0x4e5532[_0x52e941(0x1ac)]({'path':_0x4e1011,'content':_0x236382}),_0x155594[_0x52e941(0x182)][_0x52e941(0x1ac)]({'name':_0x25aea7[_0x52e941(0x225)][_0x52e941(0x260)],'outputPath':_0x4e1011,'isNew':_0x12ef04,'hasChanges':_0x5f2e27,'diff':_0x13e241}),_0x155594[_0x52e941(0x230)][_0x52e941(0x182)][_0x52e941(0x263)]++;if(_0x12ef04)_0x155594[_0x52e941(0x230)][_0x52e941(0x182)][_0x52e941(0x1a5)]++;else{if(_0x5f2e27)_0x155594['counts']['textKnowledgeBases']['updated']++;else _0x155594[_0x52e941(0x230)][_0x52e941(0x182)][_0x52e941(0x1c7)]++;}}for(const _0x420160 of _0x541f56){if(_0x420160['attributes']['isManaged'])continue;const _0x4bb9e2=getSanitizedPathWithMigration(getPromptsDir(_0x13b3d8),_0x420160['attributes'][_0x52e941(0x260)],_0x52e941(0x15d));_0x4bb9e2[_0x52e941(0x1c5)]&&this[_0x52e941(0x16f)][_0x52e941(0x24b)](_0x52e941(0x216)+a109_0x461681['basename'](_0x4bb9e2[_0x52e941(0x1c4)])+_0x52e941(0x1b1)+a109_0x461681['basename'](_0x4bb9e2['path']));const _0x79c73f=_0x4bb9e2['path'],_0x227e52=await apiPromptToYaml(_0x420160,_0x27b85e);if(!_0x227e52)continue;const _0x300249=toPromptYamlString(_0x227e52),_0x401a1f=!a109_0x59bb7c[_0x52e941(0x23b)](_0x79c73f);let _0x54e007=_0x401a1f,_0x201ab0;if(!_0x401a1f){const _0x3315e4=a109_0x59bb7c['readFileSync'](_0x79c73f,_0x52e941(0x239)),_0x3e16f1=generateDiff(_0x3315e4,_0x300249);_0x54e007=hasChanges(_0x3e16f1),_0x54e007&&(_0x201ab0=formatDiffWithColors(_0x3e16f1));}_0x4e5532[_0x52e941(0x1ac)]({'path':_0x79c73f,'content':_0x300249}),_0x155594[_0x52e941(0x15e)][_0x52e941(0x1ac)]({'name':_0x420160[_0x52e941(0x225)][_0x52e941(0x260)],'outputPath':_0x79c73f,'isNew':_0x401a1f,'hasChanges':_0x54e007,'diff':_0x201ab0}),_0x155594['counts'][_0x52e941(0x15e)][_0x52e941(0x263)]++;if(_0x401a1f)_0x155594[_0x52e941(0x230)][_0x52e941(0x15e)][_0x52e941(0x1a5)]++;else{if(_0x54e007)_0x155594[_0x52e941(0x230)][_0x52e941(0x15e)][_0x52e941(0x241)]++;else _0x155594[_0x52e941(0x230)][_0x52e941(0x15e)][_0x52e941(0x1c7)]++;}}for(const _0x39604c of _0x4419f9){const _0x432b7a=_0x39604c[_0x52e941(0x225)][_0x52e941(0x1dc)]['toLowerCase'](),_0x4aaf4c=getSanitizedPathWithMigration(getIntegrationsDir(_0x13b3d8),_0x432b7a,_0x52e941(0x15d));_0x4aaf4c[_0x52e941(0x1c5)]&&this[_0x52e941(0x16f)]['info'](_0x52e941(0x1af)+a109_0x461681['basename'](_0x4aaf4c['oldPath'])+_0x52e941(0x1b1)+a109_0x461681[_0x52e941(0x226)](_0x4aaf4c[_0x52e941(0x1e1)]));const _0x235214=_0x4aaf4c['path'],_0x1dae69=await apiIntegrationToYaml(_0x39604c,_0x27b85e),_0x297e7b=toIntegrationYamlString(_0x1dae69),_0x534f13=!a109_0x59bb7c[_0x52e941(0x23b)](_0x235214);let _0x18ef75=_0x534f13,_0x548478;if(!_0x534f13){const _0x1ca3f1=a109_0x59bb7c[_0x52e941(0x170)](_0x235214,_0x52e941(0x239)),_0x17af07=generateDiff(_0x1ca3f1,_0x297e7b);_0x18ef75=hasChanges(_0x17af07),_0x18ef75&&(_0x548478=formatDiffWithColors(_0x17af07));}_0x4e5532[_0x52e941(0x1ac)]({'path':_0x235214,'content':_0x297e7b}),_0x155594[_0x52e941(0x187)][_0x52e941(0x1ac)]({'name':_0x432b7a,'outputPath':_0x235214,'isNew':_0x534f13,'hasChanges':_0x18ef75,'diff':_0x548478}),_0x155594[_0x52e941(0x230)]['integrations']['total']++;if(_0x534f13)_0x155594[_0x52e941(0x230)][_0x52e941(0x187)]['new']++;else{if(_0x18ef75)_0x155594[_0x52e941(0x230)][_0x52e941(0x187)]['updated']++;else _0x155594[_0x52e941(0x230)]['integrations']['unchanged']++;}}for(const _0x49c11a of _0x3c1b9f){if(_0x49c11a[_0x52e941(0x225)][_0x52e941(0x16e)])continue;const _0x4338c0=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x13b3d8),_0x49c11a[_0x52e941(0x225)][_0x52e941(0x260)]);_0x4338c0[_0x52e941(0x1c5)]&&this['logger'][_0x52e941(0x24b)](_0x52e941(0x176)+a109_0x461681[_0x52e941(0x226)](_0x4338c0['oldPath'])+_0x52e941(0x1b1)+a109_0x461681[_0x52e941(0x226)](_0x4338c0['path']));const _0x343401=_0x4338c0[_0x52e941(0x1e1)],_0x2bd002=a109_0x461681[_0x52e941(0x19b)](_0x343401,sanitizeForFilesystem(_0x49c11a[_0x52e941(0x225)][_0x52e941(0x260)])+_0x52e941(0x15d)),_0x44ff01=a109_0x461681[_0x52e941(0x19b)](_0x343401,'functions'),_0x46d7cd=apiExperimentalKnowledgeBaseToYaml(_0x49c11a),_0x87b93b=toExperimentalKnowledgeBaseYamlString(_0x46d7cd),_0x52eefe=!a109_0x59bb7c[_0x52e941(0x23b)](_0x343401);let _0x52d0cd=_0x52eefe,_0x281424,_0x3bac16=_0x87b93b;const _0x42eecb=[..._0x46d7cd[_0x52e941(0x1b3)]][_0x52e941(0x184)]((_0x78205d,_0x2a0a8f)=>_0x78205d['name']['localeCompare'](_0x2a0a8f[_0x52e941(0x260)]));for(const _0x2407e0 of _0x42eecb){_0x3bac16+='\x0a---\x20function:\x20'+_0x2407e0['name']+_0x52e941(0x1a3)+_0x2407e0['code']+'\x0a---\x20schema:\x20'+_0x2407e0[_0x52e941(0x260)]+_0x52e941(0x1a3)+_0x2407e0[_0x52e941(0x26b)]+'\x0a';}if(!_0x52eefe){let _0x493c32='';a109_0x59bb7c[_0x52e941(0x23b)](_0x2bd002)&&(_0x493c32=a109_0x59bb7c[_0x52e941(0x170)](_0x2bd002,_0x52e941(0x239)));if(a109_0x59bb7c[_0x52e941(0x23b)](_0x44ff01)){const _0x42a5f8=a109_0x59bb7c[_0x52e941(0x1a2)](_0x44ff01,{'withFileTypes':!![]}),_0x315775=_0x42a5f8[_0x52e941(0x264)](_0x284e48=>_0x284e48[_0x52e941(0x252)]())['sort']((_0x18595e,_0x17a3df)=>_0x18595e[_0x52e941(0x260)][_0x52e941(0x195)](_0x17a3df['name']));for(const _0x33595c of _0x315775){const _0x2929b8=a109_0x461681[_0x52e941(0x19b)](_0x44ff01,_0x33595c[_0x52e941(0x260)],_0x52e941(0x185)),_0x25bd39=a109_0x461681[_0x52e941(0x19b)](_0x44ff01,_0x33595c['name'],_0x52e941(0x16d));a109_0x59bb7c[_0x52e941(0x23b)](_0x2929b8)&&(_0x493c32+='\x0a---\x20function:\x20'+_0x33595c[_0x52e941(0x260)]+_0x52e941(0x1a3)+a109_0x59bb7c[_0x52e941(0x170)](_0x2929b8,_0x52e941(0x239))+'\x0a'),a109_0x59bb7c[_0x52e941(0x23b)](_0x25bd39)&&(_0x493c32+=_0x52e941(0x21b)+_0x33595c[_0x52e941(0x260)]+_0x52e941(0x1a3)+a109_0x59bb7c[_0x52e941(0x170)](_0x25bd39,_0x52e941(0x239))+'\x0a');}}const _0x33c0da=generateDiff(_0x493c32,_0x3bac16);_0x52d0cd=hasChanges(_0x33c0da),_0x52d0cd&&(_0x281424=formatDiffWithColors(_0x33c0da));}_0x4e5532[_0x52e941(0x1ac)]({'path':_0x343401,'content':'','isDir':!![]}),_0x4e5532[_0x52e941(0x1ac)]({'path':_0x2bd002,'content':_0x87b93b}),_0x4e5532['push']({'path':_0x44ff01,'content':'','isDir':!![]});for(const _0x2c594b of _0x46d7cd[_0x52e941(0x1b3)]){const _0x47ea5f=a109_0x461681[_0x52e941(0x19b)](_0x44ff01,sanitizeForFilesystem(_0x2c594b[_0x52e941(0x260)])),_0x3046ad=a109_0x461681['join'](_0x47ea5f,_0x52e941(0x185)),_0x9b9d24=a109_0x461681['join'](_0x47ea5f,_0x52e941(0x16d));_0x4e5532[_0x52e941(0x1ac)]({'path':_0x47ea5f,'content':'','isDir':!![]}),_0x4e5532[_0x52e941(0x1ac)]({'path':_0x3046ad,'content':_0x2c594b[_0x52e941(0x1f5)]}),_0x4e5532[_0x52e941(0x1ac)]({'path':_0x9b9d24,'content':_0x2c594b[_0x52e941(0x26b)]});}if(a109_0x59bb7c['existsSync'](_0x44ff01)){const _0x1de1eb=a109_0x59bb7c[_0x52e941(0x1a2)](_0x44ff01,{'withFileTypes':!![]}),_0x55accc=new Set(_0x46d7cd['functions'][_0x52e941(0x183)](_0x588096=>sanitizeForFilesystem(_0x588096[_0x52e941(0x260)])));for(const _0x10bd5c of _0x1de1eb){if(_0x10bd5c[_0x52e941(0x252)]()&&!_0x55accc[_0x52e941(0x17e)](_0x10bd5c[_0x52e941(0x260)])){const _0x5b6d55=a109_0x461681[_0x52e941(0x19b)](_0x44ff01,_0x10bd5c[_0x52e941(0x260)]);_0x12adf['push']({'path':_0x5b6d55,'isDir':!![]});}}}_0x155594[_0x52e941(0x1f8)][_0x52e941(0x1ac)]({'name':_0x49c11a[_0x52e941(0x225)]['name'],'outputPath':_0x343401,'isNew':_0x52eefe,'hasChanges':_0x52d0cd,'diff':_0x281424}),_0x155594[_0x52e941(0x230)]['experimentalKnowledgeBases']['total']++;if(_0x52eefe)_0x155594[_0x52e941(0x230)][_0x52e941(0x1f8)]['new']++;else{if(_0x52d0cd)_0x155594[_0x52e941(0x230)][_0x52e941(0x1f8)][_0x52e941(0x241)]++;else _0x155594[_0x52e941(0x230)][_0x52e941(0x1f8)]['unchanged']++;}}for(const _0x510585 of _0x466948){if(_0x510585[_0x52e941(0x225)][_0x52e941(0x16e)])continue;const _0x59bd52=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x13b3d8),_0x510585['attributes'][_0x52e941(0x260)]);_0x59bd52[_0x52e941(0x1c5)]&&this[_0x52e941(0x16f)][_0x52e941(0x24b)]('Renamed\x20experimental\x20artifact\x20directory:\x20'+a109_0x461681['basename'](_0x59bd52[_0x52e941(0x1c4)])+_0x52e941(0x1b1)+a109_0x461681['basename'](_0x59bd52[_0x52e941(0x1e1)]));const _0x14912c=_0x59bd52[_0x52e941(0x1e1)],_0x4edf01=a109_0x461681[_0x52e941(0x19b)](_0x14912c,sanitizeForFilesystem(_0x510585[_0x52e941(0x225)][_0x52e941(0x260)])+_0x52e941(0x15d)),_0x106bac=a109_0x461681[_0x52e941(0x19b)](_0x14912c,_0x52e941(0x185)),_0xb69c4f=a109_0x461681['join'](_0x14912c,_0x52e941(0x1e2)),_0x496c61=apiExperimentalArtifactToYaml(_0x510585),_0x13dcdb=toExperimentalArtifactYamlString(_0x496c61),_0x1e715d=!a109_0x59bb7c[_0x52e941(0x23b)](_0x14912c);let _0x9b0158=_0x1e715d,_0x269047,_0xf7ef3a=_0x13dcdb+(_0x52e941(0x18c)+_0x496c61[_0x52e941(0x1f5)]+'\x0a');const _0x2092fe=[..._0x496c61[_0x52e941(0x1e2)]][_0x52e941(0x184)]((_0x5e78e1,_0x17dd2a)=>_0x5e78e1['file_name'][_0x52e941(0x195)](_0x17dd2a['file_name']));for(const _0x2bd824 of _0x2092fe){_0xf7ef3a+='---\x20file:\x20'+_0x2bd824[_0x52e941(0x18e)]+_0x52e941(0x1a3)+_0x2bd824[_0x52e941(0x160)]+'\x0a';}if(!_0x1e715d){let _0x36ba1f='';a109_0x59bb7c[_0x52e941(0x23b)](_0x4edf01)&&(_0x36ba1f=a109_0x59bb7c[_0x52e941(0x170)](_0x4edf01,_0x52e941(0x239)));a109_0x59bb7c[_0x52e941(0x23b)](_0x106bac)&&(_0x36ba1f+=_0x52e941(0x18c)+a109_0x59bb7c[_0x52e941(0x170)](_0x106bac,'utf-8')+'\x0a');if(a109_0x59bb7c['existsSync'](_0xb69c4f)){const _0x5769d6=a109_0x59bb7c[_0x52e941(0x1a2)](_0xb69c4f),_0x1856a8=_0x5769d6['filter'](_0x514f1c=>{const _0x552e76=_0x52e941,_0x381c90=a109_0x461681[_0x552e76(0x19b)](_0xb69c4f,_0x514f1c);return a109_0x59bb7c['statSync'](_0x381c90)['isFile']();})[_0x52e941(0x184)]((_0x4bfc36,_0x5965c8)=>_0x4bfc36[_0x52e941(0x195)](_0x5965c8));for(const _0x2ddc6c of _0x1856a8){const _0x5aa55b=a109_0x461681[_0x52e941(0x19b)](_0xb69c4f,_0x2ddc6c);_0x36ba1f+='---\x20file:\x20'+_0x2ddc6c+_0x52e941(0x1a3)+a109_0x59bb7c['readFileSync'](_0x5aa55b,_0x52e941(0x239))+'\x0a';}}const _0x58dabd=generateDiff(_0x36ba1f,_0xf7ef3a);_0x9b0158=hasChanges(_0x58dabd),_0x9b0158&&(_0x269047=formatDiffWithColors(_0x58dabd));}_0x4e5532[_0x52e941(0x1ac)]({'path':_0x14912c,'content':'','isDir':!![]}),_0x4e5532['push']({'path':_0x4edf01,'content':_0x13dcdb}),_0x4e5532[_0x52e941(0x1ac)]({'path':_0x106bac,'content':_0x496c61['code']});if(_0x496c61[_0x52e941(0x1e2)]['length']>0x0){_0x4e5532[_0x52e941(0x1ac)]({'path':_0xb69c4f,'content':'','isDir':!![]});for(const _0xd989f3 of _0x496c61[_0x52e941(0x1e2)]){const _0x601c01=a109_0x461681['join'](_0xb69c4f,_0xd989f3['file_name']);_0x4e5532[_0x52e941(0x1ac)]({'path':_0x601c01,'content':_0xd989f3['text_content']});}}if(a109_0x59bb7c[_0x52e941(0x23b)](_0xb69c4f)){const _0x38fa4f=a109_0x59bb7c['readdirSync'](_0xb69c4f),_0x1dca6f=new Set(_0x496c61[_0x52e941(0x1e2)]['map'](_0x173125=>_0x173125['file_name']));for(const _0xeaeb4c of _0x38fa4f){const _0x48d269=a109_0x461681[_0x52e941(0x19b)](_0xb69c4f,_0xeaeb4c);a109_0x59bb7c[_0x52e941(0x1b4)](_0x48d269)[_0x52e941(0x17d)]()&&!_0x1dca6f[_0x52e941(0x17e)](_0xeaeb4c)&&_0x12adf['push']({'path':_0x48d269});}}_0x155594[_0x52e941(0x229)][_0x52e941(0x1ac)]({'name':_0x510585[_0x52e941(0x225)][_0x52e941(0x260)],'outputPath':_0x14912c,'isNew':_0x1e715d,'hasChanges':_0x9b0158,'diff':_0x269047}),_0x155594['counts']['experimentalArtifacts']['total']++;if(_0x1e715d)_0x155594[_0x52e941(0x230)][_0x52e941(0x229)]['new']++;else{if(_0x9b0158)_0x155594[_0x52e941(0x230)][_0x52e941(0x229)][_0x52e941(0x241)]++;else _0x155594[_0x52e941(0x230)][_0x52e941(0x229)][_0x52e941(0x1c7)]++;}}if(_0x5c864b?.['dryRun'])return _0x155594;a109_0x59bb7c['mkdirSync'](_0x13b3d8,{'recursive':!![]}),a109_0x59bb7c[_0x52e941(0x18d)](getKnowledgeBasesDir(_0x13b3d8),{'recursive':!![]}),a109_0x59bb7c[_0x52e941(0x18d)](getPromptsDir(_0x13b3d8),{'recursive':!![]}),a109_0x59bb7c[_0x52e941(0x18d)](getIntegrationsDir(_0x13b3d8),{'recursive':!![]}),a109_0x59bb7c[_0x52e941(0x18d)](getExperimentalKnowledgeBasesDir(_0x13b3d8),{'recursive':!![]}),a109_0x59bb7c['mkdirSync'](getExperimentalArtifactsDir(_0x13b3d8),{'recursive':!![]});const _0x2d7653=a109_0x461681[_0x52e941(0x19b)](_0x13b3d8,_0x52e941(0x265));a109_0x59bb7c[_0x52e941(0x21a)](_0x2d7653,createAgentConfigContent(_0x3990bc));for(const _0x1b9e15 of _0x4e5532){if(_0x1b9e15[_0x52e941(0x268)])a109_0x59bb7c['mkdirSync'](_0x1b9e15['path'],{'recursive':!![]});else{const _0x2b7b71=a109_0x461681[_0x52e941(0x233)](_0x1b9e15[_0x52e941(0x1e1)]);!a109_0x59bb7c[_0x52e941(0x23b)](_0x2b7b71)&&a109_0x59bb7c[_0x52e941(0x18d)](_0x2b7b71,{'recursive':!![]}),a109_0x59bb7c[_0x52e941(0x21a)](_0x1b9e15[_0x52e941(0x1e1)],_0x1b9e15['content']);}}for(const _0x2f5542 of _0x12adf){_0x2f5542[_0x52e941(0x268)]?(a109_0x59bb7c[_0x52e941(0x24f)](_0x2f5542['path'],{'recursive':!![],'force':!![]}),this['logger'][_0x52e941(0x24b)](_0x52e941(0x17c)+a109_0x461681[_0x52e941(0x226)](a109_0x461681[_0x52e941(0x233)](_0x2f5542[_0x52e941(0x1e1)]))+'/'+a109_0x461681[_0x52e941(0x226)](_0x2f5542[_0x52e941(0x1e1)]))):(a109_0x59bb7c[_0x52e941(0x24f)](_0x2f5542[_0x52e941(0x1e1)],{'force':!![]}),this[_0x52e941(0x16f)][_0x52e941(0x24b)](_0x52e941(0x221)+a109_0x461681[_0x52e941(0x226)](a109_0x461681[_0x52e941(0x233)](_0x2f5542[_0x52e941(0x1e1)]))+'/'+a109_0x461681['basename'](_0x2f5542[_0x52e941(0x1e1)])));}return _0x155594;}async['pushProject'](_0x596695,_0x8915cf){const _0x36425d=a109_0x4c7d5f,_0x224b2f=a109_0x461681[_0x36425d(0x19b)](_0x596695,_0x36425d(0x265));if(!a109_0x59bb7c[_0x36425d(0x23b)](_0x224b2f))throw new SDKError(ErrorCode[_0x36425d(0x210)],'No\x20tdx.json\x20found\x20in\x20'+_0x596695,undefined,{'helpText':_0x36425d(0x253)});const _0x54cc5c=loadAgentConfig(_0x224b2f),_0x5322cf=await this[_0x36425d(0x1d9)](_0x54cc5c[_0x36425d(0x203)]),_0x3de32a=await this['client'][_0x36425d(0x23f)](_0x5322cf),_0x33b07d=_0x3de32a[_0x36425d(0x225)]['name'],_0x522dac={'projectName':_0x33b07d,'projectId':_0x5322cf,'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}}},_0x1aa2b3=[],_0xd904e5=[],_0x18323b=[],_0x5fe089=[],_0x4c02bd=[],_0x3f0065=[],_0x35bc1c=a109_0x59bb7c[_0x36425d(0x1a2)](_0x596695,{'withFileTypes':!![]});for(const _0x464587 of _0x35bc1c){if(!_0x464587[_0x36425d(0x252)]())continue;if([_0x36425d(0x17f),_0x36425d(0x15e),_0x36425d(0x187),_0x36425d(0x159),'experimental_artifacts'][_0x36425d(0x238)](_0x464587[_0x36425d(0x260)]))continue;const _0x15090c=a109_0x461681[_0x36425d(0x19b)](_0x596695,_0x464587[_0x36425d(0x260)]);if(isAgentDir(_0x15090c)){const _0x3e2ff5=a109_0x461681[_0x36425d(0x19b)](_0x15090c,_0x36425d(0x163)),_0x2e5627=a109_0x461681['join'](_0x15090c,_0x36425d(0x1d1)),_0x51d997=a109_0x461681[_0x36425d(0x19b)](_0x15090c,'starter_message.md'),_0x1adaf4=parseAgentYaml(a109_0x59bb7c[_0x36425d(0x170)](_0x3e2ff5,_0x36425d(0x239)),_0x3e2ff5),_0x234db4=a109_0x59bb7c[_0x36425d(0x23b)](_0x2e5627)?a109_0x59bb7c['readFileSync'](_0x2e5627,_0x36425d(0x239)):'',_0x37aa37=a109_0x59bb7c['existsSync'](_0x51d997)?a109_0x59bb7c[_0x36425d(0x170)](_0x51d997,_0x36425d(0x239)):_0x1adaf4[_0x36425d(0x259)];_0x1aa2b3['push']({'name':_0x1adaf4['name'],'dir':_0x15090c,'yaml':_0x1adaf4,'systemPrompt':_0x234db4,'starterMessage':_0x37aa37});}}const _0x31b793=getKnowledgeBasesDir(_0x596695);if(a109_0x59bb7c[_0x36425d(0x23b)](_0x31b793)){const _0x22f3d8=a109_0x59bb7c[_0x36425d(0x1a2)](_0x31b793);for(const _0x4d26cf of _0x22f3d8){const _0x46bdd9=a109_0x461681[_0x36425d(0x19b)](_0x31b793,_0x4d26cf);if(_0x4d26cf[_0x36425d(0x16b)](_0x36425d(0x15d))){const _0x3d775c=parseKnowledgeBaseYaml(a109_0x59bb7c[_0x36425d(0x170)](_0x46bdd9,_0x36425d(0x239)),_0x46bdd9);_0xd904e5[_0x36425d(0x1ac)]({'name':_0x3d775c['name'],'path':_0x46bdd9,'yaml':_0x3d775c});}else{if(_0x4d26cf[_0x36425d(0x16b)](_0x36425d(0x205))){const _0x76d773=a109_0x59bb7c['readFileSync'](_0x46bdd9,'utf-8'),{name:_0x3caf16,text:_0x25cd21}=parseTextKnowledgeBaseMd(_0x76d773,_0x4d26cf);_0x18323b[_0x36425d(0x1ac)]({'name':_0x3caf16,'path':_0x46bdd9,'text':_0x25cd21});}}}}const _0x17749e=getPromptsDir(_0x596695);if(a109_0x59bb7c[_0x36425d(0x23b)](_0x17749e)){const _0x3af8f8=a109_0x59bb7c['readdirSync'](_0x17749e)[_0x36425d(0x264)](_0x463125=>_0x463125['endsWith'](_0x36425d(0x15d)));for(const _0x41429a of _0x3af8f8){const _0x181d72=a109_0x461681[_0x36425d(0x19b)](_0x17749e,_0x41429a),_0x5dcb64=parsePromptYaml(a109_0x59bb7c[_0x36425d(0x170)](_0x181d72,'utf-8'),_0x181d72);_0x5fe089[_0x36425d(0x1ac)]({'name':_0x5dcb64[_0x36425d(0x260)],'path':_0x181d72,'yaml':_0x5dcb64});}}const _0x2b21e6=[],_0x4838ba=getIntegrationsDir(_0x596695);if(a109_0x59bb7c['existsSync'](_0x4838ba)){const _0x1ca038=a109_0x59bb7c[_0x36425d(0x1a2)](_0x4838ba)['filter'](_0x34ef83=>_0x34ef83['endsWith'](_0x36425d(0x15d)));for(const _0x2c95bd of _0x1ca038){const _0x120102=a109_0x461681[_0x36425d(0x19b)](_0x4838ba,_0x2c95bd),_0x5884b8=parseIntegrationYaml(a109_0x59bb7c[_0x36425d(0x170)](_0x120102,_0x36425d(0x239)),_0x120102);if(!SAFE_INTEGRATION_TYPES['includes'](_0x5884b8[_0x36425d(0x1d8)][_0x36425d(0x179)]())){this['logger'][_0x36425d(0x258)]('Skipping\x20integration\x20\x27'+_0x5884b8[_0x36425d(0x260)]+_0x36425d(0x1e4)+_0x5884b8[_0x36425d(0x1d8)]+_0x36425d(0x1ff)+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES[_0x36425d(0x19b)](',\x20')+')\x20can\x20be\x20pushed.\x20')+_0x36425d(0x254));continue;}_0x2b21e6['push']({'name':_0x5884b8[_0x36425d(0x260)],'path':_0x120102,'yaml':_0x5884b8});}}const _0x1fdc22=getExperimentalKnowledgeBasesDir(_0x596695);if(a109_0x59bb7c['existsSync'](_0x1fdc22)){const _0x4b3c3e=a109_0x59bb7c[_0x36425d(0x1a2)](_0x1fdc22,{'withFileTypes':!![]});for(const _0x1cf6d7 of _0x4b3c3e){if(!_0x1cf6d7[_0x36425d(0x252)]())continue;const _0x130bca=a109_0x461681[_0x36425d(0x19b)](_0x1fdc22,_0x1cf6d7[_0x36425d(0x260)]),_0x36d7b3=a109_0x461681[_0x36425d(0x19b)](_0x130bca,_0x1cf6d7[_0x36425d(0x260)]+_0x36425d(0x15d)),_0x81a8e3=a109_0x461681[_0x36425d(0x19b)](_0x130bca,_0x36425d(0x1b3));if(!a109_0x59bb7c[_0x36425d(0x23b)](_0x36d7b3))continue;const _0x4cb358=parseExperimentalKnowledgeBaseYaml(a109_0x59bb7c['readFileSync'](_0x36d7b3,_0x36425d(0x239)),_0x36d7b3),_0x2ec575=[];if(a109_0x59bb7c['existsSync'](_0x81a8e3)){const _0x44c5e3=a109_0x59bb7c[_0x36425d(0x1a2)](_0x81a8e3,{'withFileTypes':!![]});for(const _0x3429a4 of _0x44c5e3){if(!_0x3429a4[_0x36425d(0x252)]())continue;const _0x6fa393=a109_0x461681['join'](_0x81a8e3,_0x3429a4['name']),_0x222b99=a109_0x461681[_0x36425d(0x19b)](_0x6fa393,_0x36425d(0x185)),_0x24da4b=a109_0x461681[_0x36425d(0x19b)](_0x6fa393,_0x36425d(0x16d));a109_0x59bb7c['existsSync'](_0x222b99)&&a109_0x59bb7c[_0x36425d(0x23b)](_0x24da4b)&&_0x2ec575[_0x36425d(0x1ac)]({'name':_0x3429a4[_0x36425d(0x260)],'code':a109_0x59bb7c[_0x36425d(0x170)](_0x222b99,_0x36425d(0x239)),'json_schema':a109_0x59bb7c[_0x36425d(0x170)](_0x24da4b,_0x36425d(0x239))});}}const _0x5d8fbc={..._0x4cb358,'variables':_0x4cb358[_0x36425d(0x207)]||[],'functions':_0x2ec575};_0x4c02bd[_0x36425d(0x1ac)]({'name':_0x4cb358[_0x36425d(0x260)],'dir':_0x130bca,'def':_0x5d8fbc});}}const _0x2647d6=getExperimentalArtifactsDir(_0x596695);if(a109_0x59bb7c['existsSync'](_0x2647d6)){const _0x367238=a109_0x59bb7c[_0x36425d(0x1a2)](_0x2647d6,{'withFileTypes':!![]});for(const _0x3af63b of _0x367238){if(!_0x3af63b[_0x36425d(0x252)]())continue;const _0x581620=a109_0x461681['join'](_0x2647d6,_0x3af63b[_0x36425d(0x260)]),_0x12e937=a109_0x461681['join'](_0x581620,_0x3af63b[_0x36425d(0x260)]+_0x36425d(0x15d)),_0x15ceb5=a109_0x461681[_0x36425d(0x19b)](_0x581620,_0x36425d(0x185)),_0x5f0d22=a109_0x461681[_0x36425d(0x19b)](_0x581620,_0x36425d(0x1e2));if(!a109_0x59bb7c[_0x36425d(0x23b)](_0x12e937)||!a109_0x59bb7c[_0x36425d(0x23b)](_0x15ceb5))continue;const _0x560ad2=parseExperimentalArtifactYaml(a109_0x59bb7c['readFileSync'](_0x12e937,_0x36425d(0x239)),_0x12e937),_0x2ada4b=a109_0x59bb7c[_0x36425d(0x170)](_0x15ceb5,_0x36425d(0x239)),_0xc146d1=[];if(a109_0x59bb7c['existsSync'](_0x5f0d22)){const _0x708fd0=a109_0x59bb7c[_0x36425d(0x1a2)](_0x5f0d22);for(const _0x15ab90 of _0x708fd0){const _0x42fd73=a109_0x461681['join'](_0x5f0d22,_0x15ab90);a109_0x59bb7c['statSync'](_0x42fd73)[_0x36425d(0x17d)]()&&_0xc146d1[_0x36425d(0x1ac)]({'file_name':_0x15ab90,'text_content':a109_0x59bb7c[_0x36425d(0x170)](_0x42fd73,_0x36425d(0x239))});}}const _0x99d03c={..._0x560ad2,'code':_0x2ada4b,'files':_0xc146d1};_0x3f0065[_0x36425d(0x1ac)]({'name':_0x560ad2['name'],'dir':_0x581620,'def':_0x99d03c});}}const _0x4b3123=await this[_0x36425d(0x220)][_0x36425d(0x1e5)](_0x5322cf),_0xfd0139=await this['client'][_0x36425d(0x17a)](_0x5322cf),_0x329654=await this[_0x36425d(0x220)][_0x36425d(0x204)](_0x5322cf),_0x56bcb0=await this['client'][_0x36425d(0x25d)](_0x5322cf),_0x1b973f=await this[_0x36425d(0x220)]['listIntegrations'](_0x5322cf),_0x3cb9bd=await safeListOrEmpty(()=>this[_0x36425d(0x220)][_0x36425d(0x219)](_0x5322cf)),_0x2d2c2e=await safeListOrEmpty(()=>this['client'][_0x36425d(0x1d5)](_0x5322cf)),_0x40b70c=await fetchAllToolTargetMaps((_0x48eeda,_0x52e4e4)=>this['client'][_0x36425d(0x164)](_0x48eeda,_0x52e4e4),_0x5322cf),_0x291edc=new Map(),_0x4d67b0=new Map(),_0x16de56=new Map(),_0x1268ad=new Map(),_0x32b426=new Map(),_0x5bf15d=new Map(),_0x5a3064=new Map();for(const _0x485c9e of _0x4b3123){_0x291edc[_0x36425d(0x1f9)](_0x485c9e['attributes'][_0x36425d(0x260)],_0x485c9e);}for(const _0x5b74ae of _0xfd0139){_0x4d67b0[_0x36425d(0x1f9)](_0x5b74ae['attributes']['name'],_0x5b74ae);}for(const _0x2bf463 of _0x329654){_0x16de56[_0x36425d(0x1f9)](_0x2bf463[_0x36425d(0x225)][_0x36425d(0x260)],_0x2bf463);}for(const _0x4f0fba of _0x56bcb0){_0x1268ad['set'](_0x4f0fba[_0x36425d(0x225)][_0x36425d(0x260)],_0x4f0fba);}for(const _0x58de68 of _0x1b973f){_0x32b426[_0x36425d(0x1f9)](_0x58de68[_0x36425d(0x225)]['serviceType'][_0x36425d(0x179)](),_0x58de68);}for(const _0x4f8b11 of _0x3cb9bd){_0x5bf15d['set'](_0x4f8b11['attributes'][_0x36425d(0x260)],_0x4f8b11);}for(const _0x263459 of _0x2d2c2e){_0x5a3064[_0x36425d(0x1f9)](_0x263459[_0x36425d(0x225)][_0x36425d(0x260)],_0x263459);}const _0x13d6fd=new Map(),_0x33b5f8=new Map();for(const _0x3bf2b8 of _0x4b3123){_0x13d6fd[_0x36425d(0x1f9)](_0x3bf2b8[_0x36425d(0x225)][_0x36425d(0x260)],_0x3bf2b8['id']),_0x33b5f8[_0x36425d(0x1f9)](_0x3bf2b8['id'],_0x3bf2b8[_0x36425d(0x225)]['name']);}const _0x52b512=new Map(),_0x1528de=new Map();for(const _0x1aecf4 of _0x56bcb0){_0x52b512[_0x36425d(0x1f9)](_0x1aecf4[_0x36425d(0x225)][_0x36425d(0x260)],_0x1aecf4['id']),_0x1528de[_0x36425d(0x1f9)](_0x1aecf4['id'],_0x1aecf4['attributes'][_0x36425d(0x260)]);}const _0x5c3b32=_0x40b70c[_0x36425d(0x198)]['KnowledgeBase']||new Map(),_0x4c3654=_0x40b70c[_0x36425d(0x198)][_0x36425d(0x25c)]||new Map(),_0x1909e5=_0x40b70c['nameToId'][_0x36425d(0x214)]||new Map(),_0xdf769f=new Map(),_0x382394={'resolveToolTargetName':buildNameResolver({..._0x40b70c['idToName'],'Agent':_0x33b5f8}),'resolvePromptName':async _0x13d507=>_0x1528de[_0x36425d(0x26a)](_0x13d507),'onWarning':_0x378fa8=>this[_0x36425d(0x16f)][_0x36425d(0x258)](_0x378fa8)};let _0x46851d=[];const _0x3156d9={'projectId':_0x5322cf,'resolveToolTargetId':buildIdResolver({..._0x40b70c[_0x36425d(0x198)],'Agent':_0x13d6fd}),'resolvePromptId':async _0x54328c=>_0x52b512[_0x36425d(0x26a)](_0x54328c),'onWarning':_0x1febb1=>{const _0x361998=_0x36425d;this[_0x361998(0x16f)][_0x361998(0x258)](_0x1febb1),_0x46851d['push'](_0x1febb1);}},{resolved:_0x43e031,unresolved:_0x1c894a}=resolveAgentDependencies(_0x1aa2b3,new Set(_0x291edc[_0x36425d(0x1d4)]()));for(const {agent:_0x49f699,missingDeps:_0x89b904}of _0x1c894a){_0x522dac['agents'][_0x36425d(0x1ac)]({'agentName':_0x49f699[_0x36425d(0x1be)][_0x36425d(0x260)],'action':'error','error':_0x36425d(0x1f1)+_0x89b904[_0x36425d(0x19b)](',\x20')+_0x36425d(0x1c9)}),_0x522dac['counts'][_0x36425d(0x22d)]['errors']++;}for(const _0x5c3d1d of _0xd904e5){const _0x483599=_0x4d67b0[_0x36425d(0x26a)](_0x5c3d1d[_0x36425d(0x1be)][_0x36425d(0x260)]),_0x2edfe7=a109_0x59bb7c['readFileSync'](_0x5c3d1d['path'],'utf-8');if(_0x483599){const _0x365bbc=apiKnowledgeBaseToYaml(_0x483599),_0xe2cb3c=toKnowledgeBaseYamlString(_0x365bbc),_0x51b1ac=generateDiff(_0xe2cb3c,_0x2edfe7),_0x56196b=hasChanges(_0x51b1ac);_0x56196b?(_0x522dac[_0x36425d(0x213)]['push']({'name':_0x5c3d1d[_0x36425d(0x1be)][_0x36425d(0x260)],'action':'updated','id':_0x483599['id'],'diff':formatDiffWithColors(_0x51b1ac)}),_0x522dac['counts']['knowledgeBases'][_0x36425d(0x241)]++):(_0x522dac[_0x36425d(0x213)][_0x36425d(0x1ac)]({'name':_0x5c3d1d['yaml']['name'],'action':_0x36425d(0x1c7),'id':_0x483599['id']}),_0x522dac['counts']['knowledgeBases'][_0x36425d(0x1c7)]++);}else _0x522dac['knowledgeBases'][_0x36425d(0x1ac)]({'name':_0x5c3d1d[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x178)}),_0x522dac[_0x36425d(0x230)]['knowledgeBases'][_0x36425d(0x178)]++;}for(const _0x3cb698 of _0x18323b){const _0x1ee09f=_0x16de56[_0x36425d(0x26a)](_0x3cb698['name']),_0x411963=a109_0x59bb7c[_0x36425d(0x170)](_0x3cb698['path'],_0x36425d(0x239));if(_0x1ee09f){const _0x43f053=toTextKnowledgeBaseMd(_0x1ee09f[_0x36425d(0x225)][_0x36425d(0x260)],_0x1ee09f[_0x36425d(0x225)]['text']),_0x1acd14=generateDiff(_0x43f053,_0x411963),_0x42ee5a=hasChanges(_0x1acd14);_0x42ee5a?(_0x522dac[_0x36425d(0x182)][_0x36425d(0x1ac)]({'name':_0x3cb698['name'],'action':_0x36425d(0x241),'id':_0x1ee09f['id'],'diff':formatDiffWithColors(_0x1acd14)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x182)][_0x36425d(0x241)]++):(_0x522dac[_0x36425d(0x182)][_0x36425d(0x1ac)]({'name':_0x3cb698[_0x36425d(0x260)],'action':_0x36425d(0x1c7),'id':_0x1ee09f['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x182)]['unchanged']++);}else _0x522dac['textKnowledgeBases'][_0x36425d(0x1ac)]({'name':_0x3cb698[_0x36425d(0x260)],'action':_0x36425d(0x178)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x182)][_0x36425d(0x178)]++;}for(const _0x5b39ec of _0x43e031){const _0x510377=_0x291edc[_0x36425d(0x26a)](_0x5b39ec[_0x36425d(0x1be)]['name']),_0x687360=a109_0x461681[_0x36425d(0x19b)](_0x5b39ec[_0x36425d(0x1ed)],_0x36425d(0x163)),_0x4ff92d=a109_0x59bb7c[_0x36425d(0x170)](_0x687360,_0x36425d(0x239)),_0x1eeeee=_0x5b39ec[_0x36425d(0x24e)],_0x7362b='#\x20prompt.md\x0a'+_0x1eeeee+_0x36425d(0x267)+_0x4ff92d;if(_0x510377){const {yaml:_0x316da8,systemPrompt:_0x311b99}=await agentResponseToDef(_0x510377,_0x382394),_0x5f3ef7=toAgentYamlString(_0x316da8),_0x4e00fc='#\x20prompt.md\x0a'+_0x311b99+'\x0a\x0a#\x20agent.yml\x0a'+_0x5f3ef7,_0x4bff51=generateDiff(_0x4e00fc,_0x7362b),_0x2fc80f=hasChanges(_0x4bff51);_0x2fc80f?(_0x522dac[_0x36425d(0x22d)][_0x36425d(0x1ac)]({'agentName':_0x5b39ec['yaml'][_0x36425d(0x260)],'action':_0x36425d(0x241),'agentId':_0x510377['id'],'diff':formatDiffWithColors(_0x4bff51)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x22d)]['updated']++):(_0x522dac['agents'][_0x36425d(0x1ac)]({'agentName':_0x5b39ec['yaml']['name'],'action':_0x36425d(0x1c7),'agentId':_0x510377['id']}),_0x522dac[_0x36425d(0x230)]['agents'][_0x36425d(0x1c7)]++);}else _0x522dac[_0x36425d(0x22d)]['push']({'agentName':_0x5b39ec[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x178)}),_0x522dac['counts'][_0x36425d(0x22d)][_0x36425d(0x178)]++;}for(const _0x5beb5c of _0x5fe089){const _0x4a9543=_0x1268ad[_0x36425d(0x26a)](_0x5beb5c[_0x36425d(0x1be)][_0x36425d(0x260)]),_0x2b0e9b=a109_0x59bb7c['readFileSync'](_0x5beb5c[_0x36425d(0x1e1)],_0x36425d(0x239));if(_0x4a9543){const _0x360aaa=await apiPromptToYaml(_0x4a9543,_0x382394);if(!_0x360aaa){_0x522dac[_0x36425d(0x15e)][_0x36425d(0x1ac)]({'name':_0x5beb5c[_0x36425d(0x1be)]['name'],'action':_0x36425d(0x241),'id':_0x4a9543['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x15e)]['updated']++;continue;}const _0x1059c2=toPromptYamlString(_0x360aaa),_0x4e2016=generateDiff(_0x1059c2,_0x2b0e9b),_0x17bb91=hasChanges(_0x4e2016);_0x17bb91?(_0x522dac[_0x36425d(0x15e)][_0x36425d(0x1ac)]({'name':_0x5beb5c[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x241),'id':_0x4a9543['id'],'diff':formatDiffWithColors(_0x4e2016)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x15e)][_0x36425d(0x241)]++):(_0x522dac['prompts'][_0x36425d(0x1ac)]({'name':_0x5beb5c[_0x36425d(0x1be)]['name'],'action':'unchanged','id':_0x4a9543['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x15e)][_0x36425d(0x1c7)]++);}else _0x522dac[_0x36425d(0x15e)][_0x36425d(0x1ac)]({'name':_0x5beb5c[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x178)}),_0x522dac['counts'][_0x36425d(0x15e)]['created']++;}for(const _0x9fff2a of _0x2b21e6){const _0x3fca44=_0x32b426[_0x36425d(0x26a)](_0x9fff2a[_0x36425d(0x1be)][_0x36425d(0x1d8)]),_0x5436a0=a109_0x59bb7c['readFileSync'](_0x9fff2a[_0x36425d(0x1e1)],'utf-8');if(_0x3fca44){const _0x222ace=await apiIntegrationToYaml(_0x3fca44,_0x382394),_0x5e3e66=toIntegrationYamlString(_0x222ace),_0x233199=generateDiff(_0x5e3e66,_0x5436a0),_0x4d72f3=hasChanges(_0x233199);_0x4d72f3?(_0x522dac['integrations'][_0x36425d(0x1ac)]({'name':_0x9fff2a['yaml'][_0x36425d(0x1d8)],'action':'updated','id':_0x3fca44['id'],'diff':formatDiffWithColors(_0x233199)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x187)]['updated']++):(_0x522dac[_0x36425d(0x187)][_0x36425d(0x1ac)]({'name':_0x9fff2a[_0x36425d(0x1be)]['service_type'],'action':'unchanged','id':_0x3fca44['id']}),_0x522dac[_0x36425d(0x230)]['integrations'][_0x36425d(0x1c7)]++);}else _0x522dac[_0x36425d(0x187)][_0x36425d(0x1ac)]({'name':_0x9fff2a['yaml'][_0x36425d(0x1d8)],'action':_0x36425d(0x178)}),_0x522dac[_0x36425d(0x230)]['integrations'][_0x36425d(0x178)]++;}for(const _0x4ee8c0 of _0x4c02bd){const _0x3ce769=_0x5bf15d[_0x36425d(0x26a)](_0x4ee8c0[_0x36425d(0x189)][_0x36425d(0x260)]),_0x2d6d96=toExperimentalKnowledgeBaseYamlString(_0x4ee8c0[_0x36425d(0x189)]);let _0x21e9c3=_0x2d6d96;for(const _0x173658 of _0x4ee8c0[_0x36425d(0x189)][_0x36425d(0x1b3)]){_0x21e9c3+=_0x36425d(0x251)+_0x173658[_0x36425d(0x260)]+_0x36425d(0x1a3)+_0x173658['code']+_0x36425d(0x201)+_0x173658[_0x36425d(0x260)]+_0x36425d(0x1a3)+_0x173658[_0x36425d(0x26b)]+'\x0a';}if(_0x3ce769){const _0x2c008a=apiExperimentalKnowledgeBaseToYaml(_0x3ce769),_0x40512d=toExperimentalKnowledgeBaseYamlString(_0x2c008a);let _0x15035f=_0x40512d;for(const _0x2ded13 of _0x2c008a['functions']){_0x15035f+=_0x36425d(0x251)+_0x2ded13[_0x36425d(0x260)]+_0x36425d(0x1a3)+_0x2ded13[_0x36425d(0x1f5)]+_0x36425d(0x201)+_0x2ded13['name']+_0x36425d(0x1a3)+_0x2ded13[_0x36425d(0x26b)]+'\x0a';}const _0x589d61=generateDiff(_0x15035f,_0x21e9c3),_0x3519f8=hasChanges(_0x589d61);_0x3519f8?(_0x522dac[_0x36425d(0x1f8)]['push']({'name':_0x4ee8c0['def'][_0x36425d(0x260)],'action':_0x36425d(0x241),'id':_0x3ce769['id'],'diff':formatDiffWithColors(_0x589d61)}),_0x522dac['counts'][_0x36425d(0x1f8)][_0x36425d(0x241)]++):(_0x522dac['experimentalKnowledgeBases'][_0x36425d(0x1ac)]({'name':_0x4ee8c0[_0x36425d(0x189)][_0x36425d(0x260)],'action':'unchanged','id':_0x3ce769['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x1f8)]['unchanged']++);}else _0x522dac[_0x36425d(0x1f8)][_0x36425d(0x1ac)]({'name':_0x4ee8c0[_0x36425d(0x189)][_0x36425d(0x260)],'action':_0x36425d(0x178)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x1f8)][_0x36425d(0x178)]++;}for(const _0x44ae8 of _0x3f0065){const _0x4fe938=_0x5a3064[_0x36425d(0x26a)](_0x44ae8['def'][_0x36425d(0x260)]),_0x18220d=toExperimentalArtifactYamlString(_0x44ae8[_0x36425d(0x189)]);let _0x2da586=_0x18220d+(_0x36425d(0x18c)+_0x44ae8[_0x36425d(0x189)][_0x36425d(0x1f5)]+'\x0a');for(const _0x4193f2 of _0x44ae8[_0x36425d(0x189)][_0x36425d(0x1e2)]){_0x2da586+=_0x36425d(0x168)+_0x4193f2['file_name']+_0x36425d(0x1a3)+_0x4193f2[_0x36425d(0x160)]+'\x0a';}if(_0x4fe938){const _0x429bc8=apiExperimentalArtifactToYaml(_0x4fe938),_0x3abfb5=toExperimentalArtifactYamlString(_0x429bc8);let _0x5e27b7=_0x3abfb5+(_0x36425d(0x18c)+_0x429bc8[_0x36425d(0x1f5)]+'\x0a');for(const _0x101155 of _0x429bc8[_0x36425d(0x1e2)]){_0x5e27b7+=_0x36425d(0x168)+_0x101155['file_name']+'\x20---\x0a'+_0x101155[_0x36425d(0x160)]+'\x0a';}const _0x5734b8=generateDiff(_0x5e27b7,_0x2da586),_0x134f02=hasChanges(_0x5734b8);_0x134f02?(_0x522dac[_0x36425d(0x229)][_0x36425d(0x1ac)]({'name':_0x44ae8['def'][_0x36425d(0x260)],'action':_0x36425d(0x241),'id':_0x4fe938['id'],'diff':formatDiffWithColors(_0x5734b8)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x229)][_0x36425d(0x241)]++):(_0x522dac['experimentalArtifacts'][_0x36425d(0x1ac)]({'name':_0x44ae8[_0x36425d(0x189)][_0x36425d(0x260)],'action':'unchanged','id':_0x4fe938['id']}),_0x522dac['counts']['experimentalArtifacts'][_0x36425d(0x1c7)]++);}else _0x522dac[_0x36425d(0x229)][_0x36425d(0x1ac)]({'name':_0x44ae8['def'][_0x36425d(0x260)],'action':_0x36425d(0x178)}),_0x522dac['counts'][_0x36425d(0x229)]['created']++;}if(_0x8915cf?.[_0x36425d(0x202)])return _0x522dac;_0x522dac[_0x36425d(0x213)]=[],_0x522dac[_0x36425d(0x182)]=[],_0x522dac[_0x36425d(0x15e)]=[],_0x522dac[_0x36425d(0x187)]=[],_0x522dac[_0x36425d(0x1f8)]=[],_0x522dac[_0x36425d(0x229)]=[];const _0x99cfa0=_0x522dac[_0x36425d(0x22d)][_0x36425d(0x264)](_0x1d7989=>_0x1d7989[_0x36425d(0x1d3)]===_0x36425d(0x171));_0x522dac[_0x36425d(0x22d)]=_0x99cfa0,_0x522dac[_0x36425d(0x230)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x99cfa0[_0x36425d(0x257)]},'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 _0x441ec1 of _0xd904e5){try{const _0x1ae732=_0x4d67b0[_0x36425d(0x26a)](_0x441ec1[_0x36425d(0x1be)]['name']),_0x2024b8=yamlKnowledgeBaseToApi(_0x441ec1[_0x36425d(0x1be)],_0x5322cf);if(_0x1ae732)await this['client']['updateKnowledgeBase'](_0x1ae732['id'],_0x2024b8),_0x5c3b32['set'](_0x441ec1['yaml'][_0x36425d(0x260)],_0x1ae732['id']),_0x522dac[_0x36425d(0x213)][_0x36425d(0x1ac)]({'name':_0x441ec1[_0x36425d(0x1be)][_0x36425d(0x260)],'action':'updated','id':_0x1ae732['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x213)][_0x36425d(0x241)]++;else{const _0x434f96=await this['client']['createKnowledgeBase'](_0x2024b8);_0x5c3b32[_0x36425d(0x1f9)](_0x441ec1[_0x36425d(0x1be)]['name'],_0x434f96['id']),_0x522dac[_0x36425d(0x213)][_0x36425d(0x1ac)]({'name':_0x441ec1[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x178),'id':_0x434f96['id']}),_0x522dac['counts'][_0x36425d(0x213)][_0x36425d(0x178)]++;}}catch(_0x2faa0d){_0x522dac['knowledgeBases'][_0x36425d(0x1ac)]({'name':_0x441ec1['yaml']['name'],'action':_0x36425d(0x171),'error':_0x2faa0d[_0x36425d(0x200)]}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x213)][_0x36425d(0x261)]++;}}for(const _0x3e9712 of _0x18323b){try{const _0x38277c=_0x16de56[_0x36425d(0x26a)](_0x3e9712[_0x36425d(0x260)]),_0x45c61d=yamlTextKnowledgeBaseToApi({'name':_0x3e9712[_0x36425d(0x260)],'text':_0x3e9712['text']},_0x5322cf);if(_0x38277c)await this['client'][_0x36425d(0x1d6)](_0x38277c['id'],_0x45c61d),_0x4c3654[_0x36425d(0x1f9)](_0x3e9712[_0x36425d(0x260)],_0x38277c['id']),_0x522dac[_0x36425d(0x182)]['push']({'name':_0x3e9712[_0x36425d(0x260)],'action':_0x36425d(0x241),'id':_0x38277c['id']}),_0x522dac['counts'][_0x36425d(0x182)][_0x36425d(0x241)]++;else{const _0x1a8fc2=await this[_0x36425d(0x220)][_0x36425d(0x255)](_0x45c61d);_0x4c3654['set'](_0x3e9712[_0x36425d(0x260)],_0x1a8fc2['id']),_0x522dac[_0x36425d(0x182)][_0x36425d(0x1ac)]({'name':_0x3e9712[_0x36425d(0x260)],'action':_0x36425d(0x178),'id':_0x1a8fc2['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x182)]['created']++;}}catch(_0x27b701){_0x522dac['textKnowledgeBases'][_0x36425d(0x1ac)]({'name':_0x3e9712[_0x36425d(0x260)],'action':_0x36425d(0x171),'error':_0x27b701[_0x36425d(0x200)]}),_0x522dac[_0x36425d(0x230)]['textKnowledgeBases'][_0x36425d(0x261)]++;}}for(const _0x335993 of _0x4c02bd){try{const _0x58dc51=_0x5bf15d[_0x36425d(0x26a)](_0x335993['def']['name']),_0x4349f1=yamlExperimentalKnowledgeBaseToApi(_0x335993['def'],_0x5322cf);if(_0x58dc51)await this[_0x36425d(0x220)][_0x36425d(0x21e)](_0x58dc51['id'],_0x4349f1),_0x1909e5[_0x36425d(0x1f9)](_0x335993[_0x36425d(0x189)][_0x36425d(0x260)],_0x58dc51['id']),_0x522dac[_0x36425d(0x1f8)]['push']({'name':_0x335993[_0x36425d(0x189)]['name'],'action':'updated','id':_0x58dc51['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x1f8)]['updated']++;else{const _0x83abf=await this['client'][_0x36425d(0x240)](_0x4349f1);_0x1909e5[_0x36425d(0x1f9)](_0x335993[_0x36425d(0x189)]['name'],_0x83abf['id']),_0x522dac[_0x36425d(0x1f8)][_0x36425d(0x1ac)]({'name':_0x335993[_0x36425d(0x189)]['name'],'action':_0x36425d(0x178),'id':_0x83abf['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x1f8)][_0x36425d(0x178)]++;}}catch(_0x3958c4){_0x522dac[_0x36425d(0x1f8)][_0x36425d(0x1ac)]({'name':_0x335993[_0x36425d(0x189)][_0x36425d(0x260)],'action':'error','error':_0x3958c4[_0x36425d(0x200)]}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x1f8)][_0x36425d(0x261)]++;}}for(const _0x5a636a of _0x3f0065){try{const _0x135329=_0x5a3064[_0x36425d(0x26a)](_0x5a636a[_0x36425d(0x189)]['name']),_0x57547d=yamlExperimentalArtifactToApi(_0x5a636a[_0x36425d(0x189)],_0x5322cf);if(_0x135329)await this[_0x36425d(0x220)][_0x36425d(0x1b9)](_0x135329['id'],_0x57547d),_0xdf769f['set'](_0x5a636a['def'][_0x36425d(0x260)],_0x135329['id']),_0x522dac[_0x36425d(0x229)]['push']({'name':_0x5a636a[_0x36425d(0x189)][_0x36425d(0x260)],'action':_0x36425d(0x241),'id':_0x135329['id']}),_0x522dac[_0x36425d(0x230)]['experimentalArtifacts'][_0x36425d(0x241)]++;else{const _0x464150=await this[_0x36425d(0x220)][_0x36425d(0x1ef)](_0x57547d);_0xdf769f['set'](_0x5a636a[_0x36425d(0x189)][_0x36425d(0x260)],_0x464150['id']),_0x522dac[_0x36425d(0x229)][_0x36425d(0x1ac)]({'name':_0x5a636a['def'][_0x36425d(0x260)],'action':_0x36425d(0x178),'id':_0x464150['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x229)]['created']++;}}catch(_0x248e39){_0x522dac[_0x36425d(0x229)][_0x36425d(0x1ac)]({'name':_0x5a636a[_0x36425d(0x189)][_0x36425d(0x260)],'action':_0x36425d(0x171),'error':_0x248e39['message']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x229)][_0x36425d(0x261)]++;}}for(const _0xda11ee of _0x43e031){_0x46851d=[];try{const _0x5a36ea=_0x291edc[_0x36425d(0x26a)](_0xda11ee['yaml'][_0x36425d(0x260)]),_0x131424=await agentDefToRequest(_0xda11ee[_0x36425d(0x1be)],_0xda11ee[_0x36425d(0x24e)],_0xda11ee['starterMessage'],_0x3156d9);if(_0x5a36ea)await this['client'][_0x36425d(0x1e0)](_0x5a36ea['id'],_0x131424),_0x13d6fd[_0x36425d(0x1f9)](_0xda11ee[_0x36425d(0x1be)]['name'],_0x5a36ea['id']),_0x522dac['agents'][_0x36425d(0x1ac)]({'agentName':_0xda11ee[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x241),'agentId':_0x5a36ea['id'],'warnings':_0x46851d[_0x36425d(0x257)]>0x0?_0x46851d:undefined}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x22d)][_0x36425d(0x241)]++;else{const _0x3db356=await this[_0x36425d(0x220)][_0x36425d(0x21f)](_0x131424);_0x13d6fd[_0x36425d(0x1f9)](_0xda11ee['yaml'][_0x36425d(0x260)],_0x3db356['id']),_0x522dac[_0x36425d(0x22d)][_0x36425d(0x1ac)]({'agentName':_0xda11ee[_0x36425d(0x1be)]['name'],'action':'created','agentId':_0x3db356['id'],'warnings':_0x46851d[_0x36425d(0x257)]>0x0?_0x46851d:undefined}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x22d)][_0x36425d(0x178)]++;}}catch(_0x5f4e05){_0x522dac[_0x36425d(0x22d)][_0x36425d(0x1ac)]({'agentName':_0xda11ee[_0x36425d(0x1be)]['name'],'action':_0x36425d(0x171),'error':_0x5f4e05[_0x36425d(0x200)],'warnings':_0x46851d[_0x36425d(0x257)]>0x0?_0x46851d:undefined}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x22d)][_0x36425d(0x261)]++;}}for(const _0x39fac4 of _0x5fe089){try{const _0x19e669=_0x1268ad[_0x36425d(0x26a)](_0x39fac4[_0x36425d(0x1be)]['name']),_0x31b3f=await yamlPromptToApi(_0x39fac4[_0x36425d(0x1be)],_0x5322cf,_0x3156d9);if(!_0x31b3f){_0x522dac[_0x36425d(0x15e)][_0x36425d(0x1ac)]({'name':_0x39fac4[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x171),'error':_0x36425d(0x270)}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x15e)][_0x36425d(0x261)]++;continue;}if(_0x19e669)await this[_0x36425d(0x220)][_0x36425d(0x25a)](_0x19e669['id'],_0x31b3f),_0x52b512[_0x36425d(0x1f9)](_0x39fac4[_0x36425d(0x1be)]['name'],_0x19e669['id']),_0x522dac[_0x36425d(0x15e)][_0x36425d(0x1ac)]({'name':_0x39fac4[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x241),'id':_0x19e669['id']}),_0x522dac['counts'][_0x36425d(0x15e)][_0x36425d(0x241)]++;else{const _0x25576b=await this['client'][_0x36425d(0x266)](_0x31b3f);_0x52b512['set'](_0x39fac4[_0x36425d(0x1be)][_0x36425d(0x260)],_0x25576b['id']),_0x522dac['prompts']['push']({'name':_0x39fac4['yaml'][_0x36425d(0x260)],'action':_0x36425d(0x178),'id':_0x25576b['id']}),_0x522dac[_0x36425d(0x230)]['prompts']['created']++;}}catch(_0x28a6ee){_0x522dac[_0x36425d(0x15e)]['push']({'name':_0x39fac4[_0x36425d(0x1be)][_0x36425d(0x260)],'action':_0x36425d(0x171),'error':_0x28a6ee[_0x36425d(0x200)]}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x15e)][_0x36425d(0x261)]++;}}for(const _0x28db1c of _0x2b21e6){try{const _0x41def=_0x32b426[_0x36425d(0x26a)](_0x28db1c[_0x36425d(0x1be)][_0x36425d(0x1d8)]),_0x4df528=await yamlIntegrationToApi(_0x28db1c['yaml'],_0x5322cf,_0x3156d9);if(_0x41def){await this[_0x36425d(0x220)][_0x36425d(0x1c2)](_0x41def['id']);const _0x5ed94a=await this[_0x36425d(0x220)]['createIntegration'](_0x4df528);_0x522dac[_0x36425d(0x187)][_0x36425d(0x1ac)]({'name':_0x28db1c[_0x36425d(0x1be)]['service_type'],'action':_0x36425d(0x241),'id':_0x5ed94a['id']}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x187)][_0x36425d(0x241)]++;}else{const _0x29b3f5=await this[_0x36425d(0x220)][_0x36425d(0x1e7)](_0x4df528);_0x522dac['integrations']['push']({'name':_0x28db1c[_0x36425d(0x1be)][_0x36425d(0x1d8)],'action':_0x36425d(0x178),'id':_0x29b3f5['id']}),_0x522dac[_0x36425d(0x230)]['integrations']['created']++;}}catch(_0x3c1eba){_0x522dac[_0x36425d(0x187)][_0x36425d(0x1ac)]({'name':_0x28db1c['yaml'][_0x36425d(0x1d8)],'action':_0x36425d(0x171),'error':_0x3c1eba[_0x36425d(0x200)]}),_0x522dac[_0x36425d(0x230)][_0x36425d(0x187)]['errors']++;}}return _0x522dac;}async[a109_0x4c7d5f(0x1de)](_0x4cefb8,_0x59ab2f,_0x1518d5,_0x482944){const _0x1702dd=a109_0x4c7d5f,{projectId:_0xbce7a6,project:_0xa6a27c}=await this[_0x1702dd(0x1f7)](_0x4cefb8),_0x2b09bd=_0xa6a27c[_0x1702dd(0x225)][_0x1702dd(0x260)],_0xe4545=await this[_0x1702dd(0x220)][_0x1702dd(0x1e5)](_0xbce7a6),_0x421493=_0xe4545[_0x1702dd(0x22f)](_0xb31774=>_0xb31774[_0x1702dd(0x225)][_0x1702dd(0x260)]===_0x59ab2f);if(!_0x421493)throw new SDKError(ErrorCode['AGENT_NOT_FOUND'],_0x1702dd(0x169)+_0x59ab2f,undefined,{'helpText':_0x1702dd(0x1cd)+_0xe4545[_0x1702dd(0x183)](_0x1d0f21=>_0x1d0f21[_0x1702dd(0x225)][_0x1702dd(0x260)])['join'](',\x20')});let _0x4dfa89;if(_0x1518d5)_0x4dfa89=_0x1518d5;else{const _0x584ad5=a109_0x461681[_0x1702dd(0x19b)](process[_0x1702dd(0x23e)](),_0x1702dd(0x22d)),_0x397259=getSanitizedPathWithMigration(_0x584ad5,_0x2b09bd);_0x397259['renamed']&&this[_0x1702dd(0x16f)][_0x1702dd(0x24b)]('Renamed\x20folder:\x20'+a109_0x461681['basename'](_0x397259[_0x1702dd(0x1c4)])+'\x20→\x20'+a109_0x461681[_0x1702dd(0x226)](_0x397259[_0x1702dd(0x1e1)])),_0x4dfa89=_0x397259[_0x1702dd(0x1e1)];}const _0x2e3320=getSanitizedPathWithMigration(_0x4dfa89,_0x59ab2f);_0x2e3320[_0x1702dd(0x1c5)]&&this['logger']['info'](_0x1702dd(0x237)+a109_0x461681[_0x1702dd(0x226)](_0x2e3320[_0x1702dd(0x1c4)])+'\x20→\x20'+a109_0x461681[_0x1702dd(0x226)](_0x2e3320[_0x1702dd(0x1e1)]));const _0x25aff0=_0x2e3320[_0x1702dd(0x1e1)],_0x212398=new Map(),_0x32a587=new Map(),_0x3dd532=await this[_0x1702dd(0x220)][_0x1702dd(0x17a)](_0xbce7a6),_0x333801=await this[_0x1702dd(0x220)]['listTextKnowledgeBases'](_0xbce7a6),_0x3c2580=await safeListOrEmpty(()=>this[_0x1702dd(0x220)][_0x1702dd(0x219)](_0xbce7a6)),_0x312ab8=new Map(),_0x23bbe4=new Map();for(const _0x5301dc of _0x3dd532){_0x212398[_0x1702dd(0x1f9)](_0x5301dc['id'],_0x5301dc[_0x1702dd(0x225)][_0x1702dd(0x260)]);}for(const _0x2a3df6 of _0x333801){_0x312ab8[_0x1702dd(0x1f9)](_0x2a3df6['id'],_0x2a3df6[_0x1702dd(0x225)]['name']);}for(const _0x2ee457 of _0x3c2580){_0x23bbe4[_0x1702dd(0x1f9)](_0x2ee457['id'],_0x2ee457[_0x1702dd(0x225)][_0x1702dd(0x260)]);}for(const _0x25c4f9 of _0xe4545){_0x32a587[_0x1702dd(0x1f9)](_0x25c4f9['id'],_0x25c4f9[_0x1702dd(0x225)]['name']);}const _0x2b1429={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x212398,'TextKnowledgeBase':_0x312ab8,'Agent':_0x32a587,'ExperimentalKnowledgeBase':_0x23bbe4}),'resolvePromptName':async()=>undefined,'onWarning':_0x298d2a=>this[_0x1702dd(0x16f)]['warn'](_0x298d2a)},_0x686562=a109_0x461681[_0x1702dd(0x19b)](_0x25aff0,_0x1702dd(0x1d1)),_0x4835f5=a109_0x461681[_0x1702dd(0x19b)](_0x25aff0,_0x1702dd(0x163)),_0x3341ad=a109_0x461681[_0x1702dd(0x19b)](_0x25aff0,_0x1702dd(0x1ae)),_0x232c33=!a109_0x59bb7c[_0x1702dd(0x23b)](_0x4835f5);if(_0x482944?.[_0x1702dd(0x202)])return{'agentName':_0x59ab2f,'outputPath':_0x25aff0,'isNew':_0x232c33,'hasChanges':!![]};a109_0x59bb7c[_0x1702dd(0x18d)](_0x4dfa89,{'recursive':!![]}),a109_0x59bb7c[_0x1702dd(0x18d)](_0x25aff0,{'recursive':!![]});const _0x339a54=a109_0x461681[_0x1702dd(0x19b)](_0x4dfa89,_0x1702dd(0x265));!a109_0x59bb7c[_0x1702dd(0x23b)](_0x339a54)&&a109_0x59bb7c[_0x1702dd(0x21a)](_0x339a54,createAgentConfigContent(_0x4cefb8));const {yaml:_0x71021,systemPrompt:_0x481093,starterMessage:_0x1c86a8}=await agentResponseToDef(_0x421493,_0x2b1429);let _0x2f9878=_0x232c33;if(!_0x232c33){const _0xc38da4=a109_0x59bb7c['existsSync'](_0x686562)?a109_0x59bb7c[_0x1702dd(0x170)](_0x686562,'utf-8'):'',_0x53dd20=a109_0x59bb7c[_0x1702dd(0x170)](_0x4835f5,_0x1702dd(0x239));_0x2f9878=_0xc38da4!==_0x481093||_0x53dd20!==toAgentYamlString(_0x71021);}a109_0x59bb7c[_0x1702dd(0x21a)](_0x686562,_0x481093),a109_0x59bb7c[_0x1702dd(0x21a)](_0x4835f5,toAgentYamlString(_0x71021));if(_0x1c86a8&&_0x1c86a8[_0x1702dd(0x238)]('\x0a'))a109_0x59bb7c[_0x1702dd(0x21a)](_0x3341ad,_0x1c86a8);else a109_0x59bb7c[_0x1702dd(0x23b)](_0x3341ad)&&a109_0x59bb7c[_0x1702dd(0x223)](_0x3341ad);return{'agentName':_0x59ab2f,'outputPath':_0x25aff0,'isNew':_0x232c33,'hasChanges':_0x2f9878};}async[a109_0x4c7d5f(0x1a9)](_0x1571cf,_0x3eb057){const _0x564758=a109_0x4c7d5f;let _0x464c81;isAgentYamlPath(_0x1571cf)?_0x464c81=getAgentDirFromYamlPath(_0x1571cf):_0x464c81=_0x1571cf;const {config:_0x542613}=findAgentConfig(_0x464c81),_0x3985c6=await this['resolveProjectId'](_0x542613[_0x564758(0x203)]),_0x2cd058=a109_0x461681[_0x564758(0x19b)](_0x464c81,_0x564758(0x163)),_0x52d44f=a109_0x461681[_0x564758(0x19b)](_0x464c81,'prompt.md'),_0x40c24d=a109_0x461681[_0x564758(0x19b)](_0x464c81,'starter_message.md');if(!a109_0x59bb7c[_0x564758(0x23b)](_0x2cd058))throw new SDKError(ErrorCode[_0x564758(0x21d)],_0x564758(0x167)+_0x464c81,undefined,{'helpText':_0x564758(0x1e3)});const _0x116220=parseAgentYaml(a109_0x59bb7c[_0x564758(0x170)](_0x2cd058,_0x564758(0x239)),_0x2cd058),_0x12d3b5=a109_0x59bb7c[_0x564758(0x23b)](_0x52d44f)?a109_0x59bb7c[_0x564758(0x170)](_0x52d44f,_0x564758(0x239)):'',_0x5496df=a109_0x59bb7c[_0x564758(0x23b)](_0x40c24d)?a109_0x59bb7c[_0x564758(0x170)](_0x40c24d,_0x564758(0x239)):_0x116220[_0x564758(0x259)];if(_0x3eb057?.['dryRun'])return{'agentName':_0x116220['name'],'action':'created','projectId':_0x3985c6};const _0x13f04f=await this[_0x564758(0x220)][_0x564758(0x1e5)](_0x3985c6),_0x2ec628=await fetchAllToolTargetMaps((_0x505618,_0x48302d)=>this[_0x564758(0x220)][_0x564758(0x164)](_0x505618,_0x48302d),_0x3985c6),_0x5e2b94=new Map();for(const _0xd05656 of _0x13f04f){_0x5e2b94[_0x564758(0x1f9)](_0xd05656[_0x564758(0x225)][_0x564758(0x260)],_0xd05656['id']);}const _0x2181c9=[],_0x28a406={'projectId':_0x3985c6,'resolveToolTargetId':buildIdResolver({..._0x2ec628[_0x564758(0x198)],'Agent':_0x5e2b94}),'resolvePromptId':async()=>undefined,'onWarning':_0x7c706c=>{this['logger']['warn'](_0x7c706c),_0x2181c9['push'](_0x7c706c);}};try{const _0xeaf213=_0x13f04f[_0x564758(0x22f)](_0x2cc633=>_0x2cc633[_0x564758(0x225)][_0x564758(0x260)]===_0x116220[_0x564758(0x260)]),_0x3d114b=await agentDefToRequest(_0x116220,_0x12d3b5,_0x5496df,_0x28a406);if(_0xeaf213)return await this['client'][_0x564758(0x1e0)](_0xeaf213['id'],_0x3d114b),{'agentName':_0x116220[_0x564758(0x260)],'action':_0x564758(0x241),'projectId':_0x3985c6,'agentId':_0xeaf213['id'],'warnings':_0x2181c9[_0x564758(0x257)]>0x0?_0x2181c9:undefined};else{const _0x1f6ad4=await this[_0x564758(0x220)][_0x564758(0x21f)](_0x3d114b);return{'agentName':_0x116220[_0x564758(0x260)],'action':_0x564758(0x178),'projectId':_0x3985c6,'agentId':_0x1f6ad4['id'],'warnings':_0x2181c9[_0x564758(0x257)]>0x0?_0x2181c9:undefined};}}catch(_0x3d9f19){return{'agentName':_0x116220[_0x564758(0x260)],'action':_0x564758(0x171),'projectId':_0x3985c6,'error':_0x3d9f19[_0x564758(0x200)],'warnings':_0x2181c9['length']>0x0?_0x2181c9:undefined};}}async[a109_0x4c7d5f(0x1d0)](_0x36e9c3,_0x1c0133,_0x34cb9f){const _0x58d94b=a109_0x4c7d5f,_0x12d865=a109_0x59bb7c[_0x58d94b(0x23b)](_0x36e9c3)&&a109_0x59bb7c[_0x58d94b(0x23b)](a109_0x461681[_0x58d94b(0x19b)](_0x36e9c3,_0x58d94b(0x265)));let _0x344162;const _0x592521=[],_0x2da208=[],_0x27b51c=[],_0x3133ae=[],_0x5a18c7=[],_0x1b1c3b=[],_0x319d7e=[];if(_0x12d865){const _0x1633da=loadAgentConfig(a109_0x461681['join'](_0x36e9c3,_0x58d94b(0x265)));_0x344162=_0x1633da[_0x58d94b(0x203)];const _0x266236=a109_0x59bb7c['readdirSync'](_0x36e9c3,{'withFileTypes':!![]});for(const _0x508a16 of _0x266236){if(!_0x508a16[_0x58d94b(0x252)]())continue;if([_0x58d94b(0x17f),_0x58d94b(0x159),'experimental_artifacts','prompts',_0x58d94b(0x187)][_0x58d94b(0x238)](_0x508a16['name']))continue;const _0x332f7f=a109_0x461681[_0x58d94b(0x19b)](_0x36e9c3,_0x508a16[_0x58d94b(0x260)]);if(isAgentDir(_0x332f7f)){const _0x58c111=a109_0x461681[_0x58d94b(0x19b)](_0x332f7f,_0x58d94b(0x163)),_0x564b2d=a109_0x461681[_0x58d94b(0x19b)](_0x332f7f,'prompt.md'),_0x367b38=a109_0x461681[_0x58d94b(0x19b)](_0x332f7f,'starter_message.md'),_0x5a0030=parseAgentYaml(a109_0x59bb7c[_0x58d94b(0x170)](_0x58c111,_0x58d94b(0x239)),_0x58c111),_0x3626f7=a109_0x59bb7c[_0x58d94b(0x23b)](_0x564b2d)?a109_0x59bb7c[_0x58d94b(0x170)](_0x564b2d,_0x58d94b(0x239)):'',_0x32dc93=a109_0x59bb7c['existsSync'](_0x367b38)?a109_0x59bb7c['readFileSync'](_0x367b38,_0x58d94b(0x239)):_0x5a0030[_0x58d94b(0x259)];_0x592521['push']({'name':_0x5a0030[_0x58d94b(0x260)],'dir':_0x332f7f,'yaml':_0x5a0030,'systemPrompt':_0x3626f7,'starterMessage':_0x32dc93});}}const _0x3fc2b4=getKnowledgeBasesDir(_0x36e9c3);if(a109_0x59bb7c[_0x58d94b(0x23b)](_0x3fc2b4)){const _0xa7b8ba=a109_0x59bb7c[_0x58d94b(0x1a2)](_0x3fc2b4);for(const _0x50b2ae of _0xa7b8ba){const _0x18787d=a109_0x461681[_0x58d94b(0x19b)](_0x3fc2b4,_0x50b2ae);if(_0x50b2ae[_0x58d94b(0x16b)](_0x58d94b(0x15d))){const _0x4913ae=parseKnowledgeBaseYaml(a109_0x59bb7c['readFileSync'](_0x18787d,_0x58d94b(0x239)),_0x18787d);_0x2da208['push']({'name':_0x4913ae[_0x58d94b(0x260)],'path':_0x18787d,'yaml':_0x4913ae});}else{if(_0x50b2ae[_0x58d94b(0x16b)](_0x58d94b(0x205))){const _0x2f8404=a109_0x59bb7c['readFileSync'](_0x18787d,'utf-8'),{name:_0x37eebe,text:_0x5229f8}=parseTextKnowledgeBaseMd(_0x2f8404,_0x50b2ae);_0x27b51c[_0x58d94b(0x1ac)]({'name':_0x37eebe,'path':_0x18787d,'text':_0x5229f8});}}}}const _0x2372a7=getPromptsDir(_0x36e9c3);if(a109_0x59bb7c[_0x58d94b(0x23b)](_0x2372a7)){const _0x7129e6=a109_0x59bb7c['readdirSync'](_0x2372a7)[_0x58d94b(0x264)](_0x1d1660=>_0x1d1660['endsWith'](_0x58d94b(0x15d)));for(const _0x358844 of _0x7129e6){const _0xa4a28=a109_0x461681[_0x58d94b(0x19b)](_0x2372a7,_0x358844),_0x99a764=parsePromptYaml(a109_0x59bb7c[_0x58d94b(0x170)](_0xa4a28,'utf-8'),_0xa4a28);_0x3133ae[_0x58d94b(0x1ac)]({'name':_0x99a764[_0x58d94b(0x260)],'path':_0xa4a28,'yaml':_0x99a764});}}const _0x186c50=getIntegrationsDir(_0x36e9c3);if(a109_0x59bb7c[_0x58d94b(0x23b)](_0x186c50)){const _0x3a06f3=a109_0x59bb7c[_0x58d94b(0x1a2)](_0x186c50)['filter'](_0x15e492=>_0x15e492[_0x58d94b(0x16b)]('.yml'));for(const _0x52d71a of _0x3a06f3){const _0x5b5898=a109_0x461681['join'](_0x186c50,_0x52d71a),_0x3484a8=parseIntegrationYaml(a109_0x59bb7c['readFileSync'](_0x5b5898,_0x58d94b(0x239)),_0x5b5898);SAFE_INTEGRATION_TYPES[_0x58d94b(0x238)](_0x3484a8[_0x58d94b(0x1d8)][_0x58d94b(0x179)]())?_0x5a18c7[_0x58d94b(0x1ac)]({'name':_0x3484a8[_0x58d94b(0x260)],'path':_0x5b5898,'yaml':_0x3484a8}):this['logger']['warn'](_0x58d94b(0x1e6)+_0x3484a8[_0x58d94b(0x260)]+_0x58d94b(0x1e4)+_0x3484a8['service_type']+'):\x20'+(_0x58d94b(0x18a)+SAFE_INTEGRATION_TYPES[_0x58d94b(0x19b)](',\x20')+_0x58d94b(0x25b)));}}const _0x30ac84=getExperimentalKnowledgeBasesDir(_0x36e9c3);if(a109_0x59bb7c[_0x58d94b(0x23b)](_0x30ac84)){const _0x216561=a109_0x59bb7c[_0x58d94b(0x1a2)](_0x30ac84,{'withFileTypes':!![]});for(const _0x3a22a9 of _0x216561){if(!_0x3a22a9[_0x58d94b(0x252)]())continue;const _0x16acd0=a109_0x461681[_0x58d94b(0x19b)](_0x30ac84,_0x3a22a9[_0x58d94b(0x260)]),_0x2c255f=a109_0x461681[_0x58d94b(0x19b)](_0x16acd0,_0x3a22a9[_0x58d94b(0x260)]+_0x58d94b(0x15d));if(a109_0x59bb7c['existsSync'](_0x2c255f)){const _0x11f4ea=parseExperimentalKnowledgeBaseYaml(a109_0x59bb7c[_0x58d94b(0x170)](_0x2c255f,_0x58d94b(0x239)),_0x2c255f),_0x32277d=a109_0x461681[_0x58d94b(0x19b)](_0x16acd0,_0x58d94b(0x1b3)),_0x407ef5=[];if(a109_0x59bb7c['existsSync'](_0x32277d)){const _0xe6799e=a109_0x59bb7c[_0x58d94b(0x1a2)](_0x32277d,{'withFileTypes':!![]});for(const _0x2659cc of _0xe6799e){if(!_0x2659cc[_0x58d94b(0x252)]())continue;const _0xcd483a=a109_0x461681[_0x58d94b(0x19b)](_0x32277d,_0x2659cc['name']),_0x420455=a109_0x461681[_0x58d94b(0x19b)](_0xcd483a,'code.js'),_0x430593=a109_0x461681[_0x58d94b(0x19b)](_0xcd483a,_0x58d94b(0x16d));if(a109_0x59bb7c['existsSync'](_0x420455)&&a109_0x59bb7c[_0x58d94b(0x23b)](_0x430593)){const _0x4e48e8=a109_0x59bb7c['readFileSync'](_0x420455,_0x58d94b(0x239)),_0x38a509=a109_0x59bb7c[_0x58d94b(0x170)](_0x430593,_0x58d94b(0x239));_0x407ef5[_0x58d94b(0x1ac)]({'name':_0x2659cc[_0x58d94b(0x260)],'code':_0x4e48e8,'json_schema':_0x38a509});}}}const _0x43f4f5={..._0x11f4ea,'functions':_0x407ef5};_0x1b1c3b[_0x58d94b(0x1ac)]({'name':_0x11f4ea[_0x58d94b(0x260)],'path':_0x16acd0,'def':_0x43f4f5});}}}const _0xcf363b=getExperimentalArtifactsDir(_0x36e9c3);if(a109_0x59bb7c[_0x58d94b(0x23b)](_0xcf363b)){const _0x325259=a109_0x59bb7c[_0x58d94b(0x1a2)](_0xcf363b,{'withFileTypes':!![]});for(const _0x308d19 of _0x325259){if(!_0x308d19[_0x58d94b(0x252)]())continue;const _0x46169a=a109_0x461681['join'](_0xcf363b,_0x308d19[_0x58d94b(0x260)]),_0x2b9515=a109_0x461681['join'](_0x46169a,_0x308d19['name']+_0x58d94b(0x15d));if(a109_0x59bb7c[_0x58d94b(0x23b)](_0x2b9515)){const _0x55cf38=parseExperimentalArtifactYaml(a109_0x59bb7c['readFileSync'](_0x2b9515,_0x58d94b(0x239)),_0x2b9515),_0x4d765c=a109_0x461681['join'](_0x46169a,_0x58d94b(0x185)),_0x456a6e=a109_0x59bb7c[_0x58d94b(0x23b)](_0x4d765c)?a109_0x59bb7c[_0x58d94b(0x170)](_0x4d765c,_0x58d94b(0x239)):'',_0x5a9847=a109_0x461681[_0x58d94b(0x19b)](_0x46169a,_0x58d94b(0x1e2)),_0x3adf97=[];if(a109_0x59bb7c['existsSync'](_0x5a9847)){const _0x460573=a109_0x59bb7c[_0x58d94b(0x1a2)](_0x5a9847);for(const _0x12da93 of _0x460573){const _0x5e90=a109_0x461681['join'](_0x5a9847,_0x12da93);if(a109_0x59bb7c[_0x58d94b(0x1b4)](_0x5e90)[_0x58d94b(0x17d)]()){const _0x140514=a109_0x59bb7c[_0x58d94b(0x170)](_0x5e90,_0x58d94b(0x239));_0x3adf97[_0x58d94b(0x1ac)]({'file_name':_0x12da93,'text_content':_0x140514});}}}const _0x1e938c={..._0x55cf38,'code':_0x456a6e,'files':_0x3adf97};_0x319d7e[_0x58d94b(0x1ac)]({'name':_0x55cf38['name'],'path':_0x46169a,'def':_0x1e938c});}}}}else{const _0x57357e=await this[_0x58d94b(0x1d9)](_0x36e9c3),_0x147fdc=await this[_0x58d94b(0x220)][_0x58d94b(0x23f)](_0x57357e);_0x344162=_0x147fdc[_0x58d94b(0x225)]['name'];const _0x13a1e2=await this[_0x58d94b(0x220)][_0x58d94b(0x1e5)](_0x57357e),_0x17e173=await this[_0x58d94b(0x220)]['listKnowledgeBases'](_0x57357e),_0x2366f9=await this[_0x58d94b(0x220)][_0x58d94b(0x204)](_0x57357e),_0x43db33=await this[_0x58d94b(0x220)][_0x58d94b(0x25d)](_0x57357e),_0x2a634b=await this[_0x58d94b(0x220)]['listIntegrations'](_0x57357e),_0xbfd90e=await safeListOrEmpty(()=>this['client'][_0x58d94b(0x219)](_0x57357e)),_0x335681=await safeListOrEmpty(()=>this[_0x58d94b(0x220)][_0x58d94b(0x1d5)](_0x57357e)),_0x58b3e8=new Map(),_0x1594c2=new Map(),_0x1dfe1d=new Map(),_0x34c4ad=new Map(),_0x69ff70=new Map(),_0xa03cca=new Map();for(const _0x5ab723 of _0x17e173){_0x58b3e8[_0x58d94b(0x1f9)](_0x5ab723['id'],_0x5ab723['attributes']['name']);}for(const _0x32a57b of _0x2366f9){_0x1594c2['set'](_0x32a57b['id'],_0x32a57b[_0x58d94b(0x225)][_0x58d94b(0x260)]);}for(const _0x368110 of _0x13a1e2){_0x1dfe1d[_0x58d94b(0x1f9)](_0x368110['id'],_0x368110['attributes'][_0x58d94b(0x260)]);}for(const _0x49ee1d of _0x43db33){_0x34c4ad[_0x58d94b(0x1f9)](_0x49ee1d['id'],_0x49ee1d['attributes']['name']);}for(const _0x5e4450 of _0xbfd90e){_0x69ff70[_0x58d94b(0x1f9)](_0x5e4450['id'],_0x5e4450[_0x58d94b(0x225)]['name']);}for(const _0xf3aa43 of _0x335681){_0xa03cca[_0x58d94b(0x1f9)](_0xf3aa43['id'],_0xf3aa43[_0x58d94b(0x225)][_0x58d94b(0x260)]);}const _0x4c0620={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x58b3e8,'TextKnowledgeBase':_0x1594c2,'Agent':_0x1dfe1d,'ExperimentalKnowledgeBase':_0x69ff70}),'resolvePromptName':async _0x388ea3=>_0x34c4ad[_0x58d94b(0x26a)](_0x388ea3),'onWarning':_0x5c2e1a=>this[_0x58d94b(0x16f)]['warn'](_0x5c2e1a)};for(const _0x18b9d1 of _0x13a1e2){const _0x502497=await agentResponseToDef(_0x18b9d1,_0x4c0620),{yaml:_0xc2e27,systemPrompt:_0x4a8d6b,starterMessage:_0x1fe4b3}=_0x502497;_0x592521[_0x58d94b(0x1ac)]({'name':_0xc2e27[_0x58d94b(0x260)],'dir':'','yaml':_0xc2e27,'systemPrompt':_0x4a8d6b,'starterMessage':_0x1fe4b3});}for(const _0x4a66e3 of _0x17e173){const _0x1676cc=apiKnowledgeBaseToYaml(_0x4a66e3);_0x2da208[_0x58d94b(0x1ac)]({'name':_0x1676cc[_0x58d94b(0x260)],'path':'','yaml':_0x1676cc});}for(const _0x5a7df0 of _0x2366f9){_0x27b51c['push']({'name':_0x5a7df0[_0x58d94b(0x225)][_0x58d94b(0x260)],'path':'','text':_0x5a7df0['attributes'][_0x58d94b(0x15f)]});}for(const _0x39a843 of _0x43db33){const _0x4fde02=await apiPromptToYaml(_0x39a843,_0x4c0620);_0x4fde02&&_0x3133ae['push']({'name':_0x4fde02[_0x58d94b(0x260)],'path':'','yaml':_0x4fde02});}for(const _0x451e68 of _0x2a634b){if(!_0x451e68[_0x58d94b(0x225)][_0x58d94b(0x16e)]&&SAFE_INTEGRATION_TYPES[_0x58d94b(0x238)](_0x451e68[_0x58d94b(0x225)][_0x58d94b(0x1dc)][_0x58d94b(0x179)]())){const _0x1ff9e3=await apiIntegrationToYaml(_0x451e68,_0x4c0620);_0x5a18c7[_0x58d94b(0x1ac)]({'name':_0x451e68['attributes'][_0x58d94b(0x1dc)][_0x58d94b(0x179)](),'path':'','yaml':_0x1ff9e3});}}for(const _0x785d09 of _0xbfd90e){const _0x5bf0b9=apiExperimentalKnowledgeBaseToYaml(_0x785d09);_0x1b1c3b[_0x58d94b(0x1ac)]({'name':_0x5bf0b9[_0x58d94b(0x260)],'path':'','def':_0x5bf0b9});}for(const _0x262aa3 of _0x335681){const _0x605524=apiExperimentalArtifactToYaml(_0x262aa3);_0x319d7e[_0x58d94b(0x1ac)]({'name':_0x605524[_0x58d94b(0x260)],'path':'','def':_0x605524});}}const _0x38155d={'sourceProjectName':_0x344162,'newProjectName':_0x1c0133,'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}}},_0x1eb527=await this[_0x58d94b(0x220)][_0x58d94b(0x1f4)](),_0x23e56c=_0x1eb527['find'](_0x5628c6=>_0x5628c6[_0x58d94b(0x225)][_0x58d94b(0x260)]===_0x1c0133);if(_0x23e56c)throw new SDKError(ErrorCode[_0x58d94b(0x16a)],'Project\x20\x22'+_0x1c0133+_0x58d94b(0x23d),undefined,{'helpText':_0x58d94b(0x19e)});if(_0x34cb9f?.[_0x58d94b(0x202)])return _0x38155d[_0x58d94b(0x230)]['agents'][_0x58d94b(0x178)]=_0x592521[_0x58d94b(0x257)],_0x38155d['counts'][_0x58d94b(0x213)][_0x58d94b(0x178)]=_0x2da208[_0x58d94b(0x257)],_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x182)][_0x58d94b(0x178)]=_0x27b51c['length'],_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x1f8)][_0x58d94b(0x178)]=_0x1b1c3b['length'],_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x229)][_0x58d94b(0x178)]=_0x319d7e['length'],_0x38155d['counts'][_0x58d94b(0x15e)][_0x58d94b(0x178)]=_0x3133ae[_0x58d94b(0x257)],_0x38155d['counts']['integrations'][_0x58d94b(0x178)]=_0x5a18c7[_0x58d94b(0x257)],_0x38155d;const _0x5bcf80=await this[_0x58d94b(0x220)][_0x58d94b(0x1cb)]({'name':_0x1c0133}),_0x1f655d=_0x5bcf80['id'];_0x38155d[_0x58d94b(0x1dd)]=_0x1f655d;const _0x56060e=new Map(),_0x13d4fc=new Map(),_0x501996=new Map(),_0x4f0903=new Map(),_0x95d392=new Map(),_0x41530e=new Map(),_0xf9a799=new Map(),_0x493b73=new Map(),_0x40c096=new Set(),_0x19c030=new Set();for(const _0x1a467b of _0x592521){for(const _0x852cc3 of _0x1a467b['yaml'][_0x58d94b(0x1da)]||[]){if(_0x852cc3[_0x58d94b(0x1b7)]===_0x58d94b(0x1c6)&&_0x852cc3[_0x58d94b(0x1b2)]){const _0x132439=parseRef(_0x852cc3[_0x58d94b(0x1b2)]);if(_0x132439)_0x40c096[_0x58d94b(0x208)](_0x132439[_0x58d94b(0x260)]);}else{if(_0x852cc3['type']==='web_search'&&_0x852cc3[_0x58d94b(0x1b2)]){const _0xe2ca64=parseRef(_0x852cc3[_0x58d94b(0x1b2)]);if(_0xe2ca64)_0x19c030['add'](_0xe2ca64[_0x58d94b(0x260)]);}}}}for(const _0x36b9e4 of _0x40c096){try{const _0x2c05e7=await this[_0x58d94b(0x220)][_0x58d94b(0x21c)]({'projectId':_0x1f655d,'name':_0x36b9e4});_0x95d392[_0x58d94b(0x1f9)](_0x36b9e4,_0x2c05e7['id']),_0x38155d[_0x58d94b(0x20a)][_0x58d94b(0x1ac)]({'name':_0x36b9e4,'action':_0x58d94b(0x178),'id':_0x2c05e7['id']}),_0x38155d['counts'][_0x58d94b(0x20a)]['created']++;}catch(_0x7a6a00){_0x38155d[_0x58d94b(0x20a)][_0x58d94b(0x1ac)]({'name':_0x36b9e4,'action':_0x58d94b(0x171),'error':_0x7a6a00[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x20a)][_0x58d94b(0x261)]++;}}for(const _0x3a3c10 of _0x19c030){try{const _0x2397ba=await this[_0x58d94b(0x220)][_0x58d94b(0x1c3)]({'projectId':_0x1f655d,'name':_0x3a3c10});_0x41530e[_0x58d94b(0x1f9)](_0x3a3c10,_0x2397ba['id']),_0x38155d[_0x58d94b(0x157)][_0x58d94b(0x1ac)]({'name':_0x3a3c10,'action':'created','id':_0x2397ba['id']}),_0x38155d[_0x58d94b(0x230)]['webSearchTools']['created']++;}catch(_0x263cf3){_0x38155d[_0x58d94b(0x157)][_0x58d94b(0x1ac)]({'name':_0x3a3c10,'action':_0x58d94b(0x171),'error':_0x263cf3[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x157)][_0x58d94b(0x261)]++;}}const _0x3b8a67=await fetchAllToolTargetMaps((_0x14a7ee,_0x4829c7)=>this[_0x58d94b(0x220)][_0x58d94b(0x164)](_0x14a7ee,_0x4829c7),_0x1f655d);let _0x175492=[];const _0x432b5d={'projectId':_0x1f655d,'resolveToolTargetId':buildIdResolver({..._0x3b8a67[_0x58d94b(0x198)],'KnowledgeBase':_0x56060e,'TextKnowledgeBase':_0x13d4fc,'ExperimentalKnowledgeBase':_0xf9a799,'Agent':_0x501996,'WebSearchTool':_0x41530e,'ImageGenerator':_0x95d392}),'resolvePromptId':async _0x11b11a=>_0x4f0903[_0x58d94b(0x26a)](_0x11b11a),'onWarning':_0x37047a=>{const _0x26b397=_0x58d94b;this[_0x26b397(0x16f)][_0x26b397(0x258)](_0x37047a),_0x175492['push'](_0x37047a);}};for(const _0x3c50f5 of _0x2da208){try{const _0x5cfe2d=yamlKnowledgeBaseToApi(_0x3c50f5[_0x58d94b(0x1be)],_0x1f655d),_0x4b32b0=await this[_0x58d94b(0x220)][_0x58d94b(0x269)](_0x5cfe2d);_0x56060e[_0x58d94b(0x1f9)](_0x3c50f5[_0x58d94b(0x1be)]['name'],_0x4b32b0['id']),_0x38155d[_0x58d94b(0x213)][_0x58d94b(0x1ac)]({'name':_0x3c50f5[_0x58d94b(0x1be)][_0x58d94b(0x260)],'action':_0x58d94b(0x178),'id':_0x4b32b0['id']}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x213)][_0x58d94b(0x178)]++;}catch(_0x1642ce){_0x38155d[_0x58d94b(0x213)][_0x58d94b(0x1ac)]({'name':_0x3c50f5[_0x58d94b(0x1be)][_0x58d94b(0x260)],'action':'error','error':_0x1642ce[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)]['knowledgeBases']['errors']++;}}for(const _0x54624b of _0x27b51c){try{const _0x57f3c3=yamlTextKnowledgeBaseToApi({'name':_0x54624b[_0x58d94b(0x260)],'text':_0x54624b[_0x58d94b(0x15f)]},_0x1f655d),_0x1c14ec=await this['client']['createTextKnowledgeBase'](_0x57f3c3);_0x13d4fc[_0x58d94b(0x1f9)](_0x54624b[_0x58d94b(0x260)],_0x1c14ec['id']),_0x38155d['textKnowledgeBases'][_0x58d94b(0x1ac)]({'name':_0x54624b[_0x58d94b(0x260)],'action':_0x58d94b(0x178),'id':_0x1c14ec['id']}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x182)]['created']++;}catch(_0x3158a2){_0x38155d[_0x58d94b(0x182)]['push']({'name':_0x54624b[_0x58d94b(0x260)],'action':'error','error':_0x3158a2[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)]['textKnowledgeBases'][_0x58d94b(0x261)]++;}}for(const _0xa61c46 of _0x319d7e){try{const _0x4dbe30=yamlExperimentalArtifactToApi(_0xa61c46[_0x58d94b(0x189)],_0x1f655d),_0x12073c=await this['client']['createExperimentalArtifact'](_0x4dbe30);_0x493b73['set'](_0xa61c46[_0x58d94b(0x189)][_0x58d94b(0x260)],_0x12073c['id']),_0x38155d[_0x58d94b(0x229)]['push']({'name':_0xa61c46['def'][_0x58d94b(0x260)],'action':_0x58d94b(0x178),'id':_0x12073c['id']}),_0x38155d['counts'][_0x58d94b(0x229)][_0x58d94b(0x178)]++;}catch(_0x4c0ba0){_0x38155d[_0x58d94b(0x229)]['push']({'name':_0xa61c46['def'][_0x58d94b(0x260)],'action':_0x58d94b(0x171),'error':_0x4c0ba0[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x229)][_0x58d94b(0x261)]++;}}for(const _0x1bd253 of _0x1b1c3b){try{const _0x47203f=yamlExperimentalKnowledgeBaseToApi(_0x1bd253[_0x58d94b(0x189)],_0x1f655d),_0x259c03=await this[_0x58d94b(0x220)]['createExperimentalKnowledgeBase'](_0x47203f);_0xf9a799['set'](_0x1bd253['def'][_0x58d94b(0x260)],_0x259c03['id']),_0x38155d['experimentalKnowledgeBases'][_0x58d94b(0x1ac)]({'name':_0x1bd253[_0x58d94b(0x189)][_0x58d94b(0x260)],'action':_0x58d94b(0x178),'id':_0x259c03['id']}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x1f8)][_0x58d94b(0x178)]++;}catch(_0x1662f4){_0x38155d[_0x58d94b(0x1f8)][_0x58d94b(0x1ac)]({'name':_0x1bd253[_0x58d94b(0x189)]['name'],'action':_0x58d94b(0x171),'error':_0x1662f4[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x1f8)][_0x58d94b(0x261)]++;}}const _0x579321=[..._0x592521][_0x58d94b(0x184)]((_0x8253cc,_0x52b418)=>{const _0x3ca420=_0x58d94b,_0x14d324=_0x8253cc[_0x3ca420(0x1be)]['tools']?.[_0x3ca420(0x224)](_0x42313d=>_0x42313d[_0x3ca420(0x1b7)]==='agent')??![],_0x51f18c=_0x52b418['yaml'][_0x3ca420(0x1da)]?.[_0x3ca420(0x224)](_0x8a4ea1=>_0x8a4ea1[_0x3ca420(0x1b7)]===_0x3ca420(0x20e))??![];if(_0x14d324&&!_0x51f18c)return 0x1;if(!_0x14d324&&_0x51f18c)return-0x1;return 0x0;});for(const _0x41b0f3 of _0x579321){_0x175492=[];try{const _0x4cc472=_0x41b0f3[_0x58d94b(0x1be)]['tools']?.[_0x58d94b(0x264)](_0x28c012=>{const _0xee19d9=_0x58d94b;if(_0x28c012['type']==='agent'&&_0x28c012[_0xee19d9(0x1b2)]){const _0x4e0d17=parseRef(_0x28c012[_0xee19d9(0x1b2)]);return _0x4e0d17?.[_0xee19d9(0x260)]===_0x41b0f3[_0xee19d9(0x1be)][_0xee19d9(0x260)];}return![];})??[];if(_0x4cc472[_0x58d94b(0x257)]>0x0){const _0x346b90=_0x58d94b(0x1fe)+_0x41b0f3[_0x58d94b(0x1be)][_0x58d94b(0x260)]+_0x58d94b(0x1ec)+_0x58d94b(0x181);this[_0x58d94b(0x16f)][_0x58d94b(0x258)](_0x346b90),_0x175492[_0x58d94b(0x1ac)](_0x346b90);}const _0x5026a3=await agentDefToRequest(_0x41b0f3[_0x58d94b(0x1be)],_0x41b0f3[_0x58d94b(0x24e)],_0x41b0f3[_0x58d94b(0x1aa)],_0x432b5d),_0x5e8ba1=await this['client']['createAgentResponse'](_0x5026a3);_0x501996[_0x58d94b(0x1f9)](_0x41b0f3[_0x58d94b(0x1be)][_0x58d94b(0x260)],_0x5e8ba1['id']),_0x38155d['agents'][_0x58d94b(0x1ac)]({'agentName':_0x41b0f3['yaml'][_0x58d94b(0x260)],'action':_0x58d94b(0x178),'agentId':_0x5e8ba1['id'],'warnings':_0x175492[_0x58d94b(0x257)]>0x0?_0x175492:undefined}),_0x38155d[_0x58d94b(0x230)]['agents'][_0x58d94b(0x178)]++;}catch(_0x184b75){_0x38155d[_0x58d94b(0x22d)]['push']({'agentName':_0x41b0f3[_0x58d94b(0x1be)]['name'],'action':_0x58d94b(0x171),'error':_0x184b75[_0x58d94b(0x200)],'warnings':_0x175492[_0x58d94b(0x257)]>0x0?_0x175492:undefined}),_0x38155d[_0x58d94b(0x230)]['agents'][_0x58d94b(0x261)]++;}}for(const _0x25afe8 of _0x3133ae){try{const _0x2d7771=await yamlPromptToApi(_0x25afe8[_0x58d94b(0x1be)],_0x1f655d,_0x432b5d);if(!_0x2d7771){_0x38155d[_0x58d94b(0x15e)][_0x58d94b(0x1ac)]({'name':_0x25afe8['yaml']['name'],'action':_0x58d94b(0x171),'error':_0x58d94b(0x270)}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x15e)][_0x58d94b(0x261)]++;continue;}const _0x5a9fe2=await this[_0x58d94b(0x220)][_0x58d94b(0x266)](_0x2d7771);_0x4f0903[_0x58d94b(0x1f9)](_0x25afe8['yaml'][_0x58d94b(0x260)],_0x5a9fe2['id']),_0x38155d['prompts'][_0x58d94b(0x1ac)]({'name':_0x25afe8[_0x58d94b(0x1be)][_0x58d94b(0x260)],'action':_0x58d94b(0x178),'id':_0x5a9fe2['id']}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x15e)][_0x58d94b(0x178)]++;}catch(_0x1d753a){_0x38155d[_0x58d94b(0x15e)]['push']({'name':_0x25afe8[_0x58d94b(0x1be)]['name'],'action':'error','error':_0x1d753a[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)]['prompts']['errors']++;}}for(const _0x1218a6 of _0x5a18c7){try{const _0x3bf2f0=await yamlIntegrationToApi(_0x1218a6[_0x58d94b(0x1be)],_0x1f655d,_0x432b5d),_0x18b13a=await this[_0x58d94b(0x220)][_0x58d94b(0x1e7)](_0x3bf2f0);_0x38155d[_0x58d94b(0x187)]['push']({'name':_0x1218a6[_0x58d94b(0x1be)][_0x58d94b(0x1d8)],'action':'created','id':_0x18b13a['id']}),_0x38155d[_0x58d94b(0x230)]['integrations'][_0x58d94b(0x178)]++;}catch(_0x2787da){_0x38155d[_0x58d94b(0x187)][_0x58d94b(0x1ac)]({'name':_0x1218a6[_0x58d94b(0x1be)][_0x58d94b(0x1d8)],'action':_0x58d94b(0x171),'error':_0x2787da[_0x58d94b(0x200)]}),_0x38155d[_0x58d94b(0x230)][_0x58d94b(0x187)][_0x58d94b(0x261)]++;}}return _0x38155d;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2de3a2,_0x53f2db){const _0x1f0d37=a110_0x53f7,_0xd6e7bb=_0x2de3a2();while(!![]){try{const _0x40e3e6=-parseInt(_0x1f0d37(0x1bb))/0x1*(parseInt(_0x1f0d37(0x1c5))/0x2)+parseInt(_0x1f0d37(0x1ba))/0x3+-parseInt(_0x1f0d37(0x1b9))/0x4*(-parseInt(_0x1f0d37(0x1bf))/0x5)+-parseInt(_0x1f0d37(0x1c2))/0x6+parseInt(_0x1f0d37(0x1c6))/0x7*(parseInt(_0x1f0d37(0x1c1))/0x8)+-parseInt(_0x1f0d37(0x1c7))/0x9+parseInt(_0x1f0d37(0x1b8))/0xa;if(_0x40e3e6===_0x53f2db)break;else _0xd6e7bb['push'](_0xd6e7bb['shift']());}catch(_0x538426){_0xd6e7bb['push'](_0xd6e7bb['shift']());}}}(a110_0xcab5,0xb31cb));export function canCreateAgent(_0x3a593c,_0x19d980){const _0x46a8b4=a110_0x53f7;for(const _0x3e29ff of _0x3a593c[_0x46a8b4(0x1bd)][_0x46a8b4(0x1c9)]){if(_0x3e29ff[_0x46a8b4(0x1bc)]&&!_0x19d980[_0x46a8b4(0x1be)](_0x3e29ff[_0x46a8b4(0x1bc)]))return![];}return!![];}export function remapToolIds(_0x4e8344,_0x3b2b20,_0x456389){const _0x57b05f=a110_0x53f7;return _0x4e8344[_0x57b05f(0x1c8)](_0x2aa164=>({..._0x2aa164,'targetKnowledgeBaseId':_0x2aa164['targetKnowledgeBaseId']?_0x3b2b20[_0x57b05f(0x1c0)](_0x2aa164[_0x57b05f(0x1c3)])||_0x2aa164['targetKnowledgeBaseId']:undefined,'targetAgentId':_0x2aa164[_0x57b05f(0x1bc)]?_0x456389[_0x57b05f(0x1c0)](_0x2aa164[_0x57b05f(0x1bc)])||_0x2aa164[_0x57b05f(0x1bc)]:undefined}));}function a110_0xcab5(){const _0x42c5d1=['9194440ePNxeX','4qGlhgm','1554729BRJkOM','32369LiCJSL','targetAgentId','attributes','has','3580715adroii','get','8SgkzpG','2817210XkJKJm','targetKnowledgeBaseId','1.0','44OAjTuH','6505884OoYQkG','10511514nKRSCS','map','tools'];a110_0xcab5=function(){return _0x42c5d1;};return a110_0xcab5();}function a110_0x53f7(_0x4aba4b,_0x561503){_0x4aba4b=_0x4aba4b-0x1b8;const _0xcab5c4=a110_0xcab5();let _0x53f7ad=_0xcab5c4[_0x4aba4b];return _0x53f7ad;}export function remapVariableIds(_0xf26129,_0x3b5921){const _0x1a6c7f=a110_0x53f7;return _0xf26129['map'](_0x39b6c0=>({..._0x39b6c0,'targetKnowledgeBaseId':_0x3b5921[_0x1a6c7f(0x1c0)](_0x39b6c0[_0x1a6c7f(0x1c3)])||_0x39b6c0[_0x1a6c7f(0x1c3)]}));}export function isSupportedBackupVersion(_0x4f3b5f){const _0x455aad=a110_0x53f7;return _0x4f3b5f===_0x455aad(0x1c4);}
|