@stkxp/cli 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/README.md +273 -0
  2. package/bin/stkxp.mjs +198 -0
  3. package/package.json +97 -0
  4. package/src/bootstrap.mjs +37 -0
  5. package/src/bootstrap.test.mjs +73 -0
  6. package/src/deploy.mjs +145 -0
  7. package/src/deploy.test.mjs +131 -0
  8. package/src/export.mjs +30 -0
  9. package/src/export.test.mjs +56 -0
  10. package/src/secret-input.mjs +64 -0
  11. package/src/secret-input.test.mjs +58 -0
  12. package/src/serve.mjs +83 -0
  13. package/src/serve.test.mjs +93 -0
  14. package/vendor/dist-server/asyncapi/generator.js +1 -0
  15. package/vendor/dist-server/asyncapi/messages.js +1 -0
  16. package/vendor/dist-server/asyncapi/viewer.html +43 -0
  17. package/vendor/dist-server/core/app-config/branding.js +1 -0
  18. package/vendor/dist-server/core/app-config/mantine-theme.js +1 -0
  19. package/vendor/dist-server/core/app-config/mermaid-theme.js +2 -0
  20. package/vendor/dist-server/core/app-config/prompt-optimization.js +1 -0
  21. package/vendor/dist-server/core/app-config/settings.js +1 -0
  22. package/vendor/dist-server/core/config.js +1 -0
  23. package/vendor/dist-server/core/graph/a2a-agent-executor.js +2 -0
  24. package/vendor/dist-server/core/graph/app.js +120 -0
  25. package/vendor/dist-server/core/graph/delegated-agent-adapter.js +1 -0
  26. package/vendor/dist-server/core/graph/graph-builder.js +3 -0
  27. package/vendor/dist-server/core/graph/kibana-agent-executor.js +1 -0
  28. package/vendor/dist-server/core/graph/nodes/context/assistants-context.js +5 -0
  29. package/vendor/dist-server/core/graph/nodes/context/compare-context.js +10 -0
  30. package/vendor/dist-server/core/graph/nodes/context/enrich-context.js +8 -0
  31. package/vendor/dist-server/core/graph/nodes/context/inventory-context.js +4 -0
  32. package/vendor/dist-server/core/graph/nodes/context/namespace-context.js +2 -0
  33. package/vendor/dist-server/core/graph/nodes/context/node-types-context.js +4 -0
  34. package/vendor/dist-server/core/graph/nodes/context/relevant-assistants-context.js +5 -0
  35. package/vendor/dist-server/core/graph/nodes/context/relevant-skills-context.js +5 -0
  36. package/vendor/dist-server/core/graph/nodes/context/skills-context.js +8 -0
  37. package/vendor/dist-server/core/graph/nodes/context/state-setter.js +1 -0
  38. package/vendor/dist-server/core/graph/nodes/control/check-reset.js +1 -0
  39. package/vendor/dist-server/core/graph/nodes/control/topic-detection.js +1 -0
  40. package/vendor/dist-server/core/graph/nodes/governance/human-approval.js +16 -0
  41. package/vendor/dist-server/core/graph/nodes/index.js +1 -0
  42. package/vendor/dist-server/core/graph/nodes/orchestration/suggestion-generator.js +17 -0
  43. package/vendor/dist-server/core/graph/nodes/orchestration/team-decider.js +1 -0
  44. package/vendor/dist-server/core/graph/nodes/orchestration/team-execution/decider-error.js +4 -0
  45. package/vendor/dist-server/core/graph/nodes/orchestration/team-execution/decider-standalone-runner.js +1 -0
  46. package/vendor/dist-server/core/graph/nodes/orchestration/team-execution/decider-synthesis.js +29 -0
  47. package/vendor/dist-server/core/graph/nodes/orchestration/team-execution/pipeline-memory.js +2 -0
  48. package/vendor/dist-server/core/graph/nodes/orchestration/team-execution/pipeline-runner.js +7 -0
  49. package/vendor/dist-server/core/graph/nodes/orchestration/team-execution/team-assistant-utils.js +1 -0
  50. package/vendor/dist-server/core/graph/nodes/orchestration/team-finder.js +13 -0
  51. package/vendor/dist-server/core/graph/nodes/orchestration/team-invoker.js +3 -0
  52. package/vendor/dist-server/core/graph/nodes/orchestration/team-parallel.js +1 -0
  53. package/vendor/dist-server/core/graph/nodes/orchestration/team-pipeline.js +6 -0
  54. package/vendor/dist-server/core/graph/nodes/orchestration/team-router.js +26 -0
  55. package/vendor/dist-server/core/graph/nodes/reasoning/code-executor/index.js +6 -0
  56. package/vendor/dist-server/core/graph/nodes/reasoning/code-executor/resource-bridge.js +2 -0
  57. package/vendor/dist-server/core/graph/nodes/reasoning/code-executor/sandbox.js +6 -0
  58. package/vendor/dist-server/core/graph/nodes/reasoning/code-executor/tool-bridge.js +1 -0
  59. package/vendor/dist-server/core/graph/nodes/reasoning/local-extractor.js +5 -0
  60. package/vendor/dist-server/core/graph/nodes/reasoning/response-generator.js +47 -0
  61. package/vendor/dist-server/core/graph/nodes/reasoning/static-code-executor/index.js +1 -0
  62. package/vendor/dist-server/core/graph/nodes/reasoning/system.js +54 -0
  63. package/vendor/dist-server/core/graph/nodes/reasoning/tool-executor.js +9 -0
  64. package/vendor/dist-server/core/graph/nodes/tools/raw-output.js +4 -0
  65. package/vendor/dist-server/core/graph/nodes/tools/tool-cleaner.js +7 -0
  66. package/vendor/dist-server/core/graph/nodes/tools/tool-execution/execute-tool-calls.js +3 -0
  67. package/vendor/dist-server/core/graph/nodes/tools/tool-execution/invoke.js +1 -0
  68. package/vendor/dist-server/core/graph/nodes/tools/tool-execution/namespace-guard.js +1 -0
  69. package/vendor/dist-server/core/graph/nodes/tools/tool-execution/result-limits.js +3 -0
  70. package/vendor/dist-server/core/graph/nodes/tools/tool-invoker.js +1 -0
  71. package/vendor/dist-server/core/graph/nodes/tools/tool.js +4 -0
  72. package/vendor/dist-server/core/graph/schemas.js +1 -0
  73. package/vendor/dist-server/core/graph/topic-variants.js +1 -0
  74. package/vendor/dist-server/core/graph/types.js +1 -0
  75. package/vendor/dist-server/core/graph/utils/content-utils.js +17 -0
  76. package/vendor/dist-server/core/graph/utils/edge-jsonata-condition.js +1 -0
  77. package/vendor/dist-server/core/graph/utils/engine-vars.js +1 -0
  78. package/vendor/dist-server/core/graph/utils/logging-utils.js +4 -0
  79. package/vendor/dist-server/core/graph/utils/message-utils.js +5 -0
  80. package/vendor/dist-server/core/graph/utils/node-type-defaults-cache.js +1 -0
  81. package/vendor/dist-server/core/graph/utils/sandbox-catalog.js +1 -0
  82. package/vendor/dist-server/core/graph/utils/schema-utils.js +1 -0
  83. package/vendor/dist-server/core/graph/utils/team-context-policy.js +5 -0
  84. package/vendor/dist-server/core/graph/utils/team-node-resolvers.js +1 -0
  85. package/vendor/dist-server/core/graph/utils/tool-result.js +4 -0
  86. package/vendor/dist-server/core/graph/utils/tool-wrapper.js +14 -0
  87. package/vendor/dist-server/core/llm/init-indices.js +1 -0
  88. package/vendor/dist-server/core/llm/models/index.js +1 -0
  89. package/vendor/dist-server/core/llm/models/model.model.js +1 -0
  90. package/vendor/dist-server/core/llm/models/provider.model.js +1 -0
  91. package/vendor/dist-server/core/llm/models/routing-rule.model.js +1 -0
  92. package/vendor/dist-server/core/llm/providers.js +1 -0
  93. package/vendor/dist-server/core/mcp/client.js +1 -0
  94. package/vendor/dist-server/core/runtime/active-runs-registry.js +1 -0
  95. package/vendor/dist-server/core/runtime/system-prompt-cache.js +1 -0
  96. package/vendor/dist-server/core/runtime/trace-bus.js +1 -0
  97. package/vendor/dist-server/core/schema/cluster_health_report.js +1 -0
  98. package/vendor/dist-server/core/schema/cluster_info.js +1 -0
  99. package/vendor/dist-server/core/schema/cluster_license.js +5 -0
  100. package/vendor/dist-server/core/schema/cluster_stats.js +12 -0
  101. package/vendor/dist-server/core/schema/dashboard.js +1 -0
  102. package/vendor/dist-server/core/schema/indices_settings.js +1 -0
  103. package/vendor/dist-server/core/schema/indices_shards.js +1 -0
  104. package/vendor/dist-server/core/schema/indices_stats.js +1 -0
  105. package/vendor/dist-server/core/schema/nodes_info.js +2 -0
  106. package/vendor/dist-server/core/schema/nodes_stats.js +11 -0
  107. package/vendor/dist-server/core/schema/pricing.js +1 -0
  108. package/vendor/dist-server/core/schema/ui.js +1 -0
  109. package/vendor/dist-server/core/schema/zod_client.js +83 -0
  110. package/vendor/dist-server/core/services/a2a-client.js +2 -0
  111. package/vendor/dist-server/core/services/alerts-service.js +1 -0
  112. package/vendor/dist-server/core/services/api-keys-service.js +1 -0
  113. package/vendor/dist-server/core/services/assistant-resolver.js +1 -0
  114. package/vendor/dist-server/core/services/assistants-index-service.js +1 -0
  115. package/vendor/dist-server/core/services/async-conversations-service.js +22 -0
  116. package/vendor/dist-server/core/services/asyncapi-dispatch.js +1 -0
  117. package/vendor/dist-server/core/services/asyncapi-drivers/driver-manager.js +1 -0
  118. package/vendor/dist-server/core/services/asyncapi-drivers/driver-types.js +0 -0
  119. package/vendor/dist-server/core/services/asyncapi-drivers/http-driver.js +1 -0
  120. package/vendor/dist-server/core/services/asyncapi-drivers/nats-driver.js +1 -0
  121. package/vendor/dist-server/core/services/asyncapi-drivers/websocket-driver.js +1 -0
  122. package/vendor/dist-server/core/services/asyncapi-events-service.js +1 -0
  123. package/vendor/dist-server/core/services/asyncapi-reply-service.js +1 -0
  124. package/vendor/dist-server/core/services/asyncapi-sink.js +1 -0
  125. package/vendor/dist-server/core/services/asyncapi-tools-service.js +1 -0
  126. package/vendor/dist-server/core/services/block-repair-service.js +13 -0
  127. package/vendor/dist-server/core/services/chart-renderer.js +1 -0
  128. package/vendor/dist-server/core/services/chat-llms-service.js +1 -0
  129. package/vendor/dist-server/core/services/chat-runs-service.js +1 -0
  130. package/vendor/dist-server/core/services/chat-tools-service.js +1 -0
  131. package/vendor/dist-server/core/services/chat-traces-service.js +1 -0
  132. package/vendor/dist-server/core/services/chats-service.js +5 -0
  133. package/vendor/dist-server/core/services/comparison-service.js +107 -0
  134. package/vendor/dist-server/core/services/default-model.service.js +1 -0
  135. package/vendor/dist-server/core/services/elastic-stack-sync-service.js +2 -0
  136. package/vendor/dist-server/core/services/elasticsearch-wrapper.js +1 -0
  137. package/vendor/dist-server/core/services/embed-rate-limiter.js +1 -0
  138. package/vendor/dist-server/core/services/error-analytics-service.js +1 -0
  139. package/vendor/dist-server/core/services/es-field-resolver.js +1 -0
  140. package/vendor/dist-server/core/services/gateway-platform-types.js +1 -0
  141. package/vendor/dist-server/core/services/gliner-tagging-service.js +1 -0
  142. package/vendor/dist-server/core/services/golden-questions-scoring.js +1 -0
  143. package/vendor/dist-server/core/services/golden-questions-service.js +1 -0
  144. package/vendor/dist-server/core/services/graph-drilldown-service.js +1 -0
  145. package/vendor/dist-server/core/services/graph-registry-service.js +1 -0
  146. package/vendor/dist-server/core/services/hitl-analytics-service.js +1 -0
  147. package/vendor/dist-server/core/services/ingestion-jobs-service.js +1 -0
  148. package/vendor/dist-server/core/services/ingestion-service.js +5 -0
  149. package/vendor/dist-server/core/services/kibana-client-factory.js +1 -0
  150. package/vendor/dist-server/core/services/kibana-client.js +2 -0
  151. package/vendor/dist-server/core/services/kibana-dashboard-extractor.js +1 -0
  152. package/vendor/dist-server/core/services/kibana-service.js +1 -0
  153. package/vendor/dist-server/core/services/llm-analytics-service.js +1 -0
  154. package/vendor/dist-server/core/services/llm-client-resolver.js +1 -0
  155. package/vendor/dist-server/core/services/llm-models-service.js +1 -0
  156. package/vendor/dist-server/core/services/llm-pricing-pure.js +1 -0
  157. package/vendor/dist-server/core/services/llm-pricing-service.js +1 -0
  158. package/vendor/dist-server/core/services/llm-providers-service.js +1 -0
  159. package/vendor/dist-server/core/services/llm-routing-service.js +1 -0
  160. package/vendor/dist-server/core/services/llm-services.js +1 -0
  161. package/vendor/dist-server/core/services/llm-sync-service.js +1 -0
  162. package/vendor/dist-server/core/services/manifest-loader.js +1 -0
  163. package/vendor/dist-server/core/services/mcp-servers-service.js +1 -0
  164. package/vendor/dist-server/core/services/mcp-sync-service.js +1 -0
  165. package/vendor/dist-server/core/services/mcp-tools-service.js +1 -0
  166. package/vendor/dist-server/core/services/memories-service.js +2 -0
  167. package/vendor/dist-server/core/services/memory-analytics-service.js +1 -0
  168. package/vendor/dist-server/core/services/monitoring-analytics-service.js +1 -0
  169. package/vendor/dist-server/core/services/monitoring-service.js +1 -0
  170. package/vendor/dist-server/core/services/multi-kibana-service.js +1 -0
  171. package/vendor/dist-server/core/services/node-latency-service.js +1 -0
  172. package/vendor/dist-server/core/services/package-policy-service.js +2 -0
  173. package/vendor/dist-server/core/services/pdf-service.js +572 -0
  174. package/vendor/dist-server/core/services/plan-service.js +1 -0
  175. package/vendor/dist-server/core/services/platform-direction.js +1 -0
  176. package/vendor/dist-server/core/services/platform-secrets.js +1 -0
  177. package/vendor/dist-server/core/services/platforms-service.js +1 -0
  178. package/vendor/dist-server/core/services/policy-factory.js +1 -0
  179. package/vendor/dist-server/core/services/prompt-cache-service.js +1 -0
  180. package/vendor/dist-server/core/services/provider-rate-limits.js +1 -0
  181. package/vendor/dist-server/core/services/quota-service.js +1 -0
  182. package/vendor/dist-server/core/services/report-assets-service.js +1 -0
  183. package/vendor/dist-server/core/services/run-analytics-collector.js +1 -0
  184. package/vendor/dist-server/core/services/run-stream-sink.js +1 -0
  185. package/vendor/dist-server/core/services/send_mail.js +460 -0
  186. package/vendor/dist-server/core/services/share-service.js +1 -0
  187. package/vendor/dist-server/core/services/slack-signature.js +1 -0
  188. package/vendor/dist-server/core/services/sources-service.js +6 -0
  189. package/vendor/dist-server/core/services/team-mcp-result.js +4 -0
  190. package/vendor/dist-server/core/services/team-mcp-run-tokens.js +1 -0
  191. package/vendor/dist-server/core/services/team-mcp-runner.js +1 -0
  192. package/vendor/dist-server/core/services/team-mcp-server.js +1 -0
  193. package/vendor/dist-server/core/services/team-mcp-tools.js +1 -0
  194. package/vendor/dist-server/core/services/team-mcp-ui.js +551 -0
  195. package/vendor/dist-server/core/services/team-run-progress.js +1 -0
  196. package/vendor/dist-server/core/services/team-runner-headless.js +7 -0
  197. package/vendor/dist-server/core/services/team-search-service.js +1 -0
  198. package/vendor/dist-server/core/services/teams-service.js +1 -0
  199. package/vendor/dist-server/core/services/token-projection-service.js +1 -0
  200. package/vendor/dist-server/core/services/tool-analytics-service.js +1 -0
  201. package/vendor/dist-server/core/services/tool-history-service.js +1 -0
  202. package/vendor/dist-server/core/services/tool-metrics-service.js +1 -0
  203. package/vendor/dist-server/core/services/tool-scoring.js +1 -0
  204. package/vendor/dist-server/core/services/toolbox-import-mappers.js +1 -0
  205. package/vendor/dist-server/core/services/toolbox-import-service.js +1 -0
  206. package/vendor/dist-server/core/services/trigger-service.js +1 -0
  207. package/vendor/dist-server/core/services/version-snapshot-service.js +1 -0
  208. package/vendor/dist-server/core/services/webhook-calls-service.js +1 -0
  209. package/vendor/dist-server/core/tools/compare-chat.js +46 -0
  210. package/vendor/dist-server/core/tools/enrich-chat.js +50 -0
  211. package/vendor/dist-server/core/tools/variable-encoding.js +1 -0
  212. package/vendor/dist-server/core/types/settings.js +1 -0
  213. package/vendor/dist-server/core/utils/ab-evaluator.js +5 -0
  214. package/vendor/dist-server/core/utils/condition-evaluator.js +1 -0
  215. package/vendor/dist-server/core/utils/http-client.js +1 -0
  216. package/vendor/dist-server/core/utils/json-schema-to-form.js +1 -0
  217. package/vendor/dist-server/core/utils/logger.js +3 -0
  218. package/vendor/dist-server/core/utils/owner-scope.js +1 -0
  219. package/vendor/dist-server/core/utils/ownership.js +1 -0
  220. package/vendor/dist-server/core/utils/parallel-tool-executor.js +1 -0
  221. package/vendor/dist-server/core/utils/performance-tracker.js +3 -0
  222. package/vendor/dist-server/core/utils/prompt-optimizer.js +40 -0
  223. package/vendor/dist-server/core/utils/response-cache.js +1 -0
  224. package/vendor/dist-server/core/utils/schema-validator.js +1 -0
  225. package/vendor/dist-server/core/utils/streaming-optimizer.js +2 -0
  226. package/vendor/dist-server/core/utils/string-helpers.js +1 -0
  227. package/vendor/dist-server/core/utils/test-responses.js +9 -0
  228. package/vendor/dist-server/core/utils/text-utils.js +1 -0
  229. package/vendor/dist-server/core/utils/tool-form-trigger.js +1 -0
  230. package/vendor/dist-server/entrypoints/cli-bootstrap-run.js +1 -0
  231. package/vendor/dist-server/entrypoints/cli-deploy-run.js +1 -0
  232. package/vendor/dist-server/entrypoints/cli-deploy.js +1 -0
  233. package/vendor/dist-server/entrypoints/team-runner.js +1 -0
  234. package/vendor/dist-server/generated/toolbox-catalog.js +1 -0
  235. package/vendor/dist-server/index.js +2 -0
  236. package/vendor/dist-server/middleware/integration-logos.js +1 -0
  237. package/vendor/dist-server/middleware/plan-guard.js +1 -0
  238. package/vendor/dist-server/openapi/generator.js +1 -0
  239. package/vendor/dist-server/openapi/html-tool-spec.js +1 -0
  240. package/vendor/dist-server/routes/a2a-routes.js +1 -0
  241. package/vendor/dist-server/routes/a2a-server-routes.js +5 -0
  242. package/vendor/dist-server/routes/admin.js +1 -0
  243. package/vendor/dist-server/routes/assistants-routes.js +1 -0
  244. package/vendor/dist-server/routes/asyncapi-routes.js +1 -0
  245. package/vendor/dist-server/routes/auth.js +1 -0
  246. package/vendor/dist-server/routes/billing-routes.js +1 -0
  247. package/vendor/dist-server/routes/chat-llms.js +1 -0
  248. package/vendor/dist-server/routes/chat-tools.js +1 -0
  249. package/vendor/dist-server/routes/chat-traces.js +1 -0
  250. package/vendor/dist-server/routes/chats.js +1 -0
  251. package/vendor/dist-server/routes/clusters.js +1 -0
  252. package/vendor/dist-server/routes/compare.js +43 -0
  253. package/vendor/dist-server/routes/connectors-routes.js +1 -0
  254. package/vendor/dist-server/routes/consumptions-routes.js +1 -0
  255. package/vendor/dist-server/routes/data-admin-routes.js +1 -0
  256. package/vendor/dist-server/routes/data-transfer-routes.js +1 -0
  257. package/vendor/dist-server/routes/elastic-tool-execution-routes.js +1 -0
  258. package/vendor/dist-server/routes/geo-proxy-routes.js +1 -0
  259. package/vendor/dist-server/routes/golden-questions-routes.js +1 -0
  260. package/vendor/dist-server/routes/graph-registry.js +1 -0
  261. package/vendor/dist-server/routes/graph-templates-routes.js +1 -0
  262. package/vendor/dist-server/routes/helpdesk-routes.js +35 -0
  263. package/vendor/dist-server/routes/html-routes.js +1 -0
  264. package/vendor/dist-server/routes/index.js +1 -0
  265. package/vendor/dist-server/routes/indices.js +1 -0
  266. package/vendor/dist-server/routes/integrations-routes.js +1 -0
  267. package/vendor/dist-server/routes/langgraph.js +7 -0
  268. package/vendor/dist-server/routes/live-resources-routes.js +1 -0
  269. package/vendor/dist-server/routes/llm-analytics.js +1 -0
  270. package/vendor/dist-server/routes/llm-control-plane.js +1 -0
  271. package/vendor/dist-server/routes/llm.js +1 -0
  272. package/vendor/dist-server/routes/mcp-gateway-routes.js +1 -0
  273. package/vendor/dist-server/routes/mcp-query-routes.js +1 -0
  274. package/vendor/dist-server/routes/mcp-servers-routes.js +1 -0
  275. package/vendor/dist-server/routes/mcp-team-routes.js +1 -0
  276. package/vendor/dist-server/routes/mcp-tools-routes.js +1 -0
  277. package/vendor/dist-server/routes/me-routes.js +63 -0
  278. package/vendor/dist-server/routes/memories-routes.js +1 -0
  279. package/vendor/dist-server/routes/monitoring-analytics.js +12 -0
  280. package/vendor/dist-server/routes/monitoring.js +1 -0
  281. package/vendor/dist-server/routes/node-types-routes.js +171 -0
  282. package/vendor/dist-server/routes/nodes.js +1 -0
  283. package/vendor/dist-server/routes/packages.js +1 -0
  284. package/vendor/dist-server/routes/pdf.js +3 -0
  285. package/vendor/dist-server/routes/plan-routes.js +1 -0
  286. package/vendor/dist-server/routes/platform-requests-routes.js +1 -0
  287. package/vendor/dist-server/routes/platforms-routes.js +1 -0
  288. package/vendor/dist-server/routes/prompts-routes.js +1 -0
  289. package/vendor/dist-server/routes/proxy-logos.js +1 -0
  290. package/vendor/dist-server/routes/quality-routes.js +1 -0
  291. package/vendor/dist-server/routes/resources-ingest-routes.js +1 -0
  292. package/vendor/dist-server/routes/resources-routes.js +1 -0
  293. package/vendor/dist-server/routes/schema-routes.js +1 -0
  294. package/vendor/dist-server/routes/settings-original.js +1 -0
  295. package/vendor/dist-server/routes/settings.js +1 -0
  296. package/vendor/dist-server/routes/share-routes.js +1 -0
  297. package/vendor/dist-server/routes/sources-catalog-routes.js +1 -0
  298. package/vendor/dist-server/routes/sources-routes.js +1 -0
  299. package/vendor/dist-server/routes/team-optimizer-routes.js +1 -0
  300. package/vendor/dist-server/routes/team-schedule-routes.js +1 -0
  301. package/vendor/dist-server/routes/teams-routes.js +1 -0
  302. package/vendor/dist-server/routes/tool-analytics.js +1 -0
  303. package/vendor/dist-server/routes/tool-history-routes.js +1 -0
  304. package/vendor/dist-server/routes/tool-metrics-routes.js +1 -0
  305. package/vendor/dist-server/routes/toolbox-import-routes.js +1 -0
  306. package/vendor/dist-server/routes/tools-routes.js +5 -0
  307. package/vendor/dist-server/routes/transcribe-routes.js +1 -0
  308. package/vendor/dist-server/routes/triggers.js +1 -0
  309. package/vendor/dist-server/routes/versions-routes.js +1 -0
  310. package/vendor/dist-server/routes/webhooks-routes.js +1 -0
  311. package/vendor/dist-server/scripts/add-label-to-tools.js +4 -0
  312. package/vendor/dist-server/scripts/migrate-assistants-to-mcp.js +10 -0
  313. package/vendor/dist-server/scripts/migrate-chat-runs.js +8 -0
  314. package/vendor/dist-server/scripts/migrate-mcp-protocol.js +8 -0
  315. package/vendor/dist-server/scripts/migrate-mcp-to-platforms.js +15 -0
  316. package/vendor/dist-server/services/alert-evaluator.js +3 -0
  317. package/vendor/dist-server/services/auth.js +1 -0
  318. package/vendor/dist-server/services/billing-service.js +1 -0
  319. package/vendor/dist-server/services/chat-title-generator.js +12 -0
  320. package/vendor/dist-server/services/clone/clone-executor.js +1 -0
  321. package/vendor/dist-server/services/clone/closure-resolver.js +3 -0
  322. package/vendor/dist-server/services/clone/entity-graph.js +3 -0
  323. package/vendor/dist-server/services/clone/team-bundle-bootstrap.js +1 -0
  324. package/vendor/dist-server/services/clone/team-bundle-crypto.js +1 -0
  325. package/vendor/dist-server/services/clone/team-bundle-encrypted.js +1 -0
  326. package/vendor/dist-server/services/clone/team-bundle.js +1 -0
  327. package/vendor/dist-server/services/cluster-service.js +1 -0
  328. package/vendor/dist-server/services/connection-adapters.js +1 -0
  329. package/vendor/dist-server/services/connectors-service.js +10 -0
  330. package/vendor/dist-server/services/cost-forecast-service.js +1 -0
  331. package/vendor/dist-server/services/eui-ssr-renderer.js +4 -0
  332. package/vendor/dist-server/services/graph-canvas/full-structure-builder.js +1 -0
  333. package/vendor/dist-server/services/graph-templates-service.js +13 -0
  334. package/vendor/dist-server/services/guest-service.js +1 -0
  335. package/vendor/dist-server/services/html-service.js +1 -0
  336. package/vendor/dist-server/services/langgraph-service.js +2 -0
  337. package/vendor/dist-server/services/leaflet-render-service.js +80 -0
  338. package/vendor/dist-server/services/live-resources-service.js +16 -0
  339. package/vendor/dist-server/services/mcp-app-tester-package.js +1 -0
  340. package/vendor/dist-server/services/mcp-gateway/executors/openapi-executor.js +1 -0
  341. package/vendor/dist-server/services/mcp-gateway/gateway-grant-service.js +2 -0
  342. package/vendor/dist-server/services/team-optimizer-service.js +1 -0
  343. package/vendor/dist-server/services/trace-bus-sink.js +1 -0
  344. package/vendor/dist-server/services/user-provisioning-service.js +3 -0
  345. package/vendor/dist-server/templates/mcp-app-tester/src/mcp-http.js +3 -0
  346. package/vendor/dist-server/templates/mcp-app-tester/src/server.js +1 -0
  347. package/vendor/dist-server/utils.js +1 -0
  348. package/vendor/dist-server/ws/assistant-executor.js +7 -0
  349. package/vendor/dist-server/ws/classify-streamed-json-block.js +1 -0
  350. package/vendor/dist-server/ws/collect-response-generator-node-ids.js +1 -0
  351. package/vendor/dist-server/ws/extractors/blockkit-extractor.js +1 -0
  352. package/vendor/dist-server/ws/extractors/echarts-extractor.js +1 -0
  353. package/vendor/dist-server/ws/extractors/eui-extractor.js +1 -0
  354. package/vendor/dist-server/ws/extractors/form-extractor.js +1 -0
  355. package/vendor/dist-server/ws/extractors/index.js +1 -0
  356. package/vendor/dist-server/ws/extractors/leaflet-extractor.js +1 -0
  357. package/vendor/dist-server/ws/extractors/mantine-extractor.js +1 -0
  358. package/vendor/dist-server/ws/extractors/markdown-extractor.js +7 -0
  359. package/vendor/dist-server/ws/extractors/mermaid-extractor.js +1 -0
  360. package/vendor/dist-server/ws/extractors/recharts-extractor.js +1 -0
  361. package/vendor/dist-server/ws/extractors/remotion-extractor.js +1 -0
  362. package/vendor/dist-server/ws/handler.js +66 -0
  363. package/vendor/dist-server/ws/parsers/anthropic-parser.js +7 -0
  364. package/vendor/dist-server/ws/parsers/base-parser.js +3 -0
  365. package/vendor/dist-server/ws/parsers/gemini-parser.js +8 -0
  366. package/vendor/dist-server/ws/parsers/index.js +1 -0
  367. package/vendor/dist-server/ws/parsers/parse-json-blocks.js +1 -0
  368. package/vendor/dist-server/ws/types.js +0 -0
  369. package/vendor/dist-server/ws/utils.js +1 -0
  370. package/vendor/shared/engine-vars.ts +51 -0
  371. package/vendor/shared/llm-providers-config.ts +69 -0
