diagram-to-iac 1.0.1__py3-none-any.whl → 1.0.3__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.
- diagram_to_iac/__init__.py +34 -8
- diagram_to_iac/agents/demonstrator_langgraph/agent.py +12 -8
- diagram_to_iac/agents/git_langgraph/agent.py +74 -24
- diagram_to_iac/agents/hello_langgraph/agent.py +69 -13
- diagram_to_iac/agents/policy_agent/agent.py +41 -18
- diagram_to_iac/agents/supervisor_langgraph/agent.py +70 -25
- diagram_to_iac/agents/terraform_langgraph/agent.py +75 -27
- diagram_to_iac/core/config_loader.py +281 -0
- diagram_to_iac/core/memory.py +7 -2
- diagram_to_iac/tools/api_utils.py +61 -20
- diagram_to_iac/tools/git/git.py +69 -18
- diagram_to_iac/tools/sec_utils.py +248 -35
- diagram_to_iac/tools/shell/shell.py +89 -32
- diagram_to_iac/tools/tf/terraform.py +43 -32
- {diagram_to_iac-1.0.1.dist-info → diagram_to_iac-1.0.3.dist-info}/METADATA +3 -3
- {diagram_to_iac-1.0.1.dist-info → diagram_to_iac-1.0.3.dist-info}/RECORD +19 -18
- {diagram_to_iac-1.0.1.dist-info → diagram_to_iac-1.0.3.dist-info}/WHEEL +0 -0
- {diagram_to_iac-1.0.1.dist-info → diagram_to_iac-1.0.3.dist-info}/entry_points.txt +0 -0
- {diagram_to_iac-1.0.1.dist-info → diagram_to_iac-1.0.3.dist-info}/top_level.txt +0 -0
@@ -20,6 +20,7 @@ from pydantic import BaseModel, Field, field_validator
|
|
20
20
|
from langchain_core.tools import tool
|
21
21
|
|
22
22
|
from diagram_to_iac.core.memory import create_memory
|
23
|
+
from diagram_to_iac.core.config_loader import get_config, get_config_value
|
23
24
|
from diagram_to_iac.tools.shell import get_shell_executor, ShellExecInput
|
24
25
|
|
25
26
|
|
@@ -158,32 +159,42 @@ class TerraformExecutor:
|
|
158
159
|
datefmt='%Y-%m-%d %H:%M:%S'
|
159
160
|
)
|
160
161
|
|
161
|
-
# Load configuration
|
162
|
-
if config_path is None:
|
163
|
-
# Use shared shell configuration which contains terraform allowlist
|
164
|
-
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
165
|
-
config_path = os.path.join(base_dir, 'agents', 'shell_langgraph', 'tools', 'shell_tools_config.yaml')
|
166
|
-
self.logger.debug(f"Default config path set to: {config_path}")
|
167
|
-
|
162
|
+
# Load configuration using centralized system with fallback to direct file loading
|
168
163
|
try:
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
self.logger.warning(f"Configuration file at {config_path} is empty. Using default values.")
|
164
|
+
self.config = get_config('tools.terraform', config_path)
|
165
|
+
if self.config is None:
|
166
|
+
self.logger.warning("No terraform configuration found in centralized system. Using defaults.")
|
173
167
|
self._set_default_config()
|
174
168
|
else:
|
175
|
-
|
169
|
+
self.logger.info("Configuration loaded from centralized system")
|
170
|
+
except Exception as e:
|
171
|
+
self.logger.warning(f"Failed to load from centralized config: {e}. Falling back to direct file loading.")
|
172
|
+
# Fallback to direct file loading for backward compatibility
|
173
|
+
if config_path is None:
|
174
|
+
# Use shared shell configuration which contains terraform allowlist
|
175
|
+
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
176
|
+
config_path = os.path.join(base_dir, 'agents', 'shell_langgraph', 'tools', 'shell_tools_config.yaml')
|
177
|
+
self.logger.debug(f"Default config path set to: {config_path}")
|
178
|
+
|
179
|
+
try:
|
180
|
+
with open(config_path, 'r') as f:
|
181
|
+
loaded_config = yaml.safe_load(f)
|
182
|
+
if loaded_config is None:
|
183
|
+
self.logger.warning(f"Configuration file at {config_path} is empty. Using default values.")
|
184
|
+
self._set_default_config()
|
185
|
+
else:
|
186
|
+
# Start with default config and merge loaded config
|
187
|
+
self._set_default_config()
|
188
|
+
# Merge shell_executor config from loaded file
|
189
|
+
if 'shell_executor' in loaded_config:
|
190
|
+
self.config['shell_executor'].update(loaded_config['shell_executor'])
|
191
|
+
self.logger.info(f"Terraform configuration loaded and merged from {config_path}")
|
192
|
+
except FileNotFoundError:
|
193
|
+
self.logger.warning(f"Configuration file not found at {config_path}. Using default values.")
|
194
|
+
self._set_default_config()
|
195
|
+
except yaml.YAMLError as e:
|
196
|
+
self.logger.error(f"Error parsing YAML configuration from {config_path}: {e}. Using default values.", exc_info=True)
|
176
197
|
self._set_default_config()
|
177
|
-
# Merge shell_executor config from loaded file
|
178
|
-
if 'shell_executor' in loaded_config:
|
179
|
-
self.config['shell_executor'].update(loaded_config['shell_executor'])
|
180
|
-
self.logger.info(f"Terraform configuration loaded and merged from {config_path}")
|
181
|
-
except FileNotFoundError:
|
182
|
-
self.logger.warning(f"Configuration file not found at {config_path}. Using default values.")
|
183
|
-
self._set_default_config()
|
184
|
-
except yaml.YAMLError as e:
|
185
|
-
self.logger.error(f"Error parsing YAML configuration from {config_path}: {e}. Using default values.", exc_info=True)
|
186
|
-
self._set_default_config()
|
187
198
|
|
188
199
|
# Initialize memory system following our pattern
|
189
200
|
self.memory = create_memory(memory_type)
|
@@ -200,21 +211,21 @@ class TerraformExecutor:
|
|
200
211
|
self.logger.info(f"Allowed binaries: {shell_config.get('allowed_binaries', [])}")
|
201
212
|
|
202
213
|
def _set_default_config(self):
|
203
|
-
"""Set default configuration
|
214
|
+
"""Set default configuration using centralized system."""
|
204
215
|
self.logger.info("Setting default configuration for TerraformExecutor.")
|
205
216
|
self.config = {
|
206
217
|
'shell_executor': {
|
207
|
-
'allowed_binaries': ['terraform', 'git', 'bash', 'sh'],
|
208
|
-
'default_timeout': 300, # 5 minutes for Terraform operations
|
209
|
-
'workspace_base': '/workspace',
|
210
|
-
'restrict_to_workspace': True,
|
211
|
-
'enable_detailed_logging': True
|
218
|
+
'allowed_binaries': get_config_value("tools.terraform.allowed_binaries", ['terraform', 'git', 'bash', 'sh']),
|
219
|
+
'default_timeout': get_config_value("network.terraform_timeout", 300), # 5 minutes for Terraform operations
|
220
|
+
'workspace_base': get_config_value("system.workspace_base", '/workspace'),
|
221
|
+
'restrict_to_workspace': get_config_value("tools.terraform.restrict_to_workspace", True),
|
222
|
+
'enable_detailed_logging': get_config_value("tools.terraform.enable_detailed_logging", True)
|
212
223
|
},
|
213
224
|
'terraform_executor': {
|
214
|
-
'default_plan_file': 'plan.tfplan',
|
215
|
-
'default_auto_approve': True,
|
216
|
-
'enable_detailed_logging': True,
|
217
|
-
'store_operations_in_memory': True
|
225
|
+
'default_plan_file': get_config_value("tools.terraform.default_plan_file", 'plan.tfplan'),
|
226
|
+
'default_auto_approve': get_config_value("tools.terraform.default_auto_approve", True),
|
227
|
+
'enable_detailed_logging': get_config_value("tools.terraform.enable_detailed_logging", True),
|
228
|
+
'store_operations_in_memory': get_config_value("tools.terraform.store_operations_in_memory", True)
|
218
229
|
},
|
219
230
|
'error_messages': {
|
220
231
|
'terraform_not_found': "Terraform binary not found or not allowed",
|
@@ -1,17 +1,17 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: diagram-to-iac
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
4
4
|
Summary: Convert architecture diagrams into IaC modules
|
5
5
|
Author-email: vindpro <admin@vindpro.com>
|
6
6
|
Description-Content-Type: text/markdown
|
7
7
|
Requires-Dist: anthropic==0.54.0
|
8
|
-
Requires-Dist: google_api_python_client==2.
|
8
|
+
Requires-Dist: google_api_python_client==2.173.0
|
9
9
|
Requires-Dist: langchain_anthropic==0.3.15
|
10
10
|
Requires-Dist: langchain-core<1.0.0,>=0.3.62
|
11
11
|
Requires-Dist: langchain_google_genai==2.1.5
|
12
12
|
Requires-Dist: langchain_openai==0.3.24
|
13
13
|
Requires-Dist: langgraph==0.4.8
|
14
|
-
Requires-Dist: openai==1.
|
14
|
+
Requires-Dist: openai==1.90.0
|
15
15
|
Requires-Dist: protobuf>=5.27.0
|
16
16
|
Requires-Dist: pydantic==2.11.7
|
17
17
|
Requires-Dist: PyYAML==6.0.2
|
@@ -1,4 +1,4 @@
|
|
1
|
-
diagram_to_iac/__init__.py,sha256=
|
1
|
+
diagram_to_iac/__init__.py,sha256=gQanRC5O_7AMB-NQFEEd-MU0GICa-dBsgvcJgquKBfs,1427
|
2
2
|
diagram_to_iac/cli.py,sha256=uumG1frF42eCkdLIZxyxQB1x6lDwtG-qKL4vcHnLLXY,400
|
3
3
|
diagram_to_iac/r2d.py,sha256=I7XSuUtu8TdvAhK4tCMLc3U_3ZtP7DJGfq168aeI3Mk,13208
|
4
4
|
diagram_to_iac/actions/__init__.py,sha256=P1CjjY4FYUA0Tcx8FQNLYYSI9fhv8yKd_TmRGtmhW50,229
|
@@ -7,14 +7,14 @@ diagram_to_iac/actions/supervisor_entry.py,sha256=vWhFn-4M0jQnrUQUSCb0I_YNxzGsKi
|
|
7
7
|
diagram_to_iac/actions/terraform_agent_entry.py,sha256=gKkX4fIRdBDZpwPQO_v2t1SSO0SQuzaxQ0StKegGK8U,6852
|
8
8
|
diagram_to_iac/agents/__init__.py,sha256=GHInKSPq56ZPYSKsyti6_wk82dhn2hOqfxNHkZZOj_0,735
|
9
9
|
diagram_to_iac/agents/demonstrator_langgraph/__init__.py,sha256=nghMYMEEarfkR0V6AH1fDCV-mXBLnmFP2sO4OPxJ4cI,371
|
10
|
-
diagram_to_iac/agents/demonstrator_langgraph/agent.py,sha256=
|
10
|
+
diagram_to_iac/agents/demonstrator_langgraph/agent.py,sha256=9ZH2H5iAB2DfMhCr-OzImVZlwoeXIP8RKl6_VG47W2I,35349
|
11
11
|
diagram_to_iac/agents/git_langgraph/__init__.py,sha256=x6nCnOu-Vcl-qVqW1swhdaE_sQqUSvEUUtWk4eePBUo,295
|
12
|
-
diagram_to_iac/agents/git_langgraph/agent.py,sha256=
|
12
|
+
diagram_to_iac/agents/git_langgraph/agent.py,sha256=bG3GHub62Rm8q9XrkLMN4kLBH6BTiLYrxQ9heNGsoCY,47640
|
13
13
|
diagram_to_iac/agents/git_langgraph/pr.py,sha256=qXopN5XAF1DIac5vbH-QasihkuAiWmC9JY8pLYlm-sQ,8601
|
14
14
|
diagram_to_iac/agents/hello_langgraph/__init__.py,sha256=lviuDAPJezmpaXR-H7JxfIT9wvg1xO2t6JLyeKSSx0Y,266
|
15
|
-
diagram_to_iac/agents/hello_langgraph/agent.py,sha256=
|
15
|
+
diagram_to_iac/agents/hello_langgraph/agent.py,sha256=R49yfFGxqMPBBu36ztDH9lBE_-s7VFyRB33gnNSXxek,33777
|
16
16
|
diagram_to_iac/agents/policy_agent/__init__.py,sha256=E6QEyIpSHh0PMRNnM0dXuYtz2HZdCJaY5W7UbEwPZBA,380
|
17
|
-
diagram_to_iac/agents/policy_agent/agent.py,sha256=
|
17
|
+
diagram_to_iac/agents/policy_agent/agent.py,sha256=dJLX3q2sYmwUGjs_qQOAlAvTfkEEYUalNCnBz1eeaBw,22296
|
18
18
|
diagram_to_iac/agents/policy_agent/integration_example.py,sha256=LtOGshT0VL6yuu5p8UtJ5xqKNweRsLqeyCZK18dnwBA,6703
|
19
19
|
diagram_to_iac/agents/policy_agent/tools/__init__.py,sha256=C9ez49BmMiaAlYs_QrtC0ypMLm1S-Sf9RCRI40-KuCA,282
|
20
20
|
diagram_to_iac/agents/policy_agent/tools/tfsec_tool.py,sha256=YYCRhwVLegeCzJrbah3BYhpKwYPh7PtDxB3kYW8qt10,10116
|
@@ -22,29 +22,30 @@ diagram_to_iac/agents/shell_langgraph/__init__.py,sha256=teAx1L87McCj9_24NUdET3O
|
|
22
22
|
diagram_to_iac/agents/shell_langgraph/agent.py,sha256=dZWzjVQ9oX_BtNHQ1Zrzy2oQpuY1e5BS51-SGcWpoSw,4341
|
23
23
|
diagram_to_iac/agents/shell_langgraph/detector.py,sha256=wLw0uDP_V2m1z6SRk7QNCzoUMYCfXwu3DNg8EWue9yk,1493
|
24
24
|
diagram_to_iac/agents/supervisor_langgraph/__init__.py,sha256=iLN60d20cqoXOLyuLvJkiwrzapE84em222Tnyndq2dc,385
|
25
|
-
diagram_to_iac/agents/supervisor_langgraph/agent.py,sha256=
|
25
|
+
diagram_to_iac/agents/supervisor_langgraph/agent.py,sha256=NdqYFyVw1bc4UK-IQOmcc1ZEIQVVakg1z5OC_uN_kqc,84790
|
26
26
|
diagram_to_iac/agents/supervisor_langgraph/demonstrator.py,sha256=OT-bElEyLZBedzcc5DtZnp1yhjYVjx4jRzt52f5SoSU,803
|
27
27
|
diagram_to_iac/agents/supervisor_langgraph/guards.py,sha256=XzBgjXnwbOgLkGm7AqXX4tQdGBerq_6pKvduKPqIwF0,720
|
28
28
|
diagram_to_iac/agents/supervisor_langgraph/pat_loop.py,sha256=feY8ZPGQxqkUuHOMSdpilGDUjOvaky8xImLuVe98hrw,1566
|
29
29
|
diagram_to_iac/agents/supervisor_langgraph/router.py,sha256=7hZXXEmtvG__w7UAaOhoPaHdubUv-oMKbQdMTMXk-qY,276
|
30
30
|
diagram_to_iac/agents/terraform_langgraph/__init__.py,sha256=N4_cTgk1wNZMS9WU5xZMEm6Dt5GiJ2b0iLx-QUhJd10,390
|
31
|
-
diagram_to_iac/agents/terraform_langgraph/agent.py,sha256=
|
31
|
+
diagram_to_iac/agents/terraform_langgraph/agent.py,sha256=lDaRCLcqShZiUGN25R-T94JTCLYaz4UgT_di3tDA0nE,50593
|
32
32
|
diagram_to_iac/agents/terraform_langgraph/parser.py,sha256=J56CPlpIEIPuDHeAOL3sz4TiIgqLi7raPlX7jwFrAms,2039
|
33
33
|
diagram_to_iac/core/__init__.py,sha256=VjXPYLIS2SAPIDniBkeA2EDK0VHJvdaKIC8dzVneaTM,140
|
34
34
|
diagram_to_iac/core/agent_base.py,sha256=DjZjcfzDpEhfIOki00XwQ-4lPli3OBcQ_7RNKsT7JSI,505
|
35
|
+
diagram_to_iac/core/config_loader.py,sha256=5kkOJoOZVMJhlVQOUu_gWXd26lrblxXtcphKYLhx8WA,10131
|
35
36
|
diagram_to_iac/core/enhanced_memory.py,sha256=Ga5wtI45zEcbwL_F1YqJaXBRpWK0iJPa69j4-V-ebvM,10951
|
36
37
|
diagram_to_iac/core/errors.py,sha256=gZwZocnIcBlS4YccIBdjG8XztRCtMe4Cu6KWxLzebDM,115
|
37
38
|
diagram_to_iac/core/issue_tracker.py,sha256=0eo289hn94yCoFCkLaYiDOIJBjk33i2dk6eLeYe_9YE,1659
|
38
|
-
diagram_to_iac/core/memory.py,sha256=
|
39
|
+
diagram_to_iac/core/memory.py,sha256=P9URX8m2nab65ZPF36uf6Z9hEXQGXrjrXa8dPXG7pm8,4444
|
39
40
|
diagram_to_iac/services/__init__.py,sha256=I5R8g7vYX4tCldRf1Jf9vEhm5mylc-MfFicqLnY6a3E,238
|
40
41
|
diagram_to_iac/services/observability.py,sha256=yxbnjMc4TO1SM8RZZMHf2E8uVOLpxFhiTjsTkymDi6Y,1856
|
41
42
|
diagram_to_iac/services/step_summary.py,sha256=g3MuMZ51IDubI0oWcF7qMvseNgDS6D90AsKK_1s5xDQ,2808
|
42
43
|
diagram_to_iac/tools/__init__.py,sha256=F2pcKhoPP5KDeQIGcqKXD1J30KFKc9qxMw1jxzrs9qY,434
|
43
|
-
diagram_to_iac/tools/api_utils.py,sha256=
|
44
|
-
diagram_to_iac/tools/sec_utils.py,sha256=
|
44
|
+
diagram_to_iac/tools/api_utils.py,sha256=5Grroc0Sbu3UXQB5rv4in6LMkyU_NkOwLbu9F2tmB18,9364
|
45
|
+
diagram_to_iac/tools/sec_utils.py,sha256=BeKM1k8e8BHw5BMyghDvwB8tlyV7g3rr-civIprmLDY,10032
|
45
46
|
diagram_to_iac/tools/text_utils.py,sha256=cnwOXWndd1QAlZC4zOO9jtF3_j4xozDLUTfzfJE9wWQ,9959
|
46
47
|
diagram_to_iac/tools/git/__init__.py,sha256=1V3_Kg_KzQ6er60N-1hqQeigkV8c4AvYq-R60_xmQ4o,1316
|
47
|
-
diagram_to_iac/tools/git/git.py,sha256=
|
48
|
+
diagram_to_iac/tools/git/git.py,sha256=0NYz9NqQWf-5YTX7R3nBPyLmzvih-jhd0gYY8KZDmTM,46501
|
48
49
|
diagram_to_iac/tools/hello/__init__.py,sha256=f6GpkiQxvuGaRMm34yQilGACxUI4c5edJQTDjZtskjQ,891
|
49
50
|
diagram_to_iac/tools/hello/cal_utils.py,sha256=B-0iOJHNL1IgYPlWUdrAwEf1r9LUKBAnGyx1xQz05ZE,1507
|
50
51
|
diagram_to_iac/tools/hello/text_utils.py,sha256=ZaVQYw6GVqaq9EDTQfG3gTAudeN8CuFUUb7IETZhUCA,3952
|
@@ -55,10 +56,10 @@ diagram_to_iac/tools/llm_utils/gemini_driver.py,sha256=VO1mJ3o10oSFo5hTBs6h8TJsX
|
|
55
56
|
diagram_to_iac/tools/llm_utils/openai_driver.py,sha256=ZqzXEYEutwqRw3qWx-GH85Mj2afxK4NlhCOMq_MabqQ,3962
|
56
57
|
diagram_to_iac/tools/llm_utils/router.py,sha256=WHGanstQjUlo2SmDFKGAL6xtIb3xXWlgZ5CIzHWN8I8,12906
|
57
58
|
diagram_to_iac/tools/shell/__init__.py,sha256=6UZjBcnbPabA6Qy7t4j-dCi3S2sE6sB2bTE9PIL98bA,292
|
58
|
-
diagram_to_iac/tools/shell/shell.py,sha256=
|
59
|
-
diagram_to_iac/tools/tf/terraform.py,sha256=
|
60
|
-
diagram_to_iac-1.0.
|
61
|
-
diagram_to_iac-1.0.
|
62
|
-
diagram_to_iac-1.0.
|
63
|
-
diagram_to_iac-1.0.
|
64
|
-
diagram_to_iac-1.0.
|
59
|
+
diagram_to_iac/tools/shell/shell.py,sha256=ZOJ7Vo3l_R2Gm6Ml2FL0RX__-C_JOsUrLJVvBMwAy9E,21122
|
60
|
+
diagram_to_iac/tools/tf/terraform.py,sha256=j1boWRo6JKpNGf1OwnWoWboO0gMYTizCOHDSxozoFZw,37343
|
61
|
+
diagram_to_iac-1.0.3.dist-info/METADATA,sha256=u03hdyylQnNt18ESYsD-1DrWd8tYcypOVfKykOUjXuQ,9019
|
62
|
+
diagram_to_iac-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
63
|
+
diagram_to_iac-1.0.3.dist-info/entry_points.txt,sha256=DfGCnmgWWGHtQpqU8VqcUWs5k_be-bfO67z1vOuTitA,277
|
64
|
+
diagram_to_iac-1.0.3.dist-info/top_level.txt,sha256=k1cV0YODiCUU46qlmbQaquMcbMXhNm05NZLxsinDUBA,15
|
65
|
+
diagram_to_iac-1.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|