holmesgpt 0.13.0__py3-none-any.whl → 0.13.1__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.
Potentially problematic release.
This version of holmesgpt might be problematic. Click here for more details.
- holmes/__init__.py +1 -1
- holmes/common/env_vars.py +4 -0
- holmes/core/llm.py +3 -1
- holmes/core/tool_calling_llm.py +112 -11
- holmes/core/toolset_manager.py +1 -5
- holmes/core/tracing.py +1 -1
- holmes/main.py +7 -1
- holmes/plugins/prompts/_fetch_logs.jinja2 +4 -0
- holmes/plugins/runbooks/CLAUDE.md +85 -0
- holmes/plugins/runbooks/README.md +24 -0
- 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 +47 -13
- 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/prometheus/prometheus.py +42 -12
- holmes/utils/console/logging.py +6 -1
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.1.dist-info}/METADATA +1 -1
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.1.dist-info}/RECORD +53 -30
- holmes/plugins/toolsets/bash/grep/__init__.py +0 -52
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.1.dist-info}/LICENSE.txt +0 -0
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.1.dist-info}/WHEEL +0 -0
- {holmesgpt-0.13.0.dist-info → holmesgpt-0.13.1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from holmes.plugins.toolsets.bash.common.bash_command import (
|
|
2
|
+
SimpleBashCommand,
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class UniqCommand(SimpleBashCommand):
|
|
7
|
+
def __init__(self):
|
|
8
|
+
super().__init__(
|
|
9
|
+
name="uniq",
|
|
10
|
+
allowed_options=[], # Allow all options except file operations
|
|
11
|
+
denied_options=[],
|
|
12
|
+
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
|
+
import boto3
|
|
3
4
|
import os
|
|
4
5
|
import re
|
|
5
6
|
import time
|
|
@@ -86,22 +87,53 @@ class PrometheusConfig(BaseModel):
|
|
|
86
87
|
|
|
87
88
|
|
|
88
89
|
class AMPConfig(PrometheusConfig):
|
|
89
|
-
aws_access_key: str
|
|
90
|
-
aws_secret_access_key: str
|
|
90
|
+
aws_access_key: Optional[str] = None
|
|
91
|
+
aws_secret_access_key: Optional[str] = None
|
|
91
92
|
aws_region: str
|
|
92
93
|
aws_service_name: str = "aps"
|
|
93
|
-
healthcheck: str = "api/v1/query?query=up"
|
|
94
|
+
healthcheck: str = "api/v1/query?query=up"
|
|
94
95
|
prometheus_ssl_enabled: bool = False
|
|
95
96
|
|
|
96
97
|
def is_amp(self) -> bool:
|
|
97
98
|
return True
|
|
98
99
|
|
|
99
|
-
def
|
|
100
|
+
def _build_irsa_auth(self) -> Optional[AWS4Auth]:
|
|
101
|
+
"""Try IRSA (or default AWS provider chain)."""
|
|
102
|
+
session = boto3.Session()
|
|
103
|
+
creds = session.get_credentials()
|
|
104
|
+
if creds is None:
|
|
105
|
+
return None
|
|
106
|
+
frozen = creds.get_frozen_credentials()
|
|
100
107
|
return AWS4Auth(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
self.aws_region,
|
|
104
|
-
self.aws_service_name,
|
|
108
|
+
frozen.access_key,
|
|
109
|
+
frozen.secret_key,
|
|
110
|
+
self.aws_region,
|
|
111
|
+
self.aws_service_name,
|
|
112
|
+
session_token=frozen.token,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
def _build_static_aws_auth(self) -> Optional[AWS4Auth]:
|
|
116
|
+
"""Fallback: static credentials from config."""
|
|
117
|
+
if self.aws_access_key and self.aws_secret_access_key:
|
|
118
|
+
return AWS4Auth(
|
|
119
|
+
self.aws_access_key,
|
|
120
|
+
self.aws_secret_access_key,
|
|
121
|
+
self.aws_region,
|
|
122
|
+
self.aws_service_name,
|
|
123
|
+
)
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
def get_auth(self):
|
|
127
|
+
# Prefer IRSA, fallback to static
|
|
128
|
+
irsa_auth = self._build_irsa_auth()
|
|
129
|
+
if irsa_auth:
|
|
130
|
+
return irsa_auth
|
|
131
|
+
static_auth = self._build_static_aws_auth()
|
|
132
|
+
if static_auth:
|
|
133
|
+
return static_auth
|
|
134
|
+
raise RuntimeError(
|
|
135
|
+
"No AWS credentials available. Tried IRSA and static keys. "
|
|
136
|
+
"Ensure IRSA is configured on the service account or provide aws_access_key/aws_secret_access_key."
|
|
105
137
|
)
|
|
106
138
|
|
|
107
139
|
|
|
@@ -847,10 +879,8 @@ class PrometheusToolset(Toolset):
|
|
|
847
879
|
def determine_prometheus_class(
|
|
848
880
|
self, config: dict[str, Any]
|
|
849
881
|
) -> Type[Union[PrometheusConfig, AMPConfig]]:
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
)
|
|
853
|
-
return AMPConfig if has_aws_credentials else PrometheusConfig
|
|
882
|
+
has_aws_fields = "aws_region" in config
|
|
883
|
+
return AMPConfig if has_aws_fields else PrometheusConfig
|
|
854
884
|
|
|
855
885
|
def prerequisites_callable(self, config: dict[str, Any]) -> Tuple[bool, str]:
|
|
856
886
|
try:
|
holmes/utils/console/logging.py
CHANGED
|
@@ -41,9 +41,14 @@ def suppress_noisy_logs():
|
|
|
41
41
|
warnings.filterwarnings("ignore", category=UserWarning, module="slack_sdk.*")
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
def init_logging(verbose_flags: Optional[List[bool]] = None):
|
|
44
|
+
def init_logging(verbose_flags: Optional[List[bool]] = None, log_costs: bool = False):
|
|
45
45
|
verbosity = cli_flags_to_verbosity(verbose_flags) # type: ignore
|
|
46
46
|
|
|
47
|
+
# Setup cost logger if requested
|
|
48
|
+
if log_costs:
|
|
49
|
+
cost_logger = logging.getLogger("holmes.costs")
|
|
50
|
+
cost_logger.setLevel(logging.DEBUG)
|
|
51
|
+
|
|
47
52
|
if verbosity == Verbosity.VERY_VERBOSE:
|
|
48
53
|
logging.basicConfig(
|
|
49
54
|
force=True,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
holmes/.git_archival.json,sha256=PbwdO7rNhEJ4ALiO12DPPb81xNAIsVxCA0m8OrVoqsk,182
|
|
2
|
-
holmes/__init__.py,sha256=
|
|
2
|
+
holmes/__init__.py,sha256=NltHfPr29LMOUQTPPF4jx4HL3GJgTe2VeN_7s7XbYYc,257
|
|
3
3
|
holmes/clients/robusta_client.py,sha256=lHV02aKJmAb08jVhjQ6jWvhhmjQ86Ajbo_lgbhqfn3s,1221
|
|
4
|
-
holmes/common/env_vars.py,sha256=
|
|
4
|
+
holmes/common/env_vars.py,sha256=r5OIkAGb5nfNmDsIDZTDNV3BhhYUOIXgsGsfu587AkU,2700
|
|
5
5
|
holmes/common/openshift.py,sha256=akbQ0GpnmuzXOqTcotpTDQSDKIROypS9mgPOprUgkCw,407
|
|
6
6
|
holmes/config.py,sha256=lQwvJiVbMehzHFQ1HupLEGMmYzLuSumo5Ivko1DmaTU,23724
|
|
7
7
|
holmes/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -10,7 +10,7 @@ holmes/core/conversations.py,sha256=_X5Vods_DEaNyPJ1hqDvqG-RDCYldEnyagXqz2kZ_rs,
|
|
|
10
10
|
holmes/core/investigation.py,sha256=sxzD-z70LZKaalqdUTNrzdo3fyfHkdC6J3WnOwNyK18,6203
|
|
11
11
|
holmes/core/investigation_structured_output.py,sha256=sNxyqmsElQ-B22OlzTOrJtfrlipjyidcTU07idOBO7w,10570
|
|
12
12
|
holmes/core/issue.py,sha256=dbctGv8KHAXC1SeOMkEP-BudJ50u7kA8jLN5FN_d808,2426
|
|
13
|
-
holmes/core/llm.py,sha256=
|
|
13
|
+
holmes/core/llm.py,sha256=BS4bF4tzGntfAJVOYFowfdhSoDZwBs-z1f3YbsR-21Q,11138
|
|
14
14
|
holmes/core/models.py,sha256=1ILqNpTxMAl9sldFyp6P4gWEdtRaKJP59uZvNMqvmbs,5990
|
|
15
15
|
holmes/core/openai_formatting.py,sha256=wL0Fq6lDePIKR5viitQz9ZWCQZZkHZHmEUqPIsOoFns,4077
|
|
16
16
|
holmes/core/performance_timing.py,sha256=MTbTiiX2jjPmW7PuNA2eYON40eWsHPryR1ap_KlwZ_E,2217
|
|
@@ -20,15 +20,15 @@ holmes/core/runbooks.py,sha256=Oj5ICmiGgaq57t4erPzQDvHQ0rMGj1nhiiYhl8peH3Q,939
|
|
|
20
20
|
holmes/core/safeguards.py,sha256=SAw-J9y3uAehJVZJYsFs4C62jzLV4p_C07F2jUuJHug,4895
|
|
21
21
|
holmes/core/supabase_dal.py,sha256=uUqO1DwHsheJK1wMIqnknnUp0KhJ2kkqUd4jqae_yaA,21402
|
|
22
22
|
holmes/core/todo_manager.py,sha256=w8CGdynVfCbekW2p93OLo78OmTJqcvgkjNgjBIjkPLQ,2733
|
|
23
|
-
holmes/core/tool_calling_llm.py,sha256=
|
|
23
|
+
holmes/core/tool_calling_llm.py,sha256=x2tt7R9d6JWGwYdcR9jYVUAP8rc6B5z6lnQWqKvtV3c,38440
|
|
24
24
|
holmes/core/tools.py,sha256=AtEwwDorhA2jNYgZbeWdizjL9XQRl_B92L968bVFN3o,20807
|
|
25
25
|
holmes/core/tools_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
26
|
holmes/core/tools_utils/tool_executor.py,sha256=wLuyr1O8zkNXaZ_MzWm5hUDcOI3tB9I4YiserDhIu-E,2375
|
|
27
27
|
holmes/core/tools_utils/toolset_utils.py,sha256=SvWzen8Fg_TB_6Idw1hK0nCPrJL40ueWVMfsv8Kh2RY,2363
|
|
28
|
-
holmes/core/toolset_manager.py,sha256=
|
|
29
|
-
holmes/core/tracing.py,sha256=
|
|
28
|
+
holmes/core/toolset_manager.py,sha256=PVmhRaSZntcJ_-jE3W2vHwZgAXIprPIgq0YMGYhmcZs,18451
|
|
29
|
+
holmes/core/tracing.py,sha256=j7tC4xuPHTU3s1m8Y7kClNfGOSBTHBINFkr1NmYe51Y,8986
|
|
30
30
|
holmes/interactive.py,sha256=YsWyuCXFLTYVuikmVjwwnoqOMBqB1nXKR2vEKVCni0w,39669
|
|
31
|
-
holmes/main.py,sha256=
|
|
31
|
+
holmes/main.py,sha256=tgavFfpzB2MPc6X_NNral0MYyooDXwYj2_3ncf8YYUE,34842
|
|
32
32
|
holmes/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
holmes/plugins/destinations/__init__.py,sha256=vMYwTfA5nQ05us5Rzbaoe0R5C8Navo6ENVZhojtACTk,98
|
|
34
34
|
holmes/plugins/destinations/slack/__init__.py,sha256=HVoDdTbdJJ1amXt12ZSMVcn3E04rcOrqk6BgNwvMbWY,56
|
|
@@ -38,7 +38,7 @@ holmes/plugins/prompts/__init__.py,sha256=sOUHbHFQ6tYX7XWLi-Ak87cOQB1E889X5X8kWJ
|
|
|
38
38
|
holmes/plugins/prompts/_ai_safety.jinja2,sha256=IoVdOXHnkGwLaiuUzMczEdoahyrKhkdYvyDmz9Oewxw,2262
|
|
39
39
|
holmes/plugins/prompts/_current_date_time.jinja2,sha256=KynAvkQFqf_SXjqVY77nB8z4RgN7gti4SBSq1H7moHs,354
|
|
40
40
|
holmes/plugins/prompts/_default_log_prompt.jinja2,sha256=Tqw8CD2ZMStXIfMdYaoZT_d-FvQ_PMg6-knqag-YEgc,1478
|
|
41
|
-
holmes/plugins/prompts/_fetch_logs.jinja2,sha256
|
|
41
|
+
holmes/plugins/prompts/_fetch_logs.jinja2,sha256=-rM-bYRGOlQa0KlheCXR4b0UcED1F7nHnHgnsqbx_PM,3988
|
|
42
42
|
holmes/plugins/prompts/_general_instructions.jinja2,sha256=AEAKYlqryhuAQcGj9MJPXyy2wG_fN0FFHsDGhHHWiFk,5588
|
|
43
43
|
holmes/plugins/prompts/_global_instructions.jinja2,sha256=d_c-BtDhU_Rmx637TPAyzlIIim8ZAxy7JK3V4GV8IWI,1359
|
|
44
44
|
holmes/plugins/prompts/_permission_errors.jinja2,sha256=gIMQx-zaTnuEv7SkQVC_GvxsR5R85fLuDZnJIKWcm5A,480
|
|
@@ -54,7 +54,8 @@ holmes/plugins/prompts/investigation_output_format.jinja2,sha256=C03_d4cQUhEvI5Y
|
|
|
54
54
|
holmes/plugins/prompts/investigation_procedure.jinja2,sha256=4om_wYqZAnUhttQ13yLJDqk72ki6XLWRkllV9Tl76X4,10258
|
|
55
55
|
holmes/plugins/prompts/kubernetes_workload_ask.jinja2,sha256=C6iclMZ9n64nUvvc28WxzXixMT8s-7z1owMxSDvyVrk,5930
|
|
56
56
|
holmes/plugins/prompts/kubernetes_workload_chat.jinja2,sha256=rjB6mAHk2SDg2cwZp5vp66ihCer17BE6o8Ezr2zGQE4,1770
|
|
57
|
-
holmes/plugins/runbooks/
|
|
57
|
+
holmes/plugins/runbooks/CLAUDE.md,sha256=WYjf-ZvKmfrShmhTHplLscIpIB1j2TrrG6C_LR63XR0,5511
|
|
58
|
+
holmes/plugins/runbooks/README.md,sha256=dPrAO4bZGGW1C3FFaUm_adPMrb72DSSmbUkRSwqNK4U,2585
|
|
58
59
|
holmes/plugins/runbooks/__init__.py,sha256=2_39h7qZYhh0a7I2-OrvswF0Y8F7nWqI5zD_dgt_wsk,3333
|
|
59
60
|
holmes/plugins/runbooks/catalog.json,sha256=GvrpVpk0AIm9HZ3dlh6FI_CVzHoCGJPvZggOMaL_WKs,436
|
|
60
61
|
holmes/plugins/runbooks/jira.yaml,sha256=o24IL7Cb-Mv5X-cAj8Ik4KmEmY7bf98zBkMP5r39ong,777
|
|
@@ -98,22 +99,44 @@ holmes/plugins/toolsets/azure_sql/tools/get_top_data_io_queries.py,sha256=xGKjLM
|
|
|
98
99
|
holmes/plugins/toolsets/azure_sql/tools/get_top_log_io_queries.py,sha256=68fEIbymGppNGh4gAFz4Uvz0gLsTn41EuAfoz07Oe3w,7554
|
|
99
100
|
holmes/plugins/toolsets/azure_sql/utils.py,sha256=nN8ZcVpkOa05nocY4W1gf7aaaNhzn2oD-P0STYQK2Ck,2331
|
|
100
101
|
holmes/plugins/toolsets/bash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
|
-
holmes/plugins/toolsets/bash/
|
|
102
|
-
holmes/plugins/toolsets/bash/
|
|
102
|
+
holmes/plugins/toolsets/bash/argocd/__init__.py,sha256=1ck-b82embOjsiiZkvuDChXiFaNYFwl5xW-ysBRB4vA,2186
|
|
103
|
+
holmes/plugins/toolsets/bash/argocd/constants.py,sha256=J1bkIX_3S4WQEcqHsCIMh0T-ehHmdFHXcr8mbgJNMEI,3176
|
|
104
|
+
holmes/plugins/toolsets/bash/aws/__init__.py,sha256=4fzFz64Ussyvznp-AJ2w5pGa4IbYYw6bosK_o-XbTTM,2229
|
|
105
|
+
holmes/plugins/toolsets/bash/aws/constants.py,sha256=g8IH1CLkAZuV8SQEQrUVjLul7S28UvAwRjHwnYXkl3M,18389
|
|
106
|
+
holmes/plugins/toolsets/bash/azure/__init__.py,sha256=FsLA_v_otjuo_COEw8Hmiuh5_aQ3RWRIstECeBAS5hg,1863
|
|
107
|
+
holmes/plugins/toolsets/bash/azure/constants.py,sha256=jz2R8-EiSjGjAPBTtIAbLwfyHOJPVmI117wp-u_e8Kc,10361
|
|
108
|
+
holmes/plugins/toolsets/bash/bash_instructions.jinja2,sha256=AKVW1DpD6lii8cF582LZzEe9sOh3YJCerXBapwlEKhU,481
|
|
109
|
+
holmes/plugins/toolsets/bash/bash_toolset.py,sha256=tcwlRp7vFpLu-tFmhHlpfQjFRHLDW1NxTHJ310i901E,9299
|
|
103
110
|
holmes/plugins/toolsets/bash/common/bash.py,sha256=qFMLLgdi_RuNY_TRLIyM33JJuoXm--7zj4Xq25baAMY,1783
|
|
111
|
+
holmes/plugins/toolsets/bash/common/bash_command.py,sha256=aGlzQnUQHpEK3BNwztESassqzKQ5PFObwvHcFn5GQIY,4570
|
|
104
112
|
holmes/plugins/toolsets/bash/common/config.py,sha256=dRd_gl16e2jG_gk6_mRVT6o3idiVXJ-8CtBONAx1DOU,285
|
|
105
|
-
holmes/plugins/toolsets/bash/common/stringify.py,sha256=
|
|
106
|
-
holmes/plugins/toolsets/bash/common/validators.py,sha256=
|
|
107
|
-
holmes/plugins/toolsets/bash/
|
|
108
|
-
holmes/plugins/toolsets/bash/
|
|
109
|
-
holmes/plugins/toolsets/bash/
|
|
110
|
-
holmes/plugins/toolsets/bash/
|
|
111
|
-
holmes/plugins/toolsets/bash/kubectl/
|
|
112
|
-
holmes/plugins/toolsets/bash/kubectl/
|
|
113
|
-
holmes/plugins/toolsets/bash/kubectl/
|
|
114
|
-
holmes/plugins/toolsets/bash/kubectl/
|
|
115
|
-
holmes/plugins/toolsets/bash/kubectl/
|
|
116
|
-
holmes/plugins/toolsets/bash/
|
|
113
|
+
holmes/plugins/toolsets/bash/common/stringify.py,sha256=8dd4KqaNbMmdEaMgAnfEpbNhShVIWkce0S13ckbxNP4,1470
|
|
114
|
+
holmes/plugins/toolsets/bash/common/validators.py,sha256=hdQCwrLP9TR7TfViKIajRooqwvd3ZXC-bB-hUvNRsUk,4146
|
|
115
|
+
holmes/plugins/toolsets/bash/docker/__init__.py,sha256=PrWTOL1k7UXPD35zoIEnNhmKKzigTJxu5MLsAtHxrZc,1914
|
|
116
|
+
holmes/plugins/toolsets/bash/docker/constants.py,sha256=mmyC7RJY2eamp7yjAfqTz-mpB76fP0ZTf6uTuaeYsGY,5015
|
|
117
|
+
holmes/plugins/toolsets/bash/helm/__init__.py,sha256=WUpWPm1qcJyvdvT6qPWioshbakqMyeTzuaaxvigUIFU,2094
|
|
118
|
+
holmes/plugins/toolsets/bash/helm/constants.py,sha256=WnVCu8hv4eiDeIhyPumOU2UkC-dk3ndG1Nw5s8RrjEE,1898
|
|
119
|
+
holmes/plugins/toolsets/bash/kubectl/__init__.py,sha256=KCoiVytpxPJg4EeUWF_1EX0Ey9I4cE8EhCSLSK9gGP0,4302
|
|
120
|
+
holmes/plugins/toolsets/bash/kubectl/constants.py,sha256=jYC1YCsdM-fel3V-T5yKR0QUzwuJX0nCr7FHKCbUVt8,1494
|
|
121
|
+
holmes/plugins/toolsets/bash/kubectl/kubectl_describe.py,sha256=y-Yiy3LsleZF1DBuhq8fCSZwkdY3yD3v7z5TRLpZCY8,1596
|
|
122
|
+
holmes/plugins/toolsets/bash/kubectl/kubectl_events.py,sha256=5EP-imdVcK-b1WRSTYp1b0FiWHEwoyuS93FaRWL8xHU,1290
|
|
123
|
+
holmes/plugins/toolsets/bash/kubectl/kubectl_get.py,sha256=jjw9lTj0_9IsTkFnIIV3rib2CoYlIFTUrHX_GQUglyA,1527
|
|
124
|
+
holmes/plugins/toolsets/bash/kubectl/kubectl_logs.py,sha256=IhK22AwX5Glc93JlhmIxOdemjRShjDnjSK6PmIA3y2M,1197
|
|
125
|
+
holmes/plugins/toolsets/bash/kubectl/kubectl_run.py,sha256=1CGnbzRftgrgCLGrtF8ThOld8Ebc6Vb6VaXMQAdufoA,1585
|
|
126
|
+
holmes/plugins/toolsets/bash/kubectl/kubectl_top.py,sha256=Hjpx9K5e93OZVaJV85Oey_OdiiXYCQerGwHwWF75rhQ,1354
|
|
127
|
+
holmes/plugins/toolsets/bash/parse_command.py,sha256=ggC--vw9vI8KkXUSOnHRiwavZf93cnUvbEqNhS_yeiI,5963
|
|
128
|
+
holmes/plugins/toolsets/bash/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
129
|
+
holmes/plugins/toolsets/bash/utilities/base64_util.py,sha256=yAImxU-VQJ1ioCN-whItR9x3u0Sx84dQBMUkFw7KC1Q,324
|
|
130
|
+
holmes/plugins/toolsets/bash/utilities/cut.py,sha256=gDBdzY9gM9h6heEqeYhWwjDULpvpwWMDNYbQ-vvNKiE,318
|
|
131
|
+
holmes/plugins/toolsets/bash/utilities/grep/__init__.py,sha256=9_4yBTJYRH4vFq_B5yklf4Io0C-7v8GaJeItxZ22B1I,267
|
|
132
|
+
holmes/plugins/toolsets/bash/utilities/head.py,sha256=kgNypaY0xcbMpBt7486zdsqPcnrU17Qi--EuYaxw0AM,276
|
|
133
|
+
holmes/plugins/toolsets/bash/utilities/jq.py,sha256=qQLuVB40ROaw33jJCME_aRt2ElytAe9W81sh56JgM14,2586
|
|
134
|
+
holmes/plugins/toolsets/bash/utilities/sed.py,sha256=tDUVr1VxuLvHKv1n9_CSaBfgYIwnwLA30Vln_ehkGBY,5756
|
|
135
|
+
holmes/plugins/toolsets/bash/utilities/sort.py,sha256=atvOuiNyk4BbKvWthZusArcNslH1fMx_nMJUIB3vF9E,352
|
|
136
|
+
holmes/plugins/toolsets/bash/utilities/tail.py,sha256=GGHQoMAos0j5kN0EGSq_oQ63j9ZczyhrvEe8tgMLRzg,276
|
|
137
|
+
holmes/plugins/toolsets/bash/utilities/tr.py,sha256=4X3_816-ur6dDMyuJdS2ZwqdKz9aqqOHzqx-yi2m1cs,2157
|
|
138
|
+
holmes/plugins/toolsets/bash/utilities/uniq.py,sha256=bod-81lXO7-EQiy73A9aaDnc-RkrclwdBJ4rS_rUyn8,320
|
|
139
|
+
holmes/plugins/toolsets/bash/utilities/wc.py,sha256=EhhRcKjb9QNI51uUjftyzzHQucCawkTU3AB2cviTV90,287
|
|
117
140
|
holmes/plugins/toolsets/confluence.yaml,sha256=E4C9ZC2e_4KsN7sK_3NLSNGA_nqrNDjYR01mGA0xosM,785
|
|
118
141
|
holmes/plugins/toolsets/consts.py,sha256=vxzGJBF1XNAE9CDteUFIYNRmOagmJ-ktFEfVEU8tHl0,205
|
|
119
142
|
holmes/plugins/toolsets/coralogix/api.py,sha256=66DVwL_r7lldS1ahx3rcr60R7NCiE-21fcZPoY0v8Dk,5119
|
|
@@ -163,7 +186,7 @@ holmes/plugins/toolsets/opensearch/opensearch_logs.py,sha256=0-QULPz3KgpFogmXH8N
|
|
|
163
186
|
holmes/plugins/toolsets/opensearch/opensearch_traces.py,sha256=eg_oFMttClcsr-7Nu9r7UesnBh4YVSO31IB81-e0uw0,8699
|
|
164
187
|
holmes/plugins/toolsets/opensearch/opensearch_traces_instructions.jinja2,sha256=Xn8AW4XCMYV1VkBbF8nNB9fUpKQ1Vbm88iFczj-LQXo,1035
|
|
165
188
|
holmes/plugins/toolsets/opensearch/opensearch_utils.py,sha256=mh9Wp22tOdJYmA9IaFS7tD3aEENljyeuPOsF-lEe5C0,5097
|
|
166
|
-
holmes/plugins/toolsets/prometheus/prometheus.py,sha256=
|
|
189
|
+
holmes/plugins/toolsets/prometheus/prometheus.py,sha256=Y52Prt2XM3bFnB3maxUi5ZfknFBr8NumwDbyBdBmDas,35747
|
|
167
190
|
holmes/plugins/toolsets/prometheus/prometheus_instructions.jinja2,sha256=7IR5cIIhLKkFFVjuJh6Lg6HkuNuyTt9WYKMAo_nZMqs,2842
|
|
168
191
|
holmes/plugins/toolsets/rabbitmq/api.py,sha256=-BtqF7hQWtl_OamnQ521vYHhR8E2n2wcPNYxfI9r4kQ,14307
|
|
169
192
|
holmes/plugins/toolsets/rabbitmq/rabbitmq_instructions.jinja2,sha256=qetmtJUMkx9LIihr2fSJ2EV9h2J-b-ZdUAvMtopXZYY,3105
|
|
@@ -185,7 +208,7 @@ holmes/utils/cache.py,sha256=aPc7zTdpBQ3JQR7ET4wvIwzXhx2PpPKiBBSTgbVNXlY,2219
|
|
|
185
208
|
holmes/utils/cert_utils.py,sha256=5YAUOY3LjFqqFpYHnHLvSc70LCxEWf0spw1vZwLLvOw,1193
|
|
186
209
|
holmes/utils/colors.py,sha256=G-1EcwwOjLmilL74M4AfOGxvlGSMaDfGT518A9Iek2k,221
|
|
187
210
|
holmes/utils/console/consts.py,sha256=SXcXHWjMH63nh5ErDKR6K7wrCUoxxlZ0KKM1Ipoy6J4,387
|
|
188
|
-
holmes/utils/console/logging.py,sha256=
|
|
211
|
+
holmes/utils/console/logging.py,sha256=2HLGg58VKfECD4YhSMacIoSRt9b7tbVMDthuHa-qj6I,3253
|
|
189
212
|
holmes/utils/console/result.py,sha256=lCnn1YX6J36d1GTVYX0jkp8QrJKVosq8t7z7G1j6hhA,1386
|
|
190
213
|
holmes/utils/default_toolset_installation_guide.jinja2,sha256=HEf7tX75HE3H4-YeLbJfa0WbiLEsI71usKrXHCO_sHo,992
|
|
191
214
|
holmes/utils/definitions.py,sha256=WKVDFh1wfuo0UCV_1jXFjgP0gjGM3-U-UdxdVxmXaKM,287
|
|
@@ -201,8 +224,8 @@ holmes/utils/pydantic_utils.py,sha256=g0e0jLTa8Je8JKrhEP4N5sMxj0_hhPOqFZr0Vpd67s
|
|
|
201
224
|
holmes/utils/stream.py,sha256=Z9duSET8uXx-1dqPBjGuDKBxkJMaMsCrOqOXrVbtjGw,2806
|
|
202
225
|
holmes/utils/tags.py,sha256=SU4EZMBtLlIb7OlHsSpguFaypczRzOcuHYxDSanV3sQ,3364
|
|
203
226
|
holmes/version.py,sha256=uDRPOvVaHreROj_9HPe81RVpTzHcG8ojpGTsnJIlQOM,5220
|
|
204
|
-
holmesgpt-0.13.
|
|
205
|
-
holmesgpt-0.13.
|
|
206
|
-
holmesgpt-0.13.
|
|
207
|
-
holmesgpt-0.13.
|
|
208
|
-
holmesgpt-0.13.
|
|
227
|
+
holmesgpt-0.13.1.dist-info/LICENSE.txt,sha256=RdZMj8VXRQdVslr6PMYMbAEu5pOjOdjDqt3yAmWb9Ds,1072
|
|
228
|
+
holmesgpt-0.13.1.dist-info/METADATA,sha256=p4woVVwyO6hHxd54WjDt87-CmaV3nJl0Om0FJj4vlrg,16194
|
|
229
|
+
holmesgpt-0.13.1.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
|
|
230
|
+
holmesgpt-0.13.1.dist-info/entry_points.txt,sha256=JdzEyZhpaYr7Boo4uy4UZgzY1VsAEbzMgGmHZtx9KFY,42
|
|
231
|
+
holmesgpt-0.13.1.dist-info/RECORD,,
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
import re
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from holmes.plugins.toolsets.bash.common.stringify import escape_shell_args
|
|
6
|
-
|
|
7
|
-
MAX_GREP_SIZE = 100
|
|
8
|
-
SAFE_GREP_PATTERN = re.compile(r"^[a-zA-Z0-9\-_. :*()]+$")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def create_grep_parser(main_parser: Any):
|
|
12
|
-
parser = main_parser.add_parser(
|
|
13
|
-
"grep",
|
|
14
|
-
help="Search text patterns in files or input",
|
|
15
|
-
exit_on_error=False,
|
|
16
|
-
)
|
|
17
|
-
parser.add_argument(
|
|
18
|
-
"keyword",
|
|
19
|
-
type=lambda x: validate_grep_keyword(x),
|
|
20
|
-
help="The pattern to search for",
|
|
21
|
-
)
|
|
22
|
-
parser.add_argument(
|
|
23
|
-
"-i", "--ignore-case", action="store_true", help="Ignore case distinctions"
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def validate_grep_keyword(value: str) -> str:
|
|
28
|
-
"""Validate the grep keyword parameter."""
|
|
29
|
-
|
|
30
|
-
if not value:
|
|
31
|
-
raise argparse.ArgumentTypeError("Grep keyword cannot be empty")
|
|
32
|
-
|
|
33
|
-
if not SAFE_GREP_PATTERN.match(value):
|
|
34
|
-
raise argparse.ArgumentTypeError(f"Unsafe grep keyword: {value}")
|
|
35
|
-
|
|
36
|
-
if len(value) > MAX_GREP_SIZE:
|
|
37
|
-
raise argparse.ArgumentTypeError(
|
|
38
|
-
f"Grep keyword too long. Max allowed size is {MAX_GREP_SIZE} but received {len(value)}"
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
return value
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def stringify_grep_command(cmd: Any) -> str:
|
|
45
|
-
"""Stringify grep command."""
|
|
46
|
-
parts = ["grep"]
|
|
47
|
-
|
|
48
|
-
if cmd.ignore_case:
|
|
49
|
-
parts.append("-i")
|
|
50
|
-
|
|
51
|
-
parts.append(cmd.keyword)
|
|
52
|
-
return " ".join(escape_shell_args(parts))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|