griptape-nodes 0.45.1__py3-none-any.whl → 0.47.0__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.
- griptape_nodes/__init__.py +51 -14
- griptape_nodes/exe_types/core_types.py +65 -10
- griptape_nodes/exe_types/node_types.py +10 -0
- griptape_nodes/machines/node_resolution.py +10 -8
- griptape_nodes/node_library/workflow_registry.py +1 -1
- griptape_nodes/retained_mode/events/base_events.py +74 -1
- griptape_nodes/retained_mode/events/secrets_events.py +2 -0
- griptape_nodes/retained_mode/events/workflow_events.py +4 -2
- griptape_nodes/retained_mode/griptape_nodes.py +17 -13
- griptape_nodes/retained_mode/managers/agent_manager.py +8 -6
- griptape_nodes/retained_mode/managers/arbitrary_code_exec_manager.py +1 -1
- griptape_nodes/retained_mode/managers/config_manager.py +36 -45
- griptape_nodes/retained_mode/managers/flow_manager.py +98 -98
- griptape_nodes/retained_mode/managers/library_manager.py +51 -51
- griptape_nodes/retained_mode/managers/node_manager.py +122 -129
- griptape_nodes/retained_mode/managers/object_manager.py +9 -10
- griptape_nodes/retained_mode/managers/os_manager.py +31 -31
- griptape_nodes/retained_mode/managers/secrets_manager.py +5 -5
- griptape_nodes/retained_mode/managers/static_files_manager.py +18 -17
- griptape_nodes/retained_mode/managers/sync_manager.py +3 -2
- griptape_nodes/retained_mode/managers/version_compatibility_manager.py +84 -1
- griptape_nodes/retained_mode/managers/workflow_manager.py +221 -163
- griptape_nodes/retained_mode/retained_mode.py +22 -44
- griptape_nodes/version_compatibility/workflow_versions/__init__.py +1 -0
- griptape_nodes/version_compatibility/workflow_versions/v0_7_0/__init__.py +1 -0
- griptape_nodes/version_compatibility/workflow_versions/v0_7_0/local_executor_argument_addition.py +42 -0
- {griptape_nodes-0.45.1.dist-info → griptape_nodes-0.47.0.dist-info}/METADATA +1 -1
- {griptape_nodes-0.45.1.dist-info → griptape_nodes-0.47.0.dist-info}/RECORD +30 -27
- {griptape_nodes-0.45.1.dist-info → griptape_nodes-0.47.0.dist-info}/WHEEL +1 -1
- {griptape_nodes-0.45.1.dist-info → griptape_nodes-0.47.0.dist-info}/entry_points.txt +0 -0
|
@@ -9,7 +9,9 @@ from pydantic import ValidationError
|
|
|
9
9
|
from xdg_base_dirs import xdg_config_home
|
|
10
10
|
|
|
11
11
|
from griptape_nodes.retained_mode.events.app_events import AppInitializationComplete
|
|
12
|
-
from griptape_nodes.retained_mode.events.base_events import
|
|
12
|
+
from griptape_nodes.retained_mode.events.base_events import (
|
|
13
|
+
ResultPayload,
|
|
14
|
+
)
|
|
13
15
|
from griptape_nodes.retained_mode.events.config_events import (
|
|
14
16
|
GetConfigCategoryRequest,
|
|
15
17
|
GetConfigCategoryResultFailure,
|
|
@@ -353,39 +355,33 @@ class ConfigManager:
|
|
|
353
355
|
if request.category is None or request.category == "":
|
|
354
356
|
# Return the whole shebang. Start with the defaults and then layer on the user config.
|
|
355
357
|
contents = self.merged_config
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
return GetConfigCategoryResultSuccess(contents=contents)
|
|
358
|
+
result_details = "Successfully returned the entire config dictionary."
|
|
359
|
+
return GetConfigCategoryResultSuccess(contents=contents, result_details=result_details)
|
|
359
360
|
|
|
360
361
|
# See if we got something valid.
|
|
361
362
|
find_results = self.get_config_value(request.category)
|
|
362
363
|
if find_results is None:
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
return GetConfigCategoryResultFailure()
|
|
364
|
+
result_details = f"Attempted to get config details for category '{request.category}'. Failed because no such category could be found."
|
|
365
|
+
return GetConfigCategoryResultFailure(result_details=result_details)
|
|
366
366
|
|
|
367
367
|
if not isinstance(find_results, dict):
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
return GetConfigCategoryResultFailure()
|
|
368
|
+
result_details = f"Attempted to get config details for category '{request.category}'. Failed because this was was not a dictionary."
|
|
369
|
+
return GetConfigCategoryResultFailure(result_details=result_details)
|
|
371
370
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
return GetConfigCategoryResultSuccess(contents=find_results)
|
|
371
|
+
result_details = f"Successfully returned the config dictionary for section '{request.category}'."
|
|
372
|
+
return GetConfigCategoryResultSuccess(contents=find_results, result_details=result_details)
|
|
375
373
|
|
|
376
374
|
def on_handle_set_config_category_request(self, request: SetConfigCategoryRequest) -> ResultPayload:
|
|
377
375
|
# Validate the value is a dict
|
|
378
376
|
if not isinstance(request.contents, dict):
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
return SetConfigCategoryResultFailure()
|
|
377
|
+
result_details = f"Attempted to set config details for category '{request.category}'. Failed because the contents provided were not a dictionary."
|
|
378
|
+
return SetConfigCategoryResultFailure(result_details=result_details)
|
|
382
379
|
|
|
383
380
|
if request.category is None or request.category == "":
|
|
384
381
|
# Assign the whole shebang.
|
|
385
382
|
self._write_user_config_delta(request.contents)
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return SetConfigCategoryResultSuccess()
|
|
383
|
+
result_details = "Successfully assigned the entire config dictionary."
|
|
384
|
+
return SetConfigCategoryResultSuccess(result_details=result_details)
|
|
389
385
|
|
|
390
386
|
self.set_config_value(key=request.category, value=request.contents)
|
|
391
387
|
|
|
@@ -395,29 +391,26 @@ class ConfigManager:
|
|
|
395
391
|
for after_env_var in after_env_vars_set:
|
|
396
392
|
self._update_secret_from_env_var(after_env_var)
|
|
397
393
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return SetConfigCategoryResultSuccess()
|
|
394
|
+
result_details = f"Successfully assigned the config dictionary for section '{request.category}'."
|
|
395
|
+
return SetConfigCategoryResultSuccess(result_details=result_details)
|
|
401
396
|
|
|
402
397
|
def on_handle_get_config_value_request(self, request: GetConfigValueRequest) -> ResultPayload:
|
|
403
398
|
if request.category_and_key == "":
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return GetConfigValueResultFailure()
|
|
399
|
+
result_details = "Attempted to get config value but no category or key was specified."
|
|
400
|
+
return GetConfigValueResultFailure(result_details=result_details)
|
|
407
401
|
|
|
408
402
|
# See if we got something valid.
|
|
409
403
|
find_results = self.get_config_value(request.category_and_key)
|
|
410
404
|
if find_results is None:
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
return GetConfigValueResultFailure()
|
|
405
|
+
result_details = f"Attempted to get config value for category.key '{request.category_and_key}'. Failed because no such category.key could be found."
|
|
406
|
+
return GetConfigValueResultFailure(result_details=result_details)
|
|
414
407
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
return GetConfigValueResultSuccess(value=find_results)
|
|
408
|
+
result_details = f"Successfully returned the config value for section '{request.category_and_key}'."
|
|
409
|
+
return GetConfigValueResultSuccess(value=find_results, result_details=result_details)
|
|
418
410
|
|
|
419
411
|
def on_handle_get_config_path_request(self, request: GetConfigPathRequest) -> ResultPayload: # noqa: ARG002
|
|
420
|
-
|
|
412
|
+
result_details = "Successfully returned the config path."
|
|
413
|
+
return GetConfigPathResultSuccess(config_path=str(USER_CONFIG_PATH), result_details=result_details)
|
|
421
414
|
|
|
422
415
|
def on_handle_reset_config_request(self, request: ResetConfigRequest) -> ResultPayload: # noqa: ARG002
|
|
423
416
|
try:
|
|
@@ -425,11 +418,11 @@ class ConfigManager:
|
|
|
425
418
|
self._set_log_level(str(self.merged_config["log_level"]))
|
|
426
419
|
self.workspace_path = Path(self.merged_config["workspace_directory"])
|
|
427
420
|
|
|
428
|
-
|
|
421
|
+
result_details = "Successfully reset user configuration."
|
|
422
|
+
return ResetConfigResultSuccess(result_details=result_details)
|
|
429
423
|
except Exception as e:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
return ResetConfigResultFailure()
|
|
424
|
+
result_details = f"Attempted to reset user configuration but failed: {e}."
|
|
425
|
+
return ResetConfigResultFailure(result_details=result_details)
|
|
433
426
|
|
|
434
427
|
def _get_diff(self, old_value: Any, new_value: Any) -> dict[Any, Any]:
|
|
435
428
|
"""Generate a diff between the old and new values."""
|
|
@@ -469,9 +462,8 @@ class ConfigManager:
|
|
|
469
462
|
|
|
470
463
|
def on_handle_set_config_value_request(self, request: SetConfigValueRequest) -> ResultPayload:
|
|
471
464
|
if request.category_and_key == "":
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
return SetConfigValueResultFailure()
|
|
465
|
+
result_details = "Attempted to set config value but no category or key was specified."
|
|
466
|
+
return SetConfigValueResultFailure(result_details=result_details)
|
|
475
467
|
|
|
476
468
|
# Fetch the existing value (don't go to the env vars directly; we want the key)
|
|
477
469
|
old_value = self.get_config_value(request.category_and_key, should_load_env_var_if_detected=False)
|
|
@@ -497,16 +489,15 @@ class ConfigManager:
|
|
|
497
489
|
diff = self._get_diff(old_value_copy, request.value)
|
|
498
490
|
formatted_diff = self._format_diff(diff)
|
|
499
491
|
if formatted_diff:
|
|
500
|
-
|
|
492
|
+
result_details = f"Successfully updated {type(request.value).__name__} at '{request.category_and_key}'. Changes:\n{formatted_diff}"
|
|
501
493
|
else:
|
|
502
|
-
|
|
494
|
+
result_details = f"Successfully updated {type(request.value).__name__} at '{request.category_and_key}'. No changes detected."
|
|
503
495
|
else:
|
|
504
|
-
|
|
496
|
+
result_details = f"Successfully updated {type(request.value).__name__} at '{request.category_and_key}'"
|
|
505
497
|
else:
|
|
506
|
-
|
|
498
|
+
result_details = f"Successfully assigned the config value for '{request.category_and_key}':\n\tFROM '{old_value_copy}'\n\tTO: '{request.value}'"
|
|
507
499
|
|
|
508
|
-
|
|
509
|
-
return SetConfigValueResultSuccess()
|
|
500
|
+
return SetConfigValueResultSuccess(result_details=result_details)
|
|
510
501
|
|
|
511
502
|
def _write_user_config_delta(self, user_config_delta: dict) -> None:
|
|
512
503
|
"""Write the user configuration to the config file.
|