holmesgpt 0.13.0__py3-none-any.whl → 0.13.2__py3-none-any.whl
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.
- holmes/__init__.py +1 -1
- holmes/common/env_vars.py +11 -0
- holmes/config.py +3 -1
- holmes/core/conversations.py +0 -11
- holmes/core/investigation.py +0 -6
- holmes/core/llm.py +63 -2
- holmes/core/prompt.py +0 -2
- holmes/core/supabase_dal.py +2 -2
- holmes/core/todo_tasks_formatter.py +51 -0
- holmes/core/tool_calling_llm.py +277 -101
- holmes/core/tools.py +20 -4
- holmes/core/toolset_manager.py +1 -5
- holmes/core/tracing.py +1 -1
- holmes/interactive.py +63 -2
- holmes/main.py +7 -2
- holmes/plugins/prompts/_fetch_logs.jinja2 +4 -0
- holmes/plugins/prompts/_general_instructions.jinja2 +3 -1
- holmes/plugins/prompts/investigation_procedure.jinja2 +3 -13
- holmes/plugins/runbooks/CLAUDE.md +85 -0
- holmes/plugins/runbooks/README.md +24 -0
- holmes/plugins/toolsets/__init__.py +5 -1
- holmes/plugins/toolsets/argocd.yaml +1 -1
- holmes/plugins/toolsets/atlas_mongodb/mongodb_atlas.py +18 -6
- holmes/plugins/toolsets/aws.yaml +9 -5
- holmes/plugins/toolsets/azure_sql/tools/analyze_connection_failures.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_connections.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_health_status.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_performance.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_storage.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/get_active_alerts.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/get_slow_queries.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/get_top_cpu_queries.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/get_top_data_io_queries.py +3 -1
- holmes/plugins/toolsets/azure_sql/tools/get_top_log_io_queries.py +3 -1
- holmes/plugins/toolsets/bash/argocd/__init__.py +65 -0
- holmes/plugins/toolsets/bash/argocd/constants.py +120 -0
- holmes/plugins/toolsets/bash/aws/__init__.py +66 -0
- holmes/plugins/toolsets/bash/aws/constants.py +529 -0
- holmes/plugins/toolsets/bash/azure/__init__.py +56 -0
- holmes/plugins/toolsets/bash/azure/constants.py +339 -0
- holmes/plugins/toolsets/bash/bash_instructions.jinja2 +6 -7
- holmes/plugins/toolsets/bash/bash_toolset.py +62 -17
- holmes/plugins/toolsets/bash/common/bash_command.py +131 -0
- holmes/plugins/toolsets/bash/common/stringify.py +14 -1
- holmes/plugins/toolsets/bash/common/validators.py +91 -0
- holmes/plugins/toolsets/bash/docker/__init__.py +59 -0
- holmes/plugins/toolsets/bash/docker/constants.py +255 -0
- holmes/plugins/toolsets/bash/helm/__init__.py +61 -0
- holmes/plugins/toolsets/bash/helm/constants.py +92 -0
- holmes/plugins/toolsets/bash/kubectl/__init__.py +80 -79
- holmes/plugins/toolsets/bash/kubectl/constants.py +0 -14
- holmes/plugins/toolsets/bash/kubectl/kubectl_describe.py +38 -56
- holmes/plugins/toolsets/bash/kubectl/kubectl_events.py +28 -76
- holmes/plugins/toolsets/bash/kubectl/kubectl_get.py +39 -99
- holmes/plugins/toolsets/bash/kubectl/kubectl_logs.py +34 -15
- holmes/plugins/toolsets/bash/kubectl/kubectl_run.py +1 -1
- holmes/plugins/toolsets/bash/kubectl/kubectl_top.py +38 -77
- holmes/plugins/toolsets/bash/parse_command.py +106 -32
- holmes/plugins/toolsets/bash/utilities/__init__.py +0 -0
- holmes/plugins/toolsets/bash/utilities/base64_util.py +12 -0
- holmes/plugins/toolsets/bash/utilities/cut.py +12 -0
- holmes/plugins/toolsets/bash/utilities/grep/__init__.py +10 -0
- holmes/plugins/toolsets/bash/utilities/head.py +12 -0
- holmes/plugins/toolsets/bash/utilities/jq.py +79 -0
- holmes/plugins/toolsets/bash/utilities/sed.py +164 -0
- holmes/plugins/toolsets/bash/utilities/sort.py +15 -0
- holmes/plugins/toolsets/bash/utilities/tail.py +12 -0
- holmes/plugins/toolsets/bash/utilities/tr.py +57 -0
- holmes/plugins/toolsets/bash/utilities/uniq.py +12 -0
- holmes/plugins/toolsets/bash/utilities/wc.py +12 -0
- holmes/plugins/toolsets/confluence.yaml +1 -1
- holmes/plugins/toolsets/coralogix/api.py +3 -1
- holmes/plugins/toolsets/coralogix/toolset_coralogix_logs.py +4 -4
- holmes/plugins/toolsets/coralogix/utils.py +41 -14
- holmes/plugins/toolsets/datadog/datadog_api.py +45 -2
- holmes/plugins/toolsets/datadog/datadog_general_instructions.jinja2 +208 -0
- holmes/plugins/toolsets/datadog/datadog_logs_instructions.jinja2 +43 -0
- holmes/plugins/toolsets/datadog/datadog_metrics_instructions.jinja2 +12 -9
- holmes/plugins/toolsets/datadog/toolset_datadog_general.py +722 -0
- holmes/plugins/toolsets/datadog/toolset_datadog_logs.py +17 -6
- holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py +15 -7
- holmes/plugins/toolsets/datadog/toolset_datadog_rds.py +6 -2
- holmes/plugins/toolsets/datadog/toolset_datadog_traces.py +9 -3
- holmes/plugins/toolsets/docker.yaml +1 -1
- holmes/plugins/toolsets/git.py +15 -5
- holmes/plugins/toolsets/grafana/toolset_grafana.py +25 -4
- holmes/plugins/toolsets/grafana/toolset_grafana_loki.py +4 -4
- holmes/plugins/toolsets/grafana/toolset_grafana_tempo.jinja2 +5 -3
- holmes/plugins/toolsets/grafana/toolset_grafana_tempo.py +299 -32
- holmes/plugins/toolsets/helm.yaml +1 -1
- holmes/plugins/toolsets/internet/internet.py +4 -2
- holmes/plugins/toolsets/internet/notion.py +4 -2
- holmes/plugins/toolsets/investigator/core_investigation.py +5 -17
- holmes/plugins/toolsets/investigator/investigator_instructions.jinja2 +1 -5
- holmes/plugins/toolsets/kafka.py +19 -7
- holmes/plugins/toolsets/kubernetes.yaml +5 -5
- holmes/plugins/toolsets/kubernetes_logs.py +4 -4
- holmes/plugins/toolsets/kubernetes_logs.yaml +1 -1
- holmes/plugins/toolsets/logging_utils/logging_api.py +15 -2
- holmes/plugins/toolsets/mcp/toolset_mcp.py +3 -1
- holmes/plugins/toolsets/newrelic.py +8 -4
- holmes/plugins/toolsets/opensearch/opensearch.py +13 -5
- holmes/plugins/toolsets/opensearch/opensearch_logs.py +4 -4
- holmes/plugins/toolsets/opensearch/opensearch_traces.py +9 -6
- holmes/plugins/toolsets/prometheus/prometheus.py +198 -57
- holmes/plugins/toolsets/rabbitmq/toolset_rabbitmq.py +7 -3
- holmes/plugins/toolsets/robusta/robusta.py +10 -4
- holmes/plugins/toolsets/runbook/runbook_fetcher.py +4 -2
- holmes/plugins/toolsets/servicenow/servicenow.py +9 -3
- holmes/plugins/toolsets/slab.yaml +1 -1
- holmes/utils/console/logging.py +6 -1
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.2.dist-info}/METADATA +3 -2
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.2.dist-info}/RECORD +116 -90
- holmes/core/todo_manager.py +0 -88
- holmes/plugins/toolsets/bash/grep/__init__.py +0 -52
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.2.dist-info}/LICENSE.txt +0 -0
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.2.dist-info}/WHEEL +0 -0
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.2.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
ALLOWED_ARGOCD_COMMANDS: dict[str, dict] = {
|
|
2
|
+
# Application management (read-only)
|
|
3
|
+
"app": {
|
|
4
|
+
"list": {},
|
|
5
|
+
"get": {},
|
|
6
|
+
"resources": {},
|
|
7
|
+
"diff": {},
|
|
8
|
+
"history": {},
|
|
9
|
+
"manifests": {},
|
|
10
|
+
"logs": {},
|
|
11
|
+
"wait": {}, # Wait for app to reach desired state (read-only monitoring)
|
|
12
|
+
},
|
|
13
|
+
# Cluster management (read-only)
|
|
14
|
+
"cluster": {
|
|
15
|
+
"list": {},
|
|
16
|
+
"get": {},
|
|
17
|
+
},
|
|
18
|
+
# Project management (read-only)
|
|
19
|
+
"proj": {
|
|
20
|
+
"list": {},
|
|
21
|
+
"get": {},
|
|
22
|
+
},
|
|
23
|
+
# Repository management (read-only)
|
|
24
|
+
"repo": {
|
|
25
|
+
"list": {},
|
|
26
|
+
"get": {},
|
|
27
|
+
},
|
|
28
|
+
# Context management (read-only operations)
|
|
29
|
+
"context": {},
|
|
30
|
+
# Version information (completely safe)
|
|
31
|
+
"version": {},
|
|
32
|
+
# Account information (read-only)
|
|
33
|
+
"account": {
|
|
34
|
+
"list": {},
|
|
35
|
+
"get": {},
|
|
36
|
+
"get-user-info": {},
|
|
37
|
+
"can-i": {},
|
|
38
|
+
},
|
|
39
|
+
# Administrative commands (limited read-only)
|
|
40
|
+
"admin": {
|
|
41
|
+
"dashboard": {}, # Starts read-only web UI
|
|
42
|
+
"settings": {}, # Shows/validates settings (read-only)
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
DENIED_ARGOCD_COMMANDS: dict[str, dict] = {
|
|
47
|
+
# Authentication operations (sensitive)
|
|
48
|
+
"login": {},
|
|
49
|
+
"logout": {},
|
|
50
|
+
"relogin": {},
|
|
51
|
+
# Application lifecycle operations (state-modifying)
|
|
52
|
+
"app": {
|
|
53
|
+
"create": {},
|
|
54
|
+
"delete": {},
|
|
55
|
+
"sync": {},
|
|
56
|
+
"rollback": {},
|
|
57
|
+
"edit": {},
|
|
58
|
+
"set": {},
|
|
59
|
+
"unset": {},
|
|
60
|
+
"patch": {},
|
|
61
|
+
"delete-resource": {},
|
|
62
|
+
"terminate-op": {},
|
|
63
|
+
"actions": {}, # Custom resource actions
|
|
64
|
+
},
|
|
65
|
+
# Account management (sensitive)
|
|
66
|
+
"account": {
|
|
67
|
+
"generate-token": {},
|
|
68
|
+
"delete-token": {},
|
|
69
|
+
"update-password": {},
|
|
70
|
+
"bcrypt": {},
|
|
71
|
+
},
|
|
72
|
+
# Cluster management (state-modifying)
|
|
73
|
+
"cluster": {
|
|
74
|
+
"add": {},
|
|
75
|
+
"rm": {},
|
|
76
|
+
"set": {},
|
|
77
|
+
"rotate-auth": {},
|
|
78
|
+
},
|
|
79
|
+
# Project management (state-modifying)
|
|
80
|
+
"proj": {
|
|
81
|
+
"create": {},
|
|
82
|
+
"delete": {},
|
|
83
|
+
"edit": {},
|
|
84
|
+
"add-source": {},
|
|
85
|
+
"remove-source": {},
|
|
86
|
+
"add-destination": {},
|
|
87
|
+
"remove-destination": {},
|
|
88
|
+
"add-cluster-resource-whitelist": {},
|
|
89
|
+
"remove-cluster-resource-whitelist": {},
|
|
90
|
+
"add-namespace-resource-blacklist": {},
|
|
91
|
+
"remove-namespace-resource-blacklist": {},
|
|
92
|
+
"add-cluster-resource-blacklist": {},
|
|
93
|
+
"remove-cluster-resource-blacklist": {},
|
|
94
|
+
"add-namespace-resource-whitelist": {},
|
|
95
|
+
"remove-namespace-resource-whitelist": {},
|
|
96
|
+
"add-orphaned-ignore": {},
|
|
97
|
+
"remove-orphaned-ignore": {},
|
|
98
|
+
"add-signature-key": {},
|
|
99
|
+
"remove-signature-key": {},
|
|
100
|
+
"set-orphaned-ignore": {},
|
|
101
|
+
"add-role": {},
|
|
102
|
+
"remove-role": {},
|
|
103
|
+
"add-role-token": {},
|
|
104
|
+
"delete-role-token": {},
|
|
105
|
+
"set-role": {},
|
|
106
|
+
},
|
|
107
|
+
# Repository management (state-modifying)
|
|
108
|
+
"repo": {
|
|
109
|
+
"add": {},
|
|
110
|
+
"rm": {},
|
|
111
|
+
},
|
|
112
|
+
# Certificate management
|
|
113
|
+
"cert": {},
|
|
114
|
+
# GPG key management
|
|
115
|
+
"gpg": {},
|
|
116
|
+
# Application set operations
|
|
117
|
+
"appset": {},
|
|
118
|
+
# Notification operations
|
|
119
|
+
"notifications": {},
|
|
120
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
from typing import Any, Optional
|
|
3
|
+
|
|
4
|
+
from holmes.plugins.toolsets.bash.common.bash_command import BashCommand
|
|
5
|
+
from holmes.plugins.toolsets.bash.common.config import BashExecutorConfig
|
|
6
|
+
from holmes.plugins.toolsets.bash.common.stringify import escape_shell_args
|
|
7
|
+
from holmes.plugins.toolsets.bash.common.validators import (
|
|
8
|
+
validate_command_and_operations,
|
|
9
|
+
)
|
|
10
|
+
from holmes.plugins.toolsets.bash.aws.constants import (
|
|
11
|
+
ALLOWED_AWS_COMMANDS,
|
|
12
|
+
DENIED_AWS_COMMANDS,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AWSCommand(BashCommand):
|
|
17
|
+
def __init__(self):
|
|
18
|
+
super().__init__("aws")
|
|
19
|
+
|
|
20
|
+
def add_parser(self, parent_parser: Any):
|
|
21
|
+
"""Create AWS CLI parser with safe command validation."""
|
|
22
|
+
aws_parser = parent_parser.add_parser(
|
|
23
|
+
"aws",
|
|
24
|
+
help="Amazon Web Services Command Line Interface",
|
|
25
|
+
exit_on_error=False,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
aws_parser.add_argument(
|
|
29
|
+
"service",
|
|
30
|
+
help="AWS service name (e.g., ec2, s3, lambda)",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
aws_parser.add_argument("operation", help="AWS operation to perform")
|
|
34
|
+
|
|
35
|
+
aws_parser.add_argument(
|
|
36
|
+
"options",
|
|
37
|
+
nargs=argparse.REMAINDER,
|
|
38
|
+
default=[],
|
|
39
|
+
help="Additional AWS CLI options and parameters",
|
|
40
|
+
)
|
|
41
|
+
return aws_parser
|
|
42
|
+
|
|
43
|
+
def validate_command(
|
|
44
|
+
self, command: Any, original_command: str, config: Optional[BashExecutorConfig]
|
|
45
|
+
) -> None:
|
|
46
|
+
# Build options list with operation and remaining arguments
|
|
47
|
+
options = [command.operation] + (
|
|
48
|
+
command.options if hasattr(command, "options") else []
|
|
49
|
+
)
|
|
50
|
+
validate_command_and_operations(
|
|
51
|
+
command=command.service,
|
|
52
|
+
options=options,
|
|
53
|
+
allowed_commands=ALLOWED_AWS_COMMANDS,
|
|
54
|
+
denied_commands=DENIED_AWS_COMMANDS,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def stringify_command(
|
|
58
|
+
self, command: Any, original_command: str, config: Optional[BashExecutorConfig]
|
|
59
|
+
) -> str:
|
|
60
|
+
"""Convert parsed AWS command back to safe command string."""
|
|
61
|
+
parts = ["aws", command.service, command.operation]
|
|
62
|
+
|
|
63
|
+
if hasattr(command, "options") and command.options:
|
|
64
|
+
parts.extend(command.options)
|
|
65
|
+
|
|
66
|
+
return " ".join(escape_shell_args(parts))
|