@treasuredata/tdx 2026.6.2 → 2026.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-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/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.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/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/llm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a134_0x1c689f=a134_0x240d;(function(_0x25eabc,_0x1762bd){const _0x52124f=a134_0x240d,_0x34b899=_0x25eabc();while(!![]){try{const _0x4c1989=parseInt(_0x52124f(0x19b))/0x1+parseInt(_0x52124f(0x13e))/0x2*(parseInt(_0x52124f(0x17d))/0x3)+-parseInt(_0x52124f(0x229))/0x4+-parseInt(_0x52124f(0x1f8))/0x5+parseInt(_0x52124f(0x1ce))/0x6*(parseInt(_0x52124f(0x23b))/0x7)+parseInt(_0x52124f(0x178))/0x8+parseInt(_0x52124f(0x1d7))/0x9*(-parseInt(_0x52124f(0x1a1))/0xa);if(_0x4c1989===_0x1762bd)break;else _0x34b899['push'](_0x34b899['shift']());}catch(_0x344b61){_0x34b899['push'](_0x34b899['shift']());}}}(a134_0x3e97,0x9ac0f));import{LLMApiClient}from'../client/llm-api-client.js';import*as a134_0x3a629b from'node:fs';import*as a134_0x70d920 from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{toModelInfos}from'./user-settings.js';import{SDKError,ErrorCode,errorContains}from'../errors.js';import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,apiFormInterfaceToYaml,apiChatInterfaceToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,toFormInterfaceYamlString,toChatInterfaceYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,parseFormInterfaceYaml,parseChatInterfaceYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,yamlFormInterfaceToApi,yamlChatInterfaceToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir,getFormInterfacesDir,getChatInterfacesDir}from'../agent/agent-config.js';import{getSanitizedUsername,generateRandomHex}from'../../utils/string-utils.js';function a134_0x240d(_0x42f9cd,_0x472e4f){_0x42f9cd=_0x42f9cd-0x12e;const _0x3e9720=a134_0x3e97();let _0x240d2d=_0x3e9720[_0x42f9cd];return _0x240d2d;}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';function a134_0x3e97(){const _0x2ee041=['agent.yml','path','ALREADY_EXISTS','split','updateAgentResponse','experimental_knowledge_bases','getBackupMetadata','isDir','Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.','includes','deleteAgent','setCurrentProject','code','conflict','chat','projects','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.','chatInfo','\x27.\x20This\x20should\x20not\x20happen.','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','prompts.json','warn','Agent\x20\x27','knowledge_bases','3427832AhQxYM','agent','template','functions','createAgent','code.js','projectId','readdirSync','error','has','Could\x20not\x20resolve\x20agent\x20reference','integrations.json','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','stringify','getOrCreateDefaultAgent','toLowerCase','formInterfaces','Renamed\x20chat\x20interface\x20file:\x20','1044638EhRGfC','starter_message','experimentalKnowledgeBases','signal','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Output\x20directory\x20already\x20exists:\x20','getProject','updated','unlinkSync','Multiple\x20agents\x20found\x20with\x20name\x20\x27','Unsupported\x20backup\x20version:\x20','exportedFrom','chats','mkdirSync','\x20attempts\x20due\x20to\x20name\x20conflicts.','UNAUTHENTICATED','find','knowledgeBases','target','getDefaultProjectName','new','#\x20prompt.md\x0a','updateFormInterface','set','getCurrentProject','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','INTERNAL','duplicate','site','version','getChatLog','project.json','keys','KnowledgeBase','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','add','Renamed\x20integration\x20file:\x20','service_type','info','):\x20','form_interfaces','Renamed\x20text\x20KB\x20file:\x20','8WlkUqC','Only\x20safe\x20types\x20(','tables','\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20','basename',')\x20can\x20be\x20cloned.','textKnowledgeBases','cwd','Removed\x20deleted\x20directory:\x20','promptId','starterMessage','Project\x20not\x20found:\x20','json_schema.json','statSync','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','maxToolIterations','isManaged','setDefaultAgent','Renamed\x20folder:\x20','renamed','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','utf-8','webhookCorsOrigins','backupProject','filter','chatInterfaces','createExperimentalKnowledgeBase','reasoningEffort',')\x20can\x20be\x20pushed.\x20','listImageGenerators','prompt.md','experimentalArtifacts','isDirectory','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','temperature','listAgentsFull','agents','dirname','createKnowledgeBase','dryRun','endsWith','systemPrompt','\x20---\x0a','listChatInterfaces','history','pushAgent','knowledgebases.json','NOT_FOUND','agentId','listProjects','map','tdx_','listExperimentalKnowledgeBases','listPrompts','medium','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','listIntegrations','6532824blAgzY','pullProject','Invalid\x20agent\x20reference\x20format:\x20','integrations','join','649869xtLVuH','currentProjectId','tdx.json','---\x20file:\x20','length','\x27\x20(','listAgents','context','existsSync','LLM_PROJECT_NOT_FOUND','\x0a\x0a#\x20agent.yml\x0a','readFileSync','1.0','localeCompare','writeFileSync','chat_parent_segment','.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.','loadJsonFile','createChatInterface','agent.yml\x20not\x20found\x20in\x20','No\x20tdx.json\x20found\x20in\x20','.yml','isFile','listKnowledgeBases','chat_generic','updateKnowledgeBase','updateTextKnowledgeBase','yaml','\x20→\x20','text_content','1206847STWlae','serviceType','web_search','chat_agent_console','deleteIntegration','agentsFull','30qZQzjM','idToName','attributes','updateExperimentalArtifact','Agent\x20not\x20found:\x20','Multiple\x20projects\x20found\x20with\x20name\x20\x27','createFormInterface','listTextKnowledgeBases','Skipping\x20integration\x20\x27','updateAgent','Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.','Renamed\x20experimental\x20KB\x20directory:\x20','parse','INVALID_ARGUMENT','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','chatWelcomeMessage','errors','Renamed\x20prompt\x20file:\x20','startChat','none','Agent\x20reference\x20not\x20found','\x20in\x20project\x20','oldPath','rmSync','imageGenerators','agents.json','json_schema','deleteProject','Project\x20\x22','metadata','def','minimal','clearDefaultAgent','Backup\x20folder\x20not\x20found:\x20','total','createIntegration','size','file_name','createImageGenerator','dir','tdx_default_','high','PERMISSION_DENIED','ExperimentalKnowledgeBase','18MCosND','newProjectId','message','resolveProjectId','claude-4.5-sonnet','logger','createPrompt','text','created','5537646GlJRMx','sort','actions','dry-run-','\x0a---\x20schema:\x20','files','listWebSearchTools','counts','.md','resolveProjectName','continueChat','createAgentResponse','Renamed\x20form\x20interface\x20file:\x20','status','createTextKnowledgeBase','chat_interfaces','\x0a---\x20code\x20---\x0a','webSearchTools','resolveAgentId','push','variables','image_gen','updatePrompt','createProject','createExperimentalArtifact','getChatHistory','getAgent','content','restoreProject','listExperimentalArtifacts','description','event','getOrCreateDefaultProject','4665KgzDjC','unchanged','\x0a---\x20function:\x20','Available\x20agents:\x20','prompts','updateExperimentalKnowledgeBase','nameToId','client','agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat','cloneProject','AGENT_NOT_FOUND','experimental_artifacts','name','listFormInterfaces','Unable\x20to\x20create\x20project\x20after\x20','listToolTargets','tools','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','tdDatabaseName','llm_project','type','some','getUserSettings','get','starter_message.md'];a134_0x3e97=function(){return _0x2ee041;};return a134_0x3e97();}export const SAFE_INTEGRATION_TYPES=[a134_0x1c689f(0x195),a134_0x1c689f(0x19e),a134_0x1c689f(0x18c)];async function safeListOrEmpty(_0x1c9320){const _0x164b0c=a134_0x1c689f;try{return await _0x1c9320();}catch(_0x64a61c){if(_0x64a61c instanceof HTTPClientError&&_0x64a61c[_0x164b0c(0x1e4)]===0x194)return[];throw _0x64a61c;}}export class LLMSDK{[a134_0x1c689f(0x17e)];['client'];['context'];[a134_0x1c689f(0x1d3)]=Logger['of']('sdk.llm');constructor(_0x4e0081){const _0x33664b=a134_0x1c689f;this[_0x33664b(0x1ff)]=new LLMApiClient(_0x4e0081),this[_0x33664b(0x184)]=_0x4e0081;}[a134_0x1c689f(0x24e)](){const _0x521c47=a134_0x1c689f,_0x2d13bd=getSanitizedUsername();return _0x521c47(0x1ca)+_0x2d13bd;}async[a134_0x1c689f(0x21c)](_0x5c4ed4){const _0xdba9ef=a134_0x1c689f,{projectId:_0xf68fce}=await this['resolveProjectName'](_0x5c4ed4);this[_0xdba9ef(0x17e)]=_0xf68fce;}[a134_0x1c689f(0x253)](){const _0x5deb42=a134_0x1c689f;return this[_0x5deb42(0x17e)];}async[a134_0x1c689f(0x14f)](_0x4f118c){const _0x6ade90=a134_0x1c689f,_0x2a46e7=this[_0x6ade90(0x184)]['profile'];let _0x262e10,_0x1b5f45;if(_0x4f118c[_0x6ade90(0x21a)]('/')){const _0x5743de=_0x4f118c[_0x6ade90(0x214)]('/');if(_0x5743de[_0x6ade90(0x181)]!==0x2)throw new SDKError(ErrorCode[_0x6ade90(0x1ae)],_0x6ade90(0x17a)+_0x4f118c,undefined,{'helpText':_0x6ade90(0x209)});const [_0x46da1d,_0x46c1c3]=_0x5743de;_0x262e10=await this['resolveProjectId'](_0x46da1d),_0x1b5f45=_0x46c1c3;}else _0x262e10=this[_0x6ade90(0x17e)]||(await this[_0x6ade90(0x1f7)]())['id'],_0x1b5f45=_0x4f118c;const _0x1b7ebd=await this[_0x6ade90(0x1e9)](_0x1b5f45,_0x262e10),_0x3795f0=await this['client'][_0x6ade90(0x1f1)](_0x1b7ebd);writeCachedLLMAgent(_0x3795f0[_0x6ade90(0x1a3)]['name'],_0x1b7ebd,_0x262e10,_0x2a46e7);}['getDefaultAgent'](){const _0x415d45=a134_0x1c689f,_0x1b51e1=this[_0x415d45(0x184)]['profile'];return readCachedLLMAgent(_0x1b51e1)||undefined;}[a134_0x1c689f(0x1c2)](){const _0x19ba92=a134_0x1c689f,_0x1bbf4d=this[_0x19ba92(0x184)]['profile'];clearCachedLLMAgent(_0x1bbf4d);}async['models'](){const _0x331e15=a134_0x1c689f,_0x274e93=await this[_0x331e15(0x1ff)][_0x331e15(0x20e)]();return toModelInfos(_0x274e93);}async['createProject'](_0x897d6){const _0x5c00ed=a134_0x1c689f;return await this[_0x5c00ed(0x1ff)][_0x5c00ed(0x1ee)](_0x897d6);}async[a134_0x1c689f(0x1bd)](_0x3984da){const _0x5ca08c=a134_0x1c689f,{projectId:_0x347002}=await this['resolveProjectName'](_0x3984da);await this[_0x5ca08c(0x1ff)][_0x5ca08c(0x1bd)](_0x347002);}async[a134_0x1c689f(0x220)](_0xe9d9b8=0x32){const _0xa365c9=a134_0x1c689f;return await this['client'][_0xa365c9(0x170)](_0xe9d9b8);}async[a134_0x1c689f(0x1f7)](_0x37ae81){const _0x44c618=a134_0x1c689f,_0x3f6656=_0x37ae81||this[_0x44c618(0x24e)](),_0x53d403=this[_0x44c618(0x184)]['profile'];if(!_0x37ae81){const _0x2673e8=readCachedLLMProject(_0x53d403);if(_0x2673e8&&_0x2673e8[_0x44c618(0x204)]===_0x3f6656)try{const _0x57c1af=await this[_0x44c618(0x1ff)][_0x44c618(0x241)](_0x2673e8['id']);if(_0x57c1af[_0x44c618(0x1a3)][_0x44c618(0x204)]===_0x3f6656)return _0x57c1af;}catch{}}const _0x419a05=await this[_0x44c618(0x1ff)]['listProjects'](),_0x1af355=_0x419a05[_0x44c618(0x24b)](_0x5dfc8b=>_0x5dfc8b['attributes']['name']===_0x3f6656);if(_0x1af355)return!_0x37ae81&&writeCachedLLMProject(_0x3f6656,_0x1af355['id'],_0x53d403),_0x1af355;const _0x51360b=await this['client'][_0x44c618(0x1ee)]({'name':_0x3f6656,'description':_0x44c618(0x224)+getSanitizedUsername()+')'});return!_0x37ae81&&writeCachedLLMProject(_0x3f6656,_0x51360b['id'],_0x53d403),_0x51360b;}async['resolveProjectId'](_0x2c182c){const _0x113521=a134_0x1c689f,_0x3f7dda=await this[_0x113521(0x1ff)][_0x113521(0x170)](),_0x240eaa=_0x3f7dda[_0x113521(0x157)](_0x468d3=>_0x468d3[_0x113521(0x1a3)][_0x113521(0x204)]===_0x2c182c);if(_0x240eaa[_0x113521(0x181)]===0x0)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x113521(0x149)+_0x2c182c,undefined,{'helpText':_0x113521(0x23f)});if(_0x240eaa[_0x113521(0x181)]>0x1)throw new SDKError(ErrorCode[_0x113521(0x12e)],_0x113521(0x1a6)+_0x2c182c+'\x27.\x20This\x20should\x20not\x20happen.');return _0x240eaa[0x0]['id'];}async[a134_0x1c689f(0x1e0)](_0x69b942){const _0x31df0c=a134_0x1c689f,_0x480a31=await this[_0x31df0c(0x1ff)][_0x31df0c(0x170)](),_0x140f17=_0x480a31[_0x31df0c(0x24b)](_0x90c855=>_0x90c855['attributes']['name']===_0x69b942);if(_0x140f17)return{'projectId':_0x140f17['id'],'project':_0x140f17};throw new SDKError(ErrorCode[_0x31df0c(0x186)],'Project\x20not\x20found:\x20'+_0x69b942,undefined,{'helpText':_0x31df0c(0x23f)});}async[a134_0x1c689f(0x237)](_0xe0841=a134_0x1c689f(0x1d2),_0x2a0692=0x0,_0x9b17e3){const _0xa25d53=a134_0x1c689f,_0x588948=0xa;let _0x58b102=0x0,_0x5cb968;while(_0x58b102<_0x588948){try{const _0x3ad095=await this[_0xa25d53(0x1f7)](_0x5cb968),_0x4ad6d7=_0x3ad095['id'],_0x5cb547=[_0xa25d53(0x1b5),_0xa25d53(0x1c1),'low',_0xa25d53(0x175),_0xa25d53(0x1cb)],_0x162b86=_0x2a0692===0x0?_0xa25d53(0x172)+_0xe0841:'tdx_'+_0xe0841+'_reasoning_'+_0x5cb547[_0x2a0692],_0x59121d=await this[_0xa25d53(0x1ff)]['listAgents'](_0x4ad6d7),_0x48eedf=_0x59121d['find'](_0x443e4b=>_0x443e4b[_0xa25d53(0x1a3)][_0xa25d53(0x204)]===_0x162b86);if(_0x48eedf)return _0x48eedf;const _0x1f3fae=_0x2a0692>0x0?0x1:_0x9b17e3;return await this[_0xa25d53(0x1ff)]['createAgent']({'name':_0x162b86,'projectId':_0x4ad6d7,'modelType':_0xe0841,'systemPrompt':'','temperature':_0x1f3fae,'reasoningEffort':_0x2a0692>0x0?_0x2a0692:undefined});}catch(_0x1b7f84){if(_0x1b7f84 instanceof HTTPClientError){const _0x34f6e0=_0x1b7f84[_0xa25d53(0x1e4)];if(_0x34f6e0>=0x190&&_0x34f6e0<0x1f4){if(_0x34f6e0===0x191)throw new SDKError(ErrorCode[_0xa25d53(0x24a)],_0xa25d53(0x254),_0x1b7f84);else{if(_0x34f6e0===0x193)throw new SDKError(ErrorCode[_0xa25d53(0x1cc)],_0xa25d53(0x219),_0x1b7f84);}throw _0x1b7f84;}}if(errorContains(_0x1b7f84,'already\x20exists',_0xa25d53(0x12f),_0xa25d53(0x21e))){_0x58b102++;if(_0x58b102>=_0x588948)throw new SDKError(ErrorCode[_0xa25d53(0x213)],_0xa25d53(0x206)+_0x588948+_0xa25d53(0x249),_0x1b7f84);const _0x450b47=this[_0xa25d53(0x24e)]();_0x5cb968=_0x450b47+'_'+generateRandomHex();continue;}throw _0x1b7f84;}}throw new SDKError(ErrorCode['INTERNAL'],_0xa25d53(0x152));}async[a134_0x1c689f(0x1e9)](_0x2fc1e1,_0x4e4de8){const _0x1e5a4d=a134_0x1c689f,_0x395009=_0x4e4de8||this[_0x1e5a4d(0x17e)],_0x2dd3af=await this[_0x1e5a4d(0x1ff)][_0x1e5a4d(0x183)](_0x395009),_0x18c6c5=_0x2dd3af[_0x1e5a4d(0x157)](_0x3cebba=>_0x3cebba[_0x1e5a4d(0x1a3)][_0x1e5a4d(0x204)]===_0x2fc1e1);if(_0x18c6c5[_0x1e5a4d(0x181)]===0x0){const _0x3b3f24=_0x395009?_0x1e5a4d(0x1b7)+_0x395009:'';throw new SDKError(ErrorCode[_0x1e5a4d(0x202)],_0x1e5a4d(0x1a5)+_0x2fc1e1+_0x3b3f24,undefined,{'helpText':_0x395009?_0x1e5a4d(0x1b0):_0x1e5a4d(0x221)});}if(_0x18c6c5['length']>0x1)throw new SDKError(ErrorCode['INTERNAL'],_0x1e5a4d(0x244)+_0x2fc1e1+_0x1e5a4d(0x223));return _0x18c6c5[0x0]['id'];}async['agents'](_0x2658b9){const _0x35a49a=a134_0x1c689f,_0x5b6395=_0x2658b9||this[_0x35a49a(0x17e)];return await this[_0x35a49a(0x1ff)]['listAgents'](_0x5b6395);}async[a134_0x1c689f(0x1a0)](_0x56e780){const _0x4000d3=a134_0x1c689f;return await this[_0x4000d3(0x1ff)][_0x4000d3(0x162)](_0x56e780);}async['agent'](_0x37c288){const _0x19b521=a134_0x1c689f;return await this['client'][_0x19b521(0x1f1)](_0x37c288);}async[a134_0x1c689f(0x22d)](_0x4a359d){const _0x1cbc8f=a134_0x1c689f;return await this[_0x1cbc8f(0x1ff)][_0x1cbc8f(0x22d)](_0x4a359d);}async[a134_0x1c689f(0x1aa)](_0x57199c,_0x14b0b5){const _0x448fe2=a134_0x1c689f;return await this['client'][_0x448fe2(0x1aa)](_0x57199c,_0x14b0b5);}async[a134_0x1c689f(0x21b)](_0x4b8488){const _0x2a465a=a134_0x1c689f;await this[_0x2a465a(0x1ff)][_0x2a465a(0x21b)](_0x4b8488);}async[a134_0x1c689f(0x1b4)](_0x2b2d85){const _0x3f8011=a134_0x1c689f;return await this['client'][_0x3f8011(0x1b4)]({'agentId':_0x2b2d85});}async*[a134_0x1c689f(0x21f)](_0x4ee459,_0xd538b0){const _0x3c0a74=a134_0x1c689f;let _0x267302=_0xd538b0?.['chatId'];const _0x18c193=_0xd538b0?.[_0x3c0a74(0x16f)];if(!_0x267302){if(!_0x18c193)throw new Error(_0x3c0a74(0x200));const _0x5bb109=await this['client'][_0x3c0a74(0x1b4)]({'agentId':_0x18c193});_0x267302=_0x5bb109['id'],yield{'type':_0x3c0a74(0x1bf),'data':{'chatId':_0x267302,'agentId':_0x18c193,'projectId':_0x5bb109['attributes'][_0x3c0a74(0x22f)]}};}for await(const _0x1b4e02 of this[_0x3c0a74(0x1ff)][_0x3c0a74(0x1e1)](_0x267302,_0x4ee459,_0xd538b0?.[_0x3c0a74(0x23e)])){yield{'type':_0x3c0a74(0x1f6),'data':_0x1b4e02};}}async[a134_0x1c689f(0x247)](_0x130b7f=0x32){const _0x283600=a134_0x1c689f;return await this[_0x283600(0x1ff)]['listChats'](_0x130b7f);}async[a134_0x1c689f(0x16b)](_0x523869){const _0x255e36=a134_0x1c689f;return await this[_0x255e36(0x1ff)][_0x255e36(0x1f0)](_0x523869);}async[a134_0x1c689f(0x132)](_0x3e87c0){const _0x18bb81=a134_0x1c689f;return await this[_0x18bb81(0x1ff)]['getChatLog'](_0x3e87c0);}async[a134_0x1c689f(0x222)](_0x5eb7ed){const _0x1dcc5c=a134_0x1c689f;return await this[_0x1dcc5c(0x1ff)]['getChatInfo'](_0x5eb7ed);}async[a134_0x1c689f(0x156)](_0x318f8c,_0x4fd07b,_0x205a50){const _0x10f241=a134_0x1c689f,_0x24bd2d=_0x205a50?.['dryRun']??![],{projectId:_0x1e6b22,project:_0x28650e}=await this[_0x10f241(0x1e0)](_0x318f8c),_0x3f21b2=_0x28650e[_0x10f241(0x1a3)][_0x10f241(0x204)],_0x591811=_0x4fd07b||_0x3f21b2+'.llm';if(a134_0x3a629b[_0x10f241(0x185)](_0x591811)&&!_0x24bd2d)throw new SDKError(ErrorCode[_0x10f241(0x213)],_0x10f241(0x240)+_0x591811,undefined,{'helpText':'Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.'});const _0x596c77=await this[_0x10f241(0x1ff)][_0x10f241(0x162)](_0x1e6b22),_0x285a3c=await this[_0x10f241(0x1ff)][_0x10f241(0x194)](_0x1e6b22),_0x6a7f96=await this[_0x10f241(0x1ff)]['listPrompts'](_0x1e6b22),_0x3c9d97=await this[_0x10f241(0x1ff)][_0x10f241(0x177)](_0x1e6b22);if(!_0x24bd2d){a134_0x3a629b[_0x10f241(0x248)](_0x591811,{'recursive':!![]});const _0x4a3f80={'version':_0x10f241(0x189),'exportedAt':new Date()['toISOString'](),'exportedFrom':{'site':this[_0x10f241(0x184)][_0x10f241(0x130)],'projectId':_0x1e6b22,'projectName':_0x3f21b2},'project':_0x28650e};a134_0x3a629b[_0x10f241(0x18b)](a134_0x70d920['join'](_0x591811,_0x10f241(0x133)),JSON[_0x10f241(0x236)](_0x4a3f80,null,0x2)),a134_0x3a629b[_0x10f241(0x18b)](a134_0x70d920['join'](_0x591811,_0x10f241(0x1bb)),JSON[_0x10f241(0x236)](_0x596c77,null,0x2)),a134_0x3a629b[_0x10f241(0x18b)](a134_0x70d920['join'](_0x591811,_0x10f241(0x16d)),JSON['stringify'](_0x285a3c,null,0x2)),a134_0x3a629b['writeFileSync'](a134_0x70d920[_0x10f241(0x17c)](_0x591811,_0x10f241(0x225)),JSON[_0x10f241(0x236)](_0x6a7f96,null,0x2)),a134_0x3a629b['writeFileSync'](a134_0x70d920[_0x10f241(0x17c)](_0x591811,_0x10f241(0x234)),JSON[_0x10f241(0x236)](_0x3c9d97,null,0x2));}return{'projectName':_0x3f21b2,'outputDir':_0x591811,'counts':{'agents':_0x596c77['length'],'knowledgeBases':_0x285a3c[_0x10f241(0x181)],'prompts':_0x6a7f96[_0x10f241(0x181)],'integrations':_0x3c9d97['length']}};}async[a134_0x1c689f(0x1f3)](_0x2edee6,_0x5485c6){const _0x3768b3=a134_0x1c689f,_0x14a344=_0x5485c6?.[_0x3768b3(0x166)]??![],_0x4aff83=this['getBackupMetadata'](_0x2edee6),_0x163bab=_0x4aff83[_0x3768b3(0x246)][_0x3768b3(0x130)],_0x49f11e=this[_0x3768b3(0x184)][_0x3768b3(0x130)],_0x11fae8=_0x163bab!==_0x49f11e?_0x163bab:undefined,_0x56d1e3=this[_0x3768b3(0x18e)](a134_0x70d920['join'](_0x2edee6,_0x3768b3(0x1bb)),[]),_0x4f839a=this[_0x3768b3(0x18e)](a134_0x70d920['join'](_0x2edee6,_0x3768b3(0x16d)),[]),_0x32be8a=this[_0x3768b3(0x18e)](a134_0x70d920[_0x3768b3(0x17c)](_0x2edee6,_0x3768b3(0x225)),[]),_0x11b26a=this['loadJsonFile'](a134_0x70d920[_0x3768b3(0x17c)](_0x2edee6,'integrations.json'),[]),_0x39ede0=_0x5485c6?.[_0x3768b3(0x204)]||_0x4aff83[_0x3768b3(0x246)]['projectName'];if(_0x14a344){const _0x278f39=new Map(),_0x52c3fb=[..._0x56d1e3],_0x4a7fda=_0x56d1e3[_0x3768b3(0x181)]+0x1;let _0x431473=0x0;while(_0x52c3fb[_0x3768b3(0x181)]>0x0&&_0x431473<_0x4a7fda){_0x431473++;const _0xa8f56c=[];for(const _0x1fc30e of _0x52c3fb){canCreateAgent(_0x1fc30e,_0x278f39)?_0x278f39['set'](_0x1fc30e['id'],_0x3768b3(0x1da)+_0x1fc30e['id']):_0xa8f56c[_0x3768b3(0x1ea)](_0x1fc30e);}if(_0xa8f56c['length']===_0x52c3fb[_0x3768b3(0x181)])throw new SDKError(ErrorCode[_0x3768b3(0x12e)],_0x3768b3(0x153),undefined,{'helpText':_0x3768b3(0x235)});_0x52c3fb[_0x3768b3(0x181)]=0x0,_0x52c3fb[_0x3768b3(0x1ea)](..._0xa8f56c);}const _0x11c59f=_0x32be8a[_0x3768b3(0x157)](_0x4c3f63=>_0x278f39[_0x3768b3(0x232)](_0x4c3f63['attributes'][_0x3768b3(0x16f)]))[_0x3768b3(0x181)];return{'projectName':_0x39ede0,'projectId':'(dry-run)','counts':{'agents':_0x56d1e3[_0x3768b3(0x181)],'knowledgeBases':_0x4f839a[_0x3768b3(0x181)],'prompts':_0x11c59f,'integrations':_0x11b26a[_0x3768b3(0x181)]},'sourceSite':_0x11fae8};}const _0x4772d1=await this['client']['createProject']({'name':_0x39ede0,'description':_0x4aff83['project'][_0x3768b3(0x1a3)][_0x3768b3(0x1f5)]}),_0x33eaf8=_0x4772d1['id'],_0x4b1ff7=new Map(),_0x4c691c=new Map(),_0x3fc3c1=new Map();for(const _0x4fa712 of _0x4f839a){const _0x981190=await this['client'][_0x3768b3(0x165)]({'projectId':_0x33eaf8,'name':_0x4fa712[_0x3768b3(0x1a3)]['name'],'tdDatabaseName':_0x4fa712[_0x3768b3(0x1a3)][_0x3768b3(0x20a)],'tables':_0x4fa712[_0x3768b3(0x1a3)][_0x3768b3(0x140)]});_0x4b1ff7[_0x3768b3(0x252)](_0x4fa712['id'],_0x981190['id']);}const _0x2a6cc3=[..._0x56d1e3],_0x2baecb=_0x56d1e3[_0x3768b3(0x181)]+0x1;let _0x319d35=0x0;while(_0x2a6cc3[_0x3768b3(0x181)]>0x0&&_0x319d35<_0x2baecb){_0x319d35++;const _0x12e56b=[];for(const _0x5a4a46 of _0x2a6cc3){if(canCreateAgent(_0x5a4a46,_0x4c691c)){const _0x3d5b8e=remapToolIds(_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x208)],_0x4b1ff7,_0x4c691c),_0x5db6d0=remapVariableIds(_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x1eb)],_0x4b1ff7),_0x4fbf13=await this['client'][_0x3768b3(0x1e2)]({'name':_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x204)],'projectId':_0x33eaf8,'systemPrompt':_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x168)],'starterMessage':_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x148)],'modelType':migrateModelType(_0x5a4a46[_0x3768b3(0x1a3)]['modelType']),'maxToolIterations':_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x14d)],'temperature':_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x161)],'reasoningEffort':_0x5a4a46[_0x3768b3(0x1a3)][_0x3768b3(0x15a)],'outputs':_0x5a4a46['attributes']['outputs'],'tools':_0x3d5b8e,'variables':_0x5db6d0});_0x4c691c[_0x3768b3(0x252)](_0x5a4a46['id'],_0x4fbf13['id']);}else _0x12e56b['push'](_0x5a4a46);}if(_0x12e56b[_0x3768b3(0x181)]===_0x2a6cc3[_0x3768b3(0x181)])throw new SDKError(ErrorCode[_0x3768b3(0x12e)],'Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.',undefined,{'helpText':'The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.'});_0x2a6cc3[_0x3768b3(0x181)]=0x0,_0x2a6cc3[_0x3768b3(0x1ea)](..._0x12e56b);}for(const _0x57b818 of _0x32be8a){const _0x3722a1=_0x4c691c[_0x3768b3(0x20f)](_0x57b818[_0x3768b3(0x1a3)][_0x3768b3(0x16f)]);if(!_0x3722a1)continue;const _0x56fb81=await this[_0x3768b3(0x1ff)][_0x3768b3(0x1d4)]({'projectId':_0x33eaf8,'agentId':_0x3722a1,'name':_0x57b818[_0x3768b3(0x1a3)][_0x3768b3(0x204)],'systemPrompt':_0x57b818['attributes'][_0x3768b3(0x168)],'template':_0x57b818[_0x3768b3(0x1a3)][_0x3768b3(0x22b)],'jsonSchemaHint':_0x57b818[_0x3768b3(0x1a3)]['jsonSchemaHint']});_0x3fc3c1[_0x3768b3(0x252)](_0x57b818['id'],_0x56fb81['id']);}for(const _0x142437 of _0x11b26a){const _0x36cf89=_0x142437[_0x3768b3(0x1a3)][_0x3768b3(0x1d9)]['map'](_0x24bc58=>({..._0x24bc58,'promptId':_0x3fc3c1['get'](_0x24bc58[_0x3768b3(0x147)])||_0x24bc58[_0x3768b3(0x147)]}));await this[_0x3768b3(0x1ff)][_0x3768b3(0x1c5)]({'projectId':_0x33eaf8,'serviceType':_0x142437[_0x3768b3(0x1a3)][_0x3768b3(0x19c)],'actions':_0x36cf89,'slackMessageMode':_0x142437[_0x3768b3(0x1a3)]['slackMessageMode'],'chatIgnoreManagedActions':_0x142437[_0x3768b3(0x1a3)]['chatIgnoreManagedActions'],'chatWelcomeMessage':_0x142437[_0x3768b3(0x1a3)][_0x3768b3(0x1b1)],'webhookCorsOrigins':_0x142437[_0x3768b3(0x1a3)][_0x3768b3(0x155)]});}return{'projectName':_0x39ede0,'projectId':_0x33eaf8,'counts':{'agents':_0x4c691c[_0x3768b3(0x1c6)],'knowledgeBases':_0x4b1ff7['size'],'prompts':_0x3fc3c1[_0x3768b3(0x1c6)],'integrations':_0x11b26a[_0x3768b3(0x181)]},'sourceSite':_0x11fae8};}[a134_0x1c689f(0x18e)](_0x185f89,_0x35bb13){const _0x276dfc=a134_0x1c689f;if(!a134_0x3a629b[_0x276dfc(0x185)](_0x185f89))return _0x35bb13;return JSON[_0x276dfc(0x1ad)](a134_0x3a629b[_0x276dfc(0x188)](_0x185f89,'utf-8'));}[a134_0x1c689f(0x217)](_0x1e64d6){const _0x5211b2=a134_0x1c689f;if(!a134_0x3a629b[_0x5211b2(0x185)](_0x1e64d6))throw new SDKError(ErrorCode['NOT_FOUND'],_0x5211b2(0x1c3)+_0x1e64d6,undefined,{'helpText':'Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.'});const _0x2306af=a134_0x70d920[_0x5211b2(0x17c)](_0x1e64d6,_0x5211b2(0x133));if(!a134_0x3a629b[_0x5211b2(0x185)](_0x2306af))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20'+_0x1e64d6,undefined,{'helpText':_0x5211b2(0x160)});const _0x860652=JSON[_0x5211b2(0x1ad)](a134_0x3a629b[_0x5211b2(0x188)](_0x2306af,_0x5211b2(0x154)));if(!isSupportedBackupVersion(_0x860652[_0x5211b2(0x131)]))throw new SDKError(ErrorCode[_0x5211b2(0x1ae)],_0x5211b2(0x245)+_0x860652['version'],undefined,{'helpText':_0x5211b2(0x176)});return _0x860652;}async[a134_0x1c689f(0x179)](_0x153eda,_0x4b1e7e,_0x1a9a5a){const _0x28a22a=a134_0x1c689f,{projectId:_0x2ea5a5,project:_0x5c4232}=await this['resolveProjectName'](_0x153eda),_0x3801b5=_0x5c4232['attributes'][_0x28a22a(0x204)];let _0x1a2055;if(_0x4b1e7e)_0x1a2055=_0x4b1e7e;else{const _0x1b2be4=a134_0x70d920[_0x28a22a(0x17c)](process[_0x28a22a(0x145)](),_0x28a22a(0x163)),_0x5054f3=getSanitizedPathWithMigration(_0x1b2be4,_0x3801b5);_0x5054f3[_0x28a22a(0x151)]&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)](_0x28a22a(0x150)+a134_0x70d920['basename'](_0x5054f3[_0x28a22a(0x1b8)])+_0x28a22a(0x199)+a134_0x70d920['basename'](_0x5054f3[_0x28a22a(0x212)])),_0x1a2055=_0x5054f3[_0x28a22a(0x212)];}const _0x299101=await this[_0x28a22a(0x1ff)][_0x28a22a(0x162)](_0x2ea5a5),_0x15c836=await this['client'][_0x28a22a(0x194)](_0x2ea5a5),_0x36f1d4=await this[_0x28a22a(0x1ff)][_0x28a22a(0x1a8)](_0x2ea5a5),_0x3cd3a9=await safeListOrEmpty(()=>this['client'][_0x28a22a(0x15c)](_0x2ea5a5)),_0xa86c53=await safeListOrEmpty(()=>this[_0x28a22a(0x1ff)][_0x28a22a(0x1dd)](_0x2ea5a5)),_0xe6bb5c=await this[_0x28a22a(0x1ff)][_0x28a22a(0x174)](_0x2ea5a5),_0x553f74=await this['client']['listIntegrations'](_0x2ea5a5),_0x194274=await safeListOrEmpty(()=>this[_0x28a22a(0x1ff)][_0x28a22a(0x173)](_0x2ea5a5)),_0x513668=await safeListOrEmpty(()=>this[_0x28a22a(0x1ff)]['listExperimentalArtifacts'](_0x2ea5a5)),_0x13237f=await safeListOrEmpty(()=>this['client'][_0x28a22a(0x205)](_0x2ea5a5)),_0x1300e0=await safeListOrEmpty(()=>this[_0x28a22a(0x1ff)][_0x28a22a(0x16a)](_0x2ea5a5)),_0x1c81d2=_0x553f74['filter'](_0x49defb=>!_0x49defb[_0x28a22a(0x1a3)][_0x28a22a(0x14e)]&&SAFE_INTEGRATION_TYPES[_0x28a22a(0x21a)](_0x49defb[_0x28a22a(0x1a3)][_0x28a22a(0x19c)]['toLowerCase']())),_0x5512fa=new Map(),_0x1468da=new Map(),_0x2239f5=new Map(),_0x3c1922=new Map(),_0x49c179=new Map(),_0x15cb34=new Map(),_0x2c1ed7=new Map();for(const _0x1479c7 of _0x299101){_0x5512fa[_0x28a22a(0x252)](_0x1479c7['id'],_0x1479c7['attributes'][_0x28a22a(0x204)]);}for(const _0x143800 of _0x15c836){_0x1468da[_0x28a22a(0x252)](_0x143800['id'],_0x143800[_0x28a22a(0x1a3)][_0x28a22a(0x204)]);}for(const _0x5183e4 of _0x36f1d4){_0x2239f5[_0x28a22a(0x252)](_0x5183e4['id'],_0x5183e4[_0x28a22a(0x1a3)][_0x28a22a(0x204)]);}for(const _0x3e801f of _0x3cd3a9){_0x3c1922[_0x28a22a(0x252)](_0x3e801f['id'],_0x3e801f[_0x28a22a(0x1a3)]['name']);}for(const _0x34ae03 of _0xa86c53){_0x49c179[_0x28a22a(0x252)](_0x34ae03['id'],_0x34ae03['attributes'][_0x28a22a(0x204)]);}for(const _0x49e1fb of _0xe6bb5c){_0x15cb34['set'](_0x49e1fb['id'],_0x49e1fb[_0x28a22a(0x1a3)][_0x28a22a(0x204)]);}for(const _0x3441e6 of _0x194274){_0x2c1ed7[_0x28a22a(0x252)](_0x3441e6['id'],_0x3441e6[_0x28a22a(0x1a3)][_0x28a22a(0x204)]);}const _0x552e6d={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x1468da,'TextKnowledgeBase':_0x2239f5,'Agent':_0x5512fa,'WebSearchTool':_0x49c179,'ImageGenerator':_0x3c1922,'ExperimentalKnowledgeBase':_0x2c1ed7}),'resolvePromptName':async _0x23599a=>_0x15cb34[_0x28a22a(0x20f)](_0x23599a),'onWarning':_0x899d40=>this[_0x28a22a(0x1d3)][_0x28a22a(0x226)](_0x899d40)},_0x14bffa={'projectName':_0x3801b5,'outputDir':_0x1a2055,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'formInterfaces':[],'chatInterfaces':[],'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},'formInterfaces':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'chatInterfaces':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0}}},_0x2e574f=[],_0x2b7446=[];for(const _0x153680 of _0x299101){const _0x3aaf56=getSanitizedPathWithMigration(_0x1a2055,_0x153680[_0x28a22a(0x1a3)][_0x28a22a(0x204)]);_0x3aaf56[_0x28a22a(0x151)]&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)]('Renamed\x20agent\x20folder:\x20'+a134_0x70d920[_0x28a22a(0x142)](_0x3aaf56[_0x28a22a(0x1b8)])+_0x28a22a(0x199)+a134_0x70d920[_0x28a22a(0x142)](_0x3aaf56[_0x28a22a(0x212)]));const _0x5e4db0=_0x3aaf56[_0x28a22a(0x212)],_0x3352fc=a134_0x70d920[_0x28a22a(0x17c)](_0x5e4db0,_0x28a22a(0x15d)),_0x5320e9=a134_0x70d920[_0x28a22a(0x17c)](_0x5e4db0,_0x28a22a(0x211)),_0x14f2ca=a134_0x70d920['join'](_0x5e4db0,_0x28a22a(0x210)),{yaml:_0x2f097d,systemPrompt:_0xb3cc52,starterMessage:_0x42c615}=await agentResponseToDef(_0x153680,_0x552e6d),_0x52d5ea=toAgentYamlString(_0x2f097d),_0x1a3306=!a134_0x3a629b[_0x28a22a(0x185)](_0x5320e9);let _0x1e7f1b=_0x1a3306,_0xaac732;if(!_0x1a3306){const _0xed7ee3=a134_0x3a629b[_0x28a22a(0x185)](_0x3352fc)?a134_0x3a629b[_0x28a22a(0x188)](_0x3352fc,_0x28a22a(0x154)):'',_0x3618ea=a134_0x3a629b[_0x28a22a(0x188)](_0x5320e9,_0x28a22a(0x154)),_0x18c767=_0x28a22a(0x250)+_0xed7ee3+'\x0a\x0a#\x20agent.yml\x0a'+_0x3618ea,_0x589c65='#\x20prompt.md\x0a'+_0xb3cc52+_0x28a22a(0x187)+_0x52d5ea,_0x1311bf=generateDiff(_0x18c767,_0x589c65);_0x1e7f1b=hasChanges(_0x1311bf),_0x1e7f1b&&(_0xaac732=formatDiffWithColors(_0x1311bf));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x5e4db0,'content':'','isDir':!![]}),_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x3352fc,'content':_0xb3cc52}),_0x2e574f['push']({'path':_0x5320e9,'content':_0x52d5ea});_0x42c615&&_0x42c615[_0x28a22a(0x21a)]('\x0a')&&_0x2e574f['push']({'path':_0x14f2ca,'content':_0x42c615});_0x14bffa[_0x28a22a(0x163)][_0x28a22a(0x1ea)]({'agentName':_0x153680['attributes'][_0x28a22a(0x204)],'outputPath':_0x5e4db0,'isNew':_0x1a3306,'hasChanges':_0x1e7f1b,'diff':_0xaac732}),_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x163)][_0x28a22a(0x1c4)]++;if(_0x1a3306)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x163)][_0x28a22a(0x24f)]++;else{if(_0x1e7f1b)_0x14bffa['counts'][_0x28a22a(0x163)]['updated']++;else _0x14bffa['counts'][_0x28a22a(0x163)][_0x28a22a(0x1f9)]++;}}for(const _0x47342f of _0x15c836){if(_0x47342f[_0x28a22a(0x1a3)][_0x28a22a(0x14e)])continue;const _0x312293=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x1a2055),_0x47342f[_0x28a22a(0x1a3)]['name'],_0x28a22a(0x192));_0x312293[_0x28a22a(0x151)]&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)]('Renamed\x20KB\x20file:\x20'+a134_0x70d920[_0x28a22a(0x142)](_0x312293[_0x28a22a(0x1b8)])+_0x28a22a(0x199)+a134_0x70d920[_0x28a22a(0x142)](_0x312293[_0x28a22a(0x212)]));const _0x2251f7=_0x312293[_0x28a22a(0x212)],_0x59d792=apiKnowledgeBaseToYaml(_0x47342f),_0x2b88c7=toKnowledgeBaseYamlString(_0x59d792),_0x5b7718=!a134_0x3a629b[_0x28a22a(0x185)](_0x2251f7);let _0x314afa=_0x5b7718,_0x486599;if(!_0x5b7718){const _0x5819c8=a134_0x3a629b[_0x28a22a(0x188)](_0x2251f7,'utf-8'),_0x20d575=generateDiff(_0x5819c8,_0x2b88c7);_0x314afa=hasChanges(_0x20d575),_0x314afa&&(_0x486599=formatDiffWithColors(_0x20d575));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x2251f7,'content':_0x2b88c7}),_0x14bffa['knowledgeBases'][_0x28a22a(0x1ea)]({'name':_0x47342f[_0x28a22a(0x1a3)][_0x28a22a(0x204)],'outputPath':_0x2251f7,'isNew':_0x5b7718,'hasChanges':_0x314afa,'diff':_0x486599}),_0x14bffa['counts'][_0x28a22a(0x24c)][_0x28a22a(0x1c4)]++;if(_0x5b7718)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x24c)]['new']++;else{if(_0x314afa)_0x14bffa['counts'][_0x28a22a(0x24c)][_0x28a22a(0x242)]++;else _0x14bffa['counts'][_0x28a22a(0x24c)]['unchanged']++;}}for(const _0x23c95f of _0x36f1d4){if(_0x23c95f[_0x28a22a(0x1a3)][_0x28a22a(0x14e)])continue;const _0x1fadaa=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x1a2055),_0x23c95f[_0x28a22a(0x1a3)][_0x28a22a(0x204)],_0x28a22a(0x1df));_0x1fadaa['renamed']&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)](_0x28a22a(0x13d)+a134_0x70d920[_0x28a22a(0x142)](_0x1fadaa['oldPath'])+_0x28a22a(0x199)+a134_0x70d920[_0x28a22a(0x142)](_0x1fadaa[_0x28a22a(0x212)]));const _0x1fde62=_0x1fadaa[_0x28a22a(0x212)],_0x361c5e=toTextKnowledgeBaseMd(_0x23c95f[_0x28a22a(0x1a3)][_0x28a22a(0x204)],_0x23c95f[_0x28a22a(0x1a3)][_0x28a22a(0x1d5)]),_0x4bac0e=!a134_0x3a629b[_0x28a22a(0x185)](_0x1fde62);let _0x25e154=_0x4bac0e,_0x259c0f;if(!_0x4bac0e){const _0x477d47=a134_0x3a629b[_0x28a22a(0x188)](_0x1fde62,_0x28a22a(0x154)),_0x50ab85=generateDiff(_0x477d47,_0x361c5e);_0x25e154=hasChanges(_0x50ab85),_0x25e154&&(_0x259c0f=formatDiffWithColors(_0x50ab85));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x1fde62,'content':_0x361c5e}),_0x14bffa[_0x28a22a(0x144)][_0x28a22a(0x1ea)]({'name':_0x23c95f[_0x28a22a(0x1a3)][_0x28a22a(0x204)],'outputPath':_0x1fde62,'isNew':_0x4bac0e,'hasChanges':_0x25e154,'diff':_0x259c0f}),_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x144)][_0x28a22a(0x1c4)]++;if(_0x4bac0e)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x144)][_0x28a22a(0x24f)]++;else{if(_0x25e154)_0x14bffa['counts'][_0x28a22a(0x144)]['updated']++;else _0x14bffa[_0x28a22a(0x1de)]['textKnowledgeBases'][_0x28a22a(0x1f9)]++;}}for(const _0x35b1b2 of _0xe6bb5c){if(_0x35b1b2['attributes'][_0x28a22a(0x14e)])continue;const _0x5812db=getSanitizedPathWithMigration(getPromptsDir(_0x1a2055),_0x35b1b2[_0x28a22a(0x1a3)][_0x28a22a(0x204)],_0x28a22a(0x192));_0x5812db[_0x28a22a(0x151)]&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)](_0x28a22a(0x1b3)+a134_0x70d920[_0x28a22a(0x142)](_0x5812db[_0x28a22a(0x1b8)])+'\x20→\x20'+a134_0x70d920[_0x28a22a(0x142)](_0x5812db[_0x28a22a(0x212)]));const _0x360457=_0x5812db[_0x28a22a(0x212)],_0x3953d8=await apiPromptToYaml(_0x35b1b2,_0x552e6d);if(!_0x3953d8)continue;const _0x2fab57=toPromptYamlString(_0x3953d8),_0x5ada3f=!a134_0x3a629b[_0x28a22a(0x185)](_0x360457);let _0x4e6ed1=_0x5ada3f,_0x4408fe;if(!_0x5ada3f){const _0x43bb18=a134_0x3a629b['readFileSync'](_0x360457,_0x28a22a(0x154)),_0x2e3bb7=generateDiff(_0x43bb18,_0x2fab57);_0x4e6ed1=hasChanges(_0x2e3bb7),_0x4e6ed1&&(_0x4408fe=formatDiffWithColors(_0x2e3bb7));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x360457,'content':_0x2fab57}),_0x14bffa[_0x28a22a(0x1fc)]['push']({'name':_0x35b1b2[_0x28a22a(0x1a3)][_0x28a22a(0x204)],'outputPath':_0x360457,'isNew':_0x5ada3f,'hasChanges':_0x4e6ed1,'diff':_0x4408fe}),_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x1fc)][_0x28a22a(0x1c4)]++;if(_0x5ada3f)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x1fc)][_0x28a22a(0x24f)]++;else{if(_0x4e6ed1)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x1fc)]['updated']++;else _0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x1fc)]['unchanged']++;}}for(const _0x4b351c of _0x1c81d2){const _0x59d60e=_0x4b351c[_0x28a22a(0x1a3)]['serviceType'][_0x28a22a(0x238)](),_0x4546dc=getSanitizedPathWithMigration(getIntegrationsDir(_0x1a2055),_0x59d60e,_0x28a22a(0x192));_0x4546dc[_0x28a22a(0x151)]&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)](_0x28a22a(0x138)+a134_0x70d920[_0x28a22a(0x142)](_0x4546dc[_0x28a22a(0x1b8)])+_0x28a22a(0x199)+a134_0x70d920[_0x28a22a(0x142)](_0x4546dc['path']));const _0x167273=_0x4546dc[_0x28a22a(0x212)],_0x6a6d88=await apiIntegrationToYaml(_0x4b351c,_0x552e6d),_0x3ab6d7=toIntegrationYamlString(_0x6a6d88),_0x31032d=!a134_0x3a629b[_0x28a22a(0x185)](_0x167273);let _0x2bdd1f=_0x31032d,_0x206a93;if(!_0x31032d){const _0x1f0bcc=a134_0x3a629b[_0x28a22a(0x188)](_0x167273,'utf-8'),_0x8be381=generateDiff(_0x1f0bcc,_0x3ab6d7);_0x2bdd1f=hasChanges(_0x8be381),_0x2bdd1f&&(_0x206a93=formatDiffWithColors(_0x8be381));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x167273,'content':_0x3ab6d7}),_0x14bffa[_0x28a22a(0x17b)][_0x28a22a(0x1ea)]({'name':_0x59d60e,'outputPath':_0x167273,'isNew':_0x31032d,'hasChanges':_0x2bdd1f,'diff':_0x206a93}),_0x14bffa[_0x28a22a(0x1de)]['integrations']['total']++;if(_0x31032d)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x17b)]['new']++;else{if(_0x2bdd1f)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x17b)][_0x28a22a(0x242)]++;else _0x14bffa[_0x28a22a(0x1de)]['integrations'][_0x28a22a(0x1f9)]++;}}for(const _0x571671 of _0x194274){if(_0x571671[_0x28a22a(0x1a3)]['isManaged'])continue;const _0x449150=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x1a2055),_0x571671[_0x28a22a(0x1a3)][_0x28a22a(0x204)]);_0x449150[_0x28a22a(0x151)]&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)](_0x28a22a(0x1ac)+a134_0x70d920[_0x28a22a(0x142)](_0x449150[_0x28a22a(0x1b8)])+_0x28a22a(0x199)+a134_0x70d920[_0x28a22a(0x142)](_0x449150[_0x28a22a(0x212)]));const _0x15affe=_0x449150[_0x28a22a(0x212)],_0x377ba1=a134_0x70d920[_0x28a22a(0x17c)](_0x15affe,sanitizeForFilesystem(_0x571671[_0x28a22a(0x1a3)][_0x28a22a(0x204)])+_0x28a22a(0x192)),_0x20db81=a134_0x70d920[_0x28a22a(0x17c)](_0x15affe,_0x28a22a(0x22c)),_0x4c578b=apiExperimentalKnowledgeBaseToYaml(_0x571671),_0x4127c0=toExperimentalKnowledgeBaseYamlString(_0x4c578b),_0x3554e2=!a134_0x3a629b[_0x28a22a(0x185)](_0x15affe);let _0x286169=_0x3554e2,_0x13216d,_0x3039dd=_0x4127c0;const _0xe887da=[..._0x4c578b['functions']][_0x28a22a(0x1d8)]((_0x3b5927,_0x2023e0)=>_0x3b5927[_0x28a22a(0x204)][_0x28a22a(0x18a)](_0x2023e0[_0x28a22a(0x204)]));for(const _0x208872 of _0xe887da){_0x3039dd+=_0x28a22a(0x1fa)+_0x208872[_0x28a22a(0x204)]+'\x20---\x0a'+_0x208872[_0x28a22a(0x21d)]+'\x0a---\x20schema:\x20'+_0x208872[_0x28a22a(0x204)]+_0x28a22a(0x169)+_0x208872[_0x28a22a(0x1bc)]+'\x0a';}if(!_0x3554e2){let _0x8476b4='';a134_0x3a629b[_0x28a22a(0x185)](_0x377ba1)&&(_0x8476b4=a134_0x3a629b[_0x28a22a(0x188)](_0x377ba1,_0x28a22a(0x154)));if(a134_0x3a629b[_0x28a22a(0x185)](_0x20db81)){const _0x4e9f92=a134_0x3a629b['readdirSync'](_0x20db81,{'withFileTypes':!![]}),_0xc4577=_0x4e9f92[_0x28a22a(0x157)](_0x4ccc63=>_0x4ccc63['isDirectory']())[_0x28a22a(0x1d8)]((_0x4f3e42,_0x1bc9fc)=>_0x4f3e42['name'][_0x28a22a(0x18a)](_0x1bc9fc[_0x28a22a(0x204)]));for(const _0xaee4fd of _0xc4577){const _0x42fee2=a134_0x70d920[_0x28a22a(0x17c)](_0x20db81,_0xaee4fd['name'],_0x28a22a(0x22e)),_0x1e57d0=a134_0x70d920[_0x28a22a(0x17c)](_0x20db81,_0xaee4fd[_0x28a22a(0x204)],_0x28a22a(0x14a));a134_0x3a629b[_0x28a22a(0x185)](_0x42fee2)&&(_0x8476b4+=_0x28a22a(0x1fa)+_0xaee4fd[_0x28a22a(0x204)]+'\x20---\x0a'+a134_0x3a629b['readFileSync'](_0x42fee2,_0x28a22a(0x154))+'\x0a'),a134_0x3a629b['existsSync'](_0x1e57d0)&&(_0x8476b4+='---\x20schema:\x20'+_0xaee4fd[_0x28a22a(0x204)]+_0x28a22a(0x169)+a134_0x3a629b[_0x28a22a(0x188)](_0x1e57d0,_0x28a22a(0x154))+'\x0a');}}const _0x31112c=generateDiff(_0x8476b4,_0x3039dd);_0x286169=hasChanges(_0x31112c),_0x286169&&(_0x13216d=formatDiffWithColors(_0x31112c));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x15affe,'content':'','isDir':!![]}),_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x377ba1,'content':_0x4127c0}),_0x2e574f['push']({'path':_0x20db81,'content':'','isDir':!![]});for(const _0x5d0b9a of _0x4c578b[_0x28a22a(0x22c)]){const _0x1556d5=a134_0x70d920[_0x28a22a(0x17c)](_0x20db81,sanitizeForFilesystem(_0x5d0b9a['name'])),_0x1d3db1=a134_0x70d920[_0x28a22a(0x17c)](_0x1556d5,_0x28a22a(0x22e)),_0x1cb188=a134_0x70d920[_0x28a22a(0x17c)](_0x1556d5,'json_schema.json');_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x1556d5,'content':'','isDir':!![]}),_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x1d3db1,'content':_0x5d0b9a['code']}),_0x2e574f['push']({'path':_0x1cb188,'content':_0x5d0b9a[_0x28a22a(0x1bc)]});}if(a134_0x3a629b[_0x28a22a(0x185)](_0x20db81)){const _0x2e323b=a134_0x3a629b[_0x28a22a(0x230)](_0x20db81,{'withFileTypes':!![]}),_0x180c7a=new Set(_0x4c578b[_0x28a22a(0x22c)][_0x28a22a(0x171)](_0x53aa45=>sanitizeForFilesystem(_0x53aa45[_0x28a22a(0x204)])));for(const _0x4a140e of _0x2e323b){if(_0x4a140e['isDirectory']()&&!_0x180c7a[_0x28a22a(0x232)](_0x4a140e[_0x28a22a(0x204)])){const _0x337106=a134_0x70d920[_0x28a22a(0x17c)](_0x20db81,_0x4a140e['name']);_0x2b7446[_0x28a22a(0x1ea)]({'path':_0x337106,'isDir':!![]});}}}_0x14bffa[_0x28a22a(0x23d)][_0x28a22a(0x1ea)]({'name':_0x571671[_0x28a22a(0x1a3)][_0x28a22a(0x204)],'outputPath':_0x15affe,'isNew':_0x3554e2,'hasChanges':_0x286169,'diff':_0x13216d}),_0x14bffa['counts']['experimentalKnowledgeBases'][_0x28a22a(0x1c4)]++;if(_0x3554e2)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x23d)][_0x28a22a(0x24f)]++;else{if(_0x286169)_0x14bffa['counts'][_0x28a22a(0x23d)][_0x28a22a(0x242)]++;else _0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x23d)][_0x28a22a(0x1f9)]++;}}for(const _0xe256a9 of _0x513668){if(_0xe256a9['attributes'][_0x28a22a(0x14e)])continue;const _0x86202c=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x1a2055),_0xe256a9['attributes'][_0x28a22a(0x204)]);_0x86202c['renamed']&&this['logger'][_0x28a22a(0x13a)]('Renamed\x20experimental\x20artifact\x20directory:\x20'+a134_0x70d920[_0x28a22a(0x142)](_0x86202c['oldPath'])+'\x20→\x20'+a134_0x70d920[_0x28a22a(0x142)](_0x86202c[_0x28a22a(0x212)]));const _0x417332=_0x86202c[_0x28a22a(0x212)],_0x94f91=a134_0x70d920[_0x28a22a(0x17c)](_0x417332,sanitizeForFilesystem(_0xe256a9[_0x28a22a(0x1a3)][_0x28a22a(0x204)])+_0x28a22a(0x192)),_0x4f105e=a134_0x70d920[_0x28a22a(0x17c)](_0x417332,_0x28a22a(0x22e)),_0x57e0c2=a134_0x70d920[_0x28a22a(0x17c)](_0x417332,_0x28a22a(0x1dc)),_0x3f1a18=apiExperimentalArtifactToYaml(_0xe256a9),_0x54e1ce=toExperimentalArtifactYamlString(_0x3f1a18),_0x169009=!a134_0x3a629b[_0x28a22a(0x185)](_0x417332);let _0x4b4e3f=_0x169009,_0x319a14,_0x55b785=_0x54e1ce+(_0x28a22a(0x1e7)+_0x3f1a18[_0x28a22a(0x21d)]+'\x0a');const _0x2775fe=[..._0x3f1a18[_0x28a22a(0x1dc)]][_0x28a22a(0x1d8)]((_0x254044,_0x46ff58)=>_0x254044[_0x28a22a(0x1c7)]['localeCompare'](_0x46ff58['file_name']));for(const _0x18eff2 of _0x2775fe){_0x55b785+=_0x28a22a(0x180)+_0x18eff2[_0x28a22a(0x1c7)]+_0x28a22a(0x169)+_0x18eff2[_0x28a22a(0x19a)]+'\x0a';}if(!_0x169009){let _0x4ed066='';a134_0x3a629b['existsSync'](_0x94f91)&&(_0x4ed066=a134_0x3a629b[_0x28a22a(0x188)](_0x94f91,_0x28a22a(0x154)));a134_0x3a629b[_0x28a22a(0x185)](_0x4f105e)&&(_0x4ed066+=_0x28a22a(0x1e7)+a134_0x3a629b[_0x28a22a(0x188)](_0x4f105e,_0x28a22a(0x154))+'\x0a');if(a134_0x3a629b[_0x28a22a(0x185)](_0x57e0c2)){const _0x177b28=a134_0x3a629b['readdirSync'](_0x57e0c2),_0x32942e=_0x177b28[_0x28a22a(0x157)](_0x2547ef=>{const _0x5cdc7b=_0x28a22a,_0x4ebcad=a134_0x70d920['join'](_0x57e0c2,_0x2547ef);return a134_0x3a629b[_0x5cdc7b(0x14b)](_0x4ebcad)[_0x5cdc7b(0x193)]();})['sort']((_0x44c9f7,_0x1b513f)=>_0x44c9f7[_0x28a22a(0x18a)](_0x1b513f));for(const _0x4c971e of _0x32942e){const _0x57eaf8=a134_0x70d920['join'](_0x57e0c2,_0x4c971e);_0x4ed066+=_0x28a22a(0x180)+_0x4c971e+_0x28a22a(0x169)+a134_0x3a629b['readFileSync'](_0x57eaf8,_0x28a22a(0x154))+'\x0a';}}const _0x382031=generateDiff(_0x4ed066,_0x55b785);_0x4b4e3f=hasChanges(_0x382031),_0x4b4e3f&&(_0x319a14=formatDiffWithColors(_0x382031));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x417332,'content':'','isDir':!![]}),_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x94f91,'content':_0x54e1ce}),_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x4f105e,'content':_0x3f1a18[_0x28a22a(0x21d)]});if(_0x3f1a18[_0x28a22a(0x1dc)]['length']>0x0){_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x57e0c2,'content':'','isDir':!![]});for(const _0x15e56e of _0x3f1a18['files']){const _0xd923b3=a134_0x70d920[_0x28a22a(0x17c)](_0x57e0c2,_0x15e56e[_0x28a22a(0x1c7)]);_0x2e574f[_0x28a22a(0x1ea)]({'path':_0xd923b3,'content':_0x15e56e[_0x28a22a(0x19a)]});}}if(a134_0x3a629b[_0x28a22a(0x185)](_0x57e0c2)){const _0x31e323=a134_0x3a629b[_0x28a22a(0x230)](_0x57e0c2),_0x5fc040=new Set(_0x3f1a18[_0x28a22a(0x1dc)][_0x28a22a(0x171)](_0x3d5c55=>_0x3d5c55[_0x28a22a(0x1c7)]));for(const _0x3798f0 of _0x31e323){const _0x56eb6a=a134_0x70d920[_0x28a22a(0x17c)](_0x57e0c2,_0x3798f0);a134_0x3a629b[_0x28a22a(0x14b)](_0x56eb6a)[_0x28a22a(0x193)]()&&!_0x5fc040[_0x28a22a(0x232)](_0x3798f0)&&_0x2b7446[_0x28a22a(0x1ea)]({'path':_0x56eb6a});}}_0x14bffa['experimentalArtifacts'][_0x28a22a(0x1ea)]({'name':_0xe256a9[_0x28a22a(0x1a3)][_0x28a22a(0x204)],'outputPath':_0x417332,'isNew':_0x169009,'hasChanges':_0x4b4e3f,'diff':_0x319a14}),_0x14bffa[_0x28a22a(0x1de)]['experimentalArtifacts'][_0x28a22a(0x1c4)]++;if(_0x169009)_0x14bffa['counts'][_0x28a22a(0x15e)][_0x28a22a(0x24f)]++;else{if(_0x4b4e3f)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x15e)]['updated']++;else _0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x15e)][_0x28a22a(0x1f9)]++;}}for(const _0x1faa7e of _0x13237f){const _0xfc0acf=getSanitizedPathWithMigration(getFormInterfacesDir(_0x1a2055),_0x1faa7e[_0x28a22a(0x1a3)][_0x28a22a(0x204)],_0x28a22a(0x192));_0xfc0acf[_0x28a22a(0x151)]&&this['logger'][_0x28a22a(0x13a)](_0x28a22a(0x1e3)+a134_0x70d920[_0x28a22a(0x142)](_0xfc0acf[_0x28a22a(0x1b8)])+'\x20→\x20'+a134_0x70d920[_0x28a22a(0x142)](_0xfc0acf[_0x28a22a(0x212)]));const _0x5776c6=_0xfc0acf[_0x28a22a(0x212)],_0x402d18=await apiFormInterfaceToYaml(_0x1faa7e,_0x552e6d),_0x2ec3b2=toFormInterfaceYamlString(_0x402d18),_0x889b57=!a134_0x3a629b['existsSync'](_0x5776c6);let _0x33b5c4=_0x889b57,_0x35ce43;if(!_0x889b57){const _0xf2ec75=a134_0x3a629b[_0x28a22a(0x188)](_0x5776c6,_0x28a22a(0x154)),_0x513708=generateDiff(_0xf2ec75,_0x2ec3b2);_0x33b5c4=hasChanges(_0x513708),_0x33b5c4&&(_0x35ce43=formatDiffWithColors(_0x513708));}_0x2e574f['push']({'path':_0x5776c6,'content':_0x2ec3b2}),_0x14bffa[_0x28a22a(0x239)][_0x28a22a(0x1ea)]({'name':_0x1faa7e[_0x28a22a(0x1a3)][_0x28a22a(0x204)],'outputPath':_0x5776c6,'isNew':_0x889b57,'hasChanges':_0x33b5c4,'diff':_0x35ce43}),_0x14bffa['counts'][_0x28a22a(0x239)][_0x28a22a(0x1c4)]++;if(_0x889b57)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x239)][_0x28a22a(0x24f)]++;else{if(_0x33b5c4)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x239)][_0x28a22a(0x242)]++;else _0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x239)][_0x28a22a(0x1f9)]++;}}for(const _0x4209bd of _0x1300e0){if(_0x4209bd[_0x28a22a(0x1a3)][_0x28a22a(0x14e)])continue;const _0x4e098a=getSanitizedPathWithMigration(getChatInterfacesDir(_0x1a2055),_0x4209bd[_0x28a22a(0x1a3)][_0x28a22a(0x204)],_0x28a22a(0x192));_0x4e098a[_0x28a22a(0x151)]&&this[_0x28a22a(0x1d3)][_0x28a22a(0x13a)](_0x28a22a(0x23a)+a134_0x70d920[_0x28a22a(0x142)](_0x4e098a['oldPath'])+_0x28a22a(0x199)+a134_0x70d920['basename'](_0x4e098a[_0x28a22a(0x212)]));const _0x3d5f11=_0x4e098a[_0x28a22a(0x212)],_0x6f10c3=await apiChatInterfaceToYaml(_0x4209bd,_0x552e6d),_0x4113f9=toChatInterfaceYamlString(_0x6f10c3),_0x408c95=!a134_0x3a629b[_0x28a22a(0x185)](_0x3d5f11);let _0x30116a=_0x408c95,_0x5d7f09;if(!_0x408c95){const _0x326522=a134_0x3a629b[_0x28a22a(0x188)](_0x3d5f11,_0x28a22a(0x154)),_0x32c924=generateDiff(_0x326522,_0x4113f9);_0x30116a=hasChanges(_0x32c924),_0x30116a&&(_0x5d7f09=formatDiffWithColors(_0x32c924));}_0x2e574f[_0x28a22a(0x1ea)]({'path':_0x3d5f11,'content':_0x4113f9}),_0x14bffa[_0x28a22a(0x158)][_0x28a22a(0x1ea)]({'name':_0x4209bd[_0x28a22a(0x1a3)][_0x28a22a(0x204)],'outputPath':_0x3d5f11,'isNew':_0x408c95,'hasChanges':_0x30116a,'diff':_0x5d7f09}),_0x14bffa['counts'][_0x28a22a(0x158)][_0x28a22a(0x1c4)]++;if(_0x408c95)_0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x158)][_0x28a22a(0x24f)]++;else{if(_0x30116a)_0x14bffa['counts']['chatInterfaces'][_0x28a22a(0x242)]++;else _0x14bffa[_0x28a22a(0x1de)][_0x28a22a(0x158)][_0x28a22a(0x1f9)]++;}}if(_0x1a9a5a?.[_0x28a22a(0x166)])return _0x14bffa;a134_0x3a629b['mkdirSync'](_0x1a2055,{'recursive':!![]}),a134_0x3a629b[_0x28a22a(0x248)](getKnowledgeBasesDir(_0x1a2055),{'recursive':!![]}),a134_0x3a629b[_0x28a22a(0x248)](getPromptsDir(_0x1a2055),{'recursive':!![]}),a134_0x3a629b[_0x28a22a(0x248)](getIntegrationsDir(_0x1a2055),{'recursive':!![]}),a134_0x3a629b['mkdirSync'](getExperimentalKnowledgeBasesDir(_0x1a2055),{'recursive':!![]}),a134_0x3a629b[_0x28a22a(0x248)](getExperimentalArtifactsDir(_0x1a2055),{'recursive':!![]}),a134_0x3a629b[_0x28a22a(0x248)](getFormInterfacesDir(_0x1a2055),{'recursive':!![]}),a134_0x3a629b[_0x28a22a(0x248)](getChatInterfacesDir(_0x1a2055),{'recursive':!![]});const _0x28b28e=a134_0x70d920[_0x28a22a(0x17c)](_0x1a2055,'tdx.json');a134_0x3a629b[_0x28a22a(0x18b)](_0x28b28e,createAgentConfigContent(_0x3801b5));for(const _0x1b7052 of _0x2e574f){if(_0x1b7052[_0x28a22a(0x218)])a134_0x3a629b[_0x28a22a(0x248)](_0x1b7052[_0x28a22a(0x212)],{'recursive':!![]});else{const _0x14bd2=a134_0x70d920[_0x28a22a(0x164)](_0x1b7052['path']);!a134_0x3a629b[_0x28a22a(0x185)](_0x14bd2)&&a134_0x3a629b[_0x28a22a(0x248)](_0x14bd2,{'recursive':!![]}),a134_0x3a629b[_0x28a22a(0x18b)](_0x1b7052[_0x28a22a(0x212)],_0x1b7052[_0x28a22a(0x1f2)]);}}for(const _0x3f7a5e of _0x2b7446){_0x3f7a5e[_0x28a22a(0x218)]?(a134_0x3a629b['rmSync'](_0x3f7a5e[_0x28a22a(0x212)],{'recursive':!![],'force':!![]}),this['logger'][_0x28a22a(0x13a)](_0x28a22a(0x146)+a134_0x70d920[_0x28a22a(0x142)](a134_0x70d920[_0x28a22a(0x164)](_0x3f7a5e['path']))+'/'+a134_0x70d920[_0x28a22a(0x142)](_0x3f7a5e[_0x28a22a(0x212)]))):(a134_0x3a629b[_0x28a22a(0x1b9)](_0x3f7a5e[_0x28a22a(0x212)],{'force':!![]}),this['logger'][_0x28a22a(0x13a)]('Removed\x20deleted\x20file:\x20'+a134_0x70d920[_0x28a22a(0x142)](a134_0x70d920[_0x28a22a(0x164)](_0x3f7a5e[_0x28a22a(0x212)]))+'/'+a134_0x70d920[_0x28a22a(0x142)](_0x3f7a5e[_0x28a22a(0x212)])));}return _0x14bffa;}async['pushProject'](_0x226fbd,_0x5471bd){const _0x1ecb43=a134_0x1c689f,_0xf7e1f0=a134_0x70d920[_0x1ecb43(0x17c)](_0x226fbd,_0x1ecb43(0x17f));if(!a134_0x3a629b[_0x1ecb43(0x185)](_0xf7e1f0))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1ecb43(0x191)+_0x226fbd,undefined,{'helpText':_0x1ecb43(0x1af)});const _0x66b336=loadAgentConfig(_0xf7e1f0),_0x396955=await this[_0x1ecb43(0x1d1)](_0x66b336[_0x1ecb43(0x20b)]),_0x194c41=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x241)](_0x396955),_0x39a711=_0x194c41[_0x1ecb43(0x1a3)][_0x1ecb43(0x204)],_0x492445={'projectName':_0x39a711,'projectId':_0x396955,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'formInterfaces':[],'chatInterfaces':[],'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},'formInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'chatInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x3f9129=[],_0x45629f=[],_0x3f3567=[],_0x18418f=[],_0x450f8c=[],_0x356bd9=[],_0x4235ca=a134_0x3a629b[_0x1ecb43(0x230)](_0x226fbd,{'withFileTypes':!![]});for(const _0x3be46a of _0x4235ca){if(!_0x3be46a[_0x1ecb43(0x15f)]())continue;if([_0x1ecb43(0x228),_0x1ecb43(0x1fc),_0x1ecb43(0x17b),_0x1ecb43(0x216),_0x1ecb43(0x203),'form_interfaces','chat_interfaces'][_0x1ecb43(0x21a)](_0x3be46a[_0x1ecb43(0x204)]))continue;const _0x56e647=a134_0x70d920['join'](_0x226fbd,_0x3be46a['name']);if(isAgentDir(_0x56e647)){const _0x5e4a23=a134_0x70d920[_0x1ecb43(0x17c)](_0x56e647,_0x1ecb43(0x211)),_0x46779b=a134_0x70d920[_0x1ecb43(0x17c)](_0x56e647,'prompt.md'),_0x1cf063=a134_0x70d920[_0x1ecb43(0x17c)](_0x56e647,_0x1ecb43(0x210)),_0x49e013=parseAgentYaml(a134_0x3a629b['readFileSync'](_0x5e4a23,_0x1ecb43(0x154)),_0x5e4a23),_0x390c73=a134_0x3a629b[_0x1ecb43(0x185)](_0x46779b)?a134_0x3a629b[_0x1ecb43(0x188)](_0x46779b,_0x1ecb43(0x154)):'',_0x3d628c=a134_0x3a629b['existsSync'](_0x1cf063)?a134_0x3a629b['readFileSync'](_0x1cf063,'utf-8'):_0x49e013['starter_message'];_0x3f9129['push']({'name':_0x49e013[_0x1ecb43(0x204)],'dir':_0x56e647,'yaml':_0x49e013,'systemPrompt':_0x390c73,'starterMessage':_0x3d628c});}}const _0x16827b=getKnowledgeBasesDir(_0x226fbd);if(a134_0x3a629b[_0x1ecb43(0x185)](_0x16827b)){const _0xf815d=a134_0x3a629b[_0x1ecb43(0x230)](_0x16827b);for(const _0x437568 of _0xf815d){const _0x475937=a134_0x70d920[_0x1ecb43(0x17c)](_0x16827b,_0x437568);if(_0x437568['endsWith'](_0x1ecb43(0x192))){const _0x4f508f=parseKnowledgeBaseYaml(a134_0x3a629b['readFileSync'](_0x475937,'utf-8'),_0x475937);_0x45629f[_0x1ecb43(0x1ea)]({'name':_0x4f508f[_0x1ecb43(0x204)],'path':_0x475937,'yaml':_0x4f508f});}else{if(_0x437568[_0x1ecb43(0x167)]('.md')){const _0x264973=a134_0x3a629b['readFileSync'](_0x475937,_0x1ecb43(0x154)),{name:_0x647b9d,text:_0x48e2b1}=parseTextKnowledgeBaseMd(_0x264973,_0x437568);_0x3f3567['push']({'name':_0x647b9d,'path':_0x475937,'text':_0x48e2b1});}}}}const _0x1cefda=getPromptsDir(_0x226fbd);if(a134_0x3a629b[_0x1ecb43(0x185)](_0x1cefda)){const _0x11cbfe=a134_0x3a629b[_0x1ecb43(0x230)](_0x1cefda)[_0x1ecb43(0x157)](_0x596a48=>_0x596a48[_0x1ecb43(0x167)](_0x1ecb43(0x192)));for(const _0x36c0df of _0x11cbfe){const _0x3578a4=a134_0x70d920[_0x1ecb43(0x17c)](_0x1cefda,_0x36c0df),_0x279346=parsePromptYaml(a134_0x3a629b[_0x1ecb43(0x188)](_0x3578a4,_0x1ecb43(0x154)),_0x3578a4);_0x18418f[_0x1ecb43(0x1ea)]({'name':_0x279346[_0x1ecb43(0x204)],'path':_0x3578a4,'yaml':_0x279346});}}const _0x419ef3=[],_0x3b42ee=getIntegrationsDir(_0x226fbd);if(a134_0x3a629b[_0x1ecb43(0x185)](_0x3b42ee)){const _0x4b3e43=a134_0x3a629b['readdirSync'](_0x3b42ee)[_0x1ecb43(0x157)](_0x3032d0=>_0x3032d0['endsWith']('.yml'));for(const _0x5f50f1 of _0x4b3e43){const _0x5a50ac=a134_0x70d920[_0x1ecb43(0x17c)](_0x3b42ee,_0x5f50f1),_0x2862e5=parseIntegrationYaml(a134_0x3a629b[_0x1ecb43(0x188)](_0x5a50ac,_0x1ecb43(0x154)),_0x5a50ac);if(!SAFE_INTEGRATION_TYPES[_0x1ecb43(0x21a)](_0x2862e5[_0x1ecb43(0x139)]['toLowerCase']())){this[_0x1ecb43(0x1d3)]['warn'](_0x1ecb43(0x1a9)+_0x2862e5['name']+_0x1ecb43(0x182)+_0x2862e5[_0x1ecb43(0x139)]+_0x1ecb43(0x13b)+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES['join'](',\x20')+_0x1ecb43(0x15b))+'Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.');continue;}_0x419ef3[_0x1ecb43(0x1ea)]({'name':_0x2862e5[_0x1ecb43(0x204)],'path':_0x5a50ac,'yaml':_0x2862e5});}}const _0x10f00a=getExperimentalKnowledgeBasesDir(_0x226fbd);if(a134_0x3a629b[_0x1ecb43(0x185)](_0x10f00a)){const _0x534624=a134_0x3a629b[_0x1ecb43(0x230)](_0x10f00a,{'withFileTypes':!![]});for(const _0x5b7248 of _0x534624){if(!_0x5b7248['isDirectory']())continue;const _0x2262ed=a134_0x70d920[_0x1ecb43(0x17c)](_0x10f00a,_0x5b7248[_0x1ecb43(0x204)]),_0x5b60ef=a134_0x70d920[_0x1ecb43(0x17c)](_0x2262ed,_0x5b7248[_0x1ecb43(0x204)]+_0x1ecb43(0x192)),_0x24cee2=a134_0x70d920[_0x1ecb43(0x17c)](_0x2262ed,'functions');if(!a134_0x3a629b[_0x1ecb43(0x185)](_0x5b60ef))continue;const _0x1e22a3=parseExperimentalKnowledgeBaseYaml(a134_0x3a629b[_0x1ecb43(0x188)](_0x5b60ef,_0x1ecb43(0x154)),_0x5b60ef),_0x59a40f=[];if(a134_0x3a629b[_0x1ecb43(0x185)](_0x24cee2)){const _0x154836=a134_0x3a629b[_0x1ecb43(0x230)](_0x24cee2,{'withFileTypes':!![]});for(const _0x399286 of _0x154836){if(!_0x399286[_0x1ecb43(0x15f)]())continue;const _0x4acb2b=a134_0x70d920[_0x1ecb43(0x17c)](_0x24cee2,_0x399286['name']),_0x425f67=a134_0x70d920[_0x1ecb43(0x17c)](_0x4acb2b,_0x1ecb43(0x22e)),_0x390dde=a134_0x70d920[_0x1ecb43(0x17c)](_0x4acb2b,_0x1ecb43(0x14a));a134_0x3a629b[_0x1ecb43(0x185)](_0x425f67)&&a134_0x3a629b[_0x1ecb43(0x185)](_0x390dde)&&_0x59a40f['push']({'name':_0x399286[_0x1ecb43(0x204)],'code':a134_0x3a629b[_0x1ecb43(0x188)](_0x425f67,_0x1ecb43(0x154)),'json_schema':a134_0x3a629b[_0x1ecb43(0x188)](_0x390dde,_0x1ecb43(0x154))});}}const _0x5eb887={..._0x1e22a3,'variables':_0x1e22a3[_0x1ecb43(0x1eb)]||[],'functions':_0x59a40f};_0x450f8c['push']({'name':_0x1e22a3[_0x1ecb43(0x204)],'dir':_0x2262ed,'def':_0x5eb887});}}const _0x1b7abe=getExperimentalArtifactsDir(_0x226fbd);if(a134_0x3a629b[_0x1ecb43(0x185)](_0x1b7abe)){const _0x5c6a90=a134_0x3a629b[_0x1ecb43(0x230)](_0x1b7abe,{'withFileTypes':!![]});for(const _0x2127ba of _0x5c6a90){if(!_0x2127ba[_0x1ecb43(0x15f)]())continue;const _0x58731f=a134_0x70d920[_0x1ecb43(0x17c)](_0x1b7abe,_0x2127ba['name']),_0x8b6ca3=a134_0x70d920[_0x1ecb43(0x17c)](_0x58731f,_0x2127ba['name']+'.yml'),_0x3b5a3d=a134_0x70d920[_0x1ecb43(0x17c)](_0x58731f,_0x1ecb43(0x22e)),_0x4cc1d9=a134_0x70d920[_0x1ecb43(0x17c)](_0x58731f,_0x1ecb43(0x1dc));if(!a134_0x3a629b[_0x1ecb43(0x185)](_0x8b6ca3)||!a134_0x3a629b[_0x1ecb43(0x185)](_0x3b5a3d))continue;const _0x48aa69=parseExperimentalArtifactYaml(a134_0x3a629b['readFileSync'](_0x8b6ca3,_0x1ecb43(0x154)),_0x8b6ca3),_0xc7608=a134_0x3a629b[_0x1ecb43(0x188)](_0x3b5a3d,_0x1ecb43(0x154)),_0x1e42cc=[];if(a134_0x3a629b[_0x1ecb43(0x185)](_0x4cc1d9)){const _0x3bc7ee=a134_0x3a629b[_0x1ecb43(0x230)](_0x4cc1d9);for(const _0x59003e of _0x3bc7ee){const _0x1c4bfe=a134_0x70d920[_0x1ecb43(0x17c)](_0x4cc1d9,_0x59003e);a134_0x3a629b['statSync'](_0x1c4bfe)['isFile']()&&_0x1e42cc[_0x1ecb43(0x1ea)]({'file_name':_0x59003e,'text_content':a134_0x3a629b[_0x1ecb43(0x188)](_0x1c4bfe,_0x1ecb43(0x154))});}}const _0x19f948={..._0x48aa69,'code':_0xc7608,'files':_0x1e42cc};_0x356bd9[_0x1ecb43(0x1ea)]({'name':_0x48aa69[_0x1ecb43(0x204)],'dir':_0x58731f,'def':_0x19f948});}}const _0x4c4c6c=[],_0x3495ea=getFormInterfacesDir(_0x226fbd);if(a134_0x3a629b[_0x1ecb43(0x185)](_0x3495ea)){const _0x44ef1b=a134_0x3a629b[_0x1ecb43(0x230)](_0x3495ea)[_0x1ecb43(0x157)](_0x5e4e0c=>_0x5e4e0c[_0x1ecb43(0x167)](_0x1ecb43(0x192)));for(const _0x4fdfaf of _0x44ef1b){const _0x6e7acf=a134_0x70d920[_0x1ecb43(0x17c)](_0x3495ea,_0x4fdfaf),_0x30c8d7=parseFormInterfaceYaml(a134_0x3a629b[_0x1ecb43(0x188)](_0x6e7acf,_0x1ecb43(0x154)),_0x6e7acf);_0x4c4c6c[_0x1ecb43(0x1ea)]({'name':_0x30c8d7[_0x1ecb43(0x204)],'path':_0x6e7acf,'yaml':_0x30c8d7});}}const _0x998397=[],_0x769ffe=getChatInterfacesDir(_0x226fbd);if(a134_0x3a629b[_0x1ecb43(0x185)](_0x769ffe)){const _0x3c1fd3=a134_0x3a629b[_0x1ecb43(0x230)](_0x769ffe)[_0x1ecb43(0x157)](_0x580a81=>_0x580a81['endsWith'](_0x1ecb43(0x192)));for(const _0x914ab of _0x3c1fd3){const _0x117290=a134_0x70d920['join'](_0x769ffe,_0x914ab),_0x5aff44=parseChatInterfaceYaml(a134_0x3a629b['readFileSync'](_0x117290,_0x1ecb43(0x154)),_0x117290);_0x998397[_0x1ecb43(0x1ea)]({'name':_0x5aff44[_0x1ecb43(0x204)],'path':_0x117290,'yaml':_0x5aff44});}}const _0x3c10d8=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x162)](_0x396955),_0x2a97db=await this[_0x1ecb43(0x1ff)]['listKnowledgeBases'](_0x396955),_0x1da683=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1a8)](_0x396955),_0x2e471a=await this['client'][_0x1ecb43(0x174)](_0x396955),_0xa5aeaa=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x177)](_0x396955),_0x1dd896=await safeListOrEmpty(()=>this[_0x1ecb43(0x1ff)][_0x1ecb43(0x173)](_0x396955)),_0x147e8d=await safeListOrEmpty(()=>this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1f4)](_0x396955)),_0x1219f8=await safeListOrEmpty(()=>this['client'][_0x1ecb43(0x205)](_0x396955)),_0x5546bd=await safeListOrEmpty(()=>this[_0x1ecb43(0x1ff)][_0x1ecb43(0x16a)](_0x396955)),_0x4daa3f=await fetchAllToolTargetMaps((_0x5b0a52,_0x1c12b6)=>this[_0x1ecb43(0x1ff)][_0x1ecb43(0x207)](_0x5b0a52,_0x1c12b6),_0x396955),_0x598d81=new Map(),_0x10defb=new Map(),_0x3bc492=new Map(),_0x28bf16=new Map(),_0x2e46f=new Map(),_0x214247=new Map(),_0x466f14=new Map();for(const _0x7336dd of _0x3c10d8){_0x598d81[_0x1ecb43(0x252)](_0x7336dd[_0x1ecb43(0x1a3)]['name'],_0x7336dd);}for(const _0x29941d of _0x2a97db){_0x10defb[_0x1ecb43(0x252)](_0x29941d[_0x1ecb43(0x1a3)]['name'],_0x29941d);}for(const _0x19a506 of _0x1da683){_0x3bc492[_0x1ecb43(0x252)](_0x19a506[_0x1ecb43(0x1a3)]['name'],_0x19a506);}for(const _0x53ca71 of _0x2e471a){_0x28bf16[_0x1ecb43(0x252)](_0x53ca71[_0x1ecb43(0x1a3)][_0x1ecb43(0x204)],_0x53ca71);}for(const _0x301e1d of _0xa5aeaa){_0x2e46f['set'](_0x301e1d[_0x1ecb43(0x1a3)][_0x1ecb43(0x19c)]['toLowerCase'](),_0x301e1d);}for(const _0x425b8e of _0x1dd896){_0x214247['set'](_0x425b8e['attributes']['name'],_0x425b8e);}for(const _0x56f12b of _0x147e8d){_0x466f14[_0x1ecb43(0x252)](_0x56f12b[_0x1ecb43(0x1a3)][_0x1ecb43(0x204)],_0x56f12b);}const _0x5ed9ae=new Map(),_0x219e63=new Map();for(const _0x5325de of _0x1219f8){_0x5ed9ae['set'](_0x5325de['attributes'][_0x1ecb43(0x204)],_0x5325de);}for(const _0x500d61 of _0x5546bd){_0x219e63['set'](_0x500d61[_0x1ecb43(0x1a3)][_0x1ecb43(0x204)],_0x500d61);}const _0x2ce6ac=new Map(),_0xeca3c7=new Map();for(const _0x35921d of _0x3c10d8){_0x2ce6ac[_0x1ecb43(0x252)](_0x35921d[_0x1ecb43(0x1a3)]['name'],_0x35921d['id']),_0xeca3c7[_0x1ecb43(0x252)](_0x35921d['id'],_0x35921d[_0x1ecb43(0x1a3)][_0x1ecb43(0x204)]);}const _0x34c2ec=new Map(),_0x2f75ec=new Map();for(const _0x3e02a5 of _0x2e471a){_0x34c2ec[_0x1ecb43(0x252)](_0x3e02a5[_0x1ecb43(0x1a3)][_0x1ecb43(0x204)],_0x3e02a5['id']),_0x2f75ec[_0x1ecb43(0x252)](_0x3e02a5['id'],_0x3e02a5[_0x1ecb43(0x1a3)][_0x1ecb43(0x204)]);}const _0x73ba0d=_0x4daa3f['nameToId'][_0x1ecb43(0x135)]||new Map(),_0x42920a=_0x4daa3f[_0x1ecb43(0x1fe)]['TextKnowledgeBase']||new Map(),_0x51dae4=_0x4daa3f[_0x1ecb43(0x1fe)][_0x1ecb43(0x1cd)]||new Map(),_0x5589d8=new Map(),_0x4a7a71={'resolveToolTargetName':buildNameResolver({..._0x4daa3f[_0x1ecb43(0x1a2)],'Agent':_0xeca3c7}),'resolvePromptName':async _0x37903a=>_0x2f75ec[_0x1ecb43(0x20f)](_0x37903a),'onWarning':_0x489dec=>this[_0x1ecb43(0x1d3)][_0x1ecb43(0x226)](_0x489dec)};let _0x49122e=[];const _0x3518a1={'projectId':_0x396955,'resolveToolTargetId':buildIdResolver({..._0x4daa3f[_0x1ecb43(0x1fe)],'Agent':_0x2ce6ac}),'resolvePromptId':async _0x4dc217=>_0x34c2ec['get'](_0x4dc217),'onWarning':_0x42f96c=>{const _0x43db0f=_0x1ecb43;this[_0x43db0f(0x1d3)]['warn'](_0x42f96c),_0x49122e[_0x43db0f(0x1ea)](_0x42f96c);}},{resolved:_0x11d3e8,unresolved:_0x8e86a4}=resolveAgentDependencies(_0x3f9129,new Set(_0x598d81[_0x1ecb43(0x134)]()));for(const {agent:_0x325a41,missingDeps:_0x1e7c74}of _0x8e86a4){_0x492445['agents'][_0x1ecb43(0x1ea)]({'agentName':_0x325a41[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':'Unresolved\x20dependencies:\x20'+_0x1e7c74[_0x1ecb43(0x17c)](',\x20')+_0x1ecb43(0x18d)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x163)][_0x1ecb43(0x1b2)]++;}for(const _0x288a7d of _0x45629f){const _0x5cb60c=_0x10defb[_0x1ecb43(0x20f)](_0x288a7d['yaml'][_0x1ecb43(0x204)]),_0x552cbd=a134_0x3a629b[_0x1ecb43(0x188)](_0x288a7d[_0x1ecb43(0x212)],_0x1ecb43(0x154));if(_0x5cb60c){const _0x548268=apiKnowledgeBaseToYaml(_0x5cb60c),_0x733472=toKnowledgeBaseYamlString(_0x548268),_0x3d6eaa=generateDiff(_0x733472,_0x552cbd),_0x146f10=hasChanges(_0x3d6eaa);_0x146f10?(_0x492445[_0x1ecb43(0x24c)][_0x1ecb43(0x1ea)]({'name':_0x288a7d['yaml'][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x5cb60c['id'],'diff':formatDiffWithColors(_0x3d6eaa)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x24c)][_0x1ecb43(0x242)]++):(_0x492445[_0x1ecb43(0x24c)][_0x1ecb43(0x1ea)]({'name':_0x288a7d['yaml'][_0x1ecb43(0x204)],'action':'unchanged','id':_0x5cb60c['id']}),_0x492445[_0x1ecb43(0x1de)]['knowledgeBases'][_0x1ecb43(0x1f9)]++);}else _0x492445[_0x1ecb43(0x24c)][_0x1ecb43(0x1ea)]({'name':_0x288a7d[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1d6)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x24c)][_0x1ecb43(0x1d6)]++;}for(const _0x1480be of _0x3f3567){const _0x3bb2b8=_0x3bc492[_0x1ecb43(0x20f)](_0x1480be[_0x1ecb43(0x204)]),_0x28f17a=a134_0x3a629b[_0x1ecb43(0x188)](_0x1480be['path'],_0x1ecb43(0x154));if(_0x3bb2b8){const _0x1f9a22=toTextKnowledgeBaseMd(_0x3bb2b8['attributes'][_0x1ecb43(0x204)],_0x3bb2b8[_0x1ecb43(0x1a3)][_0x1ecb43(0x1d5)]),_0x2d2d4e=generateDiff(_0x1f9a22,_0x28f17a),_0x2b1254=hasChanges(_0x2d2d4e);_0x2b1254?(_0x492445[_0x1ecb43(0x144)][_0x1ecb43(0x1ea)]({'name':_0x1480be['name'],'action':'updated','id':_0x3bb2b8['id'],'diff':formatDiffWithColors(_0x2d2d4e)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x144)][_0x1ecb43(0x242)]++):(_0x492445[_0x1ecb43(0x144)][_0x1ecb43(0x1ea)]({'name':_0x1480be[_0x1ecb43(0x204)],'action':'unchanged','id':_0x3bb2b8['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x144)][_0x1ecb43(0x1f9)]++);}else _0x492445[_0x1ecb43(0x144)][_0x1ecb43(0x1ea)]({'name':_0x1480be['name'],'action':_0x1ecb43(0x1d6)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x144)][_0x1ecb43(0x1d6)]++;}for(const _0x44473d of _0x11d3e8){const _0x2f1bc1=_0x598d81[_0x1ecb43(0x20f)](_0x44473d['yaml']['name']),_0x4581b1=a134_0x70d920['join'](_0x44473d[_0x1ecb43(0x1c9)],'agent.yml'),_0x241879=a134_0x3a629b[_0x1ecb43(0x188)](_0x4581b1,_0x1ecb43(0x154)),_0x34bdb4=_0x44473d[_0x1ecb43(0x168)],_0x5158e9='#\x20prompt.md\x0a'+_0x34bdb4+_0x1ecb43(0x187)+_0x241879;if(_0x2f1bc1){const {yaml:_0x55d0c3,systemPrompt:_0x1ea890}=await agentResponseToDef(_0x2f1bc1,_0x4a7a71),_0x22293d=toAgentYamlString(_0x55d0c3),_0x440dae=_0x1ecb43(0x250)+_0x1ea890+_0x1ecb43(0x187)+_0x22293d,_0x359a37=generateDiff(_0x440dae,_0x5158e9),_0x16c0f7=hasChanges(_0x359a37);_0x16c0f7?(_0x492445[_0x1ecb43(0x163)][_0x1ecb43(0x1ea)]({'agentName':_0x44473d['yaml'][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'agentId':_0x2f1bc1['id'],'diff':formatDiffWithColors(_0x359a37)}),_0x492445['counts']['agents'][_0x1ecb43(0x242)]++):(_0x492445['agents'][_0x1ecb43(0x1ea)]({'agentName':_0x44473d[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1f9),'agentId':_0x2f1bc1['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x163)][_0x1ecb43(0x1f9)]++);}else _0x492445[_0x1ecb43(0x163)]['push']({'agentName':_0x44473d['yaml']['name'],'action':_0x1ecb43(0x1d6)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x163)][_0x1ecb43(0x1d6)]++;}for(const _0x655800 of _0x18418f){const _0x1e0800=_0x28bf16[_0x1ecb43(0x20f)](_0x655800[_0x1ecb43(0x198)][_0x1ecb43(0x204)]),_0xb6e81a=a134_0x3a629b[_0x1ecb43(0x188)](_0x655800[_0x1ecb43(0x212)],'utf-8');if(_0x1e0800){const _0x507ec8=await apiPromptToYaml(_0x1e0800,_0x4a7a71);if(!_0x507ec8){_0x492445['prompts'][_0x1ecb43(0x1ea)]({'name':_0x655800[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x1e0800['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x1fc)]['updated']++;continue;}const _0x5125b5=toPromptYamlString(_0x507ec8),_0x3ec936=generateDiff(_0x5125b5,_0xb6e81a),_0xc64c6d=hasChanges(_0x3ec936);_0xc64c6d?(_0x492445[_0x1ecb43(0x1fc)]['push']({'name':_0x655800['yaml'][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x1e0800['id'],'diff':formatDiffWithColors(_0x3ec936)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x1fc)][_0x1ecb43(0x242)]++):(_0x492445['prompts'][_0x1ecb43(0x1ea)]({'name':_0x655800[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':'unchanged','id':_0x1e0800['id']}),_0x492445['counts'][_0x1ecb43(0x1fc)][_0x1ecb43(0x1f9)]++);}else _0x492445['prompts'][_0x1ecb43(0x1ea)]({'name':_0x655800['yaml']['name'],'action':'created'}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x1fc)][_0x1ecb43(0x1d6)]++;}for(const _0x4cb117 of _0x419ef3){const _0x5c3191=_0x2e46f['get'](_0x4cb117[_0x1ecb43(0x198)][_0x1ecb43(0x139)]),_0x35ae1d=a134_0x3a629b[_0x1ecb43(0x188)](_0x4cb117[_0x1ecb43(0x212)],'utf-8');if(_0x5c3191){const _0x3a1ae0=await apiIntegrationToYaml(_0x5c3191,_0x4a7a71),_0x2d52c2=toIntegrationYamlString(_0x3a1ae0),_0x51e710=generateDiff(_0x2d52c2,_0x35ae1d),_0x1563c8=hasChanges(_0x51e710);_0x1563c8?(_0x492445[_0x1ecb43(0x17b)]['push']({'name':_0x4cb117[_0x1ecb43(0x198)][_0x1ecb43(0x139)],'action':_0x1ecb43(0x242),'id':_0x5c3191['id'],'diff':formatDiffWithColors(_0x51e710)}),_0x492445[_0x1ecb43(0x1de)]['integrations']['updated']++):(_0x492445[_0x1ecb43(0x17b)][_0x1ecb43(0x1ea)]({'name':_0x4cb117[_0x1ecb43(0x198)][_0x1ecb43(0x139)],'action':'unchanged','id':_0x5c3191['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x17b)]['unchanged']++);}else _0x492445[_0x1ecb43(0x17b)][_0x1ecb43(0x1ea)]({'name':_0x4cb117[_0x1ecb43(0x198)][_0x1ecb43(0x139)],'action':'created'}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x17b)][_0x1ecb43(0x1d6)]++;}for(const _0x3acd0b of _0x450f8c){const _0x70913b=_0x214247[_0x1ecb43(0x20f)](_0x3acd0b[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)]),_0x497a46=toExperimentalKnowledgeBaseYamlString(_0x3acd0b['def']);let _0x386bf7=_0x497a46;for(const _0x1c5044 of _0x3acd0b[_0x1ecb43(0x1c0)][_0x1ecb43(0x22c)]){_0x386bf7+=_0x1ecb43(0x1fa)+_0x1c5044[_0x1ecb43(0x204)]+_0x1ecb43(0x169)+_0x1c5044[_0x1ecb43(0x21d)]+_0x1ecb43(0x1db)+_0x1c5044[_0x1ecb43(0x204)]+_0x1ecb43(0x169)+_0x1c5044[_0x1ecb43(0x1bc)]+'\x0a';}if(_0x70913b){const _0x227e9b=apiExperimentalKnowledgeBaseToYaml(_0x70913b),_0x37dbaa=toExperimentalKnowledgeBaseYamlString(_0x227e9b);let _0x1a3dbb=_0x37dbaa;for(const _0x3c7cc2 of _0x227e9b['functions']){_0x1a3dbb+=_0x1ecb43(0x1fa)+_0x3c7cc2[_0x1ecb43(0x204)]+_0x1ecb43(0x169)+_0x3c7cc2['code']+_0x1ecb43(0x1db)+_0x3c7cc2[_0x1ecb43(0x204)]+_0x1ecb43(0x169)+_0x3c7cc2[_0x1ecb43(0x1bc)]+'\x0a';}const _0x39b606=generateDiff(_0x1a3dbb,_0x386bf7),_0x7c2b94=hasChanges(_0x39b606);_0x7c2b94?(_0x492445['experimentalKnowledgeBases'][_0x1ecb43(0x1ea)]({'name':_0x3acd0b['def'][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x70913b['id'],'diff':formatDiffWithColors(_0x39b606)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x23d)][_0x1ecb43(0x242)]++):(_0x492445[_0x1ecb43(0x23d)][_0x1ecb43(0x1ea)]({'name':_0x3acd0b[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1f9),'id':_0x70913b['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x23d)][_0x1ecb43(0x1f9)]++);}else _0x492445['experimentalKnowledgeBases']['push']({'name':_0x3acd0b[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1d6)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x23d)][_0x1ecb43(0x1d6)]++;}for(const _0x4a3d56 of _0x356bd9){const _0x17724f=_0x466f14[_0x1ecb43(0x20f)](_0x4a3d56['def'][_0x1ecb43(0x204)]),_0x3edb2a=toExperimentalArtifactYamlString(_0x4a3d56['def']);let _0x43378c=_0x3edb2a+('\x0a---\x20code\x20---\x0a'+_0x4a3d56[_0x1ecb43(0x1c0)][_0x1ecb43(0x21d)]+'\x0a');for(const _0x5eb1c7 of _0x4a3d56[_0x1ecb43(0x1c0)][_0x1ecb43(0x1dc)]){_0x43378c+='---\x20file:\x20'+_0x5eb1c7[_0x1ecb43(0x1c7)]+_0x1ecb43(0x169)+_0x5eb1c7[_0x1ecb43(0x19a)]+'\x0a';}if(_0x17724f){const _0x4e2f9b=apiExperimentalArtifactToYaml(_0x17724f),_0x30c305=toExperimentalArtifactYamlString(_0x4e2f9b);let _0x1d2aff=_0x30c305+('\x0a---\x20code\x20---\x0a'+_0x4e2f9b[_0x1ecb43(0x21d)]+'\x0a');for(const _0x56dd3c of _0x4e2f9b[_0x1ecb43(0x1dc)]){_0x1d2aff+='---\x20file:\x20'+_0x56dd3c[_0x1ecb43(0x1c7)]+_0x1ecb43(0x169)+_0x56dd3c[_0x1ecb43(0x19a)]+'\x0a';}const _0x3b1200=generateDiff(_0x1d2aff,_0x43378c),_0x326dc8=hasChanges(_0x3b1200);_0x326dc8?(_0x492445[_0x1ecb43(0x15e)]['push']({'name':_0x4a3d56[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':'updated','id':_0x17724f['id'],'diff':formatDiffWithColors(_0x3b1200)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x15e)][_0x1ecb43(0x242)]++):(_0x492445[_0x1ecb43(0x15e)][_0x1ecb43(0x1ea)]({'name':_0x4a3d56[_0x1ecb43(0x1c0)]['name'],'action':_0x1ecb43(0x1f9),'id':_0x17724f['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x15e)][_0x1ecb43(0x1f9)]++);}else _0x492445[_0x1ecb43(0x15e)][_0x1ecb43(0x1ea)]({'name':_0x4a3d56[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1d6)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x15e)][_0x1ecb43(0x1d6)]++;}for(const _0x355a39 of _0x4c4c6c){const _0x114286=_0x5ed9ae[_0x1ecb43(0x20f)](_0x355a39[_0x1ecb43(0x198)][_0x1ecb43(0x204)]),_0x281494=a134_0x3a629b['readFileSync'](_0x355a39[_0x1ecb43(0x212)],'utf-8');if(_0x114286){const _0x36ac77=await apiFormInterfaceToYaml(_0x114286,_0x4a7a71),_0x836ac7=toFormInterfaceYamlString(_0x36ac77),_0x5c72b8=generateDiff(_0x836ac7,_0x281494),_0x1847a7=hasChanges(_0x5c72b8);_0x1847a7?(_0x492445[_0x1ecb43(0x239)][_0x1ecb43(0x1ea)]({'name':_0x355a39[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x114286['id'],'diff':formatDiffWithColors(_0x5c72b8)}),_0x492445['counts'][_0x1ecb43(0x239)][_0x1ecb43(0x242)]++):(_0x492445[_0x1ecb43(0x239)][_0x1ecb43(0x1ea)]({'name':_0x355a39[_0x1ecb43(0x198)]['name'],'action':'unchanged','id':_0x114286['id']}),_0x492445[_0x1ecb43(0x1de)]['formInterfaces'][_0x1ecb43(0x1f9)]++);}else _0x492445[_0x1ecb43(0x239)][_0x1ecb43(0x1ea)]({'name':_0x355a39[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1d6)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x239)][_0x1ecb43(0x1d6)]++;}for(const _0x127c05 of _0x998397){const _0x15bb2e=_0x219e63['get'](_0x127c05[_0x1ecb43(0x198)][_0x1ecb43(0x204)]),_0x318bb5=a134_0x3a629b[_0x1ecb43(0x188)](_0x127c05[_0x1ecb43(0x212)],_0x1ecb43(0x154));if(_0x15bb2e){const _0x180372=await apiChatInterfaceToYaml(_0x15bb2e,_0x4a7a71),_0x2434c1=toChatInterfaceYamlString(_0x180372),_0x534a30=generateDiff(_0x2434c1,_0x318bb5),_0x4590e6=hasChanges(_0x534a30);_0x4590e6?(_0x492445[_0x1ecb43(0x158)]['push']({'name':_0x127c05['yaml'][_0x1ecb43(0x204)],'action':'updated','id':_0x15bb2e['id'],'diff':formatDiffWithColors(_0x534a30)}),_0x492445['counts'][_0x1ecb43(0x158)][_0x1ecb43(0x242)]++):(_0x492445['chatInterfaces']['push']({'name':_0x127c05['yaml']['name'],'action':'unchanged','id':_0x15bb2e['id']}),_0x492445[_0x1ecb43(0x1de)]['chatInterfaces'][_0x1ecb43(0x1f9)]++);}else _0x492445['chatInterfaces'][_0x1ecb43(0x1ea)]({'name':_0x127c05[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':'created'}),_0x492445['counts']['chatInterfaces'][_0x1ecb43(0x1d6)]++;}if(_0x5471bd?.[_0x1ecb43(0x166)])return _0x492445;_0x492445[_0x1ecb43(0x24c)]=[],_0x492445['textKnowledgeBases']=[],_0x492445['prompts']=[],_0x492445[_0x1ecb43(0x17b)]=[],_0x492445[_0x1ecb43(0x23d)]=[],_0x492445[_0x1ecb43(0x15e)]=[],_0x492445[_0x1ecb43(0x239)]=[],_0x492445[_0x1ecb43(0x158)]=[];const _0x14b67b=_0x492445[_0x1ecb43(0x163)]['filter'](_0x479262=>_0x479262['action']===_0x1ecb43(0x231));_0x492445[_0x1ecb43(0x163)]=_0x14b67b,_0x492445[_0x1ecb43(0x1de)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x14b67b['length']},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'formInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'chatInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}};for(const _0x1a778e of _0x45629f){try{const _0xefe519=_0x10defb['get'](_0x1a778e['yaml'][_0x1ecb43(0x204)]),_0x3e4bab=yamlKnowledgeBaseToApi(_0x1a778e[_0x1ecb43(0x198)],_0x396955);if(_0xefe519)await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x196)](_0xefe519['id'],_0x3e4bab),_0x73ba0d[_0x1ecb43(0x252)](_0x1a778e[_0x1ecb43(0x198)]['name'],_0xefe519['id']),_0x492445['knowledgeBases'][_0x1ecb43(0x1ea)]({'name':_0x1a778e['yaml']['name'],'action':_0x1ecb43(0x242),'id':_0xefe519['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x24c)][_0x1ecb43(0x242)]++;else{const _0x5b0036=await this['client']['createKnowledgeBase'](_0x3e4bab);_0x73ba0d[_0x1ecb43(0x252)](_0x1a778e[_0x1ecb43(0x198)][_0x1ecb43(0x204)],_0x5b0036['id']),_0x492445[_0x1ecb43(0x24c)][_0x1ecb43(0x1ea)]({'name':_0x1a778e[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1d6),'id':_0x5b0036['id']}),_0x492445['counts']['knowledgeBases']['created']++;}}catch(_0x9f11ac){_0x492445[_0x1ecb43(0x24c)]['push']({'name':_0x1a778e[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':_0x9f11ac['message']}),_0x492445['counts'][_0x1ecb43(0x24c)][_0x1ecb43(0x1b2)]++;}}for(const _0x493f9d of _0x3f3567){try{const _0x4b6d73=_0x3bc492[_0x1ecb43(0x20f)](_0x493f9d[_0x1ecb43(0x204)]),_0x38da23=yamlTextKnowledgeBaseToApi({'name':_0x493f9d['name'],'text':_0x493f9d[_0x1ecb43(0x1d5)]},_0x396955);if(_0x4b6d73)await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x197)](_0x4b6d73['id'],_0x38da23),_0x42920a[_0x1ecb43(0x252)](_0x493f9d[_0x1ecb43(0x204)],_0x4b6d73['id']),_0x492445[_0x1ecb43(0x144)][_0x1ecb43(0x1ea)]({'name':_0x493f9d[_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x4b6d73['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x144)][_0x1ecb43(0x242)]++;else{const _0x3dd543=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1e5)](_0x38da23);_0x42920a['set'](_0x493f9d[_0x1ecb43(0x204)],_0x3dd543['id']),_0x492445[_0x1ecb43(0x144)][_0x1ecb43(0x1ea)]({'name':_0x493f9d['name'],'action':_0x1ecb43(0x1d6),'id':_0x3dd543['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x144)]['created']++;}}catch(_0x3a88b8){_0x492445[_0x1ecb43(0x144)][_0x1ecb43(0x1ea)]({'name':_0x493f9d['name'],'action':'error','error':_0x3a88b8[_0x1ecb43(0x1d0)]}),_0x492445[_0x1ecb43(0x1de)]['textKnowledgeBases'][_0x1ecb43(0x1b2)]++;}}for(const _0x108252 of _0x450f8c){try{const _0x23c1e2=_0x214247[_0x1ecb43(0x20f)](_0x108252[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)]),_0x322f2a=yamlExperimentalKnowledgeBaseToApi(_0x108252['def'],_0x396955);if(_0x23c1e2)await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1fd)](_0x23c1e2['id'],_0x322f2a),_0x51dae4['set'](_0x108252['def'][_0x1ecb43(0x204)],_0x23c1e2['id']),_0x492445[_0x1ecb43(0x23d)][_0x1ecb43(0x1ea)]({'name':_0x108252[_0x1ecb43(0x1c0)]['name'],'action':_0x1ecb43(0x242),'id':_0x23c1e2['id']}),_0x492445['counts'][_0x1ecb43(0x23d)][_0x1ecb43(0x242)]++;else{const _0x47488a=await this[_0x1ecb43(0x1ff)]['createExperimentalKnowledgeBase'](_0x322f2a);_0x51dae4[_0x1ecb43(0x252)](_0x108252['def'][_0x1ecb43(0x204)],_0x47488a['id']),_0x492445['experimentalKnowledgeBases'][_0x1ecb43(0x1ea)]({'name':_0x108252[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':'created','id':_0x47488a['id']}),_0x492445[_0x1ecb43(0x1de)]['experimentalKnowledgeBases'][_0x1ecb43(0x1d6)]++;}}catch(_0x217e71){_0x492445[_0x1ecb43(0x23d)]['push']({'name':_0x108252[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':_0x217e71[_0x1ecb43(0x1d0)]}),_0x492445['counts'][_0x1ecb43(0x23d)][_0x1ecb43(0x1b2)]++;}}for(const _0x3e5dd6 of _0x356bd9){try{const _0x130ba1=_0x466f14['get'](_0x3e5dd6[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)]),_0x6af063=yamlExperimentalArtifactToApi(_0x3e5dd6[_0x1ecb43(0x1c0)],_0x396955);if(_0x130ba1)await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1a4)](_0x130ba1['id'],_0x6af063),_0x5589d8[_0x1ecb43(0x252)](_0x3e5dd6[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],_0x130ba1['id']),_0x492445[_0x1ecb43(0x15e)][_0x1ecb43(0x1ea)]({'name':_0x3e5dd6[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':'updated','id':_0x130ba1['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x15e)][_0x1ecb43(0x242)]++;else{const _0x4607f4=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1ef)](_0x6af063);_0x5589d8[_0x1ecb43(0x252)](_0x3e5dd6[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],_0x4607f4['id']),_0x492445[_0x1ecb43(0x15e)][_0x1ecb43(0x1ea)]({'name':_0x3e5dd6[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1d6),'id':_0x4607f4['id']}),_0x492445['counts'][_0x1ecb43(0x15e)][_0x1ecb43(0x1d6)]++;}}catch(_0x5c0aeb){_0x492445[_0x1ecb43(0x15e)]['push']({'name':_0x3e5dd6[_0x1ecb43(0x1c0)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':_0x5c0aeb[_0x1ecb43(0x1d0)]}),_0x492445[_0x1ecb43(0x1de)]['experimentalArtifacts']['errors']++;}}for(const _0x43fc6 of _0x11d3e8){_0x49122e=[];try{const _0x570c22=_0x598d81[_0x1ecb43(0x20f)](_0x43fc6[_0x1ecb43(0x198)][_0x1ecb43(0x204)]),_0x1e9833=await agentDefToRequest(_0x43fc6[_0x1ecb43(0x198)],_0x43fc6['systemPrompt'],_0x43fc6[_0x1ecb43(0x148)],_0x3518a1);if(_0x570c22)await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x215)](_0x570c22['id'],_0x1e9833),_0x2ce6ac[_0x1ecb43(0x252)](_0x43fc6['yaml']['name'],_0x570c22['id']),_0x492445['agents'][_0x1ecb43(0x1ea)]({'agentName':_0x43fc6[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'agentId':_0x570c22['id'],'warnings':_0x49122e[_0x1ecb43(0x181)]>0x0?_0x49122e:undefined}),_0x492445[_0x1ecb43(0x1de)]['agents']['updated']++;else{const _0xf77280=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1e2)](_0x1e9833);_0x2ce6ac[_0x1ecb43(0x252)](_0x43fc6[_0x1ecb43(0x198)][_0x1ecb43(0x204)],_0xf77280['id']),_0x492445['agents'][_0x1ecb43(0x1ea)]({'agentName':_0x43fc6[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x1d6),'agentId':_0xf77280['id'],'warnings':_0x49122e['length']>0x0?_0x49122e:undefined}),_0x492445['counts'][_0x1ecb43(0x163)][_0x1ecb43(0x1d6)]++;}}catch(_0x433d34){_0x492445[_0x1ecb43(0x163)]['push']({'agentName':_0x43fc6['yaml'][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':_0x433d34[_0x1ecb43(0x1d0)],'warnings':_0x49122e[_0x1ecb43(0x181)]>0x0?_0x49122e:undefined}),_0x492445['counts']['agents'][_0x1ecb43(0x1b2)]++;}}for(const _0x277d67 of _0x18418f){try{const _0x2a7938=_0x28bf16['get'](_0x277d67['yaml'][_0x1ecb43(0x204)]),_0x19a57c=await yamlPromptToApi(_0x277d67['yaml'],_0x396955,_0x3518a1);if(!_0x19a57c){_0x492445[_0x1ecb43(0x1fc)][_0x1ecb43(0x1ea)]({'name':_0x277d67[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':'Agent\x20reference\x20not\x20found'}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x1fc)]['errors']++;continue;}if(_0x2a7938)await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1ed)](_0x2a7938['id'],_0x19a57c),_0x34c2ec[_0x1ecb43(0x252)](_0x277d67['yaml']['name'],_0x2a7938['id']),_0x492445[_0x1ecb43(0x1fc)]['push']({'name':_0x277d67[_0x1ecb43(0x198)]['name'],'action':_0x1ecb43(0x242),'id':_0x2a7938['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x1fc)]['updated']++;else{const _0x2a2ad1=await this[_0x1ecb43(0x1ff)]['createPrompt'](_0x19a57c);_0x34c2ec[_0x1ecb43(0x252)](_0x277d67[_0x1ecb43(0x198)]['name'],_0x2a2ad1['id']),_0x492445[_0x1ecb43(0x1fc)]['push']({'name':_0x277d67[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':'created','id':_0x2a2ad1['id']}),_0x492445[_0x1ecb43(0x1de)]['prompts'][_0x1ecb43(0x1d6)]++;}}catch(_0xe3aada){_0x492445[_0x1ecb43(0x1fc)]['push']({'name':_0x277d67[_0x1ecb43(0x198)]['name'],'action':_0x1ecb43(0x231),'error':_0xe3aada[_0x1ecb43(0x1d0)]}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x1fc)]['errors']++;}}for(const _0x4441c3 of _0x419ef3){try{const _0x524710=_0x2e46f[_0x1ecb43(0x20f)](_0x4441c3[_0x1ecb43(0x198)][_0x1ecb43(0x139)]),_0x4a8f34=await yamlIntegrationToApi(_0x4441c3[_0x1ecb43(0x198)],_0x396955,_0x3518a1);if(_0x524710){await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x19f)](_0x524710['id']);const _0x2282bc=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1c5)](_0x4a8f34);_0x492445['integrations'][_0x1ecb43(0x1ea)]({'name':_0x4441c3[_0x1ecb43(0x198)][_0x1ecb43(0x139)],'action':'updated','id':_0x2282bc['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x17b)][_0x1ecb43(0x242)]++;}else{const _0x3f4361=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1c5)](_0x4a8f34);_0x492445[_0x1ecb43(0x17b)]['push']({'name':_0x4441c3[_0x1ecb43(0x198)][_0x1ecb43(0x139)],'action':_0x1ecb43(0x1d6),'id':_0x3f4361['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x17b)]['created']++;}}catch(_0x11d41c){_0x492445[_0x1ecb43(0x17b)]['push']({'name':_0x4441c3[_0x1ecb43(0x198)][_0x1ecb43(0x139)],'action':_0x1ecb43(0x231),'error':_0x11d41c[_0x1ecb43(0x1d0)]}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x17b)][_0x1ecb43(0x1b2)]++;}}for(const _0x20f6ee of _0x4c4c6c){try{const _0x126aaf=_0x5ed9ae['get'](_0x20f6ee['yaml'][_0x1ecb43(0x204)]),_0x43a393=await yamlFormInterfaceToApi(_0x20f6ee[_0x1ecb43(0x198)],_0x396955,_0x3518a1);if(!_0x43a393){_0x492445[_0x1ecb43(0x239)]['push']({'name':_0x20f6ee[_0x1ecb43(0x198)]['name'],'action':_0x1ecb43(0x231),'error':_0x1ecb43(0x233)}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x239)]['errors']++;continue;}if(_0x126aaf){const _0x5599be=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x251)](_0x126aaf['id'],_0x43a393);_0x492445['formInterfaces'][_0x1ecb43(0x1ea)]({'name':_0x20f6ee[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x5599be['id']}),_0x492445['counts'][_0x1ecb43(0x239)]['updated']++;}else{const _0x5eabe1=await this[_0x1ecb43(0x1ff)][_0x1ecb43(0x1a7)](_0x43a393);_0x492445[_0x1ecb43(0x239)][_0x1ecb43(0x1ea)]({'name':_0x20f6ee[_0x1ecb43(0x198)]['name'],'action':_0x1ecb43(0x1d6),'id':_0x5eabe1['id']}),_0x492445['counts'][_0x1ecb43(0x239)]['created']++;}}catch(_0x4e609b){_0x492445[_0x1ecb43(0x239)]['push']({'name':_0x20f6ee[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':_0x4e609b[_0x1ecb43(0x1d0)]}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x239)][_0x1ecb43(0x1b2)]++;}}for(const _0x55a81a of _0x998397){try{const _0x3a1230=_0x219e63[_0x1ecb43(0x20f)](_0x55a81a[_0x1ecb43(0x198)][_0x1ecb43(0x204)]),_0x5a27c5=await yamlChatInterfaceToApi(_0x55a81a[_0x1ecb43(0x198)],_0x396955,_0x3518a1);if(_0x3a1230){const _0x1cce2f=await this[_0x1ecb43(0x1ff)]['updateChatInterface'](_0x3a1230['id'],_0x5a27c5);_0x492445[_0x1ecb43(0x158)]['push']({'name':_0x55a81a['yaml'][_0x1ecb43(0x204)],'action':_0x1ecb43(0x242),'id':_0x1cce2f['id']}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x158)][_0x1ecb43(0x242)]++;}else{const _0x9e4ba9=await this[_0x1ecb43(0x1ff)]['createChatInterface'](_0x5a27c5);_0x492445['chatInterfaces'][_0x1ecb43(0x1ea)]({'name':_0x55a81a['yaml']['name'],'action':_0x1ecb43(0x1d6),'id':_0x9e4ba9['id']}),_0x492445[_0x1ecb43(0x1de)]['chatInterfaces'][_0x1ecb43(0x1d6)]++;}}catch(_0x1fdc34){_0x492445[_0x1ecb43(0x158)]['push']({'name':_0x55a81a[_0x1ecb43(0x198)][_0x1ecb43(0x204)],'action':_0x1ecb43(0x231),'error':_0x1fdc34[_0x1ecb43(0x1d0)]}),_0x492445[_0x1ecb43(0x1de)][_0x1ecb43(0x158)][_0x1ecb43(0x1b2)]++;}}return _0x492445;}async['pullAgent'](_0x2f6911,_0x1644a8,_0x5176b7,_0x3ddb61){const _0x382324=a134_0x1c689f,{projectId:_0x59ce8f,project:_0x5aa302}=await this['resolveProjectName'](_0x2f6911),_0x51b136=_0x5aa302[_0x382324(0x1a3)][_0x382324(0x204)],_0x191912=await this[_0x382324(0x1ff)]['listAgentsFull'](_0x59ce8f),_0x58328f=_0x191912[_0x382324(0x24b)](_0x48161b=>_0x48161b[_0x382324(0x1a3)]['name']===_0x1644a8);if(!_0x58328f)throw new SDKError(ErrorCode[_0x382324(0x202)],_0x382324(0x1a5)+_0x1644a8,undefined,{'helpText':_0x382324(0x1fb)+_0x191912[_0x382324(0x171)](_0x40baab=>_0x40baab['attributes'][_0x382324(0x204)])['join'](',\x20')});let _0x537804;if(_0x5176b7)_0x537804=_0x5176b7;else{const _0x315981=a134_0x70d920['join'](process[_0x382324(0x145)](),_0x382324(0x163)),_0xb86d18=getSanitizedPathWithMigration(_0x315981,_0x51b136);_0xb86d18[_0x382324(0x151)]&&this['logger'][_0x382324(0x13a)](_0x382324(0x150)+a134_0x70d920[_0x382324(0x142)](_0xb86d18[_0x382324(0x1b8)])+_0x382324(0x199)+a134_0x70d920[_0x382324(0x142)](_0xb86d18[_0x382324(0x212)])),_0x537804=_0xb86d18['path'];}const _0x59684a=getSanitizedPathWithMigration(_0x537804,_0x1644a8);_0x59684a[_0x382324(0x151)]&&this['logger'][_0x382324(0x13a)]('Renamed\x20agent\x20folder:\x20'+a134_0x70d920[_0x382324(0x142)](_0x59684a[_0x382324(0x1b8)])+_0x382324(0x199)+a134_0x70d920['basename'](_0x59684a[_0x382324(0x212)]));const _0x3855e1=_0x59684a[_0x382324(0x212)],_0x2f3242=new Map(),_0x55e4f8=new Map(),_0x35929c=await this[_0x382324(0x1ff)][_0x382324(0x194)](_0x59ce8f),_0x4a8853=await this[_0x382324(0x1ff)][_0x382324(0x1a8)](_0x59ce8f),_0x389570=await safeListOrEmpty(()=>this[_0x382324(0x1ff)][_0x382324(0x173)](_0x59ce8f)),_0x18dc4c=new Map(),_0x322e42=new Map();for(const _0x49769b of _0x35929c){_0x2f3242[_0x382324(0x252)](_0x49769b['id'],_0x49769b[_0x382324(0x1a3)]['name']);}for(const _0x32c986 of _0x4a8853){_0x18dc4c[_0x382324(0x252)](_0x32c986['id'],_0x32c986[_0x382324(0x1a3)][_0x382324(0x204)]);}for(const _0x557383 of _0x389570){_0x322e42[_0x382324(0x252)](_0x557383['id'],_0x557383[_0x382324(0x1a3)][_0x382324(0x204)]);}for(const _0x17f63f of _0x191912){_0x55e4f8['set'](_0x17f63f['id'],_0x17f63f[_0x382324(0x1a3)][_0x382324(0x204)]);}const _0x2ee2bd={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2f3242,'TextKnowledgeBase':_0x18dc4c,'Agent':_0x55e4f8,'ExperimentalKnowledgeBase':_0x322e42}),'resolvePromptName':async()=>undefined,'onWarning':_0x1557f9=>this[_0x382324(0x1d3)][_0x382324(0x226)](_0x1557f9)},_0x344a11=a134_0x70d920['join'](_0x3855e1,'prompt.md'),_0x41ba88=a134_0x70d920[_0x382324(0x17c)](_0x3855e1,_0x382324(0x211)),_0x42626b=a134_0x70d920[_0x382324(0x17c)](_0x3855e1,_0x382324(0x210)),_0xcb2313=!a134_0x3a629b[_0x382324(0x185)](_0x41ba88);if(_0x3ddb61?.['dryRun'])return{'agentName':_0x1644a8,'outputPath':_0x3855e1,'isNew':_0xcb2313,'hasChanges':!![]};a134_0x3a629b[_0x382324(0x248)](_0x537804,{'recursive':!![]}),a134_0x3a629b['mkdirSync'](_0x3855e1,{'recursive':!![]});const _0x5ddc37=a134_0x70d920[_0x382324(0x17c)](_0x537804,_0x382324(0x17f));!a134_0x3a629b[_0x382324(0x185)](_0x5ddc37)&&a134_0x3a629b[_0x382324(0x18b)](_0x5ddc37,createAgentConfigContent(_0x2f6911));const {yaml:_0x5a9208,systemPrompt:_0x36a986,starterMessage:_0x5e4a49}=await agentResponseToDef(_0x58328f,_0x2ee2bd);let _0x40ae0b=_0xcb2313;if(!_0xcb2313){const _0x273637=a134_0x3a629b[_0x382324(0x185)](_0x344a11)?a134_0x3a629b[_0x382324(0x188)](_0x344a11,_0x382324(0x154)):'',_0x5f287d=a134_0x3a629b[_0x382324(0x188)](_0x41ba88,'utf-8');_0x40ae0b=_0x273637!==_0x36a986||_0x5f287d!==toAgentYamlString(_0x5a9208);}a134_0x3a629b[_0x382324(0x18b)](_0x344a11,_0x36a986),a134_0x3a629b[_0x382324(0x18b)](_0x41ba88,toAgentYamlString(_0x5a9208));if(_0x5e4a49&&_0x5e4a49[_0x382324(0x21a)]('\x0a'))a134_0x3a629b[_0x382324(0x18b)](_0x42626b,_0x5e4a49);else a134_0x3a629b[_0x382324(0x185)](_0x42626b)&&a134_0x3a629b[_0x382324(0x243)](_0x42626b);return{'agentName':_0x1644a8,'outputPath':_0x3855e1,'isNew':_0xcb2313,'hasChanges':_0x40ae0b};}async[a134_0x1c689f(0x16c)](_0xc4a5a1,_0x4fc434){const _0x4ead65=a134_0x1c689f;let _0x1fdbda;isAgentYamlPath(_0xc4a5a1)?_0x1fdbda=getAgentDirFromYamlPath(_0xc4a5a1):_0x1fdbda=_0xc4a5a1;const {config:_0x4252a1}=findAgentConfig(_0x1fdbda),_0x27dbf0=await this['resolveProjectId'](_0x4252a1[_0x4ead65(0x20b)]),_0x19a913=a134_0x70d920[_0x4ead65(0x17c)](_0x1fdbda,'agent.yml'),_0x8a1991=a134_0x70d920[_0x4ead65(0x17c)](_0x1fdbda,_0x4ead65(0x15d)),_0x55c9ec=a134_0x70d920['join'](_0x1fdbda,_0x4ead65(0x210));if(!a134_0x3a629b['existsSync'](_0x19a913))throw new SDKError(ErrorCode[_0x4ead65(0x16e)],_0x4ead65(0x190)+_0x1fdbda,undefined,{'helpText':_0x4ead65(0x136)});const _0x438138=parseAgentYaml(a134_0x3a629b[_0x4ead65(0x188)](_0x19a913,_0x4ead65(0x154)),_0x19a913),_0x4ab366=a134_0x3a629b['existsSync'](_0x8a1991)?a134_0x3a629b[_0x4ead65(0x188)](_0x8a1991,_0x4ead65(0x154)):'',_0x296d50=a134_0x3a629b[_0x4ead65(0x185)](_0x55c9ec)?a134_0x3a629b['readFileSync'](_0x55c9ec,'utf-8'):_0x438138[_0x4ead65(0x23c)];if(_0x4fc434?.['dryRun'])return{'agentName':_0x438138[_0x4ead65(0x204)],'action':'created','projectId':_0x27dbf0};const _0xa07f6b=await this[_0x4ead65(0x1ff)][_0x4ead65(0x162)](_0x27dbf0),_0xec59b6=await fetchAllToolTargetMaps((_0x593839,_0x3ca30f)=>this[_0x4ead65(0x1ff)]['listToolTargets'](_0x593839,_0x3ca30f),_0x27dbf0),_0x25413c=new Map();for(const _0x49475b of _0xa07f6b){_0x25413c[_0x4ead65(0x252)](_0x49475b[_0x4ead65(0x1a3)]['name'],_0x49475b['id']);}const _0x4fd1cf=[],_0x5ef5ce={'projectId':_0x27dbf0,'resolveToolTargetId':buildIdResolver({..._0xec59b6[_0x4ead65(0x1fe)],'Agent':_0x25413c}),'resolvePromptId':async()=>undefined,'onWarning':_0xbc0f23=>{const _0x2a277f=_0x4ead65;this[_0x2a277f(0x1d3)][_0x2a277f(0x226)](_0xbc0f23),_0x4fd1cf[_0x2a277f(0x1ea)](_0xbc0f23);}};try{const _0x187069=_0xa07f6b[_0x4ead65(0x24b)](_0x3c3b35=>_0x3c3b35[_0x4ead65(0x1a3)]['name']===_0x438138['name']),_0x378efb=await agentDefToRequest(_0x438138,_0x4ab366,_0x296d50,_0x5ef5ce);if(_0x187069)return await this['client'][_0x4ead65(0x215)](_0x187069['id'],_0x378efb),{'agentName':_0x438138['name'],'action':_0x4ead65(0x242),'projectId':_0x27dbf0,'agentId':_0x187069['id'],'warnings':_0x4fd1cf[_0x4ead65(0x181)]>0x0?_0x4fd1cf:undefined};else{const _0x4324fa=await this['client'][_0x4ead65(0x1e2)](_0x378efb);return{'agentName':_0x438138[_0x4ead65(0x204)],'action':_0x4ead65(0x1d6),'projectId':_0x27dbf0,'agentId':_0x4324fa['id'],'warnings':_0x4fd1cf[_0x4ead65(0x181)]>0x0?_0x4fd1cf:undefined};}}catch(_0x1fbca4){return{'agentName':_0x438138[_0x4ead65(0x204)],'action':_0x4ead65(0x231),'projectId':_0x27dbf0,'error':_0x1fbca4[_0x4ead65(0x1d0)],'warnings':_0x4fd1cf[_0x4ead65(0x181)]>0x0?_0x4fd1cf:undefined};}}async[a134_0x1c689f(0x201)](_0x541edf,_0x257c2b,_0x435492){const _0x453aba=a134_0x1c689f,_0x460ac2=a134_0x3a629b[_0x453aba(0x185)](_0x541edf)&&a134_0x3a629b['existsSync'](a134_0x70d920['join'](_0x541edf,'tdx.json'));let _0x5c0716;const _0x135aea=[],_0x372d5b=[],_0x10a3de=[],_0x4fea4d=[],_0x344bbc=[],_0x38ca26=[],_0x4c18fd=[],_0x5f02cd=[],_0x406843=[];if(_0x460ac2){const _0x53b2b7=loadAgentConfig(a134_0x70d920[_0x453aba(0x17c)](_0x541edf,'tdx.json'));_0x5c0716=_0x53b2b7[_0x453aba(0x20b)];const _0x876ac3=a134_0x3a629b[_0x453aba(0x230)](_0x541edf,{'withFileTypes':!![]});for(const _0x1f0aec of _0x876ac3){if(!_0x1f0aec[_0x453aba(0x15f)]())continue;if(['knowledge_bases',_0x453aba(0x216),_0x453aba(0x203),'prompts',_0x453aba(0x17b),_0x453aba(0x13c),_0x453aba(0x1e6)][_0x453aba(0x21a)](_0x1f0aec[_0x453aba(0x204)]))continue;const _0x4a998c=a134_0x70d920['join'](_0x541edf,_0x1f0aec[_0x453aba(0x204)]);if(isAgentDir(_0x4a998c)){const _0xdccd36=a134_0x70d920[_0x453aba(0x17c)](_0x4a998c,_0x453aba(0x211)),_0x49b9a8=a134_0x70d920[_0x453aba(0x17c)](_0x4a998c,_0x453aba(0x15d)),_0x33ab24=a134_0x70d920[_0x453aba(0x17c)](_0x4a998c,'starter_message.md'),_0x494c5c=parseAgentYaml(a134_0x3a629b[_0x453aba(0x188)](_0xdccd36,_0x453aba(0x154)),_0xdccd36),_0x5d80a4=a134_0x3a629b[_0x453aba(0x185)](_0x49b9a8)?a134_0x3a629b['readFileSync'](_0x49b9a8,'utf-8'):'',_0x423556=a134_0x3a629b[_0x453aba(0x185)](_0x33ab24)?a134_0x3a629b[_0x453aba(0x188)](_0x33ab24,_0x453aba(0x154)):_0x494c5c['starter_message'];_0x135aea[_0x453aba(0x1ea)]({'name':_0x494c5c[_0x453aba(0x204)],'dir':_0x4a998c,'yaml':_0x494c5c,'systemPrompt':_0x5d80a4,'starterMessage':_0x423556});}}const _0x58e1d4=getKnowledgeBasesDir(_0x541edf);if(a134_0x3a629b[_0x453aba(0x185)](_0x58e1d4)){const _0x58f498=a134_0x3a629b['readdirSync'](_0x58e1d4);for(const _0x50c603 of _0x58f498){const _0x191df3=a134_0x70d920['join'](_0x58e1d4,_0x50c603);if(_0x50c603[_0x453aba(0x167)](_0x453aba(0x192))){const _0x1f905b=parseKnowledgeBaseYaml(a134_0x3a629b[_0x453aba(0x188)](_0x191df3,_0x453aba(0x154)),_0x191df3);_0x372d5b[_0x453aba(0x1ea)]({'name':_0x1f905b[_0x453aba(0x204)],'path':_0x191df3,'yaml':_0x1f905b});}else{if(_0x50c603[_0x453aba(0x167)](_0x453aba(0x1df))){const _0x185a44=a134_0x3a629b[_0x453aba(0x188)](_0x191df3,'utf-8'),{name:_0x206fd8,text:_0x30ff2d}=parseTextKnowledgeBaseMd(_0x185a44,_0x50c603);_0x10a3de[_0x453aba(0x1ea)]({'name':_0x206fd8,'path':_0x191df3,'text':_0x30ff2d});}}}}const _0x4bc5bc=getPromptsDir(_0x541edf);if(a134_0x3a629b['existsSync'](_0x4bc5bc)){const _0x533828=a134_0x3a629b['readdirSync'](_0x4bc5bc)[_0x453aba(0x157)](_0x3b9004=>_0x3b9004[_0x453aba(0x167)](_0x453aba(0x192)));for(const _0x319c8c of _0x533828){const _0xf8bb90=a134_0x70d920[_0x453aba(0x17c)](_0x4bc5bc,_0x319c8c),_0x33a288=parsePromptYaml(a134_0x3a629b['readFileSync'](_0xf8bb90,_0x453aba(0x154)),_0xf8bb90);_0x4fea4d[_0x453aba(0x1ea)]({'name':_0x33a288[_0x453aba(0x204)],'path':_0xf8bb90,'yaml':_0x33a288});}}const _0x2622ec=getIntegrationsDir(_0x541edf);if(a134_0x3a629b[_0x453aba(0x185)](_0x2622ec)){const _0x8203e2=a134_0x3a629b[_0x453aba(0x230)](_0x2622ec)[_0x453aba(0x157)](_0x1bd80d=>_0x1bd80d[_0x453aba(0x167)](_0x453aba(0x192)));for(const _0x184d2c of _0x8203e2){const _0x53a5e7=a134_0x70d920['join'](_0x2622ec,_0x184d2c),_0x5375dc=parseIntegrationYaml(a134_0x3a629b[_0x453aba(0x188)](_0x53a5e7,_0x453aba(0x154)),_0x53a5e7);SAFE_INTEGRATION_TYPES[_0x453aba(0x21a)](_0x5375dc[_0x453aba(0x139)][_0x453aba(0x238)]())?_0x344bbc[_0x453aba(0x1ea)]({'name':_0x5375dc[_0x453aba(0x204)],'path':_0x53a5e7,'yaml':_0x5375dc}):this[_0x453aba(0x1d3)]['warn'](_0x453aba(0x1a9)+_0x5375dc['name']+_0x453aba(0x182)+_0x5375dc[_0x453aba(0x139)]+'):\x20'+(_0x453aba(0x13f)+SAFE_INTEGRATION_TYPES[_0x453aba(0x17c)](',\x20')+_0x453aba(0x143)));}}const _0x43dd48=getExperimentalKnowledgeBasesDir(_0x541edf);if(a134_0x3a629b['existsSync'](_0x43dd48)){const _0x387757=a134_0x3a629b[_0x453aba(0x230)](_0x43dd48,{'withFileTypes':!![]});for(const _0x4121c5 of _0x387757){if(!_0x4121c5[_0x453aba(0x15f)]())continue;const _0x557d69=a134_0x70d920[_0x453aba(0x17c)](_0x43dd48,_0x4121c5['name']),_0x1548a9=a134_0x70d920['join'](_0x557d69,_0x4121c5[_0x453aba(0x204)]+_0x453aba(0x192));if(a134_0x3a629b['existsSync'](_0x1548a9)){const _0xe5cd10=parseExperimentalKnowledgeBaseYaml(a134_0x3a629b['readFileSync'](_0x1548a9,_0x453aba(0x154)),_0x1548a9),_0x583f34=a134_0x70d920[_0x453aba(0x17c)](_0x557d69,_0x453aba(0x22c)),_0x3faab1=[];if(a134_0x3a629b['existsSync'](_0x583f34)){const _0x176206=a134_0x3a629b[_0x453aba(0x230)](_0x583f34,{'withFileTypes':!![]});for(const _0x1cfee6 of _0x176206){if(!_0x1cfee6['isDirectory']())continue;const _0xf19974=a134_0x70d920[_0x453aba(0x17c)](_0x583f34,_0x1cfee6[_0x453aba(0x204)]),_0x228ace=a134_0x70d920['join'](_0xf19974,_0x453aba(0x22e)),_0x17de39=a134_0x70d920[_0x453aba(0x17c)](_0xf19974,_0x453aba(0x14a));if(a134_0x3a629b[_0x453aba(0x185)](_0x228ace)&&a134_0x3a629b[_0x453aba(0x185)](_0x17de39)){const _0x3d1c4d=a134_0x3a629b[_0x453aba(0x188)](_0x228ace,_0x453aba(0x154)),_0x168df2=a134_0x3a629b[_0x453aba(0x188)](_0x17de39,_0x453aba(0x154));_0x3faab1[_0x453aba(0x1ea)]({'name':_0x1cfee6['name'],'code':_0x3d1c4d,'json_schema':_0x168df2});}}}const _0x4ec8ca={..._0xe5cd10,'functions':_0x3faab1};_0x38ca26[_0x453aba(0x1ea)]({'name':_0xe5cd10[_0x453aba(0x204)],'path':_0x557d69,'def':_0x4ec8ca});}}}const _0x2352fa=getExperimentalArtifactsDir(_0x541edf);if(a134_0x3a629b[_0x453aba(0x185)](_0x2352fa)){const _0x592580=a134_0x3a629b[_0x453aba(0x230)](_0x2352fa,{'withFileTypes':!![]});for(const _0x3be6af of _0x592580){if(!_0x3be6af[_0x453aba(0x15f)]())continue;const _0x57e265=a134_0x70d920[_0x453aba(0x17c)](_0x2352fa,_0x3be6af[_0x453aba(0x204)]),_0x318672=a134_0x70d920[_0x453aba(0x17c)](_0x57e265,_0x3be6af[_0x453aba(0x204)]+'.yml');if(a134_0x3a629b[_0x453aba(0x185)](_0x318672)){const _0x1a5a1b=parseExperimentalArtifactYaml(a134_0x3a629b[_0x453aba(0x188)](_0x318672,_0x453aba(0x154)),_0x318672),_0x154a08=a134_0x70d920[_0x453aba(0x17c)](_0x57e265,_0x453aba(0x22e)),_0x24822d=a134_0x3a629b[_0x453aba(0x185)](_0x154a08)?a134_0x3a629b[_0x453aba(0x188)](_0x154a08,_0x453aba(0x154)):'',_0x1adff5=a134_0x70d920[_0x453aba(0x17c)](_0x57e265,'files'),_0x157ca4=[];if(a134_0x3a629b[_0x453aba(0x185)](_0x1adff5)){const _0x25fd07=a134_0x3a629b['readdirSync'](_0x1adff5);for(const _0x198843 of _0x25fd07){const _0x3670d9=a134_0x70d920[_0x453aba(0x17c)](_0x1adff5,_0x198843);if(a134_0x3a629b['statSync'](_0x3670d9)[_0x453aba(0x193)]()){const _0x526cbc=a134_0x3a629b['readFileSync'](_0x3670d9,'utf-8');_0x157ca4[_0x453aba(0x1ea)]({'file_name':_0x198843,'text_content':_0x526cbc});}}}const _0x331d03={..._0x1a5a1b,'code':_0x24822d,'files':_0x157ca4};_0x4c18fd[_0x453aba(0x1ea)]({'name':_0x1a5a1b[_0x453aba(0x204)],'path':_0x57e265,'def':_0x331d03});}}}const _0x283452=getFormInterfacesDir(_0x541edf);if(a134_0x3a629b['existsSync'](_0x283452)){const _0x2a3bb0=a134_0x3a629b[_0x453aba(0x230)](_0x283452)['filter'](_0x168afa=>_0x168afa[_0x453aba(0x167)]('.yml'));for(const _0x2e9995 of _0x2a3bb0){const _0x5d7a60=a134_0x70d920[_0x453aba(0x17c)](_0x283452,_0x2e9995),_0x198a54=parseFormInterfaceYaml(a134_0x3a629b[_0x453aba(0x188)](_0x5d7a60,'utf-8'),_0x5d7a60);_0x5f02cd[_0x453aba(0x1ea)]({'name':_0x198a54['name'],'path':_0x5d7a60,'yaml':_0x198a54});}}const _0x5058c0=getChatInterfacesDir(_0x541edf);if(a134_0x3a629b[_0x453aba(0x185)](_0x5058c0)){const _0x1b875f=a134_0x3a629b['readdirSync'](_0x5058c0)[_0x453aba(0x157)](_0x16cf05=>_0x16cf05[_0x453aba(0x167)](_0x453aba(0x192)));for(const _0x362d98 of _0x1b875f){const _0x574a06=a134_0x70d920[_0x453aba(0x17c)](_0x5058c0,_0x362d98),_0x3c2a6a=parseChatInterfaceYaml(a134_0x3a629b[_0x453aba(0x188)](_0x574a06,'utf-8'),_0x574a06);_0x406843[_0x453aba(0x1ea)]({'name':_0x3c2a6a[_0x453aba(0x204)],'path':_0x574a06,'yaml':_0x3c2a6a});}}}else{const _0x2fbfe8=await this[_0x453aba(0x1d1)](_0x541edf),_0x534f3d=await this[_0x453aba(0x1ff)][_0x453aba(0x241)](_0x2fbfe8);_0x5c0716=_0x534f3d[_0x453aba(0x1a3)][_0x453aba(0x204)];const _0x1ce32e=await this[_0x453aba(0x1ff)][_0x453aba(0x162)](_0x2fbfe8),_0x523201=await this[_0x453aba(0x1ff)]['listKnowledgeBases'](_0x2fbfe8),_0x5aa4e1=await this['client']['listTextKnowledgeBases'](_0x2fbfe8),_0x265a4f=await this[_0x453aba(0x1ff)][_0x453aba(0x174)](_0x2fbfe8),_0x92aa9d=await this['client'][_0x453aba(0x177)](_0x2fbfe8),_0x24cf73=await safeListOrEmpty(()=>this[_0x453aba(0x1ff)][_0x453aba(0x173)](_0x2fbfe8)),_0x5bf423=await safeListOrEmpty(()=>this[_0x453aba(0x1ff)]['listExperimentalArtifacts'](_0x2fbfe8)),_0x34a5f2=new Map(),_0x44ddde=new Map(),_0x467643=new Map(),_0x6df42b=new Map(),_0x202e77=new Map(),_0xb38528=new Map();for(const _0x48b448 of _0x523201){_0x34a5f2['set'](_0x48b448['id'],_0x48b448['attributes'][_0x453aba(0x204)]);}for(const _0x4888f0 of _0x5aa4e1){_0x44ddde[_0x453aba(0x252)](_0x4888f0['id'],_0x4888f0['attributes'][_0x453aba(0x204)]);}for(const _0x33970a of _0x1ce32e){_0x467643[_0x453aba(0x252)](_0x33970a['id'],_0x33970a[_0x453aba(0x1a3)]['name']);}for(const _0xe69a3a of _0x265a4f){_0x6df42b['set'](_0xe69a3a['id'],_0xe69a3a[_0x453aba(0x1a3)][_0x453aba(0x204)]);}for(const _0x4f770f of _0x24cf73){_0x202e77[_0x453aba(0x252)](_0x4f770f['id'],_0x4f770f['attributes'][_0x453aba(0x204)]);}for(const _0xe0c576 of _0x5bf423){_0xb38528[_0x453aba(0x252)](_0xe0c576['id'],_0xe0c576[_0x453aba(0x1a3)]['name']);}const _0x4bac6e={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x34a5f2,'TextKnowledgeBase':_0x44ddde,'Agent':_0x467643,'ExperimentalKnowledgeBase':_0x202e77}),'resolvePromptName':async _0x17266d=>_0x6df42b[_0x453aba(0x20f)](_0x17266d),'onWarning':_0x46b1a8=>this[_0x453aba(0x1d3)]['warn'](_0x46b1a8)};for(const _0x38c8fa of _0x1ce32e){const _0x35f4af=await agentResponseToDef(_0x38c8fa,_0x4bac6e),{yaml:_0x48f222,systemPrompt:_0x28e224,starterMessage:_0xbe5c78}=_0x35f4af;_0x135aea['push']({'name':_0x48f222[_0x453aba(0x204)],'dir':'','yaml':_0x48f222,'systemPrompt':_0x28e224,'starterMessage':_0xbe5c78});}for(const _0x29cc28 of _0x523201){const _0x5723e=apiKnowledgeBaseToYaml(_0x29cc28);_0x372d5b[_0x453aba(0x1ea)]({'name':_0x5723e[_0x453aba(0x204)],'path':'','yaml':_0x5723e});}for(const _0x2ff044 of _0x5aa4e1){_0x10a3de['push']({'name':_0x2ff044[_0x453aba(0x1a3)]['name'],'path':'','text':_0x2ff044['attributes'][_0x453aba(0x1d5)]});}for(const _0xb00441 of _0x265a4f){const _0x4f6707=await apiPromptToYaml(_0xb00441,_0x4bac6e);_0x4f6707&&_0x4fea4d['push']({'name':_0x4f6707[_0x453aba(0x204)],'path':'','yaml':_0x4f6707});}for(const _0x3c1919 of _0x92aa9d){if(!_0x3c1919['attributes'][_0x453aba(0x14e)]&&SAFE_INTEGRATION_TYPES['includes'](_0x3c1919[_0x453aba(0x1a3)][_0x453aba(0x19c)]['toLowerCase']())){const _0x352099=await apiIntegrationToYaml(_0x3c1919,_0x4bac6e);_0x344bbc[_0x453aba(0x1ea)]({'name':_0x3c1919[_0x453aba(0x1a3)][_0x453aba(0x19c)]['toLowerCase'](),'path':'','yaml':_0x352099});}}for(const _0x209f78 of _0x24cf73){const _0x1385a2=apiExperimentalKnowledgeBaseToYaml(_0x209f78);_0x38ca26['push']({'name':_0x1385a2[_0x453aba(0x204)],'path':'','def':_0x1385a2});}for(const _0x28c5f9 of _0x5bf423){const _0x555696=apiExperimentalArtifactToYaml(_0x28c5f9);_0x4c18fd[_0x453aba(0x1ea)]({'name':_0x555696['name'],'path':'','def':_0x555696});}const _0x385969=await safeListOrEmpty(()=>this[_0x453aba(0x1ff)]['listFormInterfaces'](_0x2fbfe8));for(const _0x6b41a8 of _0x385969){const _0x55baf8=await apiFormInterfaceToYaml(_0x6b41a8,_0x4bac6e);_0x5f02cd['push']({'name':_0x55baf8[_0x453aba(0x204)],'path':'','yaml':_0x55baf8});}const _0x1b5529=await safeListOrEmpty(()=>this[_0x453aba(0x1ff)][_0x453aba(0x16a)](_0x2fbfe8));for(const _0x25dd65 of _0x1b5529){if(_0x25dd65[_0x453aba(0x1a3)][_0x453aba(0x14e)])continue;const _0x5affda=await apiChatInterfaceToYaml(_0x25dd65,_0x4bac6e);_0x406843['push']({'name':_0x5affda[_0x453aba(0x204)],'path':'','yaml':_0x5affda});}}const _0x4d1d9a={'sourceProjectName':_0x5c0716,'newProjectName':_0x257c2b,'newProjectId':'','agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'imageGenerators':[],'webSearchTools':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'formInterfaces':[],'chatInterfaces':[],'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},'formInterfaces':{'created':0x0,'errors':0x0},'chatInterfaces':{'created':0x0,'errors':0x0}}},_0x53b21e=await this['client'][_0x453aba(0x170)](),_0x1be6d3=_0x53b21e[_0x453aba(0x24b)](_0x118573=>_0x118573[_0x453aba(0x1a3)]['name']===_0x257c2b);if(_0x1be6d3)throw new SDKError(ErrorCode[_0x453aba(0x213)],_0x453aba(0x1be)+_0x257c2b+'\x22\x20already\x20exists',undefined,{'helpText':_0x453aba(0x1ab)});if(_0x435492?.[_0x453aba(0x166)])return _0x4d1d9a['counts'][_0x453aba(0x163)][_0x453aba(0x1d6)]=_0x135aea['length'],_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x24c)][_0x453aba(0x1d6)]=_0x372d5b[_0x453aba(0x181)],_0x4d1d9a[_0x453aba(0x1de)]['textKnowledgeBases'][_0x453aba(0x1d6)]=_0x10a3de[_0x453aba(0x181)],_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x23d)]['created']=_0x38ca26[_0x453aba(0x181)],_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x15e)][_0x453aba(0x1d6)]=_0x4c18fd[_0x453aba(0x181)],_0x4d1d9a[_0x453aba(0x1de)]['prompts']['created']=_0x4fea4d['length'],_0x4d1d9a['counts']['integrations']['created']=_0x344bbc[_0x453aba(0x181)],_0x4d1d9a;const _0x4bda69=await this[_0x453aba(0x1ff)][_0x453aba(0x1ee)]({'name':_0x257c2b}),_0x6bfc08=_0x4bda69['id'];_0x4d1d9a[_0x453aba(0x1cf)]=_0x6bfc08;const _0xef3e1b=new Map(),_0x1d3243=new Map(),_0x23d99c=new Map(),_0x54eb7b=new Map(),_0x97b0f6=new Map(),_0x164125=new Map(),_0x3fcd1b=new Map(),_0x4cb929=new Map(),_0x28e349=new Set(),_0x5a0ffc=new Set();for(const _0x271644 of _0x135aea){for(const _0x1fde32 of _0x271644['yaml'][_0x453aba(0x208)]||[]){if(_0x1fde32[_0x453aba(0x20c)]===_0x453aba(0x1ec)&&_0x1fde32['target']){const _0x27553e=parseRef(_0x1fde32[_0x453aba(0x24d)]);if(_0x27553e)_0x28e349[_0x453aba(0x137)](_0x27553e['name']);}else{if(_0x1fde32[_0x453aba(0x20c)]===_0x453aba(0x19d)&&_0x1fde32['target']){const _0x1348cf=parseRef(_0x1fde32[_0x453aba(0x24d)]);if(_0x1348cf)_0x5a0ffc[_0x453aba(0x137)](_0x1348cf['name']);}}}}for(const _0x135141 of _0x28e349){try{const _0x48f27a=await this['client'][_0x453aba(0x1c8)]({'projectId':_0x6bfc08,'name':_0x135141});_0x97b0f6[_0x453aba(0x252)](_0x135141,_0x48f27a['id']),_0x4d1d9a[_0x453aba(0x1ba)][_0x453aba(0x1ea)]({'name':_0x135141,'action':_0x453aba(0x1d6),'id':_0x48f27a['id']}),_0x4d1d9a['counts']['imageGenerators'][_0x453aba(0x1d6)]++;}catch(_0x8036fe){_0x4d1d9a['imageGenerators'][_0x453aba(0x1ea)]({'name':_0x135141,'action':_0x453aba(0x231),'error':_0x8036fe[_0x453aba(0x1d0)]}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x1ba)]['errors']++;}}for(const _0x81f418 of _0x5a0ffc){try{const _0x39db17=await this['client']['createWebSearchTool']({'projectId':_0x6bfc08,'name':_0x81f418});_0x164125[_0x453aba(0x252)](_0x81f418,_0x39db17['id']),_0x4d1d9a['webSearchTools'][_0x453aba(0x1ea)]({'name':_0x81f418,'action':_0x453aba(0x1d6),'id':_0x39db17['id']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x1e8)][_0x453aba(0x1d6)]++;}catch(_0x1c3d1b){_0x4d1d9a[_0x453aba(0x1e8)][_0x453aba(0x1ea)]({'name':_0x81f418,'action':_0x453aba(0x231),'error':_0x1c3d1b['message']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x1e8)][_0x453aba(0x1b2)]++;}}const _0x2abcee=await fetchAllToolTargetMaps((_0x4d4ef0,_0x19d16d)=>this[_0x453aba(0x1ff)][_0x453aba(0x207)](_0x4d4ef0,_0x19d16d),_0x6bfc08);let _0xd2dce=[];const _0x3513d1={'projectId':_0x6bfc08,'resolveToolTargetId':buildIdResolver({..._0x2abcee[_0x453aba(0x1fe)],'KnowledgeBase':_0xef3e1b,'TextKnowledgeBase':_0x1d3243,'ExperimentalKnowledgeBase':_0x3fcd1b,'Agent':_0x23d99c,'WebSearchTool':_0x164125,'ImageGenerator':_0x97b0f6}),'resolvePromptId':async _0x1ddc0a=>_0x54eb7b[_0x453aba(0x20f)](_0x1ddc0a),'onWarning':_0x26f1e1=>{const _0x5d98d5=_0x453aba;this['logger']['warn'](_0x26f1e1),_0xd2dce[_0x5d98d5(0x1ea)](_0x26f1e1);}};for(const _0x148810 of _0x372d5b){try{const _0x187b53=yamlKnowledgeBaseToApi(_0x148810['yaml'],_0x6bfc08),_0x168a8b=await this[_0x453aba(0x1ff)][_0x453aba(0x165)](_0x187b53);_0xef3e1b['set'](_0x148810['yaml'][_0x453aba(0x204)],_0x168a8b['id']),_0x4d1d9a[_0x453aba(0x24c)][_0x453aba(0x1ea)]({'name':_0x148810[_0x453aba(0x198)][_0x453aba(0x204)],'action':_0x453aba(0x1d6),'id':_0x168a8b['id']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x24c)]['created']++;}catch(_0x121372){_0x4d1d9a[_0x453aba(0x24c)][_0x453aba(0x1ea)]({'name':_0x148810[_0x453aba(0x198)][_0x453aba(0x204)],'action':'error','error':_0x121372[_0x453aba(0x1d0)]}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x24c)][_0x453aba(0x1b2)]++;}}for(const _0x2699e5 of _0x10a3de){try{const _0x23c6ed=yamlTextKnowledgeBaseToApi({'name':_0x2699e5[_0x453aba(0x204)],'text':_0x2699e5[_0x453aba(0x1d5)]},_0x6bfc08),_0x564201=await this['client']['createTextKnowledgeBase'](_0x23c6ed);_0x1d3243[_0x453aba(0x252)](_0x2699e5[_0x453aba(0x204)],_0x564201['id']),_0x4d1d9a[_0x453aba(0x144)][_0x453aba(0x1ea)]({'name':_0x2699e5['name'],'action':_0x453aba(0x1d6),'id':_0x564201['id']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x144)][_0x453aba(0x1d6)]++;}catch(_0xd51b99){_0x4d1d9a[_0x453aba(0x144)][_0x453aba(0x1ea)]({'name':_0x2699e5[_0x453aba(0x204)],'action':_0x453aba(0x231),'error':_0xd51b99[_0x453aba(0x1d0)]}),_0x4d1d9a[_0x453aba(0x1de)]['textKnowledgeBases'][_0x453aba(0x1b2)]++;}}for(const _0x496c15 of _0x4c18fd){try{const _0x250a8d=yamlExperimentalArtifactToApi(_0x496c15[_0x453aba(0x1c0)],_0x6bfc08),_0x4e1a5f=await this[_0x453aba(0x1ff)][_0x453aba(0x1ef)](_0x250a8d);_0x4cb929[_0x453aba(0x252)](_0x496c15[_0x453aba(0x1c0)]['name'],_0x4e1a5f['id']),_0x4d1d9a['experimentalArtifacts'][_0x453aba(0x1ea)]({'name':_0x496c15[_0x453aba(0x1c0)][_0x453aba(0x204)],'action':_0x453aba(0x1d6),'id':_0x4e1a5f['id']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x15e)]['created']++;}catch(_0x3089ec){_0x4d1d9a['experimentalArtifacts'][_0x453aba(0x1ea)]({'name':_0x496c15[_0x453aba(0x1c0)]['name'],'action':_0x453aba(0x231),'error':_0x3089ec[_0x453aba(0x1d0)]}),_0x4d1d9a['counts'][_0x453aba(0x15e)][_0x453aba(0x1b2)]++;}}for(const _0x315c3d of _0x38ca26){try{const _0x5d424e=yamlExperimentalKnowledgeBaseToApi(_0x315c3d[_0x453aba(0x1c0)],_0x6bfc08),_0x590303=await this['client'][_0x453aba(0x159)](_0x5d424e);_0x3fcd1b[_0x453aba(0x252)](_0x315c3d['def'][_0x453aba(0x204)],_0x590303['id']),_0x4d1d9a[_0x453aba(0x23d)][_0x453aba(0x1ea)]({'name':_0x315c3d[_0x453aba(0x1c0)]['name'],'action':'created','id':_0x590303['id']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x23d)][_0x453aba(0x1d6)]++;}catch(_0x38c386){_0x4d1d9a[_0x453aba(0x23d)][_0x453aba(0x1ea)]({'name':_0x315c3d['def'][_0x453aba(0x204)],'action':'error','error':_0x38c386[_0x453aba(0x1d0)]}),_0x4d1d9a['counts'][_0x453aba(0x23d)][_0x453aba(0x1b2)]++;}}const _0x40a87a=[..._0x135aea][_0x453aba(0x1d8)]((_0x48d143,_0x21ab3c)=>{const _0x39dbb5=_0x453aba,_0x37714f=_0x48d143['yaml'][_0x39dbb5(0x208)]?.['some'](_0x237684=>_0x237684[_0x39dbb5(0x20c)]===_0x39dbb5(0x22a))??![],_0x47ee31=_0x21ab3c[_0x39dbb5(0x198)]['tools']?.[_0x39dbb5(0x20d)](_0x35e326=>_0x35e326['type']===_0x39dbb5(0x22a))??![];if(_0x37714f&&!_0x47ee31)return 0x1;if(!_0x37714f&&_0x47ee31)return-0x1;return 0x0;});for(const _0x1fe3d9 of _0x40a87a){_0xd2dce=[];try{const _0x372785=_0x1fe3d9[_0x453aba(0x198)]['tools']?.[_0x453aba(0x157)](_0x5da30d=>{const _0x5c735a=_0x453aba;if(_0x5da30d['type']===_0x5c735a(0x22a)&&_0x5da30d[_0x5c735a(0x24d)]){const _0x12a4c2=parseRef(_0x5da30d[_0x5c735a(0x24d)]);return _0x12a4c2?.['name']===_0x1fe3d9[_0x5c735a(0x198)][_0x5c735a(0x204)];}return![];})??[];if(_0x372785[_0x453aba(0x181)]>0x0){const _0x5ef8ae=_0x453aba(0x227)+_0x1fe3d9[_0x453aba(0x198)][_0x453aba(0x204)]+_0x453aba(0x141)+_0x453aba(0x14c);this[_0x453aba(0x1d3)][_0x453aba(0x226)](_0x5ef8ae),_0xd2dce[_0x453aba(0x1ea)](_0x5ef8ae);}const _0x401c9a=await agentDefToRequest(_0x1fe3d9['yaml'],_0x1fe3d9[_0x453aba(0x168)],_0x1fe3d9['starterMessage'],_0x3513d1),_0x145ce3=await this[_0x453aba(0x1ff)][_0x453aba(0x1e2)](_0x401c9a);_0x23d99c[_0x453aba(0x252)](_0x1fe3d9[_0x453aba(0x198)][_0x453aba(0x204)],_0x145ce3['id']),_0x4d1d9a['agents'][_0x453aba(0x1ea)]({'agentName':_0x1fe3d9['yaml'][_0x453aba(0x204)],'action':_0x453aba(0x1d6),'agentId':_0x145ce3['id'],'warnings':_0xd2dce[_0x453aba(0x181)]>0x0?_0xd2dce:undefined}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x163)][_0x453aba(0x1d6)]++;}catch(_0x497eab){_0x4d1d9a[_0x453aba(0x163)]['push']({'agentName':_0x1fe3d9['yaml'][_0x453aba(0x204)],'action':'error','error':_0x497eab[_0x453aba(0x1d0)],'warnings':_0xd2dce[_0x453aba(0x181)]>0x0?_0xd2dce:undefined}),_0x4d1d9a['counts'][_0x453aba(0x163)]['errors']++;}}for(const _0x3a25d0 of _0x4fea4d){try{const _0x1c69d4=await yamlPromptToApi(_0x3a25d0['yaml'],_0x6bfc08,_0x3513d1);if(!_0x1c69d4){_0x4d1d9a['prompts'][_0x453aba(0x1ea)]({'name':_0x3a25d0[_0x453aba(0x198)]['name'],'action':_0x453aba(0x231),'error':_0x453aba(0x1b6)}),_0x4d1d9a['counts'][_0x453aba(0x1fc)][_0x453aba(0x1b2)]++;continue;}const _0x5aab48=await this[_0x453aba(0x1ff)][_0x453aba(0x1d4)](_0x1c69d4);_0x54eb7b['set'](_0x3a25d0[_0x453aba(0x198)]['name'],_0x5aab48['id']),_0x4d1d9a[_0x453aba(0x1fc)][_0x453aba(0x1ea)]({'name':_0x3a25d0['yaml'][_0x453aba(0x204)],'action':_0x453aba(0x1d6),'id':_0x5aab48['id']}),_0x4d1d9a[_0x453aba(0x1de)]['prompts']['created']++;}catch(_0x5e8d13){_0x4d1d9a['prompts'][_0x453aba(0x1ea)]({'name':_0x3a25d0['yaml']['name'],'action':_0x453aba(0x231),'error':_0x5e8d13[_0x453aba(0x1d0)]}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x1fc)][_0x453aba(0x1b2)]++;}}for(const _0x339225 of _0x344bbc){try{const _0x1791a2=await yamlIntegrationToApi(_0x339225[_0x453aba(0x198)],_0x6bfc08,_0x3513d1),_0x3dd356=await this[_0x453aba(0x1ff)][_0x453aba(0x1c5)](_0x1791a2);_0x4d1d9a[_0x453aba(0x17b)][_0x453aba(0x1ea)]({'name':_0x339225['yaml'][_0x453aba(0x139)],'action':_0x453aba(0x1d6),'id':_0x3dd356['id']}),_0x4d1d9a[_0x453aba(0x1de)]['integrations'][_0x453aba(0x1d6)]++;}catch(_0x435652){_0x4d1d9a['integrations'][_0x453aba(0x1ea)]({'name':_0x339225[_0x453aba(0x198)][_0x453aba(0x139)],'action':'error','error':_0x435652['message']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x17b)][_0x453aba(0x1b2)]++;}}for(const _0x1ef6bf of _0x5f02cd){try{const _0x59acf4=await yamlFormInterfaceToApi(_0x1ef6bf[_0x453aba(0x198)],_0x6bfc08,_0x3513d1);if(!_0x59acf4){_0x4d1d9a['formInterfaces'][_0x453aba(0x1ea)]({'name':_0x1ef6bf[_0x453aba(0x198)][_0x453aba(0x204)],'action':_0x453aba(0x231),'error':_0x453aba(0x233)}),_0x4d1d9a[_0x453aba(0x1de)]['formInterfaces']['errors']++;continue;}const _0xe5ddb1=await this[_0x453aba(0x1ff)]['createFormInterface'](_0x59acf4);_0x4d1d9a[_0x453aba(0x239)][_0x453aba(0x1ea)]({'name':_0x1ef6bf['yaml'][_0x453aba(0x204)],'action':_0x453aba(0x1d6),'id':_0xe5ddb1['id']}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x239)][_0x453aba(0x1d6)]++;}catch(_0x5da136){_0x4d1d9a['formInterfaces'][_0x453aba(0x1ea)]({'name':_0x1ef6bf['yaml'][_0x453aba(0x204)],'action':_0x453aba(0x231),'error':_0x5da136[_0x453aba(0x1d0)]}),_0x4d1d9a[_0x453aba(0x1de)][_0x453aba(0x239)][_0x453aba(0x1b2)]++;}}for(const _0x37efe9 of _0x406843){try{const _0x379be1=await yamlChatInterfaceToApi(_0x37efe9[_0x453aba(0x198)],_0x6bfc08,_0x3513d1),_0x510ac6=await this[_0x453aba(0x1ff)][_0x453aba(0x18f)](_0x379be1);_0x4d1d9a[_0x453aba(0x158)][_0x453aba(0x1ea)]({'name':_0x37efe9[_0x453aba(0x198)][_0x453aba(0x204)],'action':'created','id':_0x510ac6['id']}),_0x4d1d9a['counts'][_0x453aba(0x158)][_0x453aba(0x1d6)]++;}catch(_0x26290e){_0x4d1d9a[_0x453aba(0x158)]['push']({'name':_0x37efe9[_0x453aba(0x198)][_0x453aba(0x204)],'action':_0x453aba(0x231),'error':_0x26290e[_0x453aba(0x1d0)]}),_0x4d1d9a[_0x453aba(0x1de)]['chatInterfaces'][_0x453aba(0x1b2)]++;}}return _0x4d1d9a;}}
|
|
1
|
+
const a134_0x1280fc=a134_0x357b;(function(_0x63f38c,_0x406e75){const _0x6ec7af=a134_0x357b,_0x513051=_0x63f38c();while(!![]){try{const _0x46d4ca=-parseInt(_0x6ec7af(0x21c))/0x1+-parseInt(_0x6ec7af(0x294))/0x2+parseInt(_0x6ec7af(0x27f))/0x3+-parseInt(_0x6ec7af(0x274))/0x4*(parseInt(_0x6ec7af(0x278))/0x5)+parseInt(_0x6ec7af(0x20b))/0x6+parseInt(_0x6ec7af(0x23f))/0x7+parseInt(_0x6ec7af(0x26e))/0x8;if(_0x46d4ca===_0x406e75)break;else _0x513051['push'](_0x513051['shift']());}catch(_0x2b0c31){_0x513051['push'](_0x513051['shift']());}}}(a134_0x4cab,0xa1272));import{LLMApiClient}from'../client/llm-api-client.js';import*as a134_0x4f3caa from'node:fs';import*as a134_0xb4a0ec from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{toModelInfos}from'./user-settings.js';function a134_0x4cab(){const _0x44d521=['def','tdDatabaseName','idToName','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','1059546dmjcns','file_name','text_content','currentProjectId','chatIgnoreManagedActions','\x27.\x20This\x20should\x20not\x20happen.','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','has','agent.yml','toISOString','tools','total','integrations','loadJsonFile','pushAgent','info','Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.','low','readFileSync','Renamed\x20form\x20interface\x20file:\x20','writeFileSync','length','filter','listPrompts','project.json','duplicate','\x0a---\x20code\x20---\x0a','backupProject','listTextKnowledgeBases','setCurrentProject','updateExperimentalKnowledgeBase','attributes','formInterfaces','template','webhookCorsOrigins','json_schema','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','chat','path','listImageGenerators','deleteProject','Renamed\x20integration\x20file:\x20','getDefaultAgent','web_search','AGENT_NOT_FOUND','Renamed\x20agent\x20folder:\x20','\x20---\x0a','createFormInterface','keys','errors','newProjectId','utf-8','context','createIntegration','event','localeCompare','#\x20prompt.md\x0a','site','Agent\x20reference\x20not\x20found','message','createTextKnowledgeBase','maxToolIterations','listProjects','\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20','logger','listAgents','NOT_FOUND','agent','service_type','cloneProject','error','listChatInterfaces','agents','Renamed\x20KB\x20file:\x20','---\x20file:\x20','already\x20exists','get','chat_interfaces','dry-run-','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.','isManaged','claude-4.5-sonnet','temperature','.yml','json_schema.json','deleteAgent','map','experimentalKnowledgeBases','Renamed\x20text\x20KB\x20file:\x20','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','parse','tdx_default_','starterMessage','createAgentResponse','getDefaultProjectName','Project\x20\x22','updateTextKnowledgeBase','):\x20','getChatInfo','target','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.','updateFormInterface','name','listIntegrations','updateAgentResponse','listExperimentalKnowledgeBases','chat_parent_segment','updatePrompt','Only\x20safe\x20types\x20(','listAgentsFull','Agent\x20not\x20found:\x20','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','Removed\x20deleted\x20directory:\x20','knowledgeBases','endsWith','Renamed\x20chat\x20interface\x20file:\x20','getCurrentProject','.md','resolveProjectId','warn','starter_message',')\x20can\x20be\x20pushed.\x20','isDir','find','getProject','history','setDefaultAgent','size','integrations.json','new','counts','createProject','tdx.json','(dry-run)','slackMessageMode','split','systemPrompt','project','stringify','getAgent','files','getOrCreateDefaultProject','getOrCreateDefaultAgent','client','signal','isFile','\x0a\x0a#\x20agent.yml\x0a','INVALID_ARGUMENT','createExperimentalKnowledgeBase','Skipping\x20integration\x20\x27','experimentalArtifacts','1464300ZQLiye','includes','knowledge_bases','clearDefaultAgent','mkdirSync','.llm','.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.','code.js','experimental_artifacts','prompt.md','action','type','---\x20schema:\x20','rmSync','KnowledgeBase','Removed\x20deleted\x20file:\x20','createExperimentalArtifact','1010302QLNVhq','\x27\x20(','listWebSearchTools','medium','webSearchTools','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','Available\x20agents:\x20','form_interfaces','\x0a---\x20schema:\x20','image_gen','\x0a---\x20function:\x20','dir','description','profile','listFormInterfaces','Unable\x20to\x20create\x20project\x20after\x20','INTERNAL','Multiple\x20agents\x20found\x20with\x20name\x20\x27','chat_generic','starter_message.md','text','unlinkSync','updated','chats','renamed','Invalid\x20agent\x20reference\x20format:\x20','Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20','Renamed\x20prompt\x20file:\x20','createWebSearchTool','UNAUTHENTICATED','unchanged','toLowerCase','basename',')\x20can\x20be\x20cloned.','sort','7508333QHcWeA','_reasoning_','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','\x20in\x20project\x20','Unsupported\x20backup\x20version:\x20','Renamed\x20experimental\x20artifact\x20directory:\x20','imageGenerators','add','listKnowledgeBases','dryRun','readdirSync','createChatInterface','resolveAgentId','listToolTargets','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','projectName','functions','ALREADY_EXISTS','updateAgent','getBackupMetadata','Unresolved\x20dependencies:\x20','oldPath','agentId','createPrompt','projects','some','resolveProjectName','createAgent','Agent\x20\x27','tdx_','prompts','chat_agent_console','textKnowledgeBases','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','getChatHistory','Multiple\x20projects\x20found\x20with\x20name\x20\x27','startChat','createKnowledgeBase','Project\x20not\x20found:\x20','chatInterfaces','agents.json','statSync','createImageGenerator','updateKnowledgeBase','status','Could\x20not\x20resolve\x20agent\x20reference','agentsFull','8267528GQWDan','set','exportedFrom','join','high','existsSync','1203692UZXpWj','chatWelcomeMessage','Renamed\x20folder:\x20','push','15AYequa','Renamed\x20experimental\x20KB\x20directory:\x20','deleteIntegration','created','LLM_PROJECT_NOT_FOUND','content','isDirectory','2258448reErHG','llm_project','updateExperimentalArtifact','TextKnowledgeBase','experimental_knowledge_bases','dirname','promptId','chatId','variables','nameToId','sdk.llm','code','yaml','getChatLog','\x20→\x20','knowledgebases.json','serviceType'];a134_0x4cab=function(){return _0x44d521;};return a134_0x4cab();}import{SDKError,ErrorCode,errorContains}from'../errors.js';import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,apiFormInterfaceToYaml,apiChatInterfaceToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,toFormInterfaceYamlString,toChatInterfaceYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,parseFormInterfaceYaml,parseChatInterfaceYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,yamlFormInterfaceToApi,yamlChatInterfaceToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';function a134_0x357b(_0x109b72,_0x1f7db6){_0x109b72=_0x109b72-0x177;const _0x4cab85=a134_0x4cab();let _0x357b4e=_0x4cab85[_0x109b72];return _0x357b4e;}import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir,getFormInterfacesDir,getChatInterfacesDir}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=[a134_0x1280fc(0x22e),a134_0x1280fc(0x25e),a134_0x1280fc(0x1de)];async function safeListOrEmpty(_0xd223a1){const _0x340b6b=a134_0x1280fc;try{return await _0xd223a1();}catch(_0x92bddf){if(_0x92bddf instanceof HTTPClientError&&_0x92bddf[_0x340b6b(0x26b)]===0x194)return[];throw _0x92bddf;}}export class LLMSDK{[a134_0x1280fc(0x177)];[a134_0x1280fc(0x203)];[a134_0x1280fc(0x1a8)];[a134_0x1280fc(0x1b4)]=Logger['of'](a134_0x1280fc(0x289));constructor(_0x1c2211){const _0x121c8a=a134_0x1280fc;this[_0x121c8a(0x203)]=new LLMApiClient(_0x1c2211),this[_0x121c8a(0x1a8)]=_0x1c2211;}[a134_0x1280fc(0x1d2)](){const _0x377ad2=a134_0x1280fc,_0x4e3a50=getSanitizedUsername();return _0x377ad2(0x1cf)+_0x4e3a50;}async[a134_0x1280fc(0x191)](_0x5b9528){const _0xe1dafb=a134_0x1280fc,{projectId:_0x341be9}=await this[_0xe1dafb(0x259)](_0x5b9528);this[_0xe1dafb(0x177)]=_0x341be9;}[a134_0x1280fc(0x1e8)](){const _0x22dff4=a134_0x1280fc;return this[_0x22dff4(0x177)];}async[a134_0x1280fc(0x1f2)](_0x2585d1){const _0x29cf3a=a134_0x1280fc,_0x1f8f75=this[_0x29cf3a(0x1a8)][_0x29cf3a(0x229)];let _0x18cc46,_0x177271;if(_0x2585d1[_0x29cf3a(0x20c)]('/')){const _0x4fa31e=_0x2585d1[_0x29cf3a(0x1fb)]('/');if(_0x4fa31e['length']!==0x2)throw new SDKError(ErrorCode[_0x29cf3a(0x207)],_0x29cf3a(0x235)+_0x2585d1,undefined,{'helpText':_0x29cf3a(0x260)});const [_0x5234cc,_0x124f13]=_0x4fa31e;_0x18cc46=await this['resolveProjectId'](_0x5234cc),_0x177271=_0x124f13;}else _0x18cc46=this[_0x29cf3a(0x177)]||(await this[_0x29cf3a(0x201)]())['id'],_0x177271=_0x2585d1;const _0x1bfff9=await this[_0x29cf3a(0x24b)](_0x177271,_0x18cc46),_0xbaa63d=await this[_0x29cf3a(0x203)][_0x29cf3a(0x1ff)](_0x1bfff9);writeCachedLLMAgent(_0xbaa63d['attributes'][_0x29cf3a(0x1da)],_0x1bfff9,_0x18cc46,_0x1f8f75);}[a134_0x1280fc(0x19e)](){const _0x3fd463=a134_0x1280fc,_0x2c7dab=this[_0x3fd463(0x1a8)][_0x3fd463(0x229)];return readCachedLLMAgent(_0x2c7dab)||undefined;}[a134_0x1280fc(0x20e)](){const _0x2f588b=a134_0x1280fc,_0x76e640=this[_0x2f588b(0x1a8)]['profile'];clearCachedLLMAgent(_0x76e640);}async['models'](){const _0xa9529d=a134_0x1280fc,_0x11f351=await this[_0xa9529d(0x203)]['getUserSettings']();return toModelInfos(_0x11f351);}async[a134_0x1280fc(0x1f7)](_0x544ef7){const _0x32046a=a134_0x1280fc;return await this['client'][_0x32046a(0x1f7)](_0x544ef7);}async[a134_0x1280fc(0x19c)](_0x17c524){const _0x40d0e4=a134_0x1280fc,{projectId:_0x1bb6d1}=await this[_0x40d0e4(0x259)](_0x17c524);await this[_0x40d0e4(0x203)][_0x40d0e4(0x19c)](_0x1bb6d1);}async[a134_0x1280fc(0x257)](_0x2f4163=0x32){const _0x114099=a134_0x1280fc;return await this[_0x114099(0x203)][_0x114099(0x1b2)](_0x2f4163);}async[a134_0x1280fc(0x201)](_0xe0d31c){const _0x57a985=a134_0x1280fc,_0x3bfd42=_0xe0d31c||this[_0x57a985(0x1d2)](),_0x514561=this[_0x57a985(0x1a8)]['profile'];if(!_0xe0d31c){const _0x1415f5=readCachedLLMProject(_0x514561);if(_0x1415f5&&_0x1415f5['name']===_0x3bfd42)try{const _0x2d5914=await this['client'][_0x57a985(0x1f0)](_0x1415f5['id']);if(_0x2d5914['attributes'][_0x57a985(0x1da)]===_0x3bfd42)return _0x2d5914;}catch{}}const _0x443a59=await this['client']['listProjects'](),_0xfd4988=_0x443a59[_0x57a985(0x1ef)](_0x1945f3=>_0x1945f3[_0x57a985(0x193)][_0x57a985(0x1da)]===_0x3bfd42);if(_0xfd4988)return!_0xe0d31c&&writeCachedLLMProject(_0x3bfd42,_0xfd4988['id'],_0x514561),_0xfd4988;const _0x2c5057=await this[_0x57a985(0x203)][_0x57a985(0x1f7)]({'name':_0x3bfd42,'description':'Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20'+getSanitizedUsername()+')'});return!_0xe0d31c&&writeCachedLLMProject(_0x3bfd42,_0x2c5057['id'],_0x514561),_0x2c5057;}async['resolveProjectId'](_0x5971d4){const _0x3f98f6=a134_0x1280fc,_0x1b1112=await this[_0x3f98f6(0x203)][_0x3f98f6(0x1b2)](),_0x5a6279=_0x1b1112[_0x3f98f6(0x18a)](_0x5bf322=>_0x5bf322[_0x3f98f6(0x193)]['name']===_0x5971d4);if(_0x5a6279[_0x3f98f6(0x189)]===0x0)throw new SDKError(ErrorCode[_0x3f98f6(0x27c)],'Project\x20not\x20found:\x20'+_0x5971d4,undefined,{'helpText':_0x3f98f6(0x17a)});if(_0x5a6279[_0x3f98f6(0x189)]>0x1)throw new SDKError(ErrorCode[_0x3f98f6(0x22c)],_0x3f98f6(0x262)+_0x5971d4+_0x3f98f6(0x179));return _0x5a6279[0x0]['id'];}async['resolveProjectName'](_0x2e3f74){const _0x2cb3d5=a134_0x1280fc,_0x2a20f0=await this[_0x2cb3d5(0x203)][_0x2cb3d5(0x1b2)](),_0x4255f7=_0x2a20f0[_0x2cb3d5(0x1ef)](_0x61c3a4=>_0x61c3a4[_0x2cb3d5(0x193)][_0x2cb3d5(0x1da)]===_0x2e3f74);if(_0x4255f7)return{'projectId':_0x4255f7['id'],'project':_0x4255f7};throw new SDKError(ErrorCode[_0x2cb3d5(0x27c)],_0x2cb3d5(0x265)+_0x2e3f74,undefined,{'helpText':_0x2cb3d5(0x17a)});}async[a134_0x1280fc(0x202)](_0x5a29a9=a134_0x1280fc(0x1c5),_0x4b1f6c=0x0,_0x5a66a8){const _0x58873a=a134_0x1280fc,_0x531552=0xa;let _0x3ca027=0x0,_0xe9d189;while(_0x3ca027<_0x531552){try{const _0x4d75bf=await this[_0x58873a(0x201)](_0xe9d189),_0x58b344=_0x4d75bf['id'],_0x496833=['none','minimal',_0x58873a(0x185),_0x58873a(0x21f),_0x58873a(0x272)],_0x1258e2=_0x4b1f6c===0x0?'tdx_'+_0x5a29a9:_0x58873a(0x25c)+_0x5a29a9+_0x58873a(0x240)+_0x496833[_0x4b1f6c],_0x3febf3=await this[_0x58873a(0x203)][_0x58873a(0x1b5)](_0x58b344),_0x389a81=_0x3febf3[_0x58873a(0x1ef)](_0x38685e=>_0x38685e[_0x58873a(0x193)][_0x58873a(0x1da)]===_0x1258e2);if(_0x389a81)return _0x389a81;const _0x27b363=_0x4b1f6c>0x0?0x1:_0x5a66a8;return await this[_0x58873a(0x203)][_0x58873a(0x25a)]({'name':_0x1258e2,'projectId':_0x58b344,'modelType':_0x5a29a9,'systemPrompt':'','temperature':_0x27b363,'reasoningEffort':_0x4b1f6c>0x0?_0x4b1f6c:undefined});}catch(_0x312132){if(_0x312132 instanceof HTTPClientError){const _0x3f3659=_0x312132['status'];if(_0x3f3659>=0x190&&_0x3f3659<0x1f4){if(_0x3f3659===0x191)throw new SDKError(ErrorCode[_0x58873a(0x239)],_0x58873a(0x293),_0x312132);else{if(_0x3f3659===0x193)throw new SDKError(ErrorCode['PERMISSION_DENIED'],'Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.',_0x312132);}throw _0x312132;}}if(errorContains(_0x312132,_0x58873a(0x1bf),_0x58873a(0x18d),'conflict')){_0x3ca027++;if(_0x3ca027>=_0x531552)throw new SDKError(ErrorCode['ALREADY_EXISTS'],_0x58873a(0x22b)+_0x531552+'\x20attempts\x20due\x20to\x20name\x20conflicts.',_0x312132);const _0x3a1017=this['getDefaultProjectName']();_0xe9d189=_0x3a1017+'_'+generateRandomHex();continue;}throw _0x312132;}}throw new SDKError(ErrorCode[_0x58873a(0x22c)],_0x58873a(0x198));}async[a134_0x1280fc(0x24b)](_0x8457e,_0x574791){const _0x355e5f=a134_0x1280fc,_0x19c86b=_0x574791||this['currentProjectId'],_0x45fd8e=await this['client'][_0x355e5f(0x1b5)](_0x19c86b),_0x54f14e=_0x45fd8e[_0x355e5f(0x18a)](_0x322f54=>_0x322f54['attributes'][_0x355e5f(0x1da)]===_0x8457e);if(_0x54f14e[_0x355e5f(0x189)]===0x0){const _0x47072a=_0x19c86b?_0x355e5f(0x242)+_0x19c86b:'';throw new SDKError(ErrorCode['AGENT_NOT_FOUND'],_0x355e5f(0x1e2)+_0x8457e+_0x47072a,undefined,{'helpText':_0x19c86b?_0x355e5f(0x1e3):_0x355e5f(0x1d8)});}if(_0x54f14e[_0x355e5f(0x189)]>0x1)throw new SDKError(ErrorCode[_0x355e5f(0x22c)],_0x355e5f(0x22d)+_0x8457e+'\x27.\x20This\x20should\x20not\x20happen.');return _0x54f14e[0x0]['id'];}async[a134_0x1280fc(0x1bc)](_0x7cac48){const _0x5d6957=a134_0x1280fc,_0x5ba806=_0x7cac48||this[_0x5d6957(0x177)];return await this[_0x5d6957(0x203)][_0x5d6957(0x1b5)](_0x5ba806);}async[a134_0x1280fc(0x26d)](_0x388d9c){const _0x24c189=a134_0x1280fc;return await this[_0x24c189(0x203)][_0x24c189(0x1e1)](_0x388d9c);}async[a134_0x1280fc(0x1b7)](_0x39ac7c){const _0x50831f=a134_0x1280fc;return await this[_0x50831f(0x203)][_0x50831f(0x1ff)](_0x39ac7c);}async[a134_0x1280fc(0x25a)](_0x503a65){const _0x2688ee=a134_0x1280fc;return await this['client'][_0x2688ee(0x25a)](_0x503a65);}async[a134_0x1280fc(0x251)](_0x32fff1,_0x4513c5){const _0x480e9a=a134_0x1280fc;return await this[_0x480e9a(0x203)][_0x480e9a(0x251)](_0x32fff1,_0x4513c5);}async[a134_0x1280fc(0x1c9)](_0xcc19d2){const _0x2a7d20=a134_0x1280fc;await this[_0x2a7d20(0x203)][_0x2a7d20(0x1c9)](_0xcc19d2);}async[a134_0x1280fc(0x263)](_0x39fafd){const _0x5db47b=a134_0x1280fc;return await this['client'][_0x5db47b(0x263)]({'agentId':_0x39fafd});}async*[a134_0x1280fc(0x199)](_0x4201cb,_0x115932){const _0x317bef=a134_0x1280fc;let _0x5b5927=_0x115932?.[_0x317bef(0x286)];const _0xd6bca6=_0x115932?.['agentId'];if(!_0x5b5927){if(!_0xd6bca6)throw new Error('agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat');const _0x36c9ee=await this[_0x317bef(0x203)][_0x317bef(0x263)]({'agentId':_0xd6bca6});_0x5b5927=_0x36c9ee['id'],yield{'type':'metadata','data':{'chatId':_0x5b5927,'agentId':_0xd6bca6,'projectId':_0x36c9ee[_0x317bef(0x193)]['projectId']}};}for await(const _0x13b782 of this['client']['continueChat'](_0x5b5927,_0x4201cb,_0x115932?.[_0x317bef(0x204)])){yield{'type':_0x317bef(0x1aa),'data':_0x13b782};}}async[a134_0x1280fc(0x233)](_0x1cab66=0x32){const _0x180bba=a134_0x1280fc;return await this[_0x180bba(0x203)]['listChats'](_0x1cab66);}async[a134_0x1280fc(0x1f1)](_0x23282c){const _0x34aacb=a134_0x1280fc;return await this['client'][_0x34aacb(0x261)](_0x23282c);}async['getChatLog'](_0x325b22){const _0x684de5=a134_0x1280fc;return await this[_0x684de5(0x203)][_0x684de5(0x28c)](_0x325b22);}async['chatInfo'](_0x1cc3f8){const _0x5223a8=a134_0x1280fc;return await this[_0x5223a8(0x203)][_0x5223a8(0x1d6)](_0x1cc3f8);}async[a134_0x1280fc(0x18f)](_0x6c5116,_0x3e4af5,_0x1c71d0){const _0x8cc1ad=a134_0x1280fc,_0x4516dc=_0x1c71d0?.[_0x8cc1ad(0x248)]??![],{projectId:_0x5d501b,project:_0xcaebd3}=await this[_0x8cc1ad(0x259)](_0x6c5116),_0x58ab9b=_0xcaebd3['attributes'][_0x8cc1ad(0x1da)],_0xd1ea7e=_0x3e4af5||_0x58ab9b+_0x8cc1ad(0x210);if(a134_0x4f3caa[_0x8cc1ad(0x273)](_0xd1ea7e)&&!_0x4516dc)throw new SDKError(ErrorCode[_0x8cc1ad(0x250)],'Output\x20directory\x20already\x20exists:\x20'+_0xd1ea7e,undefined,{'helpText':_0x8cc1ad(0x1c3)});const _0x52df8f=await this[_0x8cc1ad(0x203)][_0x8cc1ad(0x1e1)](_0x5d501b),_0x5b5124=await this[_0x8cc1ad(0x203)]['listKnowledgeBases'](_0x5d501b),_0x3eb08c=await this['client'][_0x8cc1ad(0x18b)](_0x5d501b),_0x4dbc26=await this[_0x8cc1ad(0x203)]['listIntegrations'](_0x5d501b);if(!_0x4516dc){a134_0x4f3caa['mkdirSync'](_0xd1ea7e,{'recursive':!![]});const _0xa671e1={'version':'1.0','exportedAt':new Date()[_0x8cc1ad(0x17d)](),'exportedFrom':{'site':this['context'][_0x8cc1ad(0x1ad)],'projectId':_0x5d501b,'projectName':_0x58ab9b},'project':_0xcaebd3};a134_0x4f3caa[_0x8cc1ad(0x188)](a134_0xb4a0ec['join'](_0xd1ea7e,_0x8cc1ad(0x18c)),JSON[_0x8cc1ad(0x1fe)](_0xa671e1,null,0x2)),a134_0x4f3caa[_0x8cc1ad(0x188)](a134_0xb4a0ec[_0x8cc1ad(0x271)](_0xd1ea7e,_0x8cc1ad(0x267)),JSON[_0x8cc1ad(0x1fe)](_0x52df8f,null,0x2)),a134_0x4f3caa[_0x8cc1ad(0x188)](a134_0xb4a0ec[_0x8cc1ad(0x271)](_0xd1ea7e,_0x8cc1ad(0x28e)),JSON[_0x8cc1ad(0x1fe)](_0x5b5124,null,0x2)),a134_0x4f3caa[_0x8cc1ad(0x188)](a134_0xb4a0ec['join'](_0xd1ea7e,'prompts.json'),JSON[_0x8cc1ad(0x1fe)](_0x3eb08c,null,0x2)),a134_0x4f3caa['writeFileSync'](a134_0xb4a0ec[_0x8cc1ad(0x271)](_0xd1ea7e,_0x8cc1ad(0x1f4)),JSON[_0x8cc1ad(0x1fe)](_0x4dbc26,null,0x2));}return{'projectName':_0x58ab9b,'outputDir':_0xd1ea7e,'counts':{'agents':_0x52df8f['length'],'knowledgeBases':_0x5b5124[_0x8cc1ad(0x189)],'prompts':_0x3eb08c['length'],'integrations':_0x4dbc26['length']}};}async['restoreProject'](_0x44e4f8,_0x31834e){const _0x4146ae=a134_0x1280fc,_0x16fa56=_0x31834e?.[_0x4146ae(0x248)]??![],_0x47189f=this['getBackupMetadata'](_0x44e4f8),_0x211d8d=_0x47189f[_0x4146ae(0x270)][_0x4146ae(0x1ad)],_0x11b4b1=this['context'][_0x4146ae(0x1ad)],_0x3e7ea7=_0x211d8d!==_0x11b4b1?_0x211d8d:undefined,_0x29892a=this['loadJsonFile'](a134_0xb4a0ec['join'](_0x44e4f8,_0x4146ae(0x267)),[]),_0x20c693=this['loadJsonFile'](a134_0xb4a0ec[_0x4146ae(0x271)](_0x44e4f8,_0x4146ae(0x28e)),[]),_0x26301c=this[_0x4146ae(0x181)](a134_0xb4a0ec[_0x4146ae(0x271)](_0x44e4f8,'prompts.json'),[]),_0x5b3292=this[_0x4146ae(0x181)](a134_0xb4a0ec[_0x4146ae(0x271)](_0x44e4f8,_0x4146ae(0x1f4)),[]),_0x301bea=_0x31834e?.[_0x4146ae(0x1da)]||_0x47189f[_0x4146ae(0x270)][_0x4146ae(0x24e)];if(_0x16fa56){const _0x1910ca=new Map(),_0x355432=[..._0x29892a],_0x357ae3=_0x29892a[_0x4146ae(0x189)]+0x1;let _0xf389f5=0x0;while(_0x355432[_0x4146ae(0x189)]>0x0&&_0xf389f5<_0x357ae3){_0xf389f5++;const _0xbf866a=[];for(const _0x13d7fa of _0x355432){canCreateAgent(_0x13d7fa,_0x1910ca)?_0x1910ca[_0x4146ae(0x26f)](_0x13d7fa['id'],_0x4146ae(0x1c2)+_0x13d7fa['id']):_0xbf866a[_0x4146ae(0x277)](_0x13d7fa);}if(_0xbf866a['length']===_0x355432['length'])throw new SDKError(ErrorCode[_0x4146ae(0x22c)],_0x4146ae(0x241),undefined,{'helpText':'The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.'});_0x355432[_0x4146ae(0x189)]=0x0,_0x355432[_0x4146ae(0x277)](..._0xbf866a);}const _0x3b2c47=_0x26301c[_0x4146ae(0x18a)](_0x203edc=>_0x1910ca['has'](_0x203edc[_0x4146ae(0x193)][_0x4146ae(0x255)]))[_0x4146ae(0x189)];return{'projectName':_0x301bea,'projectId':_0x4146ae(0x1f9),'counts':{'agents':_0x29892a['length'],'knowledgeBases':_0x20c693['length'],'prompts':_0x3b2c47,'integrations':_0x5b3292[_0x4146ae(0x189)]},'sourceSite':_0x3e7ea7};}const _0x1dc163=await this[_0x4146ae(0x203)][_0x4146ae(0x1f7)]({'name':_0x301bea,'description':_0x47189f[_0x4146ae(0x1fd)][_0x4146ae(0x193)][_0x4146ae(0x228)]}),_0x15aa2e=_0x1dc163['id'],_0x5f2bf4=new Map(),_0x3eea21=new Map(),_0x4f5b55=new Map();for(const _0x1c9cb8 of _0x20c693){const _0x59a1c0=await this[_0x4146ae(0x203)]['createKnowledgeBase']({'projectId':_0x15aa2e,'name':_0x1c9cb8[_0x4146ae(0x193)][_0x4146ae(0x1da)],'tdDatabaseName':_0x1c9cb8[_0x4146ae(0x193)][_0x4146ae(0x291)],'tables':_0x1c9cb8[_0x4146ae(0x193)]['tables']});_0x5f2bf4['set'](_0x1c9cb8['id'],_0x59a1c0['id']);}const _0x2b3625=[..._0x29892a],_0x24173d=_0x29892a[_0x4146ae(0x189)]+0x1;let _0x14fd77=0x0;while(_0x2b3625[_0x4146ae(0x189)]>0x0&&_0x14fd77<_0x24173d){_0x14fd77++;const _0x5c3f84=[];for(const _0x530e31 of _0x2b3625){if(canCreateAgent(_0x530e31,_0x3eea21)){const _0x35d53a=remapToolIds(_0x530e31[_0x4146ae(0x193)][_0x4146ae(0x17e)],_0x5f2bf4,_0x3eea21),_0x430c13=remapVariableIds(_0x530e31[_0x4146ae(0x193)][_0x4146ae(0x287)],_0x5f2bf4),_0x4102fd=await this[_0x4146ae(0x203)][_0x4146ae(0x1d1)]({'name':_0x530e31[_0x4146ae(0x193)][_0x4146ae(0x1da)],'projectId':_0x15aa2e,'systemPrompt':_0x530e31[_0x4146ae(0x193)][_0x4146ae(0x1fc)],'starterMessage':_0x530e31[_0x4146ae(0x193)][_0x4146ae(0x1d0)],'modelType':migrateModelType(_0x530e31[_0x4146ae(0x193)]['modelType']),'maxToolIterations':_0x530e31[_0x4146ae(0x193)][_0x4146ae(0x1b1)],'temperature':_0x530e31[_0x4146ae(0x193)][_0x4146ae(0x1c6)],'reasoningEffort':_0x530e31[_0x4146ae(0x193)]['reasoningEffort'],'outputs':_0x530e31[_0x4146ae(0x193)]['outputs'],'tools':_0x35d53a,'variables':_0x430c13});_0x3eea21['set'](_0x530e31['id'],_0x4102fd['id']);}else _0x5c3f84[_0x4146ae(0x277)](_0x530e31);}if(_0x5c3f84['length']===_0x2b3625[_0x4146ae(0x189)])throw new SDKError(ErrorCode[_0x4146ae(0x22c)],'Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.',undefined,{'helpText':_0x4146ae(0x1cd)});_0x2b3625['length']=0x0,_0x2b3625['push'](..._0x5c3f84);}for(const _0x4a911c of _0x26301c){const _0x1de4e7=_0x3eea21[_0x4146ae(0x1c0)](_0x4a911c[_0x4146ae(0x193)][_0x4146ae(0x255)]);if(!_0x1de4e7)continue;const _0x4f34c9=await this[_0x4146ae(0x203)][_0x4146ae(0x256)]({'projectId':_0x15aa2e,'agentId':_0x1de4e7,'name':_0x4a911c['attributes'][_0x4146ae(0x1da)],'systemPrompt':_0x4a911c['attributes'][_0x4146ae(0x1fc)],'template':_0x4a911c['attributes'][_0x4146ae(0x195)],'jsonSchemaHint':_0x4a911c[_0x4146ae(0x193)]['jsonSchemaHint']});_0x4f5b55['set'](_0x4a911c['id'],_0x4f34c9['id']);}for(const _0x214ee1 of _0x5b3292){const _0x37ef99=_0x214ee1[_0x4146ae(0x193)]['actions']['map'](_0x333d35=>({..._0x333d35,'promptId':_0x4f5b55['get'](_0x333d35['promptId'])||_0x333d35[_0x4146ae(0x285)]}));await this[_0x4146ae(0x203)]['createIntegration']({'projectId':_0x15aa2e,'serviceType':_0x214ee1[_0x4146ae(0x193)][_0x4146ae(0x28f)],'actions':_0x37ef99,'slackMessageMode':_0x214ee1[_0x4146ae(0x193)][_0x4146ae(0x1fa)],'chatIgnoreManagedActions':_0x214ee1[_0x4146ae(0x193)][_0x4146ae(0x178)],'chatWelcomeMessage':_0x214ee1[_0x4146ae(0x193)][_0x4146ae(0x275)],'webhookCorsOrigins':_0x214ee1[_0x4146ae(0x193)][_0x4146ae(0x196)]});}return{'projectName':_0x301bea,'projectId':_0x15aa2e,'counts':{'agents':_0x3eea21[_0x4146ae(0x1f3)],'knowledgeBases':_0x5f2bf4[_0x4146ae(0x1f3)],'prompts':_0x4f5b55['size'],'integrations':_0x5b3292['length']},'sourceSite':_0x3e7ea7};}[a134_0x1280fc(0x181)](_0x225a88,_0x3cb6ed){const _0x1ff26e=a134_0x1280fc;if(!a134_0x4f3caa[_0x1ff26e(0x273)](_0x225a88))return _0x3cb6ed;return JSON[_0x1ff26e(0x1ce)](a134_0x4f3caa['readFileSync'](_0x225a88,_0x1ff26e(0x1a7)));}[a134_0x1280fc(0x252)](_0x255b33){const _0x297597=a134_0x1280fc;if(!a134_0x4f3caa['existsSync'](_0x255b33))throw new SDKError(ErrorCode[_0x297597(0x1b6)],'Backup\x20folder\x20not\x20found:\x20'+_0x255b33,undefined,{'helpText':'Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.'});const _0x3c1d8d=a134_0xb4a0ec[_0x297597(0x271)](_0x255b33,_0x297597(0x18c));if(!a134_0x4f3caa[_0x297597(0x273)](_0x3c1d8d))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x297597(0x236)+_0x255b33,undefined,{'helpText':'Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.'});const _0x5c91c4=JSON[_0x297597(0x1ce)](a134_0x4f3caa['readFileSync'](_0x3c1d8d,_0x297597(0x1a7)));if(!isSupportedBackupVersion(_0x5c91c4['version']))throw new SDKError(ErrorCode[_0x297597(0x207)],_0x297597(0x243)+_0x5c91c4['version'],undefined,{'helpText':_0x297597(0x24d)});return _0x5c91c4;}async['pullProject'](_0x3c1847,_0x487078,_0x34d44e){const _0xf29d78=a134_0x1280fc,{projectId:_0x352944,project:_0x347a6b}=await this[_0xf29d78(0x259)](_0x3c1847),_0x14b4cd=_0x347a6b[_0xf29d78(0x193)][_0xf29d78(0x1da)];let _0xdfd7dd;if(_0x487078)_0xdfd7dd=_0x487078;else{const _0x1a2ab0=a134_0xb4a0ec[_0xf29d78(0x271)](process['cwd'](),_0xf29d78(0x1bc)),_0x3c5d46=getSanitizedPathWithMigration(_0x1a2ab0,_0x14b4cd);_0x3c5d46[_0xf29d78(0x234)]&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x276)+a134_0xb4a0ec['basename'](_0x3c5d46['oldPath'])+_0xf29d78(0x28d)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x3c5d46[_0xf29d78(0x19a)])),_0xdfd7dd=_0x3c5d46[_0xf29d78(0x19a)];}const _0x3c27bc=await this[_0xf29d78(0x203)][_0xf29d78(0x1e1)](_0x352944),_0x126dfc=await this['client'][_0xf29d78(0x247)](_0x352944),_0x3d9472=await this['client'][_0xf29d78(0x190)](_0x352944),_0x5ccf34=await safeListOrEmpty(()=>this['client'][_0xf29d78(0x19b)](_0x352944)),_0x1c8100=await safeListOrEmpty(()=>this[_0xf29d78(0x203)][_0xf29d78(0x21e)](_0x352944)),_0x43e05c=await this['client'][_0xf29d78(0x18b)](_0x352944),_0x51b02b=await this['client']['listIntegrations'](_0x352944),_0x1c730b=await safeListOrEmpty(()=>this['client'][_0xf29d78(0x1dd)](_0x352944)),_0x993f1c=await safeListOrEmpty(()=>this[_0xf29d78(0x203)]['listExperimentalArtifacts'](_0x352944)),_0x265ea1=await safeListOrEmpty(()=>this[_0xf29d78(0x203)]['listFormInterfaces'](_0x352944)),_0x5de67f=await safeListOrEmpty(()=>this[_0xf29d78(0x203)][_0xf29d78(0x1bb)](_0x352944)),_0x1de2e9=_0x51b02b[_0xf29d78(0x18a)](_0x576dc7=>!_0x576dc7[_0xf29d78(0x193)][_0xf29d78(0x1c4)]&&SAFE_INTEGRATION_TYPES[_0xf29d78(0x20c)](_0x576dc7[_0xf29d78(0x193)]['serviceType'][_0xf29d78(0x23b)]())),_0x1dd883=new Map(),_0x2c524e=new Map(),_0x3e92b8=new Map(),_0x316799=new Map(),_0x3f9d81=new Map(),_0x58d4fb=new Map(),_0x77f6d0=new Map();for(const _0x4a9c6f of _0x3c27bc){_0x1dd883['set'](_0x4a9c6f['id'],_0x4a9c6f['attributes'][_0xf29d78(0x1da)]);}for(const _0x4330cd of _0x126dfc){_0x2c524e[_0xf29d78(0x26f)](_0x4330cd['id'],_0x4330cd[_0xf29d78(0x193)][_0xf29d78(0x1da)]);}for(const _0x1941f9 of _0x3d9472){_0x3e92b8[_0xf29d78(0x26f)](_0x1941f9['id'],_0x1941f9[_0xf29d78(0x193)][_0xf29d78(0x1da)]);}for(const _0x3dab6c of _0x5ccf34){_0x316799[_0xf29d78(0x26f)](_0x3dab6c['id'],_0x3dab6c[_0xf29d78(0x193)]['name']);}for(const _0xe36575 of _0x1c8100){_0x3f9d81[_0xf29d78(0x26f)](_0xe36575['id'],_0xe36575[_0xf29d78(0x193)][_0xf29d78(0x1da)]);}for(const _0x2f336b of _0x43e05c){_0x58d4fb[_0xf29d78(0x26f)](_0x2f336b['id'],_0x2f336b['attributes'][_0xf29d78(0x1da)]);}for(const _0x5d6452 of _0x1c730b){_0x77f6d0['set'](_0x5d6452['id'],_0x5d6452[_0xf29d78(0x193)][_0xf29d78(0x1da)]);}const _0x241aab={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2c524e,'TextKnowledgeBase':_0x3e92b8,'Agent':_0x1dd883,'WebSearchTool':_0x3f9d81,'ImageGenerator':_0x316799,'ExperimentalKnowledgeBase':_0x77f6d0}),'resolvePromptName':async _0x42488e=>_0x58d4fb['get'](_0x42488e),'onWarning':_0xd1161b=>this['logger'][_0xf29d78(0x1eb)](_0xd1161b)},_0x2ca305={'projectName':_0x14b4cd,'outputDir':_0xdfd7dd,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'formInterfaces':[],'chatInterfaces':[],'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},'formInterfaces':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'chatInterfaces':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0}}},_0x2d2735=[],_0x4fa164=[];for(const _0x103eab of _0x3c27bc){const _0x1284c9=getSanitizedPathWithMigration(_0xdfd7dd,_0x103eab[_0xf29d78(0x193)][_0xf29d78(0x1da)]);_0x1284c9[_0xf29d78(0x234)]&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x1a1)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x1284c9['oldPath'])+'\x20→\x20'+a134_0xb4a0ec['basename'](_0x1284c9[_0xf29d78(0x19a)]));const _0x4b39aa=_0x1284c9[_0xf29d78(0x19a)],_0x5808e5=a134_0xb4a0ec['join'](_0x4b39aa,'prompt.md'),_0x5d2561=a134_0xb4a0ec[_0xf29d78(0x271)](_0x4b39aa,_0xf29d78(0x17c)),_0x12acb1=a134_0xb4a0ec['join'](_0x4b39aa,_0xf29d78(0x22f)),{yaml:_0x4ef23c,systemPrompt:_0x1d967e,starterMessage:_0x4854cb}=await agentResponseToDef(_0x103eab,_0x241aab),_0x1c6cf6=toAgentYamlString(_0x4ef23c),_0x245fea=!a134_0x4f3caa[_0xf29d78(0x273)](_0x5d2561);let _0x336f3c=_0x245fea,_0x11fadd;if(!_0x245fea){const _0x22fc26=a134_0x4f3caa[_0xf29d78(0x273)](_0x5808e5)?a134_0x4f3caa[_0xf29d78(0x186)](_0x5808e5,_0xf29d78(0x1a7)):'',_0x184fee=a134_0x4f3caa[_0xf29d78(0x186)](_0x5d2561,_0xf29d78(0x1a7)),_0x1c129c=_0xf29d78(0x1ac)+_0x22fc26+_0xf29d78(0x206)+_0x184fee,_0x122b7b='#\x20prompt.md\x0a'+_0x1d967e+_0xf29d78(0x206)+_0x1c6cf6,_0x33849b=generateDiff(_0x1c129c,_0x122b7b);_0x336f3c=hasChanges(_0x33849b),_0x336f3c&&(_0x11fadd=formatDiffWithColors(_0x33849b));}_0x2d2735[_0xf29d78(0x277)]({'path':_0x4b39aa,'content':'','isDir':!![]}),_0x2d2735[_0xf29d78(0x277)]({'path':_0x5808e5,'content':_0x1d967e}),_0x2d2735[_0xf29d78(0x277)]({'path':_0x5d2561,'content':_0x1c6cf6});_0x4854cb&&_0x4854cb['includes']('\x0a')&&_0x2d2735[_0xf29d78(0x277)]({'path':_0x12acb1,'content':_0x4854cb});_0x2ca305[_0xf29d78(0x1bc)][_0xf29d78(0x277)]({'agentName':_0x103eab[_0xf29d78(0x193)][_0xf29d78(0x1da)],'outputPath':_0x4b39aa,'isNew':_0x245fea,'hasChanges':_0x336f3c,'diff':_0x11fadd}),_0x2ca305[_0xf29d78(0x1f6)]['agents'][_0xf29d78(0x17f)]++;if(_0x245fea)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1bc)]['new']++;else{if(_0x336f3c)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1bc)][_0xf29d78(0x232)]++;else _0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1bc)][_0xf29d78(0x23a)]++;}}for(const _0x2d7671 of _0x126dfc){if(_0x2d7671[_0xf29d78(0x193)][_0xf29d78(0x1c4)])continue;const _0x432268=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0xdfd7dd),_0x2d7671[_0xf29d78(0x193)][_0xf29d78(0x1da)],'.yml');_0x432268['renamed']&&this[_0xf29d78(0x1b4)]['info'](_0xf29d78(0x1bd)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x432268[_0xf29d78(0x254)])+_0xf29d78(0x28d)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x432268[_0xf29d78(0x19a)]));const _0x5a7efa=_0x432268['path'],_0x140838=apiKnowledgeBaseToYaml(_0x2d7671),_0x43bb72=toKnowledgeBaseYamlString(_0x140838),_0x2cdcc2=!a134_0x4f3caa[_0xf29d78(0x273)](_0x5a7efa);let _0x20ee22=_0x2cdcc2,_0x4bc67e;if(!_0x2cdcc2){const _0x40de0c=a134_0x4f3caa[_0xf29d78(0x186)](_0x5a7efa,_0xf29d78(0x1a7)),_0x3bebfb=generateDiff(_0x40de0c,_0x43bb72);_0x20ee22=hasChanges(_0x3bebfb),_0x20ee22&&(_0x4bc67e=formatDiffWithColors(_0x3bebfb));}_0x2d2735[_0xf29d78(0x277)]({'path':_0x5a7efa,'content':_0x43bb72}),_0x2ca305[_0xf29d78(0x1e5)]['push']({'name':_0x2d7671[_0xf29d78(0x193)]['name'],'outputPath':_0x5a7efa,'isNew':_0x2cdcc2,'hasChanges':_0x20ee22,'diff':_0x4bc67e}),_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1e5)][_0xf29d78(0x17f)]++;if(_0x2cdcc2)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1e5)][_0xf29d78(0x1f5)]++;else{if(_0x20ee22)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1e5)][_0xf29d78(0x232)]++;else _0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1e5)]['unchanged']++;}}for(const _0x51b885 of _0x3d9472){if(_0x51b885[_0xf29d78(0x193)][_0xf29d78(0x1c4)])continue;const _0x5d8a7e=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0xdfd7dd),_0x51b885[_0xf29d78(0x193)][_0xf29d78(0x1da)],_0xf29d78(0x1e9));_0x5d8a7e[_0xf29d78(0x234)]&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x1cc)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x5d8a7e[_0xf29d78(0x254)])+_0xf29d78(0x28d)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x5d8a7e[_0xf29d78(0x19a)]));const _0x199ab2=_0x5d8a7e[_0xf29d78(0x19a)],_0x1d4664=toTextKnowledgeBaseMd(_0x51b885['attributes'][_0xf29d78(0x1da)],_0x51b885[_0xf29d78(0x193)][_0xf29d78(0x230)]),_0x5b353b=!a134_0x4f3caa['existsSync'](_0x199ab2);let _0x4c3744=_0x5b353b,_0x3de15a;if(!_0x5b353b){const _0x974709=a134_0x4f3caa[_0xf29d78(0x186)](_0x199ab2,_0xf29d78(0x1a7)),_0x1a0b04=generateDiff(_0x974709,_0x1d4664);_0x4c3744=hasChanges(_0x1a0b04),_0x4c3744&&(_0x3de15a=formatDiffWithColors(_0x1a0b04));}_0x2d2735[_0xf29d78(0x277)]({'path':_0x199ab2,'content':_0x1d4664}),_0x2ca305[_0xf29d78(0x25f)]['push']({'name':_0x51b885['attributes'][_0xf29d78(0x1da)],'outputPath':_0x199ab2,'isNew':_0x5b353b,'hasChanges':_0x4c3744,'diff':_0x3de15a}),_0x2ca305[_0xf29d78(0x1f6)]['textKnowledgeBases']['total']++;if(_0x5b353b)_0x2ca305[_0xf29d78(0x1f6)]['textKnowledgeBases'][_0xf29d78(0x1f5)]++;else{if(_0x4c3744)_0x2ca305['counts'][_0xf29d78(0x25f)][_0xf29d78(0x232)]++;else _0x2ca305[_0xf29d78(0x1f6)]['textKnowledgeBases'][_0xf29d78(0x23a)]++;}}for(const _0x54ee17 of _0x43e05c){if(_0x54ee17[_0xf29d78(0x193)]['isManaged'])continue;const _0x5cff93=getSanitizedPathWithMigration(getPromptsDir(_0xdfd7dd),_0x54ee17['attributes']['name'],_0xf29d78(0x1c7));_0x5cff93['renamed']&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x237)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x5cff93['oldPath'])+_0xf29d78(0x28d)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x5cff93[_0xf29d78(0x19a)]));const _0x569639=_0x5cff93[_0xf29d78(0x19a)],_0x29760c=await apiPromptToYaml(_0x54ee17,_0x241aab);if(!_0x29760c)continue;const _0x5ca7a2=toPromptYamlString(_0x29760c),_0x3a014c=!a134_0x4f3caa[_0xf29d78(0x273)](_0x569639);let _0x2f8478=_0x3a014c,_0x153636;if(!_0x3a014c){const _0x31096c=a134_0x4f3caa[_0xf29d78(0x186)](_0x569639,_0xf29d78(0x1a7)),_0x179d54=generateDiff(_0x31096c,_0x5ca7a2);_0x2f8478=hasChanges(_0x179d54),_0x2f8478&&(_0x153636=formatDiffWithColors(_0x179d54));}_0x2d2735['push']({'path':_0x569639,'content':_0x5ca7a2}),_0x2ca305[_0xf29d78(0x25d)][_0xf29d78(0x277)]({'name':_0x54ee17[_0xf29d78(0x193)][_0xf29d78(0x1da)],'outputPath':_0x569639,'isNew':_0x3a014c,'hasChanges':_0x2f8478,'diff':_0x153636}),_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x25d)][_0xf29d78(0x17f)]++;if(_0x3a014c)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x25d)]['new']++;else{if(_0x2f8478)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x25d)][_0xf29d78(0x232)]++;else _0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x25d)][_0xf29d78(0x23a)]++;}}for(const _0x4d6dcd of _0x1de2e9){const _0x259ca4=_0x4d6dcd[_0xf29d78(0x193)]['serviceType'][_0xf29d78(0x23b)](),_0x2492c5=getSanitizedPathWithMigration(getIntegrationsDir(_0xdfd7dd),_0x259ca4,'.yml');_0x2492c5[_0xf29d78(0x234)]&&this['logger'][_0xf29d78(0x183)](_0xf29d78(0x19d)+a134_0xb4a0ec['basename'](_0x2492c5[_0xf29d78(0x254)])+_0xf29d78(0x28d)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x2492c5[_0xf29d78(0x19a)]));const _0x2aba39=_0x2492c5[_0xf29d78(0x19a)],_0x2a36fe=await apiIntegrationToYaml(_0x4d6dcd,_0x241aab),_0x5de757=toIntegrationYamlString(_0x2a36fe),_0x52fce5=!a134_0x4f3caa[_0xf29d78(0x273)](_0x2aba39);let _0x5d85a5=_0x52fce5,_0x1e6f10;if(!_0x52fce5){const _0x4abacb=a134_0x4f3caa['readFileSync'](_0x2aba39,'utf-8'),_0x101093=generateDiff(_0x4abacb,_0x5de757);_0x5d85a5=hasChanges(_0x101093),_0x5d85a5&&(_0x1e6f10=formatDiffWithColors(_0x101093));}_0x2d2735[_0xf29d78(0x277)]({'path':_0x2aba39,'content':_0x5de757}),_0x2ca305[_0xf29d78(0x180)]['push']({'name':_0x259ca4,'outputPath':_0x2aba39,'isNew':_0x52fce5,'hasChanges':_0x5d85a5,'diff':_0x1e6f10}),_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x180)]['total']++;if(_0x52fce5)_0x2ca305[_0xf29d78(0x1f6)]['integrations']['new']++;else{if(_0x5d85a5)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x180)]['updated']++;else _0x2ca305['counts'][_0xf29d78(0x180)]['unchanged']++;}}for(const _0x2cf992 of _0x1c730b){if(_0x2cf992[_0xf29d78(0x193)][_0xf29d78(0x1c4)])continue;const _0x402e4e=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0xdfd7dd),_0x2cf992['attributes'][_0xf29d78(0x1da)]);_0x402e4e[_0xf29d78(0x234)]&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x279)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x402e4e['oldPath'])+_0xf29d78(0x28d)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x402e4e[_0xf29d78(0x19a)]));const _0x42adba=_0x402e4e['path'],_0x33248e=a134_0xb4a0ec[_0xf29d78(0x271)](_0x42adba,sanitizeForFilesystem(_0x2cf992[_0xf29d78(0x193)][_0xf29d78(0x1da)])+_0xf29d78(0x1c7)),_0x566ed4=a134_0xb4a0ec[_0xf29d78(0x271)](_0x42adba,_0xf29d78(0x24f)),_0x230a99=apiExperimentalKnowledgeBaseToYaml(_0x2cf992),_0x2fbb73=toExperimentalKnowledgeBaseYamlString(_0x230a99),_0x4b2d43=!a134_0x4f3caa[_0xf29d78(0x273)](_0x42adba);let _0x3a7007=_0x4b2d43,_0x390a74,_0x163d51=_0x2fbb73;const _0x4cb1a6=[..._0x230a99['functions']][_0xf29d78(0x23e)]((_0x20c907,_0x20da0e)=>_0x20c907[_0xf29d78(0x1da)][_0xf29d78(0x1ab)](_0x20da0e[_0xf29d78(0x1da)]));for(const _0x38a296 of _0x4cb1a6){_0x163d51+='\x0a---\x20function:\x20'+_0x38a296['name']+_0xf29d78(0x1a2)+_0x38a296[_0xf29d78(0x28a)]+_0xf29d78(0x224)+_0x38a296[_0xf29d78(0x1da)]+'\x20---\x0a'+_0x38a296[_0xf29d78(0x197)]+'\x0a';}if(!_0x4b2d43){let _0x382981='';a134_0x4f3caa[_0xf29d78(0x273)](_0x33248e)&&(_0x382981=a134_0x4f3caa[_0xf29d78(0x186)](_0x33248e,_0xf29d78(0x1a7)));if(a134_0x4f3caa['existsSync'](_0x566ed4)){const _0x478fca=a134_0x4f3caa['readdirSync'](_0x566ed4,{'withFileTypes':!![]}),_0x420565=_0x478fca[_0xf29d78(0x18a)](_0x362e2e=>_0x362e2e[_0xf29d78(0x27e)]())[_0xf29d78(0x23e)]((_0x35aeeb,_0x353f3d)=>_0x35aeeb[_0xf29d78(0x1da)][_0xf29d78(0x1ab)](_0x353f3d[_0xf29d78(0x1da)]));for(const _0x196fb6 of _0x420565){const _0x464e26=a134_0xb4a0ec[_0xf29d78(0x271)](_0x566ed4,_0x196fb6[_0xf29d78(0x1da)],'code.js'),_0x114826=a134_0xb4a0ec['join'](_0x566ed4,_0x196fb6[_0xf29d78(0x1da)],_0xf29d78(0x1c8));a134_0x4f3caa[_0xf29d78(0x273)](_0x464e26)&&(_0x382981+=_0xf29d78(0x226)+_0x196fb6[_0xf29d78(0x1da)]+'\x20---\x0a'+a134_0x4f3caa[_0xf29d78(0x186)](_0x464e26,_0xf29d78(0x1a7))+'\x0a'),a134_0x4f3caa[_0xf29d78(0x273)](_0x114826)&&(_0x382981+=_0xf29d78(0x217)+_0x196fb6[_0xf29d78(0x1da)]+_0xf29d78(0x1a2)+a134_0x4f3caa['readFileSync'](_0x114826,_0xf29d78(0x1a7))+'\x0a');}}const _0x3eae3d=generateDiff(_0x382981,_0x163d51);_0x3a7007=hasChanges(_0x3eae3d),_0x3a7007&&(_0x390a74=formatDiffWithColors(_0x3eae3d));}_0x2d2735['push']({'path':_0x42adba,'content':'','isDir':!![]}),_0x2d2735['push']({'path':_0x33248e,'content':_0x2fbb73}),_0x2d2735[_0xf29d78(0x277)]({'path':_0x566ed4,'content':'','isDir':!![]});for(const _0x2325c6 of _0x230a99[_0xf29d78(0x24f)]){const _0x4202c3=a134_0xb4a0ec[_0xf29d78(0x271)](_0x566ed4,sanitizeForFilesystem(_0x2325c6[_0xf29d78(0x1da)])),_0x6e604b=a134_0xb4a0ec[_0xf29d78(0x271)](_0x4202c3,_0xf29d78(0x212)),_0x11779c=a134_0xb4a0ec['join'](_0x4202c3,_0xf29d78(0x1c8));_0x2d2735[_0xf29d78(0x277)]({'path':_0x4202c3,'content':'','isDir':!![]}),_0x2d2735[_0xf29d78(0x277)]({'path':_0x6e604b,'content':_0x2325c6[_0xf29d78(0x28a)]}),_0x2d2735[_0xf29d78(0x277)]({'path':_0x11779c,'content':_0x2325c6['json_schema']});}if(a134_0x4f3caa['existsSync'](_0x566ed4)){const _0xad1dec=a134_0x4f3caa[_0xf29d78(0x249)](_0x566ed4,{'withFileTypes':!![]}),_0x2f388e=new Set(_0x230a99[_0xf29d78(0x24f)][_0xf29d78(0x1ca)](_0x5867fb=>sanitizeForFilesystem(_0x5867fb[_0xf29d78(0x1da)])));for(const _0x40f7b6 of _0xad1dec){if(_0x40f7b6[_0xf29d78(0x27e)]()&&!_0x2f388e['has'](_0x40f7b6[_0xf29d78(0x1da)])){const _0x1562e3=a134_0xb4a0ec[_0xf29d78(0x271)](_0x566ed4,_0x40f7b6[_0xf29d78(0x1da)]);_0x4fa164[_0xf29d78(0x277)]({'path':_0x1562e3,'isDir':!![]});}}}_0x2ca305[_0xf29d78(0x1cb)][_0xf29d78(0x277)]({'name':_0x2cf992[_0xf29d78(0x193)]['name'],'outputPath':_0x42adba,'isNew':_0x4b2d43,'hasChanges':_0x3a7007,'diff':_0x390a74}),_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1cb)][_0xf29d78(0x17f)]++;if(_0x4b2d43)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1cb)][_0xf29d78(0x1f5)]++;else{if(_0x3a7007)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x1cb)][_0xf29d78(0x232)]++;else _0x2ca305['counts'][_0xf29d78(0x1cb)][_0xf29d78(0x23a)]++;}}for(const _0x5b2201 of _0x993f1c){if(_0x5b2201[_0xf29d78(0x193)][_0xf29d78(0x1c4)])continue;const _0x2bfaab=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0xdfd7dd),_0x5b2201['attributes'][_0xf29d78(0x1da)]);_0x2bfaab[_0xf29d78(0x234)]&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x244)+a134_0xb4a0ec['basename'](_0x2bfaab[_0xf29d78(0x254)])+'\x20→\x20'+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x2bfaab[_0xf29d78(0x19a)]));const _0x1cad31=_0x2bfaab[_0xf29d78(0x19a)],_0x55c133=a134_0xb4a0ec[_0xf29d78(0x271)](_0x1cad31,sanitizeForFilesystem(_0x5b2201[_0xf29d78(0x193)][_0xf29d78(0x1da)])+_0xf29d78(0x1c7)),_0x3c834b=a134_0xb4a0ec[_0xf29d78(0x271)](_0x1cad31,_0xf29d78(0x212)),_0x2d5e54=a134_0xb4a0ec['join'](_0x1cad31,_0xf29d78(0x200)),_0x3867ec=apiExperimentalArtifactToYaml(_0x5b2201),_0x1e9f5d=toExperimentalArtifactYamlString(_0x3867ec),_0x33d6a2=!a134_0x4f3caa[_0xf29d78(0x273)](_0x1cad31);let _0x4bc959=_0x33d6a2,_0x301806,_0x37dbd7=_0x1e9f5d+(_0xf29d78(0x18e)+_0x3867ec[_0xf29d78(0x28a)]+'\x0a');const _0x538a27=[..._0x3867ec[_0xf29d78(0x200)]]['sort']((_0xa2e0e4,_0x495715)=>_0xa2e0e4[_0xf29d78(0x295)]['localeCompare'](_0x495715['file_name']));for(const _0x587708 of _0x538a27){_0x37dbd7+=_0xf29d78(0x1be)+_0x587708[_0xf29d78(0x295)]+_0xf29d78(0x1a2)+_0x587708[_0xf29d78(0x296)]+'\x0a';}if(!_0x33d6a2){let _0x1fe6fe='';a134_0x4f3caa['existsSync'](_0x55c133)&&(_0x1fe6fe=a134_0x4f3caa[_0xf29d78(0x186)](_0x55c133,_0xf29d78(0x1a7)));a134_0x4f3caa[_0xf29d78(0x273)](_0x3c834b)&&(_0x1fe6fe+=_0xf29d78(0x18e)+a134_0x4f3caa['readFileSync'](_0x3c834b,'utf-8')+'\x0a');if(a134_0x4f3caa[_0xf29d78(0x273)](_0x2d5e54)){const _0x300fe1=a134_0x4f3caa['readdirSync'](_0x2d5e54),_0x1358d1=_0x300fe1[_0xf29d78(0x18a)](_0x6730f3=>{const _0x21d8c0=_0xf29d78,_0x20f754=a134_0xb4a0ec[_0x21d8c0(0x271)](_0x2d5e54,_0x6730f3);return a134_0x4f3caa[_0x21d8c0(0x268)](_0x20f754)[_0x21d8c0(0x205)]();})['sort']((_0x4ea3f9,_0x485089)=>_0x4ea3f9[_0xf29d78(0x1ab)](_0x485089));for(const _0x5f3357 of _0x1358d1){const _0x888580=a134_0xb4a0ec['join'](_0x2d5e54,_0x5f3357);_0x1fe6fe+=_0xf29d78(0x1be)+_0x5f3357+_0xf29d78(0x1a2)+a134_0x4f3caa[_0xf29d78(0x186)](_0x888580,_0xf29d78(0x1a7))+'\x0a';}}const _0x412aa7=generateDiff(_0x1fe6fe,_0x37dbd7);_0x4bc959=hasChanges(_0x412aa7),_0x4bc959&&(_0x301806=formatDiffWithColors(_0x412aa7));}_0x2d2735[_0xf29d78(0x277)]({'path':_0x1cad31,'content':'','isDir':!![]}),_0x2d2735[_0xf29d78(0x277)]({'path':_0x55c133,'content':_0x1e9f5d}),_0x2d2735['push']({'path':_0x3c834b,'content':_0x3867ec[_0xf29d78(0x28a)]});if(_0x3867ec[_0xf29d78(0x200)][_0xf29d78(0x189)]>0x0){_0x2d2735[_0xf29d78(0x277)]({'path':_0x2d5e54,'content':'','isDir':!![]});for(const _0x48a1c7 of _0x3867ec[_0xf29d78(0x200)]){const _0x4c3410=a134_0xb4a0ec[_0xf29d78(0x271)](_0x2d5e54,_0x48a1c7['file_name']);_0x2d2735[_0xf29d78(0x277)]({'path':_0x4c3410,'content':_0x48a1c7[_0xf29d78(0x296)]});}}if(a134_0x4f3caa[_0xf29d78(0x273)](_0x2d5e54)){const _0x390861=a134_0x4f3caa[_0xf29d78(0x249)](_0x2d5e54),_0x1551c0=new Set(_0x3867ec[_0xf29d78(0x200)][_0xf29d78(0x1ca)](_0x1800aa=>_0x1800aa['file_name']));for(const _0x205ae3 of _0x390861){const _0x20147c=a134_0xb4a0ec[_0xf29d78(0x271)](_0x2d5e54,_0x205ae3);a134_0x4f3caa[_0xf29d78(0x268)](_0x20147c)[_0xf29d78(0x205)]()&&!_0x1551c0[_0xf29d78(0x17b)](_0x205ae3)&&_0x4fa164['push']({'path':_0x20147c});}}_0x2ca305['experimentalArtifacts']['push']({'name':_0x5b2201[_0xf29d78(0x193)]['name'],'outputPath':_0x1cad31,'isNew':_0x33d6a2,'hasChanges':_0x4bc959,'diff':_0x301806}),_0x2ca305['counts'][_0xf29d78(0x20a)]['total']++;if(_0x33d6a2)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x20a)][_0xf29d78(0x1f5)]++;else{if(_0x4bc959)_0x2ca305[_0xf29d78(0x1f6)]['experimentalArtifacts'][_0xf29d78(0x232)]++;else _0x2ca305['counts']['experimentalArtifacts']['unchanged']++;}}for(const _0x33334 of _0x265ea1){const _0x48ea4d=getSanitizedPathWithMigration(getFormInterfacesDir(_0xdfd7dd),_0x33334[_0xf29d78(0x193)][_0xf29d78(0x1da)],_0xf29d78(0x1c7));_0x48ea4d[_0xf29d78(0x234)]&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x187)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x48ea4d[_0xf29d78(0x254)])+'\x20→\x20'+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x48ea4d[_0xf29d78(0x19a)]));const _0x29c772=_0x48ea4d['path'],_0x38a3ee=await apiFormInterfaceToYaml(_0x33334,_0x241aab),_0x13ca79=toFormInterfaceYamlString(_0x38a3ee),_0x2b2706=!a134_0x4f3caa[_0xf29d78(0x273)](_0x29c772);let _0x595c80=_0x2b2706,_0x1f147b;if(!_0x2b2706){const _0x4461e8=a134_0x4f3caa[_0xf29d78(0x186)](_0x29c772,_0xf29d78(0x1a7)),_0x1e8377=generateDiff(_0x4461e8,_0x13ca79);_0x595c80=hasChanges(_0x1e8377),_0x595c80&&(_0x1f147b=formatDiffWithColors(_0x1e8377));}_0x2d2735[_0xf29d78(0x277)]({'path':_0x29c772,'content':_0x13ca79}),_0x2ca305['formInterfaces'][_0xf29d78(0x277)]({'name':_0x33334[_0xf29d78(0x193)][_0xf29d78(0x1da)],'outputPath':_0x29c772,'isNew':_0x2b2706,'hasChanges':_0x595c80,'diff':_0x1f147b}),_0x2ca305[_0xf29d78(0x1f6)]['formInterfaces'][_0xf29d78(0x17f)]++;if(_0x2b2706)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x194)]['new']++;else{if(_0x595c80)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x194)][_0xf29d78(0x232)]++;else _0x2ca305['counts'][_0xf29d78(0x194)]['unchanged']++;}}for(const _0x3a1b37 of _0x5de67f){if(_0x3a1b37[_0xf29d78(0x193)][_0xf29d78(0x1c4)])continue;const _0x2fb407=getSanitizedPathWithMigration(getChatInterfacesDir(_0xdfd7dd),_0x3a1b37['attributes']['name'],_0xf29d78(0x1c7));_0x2fb407[_0xf29d78(0x234)]&&this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x1e7)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x2fb407[_0xf29d78(0x254)])+_0xf29d78(0x28d)+a134_0xb4a0ec[_0xf29d78(0x23c)](_0x2fb407[_0xf29d78(0x19a)]));const _0x166b5a=_0x2fb407[_0xf29d78(0x19a)],_0x2cdf15=await apiChatInterfaceToYaml(_0x3a1b37,_0x241aab),_0xbc08f=toChatInterfaceYamlString(_0x2cdf15),_0x36d2db=!a134_0x4f3caa[_0xf29d78(0x273)](_0x166b5a);let _0x5837ad=_0x36d2db,_0x550b52;if(!_0x36d2db){const _0x23c990=a134_0x4f3caa['readFileSync'](_0x166b5a,_0xf29d78(0x1a7)),_0x5ca427=generateDiff(_0x23c990,_0xbc08f);_0x5837ad=hasChanges(_0x5ca427),_0x5837ad&&(_0x550b52=formatDiffWithColors(_0x5ca427));}_0x2d2735['push']({'path':_0x166b5a,'content':_0xbc08f}),_0x2ca305[_0xf29d78(0x266)][_0xf29d78(0x277)]({'name':_0x3a1b37[_0xf29d78(0x193)][_0xf29d78(0x1da)],'outputPath':_0x166b5a,'isNew':_0x36d2db,'hasChanges':_0x5837ad,'diff':_0x550b52}),_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x266)][_0xf29d78(0x17f)]++;if(_0x36d2db)_0x2ca305[_0xf29d78(0x1f6)][_0xf29d78(0x266)][_0xf29d78(0x1f5)]++;else{if(_0x5837ad)_0x2ca305['counts']['chatInterfaces'][_0xf29d78(0x232)]++;else _0x2ca305[_0xf29d78(0x1f6)]['chatInterfaces'][_0xf29d78(0x23a)]++;}}if(_0x34d44e?.[_0xf29d78(0x248)])return _0x2ca305;a134_0x4f3caa[_0xf29d78(0x20f)](_0xdfd7dd,{'recursive':!![]}),a134_0x4f3caa[_0xf29d78(0x20f)](getKnowledgeBasesDir(_0xdfd7dd),{'recursive':!![]}),a134_0x4f3caa['mkdirSync'](getPromptsDir(_0xdfd7dd),{'recursive':!![]}),a134_0x4f3caa[_0xf29d78(0x20f)](getIntegrationsDir(_0xdfd7dd),{'recursive':!![]}),a134_0x4f3caa[_0xf29d78(0x20f)](getExperimentalKnowledgeBasesDir(_0xdfd7dd),{'recursive':!![]}),a134_0x4f3caa['mkdirSync'](getExperimentalArtifactsDir(_0xdfd7dd),{'recursive':!![]}),a134_0x4f3caa[_0xf29d78(0x20f)](getFormInterfacesDir(_0xdfd7dd),{'recursive':!![]}),a134_0x4f3caa[_0xf29d78(0x20f)](getChatInterfacesDir(_0xdfd7dd),{'recursive':!![]});const _0x52d1a7=a134_0xb4a0ec['join'](_0xdfd7dd,_0xf29d78(0x1f8));a134_0x4f3caa['writeFileSync'](_0x52d1a7,createAgentConfigContent(_0x14b4cd));for(const _0x16848e of _0x2d2735){if(_0x16848e[_0xf29d78(0x1ee)])a134_0x4f3caa[_0xf29d78(0x20f)](_0x16848e[_0xf29d78(0x19a)],{'recursive':!![]});else{const _0xce03cd=a134_0xb4a0ec['dirname'](_0x16848e['path']);!a134_0x4f3caa['existsSync'](_0xce03cd)&&a134_0x4f3caa[_0xf29d78(0x20f)](_0xce03cd,{'recursive':!![]}),a134_0x4f3caa[_0xf29d78(0x188)](_0x16848e[_0xf29d78(0x19a)],_0x16848e[_0xf29d78(0x27d)]);}}for(const _0xdc8710 of _0x4fa164){_0xdc8710['isDir']?(a134_0x4f3caa[_0xf29d78(0x218)](_0xdc8710[_0xf29d78(0x19a)],{'recursive':!![],'force':!![]}),this[_0xf29d78(0x1b4)][_0xf29d78(0x183)](_0xf29d78(0x1e4)+a134_0xb4a0ec[_0xf29d78(0x23c)](a134_0xb4a0ec['dirname'](_0xdc8710['path']))+'/'+a134_0xb4a0ec[_0xf29d78(0x23c)](_0xdc8710[_0xf29d78(0x19a)]))):(a134_0x4f3caa[_0xf29d78(0x218)](_0xdc8710[_0xf29d78(0x19a)],{'force':!![]}),this[_0xf29d78(0x1b4)]['info'](_0xf29d78(0x21a)+a134_0xb4a0ec[_0xf29d78(0x23c)](a134_0xb4a0ec[_0xf29d78(0x284)](_0xdc8710[_0xf29d78(0x19a)]))+'/'+a134_0xb4a0ec[_0xf29d78(0x23c)](_0xdc8710[_0xf29d78(0x19a)])));}return _0x2ca305;}async['pushProject'](_0x49eda2,_0xa08415){const _0x23ebf3=a134_0x1280fc,_0x404ebb=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x49eda2,_0x23ebf3(0x1f8));if(!a134_0x4f3caa[_0x23ebf3(0x273)](_0x404ebb))throw new SDKError(ErrorCode[_0x23ebf3(0x207)],'No\x20tdx.json\x20found\x20in\x20'+_0x49eda2,undefined,{'helpText':'Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.'});const _0x38878e=loadAgentConfig(_0x404ebb),_0xe54f73=await this['resolveProjectId'](_0x38878e[_0x23ebf3(0x280)]),_0x3d2ae7=await this[_0x23ebf3(0x203)]['getProject'](_0xe54f73),_0x519d5f=_0x3d2ae7[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0xd109b3={'projectName':_0x519d5f,'projectId':_0xe54f73,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'formInterfaces':[],'chatInterfaces':[],'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},'formInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'chatInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x2fe103=[],_0x28d482=[],_0x45a269=[],_0x2bd3f5=[],_0x36233a=[],_0x122fc5=[],_0x5e71c8=a134_0x4f3caa[_0x23ebf3(0x249)](_0x49eda2,{'withFileTypes':!![]});for(const _0x64ddb6 of _0x5e71c8){if(!_0x64ddb6[_0x23ebf3(0x27e)]())continue;if([_0x23ebf3(0x20d),_0x23ebf3(0x25d),_0x23ebf3(0x180),_0x23ebf3(0x283),_0x23ebf3(0x213),_0x23ebf3(0x223),_0x23ebf3(0x1c1)][_0x23ebf3(0x20c)](_0x64ddb6[_0x23ebf3(0x1da)]))continue;const _0x513d7b=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x49eda2,_0x64ddb6['name']);if(isAgentDir(_0x513d7b)){const _0x30cc7d=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x513d7b,'agent.yml'),_0x4253ae=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x513d7b,_0x23ebf3(0x214)),_0x4c01ae=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x513d7b,_0x23ebf3(0x22f)),_0x26a75c=parseAgentYaml(a134_0x4f3caa[_0x23ebf3(0x186)](_0x30cc7d,_0x23ebf3(0x1a7)),_0x30cc7d),_0x65bea9=a134_0x4f3caa[_0x23ebf3(0x273)](_0x4253ae)?a134_0x4f3caa[_0x23ebf3(0x186)](_0x4253ae,_0x23ebf3(0x1a7)):'',_0x5e3e9d=a134_0x4f3caa[_0x23ebf3(0x273)](_0x4c01ae)?a134_0x4f3caa[_0x23ebf3(0x186)](_0x4c01ae,_0x23ebf3(0x1a7)):_0x26a75c[_0x23ebf3(0x1ec)];_0x2fe103['push']({'name':_0x26a75c[_0x23ebf3(0x1da)],'dir':_0x513d7b,'yaml':_0x26a75c,'systemPrompt':_0x65bea9,'starterMessage':_0x5e3e9d});}}const _0x5420eb=getKnowledgeBasesDir(_0x49eda2);if(a134_0x4f3caa[_0x23ebf3(0x273)](_0x5420eb)){const _0x811129=a134_0x4f3caa[_0x23ebf3(0x249)](_0x5420eb);for(const _0x1dc257 of _0x811129){const _0x311e0a=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x5420eb,_0x1dc257);if(_0x1dc257[_0x23ebf3(0x1e6)](_0x23ebf3(0x1c7))){const _0x5bdf81=parseKnowledgeBaseYaml(a134_0x4f3caa[_0x23ebf3(0x186)](_0x311e0a,_0x23ebf3(0x1a7)),_0x311e0a);_0x28d482[_0x23ebf3(0x277)]({'name':_0x5bdf81[_0x23ebf3(0x1da)],'path':_0x311e0a,'yaml':_0x5bdf81});}else{if(_0x1dc257[_0x23ebf3(0x1e6)]('.md')){const _0x15c10d=a134_0x4f3caa[_0x23ebf3(0x186)](_0x311e0a,_0x23ebf3(0x1a7)),{name:_0x4c67ce,text:_0x3dc2bd}=parseTextKnowledgeBaseMd(_0x15c10d,_0x1dc257);_0x45a269[_0x23ebf3(0x277)]({'name':_0x4c67ce,'path':_0x311e0a,'text':_0x3dc2bd});}}}}const _0xc68f93=getPromptsDir(_0x49eda2);if(a134_0x4f3caa['existsSync'](_0xc68f93)){const _0x30030e=a134_0x4f3caa['readdirSync'](_0xc68f93)[_0x23ebf3(0x18a)](_0x104be1=>_0x104be1[_0x23ebf3(0x1e6)](_0x23ebf3(0x1c7)));for(const _0x2ce7a8 of _0x30030e){const _0x481757=a134_0xb4a0ec[_0x23ebf3(0x271)](_0xc68f93,_0x2ce7a8),_0x2f9672=parsePromptYaml(a134_0x4f3caa[_0x23ebf3(0x186)](_0x481757,_0x23ebf3(0x1a7)),_0x481757);_0x2bd3f5[_0x23ebf3(0x277)]({'name':_0x2f9672[_0x23ebf3(0x1da)],'path':_0x481757,'yaml':_0x2f9672});}}const _0x13d6c4=[],_0x2ef806=getIntegrationsDir(_0x49eda2);if(a134_0x4f3caa[_0x23ebf3(0x273)](_0x2ef806)){const _0x11853f=a134_0x4f3caa[_0x23ebf3(0x249)](_0x2ef806)[_0x23ebf3(0x18a)](_0x4822e3=>_0x4822e3[_0x23ebf3(0x1e6)](_0x23ebf3(0x1c7)));for(const _0x3103c6 of _0x11853f){const _0x9e5e1e=a134_0xb4a0ec['join'](_0x2ef806,_0x3103c6),_0x315028=parseIntegrationYaml(a134_0x4f3caa[_0x23ebf3(0x186)](_0x9e5e1e,_0x23ebf3(0x1a7)),_0x9e5e1e);if(!SAFE_INTEGRATION_TYPES['includes'](_0x315028[_0x23ebf3(0x1b8)][_0x23ebf3(0x23b)]())){this[_0x23ebf3(0x1b4)][_0x23ebf3(0x1eb)](_0x23ebf3(0x209)+_0x315028['name']+_0x23ebf3(0x21d)+_0x315028['service_type']+'):\x20'+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES[_0x23ebf3(0x271)](',\x20')+_0x23ebf3(0x1ed))+_0x23ebf3(0x184));continue;}_0x13d6c4[_0x23ebf3(0x277)]({'name':_0x315028[_0x23ebf3(0x1da)],'path':_0x9e5e1e,'yaml':_0x315028});}}const _0x30c51a=getExperimentalKnowledgeBasesDir(_0x49eda2);if(a134_0x4f3caa[_0x23ebf3(0x273)](_0x30c51a)){const _0x4bc792=a134_0x4f3caa['readdirSync'](_0x30c51a,{'withFileTypes':!![]});for(const _0x43b673 of _0x4bc792){if(!_0x43b673[_0x23ebf3(0x27e)]())continue;const _0x443d2a=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x30c51a,_0x43b673[_0x23ebf3(0x1da)]),_0x3dbc96=a134_0xb4a0ec['join'](_0x443d2a,_0x43b673[_0x23ebf3(0x1da)]+_0x23ebf3(0x1c7)),_0x2dcffd=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x443d2a,'functions');if(!a134_0x4f3caa[_0x23ebf3(0x273)](_0x3dbc96))continue;const _0x202459=parseExperimentalKnowledgeBaseYaml(a134_0x4f3caa[_0x23ebf3(0x186)](_0x3dbc96,'utf-8'),_0x3dbc96),_0x398e02=[];if(a134_0x4f3caa[_0x23ebf3(0x273)](_0x2dcffd)){const _0x2d7415=a134_0x4f3caa[_0x23ebf3(0x249)](_0x2dcffd,{'withFileTypes':!![]});for(const _0x3136d6 of _0x2d7415){if(!_0x3136d6[_0x23ebf3(0x27e)]())continue;const _0x93ea58=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x2dcffd,_0x3136d6[_0x23ebf3(0x1da)]),_0x1ce00d=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x93ea58,_0x23ebf3(0x212)),_0x353f33=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x93ea58,_0x23ebf3(0x1c8));a134_0x4f3caa[_0x23ebf3(0x273)](_0x1ce00d)&&a134_0x4f3caa[_0x23ebf3(0x273)](_0x353f33)&&_0x398e02['push']({'name':_0x3136d6[_0x23ebf3(0x1da)],'code':a134_0x4f3caa[_0x23ebf3(0x186)](_0x1ce00d,_0x23ebf3(0x1a7)),'json_schema':a134_0x4f3caa[_0x23ebf3(0x186)](_0x353f33,_0x23ebf3(0x1a7))});}}const _0x14192c={..._0x202459,'variables':_0x202459['variables']||[],'functions':_0x398e02};_0x36233a[_0x23ebf3(0x277)]({'name':_0x202459['name'],'dir':_0x443d2a,'def':_0x14192c});}}const _0x4332de=getExperimentalArtifactsDir(_0x49eda2);if(a134_0x4f3caa[_0x23ebf3(0x273)](_0x4332de)){const _0x231b2b=a134_0x4f3caa[_0x23ebf3(0x249)](_0x4332de,{'withFileTypes':!![]});for(const _0x439bc7 of _0x231b2b){if(!_0x439bc7['isDirectory']())continue;const _0x564b73=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x4332de,_0x439bc7[_0x23ebf3(0x1da)]),_0x4a7fcd=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x564b73,_0x439bc7['name']+'.yml'),_0x55297a=a134_0xb4a0ec['join'](_0x564b73,_0x23ebf3(0x212)),_0x49a3a3=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x564b73,'files');if(!a134_0x4f3caa[_0x23ebf3(0x273)](_0x4a7fcd)||!a134_0x4f3caa[_0x23ebf3(0x273)](_0x55297a))continue;const _0x4cf2e3=parseExperimentalArtifactYaml(a134_0x4f3caa['readFileSync'](_0x4a7fcd,'utf-8'),_0x4a7fcd),_0x17d2e7=a134_0x4f3caa[_0x23ebf3(0x186)](_0x55297a,'utf-8'),_0x47c17f=[];if(a134_0x4f3caa[_0x23ebf3(0x273)](_0x49a3a3)){const _0x3e9d1d=a134_0x4f3caa[_0x23ebf3(0x249)](_0x49a3a3);for(const _0x55f40c of _0x3e9d1d){const _0x27174c=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x49a3a3,_0x55f40c);a134_0x4f3caa[_0x23ebf3(0x268)](_0x27174c)[_0x23ebf3(0x205)]()&&_0x47c17f['push']({'file_name':_0x55f40c,'text_content':a134_0x4f3caa['readFileSync'](_0x27174c,_0x23ebf3(0x1a7))});}}const _0xebba13={..._0x4cf2e3,'code':_0x17d2e7,'files':_0x47c17f};_0x122fc5[_0x23ebf3(0x277)]({'name':_0x4cf2e3['name'],'dir':_0x564b73,'def':_0xebba13});}}const _0x29f193=[],_0x92e15e=getFormInterfacesDir(_0x49eda2);if(a134_0x4f3caa[_0x23ebf3(0x273)](_0x92e15e)){const _0x30de2e=a134_0x4f3caa[_0x23ebf3(0x249)](_0x92e15e)[_0x23ebf3(0x18a)](_0x4e011a=>_0x4e011a['endsWith']('.yml'));for(const _0x245afd of _0x30de2e){const _0x3abf82=a134_0xb4a0ec['join'](_0x92e15e,_0x245afd),_0x3c9a19=parseFormInterfaceYaml(a134_0x4f3caa[_0x23ebf3(0x186)](_0x3abf82,_0x23ebf3(0x1a7)),_0x3abf82);_0x29f193[_0x23ebf3(0x277)]({'name':_0x3c9a19[_0x23ebf3(0x1da)],'path':_0x3abf82,'yaml':_0x3c9a19});}}const _0x108c54=[],_0x7d3da6=getChatInterfacesDir(_0x49eda2);if(a134_0x4f3caa['existsSync'](_0x7d3da6)){const _0x1a4e50=a134_0x4f3caa[_0x23ebf3(0x249)](_0x7d3da6)[_0x23ebf3(0x18a)](_0x365e35=>_0x365e35[_0x23ebf3(0x1e6)](_0x23ebf3(0x1c7)));for(const _0x12adf7 of _0x1a4e50){const _0x44595b=a134_0xb4a0ec[_0x23ebf3(0x271)](_0x7d3da6,_0x12adf7),_0x3da76a=parseChatInterfaceYaml(a134_0x4f3caa['readFileSync'](_0x44595b,_0x23ebf3(0x1a7)),_0x44595b);_0x108c54[_0x23ebf3(0x277)]({'name':_0x3da76a['name'],'path':_0x44595b,'yaml':_0x3da76a});}}const _0x3e3d02=await this[_0x23ebf3(0x203)][_0x23ebf3(0x1e1)](_0xe54f73),_0x1a26f0=await this['client'][_0x23ebf3(0x247)](_0xe54f73),_0xae9c3e=await this['client'][_0x23ebf3(0x190)](_0xe54f73),_0x5c80a2=await this[_0x23ebf3(0x203)][_0x23ebf3(0x18b)](_0xe54f73),_0x118ad1=await this[_0x23ebf3(0x203)]['listIntegrations'](_0xe54f73),_0x159b8f=await safeListOrEmpty(()=>this[_0x23ebf3(0x203)][_0x23ebf3(0x1dd)](_0xe54f73)),_0x169577=await safeListOrEmpty(()=>this[_0x23ebf3(0x203)]['listExperimentalArtifacts'](_0xe54f73)),_0x20d24d=await safeListOrEmpty(()=>this[_0x23ebf3(0x203)][_0x23ebf3(0x22a)](_0xe54f73)),_0x1a2b4a=await safeListOrEmpty(()=>this[_0x23ebf3(0x203)][_0x23ebf3(0x1bb)](_0xe54f73)),_0x5ea292=await fetchAllToolTargetMaps((_0x3c0774,_0x2141d6)=>this[_0x23ebf3(0x203)][_0x23ebf3(0x24c)](_0x3c0774,_0x2141d6),_0xe54f73),_0x4969ef=new Map(),_0x470d3e=new Map(),_0x4ea27b=new Map(),_0x530c8c=new Map(),_0x49e608=new Map(),_0x2fa7fe=new Map(),_0x3a6ab3=new Map();for(const _0x1ca8f2 of _0x3e3d02){_0x4969ef[_0x23ebf3(0x26f)](_0x1ca8f2[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0x1ca8f2);}for(const _0x31a11d of _0x1a26f0){_0x470d3e[_0x23ebf3(0x26f)](_0x31a11d[_0x23ebf3(0x193)]['name'],_0x31a11d);}for(const _0x14ac4c of _0xae9c3e){_0x4ea27b[_0x23ebf3(0x26f)](_0x14ac4c['attributes'][_0x23ebf3(0x1da)],_0x14ac4c);}for(const _0x30053e of _0x5c80a2){_0x530c8c['set'](_0x30053e[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0x30053e);}for(const _0x5c953c of _0x118ad1){_0x49e608[_0x23ebf3(0x26f)](_0x5c953c['attributes'][_0x23ebf3(0x28f)]['toLowerCase'](),_0x5c953c);}for(const _0x8defda of _0x159b8f){_0x2fa7fe['set'](_0x8defda[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0x8defda);}for(const _0xe5838f of _0x169577){_0x3a6ab3[_0x23ebf3(0x26f)](_0xe5838f[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0xe5838f);}const _0x4d167e=new Map(),_0x226e44=new Map();for(const _0x53fc47 of _0x20d24d){_0x4d167e[_0x23ebf3(0x26f)](_0x53fc47[_0x23ebf3(0x193)]['name'],_0x53fc47);}for(const _0x3cf412 of _0x1a2b4a){_0x226e44[_0x23ebf3(0x26f)](_0x3cf412[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0x3cf412);}const _0x3acc7d=new Map(),_0x3d3ae7=new Map();for(const _0x3df1ec of _0x3e3d02){_0x3acc7d[_0x23ebf3(0x26f)](_0x3df1ec[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0x3df1ec['id']),_0x3d3ae7[_0x23ebf3(0x26f)](_0x3df1ec['id'],_0x3df1ec[_0x23ebf3(0x193)][_0x23ebf3(0x1da)]);}const _0x51dea4=new Map(),_0x42fdc8=new Map();for(const _0x53ed04 of _0x5c80a2){_0x51dea4['set'](_0x53ed04[_0x23ebf3(0x193)][_0x23ebf3(0x1da)],_0x53ed04['id']),_0x42fdc8[_0x23ebf3(0x26f)](_0x53ed04['id'],_0x53ed04[_0x23ebf3(0x193)]['name']);}const _0xd25b66=_0x5ea292['nameToId'][_0x23ebf3(0x219)]||new Map(),_0x553293=_0x5ea292['nameToId'][_0x23ebf3(0x282)]||new Map(),_0x5753f5=_0x5ea292[_0x23ebf3(0x288)]['ExperimentalKnowledgeBase']||new Map(),_0xadf01f=new Map(),_0x1286b9={'resolveToolTargetName':buildNameResolver({..._0x5ea292[_0x23ebf3(0x292)],'Agent':_0x3d3ae7}),'resolvePromptName':async _0xf32e83=>_0x42fdc8['get'](_0xf32e83),'onWarning':_0x4b12c2=>this[_0x23ebf3(0x1b4)][_0x23ebf3(0x1eb)](_0x4b12c2)};let _0x1dafc5=[];const _0x23718f={'projectId':_0xe54f73,'resolveToolTargetId':buildIdResolver({..._0x5ea292[_0x23ebf3(0x288)],'Agent':_0x3acc7d}),'resolvePromptId':async _0x1bf33c=>_0x51dea4[_0x23ebf3(0x1c0)](_0x1bf33c),'onWarning':_0x44b937=>{const _0x802bd=_0x23ebf3;this[_0x802bd(0x1b4)]['warn'](_0x44b937),_0x1dafc5[_0x802bd(0x277)](_0x44b937);}},{resolved:_0xa14eff,unresolved:_0x259343}=resolveAgentDependencies(_0x2fe103,new Set(_0x4969ef[_0x23ebf3(0x1a4)]()));for(const {agent:_0x10d6a1,missingDeps:_0x3d0e4b}of _0x259343){_0xd109b3['agents']['push']({'agentName':_0x10d6a1[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x23ebf3(0x253)+_0x3d0e4b[_0x23ebf3(0x271)](',\x20')+_0x23ebf3(0x211)}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x1bc)][_0x23ebf3(0x1a5)]++;}for(const _0x2e227c of _0x28d482){const _0x749a1f=_0x470d3e[_0x23ebf3(0x1c0)](_0x2e227c[_0x23ebf3(0x28b)]['name']),_0x1d4328=a134_0x4f3caa['readFileSync'](_0x2e227c[_0x23ebf3(0x19a)],_0x23ebf3(0x1a7));if(_0x749a1f){const _0x7564fe=apiKnowledgeBaseToYaml(_0x749a1f),_0x13a9bf=toKnowledgeBaseYamlString(_0x7564fe),_0x2688f3=generateDiff(_0x13a9bf,_0x1d4328),_0x29e89a=hasChanges(_0x2688f3);_0x29e89a?(_0xd109b3[_0x23ebf3(0x1e5)][_0x23ebf3(0x277)]({'name':_0x2e227c[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x749a1f['id'],'diff':formatDiffWithColors(_0x2688f3)}),_0xd109b3[_0x23ebf3(0x1f6)]['knowledgeBases'][_0x23ebf3(0x232)]++):(_0xd109b3['knowledgeBases'][_0x23ebf3(0x277)]({'name':_0x2e227c['yaml'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x23a),'id':_0x749a1f['id']}),_0xd109b3[_0x23ebf3(0x1f6)]['knowledgeBases'][_0x23ebf3(0x23a)]++);}else _0xd109b3[_0x23ebf3(0x1e5)][_0x23ebf3(0x277)]({'name':_0x2e227c['yaml'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b)}),_0xd109b3['counts']['knowledgeBases'][_0x23ebf3(0x27b)]++;}for(const _0x920566 of _0x45a269){const _0x5456a5=_0x4ea27b[_0x23ebf3(0x1c0)](_0x920566[_0x23ebf3(0x1da)]),_0x5b45a0=a134_0x4f3caa[_0x23ebf3(0x186)](_0x920566[_0x23ebf3(0x19a)],_0x23ebf3(0x1a7));if(_0x5456a5){const _0x379e31=toTextKnowledgeBaseMd(_0x5456a5['attributes'][_0x23ebf3(0x1da)],_0x5456a5['attributes'][_0x23ebf3(0x230)]),_0x1d59c2=generateDiff(_0x379e31,_0x5b45a0),_0x2f69bc=hasChanges(_0x1d59c2);_0x2f69bc?(_0xd109b3[_0x23ebf3(0x25f)]['push']({'name':_0x920566[_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x5456a5['id'],'diff':formatDiffWithColors(_0x1d59c2)}),_0xd109b3['counts']['textKnowledgeBases'][_0x23ebf3(0x232)]++):(_0xd109b3[_0x23ebf3(0x25f)]['push']({'name':_0x920566['name'],'action':_0x23ebf3(0x23a),'id':_0x5456a5['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x25f)][_0x23ebf3(0x23a)]++);}else _0xd109b3['textKnowledgeBases'][_0x23ebf3(0x277)]({'name':_0x920566[_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b)}),_0xd109b3[_0x23ebf3(0x1f6)]['textKnowledgeBases'][_0x23ebf3(0x27b)]++;}for(const _0x33574d of _0xa14eff){const _0x3c4922=_0x4969ef[_0x23ebf3(0x1c0)](_0x33574d[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)]),_0x5e98d6=a134_0xb4a0ec['join'](_0x33574d[_0x23ebf3(0x227)],_0x23ebf3(0x17c)),_0x147159=a134_0x4f3caa['readFileSync'](_0x5e98d6,'utf-8'),_0x1c46b7=_0x33574d['systemPrompt'],_0x37e0e8=_0x23ebf3(0x1ac)+_0x1c46b7+'\x0a\x0a#\x20agent.yml\x0a'+_0x147159;if(_0x3c4922){const {yaml:_0x2018db,systemPrompt:_0x4b15fb}=await agentResponseToDef(_0x3c4922,_0x1286b9),_0x220780=toAgentYamlString(_0x2018db),_0x114bb7='#\x20prompt.md\x0a'+_0x4b15fb+_0x23ebf3(0x206)+_0x220780,_0x32cd47=generateDiff(_0x114bb7,_0x37e0e8),_0x25cfa1=hasChanges(_0x32cd47);_0x25cfa1?(_0xd109b3[_0x23ebf3(0x1bc)][_0x23ebf3(0x277)]({'agentName':_0x33574d[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'agentId':_0x3c4922['id'],'diff':formatDiffWithColors(_0x32cd47)}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x1bc)][_0x23ebf3(0x232)]++):(_0xd109b3[_0x23ebf3(0x1bc)][_0x23ebf3(0x277)]({'agentName':_0x33574d[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':'unchanged','agentId':_0x3c4922['id']}),_0xd109b3[_0x23ebf3(0x1f6)]['agents']['unchanged']++);}else _0xd109b3[_0x23ebf3(0x1bc)][_0x23ebf3(0x277)]({'agentName':_0x33574d[_0x23ebf3(0x28b)]['name'],'action':'created'}),_0xd109b3['counts'][_0x23ebf3(0x1bc)][_0x23ebf3(0x27b)]++;}for(const _0x4753d9 of _0x2bd3f5){const _0x56e391=_0x530c8c[_0x23ebf3(0x1c0)](_0x4753d9[_0x23ebf3(0x28b)]['name']),_0x1b0409=a134_0x4f3caa['readFileSync'](_0x4753d9[_0x23ebf3(0x19a)],_0x23ebf3(0x1a7));if(_0x56e391){const _0x5407b5=await apiPromptToYaml(_0x56e391,_0x1286b9);if(!_0x5407b5){_0xd109b3['prompts'][_0x23ebf3(0x277)]({'name':_0x4753d9[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':'updated','id':_0x56e391['id']}),_0xd109b3['counts']['prompts'][_0x23ebf3(0x232)]++;continue;}const _0x5749b6=toPromptYamlString(_0x5407b5),_0x50675b=generateDiff(_0x5749b6,_0x1b0409),_0x2c2954=hasChanges(_0x50675b);_0x2c2954?(_0xd109b3['prompts'][_0x23ebf3(0x277)]({'name':_0x4753d9[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':'updated','id':_0x56e391['id'],'diff':formatDiffWithColors(_0x50675b)}),_0xd109b3['counts'][_0x23ebf3(0x25d)][_0x23ebf3(0x232)]++):(_0xd109b3[_0x23ebf3(0x25d)][_0x23ebf3(0x277)]({'name':_0x4753d9[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x23a),'id':_0x56e391['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x25d)][_0x23ebf3(0x23a)]++);}else _0xd109b3[_0x23ebf3(0x25d)]['push']({'name':_0x4753d9[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b)}),_0xd109b3['counts'][_0x23ebf3(0x25d)][_0x23ebf3(0x27b)]++;}for(const _0x1a807f of _0x13d6c4){const _0x33f188=_0x49e608[_0x23ebf3(0x1c0)](_0x1a807f[_0x23ebf3(0x28b)][_0x23ebf3(0x1b8)]),_0x271892=a134_0x4f3caa['readFileSync'](_0x1a807f[_0x23ebf3(0x19a)],_0x23ebf3(0x1a7));if(_0x33f188){const _0x3a88c1=await apiIntegrationToYaml(_0x33f188,_0x1286b9),_0x598afe=toIntegrationYamlString(_0x3a88c1),_0x41c900=generateDiff(_0x598afe,_0x271892),_0x224b5f=hasChanges(_0x41c900);_0x224b5f?(_0xd109b3[_0x23ebf3(0x180)][_0x23ebf3(0x277)]({'name':_0x1a807f['yaml'][_0x23ebf3(0x1b8)],'action':_0x23ebf3(0x232),'id':_0x33f188['id'],'diff':formatDiffWithColors(_0x41c900)}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x180)][_0x23ebf3(0x232)]++):(_0xd109b3['integrations']['push']({'name':_0x1a807f['yaml']['service_type'],'action':_0x23ebf3(0x23a),'id':_0x33f188['id']}),_0xd109b3[_0x23ebf3(0x1f6)]['integrations'][_0x23ebf3(0x23a)]++);}else _0xd109b3[_0x23ebf3(0x180)][_0x23ebf3(0x277)]({'name':_0x1a807f[_0x23ebf3(0x28b)]['service_type'],'action':_0x23ebf3(0x27b)}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x180)][_0x23ebf3(0x27b)]++;}for(const _0x4fa755 of _0x36233a){const _0x1271b7=_0x2fa7fe[_0x23ebf3(0x1c0)](_0x4fa755[_0x23ebf3(0x290)]['name']),_0x355194=toExperimentalKnowledgeBaseYamlString(_0x4fa755[_0x23ebf3(0x290)]);let _0x5db6f8=_0x355194;for(const _0x1c9075 of _0x4fa755['def'][_0x23ebf3(0x24f)]){_0x5db6f8+='\x0a---\x20function:\x20'+_0x1c9075[_0x23ebf3(0x1da)]+_0x23ebf3(0x1a2)+_0x1c9075[_0x23ebf3(0x28a)]+'\x0a---\x20schema:\x20'+_0x1c9075[_0x23ebf3(0x1da)]+'\x20---\x0a'+_0x1c9075[_0x23ebf3(0x197)]+'\x0a';}if(_0x1271b7){const _0x289a88=apiExperimentalKnowledgeBaseToYaml(_0x1271b7),_0x30159f=toExperimentalKnowledgeBaseYamlString(_0x289a88);let _0x7dd604=_0x30159f;for(const _0x35512d of _0x289a88[_0x23ebf3(0x24f)]){_0x7dd604+=_0x23ebf3(0x226)+_0x35512d[_0x23ebf3(0x1da)]+_0x23ebf3(0x1a2)+_0x35512d[_0x23ebf3(0x28a)]+'\x0a---\x20schema:\x20'+_0x35512d['name']+_0x23ebf3(0x1a2)+_0x35512d[_0x23ebf3(0x197)]+'\x0a';}const _0x187eea=generateDiff(_0x7dd604,_0x5db6f8),_0xbb142f=hasChanges(_0x187eea);_0xbb142f?(_0xd109b3[_0x23ebf3(0x1cb)]['push']({'name':_0x4fa755['def'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x1271b7['id'],'diff':formatDiffWithColors(_0x187eea)}),_0xd109b3[_0x23ebf3(0x1f6)]['experimentalKnowledgeBases'][_0x23ebf3(0x232)]++):(_0xd109b3[_0x23ebf3(0x1cb)][_0x23ebf3(0x277)]({'name':_0x4fa755[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x23a),'id':_0x1271b7['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x1cb)][_0x23ebf3(0x23a)]++);}else _0xd109b3[_0x23ebf3(0x1cb)][_0x23ebf3(0x277)]({'name':_0x4fa755[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b)}),_0xd109b3['counts'][_0x23ebf3(0x1cb)][_0x23ebf3(0x27b)]++;}for(const _0x40fb9f of _0x122fc5){const _0x1745fd=_0x3a6ab3[_0x23ebf3(0x1c0)](_0x40fb9f['def'][_0x23ebf3(0x1da)]),_0x4e7e3b=toExperimentalArtifactYamlString(_0x40fb9f[_0x23ebf3(0x290)]);let _0x54a778=_0x4e7e3b+(_0x23ebf3(0x18e)+_0x40fb9f['def'][_0x23ebf3(0x28a)]+'\x0a');for(const _0x33da11 of _0x40fb9f[_0x23ebf3(0x290)][_0x23ebf3(0x200)]){_0x54a778+='---\x20file:\x20'+_0x33da11[_0x23ebf3(0x295)]+_0x23ebf3(0x1a2)+_0x33da11[_0x23ebf3(0x296)]+'\x0a';}if(_0x1745fd){const _0x42487d=apiExperimentalArtifactToYaml(_0x1745fd),_0x2f51c4=toExperimentalArtifactYamlString(_0x42487d);let _0x451d6e=_0x2f51c4+(_0x23ebf3(0x18e)+_0x42487d[_0x23ebf3(0x28a)]+'\x0a');for(const _0x444943 of _0x42487d['files']){_0x451d6e+='---\x20file:\x20'+_0x444943[_0x23ebf3(0x295)]+'\x20---\x0a'+_0x444943[_0x23ebf3(0x296)]+'\x0a';}const _0x2087fb=generateDiff(_0x451d6e,_0x54a778),_0x550572=hasChanges(_0x2087fb);_0x550572?(_0xd109b3[_0x23ebf3(0x20a)][_0x23ebf3(0x277)]({'name':_0x40fb9f['def'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x1745fd['id'],'diff':formatDiffWithColors(_0x2087fb)}),_0xd109b3['counts'][_0x23ebf3(0x20a)][_0x23ebf3(0x232)]++):(_0xd109b3[_0x23ebf3(0x20a)]['push']({'name':_0x40fb9f[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x23a),'id':_0x1745fd['id']}),_0xd109b3['counts'][_0x23ebf3(0x20a)][_0x23ebf3(0x23a)]++);}else _0xd109b3[_0x23ebf3(0x20a)]['push']({'name':_0x40fb9f[_0x23ebf3(0x290)]['name'],'action':'created'}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x20a)][_0x23ebf3(0x27b)]++;}for(const _0x33a29c of _0x29f193){const _0x560459=_0x4d167e['get'](_0x33a29c[_0x23ebf3(0x28b)]['name']),_0x1e1139=a134_0x4f3caa['readFileSync'](_0x33a29c[_0x23ebf3(0x19a)],_0x23ebf3(0x1a7));if(_0x560459){const _0x5385ae=await apiFormInterfaceToYaml(_0x560459,_0x1286b9),_0x234d78=toFormInterfaceYamlString(_0x5385ae),_0x16a6c8=generateDiff(_0x234d78,_0x1e1139),_0x659bdf=hasChanges(_0x16a6c8);_0x659bdf?(_0xd109b3[_0x23ebf3(0x194)][_0x23ebf3(0x277)]({'name':_0x33a29c[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x560459['id'],'diff':formatDiffWithColors(_0x16a6c8)}),_0xd109b3[_0x23ebf3(0x1f6)]['formInterfaces'][_0x23ebf3(0x232)]++):(_0xd109b3[_0x23ebf3(0x194)][_0x23ebf3(0x277)]({'name':_0x33a29c[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x23a),'id':_0x560459['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x194)]['unchanged']++);}else _0xd109b3[_0x23ebf3(0x194)][_0x23ebf3(0x277)]({'name':_0x33a29c['yaml']['name'],'action':_0x23ebf3(0x27b)}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x194)][_0x23ebf3(0x27b)]++;}for(const _0x5d7b8d of _0x108c54){const _0x52c001=_0x226e44[_0x23ebf3(0x1c0)](_0x5d7b8d['yaml'][_0x23ebf3(0x1da)]),_0x1270e9=a134_0x4f3caa[_0x23ebf3(0x186)](_0x5d7b8d[_0x23ebf3(0x19a)],_0x23ebf3(0x1a7));if(_0x52c001){const _0x36a111=await apiChatInterfaceToYaml(_0x52c001,_0x1286b9),_0x907a0b=toChatInterfaceYamlString(_0x36a111),_0x37d01c=generateDiff(_0x907a0b,_0x1270e9),_0x573d62=hasChanges(_0x37d01c);_0x573d62?(_0xd109b3[_0x23ebf3(0x266)][_0x23ebf3(0x277)]({'name':_0x5d7b8d[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x52c001['id'],'diff':formatDiffWithColors(_0x37d01c)}),_0xd109b3['counts'][_0x23ebf3(0x266)]['updated']++):(_0xd109b3[_0x23ebf3(0x266)][_0x23ebf3(0x277)]({'name':_0x5d7b8d[_0x23ebf3(0x28b)]['name'],'action':_0x23ebf3(0x23a),'id':_0x52c001['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x266)][_0x23ebf3(0x23a)]++);}else _0xd109b3[_0x23ebf3(0x266)][_0x23ebf3(0x277)]({'name':_0x5d7b8d['yaml'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b)}),_0xd109b3['counts'][_0x23ebf3(0x266)][_0x23ebf3(0x27b)]++;}if(_0xa08415?.['dryRun'])return _0xd109b3;_0xd109b3[_0x23ebf3(0x1e5)]=[],_0xd109b3[_0x23ebf3(0x25f)]=[],_0xd109b3[_0x23ebf3(0x25d)]=[],_0xd109b3[_0x23ebf3(0x180)]=[],_0xd109b3[_0x23ebf3(0x1cb)]=[],_0xd109b3[_0x23ebf3(0x20a)]=[],_0xd109b3[_0x23ebf3(0x194)]=[],_0xd109b3[_0x23ebf3(0x266)]=[];const _0xec9582=_0xd109b3[_0x23ebf3(0x1bc)]['filter'](_0x5b7ca0=>_0x5b7ca0[_0x23ebf3(0x215)]==='error');_0xd109b3[_0x23ebf3(0x1bc)]=_0xec9582,_0xd109b3[_0x23ebf3(0x1f6)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0xec9582[_0x23ebf3(0x189)]},'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},'formInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'chatInterfaces':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}};for(const _0x2a0e2d of _0x28d482){try{const _0x4c7e81=_0x470d3e[_0x23ebf3(0x1c0)](_0x2a0e2d['yaml'][_0x23ebf3(0x1da)]),_0x105a2e=yamlKnowledgeBaseToApi(_0x2a0e2d[_0x23ebf3(0x28b)],_0xe54f73);if(_0x4c7e81)await this[_0x23ebf3(0x203)][_0x23ebf3(0x26a)](_0x4c7e81['id'],_0x105a2e),_0xd25b66[_0x23ebf3(0x26f)](_0x2a0e2d[_0x23ebf3(0x28b)]['name'],_0x4c7e81['id']),_0xd109b3[_0x23ebf3(0x1e5)]['push']({'name':_0x2a0e2d['yaml'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x4c7e81['id']}),_0xd109b3[_0x23ebf3(0x1f6)]['knowledgeBases'][_0x23ebf3(0x232)]++;else{const _0x4c782b=await this['client']['createKnowledgeBase'](_0x105a2e);_0xd25b66[_0x23ebf3(0x26f)](_0x2a0e2d['yaml']['name'],_0x4c782b['id']),_0xd109b3[_0x23ebf3(0x1e5)][_0x23ebf3(0x277)]({'name':_0x2a0e2d[_0x23ebf3(0x28b)]['name'],'action':'created','id':_0x4c782b['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x1e5)][_0x23ebf3(0x27b)]++;}}catch(_0x34867f){_0xd109b3[_0x23ebf3(0x1e5)][_0x23ebf3(0x277)]({'name':_0x2a0e2d[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x34867f[_0x23ebf3(0x1af)]}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x1e5)][_0x23ebf3(0x1a5)]++;}}for(const _0x442d17 of _0x45a269){try{const _0x276e18=_0x4ea27b[_0x23ebf3(0x1c0)](_0x442d17['name']),_0x2e5c04=yamlTextKnowledgeBaseToApi({'name':_0x442d17['name'],'text':_0x442d17[_0x23ebf3(0x230)]},_0xe54f73);if(_0x276e18)await this['client'][_0x23ebf3(0x1d4)](_0x276e18['id'],_0x2e5c04),_0x553293['set'](_0x442d17[_0x23ebf3(0x1da)],_0x276e18['id']),_0xd109b3[_0x23ebf3(0x25f)]['push']({'name':_0x442d17[_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x276e18['id']}),_0xd109b3[_0x23ebf3(0x1f6)]['textKnowledgeBases']['updated']++;else{const _0x29313b=await this[_0x23ebf3(0x203)][_0x23ebf3(0x1b0)](_0x2e5c04);_0x553293['set'](_0x442d17[_0x23ebf3(0x1da)],_0x29313b['id']),_0xd109b3[_0x23ebf3(0x25f)][_0x23ebf3(0x277)]({'name':_0x442d17['name'],'action':_0x23ebf3(0x27b),'id':_0x29313b['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x25f)]['created']++;}}catch(_0x2d6a4d){_0xd109b3[_0x23ebf3(0x25f)]['push']({'name':_0x442d17[_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x2d6a4d[_0x23ebf3(0x1af)]}),_0xd109b3[_0x23ebf3(0x1f6)]['textKnowledgeBases'][_0x23ebf3(0x1a5)]++;}}for(const _0x112968 of _0x36233a){try{const _0x47f80d=_0x2fa7fe[_0x23ebf3(0x1c0)](_0x112968[_0x23ebf3(0x290)][_0x23ebf3(0x1da)]),_0x19dc9a=yamlExperimentalKnowledgeBaseToApi(_0x112968['def'],_0xe54f73);if(_0x47f80d)await this[_0x23ebf3(0x203)][_0x23ebf3(0x192)](_0x47f80d['id'],_0x19dc9a),_0x5753f5[_0x23ebf3(0x26f)](_0x112968[_0x23ebf3(0x290)]['name'],_0x47f80d['id']),_0xd109b3[_0x23ebf3(0x1cb)][_0x23ebf3(0x277)]({'name':_0x112968[_0x23ebf3(0x290)]['name'],'action':'updated','id':_0x47f80d['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x1cb)]['updated']++;else{const _0x499865=await this[_0x23ebf3(0x203)][_0x23ebf3(0x208)](_0x19dc9a);_0x5753f5[_0x23ebf3(0x26f)](_0x112968[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],_0x499865['id']),_0xd109b3[_0x23ebf3(0x1cb)][_0x23ebf3(0x277)]({'name':_0x112968[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b),'id':_0x499865['id']}),_0xd109b3['counts'][_0x23ebf3(0x1cb)]['created']++;}}catch(_0x26e25b){_0xd109b3[_0x23ebf3(0x1cb)][_0x23ebf3(0x277)]({'name':_0x112968[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x26e25b[_0x23ebf3(0x1af)]}),_0xd109b3['counts']['experimentalKnowledgeBases']['errors']++;}}for(const _0x3a47f4 of _0x122fc5){try{const _0x5b1db8=_0x3a6ab3[_0x23ebf3(0x1c0)](_0x3a47f4[_0x23ebf3(0x290)][_0x23ebf3(0x1da)]),_0x21cc3f=yamlExperimentalArtifactToApi(_0x3a47f4[_0x23ebf3(0x290)],_0xe54f73);if(_0x5b1db8)await this[_0x23ebf3(0x203)][_0x23ebf3(0x281)](_0x5b1db8['id'],_0x21cc3f),_0xadf01f['set'](_0x3a47f4[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],_0x5b1db8['id']),_0xd109b3[_0x23ebf3(0x20a)][_0x23ebf3(0x277)]({'name':_0x3a47f4['def'][_0x23ebf3(0x1da)],'action':'updated','id':_0x5b1db8['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x20a)][_0x23ebf3(0x232)]++;else{const _0x1dacfc=await this[_0x23ebf3(0x203)][_0x23ebf3(0x21b)](_0x21cc3f);_0xadf01f['set'](_0x3a47f4['def'][_0x23ebf3(0x1da)],_0x1dacfc['id']),_0xd109b3['experimentalArtifacts'][_0x23ebf3(0x277)]({'name':_0x3a47f4[_0x23ebf3(0x290)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b),'id':_0x1dacfc['id']}),_0xd109b3['counts'][_0x23ebf3(0x20a)][_0x23ebf3(0x27b)]++;}}catch(_0x288992){_0xd109b3[_0x23ebf3(0x20a)][_0x23ebf3(0x277)]({'name':_0x3a47f4['def'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x288992['message']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x20a)][_0x23ebf3(0x1a5)]++;}}for(const _0x2180f6 of _0xa14eff){_0x1dafc5=[];try{const _0x5ac498=_0x4969ef[_0x23ebf3(0x1c0)](_0x2180f6[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)]),_0x4f8554=await agentDefToRequest(_0x2180f6['yaml'],_0x2180f6[_0x23ebf3(0x1fc)],_0x2180f6[_0x23ebf3(0x1d0)],_0x23718f);if(_0x5ac498)await this[_0x23ebf3(0x203)][_0x23ebf3(0x1dc)](_0x5ac498['id'],_0x4f8554),_0x3acc7d[_0x23ebf3(0x26f)](_0x2180f6[_0x23ebf3(0x28b)]['name'],_0x5ac498['id']),_0xd109b3[_0x23ebf3(0x1bc)][_0x23ebf3(0x277)]({'agentName':_0x2180f6['yaml'][_0x23ebf3(0x1da)],'action':'updated','agentId':_0x5ac498['id'],'warnings':_0x1dafc5['length']>0x0?_0x1dafc5:undefined}),_0xd109b3['counts'][_0x23ebf3(0x1bc)][_0x23ebf3(0x232)]++;else{const _0x39f40e=await this[_0x23ebf3(0x203)][_0x23ebf3(0x1d1)](_0x4f8554);_0x3acc7d[_0x23ebf3(0x26f)](_0x2180f6['yaml'][_0x23ebf3(0x1da)],_0x39f40e['id']),_0xd109b3[_0x23ebf3(0x1bc)]['push']({'agentName':_0x2180f6[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b),'agentId':_0x39f40e['id'],'warnings':_0x1dafc5[_0x23ebf3(0x189)]>0x0?_0x1dafc5:undefined}),_0xd109b3['counts'][_0x23ebf3(0x1bc)][_0x23ebf3(0x27b)]++;}}catch(_0x549d70){_0xd109b3['agents']['push']({'agentName':_0x2180f6[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x549d70[_0x23ebf3(0x1af)],'warnings':_0x1dafc5['length']>0x0?_0x1dafc5:undefined}),_0xd109b3[_0x23ebf3(0x1f6)]['agents'][_0x23ebf3(0x1a5)]++;}}for(const _0x11a7de of _0x2bd3f5){try{const _0x4ddbf4=_0x530c8c[_0x23ebf3(0x1c0)](_0x11a7de[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)]),_0x2d6c5b=await yamlPromptToApi(_0x11a7de[_0x23ebf3(0x28b)],_0xe54f73,_0x23718f);if(!_0x2d6c5b){_0xd109b3[_0x23ebf3(0x25d)][_0x23ebf3(0x277)]({'name':_0x11a7de[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x23ebf3(0x1ae)}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x25d)][_0x23ebf3(0x1a5)]++;continue;}if(_0x4ddbf4)await this[_0x23ebf3(0x203)][_0x23ebf3(0x1df)](_0x4ddbf4['id'],_0x2d6c5b),_0x51dea4['set'](_0x11a7de[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],_0x4ddbf4['id']),_0xd109b3[_0x23ebf3(0x25d)][_0x23ebf3(0x277)]({'name':_0x11a7de[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x4ddbf4['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x25d)][_0x23ebf3(0x232)]++;else{const _0x7b5bd=await this[_0x23ebf3(0x203)][_0x23ebf3(0x256)](_0x2d6c5b);_0x51dea4[_0x23ebf3(0x26f)](_0x11a7de[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],_0x7b5bd['id']),_0xd109b3[_0x23ebf3(0x25d)][_0x23ebf3(0x277)]({'name':_0x11a7de[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':'created','id':_0x7b5bd['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x25d)][_0x23ebf3(0x27b)]++;}}catch(_0x307cd6){_0xd109b3['prompts'][_0x23ebf3(0x277)]({'name':_0x11a7de['yaml'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x307cd6['message']}),_0xd109b3[_0x23ebf3(0x1f6)]['prompts'][_0x23ebf3(0x1a5)]++;}}for(const _0x330703 of _0x13d6c4){try{const _0x5f2086=_0x49e608[_0x23ebf3(0x1c0)](_0x330703[_0x23ebf3(0x28b)][_0x23ebf3(0x1b8)]),_0x196d87=await yamlIntegrationToApi(_0x330703[_0x23ebf3(0x28b)],_0xe54f73,_0x23718f);if(_0x5f2086){await this[_0x23ebf3(0x203)][_0x23ebf3(0x27a)](_0x5f2086['id']);const _0xed109f=await this['client'][_0x23ebf3(0x1a9)](_0x196d87);_0xd109b3[_0x23ebf3(0x180)][_0x23ebf3(0x277)]({'name':_0x330703['yaml'][_0x23ebf3(0x1b8)],'action':_0x23ebf3(0x232),'id':_0xed109f['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x180)][_0x23ebf3(0x232)]++;}else{const _0x3f2b2f=await this[_0x23ebf3(0x203)][_0x23ebf3(0x1a9)](_0x196d87);_0xd109b3[_0x23ebf3(0x180)][_0x23ebf3(0x277)]({'name':_0x330703[_0x23ebf3(0x28b)][_0x23ebf3(0x1b8)],'action':_0x23ebf3(0x27b),'id':_0x3f2b2f['id']}),_0xd109b3['counts'][_0x23ebf3(0x180)][_0x23ebf3(0x27b)]++;}}catch(_0x36abb1){_0xd109b3['integrations']['push']({'name':_0x330703['yaml'][_0x23ebf3(0x1b8)],'action':_0x23ebf3(0x1ba),'error':_0x36abb1['message']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x180)][_0x23ebf3(0x1a5)]++;}}for(const _0x410382 of _0x29f193){try{const _0x30d7fa=_0x4d167e[_0x23ebf3(0x1c0)](_0x410382[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)]),_0x1e4d46=await yamlFormInterfaceToApi(_0x410382[_0x23ebf3(0x28b)],_0xe54f73,_0x23718f);if(!_0x1e4d46){_0xd109b3[_0x23ebf3(0x194)][_0x23ebf3(0x277)]({'name':_0x410382[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x23ebf3(0x26c)}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x194)][_0x23ebf3(0x1a5)]++;continue;}if(_0x30d7fa){const _0x182ad6=await this[_0x23ebf3(0x203)][_0x23ebf3(0x1d9)](_0x30d7fa['id'],_0x1e4d46);_0xd109b3[_0x23ebf3(0x194)][_0x23ebf3(0x277)]({'name':_0x410382['yaml'][_0x23ebf3(0x1da)],'action':'updated','id':_0x182ad6['id']}),_0xd109b3['counts'][_0x23ebf3(0x194)]['updated']++;}else{const _0x17ddf1=await this['client'][_0x23ebf3(0x1a3)](_0x1e4d46);_0xd109b3[_0x23ebf3(0x194)][_0x23ebf3(0x277)]({'name':_0x410382['yaml']['name'],'action':_0x23ebf3(0x27b),'id':_0x17ddf1['id']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x194)]['created']++;}}catch(_0x3aa51f){_0xd109b3['formInterfaces'][_0x23ebf3(0x277)]({'name':_0x410382[_0x23ebf3(0x28b)]['name'],'action':'error','error':_0x3aa51f['message']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x194)][_0x23ebf3(0x1a5)]++;}}for(const _0x3fe349 of _0x108c54){try{const _0xf2146c=_0x226e44[_0x23ebf3(0x1c0)](_0x3fe349[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)]),_0x49dc8f=await yamlChatInterfaceToApi(_0x3fe349['yaml'],_0xe54f73,_0x23718f);if(_0xf2146c){const _0x3da358=await this['client']['updateChatInterface'](_0xf2146c['id'],_0x49dc8f);_0xd109b3['chatInterfaces'][_0x23ebf3(0x277)]({'name':_0x3fe349[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x232),'id':_0x3da358['id']}),_0xd109b3['counts']['chatInterfaces']['updated']++;}else{const _0x3a5a89=await this[_0x23ebf3(0x203)][_0x23ebf3(0x24a)](_0x49dc8f);_0xd109b3[_0x23ebf3(0x266)]['push']({'name':_0x3fe349[_0x23ebf3(0x28b)][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x27b),'id':_0x3a5a89['id']}),_0xd109b3[_0x23ebf3(0x1f6)]['chatInterfaces'][_0x23ebf3(0x27b)]++;}}catch(_0x1b1d91){_0xd109b3[_0x23ebf3(0x266)][_0x23ebf3(0x277)]({'name':_0x3fe349['yaml'][_0x23ebf3(0x1da)],'action':_0x23ebf3(0x1ba),'error':_0x1b1d91['message']}),_0xd109b3[_0x23ebf3(0x1f6)][_0x23ebf3(0x266)][_0x23ebf3(0x1a5)]++;}}return _0xd109b3;}async['pullAgent'](_0x37cf9f,_0x16004f,_0x4aea3a,_0x8b8500){const _0xe2c72b=a134_0x1280fc,{projectId:_0x2e2a22,project:_0x44472a}=await this['resolveProjectName'](_0x37cf9f),_0x268df7=_0x44472a['attributes'][_0xe2c72b(0x1da)],_0x322e93=await this[_0xe2c72b(0x203)][_0xe2c72b(0x1e1)](_0x2e2a22),_0x34e1e3=_0x322e93[_0xe2c72b(0x1ef)](_0x144997=>_0x144997['attributes'][_0xe2c72b(0x1da)]===_0x16004f);if(!_0x34e1e3)throw new SDKError(ErrorCode[_0xe2c72b(0x1a0)],'Agent\x20not\x20found:\x20'+_0x16004f,undefined,{'helpText':_0xe2c72b(0x222)+_0x322e93[_0xe2c72b(0x1ca)](_0x254989=>_0x254989[_0xe2c72b(0x193)][_0xe2c72b(0x1da)])[_0xe2c72b(0x271)](',\x20')});let _0x581fa1;if(_0x4aea3a)_0x581fa1=_0x4aea3a;else{const _0x5d86f7=a134_0xb4a0ec[_0xe2c72b(0x271)](process['cwd'](),_0xe2c72b(0x1bc)),_0x54fc3c=getSanitizedPathWithMigration(_0x5d86f7,_0x268df7);_0x54fc3c[_0xe2c72b(0x234)]&&this[_0xe2c72b(0x1b4)][_0xe2c72b(0x183)](_0xe2c72b(0x276)+a134_0xb4a0ec['basename'](_0x54fc3c[_0xe2c72b(0x254)])+_0xe2c72b(0x28d)+a134_0xb4a0ec[_0xe2c72b(0x23c)](_0x54fc3c['path'])),_0x581fa1=_0x54fc3c['path'];}const _0xb1dcf4=getSanitizedPathWithMigration(_0x581fa1,_0x16004f);_0xb1dcf4['renamed']&&this[_0xe2c72b(0x1b4)]['info'](_0xe2c72b(0x1a1)+a134_0xb4a0ec[_0xe2c72b(0x23c)](_0xb1dcf4[_0xe2c72b(0x254)])+'\x20→\x20'+a134_0xb4a0ec[_0xe2c72b(0x23c)](_0xb1dcf4[_0xe2c72b(0x19a)]));const _0x1662e7=_0xb1dcf4['path'],_0x5d2631=new Map(),_0x4bdff1=new Map(),_0x1560eb=await this[_0xe2c72b(0x203)][_0xe2c72b(0x247)](_0x2e2a22),_0x4f0d46=await this[_0xe2c72b(0x203)]['listTextKnowledgeBases'](_0x2e2a22),_0x400e60=await safeListOrEmpty(()=>this['client']['listExperimentalKnowledgeBases'](_0x2e2a22)),_0xe50afc=new Map(),_0x5eb2d3=new Map();for(const _0x239418 of _0x1560eb){_0x5d2631[_0xe2c72b(0x26f)](_0x239418['id'],_0x239418[_0xe2c72b(0x193)]['name']);}for(const _0x36ed46 of _0x4f0d46){_0xe50afc[_0xe2c72b(0x26f)](_0x36ed46['id'],_0x36ed46[_0xe2c72b(0x193)][_0xe2c72b(0x1da)]);}for(const _0x21b599 of _0x400e60){_0x5eb2d3['set'](_0x21b599['id'],_0x21b599['attributes'][_0xe2c72b(0x1da)]);}for(const _0x495719 of _0x322e93){_0x4bdff1[_0xe2c72b(0x26f)](_0x495719['id'],_0x495719['attributes'][_0xe2c72b(0x1da)]);}const _0xdccfcb={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x5d2631,'TextKnowledgeBase':_0xe50afc,'Agent':_0x4bdff1,'ExperimentalKnowledgeBase':_0x5eb2d3}),'resolvePromptName':async()=>undefined,'onWarning':_0x1c2132=>this[_0xe2c72b(0x1b4)]['warn'](_0x1c2132)},_0x39813b=a134_0xb4a0ec[_0xe2c72b(0x271)](_0x1662e7,_0xe2c72b(0x214)),_0x5afb5b=a134_0xb4a0ec[_0xe2c72b(0x271)](_0x1662e7,'agent.yml'),_0x237ad2=a134_0xb4a0ec[_0xe2c72b(0x271)](_0x1662e7,_0xe2c72b(0x22f)),_0x49d000=!a134_0x4f3caa['existsSync'](_0x5afb5b);if(_0x8b8500?.[_0xe2c72b(0x248)])return{'agentName':_0x16004f,'outputPath':_0x1662e7,'isNew':_0x49d000,'hasChanges':!![]};a134_0x4f3caa[_0xe2c72b(0x20f)](_0x581fa1,{'recursive':!![]}),a134_0x4f3caa[_0xe2c72b(0x20f)](_0x1662e7,{'recursive':!![]});const _0x31d8a3=a134_0xb4a0ec[_0xe2c72b(0x271)](_0x581fa1,'tdx.json');!a134_0x4f3caa[_0xe2c72b(0x273)](_0x31d8a3)&&a134_0x4f3caa[_0xe2c72b(0x188)](_0x31d8a3,createAgentConfigContent(_0x37cf9f));const {yaml:_0x245659,systemPrompt:_0x392c4b,starterMessage:_0x520eef}=await agentResponseToDef(_0x34e1e3,_0xdccfcb);let _0xfe9587=_0x49d000;if(!_0x49d000){const _0x514cb3=a134_0x4f3caa[_0xe2c72b(0x273)](_0x39813b)?a134_0x4f3caa[_0xe2c72b(0x186)](_0x39813b,_0xe2c72b(0x1a7)):'',_0x273645=a134_0x4f3caa[_0xe2c72b(0x186)](_0x5afb5b,'utf-8');_0xfe9587=_0x514cb3!==_0x392c4b||_0x273645!==toAgentYamlString(_0x245659);}a134_0x4f3caa['writeFileSync'](_0x39813b,_0x392c4b),a134_0x4f3caa[_0xe2c72b(0x188)](_0x5afb5b,toAgentYamlString(_0x245659));if(_0x520eef&&_0x520eef[_0xe2c72b(0x20c)]('\x0a'))a134_0x4f3caa['writeFileSync'](_0x237ad2,_0x520eef);else a134_0x4f3caa[_0xe2c72b(0x273)](_0x237ad2)&&a134_0x4f3caa[_0xe2c72b(0x231)](_0x237ad2);return{'agentName':_0x16004f,'outputPath':_0x1662e7,'isNew':_0x49d000,'hasChanges':_0xfe9587};}async[a134_0x1280fc(0x182)](_0x10601e,_0xc3c24){const _0x37e604=a134_0x1280fc;let _0x3c3779;isAgentYamlPath(_0x10601e)?_0x3c3779=getAgentDirFromYamlPath(_0x10601e):_0x3c3779=_0x10601e;const {config:_0x9348ae}=findAgentConfig(_0x3c3779),_0x57236d=await this[_0x37e604(0x1ea)](_0x9348ae[_0x37e604(0x280)]),_0x43284e=a134_0xb4a0ec['join'](_0x3c3779,'agent.yml'),_0x4b1dda=a134_0xb4a0ec[_0x37e604(0x271)](_0x3c3779,_0x37e604(0x214)),_0x2b94e4=a134_0xb4a0ec['join'](_0x3c3779,'starter_message.md');if(!a134_0x4f3caa[_0x37e604(0x273)](_0x43284e))throw new SDKError(ErrorCode['NOT_FOUND'],'agent.yml\x20not\x20found\x20in\x20'+_0x3c3779,undefined,{'helpText':_0x37e604(0x221)});const _0x3097ea=parseAgentYaml(a134_0x4f3caa[_0x37e604(0x186)](_0x43284e,_0x37e604(0x1a7)),_0x43284e),_0x1cc1e0=a134_0x4f3caa[_0x37e604(0x273)](_0x4b1dda)?a134_0x4f3caa[_0x37e604(0x186)](_0x4b1dda,_0x37e604(0x1a7)):'',_0xe98055=a134_0x4f3caa[_0x37e604(0x273)](_0x2b94e4)?a134_0x4f3caa[_0x37e604(0x186)](_0x2b94e4,_0x37e604(0x1a7)):_0x3097ea[_0x37e604(0x1ec)];if(_0xc3c24?.[_0x37e604(0x248)])return{'agentName':_0x3097ea[_0x37e604(0x1da)],'action':_0x37e604(0x27b),'projectId':_0x57236d};const _0x4fa599=await this[_0x37e604(0x203)][_0x37e604(0x1e1)](_0x57236d),_0x4d302a=await fetchAllToolTargetMaps((_0x1a4f71,_0x114816)=>this[_0x37e604(0x203)][_0x37e604(0x24c)](_0x1a4f71,_0x114816),_0x57236d),_0x373bb5=new Map();for(const _0x18fd93 of _0x4fa599){_0x373bb5[_0x37e604(0x26f)](_0x18fd93['attributes']['name'],_0x18fd93['id']);}const _0x1b56fd=[],_0x1db545={'projectId':_0x57236d,'resolveToolTargetId':buildIdResolver({..._0x4d302a['nameToId'],'Agent':_0x373bb5}),'resolvePromptId':async()=>undefined,'onWarning':_0x1808bf=>{const _0x55e331=_0x37e604;this['logger'][_0x55e331(0x1eb)](_0x1808bf),_0x1b56fd[_0x55e331(0x277)](_0x1808bf);}};try{const _0x2e60b8=_0x4fa599[_0x37e604(0x1ef)](_0x3ea2f7=>_0x3ea2f7[_0x37e604(0x193)][_0x37e604(0x1da)]===_0x3097ea[_0x37e604(0x1da)]),_0x189f70=await agentDefToRequest(_0x3097ea,_0x1cc1e0,_0xe98055,_0x1db545);if(_0x2e60b8)return await this['client'][_0x37e604(0x1dc)](_0x2e60b8['id'],_0x189f70),{'agentName':_0x3097ea[_0x37e604(0x1da)],'action':_0x37e604(0x232),'projectId':_0x57236d,'agentId':_0x2e60b8['id'],'warnings':_0x1b56fd[_0x37e604(0x189)]>0x0?_0x1b56fd:undefined};else{const _0x15d1b2=await this['client'][_0x37e604(0x1d1)](_0x189f70);return{'agentName':_0x3097ea[_0x37e604(0x1da)],'action':_0x37e604(0x27b),'projectId':_0x57236d,'agentId':_0x15d1b2['id'],'warnings':_0x1b56fd['length']>0x0?_0x1b56fd:undefined};}}catch(_0x2e1611){return{'agentName':_0x3097ea['name'],'action':_0x37e604(0x1ba),'projectId':_0x57236d,'error':_0x2e1611[_0x37e604(0x1af)],'warnings':_0x1b56fd[_0x37e604(0x189)]>0x0?_0x1b56fd:undefined};}}async[a134_0x1280fc(0x1b9)](_0x39af0f,_0x41565c,_0x1e875e){const _0x347fc7=a134_0x1280fc,_0x890f50=a134_0x4f3caa['existsSync'](_0x39af0f)&&a134_0x4f3caa['existsSync'](a134_0xb4a0ec[_0x347fc7(0x271)](_0x39af0f,_0x347fc7(0x1f8)));let _0x4ebeb8;const _0x9cd1b=[],_0x5db401=[],_0x2cec3b=[],_0x19013c=[],_0x4e691a=[],_0x1a3e3b=[],_0x42c6c2=[],_0x358682=[],_0x52b041=[];if(_0x890f50){const _0x26b076=loadAgentConfig(a134_0xb4a0ec[_0x347fc7(0x271)](_0x39af0f,_0x347fc7(0x1f8)));_0x4ebeb8=_0x26b076[_0x347fc7(0x280)];const _0x45d470=a134_0x4f3caa['readdirSync'](_0x39af0f,{'withFileTypes':!![]});for(const _0x9feb2d of _0x45d470){if(!_0x9feb2d['isDirectory']())continue;if(['knowledge_bases',_0x347fc7(0x283),'experimental_artifacts',_0x347fc7(0x25d),_0x347fc7(0x180),_0x347fc7(0x223),_0x347fc7(0x1c1)]['includes'](_0x9feb2d[_0x347fc7(0x1da)]))continue;const _0x75b221=a134_0xb4a0ec[_0x347fc7(0x271)](_0x39af0f,_0x9feb2d[_0x347fc7(0x1da)]);if(isAgentDir(_0x75b221)){const _0x3d94ad=a134_0xb4a0ec[_0x347fc7(0x271)](_0x75b221,'agent.yml'),_0x50a95c=a134_0xb4a0ec[_0x347fc7(0x271)](_0x75b221,_0x347fc7(0x214)),_0x43a50c=a134_0xb4a0ec[_0x347fc7(0x271)](_0x75b221,_0x347fc7(0x22f)),_0x114c8f=parseAgentYaml(a134_0x4f3caa['readFileSync'](_0x3d94ad,'utf-8'),_0x3d94ad),_0x47f93d=a134_0x4f3caa[_0x347fc7(0x273)](_0x50a95c)?a134_0x4f3caa[_0x347fc7(0x186)](_0x50a95c,'utf-8'):'',_0x498299=a134_0x4f3caa[_0x347fc7(0x273)](_0x43a50c)?a134_0x4f3caa[_0x347fc7(0x186)](_0x43a50c,'utf-8'):_0x114c8f[_0x347fc7(0x1ec)];_0x9cd1b['push']({'name':_0x114c8f['name'],'dir':_0x75b221,'yaml':_0x114c8f,'systemPrompt':_0x47f93d,'starterMessage':_0x498299});}}const _0x19d19b=getKnowledgeBasesDir(_0x39af0f);if(a134_0x4f3caa[_0x347fc7(0x273)](_0x19d19b)){const _0x9b615c=a134_0x4f3caa[_0x347fc7(0x249)](_0x19d19b);for(const _0x595790 of _0x9b615c){const _0x18893b=a134_0xb4a0ec['join'](_0x19d19b,_0x595790);if(_0x595790['endsWith'](_0x347fc7(0x1c7))){const _0x4d1a75=parseKnowledgeBaseYaml(a134_0x4f3caa['readFileSync'](_0x18893b,_0x347fc7(0x1a7)),_0x18893b);_0x5db401['push']({'name':_0x4d1a75[_0x347fc7(0x1da)],'path':_0x18893b,'yaml':_0x4d1a75});}else{if(_0x595790[_0x347fc7(0x1e6)](_0x347fc7(0x1e9))){const _0x5da31f=a134_0x4f3caa['readFileSync'](_0x18893b,'utf-8'),{name:_0x481086,text:_0xe73e23}=parseTextKnowledgeBaseMd(_0x5da31f,_0x595790);_0x2cec3b[_0x347fc7(0x277)]({'name':_0x481086,'path':_0x18893b,'text':_0xe73e23});}}}}const _0x247afe=getPromptsDir(_0x39af0f);if(a134_0x4f3caa['existsSync'](_0x247afe)){const _0x433c79=a134_0x4f3caa[_0x347fc7(0x249)](_0x247afe)[_0x347fc7(0x18a)](_0x54da1b=>_0x54da1b[_0x347fc7(0x1e6)](_0x347fc7(0x1c7)));for(const _0x4b1450 of _0x433c79){const _0xc39a80=a134_0xb4a0ec['join'](_0x247afe,_0x4b1450),_0x202938=parsePromptYaml(a134_0x4f3caa[_0x347fc7(0x186)](_0xc39a80,_0x347fc7(0x1a7)),_0xc39a80);_0x19013c[_0x347fc7(0x277)]({'name':_0x202938[_0x347fc7(0x1da)],'path':_0xc39a80,'yaml':_0x202938});}}const _0x48f6a0=getIntegrationsDir(_0x39af0f);if(a134_0x4f3caa[_0x347fc7(0x273)](_0x48f6a0)){const _0x2ddffb=a134_0x4f3caa[_0x347fc7(0x249)](_0x48f6a0)[_0x347fc7(0x18a)](_0x218eb5=>_0x218eb5['endsWith'](_0x347fc7(0x1c7)));for(const _0x26f5d1 of _0x2ddffb){const _0x5a5838=a134_0xb4a0ec['join'](_0x48f6a0,_0x26f5d1),_0x409c63=parseIntegrationYaml(a134_0x4f3caa['readFileSync'](_0x5a5838,'utf-8'),_0x5a5838);SAFE_INTEGRATION_TYPES[_0x347fc7(0x20c)](_0x409c63[_0x347fc7(0x1b8)][_0x347fc7(0x23b)]())?_0x4e691a[_0x347fc7(0x277)]({'name':_0x409c63[_0x347fc7(0x1da)],'path':_0x5a5838,'yaml':_0x409c63}):this[_0x347fc7(0x1b4)][_0x347fc7(0x1eb)](_0x347fc7(0x209)+_0x409c63[_0x347fc7(0x1da)]+_0x347fc7(0x21d)+_0x409c63[_0x347fc7(0x1b8)]+_0x347fc7(0x1d5)+(_0x347fc7(0x1e0)+SAFE_INTEGRATION_TYPES[_0x347fc7(0x271)](',\x20')+_0x347fc7(0x23d)));}}const _0x35271d=getExperimentalKnowledgeBasesDir(_0x39af0f);if(a134_0x4f3caa[_0x347fc7(0x273)](_0x35271d)){const _0x4187ab=a134_0x4f3caa[_0x347fc7(0x249)](_0x35271d,{'withFileTypes':!![]});for(const _0x4c4ea1 of _0x4187ab){if(!_0x4c4ea1[_0x347fc7(0x27e)]())continue;const _0x480439=a134_0xb4a0ec['join'](_0x35271d,_0x4c4ea1[_0x347fc7(0x1da)]),_0x21caf3=a134_0xb4a0ec[_0x347fc7(0x271)](_0x480439,_0x4c4ea1[_0x347fc7(0x1da)]+_0x347fc7(0x1c7));if(a134_0x4f3caa[_0x347fc7(0x273)](_0x21caf3)){const _0x51334b=parseExperimentalKnowledgeBaseYaml(a134_0x4f3caa[_0x347fc7(0x186)](_0x21caf3,_0x347fc7(0x1a7)),_0x21caf3),_0x1fb73=a134_0xb4a0ec[_0x347fc7(0x271)](_0x480439,'functions'),_0x19806e=[];if(a134_0x4f3caa[_0x347fc7(0x273)](_0x1fb73)){const _0x2a03d3=a134_0x4f3caa[_0x347fc7(0x249)](_0x1fb73,{'withFileTypes':!![]});for(const _0x1509cb of _0x2a03d3){if(!_0x1509cb[_0x347fc7(0x27e)]())continue;const _0x58e583=a134_0xb4a0ec[_0x347fc7(0x271)](_0x1fb73,_0x1509cb['name']),_0x9d8323=a134_0xb4a0ec[_0x347fc7(0x271)](_0x58e583,'code.js'),_0x4fff1e=a134_0xb4a0ec[_0x347fc7(0x271)](_0x58e583,_0x347fc7(0x1c8));if(a134_0x4f3caa[_0x347fc7(0x273)](_0x9d8323)&&a134_0x4f3caa[_0x347fc7(0x273)](_0x4fff1e)){const _0x7a3302=a134_0x4f3caa[_0x347fc7(0x186)](_0x9d8323,_0x347fc7(0x1a7)),_0x4643f6=a134_0x4f3caa[_0x347fc7(0x186)](_0x4fff1e,_0x347fc7(0x1a7));_0x19806e[_0x347fc7(0x277)]({'name':_0x1509cb[_0x347fc7(0x1da)],'code':_0x7a3302,'json_schema':_0x4643f6});}}}const _0x57c463={..._0x51334b,'functions':_0x19806e};_0x1a3e3b[_0x347fc7(0x277)]({'name':_0x51334b[_0x347fc7(0x1da)],'path':_0x480439,'def':_0x57c463});}}}const _0xcd2d54=getExperimentalArtifactsDir(_0x39af0f);if(a134_0x4f3caa[_0x347fc7(0x273)](_0xcd2d54)){const _0xd81fcc=a134_0x4f3caa[_0x347fc7(0x249)](_0xcd2d54,{'withFileTypes':!![]});for(const _0x3eefd9 of _0xd81fcc){if(!_0x3eefd9['isDirectory']())continue;const _0x4fed3b=a134_0xb4a0ec['join'](_0xcd2d54,_0x3eefd9[_0x347fc7(0x1da)]),_0x41d49b=a134_0xb4a0ec['join'](_0x4fed3b,_0x3eefd9['name']+'.yml');if(a134_0x4f3caa[_0x347fc7(0x273)](_0x41d49b)){const _0x4291d2=parseExperimentalArtifactYaml(a134_0x4f3caa[_0x347fc7(0x186)](_0x41d49b,'utf-8'),_0x41d49b),_0x551f8f=a134_0xb4a0ec[_0x347fc7(0x271)](_0x4fed3b,_0x347fc7(0x212)),_0x31676a=a134_0x4f3caa['existsSync'](_0x551f8f)?a134_0x4f3caa[_0x347fc7(0x186)](_0x551f8f,_0x347fc7(0x1a7)):'',_0x821505=a134_0xb4a0ec[_0x347fc7(0x271)](_0x4fed3b,'files'),_0x459076=[];if(a134_0x4f3caa[_0x347fc7(0x273)](_0x821505)){const _0x38f092=a134_0x4f3caa[_0x347fc7(0x249)](_0x821505);for(const _0x49eefe of _0x38f092){const _0x35ba8a=a134_0xb4a0ec['join'](_0x821505,_0x49eefe);if(a134_0x4f3caa[_0x347fc7(0x268)](_0x35ba8a)[_0x347fc7(0x205)]()){const _0x25e1b0=a134_0x4f3caa[_0x347fc7(0x186)](_0x35ba8a,_0x347fc7(0x1a7));_0x459076[_0x347fc7(0x277)]({'file_name':_0x49eefe,'text_content':_0x25e1b0});}}}const _0x26a6e1={..._0x4291d2,'code':_0x31676a,'files':_0x459076};_0x42c6c2[_0x347fc7(0x277)]({'name':_0x4291d2[_0x347fc7(0x1da)],'path':_0x4fed3b,'def':_0x26a6e1});}}}const _0x4f17ca=getFormInterfacesDir(_0x39af0f);if(a134_0x4f3caa[_0x347fc7(0x273)](_0x4f17ca)){const _0x8ea91c=a134_0x4f3caa[_0x347fc7(0x249)](_0x4f17ca)[_0x347fc7(0x18a)](_0x1fc08f=>_0x1fc08f[_0x347fc7(0x1e6)](_0x347fc7(0x1c7)));for(const _0x296a79 of _0x8ea91c){const _0xaa7362=a134_0xb4a0ec[_0x347fc7(0x271)](_0x4f17ca,_0x296a79),_0x4dca4c=parseFormInterfaceYaml(a134_0x4f3caa[_0x347fc7(0x186)](_0xaa7362,'utf-8'),_0xaa7362);_0x358682[_0x347fc7(0x277)]({'name':_0x4dca4c[_0x347fc7(0x1da)],'path':_0xaa7362,'yaml':_0x4dca4c});}}const _0x15ad82=getChatInterfacesDir(_0x39af0f);if(a134_0x4f3caa['existsSync'](_0x15ad82)){const _0x44fbc9=a134_0x4f3caa[_0x347fc7(0x249)](_0x15ad82)['filter'](_0x18001c=>_0x18001c[_0x347fc7(0x1e6)](_0x347fc7(0x1c7)));for(const _0x5e8f62 of _0x44fbc9){const _0x3ae5e2=a134_0xb4a0ec[_0x347fc7(0x271)](_0x15ad82,_0x5e8f62),_0x15dff0=parseChatInterfaceYaml(a134_0x4f3caa[_0x347fc7(0x186)](_0x3ae5e2,'utf-8'),_0x3ae5e2);_0x52b041['push']({'name':_0x15dff0['name'],'path':_0x3ae5e2,'yaml':_0x15dff0});}}}else{const _0x5c4a0c=await this[_0x347fc7(0x1ea)](_0x39af0f),_0x53179a=await this['client'][_0x347fc7(0x1f0)](_0x5c4a0c);_0x4ebeb8=_0x53179a['attributes'][_0x347fc7(0x1da)];const _0x4359dc=await this[_0x347fc7(0x203)]['listAgentsFull'](_0x5c4a0c),_0x4f32ab=await this[_0x347fc7(0x203)][_0x347fc7(0x247)](_0x5c4a0c),_0xfebee6=await this[_0x347fc7(0x203)][_0x347fc7(0x190)](_0x5c4a0c),_0xd188aa=await this[_0x347fc7(0x203)][_0x347fc7(0x18b)](_0x5c4a0c),_0x242099=await this[_0x347fc7(0x203)][_0x347fc7(0x1db)](_0x5c4a0c),_0x5cd944=await safeListOrEmpty(()=>this[_0x347fc7(0x203)]['listExperimentalKnowledgeBases'](_0x5c4a0c)),_0x4c5c4c=await safeListOrEmpty(()=>this['client']['listExperimentalArtifacts'](_0x5c4a0c)),_0x188ea2=new Map(),_0xe21d3=new Map(),_0x229bba=new Map(),_0x50b9c1=new Map(),_0x463b64=new Map(),_0x135855=new Map();for(const _0x5a07df of _0x4f32ab){_0x188ea2['set'](_0x5a07df['id'],_0x5a07df[_0x347fc7(0x193)]['name']);}for(const _0x420476 of _0xfebee6){_0xe21d3[_0x347fc7(0x26f)](_0x420476['id'],_0x420476[_0x347fc7(0x193)]['name']);}for(const _0x324f91 of _0x4359dc){_0x229bba[_0x347fc7(0x26f)](_0x324f91['id'],_0x324f91[_0x347fc7(0x193)][_0x347fc7(0x1da)]);}for(const _0x4a4f6b of _0xd188aa){_0x50b9c1[_0x347fc7(0x26f)](_0x4a4f6b['id'],_0x4a4f6b[_0x347fc7(0x193)][_0x347fc7(0x1da)]);}for(const _0x3043c8 of _0x5cd944){_0x463b64[_0x347fc7(0x26f)](_0x3043c8['id'],_0x3043c8['attributes']['name']);}for(const _0x3dbc68 of _0x4c5c4c){_0x135855[_0x347fc7(0x26f)](_0x3dbc68['id'],_0x3dbc68['attributes'][_0x347fc7(0x1da)]);}const _0x2854d3={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x188ea2,'TextKnowledgeBase':_0xe21d3,'Agent':_0x229bba,'ExperimentalKnowledgeBase':_0x463b64}),'resolvePromptName':async _0x3fb5c6=>_0x50b9c1[_0x347fc7(0x1c0)](_0x3fb5c6),'onWarning':_0x5e8bdd=>this[_0x347fc7(0x1b4)][_0x347fc7(0x1eb)](_0x5e8bdd)};for(const _0x625917 of _0x4359dc){const _0x43c0e7=await agentResponseToDef(_0x625917,_0x2854d3),{yaml:_0x261161,systemPrompt:_0x1956c9,starterMessage:_0x3853c1}=_0x43c0e7;_0x9cd1b['push']({'name':_0x261161[_0x347fc7(0x1da)],'dir':'','yaml':_0x261161,'systemPrompt':_0x1956c9,'starterMessage':_0x3853c1});}for(const _0x3ebdba of _0x4f32ab){const _0x535d41=apiKnowledgeBaseToYaml(_0x3ebdba);_0x5db401[_0x347fc7(0x277)]({'name':_0x535d41[_0x347fc7(0x1da)],'path':'','yaml':_0x535d41});}for(const _0x54c450 of _0xfebee6){_0x2cec3b[_0x347fc7(0x277)]({'name':_0x54c450[_0x347fc7(0x193)][_0x347fc7(0x1da)],'path':'','text':_0x54c450['attributes'][_0x347fc7(0x230)]});}for(const _0x12f5e8 of _0xd188aa){const _0x38aef1=await apiPromptToYaml(_0x12f5e8,_0x2854d3);_0x38aef1&&_0x19013c[_0x347fc7(0x277)]({'name':_0x38aef1[_0x347fc7(0x1da)],'path':'','yaml':_0x38aef1});}for(const _0x387f51 of _0x242099){if(!_0x387f51[_0x347fc7(0x193)][_0x347fc7(0x1c4)]&&SAFE_INTEGRATION_TYPES['includes'](_0x387f51[_0x347fc7(0x193)][_0x347fc7(0x28f)][_0x347fc7(0x23b)]())){const _0x16ee09=await apiIntegrationToYaml(_0x387f51,_0x2854d3);_0x4e691a['push']({'name':_0x387f51[_0x347fc7(0x193)][_0x347fc7(0x28f)][_0x347fc7(0x23b)](),'path':'','yaml':_0x16ee09});}}for(const _0x3f05af of _0x5cd944){const _0x5b32b7=apiExperimentalKnowledgeBaseToYaml(_0x3f05af);_0x1a3e3b['push']({'name':_0x5b32b7[_0x347fc7(0x1da)],'path':'','def':_0x5b32b7});}for(const _0xf7c544 of _0x4c5c4c){const _0x350e4c=apiExperimentalArtifactToYaml(_0xf7c544);_0x42c6c2[_0x347fc7(0x277)]({'name':_0x350e4c[_0x347fc7(0x1da)],'path':'','def':_0x350e4c});}const _0x365c37=await safeListOrEmpty(()=>this[_0x347fc7(0x203)][_0x347fc7(0x22a)](_0x5c4a0c));for(const _0x292711 of _0x365c37){const _0x5daace=await apiFormInterfaceToYaml(_0x292711,_0x2854d3);_0x358682[_0x347fc7(0x277)]({'name':_0x5daace[_0x347fc7(0x1da)],'path':'','yaml':_0x5daace});}const _0x509c19=await safeListOrEmpty(()=>this[_0x347fc7(0x203)][_0x347fc7(0x1bb)](_0x5c4a0c));for(const _0x35ba40 of _0x509c19){if(_0x35ba40['attributes']['isManaged'])continue;const _0x6326d2=await apiChatInterfaceToYaml(_0x35ba40,_0x2854d3);_0x52b041[_0x347fc7(0x277)]({'name':_0x6326d2[_0x347fc7(0x1da)],'path':'','yaml':_0x6326d2});}}const _0x8b72ab={'sourceProjectName':_0x4ebeb8,'newProjectName':_0x41565c,'newProjectId':'','agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'imageGenerators':[],'webSearchTools':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'formInterfaces':[],'chatInterfaces':[],'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},'formInterfaces':{'created':0x0,'errors':0x0},'chatInterfaces':{'created':0x0,'errors':0x0}}},_0x130ea1=await this['client'][_0x347fc7(0x1b2)](),_0x55df98=_0x130ea1[_0x347fc7(0x1ef)](_0x26cfd3=>_0x26cfd3[_0x347fc7(0x193)]['name']===_0x41565c);if(_0x55df98)throw new SDKError(ErrorCode[_0x347fc7(0x250)],_0x347fc7(0x1d3)+_0x41565c+'\x22\x20already\x20exists',undefined,{'helpText':'Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.'});if(_0x1e875e?.[_0x347fc7(0x248)])return _0x8b72ab['counts']['agents'][_0x347fc7(0x27b)]=_0x9cd1b[_0x347fc7(0x189)],_0x8b72ab['counts']['knowledgeBases'][_0x347fc7(0x27b)]=_0x5db401['length'],_0x8b72ab[_0x347fc7(0x1f6)]['textKnowledgeBases']['created']=_0x2cec3b[_0x347fc7(0x189)],_0x8b72ab[_0x347fc7(0x1f6)]['experimentalKnowledgeBases'][_0x347fc7(0x27b)]=_0x1a3e3b[_0x347fc7(0x189)],_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x20a)][_0x347fc7(0x27b)]=_0x42c6c2[_0x347fc7(0x189)],_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x25d)]['created']=_0x19013c[_0x347fc7(0x189)],_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x180)][_0x347fc7(0x27b)]=_0x4e691a['length'],_0x8b72ab;const _0x776bc4=await this[_0x347fc7(0x203)][_0x347fc7(0x1f7)]({'name':_0x41565c}),_0x49ac2a=_0x776bc4['id'];_0x8b72ab[_0x347fc7(0x1a6)]=_0x49ac2a;const _0x3aabec=new Map(),_0x1fe7b8=new Map(),_0x1bad79=new Map(),_0x12b430=new Map(),_0x1b9391=new Map(),_0x1c9acc=new Map(),_0x3faaf5=new Map(),_0x62f5c7=new Map(),_0x5af7ec=new Set(),_0x139e67=new Set();for(const _0x5aa219 of _0x9cd1b){for(const _0x574313 of _0x5aa219['yaml'][_0x347fc7(0x17e)]||[]){if(_0x574313[_0x347fc7(0x216)]===_0x347fc7(0x225)&&_0x574313[_0x347fc7(0x1d7)]){const _0x211020=parseRef(_0x574313[_0x347fc7(0x1d7)]);if(_0x211020)_0x5af7ec[_0x347fc7(0x246)](_0x211020[_0x347fc7(0x1da)]);}else{if(_0x574313[_0x347fc7(0x216)]===_0x347fc7(0x19f)&&_0x574313['target']){const _0x378066=parseRef(_0x574313[_0x347fc7(0x1d7)]);if(_0x378066)_0x139e67[_0x347fc7(0x246)](_0x378066[_0x347fc7(0x1da)]);}}}}for(const _0x5dcd6c of _0x5af7ec){try{const _0x5c7e26=await this[_0x347fc7(0x203)][_0x347fc7(0x269)]({'projectId':_0x49ac2a,'name':_0x5dcd6c});_0x1b9391[_0x347fc7(0x26f)](_0x5dcd6c,_0x5c7e26['id']),_0x8b72ab[_0x347fc7(0x245)][_0x347fc7(0x277)]({'name':_0x5dcd6c,'action':_0x347fc7(0x27b),'id':_0x5c7e26['id']}),_0x8b72ab[_0x347fc7(0x1f6)]['imageGenerators'][_0x347fc7(0x27b)]++;}catch(_0xfd41d7){_0x8b72ab['imageGenerators'][_0x347fc7(0x277)]({'name':_0x5dcd6c,'action':_0x347fc7(0x1ba),'error':_0xfd41d7[_0x347fc7(0x1af)]}),_0x8b72ab[_0x347fc7(0x1f6)]['imageGenerators'][_0x347fc7(0x1a5)]++;}}for(const _0x2c8a9f of _0x139e67){try{const _0x14d8d8=await this[_0x347fc7(0x203)][_0x347fc7(0x238)]({'projectId':_0x49ac2a,'name':_0x2c8a9f});_0x1c9acc[_0x347fc7(0x26f)](_0x2c8a9f,_0x14d8d8['id']),_0x8b72ab[_0x347fc7(0x220)][_0x347fc7(0x277)]({'name':_0x2c8a9f,'action':_0x347fc7(0x27b),'id':_0x14d8d8['id']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x220)][_0x347fc7(0x27b)]++;}catch(_0x3a3c52){_0x8b72ab[_0x347fc7(0x220)][_0x347fc7(0x277)]({'name':_0x2c8a9f,'action':_0x347fc7(0x1ba),'error':_0x3a3c52[_0x347fc7(0x1af)]}),_0x8b72ab['counts'][_0x347fc7(0x220)][_0x347fc7(0x1a5)]++;}}const _0x113577=await fetchAllToolTargetMaps((_0xa56550,_0x15827a)=>this[_0x347fc7(0x203)][_0x347fc7(0x24c)](_0xa56550,_0x15827a),_0x49ac2a);let _0x373869=[];const _0x4d31ba={'projectId':_0x49ac2a,'resolveToolTargetId':buildIdResolver({..._0x113577[_0x347fc7(0x288)],'KnowledgeBase':_0x3aabec,'TextKnowledgeBase':_0x1fe7b8,'ExperimentalKnowledgeBase':_0x3faaf5,'Agent':_0x1bad79,'WebSearchTool':_0x1c9acc,'ImageGenerator':_0x1b9391}),'resolvePromptId':async _0x8b3c2=>_0x12b430[_0x347fc7(0x1c0)](_0x8b3c2),'onWarning':_0x2e8078=>{const _0x536451=_0x347fc7;this[_0x536451(0x1b4)]['warn'](_0x2e8078),_0x373869[_0x536451(0x277)](_0x2e8078);}};for(const _0x23aa9c of _0x5db401){try{const _0x4a43a4=yamlKnowledgeBaseToApi(_0x23aa9c['yaml'],_0x49ac2a),_0x586cce=await this[_0x347fc7(0x203)][_0x347fc7(0x264)](_0x4a43a4);_0x3aabec[_0x347fc7(0x26f)](_0x23aa9c['yaml'][_0x347fc7(0x1da)],_0x586cce['id']),_0x8b72ab[_0x347fc7(0x1e5)][_0x347fc7(0x277)]({'name':_0x23aa9c['yaml'][_0x347fc7(0x1da)],'action':_0x347fc7(0x27b),'id':_0x586cce['id']}),_0x8b72ab['counts'][_0x347fc7(0x1e5)][_0x347fc7(0x27b)]++;}catch(_0x193660){_0x8b72ab[_0x347fc7(0x1e5)][_0x347fc7(0x277)]({'name':_0x23aa9c[_0x347fc7(0x28b)][_0x347fc7(0x1da)],'action':_0x347fc7(0x1ba),'error':_0x193660[_0x347fc7(0x1af)]}),_0x8b72ab['counts'][_0x347fc7(0x1e5)][_0x347fc7(0x1a5)]++;}}for(const _0x45474d of _0x2cec3b){try{const _0x342891=yamlTextKnowledgeBaseToApi({'name':_0x45474d[_0x347fc7(0x1da)],'text':_0x45474d[_0x347fc7(0x230)]},_0x49ac2a),_0x1ee9b9=await this[_0x347fc7(0x203)][_0x347fc7(0x1b0)](_0x342891);_0x1fe7b8[_0x347fc7(0x26f)](_0x45474d[_0x347fc7(0x1da)],_0x1ee9b9['id']),_0x8b72ab[_0x347fc7(0x25f)]['push']({'name':_0x45474d[_0x347fc7(0x1da)],'action':_0x347fc7(0x27b),'id':_0x1ee9b9['id']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x25f)][_0x347fc7(0x27b)]++;}catch(_0x4c4168){_0x8b72ab[_0x347fc7(0x25f)][_0x347fc7(0x277)]({'name':_0x45474d[_0x347fc7(0x1da)],'action':_0x347fc7(0x1ba),'error':_0x4c4168['message']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x25f)][_0x347fc7(0x1a5)]++;}}for(const _0x2e86c9 of _0x42c6c2){try{const _0x18feea=yamlExperimentalArtifactToApi(_0x2e86c9[_0x347fc7(0x290)],_0x49ac2a),_0x51c1de=await this[_0x347fc7(0x203)][_0x347fc7(0x21b)](_0x18feea);_0x62f5c7[_0x347fc7(0x26f)](_0x2e86c9[_0x347fc7(0x290)][_0x347fc7(0x1da)],_0x51c1de['id']),_0x8b72ab[_0x347fc7(0x20a)]['push']({'name':_0x2e86c9['def'][_0x347fc7(0x1da)],'action':_0x347fc7(0x27b),'id':_0x51c1de['id']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x20a)][_0x347fc7(0x27b)]++;}catch(_0x242e15){_0x8b72ab[_0x347fc7(0x20a)][_0x347fc7(0x277)]({'name':_0x2e86c9[_0x347fc7(0x290)]['name'],'action':_0x347fc7(0x1ba),'error':_0x242e15['message']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x20a)]['errors']++;}}for(const _0x276859 of _0x1a3e3b){try{const _0x27bacf=yamlExperimentalKnowledgeBaseToApi(_0x276859[_0x347fc7(0x290)],_0x49ac2a),_0x1e0f82=await this[_0x347fc7(0x203)]['createExperimentalKnowledgeBase'](_0x27bacf);_0x3faaf5[_0x347fc7(0x26f)](_0x276859[_0x347fc7(0x290)][_0x347fc7(0x1da)],_0x1e0f82['id']),_0x8b72ab[_0x347fc7(0x1cb)][_0x347fc7(0x277)]({'name':_0x276859[_0x347fc7(0x290)][_0x347fc7(0x1da)],'action':'created','id':_0x1e0f82['id']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x1cb)][_0x347fc7(0x27b)]++;}catch(_0x52b5f8){_0x8b72ab[_0x347fc7(0x1cb)][_0x347fc7(0x277)]({'name':_0x276859['def'][_0x347fc7(0x1da)],'action':'error','error':_0x52b5f8['message']}),_0x8b72ab['counts'][_0x347fc7(0x1cb)][_0x347fc7(0x1a5)]++;}}const _0x4a37cb=[..._0x9cd1b][_0x347fc7(0x23e)]((_0x5cde3e,_0x36fa2b)=>{const _0x10ced8=_0x347fc7,_0x5bc9e6=_0x5cde3e[_0x10ced8(0x28b)]['tools']?.['some'](_0x1f73a6=>_0x1f73a6['type']===_0x10ced8(0x1b7))??![],_0x1430bb=_0x36fa2b[_0x10ced8(0x28b)][_0x10ced8(0x17e)]?.[_0x10ced8(0x258)](_0x54281b=>_0x54281b['type']==='agent')??![];if(_0x5bc9e6&&!_0x1430bb)return 0x1;if(!_0x5bc9e6&&_0x1430bb)return-0x1;return 0x0;});for(const _0x201f07 of _0x4a37cb){_0x373869=[];try{const _0x461af6=_0x201f07[_0x347fc7(0x28b)]['tools']?.[_0x347fc7(0x18a)](_0x40b059=>{const _0x24b7d8=_0x347fc7;if(_0x40b059[_0x24b7d8(0x216)]==='agent'&&_0x40b059[_0x24b7d8(0x1d7)]){const _0x335e4c=parseRef(_0x40b059[_0x24b7d8(0x1d7)]);return _0x335e4c?.['name']===_0x201f07[_0x24b7d8(0x28b)][_0x24b7d8(0x1da)];}return![];})??[];if(_0x461af6[_0x347fc7(0x189)]>0x0){const _0x2367e5=_0x347fc7(0x25b)+_0x201f07[_0x347fc7(0x28b)][_0x347fc7(0x1da)]+_0x347fc7(0x1b3)+'Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.';this[_0x347fc7(0x1b4)][_0x347fc7(0x1eb)](_0x2367e5),_0x373869[_0x347fc7(0x277)](_0x2367e5);}const _0x1842dc=await agentDefToRequest(_0x201f07['yaml'],_0x201f07['systemPrompt'],_0x201f07[_0x347fc7(0x1d0)],_0x4d31ba),_0x3740b2=await this[_0x347fc7(0x203)][_0x347fc7(0x1d1)](_0x1842dc);_0x1bad79['set'](_0x201f07['yaml'][_0x347fc7(0x1da)],_0x3740b2['id']),_0x8b72ab['agents'][_0x347fc7(0x277)]({'agentName':_0x201f07[_0x347fc7(0x28b)]['name'],'action':_0x347fc7(0x27b),'agentId':_0x3740b2['id'],'warnings':_0x373869[_0x347fc7(0x189)]>0x0?_0x373869:undefined}),_0x8b72ab[_0x347fc7(0x1f6)]['agents']['created']++;}catch(_0x4869b8){_0x8b72ab[_0x347fc7(0x1bc)][_0x347fc7(0x277)]({'agentName':_0x201f07['yaml'][_0x347fc7(0x1da)],'action':_0x347fc7(0x1ba),'error':_0x4869b8[_0x347fc7(0x1af)],'warnings':_0x373869['length']>0x0?_0x373869:undefined}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x1bc)][_0x347fc7(0x1a5)]++;}}for(const _0x3adfd0 of _0x19013c){try{const _0x33cafe=await yamlPromptToApi(_0x3adfd0[_0x347fc7(0x28b)],_0x49ac2a,_0x4d31ba);if(!_0x33cafe){_0x8b72ab[_0x347fc7(0x25d)][_0x347fc7(0x277)]({'name':_0x3adfd0[_0x347fc7(0x28b)]['name'],'action':'error','error':'Agent\x20reference\x20not\x20found'}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x25d)][_0x347fc7(0x1a5)]++;continue;}const _0x522e97=await this['client'][_0x347fc7(0x256)](_0x33cafe);_0x12b430[_0x347fc7(0x26f)](_0x3adfd0[_0x347fc7(0x28b)][_0x347fc7(0x1da)],_0x522e97['id']),_0x8b72ab[_0x347fc7(0x25d)][_0x347fc7(0x277)]({'name':_0x3adfd0[_0x347fc7(0x28b)][_0x347fc7(0x1da)],'action':_0x347fc7(0x27b),'id':_0x522e97['id']}),_0x8b72ab['counts'][_0x347fc7(0x25d)][_0x347fc7(0x27b)]++;}catch(_0x1f3508){_0x8b72ab[_0x347fc7(0x25d)][_0x347fc7(0x277)]({'name':_0x3adfd0[_0x347fc7(0x28b)][_0x347fc7(0x1da)],'action':_0x347fc7(0x1ba),'error':_0x1f3508[_0x347fc7(0x1af)]}),_0x8b72ab['counts'][_0x347fc7(0x25d)]['errors']++;}}for(const _0x54e76d of _0x4e691a){try{const _0x4390a3=await yamlIntegrationToApi(_0x54e76d[_0x347fc7(0x28b)],_0x49ac2a,_0x4d31ba),_0xd69e1f=await this[_0x347fc7(0x203)][_0x347fc7(0x1a9)](_0x4390a3);_0x8b72ab[_0x347fc7(0x180)]['push']({'name':_0x54e76d[_0x347fc7(0x28b)]['service_type'],'action':_0x347fc7(0x27b),'id':_0xd69e1f['id']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x180)][_0x347fc7(0x27b)]++;}catch(_0x3b7983){_0x8b72ab[_0x347fc7(0x180)][_0x347fc7(0x277)]({'name':_0x54e76d[_0x347fc7(0x28b)]['service_type'],'action':_0x347fc7(0x1ba),'error':_0x3b7983[_0x347fc7(0x1af)]}),_0x8b72ab[_0x347fc7(0x1f6)]['integrations']['errors']++;}}for(const _0x17a24d of _0x358682){try{const _0x2d886b=await yamlFormInterfaceToApi(_0x17a24d[_0x347fc7(0x28b)],_0x49ac2a,_0x4d31ba);if(!_0x2d886b){_0x8b72ab[_0x347fc7(0x194)][_0x347fc7(0x277)]({'name':_0x17a24d[_0x347fc7(0x28b)][_0x347fc7(0x1da)],'action':_0x347fc7(0x1ba),'error':_0x347fc7(0x26c)}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x194)][_0x347fc7(0x1a5)]++;continue;}const _0x7404d8=await this['client'][_0x347fc7(0x1a3)](_0x2d886b);_0x8b72ab[_0x347fc7(0x194)][_0x347fc7(0x277)]({'name':_0x17a24d[_0x347fc7(0x28b)][_0x347fc7(0x1da)],'action':_0x347fc7(0x27b),'id':_0x7404d8['id']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x194)][_0x347fc7(0x27b)]++;}catch(_0x13cbdb){_0x8b72ab[_0x347fc7(0x194)][_0x347fc7(0x277)]({'name':_0x17a24d[_0x347fc7(0x28b)][_0x347fc7(0x1da)],'action':'error','error':_0x13cbdb['message']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x194)][_0x347fc7(0x1a5)]++;}}for(const _0x3a2357 of _0x52b041){try{const _0x17f7d6=await yamlChatInterfaceToApi(_0x3a2357['yaml'],_0x49ac2a,_0x4d31ba),_0x21ee0d=await this['client']['createChatInterface'](_0x17f7d6);_0x8b72ab[_0x347fc7(0x266)][_0x347fc7(0x277)]({'name':_0x3a2357[_0x347fc7(0x28b)]['name'],'action':_0x347fc7(0x27b),'id':_0x21ee0d['id']}),_0x8b72ab[_0x347fc7(0x1f6)][_0x347fc7(0x266)]['created']++;}catch(_0x3fd4a7){_0x8b72ab[_0x347fc7(0x266)]['push']({'name':_0x3a2357['yaml'][_0x347fc7(0x1da)],'action':_0x347fc7(0x1ba),'error':_0x3fd4a7['message']}),_0x8b72ab['counts'][_0x347fc7(0x266)][_0x347fc7(0x1a5)]++;}}return _0x8b72ab;}}
|