@treasuredata/tdx 2026.3.20 → 2026.3.21
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.d.ts +33 -0
- package/dist/commands/policy-command.d.ts.map +1 -0
- package/dist/commands/policy-command.js +1 -0
- package/dist/commands/policy-command.js.map +1 -0
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.d.ts +41 -0
- package/dist/sdk/policy.d.ts.map +1 -0
- package/dist/sdk/policy.js +1 -0
- package/dist/sdk/policy.js.map +1 -0
- 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.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/policy.d.ts +58 -0
- package/dist/sdk/types/policy.d.ts.map +1 -0
- package/dist/sdk/types/policy.js +1 -0
- package/dist/sdk/types/policy.js.map +1 -0
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/llm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a122_0x29cadd=a122_0xbc78;(function(_0x46b613,_0x1b1eab){const _0x58c959=a122_0xbc78,_0xde3f0e=_0x46b613();while(!![]){try{const _0x5e09fc=parseInt(_0x58c959(0x1ad))/0x1+parseInt(_0x58c959(0x183))/0x2+-parseInt(_0x58c959(0xdb))/0x3*(-parseInt(_0x58c959(0xe7))/0x4)+parseInt(_0x58c959(0x181))/0x5+parseInt(_0x58c959(0x1a1))/0x6*(parseInt(_0x58c959(0x1bc))/0x7)+-parseInt(_0x58c959(0x119))/0x8+parseInt(_0x58c959(0xdd))/0x9*(-parseInt(_0x58c959(0xcb))/0xa);if(_0x5e09fc===_0x1b1eab)break;else _0xde3f0e['push'](_0xde3f0e['shift']());}catch(_0x251260){_0xde3f0e['push'](_0xde3f0e['shift']());}}}(a122_0x535c,0xd40fa));import{LLMApiClient}from'../client/llm-api-client.js';import*as a122_0x1debea from'node:fs';function a122_0xbc78(_0x25cb77,_0x478d3b){_0x25cb77=_0x25cb77-0xbf;const _0x535c87=a122_0x535c();let _0xbc78aa=_0x535c87[_0x25cb77];return _0xbc78aa;}import*as a122_0x52c3ab from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{SDKError,ErrorCode,errorContains}from'../errors.js';import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir}from'../agent/agent-config.js';import{getSanitizedUsername,generateRandomHex}from'../../utils/string-utils.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a122_0x535c(){const _0x2bf0e8=['nameToId','chatId','medium','\x0a---\x20code\x20---\x0a','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','getBackupMetadata','mkdirSync','listKnowledgeBases','_reasoning_','profile','getChatLog','service_type','version','low','listImageGenerators','description','get','UNAUTHENTICATED','resolveAgentId','tables','continueChat','updateTextKnowledgeBase','isManaged','getDefaultProjectName','---\x20file:\x20','#\x20prompt.md\x0a','localeCompare','chat','deleteIntegration','displayName','Renamed\x20experimental\x20artifact\x20directory:\x20','includes','updateExperimentalKnowledgeBase','knowledgebases.json','prompts.json','outputs','high','LLM_PROJECT_NOT_FOUND','Renamed\x20experimental\x20KB\x20directory:\x20','Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.','\x20attempts\x20due\x20to\x20name\x20conflicts.','integrations.json','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Agent\x20not\x20found:\x20','.md','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','\x0a\x0a#\x20agent.yml\x0a','readFileSync','getUserSettings','\x22\x20already\x20exists','minimal','maxToolIterations','chats','tdx_default_','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','yaml','find','parse','resolveProjectId','project.json','tdx_','counts','Renamed\x20integration\x20file:\x20','(dry-run)','createAgent','serviceType','listWebSearchTools','1443665sCTGHX','listExperimentalKnowledgeBases','2473434PDnEsQ','join','cwd','projects','writeFileSync','experimental_artifacts','filter','getChatHistory','toISOString','functions','createAgentResponse','client','project','updatePrompt','endsWith','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','agents','.yml','split','pushAgent','already\x20exists','pullAgent','conflict','):\x20','loadJsonFile','promptId','chat_agent_console','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','pushProject','1016742qmpEju','code','dryRun','\x0a---\x20function:\x20','content','listExperimentalArtifacts','ALREADY_EXISTS','Unresolved\x20dependencies:\x20','agents.json','isDir','knowledge_bases','Project\x20not\x20found:\x20','681647hhJJqB','deleteAgent','experimentalKnowledgeBases',')\x20can\x20be\x20cloned.','\x20---\x0a','map','oldPath','keys','dirname','Multiple\x20projects\x20found\x20with\x20name\x20\x27','createPrompt','\x27.\x20This\x20should\x20not\x20happen.','utf-8','none','duplicate','7AsjrUh','target','chat_parent_segment','experimental_knowledge_bases','listTextKnowledgeBases','createProject','No\x20tdx.json\x20found\x20in\x20','json_schema.json','exportedFrom','tools','size','warn','starterMessage','web_search','Renamed\x20KB\x20file:\x20','status','startChat','clearDefaultAgent','\x20→\x20','existsSync','createIntegration','unchanged','reasoningEffort','availableModelNames','basename','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','---\x20schema:\x20','listChats','\x0a---\x20schema:\x20','prompt.md','Agent\x20\x27','updated','dry-run-','llm_project','NOT_FOUND','starter_message','imageGenerators','sdk.llm','knowledgeBases','updateAgent','text','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','webSearchTools','code.js','resolveProjectName','.llm','files','agent','push','chatIgnoreManagedActions','3079310xGtvSL','getOrCreateDefaultAgent','variables','listPrompts','tdx.json','listAgents','created','path','Removed\x20deleted\x20directory:\x20','errors','template','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','getProject','Renamed\x20folder:\x20','listIntegrations','\x27\x20(','24fSHeeR','starter_message.md','63TmJMHt','1.0','unlinkSync','agent.yml','Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.','backupProject','setDefaultAgent','rmSync','createKnowledgeBase','add','451556yndwkS','createExperimentalKnowledgeBase','Output\x20directory\x20already\x20exists:\x20','isDirectory','sort','getOrCreateDefaultProject','signal','readdirSync','AGENT_NOT_FOUND','updateAgentResponse','json_schema','length','getAgent','total','action','\x20in\x20project\x20','context','PERMISSION_DENIED','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','listToolTargets','systemPrompt','text_content','chat_generic','renamed','info','setCurrentProject','Invalid\x20agent\x20reference\x20format:\x20','toLowerCase','listAgentsFull','projectName','Available\x20agents:\x20','availableModels','set','experimentalArtifacts','Backup\x20folder\x20not\x20found:\x20','getCurrentProject','newProjectId','name','file_name','Use\x20\x22tdx\x20llm\x20use\x20<project>\x22\x20to\x20set\x20a\x20project\x20context\x20first,\x20or\x20use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20all\x20agents.','INTERNAL','createExperimentalArtifact','createTextKnowledgeBase','has','message','logger','agentsFull','def','modelType','error','2044376fFybAc','slackMessageMode','webhookCorsOrigins','Renamed\x20text\x20KB\x20file:\x20','attributes','Only\x20safe\x20types\x20(','statSync','Agent\x20reference\x20not\x20found','history','prompts','Renamed\x20agent\x20folder:\x20','Unsupported\x20backup\x20version:\x20','image_gen','type','metadata','textKnowledgeBases','INVALID_ARGUMENT','KnowledgeBase','tdDatabaseName','isFile','currentProjectId','Multiple\x20agents\x20found\x20with\x20name\x20\x27','some','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.',')\x20can\x20be\x20pushed.\x20','new','stringify','listProjects','pullProject','restoreProject','agentId','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','idToName','integrations','Project\x20\x22','dir','site'];a122_0x535c=function(){return _0x2bf0e8;};return a122_0x535c();}import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';export const SAFE_INTEGRATION_TYPES=[a122_0x29cadd(0xfd),a122_0x29cadd(0x19d),a122_0x29cadd(0x1be)];async function safeListOrEmpty(_0x1bbf5d){const _0x425cf6=a122_0x29cadd;try{return await _0x1bbf5d();}catch(_0x40a276){if(_0x40a276 instanceof HTTPClientError&&_0x40a276[_0x425cf6(0x1cb)]===0x194)return[];throw _0x40a276;}}export class LLMSDK{[a122_0x29cadd(0x12d)];[a122_0x29cadd(0x18e)];[a122_0x29cadd(0xf7)];[a122_0x29cadd(0x114)]=Logger['of'](a122_0x29cadd(0x1e1));constructor(_0x14c319){const _0x2fd0c3=a122_0x29cadd;this['client']=new LLMApiClient(_0x14c319),this[_0x2fd0c3(0xf7)]=_0x14c319;}[a122_0x29cadd(0x155)](){const _0x16e290=a122_0x29cadd,_0x362c18=getSanitizedUsername();return _0x16e290(0x173)+_0x362c18;}async[a122_0x29cadd(0x100)](_0x13d02d){const _0x14bdf8=a122_0x29cadd,{projectId:_0x3f60be}=await this[_0x14bdf8(0xc5)](_0x13d02d);this[_0x14bdf8(0x12d)]=_0x3f60be;}[a122_0x29cadd(0x10a)](){const _0x4cbb0e=a122_0x29cadd;return this[_0x4cbb0e(0x12d)];}async[a122_0x29cadd(0xe3)](_0x3a5c92){const _0x1b93f1=a122_0x29cadd,_0x1e93b9=this[_0x1b93f1(0xf7)][_0x1b93f1(0x147)];let _0xa41fa4,_0xe26b5b;if(_0x3a5c92[_0x1b93f1(0x15d)]('/')){const _0x1f4f06=_0x3a5c92[_0x1b93f1(0x195)]('/');if(_0x1f4f06[_0x1b93f1(0xf2)]!==0x2)throw new SDKError(ErrorCode[_0x1b93f1(0x129)],_0x1b93f1(0x101)+_0x3a5c92,undefined,{'helpText':_0x1b93f1(0x19e)});const [_0x1ba9b1,_0x21a111]=_0x1f4f06;_0xa41fa4=await this[_0x1b93f1(0x178)](_0x1ba9b1),_0xe26b5b=_0x21a111;}else _0xa41fa4=this[_0x1b93f1(0x12d)]||(await this[_0x1b93f1(0xec)]())['id'],_0xe26b5b=_0x3a5c92;const _0x1a321b=await this[_0x1b93f1(0x150)](_0xe26b5b,_0xa41fa4),_0x4a2a9c=await this['client']['getAgent'](_0x1a321b);writeCachedLLMAgent(_0x4a2a9c[_0x1b93f1(0x11d)][_0x1b93f1(0x10c)],_0x1a321b,_0xa41fa4,_0x1e93b9);}['getDefaultAgent'](){const _0x380970=a122_0x29cadd,_0x37529c=this['context'][_0x380970(0x147)];return readCachedLLMAgent(_0x37529c)||undefined;}[a122_0x29cadd(0x1cd)](){const _0x497242=a122_0x29cadd,_0x30ed9a=this[_0x497242(0xf7)]['profile'];clearCachedLLMAgent(_0x30ed9a);}async['models'](){const _0x4b4171=a122_0x29cadd,_0x52cdcc=await this[_0x4b4171(0x18e)][_0x4b4171(0x16e)](),_0x3e1f16=[];for(const _0x2d3cc4 of _0x52cdcc[_0x4b4171(0x1d3)]){const _0x4475da=_0x52cdcc[_0x4b4171(0x106)][_0x2d3cc4];_0x4475da&&_0x3e1f16[_0x4b4171(0xc9)]({'name':_0x2d3cc4,'displayName':_0x4475da[_0x4b4171(0x15b)]});}return _0x3e1f16;}async['createProject'](_0x1495b2){const _0x10fe98=a122_0x29cadd;return await this[_0x10fe98(0x18e)][_0x10fe98(0x1c1)](_0x1495b2);}async['deleteProject'](_0x4b6fa6){const _0x51ba3e=a122_0x29cadd,{projectId:_0x8432e7}=await this[_0x51ba3e(0xc5)](_0x4b6fa6);await this[_0x51ba3e(0x18e)]['deleteProject'](_0x8432e7);}async[a122_0x29cadd(0x186)](_0x24a061=0x32){const _0x14a00d=a122_0x29cadd;return await this['client'][_0x14a00d(0x134)](_0x24a061);}async[a122_0x29cadd(0xec)](_0x49962e){const _0x4e0968=a122_0x29cadd,_0x2526ef=_0x49962e||this[_0x4e0968(0x155)](),_0x28a813=this['context'][_0x4e0968(0x147)];if(!_0x49962e){const _0x52b00a=readCachedLLMProject(_0x28a813);if(_0x52b00a&&_0x52b00a['name']===_0x2526ef)try{const _0x35e969=await this[_0x4e0968(0x18e)][_0x4e0968(0xd7)](_0x52b00a['id']);if(_0x35e969[_0x4e0968(0x11d)][_0x4e0968(0x10c)]===_0x2526ef)return _0x35e969;}catch{}}const _0x15082e=await this['client']['listProjects'](),_0x48e196=_0x15082e[_0x4e0968(0x176)](_0x38eecc=>_0x38eecc['attributes'][_0x4e0968(0x10c)]===_0x2526ef);if(_0x48e196)return!_0x49962e&&writeCachedLLMProject(_0x2526ef,_0x48e196['id'],_0x28a813),_0x48e196;const _0x20bcd9=await this[_0x4e0968(0x18e)]['createProject']({'name':_0x2526ef,'description':_0x4e0968(0x19f)+getSanitizedUsername()+')'});return!_0x49962e&&writeCachedLLMProject(_0x2526ef,_0x20bcd9['id'],_0x28a813),_0x20bcd9;}async[a122_0x29cadd(0x178)](_0x241698){const _0x42e7ae=a122_0x29cadd,_0x1affaa=await this[_0x42e7ae(0x18e)]['listProjects'](),_0x197aaa=_0x1affaa[_0x42e7ae(0x189)](_0x49af18=>_0x49af18[_0x42e7ae(0x11d)][_0x42e7ae(0x10c)]===_0x241698);if(_0x197aaa[_0x42e7ae(0xf2)]===0x0)throw new SDKError(ErrorCode[_0x42e7ae(0x163)],'Project\x20not\x20found:\x20'+_0x241698,undefined,{'helpText':_0x42e7ae(0x174)});if(_0x197aaa[_0x42e7ae(0xf2)]>0x1)throw new SDKError(ErrorCode[_0x42e7ae(0x10f)],_0x42e7ae(0x1b6)+_0x241698+_0x42e7ae(0x1b8));return _0x197aaa[0x0]['id'];}async[a122_0x29cadd(0xc5)](_0x242ae3){const _0x1682e2=a122_0x29cadd,_0x383d0e=await this[_0x1682e2(0x18e)][_0x1682e2(0x134)](),_0x47cc44=_0x383d0e['find'](_0x2654e2=>_0x2654e2['attributes'][_0x1682e2(0x10c)]===_0x242ae3);if(_0x47cc44)return{'projectId':_0x47cc44['id'],'project':_0x47cc44};throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x1682e2(0x1ac)+_0x242ae3,undefined,{'helpText':_0x1682e2(0x174)});}async[a122_0x29cadd(0xcc)](_0x4f5be4='claude-4.5-sonnet',_0x555a86=0x0,_0x4ff71c){const _0x5de3d3=a122_0x29cadd,_0x326532=0xa;let _0x60403f=0x0,_0x16e9d8;while(_0x60403f<_0x326532){try{const _0x33278c=await this[_0x5de3d3(0xec)](_0x16e9d8),_0x111356=_0x33278c['id'],_0x46bd08=[_0x5de3d3(0x1ba),_0x5de3d3(0x170),_0x5de3d3(0x14b),_0x5de3d3(0x140),_0x5de3d3(0x162)],_0x497c9e=_0x555a86===0x0?_0x5de3d3(0x17a)+_0x4f5be4:'tdx_'+_0x4f5be4+_0x5de3d3(0x146)+_0x46bd08[_0x555a86],_0x5b656f=await this[_0x5de3d3(0x18e)][_0x5de3d3(0xd0)](_0x111356),_0x206bb4=_0x5b656f[_0x5de3d3(0x176)](_0x4c3128=>_0x4c3128[_0x5de3d3(0x11d)][_0x5de3d3(0x10c)]===_0x497c9e);if(_0x206bb4)return _0x206bb4;const _0xa9a8ad=_0x555a86>0x0?0x1:_0x4ff71c;return await this['client'][_0x5de3d3(0x17e)]({'name':_0x497c9e,'projectId':_0x111356,'modelType':_0x4f5be4,'systemPrompt':'','temperature':_0xa9a8ad,'reasoningEffort':_0x555a86>0x0?_0x555a86:undefined});}catch(_0x37f046){if(_0x37f046 instanceof HTTPClientError){const _0x1f931=_0x37f046[_0x5de3d3(0x1cb)];if(_0x1f931>=0x190&&_0x1f931<0x1f4){if(_0x1f931===0x191)throw new SDKError(ErrorCode[_0x5de3d3(0x14f)],_0x5de3d3(0x138),_0x37f046);else{if(_0x1f931===0x193)throw new SDKError(ErrorCode[_0x5de3d3(0xf8)],'Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.',_0x37f046);}throw _0x37f046;}}if(errorContains(_0x37f046,_0x5de3d3(0x197),_0x5de3d3(0x1bb),_0x5de3d3(0x199))){_0x60403f++;if(_0x60403f>=_0x326532)throw new SDKError(ErrorCode[_0x5de3d3(0x1a7)],'Unable\x20to\x20create\x20project\x20after\x20'+_0x326532+_0x5de3d3(0x166),_0x37f046);const _0x413335=this[_0x5de3d3(0x155)]();_0x16e9d8=_0x413335+'_'+generateRandomHex();continue;}throw _0x37f046;}}throw new SDKError(ErrorCode[_0x5de3d3(0x10f)],_0x5de3d3(0x142));}async['resolveAgentId'](_0x580099,_0x36359c){const _0x591908=a122_0x29cadd,_0x5b5ab3=_0x36359c||this[_0x591908(0x12d)],_0x45049a=await this[_0x591908(0x18e)][_0x591908(0xd0)](_0x5b5ab3),_0x58dc75=_0x45049a[_0x591908(0x189)](_0x4c8c4d=>_0x4c8c4d[_0x591908(0x11d)]['name']===_0x580099);if(_0x58dc75[_0x591908(0xf2)]===0x0){const _0x567d36=_0x5b5ab3?_0x591908(0xf6)+_0x5b5ab3:'';throw new SDKError(ErrorCode[_0x591908(0xef)],_0x591908(0x169)+_0x580099+_0x567d36,undefined,{'helpText':_0x5b5ab3?_0x591908(0xe1):_0x591908(0x10e)});}if(_0x58dc75['length']>0x1)throw new SDKError(ErrorCode['INTERNAL'],_0x591908(0x12e)+_0x580099+'\x27.\x20This\x20should\x20not\x20happen.');return _0x58dc75[0x0]['id'];}async['agents'](_0x20e802){const _0x225d80=a122_0x29cadd,_0x1a6ac3=_0x20e802||this['currentProjectId'];return await this['client'][_0x225d80(0xd0)](_0x1a6ac3);}async[a122_0x29cadd(0x115)](_0x594cc7){const _0x4adff9=a122_0x29cadd;return await this[_0x4adff9(0x18e)][_0x4adff9(0x103)](_0x594cc7);}async[a122_0x29cadd(0xc8)](_0x35af02){const _0x1d3f0d=a122_0x29cadd;return await this['client'][_0x1d3f0d(0xf3)](_0x35af02);}async[a122_0x29cadd(0x17e)](_0xd2a49b){const _0x3b9d96=a122_0x29cadd;return await this[_0x3b9d96(0x18e)]['createAgent'](_0xd2a49b);}async[a122_0x29cadd(0xc0)](_0x8524f2,_0x504ea3){const _0x59a58d=a122_0x29cadd;return await this[_0x59a58d(0x18e)][_0x59a58d(0xc0)](_0x8524f2,_0x504ea3);}async[a122_0x29cadd(0x1ae)](_0x4bc312){const _0x2688a8=a122_0x29cadd;await this[_0x2688a8(0x18e)][_0x2688a8(0x1ae)](_0x4bc312);}async[a122_0x29cadd(0x1cc)](_0x18fdee){const _0x4bb582=a122_0x29cadd;return await this[_0x4bb582(0x18e)][_0x4bb582(0x1cc)]({'agentId':_0x18fdee});}async*[a122_0x29cadd(0x159)](_0x4c3a51,_0x59c58b){const _0x18c522=a122_0x29cadd;let _0x2bd899=_0x59c58b?.[_0x18c522(0x13f)];const _0x4bd9c9=_0x59c58b?.[_0x18c522(0x137)];if(!_0x2bd899){if(!_0x4bd9c9)throw new Error('agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat');const _0x1e3af1=await this[_0x18c522(0x18e)]['startChat']({'agentId':_0x4bd9c9});_0x2bd899=_0x1e3af1['id'],yield{'type':_0x18c522(0x127),'data':{'chatId':_0x2bd899,'agentId':_0x4bd9c9,'projectId':_0x1e3af1['attributes']['projectId']}};}for await(const _0xcae422 of this[_0x18c522(0x18e)][_0x18c522(0x152)](_0x2bd899,_0x4c3a51,_0x59c58b?.[_0x18c522(0xed)])){yield{'type':'event','data':_0xcae422};}}async[a122_0x29cadd(0x172)](_0x362ad2=0x32){const _0x59fd05=a122_0x29cadd;return await this[_0x59fd05(0x18e)][_0x59fd05(0x1d7)](_0x362ad2);}async[a122_0x29cadd(0x121)](_0x17a6da){const _0x4deb59=a122_0x29cadd;return await this[_0x4deb59(0x18e)][_0x4deb59(0x18a)](_0x17a6da);}async[a122_0x29cadd(0x148)](_0x2ec91c){const _0x3c2715=a122_0x29cadd;return await this[_0x3c2715(0x18e)][_0x3c2715(0x148)](_0x2ec91c);}async['chatInfo'](_0x2d0d84){return await this['client']['getChatInfo'](_0x2d0d84);}async[a122_0x29cadd(0xe2)](_0x3c9b74,_0x4fdc0f,_0x272a34){const _0x54c777=a122_0x29cadd,_0x196533=_0x272a34?.[_0x54c777(0x1a3)]??![],{projectId:_0x5b14ee,project:_0x2ab8c7}=await this[_0x54c777(0xc5)](_0x3c9b74),_0x3b56b6=_0x2ab8c7[_0x54c777(0x11d)][_0x54c777(0x10c)],_0x1173d9=_0x4fdc0f||_0x3b56b6+_0x54c777(0xc6);if(a122_0x1debea[_0x54c777(0x1cf)](_0x1173d9)&&!_0x196533)throw new SDKError(ErrorCode[_0x54c777(0x1a7)],_0x54c777(0xe9)+_0x1173d9,undefined,{'helpText':_0x54c777(0x130)});const _0xec5652=await this[_0x54c777(0x18e)][_0x54c777(0x103)](_0x5b14ee),_0x5ac96d=await this[_0x54c777(0x18e)][_0x54c777(0x145)](_0x5b14ee),_0x37783b=await this[_0x54c777(0x18e)][_0x54c777(0xce)](_0x5b14ee),_0x2c4245=await this[_0x54c777(0x18e)]['listIntegrations'](_0x5b14ee);if(!_0x196533){a122_0x1debea[_0x54c777(0x144)](_0x1173d9,{'recursive':!![]});const _0x431ce1={'version':_0x54c777(0xde),'exportedAt':new Date()[_0x54c777(0x18b)](),'exportedFrom':{'site':this[_0x54c777(0xf7)]['site'],'projectId':_0x5b14ee,'projectName':_0x3b56b6},'project':_0x2ab8c7};a122_0x1debea['writeFileSync'](a122_0x52c3ab[_0x54c777(0x184)](_0x1173d9,_0x54c777(0x179)),JSON[_0x54c777(0x133)](_0x431ce1,null,0x2)),a122_0x1debea['writeFileSync'](a122_0x52c3ab[_0x54c777(0x184)](_0x1173d9,_0x54c777(0x1a9)),JSON[_0x54c777(0x133)](_0xec5652,null,0x2)),a122_0x1debea[_0x54c777(0x187)](a122_0x52c3ab['join'](_0x1173d9,'knowledgebases.json'),JSON[_0x54c777(0x133)](_0x5ac96d,null,0x2)),a122_0x1debea[_0x54c777(0x187)](a122_0x52c3ab[_0x54c777(0x184)](_0x1173d9,_0x54c777(0x160)),JSON['stringify'](_0x37783b,null,0x2)),a122_0x1debea[_0x54c777(0x187)](a122_0x52c3ab['join'](_0x1173d9,'integrations.json'),JSON['stringify'](_0x2c4245,null,0x2));}return{'projectName':_0x3b56b6,'outputDir':_0x1173d9,'counts':{'agents':_0xec5652[_0x54c777(0xf2)],'knowledgeBases':_0x5ac96d['length'],'prompts':_0x37783b[_0x54c777(0xf2)],'integrations':_0x2c4245[_0x54c777(0xf2)]}};}async[a122_0x29cadd(0x136)](_0x5b58d3,_0x225ce7){const _0x515da8=a122_0x29cadd,_0x18830e=_0x225ce7?.['dryRun']??![],_0x9fdcb=this[_0x515da8(0x143)](_0x5b58d3),_0x198ac4=_0x9fdcb[_0x515da8(0x1c4)][_0x515da8(0x13d)],_0x4d339d=this[_0x515da8(0xf7)]['site'],_0x4be891=_0x198ac4!==_0x4d339d?_0x198ac4:undefined,_0x34b7a6=this[_0x515da8(0x19b)](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x1a9)),[]),_0x307e17=this['loadJsonFile'](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x15f)),[]),_0x54f104=this[_0x515da8(0x19b)](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x160)),[]),_0x12571e=this[_0x515da8(0x19b)](a122_0x52c3ab[_0x515da8(0x184)](_0x5b58d3,_0x515da8(0x167)),[]),_0x1b7c2f=_0x225ce7?.[_0x515da8(0x10c)]||_0x9fdcb[_0x515da8(0x1c4)][_0x515da8(0x104)];if(_0x18830e){const _0x4f33f8=new Map(),_0x549bff=[..._0x34b7a6],_0x16c67f=_0x34b7a6[_0x515da8(0xf2)]+0x1;let _0x2e9761=0x0;while(_0x549bff[_0x515da8(0xf2)]>0x0&&_0x2e9761<_0x16c67f){_0x2e9761++;const _0x3702a5=[];for(const _0x12d5fd of _0x549bff){canCreateAgent(_0x12d5fd,_0x4f33f8)?_0x4f33f8['set'](_0x12d5fd['id'],_0x515da8(0x1dc)+_0x12d5fd['id']):_0x3702a5[_0x515da8(0xc9)](_0x12d5fd);}if(_0x3702a5[_0x515da8(0xf2)]===_0x549bff[_0x515da8(0xf2)])throw new SDKError(ErrorCode[_0x515da8(0x10f)],_0x515da8(0x16b),undefined,{'helpText':'The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.'});_0x549bff[_0x515da8(0xf2)]=0x0,_0x549bff[_0x515da8(0xc9)](..._0x3702a5);}const _0x291d63=_0x54f104[_0x515da8(0x189)](_0x1bb80d=>_0x4f33f8[_0x515da8(0x112)](_0x1bb80d[_0x515da8(0x11d)][_0x515da8(0x137)]))['length'];return{'projectName':_0x1b7c2f,'projectId':_0x515da8(0x17d),'counts':{'agents':_0x34b7a6[_0x515da8(0xf2)],'knowledgeBases':_0x307e17[_0x515da8(0xf2)],'prompts':_0x291d63,'integrations':_0x12571e[_0x515da8(0xf2)]},'sourceSite':_0x4be891};}const _0x14085a=await this['client']['createProject']({'name':_0x1b7c2f,'description':_0x9fdcb[_0x515da8(0x18f)]['attributes'][_0x515da8(0x14d)]}),_0x3d5ea0=_0x14085a['id'],_0x2d2e44=new Map(),_0x227250=new Map(),_0x20b35f=new Map();for(const _0x2180f8 of _0x307e17){const _0x5da9e2=await this[_0x515da8(0x18e)][_0x515da8(0xe5)]({'projectId':_0x3d5ea0,'name':_0x2180f8[_0x515da8(0x11d)][_0x515da8(0x10c)],'tdDatabaseName':_0x2180f8['attributes'][_0x515da8(0x12b)],'tables':_0x2180f8[_0x515da8(0x11d)][_0x515da8(0x151)]});_0x2d2e44[_0x515da8(0x107)](_0x2180f8['id'],_0x5da9e2['id']);}const _0x349f57=[..._0x34b7a6],_0x3a60fd=_0x34b7a6['length']+0x1;let _0xfe7e89=0x0;while(_0x349f57[_0x515da8(0xf2)]>0x0&&_0xfe7e89<_0x3a60fd){_0xfe7e89++;const _0x2de92e=[];for(const _0x5c714c of _0x349f57){if(canCreateAgent(_0x5c714c,_0x227250)){const _0x27c94b=remapToolIds(_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x1c5)],_0x2d2e44,_0x227250),_0x16107c=remapVariableIds(_0x5c714c[_0x515da8(0x11d)][_0x515da8(0xcd)],_0x2d2e44),_0x411b19=await this[_0x515da8(0x18e)][_0x515da8(0x18d)]({'name':_0x5c714c['attributes'][_0x515da8(0x10c)],'projectId':_0x3d5ea0,'systemPrompt':_0x5c714c[_0x515da8(0x11d)][_0x515da8(0xfb)],'starterMessage':_0x5c714c['attributes'][_0x515da8(0x1c8)],'modelType':migrateModelType(_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x117)]),'maxToolIterations':_0x5c714c['attributes'][_0x515da8(0x171)],'temperature':_0x5c714c[_0x515da8(0x11d)]['temperature'],'reasoningEffort':_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x1d2)],'outputs':_0x5c714c[_0x515da8(0x11d)][_0x515da8(0x161)],'tools':_0x27c94b,'variables':_0x16107c});_0x227250['set'](_0x5c714c['id'],_0x411b19['id']);}else _0x2de92e[_0x515da8(0xc9)](_0x5c714c);}if(_0x2de92e[_0x515da8(0xf2)]===_0x349f57[_0x515da8(0xf2)])throw new SDKError(ErrorCode[_0x515da8(0x10f)],_0x515da8(0x16b),undefined,{'helpText':_0x515da8(0xf9)});_0x349f57[_0x515da8(0xf2)]=0x0,_0x349f57['push'](..._0x2de92e);}for(const _0x496782 of _0x54f104){const _0xb68b47=_0x227250[_0x515da8(0x14e)](_0x496782[_0x515da8(0x11d)][_0x515da8(0x137)]);if(!_0xb68b47)continue;const _0x40e597=await this['client'][_0x515da8(0x1b7)]({'projectId':_0x3d5ea0,'agentId':_0xb68b47,'name':_0x496782['attributes'][_0x515da8(0x10c)],'systemPrompt':_0x496782['attributes']['systemPrompt'],'template':_0x496782[_0x515da8(0x11d)][_0x515da8(0xd5)],'jsonSchemaHint':_0x496782[_0x515da8(0x11d)]['jsonSchemaHint']});_0x20b35f[_0x515da8(0x107)](_0x496782['id'],_0x40e597['id']);}for(const _0x19aff3 of _0x12571e){const _0x36f805=_0x19aff3[_0x515da8(0x11d)]['actions'][_0x515da8(0x1b2)](_0x116184=>({..._0x116184,'promptId':_0x20b35f[_0x515da8(0x14e)](_0x116184[_0x515da8(0x19c)])||_0x116184[_0x515da8(0x19c)]}));await this[_0x515da8(0x18e)][_0x515da8(0x1d0)]({'projectId':_0x3d5ea0,'serviceType':_0x19aff3[_0x515da8(0x11d)][_0x515da8(0x17f)],'actions':_0x36f805,'slackMessageMode':_0x19aff3['attributes'][_0x515da8(0x11a)],'chatIgnoreManagedActions':_0x19aff3['attributes'][_0x515da8(0xca)],'chatWelcomeMessage':_0x19aff3[_0x515da8(0x11d)]['chatWelcomeMessage'],'webhookCorsOrigins':_0x19aff3[_0x515da8(0x11d)][_0x515da8(0x11b)]});}return{'projectName':_0x1b7c2f,'projectId':_0x3d5ea0,'counts':{'agents':_0x227250[_0x515da8(0x1c6)],'knowledgeBases':_0x2d2e44[_0x515da8(0x1c6)],'prompts':_0x20b35f[_0x515da8(0x1c6)],'integrations':_0x12571e['length']},'sourceSite':_0x4be891};}[a122_0x29cadd(0x19b)](_0x138d26,_0x3af32c){const _0x7141e3=a122_0x29cadd;if(!a122_0x1debea[_0x7141e3(0x1cf)](_0x138d26))return _0x3af32c;return JSON[_0x7141e3(0x177)](a122_0x1debea[_0x7141e3(0x16d)](_0x138d26,_0x7141e3(0x1b9)));}[a122_0x29cadd(0x143)](_0x1a37b7){const _0x27e0b2=a122_0x29cadd;if(!a122_0x1debea[_0x27e0b2(0x1cf)](_0x1a37b7))throw new SDKError(ErrorCode[_0x27e0b2(0x1de)],_0x27e0b2(0x109)+_0x1a37b7,undefined,{'helpText':_0x27e0b2(0x165)});const _0x4cdcfe=a122_0x52c3ab[_0x27e0b2(0x184)](_0x1a37b7,_0x27e0b2(0x179));if(!a122_0x1debea['existsSync'](_0x4cdcfe))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20'+_0x1a37b7,undefined,{'helpText':_0x27e0b2(0x192)});const _0x456936=JSON[_0x27e0b2(0x177)](a122_0x1debea[_0x27e0b2(0x16d)](_0x4cdcfe,_0x27e0b2(0x1b9)));if(!isSupportedBackupVersion(_0x456936[_0x27e0b2(0x14a)]))throw new SDKError(ErrorCode[_0x27e0b2(0x129)],_0x27e0b2(0x124)+_0x456936[_0x27e0b2(0x14a)],undefined,{'helpText':_0x27e0b2(0xc2)});return _0x456936;}async[a122_0x29cadd(0x135)](_0x1c62f1,_0x36e486,_0x5b5c89){const _0x18462b=a122_0x29cadd,{projectId:_0x90f37,project:_0x3a3f16}=await this[_0x18462b(0xc5)](_0x1c62f1),_0x4bd3d8=_0x3a3f16[_0x18462b(0x11d)][_0x18462b(0x10c)];let _0x39dcea;if(_0x36e486)_0x39dcea=_0x36e486;else{const _0x1faa53=a122_0x52c3ab[_0x18462b(0x184)](process[_0x18462b(0x185)](),_0x18462b(0x193)),_0x414238=getSanitizedPathWithMigration(_0x1faa53,_0x4bd3d8);_0x414238['renamed']&&this[_0x18462b(0x114)][_0x18462b(0xff)](_0x18462b(0xd8)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x414238[_0x18462b(0x1b3)])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x414238['path'])),_0x39dcea=_0x414238[_0x18462b(0xd2)];}const _0x3b96cd=await this[_0x18462b(0x18e)][_0x18462b(0x103)](_0x90f37),_0x45888d=await this['client'][_0x18462b(0x145)](_0x90f37),_0x109568=await this[_0x18462b(0x18e)][_0x18462b(0x1c0)](_0x90f37),_0x27629d=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x14c)](_0x90f37)),_0x1888d4=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x180)](_0x90f37)),_0x1f6275=await this[_0x18462b(0x18e)]['listPrompts'](_0x90f37),_0x595def=await this[_0x18462b(0x18e)][_0x18462b(0xd9)](_0x90f37),_0x383a3b=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x182)](_0x90f37)),_0x55469c=await safeListOrEmpty(()=>this[_0x18462b(0x18e)][_0x18462b(0x1a6)](_0x90f37)),_0x54211c=_0x595def[_0x18462b(0x189)](_0x997d3e=>!_0x997d3e['attributes'][_0x18462b(0x154)]&&SAFE_INTEGRATION_TYPES[_0x18462b(0x15d)](_0x997d3e[_0x18462b(0x11d)][_0x18462b(0x17f)][_0x18462b(0x102)]())),_0x54b272=new Map(),_0x2b3364=new Map(),_0x3f451c=new Map(),_0xe51842=new Map(),_0xb2ea=new Map(),_0x273536=new Map(),_0x37c39d=new Map();for(const _0x3e5a62 of _0x3b96cd){_0x54b272[_0x18462b(0x107)](_0x3e5a62['id'],_0x3e5a62[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0x429a45 of _0x45888d){_0x2b3364[_0x18462b(0x107)](_0x429a45['id'],_0x429a45[_0x18462b(0x11d)]['name']);}for(const _0x292a64 of _0x109568){_0x3f451c[_0x18462b(0x107)](_0x292a64['id'],_0x292a64[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0xde9ecc of _0x27629d){_0xe51842[_0x18462b(0x107)](_0xde9ecc['id'],_0xde9ecc[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0x8bf909 of _0x1888d4){_0xb2ea[_0x18462b(0x107)](_0x8bf909['id'],_0x8bf909[_0x18462b(0x11d)][_0x18462b(0x10c)]);}for(const _0x3f471c of _0x1f6275){_0x273536['set'](_0x3f471c['id'],_0x3f471c[_0x18462b(0x11d)]['name']);}for(const _0x21baa3 of _0x383a3b){_0x37c39d[_0x18462b(0x107)](_0x21baa3['id'],_0x21baa3[_0x18462b(0x11d)][_0x18462b(0x10c)]);}const _0x1352fa={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2b3364,'TextKnowledgeBase':_0x3f451c,'Agent':_0x54b272,'WebSearchTool':_0xb2ea,'ImageGenerator':_0xe51842,'ExperimentalKnowledgeBase':_0x37c39d}),'resolvePromptName':async _0x9fd625=>_0x273536[_0x18462b(0x14e)](_0x9fd625),'onWarning':_0x347628=>this[_0x18462b(0x114)][_0x18462b(0x1c7)](_0x347628)},_0x3ec88d={'projectName':_0x4bd3d8,'outputDir':_0x39dcea,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'knowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'textKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'prompts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'integrations':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalArtifacts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0}}},_0x1ad9cc=[],_0x3a0cee=[];for(const _0x59c8c4 of _0x3b96cd){const _0x34ce15=getSanitizedPathWithMigration(_0x39dcea,_0x59c8c4['attributes'][_0x18462b(0x10c)]);_0x34ce15['renamed']&&this[_0x18462b(0x114)]['info'](_0x18462b(0x123)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x34ce15[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab['basename'](_0x34ce15['path']));const _0x4a1533=_0x34ce15[_0x18462b(0xd2)],_0x5c5466=a122_0x52c3ab['join'](_0x4a1533,_0x18462b(0x1d9)),_0x5c9a1d=a122_0x52c3ab[_0x18462b(0x184)](_0x4a1533,'agent.yml'),_0xd9cec2=a122_0x52c3ab['join'](_0x4a1533,_0x18462b(0xdc)),{yaml:_0x5d6d3a,systemPrompt:_0x218573,starterMessage:_0x483fbe}=await agentResponseToDef(_0x59c8c4,_0x1352fa),_0x43d4c8=toAgentYamlString(_0x5d6d3a),_0x52c203=!a122_0x1debea['existsSync'](_0x5c9a1d);let _0x460ea2=_0x52c203,_0x5c6e6a;if(!_0x52c203){const _0xfa32a2=a122_0x1debea[_0x18462b(0x1cf)](_0x5c5466)?a122_0x1debea[_0x18462b(0x16d)](_0x5c5466,_0x18462b(0x1b9)):'',_0x3747ad=a122_0x1debea[_0x18462b(0x16d)](_0x5c9a1d,_0x18462b(0x1b9)),_0x247c4d=_0x18462b(0x157)+_0xfa32a2+_0x18462b(0x16c)+_0x3747ad,_0x5538d0=_0x18462b(0x157)+_0x218573+_0x18462b(0x16c)+_0x43d4c8,_0x101a25=generateDiff(_0x247c4d,_0x5538d0);_0x460ea2=hasChanges(_0x101a25),_0x460ea2&&(_0x5c6e6a=formatDiffWithColors(_0x101a25));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x4a1533,'content':'','isDir':!![]}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x5c5466,'content':_0x218573}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x5c9a1d,'content':_0x43d4c8});_0x483fbe&&_0x483fbe['includes']('\x0a')&&_0x1ad9cc[_0x18462b(0xc9)]({'path':_0xd9cec2,'content':_0x483fbe});_0x3ec88d[_0x18462b(0x193)][_0x18462b(0xc9)]({'agentName':_0x59c8c4['attributes'][_0x18462b(0x10c)],'outputPath':_0x4a1533,'isNew':_0x52c203,'hasChanges':_0x460ea2,'diff':_0x5c6e6a}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0xf4)]++;if(_0x52c203)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0x132)]++;else{if(_0x460ea2)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x193)][_0x18462b(0x1d1)]++;}}for(const _0x44c5d6 of _0x45888d){if(_0x44c5d6['attributes']['isManaged'])continue;const _0x92de28=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x39dcea),_0x44c5d6['attributes']['name'],_0x18462b(0x194));_0x92de28[_0x18462b(0xfe)]&&this[_0x18462b(0x114)]['info'](_0x18462b(0x1ca)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x92de28[_0x18462b(0x1b3)])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x92de28['path']));const _0x49d438=_0x92de28[_0x18462b(0xd2)],_0x46d6b8=apiKnowledgeBaseToYaml(_0x44c5d6),_0x3f428b=toKnowledgeBaseYamlString(_0x46d6b8),_0x2ec174=!a122_0x1debea[_0x18462b(0x1cf)](_0x49d438);let _0x596aa8=_0x2ec174,_0x56b1dc;if(!_0x2ec174){const _0x570d53=a122_0x1debea[_0x18462b(0x16d)](_0x49d438,_0x18462b(0x1b9)),_0x14c554=generateDiff(_0x570d53,_0x3f428b);_0x596aa8=hasChanges(_0x14c554),_0x596aa8&&(_0x56b1dc=formatDiffWithColors(_0x14c554));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x49d438,'content':_0x3f428b}),_0x3ec88d[_0x18462b(0xbf)][_0x18462b(0xc9)]({'name':_0x44c5d6[_0x18462b(0x11d)][_0x18462b(0x10c)],'outputPath':_0x49d438,'isNew':_0x2ec174,'hasChanges':_0x596aa8,'diff':_0x56b1dc}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0xbf)][_0x18462b(0xf4)]++;if(_0x2ec174)_0x3ec88d['counts']['knowledgeBases'][_0x18462b(0x132)]++;else{if(_0x596aa8)_0x3ec88d['counts'][_0x18462b(0xbf)]['updated']++;else _0x3ec88d['counts'][_0x18462b(0xbf)][_0x18462b(0x1d1)]++;}}for(const _0x520d70 of _0x109568){if(_0x520d70[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0x490243=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x39dcea),_0x520d70[_0x18462b(0x11d)][_0x18462b(0x10c)],_0x18462b(0x16a));_0x490243[_0x18462b(0xfe)]&&this[_0x18462b(0x114)][_0x18462b(0xff)](_0x18462b(0x11c)+a122_0x52c3ab['basename'](_0x490243['oldPath'])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x490243['path']));const _0x351895=_0x490243['path'],_0x3c6b88=toTextKnowledgeBaseMd(_0x520d70['attributes']['name'],_0x520d70[_0x18462b(0x11d)][_0x18462b(0xc1)]),_0x45dfa8=!a122_0x1debea[_0x18462b(0x1cf)](_0x351895);let _0x39bb08=_0x45dfa8,_0x5e1c9f;if(!_0x45dfa8){const _0x3c2c50=a122_0x1debea[_0x18462b(0x16d)](_0x351895,_0x18462b(0x1b9)),_0x4e8113=generateDiff(_0x3c2c50,_0x3c6b88);_0x39bb08=hasChanges(_0x4e8113),_0x39bb08&&(_0x5e1c9f=formatDiffWithColors(_0x4e8113));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x351895,'content':_0x3c6b88}),_0x3ec88d[_0x18462b(0x128)][_0x18462b(0xc9)]({'name':_0x520d70['attributes'][_0x18462b(0x10c)],'outputPath':_0x351895,'isNew':_0x45dfa8,'hasChanges':_0x39bb08,'diff':_0x5e1c9f}),_0x3ec88d['counts'][_0x18462b(0x128)][_0x18462b(0xf4)]++;if(_0x45dfa8)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x128)][_0x18462b(0x132)]++;else{if(_0x39bb08)_0x3ec88d[_0x18462b(0x17b)]['textKnowledgeBases'][_0x18462b(0x1db)]++;else _0x3ec88d['counts'][_0x18462b(0x128)][_0x18462b(0x1d1)]++;}}for(const _0x4d54e7 of _0x1f6275){if(_0x4d54e7[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0x26328d=getSanitizedPathWithMigration(getPromptsDir(_0x39dcea),_0x4d54e7['attributes'][_0x18462b(0x10c)],_0x18462b(0x194));_0x26328d['renamed']&&this[_0x18462b(0x114)][_0x18462b(0xff)]('Renamed\x20prompt\x20file:\x20'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x26328d[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x26328d[_0x18462b(0xd2)]));const _0x39b7a6=_0x26328d[_0x18462b(0xd2)],_0x4702e0=await apiPromptToYaml(_0x4d54e7,_0x1352fa);if(!_0x4702e0)continue;const _0x27bd5d=toPromptYamlString(_0x4702e0),_0x1dde3d=!a122_0x1debea['existsSync'](_0x39b7a6);let _0x13ec66=_0x1dde3d,_0x576540;if(!_0x1dde3d){const _0x8db65b=a122_0x1debea['readFileSync'](_0x39b7a6,'utf-8'),_0x378ccc=generateDiff(_0x8db65b,_0x27bd5d);_0x13ec66=hasChanges(_0x378ccc),_0x13ec66&&(_0x576540=formatDiffWithColors(_0x378ccc));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x39b7a6,'content':_0x27bd5d}),_0x3ec88d['prompts'][_0x18462b(0xc9)]({'name':_0x4d54e7[_0x18462b(0x11d)][_0x18462b(0x10c)],'outputPath':_0x39b7a6,'isNew':_0x1dde3d,'hasChanges':_0x13ec66,'diff':_0x576540}),_0x3ec88d[_0x18462b(0x17b)]['prompts'][_0x18462b(0xf4)]++;if(_0x1dde3d)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x122)]['new']++;else{if(_0x13ec66)_0x3ec88d[_0x18462b(0x17b)]['prompts'][_0x18462b(0x1db)]++;else _0x3ec88d['counts'][_0x18462b(0x122)]['unchanged']++;}}for(const _0xfb4ec9 of _0x54211c){const _0x7b9011=_0xfb4ec9[_0x18462b(0x11d)][_0x18462b(0x17f)][_0x18462b(0x102)](),_0x15e38c=getSanitizedPathWithMigration(getIntegrationsDir(_0x39dcea),_0x7b9011,_0x18462b(0x194));_0x15e38c[_0x18462b(0xfe)]&&this['logger']['info'](_0x18462b(0x17c)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x15e38c[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x15e38c['path']));const _0xec371b=_0x15e38c[_0x18462b(0xd2)],_0x3d037e=await apiIntegrationToYaml(_0xfb4ec9,_0x1352fa),_0x48761e=toIntegrationYamlString(_0x3d037e),_0x5de7d5=!a122_0x1debea['existsSync'](_0xec371b);let _0x5dd8fa=_0x5de7d5,_0x3e166f;if(!_0x5de7d5){const _0x572dcb=a122_0x1debea['readFileSync'](_0xec371b,_0x18462b(0x1b9)),_0x36cf9b=generateDiff(_0x572dcb,_0x48761e);_0x5dd8fa=hasChanges(_0x36cf9b),_0x5dd8fa&&(_0x3e166f=formatDiffWithColors(_0x36cf9b));}_0x1ad9cc[_0x18462b(0xc9)]({'path':_0xec371b,'content':_0x48761e}),_0x3ec88d[_0x18462b(0x13a)][_0x18462b(0xc9)]({'name':_0x7b9011,'outputPath':_0xec371b,'isNew':_0x5de7d5,'hasChanges':_0x5dd8fa,'diff':_0x3e166f}),_0x3ec88d['counts']['integrations'][_0x18462b(0xf4)]++;if(_0x5de7d5)_0x3ec88d['counts']['integrations'][_0x18462b(0x132)]++;else{if(_0x5dd8fa)_0x3ec88d['counts'][_0x18462b(0x13a)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x13a)][_0x18462b(0x1d1)]++;}}for(const _0x237e6a of _0x383a3b){if(_0x237e6a[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0x1b5b26=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x39dcea),_0x237e6a[_0x18462b(0x11d)][_0x18462b(0x10c)]);_0x1b5b26[_0x18462b(0xfe)]&&this['logger']['info'](_0x18462b(0x164)+a122_0x52c3ab['basename'](_0x1b5b26[_0x18462b(0x1b3)])+_0x18462b(0x1ce)+a122_0x52c3ab[_0x18462b(0x1d4)](_0x1b5b26[_0x18462b(0xd2)]));const _0x1062a5=_0x1b5b26[_0x18462b(0xd2)],_0x13289b=a122_0x52c3ab[_0x18462b(0x184)](_0x1062a5,sanitizeForFilesystem(_0x237e6a['attributes']['name'])+_0x18462b(0x194)),_0x56b385=a122_0x52c3ab['join'](_0x1062a5,'functions'),_0x590a8f=apiExperimentalKnowledgeBaseToYaml(_0x237e6a),_0x257689=toExperimentalKnowledgeBaseYamlString(_0x590a8f),_0x50ed36=!a122_0x1debea['existsSync'](_0x1062a5);let _0x3256f2=_0x50ed36,_0x3573ef,_0x2f945c=_0x257689;const _0x1e898d=[..._0x590a8f['functions']]['sort']((_0x420bf4,_0x4f8379)=>_0x420bf4['name'][_0x18462b(0x158)](_0x4f8379[_0x18462b(0x10c)]));for(const _0x87672a of _0x1e898d){_0x2f945c+='\x0a---\x20function:\x20'+_0x87672a[_0x18462b(0x10c)]+_0x18462b(0x1b1)+_0x87672a[_0x18462b(0x1a2)]+_0x18462b(0x1d8)+_0x87672a[_0x18462b(0x10c)]+_0x18462b(0x1b1)+_0x87672a[_0x18462b(0xf1)]+'\x0a';}if(!_0x50ed36){let _0x56db57='';a122_0x1debea[_0x18462b(0x1cf)](_0x13289b)&&(_0x56db57=a122_0x1debea[_0x18462b(0x16d)](_0x13289b,'utf-8'));if(a122_0x1debea[_0x18462b(0x1cf)](_0x56b385)){const _0x44bd5a=a122_0x1debea[_0x18462b(0xee)](_0x56b385,{'withFileTypes':!![]}),_0x20cf11=_0x44bd5a[_0x18462b(0x189)](_0x111314=>_0x111314[_0x18462b(0xea)]())[_0x18462b(0xeb)]((_0x41ebbd,_0x5e79a9)=>_0x41ebbd['name'][_0x18462b(0x158)](_0x5e79a9['name']));for(const _0x29f7f6 of _0x20cf11){const _0x3453c6=a122_0x52c3ab[_0x18462b(0x184)](_0x56b385,_0x29f7f6[_0x18462b(0x10c)],'code.js'),_0x4d9492=a122_0x52c3ab[_0x18462b(0x184)](_0x56b385,_0x29f7f6[_0x18462b(0x10c)],_0x18462b(0x1c3));a122_0x1debea['existsSync'](_0x3453c6)&&(_0x56db57+=_0x18462b(0x1a4)+_0x29f7f6[_0x18462b(0x10c)]+_0x18462b(0x1b1)+a122_0x1debea['readFileSync'](_0x3453c6,_0x18462b(0x1b9))+'\x0a'),a122_0x1debea[_0x18462b(0x1cf)](_0x4d9492)&&(_0x56db57+=_0x18462b(0x1d6)+_0x29f7f6[_0x18462b(0x10c)]+_0x18462b(0x1b1)+a122_0x1debea[_0x18462b(0x16d)](_0x4d9492,_0x18462b(0x1b9))+'\x0a');}}const _0x4fe02c=generateDiff(_0x56db57,_0x2f945c);_0x3256f2=hasChanges(_0x4fe02c),_0x3256f2&&(_0x3573ef=formatDiffWithColors(_0x4fe02c));}_0x1ad9cc['push']({'path':_0x1062a5,'content':'','isDir':!![]}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x13289b,'content':_0x257689}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x56b385,'content':'','isDir':!![]});for(const _0x58adab of _0x590a8f[_0x18462b(0x18c)]){const _0x1ed453=a122_0x52c3ab['join'](_0x56b385,sanitizeForFilesystem(_0x58adab[_0x18462b(0x10c)])),_0x4bb00d=a122_0x52c3ab[_0x18462b(0x184)](_0x1ed453,_0x18462b(0xc4)),_0x2d3a26=a122_0x52c3ab[_0x18462b(0x184)](_0x1ed453,_0x18462b(0x1c3));_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x1ed453,'content':'','isDir':!![]}),_0x1ad9cc['push']({'path':_0x4bb00d,'content':_0x58adab[_0x18462b(0x1a2)]}),_0x1ad9cc['push']({'path':_0x2d3a26,'content':_0x58adab[_0x18462b(0xf1)]});}if(a122_0x1debea[_0x18462b(0x1cf)](_0x56b385)){const _0x14f05f=a122_0x1debea['readdirSync'](_0x56b385,{'withFileTypes':!![]}),_0x2a5acc=new Set(_0x590a8f[_0x18462b(0x18c)][_0x18462b(0x1b2)](_0x3d506f=>sanitizeForFilesystem(_0x3d506f[_0x18462b(0x10c)])));for(const _0x2d3f20 of _0x14f05f){if(_0x2d3f20['isDirectory']()&&!_0x2a5acc[_0x18462b(0x112)](_0x2d3f20[_0x18462b(0x10c)])){const _0xb0b338=a122_0x52c3ab[_0x18462b(0x184)](_0x56b385,_0x2d3f20[_0x18462b(0x10c)]);_0x3a0cee[_0x18462b(0xc9)]({'path':_0xb0b338,'isDir':!![]});}}}_0x3ec88d['experimentalKnowledgeBases']['push']({'name':_0x237e6a[_0x18462b(0x11d)][_0x18462b(0x10c)],'outputPath':_0x1062a5,'isNew':_0x50ed36,'hasChanges':_0x3256f2,'diff':_0x3573ef}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x1af)][_0x18462b(0xf4)]++;if(_0x50ed36)_0x3ec88d['counts']['experimentalKnowledgeBases']['new']++;else{if(_0x3256f2)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x1af)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)]['experimentalKnowledgeBases'][_0x18462b(0x1d1)]++;}}for(const _0x447581 of _0x55469c){if(_0x447581[_0x18462b(0x11d)][_0x18462b(0x154)])continue;const _0xd36717=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x39dcea),_0x447581[_0x18462b(0x11d)][_0x18462b(0x10c)]);_0xd36717[_0x18462b(0xfe)]&&this['logger'][_0x18462b(0xff)](_0x18462b(0x15c)+a122_0x52c3ab[_0x18462b(0x1d4)](_0xd36717[_0x18462b(0x1b3)])+'\x20→\x20'+a122_0x52c3ab['basename'](_0xd36717['path']));const _0x2bbe49=_0xd36717['path'],_0x35f617=a122_0x52c3ab[_0x18462b(0x184)](_0x2bbe49,sanitizeForFilesystem(_0x447581[_0x18462b(0x11d)][_0x18462b(0x10c)])+_0x18462b(0x194)),_0x6c7cf5=a122_0x52c3ab[_0x18462b(0x184)](_0x2bbe49,'code.js'),_0x14b1e4=a122_0x52c3ab[_0x18462b(0x184)](_0x2bbe49,'files'),_0xdfeddf=apiExperimentalArtifactToYaml(_0x447581),_0x23077d=toExperimentalArtifactYamlString(_0xdfeddf),_0x3de291=!a122_0x1debea['existsSync'](_0x2bbe49);let _0x4642a2=_0x3de291,_0x2fdadd,_0x4cf8ee=_0x23077d+(_0x18462b(0x141)+_0xdfeddf[_0x18462b(0x1a2)]+'\x0a');const _0x55c7dc=[..._0xdfeddf[_0x18462b(0xc7)]][_0x18462b(0xeb)]((_0x47e3e7,_0x1ddc4e)=>_0x47e3e7['file_name'][_0x18462b(0x158)](_0x1ddc4e[_0x18462b(0x10d)]));for(const _0x3d7755 of _0x55c7dc){_0x4cf8ee+=_0x18462b(0x156)+_0x3d7755[_0x18462b(0x10d)]+_0x18462b(0x1b1)+_0x3d7755[_0x18462b(0xfc)]+'\x0a';}if(!_0x3de291){let _0x18b914='';a122_0x1debea[_0x18462b(0x1cf)](_0x35f617)&&(_0x18b914=a122_0x1debea['readFileSync'](_0x35f617,_0x18462b(0x1b9)));a122_0x1debea[_0x18462b(0x1cf)](_0x6c7cf5)&&(_0x18b914+=_0x18462b(0x141)+a122_0x1debea[_0x18462b(0x16d)](_0x6c7cf5,_0x18462b(0x1b9))+'\x0a');if(a122_0x1debea['existsSync'](_0x14b1e4)){const _0x1bb316=a122_0x1debea[_0x18462b(0xee)](_0x14b1e4),_0x3bc059=_0x1bb316[_0x18462b(0x189)](_0x41900e=>{const _0x4db54e=_0x18462b,_0x5af232=a122_0x52c3ab[_0x4db54e(0x184)](_0x14b1e4,_0x41900e);return a122_0x1debea[_0x4db54e(0x11f)](_0x5af232)['isFile']();})['sort']((_0x1b8c7a,_0x221115)=>_0x1b8c7a[_0x18462b(0x158)](_0x221115));for(const _0x139e4 of _0x3bc059){const _0x178313=a122_0x52c3ab[_0x18462b(0x184)](_0x14b1e4,_0x139e4);_0x18b914+=_0x18462b(0x156)+_0x139e4+_0x18462b(0x1b1)+a122_0x1debea['readFileSync'](_0x178313,'utf-8')+'\x0a';}}const _0xb6f85c=generateDiff(_0x18b914,_0x4cf8ee);_0x4642a2=hasChanges(_0xb6f85c),_0x4642a2&&(_0x2fdadd=formatDiffWithColors(_0xb6f85c));}_0x1ad9cc['push']({'path':_0x2bbe49,'content':'','isDir':!![]}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x35f617,'content':_0x23077d}),_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x6c7cf5,'content':_0xdfeddf[_0x18462b(0x1a2)]});if(_0xdfeddf[_0x18462b(0xc7)][_0x18462b(0xf2)]>0x0){_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x14b1e4,'content':'','isDir':!![]});for(const _0x21ed5e of _0xdfeddf[_0x18462b(0xc7)]){const _0x512283=a122_0x52c3ab['join'](_0x14b1e4,_0x21ed5e['file_name']);_0x1ad9cc[_0x18462b(0xc9)]({'path':_0x512283,'content':_0x21ed5e['text_content']});}}if(a122_0x1debea[_0x18462b(0x1cf)](_0x14b1e4)){const _0x4bbf6a=a122_0x1debea[_0x18462b(0xee)](_0x14b1e4),_0xa5c790=new Set(_0xdfeddf[_0x18462b(0xc7)][_0x18462b(0x1b2)](_0x3fbb06=>_0x3fbb06[_0x18462b(0x10d)]));for(const _0x573922 of _0x4bbf6a){const _0x2d3cae=a122_0x52c3ab['join'](_0x14b1e4,_0x573922);a122_0x1debea[_0x18462b(0x11f)](_0x2d3cae)[_0x18462b(0x12c)]()&&!_0xa5c790[_0x18462b(0x112)](_0x573922)&&_0x3a0cee[_0x18462b(0xc9)]({'path':_0x2d3cae});}}_0x3ec88d[_0x18462b(0x108)][_0x18462b(0xc9)]({'name':_0x447581['attributes'][_0x18462b(0x10c)],'outputPath':_0x2bbe49,'isNew':_0x3de291,'hasChanges':_0x4642a2,'diff':_0x2fdadd}),_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x108)][_0x18462b(0xf4)]++;if(_0x3de291)_0x3ec88d['counts'][_0x18462b(0x108)][_0x18462b(0x132)]++;else{if(_0x4642a2)_0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x108)][_0x18462b(0x1db)]++;else _0x3ec88d[_0x18462b(0x17b)][_0x18462b(0x108)][_0x18462b(0x1d1)]++;}}if(_0x5b5c89?.[_0x18462b(0x1a3)])return _0x3ec88d;a122_0x1debea[_0x18462b(0x144)](_0x39dcea,{'recursive':!![]}),a122_0x1debea[_0x18462b(0x144)](getKnowledgeBasesDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea[_0x18462b(0x144)](getPromptsDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea['mkdirSync'](getIntegrationsDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea[_0x18462b(0x144)](getExperimentalKnowledgeBasesDir(_0x39dcea),{'recursive':!![]}),a122_0x1debea['mkdirSync'](getExperimentalArtifactsDir(_0x39dcea),{'recursive':!![]});const _0x127458=a122_0x52c3ab[_0x18462b(0x184)](_0x39dcea,'tdx.json');a122_0x1debea[_0x18462b(0x187)](_0x127458,createAgentConfigContent(_0x4bd3d8));for(const _0x4b11dd of _0x1ad9cc){if(_0x4b11dd[_0x18462b(0x1aa)])a122_0x1debea[_0x18462b(0x144)](_0x4b11dd[_0x18462b(0xd2)],{'recursive':!![]});else{const _0x4ba8d6=a122_0x52c3ab[_0x18462b(0x1b5)](_0x4b11dd[_0x18462b(0xd2)]);!a122_0x1debea[_0x18462b(0x1cf)](_0x4ba8d6)&&a122_0x1debea[_0x18462b(0x144)](_0x4ba8d6,{'recursive':!![]}),a122_0x1debea['writeFileSync'](_0x4b11dd[_0x18462b(0xd2)],_0x4b11dd[_0x18462b(0x1a5)]);}}for(const _0x5ef2f2 of _0x3a0cee){_0x5ef2f2['isDir']?(a122_0x1debea[_0x18462b(0xe4)](_0x5ef2f2['path'],{'recursive':!![],'force':!![]}),this[_0x18462b(0x114)][_0x18462b(0xff)](_0x18462b(0xd3)+a122_0x52c3ab[_0x18462b(0x1d4)](a122_0x52c3ab[_0x18462b(0x1b5)](_0x5ef2f2[_0x18462b(0xd2)]))+'/'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x5ef2f2[_0x18462b(0xd2)]))):(a122_0x1debea[_0x18462b(0xe4)](_0x5ef2f2['path'],{'force':!![]}),this[_0x18462b(0x114)][_0x18462b(0xff)]('Removed\x20deleted\x20file:\x20'+a122_0x52c3ab['basename'](a122_0x52c3ab[_0x18462b(0x1b5)](_0x5ef2f2[_0x18462b(0xd2)]))+'/'+a122_0x52c3ab[_0x18462b(0x1d4)](_0x5ef2f2[_0x18462b(0xd2)])));}return _0x3ec88d;}async[a122_0x29cadd(0x1a0)](_0x2fbc26,_0x25cd44){const _0x19f69c=a122_0x29cadd,_0x556755=a122_0x52c3ab['join'](_0x2fbc26,_0x19f69c(0xcf));if(!a122_0x1debea['existsSync'](_0x556755))throw new SDKError(ErrorCode[_0x19f69c(0x129)],_0x19f69c(0x1c2)+_0x2fbc26,undefined,{'helpText':_0x19f69c(0x168)});const _0x5d62a9=loadAgentConfig(_0x556755),_0x10e6e9=await this[_0x19f69c(0x178)](_0x5d62a9['llm_project']),_0x2e8ca1=await this[_0x19f69c(0x18e)][_0x19f69c(0xd7)](_0x10e6e9),_0x1ed110=_0x2e8ca1[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x1a417c={'projectName':_0x1ed110,'projectId':_0x10e6e9,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x2e3a8f=[],_0x47aafa=[],_0xaac714=[],_0x199736=[],_0x496450=[],_0x5a20a8=[],_0x3434c3=a122_0x1debea[_0x19f69c(0xee)](_0x2fbc26,{'withFileTypes':!![]});for(const _0x2fc449 of _0x3434c3){if(!_0x2fc449[_0x19f69c(0xea)]())continue;if([_0x19f69c(0x1ab),'prompts',_0x19f69c(0x13a),_0x19f69c(0x1bf),_0x19f69c(0x188)][_0x19f69c(0x15d)](_0x2fc449['name']))continue;const _0xc75bea=a122_0x52c3ab[_0x19f69c(0x184)](_0x2fbc26,_0x2fc449[_0x19f69c(0x10c)]);if(isAgentDir(_0xc75bea)){const _0x4047ae=a122_0x52c3ab[_0x19f69c(0x184)](_0xc75bea,_0x19f69c(0xe0)),_0x2e0cf5=a122_0x52c3ab[_0x19f69c(0x184)](_0xc75bea,_0x19f69c(0x1d9)),_0x1269f7=a122_0x52c3ab['join'](_0xc75bea,'starter_message.md'),_0x2c2eb3=parseAgentYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x4047ae,_0x19f69c(0x1b9)),_0x4047ae),_0xbf16b7=a122_0x1debea['existsSync'](_0x2e0cf5)?a122_0x1debea[_0x19f69c(0x16d)](_0x2e0cf5,_0x19f69c(0x1b9)):'',_0x4188d7=a122_0x1debea[_0x19f69c(0x1cf)](_0x1269f7)?a122_0x1debea[_0x19f69c(0x16d)](_0x1269f7,_0x19f69c(0x1b9)):_0x2c2eb3[_0x19f69c(0x1df)];_0x2e3a8f['push']({'name':_0x2c2eb3['name'],'dir':_0xc75bea,'yaml':_0x2c2eb3,'systemPrompt':_0xbf16b7,'starterMessage':_0x4188d7});}}const _0x54d8b8=getKnowledgeBasesDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x54d8b8)){const _0x231748=a122_0x1debea[_0x19f69c(0xee)](_0x54d8b8);for(const _0x486571 of _0x231748){const _0x518197=a122_0x52c3ab[_0x19f69c(0x184)](_0x54d8b8,_0x486571);if(_0x486571[_0x19f69c(0x191)](_0x19f69c(0x194))){const _0x285854=parseKnowledgeBaseYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x518197,'utf-8'),_0x518197);_0x47aafa[_0x19f69c(0xc9)]({'name':_0x285854['name'],'path':_0x518197,'yaml':_0x285854});}else{if(_0x486571['endsWith'](_0x19f69c(0x16a))){const _0xc16ed4=a122_0x1debea['readFileSync'](_0x518197,_0x19f69c(0x1b9)),{name:_0x30573c,text:_0x46ab72}=parseTextKnowledgeBaseMd(_0xc16ed4,_0x486571);_0xaac714['push']({'name':_0x30573c,'path':_0x518197,'text':_0x46ab72});}}}}const _0x14a680=getPromptsDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x14a680)){const _0xfc4441=a122_0x1debea['readdirSync'](_0x14a680)['filter'](_0x5cb9a2=>_0x5cb9a2[_0x19f69c(0x191)](_0x19f69c(0x194)));for(const _0x3e535d of _0xfc4441){const _0x2c8b8f=a122_0x52c3ab[_0x19f69c(0x184)](_0x14a680,_0x3e535d),_0x5aaaa9=parsePromptYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x2c8b8f,'utf-8'),_0x2c8b8f);_0x199736[_0x19f69c(0xc9)]({'name':_0x5aaaa9['name'],'path':_0x2c8b8f,'yaml':_0x5aaaa9});}}const _0x43b1e6=[],_0x3e504e=getIntegrationsDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x3e504e)){const _0x59bfe0=a122_0x1debea[_0x19f69c(0xee)](_0x3e504e)[_0x19f69c(0x189)](_0x3baee3=>_0x3baee3[_0x19f69c(0x191)](_0x19f69c(0x194)));for(const _0x15712b of _0x59bfe0){const _0x15051a=a122_0x52c3ab[_0x19f69c(0x184)](_0x3e504e,_0x15712b),_0x247577=parseIntegrationYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x15051a,'utf-8'),_0x15051a);if(!SAFE_INTEGRATION_TYPES['includes'](_0x247577[_0x19f69c(0x149)][_0x19f69c(0x102)]())){this[_0x19f69c(0x114)][_0x19f69c(0x1c7)]('Skipping\x20integration\x20\x27'+_0x247577['name']+'\x27\x20('+_0x247577[_0x19f69c(0x149)]+_0x19f69c(0x19a)+(_0x19f69c(0x11e)+SAFE_INTEGRATION_TYPES[_0x19f69c(0x184)](',\x20')+_0x19f69c(0x131))+'Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.');continue;}_0x43b1e6[_0x19f69c(0xc9)]({'name':_0x247577[_0x19f69c(0x10c)],'path':_0x15051a,'yaml':_0x247577});}}const _0x58a89b=getExperimentalKnowledgeBasesDir(_0x2fbc26);if(a122_0x1debea['existsSync'](_0x58a89b)){const _0x2c871f=a122_0x1debea['readdirSync'](_0x58a89b,{'withFileTypes':!![]});for(const _0x49cc3e of _0x2c871f){if(!_0x49cc3e['isDirectory']())continue;const _0x11e083=a122_0x52c3ab[_0x19f69c(0x184)](_0x58a89b,_0x49cc3e[_0x19f69c(0x10c)]),_0x1620ac=a122_0x52c3ab[_0x19f69c(0x184)](_0x11e083,_0x49cc3e['name']+_0x19f69c(0x194)),_0x52b546=a122_0x52c3ab[_0x19f69c(0x184)](_0x11e083,_0x19f69c(0x18c));if(!a122_0x1debea[_0x19f69c(0x1cf)](_0x1620ac))continue;const _0x3cf672=parseExperimentalKnowledgeBaseYaml(a122_0x1debea['readFileSync'](_0x1620ac,_0x19f69c(0x1b9)),_0x1620ac),_0x20d72b=[];if(a122_0x1debea['existsSync'](_0x52b546)){const _0x196eb7=a122_0x1debea[_0x19f69c(0xee)](_0x52b546,{'withFileTypes':!![]});for(const _0x3555cf of _0x196eb7){if(!_0x3555cf[_0x19f69c(0xea)]())continue;const _0x4691df=a122_0x52c3ab[_0x19f69c(0x184)](_0x52b546,_0x3555cf[_0x19f69c(0x10c)]),_0x3d983f=a122_0x52c3ab['join'](_0x4691df,'code.js'),_0x161fe5=a122_0x52c3ab[_0x19f69c(0x184)](_0x4691df,_0x19f69c(0x1c3));a122_0x1debea[_0x19f69c(0x1cf)](_0x3d983f)&&a122_0x1debea[_0x19f69c(0x1cf)](_0x161fe5)&&_0x20d72b[_0x19f69c(0xc9)]({'name':_0x3555cf['name'],'code':a122_0x1debea[_0x19f69c(0x16d)](_0x3d983f,'utf-8'),'json_schema':a122_0x1debea['readFileSync'](_0x161fe5,_0x19f69c(0x1b9))});}}const _0x5dc187={..._0x3cf672,'variables':_0x3cf672[_0x19f69c(0xcd)]||[],'functions':_0x20d72b};_0x496450[_0x19f69c(0xc9)]({'name':_0x3cf672[_0x19f69c(0x10c)],'dir':_0x11e083,'def':_0x5dc187});}}const _0x31b035=getExperimentalArtifactsDir(_0x2fbc26);if(a122_0x1debea[_0x19f69c(0x1cf)](_0x31b035)){const _0x131705=a122_0x1debea['readdirSync'](_0x31b035,{'withFileTypes':!![]});for(const _0x266cb9 of _0x131705){if(!_0x266cb9[_0x19f69c(0xea)]())continue;const _0x4063b5=a122_0x52c3ab[_0x19f69c(0x184)](_0x31b035,_0x266cb9[_0x19f69c(0x10c)]),_0x1e31b4=a122_0x52c3ab[_0x19f69c(0x184)](_0x4063b5,_0x266cb9[_0x19f69c(0x10c)]+_0x19f69c(0x194)),_0x5d6f86=a122_0x52c3ab[_0x19f69c(0x184)](_0x4063b5,_0x19f69c(0xc4)),_0x1d1ae8=a122_0x52c3ab[_0x19f69c(0x184)](_0x4063b5,_0x19f69c(0xc7));if(!a122_0x1debea['existsSync'](_0x1e31b4)||!a122_0x1debea[_0x19f69c(0x1cf)](_0x5d6f86))continue;const _0x441646=parseExperimentalArtifactYaml(a122_0x1debea[_0x19f69c(0x16d)](_0x1e31b4,'utf-8'),_0x1e31b4),_0x4a49ca=a122_0x1debea[_0x19f69c(0x16d)](_0x5d6f86,_0x19f69c(0x1b9)),_0x2dcb61=[];if(a122_0x1debea[_0x19f69c(0x1cf)](_0x1d1ae8)){const _0x12682a=a122_0x1debea['readdirSync'](_0x1d1ae8);for(const _0x1a3908 of _0x12682a){const _0x12c409=a122_0x52c3ab['join'](_0x1d1ae8,_0x1a3908);a122_0x1debea[_0x19f69c(0x11f)](_0x12c409)['isFile']()&&_0x2dcb61[_0x19f69c(0xc9)]({'file_name':_0x1a3908,'text_content':a122_0x1debea[_0x19f69c(0x16d)](_0x12c409,'utf-8')});}}const _0x1c15e2={..._0x441646,'code':_0x4a49ca,'files':_0x2dcb61};_0x5a20a8['push']({'name':_0x441646[_0x19f69c(0x10c)],'dir':_0x4063b5,'def':_0x1c15e2});}}const _0x467111=await this['client'][_0x19f69c(0x103)](_0x10e6e9),_0x64df13=await this[_0x19f69c(0x18e)][_0x19f69c(0x145)](_0x10e6e9),_0x1496a5=await this[_0x19f69c(0x18e)][_0x19f69c(0x1c0)](_0x10e6e9),_0x38b8ce=await this[_0x19f69c(0x18e)][_0x19f69c(0xce)](_0x10e6e9),_0x141a85=await this[_0x19f69c(0x18e)]['listIntegrations'](_0x10e6e9),_0x17b2ca=await safeListOrEmpty(()=>this['client'][_0x19f69c(0x182)](_0x10e6e9)),_0x164878=await safeListOrEmpty(()=>this[_0x19f69c(0x18e)][_0x19f69c(0x1a6)](_0x10e6e9)),_0x396fba=await fetchAllToolTargetMaps((_0x25adaa,_0x3edf81)=>this[_0x19f69c(0x18e)][_0x19f69c(0xfa)](_0x25adaa,_0x3edf81),_0x10e6e9),_0x45bc83=new Map(),_0x44c449=new Map(),_0x2e1511=new Map(),_0x3a9508=new Map(),_0x4c7cd4=new Map(),_0x27a1a7=new Map(),_0x3ecf2a=new Map();for(const _0x4f5a79 of _0x467111){_0x45bc83[_0x19f69c(0x107)](_0x4f5a79[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x4f5a79);}for(const _0x4e2b53 of _0x64df13){_0x44c449['set'](_0x4e2b53[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x4e2b53);}for(const _0x3a586d of _0x1496a5){_0x2e1511[_0x19f69c(0x107)](_0x3a586d[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x3a586d);}for(const _0x5038d3 of _0x38b8ce){_0x3a9508['set'](_0x5038d3[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x5038d3);}for(const _0x34e162 of _0x141a85){_0x4c7cd4[_0x19f69c(0x107)](_0x34e162[_0x19f69c(0x11d)]['serviceType'][_0x19f69c(0x102)](),_0x34e162);}for(const _0x10277d of _0x17b2ca){_0x27a1a7[_0x19f69c(0x107)](_0x10277d[_0x19f69c(0x11d)][_0x19f69c(0x10c)],_0x10277d);}for(const _0x5a2953 of _0x164878){_0x3ecf2a[_0x19f69c(0x107)](_0x5a2953[_0x19f69c(0x11d)]['name'],_0x5a2953);}const _0xdce501=new Map(),_0x595c8d=new Map();for(const _0x5b0cb8 of _0x467111){_0xdce501[_0x19f69c(0x107)](_0x5b0cb8[_0x19f69c(0x11d)]['name'],_0x5b0cb8['id']),_0x595c8d[_0x19f69c(0x107)](_0x5b0cb8['id'],_0x5b0cb8['attributes'][_0x19f69c(0x10c)]);}const _0x1f8efe=new Map(),_0x55005f=new Map();for(const _0x319616 of _0x38b8ce){_0x1f8efe[_0x19f69c(0x107)](_0x319616[_0x19f69c(0x11d)]['name'],_0x319616['id']),_0x55005f['set'](_0x319616['id'],_0x319616['attributes'][_0x19f69c(0x10c)]);}const _0xc19d7a=_0x396fba[_0x19f69c(0x13e)][_0x19f69c(0x12a)]||new Map(),_0x1a9c8=_0x396fba[_0x19f69c(0x13e)]['TextKnowledgeBase']||new Map(),_0x2cfe31=_0x396fba[_0x19f69c(0x13e)]['ExperimentalKnowledgeBase']||new Map(),_0x3caa44=new Map(),_0x5ccf0c={'resolveToolTargetName':buildNameResolver({..._0x396fba[_0x19f69c(0x139)],'Agent':_0x595c8d}),'resolvePromptName':async _0x51c8f8=>_0x55005f[_0x19f69c(0x14e)](_0x51c8f8),'onWarning':_0x448823=>this[_0x19f69c(0x114)][_0x19f69c(0x1c7)](_0x448823)};let _0x369de0=[];const _0x40e4e5={'projectId':_0x10e6e9,'resolveToolTargetId':buildIdResolver({..._0x396fba['nameToId'],'Agent':_0xdce501}),'resolvePromptId':async _0x5743e7=>_0x1f8efe[_0x19f69c(0x14e)](_0x5743e7),'onWarning':_0x3a6e75=>{const _0x49fdcc=_0x19f69c;this[_0x49fdcc(0x114)][_0x49fdcc(0x1c7)](_0x3a6e75),_0x369de0[_0x49fdcc(0xc9)](_0x3a6e75);}},{resolved:_0x315789,unresolved:_0x3aeafc}=resolveAgentDependencies(_0x2e3a8f,new Set(_0x45bc83[_0x19f69c(0x1b4)]()));for(const {agent:_0x1860ac,missingDeps:_0x2b9203}of _0x3aeafc){_0x1a417c['agents'][_0x19f69c(0xc9)]({'agentName':_0x1860ac[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x19f69c(0x1a8)+_0x2b9203[_0x19f69c(0x184)](',\x20')+'.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.'}),_0x1a417c[_0x19f69c(0x17b)]['agents'][_0x19f69c(0xd4)]++;}for(const _0x36d89c of _0x47aafa){const _0x115a0e=_0x44c449[_0x19f69c(0x14e)](_0x36d89c['yaml'][_0x19f69c(0x10c)]),_0x9f4540=a122_0x1debea['readFileSync'](_0x36d89c['path'],_0x19f69c(0x1b9));if(_0x115a0e){const _0x3139dc=apiKnowledgeBaseToYaml(_0x115a0e),_0x1990f3=toKnowledgeBaseYamlString(_0x3139dc),_0x4c71dc=generateDiff(_0x1990f3,_0x9f4540),_0x4957f8=hasChanges(_0x4c71dc);_0x4957f8?(_0x1a417c[_0x19f69c(0xbf)]['push']({'name':_0x36d89c['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x115a0e['id'],'diff':formatDiffWithColors(_0x4c71dc)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0xbf)][_0x19f69c(0x1db)]++):(_0x1a417c[_0x19f69c(0xbf)]['push']({'name':_0x36d89c['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1d1),'id':_0x115a0e['id']}),_0x1a417c[_0x19f69c(0x17b)]['knowledgeBases']['unchanged']++);}else _0x1a417c[_0x19f69c(0xbf)][_0x19f69c(0xc9)]({'name':_0x36d89c[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1)}),_0x1a417c['counts'][_0x19f69c(0xbf)][_0x19f69c(0xd1)]++;}for(const _0x2d4a17 of _0xaac714){const _0x362ea8=_0x2e1511[_0x19f69c(0x14e)](_0x2d4a17['name']),_0x5bb600=a122_0x1debea[_0x19f69c(0x16d)](_0x2d4a17[_0x19f69c(0xd2)],'utf-8');if(_0x362ea8){const _0xf0c1d3=toTextKnowledgeBaseMd(_0x362ea8['attributes'][_0x19f69c(0x10c)],_0x362ea8[_0x19f69c(0x11d)][_0x19f69c(0xc1)]),_0x121af0=generateDiff(_0xf0c1d3,_0x5bb600),_0x373131=hasChanges(_0x121af0);_0x373131?(_0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x2d4a17[_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x362ea8['id'],'diff':formatDiffWithColors(_0x121af0)}),_0x1a417c[_0x19f69c(0x17b)]['textKnowledgeBases'][_0x19f69c(0x1db)]++):(_0x1a417c['textKnowledgeBases']['push']({'name':_0x2d4a17['name'],'action':'unchanged','id':_0x362ea8['id']}),_0x1a417c[_0x19f69c(0x17b)]['textKnowledgeBases'][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x2d4a17[_0x19f69c(0x10c)],'action':_0x19f69c(0xd1)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x128)][_0x19f69c(0xd1)]++;}for(const _0x52f09a of _0x315789){const _0x5449db=_0x45bc83[_0x19f69c(0x14e)](_0x52f09a['yaml']['name']),_0x4ae434=a122_0x52c3ab[_0x19f69c(0x184)](_0x52f09a[_0x19f69c(0x13c)],_0x19f69c(0xe0)),_0x136aa8=a122_0x1debea['readFileSync'](_0x4ae434,_0x19f69c(0x1b9)),_0x22b098=_0x52f09a['systemPrompt'],_0x7b7fc=_0x19f69c(0x157)+_0x22b098+_0x19f69c(0x16c)+_0x136aa8;if(_0x5449db){const {yaml:_0x17fdb3,systemPrompt:_0x157012}=await agentResponseToDef(_0x5449db,_0x5ccf0c),_0x2ada0c=toAgentYamlString(_0x17fdb3),_0x5c2cec='#\x20prompt.md\x0a'+_0x157012+_0x19f69c(0x16c)+_0x2ada0c,_0x40d4e8=generateDiff(_0x5c2cec,_0x7b7fc),_0xba8e46=hasChanges(_0x40d4e8);_0xba8e46?(_0x1a417c[_0x19f69c(0x193)]['push']({'agentName':_0x52f09a['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'agentId':_0x5449db['id'],'diff':formatDiffWithColors(_0x40d4e8)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)]['updated']++):(_0x1a417c['agents'][_0x19f69c(0xc9)]({'agentName':_0x52f09a[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1d1),'agentId':_0x5449db['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x52f09a[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)][_0x19f69c(0xd1)]++;}for(const _0x5ccdf3 of _0x199736){const _0x194bff=_0x3a9508[_0x19f69c(0x14e)](_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x34e9b4=a122_0x1debea[_0x19f69c(0x16d)](_0x5ccdf3['path'],_0x19f69c(0x1b9));if(_0x194bff){const _0x446ed2=await apiPromptToYaml(_0x194bff,_0x5ccf0c);if(!_0x446ed2){_0x1a417c[_0x19f69c(0x122)][_0x19f69c(0xc9)]({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':'updated','id':_0x194bff['id']}),_0x1a417c[_0x19f69c(0x17b)]['prompts'][_0x19f69c(0x1db)]++;continue;}const _0xbf7587=toPromptYamlString(_0x446ed2),_0x67d434=generateDiff(_0xbf7587,_0x34e9b4),_0x3ea82a=hasChanges(_0x67d434);_0x3ea82a?(_0x1a417c['prompts']['push']({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x194bff['id'],'diff':formatDiffWithColors(_0x67d434)}),_0x1a417c['counts'][_0x19f69c(0x122)][_0x19f69c(0x1db)]++):(_0x1a417c[_0x19f69c(0x122)][_0x19f69c(0xc9)]({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1d1),'id':_0x194bff['id']}),_0x1a417c[_0x19f69c(0x17b)]['prompts'][_0x19f69c(0x1d1)]++);}else _0x1a417c['prompts'][_0x19f69c(0xc9)]({'name':_0x5ccdf3[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':'created'}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x122)]['created']++;}for(const _0x154c76 of _0x43b1e6){const _0x24e7de=_0x4c7cd4[_0x19f69c(0x14e)](_0x154c76['yaml'][_0x19f69c(0x149)]),_0x388ece=a122_0x1debea['readFileSync'](_0x154c76['path'],'utf-8');if(_0x24e7de){const _0x3e2bd4=await apiIntegrationToYaml(_0x24e7de,_0x5ccf0c),_0x34bf5f=toIntegrationYamlString(_0x3e2bd4),_0x43a6f2=generateDiff(_0x34bf5f,_0x388ece),_0x2e8cbe=hasChanges(_0x43a6f2);_0x2e8cbe?(_0x1a417c[_0x19f69c(0x13a)][_0x19f69c(0xc9)]({'name':_0x154c76['yaml'][_0x19f69c(0x149)],'action':_0x19f69c(0x1db),'id':_0x24e7de['id'],'diff':formatDiffWithColors(_0x43a6f2)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)]['updated']++):(_0x1a417c[_0x19f69c(0x13a)]['push']({'name':_0x154c76[_0x19f69c(0x175)][_0x19f69c(0x149)],'action':_0x19f69c(0x1d1),'id':_0x24e7de['id']}),_0x1a417c['counts']['integrations'][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x13a)][_0x19f69c(0xc9)]({'name':_0x154c76['yaml']['service_type'],'action':_0x19f69c(0xd1)}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)][_0x19f69c(0xd1)]++;}for(const _0x2ab373 of _0x496450){const _0x15a223=_0x27a1a7['get'](_0x2ab373[_0x19f69c(0x116)][_0x19f69c(0x10c)]),_0x53c159=toExperimentalKnowledgeBaseYamlString(_0x2ab373['def']);let _0x14a29b=_0x53c159;for(const _0x3acddf of _0x2ab373['def']['functions']){_0x14a29b+='\x0a---\x20function:\x20'+_0x3acddf[_0x19f69c(0x10c)]+_0x19f69c(0x1b1)+_0x3acddf['code']+_0x19f69c(0x1d8)+_0x3acddf['name']+'\x20---\x0a'+_0x3acddf[_0x19f69c(0xf1)]+'\x0a';}if(_0x15a223){const _0x4bdaf1=apiExperimentalKnowledgeBaseToYaml(_0x15a223),_0x4a6295=toExperimentalKnowledgeBaseYamlString(_0x4bdaf1);let _0x4f80be=_0x4a6295;for(const _0x5ca12a of _0x4bdaf1['functions']){_0x4f80be+=_0x19f69c(0x1a4)+_0x5ca12a[_0x19f69c(0x10c)]+_0x19f69c(0x1b1)+_0x5ca12a[_0x19f69c(0x1a2)]+_0x19f69c(0x1d8)+_0x5ca12a['name']+_0x19f69c(0x1b1)+_0x5ca12a[_0x19f69c(0xf1)]+'\x0a';}const _0x507d45=generateDiff(_0x4f80be,_0x14a29b),_0x40bc88=hasChanges(_0x507d45);_0x40bc88?(_0x1a417c[_0x19f69c(0x1af)][_0x19f69c(0xc9)]({'name':_0x2ab373[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'updated','id':_0x15a223['id'],'diff':formatDiffWithColors(_0x507d45)}),_0x1a417c['counts'][_0x19f69c(0x1af)][_0x19f69c(0x1db)]++):(_0x1a417c['experimentalKnowledgeBases'][_0x19f69c(0xc9)]({'name':_0x2ab373[_0x19f69c(0x116)]['name'],'action':_0x19f69c(0x1d1),'id':_0x15a223['id']}),_0x1a417c['counts'][_0x19f69c(0x1af)]['unchanged']++);}else _0x1a417c[_0x19f69c(0x1af)]['push']({'name':_0x2ab373[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'created'}),_0x1a417c['counts'][_0x19f69c(0x1af)][_0x19f69c(0xd1)]++;}for(const _0x30fbf1 of _0x5a20a8){const _0x5451d9=_0x3ecf2a['get'](_0x30fbf1[_0x19f69c(0x116)]['name']),_0x32c66d=toExperimentalArtifactYamlString(_0x30fbf1['def']);let _0x2933b0=_0x32c66d+('\x0a---\x20code\x20---\x0a'+_0x30fbf1[_0x19f69c(0x116)][_0x19f69c(0x1a2)]+'\x0a');for(const _0x84ec83 of _0x30fbf1[_0x19f69c(0x116)]['files']){_0x2933b0+=_0x19f69c(0x156)+_0x84ec83[_0x19f69c(0x10d)]+'\x20---\x0a'+_0x84ec83[_0x19f69c(0xfc)]+'\x0a';}if(_0x5451d9){const _0x1391b9=apiExperimentalArtifactToYaml(_0x5451d9),_0x5828fb=toExperimentalArtifactYamlString(_0x1391b9);let _0x2ca6af=_0x5828fb+(_0x19f69c(0x141)+_0x1391b9[_0x19f69c(0x1a2)]+'\x0a');for(const _0x5ee243 of _0x1391b9[_0x19f69c(0xc7)]){_0x2ca6af+='---\x20file:\x20'+_0x5ee243[_0x19f69c(0x10d)]+_0x19f69c(0x1b1)+_0x5ee243[_0x19f69c(0xfc)]+'\x0a';}const _0x353669=generateDiff(_0x2ca6af,_0x2933b0),_0x2361d4=hasChanges(_0x353669);_0x2361d4?(_0x1a417c['experimentalArtifacts']['push']({'name':_0x30fbf1[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'updated','id':_0x5451d9['id'],'diff':formatDiffWithColors(_0x353669)}),_0x1a417c[_0x19f69c(0x17b)]['experimentalArtifacts'][_0x19f69c(0x1db)]++):(_0x1a417c[_0x19f69c(0x108)][_0x19f69c(0xc9)]({'name':_0x30fbf1['def']['name'],'action':_0x19f69c(0x1d1),'id':_0x5451d9['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x108)][_0x19f69c(0x1d1)]++);}else _0x1a417c[_0x19f69c(0x108)][_0x19f69c(0xc9)]({'name':_0x30fbf1[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'created'}),_0x1a417c[_0x19f69c(0x17b)]['experimentalArtifacts']['created']++;}if(_0x25cd44?.[_0x19f69c(0x1a3)])return _0x1a417c;_0x1a417c['knowledgeBases']=[],_0x1a417c[_0x19f69c(0x128)]=[],_0x1a417c[_0x19f69c(0x122)]=[],_0x1a417c[_0x19f69c(0x13a)]=[],_0x1a417c[_0x19f69c(0x1af)]=[],_0x1a417c[_0x19f69c(0x108)]=[];const _0x57a1cf=_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0x189)](_0x1b7aeb=>_0x1b7aeb[_0x19f69c(0xf5)]===_0x19f69c(0x118));_0x1a417c[_0x19f69c(0x193)]=_0x57a1cf,_0x1a417c[_0x19f69c(0x17b)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x57a1cf['length']},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}};for(const _0x579709 of _0x47aafa){try{const _0x4a1ca6=_0x44c449[_0x19f69c(0x14e)](_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x55e1e4=yamlKnowledgeBaseToApi(_0x579709['yaml'],_0x10e6e9);if(_0x4a1ca6)await this[_0x19f69c(0x18e)]['updateKnowledgeBase'](_0x4a1ca6['id'],_0x55e1e4),_0xc19d7a['set'](_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0x4a1ca6['id']),_0x1a417c['knowledgeBases']['push']({'name':_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x4a1ca6['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0xbf)][_0x19f69c(0x1db)]++;else{const _0x5bac3f=await this['client'][_0x19f69c(0xe5)](_0x55e1e4);_0xc19d7a[_0x19f69c(0x107)](_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0x5bac3f['id']),_0x1a417c[_0x19f69c(0xbf)][_0x19f69c(0xc9)]({'name':_0x579709['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1),'id':_0x5bac3f['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0xbf)][_0x19f69c(0xd1)]++;}}catch(_0x2f54b7){_0x1a417c[_0x19f69c(0xbf)][_0x19f69c(0xc9)]({'name':_0x579709[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x2f54b7['message']}),_0x1a417c['counts'][_0x19f69c(0xbf)][_0x19f69c(0xd4)]++;}}for(const _0x95d1f3 of _0xaac714){try{const _0x8e51f9=_0x2e1511[_0x19f69c(0x14e)](_0x95d1f3[_0x19f69c(0x10c)]),_0x333ac1=yamlTextKnowledgeBaseToApi({'name':_0x95d1f3['name'],'text':_0x95d1f3[_0x19f69c(0xc1)]},_0x10e6e9);if(_0x8e51f9)await this[_0x19f69c(0x18e)][_0x19f69c(0x153)](_0x8e51f9['id'],_0x333ac1),_0x1a9c8[_0x19f69c(0x107)](_0x95d1f3[_0x19f69c(0x10c)],_0x8e51f9['id']),_0x1a417c['textKnowledgeBases']['push']({'name':_0x95d1f3['name'],'action':_0x19f69c(0x1db),'id':_0x8e51f9['id']}),_0x1a417c['counts'][_0x19f69c(0x128)][_0x19f69c(0x1db)]++;else{const _0x2be46a=await this['client']['createTextKnowledgeBase'](_0x333ac1);_0x1a9c8[_0x19f69c(0x107)](_0x95d1f3[_0x19f69c(0x10c)],_0x2be46a['id']),_0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x95d1f3['name'],'action':_0x19f69c(0xd1),'id':_0x2be46a['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x128)][_0x19f69c(0xd1)]++;}}catch(_0x55ae9f){_0x1a417c[_0x19f69c(0x128)][_0x19f69c(0xc9)]({'name':_0x95d1f3[_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x55ae9f[_0x19f69c(0x113)]}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x128)][_0x19f69c(0xd4)]++;}}for(const _0x45cc8b of _0x496450){try{const _0x29134a=_0x27a1a7[_0x19f69c(0x14e)](_0x45cc8b[_0x19f69c(0x116)][_0x19f69c(0x10c)]),_0x1a7b77=yamlExperimentalKnowledgeBaseToApi(_0x45cc8b['def'],_0x10e6e9);if(_0x29134a)await this[_0x19f69c(0x18e)][_0x19f69c(0x15e)](_0x29134a['id'],_0x1a7b77),_0x2cfe31['set'](_0x45cc8b['def']['name'],_0x29134a['id']),_0x1a417c['experimentalKnowledgeBases']['push']({'name':_0x45cc8b['def'][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x29134a['id']}),_0x1a417c['counts'][_0x19f69c(0x1af)][_0x19f69c(0x1db)]++;else{const _0xe9cd22=await this[_0x19f69c(0x18e)][_0x19f69c(0xe8)](_0x1a7b77);_0x2cfe31[_0x19f69c(0x107)](_0x45cc8b['def'][_0x19f69c(0x10c)],_0xe9cd22['id']),_0x1a417c[_0x19f69c(0x1af)][_0x19f69c(0xc9)]({'name':_0x45cc8b[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'created','id':_0xe9cd22['id']}),_0x1a417c[_0x19f69c(0x17b)]['experimentalKnowledgeBases'][_0x19f69c(0xd1)]++;}}catch(_0x438634){_0x1a417c[_0x19f69c(0x1af)]['push']({'name':_0x45cc8b[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':'error','error':_0x438634['message']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x1af)]['errors']++;}}for(const _0x5711c3 of _0x5a20a8){try{const _0x14765f=_0x3ecf2a[_0x19f69c(0x14e)](_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)]),_0x182668=yamlExperimentalArtifactToApi(_0x5711c3['def'],_0x10e6e9);if(_0x14765f)await this[_0x19f69c(0x18e)]['updateExperimentalArtifact'](_0x14765f['id'],_0x182668),_0x3caa44['set'](_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)],_0x14765f['id']),_0x1a417c['experimentalArtifacts'][_0x19f69c(0xc9)]({'name':_0x5711c3[_0x19f69c(0x116)]['name'],'action':_0x19f69c(0x1db),'id':_0x14765f['id']}),_0x1a417c[_0x19f69c(0x17b)]['experimentalArtifacts'][_0x19f69c(0x1db)]++;else{const _0x148f37=await this['client'][_0x19f69c(0x110)](_0x182668);_0x3caa44['set'](_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)],_0x148f37['id']),_0x1a417c[_0x19f69c(0x108)]['push']({'name':_0x5711c3[_0x19f69c(0x116)]['name'],'action':_0x19f69c(0xd1),'id':_0x148f37['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x108)][_0x19f69c(0xd1)]++;}}catch(_0x2745a5){_0x1a417c['experimentalArtifacts'][_0x19f69c(0xc9)]({'name':_0x5711c3[_0x19f69c(0x116)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x2745a5[_0x19f69c(0x113)]}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x108)]['errors']++;}}for(const _0x22b724 of _0x315789){_0x369de0=[];try{const _0x223b19=_0x45bc83[_0x19f69c(0x14e)](_0x22b724[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x1c1f8b=await agentDefToRequest(_0x22b724[_0x19f69c(0x175)],_0x22b724[_0x19f69c(0xfb)],_0x22b724[_0x19f69c(0x1c8)],_0x40e4e5);if(_0x223b19)await this[_0x19f69c(0x18e)][_0x19f69c(0xf0)](_0x223b19['id'],_0x1c1f8b),_0xdce501[_0x19f69c(0x107)](_0x22b724['yaml'][_0x19f69c(0x10c)],_0x223b19['id']),_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x22b724[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'agentId':_0x223b19['id'],'warnings':_0x369de0[_0x19f69c(0xf2)]>0x0?_0x369de0:undefined}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)]['updated']++;else{const _0x259dd6=await this[_0x19f69c(0x18e)][_0x19f69c(0x18d)](_0x1c1f8b);_0xdce501[_0x19f69c(0x107)](_0x22b724['yaml'][_0x19f69c(0x10c)],_0x259dd6['id']),_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x22b724['yaml'][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1),'agentId':_0x259dd6['id'],'warnings':_0x369de0[_0x19f69c(0xf2)]>0x0?_0x369de0:undefined}),_0x1a417c['counts'][_0x19f69c(0x193)][_0x19f69c(0xd1)]++;}}catch(_0x4a929c){_0x1a417c[_0x19f69c(0x193)][_0x19f69c(0xc9)]({'agentName':_0x22b724[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':'error','error':_0x4a929c['message'],'warnings':_0x369de0[_0x19f69c(0xf2)]>0x0?_0x369de0:undefined}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x193)]['errors']++;}}for(const _0x386265 of _0x199736){try{const _0x101a8f=_0x3a9508[_0x19f69c(0x14e)](_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)]),_0x751af5=await yamlPromptToApi(_0x386265['yaml'],_0x10e6e9,_0x40e4e5);if(!_0x751af5){_0x1a417c[_0x19f69c(0x122)]['push']({'name':_0x386265[_0x19f69c(0x175)]['name'],'action':_0x19f69c(0x118),'error':_0x19f69c(0x120)}),_0x1a417c[_0x19f69c(0x17b)]['prompts'][_0x19f69c(0xd4)]++;continue;}if(_0x101a8f)await this[_0x19f69c(0x18e)][_0x19f69c(0x190)](_0x101a8f['id'],_0x751af5),_0x1f8efe[_0x19f69c(0x107)](_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0x101a8f['id']),_0x1a417c[_0x19f69c(0x122)][_0x19f69c(0xc9)]({'name':_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x1db),'id':_0x101a8f['id']}),_0x1a417c['counts'][_0x19f69c(0x122)][_0x19f69c(0x1db)]++;else{const _0xfd092c=await this[_0x19f69c(0x18e)][_0x19f69c(0x1b7)](_0x751af5);_0x1f8efe[_0x19f69c(0x107)](_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],_0xfd092c['id']),_0x1a417c[_0x19f69c(0x122)]['push']({'name':_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0xd1),'id':_0xfd092c['id']}),_0x1a417c[_0x19f69c(0x17b)]['prompts']['created']++;}}catch(_0x3c6b99){_0x1a417c[_0x19f69c(0x122)]['push']({'name':_0x386265[_0x19f69c(0x175)][_0x19f69c(0x10c)],'action':_0x19f69c(0x118),'error':_0x3c6b99['message']}),_0x1a417c['counts'][_0x19f69c(0x122)]['errors']++;}}for(const _0x1239d5 of _0x43b1e6){try{const _0x49ae91=_0x4c7cd4[_0x19f69c(0x14e)](_0x1239d5[_0x19f69c(0x175)][_0x19f69c(0x149)]),_0x10f0fc=await yamlIntegrationToApi(_0x1239d5[_0x19f69c(0x175)],_0x10e6e9,_0x40e4e5);if(_0x49ae91){await this[_0x19f69c(0x18e)][_0x19f69c(0x15a)](_0x49ae91['id']);const _0x1f697b=await this['client']['createIntegration'](_0x10f0fc);_0x1a417c[_0x19f69c(0x13a)]['push']({'name':_0x1239d5[_0x19f69c(0x175)][_0x19f69c(0x149)],'action':_0x19f69c(0x1db),'id':_0x1f697b['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)]['updated']++;}else{const _0x1511db=await this[_0x19f69c(0x18e)][_0x19f69c(0x1d0)](_0x10f0fc);_0x1a417c[_0x19f69c(0x13a)][_0x19f69c(0xc9)]({'name':_0x1239d5['yaml'][_0x19f69c(0x149)],'action':_0x19f69c(0xd1),'id':_0x1511db['id']}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)][_0x19f69c(0xd1)]++;}}catch(_0x389a5b){_0x1a417c['integrations']['push']({'name':_0x1239d5[_0x19f69c(0x175)]['service_type'],'action':'error','error':_0x389a5b[_0x19f69c(0x113)]}),_0x1a417c[_0x19f69c(0x17b)][_0x19f69c(0x13a)]['errors']++;}}return _0x1a417c;}async[a122_0x29cadd(0x198)](_0x3fb3ee,_0x238a29,_0x5c6656,_0x527496){const _0x1c6eb9=a122_0x29cadd,{projectId:_0x37ab4d,project:_0x311f40}=await this[_0x1c6eb9(0xc5)](_0x3fb3ee),_0x341a37=_0x311f40['attributes'][_0x1c6eb9(0x10c)],_0x1d6f1d=await this[_0x1c6eb9(0x18e)][_0x1c6eb9(0x103)](_0x37ab4d),_0x4e2a6a=_0x1d6f1d[_0x1c6eb9(0x176)](_0x2691be=>_0x2691be[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]===_0x238a29);if(!_0x4e2a6a)throw new SDKError(ErrorCode[_0x1c6eb9(0xef)],_0x1c6eb9(0x169)+_0x238a29,undefined,{'helpText':_0x1c6eb9(0x105)+_0x1d6f1d[_0x1c6eb9(0x1b2)](_0x2da930=>_0x2da930['attributes'][_0x1c6eb9(0x10c)])[_0x1c6eb9(0x184)](',\x20')});let _0x4057b4;if(_0x5c6656)_0x4057b4=_0x5c6656;else{const _0x23a91d=a122_0x52c3ab['join'](process['cwd'](),_0x1c6eb9(0x193)),_0x494c04=getSanitizedPathWithMigration(_0x23a91d,_0x341a37);_0x494c04[_0x1c6eb9(0xfe)]&&this[_0x1c6eb9(0x114)][_0x1c6eb9(0xff)]('Renamed\x20folder:\x20'+a122_0x52c3ab[_0x1c6eb9(0x1d4)](_0x494c04[_0x1c6eb9(0x1b3)])+_0x1c6eb9(0x1ce)+a122_0x52c3ab[_0x1c6eb9(0x1d4)](_0x494c04[_0x1c6eb9(0xd2)])),_0x4057b4=_0x494c04[_0x1c6eb9(0xd2)];}const _0x1afe63=getSanitizedPathWithMigration(_0x4057b4,_0x238a29);_0x1afe63['renamed']&&this[_0x1c6eb9(0x114)][_0x1c6eb9(0xff)](_0x1c6eb9(0x123)+a122_0x52c3ab[_0x1c6eb9(0x1d4)](_0x1afe63[_0x1c6eb9(0x1b3)])+_0x1c6eb9(0x1ce)+a122_0x52c3ab['basename'](_0x1afe63[_0x1c6eb9(0xd2)]));const _0x31dc02=_0x1afe63[_0x1c6eb9(0xd2)],_0x4cdcbf=new Map(),_0x584b9f=new Map(),_0x56c539=await this['client'][_0x1c6eb9(0x145)](_0x37ab4d),_0x356634=await this['client']['listTextKnowledgeBases'](_0x37ab4d),_0x1e45ca=await safeListOrEmpty(()=>this[_0x1c6eb9(0x18e)][_0x1c6eb9(0x182)](_0x37ab4d)),_0x1f2c69=new Map(),_0x2f02fc=new Map();for(const _0x421e35 of _0x56c539){_0x4cdcbf[_0x1c6eb9(0x107)](_0x421e35['id'],_0x421e35['attributes'][_0x1c6eb9(0x10c)]);}for(const _0xf6d8e7 of _0x356634){_0x1f2c69['set'](_0xf6d8e7['id'],_0xf6d8e7[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]);}for(const _0x3a1fa4 of _0x1e45ca){_0x2f02fc[_0x1c6eb9(0x107)](_0x3a1fa4['id'],_0x3a1fa4[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]);}for(const _0x2dc707 of _0x1d6f1d){_0x584b9f['set'](_0x2dc707['id'],_0x2dc707[_0x1c6eb9(0x11d)][_0x1c6eb9(0x10c)]);}const _0x3beda8={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x4cdcbf,'TextKnowledgeBase':_0x1f2c69,'Agent':_0x584b9f,'ExperimentalKnowledgeBase':_0x2f02fc}),'resolvePromptName':async()=>undefined,'onWarning':_0x46a867=>this[_0x1c6eb9(0x114)][_0x1c6eb9(0x1c7)](_0x46a867)},_0x1e55f2=a122_0x52c3ab[_0x1c6eb9(0x184)](_0x31dc02,_0x1c6eb9(0x1d9)),_0x14900f=a122_0x52c3ab[_0x1c6eb9(0x184)](_0x31dc02,_0x1c6eb9(0xe0)),_0x4b9f69=a122_0x52c3ab['join'](_0x31dc02,_0x1c6eb9(0xdc)),_0x21cf33=!a122_0x1debea[_0x1c6eb9(0x1cf)](_0x14900f);if(_0x527496?.[_0x1c6eb9(0x1a3)])return{'agentName':_0x238a29,'outputPath':_0x31dc02,'isNew':_0x21cf33,'hasChanges':!![]};a122_0x1debea['mkdirSync'](_0x4057b4,{'recursive':!![]}),a122_0x1debea[_0x1c6eb9(0x144)](_0x31dc02,{'recursive':!![]});const _0x1e1a34=a122_0x52c3ab['join'](_0x4057b4,_0x1c6eb9(0xcf));!a122_0x1debea[_0x1c6eb9(0x1cf)](_0x1e1a34)&&a122_0x1debea[_0x1c6eb9(0x187)](_0x1e1a34,createAgentConfigContent(_0x3fb3ee));const {yaml:_0x122fa3,systemPrompt:_0x37e020,starterMessage:_0x469c72}=await agentResponseToDef(_0x4e2a6a,_0x3beda8);let _0x1ac309=_0x21cf33;if(!_0x21cf33){const _0x2b0ee9=a122_0x1debea[_0x1c6eb9(0x1cf)](_0x1e55f2)?a122_0x1debea[_0x1c6eb9(0x16d)](_0x1e55f2,_0x1c6eb9(0x1b9)):'',_0x4ddffc=a122_0x1debea[_0x1c6eb9(0x16d)](_0x14900f,'utf-8');_0x1ac309=_0x2b0ee9!==_0x37e020||_0x4ddffc!==toAgentYamlString(_0x122fa3);}a122_0x1debea[_0x1c6eb9(0x187)](_0x1e55f2,_0x37e020),a122_0x1debea[_0x1c6eb9(0x187)](_0x14900f,toAgentYamlString(_0x122fa3));if(_0x469c72&&_0x469c72['includes']('\x0a'))a122_0x1debea[_0x1c6eb9(0x187)](_0x4b9f69,_0x469c72);else a122_0x1debea[_0x1c6eb9(0x1cf)](_0x4b9f69)&&a122_0x1debea[_0x1c6eb9(0xdf)](_0x4b9f69);return{'agentName':_0x238a29,'outputPath':_0x31dc02,'isNew':_0x21cf33,'hasChanges':_0x1ac309};}async[a122_0x29cadd(0x196)](_0xce24c1,_0x53351f){const _0x5b700a=a122_0x29cadd;let _0x5028c8;isAgentYamlPath(_0xce24c1)?_0x5028c8=getAgentDirFromYamlPath(_0xce24c1):_0x5028c8=_0xce24c1;const {config:_0x5e3106}=findAgentConfig(_0x5028c8),_0x1df88c=await this[_0x5b700a(0x178)](_0x5e3106[_0x5b700a(0x1dd)]),_0x52fdc0=a122_0x52c3ab[_0x5b700a(0x184)](_0x5028c8,_0x5b700a(0xe0)),_0x3ee79e=a122_0x52c3ab['join'](_0x5028c8,_0x5b700a(0x1d9)),_0x5e50ec=a122_0x52c3ab[_0x5b700a(0x184)](_0x5028c8,_0x5b700a(0xdc));if(!a122_0x1debea['existsSync'](_0x52fdc0))throw new SDKError(ErrorCode[_0x5b700a(0x1de)],'agent.yml\x20not\x20found\x20in\x20'+_0x5028c8,undefined,{'helpText':_0x5b700a(0x1d5)});const _0x26d241=parseAgentYaml(a122_0x1debea[_0x5b700a(0x16d)](_0x52fdc0,_0x5b700a(0x1b9)),_0x52fdc0),_0x2931c7=a122_0x1debea['existsSync'](_0x3ee79e)?a122_0x1debea[_0x5b700a(0x16d)](_0x3ee79e,_0x5b700a(0x1b9)):'',_0x4210cd=a122_0x1debea[_0x5b700a(0x1cf)](_0x5e50ec)?a122_0x1debea['readFileSync'](_0x5e50ec,'utf-8'):_0x26d241[_0x5b700a(0x1df)];if(_0x53351f?.[_0x5b700a(0x1a3)])return{'agentName':_0x26d241[_0x5b700a(0x10c)],'action':'created','projectId':_0x1df88c};const _0x355209=await this[_0x5b700a(0x18e)][_0x5b700a(0x103)](_0x1df88c),_0x445933=await fetchAllToolTargetMaps((_0xa993e3,_0x56971d)=>this[_0x5b700a(0x18e)][_0x5b700a(0xfa)](_0xa993e3,_0x56971d),_0x1df88c),_0x13c6d0=new Map();for(const _0x29833c of _0x355209){_0x13c6d0['set'](_0x29833c[_0x5b700a(0x11d)][_0x5b700a(0x10c)],_0x29833c['id']);}const _0x443c16=[],_0x3f757c={'projectId':_0x1df88c,'resolveToolTargetId':buildIdResolver({..._0x445933[_0x5b700a(0x13e)],'Agent':_0x13c6d0}),'resolvePromptId':async()=>undefined,'onWarning':_0x28b6be=>{const _0x21bc53=_0x5b700a;this[_0x21bc53(0x114)][_0x21bc53(0x1c7)](_0x28b6be),_0x443c16['push'](_0x28b6be);}};try{const _0x18eace=_0x355209[_0x5b700a(0x176)](_0x4e3377=>_0x4e3377['attributes']['name']===_0x26d241['name']),_0x46118e=await agentDefToRequest(_0x26d241,_0x2931c7,_0x4210cd,_0x3f757c);if(_0x18eace)return await this[_0x5b700a(0x18e)]['updateAgentResponse'](_0x18eace['id'],_0x46118e),{'agentName':_0x26d241[_0x5b700a(0x10c)],'action':_0x5b700a(0x1db),'projectId':_0x1df88c,'agentId':_0x18eace['id'],'warnings':_0x443c16[_0x5b700a(0xf2)]>0x0?_0x443c16:undefined};else{const _0x1c840c=await this[_0x5b700a(0x18e)][_0x5b700a(0x18d)](_0x46118e);return{'agentName':_0x26d241['name'],'action':'created','projectId':_0x1df88c,'agentId':_0x1c840c['id'],'warnings':_0x443c16[_0x5b700a(0xf2)]>0x0?_0x443c16:undefined};}}catch(_0x4a5f91){return{'agentName':_0x26d241[_0x5b700a(0x10c)],'action':'error','projectId':_0x1df88c,'error':_0x4a5f91['message'],'warnings':_0x443c16[_0x5b700a(0xf2)]>0x0?_0x443c16:undefined};}}async['cloneProject'](_0x308c97,_0x375c60,_0x262826){const _0x31d555=a122_0x29cadd,_0x4dfcf5=a122_0x1debea[_0x31d555(0x1cf)](_0x308c97)&&a122_0x1debea['existsSync'](a122_0x52c3ab[_0x31d555(0x184)](_0x308c97,'tdx.json'));let _0x3e1702;const _0x4d48b8=[],_0x59c0bd=[],_0xea8833=[],_0x14f92f=[],_0x2dfd6c=[],_0x411864=[],_0x2f7096=[];if(_0x4dfcf5){const _0x3851d5=loadAgentConfig(a122_0x52c3ab[_0x31d555(0x184)](_0x308c97,'tdx.json'));_0x3e1702=_0x3851d5[_0x31d555(0x1dd)];const _0x397397=a122_0x1debea[_0x31d555(0xee)](_0x308c97,{'withFileTypes':!![]});for(const _0x3b22e3 of _0x397397){if(!_0x3b22e3[_0x31d555(0xea)]())continue;if(['knowledge_bases',_0x31d555(0x1bf),'experimental_artifacts',_0x31d555(0x122),_0x31d555(0x13a)][_0x31d555(0x15d)](_0x3b22e3[_0x31d555(0x10c)]))continue;const _0x4fcec8=a122_0x52c3ab['join'](_0x308c97,_0x3b22e3[_0x31d555(0x10c)]);if(isAgentDir(_0x4fcec8)){const _0xb07bc8=a122_0x52c3ab[_0x31d555(0x184)](_0x4fcec8,'agent.yml'),_0x98135e=a122_0x52c3ab[_0x31d555(0x184)](_0x4fcec8,'prompt.md'),_0x2b0438=a122_0x52c3ab[_0x31d555(0x184)](_0x4fcec8,_0x31d555(0xdc)),_0x3cf36e=parseAgentYaml(a122_0x1debea[_0x31d555(0x16d)](_0xb07bc8,_0x31d555(0x1b9)),_0xb07bc8),_0x4a212a=a122_0x1debea[_0x31d555(0x1cf)](_0x98135e)?a122_0x1debea[_0x31d555(0x16d)](_0x98135e,_0x31d555(0x1b9)):'',_0x5afa2e=a122_0x1debea[_0x31d555(0x1cf)](_0x2b0438)?a122_0x1debea[_0x31d555(0x16d)](_0x2b0438,_0x31d555(0x1b9)):_0x3cf36e[_0x31d555(0x1df)];_0x4d48b8[_0x31d555(0xc9)]({'name':_0x3cf36e[_0x31d555(0x10c)],'dir':_0x4fcec8,'yaml':_0x3cf36e,'systemPrompt':_0x4a212a,'starterMessage':_0x5afa2e});}}const _0x465319=getKnowledgeBasesDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x465319)){const _0x3d992f=a122_0x1debea['readdirSync'](_0x465319);for(const _0x256160 of _0x3d992f){const _0x236861=a122_0x52c3ab[_0x31d555(0x184)](_0x465319,_0x256160);if(_0x256160[_0x31d555(0x191)](_0x31d555(0x194))){const _0x102547=parseKnowledgeBaseYaml(a122_0x1debea['readFileSync'](_0x236861,_0x31d555(0x1b9)),_0x236861);_0x59c0bd['push']({'name':_0x102547[_0x31d555(0x10c)],'path':_0x236861,'yaml':_0x102547});}else{if(_0x256160[_0x31d555(0x191)](_0x31d555(0x16a))){const _0x21c94f=a122_0x1debea[_0x31d555(0x16d)](_0x236861,_0x31d555(0x1b9)),{name:_0x10a75c,text:_0x74b7fc}=parseTextKnowledgeBaseMd(_0x21c94f,_0x256160);_0xea8833[_0x31d555(0xc9)]({'name':_0x10a75c,'path':_0x236861,'text':_0x74b7fc});}}}}const _0x4c096c=getPromptsDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x4c096c)){const _0x4e1773=a122_0x1debea[_0x31d555(0xee)](_0x4c096c)[_0x31d555(0x189)](_0x4c5968=>_0x4c5968[_0x31d555(0x191)]('.yml'));for(const _0x59acc2 of _0x4e1773){const _0x4ebab1=a122_0x52c3ab[_0x31d555(0x184)](_0x4c096c,_0x59acc2),_0x30d6f0=parsePromptYaml(a122_0x1debea[_0x31d555(0x16d)](_0x4ebab1,_0x31d555(0x1b9)),_0x4ebab1);_0x14f92f['push']({'name':_0x30d6f0[_0x31d555(0x10c)],'path':_0x4ebab1,'yaml':_0x30d6f0});}}const _0x641cf6=getIntegrationsDir(_0x308c97);if(a122_0x1debea['existsSync'](_0x641cf6)){const _0x3d8f46=a122_0x1debea[_0x31d555(0xee)](_0x641cf6)[_0x31d555(0x189)](_0x478ac6=>_0x478ac6[_0x31d555(0x191)](_0x31d555(0x194)));for(const _0x462bdb of _0x3d8f46){const _0x2b28e5=a122_0x52c3ab[_0x31d555(0x184)](_0x641cf6,_0x462bdb),_0x1edc23=parseIntegrationYaml(a122_0x1debea[_0x31d555(0x16d)](_0x2b28e5,'utf-8'),_0x2b28e5);SAFE_INTEGRATION_TYPES[_0x31d555(0x15d)](_0x1edc23[_0x31d555(0x149)][_0x31d555(0x102)]())?_0x2dfd6c[_0x31d555(0xc9)]({'name':_0x1edc23['name'],'path':_0x2b28e5,'yaml':_0x1edc23}):this[_0x31d555(0x114)][_0x31d555(0x1c7)]('Skipping\x20integration\x20\x27'+_0x1edc23[_0x31d555(0x10c)]+_0x31d555(0xda)+_0x1edc23[_0x31d555(0x149)]+_0x31d555(0x19a)+(_0x31d555(0x11e)+SAFE_INTEGRATION_TYPES[_0x31d555(0x184)](',\x20')+_0x31d555(0x1b0)));}}const _0x496515=getExperimentalKnowledgeBasesDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x496515)){const _0x1d8c7b=a122_0x1debea['readdirSync'](_0x496515,{'withFileTypes':!![]});for(const _0x12de49 of _0x1d8c7b){if(!_0x12de49[_0x31d555(0xea)]())continue;const _0x564d6b=a122_0x52c3ab[_0x31d555(0x184)](_0x496515,_0x12de49['name']),_0x270301=a122_0x52c3ab[_0x31d555(0x184)](_0x564d6b,_0x12de49[_0x31d555(0x10c)]+_0x31d555(0x194));if(a122_0x1debea[_0x31d555(0x1cf)](_0x270301)){const _0xa9d22e=parseExperimentalKnowledgeBaseYaml(a122_0x1debea['readFileSync'](_0x270301,_0x31d555(0x1b9)),_0x270301),_0x2cbb47=a122_0x52c3ab[_0x31d555(0x184)](_0x564d6b,_0x31d555(0x18c)),_0x354356=[];if(a122_0x1debea[_0x31d555(0x1cf)](_0x2cbb47)){const _0x2e3105=a122_0x1debea[_0x31d555(0xee)](_0x2cbb47,{'withFileTypes':!![]});for(const _0xa3a5ae of _0x2e3105){if(!_0xa3a5ae[_0x31d555(0xea)]())continue;const _0x485e66=a122_0x52c3ab[_0x31d555(0x184)](_0x2cbb47,_0xa3a5ae[_0x31d555(0x10c)]),_0x5e04e5=a122_0x52c3ab[_0x31d555(0x184)](_0x485e66,_0x31d555(0xc4)),_0x10fa6f=a122_0x52c3ab[_0x31d555(0x184)](_0x485e66,_0x31d555(0x1c3));if(a122_0x1debea[_0x31d555(0x1cf)](_0x5e04e5)&&a122_0x1debea['existsSync'](_0x10fa6f)){const _0x11d627=a122_0x1debea[_0x31d555(0x16d)](_0x5e04e5,_0x31d555(0x1b9)),_0x5d1761=a122_0x1debea[_0x31d555(0x16d)](_0x10fa6f,'utf-8');_0x354356[_0x31d555(0xc9)]({'name':_0xa3a5ae[_0x31d555(0x10c)],'code':_0x11d627,'json_schema':_0x5d1761});}}}const _0x5a6aa3={..._0xa9d22e,'functions':_0x354356};_0x411864['push']({'name':_0xa9d22e[_0x31d555(0x10c)],'path':_0x564d6b,'def':_0x5a6aa3});}}}const _0x3dad96=getExperimentalArtifactsDir(_0x308c97);if(a122_0x1debea[_0x31d555(0x1cf)](_0x3dad96)){const _0x25a3d9=a122_0x1debea['readdirSync'](_0x3dad96,{'withFileTypes':!![]});for(const _0x2e1dcd of _0x25a3d9){if(!_0x2e1dcd['isDirectory']())continue;const _0x2b7cf2=a122_0x52c3ab[_0x31d555(0x184)](_0x3dad96,_0x2e1dcd[_0x31d555(0x10c)]),_0x1ad094=a122_0x52c3ab[_0x31d555(0x184)](_0x2b7cf2,_0x2e1dcd['name']+_0x31d555(0x194));if(a122_0x1debea[_0x31d555(0x1cf)](_0x1ad094)){const _0x18d7f8=parseExperimentalArtifactYaml(a122_0x1debea['readFileSync'](_0x1ad094,_0x31d555(0x1b9)),_0x1ad094),_0x3e0e43=a122_0x52c3ab[_0x31d555(0x184)](_0x2b7cf2,_0x31d555(0xc4)),_0x40a171=a122_0x1debea[_0x31d555(0x1cf)](_0x3e0e43)?a122_0x1debea[_0x31d555(0x16d)](_0x3e0e43,'utf-8'):'',_0x37ddfb=a122_0x52c3ab['join'](_0x2b7cf2,_0x31d555(0xc7)),_0x4f0195=[];if(a122_0x1debea[_0x31d555(0x1cf)](_0x37ddfb)){const _0x26af33=a122_0x1debea['readdirSync'](_0x37ddfb);for(const _0x5e5db2 of _0x26af33){const _0x39ac01=a122_0x52c3ab[_0x31d555(0x184)](_0x37ddfb,_0x5e5db2);if(a122_0x1debea['statSync'](_0x39ac01)['isFile']()){const _0x31c03a=a122_0x1debea['readFileSync'](_0x39ac01,'utf-8');_0x4f0195[_0x31d555(0xc9)]({'file_name':_0x5e5db2,'text_content':_0x31c03a});}}}const _0x4831f3={..._0x18d7f8,'code':_0x40a171,'files':_0x4f0195};_0x2f7096[_0x31d555(0xc9)]({'name':_0x18d7f8[_0x31d555(0x10c)],'path':_0x2b7cf2,'def':_0x4831f3});}}}}else{const _0x4eb88f=await this[_0x31d555(0x178)](_0x308c97),_0x256074=await this[_0x31d555(0x18e)][_0x31d555(0xd7)](_0x4eb88f);_0x3e1702=_0x256074[_0x31d555(0x11d)][_0x31d555(0x10c)];const _0x38031b=await this[_0x31d555(0x18e)][_0x31d555(0x103)](_0x4eb88f),_0x4b5d98=await this[_0x31d555(0x18e)][_0x31d555(0x145)](_0x4eb88f),_0x29c73b=await this[_0x31d555(0x18e)][_0x31d555(0x1c0)](_0x4eb88f),_0x70bcc9=await this[_0x31d555(0x18e)][_0x31d555(0xce)](_0x4eb88f),_0xf0a777=await this[_0x31d555(0x18e)]['listIntegrations'](_0x4eb88f),_0x2613e7=await safeListOrEmpty(()=>this[_0x31d555(0x18e)][_0x31d555(0x182)](_0x4eb88f)),_0x394850=await safeListOrEmpty(()=>this[_0x31d555(0x18e)]['listExperimentalArtifacts'](_0x4eb88f)),_0x19fbcf=new Map(),_0x494638=new Map(),_0x2aebcd=new Map(),_0x4a083c=new Map(),_0x389fb2=new Map(),_0x59e087=new Map();for(const _0x313a21 of _0x4b5d98){_0x19fbcf[_0x31d555(0x107)](_0x313a21['id'],_0x313a21[_0x31d555(0x11d)]['name']);}for(const _0x45fb8e of _0x29c73b){_0x494638['set'](_0x45fb8e['id'],_0x45fb8e[_0x31d555(0x11d)][_0x31d555(0x10c)]);}for(const _0x331c16 of _0x38031b){_0x2aebcd[_0x31d555(0x107)](_0x331c16['id'],_0x331c16[_0x31d555(0x11d)]['name']);}for(const _0x4f8e30 of _0x70bcc9){_0x4a083c[_0x31d555(0x107)](_0x4f8e30['id'],_0x4f8e30[_0x31d555(0x11d)][_0x31d555(0x10c)]);}for(const _0x1a4ff2 of _0x2613e7){_0x389fb2['set'](_0x1a4ff2['id'],_0x1a4ff2[_0x31d555(0x11d)]['name']);}for(const _0x12fe7b of _0x394850){_0x59e087['set'](_0x12fe7b['id'],_0x12fe7b['attributes'][_0x31d555(0x10c)]);}const _0x148ba0={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x19fbcf,'TextKnowledgeBase':_0x494638,'Agent':_0x2aebcd,'ExperimentalKnowledgeBase':_0x389fb2}),'resolvePromptName':async _0x49bacc=>_0x4a083c[_0x31d555(0x14e)](_0x49bacc),'onWarning':_0x41fa5f=>this[_0x31d555(0x114)][_0x31d555(0x1c7)](_0x41fa5f)};for(const _0x192308 of _0x38031b){const _0x25ed7b=await agentResponseToDef(_0x192308,_0x148ba0),{yaml:_0x12b428,systemPrompt:_0x4157f0,starterMessage:_0x31b7f1}=_0x25ed7b;_0x4d48b8['push']({'name':_0x12b428['name'],'dir':'','yaml':_0x12b428,'systemPrompt':_0x4157f0,'starterMessage':_0x31b7f1});}for(const _0x80d167 of _0x4b5d98){const _0x2eb0f7=apiKnowledgeBaseToYaml(_0x80d167);_0x59c0bd['push']({'name':_0x2eb0f7[_0x31d555(0x10c)],'path':'','yaml':_0x2eb0f7});}for(const _0xa2e9f6 of _0x29c73b){_0xea8833[_0x31d555(0xc9)]({'name':_0xa2e9f6[_0x31d555(0x11d)][_0x31d555(0x10c)],'path':'','text':_0xa2e9f6[_0x31d555(0x11d)][_0x31d555(0xc1)]});}for(const _0x4e442e of _0x70bcc9){const _0xc4dfa2=await apiPromptToYaml(_0x4e442e,_0x148ba0);_0xc4dfa2&&_0x14f92f[_0x31d555(0xc9)]({'name':_0xc4dfa2[_0x31d555(0x10c)],'path':'','yaml':_0xc4dfa2});}for(const _0x1e45a9 of _0xf0a777){if(!_0x1e45a9[_0x31d555(0x11d)][_0x31d555(0x154)]&&SAFE_INTEGRATION_TYPES[_0x31d555(0x15d)](_0x1e45a9['attributes'][_0x31d555(0x17f)][_0x31d555(0x102)]())){const _0x2f2c0f=await apiIntegrationToYaml(_0x1e45a9,_0x148ba0);_0x2dfd6c[_0x31d555(0xc9)]({'name':_0x1e45a9['attributes'][_0x31d555(0x17f)][_0x31d555(0x102)](),'path':'','yaml':_0x2f2c0f});}}for(const _0xaae233 of _0x2613e7){const _0xfb391d=apiExperimentalKnowledgeBaseToYaml(_0xaae233);_0x411864[_0x31d555(0xc9)]({'name':_0xfb391d[_0x31d555(0x10c)],'path':'','def':_0xfb391d});}for(const _0x308aa4 of _0x394850){const _0xfdd241=apiExperimentalArtifactToYaml(_0x308aa4);_0x2f7096['push']({'name':_0xfdd241['name'],'path':'','def':_0xfdd241});}}const _0x30598c={'sourceProjectName':_0x3e1702,'newProjectName':_0x375c60,'newProjectId':'','agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'imageGenerators':[],'webSearchTools':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'imageGenerators':{'created':0x0,'errors':0x0},'webSearchTools':{'created':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x19b16f=await this[_0x31d555(0x18e)][_0x31d555(0x134)](),_0x331599=_0x19b16f[_0x31d555(0x176)](_0x4c9071=>_0x4c9071[_0x31d555(0x11d)]['name']===_0x375c60);if(_0x331599)throw new SDKError(ErrorCode[_0x31d555(0x1a7)],_0x31d555(0x13b)+_0x375c60+_0x31d555(0x16f),undefined,{'helpText':'Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.'});if(_0x262826?.['dryRun'])return _0x30598c[_0x31d555(0x17b)][_0x31d555(0x193)][_0x31d555(0xd1)]=_0x4d48b8[_0x31d555(0xf2)],_0x30598c['counts'][_0x31d555(0xbf)][_0x31d555(0xd1)]=_0x59c0bd[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x128)][_0x31d555(0xd1)]=_0xea8833[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1af)][_0x31d555(0xd1)]=_0x411864['length'],_0x30598c['counts'][_0x31d555(0x108)][_0x31d555(0xd1)]=_0x2f7096[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd1)]=_0x14f92f[_0x31d555(0xf2)],_0x30598c[_0x31d555(0x17b)][_0x31d555(0x13a)][_0x31d555(0xd1)]=_0x2dfd6c[_0x31d555(0xf2)],_0x30598c;const _0x5a995d=await this[_0x31d555(0x18e)][_0x31d555(0x1c1)]({'name':_0x375c60}),_0x54bc97=_0x5a995d['id'];_0x30598c[_0x31d555(0x10b)]=_0x54bc97;const _0x376d5d=new Map(),_0x22c335=new Map(),_0x4f68bf=new Map(),_0x27df8e=new Map(),_0x45f098=new Map(),_0x2caaff=new Map(),_0xbbe5ae=new Map(),_0x3dffdd=new Map(),_0x5bab08=new Set(),_0x20546c=new Set();for(const _0x1f63df of _0x4d48b8){for(const _0x26bdd1 of _0x1f63df[_0x31d555(0x175)][_0x31d555(0x1c5)]||[]){if(_0x26bdd1['type']===_0x31d555(0x125)&&_0x26bdd1[_0x31d555(0x1bd)]){const _0x4d8820=parseRef(_0x26bdd1['target']);if(_0x4d8820)_0x5bab08[_0x31d555(0xe6)](_0x4d8820[_0x31d555(0x10c)]);}else{if(_0x26bdd1[_0x31d555(0x126)]===_0x31d555(0x1c9)&&_0x26bdd1[_0x31d555(0x1bd)]){const _0x5c2f32=parseRef(_0x26bdd1[_0x31d555(0x1bd)]);if(_0x5c2f32)_0x20546c[_0x31d555(0xe6)](_0x5c2f32[_0x31d555(0x10c)]);}}}}for(const _0x514c94 of _0x5bab08){try{const _0x50daff=await this[_0x31d555(0x18e)]['createImageGenerator']({'projectId':_0x54bc97,'name':_0x514c94});_0x45f098[_0x31d555(0x107)](_0x514c94,_0x50daff['id']),_0x30598c[_0x31d555(0x1e0)][_0x31d555(0xc9)]({'name':_0x514c94,'action':_0x31d555(0xd1),'id':_0x50daff['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1e0)][_0x31d555(0xd1)]++;}catch(_0x23c5b5){_0x30598c['imageGenerators'][_0x31d555(0xc9)]({'name':_0x514c94,'action':'error','error':_0x23c5b5[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1e0)][_0x31d555(0xd4)]++;}}for(const _0x4a1d3f of _0x20546c){try{const _0x720d4f=await this[_0x31d555(0x18e)]['createWebSearchTool']({'projectId':_0x54bc97,'name':_0x4a1d3f});_0x2caaff[_0x31d555(0x107)](_0x4a1d3f,_0x720d4f['id']),_0x30598c['webSearchTools']['push']({'name':_0x4a1d3f,'action':_0x31d555(0xd1),'id':_0x720d4f['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xc3)]['created']++;}catch(_0x11940f){_0x30598c['webSearchTools']['push']({'name':_0x4a1d3f,'action':_0x31d555(0x118),'error':_0x11940f[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xc3)]['errors']++;}}const _0x466984=await fetchAllToolTargetMaps((_0x5c3317,_0x3edb70)=>this[_0x31d555(0x18e)][_0x31d555(0xfa)](_0x5c3317,_0x3edb70),_0x54bc97);let _0x1fa648=[];const _0x3c738b={'projectId':_0x54bc97,'resolveToolTargetId':buildIdResolver({..._0x466984[_0x31d555(0x13e)],'KnowledgeBase':_0x376d5d,'TextKnowledgeBase':_0x22c335,'ExperimentalKnowledgeBase':_0xbbe5ae,'Agent':_0x4f68bf,'WebSearchTool':_0x2caaff,'ImageGenerator':_0x45f098}),'resolvePromptId':async _0x3aaef7=>_0x27df8e[_0x31d555(0x14e)](_0x3aaef7),'onWarning':_0x4602e3=>{const _0x11c125=_0x31d555;this[_0x11c125(0x114)][_0x11c125(0x1c7)](_0x4602e3),_0x1fa648[_0x11c125(0xc9)](_0x4602e3);}};for(const _0x206a1a of _0x59c0bd){try{const _0x3ba890=yamlKnowledgeBaseToApi(_0x206a1a[_0x31d555(0x175)],_0x54bc97),_0x5e1fed=await this[_0x31d555(0x18e)][_0x31d555(0xe5)](_0x3ba890);_0x376d5d[_0x31d555(0x107)](_0x206a1a['yaml'][_0x31d555(0x10c)],_0x5e1fed['id']),_0x30598c[_0x31d555(0xbf)][_0x31d555(0xc9)]({'name':_0x206a1a['yaml'][_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0x5e1fed['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xbf)][_0x31d555(0xd1)]++;}catch(_0x13dca6){_0x30598c['knowledgeBases'][_0x31d555(0xc9)]({'name':_0x206a1a[_0x31d555(0x175)]['name'],'action':_0x31d555(0x118),'error':_0x13dca6[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0xbf)][_0x31d555(0xd4)]++;}}for(const _0x3f8d42 of _0xea8833){try{const _0x338a9d=yamlTextKnowledgeBaseToApi({'name':_0x3f8d42['name'],'text':_0x3f8d42[_0x31d555(0xc1)]},_0x54bc97),_0x3dc65b=await this[_0x31d555(0x18e)][_0x31d555(0x111)](_0x338a9d);_0x22c335[_0x31d555(0x107)](_0x3f8d42[_0x31d555(0x10c)],_0x3dc65b['id']),_0x30598c[_0x31d555(0x128)][_0x31d555(0xc9)]({'name':_0x3f8d42[_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0x3dc65b['id']}),_0x30598c[_0x31d555(0x17b)]['textKnowledgeBases'][_0x31d555(0xd1)]++;}catch(_0x470a5d){_0x30598c['textKnowledgeBases'][_0x31d555(0xc9)]({'name':_0x3f8d42['name'],'action':_0x31d555(0x118),'error':_0x470a5d[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x128)][_0x31d555(0xd4)]++;}}for(const _0x2ecc63 of _0x2f7096){try{const _0x5d1916=yamlExperimentalArtifactToApi(_0x2ecc63[_0x31d555(0x116)],_0x54bc97),_0x5bf9f0=await this[_0x31d555(0x18e)][_0x31d555(0x110)](_0x5d1916);_0x3dffdd[_0x31d555(0x107)](_0x2ecc63[_0x31d555(0x116)][_0x31d555(0x10c)],_0x5bf9f0['id']),_0x30598c[_0x31d555(0x108)]['push']({'name':_0x2ecc63[_0x31d555(0x116)][_0x31d555(0x10c)],'action':'created','id':_0x5bf9f0['id']}),_0x30598c['counts']['experimentalArtifacts'][_0x31d555(0xd1)]++;}catch(_0x3e3300){_0x30598c[_0x31d555(0x108)]['push']({'name':_0x2ecc63[_0x31d555(0x116)][_0x31d555(0x10c)],'action':'error','error':_0x3e3300[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x108)][_0x31d555(0xd4)]++;}}for(const _0x5ab1ba of _0x411864){try{const _0x1098bc=yamlExperimentalKnowledgeBaseToApi(_0x5ab1ba[_0x31d555(0x116)],_0x54bc97),_0x42db74=await this['client']['createExperimentalKnowledgeBase'](_0x1098bc);_0xbbe5ae['set'](_0x5ab1ba['def'][_0x31d555(0x10c)],_0x42db74['id']),_0x30598c[_0x31d555(0x1af)][_0x31d555(0xc9)]({'name':_0x5ab1ba[_0x31d555(0x116)][_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0x42db74['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x1af)][_0x31d555(0xd1)]++;}catch(_0x2860bb){_0x30598c[_0x31d555(0x1af)]['push']({'name':_0x5ab1ba[_0x31d555(0x116)][_0x31d555(0x10c)],'action':'error','error':_0x2860bb[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)]['experimentalKnowledgeBases'][_0x31d555(0xd4)]++;}}const _0x274f88=[..._0x4d48b8][_0x31d555(0xeb)]((_0x1a1ff2,_0x112dbc)=>{const _0x1aac86=_0x31d555,_0xc7eab5=_0x1a1ff2[_0x1aac86(0x175)][_0x1aac86(0x1c5)]?.[_0x1aac86(0x12f)](_0x57471b=>_0x57471b['type']===_0x1aac86(0xc8))??![],_0x4bd0c2=_0x112dbc['yaml'][_0x1aac86(0x1c5)]?.[_0x1aac86(0x12f)](_0x1433cc=>_0x1433cc[_0x1aac86(0x126)]===_0x1aac86(0xc8))??![];if(_0xc7eab5&&!_0x4bd0c2)return 0x1;if(!_0xc7eab5&&_0x4bd0c2)return-0x1;return 0x0;});for(const _0x1354ee of _0x274f88){_0x1fa648=[];try{const _0x55d3b4=_0x1354ee[_0x31d555(0x175)][_0x31d555(0x1c5)]?.[_0x31d555(0x189)](_0x353986=>{const _0x156b18=_0x31d555;if(_0x353986[_0x156b18(0x126)]===_0x156b18(0xc8)&&_0x353986[_0x156b18(0x1bd)]){const _0x26e604=parseRef(_0x353986[_0x156b18(0x1bd)]);return _0x26e604?.[_0x156b18(0x10c)]===_0x1354ee['yaml'][_0x156b18(0x10c)];}return![];})??[];if(_0x55d3b4[_0x31d555(0xf2)]>0x0){const _0x499483=_0x31d555(0x1da)+_0x1354ee['yaml'][_0x31d555(0x10c)]+'\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20'+_0x31d555(0xd6);this[_0x31d555(0x114)][_0x31d555(0x1c7)](_0x499483),_0x1fa648['push'](_0x499483);}const _0x3f83c2=await agentDefToRequest(_0x1354ee[_0x31d555(0x175)],_0x1354ee[_0x31d555(0xfb)],_0x1354ee[_0x31d555(0x1c8)],_0x3c738b),_0x2e8f0e=await this[_0x31d555(0x18e)][_0x31d555(0x18d)](_0x3f83c2);_0x4f68bf[_0x31d555(0x107)](_0x1354ee[_0x31d555(0x175)][_0x31d555(0x10c)],_0x2e8f0e['id']),_0x30598c[_0x31d555(0x193)]['push']({'agentName':_0x1354ee[_0x31d555(0x175)][_0x31d555(0x10c)],'action':'created','agentId':_0x2e8f0e['id'],'warnings':_0x1fa648['length']>0x0?_0x1fa648:undefined}),_0x30598c['counts']['agents']['created']++;}catch(_0x5f176d){_0x30598c[_0x31d555(0x193)][_0x31d555(0xc9)]({'agentName':_0x1354ee[_0x31d555(0x175)]['name'],'action':_0x31d555(0x118),'error':_0x5f176d[_0x31d555(0x113)],'warnings':_0x1fa648[_0x31d555(0xf2)]>0x0?_0x1fa648:undefined}),_0x30598c['counts'][_0x31d555(0x193)][_0x31d555(0xd4)]++;}}for(const _0x3a1167 of _0x14f92f){try{const _0x1234eb=await yamlPromptToApi(_0x3a1167['yaml'],_0x54bc97,_0x3c738b);if(!_0x1234eb){_0x30598c[_0x31d555(0x122)]['push']({'name':_0x3a1167['yaml'][_0x31d555(0x10c)],'action':_0x31d555(0x118),'error':_0x31d555(0x120)}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd4)]++;continue;}const _0xfd92c7=await this[_0x31d555(0x18e)][_0x31d555(0x1b7)](_0x1234eb);_0x27df8e['set'](_0x3a1167[_0x31d555(0x175)]['name'],_0xfd92c7['id']),_0x30598c[_0x31d555(0x122)]['push']({'name':_0x3a1167[_0x31d555(0x175)][_0x31d555(0x10c)],'action':_0x31d555(0xd1),'id':_0xfd92c7['id']}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd1)]++;}catch(_0x57c4b3){_0x30598c[_0x31d555(0x122)][_0x31d555(0xc9)]({'name':_0x3a1167[_0x31d555(0x175)][_0x31d555(0x10c)],'action':_0x31d555(0x118),'error':_0x57c4b3[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x122)][_0x31d555(0xd4)]++;}}for(const _0x38c7b9 of _0x2dfd6c){try{const _0xd28793=await yamlIntegrationToApi(_0x38c7b9[_0x31d555(0x175)],_0x54bc97,_0x3c738b),_0x97b9d1=await this[_0x31d555(0x18e)][_0x31d555(0x1d0)](_0xd28793);_0x30598c[_0x31d555(0x13a)]['push']({'name':_0x38c7b9['yaml']['service_type'],'action':_0x31d555(0xd1),'id':_0x97b9d1['id']}),_0x30598c['counts'][_0x31d555(0x13a)][_0x31d555(0xd1)]++;}catch(_0x570f5f){_0x30598c[_0x31d555(0x13a)][_0x31d555(0xc9)]({'name':_0x38c7b9[_0x31d555(0x175)][_0x31d555(0x149)],'action':_0x31d555(0x118),'error':_0x570f5f[_0x31d555(0x113)]}),_0x30598c[_0x31d555(0x17b)][_0x31d555(0x13a)][_0x31d555(0xd4)]++;}}return _0x30598c;}}
|
|
1
|
+
function a123_0x4833(_0x4e9e4d,_0x3c7355){_0x4e9e4d=_0x4e9e4d-0x19e;const _0x3437e4=a123_0x3437();let _0x48339a=_0x3437e4[_0x4e9e4d];return _0x48339a;}const a123_0x5da6fd=a123_0x4833;(function(_0x5dc379,_0x537e34){const _0x21cc68=a123_0x4833,_0x432306=_0x5dc379();while(!![]){try{const _0x41258a=-parseInt(_0x21cc68(0x26b))/0x1*(parseInt(_0x21cc68(0x1b7))/0x2)+parseInt(_0x21cc68(0x1da))/0x3+parseInt(_0x21cc68(0x1cb))/0x4*(-parseInt(_0x21cc68(0x1bc))/0x5)+-parseInt(_0x21cc68(0x233))/0x6+parseInt(_0x21cc68(0x224))/0x7+-parseInt(_0x21cc68(0x251))/0x8+parseInt(_0x21cc68(0x1ed))/0x9*(parseInt(_0x21cc68(0x1a2))/0xa);if(_0x41258a===_0x537e34)break;else _0x432306['push'](_0x432306['shift']());}catch(_0x3687f6){_0x432306['push'](_0x432306['shift']());}}}(a123_0x3437,0xde899));import{LLMApiClient}from'../client/llm-api-client.js';import*as a123_0x112763 from'node:fs';import*as a123_0x44ff7c from'node:path';import{HTTPClientError}from'../client/http-client.js';import{canCreateAgent,remapToolIds,remapVariableIds,isSupportedBackupVersion}from'./llm-backup-utils.js';import{SDKError,ErrorCode,errorContains}from'../errors.js';function a123_0x3437(){const _0x138e9d=['info','deleteProject','agent','\x20in\x20project\x20','errors','.llm','\x0a---\x20code\x20---\x0a','code.js','json_schema.json','Backup\x20folder\x20not\x20found:\x20','history','webhookCorsOrigins','attributes','image_gen','starterMessage','warn','knowledgebases.json','target','AGENT_NOT_FOUND','def','continueChat','endsWith','existsSync','error','total','9773288bxqzzB','unchanged','createProject','event','agent.yml','Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.','getChatInfo','renamed','experimentalKnowledgeBases','minimal','variables','Available\x20agents:\x20','project.json','signal','\x20---\x0a','type','some','already\x20exists','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','new','Output\x20directory\x20already\x20exists:\x20','updated','jsonSchemaHint','get','Renamed\x20KB\x20file:\x20','starter_message','259843LzDHWq','Only\x20safe\x20types\x20(','client','code','listExperimentalArtifacts','Agent\x20reference\x20not\x20found','listProjects','llm_project','sort','readFileSync','cloneProject','(dry-run)','getDefaultProjectName','\x20attempts\x20due\x20to\x20name\x20conflicts.','push','---\x20file:\x20','listTextKnowledgeBases','TextKnowledgeBase','updateAgent','tdx_','tdDatabaseName','filter','Unresolved\x20dependencies:\x20','size','starter_message.md','\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20','chatInfo','find','getAgent','getUserSettings','backupProject','files','projects','readdirSync','createAgent','pushAgent','basename','newProjectId','listChats','metadata','loadJsonFile','chatId','knowledge_bases','Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20','dir','prompt.md','1.0','chat','NOT_FOUND','.yml','outputs','getCurrentProject','#\x20prompt.md\x0a','projectName','integrations','updateKnowledgeBase','updateAgentResponse','webSearchTools','agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat','reasoningEffort','site',')\x20can\x20be\x20cloned.','keys','INTERNAL','Unable\x20to\x20create\x20project\x20after\x20','Removed\x20deleted\x20file:\x20','projectId','pullAgent','dirname','yaml','createPrompt','conflict','\x22\x20already\x20exists','\x0a---\x20schema:\x20','\x27\x20(','systemPrompt','createExperimentalKnowledgeBase','agentId','Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.','Renamed\x20prompt\x20file:\x20','textKnowledgeBases','PERMISSION_DENIED','json_schema','10HebMFM','cwd','createWebSearchTool','.md','listAgentsFull','maxToolIterations','Renamed\x20experimental\x20artifact\x20directory:\x20','createIntegration','availableModels','Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.','resolveProjectId','listExperimentalKnowledgeBases','Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.','Project\x20\x22','serviceType','updateTextKnowledgeBase','stringify','getChatHistory','Agent\x20not\x20found:\x20','promptId','experimental_knowledge_bases','4cwxHva','Unsupported\x20backup\x20version:\x20','description','Invalid\x20agent\x20reference\x20format:\x20','createKnowledgeBase','8670XJAYBU','\x20→\x20','add','agents.json','tables','Renamed\x20text\x20KB\x20file:\x20','created','ALREADY_EXISTS','Agent\x20\x27','listToolTargets','listKnowledgeBases','text_content','message','unlinkSync','mkdirSync','2024jWPIXA','knowledgeBases','getOrCreateDefaultAgent','experimental_artifacts','restoreProject','currentProjectId','isDirectory','getOrCreateDefaultProject','includes','medium','prompts','\x0a---\x20function:\x20','template','agent.yml\x20not\x20found\x20in\x20','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','2008113AFZBqi','pushProject','actions','nameToId','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','toLowerCase','\x0a\x0a#\x20agent.yml\x0a','file_name','Skipping\x20integration\x20\x27','Multiple\x20projects\x20found\x20with\x20name\x20\x27','Multiple\x20agents\x20found\x20with\x20name\x20\x27','getChatLog','getProject','text','chat_agent_console','listPrompts','Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.','createImageGenerator','imageGenerators','34709355RasSWk','name','statSync','updateExperimentalArtifact','writeFileSync','startChat','logger','integrations.json','agents','listIntegrations','isManaged','set','oldPath','map','duplicate','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','displayName','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','status','chat_parent_segment','deleteAgent','path','version','Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.','has','length','low','):\x20','LLM_PROJECT_NOT_FOUND','deleteIntegration','updateExperimentalKnowledgeBase','web_search','listWebSearchTools','service_type','isFile','UNAUTHENTICATED','counts','localeCompare','createExperimentalArtifact','project','\x27.\x20This\x20should\x20not\x20happen.','functions','tools','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','none','context','chatIgnoreManagedActions','resolveProjectName','INVALID_ARGUMENT','Renamed\x20folder:\x20','listAgents','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.','experimentalArtifacts','exportedFrom','dryRun','4620406znvIED','tdx.json','rmSync','isDir','setCurrentProject','Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts','createAgentResponse','pullProject','getBackupMetadata','updatePrompt','parse','modelType','resolveAgentId','utf-8','profile','9934560WxJaAw','tdx_default_','temperature','createTextKnowledgeBase','join'];a123_0x3437=function(){return _0x138e9d;};return a123_0x3437();}import{getSanitizedPathWithMigration,sanitizeForFilesystem,migrateModelType,parseRef,agentResponseToDef,apiKnowledgeBaseToYaml,apiPromptToYaml,apiIntegrationToYaml,apiExperimentalKnowledgeBaseToYaml,apiExperimentalArtifactToYaml,fetchAllToolTargetMaps,toAgentYamlString,toKnowledgeBaseYamlString,toTextKnowledgeBaseMd,toPromptYamlString,toIntegrationYamlString,toExperimentalKnowledgeBaseYamlString,toExperimentalArtifactYamlString,parseAgentYaml,parseKnowledgeBaseYaml,parseTextKnowledgeBaseMd,parsePromptYaml,parseIntegrationYaml,parseExperimentalKnowledgeBaseYaml,parseExperimentalArtifactYaml,agentDefToRequest,yamlKnowledgeBaseToApi,yamlTextKnowledgeBaseToApi,yamlExperimentalKnowledgeBaseToApi,yamlExperimentalArtifactToApi,yamlPromptToApi,yamlIntegrationToApi,resolveAgentDependencies,buildNameResolver,buildIdResolver}from'../agent/agent-yaml.js';import{createAgentConfigContent,loadAgentConfig,findAgentConfig,isAgentDir,isAgentYamlPath,getAgentDirFromYamlPath,getKnowledgeBasesDir,getPromptsDir,getIntegrationsDir,getExperimentalKnowledgeBasesDir,getExperimentalArtifactsDir}from'../agent/agent-config.js';import{getSanitizedUsername,generateRandomHex}from'../../utils/string-utils.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{readCachedLLMProject,writeCachedLLMProject,readCachedLLMAgent,writeCachedLLMAgent,clearCachedLLMAgent}from'../../core/config.js';import{Logger}from'../../utils/logger/index.js';export const SAFE_INTEGRATION_TYPES=['chat_generic',a123_0x5da6fd(0x1e8),a123_0x5da6fd(0x200)];async function safeListOrEmpty(_0x5c86a6){try{return await _0x5c86a6();}catch(_0x262ff5){if(_0x262ff5 instanceof HTTPClientError&&_0x262ff5['status']===0x194)return[];throw _0x262ff5;}}export class LLMSDK{[a123_0x5da6fd(0x1d0)];[a123_0x5da6fd(0x26d)];[a123_0x5da6fd(0x21a)];[a123_0x5da6fd(0x1f3)]=Logger['of']('sdk.llm');constructor(_0xf5ee06){const _0x536356=a123_0x5da6fd;this[_0x536356(0x26d)]=new LLMApiClient(_0xf5ee06),this[_0x536356(0x21a)]=_0xf5ee06;}[a123_0x5da6fd(0x277)](){const _0x386d47=a123_0x5da6fd,_0x54b37a=getSanitizedUsername();return _0x386d47(0x234)+_0x54b37a;}async[a123_0x5da6fd(0x228)](_0x57f499){const {projectId:_0x1b0610}=await this['resolveProjectName'](_0x57f499);this['currentProjectId']=_0x1b0610;}[a123_0x5da6fd(0x29e)](){const _0x334578=a123_0x5da6fd;return this[_0x334578(0x1d0)];}async['setDefaultAgent'](_0x41350d){const _0x2b48b5=a123_0x5da6fd,_0x5dbc42=this[_0x2b48b5(0x21a)][_0x2b48b5(0x232)];let _0x5b975d,_0x52e986;if(_0x41350d[_0x2b48b5(0x1d3)]('/')){const _0x10557a=_0x41350d['split']('/');if(_0x10557a[_0x2b48b5(0x206)]!==0x2)throw new SDKError(ErrorCode[_0x2b48b5(0x21d)],_0x2b48b5(0x1ba)+_0x41350d,undefined,{'helpText':_0x2b48b5(0x1fc)});const [_0x531e67,_0x4c18d0]=_0x10557a;_0x5b975d=await this[_0x2b48b5(0x1ac)](_0x531e67),_0x52e986=_0x4c18d0;}else _0x5b975d=this['currentProjectId']||(await this[_0x2b48b5(0x1d2)]())['id'],_0x52e986=_0x41350d;const _0x106929=await this[_0x2b48b5(0x230)](_0x52e986,_0x5b975d),_0x12a8ea=await this[_0x2b48b5(0x26d)][_0x2b48b5(0x287)](_0x106929);writeCachedLLMAgent(_0x12a8ea[_0x2b48b5(0x244)]['name'],_0x106929,_0x5b975d,_0x5dbc42);}['getDefaultAgent'](){const _0x4ea47d=a123_0x5da6fd,_0x2e73b5=this[_0x4ea47d(0x21a)][_0x4ea47d(0x232)];return readCachedLLMAgent(_0x2e73b5)||undefined;}['clearDefaultAgent'](){const _0x212d66=a123_0x5da6fd,_0x5956b2=this[_0x212d66(0x21a)]['profile'];clearCachedLLMAgent(_0x5956b2);}async['models'](){const _0x73edcb=a123_0x5da6fd,_0x1514af=await this[_0x73edcb(0x26d)][_0x73edcb(0x288)](),_0x3fb17a=[];for(const _0x3c1d44 of _0x1514af['availableModelNames']){const _0x2e02d8=_0x1514af[_0x73edcb(0x1aa)][_0x3c1d44];_0x2e02d8&&_0x3fb17a['push']({'name':_0x3c1d44,'displayName':_0x2e02d8[_0x73edcb(0x1fd)]});}return _0x3fb17a;}async['createProject'](_0x4338cb){const _0xb7856d=a123_0x5da6fd;return await this[_0xb7856d(0x26d)][_0xb7856d(0x253)](_0x4338cb);}async['deleteProject'](_0x4e676a){const _0x46575f=a123_0x5da6fd,{projectId:_0x1b8d42}=await this[_0x46575f(0x21c)](_0x4e676a);await this[_0x46575f(0x26d)][_0x46575f(0x239)](_0x1b8d42);}async[a123_0x5da6fd(0x28b)](_0x56888e=0x32){const _0x55efe5=a123_0x5da6fd;return await this[_0x55efe5(0x26d)][_0x55efe5(0x271)](_0x56888e);}async[a123_0x5da6fd(0x1d2)](_0x10397b){const _0x10568a=a123_0x5da6fd,_0x4cc823=_0x10397b||this['getDefaultProjectName'](),_0x5888de=this[_0x10568a(0x21a)][_0x10568a(0x232)];if(!_0x10397b){const _0x747c11=readCachedLLMProject(_0x5888de);if(_0x747c11&&_0x747c11[_0x10568a(0x1ee)]===_0x4cc823)try{const _0x5a6115=await this[_0x10568a(0x26d)][_0x10568a(0x1e6)](_0x747c11['id']);if(_0x5a6115[_0x10568a(0x244)][_0x10568a(0x1ee)]===_0x4cc823)return _0x5a6115;}catch{}}const _0x3c3717=await this[_0x10568a(0x26d)][_0x10568a(0x271)](),_0x467b6c=_0x3c3717[_0x10568a(0x286)](_0x3c2101=>_0x3c2101[_0x10568a(0x244)]['name']===_0x4cc823);if(_0x467b6c)return!_0x10397b&&writeCachedLLMProject(_0x4cc823,_0x467b6c['id'],_0x5888de),_0x467b6c;const _0x45d96b=await this[_0x10568a(0x26d)][_0x10568a(0x253)]({'name':_0x4cc823,'description':_0x10568a(0x1de)+getSanitizedUsername()+')'});return!_0x10397b&&writeCachedLLMProject(_0x4cc823,_0x45d96b['id'],_0x5888de),_0x45d96b;}async[a123_0x5da6fd(0x1ac)](_0x1a8c4a){const _0x1f8bf6=a123_0x5da6fd,_0x2ee82b=await this['client'][_0x1f8bf6(0x271)](),_0x14edca=_0x2ee82b[_0x1f8bf6(0x280)](_0x3f992f=>_0x3f992f[_0x1f8bf6(0x244)]['name']===_0x1a8c4a);if(_0x14edca['length']===0x0)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],'Project\x20not\x20found:\x20'+_0x1a8c4a,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});if(_0x14edca[_0x1f8bf6(0x206)]>0x1)throw new SDKError(ErrorCode[_0x1f8bf6(0x2aa)],_0x1f8bf6(0x1e3)+_0x1a8c4a+_0x1f8bf6(0x215));return _0x14edca[0x0]['id'];}async['resolveProjectName'](_0x369af2){const _0x235e47=a123_0x5da6fd,_0x2f872c=await this[_0x235e47(0x26d)]['listProjects'](),_0x3886ba=_0x2f872c[_0x235e47(0x286)](_0x19b962=>_0x19b962['attributes'][_0x235e47(0x1ee)]===_0x369af2);if(_0x3886ba)return{'projectId':_0x3886ba['id'],'project':_0x3886ba};throw new SDKError(ErrorCode[_0x235e47(0x209)],'Project\x20not\x20found:\x20'+_0x369af2,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});}async[a123_0x5da6fd(0x1cd)](_0x2177b3='claude-4.5-sonnet',_0x23d863=0x0,_0x51c14f){const _0x5a51fd=a123_0x5da6fd,_0x126890=0xa;let _0xf15e18=0x0,_0x3f0728;while(_0xf15e18<_0x126890){try{const _0x1ddacc=await this[_0x5a51fd(0x1d2)](_0x3f0728),_0x406626=_0x1ddacc['id'],_0x1ff0b0=[_0x5a51fd(0x219),_0x5a51fd(0x25a),_0x5a51fd(0x207),_0x5a51fd(0x1d4),'high'],_0x480fae=_0x23d863===0x0?'tdx_'+_0x2177b3:_0x5a51fd(0x27e)+_0x2177b3+'_reasoning_'+_0x1ff0b0[_0x23d863],_0x1466a0=await this['client'][_0x5a51fd(0x21f)](_0x406626),_0x2a8e0e=_0x1466a0['find'](_0x30178b=>_0x30178b[_0x5a51fd(0x244)][_0x5a51fd(0x1ee)]===_0x480fae);if(_0x2a8e0e)return _0x2a8e0e;const _0x15e12e=_0x23d863>0x0?0x1:_0x51c14f;return await this['client']['createAgent']({'name':_0x480fae,'projectId':_0x406626,'modelType':_0x2177b3,'systemPrompt':'','temperature':_0x15e12e,'reasoningEffort':_0x23d863>0x0?_0x23d863:undefined});}catch(_0x2aadf7){if(_0x2aadf7 instanceof HTTPClientError){const _0x1ddf5c=_0x2aadf7[_0x5a51fd(0x1ff)];if(_0x1ddf5c>=0x190&&_0x1ddf5c<0x1f4){if(_0x1ddf5c===0x191)throw new SDKError(ErrorCode[_0x5a51fd(0x210)],_0x5a51fd(0x263),_0x2aadf7);else{if(_0x1ddf5c===0x193)throw new SDKError(ErrorCode[_0x5a51fd(0x1a0)],_0x5a51fd(0x256),_0x2aadf7);}throw _0x2aadf7;}}if(errorContains(_0x2aadf7,_0x5a51fd(0x262),_0x5a51fd(0x1fb),_0x5a51fd(0x2b2))){_0xf15e18++;if(_0xf15e18>=_0x126890)throw new SDKError(ErrorCode['ALREADY_EXISTS'],_0x5a51fd(0x2ab)+_0x126890+_0x5a51fd(0x278),_0x2aadf7);const _0x26f368=this[_0x5a51fd(0x277)]();_0x3f0728=_0x26f368+'_'+generateRandomHex();continue;}throw _0x2aadf7;}}throw new SDKError(ErrorCode['INTERNAL'],_0x5a51fd(0x229));}async[a123_0x5da6fd(0x230)](_0x196426,_0x36f60e){const _0x2d83e2=a123_0x5da6fd,_0x650eab=_0x36f60e||this['currentProjectId'],_0x1861a7=await this[_0x2d83e2(0x26d)][_0x2d83e2(0x21f)](_0x650eab),_0x2cb1ca=_0x1861a7[_0x2d83e2(0x280)](_0x13b1c9=>_0x13b1c9[_0x2d83e2(0x244)]['name']===_0x196426);if(_0x2cb1ca[_0x2d83e2(0x206)]===0x0){const _0x1c6431=_0x650eab?_0x2d83e2(0x23b)+_0x650eab:'';throw new SDKError(ErrorCode[_0x2d83e2(0x24a)],'Agent\x20not\x20found:\x20'+_0x196426+_0x1c6431,undefined,{'helpText':_0x650eab?'Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.':_0x2d83e2(0x220)});}if(_0x2cb1ca[_0x2d83e2(0x206)]>0x1)throw new SDKError(ErrorCode[_0x2d83e2(0x2aa)],_0x2d83e2(0x1e4)+_0x196426+_0x2d83e2(0x215));return _0x2cb1ca[0x0]['id'];}async['agents'](_0x5aa504){const _0x454e80=a123_0x5da6fd,_0x39cca3=_0x5aa504||this[_0x454e80(0x1d0)];return await this[_0x454e80(0x26d)][_0x454e80(0x21f)](_0x39cca3);}async['agentsFull'](_0x41a591){const _0x4948b4=a123_0x5da6fd;return await this[_0x4948b4(0x26d)]['listAgentsFull'](_0x41a591);}async[a123_0x5da6fd(0x23a)](_0x471e51){const _0x202ff1=a123_0x5da6fd;return await this[_0x202ff1(0x26d)][_0x202ff1(0x287)](_0x471e51);}async[a123_0x5da6fd(0x28d)](_0x42b486){const _0x57c8b9=a123_0x5da6fd;return await this[_0x57c8b9(0x26d)]['createAgent'](_0x42b486);}async[a123_0x5da6fd(0x27d)](_0x41bf72,_0x5a492c){const _0x5190e5=a123_0x5da6fd;return await this[_0x5190e5(0x26d)]['updateAgent'](_0x41bf72,_0x5a492c);}async[a123_0x5da6fd(0x201)](_0x8c1033){const _0x5e2c9a=a123_0x5da6fd;await this[_0x5e2c9a(0x26d)][_0x5e2c9a(0x201)](_0x8c1033);}async[a123_0x5da6fd(0x1f2)](_0x30f539){const _0x463571=a123_0x5da6fd;return await this[_0x463571(0x26d)][_0x463571(0x1f2)]({'agentId':_0x30f539});}async*[a123_0x5da6fd(0x29a)](_0x319b9b,_0x427656){const _0x241c86=a123_0x5da6fd;let _0x6754f8=_0x427656?.[_0x241c86(0x294)];const _0x46317d=_0x427656?.[_0x241c86(0x2b8)];if(!_0x6754f8){if(!_0x46317d)throw new Error(_0x241c86(0x2a5));const _0x187273=await this[_0x241c86(0x26d)][_0x241c86(0x1f2)]({'agentId':_0x46317d});_0x6754f8=_0x187273['id'],yield{'type':_0x241c86(0x292),'data':{'chatId':_0x6754f8,'agentId':_0x46317d,'projectId':_0x187273['attributes'][_0x241c86(0x2ad)]}};}for await(const _0x96c8b4 of this[_0x241c86(0x26d)][_0x241c86(0x24c)](_0x6754f8,_0x319b9b,_0x427656?.[_0x241c86(0x25e)])){yield{'type':_0x241c86(0x254),'data':_0x96c8b4};}}async['chats'](_0x3d0a30=0x32){const _0xbd192a=a123_0x5da6fd;return await this[_0xbd192a(0x26d)][_0xbd192a(0x291)](_0x3d0a30);}async[a123_0x5da6fd(0x242)](_0xc21a33){const _0x7463db=a123_0x5da6fd;return await this['client'][_0x7463db(0x1b3)](_0xc21a33);}async[a123_0x5da6fd(0x1e5)](_0x20e8e){const _0x128da2=a123_0x5da6fd;return await this[_0x128da2(0x26d)][_0x128da2(0x1e5)](_0x20e8e);}async[a123_0x5da6fd(0x285)](_0x136587){const _0x2d0b56=a123_0x5da6fd;return await this['client'][_0x2d0b56(0x257)](_0x136587);}async[a123_0x5da6fd(0x289)](_0x5ab462,_0x136a65,_0x11f75a){const _0x8f78c9=a123_0x5da6fd,_0x5f5112=_0x11f75a?.['dryRun']??![],{projectId:_0x3d5428,project:_0x251861}=await this[_0x8f78c9(0x21c)](_0x5ab462),_0x2f86f2=_0x251861[_0x8f78c9(0x244)][_0x8f78c9(0x1ee)],_0x44a656=_0x136a65||_0x2f86f2+_0x8f78c9(0x23d);if(a123_0x112763['existsSync'](_0x44a656)&&!_0x5f5112)throw new SDKError(ErrorCode[_0x8f78c9(0x1c3)],_0x8f78c9(0x265)+_0x44a656,undefined,{'helpText':_0x8f78c9(0x1ae)});const _0x2fb5fc=await this[_0x8f78c9(0x26d)][_0x8f78c9(0x1a6)](_0x3d5428),_0x48e5ef=await this[_0x8f78c9(0x26d)]['listKnowledgeBases'](_0x3d5428),_0x5f3a89=await this[_0x8f78c9(0x26d)][_0x8f78c9(0x1e9)](_0x3d5428),_0x42da64=await this[_0x8f78c9(0x26d)][_0x8f78c9(0x1f6)](_0x3d5428);if(!_0x5f5112){a123_0x112763[_0x8f78c9(0x1ca)](_0x44a656,{'recursive':!![]});const _0x33d697={'version':_0x8f78c9(0x299),'exportedAt':new Date()['toISOString'](),'exportedFrom':{'site':this['context']['site'],'projectId':_0x3d5428,'projectName':_0x2f86f2},'project':_0x251861};a123_0x112763['writeFileSync'](a123_0x44ff7c[_0x8f78c9(0x237)](_0x44a656,'project.json'),JSON[_0x8f78c9(0x1b2)](_0x33d697,null,0x2)),a123_0x112763[_0x8f78c9(0x1f1)](a123_0x44ff7c[_0x8f78c9(0x237)](_0x44a656,_0x8f78c9(0x1bf)),JSON[_0x8f78c9(0x1b2)](_0x2fb5fc,null,0x2)),a123_0x112763['writeFileSync'](a123_0x44ff7c[_0x8f78c9(0x237)](_0x44a656,_0x8f78c9(0x248)),JSON[_0x8f78c9(0x1b2)](_0x48e5ef,null,0x2)),a123_0x112763[_0x8f78c9(0x1f1)](a123_0x44ff7c[_0x8f78c9(0x237)](_0x44a656,'prompts.json'),JSON['stringify'](_0x5f3a89,null,0x2)),a123_0x112763[_0x8f78c9(0x1f1)](a123_0x44ff7c['join'](_0x44a656,_0x8f78c9(0x1f4)),JSON[_0x8f78c9(0x1b2)](_0x42da64,null,0x2));}return{'projectName':_0x2f86f2,'outputDir':_0x44a656,'counts':{'agents':_0x2fb5fc[_0x8f78c9(0x206)],'knowledgeBases':_0x48e5ef[_0x8f78c9(0x206)],'prompts':_0x5f3a89[_0x8f78c9(0x206)],'integrations':_0x42da64[_0x8f78c9(0x206)]}};}async[a123_0x5da6fd(0x1cf)](_0x29b099,_0x32ceb1){const _0x10b219=a123_0x5da6fd,_0x33c3b4=_0x32ceb1?.[_0x10b219(0x223)]??![],_0x42da3e=this[_0x10b219(0x22c)](_0x29b099),_0x515544=_0x42da3e[_0x10b219(0x222)][_0x10b219(0x2a7)],_0x40d657=this[_0x10b219(0x21a)][_0x10b219(0x2a7)],_0x4f8fd6=_0x515544!==_0x40d657?_0x515544:undefined,_0x524c41=this[_0x10b219(0x293)](a123_0x44ff7c[_0x10b219(0x237)](_0x29b099,_0x10b219(0x1bf)),[]),_0x19fb80=this[_0x10b219(0x293)](a123_0x44ff7c[_0x10b219(0x237)](_0x29b099,'knowledgebases.json'),[]),_0x40bdf7=this['loadJsonFile'](a123_0x44ff7c[_0x10b219(0x237)](_0x29b099,'prompts.json'),[]),_0x5b8c94=this[_0x10b219(0x293)](a123_0x44ff7c[_0x10b219(0x237)](_0x29b099,_0x10b219(0x1f4)),[]),_0x17abc6=_0x32ceb1?.['name']||_0x42da3e[_0x10b219(0x222)][_0x10b219(0x2a0)];if(_0x33c3b4){const _0x53409b=new Map(),_0x4206c1=[..._0x524c41],_0x54017b=_0x524c41[_0x10b219(0x206)]+0x1;let _0x3a98a2=0x0;while(_0x4206c1['length']>0x0&&_0x3a98a2<_0x54017b){_0x3a98a2++;const _0x5bbfc6=[];for(const _0x586f9a of _0x4206c1){canCreateAgent(_0x586f9a,_0x53409b)?_0x53409b[_0x10b219(0x1f8)](_0x586f9a['id'],'dry-run-'+_0x586f9a['id']):_0x5bbfc6[_0x10b219(0x279)](_0x586f9a);}if(_0x5bbfc6[_0x10b219(0x206)]===_0x4206c1[_0x10b219(0x206)])throw new SDKError(ErrorCode[_0x10b219(0x2aa)],'Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.',undefined,{'helpText':'The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.'});_0x4206c1[_0x10b219(0x206)]=0x0,_0x4206c1[_0x10b219(0x279)](..._0x5bbfc6);}const _0x4b5a87=_0x40bdf7['filter'](_0x5235da=>_0x53409b[_0x10b219(0x205)](_0x5235da[_0x10b219(0x244)][_0x10b219(0x2b8)]))[_0x10b219(0x206)];return{'projectName':_0x17abc6,'projectId':_0x10b219(0x276),'counts':{'agents':_0x524c41[_0x10b219(0x206)],'knowledgeBases':_0x19fb80[_0x10b219(0x206)],'prompts':_0x4b5a87,'integrations':_0x5b8c94[_0x10b219(0x206)]},'sourceSite':_0x4f8fd6};}const _0x1a3539=await this[_0x10b219(0x26d)][_0x10b219(0x253)]({'name':_0x17abc6,'description':_0x42da3e[_0x10b219(0x214)]['attributes'][_0x10b219(0x1b9)]}),_0x59b39d=_0x1a3539['id'],_0x1765d7=new Map(),_0x4ca44a=new Map(),_0x4320fd=new Map();for(const _0x504d48 of _0x19fb80){const _0x11407f=await this[_0x10b219(0x26d)]['createKnowledgeBase']({'projectId':_0x59b39d,'name':_0x504d48[_0x10b219(0x244)][_0x10b219(0x1ee)],'tdDatabaseName':_0x504d48['attributes'][_0x10b219(0x27f)],'tables':_0x504d48[_0x10b219(0x244)][_0x10b219(0x1c0)]});_0x1765d7['set'](_0x504d48['id'],_0x11407f['id']);}const _0x22b46a=[..._0x524c41],_0x1b3e9f=_0x524c41['length']+0x1;let _0x104055=0x0;while(_0x22b46a[_0x10b219(0x206)]>0x0&&_0x104055<_0x1b3e9f){_0x104055++;const _0x1660ec=[];for(const _0x4add03 of _0x22b46a){if(canCreateAgent(_0x4add03,_0x4ca44a)){const _0x395a4a=remapToolIds(_0x4add03[_0x10b219(0x244)][_0x10b219(0x217)],_0x1765d7,_0x4ca44a),_0x157bae=remapVariableIds(_0x4add03[_0x10b219(0x244)][_0x10b219(0x25b)],_0x1765d7),_0x489226=await this[_0x10b219(0x26d)]['createAgentResponse']({'name':_0x4add03[_0x10b219(0x244)][_0x10b219(0x1ee)],'projectId':_0x59b39d,'systemPrompt':_0x4add03[_0x10b219(0x244)][_0x10b219(0x2b6)],'starterMessage':_0x4add03[_0x10b219(0x244)][_0x10b219(0x246)],'modelType':migrateModelType(_0x4add03[_0x10b219(0x244)][_0x10b219(0x22f)]),'maxToolIterations':_0x4add03['attributes'][_0x10b219(0x1a7)],'temperature':_0x4add03[_0x10b219(0x244)][_0x10b219(0x235)],'reasoningEffort':_0x4add03[_0x10b219(0x244)][_0x10b219(0x2a6)],'outputs':_0x4add03['attributes'][_0x10b219(0x29d)],'tools':_0x395a4a,'variables':_0x157bae});_0x4ca44a[_0x10b219(0x1f8)](_0x4add03['id'],_0x489226['id']);}else _0x1660ec[_0x10b219(0x279)](_0x4add03);}if(_0x1660ec[_0x10b219(0x206)]===_0x22b46a[_0x10b219(0x206)])throw new SDKError(ErrorCode[_0x10b219(0x2aa)],'Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.',undefined,{'helpText':_0x10b219(0x218)});_0x22b46a[_0x10b219(0x206)]=0x0,_0x22b46a[_0x10b219(0x279)](..._0x1660ec);}for(const _0xb1a79 of _0x40bdf7){const _0x37c102=_0x4ca44a[_0x10b219(0x268)](_0xb1a79[_0x10b219(0x244)][_0x10b219(0x2b8)]);if(!_0x37c102)continue;const _0x14c954=await this[_0x10b219(0x26d)][_0x10b219(0x2b1)]({'projectId':_0x59b39d,'agentId':_0x37c102,'name':_0xb1a79['attributes'][_0x10b219(0x1ee)],'systemPrompt':_0xb1a79[_0x10b219(0x244)]['systemPrompt'],'template':_0xb1a79[_0x10b219(0x244)][_0x10b219(0x1d7)],'jsonSchemaHint':_0xb1a79['attributes'][_0x10b219(0x267)]});_0x4320fd[_0x10b219(0x1f8)](_0xb1a79['id'],_0x14c954['id']);}for(const _0xa72268 of _0x5b8c94){const _0x5cab5a=_0xa72268['attributes'][_0x10b219(0x1dc)][_0x10b219(0x1fa)](_0x11c418=>({..._0x11c418,'promptId':_0x4320fd['get'](_0x11c418[_0x10b219(0x1b5)])||_0x11c418[_0x10b219(0x1b5)]}));await this[_0x10b219(0x26d)][_0x10b219(0x1a9)]({'projectId':_0x59b39d,'serviceType':_0xa72268[_0x10b219(0x244)][_0x10b219(0x1b0)],'actions':_0x5cab5a,'slackMessageMode':_0xa72268[_0x10b219(0x244)]['slackMessageMode'],'chatIgnoreManagedActions':_0xa72268[_0x10b219(0x244)][_0x10b219(0x21b)],'chatWelcomeMessage':_0xa72268[_0x10b219(0x244)]['chatWelcomeMessage'],'webhookCorsOrigins':_0xa72268[_0x10b219(0x244)][_0x10b219(0x243)]});}return{'projectName':_0x17abc6,'projectId':_0x59b39d,'counts':{'agents':_0x4ca44a[_0x10b219(0x282)],'knowledgeBases':_0x1765d7['size'],'prompts':_0x4320fd[_0x10b219(0x282)],'integrations':_0x5b8c94[_0x10b219(0x206)]},'sourceSite':_0x4f8fd6};}[a123_0x5da6fd(0x293)](_0x57d254,_0x337c8a){const _0x490641=a123_0x5da6fd;if(!a123_0x112763[_0x490641(0x24e)](_0x57d254))return _0x337c8a;return JSON[_0x490641(0x22e)](a123_0x112763[_0x490641(0x274)](_0x57d254,_0x490641(0x231)));}[a123_0x5da6fd(0x22c)](_0x55630c){const _0x41ed68=a123_0x5da6fd;if(!a123_0x112763[_0x41ed68(0x24e)](_0x55630c))throw new SDKError(ErrorCode['NOT_FOUND'],_0x41ed68(0x241)+_0x55630c,undefined,{'helpText':_0x41ed68(0x1ea)});const _0x1e693a=a123_0x44ff7c[_0x41ed68(0x237)](_0x55630c,_0x41ed68(0x25d));if(!a123_0x112763[_0x41ed68(0x24e)](_0x1e693a))throw new SDKError(ErrorCode[_0x41ed68(0x21d)],_0x41ed68(0x296)+_0x55630c,undefined,{'helpText':_0x41ed68(0x2b9)});const _0x4938a2=JSON['parse'](a123_0x112763[_0x41ed68(0x274)](_0x1e693a,_0x41ed68(0x231)));if(!isSupportedBackupVersion(_0x4938a2['version']))throw new SDKError(ErrorCode[_0x41ed68(0x21d)],_0x41ed68(0x1b8)+_0x4938a2[_0x41ed68(0x203)],undefined,{'helpText':'This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.'});return _0x4938a2;}async[a123_0x5da6fd(0x22b)](_0x26542d,_0x3a327b,_0x3a390a){const _0x35d26d=a123_0x5da6fd,{projectId:_0x202cec,project:_0x4e72e2}=await this['resolveProjectName'](_0x26542d),_0x5da462=_0x4e72e2['attributes'][_0x35d26d(0x1ee)];let _0x1c1eb6;if(_0x3a327b)_0x1c1eb6=_0x3a327b;else{const _0x5d2471=a123_0x44ff7c['join'](process[_0x35d26d(0x1a3)](),_0x35d26d(0x1f5)),_0x2010e0=getSanitizedPathWithMigration(_0x5d2471,_0x5da462);_0x2010e0[_0x35d26d(0x258)]&&this[_0x35d26d(0x1f3)][_0x35d26d(0x238)]('Renamed\x20folder:\x20'+a123_0x44ff7c[_0x35d26d(0x28f)](_0x2010e0[_0x35d26d(0x1f9)])+_0x35d26d(0x1bd)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x2010e0['path'])),_0x1c1eb6=_0x2010e0[_0x35d26d(0x202)];}const _0x4aa9b0=await this[_0x35d26d(0x26d)][_0x35d26d(0x1a6)](_0x202cec),_0x16d945=await this[_0x35d26d(0x26d)][_0x35d26d(0x1c6)](_0x202cec),_0x3758bb=await this[_0x35d26d(0x26d)][_0x35d26d(0x27b)](_0x202cec),_0x331711=await safeListOrEmpty(()=>this[_0x35d26d(0x26d)]['listImageGenerators'](_0x202cec)),_0x1ea053=await safeListOrEmpty(()=>this[_0x35d26d(0x26d)][_0x35d26d(0x20d)](_0x202cec)),_0x37517e=await this['client'][_0x35d26d(0x1e9)](_0x202cec),_0x4659b1=await this['client'][_0x35d26d(0x1f6)](_0x202cec),_0x1d28c1=await safeListOrEmpty(()=>this[_0x35d26d(0x26d)][_0x35d26d(0x1ad)](_0x202cec)),_0x58c5ef=await safeListOrEmpty(()=>this[_0x35d26d(0x26d)]['listExperimentalArtifacts'](_0x202cec)),_0x2d4ef1=_0x4659b1[_0x35d26d(0x280)](_0x3dcd60=>!_0x3dcd60[_0x35d26d(0x244)][_0x35d26d(0x1f7)]&&SAFE_INTEGRATION_TYPES[_0x35d26d(0x1d3)](_0x3dcd60[_0x35d26d(0x244)][_0x35d26d(0x1b0)]['toLowerCase']())),_0x4c038d=new Map(),_0x2e3bf6=new Map(),_0x380911=new Map(),_0x4fdfa0=new Map(),_0x2f2f0f=new Map(),_0x39a930=new Map(),_0xe7ea33=new Map();for(const _0x23034d of _0x4aa9b0){_0x4c038d[_0x35d26d(0x1f8)](_0x23034d['id'],_0x23034d[_0x35d26d(0x244)]['name']);}for(const _0x518955 of _0x16d945){_0x2e3bf6['set'](_0x518955['id'],_0x518955['attributes']['name']);}for(const _0x211d1d of _0x3758bb){_0x380911[_0x35d26d(0x1f8)](_0x211d1d['id'],_0x211d1d[_0x35d26d(0x244)][_0x35d26d(0x1ee)]);}for(const _0x1fedce of _0x331711){_0x4fdfa0[_0x35d26d(0x1f8)](_0x1fedce['id'],_0x1fedce[_0x35d26d(0x244)]['name']);}for(const _0x20e721 of _0x1ea053){_0x2f2f0f[_0x35d26d(0x1f8)](_0x20e721['id'],_0x20e721[_0x35d26d(0x244)][_0x35d26d(0x1ee)]);}for(const _0x1c8617 of _0x37517e){_0x39a930[_0x35d26d(0x1f8)](_0x1c8617['id'],_0x1c8617[_0x35d26d(0x244)][_0x35d26d(0x1ee)]);}for(const _0x1620a7 of _0x1d28c1){_0xe7ea33['set'](_0x1620a7['id'],_0x1620a7[_0x35d26d(0x244)]['name']);}const _0x321dfc={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x2e3bf6,'TextKnowledgeBase':_0x380911,'Agent':_0x4c038d,'WebSearchTool':_0x2f2f0f,'ImageGenerator':_0x4fdfa0,'ExperimentalKnowledgeBase':_0xe7ea33}),'resolvePromptName':async _0x303e01=>_0x39a930[_0x35d26d(0x268)](_0x303e01),'onWarning':_0x26c4e9=>this['logger']['warn'](_0x26c4e9)},_0x3f3790={'projectName':_0x5da462,'outputDir':_0x1c1eb6,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'knowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'textKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'prompts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'integrations':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalKnowledgeBases':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0},'experimentalArtifacts':{'total':0x0,'new':0x0,'updated':0x0,'unchanged':0x0}}},_0x39332e=[],_0x2d6aa=[];for(const _0x378300 of _0x4aa9b0){const _0x1afa79=getSanitizedPathWithMigration(_0x1c1eb6,_0x378300[_0x35d26d(0x244)][_0x35d26d(0x1ee)]);_0x1afa79[_0x35d26d(0x258)]&&this[_0x35d26d(0x1f3)][_0x35d26d(0x238)]('Renamed\x20agent\x20folder:\x20'+a123_0x44ff7c[_0x35d26d(0x28f)](_0x1afa79[_0x35d26d(0x1f9)])+_0x35d26d(0x1bd)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x1afa79[_0x35d26d(0x202)]));const _0x4c3aad=_0x1afa79['path'],_0x3f63fb=a123_0x44ff7c[_0x35d26d(0x237)](_0x4c3aad,'prompt.md'),_0x5a8453=a123_0x44ff7c[_0x35d26d(0x237)](_0x4c3aad,_0x35d26d(0x255)),_0x24c9f4=a123_0x44ff7c[_0x35d26d(0x237)](_0x4c3aad,_0x35d26d(0x283)),{yaml:_0x5b7ce9,systemPrompt:_0x1cc6d7,starterMessage:_0x272ad4}=await agentResponseToDef(_0x378300,_0x321dfc),_0x2cb6d3=toAgentYamlString(_0x5b7ce9),_0x5ac69e=!a123_0x112763[_0x35d26d(0x24e)](_0x5a8453);let _0xf37de=_0x5ac69e,_0x39985d;if(!_0x5ac69e){const _0x5bb172=a123_0x112763[_0x35d26d(0x24e)](_0x3f63fb)?a123_0x112763[_0x35d26d(0x274)](_0x3f63fb,_0x35d26d(0x231)):'',_0x430f04=a123_0x112763[_0x35d26d(0x274)](_0x5a8453,'utf-8'),_0x454ae4='#\x20prompt.md\x0a'+_0x5bb172+_0x35d26d(0x1e0)+_0x430f04,_0x2e9930=_0x35d26d(0x29f)+_0x1cc6d7+_0x35d26d(0x1e0)+_0x2cb6d3,_0x5c8025=generateDiff(_0x454ae4,_0x2e9930);_0xf37de=hasChanges(_0x5c8025),_0xf37de&&(_0x39985d=formatDiffWithColors(_0x5c8025));}_0x39332e[_0x35d26d(0x279)]({'path':_0x4c3aad,'content':'','isDir':!![]}),_0x39332e[_0x35d26d(0x279)]({'path':_0x3f63fb,'content':_0x1cc6d7}),_0x39332e['push']({'path':_0x5a8453,'content':_0x2cb6d3});_0x272ad4&&_0x272ad4[_0x35d26d(0x1d3)]('\x0a')&&_0x39332e['push']({'path':_0x24c9f4,'content':_0x272ad4});_0x3f3790[_0x35d26d(0x1f5)]['push']({'agentName':_0x378300[_0x35d26d(0x244)][_0x35d26d(0x1ee)],'outputPath':_0x4c3aad,'isNew':_0x5ac69e,'hasChanges':_0xf37de,'diff':_0x39985d}),_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x1f5)][_0x35d26d(0x250)]++;if(_0x5ac69e)_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x1f5)][_0x35d26d(0x264)]++;else{if(_0xf37de)_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x1f5)]['updated']++;else _0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x1f5)][_0x35d26d(0x252)]++;}}for(const _0x4c98f5 of _0x16d945){if(_0x4c98f5[_0x35d26d(0x244)][_0x35d26d(0x1f7)])continue;const _0x445bd3=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x1c1eb6),_0x4c98f5[_0x35d26d(0x244)][_0x35d26d(0x1ee)],_0x35d26d(0x29c));_0x445bd3[_0x35d26d(0x258)]&&this['logger'][_0x35d26d(0x238)](_0x35d26d(0x269)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x445bd3[_0x35d26d(0x1f9)])+'\x20→\x20'+a123_0x44ff7c[_0x35d26d(0x28f)](_0x445bd3[_0x35d26d(0x202)]));const _0xd2ee4a=_0x445bd3[_0x35d26d(0x202)],_0x214b6c=apiKnowledgeBaseToYaml(_0x4c98f5),_0x1ce88c=toKnowledgeBaseYamlString(_0x214b6c),_0x3af495=!a123_0x112763[_0x35d26d(0x24e)](_0xd2ee4a);let _0x4a18b9=_0x3af495,_0x5e097b;if(!_0x3af495){const _0x1dc49b=a123_0x112763['readFileSync'](_0xd2ee4a,_0x35d26d(0x231)),_0x5780e4=generateDiff(_0x1dc49b,_0x1ce88c);_0x4a18b9=hasChanges(_0x5780e4),_0x4a18b9&&(_0x5e097b=formatDiffWithColors(_0x5780e4));}_0x39332e['push']({'path':_0xd2ee4a,'content':_0x1ce88c}),_0x3f3790[_0x35d26d(0x1cc)][_0x35d26d(0x279)]({'name':_0x4c98f5[_0x35d26d(0x244)]['name'],'outputPath':_0xd2ee4a,'isNew':_0x3af495,'hasChanges':_0x4a18b9,'diff':_0x5e097b}),_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x1cc)][_0x35d26d(0x250)]++;if(_0x3af495)_0x3f3790[_0x35d26d(0x211)]['knowledgeBases'][_0x35d26d(0x264)]++;else{if(_0x4a18b9)_0x3f3790['counts'][_0x35d26d(0x1cc)][_0x35d26d(0x266)]++;else _0x3f3790['counts'][_0x35d26d(0x1cc)][_0x35d26d(0x252)]++;}}for(const _0x57c21e of _0x3758bb){if(_0x57c21e[_0x35d26d(0x244)][_0x35d26d(0x1f7)])continue;const _0x581a4e=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x1c1eb6),_0x57c21e[_0x35d26d(0x244)]['name'],_0x35d26d(0x1a5));_0x581a4e['renamed']&&this[_0x35d26d(0x1f3)][_0x35d26d(0x238)](_0x35d26d(0x1c1)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x581a4e[_0x35d26d(0x1f9)])+_0x35d26d(0x1bd)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x581a4e['path']));const _0x4be675=_0x581a4e[_0x35d26d(0x202)],_0x53956d=toTextKnowledgeBaseMd(_0x57c21e[_0x35d26d(0x244)]['name'],_0x57c21e[_0x35d26d(0x244)]['text']),_0x45f9de=!a123_0x112763[_0x35d26d(0x24e)](_0x4be675);let _0x3003ab=_0x45f9de,_0xf43f85;if(!_0x45f9de){const _0x4025af=a123_0x112763[_0x35d26d(0x274)](_0x4be675,_0x35d26d(0x231)),_0x1502b2=generateDiff(_0x4025af,_0x53956d);_0x3003ab=hasChanges(_0x1502b2),_0x3003ab&&(_0xf43f85=formatDiffWithColors(_0x1502b2));}_0x39332e[_0x35d26d(0x279)]({'path':_0x4be675,'content':_0x53956d}),_0x3f3790[_0x35d26d(0x19f)][_0x35d26d(0x279)]({'name':_0x57c21e[_0x35d26d(0x244)][_0x35d26d(0x1ee)],'outputPath':_0x4be675,'isNew':_0x45f9de,'hasChanges':_0x3003ab,'diff':_0xf43f85}),_0x3f3790['counts'][_0x35d26d(0x19f)][_0x35d26d(0x250)]++;if(_0x45f9de)_0x3f3790['counts']['textKnowledgeBases'][_0x35d26d(0x264)]++;else{if(_0x3003ab)_0x3f3790['counts'][_0x35d26d(0x19f)]['updated']++;else _0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x19f)][_0x35d26d(0x252)]++;}}for(const _0x32c66a of _0x37517e){if(_0x32c66a[_0x35d26d(0x244)][_0x35d26d(0x1f7)])continue;const _0x2f1359=getSanitizedPathWithMigration(getPromptsDir(_0x1c1eb6),_0x32c66a[_0x35d26d(0x244)][_0x35d26d(0x1ee)],_0x35d26d(0x29c));_0x2f1359[_0x35d26d(0x258)]&&this[_0x35d26d(0x1f3)][_0x35d26d(0x238)](_0x35d26d(0x19e)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x2f1359['oldPath'])+_0x35d26d(0x1bd)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x2f1359[_0x35d26d(0x202)]));const _0x49ca35=_0x2f1359[_0x35d26d(0x202)],_0x349747=await apiPromptToYaml(_0x32c66a,_0x321dfc);if(!_0x349747)continue;const _0x382db6=toPromptYamlString(_0x349747),_0x2c6634=!a123_0x112763[_0x35d26d(0x24e)](_0x49ca35);let _0x4176b=_0x2c6634,_0x17fdc8;if(!_0x2c6634){const _0x30b520=a123_0x112763['readFileSync'](_0x49ca35,_0x35d26d(0x231)),_0x4a0415=generateDiff(_0x30b520,_0x382db6);_0x4176b=hasChanges(_0x4a0415),_0x4176b&&(_0x17fdc8=formatDiffWithColors(_0x4a0415));}_0x39332e[_0x35d26d(0x279)]({'path':_0x49ca35,'content':_0x382db6}),_0x3f3790[_0x35d26d(0x1d5)][_0x35d26d(0x279)]({'name':_0x32c66a[_0x35d26d(0x244)][_0x35d26d(0x1ee)],'outputPath':_0x49ca35,'isNew':_0x2c6634,'hasChanges':_0x4176b,'diff':_0x17fdc8}),_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x1d5)][_0x35d26d(0x250)]++;if(_0x2c6634)_0x3f3790['counts'][_0x35d26d(0x1d5)]['new']++;else{if(_0x4176b)_0x3f3790['counts']['prompts'][_0x35d26d(0x266)]++;else _0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x1d5)]['unchanged']++;}}for(const _0x67dbe2 of _0x2d4ef1){const _0x6a968b=_0x67dbe2[_0x35d26d(0x244)][_0x35d26d(0x1b0)][_0x35d26d(0x1df)](),_0x19c13e=getSanitizedPathWithMigration(getIntegrationsDir(_0x1c1eb6),_0x6a968b,_0x35d26d(0x29c));_0x19c13e[_0x35d26d(0x258)]&&this[_0x35d26d(0x1f3)]['info']('Renamed\x20integration\x20file:\x20'+a123_0x44ff7c[_0x35d26d(0x28f)](_0x19c13e[_0x35d26d(0x1f9)])+'\x20→\x20'+a123_0x44ff7c[_0x35d26d(0x28f)](_0x19c13e[_0x35d26d(0x202)]));const _0x5e6016=_0x19c13e[_0x35d26d(0x202)],_0x4e45ba=await apiIntegrationToYaml(_0x67dbe2,_0x321dfc),_0x124632=toIntegrationYamlString(_0x4e45ba),_0x17f805=!a123_0x112763['existsSync'](_0x5e6016);let _0x9eb407=_0x17f805,_0x12c616;if(!_0x17f805){const _0x51afd2=a123_0x112763[_0x35d26d(0x274)](_0x5e6016,_0x35d26d(0x231)),_0x2953f9=generateDiff(_0x51afd2,_0x124632);_0x9eb407=hasChanges(_0x2953f9),_0x9eb407&&(_0x12c616=formatDiffWithColors(_0x2953f9));}_0x39332e['push']({'path':_0x5e6016,'content':_0x124632}),_0x3f3790[_0x35d26d(0x2a1)]['push']({'name':_0x6a968b,'outputPath':_0x5e6016,'isNew':_0x17f805,'hasChanges':_0x9eb407,'diff':_0x12c616}),_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x2a1)][_0x35d26d(0x250)]++;if(_0x17f805)_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x2a1)][_0x35d26d(0x264)]++;else{if(_0x9eb407)_0x3f3790[_0x35d26d(0x211)]['integrations'][_0x35d26d(0x266)]++;else _0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x2a1)][_0x35d26d(0x252)]++;}}for(const _0x44fb2b of _0x1d28c1){if(_0x44fb2b[_0x35d26d(0x244)][_0x35d26d(0x1f7)])continue;const _0x4842a9=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x1c1eb6),_0x44fb2b[_0x35d26d(0x244)]['name']);_0x4842a9[_0x35d26d(0x258)]&&this[_0x35d26d(0x1f3)]['info']('Renamed\x20experimental\x20KB\x20directory:\x20'+a123_0x44ff7c['basename'](_0x4842a9[_0x35d26d(0x1f9)])+_0x35d26d(0x1bd)+a123_0x44ff7c[_0x35d26d(0x28f)](_0x4842a9[_0x35d26d(0x202)]));const _0x6ab118=_0x4842a9[_0x35d26d(0x202)],_0x31ed74=a123_0x44ff7c[_0x35d26d(0x237)](_0x6ab118,sanitizeForFilesystem(_0x44fb2b[_0x35d26d(0x244)][_0x35d26d(0x1ee)])+_0x35d26d(0x29c)),_0x4d0d0d=a123_0x44ff7c[_0x35d26d(0x237)](_0x6ab118,_0x35d26d(0x216)),_0x240e83=apiExperimentalKnowledgeBaseToYaml(_0x44fb2b),_0x5e97ae=toExperimentalKnowledgeBaseYamlString(_0x240e83),_0x41af35=!a123_0x112763[_0x35d26d(0x24e)](_0x6ab118);let _0x12565a=_0x41af35,_0xa64283,_0xbdd241=_0x5e97ae;const _0xc82199=[..._0x240e83[_0x35d26d(0x216)]][_0x35d26d(0x273)]((_0x5e9be1,_0x1b6487)=>_0x5e9be1[_0x35d26d(0x1ee)][_0x35d26d(0x212)](_0x1b6487[_0x35d26d(0x1ee)]));for(const _0x4356f4 of _0xc82199){_0xbdd241+=_0x35d26d(0x1d6)+_0x4356f4[_0x35d26d(0x1ee)]+'\x20---\x0a'+_0x4356f4['code']+_0x35d26d(0x2b4)+_0x4356f4[_0x35d26d(0x1ee)]+'\x20---\x0a'+_0x4356f4[_0x35d26d(0x1a1)]+'\x0a';}if(!_0x41af35){let _0x3a3cb3='';a123_0x112763['existsSync'](_0x31ed74)&&(_0x3a3cb3=a123_0x112763[_0x35d26d(0x274)](_0x31ed74,'utf-8'));if(a123_0x112763[_0x35d26d(0x24e)](_0x4d0d0d)){const _0x24d96c=a123_0x112763[_0x35d26d(0x28c)](_0x4d0d0d,{'withFileTypes':!![]}),_0x47d641=_0x24d96c[_0x35d26d(0x280)](_0x4fc06e=>_0x4fc06e['isDirectory']())[_0x35d26d(0x273)]((_0x4a39b0,_0x40197b)=>_0x4a39b0['name']['localeCompare'](_0x40197b[_0x35d26d(0x1ee)]));for(const _0x1a370d of _0x47d641){const _0x39f240=a123_0x44ff7c['join'](_0x4d0d0d,_0x1a370d['name'],_0x35d26d(0x23f)),_0x19ef9c=a123_0x44ff7c[_0x35d26d(0x237)](_0x4d0d0d,_0x1a370d[_0x35d26d(0x1ee)],_0x35d26d(0x240));a123_0x112763[_0x35d26d(0x24e)](_0x39f240)&&(_0x3a3cb3+=_0x35d26d(0x1d6)+_0x1a370d[_0x35d26d(0x1ee)]+_0x35d26d(0x25f)+a123_0x112763[_0x35d26d(0x274)](_0x39f240,'utf-8')+'\x0a'),a123_0x112763['existsSync'](_0x19ef9c)&&(_0x3a3cb3+='---\x20schema:\x20'+_0x1a370d[_0x35d26d(0x1ee)]+_0x35d26d(0x25f)+a123_0x112763[_0x35d26d(0x274)](_0x19ef9c,_0x35d26d(0x231))+'\x0a');}}const _0x595cd6=generateDiff(_0x3a3cb3,_0xbdd241);_0x12565a=hasChanges(_0x595cd6),_0x12565a&&(_0xa64283=formatDiffWithColors(_0x595cd6));}_0x39332e[_0x35d26d(0x279)]({'path':_0x6ab118,'content':'','isDir':!![]}),_0x39332e['push']({'path':_0x31ed74,'content':_0x5e97ae}),_0x39332e['push']({'path':_0x4d0d0d,'content':'','isDir':!![]});for(const _0x569e28 of _0x240e83['functions']){const _0x3fa5a8=a123_0x44ff7c[_0x35d26d(0x237)](_0x4d0d0d,sanitizeForFilesystem(_0x569e28[_0x35d26d(0x1ee)])),_0x325441=a123_0x44ff7c[_0x35d26d(0x237)](_0x3fa5a8,_0x35d26d(0x23f)),_0x3b063a=a123_0x44ff7c['join'](_0x3fa5a8,'json_schema.json');_0x39332e[_0x35d26d(0x279)]({'path':_0x3fa5a8,'content':'','isDir':!![]}),_0x39332e['push']({'path':_0x325441,'content':_0x569e28['code']}),_0x39332e[_0x35d26d(0x279)]({'path':_0x3b063a,'content':_0x569e28[_0x35d26d(0x1a1)]});}if(a123_0x112763[_0x35d26d(0x24e)](_0x4d0d0d)){const _0x32e6d3=a123_0x112763[_0x35d26d(0x28c)](_0x4d0d0d,{'withFileTypes':!![]}),_0x39f63d=new Set(_0x240e83[_0x35d26d(0x216)][_0x35d26d(0x1fa)](_0x40d718=>sanitizeForFilesystem(_0x40d718[_0x35d26d(0x1ee)])));for(const _0x3c638e of _0x32e6d3){if(_0x3c638e[_0x35d26d(0x1d1)]()&&!_0x39f63d[_0x35d26d(0x205)](_0x3c638e[_0x35d26d(0x1ee)])){const _0x4becba=a123_0x44ff7c['join'](_0x4d0d0d,_0x3c638e[_0x35d26d(0x1ee)]);_0x2d6aa[_0x35d26d(0x279)]({'path':_0x4becba,'isDir':!![]});}}}_0x3f3790['experimentalKnowledgeBases'][_0x35d26d(0x279)]({'name':_0x44fb2b[_0x35d26d(0x244)][_0x35d26d(0x1ee)],'outputPath':_0x6ab118,'isNew':_0x41af35,'hasChanges':_0x12565a,'diff':_0xa64283}),_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x259)]['total']++;if(_0x41af35)_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x259)][_0x35d26d(0x264)]++;else{if(_0x12565a)_0x3f3790[_0x35d26d(0x211)]['experimentalKnowledgeBases'][_0x35d26d(0x266)]++;else _0x3f3790[_0x35d26d(0x211)]['experimentalKnowledgeBases'][_0x35d26d(0x252)]++;}}for(const _0x4480d5 of _0x58c5ef){if(_0x4480d5[_0x35d26d(0x244)]['isManaged'])continue;const _0x1dcef0=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x1c1eb6),_0x4480d5[_0x35d26d(0x244)][_0x35d26d(0x1ee)]);_0x1dcef0[_0x35d26d(0x258)]&&this[_0x35d26d(0x1f3)][_0x35d26d(0x238)](_0x35d26d(0x1a8)+a123_0x44ff7c['basename'](_0x1dcef0['oldPath'])+_0x35d26d(0x1bd)+a123_0x44ff7c['basename'](_0x1dcef0[_0x35d26d(0x202)]));const _0x23e85d=_0x1dcef0[_0x35d26d(0x202)],_0x56a813=a123_0x44ff7c[_0x35d26d(0x237)](_0x23e85d,sanitizeForFilesystem(_0x4480d5[_0x35d26d(0x244)][_0x35d26d(0x1ee)])+_0x35d26d(0x29c)),_0x399ef0=a123_0x44ff7c['join'](_0x23e85d,_0x35d26d(0x23f)),_0xb05032=a123_0x44ff7c[_0x35d26d(0x237)](_0x23e85d,_0x35d26d(0x28a)),_0x1a5060=apiExperimentalArtifactToYaml(_0x4480d5),_0x110d05=toExperimentalArtifactYamlString(_0x1a5060),_0x24025a=!a123_0x112763[_0x35d26d(0x24e)](_0x23e85d);let _0x16ef5=_0x24025a,_0x222c43,_0x5256b8=_0x110d05+(_0x35d26d(0x23e)+_0x1a5060[_0x35d26d(0x26e)]+'\x0a');const _0x4766e8=[..._0x1a5060[_0x35d26d(0x28a)]][_0x35d26d(0x273)]((_0x37b9fe,_0x170ec0)=>_0x37b9fe[_0x35d26d(0x1e1)][_0x35d26d(0x212)](_0x170ec0['file_name']));for(const _0x127895 of _0x4766e8){_0x5256b8+=_0x35d26d(0x27a)+_0x127895[_0x35d26d(0x1e1)]+'\x20---\x0a'+_0x127895[_0x35d26d(0x1c7)]+'\x0a';}if(!_0x24025a){let _0x36d768='';a123_0x112763['existsSync'](_0x56a813)&&(_0x36d768=a123_0x112763[_0x35d26d(0x274)](_0x56a813,_0x35d26d(0x231)));a123_0x112763[_0x35d26d(0x24e)](_0x399ef0)&&(_0x36d768+='\x0a---\x20code\x20---\x0a'+a123_0x112763['readFileSync'](_0x399ef0,_0x35d26d(0x231))+'\x0a');if(a123_0x112763['existsSync'](_0xb05032)){const _0x5e6525=a123_0x112763['readdirSync'](_0xb05032),_0x41332e=_0x5e6525[_0x35d26d(0x280)](_0xad103c=>{const _0x8200b8=_0x35d26d,_0x350340=a123_0x44ff7c[_0x8200b8(0x237)](_0xb05032,_0xad103c);return a123_0x112763['statSync'](_0x350340)[_0x8200b8(0x20f)]();})[_0x35d26d(0x273)]((_0x4d2251,_0x6194e)=>_0x4d2251['localeCompare'](_0x6194e));for(const _0x2da76a of _0x41332e){const _0x1a5497=a123_0x44ff7c[_0x35d26d(0x237)](_0xb05032,_0x2da76a);_0x36d768+=_0x35d26d(0x27a)+_0x2da76a+_0x35d26d(0x25f)+a123_0x112763[_0x35d26d(0x274)](_0x1a5497,_0x35d26d(0x231))+'\x0a';}}const _0x1952b1=generateDiff(_0x36d768,_0x5256b8);_0x16ef5=hasChanges(_0x1952b1),_0x16ef5&&(_0x222c43=formatDiffWithColors(_0x1952b1));}_0x39332e[_0x35d26d(0x279)]({'path':_0x23e85d,'content':'','isDir':!![]}),_0x39332e[_0x35d26d(0x279)]({'path':_0x56a813,'content':_0x110d05}),_0x39332e[_0x35d26d(0x279)]({'path':_0x399ef0,'content':_0x1a5060['code']});if(_0x1a5060[_0x35d26d(0x28a)][_0x35d26d(0x206)]>0x0){_0x39332e[_0x35d26d(0x279)]({'path':_0xb05032,'content':'','isDir':!![]});for(const _0x3f0e1a of _0x1a5060[_0x35d26d(0x28a)]){const _0x5d2de5=a123_0x44ff7c[_0x35d26d(0x237)](_0xb05032,_0x3f0e1a[_0x35d26d(0x1e1)]);_0x39332e[_0x35d26d(0x279)]({'path':_0x5d2de5,'content':_0x3f0e1a[_0x35d26d(0x1c7)]});}}if(a123_0x112763[_0x35d26d(0x24e)](_0xb05032)){const _0x2a7989=a123_0x112763[_0x35d26d(0x28c)](_0xb05032),_0x5375c1=new Set(_0x1a5060[_0x35d26d(0x28a)][_0x35d26d(0x1fa)](_0x156307=>_0x156307[_0x35d26d(0x1e1)]));for(const _0x52c5d6 of _0x2a7989){const _0x2b2516=a123_0x44ff7c[_0x35d26d(0x237)](_0xb05032,_0x52c5d6);a123_0x112763[_0x35d26d(0x1ef)](_0x2b2516)[_0x35d26d(0x20f)]()&&!_0x5375c1[_0x35d26d(0x205)](_0x52c5d6)&&_0x2d6aa[_0x35d26d(0x279)]({'path':_0x2b2516});}}_0x3f3790[_0x35d26d(0x221)]['push']({'name':_0x4480d5[_0x35d26d(0x244)][_0x35d26d(0x1ee)],'outputPath':_0x23e85d,'isNew':_0x24025a,'hasChanges':_0x16ef5,'diff':_0x222c43}),_0x3f3790['counts'][_0x35d26d(0x221)][_0x35d26d(0x250)]++;if(_0x24025a)_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x221)]['new']++;else{if(_0x16ef5)_0x3f3790[_0x35d26d(0x211)][_0x35d26d(0x221)][_0x35d26d(0x266)]++;else _0x3f3790[_0x35d26d(0x211)]['experimentalArtifacts']['unchanged']++;}}if(_0x3a390a?.['dryRun'])return _0x3f3790;a123_0x112763['mkdirSync'](_0x1c1eb6,{'recursive':!![]}),a123_0x112763[_0x35d26d(0x1ca)](getKnowledgeBasesDir(_0x1c1eb6),{'recursive':!![]}),a123_0x112763[_0x35d26d(0x1ca)](getPromptsDir(_0x1c1eb6),{'recursive':!![]}),a123_0x112763[_0x35d26d(0x1ca)](getIntegrationsDir(_0x1c1eb6),{'recursive':!![]}),a123_0x112763[_0x35d26d(0x1ca)](getExperimentalKnowledgeBasesDir(_0x1c1eb6),{'recursive':!![]}),a123_0x112763['mkdirSync'](getExperimentalArtifactsDir(_0x1c1eb6),{'recursive':!![]});const _0x519359=a123_0x44ff7c[_0x35d26d(0x237)](_0x1c1eb6,'tdx.json');a123_0x112763[_0x35d26d(0x1f1)](_0x519359,createAgentConfigContent(_0x5da462));for(const _0x49abba of _0x39332e){if(_0x49abba[_0x35d26d(0x227)])a123_0x112763['mkdirSync'](_0x49abba[_0x35d26d(0x202)],{'recursive':!![]});else{const _0x11408d=a123_0x44ff7c[_0x35d26d(0x2af)](_0x49abba['path']);!a123_0x112763[_0x35d26d(0x24e)](_0x11408d)&&a123_0x112763[_0x35d26d(0x1ca)](_0x11408d,{'recursive':!![]}),a123_0x112763[_0x35d26d(0x1f1)](_0x49abba[_0x35d26d(0x202)],_0x49abba['content']);}}for(const _0x171cf9 of _0x2d6aa){_0x171cf9['isDir']?(a123_0x112763[_0x35d26d(0x226)](_0x171cf9[_0x35d26d(0x202)],{'recursive':!![],'force':!![]}),this[_0x35d26d(0x1f3)][_0x35d26d(0x238)]('Removed\x20deleted\x20directory:\x20'+a123_0x44ff7c[_0x35d26d(0x28f)](a123_0x44ff7c['dirname'](_0x171cf9['path']))+'/'+a123_0x44ff7c[_0x35d26d(0x28f)](_0x171cf9[_0x35d26d(0x202)]))):(a123_0x112763[_0x35d26d(0x226)](_0x171cf9[_0x35d26d(0x202)],{'force':!![]}),this[_0x35d26d(0x1f3)][_0x35d26d(0x238)](_0x35d26d(0x2ac)+a123_0x44ff7c[_0x35d26d(0x28f)](a123_0x44ff7c[_0x35d26d(0x2af)](_0x171cf9[_0x35d26d(0x202)]))+'/'+a123_0x44ff7c[_0x35d26d(0x28f)](_0x171cf9[_0x35d26d(0x202)])));}return _0x3f3790;}async[a123_0x5da6fd(0x1db)](_0x1a8742,_0x54c0e0){const _0x3f27eb=a123_0x5da6fd,_0x343820=a123_0x44ff7c[_0x3f27eb(0x237)](_0x1a8742,'tdx.json');if(!a123_0x112763[_0x3f27eb(0x24e)](_0x343820))throw new SDKError(ErrorCode[_0x3f27eb(0x21d)],'No\x20tdx.json\x20found\x20in\x20'+_0x1a8742,undefined,{'helpText':_0x3f27eb(0x1fe)});const _0x1827e4=loadAgentConfig(_0x343820),_0x245f7f=await this['resolveProjectId'](_0x1827e4[_0x3f27eb(0x272)]),_0xbc1801=await this[_0x3f27eb(0x26d)][_0x3f27eb(0x1e6)](_0x245f7f),_0x1725e2=_0xbc1801[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0x4654a1={'projectName':_0x1725e2,'projectId':_0x245f7f,'agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x1fe07c=[],_0xf1697=[],_0x4acc23=[],_0x28d354=[],_0x241254=[],_0x1ff2dd=[],_0x33170e=a123_0x112763[_0x3f27eb(0x28c)](_0x1a8742,{'withFileTypes':!![]});for(const _0x1b0d38 of _0x33170e){if(!_0x1b0d38['isDirectory']())continue;if([_0x3f27eb(0x295),_0x3f27eb(0x1d5),'integrations',_0x3f27eb(0x1b6),_0x3f27eb(0x1ce)][_0x3f27eb(0x1d3)](_0x1b0d38[_0x3f27eb(0x1ee)]))continue;const _0x48e538=a123_0x44ff7c[_0x3f27eb(0x237)](_0x1a8742,_0x1b0d38['name']);if(isAgentDir(_0x48e538)){const _0x9c5647=a123_0x44ff7c['join'](_0x48e538,'agent.yml'),_0x1ed6ee=a123_0x44ff7c[_0x3f27eb(0x237)](_0x48e538,'prompt.md'),_0x34bcd8=a123_0x44ff7c[_0x3f27eb(0x237)](_0x48e538,'starter_message.md'),_0xfe9d5=parseAgentYaml(a123_0x112763['readFileSync'](_0x9c5647,_0x3f27eb(0x231)),_0x9c5647),_0x5e1b33=a123_0x112763['existsSync'](_0x1ed6ee)?a123_0x112763[_0x3f27eb(0x274)](_0x1ed6ee,'utf-8'):'',_0xf6d6e0=a123_0x112763[_0x3f27eb(0x24e)](_0x34bcd8)?a123_0x112763['readFileSync'](_0x34bcd8,_0x3f27eb(0x231)):_0xfe9d5[_0x3f27eb(0x26a)];_0x1fe07c[_0x3f27eb(0x279)]({'name':_0xfe9d5[_0x3f27eb(0x1ee)],'dir':_0x48e538,'yaml':_0xfe9d5,'systemPrompt':_0x5e1b33,'starterMessage':_0xf6d6e0});}}const _0x3508d0=getKnowledgeBasesDir(_0x1a8742);if(a123_0x112763['existsSync'](_0x3508d0)){const _0x15958c=a123_0x112763['readdirSync'](_0x3508d0);for(const _0x1070f9 of _0x15958c){const _0x362a77=a123_0x44ff7c['join'](_0x3508d0,_0x1070f9);if(_0x1070f9[_0x3f27eb(0x24d)](_0x3f27eb(0x29c))){const _0x3e1b55=parseKnowledgeBaseYaml(a123_0x112763[_0x3f27eb(0x274)](_0x362a77,'utf-8'),_0x362a77);_0xf1697[_0x3f27eb(0x279)]({'name':_0x3e1b55['name'],'path':_0x362a77,'yaml':_0x3e1b55});}else{if(_0x1070f9[_0x3f27eb(0x24d)]('.md')){const _0xc84e9d=a123_0x112763[_0x3f27eb(0x274)](_0x362a77,'utf-8'),{name:_0x3064e4,text:_0x4beb54}=parseTextKnowledgeBaseMd(_0xc84e9d,_0x1070f9);_0x4acc23[_0x3f27eb(0x279)]({'name':_0x3064e4,'path':_0x362a77,'text':_0x4beb54});}}}}const _0x3631cc=getPromptsDir(_0x1a8742);if(a123_0x112763[_0x3f27eb(0x24e)](_0x3631cc)){const _0x3a0045=a123_0x112763[_0x3f27eb(0x28c)](_0x3631cc)[_0x3f27eb(0x280)](_0x13ac57=>_0x13ac57['endsWith'](_0x3f27eb(0x29c)));for(const _0x40909 of _0x3a0045){const _0x6b2d7a=a123_0x44ff7c[_0x3f27eb(0x237)](_0x3631cc,_0x40909),_0x362fe3=parsePromptYaml(a123_0x112763[_0x3f27eb(0x274)](_0x6b2d7a,_0x3f27eb(0x231)),_0x6b2d7a);_0x28d354[_0x3f27eb(0x279)]({'name':_0x362fe3[_0x3f27eb(0x1ee)],'path':_0x6b2d7a,'yaml':_0x362fe3});}}const _0x443a67=[],_0x4776eb=getIntegrationsDir(_0x1a8742);if(a123_0x112763[_0x3f27eb(0x24e)](_0x4776eb)){const _0x19bde9=a123_0x112763[_0x3f27eb(0x28c)](_0x4776eb)[_0x3f27eb(0x280)](_0x442843=>_0x442843[_0x3f27eb(0x24d)](_0x3f27eb(0x29c)));for(const _0x2fb382 of _0x19bde9){const _0x37d5b7=a123_0x44ff7c['join'](_0x4776eb,_0x2fb382),_0x287d2b=parseIntegrationYaml(a123_0x112763[_0x3f27eb(0x274)](_0x37d5b7,_0x3f27eb(0x231)),_0x37d5b7);if(!SAFE_INTEGRATION_TYPES['includes'](_0x287d2b[_0x3f27eb(0x20e)][_0x3f27eb(0x1df)]())){this[_0x3f27eb(0x1f3)][_0x3f27eb(0x247)](_0x3f27eb(0x1e2)+_0x287d2b[_0x3f27eb(0x1ee)]+_0x3f27eb(0x2b5)+_0x287d2b[_0x3f27eb(0x20e)]+_0x3f27eb(0x208)+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES['join'](',\x20')+')\x20can\x20be\x20pushed.\x20')+'Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.');continue;}_0x443a67[_0x3f27eb(0x279)]({'name':_0x287d2b[_0x3f27eb(0x1ee)],'path':_0x37d5b7,'yaml':_0x287d2b});}}const _0x21ee91=getExperimentalKnowledgeBasesDir(_0x1a8742);if(a123_0x112763[_0x3f27eb(0x24e)](_0x21ee91)){const _0xee3c90=a123_0x112763[_0x3f27eb(0x28c)](_0x21ee91,{'withFileTypes':!![]});for(const _0x36454e of _0xee3c90){if(!_0x36454e['isDirectory']())continue;const _0x33434c=a123_0x44ff7c[_0x3f27eb(0x237)](_0x21ee91,_0x36454e[_0x3f27eb(0x1ee)]),_0x87fa78=a123_0x44ff7c[_0x3f27eb(0x237)](_0x33434c,_0x36454e[_0x3f27eb(0x1ee)]+_0x3f27eb(0x29c)),_0x222d51=a123_0x44ff7c['join'](_0x33434c,_0x3f27eb(0x216));if(!a123_0x112763['existsSync'](_0x87fa78))continue;const _0x1e6eb1=parseExperimentalKnowledgeBaseYaml(a123_0x112763['readFileSync'](_0x87fa78,_0x3f27eb(0x231)),_0x87fa78),_0x35ff91=[];if(a123_0x112763[_0x3f27eb(0x24e)](_0x222d51)){const _0x346918=a123_0x112763[_0x3f27eb(0x28c)](_0x222d51,{'withFileTypes':!![]});for(const _0x2e42ac of _0x346918){if(!_0x2e42ac[_0x3f27eb(0x1d1)]())continue;const _0x179965=a123_0x44ff7c[_0x3f27eb(0x237)](_0x222d51,_0x2e42ac[_0x3f27eb(0x1ee)]),_0x9ecb45=a123_0x44ff7c[_0x3f27eb(0x237)](_0x179965,_0x3f27eb(0x23f)),_0x144a3d=a123_0x44ff7c[_0x3f27eb(0x237)](_0x179965,_0x3f27eb(0x240));a123_0x112763[_0x3f27eb(0x24e)](_0x9ecb45)&&a123_0x112763[_0x3f27eb(0x24e)](_0x144a3d)&&_0x35ff91[_0x3f27eb(0x279)]({'name':_0x2e42ac[_0x3f27eb(0x1ee)],'code':a123_0x112763[_0x3f27eb(0x274)](_0x9ecb45,_0x3f27eb(0x231)),'json_schema':a123_0x112763[_0x3f27eb(0x274)](_0x144a3d,_0x3f27eb(0x231))});}}const _0x3271a2={..._0x1e6eb1,'variables':_0x1e6eb1[_0x3f27eb(0x25b)]||[],'functions':_0x35ff91};_0x241254[_0x3f27eb(0x279)]({'name':_0x1e6eb1['name'],'dir':_0x33434c,'def':_0x3271a2});}}const _0x35dae8=getExperimentalArtifactsDir(_0x1a8742);if(a123_0x112763[_0x3f27eb(0x24e)](_0x35dae8)){const _0x304c16=a123_0x112763[_0x3f27eb(0x28c)](_0x35dae8,{'withFileTypes':!![]});for(const _0x3f0639 of _0x304c16){if(!_0x3f0639[_0x3f27eb(0x1d1)]())continue;const _0x2f5bd8=a123_0x44ff7c['join'](_0x35dae8,_0x3f0639[_0x3f27eb(0x1ee)]),_0x569e62=a123_0x44ff7c[_0x3f27eb(0x237)](_0x2f5bd8,_0x3f0639[_0x3f27eb(0x1ee)]+_0x3f27eb(0x29c)),_0x579f87=a123_0x44ff7c[_0x3f27eb(0x237)](_0x2f5bd8,_0x3f27eb(0x23f)),_0x1b9b84=a123_0x44ff7c[_0x3f27eb(0x237)](_0x2f5bd8,_0x3f27eb(0x28a));if(!a123_0x112763[_0x3f27eb(0x24e)](_0x569e62)||!a123_0x112763[_0x3f27eb(0x24e)](_0x579f87))continue;const _0x40f57f=parseExperimentalArtifactYaml(a123_0x112763['readFileSync'](_0x569e62,_0x3f27eb(0x231)),_0x569e62),_0x1fff01=a123_0x112763['readFileSync'](_0x579f87,_0x3f27eb(0x231)),_0x16fecb=[];if(a123_0x112763[_0x3f27eb(0x24e)](_0x1b9b84)){const _0x501aae=a123_0x112763[_0x3f27eb(0x28c)](_0x1b9b84);for(const _0x756601 of _0x501aae){const _0xb8dfde=a123_0x44ff7c['join'](_0x1b9b84,_0x756601);a123_0x112763[_0x3f27eb(0x1ef)](_0xb8dfde)[_0x3f27eb(0x20f)]()&&_0x16fecb[_0x3f27eb(0x279)]({'file_name':_0x756601,'text_content':a123_0x112763[_0x3f27eb(0x274)](_0xb8dfde,_0x3f27eb(0x231))});}}const _0x2f0a70={..._0x40f57f,'code':_0x1fff01,'files':_0x16fecb};_0x1ff2dd[_0x3f27eb(0x279)]({'name':_0x40f57f[_0x3f27eb(0x1ee)],'dir':_0x2f5bd8,'def':_0x2f0a70});}}const _0x44090c=await this[_0x3f27eb(0x26d)][_0x3f27eb(0x1a6)](_0x245f7f),_0x519025=await this['client'][_0x3f27eb(0x1c6)](_0x245f7f),_0x522c54=await this['client']['listTextKnowledgeBases'](_0x245f7f),_0x3e4e5c=await this[_0x3f27eb(0x26d)][_0x3f27eb(0x1e9)](_0x245f7f),_0x1ec13e=await this['client'][_0x3f27eb(0x1f6)](_0x245f7f),_0x40172f=await safeListOrEmpty(()=>this['client'][_0x3f27eb(0x1ad)](_0x245f7f)),_0x5e2f92=await safeListOrEmpty(()=>this[_0x3f27eb(0x26d)][_0x3f27eb(0x26f)](_0x245f7f)),_0x1e4632=await fetchAllToolTargetMaps((_0x4ceda8,_0x1d8aa6)=>this[_0x3f27eb(0x26d)][_0x3f27eb(0x1c5)](_0x4ceda8,_0x1d8aa6),_0x245f7f),_0xf84f08=new Map(),_0x51be5e=new Map(),_0x466a59=new Map(),_0x2e5afe=new Map(),_0x5522b9=new Map(),_0x52be79=new Map(),_0x3aa617=new Map();for(const _0x44f9b7 of _0x44090c){_0xf84f08[_0x3f27eb(0x1f8)](_0x44f9b7[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0x44f9b7);}for(const _0x5e5288 of _0x519025){_0x51be5e[_0x3f27eb(0x1f8)](_0x5e5288[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0x5e5288);}for(const _0xd878a2 of _0x522c54){_0x466a59[_0x3f27eb(0x1f8)](_0xd878a2[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0xd878a2);}for(const _0x3014d3 of _0x3e4e5c){_0x2e5afe[_0x3f27eb(0x1f8)](_0x3014d3[_0x3f27eb(0x244)]['name'],_0x3014d3);}for(const _0x1444be of _0x1ec13e){_0x5522b9[_0x3f27eb(0x1f8)](_0x1444be[_0x3f27eb(0x244)][_0x3f27eb(0x1b0)][_0x3f27eb(0x1df)](),_0x1444be);}for(const _0x53cde8 of _0x40172f){_0x52be79[_0x3f27eb(0x1f8)](_0x53cde8[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0x53cde8);}for(const _0x200342 of _0x5e2f92){_0x3aa617[_0x3f27eb(0x1f8)](_0x200342[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0x200342);}const _0x1187ee=new Map(),_0x1d043f=new Map();for(const _0x430309 of _0x44090c){_0x1187ee[_0x3f27eb(0x1f8)](_0x430309[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0x430309['id']),_0x1d043f['set'](_0x430309['id'],_0x430309['attributes']['name']);}const _0x20e494=new Map(),_0x26b61b=new Map();for(const _0x23c26a of _0x3e4e5c){_0x20e494['set'](_0x23c26a['attributes'][_0x3f27eb(0x1ee)],_0x23c26a['id']),_0x26b61b['set'](_0x23c26a['id'],_0x23c26a[_0x3f27eb(0x244)]['name']);}const _0x23c71c=_0x1e4632[_0x3f27eb(0x1dd)]['KnowledgeBase']||new Map(),_0x13ac23=_0x1e4632['nameToId'][_0x3f27eb(0x27c)]||new Map(),_0x8be325=_0x1e4632[_0x3f27eb(0x1dd)]['ExperimentalKnowledgeBase']||new Map(),_0x1e1b99=new Map(),_0x44d7cb={'resolveToolTargetName':buildNameResolver({..._0x1e4632['idToName'],'Agent':_0x1d043f}),'resolvePromptName':async _0x58f7c8=>_0x26b61b[_0x3f27eb(0x268)](_0x58f7c8),'onWarning':_0x4e9e65=>this[_0x3f27eb(0x1f3)][_0x3f27eb(0x247)](_0x4e9e65)};let _0x3fb42c=[];const _0x538c3d={'projectId':_0x245f7f,'resolveToolTargetId':buildIdResolver({..._0x1e4632['nameToId'],'Agent':_0x1187ee}),'resolvePromptId':async _0x169338=>_0x20e494[_0x3f27eb(0x268)](_0x169338),'onWarning':_0x1494d9=>{const _0x24d946=_0x3f27eb;this[_0x24d946(0x1f3)][_0x24d946(0x247)](_0x1494d9),_0x3fb42c[_0x24d946(0x279)](_0x1494d9);}},{resolved:_0x55ae24,unresolved:_0x3e644a}=resolveAgentDependencies(_0x1fe07c,new Set(_0xf84f08[_0x3f27eb(0x2a9)]()));for(const {agent:_0x1dd625,missingDeps:_0xb3f7e6}of _0x3e644a){_0x4654a1[_0x3f27eb(0x1f5)]['push']({'agentName':_0x1dd625[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x24f),'error':_0x3f27eb(0x281)+_0xb3f7e6[_0x3f27eb(0x237)](',\x20')+'.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.'}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1f5)][_0x3f27eb(0x23c)]++;}for(const _0x1dfc5e of _0xf1697){const _0x25a4c5=_0x51be5e[_0x3f27eb(0x268)](_0x1dfc5e[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)]),_0x283687=a123_0x112763[_0x3f27eb(0x274)](_0x1dfc5e['path'],_0x3f27eb(0x231));if(_0x25a4c5){const _0x13e447=apiKnowledgeBaseToYaml(_0x25a4c5),_0x4e479f=toKnowledgeBaseYamlString(_0x13e447),_0x42445c=generateDiff(_0x4e479f,_0x283687),_0x497561=hasChanges(_0x42445c);_0x497561?(_0x4654a1['knowledgeBases'][_0x3f27eb(0x279)]({'name':_0x1dfc5e[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':'updated','id':_0x25a4c5['id'],'diff':formatDiffWithColors(_0x42445c)}),_0x4654a1['counts'][_0x3f27eb(0x1cc)][_0x3f27eb(0x266)]++):(_0x4654a1[_0x3f27eb(0x1cc)][_0x3f27eb(0x279)]({'name':_0x1dfc5e[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x252),'id':_0x25a4c5['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1cc)][_0x3f27eb(0x252)]++);}else _0x4654a1[_0x3f27eb(0x1cc)][_0x3f27eb(0x279)]({'name':_0x1dfc5e[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':'created'}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1cc)]['created']++;}for(const _0x20af14 of _0x4acc23){const _0x562f0d=_0x466a59[_0x3f27eb(0x268)](_0x20af14[_0x3f27eb(0x1ee)]),_0x3452d6=a123_0x112763[_0x3f27eb(0x274)](_0x20af14[_0x3f27eb(0x202)],_0x3f27eb(0x231));if(_0x562f0d){const _0x1b1a39=toTextKnowledgeBaseMd(_0x562f0d[_0x3f27eb(0x244)][_0x3f27eb(0x1ee)],_0x562f0d[_0x3f27eb(0x244)][_0x3f27eb(0x1e7)]),_0x5b74d8=generateDiff(_0x1b1a39,_0x3452d6),_0x46c25c=hasChanges(_0x5b74d8);_0x46c25c?(_0x4654a1[_0x3f27eb(0x19f)][_0x3f27eb(0x279)]({'name':_0x20af14[_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x562f0d['id'],'diff':formatDiffWithColors(_0x5b74d8)}),_0x4654a1[_0x3f27eb(0x211)]['textKnowledgeBases'][_0x3f27eb(0x266)]++):(_0x4654a1[_0x3f27eb(0x19f)][_0x3f27eb(0x279)]({'name':_0x20af14[_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x252),'id':_0x562f0d['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x19f)][_0x3f27eb(0x252)]++);}else _0x4654a1[_0x3f27eb(0x19f)]['push']({'name':_0x20af14[_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x1c2)}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x19f)][_0x3f27eb(0x1c2)]++;}for(const _0x267336 of _0x55ae24){const _0x54aedf=_0xf84f08[_0x3f27eb(0x268)](_0x267336['yaml'][_0x3f27eb(0x1ee)]),_0x3bc4f5=a123_0x44ff7c[_0x3f27eb(0x237)](_0x267336[_0x3f27eb(0x297)],_0x3f27eb(0x255)),_0x5ba684=a123_0x112763[_0x3f27eb(0x274)](_0x3bc4f5,_0x3f27eb(0x231)),_0x1240b4=_0x267336['systemPrompt'],_0x543332='#\x20prompt.md\x0a'+_0x1240b4+'\x0a\x0a#\x20agent.yml\x0a'+_0x5ba684;if(_0x54aedf){const {yaml:_0x173148,systemPrompt:_0x4e2672}=await agentResponseToDef(_0x54aedf,_0x44d7cb),_0x52998e=toAgentYamlString(_0x173148),_0x81f6cb=_0x3f27eb(0x29f)+_0x4e2672+_0x3f27eb(0x1e0)+_0x52998e,_0x754feb=generateDiff(_0x81f6cb,_0x543332),_0x40d7a6=hasChanges(_0x754feb);_0x40d7a6?(_0x4654a1[_0x3f27eb(0x1f5)]['push']({'agentName':_0x267336[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'agentId':_0x54aedf['id'],'diff':formatDiffWithColors(_0x754feb)}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1f5)][_0x3f27eb(0x266)]++):(_0x4654a1['agents'][_0x3f27eb(0x279)]({'agentName':_0x267336[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x252),'agentId':_0x54aedf['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1f5)][_0x3f27eb(0x252)]++);}else _0x4654a1['agents']['push']({'agentName':_0x267336[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x1c2)}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1f5)][_0x3f27eb(0x1c2)]++;}for(const _0x41fb43 of _0x28d354){const _0x303f73=_0x2e5afe[_0x3f27eb(0x268)](_0x41fb43[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)]),_0x200ba4=a123_0x112763[_0x3f27eb(0x274)](_0x41fb43['path'],_0x3f27eb(0x231));if(_0x303f73){const _0x64fbd5=await apiPromptToYaml(_0x303f73,_0x44d7cb);if(!_0x64fbd5){_0x4654a1[_0x3f27eb(0x1d5)][_0x3f27eb(0x279)]({'name':_0x41fb43['yaml'][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x303f73['id']}),_0x4654a1['counts']['prompts'][_0x3f27eb(0x266)]++;continue;}const _0x459034=toPromptYamlString(_0x64fbd5),_0x18c660=generateDiff(_0x459034,_0x200ba4),_0x14a1f7=hasChanges(_0x18c660);_0x14a1f7?(_0x4654a1[_0x3f27eb(0x1d5)]['push']({'name':_0x41fb43[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x303f73['id'],'diff':formatDiffWithColors(_0x18c660)}),_0x4654a1['counts'][_0x3f27eb(0x1d5)][_0x3f27eb(0x266)]++):(_0x4654a1['prompts'][_0x3f27eb(0x279)]({'name':_0x41fb43[_0x3f27eb(0x2b0)]['name'],'action':'unchanged','id':_0x303f73['id']}),_0x4654a1['counts'][_0x3f27eb(0x1d5)][_0x3f27eb(0x252)]++);}else _0x4654a1[_0x3f27eb(0x1d5)][_0x3f27eb(0x279)]({'name':_0x41fb43[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x1c2)}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1d5)][_0x3f27eb(0x1c2)]++;}for(const _0xa65db8 of _0x443a67){const _0x243849=_0x5522b9[_0x3f27eb(0x268)](_0xa65db8[_0x3f27eb(0x2b0)][_0x3f27eb(0x20e)]),_0x5c6271=a123_0x112763[_0x3f27eb(0x274)](_0xa65db8[_0x3f27eb(0x202)],_0x3f27eb(0x231));if(_0x243849){const _0x4c452e=await apiIntegrationToYaml(_0x243849,_0x44d7cb),_0x8d6262=toIntegrationYamlString(_0x4c452e),_0x5c3896=generateDiff(_0x8d6262,_0x5c6271),_0x45ce77=hasChanges(_0x5c3896);_0x45ce77?(_0x4654a1['integrations'][_0x3f27eb(0x279)]({'name':_0xa65db8['yaml'][_0x3f27eb(0x20e)],'action':_0x3f27eb(0x266),'id':_0x243849['id'],'diff':formatDiffWithColors(_0x5c3896)}),_0x4654a1[_0x3f27eb(0x211)]['integrations'][_0x3f27eb(0x266)]++):(_0x4654a1[_0x3f27eb(0x2a1)][_0x3f27eb(0x279)]({'name':_0xa65db8[_0x3f27eb(0x2b0)]['service_type'],'action':'unchanged','id':_0x243849['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x2a1)][_0x3f27eb(0x252)]++);}else _0x4654a1[_0x3f27eb(0x2a1)][_0x3f27eb(0x279)]({'name':_0xa65db8[_0x3f27eb(0x2b0)]['service_type'],'action':_0x3f27eb(0x1c2)}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x2a1)][_0x3f27eb(0x1c2)]++;}for(const _0x20e8db of _0x241254){const _0x3710f9=_0x52be79[_0x3f27eb(0x268)](_0x20e8db['def'][_0x3f27eb(0x1ee)]),_0x227298=toExperimentalKnowledgeBaseYamlString(_0x20e8db[_0x3f27eb(0x24b)]);let _0x202402=_0x227298;for(const _0x4fe94b of _0x20e8db[_0x3f27eb(0x24b)][_0x3f27eb(0x216)]){_0x202402+='\x0a---\x20function:\x20'+_0x4fe94b[_0x3f27eb(0x1ee)]+'\x20---\x0a'+_0x4fe94b[_0x3f27eb(0x26e)]+'\x0a---\x20schema:\x20'+_0x4fe94b[_0x3f27eb(0x1ee)]+_0x3f27eb(0x25f)+_0x4fe94b['json_schema']+'\x0a';}if(_0x3710f9){const _0x260698=apiExperimentalKnowledgeBaseToYaml(_0x3710f9),_0xb56a26=toExperimentalKnowledgeBaseYamlString(_0x260698);let _0x34621e=_0xb56a26;for(const _0x41ef2b of _0x260698['functions']){_0x34621e+=_0x3f27eb(0x1d6)+_0x41ef2b[_0x3f27eb(0x1ee)]+_0x3f27eb(0x25f)+_0x41ef2b['code']+'\x0a---\x20schema:\x20'+_0x41ef2b['name']+_0x3f27eb(0x25f)+_0x41ef2b[_0x3f27eb(0x1a1)]+'\x0a';}const _0x3af77c=generateDiff(_0x34621e,_0x202402),_0x2d6695=hasChanges(_0x3af77c);_0x2d6695?(_0x4654a1[_0x3f27eb(0x259)][_0x3f27eb(0x279)]({'name':_0x20e8db['def'][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x3710f9['id'],'diff':formatDiffWithColors(_0x3af77c)}),_0x4654a1['counts'][_0x3f27eb(0x259)][_0x3f27eb(0x266)]++):(_0x4654a1['experimentalKnowledgeBases'][_0x3f27eb(0x279)]({'name':_0x20e8db[_0x3f27eb(0x24b)]['name'],'action':'unchanged','id':_0x3710f9['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x259)][_0x3f27eb(0x252)]++);}else _0x4654a1[_0x3f27eb(0x259)][_0x3f27eb(0x279)]({'name':_0x20e8db['def'][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x1c2)}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x259)][_0x3f27eb(0x1c2)]++;}for(const _0x565b9d of _0x1ff2dd){const _0x4373a7=_0x3aa617[_0x3f27eb(0x268)](_0x565b9d[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)]),_0x5ea558=toExperimentalArtifactYamlString(_0x565b9d['def']);let _0x4e300a=_0x5ea558+(_0x3f27eb(0x23e)+_0x565b9d[_0x3f27eb(0x24b)][_0x3f27eb(0x26e)]+'\x0a');for(const _0x1ad168 of _0x565b9d[_0x3f27eb(0x24b)][_0x3f27eb(0x28a)]){_0x4e300a+='---\x20file:\x20'+_0x1ad168[_0x3f27eb(0x1e1)]+_0x3f27eb(0x25f)+_0x1ad168[_0x3f27eb(0x1c7)]+'\x0a';}if(_0x4373a7){const _0x599a8f=apiExperimentalArtifactToYaml(_0x4373a7),_0x51be82=toExperimentalArtifactYamlString(_0x599a8f);let _0x19f5a8=_0x51be82+(_0x3f27eb(0x23e)+_0x599a8f[_0x3f27eb(0x26e)]+'\x0a');for(const _0x4b8789 of _0x599a8f['files']){_0x19f5a8+=_0x3f27eb(0x27a)+_0x4b8789['file_name']+_0x3f27eb(0x25f)+_0x4b8789[_0x3f27eb(0x1c7)]+'\x0a';}const _0x5c2efb=generateDiff(_0x19f5a8,_0x4e300a),_0x3a5115=hasChanges(_0x5c2efb);_0x3a5115?(_0x4654a1[_0x3f27eb(0x221)]['push']({'name':_0x565b9d['def'][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x4373a7['id'],'diff':formatDiffWithColors(_0x5c2efb)}),_0x4654a1['counts'][_0x3f27eb(0x221)][_0x3f27eb(0x266)]++):(_0x4654a1[_0x3f27eb(0x221)]['push']({'name':_0x565b9d[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],'action':'unchanged','id':_0x4373a7['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x221)][_0x3f27eb(0x252)]++);}else _0x4654a1[_0x3f27eb(0x221)][_0x3f27eb(0x279)]({'name':_0x565b9d['def']['name'],'action':_0x3f27eb(0x1c2)}),_0x4654a1['counts'][_0x3f27eb(0x221)][_0x3f27eb(0x1c2)]++;}if(_0x54c0e0?.['dryRun'])return _0x4654a1;_0x4654a1['knowledgeBases']=[],_0x4654a1[_0x3f27eb(0x19f)]=[],_0x4654a1['prompts']=[],_0x4654a1['integrations']=[],_0x4654a1[_0x3f27eb(0x259)]=[],_0x4654a1['experimentalArtifacts']=[];const _0x56a9e9=_0x4654a1[_0x3f27eb(0x1f5)]['filter'](_0x49c600=>_0x49c600['action']===_0x3f27eb(0x24f));_0x4654a1['agents']=_0x56a9e9,_0x4654a1[_0x3f27eb(0x211)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0x56a9e9[_0x3f27eb(0x206)]},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}};for(const _0x857feb of _0xf1697){try{const _0x1163f7=_0x51be5e['get'](_0x857feb[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)]),_0x32c916=yamlKnowledgeBaseToApi(_0x857feb[_0x3f27eb(0x2b0)],_0x245f7f);if(_0x1163f7)await this[_0x3f27eb(0x26d)][_0x3f27eb(0x2a2)](_0x1163f7['id'],_0x32c916),_0x23c71c[_0x3f27eb(0x1f8)](_0x857feb['yaml'][_0x3f27eb(0x1ee)],_0x1163f7['id']),_0x4654a1[_0x3f27eb(0x1cc)][_0x3f27eb(0x279)]({'name':_0x857feb[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':'updated','id':_0x1163f7['id']}),_0x4654a1['counts'][_0x3f27eb(0x1cc)][_0x3f27eb(0x266)]++;else{const _0x100bc3=await this['client'][_0x3f27eb(0x1bb)](_0x32c916);_0x23c71c[_0x3f27eb(0x1f8)](_0x857feb[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],_0x100bc3['id']),_0x4654a1[_0x3f27eb(0x1cc)]['push']({'name':_0x857feb[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':'created','id':_0x100bc3['id']}),_0x4654a1['counts'][_0x3f27eb(0x1cc)][_0x3f27eb(0x1c2)]++;}}catch(_0x4448bd){_0x4654a1[_0x3f27eb(0x1cc)][_0x3f27eb(0x279)]({'name':_0x857feb[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x24f),'error':_0x4448bd[_0x3f27eb(0x1c8)]}),_0x4654a1['counts'][_0x3f27eb(0x1cc)][_0x3f27eb(0x23c)]++;}}for(const _0x13567e of _0x4acc23){try{const _0x16855c=_0x466a59[_0x3f27eb(0x268)](_0x13567e['name']),_0x3db3d9=yamlTextKnowledgeBaseToApi({'name':_0x13567e['name'],'text':_0x13567e[_0x3f27eb(0x1e7)]},_0x245f7f);if(_0x16855c)await this['client'][_0x3f27eb(0x1b1)](_0x16855c['id'],_0x3db3d9),_0x13ac23[_0x3f27eb(0x1f8)](_0x13567e[_0x3f27eb(0x1ee)],_0x16855c['id']),_0x4654a1[_0x3f27eb(0x19f)][_0x3f27eb(0x279)]({'name':_0x13567e[_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x16855c['id']}),_0x4654a1[_0x3f27eb(0x211)]['textKnowledgeBases'][_0x3f27eb(0x266)]++;else{const _0x236b41=await this['client'][_0x3f27eb(0x236)](_0x3db3d9);_0x13ac23['set'](_0x13567e[_0x3f27eb(0x1ee)],_0x236b41['id']),_0x4654a1[_0x3f27eb(0x19f)][_0x3f27eb(0x279)]({'name':_0x13567e[_0x3f27eb(0x1ee)],'action':'created','id':_0x236b41['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x19f)][_0x3f27eb(0x1c2)]++;}}catch(_0x2ccb39){_0x4654a1[_0x3f27eb(0x19f)][_0x3f27eb(0x279)]({'name':_0x13567e[_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x24f),'error':_0x2ccb39['message']}),_0x4654a1[_0x3f27eb(0x211)]['textKnowledgeBases']['errors']++;}}for(const _0x3f0d90 of _0x241254){try{const _0x5d7cff=_0x52be79[_0x3f27eb(0x268)](_0x3f0d90[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)]),_0x35d547=yamlExperimentalKnowledgeBaseToApi(_0x3f0d90['def'],_0x245f7f);if(_0x5d7cff)await this['client'][_0x3f27eb(0x20b)](_0x5d7cff['id'],_0x35d547),_0x8be325[_0x3f27eb(0x1f8)](_0x3f0d90[_0x3f27eb(0x24b)]['name'],_0x5d7cff['id']),_0x4654a1[_0x3f27eb(0x259)]['push']({'name':_0x3f0d90[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x5d7cff['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x259)][_0x3f27eb(0x266)]++;else{const _0x3f4919=await this[_0x3f27eb(0x26d)][_0x3f27eb(0x2b7)](_0x35d547);_0x8be325[_0x3f27eb(0x1f8)](_0x3f0d90[_0x3f27eb(0x24b)]['name'],_0x3f4919['id']),_0x4654a1['experimentalKnowledgeBases']['push']({'name':_0x3f0d90[_0x3f27eb(0x24b)]['name'],'action':_0x3f27eb(0x1c2),'id':_0x3f4919['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x259)][_0x3f27eb(0x1c2)]++;}}catch(_0x530ae0){_0x4654a1[_0x3f27eb(0x259)][_0x3f27eb(0x279)]({'name':_0x3f0d90[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x24f),'error':_0x530ae0['message']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x259)]['errors']++;}}for(const _0x9e7c3 of _0x1ff2dd){try{const _0x26ed10=_0x3aa617['get'](_0x9e7c3[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)]),_0x5e08eb=yamlExperimentalArtifactToApi(_0x9e7c3['def'],_0x245f7f);if(_0x26ed10)await this[_0x3f27eb(0x26d)][_0x3f27eb(0x1f0)](_0x26ed10['id'],_0x5e08eb),_0x1e1b99['set'](_0x9e7c3[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],_0x26ed10['id']),_0x4654a1['experimentalArtifacts'][_0x3f27eb(0x279)]({'name':_0x9e7c3[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x266),'id':_0x26ed10['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x221)][_0x3f27eb(0x266)]++;else{const _0x29e911=await this[_0x3f27eb(0x26d)][_0x3f27eb(0x213)](_0x5e08eb);_0x1e1b99[_0x3f27eb(0x1f8)](_0x9e7c3[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],_0x29e911['id']),_0x4654a1[_0x3f27eb(0x221)][_0x3f27eb(0x279)]({'name':_0x9e7c3[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],'action':'created','id':_0x29e911['id']}),_0x4654a1[_0x3f27eb(0x211)]['experimentalArtifacts'][_0x3f27eb(0x1c2)]++;}}catch(_0x3e69eb){_0x4654a1['experimentalArtifacts']['push']({'name':_0x9e7c3[_0x3f27eb(0x24b)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x24f),'error':_0x3e69eb['message']}),_0x4654a1['counts'][_0x3f27eb(0x221)][_0x3f27eb(0x23c)]++;}}for(const _0x307e65 of _0x55ae24){_0x3fb42c=[];try{const _0x587901=_0xf84f08['get'](_0x307e65[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)]),_0x2407fb=await agentDefToRequest(_0x307e65[_0x3f27eb(0x2b0)],_0x307e65[_0x3f27eb(0x2b6)],_0x307e65[_0x3f27eb(0x246)],_0x538c3d);if(_0x587901)await this[_0x3f27eb(0x26d)]['updateAgentResponse'](_0x587901['id'],_0x2407fb),_0x1187ee[_0x3f27eb(0x1f8)](_0x307e65[_0x3f27eb(0x2b0)]['name'],_0x587901['id']),_0x4654a1[_0x3f27eb(0x1f5)][_0x3f27eb(0x279)]({'agentName':_0x307e65[_0x3f27eb(0x2b0)]['name'],'action':_0x3f27eb(0x266),'agentId':_0x587901['id'],'warnings':_0x3fb42c[_0x3f27eb(0x206)]>0x0?_0x3fb42c:undefined}),_0x4654a1[_0x3f27eb(0x211)]['agents'][_0x3f27eb(0x266)]++;else{const _0x579755=await this[_0x3f27eb(0x26d)][_0x3f27eb(0x22a)](_0x2407fb);_0x1187ee[_0x3f27eb(0x1f8)](_0x307e65['yaml'][_0x3f27eb(0x1ee)],_0x579755['id']),_0x4654a1[_0x3f27eb(0x1f5)][_0x3f27eb(0x279)]({'agentName':_0x307e65[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x1c2),'agentId':_0x579755['id'],'warnings':_0x3fb42c[_0x3f27eb(0x206)]>0x0?_0x3fb42c:undefined}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1f5)][_0x3f27eb(0x1c2)]++;}}catch(_0x19b330){_0x4654a1[_0x3f27eb(0x1f5)]['push']({'agentName':_0x307e65[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':_0x3f27eb(0x24f),'error':_0x19b330[_0x3f27eb(0x1c8)],'warnings':_0x3fb42c[_0x3f27eb(0x206)]>0x0?_0x3fb42c:undefined}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1f5)][_0x3f27eb(0x23c)]++;}}for(const _0x3c6478 of _0x28d354){try{const _0x25671c=_0x2e5afe['get'](_0x3c6478[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)]),_0x5aec50=await yamlPromptToApi(_0x3c6478[_0x3f27eb(0x2b0)],_0x245f7f,_0x538c3d);if(!_0x5aec50){_0x4654a1[_0x3f27eb(0x1d5)][_0x3f27eb(0x279)]({'name':_0x3c6478['yaml'][_0x3f27eb(0x1ee)],'action':'error','error':'Agent\x20reference\x20not\x20found'}),_0x4654a1[_0x3f27eb(0x211)]['prompts']['errors']++;continue;}if(_0x25671c)await this['client'][_0x3f27eb(0x22d)](_0x25671c['id'],_0x5aec50),_0x20e494[_0x3f27eb(0x1f8)](_0x3c6478[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],_0x25671c['id']),_0x4654a1[_0x3f27eb(0x1d5)]['push']({'name':_0x3c6478[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],'action':'updated','id':_0x25671c['id']}),_0x4654a1['counts'][_0x3f27eb(0x1d5)][_0x3f27eb(0x266)]++;else{const _0xdf0234=await this[_0x3f27eb(0x26d)]['createPrompt'](_0x5aec50);_0x20e494[_0x3f27eb(0x1f8)](_0x3c6478[_0x3f27eb(0x2b0)][_0x3f27eb(0x1ee)],_0xdf0234['id']),_0x4654a1[_0x3f27eb(0x1d5)][_0x3f27eb(0x279)]({'name':_0x3c6478['yaml'][_0x3f27eb(0x1ee)],'action':'created','id':_0xdf0234['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x1d5)][_0x3f27eb(0x1c2)]++;}}catch(_0x4e7ccd){_0x4654a1[_0x3f27eb(0x1d5)][_0x3f27eb(0x279)]({'name':_0x3c6478[_0x3f27eb(0x2b0)]['name'],'action':_0x3f27eb(0x24f),'error':_0x4e7ccd[_0x3f27eb(0x1c8)]}),_0x4654a1['counts'][_0x3f27eb(0x1d5)][_0x3f27eb(0x23c)]++;}}for(const _0x136e3b of _0x443a67){try{const _0x44346f=_0x5522b9['get'](_0x136e3b[_0x3f27eb(0x2b0)][_0x3f27eb(0x20e)]),_0x2b9596=await yamlIntegrationToApi(_0x136e3b[_0x3f27eb(0x2b0)],_0x245f7f,_0x538c3d);if(_0x44346f){await this[_0x3f27eb(0x26d)][_0x3f27eb(0x20a)](_0x44346f['id']);const _0x226bc7=await this[_0x3f27eb(0x26d)][_0x3f27eb(0x1a9)](_0x2b9596);_0x4654a1[_0x3f27eb(0x2a1)][_0x3f27eb(0x279)]({'name':_0x136e3b[_0x3f27eb(0x2b0)][_0x3f27eb(0x20e)],'action':_0x3f27eb(0x266),'id':_0x226bc7['id']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x2a1)]['updated']++;}else{const _0x390ad5=await this['client'][_0x3f27eb(0x1a9)](_0x2b9596);_0x4654a1[_0x3f27eb(0x2a1)]['push']({'name':_0x136e3b[_0x3f27eb(0x2b0)][_0x3f27eb(0x20e)],'action':_0x3f27eb(0x1c2),'id':_0x390ad5['id']}),_0x4654a1['counts'][_0x3f27eb(0x2a1)][_0x3f27eb(0x1c2)]++;}}catch(_0xfe1778){_0x4654a1[_0x3f27eb(0x2a1)]['push']({'name':_0x136e3b[_0x3f27eb(0x2b0)][_0x3f27eb(0x20e)],'action':_0x3f27eb(0x24f),'error':_0xfe1778['message']}),_0x4654a1[_0x3f27eb(0x211)][_0x3f27eb(0x2a1)]['errors']++;}}return _0x4654a1;}async[a123_0x5da6fd(0x2ae)](_0x20ca80,_0x4cc425,_0x3d25fd,_0x4b4534){const _0x15756c=a123_0x5da6fd,{projectId:_0x28a8f5,project:_0xf67243}=await this[_0x15756c(0x21c)](_0x20ca80),_0x823b85=_0xf67243[_0x15756c(0x244)]['name'],_0x2f5ddd=await this['client'][_0x15756c(0x1a6)](_0x28a8f5),_0x2f03a2=_0x2f5ddd[_0x15756c(0x286)](_0x40c243=>_0x40c243['attributes'][_0x15756c(0x1ee)]===_0x4cc425);if(!_0x2f03a2)throw new SDKError(ErrorCode[_0x15756c(0x24a)],_0x15756c(0x1b4)+_0x4cc425,undefined,{'helpText':_0x15756c(0x25c)+_0x2f5ddd['map'](_0x1a217d=>_0x1a217d['attributes'][_0x15756c(0x1ee)])[_0x15756c(0x237)](',\x20')});let _0x240062;if(_0x3d25fd)_0x240062=_0x3d25fd;else{const _0x4f4c91=a123_0x44ff7c[_0x15756c(0x237)](process['cwd'](),_0x15756c(0x1f5)),_0x514267=getSanitizedPathWithMigration(_0x4f4c91,_0x823b85);_0x514267['renamed']&&this['logger']['info'](_0x15756c(0x21e)+a123_0x44ff7c[_0x15756c(0x28f)](_0x514267[_0x15756c(0x1f9)])+_0x15756c(0x1bd)+a123_0x44ff7c[_0x15756c(0x28f)](_0x514267[_0x15756c(0x202)])),_0x240062=_0x514267[_0x15756c(0x202)];}const _0x54738e=getSanitizedPathWithMigration(_0x240062,_0x4cc425);_0x54738e[_0x15756c(0x258)]&&this[_0x15756c(0x1f3)][_0x15756c(0x238)]('Renamed\x20agent\x20folder:\x20'+a123_0x44ff7c[_0x15756c(0x28f)](_0x54738e[_0x15756c(0x1f9)])+_0x15756c(0x1bd)+a123_0x44ff7c[_0x15756c(0x28f)](_0x54738e[_0x15756c(0x202)]));const _0x29605a=_0x54738e[_0x15756c(0x202)],_0xa3f42c=new Map(),_0x563955=new Map(),_0x2a3e70=await this[_0x15756c(0x26d)][_0x15756c(0x1c6)](_0x28a8f5),_0x3b9c15=await this[_0x15756c(0x26d)]['listTextKnowledgeBases'](_0x28a8f5),_0x5502d5=await safeListOrEmpty(()=>this[_0x15756c(0x26d)][_0x15756c(0x1ad)](_0x28a8f5)),_0x2a0e96=new Map(),_0xf749f=new Map();for(const _0x2d1c26 of _0x2a3e70){_0xa3f42c[_0x15756c(0x1f8)](_0x2d1c26['id'],_0x2d1c26[_0x15756c(0x244)][_0x15756c(0x1ee)]);}for(const _0x494ba3 of _0x3b9c15){_0x2a0e96['set'](_0x494ba3['id'],_0x494ba3['attributes'][_0x15756c(0x1ee)]);}for(const _0x4fe360 of _0x5502d5){_0xf749f['set'](_0x4fe360['id'],_0x4fe360['attributes'][_0x15756c(0x1ee)]);}for(const _0x9a42bb of _0x2f5ddd){_0x563955[_0x15756c(0x1f8)](_0x9a42bb['id'],_0x9a42bb['attributes'][_0x15756c(0x1ee)]);}const _0x4d7952={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0xa3f42c,'TextKnowledgeBase':_0x2a0e96,'Agent':_0x563955,'ExperimentalKnowledgeBase':_0xf749f}),'resolvePromptName':async()=>undefined,'onWarning':_0x486aa0=>this[_0x15756c(0x1f3)][_0x15756c(0x247)](_0x486aa0)},_0x23548b=a123_0x44ff7c[_0x15756c(0x237)](_0x29605a,_0x15756c(0x298)),_0x50043d=a123_0x44ff7c[_0x15756c(0x237)](_0x29605a,_0x15756c(0x255)),_0x125458=a123_0x44ff7c['join'](_0x29605a,'starter_message.md'),_0x4a6dce=!a123_0x112763['existsSync'](_0x50043d);if(_0x4b4534?.['dryRun'])return{'agentName':_0x4cc425,'outputPath':_0x29605a,'isNew':_0x4a6dce,'hasChanges':!![]};a123_0x112763['mkdirSync'](_0x240062,{'recursive':!![]}),a123_0x112763[_0x15756c(0x1ca)](_0x29605a,{'recursive':!![]});const _0x5b4aa1=a123_0x44ff7c[_0x15756c(0x237)](_0x240062,_0x15756c(0x225));!a123_0x112763['existsSync'](_0x5b4aa1)&&a123_0x112763[_0x15756c(0x1f1)](_0x5b4aa1,createAgentConfigContent(_0x20ca80));const {yaml:_0x4a54c3,systemPrompt:_0x2c428c,starterMessage:_0x1bb2de}=await agentResponseToDef(_0x2f03a2,_0x4d7952);let _0x38c3e1=_0x4a6dce;if(!_0x4a6dce){const _0x3827d6=a123_0x112763[_0x15756c(0x24e)](_0x23548b)?a123_0x112763[_0x15756c(0x274)](_0x23548b,_0x15756c(0x231)):'',_0x5fb82b=a123_0x112763['readFileSync'](_0x50043d,_0x15756c(0x231));_0x38c3e1=_0x3827d6!==_0x2c428c||_0x5fb82b!==toAgentYamlString(_0x4a54c3);}a123_0x112763['writeFileSync'](_0x23548b,_0x2c428c),a123_0x112763[_0x15756c(0x1f1)](_0x50043d,toAgentYamlString(_0x4a54c3));if(_0x1bb2de&&_0x1bb2de[_0x15756c(0x1d3)]('\x0a'))a123_0x112763[_0x15756c(0x1f1)](_0x125458,_0x1bb2de);else a123_0x112763[_0x15756c(0x24e)](_0x125458)&&a123_0x112763[_0x15756c(0x1c9)](_0x125458);return{'agentName':_0x4cc425,'outputPath':_0x29605a,'isNew':_0x4a6dce,'hasChanges':_0x38c3e1};}async[a123_0x5da6fd(0x28e)](_0xd24fb3,_0x4679e9){const _0x291b79=a123_0x5da6fd;let _0x132292;isAgentYamlPath(_0xd24fb3)?_0x132292=getAgentDirFromYamlPath(_0xd24fb3):_0x132292=_0xd24fb3;const {config:_0x7f3742}=findAgentConfig(_0x132292),_0x22a58c=await this[_0x291b79(0x1ac)](_0x7f3742['llm_project']),_0x366fc6=a123_0x44ff7c['join'](_0x132292,'agent.yml'),_0x36f077=a123_0x44ff7c['join'](_0x132292,_0x291b79(0x298)),_0x20951b=a123_0x44ff7c['join'](_0x132292,_0x291b79(0x283));if(!a123_0x112763[_0x291b79(0x24e)](_0x366fc6))throw new SDKError(ErrorCode[_0x291b79(0x29b)],_0x291b79(0x1d8)+_0x132292,undefined,{'helpText':_0x291b79(0x1d9)});const _0x1b2049=parseAgentYaml(a123_0x112763[_0x291b79(0x274)](_0x366fc6,_0x291b79(0x231)),_0x366fc6),_0x2ac573=a123_0x112763[_0x291b79(0x24e)](_0x36f077)?a123_0x112763['readFileSync'](_0x36f077,'utf-8'):'',_0x9d53c2=a123_0x112763[_0x291b79(0x24e)](_0x20951b)?a123_0x112763[_0x291b79(0x274)](_0x20951b,_0x291b79(0x231)):_0x1b2049['starter_message'];if(_0x4679e9?.[_0x291b79(0x223)])return{'agentName':_0x1b2049['name'],'action':_0x291b79(0x1c2),'projectId':_0x22a58c};const _0x795321=await this[_0x291b79(0x26d)][_0x291b79(0x1a6)](_0x22a58c),_0x3ad182=await fetchAllToolTargetMaps((_0x3d7bcf,_0x2c3917)=>this[_0x291b79(0x26d)][_0x291b79(0x1c5)](_0x3d7bcf,_0x2c3917),_0x22a58c),_0x1d1379=new Map();for(const _0x1682e2 of _0x795321){_0x1d1379['set'](_0x1682e2[_0x291b79(0x244)][_0x291b79(0x1ee)],_0x1682e2['id']);}const _0xdaa3cb=[],_0x123ca8={'projectId':_0x22a58c,'resolveToolTargetId':buildIdResolver({..._0x3ad182['nameToId'],'Agent':_0x1d1379}),'resolvePromptId':async()=>undefined,'onWarning':_0x2f084a=>{const _0x5b2aeb=_0x291b79;this[_0x5b2aeb(0x1f3)][_0x5b2aeb(0x247)](_0x2f084a),_0xdaa3cb[_0x5b2aeb(0x279)](_0x2f084a);}};try{const _0x5ece63=_0x795321[_0x291b79(0x286)](_0x2cde5b=>_0x2cde5b['attributes'][_0x291b79(0x1ee)]===_0x1b2049[_0x291b79(0x1ee)]),_0x195a0c=await agentDefToRequest(_0x1b2049,_0x2ac573,_0x9d53c2,_0x123ca8);if(_0x5ece63)return await this['client'][_0x291b79(0x2a3)](_0x5ece63['id'],_0x195a0c),{'agentName':_0x1b2049['name'],'action':_0x291b79(0x266),'projectId':_0x22a58c,'agentId':_0x5ece63['id'],'warnings':_0xdaa3cb[_0x291b79(0x206)]>0x0?_0xdaa3cb:undefined};else{const _0x4794ec=await this[_0x291b79(0x26d)][_0x291b79(0x22a)](_0x195a0c);return{'agentName':_0x1b2049[_0x291b79(0x1ee)],'action':_0x291b79(0x1c2),'projectId':_0x22a58c,'agentId':_0x4794ec['id'],'warnings':_0xdaa3cb[_0x291b79(0x206)]>0x0?_0xdaa3cb:undefined};}}catch(_0x2e4c12){return{'agentName':_0x1b2049[_0x291b79(0x1ee)],'action':_0x291b79(0x24f),'projectId':_0x22a58c,'error':_0x2e4c12[_0x291b79(0x1c8)],'warnings':_0xdaa3cb[_0x291b79(0x206)]>0x0?_0xdaa3cb:undefined};}}async[a123_0x5da6fd(0x275)](_0x518fd8,_0x2ae21a,_0x442bce){const _0x43081d=a123_0x5da6fd,_0xb31efe=a123_0x112763[_0x43081d(0x24e)](_0x518fd8)&&a123_0x112763[_0x43081d(0x24e)](a123_0x44ff7c[_0x43081d(0x237)](_0x518fd8,_0x43081d(0x225)));let _0x228094;const _0x4b8afd=[],_0x15c144=[],_0x5d41d9=[],_0x300fb6=[],_0x38fdba=[],_0x5f07f8=[],_0x22a589=[];if(_0xb31efe){const _0x49967e=loadAgentConfig(a123_0x44ff7c[_0x43081d(0x237)](_0x518fd8,'tdx.json'));_0x228094=_0x49967e[_0x43081d(0x272)];const _0x113a6b=a123_0x112763[_0x43081d(0x28c)](_0x518fd8,{'withFileTypes':!![]});for(const _0xe0fa1e of _0x113a6b){if(!_0xe0fa1e['isDirectory']())continue;if([_0x43081d(0x295),_0x43081d(0x1b6),'experimental_artifacts',_0x43081d(0x1d5),'integrations'][_0x43081d(0x1d3)](_0xe0fa1e[_0x43081d(0x1ee)]))continue;const _0x1b1500=a123_0x44ff7c['join'](_0x518fd8,_0xe0fa1e[_0x43081d(0x1ee)]);if(isAgentDir(_0x1b1500)){const _0x4a8048=a123_0x44ff7c[_0x43081d(0x237)](_0x1b1500,'agent.yml'),_0xb4f40d=a123_0x44ff7c[_0x43081d(0x237)](_0x1b1500,_0x43081d(0x298)),_0x598ea5=a123_0x44ff7c['join'](_0x1b1500,_0x43081d(0x283)),_0x28755d=parseAgentYaml(a123_0x112763['readFileSync'](_0x4a8048,_0x43081d(0x231)),_0x4a8048),_0x102ad2=a123_0x112763[_0x43081d(0x24e)](_0xb4f40d)?a123_0x112763[_0x43081d(0x274)](_0xb4f40d,_0x43081d(0x231)):'',_0x47e92b=a123_0x112763[_0x43081d(0x24e)](_0x598ea5)?a123_0x112763['readFileSync'](_0x598ea5,'utf-8'):_0x28755d[_0x43081d(0x26a)];_0x4b8afd[_0x43081d(0x279)]({'name':_0x28755d[_0x43081d(0x1ee)],'dir':_0x1b1500,'yaml':_0x28755d,'systemPrompt':_0x102ad2,'starterMessage':_0x47e92b});}}const _0xb60cdf=getKnowledgeBasesDir(_0x518fd8);if(a123_0x112763[_0x43081d(0x24e)](_0xb60cdf)){const _0x2d750c=a123_0x112763[_0x43081d(0x28c)](_0xb60cdf);for(const _0x381ae8 of _0x2d750c){const _0x22e177=a123_0x44ff7c[_0x43081d(0x237)](_0xb60cdf,_0x381ae8);if(_0x381ae8[_0x43081d(0x24d)]('.yml')){const _0x182b3b=parseKnowledgeBaseYaml(a123_0x112763[_0x43081d(0x274)](_0x22e177,_0x43081d(0x231)),_0x22e177);_0x15c144[_0x43081d(0x279)]({'name':_0x182b3b[_0x43081d(0x1ee)],'path':_0x22e177,'yaml':_0x182b3b});}else{if(_0x381ae8[_0x43081d(0x24d)](_0x43081d(0x1a5))){const _0x394c55=a123_0x112763[_0x43081d(0x274)](_0x22e177,_0x43081d(0x231)),{name:_0xf70bee,text:_0x5753f7}=parseTextKnowledgeBaseMd(_0x394c55,_0x381ae8);_0x5d41d9[_0x43081d(0x279)]({'name':_0xf70bee,'path':_0x22e177,'text':_0x5753f7});}}}}const _0x2e08fd=getPromptsDir(_0x518fd8);if(a123_0x112763['existsSync'](_0x2e08fd)){const _0x1218d8=a123_0x112763[_0x43081d(0x28c)](_0x2e08fd)['filter'](_0x422d75=>_0x422d75[_0x43081d(0x24d)]('.yml'));for(const _0x1f8590 of _0x1218d8){const _0x3579f6=a123_0x44ff7c[_0x43081d(0x237)](_0x2e08fd,_0x1f8590),_0x1b5ab5=parsePromptYaml(a123_0x112763[_0x43081d(0x274)](_0x3579f6,'utf-8'),_0x3579f6);_0x300fb6[_0x43081d(0x279)]({'name':_0x1b5ab5['name'],'path':_0x3579f6,'yaml':_0x1b5ab5});}}const _0x34c217=getIntegrationsDir(_0x518fd8);if(a123_0x112763[_0x43081d(0x24e)](_0x34c217)){const _0x31da61=a123_0x112763['readdirSync'](_0x34c217)[_0x43081d(0x280)](_0x51c8c5=>_0x51c8c5[_0x43081d(0x24d)](_0x43081d(0x29c)));for(const _0x1666c8 of _0x31da61){const _0x449a3e=a123_0x44ff7c[_0x43081d(0x237)](_0x34c217,_0x1666c8),_0x4ab62c=parseIntegrationYaml(a123_0x112763['readFileSync'](_0x449a3e,_0x43081d(0x231)),_0x449a3e);SAFE_INTEGRATION_TYPES[_0x43081d(0x1d3)](_0x4ab62c[_0x43081d(0x20e)]['toLowerCase']())?_0x38fdba[_0x43081d(0x279)]({'name':_0x4ab62c[_0x43081d(0x1ee)],'path':_0x449a3e,'yaml':_0x4ab62c}):this['logger'][_0x43081d(0x247)](_0x43081d(0x1e2)+_0x4ab62c['name']+'\x27\x20('+_0x4ab62c[_0x43081d(0x20e)]+_0x43081d(0x208)+(_0x43081d(0x26c)+SAFE_INTEGRATION_TYPES[_0x43081d(0x237)](',\x20')+_0x43081d(0x2a8)));}}const _0x48b268=getExperimentalKnowledgeBasesDir(_0x518fd8);if(a123_0x112763[_0x43081d(0x24e)](_0x48b268)){const _0x585199=a123_0x112763['readdirSync'](_0x48b268,{'withFileTypes':!![]});for(const _0x458a0d of _0x585199){if(!_0x458a0d[_0x43081d(0x1d1)]())continue;const _0x16046c=a123_0x44ff7c['join'](_0x48b268,_0x458a0d[_0x43081d(0x1ee)]),_0x610652=a123_0x44ff7c[_0x43081d(0x237)](_0x16046c,_0x458a0d[_0x43081d(0x1ee)]+_0x43081d(0x29c));if(a123_0x112763[_0x43081d(0x24e)](_0x610652)){const _0x486b74=parseExperimentalKnowledgeBaseYaml(a123_0x112763[_0x43081d(0x274)](_0x610652,'utf-8'),_0x610652),_0x42b348=a123_0x44ff7c[_0x43081d(0x237)](_0x16046c,'functions'),_0x1cb2c6=[];if(a123_0x112763[_0x43081d(0x24e)](_0x42b348)){const _0x1ff577=a123_0x112763[_0x43081d(0x28c)](_0x42b348,{'withFileTypes':!![]});for(const _0x2c845c of _0x1ff577){if(!_0x2c845c[_0x43081d(0x1d1)]())continue;const _0x118462=a123_0x44ff7c[_0x43081d(0x237)](_0x42b348,_0x2c845c[_0x43081d(0x1ee)]),_0x5b5615=a123_0x44ff7c[_0x43081d(0x237)](_0x118462,'code.js'),_0x5d27ee=a123_0x44ff7c['join'](_0x118462,_0x43081d(0x240));if(a123_0x112763[_0x43081d(0x24e)](_0x5b5615)&&a123_0x112763['existsSync'](_0x5d27ee)){const _0x1d2268=a123_0x112763[_0x43081d(0x274)](_0x5b5615,_0x43081d(0x231)),_0x245001=a123_0x112763[_0x43081d(0x274)](_0x5d27ee,'utf-8');_0x1cb2c6[_0x43081d(0x279)]({'name':_0x2c845c[_0x43081d(0x1ee)],'code':_0x1d2268,'json_schema':_0x245001});}}}const _0x1464e8={..._0x486b74,'functions':_0x1cb2c6};_0x5f07f8['push']({'name':_0x486b74[_0x43081d(0x1ee)],'path':_0x16046c,'def':_0x1464e8});}}}const _0x4cf1d4=getExperimentalArtifactsDir(_0x518fd8);if(a123_0x112763['existsSync'](_0x4cf1d4)){const _0x3ac736=a123_0x112763[_0x43081d(0x28c)](_0x4cf1d4,{'withFileTypes':!![]});for(const _0x248705 of _0x3ac736){if(!_0x248705['isDirectory']())continue;const _0x361500=a123_0x44ff7c[_0x43081d(0x237)](_0x4cf1d4,_0x248705['name']),_0x1fc98a=a123_0x44ff7c[_0x43081d(0x237)](_0x361500,_0x248705[_0x43081d(0x1ee)]+'.yml');if(a123_0x112763['existsSync'](_0x1fc98a)){const _0x211abc=parseExperimentalArtifactYaml(a123_0x112763[_0x43081d(0x274)](_0x1fc98a,'utf-8'),_0x1fc98a),_0x4726e7=a123_0x44ff7c[_0x43081d(0x237)](_0x361500,_0x43081d(0x23f)),_0x255950=a123_0x112763[_0x43081d(0x24e)](_0x4726e7)?a123_0x112763[_0x43081d(0x274)](_0x4726e7,'utf-8'):'',_0x4dd8ce=a123_0x44ff7c[_0x43081d(0x237)](_0x361500,_0x43081d(0x28a)),_0x1fd432=[];if(a123_0x112763['existsSync'](_0x4dd8ce)){const _0x5a6755=a123_0x112763[_0x43081d(0x28c)](_0x4dd8ce);for(const _0x395987 of _0x5a6755){const _0x1d3af0=a123_0x44ff7c[_0x43081d(0x237)](_0x4dd8ce,_0x395987);if(a123_0x112763['statSync'](_0x1d3af0)[_0x43081d(0x20f)]()){const _0x332855=a123_0x112763['readFileSync'](_0x1d3af0,_0x43081d(0x231));_0x1fd432['push']({'file_name':_0x395987,'text_content':_0x332855});}}}const _0x7342d5={..._0x211abc,'code':_0x255950,'files':_0x1fd432};_0x22a589[_0x43081d(0x279)]({'name':_0x211abc[_0x43081d(0x1ee)],'path':_0x361500,'def':_0x7342d5});}}}}else{const _0x34b8d2=await this['resolveProjectId'](_0x518fd8),_0x17e7ac=await this[_0x43081d(0x26d)][_0x43081d(0x1e6)](_0x34b8d2);_0x228094=_0x17e7ac[_0x43081d(0x244)][_0x43081d(0x1ee)];const _0x538284=await this[_0x43081d(0x26d)][_0x43081d(0x1a6)](_0x34b8d2),_0x54724c=await this[_0x43081d(0x26d)][_0x43081d(0x1c6)](_0x34b8d2),_0x3758d1=await this[_0x43081d(0x26d)][_0x43081d(0x27b)](_0x34b8d2),_0x575440=await this[_0x43081d(0x26d)][_0x43081d(0x1e9)](_0x34b8d2),_0x29e6b7=await this[_0x43081d(0x26d)][_0x43081d(0x1f6)](_0x34b8d2),_0x12439e=await safeListOrEmpty(()=>this['client'][_0x43081d(0x1ad)](_0x34b8d2)),_0x1123f7=await safeListOrEmpty(()=>this[_0x43081d(0x26d)]['listExperimentalArtifacts'](_0x34b8d2)),_0xb16f0f=new Map(),_0x28bddb=new Map(),_0x4dbe78=new Map(),_0x3cd1ea=new Map(),_0x40f767=new Map(),_0x3e6b2d=new Map();for(const _0xcaf379 of _0x54724c){_0xb16f0f[_0x43081d(0x1f8)](_0xcaf379['id'],_0xcaf379[_0x43081d(0x244)][_0x43081d(0x1ee)]);}for(const _0x4f348e of _0x3758d1){_0x28bddb[_0x43081d(0x1f8)](_0x4f348e['id'],_0x4f348e[_0x43081d(0x244)][_0x43081d(0x1ee)]);}for(const _0x71b83a of _0x538284){_0x4dbe78[_0x43081d(0x1f8)](_0x71b83a['id'],_0x71b83a[_0x43081d(0x244)]['name']);}for(const _0x1520d9 of _0x575440){_0x3cd1ea['set'](_0x1520d9['id'],_0x1520d9[_0x43081d(0x244)]['name']);}for(const _0x19806b of _0x12439e){_0x40f767['set'](_0x19806b['id'],_0x19806b['attributes']['name']);}for(const _0x595dbe of _0x1123f7){_0x3e6b2d['set'](_0x595dbe['id'],_0x595dbe[_0x43081d(0x244)][_0x43081d(0x1ee)]);}const _0x5c92ea={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0xb16f0f,'TextKnowledgeBase':_0x28bddb,'Agent':_0x4dbe78,'ExperimentalKnowledgeBase':_0x40f767}),'resolvePromptName':async _0x3ce12e=>_0x3cd1ea[_0x43081d(0x268)](_0x3ce12e),'onWarning':_0x4e0623=>this[_0x43081d(0x1f3)]['warn'](_0x4e0623)};for(const _0x28bf93 of _0x538284){const _0x1f67b3=await agentResponseToDef(_0x28bf93,_0x5c92ea),{yaml:_0x48e074,systemPrompt:_0x596fd6,starterMessage:_0x3fb4a3}=_0x1f67b3;_0x4b8afd[_0x43081d(0x279)]({'name':_0x48e074[_0x43081d(0x1ee)],'dir':'','yaml':_0x48e074,'systemPrompt':_0x596fd6,'starterMessage':_0x3fb4a3});}for(const _0x28e8d1 of _0x54724c){const _0x239998=apiKnowledgeBaseToYaml(_0x28e8d1);_0x15c144[_0x43081d(0x279)]({'name':_0x239998[_0x43081d(0x1ee)],'path':'','yaml':_0x239998});}for(const _0x296278 of _0x3758d1){_0x5d41d9['push']({'name':_0x296278[_0x43081d(0x244)][_0x43081d(0x1ee)],'path':'','text':_0x296278[_0x43081d(0x244)][_0x43081d(0x1e7)]});}for(const _0xe46c04 of _0x575440){const _0x1bbfd7=await apiPromptToYaml(_0xe46c04,_0x5c92ea);_0x1bbfd7&&_0x300fb6[_0x43081d(0x279)]({'name':_0x1bbfd7[_0x43081d(0x1ee)],'path':'','yaml':_0x1bbfd7});}for(const _0x440aa6 of _0x29e6b7){if(!_0x440aa6[_0x43081d(0x244)][_0x43081d(0x1f7)]&&SAFE_INTEGRATION_TYPES[_0x43081d(0x1d3)](_0x440aa6[_0x43081d(0x244)][_0x43081d(0x1b0)][_0x43081d(0x1df)]())){const _0x45a7c5=await apiIntegrationToYaml(_0x440aa6,_0x5c92ea);_0x38fdba[_0x43081d(0x279)]({'name':_0x440aa6[_0x43081d(0x244)][_0x43081d(0x1b0)][_0x43081d(0x1df)](),'path':'','yaml':_0x45a7c5});}}for(const _0x4bdca1 of _0x12439e){const _0x582a0c=apiExperimentalKnowledgeBaseToYaml(_0x4bdca1);_0x5f07f8[_0x43081d(0x279)]({'name':_0x582a0c['name'],'path':'','def':_0x582a0c});}for(const _0x278b65 of _0x1123f7){const _0x1eb175=apiExperimentalArtifactToYaml(_0x278b65);_0x22a589[_0x43081d(0x279)]({'name':_0x1eb175[_0x43081d(0x1ee)],'path':'','def':_0x1eb175});}}const _0x6022b7={'sourceProjectName':_0x228094,'newProjectName':_0x2ae21a,'newProjectId':'','agents':[],'knowledgeBases':[],'textKnowledgeBases':[],'imageGenerators':[],'webSearchTools':[],'prompts':[],'integrations':[],'experimentalKnowledgeBases':[],'experimentalArtifacts':[],'counts':{'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'knowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'textKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'imageGenerators':{'created':0x0,'errors':0x0},'webSearchTools':{'created':0x0,'errors':0x0},'prompts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'integrations':{'created':0x0,'errors':0x0},'experimentalKnowledgeBases':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0},'experimentalArtifacts':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':0x0}}},_0x1caa99=await this[_0x43081d(0x26d)][_0x43081d(0x271)](),_0x4367cc=_0x1caa99[_0x43081d(0x286)](_0x4016db=>_0x4016db[_0x43081d(0x244)]['name']===_0x2ae21a);if(_0x4367cc)throw new SDKError(ErrorCode[_0x43081d(0x1c3)],_0x43081d(0x1af)+_0x2ae21a+_0x43081d(0x2b3),undefined,{'helpText':_0x43081d(0x1ab)});if(_0x442bce?.[_0x43081d(0x223)])return _0x6022b7[_0x43081d(0x211)][_0x43081d(0x1f5)][_0x43081d(0x1c2)]=_0x4b8afd[_0x43081d(0x206)],_0x6022b7[_0x43081d(0x211)][_0x43081d(0x1cc)][_0x43081d(0x1c2)]=_0x15c144['length'],_0x6022b7[_0x43081d(0x211)][_0x43081d(0x19f)][_0x43081d(0x1c2)]=_0x5d41d9[_0x43081d(0x206)],_0x6022b7['counts'][_0x43081d(0x259)][_0x43081d(0x1c2)]=_0x5f07f8[_0x43081d(0x206)],_0x6022b7[_0x43081d(0x211)][_0x43081d(0x221)][_0x43081d(0x1c2)]=_0x22a589['length'],_0x6022b7['counts'][_0x43081d(0x1d5)][_0x43081d(0x1c2)]=_0x300fb6[_0x43081d(0x206)],_0x6022b7[_0x43081d(0x211)]['integrations'][_0x43081d(0x1c2)]=_0x38fdba[_0x43081d(0x206)],_0x6022b7;const _0x97479=await this[_0x43081d(0x26d)][_0x43081d(0x253)]({'name':_0x2ae21a}),_0x422462=_0x97479['id'];_0x6022b7[_0x43081d(0x290)]=_0x422462;const _0x3b9d20=new Map(),_0x4761e3=new Map(),_0x396bad=new Map(),_0x23898a=new Map(),_0x3465d2=new Map(),_0x2f2474=new Map(),_0x35d092=new Map(),_0x462855=new Map(),_0x3ff455=new Set(),_0x52def2=new Set();for(const _0x2eb394 of _0x4b8afd){for(const _0x357df7 of _0x2eb394[_0x43081d(0x2b0)]['tools']||[]){if(_0x357df7[_0x43081d(0x260)]===_0x43081d(0x245)&&_0x357df7[_0x43081d(0x249)]){const _0x18a9b9=parseRef(_0x357df7[_0x43081d(0x249)]);if(_0x18a9b9)_0x3ff455[_0x43081d(0x1be)](_0x18a9b9[_0x43081d(0x1ee)]);}else{if(_0x357df7[_0x43081d(0x260)]===_0x43081d(0x20c)&&_0x357df7[_0x43081d(0x249)]){const _0x4c7879=parseRef(_0x357df7[_0x43081d(0x249)]);if(_0x4c7879)_0x52def2[_0x43081d(0x1be)](_0x4c7879[_0x43081d(0x1ee)]);}}}}for(const _0xdbe83 of _0x3ff455){try{const _0x23effe=await this[_0x43081d(0x26d)][_0x43081d(0x1eb)]({'projectId':_0x422462,'name':_0xdbe83});_0x3465d2[_0x43081d(0x1f8)](_0xdbe83,_0x23effe['id']),_0x6022b7['imageGenerators']['push']({'name':_0xdbe83,'action':_0x43081d(0x1c2),'id':_0x23effe['id']}),_0x6022b7[_0x43081d(0x211)]['imageGenerators']['created']++;}catch(_0x29866b){_0x6022b7[_0x43081d(0x1ec)][_0x43081d(0x279)]({'name':_0xdbe83,'action':_0x43081d(0x24f),'error':_0x29866b[_0x43081d(0x1c8)]}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x1ec)][_0x43081d(0x23c)]++;}}for(const _0xf38e77 of _0x52def2){try{const _0x2a7133=await this[_0x43081d(0x26d)][_0x43081d(0x1a4)]({'projectId':_0x422462,'name':_0xf38e77});_0x2f2474[_0x43081d(0x1f8)](_0xf38e77,_0x2a7133['id']),_0x6022b7[_0x43081d(0x2a4)][_0x43081d(0x279)]({'name':_0xf38e77,'action':'created','id':_0x2a7133['id']}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x2a4)]['created']++;}catch(_0x5ddcf5){_0x6022b7[_0x43081d(0x2a4)]['push']({'name':_0xf38e77,'action':_0x43081d(0x24f),'error':_0x5ddcf5[_0x43081d(0x1c8)]}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x2a4)]['errors']++;}}const _0x3fd36a=await fetchAllToolTargetMaps((_0x33c608,_0x501664)=>this[_0x43081d(0x26d)][_0x43081d(0x1c5)](_0x33c608,_0x501664),_0x422462);let _0x442cbb=[];const _0x4d1aee={'projectId':_0x422462,'resolveToolTargetId':buildIdResolver({..._0x3fd36a[_0x43081d(0x1dd)],'KnowledgeBase':_0x3b9d20,'TextKnowledgeBase':_0x4761e3,'ExperimentalKnowledgeBase':_0x35d092,'Agent':_0x396bad,'WebSearchTool':_0x2f2474,'ImageGenerator':_0x3465d2}),'resolvePromptId':async _0x4f1d45=>_0x23898a[_0x43081d(0x268)](_0x4f1d45),'onWarning':_0x8d291=>{this['logger']['warn'](_0x8d291),_0x442cbb['push'](_0x8d291);}};for(const _0x1fb899 of _0x15c144){try{const _0x3f2d10=yamlKnowledgeBaseToApi(_0x1fb899['yaml'],_0x422462),_0x3e3d30=await this[_0x43081d(0x26d)][_0x43081d(0x1bb)](_0x3f2d10);_0x3b9d20[_0x43081d(0x1f8)](_0x1fb899[_0x43081d(0x2b0)][_0x43081d(0x1ee)],_0x3e3d30['id']),_0x6022b7[_0x43081d(0x1cc)][_0x43081d(0x279)]({'name':_0x1fb899['yaml'][_0x43081d(0x1ee)],'action':_0x43081d(0x1c2),'id':_0x3e3d30['id']}),_0x6022b7['counts'][_0x43081d(0x1cc)][_0x43081d(0x1c2)]++;}catch(_0x5b2f18){_0x6022b7[_0x43081d(0x1cc)][_0x43081d(0x279)]({'name':_0x1fb899[_0x43081d(0x2b0)][_0x43081d(0x1ee)],'action':_0x43081d(0x24f),'error':_0x5b2f18['message']}),_0x6022b7[_0x43081d(0x211)]['knowledgeBases'][_0x43081d(0x23c)]++;}}for(const _0x86f2a5 of _0x5d41d9){try{const _0x241681=yamlTextKnowledgeBaseToApi({'name':_0x86f2a5[_0x43081d(0x1ee)],'text':_0x86f2a5[_0x43081d(0x1e7)]},_0x422462),_0x3453cb=await this[_0x43081d(0x26d)][_0x43081d(0x236)](_0x241681);_0x4761e3[_0x43081d(0x1f8)](_0x86f2a5[_0x43081d(0x1ee)],_0x3453cb['id']),_0x6022b7['textKnowledgeBases']['push']({'name':_0x86f2a5[_0x43081d(0x1ee)],'action':_0x43081d(0x1c2),'id':_0x3453cb['id']}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x19f)]['created']++;}catch(_0x945b20){_0x6022b7[_0x43081d(0x19f)][_0x43081d(0x279)]({'name':_0x86f2a5[_0x43081d(0x1ee)],'action':_0x43081d(0x24f),'error':_0x945b20[_0x43081d(0x1c8)]}),_0x6022b7['counts'][_0x43081d(0x19f)][_0x43081d(0x23c)]++;}}for(const _0x2e029f of _0x22a589){try{const _0x209a57=yamlExperimentalArtifactToApi(_0x2e029f[_0x43081d(0x24b)],_0x422462),_0x1873b7=await this[_0x43081d(0x26d)][_0x43081d(0x213)](_0x209a57);_0x462855[_0x43081d(0x1f8)](_0x2e029f[_0x43081d(0x24b)]['name'],_0x1873b7['id']),_0x6022b7[_0x43081d(0x221)][_0x43081d(0x279)]({'name':_0x2e029f[_0x43081d(0x24b)][_0x43081d(0x1ee)],'action':'created','id':_0x1873b7['id']}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x221)][_0x43081d(0x1c2)]++;}catch(_0x2e6ec0){_0x6022b7[_0x43081d(0x221)][_0x43081d(0x279)]({'name':_0x2e029f[_0x43081d(0x24b)][_0x43081d(0x1ee)],'action':'error','error':_0x2e6ec0[_0x43081d(0x1c8)]}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x221)][_0x43081d(0x23c)]++;}}for(const _0x170ffc of _0x5f07f8){try{const _0x1d578e=yamlExperimentalKnowledgeBaseToApi(_0x170ffc[_0x43081d(0x24b)],_0x422462),_0x21a7ad=await this[_0x43081d(0x26d)][_0x43081d(0x2b7)](_0x1d578e);_0x35d092[_0x43081d(0x1f8)](_0x170ffc['def'][_0x43081d(0x1ee)],_0x21a7ad['id']),_0x6022b7[_0x43081d(0x259)][_0x43081d(0x279)]({'name':_0x170ffc[_0x43081d(0x24b)]['name'],'action':'created','id':_0x21a7ad['id']}),_0x6022b7['counts'][_0x43081d(0x259)]['created']++;}catch(_0x3698d8){_0x6022b7[_0x43081d(0x259)]['push']({'name':_0x170ffc[_0x43081d(0x24b)][_0x43081d(0x1ee)],'action':'error','error':_0x3698d8[_0x43081d(0x1c8)]}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x259)][_0x43081d(0x23c)]++;}}const _0x2b90d7=[..._0x4b8afd][_0x43081d(0x273)]((_0x5bd064,_0x1195e7)=>{const _0x50de4c=_0x43081d,_0x250f8f=_0x5bd064['yaml']['tools']?.[_0x50de4c(0x261)](_0x447f0f=>_0x447f0f[_0x50de4c(0x260)]===_0x50de4c(0x23a))??![],_0x4df976=_0x1195e7[_0x50de4c(0x2b0)][_0x50de4c(0x217)]?.[_0x50de4c(0x261)](_0xaefbca=>_0xaefbca['type']===_0x50de4c(0x23a))??![];if(_0x250f8f&&!_0x4df976)return 0x1;if(!_0x250f8f&&_0x4df976)return-0x1;return 0x0;});for(const _0x31620f of _0x2b90d7){_0x442cbb=[];try{const _0x3bd7f0=_0x31620f['yaml']['tools']?.[_0x43081d(0x280)](_0x15beff=>{const _0x565f35=_0x43081d;if(_0x15beff[_0x565f35(0x260)]===_0x565f35(0x23a)&&_0x15beff[_0x565f35(0x249)]){const _0x804099=parseRef(_0x15beff['target']);return _0x804099?.[_0x565f35(0x1ee)]===_0x31620f[_0x565f35(0x2b0)]['name'];}return![];})??[];if(_0x3bd7f0[_0x43081d(0x206)]>0x0){const _0x5f31b0=_0x43081d(0x1c4)+_0x31620f[_0x43081d(0x2b0)][_0x43081d(0x1ee)]+_0x43081d(0x284)+_0x43081d(0x204);this[_0x43081d(0x1f3)][_0x43081d(0x247)](_0x5f31b0),_0x442cbb['push'](_0x5f31b0);}const _0x25c04a=await agentDefToRequest(_0x31620f['yaml'],_0x31620f[_0x43081d(0x2b6)],_0x31620f[_0x43081d(0x246)],_0x4d1aee),_0x217349=await this[_0x43081d(0x26d)][_0x43081d(0x22a)](_0x25c04a);_0x396bad['set'](_0x31620f[_0x43081d(0x2b0)][_0x43081d(0x1ee)],_0x217349['id']),_0x6022b7[_0x43081d(0x1f5)][_0x43081d(0x279)]({'agentName':_0x31620f['yaml'][_0x43081d(0x1ee)],'action':'created','agentId':_0x217349['id'],'warnings':_0x442cbb[_0x43081d(0x206)]>0x0?_0x442cbb:undefined}),_0x6022b7['counts'][_0x43081d(0x1f5)]['created']++;}catch(_0x58531d){_0x6022b7['agents']['push']({'agentName':_0x31620f[_0x43081d(0x2b0)][_0x43081d(0x1ee)],'action':_0x43081d(0x24f),'error':_0x58531d[_0x43081d(0x1c8)],'warnings':_0x442cbb[_0x43081d(0x206)]>0x0?_0x442cbb:undefined}),_0x6022b7[_0x43081d(0x211)]['agents'][_0x43081d(0x23c)]++;}}for(const _0x4853ad of _0x300fb6){try{const _0x3dc33f=await yamlPromptToApi(_0x4853ad['yaml'],_0x422462,_0x4d1aee);if(!_0x3dc33f){_0x6022b7[_0x43081d(0x1d5)][_0x43081d(0x279)]({'name':_0x4853ad[_0x43081d(0x2b0)]['name'],'action':'error','error':_0x43081d(0x270)}),_0x6022b7['counts'][_0x43081d(0x1d5)]['errors']++;continue;}const _0x3c5887=await this[_0x43081d(0x26d)][_0x43081d(0x2b1)](_0x3dc33f);_0x23898a[_0x43081d(0x1f8)](_0x4853ad[_0x43081d(0x2b0)][_0x43081d(0x1ee)],_0x3c5887['id']),_0x6022b7['prompts'][_0x43081d(0x279)]({'name':_0x4853ad[_0x43081d(0x2b0)]['name'],'action':'created','id':_0x3c5887['id']}),_0x6022b7[_0x43081d(0x211)]['prompts'][_0x43081d(0x1c2)]++;}catch(_0x274e23){_0x6022b7[_0x43081d(0x1d5)]['push']({'name':_0x4853ad[_0x43081d(0x2b0)][_0x43081d(0x1ee)],'action':_0x43081d(0x24f),'error':_0x274e23['message']}),_0x6022b7['counts'][_0x43081d(0x1d5)][_0x43081d(0x23c)]++;}}for(const _0x26d0f3 of _0x38fdba){try{const _0x5f4637=await yamlIntegrationToApi(_0x26d0f3[_0x43081d(0x2b0)],_0x422462,_0x4d1aee),_0x23e8b3=await this['client']['createIntegration'](_0x5f4637);_0x6022b7[_0x43081d(0x2a1)][_0x43081d(0x279)]({'name':_0x26d0f3[_0x43081d(0x2b0)][_0x43081d(0x20e)],'action':'created','id':_0x23e8b3['id']}),_0x6022b7[_0x43081d(0x211)][_0x43081d(0x2a1)][_0x43081d(0x1c2)]++;}catch(_0x5947ce){_0x6022b7[_0x43081d(0x2a1)]['push']({'name':_0x26d0f3['yaml']['service_type'],'action':'error','error':_0x5947ce['message']}),_0x6022b7[_0x43081d(0x211)]['integrations'][_0x43081d(0x23c)]++;}}return _0x6022b7;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4ddfc9,_0x4f704b){const _0x315108=a124_0x5898,_0x34083d=_0x4ddfc9();while(!![]){try{const _0x556f6f=-parseInt(_0x315108(0x1da))/0x1+parseInt(_0x315108(0x1d2))/0x2*(-parseInt(_0x315108(0x1d9))/0x3)+-parseInt(_0x315108(0x1d5))/0x4*(parseInt(_0x315108(0x1dc))/0x5)+-parseInt(_0x315108(0x1de))/0x6+-parseInt(_0x315108(0x1d8))/0x7+-parseInt(_0x315108(0x1d3))/0x8+parseInt(_0x315108(0x1dd))/0x9;if(_0x556f6f===_0x4f704b)break;else _0x34083d['push'](_0x34083d['shift']());}catch(_0x243a24){_0x34083d['push'](_0x34083d['shift']());}}}(a124_0x4bf2,0x5a273));export function canCreateAgent(_0x239363,_0x4d342b){const _0x3edab1=a124_0x5898;for(const _0x3db167 of _0x239363['attributes'][_0x3edab1(0x1d6)]){if(_0x3db167['targetAgentId']&&!_0x4d342b['has'](_0x3db167['targetAgentId']))return![];}return!![];}function a124_0x5898(_0x253c8b,_0x516a45){_0x253c8b=_0x253c8b-0x1d2;const _0x4bf2a6=a124_0x4bf2();let _0x589855=_0x4bf2a6[_0x253c8b];return _0x589855;}export function remapToolIds(_0x4441a4,_0x1d1a71,_0x2c7955){const _0x52da2c=a124_0x5898;return _0x4441a4['map'](_0xc71b78=>({..._0xc71b78,'targetKnowledgeBaseId':_0xc71b78[_0x52da2c(0x1d4)]?_0x1d1a71[_0x52da2c(0x1d7)](_0xc71b78['targetKnowledgeBaseId'])||_0xc71b78[_0x52da2c(0x1d4)]:undefined,'targetAgentId':_0xc71b78[_0x52da2c(0x1df)]?_0x2c7955[_0x52da2c(0x1d7)](_0xc71b78[_0x52da2c(0x1df)])||_0xc71b78['targetAgentId']:undefined}));}export function remapVariableIds(_0x2f977a,_0x135e1c){const _0x451bcc=a124_0x5898;return _0x2f977a['map'](_0x136571=>({..._0x136571,'targetKnowledgeBaseId':_0x135e1c[_0x451bcc(0x1d7)](_0x136571[_0x451bcc(0x1d4)])||_0x136571['targetKnowledgeBaseId']}));}function a124_0x4bf2(){const _0x15bb6a=['2538800BqNclm','tools','get','1629033GXlxjf','846078nUhRWW','524871bjKDDi','1.0','5yJwFXn','26475057cFcrfo','292026vrybfX','targetAgentId','4JQjsWd','4539144TYfpPp','targetKnowledgeBaseId'];a124_0x4bf2=function(){return _0x15bb6a;};return a124_0x4bf2();}export function isSupportedBackupVersion(_0x1a75c7){const _0x1f2f08=a124_0x5898;return _0x1a75c7===_0x1f2f08(0x1db);}
|