@@ -0,0 +1 @@
1
+ import r from"jsonata";async function s(a,{state:n}){const o=a?.trim();if(!o)return!1;let t;try{t=r(o)}catch(e){return console.warn(`[EdgeJsonataCondition] Compile error for "${o}": ${e?.message} \u2014 edge does not match (fail-closed)`),!1}try{const e=await t.evaluate(n??{},{context:n?.context??{},variables:n?.customFields??{}});return typeof e!="boolean"?(console.warn(`[EdgeJsonataCondition] Non-boolean result (${JSON.stringify(e)}) for "${o}" \u2014 edge does not match (fail-closed)`),!1):e}catch(e){return console.warn(`[EdgeJsonataCondition] Eval error for "${o}": ${e?.message} \u2014 edge does not match (fail-closed)`),!1}}export{s as evaluateEdgeJsonataCondition};
@@ -0,0 +1 @@
1
+ import{ENGINE_VAR_KEYS as s}from"../../../../shared/engine-vars";function u(e,o,i){return e.replace(/\{\{([a-zA-Z0-9_]+)\}\}/g,(t,n)=>{if(!s.has(n))return t;const r=i&&n in i?i[n]:o?.[n];return r===void 0?t:typeof r=="string"?r:JSON.stringify(r)})}export{u as interpolateEngineVars};
@@ -0,0 +1,4 @@
1
+ function l(n,o,e){console.log(`
2
+ `+"=".repeat(80)),console.log(`\u{1F4E4} ${n.toUpperCase()} - Starting execution`),console.log("=".repeat(80)),console.log(`\u{1F916} Model: ${o.provider}:${o.model}`),console.log(`\u{1F4AC} Total Messages: ${e.totalMessages}`),e.toolsCount!==void 0&&console.log(`\u{1F527} Tools Available: ${e.toolsCount}`),console.log("=".repeat(80))}function s(n,o){if(console.log(`
3
+ `+"=".repeat(80)),console.log(`\u{1F4E5} ${n.toUpperCase()} - Response received`),console.log("=".repeat(80)),console.log(`\u{1F527} Tool Calls: ${o.tool_calls?.length||0}`),console.log(`\u{1F4DD} Content Type: ${typeof o.content}`),console.log(`\u{1F4DD} Content Length: ${typeof o.content=="string"?o.content.length:"N/A"}`),o.tool_calls?.length)o.tool_calls.forEach((e,t)=>{console.log(` ${t+1}. ${e.name}(${Object.keys(e.args||{}).join(", ")})`)});else{const e=typeof o.content=="string"?o.content.substring(0,500):JSON.stringify(o.content).substring(0,500);console.log(`\u{1F4C4} Content Preview: ${e}`)}console.log("=".repeat(80)+`
4
+ `)}export{l as logNodeExecution,s as logNodeResponse};
@@ -0,0 +1,5 @@
1
+ import{AIMessage as p}from"@langchain/core/messages";import{randomUUID as m}from"node:crypto";import{getDefaultInstructions as M}from"./node-type-defaults-cache";function A(n){return n.filter(r=>r.getType()==="system")}function _(n){return n.filter(r=>r.getType()!=="system")}function S(n){const r=new Set,s=[];for(let i=n.length-1;i>=0;i--){const t=n[i];if(t.getType()==="tool"){const e=t.tool_call_id;e&&!r.has(e)?(r.add(e),s.unshift(t)):e||s.unshift(t)}else s.unshift(t)}return s}function C(n){if(n.getType()!=="ai")return n;const r=n,s=r.tool_calls??[];if(s.length===0)return n;const i=s.map(e=>({...e,id:e.id&&e.id.trim()?e.id:`call_${m()}`,type:"tool_call"}));let t="";return typeof r.content=="string"?t=r.content:Array.isArray(r.content)&&(t=r.content.filter(e=>e?.type==="text"&&typeof e.text=="string").map(e=>e.text).join("")),new p({content:t,tool_calls:i})}function B(n){const r=new Set;for(const t of n)if(t.getType()==="tool"){const e=t.tool_call_id;e&&r.add(e)}const s=[];let i=new Set;for(const t of n)if(t.getType()==="ai"){const e=t,u=e.tool_calls??[];if(u.length===0){s.push(t),i=new Set;continue}const g=u.filter(l=>l.id&&r.has(l.id));if(i=new Set(g.map(l=>l.id)),g.length===u.length)s.push(t);else if(g.length===0){const l=typeof e.content=="string"?e.content:"";s.push(new p({content:l}))}else s.push(new p({content:e.content,tool_calls:g}))}else if(t.getType()==="tool"){const e=t.tool_call_id;e&&i.has(e)&&s.push(t)}else s.push(t);return s}async function $(n,r,s,i){const t=i?.node_overrides?.[r];if(t&&typeof t=="string"&&t.trim())return console.log(`[Instructions] Assistant override for "${r}" (${t.length} chars)`,JSON.stringify(i.node_overrides)),t;const e=n.nodes.find(l=>l.type===r||l.id===r),u=e?.instructions;if(u&&typeof u=="string"&&u.trim())return console.log(`[Instructions] Loaded from graph node "${r}" (${u.length} chars)`,JSON.stringify(e.instructions)),u;if(s&&s.trim())return console.log(`[Instructions] Using literal fallback for node type "${r}"`,JSON.stringify(s)),s;const g=await M(r);return console.log(`[Instructions] Using ES-cached default for node type "${r}" (${g.length} chars)`),g}function w(n,r={}){const{maxTurns:s=3,maxCharsPerMessage:i=800}=r;if(!Array.isArray(n)||n.length===0)return null;let t=-1;for(let o=n.length-1;o>=0;o--){const c=n[o];if(c?._getType?.()==="human"||c?.constructor?.name==="HumanMessage"){t=o;break}}if(t<=0)return null;const e=n.slice(0,t),u=o=>typeof o=="string"?o:Array.isArray(o)?o.filter(c=>c&&(c.type==="text"||typeof c=="string")).map(c=>typeof c=="string"?c:c.text??"").join("").trim():"",g=o=>o.replace(/```json[\s\S]*?```/g,"[dashboard blocks]").replace(/\{"type":"dashboard"[\s\S]*?\}\]\}/g,"[dashboard blocks]").trim(),l=[];let a=null;for(const o of e){const c=o._getType?.()??o.constructor?.name;if(c==="human"||c==="HumanMessage")a=u(o.content);else if(c==="ai"||c==="AIMessage"){const h=g(u(o.content));if(!h||a===null)continue;l.push({user:a,assistant:h}),a=null}}if(l.length===0)return null;const f=l.slice(-s),d=o=>o.length>i?o.slice(0,i)+"\u2026":o,y=["[Previous turns on this team \u2014 for context only, do not repeat unless directly relevant]"];return f.forEach((o,c)=>{y.push(`
2
+ --- Turn ${l.length-f.length+c+1} ---`),y.push(`User: ${d(o.user)}`),y.push(`Assistant: ${d(o.assistant)}`)}),y.join(`
3
+ `)}function j(n){if(!Array.isArray(n)||n.length===0)return"";const r=a=>typeof a=="string"?a:Array.isArray(a)?a.map(f=>typeof f=="string"?f:f?.text??"").join(""):"",s=n[n.length-1],t=(s?._getType?.()==="system"||s?.constructor?.name==="SystemMessage")&&typeof s?.content=="string"?s.content:"";if(t.startsWith("Compressed tool results:"))return t.replace(/^Compressed tool results:\s*/,"").trim();const e=n.filter(a=>a._getType?.()==="ai"||a.constructor?.name==="AIMessage").slice(-1)[0],u=r(e?.content).trim();if(u)return u;const g=[...n].reverse().find(a=>(a._getType?.()==="system"||a.constructor?.name==="SystemMessage")&&typeof a.content=="string"&&a.content.startsWith("Compressed tool results:"));if(g)return g.content.replace(/^Compressed tool results:\s*/,"").trim();const l=n.filter(a=>a._getType?.()==="tool"||a.constructor?.name==="ToolMessage");return l.length>0?l.map(a=>r(a.content)).filter(Boolean).join(`
4
+
5
+ `).trim():""}function v(n){if(Array.isArray(n))for(let r=n.length-1;r>=0;r--){const s=n[r];if(!(s?._getType?.()==="tool"||s?.constructor?.name==="ToolMessage"))continue;const t=typeof s.content=="string"?s.content:Array.isArray(s.content)?s.content.map(e=>typeof e=="string"?e:e?.text??"").join(""):"";if(!t)return;try{return JSON.parse(t)}catch{return}}}export{S as deduplicateToolMessages,j as extractAssistantOutput,w as extractCrossTurnHistory,v as extractLastToolResultJson,_ as filterNonSystemMessages,A as filterSystemMessages,$ as getNodeInstructions,C as normalizeToolCallIds,B as sanitizeToolMessages};
@@ -0,0 +1 @@
1
+ import{Client as a}from"@elastic/elasticsearch";const i=new a({node:process.env.ELASTICSEARCH_HOST||"https://51.159.174.230:9205",auth:{username:process.env.ELASTICSEARCH_USER||"elastic",password:process.env.ELASTICSEARCH_PASSWORD||"diagnostics"},tls:{rejectUnauthorized:!1}}),c=".stkxp_node_types",l=6e4;let s=null,r=0;async function u(){try{const t=await i.search({index:c,body:{query:{match_all:{}},size:100,_source:["id","defaultInstructions"]}}),n=new Map;for(const o of t.hits.hits){const e=o._source;e?.id&&typeof e.defaultInstructions=="string"&&e.defaultInstructions.trim()&&n.set(e.id,e.defaultInstructions)}return s=n,r=Date.now(),n}catch(t){return console.error("[NodeTypeDefaultsCache] Failed to refresh:",t.message),s??new Map}}async function p(t){return(!s||Date.now()-r>l?await u():s).get(t)??""}function f(){s=null,r=0}export{f as __resetNodeTypeDefaultsCacheForTests,p as getDefaultInstructions};
@@ -0,0 +1 @@
1
+ import{sanitizeIdentifier as i}from"../nodes/reasoning/code-executor/tool-bridge";function n(t){return t.map(e=>({namespace:i(e._system||e._mcpServerName||"tools"),name:i(e.name),description:e.description}))}function o(t){return t.map(e=>({key:i(e.title),title:e.title,description:e.description,use_case:e.use_case,type:e.type}))}export{o as buildAvailableResources,n as buildAvailableTools};
@@ -0,0 +1 @@
1
+ import{z as i}from"zod";import{DynamicStructuredTool as m}from"@langchain/core/tools";function d(r){return!!r&&(typeof r.safeParse=="function"||!!r._def)}function b(r){return!!r&&typeof r=="object"&&(!!r.type||!!r.properties||Array.isArray(r.anyOf)||Array.isArray(r.oneOf)||Array.isArray(r.allOf))}function y(r){if(!r||typeof r!="object")return i.any();if(Array.isArray(r.anyOf)&&r.anyOf.length)return i.union(r.anyOf.map(y));if(Array.isArray(r.oneOf)&&r.oneOf.length)return i.union(r.oneOf.map(y));if(Array.isArray(r.allOf)&&r.allOf.length)return r.allOf.map(y).reduce((e,o)=>i.intersection(e,o));if(Array.isArray(r.enum)&&r.enum.length)return r.enum.every(e=>typeof e=="string")?i.enum(r.enum):i.union(r.enum.map(e=>i.literal(e)));switch(r.type){case"string":return i.string();case"number":return i.number();case"integer":return i.number().int();case"boolean":return i.boolean();case"array":return i.array(r.items?y(r.items):i.any());case"object":default:{const e=r.properties&&typeof r.properties=="object"?r.properties:{},o=new Set(Array.isArray(r.required)?r.required:[]),n={};for(const[t,a]of Object.entries(e)){const s=y(a);n[t]=o.has(t)?s:s.optional()}return i.object(n).passthrough()}}}function g(r){switch(r?._def?.typeName){case"ZodString":return"string";case"ZodNumber":return"number";case"ZodBoolean":return"boolean";case"ZodArray":return"array";case"ZodEnum":return"string";case"ZodObject":return"object";default:return"any"}}function T(r){const e=r?.schema;if(!e)return"";try{if(d(e)){if(e._def?.typeName!=="ZodObject")return"";const o=typeof e._def.shape=="function"?e._def.shape():e._def.shape,n=[];for(const[t,a]of Object.entries(o||{})){const s=a?._def?.typeName,p=s==="ZodOptional"||s==="ZodDefault",l=p?a._def.innerType??a:a,f=g(l);n.push(p?`${t}?: ${f}`:`${t}: ${f}`)}return n.join(", ")}if(b(e)&&e.type!=="array"){const o=e.properties&&typeof e.properties=="object"?e.properties:{},n=new Set(Array.isArray(e.required)?e.required:[]);return Object.entries(o).map(([t,a])=>`${t}${n.has(t)?"":"?"}: ${a?.type||"any"}`).join(", ")}}catch{return""}return""}const j=["_system","_mcpServerName","_mcpServerId","_selectedNamespace"];function O(r,e){for(const o of j)r?.[o]!==void 0&&(e[o]=r[o]);return e}function N(r){return r.map(e=>{const o=e.schema;if(!o||d(o))return e;if(b(o)){const n=y(o);return O(e,new m({name:e.name,description:e.description,schema:n,responseFormat:e.responseFormat,func:async(t,a)=>e.invoke(t,a)}))}return O(e,new m({name:e.name,description:e.description,schema:i.record(i.any()),responseFormat:e.responseFormat,func:async(n,t)=>e.invoke(n,t)}))})}function c(r){if(!r||!r._def)return{};const e=r._def;switch(e.typeName){case"ZodString":return{type:"string"};case"ZodNumber":return{type:"number"};case"ZodBoolean":return{type:"boolean"};case"ZodDate":return{type:"string"};case"ZodLiteral":return{type:typeof e.value=="number"?"number":typeof e.value=="boolean"?"boolean":"string",enum:[e.value]};case"ZodEnum":return{type:"string",enum:e.values};case"ZodNativeEnum":{const n=Object.values(e.values||{}).filter(t=>typeof t=="string");return{type:"string",...n.length?{enum:n}:{}}}case"ZodArray":return{type:"array",items:c(e.type)};case"ZodObject":{const n=typeof e.shape=="function"?e.shape():e.shape,t={},a=[];for(const[s,p]of Object.entries(n||{})){const l=p;t[s]=c(l);const f=l?._def?.typeName;f!=="ZodOptional"&&f!=="ZodDefault"&&a.push(s)}return{type:"object",properties:t,...a.length?{required:a}:{}}}case"ZodRecord":return{type:"object"};case"ZodOptional":case"ZodNullable":case"ZodDefault":case"ZodCatch":return c(e.innerType??e.schema);case"ZodEffects":return c(e.schema);case"ZodUnion":{const n=(e.options||[]).map(t=>c(t));return n.length?{anyOf:n}:{}}case"ZodPipeline":return c(e.out??e.in);default:return{}}}function u(r,e,o=new Set){if(!r||typeof r!="object")return r;if(o.has(r))return{};if(o.add(r),typeof r.$ref=="string"){const t=h(e,r.$ref);return t?u(JSON.parse(JSON.stringify(t)),e,o):{}}const n={};for(const[t,a]of Object.entries(r))if(!["$schema","$id","$defs","definitions","additionalProperties","$ref"].includes(t))if(t==="properties"&&a&&typeof a=="object"){n.properties={};for(const[s,p]of Object.entries(a))n.properties[s]=u(p,e,o)}else t==="items"?n.items=u(a,e,o):["anyOf","oneOf","allOf"].includes(t)&&Array.isArray(a)?n[t]=a.map(s=>u(s,e,o)):n[t]=a;return n}function h(r,e){if(!e.startsWith("#/"))return null;const o=e.slice(2).split("/");let n=r;for(const t of o)if(n&&typeof n=="object"&&t in n)n=n[t];else return null;return n}function v(r){return r.map(e=>{const o=e.schema;let n;try{d(o)?n=c(o):b(o)?n=u(o,o):n={type:"object",properties:{}}}catch{n={type:"object",properties:{}}}return(!n||n.type!=="object")&&(n={type:"object",properties:n?.properties??{}}),O(e,new m({name:e.name,description:e.description,schema:n,responseFormat:e.responseFormat,func:async(t,a)=>e.invoke(t,a)}))})}function S(r,e){if(!r||typeof r!="object"||d(r))return r;let o;try{o=JSON.parse(JSON.stringify(r))}catch{return r}delete o.$schema;const n=t=>{!t||typeof t!="object"||((e==="openai"||e==="anthropic"||e==="openrouter")&&t.additionalProperties===!1&&(t.additionalProperties=!0),t.properties&&Object.values(t.properties).forEach(n),t.items&&n(t.items),Array.isArray(t.anyOf)&&t.anyOf.forEach(n),Array.isArray(t.oneOf)&&t.oneOf.forEach(n),Array.isArray(t.allOf)&&t.allOf.forEach(n))};return n(o),o}export{T as describeToolParams,N as ensureAnthropicCompatibleTools,v as ensureGeminiCompatibleTools,b as isJsonSchemaObject,d as isZodSchema,y as jsonSchemaToZod,S as normalizeToolSchemaForProvider,c as zodToInlinedJsonSchema};
@@ -0,0 +1,5 @@
1
+ const a={shareToAssistants:!0,shareToDecider:!0,useAssistantProfiles:!1,applyOnDelegation:!1};function u(t){return{...a,...t||{}}}function c(t,o,e){const n=t?.context;return n&&(e==="assistants"?o.shareToAssistants:o.shareToDecider)?n:void 0}function f(t){if(!t||t.length===0)return;const o=t.map(e=>{const n=[];if(e.context?.role&&n.push(e.context.role),e.behavior?.task_brief&&n.push(`Objectif: ${e.behavior.task_brief}`),e.context?.style){const{audience:i,tone:s,language:r}=e.context.style,l=[i&&`Audience: ${i}`,s&&`Ton: ${s}`,r&&`Langue: ${r}`].filter(Boolean);l.length&&n.push(l.join(", "))}if(n.length!==0)return`### ${e.name||"Assistant"}
2
+ ${n.join(`
3
+ `)}`}).filter(Boolean);return o.length>0?o.join(`
4
+
5
+ `):void 0}export{f as buildAssistantProfilesSummary,c as buildTeamContextText,u as resolveContextPolicy};
@@ -0,0 +1 @@
1
+ function r(e,n){return e?.teamId??n?.selectedTeamId}export{r as resolveTeamInvokerTargetId};
@@ -0,0 +1,4 @@
1
+ function s(t){const r=[...t||[]].reverse().find(e=>e?.getType?.()==="tool"||e?._getType?.()==="tool");if(!r)return;const n=r.content;if(typeof n=="string")return n;if(Array.isArray(n))return n.map(e=>typeof e=="string"?e:e?.text??JSON.stringify(e)).join(`
2
+ `);if(n!=null)return JSON.stringify(n,null,2)}function f(t){const r=[...t||[]].reverse().find(e=>(e?.getType?.()==="ai"||e?._getType?.()==="ai")&&!e?.additional_kwargs?.__raw_output__);if(!r)return;const n=r.content;if(typeof n=="string")return n;if(Array.isArray(n))return n.map(e=>typeof e=="string"?e:e?.text??JSON.stringify(e)).join(`
3
+ `);if(n!=null)return JSON.stringify(n,null,2)}function o(t){const r=[...t||[]].reverse().find(e=>e?.getType?.()==="human"||e?._getType?.()==="human");if(!r)return;const n=r.content;if(typeof n=="string")return n;if(Array.isArray(n))return n.map(e=>typeof e=="string"?e:e?.text??JSON.stringify(e)).join(`
4
+ `);if(n!=null)return JSON.stringify(n,null,2)}function u(t){if(t==null)return;if(typeof t=="object"||typeof t!="string")return t;const r=t.trim();if(r){try{return JSON.parse(r)}catch{}try{const n="["+r.replace(/}\s*{/g,"},{").replace(/}\s*\n\s*{/g,"},{")+"]";return JSON.parse(n)}catch{}}}export{u as coerceToJson,f as lastAIMessageContent,o as lastHumanMessageContent,s as lastToolMessageContent};
@@ -0,0 +1,14 @@
1
+ import{DynamicStructuredTool as T}from"@langchain/core/tools";import{buildGuardedToolResult as A,TOOL_RESULT_MAX_TOKENS as N}from"./content-utils";function S(c){const t=c?.schema||c?.inputSchema;if(!t)return null;const o={};if(t.shape&&typeof t.shape=="object"){for(const[e,n]of Object.entries(t.shape)){let a=n,u=0;for(;(a?._def?.typeName==="ZodOptional"||a?._def?.typeName==="ZodNullable"||a?._def?.typeName==="ZodDefault")&&(a=a._def.innerType,!(++u>10)););const p=a?._def?.typeName;p==="ZodArray"?o[e]="array":p==="ZodObject"||p==="ZodRecord"?o[e]="object":o[e]="other"}return o}if(t.properties&&typeof t.properties=="object"){for(const[e,n]of Object.entries(t.properties))n?.type==="array"?o[e]="array":n?.type==="object"?o[e]="object":o[e]="other";return o}return null}function b(c,t,o){if(!c||typeof c!="object"||!t)return c;const e={...c};for(const[n,a]of Object.entries(t)){if(a!=="array"&&a!=="object")continue;const u=e[n];if(typeof u!="string")continue;const p=u.trim();if(!(!p.startsWith("[")&&!p.startsWith("{")))try{const l=JSON.parse(p),y=Array.isArray(l);a==="array"&&y?(console.log(`\u{1F527} [${o}] Auto-unstringified field "${n}": string \u2192 array (LLM JSON-stringified the value)`),e[n]=l):a==="object"&&!y&&typeof l=="object"&&l!==null&&(console.log(`\u{1F527} [${o}] Auto-unstringified field "${n}": string \u2192 object (LLM JSON-stringified the value)`),e[n]=l)}catch{}}return e}function L(c,t){console.log(`
2
+ ${"\u{1F527} ".repeat(40)}`),console.log(`\u{1F527} WRAPPING ${c.length} MCP TOOLS WITH GUARDED RESULT HANDLER`),console.log(`${"\u{1F527} ".repeat(40)}`),console.log(`\u2705 Each tool will be checked for result size (max: ${N} tokens)`),console.log("\u{1F916} Large results will trigger LLM fallback for helpful suggestions"),console.log(`${"\u{1F527} ".repeat(40)}
3
+ `);const o=c.map(e=>{console.log(` \u2705 Wrapped: ${e.name}`);const n=S(e),a=e.responseFormat==="content_and_artifact",u=async(l,y)=>{console.log(`
4
+ ${"\u26A1 ".repeat(40)}`),console.log(`\u26A1 TOOL INVOCATION: ${e.name}`),console.log(`${"\u26A1 ".repeat(40)}`),console.log(`\u{1F4E5} Args: ${JSON.stringify(l).substring(0,200)}${JSON.stringify(l).length>200?"...":""}`);const s=b(l,n,e.name),m=Date.now();try{console.log("\u{1F680} Executing tool...");const r=typeof e.func=="function"?await e.func(s,void 0,y):await e.invoke(s,y),d=Date.now()-m;console.log(`\u2705 Tool execution completed in ${d}ms`);let i=a&&Array.isArray(r)&&r.length===2?r[0]:r;Array.isArray(i)&&i.length>0&&i.every(f=>f&&typeof f=="object"&&f.type==="text"&&typeof f.text=="string")?i=i.map(f=>f.text).join(`
5
+ `):i&&typeof i=="object"&&!Array.isArray(i)&&i.type==="text"&&typeof i.text=="string"&&(console.log("\u{1F504} Normalizing MCP content block: extracting text"),i=i.text),console.log("\u{1F4CA} Checking result size...");const g=await A(i,e.name,s,t,{maxTokens:N,sampleItems:20});return g&&typeof g=="object"&&g.error==="RESULT_TOO_LARGE"?console.log("\u26A0\uFE0F RESULT TOO LARGE - Guarded result returned with LLM suggestion"):console.log("\u2705 Result size OK - Original result passed through"),console.log(`${"\u26A1 ".repeat(40)}
6
+ `),g}catch(r){const d=Date.now()-m;return console.error("\u274C TOOL EXECUTION FAILED"),console.error(` Tool: ${e.name}`),console.error(` Duration: ${d}ms`),console.error(` Error: ${r.message}`),console.log(`${"\u26A1 ".repeat(40)}
7
+ `),JSON.stringify({error:"TOOL_EXECUTION_FAILED",tool_name:e.name,error_message:r.message||String(r),status_code:r.status||r.response?.status||r.code,duration_ms:d,args_attempted:s,suggestion:"L'ex\xE9cution de l'outil a \xE9chou\xE9. V\xE9rifiez vos param\xE8tres et r\xE9essayez."})}},p=new T({name:e.name,description:e.description,schema:e.schema,responseFormat:"content",func:(l,y,s)=>u(l,s),defaultConfig:e.defaultConfig});return Object.assign(p,{_mcpServerId:e._mcpServerId,_mcpServerName:e._mcpServerName,_system:e._system,_selectedNamespace:e._selectedNamespace,_requiresForm:e._requiresForm,_toolDoc:e._toolDoc}),p});return console.log(`
8
+ \u2705 Successfully wrapped ${o.length} MCP tools
9
+ `),o}function x(c){const t=new Map;for(const o of c)t.has(o.name)||t.set(o.name,[]),t.get(o.name).push(o);return Array.from(t.entries()).map(([o,e])=>{if(e.length===1)return e[0];const n=async(u,p)=>{const y=(await Promise.allSettled(e.map(s=>Promise.resolve(s.invoke(u,p)).then(m=>({ns:s._selectedNamespace||s._mcpServerName||"unknown",result:m}))))).map(s=>s.status==="fulfilled"?s.value:null).filter(Boolean);if(y.length===0)return JSON.stringify({error:"All namespaces failed",tool_name:o});if(y.length===1){const{result:s}=y[0];return typeof s=="string"?s:JSON.stringify(s)}return y.map(({ns:s,result:m})=>`[${s}]
10
+ ${typeof m=="string"?m:JSON.stringify(m)}`).join(`
11
+
12
+ ---
13
+
14
+ `)},a=new T({name:e[0].name,description:e[0].description,schema:e[0].schema,responseFormat:e[0].responseFormat??"content",func:(u,p,l)=>n(u,l)});return Object.assign(a,{_isFanOut:!0})})}function j(c){const t=c.schema||c.inputSchema;return t?t.shape&&typeof t.shape=="object"?new Set(Object.keys(t.shape)):t.properties&&typeof t.properties=="object"?new Set(Object.keys(t.properties)):null:null}function k(c,t,o){const e=o.queryParams||{};return c.map(n=>{if(!t.has(n.name))return n;const a=n,u=j(n),p=S(n),l=!!(n._system||n._selectedNamespace),y=new Set(["namespace","cluster","packageName"]),s=async(r,d)=>{const i={userToken:o.userToken||r.userToken,cluster:r.cluster||r.namespace||e.cluster||e.namespace,namespace:r.namespace||e.namespace,packageName:e.packageName||r.packageName,nodes:e.nodes||r.nodes,roles:e.roles||r.roles,phases:e.phases||r.phases,start:e.start||r.start,end:e.end||r.end,interval:e.interval||r.interval,topic:e.topic||r.topic},g={...r};for(const[h,_]of Object.entries(i)){if(_==null)continue;const O=u?.has(h)??!1;if(y.has(h)){l&&(O||u===null)&&(g[h]=_);continue}(u===null||O)&&(g[h]=_)}const f=b(g,p,n.name);return console.log(`[MCP Wrapper] Enriching tool "${n.name}" with queryParams:`,f),typeof a.func=="function"?await a.func(f,void 0,d):await a.invoke(f,d)},m=new T({name:n.name,description:n.description,schema:n.schema?{...n.schema,required:void 0}:n.schema,responseFormat:n.responseFormat??"content",func:(r,d,i)=>s(r,i),defaultConfig:n.defaultConfig});return Object.assign(m,{_mcpServerId:n._mcpServerId,_mcpServerName:n._mcpServerName,_system:n._system,_selectedNamespace:n._selectedNamespace,_requiresForm:n._requiresForm,_toolDoc:n._toolDoc}),m})}export{x as createFanOutTools,L as wrapMcpToolsWithGuard,k as wrapMcpToolsWithQueryParams};
@@ -0,0 +1 @@
1
+ import{Client as u}from"@elastic/elasticsearch";import{LLM_INDICES as a,PROVIDER_INDEX_MAPPING as S,MODEL_INDEX_MAPPING as m,ROUTING_RULE_INDEX_MAPPING as x,DEFAULT_PROVIDERS as L,DEFAULT_MODELS as g,DEFAULT_ROUTING_RULES as I}from"./models";async function f(t,i={}){const{recreate:r=!1,seed:s=!0,verbose:e=!0}=i,n=e?console.log:()=>{},o=[{name:a.PROVIDERS,mapping:S},{name:a.MODELS,mapping:m},{name:a.ROUTING_RULES,mapping:x}];n("[LLM Indices] Starting initialization...");for(const{name:c,mapping:d}of o)try{if(await t.indices.exists({index:c}))if(r)n(`[LLM Indices] Deleting existing index: ${c}`),await t.indices.delete({index:c});else{n(`[LLM Indices] Index already exists: ${c} (skipping)`);continue}n(`[LLM Indices] Creating index: ${c}`),await t.indices.create({index:c,body:{settings:{number_of_shards:1,number_of_replicas:0,"index.max_result_window":1e4},mappings:d}}),n(`[LLM Indices] \u2705 Created index: ${c}`)}catch(l){throw console.error(`[LLM Indices] \u274C Error creating index ${c}:`,l.message),l}s&&(n("[LLM Indices] Seeding default data..."),await p(t,{verbose:e})),n("[LLM Indices] \u2705 Initialization complete")}async function p(t,i={}){const{verbose:r=!0}=i,s=r?console.log:()=>{};try{s(`[LLM Indices] Seeding ${L.length} default providers...`);for(const e of L){const n=`${e.type}-prod`,o=new Date().toISOString();await t.index({index:a.PROVIDERS,id:n,body:{...e,id:n,createdAt:o,updatedAt:o},refresh:!0})}s(`[LLM Indices] \u2705 Seeded ${L.length} providers`),s(`[LLM Indices] Seeding ${g.length} default models...`);for(const e of g){const n=`${e.modelId}`,o=new Date().toISOString();await t.index({index:a.MODELS,id:n,body:{...e,id:n,owner:"stkxp",createdAt:o,updatedAt:o},refresh:!0})}s(`[LLM Indices] \u2705 Seeded ${g.length} models`),s(`[LLM Indices] Seeding ${I.length} default routing rules...`);for(const e of I){const n=e.name.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),o=new Date().toISOString();await t.index({index:a.ROUTING_RULES,id:n,body:{...e,id:n,createdAt:o,updatedAt:o},refresh:!0})}s(`[LLM Indices] \u2705 Seeded ${I.length} routing rules`),s("[LLM Indices] \u2705 Seeding complete")}catch(e){throw console.error("[LLM Indices] \u274C Error seeding data:",e.message),e}}async function M(t,i={}){const{verbose:r=!0}=i,s=r?console.log:()=>{};s("[LLM Indices] Deleting all LLM control plane indices...");for(const e of Object.values(a))try{await t.indices.exists({index:e})?(await t.indices.delete({index:e}),s(`[LLM Indices] \u2705 Deleted index: ${e}`)):s(`[LLM Indices] Index does not exist: ${e} (skipping)`)}catch(n){console.error(`[LLM Indices] \u274C Error deleting index ${e}:`,n.message)}s("[LLM Indices] \u2705 Deletion complete")}async function E(t){const i={};for(const[r,s]of Object.entries(a))try{i[r]=await t.indices.exists({index:s})}catch{i[r]=!1}return i}async function w(){const t=process.env.ELASTICSEARCH_HOST||"https://51.159.174.230:9205",i=process.env.ELASTICSEARCH_USER||"elastic",r=process.env.ELASTICSEARCH_PASSWORD||"diagnostics",s=new u({node:t,auth:{username:i,password:r},tls:{rejectUnauthorized:!1}}),e=process.argv.slice(2),n=e[0]||"init",o=e.includes("--recreate"),c=e.includes("--no-seed");try{switch(n){case"init":await f(s,{recreate:o,seed:!c,verbose:!0});break;case"seed":await p(s,{verbose:!0});break;case"delete":await M(s,{verbose:!0});break;case"check":const d=await E(s);console.log("[LLM Indices] Status:",d);break;default:console.error(`Unknown command: ${n}`),console.log("Usage: tsx server/llm/init-indices.ts [init|seed|delete|check] [--recreate] [--no-seed]"),process.exit(1)}process.exit(0)}catch(d){console.error("[LLM Indices] Fatal error:",d.message),console.error(d.stack),process.exit(1)}}import.meta.url===`file://${process.argv[1]}`&&w();export{E as checkLLMIndices,M as deleteLLMIndices,f as initializeLLMIndices};
@@ -0,0 +1 @@
1
+ export*from"./provider.model";export*from"./model.model";export*from"./routing-rule.model";const o={PROVIDERS:".stkxp_llm_providers",MODELS:".stkxp_llm_models",ROUTING_RULES:".stkxp_llm_routing_rules"};export{o as LLM_INDICES};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";const r=e.object({streaming:e.boolean().default(!0).describe("Supports streaming responses"),toolCalling:e.boolean().default(!1).describe("Supports function/tool calling"),jsonMode:e.boolean().default(!1).describe("Supports structured JSON output"),vision:e.boolean().default(!1).describe("Supports image inputs"),multimodal:e.boolean().default(!1).describe("Supports multiple input types (text, image, audio)")}),i=e.object({inputTokens:e.number().min(0).describe("Price per 1M input tokens in USD"),outputTokens:e.number().min(0).describe("Price per 1M output tokens in USD"),currency:e.literal("USD").default("USD")}),n=e.object({temperature:e.number().min(0).max(2).optional().describe("Default temperature (0-2)"),maxTokens:e.number().int().min(1).optional().describe("Default max output tokens"),topP:e.number().min(0).max(1).optional().describe("Default top-p sampling"),topK:e.number().int().min(1).optional().describe("Default top-k sampling")}),a=e.object({version:e.string().optional().describe("Model version identifier"),releaseDate:e.string().datetime().optional().describe("Official release date"),deprecated:e.boolean().default(!1).describe("Whether model is deprecated"),replacedBy:e.string().optional().describe("ID of replacement model if deprecated"),description:e.string().optional().describe("Model description and use cases"),tags:e.array(e.string()).optional().describe("Custom tags for organization")}),o=e.object({_id:e.string().optional().describe("Elasticsearch document ID (auto-generated, used in API routes)"),id:e.string().describe("Business identifier (modifiable, e.g., gpt-4o-prod-us-east)"),providerId:e.string().describe("Foreign key to LLMProvider"),name:e.string().describe("Human-readable model name (e.g., GPT-4o)"),modelId:e.string().describe("LangChain/Provider model identifier (e.g., gpt-4o, claude-sonnet-4-5)"),contextWindow:e.number().int().min(1).describe("Maximum context window in tokens"),capabilities:r,pricing:i.optional(),parameters:n.optional(),enabled:e.boolean().default(!0).describe("Whether this model is active"),owner:e.string().optional().describe("Owner username for multi-tenancy filtering"),metadata:a.optional(),createdAt:e.string().datetime(),updatedAt:e.string().datetime()}),d=o.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({id:e.string().optional().describe("Optional custom ID, auto-generated if not provided")}),s=o.partial().omit({_id:!0,createdAt:!0,updatedAt:!0}),l=e.object({providerId:e.string().optional(),enabled:e.preprocess(t=>typeof t=="string"?t.toLowerCase()==="true":t,e.boolean().optional()),capabilities:e.object({streaming:e.boolean().optional(),toolCalling:e.boolean().optional(),jsonMode:e.boolean().optional(),vision:e.boolean().optional(),multimodal:e.boolean().optional()}).optional(),deprecated:e.preprocess(t=>typeof t=="string"?t.toLowerCase()==="true":t,e.boolean().optional()),search:e.string().optional().describe("Search in name, modelId, or tags"),limit:e.preprocess(t=>typeof t=="string"?parseInt(t,10):t,e.number().int().min(1).max(1e3).default(50)),offset:e.preprocess(t=>typeof t=="string"?parseInt(t,10):t,e.number().int().min(0).default(0))}),u={properties:{id:{type:"keyword"},providerId:{type:"keyword"},name:{type:"text",fields:{keyword:{type:"keyword"}}},modelId:{type:"keyword"},contextWindow:{type:"integer"},capabilities:{properties:{streaming:{type:"boolean"},toolCalling:{type:"boolean"},jsonMode:{type:"boolean"},vision:{type:"boolean"},multimodal:{type:"boolean"}}},pricing:{properties:{inputTokens:{type:"float"},outputTokens:{type:"float"},currency:{type:"keyword"}}},parameters:{properties:{temperature:{type:"float"},maxTokens:{type:"integer"},topP:{type:"float"},topK:{type:"integer"}}},enabled:{type:"boolean"},metadata:{properties:{version:{type:"keyword"},releaseDate:{type:"date"},deprecated:{type:"boolean"},replacedBy:{type:"keyword"},description:{type:"text"},tags:{type:"keyword"}}},createdAt:{type:"date"},updatedAt:{type:"date"}}},m=[{providerId:"openai-prod",name:"GPT-4o",modelId:"gpt-4o",contextWindow:128e3,capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},pricing:{inputTokens:2.5,outputTokens:10,currency:"USD"},parameters:{temperature:0,maxTokens:4096},enabled:!0},{providerId:"openai-prod",name:"GPT-4o Mini",modelId:"gpt-4o-mini",contextWindow:128e3,capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},pricing:{inputTokens:.15,outputTokens:.6,currency:"USD"},parameters:{temperature:0,maxTokens:4096},enabled:!0},{providerId:"anthropic-prod",name:"Claude Opus 4.7",modelId:"claude-opus-4-7",contextWindow:2e5,capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},pricing:{inputTokens:15,outputTokens:75,currency:"USD"},parameters:{temperature:0,maxTokens:16e3},enabled:!0},{providerId:"anthropic-prod",name:"Claude Sonnet 4.5",modelId:"claude-sonnet-4-5",contextWindow:2e5,capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},pricing:{inputTokens:3,outputTokens:15,currency:"USD"},parameters:{temperature:0,maxTokens:8192},enabled:!0},{providerId:"anthropic-prod",name:"Claude Haiku 4.5",modelId:"claude-haiku-4-5",contextWindow:2e5,capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!1,multimodal:!1},pricing:{inputTokens:.8,outputTokens:4,currency:"USD"},parameters:{temperature:0,maxTokens:4096},enabled:!0},{providerId:"google-prod",name:"Gemini 2.0 Flash",modelId:"gemini-2.0-flash-exp",contextWindow:1e6,capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},pricing:{inputTokens:.1,outputTokens:.4,currency:"USD"},parameters:{temperature:0,maxTokens:8192},enabled:!0},{providerId:"google-prod",name:"Gemini 1.5 Pro",modelId:"gemini-1.5-pro",contextWindow:2e6,capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},pricing:{inputTokens:1.25,outputTokens:5,currency:"USD"},parameters:{temperature:0,maxTokens:8192},enabled:!0}];export{d as CreateModelSchema,m as DEFAULT_MODELS,o as LLMModelSchema,u as MODEL_INDEX_MAPPING,r as ModelCapabilitiesSchema,a as ModelMetadataSchema,n as ModelParametersSchema,i as ModelPricingSchema,l as ModelQuerySchema,s as UpdateModelSchema};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";const t=e.enum(["openai","anthropic","google","azure","local","custom","openrouter","mistral"]),r=e.object({owner:e.string().describe("Username of the provider owner"),region:e.string().optional().describe("Geographic region (e.g., us-east-1, eu-west-1)"),environment:e.enum(["dev","staging","prod"]).optional(),sla:e.string().optional().describe("Service Level Agreement details"),costTier:e.enum(["free","pay-as-you-go","enterprise"]).optional(),tags:e.array(e.string()).optional().describe("Custom tags for organization")}),i=e.object({streaming:e.boolean().default(!0).describe("Supports streaming responses"),toolCalling:e.boolean().default(!1).describe("Supports function/tool calling"),jsonMode:e.boolean().default(!1).describe("Supports JSON output mode"),vision:e.boolean().default(!1).describe("Supports image inputs"),multimodal:e.boolean().default(!1).describe("Supports multiple input types")}),o=e.object({id:e.string().describe("Unique provider identifier (e.g., openai-prod, anthropic-eu)"),name:e.string().describe("Human-readable provider name"),type:t,endpoint:e.string().url().describe("API base URL"),apiKey:e.string().optional().describe("API key (encrypted in storage)"),enabled:e.boolean().default(!0).describe("Whether this provider is active"),owner:e.string().describe("Owner username \u2014 each user must have their own provider with their own API key"),capabilities:i.optional(),metadata:r.optional(),createdAt:e.string().datetime(),updatedAt:e.string().datetime()}),n=o.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({id:e.string().optional().describe("Optional custom ID, auto-generated if not provided")}),p=o.partial().omit({id:!0,createdAt:!0,updatedAt:!0}),d=e.object({type:t.optional(),enabled:e.boolean().optional(),owner:e.string().optional(),environment:e.enum(["dev","staging","prod"]).optional(),region:e.string().optional(),search:e.string().optional().describe("Search in name, id, or tags"),limit:e.number().int().min(1).max(100).default(50),offset:e.number().int().min(0).default(0)}),s={properties:{id:{type:"keyword"},name:{type:"text",fields:{keyword:{type:"keyword"}}},type:{type:"keyword"},endpoint:{type:"keyword"},apiKey:{type:"text",index:!1},enabled:{type:"boolean"},capabilities:{properties:{streaming:{type:"boolean"},toolCalling:{type:"boolean"},jsonMode:{type:"boolean"},vision:{type:"boolean"},multimodal:{type:"boolean"}}},owner:{type:"keyword"},metadata:{properties:{region:{type:"keyword"},environment:{type:"keyword"},sla:{type:"text"},costTier:{type:"keyword"},tags:{type:"keyword"}}},createdAt:{type:"date"},updatedAt:{type:"date"}}},l=[{name:"OpenAI Production",type:"openai",endpoint:"https://api.openai.com/v1",enabled:!1,owner:"stkxp",capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},metadata:{region:"global",environment:"prod",costTier:"pay-as-you-go"}},{name:"Anthropic Production",type:"anthropic",endpoint:"https://api.anthropic.com/v1",enabled:!1,owner:"stkxp",capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},metadata:{region:"global",environment:"prod",costTier:"pay-as-you-go"}},{name:"Google Gemini Production",type:"google",endpoint:"https://generativelanguage.googleapis.com/v1",enabled:!1,owner:"stkxp",capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},metadata:{region:"global",environment:"prod",costTier:"pay-as-you-go"}},{name:"OpenRouter",type:"openrouter",endpoint:"https://openrouter.ai/api/v1",enabled:!1,owner:"stkxp",capabilities:{streaming:!0,toolCalling:!0,jsonMode:!0,vision:!0,multimodal:!0},metadata:{region:"global",environment:"prod",costTier:"pay-as-you-go"}}];export{n as CreateProviderSchema,l as DEFAULT_PROVIDERS,o as LLMProviderSchema,s as PROVIDER_INDEX_MAPPING,i as ProviderCapabilitiesSchema,r as ProviderMetadataSchema,d as ProviderQuerySchema,t as ProviderTypeSchema,p as UpdateProviderSchema};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";const r=e.array(e.enum(["streaming","toolCalling","jsonMode","vision","multimodal"])).optional(),o=e.object({userRole:e.array(e.string()).optional().describe("Match user roles (e.g., superuser, analyst)"),topic:e.array(e.string()).optional().describe("Match topic patterns (e.g., clusters_*, mysql_*)"),environment:e.enum(["dev","staging","prod"]).optional().describe("Match environment"),requiredCapabilities:r,minContextWindow:e.number().int().min(1).optional().describe("Minimum context window required"),maxCostPerMillion:e.number().min(0).optional().describe("Maximum cost per million tokens (USD)")}),n=e.object({enabled:e.boolean().default(!0).describe("Enable automatic fallback"),maxRetries:e.number().int().min(0).max(10).default(3).describe("Maximum retry attempts"),retryDelay:e.number().int().min(0).max(1e4).default(1e3).describe("Delay between retries in ms"),onError:e.enum(["next","fail","default"]).default("next").describe("Action on error")}),a=e.object({type:e.enum(["priority","least-latency"]).default("priority"),deployments:e.array(e.object({deploymentId:e.string(),fallbackOrder:e.number().int().min(1)})).optional()}).optional(),i=e.object({_id:e.string().optional().describe("Elasticsearch document ID (auto-generated, used in API routes)"),id:e.string().describe("Business identifier (modifiable)"),name:e.string().describe("Human-readable rule name"),owner:e.string().describe("Username of the rule owner"),description:e.string().optional().describe("Rule description and purpose"),tags:e.array(e.string()).optional().describe("Custom tags for organization"),priority:e.number().int().min(1).max(100).default(50).describe("Rule priority (higher = evaluated first)"),enabled:e.boolean().default(!0).describe("Whether this rule is active"),isDefault:e.boolean().optional().describe("Whether this is the default fallback rule for its owner"),conditions:o,fallback:n,strategy:a,modelId:e.string().describe("LLMModel id to use when this rule matches"),temperature:e.number().min(0).max(2).optional().describe("Temperature override (0-2)"),maxTokens:e.number().int().min(1).optional().describe("Max tokens override"),createdAt:e.string().datetime(),updatedAt:e.string().datetime()}),l=i.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({id:e.string().optional().describe("Optional custom ID, auto-generated if not provided")}),d=i.partial().omit({_id:!0,createdAt:!0,updatedAt:!0}),p=e.object({enabled:e.string().optional().transform(t=>t===void 0?void 0:t==="true"),owner:e.string().optional(),environment:e.enum(["dev","staging","prod"]).optional(),topic:e.string().optional().describe("Filter by topic pattern"),userRole:e.string().optional().describe("Filter by user role"),search:e.string().optional().describe("Search in name, description, or tags"),limit:e.number().int().min(1).max(100).default(50),offset:e.number().int().min(0).default(0)}),u=e.object({userRole:e.string().describe("User's role (from JWT)"),topic:e.string().describe("Current topic/query type"),environment:e.enum(["dev","staging","prod"]).describe("Current environment"),requiredCapabilities:r,preferredRegion:e.string().optional().describe("Preferred geographic region"),owner:e.string().optional().describe("Executing owner (JWT username). When set, the routing engine only considers rules owned by this user so one tenant can never resolve another tenant's provider (and API key).")}),c=e.object({provider:e.any().describe("Selected LLMProvider object"),model:e.any().describe("Selected LLMModel object"),rule:e.any().optional().describe("Routing rule that was applied"),reason:e.string().describe("Selection reasoning"),timestamp:e.string().datetime()}),m={properties:{id:{type:"keyword"},name:{type:"text",fields:{keyword:{type:"keyword"}}},priority:{type:"integer"},enabled:{type:"boolean"},conditions:{properties:{userRole:{type:"keyword"},topic:{type:"keyword"},environment:{type:"keyword"},requiredCapabilities:{type:"keyword"},minContextWindow:{type:"integer"},maxCostPerMillion:{type:"float"}}},fallback:{properties:{enabled:{type:"boolean"},maxRetries:{type:"integer"},retryDelay:{type:"integer"},onError:{type:"keyword"}}},owner:{type:"keyword"},description:{type:"text"},tags:{type:"keyword"},isDefault:{type:"boolean"},modelId:{type:"keyword"},temperature:{type:"float"},maxTokens:{type:"integer"},createdAt:{type:"date"},updatedAt:{type:"date"}}},y=[{name:"Production - Tool Calling Required",owner:"stkxp",description:"Primary production routing for tool calling workloads",tags:["production","tool-calling","high-priority"],priority:90,enabled:!0,modelId:"gpt-4o",conditions:{environment:"prod",requiredCapabilities:["toolCalling","streaming"]},fallback:{enabled:!0,maxRetries:3,retryDelay:1e3,onError:"next"}},{name:"Development - Cost Optimized",owner:"stkxp",description:"Cost-optimized routing for development environment",tags:["development","cost-optimized"],priority:80,enabled:!0,modelId:"gpt-4o-mini",conditions:{environment:"dev"},fallback:{enabled:!0,maxRetries:2,retryDelay:500,onError:"next"}},{name:"Clusters Topic - High Performance",owner:"stkxp",description:"Optimized routing for Elasticsearch cluster analysis",tags:["clusters","high-performance"],priority:85,enabled:!0,modelId:"gpt-4o",conditions:{topic:["clusters_*"],environment:"prod"},fallback:{enabled:!0,maxRetries:3,retryDelay:1e3,onError:"next"}},{name:"Fallback - Default Route",owner:"stkxp",description:"Catch-all fallback rule for unmatched requests",tags:["fallback","default"],priority:1,enabled:!0,modelId:"gpt-4o-mini",conditions:{},fallback:{enabled:!0,maxRetries:3,retryDelay:1e3,onError:"fail"}}],g=e.object({id:e.string().describe("Business id of the routing rule to invoke"),prompt:e.string().describe("Text prompt sent to the resolved model")});export{g as CallLLMSchema,l as CreateRoutingRuleSchema,y as DEFAULT_ROUTING_RULES,n as FallbackConfigSchema,i as LLMRoutingRuleSchema,m as ROUTING_RULE_INDEX_MAPPING,r as RequiredCapabilitiesSchema,o as RoutingConditionsSchema,u as RoutingContextSchema,p as RoutingRuleQuerySchema,c as RoutingSelectionResultSchema,a as RoutingStrategySchema,d as UpdateRoutingRuleSchema};
@@ -0,0 +1 @@
1
+ import{ChatOpenAI as s}from"@langchain/openai";import{ChatAnthropic as m}from"@langchain/anthropic";import{ChatGoogleGenerativeAI as L}from"@langchain/google-genai";import{LLM_PROVIDERS_CONFIG as a,getProviderModels as l}from"../../../shared/llm-providers-config";const d={openai:{models:l("openai"),defaultModel:a.openai.defaultModel,baseURL:a.openai.endpoint},anthropic:{models:l("anthropic"),defaultModel:a.anthropic.defaultModel,baseURL:a.anthropic.endpoint},google:{models:l("google"),defaultModel:a.google.defaultModel,baseURL:a.google.endpoint},local:{models:["local-model"],defaultModel:"local-model",baseURL:"http://localhost:11434/v1"}};function n(e,r){if(!r){const o=new Error(`Aucune cl\xE9 API ${e} n'est configur\xE9e pour votre compte. Ajoutez votre cl\xE9 dans Param\xE8tres \u2192 LLM Providers (ou via une r\xE8gle de routage qui pointe vers un de vos providers).`);throw o.errorType="llm_auth",o}return r}function y(e){const r={temperature:e.temperature??0,streaming:e.streaming??!0},o=e.maxTokens??(process.env.LLM_MAX_TOKENS?parseInt(process.env.LLM_MAX_TOKENS,10):void 0);switch(e.provider){case"openai":{const t=/^(o[134](-|$)|gpt-5)/i.test(e.model||"");return new s({...r,...t&&{temperature:void 0},model:e.model,apiKey:n("OpenAI",e.apiKey),configuration:e.baseURL?{baseURL:e.baseURL}:void 0,...o&&{maxTokens:o}})}case"anthropic":{const t=e.model||"claude-haiku-4-5";e.model||console.warn(`[LLM] No model specified for Anthropic, using fallback: ${t}`);const i=n("Anthropic",e.apiKey),u=/^claude-(opus|sonnet|haiku|fable)-/.test(t),p=new m({streaming:e.streaming??!0,model:t,anthropicApiKey:i,...o&&{maxTokens:o},...!u&&{temperature:e.temperature??0}});return p.topP=void 0,p}case"google":return new L({...r,model:e.model,apiKey:n("Google",e.apiKey),...o&&{maxOutputTokens:o}});case"local":return new s({...r,model:e.model,apiKey:e.apiKey||"not-needed",configuration:{baseURL:e.baseURL||d.local.baseURL},...o&&{maxTokens:o}});case"openrouter":return new s({...r,model:e.model,apiKey:n("OpenRouter",e.apiKey),configuration:{baseURL:e.baseURL||"https://openrouter.ai/api/v1"},...o&&{maxTokens:o}});case"mistral":return new s({...r,model:e.model,apiKey:n("Mistral",e.apiKey),configuration:{baseURL:e.baseURL||"https://api.mistral.ai/v1"},...o&&{maxTokens:o}});case"custom":{const t=e.baseURL;if(!t){const i=new Error(`Provider de type "custom" sans endpoint : renseignez l'URL de base (ex. https://api.mistral.ai/v1) dans Param\xE8tres \u2192 LLM Providers.`);throw i.errorType="llm_auth",i}return new s({...r,model:e.model,apiKey:n("Custom (OpenAI-compatible)",e.apiKey),configuration:{baseURL:t},...o&&{maxTokens:o}})}default:throw new Error(`Provider non support\xE9: ${e.provider}`)}}function f(e){return d[e]?.models||[]}function K(e){return d[e]?.defaultModel||""}export{d as DEFAULT_LLM_CONFIG,y as createLLMInstance,f as getAvailableModels,K as getDefaultModel};
@@ -0,0 +1 @@
1
+ import{Client as C}from"@modelcontextprotocol/sdk/client/index.js";import{StreamableHTTPClientTransport as f}from"@modelcontextprotocol/sdk/client/streamableHttp.js";import{SSEClientTransport as w}from"@modelcontextprotocol/sdk/client/sse.js";import{Agent as h}from"undici";function y(n){return n.includes("/sse")||n.includes("sse://")?"sse":"http"}const P=new h({connect:{rejectUnauthorized:!1}});function M(n,e){const u=e.transportType||y(n),c=new URL(n),s={accept:"application/json, text/event-stream"};Object.entries(e.headers||{}).forEach(([r,o])=>{s[r.toLowerCase()]=o});const i=n.startsWith("https://")?{headers:s,dispatcher:P}:{headers:s};return u==="sse"?(console.log(`[MCP] Creating SSE transport for ${n}`),new w(c,{requestInit:i})):(console.log(`[MCP] Creating HTTP transport for ${n}${e.sessionId?` with session ID: ${e.sessionId}`:""}`),new f(c,{requestInit:{...i,signal:AbortSignal.timeout(e.timeout||3e4)},sessionId:e.sessionId,reconnectionOptions:e.reconnectionOptions||{initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:3}}))}async function v(n,e,u){const c=t=>!!t&&typeof t=="object"&&("transportType"in t||"headers"in t||"timeout"in t||"sessionId"in t||"reconnectionOptions"in t);let s;c(e)?s=e:s={headers:e||{},timeout:u||3e4};const i=s.transportType||y(n);console.log(`[MCP] Connecting to ${n} using ${i.toUpperCase()} protocol (timeout: ${s.timeout}ms)`);const r=M(n,s),o=new C({name:"ws-session",version:"1.0.0"});console.log("[MCP] Client created, connecting...");try{await o.connect(r),console.log(`[MCP] \u2713 Successfully connected to ${n} via ${i.toUpperCase()}`)}catch(t){throw console.error(`[MCP] \u2717 Failed to connect to ${n}:`,t.message||t),new Error(`Failed to connect to MCP server at ${n}: ${t.message||"Connection failed"}`)}async function T(){try{return(await o.listTools()).tools?.map(l=>l.name)??[]}catch(t){throw console.error("[MCP] \u274C listTools() failed:",t.message),console.error(`[MCP] Session ID in transport: ${r.sessionId||"none"}`),t}}async function g(t,l={}){const m=await o.callTool({name:t,arguments:l});if(m.isError){const a=m.content?.[0];throw new Error(a?.text??`MCP tool ${t} failed`)}const p=m.content;return p?.find(a=>a.type==="json")?.json??p?.find(a=>a.type==="text")?.text??p?.[0]?.json??p?.[0]?.text??null}async function R(){return await o.listPrompts()}async function S(t){return await o.getPrompt(t)}async function $(){return await o.listResources()}async function d(){try{await o.close()}catch{}try{await r.close()}catch{}}return{client:o,transport:r,listTools:T,callTool:g,close:d}}export{v as createMcpClient};
@@ -0,0 +1 @@
1
+ const e=new Map;function r(t){e.set(t.runId,{...t,startTime:t.startTime??Date.now(),lastActivityAt:t.lastActivityAt??Date.now()})}function s(t,n){const i=e.get(t);i&&e.set(t,{...i,...n})}function a(t){e.delete(t)}function u(t){const n=Array.from(e.values());return t?n.filter(i=>i.username===t):n}function c(t){return e.get(t)}export{c as getActiveRunMeta,u as listActiveRuns,r as registerActiveRunMeta,a as unregisterActiveRunMeta,s as updateActiveRunMeta};
@@ -0,0 +1 @@
1
+ const s=36e5,n=new Map;function o(e,t){n.set(e,{systemPrompt:t,timestamp:Date.now()})}function i(e){const t=n.get(e);if(t){if(Date.now()-t.timestamp>36e5){n.delete(e);return}return t.systemPrompt}}setInterval(()=>{const e=Date.now();for(const[t,r]of n.entries())e-r.timestamp>36e5&&(n.delete(t),console.log(`[SystemPromptCache] Expired entry for runId: ${t}`))},600*1e3);export{i as getSystemPromptForRun,o as setSystemPromptForRun};
@@ -0,0 +1 @@
1
+ import{updateActiveRunMeta as c}from"./active-runs-registry";const a=new Map;function u(e,t){let s=a.get(e);return s||(s=new Set,a.set(e,s)),s.add(t),()=>{const r=a.get(e);r&&(r.delete(t),r.size===0&&a.delete(e))}}function b(e,t){const s={lastActivityAt:t.ts||Date.now()};t.kind==="node_start"&&t.node?s.currentNode=t.node:t.kind==="assistant_start"&&t.assistantName&&(s.assistantName=t.assistantName),c(e,s);const r=a.get(e);if(!(!r||r.size===0))for(const i of r)try{i(t)}catch(n){console.warn(`[trace-bus] subscriber threw for ${e}: ${n.message}`)}}function f(e){return a.get(e)?.size??0}export{b as publishTraceEvent,u as subscribeToTrace,f as subscriberCount};
@@ -0,0 +1 @@
1
+ import*as t from"zod";const o=t.object({stagnating_backing_indices_count:t.number().optional(),total_backing_indices_in_error:t.number().optional()}),i=t.object({indices_with_readonly_block:t.number().optional(),nodes_with_unknown_disk_status:t.number().optional(),nodes_over_flood_stage_watermark:t.number().optional(),nodes_with_enough_disk_space:t.number().optional(),nodes_over_high_watermark:t.number().optional()}),s=t.object({policies:t.number().optional(),stagnating_indices:t.number().optional(),ilm_status:t.string().optional()}),e=t.object({name:t.string().optional(),node_id:t.string().optional()}),r=t.object({symptom:t.string().optional(),status:t.string().optional()}),n=t.object({initializing_primaries:t.number().optional(),unassigned_replicas:t.number().optional(),initializing_replicas:t.number().optional(),unassigned_primaries:t.number().optional(),started_replicas:t.number().optional(),started_primaries:t.number().optional(),restarting_primaries:t.number().optional(),restarting_replicas:t.number().optional(),creating_primaries:t.number().optional(),creating_replicas:t.number().optional()}),p=t.object({indices:t.array(t.string()).optional()}),l=t.object({severity:t.number().optional(),impact_areas:t.array(t.string()).optional(),description:t.string().optional(),id:t.string().describe("Process identifier (PID)").optional()}),a=t.object({max_shards_in_cluster:t.number().optional()}),c=t.object({slm_status:t.string().optional(),policies:t.number().optional()}),m=t.object({symptom:t.string().optional(),details:o.optional(),status:t.string().optional()}),y=t.object({symptom:t.string().optional(),details:i.optional(),status:t.string().optional()}),S=t.object({symptom:t.string().optional(),details:s.optional(),status:t.string().optional()}),f=t.object({recent_masters:t.array(e).optional(),current_master:e.optional()}),h=t.object({help_url:t.string().optional(),affected_resources:p.optional(),cause:t.string().optional(),action:t.string().optional(),id:t.string().describe("Process identifier (PID)").optional()}),b=t.object({data:a.optional().describe("List of all file stores."),frozen:a.optional()}),d=t.object({symptom:t.string().optional(),details:c.optional(),status:t.string().optional()}),_=t.object({symptom:t.string().optional(),details:f.optional(),status:t.string().optional()}),g=t.object({symptom:t.string().optional(),diagnosis:t.array(h).optional(),details:n.optional(),impacts:t.array(l).optional(),status:t.string().optional()}),u=t.object({symptom:t.string().optional(),details:b.optional(),status:t.string().optional()}),x=t.object({data_stream_lifecycle:m.optional(),disk:y.optional(),ilm:S.optional(),master_is_stable:_.optional(),repository_integrity:r.optional(),shards_availability:g.optional(),shards_capacity:u.optional(),slm:d.optional()}),D=t.object({indicators:x.optional()});export{p as AffectedResourcesSchema,D as ClusterStatsSchema,a as DataSchema,o as DataStreamLifecycleDetailsSchema,m as DataStreamLifecycleSchema,h as DiagnosisSchema,i as DiskDetailsSchema,y as DiskSchema,e as EntMasterSchema,s as IlmDetailsSchema,S as IlmSchema,l as ImpactSchema,x as IndicatorsSchema,f as MasterIsStableDetailsSchema,_ as MasterIsStableSchema,r as RepositoryIntegritySchema,n as ShardsAvailabilityDetailsSchema,g as ShardsAvailabilitySchema,b as ShardsCapacityDetailsSchema,u as ShardsCapacitySchema,c as SlmDetailsSchema,d as SlmSchema};
@@ -0,0 +1 @@
1
+ import*as t from"zod";const i=t.object({build_date:t.coerce.date().optional(),number:t.string().optional(),build_snapshot:t.boolean().optional(),build_flavor:t.string().optional(),lucene_version:t.string().optional(),minimum_index_compatibility_version:t.string().optional(),minimum_wire_compatibility_version:t.string().optional(),build_type:t.string().optional(),build_hash:t.string().describe("Short hash of the last git commit in this release.").optional()}),o=t.object({cluster_name:t.string().optional(),cluster_uuid:t.string().optional(),name:t.string().optional(),tagline:t.string().optional(),version:i.optional()});export{o as ClusterStatsSchema,i as VersionSchema};
@@ -0,0 +1,5 @@
1
+ import*as e from"zod";const t=e.object({uid:e.string().optional(),expiry_date_in_millis:e.number().optional(),issue_date:e.coerce.date().describe(`A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a
2
+ number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string
3
+ representation.`).optional(),start_date_in_millis:e.number().optional(),issued_to:e.string().optional(),expiry_date:e.coerce.date().describe(`A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a
4
+ number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string
5
+ representation.`).optional(),max_nodes:e.number().nullable().optional(),issue_date_in_millis:e.number().optional(),type:e.string().describe("string").optional(),issuer:e.string().optional(),max_resource_units:e.number().nullable().optional(),status:e.string().optional()}),n=e.object({license:t.optional()});export{n as ClusterStatsSchema,t as LicenseSchema};
@@ -0,0 +1,12 @@
1
+ import*as e from"zod";const t=e.object({}),s=e.object({avg:e.number().describe("Average number of concurrently open file descriptors.\nReturns `-1` if not supported.").optional(),max:e.number().describe("Maximum number of concurrently open file descriptors allowed across all selected nodes.\nReturns `-1` if not supported.").optional(),p90:e.number().optional()}),a=e.object({"single-node":e.number().optional()}),i=e.object({total_in_bytes:e.number().describe("Total amount of physical memory in bytes.").optional(),free_in_bytes:e.number().describe("Amount of free physical memory in bytes.").optional(),available_in_bytes:e.number().describe("Total number of bytes available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free_in_bytes`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise.").optional()}),c=e.object({all_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage.").optional(),primary_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the primary stage.").optional(),coordinating_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the coordinating stage.").optional(),replica_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the replica stage.").optional(),combined_coordinating_and_primary_in_bytes:e.number().describe(`Memory consumed, in bytes, by indexing requests in the coordinating or primary stage.
2
+ This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.`).optional()}),l=e.object({all_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage.").optional(),coordinating_rejections:e.number().describe("Number of indexing requests rejected in the coordinating stage.").optional(),primary_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the primary stage.").optional(),coordinating_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the coordinating stage.").optional(),primary_document_rejections:e.number().optional(),replica_in_bytes:e.number().describe("Memory consumed, in bytes, by indexing requests in the replica stage.").optional(),replica_rejections:e.number().describe("Number of indexing requests rejected in the replica stage.").optional(),combined_coordinating_and_primary_in_bytes:e.number().describe(`Memory consumed, in bytes, by indexing requests in the coordinating or primary stage.
3
+ This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.`).optional(),primary_rejections:e.number().describe("Number of indexing requests rejected in the primary stage.").optional()}),d=e.object({current:e.number().describe("Total number of documents currently being ingested.").optional(),time_in_millis:e.number().optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),failed:e.number().describe("Total number of failed ingest operations during the lifetime of this node.").optional()}),p=e.object({heap_max_in_bytes:e.number().describe("Maximum amount of memory, in bytes, available for use by the heap.").optional(),heap_used_in_bytes:e.number().describe("Memory, in bytes, currently in use by the heap.").optional()}),m=e.object({count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional()}),u=e.object({using_bundled_jdk:e.boolean().optional(),vm_version:e.string().optional(),bundled_jdk:e.boolean().optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),vm_vendor:e.string().optional(),version:e.string().optional(),vm_name:e.string().optional()}),n=e.object({security4:e.number().optional()}),b=e.object({count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),arch:e.string().describe("Name of the JVM architecture (ex: amd64, x86)").optional()}),y=e.object({used_in_bytes:e.number().describe("Amount of used physical memory in bytes.").optional(),free_percent:e.number().describe("Percentage of free memory.").optional(),adjusted_total_in_bytes:e.number().describe("If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.\nOtherwise it reports the same value as `total_in_bytes`.").optional(),total_in_bytes:e.number().describe("Total amount of physical memory in bytes.").optional(),free_in_bytes:e.number().describe("Amount of free physical memory in bytes.").optional(),used_percent:e.number().describe("Percentage of used memory.").optional()}),h=e.object({count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),name:e.string().optional()}),f=e.object({pretty_name:e.string().optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional()}),_=e.object({flavor:e.string().optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),type:e.string().describe("string").optional()}),g=e.object({percent:e.number().describe("Percentage of CPU used across all selected nodes.\nReturns `-1` if not supported.").optional()}),o=e.object({avg:e.number().describe("Average number of concurrently open file descriptors.\nReturns `-1` if not supported.").optional(),min:e.number().describe(`Minimum number of concurrently open file descriptors across all selected nodes.
4
+ Returns -1 if not supported.`).optional(),max:e.number().describe("Maximum number of concurrently open file descriptors allowed across all selected nodes.\nReturns `-1` if not supported.").optional()}),x=e.object({built_in_filters:e.array(e.any()).describe("Contains statistics about built-in token filters used in selected nodes.").optional(),synonyms:t.optional(),built_in_tokenizers:e.array(e.any()).describe("Contains statistics about built-in tokenizers used in selected nodes.").optional(),tokenizer_types:e.array(e.any()).describe("Contains statistics about tokenizer types used in selected nodes.").optional(),analyzer_types:e.array(e.any()).describe("Contains statistics about analyzer types used in selected nodes.").optional(),char_filter_types:e.array(e.any()).describe("Contains statistics about character filter types used in selected nodes.").optional(),filter_types:e.array(e.any()).describe("Contains statistics about token filter types used in selected nodes.").optional(),built_in_char_filters:e.array(e.any()).describe("Contains statistics about built-in character filters used in selected nodes.").optional(),built_in_analyzers:e.array(e.any()).describe("Contains statistics about built-in analyzers used in selected nodes.").optional()}),S=e.object({size_in_bytes:e.number().describe("Total size, in bytes, of all shards assigned to selected nodes.").optional()}),r=e.object({value_count:e.number().optional()}),T=e.object({deleted:e.number().describe(`Total number of deleted documents across all primary shards assigned to selected nodes.
5
+ This number is based on documents in Lucene segments.
6
+ Elasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.`).optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),total_size_in_bytes:e.number().optional()}),v=e.object({build_time_in_millis:e.number().optional()}),z=e.object({script_count:e.number().optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),name:e.string().optional(),index_count:e.number().optional()}),j=e.object({synthetic:e.number().optional(),stored:e.number().optional()}),C=e.object({miss_count:e.number().describe("Total count of query cache misses across all shards assigned to selected nodes.").optional(),cache_size:e.number().describe("Total number of entries currently in the query cache across all shards assigned to selected nodes.").optional(),memory_size_in_bytes:e.number().describe("Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.").optional(),total_count:e.number().describe("Total count of hits and misses in the query cache across all shards assigned to selected nodes.").optional(),evictions:e.number().describe("Total number of query cache evictions across all shards assigned to selected nodes.").optional(),hit_count:e.number().describe("Total count of query cache hits across all shards assigned to selected nodes.").optional(),cache_count:e.number().describe(`Total number of entries added to the query cache across all shards assigned to selected nodes.
7
+ This number includes current and evicted entries.`).optional()}),q=e.object({search_after:e.number().optional(),post_filter:e.number().optional(),runtime_mappings:e.number().optional(),query:e.number().optional(),_source:e.number().optional(),pit:e.number().optional(),terminate_after:e.number().optional(),fields:e.number().optional(),collapse:e.number().optional(),aggs:e.number().optional()}),M=e.object({version_map_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes.").optional(),norms_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes.").optional(),file_sizes:t.optional().describe(`This object is not populated by the cluster stats API.
8
+ To get information on segment files, use the node stats API.`),max_unsafe_auto_id_timestamp:e.number().describe("Unix timestamp, in milliseconds, of the most recently retried indexing request.").optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),fixed_bit_set_memory_in_bytes:e.number().describe("Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes.").optional(),term_vectors_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.").optional(),points_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.").optional(),index_writer_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.").optional(),memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes.").optional(),doc_values_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes.").optional(),terms_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.").optional(),stored_fields_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.").optional()}),k=e.object({replication:o.optional().describe("Ratio of replica shards to primary shards across all selected nodes."),primaries:o.optional().describe("Number of primary shards assigned to selected nodes."),shards:o.optional()}),N=e.object({total_data_set_size_in_bytes:e.number().describe(`Total data set size, in bytes, of all shards assigned to selected nodes.
9
+ This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.`).optional(),reserved_in_bytes:e.number().describe("A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.").optional(),size_in_bytes:e.number().describe("Total size, in bytes, of all shards assigned to selected nodes.").optional()}),w=e.object({total_primary_bytes:e.number().optional(),primary_shard_count:e.number().optional(),version:e.string().optional(),index_count:e.number().optional()}),P=e.object({total:e.number().describe("Total number of cluster states in queue.").optional(),failed:e.number().describe("Total number of failed ingest operations during the lifetime of this node.").optional(),successful:e.number().describe("Number of nodes that responded successfully to the request.").optional()}),I=e.object({snapshots:e.number().optional(),snapshot_deletions:e.number().optional(),cleanups:e.number().optional(),shard_snapshots:e.number().optional(),concurrent_operations:e.number().optional()}),A=e.object({failure_reasons:t.optional().describe("Statistics about the reasons for cross-cluster search request failures. The keys are the failure reason names and the values are the number of requests that failed for that reason."),features:t.optional().describe("The keys are the names of the search feature, and the values are the number of requests that used that feature. Single request can use more than one feature (e.g. both `async` and `wildcard`)."),remotes_per_search_max:e.number().describe("The maximum number of remote clusters that were queried in a single cross-cluster search request.").optional(),took:s.optional(),total:e.number().describe("Total number of cluster states in queue.").optional(),clients:t.optional().describe("Information on current and recently-closed HTTP client connections.\nClients that have been closed longer than the `http.client_stats.closed_channels.max_age` setting will not be represented here."),success:e.number().describe("The total number of cross-cluster search requests that have been successfully executed by the cluster.").optional(),took_mrt_true:s.optional(),took_mrt_false:s.optional(),clusters:t.optional().describe("Statistics about the clusters that were queried in cross-cluster search requests. The keys are cluster names, and the values are per-cluster telemetry data. This also includes the local cluster itself, which uses the name `(local)`."),remotes_per_search_avg:e.number().describe("The average number of remote clusters that were queried in a single cross-cluster search request.").optional(),skipped:e.number().describe("The total number of cross-cluster search requests (successful or failed) that had at least one remote cluster skipped.").optional()}),O=e.object({current:c.optional().describe("Total number of documents currently being ingested."),total:l.optional().describe("Total number of cluster states in queue."),limit_in_bytes:e.number().describe(`Configured memory limit, in bytes, for the indexing requests.
10
+ Replica requests have an automatic limit that is 1.5x this value.`).optional()}),J=e.object({number_of_pipelines:e.number().optional(),processor_stats:e.record(e.string(),d).optional()}),R=e.object({max_uptime_in_millis:e.number().optional(),mem:p.optional(),versions:e.array(u).describe("Array of Elasticsearch versions used on selected nodes.").optional(),threads:m.optional().describe("Number of active threads in use by JVM across all selected nodes.")}),F=e.object({http_types:n.optional().describe("Contains statistics about the HTTP network types used by selected nodes."),transport_types:n.optional().describe("Contains statistics about the transport network types used by selected nodes.")}),V=e.object({architectures:e.array(b).describe("Contains statistics about processor architectures (for example, x86_64 or aarch64) used by selected nodes.").optional(),available_processors:e.number().describe("Number of processors available to the Java virtual machine").optional(),pretty_names:e.array(f).describe("Contains statistics about operating systems used by selected nodes.").optional(),names:e.array(h).describe("Contains statistics about operating systems used by selected nodes.").optional(),mem:y.optional(),allocated_processors:e.number().describe("The number of processors actually used to calculate thread pool size. This number can be set with the node.processors setting of a node and defaults to the number of processors reported by the OS.").optional()}),D=e.object({open_file_descriptors:o.optional().describe("Number of opened file descriptors associated with the current or `-1` if not supported."),cpu:g.optional()}),E=e.object({global_ordinals:v.optional(),memory_size_in_bytes:e.number().describe("Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.").optional(),evictions:e.number().describe("Total number of query cache evictions across all shards assigned to selected nodes.").optional()}),G=e.object({field_types:e.array(z).describe("Contains statistics about field data types used in selected nodes.").optional(),total_deduplicated_mapping_size_in_bytes:e.number().describe("Total size of all mappings, in bytes, after deduplication and compression.").optional(),total_deduplicated_field_count:e.number().describe("Total number of fields in all non-system indices, accounting for mapping deduplication.").optional(),source_modes:j.optional(),runtime_field_types:e.array(e.any()).describe("Contains statistics about runtime field data types used in selected nodes.").optional(),total_field_count:e.number().describe("Total number of fields in all non-system indices.").optional()}),L=e.object({total:e.number().describe("Total number of cluster states in queue.").optional(),retrievers:t.optional(),queries:e.record(e.string(),e.number()).optional(),rescorers:t.optional(),sections:q.optional()}),Q=e.object({replication:e.number().describe("Ratio of replica shards to primary shards across all selected nodes.").optional(),primaries:e.number().describe("Number of primary shards assigned to selected nodes.").optional(),total:e.number().describe("Total number of cluster states in queue.").optional(),index:k.optional()}),U=e.object({repositories:t.optional(),current_counts:I.optional()}),H=e.object({_search:A.optional()}),B=e.object({memory:O.optional()}),K=e.object({completion:S.optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),store:N.optional(),analysis:x.optional(),sparse_vector:r.optional(),dense_vector:r.optional(),segments:M.optional(),shards:Q.optional(),mappings:G.optional(),search:L.optional(),query_cache:C.optional(),docs:T.optional(),fielddata:E.optional(),versions:e.array(w).describe("Array of Elasticsearch versions used on selected nodes.").optional()}),W=e.object({jvm:R.optional(),process:D.optional(),network_types:F.optional(),os:V.optional(),discovery_types:a.optional().describe("Contains statistics about the discovery types used by selected nodes."),versions:e.array(e.string()).describe("Array of Elasticsearch versions used on selected nodes.").optional(),plugins:e.array(e.any()).describe(`Contains statistics about installed plugins and modules by selected nodes.
11
+ If no plugins or modules are installed, this array is empty.`).optional(),count:e.record(e.string(),e.number()).optional(),packaging_types:e.array(_).describe("Contains statistics about Elasticsearch distributions installed on selected nodes.").optional(),fs:i.optional(),indexing_pressure:B.optional(),ingest:J.optional()}),X=e.object({snapshots:U.optional(),cluster_name:e.string().optional(),ccs:H.optional(),indices:K.optional(),nodes:W.optional(),cluster_uuid:e.string().optional(),repositories:t.optional(),_nodes:P.optional(),status:e.string().optional(),timestamp:e.number().describe(`Last time the statistics were refreshed.
12
+ Recorded in milliseconds since the Unix Epoch.`).optional()});export{x as AnalysisSchema,b as ArchitectureSchema,H as CcsSchema,X as ClusterStatsSchema,S as CompletionSchema,g as CpuSchema,I as CurrentCountsSchema,c as CurrentSchema,a as DiscoveryTypesSchema,T as DocsSchema,z as FieldTypeSchema,E as FielddataSchema,i as FsSchema,v as GlobalOrdinalsSchema,k as IndexSchema,B as IndexingPressureSchema,K as IndicesSchema,w as IndicesVersionSchema,J as IngestSchema,p as JvmMemSchema,R as JvmSchema,u as JvmVersionSchema,G as MappingsSchema,O as MemorySchema,h as NameSchema,F as NetworkTypesSchema,W as NodesClassSchema,P as NodesSchema,o as OpenFileDescriptorsSchema,y as OsMemSchema,V as OsSchema,_ as PackagingTypeSchema,f as PrettyNameSchema,D as ProcessSchema,d as ProcessorStatSchema,C as QueryCacheSchema,t as RepositoriesSchema,r as SeVectorSchema,L as SearchClassSchema,A as SearchSchema,q as SectionsSchema,M as SegmentsSchema,Q as ShardsSchema,U as SnapshotsSchema,j as SourceModesSchema,N as StoreSchema,m as ThreadsSchema,s as TookSchema,l as TotalSchema,n as TypesSchema};
@@ -0,0 +1 @@
1
+ import{z as t}from"zod";const e=t.object({type:t.literal("markdown"),title:t.string().optional(),body:t.string().optional()}),r=t.object({type:t.literal("echarts"),title:t.string().optional(),description:t.string().optional(),options:t.record(t.any()).default({})}),o=t.object({type:t.literal("recharts"),title:t.string().optional(),description:t.string().optional(),component:t.string(),data:t.array(t.record(t.any())),props:t.record(t.any()).optional(),children:t.array(t.lazy(()=>o)).optional()}),a=t.discriminatedUnion("type",[e,r,o]),n=t.object({session_id:t.string(),result:t.object({content:t.array(a)})});export{a as BlockSchema,n as DashboardSchema,r as EchartsBlockSchema,e as MarkdownBlockSchema,o as RechartsBlockSchema};
@@ -0,0 +1 @@
1
+ import*as t from"zod";const e=t.object({limit:t.string().optional()}),o=t.object({_tier_preference:t.string().optional()}),n=t.object({created:t.string().optional()}),i=t.object({total_fields:e.optional()}),a=t.object({include:o.optional()}),p=t.object({allocation:a.optional()}),r=t.object({routing:p.optional(),mapping:i.optional(),hidden:t.string().optional(),number_of_shards:t.string().optional(),tier:t.string().optional(),provided_name:t.string().optional(),creation_date:t.string().optional(),creation_date_parsed:t.coerce.date().optional(),number_of_replicas:t.string().optional(),uuid:t.string().optional(),version:n.optional(),age:t.number().optional()}),c=t.object({indices:t.array(t.object({key:t.string().optional(),stats:r.optional()}))});export{a as AllocationSchema,c as ClusterStatsSchema,o as IncludeSchema,i as MappingSchema,p as RoutingSchema,r as SettingsSchema,e as TotalFieldsSchema,n as VersionSchema};
@@ -0,0 +1 @@
1
+ import*as t from"zod";const n=t.object({prirep:t.string().optional(),node:t.union([t.null(),t.string()]).optional(),docs:t.union([t.number(),t.null()]).optional(),ip:t.union([t.null(),t.string()]).optional(),index:t.string().optional(),shard:t.string().optional(),state:t.string().optional(),store:t.union([t.number(),t.null()]).optional(),dataset:t.union([t.null(),t.string()]).optional()}),o=t.object({indices:t.array(t.object({key:t.string().optional(),shards:t.array(n.optional())}))});export{o as ClusterStatsSchema,n as ShardSchema};
@@ -0,0 +1 @@
1
+ import*as e from"zod";const o=e.object({avg_time_in_millis:e.number().optional(),avg_size_in_bytes:e.number().optional(),total_time_in_millis:e.number().optional(),total_operations:e.number().optional(),total_size_in_bytes:e.number().optional()}),n=e.object({size_in_bytes:e.number().optional()}),i=e.object({value_count:e.number().optional()}),r=e.object({deleted:e.number().optional(),count:e.number().optional(),total_size_in_bytes:e.number().optional()}),a=e.object({build_time_in_millis:e.number().optional()}),l=e.object({total_time_excluding_waiting_on_lock_in_millis:e.number().optional(),total:e.number().optional(),total_time_in_millis:e.number().optional(),periodic:e.number().optional()}),m=e.object({current:e.number().optional(),total:e.number().optional(),missing_total:e.number().optional(),missing_time_in_millis:e.number().optional(),exists_time_in_millis:e.number().optional(),time_in_millis:e.number().optional(),exists_total:e.number().optional()}),p=e.object({delete_time_in_millis:e.number().optional(),throttle_time_in_millis:e.number().optional(),write_load:e.number().optional(),delete_current:e.number().optional(),index_time_in_millis:e.number().optional(),is_throttled:e.boolean().optional(),index_total:e.number().optional(),delete_total:e.number().optional(),index_current:e.number().optional(),noop_update_total:e.number().optional(),index_failed:e.number().optional()}),s=e.object({current:e.number().optional(),total:e.number().optional(),total_time_in_millis:e.number().optional(),current_docs:e.number().optional(),total_auto_throttle_in_bytes:e.number().optional(),total_docs:e.number().optional(),total_size_in_bytes:e.number().optional(),total_stopped_time_in_millis:e.number().optional(),current_size_in_bytes:e.number().optional(),total_throttled_time_in_millis:e.number().optional()}),_=e.object({miss_count:e.number().optional(),cache_size:e.number().optional(),memory_size_in_bytes:e.number().optional(),total_count:e.number().optional(),evictions:e.number().optional(),hit_count:e.number().optional(),cache_count:e.number().optional()}),c=e.object({current_as_source:e.number().optional(),throttle_time_in_millis:e.number().optional(),current_as_target:e.number().optional()}),b=e.object({external_total_time_in_millis:e.number().optional(),total:e.number().optional(),listeners:e.number().optional(),total_time_in_millis:e.number().optional(),external_total:e.number().optional()}),u=e.object({miss_count:e.number().optional(),memory_size_in_bytes:e.number().optional(),evictions:e.number().optional(),hit_count:e.number().optional()}),y=e.object({}),h=e.object({total_count:e.number().optional()}),S=e.object({total_data_set_size_in_bytes:e.number().optional(),reserved_in_bytes:e.number().optional(),size_in_bytes:e.number().optional()}),x=e.object({operations:e.number().optional(),earliest_last_modified_age:e.number().optional(),size_in_bytes:e.number().optional(),uncommitted_operations:e.number().optional(),uncommitted_size_in_bytes:e.number().optional()}),f=e.object({current:e.number().optional(),total:e.number().optional(),total_time_in_millis:e.number().optional()}),d=e.object({memory_size_in_bytes:e.number().optional(),global_ordinals:a.optional(),evictions:e.number().optional()}),z=e.object({version_map_memory_in_bytes:e.number().optional(),norms_memory_in_bytes:e.number().optional(),file_sizes:y.optional(),max_unsafe_auto_id_timestamp:e.number().optional(),count:e.number().optional(),fixed_bit_set_memory_in_bytes:e.number().optional(),term_vectors_memory_in_bytes:e.number().optional(),points_memory_in_bytes:e.number().optional(),index_writer_memory_in_bytes:e.number().optional(),memory_in_bytes:e.number().optional(),doc_values_memory_in_bytes:e.number().optional(),terms_memory_in_bytes:e.number().optional(),stored_fields_memory_in_bytes:e.number().optional()}),t=e.object({completion:n.optional(),shard_stats:h.optional(),translog:x.optional(),indexing:p.optional(),refresh:b.optional(),store:S.optional(),recovery:c.optional(),dense_vector:i.optional(),segments:z.optional(),warmer:f.optional(),search:e.record(e.string(),e.number()).optional(),query_cache:_.optional(),docs:r.optional(),fielddata:d.optional(),flush:l.optional(),get:m.optional(),request_cache:u.optional(),bulk:o.optional(),merges:s.optional()}),g=e.object({primaries:t.optional(),total:t.optional(),datastream:e.string().optional(),health:e.string().optional(),uuid:e.string().optional(),status:e.string().optional()}),j=e.object({indices:e.array(e.object({key:e.string().optional(),stats:g.optional()}))});export{o as BulkSchema,j as ClusterStatsSchema,n as CompletionSchema,i as DenseVectorSchema,r as DocsSchema,d as FielddataSchema,y as FileSizesSchema,l as FlushSchema,m as GetSchema,a as GlobalOrdinalsSchema,p as IndexingSchema,s as MergesSchema,t as PrimariesSchema,_ as QueryCacheSchema,c as RecoverySchema,b as RefreshSchema,u as RequestCacheSchema,z as SegmentsSchema,h as ShardStatsSchema,g as StatsSchema,S as StoreSchema,x as TranslogSchema,f as WarmerSchema};
@@ -0,0 +1,2 @@
1
+ import*as o from"zod";const e=o.object({"ml.allocated_processors_double":o.string().optional(),server_name:o.string().optional(),"ml.machine_memory":o.string().optional(),"xpack.installed":o.string().optional(),"transform.config_version":o.string().optional(),"ml.config_version":o.string().optional(),"ml.max_jvm_size":o.string().optional(),"ml.allocated_processors":o.string().optional()}),t=o.object({api_key_version:o.number().optional(),ml_config_version:o.number().optional(),transform_config_version:o.number().optional()}),n=o.object({publish_address:o.string().optional(),bound_address:o.array(o.string()).optional(),max_content_length_in_bytes:o.number().optional()}),i=o.object({heap_init_in_bytes:o.number().optional(),non_heap_max_in_bytes:o.number().optional(),heap_max_in_bytes:o.number().describe("Maximum amount of memory, in bytes, available for use by the heap.").optional(),non_heap_init_in_bytes:o.number().optional(),direct_max_in_bytes:o.number().optional()}),r=o.object({available_processors:o.number().describe("Number of processors available to the Java virtual machine").optional(),refresh_interval_in_millis:o.number().optional(),pretty_name:o.string().optional(),name:o.string().optional(),allocated_processors:o.number().describe("The number of processors actually used to calculate thread pool size. This number can be set with the node.processors setting of a node and defaults to the number of processors reported by the OS.").optional(),arch:o.string().describe("Name of the JVM architecture (ex: amd64, x86)").optional(),version:o.string().optional()}),s=o.object({using_bundled_jdk:o.boolean().optional(),vm_version:o.string().optional(),mem:i.optional(),gc_collectors:o.array(o.string()).optional(),using_compressed_ordinary_object_pointers:o.string().optional(),vm_vendor:o.string().optional(),pid:o.number().optional(),start_time_in_millis:o.number().optional(),memory_pools:o.array(o.string()).optional(),input_arguments:o.array(o.string()).optional(),version:o.string().optional(),vm_name:o.string().optional()}),a=o.object({component_versions:t.optional(),plugins:o.array(o.any()).describe(`Contains statistics about installed plugins and modules by selected nodes.
2
+ If no plugins or modules are installed, this array is empty.`).optional(),roles:o.array(o.string()).describe("* @doc_id node-roles").optional(),build_hash:o.string().describe("Short hash of the last git commit in this release.").optional(),index_version:o.number().optional(),transport_version:o.number().optional(),build_flavor:o.string().optional(),host:o.string().optional(),build_type:o.string().optional(),jvm:s.optional(),os:r.optional(),total_indexing_buffer:o.number().describe("Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings.").optional(),ip:o.string().describe("IP address and port for the node.").optional(),transport_address:o.string().optional(),version:o.string().optional(),name:o.string().optional(),http:n.optional(),attributes:e.optional().describe("Contains a list of attributes for the node."),node_id:o.string().optional()}),p=o.object({nodes:o.array(o.object({key:o.string().optional(),info:a.optional()}))});export{e as AttributesSchema,p as ClusterStatsSchema,t as ComponentVersionsSchema,n as HttpSchema,a as InfoSchema,s as JvmSchema,i as MemSchema,r as OsSchema};
@@ -0,0 +1,11 @@
1
+ import*as e from"zod";const i=e.object({"ml.allocated_processors_double":e.string().optional(),server_name:e.string().optional(),"ml.machine_memory":e.string().optional(),"xpack.installed":e.string().optional(),"transform.config_version":e.string().optional(),"ml.config_version":e.string().optional(),"ml.max_jvm_size":e.string().optional(),"ml.allocated_processors":e.string().optional()}),a=e.object({low_watermark_free_space_in_bytes:e.number().optional(),path:e.string().optional(),total_in_bytes:e.number().describe("Total amount of physical memory in bytes.").optional(),high_watermark_free_space_in_bytes:e.number().optional(),free_in_bytes:e.number().describe("Amount of free physical memory in bytes.").optional(),available_in_bytes:e.number().describe("Total number of bytes available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free_in_bytes`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise.").optional(),type:e.string().describe("string").optional(),mount:e.string().optional(),flood_stage_free_space_in_bytes:e.number().optional()}),r=e.object({total_in_bytes:e.number().describe("Total amount of physical memory in bytes.").optional(),free_in_bytes:e.number().describe("Amount of free physical memory in bytes.").optional(),available_in_bytes:e.number().describe("Total number of bytes available to this Java virtual machine on all file stores.\nDepending on OS or process level restrictions, this might appear less than `free_in_bytes`.\nThis is the actual amount of free disk space the Elasticsearch node can utilise.").optional()}),l=e.object({avg_time_in_millis:e.number().optional(),avg_size_in_bytes:e.number().optional(),total_time_in_millis:e.number().optional(),total_operations:e.number().optional(),total_size_in_bytes:e.number().optional()}),c=e.object({size_in_bytes:e.number().describe("Total size, in bytes, of all shards assigned to selected nodes.").optional()}),n=e.object({value_count:e.number().optional()}),m=e.object({deleted:e.number().describe(`Total number of deleted documents across all primary shards assigned to selected nodes.
2
+ This number is based on documents in Lucene segments.
3
+ Elasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.`).optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),total_size_in_bytes:e.number().optional()}),p=e.object({build_time_in_millis:e.number().optional()}),d=e.object({total:e.number().describe("Total number of cluster states in queue.").optional(),total_time_excluding_waiting_on_lock_in_millis:e.number().optional(),total_time_in_millis:e.number().optional(),periodic:e.number().optional()}),b=e.object({current:e.number().describe("Total number of documents currently being ingested.").optional(),total:e.number().describe("Total number of cluster states in queue.").optional(),missing_total:e.number().optional(),exists_time_in_millis:e.number().optional(),missing_time_in_millis:e.number().optional(),time_in_millis:e.number().optional(),exists_total:e.number().optional()}),u=e.object({delete_time_in_millis:e.number().optional(),index_failed_due_to_version_conflict:e.number().optional(),throttle_time_in_millis:e.number().optional(),write_load:e.number().optional(),delete_current:e.number().optional(),index_time_in_millis:e.number().optional(),index_total:e.number().optional(),is_throttled:e.boolean().optional(),delete_total:e.number().optional(),index_current:e.number().optional(),noop_update_total:e.number().optional(),index_failed:e.number().optional()}),h=e.object({total_estimated_overhead_in_bytes:e.number().optional(),total_count:e.number().describe("Total count of hits and misses in the query cache across all shards assigned to selected nodes.").optional(),average_fields_per_segment:e.number().optional(),total_segments:e.number().optional(),total_segment_fields:e.number().optional()}),_=e.object({current:e.number().describe("Total number of documents currently being ingested.").optional(),total:e.number().describe("Total number of cluster states in queue.").optional(),total_time_in_millis:e.number().optional(),current_docs:e.number().optional(),total_auto_throttle_in_bytes:e.number().optional(),total_docs:e.number().optional(),total_size_in_bytes:e.number().optional(),current_size_in_bytes:e.number().optional(),total_stopped_time_in_millis:e.number().optional(),total_throttled_time_in_millis:e.number().optional()}),y=e.object({miss_count:e.number().describe("Total count of query cache misses across all shards assigned to selected nodes.").optional(),cache_size:e.number().describe("Total number of entries currently in the query cache across all shards assigned to selected nodes.").optional(),memory_size_in_bytes:e.number().describe("Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.").optional(),total_count:e.number().describe("Total count of hits and misses in the query cache across all shards assigned to selected nodes.").optional(),evictions:e.number().describe("Total number of query cache evictions across all shards assigned to selected nodes.").optional(),hit_count:e.number().describe("Total count of query cache hits across all shards assigned to selected nodes.").optional(),cache_count:e.number().describe(`Total number of entries added to the query cache across all shards assigned to selected nodes.
4
+ This number includes current and evicted entries.`).optional()}),f=e.object({current_as_source:e.number().optional(),throttle_time_in_millis:e.number().optional(),current_as_target:e.number().optional()}),g=e.object({external_total_time_in_millis:e.number().optional(),total:e.number().describe("Total number of cluster states in queue.").optional(),listeners:e.number().optional(),total_time_in_millis:e.number().optional(),external_total:e.number().optional()}),x=e.object({miss_count:e.number().describe("Total count of query cache misses across all shards assigned to selected nodes.").optional(),memory_size_in_bytes:e.number().describe("Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.").optional(),evictions:e.number().describe("Total number of query cache evictions across all shards assigned to selected nodes.").optional(),hit_count:e.number().describe("Total count of query cache hits across all shards assigned to selected nodes.").optional()}),S=e.object({}),T=e.object({total_count:e.number().describe("Total count of hits and misses in the query cache across all shards assigned to selected nodes.").optional()}),z=e.object({total_data_set_size_in_bytes:e.number().describe(`Total data set size, in bytes, of all shards assigned to selected nodes.
5
+ This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.`).optional(),reserved_in_bytes:e.number().describe("A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.").optional(),size_in_bytes:e.number().describe("Total size, in bytes, of all shards assigned to selected nodes.").optional()}),v=e.object({operations:e.number().describe("The total number of read and write operations for the device completed since starting Elasticsearch.").optional(),earliest_last_modified_age:e.number().optional(),size_in_bytes:e.number().describe("Total size, in bytes, of all shards assigned to selected nodes.").optional(),uncommitted_operations:e.number().optional(),uncommitted_size_in_bytes:e.number().optional()}),j=e.object({current:e.number().describe("Total number of documents currently being ingested.").optional(),total:e.number().describe("Total number of cluster states in queue.").optional(),total_time_in_millis:e.number().optional()}),t=e.object({used_in_bytes:e.number().describe("Amount of used physical memory in bytes.").optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),total_capacity_in_bytes:e.number().optional()}),C=e.object({total_loaded_count:e.number().describe("Total number of classes loaded since the JVM started.").optional(),total_unloaded_count:e.number().describe("Total number of classes unloaded since the JVM started.").optional(),current_loaded_count:e.number().describe("Number of classes currently loaded by JVM.").optional()}),s=e.object({collection_count:e.number().optional(),collection_time_in_millis:e.number().optional()}),o=e.object({used_in_bytes:e.number().describe("Amount of used physical memory in bytes.").optional(),peak_used_in_bytes:e.number().optional(),max_in_bytes:e.number().optional(),peak_max_in_bytes:e.number().optional()}),q=e.object({count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),peak_count:e.number().describe("Highest number of threads used by JVM.").optional()}),w=e.object({number_of_elapsed_periods:e.number().describe("The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed.").optional(),number_of_times_throttled:e.number().describe("The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled.").optional(),time_throttled_nanos:e.number().optional()}),M=e.object({control_group:e.string().describe("The `memory` control group to which the Elasticsearch process belongs.").optional(),usage_nanos:e.number().optional()}),k=e.object({usage_in_bytes:e.string().describe("The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the Elasticsearch process.\nThis value is stored as a string for consistency with `limit_in_bytes`.").optional(),control_group:e.string().describe("The `memory` control group to which the Elasticsearch process belongs.").optional(),limit_in_bytes:e.string().describe(`Configured memory limit, in bytes, for the indexing requests.
6
+ Replica requests have an automatic limit that is 1.5x this value.`).optional()}),A=e.object({"5m":e.number().optional(),"15m":e.number().optional(),"1m":e.number().optional()}),G=e.object({used_in_bytes:e.number().describe("Amount of used physical memory in bytes.").optional(),free_percent:e.number().describe("Percentage of free memory.").optional(),adjusted_total_in_bytes:e.number().describe("If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.\nOtherwise it reports the same value as `total_in_bytes`.").optional(),total_in_bytes:e.number().describe("Total amount of physical memory in bytes.").optional(),free_in_bytes:e.number().describe("Amount of free physical memory in bytes.").optional(),used_percent:e.number().describe("Percentage of used memory.").optional()}),J=e.object({used_in_bytes:e.number().describe("Amount of used physical memory in bytes.").optional(),total_in_bytes:e.number().describe("Total amount of physical memory in bytes.").optional(),free_in_bytes:e.number().describe("Amount of free physical memory in bytes.").optional()}),E=e.object({total:r.optional().describe("Total number of cluster states in queue."),data:e.array(a).describe("List of all file stores.").optional(),timestamp:e.number().describe(`Last time the statistics were refreshed.
7
+ Recorded in milliseconds since the Unix Epoch.`).optional()}),O=e.object({global_ordinals:p.optional(),memory_size_in_bytes:e.number().describe("Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.").optional(),evictions:e.number().describe("Total number of query cache evictions across all shards assigned to selected nodes.").optional()}),P=e.object({version_map_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes.").optional(),norms_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes.").optional(),file_sizes:S.optional().describe(`This object is not populated by the cluster stats API.
8
+ To get information on segment files, use the node stats API.`),max_unsafe_auto_id_timestamp:e.number().describe("Unix timestamp, in milliseconds, of the most recently retried indexing request.").optional(),count:e.number().describe("Total number of segments across all shards assigned to selected nodes.").optional(),fixed_bit_set_memory_in_bytes:e.number().describe("Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes.").optional(),term_vectors_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.").optional(),points_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.").optional(),index_writer_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.").optional(),memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes.").optional(),doc_values_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes.").optional(),terms_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.").optional(),stored_fields_memory_in_bytes:e.number().describe("Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.").optional()}),R=e.object({"mapped - 'non-volatile memory'":t.optional(),direct:t.optional(),mapped:t.optional()}),F=e.object({young:s.optional(),"G1 Concurrent GC":s.optional(),old:s.optional()}),D=e.object({"CodeHeap 'profiled nmethods'":o.optional(),young:o.optional(),old:o.optional(),"CodeHeap 'non-profiled nmethods'":o.optional(),"Compressed Class Space":o.optional(),Metaspace:o.optional(),"CodeHeap 'non-nmethods'":o.optional(),survivor:o.optional()}),V=e.object({stat:w.optional(),control_group:e.string().describe("The `memory` control group to which the Elasticsearch process belongs.").optional(),cfs_period_micros:e.number().describe("The period of time, in microseconds, for how regularly all tasks in the same cgroup as the Elasticsearch process should have their access to CPU resources reallocated.").optional(),cfs_quota_micros:e.number().describe("The total amount of time, in microseconds, for which all tasks in the same cgroup as the Elasticsearch process can run during one period `cfs_period_micros`.").optional()}),I=e.object({load_average:A.optional(),percent:e.number().describe("Percentage of CPU used across all selected nodes.\nReturns `-1` if not supported.").optional()}),L=e.object({completion:c.optional(),shard_stats:T.optional(),indexing:u.optional(),translog:v.optional(),refresh:g.optional(),recovery:f.optional(),store:z.optional(),sparse_vector:n.optional(),dense_vector:n.optional(),segments:P.optional(),warmer:j.optional(),mappings:h.optional(),search:e.record(e.string(),e.number()).optional(),query_cache:y.optional(),docs:m.optional(),fielddata:O.optional(),flush:d.optional(),get:b.optional(),request_cache:x.optional(),bulk:l.optional(),merges:_.optional()}),N=e.object({collectors:F.optional().describe("Contains statistics about JVM garbage collectors for the node.")}),H=e.object({heap_committed_in_bytes:e.number().describe("Amount of memory, in bytes, available for use by the heap.").optional(),heap_used_percent:e.number().describe("Percentage of memory currently in use by the heap.").optional(),heap_max_in_bytes:e.number().describe("Maximum amount of memory, in bytes, available for use by the heap.").optional(),non_heap_committed_in_bytes:e.number().describe("Amount of non-heap memory available, in bytes.").optional(),pools:D.optional().describe("Contains statistics about heap memory usage for the node."),heap_used_in_bytes:e.number().describe("Memory, in bytes, currently in use by the heap.").optional(),non_heap_used_in_bytes:e.number().describe("Non-heap memory used, in bytes.").optional()}),U=e.object({memory:k.optional(),cpu:V.optional(),cpuacct:M.optional()}),B=e.object({mem:H.optional(),classes:C.optional(),threads:q.optional().describe("Number of active threads in use by JVM across all selected nodes."),uptime_in_millis:e.number().describe("JVM uptime in milliseconds.").optional(),gc:N.optional(),buffer_pools:R.optional().describe("Contains statistics about JVM buffer pools for the node."),timestamp:e.number().describe(`Last time the statistics were refreshed.
9
+ Recorded in milliseconds since the Unix Epoch.`).optional()}),Q=e.object({mem:G.optional(),swap:J.optional(),cpu:I.optional(),cgroup:U.optional(),timestamp:e.number().describe(`Last time the statistics were refreshed.
10
+ Recorded in milliseconds since the Unix Epoch.`).optional()}),W=e.object({jvm:B.optional(),os:Q.optional(),ip:e.string().describe("IP address and port for the node.").optional(),roles:e.array(e.string()).describe("* @doc_id node-roles").optional(),transport_address:e.string().optional(),fs:E.optional(),indices:L.optional(),host:e.string().optional(),name:e.string().optional(),attributes:i.optional().describe("Contains a list of attributes for the node."),node_id:e.string().optional(),timestamp:e.number().describe(`Last time the statistics were refreshed.
11
+ Recorded in milliseconds since the Unix Epoch.`).optional()}),K=e.object({nodes:e.array(e.object({key:e.string().optional(),stats:W.optional()}))});export{i as AttributesSchema,R as BufferPoolsSchema,l as BulkSchema,V as CgroupCpuSchema,U as CgroupSchema,C as ClassesSchema,K as ClusterStatsSchema,o as CodeHeapNonNmethodsSchema,F as CollectorsSchema,c as CompletionSchema,M as CpuacctSchema,a as DatumSchema,t as DirectSchema,m as DocsSchema,O as FielddataSchema,S as FileSizesSchema,d as FlushSchema,E as FsSchema,s as G1ConcurrentGcSchema,N as GcSchema,b as GetSchema,p as GlobalOrdinalsSchema,u as IndexingSchema,L as IndicesSchema,H as JvmMemSchema,B as JvmSchema,A as LoadAverageSchema,h as MappingsSchema,k as MemorySchema,_ as MergesSchema,I as OsCpuSchema,G as OsMemSchema,Q as OsSchema,D as PoolsSchema,y as QueryCacheSchema,f as RecoverySchema,g as RefreshSchema,x as RequestCacheSchema,n as SeVectorSchema,P as SegmentsSchema,T as ShardStatsSchema,w as StatSchema,W as StatsSchema,z as StoreSchema,J as SwapSchema,q as ThreadsSchema,r as TotalSchema,v as TranslogSchema,j as WarmerSchema};
@@ -0,0 +1 @@
1
+ import*as e from"zod";const t=e.enum(["$"]),o=e.enum(["gcp"]),r=e.enum(["europe-north1","europe-west1","europe-west2"]),n=e.enum(["GB","GB-hour","GB/month","1k requests"]),i=e.object({standard:e.string().optional(),gold:e.string().optional(),unit:n.optional(),platinum:e.string().optional(),enterprise:e.string().optional(),price:e.number().optional(),valid_from:e.coerce.date().optional(),currency:t.optional(),instance_tags:e.array(e.string()).optional(),instance_type:e.string().optional(),region_instance_type:e.string().optional(),provider:o.optional(),region:r.optional()}),p=e.object({time:e.coerce.date().optional(),pricing:e.array(i).optional()});export{p as ClusterStatsSchema,t as CurrencySchema,i as PricingSchema,o as ProviderSchema,r as RegionSchema,n as UnitSchema};
@@ -0,0 +1 @@
1
+ import{z as o}from"zod";const l=o.object({type:o.literal("markdown"),id:o.string().optional(),title:o.string().optional(),body:o.string().optional(),_toolCallId:o.string().optional()}),s=o.object({type:o.literal("echarts"),id:o.string().optional(),title:o.string().optional(),description:o.string().optional(),options:o.record(o.any()).default({}),_toolCallId:o.string().optional()}),p=o.object({type:o.literal("eui"),id:o.string().optional(),title:o.string().optional(),description:o.string().optional(),body:o.string().optional()}),c=o.object({type:o.literal("raw"),id:o.string().optional(),title:o.string().optional(),content:o.any(),error:o.string().optional()}),m=o.object({component:o.string().optional(),props:o.record(o.any()).optional()}),g=o.object({type:o.literal("recharts"),id:o.string().optional(),title:o.string().optional(),description:o.string().optional(),component:o.string().optional(),data:o.array(o.record(o.any())).optional(),props:o.record(o.any()).optional(),children:o.array(m).optional()}),u=o.object({type:o.literal("table"),id:o.string().optional(),title:o.string().optional(),description:o.string().optional(),_toolCallId:o.string().optional(),data:o.array(o.union([o.record(o.any()),o.array(o.any())])),columns:o.array(o.union([o.string().transform(t=>({field:t,name:t.charAt(0).toUpperCase()+t.slice(1).replace(/_/g," "),label:t})),o.object({field:o.string().optional(),key:o.string().optional(),name:o.string().optional(),headerName:o.string().optional(),label:o.string().optional(),sortable:o.boolean().optional(),dataType:o.enum(["string","number","date","boolean","auto"]).optional(),width:o.union([o.string(),o.number()]).optional().transform(t=>t!=null?String(t):void 0)})])).optional()}),b=o.object({type:o.literal("mermaid"),id:o.string().optional(),title:o.string().optional(),description:o.string().optional(),body:o.string(),theme:o.enum(["default","dark","forest","neutral"]).optional(),chartImage:o.string().optional(),_toolCallId:o.string().optional()}),d=o.object({value:o.number(),label:o.string(),prefix:o.string().optional(),suffix:o.string().optional(),color:o.string().optional(),durationInFrames:o.number().optional()}),y=o.object({value:o.number(),max:o.number().positive().optional(),label:o.string(),color:o.string().optional(),suffix:o.string().optional(),durationInFrames:o.number().optional()}),h=o.object({value:o.number(),max:o.number().positive().optional(),label:o.string(),color:o.string().optional(),durationInFrames:o.number().optional()}),f=o.object({before:o.number(),after:o.number(),label:o.string(),prefix:o.string().optional(),suffix:o.string().optional(),color:o.string().optional(),durationInFrames:o.number().optional()}),S=o.object({title:o.string(),items:o.array(o.object({label:o.string(),value:o.number(),color:o.string().optional()})).min(1),suffix:o.string().optional(),durationInFrames:o.number().optional()}),x=o.object({title:o.string(),value:o.string(),data:o.array(o.number()).min(2),color:o.string().optional(),trendLabel:o.string().optional(),durationInFrames:o.number().optional()}),j=o.object({title:o.string(),slices:o.array(o.object({label:o.string(),value:o.number().nonnegative(),color:o.string()})).min(1),centerLabel:o.string().optional(),durationInFrames:o.number().optional()}),k=o.object({title:o.string(),steps:o.array(o.object({title:o.string(),detail:o.string().optional()})).min(1),color:o.string().optional(),durationInFrames:o.number().optional()}),I=o.object({eyebrow:o.string().optional(),title:o.string(),body:o.string(),accent:o.string().optional(),durationInFrames:o.number().optional()}),R=o.object({title:o.string(),items:o.array(o.object({value:o.string(),label:o.string(),color:o.string().optional()})).min(1),durationInFrames:o.number().optional()}),P=["stat-reveal","progress-bar","radial-gauge","before-after","ranking-list","sparkline-card","donut-breakdown","timeline-steps","insight-card","kpi-sequence"],w={"stat-reveal":d,"progress-bar":y,"radial-gauge":h,"before-after":f,"ranking-list":S,"sparkline-card":x,"donut-breakdown":j,"timeline-steps":k,"insight-card":I,"kpi-sequence":R},B=o.object({type:o.literal("remotion"),id:o.string().optional(),title:o.string().optional(),description:o.string().optional(),templateId:o.enum(P),props:o.record(o.string(),o.any()),_toolCallId:o.string().optional()}),_=o.object({lat:o.number(),lng:o.number(),title:o.string().optional(),color:o.string().optional(),popup:o.string().optional()}),C=o.object({lat:o.number(),lng:o.number(),radius:o.number(),color:o.string().optional(),fillColor:o.string().optional(),fillOpacity:o.number().optional(),popup:o.string().optional()}),v=o.object({points:o.array(o.tuple([o.number(),o.number()])),color:o.string().optional(),weight:o.number().optional(),opacity:o.number().optional(),popup:o.string().optional()}),A=o.object({points:o.array(o.tuple([o.number(),o.number()])),color:o.string().optional(),fillColor:o.string().optional(),fillOpacity:o.number().optional(),popup:o.string().optional()}),T=o.object({type:o.literal("leaflet"),id:o.string().optional(),title:o.string().optional(),description:o.string().optional(),center:o.tuple([o.number(),o.number()]),zoom:o.number().optional().default(5),height:o.number().optional().default(400),tileLayer:o.enum(["osm","mapbox"]).optional().default("osm"),mapboxToken:o.string().optional(),mapboxStyle:o.string().optional(),markers:o.array(_).optional(),circles:o.array(C).optional(),polylines:o.array(v).optional(),polygons:o.array(A).optional(),chartImage:o.string().optional()}),L=o.discriminatedUnion("type",[l,s,g,p,c,u,b,T,B]),E=o.preprocess(t=>{if(!t||typeof t!="object")return t;if(t.type==="echarts"&&!t.options&&t.option){const{option:n,...r}=t;return{...r,options:n}}if(t.type==="table"&&!Array.isArray(t.data)){const n=Array.isArray(t.rows)?t.rows:t.body?.rows;if(Array.isArray(n)){const r=t.columns??t.headers??t.body?.columns,{rows:e,headers:i,body:F,...a}=t;return{...a,data:n,...r?{columns:r}:{}}}}return t},L).superRefine((t,n)=>{if(t.type!=="remotion")return;const e=w[t.templateId].safeParse(t.props);if(!e.success)for(const i of e.error.issues)n.addIssue({...i,path:["props",...i.path]})}),O=o.object({session_id:o.string().optional(),result:o.object({content:o.array(E)})});export{O as DashboardSchema,s as EchartsBlockSchema,p as EuiBlockSchema,T as LeafletBlockSchema,l as MarkdownBlockSchema,b as MermaidBlockSchema,w as REMOTION_PROPS_SCHEMAS,P as REMOTION_TEMPLATE_IDS,c as RawBlockSchema,g as RechartsBlockSchema,m as RechartsComponentSchema,f as RemotionBeforeAfterPropsSchema,B as RemotionBlockSchema,j as RemotionDonutBreakdownPropsSchema,I as RemotionInsightCardPropsSchema,R as RemotionKpiSequencePropsSchema,y as RemotionProgressBarPropsSchema,h as RemotionRadialGaugePropsSchema,S as RemotionRankingListPropsSchema,x as RemotionSparklineCardPropsSchema,d as RemotionStatRevealPropsSchema,k as RemotionTimelineStepsPropsSchema,u as TableBlockSchema,E as UiBlockSchema};
@@ -0,0 +1,83 @@
1
+ import{makeApi as Xe,Zodios as P}from"@zodios/core";import{z as e}from"zod";const F=e.object({index:e.string(),shard:e.string(),prirep:e.string(),state:e.string(),docs:e.union([e.string(),e.string()]),store:e.union([e.string(),e.string()]),dataset:e.union([e.string(),e.string()]),ip:e.union([e.string(),e.string()]),id:e.string(),node:e.union([e.string(),e.string()]),sync_id:e.string(),"unassigned.reason":e.string(),"unassigned.at":e.string(),"unassigned.for":e.string(),"unassigned.details":e.string(),"recoverysource.type":e.string(),"completion.size":e.string(),"fielddata.memory_size":e.string(),"fielddata.evictions":e.string(),"query_cache.memory_size":e.string(),"query_cache.evictions":e.string(),"flush.total":e.string(),"flush.total_time":e.string(),"get.current":e.string(),"get.time":e.string(),"get.total":e.string(),"get.exists_time":e.string(),"get.exists_total":e.string(),"get.missing_time":e.string(),"get.missing_total":e.string(),"indexing.delete_current":e.string(),"indexing.delete_time":e.string(),"indexing.delete_total":e.string(),"indexing.index_current":e.string(),"indexing.index_time":e.string(),"indexing.index_total":e.string(),"indexing.index_failed":e.string(),"merges.current":e.string(),"merges.current_docs":e.string(),"merges.current_size":e.string(),"merges.total":e.string(),"merges.total_docs":e.string(),"merges.total_size":e.string(),"merges.total_time":e.string(),"refresh.total":e.string(),"refresh.time":e.string(),"refresh.external_total":e.string(),"refresh.external_time":e.string(),"refresh.listeners":e.string(),"search.fetch_current":e.string(),"search.fetch_time":e.string(),"search.fetch_total":e.string(),"search.open_contexts":e.string(),"search.query_current":e.string(),"search.query_time":e.string(),"search.query_total":e.string(),"search.scroll_current":e.string(),"search.scroll_time":e.string(),"search.scroll_total":e.string(),"segments.count":e.string(),"segments.memory":e.string(),"segments.index_writer_memory":e.string(),"segments.version_map_memory":e.string(),"segments.fixed_bitset_memory":e.string(),"seq_no.max":e.string(),"seq_no.local_checkpoint":e.string(),"seq_no.global_checkpoint":e.string(),"warmer.current":e.string(),"warmer.total":e.string(),"warmer.total_time":e.string(),"path.data":e.string(),"path.state":e.string(),"bulk.total_operations":e.string(),"bulk.total_time":e.string(),"bulk.total_size_in_bytes":e.string(),"bulk.avg_time":e.string(),"bulk.avg_size_in_bytes":e.string()}).partial().passthrough(),i=e.lazy(()=>e.object({type:e.string(),reason:e.string().optional(),stack_trace:e.string().optional(),caused_by:i.optional(),root_cause:e.array(i).optional(),suppressed:e.array(i).optional()}).passthrough()),v=e.object({failures:e.array(i).optional(),total:e.number(),successful:e.number(),failed:e.number()}).passthrough(),d=e.object({_nodes:v}).partial().passthrough(),_=e.string(),c=e.string(),s=e.object({name:_,count:e.number(),index_count:e.number(),indexed_vector_count:e.number().optional(),indexed_vector_dim_max:e.number().optional(),indexed_vector_dim_min:e.number().optional(),script_count:e.number().optional()}).passthrough(),Q=e.object({analyzer_types:e.array(s),built_in_analyzers:e.array(s),built_in_char_filters:e.array(s),built_in_filters:e.array(s),built_in_tokenizers:e.array(s),char_filter_types:e.array(s),filter_types:e.array(s),tokenizer_types:e.array(s)}).passthrough(),t=e.union([e.number(),e.string()]),I=e.object({size_in_bytes:e.number(),size:t.optional(),fields:e.object({}).partial().passthrough().optional()}).passthrough(),D=e.object({count:e.number(),deleted:e.number().optional()}).passthrough(),k=e.object({evictions:e.number().optional(),memory_size:t.optional(),memory_size_in_bytes:e.number(),fields:e.object({}).partial().passthrough().optional()}).passthrough(),B=e.object({cache_count:e.number(),cache_size:e.number(),evictions:e.number(),hit_count:e.number(),memory_size:t.optional(),memory_size_in_bytes:e.number(),miss_count:e.number(),total_count:e.number()}).passthrough(),w=e.object({count:e.number(),doc_values_memory:t.optional(),doc_values_memory_in_bytes:e.number(),file_sizes:e.object({}).partial().passthrough(),fixed_bit_set:t.optional(),fixed_bit_set_memory_in_bytes:e.number(),index_writer_memory:t.optional(),index_writer_max_memory_in_bytes:e.number().optional(),index_writer_memory_in_bytes:e.number(),max_unsafe_auto_id_timestamp:e.number(),memory:t.optional(),memory_in_bytes:e.number(),norms_memory:t.optional(),norms_memory_in_bytes:e.number(),points_memory:t.optional(),points_memory_in_bytes:e.number(),stored_memory:t.optional(),stored_fields_memory_in_bytes:e.number(),terms_memory_in_bytes:e.number(),terms_memory:t.optional(),term_vectory_memory:t.optional(),term_vectors_memory_in_bytes:e.number(),version_map_memory:t.optional(),version_map_memory_in_bytes:e.number()}).passthrough(),u=e.object({avg:e.number(),max:e.number(),min:e.number()}).passthrough(),A=e.object({primaries:u,replication:u,shards:u}).passthrough(),C=e.object({index:A,primaries:e.number(),replication:e.number(),total:e.number()}).partial().passthrough(),z=e.object({size:t.optional(),size_in_bytes:e.number(),reserved:t.optional(),reserved_in_bytes:e.number(),total_data_set_size:t.optional(),total_data_set_size_in_bytes:e.number().optional()}).passthrough(),M=e.object({chars_max:e.number(),chars_total:e.number(),count:e.number(),doc_max:e.number(),doc_total:e.number(),index_count:e.number(),lang:e.array(e.string()),lines_max:e.number(),lines_total:e.number(),name:_,scriptless_count:e.number(),shadowed_count:e.number(),source_max:e.number(),source_total:e.number()}).passthrough(),T=e.object({field_types:e.array(s),runtime_field_types:e.array(M).optional(),total_field_count:e.number().optional(),total_deduplicated_field_count:e.number().optional(),total_deduplicated_mapping_size:t.optional(),total_deduplicated_mapping_size_in_bytes:e.number().optional()}).passthrough(),r=e.string(),R=e.object({index_count:e.number(),primary_shard_count:e.number(),total_primary_bytes:e.number(),version:r}).passthrough(),j=e.object({analysis:Q,completion:I,count:e.number(),docs:D,fielddata:k,query_cache:B,segments:w,shards:C,store:z,mappings:T,versions:e.array(R).optional()}).passthrough(),N=e.object({coordinating_only:e.number(),data:e.number(),data_cold:e.number(),data_content:e.number(),data_frozen:e.number().optional(),data_hot:e.number(),data_warm:e.number(),ingest:e.number(),master:e.number(),ml:e.number(),remote_cluster_client:e.number(),total:e.number(),transform:e.number(),voting_only:e.number()}).passthrough(),V=e.object({available_in_bytes:e.number(),free_in_bytes:e.number(),total_in_bytes:e.number()}).passthrough(),m=e.object({all_in_bytes:e.number(),combined_coordinating_and_primary_in_bytes:e.number(),coordinating_in_bytes:e.number(),coordinating_rejections:e.number().optional(),primary_in_bytes:e.number(),primary_rejections:e.number().optional(),replica_in_bytes:e.number(),replica_rejections:e.number().optional()}).passthrough(),L=e.object({current:m,limit_in_bytes:e.number(),total:m}).passthrough(),U=e.object({memory:L}).passthrough(),G=e.object({number_of_pipelines:e.number(),processor_stats:e.object({}).partial().passthrough()}).passthrough(),g=e.number(),o=g,E=e.object({heap_max_in_bytes:e.number(),heap_used_in_bytes:e.number()}).passthrough(),O=e.object({bundled_jdk:e.boolean(),count:e.number(),using_bundled_jdk:e.boolean(),version:r,vm_name:e.string(),vm_vendor:e.string(),vm_version:r}).passthrough(),H=e.object({max_uptime_in_millis:o,mem:E,threads:e.number(),versions:e.array(O)}).passthrough(),W=e.object({http_types:e.object({}).partial().passthrough(),transport_types:e.object({}).partial().passthrough()}).passthrough(),Z=e.object({arch:e.string(),count:e.number()}).passthrough(),K=e.object({adjusted_total_in_bytes:e.number().optional(),free_in_bytes:e.number(),free_percent:e.number(),total_in_bytes:e.number(),used_in_bytes:e.number(),used_percent:e.number()}).passthrough(),X=e.object({count:e.number(),name:_}).passthrough(),J=e.object({count:e.number(),pretty_name:_}).passthrough(),Y=e.object({allocated_processors:e.number(),architectures:e.array(Z).optional(),available_processors:e.number(),mem:K,names:e.array(X),pretty_names:e.array(J)}).passthrough(),$=e.object({count:e.number(),flavor:e.string(),type:e.string()}).passthrough(),ee=e.object({classname:e.string(),description:e.string(),elasticsearch_version:r,extended_plugins:e.array(e.string()),has_native_controller:e.boolean(),java_version:r,name:_,version:r,licensed:e.boolean()}).passthrough(),te=e.object({percent:e.number()}).passthrough(),se=e.object({avg:e.number(),max:e.number(),min:e.number()}).passthrough(),_e=e.object({cpu:te,open_file_descriptors:se}).passthrough(),ne=e.object({count:N,discovery_types:e.object({}).partial().passthrough(),fs:V,indexing_pressure:U,ingest:G,jvm:H,network_types:W,os:Y,packaging_types:e.array($),plugins:e.array(ee),process:_e,versions:e.array(r)}).passthrough(),re=e.enum(["green","GREEN","yellow","YELLOW","red","RED"]),l=e.object({max:o,avg:o,p90:o}).passthrough(),b=e.object({total:e.number(),success:e.number(),skipped:e.number(),took:l,took_mrt_true:l.optional(),took_mrt_false:l.optional(),remotes_per_search_max:e.number(),remotes_per_search_avg:e.number(),failure_reasons:e.object({}).partial().passthrough(),features:e.object({}).partial().passthrough(),clients:e.object({}).partial().passthrough(),clusters:e.object({}).partial().passthrough()}).passthrough(),ie=e.object({clusters:e.object({}).partial().passthrough().optional(),_search:b,_esql:b.optional()}).passthrough(),ae=d.and(e.object({cluster_name:_,cluster_uuid:c,indices:j,nodes:ne,status:re,timestamp:e.number(),ccs:ie}).passthrough()),h=e.enum(["green","yellow","red","unknown"]),oe=e.enum(["search","ingest","backup","deployment_management"]),de=e.object({description:e.string(),id:e.string(),impact_areas:e.array(oe),severity:e.number()}).passthrough(),y=e.string(),ue=e.union([y,e.array(y)]),p=e.object({name:e.union([e.string(),e.string()]),node_id:e.union([e.string(),e.string()])}).passthrough(),le=e.object({indices:ue,nodes:e.array(p),slm_policies:e.array(e.string()),feature_states:e.array(e.string()),snapshot_repositories:e.array(e.string())}).partial().passthrough(),ye=e.object({id:e.string(),action:e.string(),affected_resources:le,cause:e.string(),help_url:e.string()}).passthrough(),n=e.object({status:h,symptom:e.string(),impacts:e.array(de).optional(),diagnosis:e.array(ye).optional()}).passthrough(),pe=e.object({message:e.string(),stack_trace:e.string()}).passthrough(),ce=e.object({name:e.string().optional(),node_id:e.string(),cluster_formation_message:e.string()}).passthrough(),me=e.object({current_master:p,recent_masters:e.array(p),exception_fetching_history:pe.optional(),cluster_formation:e.array(ce).optional()}).passthrough(),ge=n.and(e.object({details:me}).partial().passthrough()),be=e.object({creating_primaries:e.number(),creating_replicas:e.number(),initializing_primaries:e.number(),initializing_replicas:e.number(),restarting_primaries:e.number(),restarting_replicas:e.number(),started_primaries:e.number(),started_replicas:e.number(),unassigned_primaries:e.number(),unassigned_replicas:e.number()}).passthrough(),he=n.and(e.object({details:be}).partial().passthrough()),fe=e.object({indices_with_readonly_block:e.number(),nodes_with_enough_disk_space:e.number(),nodes_over_high_watermark:e.number(),nodes_over_flood_stage_watermark:e.number(),nodes_with_unknown_disk_status:e.number()}).passthrough(),qe=n.and(e.object({details:fe}).partial().passthrough()),Se=e.object({total_repositories:e.number(),corrupted_repositories:e.number(),corrupted:e.array(e.string())}).partial().passthrough(),xe=n.and(e.object({details:Se}).partial().passthrough()),Pe=e.object({index_name:y,first_occurrence_timestamp:e.number(),retry_count:e.number()}).passthrough(),Fe=e.object({stagnating_backing_indices_count:e.number(),total_backing_indices_in_error:e.number(),stagnating_backing_indices:e.array(Pe).optional()}).passthrough(),ve=n.and(e.object({details:Fe}).partial().passthrough()),f=e.enum(["RUNNING","STOPPING","STOPPED"]),Qe=e.object({ilm_status:f,policies:e.number(),stagnating_indices:e.number()}).passthrough(),Ie=n.and(e.object({details:Qe}).partial().passthrough()),De=e.object({count:e.number(),invocations_since_last_success:e.object({}).partial().passthrough().optional()}).passthrough(),ke=e.object({slm_status:f,policies:e.number(),unhealthy_policies:De.optional()}).passthrough(),Be=n.and(e.object({details:ke}).partial().passthrough()),q=e.object({max_shards_in_cluster:e.number(),current_used_shards:e.number().optional()}).passthrough(),we=e.object({data:q,frozen:q}).passthrough(),Ae=n.and(e.object({details:we}).partial().passthrough()),Ce=e.object({master_is_stable:ge,shards_availability:he,disk:qe,repository_integrity:xe,data_stream_lifecycle:ve,ilm:Ie,slm:Be,shards_capacity:Ae}).partial().passthrough(),a=g,S=e.union([e.string(),a]),ze=e.enum(["active","valid","invalid","expired"]),Me=e.enum(["missing","trial","basic","standard","dev","silver","gold","platinum","enterprise"]),Te=e.object({expiry_date:S.optional(),expiry_date_in_millis:a.optional(),issue_date:S,issue_date_in_millis:a,issued_to:e.string(),issuer:e.string(),max_nodes:e.union([e.number(),e.string()]),max_resource_units:e.union([e.number(),e.string()]).optional(),status:ze,type:Me,uid:c,start_date_in_millis:a}).passthrough(),Re=d.and(e.object({cluster_name:_,nodes:e.object({}).partial().passthrough()}).passthrough()),je=d.and(e.object({cluster_name:_.optional(),nodes:e.object({}).partial().passthrough()}).passthrough()),x=e.string(),Ne=e.object({task_id:e.number(),node_id:x,status:e.string(),reason:i}).passthrough(),Ve=e.union([e.string(),e.literal("-1"),e.literal("0")]),Le=e.number(),Ue=Le,Ge=e.union([e.string(),e.number()]),Ee=e.object({action:e.string(),cancelled:e.boolean().optional(),cancellable:e.boolean(),description:e.string().optional(),headers:e.object({}).partial().passthrough(),id:e.number(),node:x,running_time:Ve.optional(),running_time_in_nanos:Ue,start_time_in_millis:a,status:e.object({}).partial().passthrough().optional(),type:e.string(),parent_task_id:Ge.optional()}).passthrough(),Oe=e.union([e.array(Ee),e.object({}).partial().passthrough()]),He=e.object({node_failures:e.array(i),task_failures:e.array(Ne),nodes:e.object({}).partial().passthrough(),tasks:Oe}).partial().passthrough(),$e={cat_shards_ShardsRecord:F,_types_ErrorCause:i,_types_NodeStatistics:v,nodes__types_NodesResponseBase:d,_types_Name:_,_types_Uuid:c,cluster_stats_FieldTypes:s,cluster_stats_CharFilterTypes:Q,_types_ByteSize:t,_types_CompletionStats:I,_types_DocStats:D,_types_FielddataStats:k,_types_QueryCacheStats:B,_types_SegmentsStats:w,cluster_stats_ClusterShardMetrics:u,cluster_stats_ClusterIndicesShardsIndex:A,cluster_stats_ClusterIndicesShards:C,_types_StoreStats:z,cluster_stats_RuntimeFieldTypes:M,cluster_stats_FieldTypesMappings:T,_types_VersionString:r,cluster_stats_IndicesVersions:R,cluster_stats_ClusterIndices:j,cluster_stats_ClusterNodeCount:N,cluster_stats_ClusterFileSystem:V,cluster_stats_IndexingPressureMemorySummary:m,cluster_stats_IndexingPressureMemory:L,cluster_stats_IndexingPressure:U,cluster_stats_ClusterIngest:G,_types_UnitMillis:g,_types_DurationValueUnitMillis:o,cluster_stats_ClusterJvmMemory:E,cluster_stats_ClusterJvmVersion:O,cluster_stats_ClusterJvm:H,cluster_stats_ClusterNetworkTypes:W,cluster_stats_ClusterOperatingSystemArchitecture:Z,cluster_stats_OperatingSystemMemoryInfo:K,cluster_stats_ClusterOperatingSystemName:X,cluster_stats_ClusterOperatingSystemPrettyName:J,cluster_stats_ClusterOperatingSystem:Y,cluster_stats_NodePackagingType:$,_types_PluginStats:ee,cluster_stats_ClusterProcessCpu:te,cluster_stats_ClusterProcessOpenFileDescriptors:se,cluster_stats_ClusterProcess:_e,cluster_stats_ClusterNodes:ne,_types_HealthStatus:re,cluster_stats_CCSUsageTimeValue:l,cluster_stats_CCSUsageStats:b,cluster_stats_CCSStats:ie,cluster_stats_StatsResponseBase:ae,_global_health_report_IndicatorHealthStatus:h,_global_health_report_ImpactArea:oe,_global_health_report_Impact:de,_types_IndexName:y,_types_Indices:ue,_global_health_report_IndicatorNode:p,_global_health_report_DiagnosisAffectedResources:le,_global_health_report_Diagnosis:ye,_global_health_report_BaseIndicator:n,_global_health_report_MasterIsStableIndicatorExceptionFetchingHistory:pe,_global_health_report_MasterIsStableIndicatorClusterFormationNode:ce,_global_health_report_MasterIsStableIndicatorDetails:me,_global_health_report_MasterIsStableIndicator:ge,_global_health_report_ShardsAvailabilityIndicatorDetails:be,_global_health_report_ShardsAvailabilityIndicator:he,_global_health_report_DiskIndicatorDetails:fe,_global_health_report_DiskIndicator:qe,_global_health_report_RepositoryIntegrityIndicatorDetails:Se,_global_health_report_RepositoryIntegrityIndicator:xe,_global_health_report_StagnatingBackingIndices:Pe,_global_health_report_DataStreamLifecycleDetails:Fe,_global_health_report_DataStreamLifecycleIndicator:ve,_types_LifecycleOperationMode:f,_global_health_report_IlmIndicatorDetails:Qe,_global_health_report_IlmIndicator:Ie,_global_health_report_SlmIndicatorUnhealthyPolicies:De,_global_health_report_SlmIndicatorDetails:ke,_global_health_report_SlmIndicator:Be,_global_health_report_ShardsCapacityIndicatorTierDetail:q,_global_health_report_ShardsCapacityIndicatorDetails:we,_global_health_report_ShardsCapacityIndicator:Ae,_global_health_report_Indicators:Ce,_types_EpochTimeUnitMillis:a,_types_DateTime:S,license__types_LicenseStatus:ze,license__types_LicenseType:Me,license_get_LicenseInformation:Te,nodes_info_ResponseBase:Re,nodes_stats_ResponseBase:je,_types_NodeId:x,_types_TaskFailure:Ne,_types_Duration:Ve,_types_UnitNanos:Le,_types_DurationValueUnitNanos:Ue,_types_TaskId:Ge,tasks__types_TaskInfo:Ee,tasks__types_TaskInfos:Oe,tasks__types_TaskListResponseBase:He},We=Xe([{method:"get",path:"cluster_health_report",alias:"getCluster_health_report",description:`Get a report with the health status of an Elasticsearch cluster.
2
+ The report contains a list of indicators that compose Elasticsearch functionality.
3
+
4
+ Each indicator has a health status of: green, unknown, yellow or red.
5
+ The indicator will provide an explanation and metadata describing the reason for its current health status.
6
+
7
+ The cluster\u2019s status is controlled by the worst indicator status.
8
+
9
+ In the event that an indicator\u2019s status is non-green, a list of impacts may be present in the indicator result which detail the functionalities that are negatively affected by the health issue.
10
+ Each impact carries with it a severity level, an area of the system that is affected, and a simple description of the impact on the system.
11
+
12
+ Some health indicators can determine the root cause of a health problem and prescribe a set of steps that can be performed in order to improve the health of the system.
13
+ The root cause and remediation steps are encapsulated in a diagnosis.
14
+ A diagnosis contains a cause detailing a root cause analysis, an action containing a brief description of the steps to take to fix the problem, the list of affected resources (if applicable), and a detailed step-by-step troubleshooting guide to fix the diagnosed problem.
15
+
16
+ NOTE: The health indicators perform root cause analysis of non-green health statuses. This can be computationally expensive when called frequently.
17
+ When setting up automated polling of the API for health status, set verbose to false to disable the more expensive analysis logic.`,requestFormat:"json",response:e.object({cluster_name:e.string(),indicators:Ce,status:h.optional()}).passthrough()},{method:"get",path:"cluster_stats",alias:"getCluster_stats",description:"Get basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).",requestFormat:"json",response:ae},{method:"get",path:"indices_settings",alias:"getIndices_settings",description:`Get setting information for one or more indices.
18
+ For data streams, it returns setting information for the stream&#x27;s backing indices.`,requestFormat:"json",response:e.object({}).partial().passthrough()},{method:"get",path:"indices_shards",alias:"getIndices_shards",description:`Get information about the shards in a cluster.
19
+ For data streams, the API returns information about the backing indices.
20
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.`,requestFormat:"json",response:e.array(F)},{method:"get",path:"license",alias:"getLicense",description:`Get information about your Elastic license including its type, its status, when it was issued, and when it expires.
21
+
22
+ &gt;info
23
+ &gt; If the master node is generating a new cluster state, the get license API may return a &#x60;404 Not Found&#x60; response.
24
+ &gt; If you receive an unexpected 404 response after cluster startup, wait a short period and retry the request.`,requestFormat:"json",response:e.object({license:Te}).passthrough()},{method:"get",path:"nodes_hot_threads",alias:"getNodes_hot_threads",description:`Get a breakdown of the hot threads on each selected node in the cluster.
25
+ The output is plain text with a breakdown of the top hot threads for each node.`,requestFormat:"json",response:e.object({}).partial().passthrough()},{method:"get",path:"nodes_info",alias:"getNodes_info",description:"By default, the API returns all attributes and core settings for cluster nodes.",requestFormat:"json",response:Re},{method:"get",path:"nodes_stats",alias:"getNodes_stats",description:`Get statistics for nodes in a cluster.
26
+ By default, all stats are returned. You can limit the returned information by using metrics.`,requestFormat:"json",response:je},{method:"get",path:"nodes_tasks_list",alias:"getNodes_tasks_list",description:`Get information about the tasks currently running on one or more nodes in the cluster.
27
+
28
+ WARNING: The task management API is new and should still be considered a beta feature.
29
+ The API may change in ways that are not backwards compatible.
30
+
31
+ **Identifying running tasks**
32
+
33
+ The &#x60;X-Opaque-Id header&#x60;, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information.
34
+ This enables you to track certain calls or associate certain tasks with the client that started them.
35
+ For example:
36
+
37
+ &#x60;&#x60;&#x60;
38
+ curl -i -H &quot;X-Opaque-Id: 123456&quot; &quot;http://localhost:9200/_tasks?group_by&#x3D;parents&quot;
39
+ &#x60;&#x60;&#x60;
40
+
41
+ The API returns the following result:
42
+
43
+ &#x60;&#x60;&#x60;
44
+ HTTP/1.1 200 OK
45
+ X-Opaque-Id: 123456
46
+ content-type: application/json; charset&#x3D;UTF-8
47
+ content-length: 831
48
+
49
+ {
50
+ &quot;tasks&quot; : {
51
+ &quot;u5lcZHqcQhu-rUoFaqDphA:45&quot; : {
52
+ &quot;node&quot; : &quot;u5lcZHqcQhu-rUoFaqDphA&quot;,
53
+ &quot;id&quot; : 45,
54
+ &quot;type&quot; : &quot;transport&quot;,
55
+ &quot;action&quot; : &quot;cluster:monitor/tasks/lists&quot;,
56
+ &quot;start_time_in_millis&quot; : 1513823752749,
57
+ &quot;running_time_in_nanos&quot; : 293139,
58
+ &quot;cancellable&quot; : false,
59
+ &quot;headers&quot; : {
60
+ &quot;X-Opaque-Id&quot; : &quot;123456&quot;
61
+ },
62
+ &quot;children&quot; : [
63
+ {
64
+ &quot;node&quot; : &quot;u5lcZHqcQhu-rUoFaqDphA&quot;,
65
+ &quot;id&quot; : 46,
66
+ &quot;type&quot; : &quot;direct&quot;,
67
+ &quot;action&quot; : &quot;cluster:monitor/tasks/lists[n]&quot;,
68
+ &quot;start_time_in_millis&quot; : 1513823752750,
69
+ &quot;running_time_in_nanos&quot; : 92133,
70
+ &quot;cancellable&quot; : false,
71
+ &quot;parent_task_id&quot; : &quot;u5lcZHqcQhu-rUoFaqDphA:45&quot;,
72
+ &quot;headers&quot; : {
73
+ &quot;X-Opaque-Id&quot; : &quot;123456&quot;
74
+ }
75
+ }
76
+ ]
77
+ }
78
+ }
79
+ }
80
+ &#x60;&#x60;&#x60;
81
+ In this example, &#x60;X-Opaque-Id: 123456&#x60; is the ID as a part of the response header.
82
+ The &#x60;X-Opaque-Id&#x60; in the task &#x60;headers&#x60; is the ID for the task that was initiated by the REST request.
83
+ The &#x60;X-Opaque-Id&#x60; in the children &#x60;headers&#x60; is the child task of the task that was initiated by the REST request.`,requestFormat:"json",response:He}]),et=new P(We);function tt(Ze,Ke){return new P(Ze,We,Ke)}export{et as api,tt as createApiClient,$e as schemas};
@@ -0,0 +1,2 @@
1
+ import N from"https";import L from"http";import{randomUUID as T}from"node:crypto";function P(k,e){return{role:"user",parts:[{type:"text",text:k}],...e&&Object.keys(e).length>0?{metadata:e}:{}}}class H{agentUrl;authKey;timeout;constructor(e){this.agentUrl=e.agentUrl.replace(/\/$/,""),this.authKey=e.authKey,this.timeout=e.timeout??3e4}buildHeaders(e={}){const g={"Content-Type":"application/json",...e};return this.authKey&&(g.Authorization=`Bearer ${this.authKey}`),g}selectTransport(e){return e.protocol==="https:"?N:L}async getAgentCard(){const e=new URL("/.well-known/agent.json",this.agentUrl),g=this.selectTransport(e),m={hostname:e.hostname,port:e.port||(e.protocol==="https:"?443:80),path:e.pathname+e.search,method:"GET",headers:this.buildHeaders(),rejectUnauthorized:!1,timeout:this.timeout},x=await new Promise((i,c)=>{const s=g.request(m,d=>{let y="";d.setEncoding("utf8"),d.on("data",p=>{y+=p}),d.on("end",()=>{d.statusCode&&d.statusCode>=400?c(new Error(`A2A getAgentCard failed: HTTP ${d.statusCode} \u2014 ${y.slice(0,200)}`)):i(y)}),d.on("error",c)});s.on("error",c),s.on("timeout",()=>{s.destroy(),c(new Error("A2A getAgentCard timed out"))}),s.end()});try{const i=JSON.parse(x);return{name:i.name??"Unknown Agent",description:i.description,skills:Array.isArray(i.skills)?i.skills:[],streaming:i.capabilities?.streaming!==!1}}catch{throw new Error(`A2A getAgentCard: invalid JSON response \u2014 ${x.slice(0,200)}`)}}async send(e,g,m,x){const i=g??T(),c=JSON.stringify({jsonrpc:"2.0",id:"1",method:"tasks/send",params:{id:i,message:P(e,x)}}),s=new URL(this.agentUrl),d=this.selectTransport(s),y={hostname:s.hostname,port:s.port||(s.protocol==="https:"?443:80),path:s.pathname||"/",method:"POST",headers:this.buildHeaders({"Content-Length":String(Buffer.byteLength(c))}),rejectUnauthorized:!1,timeout:this.timeout},p=await new Promise((l,r)=>{const o=d.request(y,t=>{let A="";t.setEncoding("utf8"),t.on("data",f=>{A+=f}),t.on("end",()=>{t.statusCode&&t.statusCode>=400?r(new Error(`A2A tasks/send HTTP ${t.statusCode}: ${A.slice(0,300)}`)):l(A)}),t.on("error",r)});o.on("error",r),o.on("timeout",()=>{o.destroy(),r(new Error("A2A tasks/send timed out"))}),m&&m.addEventListener("abort",()=>o.destroy()),o.write(c),o.end()});let n;try{n=JSON.parse(p)}catch{throw new Error(`A2A tasks/send: invalid JSON \u2014 ${p.slice(0,200)}`)}if(n.error)return{type:"error",error:n.error.message??JSON.stringify(n.error)};const u=n.result;if(!u)return{type:"error",error:`A2A tasks/send: unexpected response \u2014 ${p.slice(0,200)}`};let a="";if(Array.isArray(u.artifacts)&&u.artifacts.length>0)for(const l of u.artifacts)for(const r of l.parts??[])r.type==="text"&&r.text&&(a+=r.text);if(!a){const l=u.status?.message?.parts??[];for(const r of l)r.type==="text"&&r.text&&(a+=r.text)}return a?{type:"text_chunk",text:a}:{type:"completed",artifacts:u.artifacts??[]}}async*sendSubscribe(e,g,m,x){const i=g??T(),c=JSON.stringify({jsonrpc:"2.0",id:"1",method:"tasks/sendSubscribe",params:{id:i,message:P(e,x)}}),s=new URL(this.agentUrl),d=this.selectTransport(s),y={hostname:s.hostname,port:s.port||(s.protocol==="https:"?443:80),path:s.pathname||"/",method:"POST",headers:this.buildHeaders({Accept:"text/event-stream","Cache-Control":"no-cache","Content-Length":String(Buffer.byteLength(c))}),rejectUnauthorized:!1,timeout:this.timeout},p=[];let n=null,u=!1,a=null;const l=t=>{p.push(t),n&&(n(),n=null)},r=()=>{u=!0,n&&(n(),n=null)},o=d.request(y,t=>{if(t.statusCode&&t.statusCode!==200){let f="";t.setEncoding("utf8"),t.on("data",C=>{f+=C}),t.on("end",()=>{a=new Error(`A2A sendSubscribe HTTP ${t.statusCode}: ${f.slice(0,300)}`),r()});return}let A="";t.setEncoding("utf8"),t.on("data",f=>{A+=f;const C=A.split(`
2
+ `);A=C.pop()??"";for(const R of C){const v=R.trimEnd();if(!v.startsWith("data:"))continue;const S=v.slice(5).trim();if(!S)continue;let w;try{w=JSON.parse(S)}catch{console.warn("[A2aClient] Failed to parse SSE data:",S.slice(0,100));continue}if(w.error){l({type:"error",error:w.error.message??JSON.stringify(w.error)}),r();return}const h=w.result;if(!h)continue;const E=h.status?.state;if(E==="working"){const b=h.status?.message;if(b){const U=(b.parts??[]).find(q=>q.type==="text");U?.text&&l({type:"text_chunk",text:U.text});const O=b.metadata?.tool;O&&l({type:"tool_call",toolName:O})}continue}if(E==="completed"||E==="done"||h.final===!0){l({type:"completed",artifacts:Array.isArray(h.artifacts)?h.artifacts:[]}),r();return}if(E==="failed"||E==="error"){const b=h.status?.message?.parts?.[0]?.text??h.error?.message??"A2A agent reported an error";l({type:"error",error:b}),r();return}}}),t.on("end",()=>r()),t.on("error",f=>{a=f,r()})});for(o.on("error",t=>{a=t,r()}),o.on("timeout",()=>{o.destroy(),a=new Error("A2A sendSubscribe timed out"),r()}),m&&m.addEventListener("abort",()=>{o.destroy(),r()}),o.write(c),o.end();!u||p.length>0;)p.length>0?yield p.shift():u||await new Promise(t=>{n=t});if(a)throw a}}export{H as A2aClient,P as buildA2aMessage};
@@ -0,0 +1 @@
1
+ import{Client as d}from"@elastic/elasticsearch";import{config as u}from"../config";const o=new d(u.elasticsearch),a=".stkxp_alerts",y={"15m":900*1e3,"1h":3600*1e3,"6h":360*60*1e3,"24h":1440*60*1e3,"7d":10080*60*1e3};async function s(){try{await o.indices.exists({index:a})||(await o.indices.create({index:a,body:{mappings:{properties:{id:{type:"keyword"},name:{type:"text",fields:{keyword:{type:"keyword"}}},description:{type:"text"},owner:{type:"keyword"},enabled:{type:"boolean"},metric:{type:"keyword"},operator:{type:"keyword"},threshold:{type:"double"},window:{type:"keyword"},filters:{properties:{assistantId:{type:"keyword"},teamId:{type:"keyword"},toolName:{type:"keyword"}}},notify:{type:"object",enabled:!1},status:{type:"keyword"},lastValue:{type:"double"},lastEvaluatedAt:{type:"date"},lastFiredAt:{type:"date"},lastRecoveredAt:{type:"date"},lastError:{type:"text"},createdAt:{type:"date"},updatedAt:{type:"date"}}},settings:{number_of_shards:1,number_of_replicas:1}}}),console.log(`\u2705 Created index: ${a}`))}catch(t){throw console.error("Failed to ensure alerts index:",t),t}}async function A(t){await s();const e=`alert_${Date.now()}_${Math.random().toString(36).slice(2,9)}`,r=new Date().toISOString(),n={id:e,createdAt:r,updatedAt:r,status:"unknown",...t};return await o.index({index:a,id:e,body:n,refresh:"wait_for"}),n}async function w(t){return await s(),(await o.search({index:a,body:{query:{term:{owner:t}},size:500,sort:[{createdAt:{order:"desc"}}]}})).hits.hits.map(r=>r._source)}async function f(){return await s(),(await o.search({index:a,body:{query:{term:{enabled:!0}},size:1e3}})).hits.hits.map(e=>e._source)}async function l(t,e){try{await s();const r=await o.get({index:a,id:t});if(!r.found)return null;const n=r._source;return n.owner!==e?null:n}catch(r){if(r.meta?.statusCode===404)return null;throw r}}async function g(t,e,r){const n=await l(t,e);if(!n)return null;const i={...n,...r,id:n.id,owner:n.owner,createdAt:n.createdAt,updatedAt:new Date().toISOString()};return await o.index({index:a,id:t,body:i,refresh:"wait_for"}),i}async function x(t,e){await o.update({index:a,id:t,body:{doc:{...e,updatedAt:new Date().toISOString()}},refresh:!1})}async function m(t,e){return await l(t,e)?(await o.delete({index:a,id:t,refresh:"wait_for"}),!0):!1}export{y as WINDOW_TO_MS,A as createAlert,m as deleteAlert,s as ensureAlertsIndex,l as getAlertById,w as listAlerts,f as listEnabledAlerts,x as patchAlertEvaluationFields,g as updateAlert};
@@ -0,0 +1 @@
1
+ import m from"crypto";import{Client as f}from"@elastic/elasticsearch";import{config as K}from"../config";import{issueApiKey as x}from"../../services/auth";const l=new f({...K.elasticsearch}),w=["agent:execute","agent:stream","agent:cancel","agent:read-result"];async function c(e){try{const r=await l.security.getUser({username:e});return(r.body??r)[e]??null}catch{return null}}async function g(e,r,t){await l.security.putUser({username:e,body:{roles:r.roles,full_name:r.full_name,email:r.email,enabled:r.enabled,metadata:t}})}async function S(e){const t=(await c(e))?.metadata?.apiKeys;return Array.isArray(t)?t:[]}async function _(e,r,t){const n=await c(e);if(!n)return null;const s=(Array.isArray(n.roles)?n.roles:[e]).filter(A=>A!=="superuser"),i=m.randomBytes(16).toString("hex"),a=t===void 0?[...w]:t,o=x(e,s,i,a),p={id:i,name:(r||"API key").slice(0,80),prefix:o.slice(0,8),createdAt:new Date().toISOString(),scopes:a},u=Array.isArray(n.metadata?.apiKeys)?n.metadata.apiKeys:[],d={...n.metadata??{},apiKeys:[...u,p]};return await g(e,n,d),{token:o,key:p}}async function C(e,r){const t=await c(e);if(!t)return!1;const n=Array.isArray(t.metadata?.apiKeys)?t.metadata.apiKeys:[],s=n.filter(a=>a.id!==r);if(s.length===n.length)return!1;const i={...t.metadata??{},apiKeys:s};return await g(e,t,i),y.delete(`${e}:${r}`),!0}const y=new Map,k=3e4;async function v(e,r){const t=`${e}:${r}`,n=y.get(t),s=Date.now();if(n&&s-n.at<k)return n.ok;const a=(await S(e)).some(o=>o.id===r);return y.set(t,{ok:a,at:s}),a}export{w as AGENT_SCOPES,_ as createApiKey,v as isApiKeyActive,S as listApiKeys,C as revokeApiKey};