@treasuredata/tdx 2026.3.21 → 2026.3.23

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.
Files changed (203) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
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
+ const a123_0x5aa90d=a123_0x4621;(function(_0x380f6c,_0x55add7){const _0x2f8614=a123_0x4621,_0x5e1040=_0x380f6c();while(!![]){try{const _0x47435f=parseInt(_0x2f8614(0xbb))/0x1+-parseInt(_0x2f8614(0x1a2))/0x2+parseInt(_0x2f8614(0x1af))/0x3+parseInt(_0x2f8614(0x168))/0x4*(-parseInt(_0x2f8614(0xca))/0x5)+-parseInt(_0x2f8614(0x170))/0x6*(parseInt(_0x2f8614(0x188))/0x7)+-parseInt(_0x2f8614(0x160))/0x8+parseInt(_0x2f8614(0x119))/0x9;if(_0x47435f===_0x55add7)break;else _0x5e1040['push'](_0x5e1040['shift']());}catch(_0x3bb472){_0x5e1040['push'](_0x5e1040['shift']());}}}(a123_0x1a8a,0xa381c));import{LLMApiClient}from'../client/llm-api-client.js';import*as a123_0x1fc611 from'node:fs';import*as a123_0x522ebe 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';function a123_0x1a8a(){const _0x1d672e=['yaml','context','prompt.md','version','Renamed\x20experimental\x20KB\x20directory:\x20','medium','set','agentId','push','existsSync','unchanged','TextKnowledgeBase','webhookCorsOrigins','agents.json','getOrCreateDefaultAgent','isDir','basename','sdk.llm','(dry-run)','getUserSettings','pullProject','listIntegrations','Default\x20project\x20for\x20tdx\x20CLI\x20chat\x20(user:\x20','textKnowledgeBases','LLM_PROJECT_NOT_FOUND','Renamed\x20integration\x20file:\x20','No\x20tdx.json\x20found\x20in\x20','errors','chat_parent_segment','Unable\x20to\x20create\x20project\x20after\x20','\x0a---\x20schema:\x20','20618379udAjZN','getProject','experimental_artifacts','localeCompare','updated','serviceType','attributes','code.js','createProject','projectId','listImageGenerators','slackMessageMode','stringify','image_gen','isDirectory','listAgentsFull','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','chats','message','imageGenerators','sort','tdx_default_','map','\x0a---\x20code\x20---\x0a','listExperimentalArtifacts','#\x20prompt.md\x0a','NOT_FOUND','add','variables','listPrompts','Authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key\x20is\x20valid\x20and\x20not\x20expired.','Use\x20format:\x20\x22agent-name\x22\x20or\x20\x22project-name/agent-name\x22','site','code','functions','setCurrentProject','file_name','listProjects','claude-4.5-sonnet','reasoningEffort','restoreProject','find','\x22\x20already\x20exists','resolveProjectName','updateAgentResponse','starter_message.md','getDefaultProjectName','size','deleteIntegration','modelType','---\x20file:\x20','INVALID_ARGUMENT','service_type','.yml','split','listWebSearchTools','getOrCreateDefaultProject','.md','agentId\x20is\x20required\x20when\x20starting\x20a\x20new\x20chat','target','chatId','toLowerCase','total','\x27\x20(','createWebSearchTool','none','Agent\x20not\x20found:\x20','oldPath','keys','availableModels','signal','1279760whvpDv','updateAgent','.llm','exportedFrom','Configure\x20WEBHOOK/SLACK\x20integrations\x20manually\x20in\x20the\x20UI.','createAgent','tdx_','listChats','1786648oEYUSY','description','knowledge_bases','updatePrompt','prompts','Only\x20safe\x20types\x20(','project','Available\x20agents:\x20','2047398zgaKlC','\x27\x20has\x20self-referencing\x20tool(s)\x20that\x20will\x20be\x20skipped\x20during\x20clone.\x20','tdx.json','getChatLog','chat_agent_console','projectName','listTextKnowledgeBases','promptId','maxToolIterations','writeFileSync','mkdirSync','Agent\x20reference\x20not\x20found','createKnowledgeBase','\x20---\x0a','createIntegration','nameToId','rmSync','The\x20backup\x20contains\x20agents\x20with\x20circular\x20dependencies.','chatInfo','experimentalKnowledgeBases','1.0','knowledgeBases','Renamed\x20agent\x20folder:\x20','logger','14JCUSwh','updateExperimentalArtifact','updateTextKnowledgeBase','pullAgent','This\x20backup\x20was\x20created\x20with\x20a\x20newer\x20version\x20of\x20tdx.','chat','Project\x20\x22','Invalid\x20backup:\x20project.json\x20not\x20found\x20in\x20','filter','tdDatabaseName','startChat','knowledgebases.json','listAgents','PERMISSION_DENIED','isFile','statSync','\x20in\x20project\x20','Removed\x20deleted\x20file:\x20','Project\x20not\x20found:\x20','Unsupported\x20backup\x20version:\x20','metadata','listExperimentalKnowledgeBases','createExperimentalArtifact','text_content','):\x20','Invalid\x20agent\x20reference\x20format:\x20','2528812AgpxVI','experimentalArtifacts','dry-run-','type','deleteAgent','tools','renamed','history','Ensure\x20the\x20backup\x20folder\x20path\x20is\x20correct.','isManaged','parse','loadJsonFile','experimental_knowledge_bases','3174405TwLCah','project.json','updateExperimentalKnowledgeBase','agent.yml','name','Multiple\x20projects\x20found\x20with\x20name\x20\x27','counts','updateKnowledgeBase','createImageGenerator','Renamed\x20prompt\x20file:\x20','webSearchTools','dirname','conflict','content','temperature','Renamed\x20KB\x20file:\x20','Renamed\x20text\x20KB\x20file:\x20','resolveProjectId','starterMessage','getAgent','profile','high','Agent\x20\x27','path','pushAgent','dryRun','listToolTargets','Ensure\x20the\x20path\x20points\x20to\x20a\x20valid\x20agent\x20directory.','Renamed\x20folder:\x20','\x0a\x0a#\x20agent.yml\x0a','client','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.','new','starter_message','AGENT_NOT_FOUND','agent','listKnowledgeBases','utf-8','currentProjectId','json_schema','320824xtULpd','agent.yml\x20not\x20found\x20in\x20','llm_project','KnowledgeBase',')\x20can\x20be\x20cloned.','readFileSync','Renamed\x20experimental\x20artifact\x20directory:\x20','setDefaultAgent','clearDefaultAgent','outputs','prompts.json','already\x20exists','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','integrations','getChatInfo','10vvZAnx','includes','readdirSync','createAgentResponse','systemPrompt','\x20→\x20','createPrompt','json_schema.json','INTERNAL','text','Circular\x20dependency\x20detected\x20in\x20agents.\x20Cannot\x20restore.','\x27.\x20This\x20should\x20not\x20happen.','agents','Unresolved\x20dependencies:\x20','ExperimentalKnowledgeBase','Skipping\x20integration\x20\x27','status','created','tables','resolveAgentId','models','template','agentsFull','chatIgnoreManagedActions','projects','chatWelcomeMessage','error','jsonSchemaHint','createTextKnowledgeBase','UNAUTHENTICATED','\x0a---\x20function:\x20','toISOString','files','warn','info','endsWith','has','newProjectId','chat_generic','ALREADY_EXISTS','length','createExperimentalKnowledgeBase','actions','get','def','join','duplicate','pushProject'];a123_0x1a8a=function(){return _0x1d672e;};return a123_0x1a8a();}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=[a123_0x5aa90d(0xf0),a123_0x5aa90d(0x174),a123_0x5aa90d(0x116)];function a123_0x4621(_0x16da8a,_0x3304d8){_0x16da8a=_0x16da8a-0xb3;const _0x1a8aa4=a123_0x1a8a();let _0x462168=_0x1a8aa4[_0x16da8a];return _0x462168;}async function safeListOrEmpty(_0x5e2636){const _0x2651f5=a123_0x5aa90d;try{return await _0x5e2636();}catch(_0x7a98cb){if(_0x7a98cb instanceof HTTPClientError&&_0x7a98cb[_0x2651f5(0xda)]===0x194)return[];throw _0x7a98cb;}}export class LLMSDK{[a123_0x5aa90d(0xb9)];[a123_0x5aa90d(0x1cd)];[a123_0x5aa90d(0xfb)];[a123_0x5aa90d(0x187)]=Logger['of'](a123_0x5aa90d(0x10b));constructor(_0x10ab97){const _0x2e371f=a123_0x5aa90d;this[_0x2e371f(0x1cd)]=new LLMApiClient(_0x10ab97),this[_0x2e371f(0xfb)]=_0x10ab97;}[a123_0x5aa90d(0x147)](){const _0x4f32d1=a123_0x5aa90d,_0x12f165=getSanitizedUsername();return _0x4f32d1(0x12e)+_0x12f165;}async[a123_0x5aa90d(0x13c)](_0x2001ed){const _0xdf2cc=a123_0x5aa90d,{projectId:_0xefad81}=await this[_0xdf2cc(0x144)](_0x2001ed);this[_0xdf2cc(0xb9)]=_0xefad81;}['getCurrentProject'](){const _0x34e4b9=a123_0x5aa90d;return this[_0x34e4b9(0xb9)];}async[a123_0x5aa90d(0xc2)](_0x23914a){const _0x36ec5e=a123_0x5aa90d,_0x3283c7=this[_0x36ec5e(0xfb)][_0x36ec5e(0x1c3)];let _0x583aad,_0xab960e;if(_0x23914a[_0x36ec5e(0xcb)]('/')){const _0xa9f3f1=_0x23914a[_0x36ec5e(0x14f)]('/');if(_0xa9f3f1['length']!==0x2)throw new SDKError(ErrorCode[_0x36ec5e(0x14c)],_0x36ec5e(0x1a1)+_0x23914a,undefined,{'helpText':_0x36ec5e(0x138)});const [_0x4d5903,_0x27c7de]=_0xa9f3f1;_0x583aad=await this[_0x36ec5e(0x1c0)](_0x4d5903),_0xab960e=_0x27c7de;}else _0x583aad=this[_0x36ec5e(0xb9)]||(await this['getOrCreateDefaultProject']())['id'],_0xab960e=_0x23914a;const _0x5d8bee=await this[_0x36ec5e(0xdd)](_0xab960e,_0x583aad),_0x3ee880=await this[_0x36ec5e(0x1cd)][_0x36ec5e(0x1c2)](_0x5d8bee);writeCachedLLMAgent(_0x3ee880[_0x36ec5e(0x11f)][_0x36ec5e(0x1b3)],_0x5d8bee,_0x583aad,_0x3283c7);}['getDefaultAgent'](){const _0x4e2bf0=a123_0x5aa90d,_0x318aed=this[_0x4e2bf0(0xfb)][_0x4e2bf0(0x1c3)];return readCachedLLMAgent(_0x318aed)||undefined;}[a123_0x5aa90d(0xc3)](){const _0x5b936e=a123_0x5aa90d,_0x174b07=this['context'][_0x5b936e(0x1c3)];clearCachedLLMAgent(_0x174b07);}async[a123_0x5aa90d(0xde)](){const _0x3955e6=a123_0x5aa90d,_0x3d9b3e=await this['client'][_0x3955e6(0x10d)](),_0x383f1e=[];for(const _0x54b620 of _0x3d9b3e['availableModelNames']){const _0x39a1f3=_0x3d9b3e[_0x3955e6(0x15e)][_0x54b620];_0x39a1f3&&_0x383f1e[_0x3955e6(0x102)]({'name':_0x54b620,'displayName':_0x39a1f3['displayName']});}return _0x383f1e;}async[a123_0x5aa90d(0x121)](_0x55c983){const _0x59a496=a123_0x5aa90d;return await this[_0x59a496(0x1cd)]['createProject'](_0x55c983);}async['deleteProject'](_0x10dfe6){const _0x2bfd91=a123_0x5aa90d,{projectId:_0x1f3afa}=await this[_0x2bfd91(0x144)](_0x10dfe6);await this[_0x2bfd91(0x1cd)]['deleteProject'](_0x1f3afa);}async[a123_0x5aa90d(0xe2)](_0x38615c=0x32){const _0x4f8ae0=a123_0x5aa90d;return await this[_0x4f8ae0(0x1cd)][_0x4f8ae0(0x13e)](_0x38615c);}async[a123_0x5aa90d(0x151)](_0x3142d5){const _0x202737=a123_0x5aa90d,_0x39ee1d=_0x3142d5||this[_0x202737(0x147)](),_0x540faf=this['context'][_0x202737(0x1c3)];if(!_0x3142d5){const _0x385498=readCachedLLMProject(_0x540faf);if(_0x385498&&_0x385498[_0x202737(0x1b3)]===_0x39ee1d)try{const _0x31c58a=await this[_0x202737(0x1cd)][_0x202737(0x11a)](_0x385498['id']);if(_0x31c58a['attributes'][_0x202737(0x1b3)]===_0x39ee1d)return _0x31c58a;}catch{}}const _0x569079=await this[_0x202737(0x1cd)][_0x202737(0x13e)](),_0x5da37e=_0x569079[_0x202737(0x142)](_0x27ea1b=>_0x27ea1b[_0x202737(0x11f)][_0x202737(0x1b3)]===_0x39ee1d);if(_0x5da37e)return!_0x3142d5&&writeCachedLLMProject(_0x39ee1d,_0x5da37e['id'],_0x540faf),_0x5da37e;const _0x5ed198=await this['client'][_0x202737(0x121)]({'name':_0x39ee1d,'description':_0x202737(0x110)+getSanitizedUsername()+')'});return!_0x3142d5&&writeCachedLLMProject(_0x39ee1d,_0x5ed198['id'],_0x540faf),_0x5ed198;}async[a123_0x5aa90d(0x1c0)](_0x11afbe){const _0x3c719b=a123_0x5aa90d,_0x50b754=await this[_0x3c719b(0x1cd)][_0x3c719b(0x13e)](),_0x4ffca8=_0x50b754['filter'](_0x32ae63=>_0x32ae63[_0x3c719b(0x11f)][_0x3c719b(0x1b3)]===_0x11afbe);if(_0x4ffca8[_0x3c719b(0xf2)]===0x0)throw new SDKError(ErrorCode[_0x3c719b(0x112)],_0x3c719b(0x19a)+_0x11afbe,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});if(_0x4ffca8[_0x3c719b(0xf2)]>0x1)throw new SDKError(ErrorCode['INTERNAL'],_0x3c719b(0x1b4)+_0x11afbe+_0x3c719b(0xd5));return _0x4ffca8[0x0]['id'];}async[a123_0x5aa90d(0x144)](_0x13777d){const _0x535d90=a123_0x5aa90d,_0x451ae2=await this[_0x535d90(0x1cd)][_0x535d90(0x13e)](),_0x1c3ce5=_0x451ae2[_0x535d90(0x142)](_0xc7e97a=>_0xc7e97a[_0x535d90(0x11f)][_0x535d90(0x1b3)]===_0x13777d);if(_0x1c3ce5)return{'projectId':_0x1c3ce5['id'],'project':_0x1c3ce5};throw new SDKError(ErrorCode[_0x535d90(0x112)],_0x535d90(0x19a)+_0x13777d,undefined,{'helpText':_0x535d90(0xc7)});}async[a123_0x5aa90d(0x108)](_0x3fe74d=a123_0x5aa90d(0x13f),_0x37fbf7=0x0,_0x1ebd56){const _0x38f53c=a123_0x5aa90d,_0xddd765=0xa;let _0x33f04d=0x0,_0x3a0a7c;while(_0x33f04d<_0xddd765){try{const _0x30637f=await this['getOrCreateDefaultProject'](_0x3a0a7c),_0x56b148=_0x30637f['id'],_0x426a1d=[_0x38f53c(0x15a),'minimal','low',_0x38f53c(0xff),_0x38f53c(0x1c4)],_0x492935=_0x37fbf7===0x0?'tdx_'+_0x3fe74d:_0x38f53c(0x166)+_0x3fe74d+'_reasoning_'+_0x426a1d[_0x37fbf7],_0x2903fc=await this[_0x38f53c(0x1cd)]['listAgents'](_0x56b148),_0x3b4454=_0x2903fc[_0x38f53c(0x142)](_0x3fea18=>_0x3fea18[_0x38f53c(0x11f)][_0x38f53c(0x1b3)]===_0x492935);if(_0x3b4454)return _0x3b4454;const _0x464495=_0x37fbf7>0x0?0x1:_0x1ebd56;return await this[_0x38f53c(0x1cd)]['createAgent']({'name':_0x492935,'projectId':_0x56b148,'modelType':_0x3fe74d,'systemPrompt':'','temperature':_0x464495,'reasoningEffort':_0x37fbf7>0x0?_0x37fbf7:undefined});}catch(_0x2a5a17){if(_0x2a5a17 instanceof HTTPClientError){const _0x58deef=_0x2a5a17[_0x38f53c(0xda)];if(_0x58deef>=0x190&&_0x58deef<0x1f4){if(_0x58deef===0x191)throw new SDKError(ErrorCode[_0x38f53c(0xe7)],_0x38f53c(0x137),_0x2a5a17);else{if(_0x58deef===0x193)throw new SDKError(ErrorCode[_0x38f53c(0x195)],'Permission\x20denied.\x20Please\x20check\x20your\x20API\x20key\x20has\x20the\x20required\x20permissions\x20for\x20LLM\x20API\x20operations.',_0x2a5a17);}throw _0x2a5a17;}}if(errorContains(_0x2a5a17,_0x38f53c(0xc6),_0x38f53c(0xf8),_0x38f53c(0x1bb))){_0x33f04d++;if(_0x33f04d>=_0xddd765)throw new SDKError(ErrorCode[_0x38f53c(0xf1)],_0x38f53c(0x117)+_0xddd765+'\x20attempts\x20due\x20to\x20name\x20conflicts.',_0x2a5a17);const _0x31e32=this[_0x38f53c(0x147)]();_0x3a0a7c=_0x31e32+'_'+generateRandomHex();continue;}throw _0x2a5a17;}}throw new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20get\x20or\x20create\x20agent:\x20exceeded\x20maximum\x20attempts');}async[a123_0x5aa90d(0xdd)](_0xfb7cc9,_0x3e462b){const _0x134881=a123_0x5aa90d,_0x4f08e1=_0x3e462b||this[_0x134881(0xb9)],_0xb5c07c=await this[_0x134881(0x1cd)][_0x134881(0x194)](_0x4f08e1),_0x4fbcff=_0xb5c07c['filter'](_0x46f223=>_0x46f223['attributes'][_0x134881(0x1b3)]===_0xfb7cc9);if(_0x4fbcff['length']===0x0){const _0x193508=_0x4f08e1?_0x134881(0x198)+_0x4f08e1:'';throw new SDKError(ErrorCode[_0x134881(0xb5)],'Agent\x20not\x20found:\x20'+_0xfb7cc9+_0x193508,undefined,{'helpText':_0x4f08e1?'Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20list\x20available\x20agents\x20in\x20the\x20current\x20project.':_0x134881(0x1ce)});}if(_0x4fbcff[_0x134881(0xf2)]>0x1)throw new SDKError(ErrorCode[_0x134881(0xd2)],'Multiple\x20agents\x20found\x20with\x20name\x20\x27'+_0xfb7cc9+_0x134881(0xd5));return _0x4fbcff[0x0]['id'];}async[a123_0x5aa90d(0xd6)](_0x3377d7){const _0xab38a6=a123_0x5aa90d,_0x51ca35=_0x3377d7||this[_0xab38a6(0xb9)];return await this['client'][_0xab38a6(0x194)](_0x51ca35);}async[a123_0x5aa90d(0xe0)](_0x461878){return await this['client']['listAgentsFull'](_0x461878);}async[a123_0x5aa90d(0xb6)](_0x2ea393){const _0x240eca=a123_0x5aa90d;return await this[_0x240eca(0x1cd)]['getAgent'](_0x2ea393);}async[a123_0x5aa90d(0x165)](_0x1c30d2){const _0x347b67=a123_0x5aa90d;return await this['client'][_0x347b67(0x165)](_0x1c30d2);}async[a123_0x5aa90d(0x161)](_0x399cb2,_0x2937ce){const _0xce5974=a123_0x5aa90d;return await this[_0xce5974(0x1cd)][_0xce5974(0x161)](_0x399cb2,_0x2937ce);}async[a123_0x5aa90d(0x1a6)](_0x1247a3){await this['client']['deleteAgent'](_0x1247a3);}async[a123_0x5aa90d(0x192)](_0x29a93e){const _0x2d7f9f=a123_0x5aa90d;return await this[_0x2d7f9f(0x1cd)][_0x2d7f9f(0x192)]({'agentId':_0x29a93e});}async*[a123_0x5aa90d(0x18d)](_0x37e6bc,_0x3c1afe){const _0x2778db=a123_0x5aa90d;let _0x1368d1=_0x3c1afe?.[_0x2778db(0x155)];const _0x919318=_0x3c1afe?.[_0x2778db(0x101)];if(!_0x1368d1){if(!_0x919318)throw new Error(_0x2778db(0x153));const _0x593f43=await this[_0x2778db(0x1cd)][_0x2778db(0x192)]({'agentId':_0x919318});_0x1368d1=_0x593f43['id'],yield{'type':_0x2778db(0x19c),'data':{'chatId':_0x1368d1,'agentId':_0x919318,'projectId':_0x593f43[_0x2778db(0x11f)][_0x2778db(0x122)]}};}for await(const _0x34db9f of this[_0x2778db(0x1cd)]['continueChat'](_0x1368d1,_0x37e6bc,_0x3c1afe?.[_0x2778db(0x15f)])){yield{'type':'event','data':_0x34db9f};}}async[a123_0x5aa90d(0x12a)](_0x47a859=0x32){const _0x4559ad=a123_0x5aa90d;return await this[_0x4559ad(0x1cd)][_0x4559ad(0x167)](_0x47a859);}async[a123_0x5aa90d(0x1a9)](_0x15f0d8){const _0x152486=a123_0x5aa90d;return await this[_0x152486(0x1cd)]['getChatHistory'](_0x15f0d8);}async[a123_0x5aa90d(0x173)](_0x3afb2a){const _0x3fa0b6=a123_0x5aa90d;return await this[_0x3fa0b6(0x1cd)][_0x3fa0b6(0x173)](_0x3afb2a);}async[a123_0x5aa90d(0x182)](_0x4f4089){const _0x169340=a123_0x5aa90d;return await this['client'][_0x169340(0xc9)](_0x4f4089);}async['backupProject'](_0x41ebfe,_0x444fd8,_0x4732c7){const _0x1462ea=a123_0x5aa90d,_0x535e51=_0x4732c7?.['dryRun']??![],{projectId:_0x12baba,project:_0x3842f9}=await this[_0x1462ea(0x144)](_0x41ebfe),_0x32777e=_0x3842f9[_0x1462ea(0x11f)][_0x1462ea(0x1b3)],_0x255dc4=_0x444fd8||_0x32777e+_0x1462ea(0x162);if(a123_0x1fc611[_0x1462ea(0x103)](_0x255dc4)&&!_0x535e51)throw new SDKError(ErrorCode[_0x1462ea(0xf1)],'Output\x20directory\x20already\x20exists:\x20'+_0x255dc4,undefined,{'helpText':'Use\x20a\x20different\x20output\x20path\x20or\x20remove\x20the\x20existing\x20directory.'});const _0x5a4000=await this[_0x1462ea(0x1cd)][_0x1462ea(0x128)](_0x12baba),_0x47e0c3=await this['client'][_0x1462ea(0xb7)](_0x12baba),_0x3198cb=await this[_0x1462ea(0x1cd)][_0x1462ea(0x136)](_0x12baba),_0x5c1ffe=await this[_0x1462ea(0x1cd)][_0x1462ea(0x10f)](_0x12baba);if(!_0x535e51){a123_0x1fc611[_0x1462ea(0x17a)](_0x255dc4,{'recursive':!![]});const _0xcb289f={'version':_0x1462ea(0x184),'exportedAt':new Date()[_0x1462ea(0xe9)](),'exportedFrom':{'site':this[_0x1462ea(0xfb)][_0x1462ea(0x139)],'projectId':_0x12baba,'projectName':_0x32777e},'project':_0x3842f9};a123_0x1fc611[_0x1462ea(0x179)](a123_0x522ebe['join'](_0x255dc4,_0x1462ea(0x1b0)),JSON[_0x1462ea(0x125)](_0xcb289f,null,0x2)),a123_0x1fc611[_0x1462ea(0x179)](a123_0x522ebe[_0x1462ea(0xf7)](_0x255dc4,_0x1462ea(0x107)),JSON[_0x1462ea(0x125)](_0x5a4000,null,0x2)),a123_0x1fc611['writeFileSync'](a123_0x522ebe[_0x1462ea(0xf7)](_0x255dc4,'knowledgebases.json'),JSON[_0x1462ea(0x125)](_0x47e0c3,null,0x2)),a123_0x1fc611[_0x1462ea(0x179)](a123_0x522ebe[_0x1462ea(0xf7)](_0x255dc4,_0x1462ea(0xc5)),JSON[_0x1462ea(0x125)](_0x3198cb,null,0x2)),a123_0x1fc611['writeFileSync'](a123_0x522ebe[_0x1462ea(0xf7)](_0x255dc4,'integrations.json'),JSON[_0x1462ea(0x125)](_0x5c1ffe,null,0x2));}return{'projectName':_0x32777e,'outputDir':_0x255dc4,'counts':{'agents':_0x5a4000[_0x1462ea(0xf2)],'knowledgeBases':_0x47e0c3[_0x1462ea(0xf2)],'prompts':_0x3198cb['length'],'integrations':_0x5c1ffe['length']}};}async[a123_0x5aa90d(0x141)](_0x5e2433,_0x5d4fae){const _0x324aab=a123_0x5aa90d,_0x138506=_0x5d4fae?.[_0x324aab(0x1c8)]??![],_0x413ebf=this['getBackupMetadata'](_0x5e2433),_0xcbc5d5=_0x413ebf[_0x324aab(0x163)][_0x324aab(0x139)],_0x4088e3=this['context'][_0x324aab(0x139)],_0x1c6e8e=_0xcbc5d5!==_0x4088e3?_0xcbc5d5:undefined,_0xa6cb4e=this[_0x324aab(0x1ad)](a123_0x522ebe[_0x324aab(0xf7)](_0x5e2433,_0x324aab(0x107)),[]),_0x541d36=this[_0x324aab(0x1ad)](a123_0x522ebe['join'](_0x5e2433,_0x324aab(0x193)),[]),_0x59129d=this['loadJsonFile'](a123_0x522ebe[_0x324aab(0xf7)](_0x5e2433,'prompts.json'),[]),_0x2662e7=this['loadJsonFile'](a123_0x522ebe[_0x324aab(0xf7)](_0x5e2433,'integrations.json'),[]),_0x372b7c=_0x5d4fae?.[_0x324aab(0x1b3)]||_0x413ebf[_0x324aab(0x163)][_0x324aab(0x175)];if(_0x138506){const _0xd87df6=new Map(),_0x53ecb8=[..._0xa6cb4e],_0x129e0c=_0xa6cb4e[_0x324aab(0xf2)]+0x1;let _0x3b0d39=0x0;while(_0x53ecb8[_0x324aab(0xf2)]>0x0&&_0x3b0d39<_0x129e0c){_0x3b0d39++;const _0x3d18af=[];for(const _0x39cc5d of _0x53ecb8){canCreateAgent(_0x39cc5d,_0xd87df6)?_0xd87df6['set'](_0x39cc5d['id'],_0x324aab(0x1a4)+_0x39cc5d['id']):_0x3d18af[_0x324aab(0x102)](_0x39cc5d);}if(_0x3d18af[_0x324aab(0xf2)]===_0x53ecb8[_0x324aab(0xf2)])throw new SDKError(ErrorCode[_0x324aab(0xd2)],_0x324aab(0xd4),undefined,{'helpText':_0x324aab(0x181)});_0x53ecb8['length']=0x0,_0x53ecb8[_0x324aab(0x102)](..._0x3d18af);}const _0x25d976=_0x59129d[_0x324aab(0x190)](_0x2f9c70=>_0xd87df6['has'](_0x2f9c70[_0x324aab(0x11f)][_0x324aab(0x101)]))['length'];return{'projectName':_0x372b7c,'projectId':_0x324aab(0x10c),'counts':{'agents':_0xa6cb4e['length'],'knowledgeBases':_0x541d36[_0x324aab(0xf2)],'prompts':_0x25d976,'integrations':_0x2662e7['length']},'sourceSite':_0x1c6e8e};}const _0x22b8ec=await this[_0x324aab(0x1cd)][_0x324aab(0x121)]({'name':_0x372b7c,'description':_0x413ebf[_0x324aab(0x16e)]['attributes'][_0x324aab(0x169)]}),_0x3d6c89=_0x22b8ec['id'],_0x68a7e8=new Map(),_0x2442fe=new Map(),_0x599c7a=new Map();for(const _0x2023fc of _0x541d36){const _0x17315d=await this['client'][_0x324aab(0x17c)]({'projectId':_0x3d6c89,'name':_0x2023fc[_0x324aab(0x11f)][_0x324aab(0x1b3)],'tdDatabaseName':_0x2023fc[_0x324aab(0x11f)][_0x324aab(0x191)],'tables':_0x2023fc['attributes'][_0x324aab(0xdc)]});_0x68a7e8[_0x324aab(0x100)](_0x2023fc['id'],_0x17315d['id']);}const _0x105185=[..._0xa6cb4e],_0x35f648=_0xa6cb4e[_0x324aab(0xf2)]+0x1;let _0x52e01a=0x0;while(_0x105185[_0x324aab(0xf2)]>0x0&&_0x52e01a<_0x35f648){_0x52e01a++;const _0x3e4cb0=[];for(const _0x369ead of _0x105185){if(canCreateAgent(_0x369ead,_0x2442fe)){const _0x25ce4a=remapToolIds(_0x369ead[_0x324aab(0x11f)][_0x324aab(0x1a7)],_0x68a7e8,_0x2442fe),_0xa634be=remapVariableIds(_0x369ead[_0x324aab(0x11f)][_0x324aab(0x135)],_0x68a7e8),_0x3f29cf=await this[_0x324aab(0x1cd)][_0x324aab(0xcd)]({'name':_0x369ead[_0x324aab(0x11f)][_0x324aab(0x1b3)],'projectId':_0x3d6c89,'systemPrompt':_0x369ead[_0x324aab(0x11f)][_0x324aab(0xce)],'starterMessage':_0x369ead[_0x324aab(0x11f)][_0x324aab(0x1c1)],'modelType':migrateModelType(_0x369ead[_0x324aab(0x11f)][_0x324aab(0x14a)]),'maxToolIterations':_0x369ead[_0x324aab(0x11f)][_0x324aab(0x178)],'temperature':_0x369ead[_0x324aab(0x11f)][_0x324aab(0x1bd)],'reasoningEffort':_0x369ead[_0x324aab(0x11f)][_0x324aab(0x140)],'outputs':_0x369ead['attributes'][_0x324aab(0xc4)],'tools':_0x25ce4a,'variables':_0xa634be});_0x2442fe[_0x324aab(0x100)](_0x369ead['id'],_0x3f29cf['id']);}else _0x3e4cb0['push'](_0x369ead);}if(_0x3e4cb0[_0x324aab(0xf2)]===_0x105185['length'])throw new SDKError(ErrorCode[_0x324aab(0xd2)],_0x324aab(0xd4),undefined,{'helpText':_0x324aab(0x181)});_0x105185[_0x324aab(0xf2)]=0x0,_0x105185['push'](..._0x3e4cb0);}for(const _0x532510 of _0x59129d){const _0x36bbb2=_0x2442fe[_0x324aab(0xf5)](_0x532510['attributes']['agentId']);if(!_0x36bbb2)continue;const _0x46b079=await this[_0x324aab(0x1cd)][_0x324aab(0xd0)]({'projectId':_0x3d6c89,'agentId':_0x36bbb2,'name':_0x532510['attributes']['name'],'systemPrompt':_0x532510[_0x324aab(0x11f)][_0x324aab(0xce)],'template':_0x532510['attributes'][_0x324aab(0xdf)],'jsonSchemaHint':_0x532510['attributes'][_0x324aab(0xe5)]});_0x599c7a[_0x324aab(0x100)](_0x532510['id'],_0x46b079['id']);}for(const _0x4bbe1b of _0x2662e7){const _0x2dd4be=_0x4bbe1b[_0x324aab(0x11f)][_0x324aab(0xf4)][_0x324aab(0x12f)](_0x45279b=>({..._0x45279b,'promptId':_0x599c7a[_0x324aab(0xf5)](_0x45279b[_0x324aab(0x177)])||_0x45279b['promptId']}));await this[_0x324aab(0x1cd)][_0x324aab(0x17e)]({'projectId':_0x3d6c89,'serviceType':_0x4bbe1b[_0x324aab(0x11f)][_0x324aab(0x11e)],'actions':_0x2dd4be,'slackMessageMode':_0x4bbe1b[_0x324aab(0x11f)][_0x324aab(0x124)],'chatIgnoreManagedActions':_0x4bbe1b[_0x324aab(0x11f)][_0x324aab(0xe1)],'chatWelcomeMessage':_0x4bbe1b[_0x324aab(0x11f)][_0x324aab(0xe3)],'webhookCorsOrigins':_0x4bbe1b[_0x324aab(0x11f)][_0x324aab(0x106)]});}return{'projectName':_0x372b7c,'projectId':_0x3d6c89,'counts':{'agents':_0x2442fe[_0x324aab(0x148)],'knowledgeBases':_0x68a7e8[_0x324aab(0x148)],'prompts':_0x599c7a[_0x324aab(0x148)],'integrations':_0x2662e7[_0x324aab(0xf2)]},'sourceSite':_0x1c6e8e};}[a123_0x5aa90d(0x1ad)](_0x2c83db,_0x3b470f){const _0x34ee0b=a123_0x5aa90d;if(!a123_0x1fc611['existsSync'](_0x2c83db))return _0x3b470f;return JSON[_0x34ee0b(0x1ac)](a123_0x1fc611[_0x34ee0b(0xc0)](_0x2c83db,_0x34ee0b(0xb8)));}['getBackupMetadata'](_0x21f942){const _0x42ccd9=a123_0x5aa90d;if(!a123_0x1fc611[_0x42ccd9(0x103)](_0x21f942))throw new SDKError(ErrorCode[_0x42ccd9(0x133)],'Backup\x20folder\x20not\x20found:\x20'+_0x21f942,undefined,{'helpText':_0x42ccd9(0x1aa)});const _0x669ec2=a123_0x522ebe[_0x42ccd9(0xf7)](_0x21f942,_0x42ccd9(0x1b0));if(!a123_0x1fc611[_0x42ccd9(0x103)](_0x669ec2))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x42ccd9(0x18f)+_0x21f942,undefined,{'helpText':'Ensure\x20this\x20is\x20a\x20valid\x20LLM\x20project\x20backup\x20folder.'});const _0x3abfec=JSON[_0x42ccd9(0x1ac)](a123_0x1fc611['readFileSync'](_0x669ec2,'utf-8'));if(!isSupportedBackupVersion(_0x3abfec[_0x42ccd9(0xfd)]))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x42ccd9(0x19b)+_0x3abfec[_0x42ccd9(0xfd)],undefined,{'helpText':_0x42ccd9(0x18c)});return _0x3abfec;}async[a123_0x5aa90d(0x10e)](_0x1c47e4,_0x141009,_0x4b5ba9){const _0x30eb1a=a123_0x5aa90d,{projectId:_0x27fda0,project:_0xa99427}=await this['resolveProjectName'](_0x1c47e4),_0x2359a7=_0xa99427[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)];let _0x5cb9a2;if(_0x141009)_0x5cb9a2=_0x141009;else{const _0x3ef0cf=a123_0x522ebe[_0x30eb1a(0xf7)](process['cwd'](),_0x30eb1a(0xd6)),_0x20d0a2=getSanitizedPathWithMigration(_0x3ef0cf,_0x2359a7);_0x20d0a2[_0x30eb1a(0x1a8)]&&this[_0x30eb1a(0x187)][_0x30eb1a(0xec)](_0x30eb1a(0x1cb)+a123_0x522ebe['basename'](_0x20d0a2['oldPath'])+_0x30eb1a(0xcf)+a123_0x522ebe['basename'](_0x20d0a2[_0x30eb1a(0x1c6)])),_0x5cb9a2=_0x20d0a2['path'];}const _0x141a58=await this[_0x30eb1a(0x1cd)]['listAgentsFull'](_0x27fda0),_0x349d98=await this[_0x30eb1a(0x1cd)][_0x30eb1a(0xb7)](_0x27fda0),_0x35c668=await this[_0x30eb1a(0x1cd)]['listTextKnowledgeBases'](_0x27fda0),_0xd5e18c=await safeListOrEmpty(()=>this['client'][_0x30eb1a(0x123)](_0x27fda0)),_0x3f9722=await safeListOrEmpty(()=>this['client'][_0x30eb1a(0x150)](_0x27fda0)),_0x3fce6e=await this[_0x30eb1a(0x1cd)][_0x30eb1a(0x136)](_0x27fda0),_0x190d25=await this['client'][_0x30eb1a(0x10f)](_0x27fda0),_0x5b1f69=await safeListOrEmpty(()=>this['client'][_0x30eb1a(0x19d)](_0x27fda0)),_0x5666bc=await safeListOrEmpty(()=>this['client']['listExperimentalArtifacts'](_0x27fda0)),_0x4c9f8a=_0x190d25[_0x30eb1a(0x190)](_0x859926=>!_0x859926['attributes'][_0x30eb1a(0x1ab)]&&SAFE_INTEGRATION_TYPES[_0x30eb1a(0xcb)](_0x859926[_0x30eb1a(0x11f)]['serviceType'][_0x30eb1a(0x156)]())),_0x478691=new Map(),_0x3d736d=new Map(),_0xfe6c9d=new Map(),_0x36229f=new Map(),_0x2e4011=new Map(),_0x518276=new Map(),_0x4d8cf5=new Map();for(const _0x5e99e8 of _0x141a58){_0x478691[_0x30eb1a(0x100)](_0x5e99e8['id'],_0x5e99e8[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)]);}for(const _0x4bde79 of _0x349d98){_0x3d736d[_0x30eb1a(0x100)](_0x4bde79['id'],_0x4bde79[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)]);}for(const _0x2191e1 of _0x35c668){_0xfe6c9d[_0x30eb1a(0x100)](_0x2191e1['id'],_0x2191e1[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)]);}for(const _0xf7e21a of _0xd5e18c){_0x36229f['set'](_0xf7e21a['id'],_0xf7e21a[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)]);}for(const _0x55b078 of _0x3f9722){_0x2e4011[_0x30eb1a(0x100)](_0x55b078['id'],_0x55b078[_0x30eb1a(0x11f)]['name']);}for(const _0x3409fa of _0x3fce6e){_0x518276['set'](_0x3409fa['id'],_0x3409fa[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)]);}for(const _0x458f2a of _0x5b1f69){_0x4d8cf5[_0x30eb1a(0x100)](_0x458f2a['id'],_0x458f2a['attributes'][_0x30eb1a(0x1b3)]);}const _0x1f62dd={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x3d736d,'TextKnowledgeBase':_0xfe6c9d,'Agent':_0x478691,'WebSearchTool':_0x2e4011,'ImageGenerator':_0x36229f,'ExperimentalKnowledgeBase':_0x4d8cf5}),'resolvePromptName':async _0x10bfd2=>_0x518276[_0x30eb1a(0xf5)](_0x10bfd2),'onWarning':_0x32eed2=>this[_0x30eb1a(0x187)]['warn'](_0x32eed2)},_0x587a71={'projectName':_0x2359a7,'outputDir':_0x5cb9a2,'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}}},_0xecbb24=[],_0x235b26=[];for(const _0x41969c of _0x141a58){const _0x100973=getSanitizedPathWithMigration(_0x5cb9a2,_0x41969c['attributes']['name']);_0x100973[_0x30eb1a(0x1a8)]&&this[_0x30eb1a(0x187)][_0x30eb1a(0xec)](_0x30eb1a(0x186)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x100973['oldPath'])+_0x30eb1a(0xcf)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x100973[_0x30eb1a(0x1c6)]));const _0x559d7f=_0x100973[_0x30eb1a(0x1c6)],_0x2ca949=a123_0x522ebe[_0x30eb1a(0xf7)](_0x559d7f,'prompt.md'),_0x45b75=a123_0x522ebe[_0x30eb1a(0xf7)](_0x559d7f,_0x30eb1a(0x1b2)),_0x40fa79=a123_0x522ebe['join'](_0x559d7f,'starter_message.md'),{yaml:_0x47fd4e,systemPrompt:_0x10dc25,starterMessage:_0x334539}=await agentResponseToDef(_0x41969c,_0x1f62dd),_0xd2b798=toAgentYamlString(_0x47fd4e),_0x46cc59=!a123_0x1fc611[_0x30eb1a(0x103)](_0x45b75);let _0x44da19=_0x46cc59,_0xaff283;if(!_0x46cc59){const _0x37fef9=a123_0x1fc611[_0x30eb1a(0x103)](_0x2ca949)?a123_0x1fc611[_0x30eb1a(0xc0)](_0x2ca949,_0x30eb1a(0xb8)):'',_0x1eec2d=a123_0x1fc611[_0x30eb1a(0xc0)](_0x45b75,'utf-8'),_0x2f37f7=_0x30eb1a(0x132)+_0x37fef9+_0x30eb1a(0x1cc)+_0x1eec2d,_0x178bda='#\x20prompt.md\x0a'+_0x10dc25+_0x30eb1a(0x1cc)+_0xd2b798,_0x362ced=generateDiff(_0x2f37f7,_0x178bda);_0x44da19=hasChanges(_0x362ced),_0x44da19&&(_0xaff283=formatDiffWithColors(_0x362ced));}_0xecbb24[_0x30eb1a(0x102)]({'path':_0x559d7f,'content':'','isDir':!![]}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x2ca949,'content':_0x10dc25}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x45b75,'content':_0xd2b798});_0x334539&&_0x334539['includes']('\x0a')&&_0xecbb24['push']({'path':_0x40fa79,'content':_0x334539});_0x587a71['agents']['push']({'agentName':_0x41969c[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)],'outputPath':_0x559d7f,'isNew':_0x46cc59,'hasChanges':_0x44da19,'diff':_0xaff283}),_0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0xd6)][_0x30eb1a(0x157)]++;if(_0x46cc59)_0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0xd6)][_0x30eb1a(0xb3)]++;else{if(_0x44da19)_0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0xd6)][_0x30eb1a(0x11d)]++;else _0x587a71[_0x30eb1a(0x1b5)]['agents'][_0x30eb1a(0x104)]++;}}for(const _0x1a7ccf of _0x349d98){if(_0x1a7ccf['attributes'][_0x30eb1a(0x1ab)])continue;const _0x3932e9=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x5cb9a2),_0x1a7ccf['attributes'][_0x30eb1a(0x1b3)],'.yml');_0x3932e9[_0x30eb1a(0x1a8)]&&this[_0x30eb1a(0x187)]['info'](_0x30eb1a(0x1be)+a123_0x522ebe['basename'](_0x3932e9[_0x30eb1a(0x15c)])+'\x20→\x20'+a123_0x522ebe[_0x30eb1a(0x10a)](_0x3932e9[_0x30eb1a(0x1c6)]));const _0x50e19e=_0x3932e9[_0x30eb1a(0x1c6)],_0x15e3bb=apiKnowledgeBaseToYaml(_0x1a7ccf),_0x511209=toKnowledgeBaseYamlString(_0x15e3bb),_0x1981d0=!a123_0x1fc611[_0x30eb1a(0x103)](_0x50e19e);let _0x423af3=_0x1981d0,_0x4f5dc2;if(!_0x1981d0){const _0x284dab=a123_0x1fc611['readFileSync'](_0x50e19e,_0x30eb1a(0xb8)),_0x20a282=generateDiff(_0x284dab,_0x511209);_0x423af3=hasChanges(_0x20a282),_0x423af3&&(_0x4f5dc2=formatDiffWithColors(_0x20a282));}_0xecbb24[_0x30eb1a(0x102)]({'path':_0x50e19e,'content':_0x511209}),_0x587a71[_0x30eb1a(0x185)][_0x30eb1a(0x102)]({'name':_0x1a7ccf[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)],'outputPath':_0x50e19e,'isNew':_0x1981d0,'hasChanges':_0x423af3,'diff':_0x4f5dc2}),_0x587a71[_0x30eb1a(0x1b5)]['knowledgeBases'][_0x30eb1a(0x157)]++;if(_0x1981d0)_0x587a71['counts'][_0x30eb1a(0x185)]['new']++;else{if(_0x423af3)_0x587a71['counts'][_0x30eb1a(0x185)][_0x30eb1a(0x11d)]++;else _0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0x185)][_0x30eb1a(0x104)]++;}}for(const _0x1a25cd of _0x35c668){if(_0x1a25cd['attributes'][_0x30eb1a(0x1ab)])continue;const _0x58b144=getSanitizedPathWithMigration(getKnowledgeBasesDir(_0x5cb9a2),_0x1a25cd['attributes']['name'],_0x30eb1a(0x152));_0x58b144[_0x30eb1a(0x1a8)]&&this[_0x30eb1a(0x187)][_0x30eb1a(0xec)](_0x30eb1a(0x1bf)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x58b144[_0x30eb1a(0x15c)])+'\x20→\x20'+a123_0x522ebe[_0x30eb1a(0x10a)](_0x58b144[_0x30eb1a(0x1c6)]));const _0x22bea0=_0x58b144['path'],_0x4c3771=toTextKnowledgeBaseMd(_0x1a25cd['attributes'][_0x30eb1a(0x1b3)],_0x1a25cd[_0x30eb1a(0x11f)]['text']),_0x87f84a=!a123_0x1fc611[_0x30eb1a(0x103)](_0x22bea0);let _0xbf2d93=_0x87f84a,_0x2dfaff;if(!_0x87f84a){const _0x1b3744=a123_0x1fc611[_0x30eb1a(0xc0)](_0x22bea0,'utf-8'),_0x185ad4=generateDiff(_0x1b3744,_0x4c3771);_0xbf2d93=hasChanges(_0x185ad4),_0xbf2d93&&(_0x2dfaff=formatDiffWithColors(_0x185ad4));}_0xecbb24['push']({'path':_0x22bea0,'content':_0x4c3771}),_0x587a71[_0x30eb1a(0x111)][_0x30eb1a(0x102)]({'name':_0x1a25cd[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)],'outputPath':_0x22bea0,'isNew':_0x87f84a,'hasChanges':_0xbf2d93,'diff':_0x2dfaff}),_0x587a71[_0x30eb1a(0x1b5)]['textKnowledgeBases'][_0x30eb1a(0x157)]++;if(_0x87f84a)_0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0x111)][_0x30eb1a(0xb3)]++;else{if(_0xbf2d93)_0x587a71['counts'][_0x30eb1a(0x111)]['updated']++;else _0x587a71[_0x30eb1a(0x1b5)]['textKnowledgeBases'][_0x30eb1a(0x104)]++;}}for(const _0x2763e7 of _0x3fce6e){if(_0x2763e7[_0x30eb1a(0x11f)][_0x30eb1a(0x1ab)])continue;const _0x53d8a7=getSanitizedPathWithMigration(getPromptsDir(_0x5cb9a2),_0x2763e7[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)],_0x30eb1a(0x14e));_0x53d8a7[_0x30eb1a(0x1a8)]&&this[_0x30eb1a(0x187)][_0x30eb1a(0xec)](_0x30eb1a(0x1b8)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x53d8a7[_0x30eb1a(0x15c)])+_0x30eb1a(0xcf)+a123_0x522ebe['basename'](_0x53d8a7[_0x30eb1a(0x1c6)]));const _0x3fd0ec=_0x53d8a7[_0x30eb1a(0x1c6)],_0x5d8661=await apiPromptToYaml(_0x2763e7,_0x1f62dd);if(!_0x5d8661)continue;const _0x321749=toPromptYamlString(_0x5d8661),_0x2ff998=!a123_0x1fc611['existsSync'](_0x3fd0ec);let _0x1e9707=_0x2ff998,_0x4fefd2;if(!_0x2ff998){const _0x152435=a123_0x1fc611[_0x30eb1a(0xc0)](_0x3fd0ec,_0x30eb1a(0xb8)),_0x32be94=generateDiff(_0x152435,_0x321749);_0x1e9707=hasChanges(_0x32be94),_0x1e9707&&(_0x4fefd2=formatDiffWithColors(_0x32be94));}_0xecbb24[_0x30eb1a(0x102)]({'path':_0x3fd0ec,'content':_0x321749}),_0x587a71[_0x30eb1a(0x16c)][_0x30eb1a(0x102)]({'name':_0x2763e7[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)],'outputPath':_0x3fd0ec,'isNew':_0x2ff998,'hasChanges':_0x1e9707,'diff':_0x4fefd2}),_0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0x16c)]['total']++;if(_0x2ff998)_0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0x16c)][_0x30eb1a(0xb3)]++;else{if(_0x1e9707)_0x587a71['counts'][_0x30eb1a(0x16c)][_0x30eb1a(0x11d)]++;else _0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0x16c)][_0x30eb1a(0x104)]++;}}for(const _0x2d5c2e of _0x4c9f8a){const _0x217bd3=_0x2d5c2e[_0x30eb1a(0x11f)]['serviceType'][_0x30eb1a(0x156)](),_0x4d2d90=getSanitizedPathWithMigration(getIntegrationsDir(_0x5cb9a2),_0x217bd3,_0x30eb1a(0x14e));_0x4d2d90[_0x30eb1a(0x1a8)]&&this[_0x30eb1a(0x187)][_0x30eb1a(0xec)](_0x30eb1a(0x113)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x4d2d90['oldPath'])+'\x20→\x20'+a123_0x522ebe[_0x30eb1a(0x10a)](_0x4d2d90['path']));const _0x19198c=_0x4d2d90[_0x30eb1a(0x1c6)],_0x1600b7=await apiIntegrationToYaml(_0x2d5c2e,_0x1f62dd),_0x3b61b4=toIntegrationYamlString(_0x1600b7),_0x16ccb6=!a123_0x1fc611['existsSync'](_0x19198c);let _0x2e3187=_0x16ccb6,_0x3237fc;if(!_0x16ccb6){const _0x50b66b=a123_0x1fc611[_0x30eb1a(0xc0)](_0x19198c,_0x30eb1a(0xb8)),_0x575f2b=generateDiff(_0x50b66b,_0x3b61b4);_0x2e3187=hasChanges(_0x575f2b),_0x2e3187&&(_0x3237fc=formatDiffWithColors(_0x575f2b));}_0xecbb24['push']({'path':_0x19198c,'content':_0x3b61b4}),_0x587a71[_0x30eb1a(0xc8)]['push']({'name':_0x217bd3,'outputPath':_0x19198c,'isNew':_0x16ccb6,'hasChanges':_0x2e3187,'diff':_0x3237fc}),_0x587a71['counts'][_0x30eb1a(0xc8)]['total']++;if(_0x16ccb6)_0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0xc8)]['new']++;else{if(_0x2e3187)_0x587a71['counts'][_0x30eb1a(0xc8)]['updated']++;else _0x587a71[_0x30eb1a(0x1b5)][_0x30eb1a(0xc8)]['unchanged']++;}}for(const _0x506a8a of _0x5b1f69){if(_0x506a8a[_0x30eb1a(0x11f)][_0x30eb1a(0x1ab)])continue;const _0x1cdbd5=getSanitizedPathWithMigration(getExperimentalKnowledgeBasesDir(_0x5cb9a2),_0x506a8a['attributes'][_0x30eb1a(0x1b3)]);_0x1cdbd5[_0x30eb1a(0x1a8)]&&this[_0x30eb1a(0x187)][_0x30eb1a(0xec)](_0x30eb1a(0xfe)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x1cdbd5[_0x30eb1a(0x15c)])+_0x30eb1a(0xcf)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x1cdbd5['path']));const _0x10e72c=_0x1cdbd5[_0x30eb1a(0x1c6)],_0x4ab297=a123_0x522ebe[_0x30eb1a(0xf7)](_0x10e72c,sanitizeForFilesystem(_0x506a8a[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)])+'.yml'),_0x3c2a0e=a123_0x522ebe['join'](_0x10e72c,'functions'),_0x4aa719=apiExperimentalKnowledgeBaseToYaml(_0x506a8a),_0x17d8a1=toExperimentalKnowledgeBaseYamlString(_0x4aa719),_0xef200b=!a123_0x1fc611[_0x30eb1a(0x103)](_0x10e72c);let _0x29a81e=_0xef200b,_0x3fb0de,_0x4e6879=_0x17d8a1;const _0x5d524f=[..._0x4aa719['functions']][_0x30eb1a(0x12d)]((_0xa8801c,_0x3909cb)=>_0xa8801c[_0x30eb1a(0x1b3)][_0x30eb1a(0x11c)](_0x3909cb[_0x30eb1a(0x1b3)]));for(const _0x34a7d7 of _0x5d524f){_0x4e6879+=_0x30eb1a(0xe8)+_0x34a7d7[_0x30eb1a(0x1b3)]+'\x20---\x0a'+_0x34a7d7[_0x30eb1a(0x13a)]+_0x30eb1a(0x118)+_0x34a7d7[_0x30eb1a(0x1b3)]+_0x30eb1a(0x17d)+_0x34a7d7[_0x30eb1a(0xba)]+'\x0a';}if(!_0xef200b){let _0x2c224b='';a123_0x1fc611[_0x30eb1a(0x103)](_0x4ab297)&&(_0x2c224b=a123_0x1fc611['readFileSync'](_0x4ab297,_0x30eb1a(0xb8)));if(a123_0x1fc611[_0x30eb1a(0x103)](_0x3c2a0e)){const _0x2a56da=a123_0x1fc611[_0x30eb1a(0xcc)](_0x3c2a0e,{'withFileTypes':!![]}),_0x28ba5b=_0x2a56da[_0x30eb1a(0x190)](_0x1f5c92=>_0x1f5c92[_0x30eb1a(0x127)]())[_0x30eb1a(0x12d)]((_0x2a031f,_0x5e26bc)=>_0x2a031f[_0x30eb1a(0x1b3)][_0x30eb1a(0x11c)](_0x5e26bc['name']));for(const _0x12958c of _0x28ba5b){const _0x116c3f=a123_0x522ebe['join'](_0x3c2a0e,_0x12958c[_0x30eb1a(0x1b3)],_0x30eb1a(0x120)),_0x4b03b5=a123_0x522ebe['join'](_0x3c2a0e,_0x12958c[_0x30eb1a(0x1b3)],'json_schema.json');a123_0x1fc611['existsSync'](_0x116c3f)&&(_0x2c224b+='\x0a---\x20function:\x20'+_0x12958c[_0x30eb1a(0x1b3)]+_0x30eb1a(0x17d)+a123_0x1fc611[_0x30eb1a(0xc0)](_0x116c3f,_0x30eb1a(0xb8))+'\x0a'),a123_0x1fc611[_0x30eb1a(0x103)](_0x4b03b5)&&(_0x2c224b+='---\x20schema:\x20'+_0x12958c[_0x30eb1a(0x1b3)]+_0x30eb1a(0x17d)+a123_0x1fc611[_0x30eb1a(0xc0)](_0x4b03b5,'utf-8')+'\x0a');}}const _0x5745ab=generateDiff(_0x2c224b,_0x4e6879);_0x29a81e=hasChanges(_0x5745ab),_0x29a81e&&(_0x3fb0de=formatDiffWithColors(_0x5745ab));}_0xecbb24['push']({'path':_0x10e72c,'content':'','isDir':!![]}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x4ab297,'content':_0x17d8a1}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x3c2a0e,'content':'','isDir':!![]});for(const _0x4be50d of _0x4aa719['functions']){const _0x45a267=a123_0x522ebe[_0x30eb1a(0xf7)](_0x3c2a0e,sanitizeForFilesystem(_0x4be50d[_0x30eb1a(0x1b3)])),_0x16a902=a123_0x522ebe['join'](_0x45a267,_0x30eb1a(0x120)),_0x4798ae=a123_0x522ebe['join'](_0x45a267,_0x30eb1a(0xd1));_0xecbb24[_0x30eb1a(0x102)]({'path':_0x45a267,'content':'','isDir':!![]}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x16a902,'content':_0x4be50d['code']}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x4798ae,'content':_0x4be50d[_0x30eb1a(0xba)]});}if(a123_0x1fc611[_0x30eb1a(0x103)](_0x3c2a0e)){const _0x5f1db4=a123_0x1fc611['readdirSync'](_0x3c2a0e,{'withFileTypes':!![]}),_0x355316=new Set(_0x4aa719[_0x30eb1a(0x13b)]['map'](_0x428e6a=>sanitizeForFilesystem(_0x428e6a[_0x30eb1a(0x1b3)])));for(const _0x4fb249 of _0x5f1db4){if(_0x4fb249[_0x30eb1a(0x127)]()&&!_0x355316['has'](_0x4fb249[_0x30eb1a(0x1b3)])){const _0x3b154f=a123_0x522ebe[_0x30eb1a(0xf7)](_0x3c2a0e,_0x4fb249[_0x30eb1a(0x1b3)]);_0x235b26[_0x30eb1a(0x102)]({'path':_0x3b154f,'isDir':!![]});}}}_0x587a71['experimentalKnowledgeBases']['push']({'name':_0x506a8a[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)],'outputPath':_0x10e72c,'isNew':_0xef200b,'hasChanges':_0x29a81e,'diff':_0x3fb0de}),_0x587a71['counts'][_0x30eb1a(0x183)][_0x30eb1a(0x157)]++;if(_0xef200b)_0x587a71['counts'][_0x30eb1a(0x183)]['new']++;else{if(_0x29a81e)_0x587a71['counts'][_0x30eb1a(0x183)][_0x30eb1a(0x11d)]++;else _0x587a71['counts'][_0x30eb1a(0x183)][_0x30eb1a(0x104)]++;}}for(const _0x3e3bc2 of _0x5666bc){if(_0x3e3bc2['attributes'][_0x30eb1a(0x1ab)])continue;const _0x3cddc2=getSanitizedPathWithMigration(getExperimentalArtifactsDir(_0x5cb9a2),_0x3e3bc2[_0x30eb1a(0x11f)]['name']);_0x3cddc2['renamed']&&this[_0x30eb1a(0x187)][_0x30eb1a(0xec)](_0x30eb1a(0xc1)+a123_0x522ebe[_0x30eb1a(0x10a)](_0x3cddc2[_0x30eb1a(0x15c)])+_0x30eb1a(0xcf)+a123_0x522ebe['basename'](_0x3cddc2[_0x30eb1a(0x1c6)]));const _0x3b3724=_0x3cddc2['path'],_0x1a5e05=a123_0x522ebe[_0x30eb1a(0xf7)](_0x3b3724,sanitizeForFilesystem(_0x3e3bc2[_0x30eb1a(0x11f)]['name'])+_0x30eb1a(0x14e)),_0x191223=a123_0x522ebe[_0x30eb1a(0xf7)](_0x3b3724,_0x30eb1a(0x120)),_0x8c15fb=a123_0x522ebe[_0x30eb1a(0xf7)](_0x3b3724,_0x30eb1a(0xea)),_0x4450a7=apiExperimentalArtifactToYaml(_0x3e3bc2),_0x1ce767=toExperimentalArtifactYamlString(_0x4450a7),_0x1245f2=!a123_0x1fc611[_0x30eb1a(0x103)](_0x3b3724);let _0x118589=_0x1245f2,_0x305590,_0x2bccfe=_0x1ce767+('\x0a---\x20code\x20---\x0a'+_0x4450a7['code']+'\x0a');const _0x21490c=[..._0x4450a7[_0x30eb1a(0xea)]][_0x30eb1a(0x12d)]((_0x21342f,_0x107c74)=>_0x21342f[_0x30eb1a(0x13d)][_0x30eb1a(0x11c)](_0x107c74[_0x30eb1a(0x13d)]));for(const _0x23b110 of _0x21490c){_0x2bccfe+=_0x30eb1a(0x14b)+_0x23b110[_0x30eb1a(0x13d)]+_0x30eb1a(0x17d)+_0x23b110[_0x30eb1a(0x19f)]+'\x0a';}if(!_0x1245f2){let _0x1dce3e='';a123_0x1fc611[_0x30eb1a(0x103)](_0x1a5e05)&&(_0x1dce3e=a123_0x1fc611[_0x30eb1a(0xc0)](_0x1a5e05,_0x30eb1a(0xb8)));a123_0x1fc611[_0x30eb1a(0x103)](_0x191223)&&(_0x1dce3e+=_0x30eb1a(0x130)+a123_0x1fc611[_0x30eb1a(0xc0)](_0x191223,'utf-8')+'\x0a');if(a123_0x1fc611[_0x30eb1a(0x103)](_0x8c15fb)){const _0x49e172=a123_0x1fc611[_0x30eb1a(0xcc)](_0x8c15fb),_0x24b12a=_0x49e172['filter'](_0x33dbc2=>{const _0x1d13a6=_0x30eb1a,_0x549fe5=a123_0x522ebe[_0x1d13a6(0xf7)](_0x8c15fb,_0x33dbc2);return a123_0x1fc611[_0x1d13a6(0x197)](_0x549fe5)[_0x1d13a6(0x196)]();})[_0x30eb1a(0x12d)]((_0x49a6ac,_0x3998dc)=>_0x49a6ac[_0x30eb1a(0x11c)](_0x3998dc));for(const _0x37d6ef of _0x24b12a){const _0x120d62=a123_0x522ebe[_0x30eb1a(0xf7)](_0x8c15fb,_0x37d6ef);_0x1dce3e+=_0x30eb1a(0x14b)+_0x37d6ef+_0x30eb1a(0x17d)+a123_0x1fc611[_0x30eb1a(0xc0)](_0x120d62,_0x30eb1a(0xb8))+'\x0a';}}const _0x8f46ad=generateDiff(_0x1dce3e,_0x2bccfe);_0x118589=hasChanges(_0x8f46ad),_0x118589&&(_0x305590=formatDiffWithColors(_0x8f46ad));}_0xecbb24[_0x30eb1a(0x102)]({'path':_0x3b3724,'content':'','isDir':!![]}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x1a5e05,'content':_0x1ce767}),_0xecbb24[_0x30eb1a(0x102)]({'path':_0x191223,'content':_0x4450a7[_0x30eb1a(0x13a)]});if(_0x4450a7[_0x30eb1a(0xea)][_0x30eb1a(0xf2)]>0x0){_0xecbb24[_0x30eb1a(0x102)]({'path':_0x8c15fb,'content':'','isDir':!![]});for(const _0x54b7d9 of _0x4450a7['files']){const _0x3701a5=a123_0x522ebe['join'](_0x8c15fb,_0x54b7d9['file_name']);_0xecbb24[_0x30eb1a(0x102)]({'path':_0x3701a5,'content':_0x54b7d9[_0x30eb1a(0x19f)]});}}if(a123_0x1fc611[_0x30eb1a(0x103)](_0x8c15fb)){const _0x540ef2=a123_0x1fc611['readdirSync'](_0x8c15fb),_0x384ecb=new Set(_0x4450a7[_0x30eb1a(0xea)]['map'](_0x185324=>_0x185324[_0x30eb1a(0x13d)]));for(const _0x3f2d29 of _0x540ef2){const _0x1404e8=a123_0x522ebe['join'](_0x8c15fb,_0x3f2d29);a123_0x1fc611[_0x30eb1a(0x197)](_0x1404e8)[_0x30eb1a(0x196)]()&&!_0x384ecb[_0x30eb1a(0xee)](_0x3f2d29)&&_0x235b26[_0x30eb1a(0x102)]({'path':_0x1404e8});}}_0x587a71[_0x30eb1a(0x1a3)][_0x30eb1a(0x102)]({'name':_0x3e3bc2[_0x30eb1a(0x11f)][_0x30eb1a(0x1b3)],'outputPath':_0x3b3724,'isNew':_0x1245f2,'hasChanges':_0x118589,'diff':_0x305590}),_0x587a71['counts'][_0x30eb1a(0x1a3)][_0x30eb1a(0x157)]++;if(_0x1245f2)_0x587a71[_0x30eb1a(0x1b5)]['experimentalArtifacts']['new']++;else{if(_0x118589)_0x587a71['counts']['experimentalArtifacts'][_0x30eb1a(0x11d)]++;else _0x587a71[_0x30eb1a(0x1b5)]['experimentalArtifacts'][_0x30eb1a(0x104)]++;}}if(_0x4b5ba9?.['dryRun'])return _0x587a71;a123_0x1fc611[_0x30eb1a(0x17a)](_0x5cb9a2,{'recursive':!![]}),a123_0x1fc611[_0x30eb1a(0x17a)](getKnowledgeBasesDir(_0x5cb9a2),{'recursive':!![]}),a123_0x1fc611[_0x30eb1a(0x17a)](getPromptsDir(_0x5cb9a2),{'recursive':!![]}),a123_0x1fc611[_0x30eb1a(0x17a)](getIntegrationsDir(_0x5cb9a2),{'recursive':!![]}),a123_0x1fc611[_0x30eb1a(0x17a)](getExperimentalKnowledgeBasesDir(_0x5cb9a2),{'recursive':!![]}),a123_0x1fc611[_0x30eb1a(0x17a)](getExperimentalArtifactsDir(_0x5cb9a2),{'recursive':!![]});const _0x4db2a9=a123_0x522ebe['join'](_0x5cb9a2,_0x30eb1a(0x172));a123_0x1fc611[_0x30eb1a(0x179)](_0x4db2a9,createAgentConfigContent(_0x2359a7));for(const _0x451560 of _0xecbb24){if(_0x451560[_0x30eb1a(0x109)])a123_0x1fc611[_0x30eb1a(0x17a)](_0x451560[_0x30eb1a(0x1c6)],{'recursive':!![]});else{const _0x1d357a=a123_0x522ebe['dirname'](_0x451560[_0x30eb1a(0x1c6)]);!a123_0x1fc611[_0x30eb1a(0x103)](_0x1d357a)&&a123_0x1fc611[_0x30eb1a(0x17a)](_0x1d357a,{'recursive':!![]}),a123_0x1fc611[_0x30eb1a(0x179)](_0x451560[_0x30eb1a(0x1c6)],_0x451560[_0x30eb1a(0x1bc)]);}}for(const _0x22da74 of _0x235b26){_0x22da74['isDir']?(a123_0x1fc611[_0x30eb1a(0x180)](_0x22da74[_0x30eb1a(0x1c6)],{'recursive':!![],'force':!![]}),this[_0x30eb1a(0x187)][_0x30eb1a(0xec)]('Removed\x20deleted\x20directory:\x20'+a123_0x522ebe['basename'](a123_0x522ebe[_0x30eb1a(0x1ba)](_0x22da74['path']))+'/'+a123_0x522ebe[_0x30eb1a(0x10a)](_0x22da74[_0x30eb1a(0x1c6)]))):(a123_0x1fc611[_0x30eb1a(0x180)](_0x22da74[_0x30eb1a(0x1c6)],{'force':!![]}),this[_0x30eb1a(0x187)]['info'](_0x30eb1a(0x199)+a123_0x522ebe[_0x30eb1a(0x10a)](a123_0x522ebe[_0x30eb1a(0x1ba)](_0x22da74[_0x30eb1a(0x1c6)]))+'/'+a123_0x522ebe[_0x30eb1a(0x10a)](_0x22da74[_0x30eb1a(0x1c6)])));}return _0x587a71;}async[a123_0x5aa90d(0xf9)](_0x54d8a8,_0x56d015){const _0x1a9c41=a123_0x5aa90d,_0x3b1700=a123_0x522ebe[_0x1a9c41(0xf7)](_0x54d8a8,_0x1a9c41(0x172));if(!a123_0x1fc611[_0x1a9c41(0x103)](_0x3b1700))throw new SDKError(ErrorCode[_0x1a9c41(0x14c)],_0x1a9c41(0x114)+_0x54d8a8,undefined,{'helpText':_0x1a9c41(0x129)});const _0xf7127d=loadAgentConfig(_0x3b1700),_0x417521=await this[_0x1a9c41(0x1c0)](_0xf7127d[_0x1a9c41(0xbd)]),_0x1350d9=await this[_0x1a9c41(0x1cd)]['getProject'](_0x417521),_0x5e7ef0=_0x1350d9[_0x1a9c41(0x11f)][_0x1a9c41(0x1b3)],_0x2bc488={'projectName':_0x5e7ef0,'projectId':_0x417521,'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}}},_0x1e312d=[],_0x49121f=[],_0x1e85c1=[],_0x5b583b=[],_0x2dbf10=[],_0x585420=[],_0x248c0e=a123_0x1fc611[_0x1a9c41(0xcc)](_0x54d8a8,{'withFileTypes':!![]});for(const _0x30bed8 of _0x248c0e){if(!_0x30bed8[_0x1a9c41(0x127)]())continue;if([_0x1a9c41(0x16a),_0x1a9c41(0x16c),_0x1a9c41(0xc8),_0x1a9c41(0x1ae),'experimental_artifacts']['includes'](_0x30bed8[_0x1a9c41(0x1b3)]))continue;const _0x52428d=a123_0x522ebe[_0x1a9c41(0xf7)](_0x54d8a8,_0x30bed8[_0x1a9c41(0x1b3)]);if(isAgentDir(_0x52428d)){const _0x11205c=a123_0x522ebe[_0x1a9c41(0xf7)](_0x52428d,_0x1a9c41(0x1b2)),_0x14e66f=a123_0x522ebe[_0x1a9c41(0xf7)](_0x52428d,_0x1a9c41(0xfc)),_0x55ef2a=a123_0x522ebe[_0x1a9c41(0xf7)](_0x52428d,_0x1a9c41(0x146)),_0x4ee686=parseAgentYaml(a123_0x1fc611[_0x1a9c41(0xc0)](_0x11205c,'utf-8'),_0x11205c),_0x1830ad=a123_0x1fc611[_0x1a9c41(0x103)](_0x14e66f)?a123_0x1fc611[_0x1a9c41(0xc0)](_0x14e66f,_0x1a9c41(0xb8)):'',_0x2f6660=a123_0x1fc611[_0x1a9c41(0x103)](_0x55ef2a)?a123_0x1fc611[_0x1a9c41(0xc0)](_0x55ef2a,_0x1a9c41(0xb8)):_0x4ee686['starter_message'];_0x1e312d[_0x1a9c41(0x102)]({'name':_0x4ee686[_0x1a9c41(0x1b3)],'dir':_0x52428d,'yaml':_0x4ee686,'systemPrompt':_0x1830ad,'starterMessage':_0x2f6660});}}const _0x14dce2=getKnowledgeBasesDir(_0x54d8a8);if(a123_0x1fc611['existsSync'](_0x14dce2)){const _0x407834=a123_0x1fc611[_0x1a9c41(0xcc)](_0x14dce2);for(const _0x2d9d42 of _0x407834){const _0x30e6fe=a123_0x522ebe['join'](_0x14dce2,_0x2d9d42);if(_0x2d9d42['endsWith'](_0x1a9c41(0x14e))){const _0x3dc88c=parseKnowledgeBaseYaml(a123_0x1fc611[_0x1a9c41(0xc0)](_0x30e6fe,_0x1a9c41(0xb8)),_0x30e6fe);_0x49121f['push']({'name':_0x3dc88c[_0x1a9c41(0x1b3)],'path':_0x30e6fe,'yaml':_0x3dc88c});}else{if(_0x2d9d42['endsWith'](_0x1a9c41(0x152))){const _0x25a3e5=a123_0x1fc611['readFileSync'](_0x30e6fe,'utf-8'),{name:_0x265a83,text:_0x66c45}=parseTextKnowledgeBaseMd(_0x25a3e5,_0x2d9d42);_0x1e85c1['push']({'name':_0x265a83,'path':_0x30e6fe,'text':_0x66c45});}}}}const _0x42de76=getPromptsDir(_0x54d8a8);if(a123_0x1fc611[_0x1a9c41(0x103)](_0x42de76)){const _0xab710c=a123_0x1fc611[_0x1a9c41(0xcc)](_0x42de76)['filter'](_0x1bee5d=>_0x1bee5d[_0x1a9c41(0xed)](_0x1a9c41(0x14e)));for(const _0x1e89f6 of _0xab710c){const _0x494473=a123_0x522ebe[_0x1a9c41(0xf7)](_0x42de76,_0x1e89f6),_0x22c1ba=parsePromptYaml(a123_0x1fc611['readFileSync'](_0x494473,'utf-8'),_0x494473);_0x5b583b[_0x1a9c41(0x102)]({'name':_0x22c1ba[_0x1a9c41(0x1b3)],'path':_0x494473,'yaml':_0x22c1ba});}}const _0x3c5cf6=[],_0x2bfde9=getIntegrationsDir(_0x54d8a8);if(a123_0x1fc611[_0x1a9c41(0x103)](_0x2bfde9)){const _0x4270d6=a123_0x1fc611['readdirSync'](_0x2bfde9)[_0x1a9c41(0x190)](_0x20df72=>_0x20df72[_0x1a9c41(0xed)](_0x1a9c41(0x14e)));for(const _0x34aebb of _0x4270d6){const _0xf952b2=a123_0x522ebe[_0x1a9c41(0xf7)](_0x2bfde9,_0x34aebb),_0x21e1a0=parseIntegrationYaml(a123_0x1fc611[_0x1a9c41(0xc0)](_0xf952b2,_0x1a9c41(0xb8)),_0xf952b2);if(!SAFE_INTEGRATION_TYPES[_0x1a9c41(0xcb)](_0x21e1a0['service_type'][_0x1a9c41(0x156)]())){this[_0x1a9c41(0x187)]['warn'](_0x1a9c41(0xd9)+_0x21e1a0[_0x1a9c41(0x1b3)]+'\x27\x20('+_0x21e1a0[_0x1a9c41(0x14d)]+_0x1a9c41(0x1a0)+('Only\x20safe\x20types\x20('+SAFE_INTEGRATION_TYPES[_0x1a9c41(0xf7)](',\x20')+')\x20can\x20be\x20pushed.\x20')+_0x1a9c41(0x164));continue;}_0x3c5cf6[_0x1a9c41(0x102)]({'name':_0x21e1a0[_0x1a9c41(0x1b3)],'path':_0xf952b2,'yaml':_0x21e1a0});}}const _0xa1c96f=getExperimentalKnowledgeBasesDir(_0x54d8a8);if(a123_0x1fc611[_0x1a9c41(0x103)](_0xa1c96f)){const _0x461540=a123_0x1fc611[_0x1a9c41(0xcc)](_0xa1c96f,{'withFileTypes':!![]});for(const _0x2a8e2b of _0x461540){if(!_0x2a8e2b[_0x1a9c41(0x127)]())continue;const _0x19e756=a123_0x522ebe[_0x1a9c41(0xf7)](_0xa1c96f,_0x2a8e2b['name']),_0x52a8da=a123_0x522ebe['join'](_0x19e756,_0x2a8e2b[_0x1a9c41(0x1b3)]+_0x1a9c41(0x14e)),_0x138e74=a123_0x522ebe['join'](_0x19e756,_0x1a9c41(0x13b));if(!a123_0x1fc611[_0x1a9c41(0x103)](_0x52a8da))continue;const _0x22cfa8=parseExperimentalKnowledgeBaseYaml(a123_0x1fc611['readFileSync'](_0x52a8da,_0x1a9c41(0xb8)),_0x52a8da),_0x13ae2f=[];if(a123_0x1fc611['existsSync'](_0x138e74)){const _0x2c0e77=a123_0x1fc611['readdirSync'](_0x138e74,{'withFileTypes':!![]});for(const _0x5ae0df of _0x2c0e77){if(!_0x5ae0df[_0x1a9c41(0x127)]())continue;const _0x3115de=a123_0x522ebe[_0x1a9c41(0xf7)](_0x138e74,_0x5ae0df['name']),_0x52a2a1=a123_0x522ebe[_0x1a9c41(0xf7)](_0x3115de,_0x1a9c41(0x120)),_0x557197=a123_0x522ebe['join'](_0x3115de,_0x1a9c41(0xd1));a123_0x1fc611[_0x1a9c41(0x103)](_0x52a2a1)&&a123_0x1fc611[_0x1a9c41(0x103)](_0x557197)&&_0x13ae2f['push']({'name':_0x5ae0df[_0x1a9c41(0x1b3)],'code':a123_0x1fc611[_0x1a9c41(0xc0)](_0x52a2a1,_0x1a9c41(0xb8)),'json_schema':a123_0x1fc611[_0x1a9c41(0xc0)](_0x557197,_0x1a9c41(0xb8))});}}const _0x403bfe={..._0x22cfa8,'variables':_0x22cfa8[_0x1a9c41(0x135)]||[],'functions':_0x13ae2f};_0x2dbf10[_0x1a9c41(0x102)]({'name':_0x22cfa8['name'],'dir':_0x19e756,'def':_0x403bfe});}}const _0x15ea93=getExperimentalArtifactsDir(_0x54d8a8);if(a123_0x1fc611[_0x1a9c41(0x103)](_0x15ea93)){const _0x4e842c=a123_0x1fc611[_0x1a9c41(0xcc)](_0x15ea93,{'withFileTypes':!![]});for(const _0xe28e59 of _0x4e842c){if(!_0xe28e59[_0x1a9c41(0x127)]())continue;const _0x174d49=a123_0x522ebe[_0x1a9c41(0xf7)](_0x15ea93,_0xe28e59[_0x1a9c41(0x1b3)]),_0x52fdc3=a123_0x522ebe['join'](_0x174d49,_0xe28e59[_0x1a9c41(0x1b3)]+'.yml'),_0x302771=a123_0x522ebe[_0x1a9c41(0xf7)](_0x174d49,_0x1a9c41(0x120)),_0x297b74=a123_0x522ebe[_0x1a9c41(0xf7)](_0x174d49,'files');if(!a123_0x1fc611[_0x1a9c41(0x103)](_0x52fdc3)||!a123_0x1fc611['existsSync'](_0x302771))continue;const _0xed9737=parseExperimentalArtifactYaml(a123_0x1fc611[_0x1a9c41(0xc0)](_0x52fdc3,_0x1a9c41(0xb8)),_0x52fdc3),_0x18c265=a123_0x1fc611['readFileSync'](_0x302771,'utf-8'),_0x51735f=[];if(a123_0x1fc611['existsSync'](_0x297b74)){const _0x451062=a123_0x1fc611[_0x1a9c41(0xcc)](_0x297b74);for(const _0x894775 of _0x451062){const _0x4f4f0f=a123_0x522ebe[_0x1a9c41(0xf7)](_0x297b74,_0x894775);a123_0x1fc611[_0x1a9c41(0x197)](_0x4f4f0f)[_0x1a9c41(0x196)]()&&_0x51735f[_0x1a9c41(0x102)]({'file_name':_0x894775,'text_content':a123_0x1fc611[_0x1a9c41(0xc0)](_0x4f4f0f,_0x1a9c41(0xb8))});}}const _0x50009e={..._0xed9737,'code':_0x18c265,'files':_0x51735f};_0x585420['push']({'name':_0xed9737[_0x1a9c41(0x1b3)],'dir':_0x174d49,'def':_0x50009e});}}const _0x142ae1=await this[_0x1a9c41(0x1cd)]['listAgentsFull'](_0x417521),_0xedce83=await this['client'][_0x1a9c41(0xb7)](_0x417521),_0x5ac587=await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x176)](_0x417521),_0x4e0d91=await this['client'][_0x1a9c41(0x136)](_0x417521),_0x2a546e=await this['client'][_0x1a9c41(0x10f)](_0x417521),_0x2135e8=await safeListOrEmpty(()=>this[_0x1a9c41(0x1cd)][_0x1a9c41(0x19d)](_0x417521)),_0x3b90e1=await safeListOrEmpty(()=>this[_0x1a9c41(0x1cd)][_0x1a9c41(0x131)](_0x417521)),_0x3f083c=await fetchAllToolTargetMaps((_0x5a13a8,_0x2a4a85)=>this[_0x1a9c41(0x1cd)]['listToolTargets'](_0x5a13a8,_0x2a4a85),_0x417521),_0x5ee228=new Map(),_0x3b8a08=new Map(),_0x1b4592=new Map(),_0x48362a=new Map(),_0x47247b=new Map(),_0x1acf7d=new Map(),_0x22e241=new Map();for(const _0x35035b of _0x142ae1){_0x5ee228[_0x1a9c41(0x100)](_0x35035b[_0x1a9c41(0x11f)][_0x1a9c41(0x1b3)],_0x35035b);}for(const _0x48d976 of _0xedce83){_0x3b8a08[_0x1a9c41(0x100)](_0x48d976[_0x1a9c41(0x11f)][_0x1a9c41(0x1b3)],_0x48d976);}for(const _0x20b31a of _0x5ac587){_0x1b4592[_0x1a9c41(0x100)](_0x20b31a['attributes'][_0x1a9c41(0x1b3)],_0x20b31a);}for(const _0x3c5c8c of _0x4e0d91){_0x48362a['set'](_0x3c5c8c[_0x1a9c41(0x11f)]['name'],_0x3c5c8c);}for(const _0x5589bb of _0x2a546e){_0x47247b[_0x1a9c41(0x100)](_0x5589bb[_0x1a9c41(0x11f)]['serviceType'][_0x1a9c41(0x156)](),_0x5589bb);}for(const _0x1dc2e0 of _0x2135e8){_0x1acf7d[_0x1a9c41(0x100)](_0x1dc2e0[_0x1a9c41(0x11f)][_0x1a9c41(0x1b3)],_0x1dc2e0);}for(const _0x17f4e9 of _0x3b90e1){_0x22e241[_0x1a9c41(0x100)](_0x17f4e9['attributes'][_0x1a9c41(0x1b3)],_0x17f4e9);}const _0x43d7c3=new Map(),_0x72b371=new Map();for(const _0x438c4d of _0x142ae1){_0x43d7c3[_0x1a9c41(0x100)](_0x438c4d['attributes'][_0x1a9c41(0x1b3)],_0x438c4d['id']),_0x72b371[_0x1a9c41(0x100)](_0x438c4d['id'],_0x438c4d[_0x1a9c41(0x11f)][_0x1a9c41(0x1b3)]);}const _0x105e00=new Map(),_0x29f5e4=new Map();for(const _0x5adbc of _0x4e0d91){_0x105e00['set'](_0x5adbc['attributes'][_0x1a9c41(0x1b3)],_0x5adbc['id']),_0x29f5e4[_0x1a9c41(0x100)](_0x5adbc['id'],_0x5adbc[_0x1a9c41(0x11f)]['name']);}const _0x19f806=_0x3f083c['nameToId'][_0x1a9c41(0xbe)]||new Map(),_0x4999dd=_0x3f083c[_0x1a9c41(0x17f)][_0x1a9c41(0x105)]||new Map(),_0x3aab6c=_0x3f083c[_0x1a9c41(0x17f)][_0x1a9c41(0xd8)]||new Map(),_0xce7499=new Map(),_0x15ccec={'resolveToolTargetName':buildNameResolver({..._0x3f083c['idToName'],'Agent':_0x72b371}),'resolvePromptName':async _0x4fa90d=>_0x29f5e4['get'](_0x4fa90d),'onWarning':_0x25b2e8=>this[_0x1a9c41(0x187)][_0x1a9c41(0xeb)](_0x25b2e8)};let _0x1a430a=[];const _0x3f331b={'projectId':_0x417521,'resolveToolTargetId':buildIdResolver({..._0x3f083c[_0x1a9c41(0x17f)],'Agent':_0x43d7c3}),'resolvePromptId':async _0x595106=>_0x105e00[_0x1a9c41(0xf5)](_0x595106),'onWarning':_0x548037=>{const _0x1ff742=_0x1a9c41;this[_0x1ff742(0x187)][_0x1ff742(0xeb)](_0x548037),_0x1a430a[_0x1ff742(0x102)](_0x548037);}},{resolved:_0x462e35,unresolved:_0x5562f3}=resolveAgentDependencies(_0x1e312d,new Set(_0x5ee228[_0x1a9c41(0x15d)]()));for(const {agent:_0x2f7eff,missingDeps:_0xe25b99}of _0x5562f3){_0x2bc488['agents'][_0x1a9c41(0x102)]({'agentName':_0x2f7eff['yaml']['name'],'action':_0x1a9c41(0xe4),'error':_0x1a9c41(0xd7)+_0xe25b99[_0x1a9c41(0xf7)](',\x20')+'.\x20Check\x20for\x20circular\x20references\x20or\x20missing\x20agents.'}),_0x2bc488[_0x1a9c41(0x1b5)]['agents'][_0x1a9c41(0x115)]++;}for(const _0x2d3c75 of _0x49121f){const _0x4a1dc0=_0x3b8a08[_0x1a9c41(0xf5)](_0x2d3c75['yaml'][_0x1a9c41(0x1b3)]),_0x1e5e61=a123_0x1fc611[_0x1a9c41(0xc0)](_0x2d3c75[_0x1a9c41(0x1c6)],'utf-8');if(_0x4a1dc0){const _0xe80569=apiKnowledgeBaseToYaml(_0x4a1dc0),_0x29869d=toKnowledgeBaseYamlString(_0xe80569),_0x4ff70c=generateDiff(_0x29869d,_0x1e5e61),_0x297e76=hasChanges(_0x4ff70c);_0x297e76?(_0x2bc488[_0x1a9c41(0x185)][_0x1a9c41(0x102)]({'name':_0x2d3c75[_0x1a9c41(0xfa)]['name'],'action':'updated','id':_0x4a1dc0['id'],'diff':formatDiffWithColors(_0x4ff70c)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x185)][_0x1a9c41(0x11d)]++):(_0x2bc488['knowledgeBases'][_0x1a9c41(0x102)]({'name':_0x2d3c75['yaml'][_0x1a9c41(0x1b3)],'action':'unchanged','id':_0x4a1dc0['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x185)][_0x1a9c41(0x104)]++);}else _0x2bc488[_0x1a9c41(0x185)][_0x1a9c41(0x102)]({'name':_0x2d3c75[_0x1a9c41(0xfa)]['name'],'action':_0x1a9c41(0xdb)}),_0x2bc488[_0x1a9c41(0x1b5)]['knowledgeBases']['created']++;}for(const _0x8b7f1a of _0x1e85c1){const _0x5287ef=_0x1b4592[_0x1a9c41(0xf5)](_0x8b7f1a[_0x1a9c41(0x1b3)]),_0x150173=a123_0x1fc611['readFileSync'](_0x8b7f1a['path'],'utf-8');if(_0x5287ef){const _0x47b665=toTextKnowledgeBaseMd(_0x5287ef['attributes'][_0x1a9c41(0x1b3)],_0x5287ef[_0x1a9c41(0x11f)]['text']),_0x17be36=generateDiff(_0x47b665,_0x150173),_0x3b342a=hasChanges(_0x17be36);_0x3b342a?(_0x2bc488[_0x1a9c41(0x111)][_0x1a9c41(0x102)]({'name':_0x8b7f1a[_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x5287ef['id'],'diff':formatDiffWithColors(_0x17be36)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x111)][_0x1a9c41(0x11d)]++):(_0x2bc488[_0x1a9c41(0x111)][_0x1a9c41(0x102)]({'name':_0x8b7f1a[_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x104),'id':_0x5287ef['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x111)][_0x1a9c41(0x104)]++);}else _0x2bc488[_0x1a9c41(0x111)][_0x1a9c41(0x102)]({'name':_0x8b7f1a[_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb)}),_0x2bc488[_0x1a9c41(0x1b5)]['textKnowledgeBases'][_0x1a9c41(0xdb)]++;}for(const _0x28f511 of _0x462e35){const _0x50e481=_0x5ee228[_0x1a9c41(0xf5)](_0x28f511[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)]),_0x101f63=a123_0x522ebe[_0x1a9c41(0xf7)](_0x28f511['dir'],_0x1a9c41(0x1b2)),_0x5ee72a=a123_0x1fc611[_0x1a9c41(0xc0)](_0x101f63,_0x1a9c41(0xb8)),_0x1fd63b=_0x28f511[_0x1a9c41(0xce)],_0xd5f60c=_0x1a9c41(0x132)+_0x1fd63b+'\x0a\x0a#\x20agent.yml\x0a'+_0x5ee72a;if(_0x50e481){const {yaml:_0x128983,systemPrompt:_0x2b30bf}=await agentResponseToDef(_0x50e481,_0x15ccec),_0x4e2f69=toAgentYamlString(_0x128983),_0x345f9a=_0x1a9c41(0x132)+_0x2b30bf+_0x1a9c41(0x1cc)+_0x4e2f69,_0x746530=generateDiff(_0x345f9a,_0xd5f60c),_0x3959c0=hasChanges(_0x746530);_0x3959c0?(_0x2bc488[_0x1a9c41(0xd6)][_0x1a9c41(0x102)]({'agentName':_0x28f511[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'agentId':_0x50e481['id'],'diff':formatDiffWithColors(_0x746530)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xd6)][_0x1a9c41(0x11d)]++):(_0x2bc488[_0x1a9c41(0xd6)][_0x1a9c41(0x102)]({'agentName':_0x28f511[_0x1a9c41(0xfa)]['name'],'action':_0x1a9c41(0x104),'agentId':_0x50e481['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xd6)][_0x1a9c41(0x104)]++);}else _0x2bc488[_0x1a9c41(0xd6)]['push']({'agentName':_0x28f511[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xd6)][_0x1a9c41(0xdb)]++;}for(const _0x4aee2d of _0x5b583b){const _0x30278b=_0x48362a[_0x1a9c41(0xf5)](_0x4aee2d[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)]),_0x3408c7=a123_0x1fc611['readFileSync'](_0x4aee2d['path'],_0x1a9c41(0xb8));if(_0x30278b){const _0x4d8395=await apiPromptToYaml(_0x30278b,_0x15ccec);if(!_0x4d8395){_0x2bc488[_0x1a9c41(0x16c)]['push']({'name':_0x4aee2d[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x30278b['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x16c)][_0x1a9c41(0x11d)]++;continue;}const _0x286b7a=toPromptYamlString(_0x4d8395),_0x55cc11=generateDiff(_0x286b7a,_0x3408c7),_0x1c762b=hasChanges(_0x55cc11);_0x1c762b?(_0x2bc488['prompts'][_0x1a9c41(0x102)]({'name':_0x4aee2d[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x30278b['id'],'diff':formatDiffWithColors(_0x55cc11)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x16c)]['updated']++):(_0x2bc488[_0x1a9c41(0x16c)][_0x1a9c41(0x102)]({'name':_0x4aee2d['yaml'][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x104),'id':_0x30278b['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x16c)][_0x1a9c41(0x104)]++);}else _0x2bc488[_0x1a9c41(0x16c)][_0x1a9c41(0x102)]({'name':_0x4aee2d[_0x1a9c41(0xfa)]['name'],'action':_0x1a9c41(0xdb)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x16c)]['created']++;}for(const _0x3bda36 of _0x3c5cf6){const _0x5e6eed=_0x47247b[_0x1a9c41(0xf5)](_0x3bda36['yaml']['service_type']),_0x3931af=a123_0x1fc611[_0x1a9c41(0xc0)](_0x3bda36['path'],'utf-8');if(_0x5e6eed){const _0x19b66a=await apiIntegrationToYaml(_0x5e6eed,_0x15ccec),_0x4b6d44=toIntegrationYamlString(_0x19b66a),_0x2ed274=generateDiff(_0x4b6d44,_0x3931af),_0x1843ba=hasChanges(_0x2ed274);_0x1843ba?(_0x2bc488[_0x1a9c41(0xc8)][_0x1a9c41(0x102)]({'name':_0x3bda36[_0x1a9c41(0xfa)]['service_type'],'action':'updated','id':_0x5e6eed['id'],'diff':formatDiffWithColors(_0x2ed274)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xc8)][_0x1a9c41(0x11d)]++):(_0x2bc488[_0x1a9c41(0xc8)][_0x1a9c41(0x102)]({'name':_0x3bda36[_0x1a9c41(0xfa)]['service_type'],'action':_0x1a9c41(0x104),'id':_0x5e6eed['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xc8)][_0x1a9c41(0x104)]++);}else _0x2bc488[_0x1a9c41(0xc8)]['push']({'name':_0x3bda36['yaml'][_0x1a9c41(0x14d)],'action':_0x1a9c41(0xdb)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xc8)][_0x1a9c41(0xdb)]++;}for(const _0x4c6805 of _0x2dbf10){const _0x541008=_0x1acf7d[_0x1a9c41(0xf5)](_0x4c6805[_0x1a9c41(0xf6)]['name']),_0x55d8cc=toExperimentalKnowledgeBaseYamlString(_0x4c6805[_0x1a9c41(0xf6)]);let _0x3fca4b=_0x55d8cc;for(const _0xe8d60c of _0x4c6805[_0x1a9c41(0xf6)][_0x1a9c41(0x13b)]){_0x3fca4b+=_0x1a9c41(0xe8)+_0xe8d60c[_0x1a9c41(0x1b3)]+'\x20---\x0a'+_0xe8d60c['code']+_0x1a9c41(0x118)+_0xe8d60c[_0x1a9c41(0x1b3)]+_0x1a9c41(0x17d)+_0xe8d60c[_0x1a9c41(0xba)]+'\x0a';}if(_0x541008){const _0x43efaf=apiExperimentalKnowledgeBaseToYaml(_0x541008),_0x5030e3=toExperimentalKnowledgeBaseYamlString(_0x43efaf);let _0x30f963=_0x5030e3;for(const _0x154918 of _0x43efaf[_0x1a9c41(0x13b)]){_0x30f963+='\x0a---\x20function:\x20'+_0x154918[_0x1a9c41(0x1b3)]+'\x20---\x0a'+_0x154918['code']+_0x1a9c41(0x118)+_0x154918[_0x1a9c41(0x1b3)]+_0x1a9c41(0x17d)+_0x154918[_0x1a9c41(0xba)]+'\x0a';}const _0xac6bac=generateDiff(_0x30f963,_0x3fca4b),_0x37cec6=hasChanges(_0xac6bac);_0x37cec6?(_0x2bc488[_0x1a9c41(0x183)][_0x1a9c41(0x102)]({'name':_0x4c6805[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x541008['id'],'diff':formatDiffWithColors(_0xac6bac)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x183)][_0x1a9c41(0x11d)]++):(_0x2bc488[_0x1a9c41(0x183)]['push']({'name':_0x4c6805['def']['name'],'action':_0x1a9c41(0x104),'id':_0x541008['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x183)][_0x1a9c41(0x104)]++);}else _0x2bc488[_0x1a9c41(0x183)][_0x1a9c41(0x102)]({'name':_0x4c6805[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb)}),_0x2bc488['counts'][_0x1a9c41(0x183)][_0x1a9c41(0xdb)]++;}for(const _0x44c328 of _0x585420){const _0x286a2c=_0x22e241[_0x1a9c41(0xf5)](_0x44c328[_0x1a9c41(0xf6)]['name']),_0x11f155=toExperimentalArtifactYamlString(_0x44c328[_0x1a9c41(0xf6)]);let _0x283e0c=_0x11f155+('\x0a---\x20code\x20---\x0a'+_0x44c328[_0x1a9c41(0xf6)]['code']+'\x0a');for(const _0x43d5b4 of _0x44c328[_0x1a9c41(0xf6)][_0x1a9c41(0xea)]){_0x283e0c+=_0x1a9c41(0x14b)+_0x43d5b4[_0x1a9c41(0x13d)]+_0x1a9c41(0x17d)+_0x43d5b4[_0x1a9c41(0x19f)]+'\x0a';}if(_0x286a2c){const _0x16641e=apiExperimentalArtifactToYaml(_0x286a2c),_0xb27dca=toExperimentalArtifactYamlString(_0x16641e);let _0x486a74=_0xb27dca+(_0x1a9c41(0x130)+_0x16641e[_0x1a9c41(0x13a)]+'\x0a');for(const _0x3a97c6 of _0x16641e[_0x1a9c41(0xea)]){_0x486a74+=_0x1a9c41(0x14b)+_0x3a97c6[_0x1a9c41(0x13d)]+'\x20---\x0a'+_0x3a97c6[_0x1a9c41(0x19f)]+'\x0a';}const _0x436a41=generateDiff(_0x486a74,_0x283e0c),_0x3994ef=hasChanges(_0x436a41);_0x3994ef?(_0x2bc488[_0x1a9c41(0x1a3)][_0x1a9c41(0x102)]({'name':_0x44c328['def'][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x286a2c['id'],'diff':formatDiffWithColors(_0x436a41)}),_0x2bc488['counts']['experimentalArtifacts']['updated']++):(_0x2bc488[_0x1a9c41(0x1a3)][_0x1a9c41(0x102)]({'name':_0x44c328[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],'action':'unchanged','id':_0x286a2c['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x1a3)][_0x1a9c41(0x104)]++);}else _0x2bc488[_0x1a9c41(0x1a3)][_0x1a9c41(0x102)]({'name':_0x44c328[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb)}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x1a3)][_0x1a9c41(0xdb)]++;}if(_0x56d015?.[_0x1a9c41(0x1c8)])return _0x2bc488;_0x2bc488[_0x1a9c41(0x185)]=[],_0x2bc488[_0x1a9c41(0x111)]=[],_0x2bc488['prompts']=[],_0x2bc488[_0x1a9c41(0xc8)]=[],_0x2bc488[_0x1a9c41(0x183)]=[],_0x2bc488[_0x1a9c41(0x1a3)]=[];const _0xa9dc5d=_0x2bc488[_0x1a9c41(0xd6)]['filter'](_0x2b0c44=>_0x2b0c44['action']===_0x1a9c41(0xe4));_0x2bc488[_0x1a9c41(0xd6)]=_0xa9dc5d,_0x2bc488[_0x1a9c41(0x1b5)]={'agents':{'created':0x0,'updated':0x0,'unchanged':0x0,'errors':_0xa9dc5d[_0x1a9c41(0xf2)]},'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 _0x14a4c4 of _0x49121f){try{const _0x17bb75=_0x3b8a08[_0x1a9c41(0xf5)](_0x14a4c4[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)]),_0x44e89b=yamlKnowledgeBaseToApi(_0x14a4c4[_0x1a9c41(0xfa)],_0x417521);if(_0x17bb75)await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x1b6)](_0x17bb75['id'],_0x44e89b),_0x19f806[_0x1a9c41(0x100)](_0x14a4c4[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],_0x17bb75['id']),_0x2bc488[_0x1a9c41(0x185)][_0x1a9c41(0x102)]({'name':_0x14a4c4[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x17bb75['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x185)][_0x1a9c41(0x11d)]++;else{const _0x1a16b1=await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x17c)](_0x44e89b);_0x19f806[_0x1a9c41(0x100)](_0x14a4c4['yaml']['name'],_0x1a16b1['id']),_0x2bc488[_0x1a9c41(0x185)]['push']({'name':_0x14a4c4[_0x1a9c41(0xfa)]['name'],'action':_0x1a9c41(0xdb),'id':_0x1a16b1['id']}),_0x2bc488['counts'][_0x1a9c41(0x185)][_0x1a9c41(0xdb)]++;}}catch(_0x38d773){_0x2bc488[_0x1a9c41(0x185)][_0x1a9c41(0x102)]({'name':_0x14a4c4[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xe4),'error':_0x38d773['message']}),_0x2bc488['counts']['knowledgeBases']['errors']++;}}for(const _0x4e2f89 of _0x1e85c1){try{const _0x2fb6cf=_0x1b4592[_0x1a9c41(0xf5)](_0x4e2f89[_0x1a9c41(0x1b3)]),_0x5543c1=yamlTextKnowledgeBaseToApi({'name':_0x4e2f89[_0x1a9c41(0x1b3)],'text':_0x4e2f89[_0x1a9c41(0xd3)]},_0x417521);if(_0x2fb6cf)await this['client'][_0x1a9c41(0x18a)](_0x2fb6cf['id'],_0x5543c1),_0x4999dd['set'](_0x4e2f89[_0x1a9c41(0x1b3)],_0x2fb6cf['id']),_0x2bc488[_0x1a9c41(0x111)][_0x1a9c41(0x102)]({'name':_0x4e2f89[_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x2fb6cf['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x111)][_0x1a9c41(0x11d)]++;else{const _0x343fd7=await this[_0x1a9c41(0x1cd)]['createTextKnowledgeBase'](_0x5543c1);_0x4999dd[_0x1a9c41(0x100)](_0x4e2f89[_0x1a9c41(0x1b3)],_0x343fd7['id']),_0x2bc488['textKnowledgeBases'][_0x1a9c41(0x102)]({'name':_0x4e2f89[_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb),'id':_0x343fd7['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x111)][_0x1a9c41(0xdb)]++;}}catch(_0x1bbf42){_0x2bc488[_0x1a9c41(0x111)][_0x1a9c41(0x102)]({'name':_0x4e2f89[_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xe4),'error':_0x1bbf42['message']}),_0x2bc488[_0x1a9c41(0x1b5)]['textKnowledgeBases'][_0x1a9c41(0x115)]++;}}for(const _0x43e55c of _0x2dbf10){try{const _0x1656b4=_0x1acf7d[_0x1a9c41(0xf5)](_0x43e55c['def'][_0x1a9c41(0x1b3)]),_0x1a6ca3=yamlExperimentalKnowledgeBaseToApi(_0x43e55c[_0x1a9c41(0xf6)],_0x417521);if(_0x1656b4)await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x1b1)](_0x1656b4['id'],_0x1a6ca3),_0x3aab6c[_0x1a9c41(0x100)](_0x43e55c[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],_0x1656b4['id']),_0x2bc488[_0x1a9c41(0x183)][_0x1a9c41(0x102)]({'name':_0x43e55c[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x1656b4['id']}),_0x2bc488['counts'][_0x1a9c41(0x183)][_0x1a9c41(0x11d)]++;else{const _0x50f600=await this[_0x1a9c41(0x1cd)][_0x1a9c41(0xf3)](_0x1a6ca3);_0x3aab6c[_0x1a9c41(0x100)](_0x43e55c[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],_0x50f600['id']),_0x2bc488[_0x1a9c41(0x183)][_0x1a9c41(0x102)]({'name':_0x43e55c[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb),'id':_0x50f600['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x183)][_0x1a9c41(0xdb)]++;}}catch(_0x16f58a){_0x2bc488[_0x1a9c41(0x183)]['push']({'name':_0x43e55c[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xe4),'error':_0x16f58a[_0x1a9c41(0x12b)]}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x183)][_0x1a9c41(0x115)]++;}}for(const _0x3240c5 of _0x585420){try{const _0x58e64e=_0x22e241[_0x1a9c41(0xf5)](_0x3240c5[_0x1a9c41(0xf6)][_0x1a9c41(0x1b3)]),_0x5e9068=yamlExperimentalArtifactToApi(_0x3240c5[_0x1a9c41(0xf6)],_0x417521);if(_0x58e64e)await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x189)](_0x58e64e['id'],_0x5e9068),_0xce7499[_0x1a9c41(0x100)](_0x3240c5['def'][_0x1a9c41(0x1b3)],_0x58e64e['id']),_0x2bc488['experimentalArtifacts']['push']({'name':_0x3240c5['def'][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0x11d),'id':_0x58e64e['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x1a3)][_0x1a9c41(0x11d)]++;else{const _0x2e7e4b=await this['client'][_0x1a9c41(0x19e)](_0x5e9068);_0xce7499[_0x1a9c41(0x100)](_0x3240c5['def'][_0x1a9c41(0x1b3)],_0x2e7e4b['id']),_0x2bc488[_0x1a9c41(0x1a3)]['push']({'name':_0x3240c5['def']['name'],'action':_0x1a9c41(0xdb),'id':_0x2e7e4b['id']}),_0x2bc488[_0x1a9c41(0x1b5)]['experimentalArtifacts'][_0x1a9c41(0xdb)]++;}}catch(_0xc14061){_0x2bc488['experimentalArtifacts']['push']({'name':_0x3240c5['def']['name'],'action':_0x1a9c41(0xe4),'error':_0xc14061[_0x1a9c41(0x12b)]}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x1a3)][_0x1a9c41(0x115)]++;}}for(const _0x263c80 of _0x462e35){_0x1a430a=[];try{const _0x45b279=_0x5ee228[_0x1a9c41(0xf5)](_0x263c80['yaml'][_0x1a9c41(0x1b3)]),_0x4c8a77=await agentDefToRequest(_0x263c80[_0x1a9c41(0xfa)],_0x263c80['systemPrompt'],_0x263c80[_0x1a9c41(0x1c1)],_0x3f331b);if(_0x45b279)await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x145)](_0x45b279['id'],_0x4c8a77),_0x43d7c3[_0x1a9c41(0x100)](_0x263c80[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],_0x45b279['id']),_0x2bc488['agents'][_0x1a9c41(0x102)]({'agentName':_0x263c80[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':'updated','agentId':_0x45b279['id'],'warnings':_0x1a430a[_0x1a9c41(0xf2)]>0x0?_0x1a430a:undefined}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xd6)][_0x1a9c41(0x11d)]++;else{const _0x223406=await this[_0x1a9c41(0x1cd)]['createAgentResponse'](_0x4c8a77);_0x43d7c3[_0x1a9c41(0x100)](_0x263c80[_0x1a9c41(0xfa)]['name'],_0x223406['id']),_0x2bc488[_0x1a9c41(0xd6)]['push']({'agentName':_0x263c80['yaml'][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb),'agentId':_0x223406['id'],'warnings':_0x1a430a[_0x1a9c41(0xf2)]>0x0?_0x1a430a:undefined}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0xd6)]['created']++;}}catch(_0x3188d4){_0x2bc488[_0x1a9c41(0xd6)][_0x1a9c41(0x102)]({'agentName':_0x263c80[_0x1a9c41(0xfa)]['name'],'action':'error','error':_0x3188d4[_0x1a9c41(0x12b)],'warnings':_0x1a430a[_0x1a9c41(0xf2)]>0x0?_0x1a430a:undefined}),_0x2bc488[_0x1a9c41(0x1b5)]['agents'][_0x1a9c41(0x115)]++;}}for(const _0x40ad70 of _0x5b583b){try{const _0x546564=_0x48362a[_0x1a9c41(0xf5)](_0x40ad70[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)]),_0x17a76b=await yamlPromptToApi(_0x40ad70[_0x1a9c41(0xfa)],_0x417521,_0x3f331b);if(!_0x17a76b){_0x2bc488[_0x1a9c41(0x16c)]['push']({'name':_0x40ad70[_0x1a9c41(0xfa)]['name'],'action':_0x1a9c41(0xe4),'error':_0x1a9c41(0x17b)}),_0x2bc488[_0x1a9c41(0x1b5)]['prompts']['errors']++;continue;}if(_0x546564)await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x16b)](_0x546564['id'],_0x17a76b),_0x105e00[_0x1a9c41(0x100)](_0x40ad70[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],_0x546564['id']),_0x2bc488[_0x1a9c41(0x16c)]['push']({'name':_0x40ad70[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':'updated','id':_0x546564['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x16c)]['updated']++;else{const _0x30d458=await this['client']['createPrompt'](_0x17a76b);_0x105e00[_0x1a9c41(0x100)](_0x40ad70[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],_0x30d458['id']),_0x2bc488[_0x1a9c41(0x16c)][_0x1a9c41(0x102)]({'name':_0x40ad70[_0x1a9c41(0xfa)][_0x1a9c41(0x1b3)],'action':_0x1a9c41(0xdb),'id':_0x30d458['id']}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x16c)]['created']++;}}catch(_0x252729){_0x2bc488[_0x1a9c41(0x16c)]['push']({'name':_0x40ad70['yaml']['name'],'action':_0x1a9c41(0xe4),'error':_0x252729[_0x1a9c41(0x12b)]}),_0x2bc488[_0x1a9c41(0x1b5)][_0x1a9c41(0x16c)][_0x1a9c41(0x115)]++;}}for(const _0x4d8498 of _0x3c5cf6){try{const _0x133f4a=_0x47247b[_0x1a9c41(0xf5)](_0x4d8498[_0x1a9c41(0xfa)]['service_type']),_0x1df224=await yamlIntegrationToApi(_0x4d8498[_0x1a9c41(0xfa)],_0x417521,_0x3f331b);if(_0x133f4a){await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x149)](_0x133f4a['id']);const _0x4a1f26=await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x17e)](_0x1df224);_0x2bc488['integrations'][_0x1a9c41(0x102)]({'name':_0x4d8498[_0x1a9c41(0xfa)]['service_type'],'action':_0x1a9c41(0x11d),'id':_0x4a1f26['id']}),_0x2bc488['counts'][_0x1a9c41(0xc8)][_0x1a9c41(0x11d)]++;}else{const _0x286a31=await this[_0x1a9c41(0x1cd)][_0x1a9c41(0x17e)](_0x1df224);_0x2bc488[_0x1a9c41(0xc8)]['push']({'name':_0x4d8498[_0x1a9c41(0xfa)][_0x1a9c41(0x14d)],'action':'created','id':_0x286a31['id']}),_0x2bc488['counts'][_0x1a9c41(0xc8)][_0x1a9c41(0xdb)]++;}}catch(_0x2af1b2){_0x2bc488[_0x1a9c41(0xc8)][_0x1a9c41(0x102)]({'name':_0x4d8498['yaml'][_0x1a9c41(0x14d)],'action':'error','error':_0x2af1b2[_0x1a9c41(0x12b)]}),_0x2bc488[_0x1a9c41(0x1b5)]['integrations'][_0x1a9c41(0x115)]++;}}return _0x2bc488;}async[a123_0x5aa90d(0x18b)](_0x64a4c9,_0x3586ce,_0x12162a,_0x3241c9){const _0x5b9965=a123_0x5aa90d,{projectId:_0x45d765,project:_0x230ed9}=await this[_0x5b9965(0x144)](_0x64a4c9),_0x12d3e9=_0x230ed9[_0x5b9965(0x11f)][_0x5b9965(0x1b3)],_0x453d72=await this['client'][_0x5b9965(0x128)](_0x45d765),_0x30c022=_0x453d72[_0x5b9965(0x142)](_0x521f33=>_0x521f33[_0x5b9965(0x11f)][_0x5b9965(0x1b3)]===_0x3586ce);if(!_0x30c022)throw new SDKError(ErrorCode['AGENT_NOT_FOUND'],_0x5b9965(0x15b)+_0x3586ce,undefined,{'helpText':_0x5b9965(0x16f)+_0x453d72[_0x5b9965(0x12f)](_0x49d0ed=>_0x49d0ed['attributes'][_0x5b9965(0x1b3)])[_0x5b9965(0xf7)](',\x20')});let _0x564e92;if(_0x12162a)_0x564e92=_0x12162a;else{const _0x17fb13=a123_0x522ebe[_0x5b9965(0xf7)](process['cwd'](),_0x5b9965(0xd6)),_0x3c4119=getSanitizedPathWithMigration(_0x17fb13,_0x12d3e9);_0x3c4119['renamed']&&this[_0x5b9965(0x187)][_0x5b9965(0xec)]('Renamed\x20folder:\x20'+a123_0x522ebe[_0x5b9965(0x10a)](_0x3c4119['oldPath'])+_0x5b9965(0xcf)+a123_0x522ebe['basename'](_0x3c4119[_0x5b9965(0x1c6)])),_0x564e92=_0x3c4119[_0x5b9965(0x1c6)];}const _0x372756=getSanitizedPathWithMigration(_0x564e92,_0x3586ce);_0x372756[_0x5b9965(0x1a8)]&&this[_0x5b9965(0x187)][_0x5b9965(0xec)](_0x5b9965(0x186)+a123_0x522ebe[_0x5b9965(0x10a)](_0x372756[_0x5b9965(0x15c)])+_0x5b9965(0xcf)+a123_0x522ebe[_0x5b9965(0x10a)](_0x372756[_0x5b9965(0x1c6)]));const _0x32b598=_0x372756[_0x5b9965(0x1c6)],_0x279779=new Map(),_0x5b8c8c=new Map(),_0x5a796f=await this[_0x5b9965(0x1cd)][_0x5b9965(0xb7)](_0x45d765),_0x1068e2=await this[_0x5b9965(0x1cd)][_0x5b9965(0x176)](_0x45d765),_0x2ec311=await safeListOrEmpty(()=>this[_0x5b9965(0x1cd)][_0x5b9965(0x19d)](_0x45d765)),_0x5c82fe=new Map(),_0x146ad1=new Map();for(const _0x1a65b5 of _0x5a796f){_0x279779[_0x5b9965(0x100)](_0x1a65b5['id'],_0x1a65b5[_0x5b9965(0x11f)][_0x5b9965(0x1b3)]);}for(const _0x215a70 of _0x1068e2){_0x5c82fe[_0x5b9965(0x100)](_0x215a70['id'],_0x215a70[_0x5b9965(0x11f)][_0x5b9965(0x1b3)]);}for(const _0xbe2443 of _0x2ec311){_0x146ad1[_0x5b9965(0x100)](_0xbe2443['id'],_0xbe2443[_0x5b9965(0x11f)]['name']);}for(const _0x110992 of _0x453d72){_0x5b8c8c[_0x5b9965(0x100)](_0x110992['id'],_0x110992[_0x5b9965(0x11f)][_0x5b9965(0x1b3)]);}const _0xf2c0f8={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x279779,'TextKnowledgeBase':_0x5c82fe,'Agent':_0x5b8c8c,'ExperimentalKnowledgeBase':_0x146ad1}),'resolvePromptName':async()=>undefined,'onWarning':_0x198dc8=>this[_0x5b9965(0x187)][_0x5b9965(0xeb)](_0x198dc8)},_0x5476c4=a123_0x522ebe[_0x5b9965(0xf7)](_0x32b598,_0x5b9965(0xfc)),_0x2b0aac=a123_0x522ebe[_0x5b9965(0xf7)](_0x32b598,_0x5b9965(0x1b2)),_0x1e14aa=a123_0x522ebe[_0x5b9965(0xf7)](_0x32b598,'starter_message.md'),_0x29cd9c=!a123_0x1fc611[_0x5b9965(0x103)](_0x2b0aac);if(_0x3241c9?.[_0x5b9965(0x1c8)])return{'agentName':_0x3586ce,'outputPath':_0x32b598,'isNew':_0x29cd9c,'hasChanges':!![]};a123_0x1fc611[_0x5b9965(0x17a)](_0x564e92,{'recursive':!![]}),a123_0x1fc611['mkdirSync'](_0x32b598,{'recursive':!![]});const _0x4dea83=a123_0x522ebe[_0x5b9965(0xf7)](_0x564e92,_0x5b9965(0x172));!a123_0x1fc611[_0x5b9965(0x103)](_0x4dea83)&&a123_0x1fc611[_0x5b9965(0x179)](_0x4dea83,createAgentConfigContent(_0x64a4c9));const {yaml:_0x4ccfc7,systemPrompt:_0x38d451,starterMessage:_0xb09c3}=await agentResponseToDef(_0x30c022,_0xf2c0f8);let _0x1f8645=_0x29cd9c;if(!_0x29cd9c){const _0x1134da=a123_0x1fc611[_0x5b9965(0x103)](_0x5476c4)?a123_0x1fc611['readFileSync'](_0x5476c4,_0x5b9965(0xb8)):'',_0x22bb86=a123_0x1fc611[_0x5b9965(0xc0)](_0x2b0aac,_0x5b9965(0xb8));_0x1f8645=_0x1134da!==_0x38d451||_0x22bb86!==toAgentYamlString(_0x4ccfc7);}a123_0x1fc611[_0x5b9965(0x179)](_0x5476c4,_0x38d451),a123_0x1fc611[_0x5b9965(0x179)](_0x2b0aac,toAgentYamlString(_0x4ccfc7));if(_0xb09c3&&_0xb09c3[_0x5b9965(0xcb)]('\x0a'))a123_0x1fc611[_0x5b9965(0x179)](_0x1e14aa,_0xb09c3);else a123_0x1fc611['existsSync'](_0x1e14aa)&&a123_0x1fc611['unlinkSync'](_0x1e14aa);return{'agentName':_0x3586ce,'outputPath':_0x32b598,'isNew':_0x29cd9c,'hasChanges':_0x1f8645};}async[a123_0x5aa90d(0x1c7)](_0x155b99,_0x4ec315){const _0x4bc720=a123_0x5aa90d;let _0x18a47a;isAgentYamlPath(_0x155b99)?_0x18a47a=getAgentDirFromYamlPath(_0x155b99):_0x18a47a=_0x155b99;const {config:_0x47550d}=findAgentConfig(_0x18a47a),_0x294057=await this[_0x4bc720(0x1c0)](_0x47550d['llm_project']),_0x4342ce=a123_0x522ebe[_0x4bc720(0xf7)](_0x18a47a,'agent.yml'),_0x62b358=a123_0x522ebe[_0x4bc720(0xf7)](_0x18a47a,_0x4bc720(0xfc)),_0xf0531e=a123_0x522ebe[_0x4bc720(0xf7)](_0x18a47a,_0x4bc720(0x146));if(!a123_0x1fc611[_0x4bc720(0x103)](_0x4342ce))throw new SDKError(ErrorCode[_0x4bc720(0x133)],_0x4bc720(0xbc)+_0x18a47a,undefined,{'helpText':_0x4bc720(0x1ca)});const _0xd0a7c2=parseAgentYaml(a123_0x1fc611[_0x4bc720(0xc0)](_0x4342ce,'utf-8'),_0x4342ce),_0x1daee3=a123_0x1fc611[_0x4bc720(0x103)](_0x62b358)?a123_0x1fc611[_0x4bc720(0xc0)](_0x62b358,'utf-8'):'',_0x23e324=a123_0x1fc611['existsSync'](_0xf0531e)?a123_0x1fc611['readFileSync'](_0xf0531e,_0x4bc720(0xb8)):_0xd0a7c2[_0x4bc720(0xb4)];if(_0x4ec315?.[_0x4bc720(0x1c8)])return{'agentName':_0xd0a7c2['name'],'action':_0x4bc720(0xdb),'projectId':_0x294057};const _0x3e286d=await this[_0x4bc720(0x1cd)][_0x4bc720(0x128)](_0x294057),_0x2a6b50=await fetchAllToolTargetMaps((_0x2a4dcd,_0x4e44ed)=>this[_0x4bc720(0x1cd)][_0x4bc720(0x1c9)](_0x2a4dcd,_0x4e44ed),_0x294057),_0x2132ca=new Map();for(const _0xe337fa of _0x3e286d){_0x2132ca[_0x4bc720(0x100)](_0xe337fa[_0x4bc720(0x11f)][_0x4bc720(0x1b3)],_0xe337fa['id']);}const _0x6c763=[],_0x38ef32={'projectId':_0x294057,'resolveToolTargetId':buildIdResolver({..._0x2a6b50[_0x4bc720(0x17f)],'Agent':_0x2132ca}),'resolvePromptId':async()=>undefined,'onWarning':_0x5f3194=>{this['logger']['warn'](_0x5f3194),_0x6c763['push'](_0x5f3194);}};try{const _0x5c3911=_0x3e286d['find'](_0x71c1cd=>_0x71c1cd[_0x4bc720(0x11f)][_0x4bc720(0x1b3)]===_0xd0a7c2['name']),_0x2ad4fd=await agentDefToRequest(_0xd0a7c2,_0x1daee3,_0x23e324,_0x38ef32);if(_0x5c3911)return await this[_0x4bc720(0x1cd)][_0x4bc720(0x145)](_0x5c3911['id'],_0x2ad4fd),{'agentName':_0xd0a7c2['name'],'action':_0x4bc720(0x11d),'projectId':_0x294057,'agentId':_0x5c3911['id'],'warnings':_0x6c763['length']>0x0?_0x6c763:undefined};else{const _0x482302=await this[_0x4bc720(0x1cd)][_0x4bc720(0xcd)](_0x2ad4fd);return{'agentName':_0xd0a7c2[_0x4bc720(0x1b3)],'action':'created','projectId':_0x294057,'agentId':_0x482302['id'],'warnings':_0x6c763[_0x4bc720(0xf2)]>0x0?_0x6c763:undefined};}}catch(_0x18abe2){return{'agentName':_0xd0a7c2[_0x4bc720(0x1b3)],'action':'error','projectId':_0x294057,'error':_0x18abe2[_0x4bc720(0x12b)],'warnings':_0x6c763[_0x4bc720(0xf2)]>0x0?_0x6c763:undefined};}}async['cloneProject'](_0x17a02a,_0x34c928,_0x43cc8d){const _0x1d9486=a123_0x5aa90d,_0x4a80d1=a123_0x1fc611[_0x1d9486(0x103)](_0x17a02a)&&a123_0x1fc611[_0x1d9486(0x103)](a123_0x522ebe['join'](_0x17a02a,_0x1d9486(0x172)));let _0xf4c38a;const _0x5d0a3e=[],_0x453446=[],_0x3bcac6=[],_0x122f6f=[],_0x42baca=[],_0x2da978=[],_0xf83fb5=[];if(_0x4a80d1){const _0xbbc6c9=loadAgentConfig(a123_0x522ebe[_0x1d9486(0xf7)](_0x17a02a,_0x1d9486(0x172)));_0xf4c38a=_0xbbc6c9[_0x1d9486(0xbd)];const _0x40d579=a123_0x1fc611['readdirSync'](_0x17a02a,{'withFileTypes':!![]});for(const _0x2bddd0 of _0x40d579){if(!_0x2bddd0[_0x1d9486(0x127)]())continue;if([_0x1d9486(0x16a),_0x1d9486(0x1ae),_0x1d9486(0x11b),_0x1d9486(0x16c),_0x1d9486(0xc8)][_0x1d9486(0xcb)](_0x2bddd0[_0x1d9486(0x1b3)]))continue;const _0x4167e8=a123_0x522ebe[_0x1d9486(0xf7)](_0x17a02a,_0x2bddd0[_0x1d9486(0x1b3)]);if(isAgentDir(_0x4167e8)){const _0x27518a=a123_0x522ebe[_0x1d9486(0xf7)](_0x4167e8,'agent.yml'),_0xa350a8=a123_0x522ebe[_0x1d9486(0xf7)](_0x4167e8,_0x1d9486(0xfc)),_0x2e4a56=a123_0x522ebe[_0x1d9486(0xf7)](_0x4167e8,'starter_message.md'),_0x18d636=parseAgentYaml(a123_0x1fc611['readFileSync'](_0x27518a,'utf-8'),_0x27518a),_0x967c0e=a123_0x1fc611[_0x1d9486(0x103)](_0xa350a8)?a123_0x1fc611[_0x1d9486(0xc0)](_0xa350a8,_0x1d9486(0xb8)):'',_0x14b9b2=a123_0x1fc611[_0x1d9486(0x103)](_0x2e4a56)?a123_0x1fc611[_0x1d9486(0xc0)](_0x2e4a56,_0x1d9486(0xb8)):_0x18d636[_0x1d9486(0xb4)];_0x5d0a3e[_0x1d9486(0x102)]({'name':_0x18d636[_0x1d9486(0x1b3)],'dir':_0x4167e8,'yaml':_0x18d636,'systemPrompt':_0x967c0e,'starterMessage':_0x14b9b2});}}const _0x3aa9bb=getKnowledgeBasesDir(_0x17a02a);if(a123_0x1fc611[_0x1d9486(0x103)](_0x3aa9bb)){const _0x4e711d=a123_0x1fc611[_0x1d9486(0xcc)](_0x3aa9bb);for(const _0xe3b080 of _0x4e711d){const _0xe7a8ed=a123_0x522ebe[_0x1d9486(0xf7)](_0x3aa9bb,_0xe3b080);if(_0xe3b080['endsWith'](_0x1d9486(0x14e))){const _0xf457d=parseKnowledgeBaseYaml(a123_0x1fc611['readFileSync'](_0xe7a8ed,_0x1d9486(0xb8)),_0xe7a8ed);_0x453446[_0x1d9486(0x102)]({'name':_0xf457d[_0x1d9486(0x1b3)],'path':_0xe7a8ed,'yaml':_0xf457d});}else{if(_0xe3b080['endsWith']('.md')){const _0x2d7a66=a123_0x1fc611[_0x1d9486(0xc0)](_0xe7a8ed,'utf-8'),{name:_0x2f1f67,text:_0x5e9706}=parseTextKnowledgeBaseMd(_0x2d7a66,_0xe3b080);_0x3bcac6[_0x1d9486(0x102)]({'name':_0x2f1f67,'path':_0xe7a8ed,'text':_0x5e9706});}}}}const _0x5897f8=getPromptsDir(_0x17a02a);if(a123_0x1fc611['existsSync'](_0x5897f8)){const _0x4ab1ea=a123_0x1fc611[_0x1d9486(0xcc)](_0x5897f8)[_0x1d9486(0x190)](_0x3776e8=>_0x3776e8[_0x1d9486(0xed)](_0x1d9486(0x14e)));for(const _0xbe3860 of _0x4ab1ea){const _0x443fdc=a123_0x522ebe['join'](_0x5897f8,_0xbe3860),_0x252eae=parsePromptYaml(a123_0x1fc611[_0x1d9486(0xc0)](_0x443fdc,'utf-8'),_0x443fdc);_0x122f6f['push']({'name':_0x252eae[_0x1d9486(0x1b3)],'path':_0x443fdc,'yaml':_0x252eae});}}const _0xba488a=getIntegrationsDir(_0x17a02a);if(a123_0x1fc611[_0x1d9486(0x103)](_0xba488a)){const _0x5b22d3=a123_0x1fc611[_0x1d9486(0xcc)](_0xba488a)[_0x1d9486(0x190)](_0x3dfd77=>_0x3dfd77['endsWith'](_0x1d9486(0x14e)));for(const _0x3cac70 of _0x5b22d3){const _0x10bac1=a123_0x522ebe[_0x1d9486(0xf7)](_0xba488a,_0x3cac70),_0x25fb8b=parseIntegrationYaml(a123_0x1fc611['readFileSync'](_0x10bac1,_0x1d9486(0xb8)),_0x10bac1);SAFE_INTEGRATION_TYPES[_0x1d9486(0xcb)](_0x25fb8b[_0x1d9486(0x14d)][_0x1d9486(0x156)]())?_0x42baca[_0x1d9486(0x102)]({'name':_0x25fb8b[_0x1d9486(0x1b3)],'path':_0x10bac1,'yaml':_0x25fb8b}):this[_0x1d9486(0x187)][_0x1d9486(0xeb)](_0x1d9486(0xd9)+_0x25fb8b[_0x1d9486(0x1b3)]+_0x1d9486(0x158)+_0x25fb8b['service_type']+'):\x20'+(_0x1d9486(0x16d)+SAFE_INTEGRATION_TYPES[_0x1d9486(0xf7)](',\x20')+_0x1d9486(0xbf)));}}const _0x53568d=getExperimentalKnowledgeBasesDir(_0x17a02a);if(a123_0x1fc611[_0x1d9486(0x103)](_0x53568d)){const _0x1930c7=a123_0x1fc611[_0x1d9486(0xcc)](_0x53568d,{'withFileTypes':!![]});for(const _0x237ad4 of _0x1930c7){if(!_0x237ad4[_0x1d9486(0x127)]())continue;const _0x4839bc=a123_0x522ebe[_0x1d9486(0xf7)](_0x53568d,_0x237ad4[_0x1d9486(0x1b3)]),_0x467c05=a123_0x522ebe[_0x1d9486(0xf7)](_0x4839bc,_0x237ad4['name']+_0x1d9486(0x14e));if(a123_0x1fc611['existsSync'](_0x467c05)){const _0x17398f=parseExperimentalKnowledgeBaseYaml(a123_0x1fc611[_0x1d9486(0xc0)](_0x467c05,_0x1d9486(0xb8)),_0x467c05),_0x7e35ea=a123_0x522ebe[_0x1d9486(0xf7)](_0x4839bc,_0x1d9486(0x13b)),_0x43d521=[];if(a123_0x1fc611[_0x1d9486(0x103)](_0x7e35ea)){const _0x47c9ee=a123_0x1fc611[_0x1d9486(0xcc)](_0x7e35ea,{'withFileTypes':!![]});for(const _0x2a3906 of _0x47c9ee){if(!_0x2a3906[_0x1d9486(0x127)]())continue;const _0x3ccdd0=a123_0x522ebe[_0x1d9486(0xf7)](_0x7e35ea,_0x2a3906[_0x1d9486(0x1b3)]),_0x3afedf=a123_0x522ebe[_0x1d9486(0xf7)](_0x3ccdd0,_0x1d9486(0x120)),_0x5dd226=a123_0x522ebe[_0x1d9486(0xf7)](_0x3ccdd0,'json_schema.json');if(a123_0x1fc611[_0x1d9486(0x103)](_0x3afedf)&&a123_0x1fc611[_0x1d9486(0x103)](_0x5dd226)){const _0x216627=a123_0x1fc611[_0x1d9486(0xc0)](_0x3afedf,'utf-8'),_0x48d640=a123_0x1fc611[_0x1d9486(0xc0)](_0x5dd226,_0x1d9486(0xb8));_0x43d521[_0x1d9486(0x102)]({'name':_0x2a3906[_0x1d9486(0x1b3)],'code':_0x216627,'json_schema':_0x48d640});}}}const _0x377f47={..._0x17398f,'functions':_0x43d521};_0x2da978[_0x1d9486(0x102)]({'name':_0x17398f[_0x1d9486(0x1b3)],'path':_0x4839bc,'def':_0x377f47});}}}const _0x550d98=getExperimentalArtifactsDir(_0x17a02a);if(a123_0x1fc611[_0x1d9486(0x103)](_0x550d98)){const _0x34cb8f=a123_0x1fc611[_0x1d9486(0xcc)](_0x550d98,{'withFileTypes':!![]});for(const _0x27158a of _0x34cb8f){if(!_0x27158a[_0x1d9486(0x127)]())continue;const _0x161092=a123_0x522ebe[_0x1d9486(0xf7)](_0x550d98,_0x27158a['name']),_0x2c559c=a123_0x522ebe[_0x1d9486(0xf7)](_0x161092,_0x27158a[_0x1d9486(0x1b3)]+'.yml');if(a123_0x1fc611[_0x1d9486(0x103)](_0x2c559c)){const _0x167c1c=parseExperimentalArtifactYaml(a123_0x1fc611[_0x1d9486(0xc0)](_0x2c559c,_0x1d9486(0xb8)),_0x2c559c),_0x387fee=a123_0x522ebe[_0x1d9486(0xf7)](_0x161092,'code.js'),_0x58c105=a123_0x1fc611[_0x1d9486(0x103)](_0x387fee)?a123_0x1fc611[_0x1d9486(0xc0)](_0x387fee,'utf-8'):'',_0x131c49=a123_0x522ebe['join'](_0x161092,_0x1d9486(0xea)),_0x216880=[];if(a123_0x1fc611[_0x1d9486(0x103)](_0x131c49)){const _0x5edc8e=a123_0x1fc611[_0x1d9486(0xcc)](_0x131c49);for(const _0x5d8ad9 of _0x5edc8e){const _0x4feaa5=a123_0x522ebe[_0x1d9486(0xf7)](_0x131c49,_0x5d8ad9);if(a123_0x1fc611['statSync'](_0x4feaa5)[_0x1d9486(0x196)]()){const _0x22fc4c=a123_0x1fc611[_0x1d9486(0xc0)](_0x4feaa5,_0x1d9486(0xb8));_0x216880[_0x1d9486(0x102)]({'file_name':_0x5d8ad9,'text_content':_0x22fc4c});}}}const _0x37b520={..._0x167c1c,'code':_0x58c105,'files':_0x216880};_0xf83fb5[_0x1d9486(0x102)]({'name':_0x167c1c[_0x1d9486(0x1b3)],'path':_0x161092,'def':_0x37b520});}}}}else{const _0x3ce445=await this[_0x1d9486(0x1c0)](_0x17a02a),_0x50dfed=await this[_0x1d9486(0x1cd)][_0x1d9486(0x11a)](_0x3ce445);_0xf4c38a=_0x50dfed[_0x1d9486(0x11f)][_0x1d9486(0x1b3)];const _0x847ee8=await this[_0x1d9486(0x1cd)]['listAgentsFull'](_0x3ce445),_0x56ce2e=await this[_0x1d9486(0x1cd)][_0x1d9486(0xb7)](_0x3ce445),_0x2e05df=await this[_0x1d9486(0x1cd)][_0x1d9486(0x176)](_0x3ce445),_0x83428b=await this[_0x1d9486(0x1cd)][_0x1d9486(0x136)](_0x3ce445),_0xb9d379=await this[_0x1d9486(0x1cd)][_0x1d9486(0x10f)](_0x3ce445),_0x113d89=await safeListOrEmpty(()=>this['client'][_0x1d9486(0x19d)](_0x3ce445)),_0x3af6e4=await safeListOrEmpty(()=>this[_0x1d9486(0x1cd)][_0x1d9486(0x131)](_0x3ce445)),_0x374a6c=new Map(),_0x471c70=new Map(),_0x2c7360=new Map(),_0x4649ae=new Map(),_0x1e5f5b=new Map(),_0x41b8a5=new Map();for(const _0x74e4d1 of _0x56ce2e){_0x374a6c[_0x1d9486(0x100)](_0x74e4d1['id'],_0x74e4d1[_0x1d9486(0x11f)]['name']);}for(const _0xb3a3e of _0x2e05df){_0x471c70['set'](_0xb3a3e['id'],_0xb3a3e[_0x1d9486(0x11f)][_0x1d9486(0x1b3)]);}for(const _0x214922 of _0x847ee8){_0x2c7360[_0x1d9486(0x100)](_0x214922['id'],_0x214922[_0x1d9486(0x11f)][_0x1d9486(0x1b3)]);}for(const _0x4f5d2c of _0x83428b){_0x4649ae[_0x1d9486(0x100)](_0x4f5d2c['id'],_0x4f5d2c[_0x1d9486(0x11f)][_0x1d9486(0x1b3)]);}for(const _0x164ecb of _0x113d89){_0x1e5f5b[_0x1d9486(0x100)](_0x164ecb['id'],_0x164ecb[_0x1d9486(0x11f)][_0x1d9486(0x1b3)]);}for(const _0x440142 of _0x3af6e4){_0x41b8a5[_0x1d9486(0x100)](_0x440142['id'],_0x440142[_0x1d9486(0x11f)][_0x1d9486(0x1b3)]);}const _0x3eb6aa={'resolveToolTargetName':buildNameResolver({'KnowledgeBase':_0x374a6c,'TextKnowledgeBase':_0x471c70,'Agent':_0x2c7360,'ExperimentalKnowledgeBase':_0x1e5f5b}),'resolvePromptName':async _0x1c31fe=>_0x4649ae[_0x1d9486(0xf5)](_0x1c31fe),'onWarning':_0x299d48=>this[_0x1d9486(0x187)][_0x1d9486(0xeb)](_0x299d48)};for(const _0x431708 of _0x847ee8){const _0x4a6691=await agentResponseToDef(_0x431708,_0x3eb6aa),{yaml:_0x1bfabe,systemPrompt:_0x1adcbc,starterMessage:_0x21e048}=_0x4a6691;_0x5d0a3e[_0x1d9486(0x102)]({'name':_0x1bfabe['name'],'dir':'','yaml':_0x1bfabe,'systemPrompt':_0x1adcbc,'starterMessage':_0x21e048});}for(const _0x4f418d of _0x56ce2e){const _0x396c77=apiKnowledgeBaseToYaml(_0x4f418d);_0x453446['push']({'name':_0x396c77['name'],'path':'','yaml':_0x396c77});}for(const _0x11702a of _0x2e05df){_0x3bcac6[_0x1d9486(0x102)]({'name':_0x11702a['attributes'][_0x1d9486(0x1b3)],'path':'','text':_0x11702a[_0x1d9486(0x11f)][_0x1d9486(0xd3)]});}for(const _0xa7f0d of _0x83428b){const _0x2b0bb2=await apiPromptToYaml(_0xa7f0d,_0x3eb6aa);_0x2b0bb2&&_0x122f6f['push']({'name':_0x2b0bb2['name'],'path':'','yaml':_0x2b0bb2});}for(const _0x342ef3 of _0xb9d379){if(!_0x342ef3['attributes'][_0x1d9486(0x1ab)]&&SAFE_INTEGRATION_TYPES[_0x1d9486(0xcb)](_0x342ef3[_0x1d9486(0x11f)][_0x1d9486(0x11e)][_0x1d9486(0x156)]())){const _0x1cabff=await apiIntegrationToYaml(_0x342ef3,_0x3eb6aa);_0x42baca[_0x1d9486(0x102)]({'name':_0x342ef3[_0x1d9486(0x11f)][_0x1d9486(0x11e)][_0x1d9486(0x156)](),'path':'','yaml':_0x1cabff});}}for(const _0x5e232e of _0x113d89){const _0x1f242f=apiExperimentalKnowledgeBaseToYaml(_0x5e232e);_0x2da978[_0x1d9486(0x102)]({'name':_0x1f242f[_0x1d9486(0x1b3)],'path':'','def':_0x1f242f});}for(const _0x24be52 of _0x3af6e4){const _0x11ef73=apiExperimentalArtifactToYaml(_0x24be52);_0xf83fb5[_0x1d9486(0x102)]({'name':_0x11ef73[_0x1d9486(0x1b3)],'path':'','def':_0x11ef73});}}const _0x4bfb66={'sourceProjectName':_0xf4c38a,'newProjectName':_0x34c928,'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}}},_0xd0d625=await this['client'][_0x1d9486(0x13e)](),_0x51e20e=_0xd0d625[_0x1d9486(0x142)](_0x2fc502=>_0x2fc502['attributes'][_0x1d9486(0x1b3)]===_0x34c928);if(_0x51e20e)throw new SDKError(ErrorCode[_0x1d9486(0xf1)],_0x1d9486(0x18e)+_0x34c928+_0x1d9486(0x143),undefined,{'helpText':'Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20project\x20first.'});if(_0x43cc8d?.[_0x1d9486(0x1c8)])return _0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0xd6)][_0x1d9486(0xdb)]=_0x5d0a3e['length'],_0x4bfb66[_0x1d9486(0x1b5)]['knowledgeBases'][_0x1d9486(0xdb)]=_0x453446[_0x1d9486(0xf2)],_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0x111)][_0x1d9486(0xdb)]=_0x3bcac6[_0x1d9486(0xf2)],_0x4bfb66[_0x1d9486(0x1b5)]['experimentalKnowledgeBases']['created']=_0x2da978['length'],_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0x1a3)][_0x1d9486(0xdb)]=_0xf83fb5[_0x1d9486(0xf2)],_0x4bfb66['counts'][_0x1d9486(0x16c)][_0x1d9486(0xdb)]=_0x122f6f[_0x1d9486(0xf2)],_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0xc8)][_0x1d9486(0xdb)]=_0x42baca[_0x1d9486(0xf2)],_0x4bfb66;const _0x4ca775=await this['client'][_0x1d9486(0x121)]({'name':_0x34c928}),_0x1920b4=_0x4ca775['id'];_0x4bfb66[_0x1d9486(0xef)]=_0x1920b4;const _0x213990=new Map(),_0x82f70c=new Map(),_0x1c937c=new Map(),_0x443e8d=new Map(),_0x1ec9db=new Map(),_0x31b986=new Map(),_0x408321=new Map(),_0x84bf93=new Map(),_0x28c0cd=new Set(),_0x499a72=new Set();for(const _0x34b9c7 of _0x5d0a3e){for(const _0x1bef08 of _0x34b9c7[_0x1d9486(0xfa)][_0x1d9486(0x1a7)]||[]){if(_0x1bef08[_0x1d9486(0x1a5)]===_0x1d9486(0x126)&&_0x1bef08['target']){const _0x254222=parseRef(_0x1bef08[_0x1d9486(0x154)]);if(_0x254222)_0x28c0cd[_0x1d9486(0x134)](_0x254222[_0x1d9486(0x1b3)]);}else{if(_0x1bef08['type']==='web_search'&&_0x1bef08[_0x1d9486(0x154)]){const _0xc42346=parseRef(_0x1bef08[_0x1d9486(0x154)]);if(_0xc42346)_0x499a72[_0x1d9486(0x134)](_0xc42346[_0x1d9486(0x1b3)]);}}}}for(const _0xce8abb of _0x28c0cd){try{const _0x5e32f6=await this[_0x1d9486(0x1cd)][_0x1d9486(0x1b7)]({'projectId':_0x1920b4,'name':_0xce8abb});_0x1ec9db[_0x1d9486(0x100)](_0xce8abb,_0x5e32f6['id']),_0x4bfb66[_0x1d9486(0x12c)][_0x1d9486(0x102)]({'name':_0xce8abb,'action':_0x1d9486(0xdb),'id':_0x5e32f6['id']}),_0x4bfb66['counts'][_0x1d9486(0x12c)][_0x1d9486(0xdb)]++;}catch(_0x10a4bc){_0x4bfb66[_0x1d9486(0x12c)][_0x1d9486(0x102)]({'name':_0xce8abb,'action':_0x1d9486(0xe4),'error':_0x10a4bc[_0x1d9486(0x12b)]}),_0x4bfb66['counts'][_0x1d9486(0x12c)][_0x1d9486(0x115)]++;}}for(const _0x279b49 of _0x499a72){try{const _0x436b44=await this[_0x1d9486(0x1cd)][_0x1d9486(0x159)]({'projectId':_0x1920b4,'name':_0x279b49});_0x31b986[_0x1d9486(0x100)](_0x279b49,_0x436b44['id']),_0x4bfb66[_0x1d9486(0x1b9)][_0x1d9486(0x102)]({'name':_0x279b49,'action':_0x1d9486(0xdb),'id':_0x436b44['id']}),_0x4bfb66['counts'][_0x1d9486(0x1b9)][_0x1d9486(0xdb)]++;}catch(_0x31c1a3){_0x4bfb66[_0x1d9486(0x1b9)][_0x1d9486(0x102)]({'name':_0x279b49,'action':'error','error':_0x31c1a3[_0x1d9486(0x12b)]}),_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0x1b9)]['errors']++;}}const _0x591e8f=await fetchAllToolTargetMaps((_0x668be7,_0x31b5eb)=>this[_0x1d9486(0x1cd)][_0x1d9486(0x1c9)](_0x668be7,_0x31b5eb),_0x1920b4);let _0x557ba5=[];const _0x2334ae={'projectId':_0x1920b4,'resolveToolTargetId':buildIdResolver({..._0x591e8f[_0x1d9486(0x17f)],'KnowledgeBase':_0x213990,'TextKnowledgeBase':_0x82f70c,'ExperimentalKnowledgeBase':_0x408321,'Agent':_0x1c937c,'WebSearchTool':_0x31b986,'ImageGenerator':_0x1ec9db}),'resolvePromptId':async _0x311f6f=>_0x443e8d['get'](_0x311f6f),'onWarning':_0x49742d=>{const _0x8fdb20=_0x1d9486;this[_0x8fdb20(0x187)][_0x8fdb20(0xeb)](_0x49742d),_0x557ba5[_0x8fdb20(0x102)](_0x49742d);}};for(const _0x305fe0 of _0x453446){try{const _0x3ef990=yamlKnowledgeBaseToApi(_0x305fe0[_0x1d9486(0xfa)],_0x1920b4),_0xa8885a=await this['client'][_0x1d9486(0x17c)](_0x3ef990);_0x213990['set'](_0x305fe0[_0x1d9486(0xfa)][_0x1d9486(0x1b3)],_0xa8885a['id']),_0x4bfb66[_0x1d9486(0x185)][_0x1d9486(0x102)]({'name':_0x305fe0['yaml']['name'],'action':_0x1d9486(0xdb),'id':_0xa8885a['id']}),_0x4bfb66['counts']['knowledgeBases'][_0x1d9486(0xdb)]++;}catch(_0x23c113){_0x4bfb66['knowledgeBases'][_0x1d9486(0x102)]({'name':_0x305fe0['yaml']['name'],'action':_0x1d9486(0xe4),'error':_0x23c113[_0x1d9486(0x12b)]}),_0x4bfb66['counts']['knowledgeBases']['errors']++;}}for(const _0xf9e0b0 of _0x3bcac6){try{const _0x2d4b04=yamlTextKnowledgeBaseToApi({'name':_0xf9e0b0[_0x1d9486(0x1b3)],'text':_0xf9e0b0[_0x1d9486(0xd3)]},_0x1920b4),_0x4ffad6=await this['client'][_0x1d9486(0xe6)](_0x2d4b04);_0x82f70c[_0x1d9486(0x100)](_0xf9e0b0[_0x1d9486(0x1b3)],_0x4ffad6['id']),_0x4bfb66['textKnowledgeBases'][_0x1d9486(0x102)]({'name':_0xf9e0b0[_0x1d9486(0x1b3)],'action':_0x1d9486(0xdb),'id':_0x4ffad6['id']}),_0x4bfb66['counts'][_0x1d9486(0x111)][_0x1d9486(0xdb)]++;}catch(_0x4d2d32){_0x4bfb66[_0x1d9486(0x111)][_0x1d9486(0x102)]({'name':_0xf9e0b0[_0x1d9486(0x1b3)],'action':_0x1d9486(0xe4),'error':_0x4d2d32['message']}),_0x4bfb66['counts'][_0x1d9486(0x111)][_0x1d9486(0x115)]++;}}for(const _0x2eb782 of _0xf83fb5){try{const _0x5d8f9a=yamlExperimentalArtifactToApi(_0x2eb782['def'],_0x1920b4),_0x13b3d4=await this[_0x1d9486(0x1cd)][_0x1d9486(0x19e)](_0x5d8f9a);_0x84bf93[_0x1d9486(0x100)](_0x2eb782[_0x1d9486(0xf6)][_0x1d9486(0x1b3)],_0x13b3d4['id']),_0x4bfb66[_0x1d9486(0x1a3)]['push']({'name':_0x2eb782[_0x1d9486(0xf6)][_0x1d9486(0x1b3)],'action':_0x1d9486(0xdb),'id':_0x13b3d4['id']}),_0x4bfb66[_0x1d9486(0x1b5)]['experimentalArtifacts'][_0x1d9486(0xdb)]++;}catch(_0x24f118){_0x4bfb66['experimentalArtifacts'][_0x1d9486(0x102)]({'name':_0x2eb782[_0x1d9486(0xf6)][_0x1d9486(0x1b3)],'action':_0x1d9486(0xe4),'error':_0x24f118['message']}),_0x4bfb66['counts'][_0x1d9486(0x1a3)]['errors']++;}}for(const _0x93d477 of _0x2da978){try{const _0x2b9a99=yamlExperimentalKnowledgeBaseToApi(_0x93d477[_0x1d9486(0xf6)],_0x1920b4),_0x13454a=await this['client'][_0x1d9486(0xf3)](_0x2b9a99);_0x408321['set'](_0x93d477[_0x1d9486(0xf6)][_0x1d9486(0x1b3)],_0x13454a['id']),_0x4bfb66['experimentalKnowledgeBases'][_0x1d9486(0x102)]({'name':_0x93d477[_0x1d9486(0xf6)][_0x1d9486(0x1b3)],'action':'created','id':_0x13454a['id']}),_0x4bfb66['counts'][_0x1d9486(0x183)][_0x1d9486(0xdb)]++;}catch(_0x29f2a0){_0x4bfb66[_0x1d9486(0x183)][_0x1d9486(0x102)]({'name':_0x93d477['def'][_0x1d9486(0x1b3)],'action':'error','error':_0x29f2a0[_0x1d9486(0x12b)]}),_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0x183)]['errors']++;}}const _0x4042a7=[..._0x5d0a3e][_0x1d9486(0x12d)]((_0xaf3af7,_0x18f309)=>{const _0xaecaf6=_0x1d9486,_0x86c6af=_0xaf3af7['yaml']['tools']?.['some'](_0xf22625=>_0xf22625[_0xaecaf6(0x1a5)]===_0xaecaf6(0xb6))??![],_0x1d4d00=_0x18f309[_0xaecaf6(0xfa)][_0xaecaf6(0x1a7)]?.['some'](_0x132125=>_0x132125[_0xaecaf6(0x1a5)]===_0xaecaf6(0xb6))??![];if(_0x86c6af&&!_0x1d4d00)return 0x1;if(!_0x86c6af&&_0x1d4d00)return-0x1;return 0x0;});for(const _0x440ee6 of _0x4042a7){_0x557ba5=[];try{const _0x3e52e4=_0x440ee6[_0x1d9486(0xfa)][_0x1d9486(0x1a7)]?.[_0x1d9486(0x190)](_0x31da67=>{const _0x8bcbb2=_0x1d9486;if(_0x31da67['type']===_0x8bcbb2(0xb6)&&_0x31da67['target']){const _0x22964d=parseRef(_0x31da67[_0x8bcbb2(0x154)]);return _0x22964d?.['name']===_0x440ee6[_0x8bcbb2(0xfa)][_0x8bcbb2(0x1b3)];}return![];})??[];if(_0x3e52e4[_0x1d9486(0xf2)]>0x0){const _0x194e7a=_0x1d9486(0x1c5)+_0x440ee6[_0x1d9486(0xfa)][_0x1d9486(0x1b3)]+_0x1d9486(0x171)+'Re-add\x20them\x20after\x20clone\x20using\x20\x27tdx\x20agent\x20push\x27.';this['logger']['warn'](_0x194e7a),_0x557ba5['push'](_0x194e7a);}const _0x1eb537=await agentDefToRequest(_0x440ee6[_0x1d9486(0xfa)],_0x440ee6[_0x1d9486(0xce)],_0x440ee6[_0x1d9486(0x1c1)],_0x2334ae),_0x34e347=await this['client'][_0x1d9486(0xcd)](_0x1eb537);_0x1c937c['set'](_0x440ee6[_0x1d9486(0xfa)][_0x1d9486(0x1b3)],_0x34e347['id']),_0x4bfb66['agents']['push']({'agentName':_0x440ee6[_0x1d9486(0xfa)][_0x1d9486(0x1b3)],'action':_0x1d9486(0xdb),'agentId':_0x34e347['id'],'warnings':_0x557ba5[_0x1d9486(0xf2)]>0x0?_0x557ba5:undefined}),_0x4bfb66[_0x1d9486(0x1b5)]['agents']['created']++;}catch(_0x1a257a){_0x4bfb66[_0x1d9486(0xd6)][_0x1d9486(0x102)]({'agentName':_0x440ee6['yaml'][_0x1d9486(0x1b3)],'action':'error','error':_0x1a257a[_0x1d9486(0x12b)],'warnings':_0x557ba5['length']>0x0?_0x557ba5:undefined}),_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0xd6)][_0x1d9486(0x115)]++;}}for(const _0x531387 of _0x122f6f){try{const _0x65d0f2=await yamlPromptToApi(_0x531387['yaml'],_0x1920b4,_0x2334ae);if(!_0x65d0f2){_0x4bfb66[_0x1d9486(0x16c)][_0x1d9486(0x102)]({'name':_0x531387[_0x1d9486(0xfa)][_0x1d9486(0x1b3)],'action':_0x1d9486(0xe4),'error':_0x1d9486(0x17b)}),_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0x16c)][_0x1d9486(0x115)]++;continue;}const _0xafca7a=await this['client'][_0x1d9486(0xd0)](_0x65d0f2);_0x443e8d[_0x1d9486(0x100)](_0x531387[_0x1d9486(0xfa)]['name'],_0xafca7a['id']),_0x4bfb66['prompts'][_0x1d9486(0x102)]({'name':_0x531387[_0x1d9486(0xfa)][_0x1d9486(0x1b3)],'action':_0x1d9486(0xdb),'id':_0xafca7a['id']}),_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0x16c)][_0x1d9486(0xdb)]++;}catch(_0x28e59c){_0x4bfb66[_0x1d9486(0x16c)][_0x1d9486(0x102)]({'name':_0x531387[_0x1d9486(0xfa)][_0x1d9486(0x1b3)],'action':'error','error':_0x28e59c[_0x1d9486(0x12b)]}),_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0x16c)][_0x1d9486(0x115)]++;}}for(const _0x4a2d90 of _0x42baca){try{const _0x50bc4e=await yamlIntegrationToApi(_0x4a2d90[_0x1d9486(0xfa)],_0x1920b4,_0x2334ae),_0x2dd81c=await this[_0x1d9486(0x1cd)][_0x1d9486(0x17e)](_0x50bc4e);_0x4bfb66[_0x1d9486(0xc8)][_0x1d9486(0x102)]({'name':_0x4a2d90['yaml']['service_type'],'action':_0x1d9486(0xdb),'id':_0x2dd81c['id']}),_0x4bfb66[_0x1d9486(0x1b5)][_0x1d9486(0xc8)][_0x1d9486(0xdb)]++;}catch(_0x4c09f3){_0x4bfb66[_0x1d9486(0xc8)][_0x1d9486(0x102)]({'name':_0x4a2d90[_0x1d9486(0xfa)]['service_type'],'action':_0x1d9486(0xe4),'error':_0x4c09f3[_0x1d9486(0x12b)]}),_0x4bfb66[_0x1d9486(0x1b5)]['integrations'][_0x1d9486(0x115)]++;}}return _0x4bfb66;}}
@@ -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);}
1
+ function a124_0x2a9b(){const _0xfbe630=['40563bWtwWf','attributes','6288725PHazGq','8360592yyHYFm','tools','374290nDbiBQ','map','get','3624222uLbRNi','4880DfbpdA','22556xFTirH','targetKnowledgeBaseId','7529800ayccrZ','targetAgentId','324WEAgql','4pGcOIP'];a124_0x2a9b=function(){return _0xfbe630;};return a124_0x2a9b();}(function(_0x185703,_0x59b9ab){const _0x393a64=a124_0x1ae6,_0xbcfe74=_0x185703();while(!![]){try{const _0xb0a192=parseInt(_0x393a64(0x172))/0x1*(-parseInt(_0x393a64(0x168))/0x2)+-parseInt(_0x393a64(0x171))/0x3*(-parseInt(_0x393a64(0x16d))/0x4)+-parseInt(_0x393a64(0x175))/0x5+parseInt(_0x393a64(0x176))/0x6+-parseInt(_0x393a64(0x16b))/0x7+-parseInt(_0x393a64(0x16f))/0x8+-parseInt(_0x393a64(0x173))/0x9*(-parseInt(_0x393a64(0x16c))/0xa);if(_0xb0a192===_0x59b9ab)break;else _0xbcfe74['push'](_0xbcfe74['shift']());}catch(_0x1726cf){_0xbcfe74['push'](_0xbcfe74['shift']());}}}(a124_0x2a9b,0xb3d34));export function canCreateAgent(_0x3473c7,_0x4f9c2d){const _0x4a3126=a124_0x1ae6;for(const _0x52bd25 of _0x3473c7[_0x4a3126(0x174)][_0x4a3126(0x167)]){if(_0x52bd25[_0x4a3126(0x170)]&&!_0x4f9c2d['has'](_0x52bd25[_0x4a3126(0x170)]))return![];}return!![];}function a124_0x1ae6(_0x466106,_0x57df77){_0x466106=_0x466106-0x167;const _0x2a9b0a=a124_0x2a9b();let _0x1ae6d5=_0x2a9b0a[_0x466106];return _0x1ae6d5;}export function remapToolIds(_0x7a9b61,_0x27a732,_0x462661){const _0xfa11d=a124_0x1ae6;return _0x7a9b61[_0xfa11d(0x169)](_0x56a104=>({..._0x56a104,'targetKnowledgeBaseId':_0x56a104[_0xfa11d(0x16e)]?_0x27a732[_0xfa11d(0x16a)](_0x56a104[_0xfa11d(0x16e)])||_0x56a104[_0xfa11d(0x16e)]:undefined,'targetAgentId':_0x56a104[_0xfa11d(0x170)]?_0x462661['get'](_0x56a104[_0xfa11d(0x170)])||_0x56a104['targetAgentId']:undefined}));}export function remapVariableIds(_0x1465fe,_0x39c6bf){const _0x1a047b=a124_0x1ae6;return _0x1465fe[_0x1a047b(0x169)](_0x1599c1=>({..._0x1599c1,'targetKnowledgeBaseId':_0x39c6bf[_0x1a047b(0x16a)](_0x1599c1[_0x1a047b(0x16e)])||_0x1599c1['targetKnowledgeBaseId']}));}export function isSupportedBackupVersion(_0xcfe548){return _0xcfe548==='1.0';}